@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
@@ -293,6 +293,13 @@
293
293
  flex-basis var(--dur-panel) var(--ease-in-out);
294
294
  overflow: hidden;
295
295
  }
296
+ /* #170 F35: an overflow:hidden box is still a scroll container, and the New-folder tooltip (data-tip) lays out
297
+ 16 px past the edge — a script or a focus scroll shifted the whole panel 8 px left. Clip it like the shell root. */
298
+ @supports (overflow: clip) {
299
+ .sh-sidebar {
300
+ overflow: clip;
301
+ }
302
+ }
296
303
 
297
304
  .sh-sidebar.is-collapsed {
298
305
  width: 0;
@@ -2633,7 +2640,20 @@
2633
2640
  flex-direction: column;
2634
2641
  overflow: hidden;
2635
2642
  pointer-events: auto;
2636
- animation: sh-island-in var(--dur-panel) var(--ease-out);
2643
+ /* #170 R29: an island that comes back grows out of its corner icon — the fold (sh-island-fold) reversed */
2644
+ animation: sh-island-grow var(--dur-panel) var(--ease-out);
2645
+ }
2646
+ .sh-body--float > .sh-dockslot--left > .sh-dockslot-inner {
2647
+ transform-origin: top left;
2648
+ }
2649
+ .sh-body--float > .sh-dockslot--right > .sh-dockslot-inner {
2650
+ transform-origin: top right;
2651
+ }
2652
+ .sh-body--float > .sh-dockslot--left > .sh-dockslot-ai {
2653
+ transform-origin: bottom left;
2654
+ }
2655
+ .sh-body--float > .sh-dockslot--right > .sh-dockslot-ai {
2656
+ transform-origin: bottom right;
2637
2657
  }
2638
2658
  .sh-body--float .sh-dockslot-inner > .sh-sidebar,
2639
2659
  .sh-body--float .sh-dockslot-inner > .sh-rpanel {
@@ -2872,6 +2892,16 @@
2872
2892
  transform: scale(0.12);
2873
2893
  }
2874
2894
  }
