@agent-native/core-corpus 0.214.0 → 0.217.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +61 -1
- package/corpus/templates/analytics/AGENTS.md +1 -1
- package/corpus/templates/analytics/CHANGELOG.md +2 -0
- package/corpus/templates/analytics/actions/get-session-replay-summary.ts +9 -65
- package/corpus/templates/analytics/actions/list-event-catalog.ts +1 -1
- package/corpus/templates/analytics/actions/list-session-outputs.ts +40 -0
- package/corpus/templates/analytics/actions/list-session-recordings.ts +17 -4
- package/corpus/templates/analytics/actions/view-screen.ts +29 -3
- package/corpus/templates/analytics/app/i18n/en-US.ts +27 -0
- package/corpus/templates/analytics/app/pages/sessions/EventCatalogPage.tsx +18 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +3 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionOutputs.tsx +197 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionsTriagePage.tsx +114 -4
- package/corpus/templates/analytics/changelog/2026-10-15-sessions-can-find-people-who-made-a-slides-deck-but-didn-t-p.md +6 -0
- package/corpus/templates/analytics/changelog/2026-10-16-the-activation-funnel-counts-visitors-who-decline-analytics-.md +6 -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/db/schema.ts +67 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +28 -22
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +36 -1
- package/corpus/templates/analytics/server/lib/output-outcomes.ts +712 -0
- package/corpus/templates/analytics/server/lib/replay-origins.ts +33 -0
- package/corpus/templates/analytics/server/lib/session-event-index.ts +20 -0
- package/corpus/templates/analytics/server/lib/session-performance.ts +6 -40
- package/corpus/templates/analytics/server/lib/session-recording-associations.ts +30 -1
- package/corpus/templates/analytics/server/lib/session-replay-triage.ts +99 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +85 -40
- package/corpus/templates/analytics/server/lib/sessions-triage-lab.ts +8 -2
- package/corpus/templates/analytics/server/plugins/db.ts +46 -0
- package/corpus/templates/analytics/shared/output-use.ts +205 -0
- package/corpus/templates/analytics/shared/session-events.ts +6 -0
- 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/calendar/CHANGELOG.md +6 -0
- package/corpus/templates/calendar/actions/create-event.ts +2 -4
- package/corpus/templates/calendar/actions/update-event.ts +35 -6
- package/corpus/templates/calendar/changelog/2026-10-21-solo-events-avoid-notification-approval.md +6 -0
- 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 +17 -3
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +4 -2
- package/corpus/templates/content/CHANGELOG.md +54 -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/_browser-document-save-attempt.ts +23 -1
- package/corpus/templates/content/actions/_builder-cms-blob-custody.ts +467 -0
- package/corpus/templates/content/actions/_builder-cms-execution-lease.ts +17 -0
- package/corpus/templates/content/actions/_builder-cms-intent-lookup.ts +5 -0
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +881 -21
- package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +28 -2
- package/corpus/templates/content/actions/_builder-cms-write-client.ts +109 -11
- package/corpus/templates/content/actions/_builder-docs-client.ts +1 -0
- package/corpus/templates/content/actions/_builder-private-blob.test-fixture.ts +90 -0
- package/corpus/templates/content/actions/_builder-source-execution-guard.ts +48 -0
- 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/_content-save-outcomes.ts +5 -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 +308 -9
- package/corpus/templates/content/actions/_database-utils.ts +96 -7
- package/corpus/templates/content/actions/_database-view-setup.ts +37 -2
- package/corpus/templates/content/actions/_delete-content-space.ts +8 -1
- 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-freshness.ts +30 -4
- 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/add-content-database-source-field-property.ts +23 -6
- package/corpus/templates/content/actions/cancel-prepared-builder-source-update.ts +110 -26
- package/corpus/templates/content/actions/change-content-database-source-role.ts +51 -7
- 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 +311 -100
- package/corpus/templates/content/actions/disconnect-content-database-source.ts +68 -2
- package/corpus/templates/content/actions/disconnect-local-folder-source.ts +33 -2
- package/corpus/templates/content/actions/edit-document.ts +18 -5
- package/corpus/templates/content/actions/execute-builder-source-execution.ts +900 -140
- 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/get-document.ts +2 -0
- 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/permanently-delete-document.ts +6 -0
- package/corpus/templates/content/actions/prepare-builder-source-execution.ts +155 -13
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +299 -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/set-live-body-switch.ts +45 -0
- 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 +158 -34
- package/corpus/templates/content/actions/validate-builder-source-execution.ts +135 -26
- 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 +228 -71
- package/corpus/templates/content/app/components/editor/database/GitHubSourceStatusLine.tsx +27 -2
- package/corpus/templates/content/app/components/editor/database/ListItemLayout.tsx +32 -8
- package/corpus/templates/content/app/components/editor/database/ListItemRow.tsx +27 -2
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +1 -0
- 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-database.ts +40 -2
- package/corpus/templates/content/app/hooks/use-content-trash.ts +8 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +14 -0
- package/corpus/templates/content/app/i18n-data.ts +1 -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-17-builder-content-avoids-retrying-a-write-when-builder-accepte.md +6 -0
- package/corpus/templates/content/changelog/2026-10-18-link-a-new-collection-to-a-github-folder-from-its-sources.md +1 -1
- 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-builder-content-sync-keeps-read-and-write-status-accurate-wh.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-list-rows-can-show-each-pages-first-lines.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-a-collection-linked-to-a-big-github-folder-fills-faster-and-p.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/docs/product/capabilities/content.source.adapters.md +29 -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/parity/matrix.md +42 -42
- package/corpus/templates/content/parity/matrix.ts +3 -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 +21 -0
- package/corpus/templates/content/server/lib/content-trash-purge.ts +222 -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 +311 -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/live-copy/binding.ts +31 -0
- package/corpus/templates/content/server/live-copy/bounded-task.d.ts +6 -0
- package/corpus/templates/content/server/live-copy/exec-db.ts +1 -0
- package/corpus/templates/content/server/live-copy/holds.ts +59 -0
- package/corpus/templates/content/server/live-copy/persist.ts +656 -0
- package/corpus/templates/content/server/live-copy/switch.ts +136 -0
- package/corpus/templates/content/server/live-copy/task-names.ts +4 -0
- package/corpus/templates/content/server/live-copy/tasks.ts +183 -0
- package/corpus/templates/content/server/live-copy/write-cause.ts +85 -0
- package/corpus/templates/content/server/live-copy/write.ts +85 -0
- package/corpus/templates/content/server/plugins/builder-private-payload-cleanup.ts +22 -0
- package/corpus/templates/content/server/plugins/collab.ts +3 -0
- package/corpus/templates/content/server/plugins/db.ts +33 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +50 -168
- package/corpus/templates/content/shared/api.ts +32 -1
- package/corpus/templates/content/shared/blocks-fields-manifest.ts +106 -0
- package/corpus/templates/content/shared/database-item-layout.ts +54 -22
- 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/document-intent-merge.ts +16 -9
- 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/og-description.ts +258 -36
- 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/design-templates/SKILL.md +5 -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 +30 -92
- package/corpus/templates/design/AGENTS.md +1 -3
- package/corpus/templates/design/CHANGELOG.md +34 -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-getting-started.ts +53 -0
- 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 +141 -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 +778 -246
- package/corpus/templates/design/app/components/design/bridge/native-source-provider.ts +512 -320
- 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 +540 -161
- 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 +45 -150
- 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/design-canvas/text-content-change-result.ts +46 -12
- 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/home/DesignHomeLibrary.tsx +15 -8
- package/corpus/templates/design/app/components/layout/GettingStarted.tsx +50 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -0
- package/corpus/templates/design/app/components/templates/DesignTemplateGrid.tsx +163 -0
- package/corpus/templates/design/app/components/templates/DesignTemplateLibrary.tsx +65 -78
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +66 -5
- package/corpus/templates/design/app/global.css +6 -0
- package/corpus/templates/design/app/i18n/en-US.ts +95 -2
- package/corpus/templates/design/app/lib/canvas-load-outcome.ts +147 -0
- package/corpus/templates/design/app/lib/canvas-outcome-tracking.ts +531 -0
- package/corpus/templates/design/app/lib/canvas-style-kind.ts +50 -0
- package/corpus/templates/design/app/pages/Index.tsx +10 -3
- 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 +88 -32
- 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/save-file-content.ts +38 -3
- 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-core.ts +9 -0
- 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-files-and-saving.ts +2 -0
- 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-a-getting-started-checklist-at-the-bottom-of-the-sidebar-tra.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-21-templates-now-open-a-read-only-preview-from-the-card-and-the.md +6 -0
- package/corpus/templates/design/changelog/2026-10-22-collapsed-shader-layers-no-longer-interrupt-other-shaders-on.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/changelog/2026-10-22-shader-fills-keep-rendering-when-other-screen-content-cannot.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/design-export-validation/export-baseline.json +24 -0
- 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/lib/getting-started.ts +267 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +0 -2
- package/corpus/templates/design/server/plugins/getting-started.ts +5 -0
- package/corpus/templates/design/shared/design-template-presets/analytics-dashboard.ts +127 -0
- package/corpus/templates/design/shared/design-template-presets/design-studio.ts +98 -0
- package/corpus/templates/design/shared/design-template-presets/messaging-app.ts +101 -0
- package/corpus/templates/design/shared/design-template-presets/project-tasks.ts +120 -0
- package/corpus/templates/design/shared/design-template-presets.ts +8 -0
- 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/forms/server/plugins/agent-chat.ts +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/CHANGELOG.md +6 -0
- package/corpus/templates/slides/actions/delete-deck.ts +7 -0
- package/corpus/templates/slides/changelog/2026-10-21-connected-deck-deletion-requires-approval.md +6 -0
- package/corpus/templates/slides/scripts/edit-fidelity/client-action.ts +61 -0
- package/corpus/templates/slides/scripts/edit-fidelity/run.ts +10 -0
- 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
|
@@ -4,6 +4,10 @@ import type {
|
|
|
4
4
|
EffectInstance,
|
|
5
5
|
} from "../../../../shared/native-effects";
|
|
6
6
|
import { planNativeExportRegion } from "../../../../shared/native-export-region";
|
|
7
|
+
import {
|
|
8
|
+
nativeWorkerInputAssetId,
|
|
9
|
+
planNativeInputResources,
|
|
10
|
+
} from "../../../../shared/native-input-resources";
|
|
7
11
|
import { NativePreviewPolicyController } from "./native-preview-policy";
|
|
8
12
|
import { planNativeWorkerBackdropRoute } from "./native-worker-backdrop-route";
|
|
9
13
|
import {
|
|
@@ -22,7 +26,10 @@ import {
|
|
|
22
26
|
import {
|
|
23
27
|
NativeWorkerGpu,
|
|
24
28
|
NativeWorkerGpuError,
|
|
29
|
+
NativeWorkerGpuFlightCapacityError,
|
|
30
|
+
nativeWorkerTextureSizeValid,
|
|
25
31
|
type NativeWorkerGpuBank,
|
|
32
|
+
type NativeWorkerGpuFlightLease,
|
|
26
33
|
} from "./native-worker-gpu";
|
|
27
34
|
import {
|
|
28
35
|
finishWgsl,
|
|
@@ -33,8 +40,10 @@ import {
|
|
|
33
40
|
} from "./native-worker-gpu-wgsl";
|
|
34
41
|
import {
|
|
35
42
|
NATIVE_WORKER_PROTOCOL_VERSION,
|
|
43
|
+
nativeWorkerClockSampleValid,
|
|
36
44
|
type NativeWorkerEffectTarget,
|
|
37
45
|
type NativeWorkerFromGpu,
|
|
46
|
+
type NativeWorkerCamera,
|
|
38
47
|
type NativeWorkerScene,
|
|
39
48
|
type NativeWorkerSourceRecord,
|
|
40
49
|
type NativeWorkerToGpu,
|
|
@@ -66,6 +75,11 @@ function checkedScene(scene: NativeWorkerScene, gpu: NativeWorkerGpu): void {
|
|
|
66
75
|
scene.generation < 1 ||
|
|
67
76
|
!Number.isSafeInteger(scene.sourceEpoch) ||
|
|
68
77
|
!Number.isSafeInteger(scene.authoredEpoch) ||
|
|
78
|
+
typeof scene.clock.playing !== "boolean" ||
|
|
79
|
+
!nativeWorkerClockSampleValid(
|
|
80
|
+
scene.clock,
|
|
81
|
+
performance.timeOrigin + performance.now(),
|
|
82
|
+
) ||
|
|
69
83
|
![
|
|
70
84
|
scene.viewport.x,
|
|
71
85
|
scene.viewport.y,
|
|
@@ -78,12 +92,14 @@ function checkedScene(scene: NativeWorkerScene, gpu: NativeWorkerGpu): void {
|
|
|
78
92
|
scene.viewport.width <= 0 ||
|
|
79
93
|
scene.viewport.height <= 0 ||
|
|
80
94
|
scene.pixelRatio <= 0 ||
|
|
95
|
+
!nativeWorkerTextureSizeValid(scene.width, scene.height) ||
|
|
81
96
|
scene.width !== Math.ceil(scene.viewport.width * scene.pixelRatio) ||
|
|
82
97
|
scene.height !== Math.ceil(scene.viewport.height * scene.pixelRatio) ||
|
|
83
98
|
(scene.colorSpace !== "srgb" && scene.colorSpace !== "display-p3") ||
|
|
84
99
|
(scene.frameRateTarget !== undefined &&
|
|
85
100
|
scene.frameRateTarget !== 60 &&
|
|
86
|
-
scene.frameRateTarget !== 120)
|
|
101
|
+
scene.frameRateTarget !== 120) ||
|
|
102
|
+
(scene.compact !== undefined && typeof scene.compact !== "boolean")
|
|
87
103
|
)
|
|
88
104
|
throw new NativeWorkerSceneError(
|
|
89
105
|
"scene-geometry-invalid",
|
|
@@ -131,7 +147,45 @@ function checkedScene(scene: NativeWorkerScene, gpu: NativeWorkerGpu): void {
|
|
|
131
147
|
const instancesById = new Map(
|
|
132
148
|
scene.instances.map((instance) => [instance.id, instance]),
|
|
133
149
|
);
|
|
150
|
+
const definitionsByKey = new Map(
|
|
151
|
+
scene.definitions.map((definition) => [
|
|
152
|
+
`${definition.id}:${definition.version}`,
|
|
153
|
+
definition,
|
|
154
|
+
]),
|
|
155
|
+
);
|
|
134
156
|
for (const target of scene.targets) {
|
|
157
|
+
const instance = instancesById.get(target.instanceId);
|
|
158
|
+
const definition = instance
|
|
159
|
+
? definitionsByKey.get(
|
|
160
|
+
`${instance.definitionId}:${instance.definitionVersion}`,
|
|
161
|
+
)
|
|
162
|
+
: undefined;
|
|
163
|
+
if (!instance || !definition)
|
|
164
|
+
throw new NativeWorkerSceneError(
|
|
165
|
+
"scene-effect-invalid",
|
|
166
|
+
`Effect ${target.instanceId} has no matching definition.`,
|
|
167
|
+
);
|
|
168
|
+
const plan = planNativeInputResources(definition, instance);
|
|
169
|
+
if (!plan.ok) throw new NativeWorkerSceneError(plan.code, plan.detail);
|
|
170
|
+
const expectedInputAssets = [...plan.inputs].flatMap(([resource, input]) =>
|
|
171
|
+
input.kind === "asset"
|
|
172
|
+
? ([[resource, nativeWorkerInputAssetId(input)]] as const)
|
|
173
|
+
: [],
|
|
174
|
+
);
|
|
175
|
+
const supplied = Object.entries(target.inputAssetIds ?? {});
|
|
176
|
+
if (
|
|
177
|
+
expectedInputAssets.length !== supplied.length ||
|
|
178
|
+
expectedInputAssets.some(
|
|
179
|
+
([resource, assetId]) =>
|
|
180
|
+
assetId === null ||
|
|
181
|
+
target.inputAssetIds?.[resource] !== assetId ||
|
|
182
|
+
!requirements.has(assetId),
|
|
183
|
+
)
|
|
184
|
+
)
|
|
185
|
+
throw new NativeWorkerSceneError(
|
|
186
|
+
"scene-input-asset-invalid",
|
|
187
|
+
`Effect ${target.instanceId} has invalid input asset bindings.`,
|
|
188
|
+
);
|
|
135
189
|
if (!target.groupLocalOwnerId) continue;
|
|
136
190
|
const child = instancesById.get(target.instanceId);
|
|
137
191
|
const owner = instancesById.get(target.groupLocalOwnerId);
|
|
@@ -148,16 +202,101 @@ function checkedScene(scene: NativeWorkerScene, gpu: NativeWorkerGpu): void {
|
|
|
148
202
|
}
|
|
149
203
|
}
|
|
150
204
|
|
|
205
|
+
function compatibleCameraContent(
|
|
206
|
+
base: NativeWorkerScene,
|
|
207
|
+
candidate: NativeWorkerScene,
|
|
208
|
+
): boolean {
|
|
209
|
+
return (
|
|
210
|
+
candidate.sceneId === base.sceneId &&
|
|
211
|
+
candidate.sourceEpoch === base.sourceEpoch &&
|
|
212
|
+
candidate.authoredEpoch === base.authoredEpoch &&
|
|
213
|
+
candidate.pixelRatio === base.pixelRatio &&
|
|
214
|
+
candidate.colorSpace === base.colorSpace &&
|
|
215
|
+
candidate.frameRateTarget === base.frameRateTarget &&
|
|
216
|
+
candidate.compact === base.compact &&
|
|
217
|
+
candidate.definitions === base.definitions &&
|
|
218
|
+
candidate.instances === base.instances &&
|
|
219
|
+
candidate.targets === base.targets &&
|
|
220
|
+
candidate.records === base.records &&
|
|
221
|
+
candidate.backdropRecords === base.backdropRecords &&
|
|
222
|
+
candidate.requiredAssets === base.requiredAssets
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function checkedCamera(
|
|
227
|
+
camera: NativeWorkerCamera,
|
|
228
|
+
state: SceneState,
|
|
229
|
+
): NativeWorkerScene {
|
|
230
|
+
const current = state.current;
|
|
231
|
+
const staged = state.staged;
|
|
232
|
+
if (
|
|
233
|
+
!current ||
|
|
234
|
+
!state.currentSignature ||
|
|
235
|
+
camera.baseGeneration !== current.generation ||
|
|
236
|
+
camera.sceneId !== current.sceneId ||
|
|
237
|
+
camera.sourceEpoch !== current.sourceEpoch ||
|
|
238
|
+
camera.authoredEpoch !== current.authoredEpoch ||
|
|
239
|
+
camera.pixelRatio !== current.pixelRatio ||
|
|
240
|
+
(staged !== null && !compatibleCameraContent(current, staged))
|
|
241
|
+
)
|
|
242
|
+
throw new NativeWorkerSceneError(
|
|
243
|
+
"worker-camera-base-stale",
|
|
244
|
+
"The camera update no longer matches the committed native scene.",
|
|
245
|
+
);
|
|
246
|
+
if (
|
|
247
|
+
!Number.isSafeInteger(camera.generation) ||
|
|
248
|
+
camera.generation <=
|
|
249
|
+
Math.max(current.generation, staged?.generation ?? 0) ||
|
|
250
|
+
!nativeWorkerTextureSizeValid(camera.width, camera.height) ||
|
|
251
|
+
!camera.viewport ||
|
|
252
|
+
!camera.clock ||
|
|
253
|
+
typeof camera.clock.playing !== "boolean" ||
|
|
254
|
+
!nativeWorkerClockSampleValid(
|
|
255
|
+
camera.clock,
|
|
256
|
+
performance.timeOrigin + performance.now(),
|
|
257
|
+
) ||
|
|
258
|
+
![
|
|
259
|
+
camera.viewport.x,
|
|
260
|
+
camera.viewport.y,
|
|
261
|
+
camera.viewport.width,
|
|
262
|
+
camera.viewport.height,
|
|
263
|
+
camera.clock.timeSeconds,
|
|
264
|
+
camera.clock.speed,
|
|
265
|
+
].every(Number.isFinite) ||
|
|
266
|
+
camera.viewport.width <= 0 ||
|
|
267
|
+
camera.viewport.height <= 0 ||
|
|
268
|
+
camera.width !== Math.ceil(camera.viewport.width * camera.pixelRatio) ||
|
|
269
|
+
camera.height !== Math.ceil(camera.viewport.height * camera.pixelRatio)
|
|
270
|
+
)
|
|
271
|
+
throw new NativeWorkerSceneError(
|
|
272
|
+
"scene-geometry-invalid",
|
|
273
|
+
"The camera update has invalid full-resolution geometry.",
|
|
274
|
+
);
|
|
275
|
+
return {
|
|
276
|
+
...current,
|
|
277
|
+
generation: camera.generation,
|
|
278
|
+
viewport: camera.viewport,
|
|
279
|
+
width: camera.width,
|
|
280
|
+
height: camera.height,
|
|
281
|
+
clock: camera.clock,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
|
|
151
285
|
function clockTime(
|
|
152
286
|
scene: NativeWorkerScene,
|
|
153
287
|
anchorMs: number,
|
|
154
288
|
nowMs: number,
|
|
155
289
|
): number {
|
|
290
|
+
const elapsedMs =
|
|
291
|
+
scene.clock.sampledAtEpochMs === undefined
|
|
292
|
+
? Math.max(0, nowMs - anchorMs)
|
|
293
|
+
: Math.max(
|
|
294
|
+
0,
|
|
295
|
+
performance.timeOrigin + nowMs - scene.clock.sampledAtEpochMs,
|
|
296
|
+
);
|
|
156
297
|
return (
|
|
157
298
|
scene.clock.timeSeconds +
|
|
158
|
-
(scene.clock.playing
|
|
159
|
-
? (Math.max(0, nowMs - anchorMs) * scene.clock.speed) / 1000
|
|
160
|
-
: 0)
|
|
299
|
+
(scene.clock.playing ? (elapsedMs * scene.clock.speed) / 1000 : 0)
|
|
161
300
|
);
|
|
162
301
|
}
|
|
163
302
|
|
|
@@ -721,6 +860,9 @@ class NativeWorkerRenderer {
|
|
|
721
860
|
localTime(instance, this.timeSeconds),
|
|
722
861
|
this.encoder,
|
|
723
862
|
new Map([
|
|
863
|
+
...Object.entries(target.inputAssetIds ?? {}).map(
|
|
864
|
+
([resource, assetId]) => [resource, this.asset(assetId)] as const,
|
|
865
|
+
),
|
|
724
866
|
...(target.receiverGeometryAssetId
|
|
725
867
|
? [
|
|
726
868
|
[
|
|
@@ -1003,10 +1145,34 @@ type DueScene = {
|
|
|
1003
1145
|
staged: boolean;
|
|
1004
1146
|
};
|
|
1005
1147
|
|
|
1148
|
+
type FlightItem = DueScene & {
|
|
1149
|
+
lease: NativeWorkerGpuFlightLease;
|
|
1150
|
+
final: GPUTexture;
|
|
1151
|
+
renderer: NativeWorkerRenderer;
|
|
1152
|
+
timeSeconds: number;
|
|
1153
|
+
stagedAtStart: NativeWorkerScene | null;
|
|
1154
|
+
currentAtStart: NativeWorkerScene | null;
|
|
1155
|
+
anchorAtStart: number;
|
|
1156
|
+
signatureAtStart: string | null;
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
type BatchFlight = {
|
|
1160
|
+
items: FlightItem[];
|
|
1161
|
+
due: readonly DueScene[];
|
|
1162
|
+
now: number;
|
|
1163
|
+
fence: Promise<FlightFenceResult> | null;
|
|
1164
|
+
presentation: Promise<void> | null;
|
|
1165
|
+
presentationSubmittedAtMs: number | null;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
type FlightFenceResult =
|
|
1169
|
+
| { status: "completed" }
|
|
1170
|
+
| { status: "failed"; error: unknown };
|
|
1171
|
+
|
|
1006
1172
|
export class NativeWorkerRuntime {
|
|
1007
1173
|
private readonly scenes = new Map<string, SceneState>();
|
|
1008
1174
|
private readonly animationCadence = new Map<
|
|
1009
|
-
60 | 120,
|
|
1175
|
+
60 | 120 | "compact",
|
|
1010
1176
|
NativePreviewPolicyController
|
|
1011
1177
|
>();
|
|
1012
1178
|
private timer: number | null = null;
|
|
@@ -1015,6 +1181,14 @@ export class NativeWorkerRuntime {
|
|
|
1015
1181
|
private device: GPUDevice | null = null;
|
|
1016
1182
|
private creatingDevice: Promise<GPUDevice> | null = null;
|
|
1017
1183
|
private gpuTail: Promise<void> = Promise.resolve();
|
|
1184
|
+
private readonly flights: BatchFlight[] = [];
|
|
1185
|
+
private readonly flightWaiters: Array<() => void> = [];
|
|
1186
|
+
private recordingFlights = 0;
|
|
1187
|
+
private settlingFlight = false;
|
|
1188
|
+
private flightRecovery = false;
|
|
1189
|
+
private pendingFlightFailure: unknown | null = null;
|
|
1190
|
+
private secondFlightUnavailable = false;
|
|
1191
|
+
private pendingExclusiveOperations = 0;
|
|
1018
1192
|
private readonly pendingInit = new Set<string>();
|
|
1019
1193
|
private readonly cancelledInit = new Set<string>();
|
|
1020
1194
|
private static readonly MAX_SHARED_RESOURCE_BYTES = 2_147_483_648;
|
|
@@ -1035,12 +1209,272 @@ export class NativeWorkerRuntime {
|
|
|
1035
1209
|
return result;
|
|
1036
1210
|
}
|
|
1037
1211
|
|
|
1038
|
-
private
|
|
1039
|
-
|
|
1212
|
+
private waitForFlights(): Promise<void> {
|
|
1213
|
+
if (!this.flights.length && !this.flightRecovery && !this.recordingFlights)
|
|
1214
|
+
return Promise.resolve();
|
|
1215
|
+
return new Promise((resolve) => this.flightWaiters.push(resolve));
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
private async withExclusiveGpu<T>(task: () => Promise<T>): Promise<T> {
|
|
1219
|
+
this.pendingExclusiveOperations++;
|
|
1220
|
+
try {
|
|
1221
|
+
await this.waitForFlights();
|
|
1222
|
+
return await this.serializeGpu(task);
|
|
1223
|
+
} finally {
|
|
1224
|
+
this.pendingExclusiveOperations--;
|
|
1225
|
+
this.schedule();
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
private finishFlightWaiters(): void {
|
|
1230
|
+
if (this.flights.length || this.flightRecovery || this.recordingFlights)
|
|
1231
|
+
return;
|
|
1232
|
+
this.secondFlightUnavailable = false;
|
|
1233
|
+
for (const resolve of this.flightWaiters.splice(0)) resolve();
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
private sceneHasFlight(state: SceneState): boolean {
|
|
1237
|
+
return this.flights.some((flight) =>
|
|
1238
|
+
flight.items.some((item) => item.state === state),
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
private flightItemCurrent(item: FlightItem): boolean {
|
|
1243
|
+
const { state, scene } = item;
|
|
1244
|
+
const compatibleNewerCamera =
|
|
1245
|
+
state.staged !== null &&
|
|
1246
|
+
state.currentSignature !== null &&
|
|
1247
|
+
state.stagedSignature === state.currentSignature &&
|
|
1248
|
+
compatibleCameraContent(scene, state.staged);
|
|
1249
|
+
const predecessorAdopted =
|
|
1250
|
+
item.staged &&
|
|
1251
|
+
state.current === scene &&
|
|
1252
|
+
state.currentSignature === item.signatureAtStart &&
|
|
1253
|
+
(state.staged === null || compatibleNewerCamera);
|
|
1254
|
+
const compatibleCameraArrived =
|
|
1255
|
+
!item.staged && item.stagedAtStart === null && compatibleNewerCamera;
|
|
1256
|
+
return (
|
|
1257
|
+
!state.disposed &&
|
|
1258
|
+
(predecessorAdopted ||
|
|
1259
|
+
(state.current === item.currentAtStart &&
|
|
1260
|
+
(state.staged === item.stagedAtStart || compatibleCameraArrived) &&
|
|
1261
|
+
(item.staged ? state.staged === scene : state.current === scene)))
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
private async settleFlights(): Promise<void> {
|
|
1266
|
+
if (this.settlingFlight) return;
|
|
1267
|
+
this.settlingFlight = true;
|
|
1268
|
+
try {
|
|
1269
|
+
while (this.flights.length) {
|
|
1270
|
+
const flight = this.flights[0]!;
|
|
1271
|
+
try {
|
|
1272
|
+
if (this.pendingFlightFailure !== null) {
|
|
1273
|
+
const failure = this.pendingFlightFailure;
|
|
1274
|
+
this.pendingFlightFailure = null;
|
|
1275
|
+
await this.recoverFlights(failure);
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
if (!flight.fence)
|
|
1279
|
+
await this.serializeGpu(() => this.presentFlight(flight));
|
|
1280
|
+
const pendingFence = flight.fence;
|
|
1281
|
+
if (!pendingFence)
|
|
1282
|
+
throw new NativeWorkerSceneError(
|
|
1283
|
+
"gpu-flight-fence-missing",
|
|
1284
|
+
"The shared GPU flight has no completion fence.",
|
|
1285
|
+
);
|
|
1286
|
+
const fence = await pendingFence;
|
|
1287
|
+
if (fence.status === "failed") throw fence.error;
|
|
1288
|
+
let superseded = false;
|
|
1289
|
+
await this.serializeGpu(async () => {
|
|
1290
|
+
superseded = flight.items.some(
|
|
1291
|
+
(item) => !this.flightItemCurrent(item),
|
|
1292
|
+
);
|
|
1293
|
+
if (superseded) return;
|
|
1294
|
+
for (const item of flight.items)
|
|
1295
|
+
item.state.gpu.validatePublication(item.lease, item.final);
|
|
1296
|
+
for (const item of flight.items) {
|
|
1297
|
+
const { state, scene, lease } = item;
|
|
1298
|
+
state.gpu.publish(lease, item.final, scene);
|
|
1299
|
+
const staged = item.staged && state.staged === scene;
|
|
1300
|
+
if (staged) state.anchorMs = item.anchorAtStart;
|
|
1301
|
+
this.completeFrame(
|
|
1302
|
+
item.sceneId,
|
|
1303
|
+
state,
|
|
1304
|
+
scene,
|
|
1305
|
+
staged,
|
|
1306
|
+
flight.now,
|
|
1307
|
+
lease.bank,
|
|
1308
|
+
item.renderer,
|
|
1309
|
+
item.timeSeconds,
|
|
1310
|
+
lease,
|
|
1311
|
+
flight.presentationSubmittedAtMs,
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
if (superseded) {
|
|
1316
|
+
await this.recoverFlights(null);
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
this.flights.shift();
|
|
1320
|
+
for (const item of flight.items) {
|
|
1321
|
+
item.state.gpu.releaseFlight(item.lease);
|
|
1322
|
+
item.state.busy = this.sceneHasFlight(item.state);
|
|
1323
|
+
}
|
|
1324
|
+
this.secondFlightUnavailable = false;
|
|
1325
|
+
this.schedule();
|
|
1326
|
+
} catch (error) {
|
|
1327
|
+
try {
|
|
1328
|
+
await this.recoverFlights(error);
|
|
1329
|
+
} catch (recoveryError) {
|
|
1330
|
+
const first = flight.items[0];
|
|
1331
|
+
if (first)
|
|
1332
|
+
this.error(
|
|
1333
|
+
first.sceneId,
|
|
1334
|
+
recoveryError,
|
|
1335
|
+
undefined,
|
|
1336
|
+
first.scene.generation,
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
} finally {
|
|
1343
|
+
this.settlingFlight = false;
|
|
1344
|
+
this.finishFlightWaiters();
|
|
1345
|
+
for (const [sceneId, state] of this.scenes)
|
|
1346
|
+
if (state.disposed && !state.busy)
|
|
1347
|
+
void this.serializeGpu(async () =>
|
|
1348
|
+
this.disposeScene(sceneId, state),
|
|
1349
|
+
).catch((error) => this.error(sceneId, error));
|
|
1350
|
+
this.schedule();
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
private async recoverFlights(error: unknown): Promise<void> {
|
|
1355
|
+
this.flightRecovery = true;
|
|
1356
|
+
const failed = this.flights.splice(0);
|
|
1357
|
+
try {
|
|
1358
|
+
await this.serializeGpu(async () => {
|
|
1359
|
+
const device = failed[0]?.items[0]?.state.gpu.device;
|
|
1360
|
+
let drainFailure: unknown = null;
|
|
1361
|
+
try {
|
|
1362
|
+
if (device) await device.queue.onSubmittedWorkDone();
|
|
1363
|
+
} catch (failure) {
|
|
1364
|
+
drainFailure = failure;
|
|
1365
|
+
}
|
|
1366
|
+
let releaseFailure: unknown = null;
|
|
1367
|
+
for (const flight of failed)
|
|
1368
|
+
for (const item of flight.items)
|
|
1369
|
+
try {
|
|
1370
|
+
item.state.gpu.releaseFlight(item.lease);
|
|
1371
|
+
} catch (failure) {
|
|
1372
|
+
releaseFailure ??= failure;
|
|
1373
|
+
}
|
|
1374
|
+
if (drainFailure || releaseFailure)
|
|
1375
|
+
throw new NativeWorkerSceneError(
|
|
1376
|
+
"gpu-flight-drain-failed",
|
|
1377
|
+
`The shared GPU flight could not drain safely: ${String(drainFailure ?? releaseFailure)}`,
|
|
1378
|
+
);
|
|
1379
|
+
let restorationFailure: unknown = null;
|
|
1380
|
+
const affected = new Map<SceneState, FlightItem>();
|
|
1381
|
+
for (const flight of failed)
|
|
1382
|
+
for (const item of flight.items) affected.set(item.state, item);
|
|
1383
|
+
for (const item of affected.values()) {
|
|
1384
|
+
const current = item.state.current;
|
|
1385
|
+
if (item.state.disposed || !current) continue;
|
|
1386
|
+
const front = item.state.gpu.frontTexture();
|
|
1387
|
+
if (front) {
|
|
1388
|
+
try {
|
|
1389
|
+
const bank = item.state.gpu.spareBank(
|
|
1390
|
+
current,
|
|
1391
|
+
item.state.currentSignature,
|
|
1392
|
+
);
|
|
1393
|
+
try {
|
|
1394
|
+
await this.present(item.state.gpu, bank, current, front, null);
|
|
1395
|
+
} finally {
|
|
1396
|
+
item.state.gpu.endLegacyFlight();
|
|
1397
|
+
}
|
|
1398
|
+
} catch (restoreError) {
|
|
1399
|
+
restorationFailure ??= restoreError;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
if (restorationFailure)
|
|
1404
|
+
throw new NativeWorkerSceneError(
|
|
1405
|
+
"presentation-restore-failed",
|
|
1406
|
+
`A validated shared frame could not be restored: ${String(restorationFailure)}`,
|
|
1407
|
+
);
|
|
1408
|
+
});
|
|
1409
|
+
if (error !== null) {
|
|
1410
|
+
const dueByState = new Map<SceneState, DueScene>();
|
|
1411
|
+
for (const flight of failed)
|
|
1412
|
+
for (const item of flight.due) dueByState.set(item.state, item);
|
|
1413
|
+
const due = [...dueByState.values()];
|
|
1414
|
+
let isolated = false;
|
|
1415
|
+
for (const item of due) {
|
|
1416
|
+
if (
|
|
1417
|
+
item.state.disposed ||
|
|
1418
|
+
(item.staged
|
|
1419
|
+
? item.state.staged !== item.scene
|
|
1420
|
+
: item.state.current !== item.scene)
|
|
1421
|
+
)
|
|
1422
|
+
continue;
|
|
1423
|
+
try {
|
|
1424
|
+
await this.serializeGpu(() =>
|
|
1425
|
+
this.frame(
|
|
1426
|
+
item.sceneId,
|
|
1427
|
+
item.state,
|
|
1428
|
+
item.scene,
|
|
1429
|
+
performance.now(),
|
|
1430
|
+
),
|
|
1431
|
+
);
|
|
1432
|
+
} catch (sceneError) {
|
|
1433
|
+
isolated = true;
|
|
1434
|
+
if (item.staged && item.state.staged === item.scene) {
|
|
1435
|
+
item.state.staged = null;
|
|
1436
|
+
item.state.stagedSignature = null;
|
|
1437
|
+
} else if (!item.staged)
|
|
1438
|
+
item.state.failedGeneration = item.scene.generation;
|
|
1439
|
+
this.error(
|
|
1440
|
+
item.sceneId,
|
|
1441
|
+
sceneError,
|
|
1442
|
+
undefined,
|
|
1443
|
+
item.scene.generation,
|
|
1444
|
+
);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
if (!isolated && due[0])
|
|
1448
|
+
this.error(
|
|
1449
|
+
due[0].sceneId,
|
|
1450
|
+
new NativeWorkerSceneError(
|
|
1451
|
+
"gpu-batch-validation",
|
|
1452
|
+
`The shared GPU batch failed validation before individual scenes recovered: ${String(error)}`,
|
|
1453
|
+
),
|
|
1454
|
+
undefined,
|
|
1455
|
+
due[0].scene.generation,
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
} finally {
|
|
1459
|
+
for (const flight of failed)
|
|
1460
|
+
for (const item of flight.items) item.state.busy = false;
|
|
1461
|
+
this.flightRecovery = false;
|
|
1462
|
+
this.secondFlightUnavailable = false;
|
|
1463
|
+
this.finishFlightWaiters();
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
private cadenceForRate(
|
|
1468
|
+
rate: 60 | 120,
|
|
1469
|
+
compact = false,
|
|
1470
|
+
): NativePreviewPolicyController {
|
|
1471
|
+
const key = compact ? "compact" : rate;
|
|
1472
|
+
let cadence = this.animationCadence.get(key);
|
|
1040
1473
|
if (!cadence) {
|
|
1041
1474
|
cadence = new NativePreviewPolicyController();
|
|
1042
1475
|
cadence.setPolicy({ quality: "quality", frameRateTarget: rate });
|
|
1043
|
-
|
|
1476
|
+
cadence.setOverviewCompact(compact);
|
|
1477
|
+
this.animationCadence.set(key, cadence);
|
|
1044
1478
|
}
|
|
1045
1479
|
return cadence;
|
|
1046
1480
|
}
|
|
@@ -1262,7 +1696,7 @@ export class NativeWorkerRuntime {
|
|
|
1262
1696
|
if (message.type === "visibility") {
|
|
1263
1697
|
state.visible = message.visible;
|
|
1264
1698
|
if (!state.visible)
|
|
1265
|
-
void this.
|
|
1699
|
+
void this.withExclusiveGpu(async () => {
|
|
1266
1700
|
if (!state.disposed && !state.visible)
|
|
1267
1701
|
state.gpu.reject(state.gpu.frontBank());
|
|
1268
1702
|
}).catch((error) => this.error(sceneId, error));
|
|
@@ -1276,10 +1710,11 @@ export class NativeWorkerRuntime {
|
|
|
1276
1710
|
if (message.type === "asset") {
|
|
1277
1711
|
const key = NativeWorkerGpu.assetKey(message.assetId, message.revision);
|
|
1278
1712
|
state.unclaimedAssets.set(key, message.generation);
|
|
1279
|
-
const task = this.
|
|
1713
|
+
const task = this.withExclusiveGpu(async () => {
|
|
1280
1714
|
state.gpu.device.pushErrorScope("validation");
|
|
1281
1715
|
let scopeOpen = true;
|
|
1282
1716
|
try {
|
|
1717
|
+
state.gpu.retireIdleWorkForAssetUpload(message);
|
|
1283
1718
|
state.gpu.uploadAsset(message);
|
|
1284
1719
|
const validation = await state.gpu.device.popErrorScope();
|
|
1285
1720
|
scopeOpen = false;
|
|
@@ -1324,7 +1759,9 @@ export class NativeWorkerRuntime {
|
|
|
1324
1759
|
if (message.type === "dispose") {
|
|
1325
1760
|
state.disposed = true;
|
|
1326
1761
|
if (!state.busy)
|
|
1327
|
-
void this.
|
|
1762
|
+
void this.withExclusiveGpu(async () =>
|
|
1763
|
+
this.disposeScene(sceneId, state),
|
|
1764
|
+
).catch((error) => this.error(sceneId, error));
|
|
1328
1765
|
if (!this.hasScheduledWork() && this.timer !== null) {
|
|
1329
1766
|
cancelAnimationFrame(this.timer);
|
|
1330
1767
|
this.timer = null;
|
|
@@ -1366,6 +1803,25 @@ export class NativeWorkerRuntime {
|
|
|
1366
1803
|
}
|
|
1367
1804
|
return;
|
|
1368
1805
|
}
|
|
1806
|
+
if (message.type === "camera") {
|
|
1807
|
+
try {
|
|
1808
|
+
const scene = checkedCamera(message, state);
|
|
1809
|
+
state.staged = scene;
|
|
1810
|
+
state.stagedSignature = state.currentSignature;
|
|
1811
|
+
state.stagedAnchorMs = performance.now();
|
|
1812
|
+
state.failedGeneration = null;
|
|
1813
|
+
this.post({
|
|
1814
|
+
type: "scene-staged",
|
|
1815
|
+
sceneId,
|
|
1816
|
+
generation: scene.generation,
|
|
1817
|
+
sourceEpoch: scene.sourceEpoch,
|
|
1818
|
+
});
|
|
1819
|
+
this.schedule();
|
|
1820
|
+
} catch (error) {
|
|
1821
|
+
this.error(sceneId, error, undefined, message.generation);
|
|
1822
|
+
}
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1369
1825
|
if (message.type === "export-scene") {
|
|
1370
1826
|
try {
|
|
1371
1827
|
await this.validateUploads(message.scene, state);
|
|
@@ -1410,7 +1866,8 @@ export class NativeWorkerRuntime {
|
|
|
1410
1866
|
!state.disposed &&
|
|
1411
1867
|
(state.exports.length ||
|
|
1412
1868
|
(state.visible &&
|
|
1413
|
-
(state.staged
|
|
1869
|
+
((state.staged &&
|
|
1870
|
+
(!this.sceneHasFlight(state) || state.staged.clock.playing)) ||
|
|
1414
1871
|
(state.current?.clock.playing &&
|
|
1415
1872
|
state.failedGeneration !== state.current.generation))))
|
|
1416
1873
|
)
|
|
@@ -1419,7 +1876,17 @@ export class NativeWorkerRuntime {
|
|
|
1419
1876
|
}
|
|
1420
1877
|
|
|
1421
1878
|
private schedule(): void {
|
|
1422
|
-
if (
|
|
1879
|
+
if (
|
|
1880
|
+
this.timer !== null ||
|
|
1881
|
+
this.pumpBusy ||
|
|
1882
|
+
this.flightRecovery ||
|
|
1883
|
+
this.pendingExclusiveOperations > 0 ||
|
|
1884
|
+
this.recordingFlights > 0 ||
|
|
1885
|
+
this.flightWaiters.length > 0 ||
|
|
1886
|
+
this.flights.length === 2 ||
|
|
1887
|
+
(this.flights.length > 0 && this.secondFlightUnavailable) ||
|
|
1888
|
+
!this.hasScheduledWork()
|
|
1889
|
+
)
|
|
1423
1890
|
return;
|
|
1424
1891
|
this.timer = requestAnimationFrame((now) => {
|
|
1425
1892
|
this.timer = null;
|
|
@@ -1431,8 +1898,20 @@ export class NativeWorkerRuntime {
|
|
|
1431
1898
|
if (this.pumpBusy) return;
|
|
1432
1899
|
this.pumpBusy = true;
|
|
1433
1900
|
try {
|
|
1901
|
+
const needsExclusive =
|
|
1902
|
+
this.pendingExclusiveOperations > 0 ||
|
|
1903
|
+
[...this.scenes.values()].some(
|
|
1904
|
+
(state) =>
|
|
1905
|
+
!state.disposed &&
|
|
1906
|
+
(state.exports.length > 0 ||
|
|
1907
|
+
(state.visible &&
|
|
1908
|
+
state.staged !== null &&
|
|
1909
|
+
(state.current === null ||
|
|
1910
|
+
state.stagedSignature !== state.currentSignature))),
|
|
1911
|
+
);
|
|
1912
|
+
if (this.flights.length && needsExclusive) return;
|
|
1434
1913
|
const due: DueScene[] = [];
|
|
1435
|
-
const dueRates = new Map<60 | 120, boolean>();
|
|
1914
|
+
const dueRates = new Map<60 | 120 | "compact", boolean>();
|
|
1436
1915
|
for (const [sceneId, state] of this.scenes) {
|
|
1437
1916
|
const staged =
|
|
1438
1917
|
state.staged !== null &&
|
|
@@ -1441,79 +1920,97 @@ export class NativeWorkerRuntime {
|
|
|
1441
1920
|
state.stagedSignature === state.currentSignature;
|
|
1442
1921
|
const scene = staged ? state.staged : state.current;
|
|
1443
1922
|
if (!scene || !state.visible || state.disposed) continue;
|
|
1923
|
+
if (
|
|
1924
|
+
staged &&
|
|
1925
|
+
this.sceneHasFlight(state) &&
|
|
1926
|
+
(!scene.clock.playing ||
|
|
1927
|
+
!this.flights.some((flight) =>
|
|
1928
|
+
flight.items.some(
|
|
1929
|
+
(item) =>
|
|
1930
|
+
item.state === state &&
|
|
1931
|
+
((item.staged && item.scene === scene) ||
|
|
1932
|
+
(item.scene === state.current &&
|
|
1933
|
+
compatibleCameraContent(item.scene, scene))),
|
|
1934
|
+
),
|
|
1935
|
+
))
|
|
1936
|
+
)
|
|
1937
|
+
continue;
|
|
1444
1938
|
if (!staged && !scene.clock.playing) continue;
|
|
1445
1939
|
if (state.failedGeneration === scene.generation) continue;
|
|
1446
|
-
state.cadence.setPolicy({
|
|
1447
|
-
quality: "quality",
|
|
1448
|
-
frameRateTarget: scene.frameRateTarget ?? 60,
|
|
1449
|
-
});
|
|
1450
1940
|
const rate = scene.frameRateTarget ?? 60;
|
|
1451
|
-
|
|
1941
|
+
const compact = scene.compact === true;
|
|
1942
|
+
state.cadence.setPolicy({ quality: "quality", frameRateTarget: rate });
|
|
1943
|
+
state.cadence.setOverviewCompact(compact);
|
|
1944
|
+
const key = compact ? "compact" : rate;
|
|
1945
|
+
if (!dueRates.has(key))
|
|
1452
1946
|
dueRates.set(
|
|
1453
|
-
|
|
1454
|
-
this.cadenceForRate(rate).isSubmissionDue(now, false, 2),
|
|
1947
|
+
key,
|
|
1948
|
+
this.cadenceForRate(rate, compact).isSubmissionDue(now, false, 2),
|
|
1455
1949
|
);
|
|
1456
|
-
if (dueRates.get(
|
|
1950
|
+
if (dueRates.get(key)) due.push({ sceneId, state, scene, staged });
|
|
1457
1951
|
}
|
|
1458
|
-
if (due.length) {
|
|
1952
|
+
if (due.length && !needsExclusive) {
|
|
1459
1953
|
for (const item of due) item.state.busy = true;
|
|
1460
|
-
const priorFrames = new Map(
|
|
1461
|
-
due.map((item) => [item.state, item.state.frame]),
|
|
1462
|
-
);
|
|
1463
1954
|
try {
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
if (
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1955
|
+
this.recordingFlights++;
|
|
1956
|
+
let flight: BatchFlight | null;
|
|
1957
|
+
try {
|
|
1958
|
+
flight = await this.serializeGpu(() => this.recordFlight(due, now));
|
|
1959
|
+
if (flight) this.flights.push(flight);
|
|
1960
|
+
} finally {
|
|
1961
|
+
this.recordingFlights--;
|
|
1962
|
+
this.finishFlightWaiters();
|
|
1963
|
+
}
|
|
1964
|
+
if (flight) {
|
|
1965
|
+
await this.serializeGpu(() => this.presentFlight(flight));
|
|
1966
|
+
const committedCadences = new Set<NativePreviewPolicyController>();
|
|
1967
|
+
for (const item of flight.items) {
|
|
1968
|
+
const cadence = this.cadenceForRate(
|
|
1969
|
+
item.scene.frameRateTarget ?? 60,
|
|
1970
|
+
item.scene.compact === true,
|
|
1478
1971
|
);
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
item.state.staged = null;
|
|
1483
|
-
item.state.stagedSignature = null;
|
|
1484
|
-
} else if (!item.staged)
|
|
1485
|
-
item.state.failedGeneration = item.scene.generation;
|
|
1486
|
-
this.error(item.sceneId, error, undefined, item.scene.generation);
|
|
1972
|
+
if (committedCadences.has(cadence)) continue;
|
|
1973
|
+
committedCadences.add(cadence);
|
|
1974
|
+
cadence.commitSubmission(now, false);
|
|
1487
1975
|
}
|
|
1976
|
+
void this.settleFlights();
|
|
1977
|
+
} else if (this.flights.length) {
|
|
1978
|
+
this.secondFlightUnavailable = true;
|
|
1488
1979
|
}
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
)
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
)
|
|
1980
|
+
} catch (error) {
|
|
1981
|
+
if (this.flights.length) {
|
|
1982
|
+
this.pendingFlightFailure = error;
|
|
1983
|
+
void this.settleFlights();
|
|
1984
|
+
} else {
|
|
1985
|
+
for (const item of due) {
|
|
1986
|
+
if (item.state.disposed) continue;
|
|
1987
|
+
try {
|
|
1988
|
+
await this.serializeGpu(() =>
|
|
1989
|
+
this.frame(item.sceneId, item.state, item.scene, now),
|
|
1990
|
+
);
|
|
1991
|
+
} catch (sceneError) {
|
|
1992
|
+
if (item.staged && item.state.staged === item.scene) {
|
|
1993
|
+
item.state.staged = null;
|
|
1994
|
+
item.state.stagedSignature = null;
|
|
1995
|
+
} else if (!item.staged)
|
|
1996
|
+
item.state.failedGeneration = item.scene.generation;
|
|
1997
|
+
this.error(
|
|
1998
|
+
item.sceneId,
|
|
1999
|
+
sceneError,
|
|
2000
|
+
undefined,
|
|
2001
|
+
item.scene.generation,
|
|
2002
|
+
);
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
1501
2005
|
}
|
|
1502
2006
|
} finally {
|
|
1503
|
-
for (const
|
|
1504
|
-
|
|
1505
|
-
.filter(
|
|
1506
|
-
(item) =>
|
|
1507
|
-
item.state.frame >
|
|
1508
|
-
(priorFrames.get(item.state) ?? item.state.frame),
|
|
1509
|
-
)
|
|
1510
|
-
.map((item) => item.scene.frameRateTarget ?? 60),
|
|
1511
|
-
))
|
|
1512
|
-
this.cadenceForRate(rate).commitSubmission(now, false);
|
|
1513
|
-
for (const item of due) item.state.busy = false;
|
|
2007
|
+
for (const item of due)
|
|
2008
|
+
if (!this.sceneHasFlight(item.state)) item.state.busy = false;
|
|
1514
2009
|
}
|
|
1515
2010
|
}
|
|
1516
2011
|
|
|
2012
|
+
if (this.flights.length) return;
|
|
2013
|
+
|
|
1517
2014
|
const exports = [...this.scenes].find(
|
|
1518
2015
|
([, state]) => !state.disposed && state.exports.length,
|
|
1519
2016
|
);
|
|
@@ -1555,6 +2052,7 @@ export class NativeWorkerRuntime {
|
|
|
1555
2052
|
quality: "quality",
|
|
1556
2053
|
frameRateTarget: scene.frameRateTarget ?? 60,
|
|
1557
2054
|
});
|
|
2055
|
+
state.cadence.setOverviewCompact(scene.compact === true);
|
|
1558
2056
|
if (!state.cadence.isSubmissionDue(now, true, 2)) continue;
|
|
1559
2057
|
this.stagedCursor = (index + 1) % scenes.length;
|
|
1560
2058
|
state.busy = true;
|
|
@@ -1582,157 +2080,153 @@ export class NativeWorkerRuntime {
|
|
|
1582
2080
|
}
|
|
1583
2081
|
}
|
|
1584
2082
|
|
|
1585
|
-
private async
|
|
2083
|
+
private async recordFlight(
|
|
1586
2084
|
due: readonly DueScene[],
|
|
1587
2085
|
now: number,
|
|
1588
|
-
): Promise<
|
|
2086
|
+
): Promise<BatchFlight | null> {
|
|
1589
2087
|
const device = due[0]?.state.gpu.device;
|
|
1590
|
-
if (!device) return;
|
|
2088
|
+
if (!device) return null;
|
|
1591
2089
|
if (due.some((item) => item.state.gpu.device !== device))
|
|
1592
2090
|
throw new NativeWorkerSceneError(
|
|
1593
2091
|
"gpu-shared-device-mismatch",
|
|
1594
2092
|
"The worker batch contains scenes from different GPU devices.",
|
|
1595
2093
|
);
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
final: GPUTexture;
|
|
1600
|
-
renderer: NativeWorkerRenderer;
|
|
1601
|
-
timeSeconds: number;
|
|
1602
|
-
stagedAtStart: NativeWorkerScene | null;
|
|
1603
|
-
currentAtStart: NativeWorkerScene | null;
|
|
1604
|
-
anchorAtStart: number;
|
|
1605
|
-
}
|
|
1606
|
-
> = [];
|
|
1607
|
-
const renderBuffers: GPUCommandBuffer[] = [];
|
|
1608
|
-
device.pushErrorScope("validation");
|
|
1609
|
-
let scopeOpen = true;
|
|
1610
|
-
let renderSubmitted = false;
|
|
2094
|
+
const acquired: Array<DueScene & { lease: NativeWorkerGpuFlightLease }> =
|
|
2095
|
+
[];
|
|
2096
|
+
let acquisitionComplete = false;
|
|
1611
2097
|
try {
|
|
1612
2098
|
for (const item of due) {
|
|
1613
|
-
const { state, scene } = item;
|
|
1614
2099
|
if (
|
|
1615
|
-
state.disposed ||
|
|
1616
|
-
(item.staged
|
|
2100
|
+
item.state.disposed ||
|
|
2101
|
+
(item.staged
|
|
2102
|
+
? item.state.staged !== item.scene
|
|
2103
|
+
: item.state.current !== item.scene)
|
|
1617
2104
|
)
|
|
1618
2105
|
continue;
|
|
1619
|
-
const
|
|
2106
|
+
const result = item.state.gpu.tryAcquireFlight(
|
|
2107
|
+
item.scene,
|
|
2108
|
+
item.staged
|
|
2109
|
+
? item.state.stagedSignature
|
|
2110
|
+
: item.state.currentSignature,
|
|
2111
|
+
);
|
|
2112
|
+
if (result.status === "capacity") {
|
|
2113
|
+
if (this.flights.length) return null;
|
|
2114
|
+
throw new NativeWorkerSceneError(
|
|
2115
|
+
"gpu-flight-capacity",
|
|
2116
|
+
`The first GPU flight could not acquire a candidate: ${result.reason}`,
|
|
2117
|
+
);
|
|
2118
|
+
}
|
|
2119
|
+
acquired.push({ ...item, lease: result.lease });
|
|
2120
|
+
}
|
|
2121
|
+
acquisitionComplete = true;
|
|
2122
|
+
} finally {
|
|
2123
|
+
if (!acquisitionComplete)
|
|
2124
|
+
for (const held of acquired) held.state.gpu.releaseFlight(held.lease);
|
|
2125
|
+
}
|
|
2126
|
+
if (!acquired.length) return null;
|
|
2127
|
+
|
|
2128
|
+
const rendered: FlightItem[] = [];
|
|
2129
|
+
const buffers: GPUCommandBuffer[] = [];
|
|
2130
|
+
let scopeOpen = false;
|
|
2131
|
+
let submitted = false;
|
|
2132
|
+
let failed = false;
|
|
2133
|
+
try {
|
|
2134
|
+
device.pushErrorScope("validation");
|
|
2135
|
+
scopeOpen = true;
|
|
2136
|
+
for (const item of acquired) {
|
|
2137
|
+
const { state, scene, lease } = item;
|
|
1620
2138
|
const stagedAtStart = state.staged;
|
|
1621
2139
|
const currentAtStart = state.current;
|
|
1622
2140
|
const anchorAtStart = item.staged
|
|
1623
2141
|
? state.stagedAnchorMs
|
|
1624
2142
|
: state.anchorMs;
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
);
|
|
1629
|
-
gpu.beginFrame();
|
|
2143
|
+
const signatureAtStart = item.staged
|
|
2144
|
+
? state.stagedSignature
|
|
2145
|
+
: state.currentSignature;
|
|
2146
|
+
state.gpu.beginFrame(lease);
|
|
1630
2147
|
const encoder = device.createCommandEncoder();
|
|
1631
2148
|
const timeSeconds = clockTime(scene, anchorAtStart, now);
|
|
1632
2149
|
const renderer = new NativeWorkerRenderer(
|
|
1633
2150
|
scene,
|
|
1634
2151
|
timeSeconds,
|
|
1635
|
-
gpu,
|
|
1636
|
-
bank,
|
|
2152
|
+
state.gpu,
|
|
2153
|
+
lease.bank,
|
|
1637
2154
|
encoder,
|
|
1638
2155
|
);
|
|
1639
2156
|
const composed = await renderer.render(scene.records);
|
|
1640
|
-
const final = gpu.stageFinal(scene, composed, encoder);
|
|
1641
|
-
gpu.uploadFrame();
|
|
1642
|
-
|
|
2157
|
+
const final = state.gpu.stageFinal(lease, scene, composed, encoder);
|
|
2158
|
+
state.gpu.uploadFrame(lease);
|
|
2159
|
+
buffers.push(encoder.finish());
|
|
1643
2160
|
rendered.push({
|
|
1644
2161
|
...item,
|
|
1645
|
-
bank,
|
|
1646
2162
|
final,
|
|
1647
2163
|
renderer,
|
|
1648
2164
|
timeSeconds,
|
|
1649
2165
|
stagedAtStart,
|
|
1650
2166
|
currentAtStart,
|
|
1651
2167
|
anchorAtStart,
|
|
2168
|
+
signatureAtStart,
|
|
1652
2169
|
});
|
|
1653
2170
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
const
|
|
2171
|
+
device.queue.submit(buffers);
|
|
2172
|
+
submitted = true;
|
|
2173
|
+
for (const item of acquired)
|
|
2174
|
+
item.state.gpu.markFlightSubmitted(item.lease);
|
|
2175
|
+
const validationPromise = device.popErrorScope();
|
|
1659
2176
|
scopeOpen = false;
|
|
2177
|
+
const validation = await validationPromise;
|
|
1660
2178
|
if (validation)
|
|
1661
2179
|
throw new NativeWorkerSceneError("gpu-validation", validation.message);
|
|
2180
|
+
return {
|
|
2181
|
+
items: rendered,
|
|
2182
|
+
due,
|
|
2183
|
+
now,
|
|
2184
|
+
fence: null,
|
|
2185
|
+
presentation: null,
|
|
2186
|
+
presentationSubmittedAtMs: null,
|
|
2187
|
+
};
|
|
1662
2188
|
} catch (error) {
|
|
1663
|
-
|
|
1664
|
-
if (scopeOpen)
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
if (renderSubmitted)
|
|
1674
|
-
try {
|
|
1675
|
-
await device.queue.onSubmittedWorkDone();
|
|
1676
|
-
} catch (queueError) {
|
|
1677
|
-
failure = new NativeWorkerSceneError(
|
|
1678
|
-
"gpu-validation",
|
|
1679
|
-
`Rendering failed while draining GPU work: ${String(error)}; ${String(queueError)}`,
|
|
1680
|
-
);
|
|
1681
|
-
}
|
|
1682
|
-
throw failure;
|
|
2189
|
+
failed = true;
|
|
2190
|
+
if (scopeOpen) await device.popErrorScope();
|
|
2191
|
+
if (submitted) await device.queue.onSubmittedWorkDone();
|
|
2192
|
+
if (
|
|
2193
|
+
!submitted &&
|
|
2194
|
+
this.flights.length &&
|
|
2195
|
+
error instanceof NativeWorkerGpuFlightCapacityError
|
|
2196
|
+
)
|
|
2197
|
+
return null;
|
|
2198
|
+
throw error;
|
|
1683
2199
|
} finally {
|
|
1684
|
-
for (const item of
|
|
2200
|
+
for (const item of acquired) item.state.gpu.finishFrame(item.lease);
|
|
2201
|
+
if (failed)
|
|
2202
|
+
for (const item of acquired) item.state.gpu.releaseFlight(item.lease);
|
|
1685
2203
|
}
|
|
1686
|
-
|
|
2204
|
+
}
|
|
1687
2205
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
item.bank,
|
|
1706
|
-
item.currentAtStart,
|
|
1707
|
-
front,
|
|
1708
|
-
null,
|
|
1709
|
-
);
|
|
1710
|
-
} catch (error) {
|
|
1711
|
-
failure ??= error;
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
if (failure)
|
|
1715
|
-
throw new NativeWorkerSceneError(
|
|
1716
|
-
"presentation-restore-failed",
|
|
1717
|
-
`A validated shared frame could not be restored: ${String(failure)}`,
|
|
1718
|
-
);
|
|
1719
|
-
};
|
|
1720
|
-
device.pushErrorScope("validation");
|
|
1721
|
-
scopeOpen = true;
|
|
1722
|
-
let presentationSubmitted = false;
|
|
2206
|
+
private presentFlight(flight: BatchFlight): Promise<void> {
|
|
2207
|
+
return (flight.presentation ??= this.submitPresentation(flight));
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
private async submitPresentation(flight: BatchFlight): Promise<void> {
|
|
2211
|
+
const device = flight.items[0]?.state.gpu.device;
|
|
2212
|
+
if (!device) return;
|
|
2213
|
+
if (flight.items.some((item) => !this.flightItemCurrent(item))) {
|
|
2214
|
+
flight.fence = device.queue.onSubmittedWorkDone().then(
|
|
2215
|
+
(): FlightFenceResult => ({ status: "completed" }),
|
|
2216
|
+
(error): FlightFenceResult => ({ status: "failed", error }),
|
|
2217
|
+
);
|
|
2218
|
+
return;
|
|
2219
|
+
}
|
|
2220
|
+
const buffers: GPUCommandBuffer[] = [];
|
|
2221
|
+
let scopeOpen = false;
|
|
2222
|
+
let submitted = false;
|
|
1723
2223
|
try {
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
(item.staged
|
|
1729
|
-
? item.state.staged !== item.scene
|
|
1730
|
-
: item.state.current !== item.scene)
|
|
1731
|
-
)
|
|
1732
|
-
continue;
|
|
1733
|
-
prepared.push(item);
|
|
2224
|
+
device.pushErrorScope("validation");
|
|
2225
|
+
scopeOpen = true;
|
|
2226
|
+
for (const item of flight.items) {
|
|
2227
|
+
const gpu = item.state.gpu;
|
|
1734
2228
|
gpu.preparePresentation(item.scene);
|
|
1735
|
-
gpu.beginFrame();
|
|
2229
|
+
gpu.beginFrame(item.lease);
|
|
1736
2230
|
const encoder = device.createCommandEncoder();
|
|
1737
2231
|
const pipeline = await gpu.pipeline(
|
|
1738
2232
|
presentWgsl(item.scene.colorSpace),
|
|
@@ -1741,7 +2235,7 @@ export class NativeWorkerRuntime {
|
|
|
1741
2235
|
2,
|
|
1742
2236
|
);
|
|
1743
2237
|
const bind = gpu.bind(
|
|
1744
|
-
item.bank,
|
|
2238
|
+
item.lease.bank,
|
|
1745
2239
|
"presentation",
|
|
1746
2240
|
pipeline,
|
|
1747
2241
|
item.final,
|
|
@@ -1758,122 +2252,53 @@ export class NativeWorkerRuntime {
|
|
|
1758
2252
|
]),
|
|
1759
2253
|
);
|
|
1760
2254
|
draw(encoder, gpu.context.getCurrentTexture(), pipeline, bind);
|
|
1761
|
-
gpu.uploadFrame();
|
|
1762
|
-
|
|
2255
|
+
gpu.uploadFrame(item.lease);
|
|
2256
|
+
buffers.push(encoder.finish());
|
|
1763
2257
|
}
|
|
1764
|
-
if (
|
|
1765
|
-
device.queue.submit(
|
|
1766
|
-
|
|
2258
|
+
if (flight.items.every((item) => this.flightItemCurrent(item))) {
|
|
2259
|
+
device.queue.submit(buffers);
|
|
2260
|
+
submitted = true;
|
|
2261
|
+
flight.presentationSubmittedAtMs = performance.now();
|
|
1767
2262
|
}
|
|
1768
|
-
const
|
|
2263
|
+
const validationPromise = device.popErrorScope();
|
|
1769
2264
|
scopeOpen = false;
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
"gpu-validation",
|
|
1784
|
-
`Presentation failed and its validation scope failed: ${String(error)}; ${String(scopeError)}`,
|
|
1785
|
-
);
|
|
1786
|
-
}
|
|
1787
|
-
if (renderSubmitted || presentationSubmitted)
|
|
1788
|
-
try {
|
|
1789
|
-
await device.queue.onSubmittedWorkDone();
|
|
1790
|
-
} catch (queueError) {
|
|
1791
|
-
failure = new NativeWorkerSceneError(
|
|
1792
|
-
"gpu-validation",
|
|
1793
|
-
`Presentation failed while draining GPU work: ${String(error)}; ${String(queueError)}`,
|
|
1794
|
-
);
|
|
1795
|
-
}
|
|
1796
|
-
for (const item of prepared) item.state.gpu.finishFrame();
|
|
1797
|
-
await restorePrepared();
|
|
1798
|
-
throw failure;
|
|
1799
|
-
} finally {
|
|
1800
|
-
for (const item of prepared) item.state.gpu.finishFrame();
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
const remainsCurrent = (item: (typeof prepared)[number]) => {
|
|
1804
|
-
const { state, scene } = item;
|
|
1805
|
-
const stagedUnchanged = state.staged === item.stagedAtStart;
|
|
1806
|
-
const compatibleCameraArrived =
|
|
1807
|
-
!item.staged &&
|
|
1808
|
-
item.stagedAtStart === null &&
|
|
1809
|
-
state.staged !== null &&
|
|
1810
|
-
state.currentSignature !== null &&
|
|
1811
|
-
state.stagedSignature === state.currentSignature &&
|
|
1812
|
-
state.staged.sourceEpoch === scene.sourceEpoch &&
|
|
1813
|
-
state.staged.authoredEpoch === scene.authoredEpoch;
|
|
1814
|
-
return (
|
|
1815
|
-
!state.disposed &&
|
|
1816
|
-
state.current === item.currentAtStart &&
|
|
1817
|
-
(stagedUnchanged || compatibleCameraArrived) &&
|
|
1818
|
-
(item.staged ? state.staged === scene : state.current === scene)
|
|
1819
|
-
);
|
|
1820
|
-
};
|
|
1821
|
-
const superseded = prepared.filter((item) => !remainsCurrent(item));
|
|
1822
|
-
if (superseded.length) {
|
|
1823
|
-
try {
|
|
1824
|
-
for (const item of superseded) {
|
|
1825
|
-
if (item.state.disposed) continue;
|
|
1826
|
-
const front = item.state.gpu.frontTexture();
|
|
1827
|
-
if (!front || !item.currentAtStart)
|
|
1828
|
-
throw new NativeWorkerSceneError(
|
|
1829
|
-
"presentation-restore-failed",
|
|
1830
|
-
"The superseded scene has no retained validated frame.",
|
|
1831
|
-
);
|
|
1832
|
-
await this.present(
|
|
1833
|
-
item.state.gpu,
|
|
1834
|
-
item.bank,
|
|
1835
|
-
item.currentAtStart,
|
|
1836
|
-
front,
|
|
1837
|
-
null,
|
|
2265
|
+
const completionPromise = device.queue.onSubmittedWorkDone();
|
|
2266
|
+
flight.fence = Promise.allSettled([
|
|
2267
|
+
validationPromise,
|
|
2268
|
+
completionPromise,
|
|
2269
|
+
]).then(([validation, completion]): FlightFenceResult => {
|
|
2270
|
+
const failures: unknown[] = [];
|
|
2271
|
+
if (validation.status === "rejected") failures.push(validation.reason);
|
|
2272
|
+
else if (validation.value)
|
|
2273
|
+
failures.push(
|
|
2274
|
+
new NativeWorkerSceneError(
|
|
2275
|
+
"gpu-validation",
|
|
2276
|
+
validation.value.message,
|
|
2277
|
+
),
|
|
1838
2278
|
);
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
item.state.gpu.validatePublication(item.bank, item.final);
|
|
2279
|
+
if (completion.status === "rejected") failures.push(completion.reason);
|
|
2280
|
+
return failures.length
|
|
2281
|
+
? {
|
|
2282
|
+
status: "failed",
|
|
2283
|
+
error:
|
|
2284
|
+
failures.length === 1
|
|
2285
|
+
? failures[0]
|
|
2286
|
+
: Object.assign(
|
|
2287
|
+
new NativeWorkerSceneError(
|
|
2288
|
+
"gpu-presentation-failed",
|
|
2289
|
+
`GPU presentation validation and completion both failed: ${failures.map(String).join("; ")}`,
|
|
2290
|
+
),
|
|
2291
|
+
{ errors: failures },
|
|
2292
|
+
),
|
|
2293
|
+
}
|
|
2294
|
+
: { status: "completed" };
|
|
2295
|
+
});
|
|
1857
2296
|
} catch (error) {
|
|
1858
|
-
await
|
|
2297
|
+
if (scopeOpen) await device.popErrorScope();
|
|
2298
|
+
if (submitted) await device.queue.onSubmittedWorkDone();
|
|
1859
2299
|
throw error;
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
const { state, scene, sceneId, bank, final, renderer, timeSeconds } =
|
|
1863
|
-
item;
|
|
1864
|
-
if (superseded.includes(item)) continue;
|
|
1865
|
-
state.gpu.publish(bank, final, scene);
|
|
1866
|
-
if (item.staged) state.anchorMs = item.anchorAtStart;
|
|
1867
|
-
this.completeFrame(
|
|
1868
|
-
sceneId,
|
|
1869
|
-
state,
|
|
1870
|
-
scene,
|
|
1871
|
-
item.staged,
|
|
1872
|
-
now,
|
|
1873
|
-
bank,
|
|
1874
|
-
renderer,
|
|
1875
|
-
timeSeconds,
|
|
1876
|
-
);
|
|
2300
|
+
} finally {
|
|
2301
|
+
for (const item of flight.items) item.state.gpu.finishFrame(item.lease);
|
|
1877
2302
|
}
|
|
1878
2303
|
}
|
|
1879
2304
|
|
|
@@ -1886,17 +2311,19 @@ export class NativeWorkerRuntime {
|
|
|
1886
2311
|
bank: NativeWorkerGpuBank,
|
|
1887
2312
|
renderer: NativeWorkerRenderer,
|
|
1888
2313
|
timeSeconds: number,
|
|
2314
|
+
lease?: NativeWorkerGpuFlightLease,
|
|
2315
|
+
presentationSubmittedAtMs?: number | null,
|
|
1889
2316
|
): void {
|
|
1890
|
-
state.gpu.trimWork(
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
)
|
|
1896
|
-
this.cadenceForRate(
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
);
|
|
2317
|
+
if (lease) state.gpu.trimWork(lease);
|
|
2318
|
+
else state.gpu.trimWork(bank);
|
|
2319
|
+
const cadenceKey = scene.compact
|
|
2320
|
+
? "compact"
|
|
2321
|
+
: (scene.frameRateTarget ?? 60);
|
|
2322
|
+
if (staged && scene.clock.playing && !this.animationCadence.has(cadenceKey))
|
|
2323
|
+
this.cadenceForRate(
|
|
2324
|
+
scene.frameRateTarget ?? 60,
|
|
2325
|
+
scene.compact === true,
|
|
2326
|
+
).commitSubmission(now, false);
|
|
1900
2327
|
if (staged) {
|
|
1901
2328
|
state.current = scene;
|
|
1902
2329
|
state.staged = null;
|
|
@@ -1913,6 +2340,11 @@ export class NativeWorkerRuntime {
|
|
|
1913
2340
|
...(state.current?.requiredAssets ?? []),
|
|
1914
2341
|
...(state.staged?.requiredAssets ?? []),
|
|
1915
2342
|
...state.exports.flatMap((pending) => pending.scene.requiredAssets),
|
|
2343
|
+
...this.flights.flatMap((flight) =>
|
|
2344
|
+
flight.items
|
|
2345
|
+
.filter((item) => item.state === state)
|
|
2346
|
+
.flatMap((item) => item.scene.requiredAssets),
|
|
2347
|
+
),
|
|
1916
2348
|
].map((asset) => NativeWorkerGpu.assetKey(asset.assetId, asset.revision)),
|
|
1917
2349
|
);
|
|
1918
2350
|
for (const key of state.unclaimedAssets.keys()) held.add(key);
|
|
@@ -1925,6 +2357,10 @@ export class NativeWorkerRuntime {
|
|
|
1925
2357
|
frame: state.frame,
|
|
1926
2358
|
timeSeconds,
|
|
1927
2359
|
presentedAtMs: performance.now(),
|
|
2360
|
+
...(presentationSubmittedAtMs !== null &&
|
|
2361
|
+
presentationSubmittedAtMs !== undefined
|
|
2362
|
+
? { presentationSubmittedAtMs }
|
|
2363
|
+
: {}),
|
|
1928
2364
|
...(staged ? { committedInstances: renderer.provenance() } : {}),
|
|
1929
2365
|
});
|
|
1930
2366
|
}
|
|
@@ -2015,6 +2451,7 @@ export class NativeWorkerRuntime {
|
|
|
2015
2451
|
throw error;
|
|
2016
2452
|
} finally {
|
|
2017
2453
|
if (frameOpen) gpu.finishFrame();
|
|
2454
|
+
gpu.endLegacyFlight();
|
|
2018
2455
|
}
|
|
2019
2456
|
}
|
|
2020
2457
|
|
|
@@ -2137,6 +2574,26 @@ export class NativeWorkerRuntime {
|
|
|
2137
2574
|
encoder,
|
|
2138
2575
|
);
|
|
2139
2576
|
const composed = await renderer.renderExport();
|
|
2577
|
+
gpu.uploadFrame();
|
|
2578
|
+
gpu.device.queue.submit([encoder.finish()]);
|
|
2579
|
+
submitted = true;
|
|
2580
|
+
const compositionValidation = await gpu.device.popErrorScope();
|
|
2581
|
+
scopeOpen = false;
|
|
2582
|
+
if (compositionValidation)
|
|
2583
|
+
throw new NativeWorkerSceneError(
|
|
2584
|
+
"gpu-validation",
|
|
2585
|
+
compositionValidation.message,
|
|
2586
|
+
);
|
|
2587
|
+
await gpu.device.queue.onSubmittedWorkDone();
|
|
2588
|
+
gpu.finishFrame();
|
|
2589
|
+
frameOpen = false;
|
|
2590
|
+
gpu.trimWorkExcept(bank, composed);
|
|
2591
|
+
|
|
2592
|
+
gpu.beginFrame();
|
|
2593
|
+
frameOpen = true;
|
|
2594
|
+
gpu.device.pushErrorScope("validation");
|
|
2595
|
+
scopeOpen = true;
|
|
2596
|
+
const outputEncoder = gpu.device.createCommandEncoder();
|
|
2140
2597
|
const output = gpu.texture(
|
|
2141
2598
|
bank,
|
|
2142
2599
|
"export:output",
|
|
@@ -2168,7 +2625,7 @@ export class NativeWorkerRuntime {
|
|
|
2168
2625
|
0,
|
|
2169
2626
|
]),
|
|
2170
2627
|
);
|
|
2171
|
-
draw(
|
|
2628
|
+
draw(outputEncoder, output, pipeline, bind);
|
|
2172
2629
|
const bytesPerRow = Math.ceil((planned.width * 4) / 256) * 256;
|
|
2173
2630
|
readbackBytes = bytesPerRow * planned.height;
|
|
2174
2631
|
gpu.reserveTransient(readbackBytes, "export:readback");
|
|
@@ -2177,13 +2634,13 @@ export class NativeWorkerRuntime {
|
|
|
2177
2634
|
size: readbackBytes,
|
|
2178
2635
|
usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
|
|
2179
2636
|
});
|
|
2180
|
-
|
|
2637
|
+
outputEncoder.copyTextureToBuffer(
|
|
2181
2638
|
{ texture: output },
|
|
2182
2639
|
{ buffer: readback, bytesPerRow },
|
|
2183
2640
|
[planned.width, planned.height],
|
|
2184
2641
|
);
|
|
2185
2642
|
gpu.uploadFrame();
|
|
2186
|
-
gpu.device.queue.submit([
|
|
2643
|
+
gpu.device.queue.submit([outputEncoder.finish()]);
|
|
2187
2644
|
submitted = true;
|
|
2188
2645
|
const validation = await gpu.device.popErrorScope();
|
|
2189
2646
|
scopeOpen = false;
|
|
@@ -2249,10 +2706,11 @@ export class NativeWorkerRuntime {
|
|
|
2249
2706
|
}
|
|
2250
2707
|
if (readbackReserved) cleanup(() => gpu.releaseTransient(readbackBytes));
|
|
2251
2708
|
if (frameOpen) cleanup(() => gpu.finishFrame());
|
|
2252
|
-
if (
|
|
2709
|
+
if (bank) {
|
|
2253
2710
|
const finishedBank = bank;
|
|
2254
|
-
cleanup(() => gpu.
|
|
2711
|
+
cleanup(() => gpu.trimWorkExcept(finishedBank, null));
|
|
2255
2712
|
}
|
|
2713
|
+
cleanup(() => gpu.endLegacyFlight());
|
|
2256
2714
|
state.activeExportId = null;
|
|
2257
2715
|
cancelled = state.cancelled.delete(request.requestId) || cancelled;
|
|
2258
2716
|
const held = new Set(
|