@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.
Files changed (401) hide show
  1. package/README.md +2 -1
  2. package/apps/hub/src/project-transactions/kernel.mjs +13 -7
  3. package/apps/studio/access/closure.ts +86 -10
  4. package/apps/studio/access/filters.ts +18 -1
  5. package/apps/studio/access/request.ts +8 -0
  6. package/apps/studio/acp/design-write-verb.ts +12 -2
  7. package/apps/studio/acp/env.ts +7 -2
  8. package/apps/studio/acp/index.ts +15 -4
  9. package/apps/studio/acp/login-state.ts +22 -5
  10. package/apps/studio/acp/may-scope.ts +38 -1
  11. package/apps/studio/acp/plugin-bootstrap.ts +13 -1
  12. package/apps/studio/acp/probe.ts +11 -4
  13. package/apps/studio/actions/agents.ts +110 -28
  14. package/apps/studio/actions/canvas-keys.ts +4 -2
  15. package/apps/studio/actions/ctx.ts +3 -0
  16. package/apps/studio/actions/defs/annotation.ts +84 -2
  17. package/apps/studio/actions/defs/app.ts +28 -1
  18. package/apps/studio/actions/defs/edit.ts +13 -0
  19. package/apps/studio/actions/defs/export.ts +12 -0
  20. package/apps/studio/actions/defs/sync.ts +18 -0
  21. package/apps/studio/actions/defs/video.ts +9 -0
  22. package/apps/studio/actions/documents.ts +6 -1
  23. package/apps/studio/actions/keymap.gen.ts +147 -9
  24. package/apps/studio/actions/menu.ts +5 -1
  25. package/apps/studio/actions/types.ts +4 -2
  26. package/apps/studio/actions/verbs.ts +9 -0
  27. package/apps/studio/actions.manifest.json +300 -45
  28. package/apps/studio/actions.parity.json +19 -1
  29. package/apps/studio/ai/save-hold.ts +2 -1
  30. package/apps/studio/ai/write-claim-scope.ts +7 -1
  31. package/apps/studio/ai/write-claim.ts +154 -3
  32. package/apps/studio/annotations/ai-read.ts +42 -6
  33. package/apps/studio/annotations/ai-write.ts +145 -2
  34. package/apps/studio/annotations/board-ops.ts +34 -3
  35. package/apps/studio/annotations/checklist-ops.ts +374 -0
  36. package/apps/studio/annotations/elements/checkitem.model.ts +129 -0
  37. package/apps/studio/annotations/elements/sticky.model.ts +54 -2
  38. package/apps/studio/annotations/ops.ts +30 -0
  39. package/apps/studio/annotations/registry.ts +9 -1
  40. package/apps/studio/annotations/templates.ts +4 -2
  41. package/apps/studio/annotations/text-steps.ts +114 -10
  42. package/apps/studio/annotations/ui/checklist-wire.ts +129 -0
  43. package/apps/studio/annotations/ui/checklist.tsx +429 -0
  44. package/apps/studio/annotations/ui/element-node.tsx +48 -2
  45. package/apps/studio/annotations/ui/template-place.ts +11 -1
  46. package/apps/studio/annotations/v1-adapter.ts +22 -3
  47. package/apps/studio/annotations-context-toolbar.tsx +12 -0
  48. package/apps/studio/annotations-layer.tsx +442 -49
  49. package/apps/studio/annotations-model.ts +4 -2
  50. package/apps/studio/api.ts +148 -21
  51. package/apps/studio/artboard-live-gate.tsx +54 -17
  52. package/apps/studio/artboard-still-persist.ts +166 -0
  53. package/apps/studio/artboard-still-raster.ts +6 -2
  54. package/apps/studio/artboard-still.ts +390 -20
  55. package/apps/studio/asset-added.ts +154 -0
  56. package/apps/studio/asset-details.ts +46 -3
  57. package/apps/studio/asset-origins.ts +5 -3
  58. package/apps/studio/asset-trash.ts +6 -1
  59. package/apps/studio/bin/_agent-browser-safe.mjs +3 -4
  60. package/apps/studio/bin/_annotate-post.mjs +14 -5
  61. package/apps/studio/bin/_audio-search.mjs +8 -2
  62. package/apps/studio/bin/_curl-local.mjs +7 -4
  63. package/apps/studio/bin/_desktop-locate.sh +145 -0
  64. package/apps/studio/bin/_ds-check-live.mjs +2 -1
  65. package/apps/studio/bin/_exports.mjs +38 -2
  66. package/apps/studio/bin/_history.mjs +79 -8
  67. package/apps/studio/bin/_import-asset.mjs +14 -9
  68. package/apps/studio/bin/_import-figma.mjs +510 -98
  69. package/apps/studio/bin/_index-cli.mjs +10 -21
  70. package/apps/studio/bin/_ingest-footage.mjs +24 -6
  71. package/apps/studio/bin/_media-probe.mjs +232 -0
  72. package/apps/studio/bin/_perf-probe-open.mjs +6 -0
  73. package/apps/studio/bin/_perf-probe-safari.mjs +6 -0
  74. package/apps/studio/bin/_perf-probe-studio.mjs +6 -1
  75. package/apps/studio/bin/_perf-probe.mjs +8 -3
  76. package/apps/studio/bin/_perf-sweep-shared.mjs +789 -0
  77. package/apps/studio/bin/_perf-sweep.mjs +240 -0
  78. package/apps/studio/bin/_record-shot.sh +33 -8
  79. package/apps/studio/bin/_screenshot-playwright.mjs +45 -2
  80. package/apps/studio/bin/_studio-verb.mjs +8 -3
  81. package/apps/studio/bin/_thumb-route.mjs +21 -0
  82. package/apps/studio/bin/_thumbs-playwright.mjs +83 -1
  83. package/apps/studio/bin/_transcribe.mjs +22 -6
  84. package/apps/studio/bin/_unsynced-refs.mjs +22 -0
  85. package/apps/studio/bin/_url-guard.mjs +120 -5
  86. package/apps/studio/bin/_url-guard.sh +29 -7
  87. package/apps/studio/bin/_video-limits.mjs +104 -0
  88. package/apps/studio/bin/_video-playwright.mjs +119 -19
  89. package/apps/studio/bin/_video-proxy.mjs +130 -0
  90. package/apps/studio/bin/_write-claim.mjs +38 -16
  91. package/apps/studio/bin/annotate.mjs +12 -2
  92. package/apps/studio/bin/canvas-rects.sh +19 -4
  93. package/apps/studio/bin/chat-open.sh +7 -1
  94. package/apps/studio/bin/draw-proof.sh +6 -2
  95. package/apps/studio/bin/generate.sh +32 -10
  96. package/apps/studio/bin/handoff.sh +2 -2
  97. package/apps/studio/bin/perf.sh +96 -15
  98. package/apps/studio/bin/photo-adjust.sh +6 -3
  99. package/apps/studio/bin/photo-bg-remove.sh +2 -2
  100. package/apps/studio/bin/prep.sh +21 -4
  101. package/apps/studio/bin/read-annotations.mjs +3 -0
  102. package/apps/studio/bin/runtime-health.sh +27 -1
  103. package/apps/studio/bin/screenshot.sh +152 -12
  104. package/apps/studio/bin/server-up.sh +64 -6
  105. package/apps/studio/bin/smoke.sh +43 -8
  106. package/apps/studio/bin/to-lottie.sh +3 -2
  107. package/apps/studio/bin/video-proxy.sh +27 -0
  108. package/apps/studio/bin/visual-sanity.sh +3 -1
  109. package/apps/studio/bridge/dgn-protocol.ts +157 -1
  110. package/apps/studio/bridge/mode-shows.ts +8 -6
  111. package/apps/studio/bridge/still-webp.ts +233 -0
  112. package/apps/studio/build.ts +18 -0
  113. package/apps/studio/canvas-build.ts +93 -11
  114. package/apps/studio/canvas-comment-mount.tsx +53 -8
  115. package/apps/studio/canvas-edit.ts +34 -1
  116. package/apps/studio/canvas-lib-module.ts +210 -0
  117. package/apps/studio/canvas-lib.tsx +3 -12
  118. package/apps/studio/canvas-pipeline.ts +111 -5
  119. package/apps/studio/canvas-shell.tsx +8 -11
  120. package/apps/studio/canvas-theme-pill.tsx +5 -3
  121. package/apps/studio/check/index.ts +12 -5
  122. package/apps/studio/check/video.ts +18 -2
  123. package/apps/studio/client/app.jsx +65 -7
  124. package/apps/studio/client/clipboard-relay.ts +193 -16
  125. package/apps/studio/client/comments-overlay.css +18 -0
  126. package/apps/studio/client/export-center.jsx +30 -0
  127. package/apps/studio/client/generate-dialog.jsx +49 -4
  128. package/apps/studio/client/github.js +7 -0
  129. package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
  130. package/apps/studio/client/home/HomeConnection.jsx +111 -0
  131. package/apps/studio/client/home/home-accounts-model.js +110 -1
  132. package/apps/studio/client/home/home-api.js +9 -2
  133. package/apps/studio/client/home/home-app.jsx +126 -13
  134. package/apps/studio/client/home/home-model.js +69 -1
  135. package/apps/studio/client/home/home-where-model.js +105 -0
  136. package/apps/studio/client/home/home.css +239 -1
  137. package/apps/studio/client/hooks/use-canvas-bridge.jsx +173 -98
  138. package/apps/studio/client/hooks/use-palette-and-panels.jsx +5 -1
  139. package/apps/studio/client/hooks/use-tabs.jsx +11 -4
  140. package/apps/studio/client/panels/DiffView.jsx +7 -1
  141. package/apps/studio/client/panels/TeamProjects.jsx +137 -134
  142. package/apps/studio/client/panels/chat-context.js +2 -0
  143. package/apps/studio/client/panels/slash-commands.gen.js +13 -13
  144. package/apps/studio/client/selection-scope.js +16 -9
  145. package/apps/studio/client/share-link.js +12 -0
  146. package/apps/studio/client/shell/viewport.jsx +11 -1
  147. package/apps/studio/client/shell-events.js +8 -0
  148. package/apps/studio/client/styles/3-kit-maude-v2.css +16 -0
  149. package/apps/studio/client/styles/_index.css +4 -0
  150. package/apps/studio/client/v2/ai/Feed.jsx +1 -1
  151. package/apps/studio/client/v2/ai/OfferCard.jsx +34 -0
  152. package/apps/studio/client/v2/ai/activity-line.js +54 -1
  153. package/apps/studio/client/v2/ai/ai-offer.js +21 -1
  154. package/apps/studio/client/v2/ai/run-model.js +3 -1
  155. package/apps/studio/client/v2/annotations/vote-store.js +28 -4
  156. package/apps/studio/client/v2/assets/asset-drop-session.js +37 -2
  157. package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +7 -5
  158. package/apps/studio/client/v2/assets/details-model.js +1 -1
  159. package/apps/studio/client/v2/assets/details.jsx +5 -0
  160. package/apps/studio/client/v2/assets/tile-drag.js +11 -7
  161. package/apps/studio/client/v2/comments/comments-panel.jsx +22 -3
  162. package/apps/studio/client/v2/create/duplicate-done.js +6 -2
  163. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
  164. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
  165. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
  166. package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
  167. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +113 -3
  168. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +343 -6
  169. package/apps/studio/client/v2/diagnostics/sync-details/unsynced-refs.js +55 -0
  170. package/apps/studio/client/v2/ds/review.css +1 -1
  171. package/apps/studio/client/v2/export/exports-model.js +7 -0
  172. package/apps/studio/client/v2/export/exports-panel.jsx +1 -0
  173. package/apps/studio/client/v2/export/job-row.jsx +32 -2
  174. package/apps/studio/client/v2/handoff/ready-card.jsx +1 -1
  175. package/apps/studio/client/v2/history/compare-view.jsx +1 -0
  176. package/apps/studio/client/v2/inspector/css-write.js +6 -1
  177. package/apps/studio/client/v2/inspector/frame.jsx +28 -4
  178. package/apps/studio/client/v2/inspector/kinds/clip-model.js +51 -0
  179. package/apps/studio/client/v2/inspector/kinds/clip.jsx +75 -2
  180. package/apps/studio/client/v2/inspector/model.js +21 -0
  181. package/apps/studio/client/v2/inspector/sections/fill.jsx +12 -3
  182. package/apps/studio/client/v2/inspector/sections/recent-colours.js +8 -5
  183. package/apps/studio/client/v2/inspector/view-mode.jsx +11 -1
  184. package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
  185. package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
  186. package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
  187. package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
  188. package/apps/studio/client/v2/link-server/link-server.css +109 -0
  189. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
  190. package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
  191. package/apps/studio/client/v2/preview/link-follow.js +4 -2
  192. package/apps/studio/client/v2/preview/preview-chrome-host.jsx +16 -6
  193. package/apps/studio/client/v2/search/help-model.js +2 -0
  194. package/apps/studio/client/v2/search/search-keywords.js +3 -2
  195. package/apps/studio/client/v2/settings/account.jsx +4 -2
  196. package/apps/studio/client/v2/settings/advanced-section.jsx +344 -137
  197. package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
  198. package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
  199. package/apps/studio/client/v2/settings/general-section.jsx +155 -24
  200. package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
  201. package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
  202. package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
  203. package/apps/studio/client/v2/settings/settings-cards.js +220 -0
  204. package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
  205. package/apps/studio/client/v2/settings/settings-model.js +100 -31
  206. package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
  207. package/apps/studio/client/v2/settings/settings.css +374 -64
  208. package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
  209. package/apps/studio/client/v2/settings/this-project-model.js +172 -0
  210. package/apps/studio/client/v2/settings/use-connections.js +3 -2
  211. package/apps/studio/client/v2/settings/use-open-card.js +37 -0
  212. package/apps/studio/client/v2/share/share-sheet.jsx +28 -11
  213. package/apps/studio/client/v2/shell/api-session-boot.js +6 -0
  214. package/apps/studio/client/v2/shell/api-session.js +126 -0
  215. package/apps/studio/client/v2/shell/connection-state.js +197 -0
  216. package/apps/studio/client/v2/shell/floating-panels.css +31 -1
  217. package/apps/studio/client/v2/shell/image-pick.js +61 -8
  218. package/apps/studio/client/v2/shell/menu-aim.js +43 -0
  219. package/apps/studio/client/v2/shell/menu-runner.js +25 -7
  220. package/apps/studio/client/v2/shell/occlusion-insets.js +18 -1
  221. package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
  222. package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
  223. package/apps/studio/client/v2/shell/project-account-model.js +272 -149
  224. package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
  225. package/apps/studio/client/v2/shell/project-account.css +237 -0
  226. package/apps/studio/client/v2/shell/project-pill.jsx +52 -6
  227. package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
  228. package/apps/studio/client/v2/shell/shell-parity.js +3 -2
  229. package/apps/studio/client/v2/shell/shell-parity.json +71 -36
  230. package/apps/studio/client/v2/shell/still-bridge.js +194 -0
  231. package/apps/studio/client/v2/shell/still-store.js +319 -0
  232. package/apps/studio/client/v2/shell/use-account.js +2 -0
  233. package/apps/studio/client/v2/shell/use-tool-panels.js +2 -1
  234. package/apps/studio/client/v2/signin/use-signin.js +1 -1
  235. package/apps/studio/client/v2/timeline/Timeline.jsx +15 -0
  236. package/apps/studio/client/v2/timeline/frame-handle-model.js +142 -0
  237. package/apps/studio/client/v2/timeline/frame-handle.jsx +151 -0
  238. package/apps/studio/clip-ops.ts +126 -8
  239. package/apps/studio/cloud/endpoints.ts +29 -4
  240. package/apps/studio/collab/ai-activity.ts +10 -8
  241. package/apps/studio/collab/awareness-bridge.ts +34 -9
  242. package/apps/studio/collab/index.ts +3 -0
  243. package/apps/studio/collab/registry.ts +41 -10
  244. package/apps/studio/comment-reattach.ts +149 -0
  245. package/apps/studio/comments/mine-stamp.ts +15 -7
  246. package/apps/studio/comments/ops.ts +52 -8
  247. package/apps/studio/comments-overlay.tsx +146 -9
  248. package/apps/studio/dist/client.bundle.js +892 -885
  249. package/apps/studio/dist/comment-mount.js +2 -2
  250. package/apps/studio/dist/styles.css +1 -1
  251. package/apps/studio/dom-selection.ts +87 -18
  252. package/apps/studio/ds/board/directions.css +8 -0
  253. package/apps/studio/ds/board/outline.tsx +16 -0
  254. package/apps/studio/ds/canvas-check.ts +6 -0
  255. package/apps/studio/edit-ops/clip/reframe.ts +19 -3
  256. package/apps/studio/edit-ops/clip-carry.ts +602 -0
  257. package/apps/studio/edit-ops/clipboard.ts +318 -23
  258. package/apps/studio/edit-ops/dispatch.ts +20 -2
  259. package/apps/studio/edit-ops/scope-names.ts +249 -40
  260. package/apps/studio/edit-ops/slot-defaults.ts +3 -0
  261. package/apps/studio/edit-ops/types.ts +6 -0
  262. package/apps/studio/editing/align-bar.tsx +33 -9
  263. package/apps/studio/editing/artboard-actions.ts +5 -0
  264. package/apps/studio/editing/artboard-menu.tsx +6 -2
  265. package/apps/studio/editing/click-to-type.ts +1 -1
  266. package/apps/studio/editing/clip-words.ts +48 -0
  267. package/apps/studio/editing/clipboard.ts +21 -6
  268. package/apps/studio/editing/declared-background.ts +25 -0
  269. package/apps/studio/editing/index.tsx +3 -0
  270. package/apps/studio/editing/object-keys.ts +4 -4
  271. package/apps/studio/editing/object-menu.tsx +13 -3
  272. package/apps/studio/editing/pen/points.tsx +61 -0
  273. package/apps/studio/editing/text-in-place.tsx +11 -0
  274. package/apps/studio/editing/video-frame-handle.tsx +425 -0
  275. package/apps/studio/exporters/capture-prepass.ts +374 -0
  276. package/apps/studio/exporters/degraded.ts +148 -0
  277. package/apps/studio/exporters/hub-render-door.ts +28 -2
  278. package/apps/studio/exporters/index.ts +3 -1
  279. package/apps/studio/exporters/job-budget.ts +93 -0
  280. package/apps/studio/exporters/jobs.ts +215 -28
  281. package/apps/studio/exporters/parity-check.ts +254 -0
  282. package/apps/studio/exporters/remote.ts +209 -15
  283. package/apps/studio/exporters/svg-inline.ts +87 -0
  284. package/apps/studio/exporters/video-render-lib.ts +88 -26
  285. package/apps/studio/exporters/video.ts +29 -6
  286. package/apps/studio/figma/assets.ts +58 -43
  287. package/apps/studio/figma/codegen-fonts.ts +100 -0
  288. package/apps/studio/figma/fig-decode.ts +390 -25
  289. package/apps/studio/figma/fig-kiwi.ts +18 -4
  290. package/apps/studio/figma/fig-vector.ts +59 -3
  291. package/apps/studio/figma/sanitize.ts +2 -0
  292. package/apps/studio/figma/style-map.ts +293 -48
  293. package/apps/studio/figma/to-artboard.ts +455 -69
  294. package/apps/studio/figma/to-strokes.ts +44 -11
  295. package/apps/studio/figma/types.ts +13 -0
  296. package/apps/studio/footage/schema.ts +3 -3
  297. package/apps/studio/generation/adapters/elevenlabs.ts +7 -1
  298. package/apps/studio/generation/adapters/groq.ts +8 -1
  299. package/apps/studio/generation/spend.ts +312 -0
  300. package/apps/studio/generation/types.ts +12 -0
  301. package/apps/studio/handoff/run.ts +1 -1
  302. package/apps/studio/handoff/targets.ts +2 -2
  303. package/apps/studio/handoff/write-scopes.ts +1 -1
  304. package/apps/studio/history/describe-annotations.ts +4 -0
  305. package/apps/studio/home/accounts.ts +30 -11
  306. package/apps/studio/home/cloud.ts +6 -1
  307. package/apps/studio/home/create-local.ts +32 -3
  308. package/apps/studio/home/hub-health.ts +76 -0
  309. package/apps/studio/home/routes.ts +15 -4
  310. package/apps/studio/http.ts +438 -86
  311. package/apps/studio/imported-module-ids.ts +91 -0
  312. package/apps/studio/inspect.ts +2 -0
  313. package/apps/studio/migrate/hub.ts +8 -1
  314. package/apps/studio/notifications.tsx +47 -5
  315. package/apps/studio/paths.ts +10 -1
  316. package/apps/studio/port.ts +3 -2
  317. package/apps/studio/preview/preview-camera.tsx +15 -382
  318. package/apps/studio/readiness.ts +10 -1
  319. package/apps/studio/release-build.ts +51 -0
  320. package/apps/studio/routes/agent.ts +188 -9
  321. package/apps/studio/routes/ai.ts +43 -11
  322. package/apps/studio/routes/annotations.ts +27 -1
  323. package/apps/studio/routes/assets.ts +18 -1
  324. package/apps/studio/routes/canvas-origin.ts +12 -9
  325. package/apps/studio/routes/cloud-move.ts +15 -0
  326. package/apps/studio/routes/edit.ts +3 -0
  327. package/apps/studio/routes/export.ts +51 -0
  328. package/apps/studio/routes/generate.ts +42 -12
  329. package/apps/studio/routes/hub-link-folder.ts +334 -0
  330. package/apps/studio/routes/hub-signin.ts +78 -1
  331. package/apps/studio/routes/index.ts +9 -1
  332. package/apps/studio/routes/shell.ts +217 -5
  333. package/apps/studio/routes/sync.ts +136 -8
  334. package/apps/studio/routes/votes.ts +2 -1
  335. package/apps/studio/schema/annotations.v2.schema.json +143 -1
  336. package/apps/studio/schema/beats.v1.schema.json +1 -1
  337. package/apps/studio/schema/edl.v1.schema.json +1 -1
  338. package/apps/studio/schema/formats.ts +3 -3
  339. package/apps/studio/schema/transcript.v1.schema.json +1 -1
  340. package/apps/studio/server.ts +142 -43
  341. package/apps/studio/shell/api-key.ts +503 -0
  342. package/apps/studio/shell/attest.ts +59 -0
  343. package/apps/studio/shell/capture-url.ts +20 -0
  344. package/apps/studio/shell/cli-yield.ts +276 -0
  345. package/apps/studio/shell/clip-transfer.ts +302 -0
  346. package/apps/studio/shell/key-file.ts +108 -0
  347. package/apps/studio/shell/server-json.ts +75 -0
  348. package/apps/studio/shell/worktree.ts +19 -0
  349. package/apps/studio/spoof-chars.ts +9 -0
  350. package/apps/studio/studio-page-host.ts +1 -1
  351. package/apps/studio/sync/accepted-cold-start.ts +144 -8
  352. package/apps/studio/sync/accepted-link.ts +76 -29
  353. package/apps/studio/sync/action-stage.ts +575 -44
  354. package/apps/studio/sync/adopt-held.ts +85 -0
  355. package/apps/studio/sync/ctl-heal.ts +58 -0
  356. package/apps/studio/sync/file-ledger.ts +38 -4
  357. package/apps/studio/sync/file-membership.ts +16 -1
  358. package/apps/studio/sync/file-plane.ts +289 -22
  359. package/apps/studio/sync/held-deletes.ts +86 -5
  360. package/apps/studio/sync/hub-link.ts +8 -0
  361. package/apps/studio/sync/index.ts +196 -12
  362. package/apps/studio/sync/journal-client.ts +50 -4
  363. package/apps/studio/sync/link-consent.ts +22 -75
  364. package/apps/studio/sync/link-survey.ts +252 -0
  365. package/apps/studio/sync/local-kernel.ts +296 -8
  366. package/apps/studio/sync/projection.ts +22 -3
  367. package/apps/studio/sync/seed-progress.ts +12 -0
  368. package/apps/studio/sync/source-recovery.ts +59 -3
  369. package/apps/studio/sync/status.ts +19 -2
  370. package/apps/studio/sync/unsynced-refs.ts +397 -0
  371. package/apps/studio/sync/writer-registry.ts +20 -0
  372. package/apps/studio/thumbs/service.ts +4 -1
  373. package/apps/studio/tool-palette.tsx +23 -0
  374. package/apps/studio/ui-prefs.ts +40 -0
  375. package/apps/studio/use-agent-presence.tsx +2 -2
  376. package/apps/studio/use-canvas-keys.ts +6 -1
  377. package/apps/studio/video/format-ids.ts +2 -2
  378. package/apps/studio/video/inject.ts +31 -0
  379. package/apps/studio/video/media-risk.ts +58 -0
  380. package/apps/studio/video/object-fit.ts +137 -0
  381. package/apps/studio/video/provider-transcript.ts +141 -0
  382. package/apps/studio/whats-new.json +137 -0
  383. package/apps/studio/workspace-mode.ts +1 -0
  384. package/apps/studio/ws.ts +5 -0
  385. package/cli/commands/design.mjs +119 -8
  386. package/cli/lib/bash-guard.mjs +366 -6
  387. package/cli/lib/confine-read.mjs +1 -0
  388. package/cli/lib/design-help.gen.mjs +3 -2
  389. package/cli/lib/design-hook.mjs +387 -81
  390. package/cli/lib/design-link.mjs +16 -1
  391. package/cli/lib/design-open.mjs +49 -3
  392. package/cli/lib/desktop-locate.mjs +770 -0
  393. package/cli/lib/handoff.mjs +1 -1
  394. package/cli/lib/hook-state.mjs +291 -0
  395. package/cli/lib/pkg-root.mjs +65 -13
  396. package/cli/lib/studio-locate.mjs +59 -16
  397. package/package.json +15 -8
  398. package/plugins/design/templates/_shell.html +13 -0
  399. package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
  400. package/apps/studio/client/v2/shell/account-card-model.js +0 -114
  401. package/apps/studio/client/v2/shell/account-card.jsx +0 -189
