@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,8 +1,9 @@
|
|
|
1
1
|
// Internal shim behind index.sh (`maude design index`). See index.sh for usage.
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
3
|
import path from 'node:path';
|
|
5
4
|
|
|
5
|
+
import { locateStudio, studioHeaders } from '../../../cli/lib/studio-locate.mjs';
|
|
6
|
+
|
|
6
7
|
const args = process.argv.slice(2);
|
|
7
8
|
const opt = (k) => (args.includes(k) ? args[args.indexOf(k) + 1] : undefined);
|
|
8
9
|
const JSON_OUT = args.includes('--json');
|
|
@@ -15,25 +16,13 @@ if (!existsSync(path.join(designRoot, 'config.json'))) {
|
|
|
15
16
|
|
|
16
17
|
async function fromServer(query) {
|
|
17
18
|
try {
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
process.kill(info.pid, 0);
|
|
26
|
-
} catch {
|
|
27
|
-
return null; // a dead server's file
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// and only a studio serving THIS root: a reused port may be another project's (server-up.sh's rule)
|
|
31
|
-
const health = await fetch(`http://127.0.0.1:${port}/_health`, {
|
|
32
|
-
signal: AbortSignal.timeout(1500),
|
|
33
|
-
}).then((r) => (r.ok ? r.json() : null));
|
|
34
|
-
const id = createHash('sha256').update(realpathSync(root)).digest('hex').slice(0, 12);
|
|
35
|
-
if (health?.app !== 'design' || health.rootId !== id) return null;
|
|
36
|
-
const res = await fetch(`http://127.0.0.1:${port}/_api/index${query}`, {
|
|
19
|
+
// locateStudio: the app's attested server, else `_server.json`'s PORT only on loopback — never the
|
|
20
|
+
// file's `url` — and only a studio whose /_health names THIS root (a reused port may be another
|
|
21
|
+
// project's). It carries the server's API key (sec-loopback-bearer §7.6); studioHeaders sends it.
|
|
22
|
+
const studio = await locateStudio(root, { timeoutMs: 1500 });
|
|
23
|
+
if (!studio) return null;
|
|
24
|
+
const res = await fetch(`${studio.base}/_api/index${query}`, {
|
|
25
|
+
headers: studioHeaders(studio),
|
|
37
26
|
signal: AbortSignal.timeout(1500),
|
|
38
27
|
});
|
|
39
28
|
return res.ok ? await res.json() : null;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// content-addressed asset store, behind `maude design ingest-footage` (DDR-062
|
|
4
4
|
// dispatch). The folder-scale counterpart to `_fetch-asset.mjs` (single URL).
|
|
5
5
|
//
|
|
6
|
-
// feature-footage-analysis-director, Task 3. WHY THIS EXISTS: the `/design:reel`
|
|
6
|
+
// feature-footage-analysis-director, Task 3. WHY THIS EXISTS: the `/design-video:reel`
|
|
7
7
|
// director pipeline wants to start from a folder of client clips
|
|
8
8
|
// (`/…/podklady/video`). This verb copies each recognised video (and any image/
|
|
9
9
|
// audio) into `<designRoot>/assets/<sha8>.<ext>` — the SAME content-addressed
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
// • no network, no shell interpolation, no container parsing (magic bytes only).
|
|
24
24
|
//
|
|
25
25
|
// Reached via `maude design ingest-footage <dir> --root <repo>`, never a raw path.
|
|
26
|
-
// stdout (default) = a JSON manifest { clips:[{asset,src,bytes,category}],
|
|
27
|
-
// skipped:[{src,why}], assetsDir }.
|
|
28
|
-
//
|
|
26
|
+
// stdout (default) = a JSON manifest { clips:[{asset,src,bytes,category,warning?}],
|
|
27
|
+
// skipped:[{src,why}], warnings:[string], assetsDir }. A video that is HEVC, variable frame
|
|
28
|
+
// rate or has a second audio track carries a `warning` naming the asset and the codec (#128 §1;
|
|
29
|
+
// needs ffprobe, silently absent without it) and is echoed on stderr. Exit: 0 ok (even with
|
|
30
|
+
// skips) · 2 usage · 6 write/containment error · 1 other.
|
|
29
31
|
|
|
30
32
|
import { createHash } from 'node:crypto';
|
|
31
33
|
import {
|
|
@@ -42,6 +44,8 @@ import {
|
|
|
42
44
|
import { extname, join, resolve, sep } from 'node:path';
|
|
43
45
|
import { pathToFileURL } from 'node:url';
|
|
44
46
|
|
|
47
|
+
import { describeMedia, findTool, probeMedia } from './_media-probe.mjs';
|
|
48
|
+
|
|
45
49
|
// The DDR-148 video ceiling (100 MB). Images/audio also ride this generous cap
|
|
46
50
|
// here — the reel pipeline's inputs are dominated by video. Override per-file
|
|
47
51
|
// via --max-bytes.
|
|
@@ -210,6 +214,7 @@ export async function ingestFootage({
|
|
|
210
214
|
designRootRel = '.design',
|
|
211
215
|
maxBytes = DEFAULT_MAX_BYTES,
|
|
212
216
|
recursive = false,
|
|
217
|
+
probe, // ffprobe path, or null for "none" (a test seam); default = look it up
|
|
213
218
|
}) {
|
|
214
219
|
const srcDir = resolve(dir);
|
|
215
220
|
if (!existsSync(srcDir) || !statSync(srcDir).isDirectory())
|
|
@@ -221,6 +226,8 @@ export async function ingestFootage({
|
|
|
221
226
|
const clips = [];
|
|
222
227
|
const skipped = [];
|
|
223
228
|
const seen = new Set(); // sha8 dedupe within this run
|
|
229
|
+
const warnings = [];
|
|
230
|
+
const ffprobe = probe === undefined ? findTool('ffprobe') : probe;
|
|
224
231
|
|
|
225
232
|
for (const file of listFiles(srcDir, recursive)) {
|
|
226
233
|
let size;
|
|
@@ -281,11 +288,21 @@ export async function ingestFootage({
|
|
|
281
288
|
}
|
|
282
289
|
if (!seen.has(sha8)) {
|
|
283
290
|
seen.add(sha8);
|
|
284
|
-
|
|
291
|
+
const clip = { asset: `assets/${name}`, src: file, bytes: size, category: info.category };
|
|
292
|
+
// #128 §1 — a clip that plays but cannot be exported with sound (HEVC, variable frame rate, a
|
|
293
|
+
// second audio track) is named now, not after a muted export. No ffprobe = nothing to say.
|
|
294
|
+
if (info.category === 'video' && ffprobe) {
|
|
295
|
+
const warning = describeMedia(clip.asset, probeMedia(fileAbs, { ffprobe }));
|
|
296
|
+
if (warning) {
|
|
297
|
+
clip.warning = warning;
|
|
298
|
+
warnings.push(warning);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
clips.push(clip);
|
|
285
302
|
}
|
|
286
303
|
}
|
|
287
304
|
|
|
288
|
-
return { clips, skipped, assetsDir };
|
|
305
|
+
return { clips, skipped, warnings, assetsDir };
|
|
289
306
|
}
|
|
290
307
|
|
|
291
308
|
// ── CLI ──────────────────────────────────────────────────────────────────────
|
|
@@ -374,6 +391,7 @@ async function main() {
|
|
|
374
391
|
maxBytes: opts.maxBytes,
|
|
375
392
|
recursive: opts.recursive,
|
|
376
393
|
});
|
|
394
|
+
for (const w of r.warnings) process.stderr.write(`ingest-footage: ⚠ ${w}\n`);
|
|
377
395
|
process.stdout.write(`${JSON.stringify(r, null, 2)}\n`);
|
|
378
396
|
} catch (err) {
|
|
379
397
|
process.stderr.write(`ingest-footage: ${err.message}\n`);
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// _media-probe.mjs — what a video clip is made of, and the three things that make an export of it
|
|
2
|
+
// fail (#128 §1, root cause of #127).
|
|
3
|
+
//
|
|
4
|
+
// An iPhone clip is HEVC and variable frame rate; a `.mov` can carry a second (spatial) audio track.
|
|
5
|
+
// All of them PLAY in the Player, then the export's audio renderer (`renderMediaOnWeb`) cannot decode
|
|
6
|
+
// them, the exporter falls back to frame-by-frame capture, and the file ships with no sound — with
|
|
7
|
+
// nothing said at import. This module is the one place that reads a clip with `ffprobe` and says so:
|
|
8
|
+
//
|
|
9
|
+
// probeMedia(abs) → { video, audio[], durationSec } or null (no ffprobe / unreadable)
|
|
10
|
+
// mediaIssues(probe) → [{ kind: 'hevc' | 'vfr' | 'audio-tracks', label }]
|
|
11
|
+
// describeMedia(rel, probe) → one sentence naming the asset and the codec, or null when all is well
|
|
12
|
+
// makeProxy({ src, outDir }) → an H.264 / constant-frame-rate / one-AAC copy next to the original
|
|
13
|
+
//
|
|
14
|
+
// A soft dependency, like decode.ts: ffmpeg/ffprobe are never bundled (DDR-177). Without them every
|
|
15
|
+
// function answers "nothing to say" — a warning is never invented, and an import is never blocked.
|
|
16
|
+
// Arguments always go to the tools as an args array (never a shell string), and the file is always an
|
|
17
|
+
// ABSOLUTE path, so a name starting with "-" can never be read as an option.
|
|
18
|
+
//
|
|
19
|
+
// Plain Node ESM so the `maude design` verbs (node) and the studio (bun) share it.
|
|
20
|
+
|
|
21
|
+
import { spawnSync } from 'node:child_process';
|
|
22
|
+
import { createHash } from 'node:crypto';
|
|
23
|
+
import { existsSync, readFileSync, renameSync, rmSync, statSync } from 'node:fs';
|
|
24
|
+
import { delimiter, join } from 'node:path';
|
|
25
|
+
|
|
26
|
+
const EXTRA_TOOL_DIRS = ['/opt/homebrew/bin', '/usr/local/bin', '/usr/bin'];
|
|
27
|
+
const PROBE_TIMEOUT_MS = 20_000;
|
|
28
|
+
const PROXY_TIMEOUT_MS = 30 * 60_000;
|
|
29
|
+
/** The constant frame rates a variable-rate clip is conformed to (nearest to its average). */
|
|
30
|
+
const CFR_CHOICES = [24, 25, 30, 50, 60];
|
|
31
|
+
/** avg vs. peak frame rate further apart than this is "variable" (a CFR clip's two are equal). */
|
|
32
|
+
const VFR_TOLERANCE = 0.05;
|
|
33
|
+
|
|
34
|
+
/** A working `<dir>/<name>` (PATH, then Homebrew's dirs) that answers `-version`, or null. */
|
|
35
|
+
export function findTool(name, o = {}) {
|
|
36
|
+
const dirs = [
|
|
37
|
+
...(o.path ?? process.env.PATH ?? '').split(delimiter).filter(Boolean),
|
|
38
|
+
...(o.extraDirs ?? EXTRA_TOOL_DIRS),
|
|
39
|
+
];
|
|
40
|
+
for (const d of dirs) {
|
|
41
|
+
const c = join(d, name);
|
|
42
|
+
if (!existsSync(c)) continue;
|
|
43
|
+
const probe = spawnSync(c, ['-version'], { stdio: 'ignore' });
|
|
44
|
+
if (!probe.error && probe.status === 0) return c;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** `"30000/1001"` → 29.97; anything unusable → 0. */
|
|
50
|
+
function rate(v) {
|
|
51
|
+
if (typeof v !== 'string') return 0;
|
|
52
|
+
const [n, d] = v.split('/').map(Number);
|
|
53
|
+
if (!Number.isFinite(n) || !Number.isFinite(d) || d === 0) return 0;
|
|
54
|
+
return n / d;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const num = (v) => {
|
|
58
|
+
const n = Number(v);
|
|
59
|
+
return Number.isFinite(n) ? n : undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Read a clip. Returns null when ffprobe is absent, fails, or the file has no video stream.
|
|
64
|
+
* `o.ffprobe`: a path (or `null` = "pretend there is none"); default = look it up.
|
|
65
|
+
*/
|
|
66
|
+
export function probeMedia(abs, o = {}) {
|
|
67
|
+
const ffprobe = o.ffprobe === undefined ? findTool('ffprobe') : o.ffprobe;
|
|
68
|
+
if (!ffprobe) return null;
|
|
69
|
+
const run = spawnSync(
|
|
70
|
+
ffprobe,
|
|
71
|
+
['-v', 'error', '-print_format', 'json', '-show_streams', '-show_format', abs],
|
|
72
|
+
{ encoding: 'utf8', timeout: PROBE_TIMEOUT_MS, maxBuffer: 8 * 1024 * 1024 }
|
|
73
|
+
);
|
|
74
|
+
if (run.error || run.status !== 0) return null;
|
|
75
|
+
let j;
|
|
76
|
+
try {
|
|
77
|
+
j = JSON.parse(run.stdout);
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const streams = Array.isArray(j?.streams) ? j.streams : [];
|
|
82
|
+
const v = streams.find((s) => s?.codec_type === 'video' && s?.disposition?.attached_pic !== 1);
|
|
83
|
+
if (!v) return null;
|
|
84
|
+
const avg = rate(v.avg_frame_rate);
|
|
85
|
+
const peak = rate(v.r_frame_rate);
|
|
86
|
+
const vfr = avg > 0 && peak > 0 && Math.abs(avg - peak) / Math.max(avg, peak) > VFR_TOLERANCE;
|
|
87
|
+
return {
|
|
88
|
+
video: {
|
|
89
|
+
codec: String(v.codec_name ?? 'unknown'),
|
|
90
|
+
profile: typeof v.profile === 'string' ? v.profile : undefined,
|
|
91
|
+
width: num(v.width),
|
|
92
|
+
height: num(v.height),
|
|
93
|
+
avgFps: avg || undefined,
|
|
94
|
+
peakFps: peak || undefined,
|
|
95
|
+
rFrameRate: typeof v.r_frame_rate === 'string' ? v.r_frame_rate : undefined,
|
|
96
|
+
vfr,
|
|
97
|
+
},
|
|
98
|
+
audio: streams
|
|
99
|
+
.filter((s) => s?.codec_type === 'audio')
|
|
100
|
+
.map((s) => ({ codec: String(s.codec_name ?? 'unknown') })),
|
|
101
|
+
durationSec: num(j?.format?.duration),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const round1 = (n) => Math.round(n * 10) / 10;
|
|
106
|
+
|
|
107
|
+
/** What is wrong with this clip for an export. Empty = nothing. */
|
|
108
|
+
export function mediaIssues(probe) {
|
|
109
|
+
if (!probe?.video) return [];
|
|
110
|
+
const out = [];
|
|
111
|
+
const c = probe.video.codec.toLowerCase();
|
|
112
|
+
if (c === 'hevc' || c === 'h265') out.push({ kind: 'hevc', label: 'HEVC (H.265)' });
|
|
113
|
+
if (probe.video.vfr) {
|
|
114
|
+
const fps = probe.video.avgFps;
|
|
115
|
+
out.push({
|
|
116
|
+
kind: 'vfr',
|
|
117
|
+
label: fps ? `variable frame rate (about ${round1(fps)} fps)` : 'variable frame rate',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (probe.audio.length > 1) {
|
|
121
|
+
out.push({
|
|
122
|
+
kind: 'audio-tracks',
|
|
123
|
+
label: `${probe.audio.length} audio tracks (${probe.audio.map((a) => a.codec).join(', ')})`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The labels as one phrase: `HEVC (H.265), variable frame rate (about 32.5 fps)`. */
|
|
130
|
+
export function issuesPhrase(issues) {
|
|
131
|
+
return issues.map((i) => i.label).join(', ');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The sentence that names the asset and the codec. `null` when the clip is fine (or unreadable).
|
|
136
|
+
* `rel` is shown as given (`assets/3b165be8.mp4`).
|
|
137
|
+
*/
|
|
138
|
+
export function describeMedia(rel, probe) {
|
|
139
|
+
const issues = mediaIssues(probe);
|
|
140
|
+
if (!issues.length) return null;
|
|
141
|
+
return (
|
|
142
|
+
`${rel} is ${issuesPhrase(issues)}: the export may not be able to decode it, and then the ` +
|
|
143
|
+
`video would have no sound. Make an H.264 copy next to it with \`maude design video-proxy ${rel}\`.`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The constant frame rate a proxy of this clip gets. */
|
|
148
|
+
export function proxyFps(probe) {
|
|
149
|
+
const v = probe?.video;
|
|
150
|
+
if (v && !v.vfr && v.rFrameRate && rate(v.rFrameRate) > 0) return v.rFrameRate;
|
|
151
|
+
const avg = v?.avgFps ?? 30;
|
|
152
|
+
let best = CFR_CHOICES[0];
|
|
153
|
+
for (const c of CFR_CHOICES) if (Math.abs(c - avg) < Math.abs(best - avg)) best = c;
|
|
154
|
+
return String(best);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** The ffmpeg arguments for the proxy: first video + first audio only, H.264 / CFR / yuv420p / AAC. */
|
|
158
|
+
export function proxyArgs(src, out, probe) {
|
|
159
|
+
return [
|
|
160
|
+
'-nostdin',
|
|
161
|
+
'-y',
|
|
162
|
+
'-v',
|
|
163
|
+
'error',
|
|
164
|
+
'-i',
|
|
165
|
+
src,
|
|
166
|
+
'-map',
|
|
167
|
+
'0:v:0',
|
|
168
|
+
'-map',
|
|
169
|
+
'0:a:0?',
|
|
170
|
+
'-vf',
|
|
171
|
+
`fps=${proxyFps(probe)},format=yuv420p`,
|
|
172
|
+
'-c:v',
|
|
173
|
+
'libx264',
|
|
174
|
+
'-crf',
|
|
175
|
+
'18',
|
|
176
|
+
'-preset',
|
|
177
|
+
'medium',
|
|
178
|
+
'-c:a',
|
|
179
|
+
'aac',
|
|
180
|
+
'-b:a',
|
|
181
|
+
'192k',
|
|
182
|
+
'-movflags',
|
|
183
|
+
'+faststart',
|
|
184
|
+
'-f',
|
|
185
|
+
'mp4',
|
|
186
|
+
out,
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export class ProxyError extends Error {
|
|
191
|
+
constructor(message, code = 1) {
|
|
192
|
+
super(message);
|
|
193
|
+
this.code = code;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Write the proxy of `src` (absolute) into `outDir` (absolute) as `<sha8>.mp4` — content-addressed like
|
|
199
|
+
* every asset, so it resolves everywhere an asset does. The original is only ever read. Returns
|
|
200
|
+
* `{ file, name, reused, probe, issues }`. Throws ProxyError (code 3 = no ffmpeg/ffprobe, 4 = not a
|
|
201
|
+
* readable video, 1 = the encode failed).
|
|
202
|
+
*/
|
|
203
|
+
export function makeProxy({ src, outDir, ffmpeg, ffprobe }) {
|
|
204
|
+
const ff = ffmpeg === undefined ? findTool('ffmpeg') : ffmpeg;
|
|
205
|
+
const fp = ffprobe === undefined ? findTool('ffprobe') : ffprobe;
|
|
206
|
+
if (!ff || !fp) throw new ProxyError('ffmpeg and ffprobe are needed to make an H.264 copy', 3);
|
|
207
|
+
const probe = probeMedia(src, { ffprobe: fp });
|
|
208
|
+
if (!probe) throw new ProxyError('this file has no video that ffprobe can read', 4);
|
|
209
|
+
const part = join(outDir, `.proxy-${process.pid}-${Date.now()}.part`);
|
|
210
|
+
try {
|
|
211
|
+
const run = spawnSync(ff, proxyArgs(src, part, probe), {
|
|
212
|
+
encoding: 'utf8',
|
|
213
|
+
timeout: PROXY_TIMEOUT_MS,
|
|
214
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
215
|
+
});
|
|
216
|
+
if (run.error) throw new ProxyError(`ffmpeg could not start: ${run.error.message}`);
|
|
217
|
+
if (run.status !== 0) {
|
|
218
|
+
const tail = (run.stderr || '').trim().split('\n').slice(-3).join(' ');
|
|
219
|
+
throw new ProxyError(`ffmpeg could not convert this file: ${tail || `exit ${run.status}`}`);
|
|
220
|
+
}
|
|
221
|
+
if (!statSync(part).size) throw new ProxyError('ffmpeg wrote an empty file');
|
|
222
|
+
const sha8 = createHash('sha256').update(readFileSync(part)).digest('hex').slice(0, 8);
|
|
223
|
+
const name = `${sha8}.mp4`;
|
|
224
|
+
const file = join(outDir, name);
|
|
225
|
+
const reused = existsSync(file);
|
|
226
|
+
if (reused) rmSync(part, { force: true });
|
|
227
|
+
else renameSync(part, file);
|
|
228
|
+
return { file, name, reused, probe, issues: mediaIssues(probe) };
|
|
229
|
+
} finally {
|
|
230
|
+
rmSync(part, { force: true });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
// Exit: 0 measured / 1 failed / 2 bad args.
|
|
27
27
|
|
|
28
28
|
import { launchChromium, launchWebkit } from './_pw-launch.mjs';
|
|
29
|
+
import { readLaunchFd } from './_url-guard.mjs';
|
|
29
30
|
|
|
30
31
|
function parseArgs(argv) {
|
|
31
32
|
const o = {
|
|
@@ -48,6 +49,8 @@ function parseArgs(argv) {
|
|
|
48
49
|
const a = argv[i];
|
|
49
50
|
const v = () => argv[++i];
|
|
50
51
|
if (a === '--url') o.url = v();
|
|
52
|
+
else if (a === '--launch') o.launch = v();
|
|
53
|
+
else if (a === '--launch-fd') o.launch = readLaunchFd(v());
|
|
51
54
|
else if (a === '--open') o.open = v();
|
|
52
55
|
else if (a === '--engine') o.engine = v();
|
|
53
56
|
else if (a === '--window') o.window = v();
|
|
@@ -157,6 +160,9 @@ async function main() {
|
|
|
157
160
|
for (const { name, value } of r?.metrics || []) m[name] = value;
|
|
158
161
|
return m;
|
|
159
162
|
};
|
|
163
|
+
// sec-loopback-bearer §7.4 — a one-time opening link (perf.sh `studio_launch_url`): visited first, it
|
|
164
|
+
// leaves the session cookie the studio page needs; every later URL is built from --url as before
|
|
165
|
+
if (o.launch) await page.goto(o.launch, { waitUntil: 'domcontentloaded' });
|
|
160
166
|
const t0 = Date.now();
|
|
161
167
|
const enc = o.open.split('/').map(encodeURIComponent).join('/');
|
|
162
168
|
// --bare <query>: the canvas page on its own (top level — every artboard live unless the query says
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
readHistory,
|
|
62
62
|
renderReport,
|
|
63
63
|
} from './_perf-shared.mjs';
|
|
64
|
+
import { readLaunchFd } from './_url-guard.mjs';
|
|
64
65
|
|
|
65
66
|
function parseArgs(argv) {
|
|
66
67
|
const out = {
|
|
@@ -87,6 +88,8 @@ function parseArgs(argv) {
|
|
|
87
88
|
for (let i = 0; i < argv.length; i++) {
|
|
88
89
|
const a = argv[i];
|
|
89
90
|
if (a === '--url') out.url = argv[++i];
|
|
91
|
+
else if (a === '--launch') out.launch = argv[++i];
|
|
92
|
+
else if (a === '--launch-fd') out.launch = readLaunchFd(argv[++i]);
|
|
90
93
|
else if (a === '--label') out.label = argv[++i];
|
|
91
94
|
else if (a === '--history') out.history = argv[++i];
|
|
92
95
|
else if (a === '--variant') out.variant = argv[++i];
|
|
@@ -326,6 +329,9 @@ async function main() {
|
|
|
326
329
|
width: opts.windowSize.w,
|
|
327
330
|
height: opts.windowSize.h,
|
|
328
331
|
});
|
|
332
|
+
// sec-loopback-bearer §7.4 — a one-time opening link (perf.sh `studio_launch_url`): visited first, it
|
|
333
|
+
// leaves the session cookie the studio page needs; every later URL is built from --url as before
|
|
334
|
+
if (opts.launch) await wd(opts.driverPort, 'POST', `${base}/url`, { url: opts.launch });
|
|
329
335
|
await wd(opts.driverPort, 'POST', `${base}/url`, { url: opts.url });
|
|
330
336
|
|
|
331
337
|
// Studio mode measures the canvas AS THE USER RUNS IT: inside the studio
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
renderReport,
|
|
31
31
|
} from './_perf-shared.mjs';
|
|
32
32
|
import { launchChromium } from './_pw-launch.mjs';
|
|
33
|
+
import { readLaunchFd } from './_url-guard.mjs';
|
|
33
34
|
|
|
34
35
|
function parseArgs(argv) {
|
|
35
36
|
const o = {
|
|
@@ -55,6 +56,8 @@ function parseArgs(argv) {
|
|
|
55
56
|
const a = argv[i];
|
|
56
57
|
const v = () => argv[++i];
|
|
57
58
|
if (a === '--url') o.url = v();
|
|
59
|
+
else if (a === '--launch') o.launch = v();
|
|
60
|
+
else if (a === '--launch-fd') o.launch = readLaunchFd(v());
|
|
58
61
|
else if (a === '--studio') o.studio = v();
|
|
59
62
|
else if (a === '--label') o.label = v();
|
|
60
63
|
else if (a === '--history') o.history = v();
|
|
@@ -100,7 +103,9 @@ async function main() {
|
|
|
100
103
|
deviceScaleFactor: opts.dpr,
|
|
101
104
|
});
|
|
102
105
|
const page = await ctx.newPage();
|
|
103
|
-
|
|
106
|
+
// sec-loopback-bearer §7.4 — a one-time opening link (perf.sh `studio_launch_url`): visited first, it
|
|
107
|
+
// leaves the session cookie the studio page needs; every later URL is built from --url as before
|
|
108
|
+
await page.goto(opts.launch || opts.url, { waitUntil: 'domcontentloaded' });
|
|
104
109
|
const rowSel = `[data-testid="canvas-row-${opts.studio}"]`;
|
|
105
110
|
// A canvas the Canvases panel does not list (the Design system canvas under system/) is opened by its path.
|
|
106
111
|
const viaPath = async () => {
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
readHistory,
|
|
40
40
|
renderReport,
|
|
41
41
|
} from './_perf-shared.mjs';
|
|
42
|
+
import { redactUrl } from './_url-guard.mjs';
|
|
42
43
|
|
|
43
44
|
const AB = resolveAgentBrowserBin();
|
|
44
45
|
|
|
@@ -102,10 +103,12 @@ function parseArgs(argv) {
|
|
|
102
103
|
return out;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
function ab(args) {
|
|
106
|
+
function ab(args, quiet = false) {
|
|
106
107
|
return execFileSync(AB, ['--session', AB_SESSION, ...args], {
|
|
107
108
|
encoding: 'utf8',
|
|
108
109
|
maxBuffer: 32 * 1024 * 1024,
|
|
110
|
+
// `open` can echo its URL (a frame capability) — never to stderr, which the AI chat reads
|
|
111
|
+
...(quiet ? { stdio: 'ignore' } : {}),
|
|
109
112
|
});
|
|
110
113
|
}
|
|
111
114
|
|
|
@@ -147,9 +150,11 @@ async function main() {
|
|
|
147
150
|
|
|
148
151
|
try {
|
|
149
152
|
opened = true;
|
|
150
|
-
ab(['open', opts.url]);
|
|
153
|
+
ab(['open', opts.url], true);
|
|
151
154
|
} catch (err) {
|
|
152
|
-
console.error(
|
|
155
|
+
console.error(
|
|
156
|
+
`_perf-probe.mjs: agent-browser could not open ${redactUrl(opts.url)}\n${redactUrl(err.message)}`
|
|
157
|
+
);
|
|
153
158
|
process.exit(1);
|
|
154
159
|
}
|
|
155
160
|
|