@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
|
@@ -1,274 +1,15 @@
|
|
|
1
|
-
// apps/studio/preview/preview-camera.tsx —
|
|
1
|
+
// apps/studio/preview/preview-camera.tsx — Edit ⇄ Preview in the canvas (04 md-motion).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// r2-p3 (Michal TD1d, decision maude/v2-michal-ux-audit-td-decisions): a mode switch changes only the toolbar —
|
|
4
|
+
// Preview keeps the Edit camera and the panels keep their place. The S3.9 camera ease (a 220 ms glide onto the
|
|
5
|
+
// artboard in view) was switched off by that decision and, per #170 D3, is removed: nothing here moves the camera.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// · Edit ⇄ Preview (and Viewing ⇄ Preview) only. Present is S3.2a's stage and has its own lift
|
|
11
|
-
// (present-stage.tsx); a Present transition here cancels a running ease and forgets the way back.
|
|
12
|
-
// · The camera belongs to the person: a gesture mid-ease stops it, and Preview → Edit only returns the
|
|
13
|
-
// camera when it is still where the ease left it.
|
|
14
|
-
//
|
|
15
|
-
// Mounted by canvas-lib's `DesignCanvasInner` through `usePreviewCamera` and nothing else. The engine is
|
|
16
|
-
// plain TS with its scheduling injected, so the tests drive it frame by frame.
|
|
7
|
+
// What stays is the document's side of Preview, mounted by canvas-lib's `DesignCanvasInner` through
|
|
8
|
+
// `usePreviewMark`: `html[data-maude-preview]` while the shell's mode is Preview, so a web artboard's design
|
|
9
|
+
// surface scrolls inside itself (styles below), and `usePreviewing` for chrome that steps aside in Preview.
|
|
17
10
|
|
|
18
|
-
import {
|
|
11
|
+
import { useEffect, useSyncExternalStore } from 'react';
|
|
19
12
|
import { canvasModeStore } from '../bridge/canvas-mode-store.ts';
|
|
20
|
-
import type { CanvasModeV2 } from '../bridge/canvas-modes.ts';
|
|
21
|
-
import { type Insets, visibleRect, ZERO_INSETS } from '../bridge/occlusion.ts';
|
|
22
|
-
import { frameCafOn, frameRafOn } from '../frame-clock.ts';
|
|
23
|
-
|
|
24
|
-
export interface Camera {
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
zoom: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface BoardRect {
|
|
31
|
-
id: string;
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
w: number;
|
|
35
|
-
h: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** `--dur-panel` when the token is absent (client/styles/1-tokens-shell.css). */
|
|
39
|
-
export const EASE_MS = 220;
|
|
40
|
-
/** `--ease-out` when the token is absent. */
|
|
41
|
-
export const EASE_OUT: readonly [number, number, number, number] = [0.2, 0, 0, 1];
|
|
42
|
-
|
|
43
|
-
const SAME_EPS = 1e-6;
|
|
44
|
-
const sameCam = (a: Camera, b: Camera) =>
|
|
45
|
-
Math.abs(a.x - b.x) < SAME_EPS &&
|
|
46
|
-
Math.abs(a.y - b.y) < SAME_EPS &&
|
|
47
|
-
Math.abs(a.zoom - b.zoom) < 1e-9;
|
|
48
|
-
|
|
49
|
-
// ── pure helpers ─────────────────────────────────────────────────────────────────────────────────
|
|
50
|
-
|
|
51
|
-
const isBase = (m: CanvasModeV2 | null) => m === 'edit' || m === 'viewing';
|
|
52
|
-
|
|
53
|
-
/** Which mode transitions move the camera. Present (either side), boot, a re-sent mode and a role clamp
|
|
54
|
-
* between Edit and Viewing do not.
|
|
55
|
-
*
|
|
56
|
-
* r2-p3 (Michal TD1d, decision maude/v2-michal-ux-audit-td-decisions — supersedes the S3.9 ease of
|
|
57
|
-
* `v2-S3.9-camera-ease-engine`): a mode switch changes only the toolbar, so NO transition moves the camera
|
|
58
|
-
* any more — Preview keeps the Edit camera and the panels keep their place. The engine stays (tests drive it
|
|
59
|
-
* directly) behind this one switch; `PREVIEW_EASES` is the way back if the frame ever moves again. */
|
|
60
|
-
export const PREVIEW_EASES = false;
|
|
61
|
-
export function easeKind(
|
|
62
|
-
prev: CanvasModeV2 | null,
|
|
63
|
-
next: CanvasModeV2 | null
|
|
64
|
-
): 'enter' | 'leave' | null {
|
|
65
|
-
if (!PREVIEW_EASES) return null;
|
|
66
|
-
if (isBase(prev) && next === 'preview') return 'enter';
|
|
67
|
-
if (prev === 'preview' && isBase(next)) return 'leave';
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** A CSS `cubic-bezier(x1, y1, x2, y2)` as a function of time (Newton, bisection as the fallback). */
|
|
72
|
-
export function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number {
|
|
73
|
-
const cx = 3 * x1;
|
|
74
|
-
const bx = 3 * (x2 - x1) - cx;
|
|
75
|
-
const ax = 1 - cx - bx;
|
|
76
|
-
const cy = 3 * y1;
|
|
77
|
-
const by = 3 * (y2 - y1) - cy;
|
|
78
|
-
const ay = 1 - cy - by;
|
|
79
|
-
const X = (s: number) => ((ax * s + bx) * s + cx) * s;
|
|
80
|
-
const Y = (s: number) => ((ay * s + by) * s + cy) * s;
|
|
81
|
-
const dX = (s: number) => (3 * ax * s + 2 * bx) * s + cx;
|
|
82
|
-
return (t) => {
|
|
83
|
-
if (t <= 0) return 0;
|
|
84
|
-
if (t >= 1) return 1;
|
|
85
|
-
let s = t;
|
|
86
|
-
for (let i = 0; i < 8; i++) {
|
|
87
|
-
const err = X(s) - t;
|
|
88
|
-
if (Math.abs(err) < 1e-7) return Y(s);
|
|
89
|
-
const d = dX(s);
|
|
90
|
-
if (Math.abs(d) < 1e-6) break;
|
|
91
|
-
s -= err / d;
|
|
92
|
-
}
|
|
93
|
-
let lo = 0;
|
|
94
|
-
let hi = 1;
|
|
95
|
-
s = t;
|
|
96
|
-
for (let i = 0; i < 40; i++) {
|
|
97
|
-
const x = X(s);
|
|
98
|
-
if (Math.abs(x - t) < 1e-7) break;
|
|
99
|
-
if (x < t) lo = s;
|
|
100
|
-
else hi = s;
|
|
101
|
-
s = (lo + hi) / 2;
|
|
102
|
-
}
|
|
103
|
-
return Y(s);
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The artboard in view: nearest the centre of the visible area, for the layout the camera was drawn for
|
|
109
|
-
* (`insets` = what covered the canvas BEFORE the panels folded). Ties go to the first in canvas order.
|
|
110
|
-
*/
|
|
111
|
-
export function inViewArtboard(
|
|
112
|
-
cam: Camera,
|
|
113
|
-
host: { w: number; h: number },
|
|
114
|
-
insets: Readonly<Insets>,
|
|
115
|
-
rects: readonly BoardRect[]
|
|
116
|
-
): BoardRect | null {
|
|
117
|
-
if (rects.length === 0 || !cam.zoom) return null;
|
|
118
|
-
const v = visibleRect(host.w, host.h, insets);
|
|
119
|
-
const cx = (v.x + v.w / 2 - cam.x) / cam.zoom;
|
|
120
|
-
const cy = (v.y + v.h / 2 - cam.y) / cam.zoom;
|
|
121
|
-
let best: BoardRect | null = null;
|
|
122
|
-
let bestD = Number.POSITIVE_INFINITY;
|
|
123
|
-
for (const r of rects) {
|
|
124
|
-
const d = (r.x + r.w / 2 - cx) ** 2 + (r.y + r.h / 2 - cy) ** 2;
|
|
125
|
-
if (d < bestD) {
|
|
126
|
-
bestD = d;
|
|
127
|
-
best = r;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return best;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// ── the engine ───────────────────────────────────────────────────────────────────────────────────
|
|
134
|
-
|
|
135
|
-
export interface PreviewEaseDeps {
|
|
136
|
-
/** The camera as it is right now (exact — the live mirror, not the settle-cadence published value). */
|
|
137
|
-
getCamera(): Camera;
|
|
138
|
-
setCamera(c: Camera): void;
|
|
139
|
-
getArtboards(): readonly BoardRect[];
|
|
140
|
-
/** The canvas host's size; null / zero when it is not showing (a background canvas). */
|
|
141
|
-
getHostSize(): { w: number; h: number } | null;
|
|
142
|
-
/** 04 md-preview-combine: a canvas with several boards and NO links has nothing to step through, so Preview
|
|
143
|
-
* keeps the overview ("pan across all 15") instead of zooming onto one board. Absent = never hold. */
|
|
144
|
-
holdOverview?(): boolean;
|
|
145
|
-
/** The camera that lands `rect` in the visible area under the CURRENT insets. */
|
|
146
|
-
fit(rect: BoardRect): Camera;
|
|
147
|
-
raf(cb: (now: number) => void): number;
|
|
148
|
-
caf(id: number): void;
|
|
149
|
-
now(): number;
|
|
150
|
-
reducedMotion(): boolean;
|
|
151
|
-
durationMs(): number;
|
|
152
|
-
easing(): (t: number) => number;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface PreviewEase {
|
|
156
|
-
/** Edit / Viewing → Preview. `insetsBefore` = the insets the camera was drawn under. */
|
|
157
|
-
enter(insetsBefore?: Readonly<Insets>): boolean;
|
|
158
|
-
/** Preview → Edit / Viewing: back to where Edit left it, if the camera is still where the ease left it. */
|
|
159
|
-
leave(): boolean;
|
|
160
|
-
/** Present (or anything else that is not ours) took over: cancel and forget the way back. */
|
|
161
|
-
stop(): void;
|
|
162
|
-
moving(): boolean;
|
|
163
|
-
dispose(): void;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export function createPreviewEase(deps: PreviewEaseDeps): PreviewEase {
|
|
167
|
-
let tween: number | null = null;
|
|
168
|
-
/** The camera Edit left, and the one the ease landed on (null while it is still running). */
|
|
169
|
-
let saved: { from: Camera; landed: Camera | null } | null = null;
|
|
170
|
-
/** The camera as this engine last set it, read back (the controller clamps zoom). */
|
|
171
|
-
let last: Camera | null = null;
|
|
172
|
-
|
|
173
|
-
const ms = () => (deps.reducedMotion() ? 1 : Math.max(1, deps.durationMs()));
|
|
174
|
-
const cancel = () => {
|
|
175
|
-
if (tween !== null) deps.caf(tween);
|
|
176
|
-
tween = null;
|
|
177
|
-
};
|
|
178
|
-
const put = (c: Camera) => {
|
|
179
|
-
deps.setCamera({ ...c });
|
|
180
|
-
last = deps.getCamera();
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
/** Glide to `to`; the LAST frame is `to` itself, never an interpolation that rounds. */
|
|
184
|
-
const glide = (to: Camera, done: (landed: Camera) => void) => {
|
|
185
|
-
cancel();
|
|
186
|
-
const from = deps.getCamera();
|
|
187
|
-
const dur = ms();
|
|
188
|
-
if (dur <= 1 || sameCam(from, to)) {
|
|
189
|
-
if (!sameCam(from, to)) put(to);
|
|
190
|
-
done(deps.getCamera());
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const ease = deps.easing();
|
|
194
|
-
const t0 = deps.now();
|
|
195
|
-
last = from;
|
|
196
|
-
const tick = (now: number) => {
|
|
197
|
-
// the person took the camera (a pan, a wheel, a jump): the ease is over
|
|
198
|
-
if (last && !sameCam(deps.getCamera(), last)) {
|
|
199
|
-
tween = null;
|
|
200
|
-
saved = null;
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
const t = Math.min(1, Math.max(0, (now - t0) / dur));
|
|
204
|
-
if (t >= 1) {
|
|
205
|
-
tween = null;
|
|
206
|
-
put(to);
|
|
207
|
-
done(deps.getCamera());
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const e = ease(t);
|
|
211
|
-
put({
|
|
212
|
-
x: from.x + (to.x - from.x) * e,
|
|
213
|
-
y: from.y + (to.y - from.y) * e,
|
|
214
|
-
zoom: from.zoom + (to.zoom - from.zoom) * e,
|
|
215
|
-
});
|
|
216
|
-
tween = deps.raf(tick);
|
|
217
|
-
};
|
|
218
|
-
tween = deps.raf(tick);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
return {
|
|
222
|
-
enter(insetsBefore = ZERO_INSETS) {
|
|
223
|
-
cancel();
|
|
224
|
-
saved = null;
|
|
225
|
-
const host = deps.getHostSize();
|
|
226
|
-
if (!host?.w || !host.h) return false;
|
|
227
|
-
if (deps.holdOverview?.()) return false;
|
|
228
|
-
const cam = deps.getCamera();
|
|
229
|
-
const board = inViewArtboard(cam, host, insetsBefore, deps.getArtboards());
|
|
230
|
-
if (!board) return false;
|
|
231
|
-
const to = deps.fit(board);
|
|
232
|
-
if (sameCam(cam, to)) return false;
|
|
233
|
-
saved = { from: cam, landed: null };
|
|
234
|
-
const mine = saved;
|
|
235
|
-
glide(to, (landed) => {
|
|
236
|
-
if (saved === mine) mine.landed = landed;
|
|
237
|
-
});
|
|
238
|
-
return true;
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
leave() {
|
|
242
|
-
const s = saved;
|
|
243
|
-
saved = null;
|
|
244
|
-
if (!s) return false;
|
|
245
|
-
const running = tween !== null;
|
|
246
|
-
const cur = deps.getCamera();
|
|
247
|
-
// moved by the person since the ease landed: the camera is theirs
|
|
248
|
-
if (!running && !(s.landed && sameCam(cur, s.landed))) return false;
|
|
249
|
-
if (sameCam(cur, s.from)) {
|
|
250
|
-
cancel();
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
glide(s.from, () => {});
|
|
254
|
-
return true;
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
stop() {
|
|
258
|
-
cancel();
|
|
259
|
-
saved = null;
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
moving: () => tween !== null,
|
|
263
|
-
|
|
264
|
-
dispose() {
|
|
265
|
-
cancel();
|
|
266
|
-
saved = null;
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// ── the React mount ──────────────────────────────────────────────────────────────────────────────
|
|
272
13
|
|
|
273
14
|
const STYLE_ID = 'maude-preview-style';
|
|
274
15
|
|
|
@@ -294,43 +35,6 @@ html[data-maude-preview] .dc-canvas .dc-artboard[data-dc-kind='web'] > .dc-artbo
|
|
|
294
35
|
doc.head.appendChild(style);
|
|
295
36
|
}
|
|
296
37
|
|
|
297
|
-
function cssTokenMs(win: Window): number {
|
|
298
|
-
try {
|
|
299
|
-
const raw = win
|
|
300
|
-
.getComputedStyle(win.document.documentElement)
|
|
301
|
-
.getPropertyValue('--dur-panel')
|
|
302
|
-
.trim();
|
|
303
|
-
const m = /^([\d.]+)(ms|s)$/.exec(raw);
|
|
304
|
-
if (m) return Number(m[1]) * (m[2] === 's' ? 1000 : 1);
|
|
305
|
-
} catch {
|
|
306
|
-
/* no computed style */
|
|
307
|
-
}
|
|
308
|
-
return EASE_MS;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function cssEasing(win: Window): (t: number) => number {
|
|
312
|
-
try {
|
|
313
|
-
const raw = win
|
|
314
|
-
.getComputedStyle(win.document.documentElement)
|
|
315
|
-
.getPropertyValue('--ease-out')
|
|
316
|
-
.trim();
|
|
317
|
-
const m =
|
|
318
|
-
/^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(raw);
|
|
319
|
-
if (m) return cubicBezier(Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4]));
|
|
320
|
-
} catch {
|
|
321
|
-
/* no computed style */
|
|
322
|
-
}
|
|
323
|
-
return cubicBezier(...EASE_OUT);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function reducedMotion(win: Window): boolean {
|
|
327
|
-
try {
|
|
328
|
-
return !!win.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
|
329
|
-
} catch {
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
38
|
const NO_SUBSCRIBE = () => () => {};
|
|
335
39
|
const NO_SNAPSHOT = () => null;
|
|
336
40
|
|
|
@@ -346,97 +50,26 @@ export function usePreviewing(): boolean {
|
|
|
346
50
|
return mode === 'preview';
|
|
347
51
|
}
|
|
348
52
|
|
|
349
|
-
export interface UsePreviewCameraOptions<T extends BoardRect = BoardRect> {
|
|
350
|
-
hostRef: RefObject<HTMLElement | null>;
|
|
351
|
-
artboards: readonly T[];
|
|
352
|
-
/** The viewport controller's handle: the way to set the camera. */
|
|
353
|
-
controller: { viewport: Camera; setViewport(v: Camera): void };
|
|
354
|
-
/** The exact live camera (canvas-lib's `getLiveViewport`); the controller's published one lags. */
|
|
355
|
-
getCamera?: () => Camera | null;
|
|
356
|
-
/** The camera that lands one artboard in the visible area (canvas-lib's `computeFit`, insets applied). */
|
|
357
|
-
fit(rect: T): Camera;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
53
|
/**
|
|
361
54
|
* Mount Edit ⇄ Preview on a canvas. Reads the shell's `set-mode` through the document's mode store
|
|
362
|
-
* (canvas-mode-store.ts) and
|
|
363
|
-
*
|
|
55
|
+
* (canvas-mode-store.ts) and marks the document while the mode is Preview (`html[data-maude-preview]`) so a web
|
|
56
|
+
* artboard can scroll inside itself. It never moves the camera.
|
|
364
57
|
*/
|
|
365
|
-
export function
|
|
366
|
-
const optsRef = useRef(opts);
|
|
367
|
-
optsRef.current = opts;
|
|
58
|
+
export function usePreviewMark(): void {
|
|
368
59
|
const win = typeof window === 'undefined' ? null : window;
|
|
369
|
-
const engineRef = useRef<PreviewEase | null>(null);
|
|
370
|
-
|
|
371
60
|
useEffect(() => {
|
|
372
61
|
if (!win) return;
|
|
373
62
|
const store = canvasModeStore(win);
|
|
374
63
|
ensurePreviewStyles(win.document);
|
|
375
|
-
const engine = createPreviewEase({
|
|
376
|
-
getCamera: () => {
|
|
377
|
-
const o = optsRef.current;
|
|
378
|
-
return { ...(o.getCamera?.() ?? o.controller.viewport) };
|
|
379
|
-
},
|
|
380
|
-
setCamera: (c) => optsRef.current.controller.setViewport(c),
|
|
381
|
-
getArtboards: () => optsRef.current.artboards,
|
|
382
|
-
getHostSize: () => {
|
|
383
|
-
const h = optsRef.current.hostRef.current;
|
|
384
|
-
return h ? { w: h.clientWidth, h: h.clientHeight } : null;
|
|
385
|
-
},
|
|
386
|
-
fit: (rect) => optsRef.current.fit(rect as T),
|
|
387
|
-
holdOverview: () =>
|
|
388
|
-
optsRef.current.artboards.length > 1 && !win.document.querySelector('[data-cd-link]'),
|
|
389
|
-
raf: (cb) => frameRafOn(win, cb),
|
|
390
|
-
caf: (id) => frameCafOn(win, id),
|
|
391
|
-
now: () => (typeof performance !== 'undefined' ? performance.now() : Date.now()),
|
|
392
|
-
reducedMotion: () => reducedMotion(win),
|
|
393
|
-
durationMs: () => cssTokenMs(win),
|
|
394
|
-
easing: () => cssEasing(win),
|
|
395
|
-
});
|
|
396
|
-
engineRef.current = engine;
|
|
397
|
-
|
|
398
|
-
// The insets the camera was DRAWN under. The shell sends the target layout's insets right before
|
|
399
|
-
// `set-mode` (same task), so a change that just arrived is the folded layout and the value before that
|
|
400
|
-
// burst is the one the camera knows. Older changes are the camera's own layout already.
|
|
401
|
-
const BURST_MS = 100;
|
|
402
|
-
const clock = () => (typeof performance !== 'undefined' ? performance.now() : Date.now());
|
|
403
|
-
let curInsets: Readonly<Insets> = store.get().insets;
|
|
404
|
-
let beforeBurst: Readonly<Insets> = curInsets;
|
|
405
|
-
let lastChangeAt = Number.NEGATIVE_INFINITY;
|
|
406
|
-
let insetsSeq = store.get().insetsSeq;
|
|
407
|
-
let modeSeq = store.get().modeSeq;
|
|
408
64
|
const root = win.document.documentElement;
|
|
409
|
-
const mark = (
|
|
410
|
-
if (mode === 'preview') root.setAttribute('data-maude-preview', '');
|
|
65
|
+
const mark = () => {
|
|
66
|
+
if (store.get().mode === 'preview') root.setAttribute('data-maude-preview', '');
|
|
411
67
|
else root.removeAttribute('data-maude-preview');
|
|
412
68
|
};
|
|
413
|
-
mark(
|
|
414
|
-
|
|
415
|
-
const onSnap = () => {
|
|
416
|
-
const s = store.get();
|
|
417
|
-
const now = clock();
|
|
418
|
-
if (s.insetsSeq !== insetsSeq) {
|
|
419
|
-
insetsSeq = s.insetsSeq;
|
|
420
|
-
if (now - lastChangeAt > BURST_MS) beforeBurst = curInsets;
|
|
421
|
-
curInsets = s.insets;
|
|
422
|
-
lastChangeAt = now;
|
|
423
|
-
}
|
|
424
|
-
if (s.modeSeq === modeSeq) return;
|
|
425
|
-
modeSeq = s.modeSeq;
|
|
426
|
-
mark(s.mode);
|
|
427
|
-
if (s.mode === 'present' || s.prevMode === 'present') {
|
|
428
|
-
engine.stop();
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
const kind = easeKind(s.prevMode, s.mode);
|
|
432
|
-
if (kind === 'enter') engine.enter(now - lastChangeAt <= BURST_MS ? beforeBurst : curInsets);
|
|
433
|
-
else if (kind === 'leave') engine.leave();
|
|
434
|
-
};
|
|
435
|
-
const unsub = store.subscribe(onSnap);
|
|
69
|
+
mark();
|
|
70
|
+
const unsub = store.subscribe(mark);
|
|
436
71
|
return () => {
|
|
437
72
|
unsub();
|
|
438
|
-
engine.dispose();
|
|
439
|
-
engineRef.current = null;
|
|
440
73
|
root.removeAttribute('data-maude-preview');
|
|
441
74
|
};
|
|
442
75
|
}, [win]);
|
package/apps/studio/readiness.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { isNativePluginContext } from './acp/plugin-bootstrap.ts';
|
|
|
19
19
|
import { isE2eEnv, resolveAdapterEntry, resolveClaudePath } from './acp/probe.ts';
|
|
20
20
|
import { resolveBrowser } from './bin/_ensure-browser.mjs';
|
|
21
21
|
import { DESIGN_PLUGIN_DIR } from './paths.ts';
|
|
22
|
+
import { e2eSwitch } from './release-build.ts';
|
|
22
23
|
|
|
23
24
|
export type ReadinessStatus = 'present' | 'missing' | 'unknown';
|
|
24
25
|
|
|
@@ -192,6 +193,14 @@ export function scanPlugins(): PluginScan {
|
|
|
192
193
|
* trip, not three sequential ones. The backing route gates cross-origin callers
|
|
193
194
|
* (DDR-128 hardening) so this can't be turned into a spawn-storm from a drive-by page.
|
|
194
195
|
*/
|
|
196
|
+
/** #168 — the forced claude status an e2e lane asked for; a release build ignores the switch. */
|
|
197
|
+
export function e2eForcedClaudeStatus(
|
|
198
|
+
env: Record<string, string | undefined> = process.env,
|
|
199
|
+
release?: boolean
|
|
200
|
+
): string | undefined {
|
|
201
|
+
return e2eSwitch(env, 'MAUDE_E2E_FORCE_CLAUDE_STATUS', release);
|
|
202
|
+
}
|
|
203
|
+
|
|
195
204
|
export async function probeReadiness(): Promise<ReadinessReport> {
|
|
196
205
|
let [claude, maude, agentBrowser] = await Promise.all([
|
|
197
206
|
resolveClaudeOnPathForReadiness(),
|
|
@@ -206,7 +215,7 @@ export async function probeReadiness(): Promise<ReadinessReport> {
|
|
|
206
215
|
// to occur naturally gets a narrow, explicitly-named override instead of a
|
|
207
216
|
// hand-rolled sandbox that fights the OS's own PATH resolution). Never
|
|
208
217
|
// affects real users — unset in every normal launch.
|
|
209
|
-
const e2eForce =
|
|
218
|
+
const e2eForce = e2eForcedClaudeStatus();
|
|
210
219
|
// A verified, explicitly-provisioned MAUDE_CLAUDE_BIN override (T0c's
|
|
211
220
|
// install flow, once its freshness+hash check passes) must never be
|
|
212
221
|
// clobbered back to "missing"/"signed-out" by this coarser stub — mirrors
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The build-time "this is a shipped build" constant, and the one gate every `MAUDE_E2E_*` switch goes through.
|
|
2
|
+
//
|
|
3
|
+
// The desktop e2e lanes drive the sidecar with `MAUDE_E2E_*` environment variables (a forced claude status, a fake
|
|
4
|
+
// installer, an install-path redirect, a fixed port ladder). Those are test harness hooks: a shipped build must not
|
|
5
|
+
// honour them, whatever its environment holds. The Rust side gates its twins on `debug_assertions`; the TypeScript
|
|
6
|
+
// side cannot (one compiled sidecar serves the debug e2e app and the release app), so `build.ts` bakes
|
|
7
|
+
// `__MAUDE_RELEASE_BUILD__` into the compiled binary: true for every `--release` build (the cloud variant always),
|
|
8
|
+
// absent for a run from source and for the e2e sidecar (`--release --e2e`, never passed by CI).
|
|
9
|
+
//
|
|
10
|
+
// Fail closed: only an explicit `true` means release, and the release build path sets it unless the caller asked
|
|
11
|
+
// for `--e2e`.
|
|
12
|
+
|
|
13
|
+
declare const __MAUDE_RELEASE_BUILD__: boolean | undefined;
|
|
14
|
+
|
|
15
|
+
/** True only inside a binary built as a release. Reading an undefined global through `typeof` never throws. */
|
|
16
|
+
export const IS_RELEASE_BUILD: boolean =
|
|
17
|
+
typeof __MAUDE_RELEASE_BUILD__ !== 'undefined' && __MAUDE_RELEASE_BUILD__ === true;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The value of an e2e switch, or `undefined` when this is a release build (the switch is ignored, not refused:
|
|
21
|
+
* a shipped app behaves exactly as if the variable were not set). `release` is a parameter so a test can pin both
|
|
22
|
+
* halves without a second compiled binary.
|
|
23
|
+
*/
|
|
24
|
+
export function e2eSwitch(
|
|
25
|
+
env: Record<string, string | undefined>,
|
|
26
|
+
name: string,
|
|
27
|
+
release: boolean = IS_RELEASE_BUILD
|
|
28
|
+
): string | undefined {
|
|
29
|
+
if (release) return undefined;
|
|
30
|
+
return env[name];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The `--define` entries `build.ts` hands the compiler. `{}` for a build that keeps the e2e switches. */
|
|
34
|
+
export function releaseDefines(opts: {
|
|
35
|
+
release: boolean;
|
|
36
|
+
e2e: boolean;
|
|
37
|
+
cloud: boolean;
|
|
38
|
+
}): Record<string, string> {
|
|
39
|
+
// The cloud cell is always a shipped build, whatever else was asked.
|
|
40
|
+
const shipped = opts.cloud || (opts.release && !opts.e2e);
|
|
41
|
+
return shipped ? { __MAUDE_RELEASE_BUILD__: 'true' } : {};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The defines a CANVAS build (canvas-build.ts, run by this server) carries: a release server tells the canvas it is a
|
|
46
|
+
* shipped build, so canvas-lib code that reads `IS_RELEASE_BUILD` gets the server's answer (#212 §5: no still
|
|
47
|
+
* globals on a shipped canvas). `{}` from source and in the e2e sidecar.
|
|
48
|
+
*/
|
|
49
|
+
export function canvasDefines(release: boolean = IS_RELEASE_BUILD): Record<string, string> {
|
|
50
|
+
return release ? { __MAUDE_RELEASE_BUILD__: 'true' } : {};
|
|
51
|
+
}
|