@agent-native/core-corpus 0.214.0 → 0.217.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 (1217) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +1 -1
  3. package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +61 -1
  4. package/corpus/templates/analytics/AGENTS.md +1 -1
  5. package/corpus/templates/analytics/CHANGELOG.md +2 -0
  6. package/corpus/templates/analytics/actions/get-session-replay-summary.ts +9 -65
  7. package/corpus/templates/analytics/actions/list-event-catalog.ts +1 -1
  8. package/corpus/templates/analytics/actions/list-session-outputs.ts +40 -0
  9. package/corpus/templates/analytics/actions/list-session-recordings.ts +17 -4
  10. package/corpus/templates/analytics/actions/view-screen.ts +29 -3
  11. package/corpus/templates/analytics/app/i18n/en-US.ts +27 -0
  12. package/corpus/templates/analytics/app/pages/sessions/EventCatalogPage.tsx +18 -1
  13. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +3 -1
  14. package/corpus/templates/analytics/app/pages/sessions/SessionOutputs.tsx +197 -0
  15. package/corpus/templates/analytics/app/pages/sessions/SessionsTriagePage.tsx +114 -4
  16. package/corpus/templates/analytics/changelog/2026-10-15-sessions-can-find-people-who-made-a-slides-deck-but-didn-t-p.md +6 -0
  17. package/corpus/templates/analytics/changelog/2026-10-16-the-activation-funnel-counts-visitors-who-decline-analytics-.md +6 -0
  18. package/corpus/templates/analytics/changelog/2026-10-21-session-replay-quotas-count-the-compressed-size-analytics-st.md +6 -0
  19. package/corpus/templates/analytics/server/db/schema.ts +67 -0
  20. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -0
  21. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +28 -22
  22. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +36 -1
  23. package/corpus/templates/analytics/server/lib/output-outcomes.ts +712 -0
  24. package/corpus/templates/analytics/server/lib/replay-origins.ts +33 -0
  25. package/corpus/templates/analytics/server/lib/session-event-index.ts +20 -0
  26. package/corpus/templates/analytics/server/lib/session-performance.ts +6 -40
  27. package/corpus/templates/analytics/server/lib/session-recording-associations.ts +30 -1
  28. package/corpus/templates/analytics/server/lib/session-replay-triage.ts +99 -0
  29. package/corpus/templates/analytics/server/lib/session-replay.ts +85 -40
  30. package/corpus/templates/analytics/server/lib/sessions-triage-lab.ts +8 -2
  31. package/corpus/templates/analytics/server/plugins/db.ts +46 -0
  32. package/corpus/templates/analytics/shared/output-use.ts +205 -0
  33. package/corpus/templates/analytics/shared/session-events.ts +6 -0
  34. package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +1 -1
  35. package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +1 -1
  36. package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +1 -1
  37. package/corpus/templates/calendar/CHANGELOG.md +6 -0
  38. package/corpus/templates/calendar/actions/create-event.ts +2 -4
  39. package/corpus/templates/calendar/actions/update-event.ts +35 -6
  40. package/corpus/templates/calendar/changelog/2026-10-21-solo-events-avoid-notification-approval.md +6 -0
  41. package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +1 -1
  42. package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +1 -1
  43. package/corpus/templates/community/qr/package.json +1 -1
  44. package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +1 -1
  45. package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +36 -0
  46. package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +10 -0
  47. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +17 -3
  48. package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +4 -2
  49. package/corpus/templates/content/CHANGELOG.md +54 -0
  50. package/corpus/templates/content/acceptance/_writers.ts +604 -0
  51. package/corpus/templates/content/acceptance/generate-action-registry.ts +10 -0
  52. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/create-document.json +75 -0
  53. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/duplicate-page.json +75 -0
  54. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace-without-a-revision.json +75 -0
  55. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace.json +75 -0
  56. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-initializecontent.json +75 -0
  57. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/import-content.json +75 -0
  58. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-existing-page.json +75 -0
  59. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-new-page.json +75 -0
  60. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-changed-file.json +75 -0
  61. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-new-file.json +75 -0
  62. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/restore-document-version.json +75 -0
  63. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-document-property-primary-blocks-field.json +75 -0
  64. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-image-alt-text.json +75 -0
  65. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/undo-content-import.json +75 -0
  66. package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/update-document-browser-full-rewrite.json +75 -0
  67. package/corpus/templates/content/acceptance/known-loss.ts +69 -0
  68. package/corpus/templates/content/acceptance/round-trip-corpus.ts +1397 -0
  69. package/corpus/templates/content/actions/_blocks-field-identity.ts +35 -1
  70. package/corpus/templates/content/actions/_browser-document-save-attempt.ts +23 -1
  71. package/corpus/templates/content/actions/_builder-cms-blob-custody.ts +467 -0
  72. package/corpus/templates/content/actions/_builder-cms-execution-lease.ts +17 -0
  73. package/corpus/templates/content/actions/_builder-cms-intent-lookup.ts +5 -0
  74. package/corpus/templates/content/actions/_builder-cms-read-client.ts +881 -21
  75. package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +28 -2
  76. package/corpus/templates/content/actions/_builder-cms-write-client.ts +109 -11
  77. package/corpus/templates/content/actions/_builder-docs-client.ts +1 -0
  78. package/corpus/templates/content/actions/_builder-private-blob.test-fixture.ts +90 -0
  79. package/corpus/templates/content/actions/_builder-source-execution-guard.ts +48 -0
  80. package/corpus/templates/content/actions/_content-database-lifecycle.ts +11 -11
  81. package/corpus/templates/content/actions/_content-database-personal-view.ts +2 -0
  82. package/corpus/templates/content/actions/_content-favorites.ts +37 -0
  83. package/corpus/templates/content/actions/_content-save-outcomes.ts +5 -0
  84. package/corpus/templates/content/actions/_database-membership-lock.ts +39 -8
  85. package/corpus/templates/content/actions/_database-navigation.ts +19 -21
  86. package/corpus/templates/content/actions/_database-row-batch.ts +41 -18
  87. package/corpus/templates/content/actions/_database-row-mutation.ts +17 -28
  88. package/corpus/templates/content/actions/_database-source-utils.ts +308 -9
  89. package/corpus/templates/content/actions/_database-utils.ts +96 -7
  90. package/corpus/templates/content/actions/_database-view-setup.ts +37 -2
  91. package/corpus/templates/content/actions/_delete-content-space.ts +8 -1
  92. package/corpus/templates/content/actions/_document-edit-mutation.ts +33 -32
  93. package/corpus/templates/content/actions/_document-flush.ts +593 -171
  94. package/corpus/templates/content/actions/_document-save-locks.ts +54 -0
  95. package/corpus/templates/content/actions/_document-save-row.ts +133 -0
  96. package/corpus/templates/content/actions/_github-source-freshness.ts +30 -4
  97. package/corpus/templates/content/actions/_github-source.ts +18 -8
  98. package/corpus/templates/content/actions/_move-page-to-space.ts +189 -25
  99. package/corpus/templates/content/actions/_nfm-syntax.ts +2 -0
  100. package/corpus/templates/content/actions/_row-lock-order.ts +115 -0
  101. package/corpus/templates/content/actions/add-content-database-source-field-property.ts +23 -6
  102. package/corpus/templates/content/actions/cancel-prepared-builder-source-update.ts +110 -26
  103. package/corpus/templates/content/actions/change-content-database-source-role.ts +51 -7
  104. package/corpus/templates/content/actions/create-content-database.ts +11 -0
  105. package/corpus/templates/content/actions/create-document.ts +13 -1
  106. package/corpus/templates/content/actions/delete-content-database.ts +17 -14
  107. package/corpus/templates/content/actions/delete-document-property.ts +5 -0
  108. package/corpus/templates/content/actions/delete-document.ts +311 -100
  109. package/corpus/templates/content/actions/disconnect-content-database-source.ts +68 -2
  110. package/corpus/templates/content/actions/disconnect-local-folder-source.ts +33 -2
  111. package/corpus/templates/content/actions/edit-document.ts +18 -5
  112. package/corpus/templates/content/actions/execute-builder-source-execution.ts +900 -140
  113. package/corpus/templates/content/actions/export-document.ts +3 -0
  114. package/corpus/templates/content/actions/get-blocks-field-word-count.ts +22 -5
  115. package/corpus/templates/content/actions/get-document.ts +2 -0
  116. package/corpus/templates/content/actions/import-content-source.ts +170 -54
  117. package/corpus/templates/content/actions/move-document.ts +191 -73
  118. package/corpus/templates/content/actions/permanently-delete-document.ts +6 -0
  119. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +155 -13
  120. package/corpus/templates/content/actions/prepare-builder-source-review.ts +299 -73
  121. package/corpus/templates/content/actions/pull-document.ts +8 -2
  122. package/corpus/templates/content/actions/remove-database-items.ts +23 -4
  123. package/corpus/templates/content/actions/restore-content-database.ts +76 -55
  124. package/corpus/templates/content/actions/restore-document-version.ts +19 -35
  125. package/corpus/templates/content/actions/restore-document.ts +65 -53
  126. package/corpus/templates/content/actions/rollback-created-slash-document.ts +11 -16
  127. package/corpus/templates/content/actions/set-document-property.ts +15 -1
  128. package/corpus/templates/content/actions/set-live-body-switch.ts +45 -0
  129. package/corpus/templates/content/actions/share-local-file-document.ts +18 -14
  130. package/corpus/templates/content/actions/suggest-document-edit.ts +2 -3
  131. package/corpus/templates/content/actions/sync-local-folder-source.ts +35 -1
  132. package/corpus/templates/content/actions/undo-content-import.ts +16 -12
  133. package/corpus/templates/content/actions/update-content-database-view.ts +2 -0
  134. package/corpus/templates/content/actions/update-document.ts +158 -34
  135. package/corpus/templates/content/actions/validate-builder-source-execution.ts +135 -26
  136. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -6
  137. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +49 -3
  138. package/corpus/templates/content/app/components/editor/ContentImportDialog.tsx +2 -0
  139. package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +53 -11
  140. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +608 -353
  141. package/corpus/templates/content/app/components/editor/StaticDocumentBody.tsx +765 -0
  142. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +233 -80
  143. package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +32 -3
  144. package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +88 -23
  145. package/corpus/templates/content/app/components/editor/comment-anchors.ts +19 -0
  146. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +228 -71
  147. package/corpus/templates/content/app/components/editor/database/GitHubSourceStatusLine.tsx +27 -2
  148. package/corpus/templates/content/app/components/editor/database/ListItemLayout.tsx +32 -8
  149. package/corpus/templates/content/app/components/editor/database/ListItemRow.tsx +27 -2
  150. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +1 -0
  151. package/corpus/templates/content/app/components/editor/document-flush-participant.ts +253 -0
  152. package/corpus/templates/content/app/components/editor/editor-transaction-meta.ts +28 -0
  153. package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +2 -1
  154. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +27 -6
  155. package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +0 -1
  156. package/corpus/templates/content/app/components/editor/extensions/NotionExtensions.tsx +4 -4
  157. package/corpus/templates/content/app/components/editor/extensions/SuggestionHighlight.ts +24 -2
  158. package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +25 -6
  159. package/corpus/templates/content/app/components/editor/pending-document-persistence.ts +59 -1
  160. package/corpus/templates/content/app/components/editor/stored-body-images.ts +27 -0
  161. package/corpus/templates/content/app/components/editor/suggestions/presentation-rebase.ts +17 -0
  162. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -4
  163. package/corpus/templates/content/app/components/trash/TrashBrowser.tsx +4 -1
  164. package/corpus/templates/content/app/global.css +21 -0
  165. package/corpus/templates/content/app/hooks/use-content-database.ts +40 -2
  166. package/corpus/templates/content/app/hooks/use-content-trash.ts +8 -0
  167. package/corpus/templates/content/app/hooks/use-documents.ts +14 -0
  168. package/corpus/templates/content/app/i18n-data.ts +1 -0
  169. package/corpus/templates/content/app/import-messages.ts +25 -0
  170. package/corpus/templates/content/app/trash-messages.ts +16 -0
  171. package/corpus/templates/content/changelog/2026-10-16-a-page-open-in-a-tab-that-shows-it-s-in-the-trash-reopens-wi.md +6 -0
  172. package/corpus/templates/content/changelog/2026-10-16-a-page-restored-from-trash-returns-to-its-place-in-its-colle.md +6 -0
  173. package/corpus/templates/content/changelog/2026-10-16-agent-written-markdown-keeps-nested-lists-indented-with-spac.md +6 -0
  174. package/corpus/templates/content/changelog/2026-10-16-opening-a-page-you-can-edit-no-longer-rebuilds-its-editor-on.md +6 -0
  175. package/corpus/templates/content/changelog/2026-10-16-pages-moved-or-imported-at-the-same-time-can-no-longer-end-u.md +6 -0
  176. package/corpus/templates/content/changelog/2026-10-16-re-importing-a-markdown-export-of-a-page-no-longer-reports-t.md +6 -0
  177. package/corpus/templates/content/changelog/2026-10-16-saving-a-page-or-restoring-one-of-its-versions-no-longer-fai.md +6 -0
  178. package/corpus/templates/content/changelog/2026-10-17-agents-reading-a-page-you-have-open-no-longer-wait-or-fail-w.md +6 -0
  179. package/corpus/templates/content/changelog/2026-10-17-builder-content-avoids-retrying-a-write-when-builder-accepte.md +6 -0
  180. package/corpus/templates/content/changelog/2026-10-18-link-a-new-collection-to-a-github-folder-from-its-sources.md +1 -1
  181. package/corpus/templates/content/changelog/2026-10-19-fresh-document-reads-require-confirmation-from-every-open-ed.md +6 -0
  182. package/corpus/templates/content/changelog/2026-10-20-builder-content-sync-keeps-read-and-write-status-accurate-wh.md +6 -0
  183. package/corpus/templates/content/changelog/2026-10-20-html-table-cells-preserve-a-trailing-backslash-when-opening-.md +6 -0
  184. package/corpus/templates/content/changelog/2026-10-20-preserve-empty-paragraph-colors-and-refuse-unsupported-inlin.md +6 -0
  185. package/corpus/templates/content/changelog/2026-10-20-the-advanced-filter-and-each-filter-group-inside-it-have-the.md +6 -0
  186. package/corpus/templates/content/changelog/2026-10-21-blocks-fields-keep-unconfirmed-saves-visible-and-agent-reads.md +6 -0
  187. package/corpus/templates/content/changelog/2026-10-21-list-rows-can-show-each-pages-first-lines.md +6 -0
  188. package/corpus/templates/content/changelog/2026-10-21-preserve-compact-table-row-groups-and-report-invalid-block-colors.md +6 -0
  189. package/corpus/templates/content/changelog/2026-10-21-suggested-edits-show-an-agent-s-whole-reason-open-a-group-to.md +6 -0
  190. package/corpus/templates/content/changelog/2026-10-21-suggestions-keep-refusing-unmatched-emphasis-in-stored-markd.md +6 -0
  191. package/corpus/templates/content/changelog/2026-10-22-a-collection-linked-to-a-big-github-folder-fills-faster-and-p.md +6 -0
  192. package/corpus/templates/content/changelog/2026-10-22-accept-remaining-and-reject-remaining-show-the-result-for-ev.md +6 -0
  193. package/corpus/templates/content/changelog/2026-10-22-accepting-a-group-of-suggested-edits-saves-faster-and-adds-o.md +6 -0
  194. package/corpus/templates/content/changelog/2026-10-22-agents-read-saved-page-text-after-failed-icon-change.md +6 -0
  195. package/corpus/templates/content/changelog/2026-10-22-changes-made-from-a-menu-or-popover-such-as-an-image-s-alt-t.md +6 -0
  196. package/corpus/templates/content/changelog/2026-10-22-text-an-agent-writes-inside-a-callout-column-or-synced-block.md +6 -0
  197. package/corpus/templates/content/docs/product/capabilities/content.source.adapters.md +29 -0
  198. package/corpus/templates/content/e2e/auth-files.ts +28 -0
  199. package/corpus/templates/content/e2e/convergence-summary.ts +84 -29
  200. package/corpus/templates/content/e2e/gate-arm.ts +15 -0
  201. package/corpus/templates/content/e2e/global-setup.ts +43 -75
  202. package/corpus/templates/content/e2e/global-teardown.ts +34 -0
  203. package/corpus/templates/content/e2e/helpers.ts +598 -92
  204. package/corpus/templates/content/e2e/live-body-gate.ts +188 -0
  205. package/corpus/templates/content/e2e/playwright.config.ts +12 -3
  206. package/corpus/templates/content/e2e/server-identity.ts +47 -0
  207. package/corpus/templates/content/e2e/stored-form/collab-blocks.ts +123 -0
  208. package/corpus/templates/content/package.json +1 -1
  209. package/corpus/templates/content/parity/matrix.md +42 -42
  210. package/corpus/templates/content/parity/matrix.ts +3 -1
  211. package/corpus/templates/content/scripts/_stored-form-census-kinds.ts +30 -2
  212. package/corpus/templates/content/scripts/historical-icon-apply.ts +9 -1
  213. package/corpus/templates/content/scripts/trace-startup.mjs +460 -133
  214. package/corpus/templates/content/server/db/exec.ts +58 -0
  215. package/corpus/templates/content/server/db/schema.ts +21 -0
  216. package/corpus/templates/content/server/lib/content-trash-purge.ts +222 -144
  217. package/corpus/templates/content/server/lib/document-metadata-updated-at.ts +43 -1
  218. package/corpus/templates/content/server/lib/document-revision.ts +23 -0
  219. package/corpus/templates/content/server/lib/live-body-writer.ts +311 -0
  220. package/corpus/templates/content/server/lib/notion-sync.ts +63 -29
  221. package/corpus/templates/content/server/lib/notion.ts +5 -5
  222. package/corpus/templates/content/server/lib/suggested-edits.ts +357 -230
  223. package/corpus/templates/content/server/live-copy/binding.ts +31 -0
  224. package/corpus/templates/content/server/live-copy/bounded-task.d.ts +6 -0
  225. package/corpus/templates/content/server/live-copy/exec-db.ts +1 -0
  226. package/corpus/templates/content/server/live-copy/holds.ts +59 -0
  227. package/corpus/templates/content/server/live-copy/persist.ts +656 -0
  228. package/corpus/templates/content/server/live-copy/switch.ts +136 -0
  229. package/corpus/templates/content/server/live-copy/task-names.ts +4 -0
  230. package/corpus/templates/content/server/live-copy/tasks.ts +183 -0
  231. package/corpus/templates/content/server/live-copy/write-cause.ts +85 -0
  232. package/corpus/templates/content/server/live-copy/write.ts +85 -0
  233. package/corpus/templates/content/server/plugins/builder-private-payload-cleanup.ts +22 -0
  234. package/corpus/templates/content/server/plugins/collab.ts +3 -0
  235. package/corpus/templates/content/server/plugins/db.ts +33 -0
  236. package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +50 -168
  237. package/corpus/templates/content/shared/api.ts +32 -1
  238. package/corpus/templates/content/shared/blocks-fields-manifest.ts +106 -0
  239. package/corpus/templates/content/shared/database-item-layout.ts +54 -22
  240. package/corpus/templates/content/shared/database-query.ts +192 -30
  241. package/corpus/templates/content/shared/document-export.ts +12 -14
  242. package/corpus/templates/content/shared/document-flush-protocol.ts +88 -0
  243. package/corpus/templates/content/shared/document-intent-merge.ts +16 -9
  244. package/corpus/templates/content/shared/editor-save-state.ts +97 -0
  245. package/corpus/templates/content/shared/feature-flags.ts +10 -0
  246. package/corpus/templates/content/shared/import/markdown.ts +91 -7
  247. package/corpus/templates/content/shared/import/types.ts +2 -0
  248. package/corpus/templates/content/shared/inline-math.ts +6 -4
  249. package/corpus/templates/content/shared/nfm-fidelity.ts +247 -0
  250. package/corpus/templates/content/shared/nfm.ts +1933 -340
  251. package/corpus/templates/content/shared/og-description.ts +258 -36
  252. package/corpus/templates/content/shared/suggestion-diff.ts +13 -0
  253. package/corpus/templates/content/shared/suggestion-formatting.ts +143 -20
  254. package/corpus/templates/content/shared/suggestion-text.ts +39 -0
  255. package/corpus/templates/content/vitest.config.ts +10 -0
  256. package/corpus/templates/crm/.agents/skills/actions/references/action-fields.md +1 -1
  257. package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +1 -1
  258. package/corpus/templates/design/.agents/skills/design-templates/SKILL.md +5 -1
  259. package/corpus/templates/design/.agents/skills/native-effects/SKILL.md +9 -2
  260. package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +3 -249
  261. package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +30 -92
  262. package/corpus/templates/design/AGENTS.md +1 -3
  263. package/corpus/templates/design/CHANGELOG.md +34 -0
  264. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1 -6
  265. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +5 -7
  266. package/corpus/templates/design/actions/_native-local-export-server.ts +44 -31
  267. package/corpus/templates/design/actions/_native-render-contexts.ts +76 -21
  268. package/corpus/templates/design/actions/claim-native-local-export.ts +5 -0
  269. package/corpus/templates/design/actions/finish-native-local-export.ts +13 -2
  270. package/corpus/templates/design/actions/get-getting-started.ts +53 -0
  271. package/corpus/templates/design/actions/get-native-shader-approvals.ts +35 -0
  272. package/corpus/templates/design/actions/get-shader.ts +134 -219
  273. package/corpus/templates/design/actions/list-design-extensions.ts +3 -58
  274. package/corpus/templates/design/actions/request-native-local-export.ts +32 -6
  275. package/corpus/templates/design/actions/run-design-extension-action.ts +0 -29
  276. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +141 -108
  277. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +0 -218
  278. package/corpus/templates/design/app/components/design/DesignThumbnail.tsx +59 -3
  279. package/corpus/templates/design/app/components/design/EditPanel.tsx +35 -47
  280. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +242 -62
  281. package/corpus/templates/design/app/components/design/NativePreviewErrorBoundary.tsx +53 -0
  282. package/corpus/templates/design/app/components/design/bridge/codegen.ts +18 -3
  283. package/corpus/templates/design/app/components/design/bridge/native-composition-clock.ts +5 -4
  284. package/corpus/templates/design/app/components/design/bridge/native-dom.ts +37 -0
  285. package/corpus/templates/design/app/components/design/bridge/native-intrinsic-image.ts +2 -1
  286. package/corpus/templates/design/app/components/design/bridge/native-mesh-grid.ts +90 -0
  287. package/corpus/templates/design/app/components/design/bridge/native-opaque-public-asset.ts +363 -0
  288. package/corpus/templates/design/app/components/design/bridge/native-opaque-worker-lease.ts +179 -0
  289. package/corpus/templates/design/app/components/design/bridge/native-preview-geometry.ts +132 -7
  290. package/corpus/templates/design/app/components/design/bridge/native-preview-policy.ts +4 -0
  291. package/corpus/templates/design/app/components/design/bridge/native-preview-viewport-transport.ts +378 -0
  292. package/corpus/templates/design/app/components/design/bridge/native-scene-body-transform.ts +62 -0
  293. package/corpus/templates/design/app/components/design/bridge/native-scene-presentation-element.ts +10 -0
  294. package/corpus/templates/design/app/components/design/bridge/native-shader-runtime.bridge.ts +778 -246
  295. package/corpus/templates/design/app/components/design/bridge/native-source-provider.ts +512 -320
  296. package/corpus/templates/design/app/components/design/bridge/native-stateful-resource.ts +2 -2
  297. package/corpus/templates/design/app/components/design/bridge/native-stateless-compute.ts +5 -2
  298. package/corpus/templates/design/app/components/design/bridge/native-svg-source.ts +11 -1
  299. package/corpus/templates/design/app/components/design/bridge/native-worker-broker.ts +6 -0
  300. package/corpus/templates/design/app/components/design/bridge/native-worker-entry.ts +761 -303
  301. package/corpus/templates/design/app/components/design/bridge/native-worker-fill.ts +16 -6
  302. package/corpus/templates/design/app/components/design/bridge/native-worker-gpu.ts +854 -91
  303. package/corpus/templates/design/app/components/design/bridge/native-worker-host.ts +15 -1
  304. package/corpus/templates/design/app/components/design/bridge/native-worker-input-assets.ts +200 -0
  305. package/corpus/templates/design/app/components/design/bridge/native-worker-protocol.ts +40 -1
  306. package/corpus/templates/design/app/components/design/bridge/native-worker-scene-host.ts +540 -161
  307. package/corpus/templates/design/app/components/design/bridge/native-worker-source-snapshot.ts +21 -0
  308. package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +5 -371
  309. package/corpus/templates/design/app/components/design/bridge/shader-runtime.bridge.ts +45 -150
  310. package/corpus/templates/design/app/components/design/design-canvas/interact-document.ts +5 -9
  311. package/corpus/templates/design/app/components/design/design-canvas/native-preview-surface.ts +150 -0
  312. package/corpus/templates/design/app/components/design/design-canvas/native-public-asset-preview.ts +409 -0
  313. package/corpus/templates/design/app/components/design/design-canvas/native-public-worker-preview.ts +1086 -0
  314. package/corpus/templates/design/app/components/design/design-canvas/private-replay-screenshot-preview.ts +2 -2
  315. package/corpus/templates/design/app/components/design/design-canvas/text-content-change-result.ts +46 -12
  316. package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +15 -26
  317. package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +74 -67
  318. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +7 -19
  319. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +39 -30
  320. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +4 -0
  321. package/corpus/templates/design/app/components/design/inspector/NativeShaderColorControls.tsx +3 -7
  322. package/corpus/templates/design/app/components/design/inspector/NativeShaderPaintControls.tsx +12 -5
  323. package/corpus/templates/design/app/components/design/inspector/NativeShaderPanel.tsx +705 -190
  324. package/corpus/templates/design/app/components/design/inspector/fill-field-reading.ts +1 -2
  325. package/corpus/templates/design/app/components/design/inspector/index.ts +0 -6
  326. package/corpus/templates/design/app/components/design/inspector/native-catalog-display.ts +26 -5
  327. package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-fixture.ts +42 -0
  328. package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-preview.ts +51 -33
  329. package/corpus/templates/design/app/components/design/inspector/native-shader-paint.ts +1 -0
  330. package/corpus/templates/design/app/components/design/inspector/native-shader-property-draft.ts +89 -23
  331. package/corpus/templates/design/app/components/design/inspector/saved-glsl-shader.tsx +243 -0
  332. package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +54 -5
  333. package/corpus/templates/design/app/components/design/shader-source-coordination.ts +66 -0
  334. package/corpus/templates/design/app/components/design/use-native-shader-approvals.ts +36 -8
  335. package/corpus/templates/design/app/components/home/DesignHomeLibrary.tsx +15 -8
  336. package/corpus/templates/design/app/components/layout/GettingStarted.tsx +50 -0
  337. package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -0
  338. package/corpus/templates/design/app/components/templates/DesignTemplateGrid.tsx +163 -0
  339. package/corpus/templates/design/app/components/templates/DesignTemplateLibrary.tsx +65 -78
  340. package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +66 -5
  341. package/corpus/templates/design/app/global.css +6 -0
  342. package/corpus/templates/design/app/i18n/en-US.ts +95 -2
  343. package/corpus/templates/design/app/lib/canvas-load-outcome.ts +147 -0
  344. package/corpus/templates/design/app/lib/canvas-outcome-tracking.ts +531 -0
  345. package/corpus/templates/design/app/lib/canvas-style-kind.ts +50 -0
  346. package/corpus/templates/design/app/pages/Index.tsx +10 -3
  347. package/corpus/templates/design/app/pages/Present.tsx +36 -1
  348. package/corpus/templates/design/app/pages/design-editor/commands/apply-file-content-update.ts +1 -1
  349. package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +1 -1
  350. package/corpus/templates/design/app/pages/design-editor/commands/commit-visual-styles.ts +88 -32
  351. package/corpus/templates/design/app/pages/design-editor/commands/cross-screen-element-drop.ts +1 -1
  352. package/corpus/templates/design/app/pages/design-editor/commands/layer-move-to-screen.ts +1 -1
  353. package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +1 -1
  354. package/corpus/templates/design/app/pages/design-editor/commands/paste-svg-layer.ts +1 -1
  355. package/corpus/templates/design/app/pages/design-editor/commands/prepare-content-history-replay.ts +1 -1
  356. package/corpus/templates/design/app/pages/design-editor/commands/redo.ts +1 -1
  357. package/corpus/templates/design/app/pages/design-editor/commands/render-png-blob.ts +84 -41
  358. package/corpus/templates/design/app/pages/design-editor/commands/save-file-content.ts +38 -3
  359. package/corpus/templates/design/app/pages/design-editor/commands/shader-source-edit.ts +1 -1
  360. package/corpus/templates/design/app/pages/design-editor/commands/undo.ts +1 -1
  361. package/corpus/templates/design/app/pages/design-editor/design-editor-view.tsx +0 -2
  362. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-content-and-components.ts +4 -33
  363. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-core.ts +9 -0
  364. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-export-and-handoff.ts +2 -2
  365. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-files-and-saving.ts +2 -0
  366. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-history.ts +0 -11
  367. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-layer-models.ts +2 -55
  368. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-screen-rendering.tsx +0 -3
  369. package/corpus/templates/design/app/pages/design-editor/domains/use-editor-selection-and-styles.ts +0 -24
  370. package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +0 -16
  371. package/corpus/templates/design/app/pages/design-editor/use-native-local-export-requests.ts +70 -11
  372. package/corpus/templates/design/app/pages/design-editor/view/single-screen-canvas.tsx +0 -2
  373. package/corpus/templates/design/changelog/2026-10-20-folded-mesh-adds-an-animated-sculpted-fill-with-editable-col.md +6 -0
  374. package/corpus/templates/design/changelog/2026-10-20-read-only-design-views-render-native-shader-previews-in-nest.md +6 -0
  375. package/corpus/templates/design/changelog/2026-10-20-selected-screens-with-shader-effects-can-be-exported-togethe.md +6 -0
  376. package/corpus/templates/design/changelog/2026-10-20-shader-previews-reuse-validated-scene-data-while-panning-inc.md +6 -0
  377. package/corpus/templates/design/changelog/2026-10-20-shader-previews-stay-aligned-while-you-zoom.md +6 -0
  378. package/corpus/templates/design/changelog/2026-10-20-signed-out-sessions-no-longer-watch-for-private-png-export-r.md +6 -0
  379. package/corpus/templates/design/changelog/2026-10-21-a-getting-started-checklist-at-the-bottom-of-the-sidebar-tra.md +6 -0
  380. package/corpus/templates/design/changelog/2026-10-21-effect-thumbnails-show-richer-previews.md +6 -0
  381. package/corpus/templates/design/changelog/2026-10-21-native-effects-render-across-previews.md +6 -0
  382. package/corpus/templates/design/changelog/2026-10-21-native-shader-previews-use-less-gpu-memory-when-many-mesh-ef.md +6 -0
  383. package/corpus/templates/design/changelog/2026-10-21-opening-design-no-longer-shows-png-export-errors-when-no-exp.md +6 -0
  384. package/corpus/templates/design/changelog/2026-10-21-pulsing-border-controls-grouped.md +6 -0
  385. package/corpus/templates/design/changelog/2026-10-21-pulsing-border-follows-element-outlines.md +6 -0
  386. package/corpus/templates/design/changelog/2026-10-21-remove-obsolete-shader-fills.md +6 -0
  387. package/corpus/templates/design/changelog/2026-10-21-shader-previews-recover-from-temporary-gpu-and-image-failure.md +6 -0
  388. package/corpus/templates/design/changelog/2026-10-21-templates-now-open-a-read-only-preview-from-the-card-and-the.md +6 -0
  389. package/corpus/templates/design/changelog/2026-10-22-collapsed-shader-layers-no-longer-interrupt-other-shaders-on.md +6 -0
  390. package/corpus/templates/design/changelog/2026-10-22-shader-fills-and-effects-render-correctly-on-canvas-elements.md +6 -0
  391. package/corpus/templates/design/changelog/2026-10-22-shader-fills-keep-rendering-when-other-screen-content-cannot.md +6 -0
  392. package/corpus/templates/design/package.json +0 -1
  393. package/corpus/templates/design/playwright.config.ts +1 -1
  394. package/corpus/templates/design/scripts/design-export-validation/export-baseline.json +24 -0
  395. package/corpus/templates/design/scripts/runtime-budget-zoom.ts +9 -21
  396. package/corpus/templates/design/scripts/runtime-budget.ts +10 -24
  397. package/corpus/templates/design/server/lib/getting-started.ts +267 -0
  398. package/corpus/templates/design/server/plugins/agent-chat.ts +0 -2
  399. package/corpus/templates/design/server/plugins/getting-started.ts +5 -0
  400. package/corpus/templates/design/shared/design-template-presets/analytics-dashboard.ts +127 -0
  401. package/corpus/templates/design/shared/design-template-presets/design-studio.ts +98 -0
  402. package/corpus/templates/design/shared/design-template-presets/messaging-app.ts +101 -0
  403. package/corpus/templates/design/shared/design-template-presets/project-tasks.ts +120 -0
  404. package/corpus/templates/design/shared/design-template-presets.ts +8 -0
  405. package/corpus/templates/design/shared/effect-graph.ts +46 -1
  406. package/corpus/templates/design/shared/generation-output-receipt.ts +0 -1
  407. package/corpus/templates/design/shared/native-effect-animation-capability.ts +6 -0
  408. package/corpus/templates/design/shared/native-effect-folded-mesh-v1.ts +268 -0
  409. package/corpus/templates/design/shared/native-effect-folded-mesh-v2.ts +310 -0
  410. package/corpus/templates/design/shared/native-effect-folded-mesh.ts +489 -0
  411. package/corpus/templates/design/shared/native-effect-gallery-additions.ts +2 -2
  412. package/corpus/templates/design/shared/native-effect-paint.ts +8 -0
  413. package/corpus/templates/design/shared/native-effect-parameter-constraints.ts +8 -1
  414. package/corpus/templates/design/shared/native-effect-presets.ts +18 -1
  415. package/corpus/templates/design/shared/native-effect-property-presentation.ts +81 -0
  416. package/corpus/templates/design/shared/native-effect-pulsing-border-v3.ts +281 -0
  417. package/corpus/templates/design/shared/native-effect-pulsing-border-v4.ts +284 -0
  418. package/corpus/templates/design/shared/native-effect-pulsing-border.ts +300 -0
  419. package/corpus/templates/design/shared/native-effect-trust.ts +6 -0
  420. package/corpus/templates/design/shared/native-effect-wgsl.ts +12 -0
  421. package/corpus/templates/design/shared/native-effects.ts +528 -15
  422. package/corpus/templates/design/shared/native-input-resources.ts +36 -0
  423. package/corpus/templates/design/shared/native-local-export.ts +14 -0
  424. package/corpus/templates/design/shared/native-parameter-animation.ts +1 -0
  425. package/corpus/templates/design/shared/native-pointer-input.ts +9 -11
  426. package/corpus/templates/design/shared/shader-fills.ts +0 -513
  427. package/corpus/templates/design/vitest.setup.ts +7 -1
  428. package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +1 -1
  429. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +20 -18
  430. package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +1 -1
  431. package/corpus/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +36 -80
  432. package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +54 -16
  433. package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +50 -73
  434. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +20 -18
  435. package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +1 -1
  436. package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -1
  437. package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +1 -1
  438. package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +1 -1
  439. package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +1 -1
  440. package/corpus/templates/slides/CHANGELOG.md +6 -0
  441. package/corpus/templates/slides/actions/delete-deck.ts +7 -0
  442. package/corpus/templates/slides/changelog/2026-10-21-connected-deck-deletion-requires-approval.md +6 -0
  443. package/corpus/templates/slides/scripts/edit-fidelity/client-action.ts +61 -0
  444. package/corpus/templates/slides/scripts/edit-fidelity/run.ts +10 -0
  445. package/corpus/templates/slides-2/.agents/skills/actions/SKILL.md +199 -0
  446. package/corpus/templates/slides-2/.agents/skills/actions/references/action-fields.md +145 -0
  447. package/corpus/templates/slides-2/.agents/skills/actions/references/examples.md +96 -0
  448. package/corpus/templates/slides-2/.agents/skills/actions/references/provider-apis.md +95 -0
  449. package/corpus/templates/slides-2/.agents/skills/adding-a-feature/SKILL.md +235 -0
  450. package/corpus/templates/slides-2/.agents/skills/agent-native-docs/SKILL.md +161 -0
  451. package/corpus/templates/slides-2/.agents/skills/agent-native-toolkit/SKILL.md +314 -0
  452. package/corpus/templates/slides-2/.agents/skills/analytics-data-for-decks/SKILL.md +44 -0
  453. package/corpus/templates/slides-2/.agents/skills/apply-slide-comments/SKILL.md +63 -0
  454. package/corpus/templates/slides-2/.agents/skills/client-side-routing/SKILL.md +87 -0
  455. package/corpus/templates/slides-2/.agents/skills/context-awareness/SKILL.md +282 -0
  456. package/corpus/templates/slides-2/.agents/skills/create-deck/SKILL.md +263 -0
  457. package/corpus/templates/slides-2/.agents/skills/create-deck/references/reference-inputs.md +72 -0
  458. package/corpus/templates/slides-2/.agents/skills/create-deck/references/slide-templates.md +93 -0
  459. package/corpus/templates/slides-2/.agents/skills/create-deck/references/source-material.md +16 -0
  460. package/corpus/templates/slides-2/.agents/skills/creative-context/SKILL.md +134 -0
  461. package/corpus/templates/slides-2/.agents/skills/customizing-agent-native/SKILL.md +219 -0
  462. package/corpus/templates/slides-2/.agents/skills/deck-management/SKILL.md +182 -0
  463. package/corpus/templates/slides-2/.agents/skills/delegate-to-agent/SKILL.md +62 -0
  464. package/corpus/templates/slides-2/.agents/skills/design-systems/SKILL.md +233 -0
  465. package/corpus/templates/slides-2/.agents/skills/external-agents/SKILL.md +549 -0
  466. package/corpus/templates/slides-2/.agents/skills/external-agents/references/mcp-apps-embedding.md +169 -0
  467. package/corpus/templates/slides-2/.agents/skills/frontend-design/SKILL.md +102 -0
  468. package/corpus/templates/slides-2/.agents/skills/frontend-design/references/visual-direction.md +102 -0
  469. package/corpus/templates/slides-2/.agents/skills/image-generation-via-a2a/SKILL.md +134 -0
  470. package/corpus/templates/slides-2/.agents/skills/performance/SKILL.md +79 -0
  471. package/corpus/templates/slides-2/.agents/skills/portability/SKILL.md +108 -0
  472. package/corpus/templates/slides-2/.agents/skills/real-time-sync/SKILL.md +146 -0
  473. package/corpus/templates/slides-2/.agents/skills/reliable-mutations/SKILL.md +72 -0
  474. package/corpus/templates/slides-2/.agents/skills/secrets/SKILL.md +82 -0
  475. package/corpus/templates/slides-2/.agents/skills/security/SKILL.md +80 -0
  476. package/corpus/templates/slides-2/.agents/skills/self-modifying-code/SKILL.md +123 -0
  477. package/corpus/templates/slides-2/.agents/skills/shadcn-ui/SKILL.md +71 -0
  478. package/corpus/templates/slides-2/.agents/skills/sharing/SKILL.md +286 -0
  479. package/corpus/templates/slides-2/.agents/skills/slide-design/SKILL.md +144 -0
  480. package/corpus/templates/slides-2/.agents/skills/slide-editing/SKILL.md +284 -0
  481. package/corpus/templates/slides-2/.agents/skills/slide-editing/references/animations.md +33 -0
  482. package/corpus/templates/slides-2/.agents/skills/slide-editing/references/freeform-objects.md +22 -0
  483. package/corpus/templates/slides-2/.agents/skills/slide-editing/references/restyling.md +69 -0
  484. package/corpus/templates/slides-2/.agents/skills/slide-editing/references/transitions.md +26 -0
  485. package/corpus/templates/slides-2/.agents/skills/slide-editing/references/video.md +45 -0
  486. package/corpus/templates/slides-2/.agents/skills/slide-images/SKILL.md +136 -0
  487. package/corpus/templates/slides-2/.agents/skills/storing-data/SKILL.md +234 -0
  488. package/corpus/templates/slides-2/.agents/skills/turn-into-skill/SKILL.md +112 -0
  489. package/corpus/templates/slides-2/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  490. package/corpus/templates/slides-2/.agents/skills/workspace-conventions/SKILL.md +103 -0
  491. package/corpus/templates/slides-2/.builder/rules/deploy-app.mdc +22 -0
  492. package/corpus/templates/slides-2/.builder/rules/organize-ui.mdc +9 -0
  493. package/corpus/templates/slides-2/.dockerignore +61 -0
  494. package/corpus/templates/slides-2/.env.example +23 -0
  495. package/corpus/templates/slides-2/.ignore +3 -0
  496. package/corpus/templates/slides-2/.mcp.json +8 -0
  497. package/corpus/templates/slides-2/.oxfmtrc.json +8 -0
  498. package/corpus/templates/slides-2/AGENTS.md +66 -0
  499. package/corpus/templates/slides-2/CHANGELOG.md +76 -0
  500. package/corpus/templates/slides-2/DEVELOPING.md +157 -0
  501. package/corpus/templates/slides-2/README.md +58 -0
  502. package/corpus/templates/slides-2/THIRD_PARTY_NOTICES.md +33 -0
  503. package/corpus/templates/slides-2/_gitignore +38 -0
  504. package/corpus/templates/slides-2/actions/_agent-presence.ts +29 -0
  505. package/corpus/templates/slides-2/actions/_app-url.ts +37 -0
  506. package/corpus/templates/slides-2/actions/_deck-app-scope.ts +30 -0
  507. package/corpus/templates/slides-2/actions/_deck-tracking.ts +260 -0
  508. package/corpus/templates/slides-2/actions/_deck-write.ts +206 -0
  509. package/corpus/templates/slides-2/actions/_imported-slide-source.ts +162 -0
  510. package/corpus/templates/slides-2/actions/_inline-image-storage.ts +1013 -0
  511. package/corpus/templates/slides-2/actions/_linked-design-system.ts +83 -0
  512. package/corpus/templates/slides-2/actions/_presenter-notes.ts +83 -0
  513. package/corpus/templates/slides-2/actions/_render-artifacts.ts +111 -0
  514. package/corpus/templates/slides-2/actions/_slide-source.ts +344 -0
  515. package/corpus/templates/slides-2/actions/_tab-state.ts +51 -0
  516. package/corpus/templates/slides-2/actions/_test-brandfetch.ts +31 -0
  517. package/corpus/templates/slides-2/actions/_uploaded-files.ts +114 -0
  518. package/corpus/templates/slides-2/actions/add-deck.ts +123 -0
  519. package/corpus/templates/slides-2/actions/add-slide-comment.ts +267 -0
  520. package/corpus/templates/slides-2/actions/add-slide.ts +888 -0
  521. package/corpus/templates/slides-2/actions/analyze-brand-assets.ts +66 -0
  522. package/corpus/templates/slides-2/actions/apply-design-system.ts +111 -0
  523. package/corpus/templates/slides-2/actions/approve-deck-access-request.ts +287 -0
  524. package/corpus/templates/slides-2/actions/audit-contrast.ts +143 -0
  525. package/corpus/templates/slides-2/actions/check-image-gen.ts +17 -0
  526. package/corpus/templates/slides-2/actions/clone-context-slide.ts +340 -0
  527. package/corpus/templates/slides-2/actions/clone-creative-context-deck.ts +143 -0
  528. package/corpus/templates/slides-2/actions/control-deck-history.ts +186 -0
  529. package/corpus/templates/slides-2/actions/control-presenter.ts +117 -0
  530. package/corpus/templates/slides-2/actions/control-slide-editor.ts +267 -0
  531. package/corpus/templates/slides-2/actions/create-deck-from-template.ts +274 -0
  532. package/corpus/templates/slides-2/actions/create-deck.ts +1243 -0
  533. package/corpus/templates/slides-2/actions/create-design-system.ts +131 -0
  534. package/corpus/templates/slides-2/actions/create-share-link.ts +127 -0
  535. package/corpus/templates/slides-2/actions/db-health.ts +22 -0
  536. package/corpus/templates/slides-2/actions/delete-asset.ts +154 -0
  537. package/corpus/templates/slides-2/actions/delete-deck.ts +427 -0
  538. package/corpus/templates/slides-2/actions/delete-design-system.ts +167 -0
  539. package/corpus/templates/slides-2/actions/delete-slide-comment.ts +143 -0
  540. package/corpus/templates/slides-2/actions/delete-staged-dataset.ts +30 -0
  541. package/corpus/templates/slides-2/actions/duplicate-deck.ts +299 -0
  542. package/corpus/templates/slides-2/actions/export-google-slides.ts +41 -0
  543. package/corpus/templates/slides-2/actions/export-html.ts +770 -0
  544. package/corpus/templates/slides-2/actions/export-pptx.ts +2203 -0
  545. package/corpus/templates/slides-2/actions/extract-pdf.ts +49 -0
  546. package/corpus/templates/slides-2/actions/generate-image-api.ts +671 -0
  547. package/corpus/templates/slides-2/actions/generate-image.ts +492 -0
  548. package/corpus/templates/slides-2/actions/get-agent-access-deck.ts +52 -0
  549. package/corpus/templates/slides-2/actions/get-deck-access-status.ts +130 -0
  550. package/corpus/templates/slides-2/actions/get-deck-design-tokens.ts +62 -0
  551. package/corpus/templates/slides-2/actions/get-deck-reference-context.ts +232 -0
  552. package/corpus/templates/slides-2/actions/get-deck-template.ts +38 -0
  553. package/corpus/templates/slides-2/actions/get-deck-version.ts +85 -0
  554. package/corpus/templates/slides-2/actions/get-deck.ts +562 -0
  555. package/corpus/templates/slides-2/actions/get-design-system-decode-job-status.ts +57 -0
  556. package/corpus/templates/slides-2/actions/get-design-system-tier-limit.ts +12 -0
  557. package/corpus/templates/slides-2/actions/get-design-system.ts +453 -0
  558. package/corpus/templates/slides-2/actions/get-google-docs-status.ts +106 -0
  559. package/corpus/templates/slides-2/actions/get-google-picker-token.ts +84 -0
  560. package/corpus/templates/slides-2/actions/get-home-suggestions.ts +52 -0
  561. package/corpus/templates/slides-2/actions/get-layout-overflows.ts +192 -0
  562. package/corpus/templates/slides-2/actions/get-slide-render.ts +125 -0
  563. package/corpus/templates/slides-2/actions/get-slide-source.ts +115 -0
  564. package/corpus/templates/slides-2/actions/get-slide-theme-preview.ts +64 -0
  565. package/corpus/templates/slides-2/actions/get-slide-theme.ts +44 -0
  566. package/corpus/templates/slides-2/actions/get-slides-2-upload-storage-status.ts +17 -0
  567. package/corpus/templates/slides-2/actions/get-slides-notification-prefs.ts +37 -0
  568. package/corpus/templates/slides-2/actions/get-workspace-defaults.ts +51 -0
  569. package/corpus/templates/slides-2/actions/image-gen-status.ts +35 -0
  570. package/corpus/templates/slides-2/actions/import-code.ts +26 -0
  571. package/corpus/templates/slides-2/actions/import-design-project.ts +49 -0
  572. package/corpus/templates/slides-2/actions/import-document.ts +125 -0
  573. package/corpus/templates/slides-2/actions/import-docx.ts +57 -0
  574. package/corpus/templates/slides-2/actions/import-file.ts +1273 -0
  575. package/corpus/templates/slides-2/actions/import-from-url.ts +25 -0
  576. package/corpus/templates/slides-2/actions/import-google-doc.ts +208 -0
  577. package/corpus/templates/slides-2/actions/import-google-font.ts +110 -0
  578. package/corpus/templates/slides-2/actions/import-google-slides-reference.ts +667 -0
  579. package/corpus/templates/slides-2/actions/import-pptx.ts +564 -0
  580. package/corpus/templates/slides-2/actions/import-svgl-logo.ts +115 -0
  581. package/corpus/templates/slides-2/actions/index-design-system-with-builder.ts +181 -0
  582. package/corpus/templates/slides-2/actions/index-uploaded-design-system-files.ts +77 -0
  583. package/corpus/templates/slides-2/actions/list-assets.ts +286 -0
  584. package/corpus/templates/slides-2/actions/list-deck-templates.ts +83 -0
  585. package/corpus/templates/slides-2/actions/list-deck-versions.ts +185 -0
  586. package/corpus/templates/slides-2/actions/list-decks.ts +591 -0
  587. package/corpus/templates/slides-2/actions/list-design-systems.ts +180 -0
  588. package/corpus/templates/slides-2/actions/list-slide-comments.ts +128 -0
  589. package/corpus/templates/slides-2/actions/list-slide-themes.ts +17 -0
  590. package/corpus/templates/slides-2/actions/list-staged-datasets.ts +14 -0
  591. package/corpus/templates/slides-2/actions/logo-config.ts +13 -0
  592. package/corpus/templates/slides-2/actions/navigate.ts +158 -0
  593. package/corpus/templates/slides-2/actions/patch-deck.ts +2378 -0
  594. package/corpus/templates/slides-2/actions/provider-api-catalog.ts +25 -0
  595. package/corpus/templates/slides-2/actions/provider-api-docs.ts +83 -0
  596. package/corpus/templates/slides-2/actions/provider-api-request.ts +222 -0
  597. package/corpus/templates/slides-2/actions/query-staged-dataset.ts +83 -0
  598. package/corpus/templates/slides-2/actions/read-composer-source.ts +108 -0
  599. package/corpus/templates/slides-2/actions/request-deck-access.ts +803 -0
  600. package/corpus/templates/slides-2/actions/restore-deck-version.ts +203 -0
  601. package/corpus/templates/slides-2/actions/run.ts +2 -0
  602. package/corpus/templates/slides-2/actions/save-deck.ts +313 -0
  603. package/corpus/templates/slides-2/actions/search-google-fonts.ts +61 -0
  604. package/corpus/templates/slides-2/actions/search-images.ts +30 -0
  605. package/corpus/templates/slides-2/actions/search-logos.ts +23 -0
  606. package/corpus/templates/slides-2/actions/search-svgl-logos.ts +42 -0
  607. package/corpus/templates/slides-2/actions/set-default-design-system.ts +88 -0
  608. package/corpus/templates/slides-2/actions/set-workspace-defaults.ts +61 -0
  609. package/corpus/templates/slides-2/actions/start-design-system-upload.ts +80 -0
  610. package/corpus/templates/slides-2/actions/sync-design-system-with-builder.ts +84 -0
  611. package/corpus/templates/slides-2/actions/toggle-slide-comment-reaction.ts +150 -0
  612. package/corpus/templates/slides-2/actions/transform-slide-objects.ts +1528 -0
  613. package/corpus/templates/slides-2/actions/update-asset.ts +499 -0
  614. package/corpus/templates/slides-2/actions/update-deck-aspect-ratio.ts +95 -0
  615. package/corpus/templates/slides-2/actions/update-deck-design-tokens.ts +175 -0
  616. package/corpus/templates/slides-2/actions/update-design-system.ts +95 -0
  617. package/corpus/templates/slides-2/actions/update-slide-comment.ts +213 -0
  618. package/corpus/templates/slides-2/actions/update-slide-source.ts +353 -0
  619. package/corpus/templates/slides-2/actions/update-slide.ts +850 -0
  620. package/corpus/templates/slides-2/actions/update-slides-notification-prefs.ts +55 -0
  621. package/corpus/templates/slides-2/actions/view-screen.ts +1098 -0
  622. package/corpus/templates/slides-2/agent-native.app-skill.json +165 -0
  623. package/corpus/templates/slides-2/agent-native.config.ts +20 -0
  624. package/corpus/templates/slides-2/agent-native.json +18 -0
  625. package/corpus/templates/slides-2/app/components/ThemeToggle.tsx +47 -0
  626. package/corpus/templates/slides-2/app/components/comments/SlideCommentPins.tsx +781 -0
  627. package/corpus/templates/slides-2/app/components/comments/SlideCommentsPanel.tsx +1075 -0
  628. package/corpus/templates/slides-2/app/components/deck/DeckCard.tsx +304 -0
  629. package/corpus/templates/slides-2/app/components/deck/DeckFilterMenu.tsx +83 -0
  630. package/corpus/templates/slides-2/app/components/deck/ExcalidrawSlide.tsx +183 -0
  631. package/corpus/templates/slides-2/app/components/deck/MermaidRenderer.tsx +126 -0
  632. package/corpus/templates/slides-2/app/components/deck/SlideRenderer.tsx +1553 -0
  633. package/corpus/templates/slides-2/app/components/design-system/DesignSystemCard.tsx +235 -0
  634. package/corpus/templates/slides-2/app/components/design-system/DesignSystemSetup.tsx +2021 -0
  635. package/corpus/templates/slides-2/app/components/design-system/builder-design-system-upload.ts +200 -0
  636. package/corpus/templates/slides-2/app/components/design-system/builder-index-response.ts +104 -0
  637. package/corpus/templates/slides-2/app/components/editor/AddSlidePopover.tsx +461 -0
  638. package/corpus/templates/slides-2/app/components/editor/AiEditingMarker.tsx +24 -0
  639. package/corpus/templates/slides-2/app/components/editor/AlignmentGuides.tsx +82 -0
  640. package/corpus/templates/slides-2/app/components/editor/AnimationsPanel.tsx +698 -0
  641. package/corpus/templates/slides-2/app/components/editor/AppMenu.tsx +356 -0
  642. package/corpus/templates/slides-2/app/components/editor/AssetLibraryPanel.tsx +508 -0
  643. package/corpus/templates/slides-2/app/components/editor/BlockBubbleMenu.tsx +548 -0
  644. package/corpus/templates/slides-2/app/components/editor/DeckAccessDeniedPage.tsx +173 -0
  645. package/corpus/templates/slides-2/app/components/editor/DeckEditorSkeleton.tsx +35 -0
  646. package/corpus/templates/slides-2/app/components/editor/DeferredPopoverFallback.tsx +148 -0
  647. package/corpus/templates/slides-2/app/components/editor/EditorActionCluster.tsx +217 -0
  648. package/corpus/templates/slides-2/app/components/editor/EditorSidebar.tsx +1047 -0
  649. package/corpus/templates/slides-2/app/components/editor/EditorToolbar.tsx +1285 -0
  650. package/corpus/templates/slides-2/app/components/editor/ExportMenu.tsx +579 -0
  651. package/corpus/templates/slides-2/app/components/editor/GeneratingOverlay.tsx +21 -0
  652. package/corpus/templates/slides-2/app/components/editor/GeneratingSlidePreview.tsx +73 -0
  653. package/corpus/templates/slides-2/app/components/editor/GoogleDocImportHint.tsx +378 -0
  654. package/corpus/templates/slides-2/app/components/editor/GoogleDriveConnectionCta.tsx +154 -0
  655. package/corpus/templates/slides-2/app/components/editor/GoogleSlidesReferenceImport.tsx +299 -0
  656. package/corpus/templates/slides-2/app/components/editor/HistoryPanel.tsx +354 -0
  657. package/corpus/templates/slides-2/app/components/editor/HomeQuickStartDialog.tsx +202 -0
  658. package/corpus/templates/slides-2/app/components/editor/ImageCropOverlay.tsx +820 -0
  659. package/corpus/templates/slides-2/app/components/editor/ImageDropPromptPopover.tsx +280 -0
  660. package/corpus/templates/slides-2/app/components/editor/ImageGenPanel.tsx +244 -0
  661. package/corpus/templates/slides-2/app/components/editor/ImageOverlay.tsx +280 -0
  662. package/corpus/templates/slides-2/app/components/editor/ImageSearchPanel.tsx +183 -0
  663. package/corpus/templates/slides-2/app/components/editor/ImportDeckButton.tsx +247 -0
  664. package/corpus/templates/slides-2/app/components/editor/LogoSearchPanel.tsx +366 -0
  665. package/corpus/templates/slides-2/app/components/editor/MermaidToExcalidrawPanel.tsx +99 -0
  666. package/corpus/templates/slides-2/app/components/editor/MissingDeckAccessPane.tsx +219 -0
  667. package/corpus/templates/slides-2/app/components/editor/NewDeckReferenceStep.tsx +812 -0
  668. package/corpus/templates/slides-2/app/components/editor/PromptDialog.tsx +963 -0
  669. package/corpus/templates/slides-2/app/components/editor/QuestionFlow.tsx +119 -0
  670. package/corpus/templates/slides-2/app/components/editor/RequestDeckAccessDialog.tsx +101 -0
  671. package/corpus/templates/slides-2/app/components/editor/ShareDialog.tsx +126 -0
  672. package/corpus/templates/slides-2/app/components/editor/SlideContextToolbar.tsx +1471 -0
  673. package/corpus/templates/slides-2/app/components/editor/SlideEditor.tsx +11183 -0
  674. package/corpus/templates/slides-2/app/components/editor/SlideOverflowWarning.tsx +82 -0
  675. package/corpus/templates/slides-2/app/components/editor/SlideScrollStack.tsx +307 -0
  676. package/corpus/templates/slides-2/app/components/editor/SlideSlashCommandMenu.tsx +692 -0
  677. package/corpus/templates/slides-2/app/components/editor/SlideThumbnailContextMenu.tsx +52 -0
  678. package/corpus/templates/slides-2/app/components/editor/SlideTransitionControl.tsx +184 -0
  679. package/corpus/templates/slides-2/app/components/editor/SlidesComposerContext.tsx +789 -0
  680. package/corpus/templates/slides-2/app/components/editor/SlidesComposerContextProvider.tsx +74 -0
  681. package/corpus/templates/slides-2/app/components/editor/SlidesLayersPanel.tsx +377 -0
  682. package/corpus/templates/slides-2/app/components/editor/SpeakerNotesPanel.tsx +119 -0
  683. package/corpus/templates/slides-2/app/components/editor/TweaksPanel.tsx +77 -0
  684. package/corpus/templates/slides-2/app/components/editor/UploadStorageGate.tsx +37 -0
  685. package/corpus/templates/slides-2/app/components/editor/bullet-editing.ts +880 -0
  686. package/corpus/templates/slides-2/app/components/editor/canvas-interactions/index.ts +12 -0
  687. package/corpus/templates/slides-2/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +119 -0
  688. package/corpus/templates/slides-2/app/components/editor/commit-active-edit.ts +14 -0
  689. package/corpus/templates/slides-2/app/components/editor/editor-command-model.ts +35 -0
  690. package/corpus/templates/slides-2/app/components/editor/fit-text-object.ts +31 -0
  691. package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-cases.json +983 -0
  692. package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-host.ts +747 -0
  693. package/corpus/templates/slides-2/app/components/editor/in-place-text-session.ts +6891 -0
  694. package/corpus/templates/slides-2/app/components/editor/inline-edit-session.ts +26 -0
  695. package/corpus/templates/slides-2/app/components/editor/list-editing.ts +501 -0
  696. package/corpus/templates/slides-2/app/components/editor/rich-text-selection.ts +975 -0
  697. package/corpus/templates/slides-2/app/components/editor/rte-test-utils.ts +265 -0
  698. package/corpus/templates/slides-2/app/components/editor/selection-overlay-measurement.ts +191 -0
  699. package/corpus/templates/slides-2/app/components/editor/slide-escape-arbiter.ts +34 -0
  700. package/corpus/templates/slides-2/app/components/editor/slide-object-interactions.ts +6362 -0
  701. package/corpus/templates/slides-2/app/components/editor/slide-object-transform.browser-host.ts +19 -0
  702. package/corpus/templates/slides-2/app/components/editor/slide-pointer-target.ts +432 -0
  703. package/corpus/templates/slides-2/app/components/editor/slide-presence.ts +13 -0
  704. package/corpus/templates/slides-2/app/components/editor/slide-style.ts +243 -0
  705. package/corpus/templates/slides-2/app/components/editor/slide-text-targets.ts +540 -0
  706. package/corpus/templates/slides-2/app/components/editor/style-clipboard.ts +102 -0
  707. package/corpus/templates/slides-2/app/components/editor/use-prompt-import.ts +159 -0
  708. package/corpus/templates/slides-2/app/components/home/SlidesHomeLibrary.tsx +79 -0
  709. package/corpus/templates/slides-2/app/components/layout/AgentWorkIndicator.tsx +193 -0
  710. package/corpus/templates/slides-2/app/components/layout/Header.tsx +110 -0
  711. package/corpus/templates/slides-2/app/components/layout/Layout.tsx +492 -0
  712. package/corpus/templates/slides-2/app/components/layout/Sidebar.tsx +109 -0
  713. package/corpus/templates/slides-2/app/components/layout/layout-route-policy.ts +28 -0
  714. package/corpus/templates/slides-2/app/components/presentation/PresentationView.tsx +1116 -0
  715. package/corpus/templates/slides-2/app/components/presentation/PresenterView.tsx +526 -0
  716. package/corpus/templates/slides-2/app/components/presentation/SlideTransitionStage.tsx +297 -0
  717. package/corpus/templates/slides-2/app/components/presentation/present-channel.ts +31 -0
  718. package/corpus/templates/slides-2/app/components/presentation/slide-build-steps.ts +231 -0
  719. package/corpus/templates/slides-2/app/components/presentation/slide-navigation.ts +273 -0
  720. package/corpus/templates/slides-2/app/components/presentation/slide-transition-motion.ts +258 -0
  721. package/corpus/templates/slides-2/app/components/presentation/voice-navigation.ts +61 -0
  722. package/corpus/templates/slides-2/app/components/settings/notification-settings.tsx +93 -0
  723. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2AssetBrowser.tsx +726 -0
  724. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2CommandMenu.tsx +453 -0
  725. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Comments.tsx +571 -0
  726. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2DesignTokens.tsx +345 -0
  727. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Editor.tsx +4804 -0
  728. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ExportMenu.tsx +671 -0
  729. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2FontBrowser.tsx +342 -0
  730. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ImageCropControls.tsx +487 -0
  731. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Inspector.tsx +950 -0
  732. package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2SvglLogoSearchDialog.tsx +332 -0
  733. package/corpus/templates/slides-2/app/components/slides-2-editor/cross-slide-edit-history.ts +151 -0
  734. package/corpus/templates/slides-2/app/components/slides-2-editor/design-token-presets.ts +140 -0
  735. package/corpus/templates/slides-2/app/components/slides-2-editor/editor-action-errors.ts +47 -0
  736. package/corpus/templates/slides-2/app/components/slides-2-editor/editor-export-errors.ts +60 -0
  737. package/corpus/templates/slides-2/app/components/slides-2-editor/geometry.ts +275 -0
  738. package/corpus/templates/slides-2/app/components/slides-2-editor/image-crop-style.ts +82 -0
  739. package/corpus/templates/slides-2/app/components/slides-2-editor/inline-text-editor.tsx +631 -0
  740. package/corpus/templates/slides-2/app/components/slides-2-editor/keyboard-shortcuts.ts +104 -0
  741. package/corpus/templates/slides-2/app/components/slides-2-editor/object-insertion.ts +13 -0
  742. package/corpus/templates/slides-2/app/components/slides-2-editor/preview-patches.ts +54 -0
  743. package/corpus/templates/slides-2/app/components/slides-2-editor/sandbox-render-errors.ts +23 -0
  744. package/corpus/templates/slides-2/app/components/slides-2-editor/source-structure.ts +634 -0
  745. package/corpus/templates/slides-2/app/components/slides-2-editor/types.ts +85 -0
  746. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2BlackoutOverlay.tsx +13 -0
  747. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ControlBar.tsx +285 -0
  748. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2HelpDialog.tsx +72 -0
  749. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2JumpInput.tsx +38 -0
  750. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2LaserPointer.tsx +67 -0
  751. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Overview.tsx +161 -0
  752. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Player.tsx +839 -0
  753. package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ProgressBar.tsx +23 -0
  754. package/corpus/templates/slides-2/app/components/slides-2-presenter/keyboard.ts +36 -0
  755. package/corpus/templates/slides-2/app/components/slides-2-presenter/presenter-channel.ts +131 -0
  756. package/corpus/templates/slides-2/app/components/slides-2-presenter/use-presenter-action-bridge.ts +296 -0
  757. package/corpus/templates/slides-2/app/components/slides-2-presenter/useSlides2TouchSwipe.ts +80 -0
  758. package/corpus/templates/slides-2/app/components/slides-2-runtime/SandboxedSlide.tsx +724 -0
  759. package/corpus/templates/slides-2/app/components/slides-2-runtime/SlideContentRenderer.tsx +137 -0
  760. package/corpus/templates/slides-2/app/components/slides-2-runtime/Slides2Canvas.tsx +99 -0
  761. package/corpus/templates/slides-2/app/components/slides-2-runtime/constants.ts +4 -0
  762. package/corpus/templates/slides-2/app/components/slides-2-runtime/protocol.ts +1400 -0
  763. package/corpus/templates/slides-2/app/components/slides-2-runtime/transition-frame.ts +439 -0
  764. package/corpus/templates/slides-2/app/components/templates/DeckTemplateLibrary.tsx +314 -0
  765. package/corpus/templates/slides-2/app/components/templates/DeckTemplatePreview.tsx +60 -0
  766. package/corpus/templates/slides-2/app/components/templates/DeckTemplateStage.tsx +45 -0
  767. package/corpus/templates/slides-2/app/components/ui/alert-dialog.tsx +1 -0
  768. package/corpus/templates/slides-2/app/components/ui/avatar.tsx +1 -0
  769. package/corpus/templates/slides-2/app/components/ui/button-group.tsx +1 -0
  770. package/corpus/templates/slides-2/app/components/ui/button.tsx +1 -0
  771. package/corpus/templates/slides-2/app/components/ui/card.tsx +1 -0
  772. package/corpus/templates/slides-2/app/components/ui/command.tsx +1 -0
  773. package/corpus/templates/slides-2/app/components/ui/context-menu.tsx +32 -0
  774. package/corpus/templates/slides-2/app/components/ui/dialog.tsx +1 -0
  775. package/corpus/templates/slides-2/app/components/ui/dropdown-menu.tsx +1 -0
  776. package/corpus/templates/slides-2/app/components/ui/filter-trigger.tsx +1 -0
  777. package/corpus/templates/slides-2/app/components/ui/input.tsx +1 -0
  778. package/corpus/templates/slides-2/app/components/ui/label.tsx +1 -0
  779. package/corpus/templates/slides-2/app/components/ui/popover.tsx +1 -0
  780. package/corpus/templates/slides-2/app/components/ui/progress.tsx +1 -0
  781. package/corpus/templates/slides-2/app/components/ui/scroll-area.tsx +1 -0
  782. package/corpus/templates/slides-2/app/components/ui/select.tsx +1 -0
  783. package/corpus/templates/slides-2/app/components/ui/separator.tsx +1 -0
  784. package/corpus/templates/slides-2/app/components/ui/sheet.tsx +1 -0
  785. package/corpus/templates/slides-2/app/components/ui/skeleton.tsx +1 -0
  786. package/corpus/templates/slides-2/app/components/ui/slider.tsx +1 -0
  787. package/corpus/templates/slides-2/app/components/ui/spinner.tsx +1 -0
  788. package/corpus/templates/slides-2/app/components/ui/switch.tsx +1 -0
  789. package/corpus/templates/slides-2/app/components/ui/tabs.tsx +59 -0
  790. package/corpus/templates/slides-2/app/components/ui/textarea.tsx +1 -0
  791. package/corpus/templates/slides-2/app/components/ui/toggle-group.tsx +1 -0
  792. package/corpus/templates/slides-2/app/components/ui/toolkit-provider.tsx +17 -0
  793. package/corpus/templates/slides-2/app/components/ui/tooltip.tsx +1 -0
  794. package/corpus/templates/slides-2/app/components/visual-editor/CanvasCommentPins.tsx +46 -0
  795. package/corpus/templates/slides-2/app/components/visual-editor/DrawOverlay.tsx +27 -0
  796. package/corpus/templates/slides-2/app/components/visual-editor/MultiSelectChip.tsx +97 -0
  797. package/corpus/templates/slides-2/app/components/visual-editor/SaveStatusIndicator.tsx +273 -0
  798. package/corpus/templates/slides-2/app/components/visual-editor/index.ts +4 -0
  799. package/corpus/templates/slides-2/app/context/DeckContext.tsx +7486 -0
  800. package/corpus/templates/slides-2/app/design-system.ts +3 -0
  801. package/corpus/templates/slides-2/app/entry.client.tsx +10 -0
  802. package/corpus/templates/slides-2/app/entry.server.tsx +10 -0
  803. package/corpus/templates/slides-2/app/global.css +1626 -0
  804. package/corpus/templates/slides-2/app/hooks/use-agent-generating.ts +517 -0
  805. package/corpus/templates/slides-2/app/hooks/use-compact-editor-layout.ts +26 -0
  806. package/corpus/templates/slides-2/app/hooks/use-contrast-audit-bridge.ts +49 -0
  807. package/corpus/templates/slides-2/app/hooks/use-deck-access-reload.ts +70 -0
  808. package/corpus/templates/slides-2/app/hooks/use-deck-access.ts +50 -0
  809. package/corpus/templates/slides-2/app/hooks/use-deck-design-system.ts +146 -0
  810. package/corpus/templates/slides-2/app/hooks/use-deck-history-action-bridge.ts +266 -0
  811. package/corpus/templates/slides-2/app/hooks/use-deck-presence.ts +89 -0
  812. package/corpus/templates/slides-2/app/hooks/use-deck-role.ts +46 -0
  813. package/corpus/templates/slides-2/app/hooks/use-deck-versions.ts +43 -0
  814. package/corpus/templates/slides-2/app/hooks/use-design-system-workflows.ts +11 -0
  815. package/corpus/templates/slides-2/app/hooks/use-design-systems.ts +31 -0
  816. package/corpus/templates/slides-2/app/hooks/use-generating-slide-preview.ts +115 -0
  817. package/corpus/templates/slides-2/app/hooks/use-navigation-state.ts +229 -0
  818. package/corpus/templates/slides-2/app/hooks/use-new-deck-generation-signal.ts +46 -0
  819. package/corpus/templates/slides-2/app/hooks/use-new-deck-generation.ts +710 -0
  820. package/corpus/templates/slides-2/app/hooks/use-sidebar-collapsed.ts +95 -0
  821. package/corpus/templates/slides-2/app/hooks/use-slide-comments.ts +202 -0
  822. package/corpus/templates/slides-2/app/hooks/use-slide-file-storage-status.ts +55 -0
  823. package/corpus/templates/slides-2/app/hooks/use-undo-selection.ts +66 -0
  824. package/corpus/templates/slides-2/app/hooks/use-workspace-defaults.ts +31 -0
  825. package/corpus/templates/slides-2/app/i18n/en-US.ts +1507 -0
  826. package/corpus/templates/slides-2/app/i18n/index.ts +19 -0
  827. package/corpus/templates/slides-2/app/lib/agent-visible-message.ts +21 -0
  828. package/corpus/templates/slides-2/app/lib/aspect-ratios.ts +7 -0
  829. package/corpus/templates/slides-2/app/lib/asset-error-copy.ts +59 -0
  830. package/corpus/templates/slides-2/app/lib/canvas-zoom.ts +47 -0
  831. package/corpus/templates/slides-2/app/lib/composer-context.ts +152 -0
  832. package/corpus/templates/slides-2/app/lib/composer-draft.ts +34 -0
  833. package/corpus/templates/slides-2/app/lib/contrast-audit.ts +390 -0
  834. package/corpus/templates/slides-2/app/lib/contrast-resolve.ts +240 -0
  835. package/corpus/templates/slides-2/app/lib/create-deck-generation.ts +938 -0
  836. package/corpus/templates/slides-2/app/lib/deck-access-lost.ts +4 -0
  837. package/corpus/templates/slides-2/app/lib/deck-backup.ts +186 -0
  838. package/corpus/templates/slides-2/app/lib/deck-editor-loading.ts +91 -0
  839. package/corpus/templates/slides-2/app/lib/deck-export-file-client.ts +77 -0
  840. package/corpus/templates/slides-2/app/lib/deck-filter.ts +52 -0
  841. package/corpus/templates/slides-2/app/lib/deck-list-loading.ts +16 -0
  842. package/corpus/templates/slides-2/app/lib/deck-preview-frame.ts +15 -0
  843. package/corpus/templates/slides-2/app/lib/deck-share-links.ts +9 -0
  844. package/corpus/templates/slides-2/app/lib/deck-sorting.ts +19 -0
  845. package/corpus/templates/slides-2/app/lib/deferred-editor-surfaces.ts +24 -0
  846. package/corpus/templates/slides-2/app/lib/design-system-selection.ts +11 -0
  847. package/corpus/templates/slides-2/app/lib/design-systems.ts +231 -0
  848. package/corpus/templates/slides-2/app/lib/dynamic-import.ts +50 -0
  849. package/corpus/templates/slides-2/app/lib/editor-agent-handoff.ts +92 -0
  850. package/corpus/templates/slides-2/app/lib/editor-shortcuts.ts +153 -0
  851. package/corpus/templates/slides-2/app/lib/export-google-slides-client.ts +168 -0
  852. package/corpus/templates/slides-2/app/lib/export-pdf-client.ts +684 -0
  853. package/corpus/templates/slides-2/app/lib/export-pptx-client.ts +2420 -0
  854. package/corpus/templates/slides-2/app/lib/generation-lifecycle.ts +24 -0
  855. package/corpus/templates/slides-2/app/lib/generation-state.ts +247 -0
  856. package/corpus/templates/slides-2/app/lib/google-docs-client.ts +110 -0
  857. package/corpus/templates/slides-2/app/lib/google-slides-export-availability-client.ts +53 -0
  858. package/corpus/templates/slides-2/app/lib/google-slides-reference-source.ts +18 -0
  859. package/corpus/templates/slides-2/app/lib/image-download.ts +85 -0
  860. package/corpus/templates/slides-2/app/lib/image-drop-to-agent.ts +210 -0
  861. package/corpus/templates/slides-2/app/lib/import-uploaded-deck.ts +132 -0
  862. package/corpus/templates/slides-2/app/lib/inline-edit-remote.ts +55 -0
  863. package/corpus/templates/slides-2/app/lib/localize-slides-changelog.ts +47 -0
  864. package/corpus/templates/slides-2/app/lib/mermaid-blocks.ts +18 -0
  865. package/corpus/templates/slides-2/app/lib/new-deck-reference-selection.ts +174 -0
  866. package/corpus/templates/slides-2/app/lib/normalize-slide-padding.ts +74 -0
  867. package/corpus/templates/slides-2/app/lib/pending-deck-changes.ts +33 -0
  868. package/corpus/templates/slides-2/app/lib/portaled-layer.ts +7 -0
  869. package/corpus/templates/slides-2/app/lib/pptx-google-slides.ts +204 -0
  870. package/corpus/templates/slides-2/app/lib/prompt-attachment-adapter.ts +37 -0
  871. package/corpus/templates/slides-2/app/lib/prompt-file-uploads.ts +557 -0
  872. package/corpus/templates/slides-2/app/lib/recent-references.ts +106 -0
  873. package/corpus/templates/slides-2/app/lib/reference-document-hydration.ts +406 -0
  874. package/corpus/templates/slides-2/app/lib/register-chat-renderers.tsx +645 -0
  875. package/corpus/templates/slides-2/app/lib/reveal-after-delete.ts +55 -0
  876. package/corpus/templates/slides-2/app/lib/sanitize-slide-html.ts +752 -0
  877. package/corpus/templates/slides-2/app/lib/slide-agent-context.ts +148 -0
  878. package/corpus/templates/slides-2/app/lib/slide-animation-elements.ts +900 -0
  879. package/corpus/templates/slides-2/app/lib/slide-clipboard.ts +534 -0
  880. package/corpus/templates/slides-2/app/lib/slide-comment-anchor.ts +286 -0
  881. package/corpus/templates/slides-2/app/lib/slide-content-merge.ts +295 -0
  882. package/corpus/templates/slides-2/app/lib/slide-image-replacement.ts +1919 -0
  883. package/corpus/templates/slides-2/app/lib/slide-live-remote.ts +215 -0
  884. package/corpus/templates/slides-2/app/lib/slide-scroll.ts +56 -0
  885. package/corpus/templates/slides-2/app/lib/slide-source-map.ts +1099 -0
  886. package/corpus/templates/slides-2/app/lib/slide-video.ts +390 -0
  887. package/corpus/templates/slides-2/app/lib/slides-relay-tracking.ts +114 -0
  888. package/corpus/templates/slides-2/app/lib/streaming-slide-html.ts +77 -0
  889. package/corpus/templates/slides-2/app/lib/tab-id.ts +3 -0
  890. package/corpus/templates/slides-2/app/lib/template-navigation.ts +15 -0
  891. package/corpus/templates/slides-2/app/lib/text-tool-shortcut.ts +75 -0
  892. package/corpus/templates/slides-2/app/lib/undo-reveal.ts +332 -0
  893. package/corpus/templates/slides-2/app/lib/upload-response.ts +107 -0
  894. package/corpus/templates/slides-2/app/lib/utils.ts +38 -0
  895. package/corpus/templates/slides-2/app/lib/validate-native-slide-html.ts +177 -0
  896. package/corpus/templates/slides-2/app/lib/video-upload.ts +354 -0
  897. package/corpus/templates/slides-2/app/pages/DeckEditor.tsx +6158 -0
  898. package/corpus/templates/slides-2/app/pages/DesignSystems.tsx +363 -0
  899. package/corpus/templates/slides-2/app/pages/Index.tsx +3254 -0
  900. package/corpus/templates/slides-2/app/pages/NotFound.tsx +33 -0
  901. package/corpus/templates/slides-2/app/pages/Presentation.tsx +120 -0
  902. package/corpus/templates/slides-2/app/pages/SharedPresentation.tsx +174 -0
  903. package/corpus/templates/slides-2/app/pages/SlideThemeDetail.tsx +227 -0
  904. package/corpus/templates/slides-2/app/pages/SlideThemes.tsx +155 -0
  905. package/corpus/templates/slides-2/app/pages/Slides2EditorPage.tsx +1618 -0
  906. package/corpus/templates/slides-2/app/pages/Slides2PresenterConsolePage.tsx +937 -0
  907. package/corpus/templates/slides-2/app/pages/Slides2PresenterPage.tsx +979 -0
  908. package/corpus/templates/slides-2/app/pages/Templates.tsx +32 -0
  909. package/corpus/templates/slides-2/app/root.tsx +391 -0
  910. package/corpus/templates/slides-2/app/routes/$.tsx +10 -0
  911. package/corpus/templates/slides-2/app/routes/_index.tsx +1 -0
  912. package/corpus/templates/slides-2/app/routes/access-request.approve.tsx +276 -0
  913. package/corpus/templates/slides-2/app/routes/agent.tsx +19 -0
  914. package/corpus/templates/slides-2/app/routes/chat.$threadId.tsx +1 -0
  915. package/corpus/templates/slides-2/app/routes/chat.tsx +190 -0
  916. package/corpus/templates/slides-2/app/routes/deck.$id.tsx +10 -0
  917. package/corpus/templates/slides-2/app/routes/deck.$id_.present.tsx +10 -0
  918. package/corpus/templates/slides-2/app/routes/design-systems.tsx +10 -0
  919. package/corpus/templates/slides-2/app/routes/extensions.$id.$slug.tsx +2 -0
  920. package/corpus/templates/slides-2/app/routes/extensions.$id.tsx +5 -0
  921. package/corpus/templates/slides-2/app/routes/extensions._index.tsx +5 -0
  922. package/corpus/templates/slides-2/app/routes/extensions.tsx +5 -0
  923. package/corpus/templates/slides-2/app/routes/home-layout.tsx +31 -0
  924. package/corpus/templates/slides-2/app/routes/home.tsx +22 -0
  925. package/corpus/templates/slides-2/app/routes/p.$id.tsx +195 -0
  926. package/corpus/templates/slides-2/app/routes/settings.$.tsx +1 -0
  927. package/corpus/templates/slides-2/app/routes/settings.tsx +131 -0
  928. package/corpus/templates/slides-2/app/routes/share.$token.tsx +137 -0
  929. package/corpus/templates/slides-2/app/routes/slide.tsx +209 -0
  930. package/corpus/templates/slides-2/app/routes/team.tsx +11 -0
  931. package/corpus/templates/slides-2/app/routes/templates.tsx +1 -0
  932. package/corpus/templates/slides-2/app/routes/themes.$id.tsx +1 -0
  933. package/corpus/templates/slides-2/app/routes/themes.tsx +1 -0
  934. package/corpus/templates/slides-2/app/routes.ts +24 -0
  935. package/corpus/templates/slides-2/app/vite-env.d.ts +24 -0
  936. package/corpus/templates/slides-2/changelog/2026-10-17-find-and-switch-decks-from-the-presenter-console.md +6 -0
  937. package/corpus/templates/slides-2/changelog/2026-10-17-meet-slides-2-create-and-refine-editable-slide-decks-with-an.md +6 -0
  938. package/corpus/templates/slides-2/changelog/2026-10-17-pptx-image-export.md +6 -0
  939. package/corpus/templates/slides-2/changelog/2026-10-17-visual-editor.md +6 -0
  940. package/corpus/templates/slides-2/changelog/2026-10-18-apply-an-accessible-design-system-to-an-existing-deck-before.md +6 -0
  941. package/corpus/templates/slides-2/changelog/2026-10-18-choose-a-template-or-start-a-new-presentation-from-the-slide.md +6 -0
  942. package/corpus/templates/slides-2/changelog/2026-10-18-generate-decks-from-a-prompt-then-edit-slide-elements-direct.md +6 -0
  943. package/corpus/templates/slides-2/changelog/2026-10-18-generate-presentation-decks-from-a-prompt-and-edit-every-sli.md +6 -0
  944. package/corpus/templates/slides-2/changelog/2026-10-18-new-presentation-drafts-save-before-generation-starts-so-you.md +6 -0
  945. package/corpus/templates/slides-2/changelog/2026-10-18-the-assistant-can-undo-redo-and-save-pending-edits-in-the-vi.md +6 -0
  946. package/corpus/templates/slides-2/changelog/2026-10-19-agents-can-insert-duplicate-and-delete-canvas-objects-in-sou.md +6 -0
  947. package/corpus/templates/slides-2/changelog/2026-10-19-browse-slide-themes.md +6 -0
  948. package/corpus/templates/slides-2/changelog/2026-10-19-clicking-a-slide-preview-in-overview-selects-that-slide.md +6 -0
  949. package/corpus/templates/slides-2/changelog/2026-10-19-create-decks-from-a-prompt-and-edit-slides-directly-on-the-c.md +6 -0
  950. package/corpus/templates/slides-2/changelog/2026-10-19-creating-and-editing-decks-now-starts-with-the-tools-most-re.md +6 -0
  951. package/corpus/templates/slides-2/changelog/2026-10-19-deleting-decks-revokes-public-links.md +7 -0
  952. package/corpus/templates/slides-2/changelog/2026-10-19-escape-cancels-an-in-progress-slide-drag-without-losing-earl.md +6 -0
  953. package/corpus/templates/slides-2/changelog/2026-10-19-import-failures-now-show-clear-localized-descriptions-instea.md +6 -0
  954. package/corpus/templates/slides-2/changelog/2026-10-19-presenter-controls-stay-responsive-when-moving-over-the-slid.md +6 -0
  955. package/corpus/templates/slides-2/changelog/2026-10-19-presenter-notes-stay-private-from-viewers-and-commenters.md +6 -0
  956. package/corpus/templates/slides-2/changelog/2026-10-19-preview-generated-slides-in-chat.md +6 -0
  957. package/corpus/templates/slides-2/changelog/2026-10-19-remote-image-previews-accept-supported-raster-formats.md +6 -0
  958. package/corpus/templates/slides-2/changelog/2026-10-19-search-the-svgl-catalog-and-add-svg-logos-to-a-deck-or-the-g.md +6 -0
  959. package/corpus/templates/slides-2/changelog/2026-10-19-slide-generation-explains-when-react-effect-hooks-cannot-run.md +6 -0
  960. package/corpus/templates/slides-2/changelog/2026-10-19-the-editor-highlights-hovered-objects-and-keeps-image-replac.md +6 -0
  961. package/corpus/templates/slides-2/changelog/2026-10-19-the-slide-editor-uses-the-shared-agent-native-controls.md +6 -0
  962. package/corpus/templates/slides-2/changelog/2026-10-20-deck-editing-controls-match-the-workspace.md +6 -0
  963. package/corpus/templates/slides-2/changelog/2026-10-20-google-slides-imports-now-report-missing-image-data-instead-.md +6 -0
  964. package/corpus/templates/slides-2/changelog/2026-10-20-imports-and-previews-handle-large-content-safely.md +6 -0
  965. package/corpus/templates/slides-2/changelog/2026-10-20-public-deck-pages-can-export-source-backed-slides-to-pdf.md +6 -0
  966. package/corpus/templates/slides-2/changelog/2026-10-20-saved-slide-images-stay-available.md +6 -0
  967. package/corpus/templates/slides-2/changelog/2026-10-20-scope-global-media-picks-to-assets-the-current-deck-can-reso.md +6 -0
  968. package/corpus/templates/slides-2/components.json +20 -0
  969. package/corpus/templates/slides-2/drizzle.config.ts +3 -0
  970. package/corpus/templates/slides-2/learnings.defaults.md +5 -0
  971. package/corpus/templates/slides-2/netlify.toml +24 -0
  972. package/corpus/templates/slides-2/package.json +147 -0
  973. package/corpus/templates/slides-2/public/agent-native-icon-dark.svg +10 -0
  974. package/corpus/templates/slides-2/public/agent-native-icon-light.svg +10 -0
  975. package/corpus/templates/slides-2/public/agent-native-logo-dark.svg +21 -0
  976. package/corpus/templates/slides-2/public/agent-native-logo-light.svg +21 -0
  977. package/corpus/templates/slides-2/public/assets/builder-logo-white.svg +15 -0
  978. package/corpus/templates/slides-2/public/assets/generated/preview.html +61 -0
  979. package/corpus/templates/slides-2/public/assets/intuit-logo-white.svg +6 -0
  980. package/corpus/templates/slides-2/public/assets/walmart-logo-white.svg +6 -0
  981. package/corpus/templates/slides-2/public/chatgpt-plugin-icon.svg +7 -0
  982. package/corpus/templates/slides-2/public/favicon.svg +1 -0
  983. package/corpus/templates/slides-2/public/icon-180.svg +1 -0
  984. package/corpus/templates/slides-2/public/icon-192.svg +1 -0
  985. package/corpus/templates/slides-2/public/icon-512.svg +1 -0
  986. package/corpus/templates/slides-2/public/manifest.json +20 -0
  987. package/corpus/templates/slides-2/public/placeholder.svg +1 -0
  988. package/corpus/templates/slides-2/public/robots.txt +14 -0
  989. package/corpus/templates/slides-2/public/visual-edit-structure-proof.html +99 -0
  990. package/corpus/templates/slides-2/react-router.config.ts +7 -0
  991. package/corpus/templates/slides-2/scripts/edit-fidelity/README.md +499 -0
  992. package/corpus/templates/slides-2/scripts/edit-fidelity/authoring-fuzz.ts +9517 -0
  993. package/corpus/templates/slides-2/scripts/edit-fidelity/baseline.json +16427 -0
  994. package/corpus/templates/slides-2/scripts/edit-fidelity/dev-server-url.ts +10 -0
  995. package/corpus/templates/slides-2/scripts/edit-fidelity/lib/in-page.ts +1975 -0
  996. package/corpus/templates/slides-2/scripts/edit-fidelity/lib/metrics.ts +1401 -0
  997. package/corpus/templates/slides-2/scripts/edit-fidelity/retry-infra.ts +7 -0
  998. package/corpus/templates/slides-2/scripts/edit-fidelity/run-options.ts +21 -0
  999. package/corpus/templates/slides-2/scripts/edit-fidelity/run-outcomes.ts +127 -0
  1000. package/corpus/templates/slides-2/scripts/edit-fidelity/run.ts +8451 -0
  1001. package/corpus/templates/slides-2/scripts/export-fidelity/README.md +116 -0
  1002. package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout-lib.ts +241 -0
  1003. package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout.ts +30 -0
  1004. package/corpus/templates/slides-2/scripts/export-fidelity/diff.ts +222 -0
  1005. package/corpus/templates/slides-2/scripts/export-fidelity/export.ts +765 -0
  1006. package/corpus/templates/slides-2/scripts/export-fidelity/fixtures/agent-dark-deck.json +48 -0
  1007. package/corpus/templates/slides-2/scripts/export-fidelity/generate-calibration.ts +765 -0
  1008. package/corpus/templates/slides-2/scripts/export-fidelity/google-export.ts +137 -0
  1009. package/corpus/templates/slides-2/scripts/export-fidelity/google-layout.ts +82 -0
  1010. package/corpus/templates/slides-2/scripts/export-fidelity/resolve-pkg.ts +29 -0
  1011. package/corpus/templates/slides-2/scripts/migrate-production.ts +22 -0
  1012. package/corpus/templates/slides-2/server/db/index.ts +73 -0
  1013. package/corpus/templates/slides-2/server/db/schema.ts +189 -0
  1014. package/corpus/templates/slides-2/server/handlers/assets-url.ts +13 -0
  1015. package/corpus/templates/slides-2/server/handlers/assets.ts +3217 -0
  1016. package/corpus/templates/slides-2/server/handlers/decks.ts +185 -0
  1017. package/corpus/templates/slides-2/server/handlers/demo.ts +9 -0
  1018. package/corpus/templates/slides-2/server/handlers/design-systems.ts +219 -0
  1019. package/corpus/templates/slides-2/server/handlers/google-docs-auth.ts +165 -0
  1020. package/corpus/templates/slides-2/server/handlers/image-gen.ts +153 -0
  1021. package/corpus/templates/slides-2/server/handlers/image-providers/gemini.ts +209 -0
  1022. package/corpus/templates/slides-2/server/handlers/image-providers/index.ts +61 -0
  1023. package/corpus/templates/slides-2/server/handlers/image-providers/openai.ts +288 -0
  1024. package/corpus/templates/slides-2/server/handlers/image-providers/types.ts +35 -0
  1025. package/corpus/templates/slides-2/server/handlers/import/docx-parser.ts +31 -0
  1026. package/corpus/templates/slides-2/server/handlers/import/html-converter.ts +1534 -0
  1027. package/corpus/templates/slides-2/server/handlers/import/pdf-fidelity-parser.ts +1039 -0
  1028. package/corpus/templates/slides-2/server/handlers/import/pdf-sidecar-reader.ts +81 -0
  1029. package/corpus/templates/slides-2/server/handlers/import/pdf-style-digest.ts +187 -0
  1030. package/corpus/templates/slides-2/server/handlers/import/pptx-assets.ts +155 -0
  1031. package/corpus/templates/slides-2/server/handlers/import/pptx-parser.ts +57 -0
  1032. package/corpus/templates/slides-2/server/handlers/request-auth-context.ts +108 -0
  1033. package/corpus/templates/slides-2/server/handlers/share.ts +52 -0
  1034. package/corpus/templates/slides-2/server/handlers/uploads-chunked.ts +1066 -0
  1035. package/corpus/templates/slides-2/server/handlers/uploads.ts +457 -0
  1036. package/corpus/templates/slides-2/server/lib/access-request-email.ts +66 -0
  1037. package/corpus/templates/slides-2/server/lib/assets-image-delegation.ts +331 -0
  1038. package/corpus/templates/slides-2/server/lib/bounded-multipart.ts +49 -0
  1039. package/corpus/templates/slides-2/server/lib/builder-design-system-proxy.ts +122 -0
  1040. package/corpus/templates/slides-2/server/lib/chat-attachments.ts +425 -0
  1041. package/corpus/templates/slides-2/server/lib/chatgpt-directory-tools.ts +246 -0
  1042. package/corpus/templates/slides-2/server/lib/chunked-upload-session.ts +195 -0
  1043. package/corpus/templates/slides-2/server/lib/comment-notifications.ts +184 -0
  1044. package/corpus/templates/slides-2/server/lib/deck-access-requests.ts +102 -0
  1045. package/corpus/templates/slides-2/server/lib/deck-asset-scope.ts +150 -0
  1046. package/corpus/templates/slides-2/server/lib/deck-export-tracking.ts +119 -0
  1047. package/corpus/templates/slides-2/server/lib/deck-templates/a-case-study.ts +154 -0
  1048. package/corpus/templates/slides-2/server/lib/deck-templates/a-company.ts +160 -0
  1049. package/corpus/templates/slides-2/server/lib/deck-templates/a-pitch.ts +151 -0
  1050. package/corpus/templates/slides-2/server/lib/deck-templates/a-quarterly.ts +264 -0
  1051. package/corpus/templates/slides-2/server/lib/deck-templates/a-shared.ts +35 -0
  1052. package/corpus/templates/slides-2/server/lib/deck-templates/a-update.ts +188 -0
  1053. package/corpus/templates/slides-2/server/lib/deck-templates/a-workshop.ts +196 -0
  1054. package/corpus/templates/slides-2/server/lib/deck-templates/b-keynote.ts +131 -0
  1055. package/corpus/templates/slides-2/server/lib/deck-templates/b-lesson.ts +209 -0
  1056. package/corpus/templates/slides-2/server/lib/deck-templates/b-manifesto.ts +149 -0
  1057. package/corpus/templates/slides-2/server/lib/deck-templates/b-portfolio.ts +144 -0
  1058. package/corpus/templates/slides-2/server/lib/deck-templates/b-research.ts +221 -0
  1059. package/corpus/templates/slides-2/server/lib/deck-templates/b-roadmap.ts +264 -0
  1060. package/corpus/templates/slides-2/server/lib/deck-templates/b-shared.ts +44 -0
  1061. package/corpus/templates/slides-2/server/lib/deck-templates/group-a.ts +16 -0
  1062. package/corpus/templates/slides-2/server/lib/deck-templates/group-b.ts +16 -0
  1063. package/corpus/templates/slides-2/server/lib/deck-templates/legacy.ts +567 -0
  1064. package/corpus/templates/slides-2/server/lib/deck-templates.ts +60 -0
  1065. package/corpus/templates/slides-2/server/lib/deck-versions.ts +233 -0
  1066. package/corpus/templates/slides-2/server/lib/design-system-workflows.ts +22 -0
  1067. package/corpus/templates/slides-2/server/lib/emails.ts +84 -0
  1068. package/corpus/templates/slides-2/server/lib/env-config.ts +15 -0
  1069. package/corpus/templates/slides-2/server/lib/fetch-remote-image.ts +245 -0
  1070. package/corpus/templates/slides-2/server/lib/generation-completion.ts +278 -0
  1071. package/corpus/templates/slides-2/server/lib/google-docs-access.ts +51 -0
  1072. package/corpus/templates/slides-2/server/lib/google-docs-error.ts +54 -0
  1073. package/corpus/templates/slides-2/server/lib/google-docs-oauth.ts +422 -0
  1074. package/corpus/templates/slides-2/server/lib/google-fonts.ts +509 -0
  1075. package/corpus/templates/slides-2/server/lib/google-oauth-preflight.ts +119 -0
  1076. package/corpus/templates/slides-2/server/lib/google-slides-export-availability.ts +55 -0
  1077. package/corpus/templates/slides-2/server/lib/image-proxy-response.ts +16 -0
  1078. package/corpus/templates/slides-2/server/lib/image-proxy-url.ts +155 -0
  1079. package/corpus/templates/slides-2/server/lib/import-asset-storage.ts +214 -0
  1080. package/corpus/templates/slides-2/server/lib/imported-asset-batch.ts +218 -0
  1081. package/corpus/templates/slides-2/server/lib/legacy-slide-source.ts +692 -0
  1082. package/corpus/templates/slides-2/server/lib/media-search-providers.ts +216 -0
  1083. package/corpus/templates/slides-2/server/lib/native-creative-context.ts +295 -0
  1084. package/corpus/templates/slides-2/server/lib/pdf-parse-setup.ts +115 -0
  1085. package/corpus/templates/slides-2/server/lib/provider-api.ts +57 -0
  1086. package/corpus/templates/slides-2/server/lib/request-wait-until.ts +30 -0
  1087. package/corpus/templates/slides-2/server/lib/shared-deck.ts +29 -0
  1088. package/corpus/templates/slides-2/server/lib/slide-asset-references.ts +309 -0
  1089. package/corpus/templates/slides-2/server/lib/slide-content-patch.ts +1004 -0
  1090. package/corpus/templates/slides-2/server/lib/slide-hygiene.ts +731 -0
  1091. package/corpus/templates/slides-2/server/lib/slide-image-insertion.ts +136 -0
  1092. package/corpus/templates/slides-2/server/lib/slide-reveal-issues.ts +41 -0
  1093. package/corpus/templates/slides-2/server/lib/slide-source-editing/babel-walk.ts +117 -0
  1094. package/corpus/templates/slides-2/server/lib/slide-source-editing/batch-edit.ts +152 -0
  1095. package/corpus/templates/slides-2/server/lib/slide-source-editing/edit-ops.ts +1478 -0
  1096. package/corpus/templates/slides-2/server/lib/slide-source-editing/image-target.ts +128 -0
  1097. package/corpus/templates/slides-2/server/lib/slide-source-editing/text-diff.ts +23 -0
  1098. package/corpus/templates/slides-2/server/lib/slide-source-limits.ts +9 -0
  1099. package/corpus/templates/slides-2/server/lib/slide-source.ts +1786 -0
  1100. package/corpus/templates/slides-2/server/lib/slide-theme-demo-sources.ts +2106 -0
  1101. package/corpus/templates/slides-2/server/lib/slide-themes.ts +2174 -0
  1102. package/corpus/templates/slides-2/server/lib/slide-worker-runtime.ts +1995 -0
  1103. package/corpus/templates/slides-2/server/lib/slides-tracking.ts +73 -0
  1104. package/corpus/templates/slides-2/server/lib/source-import.ts +213 -0
  1105. package/corpus/templates/slides-2/server/lib/svgl.ts +364 -0
  1106. package/corpus/templates/slides-2/server/lib/tenant-files.ts +179 -0
  1107. package/corpus/templates/slides-2/server/lib/upload-storage-status.ts +9 -0
  1108. package/corpus/templates/slides-2/server/lib/uploaded-asset-cleanup-outbox.ts +521 -0
  1109. package/corpus/templates/slides-2/server/lib/uploaded-asset-object-lifecycle.ts +404 -0
  1110. package/corpus/templates/slides-2/server/lib/uploaded-fonts.ts +696 -0
  1111. package/corpus/templates/slides-2/server/lib/uploaded-reference-storage.ts +77 -0
  1112. package/corpus/templates/slides-2/server/lib/validate-slide-animations.ts +341 -0
  1113. package/corpus/templates/slides-2/server/middleware/auth.ts +6 -0
  1114. package/corpus/templates/slides-2/server/plugins/_dev-upload-stub.ts +6 -0
  1115. package/corpus/templates/slides-2/server/plugins/agent-chat.ts +402 -0
  1116. package/corpus/templates/slides-2/server/plugins/auth.ts +31 -0
  1117. package/corpus/templates/slides-2/server/plugins/collab.ts +30 -0
  1118. package/corpus/templates/slides-2/server/plugins/config.ts +6 -0
  1119. package/corpus/templates/slides-2/server/plugins/core-routes.ts +30 -0
  1120. package/corpus/templates/slides-2/server/plugins/creative-context.ts +187 -0
  1121. package/corpus/templates/slides-2/server/plugins/db.ts +462 -0
  1122. package/corpus/templates/slides-2/server/plugins/feature-flags.ts +5 -0
  1123. package/corpus/templates/slides-2/server/plugins/labs.ts +8 -0
  1124. package/corpus/templates/slides-2/server/plugins/orphaned-asset-cleanup.ts +17 -0
  1125. package/corpus/templates/slides-2/server/plugins/otel.ts +6 -0
  1126. package/corpus/templates/slides-2/server/plugins/transactional-emails.ts +5 -0
  1127. package/corpus/templates/slides-2/server/register-secrets.ts +209 -0
  1128. package/corpus/templates/slides-2/server/routes/[...page].get.ts +5 -0
  1129. package/corpus/templates/slides-2/server/routes/[...page].head.ts +1 -0
  1130. package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/auth-url.get.ts +1 -0
  1131. package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/callback.get.ts +1 -0
  1132. package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/auth-url.get.ts +1 -0
  1133. package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/callback.get.ts +1 -0
  1134. package/corpus/templates/slides-2/server/routes/api/assets/upload-video.post.ts +1 -0
  1135. package/corpus/templates/slides-2/server/routes/api/assets/upload.post.ts +1 -0
  1136. package/corpus/templates/slides-2/server/routes/api/assets/video-uploads.delete.ts +1 -0
  1137. package/corpus/templates/slides-2/server/routes/api/deck-agent-context.json.get.ts +105 -0
  1138. package/corpus/templates/slides-2/server/routes/api/decks/events.get.ts +1 -0
  1139. package/corpus/templates/slides-2/server/routes/api/demo.get.ts +1 -0
  1140. package/corpus/templates/slides-2/server/routes/api/exports/[filename].get.ts +221 -0
  1141. package/corpus/templates/slides-2/server/routes/api/exports/google-slides.post.ts +240 -0
  1142. package/corpus/templates/slides-2/server/routes/api/exports/html.post.ts +67 -0
  1143. package/corpus/templates/slides-2/server/routes/api/exports/pptx.post.ts +100 -0
  1144. package/corpus/templates/slides-2/server/routes/api/gen-preview/[...].get.ts +24 -0
  1145. package/corpus/templates/slides-2/server/routes/api/generated/[...].get.ts +24 -0
  1146. package/corpus/templates/slides-2/server/routes/api/image-proxy.get.ts +518 -0
  1147. package/corpus/templates/slides-2/server/routes/api/import-assets/[token].get.ts +70 -0
  1148. package/corpus/templates/slides-2/server/routes/api/preview-images.get.ts +20 -0
  1149. package/corpus/templates/slides-2/server/routes/api/share/[token].get.ts +1 -0
  1150. package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/chunk.post.ts +1 -0
  1151. package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/status.get.ts +1 -0
  1152. package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId].delete.ts +1 -0
  1153. package/corpus/templates/slides-2/server/routes/api/uploads-chunked/start.post.ts +1 -0
  1154. package/corpus/templates/slides-2/server/routes/api/uploads.delete.ts +1 -0
  1155. package/corpus/templates/slides-2/server/routes/api/uploads.post.ts +1 -0
  1156. package/corpus/templates/slides-2/server/workspace-defaults.ts +196 -0
  1157. package/corpus/templates/slides-2/shared/action-ui.ts +147 -0
  1158. package/corpus/templates/slides-2/shared/agent-readable.ts +2 -0
  1159. package/corpus/templates/slides-2/shared/api.ts +406 -0
  1160. package/corpus/templates/slides-2/shared/app-state-tabs.ts +30 -0
  1161. package/corpus/templates/slides-2/shared/app-storage.ts +9 -0
  1162. package/corpus/templates/slides-2/shared/aspect-ratios.ts +49 -0
  1163. package/corpus/templates/slides-2/shared/blank-slide.ts +179 -0
  1164. package/corpus/templates/slides-2/shared/client-compatibility.ts +2 -0
  1165. package/corpus/templates/slides-2/shared/contrast-audit.ts +255 -0
  1166. package/corpus/templates/slides-2/shared/deck-access.ts +26 -0
  1167. package/corpus/templates/slides-2/shared/deck-app-scope.ts +14 -0
  1168. package/corpus/templates/slides-2/shared/deck-content.ts +37 -0
  1169. package/corpus/templates/slides-2/shared/deck-history-control.ts +79 -0
  1170. package/corpus/templates/slides-2/shared/deck-scope.ts +5 -0
  1171. package/corpus/templates/slides-2/shared/deck-title.ts +199 -0
  1172. package/corpus/templates/slides-2/shared/deck-write.ts +61 -0
  1173. package/corpus/templates/slides-2/shared/design-flags.ts +7 -0
  1174. package/corpus/templates/slides-2/shared/design-system-validation.ts +88 -0
  1175. package/corpus/templates/slides-2/shared/editor-control.ts +120 -0
  1176. package/corpus/templates/slides-2/shared/generation-timing.ts +19 -0
  1177. package/corpus/templates/slides-2/shared/google-docs.ts +69 -0
  1178. package/corpus/templates/slides-2/shared/labs.ts +10 -0
  1179. package/corpus/templates/slides-2/shared/overview-navigation.ts +34 -0
  1180. package/corpus/templates/slides-2/shared/ownership.ts +6 -0
  1181. package/corpus/templates/slides-2/shared/pdf-sidecar.ts +130 -0
  1182. package/corpus/templates/slides-2/shared/presenter-control.ts +111 -0
  1183. package/corpus/templates/slides-2/shared/representative-slide.ts +89 -0
  1184. package/corpus/templates/slides-2/shared/slide-background.ts +30 -0
  1185. package/corpus/templates/slides-2/shared/slide-comment-anchor.ts +117 -0
  1186. package/corpus/templates/slides-2/shared/slide-comment-reactions.ts +47 -0
  1187. package/corpus/templates/slides-2/shared/slide-design-tokens.ts +92 -0
  1188. package/corpus/templates/slides-2/shared/slide-fit.ts +78 -0
  1189. package/corpus/templates/slides-2/shared/slide-ids.ts +133 -0
  1190. package/corpus/templates/slides-2/shared/slide-number.ts +124 -0
  1191. package/corpus/templates/slides-2/shared/slide-object-structure.ts +790 -0
  1192. package/corpus/templates/slides-2/shared/slide-text-range-selection.ts +50 -0
  1193. package/corpus/templates/slides-2/shared/slide-transitions.ts +70 -0
  1194. package/corpus/templates/slides-2/shared/slides-2-transition.ts +194 -0
  1195. package/corpus/templates/slides-2/shared/slides-user-prefs.ts +22 -0
  1196. package/corpus/templates/slides-2/shared/source-import-errors.ts +12 -0
  1197. package/corpus/templates/slides-2/shared/source-runtime-export.ts +76 -0
  1198. package/corpus/templates/slides-2/shared/upload-types.ts +41 -0
  1199. package/corpus/templates/slides-2/ssr-entry.ts +11 -0
  1200. package/corpus/templates/slides-2/tsconfig.json +27 -0
  1201. package/corpus/templates/slides-2/vite.config.ts +77 -0
  1202. package/corpus/templates/slides-2/vitest.config.ts +28 -0
  1203. package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +1 -1
  1204. package/package.json +1 -1
  1205. package/corpus/templates/design/.agents/skills/shader-fills/SKILL.md +0 -182
  1206. package/corpus/templates/design/actions/apply-shader-fill.ts +0 -450
  1207. package/corpus/templates/design/actions/apply-shader.ts +0 -257
  1208. package/corpus/templates/design/actions/preview-shader-fill.ts +0 -157
  1209. package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +0 -1144
  1210. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +0 -450
  1211. package/corpus/templates/design/app/components/design/inspector/ShaderControls.stories.tsx +0 -71
  1212. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +0 -555
  1213. package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +0 -105
  1214. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +0 -433
  1215. package/corpus/templates/design/app/components/design/inspector/color-picker-shader-pane.tsx +0 -648
  1216. package/corpus/templates/design/shared/shader-fill.ts +0 -174
  1217. package/corpus/templates/design/shared/shader-presets.ts +0 -1523
