@1agh/maude 2.0.8 → 2.1.1
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/README.md +2 -1
- package/apps/hub/src/project-transactions/kernel.mjs +13 -7
- package/apps/studio/access/closure.ts +86 -10
- package/apps/studio/access/filters.ts +18 -1
- package/apps/studio/access/request.ts +8 -0
- package/apps/studio/acp/design-write-verb.ts +12 -2
- package/apps/studio/acp/env.ts +7 -2
- package/apps/studio/acp/index.ts +15 -4
- package/apps/studio/acp/login-state.ts +22 -5
- package/apps/studio/acp/may-scope.ts +38 -1
- package/apps/studio/acp/plugin-bootstrap.ts +13 -1
- package/apps/studio/acp/probe.ts +11 -4
- package/apps/studio/actions/agents.ts +110 -28
- package/apps/studio/actions/canvas-keys.ts +4 -2
- package/apps/studio/actions/ctx.ts +3 -0
- package/apps/studio/actions/defs/annotation.ts +84 -2
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/edit.ts +13 -0
- package/apps/studio/actions/defs/export.ts +12 -0
- package/apps/studio/actions/defs/sync.ts +18 -0
- package/apps/studio/actions/defs/video.ts +9 -0
- package/apps/studio/actions/documents.ts +6 -1
- package/apps/studio/actions/keymap.gen.ts +147 -9
- package/apps/studio/actions/menu.ts +5 -1
- package/apps/studio/actions/types.ts +4 -2
- package/apps/studio/actions/verbs.ts +9 -0
- package/apps/studio/actions.manifest.json +300 -45
- package/apps/studio/actions.parity.json +19 -1
- package/apps/studio/ai/save-hold.ts +2 -1
- package/apps/studio/ai/write-claim-scope.ts +7 -1
- package/apps/studio/ai/write-claim.ts +154 -3
- package/apps/studio/annotations/ai-read.ts +42 -6
- package/apps/studio/annotations/ai-write.ts +145 -2
- package/apps/studio/annotations/board-ops.ts +34 -3
- package/apps/studio/annotations/checklist-ops.ts +374 -0
- package/apps/studio/annotations/elements/checkitem.model.ts +129 -0
- package/apps/studio/annotations/elements/sticky.model.ts +54 -2
- package/apps/studio/annotations/ops.ts +30 -0
- package/apps/studio/annotations/registry.ts +9 -1
- package/apps/studio/annotations/templates.ts +4 -2
- package/apps/studio/annotations/text-steps.ts +114 -10
- package/apps/studio/annotations/ui/checklist-wire.ts +129 -0
- package/apps/studio/annotations/ui/checklist.tsx +429 -0
- package/apps/studio/annotations/ui/element-node.tsx +48 -2
- package/apps/studio/annotations/ui/template-place.ts +11 -1
- package/apps/studio/annotations/v1-adapter.ts +22 -3
- package/apps/studio/annotations-context-toolbar.tsx +12 -0
- package/apps/studio/annotations-layer.tsx +442 -49
- package/apps/studio/annotations-model.ts +4 -2
- package/apps/studio/api.ts +148 -21
- package/apps/studio/artboard-live-gate.tsx +54 -17
- package/apps/studio/artboard-still-persist.ts +166 -0
- package/apps/studio/artboard-still-raster.ts +6 -2
- package/apps/studio/artboard-still.ts +390 -20
- package/apps/studio/asset-added.ts +154 -0
- package/apps/studio/asset-details.ts +46 -3
- package/apps/studio/asset-origins.ts +5 -3
- package/apps/studio/asset-trash.ts +6 -1
- package/apps/studio/bin/_agent-browser-safe.mjs +3 -4
- package/apps/studio/bin/_annotate-post.mjs +14 -5
- package/apps/studio/bin/_audio-search.mjs +8 -2
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/bin/_desktop-locate.sh +145 -0
- package/apps/studio/bin/_ds-check-live.mjs +2 -1
- package/apps/studio/bin/_exports.mjs +38 -2
- package/apps/studio/bin/_history.mjs +79 -8
- package/apps/studio/bin/_import-asset.mjs +14 -9
- package/apps/studio/bin/_import-figma.mjs +510 -98
- package/apps/studio/bin/_index-cli.mjs +10 -21
- package/apps/studio/bin/_ingest-footage.mjs +24 -6
- package/apps/studio/bin/_media-probe.mjs +232 -0
- package/apps/studio/bin/_perf-probe-open.mjs +6 -0
- package/apps/studio/bin/_perf-probe-safari.mjs +6 -0
- package/apps/studio/bin/_perf-probe-studio.mjs +6 -1
- package/apps/studio/bin/_perf-probe.mjs +8 -3
- package/apps/studio/bin/_perf-sweep-shared.mjs +789 -0
- package/apps/studio/bin/_perf-sweep.mjs +240 -0
- package/apps/studio/bin/_record-shot.sh +33 -8
- package/apps/studio/bin/_screenshot-playwright.mjs +45 -2
- package/apps/studio/bin/_studio-verb.mjs +8 -3
- package/apps/studio/bin/_thumb-route.mjs +21 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +83 -1
- package/apps/studio/bin/_transcribe.mjs +22 -6
- package/apps/studio/bin/_unsynced-refs.mjs +22 -0
- package/apps/studio/bin/_url-guard.mjs +120 -5
- package/apps/studio/bin/_url-guard.sh +29 -7
- package/apps/studio/bin/_video-limits.mjs +104 -0
- package/apps/studio/bin/_video-playwright.mjs +119 -19
- package/apps/studio/bin/_video-proxy.mjs +130 -0
- package/apps/studio/bin/_write-claim.mjs +38 -16
- package/apps/studio/bin/annotate.mjs +12 -2
- package/apps/studio/bin/canvas-rects.sh +19 -4
- package/apps/studio/bin/chat-open.sh +7 -1
- package/apps/studio/bin/draw-proof.sh +6 -2
- package/apps/studio/bin/generate.sh +32 -10
- package/apps/studio/bin/handoff.sh +2 -2
- package/apps/studio/bin/perf.sh +96 -15
- package/apps/studio/bin/photo-adjust.sh +6 -3
- package/apps/studio/bin/photo-bg-remove.sh +2 -2
- package/apps/studio/bin/prep.sh +21 -4
- package/apps/studio/bin/read-annotations.mjs +3 -0
- package/apps/studio/bin/runtime-health.sh +27 -1
- package/apps/studio/bin/screenshot.sh +152 -12
- package/apps/studio/bin/server-up.sh +64 -6
- package/apps/studio/bin/smoke.sh +43 -8
- package/apps/studio/bin/to-lottie.sh +3 -2
- package/apps/studio/bin/video-proxy.sh +27 -0
- package/apps/studio/bin/visual-sanity.sh +3 -1
- package/apps/studio/bridge/dgn-protocol.ts +157 -1
- package/apps/studio/bridge/mode-shows.ts +8 -6
- package/apps/studio/bridge/still-webp.ts +233 -0
- package/apps/studio/build.ts +18 -0
- package/apps/studio/canvas-build.ts +93 -11
- package/apps/studio/canvas-comment-mount.tsx +53 -8
- package/apps/studio/canvas-edit.ts +34 -1
- package/apps/studio/canvas-lib-module.ts +210 -0
- package/apps/studio/canvas-lib.tsx +3 -12
- package/apps/studio/canvas-pipeline.ts +111 -5
- package/apps/studio/canvas-shell.tsx +8 -11
- package/apps/studio/canvas-theme-pill.tsx +5 -3
- package/apps/studio/check/index.ts +12 -5
- package/apps/studio/check/video.ts +18 -2
- package/apps/studio/client/app.jsx +65 -7
- package/apps/studio/client/clipboard-relay.ts +193 -16
- package/apps/studio/client/comments-overlay.css +18 -0
- package/apps/studio/client/export-center.jsx +30 -0
- package/apps/studio/client/generate-dialog.jsx +49 -4
- package/apps/studio/client/github.js +7 -0
- package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
- package/apps/studio/client/home/HomeConnection.jsx +111 -0
- package/apps/studio/client/home/home-accounts-model.js +110 -1
- package/apps/studio/client/home/home-api.js +9 -2
- package/apps/studio/client/home/home-app.jsx +126 -13
- package/apps/studio/client/home/home-model.js +69 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +239 -1
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +173 -98
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +5 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/DiffView.jsx +7 -1
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/panels/chat-context.js +2 -0
- package/apps/studio/client/panels/slash-commands.gen.js +13 -13
- package/apps/studio/client/selection-scope.js +16 -9
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/shell/viewport.jsx +11 -1
- package/apps/studio/client/shell-events.js +8 -0
- package/apps/studio/client/styles/3-kit-maude-v2.css +16 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/ai/Feed.jsx +1 -1
- package/apps/studio/client/v2/ai/OfferCard.jsx +34 -0
- package/apps/studio/client/v2/ai/activity-line.js +54 -1
- package/apps/studio/client/v2/ai/ai-offer.js +21 -1
- package/apps/studio/client/v2/ai/run-model.js +3 -1
- package/apps/studio/client/v2/annotations/vote-store.js +28 -4
- package/apps/studio/client/v2/assets/asset-drop-session.js +37 -2
- package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +7 -5
- package/apps/studio/client/v2/assets/details-model.js +1 -1
- package/apps/studio/client/v2/assets/details.jsx +5 -0
- package/apps/studio/client/v2/assets/tile-drag.js +11 -7
- package/apps/studio/client/v2/comments/comments-panel.jsx +22 -3
- package/apps/studio/client/v2/create/duplicate-done.js +6 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +113 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +343 -6
- package/apps/studio/client/v2/diagnostics/sync-details/unsynced-refs.js +55 -0
- package/apps/studio/client/v2/ds/review.css +1 -1
- package/apps/studio/client/v2/export/exports-model.js +7 -0
- package/apps/studio/client/v2/export/exports-panel.jsx +1 -0
- package/apps/studio/client/v2/export/job-row.jsx +32 -2
- package/apps/studio/client/v2/handoff/ready-card.jsx +1 -1
- package/apps/studio/client/v2/history/compare-view.jsx +1 -0
- package/apps/studio/client/v2/inspector/css-write.js +6 -1
- package/apps/studio/client/v2/inspector/frame.jsx +28 -4
- package/apps/studio/client/v2/inspector/kinds/clip-model.js +51 -0
- package/apps/studio/client/v2/inspector/kinds/clip.jsx +75 -2
- package/apps/studio/client/v2/inspector/model.js +21 -0
- package/apps/studio/client/v2/inspector/sections/fill.jsx +12 -3
- package/apps/studio/client/v2/inspector/sections/recent-colours.js +8 -5
- package/apps/studio/client/v2/inspector/view-mode.jsx +11 -1
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/preview/link-follow.js +4 -2
- package/apps/studio/client/v2/preview/preview-chrome-host.jsx +16 -6
- package/apps/studio/client/v2/search/help-model.js +2 -0
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +344 -137
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +155 -24
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +100 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/share/share-sheet.jsx +28 -11
- package/apps/studio/client/v2/shell/api-session-boot.js +6 -0
- package/apps/studio/client/v2/shell/api-session.js +126 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/floating-panels.css +31 -1
- package/apps/studio/client/v2/shell/image-pick.js +61 -8
- package/apps/studio/client/v2/shell/menu-aim.js +43 -0
- package/apps/studio/client/v2/shell/menu-runner.js +25 -7
- package/apps/studio/client/v2/shell/occlusion-insets.js +18 -1
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/project-pill.jsx +52 -6
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +71 -36
- package/apps/studio/client/v2/shell/still-bridge.js +194 -0
- package/apps/studio/client/v2/shell/still-store.js +319 -0
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/shell/use-tool-panels.js +2 -1
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/client/v2/timeline/Timeline.jsx +15 -0
- package/apps/studio/client/v2/timeline/frame-handle-model.js +142 -0
- package/apps/studio/client/v2/timeline/frame-handle.jsx +151 -0
- package/apps/studio/clip-ops.ts +126 -8
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/collab/ai-activity.ts +10 -8
- package/apps/studio/collab/awareness-bridge.ts +34 -9
- package/apps/studio/collab/index.ts +3 -0
- package/apps/studio/collab/registry.ts +41 -10
- package/apps/studio/comment-reattach.ts +149 -0
- package/apps/studio/comments/mine-stamp.ts +15 -7
- package/apps/studio/comments/ops.ts +52 -8
- package/apps/studio/comments-overlay.tsx +146 -9
- package/apps/studio/dist/client.bundle.js +892 -885
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/dom-selection.ts +87 -18
- package/apps/studio/ds/board/directions.css +8 -0
- package/apps/studio/ds/board/outline.tsx +16 -0
- package/apps/studio/ds/canvas-check.ts +6 -0
- package/apps/studio/edit-ops/clip/reframe.ts +19 -3
- package/apps/studio/edit-ops/clip-carry.ts +602 -0
- package/apps/studio/edit-ops/clipboard.ts +318 -23
- package/apps/studio/edit-ops/dispatch.ts +20 -2
- package/apps/studio/edit-ops/scope-names.ts +249 -40
- package/apps/studio/edit-ops/slot-defaults.ts +3 -0
- package/apps/studio/edit-ops/types.ts +6 -0
- package/apps/studio/editing/align-bar.tsx +33 -9
- package/apps/studio/editing/artboard-actions.ts +5 -0
- package/apps/studio/editing/artboard-menu.tsx +6 -2
- package/apps/studio/editing/click-to-type.ts +1 -1
- package/apps/studio/editing/clip-words.ts +48 -0
- package/apps/studio/editing/clipboard.ts +21 -6
- package/apps/studio/editing/declared-background.ts +25 -0
- package/apps/studio/editing/index.tsx +3 -0
- package/apps/studio/editing/object-keys.ts +4 -4
- package/apps/studio/editing/object-menu.tsx +13 -3
- package/apps/studio/editing/pen/points.tsx +61 -0
- package/apps/studio/editing/text-in-place.tsx +11 -0
- package/apps/studio/editing/video-frame-handle.tsx +425 -0
- package/apps/studio/exporters/capture-prepass.ts +374 -0
- package/apps/studio/exporters/degraded.ts +148 -0
- package/apps/studio/exporters/hub-render-door.ts +28 -2
- package/apps/studio/exporters/index.ts +3 -1
- package/apps/studio/exporters/job-budget.ts +93 -0
- package/apps/studio/exporters/jobs.ts +215 -28
- package/apps/studio/exporters/parity-check.ts +254 -0
- package/apps/studio/exporters/remote.ts +209 -15
- package/apps/studio/exporters/svg-inline.ts +87 -0
- package/apps/studio/exporters/video-render-lib.ts +88 -26
- package/apps/studio/exporters/video.ts +29 -6
- package/apps/studio/figma/assets.ts +58 -43
- package/apps/studio/figma/codegen-fonts.ts +100 -0
- package/apps/studio/figma/fig-decode.ts +390 -25
- package/apps/studio/figma/fig-kiwi.ts +18 -4
- package/apps/studio/figma/fig-vector.ts +59 -3
- package/apps/studio/figma/sanitize.ts +2 -0
- package/apps/studio/figma/style-map.ts +293 -48
- package/apps/studio/figma/to-artboard.ts +455 -69
- package/apps/studio/figma/to-strokes.ts +44 -11
- package/apps/studio/figma/types.ts +13 -0
- package/apps/studio/footage/schema.ts +3 -3
- package/apps/studio/generation/adapters/elevenlabs.ts +7 -1
- package/apps/studio/generation/adapters/groq.ts +8 -1
- package/apps/studio/generation/spend.ts +312 -0
- package/apps/studio/generation/types.ts +12 -0
- package/apps/studio/handoff/run.ts +1 -1
- package/apps/studio/handoff/targets.ts +2 -2
- package/apps/studio/handoff/write-scopes.ts +1 -1
- package/apps/studio/history/describe-annotations.ts +4 -0
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/create-local.ts +32 -3
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +15 -4
- package/apps/studio/http.ts +438 -86
- package/apps/studio/imported-module-ids.ts +91 -0
- package/apps/studio/inspect.ts +2 -0
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/notifications.tsx +47 -5
- package/apps/studio/paths.ts +10 -1
- package/apps/studio/port.ts +3 -2
- package/apps/studio/preview/preview-camera.tsx +15 -382
- package/apps/studio/readiness.ts +10 -1
- package/apps/studio/release-build.ts +51 -0
- package/apps/studio/routes/agent.ts +188 -9
- package/apps/studio/routes/ai.ts +43 -11
- package/apps/studio/routes/annotations.ts +27 -1
- package/apps/studio/routes/assets.ts +18 -1
- package/apps/studio/routes/canvas-origin.ts +12 -9
- package/apps/studio/routes/cloud-move.ts +15 -0
- package/apps/studio/routes/edit.ts +3 -0
- package/apps/studio/routes/export.ts +51 -0
- package/apps/studio/routes/generate.ts +42 -12
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +9 -1
- package/apps/studio/routes/shell.ts +217 -5
- package/apps/studio/routes/sync.ts +136 -8
- package/apps/studio/routes/votes.ts +2 -1
- package/apps/studio/schema/annotations.v2.schema.json +143 -1
- package/apps/studio/schema/beats.v1.schema.json +1 -1
- package/apps/studio/schema/edl.v1.schema.json +1 -1
- package/apps/studio/schema/formats.ts +3 -3
- package/apps/studio/schema/transcript.v1.schema.json +1 -1
- package/apps/studio/server.ts +142 -43
- package/apps/studio/shell/api-key.ts +503 -0
- package/apps/studio/shell/attest.ts +59 -0
- package/apps/studio/shell/capture-url.ts +20 -0
- package/apps/studio/shell/cli-yield.ts +276 -0
- package/apps/studio/shell/clip-transfer.ts +302 -0
- package/apps/studio/shell/key-file.ts +108 -0
- package/apps/studio/shell/server-json.ts +75 -0
- package/apps/studio/shell/worktree.ts +19 -0
- package/apps/studio/spoof-chars.ts +9 -0
- package/apps/studio/studio-page-host.ts +1 -1
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/accepted-link.ts +76 -29
- package/apps/studio/sync/action-stage.ts +575 -44
- package/apps/studio/sync/adopt-held.ts +85 -0
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-membership.ts +16 -1
- package/apps/studio/sync/file-plane.ts +289 -22
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +196 -12
- package/apps/studio/sync/journal-client.ts +50 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +296 -8
- package/apps/studio/sync/projection.ts +22 -3
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +59 -3
- package/apps/studio/sync/status.ts +19 -2
- package/apps/studio/sync/unsynced-refs.ts +397 -0
- package/apps/studio/sync/writer-registry.ts +20 -0
- package/apps/studio/thumbs/service.ts +4 -1
- package/apps/studio/tool-palette.tsx +23 -0
- package/apps/studio/ui-prefs.ts +40 -0
- package/apps/studio/use-agent-presence.tsx +2 -2
- package/apps/studio/use-canvas-keys.ts +6 -1
- package/apps/studio/video/format-ids.ts +2 -2
- package/apps/studio/video/inject.ts +31 -0
- package/apps/studio/video/media-risk.ts +58 -0
- package/apps/studio/video/object-fit.ts +137 -0
- package/apps/studio/video/provider-transcript.ts +141 -0
- package/apps/studio/whats-new.json +137 -0
- package/apps/studio/workspace-mode.ts +1 -0
- package/apps/studio/ws.ts +5 -0
- package/cli/commands/design.mjs +119 -8
- package/cli/lib/bash-guard.mjs +366 -6
- package/cli/lib/confine-read.mjs +1 -0
- package/cli/lib/design-help.gen.mjs +3 -2
- package/cli/lib/design-hook.mjs +387 -81
- package/cli/lib/design-link.mjs +16 -1
- package/cli/lib/design-open.mjs +49 -3
- package/cli/lib/desktop-locate.mjs +770 -0
- package/cli/lib/handoff.mjs +1 -1
- package/cli/lib/hook-state.mjs +291 -0
- package/cli/lib/pkg-root.mjs +65 -13
- package/cli/lib/studio-locate.mjs +59 -16
- package/package.json +15 -8
- package/plugins/design/templates/_shell.html +13 -0
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# (lottie-react-native) — same renderer family, 1:1 by construction. It is an
|
|
9
9
|
# EMITTER from the keyframe data, NOT a converter of rendered SVG/SMIL (no reliable
|
|
10
10
|
# one exists — DDR-094 research). The generator encodes the 8 conversion rules; see
|
|
11
|
-
# `plugins/design/commands/to-lottie.md` + `references/draw/motion-rules.md`.
|
|
11
|
+
# `plugins/design-video/commands/to-lottie.md` + the design plugin's `references/draw/motion-rules.md`.
|
|
12
12
|
#
|
|
13
13
|
# Reached via `maude design to-lottie` (DDR-062), never a raw bin path.
|
|
14
14
|
#
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
# / 4 verify render failed.
|
|
33
33
|
|
|
34
34
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
35
|
+
. "$SCRIPT_DIR/_url-guard.sh" # maude_redact — log lines never carry a link or a frame capability
|
|
35
36
|
GEN=""
|
|
36
37
|
OUT=""
|
|
37
38
|
VERIFY=0
|
|
@@ -113,7 +114,7 @@ if [ "$VERIFY" -eq 1 ]; then
|
|
|
113
114
|
F_TRIM="$(printf '%s' "$F" | tr -d '[:space:]')"
|
|
114
115
|
URL="http://localhost:$PORT/_to-lottie-verify.html?src=$OUT_BASE&f=$F_TRIM"
|
|
115
116
|
PNG="$FRAMES_DIR/frame-$F_TRIM.png"
|
|
116
|
-
echo "→ verify frame $F_TRIM ($URL)" >&2
|
|
117
|
+
echo "→ verify frame $F_TRIM ($(maude_redact "$URL"))" >&2
|
|
117
118
|
bash "$SCRIPT_DIR/screenshot.sh" --url "$URL" --full --out "$PNG" --timeout "$TIMEOUT" >&2 \
|
|
118
119
|
|| { echo "✗ verify frame $F_TRIM failed" >&2; FAIL=$((FAIL + 1)); }
|
|
119
120
|
done
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# video-proxy.sh — thin shim over _video-proxy.mjs; reached via
|
|
3
|
+
# `maude design video-proxy` (DDR-062), never a raw bin path. Makes an H.264 /
|
|
4
|
+
# constant-frame-rate / single-AAC copy of one video asset next to the original,
|
|
5
|
+
# for a clip that is HEVC, variable frame rate or has a second audio track
|
|
6
|
+
# (#128 §1). See _video-proxy.mjs for the rationale.
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# video-proxy.sh assets/<clip> --root <repo> [--design-root .design]
|
|
10
|
+
#
|
|
11
|
+
# stdout on success = a JSON manifest { source, proxy, reused, found, width, height, fps }.
|
|
12
|
+
# Exit: 0 ok · 2 usage · 3 no ffmpeg · 4 not a readable video · 6 outside assets/ · 1 other.
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
14
|
+
|
|
15
|
+
case "$1" in
|
|
16
|
+
--help|-h) sed -n '2,12p' "$0" | sed 's/^# \?//'; exit 0 ;;
|
|
17
|
+
esac
|
|
18
|
+
|
|
19
|
+
# Pure Node ESM (no .ts); prefer node, fall back to bun in a dev tree.
|
|
20
|
+
if command -v node >/dev/null 2>&1; then
|
|
21
|
+
exec node "$SCRIPT_DIR/_video-proxy.mjs" "$@"
|
|
22
|
+
elif command -v bun >/dev/null 2>&1; then
|
|
23
|
+
exec bun run "$SCRIPT_DIR/_video-proxy.mjs" "$@"
|
|
24
|
+
else
|
|
25
|
+
echo "video-proxy.sh: node or bun is required." >&2
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
@@ -179,7 +179,9 @@ declare -a FAILED=()
|
|
|
179
179
|
for s in "${EXISTING[@]}"; do
|
|
180
180
|
REL="system/$DS/preview/${s}.tsx"
|
|
181
181
|
REL_ENC=$(printf '%s' "$REL" | sed 's/ /%20/g')
|
|
182
|
-
|
|
182
|
+
# sec-loopback-bearer §7.3 — asked with the key, so the capture gets its frame capability
|
|
183
|
+
. "$SCRIPT_DIR/_desktop-locate.sh"
|
|
184
|
+
URL="$(studio_capture_url "$ROOT_ABS" "$PORT" "/_canvas-shell.html?canvas=${REL_ENC}")"
|
|
183
185
|
. "$SCRIPT_DIR/_url-guard.sh" && maude_url_guard "$URL" || exit 2 # V2-8.9 B2 — http(s) to this Mac only
|
|
184
186
|
OUT_PNG="$OUT_DIR/${s}.png"
|
|
185
187
|
echo "→ screenshot: $s" >&2
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
} from './canvas-modes.ts';
|
|
35
35
|
import { clampInsets, type Insets } from './occlusion.ts';
|
|
36
36
|
import { parsePasteData } from './paste-data.ts';
|
|
37
|
+
import { stillImageBytes } from './still-webp.ts';
|
|
37
38
|
|
|
38
39
|
export const DGN_V = 2;
|
|
39
40
|
type Id = string;
|
|
@@ -124,6 +125,9 @@ export interface CanvasToShell {
|
|
|
124
125
|
// S10.8 — "Review…" on the Design system canvas's bar: the person asks for "Update N canvases". The canvas
|
|
125
126
|
// only asks; the shell opens the sheet (client/v2/ds/review-host.jsx), for the canvas on screen.
|
|
126
127
|
'ds-review': Empty;
|
|
128
|
+
// #168 F5 — the Light/Dark pill's path button. The canvas only asks; the shell copies the path IT holds for the
|
|
129
|
+
// active frame (the `canvas.copy-file-path` action), never a path the canvas names or could overwrite.
|
|
130
|
+
'copy-canvas-path': Empty;
|
|
127
131
|
// S10.9 (13 · ds-edit-reach) — the answer to a `ds-rects` ask: where each asked element sits, in THIS frame's own
|
|
128
132
|
// pixels (getBoundingClientRect), and the frame's size. The reach view rings them. `label` is the artboard's own
|
|
129
133
|
// name as text (untrusted; rendered as text only).
|
|
@@ -357,6 +361,18 @@ export interface CanvasToShell {
|
|
|
357
361
|
word?: string;
|
|
358
362
|
}>;
|
|
359
363
|
};
|
|
364
|
+
/**
|
|
365
|
+
* #128 §5 (T3.6b) — the on-canvas pan / zoom handle let go: where the person left the picture of the clip the shell
|
|
366
|
+
* named (`video-frame-handle`). `zoom` 1–8, `focus` the picture point under the frame's centre (fractions). The shell
|
|
367
|
+
* turns it into ONE `video.reframe` through the Timeline's clip pipe — the inspector's Zoom / Focus write.
|
|
368
|
+
*/
|
|
369
|
+
'video-frame-commit': {
|
|
370
|
+
v: 1;
|
|
371
|
+
artboardId: Id;
|
|
372
|
+
stableId: string;
|
|
373
|
+
zoom: number;
|
|
374
|
+
focus: [number, number];
|
|
375
|
+
};
|
|
360
376
|
/**
|
|
361
377
|
* S2.19 (14 `ed-edge-ask`) — ⌘/ with elements selected: which (`refs`, with the canvas's locators for the
|
|
362
378
|
* prompt's `[selected: …]` lines) and where (`rect`, iframe viewport px). The SHELL draws the bubble and owns
|
|
@@ -383,6 +399,10 @@ export interface CanvasToShell {
|
|
|
383
399
|
cause: 'key' | 'esc' | 'inspect' | 'toolbar' | 'link';
|
|
384
400
|
};
|
|
385
401
|
'toolbar-rect': { mode: CanvasModeV2; rect: Rect | null };
|
|
402
|
+
// #170 (T2.4b) — one of the toolbar's popovers (Shape kinds, More, Sticky colours, Marker tips) is open: they open
|
|
403
|
+
// upward into the dock where the shell's toast pill sits, so the shell moves its toasts to the top while one is.
|
|
404
|
+
// One boolean, no rect and no text — nothing here is rendered by the shell.
|
|
405
|
+
'toolbar-popover': { open: boolean };
|
|
386
406
|
'tool-panel-open': {
|
|
387
407
|
// r2-p1 TD10: 'image' = Image (I), the shell's picture picker; 'generate' = the Generate… slot next to it
|
|
388
408
|
panel: 'stickers' | 'components' | 'templates' | 'assets' | 'sizes' | 'image' | 'generate';
|
|
@@ -452,6 +472,12 @@ export interface CanvasToShell {
|
|
|
452
472
|
// shell checks it against its own asset-state answer (`lfs-pointer`) and builds the prompt itself.
|
|
453
473
|
'asset-lfs-fix-request': { rel: string };
|
|
454
474
|
'asset-lfs-copy-request': { rel: string };
|
|
475
|
+
// #212 §5 (T2.2) — the overview stills persist across sessions. The canvas only NAMES an artboard of the canvas
|
|
476
|
+
// its frame shows; the shell picks the key (project, the frame's capability, the index's source hashes) and checks
|
|
477
|
+
// the bytes (bridge/still-webp.ts: a still WebP, or a PNG where the browser encodes no WebP). `file` must equal
|
|
478
|
+
// the shell's own active canvas (contract 212-still-cache §5).
|
|
479
|
+
'stills-want': { file: string };
|
|
480
|
+
'still-put': { file: string; artboard: string; sig: string; bytes: ArrayBuffer };
|
|
455
481
|
}
|
|
456
482
|
|
|
457
483
|
/** S8.19 — one picture's state, as the shell tells the canvas (contract S8-S9-asset-presence §5.5). */
|
|
@@ -604,6 +630,18 @@ export interface ShellToCanvas {
|
|
|
604
630
|
// S7.17 (07 ve-together): the caption word this person is fixing in the shell (the Transcript panel's field) — the
|
|
605
631
|
// canvas publishes it on awareness as a soft lock; `{ artboardId: null }` = they left it.
|
|
606
632
|
'timeline-word': { artboardId: Id | null; wordKey?: string };
|
|
633
|
+
// #128 §5 (T3.6b): the clip the Timeline has selected, for the on-canvas pan / zoom handle over its artboard's video —
|
|
634
|
+
// the source size (null = not known yet), the zoom and the focus the renderer shows at the playhead. `artboardId: null`
|
|
635
|
+
// takes the handle down.
|
|
636
|
+
'video-frame-handle': {
|
|
637
|
+
v: 1;
|
|
638
|
+
artboardId: Id | null;
|
|
639
|
+
stableId?: string;
|
|
640
|
+
label?: string;
|
|
641
|
+
src?: { w: number; h: number } | null;
|
|
642
|
+
zoom?: number;
|
|
643
|
+
focus?: [number, number];
|
|
644
|
+
};
|
|
607
645
|
// S7.24b (08 ak-mixed-fit): the kind filter — the artboards OUTSIDE the chosen kind, for the canvas to draw
|
|
608
646
|
// quiet ("19 other artboards are dimmed"). The shell counts (the index knows each canvas's artboard kinds); the
|
|
609
647
|
// canvas only draws. `null` = dim nothing. ≤ DIM_IDS_MAX ids; a longer list is refused whole.
|
|
@@ -772,6 +810,9 @@ export interface ShellToCanvas {
|
|
|
772
810
|
// selected, ← → are `take-step`, not a nudge. State, not an event: the whole set each time. ≤ 256 items,
|
|
773
811
|
// each an asset path; a planted or oversized list is refused whole.
|
|
774
812
|
'gen-takes': { assets: string[] };
|
|
813
|
+
// #212 §5 (T2.2) — the persisted stills of THIS canvas (the shell's answer to `stills-want`): seeds, shown only once
|
|
814
|
+
// the artboard's own content signature matches `sig` (artboard-still.ts `adopt`). ≤ STILLS_MAX items.
|
|
815
|
+
stills: { file: string; items: Array<{ artboard: string; sig: string; bytes: ArrayBuffer }> };
|
|
775
816
|
}
|
|
776
817
|
|
|
777
818
|
/** r3 — what an Assets drop lands on: a picture or frame (by ref) or the artboard itself (placed loose). */
|
|
@@ -960,6 +1001,35 @@ const wordKeyV: V = (v) => {
|
|
|
960
1001
|
if (/[\u0000-\u001f\u007f]/.test(v) || v.split('|').length < 3) return BAD;
|
|
961
1002
|
return v;
|
|
962
1003
|
};
|
|
1004
|
+
/** #128 §5 (T3.6b) — a clip's `stableId` (`name:…`, `mclip:…`, `Comp#3`): bounded, no control characters. */
|
|
1005
|
+
export const CLIP_ID_MAX = 200;
|
|
1006
|
+
const clipIdV: V = (v) =>
|
|
1007
|
+
typeof v === 'string' &&
|
|
1008
|
+
v.length > 0 &&
|
|
1009
|
+
v.length <= CLIP_ID_MAX &&
|
|
1010
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: the point is to refuse them
|
|
1011
|
+
!/[\u0000-\u001f\u007f]/.test(v)
|
|
1012
|
+
? v
|
|
1013
|
+
: BAD;
|
|
1014
|
+
/** The handle's zoom: the `<Reframe zoom>` range the op takes (1–8). */
|
|
1015
|
+
const frameZoomV: V = (v) =>
|
|
1016
|
+
typeof v === 'number' && Number.isFinite(v) && v >= 1 && v <= 8 ? v : BAD;
|
|
1017
|
+
/** A focus point: exactly two fractions of the picture. */
|
|
1018
|
+
const unitPairV: V = (v) =>
|
|
1019
|
+
Array.isArray(v) && v.length === 2 && unit(v[0]) !== BAD && unit(v[1]) !== BAD
|
|
1020
|
+
? [v[0], v[1]]
|
|
1021
|
+
: BAD;
|
|
1022
|
+
/** A picture's own size in px (a source frame), never 0 or past 64k. */
|
|
1023
|
+
const picSizeV: V = (v) =>
|
|
1024
|
+
isPlain(v) &&
|
|
1025
|
+
typeof v.w === 'number' &&
|
|
1026
|
+
typeof v.h === 'number' &&
|
|
1027
|
+
v.w > 0 &&
|
|
1028
|
+
v.h > 0 &&
|
|
1029
|
+
v.w <= 65536 &&
|
|
1030
|
+
v.h <= 65536
|
|
1031
|
+
? { w: v.w, h: v.h }
|
|
1032
|
+
: BAD;
|
|
963
1033
|
/** `timeline-peers` (S7.17): a planted or oversized list is REJECTED whole, never trimmed. */
|
|
964
1034
|
const timelinePeerList: V = (v) => {
|
|
965
1035
|
if (!Array.isArray(v) || v.length > PEERS_MAX) return BAD;
|
|
@@ -1176,7 +1246,15 @@ const aiSeenList: V = (v) =>
|
|
|
1176
1246
|
: BAD;
|
|
1177
1247
|
|
|
1178
1248
|
/** S9.22 — the comment bridge. The op names the door takes (comments/ops.ts `parseCommentOp`). */
|
|
1179
|
-
export const COMMENT_OPS = [
|
|
1249
|
+
export const COMMENT_OPS = [
|
|
1250
|
+
'add',
|
|
1251
|
+
'reply',
|
|
1252
|
+
'resolve',
|
|
1253
|
+
'reopen',
|
|
1254
|
+
'edit-own',
|
|
1255
|
+
'delete-own',
|
|
1256
|
+
'reattach',
|
|
1257
|
+
] as const;
|
|
1180
1258
|
/** S4.V4 G5 — the sticky ↔ comment conversion asks the thread makes; the SHELL answers them (S4.7 routes,
|
|
1181
1259
|
* its own session conversion map), never the comment door. `{ op, commentId }` only. */
|
|
1182
1260
|
export const COMMENT_CONVERT_OPS = ['to-sticky', 'convert-undo', 'convert-undoable'] as const;
|
|
@@ -1227,6 +1305,18 @@ const genTakeAssets: V = (v) =>
|
|
|
1227
1305
|
? v.slice()
|
|
1228
1306
|
: BAD;
|
|
1229
1307
|
|
|
1308
|
+
/** #212 §5 — a persisted still: a real still WebP or single-image PNG (bridge/still-webp.ts), copied, else junk. */
|
|
1309
|
+
const stillBytesV: V = (v) => stillImageBytes(v) ?? BAD;
|
|
1310
|
+
/** #212 §5 — an artboard id as the canvas names it (no control characters), and a still's signature. */
|
|
1311
|
+
const stillArtboardV: V = (v) =>
|
|
1312
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: the point is to refuse them
|
|
1313
|
+
typeof v === 'string' && v.length >= 1 && v.length <= 200 && !/[\u0000-\u001f\u007f]/.test(v)
|
|
1314
|
+
? v
|
|
1315
|
+
: BAD;
|
|
1316
|
+
export const STILL_SIG_MAX = 200;
|
|
1317
|
+
/** #212 §5 — the most stills one answer carries (the store's per-canvas cap). */
|
|
1318
|
+
export const STILLS_MAX = 2000;
|
|
1319
|
+
|
|
1230
1320
|
/** A top-level parser over exactly the interface's keys (the type pins the key set). */
|
|
1231
1321
|
function p<T>(
|
|
1232
1322
|
fields: NoInfer<{ [K in keyof Required<T>]: V }>
|
|
@@ -1302,6 +1392,8 @@ const c2s: C2S = {
|
|
|
1302
1392
|
},
|
|
1303
1393
|
// S10.8 — handled by client/v2/ds/use-ds-frames.js (opens the review for the ACTIVE canvas's system)
|
|
1304
1394
|
'ds-review': { gate: 'active', status: 'live', owner: 'h/use-ds-frames', parse: none },
|
|
1395
|
+
// #168 F5 — the bridge runs `canvas.copy-file-path` for the active tab
|
|
1396
|
+
'copy-canvas-path': { gate: 'active', status: 'live', owner: BR, parse: none },
|
|
1305
1397
|
// S10.9 — sent by the shell template's `ds-rects` region, read by client/v2/ds/reach-view.jsx (the frames it
|
|
1306
1398
|
// framed itself, hence 'frame': a reach frame is never the active canvas)
|
|
1307
1399
|
'ds-rects-result': {
|
|
@@ -1800,6 +1892,19 @@ const c2s: C2S = {
|
|
|
1800
1892
|
owner: 'v2/timeline/peers (S7.17)',
|
|
1801
1893
|
parse: p({ peers: timelinePeerList }),
|
|
1802
1894
|
},
|
|
1895
|
+
// #128 §5 (T3.6b) — the active canvas's pan / zoom handle let go; the shell writes it as one video.reframe.
|
|
1896
|
+
'video-frame-commit': {
|
|
1897
|
+
gate: 'active',
|
|
1898
|
+
status: 'live',
|
|
1899
|
+
owner: 'v2/timeline/frame-handle (T3.6b)',
|
|
1900
|
+
parse: p({
|
|
1901
|
+
v: lit(1),
|
|
1902
|
+
artboardId: linkArtboardIdV,
|
|
1903
|
+
stableId: clipIdV,
|
|
1904
|
+
zoom: frameZoomV,
|
|
1905
|
+
focus: unitPairV,
|
|
1906
|
+
}),
|
|
1907
|
+
},
|
|
1803
1908
|
'ask-selection': {
|
|
1804
1909
|
gate: 'active',
|
|
1805
1910
|
status: 'live',
|
|
@@ -1853,6 +1958,12 @@ const c2s: C2S = {
|
|
|
1853
1958
|
owner: 'tool-palette (V2-4.5a); shell tool panels (V2-4.5c)',
|
|
1854
1959
|
parse: p({ mode, rect: nul(rect) }),
|
|
1855
1960
|
},
|
|
1961
|
+
'toolbar-popover': {
|
|
1962
|
+
gate: 'active',
|
|
1963
|
+
status: 'live',
|
|
1964
|
+
owner: 'tool-palette (#170 T2.4b); h/use-canvas-bridge → notifications (toast placement)',
|
|
1965
|
+
parse: p({ open: bool }),
|
|
1966
|
+
},
|
|
1856
1967
|
'tool-panel-open': {
|
|
1857
1968
|
gate: 'active',
|
|
1858
1969
|
status: 'live',
|
|
@@ -1998,6 +2109,24 @@ const c2s: C2S = {
|
|
|
1998
2109
|
owner: 'client/v2/assets/asset-state-lane (2.0.3 LFS placeholder)',
|
|
1999
2110
|
parse: p({ rel: shortStr(512) }),
|
|
2000
2111
|
},
|
|
2112
|
+
// #212 §5 — the shell also requires `file === activePath` and a plain open (client/v2/shell/still-bridge.js).
|
|
2113
|
+
'stills-want': {
|
|
2114
|
+
gate: 'active',
|
|
2115
|
+
status: 'live',
|
|
2116
|
+
owner: 'client/v2/shell/still-bridge (#212 §5)',
|
|
2117
|
+
parse: p({ file: shortStr(1024) }),
|
|
2118
|
+
},
|
|
2119
|
+
'still-put': {
|
|
2120
|
+
gate: 'active',
|
|
2121
|
+
status: 'live',
|
|
2122
|
+
owner: 'client/v2/shell/still-bridge (#212 §5)',
|
|
2123
|
+
parse: p({
|
|
2124
|
+
file: shortStr(1024),
|
|
2125
|
+
artboard: stillArtboardV,
|
|
2126
|
+
sig: shortStr(STILL_SIG_MAX),
|
|
2127
|
+
bytes: stillBytesV,
|
|
2128
|
+
}),
|
|
2129
|
+
},
|
|
2001
2130
|
};
|
|
2002
2131
|
|
|
2003
2132
|
const s2c: S2C = {
|
|
@@ -2332,6 +2461,21 @@ const s2c: S2C = {
|
|
|
2332
2461
|
owner: 'collab/timeline-presence (S7.17)',
|
|
2333
2462
|
parse: p({ artboardId: nul(linkArtboardIdV), wordKey: opt(wordKeyV) }),
|
|
2334
2463
|
},
|
|
2464
|
+
// #128 §5 (T3.6b) — the selected clip for the on-canvas pan / zoom handle (editing/video-frame-handle). Parent only.
|
|
2465
|
+
'video-frame-handle': {
|
|
2466
|
+
gate: 'parent',
|
|
2467
|
+
status: 'live',
|
|
2468
|
+
owner: 'editing/video-frame-handle (T3.6b)',
|
|
2469
|
+
parse: p({
|
|
2470
|
+
v: lit(1),
|
|
2471
|
+
artboardId: nul(linkArtboardIdV),
|
|
2472
|
+
stableId: opt(clipIdV),
|
|
2473
|
+
label: opt(shortStr(120)),
|
|
2474
|
+
src: opt(nul(picSizeV)),
|
|
2475
|
+
zoom: opt(frameZoomV),
|
|
2476
|
+
focus: opt(unitPairV),
|
|
2477
|
+
}),
|
|
2478
|
+
},
|
|
2335
2479
|
// S7.24b — the kind filter's dimming: ids of the artboards outside the kind, or null. Parent only; capped.
|
|
2336
2480
|
'dim-artboards': {
|
|
2337
2481
|
gate: 'parent',
|
|
@@ -2638,6 +2782,18 @@ const s2c: S2C = {
|
|
|
2638
2782
|
owner: 'editing/take-keys (S8.16, L1)',
|
|
2639
2783
|
parse: p({ assets: genTakeAssets }),
|
|
2640
2784
|
},
|
|
2785
|
+
stills: {
|
|
2786
|
+
gate: 'parent',
|
|
2787
|
+
status: 'live',
|
|
2788
|
+
owner: 'artboard-still-persist (#212 §5)',
|
|
2789
|
+
parse: p({
|
|
2790
|
+
file: shortStr(1024),
|
|
2791
|
+
items: capped(
|
|
2792
|
+
STILLS_MAX,
|
|
2793
|
+
arrOf(shape({ artboard: stillArtboardV, sig: shortStr(STILL_SIG_MAX), bytes: stillBytesV }))
|
|
2794
|
+
),
|
|
2795
|
+
}),
|
|
2796
|
+
},
|
|
2641
2797
|
};
|
|
2642
2798
|
|
|
2643
2799
|
export const DGN_TABLE: { c2s: C2S; s2c: S2C } = { c2s, s2c };
|
|
@@ -63,10 +63,11 @@ export const MODE_SHOWS = Object.freeze({
|
|
|
63
63
|
measure: row('on', 'on', 'off', 'off', 'on'),
|
|
64
64
|
/** A8 — what an AI write does on the canvas: `held` only in Present · Artboards. */
|
|
65
65
|
'ai-changes': row('live', 'live', 'held', 'live-unmarked', 'live'),
|
|
66
|
-
/** Shell: the Canvases (left) panel.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
/** Shell: the Canvases (left) panel. #163 (Michal): a mode switch changes only the toolbar, so Preview keeps
|
|
67
|
+
* the panels where the person left them; it never folds them to their corner icons (⌘\ is the person's). */
|
|
68
|
+
'left-panels': row('shown', 'shown', 'hidden', 'hidden', 'shown'),
|
|
69
|
+
/** Shell: the AI chat panel (C30: a viewing role has none). Shown in Preview too (#163). */
|
|
70
|
+
'ai-panel': row('shown', 'shown', 'hidden', 'hidden', 'none'),
|
|
70
71
|
/** Shell: the Share cluster. `full-access` = full, with the access word. r2-p3 (Michal TD1d): a mode switch
|
|
71
72
|
* changes only the toolbar, so Preview keeps Edit's full cluster (faces, status word, avatar); `compact`
|
|
72
73
|
* (faces + status step aside) is no mode's cell any more. */
|
|
@@ -160,8 +161,9 @@ export const holdsAiChanges = (
|
|
|
160
161
|
present?: Pick<PresentSpec, 'kind'> | null
|
|
161
162
|
): boolean => modeCell('ai-changes', mode, present) === 'held';
|
|
162
163
|
|
|
163
|
-
/**
|
|
164
|
+
/** Does a mode fold the Canvases / AI chat panels to their corner icons? None does since #163 (Present hides). */
|
|
164
165
|
export const foldsPanels = (
|
|
165
166
|
mode: CanvasModeV2,
|
|
166
167
|
present?: Pick<PresentSpec, 'kind'> | null
|
|
167
|
-
|
|
168
|
+
// the table holds no `folded` cell any more; the read stays, so a row that folds again needs no new code
|
|
169
|
+
): boolean => (modeCell('left-panels', mode, present) as string) === 'folded';
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// apps/studio/bridge/still-webp.ts — #212 §5 (T2.2): is this buffer a still (WebP or PNG) of an overview still?
|
|
2
|
+
//
|
|
3
|
+
// The bytes come from the untrusted canvas origin (DDR-054) and are stored by the shell across sessions
|
|
4
|
+
// (client/v2/shell/still-store.js), so they are checked by what they ARE, never by what the frame says:
|
|
5
|
+
// for WebP the RIFF container, the first chunk's bitstream header and the size it encodes; for PNG (WebKit encodes
|
|
6
|
+
// no WebP) a structural chunk walk and the IHDR size. Nothing is decoded.
|
|
7
|
+
// Leaf module (no imports): the dgn table (both documents) and the shell store share it.
|
|
8
|
+
//
|
|
9
|
+
// Contract: client/v2/contracts/212-still-cache.md §5 "Bytes".
|
|
10
|
+
|
|
11
|
+
/** The most bytes one persisted still may have (measured: ~18 kB at 400 px). */
|
|
12
|
+
export const STILL_PERSIST_MAX_BYTES = 256 * 1024;
|
|
13
|
+
/** The largest still the overview draws: `stillWidthPx` (400) × `RASTER_MAX_HEIGHT_PX` (1600), +1 px rounding. */
|
|
14
|
+
export const STILL_PERSIST_MAX_W = 401;
|
|
15
|
+
export const STILL_PERSIST_MAX_H = 1601;
|
|
16
|
+
|
|
17
|
+
export type StillWebpCheck =
|
|
18
|
+
| { ok: true; w: number; h: number }
|
|
19
|
+
| {
|
|
20
|
+
ok: false;
|
|
21
|
+
reason:
|
|
22
|
+
| 'not-bytes'
|
|
23
|
+
| 'empty'
|
|
24
|
+
| 'too-large'
|
|
25
|
+
| 'not-webp'
|
|
26
|
+
| 'bad-size'
|
|
27
|
+
| 'bad-chunk'
|
|
28
|
+
| 'animated'
|
|
29
|
+
| 'too-big';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const u8 = (v: unknown): Uint8Array | null => {
|
|
33
|
+
if (v instanceof Uint8Array) return v;
|
|
34
|
+
if (v instanceof ArrayBuffer) return new Uint8Array(v);
|
|
35
|
+
// a buffer from another realm (a structured clone keeps the class name)
|
|
36
|
+
if (v && typeof v === 'object' && Object.prototype.toString.call(v) === '[object ArrayBuffer]')
|
|
37
|
+
return new Uint8Array(v as ArrayBuffer);
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
const tag = (b: Uint8Array, i: number) => String.fromCharCode(b[i], b[i + 1], b[i + 2], b[i + 3]);
|
|
41
|
+
const le32 = (b: Uint8Array, i: number) =>
|
|
42
|
+
(b[i] | (b[i + 1] << 8) | (b[i + 2] << 16) | (b[i + 3] << 24)) >>> 0;
|
|
43
|
+
const le24 = (b: Uint8Array, i: number) => b[i] | (b[i + 1] << 8) | (b[i + 2] << 16);
|
|
44
|
+
|
|
45
|
+
/** Check a candidate still: a real, single-frame WebP no bigger than the overview ever draws. */
|
|
46
|
+
export function checkStillWebp(v: unknown): StillWebpCheck {
|
|
47
|
+
const b = u8(v);
|
|
48
|
+
if (!b) return { ok: false, reason: 'not-bytes' };
|
|
49
|
+
if (b.length === 0) return { ok: false, reason: 'empty' };
|
|
50
|
+
if (b.length > STILL_PERSIST_MAX_BYTES) return { ok: false, reason: 'too-large' };
|
|
51
|
+
if (b.length < 30 || tag(b, 0) !== 'RIFF' || tag(b, 8) !== 'WEBP')
|
|
52
|
+
return { ok: false, reason: 'not-webp' };
|
|
53
|
+
// the RIFF size names exactly this buffer (+ one pad byte at most): nothing trails the image
|
|
54
|
+
const riff = le32(b, 4);
|
|
55
|
+
if (riff + 8 !== b.length && riff + 9 !== b.length) return { ok: false, reason: 'bad-size' };
|
|
56
|
+
const chunk = tag(b, 12);
|
|
57
|
+
const len = le32(b, 16);
|
|
58
|
+
if (len < 10 || 20 + len > b.length) return { ok: false, reason: 'bad-chunk' };
|
|
59
|
+
let w = 0;
|
|
60
|
+
let h = 0;
|
|
61
|
+
if (chunk === 'VP8 ') {
|
|
62
|
+
// frame tag (3 bytes, bit 0 = 0 for a key frame), then the start code 9d 01 2a, then 14-bit width / height
|
|
63
|
+
if ((b[20] & 1) !== 0 || b[23] !== 0x9d || b[24] !== 0x01 || b[25] !== 0x2a)
|
|
64
|
+
return { ok: false, reason: 'bad-chunk' };
|
|
65
|
+
w = (b[26] | (b[27] << 8)) & 0x3fff;
|
|
66
|
+
h = (b[28] | (b[29] << 8)) & 0x3fff;
|
|
67
|
+
} else if (chunk === 'VP8L') {
|
|
68
|
+
if (b[20] !== 0x2f) return { ok: false, reason: 'bad-chunk' };
|
|
69
|
+
const bits = le32(b, 21);
|
|
70
|
+
w = (bits & 0x3fff) + 1;
|
|
71
|
+
h = ((bits >>> 14) & 0x3fff) + 1;
|
|
72
|
+
if (bits >>> 29 !== 0) return { ok: false, reason: 'bad-chunk' }; // version 0 only
|
|
73
|
+
} else if (chunk === 'VP8X') {
|
|
74
|
+
// flags: bit 1 = animation — a still is one frame
|
|
75
|
+
if ((b[20] & 0x02) !== 0) return { ok: false, reason: 'animated' };
|
|
76
|
+
w = le24(b, 24) + 1;
|
|
77
|
+
h = le24(b, 27) + 1;
|
|
78
|
+
} else return { ok: false, reason: 'bad-chunk' };
|
|
79
|
+
if (!(w > 0 && h > 0)) return { ok: false, reason: 'bad-chunk' };
|
|
80
|
+
if (w > STILL_PERSIST_MAX_W || h > STILL_PERSIST_MAX_H) return { ok: false, reason: 'too-big' };
|
|
81
|
+
return { ok: true, w, h };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ─── PNG (WebKit has no WebP encoder: `toBlob(cb, 'image/webp')` answers `image/png` on Safari / Tauri) ───────
|
|
85
|
+
|
|
86
|
+
export type StillPngCheck =
|
|
87
|
+
| { ok: true; w: number; h: number }
|
|
88
|
+
| {
|
|
89
|
+
ok: false;
|
|
90
|
+
reason:
|
|
91
|
+
| 'not-bytes'
|
|
92
|
+
| 'empty'
|
|
93
|
+
| 'too-large'
|
|
94
|
+
| 'not-png'
|
|
95
|
+
| 'bad-size'
|
|
96
|
+
| 'bad-chunk'
|
|
97
|
+
| 'animated'
|
|
98
|
+
| 'too-big';
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const PNG_SIG = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
|
|
102
|
+
const be32 = (b: Uint8Array, i: number) =>
|
|
103
|
+
((b[i] << 24) | (b[i + 1] << 16) | (b[i + 2] << 8) | b[i + 3]) >>> 0;
|
|
104
|
+
/** The chunks a canvas encoder writes (WebKit: IHDR sRGB eXIf IDAT… IEND); any other chunk refuses the still. */
|
|
105
|
+
// Kept to what a canvas encoder writes: no iCCP (an untrusted compressed ICC profile the decoder would inflate and
|
|
106
|
+
// parse), no text chunks. Interlace is refused too — a canvas encoder never writes Adam7.
|
|
107
|
+
const PNG_ANCILLARY = new Set(['sRGB', 'gAMA', 'cHRM', 'pHYs', 'sBIT', 'bKGD', 'tRNS', 'eXIf']);
|
|
108
|
+
/** APNG: a still is one image. */
|
|
109
|
+
const PNG_ANIMATION = new Set(['acTL', 'fcTL', 'fdAT']);
|
|
110
|
+
/** Bit depths allowed per colour type (PNG spec, table 11.1). */
|
|
111
|
+
const PNG_DEPTHS: Record<number, number[]> = {
|
|
112
|
+
0: [1, 2, 4, 8, 16],
|
|
113
|
+
2: [8, 16],
|
|
114
|
+
3: [1, 2, 4, 8],
|
|
115
|
+
4: [8, 16],
|
|
116
|
+
6: [8, 16],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Check a candidate still: a single-image PNG no bigger than the overview ever draws. A structural walk, CRC-free
|
|
121
|
+
* (nothing here decodes, the canvas does in its own origin): the signature; IHDR first, 13 bytes, its size within the
|
|
122
|
+
* caps and a valid depth / colour type / method triple; every chunk's length within what is left of the buffer (an
|
|
123
|
+
* integer compare against the remaining bytes, never `off + len`); only the chunks a canvas encoder writes, one IDAT
|
|
124
|
+
* run; no APNG chunk; IEND empty and the very last bytes — nothing trails the image.
|
|
125
|
+
*/
|
|
126
|
+
export function checkStillPng(v: unknown): StillPngCheck {
|
|
127
|
+
const b = u8(v);
|
|
128
|
+
if (!b) return { ok: false, reason: 'not-bytes' };
|
|
129
|
+
if (b.length === 0) return { ok: false, reason: 'empty' };
|
|
130
|
+
if (b.length > STILL_PERSIST_MAX_BYTES) return { ok: false, reason: 'too-large' };
|
|
131
|
+
// signature + IHDR (12 + 13) + IEND (12)
|
|
132
|
+
if (b.length < 8 + 25 + 12 || PNG_SIG.some((x, i) => b[i] !== x))
|
|
133
|
+
return { ok: false, reason: 'not-png' };
|
|
134
|
+
let off = 8;
|
|
135
|
+
let first = true;
|
|
136
|
+
let w = 0;
|
|
137
|
+
let h = 0;
|
|
138
|
+
let palette = false;
|
|
139
|
+
let plte = false;
|
|
140
|
+
let idat: 'none' | 'in' | 'done' = 'none';
|
|
141
|
+
for (;;) {
|
|
142
|
+
const left = b.length - off;
|
|
143
|
+
if (left < 12) return { ok: false, reason: 'bad-chunk' }; // a chunk is at least length + type + CRC
|
|
144
|
+
const len = be32(b, off);
|
|
145
|
+
if (len > left - 12) return { ok: false, reason: 'bad-chunk' };
|
|
146
|
+
const type = tag(b, off + 4);
|
|
147
|
+
const d = off + 8;
|
|
148
|
+
if (!/^[A-Za-z]{4}$/.test(type)) return { ok: false, reason: 'bad-chunk' };
|
|
149
|
+
if (first) {
|
|
150
|
+
if (type !== 'IHDR' || len !== 13) return { ok: false, reason: 'bad-chunk' };
|
|
151
|
+
w = be32(b, d);
|
|
152
|
+
h = be32(b, d + 4);
|
|
153
|
+
const depth = b[d + 8];
|
|
154
|
+
const color = b[d + 9];
|
|
155
|
+
if (!(PNG_DEPTHS[color] ?? []).includes(depth)) return { ok: false, reason: 'bad-chunk' };
|
|
156
|
+
// compression 0, filter 0, interlace 0 (none — a canvas encoder never writes Adam7)
|
|
157
|
+
if (b[d + 10] !== 0 || b[d + 11] !== 0 || b[d + 12] !== 0)
|
|
158
|
+
return { ok: false, reason: 'bad-chunk' };
|
|
159
|
+
if (!(w > 0 && h > 0)) return { ok: false, reason: 'bad-chunk' };
|
|
160
|
+
if (w > STILL_PERSIST_MAX_W || h > STILL_PERSIST_MAX_H)
|
|
161
|
+
return { ok: false, reason: 'too-big' };
|
|
162
|
+
palette = color === 3;
|
|
163
|
+
first = false;
|
|
164
|
+
} else if (type === 'IEND') {
|
|
165
|
+
if (len !== 0 || idat === 'none' || (palette && !plte))
|
|
166
|
+
return { ok: false, reason: 'bad-chunk' };
|
|
167
|
+
if (d + 4 !== b.length) return { ok: false, reason: 'bad-size' };
|
|
168
|
+
return { ok: true, w, h };
|
|
169
|
+
} else if (type === 'IDAT') {
|
|
170
|
+
if (idat === 'done') return { ok: false, reason: 'bad-chunk' };
|
|
171
|
+
idat = 'in';
|
|
172
|
+
} else if (PNG_ANIMATION.has(type)) {
|
|
173
|
+
return { ok: false, reason: 'animated' };
|
|
174
|
+
} else if (type === 'PLTE' || PNG_ANCILLARY.has(type)) {
|
|
175
|
+
if (idat === 'in') idat = 'done';
|
|
176
|
+
if (type === 'PLTE') {
|
|
177
|
+
if (plte || idat !== 'none' || len === 0 || len > 768 || len % 3 !== 0)
|
|
178
|
+
return { ok: false, reason: 'bad-chunk' };
|
|
179
|
+
plte = true;
|
|
180
|
+
}
|
|
181
|
+
} else return { ok: false, reason: 'bad-chunk' }; // a second IHDR, text, an unknown or private chunk
|
|
182
|
+
off = d + len + 4;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// ─── either format ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
export type StillFormat = 'webp' | 'png';
|
|
188
|
+
export type StillImageCheck =
|
|
189
|
+
| { ok: true; format: StillFormat; w: number; h: number }
|
|
190
|
+
| {
|
|
191
|
+
ok: false;
|
|
192
|
+
reason: Exclude<StillWebpCheck, { ok: true }>['reason'] | 'not-image' | 'not-png';
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Check a candidate still in the format its first bytes name — WebP (Chromium, Firefox) or PNG (WebKit) — and
|
|
197
|
+
* report that format, so the canvas decodes it with the right MIME. Bytes that are neither are `not-image`.
|
|
198
|
+
*/
|
|
199
|
+
export function checkStillImage(v: unknown): StillImageCheck {
|
|
200
|
+
const b = u8(v);
|
|
201
|
+
if (b && b.length >= 8 && PNG_SIG.every((x, i) => b[i] === x)) {
|
|
202
|
+
const r = checkStillPng(b);
|
|
203
|
+
return r.ok ? { ok: true, format: 'png', w: r.w, h: r.h } : r;
|
|
204
|
+
}
|
|
205
|
+
if (b && b.length >= 12 && tag(b, 0) === 'RIFF' && tag(b, 8) === 'WEBP') {
|
|
206
|
+
const r = checkStillWebp(b);
|
|
207
|
+
return r.ok ? { ok: true, format: 'webp', w: r.w, h: r.h } : r;
|
|
208
|
+
}
|
|
209
|
+
if (!b) return { ok: false, reason: 'not-bytes' };
|
|
210
|
+
if (b.length === 0) return { ok: false, reason: 'empty' };
|
|
211
|
+
if (b.length > STILL_PERSIST_MAX_BYTES) return { ok: false, reason: 'too-large' };
|
|
212
|
+
return { ok: false, reason: 'not-image' };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** The MIME of a still's bytes (`image/webp` | `image/png`), or null when they are not a still. */
|
|
216
|
+
export function stillMime(v: unknown): 'image/webp' | 'image/png' | null {
|
|
217
|
+
const r = checkStillImage(v);
|
|
218
|
+
return r.ok ? (r.format === 'png' ? 'image/png' : 'image/webp') : null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** The buffer when it is a still (WebP or PNG; a fresh copy, so a later write to the sender's view cannot change it), else null. */
|
|
222
|
+
export function stillImageBytes(v: unknown): ArrayBuffer | null {
|
|
223
|
+
if (!checkStillImage(v).ok) return null;
|
|
224
|
+
const b = u8(v) as Uint8Array;
|
|
225
|
+
return b.slice().buffer;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** The buffer when it is a still WebP (a fresh copy), else null. WebP only; the bridge uses `stillImageBytes`. */
|
|
229
|
+
export function stillWebpBytes(v: unknown): ArrayBuffer | null {
|
|
230
|
+
if (!checkStillWebp(v).ok) return null;
|
|
231
|
+
const b = u8(v) as Uint8Array;
|
|
232
|
+
return b.slice().buffer;
|
|
233
|
+
}
|
package/apps/studio/build.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
22
22
|
import { browserslistToTargets, bundle as lcssBundle } from 'lightningcss';
|
|
23
23
|
|
|
24
24
|
import { cloudStubPlugin } from './cloud-build.ts';
|
|
25
|
+
import { releaseDefines } from './release-build.ts';
|
|
25
26
|
|
|
26
27
|
const ROOT = dirname(fileURLToPath(import.meta.url));
|
|
27
28
|
|
|
@@ -64,6 +65,21 @@ const WATCH = ARGS.has('--watch');
|
|
|
64
65
|
/** Cloud Phase 27 D1 — build the CELL's variant (secret-bearing surfaces
|
|
65
66
|
* removed from the binary, not merely un-routed). `--cloud` with `--release`. */
|
|
66
67
|
const CLOUD = ARGS.has('--cloud');
|
|
68
|
+
/** #168 — the desktop e2e lane's sidecar: a `--release` binary that keeps the `MAUDE_E2E_*` switches. Every other
|
|
69
|
+
* `--release` build (CI, the npm platform packages, the cell) bakes `__MAUDE_RELEASE_BUILD__` and ignores them
|
|
70
|
+
* (release-build.ts). Never passed by a workflow; the cloud variant refuses it. */
|
|
71
|
+
const E2E_SIDECAR = ARGS.has('--e2e');
|
|
72
|
+
if (E2E_SIDECAR && (CLOUD || MODE !== 'release')) {
|
|
73
|
+
console.error(
|
|
74
|
+
'[build] --e2e only applies to a plain --release server binary (not --cloud, not dev).'
|
|
75
|
+
);
|
|
76
|
+
process.exit(2);
|
|
77
|
+
}
|
|
78
|
+
const RELEASE_DEFINES = releaseDefines({
|
|
79
|
+
release: MODE === 'release',
|
|
80
|
+
e2e: E2E_SIDECAR,
|
|
81
|
+
cloud: CLOUD,
|
|
82
|
+
});
|
|
67
83
|
|
|
68
84
|
const PLATFORM_MATRIX = [
|
|
69
85
|
'bun-darwin-arm64',
|
|
@@ -442,6 +458,7 @@ async function buildServerBinary(
|
|
|
442
458
|
entrypoints: [entry],
|
|
443
459
|
target: 'bun',
|
|
444
460
|
minify: true,
|
|
461
|
+
define: RELEASE_DEFINES,
|
|
445
462
|
plugins: [cloudStubPlugin(ROOT)],
|
|
446
463
|
compile: { target, outfile: outPath },
|
|
447
464
|
} as Parameters<typeof Bun.build>[0]);
|
|
@@ -460,6 +477,7 @@ async function buildServerBinary(
|
|
|
460
477
|
'--minify',
|
|
461
478
|
'--sourcemap',
|
|
462
479
|
'--smol',
|
|
480
|
+
...Object.entries(RELEASE_DEFINES).map(([k, v]) => `--define=${k}=${v}`),
|
|
463
481
|
`--outfile=${outPath}`,
|
|
464
482
|
entry,
|
|
465
483
|
],
|