@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
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
import { readFileSync, statSync } from 'node:fs';
|
|
16
16
|
import path from 'node:path';
|
|
17
|
-
|
|
17
|
+
import { readAssetAdded } from './asset-added.ts';
|
|
18
18
|
import { homeShort, readAssetOrigin } from './asset-origins.ts';
|
|
19
19
|
import { sidecarsOf } from './asset-trash.ts';
|
|
20
|
+
import { describeMedia, probeMedia } from './bin/_media-probe.mjs';
|
|
20
21
|
import { walkIdElements } from './element-ids.ts';
|
|
21
22
|
import { readGen } from './generation/gen-sidecar.ts';
|
|
22
23
|
import { assetKindOf } from './index/extractors/asset-usage.ts';
|
|
@@ -72,7 +73,15 @@ export interface AssetDetails {
|
|
|
72
73
|
mtimeMs: number;
|
|
73
74
|
madeByAi: MadeByAi | null;
|
|
74
75
|
footage: FootageFacts | null;
|
|
75
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* A clip that plays but cannot be exported with sound — HEVC, variable frame rate, a second audio track
|
|
78
|
+
* (#128 §1): the sentence names the asset and the codec and the fix. Only present for such a clip.
|
|
79
|
+
*/
|
|
80
|
+
mediaWarnings?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* "Added by <name>" — from the synced `assets/<stem>.added.json` (#172), told to every session that may see the asset;
|
|
83
|
+
* else the display name this Mac's origin record keeps, only to a session that may hear the Original. Never an e-mail.
|
|
84
|
+
*/
|
|
76
85
|
addedBy?: string;
|
|
77
86
|
uses: UseOfAsset[];
|
|
78
87
|
advanced: {
|
|
@@ -266,6 +275,33 @@ export interface AssetDetailsOptions {
|
|
|
266
275
|
/** Tell this session the Original path? Only this Mac's own project session may hear it. */
|
|
267
276
|
includeOriginal: boolean;
|
|
268
277
|
home?: string;
|
|
278
|
+
/** Reads a clip with ffprobe (a seam for the tests); the studio passes none. */
|
|
279
|
+
probe?: typeof probeMedia;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** One probe per file version: the sheet is opened often, ffprobe is a process spawn. */
|
|
283
|
+
const probeCache = new Map<string, string | null>();
|
|
284
|
+
const PROBE_CACHE_MAX = 200;
|
|
285
|
+
|
|
286
|
+
function mediaWarningOf(
|
|
287
|
+
rel: string,
|
|
288
|
+
abs: string,
|
|
289
|
+
st: { size: number; mtimeMs: number },
|
|
290
|
+
probe: typeof probeMedia
|
|
291
|
+
): string | null {
|
|
292
|
+
const key = `${abs}|${st.size}|${Math.round(st.mtimeMs)}`;
|
|
293
|
+
if (probe === probeMedia && probeCache.has(key)) return probeCache.get(key) ?? null;
|
|
294
|
+
let warning: string | null = null;
|
|
295
|
+
try {
|
|
296
|
+
warning = describeMedia(rel, probe(abs));
|
|
297
|
+
} catch {
|
|
298
|
+
warning = null;
|
|
299
|
+
}
|
|
300
|
+
if (probe === probeMedia) {
|
|
301
|
+
if (probeCache.size >= PROBE_CACHE_MAX) probeCache.clear();
|
|
302
|
+
probeCache.set(key, warning);
|
|
303
|
+
}
|
|
304
|
+
return warning;
|
|
269
305
|
}
|
|
270
306
|
|
|
271
307
|
/** Everything the details sheet draws, or null when `rel` is not an asset this project keeps. */
|
|
@@ -310,6 +346,12 @@ export function assetDetails(rel: string, o: AssetDetailsOptions): AssetDetails
|
|
|
310
346
|
}
|
|
311
347
|
|
|
312
348
|
const origin = o.includeOriginal ? readAssetOrigin(o.designRoot, rel) : null;
|
|
349
|
+
// #172 — the synced record is what every peer says; this Mac's own note is only the fallback for an older import
|
|
350
|
+
const addedBy = readAssetAdded(o.designRoot, rel)?.by ?? origin?.by;
|
|
351
|
+
const mediaWarning =
|
|
352
|
+
kind === 'video'
|
|
353
|
+
? mediaWarningOf(rel, path.join(o.designRoot, ...rel.split('/')), st, o.probe ?? probeMedia)
|
|
354
|
+
: null;
|
|
313
355
|
const advanced: AssetDetails['advanced'] = {
|
|
314
356
|
storedAs: rel,
|
|
315
357
|
edits,
|
|
@@ -332,7 +374,8 @@ export function assetDetails(rel: string, o: AssetDetailsOptions): AssetDetails
|
|
|
332
374
|
mtimeMs: Math.round(st.mtimeMs),
|
|
333
375
|
madeByAi: madeByAiOf(o.designRoot, rel),
|
|
334
376
|
footage: kind === 'video' ? footageOf(o.designRoot, rel) : null,
|
|
335
|
-
...(
|
|
377
|
+
...(mediaWarning ? { mediaWarnings: [mediaWarning] } : {}),
|
|
378
|
+
...(addedBy ? { addedBy } : {}),
|
|
336
379
|
uses,
|
|
337
380
|
advanced,
|
|
338
381
|
};
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
// shell caller that holds one (`recordAssetOrigin`). Keyed by the picture's sha8, so the same bytes imported again
|
|
14
14
|
// (same name) keep ONE record: the latest path wins (the person's newest copy is the one they can still find).
|
|
15
15
|
//
|
|
16
|
-
// Leaf module (node:fs / node:path
|
|
16
|
+
// Leaf module (node:fs / node:path + the leaf spoof-chars.ts; erasable TypeScript) — the CLI imports it under bun, the route under bun.
|
|
17
17
|
|
|
18
18
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
19
19
|
import path from 'node:path';
|
|
20
|
+
import { stripNameSpoofChars } from './spoof-chars.ts';
|
|
20
21
|
|
|
21
22
|
export const ORIGINS_REL = '_canvas-state/asset-origins.json';
|
|
22
23
|
/** Oldest entries are dropped past this. */
|
|
@@ -52,10 +53,11 @@ export function originKey(assetRel: unknown): string | null {
|
|
|
52
53
|
/** Longest name kept for "Added by". */
|
|
53
54
|
export const MAX_ORIGIN_BY = 80;
|
|
54
55
|
|
|
55
|
-
/** A display name, or null: no control character, no `@` (an e-mail is not a name), a sane length.
|
|
56
|
+
/** A display name, or null: no control character, no `@` (an e-mail is not a name), a sane length. Bidi, zero-width
|
|
57
|
+
* and Unicode tag characters are stripped first (burndown L4) — a peer-synced name must not reorder or hide text. */
|
|
56
58
|
export function cleanOriginBy(v: unknown): string | null {
|
|
57
59
|
if (typeof v !== 'string') return null;
|
|
58
|
-
const t = v.trim();
|
|
60
|
+
const t = stripNameSpoofChars(v).trim();
|
|
59
61
|
if (!t || t.length > MAX_ORIGIN_BY || CONTROL.test(t) || t.includes('@')) return null;
|
|
60
62
|
return t;
|
|
61
63
|
}
|
|
@@ -27,6 +27,7 @@ const SIDECAR_SUFFIXES = [
|
|
|
27
27
|
'.transcript.json',
|
|
28
28
|
'.beats.json',
|
|
29
29
|
'.gen.json',
|
|
30
|
+
'.added.json',
|
|
30
31
|
'.srt',
|
|
31
32
|
'.vtt',
|
|
32
33
|
'.json',
|
|
@@ -87,7 +88,11 @@ export function sidecarsOf(designRoot: string, rel: string): string[] {
|
|
|
87
88
|
for (const n of names) {
|
|
88
89
|
if (n === name) continue;
|
|
89
90
|
const perUse = PER_USE.exec(n);
|
|
90
|
-
const own =
|
|
91
|
+
const own =
|
|
92
|
+
(perUse && perUse[1] === stem) ||
|
|
93
|
+
SIDECAR_SUFFIXES.some((s) => n === `${base}${s}`) ||
|
|
94
|
+
// the who-added record keyed by the FULL name (burndown F6, asset-added.ts addedRelOf)
|
|
95
|
+
n === `${name}.added.json`;
|
|
91
96
|
// another PICTURE with the same stem is not a sidecar — only the known companion shapes ride along
|
|
92
97
|
if (own && !assetKindOf(n)) out.push(`assets/${n}`);
|
|
93
98
|
}
|
|
@@ -200,10 +200,9 @@ export function validateArgv(argv) {
|
|
|
200
200
|
// V2-8.9 B2 — `--allowed-domains` names hosts, so it never stopped `file://` (no host at all):
|
|
201
201
|
// `open file:///…/.ssh/id_ed25519` + `get text body` read any file. Only http(s) to this Mac.
|
|
202
202
|
// (`screenshot <path>` is confined to the project / temp dir by the dispatcher, cli design.mjs.)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
203
|
+
// sec-loopback-bearer §7.5 — urlRefusal also refuses a one-time opening link in any encoding
|
|
204
|
+
// (_url-guard.mjs `launchRefusal`): the AI's browser never holds a studio session.
|
|
205
|
+
if (sub === 'open') return urlRefusal(rest[0]);
|
|
207
206
|
return null;
|
|
208
207
|
}
|
|
209
208
|
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
// the exit code); returns `null` when the caller should write the board file itself.
|
|
9
9
|
|
|
10
10
|
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
-
import { join } from 'node:path';
|
|
11
|
+
import { dirname, join } from 'node:path';
|
|
12
|
+
|
|
13
|
+
import { findProjectRoot, studioHeadersFor } from '../../../cli/lib/studio-locate.mjs';
|
|
12
14
|
|
|
13
15
|
export class PostOpsError extends Error {
|
|
14
16
|
constructor(message, code = 1) {
|
|
@@ -63,12 +65,15 @@ export function runIdForChat(view, chatId) {
|
|
|
63
65
|
* Claude, an outside write). Any failure to read the runs is "not inside a run" — the studio's
|
|
64
66
|
* gate decides what a tag may do, this only names it.
|
|
65
67
|
*/
|
|
66
|
-
export async function defaultActionId(base, env = process.env) {
|
|
68
|
+
export async function defaultActionId(base, env = process.env, headers = {}) {
|
|
67
69
|
const fallback = `ai-annotate-${Math.random().toString(36).slice(2, 12)}`;
|
|
68
70
|
const chatId = env.MAUDE_CHAT_ID;
|
|
69
71
|
if (typeof chatId !== 'string' || !CHAT_ID.test(chatId)) return fallback;
|
|
70
72
|
try {
|
|
71
|
-
const res = await fetch(`${base}/_api/ai/runs`, {
|
|
73
|
+
const res = await fetch(`${base}/_api/ai/runs`, {
|
|
74
|
+
headers,
|
|
75
|
+
signal: AbortSignal.timeout(3_000),
|
|
76
|
+
});
|
|
72
77
|
if (!res.ok) return fallback;
|
|
73
78
|
const runId = runIdForChat(await res.json(), chatId);
|
|
74
79
|
return runId ? `run:${runId}` : fallback;
|
|
@@ -96,12 +101,16 @@ export async function postOps(designRoot, file, ops, actionId) {
|
|
|
96
101
|
// `url` can't turn the verb into an exfiltration primitive. Anything else
|
|
97
102
|
// silently falls back to the file write (the local intent still succeeds).
|
|
98
103
|
if (!base || !isLoopbackHttpUrl(base)) return null;
|
|
99
|
-
|
|
104
|
+
// sec-loopback-bearer §7.6 — the key of the server serving this project on that port (the app's
|
|
105
|
+
// attested one, or a terminal one whose /_health names the root); none for any other port
|
|
106
|
+
const root = findProjectRoot(designRoot) ?? dirname(designRoot);
|
|
107
|
+
const keyed = await studioHeadersFor(root, new URL(base).port || 80);
|
|
108
|
+
const id = actionId ?? (await defaultActionId(base, process.env, keyed));
|
|
100
109
|
let res;
|
|
101
110
|
try {
|
|
102
111
|
res = await fetch(`${base}/_api/annotations/ops`, {
|
|
103
112
|
method: 'POST',
|
|
104
|
-
headers: { 'Content-Type': 'application/json' },
|
|
113
|
+
headers: { ...keyed, 'Content-Type': 'application/json' },
|
|
105
114
|
body: JSON.stringify({
|
|
106
115
|
file,
|
|
107
116
|
actionId: id,
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
import { existsSync, readFileSync } from 'node:fs';
|
|
24
24
|
import { join } from 'node:path';
|
|
25
25
|
|
|
26
|
+
import { studioHeadersFor } from '../../../cli/lib/studio-locate.mjs';
|
|
27
|
+
|
|
26
28
|
function parseArgs(argv) {
|
|
27
29
|
const out = {};
|
|
28
30
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -68,12 +70,14 @@ async function main() {
|
|
|
68
70
|
const repo = args.root || process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
69
71
|
const port = resolvePort(repo);
|
|
70
72
|
const base = `http://127.0.0.1:${port}/_api/generate`;
|
|
73
|
+
// sec-loopback-bearer §7.6 — the studio's API key (the app's attested server, or a terminal one's)
|
|
74
|
+
const keyed = await studioHeadersFor(repo, port);
|
|
71
75
|
|
|
72
76
|
if (args.reuse) {
|
|
73
77
|
try {
|
|
74
78
|
const res = await fetch(`${base}/audio-reuse`, {
|
|
75
79
|
method: 'POST',
|
|
76
|
-
headers: { 'content-type': 'application/json' },
|
|
80
|
+
headers: { ...keyed, 'content-type': 'application/json' },
|
|
77
81
|
body: JSON.stringify({ id: args.reuse }),
|
|
78
82
|
});
|
|
79
83
|
const json = await res.json().catch(() => ({}));
|
|
@@ -94,7 +98,9 @@ async function main() {
|
|
|
94
98
|
|
|
95
99
|
let data;
|
|
96
100
|
try {
|
|
97
|
-
const res = await fetch(`${base}/audio-search?q=${encodeURIComponent(args.query)}
|
|
101
|
+
const res = await fetch(`${base}/audio-search?q=${encodeURIComponent(args.query)}`, {
|
|
102
|
+
headers: keyed,
|
|
103
|
+
});
|
|
98
104
|
data = await res.json();
|
|
99
105
|
if (!res.ok) {
|
|
100
106
|
process.stderr.write(`audio-search: ${data?.error ?? res.status}\n`);
|
|
@@ -467,9 +467,12 @@ async function main() {
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
// Run only when invoked directly (not when imported by the test). This shim
|
|
470
|
-
// runs under real `node` on a real on-disk path
|
|
471
|
-
//
|
|
472
|
-
//
|
|
473
|
-
|
|
470
|
+
// runs under real `node` on a real on-disk path; since 2.1.1 the server also imports its loopback
|
|
471
|
+
// refusals (the address check), so the module is reachable inside `bun --compile` too. There the
|
|
472
|
+
// argv[1] compare is unreliable — `import.meta.main` is the entry flag under bun, and the compare
|
|
473
|
+
// stays only for plain `node` (Node <24 leaves it undefined).
|
|
474
|
+
const runDirectly =
|
|
475
|
+
import.meta.main ?? (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href);
|
|
476
|
+
if (runDirectly) {
|
|
474
477
|
main();
|
|
475
478
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# _desktop-locate.sh — SOURCED (never run) by the helpers that need a project's studio port: server-up.sh,
|
|
2
|
+
# screenshot.sh, smoke.sh, canvas-rects.sh, perf.sh, runtime-health.sh. #206 T6.3d (DDR-250).
|
|
3
|
+
#
|
|
4
|
+
# While the Maude desktop app runs it owns a checkout's server. `desktop_port` asks the app's registry first
|
|
5
|
+
# (cli/lib/desktop-locate.mjs: the port is used only after the server there answers a fresh attest challenge)
|
|
6
|
+
# and sets DESKTOP_PORT. Return codes (the helper's own):
|
|
7
|
+
# 0 DESKTOP_PORT is the app's attested server for this project — use it, never `_server.json`
|
|
8
|
+
# 10 not the app's (no app, or it has no running server here) — keep the project's own `_server.json` path
|
|
9
|
+
# 11 the app serves this project but its server did not answer the check — fail closed: do NOT fall back
|
|
10
|
+
# to `_server.json` (a planted copy must never win while the app runs); the reason is on stderr
|
|
11
|
+
# 4 the app refused for a reason the person must see (stderr) — server-up only
|
|
12
|
+
#
|
|
13
|
+
# desktop_port <repo> [--ensure capture|show] [--lease]
|
|
14
|
+
# desktop_locate <mode> … the raw call (restart, app-pid)
|
|
15
|
+
#
|
|
16
|
+
# <pkgRoot>/cli/lib/desktop-locate.mjs is three levels above this file in every layout (dev tree, npm install,
|
|
17
|
+
# the .app's Contents/Resources). No JS runtime, or no module → 10 (today's behaviour).
|
|
18
|
+
|
|
19
|
+
_DL_JS="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." 2>/dev/null && pwd)/cli/lib/desktop-locate.mjs"
|
|
20
|
+
|
|
21
|
+
# Fast path: no registry file → no app, without starting a JS runtime. Only a precheck — the module decides
|
|
22
|
+
# everything else (ownership, mode, the test-runner guard). The same default as registryPath() there.
|
|
23
|
+
_dl_registry_file() {
|
|
24
|
+
case "${MAUDE_APP_REGISTRY_FILE:-}" in
|
|
25
|
+
/*) printf '%s' "$MAUDE_APP_REGISTRY_FILE"; return ;;
|
|
26
|
+
esac
|
|
27
|
+
case "$(uname -s 2>/dev/null)" in
|
|
28
|
+
Darwin) printf '%s' "$HOME/Library/Application Support/com.maude.app/servers.json" ;;
|
|
29
|
+
*)
|
|
30
|
+
local data="${XDG_DATA_HOME:-}"
|
|
31
|
+
case "$data" in /*) : ;; *) data="$HOME/.local/share" ;; esac
|
|
32
|
+
printf '%s' "$data/com.maude.app/servers.json"
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
desktop_locate() {
|
|
38
|
+
[ -f "$_DL_JS" ] || return 10
|
|
39
|
+
[ -f "$(_dl_registry_file)" ] || return 10
|
|
40
|
+
if command -v node >/dev/null 2>&1; then
|
|
41
|
+
node "$_DL_JS" "$@"
|
|
42
|
+
elif command -v bun >/dev/null 2>&1; then
|
|
43
|
+
bun "$_DL_JS" "$@"
|
|
44
|
+
else
|
|
45
|
+
return 10
|
|
46
|
+
fi
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
desktop_port() {
|
|
50
|
+
local repo="$1" out rc
|
|
51
|
+
shift
|
|
52
|
+
DESKTOP_PORT=""
|
|
53
|
+
out=$(desktop_locate port --root "$repo" "$@")
|
|
54
|
+
rc=$?
|
|
55
|
+
if [ "$rc" = 0 ]; then
|
|
56
|
+
if [[ "$out" =~ ^[0-9]{1,5}$ ]]; then
|
|
57
|
+
DESKTOP_PORT="$out"
|
|
58
|
+
elif [ -n "$out" ]; then
|
|
59
|
+
return 10 # not a port: ignore it
|
|
60
|
+
fi
|
|
61
|
+
fi
|
|
62
|
+
return "$rc"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# ---------------------------------------------------------------------------------------------------------
|
|
66
|
+
# sec-loopback-bearer §7.5–7.6 — a studio started by the app or from a terminal requires its API key from
|
|
67
|
+
# every caller on its main origin. These are the ONLY way a helper talks to that origin (a static test,
|
|
68
|
+
# cli/lib/helper-studio-key.test.mjs, fails on a bare `curl http://…:$PORT/_…` or `fetch` elsewhere).
|
|
69
|
+
#
|
|
70
|
+
# studio_key <repo> <port> sets STUDIO_KEY (empty: the server needs no key it told us about);
|
|
71
|
+
# returns 11 when the app serves the project but did not attest
|
|
72
|
+
# studio_curl <repo> <port> <curl args…> curl with the key as a header, handed to curl through a
|
|
73
|
+
# config on stdin — never argv or the environment (`ps` shows both)
|
|
74
|
+
# studio_launch_url <repo> <port> [--helper] prints a one-time opening URL (`/?maude-launch=…`) for
|
|
75
|
+
# a browser; --helper for a capture helper's own browser (its session
|
|
76
|
+
# sits in the helpers' budget and never evicts the person's)
|
|
77
|
+
#
|
|
78
|
+
# The key is cached per (repo, port) in an UNEXPORTED shell variable, so a polling loop asks once and no
|
|
79
|
+
# child process inherits it. A request whose body is on stdin cannot use studio_curl.
|
|
80
|
+
|
|
81
|
+
_STUDIO_KEY_FOR=""
|
|
82
|
+
STUDIO_KEY=""
|
|
83
|
+
|
|
84
|
+
_dl_node() {
|
|
85
|
+
[ -f "$_DL_JS" ] || return 10
|
|
86
|
+
if command -v node >/dev/null 2>&1; then
|
|
87
|
+
node "$_DL_JS" "$@"
|
|
88
|
+
elif command -v bun >/dev/null 2>&1; then
|
|
89
|
+
bun "$_DL_JS" "$@"
|
|
90
|
+
else
|
|
91
|
+
return 10
|
|
92
|
+
fi
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
studio_key() {
|
|
96
|
+
local repo="$1" port="$2" out rc
|
|
97
|
+
if [ "$_STUDIO_KEY_FOR" = "$repo|$port" ]; then return 0; fi
|
|
98
|
+
STUDIO_KEY=""
|
|
99
|
+
out=$(_dl_node key --root "$repo" --port "$port" 2>/dev/null)
|
|
100
|
+
rc=$?
|
|
101
|
+
if [ "$rc" = 11 ]; then return 11; fi
|
|
102
|
+
if [ "$rc" = 0 ] && [[ "$out" =~ ^[0-9a-fA-F]{64}$ ]]; then STUDIO_KEY="$out"; fi
|
|
103
|
+
_STUDIO_KEY_FOR="$repo|$port"
|
|
104
|
+
return 0
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
studio_curl() {
|
|
108
|
+
local repo="$1" port="$2"
|
|
109
|
+
shift 2
|
|
110
|
+
# a subshell (`$(studio_curl …)`) cannot fill the caller's cache: call `studio_key` once first
|
|
111
|
+
studio_key "$repo" "$port" || return 7
|
|
112
|
+
if [ -n "$STUDIO_KEY" ]; then
|
|
113
|
+
printf 'header = "x-maude-api-key: %s"\n' "$STUDIO_KEY" | curl --config - "$@"
|
|
114
|
+
else
|
|
115
|
+
curl "$@"
|
|
116
|
+
fi
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# studio_capture_url <repo> <port> <path?query> prints the URL a headless browser opens to capture a
|
|
120
|
+
# canvas (`/_canvas-shell.html?canvas=…`). A key-required server mints the frame capability on that
|
|
121
|
+
# path's 307 only for a caller that sent the key (sec-loopback-bearer §7.3): this asks with the key
|
|
122
|
+
# and prints the capture-origin URL the redirect names. No redirect (the split off), no key, or an
|
|
123
|
+
# unexpected answer: the main-origin URL, as before. Never prints the key or a launch token.
|
|
124
|
+
studio_capture_url() {
|
|
125
|
+
local repo="$1" port="$2" rel="$3" loc
|
|
126
|
+
loc=$(studio_curl "$repo" "$port" -s -o /dev/null --max-time 5 -w '%{redirect_url}' \
|
|
127
|
+
"http://localhost:${port}${rel}" 2>/dev/null)
|
|
128
|
+
if [[ "$loc" =~ ^http://(localhost|127\.0\.0\.1|\[::1\]):[0-9]{1,5}/_canvas-shell\.html(\?|$) ]]; then
|
|
129
|
+
printf '%s\n' "$loc"
|
|
130
|
+
else
|
|
131
|
+
printf 'http://localhost:%s%s\n' "$port" "$rel"
|
|
132
|
+
fi
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
studio_launch_url() {
|
|
136
|
+
local repo="$1" port="$2" out
|
|
137
|
+
local kind=()
|
|
138
|
+
[ "${3:-}" = "--helper" ] && kind=(--helper)
|
|
139
|
+
out=$(_dl_node launch-url --root "$repo" --port "$port" "${kind[@]}" 2>/dev/null)
|
|
140
|
+
if [[ "$out" =~ ^http://localhost:[0-9]{1,5}/ ]]; then
|
|
141
|
+
printf '%s\n' "$out"
|
|
142
|
+
else
|
|
143
|
+
printf 'http://localhost:%s/\n' "$port"
|
|
144
|
+
fi
|
|
145
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// `_server.json` cannot point ds-check at another host or project. Any failure → "no studio": ds-check then
|
|
7
7
|
// says so and prints the static reasons only.
|
|
8
8
|
import { resolve } from 'node:path';
|
|
9
|
-
import { locateStudio } from '../../../cli/lib/studio-locate.mjs';
|
|
9
|
+
import { locateStudio, studioHeaders } from '../../../cli/lib/studio-locate.mjs';
|
|
10
10
|
import { NO_STUDIO, refusedFromIndex } from '../ds/post-build.ts';
|
|
11
11
|
|
|
12
12
|
/** The project root ds-check will use (`--root`, else $CLAUDE_PROJECT_DIR, else the cwd). */
|
|
@@ -27,6 +27,7 @@ export async function liveRefusals(root, { locate = locateStudio, timeoutMs = 15
|
|
|
27
27
|
const studio = await locate(root, { timeoutMs });
|
|
28
28
|
if (!studio) return NO_STUDIO;
|
|
29
29
|
const res = await fetch(`${studio.base}/_index-data`, {
|
|
30
|
+
headers: studioHeaders(studio),
|
|
30
31
|
signal: AbortSignal.timeout(timeoutMs),
|
|
31
32
|
});
|
|
32
33
|
if (!res.ok) return NO_STUDIO;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// list GET /_api/export-history — this session's recent exports (effect none)
|
|
5
5
|
// retry <id|i> S8.4 — run only the items of one group job that did not make it, again
|
|
6
6
|
// (POST /_api/export-jobs/retry — the Exports panel's "Retry <name>"); effect project
|
|
7
|
+
// cancel <id> #128 T3.7b — stop one of your unfinished exports (POST /_api/export-jobs/cancel —
|
|
8
|
+
// the Exports panel's "Cancel" on a running cloud row); effect project
|
|
7
9
|
// again <id|i> re-submit one entry through the SAME jobs path the Export sheet's
|
|
8
10
|
// "Export again" row uses: POST /_api/export-jobs with replayExportJob(entry)
|
|
9
11
|
// (exporters/replay.ts — the sheet's scope fallback), wait for the job, write
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
import { existsSync, mkdirSync, statSync, writeFileSync } from 'node:fs';
|
|
15
17
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
16
18
|
import { outputViolation, violationMessage } from '../../../cli/lib/confine-out.mjs';
|
|
19
|
+
import { studioHeaders } from '../../../cli/lib/studio-locate.mjs';
|
|
17
20
|
import { replayExportBody } from '../exporters/replay.ts';
|
|
18
21
|
import {
|
|
19
22
|
call,
|
|
@@ -30,11 +33,14 @@ import {
|
|
|
30
33
|
export const USAGE = `usage: maude design exports list [--json] [--root <project>]
|
|
31
34
|
maude design exports again <id | index> [--out <file|folder/>] [--no-wait] [--json] [--root <project>]
|
|
32
35
|
maude design exports retry <id | index> [--item <id[,id…]>] [--no-wait] [--json] [--root <project>]
|
|
36
|
+
maude design exports cancel <id> [--json] [--root <project>]
|
|
33
37
|
list recent exports, newest first (index 0 is the newest)
|
|
34
38
|
again export that entry again, exactly as the Export sheet's "Export again" does; waits for the
|
|
35
39
|
job and writes the file to --out (default: the current folder). --no-wait only queues it.
|
|
36
40
|
retry run again ONLY the items of that export that did not make it (all of them, or --item); the
|
|
37
41
|
ones that made it are left alone. Waits for the job and says how many made it.
|
|
42
|
+
cancel stop one of YOUR unfinished exports (the id the panel row shows); a running cloud video is
|
|
43
|
+
also stopped on the render service. Another person's export is not found.
|
|
38
44
|
Exit 0 ok · 1 not found / the export failed · 2 usage · 3 no studio running.
|
|
39
45
|
`;
|
|
40
46
|
|
|
@@ -164,7 +170,8 @@ async function fetchBytes(studio, jobId) {
|
|
|
164
170
|
try {
|
|
165
171
|
const res = await fetch(
|
|
166
172
|
`${studio.base}/_api/export-jobs/download?${new URLSearchParams({ id: jobId })}`,
|
|
167
|
-
|
|
173
|
+
// sec-loopback-bearer §7.6 — the studio's API key, like every `call`
|
|
174
|
+
{ headers: studioHeaders(studio), signal: AbortSignal.timeout(60_000) }
|
|
168
175
|
);
|
|
169
176
|
return res.ok ? new Uint8Array(await res.arrayBuffer()) : null;
|
|
170
177
|
} catch {
|
|
@@ -232,7 +239,36 @@ async function retry(words) {
|
|
|
232
239
|
return failed.length || done.status === 'failed' ? 1 : 0;
|
|
233
240
|
}
|
|
234
241
|
|
|
235
|
-
|
|
242
|
+
async function cancel(words) {
|
|
243
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--root'] });
|
|
244
|
+
if (pos.length !== 1) throw new UsageError('cancel takes one <id>');
|
|
245
|
+
const c = await connect('exports', flags['--root']);
|
|
246
|
+
if (c.exit) return c.exit;
|
|
247
|
+
const id = pos[0];
|
|
248
|
+
const posted = await call(c.studio, '/_api/export-jobs/cancel', { method: 'POST', json: { id } });
|
|
249
|
+
if (posted?.status !== 200) {
|
|
250
|
+
const why =
|
|
251
|
+
posted?.status === 404
|
|
252
|
+
? 'that export is not here any more'
|
|
253
|
+
: posted?.status === 409
|
|
254
|
+
? 'it has already finished'
|
|
255
|
+
: posted?.status === 502
|
|
256
|
+
? 'the cloud did not answer'
|
|
257
|
+
: posted
|
|
258
|
+
? clean(posted.text).slice(0, 200) || posted.status
|
|
259
|
+
: 'no answer';
|
|
260
|
+
process.stderr.write(`maude design exports cancel: not cancelled (${why})\n`);
|
|
261
|
+
return 1;
|
|
262
|
+
}
|
|
263
|
+
process.stdout.write(
|
|
264
|
+
flags['--json']
|
|
265
|
+
? `${JSON.stringify(untrustedJson({ jobId: id, cancelled: true }))}\n`
|
|
266
|
+
: `→ cancelled ${clean(id)}\n`
|
|
267
|
+
);
|
|
268
|
+
return 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const SUBS = { list, again, retry, cancel };
|
|
236
272
|
|
|
237
273
|
if (import.meta.main) {
|
|
238
274
|
runVerb('exports', USAGE, async (words) => {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
|
|
28
28
|
export const USAGE = `usage: maude design history list [<canvas>] [--limit N] [--json] [--root <project>]
|
|
29
29
|
maude design history show <ref> [<canvas>] [--json] [--root <project>]
|
|
30
|
-
maude design history diff [<canvas>] [--from <ref>] [--to <ref>|now] [--json] [--root <project>]
|
|
30
|
+
maude design history diff [<canvas>] [--from <ref> | --run <id>|@mine] [--to <ref>|now] [--json] [--root <project>]
|
|
31
31
|
maude design history object <canvas> <artboard>/<id> | <annotation-id> [--json] [--root <project>]
|
|
32
32
|
maude design history restore <canvas> <ref> [--artboard <id> | --element <artboard>/<id>] [--json] [--root <project>]
|
|
33
33
|
maude design history undo --action <id> | --chat <id> [--redo] [--json] [--root <project>]
|
|
@@ -37,8 +37,9 @@ export const USAGE = `usage: maude design history list [<canvas>] [--limit N] [-
|
|
|
37
37
|
list the versions, newest first
|
|
38
38
|
show one version: who, when, what it was, the canvases it touched
|
|
39
39
|
diff what changed since <ref>: a synced project names the canvas and says it in words, from
|
|
40
|
-
the version before
|
|
41
|
-
<
|
|
40
|
+
the version before the newest AI run's first version on that canvas (or --from, or
|
|
41
|
+
--run <id>: that run's; --run @mine: this chat's newest run) to now (or --to); a git
|
|
42
|
+
project diffs since <ref> (default: the last commit)
|
|
42
43
|
object one object's versions, newest first (a canvas element by <artboard>/<id>, or a sticky /
|
|
43
44
|
arrow / sticker by its annotation id); rows followed back by matching say so — synced
|
|
44
45
|
restore the whole canvas back to <ref>, as a NEW version (Now stays in the history) — synced;
|
|
@@ -80,10 +81,23 @@ const canvasesOf = (row) => (row.canvases ?? []).map((c) => field(c).replace(/^\
|
|
|
80
81
|
// p8-fix-d F20 — the person by name (the studio's lookup, `actorName`), an AI run as "· AI"
|
|
81
82
|
// (CONTRACT §3), and a prompt-less run's placeholder label ("Claude Code") is not printed as if it
|
|
82
83
|
// were the prompt.
|
|
84
|
+
/**
|
|
85
|
+
* #164 B3 — which agent made an AI version, from what the row carries: a Maude chat's run names its
|
|
86
|
+
* chat; a run with no chat is a terminal session's. A row with neither (older rows) names no agent —
|
|
87
|
+
* the placeholder label is never read as one.
|
|
88
|
+
*/
|
|
89
|
+
export function agentOf(row) {
|
|
90
|
+
if (row?.kind !== 'ai') return undefined;
|
|
91
|
+
if (row.chatId) return 'Maude chat';
|
|
92
|
+
if (row.runId) return 'Claude Code';
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
function syncedLine(row) {
|
|
84
97
|
const ai = row.kind === 'ai';
|
|
85
98
|
const person = row.actorName ?? row.actor ?? '?';
|
|
86
|
-
const
|
|
99
|
+
const agent = agentOf(row);
|
|
100
|
+
const who = `${field(person)}${row.mine ? ' (you)' : ''}${ai ? ` · AI${agent ? ` (${agent})` : ''}` : ''}`;
|
|
87
101
|
const label = ai ? (promptOfRun(row.label) ?? '') : (row.label ?? '');
|
|
88
102
|
const where = canvasesOf(row).join(', ');
|
|
89
103
|
return `r${field(row.revision)} ${when(row.committedAt)} ${who} ${field(row.kind ?? '')}${label ? ` ${field(label)}` : ''}${where ? ` · ${where}` : ''}`;
|
|
@@ -109,7 +123,15 @@ async function list(words) {
|
|
|
109
123
|
const repoRel = canvasArg(c.root, pos[0]);
|
|
110
124
|
const v = await versions(c.studio, { repoRel, limit });
|
|
111
125
|
if (v.kind === 'synced') {
|
|
112
|
-
if (flags['--json'])
|
|
126
|
+
if (flags['--json'])
|
|
127
|
+
out({
|
|
128
|
+
kind: 'synced',
|
|
129
|
+
canvas: repoRel,
|
|
130
|
+
versions: v.rows.map((row) => {
|
|
131
|
+
const agent = agentOf(row);
|
|
132
|
+
return agent ? { ...row, agent } : row;
|
|
133
|
+
}),
|
|
134
|
+
});
|
|
113
135
|
else if (v.rows.length === 0) process.stdout.write('no versions yet\n');
|
|
114
136
|
else writeUntrusted(v.rows.map((row) => `${syncedLine(row)}\n`).join(''));
|
|
115
137
|
return 0;
|
|
@@ -157,14 +179,23 @@ async function show(words) {
|
|
|
157
179
|
async function diff(words) {
|
|
158
180
|
const { flags, pos } = parseWords(words, {
|
|
159
181
|
bool: ['--json'],
|
|
160
|
-
value: ['--from', '--to', '--root'],
|
|
182
|
+
value: ['--from', '--to', '--run', '--root'],
|
|
161
183
|
});
|
|
162
184
|
if (pos.length > 1) throw new UsageError('diff takes at most one canvas');
|
|
185
|
+
const run = flags['--run'];
|
|
186
|
+
if (run !== undefined) {
|
|
187
|
+
if (flags['--from'] !== undefined) throw new UsageError('--run and --from name the same thing');
|
|
188
|
+
if (run !== '@mine' && !CHAT_ID.test(run))
|
|
189
|
+
throw new UsageError('--run takes a run id ([A-Za-z0-9_-], ≤ 64) or @mine');
|
|
190
|
+
if (run === '@mine' && !CHAT_ID.test(process.env.MAUDE_CHAT_ID ?? ''))
|
|
191
|
+
throw new UsageError('--run @mine needs a Maude chat (MAUDE_CHAT_ID is not set)');
|
|
192
|
+
}
|
|
163
193
|
const c = await connect('history', flags['--root']);
|
|
164
194
|
if (c.exit) return c.exit;
|
|
165
195
|
const repoRel = canvasArg(c.root, pos[0]);
|
|
166
|
-
const v = await versions(c.studio, { repoRel, limit:
|
|
196
|
+
const v = await versions(c.studio, { repoRel, limit: 200 });
|
|
167
197
|
if (v.kind === 'synced') return syncedDiff(c, repoRel, v.rows, flags);
|
|
198
|
+
if (run !== undefined) throw new UsageError('--run needs a synced project');
|
|
168
199
|
if (flags['--to'] !== undefined) throw new UsageError('--to needs a synced project');
|
|
169
200
|
const from = flags['--from'] ?? 'HEAD';
|
|
170
201
|
if (from !== 'HEAD' && !SHA.test(from)) throw new UsageError('--from is a commit sha');
|
|
@@ -210,14 +241,53 @@ async function diff(words) {
|
|
|
210
241
|
* the canvas's newest (what its latest version changed) or `--from`, to now or `--to`.
|
|
211
242
|
*/
|
|
212
243
|
const REF = /^(r\d{1,12}|git:[0-9a-f]{7,40})$/i;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The newest AI run in `rows` (newest first), of `chatId` when given. Only this Mac's own runs
|
|
247
|
+
* (`row.mine`) are a target: the default diff must never point at a teammate's run (#164 F3).
|
|
248
|
+
*/
|
|
249
|
+
export function newestRun(rows, chatId) {
|
|
250
|
+
const r = rows.find(
|
|
251
|
+
(x) => x.kind === 'ai' && x.runId && x.mine && (!chatId || x.chatId === chatId)
|
|
252
|
+
);
|
|
253
|
+
return r?.runId;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Index of the OLDEST row of `runId`'s group in `rows` (newest first), or -1. A run's rows are not
|
|
258
|
+
* contiguous — a person's save, or another run, can land between its actions — so the version before
|
|
259
|
+
* the run is the row below this one, never the row below the run's newest (#164 §8).
|
|
260
|
+
*/
|
|
261
|
+
export function oldestOfRun(rows, runId) {
|
|
262
|
+
let at = -1;
|
|
263
|
+
rows.forEach((x, i) => {
|
|
264
|
+
if (x.kind === 'ai' && x.runId === runId) at = i;
|
|
265
|
+
});
|
|
266
|
+
return at;
|
|
267
|
+
}
|
|
268
|
+
|
|
213
269
|
async function syncedDiff(c, repoRel, rows, flags) {
|
|
214
270
|
if (!repoRel) throw new UsageError('diff on a synced project takes a <canvas>');
|
|
215
271
|
const to = flags['--to'] ?? 'now';
|
|
216
272
|
if (to !== 'now' && !REF.test(to)) throw new UsageError('--to is r<n>, git:<sha> or now');
|
|
217
273
|
let from = flags['--from'];
|
|
218
274
|
if (from !== undefined && !REF.test(from)) throw new UsageError('--from is r<n> or git:<sha>');
|
|
275
|
+
const asked = flags['--run'];
|
|
276
|
+
const where = repoRel.replace(/^\.design\//, '');
|
|
277
|
+
let runId = asked;
|
|
278
|
+
if (asked === '@mine') runId = newestRun(rows, process.env.MAUDE_CHAT_ID);
|
|
279
|
+
else if (asked === undefined && from === undefined) runId = newestRun(rows);
|
|
219
280
|
if (from === undefined) {
|
|
220
|
-
|
|
281
|
+
// by run when the rows say which run made them; the row just below the canvas's newest otherwise
|
|
282
|
+
let at = 0;
|
|
283
|
+
if (runId !== undefined) at = oldestOfRun(rows, runId);
|
|
284
|
+
if (asked !== undefined && (runId === undefined || at < 0)) {
|
|
285
|
+
process.stderr.write(
|
|
286
|
+
`maude design history: no version by run ${clean(asked)} in ${where} — \`maude design history list --json\` shows each version's runId\n`
|
|
287
|
+
);
|
|
288
|
+
return 1;
|
|
289
|
+
}
|
|
290
|
+
const before = rows[at + 1];
|
|
221
291
|
if (!before) {
|
|
222
292
|
process.stdout.write(`${field(repoRel)} has no earlier version to compare with\n`);
|
|
223
293
|
return 0;
|
|
@@ -248,6 +318,7 @@ async function syncedDiff(c, repoRel, rows, flags) {
|
|
|
248
318
|
const where = (Array.isArray(ch.artboards) ? ch.artboards : []).map((a) => field(a)).join(', ');
|
|
249
319
|
return `${where || 'canvas'} ${field(ch.words ?? '')}\n`;
|
|
250
320
|
};
|
|
321
|
+
process.stdout.write(`from ${from} to ${to}\n`);
|
|
251
322
|
writeUntrusted(changes.map(line).join(''));
|
|
252
323
|
return 0;
|
|
253
324
|
}
|