@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
@@ -1,4 +1,15 @@
1
+ import {
2
+ addItem,
3
+ type ChecklistResult,
4
+ makeChecklist,
5
+ moveItem,
6
+ removeItem,
7
+ rewordItem,
8
+ tickItem,
9
+ withItemDeletes,
10
+ } from './annotations/checklist-ops.ts';
1
11
  import { MAX_BOARD_BYTES, MAX_ELEMENTS } from './annotations/constants.ts';
12
+ import { isChecklist, itemsByList } from './annotations/elements/checkitem.model.ts';
2
13
  import { fanOut, stackLanding, stackMembers } from './annotations/elements/sticky.model.ts';
3
14
  import { type HostRects, resolverFromRects } from './annotations/hosts.ts';
4
15
  import { guardLockedOps, isAllLocked, lockedStrokeIds } from './annotations/lock.ts';
@@ -38,6 +49,19 @@ import {
38
49
  } from './annotations/ui/arrow-cards.tsx';
39
50
  import { labelPatch, NEW_ARROW } from './annotations/ui/arrow-kinds.ts';
40
51
  import { BoardStore } from './annotations/ui/board.ts';
52
+ import {
53
+ type CheckEdit,
54
+ type ChecklistApi,
55
+ ChecklistContext,
56
+ progressWords,
57
+ } from './annotations/ui/checklist.tsx';
58
+ import {
59
+ checklistCommitOps,
60
+ isChecklistTarget,
61
+ itemPutsFor,
62
+ itemsForCopy,
63
+ splitPasteItems,
64
+ } from './annotations/ui/checklist-wire.ts';
41
65
  import {
42
66
  Containment,
43
67
  expandForOp,
@@ -423,6 +447,9 @@ function isBoardClipboard(txt: string): boolean {
423
447
 
424
448
  function isEditable(t: EventTarget | null): boolean {
425
449
  if (!t || !(t as HTMLElement).tagName) return false;
450
+ // #113 — a checklist row's keys are the registry's `checklist.*` (useCanvasKeys under `checkItemFocused`):
451
+ // the layer's own sticky keys (⌫ ↵ arrows ⌘C …) stand aside on it, like in a text field.
452
+ if (isChecklistTarget(t)) return true;
426
453
  const el = t as HTMLElement;
427
454
  const tag = el.tagName;
428
455
  if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;
@@ -691,6 +718,14 @@ const STICKY_RUN_ACTIONS: ReadonlySet<string> = new Set([
691
718
  'annotation.ask-ai',
692
719
  'annotations.trash-resolved',
693
720
  'annotations.select-resolved',
721
+ // #113 — the checklist rows from ⌘K / the menus (the keys reach the same code through useCanvasKeys)
722
+ 'annotation.make-checklist',
723
+ 'checklist.toggle',
724
+ 'checklist.edit',
725
+ 'checklist.add-below',
726
+ 'checklist.remove-empty',
727
+ 'checklist.move-up',
728
+ 'checklist.move-down',
694
729
  ]);
695
730
 
696
731
  const ANNOT_CSS = `
@@ -903,6 +938,8 @@ export interface StrokesStoreValue {
903
938
  * `annotation.fold`, `annotation.to-comment`) on the current selection. False when it does not apply.
904
939
  */
905
940
  runAction?: (id: string) => boolean;
941
+ /** #113 — does this sticky have checklist entries (the small toolbar offers "Turn into checklist" when not)? */
942
+ isChecklist?: (id: string) => boolean;
906
943
  /** The host a dragged arrow endpoint would bind to (halo), or null. */
907
944
  setBindHint?: (hostId: string | null) => void;
908
945
  /** Live size label + dimension-match halos while resizing, or null. */
@@ -934,7 +971,7 @@ export function useStrokesStore(): StrokesStoreValue | null {
934
971
  // the main tool palette, the in-canvas draw chrome, the minimap, and the
935
972
  // right-click menu. Clicks on these route to their own handlers.
936
973
  const CHROME_SELECTOR =
937
- '.dc-annot-conn-dot, .dc-annot-arrowui-live, .dc-annot-ctx, .dc-tool-palette, .dc-mm, .dc-context-menu, .dc-tp-popover, .dc-multi-artboard-tb, .dc-elem-ctx-tb, .dc-cv-eq-spacing-layer, .cm-composer, .cm-thread, .cm-mention-popup, .cm-pin, .dc-annot-resize-handle, .dc-annot-rotate-zone, .dc-annot-editor, [data-group-resize-corner]';
974
+ '.dc-annot-conn-dot, .dc-annot-arrowui-live, .dc-annot-ctx, .dc-tool-palette, .dc-mm, .dc-context-menu, .dc-tp-popover, .dc-multi-artboard-tb, .dc-elem-ctx-tb, .dc-cv-eq-spacing-layer, .cm-composer, .cm-thread, .cm-mention-popup, .cm-pin, .dc-annot-resize-handle, .dc-annot-rotate-zone, .dc-annot-editor, [data-group-resize-corner], [data-an-checklist]';
938
975
 
939
976
  const HINTS_KEY = 'maude-annot-hints-v1';
940
977
 
@@ -1037,6 +1074,19 @@ function scaleStrokeInGroup(
1037
1074
  }
1038
1075
 
1039
1076
  /** The copies of `ids` in a duplicate result (what to select afterwards). */
1077
+ /** #113 — two checklist gestures as one batch (a split = a reword + an add; ⌘↵ in an entry = a reword + a tick). */
1078
+ function joinChecklist(a: ChecklistResult | null, b: ChecklistResult): ChecklistResult {
1079
+ if (!a) return b;
1080
+ if (!a.ok) return a;
1081
+ if (!b.ok) return b;
1082
+ return { ok: true, ops: [...a.ops, ...b.ops], label: b.label };
1083
+ }
1084
+
1085
+ /** #113 — a fresh checklist entry id (the layer focuses the new row by it). */
1086
+ function mintCheckId(): string {
1087
+ return `ck_${Math.random().toString(36).slice(2, 10).padEnd(8, '0')}`;
1088
+ }
1089
+
1040
1090
  function cloneRoots(ids: readonly string[], res: { idMap: ReadonlyMap<string, string> }): string[] {
1041
1091
  return ids.map((id) => res.idMap.get(id)).filter((x): x is string => !!x);
1042
1092
  }
@@ -1517,7 +1567,14 @@ export function AnnotationsLayer() {
1517
1567
  * stays pending (re-applied over replica snapshots) until its echo arrives.
1518
1568
  */
1519
1569
  const sendOps = useCallback(
1520
- (ops: readonly AnnotationOp[], local = false, draft = false, sid?: string): Promise<void> => {
1570
+ (
1571
+ ops: readonly AnnotationOp[],
1572
+ local = false,
1573
+ draft = false,
1574
+ sid?: string,
1575
+ /** T7.3b (#113) — the gesture in words ("Ticked “…”"): the row ⌘Z names. Text only. */
1576
+ label?: string
1577
+ ): Promise<void> => {
1521
1578
  const file = fileRef.current;
1522
1579
  if (!file || !ops.length) return putChainRef.current;
1523
1580
  // p8-fix-d F13 — a draft's id says so: the home records it with the session's commit, one step.
@@ -1536,7 +1593,7 @@ export function AnnotationsLayer() {
1536
1593
  fetch('/_api/annotations/ops', {
1537
1594
  method: 'POST',
1538
1595
  headers: { 'Content-Type': 'application/json' },
1539
- body: JSON.stringify({ file, actionId, ops }),
1596
+ body: JSON.stringify({ file, actionId, ops, ...(label ? { label } : {}) }),
1540
1597
  })
1541
1598
  .then(async (r) => {
1542
1599
  // A refused save (403 read-only, 405 at a proxy door) previously
@@ -1574,11 +1631,11 @@ export function AnnotationsLayer() {
1574
1631
 
1575
1632
  /** Apply a batch here (optimistic) and send it. Returns what undoes it. */
1576
1633
  const applyOpsLocal = useCallback(
1577
- (ops: readonly AnnotationOp[], sid?: string): AnnotationOp[] => {
1634
+ (ops: readonly AnnotationOp[], sid?: string, label?: string): AnnotationOp[] => {
1578
1635
  if (!ops.length) return [];
1579
1636
  annotationsChangedRef.current = true;
1580
1637
  const r = board.apply(ops);
1581
- void sendOps(ops, true, false, sid);
1638
+ void sendOps(ops, true, false, sid, label);
1582
1639
  return r.inverse;
1583
1640
  },
1584
1641
  [board, sendOps]
@@ -1605,7 +1662,17 @@ export function AnnotationsLayer() {
1605
1662
  * inverse (peer-safe: it reverts only fields still holding our values).
1606
1663
  */
1607
1664
  const commitStrokes = useCallback(
1608
- (prev: readonly Stroke[], next: readonly Stroke[], label?: string) => {
1665
+ (
1666
+ prev: readonly Stroke[],
1667
+ next: readonly Stroke[],
1668
+ label?: string,
1669
+ /** #163 — `drag`: the person dragged the objects; only a drag adopts them into a section */
1670
+ opts?: {
1671
+ drag?: boolean;
1672
+ /** #113 — records with no stroke form (a copied checklist's entries) that ride in the same batch */
1673
+ extraOps?: readonly AnnotationOp[];
1674
+ }
1675
+ ) => {
1609
1676
  setPreview(null);
1610
1677
  // An upload still in flight is not on the board: it leaves the view
1611
1678
  // when this commit removes it or when its uploaded form lands.
@@ -1629,7 +1696,7 @@ export function AnnotationsLayer() {
1629
1696
  prevMap, // S4.16 — a new sticky over a video is pinned to the playhead (annotations/time-marks.ts)
1630
1697
  withMembership(
1631
1698
  prevMap,
1632
- strokesToElementMap(persist(next), committed),
1699
+ strokesToElementMap(persist(next), committed, { adoptOnMove: opts?.drag === true }),
1633
1700
  dragBusRef.current?.layoutRects() ?? []
1634
1701
  ),
1635
1702
  playheadOf
@@ -1638,7 +1705,12 @@ export function AnnotationsLayer() {
1638
1705
  // locked element (as of `prevMap`) is not moved, resized, re-texted or
1639
1706
  // deleted. The board re-renders from the store, so a blocked change
1640
1707
  // snaps back on its own.
1641
- const ops = guardLockedOps(prevMap, diffToOps(prevMap, nextMap)).ops;
1708
+ // #113 — a deleted checklist sticky takes its entries (the same batch, so the same ⌘Z), and a copy of one
1709
+ // brings its entries' puts (`extraOps`): the stroke view never carries entries.
1710
+ const ops = [
1711
+ ...withItemDeletes(committed, guardLockedOps(prevMap, diffToOps(prevMap, nextMap)).ops),
1712
+ ...(opts?.extraOps ?? []),
1713
+ ];
1642
1714
  // A text edit session's commit (Task 19): the board merges against what
1643
1715
  // the session last SENT (its drafts), while undo goes back to the text
1644
1716
  // before the edit. Drafts never reach undo.
@@ -1792,7 +1864,9 @@ export function AnnotationsLayer() {
1792
1864
  const res = unlockCopies(duplicateStrokes(prev, withSubtree(ids), dx, dy));
1793
1865
  if (res.strokes.length === prev.length) return [];
1794
1866
  const added = res.strokes.length - prev.length;
1795
- commitStrokes(prev, res.strokes, `duplicate ${added} stroke${added === 1 ? '' : 's'}`);
1867
+ commitStrokes(prev, res.strokes, `duplicate ${added} stroke${added === 1 ? '' : 's'}`, {
1868
+ extraOps: itemPutsFor(board.committed.values(), res.idMap), // #113 — a checklist's entries travel
1869
+ });
1796
1870
  // Select the copies of what was selected (their contents ride along).
1797
1871
  return cloneRoots(ids, res);
1798
1872
  };
@@ -1865,6 +1939,7 @@ export function AnnotationsLayer() {
1865
1939
  previewStroke,
1866
1940
  commitGesture,
1867
1941
  runAction: (id: string) => runAnnotationActionRef.current(id),
1942
+ isChecklist: (id: string) => isChecklist(board.committed.values(), id),
1868
1943
  };
1869
1944
  }, [strokes, setStrokes, commitStrokes, rememberDeletedIds]);
1870
1945
 
@@ -2277,7 +2352,10 @@ export function AnnotationsLayer() {
2277
2352
  }
2278
2353
  const placed = expandTemplate(p.id, { x: wx, y: wy }, name || null);
2279
2354
  if (!placed) return true;
2280
- commitStrokes(before, [...before, ...placed.strokes], `add ${p.id} template`);
2355
+ commitStrokes(before, [...before, ...placed.strokes], `add ${p.id} template`, {
2356
+ // #113 — a checklist template's entries (no stroke form) go in the same batch
2357
+ extraOps: placed.records.map((el) => ({ op: 'put', el }) as AnnotationOp),
2358
+ });
2281
2359
  annotSel?.replace(placed.selectIds);
2282
2360
  return true;
2283
2361
  };
@@ -3592,7 +3670,8 @@ export function AnnotationsLayer() {
3592
3670
  landed,
3593
3671
  `${st.altDup ? 'duplicate' : 'move'} ${st.movedIds.length} stroke${
3594
3672
  st.movedIds.length === 1 ? '' : 's'
3595
- }`
3673
+ }`,
3674
+ { drag: true }
3596
3675
  );
3597
3676
  };
3598
3677
  return {
@@ -3939,13 +4018,16 @@ export function AnnotationsLayer() {
3939
4018
  text,
3940
4019
  fmt,
3941
4020
  measuredH,
3942
- commitSessionRef.current?.base ?? existing.text
4021
+ commitSessionRef.current?.base ?? existing.text,
4022
+ itemsByList(board.committed.values())
4023
+ .get(id)
4024
+ ?.map((i) => ({ text: i.text })) // #113 — room for a checklist's entries
3943
4025
  );
3944
4026
  if (!edited) return;
3945
4027
  const next = prev.map((s) => (s.id === id ? edited : s));
3946
4028
  commitStrokes(prev, next, 'edit sticky');
3947
4029
  },
3948
- [commitStrokes]
4030
+ [commitStrokes, board]
3949
4031
  );
