@agent-native/core-corpus 0.214.0 → 0.216.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.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/analytics/CHANGELOG.md +1 -0
- package/corpus/templates/analytics/changelog/2026-10-21-session-replay-quotas-count-the-compressed-size-analytics-st.md +6 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +40 -9
- package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/community/qr/package.json +1 -1
- package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +36 -0
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +10 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +11 -0
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +4 -2
- package/corpus/templates/content/CHANGELOG.md +46 -0
- package/corpus/templates/content/acceptance/_writers.ts +604 -0
- package/corpus/templates/content/acceptance/generate-action-registry.ts +10 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/create-document.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/duplicate-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace-without-a-revision.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-initializecontent.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/import-content.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-existing-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-new-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-changed-file.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-new-file.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/restore-document-version.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-document-property-primary-blocks-field.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-image-alt-text.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/undo-content-import.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/update-document-browser-full-rewrite.json +75 -0
- package/corpus/templates/content/acceptance/known-loss.ts +69 -0
- package/corpus/templates/content/acceptance/round-trip-corpus.ts +1397 -0
- package/corpus/templates/content/actions/_blocks-field-identity.ts +35 -1
- package/corpus/templates/content/actions/_content-database-lifecycle.ts +11 -11
- package/corpus/templates/content/actions/_content-database-personal-view.ts +2 -0
- package/corpus/templates/content/actions/_content-favorites.ts +37 -0
- package/corpus/templates/content/actions/_database-membership-lock.ts +39 -8
- package/corpus/templates/content/actions/_database-navigation.ts +19 -21
- package/corpus/templates/content/actions/_database-row-batch.ts +41 -18
- package/corpus/templates/content/actions/_database-row-mutation.ts +17 -28
- package/corpus/templates/content/actions/_database-source-utils.ts +18 -1
- package/corpus/templates/content/actions/_database-utils.ts +3 -0
- package/corpus/templates/content/actions/_database-view-setup.ts +16 -0
- package/corpus/templates/content/actions/_document-edit-mutation.ts +33 -32
- package/corpus/templates/content/actions/_document-flush.ts +593 -171
- package/corpus/templates/content/actions/_document-save-locks.ts +54 -0
- package/corpus/templates/content/actions/_document-save-row.ts +133 -0
- package/corpus/templates/content/actions/_github-source.ts +18 -8
- package/corpus/templates/content/actions/_move-page-to-space.ts +189 -25
- package/corpus/templates/content/actions/_nfm-syntax.ts +2 -0
- package/corpus/templates/content/actions/_row-lock-order.ts +115 -0
- package/corpus/templates/content/actions/create-content-database.ts +11 -0
- package/corpus/templates/content/actions/create-document.ts +13 -1
- package/corpus/templates/content/actions/delete-content-database.ts +17 -14
- package/corpus/templates/content/actions/delete-document-property.ts +5 -0
- package/corpus/templates/content/actions/delete-document.ts +270 -97
- package/corpus/templates/content/actions/edit-document.ts +18 -5
- package/corpus/templates/content/actions/export-document.ts +3 -0
- package/corpus/templates/content/actions/get-blocks-field-word-count.ts +22 -5
- package/corpus/templates/content/actions/import-content-source.ts +170 -54
- package/corpus/templates/content/actions/move-document.ts +191 -73
- package/corpus/templates/content/actions/pull-document.ts +8 -2
- package/corpus/templates/content/actions/remove-database-items.ts +23 -4
- package/corpus/templates/content/actions/restore-content-database.ts +76 -55
- package/corpus/templates/content/actions/restore-document-version.ts +19 -35
- package/corpus/templates/content/actions/restore-document.ts +65 -53
- package/corpus/templates/content/actions/rollback-created-slash-document.ts +11 -16
- package/corpus/templates/content/actions/set-document-property.ts +15 -1
- package/corpus/templates/content/actions/share-local-file-document.ts +18 -14
- package/corpus/templates/content/actions/suggest-document-edit.ts +2 -3
- package/corpus/templates/content/actions/sync-local-folder-source.ts +35 -1
- package/corpus/templates/content/actions/undo-content-import.ts +16 -12
- package/corpus/templates/content/actions/update-content-database-view.ts +2 -0
- package/corpus/templates/content/actions/update-document.ts +19 -14
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -6
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +49 -3
- package/corpus/templates/content/app/components/editor/ContentImportDialog.tsx +2 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +53 -11
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +608 -353
- package/corpus/templates/content/app/components/editor/StaticDocumentBody.tsx +765 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +233 -80
- package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +32 -3
- package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +88 -23
- package/corpus/templates/content/app/components/editor/comment-anchors.ts +19 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +205 -71
- package/corpus/templates/content/app/components/editor/document-flush-participant.ts +253 -0
- package/corpus/templates/content/app/components/editor/editor-transaction-meta.ts +28 -0
- package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +2 -1
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +27 -6
- package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +0 -1
- package/corpus/templates/content/app/components/editor/extensions/NotionExtensions.tsx +4 -4
- package/corpus/templates/content/app/components/editor/extensions/SuggestionHighlight.ts +24 -2
- package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +25 -6
- package/corpus/templates/content/app/components/editor/pending-document-persistence.ts +59 -1
- package/corpus/templates/content/app/components/editor/stored-body-images.ts +27 -0
- package/corpus/templates/content/app/components/editor/suggestions/presentation-rebase.ts +17 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -4
- package/corpus/templates/content/app/components/trash/TrashBrowser.tsx +4 -1
- package/corpus/templates/content/app/global.css +21 -0
- package/corpus/templates/content/app/hooks/use-content-trash.ts +8 -0
- package/corpus/templates/content/app/import-messages.ts +25 -0
- package/corpus/templates/content/app/trash-messages.ts +16 -0
- 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
- package/corpus/templates/content/changelog/2026-10-16-a-page-restored-from-trash-returns-to-its-place-in-its-colle.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-agent-written-markdown-keeps-nested-lists-indented-with-spac.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-opening-a-page-you-can-edit-no-longer-rebuilds-its-editor-on.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-pages-moved-or-imported-at-the-same-time-can-no-longer-end-u.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-re-importing-a-markdown-export-of-a-page-no-longer-reports-t.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-saving-a-page-or-restoring-one-of-its-versions-no-longer-fai.md +6 -0
- package/corpus/templates/content/changelog/2026-10-17-agents-reading-a-page-you-have-open-no-longer-wait-or-fail-w.md +6 -0
- package/corpus/templates/content/changelog/2026-10-19-fresh-document-reads-require-confirmation-from-every-open-ed.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-html-table-cells-preserve-a-trailing-backslash-when-opening-.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-preserve-empty-paragraph-colors-and-refuse-unsupported-inlin.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-the-advanced-filter-and-each-filter-group-inside-it-have-the.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-blocks-fields-keep-unconfirmed-saves-visible-and-agent-reads.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-preserve-compact-table-row-groups-and-report-invalid-block-colors.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-suggested-edits-show-an-agent-s-whole-reason-open-a-group-to.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-suggestions-keep-refusing-unmatched-emphasis-in-stored-markd.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-accept-remaining-and-reject-remaining-show-the-result-for-ev.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-accepting-a-group-of-suggested-edits-saves-faster-and-adds-o.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-agents-read-saved-page-text-after-failed-icon-change.md +6 -0
- 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
- package/corpus/templates/content/changelog/2026-10-22-text-an-agent-writes-inside-a-callout-column-or-synced-block.md +6 -0
- package/corpus/templates/content/e2e/auth-files.ts +28 -0
- package/corpus/templates/content/e2e/convergence-summary.ts +84 -29
- package/corpus/templates/content/e2e/gate-arm.ts +15 -0
- package/corpus/templates/content/e2e/global-setup.ts +43 -75
- package/corpus/templates/content/e2e/global-teardown.ts +34 -0
- package/corpus/templates/content/e2e/helpers.ts +598 -92
- package/corpus/templates/content/e2e/live-body-gate.ts +188 -0
- package/corpus/templates/content/e2e/playwright.config.ts +12 -3
- package/corpus/templates/content/e2e/server-identity.ts +47 -0
- package/corpus/templates/content/e2e/stored-form/collab-blocks.ts +123 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/content/scripts/_stored-form-census-kinds.ts +30 -2
- package/corpus/templates/content/scripts/historical-icon-apply.ts +9 -1
- package/corpus/templates/content/scripts/trace-startup.mjs +460 -133
- package/corpus/templates/content/server/db/exec.ts +58 -0
- package/corpus/templates/content/server/db/schema.ts +1 -0
- package/corpus/templates/content/server/lib/content-trash-purge.ts +208 -144
- package/corpus/templates/content/server/lib/document-metadata-updated-at.ts +43 -1
- package/corpus/templates/content/server/lib/document-revision.ts +23 -0
- package/corpus/templates/content/server/lib/live-body-writer.ts +199 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +63 -29
- package/corpus/templates/content/server/lib/notion.ts +5 -5
- package/corpus/templates/content/server/lib/suggested-edits.ts +357 -230
- package/corpus/templates/content/server/plugins/db.ts +5 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +50 -168
- package/corpus/templates/content/shared/api.ts +2 -0
- package/corpus/templates/content/shared/blocks-fields-manifest.ts +106 -0
- package/corpus/templates/content/shared/database-query.ts +192 -30
- package/corpus/templates/content/shared/document-export.ts +12 -14
- package/corpus/templates/content/shared/document-flush-protocol.ts +88 -0
- package/corpus/templates/content/shared/editor-save-state.ts +97 -0
- package/corpus/templates/content/shared/feature-flags.ts +10 -0
- package/corpus/templates/content/shared/import/markdown.ts +91 -7
- package/corpus/templates/content/shared/import/types.ts +2 -0
- package/corpus/templates/content/shared/inline-math.ts +6 -4
- package/corpus/templates/content/shared/nfm-fidelity.ts +247 -0
- package/corpus/templates/content/shared/nfm.ts +1933 -340
- package/corpus/templates/content/shared/suggestion-diff.ts +13 -0
- package/corpus/templates/content/shared/suggestion-formatting.ts +143 -20
- package/corpus/templates/content/shared/suggestion-text.ts +39 -0
- package/corpus/templates/content/vitest.config.ts +10 -0
- package/corpus/templates/crm/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/design/.agents/skills/native-effects/SKILL.md +9 -2
- package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +3 -249
- package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +5 -88
- package/corpus/templates/design/AGENTS.md +1 -3
- package/corpus/templates/design/CHANGELOG.md +32 -0
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1 -6
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +5 -7
- package/corpus/templates/design/actions/_native-local-export-server.ts +44 -31
- package/corpus/templates/design/actions/_native-render-contexts.ts +76 -21
- package/corpus/templates/design/actions/claim-native-local-export.ts +5 -0
- package/corpus/templates/design/actions/finish-native-local-export.ts +13 -2
- package/corpus/templates/design/actions/get-native-shader-approvals.ts +35 -0
- package/corpus/templates/design/actions/get-shader.ts +134 -219
- package/corpus/templates/design/actions/list-design-extensions.ts +3 -58
- package/corpus/templates/design/actions/request-native-local-export.ts +32 -6
- package/corpus/templates/design/actions/run-design-extension-action.ts +0 -29
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +131 -108
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +0 -218
- package/corpus/templates/design/app/components/design/DesignThumbnail.tsx +59 -3
- package/corpus/templates/design/app/components/design/EditPanel.tsx +35 -47
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +242 -62
- package/corpus/templates/design/app/components/design/NativePreviewErrorBoundary.tsx +53 -0
- package/corpus/templates/design/app/components/design/bridge/codegen.ts +18 -3
- package/corpus/templates/design/app/components/design/bridge/native-composition-clock.ts +5 -4
- package/corpus/templates/design/app/components/design/bridge/native-dom.ts +37 -0
- package/corpus/templates/design/app/components/design/bridge/native-intrinsic-image.ts +2 -1
- package/corpus/templates/design/app/components/design/bridge/native-mesh-grid.ts +90 -0
- package/corpus/templates/design/app/components/design/bridge/native-opaque-public-asset.ts +363 -0
- package/corpus/templates/design/app/components/design/bridge/native-opaque-worker-lease.ts +179 -0
- package/corpus/templates/design/app/components/design/bridge/native-preview-geometry.ts +132 -7
- package/corpus/templates/design/app/components/design/bridge/native-preview-policy.ts +4 -0
- package/corpus/templates/design/app/components/design/bridge/native-preview-viewport-transport.ts +378 -0
- package/corpus/templates/design/app/components/design/bridge/native-scene-body-transform.ts +62 -0
- package/corpus/templates/design/app/components/design/bridge/native-scene-presentation-element.ts +10 -0
- package/corpus/templates/design/app/components/design/bridge/native-shader-runtime.bridge.ts +646 -167
- package/corpus/templates/design/app/components/design/bridge/native-source-provider.ts +246 -192
- package/corpus/templates/design/app/components/design/bridge/native-stateful-resource.ts +2 -2
- package/corpus/templates/design/app/components/design/bridge/native-stateless-compute.ts +5 -2
- package/corpus/templates/design/app/components/design/bridge/native-svg-source.ts +11 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-broker.ts +6 -0
- package/corpus/templates/design/app/components/design/bridge/native-worker-entry.ts +761 -303
- package/corpus/templates/design/app/components/design/bridge/native-worker-fill.ts +16 -6
- package/corpus/templates/design/app/components/design/bridge/native-worker-gpu.ts +854 -91
- package/corpus/templates/design/app/components/design/bridge/native-worker-host.ts +15 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-input-assets.ts +200 -0
- package/corpus/templates/design/app/components/design/bridge/native-worker-protocol.ts +40 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-scene-host.ts +425 -126
- package/corpus/templates/design/app/components/design/bridge/native-worker-source-snapshot.ts +21 -0
- package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +5 -371
- package/corpus/templates/design/app/components/design/bridge/shader-runtime.bridge.ts +4 -146
- package/corpus/templates/design/app/components/design/design-canvas/interact-document.ts +5 -9
- package/corpus/templates/design/app/components/design/design-canvas/native-preview-surface.ts +150 -0
- package/corpus/templates/design/app/components/design/design-canvas/native-public-asset-preview.ts +409 -0
- package/corpus/templates/design/app/components/design/design-canvas/native-public-worker-preview.ts +1086 -0
- package/corpus/templates/design/app/components/design/design-canvas/private-replay-screenshot-preview.ts +2 -2
- package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +15 -26
- package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +74 -67
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +7 -19
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +39 -30
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +4 -0
- package/corpus/templates/design/app/components/design/inspector/NativeShaderColorControls.tsx +3 -7
- package/corpus/templates/design/app/components/design/inspector/NativeShaderPaintControls.tsx +12 -5
- package/corpus/templates/design/app/components/design/inspector/NativeShaderPanel.tsx +705 -190
- package/corpus/templates/design/app/components/design/inspector/fill-field-reading.ts +1 -2
- package/corpus/templates/design/app/components/design/inspector/index.ts +0 -6
- package/corpus/templates/design/app/components/design/inspector/native-catalog-display.ts +26 -5
- package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-fixture.ts +42 -0
- package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-preview.ts +51 -33
- package/corpus/templates/design/app/components/design/inspector/native-shader-paint.ts +1 -0
- package/corpus/templates/design/app/components/design/inspector/native-shader-property-draft.ts +89 -23
- package/corpus/templates/design/app/components/design/inspector/saved-glsl-shader.tsx +243 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +54 -5
- package/corpus/templates/design/app/components/design/shader-source-coordination.ts +66 -0
- package/corpus/templates/design/app/components/design/use-native-shader-approvals.ts +36 -8
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +60 -3
- package/corpus/templates/design/app/i18n/en-US.ts +78 -2
- package/corpus/templates/design/app/pages/Present.tsx +36 -1
- package/corpus/templates/design/app/pages/design-editor/commands/apply-file-content-update.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/commit-visual-styles.ts +2 -3
- package/corpus/templates/design/app/pages/design-editor/commands/cross-screen-element-drop.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/layer-move-to-screen.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/paste-svg-layer.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/prepare-content-history-replay.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/redo.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/render-png-blob.ts +84 -41
- package/corpus/templates/design/app/pages/design-editor/commands/shader-source-edit.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/undo.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/design-editor-view.tsx +0 -2
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-content-and-components.ts +4 -33
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-export-and-handoff.ts +2 -2
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-history.ts +0 -11
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-layer-models.ts +2 -55
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-screen-rendering.tsx +0 -3
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-selection-and-styles.ts +0 -24
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +0 -16
- package/corpus/templates/design/app/pages/design-editor/use-native-local-export-requests.ts +70 -11
- package/corpus/templates/design/app/pages/design-editor/view/single-screen-canvas.tsx +0 -2
- package/corpus/templates/design/changelog/2026-10-20-folded-mesh-adds-an-animated-sculpted-fill-with-editable-col.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-read-only-design-views-render-native-shader-previews-in-nest.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-selected-screens-with-shader-effects-can-be-exported-togethe.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-shader-previews-reuse-validated-scene-data-while-panning-inc.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-shader-previews-stay-aligned-while-you-zoom.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-signed-out-sessions-no-longer-watch-for-private-png-export-r.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-effect-thumbnails-show-richer-previews.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-native-effects-render-across-previews.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-native-shader-previews-use-less-gpu-memory-when-many-mesh-ef.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-opening-design-no-longer-shows-png-export-errors-when-no-exp.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-pulsing-border-controls-grouped.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-pulsing-border-follows-element-outlines.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-remove-obsolete-shader-fills.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-shader-previews-recover-from-temporary-gpu-and-image-failure.md +6 -0
- package/corpus/templates/design/changelog/2026-10-22-shader-fills-and-effects-render-correctly-on-canvas-elements.md +6 -0
- package/corpus/templates/design/package.json +0 -1
- package/corpus/templates/design/playwright.config.ts +1 -1
- package/corpus/templates/design/scripts/runtime-budget-zoom.ts +9 -21
- package/corpus/templates/design/scripts/runtime-budget.ts +10 -24
- package/corpus/templates/design/server/plugins/agent-chat.ts +0 -2
- package/corpus/templates/design/shared/effect-graph.ts +46 -1
- package/corpus/templates/design/shared/generation-output-receipt.ts +0 -1
- package/corpus/templates/design/shared/native-effect-animation-capability.ts +6 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh-v1.ts +268 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh-v2.ts +310 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh.ts +489 -0
- package/corpus/templates/design/shared/native-effect-gallery-additions.ts +2 -2
- package/corpus/templates/design/shared/native-effect-paint.ts +8 -0
- package/corpus/templates/design/shared/native-effect-parameter-constraints.ts +8 -1
- package/corpus/templates/design/shared/native-effect-presets.ts +18 -1
- package/corpus/templates/design/shared/native-effect-property-presentation.ts +81 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border-v3.ts +281 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border-v4.ts +284 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border.ts +300 -0
- package/corpus/templates/design/shared/native-effect-trust.ts +6 -0
- package/corpus/templates/design/shared/native-effect-wgsl.ts +12 -0
- package/corpus/templates/design/shared/native-effects.ts +528 -15
- package/corpus/templates/design/shared/native-input-resources.ts +36 -0
- package/corpus/templates/design/shared/native-local-export.ts +14 -0
- package/corpus/templates/design/shared/native-parameter-animation.ts +1 -0
- package/corpus/templates/design/shared/native-pointer-input.ts +9 -11
- package/corpus/templates/design/shared/shader-fills.ts +0 -513
- package/corpus/templates/design/vitest.setup.ts +7 -1
- package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +20 -18
- package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +36 -80
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +54 -16
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +50 -73
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +20 -18
- package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/slides-2/.agents/skills/actions/SKILL.md +199 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/action-fields.md +145 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/examples.md +96 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/slides-2/.agents/skills/adding-a-feature/SKILL.md +235 -0
- package/corpus/templates/slides-2/.agents/skills/agent-native-docs/SKILL.md +161 -0
- package/corpus/templates/slides-2/.agents/skills/agent-native-toolkit/SKILL.md +314 -0
- package/corpus/templates/slides-2/.agents/skills/analytics-data-for-decks/SKILL.md +44 -0
- package/corpus/templates/slides-2/.agents/skills/apply-slide-comments/SKILL.md +63 -0
- package/corpus/templates/slides-2/.agents/skills/client-side-routing/SKILL.md +87 -0
- package/corpus/templates/slides-2/.agents/skills/context-awareness/SKILL.md +282 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/SKILL.md +263 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/reference-inputs.md +72 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/slide-templates.md +93 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/source-material.md +16 -0
- package/corpus/templates/slides-2/.agents/skills/creative-context/SKILL.md +134 -0
- package/corpus/templates/slides-2/.agents/skills/customizing-agent-native/SKILL.md +219 -0
- package/corpus/templates/slides-2/.agents/skills/deck-management/SKILL.md +182 -0
- package/corpus/templates/slides-2/.agents/skills/delegate-to-agent/SKILL.md +62 -0
- package/corpus/templates/slides-2/.agents/skills/design-systems/SKILL.md +233 -0
- package/corpus/templates/slides-2/.agents/skills/external-agents/SKILL.md +549 -0
- package/corpus/templates/slides-2/.agents/skills/external-agents/references/mcp-apps-embedding.md +169 -0
- package/corpus/templates/slides-2/.agents/skills/frontend-design/SKILL.md +102 -0
- package/corpus/templates/slides-2/.agents/skills/frontend-design/references/visual-direction.md +102 -0
- package/corpus/templates/slides-2/.agents/skills/image-generation-via-a2a/SKILL.md +134 -0
- package/corpus/templates/slides-2/.agents/skills/performance/SKILL.md +79 -0
- package/corpus/templates/slides-2/.agents/skills/portability/SKILL.md +108 -0
- package/corpus/templates/slides-2/.agents/skills/real-time-sync/SKILL.md +146 -0
- package/corpus/templates/slides-2/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/templates/slides-2/.agents/skills/secrets/SKILL.md +82 -0
- package/corpus/templates/slides-2/.agents/skills/security/SKILL.md +80 -0
- package/corpus/templates/slides-2/.agents/skills/self-modifying-code/SKILL.md +123 -0
- package/corpus/templates/slides-2/.agents/skills/shadcn-ui/SKILL.md +71 -0
- package/corpus/templates/slides-2/.agents/skills/sharing/SKILL.md +286 -0
- package/corpus/templates/slides-2/.agents/skills/slide-design/SKILL.md +144 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/SKILL.md +284 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/animations.md +33 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/freeform-objects.md +22 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/restyling.md +69 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/transitions.md +26 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/video.md +45 -0
- package/corpus/templates/slides-2/.agents/skills/slide-images/SKILL.md +136 -0
- package/corpus/templates/slides-2/.agents/skills/storing-data/SKILL.md +234 -0
- package/corpus/templates/slides-2/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/slides-2/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides-2/.agents/skills/workspace-conventions/SKILL.md +103 -0
- package/corpus/templates/slides-2/.builder/rules/deploy-app.mdc +22 -0
- package/corpus/templates/slides-2/.builder/rules/organize-ui.mdc +9 -0
- package/corpus/templates/slides-2/.dockerignore +61 -0
- package/corpus/templates/slides-2/.env.example +23 -0
- package/corpus/templates/slides-2/.ignore +3 -0
- package/corpus/templates/slides-2/.mcp.json +8 -0
- package/corpus/templates/slides-2/.oxfmtrc.json +8 -0
- package/corpus/templates/slides-2/AGENTS.md +66 -0
- package/corpus/templates/slides-2/CHANGELOG.md +76 -0
- package/corpus/templates/slides-2/DEVELOPING.md +157 -0
- package/corpus/templates/slides-2/README.md +58 -0
- package/corpus/templates/slides-2/THIRD_PARTY_NOTICES.md +33 -0
- package/corpus/templates/slides-2/_gitignore +38 -0
- package/corpus/templates/slides-2/actions/_agent-presence.ts +29 -0
- package/corpus/templates/slides-2/actions/_app-url.ts +37 -0
- package/corpus/templates/slides-2/actions/_deck-app-scope.ts +30 -0
- package/corpus/templates/slides-2/actions/_deck-tracking.ts +260 -0
- package/corpus/templates/slides-2/actions/_deck-write.ts +206 -0
- package/corpus/templates/slides-2/actions/_imported-slide-source.ts +162 -0
- package/corpus/templates/slides-2/actions/_inline-image-storage.ts +1013 -0
- package/corpus/templates/slides-2/actions/_linked-design-system.ts +83 -0
- package/corpus/templates/slides-2/actions/_presenter-notes.ts +83 -0
- package/corpus/templates/slides-2/actions/_render-artifacts.ts +111 -0
- package/corpus/templates/slides-2/actions/_slide-source.ts +344 -0
- package/corpus/templates/slides-2/actions/_tab-state.ts +51 -0
- package/corpus/templates/slides-2/actions/_test-brandfetch.ts +31 -0
- package/corpus/templates/slides-2/actions/_uploaded-files.ts +114 -0
- package/corpus/templates/slides-2/actions/add-deck.ts +123 -0
- package/corpus/templates/slides-2/actions/add-slide-comment.ts +267 -0
- package/corpus/templates/slides-2/actions/add-slide.ts +888 -0
- package/corpus/templates/slides-2/actions/analyze-brand-assets.ts +66 -0
- package/corpus/templates/slides-2/actions/apply-design-system.ts +111 -0
- package/corpus/templates/slides-2/actions/approve-deck-access-request.ts +287 -0
- package/corpus/templates/slides-2/actions/audit-contrast.ts +143 -0
- package/corpus/templates/slides-2/actions/check-image-gen.ts +17 -0
- package/corpus/templates/slides-2/actions/clone-context-slide.ts +340 -0
- package/corpus/templates/slides-2/actions/clone-creative-context-deck.ts +143 -0
- package/corpus/templates/slides-2/actions/control-deck-history.ts +186 -0
- package/corpus/templates/slides-2/actions/control-presenter.ts +117 -0
- package/corpus/templates/slides-2/actions/control-slide-editor.ts +267 -0
- package/corpus/templates/slides-2/actions/create-deck-from-template.ts +274 -0
- package/corpus/templates/slides-2/actions/create-deck.ts +1243 -0
- package/corpus/templates/slides-2/actions/create-design-system.ts +131 -0
- package/corpus/templates/slides-2/actions/create-share-link.ts +127 -0
- package/corpus/templates/slides-2/actions/db-health.ts +22 -0
- package/corpus/templates/slides-2/actions/delete-asset.ts +154 -0
- package/corpus/templates/slides-2/actions/delete-deck.ts +427 -0
- package/corpus/templates/slides-2/actions/delete-design-system.ts +167 -0
- package/corpus/templates/slides-2/actions/delete-slide-comment.ts +143 -0
- package/corpus/templates/slides-2/actions/delete-staged-dataset.ts +30 -0
- package/corpus/templates/slides-2/actions/duplicate-deck.ts +299 -0
- package/corpus/templates/slides-2/actions/export-google-slides.ts +41 -0
- package/corpus/templates/slides-2/actions/export-html.ts +770 -0
- package/corpus/templates/slides-2/actions/export-pptx.ts +2203 -0
- package/corpus/templates/slides-2/actions/extract-pdf.ts +49 -0
- package/corpus/templates/slides-2/actions/generate-image-api.ts +671 -0
- package/corpus/templates/slides-2/actions/generate-image.ts +492 -0
- package/corpus/templates/slides-2/actions/get-agent-access-deck.ts +52 -0
- package/corpus/templates/slides-2/actions/get-deck-access-status.ts +130 -0
- package/corpus/templates/slides-2/actions/get-deck-design-tokens.ts +62 -0
- package/corpus/templates/slides-2/actions/get-deck-reference-context.ts +232 -0
- package/corpus/templates/slides-2/actions/get-deck-template.ts +38 -0
- package/corpus/templates/slides-2/actions/get-deck-version.ts +85 -0
- package/corpus/templates/slides-2/actions/get-deck.ts +562 -0
- package/corpus/templates/slides-2/actions/get-design-system-decode-job-status.ts +57 -0
- package/corpus/templates/slides-2/actions/get-design-system-tier-limit.ts +12 -0
- package/corpus/templates/slides-2/actions/get-design-system.ts +453 -0
- package/corpus/templates/slides-2/actions/get-google-docs-status.ts +106 -0
- package/corpus/templates/slides-2/actions/get-google-picker-token.ts +84 -0
- package/corpus/templates/slides-2/actions/get-home-suggestions.ts +52 -0
- package/corpus/templates/slides-2/actions/get-layout-overflows.ts +192 -0
- package/corpus/templates/slides-2/actions/get-slide-render.ts +125 -0
- package/corpus/templates/slides-2/actions/get-slide-source.ts +115 -0
- package/corpus/templates/slides-2/actions/get-slide-theme-preview.ts +64 -0
- package/corpus/templates/slides-2/actions/get-slide-theme.ts +44 -0
- package/corpus/templates/slides-2/actions/get-slides-2-upload-storage-status.ts +17 -0
- package/corpus/templates/slides-2/actions/get-slides-notification-prefs.ts +37 -0
- package/corpus/templates/slides-2/actions/get-workspace-defaults.ts +51 -0
- package/corpus/templates/slides-2/actions/image-gen-status.ts +35 -0
- package/corpus/templates/slides-2/actions/import-code.ts +26 -0
- package/corpus/templates/slides-2/actions/import-design-project.ts +49 -0
- package/corpus/templates/slides-2/actions/import-document.ts +125 -0
- package/corpus/templates/slides-2/actions/import-docx.ts +57 -0
- package/corpus/templates/slides-2/actions/import-file.ts +1273 -0
- package/corpus/templates/slides-2/actions/import-from-url.ts +25 -0
- package/corpus/templates/slides-2/actions/import-google-doc.ts +208 -0
- package/corpus/templates/slides-2/actions/import-google-font.ts +110 -0
- package/corpus/templates/slides-2/actions/import-google-slides-reference.ts +667 -0
- package/corpus/templates/slides-2/actions/import-pptx.ts +564 -0
- package/corpus/templates/slides-2/actions/import-svgl-logo.ts +115 -0
- package/corpus/templates/slides-2/actions/index-design-system-with-builder.ts +181 -0
- package/corpus/templates/slides-2/actions/index-uploaded-design-system-files.ts +77 -0
- package/corpus/templates/slides-2/actions/list-assets.ts +286 -0
- package/corpus/templates/slides-2/actions/list-deck-templates.ts +83 -0
- package/corpus/templates/slides-2/actions/list-deck-versions.ts +185 -0
- package/corpus/templates/slides-2/actions/list-decks.ts +591 -0
- package/corpus/templates/slides-2/actions/list-design-systems.ts +180 -0
- package/corpus/templates/slides-2/actions/list-slide-comments.ts +128 -0
- package/corpus/templates/slides-2/actions/list-slide-themes.ts +17 -0
- package/corpus/templates/slides-2/actions/list-staged-datasets.ts +14 -0
- package/corpus/templates/slides-2/actions/logo-config.ts +13 -0
- package/corpus/templates/slides-2/actions/navigate.ts +158 -0
- package/corpus/templates/slides-2/actions/patch-deck.ts +2378 -0
- package/corpus/templates/slides-2/actions/provider-api-catalog.ts +25 -0
- package/corpus/templates/slides-2/actions/provider-api-docs.ts +83 -0
- package/corpus/templates/slides-2/actions/provider-api-request.ts +222 -0
- package/corpus/templates/slides-2/actions/query-staged-dataset.ts +83 -0
- package/corpus/templates/slides-2/actions/read-composer-source.ts +108 -0
- package/corpus/templates/slides-2/actions/request-deck-access.ts +803 -0
- package/corpus/templates/slides-2/actions/restore-deck-version.ts +203 -0
- package/corpus/templates/slides-2/actions/run.ts +2 -0
- package/corpus/templates/slides-2/actions/save-deck.ts +313 -0
- package/corpus/templates/slides-2/actions/search-google-fonts.ts +61 -0
- package/corpus/templates/slides-2/actions/search-images.ts +30 -0
- package/corpus/templates/slides-2/actions/search-logos.ts +23 -0
- package/corpus/templates/slides-2/actions/search-svgl-logos.ts +42 -0
- package/corpus/templates/slides-2/actions/set-default-design-system.ts +88 -0
- package/corpus/templates/slides-2/actions/set-workspace-defaults.ts +61 -0
- package/corpus/templates/slides-2/actions/start-design-system-upload.ts +80 -0
- package/corpus/templates/slides-2/actions/sync-design-system-with-builder.ts +84 -0
- package/corpus/templates/slides-2/actions/toggle-slide-comment-reaction.ts +150 -0
- package/corpus/templates/slides-2/actions/transform-slide-objects.ts +1528 -0
- package/corpus/templates/slides-2/actions/update-asset.ts +499 -0
- package/corpus/templates/slides-2/actions/update-deck-aspect-ratio.ts +95 -0
- package/corpus/templates/slides-2/actions/update-deck-design-tokens.ts +175 -0
- package/corpus/templates/slides-2/actions/update-design-system.ts +95 -0
- package/corpus/templates/slides-2/actions/update-slide-comment.ts +213 -0
- package/corpus/templates/slides-2/actions/update-slide-source.ts +353 -0
- package/corpus/templates/slides-2/actions/update-slide.ts +850 -0
- package/corpus/templates/slides-2/actions/update-slides-notification-prefs.ts +55 -0
- package/corpus/templates/slides-2/actions/view-screen.ts +1098 -0
- package/corpus/templates/slides-2/agent-native.app-skill.json +165 -0
- package/corpus/templates/slides-2/agent-native.config.ts +20 -0
- package/corpus/templates/slides-2/agent-native.json +18 -0
- package/corpus/templates/slides-2/app/components/ThemeToggle.tsx +47 -0
- package/corpus/templates/slides-2/app/components/comments/SlideCommentPins.tsx +781 -0
- package/corpus/templates/slides-2/app/components/comments/SlideCommentsPanel.tsx +1075 -0
- package/corpus/templates/slides-2/app/components/deck/DeckCard.tsx +304 -0
- package/corpus/templates/slides-2/app/components/deck/DeckFilterMenu.tsx +83 -0
- package/corpus/templates/slides-2/app/components/deck/ExcalidrawSlide.tsx +183 -0
- package/corpus/templates/slides-2/app/components/deck/MermaidRenderer.tsx +126 -0
- package/corpus/templates/slides-2/app/components/deck/SlideRenderer.tsx +1553 -0
- package/corpus/templates/slides-2/app/components/design-system/DesignSystemCard.tsx +235 -0
- package/corpus/templates/slides-2/app/components/design-system/DesignSystemSetup.tsx +2021 -0
- package/corpus/templates/slides-2/app/components/design-system/builder-design-system-upload.ts +200 -0
- package/corpus/templates/slides-2/app/components/design-system/builder-index-response.ts +104 -0
- package/corpus/templates/slides-2/app/components/editor/AddSlidePopover.tsx +461 -0
- package/corpus/templates/slides-2/app/components/editor/AiEditingMarker.tsx +24 -0
- package/corpus/templates/slides-2/app/components/editor/AlignmentGuides.tsx +82 -0
- package/corpus/templates/slides-2/app/components/editor/AnimationsPanel.tsx +698 -0
- package/corpus/templates/slides-2/app/components/editor/AppMenu.tsx +356 -0
- package/corpus/templates/slides-2/app/components/editor/AssetLibraryPanel.tsx +508 -0
- package/corpus/templates/slides-2/app/components/editor/BlockBubbleMenu.tsx +548 -0
- package/corpus/templates/slides-2/app/components/editor/DeckAccessDeniedPage.tsx +173 -0
- package/corpus/templates/slides-2/app/components/editor/DeckEditorSkeleton.tsx +35 -0
- package/corpus/templates/slides-2/app/components/editor/DeferredPopoverFallback.tsx +148 -0
- package/corpus/templates/slides-2/app/components/editor/EditorActionCluster.tsx +217 -0
- package/corpus/templates/slides-2/app/components/editor/EditorSidebar.tsx +1047 -0
- package/corpus/templates/slides-2/app/components/editor/EditorToolbar.tsx +1285 -0
- package/corpus/templates/slides-2/app/components/editor/ExportMenu.tsx +579 -0
- package/corpus/templates/slides-2/app/components/editor/GeneratingOverlay.tsx +21 -0
- package/corpus/templates/slides-2/app/components/editor/GeneratingSlidePreview.tsx +73 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleDocImportHint.tsx +378 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleDriveConnectionCta.tsx +154 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleSlidesReferenceImport.tsx +299 -0
- package/corpus/templates/slides-2/app/components/editor/HistoryPanel.tsx +354 -0
- package/corpus/templates/slides-2/app/components/editor/HomeQuickStartDialog.tsx +202 -0
- package/corpus/templates/slides-2/app/components/editor/ImageCropOverlay.tsx +820 -0
- package/corpus/templates/slides-2/app/components/editor/ImageDropPromptPopover.tsx +280 -0
- package/corpus/templates/slides-2/app/components/editor/ImageGenPanel.tsx +244 -0
- package/corpus/templates/slides-2/app/components/editor/ImageOverlay.tsx +280 -0
- package/corpus/templates/slides-2/app/components/editor/ImageSearchPanel.tsx +183 -0
- package/corpus/templates/slides-2/app/components/editor/ImportDeckButton.tsx +247 -0
- package/corpus/templates/slides-2/app/components/editor/LogoSearchPanel.tsx +366 -0
- package/corpus/templates/slides-2/app/components/editor/MermaidToExcalidrawPanel.tsx +99 -0
- package/corpus/templates/slides-2/app/components/editor/MissingDeckAccessPane.tsx +219 -0
- package/corpus/templates/slides-2/app/components/editor/NewDeckReferenceStep.tsx +812 -0
- package/corpus/templates/slides-2/app/components/editor/PromptDialog.tsx +963 -0
- package/corpus/templates/slides-2/app/components/editor/QuestionFlow.tsx +119 -0
- package/corpus/templates/slides-2/app/components/editor/RequestDeckAccessDialog.tsx +101 -0
- package/corpus/templates/slides-2/app/components/editor/ShareDialog.tsx +126 -0
- package/corpus/templates/slides-2/app/components/editor/SlideContextToolbar.tsx +1471 -0
- package/corpus/templates/slides-2/app/components/editor/SlideEditor.tsx +11183 -0
- package/corpus/templates/slides-2/app/components/editor/SlideOverflowWarning.tsx +82 -0
- package/corpus/templates/slides-2/app/components/editor/SlideScrollStack.tsx +307 -0
- package/corpus/templates/slides-2/app/components/editor/SlideSlashCommandMenu.tsx +692 -0
- package/corpus/templates/slides-2/app/components/editor/SlideThumbnailContextMenu.tsx +52 -0
- package/corpus/templates/slides-2/app/components/editor/SlideTransitionControl.tsx +184 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesComposerContext.tsx +789 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesComposerContextProvider.tsx +74 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesLayersPanel.tsx +377 -0
- package/corpus/templates/slides-2/app/components/editor/SpeakerNotesPanel.tsx +119 -0
- package/corpus/templates/slides-2/app/components/editor/TweaksPanel.tsx +77 -0
- package/corpus/templates/slides-2/app/components/editor/UploadStorageGate.tsx +37 -0
- package/corpus/templates/slides-2/app/components/editor/bullet-editing.ts +880 -0
- package/corpus/templates/slides-2/app/components/editor/canvas-interactions/index.ts +12 -0
- package/corpus/templates/slides-2/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +119 -0
- package/corpus/templates/slides-2/app/components/editor/commit-active-edit.ts +14 -0
- package/corpus/templates/slides-2/app/components/editor/editor-command-model.ts +35 -0
- package/corpus/templates/slides-2/app/components/editor/fit-text-object.ts +31 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-cases.json +983 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-host.ts +747 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.ts +6891 -0
- package/corpus/templates/slides-2/app/components/editor/inline-edit-session.ts +26 -0
- package/corpus/templates/slides-2/app/components/editor/list-editing.ts +501 -0
- package/corpus/templates/slides-2/app/components/editor/rich-text-selection.ts +975 -0
- package/corpus/templates/slides-2/app/components/editor/rte-test-utils.ts +265 -0
- package/corpus/templates/slides-2/app/components/editor/selection-overlay-measurement.ts +191 -0
- package/corpus/templates/slides-2/app/components/editor/slide-escape-arbiter.ts +34 -0
- package/corpus/templates/slides-2/app/components/editor/slide-object-interactions.ts +6362 -0
- package/corpus/templates/slides-2/app/components/editor/slide-object-transform.browser-host.ts +19 -0
- package/corpus/templates/slides-2/app/components/editor/slide-pointer-target.ts +432 -0
- package/corpus/templates/slides-2/app/components/editor/slide-presence.ts +13 -0
- package/corpus/templates/slides-2/app/components/editor/slide-style.ts +243 -0
- package/corpus/templates/slides-2/app/components/editor/slide-text-targets.ts +540 -0
- package/corpus/templates/slides-2/app/components/editor/style-clipboard.ts +102 -0
- package/corpus/templates/slides-2/app/components/editor/use-prompt-import.ts +159 -0
- package/corpus/templates/slides-2/app/components/home/SlidesHomeLibrary.tsx +79 -0
- package/corpus/templates/slides-2/app/components/layout/AgentWorkIndicator.tsx +193 -0
- package/corpus/templates/slides-2/app/components/layout/Header.tsx +110 -0
- package/corpus/templates/slides-2/app/components/layout/Layout.tsx +492 -0
- package/corpus/templates/slides-2/app/components/layout/Sidebar.tsx +109 -0
- package/corpus/templates/slides-2/app/components/layout/layout-route-policy.ts +28 -0
- package/corpus/templates/slides-2/app/components/presentation/PresentationView.tsx +1116 -0
- package/corpus/templates/slides-2/app/components/presentation/PresenterView.tsx +526 -0
- package/corpus/templates/slides-2/app/components/presentation/SlideTransitionStage.tsx +297 -0
- package/corpus/templates/slides-2/app/components/presentation/present-channel.ts +31 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-build-steps.ts +231 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-navigation.ts +273 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-transition-motion.ts +258 -0
- package/corpus/templates/slides-2/app/components/presentation/voice-navigation.ts +61 -0
- package/corpus/templates/slides-2/app/components/settings/notification-settings.tsx +93 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2AssetBrowser.tsx +726 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2CommandMenu.tsx +453 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Comments.tsx +571 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2DesignTokens.tsx +345 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Editor.tsx +4804 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ExportMenu.tsx +671 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2FontBrowser.tsx +342 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ImageCropControls.tsx +487 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Inspector.tsx +950 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2SvglLogoSearchDialog.tsx +332 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/cross-slide-edit-history.ts +151 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/design-token-presets.ts +140 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/editor-action-errors.ts +47 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/editor-export-errors.ts +60 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/geometry.ts +275 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/image-crop-style.ts +82 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/inline-text-editor.tsx +631 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/keyboard-shortcuts.ts +104 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/object-insertion.ts +13 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/preview-patches.ts +54 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/sandbox-render-errors.ts +23 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/source-structure.ts +634 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/types.ts +85 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2BlackoutOverlay.tsx +13 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ControlBar.tsx +285 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2HelpDialog.tsx +72 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2JumpInput.tsx +38 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2LaserPointer.tsx +67 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Overview.tsx +161 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Player.tsx +839 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ProgressBar.tsx +23 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/keyboard.ts +36 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/presenter-channel.ts +131 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/use-presenter-action-bridge.ts +296 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/useSlides2TouchSwipe.ts +80 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/SandboxedSlide.tsx +724 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/SlideContentRenderer.tsx +137 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/Slides2Canvas.tsx +99 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/constants.ts +4 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/protocol.ts +1400 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/transition-frame.ts +439 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplateLibrary.tsx +314 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplatePreview.tsx +60 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplateStage.tsx +45 -0
- package/corpus/templates/slides-2/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/button-group.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/button.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/card.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/command.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/context-menu.tsx +32 -0
- package/corpus/templates/slides-2/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/filter-trigger.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/input.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/label.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/select.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/tabs.tsx +59 -0
- package/corpus/templates/slides-2/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/slides-2/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/slides-2/app/components/visual-editor/CanvasCommentPins.tsx +46 -0
- package/corpus/templates/slides-2/app/components/visual-editor/DrawOverlay.tsx +27 -0
- package/corpus/templates/slides-2/app/components/visual-editor/MultiSelectChip.tsx +97 -0
- package/corpus/templates/slides-2/app/components/visual-editor/SaveStatusIndicator.tsx +273 -0
- package/corpus/templates/slides-2/app/components/visual-editor/index.ts +4 -0
- package/corpus/templates/slides-2/app/context/DeckContext.tsx +7486 -0
- package/corpus/templates/slides-2/app/design-system.ts +3 -0
- package/corpus/templates/slides-2/app/entry.client.tsx +10 -0
- package/corpus/templates/slides-2/app/entry.server.tsx +10 -0
- package/corpus/templates/slides-2/app/global.css +1626 -0
- package/corpus/templates/slides-2/app/hooks/use-agent-generating.ts +517 -0
- package/corpus/templates/slides-2/app/hooks/use-compact-editor-layout.ts +26 -0
- package/corpus/templates/slides-2/app/hooks/use-contrast-audit-bridge.ts +49 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-access-reload.ts +70 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-access.ts +50 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-design-system.ts +146 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-history-action-bridge.ts +266 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-presence.ts +89 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-role.ts +46 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-versions.ts +43 -0
- package/corpus/templates/slides-2/app/hooks/use-design-system-workflows.ts +11 -0
- package/corpus/templates/slides-2/app/hooks/use-design-systems.ts +31 -0
- package/corpus/templates/slides-2/app/hooks/use-generating-slide-preview.ts +115 -0
- package/corpus/templates/slides-2/app/hooks/use-navigation-state.ts +229 -0
- package/corpus/templates/slides-2/app/hooks/use-new-deck-generation-signal.ts +46 -0
- package/corpus/templates/slides-2/app/hooks/use-new-deck-generation.ts +710 -0
- package/corpus/templates/slides-2/app/hooks/use-sidebar-collapsed.ts +95 -0
- package/corpus/templates/slides-2/app/hooks/use-slide-comments.ts +202 -0
- package/corpus/templates/slides-2/app/hooks/use-slide-file-storage-status.ts +55 -0
- package/corpus/templates/slides-2/app/hooks/use-undo-selection.ts +66 -0
- package/corpus/templates/slides-2/app/hooks/use-workspace-defaults.ts +31 -0
- package/corpus/templates/slides-2/app/i18n/en-US.ts +1507 -0
- package/corpus/templates/slides-2/app/i18n/index.ts +19 -0
- package/corpus/templates/slides-2/app/lib/agent-visible-message.ts +21 -0
- package/corpus/templates/slides-2/app/lib/aspect-ratios.ts +7 -0
- package/corpus/templates/slides-2/app/lib/asset-error-copy.ts +59 -0
- package/corpus/templates/slides-2/app/lib/canvas-zoom.ts +47 -0
- package/corpus/templates/slides-2/app/lib/composer-context.ts +152 -0
- package/corpus/templates/slides-2/app/lib/composer-draft.ts +34 -0
- package/corpus/templates/slides-2/app/lib/contrast-audit.ts +390 -0
- package/corpus/templates/slides-2/app/lib/contrast-resolve.ts +240 -0
- package/corpus/templates/slides-2/app/lib/create-deck-generation.ts +938 -0
- package/corpus/templates/slides-2/app/lib/deck-access-lost.ts +4 -0
- package/corpus/templates/slides-2/app/lib/deck-backup.ts +186 -0
- package/corpus/templates/slides-2/app/lib/deck-editor-loading.ts +91 -0
- package/corpus/templates/slides-2/app/lib/deck-export-file-client.ts +77 -0
- package/corpus/templates/slides-2/app/lib/deck-filter.ts +52 -0
- package/corpus/templates/slides-2/app/lib/deck-list-loading.ts +16 -0
- package/corpus/templates/slides-2/app/lib/deck-preview-frame.ts +15 -0
- package/corpus/templates/slides-2/app/lib/deck-share-links.ts +9 -0
- package/corpus/templates/slides-2/app/lib/deck-sorting.ts +19 -0
- package/corpus/templates/slides-2/app/lib/deferred-editor-surfaces.ts +24 -0
- package/corpus/templates/slides-2/app/lib/design-system-selection.ts +11 -0
- package/corpus/templates/slides-2/app/lib/design-systems.ts +231 -0
- package/corpus/templates/slides-2/app/lib/dynamic-import.ts +50 -0
- package/corpus/templates/slides-2/app/lib/editor-agent-handoff.ts +92 -0
- package/corpus/templates/slides-2/app/lib/editor-shortcuts.ts +153 -0
- package/corpus/templates/slides-2/app/lib/export-google-slides-client.ts +168 -0
- package/corpus/templates/slides-2/app/lib/export-pdf-client.ts +684 -0
- package/corpus/templates/slides-2/app/lib/export-pptx-client.ts +2420 -0
- package/corpus/templates/slides-2/app/lib/generation-lifecycle.ts +24 -0
- package/corpus/templates/slides-2/app/lib/generation-state.ts +247 -0
- package/corpus/templates/slides-2/app/lib/google-docs-client.ts +110 -0
- package/corpus/templates/slides-2/app/lib/google-slides-export-availability-client.ts +53 -0
- package/corpus/templates/slides-2/app/lib/google-slides-reference-source.ts +18 -0
- package/corpus/templates/slides-2/app/lib/image-download.ts +85 -0
- package/corpus/templates/slides-2/app/lib/image-drop-to-agent.ts +210 -0
- package/corpus/templates/slides-2/app/lib/import-uploaded-deck.ts +132 -0
- package/corpus/templates/slides-2/app/lib/inline-edit-remote.ts +55 -0
- package/corpus/templates/slides-2/app/lib/localize-slides-changelog.ts +47 -0
- package/corpus/templates/slides-2/app/lib/mermaid-blocks.ts +18 -0
- package/corpus/templates/slides-2/app/lib/new-deck-reference-selection.ts +174 -0
- package/corpus/templates/slides-2/app/lib/normalize-slide-padding.ts +74 -0
- package/corpus/templates/slides-2/app/lib/pending-deck-changes.ts +33 -0
- package/corpus/templates/slides-2/app/lib/portaled-layer.ts +7 -0
- package/corpus/templates/slides-2/app/lib/pptx-google-slides.ts +204 -0
- package/corpus/templates/slides-2/app/lib/prompt-attachment-adapter.ts +37 -0
- package/corpus/templates/slides-2/app/lib/prompt-file-uploads.ts +557 -0
- package/corpus/templates/slides-2/app/lib/recent-references.ts +106 -0
- package/corpus/templates/slides-2/app/lib/reference-document-hydration.ts +406 -0
- package/corpus/templates/slides-2/app/lib/register-chat-renderers.tsx +645 -0
- package/corpus/templates/slides-2/app/lib/reveal-after-delete.ts +55 -0
- package/corpus/templates/slides-2/app/lib/sanitize-slide-html.ts +752 -0
- package/corpus/templates/slides-2/app/lib/slide-agent-context.ts +148 -0
- package/corpus/templates/slides-2/app/lib/slide-animation-elements.ts +900 -0
- package/corpus/templates/slides-2/app/lib/slide-clipboard.ts +534 -0
- package/corpus/templates/slides-2/app/lib/slide-comment-anchor.ts +286 -0
- package/corpus/templates/slides-2/app/lib/slide-content-merge.ts +295 -0
- package/corpus/templates/slides-2/app/lib/slide-image-replacement.ts +1919 -0
- package/corpus/templates/slides-2/app/lib/slide-live-remote.ts +215 -0
- package/corpus/templates/slides-2/app/lib/slide-scroll.ts +56 -0
- package/corpus/templates/slides-2/app/lib/slide-source-map.ts +1099 -0
- package/corpus/templates/slides-2/app/lib/slide-video.ts +390 -0
- package/corpus/templates/slides-2/app/lib/slides-relay-tracking.ts +114 -0
- package/corpus/templates/slides-2/app/lib/streaming-slide-html.ts +77 -0
- package/corpus/templates/slides-2/app/lib/tab-id.ts +3 -0
- package/corpus/templates/slides-2/app/lib/template-navigation.ts +15 -0
- package/corpus/templates/slides-2/app/lib/text-tool-shortcut.ts +75 -0
- package/corpus/templates/slides-2/app/lib/undo-reveal.ts +332 -0
- package/corpus/templates/slides-2/app/lib/upload-response.ts +107 -0
- package/corpus/templates/slides-2/app/lib/utils.ts +38 -0
- package/corpus/templates/slides-2/app/lib/validate-native-slide-html.ts +177 -0
- package/corpus/templates/slides-2/app/lib/video-upload.ts +354 -0
- package/corpus/templates/slides-2/app/pages/DeckEditor.tsx +6158 -0
- package/corpus/templates/slides-2/app/pages/DesignSystems.tsx +363 -0
- package/corpus/templates/slides-2/app/pages/Index.tsx +3254 -0
- package/corpus/templates/slides-2/app/pages/NotFound.tsx +33 -0
- package/corpus/templates/slides-2/app/pages/Presentation.tsx +120 -0
- package/corpus/templates/slides-2/app/pages/SharedPresentation.tsx +174 -0
- package/corpus/templates/slides-2/app/pages/SlideThemeDetail.tsx +227 -0
- package/corpus/templates/slides-2/app/pages/SlideThemes.tsx +155 -0
- package/corpus/templates/slides-2/app/pages/Slides2EditorPage.tsx +1618 -0
- package/corpus/templates/slides-2/app/pages/Slides2PresenterConsolePage.tsx +937 -0
- package/corpus/templates/slides-2/app/pages/Slides2PresenterPage.tsx +979 -0
- package/corpus/templates/slides-2/app/pages/Templates.tsx +32 -0
- package/corpus/templates/slides-2/app/root.tsx +391 -0
- package/corpus/templates/slides-2/app/routes/$.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/_index.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/access-request.approve.tsx +276 -0
- package/corpus/templates/slides-2/app/routes/agent.tsx +19 -0
- package/corpus/templates/slides-2/app/routes/chat.$threadId.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/chat.tsx +190 -0
- package/corpus/templates/slides-2/app/routes/deck.$id.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/deck.$id_.present.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/design-systems.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/slides-2/app/routes/extensions.$id.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/extensions._index.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/extensions.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/home-layout.tsx +31 -0
- package/corpus/templates/slides-2/app/routes/home.tsx +22 -0
- package/corpus/templates/slides-2/app/routes/p.$id.tsx +195 -0
- package/corpus/templates/slides-2/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/settings.tsx +131 -0
- package/corpus/templates/slides-2/app/routes/share.$token.tsx +137 -0
- package/corpus/templates/slides-2/app/routes/slide.tsx +209 -0
- package/corpus/templates/slides-2/app/routes/team.tsx +11 -0
- package/corpus/templates/slides-2/app/routes/templates.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/themes.$id.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/themes.tsx +1 -0
- package/corpus/templates/slides-2/app/routes.ts +24 -0
- package/corpus/templates/slides-2/app/vite-env.d.ts +24 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-find-and-switch-decks-from-the-presenter-console.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-meet-slides-2-create-and-refine-editable-slide-decks-with-an.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-pptx-image-export.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-visual-editor.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-apply-an-accessible-design-system-to-an-existing-deck-before.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-choose-a-template-or-start-a-new-presentation-from-the-slide.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-generate-decks-from-a-prompt-then-edit-slide-elements-direct.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-generate-presentation-decks-from-a-prompt-and-edit-every-sli.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-new-presentation-drafts-save-before-generation-starts-so-you.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-the-assistant-can-undo-redo-and-save-pending-edits-in-the-vi.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-agents-can-insert-duplicate-and-delete-canvas-objects-in-sou.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-browse-slide-themes.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-clicking-a-slide-preview-in-overview-selects-that-slide.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-create-decks-from-a-prompt-and-edit-slides-directly-on-the-c.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-creating-and-editing-decks-now-starts-with-the-tools-most-re.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-deleting-decks-revokes-public-links.md +7 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-escape-cancels-an-in-progress-slide-drag-without-losing-earl.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-import-failures-now-show-clear-localized-descriptions-instea.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-presenter-controls-stay-responsive-when-moving-over-the-slid.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-presenter-notes-stay-private-from-viewers-and-commenters.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-preview-generated-slides-in-chat.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-remote-image-previews-accept-supported-raster-formats.md +6 -0
- 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
- package/corpus/templates/slides-2/changelog/2026-10-19-slide-generation-explains-when-react-effect-hooks-cannot-run.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-the-editor-highlights-hovered-objects-and-keeps-image-replac.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-the-slide-editor-uses-the-shared-agent-native-controls.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-deck-editing-controls-match-the-workspace.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-google-slides-imports-now-report-missing-image-data-instead-.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-imports-and-previews-handle-large-content-safely.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-public-deck-pages-can-export-source-backed-slides-to-pdf.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-saved-slide-images-stay-available.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-scope-global-media-picks-to-assets-the-current-deck-can-reso.md +6 -0
- package/corpus/templates/slides-2/components.json +20 -0
- package/corpus/templates/slides-2/drizzle.config.ts +3 -0
- package/corpus/templates/slides-2/learnings.defaults.md +5 -0
- package/corpus/templates/slides-2/netlify.toml +24 -0
- package/corpus/templates/slides-2/package.json +147 -0
- package/corpus/templates/slides-2/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/slides-2/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/slides-2/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/slides-2/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/slides-2/public/assets/builder-logo-white.svg +15 -0
- package/corpus/templates/slides-2/public/assets/generated/preview.html +61 -0
- package/corpus/templates/slides-2/public/assets/intuit-logo-white.svg +6 -0
- package/corpus/templates/slides-2/public/assets/walmart-logo-white.svg +6 -0
- package/corpus/templates/slides-2/public/chatgpt-plugin-icon.svg +7 -0
- package/corpus/templates/slides-2/public/favicon.svg +1 -0
- package/corpus/templates/slides-2/public/icon-180.svg +1 -0
- package/corpus/templates/slides-2/public/icon-192.svg +1 -0
- package/corpus/templates/slides-2/public/icon-512.svg +1 -0
- package/corpus/templates/slides-2/public/manifest.json +20 -0
- package/corpus/templates/slides-2/public/placeholder.svg +1 -0
- package/corpus/templates/slides-2/public/robots.txt +14 -0
- package/corpus/templates/slides-2/public/visual-edit-structure-proof.html +99 -0
- package/corpus/templates/slides-2/react-router.config.ts +7 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/README.md +499 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/authoring-fuzz.ts +9517 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/baseline.json +16427 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/dev-server-url.ts +10 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/lib/in-page.ts +1975 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/lib/metrics.ts +1401 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/retry-infra.ts +7 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run-options.ts +21 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run-outcomes.ts +127 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run.ts +8451 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/README.md +116 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout-lib.ts +241 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout.ts +30 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/diff.ts +222 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/export.ts +765 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/fixtures/agent-dark-deck.json +48 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/generate-calibration.ts +765 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/google-export.ts +137 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/google-layout.ts +82 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/resolve-pkg.ts +29 -0
- package/corpus/templates/slides-2/scripts/migrate-production.ts +22 -0
- package/corpus/templates/slides-2/server/db/index.ts +73 -0
- package/corpus/templates/slides-2/server/db/schema.ts +189 -0
- package/corpus/templates/slides-2/server/handlers/assets-url.ts +13 -0
- package/corpus/templates/slides-2/server/handlers/assets.ts +3217 -0
- package/corpus/templates/slides-2/server/handlers/decks.ts +185 -0
- package/corpus/templates/slides-2/server/handlers/demo.ts +9 -0
- package/corpus/templates/slides-2/server/handlers/design-systems.ts +219 -0
- package/corpus/templates/slides-2/server/handlers/google-docs-auth.ts +165 -0
- package/corpus/templates/slides-2/server/handlers/image-gen.ts +153 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/gemini.ts +209 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/index.ts +61 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/openai.ts +288 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/types.ts +35 -0
- package/corpus/templates/slides-2/server/handlers/import/docx-parser.ts +31 -0
- package/corpus/templates/slides-2/server/handlers/import/html-converter.ts +1534 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-fidelity-parser.ts +1039 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-sidecar-reader.ts +81 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-style-digest.ts +187 -0
- package/corpus/templates/slides-2/server/handlers/import/pptx-assets.ts +155 -0
- package/corpus/templates/slides-2/server/handlers/import/pptx-parser.ts +57 -0
- package/corpus/templates/slides-2/server/handlers/request-auth-context.ts +108 -0
- package/corpus/templates/slides-2/server/handlers/share.ts +52 -0
- package/corpus/templates/slides-2/server/handlers/uploads-chunked.ts +1066 -0
- package/corpus/templates/slides-2/server/handlers/uploads.ts +457 -0
- package/corpus/templates/slides-2/server/lib/access-request-email.ts +66 -0
- package/corpus/templates/slides-2/server/lib/assets-image-delegation.ts +331 -0
- package/corpus/templates/slides-2/server/lib/bounded-multipart.ts +49 -0
- package/corpus/templates/slides-2/server/lib/builder-design-system-proxy.ts +122 -0
- package/corpus/templates/slides-2/server/lib/chat-attachments.ts +425 -0
- package/corpus/templates/slides-2/server/lib/chatgpt-directory-tools.ts +246 -0
- package/corpus/templates/slides-2/server/lib/chunked-upload-session.ts +195 -0
- package/corpus/templates/slides-2/server/lib/comment-notifications.ts +184 -0
- package/corpus/templates/slides-2/server/lib/deck-access-requests.ts +102 -0
- package/corpus/templates/slides-2/server/lib/deck-asset-scope.ts +150 -0
- package/corpus/templates/slides-2/server/lib/deck-export-tracking.ts +119 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-case-study.ts +154 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-company.ts +160 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-pitch.ts +151 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-quarterly.ts +264 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-shared.ts +35 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-update.ts +188 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-workshop.ts +196 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-keynote.ts +131 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-lesson.ts +209 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-manifesto.ts +149 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-portfolio.ts +144 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-research.ts +221 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-roadmap.ts +264 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-shared.ts +44 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/group-a.ts +16 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/group-b.ts +16 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/legacy.ts +567 -0
- package/corpus/templates/slides-2/server/lib/deck-templates.ts +60 -0
- package/corpus/templates/slides-2/server/lib/deck-versions.ts +233 -0
- package/corpus/templates/slides-2/server/lib/design-system-workflows.ts +22 -0
- package/corpus/templates/slides-2/server/lib/emails.ts +84 -0
- package/corpus/templates/slides-2/server/lib/env-config.ts +15 -0
- package/corpus/templates/slides-2/server/lib/fetch-remote-image.ts +245 -0
- package/corpus/templates/slides-2/server/lib/generation-completion.ts +278 -0
- package/corpus/templates/slides-2/server/lib/google-docs-access.ts +51 -0
- package/corpus/templates/slides-2/server/lib/google-docs-error.ts +54 -0
- package/corpus/templates/slides-2/server/lib/google-docs-oauth.ts +422 -0
- package/corpus/templates/slides-2/server/lib/google-fonts.ts +509 -0
- package/corpus/templates/slides-2/server/lib/google-oauth-preflight.ts +119 -0
- package/corpus/templates/slides-2/server/lib/google-slides-export-availability.ts +55 -0
- package/corpus/templates/slides-2/server/lib/image-proxy-response.ts +16 -0
- package/corpus/templates/slides-2/server/lib/image-proxy-url.ts +155 -0
- package/corpus/templates/slides-2/server/lib/import-asset-storage.ts +214 -0
- package/corpus/templates/slides-2/server/lib/imported-asset-batch.ts +218 -0
- package/corpus/templates/slides-2/server/lib/legacy-slide-source.ts +692 -0
- package/corpus/templates/slides-2/server/lib/media-search-providers.ts +216 -0
- package/corpus/templates/slides-2/server/lib/native-creative-context.ts +295 -0
- package/corpus/templates/slides-2/server/lib/pdf-parse-setup.ts +115 -0
- package/corpus/templates/slides-2/server/lib/provider-api.ts +57 -0
- package/corpus/templates/slides-2/server/lib/request-wait-until.ts +30 -0
- package/corpus/templates/slides-2/server/lib/shared-deck.ts +29 -0
- package/corpus/templates/slides-2/server/lib/slide-asset-references.ts +309 -0
- package/corpus/templates/slides-2/server/lib/slide-content-patch.ts +1004 -0
- package/corpus/templates/slides-2/server/lib/slide-hygiene.ts +731 -0
- package/corpus/templates/slides-2/server/lib/slide-image-insertion.ts +136 -0
- package/corpus/templates/slides-2/server/lib/slide-reveal-issues.ts +41 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/babel-walk.ts +117 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/batch-edit.ts +152 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/edit-ops.ts +1478 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/image-target.ts +128 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/text-diff.ts +23 -0
- package/corpus/templates/slides-2/server/lib/slide-source-limits.ts +9 -0
- package/corpus/templates/slides-2/server/lib/slide-source.ts +1786 -0
- package/corpus/templates/slides-2/server/lib/slide-theme-demo-sources.ts +2106 -0
- package/corpus/templates/slides-2/server/lib/slide-themes.ts +2174 -0
- package/corpus/templates/slides-2/server/lib/slide-worker-runtime.ts +1995 -0
- package/corpus/templates/slides-2/server/lib/slides-tracking.ts +73 -0
- package/corpus/templates/slides-2/server/lib/source-import.ts +213 -0
- package/corpus/templates/slides-2/server/lib/svgl.ts +364 -0
- package/corpus/templates/slides-2/server/lib/tenant-files.ts +179 -0
- package/corpus/templates/slides-2/server/lib/upload-storage-status.ts +9 -0
- package/corpus/templates/slides-2/server/lib/uploaded-asset-cleanup-outbox.ts +521 -0
- package/corpus/templates/slides-2/server/lib/uploaded-asset-object-lifecycle.ts +404 -0
- package/corpus/templates/slides-2/server/lib/uploaded-fonts.ts +696 -0
- package/corpus/templates/slides-2/server/lib/uploaded-reference-storage.ts +77 -0
- package/corpus/templates/slides-2/server/lib/validate-slide-animations.ts +341 -0
- package/corpus/templates/slides-2/server/middleware/auth.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/_dev-upload-stub.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/agent-chat.ts +402 -0
- package/corpus/templates/slides-2/server/plugins/auth.ts +31 -0
- package/corpus/templates/slides-2/server/plugins/collab.ts +30 -0
- package/corpus/templates/slides-2/server/plugins/config.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/core-routes.ts +30 -0
- package/corpus/templates/slides-2/server/plugins/creative-context.ts +187 -0
- package/corpus/templates/slides-2/server/plugins/db.ts +462 -0
- package/corpus/templates/slides-2/server/plugins/feature-flags.ts +5 -0
- package/corpus/templates/slides-2/server/plugins/labs.ts +8 -0
- package/corpus/templates/slides-2/server/plugins/orphaned-asset-cleanup.ts +17 -0
- package/corpus/templates/slides-2/server/plugins/otel.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/slides-2/server/register-secrets.ts +209 -0
- package/corpus/templates/slides-2/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/slides-2/server/routes/[...page].head.ts +1 -0
- package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/auth-url.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/callback.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/auth-url.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/callback.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/upload-video.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/upload.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/video-uploads.delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/deck-agent-context.json.get.ts +105 -0
- package/corpus/templates/slides-2/server/routes/api/decks/events.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/demo.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/exports/[filename].get.ts +221 -0
- package/corpus/templates/slides-2/server/routes/api/exports/google-slides.post.ts +240 -0
- package/corpus/templates/slides-2/server/routes/api/exports/html.post.ts +67 -0
- package/corpus/templates/slides-2/server/routes/api/exports/pptx.post.ts +100 -0
- package/corpus/templates/slides-2/server/routes/api/gen-preview/[...].get.ts +24 -0
- package/corpus/templates/slides-2/server/routes/api/generated/[...].get.ts +24 -0
- package/corpus/templates/slides-2/server/routes/api/image-proxy.get.ts +518 -0
- package/corpus/templates/slides-2/server/routes/api/import-assets/[token].get.ts +70 -0
- package/corpus/templates/slides-2/server/routes/api/preview-images.get.ts +20 -0
- package/corpus/templates/slides-2/server/routes/api/share/[token].get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/chunk.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/status.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId].delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/start.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads.delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads.post.ts +1 -0
- package/corpus/templates/slides-2/server/workspace-defaults.ts +196 -0
- package/corpus/templates/slides-2/shared/action-ui.ts +147 -0
- package/corpus/templates/slides-2/shared/agent-readable.ts +2 -0
- package/corpus/templates/slides-2/shared/api.ts +406 -0
- package/corpus/templates/slides-2/shared/app-state-tabs.ts +30 -0
- package/corpus/templates/slides-2/shared/app-storage.ts +9 -0
- package/corpus/templates/slides-2/shared/aspect-ratios.ts +49 -0
- package/corpus/templates/slides-2/shared/blank-slide.ts +179 -0
- package/corpus/templates/slides-2/shared/client-compatibility.ts +2 -0
- package/corpus/templates/slides-2/shared/contrast-audit.ts +255 -0
- package/corpus/templates/slides-2/shared/deck-access.ts +26 -0
- package/corpus/templates/slides-2/shared/deck-app-scope.ts +14 -0
- package/corpus/templates/slides-2/shared/deck-content.ts +37 -0
- package/corpus/templates/slides-2/shared/deck-history-control.ts +79 -0
- package/corpus/templates/slides-2/shared/deck-scope.ts +5 -0
- package/corpus/templates/slides-2/shared/deck-title.ts +199 -0
- package/corpus/templates/slides-2/shared/deck-write.ts +61 -0
- package/corpus/templates/slides-2/shared/design-flags.ts +7 -0
- package/corpus/templates/slides-2/shared/design-system-validation.ts +88 -0
- package/corpus/templates/slides-2/shared/editor-control.ts +120 -0
- package/corpus/templates/slides-2/shared/generation-timing.ts +19 -0
- package/corpus/templates/slides-2/shared/google-docs.ts +69 -0
- package/corpus/templates/slides-2/shared/labs.ts +10 -0
- package/corpus/templates/slides-2/shared/overview-navigation.ts +34 -0
- package/corpus/templates/slides-2/shared/ownership.ts +6 -0
- package/corpus/templates/slides-2/shared/pdf-sidecar.ts +130 -0
- package/corpus/templates/slides-2/shared/presenter-control.ts +111 -0
- package/corpus/templates/slides-2/shared/representative-slide.ts +89 -0
- package/corpus/templates/slides-2/shared/slide-background.ts +30 -0
- package/corpus/templates/slides-2/shared/slide-comment-anchor.ts +117 -0
- package/corpus/templates/slides-2/shared/slide-comment-reactions.ts +47 -0
- package/corpus/templates/slides-2/shared/slide-design-tokens.ts +92 -0
- package/corpus/templates/slides-2/shared/slide-fit.ts +78 -0
- package/corpus/templates/slides-2/shared/slide-ids.ts +133 -0
- package/corpus/templates/slides-2/shared/slide-number.ts +124 -0
- package/corpus/templates/slides-2/shared/slide-object-structure.ts +790 -0
- package/corpus/templates/slides-2/shared/slide-text-range-selection.ts +50 -0
- package/corpus/templates/slides-2/shared/slide-transitions.ts +70 -0
- package/corpus/templates/slides-2/shared/slides-2-transition.ts +194 -0
- package/corpus/templates/slides-2/shared/slides-user-prefs.ts +22 -0
- package/corpus/templates/slides-2/shared/source-import-errors.ts +12 -0
- package/corpus/templates/slides-2/shared/source-runtime-export.ts +76 -0
- package/corpus/templates/slides-2/shared/upload-types.ts +41 -0
- package/corpus/templates/slides-2/ssr-entry.ts +11 -0
- package/corpus/templates/slides-2/tsconfig.json +27 -0
- package/corpus/templates/slides-2/vite.config.ts +77 -0
- package/corpus/templates/slides-2/vitest.config.ts +28 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +1 -1
- package/package.json +1 -1
- package/corpus/templates/design/.agents/skills/shader-fills/SKILL.md +0 -182
- package/corpus/templates/design/actions/apply-shader-fill.ts +0 -450
- package/corpus/templates/design/actions/apply-shader.ts +0 -257
- package/corpus/templates/design/actions/preview-shader-fill.ts +0 -157
- package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +0 -1144
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +0 -450
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.stories.tsx +0 -71
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +0 -555
- package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +0 -105
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +0 -433
- package/corpus/templates/design/app/components/design/inspector/color-picker-shader-pane.tsx +0 -648
- package/corpus/templates/design/shared/shader-fill.ts +0 -174
- package/corpus/templates/design/shared/shader-presets.ts +0 -1523
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { planEffectGraph } from "../../../../shared/effect-graph";
|
|
2
|
+
import type { EffectMeshSpec } from "../../../../shared/effect-graph";
|
|
2
3
|
import {
|
|
4
|
+
nativeEffectUniformFloats,
|
|
3
5
|
packNativeProperties,
|
|
4
6
|
type EffectDefinition,
|
|
5
7
|
type EffectInstance,
|
|
6
8
|
} from "../../../../shared/native-effects";
|
|
7
9
|
import { resolveNativeParameterAnimation } from "../../../../shared/native-parameter-animation";
|
|
8
10
|
import { packNativeUniformClock } from "../../../../shared/native-uniform-timing";
|
|
11
|
+
import {
|
|
12
|
+
acquireNativeMeshGrid,
|
|
13
|
+
nativeMeshGridBytes,
|
|
14
|
+
type NativeMeshGridLease,
|
|
15
|
+
} from "./native-mesh-grid";
|
|
9
16
|
import {
|
|
10
17
|
NativePackedUniformArena,
|
|
11
18
|
type NativePackedUniformFrame,
|
|
@@ -16,6 +23,10 @@ import type {
|
|
|
16
23
|
NativeWorkerEffectTarget,
|
|
17
24
|
NativeWorkerScene,
|
|
18
25
|
} from "./native-worker-protocol";
|
|
26
|
+
import {
|
|
27
|
+
NATIVE_WORKER_MAX_DIMENSION,
|
|
28
|
+
NATIVE_WORKER_MAX_PIXELS,
|
|
29
|
+
} from "./native-worker-protocol";
|
|
19
30
|
|
|
20
31
|
declare const GPUTextureUsage: Readonly<{
|
|
21
32
|
COPY_SRC: number;
|
|
@@ -26,8 +37,6 @@ declare const GPUTextureUsage: Readonly<{
|
|
|
26
37
|
declare const GPUBufferUsage: Readonly<{ UNIFORM: number; COPY_DST: number }>;
|
|
27
38
|
declare const GPUShaderStage: Readonly<{ VERTEX: number; FRAGMENT: number }>;
|
|
28
39
|
|
|
29
|
-
const MAX_DIMENSION = 4096;
|
|
30
|
-
const MAX_PIXELS = 8_388_608;
|
|
31
40
|
const MAX_RESOURCE_BYTES = 402_653_184;
|
|
32
41
|
const MAX_EFFECT_BYTES = 134_217_728;
|
|
33
42
|
|
|
@@ -61,8 +70,10 @@ type BindingResource = {
|
|
|
61
70
|
|
|
62
71
|
export type NativeWorkerGpuBank = {
|
|
63
72
|
textures: Map<string, TextureResource>;
|
|
73
|
+
depths: Map<string, TextureResource>;
|
|
64
74
|
bindings: Map<string, BindingResource>;
|
|
65
75
|
usedTextures: Set<string>;
|
|
76
|
+
usedDepths: Set<string>;
|
|
66
77
|
usedBindings: Set<string>;
|
|
67
78
|
sceneTexture: GPUTexture | null;
|
|
68
79
|
generation: number;
|
|
@@ -72,6 +83,47 @@ export type NativeWorkerGpuBank = {
|
|
|
72
83
|
pixelRatio: number;
|
|
73
84
|
};
|
|
74
85
|
|
|
86
|
+
export type NativeWorkerGpuFlightLease = {
|
|
87
|
+
readonly bank: NativeWorkerGpuBank;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type NativeWorkerGpuFlightAcquisition =
|
|
91
|
+
| { status: "acquired"; lease: NativeWorkerGpuFlightLease }
|
|
92
|
+
| {
|
|
93
|
+
status: "capacity";
|
|
94
|
+
reason: "flight-limit" | "memory-budget" | "incompatible-scene";
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export class NativeWorkerGpuFlightCapacityError extends Error {
|
|
98
|
+
readonly reason = "memory-budget" as const;
|
|
99
|
+
|
|
100
|
+
constructor(message: string) {
|
|
101
|
+
super(message);
|
|
102
|
+
this.name = "NativeWorkerGpuFlightCapacityError";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
type NativeWorkerGpuFlightSlot = {
|
|
107
|
+
bank: NativeWorkerGpuBank;
|
|
108
|
+
uniformBuffer: GPUBuffer | null;
|
|
109
|
+
uniformArena: NativePackedUniformArena<GPUBuffer> | null;
|
|
110
|
+
uniformFrame: NativePackedUniformFrame | null;
|
|
111
|
+
uniformUploaded: boolean;
|
|
112
|
+
uniformCount: number;
|
|
113
|
+
uniformOccurrences: Map<string, number>;
|
|
114
|
+
pendingFinalIndex: number;
|
|
115
|
+
reservedBytes: number;
|
|
116
|
+
uniformReservationBytes: number;
|
|
117
|
+
finalReservationBytes: number;
|
|
118
|
+
workReservationBytes: number;
|
|
119
|
+
activeLease: NativeWorkerGpuFlightLease | null;
|
|
120
|
+
submitted: boolean;
|
|
121
|
+
compositionSignature: string | null;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
pixelRatio: number;
|
|
125
|
+
};
|
|
126
|
+
|
|
75
127
|
export type NativeWorkerGpuFacade = {
|
|
76
128
|
texture(
|
|
77
129
|
bank: NativeWorkerGpuBank,
|
|
@@ -86,6 +138,7 @@ export type NativeWorkerGpuFacade = {
|
|
|
86
138
|
blend: boolean,
|
|
87
139
|
textureCount: number,
|
|
88
140
|
placement?: EffectInstance["placement"],
|
|
141
|
+
mesh?: boolean,
|
|
89
142
|
): Promise<GPURenderPipeline>;
|
|
90
143
|
bind(
|
|
91
144
|
bank: NativeWorkerGpuBank,
|
|
@@ -103,8 +156,10 @@ export type NativeWorkerGpuFacade = {
|
|
|
103
156
|
function createBank(): NativeWorkerGpuBank {
|
|
104
157
|
return {
|
|
105
158
|
textures: new Map(),
|
|
159
|
+
depths: new Map(),
|
|
106
160
|
bindings: new Map(),
|
|
107
161
|
usedTextures: new Set(),
|
|
162
|
+
usedDepths: new Set(),
|
|
108
163
|
usedBindings: new Set(),
|
|
109
164
|
sceneTexture: null,
|
|
110
165
|
generation: -1,
|
|
@@ -115,15 +170,18 @@ function createBank(): NativeWorkerGpuBank {
|
|
|
115
170
|
};
|
|
116
171
|
}
|
|
117
172
|
|
|
118
|
-
function
|
|
173
|
+
export function nativeWorkerTextureSizeValid(
|
|
174
|
+
width: number,
|
|
175
|
+
height: number,
|
|
176
|
+
): boolean {
|
|
119
177
|
return (
|
|
120
178
|
Number.isSafeInteger(width) &&
|
|
121
179
|
Number.isSafeInteger(height) &&
|
|
122
180
|
width > 0 &&
|
|
123
181
|
height > 0 &&
|
|
124
|
-
width <=
|
|
125
|
-
height <=
|
|
126
|
-
width * height <=
|
|
182
|
+
width <= NATIVE_WORKER_MAX_DIMENSION &&
|
|
183
|
+
height <= NATIVE_WORKER_MAX_DIMENSION &&
|
|
184
|
+
width * height <= NATIVE_WORKER_MAX_PIXELS
|
|
127
185
|
);
|
|
128
186
|
}
|
|
129
187
|
|
|
@@ -139,21 +197,28 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
139
197
|
readonly canvasFormat: GPUTextureFormat;
|
|
140
198
|
readonly workingFormat: GPUTextureFormat = "rgba16float";
|
|
141
199
|
private presentedColorSpace: NativeWorkerScene["colorSpace"] = "srgb";
|
|
142
|
-
private finalTextures: [
|
|
143
|
-
null,
|
|
144
|
-
null,
|
|
145
|
-
|
|
146
|
-
|
|
200
|
+
private finalTextures: [
|
|
201
|
+
TextureResource | null,
|
|
202
|
+
TextureResource | null,
|
|
203
|
+
TextureResource | null,
|
|
204
|
+
] = [null, null, null];
|
|
205
|
+
private frontFinalIndex = 0;
|
|
206
|
+
private frontSlot: NativeWorkerGpuFlightSlot | null = null;
|
|
147
207
|
private allocatedBytes = 0;
|
|
148
208
|
private allocatedUniformBytes = 0;
|
|
209
|
+
private reservedBytes = 0;
|
|
149
210
|
private transientBytes = 0;
|
|
150
211
|
private sharedBudget: ((bytes: number, key: string) => void) | null = null;
|
|
151
|
-
private readonly
|
|
152
|
-
private
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
private readonly
|
|
212
|
+
private readonly flightSlots: NativeWorkerGpuFlightSlot[] = [];
|
|
213
|
+
private readonly leaseSlots = new WeakMap<
|
|
214
|
+
NativeWorkerGpuFlightLease,
|
|
215
|
+
NativeWorkerGpuFlightSlot
|
|
216
|
+
>();
|
|
217
|
+
private readonly bankSlots = new WeakMap<
|
|
218
|
+
NativeWorkerGpuBank,
|
|
219
|
+
NativeWorkerGpuFlightSlot
|
|
220
|
+
>();
|
|
221
|
+
private legacyLease: NativeWorkerGpuFlightLease | null = null;
|
|
157
222
|
private readonly pipelineCache = new Map<
|
|
158
223
|
string,
|
|
159
224
|
Map<string, GPURenderPipeline>
|
|
@@ -164,6 +229,19 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
164
229
|
number
|
|
165
230
|
>();
|
|
166
231
|
private readonly effectLayouts = new Map<number, GPUPipelineLayout>();
|
|
232
|
+
private readonly preparedPlans = new WeakMap<
|
|
233
|
+
EffectDefinition,
|
|
234
|
+
ReturnType<typeof planEffectGraph>
|
|
235
|
+
>();
|
|
236
|
+
private readonly preparedProperties = new WeakMap<
|
|
237
|
+
EffectInstance,
|
|
238
|
+
{
|
|
239
|
+
definition: EffectDefinition;
|
|
240
|
+
params: EffectInstance["params"];
|
|
241
|
+
packed: Float32Array;
|
|
242
|
+
}
|
|
243
|
+
>();
|
|
244
|
+
private readonly meshGrids = new Map<string, NativeMeshGridLease>();
|
|
167
245
|
private readonly assets = new Map<string, TextureResource>();
|
|
168
246
|
private white: GPUTexture;
|
|
169
247
|
private transparent: GPUTexture;
|
|
@@ -188,16 +266,77 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
188
266
|
minFilter: "nearest",
|
|
189
267
|
});
|
|
190
268
|
const uniformCapacity = 2_097_152;
|
|
191
|
-
|
|
269
|
+
const uniformBuffer = device.createBuffer({
|
|
192
270
|
size: uniformCapacity,
|
|
193
271
|
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
194
272
|
});
|
|
195
|
-
|
|
273
|
+
const slot: NativeWorkerGpuFlightSlot = {
|
|
274
|
+
bank: this.bank,
|
|
275
|
+
uniformBuffer,
|
|
276
|
+
uniformArena: this.createUniformArena(uniformCapacity, uniformBuffer),
|
|
277
|
+
uniformFrame: null,
|
|
278
|
+
uniformUploaded: false,
|
|
279
|
+
uniformCount: 0,
|
|
280
|
+
uniformOccurrences: new Map(),
|
|
281
|
+
pendingFinalIndex: 1,
|
|
282
|
+
reservedBytes: 0,
|
|
283
|
+
uniformReservationBytes: 0,
|
|
284
|
+
finalReservationBytes: 0,
|
|
285
|
+
workReservationBytes: 0,
|
|
286
|
+
activeLease: null,
|
|
287
|
+
submitted: false,
|
|
288
|
+
compositionSignature: null,
|
|
289
|
+
width: 0,
|
|
290
|
+
height: 0,
|
|
291
|
+
pixelRatio: 0,
|
|
292
|
+
};
|
|
293
|
+
this.flightSlots.push(slot);
|
|
294
|
+
this.bankSlots.set(this.bank, slot);
|
|
196
295
|
this.allocatedUniformBytes += uniformCapacity;
|
|
197
296
|
this.white = this.createSolid([255, 255, 255, 255]);
|
|
198
297
|
this.transparent = this.createSolid([0, 0, 0, 0]);
|
|
199
298
|
}
|
|
200
299
|
|
|
300
|
+
private get uniformArena(): NativePackedUniformArena<GPUBuffer> {
|
|
301
|
+
return this.flightSlots[0]!.uniformArena!;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
private set uniformArena(value: NativePackedUniformArena<GPUBuffer>) {
|
|
305
|
+
this.flightSlots[0]!.uniformArena = value;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
private get uniformBuffer(): GPUBuffer {
|
|
309
|
+
return this.flightSlots[0]!.uniformBuffer!;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
private get uniformFrame(): NativePackedUniformFrame | null {
|
|
313
|
+
return this.flightSlots[0]!.uniformFrame;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
private set uniformFrame(value: NativePackedUniformFrame | null) {
|
|
317
|
+
this.flightSlots[0]!.uniformFrame = value;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
private get uniformUploaded(): boolean {
|
|
321
|
+
return this.flightSlots[0]!.uniformUploaded;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
private set uniformUploaded(value: boolean) {
|
|
325
|
+
this.flightSlots[0]!.uniformUploaded = value;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
private get uniformCount(): number {
|
|
329
|
+
return this.flightSlots[0]!.uniformCount;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
private set uniformCount(value: number) {
|
|
333
|
+
this.flightSlots[0]!.uniformCount = value;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
private get uniformOccurrences(): Map<string, number> {
|
|
337
|
+
return this.flightSlots[0]!.uniformOccurrences;
|
|
338
|
+
}
|
|
339
|
+
|
|
201
340
|
static async create(
|
|
202
341
|
sceneId: string,
|
|
203
342
|
canvas: OffscreenCanvas,
|
|
@@ -239,45 +378,131 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
239
378
|
}
|
|
240
379
|
|
|
241
380
|
frontBank(): NativeWorkerGpuBank {
|
|
242
|
-
return this.bank;
|
|
381
|
+
return this.frontSlot?.bank ?? this.bank;
|
|
243
382
|
}
|
|
244
383
|
|
|
245
384
|
frontTexture(): GPUTexture | null {
|
|
246
|
-
return this.finalTextures[this.
|
|
385
|
+
return this.finalTextures[this.frontFinalIndex]?.texture ?? null;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
tryAcquireFlight(
|
|
389
|
+
scene: NativeWorkerScene,
|
|
390
|
+
compositionSignature: string | null,
|
|
391
|
+
): NativeWorkerGpuFlightAcquisition {
|
|
392
|
+
this.assertLive();
|
|
393
|
+
this.assertSceneSize(scene);
|
|
394
|
+
const active = this.flightSlots.filter((slot) => slot.activeLease);
|
|
395
|
+
if (active.length >= 2 || this.legacyLease)
|
|
396
|
+
return { status: "capacity", reason: "flight-limit" };
|
|
397
|
+
const slot =
|
|
398
|
+
this.flightSlots.find((candidate) => !candidate.activeLease) ?? null;
|
|
399
|
+
const reference = active[0];
|
|
400
|
+
if (
|
|
401
|
+
reference &&
|
|
402
|
+
(reference.compositionSignature !== compositionSignature ||
|
|
403
|
+
reference.width !== scene.width ||
|
|
404
|
+
reference.height !== scene.height ||
|
|
405
|
+
reference.pixelRatio !== scene.pixelRatio)
|
|
406
|
+
)
|
|
407
|
+
return { status: "capacity", reason: "incompatible-scene" };
|
|
408
|
+
|
|
409
|
+
const targetSlot = slot ?? this.createEmptyFlightSlot();
|
|
410
|
+
const pendingFinalIndex = this.findPendingFinalIndex(targetSlot);
|
|
411
|
+
if (pendingFinalIndex === null)
|
|
412
|
+
return { status: "capacity", reason: "flight-limit" };
|
|
413
|
+
targetSlot.pendingFinalIndex = pendingFinalIndex;
|
|
414
|
+
const isSecond = active.length > 0;
|
|
415
|
+
const uniformBytes = targetSlot.uniformBuffer ? 0 : 2_097_152;
|
|
416
|
+
const finalBytes = textureSize(
|
|
417
|
+
scene.width,
|
|
418
|
+
scene.height,
|
|
419
|
+
this.workingFormat,
|
|
420
|
+
);
|
|
421
|
+
const pendingFinal = this.finalTextures[targetSlot.pendingFinalIndex];
|
|
422
|
+
const finalReserve = Math.max(0, finalBytes - (pendingFinal?.bytes ?? 0));
|
|
423
|
+
const reusableWork =
|
|
424
|
+
targetSlot.compositionSignature === compositionSignature &&
|
|
425
|
+
targetSlot.width === scene.width &&
|
|
426
|
+
targetSlot.height === scene.height &&
|
|
427
|
+
targetSlot.pixelRatio === scene.pixelRatio;
|
|
428
|
+
const workReserve =
|
|
429
|
+
isSecond && !reusableWork && reference
|
|
430
|
+
? this.bankBytes(reference.bank)
|
|
431
|
+
: 0;
|
|
432
|
+
const reservation = uniformBytes + finalReserve + workReserve;
|
|
433
|
+
try {
|
|
434
|
+
this.prepareBank(targetSlot, scene, compositionSignature);
|
|
435
|
+
this.reserveFlightBytes(
|
|
436
|
+
targetSlot,
|
|
437
|
+
reservation,
|
|
438
|
+
"flight:reserve",
|
|
439
|
+
uniformBytes,
|
|
440
|
+
finalReserve,
|
|
441
|
+
workReserve,
|
|
442
|
+
);
|
|
443
|
+
if (!targetSlot.uniformBuffer) this.createFlightUniforms(targetSlot);
|
|
444
|
+
} catch (error) {
|
|
445
|
+
this.releaseFlightReservation(targetSlot);
|
|
446
|
+
if (
|
|
447
|
+
isSecond &&
|
|
448
|
+
error instanceof NativeWorkerGpuError &&
|
|
449
|
+
(error.code === "gpu-budget-exceeded" ||
|
|
450
|
+
error.code === "gpu-shared-budget-exceeded")
|
|
451
|
+
)
|
|
452
|
+
return { status: "capacity", reason: "memory-budget" };
|
|
453
|
+
throw error;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const lease: NativeWorkerGpuFlightLease = Object.freeze({
|
|
457
|
+
bank: targetSlot.bank,
|
|
458
|
+
});
|
|
459
|
+
targetSlot.activeLease = lease;
|
|
460
|
+
targetSlot.submitted = false;
|
|
461
|
+
this.leaseSlots.set(lease, targetSlot);
|
|
462
|
+
return { status: "acquired", lease };
|
|
247
463
|
}
|
|
248
464
|
|
|
249
|
-
beginFrame(): void {
|
|
250
|
-
|
|
465
|
+
beginFrame(lease?: NativeWorkerGpuFlightLease): void {
|
|
466
|
+
const slot = lease
|
|
467
|
+
? this.slotForLease(lease)
|
|
468
|
+
: this.legacySlotForRecording();
|
|
469
|
+
if (slot.uniformFrame)
|
|
251
470
|
throw new NativeWorkerGpuError(
|
|
252
471
|
"frame-pipeline-busy",
|
|
253
472
|
"A worker GPU frame is already recording.",
|
|
254
473
|
);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
474
|
+
slot.uniformFrame = slot.uniformArena!.beginFrame();
|
|
475
|
+
slot.uniformUploaded = false;
|
|
476
|
+
slot.uniformCount = 0;
|
|
477
|
+
slot.uniformOccurrences.clear();
|
|
259
478
|
}
|
|
260
479
|
|
|
261
|
-
uploadFrame(): void {
|
|
262
|
-
const
|
|
480
|
+
uploadFrame(lease?: NativeWorkerGpuFlightLease): void {
|
|
481
|
+
const slot = lease
|
|
482
|
+
? this.slotForLease(lease)
|
|
483
|
+
: this.legacySlotForRecording();
|
|
484
|
+
const frame = slot.uniformFrame;
|
|
263
485
|
if (!frame)
|
|
264
486
|
throw new NativeWorkerGpuError(
|
|
265
487
|
"uniform-frame-missing",
|
|
266
488
|
"The GPU frame has no packed uniforms.",
|
|
267
489
|
);
|
|
268
|
-
if (!
|
|
269
|
-
|
|
270
|
-
|
|
490
|
+
if (!slot.uniformCount) return;
|
|
491
|
+
slot.uniformArena!.upload(frame);
|
|
492
|
+
slot.uniformUploaded = true;
|
|
271
493
|
}
|
|
272
494
|
|
|
273
|
-
finishFrame(): void {
|
|
274
|
-
const
|
|
495
|
+
finishFrame(lease?: NativeWorkerGpuFlightLease): void {
|
|
496
|
+
const slot = lease
|
|
497
|
+
? this.slotForLease(lease)
|
|
498
|
+
: this.legacySlotForRecording();
|
|
499
|
+
const frame = slot.uniformFrame;
|
|
275
500
|
if (!frame) return;
|
|
276
|
-
if (
|
|
277
|
-
else
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
501
|
+
if (slot.uniformUploaded) slot.uniformArena!.finishFrame(frame);
|
|
502
|
+
else slot.uniformArena!.abortFrame(frame);
|
|
503
|
+
slot.uniformFrame = null;
|
|
504
|
+
slot.uniformUploaded = false;
|
|
505
|
+
slot.uniformCount = 0;
|
|
281
506
|
}
|
|
282
507
|
|
|
283
508
|
spareBank(
|
|
@@ -285,16 +510,39 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
285
510
|
compositionSignature: string | null = null,
|
|
286
511
|
): NativeWorkerGpuBank {
|
|
287
512
|
this.assertLive();
|
|
288
|
-
if (
|
|
289
|
-
!validSize(scene.width, scene.height) ||
|
|
290
|
-
!Number.isFinite(scene.pixelRatio) ||
|
|
291
|
-
scene.pixelRatio <= 0
|
|
292
|
-
)
|
|
513
|
+
if (this.legacyLease)
|
|
293
514
|
throw new NativeWorkerGpuError(
|
|
294
|
-
"
|
|
295
|
-
"The
|
|
515
|
+
"frame-pipeline-busy",
|
|
516
|
+
"The prior exclusive GPU operation has not released its lease.",
|
|
296
517
|
);
|
|
297
|
-
|
|
518
|
+
if (this.flightSlots.some((slot) => slot.activeLease))
|
|
519
|
+
throw new NativeWorkerGpuError(
|
|
520
|
+
"frame-pipeline-busy",
|
|
521
|
+
"An explicit worker flight is active during an exclusive GPU operation.",
|
|
522
|
+
);
|
|
523
|
+
this.assertSceneSize(scene);
|
|
524
|
+
const slot = this.frontSlot ?? this.flightSlots[0]!;
|
|
525
|
+
const pendingFinalIndex = this.findPendingFinalIndex(slot);
|
|
526
|
+
if (pendingFinalIndex === null)
|
|
527
|
+
throw new NativeWorkerGpuError(
|
|
528
|
+
"frame-pipeline-busy",
|
|
529
|
+
"No non-visible final texture is available for an exclusive GPU operation.",
|
|
530
|
+
);
|
|
531
|
+
slot.pendingFinalIndex = pendingFinalIndex;
|
|
532
|
+
this.prepareBank(slot, scene, compositionSignature);
|
|
533
|
+
this.legacyLease = Object.freeze({ bank: slot.bank });
|
|
534
|
+
this.leaseSlots.set(this.legacyLease, slot);
|
|
535
|
+
slot.activeLease = this.legacyLease;
|
|
536
|
+
slot.submitted = false;
|
|
537
|
+
return slot.bank;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
private prepareBank(
|
|
541
|
+
slot: NativeWorkerGpuFlightSlot,
|
|
542
|
+
scene: NativeWorkerScene,
|
|
543
|
+
compositionSignature: string | null,
|
|
544
|
+
): NativeWorkerGpuBank {
|
|
545
|
+
const bank = slot.bank;
|
|
298
546
|
const densityChanged = bank.pixelRatio !== scene.pixelRatio;
|
|
299
547
|
const resized =
|
|
300
548
|
bank.width !== scene.width ||
|
|
@@ -309,14 +557,17 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
309
557
|
bank.compositionSignature === compositionSignature &&
|
|
310
558
|
!densityChanged;
|
|
311
559
|
if (changed || resized) {
|
|
312
|
-
if (
|
|
560
|
+
if (slot.uniformFrame)
|
|
313
561
|
throw new NativeWorkerGpuError(
|
|
314
562
|
"frame-pipeline-busy",
|
|
315
563
|
"The GPU scene changed during an active packed frame.",
|
|
316
564
|
);
|
|
317
565
|
if (!reuseBindings) {
|
|
318
566
|
bank.bindings.clear();
|
|
319
|
-
|
|
567
|
+
slot.uniformArena = this.createUniformArena(
|
|
568
|
+
2_097_152,
|
|
569
|
+
slot.uniformBuffer!,
|
|
570
|
+
);
|
|
320
571
|
}
|
|
321
572
|
}
|
|
322
573
|
if (resized) {
|
|
@@ -329,33 +580,305 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
329
580
|
bank.generation = scene.generation;
|
|
330
581
|
bank.compositionSignature = compositionSignature;
|
|
331
582
|
bank.usedTextures.clear();
|
|
583
|
+
bank.usedDepths.clear();
|
|
332
584
|
bank.usedBindings.clear();
|
|
585
|
+
slot.compositionSignature = compositionSignature;
|
|
586
|
+
slot.width = scene.width;
|
|
587
|
+
slot.height = scene.height;
|
|
588
|
+
slot.pixelRatio = scene.pixelRatio;
|
|
333
589
|
return bank;
|
|
334
590
|
}
|
|
335
591
|
|
|
336
|
-
|
|
337
|
-
|
|
592
|
+
markFlightSubmitted(lease: NativeWorkerGpuFlightLease): void {
|
|
593
|
+
this.slotForLease(lease).submitted = true;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
releaseFlight(lease: NativeWorkerGpuFlightLease): void {
|
|
597
|
+
const slot = this.slotForLease(lease);
|
|
598
|
+
if (slot.uniformFrame)
|
|
599
|
+
throw new NativeWorkerGpuError(
|
|
600
|
+
"frame-pipeline-busy",
|
|
601
|
+
"A worker GPU flight cannot be released while recording uniforms.",
|
|
602
|
+
);
|
|
603
|
+
if (!slot.submitted) this.clearBank(slot.bank);
|
|
604
|
+
this.releaseFlightReservation(slot);
|
|
605
|
+
slot.activeLease = null;
|
|
606
|
+
slot.submitted = false;
|
|
607
|
+
if (this.legacyLease === lease) this.legacyLease = null;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
endLegacyFlight(): void {
|
|
611
|
+
const lease = this.legacyLease;
|
|
612
|
+
if (!lease) return;
|
|
613
|
+
this.slotForLease(lease).submitted = true;
|
|
614
|
+
this.releaseFlight(lease);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
private legacySlotForRecording(): NativeWorkerGpuFlightSlot {
|
|
618
|
+
if (this.legacyLease) return this.slotForLease(this.legacyLease);
|
|
619
|
+
if (this.flightSlots.some((slot) => slot.activeLease))
|
|
620
|
+
throw new NativeWorkerGpuError(
|
|
621
|
+
"frame-pipeline-busy",
|
|
622
|
+
"An exclusive GPU frame cannot overlap a worker flight.",
|
|
623
|
+
);
|
|
624
|
+
const slot = this.frontSlot ?? this.flightSlots[0]!;
|
|
625
|
+
const lease = Object.freeze({ bank: slot.bank });
|
|
626
|
+
this.legacyLease = lease;
|
|
627
|
+
slot.activeLease = lease;
|
|
628
|
+
slot.submitted = false;
|
|
629
|
+
this.leaseSlots.set(lease, slot);
|
|
630
|
+
return slot;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
private assertSceneSize(scene: NativeWorkerScene): void {
|
|
634
|
+
if (
|
|
635
|
+
!nativeWorkerTextureSizeValid(scene.width, scene.height) ||
|
|
636
|
+
!Number.isFinite(scene.pixelRatio) ||
|
|
637
|
+
scene.pixelRatio <= 0
|
|
638
|
+
)
|
|
639
|
+
throw new NativeWorkerGpuError(
|
|
640
|
+
"scene-size-invalid",
|
|
641
|
+
"The native worker scene has invalid full-resolution geometry.",
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
private createEmptyFlightSlot(): NativeWorkerGpuFlightSlot {
|
|
646
|
+
const slot: NativeWorkerGpuFlightSlot = {
|
|
647
|
+
bank: createBank(),
|
|
648
|
+
uniformBuffer: null,
|
|
649
|
+
uniformArena: null,
|
|
650
|
+
uniformFrame: null,
|
|
651
|
+
uniformUploaded: false,
|
|
652
|
+
uniformCount: 0,
|
|
653
|
+
uniformOccurrences: new Map(),
|
|
654
|
+
pendingFinalIndex: 2,
|
|
655
|
+
reservedBytes: 0,
|
|
656
|
+
uniformReservationBytes: 0,
|
|
657
|
+
finalReservationBytes: 0,
|
|
658
|
+
workReservationBytes: 0,
|
|
659
|
+
activeLease: null,
|
|
660
|
+
submitted: false,
|
|
661
|
+
compositionSignature: null,
|
|
662
|
+
width: 0,
|
|
663
|
+
height: 0,
|
|
664
|
+
pixelRatio: 0,
|
|
665
|
+
};
|
|
666
|
+
this.flightSlots.push(slot);
|
|
667
|
+
this.bankSlots.set(slot.bank, slot);
|
|
668
|
+
return slot;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
private createFlightUniforms(slot: NativeWorkerGpuFlightSlot): void {
|
|
672
|
+
const capacityBytes = 2_097_152;
|
|
673
|
+
const buffer = this.device.createBuffer({
|
|
674
|
+
size: capacityBytes,
|
|
675
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
676
|
+
});
|
|
677
|
+
let arena: NativePackedUniformArena<GPUBuffer>;
|
|
678
|
+
try {
|
|
679
|
+
arena = this.createUniformArena(capacityBytes, buffer);
|
|
680
|
+
} catch (error) {
|
|
681
|
+
buffer.destroy();
|
|
682
|
+
throw error;
|
|
683
|
+
}
|
|
684
|
+
slot.uniformBuffer = buffer;
|
|
685
|
+
slot.uniformArena = arena;
|
|
686
|
+
this.commitFlightReservation(slot, capacityBytes, "uniform");
|
|
687
|
+
this.allocatedUniformBytes += capacityBytes;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
private reserveFlightBytes(
|
|
691
|
+
slot: NativeWorkerGpuFlightSlot,
|
|
692
|
+
bytes: number,
|
|
693
|
+
key: string,
|
|
694
|
+
uniformBytes: number,
|
|
695
|
+
finalBytes: number,
|
|
696
|
+
workBytes: number,
|
|
697
|
+
): void {
|
|
698
|
+
if (bytes <= 0) return;
|
|
699
|
+
if (this.resourceBytes() + bytes > MAX_RESOURCE_BYTES)
|
|
700
|
+
throw this.budgetError(bytes, key);
|
|
701
|
+
this.sharedBudget?.(bytes, key);
|
|
702
|
+
slot.reservedBytes += bytes;
|
|
703
|
+
slot.uniformReservationBytes += uniformBytes;
|
|
704
|
+
slot.finalReservationBytes += finalBytes;
|
|
705
|
+
slot.workReservationBytes += workBytes;
|
|
706
|
+
this.reservedBytes += bytes;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
private findPendingFinalIndex(
|
|
710
|
+
slot: NativeWorkerGpuFlightSlot,
|
|
711
|
+
): number | null {
|
|
712
|
+
const occupied = new Set<number>();
|
|
713
|
+
if (this.finalTextures[this.frontFinalIndex])
|
|
714
|
+
occupied.add(this.frontFinalIndex);
|
|
715
|
+
for (const candidate of this.flightSlots)
|
|
716
|
+
if (candidate !== slot && candidate.activeLease)
|
|
717
|
+
occupied.add(candidate.pendingFinalIndex);
|
|
718
|
+
for (let index = 0; index < this.finalTextures.length; index++)
|
|
719
|
+
if (!occupied.has(index)) return index;
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
private commitFlightReservation(
|
|
724
|
+
slot: NativeWorkerGpuFlightSlot,
|
|
725
|
+
bytes: number,
|
|
726
|
+
category: "uniform" | "final" | "work",
|
|
727
|
+
): void {
|
|
728
|
+
const categoryKey = `${category}ReservationBytes` as const;
|
|
729
|
+
const committed = Math.min(bytes, slot[categoryKey]);
|
|
730
|
+
slot[categoryKey] -= committed;
|
|
731
|
+
slot.reservedBytes -= committed;
|
|
732
|
+
this.reservedBytes -= committed;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
private releaseFlightReservation(slot: NativeWorkerGpuFlightSlot): void {
|
|
736
|
+
this.reservedBytes -= slot.reservedBytes;
|
|
737
|
+
slot.reservedBytes = 0;
|
|
738
|
+
slot.uniformReservationBytes = 0;
|
|
739
|
+
slot.finalReservationBytes = 0;
|
|
740
|
+
slot.workReservationBytes = 0;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
private bankBytes(bank: NativeWorkerGpuBank): number {
|
|
744
|
+
return [...bank.textures.values(), ...bank.depths.values()].reduce(
|
|
745
|
+
(total, resource) => total + resource.bytes,
|
|
746
|
+
0,
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
private slotForLease(
|
|
751
|
+
lease: NativeWorkerGpuFlightLease,
|
|
752
|
+
): NativeWorkerGpuFlightSlot {
|
|
753
|
+
const slot = this.leaseSlots.get(lease);
|
|
754
|
+
if (!slot || slot.activeLease !== lease)
|
|
755
|
+
throw new NativeWorkerGpuError(
|
|
756
|
+
"flight-lease-invalid",
|
|
757
|
+
"The GPU flight lease is no longer active.",
|
|
758
|
+
);
|
|
759
|
+
return slot;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
private slotForBank(bank: NativeWorkerGpuBank): NativeWorkerGpuFlightSlot {
|
|
763
|
+
const slot = this.bankSlots.get(bank);
|
|
764
|
+
if (!slot)
|
|
765
|
+
throw new NativeWorkerGpuError(
|
|
766
|
+
"flight-bank-invalid",
|
|
767
|
+
"The GPU work bank does not belong to this scene.",
|
|
768
|
+
);
|
|
769
|
+
return slot;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
private capacityError(slot: NativeWorkerGpuFlightSlot): Error | null {
|
|
773
|
+
return this.flightSlots.indexOf(slot) > 0 &&
|
|
774
|
+
slot.activeLease !== null &&
|
|
775
|
+
!slot.submitted
|
|
776
|
+
? new NativeWorkerGpuFlightCapacityError(
|
|
777
|
+
"The second native worker flight exceeded the reserved GPU budget.",
|
|
778
|
+
)
|
|
779
|
+
: null;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
trimWork(target: NativeWorkerGpuBank | NativeWorkerGpuFlightLease): void {
|
|
783
|
+
const isLease = !this.bankSlots.has(target as NativeWorkerGpuBank);
|
|
784
|
+
const slot = isLease
|
|
785
|
+
? this.slotForLease(target as NativeWorkerGpuFlightLease)
|
|
786
|
+
: this.slotForBank(target as NativeWorkerGpuBank);
|
|
787
|
+
if (slot.uniformFrame)
|
|
788
|
+
throw new NativeWorkerGpuError(
|
|
789
|
+
"frame-pipeline-busy",
|
|
790
|
+
"GPU work must finish before resource retirement.",
|
|
791
|
+
);
|
|
792
|
+
const bank = slot.bank;
|
|
793
|
+
this.trimBank(bank);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// The caller must await the GPU submission fence before retiring encoded textures.
|
|
797
|
+
trimWorkExcept(
|
|
798
|
+
target: NativeWorkerGpuBank | NativeWorkerGpuFlightLease,
|
|
799
|
+
retained: GPUTexture | null,
|
|
800
|
+
): void {
|
|
801
|
+
const isLease = !this.bankSlots.has(target as NativeWorkerGpuBank);
|
|
802
|
+
const slot = isLease
|
|
803
|
+
? this.slotForLease(target as NativeWorkerGpuFlightLease)
|
|
804
|
+
: this.slotForBank(target as NativeWorkerGpuBank);
|
|
805
|
+
if (slot.activeLease && slot.activeLease !== this.legacyLease)
|
|
806
|
+
throw new NativeWorkerGpuError(
|
|
807
|
+
"frame-pipeline-busy",
|
|
808
|
+
"Work cannot be retired while an explicit worker flight owns the bank.",
|
|
809
|
+
);
|
|
810
|
+
if (slot.uniformFrame)
|
|
338
811
|
throw new NativeWorkerGpuError(
|
|
339
812
|
"frame-pipeline-busy",
|
|
340
813
|
"GPU work must finish before resource retirement.",
|
|
341
814
|
);
|
|
815
|
+
const bank = slot.bank;
|
|
816
|
+
bank.usedTextures.clear();
|
|
817
|
+
for (const [key, resource] of bank.textures)
|
|
818
|
+
if (resource.texture === retained) bank.usedTextures.add(key);
|
|
819
|
+
bank.usedDepths.clear();
|
|
820
|
+
bank.usedBindings.clear();
|
|
821
|
+
this.trimBank(bank);
|
|
822
|
+
if (!retained) bank.sceneTexture = null;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
private trimBank(bank: NativeWorkerGpuBank): void {
|
|
342
826
|
for (const [key, resource] of bank.textures) {
|
|
343
827
|
if (bank.usedTextures.has(key)) continue;
|
|
344
828
|
resource.texture.destroy();
|
|
345
829
|
this.allocatedBytes -= resource.bytes;
|
|
346
830
|
bank.textures.delete(key);
|
|
347
831
|
}
|
|
832
|
+
for (const [key, resource] of bank.depths) {
|
|
833
|
+
if (bank.usedDepths.has(key)) continue;
|
|
834
|
+
resource.texture.destroy();
|
|
835
|
+
this.allocatedBytes -= resource.bytes;
|
|
836
|
+
bank.depths.delete(key);
|
|
837
|
+
}
|
|
348
838
|
for (const key of bank.bindings.keys())
|
|
349
839
|
if (!bank.usedBindings.has(key)) bank.bindings.delete(key);
|
|
350
840
|
}
|
|
351
841
|
|
|
352
842
|
stageFinal(
|
|
843
|
+
lease: NativeWorkerGpuFlightLease,
|
|
353
844
|
scene: NativeWorkerScene,
|
|
354
845
|
sceneTexture: GPUTexture,
|
|
355
846
|
encoder: GPUCommandEncoder,
|
|
847
|
+
): GPUTexture;
|
|
848
|
+
stageFinal(
|
|
849
|
+
scene: NativeWorkerScene,
|
|
850
|
+
sceneTexture: GPUTexture,
|
|
851
|
+
encoder: GPUCommandEncoder,
|
|
852
|
+
): GPUTexture;
|
|
853
|
+
stageFinal(
|
|
854
|
+
leaseOrScene: NativeWorkerGpuFlightLease | NativeWorkerScene,
|
|
855
|
+
sceneOrTexture: NativeWorkerScene | GPUTexture,
|
|
856
|
+
textureOrEncoder: GPUTexture | GPUCommandEncoder,
|
|
857
|
+
maybeEncoder?: GPUCommandEncoder,
|
|
356
858
|
): GPUTexture {
|
|
357
859
|
this.assertLive();
|
|
358
|
-
const
|
|
860
|
+
const explicitLease = this.leaseSlots.has(
|
|
861
|
+
leaseOrScene as NativeWorkerGpuFlightLease,
|
|
862
|
+
);
|
|
863
|
+
const lease = explicitLease
|
|
864
|
+
? (leaseOrScene as NativeWorkerGpuFlightLease)
|
|
865
|
+
: this.legacyLease;
|
|
866
|
+
if (!lease)
|
|
867
|
+
throw new NativeWorkerGpuError(
|
|
868
|
+
"flight-lease-invalid",
|
|
869
|
+
"Final textures require an active GPU flight lease.",
|
|
870
|
+
);
|
|
871
|
+
const slot = this.slotForLease(lease);
|
|
872
|
+
const scene = (
|
|
873
|
+
explicitLease ? sceneOrTexture : leaseOrScene
|
|
874
|
+
) as NativeWorkerScene;
|
|
875
|
+
const sceneTexture = (
|
|
876
|
+
explicitLease ? textureOrEncoder : sceneOrTexture
|
|
877
|
+
) as GPUTexture;
|
|
878
|
+
const encoder = (
|
|
879
|
+
explicitLease ? maybeEncoder : textureOrEncoder
|
|
880
|
+
) as GPUCommandEncoder;
|
|
881
|
+
const index = slot.pendingFinalIndex;
|
|
359
882
|
let resource = this.finalTextures[index];
|
|
360
883
|
if (
|
|
361
884
|
resource &&
|
|
@@ -367,7 +890,7 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
367
890
|
}
|
|
368
891
|
if (!resource) {
|
|
369
892
|
const bytes = textureSize(scene.width, scene.height, this.workingFormat);
|
|
370
|
-
this.ensureBudget(bytes, `final:${index}
|
|
893
|
+
this.ensureBudget(bytes, `final:${index}`, slot, "final");
|
|
371
894
|
resource = {
|
|
372
895
|
texture: this.device.createTexture({
|
|
373
896
|
size: [scene.width, scene.height],
|
|
@@ -383,6 +906,7 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
383
906
|
bytes,
|
|
384
907
|
};
|
|
385
908
|
this.finalTextures[index] = resource;
|
|
909
|
+
this.commitFlightReservation(slot, bytes, "final");
|
|
386
910
|
this.allocatedBytes += bytes;
|
|
387
911
|
}
|
|
388
912
|
encoder.copyTextureToTexture(
|
|
@@ -393,26 +917,63 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
393
917
|
return resource.texture;
|
|
394
918
|
}
|
|
395
919
|
|
|
920
|
+
publish(
|
|
921
|
+
lease: NativeWorkerGpuFlightLease,
|
|
922
|
+
validatedFinal: GPUTexture,
|
|
923
|
+
scene: NativeWorkerScene,
|
|
924
|
+
): void;
|
|
396
925
|
publish(
|
|
397
926
|
bank: NativeWorkerGpuBank,
|
|
398
927
|
validatedFinal: GPUTexture,
|
|
399
928
|
scene: NativeWorkerScene,
|
|
929
|
+
): void;
|
|
930
|
+
publish(
|
|
931
|
+
leaseOrBank: NativeWorkerGpuFlightLease | NativeWorkerGpuBank,
|
|
932
|
+
validatedFinal: GPUTexture,
|
|
933
|
+
scene: NativeWorkerScene,
|
|
400
934
|
): void {
|
|
401
|
-
this.
|
|
402
|
-
|
|
403
|
-
|
|
935
|
+
const explicitLease = this.leaseSlots.has(
|
|
936
|
+
leaseOrBank as NativeWorkerGpuFlightLease,
|
|
937
|
+
);
|
|
938
|
+
const slot = explicitLease
|
|
939
|
+
? this.slotForLease(leaseOrBank as NativeWorkerGpuFlightLease)
|
|
940
|
+
: this.slotForBank(leaseOrBank as NativeWorkerGpuBank);
|
|
941
|
+
if (explicitLease)
|
|
942
|
+
this.validatePublication(
|
|
943
|
+
leaseOrBank as NativeWorkerGpuFlightLease,
|
|
944
|
+
validatedFinal,
|
|
945
|
+
);
|
|
946
|
+
else this.validatePublication(slot.bank, validatedFinal);
|
|
947
|
+
const previousFront = this.frontFinalIndex;
|
|
948
|
+
const nextFront = slot.pendingFinalIndex;
|
|
949
|
+
slot.bank.sceneTexture = validatedFinal;
|
|
950
|
+
this.frontFinalIndex = nextFront;
|
|
951
|
+
slot.pendingFinalIndex = previousFront;
|
|
952
|
+
this.frontSlot = slot;
|
|
953
|
+
slot.submitted = true;
|
|
404
954
|
void scene;
|
|
405
955
|
}
|
|
406
956
|
|
|
957
|
+
validatePublication(
|
|
958
|
+
lease: NativeWorkerGpuFlightLease,
|
|
959
|
+
validatedFinal: GPUTexture,
|
|
960
|
+
): void;
|
|
407
961
|
validatePublication(
|
|
408
962
|
bank: NativeWorkerGpuBank,
|
|
409
963
|
validatedFinal: GPUTexture,
|
|
964
|
+
): void;
|
|
965
|
+
validatePublication(
|
|
966
|
+
leaseOrBank: NativeWorkerGpuFlightLease | NativeWorkerGpuBank,
|
|
967
|
+
validatedFinal: GPUTexture,
|
|
410
968
|
): void {
|
|
411
969
|
this.assertLive();
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
970
|
+
const explicitLease = this.leaseSlots.has(
|
|
971
|
+
leaseOrBank as NativeWorkerGpuFlightLease,
|
|
972
|
+
);
|
|
973
|
+
const slot = explicitLease
|
|
974
|
+
? this.slotForLease(leaseOrBank as NativeWorkerGpuFlightLease)
|
|
975
|
+
: this.slotForBank(leaseOrBank as NativeWorkerGpuBank);
|
|
976
|
+
if (this.finalTextures[slot.pendingFinalIndex]?.texture !== validatedFinal)
|
|
416
977
|
throw new NativeWorkerGpuError(
|
|
417
978
|
"frame-order-invalid",
|
|
418
979
|
"The validated GPU final texture is no longer spare.",
|
|
@@ -435,7 +996,10 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
435
996
|
}
|
|
436
997
|
|
|
437
998
|
reject(bank: NativeWorkerGpuBank): void {
|
|
438
|
-
|
|
999
|
+
const slot = this.bankSlots.get(bank);
|
|
1000
|
+
if (!slot || slot === this.frontSlot) return;
|
|
1001
|
+
if (slot.activeLease && slot.submitted) return;
|
|
1002
|
+
if (slot.activeLease) this.releaseFlight(slot.activeLease);
|
|
439
1003
|
this.clearBank(bank);
|
|
440
1004
|
}
|
|
441
1005
|
|
|
@@ -447,7 +1011,7 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
447
1011
|
format: GPUTextureFormat = this.workingFormat,
|
|
448
1012
|
): GPUTexture {
|
|
449
1013
|
this.assertLive();
|
|
450
|
-
if (!
|
|
1014
|
+
if (!nativeWorkerTextureSizeValid(width, height))
|
|
451
1015
|
throw new NativeWorkerGpuError(
|
|
452
1016
|
"resource-size-unsupported",
|
|
453
1017
|
"The native GPU texture exceeds its dimension limit.",
|
|
@@ -466,7 +1030,8 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
466
1030
|
bank.textures.delete(key);
|
|
467
1031
|
}
|
|
468
1032
|
const bytes = textureSize(width, height, format);
|
|
469
|
-
this.
|
|
1033
|
+
const slot = this.slotForBank(bank);
|
|
1034
|
+
this.ensureBudget(bytes, `work:${key}`, slot, "work");
|
|
470
1035
|
const texture = this.device.createTexture({
|
|
471
1036
|
size: [width, height],
|
|
472
1037
|
format,
|
|
@@ -477,16 +1042,69 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
477
1042
|
GPUTextureUsage.COPY_DST,
|
|
478
1043
|
});
|
|
479
1044
|
bank.textures.set(key, { texture, width, height, format, bytes });
|
|
1045
|
+
this.commitFlightReservation(slot, bytes, "work");
|
|
1046
|
+
this.allocatedBytes += bytes;
|
|
1047
|
+
return texture;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
private meshDepth(
|
|
1051
|
+
bank: NativeWorkerGpuBank,
|
|
1052
|
+
width: number,
|
|
1053
|
+
height: number,
|
|
1054
|
+
): GPUTexture {
|
|
1055
|
+
const key = `depth24plus:${width}x${height}`;
|
|
1056
|
+
bank.usedDepths.add(key);
|
|
1057
|
+
const existing = bank.depths.get(key);
|
|
1058
|
+
if (existing?.width === width && existing.height === height)
|
|
1059
|
+
return existing.texture;
|
|
1060
|
+
if (existing) {
|
|
1061
|
+
existing.texture.destroy();
|
|
1062
|
+
this.allocatedBytes -= existing.bytes;
|
|
1063
|
+
bank.depths.delete(key);
|
|
1064
|
+
}
|
|
1065
|
+
const bytes = width * height * 4;
|
|
1066
|
+
const slot = this.slotForBank(bank);
|
|
1067
|
+
this.ensureBudget(bytes, `depth:${key}`, slot, "work");
|
|
1068
|
+
const texture = this.device.createTexture({
|
|
1069
|
+
size: [width, height],
|
|
1070
|
+
format: "depth24plus",
|
|
1071
|
+
usage: GPUTextureUsage.RENDER_ATTACHMENT,
|
|
1072
|
+
});
|
|
1073
|
+
bank.depths.set(key, {
|
|
1074
|
+
texture,
|
|
1075
|
+
width,
|
|
1076
|
+
height,
|
|
1077
|
+
format: "depth24plus",
|
|
1078
|
+
bytes,
|
|
1079
|
+
});
|
|
1080
|
+
this.commitFlightReservation(slot, bytes, "work");
|
|
480
1081
|
this.allocatedBytes += bytes;
|
|
481
1082
|
return texture;
|
|
482
1083
|
}
|
|
483
1084
|
|
|
1085
|
+
private meshGrid(
|
|
1086
|
+
mesh: EffectMeshSpec,
|
|
1087
|
+
slot: NativeWorkerGpuFlightSlot,
|
|
1088
|
+
): NativeMeshGridLease {
|
|
1089
|
+
const key = `${mesh.columns}x${mesh.rows}`;
|
|
1090
|
+
const existing = this.meshGrids.get(key);
|
|
1091
|
+
if (existing) return existing;
|
|
1092
|
+
const bytes = nativeMeshGridBytes(mesh);
|
|
1093
|
+
this.ensureBudget(bytes, `mesh:${key}`, slot, "work");
|
|
1094
|
+
const lease = acquireNativeMeshGrid(this.device, mesh);
|
|
1095
|
+
this.meshGrids.set(key, lease);
|
|
1096
|
+
this.commitFlightReservation(slot, bytes, "work");
|
|
1097
|
+
this.allocatedBytes += bytes;
|
|
1098
|
+
return lease;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
484
1101
|
async pipeline(
|
|
485
1102
|
wgsl: string,
|
|
486
1103
|
format: GPUTextureFormat,
|
|
487
1104
|
blend: boolean,
|
|
488
1105
|
textureCount: number,
|
|
489
1106
|
placement?: EffectInstance["placement"],
|
|
1107
|
+
mesh = false,
|
|
490
1108
|
): Promise<GPURenderPipeline> {
|
|
491
1109
|
this.assertLive();
|
|
492
1110
|
if (
|
|
@@ -499,7 +1117,7 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
499
1117
|
"The shader has more texture inputs than the GPU supports.",
|
|
500
1118
|
);
|
|
501
1119
|
const constants = nativeRenderPlacementConstants(wgsl, placement);
|
|
502
|
-
const key = JSON.stringify([format, blend, textureCount, constants]);
|
|
1120
|
+
const key = JSON.stringify([format, blend, textureCount, constants, mesh]);
|
|
503
1121
|
const cached = this.pipelineCache.get(wgsl)?.get(key);
|
|
504
1122
|
if (cached) return cached;
|
|
505
1123
|
const module = this.device.createShaderModule({ code: wgsl });
|
|
@@ -549,6 +1167,15 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
549
1167
|
],
|
|
550
1168
|
},
|
|
551
1169
|
primitive: { topology: "triangle-list" },
|
|
1170
|
+
...(mesh
|
|
1171
|
+
? {
|
|
1172
|
+
depthStencil: {
|
|
1173
|
+
format: "depth24plus" as const,
|
|
1174
|
+
depthWriteEnabled: true,
|
|
1175
|
+
depthCompare: "less" as const,
|
|
1176
|
+
},
|
|
1177
|
+
}
|
|
1178
|
+
: {}),
|
|
552
1179
|
});
|
|
553
1180
|
if (this.disposed)
|
|
554
1181
|
throw new NativeWorkerGpuError(
|
|
@@ -583,18 +1210,20 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
583
1210
|
sampler = this.sampler,
|
|
584
1211
|
): GPUBindGroup {
|
|
585
1212
|
this.assertLive();
|
|
586
|
-
const
|
|
1213
|
+
const slot = this.slotForBank(bank);
|
|
1214
|
+
const frame = slot.uniformFrame;
|
|
587
1215
|
if (!frame)
|
|
588
1216
|
throw new NativeWorkerGpuError(
|
|
589
1217
|
"uniform-frame-missing",
|
|
590
1218
|
"A draw was encoded without a worker uniform frame.",
|
|
591
1219
|
);
|
|
592
|
-
|
|
593
|
-
|
|
1220
|
+
key = `${key}:uniform${values.byteLength}`;
|
|
1221
|
+
const occurrence = slot.uniformOccurrences.get(key) ?? 0;
|
|
1222
|
+
slot.uniformOccurrences.set(key, occurrence + 1);
|
|
594
1223
|
key = `${key}:${occurrence}`;
|
|
595
1224
|
bank.usedBindings.add(key);
|
|
596
|
-
const packed =
|
|
597
|
-
|
|
1225
|
+
const packed = slot.uniformArena!.write(frame, key, values);
|
|
1226
|
+
slot.uniformCount++;
|
|
598
1227
|
const { size, offset } = packed;
|
|
599
1228
|
let binding = bank.bindings.get(key);
|
|
600
1229
|
if (
|
|
@@ -679,7 +1308,8 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
679
1308
|
"worker-capability-pass",
|
|
680
1309
|
`Effect ${instance.id} needs a temporal or non-render pass.`,
|
|
681
1310
|
);
|
|
682
|
-
const plan =
|
|
1311
|
+
const plan =
|
|
1312
|
+
this.preparedPlans.get(definition) ?? planEffectGraph(definition);
|
|
683
1313
|
if (plan.errors.length)
|
|
684
1314
|
throw new NativeWorkerGpuError(
|
|
685
1315
|
"effect-graph-invalid",
|
|
@@ -693,6 +1323,20 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
693
1323
|
timeSeconds,
|
|
694
1324
|
)
|
|
695
1325
|
: instance.params;
|
|
1326
|
+
const cached = this.preparedProperties.get(instance);
|
|
1327
|
+
const packedProperties =
|
|
1328
|
+
!instance.animation &&
|
|
1329
|
+
cached?.definition === definition &&
|
|
1330
|
+
cached.params === instance.params
|
|
1331
|
+
? cached.packed
|
|
1332
|
+
: packNativeProperties(definition, params);
|
|
1333
|
+
this.preparedPlans.set(definition, plan);
|
|
1334
|
+
if (!instance.animation)
|
|
1335
|
+
this.preparedProperties.set(instance, {
|
|
1336
|
+
definition,
|
|
1337
|
+
params: instance.params,
|
|
1338
|
+
packed: packedProperties,
|
|
1339
|
+
});
|
|
696
1340
|
const resources = new Map<string, GPUTexture>([
|
|
697
1341
|
["source", source],
|
|
698
1342
|
...inputs,
|
|
@@ -720,12 +1364,14 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
720
1364
|
);
|
|
721
1365
|
const width = spec?.size === "fixed" ? spec.width : target.width;
|
|
722
1366
|
const height = spec?.size === "fixed" ? spec.height : target.height;
|
|
723
|
-
if (!width || !height || !
|
|
1367
|
+
if (!width || !height || !nativeWorkerTextureSizeValid(width, height))
|
|
724
1368
|
throw new NativeWorkerGpuError(
|
|
725
1369
|
"resource-size-unsupported",
|
|
726
1370
|
`Pass ${pass.id} exceeds effect bounds.`,
|
|
727
1371
|
);
|
|
728
|
-
resourceBytes +=
|
|
1372
|
+
resourceBytes +=
|
|
1373
|
+
textureSize(width, height, format) +
|
|
1374
|
+
(pass.mesh ? width * height * 4 : 0);
|
|
729
1375
|
if (resourceBytes > MAX_EFFECT_BYTES)
|
|
730
1376
|
throw new NativeWorkerGpuError(
|
|
731
1377
|
"resource-budget-exceeded",
|
|
@@ -753,8 +1399,11 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
753
1399
|
false,
|
|
754
1400
|
reads.length,
|
|
755
1401
|
instance.placement,
|
|
1402
|
+
pass.mesh !== undefined,
|
|
1403
|
+
);
|
|
1404
|
+
const values = new Float32Array(
|
|
1405
|
+
8 + nativeEffectUniformFloats(definition),
|
|
756
1406
|
);
|
|
757
|
-
const values = new Float32Array(136);
|
|
758
1407
|
values.set([width, height, 1 / width, 1 / height], 0);
|
|
759
1408
|
values.set(
|
|
760
1409
|
packNativeUniformClock({
|
|
@@ -764,7 +1413,7 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
764
1413
|
}),
|
|
765
1414
|
4,
|
|
766
1415
|
);
|
|
767
|
-
values.set(
|
|
1416
|
+
values.set(packedProperties, 8);
|
|
768
1417
|
const input = reads[0] ?? null;
|
|
769
1418
|
const bind = this.bind(
|
|
770
1419
|
bank,
|
|
@@ -775,6 +1424,10 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
775
1424
|
values,
|
|
776
1425
|
reads.slice(2),
|
|
777
1426
|
);
|
|
1427
|
+
const depth = pass.mesh ? this.meshDepth(bank, width, height) : null;
|
|
1428
|
+
const grid = pass.mesh
|
|
1429
|
+
? this.meshGrid(pass.mesh, this.slotForBank(bank))
|
|
1430
|
+
: null;
|
|
778
1431
|
const render = encoder.beginRenderPass({
|
|
779
1432
|
colorAttachments: [
|
|
780
1433
|
{
|
|
@@ -784,10 +1437,23 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
784
1437
|
clearValue: { r: 0, g: 0, b: 0, a: 0 },
|
|
785
1438
|
},
|
|
786
1439
|
],
|
|
1440
|
+
...(depth
|
|
1441
|
+
? {
|
|
1442
|
+
depthStencilAttachment: {
|
|
1443
|
+
view: depth.createView(),
|
|
1444
|
+
depthLoadOp: "clear" as const,
|
|
1445
|
+
depthStoreOp: "discard" as const,
|
|
1446
|
+
depthClearValue: 1,
|
|
1447
|
+
},
|
|
1448
|
+
}
|
|
1449
|
+
: {}),
|
|
787
1450
|
});
|
|
788
1451
|
render.setPipeline(pipeline);
|
|
789
1452
|
render.setBindGroup(0, bind);
|
|
790
|
-
|
|
1453
|
+
if (grid) {
|
|
1454
|
+
render.setIndexBuffer(grid.buffer, "uint32");
|
|
1455
|
+
render.drawIndexed(grid.indexCount);
|
|
1456
|
+
} else render.draw(3);
|
|
791
1457
|
render.end();
|
|
792
1458
|
resources.set(pass.output, output);
|
|
793
1459
|
}
|
|
@@ -823,6 +1489,36 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
823
1489
|
return JSON.stringify([assetId, revision]);
|
|
824
1490
|
}
|
|
825
1491
|
|
|
1492
|
+
retireIdleWorkForAssetUpload(asset: NativeWorkerAsset): void {
|
|
1493
|
+
if (
|
|
1494
|
+
this.flightSlots.some(
|
|
1495
|
+
(slot) => slot.activeLease && slot.activeLease !== this.legacyLease,
|
|
1496
|
+
)
|
|
1497
|
+
)
|
|
1498
|
+
throw new NativeWorkerGpuError(
|
|
1499
|
+
"frame-pipeline-busy",
|
|
1500
|
+
"Asset uploads cannot retire work while an explicit worker flight is active.",
|
|
1501
|
+
);
|
|
1502
|
+
if (
|
|
1503
|
+
this.assets.has(NativeWorkerGpu.assetKey(asset.assetId, asset.revision))
|
|
1504
|
+
)
|
|
1505
|
+
return;
|
|
1506
|
+
const width = asset.kind === "bitmap" ? asset.bitmap.width : asset.width;
|
|
1507
|
+
const height = asset.kind === "bitmap" ? asset.bitmap.height : asset.height;
|
|
1508
|
+
if (!nativeWorkerTextureSizeValid(width, height)) return;
|
|
1509
|
+
const format =
|
|
1510
|
+
asset.kind === "bitmap"
|
|
1511
|
+
? asset.sampleEncoding === "linear-data"
|
|
1512
|
+
? "rgba8unorm"
|
|
1513
|
+
: "rgba8unorm-srgb"
|
|
1514
|
+
: "rgba16float";
|
|
1515
|
+
if (
|
|
1516
|
+
this.resourceBytes() + textureSize(width, height, format) >
|
|
1517
|
+
MAX_RESOURCE_BYTES
|
|
1518
|
+
)
|
|
1519
|
+
this.trimWorkExcept(this.bank, null);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
826
1522
|
uploadAsset(asset: NativeWorkerAsset): void {
|
|
827
1523
|
try {
|
|
828
1524
|
this.assertLive();
|
|
@@ -837,8 +1533,12 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
837
1533
|
const height =
|
|
838
1534
|
asset.kind === "bitmap" ? asset.bitmap.height : asset.height;
|
|
839
1535
|
const format: GPUTextureFormat =
|
|
840
|
-
asset.kind === "bitmap"
|
|
841
|
-
|
|
1536
|
+
asset.kind === "bitmap"
|
|
1537
|
+
? asset.sampleEncoding === "linear-data"
|
|
1538
|
+
? "rgba8unorm"
|
|
1539
|
+
: "rgba8unorm-srgb"
|
|
1540
|
+
: "rgba16float";
|
|
1541
|
+
if (!nativeWorkerTextureSizeValid(width, height))
|
|
842
1542
|
throw new NativeWorkerGpuError(
|
|
843
1543
|
"asset-size-invalid",
|
|
844
1544
|
`Asset ${asset.assetId} exceeds texture limits.`,
|
|
@@ -914,7 +1614,10 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
914
1614
|
|
|
915
1615
|
resourceBytes(): number {
|
|
916
1616
|
return (
|
|
917
|
-
this.allocatedBytes +
|
|
1617
|
+
this.allocatedBytes +
|
|
1618
|
+
this.allocatedUniformBytes +
|
|
1619
|
+
this.reservedBytes +
|
|
1620
|
+
this.transientBytes
|
|
918
1621
|
);
|
|
919
1622
|
}
|
|
920
1623
|
|
|
@@ -934,19 +1637,33 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
934
1637
|
dispose(): void {
|
|
935
1638
|
if (this.disposed) return;
|
|
936
1639
|
this.disposed = true;
|
|
937
|
-
|
|
1640
|
+
for (const slot of this.flightSlots) {
|
|
1641
|
+
this.clearBank(slot.bank);
|
|
1642
|
+
this.releaseFlightReservation(slot);
|
|
1643
|
+
slot.activeLease = null;
|
|
1644
|
+
if (slot.uniformBuffer) {
|
|
1645
|
+
slot.uniformBuffer.destroy();
|
|
1646
|
+
this.allocatedUniformBytes -= 2_097_152;
|
|
1647
|
+
slot.uniformBuffer = null;
|
|
1648
|
+
slot.uniformArena = null;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
this.legacyLease = null;
|
|
1652
|
+
for (const grid of this.meshGrids.values()) {
|
|
1653
|
+
grid.release();
|
|
1654
|
+
this.allocatedBytes -= grid.bytes;
|
|
1655
|
+
}
|
|
1656
|
+
this.meshGrids.clear();
|
|
938
1657
|
this.retireAssets(new Set());
|
|
939
1658
|
for (const resource of this.finalTextures)
|
|
940
1659
|
if (resource) {
|
|
941
1660
|
resource.texture.destroy();
|
|
942
1661
|
this.allocatedBytes -= resource.bytes;
|
|
943
1662
|
}
|
|
944
|
-
this.finalTextures = [null, null];
|
|
1663
|
+
this.finalTextures = [null, null, null];
|
|
945
1664
|
this.white.destroy();
|
|
946
1665
|
this.transparent.destroy();
|
|
947
1666
|
this.allocatedBytes -= 8;
|
|
948
|
-
this.uniformBuffer.destroy();
|
|
949
|
-
this.allocatedUniformBytes -= 2_097_152;
|
|
950
1667
|
this.context.unconfigure();
|
|
951
1668
|
if (this.ownsDevice) this.device.destroy();
|
|
952
1669
|
}
|
|
@@ -971,9 +1688,10 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
971
1688
|
|
|
972
1689
|
private createUniformArena(
|
|
973
1690
|
capacityBytes: number,
|
|
1691
|
+
buffer: GPUBuffer,
|
|
974
1692
|
): NativePackedUniformArena<GPUBuffer> {
|
|
975
1693
|
return new NativePackedUniformArena({
|
|
976
|
-
buffer
|
|
1694
|
+
buffer,
|
|
977
1695
|
capacityBytes,
|
|
978
1696
|
alignment: this.device.limits.minUniformBufferOffsetAlignment,
|
|
979
1697
|
upload: (buffer, bytes) =>
|
|
@@ -1011,14 +1729,52 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
1011
1729
|
});
|
|
1012
1730
|
}
|
|
1013
1731
|
|
|
1014
|
-
private ensureBudget(
|
|
1732
|
+
private ensureBudget(
|
|
1733
|
+
bytes: number,
|
|
1734
|
+
key: string,
|
|
1735
|
+
slot?: NativeWorkerGpuFlightSlot,
|
|
1736
|
+
category?: "uniform" | "final" | "work",
|
|
1737
|
+
): void {
|
|
1738
|
+
const reservedBytes =
|
|
1739
|
+
category === "uniform"
|
|
1740
|
+
? slot?.uniformReservationBytes
|
|
1741
|
+
: category === "final"
|
|
1742
|
+
? slot?.finalReservationBytes
|
|
1743
|
+
: category === "work"
|
|
1744
|
+
? slot?.workReservationBytes
|
|
1745
|
+
: 0;
|
|
1746
|
+
const credit = Math.min(bytes, reservedBytes ?? 0);
|
|
1747
|
+
const additional = bytes - credit;
|
|
1015
1748
|
const allocated = this.resourceBytes();
|
|
1016
|
-
if (allocated +
|
|
1017
|
-
|
|
1018
|
-
|
|
1749
|
+
if (allocated + additional > MAX_RESOURCE_BYTES)
|
|
1750
|
+
throw (
|
|
1751
|
+
this.capacityError(slot ?? this.flightSlots[0]!) ??
|
|
1752
|
+
this.budgetError(bytes, key)
|
|
1753
|
+
);
|
|
1754
|
+
try {
|
|
1755
|
+
if (additional) this.sharedBudget?.(additional, key);
|
|
1756
|
+
} catch (error) {
|
|
1757
|
+
if (
|
|
1758
|
+
slot &&
|
|
1759
|
+
error instanceof NativeWorkerGpuError &&
|
|
1760
|
+
(error.code === "gpu-budget-exceeded" ||
|
|
1761
|
+
error.code === "gpu-shared-budget-exceeded")
|
|
1762
|
+
) {
|
|
1763
|
+
const capacityError = this.capacityError(slot);
|
|
1764
|
+
if (capacityError) throw capacityError;
|
|
1765
|
+
}
|
|
1766
|
+
throw error;
|
|
1019
1767
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
private budgetError(bytes: number, key: string): NativeWorkerGpuError {
|
|
1771
|
+
const work = this.flightSlots.reduce(
|
|
1772
|
+
(total, slot) =>
|
|
1773
|
+
total +
|
|
1774
|
+
[...slot.bank.textures.values(), ...slot.bank.depths.values()].reduce(
|
|
1775
|
+
(subtotal, resource) => subtotal + resource.bytes,
|
|
1776
|
+
0,
|
|
1777
|
+
),
|
|
1022
1778
|
0,
|
|
1023
1779
|
);
|
|
1024
1780
|
const assets = [...this.assets.values()].reduce(
|
|
@@ -1029,9 +1785,10 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
1029
1785
|
(total, resource) => total + (resource?.bytes ?? 0),
|
|
1030
1786
|
0,
|
|
1031
1787
|
);
|
|
1032
|
-
|
|
1788
|
+
const allocated = this.resourceBytes();
|
|
1789
|
+
return new NativeWorkerGpuError(
|
|
1033
1790
|
"gpu-budget-exceeded",
|
|
1034
|
-
`The native worker GPU resources exceed their bounded budget: ${key} requests ${bytes} bytes with ${allocated} bytes allocated; work ${work} bytes
|
|
1791
|
+
`The native worker GPU resources exceed their bounded budget: ${key} requests ${bytes} bytes with ${allocated} bytes allocated; work ${work} bytes, assets ${assets} bytes/${this.assets.size} textures, finals ${finals} bytes/${this.finalTextures.filter(Boolean).length} textures.`,
|
|
1035
1792
|
);
|
|
1036
1793
|
}
|
|
1037
1794
|
|
|
@@ -1041,8 +1798,14 @@ export class NativeWorkerGpu implements NativeWorkerGpuFacade {
|
|
|
1041
1798
|
this.allocatedBytes -= resource.bytes;
|
|
1042
1799
|
}
|
|
1043
1800
|
bank.textures.clear();
|
|
1801
|
+
for (const resource of bank.depths.values()) {
|
|
1802
|
+
resource.texture.destroy();
|
|
1803
|
+
this.allocatedBytes -= resource.bytes;
|
|
1804
|
+
}
|
|
1805
|
+
bank.depths.clear();
|
|
1044
1806
|
bank.bindings.clear();
|
|
1045
1807
|
bank.usedTextures.clear();
|
|
1808
|
+
bank.usedDepths.clear();
|
|
1046
1809
|
bank.usedBindings.clear();
|
|
1047
1810
|
bank.sceneTexture = null;
|
|
1048
1811
|
bank.generation = -1;
|