@@ -95,6 +95,94 @@ export function transpileCanvasSource(canvasAbsPath: string, source: string): Tr
95
95
  return { js, locator, etag, withIds };
96
96
  }
97
97
 
98
+ /**
99
+ * #151 §3 (T2.3) — stamp a LOCAL MODULE a canvas imports (a shared hi-fi component file), so a
100
+ * comment, a selection or an arrow aimed at one of its elements has a `data-cd-id` to hold. Pass 1
101
+ * only ever saw the canvas's own source; every element rendered by an imported component had none.
102
+ *
103
+ * Differences from the canvas pass, all on purpose:
104
+ * - the computed id is scoped to the MODULE (`scope`, its design-root-relative path), so two
105
+ * modules' `Card:0` cannot collide with each other or with the canvas's own ids;
106
+ * - no locator entry — the locator is the canvas file's map (the inspector and the text patch
107
+ * match it by the canvas source's line/column), and an imported element is not in that file;
108
+ * - no `data-cd-editable` marker — the edit engine reads the canvas source, so offering an inline
109
+ * edit there would only fail at commit.
110
+ * An element is rendered once per use of its component, so instances share an id exactly like
111
+ * `.map()` rows do; the occurrence index tells them apart (ElementRef.occurrence).
112
+ *
113
+ * Returns the stamped source, or null when the file does not parse / has nothing to stamp (the
114
+ * bundler then reads the original and reports its own error).
115
+ */
116
+ export function stampImportedModule(
117
+ moduleAbsPath: string,
118
+ source: string,
119
+ scope: string
120
+ ): string | null {
121
+ if (hasMacroImport(source)) return null;
122
+ let parsed: ReturnType<typeof parseSync>;
123
+ try {
124
+ parsed = parseSync(moduleAbsPath, source, { sourceType: 'module' });
125
+ } catch {
126
+ return null;
127
+ }
128
+ if (parsed.errors && parsed.errors.length > 0) return null;
129
+ const s = new MagicString(source);
130
+ walkInjectIds(parsed.program, source, moduleAbsPath, s, {}, { idScope: scope });
131
+ return s.hasChanged() ? s.toString() : null;
132
+ }
133
+
134
+ /**
135
+ * The scope (design-root-relative posix path) an imported module's ids and `data-cd-module` marker are
136
+ * made under, or null when the file is not one to stamp: outside the root, the design system folder
137
+ * (`system/` is selected as an instance), runtime state (`_*`), dot-folders, vendored code, or a path
138
+ * with a character that could not sit safely inside a JSX attribute string. `root` is the real path of
139
+ * the design root (as Bun reports file paths; macOS `/tmp` is `/private/tmp`).
140
+ */
141
+ export function importedModuleScope(file: string, root: string): string | null {
142
+ const rel = path.relative(root, file);
143
+ if (!rel || rel.startsWith('..') || path.isAbsolute(rel)) return null;
144
+ const parts = rel.split(path.sep);
145
+ const first = parts[0] as string;
146
+ if (first === 'system' || first.startsWith('_') || first.startsWith('.')) return null;
147
+ if (parts.includes('node_modules')) return null;
148
+ const scope = parts.join('/');
149
+ return SAFE_SCOPE_RE.test(scope) ? scope : null;
150
+ }
151
+ const SAFE_SCOPE_RE = /^[\p{L}\p{N}_@.+()[\] -]+(?:\/[\p{L}\p{N}_@.+()[\] -]+)*$/u;
152
+
153
+ /**
154
+ * Every `data-cd-id` the elements of an imported module carry once stamped (computed and authored), under
155
+ * `scope`. The server's side of `stampImportedModule`: the same walk, so the same ids, without the bytes.
156
+ * Empty when the source does not parse.
157
+ */
158
+ export function importedModuleIds(
159
+ moduleAbsPath: string,
160
+ source: string,
161
+ scope: string
162
+ ): Set<string> {
163
+ const ids = new Set<string>();
164
+ if (hasMacroImport(source)) return ids;
165
+ let parsed: ReturnType<typeof parseSync>;
166
+ try {
167
+ parsed = parseSync(moduleAbsPath, source, { sourceType: 'module' });
168
+ } catch {
169
+ return ids;
170
+ }
171
+ if (parsed.errors && parsed.errors.length > 0) return ids;
172
+ walkInjectIds(
173
+ parsed.program,
174
+ source,
175
+ moduleAbsPath,
176
+ new MagicString(source),
177
+ {},
178
+ {
179
+ idScope: scope,
180
+ ids,
181
+ }
182
+ );
183
+ return ids;
184
+ }
185
+
98
186
  export class TranspileError extends Error {
99
187
  readonly canvas: string;
100
188
  readonly byte: number;
@@ -255,7 +343,10 @@ function walkInjectIds(
255
343
  source: string,
256
344
  canvasAbsPath: string,
257
345
  s: MagicString,
258
- locator: LocatorMap
346
+ locator: LocatorMap,
347
+ // Set for an IMPORTED module (stampImportedModule): ids scoped to it, no inline-edit marker, and
348
+ // every element marked `data-cd-module`. `ids` (optional) collects every id the module's elements carry.
349
+ imported?: { idScope: string; ids?: Set<string> }
259
350
  ): void {
260
351
  // Stack of enclosing components. JSX outside any component (e.g. a top-level
261
352
  // `const x = <div/>;` constant) attributes to "" -- still gets an ID, just
@@ -296,7 +387,10 @@ function walkInjectIds(
296
387
  };
297
388
  };
298
389
  if (!hasJsxAttr(opening, 'data-cd-id')) {
299
- const id = computeId(frame.componentName, idx);
390
+ const id = computeId(
391
+ imported ? `${imported.idScope}\0${frame.componentName}` : frame.componentName,
392
+ idx
393
+ );
300
394
  // Insert " data-cd-id=\"<id>\"" right after the tag name. magic-string's
301
395
  // appendLeft puts the new text before any subsequent attribute. JSX
302
396
  // attribute order is irrelevant at runtime; visually the new attr lands
@@ -304,14 +398,26 @@ function walkInjectIds(
304
398
  const insertAt: number | undefined = opening?.name?.end;
305
399
  if (typeof insertAt === 'number') {
306
400
  s.appendLeft(insertAt, ` data-cd-id="${id}"`);
307
- locator[id] = locate();
401
+ if (!imported) locator[id] = locate();
402
+ imported?.ids?.add(id);
308
403
  }
309
404
  } else {
310
405
  // V2-2.19 (contract V2-1.4 §5.2): an AUTHORED id is the stable identity, so it
311
406
  // gets a locator entry too (the first element wins on a duplicate — the id
312
407
  // check reports the duplicate itself).
313
408
  const authored = authoredIdLiteral(opening);
314
- if (authored && !locator[authored]) locator[authored] = locate();
409
+ if (authored && !imported && !locator[authored]) locator[authored] = locate();
410
+ if (authored) imported?.ids?.add(authored);
411
+ }
412
+
413
+ // #151 T2.3b — an element of an imported module is edit-READ-ONLY (the edit engine reads only the
414
+ // canvas file). The marker is the module's design-root-relative path: the inspector and the canvas
415
+ // read it from the DOM and name the file; ids stay 8 hex, so the server finds the file by walking
416
+ // the canvas's imports (imported-module-ids.ts), never from the id.
417
+ if (imported && !hasJsxAttr(opening, 'data-cd-module')) {
418
+ const insertAt: number | undefined = opening?.name?.end;
419
+ if (typeof insertAt === 'number')
420
+ s.appendLeft(insertAt, ` data-cd-module="${imported.idScope}"`);
315
421
  }
316
422
 
317
423
  // Phase 6 (unified-text-editing) — build-time editability marker, so
@@ -321,7 +427,7 @@ function walkInjectIds(
321
427
  // source string at commit (canvas-edit.ts). Independent of the id
322
428
  // injection above: hand-authored data-cd-id elements still get it.
323
429
  const editKind = inlineEditableKind(node);
324
- if (editKind && !hasJsxAttr(opening, 'data-cd-editable')) {
430
+ if (editKind && !imported && !hasJsxAttr(opening, 'data-cd-editable')) {
325
431
  const insertAt: number | undefined = opening?.name?.end;
326
432
  if (typeof insertAt === 'number') {
327
433
  s.appendLeft(insertAt, ` data-cd-editable="${editKind}"`);
@@ -117,6 +117,7 @@ import {
117
117
  } from './editing/reorder-slot.tsx';
118
118
  import { isLockedDom, lockedClickSelection, stepOut } from './editing/selection.tsx';
119
119
  import { commitTextInPlace, lockedTextLine, textOpDeps } from './editing/text-actions.ts';
120
+ import { textEditKey } from './editing/text-in-place.tsx';
120
121
  import { worldMenuSections } from './editing/world-menu.ts';
121
122
  import { EqualSpacingHandles } from './equal-spacing-handles.tsx';
122
123
  import { frameCaf, frameRaf } from './frame-clock.ts';
@@ -3349,7 +3350,7 @@ function CanvasRouter({
3349
3350
  // nodes) to edit its copy in place. Commit (blur / Enter) posts `dgn:edit-text`
3350
3351
  // to the shell, which calls the main-origin /_api/edit-text → editText writes
3351
3352
  // the escaped JSXText to source; the file-watcher HMR reload re-renders from
3352
- // the persisted source. Esc restores the original. Mixed/expression elements
3353
+ // the persisted source. Esc keeps the typed words too (#163, `textEditKey`). Mixed/expression elements
3353
3354
  // are skipped (the engine would refuse them anyway — honest no-op).
3354
3355
  useEffect(() => {
3355
3356
  if (typeof document === 'undefined') return;
@@ -3357,9 +3358,6 @@ function CanvasRouter({
3357
3358
  if (!host) return;
3358
3359
  let editing: HTMLElement | null = null;
3359
3360
  let original = '';
3360
- // r2-text-tool — a text the Text tool has just made: esc keeps what was typed (there is nothing of yours to
3361
- // restore; restoring would put back the placeholder "Text"). Any other text: esc restores, as before.
3362
- let escKeeps = false;
3363
3361
  // Unified custom blinking caret (text-caret.ts) — mounted for the whole
3364
3362
  // edit session, disposed in teardown. Hides the native caret while up.
3365
3363
  let caretDispose: (() => void) | null = null;
@@ -3370,10 +3368,12 @@ function CanvasRouter({
3370
3368
  let lastTextCommit: { el: HTMLElement; original: string } | null = null;
3371
3369
  const onBlur = (): void => commitEdit(true);
3372
3370
  const onKey = (e: KeyboardEvent): void => {
3373
- if (e.key === 'Escape') {
3371
+ // #163 — Esc keeps the typed words for every text, as Figma does; Undo is the way back.
3372
+ const act = textEditKey(e);
3373
+ if (act === 'commit') {
3374
3374
  e.preventDefault();
3375
- commitEdit(escKeeps);
3376
- } else if (e.key === 'Enter' && !e.shiftKey) {
3375
+ commitEdit(true);
3376
+ } else if (act === 'blur') {
3377
3377
  e.preventDefault();
3378
3378
  (e.currentTarget as HTMLElement | null)?.blur?.();
3379
3379
  }
@@ -3477,7 +3477,7 @@ function CanvasRouter({
3477
3477
  stamped: HTMLElement,
3478
3478
  clientX: number,
3479
3479
  clientY: number,
3480
- opts?: { selectAll?: boolean; escKeeps?: boolean }
3480
+ opts?: { selectAll?: boolean }
3481
3481
  ): void {
3482
3482
  if (editing) return;
3483
3483
  // Cloud Phase 25 C2 — inline text edit is a source write; a read-only
@@ -3493,7 +3493,6 @@ function CanvasRouter({
3493
3493
  }
3494
3494
  editing = stamped;
3495
3495
  original = stamped.textContent ?? '';
3496
- escKeeps = opts?.escKeeps === true;
3497
3496
  stamped.setAttribute('contenteditable', 'plaintext-only');
3498
3497
  stamped.classList.add('dc-text-editing');
3499
3498
  stamped.addEventListener('blur', onBlur, true);
@@ -3598,14 +3597,12 @@ function CanvasRouter({
3598
3597
  clientX?: number;
3599
3598
  clientY?: number;
3600
3599
  selectAll?: boolean;
3601
- escKeeps?: boolean;
3602
3600
  }>
3603
3601
  ).detail;
3604
3602
  if (!detail?.el || !host.contains(detail.el)) return;
3605
3603
  // V2-8.7 — ↵ on a selected text arrives with selectAll (the keyboard door has no caret point)
3606
3604
  enterEditModeAt(detail.el, detail.clientX ?? 0, detail.clientY ?? 0, {
3607
3605
  selectAll: detail.selectAll === true,
3608
- escKeeps: detail.escKeeps === true,
3609
3606
  });
3610
3607
  };
3611
3608
  // The shell rejected the last inline text edit — revert the optimistic
@@ -96,10 +96,12 @@ export function CanvasThemePill({
96
96
  return () => clearTimeout(t);
97
97
  }, [copied]);
98
98
  const file = canvasFilePath();
99
- const copyPath = async () => {
99
+ // #168 F5 — the pill only asks: `__canvas_meta_file__` is a global any canvas code can overwrite, so the shell
100
+ // copies the path it holds for this (active) frame and says so itself if the copy fails
101
+ const copyPath = () => {
100
102
  if (!file) return;
101
103
  try {
102
- await navigator.clipboard.writeText(file);
104
+ window.parent.postMessage({ dgn: 'copy-canvas-path' }, '*');
103
105
  setCopied('ok');
104
106
  } catch {
105
107
  setCopied('failed');
@@ -133,7 +135,7 @@ export function CanvasThemePill({
133
135
  title={`Copy relative path — ${file}`}
134
136
  aria-label={`Copy relative path ${file}`}
135
137
  aria-live="polite"
136
- onClick={() => void copyPath()}
138
+ onClick={copyPath}
137
139
  >
138
140
  {copied === 'ok'
139
141
  ? 'Copied'
@@ -287,7 +287,8 @@ function checkCanvasTsx(rel: string, text: string, opts: CheckOptions, r: CheckR
287
287
  }
288
288
  // S7.5 — the comp vocabulary's rules (V2-1.10 §5.7): one <Captions>, <Duck> wraps one <Audio>,
289
289
  // <Reframe> keys sorted / in range / no follow, `fixes` a JSON literal, no derived props.
290
- for (const f of videoVocabFindings(rel, text, parsed.program)) r.errors.push(f);
290
+ for (const { severity, ...f } of videoVocabFindings(rel, text, parsed.program))
291
+ (severity === 'warning' ? r.warnings : r.errors).push(f);
291
292
  const ids = checkIdsAdapter(text, {
292
293
  against: opts.against ?? undefined,
293
294
  path: rel,
@@ -307,7 +308,13 @@ function checkCanvasTsx(rel: string, text: string, opts: CheckOptions, r: CheckR
307
308
  if (f.element) out.element = f.element;
308
309
  // p8-secfix-hook I1 — identity only: a digest of the id attribute's source, as an artboard
309
310
  // finding has, so a fixed old mapped id and a new different one never cancel out
310
- if (f.span) out.key = sourceKey(text.slice(f.span.start, f.span.end));
311
+ // #168 E2 — and of the element it sits on (artboard, tag, label), so fixing one id while
312
+ // pasting the identical source onto another element or artboard never cancels out
313
+ if (f.span) {
314
+ const el = f.element;
315
+ const where = el ? `\u0000${el.artboard ?? ''}\u0000${el.tag}\u0000${el.label}` : '';
316
+ out.key = sourceKey(`${text.slice(f.span.start, f.span.end)}${where}`);
317
+ }
311
318
  (f.severity === 'error' ? r.errors : f.severity === 'warning' ? r.warnings : r.infos).push(out);
312
319
  }
313
320
  }
@@ -450,8 +457,8 @@ export function checkFile(rel: string, text: string, opts: CheckOptions = {}): C
450
457
  `${rel} › ${fileText(e.split(':')[0])}`,
451
458
  cleanText(e, 200),
452
459
  kind === 'edl'
453
- ? 'write the EDL in the documented shape (apps/studio/schema/edl.v1.schema.json, skill design:footage-director)'
454
- : 'write the analysis in the documented shape (skill design:footage-director)'
460
+ ? 'write the EDL in the documented shape (apps/studio/schema/edl.v1.schema.json, skill design-video:footage-director)'
461
+ : 'write the analysis in the documented shape (skill design-video:footage-director)'
455
462
  )
456
463
  );
457
464
  } else if (kind === 'gen' && opts.strict) {
@@ -476,7 +483,7 @@ export function checkFile(rel: string, text: string, opts: CheckOptions = {}): C
476
483
  kind,
477
484
  `${rel} › ${fileText(e.split(':')[0])}`,
478
485
  cleanText(e, 200),
479
- `write the ${kind} in the documented shape (apps/studio/schema/${kind}.v1.schema.json, skill design:video-comp)`
486
+ `write the ${kind} in the documented shape (apps/studio/schema/${kind}.v1.schema.json, skill design-video:video-comp)`
480
487
  )
481
488
  );
482
489
  } else if (kind === 'ds-managed')
@@ -10,10 +10,12 @@
10
10
  // video-title-motion <TitleMotion preset frames>: preset is one of the six, frames a whole number (S7.10)
11
11
  // video-captions-fixes `fixes` is a JSON literal of { src, at, text }
12
12
  // video-derived-prop `__words` / `__speech` are the build's — never in the file
13
+ // video-object-fit-style (warning) <Video style={{ objectFit }}>: write the objectFit PROP (#128 §3)
13
14
  //
14
15
  // Only components imported from `@maude/canvas-lib` are judged (aliases followed): a comp's own
15
16
  // local `Captions` (today's CUES pattern) is the author's business.
16
17
 
18
+ import { objectFitSites } from '../video/object-fit.ts';
17
19
  import { isTitleMotion } from '../video/title-motion.ts';
18
20
 
19
21
  // biome-ignore lint/suspicious/noExplicitAny: oxc's ESTree nodes are walked structurally
@@ -25,6 +27,8 @@ export interface VideoFinding {
25
27
  what: string;
26
28
  fix: string;
27
29
  line: number;
30
+ /** absent = an error; the build already copes with a warning's pattern, so it never blocks a write */
31
+ severity?: 'warning';
28
32
  }
29
33
 
30
34
  const LIB = '@maude/canvas-lib';
@@ -178,9 +182,21 @@ function compSpans(program: Node): Array<{ name: string; start: number; end: num
178
182
  }
179
183
 
180
184
  export function videoVocabFindings(rel: string, text: string, program: Node): VideoFinding[] {
181
- const names = imports(program);
182
- if (names.size === 0) return [];
183
185
  const out: VideoFinding[] = [];
186
+ // #128 §3 — judged on @remotion/media's <Video>, whether or not the canvas uses the vocabulary
187
+ for (const site of objectFitSites(program, text)) {
188
+ const line = lineAt(text, site.el.start as number);
189
+ out.push({
190
+ code: 'video-object-fit-style',
191
+ where: `${rel}:${line}`,
192
+ what: '<Video> reads the objectFit prop, so objectFit in its style does nothing there (the clip stays letterboxed)',
193
+ fix: 'write objectFit="cover" (or "contain" / "fill") as a prop on <Video>, not inside style',
194
+ line,
195
+ severity: 'warning',
196
+ });
197
+ }
198
+ const names = imports(program);
199
+ if (names.size === 0) return out;
184
200
  const push = (code: string, at: number, what: string, fix: string) => {
185
201
  const line = lineAt(text, at);
186
202
  out.push({ code, where: `${rel}:${line}`, what, fix, line });
@@ -3,6 +3,10 @@
3
3
  // Renders: file tree, tabs, viewport (iframes), status bar, design-system view, comments.
4
4
  // Universal — no project tokens needed; styling lives in client/styles/.
5
5
 
6
+ // sec-loopback-bearer §7.4 — FIRST: a desktop project tab opens its session with its server before
7
+ // any other module can send a request (side effect; a no-op elsewhere).
8
+ import './v2/shell/api-session-boot.js';
9
+ import { apiSessionReady } from './v2/shell/api-session.js';
6
10
  import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
11
  import { createPortal } from 'react-dom';
8
12
  import { createRoot } from 'react-dom/client';
@@ -234,7 +238,9 @@ import { CornerIcons } from './v2/shell/corner-icons.jsx';
234
238
  import ShellErrorBoundary from './v2/shell/shell-error-boundary.jsx';
235
239
  import { expectServedFrom, setServedFrom } from './v2/shell/served-routes.js';
236
240
  import { cutCopyPaste, createMenuHandlers, menuRunner } from './v2/shell/menu-runner.js';
241
+ import { openAccountMenu } from './v2/shell/project-account-bus.js';
237
242
  import DiagnosticsHost from './v2/diagnostics/diagnostics-host.jsx';
243
+ import LinkServerHost from './v2/link-server/LinkServerHost.jsx';
238
244
  import { useDiagnosticsMenu } from './v2/diagnostics/use-diagnostics-menu.js';
239
245
  import { menuCtx, moveDestinations } from './v2/shell/project-menu-model.js';
240
246
  import { usePagesView } from './v2/shell/use-canvas-mode-lane.js';
@@ -835,6 +841,28 @@ function ShellState({ children }) {
835
841
  );
836
842
  } catch {}
837
843
  }
844
+ } else if (m.type === 'generate:approval' && m.payload) {
845
+ // A paid generation above the person's confirm amount waits for them (generation/spend.ts).
846
+ const ask = m.payload;
847
+ shellToast(
848
+ `AI needs your OK to make ${ask.summary} for about $${Number(ask.estimate).toFixed(2)}.`,
849
+ true,
850
+ {
851
+ label: 'Approve',
852
+ onClick: () => {
853
+ fetch('/_api/generate-jobs', {
854
+ method: 'POST',
855
+ headers: { 'content-type': 'application/json' },
856
+ body: JSON.stringify({ approve: ask.id }),
857
+ })
858
+ .then((r) => {
859
+ if (!r.ok) throw new Error('expired');
860
+ shellToast('Approved. Ask AI to try again.', true);
861
+ })
862
+ .catch(() => shellToast('That approval expired. Ask AI to try again.'));
863
+ },
864
+ }
865
+ );
838
866
  } else if (m.type === 'export:job' && m.payload) {
839
867
  // feature-background-export-notification-center — full-snapshot
840
868
  // job state on every queued/running/progress/done/failed change.
@@ -1679,8 +1707,10 @@ function ShellProjectPill() {
1679
1707
  showHidden,
1680
1708
  layersMode,
1681
1709
  setLayersMode,
1710
+ layersOpen,
1682
1711
  setLayersOpen,
1683
1712
  assetsOpen,
1713
+ assistantOpen,
1684
1714
  startTour,
1685
1715
  toggleRightPanel,
1686
1716
  toggleTimeline,
@@ -1731,6 +1761,8 @@ function ShellProjectPill() {
1731
1761
  postToActiveCanvas,
1732
1762
  openPanelExclusive,
1733
1763
  toggleRightPanel,
1764
+ // #170 R25 — View › Layers opens the Inspector when Layers lives inside it
1765
+ layersMode,
1734
1766
  setExportDialog,
1735
1767
  setGenerateOpen,
1736
1768
  setSettingsOpen,
@@ -1743,7 +1775,7 @@ function ShellProjectPill() {
1743
1775
  onQuickSetup: () => setQuickSetupOpen(true),
1744
1776
  onIntro: () => setIntroOpen(true),
1745
1777
  onWhatsNew: whatsNew.openPanel,
1746
- onShare: () => showShare(),
1778
+ onShare: (opts) => showShare(undefined, opts),
1747
1779
  onReload: reloadActive,
1748
1780
  onCloseCanvas: () => activePath && closeTab(activePath),
1749
1781
  onAssembleVideo: assembleVideo,
@@ -1800,11 +1832,19 @@ function ShellProjectPill() {
1800
1832
  form.submit();
1801
1833
  return;
1802
1834
  }
1835
+ // 2.1.1 T4 — the desktop: the avatar menu's Switch account list (accounts already on this Mac,
1836
+ // "No account — this Mac only"). It never moves the project to a fresh, empty account.
1837
+ openAccountMenu('switch');
1838
+ },
1839
+ // 2.1.1 T4 — "Add a Maude Cloud account…": V2-3.8's prepare (a profile already signed in to Maude
1840
+ // Cloud is never re-signed: the project moves to a profile of its own and reloads), then the cloud
1841
+ // sign-in where it lives, Settings › Connections.
1842
+ onAddCloudAccount: () => {
1803
1843
  cloudSignInPrepare().then(
1804
1844
  (moved) => {
1805
- if (!moved) shellToast('Sign in from the Share panel to use another account.');
1845
+ if (!moved) setSettingsOpen('connections');
1806
1846
  },
1807
- (e) => shellToast(String(e?.message || e || 'Could not switch accounts.'))
1847
+ (e) => shellToast(String(e?.message || e || 'Could not add an account.'))
1808
1848
  );
1809
1849
  },
1810
1850
  onCutPaste: (kind) => cutCopyPaste(kind, openerRef.current, { postToActiveCanvas }),
@@ -1876,7 +1916,7 @@ function ShellProjectPill() {
1876
1916
  window.removeEventListener(OPEN_ASSETS_EVENT, onAttachAssets);
1877
1917
  };
1878
1918
  }, [openRightPanel, openTab, cfg?.designRel]);
1879
- // S1.22c: the native tab menu's "Sign in as another account…" arrives as `menu://action
1919
+ // S1.22c: the native tab menu's "Switch account…" arrives as `menu://action
1880
1920
  // {id:'account.switch'}` (tabs.rs TabMenuItem::SwitchAccount); it is not a palette row, so the
1881
1921
  // palette's menu://action listener never runs it — the menu handler does.
1882
1922
  useEffect(() => {
@@ -1961,6 +2001,9 @@ function ShellProjectPill() {
1961
2001
  'view.inspector-on-select': autoOpenInspector,
1962
2002
  'view.timeline-keep-open': timelineKept,
1963
2003
  'view.inspector': inspectorOpen,
2004
+ // #170 R25 — the View rows for Layers (where it lives) and the AI chat
2005
+ 'view.layers': layersMode === 'in-inspector' ? inspectorOpen : layersOpen,
2006
+ 'ai.chat': assistantOpen,
1964
2007
  'view.comments': commentsPanelOpen,
1965
2008
  'view.exports': exportCenter.panelOpen,
1966
2009
  'history.open': changesOpen,
@@ -1982,6 +2025,8 @@ function ShellProjectPill() {
1982
2025
  printGuidesVisible,
1983
2026
  showHidden,
1984
2027
  layersMode,
2028
+ layersOpen,
2029
+ assistantOpen,
1985
2030
  assetsOpen,
1986
2031
  autoOpenInspector,
1987
2032
  timelineKept,
@@ -2602,9 +2647,18 @@ function ShellTimelinePanel() {
2602
2647
  headers: { 'content-type': 'application/json' },
2603
2648
  body: JSON.stringify({ provider: 'gemini', modality, prompt }),
2604
2649
  })
2605
- .then(async (r) => (r.ok ? r.json() : Promise.reject(new Error(await r.text()))))
2650
+ .then(async (r) => {
2651
+ if (r.ok) return r.json();
2652
+ // a spend limit or a job waiting for the person's OK answers with a message to show as it is
2653
+ const text = await r.text();
2654
+ let msg = text;
2655
+ try {
2656
+ msg = JSON.parse(text).message || text;
2657
+ } catch {}
2658
+ return Promise.reject(new Error(msg));
2659
+ })
2606
2660
  .then((job) => {
2607
- const jobId = job?.id;
2661
+ const jobId = job?.jobId ?? job?.id;
2608
2662
  if (!jobId) throw new Error('no job id');
2609
2663
  shellToast(`Generating ${ph.kind}… (runs in the background)`, true);
2610
2664
  const stableId = clip.stableId;
@@ -3173,6 +3227,8 @@ function ShellTree() {
3173
3227
  <ShellProjectPill />
3174
3228
  {/* V2-4.7b — Menu › Diagnostics: Logs · Server · AI setup · Sync (today's Sync panel, whole). */}
3175
3229
  <DiagnosticsHost toast={shellToast} />
3230
+ {/* 2.1.1 T5 — `account.link-server`: the one "Link your server" dialog (avatar, Settings, Sync). */}
3231
+ <LinkServerHost />
3176
3232
  {/* V2-4.3a — the Share cluster, top-right: faces, status word, comments, Exports, Hide panels, Share. */}
3177
3233
  <ShellShareCluster />
3178
3234
  {/* S2.20 — Menu › Edit › Undo history… (the ⌘Z projection's popover). */}
@@ -3618,7 +3674,9 @@ else {
3618
3674
  // #204 R — the shell's pollers mount before `/_config` answers; they wait for it (bounded) so a
3619
3675
  // workspace cell is never asked a route it withholds on the way up. Home is no cell: it says so at once.
3620
3676
  expectServedFrom();
3621
- const migrated = migrateAtBoot().catch(() => {});
3677
+ // sec-loopback-bearer §7.4 — a desktop project tab renders once its session with its server is
3678
+ // open, so the sockets its effects open carry the cookie (resolves at once anywhere else).
3679
+ const migrated = apiSessionReady().then(() => migrateAtBoot().catch(() => {}));
3622
3680
  Promise.race([migrated, new Promise((r) => setTimeout(r, 1500))]).then(() =>
3623
3681
  bootShellMode((mode) => {
3624
3682
  if (mode === 'home') setServedFrom(null);