@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,111 @@
1
+ // client/home/HomeConnection.jsx — 2.1.1 B4 (artboard 14): the pieces Home's accounts row and its project
2
+ // rows share — an account's face with the connection badge on it, the "Where" chip, and the state word.
3
+ // Models: home-where-model.js (words, tones) · home-accounts-model.js (cards). Nothing here decides a
4
+ // state; it draws what the model says.
5
+
6
+ import { HIcon } from './home-icons.jsx';
7
+
8
+ /** The broken-link glyph on a sign-in that stopped working (the project window's badge). */
9
+ function BrokenLink({ size = 10 }) {
10
+ return (
11
+ <svg
12
+ width={size}
13
+ height={size}
14
+ viewBox="0 0 16 16"
15
+ fill="none"
16
+ stroke="currentColor"
17
+ strokeWidth="1.6"
18
+ strokeLinecap="round"
19
+ aria-hidden="true"
20
+ >
21
+ <path d="M6.6 9.4 5.1 10.9a2.1 2.1 0 0 1-3-3l1.5-1.5" />
22
+ <path d="M9.4 6.6 10.9 5.1a2.1 2.1 0 0 1 3 3l-1.5 1.5" />
23
+ <path d="M5.2 1.8v1.6M1.8 5.2h1.6M10.8 14.2v-1.6M14.2 10.8h-1.6" />
24
+ </svg>
25
+ );
26
+ }
27
+
28
+ /** "Kept by Maude" — the mark, single colour. */
29
+ function KeptGlyph({ size = 12 }) {
30
+ return (
31
+ <svg width={size} height={size} viewBox="0 0 16 16" aria-hidden="true">
32
+ <rect x="1.5" y="1.5" width="13" height="13" rx="3.5" fill="currentColor" />
33
+ <path d="M8 4.2v7.6M4.2 8h7.6" stroke="var(--bg-1)" strokeWidth="1.6" strokeLinecap="round" />
34
+ </svg>
35
+ );
36
+ }
37
+
38
+ /**
39
+ * An account's face — a circle with a letter for a Maude Cloud account, a tile with the server glyph for
40
+ * your server, a laptop tile for this Mac — with the connection state as ONE badge on it (a thin ring
41
+ * turning while it syncs, a grey face offline, a broken link when a sign-in needs the person, a warning
42
+ * when the server does not answer).
43
+ * @param {{ face: { kind: string, initial?: string, tone?: string }, state?: string|null,
44
+ * size?: 'sm'|'md'|'lg' }} props
45
+ */
46
+ export function AcctFace({ face, state = null, size = 'md' }) {
47
+ const glyph = size === 'lg' ? 16 : size === 'md' ? 13 : 10;
48
+ return (
49
+ <span
50
+ className={`home-acf home-acf--${size}`}
51
+ data-conn={state ?? undefined}
52
+ aria-hidden="true"
53
+ >
54
+ {face.kind === 'cloud' ? (
55
+ <span className={`home-face home-face--${size} home-face--${face.tone}`}>
56
+ {face.initial}
57
+ </span>
58
+ ) : (
59
+ <span className={`home-acf-tile home-acf-tile--${face.kind} home-acf-tile--${size}`}>
60
+ <HIcon name={face.kind === 'server' ? 'server' : 'laptop'} size={glyph} />
61
+ </span>
62
+ )}
63
+ {state === 'syncing' ? <span className="home-acf-ring" /> : null}
64
+ {state === 'missing' || state === 'rejected' ? (
65
+ <span className="home-acf-badge home-acf-badge--bad">
66
+ <BrokenLink size={size === 'lg' ? 12 : size === 'md' ? 10 : 8} />
67
+ </span>
68
+ ) : null}
69
+ {state === 'unreachable' ? (
70
+ <span className="home-acf-badge home-acf-badge--warn">!</span>
71
+ ) : null}
72
+ </span>
73
+ );
74
+ }
75
+
76
+ /** The state as a word with its dot (green · red · amber · grey). */
77
+ export function StateWord({ tone, children, testid }) {
78
+ return (
79
+ <span className="home-sw" data-tone={tone} data-testid={testid}>
80
+ <i aria-hidden="true" />
81
+ {children}
82
+ </span>
83
+ );
84
+ }
85
+
86
+ const WHERE_ICON = { cloud: 'cloud', server: 'server', folder: 'folder' };
87
+
88
+ /**
89
+ * The "Where" chip: the account for a synced project (Maude Cloud by e-mail, your server by host), or the
90
+ * place for a project only on this Mac (Your folder · Kept by Maude), with the folder's path beside it.
91
+ * @param {{ where: { kind: string, label: string, path: string|null }, testid?: string }} props
92
+ */
93
+ export function WhereChip({ where, testid }) {
94
+ return (
95
+ <span className="home-where" data-kind={where.kind} data-testid={testid}>
96
+ <span className="home-place">
97
+ {where.kind === 'kept' ? (
98
+ <KeptGlyph size={12} />
99
+ ) : (
100
+ <HIcon name={WHERE_ICON[where.kind] ?? 'folder'} size={12} />
101
+ )}
102
+ <span>{where.label}</span>
103
+ </span>
104
+ {where.path ? (
105
+ <span className="home-where-path" title={where.path}>
106
+ {where.path}
107
+ </span>
108
+ ) : null}
109
+ </span>
110
+ );
111
+ }
@@ -14,7 +14,8 @@
14
14
  // that holds a credential (`home_cloud_sign_in_prepare` makes a fresh one — that IS the switch);
