@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
@@ -259,6 +259,40 @@
259
259
  background: var(--accent);
260
260
  filter: brightness(1.06);
261
261
  }
262
+ /* 2.1.1 T3 — Sync on a project only on this Mac (canvas 17 ac-sync): centred, two ways out. */
263
+ .dg-solo-b {
264
+ display: flex;
265
+ flex-direction: column;
266
+ align-items: center;
267
+ gap: var(--space-2, 8px);
268
+ padding: var(--space-4, 16px) var(--space-3, 12px) var(--space-2, 8px);
269
+ text-align: center;
270
+ }
271
+ .dg-solo-ic {
272
+ display: grid;
273
+ place-items: center;
274
+ width: 44px;
275
+ height: 44px;
276
+ border-radius: var(--radius-lg, 12px);
277
+ background: var(--bg-3);
278
+ color: var(--fg-1);
279
+ }
280
+ .dg-solo-b > strong {
281
+ font-size: var(--type-md, 15px);
282
+ color: var(--fg-0);
283
+ }
284
+ .dg-solo-b .dg-empty {
285
+ max-width: 36ch;
286
+ font-size: var(--type-sm, 13px);
287
+ color: var(--fg-1);
288
+ }
289
+ .dg-solo-acts {
290
+ display: flex;
291
+ flex-wrap: wrap;
292
+ justify-content: center;
293
+ gap: var(--space-2, 8px);
294
+ margin-top: var(--space-1, 4px);
295
+ }
262
296
  .dg-notice,
