@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
package/apps/studio/clip-ops.ts
CHANGED
|
@@ -306,6 +306,27 @@ function clipNameAttr(cc: { clips: Array<{ stableId: string }> }, raw: unknown):
|
|
|
306
306
|
return ` name="${escapeAttr(name)}"`;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
interface StorylineMedia {
|
|
310
|
+
tag: string;
|
|
311
|
+
src: string;
|
|
312
|
+
importName: string;
|
|
313
|
+
specifier: string;
|
|
314
|
+
/** a moving picture (`Video` / `OffthreadVideo`) — fills its beat */
|
|
315
|
+
visual: boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The media element a storyline beat holds. A video fills the comp (`width/height: 100%`) and says how with the
|
|
320
|
+
* `objectFit` PROP — `cover`, so a clip whose aspect differs from the artboard's crops instead of letterboxing
|
|
321
|
+
* (#128 §3/§4: the prop is what `@remotion/media`'s `<Video>` reads; a style would be ignored).
|
|
322
|
+
*/
|
|
323
|
+
function storylineMediaEl(media: StorylineMedia): string {
|
|
324
|
+
const src = `src="${escapeAttr(media.src)}"`;
|
|
325
|
+
return media.visual
|
|
326
|
+
? `<${media.tag} ${src} objectFit="cover" style={{ width: '100%', height: '100%' }} />`
|
|
327
|
+
: `<${media.tag} ${src} />`;
|
|
328
|
+
}
|
|
329
|
+
|
|
309
330
|
const PLACEHOLDER_KINDS = new Set(['veo', 'motion', 'image']);
|
|
310
331
|
|
|
311
332
|
function placeholderChildText(
|
|
@@ -366,9 +387,15 @@ export function applyInsertClipAt(
|
|
|
366
387
|
const dur = Math.max(1, Math.round(opts.durationInFrames));
|
|
367
388
|
const nameAttr = clipNameAttr(cc, opts.name);
|
|
368
389
|
const srcTrim = (opts.src ?? '').trim();
|
|
369
|
-
const media:
|
|
390
|
+
const media: StorylineMedia | null =
|
|
370
391
|
opts.mediaTag && INSERTABLE_MEDIA.has(opts.mediaTag) && srcTrim
|
|
371
|
-
? {
|
|
392
|
+
? {
|
|
393
|
+
tag: opts.mediaTag,
|
|
394
|
+
src: srcTrim,
|
|
395
|
+
importName: opts.mediaTag,
|
|
396
|
+
specifier: 'remotion',
|
|
397
|
+
visual: opts.mediaTag === 'Video' || opts.mediaTag === 'OffthreadVideo',
|
|
398
|
+
}
|
|
372
399
|
: null;
|
|
373
400
|
if (media) {
|
|
374
401
|
assertContainedSrc(canvasAbsPath, media.src, artboardId ?? '');
|
|
@@ -433,7 +460,7 @@ export function applyInsertClipAt(
|
|
|
433
460
|
dur
|
|
434
461
|
).trimEnd()
|
|
435
462
|
: media
|
|
436
|
-
? `\n${indent}
|
|
463
|
+
? `\n${indent} ${storylineMediaEl(media)}`
|
|
437
464
|
: '';
|
|
438
465
|
s2.appendLeft(
|
|
439
466
|
rootClose,
|
|
@@ -441,6 +468,18 @@ export function applyInsertClipAt(
|
|
|
441
468
|
`${gfChild}\n` +
|
|
442
469
|
`${indent} </TransitionSeries.Sequence>\n${indent}</TransitionSeries>\n${indent.slice(2)}`
|
|
443
470
|
);
|
|
471
|
+
// #128 §4: the comp's own length follows its first beat (an empty comp takes it, a comp that already holds
|
|
472
|
+
// overlays only ever grows) — the 150-frame default of a fresh comp must not cut a 1255-frame clip.
|
|
473
|
+
for (const m of source.matchAll(/<VideoComp\b/g)) {
|
|
474
|
+
const at = m.index as number;
|
|
475
|
+
const comp = attrSpanInTag(source, at, 'component');
|
|
476
|
+
if (comp?.valueText?.replace(/[{}\s]/g, '') !== cc.compName) continue;
|
|
477
|
+
const len = attrSpanInTag(source, at, 'durationInFrames');
|
|
478
|
+
const current = numAttrText(source, at, 'durationInFrames');
|
|
479
|
+
if (!len || current == null || !/^\{\s*\d+\s*\}$/.test(len.valueText ?? '')) continue;
|
|
480
|
+
const next = cc.clips.length === 0 ? dur : Math.max(current, dur);
|
|
481
|
+
if (next !== current) s2.overwrite(len.start, len.end, ` durationInFrames={${next}}`);
|
|
482
|
+
}
|
|
444
483
|
ensureImportPublic(s2, source, 'TransitionSeries', '@remotion/transitions');
|
|
445
484
|
if (opts.placeholder) ensureNamedImport(s2, source, 'AIPlaceholder', '@maude/canvas-lib');
|
|
446
485
|
if (media) ensureNamedImport(s2, source, media.importName, media.specifier);
|
|
@@ -463,7 +502,7 @@ export function applyInsertClipAt(
|
|
|
463
502
|
const mediaText = opts.placeholder
|
|
464
503
|
? placeholderChildText(canvasAbsPath, artboardId, opts.placeholder, indent, dur)
|
|
465
504
|
: media
|
|
466
|
-
? `\n${indent}
|
|
505
|
+
? `\n${indent} ${storylineMediaEl(media)}\n${indent}`
|
|
467
506
|
: '';
|
|
468
507
|
if (opts.placeholder) ensureNamedImport(s, source, 'AIPlaceholder', '@maude/canvas-lib');
|
|
469
508
|
if (media) ensureNamedImport(s, source, media.importName, media.specifier);
|
|
@@ -1723,6 +1762,83 @@ export function applyResolvePlaceholder(
|
|
|
1723
1762
|
return { source: out };
|
|
1724
1763
|
}
|
|
1725
1764
|
|
|
1765
|
+
// biome-ignore lint/suspicious/noExplicitAny: oxc's ESTree nodes are walked structurally
|
|
1766
|
+
type AstNode = any;
|
|
1767
|
+
|
|
1768
|
+
const jsxName = (el: AstNode): string => el?.openingElement?.name?.name ?? '';
|
|
1769
|
+
|
|
1770
|
+
/** `style={{ width: "100%", height: "100%" }}` on the element (both literally 100 %). */
|
|
1771
|
+
function isFullSizeStyle(el: AstNode): boolean {
|
|
1772
|
+
const attr = (el.openingElement.attributes ?? []).find(
|
|
1773
|
+
(a: AstNode) => a.type === 'JSXAttribute' && a.name?.name === 'style'
|
|
1774
|
+
);
|
|
1775
|
+
const obj = attr?.value?.expression;
|
|
1776
|
+
if (obj?.type !== 'ObjectExpression') return false;
|
|
1777
|
+
const full = (key: string) =>
|
|
1778
|
+
(obj.properties ?? []).some(
|
|
1779
|
+
(p: AstNode) =>
|
|
1780
|
+
p.type === 'Property' &&
|
|
1781
|
+
(p.key?.name === key || p.key?.value === key) &&
|
|
1782
|
+
p.value?.type === 'Literal' &&
|
|
1783
|
+
p.value.value === '100%'
|
|
1784
|
+
);
|
|
1785
|
+
return full('width') && full('height');
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
/** Only `<div>`s, text and string literals below it — a card of words, not a design. */
|
|
1789
|
+
function isWordsOnly(el: AstNode): boolean {
|
|
1790
|
+
for (const c of el.children ?? []) {
|
|
1791
|
+
if (c.type === 'JSXText') continue;
|
|
1792
|
+
if (c.type === 'JSXExpressionContainer') {
|
|
1793
|
+
if (c.expression?.type === 'Literal' && typeof c.expression.value === 'string') continue;
|
|
1794
|
+
return false;
|
|
1795
|
+
}
|
|
1796
|
+
if (c.type === 'JSXElement' && jsxName(c) === 'div' && isWordsOnly(c)) continue;
|
|
1797
|
+
return false;
|
|
1798
|
+
}
|
|
1799
|
+
return true;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* The span of the artboard's placeholder: its ONLY child is a full-size `<div>` (width and height literally
|
|
1804
|
+
* "100%") holding nothing but nested `<div>`s and words — the brief board's empty-state card. Null for anything
|
|
1805
|
+
* that could be a real design (an image, a component, a computed child, a second sibling).
|
|
1806
|
+
*/
|
|
1807
|
+
function fullSizePlaceholder(
|
|
1808
|
+
canvasAbsPath: string,
|
|
1809
|
+
source: string,
|
|
1810
|
+
artboardStart: number
|
|
1811
|
+
): { start: number; end: number } | null {
|
|
1812
|
+
const parsed = parseSync(canvasAbsPath, source, { sourceType: 'module' });
|
|
1813
|
+
let found: { start: number; end: number } | null = null;
|
|
1814
|
+
const walk = (n: AstNode): void => {
|
|
1815
|
+
if (found || !n || typeof n !== 'object') return;
|
|
1816
|
+
if (Array.isArray(n)) {
|
|
1817
|
+
for (const c of n) walk(c);
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
if (n.type === 'JSXElement' && n.start === artboardStart) {
|
|
1821
|
+
const kids = (n.children ?? []).filter(
|
|
1822
|
+
(c: AstNode) => !(c.type === 'JSXText' && !String(c.value).trim())
|
|
1823
|
+
);
|
|
1824
|
+
const only = kids[0];
|
|
1825
|
+
if (
|
|
1826
|
+
kids.length === 1 &&
|
|
1827
|
+
only.type === 'JSXElement' &&
|
|
1828
|
+
jsxName(only) === 'div' &&
|
|
1829
|
+
isFullSizeStyle(only) &&
|
|
1830
|
+
isWordsOnly(only)
|
|
1831
|
+
) {
|
|
1832
|
+
found = { start: only.start, end: only.end };
|
|
1833
|
+
}
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
for (const k of Object.keys(n)) if (k !== 'parent') walk(n[k]);
|
|
1837
|
+
};
|
|
1838
|
+
walk(parsed.program);
|
|
1839
|
+
return found;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1726
1842
|
/**
|
|
1727
1843
|
* Dogfood fix — an artboard marked `kind="video"` in the Inspector IS the
|
|
1728
1844
|
* user's "this is a video" intent, but without a `<VideoComp>` inside it the
|
|
@@ -1763,10 +1879,12 @@ export function applyEnsureVideoComp(
|
|
|
1763
1879
|
for (let i = 2; new RegExp(`\\b${compName}\\b`).test(source); i += 1) compName = `VideoCut${i}`;
|
|
1764
1880
|
const indent = lineStartInfo(source, closeIdx).indent;
|
|
1765
1881
|
const s = new MagicString(source);
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
);
|
|
1882
|
+
const compText = `<VideoComp component={${compName}} durationInFrames={150} fps={30} width={${width}} height={${height}} />`;
|
|
1883
|
+
// #128 §4: a brief board's full-size empty-state card would push a SIBLING comp out of the fixed
|
|
1884
|
+
// artboard — the card is the placeholder, so the comp takes its place.
|
|
1885
|
+
const placeholder = fullSizePlaceholder(canvasAbsPath, source, target.start);
|
|
1886
|
+
if (placeholder) s.overwrite(placeholder.start, placeholder.end, compText);
|
|
1887
|
+
else s.appendLeft(closeIdx, ` ${compText}\n${indent}`);
|
|
1770
1888
|
// The comp body — an AbsoluteFill root so the first storyline drop can
|
|
1771
1889
|
// author its <TransitionSeries> inside (the greenfield insert contract).
|
|
1772
1890
|
const exportM = source.match(/^export default function\b/m) ?? source.match(/^export default\b/m);
|
|
@@ -30,7 +30,7 @@ import { browserDoorOf } from '../client/v2/cloud/browser-door.js';
|
|
|
30
30
|
import { asFormat, formatToKeep } from '../format.ts';
|
|
31
31
|
import { deleteHubCredential, saveHubCredential } from '../sync/hub-link.ts';
|
|
32
32
|
import { getHubRecord, getHubToken, normalizeUrl } from '../sync/hubs-config.ts';
|
|
33
|
-
import { deleteProjectLink, linksPath, recordProjectLink } from '../sync/link-consent.ts';
|
|
33
|
+
import { deleteProjectLink, linksPath, normHub, recordProjectLink } from '../sync/link-consent.ts';
|
|
34
34
|
import { boundCloudToken, cloudConfigPath } from './config-path.ts';
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -238,6 +238,24 @@ interface Ctx {
|
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
/**
|
|
242
|
+
* 2.1.1 T2 — where the project at `repoRoot` lives: `{ kept: true }` for a copy Maude keeps (the app
|
|
243
|
+
* bound it to a server: `MAUDE_APP_BOUND_HUB`, set by the desktop shell per spawn, never by a repo),
|
|
244
|
+
* else `{ kept: false, folder }` — the folder, with the home directory as `~`.
|
|
245
|
+
*/
|
|
246
|
+
export function placeOf(
|
|
247
|
+
repoRoot: string,
|
|
248
|
+
env: Record<string, string | undefined> = process.env
|
|
249
|
+
): { kept: true } | { kept: false; folder: string } {
|
|
250
|
+
if (normHub(env.MAUDE_APP_BOUND_HUB)) return { kept: true };
|
|
251
|
+
const home = env.HOME || '';
|
|
252
|
+
const folder =
|
|
253
|
+
home && (repoRoot === home || repoRoot.startsWith(home.endsWith(sep) ? home : home + sep))
|
|
254
|
+
? `~${repoRoot.slice(home.replace(/[\\/]+$/, '').length)}`
|
|
255
|
+
: repoRoot;
|
|
256
|
+
return { kept: false, folder };
|
|
257
|
+
}
|
|
258
|
+
|
|
241
259
|
export function createCloudEndpoints(ctx: Ctx) {
|
|
242
260
|
const cfgFile = () => ctx.cloudConfigPath ?? cloudConfigPath();
|
|
243
261
|
/** gate-b-sec4 — the per-Mac link record, beside the same profile's hubs.json. */
|
|
@@ -269,6 +287,10 @@ export function createCloudEndpoints(ctx: Ctx) {
|
|
|
269
287
|
url: file ? file.url : cloudUrl(),
|
|
270
288
|
project: basename(ctx.paths.repoRoot),
|
|
271
289
|
linkedHub: readLinkedHub(),
|
|
290
|
+
// 2.1.1 T2 — where the project lives (canvas 17 · ac-model): a copy Maude keeps for a
|
|
291
|
+
// server the APP bound it to (`MAUDE_APP_BOUND_HUB`, which a repo cannot set), else the
|
|
292
|
+
// person's own folder, home-abbreviated. Main origin only, like the rest of this answer.
|
|
293
|
+
place: placeOf(ctx.paths.repoRoot),
|
|
272
294
|
},
|
|
273
295
|
};
|
|
274
296
|
},
|
|
@@ -763,20 +785,23 @@ export function createCloudEndpoints(ctx: Ctx) {
|
|
|
763
785
|
* opened (attacker pass 2026-08-04, B2). A stored hub credential for that
|
|
764
786
|
* address is the corroboration, because only a real sign-in writes one.
|
|
765
787
|
*/
|
|
766
|
-
function readLinkedHub(): { url: string; credentialed: boolean } | null {
|
|
788
|
+
function readLinkedHub(): { url: string; credentialed: boolean; confirmed: boolean } | null {
|
|
767
789
|
try {
|
|
768
790
|
const cfg = JSON.parse(readFileSync(join(ctx.paths.designRoot, 'config.json'), 'utf8'));
|
|
769
791
|
const url = cfg?.linkedHub?.url;
|
|
770
792
|
if (typeof url !== 'string' || !url) return null;
|
|
771
793
|
let credentialed = false;
|
|
772
794
|
// gate-b-sec4 — a link this Mac never made vouches for nothing and is sent nothing.
|
|
773
|
-
|
|
795
|
+
// 2.1.1 — and the page hears so (`confirmed: false`). `confirmed` comes from THIS Mac's link
|
|
796
|
+
// record (the boot verdict that parked the claim), never from the repo, so an address this Mac
|
|
797
|
+
// never confirmed is never worded as a sign-in to repair.
|
|
798
|
+
if (ctx.unconfirmedHub) return { url, credentialed: false, confirmed: false };
|
|
774
799
|
try {
|
|
775
800
|
credentialed = !!getHubToken(normalizeUrl(url));
|
|
776
801
|
} catch {
|
|
777
802
|
/* unreadable credential store → treat as uncorroborated */
|
|
778
803
|
}
|
|
779
|
-
return { url, credentialed };
|
|
804
|
+
return { url, credentialed, confirmed: true };
|
|
780
805
|
} catch {
|
|
781
806
|
return null; // absent/malformed → simply not linked
|
|
782
807
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Phase 8 Task 4 — AI activity tracking with heartbeat-based TTL.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
3
|
+
// Today this map holds only the ACP chat's own entries (acp/index.ts), until S5.6
|
|
4
|
+
// moves the chat turn onto the run registry; every other AI run's banner entry is
|
|
5
|
+
// DERIVED from the registry (`RunRegistry.bannerEntries`). The v1 bracket that
|
|
6
|
+
// used to fill it (`POST /_api/ai/start|heartbeat|end` from `/design:edit`) is
|
|
7
|
+
// retired — 410 Gone since T2.5b (#163); the design plugin's hooks open and close
|
|
8
|
+
// the run (`/_api/agent/run/begin` … `/run/end`). The server keeps an in-memory
|
|
9
|
+
// map keyed by canvas file path and broadcasts changes over the inspector WS bus
|
|
10
|
+
// so every open client renders the "Claude is editing this canvas" banner.
|
|
9
11
|
//
|
|
10
12
|
// Why not Awareness — Awareness is the y-protocols channel for connected
|
|
11
13
|
// peers. The AI is not a connected peer (it lives in a slash command, not a
|
|
@@ -13,8 +15,8 @@
|
|
|
13
15
|
// not just the per-canvas Y.Doc room. A separate bus event keeps the model
|
|
14
16
|
// honest: AI activity is a server-managed projection, not a peer state.
|
|
15
17
|
//
|
|
16
|
-
// 30-second grace TTL — if the
|
|
17
|
-
//
|
|
18
|
+
// 30-second grace TTL — if the chat turn dies without an end the banner
|
|
19
|
+
// auto-clears 30 s after the last heartbeat. A janitor runs every 5 s
|
|
18
20
|
// and broadcasts cleared state if the entry expired.
|
|
19
21
|
|
|
20
22
|
import type { Context } from '../context.ts';
|
|
@@ -93,33 +93,57 @@ function scrubHolding(state: unknown): unknown {
|
|
|
93
93
|
return { ...rest, holding: size <= HOLDING_WIRE_MAX ? hold : null };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/** T5.2 — the hub's mark is the hub's to set: a studio never forwards it as its own. */
|
|
97
|
+
function withoutMark(state: unknown): unknown {
|
|
98
|
+
if (!state || typeof state !== 'object' || !('roleBy' in state)) return state;
|
|
99
|
+
const { roleBy: _mark, ...rest } = state as Record<string, unknown>;
|
|
100
|
+
return rest;
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
/** `a`'s states for `clients`, as they may leave this studio. */
|
|
97
104
|
function outbound(a: Awareness, clients: readonly number[]): Map<number, unknown> {
|
|
98
105
|
const states = a.getStates();
|
|
99
106
|
const out = new Map<number, unknown>();
|
|
100
|
-
for (const id of clients)
|
|
107
|
+
for (const id of clients)
|
|
108
|
+
if (states.has(id)) out.set(id, withoutMark(scrubHolding(states.get(id))));
|
|
101
109
|
return out;
|
|
102
110
|
}
|
|
103
111
|
|
|
104
112
|
/**
|
|
105
113
|
* V2-8.9 round B L1 (belt and braces) — `b`'s states for `clients` as they may enter the room: a `role`
|
|
106
114
|
* word the hub did not vouch for (no `roleBy: 'hub'`, apps/hub access-docs.mjs `stampHubRole`) is dropped,
|
|
107
|
-
* so a peer on an older hub cannot show itself as "· Owner".
|
|
115
|
+
* so a peer on an older hub cannot show itself as "· Owner". T5.2 (#165): an older hub relays the mark
|
|
116
|
+
* itself as a peer sent it, so `vouched` (the hub says `presence-role-v1`) must hold too; otherwise the
|
|
117
|
+
* role and its mark are both dropped.
|
|
108
118
|
*/
|
|
109
|
-
function inbound(b: Awareness, clients: readonly number[]): Map<number, unknown> {
|
|
119
|
+
function inbound(b: Awareness, clients: readonly number[], vouched: boolean): Map<number, unknown> {
|
|
110
120
|
const states = b.getStates();
|
|
111
121
|
const out = new Map<number, unknown>();
|
|
112
122
|
for (const id of clients) {
|
|
113
123
|
if (!states.has(id)) continue;
|
|
114
124
|
const s = states.get(id);
|
|
115
|
-
if (s
|
|
116
|
-
|
|
125
|
+
if (!s || typeof s !== 'object' || !('role' in s || 'roleBy' in s)) {
|
|
126
|
+
out.set(id, s);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const kept = vouched && (s as { roleBy?: unknown }).roleBy === 'hub';
|
|
130
|
+
if (kept && 'role' in s) out.set(id, s);
|
|
131
|
+
else {
|
|
132
|
+
const { role: _role, roleBy: _mark, ...rest } = s as Record<string, unknown>;
|
|
117
133
|
out.set(id, rest);
|
|
118
|
-
}
|
|
134
|
+
}
|
|
119
135
|
}
|
|
120
136
|
return out;
|
|
121
137
|
}
|
|
122
138
|
|
|
139
|
+
export interface BridgeOptions {
|
|
140
|
+
/**
|
|
141
|
+
* T5.2 (#165) — does the hub stamp presence roles (its /health says `presence-role-v1`)? Read on every
|
|
142
|
+
* relay; absent = the V2-8.9 rule alone (the mark is enough).
|
|
143
|
+
*/
|
|
144
|
+
rolesVouched?: () => boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
123
147
|
interface AwarenessChange {
|
|
124
148
|
added: number[];
|
|
125
149
|
updated: number[];
|
|
@@ -133,7 +157,8 @@ interface AwarenessChange {
|
|
|
133
157
|
* Awareness is destroyed, otherwise a late relay would apply to a dead
|
|
134
158
|
* instance.
|
|
135
159
|
*/
|
|
136
|
-
export function bridgeAwareness(a: Awareness, b: Awareness): () => void {
|
|
160
|
+
export function bridgeAwareness(a: Awareness, b: Awareness, opts: BridgeOptions = {}): () => void {
|
|
161
|
+
const vouched = () => (opts.rolesVouched ? opts.rolesVouched() === true : true);
|
|
137
162
|
// A single shared origin for both directions. A genuine local change carries
|
|
138
163
|
// some other origin (a browser conn, the provider's internal token, or null),
|
|
139
164
|
// so it relays; a change this bridge applied carries BRIDGE, so it stops.
|
|
@@ -165,7 +190,7 @@ export function bridgeAwareness(a: Awareness, b: Awareness): () => void {
|
|
|
165
190
|
if (changed.length > 0)
|
|
166
191
|
applyAwarenessUpdate(
|
|
167
192
|
a,
|
|
168
|
-
encodeAwarenessUpdate(b, changed, inbound(b, changed) as Map<number, never>),
|
|
193
|
+
encodeAwarenessUpdate(b, changed, inbound(b, changed, vouched()) as Map<number, never>),
|
|
169
194
|
BRIDGE
|
|
170
195
|
);
|
|
171
196
|
const leaving = departed.filter((id) => a.getStates().has(id));
|
|
@@ -187,7 +212,7 @@ export function bridgeAwareness(a: Awareness, b: Awareness): () => void {
|
|
|
187
212
|
if (bClients.length > 0)
|
|
188
213
|
applyAwarenessUpdate(
|
|
189
214
|
a,
|
|
190
|
-
encodeAwarenessUpdate(b, bClients, inbound(b, bClients) as Map<number, never>),
|
|
215
|
+
encodeAwarenessUpdate(b, bClients, inbound(b, bClients, vouched()) as Map<number, never>),
|
|
191
216
|
BRIDGE
|
|
192
217
|
);
|
|
193
218
|
|
|
@@ -89,11 +89,14 @@ export function createCollab(ctx: Context, api: Api): Collab {
|
|
|
89
89
|
// `draft` (p8-fix-d F13): only a text session's idle-typing drafts — the home records them
|
|
90
90
|
// with that session's commit, as one step.
|
|
91
91
|
const draft = registryRef?.takeDraftOnly(slug) === true;
|
|
92
|
+
// T7.3b (#113) — the one gesture this projection flushes, in words: the row ⌘Z names.
|
|
93
|
+
const label = registryRef?.takeFlushLabel(slug);
|
|
92
94
|
ctx.bus.emit('annotations-projected', {
|
|
93
95
|
slug,
|
|
94
96
|
board,
|
|
95
97
|
contested,
|
|
96
98
|
...(draft ? { draft } : {}),
|
|
99
|
+
...(label ? { label } : {}),
|
|
97
100
|
});
|
|
98
101
|
},
|
|
99
102
|
onAnnotationsSeeded: (slug, board) => {
|
|
@@ -19,7 +19,7 @@ import { isDraftWriteId } from '../annotations/ui/text-session.ts';
|
|
|
19
19
|
import type { BoardGuard } from '../annotations/vote-guard.ts';
|
|
20
20
|
import { applyCommentsToDoc, stampAnnotationsEdit } from '../sync/codec.ts';
|
|
21
21
|
import { MAX_ANNOTATIONS_BYTES } from '../sync/limits.ts';
|
|
22
|
-
import { bridgeAwareness } from './awareness-bridge.ts';
|
|
22
|
+
import { type BridgeOptions, bridgeAwareness } from './awareness-bridge.ts';
|
|
23
23
|
import type { Room, RoomCallbacks } from './room.ts';
|
|
24
24
|
import { createRoom } from './room.ts';
|
|
25
25
|
|
|
@@ -73,8 +73,16 @@ export interface Registry {
|
|
|
73
73
|
slug: string,
|
|
74
74
|
ops: readonly Op[],
|
|
75
75
|
actionId?: string,
|
|
76
|
-
guard?: BoardGuard
|
|
76
|
+
guard?: BoardGuard,
|
|
77
|
+
/** T7.3b (#113) — the gesture in words (untrusted; the local home cleans it). */
|
|
78
|
+
label?: string
|
|
77
79
|
): ApplyResult | 'too-large' | 'refused' | null;
|
|
80
|
+
/**
|
|
81
|
+
* T7.3b (#113) — the gesture in words of the ONE person's batch since the room last projected its
|
|
82
|
+
* board; `undefined` when there was none, or several that did not say the same words, or a file
|
|
83
|
+
* import (the lane label stands then). Drafts do not count — a session's commit names it. Clears.
|
|
84
|
+
*/
|
|
85
|
+
takeFlushLabel(slug: string): string | undefined;
|
|
78
86
|
/**
|
|
79
87
|
* S4.V4 G4 — the board a live room holds (canonical text), ahead of its debounced flush: a reader that
|
|
80
88
|
* must see its own `applyOpsToRoom` write reads this first. `null` when no room (or a never-populated
|
|
@@ -110,9 +118,10 @@ export interface Registry {
|
|
|
110
118
|
* cross-machine through Hocuspocus. Idempotent per slug; returns a detach
|
|
111
119
|
* fn. If a room is already live the bridge wires immediately, otherwise it
|
|
112
120
|
* wires when the room is next created. Awareness is ephemeral — this writes
|
|
113
|
-
* no files (see awareness-bridge.ts on why F14 is untouched).
|
|
121
|
+
* no files (see awareness-bridge.ts on why F14 is untouched). `opts.rolesVouched` (T5.2): does
|
|
122
|
+
* the hub stamp presence roles — a hub-relayed role is kept only then.
|
|
114
123
|
*/
|
|
115
|
-
attachHubAwareness(slug: string, awareness: Awareness): () => void;
|
|
124
|
+
attachHubAwareness(slug: string, awareness: Awareness, opts?: BridgeOptions): () => void;
|
|
116
125
|
/**
|
|
117
126
|
* Phase 9.2 (DDR-064) — pin a room so `drop` won't destroy it when the last
|
|
118
127
|
* browser leaves. The shared-doc path pins a slug while a hub
|
|
@@ -187,6 +196,7 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
187
196
|
// churn as browser tabs come and go; the bridge is re-wired each time a room
|
|
188
197
|
// is (re)created for a slug that has an attached hub Awareness.
|
|
189
198
|
const hubAwareness = new Map<string, Awareness>();
|
|
199
|
+
const hubBridgeOpts = new Map<string, BridgeOptions>();
|
|
190
200
|
const bridges = new Map<string, () => void>();
|
|
191
201
|
// Phase 9.2 (DDR-064) — slugs whose room must survive the last-browser-leaves
|
|
192
202
|
// drop because a shared-doc hub provider is attached to its doc. Only the
|
|
@@ -196,18 +206,24 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
196
206
|
const textContest = createTextContest();
|
|
197
207
|
// p8-fix-d F13 — per slug since its last projection: did a draft batch land, did anything else.
|
|
198
208
|
const flushKinds = new Map<string, { draft: boolean; other: boolean }>();
|
|
199
|
-
|
|
209
|
+
// T7.3b — per slug since its last projection: the words of its non-draft batches (`null` = none,
|
|
210
|
+
// or they disagree). A file import counts as a batch with no words.
|
|
211
|
+
const flushLabels = new Map<string, string | null>();
|
|
212
|
+
const noteFlushKind = (slug: string, draft: boolean, label?: string) => {
|
|
200
213
|
const k = flushKinds.get(slug) ?? { draft: false, other: false };
|
|
201
214
|
if (draft) k.draft = true;
|
|
202
215
|
else k.other = true;
|
|
203
216
|
flushKinds.set(slug, k);
|
|
217
|
+
if (draft) return;
|
|
218
|
+
const said = typeof label === 'string' && label ? label.slice(0, 1024) : null;
|
|
219
|
+
flushLabels.set(slug, flushLabels.has(slug) && flushLabels.get(slug) !== said ? null : said);
|
|
204
220
|
};
|
|
205
221
|
|
|
206
222
|
function wireBridge(slug: string, room: Room): void {
|
|
207
223
|
if (bridges.has(slug)) return;
|
|
208
224
|
const hub = hubAwareness.get(slug);
|
|
209
225
|
if (!hub) return;
|
|
210
|
-
bridges.set(slug, bridgeAwareness(room.awareness, hub));
|
|
226
|
+
bridges.set(slug, bridgeAwareness(room.awareness, hub, hubBridgeOpts.get(slug)));
|
|
211
227
|
}
|
|
212
228
|
|
|
213
229
|
function teardownBridge(slug: string): void {
|
|
@@ -228,13 +244,22 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
228
244
|
return room;
|
|
229
245
|
}
|
|
230
246
|
|
|
231
|
-
function attachHubAwareness(
|
|
247
|
+
function attachHubAwareness(
|
|
248
|
+
slug: string,
|
|
249
|
+
awareness: Awareness,
|
|
250
|
+
opts?: BridgeOptions
|
|
251
|
+
): () => void {
|
|
232
252
|
hubAwareness.set(slug, awareness);
|
|
253
|
+
if (opts) hubBridgeOpts.set(slug, opts);
|
|
254
|
+
else hubBridgeOpts.delete(slug);
|
|
233
255
|
const room = rooms.get(slug);
|
|
234
256
|
if (room) wireBridge(slug, room);
|
|
235
257
|
return () => {
|
|
236
258
|
teardownBridge(slug);
|
|
237
|
-
if (hubAwareness.get(slug) === awareness)
|
|
259
|
+
if (hubAwareness.get(slug) === awareness) {
|
|
260
|
+
hubAwareness.delete(slug);
|
|
261
|
+
hubBridgeOpts.delete(slug);
|
|
262
|
+
}
|
|
238
263
|
};
|
|
239
264
|
}
|
|
240
265
|
|
|
@@ -286,7 +311,8 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
286
311
|
slug: string,
|
|
287
312
|
ops: readonly Op[],
|
|
288
313
|
actionId?: string,
|
|
289
|
-
guard?: BoardGuard
|
|
314
|
+
guard?: BoardGuard,
|
|
315
|
+
label?: string
|
|
290
316
|
): ApplyResult | 'too-large' | 'refused' | null {
|
|
291
317
|
const room = rooms.get(slug);
|
|
292
318
|
// A replica that was never populated is not the board's truth — the
|
|
@@ -300,7 +326,7 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
300
326
|
const next = [...r.state.values()];
|
|
301
327
|
if (serializeBoard(next).length > MAX_ANNOTATIONS_BYTES) return 'too-large';
|
|
302
328
|
textContest.record(slug, before, ops);
|
|
303
|
-
noteFlushKind(slug, isDraftWriteId(actionId));
|
|
329
|
+
noteFlushKind(slug, isDraftWriteId(actionId), label);
|
|
304
330
|
// One transaction with the lane's newest-wins stamp, so peers get ONE
|
|
305
331
|
// update and the room's persistence projects it to disk.
|
|
306
332
|
room.doc.transact(() => {
|
|
@@ -397,6 +423,11 @@ export function createRegistry(callbacks: RoomCallbacks): Registry {
|
|
|
397
423
|
flushKinds.delete(slug);
|
|
398
424
|
return !!k && k.draft && !k.other;
|
|
399
425
|
},
|
|
426
|
+
takeFlushLabel: (slug) => {
|
|
427
|
+
const said = flushLabels.get(slug);
|
|
428
|
+
flushLabels.delete(slug);
|
|
429
|
+
return said ?? undefined;
|
|
430
|
+
},
|
|
400
431
|
setAgentEditing,
|
|
401
432
|
attachHubAwareness,
|
|
402
433
|
pin,
|