15
15
  // "Connect to a team server…" is the Advanced › hub sheet. A browser has no shell: facts only.
16
16
 
17
- import { accountFace } from './home-model.js';
17
+ import { accountFace, normHubUrl } from './home-model.js';
18
+ import { CONN_WORDS, cloudState } from './home-where-model.js';
18
19
 
19
20
  const hostOf = (url) => {
20
21
  try {
@@ -119,3 +120,111 @@ export function homeAccounts({ native = false, shell = null, clouds = null, hubP
119
120
  add: native ? { cloud: 'Add a Maude Cloud account…', team: 'Connect to a team server…' } : null,
120
121
  };
121
122
  }
123
+
124
+ const projectsWord = (n) => (n === 0 ? 'No projects' : `${n} ${n === 1 ? 'project' : 'projects'}`);
125
+
126
+ /**
127
+ * 2.1.1 B4 (artboard 14) — the accounts row on top of Home: one card per account the projects (or the
128
+ * sign-ins) name, with its state and, when the person can fix it in one click, the button.
129
+ * cloud a Maude Cloud account, by its e-mail. Listed when signed in, when its sign-in was refused,
130
+ * or when a project is on it but no sign-in is left ("Sign-in missing").
131
+ * server a server of your own, by its account (or host). Listed per saved sign-in, and for a server
132
+ * a project is on but no sign-in is saved for.
133
+ * "This Mac only" is not a card: nothing to connect, and the project rows already say it.
134
+ * `fix`: `{ path: 'cloud-signin', profile }` (Home's own Maude Cloud sign-in) or
135
+ * `{ path: 'hub-signin', profile, url }` (the team-server sign-in, address prefilled) — only for a
136
+ * sign-in that is missing or stopped working; a server that does not answer has nothing to fix here.
137
+ *
138
+ * @param in.shell `shell_state`
139
+ * @param in.clouds one `GET /_home/cloud` answer per profile
140
+ * @param in.hubProfiles `GET /_home/accounts` `profiles` (each hub with its `state`)
141
+ * @param in.groups `buildHomeModel().groups` (rows carry `where` / `connection`)
142
+ */
143
+ export function homeAccountCards({ shell = null, clouds = null, hubProfiles = null, groups = [] }) {
144
+ const profiles = (shell?.profiles ?? []).filter((p) => p && typeof p.id === 'string');
145
+ const ids = [...profiles.map((p) => p.id), ...groups.map((g) => g.profile?.id)].filter(
146
+ (id, i, all) => typeof id === 'string' && all.indexOf(id) === i
147
+ );
148
+ const out = [];
149
+ for (const id of ids) {
150
+ const prof = profiles.find((p) => p.id === id) ?? null;
151
+ const rows = groups.find((g) => g.profile?.id === id)?.rows ?? [];
152
+ const listing = (clouds ?? []).find((c) => c?.profile === id) ?? null;
153
+ const email = str(listing?.account?.email) || str(prof?.email);
154
+ const onCloud = rows.filter((r) => r.where?.kind === 'cloud');
155
+ const cloudOwn = rows.some((r) => r.connection?.kind === 'cloud');
156
+
157
+ if (listing?.signedIn || listing?.rejected || cloudOwn) {
158
+ const state = cloudState(listing) ?? (cloudOwn ? 'missing' : null);
159
+ if (state)
160
+ out.push({
161
+ key: `cloud:${id}`,
162
+ kind: 'cloud',
163
+ profile: id,
164
+ url: null,
165
+ face: { kind: 'cloud', ...accountFace({ id, label: email || prof?.label, email }) },
166
+ title: email || 'Maude Cloud',
167
+ sub: `Maude Cloud · ${projectsWord(onCloud.length)}`,
168
+ state,
169
+ word: CONN_WORDS[state],
170
+ fix:
171
+ state === 'rejected' || state === 'missing'
172
+ ? {
173
+ path: 'cloud-signin',
174
+ profile: id,
175
+ label: state === 'rejected' ? 'Sign in again' : 'Sign in',
176
+ }
177
+ : null,
178
+ });
179
+ }
180
+
181
+ const saved = (hubProfiles ?? []).find((x) => x?.id === id)?.hubs ?? [];
182
+ const servers = new Map();
183
+ for (const h of saved)
184
+ if (h && typeof h.url === 'string' && normHubUrl(h.url))
185
+ servers.set(normHubUrl(h.url), { url: h.url, account: str(h.account), state: h.state });
186
+ for (const r of rows) {
187
+ const url = r.connection?.kind === 'team' ? r.boundHub || r.hub : null;
188
+ if (url && !servers.has(url)) servers.set(url, { url, account: null, state: 'missing' });
189
+ }
190
+ for (const [norm, h] of servers) {
191
+ const state =
192
+ h.state === 'missing' || h.state === 'rejected' || h.state === 'unreachable'
193
+ ? h.state
194
+ : 'ok';
195
+ const host = hostOf(h.url);
196
+ const n = rows.filter(
197
+ (r) => r.where?.kind === 'server' && (r.boundHub || r.hub) === norm
198
+ ).length;
199
+ out.push({
200
+ key: `server:${id}:${norm}`,
201
+ kind: 'server',
202
+ profile: id,
203
+ url: h.url,
204
+ face: { kind: 'server' },
205
+ title: h.account || host,
206
+ sub: `${h.account ? host : 'Your server'} · ${projectsWord(n)}`,
207
+ state,
208
+ word: CONN_WORDS[state],
209
+ fix:
210
+ state === 'rejected' || state === 'missing'
211
+ ? {
212
+ path: 'hub-signin',
213
+ profile: id,
214
+ url: h.url,
215
+ label: state === 'rejected' ? 'Sign in again' : 'Sign in',
216
+ }
217
+ : null,
218
+ });
219
+ }
220
+ }
221
+ return out;
222
+ }
223
+
224
+ /** The testid tail of a card: `<profile>-cloud` or `<profile>-<host>`. */
225
+ export const slugOf = (card) =>
226
+ card.kind === 'cloud'
227
+ ? `${card.profile}-cloud`
228
+ : `${card.profile}-${hostOf(card.url)
229
+ .toLowerCase()
230
+ .replace(/[^a-z0-9]+/g, '-')}`;
@@ -130,8 +130,12 @@ export const cloudSignInStart = (profile) =>
130
130
  export const cloudSignInPoll = (state) => post('/_home/cloud/signin/poll', { state });
131
131
  export const cloudSignInCancel = (state) => post('/_home/cloud/signin/cancel', { state });
132
132
  /** Rust picks (or makes) the profile the next sign-in may write → its id. A refusal rejects with words. */
133
- export const signInPrepare = (forInvite) =>
134
- shellInvoke('home_cloud_sign_in_prepare', forInvite ? { forInvite } : {});
133
+ export const signInPrepare = (forInvite, profile) =>
134
+ shellInvoke('home_cloud_sign_in_prepare', {
135
+ ...(forInvite ? { forInvite } : {}),
136
+ // 2.1.1: "Sign in again" on an account's card asks for THAT profile
137
+ ...(profile ? { profile } : {}),
138
+ });
135
139
  export const signInOpenBrowser = (userCode, state) =>
136
140
  shellInvoke('home_cloud_sign_in_open', { userCode, state });
137
141
  /** After the Home server stored the credential: Rust records the account → the profile it landed in. */
@@ -272,6 +276,9 @@ export const openProject = (where, target, intent) =>
272
276
  ...(intent ? { intent } : {}),
273
277
  });
