@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
package/README.md CHANGED
@@ -34,9 +34,10 @@ Plus the **`maude`** CLI — `maude init` scaffolds a fresh `.ai/` workspace fro
34
34
  ```
35
35
  /plugin install design@maude
36
36
  /plugin install flow@maude
37
+ /plugin install design-video@maude # optional: video — reels, footage analysis, Lottie export
37
38
  ```
38
39
 
39
- Then `/reload-plugins` and you should see `/design:edit`, `/design:*`, `/flow:plan`, `/flow:execute`, etc.
40
+ `design-video` is opt-in and needs `design` ([what moved](docs/MIGRATING-DESIGN-VIDEO.md)). Then `/reload-plugins` and you should see `/design:edit`, `/design:*`, `/flow:plan`, `/flow:execute`, etc.
40
41
 
41
42
  ### 3. Install the CLI
42
43
 
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { createHash, randomUUID } from 'node:crypto';
18
18
 
19
+ import { textSlotsCollide } from '../../../studio/annotations/text-steps.ts';
19
20
  import { canvasSlugFromRel } from '../../../studio/canvas-slug.ts';
20
21
  import { validateCanvasPath } from '../../../studio/sync/canvas-path.ts';
21
22
  import { checkLane, LANE_NAMES, laneHash, mergeLane } from './lanes.mjs';