3950
4032
 
3951
4033
  // Phase 21 — re-edit an EXISTING standalone text node. Empty text deletes it
@@ -4188,7 +4270,11 @@ export function AnnotationsLayer() {
4188
4270
  ?.writeText(
4189
4271
  JSON.stringify({
4190
4272
  maudeElements: 2,
4191
- elements: v1ToV2(payload, { flat: true }).elements,
4273
+ // #113 — a checklist sticky's entries ride after the cards (paste remaps their `list`)
4274
+ elements: [
4275
+ ...v1ToV2(payload, { flat: true }).elements,
4276
+ ...itemsForCopy(board.committed, expanded),
4277
+ ],
4192
4278
  })
4193
4279
  )
4194
4280
  .catch(() => {
@@ -4203,7 +4289,7 @@ export function AnnotationsLayer() {
4203
4289
  }
4204
4290
  return true;
4205
4291
  },
4206
- [annotSel]
4292
+ [annotSel, board]
4207
4293
  );
4208
4294
 
4209
4295
  /**
@@ -4216,6 +4302,8 @@ export function AnnotationsLayer() {
4216
4302
  (txt: string): boolean => {
4217
4303
  if (!annotSel || !isBoardClipboard(txt)) return false;
4218
4304
  let safe: Stroke[] = [];
4305
+ // #113 — the payload's checklist entries and the stickies they belong to (entries have no stroke form)
4306
+ let pastedRecords: AnnotationElement[] = [];
4219
4307
  try {
4220
4308
  const parsed = JSON.parse(txt) as {
4221
4309
  maudeElements?: number;
@@ -4242,11 +4330,14 @@ export function AnnotationsLayer() {
4242
4330
  const out: Record<string, unknown> = { ...el };
4243
4331
  delete out.author;
4244
4332
  delete out.locked; // #137 — a pasted copy starts unlocked
4245
- if (author) out.author = author;
4333
+ if (author && el.type !== 'checkitem') out.author = author; // an entry has no author line
4246
4334
  if (el.type === 'link' && typeof el.url === 'string') out.domain = linkDomain(el.url);
4247
4335
  return out;
4248
4336
  });
4249
- safe = elementsToStrokes(validateElements(mine).elements);
4337
+ const valid = validateElements(mine).elements;
4338
+ const { drawn, items } = splitPasteItems(valid);
4339
+ pastedRecords = items.length ? [...drawn.filter((e) => e.type === 'sticky'), ...items] : [];
4340
+ safe = elementsToStrokes(drawn);
4250
4341
  } catch {
4251
4342
  return false;
4252
4343
  }
@@ -4263,7 +4354,9 @@ export function AnnotationsLayer() {
4263
4354
  // recompute keeps binds to hosts present in THIS canvas and strips the
4264
4355
  // cross-canvas danglers (endpoint frozen).
4265
4356
  const next = recomputeBoundArrows([...prev, ...clones]);
4266
- commitStrokes(prev, next, `paste ${clones.length} stroke${clones.length === 1 ? '' : 's'}`);
4357
+ commitStrokes(prev, next, `paste ${clones.length} stroke${clones.length === 1 ? '' : 's'}`, {
4358
+ extraOps: pastedRecords.length ? itemPutsFor(pastedRecords, res.idMap) : [],
4359
+ });
4267
4360
  annotSel.replace(res.newIds);
4268
4361
  return true;
4269
4362
  },
@@ -4663,6 +4756,7 @@ export function AnnotationsLayer() {
4663
4756
  ? ('Reopen' as const)
4664
4757
  : ('Resolve' as const),
4665
4758
  canFanOut: stackMembers(stickyBoxes(strokes), soleSelected.id).length > 1,
4759
+ canChecklist: !isChecklist(board.committed.values(), soleSelected.id),
4666
4760
  }
4667
4761
  : null;
4668
4762
  const sectionMenu =
@@ -4783,7 +4877,8 @@ export function AnnotationsLayer() {
4783
4877
  action === 'resolve' ||
4784
4878
  action === 'fan-out' ||
4785
4879
  action === 'fold' ||
4786
- action === 'to-comment'
4880
+ action === 'to-comment' ||
4881
+ action === 'make-checklist'
4787
4882
  ) {
4788
4883
  runAnnotationActionRef.current(`annotation.${action}`);
4789
4884
  } else if (action === 'history') {
@@ -4830,6 +4925,273 @@ export function AnnotationsLayer() {
4830
4925
  [annotSel, copySelection, strokesById]
4831
4926
  );
4832
4927
 
4928
+ // ── #113 — checklists (contract 113-checklist §5.3–§5.6) ──
4929
+ // Every gesture is ONE op batch (annotations/checklist-ops.ts) through the lock net and the sticky's growth
4930
+ // (annotations/ui/checklist-wire.ts), applied here and recorded as one undo step. Entries never go through
4931
+ // the stroke diff. Keys are the registry's `checklist.*` (useCanvasKeys below, under `checkItemFocused`);
4932
+ // the rows draw in annotations/ui/checklist.tsx and only report focus and clicks.
4933
+ const [checkEdit, setCheckEdit] = useState<CheckEdit | null>(null);
4934
+ const [checkFocus, setCheckFocus] = useState<CheckEdit | null>(null);
4935
+ const [checkAnnounce, setCheckAnnounce] = useState<ChecklistApi['announce']>(null);
4936
+ /** The row that last had focus (⌘K's checklist rows act on it while its sticky is selected). */
4937
+ const lastRowRef = useRef<string | null>(null);
4938
+ const checkLive = posture === 'drawn' && annotationPicks(tool, posture);
4939
+ useEffect(() => {
4940
+ if (!checkLive) setCheckEdit(null);
4941
+ }, [checkLive]);
4942
+ const prevByListRef = useRef<Map<string, AnnotationElement[]>>(new Map());
4943
+ // biome-ignore lint/correctness/useExhaustiveDependencies: re-read per board version; identity kept while no entry changed
4944
+ const checkByList = useMemo(() => {
4945
+ const next = itemsByList(board.elements.values());
4946
+ const prev = prevByListRef.current;
4947
+ const same =
4948
+ next.size === prev.size &&
4949
+ [...next].every(([k, v]) => {
4950
+ const p = prev.get(k);
4951
+ return !!p && p.length === v.length && p.every((x, i) => x === v[i]);
4952
+ });
4953
+ if (same) return prev;
4954
+ prevByListRef.current = next;
4955
+ return next;
4956
+ }, [board, boardVersion]);
4957
+ const checkSay = useCallback((message: string) => {
4958
+ if (!postToShell({ dgn: 'annotation-toast', v: 1, message, undo: false }))
4959
+ showCanvasToast(message);
4960
+ }, []);
4961
+ /** Commit one checklist gesture; a refusal (a locked list, a gone entry) says why. */
4962
+ const commitChecklist = useCallback(
4963
+ (res: ChecklistResult): boolean => {
4964
+ if (!res.ok) {
4965
+ checkSay(res.message);
4966
+ return false;
4967
+ }
4968
+ const ops = checklistCommitOps(board.committed, res.ops);
4969
+ if (!ops.length) return true;
4970
+ setPreview(null);
4971
+ // T7.3b (#113) — the batch says its gesture ("Ticked “Write the post”"): ⌘Z's toast names it
4972
+ const inverse = applyOpsLocal(ops, undefined, res.label);
4973
+ undoStackRef.current.record(
4974
+ buildAnnotationOpsRecord({ ops, inverse, label: res.label, file: fileRef.current })
4975
+ );
4976
+ return true;
4977
+ },
4978
+ [board, applyOpsLocal, checkSay]
4979
+ );
4980
+ const checkMe = collab?.myName ?? 'Someone';
4981
+ const listOf = useCallback(
4982
+ (itemId: string): string | null => {
4983
+ const l = board.committed.get(itemId)?.list;
4984
+ return typeof l === 'string' ? l : null;
4985
+ },
4986
+ [board]
4987
+ );
4988
+ const announceList = useCallback(
4989
+ (listId: string | null) => {
4990
+ if (!listId) return;
4991
+ const items = itemsByList(board.committed.values()).get(listId) ?? [];
4992
+ setCheckAnnounce({ list: listId, text: progressWords(items) });
4993
+ },
4994
+ [board]
4995
+ );
4996
+ /** The words in an open entry, when they differ from what is stored (null = nothing to reword). */
4997
+ const pendingReword = useCallback(
4998
+ (itemId: string, text: string): ChecklistResult | null => {
4999
+ const stored = board.committed.get(itemId)?.text;
5000
+ return (typeof stored === 'string' ? stored : '') === text
5001
+ ? null
5002
+ : rewordItem(board.committed, itemId, text);
5003
+ },
5004
+ [board]
5005
+ );
5006
+ const checkToggle = useCallback(
5007
+ (itemId: string, typed?: string) => {
5008
+ const cur = board.committed.get(itemId);
5009
+ if (!cur) return;
5010
+ const tick = tickItem(board.committed, itemId, cur.done === undefined, { by: checkMe });
5011
+ const pre = typed === undefined ? null : pendingReword(itemId, typed);
5012
+ if (commitChecklist(joinChecklist(pre, tick))) announceList(listOf(itemId));
5013
+ },
5014
+ [board, checkMe, commitChecklist, pendingReword, announceList, listOf]
5015
+ );
5016
+ const checkStartEdit = useCallback(
5017
+ (itemId: string, caret: number | 'end' = 'end') => {
5018
+ // a locked list keeps its words (it still ticks): say so instead of opening the field
5019
+ const probe = rewordItem(board.committed, itemId, '');
5020
+ if (!probe.ok) {
5021
+ checkSay(probe.message);
5022
+ return;
5023
+ }
5024
+ setCheckEdit({ id: itemId, caret });
5025
+ },
5026
+ [board, checkSay]
5027
+ );
5028
+ const checkCommitText = useCallback(
5029
+ (itemId: string, text: string) => {
5030
+ setCheckEdit((e) => (e?.id === itemId ? null : e));
5031
+ const r = pendingReword(itemId, text);
5032
+ if (r) commitChecklist(r);
5033
+ },
5034
+ [pendingReword, commitChecklist]
5035
+ );
5036
+ const checkAddAtEnd = useCallback(
5037
+ (listId: string) => {
5038
+ const id = mintCheckId();
5039
+ if (commitChecklist(addItem(board.committed, listId, { id }))) setCheckEdit({ id, caret: 0 });
5040
+ },
5041
+ [board, commitChecklist]
5042
+ );
5043
+ const checkFocused = useCallback(
5044
+ (itemId: string) => {
5045
+ lastRowRef.current = itemId;
5046
+ setCheckFocus(null);
5047
+ // the row's keys are scoped to an annotation selection: its sticky becomes the selection
5048
+ const list = listOf(itemId);
5049
+ if (
5050
+ list &&
5051
+ annotSel &&
5052
+ !(annotSel.selectedIds.length === 1 && annotSel.selectedIds[0] === list)
5053
+ )
5054
+ annotSel.replace(list);
5055
+ },
5056
+ [listOf, annotSel]
5057
+ );
5058
+ const checklistApi = useMemo<ChecklistApi>(
5059
+ () => ({
5060
+ byList: checkByList,
5061
+ interactive: checkLive,
5062
+ editing: checkEdit,
5063
+ focusRequest: checkFocus,
5064
+ announce: checkAnnounce,
5065
+ toggle: (id) => checkToggle(id),
5066
+ startEdit: checkStartEdit,
5067
+ commitText: checkCommitText,
5068
+ addAtEnd: checkAddAtEnd,
5069
+ focused: checkFocused,
5070
+ }),
5071
+ [
5072
+ checkByList,
5073
+ checkLive,
5074
+ checkEdit,
5075
+ checkFocus,
5076
+ checkAnnounce,
5077
+ checkToggle,
5078
+ checkStartEdit,
5079
+ checkCommitText,
5080
+ checkAddAtEnd,
5081
+ checkFocused,
5082
+ ]
5083
+ );
5084
+ /**
5085
+ * The registry's checklist gestures. `itemId` is the row (a key's target, or the last focused row for a
5086
+ * ⌘K row); `field` the open entry's input when the key came from it. True when it did something.
5087
+ */
5088
+ const runChecklist = useCallback(
5089
+ (id: string, itemId: string, field: HTMLInputElement | null): boolean => {
5090
+ if (!checkLive) return false;
5091
+ const typed = field ? field.value.replace(/\n/g, ' ') : undefined;
5092
+ const list = listOf(itemId);
5093
+ if (!list) return false;
5094
+ const rows = itemsByList(board.committed.values()).get(list) ?? [];
5095
+ const at = rows.findIndex((r) => r.id === itemId);
5096
+ switch (id) {
5097
+ case 'checklist.toggle':
5098
+ checkToggle(itemId, typed);
5099
+ return true;
5100
+ case 'checklist.edit':
5101
+ checkStartEdit(itemId, 'end');
5102
+ return true;
5103
+ case 'checklist.add-below': {
5104
+ // ↵ splits at the caret like a list editor: the words after it start the next entry
5105
+ const caret = field?.selectionStart ?? typed?.length ?? 0;
5106
+ const before = typed === undefined ? undefined : typed.slice(0, caret);
5107
+ const after = typed === undefined ? '' : typed.slice(caret);
5108
+ const nid = mintCheckId();
5109
+ const pre = before === undefined ? null : pendingReword(itemId, before);
5110
+ if (field && before !== undefined) field.value = before; // its blur then rewords nothing
5111
+ const add = addItem(board.committed, list, { id: nid, after: itemId, text: after });
5112
+ if (commitChecklist(joinChecklist(pre, add))) setCheckEdit({ id: nid, caret: 0 });
5113
+ return true;
5114
+ }
5115
+ case 'checklist.remove-empty': {
5116
+ if (typed === undefined || typed !== '') return false; // a character to delete: the field's
5117
+ const prev = rows[at - 1];
5118
+ const next = rows[at + 1];
5119
+ if (commitChecklist(removeItem(board.committed, itemId))) {
5120
+ if (prev) setCheckEdit({ id: prev.id, caret: 'end' });
5121
+ else {
5122
+ setCheckEdit(null);
5123
+ if (next) setCheckFocus({ id: next.id });
5124
+ }
5125
+ }
5126
+ return true;
5127
+ }
5128
+ case 'checklist.move-up':
5129
+ case 'checklist.move-down': {
5130
+ const pre = typed === undefined ? null : pendingReword(itemId, typed);
5131
+ const move = moveItem(
5132
+ board.committed,
5133
+ itemId,
5134
+ id === 'checklist.move-up' ? 'up' : 'down'
5135
+ );
5136
+ if (commitChecklist(joinChecklist(pre, move))) {
5137
+ if (field) setCheckEdit({ id: itemId, caret: field.selectionStart ?? 'end' });
5138
+ else setCheckFocus({ id: itemId });
5139
+ }
5140
+ return true;
5141
+ }
5142
+ case 'checklist.focus-prev':
5143
+ case 'checklist.focus-next': {
5144
+ const to = rows[at + (id === 'checklist.focus-prev' ? -1 : 1)];
5145
+ if (to) setCheckFocus({ id: to.id });
5146
+ return true;
5147
+ }
5148
+ default:
5149
+ return false;
5150
+ }
5151
+ },
5152
+ [checkLive, listOf, board, checkToggle, checkStartEdit, pendingReword, commitChecklist]
5153
+ );
5154
+ const runChecklistRef = useRef(runChecklist);
5155
+ runChecklistRef.current = runChecklist;
5156
+ const checklistKey = (id: string) => (e: KeyboardEvent) => {
5157
+ const row = (e.target as Element | null)?.closest?.(
5158
+ '[data-an-check-row]'
5159
+ ) as HTMLElement | null;
5160
+ const itemId = row?.dataset.itemId;
5161
+ if (!itemId) return;
5162
+ const field =
5163
+ e.target instanceof HTMLInputElement && e.target.hasAttribute('data-an-check-input')
5164
+ ? e.target
5165
+ : null;
5166
+ if (!runChecklistRef.current(id, itemId, field)) return;
5167
+ e.preventDefault();
5168
+ // Space must not also arm the hold-to-pan (canvas-lib) or play a video under the sticky
5169
+ e.stopPropagation();
5170
+ };
5171
+ useCanvasKeys(
5172
+ {
5173
+ 'checklist.toggle': checklistKey('checklist.toggle'),
5174
+ 'checklist.edit': checklistKey('checklist.edit'),
5175
+ 'checklist.add-below': checklistKey('checklist.add-below'),
5176
+ 'checklist.remove-empty': checklistKey('checklist.remove-empty'),
5177
+ 'checklist.move-up': checklistKey('checklist.move-up'),
5178
+ 'checklist.move-down': checklistKey('checklist.move-down'),
5179
+ 'checklist.focus-prev': checklistKey('checklist.focus-prev'),
5180
+ 'checklist.focus-next': checklistKey('checklist.focus-next'),
5181
+ },
5182
+ {
5183
+ target: 'document',
5184
+ capture: true,
5185
+ checkItemFocused: (e) => isChecklistTarget(e.target),
5186
+ // a focused row is its sticky's scope (checkFocused selects the sticky; this covers the first key)
5187
+ selection: () =>
5188
+ (annotSel?.selectedIds.length ?? 0) > 0 ||
5189
+ (typeof document !== 'undefined' && isChecklistTarget(document.activeElement))
5190
+ ? 'annotation'
5191
+ : 'none',
5192
+ }
5193
+ );
5194
+
4833
5195
  // S4.12 - stickies and sections up close. One entry point for the menu rows, the small toolbar and the
4834
5196
  // registry actions (`run-action` from ⌘K / the keyboard): resolve, fan out, fold, turn into a comment, and
4835
5197
  // the ⌘K clean-up of resolved stickies. Every write is one `commitStrokes` = one undo step.
@@ -4898,11 +5260,34 @@ export function AnnotationsLayer() {
4898
5260
  say(trashedLine(ids.length), true);
4899
5261
  return true;
4900
5262
  }
5263
+ // #113 — "Turn into checklist" (menu, small toolbar, ⌘K): its task lines become entries
5264
+ case 'annotation.make-checklist': {
5265
+ const only = sel.length === 1 ? cur.find((x) => x.id === sel[0]) : undefined;
5266
+ if (!only || only.tool !== 'sticky') return false;
5267
+ const res = makeChecklist(board.committed, only.id, { by: me });
5268
+ if (!commitChecklist(res)) return false;
5269
+ // a fresh, empty entry opens for typing
5270
+ const first = itemsByList(board.committed.values()).get(only.id)?.[0];
5271
+ if (first && !first.text) setCheckEdit({ id: first.id, caret: 0 });
5272
+ return true;
5273
+ }
5274
+ // ⌘K's checklist rows act on the row that last had focus, while its sticky is the selection
5275
+ case 'checklist.toggle':
5276
+ case 'checklist.edit':
5277
+ case 'checklist.add-below':
5278
+ case 'checklist.remove-empty':
5279
+ case 'checklist.move-up':
5280
+ case 'checklist.move-down': {
5281
+ const row = lastRowRef.current;
5282
+ const list = row ? board.committed.get(row)?.list : undefined;
5283
+ if (!row || typeof list !== 'string' || !sel.includes(list)) return false;
5284
+ return runChecklistRef.current(id, row, null);
5285
+ }
4901
5286
  default:
4902
5287
  return false;
4903
5288
  }