274
278
  export const openProjectFolder = () => shellInvoke('open_project_folder');
279
+ /** #206 T6.3g — a Worktrees row's folder as its own tab, by the pid `shell_state` listed it under
280
+ * (Rust resolves the folder from its own list; Home never names a path). → `{label, opened}`. */
281
+ export const openWorktree = (pid) => shellInvoke('open_worktree', { pid });
275
282
  export const relinkProject = (pid) => shellInvoke('relink_project', { pid });
276
283
  /** The existing command (github.js `managedProjectOpen`): resolves the managed copy's folder. */
277
284
  export const managedProjectOpen = (p) =>
@@ -13,6 +13,7 @@
13
13
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
14
14
 
15
15
  import {
16
+ cloudSignOut,
16
17
  createLocal,
17
18
  createLocalFromPrompt,
18
19
  getAccounts,
@@ -28,6 +29,7 @@ import {
28
29
  openCloudUrl,
29
30
  openProject,
30
31
  openProjectFolder,
32
+ openWorktree,
31
33
  pendingInviteAccept,
32
34
  pendingInviteLeave,
33
35
  pickProjectLocation,
@@ -60,6 +62,9 @@ import { InviteSheet } from './InviteSheet.jsx';
60
62
  import { INVITE_WORDS, joinPendingAndOpen, useInviteFlow } from './invite-flow.js';
61
63
  import { HIcon, HMark, HSpark, ProjectSquare } from './home-icons.jsx';
62
64
  import { HomeAccounts } from './HomeAccounts.jsx';
65
+ import { HomeAccountsRow } from './HomeAccountsRow.jsx';
66
+ import { AcctFace, StateWord, WhereChip } from './HomeConnection.jsx';
67
+ import { homeAccountCards } from './home-accounts-model.js';
63
68
  import {
64
69
  accountFace,
65
70
  buildHomeModel,
@@ -452,6 +457,9 @@ export function HomeApp() {
452
457
  // 2.0.5 W4b — the account each profile's team servers vouched for, so a row can say
453
458
  // "Team server · <host> · <account>" (public handles from /_home/accounts, never a token)
454
459
  const [hubAccounts, setHubAccounts] = useState(null);
460
+ // 2.1.1 — and whether each of those sign-ins still works (`state`), plus the raw answer for the accounts row
461
+ const [hubStates, setHubStates] = useState(null);
462
+ const [hubProfiles, setHubProfiles] = useState(null);
455
463
  const profileKey = (data.shell?.profiles ?? [])
456
464
  .map((p) => p?.id)
457
465
  .filter(Boolean)
@@ -470,6 +478,15 @@ export function HomeApp() {
470
478
  ])
471
479
  )
472
480
  );
481
+ setHubStates(
482
+ Object.fromEntries(
483
+ r.json.profiles.map((p) => [
484
+ p.id,
485
+ Object.fromEntries((p.hubs ?? []).map((h) => [h.url, h.state])),
486
+ ])
487
+ )
488
+ );
489
+ setHubProfiles(r.json.profiles);
473
490
  });
