@1agh/maude 2.0.8 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/apps/hub/src/project-transactions/kernel.mjs +13 -7
- package/apps/studio/access/closure.ts +86 -10
- package/apps/studio/access/filters.ts +18 -1
- package/apps/studio/access/request.ts +8 -0
- package/apps/studio/acp/design-write-verb.ts +12 -2
- package/apps/studio/acp/env.ts +7 -2
- package/apps/studio/acp/index.ts +15 -4
- package/apps/studio/acp/login-state.ts +22 -5
- package/apps/studio/acp/may-scope.ts +38 -1
- package/apps/studio/acp/plugin-bootstrap.ts +13 -1
- package/apps/studio/acp/probe.ts +11 -4
- package/apps/studio/actions/agents.ts +110 -28
- package/apps/studio/actions/canvas-keys.ts +4 -2
- package/apps/studio/actions/ctx.ts +3 -0
- package/apps/studio/actions/defs/annotation.ts +84 -2
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/edit.ts +13 -0
- package/apps/studio/actions/defs/export.ts +12 -0
- package/apps/studio/actions/defs/sync.ts +18 -0
- package/apps/studio/actions/defs/video.ts +9 -0
- package/apps/studio/actions/documents.ts +6 -1
- package/apps/studio/actions/keymap.gen.ts +147 -9
- package/apps/studio/actions/menu.ts +5 -1
- package/apps/studio/actions/types.ts +4 -2
- package/apps/studio/actions/verbs.ts +9 -0
- package/apps/studio/actions.manifest.json +300 -45
- package/apps/studio/actions.parity.json +19 -1
- package/apps/studio/ai/save-hold.ts +2 -1
- package/apps/studio/ai/write-claim-scope.ts +7 -1
- package/apps/studio/ai/write-claim.ts +154 -3
- package/apps/studio/annotations/ai-read.ts +42 -6
- package/apps/studio/annotations/ai-write.ts +145 -2
- package/apps/studio/annotations/board-ops.ts +34 -3
- package/apps/studio/annotations/checklist-ops.ts +374 -0
- package/apps/studio/annotations/elements/checkitem.model.ts +129 -0
- package/apps/studio/annotations/elements/sticky.model.ts +54 -2
- package/apps/studio/annotations/ops.ts +30 -0
- package/apps/studio/annotations/registry.ts +9 -1
- package/apps/studio/annotations/templates.ts +4 -2
- package/apps/studio/annotations/text-steps.ts +114 -10
- package/apps/studio/annotations/ui/checklist-wire.ts +129 -0
- package/apps/studio/annotations/ui/checklist.tsx +429 -0
- package/apps/studio/annotations/ui/element-node.tsx +48 -2
- package/apps/studio/annotations/ui/template-place.ts +11 -1
- package/apps/studio/annotations/v1-adapter.ts +22 -3
- package/apps/studio/annotations-context-toolbar.tsx +12 -0
- package/apps/studio/annotations-layer.tsx +442 -49
- package/apps/studio/annotations-model.ts +4 -2
- package/apps/studio/api.ts +148 -21
- package/apps/studio/artboard-live-gate.tsx +54 -17
- package/apps/studio/artboard-still-persist.ts +166 -0
- package/apps/studio/artboard-still-raster.ts +6 -2
- package/apps/studio/artboard-still.ts +390 -20
- package/apps/studio/asset-added.ts +154 -0
- package/apps/studio/asset-details.ts +46 -3
- package/apps/studio/asset-origins.ts +5 -3
- package/apps/studio/asset-trash.ts +6 -1
- package/apps/studio/bin/_agent-browser-safe.mjs +3 -4
- package/apps/studio/bin/_annotate-post.mjs +14 -5
- package/apps/studio/bin/_audio-search.mjs +8 -2
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/bin/_desktop-locate.sh +145 -0
- package/apps/studio/bin/_ds-check-live.mjs +2 -1
- package/apps/studio/bin/_exports.mjs +38 -2
- package/apps/studio/bin/_history.mjs +79 -8
- package/apps/studio/bin/_import-asset.mjs +14 -9
- package/apps/studio/bin/_import-figma.mjs +510 -98
- package/apps/studio/bin/_index-cli.mjs +10 -21
- package/apps/studio/bin/_ingest-footage.mjs +24 -6
- package/apps/studio/bin/_media-probe.mjs +232 -0
- package/apps/studio/bin/_perf-probe-open.mjs +6 -0
- package/apps/studio/bin/_perf-probe-safari.mjs +6 -0
- package/apps/studio/bin/_perf-probe-studio.mjs +6 -1
- package/apps/studio/bin/_perf-probe.mjs +8 -3
- package/apps/studio/bin/_perf-sweep-shared.mjs +789 -0
- package/apps/studio/bin/_perf-sweep.mjs +240 -0
- package/apps/studio/bin/_record-shot.sh +33 -8
- package/apps/studio/bin/_screenshot-playwright.mjs +45 -2
- package/apps/studio/bin/_studio-verb.mjs +8 -3
- package/apps/studio/bin/_thumb-route.mjs +21 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +83 -1
- package/apps/studio/bin/_transcribe.mjs +22 -6
- package/apps/studio/bin/_unsynced-refs.mjs +22 -0
- package/apps/studio/bin/_url-guard.mjs +120 -5
- package/apps/studio/bin/_url-guard.sh +29 -7
- package/apps/studio/bin/_video-limits.mjs +104 -0
- package/apps/studio/bin/_video-playwright.mjs +119 -19
- package/apps/studio/bin/_video-proxy.mjs +130 -0
- package/apps/studio/bin/_write-claim.mjs +38 -16
- package/apps/studio/bin/annotate.mjs +12 -2
- package/apps/studio/bin/canvas-rects.sh +19 -4
- package/apps/studio/bin/chat-open.sh +7 -1
- package/apps/studio/bin/draw-proof.sh +6 -2
- package/apps/studio/bin/generate.sh +32 -10
- package/apps/studio/bin/handoff.sh +2 -2
- package/apps/studio/bin/perf.sh +96 -15
- package/apps/studio/bin/photo-adjust.sh +6 -3
- package/apps/studio/bin/photo-bg-remove.sh +2 -2
- package/apps/studio/bin/prep.sh +21 -4
- package/apps/studio/bin/read-annotations.mjs +3 -0
- package/apps/studio/bin/runtime-health.sh +27 -1
- package/apps/studio/bin/screenshot.sh +152 -12
- package/apps/studio/bin/server-up.sh +64 -6
- package/apps/studio/bin/smoke.sh +43 -8
- package/apps/studio/bin/to-lottie.sh +3 -2
- package/apps/studio/bin/video-proxy.sh +27 -0
- package/apps/studio/bin/visual-sanity.sh +3 -1
- package/apps/studio/bridge/dgn-protocol.ts +157 -1
- package/apps/studio/bridge/mode-shows.ts +8 -6
- package/apps/studio/bridge/still-webp.ts +233 -0
- package/apps/studio/build.ts +18 -0
- package/apps/studio/canvas-build.ts +93 -11
- package/apps/studio/canvas-comment-mount.tsx +53 -8
- package/apps/studio/canvas-edit.ts +34 -1
- package/apps/studio/canvas-lib-module.ts +210 -0
- package/apps/studio/canvas-lib.tsx +3 -12
- package/apps/studio/canvas-pipeline.ts +111 -5
- package/apps/studio/canvas-shell.tsx +8 -11
- package/apps/studio/canvas-theme-pill.tsx +5 -3
- package/apps/studio/check/index.ts +12 -5
- package/apps/studio/check/video.ts +18 -2
- package/apps/studio/client/app.jsx +65 -7
- package/apps/studio/client/clipboard-relay.ts +193 -16
- package/apps/studio/client/comments-overlay.css +18 -0
- package/apps/studio/client/export-center.jsx +30 -0
- package/apps/studio/client/generate-dialog.jsx +49 -4
- package/apps/studio/client/github.js +7 -0
- package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
- package/apps/studio/client/home/HomeConnection.jsx +111 -0
- package/apps/studio/client/home/home-accounts-model.js +110 -1
- package/apps/studio/client/home/home-api.js +9 -2
- package/apps/studio/client/home/home-app.jsx +126 -13
- package/apps/studio/client/home/home-model.js +69 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +239 -1
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +173 -98
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +5 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/DiffView.jsx +7 -1
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/panels/chat-context.js +2 -0
- package/apps/studio/client/panels/slash-commands.gen.js +13 -13
- package/apps/studio/client/selection-scope.js +16 -9
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/shell/viewport.jsx +11 -1
- package/apps/studio/client/shell-events.js +8 -0
- package/apps/studio/client/styles/3-kit-maude-v2.css +16 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/ai/Feed.jsx +1 -1
- package/apps/studio/client/v2/ai/OfferCard.jsx +34 -0
- package/apps/studio/client/v2/ai/activity-line.js +54 -1
- package/apps/studio/client/v2/ai/ai-offer.js +21 -1
- package/apps/studio/client/v2/ai/run-model.js +3 -1
- package/apps/studio/client/v2/annotations/vote-store.js +28 -4
- package/apps/studio/client/v2/assets/asset-drop-session.js +37 -2
- package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +7 -5
- package/apps/studio/client/v2/assets/details-model.js +1 -1
- package/apps/studio/client/v2/assets/details.jsx +5 -0
- package/apps/studio/client/v2/assets/tile-drag.js +11 -7
- package/apps/studio/client/v2/comments/comments-panel.jsx +22 -3
- package/apps/studio/client/v2/create/duplicate-done.js +6 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +113 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +343 -6
- package/apps/studio/client/v2/diagnostics/sync-details/unsynced-refs.js +55 -0
- package/apps/studio/client/v2/ds/review.css +1 -1
- package/apps/studio/client/v2/export/exports-model.js +7 -0
- package/apps/studio/client/v2/export/exports-panel.jsx +1 -0
- package/apps/studio/client/v2/export/job-row.jsx +32 -2
- package/apps/studio/client/v2/handoff/ready-card.jsx +1 -1
- package/apps/studio/client/v2/history/compare-view.jsx +1 -0
- package/apps/studio/client/v2/inspector/css-write.js +6 -1
- package/apps/studio/client/v2/inspector/frame.jsx +28 -4
- package/apps/studio/client/v2/inspector/kinds/clip-model.js +51 -0
- package/apps/studio/client/v2/inspector/kinds/clip.jsx +75 -2
- package/apps/studio/client/v2/inspector/model.js +21 -0
- package/apps/studio/client/v2/inspector/sections/fill.jsx +12 -3
- package/apps/studio/client/v2/inspector/sections/recent-colours.js +8 -5
- package/apps/studio/client/v2/inspector/view-mode.jsx +11 -1
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/preview/link-follow.js +4 -2
- package/apps/studio/client/v2/preview/preview-chrome-host.jsx +16 -6
- package/apps/studio/client/v2/search/help-model.js +2 -0
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +344 -137
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +155 -24
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +100 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/share/share-sheet.jsx +28 -11
- package/apps/studio/client/v2/shell/api-session-boot.js +6 -0
- package/apps/studio/client/v2/shell/api-session.js +126 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/floating-panels.css +31 -1
- package/apps/studio/client/v2/shell/image-pick.js +61 -8
- package/apps/studio/client/v2/shell/menu-aim.js +43 -0
- package/apps/studio/client/v2/shell/menu-runner.js +25 -7
- package/apps/studio/client/v2/shell/occlusion-insets.js +18 -1
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/project-pill.jsx +52 -6
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +71 -36
- package/apps/studio/client/v2/shell/still-bridge.js +194 -0
- package/apps/studio/client/v2/shell/still-store.js +319 -0
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/shell/use-tool-panels.js +2 -1
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/client/v2/timeline/Timeline.jsx +15 -0
- package/apps/studio/client/v2/timeline/frame-handle-model.js +142 -0
- package/apps/studio/client/v2/timeline/frame-handle.jsx +151 -0
- package/apps/studio/clip-ops.ts +126 -8
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/collab/ai-activity.ts +10 -8
- package/apps/studio/collab/awareness-bridge.ts +34 -9
- package/apps/studio/collab/index.ts +3 -0
- package/apps/studio/collab/registry.ts +41 -10
- package/apps/studio/comment-reattach.ts +149 -0
- package/apps/studio/comments/mine-stamp.ts +15 -7
- package/apps/studio/comments/ops.ts +52 -8
- package/apps/studio/comments-overlay.tsx +146 -9
- package/apps/studio/dist/client.bundle.js +892 -885
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/dom-selection.ts +87 -18
- package/apps/studio/ds/board/directions.css +8 -0
- package/apps/studio/ds/board/outline.tsx +16 -0
- package/apps/studio/ds/canvas-check.ts +6 -0
- package/apps/studio/edit-ops/clip/reframe.ts +19 -3
- package/apps/studio/edit-ops/clip-carry.ts +602 -0
- package/apps/studio/edit-ops/clipboard.ts +318 -23
- package/apps/studio/edit-ops/dispatch.ts +20 -2
- package/apps/studio/edit-ops/scope-names.ts +249 -40
- package/apps/studio/edit-ops/slot-defaults.ts +3 -0
- package/apps/studio/edit-ops/types.ts +6 -0
- package/apps/studio/editing/align-bar.tsx +33 -9
- package/apps/studio/editing/artboard-actions.ts +5 -0
- package/apps/studio/editing/artboard-menu.tsx +6 -2
- package/apps/studio/editing/click-to-type.ts +1 -1
- package/apps/studio/editing/clip-words.ts +48 -0
- package/apps/studio/editing/clipboard.ts +21 -6
- package/apps/studio/editing/declared-background.ts +25 -0
- package/apps/studio/editing/index.tsx +3 -0
- package/apps/studio/editing/object-keys.ts +4 -4
- package/apps/studio/editing/object-menu.tsx +13 -3
- package/apps/studio/editing/pen/points.tsx +61 -0
- package/apps/studio/editing/text-in-place.tsx +11 -0
- package/apps/studio/editing/video-frame-handle.tsx +425 -0
- package/apps/studio/exporters/capture-prepass.ts +374 -0
- package/apps/studio/exporters/degraded.ts +148 -0
- package/apps/studio/exporters/hub-render-door.ts +28 -2
- package/apps/studio/exporters/index.ts +3 -1
- package/apps/studio/exporters/job-budget.ts +93 -0
- package/apps/studio/exporters/jobs.ts +215 -28
- package/apps/studio/exporters/parity-check.ts +254 -0
- package/apps/studio/exporters/remote.ts +209 -15
- package/apps/studio/exporters/svg-inline.ts +87 -0
- package/apps/studio/exporters/video-render-lib.ts +88 -26
- package/apps/studio/exporters/video.ts +29 -6
- package/apps/studio/figma/assets.ts +58 -43
- package/apps/studio/figma/codegen-fonts.ts +100 -0
- package/apps/studio/figma/fig-decode.ts +390 -25
- package/apps/studio/figma/fig-kiwi.ts +18 -4
- package/apps/studio/figma/fig-vector.ts +59 -3
- package/apps/studio/figma/sanitize.ts +2 -0
- package/apps/studio/figma/style-map.ts +293 -48
- package/apps/studio/figma/to-artboard.ts +455 -69
- package/apps/studio/figma/to-strokes.ts +44 -11
- package/apps/studio/figma/types.ts +13 -0
- package/apps/studio/footage/schema.ts +3 -3
- package/apps/studio/generation/adapters/elevenlabs.ts +7 -1
- package/apps/studio/generation/adapters/groq.ts +8 -1
- package/apps/studio/generation/spend.ts +312 -0
- package/apps/studio/generation/types.ts +12 -0
- package/apps/studio/handoff/run.ts +1 -1
- package/apps/studio/handoff/targets.ts +2 -2
- package/apps/studio/handoff/write-scopes.ts +1 -1
- package/apps/studio/history/describe-annotations.ts +4 -0
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/create-local.ts +32 -3
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +15 -4
- package/apps/studio/http.ts +438 -86
- package/apps/studio/imported-module-ids.ts +91 -0
- package/apps/studio/inspect.ts +2 -0
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/notifications.tsx +47 -5
- package/apps/studio/paths.ts +10 -1
- package/apps/studio/port.ts +3 -2
- package/apps/studio/preview/preview-camera.tsx +15 -382
- package/apps/studio/readiness.ts +10 -1
- package/apps/studio/release-build.ts +51 -0
- package/apps/studio/routes/agent.ts +188 -9
- package/apps/studio/routes/ai.ts +43 -11
- package/apps/studio/routes/annotations.ts +27 -1
- package/apps/studio/routes/assets.ts +18 -1
- package/apps/studio/routes/canvas-origin.ts +12 -9
- package/apps/studio/routes/cloud-move.ts +15 -0
- package/apps/studio/routes/edit.ts +3 -0
- package/apps/studio/routes/export.ts +51 -0
- package/apps/studio/routes/generate.ts +42 -12
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +9 -1
- package/apps/studio/routes/shell.ts +217 -5
- package/apps/studio/routes/sync.ts +136 -8
- package/apps/studio/routes/votes.ts +2 -1
- package/apps/studio/schema/annotations.v2.schema.json +143 -1
- package/apps/studio/schema/beats.v1.schema.json +1 -1
- package/apps/studio/schema/edl.v1.schema.json +1 -1
- package/apps/studio/schema/formats.ts +3 -3
- package/apps/studio/schema/transcript.v1.schema.json +1 -1
- package/apps/studio/server.ts +142 -43
- package/apps/studio/shell/api-key.ts +503 -0
- package/apps/studio/shell/attest.ts +59 -0
- package/apps/studio/shell/capture-url.ts +20 -0
- package/apps/studio/shell/cli-yield.ts +276 -0
- package/apps/studio/shell/clip-transfer.ts +302 -0
- package/apps/studio/shell/key-file.ts +108 -0
- package/apps/studio/shell/server-json.ts +75 -0
- package/apps/studio/shell/worktree.ts +19 -0
- package/apps/studio/spoof-chars.ts +9 -0
- package/apps/studio/studio-page-host.ts +1 -1
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/accepted-link.ts +76 -29
- package/apps/studio/sync/action-stage.ts +575 -44
- package/apps/studio/sync/adopt-held.ts +85 -0
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-membership.ts +16 -1
- package/apps/studio/sync/file-plane.ts +289 -22
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +196 -12
- package/apps/studio/sync/journal-client.ts +50 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +296 -8
- package/apps/studio/sync/projection.ts +22 -3
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +59 -3
- package/apps/studio/sync/status.ts +19 -2
- package/apps/studio/sync/unsynced-refs.ts +397 -0
- package/apps/studio/sync/writer-registry.ts +20 -0
- package/apps/studio/thumbs/service.ts +4 -1
- package/apps/studio/tool-palette.tsx +23 -0
- package/apps/studio/ui-prefs.ts +40 -0
- package/apps/studio/use-agent-presence.tsx +2 -2
- package/apps/studio/use-canvas-keys.ts +6 -1
- package/apps/studio/video/format-ids.ts +2 -2
- package/apps/studio/video/inject.ts +31 -0
- package/apps/studio/video/media-risk.ts +58 -0
- package/apps/studio/video/object-fit.ts +137 -0
- package/apps/studio/video/provider-transcript.ts +141 -0
- package/apps/studio/whats-new.json +137 -0
- package/apps/studio/workspace-mode.ts +1 -0
- package/apps/studio/ws.ts +5 -0
- package/cli/commands/design.mjs +119 -8
- package/cli/lib/bash-guard.mjs +366 -6
- package/cli/lib/confine-read.mjs +1 -0
- package/cli/lib/design-help.gen.mjs +3 -2
- package/cli/lib/design-hook.mjs +387 -81
- package/cli/lib/design-link.mjs +16 -1
- package/cli/lib/design-open.mjs +49 -3
- package/cli/lib/desktop-locate.mjs +770 -0
- package/cli/lib/handoff.mjs +1 -1
- package/cli/lib/hook-state.mjs +291 -0
- package/cli/lib/pkg-root.mjs +65 -13
- package/cli/lib/studio-locate.mjs +59 -16
- package/package.json +15 -8
- package/plugins/design/templates/_shell.html +13 -0
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
package/README.md
CHANGED
|
@@ -34,9 +34,10 @@ Plus the **`maude`** CLI — `maude init` scaffolds a fresh `.ai/` workspace fro
|
|
|
34
34
|
```
|
|
35
35
|
/plugin install design@maude
|
|
36
36
|
/plugin install flow@maude
|
|
37
|
+
/plugin install design-video@maude # optional: video — reels, footage analysis, Lottie export
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
Then `/reload-plugins` and you should see `/design:edit`, `/design:*`, `/flow:plan`, `/flow:execute`, etc.
|
|
40
|
+
`design-video` is opt-in and needs `design` ([what moved](docs/MIGRATING-DESIGN-VIDEO.md)). Then `/reload-plugins` and you should see `/design:edit`, `/design:*`, `/flow:plan`, `/flow:execute`, etc.
|
|
40
41
|
|
|
41
42
|
### 3. Install the CLI
|
|
42
43
|
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { createHash, randomUUID } from 'node:crypto';
|
|
18
18
|
|
|
19
|
+
import { textSlotsCollide } from '../../../studio/annotations/text-steps.ts';
|
|
19
20
|
import { canvasSlugFromRel } from '../../../studio/canvas-slug.ts';
|
|
20
21
|
import { validateCanvasPath } from '../../../studio/sync/canvas-path.ts';
|
|
21
22
|
import { checkLane, LANE_NAMES, laneHash, mergeLane } from './lanes.mjs';
|
|
@@ -872,13 +873,15 @@ export function createKernel({
|
|
|
872
873
|
const chain = await ownHistory.withoutRoundTrips(later.filter((x) => !own.has(x.actionId)));
|
|
873
874
|
let x = before;
|
|
874
875
|
for (const step of chain) {
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
);
|
|
881
|
-
|
|
876
|
+
const stepBefore = await work.content(step.beforeHash);
|
|
877
|
+
const stepAfter = await work.content(step.afterHash);
|
|
878
|
+
const m = mergeLane(first.lane, stepBefore, x, stepAfter);
|
|
879
|
+
// T5.2 (#165) — the annotations merge lets the revert win an overlapping text ("ours"): that
|
|
880
|
+
// later step's words would be lost. The same check a v2 studio makes before it asks
|
|
881
|
+
// (sync/hub-text-undo.ts), here for every desktop; it refuses the whole undo (opUndo).
|
|
882
|
+
const textOverlap =
|
|
883
|
+
m.ok && first.lane === 'annotations' && textSlotsCollide(stepBefore, x, stepAfter);
|
|
884
|
+
if (!m.ok || textOverlap) {
|
|
882
885
|
return {
|
|
883
886
|
skipped: {
|
|
884
887
|
doc: st.doc,
|
|
@@ -887,6 +890,7 @@ export function createKernel({
|
|
|
887
890
|
// Multi-target only, so a v1 single undo answers byte for byte as before.
|
|
888
891
|
...(many ? { conflictWith: step.actionId } : {}),
|
|
889
892
|
},
|
|
893
|
+
...(textOverlap ? { textOverlap: true } : {}),
|
|
890
894
|
};
|
|
891
895
|
}
|
|
892
896
|
x = m.content;
|
|
@@ -1042,6 +1046,8 @@ export function createKernel({
|
|
|
1042
1046
|
reverted.add(k);
|
|
1043
1047
|
if (e.entry && deletedHere.has(e.entry)) continue;
|
|
1044
1048
|
const r = await revertLane(work, firstOn.get(k) ?? e, targetIds, many, ownHistory);
|
|
1049
|
+
// T5.2 — reverting over somebody's text is never half done: the whole undo is refused.
|
|
1050
|
+
if (r.textOverlap) throw new Reject('undo-conflict', { skipped: [r.skipped] });
|
|
1045
1051
|
if (r.skipped) skipped.push(r.skipped);
|
|
1046
1052
|
else if (r.applied) applied++;
|
|
1047
1053
|
}
|
|
@@ -64,7 +64,7 @@ const MODULE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs)$/i;
|
|
|
64
64
|
* (a canvas), `.md`, `.txt`, unknown — taken with `with { type: 'text' }` is just bytes into the
|
|
65
65
|
* frame, so it blocks the grant like an imported canvas.
|
|
66
66
|
*/
|
|
67
|
-
const IMPORTABLE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs|css|json)$/i;
|
|
67
|
+
export const IMPORTABLE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs|css|json)$/i;
|
|
68
68
|
/** A design system's own folder — exactly one segment under `system/` (V2-8.9 defender L3). */
|
|
69
69
|
const DS_SYSTEM_PATH_RE = /^system\/[^/]+$/;
|
|
70
70
|
/** A specifier with an extension of its own (`./data.json`, `./logo.svg`): the exact file. */
|
|
@@ -129,20 +129,27 @@ export function relativeImportGroups(
|
|
|
129
129
|
canvasAbsPath: string,
|
|
130
130
|
designRoot: string
|
|
131
131
|
): string[][] {
|
|
132
|
-
|
|
132
|
+
return relativeImportSpecs(rawSource, /\.css$/i.test(canvasAbsPath)).map((spec) =>
|
|
133
|
+
specCandidates(spec, canvasAbsPath, designRoot)
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* #158 — the distinct relative specifiers `relativeImportGroups` resolves, decoded, in source order
|
|
139
|
+
* (`css`: the file is a stylesheet, so `@import url(…)` counts). Exported so a diagnostic names the
|
|
140
|
+
* specifier an import was written with — one scan, never a second copy of the import grammar.
|
|
141
|
+
*/
|
|
142
|
+
export function relativeImportSpecs(rawSource: string, css: boolean): string[] {
|
|
133
143
|
const source = importScanText(rawSource, css);
|
|
134
|
-
const groups: string[][] = [];
|
|
135
144
|
const specs = new Set<string>();
|
|
136
145
|
for (const re of css ? [...SPEC_RES, CSS_URL_IMPORT_RE] : SPEC_RES) {
|
|
137
146
|
re.lastIndex = 0;
|
|
138
147
|
for (let m = re.exec(source); m !== null; m = re.exec(source)) {
|
|
139
148
|
const spec = decodeJsString(m[1] ?? '');
|
|
140
|
-
if (
|
|
141
|
-
specs.add(spec);
|
|
142
|
-
groups.push(specCandidates(spec, canvasAbsPath, designRoot));
|
|
149
|
+
if (spec.startsWith('.')) specs.add(spec);
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
return
|
|
152
|
+
return [...specs];
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
/**
|
|
@@ -221,6 +228,12 @@ export interface ProjectReader {
|
|
|
221
228
|
/** p8-closure-lows — the canvas-shaped (`.tsx`/`.html`) entries the last `list()` saw but did
|
|
222
229
|
* not yield (a symlink, a dot name), by name only: each counts as another canvas's slug. */
|
|
223
230
|
unlisted?(): Iterable<string>;
|
|
231
|
+
/** #167 T5.3 — folders the listing cut at its depth cap (each a designRoot-relative folder):
|
|
232
|
+
* whatever lies below is unseen, so an owner whose slug starts with a cut folder's slug keeps
|
|
233
|
+
* its stylesheet refused. A reader without depth cap leaves it out. */
|
|
234
|
+
cutFolders?(): Iterable<string>;
|
|
235
|
+
/** #167 T5.3 — a listed path that is only a tombstone (gone from the disk): no slug twin. */
|
|
236
|
+
gone?(rel: string): boolean;
|
|
224
237
|
}
|
|
225
238
|
|
|
226
239
|
export interface Closure {
|
|
@@ -253,6 +266,7 @@ const ASSET_SIDECAR_SUFFIXES = [
|
|
|
253
266
|
'.transcript.json',
|
|
254
267
|
'.beats.json',
|
|
255
268
|
'.gen.json', // the generation provenance of a take (S8 §5.2) — rides with its image
|
|
269
|
+
'.added.json', // who brought the asset in (#172, a display name) — rides with its asset
|
|
256
270
|
'.srt',
|
|
257
271
|
'.vtt',
|
|
258
272
|
'.json', // the bare whisper dump beside old captions (V2-1.10)
|
|
@@ -622,6 +636,10 @@ interface WalkEnv {
|
|
|
622
636
|
listTruncated: boolean;
|
|
623
637
|
/** p8-closure-lows — canvas-shaped entries the listing saw but did not yield (`unlisted`). */
|
|
624
638
|
unlisted: readonly string[];
|
|
639
|
+
/** #167 T5.3 — each depth-cut folder's slug plus `-`: a slug starting with one may be hidden. */
|
|
640
|
+
cutSlugs: readonly string[];
|
|
641
|
+
/** #167 T5.3 — listed and not only a tombstone (`ProjectReader.gone`). */
|
|
642
|
+
present: (rel: string) => boolean;
|
|
625
643
|
/** 2.0.7 (#207) — `files`' openable canvas files (`.tsx`/`.html`, not `_`-prefixed) by NFC slug,
|
|
626
644
|
* and `unlisted` by NFC slug: what `grantedBySlug` scanned the whole listing for, per owner. */
|
|
627
645
|
slugIndex: () => { files: ReadonlyMap<string, string[]>; unlisted: ReadonlySet<string> };
|
|
@@ -760,12 +778,14 @@ function walkEnv(project: ProjectReader, files: ReadonlySet<string>, cfg: Closur
|
|
|
760
778
|
typeof project.present === 'function';
|
|
761
779
|
const listTruncated = !reports || project.listTruncated?.() === true;
|
|
762
780
|
const unlisted = reports ? [...(project.unlisted?.() ?? [])] : [];
|
|
781
|
+
const cutSlugs = [...(project.cutFolders?.() ?? [])].map((d) => `${slugNfc(d)}-`);
|
|
782
|
+
const present = (rel: string): boolean => files.has(rel) && project.gone?.(rel) !== true;
|
|
763
783
|
let slugs: { files: Map<string, string[]>; unlisted: Set<string> } | null = null;
|
|
764
784
|
const slugIndex = () => {
|
|
765
785
|
if (slugs) return slugs;
|
|
766
786
|
const bySlug = new Map<string, string[]>();
|
|
767
787
|
for (const f of files) {
|
|
768
|
-
if (!/\.(tsx|html)$/i.test(f) || f.startsWith('_')) continue;
|
|
788
|
+
if (!/\.(tsx|html)$/i.test(f) || f.startsWith('_') || !present(f)) continue;
|
|
769
789
|
const slug = slugNfc(f);
|
|
770
790
|
const list = bySlug.get(slug);
|
|
771
791
|
if (list) list.push(f);
|
|
@@ -774,7 +794,19 @@ function walkEnv(project: ProjectReader, files: ReadonlySet<string>, cfg: Closur
|
|
|
774
794
|
slugs = { files: bySlug, unlisted: new Set(unlisted.map(slugNfc)) };
|
|
775
795
|
return slugs;
|
|
776
796
|
};
|
|
777
|
-
return {
|
|
797
|
+
return {
|
|
798
|
+
files,
|
|
799
|
+
textOf,
|
|
800
|
+
isCanvas,
|
|
801
|
+
cfg,
|
|
802
|
+
project,
|
|
803
|
+
known,
|
|
804
|
+
listTruncated,
|
|
805
|
+
unlisted,
|
|
806
|
+
cutSlugs,
|
|
807
|
+
present,
|
|
808
|
+
slugIndex,
|
|
809
|
+
};
|
|
778
810
|
}
|
|
779
811
|
|
|
780
812
|
const SAME_NAME_RE =
|
|
@@ -905,11 +937,12 @@ function walkImports(
|
|
|
905
937
|
const grantedBySlug = (owner: string): boolean => {
|
|
906
938
|
if (env.listTruncated || env.known.has(owner)) return false;
|
|
907
939
|
const meta = owner.replace(/\.(tsx|html)$/i, '.meta.json');
|
|
908
|
-
if (env.
|
|
940
|
+
if (env.present(owner) || env.present(meta)) return false;
|
|
909
941
|
// p8-closure-lows-2 — slugs compare NFC on both sides (APFS holds `café` in NFC and NFD as one
|
|
910
942
|
// name); never case-folded beyond the slug's own lower-casing. A slug already found foreign
|
|
911
943
|
// answers before any disk look-up (`present` could only make it foreign too).
|
|
912
944
|
const slug = slugNfc(owner);
|
|
945
|
+
if (env.cutSlugs.some((p) => slug.startsWith(p))) return false;
|
|
913
946
|
const hit = slugOwned.get(slug);
|
|
914
947
|
if (hit === false) return false;
|
|
915
948
|
if (env.project.present?.(owner) || env.project.present?.(meta)) return false;
|
|
@@ -1016,6 +1049,45 @@ function walkImports(
|
|
|
1016
1049
|
return { visited, refused, missing, blocked: blocked || refused.size > 0 };
|
|
1017
1050
|
}
|
|
1018
1051
|
|
|
1052
|
+
/** #122 (122-A) — `importAllowed`'s answer: why a would-be import is refused, and the canvases it would inline. */
|
|
1053
|
+
export type ImportVerdict =
|
|
1054
|
+
| { ok: true }
|
|
1055
|
+
| { ok: false; why: 'canvas' | 'missing' | 'blocked'; canvases: string[] };
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* A design-root listing that answers `has` by reading (a paste checks one import, never lists the project);
|
|
1059
|
+
* it iterates as empty. An own `has` on a plain Set: no class syntax the hub's strip-only TypeScript lacks.
|
|
1060
|
+
*/
|
|
1061
|
+
const readableFiles = (probe: (rel: string) => boolean): ReadonlySet<string> =>
|
|
1062
|
+
Object.assign(new Set<string>(), { has: probe });
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* #122 (122-A) — may a canvas at `fromRel` gain `import … from spec`? The C4 import walk's own rule (`walkImports`:
|
|
1066
|
+
* an importable extension, not a canvas, nothing under a `_` runtime folder, every import resolving, transitively)
|
|
1067
|
+
* applied to that ONE import — the would-be text, never the disk's copy of `fromRel` and never its other imports
|
|
1068
|
+
* (a paste is refused for what it adds, not for what the target already had). A bare / virtual specifier is not
|
|
1069
|
+
* walked (`@maude/canvas-lib`, `react`): allowed. A reader with no listing errs to "canvas" like every partial
|
|
1070
|
+
* listing (`listTruncated`), so the same-name owner rule never admits a stylesheet here.
|
|
1071
|
+
*/
|
|
1072
|
+
export function importAllowed(
|
|
1073
|
+
spec: string,
|
|
1074
|
+
fromRel: string,
|
|
1075
|
+
project: { text(rel: string): string | null },
|
|
1076
|
+
config?: ClosureConfig
|
|
1077
|
+
): ImportVerdict {
|
|
1078
|
+
if (!spec.startsWith('.')) return { ok: true };
|
|
1079
|
+
if (/['"\\\n`]/.test(spec)) return { ok: false, why: 'blocked', canvases: [] };
|
|
1080
|
+
const probe = `import '${spec}';\n`;
|
|
1081
|
+
const text = (rel: string): string | null => (rel === fromRel ? probe : project.text(rel));
|
|
1082
|
+
const reader: ProjectReader = { list: () => [], text, head: () => '' };
|
|
1083
|
+
const files = readableFiles((rel) => text(rel) !== null);
|
|
1084
|
+
const cfg = config ?? closureConfigOf(readJsonObject(reader, 'config.json'));
|
|
1085
|
+
const walk = walkImports(walkEnv(reader, files, cfg), fromRel, new Set([fromRel]));
|
|
1086
|
+
if (walk.refused.size) return { ok: false, why: 'canvas', canvases: [...walk.refused].sort() };
|
|
1087
|
+
if (walk.missing.size) return { ok: false, why: 'missing', canvases: [] };
|
|
1088
|
+
return walk.blocked ? { ok: false, why: 'blocked', canvases: [] } : { ok: true };
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1019
1091
|
/**
|
|
1020
1092
|
* gate-b-c4j — per canvas, the other canvases its import walk refuses (sorted; a canvas importing
|
|
1021
1093
|
* none is absent): a frame on it renders none of them, so its module is refused. What the shell
|
|
@@ -1146,6 +1218,8 @@ function compute(
|
|
|
1146
1218
|
const side = `${base}${suffix}`;
|
|
1147
1219
|
if (side !== asset && files.has(side) && !PER_USE_PHOTO_RE.test(side)) read.add(side);
|
|
1148
1220
|
}
|
|
1221
|
+
// The who-added record keyed by the asset's FULL name (burndown F6, asset-added.ts addedRelOf).
|
|
1222
|
+
if (files.has(`${asset}.added.json`)) read.add(`${asset}.added.json`);
|
|
1149
1223
|
assetUsers.set(asset, new Set());
|
|
1150
1224
|
}
|
|
1151
1225
|
// Only for an asset the closure already holds (the element's own `src` put it there).
|
|
@@ -1209,6 +1283,8 @@ function isAssetSidecar(rel: string, files: Set<string>): boolean {
|
|
|
1209
1283
|
for (const suffix of ASSET_SIDECAR_SUFFIXES) {
|
|
1210
1284
|
if (!rel.endsWith(suffix)) continue;
|
|
1211
1285
|
const base = rel.slice(0, -suffix.length);
|
|
1286
|
+
// `<asset name>.added.json` (burndown F6): its base IS the asset
|
|
1287
|
+
if (suffix === '.added.json' && files.has(base)) return true;
|
|
1212
1288
|
for (const f of files) if (f !== rel && f.startsWith(`${base}.`)) return true;
|
|
1213
1289
|
}
|
|
1214
1290
|
return false;
|
|
@@ -198,6 +198,8 @@ export const WS_FRAME_CLASSES = Object.freeze({
|
|
|
198
198
|
'thumb-ready': 'project',
|
|
199
199
|
'ai:runs': 'project',
|
|
200
200
|
'generate:job': 'project',
|
|
201
|
+
// Spend cap: a paid job waiting for the person's OK (id, kind, estimate) — project-wide like the job itself.
|
|
202
|
+
'generate:approval': 'project',
|
|
201
203
|
} as const satisfies Record<string, 'none' | 'canvas' | 'filtered' | 'project'>);
|
|
202
204
|
|
|
203
205
|
type Frame = Record<string, unknown>;
|
|
@@ -597,6 +599,20 @@ export interface ProjectVisibility {
|
|
|
597
599
|
|
|
598
600
|
const sources = new WeakMap<object, ProjectVisibility>();
|
|
599
601
|
|
|
602
|
+
/**
|
|
603
|
+
* #169 T8.1c — a write the closure cannot see: a first-segment `_` path (runtime state, DDR-115),
|
|
604
|
+
* which the listing skips and no import walk reads. Every canvas build rewrites `_locator.json`,
|
|
605
|
+
* and each bump threw away every frame's cached closure, so the next requests re-walked the whole
|
|
606
|
+
* design root on the event loop. The two local harness folders still count: a harness grant
|
|
607
|
+
* (`_draw/<slug>.proof.tsx`, `_photo/<slug>.bgremove.tsx`) walks its own text. Anything that is not
|
|
608
|
+
* a plain relative path bumps (fail closed).
|
|
609
|
+
*/
|
|
610
|
+
function closureBlindTo(rel: unknown): boolean {
|
|
611
|
+
if (typeof rel !== 'string') return false;
|
|
612
|
+
const first = rel.split(/[\\/]/)[0] ?? '';
|
|
613
|
+
return first.startsWith('_') && first !== '_draw' && first !== '_photo';
|
|
614
|
+
}
|
|
615
|
+
|
|
600
616
|
/**
|
|
601
617
|
* The closure source of one project: its disk reader, a closure cache keyed by (grants,
|
|
602
618
|
* tree generation) and the generation bump on every file change. ONE per Context, so the
|
|
@@ -612,7 +628,8 @@ export function projectVisibility(
|
|
|
612
628
|
const hit = sources.get(ctx);
|
|
613
629
|
if (hit) return hit;
|
|
614
630
|
let generation = 0;
|
|
615
|
-
ctx.bus.on('fs:any', () => {
|
|
631
|
+
ctx.bus.on('fs:any', (rel: unknown) => {
|
|
632
|
+
if (closureBlindTo(rel)) return;
|
|
616
633
|
generation++;
|
|
617
634
|
});
|
|
618
635
|
const cache: ClosureCache = createClosureCache();
|
|
@@ -102,6 +102,8 @@ export const EXPORT_WRITES: ReadonlySet<string> = new Set([
|
|
|
102
102
|
*/
|
|
103
103
|
export const EXPORT_TABLE_WRITES: ReadonlySet<string> = new Set([
|
|
104
104
|
'/_api/export-jobs/retry',
|
|
105
|
+
// #128 T3.7b — Cancel stops one of the session's own unfinished exports (the owner's jobs only)
|
|
106
|
+
'/_api/export-jobs/cancel',
|
|
105
107
|
// S8.7 — the Print preflight (paper, the back, safe margin, fonts) is numbers and names about an export
|
|
106
108
|
'/_api/export-preflight',
|
|
107
109
|
// P8 C2 — the pictures of what an export would reach (artboard stills from the picture service)
|
|
@@ -163,8 +165,14 @@ const CANVAS_ONLY_REFUSED = new Set([
|
|
|
163
165
|
'/_api/diagnostics/report',
|
|
164
166
|
'/_api/debug-bundle',
|
|
165
167
|
'/_api/cloud/move',
|
|
168
|
+
'/_api/hub/link-folder',
|
|
166
169
|
'/_api/cloud/projects',
|
|
167
170
|
'/_api/github/repos',
|
|
171
|
+
// #122 (122-C) — the desktop shell's clip carriage (shell-token routes, `project` class): they move a
|
|
172
|
+
// canvas's text and pictures between projects, so a canvas-only session is refused before the token gate
|
|
173
|
+
'/_api/shell/clip-export',
|
|
174
|
+
'/_api/shell/clip-asset',
|
|
175
|
+
'/_api/shell/clip-import',
|
|
168
176
|
]);
|
|
169
177
|
|
|
170
178
|
/** Is `pathname` a project-level route a canvas-only session is refused outright (p8-c4)? */
|
|
@@ -63,9 +63,19 @@ export function shellOpensWindow(command: unknown): boolean {
|
|
|
63
63
|
* A trailing `&`, `nohup`, `setsid`, `disown` … (`bashBackgrounds`) or Claude Code's
|
|
64
64
|
* `run_in_background`. Its window then stays open until the turn ends, not the call's return +
|
|
65
65
|
* SHELL_SETTLE_MS: `nohup python3 w.py &` returns at once and writes later.
|
|
66
|
+
*
|
|
67
|
+
* #168 E4 — `where` is the project root and the shell's working directory (the ACP session's cwd is
|
|
68
|
+
* the repo root): with it, a script FILE the command runs (`bash go.sh`, `./go.sh`, `python3 w.py`) is
|
|
69
|
+
* read, and one that detaches counts too.
|
|
66
70
|
*/
|
|
67
|
-
export function shellOutlivesCall(
|
|
71
|
+
export function shellOutlivesCall(
|
|
72
|
+
rawInput: unknown,
|
|
73
|
+
where?: { root: string; cwd?: string }
|
|
74
|
+
): boolean {
|
|
68
75
|
const input = rawInput as { command?: unknown; run_in_background?: unknown } | null | undefined;
|
|
69
76
|
if (!input || typeof input !== 'object') return false;
|
|
70
|
-
return
|
|
77
|
+
return (
|
|
78
|
+
input.run_in_background === true ||
|
|
79
|
+
bashBackgrounds(input.command, where ? { root: where.root, cwd: where.cwd ?? where.root } : {})
|
|
80
|
+
);
|
|
71
81
|
}
|
package/apps/studio/acp/env.ts
CHANGED
|
@@ -59,8 +59,10 @@ const GENERATION_KEY_CUSTODY_RE = /^MAUDE_GEN_KEY/i;
|
|
|
59
59
|
* Only the dev-server's github/token.ts talks to the bridge; an agent holding the key could
|
|
60
60
|
* ask it for the profile's GitHub OAuth token.
|
|
61
61
|
* • `MAUDE_SHELL_*` — the shell probe token + its info-file path (V2-3.4, V2-1.1 decision 8),
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* the per-spawn attest key `MAUDE_SHELL_ATTEST_KEY` (#206, shell/attest.ts — an agent holding
|
|
63
|
+
* it could answer for the app's sidecar), and `MAUDE_SHELL_SIDECAR` (not a secret: the
|
|
64
|
+
* app-port-range marker, port.ts — an agent's own `maude design serve` must stay off the
|
|
65
|
+
* app's 46399–46408).
|
|
64
66
|
* • `MAUDE_HOME_*` — the Home server's internal bearer, its page secret (V2-3.6 H1) and its
|
|
65
67
|
* state dir. A project server never receives them; scrubbed anyway, so no spawn path can
|
|
66
68
|
* hand them on.
|
|
@@ -154,6 +156,9 @@ export function scrubAgentEnv(
|
|
|
154
156
|
if (PROFILE_POINTER_KEYS.has(key)) continue;
|
|
155
157
|
// V2-1.15 §5.4 — a run binding is the bridge's to set, per chat (chatSpawnEnv)
|
|
156
158
|
if (RUN_BINDING_KEYS.has(key)) continue;
|
|
159
|
+
// #206 — a server's role (`cli`: step down for the app's sidecar, shell/cli-yield.ts) is its
|
|
160
|
+
// own; a server the agent starts says its own role (server-up / `maude design serve`)
|
|
161
|
+
if (key === 'MAUDE_SERVER_ROLE') continue;
|
|
157
162
|
out[key] = value;
|
|
158
163
|
}
|
|
159
164
|
return out;
|
package/apps/studio/acp/index.ts
CHANGED
|
@@ -295,8 +295,8 @@ function parseScopeElements(
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// RC5 (rca/issue-canvas-hmr-optimistic-update-consistency) — the ACP chat agent
|
|
298
|
-
// edits canvases through its own tools, so unlike `/design:edit` (
|
|
299
|
-
// /_api/ai/start
|
|
298
|
+
// edits canvases through its own tools, so unlike `/design:edit` (whose hooks
|
|
299
|
+
// open and close a registry run; the v1 /_api/ai/start bracket is retired) nothing announced it: no yellow
|
|
300
300
|
// banner, no DDR-078 agent presence, no colored rim. This tracker watches the
|
|
301
301
|
// streamed `tool_call` / `tool_call_update` notifications for edit-kind tools
|
|
302
302
|
// touching canvas files under <designRoot> and drives the same `ai-activity`
|
|
@@ -462,7 +462,8 @@ export function createAgentActivityTracker(
|
|
|
462
462
|
|
|
463
463
|
/**
|
|
464
464
|
* Open the turn's project action (its run stage, always claim-only); `shell` = the window of one
|
|
465
|
-
* call that cannot claim, for the canvases its command names (A1, S7)
|
|
465
|
+
* call that cannot claim, for the canvases its command names (A1, S7) — a PARKING window (#164):
|
|
466
|
+
* nothing this tracker opens ever claims a write for the run.
|
|
466
467
|
*/
|
|
467
468
|
function openAction(shell?: {
|
|
468
469
|
call: string;
|
|
@@ -538,6 +539,10 @@ export function createAgentActivityTracker(
|
|
|
538
539
|
// name) used to open nothing, so its writes landed as the person's: it now opens a window over
|
|
539
540
|
// every canvas for the run stage (outside writes only; no hold), and the design hook's post-bash
|
|
540
541
|
// binds exactly the bytes it changed.
|
|
542
|
+
// #164 T5.1 — this window only PARKS (sync/action-stage.ts): it can never claim. A parked write
|
|
543
|
+
// joins the run only when the design hook's settle (POST /_api/agent/bash/settle, keyed by the
|
|
544
|
+
// same tool call id) claims its post-call bytes; with no settle it is released as outside at
|
|
545
|
+
// close + SETTLE_WAIT_MS, at stale, or at the run's end.
|
|
541
546
|
const opens = !shellSeen.has(id) && shellOpensWindow(command);
|
|
542
547
|
const named = opens
|
|
543
548
|
? namedDesignFiles(ctx.paths.designRoot, command).map(
|
|
@@ -550,7 +555,13 @@ export function createAgentActivityTracker(
|
|
|
550
555
|
if (!named.length) shellAll.add(id);
|
|
551
556
|
// p8-secfix-hook F2 — `nohup python3 w.py &` / `run_in_background` returns at once and
|
|
552
557
|
// writes later: its window stays open until the turn ends (endTurn), not return + settle
|
|
553
|
-
if (
|
|
558
|
+
if (
|
|
559
|
+
shellOutlivesCall(u.rawInput, {
|
|
560
|
+
root: ctx.paths.repoRoot,
|
|
561
|
+
cwd: ctx.paths.repoRoot,
|
|
562
|
+
})
|
|
563
|
+
)
|
|
564
|
+
shellOutlives.add(id);
|
|
554
565
|
shellWindow(id, true);
|
|
555
566
|
}
|
|
556
567
|
if (
|
|
@@ -9,6 +9,7 @@ import { createHash } from 'node:crypto';
|
|
|
9
9
|
import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
11
11
|
import { dirname, join } from 'node:path';
|
|
12
|
+
import { e2eSwitch } from '../release-build.ts';
|
|
12
13
|
import { scrubAgentEnv } from './env.ts';
|
|
13
14
|
import { isE2eEnv, resolveClaudePath, setTrustedClaudeBin } from './probe.ts';
|
|
14
15
|
|
|
@@ -88,8 +89,17 @@ const NATIVE_INSTALL_CMD = 'curl -fsSL https://claude.ai/install.sh | bash';
|
|
|
88
89
|
// clobber a genuine install). The e2e config points this at a disposable temp
|
|
89
90
|
// path instead; unset in every normal launch, so real users always get the
|
|
90
91
|
// real well-known path.
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
export function wellKnownInstallPath(
|
|
93
|
+
env: Record<string, string | undefined> = process.env,
|
|
94
|
+
release?: boolean
|
|
95
|
+
): string {
|
|
96
|
+
// #168 — a release build never redirects the install target.
|
|
97
|
+
return (
|
|
98
|
+
e2eSwitch(env, 'MAUDE_E2E_CLAUDE_INSTALL_PATH', release) ||
|
|
99
|
+
join(homedir(), '.local', 'bin', 'claude')
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const WELL_KNOWN_INSTALL_PATH = wellKnownInstallPath();
|
|
93
103
|
|
|
94
104
|
// Desktop-e2e stub (mirrors MAUDE_E2E_FAKE_GITHUB_LOGIN in oauth.rs) — running
|
|
95
105
|
// the REAL `curl | bash` installer in a test harness is both slow/network-
|
|
@@ -99,7 +109,13 @@ const WELL_KNOWN_INSTALL_PATH =
|
|
|
99
109
|
// e2e-overridden — see above) — through the EXACT SAME freshness + content-pin
|
|
100
110
|
// verification path a real install goes through below, so that security-
|
|
101
111
|
// critical code stays exercised, not bypassed. Never set in a normal launch.
|
|
102
|
-
|
|
112
|
+
export function fakeInstallEnabled(
|
|
113
|
+
env: Record<string, string | undefined> = process.env,
|
|
114
|
+
release?: boolean
|
|
115
|
+
): boolean {
|
|
116
|
+
return e2eSwitch(env, 'MAUDE_E2E_FAKE_CLAUDE_INSTALL', release) === '1';
|
|
117
|
+
}
|
|
118
|
+
const E2E_FAKE_INSTALL = fakeInstallEnabled();
|
|
103
119
|
const FAKE_CLAUDE_SCRIPT = `#!/bin/sh
|
|
104
120
|
# Maude desktop-e2e fake claude binary (DDR-166) — only ever written when
|
|
105
121
|
# MAUDE_E2E_FAKE_CLAUDE_INSTALL=1. Implements just enough of \`auth status\`/
|
|
@@ -176,9 +192,10 @@ let installChild: ReturnType<typeof Bun.spawn> | null = null;
|
|
|
176
192
|
* person's real `~/.local/bin/claude` (MAUDE_E2E_CLAUDE_INSTALL_PATH redirects only the fake's target).
|
|
177
193
|
*/
|
|
178
194
|
export function installRefusal(
|
|
179
|
-
env: Record<string, string | undefined> = process.env
|
|
195
|
+
env: Record<string, string | undefined> = process.env,
|
|
196
|
+
release?: boolean
|
|
180
197
|
): string | null {
|
|
181
|
-
if (isE2eEnv(env) && env.MAUDE_E2E_FAKE_CLAUDE_INSTALL !== '1')
|
|
198
|
+
if (isE2eEnv(env, release) && env.MAUDE_E2E_FAKE_CLAUDE_INSTALL !== '1')
|
|
182
199
|
return 'An e2e lane never runs the real Claude Code installer (set MAUDE_E2E_FAKE_CLAUDE_INSTALL=1).';
|
|
183
200
|
return null;
|
|
184
201
|
}
|
|
@@ -60,6 +60,7 @@ import { chmodSync, lstatSync, mkdirSync, readdirSync, rmSync } from 'node:fs';
|
|
|
60
60
|
import { homedir, tmpdir } from 'node:os';
|
|
61
61
|
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
62
62
|
|
|
63
|
+
import { serverKeyDir } from '../shell/key-file.ts';
|
|
63
64
|
import { agentPath } from './agent-path.ts';
|
|
64
65
|
import { isInsideRoot, resolveRealPath } from './write-scope.ts';
|
|
65
66
|
|
|
@@ -272,6 +273,10 @@ export function mayRefusal(
|
|
|
272
273
|
// the two files this server's own profile env names (MAUDE_CLOUD_CONFIG / HUBS_CONFIG_PATH)
|
|
273
274
|
// wherever they are. The agent's env no longer carries those two pointers (acp/env.ts).
|
|
274
275
|
// • ~/.ssh, ~/.aws, ~/.gnupg, ~/Library/Keychains.
|
|
276
|
+
// • The desktop app's own data folder (#206): `servers.json` (every tab's port + attest key),
|
|
277
|
+
// `cli.sock`, `run/` (the token-bridge port), `shell-info/` and `home/`. Named entries, not the
|
|
278
|
+
// whole folder: a Maude Cloud project's managed copy lives in its `projects/` and its session
|
|
279
|
+
// must keep reading its own files.
|
|
275
280
|
//
|
|
276
281
|
// Two layers, as above: the deny rules (Read — Claude Code applies Read rules to Grep/Glob
|
|
277
282
|
// best-effort) and the live gate (`credentialRefusal`) for a request that does reach the bridge — a
|
|
@@ -289,10 +294,27 @@ export interface CredentialPaths {
|
|
|
289
294
|
files: string[];
|
|
290
295
|
}
|
|
291
296
|
|
|
297
|
+
/** The desktop app's identifier — its data folder's name (tauri.conf.json `identifier`). */
|
|
298
|
+
const APP_IDENTIFIER = 'com.maude.app';
|
|
299
|
+
|
|
300
|
+
/** The desktop app's data folder (Tauri `app_data_dir`) for a platform, or null when unknown. */
|
|
301
|
+
export function appDataDirFor(
|
|
302
|
+
env: Record<string, string | undefined>,
|
|
303
|
+
home: string,
|
|
304
|
+
platform: NodeJS.Platform
|
|
305
|
+
): string | null {
|
|
306
|
+
if (platform === 'darwin') return join(home, 'Library', 'Application Support', APP_IDENTIFIER);
|
|
307
|
+
if (platform === 'win32')
|
|
308
|
+
return env.APPDATA && isAbsolute(env.APPDATA) ? join(env.APPDATA, APP_IDENTIFIER) : null;
|
|
309
|
+
const data = env.XDG_DATA_HOME && isAbsolute(env.XDG_DATA_HOME) ? env.XDG_DATA_HOME : null;
|
|
310
|
+
return join(data ?? join(home, '.local', 'share'), APP_IDENTIFIER);
|
|
311
|
+
}
|
|
312
|
+
|
|
292
313
|
/** The credential folders/files for an env (absolute; the real path too when it differs). */
|
|
293
314
|
export function credentialPathsFor(
|
|
294
315
|
env: Record<string, string | undefined> = process.env,
|
|
295
|
-
home: string = env.HOME || homedir()
|
|
316
|
+
home: string = env.HOME || homedir(),
|
|
317
|
+
platform: NodeJS.Platform = process.platform
|
|
296
318
|
): CredentialPaths {
|
|
297
319
|
const dirs = new Set<string>();
|
|
298
320
|
const files = new Set<string>();
|
|
@@ -306,6 +328,21 @@ export function credentialPathsFor(
|
|
|
306
328
|
const xdg = env.XDG_CONFIG_HOME;
|
|
307
329
|
if (xdg && xdg.length > 0 && isAbsolute(xdg)) addDir(join(xdg, 'maude'));
|
|
308
330
|
for (const d of ['.ssh', '.aws', '.gnupg', join('Library', 'Keychains')]) addDir(join(home, d));
|
|
331
|
+
// sec-loopback-bearer §7.5 — terminal-started servers' API key files (shell/key-file.ts): the
|
|
332
|
+
// default state dir AND this env's XDG_STATE_HOME one — a terminal shell may set it when the app
|
|
333
|
+
// does not, so a server started there writes where this session's own env would not point
|
|
334
|
+
addDir(serverKeyDir({ HOME: home }));
|
|
335
|
+
addDir(serverKeyDir({ ...env, HOME: home }));
|
|
336
|
+
const appData = appDataDirFor(env, home, platform);
|
|
337
|
+
if (appData) {
|
|
338
|
+
for (const d of ['run', 'shell-info', 'home']) addDir(join(appData, d));
|
|
339
|
+
for (const f of ['servers.json', 'cli.sock']) {
|
|
340
|
+
const abs = resolve(appData, f);
|
|
341
|
+
files.add(abs);
|
|
342
|
+
const real = resolveRealPath(abs, abs);
|
|
343
|
+
if (real !== abs) files.add(real);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
309
346
|
for (const k of ['MAUDE_CLOUD_CONFIG', 'HUBS_CONFIG_PATH']) {
|
|
310
347
|
const f = env[k];
|
|
311
348
|
if (!f || !isAbsolute(f)) continue;
|
|
@@ -43,7 +43,12 @@ import { readFileSync } from 'node:fs';
|
|
|
43
43
|
import { homedir } from 'node:os';
|
|
44
44
|
import { basename, join } from 'node:path';
|
|
45
45
|
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
DESIGN_PLUGIN_DIR,
|
|
48
|
+
DESIGN_VIDEO_PLUGIN_DIR,
|
|
49
|
+
FLOW_PLUGIN_DIR,
|
|
50
|
+
KGAI_PLUGIN_DIR,
|
|
51
|
+
} from '../paths.ts';
|
|
47
52
|
import { readUiPrefs } from '../ui-prefs.ts';
|
|
48
53
|
|
|
49
54
|
/**
|
|
@@ -65,6 +70,8 @@ export interface SessionPluginDeps {
|
|
|
65
70
|
native: boolean;
|
|
66
71
|
/** Bundled `design` plugin dir, or null (npm/web layout). */
|
|
67
72
|
designDir: string | null;
|
|
73
|
+
/** Bundled `design-video` plugin dir (DDR-249), or null (npm/web layout / an older bundle). */
|
|
74
|
+
designVideoDir?: string | null;
|
|
68
75
|
/** Bundled `flow` plugin dir, or null (npm/web layout). */
|
|
69
76
|
flowDir: string | null;
|
|
70
77
|
/** Bundled third-party `kgai` plugin dir, or null (only staged in the .app). */
|
|
@@ -86,6 +93,10 @@ export function computeSessionPlugins(deps: SessionPluginDeps): SdkPluginConfig[
|
|
|
86
93
|
if (dir) out.push({ type: 'local', path: dir, skipMcpDiscovery: true });
|
|
87
94
|
};
|
|
88
95
|
add(deps.designDir);
|
|
96
|
+
// design-video (#156 §4, DDR-249) is opt-in in a terminal, but the app ships its video
|
|
97
|
+
// features (reel, footage analysis, video comps, Lottie handoff), so the chat always loads it.
|
|
98
|
+
// It needs design (its agents run under design's hooks), so it never loads alone.
|
|
99
|
+
if (deps.designDir) add(deps.designVideoDir ?? null);
|
|
89
100
|
// `/flow` auto-load is intentionally OFF for now (2026-07-03) — the chat ships
|
|
90
101
|
// design-only. `deps.flowDir` stays resolved (harmless) so restoring it is a
|
|
91
102
|
// one-liner: re-add `add(deps.flowDir)`.
|
|
@@ -214,6 +225,7 @@ export function resolveSessionPlugins(): SdkPluginConfig[] {
|
|
|
214
225
|
return computeSessionPlugins({
|
|
215
226
|
native: isNativePluginContext(),
|
|
216
227
|
designDir: DESIGN_PLUGIN_DIR,
|
|
228
|
+
designVideoDir: DESIGN_VIDEO_PLUGIN_DIR,
|
|
217
229
|
flowDir: FLOW_PLUGIN_DIR,
|
|
218
230
|
kgaiDir: KGAI_PLUGIN_DIR,
|
|
219
231
|
});
|
package/apps/studio/acp/probe.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
|
11
11
|
import { dirname, join, win32 } from 'node:path';
|
|
12
12
|
|
|
13
13
|
import { DEV_SERVER_ROOT, IS_COMPILED_BINARY } from '../paths.ts';
|
|
14
|
+
import { e2eSwitch, IS_RELEASE_BUILD } from '../release-build.ts';
|
|
14
15
|
import { scrubAgentEnv } from './env.ts';
|
|
15
16
|
|
|
16
17
|
/** Adapter npm package — the renamed continuation of `@zed-industries/claude-code-acp`. */
|
|
@@ -133,7 +134,8 @@ function contentStillTrusted(path: string): boolean {
|
|
|
133
134
|
*/
|
|
134
135
|
export function resolveClaudePath(
|
|
135
136
|
env: Record<string, string | undefined> = process.env,
|
|
136
|
-
which: (bin: string) => string | null = (bin) => Bun.which(bin)
|
|
137
|
+
which: (bin: string) => string | null = (bin) => Bun.which(bin),
|
|
138
|
+
release: boolean = IS_RELEASE_BUILD
|
|
137
139
|
): string | null {
|
|
138
140
|
// An explicit, content-pinned `MAUDE_CLAUDE_BIN` override is checked FIRST
|
|
139
141
|
// and always wins — including over the E2E force-missing stub below. This
|
|
@@ -153,17 +155,22 @@ export function resolveClaudePath(
|
|
|
153
155
|
// DDR-166 — deterministic E2E stub (mirrors MAUDE_E2E_FAKE_GITHUB_LOGIN in
|
|
154
156
|
// oauth.rs), simulating a machine where `claude` is absent from PATH.
|
|
155
157
|
// Never set in a normal launch.
|
|
156
|
-
if (env
|
|
158
|
+
if (e2eSwitch(env, 'MAUDE_E2E_FORCE_CLAUDE_STATUS', release) === 'missing') return null;
|
|
157
159
|
// p8-e2e-isolation-r13 — an e2e lane gets ONLY the stub it names in MAUDE_CLAUDE_BIN (above). A PATH lookup is
|
|
158
160
|
// what found the person's real `~/.local/bin/claude` in the 2026-10-27 V2-8.3 record: the sidecar's PATH is the
|
|
159
161
|
// person's login-shell PATH (sidecar.rs), and that claude reads the real keychain. Normal launches never set a
|
|
160
162
|
// MAUDE_E2E_* variable, so their resolution is unchanged.
|
|
161
|
-
if (isE2eEnv(env)) return null;
|
|
163
|
+
if (isE2eEnv(env, release)) return null;
|
|
162
164
|
return which('claude');
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
/** p8-e2e-isolation-r13 — true when any `MAUDE_E2E_*` variable is set non-empty (a desktop e2e lane / harness). */
|
|
166
|
-
export function isE2eEnv(
|
|
168
|
+
export function isE2eEnv(
|
|
169
|
+
env: Record<string, string | undefined> = process.env,
|
|
170
|
+
release: boolean = IS_RELEASE_BUILD
|
|
171
|
+
): boolean {
|
|
172
|
+
// #168 — a shipped build ignores every e2e switch (release-build.ts).
|
|
173
|
+
if (release) return false;
|
|
167
174
|
for (const [k, v] of Object.entries(env)) if (k.startsWith('MAUDE_E2E_') && v) return true;
|
|
168
175
|
return false;
|
|
169
176
|
}
|