@@ -8,6 +8,7 @@ import {
8
8
  feedbackUniformProperties,
9
9
  planEffectGraph,
10
10
  type EffectPass,
11
+ type EffectMeshSpec,
11
12
  type EffectResourceSpec,
12
13
  } from "../../../../shared/effect-graph";
13
14
  import { resolveNativeClipRadii } from "../../../../shared/native-clip-geometry";
@@ -30,6 +31,7 @@ import {
30
31
  parseNativeEffectApprovalState,
31
32
  } from "../../../../shared/native-effect-trust";
32
33
  import {
34
+ nativeEffectUniformFloats,
33
35
  packNativeProperties,
34
36
  validateEffectDocument,
35
37
  usesRetiredNativeImageAbi,
@@ -53,7 +55,10 @@ import {
53
55
  nativeFeedbackResetValuesChanged,
54
56
  type NativeFeedbackDefinition,
55
57
  } from "../../../../shared/native-feedback-plan";
56
- import { planNativeInputResources } from "../../../../shared/native-input-resources";
58
+ import {
59
+ nativeWorkerSupportsInputResources,
60
+ planNativeInputResources,
61
+ } from "../../../../shared/native-input-resources";
57
62
  import {
58
63
  hashEffectInstance,
59
64
  type NativeInstancePreviewRequest,
@@ -143,6 +148,12 @@ import {
143
148
  NativeDeviceLifecycleError,
144
149
  type NativeDeviceScope,
145
150
  } from "./native-device-lifecycle";
151
+ import {
152
+ isNativeElement,
153
+ isNativeHtmlElement,
154
+ isNativeHtmlTag,
155
+ isNativeSvgRoot,
156
+ } from "./native-dom";
146
157
  import {
147
158
  planNativeChainedEffectExtent,
148
159
  planNativeFillPresentationExtent,
@@ -177,6 +188,11 @@ import {
177
188
  NativeCameraError,
178
189
  NativeLiveCameraSource,
179
190
  } from "./native-live-camera-source";
191
+ import {
192
+ acquireNativeMeshGrid,
193
+ nativeMeshGridBytes,
194
+ type NativeMeshGridLease,
195
+ } from "./native-mesh-grid";
180
196
  import {
181
197
  emptyNativeBenchmarkPhaseValues,
182
198
  emptyNativeBenchmarkFullFrameValues,
@@ -194,6 +210,10 @@ import {
194
210
  planNativeMountedOutputReadback,
195
211
  withNativeMountedTextureReadback,
196
212
  } from "./native-mounted-output-summary";
213
+ import {
214
+ isOpaquePublicAssetPreview,
215
+ resolveOpaquePublicAssetBlob,
216
+ } from "./native-opaque-public-asset";
197
217
  import {
198
218
  NativePackedUniformArena,
199
219
  type NativePackedUniformFrame,
@@ -221,6 +241,8 @@ import {
221
241
  import { planNativePreviewBudget } from "./native-preview-budget";
222
242
  import {
223
243
  fitNativeRasterDensity,
244
+ nativePreviewStableAllocationOrExactViewport,
245
+ nativePreviewStablePhysicalViewport,
224
246
  nativePreviewPhysicalViewport,
225
247
  nativePreviewBoxesOverlap,
226
248
  nativePreviewTargetDensity,
@@ -234,6 +256,12 @@ import {
234
256
  resolveNativePreviewPolicy,
235
257
  type NativePreviewStatus,
236
258
  } from "./native-preview-policy";
259
+ import {
260
+ isTrustedOpaquePreviewViewportPortResponse,
261
+ NATIVE_PREVIEW_VIEWPORT_REQUEST_MESSAGE,
262
+ type NativePreviewViewportRequest,
263
+ type NativePreviewViewportResponse,
264
+ } from "./native-preview-viewport-transport";
237
265
  import { NativeRafIntervalTelemetry } from "./native-raf-interval";
238
266
  import {
239
267
  buildNativeReceiverFields,
@@ -242,6 +270,14 @@ import {
242
270
  import { beginNativeRegionExport } from "./native-region-export";
243
271
  import { nativeRenderPlacementConstants } from "./native-render-placement";
244
272
  import { createNativeRuntimeEpoch } from "./native-runtime-epoch";
273
+ import {
274
+ attachNativeScenePresentationCanvas,
275
+ supportsNativeSceneBodyTransform,
276
+ } from "./native-scene-body-transform";
277
+ import {
278
+ isNativeScenePresentationElement,
279
+ type NativeScenePresentationElement,
280
+ } from "./native-scene-presentation-element";
245
281
  import {
246
282
  NativeSimulationTimelineError,
247
283
  planNativeSimulationSteps,
@@ -331,6 +367,7 @@ import {
331
367
  import { NativeWorkerHostError } from "./native-worker-host";
332
368
  import {
333
369
  NativeWorkerSceneHost,
370
+ NativeWorkerSceneSourceError,
334
371
  type NativeWorkerSceneEntry,
335
372
  } from "./native-worker-scene-host";
336
373
 
@@ -955,6 +992,10 @@ const definitionKey = (id: string, version: number): string =>
955
992
  const MAX_DIMENSION = 4096;
956
993
  const MAX_PIXELS = 8_388_608;
957
994
  const MAX_RESOURCE_BYTES = 134_217_728;
995
+ const MAX_LEGACY_PREVIEW_PIXELS = Math.min(
996
+ MAX_PIXELS,
997
+ Math.floor(MAX_RESOURCE_BYTES / 40),
998
+ );
958
999
  const MAX_REALM_TEXTURE_BYTES = 402_653_184;
959
1000
  const unavailableFeedbackStateFollowups = {
960
1001
  sourceTransition: {
@@ -1012,19 +1053,11 @@ function awaitInputDecode<T>(
1012
1053
  });
1013
1054
  }
1014
1055
 
1015
- type NativeScenePresentationElement = HTMLElement | SVGSVGElement;
1016
-
1017
- function isNativeScenePresentationElement(
1018
- element: Element,
1019
- ): element is NativeScenePresentationElement {
1020
- return element instanceof HTMLElement || element instanceof SVGSVGElement;
1021
- }
1022
-
1023
1056
  export function nativePresentationTargetLayout(
1024
1057
  target: HTMLElement | SVGSVGElement,
1025
1058
  ) {
1026
1059
  const style = getComputedStyle(target);
1027
- if (target instanceof HTMLElement)
1060
+ if (isNativeHtmlElement(target))
1028
1061
  return {
1029
1062
  width: target.offsetWidth,
1030
1063
  height: target.offsetHeight,
@@ -1037,7 +1070,7 @@ export function nativePresentationTargetLayout(
1037
1070
  scale: style.scale,
1038
1071
  };
1039
1072
  const parent = target.parentElement;
1040
- if (!(parent instanceof HTMLElement))
1073
+ if (!isNativeHtmlElement(parent))
1041
1074
  throw new NativeSourceError(
1042
1075
  "source-inline-svg",
1043
1076
  "A native SVG target needs an HTML parent.",
@@ -1069,28 +1102,43 @@ class NativeShaderRuntime {
1069
1102
  readonly epoch = createNativeRuntimeEpoch();
1070
1103
  private readonly exportInitialPixelRatio: number | null;
1071
1104
  constructor(private readonly runtimeScript: Node | null) {
1072
- const encoded =
1073
- runtimeScript instanceof HTMLScriptElement
1074
- ? runtimeScript.getAttribute(
1075
- "data-agent-native-export-initial-pixel-ratio",
1076
- )
1077
- : null;
1078
- if (encoded === null) {
1079
- this.exportInitialPixelRatio = null;
1080
- return;
1105
+ const encoded = isNativeHtmlTag(runtimeScript, "script")
1106
+ ? runtimeScript.getAttribute(
1107
+ "data-agent-native-export-initial-pixel-ratio",
1108
+ )
1109
+ : null;
1110
+ if (encoded === null) this.exportInitialPixelRatio = null;
1111
+ else {
1112
+ const ratio = Number(encoded);
1113
+ if (
1114
+ !Number.isFinite(ratio) ||
1115
+ ratio <= 0 ||
1116
+ ratio > 4 ||
1117
+ String(ratio) !== encoded
1118
+ )
1119
+ throw new NativeSourceError(
1120
+ "export-initial-density-invalid",
1121
+ "export-initial-density-invalid",
1122
+ );
1123
+ this.exportInitialPixelRatio = ratio;
1124
+ }
1125
+ const encodedEpoch = isNativeHtmlTag(runtimeScript, "script")
1126
+ ? runtimeScript.getAttribute("data-agent-native-animation-epoch-ms")
1127
+ : null;
1128
+ if (encodedEpoch !== null) {
1129
+ const epoch = Number(encodedEpoch);
1130
+ if (
1131
+ !Number.isFinite(epoch) ||
1132
+ epoch <= 0 ||
1133
+ epoch > 8.64e15 ||
1134
+ String(epoch) !== encodedEpoch
1135
+ )
1136
+ throw new NativeSourceError(
1137
+ "preview-animation-epoch-invalid",
1138
+ "The shared preview animation epoch is invalid.",
1139
+ );
1140
+ this.clockOrigin = epoch - performance.timeOrigin;
1081
1141
  }
1082
- const ratio = Number(encoded);
1083
- if (
1084
- !Number.isFinite(ratio) ||
1085
- ratio <= 0 ||
1086
- ratio > 4 ||
1087
- String(ratio) !== encoded
1088
- )
1089
- throw new NativeSourceError(
1090
- "export-initial-density-invalid",
1091
- "export-initial-density-invalid",
1092
- );
1093
- this.exportInitialPixelRatio = ratio;
1094
1142
  }
1095
1143
  private device: GPUDevice | null = null;
1096
1144
  private deviceLifecycle = new NativeDeviceLifecycle<NativeDeviceResources>(
@@ -1123,6 +1171,8 @@ class NativeShaderRuntime {
1123
1171
  private finishPipeline: GPURenderPipeline | null = null;
1124
1172
  private effectPipelineLayouts = new Map<number, GPUPipelineLayout>();
1125
1173
  private pipelines = new NativePipelineCache<GPURenderPipeline>(MAX_PIPELINES);
1174
+ private meshGrids = new Map<string, NativeMeshGridLease>();
1175
+ private allocatedMeshBytes = 0;
1126
1176
  private simulationComputePipelines =
1127
1177
  new NativePipelineCache<GPUComputePipeline>(16);
1128
1178
  private simulationRenderPipelines =
@@ -1155,6 +1205,8 @@ class NativeShaderRuntime {
1155
1205
  private workerPreviewBase: EffectInstance | null = null;
1156
1206
  private legacyDraftSession = false;
1157
1207
  private workerCapabilityBlocked = false;
1208
+ private workerRootSourceBlocked = false;
1209
+ private workerSourceRetryTimer = 0;
1158
1210
  private workerRecoveryAttempts = 0;
1159
1211
  private workerRecoveryQueued = false;
1160
1212
  private cameraReportedState = "idle";
@@ -1361,13 +1413,27 @@ class NativeShaderRuntime {
1361
1413
  } | null = null;
1362
1414
  private previewPolicy = new NativePreviewPolicyController();
1363
1415
  private previewViewport: NativePreviewBox | null = null;
1416
+ private previewAllocationViewport: NativePreviewBox | null = null;
1417
+ private previewMaxViewportWidth: number | null = null;
1418
+ private previewMaxViewportHeight: number | null = null;
1364
1419
  private previewDisplayScale = 1;
1365
1420
  private previewHostObserver: MutationObserver | null = null;
1366
1421
  private previewHostResizeObserver: ResizeObserver | null = null;
1367
1422
  private previewHostParent: Window | null = null;
1368
1423
  private previewHostFrame = 0;
1424
+ private previewHostRafHost: Window | null = null;
1369
1425
  private previewHostFramePending = false;
1370
1426
  private previewHostGeneration = 0;
1427
+ private opaquePreviewViewportNonce: string | null = null;
1428
+ private opaquePreviewViewportRequest: NativePreviewViewportRequest | null =
1429
+ null;
1430
+ private opaquePreviewViewportPort: MessagePort | null = null;
1431
+ private opaquePreviewViewportReceived = false;
1432
+ private opaquePreviewHostPixelRatio: number | null = null;
1433
+ private opaquePreviewViewportRetries = 0;
1434
+ private opaquePreviewViewportExhausted = false;
1435
+ private opaquePreviewViewportTimer: ReturnType<typeof setTimeout> | null =
1436
+ null;
1371
1437
  private previewFrameHostGeneration = 0;
1372
1438
  private previewTargetDensities = new Map<
1373
1439
  NativeScenePresentationElement,
@@ -1533,13 +1599,82 @@ class NativeShaderRuntime {
1533
1599
  if (mount.instance.placement === "backdrop") {
1534
1600
  this.showOriginal(mount);
1535
1601
  } else if (mount.outputTexture && mount.suppressed) {
1536
- this.syncPresentation(mount);
1602
+ if (mount.outputExtent && this.refreshPresentationGeometry(mount))
1603
+ this.syncPresentation(mount);
1604
+ else this.showOriginal(mount);
1537
1605
  } else {
1538
1606
  this.showOriginal(mount);
1539
1607
  }
1540
1608
  }
1541
1609
  }
1542
1610
 
1611
+ private refreshPresentationGeometry(mount: Mount): boolean {
1612
+ const outputExtent = mount.outputExtent;
1613
+ if (!outputExtent) return false;
1614
+ this.reconcilePresentation(mount);
1615
+ const presentationExtent =
1616
+ mount.instance.placement === "fill" && mount.isTopLayer
1617
+ ? (mount.fillPresentationExtent ?? outputExtent)
1618
+ : outputExtent;
1619
+ if (presentationExtent.expanded) {
1620
+ for (
1621
+ let node: Element | null = mount.target;
1622
+ node;
1623
+ node = node.parentElement
1624
+ )
1625
+ if (!supportsNativeOutput2D(getComputedStyle(node))) return false;
1626
+ }
1627
+ return this.projectPresentationGeometry(
1628
+ mount,
1629
+ presentationExtent,
1630
+ outputExtent.pixelRatio,
1631
+ );
1632
+ }
1633
+
1634
+ private projectPresentationGeometry(
1635
+ mount: Mount,
1636
+ presentationExtent: NativeEffectExtentPlan,
1637
+ pixelRatio: number,
1638
+ ): boolean {
1639
+ const targetLayout = nativePresentationTargetLayout(mount.target);
1640
+ const { left, top } = presentationExtent;
1641
+ const style = getComputedStyle(mount.target);
1642
+ const geometry = planNativeOutputGeometry({
1643
+ offsetLeft: targetLayout.offsetLeft,
1644
+ offsetTop: targetLayout.offsetTop,
1645
+ width: targetLayout.width,
1646
+ height: targetLayout.height,
1647
+ extent: presentationExtent,
1648
+ transformOrigin: targetLayout.transformOrigin,
1649
+ });
1650
+ if (presentationExtent.expanded && !geometry) return false;
1651
+ mount.canvas.style.left = `${geometry?.left ?? targetLayout.offsetLeft - left / pixelRatio}px`;
1652
+ mount.canvas.style.top = `${geometry?.top ?? targetLayout.offsetTop - top / pixelRatio}px`;
1653
+ mount.canvas.style.width = `${geometry?.width ?? targetLayout.width + (left + presentationExtent.right) / pixelRatio}px`;
1654
+ mount.canvas.style.height = `${geometry?.height ?? targetLayout.height + (top + presentationExtent.bottom) / pixelRatio}px`;
1655
+ mount.canvas.style.transform = targetLayout.transform;
1656
+ mount.canvas.style.translate = targetLayout.translate;
1657
+ mount.canvas.style.rotate = targetLayout.rotate;
1658
+ mount.canvas.style.scale = targetLayout.scale;
1659
+ mount.canvas.style.transformOrigin =
1660
+ geometry?.transformOrigin ?? targetLayout.transformOrigin;
1661
+ mount.canvas.style.borderRadius =
1662
+ mount.instance.placement === "fill" || presentationExtent.expanded
1663
+ ? "0"
1664
+ : style.borderRadius;
1665
+ if (mount.instance.placement === "fill")
1666
+ mount.canvas.style.opacity =
1667
+ mount.target.getAttribute("data-an-native-authored-opacity") ??
1668
+ style.opacity;
1669
+ else if (mount.instance.placement === "layer")
1670
+ mount.canvas.style.opacity = mount.layerSourceOpacityDeferred
1671
+ ? (mount.target.getAttribute("data-an-native-authored-opacity") ??
1672
+ style.opacity)
1673
+ : "";
1674
+ mount.canvas.style.zIndex = style.zIndex === "auto" ? "auto" : style.zIndex;
1675
+ return true;
1676
+ }
1677
+
1543
1678
  private groupLocalNoncontributing(mount: Mount): boolean {
1544
1679
  if (mount.instance.placement !== "backdrop") return false;
1545
1680
  const owner = this.nestedBackdropOwner(mount.target);
@@ -1615,6 +1750,7 @@ class NativeShaderRuntime {
1615
1750
  height: innerHeight,
1616
1751
  pixelRatio: this.previewStatus().effectivePixelRatio,
1617
1752
  viewport: this.previewViewport,
1753
+ allocationViewport: this.previewAllocationViewport,
1618
1754
  deviceEpoch: this.deviceEpoch,
1619
1755
  media: [...document.querySelectorAll("img,video,source")].map(
1620
1756
  (element) => [
@@ -1712,13 +1848,7 @@ class NativeShaderRuntime {
1712
1848
  "scene-background-unsupported",
1713
1849
  "A translucent or image root background needs a single captured presentation layer.",
1714
1850
  );
1715
- if (
1716
- bodyStyle.transform !== "none" ||
1717
- bodyStyle.translate !== "none" ||
1718
- bodyStyle.rotate !== "none" ||
1719
- bodyStyle.scale !== "none" ||
1720
- bodyStyle.opacity !== "1"
1721
- )
1851
+ if (!supportsNativeSceneBodyTransform(bodyStyle))
1722
1852
  throw new NativeSourceError(
1723
1853
  "scene-presentation-transform-unsupported",
1724
1854
  "A transformed or translucent body needs a viewport presentation transform.",
@@ -1726,8 +1856,9 @@ class NativeShaderRuntime {
1726
1856
  const viewport =
1727
1857
  this.compositionPixelRatio === null &&
1728
1858
  this.exportInitialPixelRatio === null
1729
- ? this.previewViewport
1859
+ ? (this.previewAllocationViewport ?? this.previewViewport)
1730
1860
  : null;
1861
+ const stableAllocation = !!viewport && this.usesStablePreviewAllocation();
1731
1862
  const requestedRatio =
1732
1863
  this.compositionPixelRatio ?? this.scenePreviewPixelRatio();
1733
1864
  const dpr =
@@ -1745,7 +1876,9 @@ class NativeShaderRuntime {
1745
1876
  pixelPadding: 1,
1746
1877
  });
1747
1878
  const physical = viewport
1748
- ? nativePreviewPhysicalViewport(viewport, dpr)
1879
+ ? stableAllocation
1880
+ ? nativePreviewStablePhysicalViewport(viewport, dpr)
1881
+ : nativePreviewPhysicalViewport(viewport, dpr)
1749
1882
  : {
1750
1883
  x: 0,
1751
1884
  y: 0,
@@ -1754,12 +1887,14 @@ class NativeShaderRuntime {
1754
1887
  };
1755
1888
  const { width, height } = physical;
1756
1889
  const sceneViewport = viewport
1757
- ? {
1758
- x: physical.x / dpr,
1759
- y: physical.y / dpr,
1760
- width: width / dpr,
1761
- height: height / dpr,
1762
- }
1890
+ ? stableAllocation
1891
+ ? viewport
1892
+ : {
1893
+ x: physical.x / dpr,
1894
+ y: physical.y / dpr,
1895
+ width: width / dpr,
1896
+ height: height / dpr,
1897
+ }
1763
1898
  : undefined;
1764
1899
  if (
1765
1900
  width <= 0 ||
@@ -1798,7 +1933,7 @@ class NativeShaderRuntime {
1798
1933
  canvas.style.height = `${sceneViewport?.height ?? innerHeight}px`;
1799
1934
  canvas.width = width;
1800
1935
  canvas.height = height;
1801
- body.prepend(canvas);
1936
+ attachNativeScenePresentationCanvas(canvas, body, bodyStyle);
1802
1937
  const context = canvas.getContext("webgpu") as GPUCanvasContext | null;
1803
1938
  if (!context) {
1804
1939
  canvas.remove();
@@ -1895,6 +2030,7 @@ class NativeShaderRuntime {
1895
2030
  window.addEventListener("scroll", scene.onViewportChange, true);
1896
2031
  window.addEventListener("resize", scene.onViewportChange);
1897
2032
  }
2033
+ attachNativeScenePresentationCanvas(scene.canvas, body, bodyStyle);
1898
2034
  const viewportMatches = (): boolean =>
1899
2035
  window.scrollX === 0 &&
1900
2036
  window.scrollY === 0 &&
@@ -2829,6 +2965,180 @@ class NativeShaderRuntime {
2829
2965
  return reservation.sample;
2830
2966
  }
2831
2967
 
2968
+ private requestOpaquePreviewViewport(): void {
2969
+ if (window.parent === window || window.frameElement) return;
2970
+ const origin = nativeDocumentOrigin();
2971
+ const width = window.innerWidth;
2972
+ const height = window.innerHeight;
2973
+ const prior = this.opaquePreviewViewportRequest;
2974
+ if (
2975
+ prior &&
2976
+ prior.width === width &&
2977
+ prior.height === height &&
2978
+ this.opaquePreviewViewportNonce
2979
+ ) {
2980
+ if (!this.opaquePreviewViewportExhausted)
2981
+ this.scheduleOpaquePreviewViewportRetry();
2982
+ return;
2983
+ }
2984
+ const nonce = this.opaquePreviewViewportNonce ?? window.crypto.randomUUID();
2985
+ const request: NativePreviewViewportRequest = {
2986
+ type: NATIVE_PREVIEW_VIEWPORT_REQUEST_MESSAGE,
2987
+ schemaVersion: 1,
2988
+ nonce,
2989
+ width,
2990
+ height,
2991
+ };
2992
+ this.opaquePreviewViewportNonce = nonce;
2993
+ this.opaquePreviewViewportRequest = request;
2994
+ this.opaquePreviewViewportReceived = false;
2995
+ this.opaquePreviewViewportRetries = 0;
2996
+ this.opaquePreviewViewportExhausted = false;
2997
+ if (this.opaquePreviewViewportTimer)
2998
+ clearTimeout(this.opaquePreviewViewportTimer);
2999
+ this.opaquePreviewViewportTimer = null;
3000
+ this.sendOpaquePreviewViewportRequest(request, origin);
3001
+ this.scheduleOpaquePreviewViewportRetry();
3002
+ }
3003
+
3004
+ private sendOpaquePreviewViewportRequest(
3005
+ request: NativePreviewViewportRequest,
3006
+ origin: string,
3007
+ ): void {
3008
+ this.opaquePreviewViewportPort?.close();
3009
+ const channel = new MessageChannel();
3010
+ this.opaquePreviewViewportPort = channel.port1;
3011
+ channel.port1.onmessage = (event: MessageEvent<unknown>) => {
3012
+ const candidate = {
3013
+ nonce: this.opaquePreviewViewportNonce,
3014
+ response: event.data,
3015
+ };
3016
+ if (!isTrustedOpaquePreviewViewportPortResponse(candidate)) return;
3017
+ this.acceptOpaquePreviewViewport(candidate.response);
3018
+ };
3019
+ channel.port1.start();
3020
+ window.parent.postMessage(request, origin, [channel.port2]);
3021
+ }
3022
+
3023
+ private scheduleOpaquePreviewViewportRetry(): void {
3024
+ const request = this.opaquePreviewViewportRequest;
3025
+ if (
3026
+ this.opaquePreviewViewportReceived ||
3027
+ this.opaquePreviewViewportExhausted ||
3028
+ this.opaquePreviewViewportTimer ||
3029
+ !request
3030
+ )
3031
+ return;
3032
+ this.opaquePreviewViewportTimer = setTimeout(() => {
3033
+ this.opaquePreviewViewportTimer = null;
3034
+ if (this.disposed || this.opaquePreviewViewportReceived) return;
3035
+ if (this.opaquePreviewViewportRetries < 3) {
3036
+ this.opaquePreviewViewportRetries += 1;
3037
+ try {
3038
+ this.sendOpaquePreviewViewportRequest(
3039
+ request,
3040
+ nativeDocumentOrigin(),
3041
+ );
3042
+ } catch (error) {
3043
+ this.issue("source-origin-unavailable", String(error));
3044
+ return;
3045
+ }
3046
+ this.scheduleOpaquePreviewViewportRetry();
3047
+ return;
3048
+ }
3049
+ const error = new NativeSourceError(
3050
+ "preview-viewport-unreadable",
3051
+ "The editor preview host did not provide viewport geometry.",
3052
+ );
3053
+ this.opaquePreviewViewportExhausted = true;
3054
+ this.issue(error.code, error.message);
3055
+ document.documentElement.setAttribute(
3056
+ "data-an-native-runtime-error",
3057
+ error.code,
3058
+ );
3059
+ }, 500);
3060
+ }
3061
+
3062
+ private acceptOpaquePreviewViewport(
3063
+ response: NativePreviewViewportResponse,
3064
+ ): void {
3065
+ if (
3066
+ window.frameElement ||
3067
+ window.parent === window ||
3068
+ response.nonce !== this.opaquePreviewViewportNonce ||
3069
+ response.width !== window.innerWidth ||
3070
+ response.height !== window.innerHeight
3071
+ )
3072
+ return;
3073
+ const wasReceived = this.opaquePreviewViewportReceived;
3074
+ this.opaquePreviewViewportReceived = true;
3075
+ if (this.opaquePreviewViewportTimer) {
3076
+ clearTimeout(this.opaquePreviewViewportTimer);
3077
+ this.opaquePreviewViewportTimer = null;
3078
+ }
3079
+ this.opaquePreviewViewportRetries = 0;
3080
+ this.opaquePreviewViewportExhausted = false;
3081
+ if (response.error) {
3082
+ this.issue(response.error.code, response.error.message);
3083
+ document.documentElement.setAttribute(
3084
+ "data-an-native-runtime-error",
3085
+ response.error.code,
3086
+ );
3087
+ return;
3088
+ }
3089
+ const previousViewport = this.previewViewport;
3090
+ const previousAllocationViewport = this.previewAllocationViewport;
3091
+ const previousMaxViewportWidth = this.previewMaxViewportWidth;
3092
+ const previousMaxViewportHeight = this.previewMaxViewportHeight;
3093
+ const previousScale = this.previewDisplayScale;
3094
+ const previousHostPixelRatio = this.opaquePreviewHostPixelRatio;
3095
+ this.opaquePreviewHostPixelRatio = response.hostDevicePixelRatio ?? null;
3096
+ const scale = response.displayScale;
3097
+ if (
3098
+ previousHostPixelRatio !== this.opaquePreviewHostPixelRatio ||
3099
+ Math.abs(scale - this.previewDisplayScale) > 0.0001 * Math.max(1, scale)
3100
+ ) {
3101
+ this.previewPolicy.resetDensityBudget();
3102
+ this.sceneBudgetFault = null;
3103
+ this.previewDisplayScale = scale;
3104
+ }
3105
+ this.previewViewport = response.viewport;
3106
+ this.previewMaxViewportWidth = response.maxViewportWidth;
3107
+ this.previewMaxViewportHeight = response.maxViewportHeight;
3108
+ this.previewAllocationViewport = this.planPreviewAllocationViewport(
3109
+ MAX_LEGACY_PREVIEW_PIXELS,
3110
+ );
3111
+ if (
3112
+ document.documentElement.getAttribute("data-an-native-runtime-error") ===
3113
+ "preview-viewport-unreadable"
3114
+ )
3115
+ document.documentElement.removeAttribute("data-an-native-runtime-error");
3116
+ const sameViewport =
3117
+ previousViewport === response.viewport ||
3118
+ (previousViewport !== null &&
3119
+ response.viewport !== null &&
3120
+ previousViewport.x === response.viewport.x &&
3121
+ previousViewport.y === response.viewport.y &&
3122
+ previousViewport.width === response.viewport.width &&
3123
+ previousViewport.height === response.viewport.height);
3124
+ if (
3125
+ wasReceived &&
3126
+ previousScale === this.previewDisplayScale &&
3127
+ previousHostPixelRatio === this.opaquePreviewHostPixelRatio &&
3128
+ sameViewport &&
3129
+ previousMaxViewportWidth === this.previewMaxViewportWidth &&
3130
+ previousMaxViewportHeight === this.previewMaxViewportHeight &&
3131
+ this.samePreviewBox(
3132
+ previousAllocationViewport,
3133
+ this.previewAllocationViewport,
3134
+ )
3135
+ )
3136
+ return;
3137
+ this.previewHostGeneration += 1;
3138
+ if (this.workerScene) this.onPreviewHostChange();
3139
+ else this.requestSourceFrame();
3140
+ }
3141
+
2832
3142
  private refreshPreviewViewport(): boolean {
2833
3143
  if (
2834
3144
  this.exportInitialPixelRatio !== null ||
@@ -2838,12 +3148,16 @@ class NativeShaderRuntime {
2838
3148
  try {
2839
3149
  const frame = window.frameElement;
2840
3150
  if (!frame) {
2841
- if (window.parent !== window)
2842
- throw new NativeSourceError(
2843
- "preview-viewport-unreadable",
2844
- "The editor preview frame is inaccessible.",
3151
+ if (window.parent !== window) {
3152
+ this.requestOpaquePreviewViewport();
3153
+ return (
3154
+ this.opaquePreviewViewportReceived && this.previewViewport !== null
2845
3155
  );
3156
+ }
2846
3157
  this.previewViewport = null;
3158
+ this.previewAllocationViewport = null;
3159
+ this.previewMaxViewportWidth = null;
3160
+ this.previewMaxViewportHeight = null;
2847
3161
  this.previewDisplayScale = 1;
2848
3162
  return true;
2849
3163
  }
@@ -2909,6 +3223,11 @@ class NativeShaderRuntime {
2909
3223
  this.previewDisplayScale = scale;
2910
3224
  }
2911
3225
  this.previewViewport = planned?.viewport ?? null;
3226
+ this.previewMaxViewportWidth = planned?.maxViewportWidth ?? null;
3227
+ this.previewMaxViewportHeight = planned?.maxViewportHeight ?? null;
3228
+ this.previewAllocationViewport = this.planPreviewAllocationViewport(
3229
+ MAX_LEGACY_PREVIEW_PIXELS,
3230
+ );
2912
3231
  return planned !== null;
2913
3232
  } catch (error) {
2914
3233
  if (error instanceof NativeSourceError) throw error;
@@ -2919,11 +3238,65 @@ class NativeShaderRuntime {
2919
3238
  }
2920
3239
  }
2921
3240
 
3241
+ private samePreviewBox(
3242
+ first: NativePreviewBox | null,
3243
+ second: NativePreviewBox | null,
3244
+ ): boolean {
3245
+ return (
3246
+ first === second ||
3247
+ (first !== null &&
3248
+ second !== null &&
3249
+ first.x === second.x &&
3250
+ first.y === second.y &&
3251
+ first.width === second.width &&
3252
+ first.height === second.height)
3253
+ );
3254
+ }
3255
+
3256
+ private planPreviewAllocationViewport(
3257
+ maxPixels: number,
3258
+ ): NativePreviewBox | null {
3259
+ const viewport = this.previewViewport;
3260
+ if (!viewport) return null;
3261
+ const maxViewportWidth = this.previewMaxViewportWidth;
3262
+ const maxViewportHeight = this.previewMaxViewportHeight;
3263
+ if (maxViewportWidth === null || maxViewportHeight === null)
3264
+ return viewport;
3265
+ return nativePreviewStableAllocationOrExactViewport({
3266
+ viewport,
3267
+ rootWidth: innerWidth,
3268
+ rootHeight: innerHeight,
3269
+ maxViewportWidth,
3270
+ maxViewportHeight,
3271
+ density: this.desiredScenePreviewPixelRatio(),
3272
+ maxDimension: MAX_DIMENSION,
3273
+ maxPixels,
3274
+ pixelPadding: 1,
3275
+ });
3276
+ }
3277
+
3278
+ private usesStablePreviewAllocation(): boolean {
3279
+ const raw = this.previewViewport;
3280
+ const allocation = this.previewAllocationViewport;
3281
+ return (
3282
+ raw !== null &&
3283
+ allocation !== null &&
3284
+ (allocation.width > raw.width + 0.0001 ||
3285
+ allocation.height > raw.height + 0.0001)
3286
+ );
3287
+ }
3288
+
2922
3289
  private observePreviewHost(): void {
2923
3290
  if (this.exportInitialPixelRatio !== null) return;
2924
3291
  document.addEventListener("visibilitychange", this.onPreviewHostChange);
2925
3292
  const frame = window.frameElement;
2926
- if (!frame) return;
3293
+ if (!frame) {
3294
+ if (window.parent !== window) {
3295
+ window.addEventListener("resize", this.onPreviewHostChange);
3296
+ this.requestOpaquePreviewViewport();
3297
+ }
3298
+ return;
3299
+ }
2927
3300
  this.previewHostObserver?.disconnect();
2928
3301
  this.previewHostResizeObserver?.disconnect();
2929
3302
  this.previewHostParent?.removeEventListener(
@@ -2956,6 +3329,15 @@ class NativeShaderRuntime {
2956
3329
 
2957
3330
  private onPreviewHostChange = (): void => {
2958
3331
  if (this.disposed) return;
3332
+ try {
3333
+ this.requestOpaquePreviewViewport();
3334
+ } catch (error) {
3335
+ this.issue(
3336
+ "source-origin-unavailable",
3337
+ error instanceof Error ? error.message : String(error),
3338
+ );
3339
+ return;
3340
+ }
2959
3341
  if (!this.workerScene) {
2960
3342
  this.previewHostGeneration += 1;
2961
3343
  this.requestSourceFrame();
@@ -2967,7 +3349,9 @@ class NativeShaderRuntime {
2967
3349
  }
2968
3350
  if (this.previewHostFramePending) return;
2969
3351
  this.previewHostFramePending = true;
2970
- this.previewHostFrame = window.parent.requestAnimationFrame(() => {
3352
+ const rafHost = window.frameElement ? window.parent : window;
3353
+ this.previewHostRafHost = rafHost;
3354
+ this.previewHostFrame = rafHost.requestAnimationFrame(() => {
2971
3355
  this.previewHostFramePending = false;
2972
3356
  this.previewHostFrame = 0;
2973
3357
  const scene = this.workerScene;
@@ -3001,9 +3385,13 @@ class NativeShaderRuntime {
3001
3385
  });
3002
3386
  };
3003
3387
 
3388
+ private previewDevicePixelRatio(): number {
3389
+ return this.opaquePreviewHostPixelRatio ?? (devicePixelRatio || 1);
3390
+ }
3391
+
3004
3392
  previewStatus = (): NativePreviewStatus => {
3005
3393
  const status = this.previewPolicy.status(
3006
- devicePixelRatio || 1,
3394
+ this.previewDevicePixelRatio(),
3007
3395
  this.renderWallSamples[this.renderWallSamples.length - 1],
3008
3396
  this.rafIntervalSamples[this.rafIntervalSamples.length - 1],
3009
3397
  );
@@ -3472,6 +3860,7 @@ class NativeShaderRuntime {
3472
3860
  }
3473
3861
 
3474
3862
  private clearDeviceResources(code: string, message: string): void {
3863
+ this.releaseMeshGrids();
3475
3864
  this.previewTargetDensities.clear();
3476
3865
  this.previewBudgetDensities.clear();
3477
3866
  this.previewBudgetSignature = "";
@@ -3814,6 +4203,48 @@ class NativeShaderRuntime {
3814
4203
  return texture;
3815
4204
  }
3816
4205
 
4206
+ private meshDepth(
4207
+ mount: Mount,
4208
+ key: string,
4209
+ width: number,
4210
+ height: number,
4211
+ ): GPUTexture {
4212
+ const previous = mount.resourceTextures.get(key);
4213
+ if (previous && previous.width === width && previous.height === height)
4214
+ return previous;
4215
+ mount.resourceTextures.delete(key);
4216
+ this.destroyTexture(previous);
4217
+ const bytes = width * height * 4;
4218
+ this.ensureTextureBudget(bytes);
4219
+ const texture = this.device!.createTexture({
4220
+ size: [width, height],
4221
+ format: "depth24plus",
4222
+ usage: GPUTextureUsage.RENDER_ATTACHMENT,
4223
+ });
4224
+ this.textureBytes.set(texture, bytes);
4225
+ this.allocatedTextureBytes += bytes;
4226
+ mount.resourceTextures.set(key, texture);
4227
+ return texture;
4228
+ }
4229
+
4230
+ private meshGrid(mesh: EffectMeshSpec): NativeMeshGridLease {
4231
+ const key = `${mesh.columns}x${mesh.rows}`;
4232
+ const existing = this.meshGrids.get(key);
4233
+ if (existing) return existing;
4234
+ const bytes = nativeMeshGridBytes(mesh);
4235
+ this.ensureTextureBudget(bytes);
4236
+ const lease = acquireNativeMeshGrid(this.device!, mesh);
4237
+ this.meshGrids.set(key, lease);
4238
+ this.allocatedMeshBytes += bytes;
4239
+ return lease;
4240
+ }
4241
+
4242
+ private releaseMeshGrids(): void {
4243
+ for (const lease of this.meshGrids.values()) lease.release();
4244
+ this.meshGrids.clear();
4245
+ this.allocatedMeshBytes = 0;
4246
+ }
4247
+
3817
4248
  private destroyTexture(texture: GPUTexture | null | undefined): void {
3818
4249
  if (!texture || this.destroyedTextures.has(texture)) return;
3819
4250
  if (this.statelessTextureLeases.has(texture)) {
@@ -4049,7 +4480,7 @@ class NativeShaderRuntime {
4049
4480
 
4050
4481
  private offscreen(mount: Mount): boolean {
4051
4482
  const rect = mount.target.getBoundingClientRect();
4052
- const dpr = mount.pixelRatio || Math.min(devicePixelRatio || 1, 2);
4483
+ const dpr = mount.pixelRatio || Math.min(this.previewDevicePixelRatio(), 2);
4053
4484
  const halo = mount.outputExtent;
4054
4485
  const margins = {
4055
4486
  left: Math.max(
@@ -4194,6 +4625,7 @@ class NativeShaderRuntime {
4194
4625
  canvasBytes += surface.canvas.width * surface.canvas.height * 8;
4195
4626
  return (
4196
4627
  this.allocatedTextureBytes +
4628
+ this.allocatedMeshBytes +
4197
4629
  this.allocatedUniformBytes +
4198
4630
  this.allocatedSimulationBytes +
4199
4631
  this.allocatedStatelessBytes +
@@ -4772,6 +5204,88 @@ class NativeShaderRuntime {
4772
5204
  );
4773
5205
  }
4774
5206
 
5207
+ private hasWorkerPresentationToRetire(): boolean {
5208
+ return Boolean(
5209
+ this.retiringWorkerScene || this.mounts.size || this.scenePresentation,
5210
+ );
5211
+ }
5212
+
5213
+ private prepareWorkerSceneCommit(): void {
5214
+ if (this.retiringWorkerScene) {
5215
+ this.retiringWorkerScene.dispose({ preservePresentationState: true });
5216
+ this.retiringWorkerScene = null;
5217
+ }
5218
+ for (const [id, mount] of this.mounts) {
5219
+ this.unmount(mount);
5220
+ this.mounts.delete(id);
5221
+ }
5222
+ if (this.scenePresentation) this.releaseScenePresentation();
5223
+ }
5224
+
5225
+ private onWorkerSceneFailure = (error: Error): void => {
5226
+ const code =
5227
+ error instanceof NativeWorkerSceneSourceError
5228
+ ? error.captureFailure.code
5229
+ : error instanceof NativeSourceError ||
5230
+ error instanceof NativeWorkerHostError
5231
+ ? error.code
5232
+ : "worker-scene-failed";
5233
+ if (
5234
+ error instanceof NativeWorkerSceneSourceError ||
5235
+ [
5236
+ "worker-continuous-source-unsupported",
5237
+ "worker-unavailable",
5238
+ "gpu-unavailable",
5239
+ "canvas-unavailable",
5240
+ ].includes(code)
5241
+ ) {
5242
+ if (error instanceof NativeWorkerSceneSourceError) {
5243
+ this.workerRootSourceBlocked = true;
5244
+ clearTimeout(this.workerSourceRetryTimer);
5245
+ this.workerSourceRetryTimer = 0;
5246
+ } else this.workerCapabilityBlocked = true;
5247
+ queueMicrotask(() => this.requestScan());
5248
+ }
5249
+ if (
5250
+ [
5251
+ "gpu-device-lost",
5252
+ "gpu-uncaptured-error",
5253
+ "worker-failed",
5254
+ "worker-init-timeout",
5255
+ ].includes(code) &&
5256
+ this.workerRecoveryAttempts < 2 &&
5257
+ !this.workerRecoveryQueued
5258
+ ) {
5259
+ this.workerRecoveryAttempts += 1;
5260
+ this.workerRecoveryQueued = true;
5261
+ queueMicrotask(() => {
5262
+ const failed = this.workerScene;
5263
+ if (failed?.committedScene()) {
5264
+ this.retiringWorkerScene?.dispose();
5265
+ this.retiringWorkerScene = failed;
5266
+ failed.holdLastFrame();
5267
+ } else failed?.dispose();
5268
+ if (this.workerScene === failed) this.workerScene = null;
5269
+ this.workerRecoveryQueued = false;
5270
+ window.setTimeout(
5271
+ () => this.requestScan(),
5272
+ 100 * this.workerRecoveryAttempts,
5273
+ );
5274
+ });
5275
+ }
5276
+ this.issue(code, error.message);
5277
+ for (const entry of this.workerEntries) {
5278
+ const status = this.workerScene?.committedScene() ? "last-good" : "error";
5279
+ entry.target.setAttribute("data-an-native-status", status);
5280
+ entry.target.setAttribute("data-an-native-error", code);
5281
+ this.postStatus(entry.instance.id, entry.instance.nodeId, status, {
5282
+ code,
5283
+ message: error.message,
5284
+ instanceId: entry.instance.id,
5285
+ });
5286
+ }
5287
+ };
5288
+
4775
5289
  private scanOnce = async (): Promise<void> => {
4776
5290
  if (this.disposed) return;
4777
5291
  if (this.running) await this.running;
@@ -5120,6 +5634,7 @@ class NativeShaderRuntime {
5120
5634
  this.dynamicRangeRequested === "sdr" &&
5121
5635
  !this.legacyDraftSession &&
5122
5636
  !this.workerCapabilityBlocked &&
5637
+ !this.workerRootSourceBlocked &&
5123
5638
  !window.frameElement?.hasAttribute(
5124
5639
  "data-native-catalog-preview-renderer",
5125
5640
  ) &&
@@ -5127,7 +5642,7 @@ class NativeShaderRuntime {
5127
5642
  typeof HTMLCanvasElement.prototype.transferControlToOffscreen ===
5128
5643
  "function" &&
5129
5644
  workerEntries.every(
5130
- ({ definition }) =>
5645
+ ({ definition, instance, target }) =>
5131
5646
  !definition.simulation &&
5132
5647
  !definition.feedback &&
5133
5648
  !definition.statelessCompute &&
@@ -5136,6 +5651,10 @@ class NativeShaderRuntime {
5136
5651
  definition.passes.every(
5137
5652
  (pass) =>
5138
5653
  pass.kind === "render" && !pass.previousFrameReads?.length,
5654
+ ) &&
5655
+ nativeWorkerSupportsInputResources(
5656
+ planNativeInputResources(definition, instance),
5657
+ isNativeSvgRoot(target),
5139
5658
  ),
5140
5659
  );
5141
5660
  if (workerCapable) {
@@ -5153,115 +5672,52 @@ class NativeShaderRuntime {
5153
5672
  this.workerScene ??= new NativeWorkerSceneHost(
5154
5673
  nativeWorkerSource,
5155
5674
  `${this.epoch}:${createNativeRuntimeEpoch()}`,
5156
- () => ({
5157
- playing: this.playing,
5158
- timeSeconds: this.currentTime(),
5159
- speed: 1,
5160
- }),
5675
+ () => {
5676
+ const sampledAtMs = performance.now();
5677
+ return {
5678
+ playing: this.playing,
5679
+ timeSeconds: this.currentTime(sampledAtMs),
5680
+ speed: 1,
5681
+ sampledAtEpochMs: performance.timeOrigin + sampledAtMs,
5682
+ };
5683
+ },
5161
5684
  (_publication, message) => {
5162
5685
  this.workerRecoveryAttempts = 0;
5163
- if (this.retiringWorkerScene) {
5164
- this.retiringWorkerScene.dispose({
5165
- preservePresentationState: true,
5166
- });
5167
- this.retiringWorkerScene = null;
5168
- }
5169
- if (this.mounts.size || this.scenePresentation) {
5170
- for (const [id, mount] of this.mounts) {
5171
- this.unmount(mount);
5172
- this.mounts.delete(id);
5173
- }
5174
- if (this.scenePresentation) this.releaseScenePresentation();
5175
- this.workerScene?.setEntries(this.workerEntries);
5176
- }
5177
- for (const committed of message.committedInstances) {
5178
- const entry = this.workerEntries.find(
5179
- (candidate) => candidate.instance.id === committed.instanceId,
5180
- );
5181
- if (entry)
5182
- this.postStatus(
5183
- entry.instance.id,
5184
- entry.instance.nodeId,
5185
- "ready",
5186
- );
5187
- }
5188
- },
5189
- (error) => {
5190
- const code =
5191
- error instanceof NativeSourceError ||
5192
- error instanceof NativeWorkerHostError
5193
- ? error.code
5194
- : "worker-scene-failed";
5195
- if (
5196
- [
5197
- "worker-continuous-source-unsupported",
5198
- "worker-unavailable",
5199
- "gpu-unavailable",
5200
- "canvas-unavailable",
5201
- ].includes(code)
5202
- ) {
5203
- this.workerCapabilityBlocked = true;
5204
- queueMicrotask(() => this.requestScan());
5205
- }
5206
- if (
5207
- [
5208
- "gpu-device-lost",
5209
- "gpu-uncaptured-error",
5210
- "worker-failed",
5211
- "worker-init-timeout",
5212
- ].includes(code) &&
5213
- this.workerRecoveryAttempts < 2 &&
5214
- !this.workerRecoveryQueued
5215
- ) {
5216
- this.workerRecoveryAttempts += 1;
5217
- this.workerRecoveryQueued = true;
5218
- queueMicrotask(() => {
5219
- const failed = this.workerScene;
5220
- if (failed?.committedScene()) {
5221
- this.retiringWorkerScene?.dispose();
5222
- this.retiringWorkerScene = failed;
5223
- failed.holdLastFrame();
5224
- } else failed?.dispose();
5225
- if (this.workerScene === failed) this.workerScene = null;
5226
- this.workerRecoveryQueued = false;
5227
- window.setTimeout(
5228
- () => this.requestScan(),
5229
- 100 * this.workerRecoveryAttempts,
5686
+ if (message.contentChanged)
5687
+ for (const committed of message.committedInstances) {
5688
+ const entry = this.workerEntries.find(
5689
+ (candidate) => candidate.instance.id === committed.instanceId,
5230
5690
  );
5231
- });
5232
- }
5233
- this.issue(code, error.message);
5234
- for (const entry of this.workerEntries) {
5235
- const status = this.workerScene?.committedScene()
5236
- ? "last-good"
5237
- : "error";
5238
- entry.target.setAttribute("data-an-native-status", status);
5239
- entry.target.setAttribute("data-an-native-error", code);
5240
- this.postStatus(
5241
- entry.instance.id,
5242
- entry.instance.nodeId,
5243
- status,
5244
- {
5245
- code,
5246
- message: error.message,
5247
- instanceId: entry.instance.id,
5248
- },
5249
- );
5250
- }
5691
+ if (entry)
5692
+ this.postStatus(
5693
+ entry.instance.id,
5694
+ entry.instance.nodeId,
5695
+ "ready",
5696
+ );
5697
+ }
5251
5698
  },
5699
+ this.onWorkerSceneFailure,
5252
5700
  nativePresentationTargetLayout,
5253
5701
  () => {
5254
5702
  this.refreshPreviewViewport();
5255
5703
  return {
5256
- viewport: this.previewViewport ?? {
5257
- x: 0,
5258
- y: 0,
5259
- width: innerWidth,
5260
- height: innerHeight,
5261
- },
5704
+ viewport: this.planPreviewAllocationViewport(MAX_PIXELS) ??
5705
+ this.previewViewport ?? {
5706
+ x: 0,
5707
+ y: 0,
5708
+ width: innerWidth,
5709
+ height: innerHeight,
5710
+ },
5262
5711
  pixelRatio: this.desiredScenePreviewPixelRatio(),
5263
5712
  };
5264
5713
  },
5714
+ () => ({
5715
+ frameRateTarget: this.previewStatus().frameRateTarget,
5716
+ compact: this.previewPolicy.isOverviewCompact(),
5717
+ }),
5718
+ () => this.clockOrigin,
5719
+ () => this.hasWorkerPresentationToRetire(),
5720
+ () => this.prepareWorkerSceneCommit(),
5265
5721
  );
5266
5722
  this.workerScene.setVisible(
5267
5723
  document.visibilityState !== "hidden" &&
@@ -5528,7 +5984,7 @@ class NativeShaderRuntime {
5528
5984
  ): boolean {
5529
5985
  for (
5530
5986
  let sibling = target.nextElementSibling;
5531
- sibling instanceof HTMLCanvasElement;
5987
+ isNativeHtmlTag(sibling, "canvas");
5532
5988
  sibling = sibling.nextElementSibling
5533
5989
  ) {
5534
5990
  if (sibling === canvas) return true;
@@ -5566,7 +6022,7 @@ class NativeShaderRuntime {
5566
6022
  let insertionPoint: Element = target;
5567
6023
  if (instance.placement === "backdrop")
5568
6024
  while (
5569
- insertionPoint.nextElementSibling instanceof HTMLCanvasElement &&
6025
+ isNativeHtmlTag(insertionPoint.nextElementSibling, "canvas") &&
5570
6026
  insertionPoint.nextElementSibling !== canvas &&
5571
6027
  insertionPoint.nextElementSibling.hasAttribute(
5572
6028
  "data-an-native-backdrop-presentation",
@@ -6319,7 +6775,7 @@ class NativeShaderRuntime {
6319
6775
  return false;
6320
6776
  }
6321
6777
  const baseDensity = this.previewPolicy.status(
6322
- devicePixelRatio || 1,
6778
+ this.previewDevicePixelRatio(),
6323
6779
  ).effectivePixelRatio;
6324
6780
  const desiredDensity = this.desiredScenePreviewPixelRatio();
6325
6781
  const groups = new Map<NativeScenePresentationElement, Mount[]>();
@@ -6403,23 +6859,26 @@ class NativeShaderRuntime {
6403
6859
  ),
6404
6860
  };
6405
6861
  });
6406
- const viewport = this.previewViewport ?? {
6407
- x: 0,
6408
- y: 0,
6409
- width: innerWidth,
6410
- height: innerHeight,
6411
- };
6862
+ const allocationViewport = this.previewAllocationViewport ??
6863
+ this.previewViewport ?? {
6864
+ x: 0,
6865
+ y: 0,
6866
+ width: innerWidth,
6867
+ height: innerHeight,
6868
+ };
6412
6869
  const sceneDensity = this.previewViewport
6413
6870
  ? fitNativeRasterDensity({
6414
- width: viewport.width,
6415
- height: viewport.height,
6871
+ width: allocationViewport.width,
6872
+ height: allocationViewport.height,
6416
6873
  density: desiredDensity,
6417
6874
  maxDimension: MAX_DIMENSION,
6418
6875
  maxPixels: Math.min(MAX_PIXELS, Math.floor(MAX_RESOURCE_BYTES / 40)),
6419
6876
  pixelPadding: 1,
6420
6877
  })
6421
6878
  : desiredDensity;
6422
- const visible = nativePreviewPhysicalViewport(viewport, sceneDensity);
6879
+ const sceneAllocation = this.usesStablePreviewAllocation()
6880
+ ? nativePreviewStablePhysicalViewport(allocationViewport, sceneDensity)
6881
+ : nativePreviewPhysicalViewport(allocationViewport, sceneDensity);
6423
6882
  const scene = this.scenePresentation;
6424
6883
  const hasCommittedScene =
6425
6884
  scene !== null &&
@@ -6434,7 +6893,8 @@ class NativeShaderRuntime {
6434
6893
  );
6435
6894
  const sceneBudgetSignature = JSON.stringify({
6436
6895
  requests,
6437
- viewport,
6896
+ viewport: allocationViewport,
6897
+ visibleViewport: this.previewViewport,
6438
6898
  sceneDensity,
6439
6899
  needsScene,
6440
6900
  fixedBytes,
@@ -6454,8 +6914,8 @@ class NativeShaderRuntime {
6454
6914
  const sceneRequest = needsScene
6455
6915
  ? {
6456
6916
  id: sceneRequestId,
6457
- width: viewport.width,
6458
- height: viewport.height,
6917
+ width: allocationViewport.width,
6918
+ height: allocationViewport.height,
6459
6919
  baseDensity: Math.min(desiredSceneDensity, 0.5),
6460
6920
  desiredDensity: desiredSceneDensity,
6461
6921
  bytesPerPixel: 40,
@@ -6475,7 +6935,7 @@ class NativeShaderRuntime {
6475
6935
  for (const entry of scene!.surface.sourceTextures.values())
6476
6936
  retainedSceneTextures.add(entry.texture);
6477
6937
  const replacement = nativePreviewPhysicalViewport(
6478
- viewport,
6938
+ allocationViewport,
6479
6939
  desiredSceneDensity,
6480
6940
  );
6481
6941
  for (const [key, entry] of scene!.surface.isolationTextures)
@@ -6506,7 +6966,7 @@ class NativeShaderRuntime {
6506
6966
  : 0;
6507
6967
  const reservedBytes =
6508
6968
  retainedSceneBytes +
6509
- Math.min(MAX_PIXELS, visible.width * visible.height) * 8 +
6969
+ Math.min(MAX_PIXELS, sceneAllocation.width * sceneAllocation.height) * 8 +
6510
6970
  33_554_432 +
6511
6971
  fixedBytes;
6512
6972
  const availableBytes = MAX_REALM_TEXTURE_BYTES - reservedBytes;
@@ -6630,7 +7090,7 @@ class NativeShaderRuntime {
6630
7090
  ...Object.values(outputInsets),
6631
7091
  ) * localScale;
6632
7092
  requestedRatio = nativePreviewTargetDensity({
6633
- baseDensity: this.previewPolicy.status(devicePixelRatio || 1)
7093
+ baseDensity: this.previewPolicy.status(this.previewDevicePixelRatio())
6634
7094
  .effectivePixelRatio,
6635
7095
  displayScale: this.targetPreviewDisplayScale(targetMembers, localScale),
6636
7096
  viewport: this.previewViewport,
@@ -6695,7 +7155,6 @@ class NativeShaderRuntime {
6695
7155
  mount.instance.placement === "fill" && mount.isTopLayer
6696
7156
  ? (mount.fillPresentationExtent ?? planned.plan)
6697
7157
  : planned.plan;
6698
- const { left, top } = presentationExtent;
6699
7158
  mount.pixelRatio = dpr;
6700
7159
  mount.outputExtent = planned.plan;
6701
7160
  mount.captureInsets = captureInsets;
@@ -6727,44 +7186,11 @@ class NativeShaderRuntime {
6727
7186
  );
6728
7187
  }
6729
7188
  }
6730
- const geometry = planNativeOutputGeometry({
6731
- offsetLeft: targetLayout.offsetLeft,
6732
- offsetTop: targetLayout.offsetTop,
6733
- width: targetLayout.width,
6734
- height: targetLayout.height,
6735
- extent: presentationExtent,
6736
- transformOrigin: targetLayout.transformOrigin,
6737
- });
6738
- if (presentationExtent.expanded && !geometry)
7189
+ if (!this.projectPresentationGeometry(mount, presentationExtent, dpr))
6739
7190
  throw new NativeSourceError(
6740
7191
  "effect-output-transform-unsupported",
6741
7192
  "Expanded output has an unsupported transform origin.",
6742
7193
  );
6743
- mount.canvas.style.left = `${geometry?.left ?? targetLayout.offsetLeft - left / dpr}px`;
6744
- mount.canvas.style.top = `${geometry?.top ?? targetLayout.offsetTop - top / dpr}px`;
6745
- mount.canvas.style.width = `${geometry?.width ?? targetLayout.width + (left + presentationExtent.right) / dpr}px`;
6746
- mount.canvas.style.height = `${geometry?.height ?? targetLayout.height + (top + presentationExtent.bottom) / dpr}px`;
6747
- mount.canvas.style.transform = targetLayout.transform;
6748
- mount.canvas.style.translate = targetLayout.translate;
6749
- mount.canvas.style.rotate = targetLayout.rotate;
6750
- mount.canvas.style.scale = targetLayout.scale;
6751
- mount.canvas.style.transformOrigin =
6752
- geometry?.transformOrigin ?? targetLayout.transformOrigin;
6753
- mount.canvas.style.borderRadius =
6754
- mount.instance.placement === "fill" || presentationExtent.expanded
6755
- ? "0"
6756
- : style.borderRadius;
6757
- if (mount.instance.placement === "fill")
6758
- mount.canvas.style.opacity =
6759
- mount.target.getAttribute("data-an-native-authored-opacity") ??
6760
- style.opacity;
6761
- else if (mount.instance.placement === "layer")
6762
- mount.canvas.style.opacity = mount.layerSourceOpacityDeferred
6763
- ? (mount.target.getAttribute("data-an-native-authored-opacity") ??
6764
- style.opacity)
6765
- : "";
6766
- mount.canvas.style.zIndex =
6767
- style.zIndex === "auto" ? "auto" : style.zIndex;
6768
7194
  }
6769
7195
  this.syncSceneSourceOpacity(mount);
6770
7196
  if (mount.width !== width || mount.height !== height) {
@@ -6837,6 +7263,7 @@ class NativeShaderRuntime {
6837
7263
  effect = false,
6838
7264
  effectTextureCount = 2,
6839
7265
  placement?: EffectInstance["placement"],
7266
+ mesh = false,
6840
7267
  ): Promise<GPURenderPipeline> {
6841
7268
  const device = await this.ensureDevice();
6842
7269
  const deviceEpoch = this.deviceEpoch;
@@ -6855,7 +7282,7 @@ class NativeShaderRuntime {
6855
7282
  );
6856
7283
  }
6857
7284
  const constants = nativeRenderPlacementConstants(wgsl, placement);
6858
- const key = `${deviceEpoch}:${format}:${blend}:${effect}:${textureCount}:${JSON.stringify(constants)}:${wgsl}`;
7285
+ const key = `${deviceEpoch}:${format}:${blend}:${effect}:${textureCount}:${mesh}:${JSON.stringify(constants)}:${wgsl}`;
6859
7286
  if (!this.pipelines.has(key)) this.ensureTextureBudget(524_288);
6860
7287
  return this.pipelines.getOrCreate(key, async () => {
6861
7288
  const module = device.createShaderModule({ code: wgsl });
@@ -6945,6 +7372,15 @@ class NativeShaderRuntime {
6945
7372
  ],
6946
7373
  },
6947
7374
  primitive: { topology: "triangle-list" },
7375
+ ...(mesh
7376
+ ? {
7377
+ depthStencil: {
7378
+ format: "depth24plus" as const,
7379
+ depthWriteEnabled: true,
7380
+ depthCompare: "less" as const,
7381
+ },
7382
+ }
7383
+ : {}),
6948
7384
  });
6949
7385
  if (this.device !== device || this.deviceEpoch !== deviceEpoch)
6950
7386
  throw new NativeSourceError(
@@ -6987,7 +7423,7 @@ class NativeShaderRuntime {
6987
7423
  "uniform-owner-unavailable",
6988
7424
  "The packed draw has no frame-owned render state.",
6989
7425
  );
6990
- const drawKey = `${owner}:${key}`;
7426
+ const drawKey = `${owner}:${key}:uniform${bytes.byteLength}`;
6991
7427
  const occurrence = packed.occurrences.get(drawKey) ?? 0;
6992
7428
  packed.occurrences.set(drawKey, occurrence + 1);
6993
7429
  key = `${key}:${occurrence}`;
@@ -7214,7 +7650,7 @@ class NativeShaderRuntime {
7214
7650
  [uploadWidth, uploadHeight],
7215
7651
  );
7216
7652
  } catch (directError) {
7217
- if (scale >= 1 && !(record.source instanceof HTMLImageElement)) {
7653
+ if (scale >= 1 && !isNativeHtmlTag(record.source, "img")) {
7218
7654
  throw new NativeSourceError(
7219
7655
  "source-gpu-upload",
7220
7656
  `A ${record.kind} source could not be uploaded to WebGPU: ${String(directError)}`,
@@ -7344,6 +7780,15 @@ class NativeShaderRuntime {
7344
7780
  }
7345
7781
 
7346
7782
  private async fetchInputBlob(url: URL, signal: AbortSignal): Promise<Blob> {
7783
+ if (isOpaquePublicAssetPreview()) {
7784
+ const blob = await resolveOpaquePublicAssetBlob(url.href);
7785
+ if (signal.aborted)
7786
+ throw new NativeSourceError(
7787
+ "input-asset-aborted",
7788
+ "The input asset load was cancelled.",
7789
+ );
7790
+ return blob;
7791
+ }
7347
7792
  const response = await fetch(url.href, {
7348
7793
  credentials: "same-origin",
7349
7794
  mode: "same-origin",
@@ -9074,7 +9519,9 @@ class NativeShaderRuntime {
9074
9519
  };
9075
9520
  }
9076
9521
  const uniform = (stepTime: number): GPUBuffer => {
9077
- const values = new Float32Array(136);
9522
+ const values = new Float32Array(
9523
+ 8 + nativeEffectUniformFloats(definition),
9524
+ );
9078
9525
  values.set(
9079
9526
  [mount.width, mount.height, 1 / mount.width, 1 / mount.height],
9080
9527
  0,
@@ -9313,7 +9760,9 @@ class NativeShaderRuntime {
9313
9760
  true,
9314
9761
  );
9315
9762
  assertSimulationDevice();
9316
- const trailData = new Float32Array(136);
9763
+ const trailData = new Float32Array(
9764
+ 8 + nativeEffectUniformFloats(definition),
9765
+ );
9317
9766
  trailData.set(
9318
9767
  [mount.width, mount.height, 1 / mount.width, 1 / mount.height],
9319
9768
  0,
@@ -9689,7 +10138,9 @@ class NativeShaderRuntime {
9689
10138
  return count;
9690
10139
  },
9691
10140
  uniforms: (_pass, _width, _height, stepTime, dt) => {
9692
- const data = new Float32Array(136);
10141
+ const data = new Float32Array(
10142
+ 8 + nativeEffectUniformFloats(definition),
10143
+ );
9693
10144
  data.set(
9694
10145
  [mount.width, mount.height, 1 / mount.width, 1 / mount.height],
9695
10146
  0,
@@ -10047,6 +10498,7 @@ class NativeShaderRuntime {
10047
10498
  device,
10048
10499
  compute.wgsl,
10049
10500
  resolve.wgsl,
10501
+ nativeEffectUniformFloats(definition),
10050
10502
  ),
10051
10503
  );
10052
10504
  if (
@@ -10082,10 +10534,14 @@ class NativeShaderRuntime {
10082
10534
  };
10083
10535
  this.ensureCompositionBudget(
10084
10536
  budgetSurface,
10085
- plan.byteLength + 544 + (replace ? mount.width * mount.height * 8 : 0),
10537
+ plan.byteLength +
10538
+ (8 + nativeEffectUniformFloats(definition)) * 4 +
10539
+ (replace ? mount.width * mount.height * 8 : 0),
10086
10540
  );
10087
10541
  this.ensureTextureBudget(
10088
- plan.byteLength + 544 + (replace ? mount.width * mount.height * 8 : 0),
10542
+ plan.byteLength +
10543
+ (8 + nativeEffectUniformFloats(definition)) * 4 +
10544
+ (replace ? mount.width * mount.height * 8 : 0),
10089
10545
  );
10090
10546
  if (replace) {
10091
10547
  const prior = output;
@@ -10094,7 +10550,7 @@ class NativeShaderRuntime {
10094
10550
  if (prior && prior !== source && prior !== mount.outputTexture)
10095
10551
  this.textureRetirement.push(prior);
10096
10552
  }
10097
- const data = new Float32Array(136);
10553
+ const data = new Float32Array(8 + nativeEffectUniformFloats(definition));
10098
10554
  data.set([mount.width, mount.height, 1 / mount.width, 1 / mount.height]);
10099
10555
  data.set(
10100
10556
  packNativeUniformClock({
@@ -10573,7 +11029,7 @@ class NativeShaderRuntime {
10573
11029
  scene.every(
10574
11030
  (record) =>
10575
11031
  record.kind === "image" &&
10576
- record.source instanceof HTMLImageElement &&
11032
+ isNativeHtmlTag(record.source, "img") &&
10577
11033
  !!record.imageSourceUrl &&
10578
11034
  (record.source.currentSrc || record.source.src) ===
10579
11035
  record.imageSourceUrl,
@@ -11061,7 +11517,9 @@ class NativeShaderRuntime {
11061
11517
  usedTextures.add(texture);
11062
11518
  }
11063
11519
  const pipeline = pipelines.get(pass.id)!;
11064
- const data = new Float32Array(136);
11520
+ const data = new Float32Array(
11521
+ 8 + nativeEffectUniformFloats(definition),
11522
+ );
11065
11523
  data.set([width, height, 1 / width, 1 / height], 0);
11066
11524
  data.set(
11067
11525
  packNativeUniformClock({
@@ -11460,10 +11918,12 @@ class NativeShaderRuntime {
11460
11918
  `The camera input is ${state}.`,
11461
11919
  );
11462
11920
  }
11463
- const width =
11464
- source instanceof HTMLVideoElement ? source.videoWidth : source.width;
11465
- const height =
11466
- source instanceof HTMLVideoElement ? source.videoHeight : source.height;
11921
+ const width = isNativeHtmlTag(source, "video")
11922
+ ? source.videoWidth
11923
+ : source.width;
11924
+ const height = isNativeHtmlTag(source, "video")
11925
+ ? source.videoHeight
11926
+ : source.height;
11467
11927
  if (
11468
11928
  !Number.isSafeInteger(width) ||
11469
11929
  !Number.isSafeInteger(height) ||
@@ -11720,7 +12180,7 @@ class NativeShaderRuntime {
11720
12180
  binding.kind === "builtin" && binding.source === "receiver-interior",
11721
12181
  );
11722
12182
  const svgInterior =
11723
- receiverInteriorRequested && mount.target instanceof SVGSVGElement;
12183
+ receiverInteriorRequested && isNativeSvgRoot(mount.target);
11724
12184
  const receiverGeometry =
11725
12185
  receiverGeometryRequested || svgInterior
11726
12186
  ? await this.receiverGeometryTextures(mount, svgInterior)
@@ -12168,7 +12628,10 @@ class NativeShaderRuntime {
12168
12628
  "resource-size-unsupported",
12169
12629
  `Render output ${pass.output} exceeds the supported texture bounds.`,
12170
12630
  );
12171
- resourceBytes += width * height * (format === "rgba16float" ? 8 : 4);
12631
+ resourceBytes +=
12632
+ width *
12633
+ height *
12634
+ ((format === "rgba16float" ? 8 : 4) + (pass.mesh ? 4 : 0));
12172
12635
  if (resourceBytes > MAX_RESOURCE_BYTES)
12173
12636
  throw new NativeSourceError(
12174
12637
  "resource-budget-exceeded",
@@ -12199,6 +12662,7 @@ class NativeShaderRuntime {
12199
12662
  true,
12200
12663
  pass.reads.length,
12201
12664
  instance.placement,
12665
+ pass.mesh !== undefined,
12202
12666
  );
12203
12667
  } catch (error) {
12204
12668
  if (error instanceof NativeShaderCompilationError)
@@ -12210,7 +12674,7 @@ class NativeShaderRuntime {
12210
12674
  );
12211
12675
  throw error;
12212
12676
  }
12213
- const data = new Float32Array(136);
12677
+ const data = new Float32Array(8 + nativeEffectUniformFloats(definition));
12214
12678
  data.set([width, height, 1 / width, 1 / height], 0);
12215
12679
  data.set(
12216
12680
  packNativeUniformClock({ time, seed: instance.seed, pixelRatio: dpr }),
@@ -12239,6 +12703,10 @@ class NativeShaderRuntime {
12239
12703
  null,
12240
12704
  otherInputs.slice(1),
12241
12705
  );
12706
+ const depth = pass.mesh
12707
+ ? this.meshDepth(mount, `__mesh_depth:${pass.id}`, width, height)
12708
+ : null;
12709
+ const grid = pass.mesh ? this.meshGrid(pass.mesh) : null;
12242
12710
  const render = encoder.beginRenderPass({
12243
12711
  ...this.gpuTimestampWrites(encoder, `effect:${pass.id}`),
12244
12712
  colorAttachments: [
@@ -12249,10 +12717,23 @@ class NativeShaderRuntime {
12249
12717
  clearValue: { r: 0, g: 0, b: 0, a: 0 },
12250
12718
  },
12251
12719
  ],
12720
+ ...(depth
12721
+ ? {
12722
+ depthStencilAttachment: {
12723
+ view: depth.createView(),
12724
+ depthLoadOp: "clear" as const,
12725
+ depthStoreOp: "discard" as const,
12726
+ depthClearValue: 1,
12727
+ },
12728
+ }
12729
+ : {}),
12252
12730
  });
12253
12731
  render.setPipeline(pipeline);
12254
12732
  render.setBindGroup(0, bind);
12255
- render.draw(3);
12733
+ if (grid) {
12734
+ render.setIndexBuffer(grid.buffer, "uint32");
12735
+ render.drawIndexed(grid.indexCount);
12736
+ } else render.draw(3);
12256
12737
  render.end();
12257
12738
  resources.set(pass.output, output);
12258
12739
  }
@@ -12267,7 +12748,7 @@ class NativeShaderRuntime {
12267
12748
 
12268
12749
  private async textMask(mount: Mount): Promise<GPUTexture> {
12269
12750
  if (mount.instance.clip !== "text") return this.white!;
12270
- if (!(mount.target instanceof HTMLElement))
12751
+ if (!isNativeHtmlElement(mount.target))
12271
12752
  throw new NativeSourceError(
12272
12753
  "source-inline-svg",
12273
12754
  "An SVG Fill uses vector paint coverage rather than a text mask.",
@@ -13330,7 +13811,7 @@ class NativeShaderRuntime {
13330
13811
  authoredSourceEpoch: number,
13331
13812
  ): Promise<GPUTexture> {
13332
13813
  const ancestor = parent.target;
13333
- if (!(ancestor instanceof HTMLElement))
13814
+ if (!isNativeHtmlElement(ancestor))
13334
13815
  throw new NativeSourceError(
13335
13816
  "source-inline-svg",
13336
13817
  "An SVG Fill cannot contain a nested HTML Backdrop.",
@@ -15928,8 +16409,8 @@ class NativeShaderRuntime {
15928
16409
  }
15929
16410
  }
15930
16411
 
15931
- private currentTime(): number {
15932
- return this.timeOverride ?? (performance.now() - this.clockOrigin) / 1000;
16412
+ private currentTime(nowMs = performance.now()): number {
16413
+ return this.timeOverride ?? (nowMs - this.clockOrigin) / 1000;
15933
16414
  }
15934
16415
 
15935
16416
  private closeStatelessFrameScope(
@@ -16016,7 +16497,7 @@ class NativeShaderRuntime {
16016
16497
  if (
16017
16498
  mount.instance.placement !== "fill" ||
16018
16499
  mount.instance.clip === "text" ||
16019
- !(mount.target instanceof HTMLElement) ||
16500
+ !isNativeHtmlElement(mount.target) ||
16020
16501
  !mount.provider ||
16021
16502
  !this.hasPresentationGeometry(mount.target) ||
16022
16503
  this.offscreen(mount) ||
@@ -16029,7 +16510,7 @@ class NativeShaderRuntime {
16029
16510
  style.boxShadow === "none" &&
16030
16511
  (style.outlineStyle === "none" || style.outlineWidth === "0px") &&
16031
16512
  [...mount.target.childNodes].every((node) =>
16032
- node instanceof Element
16513
+ isNativeElement(node)
16033
16514
  ? node.hasAttribute("data-an-native-canvas")
16034
16515
  : node.nodeType !== Node.TEXT_NODE || !node.textContent?.trim(),
16035
16516
  )
@@ -16056,8 +16537,8 @@ class NativeShaderRuntime {
16056
16537
  this.colorPresented,
16057
16538
  this.dynamicRangePresented,
16058
16539
  ]) !== family.presentationFormat ||
16059
- this.previewPolicy.status(devicePixelRatio || 1).effectivePixelRatio !==
16060
- family.density ||
16540
+ this.previewPolicy.status(this.previewDevicePixelRatio())
16541
+ .effectivePixelRatio !== family.density ||
16061
16542
  this.compositionPixelRatio !== null ||
16062
16543
  this.exportInitialPixelRatio !== null ||
16063
16544
  this.compositionAbort ||
@@ -16233,7 +16714,7 @@ class NativeShaderRuntime {
16233
16714
  deviceEpoch: epoch,
16234
16715
  hostGeneration: this.previewHostGeneration,
16235
16716
  viewport: JSON.stringify(this.previewViewport),
16236
- density: this.previewPolicy.status(devicePixelRatio || 1)
16717
+ density: this.previewPolicy.status(this.previewDevicePixelRatio())
16237
16718
  .effectivePixelRatio,
16238
16719
  presentationFormat: JSON.stringify([
16239
16720
  this.format,
@@ -20071,6 +20552,30 @@ class NativeShaderRuntime {
20071
20552
  "composition-instance-stale",
20072
20553
  "The requested native scene differs from the worker preview.",
20073
20554
  );
20555
+ const committedScene = workerScene.committedScene();
20556
+ const presentedInstances = new Map(
20557
+ committedScene?.scene.instances.map((instance) => [
20558
+ instance.id,
20559
+ instance,
20560
+ ]),
20561
+ );
20562
+ if (
20563
+ !committedScene ||
20564
+ presentedInstances.size !== committedScene.scene.instances.length ||
20565
+ committedScene.scene.instances.some((instance) => {
20566
+ const current = this.workerEntries.find(
20567
+ (entry) => entry.instance.id === instance.id,
20568
+ );
20569
+ return (
20570
+ !current ||
20571
+ JSON.stringify(current.instance) !== JSON.stringify(instance)
20572
+ );
20573
+ })
20574
+ )
20575
+ throw new NativeSourceError(
20576
+ "composition-instance-stale",
20577
+ "The committed worker scene differs from its authored effects.",
20578
+ );
20074
20579
  const timeSeconds = this.currentTime();
20075
20580
  const exported = await workerScene.captureExportScene({
20076
20581
  cropRect: region.region,
@@ -20096,7 +20601,14 @@ class NativeShaderRuntime {
20096
20601
  ))) ||
20097
20602
  exported.width !== region.width ||
20098
20603
  exported.height !== region.height ||
20099
- exported.rgba.byteLength !== region.width * region.height * 4
20604
+ exported.rgba.byteLength !== region.width * region.height * 4 ||
20605
+ exported.committedInstances.length !== presentedInstances.size ||
20606
+ new Set(
20607
+ exported.committedInstances.map((instance) => instance.instanceId),
20608
+ ).size !== exported.committedInstances.length ||
20609
+ exported.committedInstances.some(
20610
+ (instance) => !presentedInstances.has(instance.instanceId),
20611
+ )
20100
20612
  )
20101
20613
  throw new NativeSourceError(
20102
20614
  "composition-preview-stale",
@@ -20135,7 +20647,7 @@ class NativeShaderRuntime {
20135
20647
  };
20136
20648
  }),
20137
20649
  );
20138
- if (committedInstances.length !== this.workerEntries.length)
20650
+ if (committedInstances.length !== presentedInstances.size)
20139
20651
  throw new NativeSourceError(
20140
20652
  "composition-instance-stale",
20141
20653
  "The worker still omitted a native effect.",
@@ -21677,6 +22189,7 @@ class NativeShaderRuntime {
21677
22189
 
21678
22190
  private onMessage = (event: MessageEvent): void => {
21679
22191
  if (!event.data || typeof event.data !== "object") return;
22192
+ const data = event.data as Record<string, unknown>;
21680
22193
  if (event.source !== window) {
21681
22194
  if (event.source !== window.parent) return;
21682
22195
  let inheritedOrigin: string;
@@ -21688,7 +22201,6 @@ class NativeShaderRuntime {
21688
22201
  }
21689
22202
  if (event.origin !== inheritedOrigin) return;
21690
22203
  }
21691
- const data = event.data as Record<string, unknown>;
21692
22204
  if (data.type === "native-shader-editor-preview-policy") {
21693
22205
  if (window.parent === window || event.source !== window.parent) return;
21694
22206
  if (
@@ -22205,6 +22717,15 @@ class NativeShaderRuntime {
22205
22717
  record.target !== this.runtimeScript &&
22206
22718
  !isNativeSourceOmittedMutation(record),
22207
22719
  );
22720
+ if (this.workerRootSourceBlocked && authoredRecords.length) {
22721
+ clearTimeout(this.workerSourceRetryTimer);
22722
+ this.workerSourceRetryTimer = window.setTimeout(() => {
22723
+ this.workerSourceRetryTimer = 0;
22724
+ if (this.disposed || !this.workerRootSourceBlocked) return;
22725
+ this.workerRootSourceBlocked = false;
22726
+ this.requestScan();
22727
+ }, 100);
22728
+ }
22208
22729
  if (this.compositionAbort && authoredRecords.length)
22209
22730
  this.compositionAbort.abort(
22210
22731
  new NativeSourceError(
@@ -22219,7 +22740,7 @@ class NativeShaderRuntime {
22219
22740
  return;
22220
22741
  }
22221
22742
  for (const record of authoredRecords) {
22222
- if (record.type !== "attributes" || !(record.target instanceof Element))
22743
+ if (record.type !== "attributes" || !isNativeElement(record.target))
22223
22744
  continue;
22224
22745
  for (const mount of this.mounts.values())
22225
22746
  if (
@@ -22306,7 +22827,7 @@ class NativeShaderRuntime {
22306
22827
  subtree: true,
22307
22828
  });
22308
22829
  const affectsEffects = (node: Node): boolean => {
22309
- if (!(node instanceof Element)) return false;
22830
+ if (!isNativeElement(node)) return false;
22310
22831
  return (
22311
22832
  node.matches(
22312
22833
  `script[type="${SCRIPT_TYPE}"],[data-agent-native-node-id]`,
@@ -22325,12 +22846,12 @@ class NativeShaderRuntime {
22325
22846
  );
22326
22847
  if (record.type === "attributes")
22327
22848
  return (
22328
- record.target instanceof Element &&
22329
- (record.target instanceof HTMLScriptElement ||
22849
+ isNativeElement(record.target) &&
22850
+ (isNativeHtmlTag(record.target, "script") ||
22330
22851
  record.attributeName === "data-agent-native-node-id")
22331
22852
  );
22332
22853
  if (
22333
- record.target instanceof HTMLScriptElement &&
22854
+ isNativeHtmlTag(record.target, "script") &&
22334
22855
  record.target.type === SCRIPT_TYPE
22335
22856
  )
22336
22857
  return true;
@@ -22407,10 +22928,19 @@ class NativeShaderRuntime {
22407
22928
  "visibilitychange",
22408
22929
  this.onPreviewHostChange,
22409
22930
  );
22931
+ window.removeEventListener("resize", this.onPreviewHostChange);
22410
22932
  window.removeEventListener("pagehide", this.onPageHide);
22411
22933
  if (this.previewHostFramePending)
22412
- this.previewHostParent?.cancelAnimationFrame(this.previewHostFrame);
22934
+ (this.previewHostRafHost ?? window).cancelAnimationFrame(
22935
+ this.previewHostFrame,
22936
+ );
22937
+ if (this.opaquePreviewViewportTimer)
22938
+ clearTimeout(this.opaquePreviewViewportTimer);
22939
+ this.opaquePreviewViewportTimer = null;
22940
+ this.opaquePreviewViewportPort?.close();
22941
+ this.opaquePreviewViewportPort = null;
22413
22942
  this.previewHostFrame = 0;
22943
+ this.previewHostRafHost = null;
22414
22944
  this.previewHostFramePending = false;
22415
22945
  this.previewHostParent?.removeEventListener(
22416
22946
  "scroll",
@@ -22424,6 +22954,7 @@ class NativeShaderRuntime {
22424
22954
  this.previewHostParent = null;
22425
22955
  window.removeEventListener("message", this.onMessage);
22426
22956
  clearTimeout(this.rescanTimer);
22957
+ clearTimeout(this.workerSourceRetryTimer);
22427
22958
  clearTimeout(this.deviceRetryTimer);
22428
22959
  if (
22429
22960
  this.scenePresentation &&
@@ -22447,6 +22978,7 @@ class NativeShaderRuntime {
22447
22978
  }
22448
22979
 
22449
22980
  private releaseDisposedResources(): void {
22981
+ this.releaseMeshGrids();
22450
22982
  this.workerScene?.dispose();
22451
22983
  this.retiringWorkerScene?.dispose();
22452
22984
  this.workerScene = null;