474
491
  return () => {
475
492
  live = false;
@@ -483,9 +500,23 @@ export function HomeApp() {
483
500
  clouds: data.clouds,
484
501
  filterPid: filterPid || null,
485
502
  hubAccounts,
503
+ hubStates,
486
504
  cloudUrl,
487
505
  }),
488
- [data.shell, data.index, data.clouds, filterPid, hubAccounts, cloudUrl]
506
+ [data.shell, data.index, data.clouds, filterPid, hubAccounts, hubStates, cloudUrl]
507
+ );
508
+ // 2.1.1 (artboard 14) — the accounts row on top; an account whose sign-in stopped working is fixed
509
+ // from its own card. A Maude Cloud one drops the dead credential first so the sign-in may use that
510
+ // same profile again (Rust never re-signs a profile that still holds one).
511
+ const accountCards = useMemo(
512
+ () =>
513
+ homeAccountCards({
514
+ shell: data.shell,
515
+ clouds: data.clouds,
516
+ hubProfiles: hubProfiles ?? [],
517
+ groups: model.groups,
518
+ }),
519
+ [data.shell, data.clouds, hubProfiles, model.groups]
489
520
  );
490
521
  // 2.0.5 W4b — the face at the top right opens every account on this Mac (HomeAccounts.jsx)