2895
+ @keyframes sh-island-grow {
2896
+ from {
2897
+ opacity: 0;
2898
+ transform: scale(0.12);
2899
+ }
2900
+ to {
2901
+ opacity: 1;
2902
+ transform: none;
2903
+ }
2904
+ }
2875
2905
  @keyframes sh-island-in {
2876
2906
  from {
2877
2907
  opacity: 0;
@@ -11,17 +11,26 @@
11
11
  // person gets the platform's dialog: the native one in the app (`pickMediaFiles`, as Add files… does — it needs no
12
12
  // page activation), the input's own in a browser.
13
13
  //
14
+ // #168 F1 — the canvas decides when it asks, so it never opens the dialog itself: an ask (`ask(canvas)`) shows the
15
+ // shell's own chip, "Choose a picture for <canvas>" + Choose…, and only a click on that chip opens the dialog. Two
16
+ // cancelled dialogs in a row and the shell stops offering the chip for PICK_BACKOFF_MS; a placed picture resets it.
17
+ //
14
18
  // The pure half (`placeFiles`) takes everything it touches as a function so a test drives it.
15
19
 
16
20
  import { uploadAsset } from '../../../asset-upload.ts';
17
21
  import { isVideoFile, isVideoName, videoNaturalOf } from '../../../video-natural.ts';
18
22
  import { isNativeApp, pickedMediaSource, pickMediaFiles } from '../../github.js';
19
- import { shellToast } from '../../shell/util.js';
23
+ import { notifyCanvasTriggered } from '../../../notifications.tsx';
24
+ import { basename, displayName, shellToast } from '../../shell/util.js';
20
25
 
21
26
  export const IMAGE_INPUT_TESTID = 'image-tool-input';
22
27
  export const NOT_A_PICTURE_LINE =
23
28
  'That is not a picture or a video. Pick a PNG, JPEG, GIF, WebP, SVG or HEIC picture, or an MP4, MOV, M4V or WebM video.';
24
29
  export const NOT_ADDED_LINE = 'That picture or video couldn’t be added, so nothing was placed.';
30
+ /** #168 F1: the one id the chip is shown under (a repeat ask replaces it) and the back-off after two cancels. */
31
+ export const PICK_CHIP_ID = 'canvas-image-pick';
32
+ export const PICK_BACKOFF_MS = 60_000;
33
+ const CANCELS_BEFORE_BACKOFF = 2;
25
34
 
26
35
  const IMAGE_NAME = /\.(avif|gif|heic|heif|jpe?g|png|svg|tiff?|webp)$/i;
27
36
  // r3 (Michal: "nemůžu vkládat videa"): a video (mp4 · mov · m4v · webm) is placed like a picture. Sound stays out — there is
@@ -60,14 +69,30 @@ const mimeOf = (name) => {
60
69
  * @param deps.videoNatural (file) => Promise<{w,h} | null> — a video's size, fitted (default: read from its metadata)
61
70
  * @param deps.toast (line) => void
62
71
  * @param deps.activePath () => string | null — the canvas a file handed to the input (no dialog) is placed on
72
+ * @param deps.notify (notice) => string | null — the chip (default `notifyCanvasTriggered`: one id, rate-limited)
73
+ * @param deps.nameOf (path) => string — the canvas name the chip says
74
+ * @param deps.now () => number — ms clock (the back-off)
75
+ * @param deps.isNative / deps.pickNative / deps.nativeSource — the app's own dialog (default: github.js)
63
76
  */
64
77
  export function createImagePick(deps) {
65
78
  const upload = deps.upload ?? ((f) => uploadAsset(f, { name: f.name }));
66
79
  const natural = deps.natural ?? naturalSizeOf;
67
80
  const videoNatural = deps.videoNatural ?? videoNaturalOf;
68
81
  const toast = deps.toast ?? ((line) => shellToast(line, false));
82
+ const notify = deps.notify ?? notifyCanvasTriggered;
83
+ const nameOf = deps.nameOf ?? ((p) => displayName(basename(p)));
84
+ const now = deps.now ?? (() => Date.now());
85
+ const isNative = deps.isNative ?? isNativeApp;
86
+ const pickNative = deps.pickNative ?? pickMediaFiles;
87
+ const nativeSource = deps.nativeSource ?? pickedMediaSource;
69
88
  let input = null;
70
89
  let forCanvas = null;
90
+ let cancels = 0;
91
+ let lastCancel = -Infinity;
92
+ const cancelled = () => {
93
+ cancels++;
94
+ lastCancel = now();
95
+ };
71
96
 
72
97
  /** The pick for `canvas`: the first picture or video of `files` into Assets, then `place-image` to that canvas. */
73
98
  async function placeFiles(canvas, files) {
@@ -87,6 +112,7 @@ export function createImagePick(deps) {
87
112
  return;
88
113
  }
89
114
  const size = await (isVideo(f) ? videoNatural(f) : natural(f));
115
+ cancels = 0;
90
116
  deps.post(canvas, { dgn: 'place-image', asset: r.path, natural: size, label: f.name });
91
117
  }
92
118
 
@@ -109,22 +135,32 @@ export function createImagePick(deps) {
109
135
  input.value = '';
110
136
  if (canvas) void placeFiles(canvas, files);
111
137
  });
138
+ // the browser's own dialog closed with nothing picked
139
+ input.addEventListener('cancel', () => {
140
+ forCanvas = null;
141
+ cancelled();
142
+ });
112
143
  doc.body.appendChild(input);
113
144
  return input;
114
145
  }
115
146
 
116
- /** Image (I) for `canvas`: the platform's dialog now. */
147
+ /** The platform's dialog for `canvas` — only ever from the chip's click (a person in the shell), never a canvas. */
117
148
  async function open(canvas) {
118
149
  forCanvas = canvas;
119
- if (isNativeApp()) {
120
- const picked = await pickMediaFiles();
121
- const first = (picked || []).find((p) => IMAGE_NAME.test(p.name) || isVideoName(p.name));
150
+ if (isNative()) {
151
+ const picked = await pickNative();
152
+ if (!picked?.length) {
153
+ forCanvas = null;
154
+ cancelled();
155
+ return;
156
+ }
157
+ const first = picked.find((p) => IMAGE_NAME.test(p.name) || isVideoName(p.name));
122
158
  if (!first) {
123
- if (picked?.length) toast(NOT_A_PICTURE_LINE);
159
+ toast(NOT_A_PICTURE_LINE);
124
160
  return;
125
161
  }
126
162
  // a picked source is not a Blob (it reads through the app), so its size comes from the place op, not here
127
- const src = pickedMediaSource(first, mimeOf(first.name));
163
+ const src = nativeSource(first, mimeOf(first.name));
128
164
  try {
129
165
  await placeFiles(canvas, [src]);
130
166
  } finally {
@@ -136,5 +172,22 @@ export function createImagePick(deps) {
136
172
  mount(document).click();
137
173
  }
138
174
 
139
- return { placeFiles, mount, open };
175
+ /**
176
+ * Image (I) asked by `canvas`: the shell's chip, never the dialog. False when backing off (two cancels in a row,
177
+ * less than PICK_BACKOFF_MS ago) — the ask is ignored and nothing is shown.
178
+ */
179
+ function ask(canvas) {
180
+ if (cancels >= CANCELS_BEFORE_BACKOFF && now() - lastCancel < PICK_BACKOFF_MS) return false;
181
+ if (cancels >= CANCELS_BEFORE_BACKOFF) cancels = 0;
182
+ notify({
183
+ id: PICK_CHIP_ID,
184
+ title: `Choose a picture for ${nameOf(canvas)}`,
185
+ kind: 'info',
186
+ icon: 'image',
187
+ action: { label: 'Choose…', onClick: () => void open(canvas) },
188
+ });
189
+ return true;
190
+ }
191
+
192
+ return { placeFiles, mount, open, ask };
140
193
  }
@@ -0,0 +1,43 @@
1
+ // client/v2/shell/menu-aim.js — #170 F34: a submenu forgives the diagonal.
2
+ //
3
+ // Moving from File toward its open submenu crosses the rows under it (Edit, View); each row's hover used to switch the
4
+ // open submenu, so the one you were reaching for closed on the way. The rule (the "safe triangle"): while a submenu is
5
+ // open and the pointer is moving INSIDE the triangle from where it just was to the submenu's two near corners, a hover
6
+ // on another row waits a moment instead of switching. Entering the submenu, or the pointer leaving the triangle,
7
+ // settles it at once. Pure: no DOM, no timers; the menu owns those.
8
+
9
+ /** How long a hover on another row waits while the pointer is aiming at the open submenu (ms). */
10
+ export const AIM_DELAY_MS = 220;
11
+
12
+ const sign = (p, a, b) => (p.x - b.x) * (a.y - b.y) - (a.x - b.x) * (p.y - b.y);
13
+
14
+ /** Is `p` inside (or on the edge of) the triangle `a b c`? */
15
+ export function inTriangle(p, a, b, c) {
16
+ const d1 = sign(p, a, b);
17
+ const d2 = sign(p, b, c);
18
+ const d3 = sign(p, c, a);
19
+ const neg = d1 < 0 || d2 < 0 || d3 < 0;
20
+ const pos = d1 > 0 || d2 > 0 || d3 > 0;
21
+ return !(neg && pos);
22
+ }
23
+
24
+ /**
25
+ * Is the pointer heading for the open submenu?
26
+ * @param prev where the pointer was a moment ago ({x, y}), or null
27
+ * @param cur where it is now
28
+ * @param rect the open submenu's box ({left, right, top, bottom})
29
+ * @param menuRight the x of the edge of the parent menu the submenu opens from (the submenu is on its right when
30
+ * rect.left >= menuRight - 1, else on its left)
31
+ */
32
+ export function aimingAtSub(prev, cur, rect, menuRight) {
33
+ if (!prev || !cur || !rect) return false;
34
+ if (rect.right <= rect.left || rect.bottom <= rect.top) return false;
35
+ // the submenu's NEAR edge: its left edge when it opens to the right, its right edge when it flipped to the left
36
+ const onRight = rect.left >= menuRight - 1;
37
+ const x = onRight ? rect.left : rect.right;
38
+ // already past the near edge: it is in the submenu, nothing to wait for
39
+ if (onRight ? cur.x >= x : cur.x <= x) return false;
40
+ // moving away from the submenu is not aiming at it
41
+ if (onRight ? cur.x < prev.x : cur.x > prev.x) return false;
42
+ return inTriangle(cur, prev, { x, y: rect.top }, { x, y: rect.bottom });
43
+ }
@@ -27,6 +27,7 @@ import { createAccessHandlers } from '../access/access-client.js';
27
27
  import { createDiagnosticsHandlers } from '../diagnostics/diagnostics-handlers.js';
28
28
  import { runFillAsk } from '../empty/fill-ask.js';
29
29
  import { runAssetsAction } from '../assets/assets-bus.js';
30
+ import { runLinkServer } from './project-account-bus.js';
30
31
  import { runTakeStepNow } from '../assets/use-takes-lane.js';
31
32
  import { runCopyPng } from '../export/copy-png.js';
32
33
  import { foldStore } from '../fold/use-fold.js';
@@ -56,7 +57,7 @@ import { runTokenAction } from '../ds/token-write.js';
56
57
  import { runUndoKey } from '../undo/use-undo-projection.jsx';
57
58
  import { runPreviewBack } from '../preview/preview-back.js';
58
59
  import { requestShareFocus } from '../share/share-model.js';
59
- import { nativeDoors } from './native-doors.js';
60
+ import { nativeDoors, projectRel } from './native-doors.js';
60
61
  import { presentFrom, togglePresentCanvas } from './use-canvas-mode-lane.js';
61
62
  import { panelLayout } from './use-panel-layout.js';
62
63
  import { clearFollowedLoop, loopAt } from '../timeline/playhead.js';
@@ -74,6 +75,7 @@ import { timelineStore } from '../timeline/timeline-store.js';
74
75
  import { addCaptionsFromSpeech, transcriptUi } from '../transcript/captions-api.js';
75
76
  import { formatsUi } from '../inspector/formats-ui.js';
76
77
  import { otherTakesUi } from '../timeline/other-takes.jsx';
78
+ import { frameHandleUi } from '../timeline/frame-handle-model.js';
77
79
  import { reframeUi } from '../timeline/reframe-island.jsx';
78
80
  import { openHistory } from '../history/object-filter.js';
79
81
 
@@ -109,9 +111,11 @@ export const MENU_ACTION_EVENT = 'maude:menu-action';
109
111
  const noop = () => {};
110
112
 
111
113
  /** S11.9 — run a native path door on the open canvas; its refusal (Rust's words, or "browser") becomes a toast. */
112
- async function runDoor(d, id) {
113
- if (!d.activePath) return;
114
- const res = await nativeDoors().run(id, d.activePath);
114
+ async function runDoor(d, id, path) {
115
+ // #151 T2.3b — `path` (project-relative) names another file of the project: the file an imported component lives in
116
+ const rel = typeof path === 'string' && path ? path : d.activePath;
117
+ if (!rel) return;
118
+ const res = await nativeDoors().run(id, rel);
115
119
  if (res?.ok) return;
116
120
  d.toast(
117
121
  res?.reason === 'browser'
@@ -218,7 +222,10 @@ export function createMenuHandlers(d) {
218
222
  // S11.9 — the row menu's Advanced group on the OPEN canvas. The two native doors take the project-relative
219
223
  // path of the open canvas (the tab's path; Rust refuses anything else); a browser tab has no door and says so.
220
224
  'canvas.reveal-in-finder': () => runDoor(d, 'canvas.reveal-in-finder'),
221
- 'canvas.open-in-editor': () => runDoor(d, 'canvas.open-in-editor'),
225
+ 'canvas.open-in-editor': (p) => runDoor(d, 'canvas.open-in-editor', p?.path),
226
+ // #167 T5.3 — Sync details' held row: the canvas folders are config.json's canvasGroups
227
+ 'sync.open-canvas-folders': () =>
228
+ runDoor(d, 'canvas.open-in-editor', projectRel(d.designRel ?? '.design', 'config.json')),
222
229
  'canvas.copy-file-path': async () => {
223
230
  if (!d.activePath) return;
224
231
  d.toast(
@@ -274,6 +281,9 @@ export function createMenuHandlers(d) {
274
281
  'handoff.open': () => d.setExportDialog({ mode: 'handoff' }),
275
282
  'canvas.close': () => d.onCloseCanvas(),
276
283
  'account.switch': () => d.onSwitchAccount(),
284
+ // 2.1.1 T4 — the Switch account list's foot (account-menu.js)
285
+ 'account.add-cloud': () => d.onAddCloudAccount?.(),
286
+ 'account.link-server': (params) => runLinkServer(params, d),
277
287
  // 2.0.5 W4 — the GitHub device flow is the mounted host's (github-signin-host.jsx: its code sheet
278
288
  // and state); it hears this the way IdentityBar hears project.new. A browser tab has no keychain.
279
289
  'account.github-signin': () => {
@@ -349,6 +359,11 @@ export function createMenuHandlers(d) {
349
359
  'image.next-take': () => void runTakeStepNow('next'),
350
360
  'image.prev-take': () => void runTakeStepNow('prev'),
351
361
  'view.layers-panel': () => d.onToggleLayersMode(),
362
+ // #170 R25 — View › Layers: the Layers panel, or the Inspector when Layers lives inside it (the switch above)
363
+ 'view.layers': () => {
364
+ panelLayout.show();
365
+ d.toggleRightPanel(d.layersMode === 'in-inspector' ? 'inspector' : 'layers');
366
+ },
352
367
  'view.trash': () => {
353
368
  panelLayout.show();
354
369
  d.openPanelExclusive('tree');
@@ -495,6 +510,8 @@ export function createMenuHandlers(d) {
495
510
  'video.transcript.open': () => transcriptUi.toggle(),
496
511
  // S7.13 — the Re-frame island (on the selected clip) and the Video inspector's Formats rows (07 ve-reframe, ve-formats)
497
512
  'video.reframe': () => reframeUi.open(),
513
+ // #128 §5 (T3.6b) — move and zoom the selected clip's picture on the canvas; the same action leaves it
514
+ 'video.frame-handle': () => frameHandleUi.toggle(),
498
515
  // S7.15 — Other takes on the selected clip (07 ve-ai-adjust); the swap itself is the clip pipe's `video.take.swap`
499
516
  'video.take.swap': () => otherTakesUi.open(),
500
517
  'video.format.add': () => {
@@ -578,9 +595,10 @@ export function createMenuHandlers(d) {
578
595
  requestShareFocus('link');
579
596
  d.onShare();
580
597
  },
581
- 'share.move-to-cloud': () => d.onShare(),
598
+ // 2.1.1 T7 — about the project, not a canvas: the project's sheet when no canvas is open
599
+ 'share.move-to-cloud': () => d.onShare({ project: true }),
582
600
  // gate-b-sec4 — Connect lives in the Share sheet
583
- 'sync.connect-link': () => d.onShare(),
601
+ 'sync.connect-link': () => d.onShare({ project: true }),
584
602
  // S9.21 — Ask to edit (the Viewing button, ⌘K) and the owner's answer (the request block's buttons)
585
603
  ...createAccessHandlers(d),
586
604
  // `{ tab }` lands on that section ("Connect a Google key?" → connections); the sheet resolves a name it lacks
@@ -17,7 +17,24 @@ const EDGES = new Set(['top', 'right', 'bottom', 'left']);
17
17
 
18
18
  const boxOf = (el) => {
19
19
  const r = el?.getBoundingClientRect?.();
20
- return r ? { left: r.left, top: r.top, right: r.right, bottom: r.bottom } : null;
20
+ if (!r) return null;
21
+ const box = { left: r.left, top: r.top, right: r.right, bottom: r.bottom };
22
+ // #170 R29 — an island that comes back grows out of its icon (scale 0.12 → 1, floating-panels.css), and
23
+ // getBoundingClientRect reads the scaled box: measured mid-grow it covered a tenth of itself. Read the layout box
24
+ // instead — the transform's fixed point (its origin) and the untransformed size. A scale is the only transform an
25
+ // island runs; with no layout size (display: contents, a fake) the drawn box stands.
26
+ const w = el.offsetWidth;
27
+ const h = el.offsetHeight;
28
+ if (!(w > 0 && h > 0) || (Math.abs(r.width - w) < 0.5 && Math.abs(r.height - h) < 0.5))
29
+ return box;
30
+ const origin = el.ownerDocument?.defaultView?.getComputedStyle?.(el)?.transformOrigin ?? '';
31
+ const [ox, oy] = origin.split(' ').map((v) => Number.parseFloat(v));
32
+ if (!Number.isFinite(ox) || !Number.isFinite(oy)) return box;
33
+ const sx = r.width / w;
34
+ const sy = r.height / h;
35
+ const left = r.left - ox * (1 - sx);
36
+ const top = r.top - oy * (1 - sy);
37
+ return { left, top, right: left + w, bottom: top + h };
21
38
  };
22
39
 
23
40
  /**
@@ -0,0 +1,36 @@
1
+ // client/v2/shell/project-account-bus.js — 2.1.1 T2/T4: how the registry reaches the avatar menu and the
2
+ // team-server dialog without a new key handler.
3
+ //
4
+ // ACCOUNT_MENU_EVENT `account.switch` (⌘K, the tab menu) opens the avatar menu on its Switch account
5
+ // list; the Share cluster host hears it (share-cluster-host.jsx).
6
+ // LINK_SERVER_EVENT `account.link-server` — "Link your server…" / "Sign in with custom server…". The one
7
+ // team-server dialog (2.1.1 T5) hears it and calls `preventDefault()`. Nobody did → the
8
+ // row opens Settings › General › This project, where today's team-server dialog lives — a row never
9
+ // does nothing.
10
+
11
+ export const ACCOUNT_MENU_EVENT = 'maude:account-menu';
12
+ export const LINK_SERVER_EVENT = 'maude:link-server';
13
+
14
+ /** Open the avatar menu (`view`: 'menu' | 'switch'). */
15
+ export function openAccountMenu(view = 'switch') {
16
+ window.dispatchEvent(new CustomEvent(ACCOUNT_MENU_EVENT, { detail: { view } }));
17
+ }
18
+
19
+ /**
20
+ * `account.link-server`.
21
+ * @param params `{ intent?: 'link' | 'sign-in', url?: string }` — sign-in = "Sign in with custom server…"
22
+ * @param d the menu runner's deps (`setSettingsOpen`)
23
+ * @returns 'dialog' when the dialog took it, 'settings' when it fell back
24
+ */
25
+ export function runLinkServer(params, d) {
26
+ const detail = {
27
+ intent: params?.intent === 'sign-in' ? 'sign-in' : 'link',
28
+ ...(typeof params?.url === 'string' && params.url ? { url: params.url } : {}),
29
+ };
30
+ const ev = new CustomEvent(LINK_SERVER_EVENT, { detail, cancelable: true });
31
+ window.dispatchEvent(ev);
32
+ if (ev.defaultPrevented) return 'dialog';
33
+ // 2.1.1 T6: the project's link lives in General › This project (canvas 17 · 10)
34
+ d?.setSettingsOpen?.('general#this-project');
35
+ return 'settings';
36
+ }