4904
5289
  },
4905
- [annotSel, collab?.myName, commitStrokes]
5290
+ [annotSel, collab?.myName, commitStrokes, board, commitChecklist]
4906
5291
  );
4907
5292
  runAnnotationActionRef.current = runAnnotationAction;
4908
5293
  // ⌘/ with annotations selected asks the AI about them (registry `annotation.ask-ai`, Preview only; in Edit
@@ -5066,34 +5451,36 @@ export function AnnotationsLayer() {
5066
5451
  }}
5067
5452
  />
5068
5453
  {visible ? (
5069
- <AnnotationsSvg
5070
- worldRef={worldRef}
5071
- strokes={shownStrokes}
5072
- quiet={quiet}
5073
- anchorsById={anchorsById}
5074
- selectMode={annotationPicks(tool, posture) && !quiet}
5075
- selectedStrokes={selectedStrokes}
5076
- selectionLocked={selectionLocked}
5077
- marquee={marquee}
5078
- snapGuides={snapGuides}
5079
- bindHintId={bindHintId}
5080
- resizeInfo={resizeInfo}
5081
- connDraft={connDraft}
5082
- addTextHintId={editingTarget ? null : addTextHintId}
5083
- ghost={ghostPreview}
5084
- editingTarget={editingTarget}
5085
- editCaretPoint={editCaretPoint}
5086
- inkColor={color}
5087
- onCommitEdit={commitEditing}
5088
- onCancelEdit={cancelEditing}
5089
- onDraftEdit={draftEditing}
5090
- onChainEdit={chainAfterCommit}
5091
- gestureState={gestureState}
5092
- editNotice={editGone ? 'deleted' : remoteEdited ? 'edited' : null}
5093
- unknownElements={unknownElements}
5094
- arrowUi={arrowUi}
5095
- foldNotes={foldNotes}
5096
- />
5454
+ <ChecklistContext.Provider value={checklistApi}>
5455
+ <AnnotationsSvg
5456
+ worldRef={worldRef}
5457
+ strokes={shownStrokes}
5458
+ quiet={quiet}
5459
+ anchorsById={anchorsById}
5460
+ selectMode={annotationPicks(tool, posture) && !quiet}
5461
+ selectedStrokes={selectedStrokes}
5462
+ selectionLocked={selectionLocked}
5463
+ marquee={marquee}
5464
+ snapGuides={snapGuides}
5465
+ bindHintId={bindHintId}
5466
+ resizeInfo={resizeInfo}
5467
+ connDraft={connDraft}
5468
+ addTextHintId={editingTarget ? null : addTextHintId}
5469
+ ghost={ghostPreview}
5470
+ editingTarget={editingTarget}
5471
+ editCaretPoint={editCaretPoint}
5472
+ inkColor={color}
5473
+ onCommitEdit={commitEditing}
5474
+ onCancelEdit={cancelEditing}
5475
+ onDraftEdit={draftEditing}
5476
+ onChainEdit={chainAfterCommit}
5477
+ gestureState={gestureState}
5478
+ editNotice={editGone ? 'deleted' : remoteEdited ? 'edited' : null}
5479
+ unknownElements={unknownElements}
5480
+ arrowUi={arrowUi}
5481
+ foldNotes={foldNotes}
5482
+ />
5483
+ </ChecklistContext.Provider>
5097
5484
  ) : null}