263
297
  .dg-latest {
264
298
  display: flex;
@@ -53,6 +53,24 @@ export function canvasNamesBySlug(groups) {
53
53
  return out;
54
54
  }
55
55
 
56
+ /** Burndown F4 — a code-held row's file versions, by path: `{ sha256, size }` (only a valid sha). */
57
+ function heldVersions(files) {
58
+ const out = {};
59
+ if (!Array.isArray(files)) return out;
60
+ for (const f of files.slice(0, 200)) {
61
+ if (!f || typeof f.path !== 'string' || typeof f.sha256 !== 'string') continue;
62
+ if (!/^[0-9a-f]{64}$/.test(f.sha256) || !isCount(f.size)) continue;
63
+ out[f.path] = { sha256: f.sha256, size: f.size };
64
+ }
65
+ return out;
66
+ }
67
+
68
+ /** `{ versions }` only when the row names one (a row from an older hub, or another kind, has none). */
69
+ function withVersions(files) {
70
+ const versions = heldVersions(files);
71
+ return Object.keys(versions).length > 0 ? { versions } : {};
72
+ }
73
+
56
74
  /** A canvas slug the runtime can name (no path, no traversal) — the same rule the bus applies. */
57
75
  export const SAFE_SLUG = /^[A-Za-z0-9_.-]{1,200}$/;
58
76
 
@@ -99,7 +117,9 @@ const ATTENTION = new Set(['conflict', 'stuck', 'referenced-but-unoffered', 'loc
99
117
 
100
118
  /** Words for the per-file states a person has to look at (file-ledger.ts owns the union). */
101
119
  export const DELIVERY_WORD = Object.freeze({
102
- conflict: 'conflict — the older copy is in the trash',
120
+ // 2.1.1 T14 — this Mac's version is parked BESIDE the file (not in the trash); the row that names the
121
+ // copy is `lists.fileConflicts`. This is the line for a conflict whose copy is not parked yet.
122
+ conflict: 'changed here and in the project — sync is sorting it out',
103
123
  stuck: 'stuck',
104
124
  'referenced-but-unoffered': 'used, never received',
105
125
  'local-only': 'only on this Mac',
@@ -108,6 +128,51 @@ export const DELIVERY_WORD = Object.freeze({
108
128
  'hub-only': 'on the hub only',
109
129
  });
110
130
 
131
+ /** 2.1.1 T14 — the lane words a set-aside notice carries (`sync/accepted-cold-start.ts` `SET_ASIDE_WORDS`). */
132
+ const SET_ASIDE_LANE_WORD = Object.freeze({
133
+ meta: 'layout',
134
+ annotations: 'sticky notes',
135
+ comments: 'comments',
136
+ });
137
+ const SET_ASIDE_PREFIX = 'set-aside-';
138
+
139
+ /**
140
+ * 2.1.1 T14 — the canvases whose layout, sticky notes or comments the server's version replaced after a
141
+ * first link (the runtime's `set-aside-<slug>` notices): this Mac's are kept in the canvas's recovery
142
+ * folder. `{ slug, lanes: ['layout', …], where }`; a slug the runtime could not have made is dropped.
143
+ */
144
+ export function setAsideRows(status) {
145
+ const out = [];
146
+ for (const n of Array.isArray(status?.notices) ? status.notices : []) {
147
+ if (!n || typeof n.id !== 'string' || !n.id.startsWith(SET_ASIDE_PREFIX)) continue;
148
+ const slug = n.id.slice(SET_ASIDE_PREFIX.length);
149
+ if (!SAFE_SLUG.test(slug) || out.some((r) => r.slug === slug)) continue;
150
+ const lanes = (Array.isArray(n.lanes) ? n.lanes : [])
151
+ .map((l) => SET_ASIDE_LANE_WORD[l])
152
+ .filter(Boolean)
153
+ .filter((w, i, all) => all.indexOf(w) === i);
154
+ out.push({ slug, lanes, where: `_history/${slug}/sync-recovery` });
155
+ }
156
+ return out.slice(0, 50);
157
+ }
158
+
159
+ /** "layout", "layout and comments", "layout, sticky notes and comments" */
160
+ export function laneList(lanes) {
161
+ if (lanes.length < 2) return lanes[0] ?? 'version';
162
+ return `${lanes.slice(0, -1).join(', ')} and ${lanes[lanes.length - 1]}`;
163
+ }
164
+
165
+ /** The sentence a set-aside row says (CONTRACT §4: what happened · what is safe). */
166
+ export function setAsideWords(name, lanes) {
167
+ const many = lanes.length > 1 || lanes[0] === 'sticky notes' || lanes[0] === 'comments';
168
+ return `${cleanName(name, 'This canvas')}: the server’s ${laneList(lanes)} ${many ? 'are' : 'is'} used; yours ${many ? 'are' : 'is'} kept.`;
169
+ }
170
+
171
+ /** The sentence a file-conflict row says: which copy is the file, where yours is. */
172
+ export function fileConflictWords(copyName) {
173
+ return `The server’s version is the file; yours is kept beside it as ${cleanName(copyName, 'a copy')}.`;
174
+ }
175
+
111
176
  const thousands = (n) => String(n).replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
112
177
 
113
178
  export function syncDetailsModel(
@@ -169,6 +234,36 @@ export function syncDetailsModel(
169
234
  .filter((f) => f && typeof f.folder === 'string' && isCount(f.count))
170
235
  .slice(0, 10)
171
236
  .map((f) => ({ folder: f.folder, count: f.count })),
237
+ // 2.1.1 N4 — the held set this card shows; the answer carries it back (a set that grew since
238
+ // answers `changed` and nothing is sent)
239
+ digest:
240
+ typeof deletesOut.digest === 'string' && /^[0-9a-f]{16,64}$/.test(deletesOut.digest)
241
+ ? deletesOut.digest
242
+ : '',
243
+ });
244
+ }
245
+ // 2.1.1 T13 — the project deleted a batch this Mac still holds: its own card and answer (Remove
246
+ // here too · Keep them here), the incoming twin of the card above.
247
+ const deletesIn = held.find((h) => h.kind === 'delete-in' && isCount(h.count) && h.count > 0);
248
+ if (deletesIn) {
249
+ needs.push({
250
+ kind: 'deletes-incoming',
251
+ count: deletesIn.count,
252
+ detail: cleanName(
253
+ deletesIn.detail,
254
+ 'The project deleted files that are still on this Mac.',
255
+ HELD_DETAIL_MAX
256
+ ),
257
+ folders: (Array.isArray(deletesIn.folders) ? deletesIn.folders : [])
258
+ .filter((f) => f && typeof f.folder === 'string' && isCount(f.count))
259
+ .slice(0, 10)
260
+ .map((f) => ({ folder: f.folder, count: f.count })),
261
+ // 2.1.1 T8 — the held set this card shows; the answer carries it back (a set that changed
262
+ // since answers `changed` and nothing is removed)
263
+ digest:
264
+ typeof deletesIn.digest === 'string' && /^[0-9a-f]{16,64}$/.test(deletesIn.digest)
265
+ ? deletesIn.digest
266
+ : '',
172
267
  });
173
268
  }
174
269
  const purge = files?.deletePurge;
@@ -198,6 +293,18 @@ export function syncDetailsModel(
198
293
  attention.sort((a, b) => a[0].localeCompare(b[0]));
199
294
  hubOnly.sort((a, b) => a.localeCompare(b));
200
295
  }
296
+ // 2.1.1 T14 — a file in conflict whose copy is parked beside it gets its own row naming the copy;
297
+ // the generic attention list keeps the rest (a conflict whose copy is not parked yet included).
298
+ const copies =
299
+ files?.conflictCopies && typeof files.conflictCopies === 'object' ? files.conflictCopies : {};
300
+ const fileConflicts = [];
301
+ const attentionRest = [];
302
+ for (const [rel, state] of attention) {
303
+ const copy = state === 'conflict' ? copies[rel] : undefined;
304
+ if (typeof copy === 'string' && copy && !copy.includes('..') && !copy.startsWith('/')) {
305
+ fileConflicts.push({ rel, copy, copyName: copy.slice(copy.lastIndexOf('/') + 1) });
306
+ } else attentionRest.push([rel, state]);
307
+ }
201
308
 
202
309
  const counts = [];
203
310
  if (progress) {
@@ -242,17 +349,20 @@ export function syncDetailsModel(
242
349
  lists: {
243
350
  // `delete-out` is the Needs you card above (its own answer), not a second row here.
244
351
  held: held
245
- .filter((h) => !(deletesOut && h === deletesOut))
352
+ .filter((h) => !(deletesOut && h === deletesOut) && !(deletesIn && h === deletesIn))
246
353
  .map((h) => ({
247
354
  kind: h.kind,
248
355
  detail: cleanName(h.detail, 'Sync paused — nothing was removed.', HELD_DETAIL_MAX),
249
356
  paths: Array.isArray(h.paths)
250
357
  ? h.paths.filter((p) => typeof p === 'string').slice(0, 50)
251
358
  : [],
359
+ ...withVersions(h.files),
252
360
  })),
253
361
  rateLimited: files?.rateLimited ? { waiting: rateLimited } : null,
254
362
  failed,
255
- attention: attention.slice(0, 50),
363
+ attention: attentionRest.slice(0, 50),
364
+ fileConflicts: fileConflicts.slice(0, 50),
365
+ setAside: setAsideRows(status),
256
366
  // Issue #207 (7b) — deleted on this Mac and kept on the hub: listed, never "waiting".
257
367
  hubOnly: { count: hubOnly.length, paths: hubOnly.slice(0, 50) },
258
368
  // Issue #207 — a long run of pictures going up (a render sequence), and the folders this
@@ -2,7 +2,8 @@
2
2
  // Sync, rebuilt. The controls carry the v1 hooks the e2e scenarios drive (S11.12b): sync-panel (root) ·
3
3
  // sync-ai-held · sync-ai-publish · sync-ai-discard · sync-assets-cancel · sync-signin-again ·
4
4
  // sync-delivery-attention · sync-deletes-held (+ -delete / -keep / -confirm / -cancel / -said /
5
- // -folders / -confirming) · sync-deletes-purging · sync-hub-only. Replaces the v1 Sync panel's mount in the sheet (its routes stay; SyncPanel.jsx and
5
+ // -folders / -confirming) · sync-kept (+ sync-file-conflict-<i> / -reveal-<i> / sync-set-aside-<i> /
6
+ // -reveal-<i>, 2.1.1 T14) · sync-deletes-incoming (+ -remove / -keep / -said / -folders) · sync-deletes-purging · sync-hub-only. Replaces the v1 Sync panel's mount in the sheet (its routes stay; SyncPanel.jsx and
6
7
  // SourceConflictPanel.jsx keep their files). What needs the person comes first, each with its own
7
8
  // choice; the transfer, the counts and the lists follow.
8
9
  //
@@ -17,7 +18,17 @@ import { safeDetail, syncPresentation } from '../../../../sync/presentation.ts';
17
18
  import { lineDiff } from '../../../panels/SourceConflictPanel.jsx';
18
19
  import { readCodeConsent } from '../../code/code-consent.js';
19
20
  import { CodeConsentSheet } from '../../code/code-consent-sheet.jsx';
20
- import { DELIVERY_WORD, cleanName, resolvedWords, syncDetailsModel } from './sync-details-model.js';
21
+ import { menuRunner } from '../../shell/menu-runner.js';
22
+ import { nativeDoors, projectRel } from '../../shell/native-doors.js';
23
+ import {
24
+ DELIVERY_WORD,
25
+ cleanName,
26
+ fileConflictWords,
27
+ resolvedWords,
28
+ setAsideWords,
29
+ syncDetailsModel,
30
+ } from './sync-details-model.js';
31
+ import { UNSYNCED_SHOWN, groupByCanvas, readUnsyncedRefs } from './unsynced-refs.js';
21
32
 
22
33
  /** Registry id → the `choice` the conflict route takes. */
23
34
  export const CONFLICT_PICK = Object.freeze({
@@ -208,6 +219,68 @@ function CodeConsentButton({ mode, host, fetchImpl, onDone }) {
208
219
  );
209
220
  }
210
221
 
222
+ /**
223
+ * #167 T5.3 — held rows whose way out is the canvas folders: the hub's code-held list (the owner's
224
+ * read) and this Mac's own canvases outside the canvas folders (item 6). "Open canvas folders"
225
+ * (`sync.open-canvas-folders`) opens config.json, where they are set — a native door, so only in
226
+ * the Mac app; the row's sentence names the verb everywhere.
227
+ */
228
+ export const FOLDERS_HELD_KINDS = new Set(['code-held', 'canvas-outside-folders']);
229
+
230
+ /** The shown version of a held file: "1.2 KB · version a1b2c3d4" (the hub's sha, first 8). */
231
+ export function heldVersionWords(v) {
232
+ const n = v.size;
233
+ const size =
234
+ n < 1000
235
+ ? `${n} ${n === 1 ? 'byte' : 'bytes'}`
236
+ : n < 1_000_000
237
+ ? `${(n / 1000).toFixed(1)} KB`
238
+ : `${(n / 1_000_000).toFixed(1)} MB`;
239
+ return `${size} · version ${v.sha256.slice(0, 8)}`;
240
+ }
241
+
242
+ /** Said when the hub names no version for a held file (an older hub): nothing to adopt safely. */
243
+ const ADOPT_NEEDS_VERSION =
244
+ 'This file can’t be adopted until Maude and the project’s hub are both up to date. Nothing changed.';
245
+
246
+ /** "Adopt as code" (`sync.adopt-as-code`) on one file of the hub's code-held list — owner only:
247
+ * that list reaches the owner alone, and the hub's door refuses anyone else. It sends the version
248
+ * the row shows (`version.sha256`); the hub adopts those bytes and no others (burndown F4). */
249
+ function AdoptButton({ rel, index, version, fetchImpl }) {
250
+ const [said, setSaid] = useState(version ? null : ADOPT_NEEDS_VERSION);
251
+ const [busy, setBusy] = useState(false);
252
+ if (said)
253
+ return (
254
+ <span className="dg-hint" data-testid={`diag-sync-held-adopt-said-${index}`}>
255
+ {said}
256
+ </span>
257
+ );
258
+ return (
259
+ <button
260
+ type="button"
261
+ className="sd-link"
262
+ data-action="sync.adopt-as-code"
263
+ data-testid={`diag-sync-held-adopt-${index}`}
264
+ disabled={busy}
265
+ onClick={async () => {
266
+ setBusy(true);
267
+ const r = await postJson(fetchImpl, '/_api/sync/adopt-held', {
268
+ path: rel,
269
+ sha256: version.sha256,
270
+ });
271
+ setBusy(false);
272
+ setSaid(
273
+ r?.ok
274
+ ? 'Kept as code. It syncs on the next pass.'
275
+ : cleanName(r?.detail || r?.message, 'That didn’t work. Nothing changed.', 200)
276
+ );
277
+ }}
278
+ >
279
+ Adopt as code
280
+ </button>
281
+ );
282
+ }
283
+
211
284
  const filesWord = (n) => `${n.toLocaleString('en-US')} ${n === 1 ? 'file' : 'files'}`;
212
285
 
213
286
  /** Issue #207 (7b) — the words after an answer to held deletes (CONTRACT §3–§4: plain, no "we"). */
@@ -234,7 +307,12 @@ function HeldDeletesCard({ need, fetchImpl }) {
234
307
  async function answer(kind) {
235
308
  setBusy(true);
236
309
  setSaid('');
237
- const r = await postJson(fetchImpl, '/_api/sync/held-deletes', { answer: kind, folder: null });
310
+ // 2.1.1 N4 — the answer names the set on screen (`need.digest`), never "whatever is held now"
311
+ const r = await postJson(fetchImpl, '/_api/sync/held-deletes', {
312
+ answer: kind,
313
+ folder: null,
314
+ digest: need.digest,
315
+ });
238
316
  setBusy(false);
239
317
  setConfirming(false);
240
318
  setSaid(heldDeletesWords(r));
@@ -312,6 +390,86 @@ function HeldDeletesCard({ need, fetchImpl }) {
312
390
  );
313
391
  }
314
392
 
393
+ /** 2.1.1 T13 — the words after an answer to a batch the project deleted (CONTRACT §3–§4). */
394
+ export function heldIncomingWords(answer) {
395
+ // 2.1.1 T8 — the held set changed after the card was drawn: the card redraws with the new one
396
+ if (answer?.reason === 'changed')
397
+ return 'The list changed. Nothing was removed — look at it again.';
398
+ if (!answer?.ok) return safeDetail(answer?.detail, 'That didn’t work. Nothing was removed.');
399
+ if (answer.how === 'kept-here')
400
+ return `Kept here. ${filesWord(answer.count)} stay on this Mac and aren’t sent back.`;
401
+ return `Removing ${filesWord(answer.count)}. They’re moving to the trash.`;
402
+ }
403
+
404
+ /**
405
+ * 2.1.1 T13 — the project deleted a batch larger than sync removes unasked, and this Mac still has
406
+ * the files. Remove here too files them into the trash in one pass (recoverable); Keep them here
407
+ * leaves them and never sends them back. Both `POST /_api/sync/held-deletes` (this Mac only).
408
+ */
409
+ function HeldIncomingCard({ need, fetchImpl }) {
410
+ const [busy, setBusy] = useState(false);
411
+ const [said, setSaid] = useState('');
412
+ const [done, setDone] = useState(false);
413
+ async function answer(kind) {
414
+ setBusy(true);
415
+ setSaid('');
416
+ // 2.1.1 T8 — the answer names the set on screen (`need.digest`), never "whatever is held now"
417
+ const r = await postJson(fetchImpl, '/_api/sync/held-deletes', {
418
+ answer: kind,
419
+ folder: null,
420
+ digest: need.digest,
421
+ });
422
+ setBusy(false);
423
+ setSaid(heldIncomingWords(r));
424
+ if (r?.ok) setDone(true);
425
+ }
426
+ return (
427
+ <div className="sd-card" data-testid="sync-deletes-incoming">
428
+ <strong className="sd-ct">Deleted by the project · {filesWord(need.count)}</strong>
429
+ <span className="sd-cd">{need.detail}</span>
430
+ {need.folders.length ? (
431
+ <ul className="sd-failed" data-testid="sync-deletes-incoming-folders">
432
+ {need.folders.map((f) => (
433
+ <li key={f.folder}>
434
+ <span className="dg-mono">{cleanName(f.folder, 'the project folder')}</span>{' '}
435
+ {filesWord(f.count)}
436
+ </li>
437
+ ))}
438
+ </ul>
439
+ ) : null}
440
+ {done ? null : (
441
+ <div className="sd-acts">
442
+ <button
443
+ type="button"
444
+ className="dg-btn"
445
+ data-action="sync.remove-held-here"
446
+ data-testid="sync-deletes-incoming-remove"
447
+ disabled={busy}
448
+ onClick={() => answer('remove-here')}
449
+ >
450
+ Remove here too
451
+ </button>
452
+ <button
453
+ type="button"
454
+ className="dg-btn"
455
+ data-action="sync.keep-held-here"
456
+ data-testid="sync-deletes-incoming-keep"
457
+ disabled={busy}
458
+ onClick={() => answer('keep-here')}
459
+ >
460
+ Keep them here
461
+ </button>
462
+ </div>
463
+ )}
464
+ {said ? (
465
+ <p className="dg-hint" role="status" data-testid="sync-deletes-incoming-said">
466
+ {said}
467
+ </p>
468
+ ) : null}
469
+ </div>
470
+ );
471
+ }
472
+
315
473
  /** Issue #207 (7b) — the owner's purge of held deletes: how far it is, or why it stopped. */
316
474
  function DeletesPurgingCard({ need }) {
317
475
  return (
@@ -494,17 +652,142 @@ function FoldersSection({ sequences, ignored, fetchImpl }) {
494
652
  );
495
653
  }
496
654
 
655
+ /**
656
+ * #158 — files a canvas uses that will not reach the workspace. One issue row per canvas, each file
657
+ * with why and the way out, in the server's words (the terminal and the smoke report say the same).
658
+ * Read-only on purpose: the fix is a move or a rename in the project, not a button here. Calm — the
659
+ * canvas works on this Mac; the row says what a teammate would miss.
660
+ */
661
+ /**
662
+ * 2.1.1 T14 — what a first link kept of this Mac's: the copy beside a file that differed, and the
663
+ * layout, sticky notes or comments the server's version replaced (kept in the canvas's recovery
664
+ * folder). Nothing here needs an answer; each row says what happened, that it is safe, and — in the
665
+ * Mac app — offers Show in Finder.
666
+ */
667
+ function KeptSection({ fileConflicts, setAside, names, designRel, native }) {
668
+ const [said, setSaid] = useState('');
669
+ if (!fileConflicts.length && !setAside.length) return null;
670
+ async function reveal(rel) {
671
+ const r = await nativeDoors().revealPath(projectRel(designRel, rel));
672
+ setSaid(
673
+ r?.ok ? '' : cleanName(r?.error, 'Finder couldn’t open that. The copy is still there.')
674
+ );
675
+ }
676
+ return (
677
+ <section aria-label="Kept on this Mac" data-testid="sync-kept">
678
+ <p className="sd-sub">Kept on this Mac · {fileConflicts.length + setAside.length}</p>
679
+ {fileConflicts.map((c, i) => (
680
+ <div className="sd-card" key={c.rel} data-testid={`sync-file-conflict-${i}`}>
681
+ <strong className="sd-ct dg-mono">{cleanName(c.rel, '(unnamed)')}</strong>
682
+ <span className="sd-cd">{fileConflictWords(c.copyName)}</span>
683
+ {native ? (
684
+ <div className="sd-acts">
685
+ <button
686
+ type="button"
687
+ className="dg-btn"
688
+ data-testid={`sync-file-conflict-reveal-${i}`}
689
+ onClick={() => reveal(c.copy)}
690
+ >
691
+ Show in Finder
692
+ </button>
693
+ </div>
694
+ ) : null}
695
+ </div>
696
+ ))}
697
+ {setAside.map((r, i) => (
698
+ <div className="sd-card" key={r.slug} data-testid={`sync-set-aside-${i}`}>
699
+ <strong className="sd-ct">
700
+ {setAsideWords(names?.get?.(r.slug) ?? r.slug, r.lanes)}
701
+ </strong>
702
+ <span className="sd-cd">
703
+ Kept in <span className="dg-mono">{r.where}</span>.
704
+ </span>
705
+ {native ? (
706
+ <div className="sd-acts">
707
+ <button
708
+ type="button"
709
+ className="dg-btn"
710
+ data-testid={`sync-set-aside-reveal-${i}`}
711
+ onClick={() => reveal(r.where)}
712
+ >
713
+ Show in Finder
714
+ </button>
715
+ </div>
716
+ ) : null}
717
+ </div>
718
+ ))}
719
+ {said ? (
720
+ <p className="dg-hint" role="status" data-testid="sync-kept-said">
721
+ {said}
722
+ </p>
723
+ ) : null}
724
+ </section>
725
+ );
726
+ }
727
+
728
+ function useUnsyncedRefs(fetchImpl) {
729
+ const [refs, setRefs] = useState([]);
730
+ useEffect(() => {
731
+ let live = true;
732
+ readUnsyncedRefs(fetchImpl).then((r) => {
733
+ if (live) setRefs(r);
734
+ });
735
+ return () => {
736
+ live = false;
737
+ };
738
+ }, [fetchImpl]);
739
+ return refs;
740
+ }
741
+
742
+ function UnsyncedSection({ refs }) {
743
+ if (!refs.length) return null;
744
+ const groups = groupByCanvas(refs);
745
+ const shown = groups.slice(0, UNSYNCED_SHOWN);
746
+ const more = groups.length - shown.length;
747
+ return (
748
+ <section aria-label="Files that stay on this Mac" data-testid="sync-unsynced">
749
+ <p className="sd-sub">
750
+ Files that stay on this Mac · {groups.length} {groups.length === 1 ? 'canvas' : 'canvases'}
751
+ </p>
752
+ {shown.map((g, i) => (
753
+ <div className="sd-card" key={g.canvas} data-testid={`sync-unsynced-${i}`}>
754
+ <strong className="sd-ct">{g.title}</strong>
755
+ <span className="sd-cd">
756
+ It opens here. The people you share with won’t get{' '}
757
+ {g.files.length === 1 ? 'this file' : 'these files'}:
758
+ </span>
759
+ {g.files.map((f) => (
760
+ <span className="sd-cd" key={f.file}>
761
+ <span className="dg-mono">{f.file}</span> — {f.detail} {f.fix}
762
+ </span>
763
+ ))}
764
+ </div>
765
+ ))}
766
+ {more > 0 ? (
767
+ <p className="dg-hint">
768
+ And {more} more {more === 1 ? 'canvas' : 'canvases'}. `maude design status` lists them
769
+ all.
770
+ </p>
771
+ ) : null}
772
+ </section>
773
+ );
774
+ }
775
+
497
776
  export default function SyncDetails({
498
777
  status,
499
778
  project,
500
779
  cloud,
501
780
  native = false,
502
781
  names = null,
782
+ // 2.1.1 T14 — the design root's project-relative folder, for Show in Finder on a kept copy
783
+ designRel = '.design',
503
784
  onSignInAgain,
504
785
  fetchImpl = fetch,
505
786
  // p8-held-conflict-status — open this held conflict's Compare (a slug), once per new `focusSeq`
506
787
  focusConflict = null,
507
788
  focusSeq = 0,
789
+ // #167 T5.3 — a held row's registry actions (sync.open-canvas-folders) run through the one runner
790
+ runAction = (id, params) => menuRunner.run(id, params),
508
791
  }) {
509
792
  const p = syncPresentation(status, { project });
510
793
  const m = syncDetailsModel(status, { project, cloud, native, refused: p?.phase === 'refused' });
@@ -512,6 +795,7 @@ export default function SyncDetails({
512
795
  const codeHeld = m.lists.held.find((h) => h.kind === 'code-consent');
513
796
  const [consent, setConsent] = useCodeConsent(fetchImpl, codeHeld ? codeHeld.paths.length + 1 : 0);
514
797
  const canChange = consent?.changeable === true;
798
+ const unsynced = useUnsyncedRefs(fetchImpl);
515
799
  return (
516
800
  <div className="sd" data-testid="sync-panel">
517
801
  <div className="dg-hd">
@@ -540,7 +824,19 @@ export default function SyncDetails({
540
824
  ) : need.kind === 'assets-stay' ? (
541
825
  <AssetsStayCard key="assets-stay" />
542
826
  ) : need.kind === 'deletes-held' ? (
543
- <HeldDeletesCard key="deletes-held" need={need} fetchImpl={fetchImpl} />
827
+ // a new held set is a new card (its answer, confirm and words start over)
828
+ <HeldDeletesCard
829
+ key={`deletes-held-${need.digest}`}
830
+ need={need}
831
+ fetchImpl={fetchImpl}
832
+ />
833
+ ) : need.kind === 'deletes-incoming' ? (
834
+ // a new held set is a new card (its answer and words start over)
835
+ <HeldIncomingCard
836
+ key={`deletes-incoming-${need.digest}`}
837
+ need={need}
838
+ fetchImpl={fetchImpl}
839
+ />
544
840
  ) : need.kind === 'deletes-purging' ? (
545
841
  <DeletesPurgingCard key="deletes-purging" need={need} />
546
842
  ) : (
@@ -591,6 +887,16 @@ export default function SyncDetails({
591
887
  fetchImpl={fetchImpl}
592
888
  />
593
889
 
890
+ <UnsyncedSection refs={unsynced} />
891
+
892
+ <KeptSection
893
+ fileConflicts={m.lists.fileConflicts}
894
+ setAside={m.lists.setAside}
895
+ names={names}
896
+ designRel={designRel || '.design'}
897
+ native={native}
898
+ />
899
+
594
900
  {m.counts.length ? (
595
901
  <section aria-label="Counts" data-testid="diag-sync-counts">
596
902
  <p className="sd-sub">Counts</p>
@@ -613,11 +919,42 @@ export default function SyncDetails({
613
919
  <details className="sd-held" data-testid={`diag-sync-held-${h.kind}`}>
614
920
  <summary>{h.detail}</summary>
615
921
  <ul>
616
- {h.paths.map((rel) => (
617
- <li key={rel}>{cleanName(rel)}</li>
922
+ {h.paths.map((rel, i) => (
923
+ <li key={rel}>
924
+ {cleanName(rel)}
925
+ {h.kind === 'code-held' ? (
926
+ <>
927
+ {h.versions?.[rel] ? (
928
+ <>
929
+ {' '}
930
+ <span className="dg-hint" data-testid={`diag-sync-held-version-${i}`}>
931
+ {heldVersionWords(h.versions[rel])}
932
+ </span>
933
+ </>
934
+ ) : null}{' '}
935
+ <AdoptButton
936
+ rel={rel}
937
+ index={i}
938
+ version={h.versions?.[rel] ?? null}
939
+ fetchImpl={fetchImpl}
940
+ />
941
+ </>
942
+ ) : null}
943
+ </li>
618
944
  ))}
619
945
  </ul>
620
946
  </details>
947
+ {FOLDERS_HELD_KINDS.has(h.kind) && native ? (
948
+ <button
949
+ type="button"
950
+ className="sd-link"
951
+ data-action="sync.open-canvas-folders"
952
+ data-testid={`diag-sync-held-open-folders-${h.kind}`}
953
+ onClick={() => runAction('sync.open-canvas-folders')}
954
+ >
955
+ Open canvas folders
956
+ </button>
957
+ ) : null}
621
958
  {h.kind === 'code-consent' && canChange && !consent.allowed ? (
622
959
  <CodeConsentButton
623
960
  mode="allow"