@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
@@ -27,6 +27,7 @@
27
27
  "menuRows": {
28
28
  "all": [
29
29
  "account.switch",
30
+ "ai.chat",
30
31
  "artboard.new-a4",
31
32
  "artboard.new-desktop",
32
33
  "artboard.new-laptop",
@@ -93,6 +94,7 @@
93
94
  "view.hidden-files",
94
95
  "view.inspector",
95
96
  "view.inspector-on-select",
97
+ "view.layers",
96
98
  "view.layers-panel",
97
99
  "view.minimap",
98
100
  "view.pages",
@@ -142,9 +144,12 @@
142
144
  "select.none": ["edit"],
143
145
  "select.all-annotations": ["edit"],
144
146
  "view.panels": ["view"],
147
+ "view.layers": ["view"],
148
+ "view.inspector": ["view"],
145
149
  "view.comments": ["view"],
146
150
  "view.assets": ["view"],
147
151
  "view.exports": ["view"],
152
+ "ai.chat": ["view"],
148
153
  "view.annotations": ["view"],
149
154
  "view.pages": ["view"],
150
155
  "mode.preview": ["view"],
@@ -156,7 +161,6 @@
156
161
  "view.zoom-fit": ["view"],
157
162
  "view.zoom-actual": ["view"],
158
163
  "view.layers-panel": ["view", "advanced"],
159
- "view.inspector": ["view", "advanced"],
160
164
  "view.inspector-on-select": ["view", "advanced"],
161
165
  "view.timeline-keep-open": ["view", "advanced"],
162
166
  "view.minimap": ["view", "advanced"],
@@ -278,9 +282,12 @@
278
282
  "select.none",
279
283
  "select.all-annotations",
280
284
  "view.panels",
285
+ "view.layers",
286
+ "view.inspector",
281
287
  "view.comments",
282
288
  "view.assets",
283
289
  "view.exports",
290
+ "ai.chat",
284
291
  "view.annotations",
285
292
  "view.pages",
286
293
  "mode.preview",
@@ -292,7 +299,6 @@
292
299
  "view.zoom-fit",
293
300
  "view.zoom-actual",
294
301
  "view.layers-panel",
295
- "view.inspector",
296
302
  "view.inspector-on-select",
297
303
  "view.timeline-keep-open",
298
304
  "view.minimap",
@@ -441,28 +447,35 @@
441
447
  "testid": "settings-single-keys",
442
448
  "section": "general"
443
449
  },
450
+ {
451
+ "testid": "settings-terminal-opens",
452
+ "section": "general"
453
+ },
444
454
  {
445
455
  "testid": "cloud-account",
446
- "section": "connections"
456
+ "section": "general",
457
+ "conditional": true
447
458
  },
448
459
  {
449
- "testid": "settings-github",
450
- "section": "connections"
460
+ "testid": "settings-hub-address",
461
+ "section": "general",
462
+ "conditional": true
451
463
  },
452
464
  {
453
- "testid": "settings-ai-keys",
454
- "section": "connections"
465
+ "testid": "settings-team-server-add",
466
+ "section": "general",
467
+ "conditional": true
455
468
  },
456
469
  {
457
- "testid": "figma-connect-card",
470
+ "testid": "settings-github",
458
471
  "section": "connections"
459
472
  },
460
473
  {
461
- "testid": "settings-hub-address",
474
+ "testid": "settings-ai-keys",
462
475
  "section": "connections"
463
476
  },
464
477
  {
465
- "testid": "settings-team-server-add",
478
+ "testid": "figma-connect-card",
466
479
  "section": "connections"
467
480
  },
468
481
  {
@@ -507,19 +520,23 @@
507
520
  },
508
521
  {
509
522
  "testid": "sync-setting-syncFiles",
510
- "section": "advanced"
523
+ "section": "general",
524
+ "conditional": true
511
525
  },
512
526
  {
513
527
  "testid": "sync-setting-syncFiles",
514
- "section": "advanced"
528
+ "section": "general",
529
+ "conditional": true
515
530
  },
516
531
  {
517
532
  "testid": "sync-setting-firstAnchor",
518
- "section": "advanced"
533
+ "section": "general",
534
+ "conditional": true
519
535
  },
520
536
  {
521
537
  "testid": "sync-ownership-adopt",
522
- "section": "advanced"
538
+ "section": "general",
539
+ "conditional": true
523
540
  },
524
541
  {
525
542
  "testid": "settings-runtime",
@@ -662,6 +679,8 @@
662
679
  "select.none",
663
680
  "select.all-annotations",
664
681
  "view.panels",
682
+ "view.layers",
683
+ "view.inspector",
665
684
  "view.comments",
666
685
  "view.assets",
667
686
  "view.exports",
@@ -676,7 +695,6 @@
676
695
  "view.zoom-fit",
677
696
  "view.zoom-actual",
678
697
  "view.layers-panel",
679
- "view.inspector",
680
698
  "view.inspector-on-select",
681
699
  "view.timeline-keep-open",
682
700
  "view.minimap",
@@ -716,7 +734,8 @@
716
734
  "nav.home": "Back to Home is for desktop and cloud only",
717
735
  "project.pull-copy": "Pull a local copy… is for desktop only",
718
736
  "project.share-github": "Share on GitHub… is for desktop only",
719
- "account.switch": "Sign in as another account… is for desktop and cloud only"
737
+ "account.switch": "Switch account… is for desktop and cloud only",
738
+ "ai.chat": "AI chat is for desktop and cloud only"
720
739
  }
721
740
  },