5098
5485
  {visible && !quiet ? (
5099
5486
  <BelongsOutline
@@ -5856,7 +6243,12 @@ export function AnnotationContextMenu({
5856
6243
  onClose,
5857
6244
  }: {
5858
6245
  /** S4.12 - the sticky rows (canvas 15 an-convert): only for a sole sticky / section. */
5859
- sticky?: { resolveWord: 'Resolve' | 'Reopen'; canFanOut: boolean } | null;
6246
+ sticky?: {
6247
+ resolveWord: 'Resolve' | 'Reopen';
6248
+ canFanOut: boolean;
6249
+ /** #113 — a plain sticky (no entries yet): "Turn into checklist" */
6250
+ canChecklist?: boolean;
6251
+ } | null;
5860
6252
  /** S4.12 - the section rows: Fold / Unfold, and the AI question. */
5861
6253
  section?: { foldWord: 'Fold' | 'Unfold' } | null;
5862
6254
  pos: { x: number; y: number };
@@ -5936,6 +6328,7 @@ export function AnnotationContextMenu({
5936
6328
  {sticky ? (
5937
6329
  <>
5938
6330
  {item('to-comment', 'Turn into a comment')}
6331
+ {sticky.canChecklist ? item('make-checklist', 'Turn into checklist') : null}
5939
6332
  {item('resolve', sticky.resolveWord)}
5940
6333
  {sticky.canFanOut ? item('fan-out', 'Fan out') : null}
5941
6334
  {/* p8-dead-reasons — `history.object`: the shell opens Version history filtered to this sticky */}