@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
@@ -0,0 +1,237 @@
1
+ /* client/v2/shell/project-account.css — 2.1.1 T2/T4: the account chip's face + badge, the avatar menu,
2
+ Switch account and its sheet (project-account-card.jsx; canvas 17 Accounts and Connections). */
3
+ @layer components {
4
+ .sh-af {
5
+ position: relative;
6
+ flex: none;
7
+ display: inline-grid;
8
+ place-items: center;
9
+ width: 24px;
10
+ height: 24px;
11
+ }
12
+ .sh-af--sm {
13
+ width: 16px;
14
+ height: 16px;
15
+ }
16
+ .sh-af-circle--sm {
17
+ width: 16px;
18
+ height: 16px;
19
+ font-size: 9px;
20
+ }
21
+ .sh-af-tile {
22
+ display: grid;
23
+ place-items: center;
24
+ width: 100%;
25
+ height: 100%;
26
+ border-radius: var(--radius-sm, 6px);
27
+ background: var(--bg-3);
28
+ color: var(--fg-1);
29
+ }
30
+ .sh-af-tile[data-kind="server"] {
31
+ background: var(--object-green);
32
+ color: var(--object-ink);
33
+ }
34
+ /* offline: the face goes grey — the network, nothing to do */
35
+ .sh-af[data-badge="grey"] .sh-acct-face,
36
+ .sh-af[data-badge="grey"] .sh-af-tile {
37
+ background: var(--bg-3);
38
+ color: var(--fg-2);
39
+ }
40
+ .sh-af-ring {
41
+ position: absolute;
42
+ inset: -3px;
43
+ width: calc(100% + 6px);
44
+ height: calc(100% + 6px);
45
+ stroke: var(--accent);
46
+ animation: sh-af-spin 1.2s linear infinite;
47
+ }
48
+ @keyframes sh-af-spin {
49
+ to {
50
+ transform: rotate(360deg);
51
+ }
52
+ }
53
+ .sh-af-badge {
54
+ position: absolute;
55
+ right: -4px;
56
+ bottom: -4px;
57
+ display: grid;
58
+ place-items: center;
59
+ width: 13px;
60
+ height: 13px;
61
+ border-radius: var(--radius-pill, 999px);
62
+ box-shadow: 0 0 0 1.5px var(--bg-2);
63
+ color: var(--fg-on-accent, #fff);
64
+ }
65
+ .sh-af-badge--broken {
66
+ background: var(--danger, oklch(0.6 0.2 25));
67
+ }
68
+ .sh-af-badge--warn {
69
+ background: var(--warning, oklch(0.75 0.15 75));
70
+ color: var(--object-ink);
71
+ }
72
+
73
+ /* the menu */
74
+ .sh-am-pop {
75
+ width: 320px;
76
+ }
77
+ .sh-am,
78
+ .sh-am-sub {
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: 2px;
82
+ }
83
+ .sh-am-pb {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: 4px;
87
+ padding: var(--space-2, 8px);
88
+ border-radius: var(--radius-md, 8px);
89
+ }
90
+ .sh-am-pb--bad {
91
+ background: color-mix(in oklch, var(--danger, oklch(0.6 0.2 25)) 12%, var(--bg-2));
92
+ }
93
+ .sh-am-name {
94
+ font-size: var(--type-md, 15px);
95
+ color: var(--fg-0);
96
+ padding-bottom: 2px;
97
+ }
98
+ .sh-am-line {
99
+ display: flex;
100
+ align-items: flex-start;
101
+ gap: var(--space-2, 8px);
102
+ font-size: var(--type-xs, 12px);
103
+ color: var(--fg-1);
104
+ }
105
+ .sh-am-ic {
106
+ flex: none;
107
+ display: inline-grid;
108
+ place-items: center;
109
+ width: 16px;
110
+ min-height: 16px;
111
+ color: var(--fg-2);
112
+ }
113
+ .sh-am-txt {
114
+ min-width: 0;
115
+ overflow-wrap: anywhere;
116
+ }
117
+ .sh-am-q,
118
+ .sh-am-gt {
119
+ color: var(--fg-2);
120
+ }
121
+ .sh-am-gt {
122
+ padding: var(--space-1, 4px) var(--space-2, 8px) 0;
123
+ font-size: var(--type-xs, 12px);
124
+ font-weight: var(--w-medium, 500);
125
+ }
126
+ .sh-am-mono {
127
+ font-family: var(--font-mono, ui-monospace, monospace);
128
+ font-size: 11px;
129
+ }
130
+ .sh-am-dot {
131
+ width: 7px;
132
+ height: 7px;
133
+ border-radius: var(--radius-pill, 999px);
134
+ background: var(--fg-2);
135
+ }
136
+ .sh-am-dot[data-tone="ok"] {
137
+ background: var(--success, oklch(0.65 0.15 150));
138
+ }
139
+ .sh-am-dot[data-tone="busy"] {
140
+ background: var(--accent);
141
+ }
142
+ .sh-am-dot[data-tone="warn"] {
143
+ background: var(--warning, oklch(0.75 0.15 75));
144
+ }
145
+ .sh-am-dot[data-tone="error"] {
146
+ background: var(--danger, oklch(0.6 0.2 25));
147
+ }
148
+ .sh-am-status[data-tone="error"] {
149
+ color: var(--danger, oklch(0.6 0.2 25));
150
+ }
151
+ .sh-am-fix {
152
+ display: flex;
153
+ flex-direction: column;
154
+ gap: var(--space-2, 8px);
155
+ padding-top: var(--space-1, 4px);
156
+ font-size: var(--type-xs, 12px);
157
+ color: var(--fg-1);
158
+ }
159
+ .sh-am-fixt {
160
+ line-height: 1.45;
161
+ text-wrap: pretty;
162
+ }
163
+ .sh-am-fixr {
164
+ display: flex;
165
+ gap: var(--space-2, 8px);
166
+ align-items: center;
167
+ }
168
+ .sh-am-addr {
169
+ flex: 1;
170
+ min-width: 0;
171
+ display: inline-flex;
172
+ align-items: center;
173
+ gap: 6px;
174
+ height: 28px;
175
+ padding: 0 var(--space-2, 8px);
176
+ border-radius: var(--radius-md, 8px);
177
+ background: var(--bg-1);
178
+ color: var(--fg-1);
179
+ overflow: hidden;
180
+ white-space: nowrap;
181
+ text-overflow: ellipsis;
182
+ }
183
+ .sh-am-row {
184
+ gap: var(--space-2, 8px);
185
+ }
186
+ .sh-am-lab {
187
+ flex: 1;
188
+ min-width: 0;
189
+ }
190
+ .sh-am-keys {
191
+ color: var(--fg-2);
192
+ font-size: var(--type-xs, 12px);
193
+ }
194
+ .sh-am-row--two {
195
+ min-height: 40px;
196
+ }
197
+ .sh-am-two {
198
+ display: flex;
199
+ flex-direction: column;
200
+ min-width: 0;
201
+ }
202
+ .sh-am-two strong {
203
+ font-weight: var(--w-medium, 500);
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ white-space: nowrap;
207
+ }
208
+ .sh-am-two span {
209
+ font-size: var(--type-xs, 12px);
210
+ color: var(--fg-2);
211
+ }
212
+ .sh-am-back svg {
213
+ transform: rotate(90deg);
214
+ }
215
+ .sh-am-sheet {
216
+ display: flex;
217
+ flex-direction: column;
218
+ gap: var(--space-2, 8px);
219
+ padding: var(--space-3, 12px);
220
+ }
221
+ .sh-am-sheet-h {
222
+ font-size: var(--type-md, 15px);
223
+ color: var(--fg-0);
224
+ }
225
+ .sh-am-conf {
226
+ display: flex;
227
+ align-items: flex-start;
228
+ gap: var(--space-2, 8px);
229
+ font-size: var(--type-xs, 12px);
230
+ color: var(--fg-1);
231
+ }
232
+ .sh-am-conf > svg {
233
+ flex: none;
234
+ margin-top: 1px;
235
+ color: var(--fg-2);
236
+ }
237
+ }
@@ -17,6 +17,7 @@ import { Kbd, StIcon } from '../../shell/icons.jsx';
17
17
  import { SWITCHER_TRIGGER_TESTID } from '../../panels/RepoBranchSwitcher.jsx';
18
18
  import { reasonProps } from '../access/disabled-reason.js';
19
19
  import { onCanvasPointer } from './canvas-pointer.js';
20
+ import { AIM_DELAY_MS, aimingAtSub } from './menu-aim.js';
20
21
  import { buildProjectMenu } from './project-menu-model.js';
21
22
 
22
23
  const slug = (s) =>
@@ -232,6 +233,7 @@ export function ProjectPill({
232
233
  setOpen(false);
233
234
  setOpenPath([]);
234
235
  setCur(null);
236
+ clearTimeout(aim.current.timer);
235
237
  if (focusPill) btnRef.current?.focus();
236
238
  },
237
239
  [btnRef]
@@ -299,12 +301,56 @@ export function ProjectPill({
299
301
  else run(n.id);
300
302
  };
301
303
 
304
+ // #170 F34 — a submenu forgives the diagonal. The pointer's last two points (menu-aim.js); a hover on another row
305
+ // while the pointer is heading for the open submenu waits a moment instead of switching it.
306
+ const aim = useRef({ prev: null, cur: null, timer: null });
307
+ const openRef = useRef(openPath);
308
+ openRef.current = openPath;
309
+ const cancelAim = useCallback(() => {
310
+ clearTimeout(aim.current.timer);
311
+ aim.current.timer = null;
312
+ }, []);
313
+ useEffect(() => cancelAim, [cancelAim]);
314
+ const onMenuMove = (e) => {
315
+ const a = aim.current;
316
+ if (a.cur && (a.cur.x !== e.clientX || a.cur.y !== e.clientY)) a.prev = a.cur;
317
+ a.cur = { x: e.clientX, y: e.clientY };
318
+ };
319
+
302
320
  const onHover = (depth, subLabel, el) => {
303
- setOpenPath((p) => {
304
- const next = subLabel ? [...p.slice(0, depth), subLabel] : p.slice(0, depth);
305
- return next.length === p.length && next.every((x, i) => x === p[i]) ? p : next;
306
- });
307
- if (document.activeElement !== el) el.focus({ preventScroll: true });
321
+ const apply = () => {
322
+ setOpenPath((p) => {
323
+ const next = subLabel ? [...p.slice(0, depth), subLabel] : p.slice(0, depth);
324
+ return next.length === p.length && next.every((x, i) => x === p[i]) ? p : next;
325
+ });
326
+ if (document.activeElement !== el) el.focus({ preventScroll: true });
327
+ };
328
+ cancelAim();
329
+ const level = el.closest?.('[role=menu]');
330
+ const openSub = openRef.current[depth]
331
+ ? level?.querySelector(':scope > .sh-pm-li > [role=menu]')
332
+ : null;
333
+ if (openSub && openRef.current[depth] !== subLabel) {
334
+ const waiting = () =>
335
+ aimingAtSub(
336
+ aim.current.prev,
337
+ aim.current.cur,
338
+ openSub.getBoundingClientRect(),
339
+ level.getBoundingClientRect().right
340
+ );
341
+ if (waiting()) {
342
+ aim.current.timer = setTimeout(() => {
343
+ aim.current.timer = null;
344
+ // the pointer came to rest on this row (not in the submenu, not on another row): the switch it asked for
345
+ const pt = aim.current.cur;
346
+ const r = el.isConnected ? el.getBoundingClientRect() : null;
347
+ if (r && pt && pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)
348
+ apply();
349
+ }, AIM_DELAY_MS);
350
+ return;
351
+ }
352
+ }
353
+ apply();
308
354
  };
309
355
 
310
356
  const onMenuKey = (e) => {
@@ -439,7 +485,7 @@ export function ProjectPill({
439
485
  </button>
440
486
  {open ? (
441
487
  // biome-ignore lint/a11y/noStaticElementInteractions: key events bubble from the menu's rows
442
- <div ref={menuRef} className="sh-pm-root" onKeyDown={onMenuKey}>
488
+ <div ref={menuRef} className="sh-pm-root" onKeyDown={onMenuKey} onMouseMove={onMenuMove}>
443
489
  <Level
444
490
  nodes={model}
445
491
  depth={0}
@@ -33,6 +33,7 @@ import { usePresenceHost } from '../presence/use-presence-host.js';
33
33
  import { useShellStore } from '../../stores/shell-store.jsx';
34
34
  import { askToEdit } from './ask-to-edit.js';
35
35
  import { setExportPeople } from '../export/use-export-spec.js';
36
+ import { requestShareFocus } from '../share/share-model.js';
36
37
  import { menuRunner } from './menu-runner.js';
37
38
  import { ModeSwitch } from './mode-switch.jsx';
38
39
  import { menuCtx } from './project-menu-model.js';
@@ -45,8 +46,6 @@ import {
45
46
  heldConflicts,
46
47
  } from '../diagnostics/sync-details/sync-details-model.js';
47
48
  import { ShareCluster } from './share-cluster.jsx';
48
- import { AccountChip } from './account-card.jsx';
49
- import { accountCard, accountChip } from './account-card-model.js';
50
49
  import { presentFromLabel } from './present-from-label.js';
51
50
  import { copyPresentationLink, copyRowState } from '../present/copy-link.js';
52
51
  import { normalizeOpenPath } from '../../share-link.js';
@@ -62,8 +61,16 @@ import {
62
61
  import { servedFetch } from './served-routes.js';
63
62
  import { CLOUD_CHANGED_EVENT } from '../../panels/CloudBar.jsx';
64
63
  import { GitHubSignInSheet, useGitHubSignInHost } from './github-signin-host.jsx';
65
- import { ProjectAccountCard, ProjectAccountPopover } from './project-account-card.jsx';
66
- import { projectAccount } from './project-account-model.js';
64
+ import {
65
+ AccountChip,
66
+ ProjectAccountMenu,
67
+ ProjectAccountPopover,
68
+ SwitchSheet,
69
+ } from './project-account-card.jsx';
70
+ import { accountFace, accountMenu, switchList, switchSheet } from './project-account-model.js';
71
+ import { ACCOUNT_MENU_EVENT } from './project-account-bus.js';
72
+ import { useSignInToast } from './project-account-toast.js';
73
+ import { connectionState, connectionWords } from './connection-state.js';
67
74
  import { runTeamSwitch } from './team-switch.js';
68
75
 
69
76
  /** 2.0.5 W4 — the team server sign-in's recorded account (`GET /_api/connections/hub`, Settings' own read). */
@@ -89,21 +96,6 @@ function useHubAccount(enabled, url) {
89
96
  return account;
90
97
  }
91
98
 
92
- /** Settings' team-server "Sign out": POST /_api/cloud/detach — the link and its sign-in, this profile only. */
93
- async function detachHub(host) {
94
- try {
95
- const r = await fetch('/_api/cloud/detach', { method: 'POST' });
96
- const j = await r.json().catch(() => ({}));
97
- if (!r.ok || !j?.ok) throw new Error(j?.error || String(r.status));
98
- window.dispatchEvent(
99
- new CustomEvent(CLOUD_CHANGED_EVENT, { detail: { from: 'account-card' } })
100
- );
101
- shellToast(`Signed out of ${host || 'the team server'}. Your work stays on this Mac.`, true);
102
- } catch {
103
- shellToast('Could not sign out. Nothing changed — try again.');
104
- }
105
- }
106
-
107
99
  /** `{ ok, status, json }` of a same-origin JSON call (team-switch.js's `api`). */
108
100
  async function jsonFetch(path, init) {
109
101
  try {
@@ -114,6 +106,17 @@ async function jsonFetch(path, init) {
114
106
  }
115
107
  }
116
108
 
109
+ // 2.1.1 T2 — the save word beside the chip says the connection state in words (canvas 17 · ac-states):
110
+ // the two sign-in states, a server that does not answer, and this Mac offline. Its actions stay the
111
+ // status's own (the word opens Diagnostics › Sync).
112
+ const CONNECTION_WORDS = new Set(['signin-missing', 'signin-rejected', 'unreachable', 'offline']);
113
+ function withConnection(status, conn) {
114
+ if (!conn || !CONNECTION_WORDS.has(conn.state)) return status;
115
+ if (status?.kind === 'not-saved' && (status.conflict || status.detail)) return status;
116
+ const w = connectionWords(conn);
117
+ return { ...status, word: w.word, icon: w.icon, tone: w.tone, connection: conn.state };
118
+ }
119
+
117
120
  const subscribeOnline = (fn) => {
118
121
  window.addEventListener('online', fn);
119
122
  window.addEventListener('offline', fn);
@@ -300,75 +303,90 @@ export function ShellShareCluster() {
300
303
  [selected, canvasActiveArtboard, boards]
301
304
  );
302
305
 
303
- // S1.22a — the account chip (desktop): which Mac account this project tab is bound to. A cloud tab's
304
- // account is the hub's, a browser tab has none: both get no chip.
306
+ // 2.1.1 T2/T4 (canvas 17 Accounts and Connections) — the account chip: its face says the kind (a
307
+ // Maude Cloud circle, your server's tile, this Mac's laptop) with at most one badge from the
308
+ // connection state; it and your own face open THIS project's account menu. A cloud tab's account is
309
+ // the hub's (no chip); a browser tab on this Mac shows the facts and no Mac account.
305
310
  const native = isNativeApp();
306
- // 2.0.5 W4 — every non-cloud tab reads its account (a browser tab on this Mac shows the facts too)
307
311
  const acct = useAccount(!cfg?.cloud);
308
312
  const projectName = cfg?.cloud?.projectName || project;
309
- const chip = useMemo(
313
+ const gh = useGitHubSignInHost();
314
+ const [acctOpen, setAcctOpen] = useState(false);
315
+ const [acctView, setAcctView] = useState('menu');
316
+ const [pick, setPick] = useState(null); // { row, sheet } — the Switch account row being confirmed
317
+ const [using, setUsing] = useState(false);
318
+ const closeAcct = useCallback(() => {
319
+ setAcctOpen(false);
320
+ setAcctView('menu');
321
+ setPick(null);
322
+ }, []);
323
+ // the account's own read once it answered (it follows a sign-out), the shell's link until then
324
+ const linkHub = acct.linkedHub !== undefined ? acct.linkedHub : (cloudLinkedHub ?? null);
325
+ const hubAccount = useHubAccount(!cfg?.cloud && !!linkHub?.credentialed, linkHub?.url);
326
+ const conn = useMemo(
310
327
  () =>
311
- accountChip({
312
- native,
313
- cloud: !!cfg?.cloud,
314
- connected: acct.connected,
315
- profile: cfg?.profile,
316
- email: acct.email,
317
- accounts: acct.accounts,
318
- }),
319
- [native, cfg?.cloud, cfg?.profile, acct.connected, acct.email, acct.accounts]
328
+ cfg?.cloud
329
+ ? null
330
+ : connectionState({
331
+ linkedHub: linkHub,
332
+ cloudUrl: acct.cloudUrl,
333
+ syncStatus,
334
+ phase,
335
+ pending,
336
+ online,
337
+ }),
338
+ [cfg?.cloud, linkHub, acct.cloudUrl, syncStatus, phase, pending, online]
320
339
  );
321
- const card = useMemo(
340
+ const face = useMemo(
322
341
  () =>
323
- chip
324
- ? accountCard({
325
- project: projectName,
342
+ conn
343
+ ? accountFace({
344
+ conn,
326
345
  profile: cfg?.profile,
327
- email: acct.email,
328
- accounts: acct.accounts,
346
+ cloudConnected: acct.connected,
347
+ cloudEmail: acct.email,
329
348
  })
330
349
  : null,
331
- [chip, projectName, cfg?.profile, acct.email, acct.accounts]
350
+ [conn, cfg?.profile, acct.connected, acct.email]
332
351
  );
333
- // 2.0.5 W4 — the avatar (your face, or the chip) opens THIS project's account: kind, profile, hub or
334
- // cloud project, the login; Sign out on the kind's existing path, Switch through bind-on-sign-in.
335
- const gh = useGitHubSignInHost();
336
- const [acctOpen, setAcctOpen] = useState(false);
337
- const closeAcct = useCallback(() => setAcctOpen(false), []);
338
- // the account's own read once it answered (it follows a sign-out), the shell's link until then
339
- const linkHub = acct.linkedHub !== undefined ? acct.linkedHub : (cloudLinkedHub ?? null);
340
- const hubAccount = useHubAccount(!cfg?.cloud && !!linkHub?.credentialed, linkHub?.url);
341
- const projectAcct = useMemo(
352
+ const menu = useMemo(
342
353
  () =>
343
- projectAccount({
354
+ accountMenu({
344
355
  native,
345
356
  cloudTab: cfg?.cloud ?? null,
346
- profile: cfg?.profile,
347
357
  project: projectName,
348
- linkedHub: linkHub,
358
+ conn,
359
+ face,
360
+ place: acct.place,
349
361
  hubAccount,
350
- cloudUrl: acct.cloudUrl,
351
- cloudConnected: acct.connected,
352
- cloudEmail: acct.email,
353
- github: { state: gh.state, login: gh.login },
362
+ pending,
363
+ lastSyncAt: syncStatus?.lastSyncAt ?? null,
354
364
  }),
355
- [native, cfg?.cloud, cfg?.profile, projectName, linkHub, hubAccount, acct, gh.state, gh.login]
365
+ [native, cfg?.cloud, projectName, conn, face, acct.place, hubAccount, pending, syncStatus]
356
366
  );
357
- const signOutPath = useCallback(
358
- async (path) => {
359
- if (path === 'cloud-signout') return acct.signOut();
360
- if (path === 'github-signout') return gh.signOut();
361
- if (path === 'hub-detach') return detachHub(projectAcct.where);
362
- },
363
- [acct, gh, projectAcct.where]
367
+ const list = useMemo(
368
+ () =>
369
+ native && !cfg?.cloud
370
+ ? switchList({ accounts: acct.accounts, profile: cfg?.profile, cloudEmail: acct.email })
371
+ : null,
372
+ [native, cfg?.cloud, acct.accounts, cfg?.profile, acct.email]
364
373
  );
365
- // 2.0.5 W4b — Switch / Sign in for a team server: `team_sign_in_prepare` first (bind-on-sign-in for
366
- // a hub), then the server's own page. Words come back as one toast.
367
- const switchPath = useCallback(
368
- async (spec) => {
369
- if (spec?.path !== 'hub-switch') return;
374
+ // `account.switch` (⌘K, the tab menu) opens the menu on its Switch account list
375
+ useEffect(() => {
376
+ const on = (e) => {
377
+ setPick(null);
378
+ setAcctView(e?.detail?.view === 'switch' ? 'switch' : 'menu');
379
+ setAcctOpen(true);
380
+ };
381
+ window.addEventListener(ACCOUNT_MENU_EVENT, on);
382
+ return () => window.removeEventListener(ACCOUNT_MENU_EVENT, on);
383
+ }, []);
384
+ // 2.0.5 W4b — a team server's sign-in: `team_sign_in_prepare` first (bind-on-sign-in for a hub), then
385
+ // the server's own page with the folder's linked address. Words come back as one toast.
386
+ const hubSignIn = useCallback(
387
+ async (url) => {
370
388
  const r = await runTeamSwitch({
371
- url: spec.url,
389
+ url,
372
390
  native,
373
391
  invoke: shellInvoke,
374
392
  api: jsonFetch,
@@ -385,6 +403,41 @@ export function ShellShareCluster() {
385
403
  },
386
404
  [native]
387
405
  );
406
+ // The broken sign-in's one button (menu, toast): your server's own sign-in page with the address the
407
+ // folder already names — never typed again; a Maude Cloud project signs in where Maude Cloud does.
408
+ const fixSignIn = useCallback(
409
+ (fix) => {
410
+ closeAcct();
411
+ if (fix?.path === 'hub-signin') void hubSignIn(fix.url);
412
+ else menuRunner.run('settings.open', { tab: 'connections' });
413
+ },
414
+ [closeAcct, hubSignIn]
415
+ );
416
+ useSignInToast({
417
+ conn,
418
+ project: projectName,
419
+ onFix: () => fixSignIn(menu.fix),
420
+ toast: notify,
421
+ enabled: !cfg?.cloud,
422
+ });
423
+ const confirmUse = useCallback(async () => {
424
+ const row = pick?.row;
425
+ if (!row) return;
426
+ setUsing(true);
427
+ try {
428
+ const rebound = await shellInvoke('project_use_account', { id: row.id });
429
+ if (rebound)
430
+ shellToast(
431
+ `${projectName || 'This project'} now uses ${row.kind === 'local' ? 'no account' : row.title}. Reopening it…`,
432
+ true
433
+ );
434
+ closeAcct();
435
+ } catch (e) {
436
+ shellToast(String(e?.message || e || 'Could not switch accounts. Nothing changed.'));
437
+ } finally {
438
+ setUsing(false);
439
+ }
440
+ }, [pick, projectName, closeAcct]);
388
441
  // S9.23 — the faces' menu and people list: where people are, Follow / Go to / Bring everyone here.
389
442
  const presence = usePresenceHost({
390
443
  lane,
@@ -423,22 +476,52 @@ export function ShellShareCluster() {
423
476
  <>
424
477
  <span className="sh-pa-anchor">
425
478
  <ProjectAccountPopover open={acctOpen} onClose={closeAcct}>
426
- <ProjectAccountCard
427
- account={projectAcct}
428
- run={(id) => menuRunner.run(id)}
429
- onSignOut={signOutPath}
430
- onSwitch={switchPath}
431
- onClose={closeAcct}
432
- />
479
+ {pick ? (
480
+ <SwitchSheet
481
+ sheet={pick.sheet}
482
+ busy={using}
483
+ onCancel={() => setPick(null)}
484
+ onConfirm={confirmUse}
485
+ />
486
+ ) : (
487
+ <ProjectAccountMenu
488
+ menu={menu}
489
+ face={face}
490
+ list={list}
491
+ view={acctView}
492
+ onView={setAcctView}
493
+ onFix={fixSignIn}
494
+ onPick={(row) =>
495
+ setPick({
496
+ row,
497
+ sheet: switchSheet({ row, project: projectName, place: acct.place, conn }),
498
+ })
499
+ }
500
+ onAction={(id, params) => {
501
+ closeAcct();
502
+ if (id === 'show-in-finder')
503
+ void doors.revealPath(cfg?.designRel || '.design');
504
+ else if (id === 'retry') retry();
505
+ else if (id === 'review-link') {
506
+ // 2.1.1 T8 — an address the repo names: the Share sheet's Connect row, the one
507
+ // consent step; never a sign-in with that address filled in
508
+ requestShareFocus('connect');
509
+ menuRunner.run('share.open');
510
+ } else menuRunner.run(id, params);
511
+ }}
512
+ />
513
+ )}
433
514
  </ProjectAccountPopover>
434
515
  </span>
435
- {chip ? (
516
+ {native && face ? (
436
517
  <AccountChip
437
- chip={chip}
438
- card={card}
439
- onSwitch={() => menuRunner.run('account.switch')}
440
- onSignOut={acct.signOut}
441
- onOpen={() => setAcctOpen((o) => !o)}
518
+ face={face}
519
+ accountId={cfg?.profile?.id || 'default'}
520
+ onOpen={() => {
521
+ setAcctView('menu');
522
+ setPick(null);
523
+ setAcctOpen((o) => !o);
524
+ }}
442
525
  opened={acctOpen}
443
526
  />
444
527
  ) : null}
@@ -449,7 +532,7 @@ export function ShellShareCluster() {
449
532
  faces={faces}
450
533
  onFollow={lane.follow}
451
534
  presence={presence}
452
- status={shown}
535
+ status={withConnection(shown, conn)}
453
536
  access={access}
454
537
  commentsCount={comments ? Number(comments.unreadCount) || 0 : Number(totalOpen) || 0}
455
538
  commentsCountKind={comments ? 'unread' : 'open'}
@@ -324,8 +324,9 @@ function settingsPart({ native, cloud, readOnly }) {
324
324
  ).map((r) => ({
325
325
  testid: r.testid,
326
326
  section: r.section,
327
- // The account row needs an address the shell may not have (a desktop not signed in, a hub with no dashboard).
328
- ...(r.account ? { conditional: true } : {}),
327
+ // The account row needs an address the shell may not have (a desktop not signed in, a hub with no dashboard);
328
+ // a row under a fold (2.1.1 T6: This project › Sync details) is drawn once that fold is open.
329
+ ...(r.account || r.fold ? { conditional: true } : {}),
329
330
  }));
330
331
  return {
331
332
  present: true,