@@ -872,13 +873,15 @@ export function createKernel({
872
873
  const chain = await ownHistory.withoutRoundTrips(later.filter((x) => !own.has(x.actionId)));
873
874
  let x = before;
874
875
  for (const step of chain) {
875
- const m = mergeLane(
876
- first.lane,
877
- await work.content(step.beforeHash),
878
- x,
879
- await work.content(step.afterHash)
880
- );
881
- if (!m.ok) {
876
+ const stepBefore = await work.content(step.beforeHash);
877
+ const stepAfter = await work.content(step.afterHash);
878
+ const m = mergeLane(first.lane, stepBefore, x, stepAfter);
879
+ // T5.2 (#165) — the annotations merge lets the revert win an overlapping text ("ours"): that
880
+ // later step's words would be lost. The same check a v2 studio makes before it asks
881
+ // (sync/hub-text-undo.ts), here for every desktop; it refuses the whole undo (opUndo).
882
+ const textOverlap =
883
+ m.ok && first.lane === 'annotations' && textSlotsCollide(stepBefore, x, stepAfter);
884
+ if (!m.ok || textOverlap) {
882
885
  return {
883
886
  skipped: {
884
887
  doc: st.doc,
@@ -887,6 +890,7 @@ export function createKernel({
887
890
  // Multi-target only, so a v1 single undo answers byte for byte as before.
888
891
  ...(many ? { conflictWith: step.actionId } : {}),
889
892
  },
893
+ ...(textOverlap ? { textOverlap: true } : {}),
890
894
  };
891
895
  }
892
896
  x = m.content;
@@ -1042,6 +1046,8 @@ export function createKernel({
1042
1046
  reverted.add(k);
1043
1047
  if (e.entry && deletedHere.has(e.entry)) continue;
1044
1048
  const r = await revertLane(work, firstOn.get(k) ?? e, targetIds, many, ownHistory);
1049
+ // T5.2 — reverting over somebody's text is never half done: the whole undo is refused.
1050
+ if (r.textOverlap) throw new Reject('undo-conflict', { skipped: [r.skipped] });
1045
1051
  if (r.skipped) skipped.push(r.skipped);
1046
1052
  else if (r.applied) applied++;
1047
1053
  }
@@ -64,7 +64,7 @@ const MODULE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs)$/i;
64
64
  * (a canvas), `.md`, `.txt`, unknown — taken with `with { type: 'text' }` is just bytes into the
65
65
  * frame, so it blocks the grant like an imported canvas.
66
66
  */
67
- const IMPORTABLE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs|css|json)$/i;
67
+ export const IMPORTABLE_EXT_RE = /\.(tsx|ts|jsx|js|mjs|cjs|css|json)$/i;
68
68
  /** A design system's own folder — exactly one segment under `system/` (V2-8.9 defender L3). */
69
69
  const DS_SYSTEM_PATH_RE = /^system\/[^/]+$/;
70
70
  /** A specifier with an extension of its own (`./data.json`, `./logo.svg`): the exact file. */
@@ -129,20 +129,27 @@ export function relativeImportGroups(
129
129
  canvasAbsPath: string,
130
130
  designRoot: string
131
131
  ): string[][] {
132
- const css = /\.css$/i.test(canvasAbsPath);
132
+ return relativeImportSpecs(rawSource, /\.css$/i.test(canvasAbsPath)).map((spec) =>
133
+ specCandidates(spec, canvasAbsPath, designRoot)
134
+ );
135
+ }
136
+
137
+ /**
138
+ * #158 — the distinct relative specifiers `relativeImportGroups` resolves, decoded, in source order
139
+ * (`css`: the file is a stylesheet, so `@import url(…)` counts). Exported so a diagnostic names the
140
+ * specifier an import was written with — one scan, never a second copy of the import grammar.
141
+ */
142
+ export function relativeImportSpecs(rawSource: string, css: boolean): string[] {
133
143
  const source = importScanText(rawSource, css);
134
- const groups: string[][] = [];
135
144
  const specs = new Set<string>();
136
145
  for (const re of css ? [...SPEC_RES, CSS_URL_IMPORT_RE] : SPEC_RES) {
137
146
  re.lastIndex = 0;
138
147
  for (let m = re.exec(source); m !== null; m = re.exec(source)) {
139
148
  const spec = decodeJsString(m[1] ?? '');
140
- if (!spec.startsWith('.') || specs.has(spec)) continue;
141
- specs.add(spec);
142
- groups.push(specCandidates(spec, canvasAbsPath, designRoot));
149
+ if (spec.startsWith('.')) specs.add(spec);
143
150
  }
144
151
  }
145
- return groups;
152
+ return [...specs];
146
153
  }
147
154
 
148
155
  /**
@@ -221,6 +228,12 @@ export interface ProjectReader {
221
228
  /** p8-closure-lows — the canvas-shaped (`.tsx`/`.html`) entries the last `list()` saw but did
222
229
  * not yield (a symlink, a dot name), by name only: each counts as another canvas's slug. */
223
230
  unlisted?(): Iterable<string>;
231
+ /** #167 T5.3 — folders the listing cut at its depth cap (each a designRoot-relative folder):
232
+ * whatever lies below is unseen, so an owner whose slug starts with a cut folder's slug keeps
233
+ * its stylesheet refused. A reader without depth cap leaves it out. */
234
+ cutFolders?(): Iterable<string>;
235
+ /** #167 T5.3 — a listed path that is only a tombstone (gone from the disk): no slug twin. */
236
+ gone?(rel: string): boolean;
224
237
  }
225
238
 
226
239
  export interface Closure {
@@ -253,6 +266,7 @@ const ASSET_SIDECAR_SUFFIXES = [
253
266
  '.transcript.json',
254
267
  '.beats.json',
255
268
  '.gen.json', // the generation provenance of a take (S8 §5.2) — rides with its image
269
+ '.added.json', // who brought the asset in (#172, a display name) — rides with its asset
256
270
  '.srt',
257
271
  '.vtt',
258
272
  '.json', // the bare whisper dump beside old captions (V2-1.10)
@@ -622,6 +636,10 @@ interface WalkEnv {
622
636
  listTruncated: boolean;
623
637
  /** p8-closure-lows — canvas-shaped entries the listing saw but did not yield (`unlisted`). */
624
638
  unlisted: readonly string[];
639
+ /** #167 T5.3 — each depth-cut folder's slug plus `-`: a slug starting with one may be hidden. */
640
+ cutSlugs: readonly string[];
641
+ /** #167 T5.3 — listed and not only a tombstone (`ProjectReader.gone`). */
642
+ present: (rel: string) => boolean;
625
643
  /** 2.0.7 (#207) — `files`' openable canvas files (`.tsx`/`.html`, not `_`-prefixed) by NFC slug,
626
644
  * and `unlisted` by NFC slug: what `grantedBySlug` scanned the whole listing for, per owner. */
627
645
  slugIndex: () => { files: ReadonlyMap<string, string[]>; unlisted: ReadonlySet<string> };
@@ -760,12 +778,14 @@ function walkEnv(project: ProjectReader, files: ReadonlySet<string>, cfg: Closur
760
778
  typeof project.present === 'function';
761
779
  const listTruncated = !reports || project.listTruncated?.() === true;
762
780
  const unlisted = reports ? [...(project.unlisted?.() ?? [])] : [];
781
+ const cutSlugs = [...(project.cutFolders?.() ?? [])].map((d) => `${slugNfc(d)}-`);
782
+ const present = (rel: string): boolean => files.has(rel) && project.gone?.(rel) !== true;
763
783
  let slugs: { files: Map<string, string[]>; unlisted: Set<string> } | null = null;
764
784
  const slugIndex = () => {
765
785
  if (slugs) return slugs;
766
786
  const bySlug = new Map<string, string[]>();
767
787
  for (const f of files) {
768
- if (!/\.(tsx|html)$/i.test(f) || f.startsWith('_')) continue;
788
+ if (!/\.(tsx|html)$/i.test(f) || f.startsWith('_') || !present(f)) continue;
769
789
  const slug = slugNfc(f);
770
790
  const list = bySlug.get(slug);
771
791
  if (list) list.push(f);
@@ -774,7 +794,19 @@ function walkEnv(project: ProjectReader, files: ReadonlySet<string>, cfg: Closur
774
794
  slugs = { files: bySlug, unlisted: new Set(unlisted.map(slugNfc)) };
775
795
  return slugs;
776
796
  };
777
- return { files, textOf, isCanvas, cfg, project, known, listTruncated, unlisted, slugIndex };
797
+ return {
798
+ files,
799
+ textOf,
800
+ isCanvas,
801
+ cfg,
802
+ project,
803
+ known,
804
+ listTruncated,
805
+ unlisted,
806
+ cutSlugs,
807
+ present,
808
+ slugIndex,
809
+ };
778
810
  }
779
811
 
780
812
  const SAME_NAME_RE =
@@ -905,11 +937,12 @@ function walkImports(
905
937
  const grantedBySlug = (owner: string): boolean => {
906
938
  if (env.listTruncated || env.known.has(owner)) return false;
907
939
  const meta = owner.replace(/\.(tsx|html)$/i, '.meta.json');
908
- if (env.files.has(owner) || env.files.has(meta)) return false;
940
+ if (env.present(owner) || env.present(meta)) return false;
909
941
  // p8-closure-lows-2 — slugs compare NFC on both sides (APFS holds `café` in NFC and NFD as one
910
942
  // name); never case-folded beyond the slug's own lower-casing. A slug already found foreign
911
943
  // answers before any disk look-up (`present` could only make it foreign too).
912
944
  const slug = slugNfc(owner);
945
+ if (env.cutSlugs.some((p) => slug.startsWith(p))) return false;
913
946
  const hit = slugOwned.get(slug);
914
947
  if (hit === false) return false;
915
948
  if (env.project.present?.(owner) || env.project.present?.(meta)) return false;
@@ -1016,6 +1049,45 @@ function walkImports(
1016
1049
  return { visited, refused, missing, blocked: blocked || refused.size > 0 };
1017
1050
  }
1018
1051
 
1052
+ /** #122 (122-A) — `importAllowed`'s answer: why a would-be import is refused, and the canvases it would inline. */
1053
+ export type ImportVerdict =
1054
+ | { ok: true }
1055
+ | { ok: false; why: 'canvas' | 'missing' | 'blocked'; canvases: string[] };
1056
+
1057
+ /**
1058
+ * A design-root listing that answers `has` by reading (a paste checks one import, never lists the project);
1059
+ * it iterates as empty. An own `has` on a plain Set: no class syntax the hub's strip-only TypeScript lacks.
1060
+ */
1061
+ const readableFiles = (probe: (rel: string) => boolean): ReadonlySet<string> =>
1062
+ Object.assign(new Set<string>(), { has: probe });
1063
+
1064
+ /**
1065
+ * #122 (122-A) — may a canvas at `fromRel` gain `import … from spec`? The C4 import walk's own rule (`walkImports`:
1066
+ * an importable extension, not a canvas, nothing under a `_` runtime folder, every import resolving, transitively)
1067
+ * applied to that ONE import — the would-be text, never the disk's copy of `fromRel` and never its other imports
1068
+ * (a paste is refused for what it adds, not for what the target already had). A bare / virtual specifier is not
1069
+ * walked (`@maude/canvas-lib`, `react`): allowed. A reader with no listing errs to "canvas" like every partial
1070
+ * listing (`listTruncated`), so the same-name owner rule never admits a stylesheet here.
1071
+ */
1072
+ export function importAllowed(
1073
+ spec: string,
1074
+ fromRel: string,
1075
+ project: { text(rel: string): string | null },
1076
+ config?: ClosureConfig
1077
+ ): ImportVerdict {
1078
+ if (!spec.startsWith('.')) return { ok: true };
1079
+ if (/['"\\\n`]/.test(spec)) return { ok: false, why: 'blocked', canvases: [] };
1080
+ const probe = `import '${spec}';\n`;
1081
+ const text = (rel: string): string | null => (rel === fromRel ? probe : project.text(rel));
1082
+ const reader: ProjectReader = { list: () => [], text, head: () => '' };
1083
+ const files = readableFiles((rel) => text(rel) !== null);
1084
+ const cfg = config ?? closureConfigOf(readJsonObject(reader, 'config.json'));
1085
+ const walk = walkImports(walkEnv(reader, files, cfg), fromRel, new Set([fromRel]));
1086
+ if (walk.refused.size) return { ok: false, why: 'canvas', canvases: [...walk.refused].sort() };
1087
+ if (walk.missing.size) return { ok: false, why: 'missing', canvases: [] };
1088
+ return walk.blocked ? { ok: false, why: 'blocked', canvases: [] } : { ok: true };
1089
+ }
1090
+
1019
1091
  /**
1020
1092
  * gate-b-c4j — per canvas, the other canvases its import walk refuses (sorted; a canvas importing
1021
1093
  * none is absent): a frame on it renders none of them, so its module is refused. What the shell
@@ -1146,6 +1218,8 @@ function compute(
1146
1218
  const side = `${base}${suffix}`;
1147
1219
  if (side !== asset && files.has(side) && !PER_USE_PHOTO_RE.test(side)) read.add(side);
1148
1220
  }
1221
+ // The who-added record keyed by the asset's FULL name (burndown F6, asset-added.ts addedRelOf).
1222
+ if (files.has(`${asset}.added.json`)) read.add(`${asset}.added.json`);
1149
1223
  assetUsers.set(asset, new Set());
1150
1224
  }
1151
1225
  // Only for an asset the closure already holds (the element's own `src` put it there).
@@ -1209,6 +1283,8 @@ function isAssetSidecar(rel: string, files: Set<string>): boolean {
1209
1283
  for (const suffix of ASSET_SIDECAR_SUFFIXES) {
1210
1284
  if (!rel.endsWith(suffix)) continue;
1211
1285
  const base = rel.slice(0, -suffix.length);
1286
+ // `<asset name>.added.json` (burndown F6): its base IS the asset
1287
+ if (suffix === '.added.json' && files.has(base)) return true;
1212
1288
  for (const f of files) if (f !== rel && f.startsWith(`${base}.`)) return true;
1213
1289
  }
1214
1290
  return false;
@@ -198,6 +198,8 @@ export const WS_FRAME_CLASSES = Object.freeze({
198
198
  'thumb-ready': 'project',
199
199
  'ai:runs': 'project',
200
200
  'generate:job': 'project',
201
+ // Spend cap: a paid job waiting for the person's OK (id, kind, estimate) — project-wide like the job itself.
202
+ 'generate:approval': 'project',
201
203
  } as const satisfies Record<string, 'none' | 'canvas' | 'filtered' | 'project'>);
202
204
 
203
205
  type Frame = Record<string, unknown>;
@@ -597,6 +599,20 @@ export interface ProjectVisibility {
597
599
 
598
600
  const sources = new WeakMap<object, ProjectVisibility>();
599
601
 
602
+ /**
603
+ * #169 T8.1c — a write the closure cannot see: a first-segment `_` path (runtime state, DDR-115),
604
+ * which the listing skips and no import walk reads. Every canvas build rewrites `_locator.json`,
605
+ * and each bump threw away every frame's cached closure, so the next requests re-walked the whole
606
+ * design root on the event loop. The two local harness folders still count: a harness grant
607
+ * (`_draw/<slug>.proof.tsx`, `_photo/<slug>.bgremove.tsx`) walks its own text. Anything that is not
608
+ * a plain relative path bumps (fail closed).
609
+ */
610
+ function closureBlindTo(rel: unknown): boolean {
611
+ if (typeof rel !== 'string') return false;
612
+ const first = rel.split(/[\\/]/)[0] ?? '';
613
+ return first.startsWith('_') && first !== '_draw' && first !== '_photo';
614
+ }
615
+
600
616
  /**
601
617
  * The closure source of one project: its disk reader, a closure cache keyed by (grants,
602
618
  * tree generation) and the generation bump on every file change. ONE per Context, so the
@@ -612,7 +628,8 @@ export function projectVisibility(
612
628
  const hit = sources.get(ctx);
613
629
  if (hit) return hit;
614
630
  let generation = 0;
615
- ctx.bus.on('fs:any', () => {
631
+ ctx.bus.on('fs:any', (rel: unknown) => {
632
+ if (closureBlindTo(rel)) return;
616
633
  generation++;
617
634
  });
618
635
  const cache: ClosureCache = createClosureCache();
@@ -102,6 +102,8 @@ export const EXPORT_WRITES: ReadonlySet<string> = new Set([
102
102
  */
103
103
  export const EXPORT_TABLE_WRITES: ReadonlySet<string> = new Set([
104
104
  '/_api/export-jobs/retry',
105
+ // #128 T3.7b — Cancel stops one of the session's own unfinished exports (the owner's jobs only)
106
+ '/_api/export-jobs/cancel',
105
107
  // S8.7 — the Print preflight (paper, the back, safe margin, fonts) is numbers and names about an export
106
108
  '/_api/export-preflight',
107
109
  // P8 C2 — the pictures of what an export would reach (artboard stills from the picture service)
@@ -163,8 +165,14 @@ const CANVAS_ONLY_REFUSED = new Set([
163
165
  '/_api/diagnostics/report',
164
166
  '/_api/debug-bundle',
165
167
  '/_api/cloud/move',
168
+ '/_api/hub/link-folder',
166
169
  '/_api/cloud/projects',
167
170
  '/_api/github/repos',
171
+ // #122 (122-C) — the desktop shell's clip carriage (shell-token routes, `project` class): they move a
172
+ // canvas's text and pictures between projects, so a canvas-only session is refused before the token gate
173
+ '/_api/shell/clip-export',
174
+ '/_api/shell/clip-asset',
175
+ '/_api/shell/clip-import',
168
176
  ]);
169
177
 
170
178
  /** Is `pathname` a project-level route a canvas-only session is refused outright (p8-c4)? */
@@ -63,9 +63,19 @@ export function shellOpensWindow(command: unknown): boolean {
63
63
  * A trailing `&`, `nohup`, `setsid`, `disown` … (`bashBackgrounds`) or Claude Code's
64
64
  * `run_in_background`. Its window then stays open until the turn ends, not the call's return +
65
65
  * SHELL_SETTLE_MS: `nohup python3 w.py &` returns at once and writes later.
66
+ *
67
+ * #168 E4 — `where` is the project root and the shell's working directory (the ACP session's cwd is
68
+ * the repo root): with it, a script FILE the command runs (`bash go.sh`, `./go.sh`, `python3 w.py`) is
69
+ * read, and one that detaches counts too.
66
70
  */
67
- export function shellOutlivesCall(rawInput: unknown): boolean {
71
+ export function shellOutlivesCall(
72
+ rawInput: unknown,
73
+ where?: { root: string; cwd?: string }
74
+ ): boolean {
68
75
  const input = rawInput as { command?: unknown; run_in_background?: unknown } | null | undefined;
69
76
  if (!input || typeof input !== 'object') return false;
70
- return input.run_in_background === true || bashBackgrounds(input.command);
77
+ return (
78
+ input.run_in_background === true ||
79
+ bashBackgrounds(input.command, where ? { root: where.root, cwd: where.cwd ?? where.root } : {})
80
+ );
71
81
  }
@@ -59,8 +59,10 @@ const GENERATION_KEY_CUSTODY_RE = /^MAUDE_GEN_KEY/i;
59
59
  * Only the dev-server's github/token.ts talks to the bridge; an agent holding the key could
60
60
  * ask it for the profile's GitHub OAuth token.
61
61
  * • `MAUDE_SHELL_*` — the shell probe token + its info-file path (V2-3.4, V2-1.1 decision 8),
62
- * and `MAUDE_SHELL_SIDECAR` (not a secret: the app-port-range marker, port.ts — an agent's own
63
- * `maude design serve` must stay off the app's 46399–46408).
62
+ * the per-spawn attest key `MAUDE_SHELL_ATTEST_KEY` (#206, shell/attest.ts — an agent holding
63
+ * it could answer for the app's sidecar), and `MAUDE_SHELL_SIDECAR` (not a secret: the
64
+ * app-port-range marker, port.ts — an agent's own `maude design serve` must stay off the
65
+ * app's 46399–46408).
64
66
  * • `MAUDE_HOME_*` — the Home server's internal bearer, its page secret (V2-3.6 H1) and its
65
67
  * state dir. A project server never receives them; scrubbed anyway, so no spawn path can
66
68
  * hand them on.
@@ -154,6 +156,9 @@ export function scrubAgentEnv(
154
156
  if (PROFILE_POINTER_KEYS.has(key)) continue;
155
157
  // V2-1.15 §5.4 — a run binding is the bridge's to set, per chat (chatSpawnEnv)
156
158
  if (RUN_BINDING_KEYS.has(key)) continue;
159
+ // #206 — a server's role (`cli`: step down for the app's sidecar, shell/cli-yield.ts) is its
160
+ // own; a server the agent starts says its own role (server-up / `maude design serve`)
161
+ if (key === 'MAUDE_SERVER_ROLE') continue;
157
162
  out[key] = value;
158
163
  }
159
164
  return out;
@@ -295,8 +295,8 @@ function parseScopeElements(
295
295
  }
296
296
 
297
297
  // RC5 (rca/issue-canvas-hmr-optimistic-update-consistency) — the ACP chat agent
298
- // edits canvases through its own tools, so unlike `/design:edit` (which curls
299
- // /_api/ai/start|heartbeat|end around the edit) nothing announced it: no yellow
298
+ // edits canvases through its own tools, so unlike `/design:edit` (whose hooks
299
+ // open and close a registry run; the v1 /_api/ai/start bracket is retired) nothing announced it: no yellow
300
300
  // banner, no DDR-078 agent presence, no colored rim. This tracker watches the
301
301
  // streamed `tool_call` / `tool_call_update` notifications for edit-kind tools
302
302
  // touching canvas files under <designRoot> and drives the same `ai-activity`
@@ -462,7 +462,8 @@ export function createAgentActivityTracker(
462
462
 
463
463
  /**
464
464
  * Open the turn's project action (its run stage, always claim-only); `shell` = the window of one
465
- * call that cannot claim, for the canvases its command names (A1, S7).
465
+ * call that cannot claim, for the canvases its command names (A1, S7) — a PARKING window (#164):
466
+ * nothing this tracker opens ever claims a write for the run.
466
467
  */
467
468
  function openAction(shell?: {
468
469
  call: string;
@@ -538,6 +539,10 @@ export function createAgentActivityTracker(
538
539
  // name) used to open nothing, so its writes landed as the person's: it now opens a window over
539
540
  // every canvas for the run stage (outside writes only; no hold), and the design hook's post-bash
540
541
  // binds exactly the bytes it changed.
542
+ // #164 T5.1 — this window only PARKS (sync/action-stage.ts): it can never claim. A parked write
543
+ // joins the run only when the design hook's settle (POST /_api/agent/bash/settle, keyed by the
544
+ // same tool call id) claims its post-call bytes; with no settle it is released as outside at
545
+ // close + SETTLE_WAIT_MS, at stale, or at the run's end.
541
546
  const opens = !shellSeen.has(id) && shellOpensWindow(command);
542
547
  const named = opens
543
548
  ? namedDesignFiles(ctx.paths.designRoot, command).map(
@@ -550,7 +555,13 @@ export function createAgentActivityTracker(
550
555
  if (!named.length) shellAll.add(id);
551
556
  // p8-secfix-hook F2 — `nohup python3 w.py &` / `run_in_background` returns at once and
552
557
  // writes later: its window stays open until the turn ends (endTurn), not return + settle
553
- if (shellOutlivesCall(u.rawInput)) shellOutlives.add(id);
558
+ if (
559
+ shellOutlivesCall(u.rawInput, {
560
+ root: ctx.paths.repoRoot,
561
+ cwd: ctx.paths.repoRoot,
562
+ })
563
+ )
564
+ shellOutlives.add(id);
554
565
  shellWindow(id, true);
555
566
  }
556
567
  if (
@@ -9,6 +9,7 @@ import { createHash } from 'node:crypto';
9
9
  import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
10
10
  import { homedir } from 'node:os';
11
11
  import { dirname, join } from 'node:path';
12
+ import { e2eSwitch } from '../release-build.ts';
12
13
  import { scrubAgentEnv } from './env.ts';
13
14
  import { isE2eEnv, resolveClaudePath, setTrustedClaudeBin } from './probe.ts';
14
15
 
@@ -88,8 +89,17 @@ const NATIVE_INSTALL_CMD = 'curl -fsSL https://claude.ai/install.sh | bash';
88
89
  // clobber a genuine install). The e2e config points this at a disposable temp
89
90
  // path instead; unset in every normal launch, so real users always get the
90
91
  // real well-known path.
91
- const WELL_KNOWN_INSTALL_PATH =
92
- process.env.MAUDE_E2E_CLAUDE_INSTALL_PATH || join(homedir(), '.local', 'bin', 'claude');
92
+ export function wellKnownInstallPath(
93
+ env: Record<string, string | undefined> = process.env,
94
+ release?: boolean
95
+ ): string {
96
+ // #168 — a release build never redirects the install target.
97
+ return (
98
+ e2eSwitch(env, 'MAUDE_E2E_CLAUDE_INSTALL_PATH', release) ||
99
+ join(homedir(), '.local', 'bin', 'claude')
100
+ );
101
+ }
102
+ const WELL_KNOWN_INSTALL_PATH = wellKnownInstallPath();
93
103
 
94
104
  // Desktop-e2e stub (mirrors MAUDE_E2E_FAKE_GITHUB_LOGIN in oauth.rs) — running
95
105
  // the REAL `curl | bash` installer in a test harness is both slow/network-
@@ -99,7 +109,13 @@ const WELL_KNOWN_INSTALL_PATH =
99
109
  // e2e-overridden — see above) — through the EXACT SAME freshness + content-pin
100
110
  // verification path a real install goes through below, so that security-
101
111
  // critical code stays exercised, not bypassed. Never set in a normal launch.
102
- const E2E_FAKE_INSTALL = process.env.MAUDE_E2E_FAKE_CLAUDE_INSTALL === '1';
112
+ export function fakeInstallEnabled(
113
+ env: Record<string, string | undefined> = process.env,
114
+ release?: boolean
115
+ ): boolean {
116
+ return e2eSwitch(env, 'MAUDE_E2E_FAKE_CLAUDE_INSTALL', release) === '1';
117
+ }
118
+ const E2E_FAKE_INSTALL = fakeInstallEnabled();
103
119
  const FAKE_CLAUDE_SCRIPT = `#!/bin/sh
104
120
  # Maude desktop-e2e fake claude binary (DDR-166) — only ever written when
105
121
  # MAUDE_E2E_FAKE_CLAUDE_INSTALL=1. Implements just enough of \`auth status\`/
@@ -176,9 +192,10 @@ let installChild: ReturnType<typeof Bun.spawn> | null = null;
176
192
  * person's real `~/.local/bin/claude` (MAUDE_E2E_CLAUDE_INSTALL_PATH redirects only the fake's target).
177
193
  */
178
194
  export function installRefusal(
179
- env: Record<string, string | undefined> = process.env
195
+ env: Record<string, string | undefined> = process.env,
196
+ release?: boolean
180
197
  ): string | null {
181
- if (isE2eEnv(env) && env.MAUDE_E2E_FAKE_CLAUDE_INSTALL !== '1')
198
+ if (isE2eEnv(env, release) && env.MAUDE_E2E_FAKE_CLAUDE_INSTALL !== '1')
182
199
  return 'An e2e lane never runs the real Claude Code installer (set MAUDE_E2E_FAKE_CLAUDE_INSTALL=1).';
183
200
  return null;
184
201
  }
@@ -60,6 +60,7 @@ import { chmodSync, lstatSync, mkdirSync, readdirSync, rmSync } from 'node:fs';
60
60
  import { homedir, tmpdir } from 'node:os';
61
61
  import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
62
62
 
63
+ import { serverKeyDir } from '../shell/key-file.ts';
63
64
  import { agentPath } from './agent-path.ts';
64
65
  import { isInsideRoot, resolveRealPath } from './write-scope.ts';
65
66
 
@@ -272,6 +273,10 @@ export function mayRefusal(
272
273
  // the two files this server's own profile env names (MAUDE_CLOUD_CONFIG / HUBS_CONFIG_PATH)
273
274
  // wherever they are. The agent's env no longer carries those two pointers (acp/env.ts).
274
275
  // • ~/.ssh, ~/.aws, ~/.gnupg, ~/Library/Keychains.
276
+ // • The desktop app's own data folder (#206): `servers.json` (every tab's port + attest key),
277
+ // `cli.sock`, `run/` (the token-bridge port), `shell-info/` and `home/`. Named entries, not the
278
+ // whole folder: a Maude Cloud project's managed copy lives in its `projects/` and its session
279
+ // must keep reading its own files.
275
280
  //
276
281
  // Two layers, as above: the deny rules (Read — Claude Code applies Read rules to Grep/Glob
277
282
  // best-effort) and the live gate (`credentialRefusal`) for a request that does reach the bridge — a
@@ -289,10 +294,27 @@ export interface CredentialPaths {
289
294
  files: string[];
290
295
  }
291
296
 
297
+ /** The desktop app's identifier — its data folder's name (tauri.conf.json `identifier`). */
298
+ const APP_IDENTIFIER = 'com.maude.app';
299
+
300
+ /** The desktop app's data folder (Tauri `app_data_dir`) for a platform, or null when unknown. */
301
+ export function appDataDirFor(
302
+ env: Record<string, string | undefined>,
303
+ home: string,
304
+ platform: NodeJS.Platform
305
+ ): string | null {
306
+ if (platform === 'darwin') return join(home, 'Library', 'Application Support', APP_IDENTIFIER);
307
+ if (platform === 'win32')
308
+ return env.APPDATA && isAbsolute(env.APPDATA) ? join(env.APPDATA, APP_IDENTIFIER) : null;
309
+ const data = env.XDG_DATA_HOME && isAbsolute(env.XDG_DATA_HOME) ? env.XDG_DATA_HOME : null;
310
+ return join(data ?? join(home, '.local', 'share'), APP_IDENTIFIER);
311
+ }
312
+
292
313
  /** The credential folders/files for an env (absolute; the real path too when it differs). */
293
314
  export function credentialPathsFor(
294
315
  env: Record<string, string | undefined> = process.env,
295
- home: string = env.HOME || homedir()
316
+ home: string = env.HOME || homedir(),
317
+ platform: NodeJS.Platform = process.platform
296
318
  ): CredentialPaths {
297
319
  const dirs = new Set<string>();
298
320
  const files = new Set<string>();
@@ -306,6 +328,21 @@ export function credentialPathsFor(
306
328
  const xdg = env.XDG_CONFIG_HOME;
307
329
  if (xdg && xdg.length > 0 && isAbsolute(xdg)) addDir(join(xdg, 'maude'));
308
330
  for (const d of ['.ssh', '.aws', '.gnupg', join('Library', 'Keychains')]) addDir(join(home, d));
331
+ // sec-loopback-bearer §7.5 — terminal-started servers' API key files (shell/key-file.ts): the
332
+ // default state dir AND this env's XDG_STATE_HOME one — a terminal shell may set it when the app
333
+ // does not, so a server started there writes where this session's own env would not point
334
+ addDir(serverKeyDir({ HOME: home }));
335
+ addDir(serverKeyDir({ ...env, HOME: home }));
336
+ const appData = appDataDirFor(env, home, platform);
337
+ if (appData) {
338
+ for (const d of ['run', 'shell-info', 'home']) addDir(join(appData, d));
339
+ for (const f of ['servers.json', 'cli.sock']) {
340
+ const abs = resolve(appData, f);
341
+ files.add(abs);
342
+ const real = resolveRealPath(abs, abs);
343
+ if (real !== abs) files.add(real);
344
+ }
345
+ }
309
346
  for (const k of ['MAUDE_CLOUD_CONFIG', 'HUBS_CONFIG_PATH']) {
310
347
  const f = env[k];
311
348
  if (!f || !isAbsolute(f)) continue;
@@ -43,7 +43,12 @@ import { readFileSync } from 'node:fs';
43
43
  import { homedir } from 'node:os';
44
44
  import { basename, join } from 'node:path';
45
45
 
46
- import { DESIGN_PLUGIN_DIR, FLOW_PLUGIN_DIR, KGAI_PLUGIN_DIR } from '../paths.ts';
46
+ import {
47
+ DESIGN_PLUGIN_DIR,
48
+ DESIGN_VIDEO_PLUGIN_DIR,
49
+ FLOW_PLUGIN_DIR,
50
+ KGAI_PLUGIN_DIR,
51
+ } from '../paths.ts';
47
52
  import { readUiPrefs } from '../ui-prefs.ts';
48
53
 
49
54
  /**
@@ -65,6 +70,8 @@ export interface SessionPluginDeps {
65
70
  native: boolean;
66
71
  /** Bundled `design` plugin dir, or null (npm/web layout). */
67
72
  designDir: string | null;
73
+ /** Bundled `design-video` plugin dir (DDR-249), or null (npm/web layout / an older bundle). */
74
+ designVideoDir?: string | null;
68
75
  /** Bundled `flow` plugin dir, or null (npm/web layout). */
69
76
  flowDir: string | null;
70
77
  /** Bundled third-party `kgai` plugin dir, or null (only staged in the .app). */
@@ -86,6 +93,10 @@ export function computeSessionPlugins(deps: SessionPluginDeps): SdkPluginConfig[
86
93
  if (dir) out.push({ type: 'local', path: dir, skipMcpDiscovery: true });
87
94
  };
88
95
  add(deps.designDir);
96
+ // design-video (#156 §4, DDR-249) is opt-in in a terminal, but the app ships its video
97
+ // features (reel, footage analysis, video comps, Lottie handoff), so the chat always loads it.
98
+ // It needs design (its agents run under design's hooks), so it never loads alone.
99
+ if (deps.designDir) add(deps.designVideoDir ?? null);
89
100
  // `/flow` auto-load is intentionally OFF for now (2026-07-03) — the chat ships
90
101
  // design-only. `deps.flowDir` stays resolved (harmless) so restoring it is a
91
102
  // one-liner: re-add `add(deps.flowDir)`.
@@ -214,6 +225,7 @@ export function resolveSessionPlugins(): SdkPluginConfig[] {
214
225
  return computeSessionPlugins({
215
226
  native: isNativePluginContext(),
216
227
  designDir: DESIGN_PLUGIN_DIR,
228
+ designVideoDir: DESIGN_VIDEO_PLUGIN_DIR,
217
229
  flowDir: FLOW_PLUGIN_DIR,
218
230
  kgaiDir: KGAI_PLUGIN_DIR,
219
231
  });
@@ -11,6 +11,7 @@ import { existsSync, readFileSync, realpathSync } from 'node:fs';
11
11
  import { dirname, join, win32 } from 'node:path';
12
12
 
13
13
  import { DEV_SERVER_ROOT, IS_COMPILED_BINARY } from '../paths.ts';
14
+ import { e2eSwitch, IS_RELEASE_BUILD } from '../release-build.ts';
14
15
  import { scrubAgentEnv } from './env.ts';
15
16
 
16
17
  /** Adapter npm package — the renamed continuation of `@zed-industries/claude-code-acp`. */
@@ -133,7 +134,8 @@ function contentStillTrusted(path: string): boolean {
133
134
  */
134
135
  export function resolveClaudePath(
135
136
  env: Record<string, string | undefined> = process.env,
136
- which: (bin: string) => string | null = (bin) => Bun.which(bin)
137
+ which: (bin: string) => string | null = (bin) => Bun.which(bin),
138
+ release: boolean = IS_RELEASE_BUILD
137
139
  ): string | null {
138
140
  // An explicit, content-pinned `MAUDE_CLAUDE_BIN` override is checked FIRST
139
141
  // and always wins — including over the E2E force-missing stub below. This
@@ -153,17 +155,22 @@ export function resolveClaudePath(
153
155
  // DDR-166 — deterministic E2E stub (mirrors MAUDE_E2E_FAKE_GITHUB_LOGIN in
154
156
  // oauth.rs), simulating a machine where `claude` is absent from PATH.
155
157
  // Never set in a normal launch.
156
- if (env.MAUDE_E2E_FORCE_CLAUDE_STATUS === 'missing') return null;
158
+ if (e2eSwitch(env, 'MAUDE_E2E_FORCE_CLAUDE_STATUS', release) === 'missing') return null;
157
159
  // p8-e2e-isolation-r13 — an e2e lane gets ONLY the stub it names in MAUDE_CLAUDE_BIN (above). A PATH lookup is
158
160
  // what found the person's real `~/.local/bin/claude` in the 2026-10-27 V2-8.3 record: the sidecar's PATH is the
159
161
  // person's login-shell PATH (sidecar.rs), and that claude reads the real keychain. Normal launches never set a
160
162
  // MAUDE_E2E_* variable, so their resolution is unchanged.
161
- if (isE2eEnv(env)) return null;
163
+ if (isE2eEnv(env, release)) return null;
162
164
  return which('claude');
163
165
  }
164
166
 
165
167
  /** p8-e2e-isolation-r13 — true when any `MAUDE_E2E_*` variable is set non-empty (a desktop e2e lane / harness). */
166
- export function isE2eEnv(env: Record<string, string | undefined> = process.env): boolean {
168
+ export function isE2eEnv(
169
+ env: Record<string, string | undefined> = process.env,
170
+ release: boolean = IS_RELEASE_BUILD
171
+ ): boolean {
172
+ // #168 — a shipped build ignores every e2e switch (release-build.ts).
173
+ if (release) return false;
167
174
  for (const [k, v] of Object.entries(env)) if (k.startsWith('MAUDE_E2E_') && v) return true;
168
175
  return false;
169
176
  }