491
522
  const searchPids = useMemo(
@@ -627,6 +658,19 @@ export function HomeApp() {
627
658
  [fail]
628
659
  );
629
660
 
661
+ // #206 T6.3g — a Worktrees row's chip: its own tab, by pid (never `open_project`, never a path).
662
+ const openWorktreeTab = useCallback(
663
+ async (pid) => {
664
+ if (!data.native) return;
665
+ try {
666
+ await openWorktree(pid);
667
+ } catch (e) {
668
+ fail(e);
669
+ }
670
+ },
671
+ [data.native, fail]
672
+ );
673
+
630
674
  // A project not on this Mac yet, once prepared: its own copy → a tab (`managed_project_open`
631
675
  // resolves the copy's folder, `open_project` opens it). Cloud rows and connect links share it.
632
676
  // A Can view account gets no copy (S9.17b): the prepare's browser door opens the cell as a
@@ -1051,6 +1095,20 @@ export function HomeApp() {
1051
1095
  </p>
1052
1096
  ) : null}
1053
1097
 
1098
+ {data.native && accountCards.length ? (
1099
+ <HomeAccountsRow
1100
+ cards={accountCards}
1101
+ native={data.native}
1102
+ onCloudSignIn={async (card) => {
1103
+ if (card.state === 'rejected') await cloudSignOut(card.profile);
1104
+ signin.begin({ profile: card.profile });
1105
+ }}
1106
+ onAddCloud={() => signin.begin()}
1107
+ onAddTeam={() => openSheet('hub')}
1108
+ onChanged={data.reload}
1109
+ />
1110
+ ) : null}
1111
+
1054
1112
  {model.pinned.length ? (
1055
1113
  <section className="home-sec" aria-labelledby="home-h-pinned">
1056
1114
  <h2 className="home-h" id="home-h-pinned">
@@ -1232,6 +1290,7 @@ export function HomeApp() {
1232
1290
  showHeader={projGroups.length > 1 || !!g.profile.email}
1233
1291
  canOpen={data.native}
1234
1292
  onOpen={(pid) => open(pid)}
1293
+ onOpenWorktree={openWorktreeTab}
1235
1294
  onRelink={relink}
1236
1295
  onOpenCloud={openCloud}
1237
1296
  />
@@ -1409,20 +1468,34 @@ const STATE_WORD = {
1409
1468
  ),
1410
1469
  };
1411
1470
 
1412
- // 2.0.5 W4b — how a local project is connected and as whom: "Local · this Mac only",
1413
- // "Maude Cloud · <account>", "Team server · <host> · <account>" (home-model `connectionOf`).
1414
- const CONNECTION_ICON = { local: 'laptop', cloud: 'cloud', team: 'server' };
1415
- function ConnectionWords({ row }) {
1416
- const c = row.connection;
1417
- if (!c?.words) return null;
1471
+ // 2.1.1 (artboard 14) — a project row says where it lives (the account, or the place) and shows the
1472
+ // connection badge the project window shows: the account's face with the state on it, and its word.
1473
+ // `home-project-conn-<pid>` stays the connection cell (data-kind = local / cloud / team, data-state).
1474
+ function RowWhere({ row }) {
1475
+ if (!row.where) return null;
1476
+ return (
1477
+ <span className="home-prow-where">
1478
+ <WhereChip where={row.where} testid={`home-project-where-${row.pid}`} />
1479
+ </span>
1480
+ );
1481
+ }
1482
+ function RowConn({ row }) {
1483
+ const c = row.conn;
1418
1484
  return (
1419
1485
  <span
1420
- className="home-prow-conn"
1486
+ className="home-prow-st"
1421
1487
  data-testid={`home-project-conn-${row.pid}`}
1422
- data-kind={c.kind}
1488
+ data-kind={row.connection?.kind ?? undefined}
1489
+ data-state={c?.state ?? undefined}
1423
1490
  >
1424
- <HIcon name={CONNECTION_ICON[c.kind] ?? 'laptop'} size={12} />
1425
- {c.words}
1491
+ {c ? (
1492
+ <>
1493
+ <AcctFace face={c.face} state={c.state} size="sm" />
1494
+ <StateWord tone={c.tone} testid={`home-project-state-${row.pid}`}>
1495
+ {c.word}
1496
+ </StateWord>
1497
+ </>
1498
+ ) : null}
1426
1499
  </span>
1427
1500
  );
1428
1501
  }
@@ -1455,6 +1528,33 @@ function RowCopies({ row, canOpen, onOpen }) {
1455
1528
  );
1456
1529
  }
1457
1530
 
1531
+ // #206 T6.3g (contract 206 §5) — the git worktrees of this project this Mac opened as tabs: one
1532
+ // "Worktrees" row under the project, a chip per branch. A worktree is never a project row of its own.
1533
+ function RowWorktrees({ row, canOpen, onOpen }) {
1534
+ if (!row.worktrees?.length) return null;
1535
+ return (
1536
+ <span className="home-prow-copies" data-testid={`home-project-worktrees-${row.pid}`}>
1537
+ <span className="home-prow-wt-h">Worktrees</span>
1538
+ {row.worktrees.map((w) => (
1539
+ <button
1540
+ key={w.pid}
1541
+ type="button"
1542
+ className="chip home-prow-copy"
1543
+ data-testid={`home-worktree-${w.pid}`}
1544
+ data-place={w.place}
1545
+ onClick={() => onOpen(w.pid)}
1546
+ disabled={!canOpen}
1547
+ {...reasonProps(!canOpen, 'homeBrowser')}
1548
+ title={w.root}
1549
+ aria-label={`Open the ${w.branch} worktree of ${row.name}`}
1550
+ >
1551
+ {w.branch}
1552
+ </button>
1553
+ ))}
1554
+ </span>
1555
+ );
1556
+ }
1557
+
1458
1558
  // A project tab's live state (shell_state `ai` + `place`), canvas 11's words: AI working (a spark
1459
1559
  // while it runs) · Needs you (it is waiting on a decision — the one that asks for you wins) ·
1460
1560
  // Resting (its server is stopped; the tab wakes it). A resting tab never has AI (rest policy).
@@ -1491,7 +1591,15 @@ function RowLive({ row }) {
1491
1591
  return null;
1492
1592
  }
1493
1593
 
1494
- function ProfileGroup({ group, showHeader, canOpen, onOpen, onRelink, onOpenCloud }) {
1594
+ function ProfileGroup({
1595
+ group,
1596
+ showHeader,
1597
+ canOpen,
1598
+ onOpen,
1599
+ onOpenWorktree,
1600
+ onRelink,
1601
+ onOpenCloud,
1602
+ }) {
1495
1603
  const { profile, cloud } = group;
1496
1604
  return (
1497
1605
  <div className="home-acct" data-testid={`home-profile-${profile.id}`}>
@@ -1524,6 +1632,9 @@ function ProfileGroup({ group, showHeader, canOpen, onOpen, onRelink, onOpenClou
1524
1632
  {cloudRoleWord(r.role)} · {STATE_WORD.cloud}
1525
1633
  </span>
1526
1634
  </span>
1635
+ <span className="home-prow-where">
1636
+ <WhereChip where={r.where} testid={`home-project-where-${r.projectId}`} />
1637
+ </span>
1527
1638
  <button
1528
1639
  type="button"
1529
1640
  className="btn btn--sm"
@@ -1573,7 +1684,6 @@ function ProfileGroup({ group, showHeader, canOpen, onOpen, onRelink, onOpenClou
1573
1684
  {[
1574
1685
  r.canvasCount != null ? canvasCount(r.canvasCount) : null,
1575
1686
  STATE_WORD[r.status] ?? null,
1576
- r.connection ? <ConnectionWords key="conn" row={r} /> : null,
1577
1687
  ]
1578
1688
  .filter(Boolean)
1579
1689
  .map((part, i) => (
@@ -1585,11 +1695,14 @@ function ProfileGroup({ group, showHeader, canOpen, onOpen, onRelink, onOpenClou
1585
1695
  ))}
1586
1696
  </span>
1587
1697
  </span>
1698
+ <RowWhere row={r} />
1699
+ <RowConn row={r} />
1588
1700
  <RowLive row={r} />
1589
1701
  <ProjectSquare id={r.pid} name={r.name} />
1590
1702
  </button>
1591
1703
  )}
1592
1704
  <RowCopies row={r} canOpen={canOpen} onOpen={onOpen} />
1705
+ <RowWorktrees row={r} canOpen={canOpen} onOpen={onOpenWorktree} />
1593
1706
  </li>
1594
1707
  )
1595
1708
  )}
@@ -15,6 +15,7 @@
15
15
  import { localIdentityMatches } from '../share-link.js';
16
16
  import { accountTone } from '../shell/account-tone.js';
17
17
  import { pathTestIdSlug } from '../shell/util.js';
18
+ import { cloudRowWhere, cloudState, connBadge, serverState, whereOf } from './home-where-model.js';
18
19
 
19
20
  /** `canvas-row-<slug>`'s rule, so Home rows and tree rows name a canvas the same way. */
20
21
  export const rowSlug = (rel) => pathTestIdSlug(rel);
@@ -186,6 +187,7 @@ export function buildHomeModel({
186
187
  clouds = null,
187
188
  filterPid = null,
188
189
  hubAccounts = null,
190
+ hubStates = null,
189
191
  cloudUrl = null,
190
192
  }) {
191
193
  const indexed = new Map();
@@ -236,6 +238,14 @@ export function buildHomeModel({
236
238
  if (normHubUrl(url) && typeof who === 'string' && who) m.set(normHubUrl(url), who);
237
239
  accountsOn.set(id, m);
238
240
  }
241
+ // 2.1.1 — per profile, whether each saved team sign-in still works (`/_home/accounts` `state`)
242
+ const statesOn = new Map();
243
+ for (const [id, byHub] of Object.entries(hubStates ?? {})) {
244
+ const m = new Map();
245
+ for (const [url, st] of Object.entries(byHub ?? {}))
246
+ if (normHubUrl(url) && typeof st === 'string') m.set(normHubUrl(url), st);
247
+ statesOn.set(id, m);
248
+ }
239
249
  const allLocal = registry.map((p) => {
240
250
  const ix = indexed.get(p.pid);
241
251
  const gone = ix?.state === 'gone';
@@ -286,7 +296,34 @@ export function buildHomeModel({
286
296
  const ib = mru.has(b.pid) ? mru.get(b.pid) : Number.POSITIVE_INFINITY;
287
297
  return ia - ib || a.name.localeCompare(b.name);
288
298
  });
289
- const localRows = collapseDuplicates(allLocal, cloudUrl);
299
+ const listingFor = (id) => (clouds ?? []).find((c) => c?.profile === id) ?? null;
300
+ // 2.1.1 (artboard 14) — where the row lives and how it connects, after the folded copies settled
301
+ const placed = (r) => {
302
+ const kind = r.connection?.kind;
303
+ const state =
304
+ kind === 'local'
305
+ ? 'local'
306
+ : kind === 'cloud'
307
+ ? cloudState(listingFor(r.profile))
308
+ : kind === 'team'
309
+ ? serverState(
310
+ hubStates ? (statesOn.get(r.profile) ?? new Map()) : null,
311
+ r.boundHub || r.hub
312
+ )
313
+ : null;
314
+ return {
315
+ ...r,
316
+ where: whereOf(r),
317
+ conn: connBadge(state, {
318
+ kind,
319
+ profile: { id: r.profile },
320
+ email: r.connection?.account ?? null,
321
+ }),
322
+ };
323
+ };
324
+ const localRows = attachWorktrees(collapseDuplicates(allLocal, cloudUrl), shell?.worktrees).map(
325
+ (r) => (r.status === 'gone' ? r : placed(r))
326
+ );
290
327
 
291
328
  // one profile's copy never hides another profile's cloud row
292
329
  const bound = new Set(
@@ -308,6 +345,8 @@ export function buildHomeModel({
308
345
  ownerName: cp.ownerName ?? null,
309
346
  role: cp.role ?? null,
310
347
  url: cp.url ?? null,
348
+ where: cloudRowWhere(listing.account?.email || emailOf(listing.profile)),
349
+ conn: null,
311
350
  status: 'cloud',
312
351
  updatedAt: cp.updatedAt ?? null,
313
352
  });
@@ -361,6 +400,35 @@ export function buildHomeModel({
361
400
  };
362
401
  }
363
402
 
403
+ /**
404
+ * #206 T6.3g (contract 206 §5 "Home and Recent") — the worktree folders this Mac opened as tabs
405
+ * (`shell_state.worktrees`, newest first) go under their main project's row as `worktrees`, never as
406
+ * rows of their own. A row folded into another (`copies`) hands its worktrees to that row; a worktree
407
+ * whose main project Home does not list is not shown.
408
+ */
409
+ function attachWorktrees(rows, worktrees) {
410
+ const valid = (worktrees ?? []).filter(
411
+ (w) =>
412
+ w &&
413
+ typeof w.pid === 'string' &&
414
+ typeof w.mainPid === 'string' &&
415
+ typeof w.branch === 'string' &&
416
+ w.branch
417
+ );
418
+ return rows.map((r) => {
419
+ const owners = new Set([r.pid, ...r.copies.map((c) => c.pid)]);
420
+ const mine = valid
421
+ .filter((w) => owners.has(w.mainPid))
422
+ .map((w) => ({
423
+ pid: w.pid,
424
+ branch: w.branch,
425
+ place: w.place ?? 'closed',
426
+ root: w.root ?? '',
427
+ }));
428
+ return { ...r, worktrees: mine };
429
+ });
430
+ }
431
+
364
432
  /**
365
433
  * 2.0.5 W4b (4) — one row per project. Identity, never the label:
366
434
  * (a) a managed copy (profile + its bound hub + the project id in its folder name) folds into the