722
741
  "share-cluster": {
@@ -829,26 +848,29 @@
829
848
  },
830
849
  {
831
850
  "testid": "cloud-account",
832
- "section": "connections"
851
+ "section": "general",
852
+ "conditional": true
833
853
  },
834
854
  {
835
- "testid": "settings-github",
836
- "section": "connections"
855
+ "testid": "settings-hub-address",
856
+ "section": "general",
857
+ "conditional": true
837
858
  },
838
859
  {
839
- "testid": "settings-ai-keys",
840
- "section": "connections"
860
+ "testid": "settings-team-server-add",
861
+ "section": "general",
862
+ "conditional": true
841
863
  },
842
864
  {
843
- "testid": "figma-connect-card",
865
+ "testid": "settings-github",
844
866
  "section": "connections"
845
867
  },
846
868
  {
847
- "testid": "settings-hub-address",
869
+ "testid": "settings-ai-keys",
848
870
  "section": "connections"
849
871
  },
850
872
  {
851
- "testid": "settings-team-server-add",
873
+ "testid": "figma-connect-card",
852
874
  "section": "connections"
853
875
  },
854
876
  {
@@ -889,19 +911,23 @@
889
911
  },
890
912
  {
891
913
  "testid": "sync-setting-syncFiles",
892
- "section": "advanced"
914
+ "section": "general",
915
+ "conditional": true
893
916
  },
894
917
  {
895
918
  "testid": "sync-setting-syncFiles",
896
- "section": "advanced"
919
+ "section": "general",
920
+ "conditional": true
897
921
  },
898
922
  {
899
923
  "testid": "sync-setting-firstAnchor",
900
- "section": "advanced"
924
+ "section": "general",
925
+ "conditional": true
901
926
  },
902
927
  {
903
928
  "testid": "sync-ownership-adopt",
904
- "section": "advanced"
929
+ "section": "general",
930
+ "conditional": true
905
931
  },
