@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://maude.sh/schema/beats/v1",
|
|
4
4
|
"title": "Maude beat-grid sidecar (assets/<sha8>.beats.json), v1",
|
|
5
|
-
"description": "GENERATED by scripts/gen-actions.mjs from apps/studio/video/format-ids.ts — the runtime source is validateBeats (video/schema.ts). V2-1.10 §5.2: one per music asset, written by `maude design beats` and the studio. Preserving (additionalProperties open). Rule the schema cannot state: beats strictly ascending. beats[bar.phase + 4k] are downbeats; tempoStrength < 0.15 means no clear beat. Skill: design:video-comp.",
|
|
5
|
+
"description": "GENERATED by scripts/gen-actions.mjs from apps/studio/video/format-ids.ts — the runtime source is validateBeats (video/schema.ts). V2-1.10 §5.2: one per music asset, written by `maude design beats` and the studio. Preserving (additionalProperties open). Rule the schema cannot state: beats strictly ascending. beats[bar.phase + 4k] are downbeats; tempoStrength < 0.15 means no clear beat. Skill: design-video:video-comp.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": [
|
|
8
8
|
"format",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://maude.sh/schema/edl/v1",
|
|
4
4
|
"title": "Maude edit decision list (<slug>.edl.json), v1",
|
|
5
|
-
"description": "The documented shape of an EDL (`/design:reel`, skill design:footage-director). The runtime source is `validateEdl` in apps/studio/footage/schema.ts — `maude design check --strict` runs it; test/schema-drift.test.ts holds this file to the same verdicts on a corpus. Every optional field may also be null. V2-1.12 R8: v1's reader treats an EDL with ANY unknown key as missing, so v2 adds no keys to this format.",
|
|
5
|
+
"description": "The documented shape of an EDL (`/design-video:reel`, skill design-video:footage-director). The runtime source is `validateEdl` in apps/studio/footage/schema.ts — `maude design check --strict` runs it; test/schema-drift.test.ts holds this file to the same verdicts on a corpus. Every optional field may also be null. V2-1.12 R8: v1's reader treats an EDL with ANY unknown key as missing, so v2 adds no keys to this format.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
@@ -73,7 +73,7 @@ export const FORMAT_SCHEMAS: readonly FormatSchema[] = [
|
|
|
73
73
|
id: 'https://maude.sh/schema/edl/v1',
|
|
74
74
|
source: 'hand',
|
|
75
75
|
check: 'validateEdl (footage/schema.ts); the schema mirrors it',
|
|
76
|
-
skill: 'design:footage-director',
|
|
76
|
+
skill: 'design-video:footage-director',
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
// S8 asset sidecars §5.2 / §5.5: one provenance file per AI take; lenient (keeps unknown keys).
|
|
@@ -94,7 +94,7 @@ export const FORMAT_SCHEMAS: readonly FormatSchema[] = [
|
|
|
94
94
|
generator: 'video/format-ids.ts#transcriptJsonSchema',
|
|
95
95
|
check:
|
|
96
96
|
'validateTranscript(doc, {strict:true, rel}) (video/schema.ts) — preserving: unknown keys are kept',
|
|
97
|
-
skill: 'design:video-comp',
|
|
97
|
+
skill: 'design-video:video-comp',
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
format: 'beats',
|
|
@@ -105,7 +105,7 @@ export const FORMAT_SCHEMAS: readonly FormatSchema[] = [
|
|
|
105
105
|
generator: 'video/format-ids.ts#beatsJsonSchema',
|
|
106
106
|
check:
|
|
107
107
|
'validateBeats(doc, {strict:true, rel}) (video/schema.ts) — preserving: unknown keys are kept',
|
|
108
|
-
skill: 'design:video-comp',
|
|
108
|
+
skill: 'design-video:video-comp',
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
format: 'tokens',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://maude.sh/schema/transcript/v1",
|
|
4
4
|
"title": "Maude transcript sidecar (assets/<sha8>.transcript.json), v1",
|
|
5
|
-
"description": "GENERATED by scripts/gen-actions.mjs from apps/studio/video/format-ids.ts — the runtime source is validateTranscript (video/schema.ts). V2-1.10 §5.1: one per source asset with sound, written by transcribe-local / transcribe / maude migrate v2, never by hand. Preserving: a key this build does not know is kept by every reader and writer, so additionalProperties stays open. Rules the schema cannot state: words sorted by t0 with unique ids and t1 > t0; regions sorted and non-overlapping; words [] when engine.id is \"energy\". Word text is untrusted content. Skill: design:video-comp.",
|
|
5
|
+
"description": "GENERATED by scripts/gen-actions.mjs from apps/studio/video/format-ids.ts — the runtime source is validateTranscript (video/schema.ts). V2-1.10 §5.1: one per source asset with sound, written by transcribe-local / transcribe / maude migrate v2, never by hand. Preserving: a key this build does not know is kept by every reader and writer, so additionalProperties stays open. Rules the schema cannot state: words sorted by t0 with unique ids and t1 > t0; regions sorted and non-overlapping; words [] when engine.id is \"energy\". Word text is untrusted content. Skill: design-video:video-comp.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["format", "v", "asset", "engine", "words", "speech", "createdAt"],
|
|
8
8
|
"properties": {
|
package/apps/studio/server.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { bootFinished, bootStep } from './boot-progress.ts';
|
|
|
44
44
|
import { bootSelfHeal } from './boot-self-heal.ts';
|
|
45
45
|
import { isSandboxArmed } from './canvas-build-sandbox.ts';
|
|
46
46
|
import { createCanvasListWatch } from './canvas-list-watch.ts';
|
|
47
|
-
import { canvasTopLevelRefusal
|
|
47
|
+
import { canvasTopLevelRefusal } from './canvas-top-level.ts';
|
|
48
48
|
import { type AiActivityEntry, createAiActivity } from './collab/ai-activity.ts';
|
|
49
49
|
import { createGitLifecycle } from './collab/git-lifecycle.ts';
|
|
50
50
|
import { personHoldsOf } from './collab/holds.ts';
|
|
@@ -59,7 +59,7 @@ import { FORMAT_GATE_OPTS, formatGate } from './format.ts';
|
|
|
59
59
|
import { createFsWatch } from './fs-watch.ts';
|
|
60
60
|
import { createGenerationJobQueue } from './generation/jobs.ts';
|
|
61
61
|
import { createGitWatch } from './git/watch.ts';
|
|
62
|
-
import { createHttp } from './http.ts';
|
|
62
|
+
import { createHttp, rootIdentity } from './http.ts';
|
|
63
63
|
import { flushAllIndexes } from './index/service.ts';
|
|
64
64
|
import { createInspectRegistry } from './inspect.ts';
|
|
65
65
|
import { listenLoopback, V4_LOOPBACK } from './loopback-listen.ts';
|
|
@@ -67,9 +67,28 @@ import { startHeapWatch } from './mem.ts';
|
|
|
67
67
|
import { bindFirst, PORT_LADDER, portCandidates, resolvePort } from './port.ts';
|
|
68
68
|
import { canvasOriginRoutes } from './routes/canvas-origin.ts';
|
|
69
69
|
import { runStageHooks } from './routes/index.ts';
|
|
70
|
+
import { bindShellRuntime, shellPendingWork } from './routes/shell.ts';
|
|
70
71
|
import { normalizeSessionKey, runInSession, SESSION_HEADER } from './session-scope.ts';
|
|
72
|
+
import {
|
|
73
|
+
bootApiKey,
|
|
74
|
+
LAUNCH_PARAM,
|
|
75
|
+
mainOriginKeyRefusal,
|
|
76
|
+
mintLaunchToken,
|
|
77
|
+
terminalKeylessForSplitOff,
|
|
78
|
+
terminalKeyMode,
|
|
79
|
+
} from './shell/api-key.ts';
|
|
80
|
+
import {
|
|
81
|
+
isCliRole,
|
|
82
|
+
registryPath,
|
|
83
|
+
SERVER_ROLE_ENV,
|
|
84
|
+
watchForAppSidecar,
|
|
85
|
+
yieldIntervalFrom,
|
|
86
|
+
yieldRefusal,
|
|
87
|
+
} from './shell/cli-yield.ts';
|
|
71
88
|
import { writeShellInfoFile } from './shell/info-file.ts';
|
|
89
|
+
import { removeServerKeyFile, writeServerKeyFile } from './shell/key-file.ts';
|
|
72
90
|
import { exitWithParent } from './shell/parent-watch.ts';
|
|
91
|
+
import { removeServerJsonIfOurs, writeServerJson } from './shell/server-json.ts';
|
|
73
92
|
import { createActionFeed } from './sync/action-feed.ts';
|
|
74
93
|
import { accessFor, getHubRecord, watchHubsConfig } from './sync/hubs-config.ts';
|
|
75
94
|
import { hubHealth } from './sync/journal-client.ts';
|
|
@@ -163,7 +182,7 @@ const api = createApi(ctx, {
|
|
|
163
182
|
},
|
|
164
183
|
// Phase 8 Task 5 — same bridge for annotations. PUT /_api/annotations writes
|
|
165
184
|
// the SVG blob to disk; we mirror it into the live Y.Map for collab peers.
|
|
166
|
-
onAnnotationsChanged: (file, svg, writeId, base, recordedWithLanes) => {
|
|
185
|
+
onAnnotationsChanged: (file, svg, writeId, base, recordedWithLanes, contested, label) => {
|
|
167
186
|
const runtime = ctx.syncControl?.current?.();
|
|
168
187
|
// T-S4.5b — a `run:<id>` batch (gated in http.ts annotationOps) joins its run's stage.
|
|
169
188
|
const runId = runTagOf(writeId);
|
|
@@ -189,6 +208,10 @@ const api = createApi(ctx, {
|
|
|
189
208
|
: runtime?.proposeLane?.(api.fileSlug(file), 'annotations', svg, {
|
|
190
209
|
...(writeId ? { writeId } : {}),
|
|
191
210
|
...(base !== undefined ? { baseText: base } : {}),
|
|
211
|
+
// T5.2 (#165) — a disk-path batch's contest, as a room's projection carries it.
|
|
212
|
+
...(contested?.length ? { contested } : {}),
|
|
213
|
+
// T7.3b (#113) — the gesture in words names the row ⌘Z undoes ("Ticked “…”")
|
|
214
|
+
...(label ? { label } : {}),
|
|
192
215
|
});
|
|
193
216
|
if (proposed) {
|
|
194
217
|
void proposed.catch(() => {});
|
|
@@ -201,9 +224,9 @@ const api = createApi(ctx, {
|
|
|
201
224
|
// Code review H1 — the canvas op path goes to a live room's replica, not to a
|
|
202
225
|
// file its debounced flush hasn't caught up with. Accepted mode keeps the
|
|
203
226
|
// disk + proposeLane path: there the hub kernel merges against the base.
|
|
204
|
-
applyAnnotationOpsLive: (file, ops, actionId, guard) => {
|
|
227
|
+
applyAnnotationOpsLive: (file, ops, actionId, guard, label) => {
|
|
205
228
|
if (ctx.syncControl?.current?.()?.acceptedMode?.()) return null;
|
|
206
|
-
return collab?.registry.applyOpsToRoom(api.fileSlug(file), ops, actionId, guard) ?? null;
|
|
229
|
+
return collab?.registry.applyOpsToRoom(api.fileSlug(file), ops, actionId, guard, label) ?? null;
|
|
207
230
|
},
|
|
208
231
|
// S4.V4 G4 — the reader's half of the same shortcut (the vote door reads its own write back).
|
|
209
232
|
readAnnotationsLive: (file) => {
|
|
@@ -463,6 +486,11 @@ const MAX_REQUEST_BODY = ASSET_MAX_VIDEO_BYTES + 8 * 1024 * 1024;
|
|
|
463
486
|
const FETCH_ROUTES_FORBIDDEN_IN_WORKSPACE = ['/_ws/acp'];
|
|
464
487
|
const FETCH_ROUTES_SANDBOXED = ['/_canvas-shell.html', '/_canvas-runtime/'];
|
|
465
488
|
const WORKSPACE = isWorkspaceMode();
|
|
489
|
+
// #206 — a terminal-started server (server-up / `maude design serve`) steps down for the app's
|
|
490
|
+
// sidecar on this root (shell/cli-yield.ts). Read once and removed: a role is this process's, not
|
|
491
|
+
// its children's (scrubAgentEnv drops it from the agent as well).
|
|
492
|
+
const CLI_ROLE = !WORKSPACE && isCliRole(process.env);
|
|
493
|
+
delete process.env[SERVER_ROLE_ENV];
|
|
466
494
|
// DDR-209 A′1 — the contract that lets a cell serve `/_canvas-shell` +
|
|
467
495
|
// `/_canvas-runtime` at all: the canvas build runs out of process, with an empty
|
|
468
496
|
// environment, an import allowlist and ceilings. Computed here rather than
|
|
@@ -493,7 +521,11 @@ function withSession<T extends unknown[]>(
|
|
|
493
521
|
// so a leaf asks `currentAccess()` instead of re-deriving a role.
|
|
494
522
|
// p8-a1-save-hold — and WHO saves: a write from the studio page (a browser) is a person's save, which
|
|
495
523
|
// waits while a running interpreter call names its file (ai/save-hold.ts); a terminal verb never does.
|
|
524
|
+
// #206 — a CLI server stepping down for the app's sidecar refuses new writes (shell/cli-yield.ts)
|
|
525
|
+
// sec-loopback-bearer §7 — a desktop-started server needs its key from every main-origin caller
|
|
496
526
|
return (req, ...rest) =>
|
|
527
|
+
mainOriginKeyRefusal(req) ??
|
|
528
|
+
yieldRefusal(req) ??
|
|
497
529
|
runWithAccess(http.accessOf(req), () =>
|
|
498
530
|
runInSession(WORKSPACE ? normalizeSessionKey(req.headers.get(SESSION_HEADER)) : '', () =>
|
|
499
531
|
withSaveRequest(req, () => handler(req, ...rest))
|
|
@@ -575,7 +607,14 @@ function startServer(port: number, hostname = V4_LOOPBACK): BunServer {
|
|
|
575
607
|
maxRequestBodySize: MAX_REQUEST_BODY,
|
|
576
608
|
routes: SERVER_ROUTES,
|
|
577
609
|
async fetch(req, srv) {
|
|
610
|
+
// sec-loopback-bearer §7 — first, before any WebSocket upgrade below (main listener only:
|
|
611
|
+
// the canvas and capture listeners keep their own frame-capability model)
|
|
612
|
+
const keyRefused = mainOriginKeyRefusal(req);
|
|
613
|
+
if (keyRefused) return keyRefused;
|
|
578
614
|
const pathname = new URL(req.url).pathname;
|
|
615
|
+
// #206 — the fall-through half of the yield refusal (`withSession` covers the routes map)
|
|
616
|
+
const yielded = yieldRefusal(req);
|
|
617
|
+
if (yielded) return yielded;
|
|
579
618
|
|
|
580
619
|
// Containment (DDR-193 §2) — the `fetch` fall-through owns paths that are
|
|
581
620
|
// not in the route table (`/_ws/acp`), so pruning the table alone would
|
|
@@ -779,13 +818,29 @@ async function seesRoomCanvas(access: Access, slug: string): Promise<boolean> {
|
|
|
779
818
|
return access.seesCanvas(file.startsWith(prefix) ? file.slice(prefix.length) : file);
|
|
780
819
|
}
|
|
781
820
|
|
|
821
|
+
/**
|
|
822
|
+
* #168 T5.4 S1 — no canvas installs a service worker, on either canvas listener. Under the canvas
|
|
823
|
+
* CSP `worker-src` falls back to `script-src 'self'`, so a canvas could otherwise register a worker
|
|
824
|
+
* that outlives its frame and answers later frames on the shared origin. The browser marks the
|
|
825
|
+
* worker script fetch (and its updates) with `Service-Worker: script`; no canvas needs one.
|
|
826
|
+
*/
|
|
827
|
+
function serviceWorkerRefusal(req: Request, listener: string): Response | null {
|
|
828
|
+
if (!req.headers.get('service-worker')) return null;
|
|
829
|
+
return new Response(`the ${listener} origin installs no service workers`, { status: 403 });
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/** The interactive canvas listener's gate: no service worker, never a top-level page. */
|
|
833
|
+
function canvasRefusal(req: Request): Response | null {
|
|
834
|
+
return serviceWorkerRefusal(req, 'canvas') ?? canvasTopLevelRefusal(req);
|
|
835
|
+
}
|
|
836
|
+
|
|
782
837
|
function captureRefusal(req: Request): Response | null {
|
|
783
838
|
if (!isLoopbackHost(req.headers.get('host')))
|
|
784
839
|
return new Response('local request required (DNS-rebinding guard)', { status: 403 });
|
|
785
840
|
if (req.headers.get('upgrade'))
|
|
786
841
|
return new Response('the capture origin accepts no upgrades', { status: 403 });
|
|
787
|
-
|
|
788
|
-
|
|
842
|
+
const sw = serviceWorkerRefusal(req, 'capture');
|
|
843
|
+
if (sw) return sw;
|
|
789
844
|
if (req.method !== 'GET' && req.method !== 'HEAD') return captureWriteRefusal();
|
|
790
845
|
return null;
|
|
791
846
|
}
|
|
@@ -797,7 +852,7 @@ function captureRefusal(req: Request): Response | null {
|
|
|
797
852
|
*/
|
|
798
853
|
function inFrame(req: Request, fn: () => Response | Promise<Response>): Promise<Response> {
|
|
799
854
|
return runInFrame(http.frameScopeOf(req), async () => {
|
|
800
|
-
const stop = frameRefusal(new URL(req.url).pathname, http.accessOf(req));
|
|
855
|
+
const stop = yieldRefusal(req) ?? frameRefusal(new URL(req.url).pathname, http.accessOf(req));
|
|
801
856
|
return stop ?? fn();
|
|
802
857
|
});
|
|
803
858
|
}
|
|
@@ -812,12 +867,15 @@ function framedRoutes<R extends Record<string, unknown>>(routes: R): R {
|
|
|
812
867
|
return out as R;
|
|
813
868
|
}
|
|
814
869
|
|
|
815
|
-
/** Each route behind
|
|
816
|
-
function
|
|
870
|
+
/** Each route behind `refusal` (Bun matches `routes` before `fetch`, so a gate on `fetch` alone misses them). */
|
|
871
|
+
function gatedRoutes<R extends Record<string, unknown>>(
|
|
872
|
+
routes: R,
|
|
873
|
+
refusal: (req: Request) => Response | null
|
|
874
|
+
): R {
|
|
817
875
|
const out: Record<string, unknown> = {};
|
|
818
876
|
for (const [path, handler] of Object.entries(routes)) {
|
|
819
877
|
const fn = handler as (req: Request) => Response | Promise<Response>;
|
|
820
|
-
out[path] = (req: Request) =>
|
|
878
|
+
out[path] = (req: Request) => refusal(req) ?? fn(req);
|
|
821
879
|
}
|
|
822
880
|
return out as R;
|
|
823
881
|
}
|
|
@@ -841,7 +899,9 @@ function startCanvasServer(
|
|
|
841
899
|
// GET/HEAD gate — never a third allowlist (V2-2.8 S9).
|
|
842
900
|
// V2-3.6 N-M2 — the interactive canvas origin refuses a top-level document
|
|
843
901
|
// (canvas-top-level.ts); the capture origin is loaded top-level by design.
|
|
844
|
-
|
|
902
|
+
// The capture origin's copy of the ONE table sits behind the capture gate; the interactive
|
|
903
|
+
// one behind the canvas gate (#168 S1: no service worker; V2-3.6 N-M2: no top-level page).
|
|
904
|
+
routes: gatedRoutes(routes, capture ? captureRefusal : canvasRefusal),
|
|
845
905
|
async fetch(req, srv) {
|
|
846
906
|
const pathname = new URL(req.url).pathname;
|
|
847
907
|
|
|
@@ -851,7 +911,7 @@ function startCanvasServer(
|
|
|
851
911
|
const refused = captureRefusal(req);
|
|
852
912
|
if (refused) return refused;
|
|
853
913
|
} else {
|
|
854
|
-
const refused =
|
|
914
|
+
const refused = canvasRefusal(req);
|
|
855
915
|
if (refused) return refused;
|
|
856
916
|
}
|
|
857
917
|
// gate-b-c4 — the rest runs inside this request's frame (see inFrame).
|
|
@@ -1016,6 +1076,9 @@ const extraShellOrigins = (process.env.MAUDE_EXTRA_SHELL_ORIGINS ?? '')
|
|
|
1016
1076
|
.map((o) => ` ${o}`)
|
|
1017
1077
|
.join('');
|
|
1018
1078
|
ctx.mainOrigin = `http://localhost:${server.port} http://127.0.0.1:${server.port}${publicShellOrigin}${extraShellOrigins}`;
|
|
1079
|
+
// #206 — what /_api/shell/attest binds into its MAC: this root's identity and the port this
|
|
1080
|
+
// listener BOUND (never a request's Host). Answered only when the app gave this spawn a key.
|
|
1081
|
+
bindShellRuntime({ rootId: rootIdentity(ctx.paths.repoRoot), port: server.port ?? 0 });
|
|
1019
1082
|
// DDR-247 — apps that may FRAME the studio for the read-only `?embed=1` view.
|
|
1020
1083
|
// Deliberately NOT folded into `mainOrigin` above: those are shells, and the
|
|
1021
1084
|
// hub's canvas door accepts shells as writers. An embedder only gets framing.
|
|
@@ -1070,28 +1133,35 @@ const captureServer =
|
|
|
1070
1133
|
: null;
|
|
1071
1134
|
if (captureServer) ctx.captureOrigin = `http://localhost:${captureServer.port}`;
|
|
1072
1135
|
|
|
1136
|
+
// sec-loopback-bearer §7.5 — a terminal-started server minted its own key; the CLI on this machine
|
|
1137
|
+
// reads it from the per-user key file (never the project), and the browser opens with a launch token.
|
|
1138
|
+
// Written BEFORE `_server.json`: a helper that found the port there finds the key too.
|
|
1139
|
+
const serverKeyFile = terminalKeyMode()
|
|
1140
|
+
? writeServerKeyFile({
|
|
1141
|
+
port: server.port ?? 0,
|
|
1142
|
+
pid: process.pid,
|
|
1143
|
+
rootId: rootIdentity(ctx.paths.repoRoot),
|
|
1144
|
+
apiKey: bootApiKey(),
|
|
1145
|
+
})
|
|
1146
|
+
: null;
|
|
1147
|
+
|
|
1073
1148
|
const startedAt = new Date().toISOString();
|
|
1074
1149
|
bootFinished();
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
},
|
|
1091
|
-
null,
|
|
1092
|
-
2
|
|
1093
|
-
)
|
|
1094
|
-
);
|
|
1150
|
+
// #206 (DDR-250 decision 7) — atomic, and removed at shutdown only while it still names this
|
|
1151
|
+
// server (shell/server-json.ts): another server on this root may have written its own since.
|
|
1152
|
+
writeServerJson(ctx.paths.serverInfoFile, {
|
|
1153
|
+
pid: process.pid,
|
|
1154
|
+
port: server.port ?? 0,
|
|
1155
|
+
url: `http://localhost:${server.port}`,
|
|
1156
|
+
...(canvasOrigin ? { canvasOrigin } : {}),
|
|
1157
|
+
// The port the canvas listener actually BOUND, as distinct from the
|
|
1158
|
+
// public `canvasOrigin` name above. A co-located reverse proxy (the cell's
|
|
1159
|
+
// hub) forwards canvas-origin traffic here; nothing else needs it.
|
|
1160
|
+
...(canvasServer ? { canvasPort: canvasServer.port } : {}),
|
|
1161
|
+
started: startedAt,
|
|
1162
|
+
project: ctx.cfg.name,
|
|
1163
|
+
config_source: ctx.cfg._source,
|
|
1164
|
+
});
|
|
1095
1165
|
// V2-1.1 decision 8 — the same facts, to the desktop shell's own info file when it asked for one
|
|
1096
1166
|
// (MAUDE_SHELL_INFO_FILE; atomic, 0600). Its probes read only that file + call the token-gated
|
|
1097
1167
|
// /_api/shell/status, so a planted _server.json is never believed. _server.json is unchanged.
|
|
@@ -1151,6 +1221,9 @@ const syncRuntime = createSyncSupervisor(ctx, collab ? { registry: collab.regist
|
|
|
1151
1221
|
// unchanged. The watcher feeds it through the bus.
|
|
1152
1222
|
const localHome = attachLocalHome(ctx, syncRuntime);
|
|
1153
1223
|
ctx.syncControl = localHome.control;
|
|
1224
|
+
// #206 — `/_api/shell/status.storeMode`: `read-only` while another server on this root holds the
|
|
1225
|
+
// store lock. No local store (a linked project) is never waiting for one.
|
|
1226
|
+
bindShellRuntime({ storeMode: () => localHome.home()?.mode() ?? 'writer' });
|
|
1154
1227
|
// S5.3 — the run registry's lease home (Q2): the linked hub when its `/health` advertises
|
|
1155
1228
|
// `runs-v1`, else per-Mac leases plus the Diagnostics line. An unreachable hub (capabilities
|
|
1156
1229
|
// null) keeps the per-Mac home without the line — it is offline, not old. A cell keeps its own.
|
|
@@ -1195,9 +1268,19 @@ try {
|
|
|
1195
1268
|
}
|
|
1196
1269
|
|
|
1197
1270
|
const url = `http://localhost:${server.port}`;
|
|
1271
|
+
// §7.5 — a key-requiring server opens with a one-time launch token; it is printed only to a
|
|
1272
|
+
// terminal (a nohup'd server-up log keeps the plain address) and never names the key itself
|
|
1273
|
+
const launchUrl = () => `${url}/?${LAUNCH_PARAM}=${mintLaunchToken(bootApiKey())}`;
|
|
1274
|
+
const requiresLaunch = terminalKeyMode();
|
|
1198
1275
|
console.log(`\n ${ctx.projectLabel} — local browser`);
|
|
1199
1276
|
console.log(' ─────────────────────────────');
|
|
1200
|
-
console.log(` ${url}`);
|
|
1277
|
+
console.log(` ${requiresLaunch && process.stdout.isTTY ? launchUrl() : url}`);
|
|
1278
|
+
if (requiresLaunch)
|
|
1279
|
+
console.log(' (the link opens once; `maude design server-up --open` opens the studio again)');
|
|
1280
|
+
if (terminalKeylessForSplitOff())
|
|
1281
|
+
console.log(
|
|
1282
|
+
' (MAUDE_CANVAS_ORIGIN_SPLIT=0: canvases run on this origin, so this server asks no key — any process on this Mac can reach it)'
|
|
1283
|
+
);
|
|
1201
1284
|
console.log(` Project: ${ctx.cfg.name}`);
|
|
1202
1285
|
console.log(` Config: ${ctx.cfg._source}`);
|
|
1203
1286
|
console.log(` Design: ${ctx.paths.designRoot}`);
|
|
@@ -1221,7 +1304,11 @@ if (!process.env.NO_OPEN && !WORKSPACE) {
|
|
|
1221
1304
|
// throw. That is precisely how a headless image with no `xdg-open` took the
|
|
1222
1305
|
// whole server down. (DDR-009 also prefers Bun.* here.)
|
|
1223
1306
|
try {
|
|
1224
|
-
Bun.spawn([opener,
|
|
1307
|
+
Bun.spawn([opener, requiresLaunch ? launchUrl() : url], {
|
|
1308
|
+
stdin: 'ignore',
|
|
1309
|
+
stdout: 'ignore',
|
|
1310
|
+
stderr: 'ignore',
|
|
1311
|
+
}).unref();
|
|
1225
1312
|
} catch {
|
|
1226
1313
|
console.log(` (could not open a browser automatically — visit ${url})`);
|
|
1227
1314
|
}
|
|
@@ -1320,14 +1407,9 @@ async function shutdown() {
|
|
|
1320
1407
|
} catch {
|
|
1321
1408
|
/* watcher cleanup is best-effort */
|
|
1322
1409
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
const fs = await import('node:fs/promises');
|
|
1327
|
-
await fs.unlink(ctx.paths.serverInfoFile).catch(() => {});
|
|
1328
|
-
} catch {
|
|
1329
|
-
/* ignore */
|
|
1330
|
-
}
|
|
1410
|
+
// #206 — compare-and-delete: never another server's file (a desktop sidecar on this root)
|
|
1411
|
+
removeServerJsonIfOurs(ctx.paths.serverInfoFile, { pid: process.pid, started: startedAt });
|
|
1412
|
+
removeServerKeyFile(serverKeyFile);
|
|
1331
1413
|
server.stop();
|
|
1332
1414
|
try {
|
|
1333
1415
|
canvasServer?.stop();
|
|
@@ -1349,3 +1431,20 @@ process.on('SIGTERM', shutdown);
|
|
|
1349
1431
|
// from a terminal (`maude design serve`, server-up.sh's nohup respawn) is meant to outlive that
|
|
1350
1432
|
// terminal and is left alone (shell/parent-watch.ts says who is who).
|
|
1351
1433
|
exitWithParent(() => void shutdown(), 'server');
|
|
1434
|
+
|
|
1435
|
+
// #206 (DDR-250 decision 1) — a terminal-started server hands the root over to the desktop app's
|
|
1436
|
+
// sidecar once one is running here AND attests (shell/cli-yield.ts): new writes get 409 `yielded`,
|
|
1437
|
+
// its jobs and unsent work finish (≤ 120 s), then the ordinary shutdown releases the store lock.
|
|
1438
|
+
const appRegistry = CLI_ROLE ? registryPath() : null;
|
|
1439
|
+
if (appRegistry) {
|
|
1440
|
+
watchForAppSidecar({
|
|
1441
|
+
root: ctx.paths.repoRoot,
|
|
1442
|
+
rootId: rootIdentity(ctx.paths.repoRoot),
|
|
1443
|
+
selfPid: process.pid,
|
|
1444
|
+
selfPort: server.port ?? 0,
|
|
1445
|
+
file: appRegistry,
|
|
1446
|
+
pending: shellPendingWork,
|
|
1447
|
+
intervalMs: yieldIntervalFrom(process.env),
|
|
1448
|
+
onYield: () => void shutdown(),
|
|
1449
|
+
});
|
|
1450
|
+
}
|