@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
@@ -123,6 +123,9 @@ export interface SyncNotice {
123
123
  * which config key opts out. */
124
124
  text: string;
125
125
  severity: 'info' | 'warn';
126
+ /** 2.1.1 T14 — `set-aside-<slug>`: which of this Mac's lanes (`meta` · `annotations` · `comments`)
127
+ * the project's version replaced, so Sync details can name them without parsing `text`. */
128
+ lanes?: string[];
126
129
  at: number;
127
130
  }
128
131
 
@@ -131,7 +134,7 @@ export interface FilePlaneStatus {
131
134
  synced: number;
132
135
  /** Cumulative files landed this boot. */
133
136
  pulled: number;
134
- /** Cumulative conflicts this boot (either winner); losers are in _trash/. */
137
+ /** Cumulative conflicts this boot: the project's version is the file, this Mac's is parked beside it. */
135
138
  conflicts: number;
136
139
  /** Sync v2 — cumulative files sent UP this boot. The v1 lane had no push
137
140
  * half of its own, so this is absent on a journal-less hub. */
@@ -169,11 +172,20 @@ export interface FilePlaneStatus {
169
172
  /** 2.0.5: files the legacy (v1) pull could not save here; retried later, less often. */
170
173
  | 'pull-failed'
171
174
  /** fix/207: shared code this Mac holds until the person allows it (Allow shared code…). */
172
- | 'code-consent';
175
+ | 'code-consent'
176
+ /** #167 T5.3: canvases outside the canvas folders, not offered while none are declared. */
177
+ | 'canvas-outside-folders';
173
178
  count: number;
174
179
  paths: string[];
175
180
  /** Issue #207 (7b) — `delete-out`: the folders the held deletes sit in, largest first. */
176
181
  folders?: { folder: string; count: number }[];
182
+ /** 2.1.1 T8 — `delete-in`: a fingerprint of every held path; the answer carries it back. */
183
+ digest?: string;
184
+ /** `code-held`: the version of each listed file on the hub (an older hub names none) — the row
185
+ * shows it and "Adopt as code" sends the sha, so the hub adopts exactly what was shown. */
186
+ files?: { path: string; sha256: string; size: number }[];
187
+ /** #167 T5.3 — `code-held`: the hub could not name every held file (more are held than listed). */
188
+ overflow?: true;
177
189
  /** One sentence, in the user's terms, about what is waiting and why. */
178
190
  detail: string;
179
191
  }[];
@@ -246,6 +258,11 @@ export interface FilePlaneStatus {
246
258
  * emits. Same bounding shape `items`/`itemsTruncated` already uses.
247
259
  */
248
260
  deliveryTruncated?: number;
261
+ /**
262
+ * 2.1.1 T14 — files in `conflict` whose copy of this Mac's version sits beside them:
263
+ * `{ "<file>": "<copy>" }`, both relative to the design root. Sync details names the copy.
264
+ */
265
+ conflictCopies?: Record<string, string>;
249
266
  /**
250
267
  * THE DENOMINATOR (feature-large-project-seed).
251
268
  *
@@ -0,0 +1,397 @@
1
+ // Issue #158 — which files a linked canvas needs that never reach the workspace.
2
+ //
3
+ // A canvas builds fine on the Mac that has every file, so a canvas whose import sits in a `_helpers/`
4
+ // folder, or whose stylesheet names a font outside `assets/`, opens for its author and fails for the
5
+ // next person — silently. This is the read-only diagnostic that says so ahead of time: it walks each
6
+ // canvas's relative imports (the closure's own import grammar, access/closure.ts) and its stylesheet
7
+ // `url()` refs, judges every file it reaches against the sync set (the membership classifier,
8
+ // sync/file-membership.ts) and names the file and the reason.
9
+ //
10
+ // READ-ONLY IN BOTH DIRECTIONS. It never changes what syncs: `classifyProjectFile` and the push
11
+ // listing (`asset-push.ts` `listPushableAssets`) are only CALLED, with the same answer they give the
12
+ // plane — a test pins that the predicate's answers are untouched. And it reads the disk only (no
13
+ // network, no hub, no token), so `maude design status`, the smoke report and the Sync details panel
14
+ // can all ask it for the same answer.
15
+ //
16
+ // One thing the disk cannot tell it: whether the receiving side accepts shared code (the owner-hub
17
+ // gate). A `.ts` module outside a canvas is counted as travelling when file sync is on.
18
+
19
+ import { type Dirent, lstatSync, readdirSync, readFileSync } from 'node:fs';
20
+ import { join, posix, resolve } from 'node:path';
21
+
22
+ import { IMPORTABLE_EXT_RE, relativeImportSpecs, specCandidates } from '../access/closure.ts';
23
+ import { isCanvasSource } from '../skip-dirs.ts';
24
+ import {
25
+ classifyProjectFile,
26
+ isFilePlaneClass,
27
+ isProjectFileShape,
28
+ isRuntimeStateRel,
29
+ } from './file-membership.ts';
30
+ import { isIgnoredRel, normalizeIgnoreFolders } from './file-plane.ts';
31
+
32
+ export type UnsyncedReason =
33
+ | 'runtime-state'
34
+ | 'config'
35
+ | 'ignored-folder'
36
+ | 'symlink'
37
+ | 'underscore-folder'
38
+ | 'sync-files-off'
39
+ | 'extension'
40
+ | 'path-shape'
41
+ | 'missing'
42
+ | 'outside-root'
43
+ | 'import-extension';
44
+
45
+ export interface UnsyncedRef {
46
+ /** The canvas whose walk reached it (designRoot-relative). */
47
+ canvas: string;
48
+ /** The file that will not reach the workspace (designRoot-relative; the specifier for `outside-root`). */
49
+ file: string;
50
+ /** The specifier or url as written. */
51
+ ref: string;
52
+ via: 'import' | 'css-url';
53
+ reason: UnsyncedReason;
54
+ /** One sentence: why. */
55
+ detail: string;
56
+ /** One sentence: the way out. */
57
+ fix: string;
58
+ }
59
+
60
+ export interface UnsyncedReport {
61
+ /** The project names a workspace; an unlinked project is not checked. */
62
+ linked: boolean;
63
+ /** File sync is on (default on). */
64
+ syncFiles: boolean;
65
+ /** Canvases walked. */
66
+ canvases: number;
67
+ refs: UnsyncedRef[];
68
+ }
69
+
70
+ const WORDS: Record<UnsyncedReason, { why: (folder?: string) => string; fix: string }> = {
71
+ 'runtime-state': {
72
+ why: () => "It is Maude's own working data, kept on each Mac",
73
+ fix: 'Move what the canvas needs out of that folder.',
74
+ },
75
+ config: {
76
+ why: () => "The project's config is never shared",
77
+ fix: 'Move what the canvas needs into its own file.',
78
+ },
79
+ 'ignored-folder': {
80
+ why: () => 'Its folder is set not to sync',
81
+ fix: 'Sync that folder again in Sync details, or move the file.',
82
+ },
83
+ symlink: {
84
+ why: () => 'It is a link, and only real files are shared',
85
+ fix: 'Copy the file into the project.',
86
+ },
87
+ 'underscore-folder': {
88
+ why: (f) => `It is in ${f ?? 'a folder'}, and folders starting with _ stay on this Mac`,
89
+ fix: 'Rename the folder without the _.',
90
+ },
91
+ 'sync-files-off': {
92
+ why: () => 'This project shares only pictures, video and fonts inside assets/',
93
+ fix: 'Move it into assets/, or turn on file sync in Settings › Advanced.',
94
+ },
95
+ extension: {
96
+ why: () => 'This kind of file is not shared',
97
+ fix: 'Keep it as code or a stylesheet, or put it in assets/.',
98
+ },
99
+ 'path-shape': {
100
+ why: () => "Its name or place can't be shared",
101
+ fix: 'Rename or move it.',
102
+ },
103
+ missing: {
104
+ why: () => 'It is not in this project',
105
+ fix: 'Add it back, or fix the import.',
106
+ },
107
+ 'outside-root': {
108
+ why: () => 'It points outside the design folder',
109
+ fix: 'Move the file into the design folder.',
110
+ },
111
+ 'import-extension': {
112
+ why: () => 'A canvas can only import code, stylesheets and JSON',
113
+ fix: 'Put pictures and fonts in assets/ and refer to them by path.',
114
+ },
115
+ };
116
+
117
+ const MODULE_RE = /\.(tsx|ts|jsx|js|mjs|cjs)$/i;
118
+ const CSS_RE = /\.css$/i;
119
+ const MAX_TEXT_BYTES = 1_500_000;
120
+ const MAX_WALK_DIRS = 4000;
121
+
122
+ type Probe = 'file' | 'link' | null;
123
+
124
+ export interface UnsyncedInput {
125
+ /** What sits at a designRoot-relative path: a real file, a link, or nothing. */
126
+ probe(rel: string): Probe;
127
+ text(rel: string): string | null;
128
+ /** Every canvas candidate (`.tsx` in a canvas group). */
129
+ canvasCandidates: readonly string[];
130
+ canvasGroups?: readonly { path?: string }[];
131
+ syncFiles: boolean;
132
+ ignoreFolders?: readonly string[];
133
+ /** Absolute design root — `specCandidates` clamps against it. */
134
+ designRoot: string;
135
+ }
136
+
137
+ /** `css url(...)` targets that are files of the project, in source order. */
138
+ function cssUrlRefs(css: string): string[] {
139
+ const text = css.replace(/\/\*[\s\S]*?\*\//g, '');
140
+ const out: string[] = [];
141
+ const re = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)\s"']+))\s*\)/gi;
142
+ for (let m = re.exec(text); m !== null; m = re.exec(text)) {
143
+ const raw = (m[1] ?? m[2] ?? m[3] ?? '').trim();
144
+ if (!raw || raw.startsWith('#') || raw.startsWith('/') || raw.includes('${')) continue;
145
+ if (/^[a-z][a-z0-9+.-]*:/i.test(raw) || raw.startsWith('var(')) continue; // data:, https:, …
146
+ const clean = raw.replace(/[?#].*$/, '');
147
+ if (clean) out.push(clean);
148
+ }
149
+ return out;
150
+ }
151
+
152
+ function decode(p: string): string {
153
+ try {
154
+ return decodeURIComponent(p);
155
+ } catch {
156
+ return p;
157
+ }
158
+ }
159
+
160
+ /** The pure walk. */
161
+ export function unsyncedRefs(input: UnsyncedInput): { canvases: number; refs: UnsyncedRef[] } {
162
+ const { probe, designRoot } = input;
163
+ const ignore = [...(input.ignoreFolders ?? [])];
164
+ const classOpts = {
165
+ canvasGroups: input.canvasGroups,
166
+ hasFile: (r: string) => probe(r) === 'file',
167
+ };
168
+ const abs = (rel: string) => join(designRoot, ...rel.split('/'));
169
+ const relOf = (a: string) =>
170
+ posix.normalize(
171
+ a
172
+ .slice(resolve(designRoot).length + 1)
173
+ .split('\\')
174
+ .join('/')
175
+ );
176
+
177
+ /** Why a file that exists will not reach the workspace, or null when it does. */
178
+ const judge = (
179
+ rel: string,
180
+ via: 'import' | 'css-url'
181
+ ): { reason: UnsyncedReason; folder?: string } | null => {
182
+ if (isRuntimeStateRel(rel)) return { reason: 'runtime-state' };
183
+ if (rel === 'config.json') return { reason: 'config' };
184
+ if (ignore.length > 0 && isIgnoredRel(rel, ignore)) return { reason: 'ignored-folder' };
185
+ if (probe(rel) === 'link') return { reason: 'symlink' };
186
+ const cls = classifyProjectFile(rel, classOpts);
187
+ if (cls === 'never') {
188
+ const folder = rel
189
+ .split('/')
190
+ .slice(0, -1)
191
+ .find((p) => p.startsWith('_') || p.startsWith('.'));
192
+ if (folder) return { reason: 'underscore-folder', folder };
193
+ return { reason: isProjectFileShape(rel) ? 'extension' : 'path-shape' };
194
+ }
195
+ if (cls !== 'canvas-owned' && isFilePlaneClass(cls)) {
196
+ const underAssets = rel.split('/').slice(0, -1).includes('assets');
197
+ if (!input.syncFiles && !(cls === 'inert-media' && underAssets))
198
+ return { reason: 'sync-files-off' };
199
+ }
200
+ if (via === 'import' && !IMPORTABLE_EXT_RE.test(rel)) return { reason: 'import-extension' };
201
+ return null;
202
+ };
203
+
204
+ const canvases = input.canvasCandidates.filter(
205
+ (c) =>
206
+ probe(c) === 'file' &&
207
+ classifyProjectFile(c, classOpts) === 'canvas-owned' &&
208
+ isCanvasSource(input.text(c))
209
+ );
210
+ const refs: UnsyncedRef[] = [];
211
+ const reported = new Set<string>();
212
+
213
+ const report = (
214
+ canvas: string,
215
+ file: string,
216
+ ref: string,
217
+ via: 'import' | 'css-url',
218
+ reason: UnsyncedReason,
219
+ folder?: string
220
+ ) => {
221
+ const key = `${canvas}\0${file}\0${reason}`;
222
+ if (reported.has(key)) return;
223
+ reported.add(key);
224
+ const w = WORDS[reason];
225
+ refs.push({ canvas, file, ref, via, reason, detail: `${w.why(folder)}.`, fix: w.fix });
226
+ };
227
+
228
+ for (const canvas of canvases) {
229
+ const seen = new Set<string>([canvas]);
230
+ const queue: string[] = [canvas];
231
+ const sibling = canvas.replace(/\.tsx$/i, '.css');
232
+ if (probe(sibling) === 'file') {
233
+ seen.add(sibling);
234
+ queue.push(sibling);
235
+ }
236
+ while (queue.length > 0) {
237
+ const from = queue.shift() as string;
238
+ const body = input.text(from);
239
+ if (body === null) continue;
240
+ const css = CSS_RE.test(from);
241
+ const reach = (file: string, ref: string, via: 'import' | 'css-url') => {
242
+ const verdict = judge(file, via);
243
+ if (verdict) return report(canvas, file, ref, via, verdict.reason, verdict.folder);
244
+ if (!seen.has(file) && (MODULE_RE.test(file) || CSS_RE.test(file))) {
245
+ seen.add(file);
246
+ queue.push(file);
247
+ }
248
+ };
249
+ for (const spec of relativeImportSpecs(body, css)) {
250
+ const group = specCandidates(spec, abs(from), designRoot);
251
+ if (group.length === 0) {
252
+ report(
253
+ canvas,
254
+ posix.normalize(posix.join(posix.dirname(from), spec)),
255
+ spec,
256
+ 'import',
257
+ 'outside-root'
258
+ );
259
+ continue;
260
+ }
261
+ const rels = group.map(relOf);
262
+ const hit = rels.find((r) => probe(r) !== null);
263
+ if (hit === undefined) report(canvas, rels[0] as string, spec, 'import', 'missing');
264
+ else reach(hit, spec, 'import');
265
+ }
266
+ if (css) {
267
+ for (const raw of cssUrlRefs(body)) {
268
+ const joined = posix.normalize(posix.join(posix.dirname(from), decode(raw)));
269
+ if (joined.startsWith('../') || joined === '..') {
270
+ report(canvas, joined, raw, 'css-url', 'outside-root');
271
+ continue;
272
+ }
273
+ if (probe(joined) === null) report(canvas, joined, raw, 'css-url', 'missing');
274
+ else reach(joined, raw, 'css-url');
275
+ }
276
+ }
277
+ }
278
+ }
279
+ refs.sort((a, b) =>
280
+ a.canvas === b.canvas ? a.file.localeCompare(b.file) : a.canvas.localeCompare(b.canvas)
281
+ );
282
+ return { canvases: canvases.length, refs };
283
+ }
284
+
285
+ // ---------------------------------------------------------------------------------------- the disk
286
+
287
+ function readConfig(designRoot: string): Record<string, unknown> | null {
288
+ try {
289
+ const parsed = JSON.parse(readFileSync(join(designRoot, 'config.json'), 'utf8'));
290
+ return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
291
+ ? (parsed as Record<string, unknown>)
292
+ : null;
293
+ } catch {
294
+ return null;
295
+ }
296
+ }
297
+
298
+ /** The canvas-group folders as the file plane reads them (`['system', 'ui']` when none declared). */
299
+ function groupPaths(groups: readonly { path?: string }[] | undefined): string[] {
300
+ const out: string[] = [];
301
+ for (const g of groups ?? []) {
302
+ const p =
303
+ typeof g?.path === 'string' ? g.path.replace(/\\/g, '/').replace(/^\/+|\/+$/g, '') : '';
304
+ if (p && !p.split('/').some((s) => !s || s === '.' || s === '..') && !out.includes(p))
305
+ out.push(p);
306
+ }
307
+ return out.length > 0 ? out : ['system', 'ui'];
308
+ }
309
+
310
+ /** The `.tsx` files in the canvas groups; `_`-prefixed and dot folders are never canvases. */
311
+ function walkCandidates(designRoot: string, groups: readonly string[]): string[] {
312
+ const found: string[] = [];
313
+ let dirs = 0;
314
+ const walk = (rel: string) => {
315
+ if (++dirs > MAX_WALK_DIRS) return;
316
+ let entries: Dirent[];
317
+ try {
318
+ entries = readdirSync(join(designRoot, ...rel.split('/')), { withFileTypes: true });
319
+ } catch {
320
+ return;
321
+ }
322
+ for (const e of entries) {
323
+ if (e.name.startsWith('.') || e.name.startsWith('_') || e.name === 'node_modules') continue;
324
+ const child = `${rel}/${e.name}`;
325
+ if (e.isDirectory()) walk(child);
326
+ else if (e.isFile() && /\.tsx$/i.test(e.name)) found.push(child);
327
+ }
328
+ };
329
+ for (const g of groups) walk(g);
330
+ return found;
331
+ }
332
+
333
+ /** Walk a project's design root. `env` is the process environment (the `MAUDE_SYNC_FILES` default). */
334
+ export function unsyncedRefsOnDisk(
335
+ designRoot: string,
336
+ env: Record<string, string | undefined> = process.env
337
+ ): UnsyncedReport {
338
+ const cfg = readConfig(designRoot);
339
+ const hub = cfg?.linkedHub as Record<string, unknown> | undefined;
340
+ if (!hub || typeof hub.url !== 'string' || !hub.url) {
341
+ return { linked: false, syncFiles: true, canvases: 0, refs: [] };
342
+ }
343
+ // Mirrors `sync/index.ts` `fileSyncEnabled` / `asset-push.ts` `readProjectConfig`: on unless the
344
+ // project opts out (or the machine does, and the project did not opt in).
345
+ const syncFiles =
346
+ hub.syncFiles !== false && (env.MAUDE_SYNC_FILES !== '0' || hub.syncFiles === true);
347
+ const canvasGroups = Array.isArray(cfg?.canvasGroups)
348
+ ? (cfg?.canvasGroups as { path?: string }[])
349
+ : undefined;
350
+ const probe = (rel: string): Probe => {
351
+ try {
352
+ const st = lstatSync(join(designRoot, ...rel.split('/')));
353
+ return st.isSymbolicLink() ? 'link' : st.isFile() ? 'file' : null;
354
+ } catch {
355
+ return null;
356
+ }
357
+ };
358
+ const text = (rel: string): string | null => {
359
+ try {
360
+ const p = join(designRoot, ...rel.split('/'));
361
+ if (lstatSync(p).size > MAX_TEXT_BYTES) return null;
362
+ return readFileSync(p, 'utf8');
363
+ } catch {
364
+ return null;
365
+ }
366
+ };
367
+ const walked = unsyncedRefs({
368
+ probe,
369
+ text,
370
+ canvasCandidates: walkCandidates(designRoot, groupPaths(canvasGroups)),
371
+ canvasGroups,
372
+ syncFiles,
373
+ ignoreFolders: normalizeIgnoreFolders(hub.ignoreFolders),
374
+ designRoot: resolve(designRoot),
375
+ });
376
+ return { linked: true, syncFiles, ...walked };
377
+ }
378
+
379
+ // ----------------------------------------------------------------------------------------- the words
380
+
381
+ const noun = (n: number, one: string, many: string) => `${n} ${n === 1 ? one : many}`;
382
+
383
+ /**
384
+ * The report as terminal lines: a head that counts, then one line per file — canvas · file · why and
385
+ * the way out. Empty for an unlinked project or a clean one (nothing to say is nothing printed).
386
+ */
387
+ export function unsyncedLines(report: UnsyncedReport, limit = 12): string[] {
388
+ if (!report.linked || report.refs.length === 0) return [];
389
+ const files = new Set(report.refs.map((r) => r.file));
390
+ const canvases = new Set(report.refs.map((r) => r.canvas));
391
+ const head = `${noun(files.size, 'file', 'files')} used by ${noun(canvases.size, 'canvas', 'canvases')} won't reach the people you share with.`;
392
+ const lines = report.refs
393
+ .slice(0, limit)
394
+ .map((r) => `${r.canvas} · ${r.file} · ${r.detail} ${r.fix}`);
395
+ if (report.refs.length > limit) lines.push(`…and ${report.refs.length - limit} more.`);
396
+ return [head, ...lines];
397
+ }
@@ -450,6 +450,7 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
450
450
  '/_api/agent/run/end': { class: 'local' }, // V2-2.4b the design plugin's hooks (V2-1.11 §5.4)
451
451
  '/_api/agent/write/claim': { class: 'local' }, // p8-a1-claims — a disk-writing verb claims its bytes for its run
452
452
  '/_api/agent/bash/window': { class: 'local' }, // p8-a1-claims — a Bash call that cannot claim names its files
453
+ '/_api/agent/bash/settle': { class: 'local' }, // #164 — that call's post-call bytes, claimed for its run
453
454
  // --- this machine only
454
455
  '/_api/acp/activity': { class: 'local' },
455
456
  '/_api/acp/attachment': { class: 'local' },
@@ -522,6 +523,7 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
522
523
  '/_api/export-jobs': { class: 'local' },
523
524
  '/_api/export-jobs/download': { class: 'local' },
524
525
  '/_api/export-jobs/retry': { class: 'local' }, // S8.4 — re-runs a job's failed items; the files stay on this Mac
526
+ '/_api/export-jobs/cancel': { class: 'local' }, // #128 T3.7b — stops one of the session's unfinished exports; writes no project file
525
527
  '/_api/export-preflight': { class: 'local' }, // S8.7 — names and numbers about a print export, writes nothing
526
528
  '/_api/export-preview': { class: 'local' }, // P8 C2 — artboard stills of what an export reaches, from the picture service; writes nothing
527
529
  '/_api/export-warmup': { class: 'local' },
@@ -530,6 +532,9 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
530
532
  '/_api/generate/keys': { class: 'local' },
531
533
  '/_api/generate/whisper-model': { class: 'local' },
532
534
  '/_api/hub/link': { class: 'local' },
535
+ // 2.1.1 routes/hub-link-folder.ts: links THIS folder to the person's team server (the attach lane);
536
+ // the seed-up is the sync runtime's, never this route's
537
+ '/_api/hub/link-folder': { class: 'local' },
533
538
  '/_api/report': { class: 'local' },
534
539
  '/_api/report-fallback': { class: 'local' },
535
540
  '/_api/shell-shot': { class: 'local' },
@@ -541,9 +546,12 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
541
546
  '/_api/sync/link/confirm': { class: 'local', rows: 'X16' },
542
547
  // fix/207 — this Mac's shared-code consent: a per-Mac answer in the profile's hubs.json
543
548
  '/_api/sync/code-consent': { class: 'read' },
549
+ '/_api/sync/unsynced-refs': { class: 'read' }, // routes/sync.ts (#158): a disk read against the sync set, no effect
544
550
  '/_api/sync/code-consent/set': { class: 'local', rows: 'X16' },
545
551
  // 2.0.7 #7b — the answer to held local deletes: this Mac's ledger (Keep) or the hub's own doors (Delete)
546
552
  '/_api/sync/held-deletes': { class: 'local', rows: 'X16' },
553
+ // #167 T5.3 — Adopt as code: the hub's own owner door journals its bytes; nothing written here
554
+ '/_api/sync/adopt-held': { class: 'local', rows: 'X16' },
547
555
  // S11.17 — Retry lands the canvas writes a full disk held; each then travels like any studio write
548
556
  '/_api/diagnostics/disk-retry': { class: 'local' },
549
557
  // p8-a1-save-hold — the closing page lands the saves held behind an AI call; each then travels like any studio write
@@ -562,12 +570,24 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
562
570
  '/_api/hub-signin/poll': { class: 'local' },
563
571
  '/_api/hub-signin/cancel': { class: 'local' },
564
572
  '/_api/hub-signin/return': { class: 'local' },
573
+ // 2.1.1 T5 — "Link your server": a tokenless /health check of a typed address (writes nothing)
574
+ '/_api/hub-signin/check': { class: 'read' },
565
575
  // --- the V2-2.5 table (routes/*.ts) — classified by the lead (decision v2-2.5 classification)
566
576
  '/_api/outbox': { class: 'read' }, // routes/outbox.ts: the queue's view
567
577
  '/_api/outbox/:id': { class: 'read' },
568
578
  '/_api/outbox/:id/cancel': { class: 'local' }, // this machine's queue (_state/outbox)
569
579
  '/_api/outbox/:id/retry': { class: 'local' },
570
580
  '/_api/shell/status': { class: 'read' }, // routes/shell.ts: the desktop shell's probe — four counts, no effect
581
+ '/_api/shell/attest': { class: 'read' }, // routes/shell.ts (#206): one MAC over a nonce, no effect
582
+ // #122 (122-C) — the desktop shell carrying a clip between two project servers (shell/clip-transfer.ts):
583
+ // export / asset read a clip this server holds; import writes the clip's pictures into `assets/` (the
584
+ // Assets writer's content-addressed names, joining the file plane like any import) and keeps the clip
585
+ '/_api/shell/clip-export': { class: 'read' },
586
+ '/_api/shell/clip-asset': { class: 'read' },
587
+ '/_api/shell/clip-import': {
588
+ class: 'file-plane',
589
+ rows: 'S28/I08 (assets/<sha8> from another project)',
590
+ },
571
591
  '/_api/project/format': { class: 'read' }, // routes/project-format.ts
572
592
  '/_api/asset-state': { class: 'read' }, // routes/asset-state.ts (S8.19): disk + queue + hub presence, no effect
573
593
  // routes/asset-details.ts (S8.21): the details of one asset and the Generated runs — reads of the project's own sidecars
@@ -27,6 +27,7 @@ import { exportShimPath, resolveExportRuntime } from '../exporters/_runtime.ts';
27
27
  import { canvasShellUrl } from '../exporters/index.ts';
28
28
  import type { IndexService } from '../index/service.ts';
29
29
  import type { ArtboardKind, ArtboardRow, CanvasRow } from '../index/types.ts';
30
+ import { localCaptureUrl } from '../shell/capture-url.ts';
30
31
  import {
31
32
  assetKey,
32
33
  dsCssHash,
@@ -559,7 +560,9 @@ export function createThumbService(o: ThumbServiceOptions): ThumbService {
559
560
  {
560
561
  op: 'tile',
561
562
  // gate-b-c4 — `frame` scopes the capture to the canvas the tile imports (access/frame.ts).
562
- url: `${server}/_canvas-shell.html?hide-chrome=1&frame=${encodeURIComponent(job.rel)}`,
563
+ url: localCaptureUrl(
564
+ `${server}/_canvas-shell.html?hide-chrome=1&frame=${encodeURIComponent(job.rel)}`
565
+ ),
563
566
  expectOrigin: capture,
564
567
  src: `/${designRel}/${job.rel.split('/').map(encodeURIComponent).join('/')}`,
565
568
  video: job.video === true,
@@ -177,6 +177,9 @@ export function resolveInsertAnchor(
177
177
  return artboardId ? { artboardId, position: 'inside-end' } : null;
178
178
  }
179
179
 
180
+ /** #170 — the toolbar's popovers (Shape kinds, More, Sticky colours, Marker tips). */
181
+ const POPOVER_SELECTOR = '.dc-tp-shape-popover, .dc-tp-list-popover, .dc-tp-opts-popover';
182
+
180
183
  /** Fire a verb at the shell (a main-origin write; DDR-054 keeps the canvas itself write-free). */
181
184
  function postShell(msg: object): void {
182
185
  try {
@@ -573,6 +576,26 @@ export function ToolPalette() {
573
576
  };
574
577
  }, [open]);
575
578
 
579
+ // #170 (T2.4b) — the popovers open upward into the dock, where the shell's toast pill sits: tell the shell when one
580
+ // is in the DOM and when none is, so it moves its toasts out of the way (notifications.tsx). Said only on a change.
581
+ const popoverSaid = useRef(false);
582
+ useEffect(() => {
583
+ const shown = !!rootRef.current?.querySelector(POPOVER_SELECTOR);
584
+ if (shown === popoverSaid.current) return;
585
+ popoverSaid.current = shown;
586
+ if (typeof window !== 'undefined' && window.parent !== window)
587
+ postShell({ dgn: 'toolbar-popover', open: shown });
588
+ });
589
+ useEffect(
590
+ () => () => {
591
+ if (!popoverSaid.current) return;
592
+ popoverSaid.current = false;
593
+ if (typeof window !== 'undefined' && window.parent !== window)
594
+ postShell({ dgn: 'toolbar-popover', open: false });
595
+ },
596
+ []
597
+ );
598
+
576
599
  if (!mounted || slots.length === 0) return null;
577
600
 
578
601
  const armed = (t: ToolId | null): ToolId | null =>
@@ -31,6 +31,7 @@ import {
31
31
  } from './annotations/ui/tool-prefs.ts';
32
32
  import { verGt } from './client/whats-new-seen.js';
33
33
  import { isRecentColour } from './edit-ops/words-paint.ts';
34
+ import { type SpendSettings, validateSpendSettings } from './generation/spend.ts';
34
35
  import { PRESET_ID_RE } from './kinds/presets.ts';
35
36
  import { PREFS_VERSION } from './ui-prefs-migrate.ts';
36
37
 
@@ -103,6 +104,12 @@ export interface UiPrefs {
103
104
  * on read by the catalogue.
104
105
  */
105
106
  recentSizes?: string[];
107
+ /**
108
+ * The spend cap on paid media generation (Settings › Advanced › Generation spend), per Mac: USD per run,
109
+ * USD per day, and the single-job amount above which the person is asked. Absent = the defaults
110
+ * (generation/spend.ts). Bounded on write; a stored out-of-bounds value falls back on read.
111
+ */
112
+ generateSpend?: Partial<SpendSettings>;
106
113
  migratedFrom?: number;
107
114
  /**
108
115
  * Lossless reader (V2-1.12): any top-level field this build does not know round-trips untouched
@@ -314,6 +321,11 @@ export function validateUiPrefsPatch(body: Record<string, unknown>): UiPrefsPatc
314
321
  return fail(`recentSizes must be a list of up to ${RECENT_SIZES_MAX} size ids`);
315
322
  patch.recentSizes = [...new Set(v as string[])];
316
323
  }
324
+ if ('generateSpend' in body) {
325
+ const r = validateSpendSettings(body.generateSpend);
326
+ if (!r.ok) return fail(r.error);
327
+ patch.generateSpend = r.value;
328
+ }
317
329
  if ('annotationPrefs' in body) {
318
330
  const r = checkAnnotationPrefsPatch(body.annotationPrefs);
319
331
  if (!r.ok) return fail(r.error);
@@ -437,6 +449,33 @@ function readRaw(path: string): RawPrefs {
437
449
  }
438
450
 
439
451
  /** Current UI prefs merged over the defaults (defaults when missing/unreadable). */
452
+ /**
453
+ * #168 G3 — Recent colours are keyed by the SERVER's own root identity (`rootIdentity(repoRoot)`, http.ts), never a
454
+ * name the client sends: the page only ever writes and reads "this project" (`RECENT_HERE`). Two projects with one
455
+ * name no longer share a list, and no page reads or writes another project's.
456
+ */
457
+ export const RECENT_HERE = 'here';
458
+ const recentKeyOf = (rootId: string) => `root:${rootId}`;
459
+
460
+ /** POST: re-key the page's `RECENT_HERE` list by `rootId`, in place. Returns an error for any other key. */
461
+ export function scopeRecentColoursWrite(patch: Partial<UiPrefs>, rootId: string): string | null {
462
+ const rc = patch.recentColours;
463
+ if (rc === undefined) return null;
464
+ const keys = Object.keys(rc);
465
+ if (keys.length !== 1 || keys[0] !== RECENT_HERE)
466
+ return 'recentColours takes only this project’s list';
467
+ patch.recentColours = { [recentKeyOf(rootId)]: rc[RECENT_HERE] as string[] };
468
+ return null;
469
+ }
470
+
471
+ /** GET: serve only `rootId`'s list, as `RECENT_HERE`, in place — never another project's. */
472
+ export function scopeRecentColoursRead(prefs: Record<string, unknown>, rootId: string): void {
473
+ if (!('recentColours' in prefs)) return;
474
+ const map = plain(prefs.recentColours);
475
+ const mine = map[recentKeyOf(rootId)];
476
+ prefs.recentColours = Array.isArray(mine) ? { [RECENT_HERE]: mine } : {};
477
+ }
478
+
440
479
  export function readUiPrefs(): UiPrefs {
441
480
  const raw = readRaw(uiPrefsPath());
442
481
  return raw.kind === 'ok' ? coerce(raw.value) : { ...UI_PREFS_DEFAULTS };
@@ -479,6 +518,7 @@ export function writeUiPrefs(patch: Partial<UiPrefs>): UiPrefs {
479
518
  'canvasesSort',
480
519
  'recentColours',
481
520
  'annotationPrefs',
521
+ 'generateSpend',
482
522
  ] as const) {
483
523
  if (patch[k] !== undefined) merged[k] = { ...plain(cur[k]), ...plain(patch[k]) } as never;
484
524
  }
@@ -111,8 +111,8 @@ export function agentFunnyName(seed: string): string {
111
111
  }
112
112
 
113
113
  /**
114
- * Strip control chars + length-cap the author. The /_api/ai/start endpoint
115
- * caps it server-side, but the postMessage relay path never round-trips the
114
+ * Strip control chars + length-cap the author. The run registry names the agent
115
+ * server-side, but the postMessage relay path never round-trips the
116
116
  * server, so we re-bound it here at the trust boundary (DDR-078 security
117
117
  * follow-up) — keeps a spoofed `author` from bloating the badge even if the
118
118
  * origin guard below ever regresses.