906
932
  {
907
933
  "testid": "settings-runtime",
@@ -1049,9 +1075,12 @@
1049
1075
  "select.none",
1050
1076
  "select.all-annotations",
1051
1077
  "view.panels",
1078
+ "view.layers",
1079
+ "view.inspector",
1052
1080
  "view.comments",
1053
1081
  "view.assets",
1054
1082
  "view.exports",
1083
+ "ai.chat",
1055
1084
  "view.annotations",
1056
1085
  "view.pages",
1057
1086
  "mode.preview",
@@ -1063,7 +1092,6 @@
1063
1092
  "view.zoom-fit",
1064
1093
  "view.zoom-actual",
1065
1094
  "view.layers-panel",
1066
- "view.inspector",
1067
1095
  "view.inspector-on-select",
1068
1096
  "view.timeline-keep-open",
1069
1097
  "view.minimap",
@@ -1089,7 +1117,7 @@
1089
1117
  "diag.ai-recheck",
1090
1118
  "settings.open"
1091
1119
  ],
1092
- "disabled": [],
1120
+ "disabled": ["ai.chat"],
1093
1121
  "ctx": {
1094
1122
  "shell": "cloud",
1095
1123
  "role": "owner"
@@ -1318,9 +1346,12 @@
1318
1346
  "select.none",
1319
1347
  "select.all-annotations",
1320
1348
  "view.panels",
1349
+ "view.layers",
1350
+ "view.inspector",
1321
1351
  "view.comments",
1322
1352
  "view.assets",
1323
1353
  "view.exports",
1354
+ "ai.chat",
1324
1355
  "view.annotations",
1325
1356
  "view.pages",
1326
1357
  "mode.preview",
@@ -1332,7 +1363,6 @@
1332
1363
  "view.zoom-fit",
1333
1364
  "view.zoom-actual",
1334
1365
  "view.layers-panel",
1335
- "view.inspector",
1336
1366
  "view.inspector-on-select",
1337
1367
  "view.timeline-keep-open",
1338
1368
  "view.minimap",
@@ -1358,7 +1388,7 @@
1358
1388
  "diag.ai-recheck",
1359
1389
  "settings.open"
1360
1390
  ],
1361
- "disabled": [],
1391
+ "disabled": ["ai.chat"],
1362
1392
  "ctx": {
1363
1393
  "shell": "cloud",
1364
1394
  "role": "owner"
@@ -1572,9 +1602,12 @@
1572
1602
  "select.all",
1573
1603
  "select.none",
1574
1604
  "view.panels",
1605
+ "view.layers",
1606
+ "view.inspector",
1575
1607
  "view.comments",
1576
1608
  "view.assets",
1577
1609
  "view.exports",
1610
+ "ai.chat",
1578
1611
  "view.annotations",
1579
1612
  "view.pages",
1580
1613
  "mode.preview",
@@ -1586,7 +1619,6 @@
1586
1619
  "view.zoom-fit",
1587
1620
  "view.zoom-actual",
1588
1621
  "view.layers-panel",
1589
- "view.inspector",
1590
1622
  "view.inspector-on-select",
1591
1623
  "view.timeline-keep-open",
1592
1624
  "view.minimap",
@@ -1619,7 +1651,8 @@
1619
1651
  "edit.undo-history",
1620
1652
  "edit.cut",
1621
1653
  "edit.paste",
1622
- "edit.paste-properties"
1654
+ "edit.paste-properties",
1655
+ "ai.chat"
1623
1656
  ],
1624
1657
  "ctx": {
1625
1658
  "shell": "cloud",
@@ -1831,6 +1864,8 @@
1831
1864
  "select.all",
1832
1865
  "select.none",
1833
1866
  "view.panels",
1867
+ "view.layers",
1868
+ "view.inspector",
1834
1869
  "view.comments",
1835
1870
  "view.assets",
1836
1871
  "view.exports",
@@ -1845,7 +1880,6 @@
1845
1880
  "view.zoom-fit",
1846
1881
  "view.zoom-actual",
1847
1882
  "view.layers-panel",
1848
- "view.inspector",
1849
1883
  "view.inspector-on-select",
1850
1884
  "view.timeline-keep-open",
1851
1885
  "view.minimap",
@@ -1906,8 +1940,9 @@
1906
1940
  "import.figma": "Import from Figma… needs edit rights",
1907
1941
  "import.brand": "Import a brand… needs edit rights",
1908
1942
  "video.assemble": "Assemble clips into a video needs edit rights",
1909
- "account.switch": "Sign in as another account… is for desktop and cloud only",
1943
+ "account.switch": "Switch account… is for desktop and cloud only",
1910
1944
  "select.all-annotations": "Select all annotations needs edit rights",
1945
+ "ai.chat": "AI chat is for desktop and cloud only",
1911
1946
  "sync.resync": "Resync now needs edit rights"
1912
1947
  }
1913
1948
  },
@@ -0,0 +1,194 @@
1
+ // client/v2/shell/still-bridge.js — #212 §5 (T2.2): the shell's side of the persisted overview stills.
2
+ //
3
+ // The canvas frame (untrusted origin, DDR-054) posts `stills-want { file }` once and `still-put { file, artboard,
4
+ // sig, bytes }` for each still it drew. Before reading or writing anything the shell checks, in order:
5
+ // 1. origin + the `active` gate (acceptFromCanvas): `e.source` is the shell's own iframe for `activePath`;
6
+ // 2. `file === activePath` — the frame's word may only NARROW the shell's own state, never pick the canvas;
7
+ // 3. that iframe's own `src` is a plain open (no version `sha`, embed, follow, hide-chrome, thumbnail);
8
+ // 4. the project index has a row for the canvas.
9
+ // Then it picks the key itself: the index `pid`, a SHA-256 of the frame's capability for that canvas (`frameCapFor`,
10
+ // C4 — per subject and per canvas) and the index row's source hashes. The answer (`stills`) goes to that window
11
+ // alone, once per window, its buffers transferred.
12
+ //
13
+ // A WRITE needs one thing more: no sibling. Every canvas frame mounted at once shares the one canvas origin, so a
14
+ // sibling can run code in the active frame's realm (the C4 named gap) and post `still-put` as it — a forged still
15
+ // that would outlive the sibling. So the shell stores nothing while another frame of the canvas origin is mounted,
16
+ // and nothing for the rest of the session once one was (`createSiblingGuard`: the sibling may have changed the
17
+ // active frame's realm, or the origin's own state, before it left).
18
+ // Contract: client/v2/contracts/212-still-cache.md §5.
19
+
20
+ import { acceptFromCanvas } from '../../../bridge/dgn-protocol.ts';
21
+ import { frameCapFor, sha256 } from '../../frame-cap.js';
22
+ import { indexSnapshotNow } from '../canvases/use-canvas-index.js';
23
+ import { stillStore } from './still-store.js';
24
+
25
+ export const STILL_BRIDGE_TYPES = Object.freeze(['stills-want', 'still-put']);
26
+ /** How long a `stills-want` waits for the first index snapshot (ms). */
27
+ export const STILL_INDEX_WAIT_MS = 4000;
28
+ /** A frame opened with any of these is not today's plain canvas: nothing is stored or answered for it. */
29
+ const NOT_PLAIN = ['sha', 'embed', 'follow', 'hide-chrome', 'thumbnail'];
30
+
31
+ /**
32
+ * The sibling guard: watches the shell's own iframes (kept-alive tabs, the System gallery, a version view — any
33
+ * frame) and remembers every origin that ever had two frames mounted at once. `mayWrite(frame, origin)`: `frame`
34
+ * is the only frame of `origin` mounted now, and no two ever were this session.
35
+ * `doc`/`Observer` are injectable (tests); a missing one = no guard = no write.
36
+ */
37
+ export function createSiblingGuard({
38
+ doc = typeof document !== 'undefined' ? document : null,
39
+ Observer = typeof MutationObserver === 'function' ? MutationObserver : null,
40
+ } = {}) {
41
+ if (!doc || typeof doc.querySelectorAll !== 'function' || !Observer) return null;
42
+ const crowded = new Set();
43
+ const originOf = (f) => {
44
+ const src = f?.src || f?.getAttribute?.('src');
45
+ if (typeof src !== 'string' || !src) return null;
46
+ try {
47
+ const o = new URL(src, doc.baseURI || undefined).origin;
48
+ return o && o !== 'null' ? o : null;
49
+ } catch {
50
+ return null;
51
+ }
52
+ };
53
+ const framesOf = (origin) =>
54
+ [...doc.querySelectorAll('iframe')].filter((f) => originOf(f) === origin);
55
+ const sweep = () => {
56
+ const count = new Map();
57
+ for (const f of doc.querySelectorAll('iframe')) {
58
+ const o = originOf(f);
59
+ if (o) count.set(o, (count.get(o) ?? 0) + 1);
60
+ }
61
+ for (const [o, n] of count) if (n > 1) crowded.add(o);
62
+ };
63
+ const isFrame = (n) => n?.nodeName === 'IFRAME' || !!n?.querySelector?.('iframe');
64
+ const obs = new Observer((records) => {
65
+ for (const r of records ?? [])
66
+ if (isFrame(r.target) || [...(r.addedNodes ?? [])].some(isFrame)) return void sweep();
67
+ });
68
+ obs.observe(doc, { subtree: true, childList: true, attributes: true, attributeFilter: ['src'] });
69
+ sweep();
70
+ return {
71
+ mayWrite(frame, origin) {
72
+ sweep();
73
+ if (!frame || crowded.has(origin)) return false;
74
+ const fs = framesOf(origin);
75
+ return fs.length === 1 && fs[0] === frame;
76
+ },
77
+ stop: () => obs.disconnect(),
78
+ };
79
+ }
80
+
81
+ /** The page's guard: started when the shell loads this module, before any canvas frame is mounted. */
82
+ const pageGuard = createSiblingGuard();
83
+ /** Frame windows already answered: one `stills-want` answer per window. */
84
+ const answeredWins = new WeakSet();
85
+
86
+ export const isStillBridgeMessage = (m) =>
87
+ !!m && typeof m === 'object' && (m.dgn === 'stills-want' || m.dgn === 'still-put');
88
+
89
+ /** A plain open of the canvas: the shell's own iframe `src` carries no version / embed / follow / capture flag. */
90
+ export function plainFrameSrc(src) {
91
+ if (typeof src !== 'string' || !src) return false;
92
+ let q;
93
+ try {
94
+ q = new URL(src, 'http://x').searchParams;
95
+ } catch {
96
+ return false;
97
+ }
98
+ return !NOT_PLAIN.some((k) => q.has(k));
99
+ }
100
+
101
+ const designRelOf = (path, designRel) => {
102
+ const root = String(designRel || '.design').replace(/^\/+|\/+$/g, '');
103
+ return root && path.startsWith(`${root}/`) ? path.slice(root.length + 1) : path;
104
+ };
105
+
106
+ /** The first index snapshot (the Canvases panel's read), waited for up to `ms`. */
107
+ function snapshotSoon(index, ms) {
108
+ const now = index.get();
109
+ if (now || ms <= 0) return Promise.resolve(now);
110
+ return new Promise((res) => {
111
+ let off = () => {};
112
+ const t = setTimeout(() => {
113
+ off();
114
+ res(index.get());
115
+ }, ms);
116
+ off = index.subscribe(() => {
117
+ const s = index.get();
118
+ if (!s) return;
119
+ clearTimeout(t);
120
+ off();
121
+ res(s);
122
+ });
123
+ });
124
+ }
125
+
126
+ const hex = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');
127
+ /** The stored scope: a SHA-256 of the frame capability (or of the plain path) — never the capability itself. */
128
+ export const stillScopeOf = (cap) =>
129
+ hex(sha256(new TextEncoder().encode(`maude-still-scope-v1\n${cap}`)));
130
+
131
+ /**
132
+ * The key parts for the active canvas, or null when there is no key to give (no row, no pid).
133
+ * `scope` = a SHA-256 of the frame's capability (C4) — a MAC over the canvas path under the opener's per-subject key.
134
+ */
135
+ export function stillKeyFor(snapshot, { activePath, designRel, frameKey }) {
136
+ if (!snapshot || typeof snapshot.pid !== 'string' || !snapshot.pid) return null;
137
+ const rel = designRelOf(activePath, designRel);
138
+ const row = Array.isArray(snapshot.canvases)
139
+ ? snapshot.canvases.find((c) => c?.rel === rel)
140
+ : null;
141
+ if (!row || typeof row.srcHash !== 'string' || !row.srcHash) return null;
142
+ const scope = stillScopeOf(frameCapFor(frameKey, rel) ?? `rel:${rel}`);
143
+ const src = `${row.srcHash}:${row.metaHash ?? '-'}:${row.depsHash ?? '-'}`;
144
+ return { pid: snapshot.pid, scope, src };
145
+ }
146
+
147
+ /**
148
+ * One canvas→shell still message. `ctx`: `{ canvasOrigin, activePath, frame (the shell's iframe element for
149
+ * activePath), designRel, frameKey, store?, index?, waitMs?, guard? }`. Resolves to what it did (tests read it):
150
+ * 'refused' | 'siblings' | 'stored' | 'not-stored' | 'answered' | 'once' | 'no-key'.
151
+ */
152
+ export async function handleStillBridge(e, ctx) {
153
+ const win = ctx.frame?.contentWindow ?? null;
154
+ const activePath = ctx.activePath;
155
+ if (!win || typeof activePath !== 'string' || !activePath) return 'refused';
156
+ const m = acceptFromCanvas(e, { canvasOrigin: ctx.canvasOrigin, active: win });
157
+ if (!m || (m.dgn !== 'stills-want' && m.dgn !== 'still-put')) return 'refused';
158
+ if (m.file !== activePath) return 'refused';
159
+ const src = ctx.frame.getAttribute?.('src') ?? ctx.frame.src;
160
+ if (!plainFrameSrc(src)) return 'refused';
161
+ const index = ctx.index ?? indexSnapshotNow;
162
+ const store = ctx.store ?? stillStore();
163
+ const keyCtx = { activePath, designRel: ctx.designRel, frameKey: ctx.frameKey };
164
+ if (m.dgn === 'still-put') {
165
+ const guard = ctx.guard === undefined ? pageGuard : ctx.guard;
166
+ if (!guard?.mayWrite(ctx.frame, ctx.canvasOrigin)) return 'siblings';
167
+ const key = stillKeyFor(index.get(), keyCtx);
168
+ if (!key) return 'no-key';
169
+ const ok = await store.put({ ...key, artboard: m.artboard, sig: m.sig, bytes: m.bytes });
170
+ return ok ? 'stored' : 'not-stored';
171
+ }
172
+ if (answeredWins.has(win)) return 'once';
173
+ answeredWins.add(win);
174
+ const snap = await snapshotSoon(index, ctx.waitMs ?? STILL_INDEX_WAIT_MS);
175
+ const key = stillKeyFor(snap, keyCtx);
176
+ if (!key) return 'no-key';
177
+ const items = await store.list(key);
178
+ // the frame may have changed canvas while the store answered: then it gets nothing
179
+ if (
180
+ ctx.frame?.contentWindow !== win ||
181
+ !plainFrameSrc(ctx.frame.getAttribute?.('src') ?? ctx.frame.src)
182
+ )
183
+ return 'refused';
184
+ try {
185
+ win.postMessage(
186
+ { dgn: 'stills', file: activePath, items },
187
+ ctx.canvasOrigin,
188
+ items.map((it) => it.bytes)
189
+ );
190
+ } catch {
191
+ /* detached */
192
+ }
193
+ return 'answered';
194
+ }