@dexhq/canvas 0.14.0 → 0.16.0

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 (451) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +5 -3
  3. package/app/canvas/activity-parts.tsx +50 -6
  4. package/app/canvas/activity.tsx +10 -18
  5. package/app/canvas/agent-changes.ts +18 -8
  6. package/app/canvas/anchoring.ts +15 -7
  7. package/app/canvas/canvas-context.tsx +6 -2
  8. package/app/canvas/canvas-input.ts +186 -14
  9. package/app/canvas/canvas-keys.ts +9 -0
  10. package/app/canvas/canvas-model.ts +7 -44
  11. package/app/canvas/canvas-panels.ts +1 -17
  12. package/app/canvas/canvas-scene.ts +250 -27
  13. package/app/canvas/canvas-ui.ts +13 -3
  14. package/app/canvas/canvas.css +147 -29
  15. package/app/canvas/change-notice.tsx +10 -1
  16. package/app/canvas/comment-layer.tsx +2 -1
  17. package/app/canvas/comments.tsx +270 -111
  18. package/app/canvas/element-link.ts +135 -0
  19. package/app/canvas/element-picker.ts +223 -27
  20. package/app/canvas/engine/canvas-gestures.ts +72 -17
  21. package/app/canvas/engine/canvas-store.ts +17 -1
  22. package/app/canvas/engine/engine.css +6 -3
  23. package/app/canvas/export-dialog.tsx +265 -0
  24. package/app/canvas/find-bar.tsx +817 -0
  25. package/app/canvas/find-model.ts +135 -0
  26. package/app/canvas/flow-canvas.tsx +83 -16
  27. package/app/canvas/follow-pin.ts +26 -6
  28. package/app/canvas/frame-context-menu.tsx +61 -7
  29. package/app/canvas/frame-node.tsx +19 -20
  30. package/app/canvas/imported-reviews.tsx +12 -22
  31. package/app/canvas/layout.ts +68 -22
  32. package/app/canvas/linked-element.tsx +196 -0
  33. package/app/canvas/live-page.ts +156 -19
  34. package/app/canvas/mentions.tsx +209 -0
  35. package/app/canvas/page-find.ts +220 -0
  36. package/app/canvas/page-style.ts +23 -0
  37. package/app/canvas/picked-box.tsx +21 -0
  38. package/app/canvas/removed-views-panel.tsx +4 -4
  39. package/app/canvas/request-node.tsx +151 -0
  40. package/app/canvas/review-panel.tsx +8 -3
  41. package/app/canvas/section-node.tsx +6 -133
  42. package/app/canvas/spec-margin.tsx +4 -1
  43. package/app/canvas/spec-threads.ts +24 -23
  44. package/app/canvas/teammates-layer.tsx +205 -0
  45. package/app/canvas/text-layer.tsx +103 -17
  46. package/app/canvas/thread-focus.tsx +14 -12
  47. package/app/canvas/tool-cursors.ts +7 -6
  48. package/app/canvas/tool-icons.tsx +24 -56
  49. package/app/canvas/typing.ts +12 -0
  50. package/app/canvas/use-activity.ts +0 -8
  51. package/app/canvas/use-agent-changes.tsx +40 -42
  52. package/app/canvas/use-canvas-clipboard.tsx +11 -14
  53. package/app/canvas/use-canvas-editor.ts +4 -2
  54. package/app/canvas/xray.ts +3 -12
  55. package/app/export/player-model.ts +159 -0
  56. package/app/export/player.tsx +198 -0
  57. package/app/export.html +31 -0
  58. package/app/export.tsx +9 -0
  59. package/app/frame/announce-refreshes.ts +21 -0
  60. package/app/frame/start-frame.tsx +50 -0
  61. package/app/frame/view-loads.ts +161 -0
  62. package/app/frame/views.ts +13 -49
  63. package/app/frame.tsx +2 -33
  64. package/app/i18n/locales/en/messages.po +233 -14
  65. package/app/i18n/locales/en/messages.ts +1 -1
  66. package/app/i18n/locales/pseudo/messages.po +232 -13
  67. package/app/i18n/locales/pseudo/messages.ts +1 -1
  68. package/app/icons/dex-glyphs.tsx +219 -0
  69. package/app/icons/glyphs.tsx +80 -80
  70. package/app/kit/use-flow.ts +2 -1
  71. package/app/live/canvas-teammates.ts +90 -0
  72. package/app/live/studio-api.ts +30 -20
  73. package/app/main.tsx +3 -0
  74. package/app/pages/canvas.tsx +45 -14
  75. package/app/pages/commands-settings.tsx +17 -3
  76. package/app/pages/render.tsx +39 -11
  77. package/app/shell/bell.tsx +15 -5
  78. package/app/shell/feedback-form.tsx +10 -21
  79. package/app/shell/feedback-link.tsx +2 -1
  80. package/app/shell/presence.tsx +123 -26
  81. package/app/shell/scaled-frame.tsx +21 -9
  82. package/app/shell/thread-list.tsx +25 -8
  83. package/app/shell/working-on.tsx +35 -3
  84. package/app/types.ts +21 -205
  85. package/app/ui/file-drop.ts +128 -0
  86. package/app/ui/prompt-editor.tsx +39 -11
  87. package/app/ui/reference.tsx +21 -8
  88. package/app/ui/shadcn/input-group.tsx +2 -2
  89. package/bin/sudio.mjs +1 -1
  90. package/dist/cli/banner.d.mts +4 -2
  91. package/dist/cli/banner.mjs +34 -11
  92. package/dist/cli/commands/app.mjs +19 -11
  93. package/dist/cli/commands/create.d.mts +5 -5
  94. package/dist/cli/commands/create.mjs +4 -4
  95. package/dist/cli/commands/export.d.mts +40 -0
  96. package/dist/cli/commands/export.mjs +66 -0
  97. package/dist/cli/commands/hook.mjs +2 -1
  98. package/dist/cli/commands/init.d.mts +2 -2
  99. package/dist/cli/commands/upgrade.mjs +1 -1
  100. package/dist/cli/help.d.mts +1 -1
  101. package/dist/cli/help.mjs +13 -7
  102. package/dist/cli/main.d.mts +42 -5
  103. package/dist/cli/main.mjs +1 -0
  104. package/dist/config/load.mjs +14 -2
  105. package/dist/config/project-files.d.mts +11 -0
  106. package/dist/config/project-files.mjs +23 -2
  107. package/dist/config/renamed.d.mts +7 -2
  108. package/dist/config/renamed.mjs +13 -3
  109. package/dist/content/capture.d.mts +2 -2
  110. package/dist/content/capture.mjs +2 -2
  111. package/dist/content/commands.d.mts +11 -9
  112. package/dist/content/commands.mjs +22 -16
  113. package/dist/content/comments-log.mjs +2 -1
  114. package/dist/content/content.d.mts +13 -143
  115. package/dist/content/content.mjs +55 -76
  116. package/dist/content/element-words.d.mts +42 -0
  117. package/dist/content/element-words.mjs +112 -0
  118. package/dist/content/flow-specs.mjs +1 -1
  119. package/dist/content/hosted-person.d.mts +31 -0
  120. package/dist/content/hosted-person.mjs +68 -0
  121. package/dist/content/merge-rules.d.mts +5 -0
  122. package/dist/content/merge-rules.mjs +17 -1
  123. package/dist/content/prototype-summary.d.mts +3 -39
  124. package/dist/content/prototype-summary.mjs +2 -3
  125. package/dist/content/prototypes.mjs +1 -1
  126. package/dist/content/screenshot.mjs +9 -0
  127. package/dist/content/text-edit.d.mts +24 -14
  128. package/dist/content/text-edit.mjs +92 -81
  129. package/dist/content/text-replace.d.mts +30 -0
  130. package/dist/content/text-replace.mjs +285 -0
  131. package/dist/content/thread-module.d.mts +2 -4
  132. package/dist/content/thread-module.mjs +4 -5
  133. package/dist/content/threads.mjs +1 -1
  134. package/dist/paste/paste.mjs +1 -1
  135. package/dist/paths.d.mts +0 -2
  136. package/dist/paths.mjs +1 -3
  137. package/dist/server/agent-env.d.mts +5 -1
  138. package/dist/server/agent-env.mjs +7 -2
  139. package/dist/server/agent-session.d.mts +14 -1
  140. package/dist/server/agent-session.mjs +84 -19
  141. package/dist/server/agents.d.mts +10 -0
  142. package/dist/server/agents.mjs +21 -6
  143. package/dist/server/build-pictures.mjs +1 -1
  144. package/dist/server/canvas-presence.d.mts +22 -0
  145. package/dist/server/canvas-presence.mjs +160 -0
  146. package/dist/server/channel.d.mts +13 -24
  147. package/dist/server/channel.mjs +55 -37
  148. package/dist/server/claimed-presence.d.mts +3 -2
  149. package/dist/server/claimed-presence.mjs +15 -7
  150. package/dist/server/close-check.mjs +2 -2
  151. package/dist/server/command-settings.mjs +1 -1
  152. package/dist/server/comments/actions.d.mts +145 -0
  153. package/dist/server/comments/actions.mjs +146 -0
  154. package/dist/server/comments/routes.d.mts +25 -0
  155. package/dist/server/comments/routes.mjs +67 -0
  156. package/dist/server/comments/tools.d.mts +6 -0
  157. package/dist/server/comments/tools.mjs +154 -0
  158. package/dist/server/dev-server.mjs +59 -23
  159. package/dist/server/export/build.d.mts +15 -0
  160. package/dist/server/export/build.mjs +220 -0
  161. package/dist/server/export/page.d.mts +25 -0
  162. package/dist/server/export/page.mjs +40 -0
  163. package/dist/server/export/plugin.d.mts +31 -0
  164. package/dist/server/export/plugin.mjs +69 -0
  165. package/dist/server/export/run.d.mts +9 -0
  166. package/dist/server/export/run.mjs +61 -0
  167. package/dist/server/export/save.d.mts +7 -0
  168. package/dist/server/export/save.mjs +29 -0
  169. package/dist/server/file-lock.d.mts +2 -2
  170. package/dist/server/file-lock.mjs +130 -36
  171. package/dist/server/hosted.d.mts +8 -0
  172. package/dist/server/hosted.mjs +78 -0
  173. package/dist/server/live-mirror.mjs +66 -10
  174. package/dist/server/live.mjs +28 -1
  175. package/dist/server/mcp.d.mts +0 -2
  176. package/dist/server/mcp.mjs +9 -8
  177. package/dist/server/me.d.mts +3 -1
  178. package/dist/server/me.mjs +8 -2
  179. package/dist/server/notices.d.mts +1 -1
  180. package/dist/server/notices.mjs +1 -1
  181. package/dist/server/open-page.d.mts +22 -0
  182. package/dist/server/open-page.mjs +20 -2
  183. package/dist/server/outcome.d.mts +22 -0
  184. package/dist/server/outcome.mjs +8 -0
  185. package/dist/server/own-copies.mjs +1 -1
  186. package/dist/server/people.d.mts +8 -3
  187. package/dist/server/people.mjs +6 -2
  188. package/dist/server/pictures.d.mts +1 -1
  189. package/dist/server/pictures.mjs +2 -2
  190. package/dist/server/port.d.mts +12 -0
  191. package/dist/server/port.mjs +66 -14
  192. package/dist/server/prebundle.d.mts +32 -0
  193. package/dist/server/prebundle.mjs +115 -0
  194. package/dist/server/presence.d.mts +4 -1
  195. package/dist/server/presence.mjs +2 -2
  196. package/dist/server/problems.d.mts +8 -0
  197. package/dist/server/problems.mjs +13 -0
  198. package/dist/server/requests.d.mts +5 -1
  199. package/dist/server/requests.mjs +76 -78
  200. package/dist/server/source-stamp.d.mts +4 -3
  201. package/dist/server/source-stamp.mjs +60 -31
  202. package/dist/server/state.d.mts +19 -10
  203. package/dist/server/state.mjs +27 -18
  204. package/dist/server/studio-for.d.mts +5 -0
  205. package/dist/server/studio-for.mjs +17 -3
  206. package/dist/server/sync-install.d.mts +8 -12
  207. package/dist/server/sync-install.mjs +12 -30
  208. package/dist/server/thread-source.d.mts +8 -0
  209. package/dist/server/thread-source.mjs +25 -6
  210. package/dist/server/tools/describe.d.mts +1 -1
  211. package/dist/server/tools/describe.mjs +1 -1
  212. package/dist/server/tools/export.d.mts +5 -0
  213. package/dist/server/tools/export.mjs +35 -0
  214. package/dist/server/tools/feedback.d.mts +1 -1
  215. package/dist/server/tools/place-frame.mjs +16 -16
  216. package/dist/server/tools/reading.mjs +13 -4
  217. package/dist/server/tools/show.d.mts +1 -1
  218. package/dist/server/tools/snapshot.d.mts +1 -1
  219. package/dist/server/tools/thread-list.mjs +2 -2
  220. package/dist/server/tools/watch.mjs +5 -3
  221. package/dist/server/vite.d.mts +9 -4
  222. package/dist/server/vite.mjs +65 -63
  223. package/dist/server/web-app.mjs +4 -7
  224. package/dist/server/welcome.mjs +2 -1
  225. package/dist/server/work-groups.mjs +1 -1
  226. package/dist/setup/apply.d.mts +4 -0
  227. package/dist/setup/apply.mjs +5 -4
  228. package/dist/setup/create.d.mts +4 -2
  229. package/dist/setup/create.mjs +72 -22
  230. package/dist/setup/design-system-checks.mjs +3 -17
  231. package/dist/setup/desktop-app-script.mjs +4 -3
  232. package/dist/setup/desktop-app-start.d.mts +8 -2
  233. package/dist/setup/desktop-app-start.mjs +64 -29
  234. package/dist/setup/desktop-app.d.mts +8 -0
  235. package/dist/setup/desktop-app.mjs +19 -3
  236. package/dist/setup/detect/workspace.d.mts +10 -10
  237. package/dist/setup/detect/workspace.mjs +10 -12
  238. package/dist/setup/detect.d.mts +0 -2
  239. package/dist/setup/detect.mjs +1 -3
  240. package/dist/setup/doctor.d.mts +4 -1
  241. package/dist/setup/doctor.mjs +8 -6
  242. package/dist/setup/migrate/dex-folder.d.mts +61 -0
  243. package/dist/setup/migrate/dex-folder.mjs +544 -0
  244. package/dist/setup/migrate/files-folder.mjs +1 -1
  245. package/dist/setup/migrate/guides.mjs +1 -1
  246. package/dist/setup/migrate/migrations.mjs +4 -0
  247. package/dist/setup/migrate/row-titles.mjs +1 -1
  248. package/dist/setup/migrate/setup-files.d.mts +5 -0
  249. package/dist/setup/migrate/setup-files.mjs +115 -0
  250. package/dist/setup/migrate/studio-state.d.mts +2 -2
  251. package/dist/setup/migrate/studio-state.mjs +4 -4
  252. package/dist/setup/placement.d.mts +1 -1
  253. package/dist/setup/placement.mjs +5 -4
  254. package/dist/setup/plan.d.mts +5 -5
  255. package/dist/setup/plan.mjs +8 -12
  256. package/dist/setup/project.d.mts +6 -1
  257. package/dist/setup/project.mjs +10 -10
  258. package/dist/setup/prompts.d.mts +2 -1
  259. package/dist/setup/prompts.mjs +4 -3
  260. package/dist/setup/questions.mjs +3 -2
  261. package/dist/setup/starters.d.mts +3 -1
  262. package/dist/setup/starters.mjs +9 -3
  263. package/dist/setup/write.d.mts +15 -3
  264. package/dist/setup/write.mjs +23 -3
  265. package/dist/shared/annotations-core.mjs +1 -1
  266. package/dist/shared/canvas-core.d.mts +22 -7
  267. package/dist/shared/canvas-core.mjs +39 -11
  268. package/dist/shared/canvas-file.d.mts +201 -0
  269. package/dist/shared/canvas-file.mjs +1 -0
  270. package/dist/shared/comments/routes.d.mts +55 -0
  271. package/dist/shared/comments/routes.mjs +39 -0
  272. package/dist/shared/export-core.d.mts +62 -0
  273. package/dist/shared/export-core.mjs +101 -0
  274. package/dist/shared/feedback.d.mts +8 -0
  275. package/dist/shared/feedback.mjs +10 -2
  276. package/dist/shared/live-core.d.mts +2 -0
  277. package/dist/shared/live-core.mjs +6 -1
  278. package/dist/shared/live-presence.d.mts +57 -2
  279. package/dist/shared/live-presence.mjs +90 -4
  280. package/dist/shared/page-messages.d.mts +14 -1
  281. package/dist/shared/page-messages.mjs +30 -3
  282. package/dist/shared/page-review.d.mts +2 -11
  283. package/dist/shared/page-review.mjs +4 -13
  284. package/dist/shared/people-core.d.mts +28 -0
  285. package/dist/shared/people-core.mjs +27 -1
  286. package/dist/shared/presence-core.d.mts +13 -0
  287. package/dist/shared/presence-core.mjs +11 -2
  288. package/dist/shared/references-core.d.mts +4 -0
  289. package/dist/shared/references-core.mjs +12 -4
  290. package/dist/shared/review-file.d.mts +5 -0
  291. package/dist/shared/review-file.mjs +23 -13
  292. package/dist/shared/server-page.mjs +1 -1
  293. package/dist/shared/signup.d.mts +2 -5
  294. package/dist/shared/signup.mjs +2 -35
  295. package/dist/shared/studio-events.d.mts +0 -6
  296. package/dist/shared/studio-events.mjs +1 -5
  297. package/dist/shared/studio-files.d.mts +21 -0
  298. package/dist/shared/studio-files.mjs +16 -2
  299. package/dist/shared/studio-routes.d.mts +29 -63
  300. package/dist/shared/studio-routes.mjs +1 -69
  301. package/dist/shared/threads-core.d.mts +29 -6
  302. package/dist/shared/threads-core.mjs +68 -13
  303. package/extension/dist/feedback.js +104 -284
  304. package/extension/dist/manifest.json +1 -1
  305. package/extension/dist/picker.js +104 -284
  306. package/package.json +2 -2
  307. package/src/cli/banner.ts +45 -11
  308. package/src/cli/commands/app.ts +23 -8
  309. package/src/cli/commands/create.ts +4 -4
  310. package/src/cli/commands/export.ts +78 -0
  311. package/src/cli/commands/hook.ts +4 -1
  312. package/src/cli/commands/upgrade.ts +1 -1
  313. package/src/cli/help.ts +13 -7
  314. package/src/cli/main.ts +1 -0
  315. package/src/config/load.ts +26 -2
  316. package/src/config/project-files.ts +36 -6
  317. package/src/config/renamed.ts +19 -4
  318. package/src/content/capture.ts +6 -12
  319. package/src/content/commands.ts +30 -18
  320. package/src/content/comments-log.ts +4 -1
  321. package/src/content/content.ts +71 -257
  322. package/src/content/element-words.ts +175 -0
  323. package/src/content/flow-specs.ts +2 -1
  324. package/src/content/hosted-person.ts +107 -0
  325. package/src/content/merge-rules.ts +29 -0
  326. package/src/content/prototype-summary.ts +4 -44
  327. package/src/content/review-pages.ts +2 -1
  328. package/src/content/screenshot.ts +14 -0
  329. package/src/content/text-edit.ts +172 -105
  330. package/src/content/text-replace.ts +420 -0
  331. package/src/content/thread-module.ts +2 -4
  332. package/src/content/trash.ts +1 -1
  333. package/src/paths.ts +0 -8
  334. package/src/server/agent-env.ts +12 -2
  335. package/src/server/agent-session.ts +124 -34
  336. package/src/server/agents.ts +48 -17
  337. package/src/server/canvas-presence.ts +237 -0
  338. package/src/server/channel.ts +95 -53
  339. package/src/server/claimed-presence.ts +26 -10
  340. package/src/server/command-settings.ts +1 -1
  341. package/src/server/comments/actions.ts +333 -0
  342. package/src/server/comments/routes.ts +131 -0
  343. package/src/server/comments/tools.ts +317 -0
  344. package/src/server/dev-server.ts +94 -33
  345. package/src/server/export/build.ts +310 -0
  346. package/src/server/export/page.ts +85 -0
  347. package/src/server/export/plugin.ts +138 -0
  348. package/src/server/export/run.ts +79 -0
  349. package/src/server/export/save.ts +38 -0
  350. package/src/server/file-lock.ts +205 -54
  351. package/src/server/hosted.ts +113 -0
  352. package/src/server/live-mirror.ts +93 -8
  353. package/src/server/live.ts +46 -1
  354. package/src/server/machine-update.ts +3 -3
  355. package/src/server/mcp.ts +15 -14
  356. package/src/server/me.ts +12 -6
  357. package/src/server/notices.ts +2 -2
  358. package/src/server/open-page.ts +54 -4
  359. package/src/server/outcome.ts +26 -0
  360. package/src/server/people.ts +13 -3
  361. package/src/server/pictures.ts +2 -2
  362. package/src/server/port.ts +94 -20
  363. package/src/server/prebundle.ts +230 -0
  364. package/src/server/presence.ts +12 -4
  365. package/src/server/problems.ts +11 -0
  366. package/src/server/requests.ts +115 -110
  367. package/src/server/roster.ts +1 -1
  368. package/src/server/saved.ts +1 -1
  369. package/src/server/source-stamp.ts +118 -37
  370. package/src/server/state.ts +53 -31
  371. package/src/server/studio-for.ts +26 -2
  372. package/src/server/sync-install.ts +35 -26
  373. package/src/server/thread-place.ts +2 -4
  374. package/src/server/thread-source.ts +35 -3
  375. package/src/server/tools/export.ts +56 -0
  376. package/src/server/tools/place-frame.ts +23 -15
  377. package/src/server/tools/reading.ts +16 -3
  378. package/src/server/tools/thread-list.ts +1 -1
  379. package/src/server/tools/watch.ts +7 -7
  380. package/src/server/updates.ts +2 -2
  381. package/src/server/vite.ts +106 -110
  382. package/src/server/web-app.ts +11 -9
  383. package/src/server/welcome.ts +3 -1
  384. package/src/setup/apply.ts +8 -5
  385. package/src/setup/create.ts +101 -27
  386. package/src/setup/design-system-checks.ts +8 -21
  387. package/src/setup/desktop-app-script.ts +4 -3
  388. package/src/setup/desktop-app-start.ts +94 -26
  389. package/src/setup/desktop-app.ts +23 -2
  390. package/src/setup/detect/workspace.ts +20 -21
  391. package/src/setup/detect.ts +0 -4
  392. package/src/setup/doctor.ts +13 -6
  393. package/src/setup/migrate/dex-folder.ts +842 -0
  394. package/src/setup/migrate/files-folder.ts +1 -1
  395. package/src/setup/migrate/guides.ts +3 -1
  396. package/src/setup/migrate/migrations.ts +8 -2
  397. package/src/setup/migrate/setup-files.ts +198 -0
  398. package/src/setup/migrate/studio-state.ts +12 -10
  399. package/src/setup/own-app.ts +1 -1
  400. package/src/setup/placement.ts +7 -6
  401. package/src/setup/plan.ts +13 -18
  402. package/src/setup/project.ts +11 -10
  403. package/src/setup/prompts.ts +5 -4
  404. package/src/setup/questions.ts +6 -3
  405. package/src/setup/starters.ts +11 -4
  406. package/src/setup/write.ts +34 -3
  407. package/src/shared/canvas-core.ts +48 -9
  408. package/src/shared/canvas-file.ts +205 -0
  409. package/src/shared/comments/routes.ts +81 -0
  410. package/src/shared/export-core.ts +198 -0
  411. package/src/shared/feedback.ts +14 -4
  412. package/src/shared/live-core.ts +8 -0
  413. package/src/shared/live-presence.ts +171 -2
  414. package/src/shared/page-messages.ts +38 -2
  415. package/src/shared/page-review.ts +11 -16
  416. package/src/shared/people-core.ts +44 -0
  417. package/src/shared/presence-core.ts +18 -2
  418. package/src/shared/references-core.ts +22 -3
  419. package/src/shared/review-file.ts +28 -12
  420. package/src/shared/server-page.ts +2 -1
  421. package/src/shared/signup.ts +4 -28
  422. package/src/shared/studio-events.ts +0 -13
  423. package/src/shared/studio-files.ts +29 -1
  424. package/src/shared/studio-routes.ts +32 -65
  425. package/src/shared/threads-core.ts +134 -12
  426. package/templates/methods/explore.md +1 -1
  427. package/templates/methods/handoff.md +1 -1
  428. package/templates/methods/review.md +2 -1
  429. package/templates/rules/canvas-frames.md +6 -3
  430. package/templates/rules/commands.md +1 -0
  431. package/templates/rules/prototypes.md +1 -1
  432. package/templates/rules/studio.md +17 -11
  433. package/templates/skills/comprehend/SKILL.md +56 -0
  434. package/templates/skills/distill/SKILL.md +172 -0
  435. package/templates/skills/export-prototype/SKILL.md +35 -0
  436. package/templates/skills/riff/SKILL.md +21 -0
  437. package/templates/skills/riff-deep/SKILL.md +40 -0
  438. package/templates/skills/riff-max/SKILL.md +46 -0
  439. package/templates/skills/riff-state/SKILL.md +45 -0
  440. package/templates/skills/riff-up/SKILL.md +38 -0
  441. package/templates/skills/riff-wide/SKILL.md +40 -0
  442. package/templates/starters/standalone/README.md +1 -1
  443. package/templates/starters/turborepo/README.md +2 -2
  444. package/templates/starters/turborepo/apps/web/src/app.tsx +2 -2
  445. package/templates/starters/vite/README.md +1 -1
  446. package/dist/server/tools/close-reply.d.mts +0 -6
  447. package/dist/server/tools/close-reply.mjs +0 -138
  448. package/dist/server/tools/comment.d.mts +0 -6
  449. package/dist/server/tools/comment.mjs +0 -49
  450. package/src/server/tools/close-reply.ts +0 -271
  451. package/src/server/tools/comment.ts +0 -96
@@ -0,0 +1,115 @@
1
+ import { posix as posix$1 } from "../../paths.mjs";
2
+ import { MERGE_RULES, withNewMerges } from "../../content/merge-rules.mjs";
3
+ import { UPGRADE_COMMAND } from "./migration.mjs";
4
+ import { listing } from "../../shared/listing.mjs";
5
+ import { AGENTS, addAgent, agentRootOf, agentSetups } from "../../server/agents.mjs";
6
+ import { STUDIO_TYPES, STUDIO_TYPES_FILE, copiesPaths, renamedScripts } from "../write.mjs";
7
+ import { AGENT_FILES } from "../plan.mjs";
8
+ import { editManifest, studioTsconfig } from "../apply.mjs";
9
+ import { existsSync } from "node:fs";
10
+ import { join, relative, resolve } from "node:path";
11
+ import { readFile, writeFile } from "node:fs/promises";
12
+ //#region src/setup/migrate/setup-files.ts
13
+ const readIfThere = async (file) => existsSync(file) ? await readFile(file, "utf8") : void 0;
14
+ /** Agents whose config has the studio only under an older name. */
15
+ async function agentChanges({ root, content }) {
16
+ const agentRoot = agentRootOf(root);
17
+ return (await agentSetups(root, content, agentRoot)).flatMap(({ id, old, oneClick }) => {
18
+ if (!(old && oneClick && id !== "other")) return [];
19
+ const files = AGENT_FILES[id].filter((file) => existsSync(join(agentRoot, file)));
20
+ return [{
21
+ does: `${listing(files)} (${AGENTS[id].name ?? id})`,
22
+ path: join(agentRoot, files[0] ?? ""),
23
+ write: () => addAgent(id, root, content, agentRoot)
24
+ }];
25
+ });
26
+ }
27
+ /** The studio's tsconfig, when it copies paths as setups before 0.13 did. */
28
+ async function tsconfigChanges({ root, content }) {
29
+ const path = join(content, "tsconfig.json");
30
+ const own = resolve(content) === resolve(root);
31
+ const text = await readIfThere(path);
32
+ if (own || text === void 0 || !copiesPaths(text)) return [];
33
+ const types = join(content, STUDIO_TYPES_FILE);
34
+ return [{
35
+ does: posix$1(relative(root, path)),
36
+ path,
37
+ write: async () => {
38
+ await writeFile(path, studioTsconfig({
39
+ content,
40
+ packageDir: root
41
+ }));
42
+ if (!existsSync(types)) await writeFile(types, STUDIO_TYPES);
43
+ }
44
+ }];
45
+ }
46
+ /** The scripts setup wrote running `sudio`. */
47
+ async function scriptChanges({ root }) {
48
+ const path = join(root, "package.json");
49
+ const text = await readIfThere(path);
50
+ let scripts = {};
51
+ try {
52
+ scripts = JSON.parse(text ?? "{}").scripts ?? {};
53
+ } catch {
54
+ return [];
55
+ }
56
+ const renamed = renamedScripts(scripts);
57
+ const names = Object.keys(renamed).map((name) => `"${name}"`);
58
+ if (names.length === 0) return [];
59
+ return [{
60
+ does: `package.json ${names.length === 1 ? "script" : "scripts"} ${listing(names)}`,
61
+ path,
62
+ write: () => editManifest(path, (manifest) => {
63
+ manifest.scripts = {
64
+ ...manifest.scripts,
65
+ ...renamed
66
+ };
67
+ })
68
+ }];
69
+ }
70
+ /** Each .gitattributes the studio wrote that names Sudio's merges. */
71
+ async function mergeChanges({ root, content }) {
72
+ const changes = [];
73
+ for (const folder of Object.keys(MERGE_RULES)) {
74
+ const path = join(content, folder, ".gitattributes");
75
+ const text = await readIfThere(path);
76
+ const updated = text === void 0 ? text : withNewMerges(text);
77
+ if (updated !== void 0 && updated !== text) changes.push({
78
+ does: posix$1(relative(root, path)),
79
+ path,
80
+ write: () => writeFile(path, updated)
81
+ });
82
+ }
83
+ return changes;
84
+ }
85
+ /** Every file setup wrote that an older name is left in. */
86
+ const changesIn = async (project) => (await Promise.all([
87
+ agentChanges,
88
+ tsconfigChanges,
89
+ scriptChanges,
90
+ mergeChanges
91
+ ].map((changes) => changes(project)))).flat();
92
+ const listOf = (steps) => steps.map(({ does }) => does).join(", ");
93
+ /** What setup wrote under older names is written as setup writes it now. */
94
+ const setupFilesMigration = {
95
+ name: "setup files",
96
+ plan: async (project) => (await changesIn(project)).map(({ does, path }) => ({
97
+ kind: "change",
98
+ does,
99
+ path
100
+ })),
101
+ apply: async (project, steps) => {
102
+ const planned = new Set(steps.map(({ path }) => path));
103
+ for (const change of await changesIn(project)) if (planned.has(change.path)) await change.write();
104
+ },
105
+ report: (steps, { dryRun }) => {
106
+ if (steps.length === 0) return dryRun ? ["Agents' configs, the tsconfig, scripts and merges: nothing to change."] : [];
107
+ return [`${dryRun ? "Would write" : "Wrote"} as setup does now, with Dex's names: ${listOf(steps)}`, ""];
108
+ },
109
+ warning: (steps) => ({
110
+ message: `Written by an older setup, with names Dex no longer uses (sudio, @sudio/core): ${listOf(steps)}`,
111
+ fix: `Run ${UPGRADE_COMMAND} to write ${steps.length === 1 ? "it" : "them"} as \`dex create\` does now, keeping anything else in ${steps.length === 1 ? "it" : "them"}.`
112
+ })
113
+ };
114
+ //#endregion
115
+ export { setupFilesMigration };
@@ -8,7 +8,7 @@ export interface StateChange {
8
8
  path: string;
9
9
  }
10
10
  /**
11
- * Move a studio's presence and snapshots into `.studio/`, and its
11
+ * Move a studio's presence and snapshots into `.local/`, and its
12
12
  * `.gitignore` to the one line. `root` is the project (where `.gitignore`
13
13
  * and `dex.config.*` are), `content` the studio folder. Returns what it
14
14
  * changed; with `dryRun`, what it would change, changing nothing. Running it
@@ -17,6 +17,6 @@ export interface StateChange {
17
17
  export declare function migrateStudioState(root: string, content: string, { dryRun }?: {
18
18
  dryRun?: boolean;
19
19
  }): Promise<StateChange[]>;
20
- /** Presence and snapshots move into `.studio/`. */
20
+ /** Presence and snapshots move into `.local/`. */
21
21
  export declare const studioStateMigration: Migration;
22
22
  //#endregion
@@ -86,7 +86,7 @@ function snapshotsStep(root, content) {
86
86
  };
87
87
  }
88
88
  /**
89
- * Move a studio's presence and snapshots into `.studio/`, and its
89
+ * Move a studio's presence and snapshots into `.local/`, and its
90
90
  * `.gitignore` to the one line. `root` is the project (where `.gitignore`
91
91
  * and `dex.config.*` are), `content` the studio folder. Returns what it
92
92
  * changed; with `dryRun`, what it would change, changing nothing. Running it
@@ -105,7 +105,7 @@ async function migrateStudioState(root, content, { dryRun = false } = {}) {
105
105
  }
106
106
  return changes;
107
107
  }
108
- /** Presence and snapshots move into `.studio/`. */
108
+ /** Presence and snapshots move into `.local/`. */
109
109
  const studioStateMigration = {
110
110
  name: "studio state",
111
111
  plan: async ({ root, content }) => (await migrateStudioState(root, content, { dryRun: true })).map(({ does, path }) => ({
@@ -117,12 +117,12 @@ const studioStateMigration = {
117
117
  await migrateStudioState(root, content);
118
118
  },
119
119
  report: (steps, { dryRun }) => steps.length === 0 ? [] : [
120
- `Studio state${dryRun ? " (would move)" : ""}: into .studio/`,
120
+ `Studio state${dryRun ? " (would move)" : ""}: into .local/`,
121
121
  ...steps.map(({ does }) => ` ${does}`),
122
122
  ""
123
123
  ],
124
124
  warning: (steps) => ({
125
- message: "The studio keeps presence or snapshots outside .studio/",
125
+ message: "The studio keeps presence or snapshots outside .local/",
126
126
  fix: `Run ${UPGRADE_COMMAND} to ${steps.map(({ does }) => does).join("; ")}.`
127
127
  })
128
128
  };
@@ -15,7 +15,7 @@ export declare const PLACEMENT_FLAG = "--app <name> | --in <package>";
15
15
  * then its apps and the packages that hold components.
16
16
  */
17
17
  export declare function workspaceLines(workspace: Workspace): string[];
18
- /** A placement, for people: "its own app, apps/studio (@acme/studio)". */
18
+ /** A placement, for people: "its own app, apps/dex (@acme/dex)". */
19
19
  export declare function describePlacement(placement: Placement): string;
20
20
  /** Its own app, named: apps/<name>, scoped as the workspace's packages are. */
21
21
  export declare function namedOwnApp(workspace: Workspace, name: string): OwnAppPlacement;
@@ -1,3 +1,4 @@
1
+ import "../shared/studio-files.mjs";
1
2
  import { readJson } from "../config/project-files.mjs";
2
3
  import { insideAppPlacement, outsideGlobs, ownAppPlacement } from "./detect/workspace.mjs";
3
4
  import { Cancelled } from "./prompts.mjs";
@@ -86,7 +87,7 @@ function workspaceLines(workspace) {
86
87
  ...others > 0 ? [`and ${others} other package${others === 1 ? "" : "s"}`] : []
87
88
  ];
88
89
  }
89
- /** A placement, for people: "its own app, apps/studio (@acme/studio)". */
90
+ /** A placement, for people: "its own app, apps/dex (@acme/dex)". */
90
91
  function describePlacement(placement) {
91
92
  if (placement.kind === "own-app") return `its own app, ${placement.folder} (${placement.packageName})`;
92
93
  return `inside ${placement.packageFolder === "." ? "the workspace root" : placement.packageFolder}, in ${placement.folder}`;
@@ -99,7 +100,7 @@ const placementLabel = (placement, recommended) => {
99
100
  /** Its own app, named: apps/<name>, scoped as the workspace's packages are. */
100
101
  function namedOwnApp(workspace, name) {
101
102
  const clean = name.trim().replace(TRAILING_SLASHES_RE, "");
102
- if (!APP_NAME_RE.test(clean)) throw new Error(`--app takes a folder name, like "studio" or "design-studio", not "${name}".`);
103
+ if (!APP_NAME_RE.test(clean)) throw new Error(`--app takes a folder name, like "dex" or "design-dex", not "${name}".`);
103
104
  const parent = ownAppPlacement(workspace).folder.split("/").slice(0, -1).join("/");
104
105
  const folder = parent ? `${parent}/${clean}` : clean;
105
106
  const dir = join(workspace.root, ...folder.split("/"));
@@ -124,8 +125,8 @@ const rootPlacement = (workspace) => ({
124
125
  packageDir: workspace.root,
125
126
  packageFolder: ".",
126
127
  packageName: void 0,
127
- dir: join(workspace.root, "studio"),
128
- folder: "studio",
128
+ dir: join(workspace.root, "dex"),
129
+ folder: "dex",
129
130
  flag: "--in ."
130
131
  });
131
132
  /** The package `--in` names, by folder or by name. */
@@ -46,12 +46,12 @@ export type PlanStep = {
46
46
  export interface StudioTarget {
47
47
  /**
48
48
  * single: the project on its own, or a package set up by itself;
49
- * inside-app: a studio/ folder of a workspace app; own-app: apps/<name>.
49
+ * inside-app: a Dex folder, dex/, of a workspace app; own-app: apps/<name>.
50
50
  */
51
51
  kind: "single" | "inside-app" | "own-app";
52
- /** The package that holds dex.config.ts: ".", "apps/web", "apps/studio". */
52
+ /** The package that holds dex.config.ts: ".", "apps/web", "apps/dex". */
53
53
  package: string;
54
- /** The studio's content folder: "studio", "apps/web/studio", "apps/studio". */
54
+ /** The Dex folder: "dex", "apps/web/dex", "apps/dex". */
55
55
  studio: string;
56
56
  }
57
57
  /** What setting up in a workspace adds to a single project's setup. */
@@ -69,7 +69,7 @@ export interface WorkspaceSetup {
69
69
  }
70
70
  export interface SetupPlan {
71
71
  steps: PlanStep[];
72
- /** The studio's folder, relative to where the plan starts: "studio". */
72
+ /** The studio's folder, relative to where the plan starts: "dex". */
73
73
  studio: string;
74
74
  target: StudioTarget;
75
75
  /** Set in a workspace. */
@@ -129,7 +129,7 @@ export interface PlanInput {
129
129
  studioPackage: StudioPackage;
130
130
  /** `--studio`: where to install the studio from. */
131
131
  studioSpec: string | undefined;
132
- /** Where the studio goes; a studio/ folder of the project by default. */
132
+ /** Where the studio goes; the project's Dex folder, dex/, by default. */
133
133
  target?: StudioTarget;
134
134
  /** The studio's tsconfig.json as it is, when it has one. */
135
135
  tsconfig?: string;
@@ -1,11 +1,10 @@
1
1
  import { PACKAGE_NAME } from "../paths.mjs";
2
2
  import { STUDIO_FILES } from "../shared/studio-files.mjs";
3
- import { parseJsonc } from "../config/project-files.mjs";
4
3
  import { listing } from "../shared/listing.mjs";
5
4
  import { designMdDetail, fromProject } from "./design-md-setup.mjs";
6
5
  import { pmCommand } from "../config/package-manager.mjs";
7
6
  import { agentName } from "./project.mjs";
8
- import { OLD_SCRIPTS, STUDIO_TYPES_FILE, hasPointer, ignoreFile, missingIgnoreLines, missingScripts, pnpmDecidesEsbuild, withEsbuildBuilds } from "./write.mjs";
7
+ import { OLD_SCRIPTS, STUDIO_TYPES_FILE, copiesPaths, hasPointer, ignoreFile, missingIgnoreLines, missingScripts, pnpmDecidesEsbuild, renamedScripts, withEsbuildBuilds } from "./write.mjs";
9
8
  import { PROVIDER_FILE, shadcnInitFlags } from "./questions.mjs";
10
9
  //#region src/setup/plan.ts
11
10
  /** `path` in the package at `folder`: "apps/web/package.json". */
@@ -180,15 +179,6 @@ function appSteps(input, target) {
180
179
  });
181
180
  return steps.filter((step) => step.action !== "create" || !input.existing.has(step.path));
182
181
  }
183
- /** Whether a tsconfig copies `paths`, as older setups wrote it. */
184
- function copiesPaths(tsconfig) {
185
- try {
186
- const { compilerOptions } = parseJsonc(tsconfig);
187
- return typeof compilerOptions?.paths === "object";
188
- } catch {
189
- return false;
190
- }
191
- }
192
182
  /**
193
183
  * Made again when it copies the project's paths, which go stale; one
194
184
  * without is the person's to have changed, and is left as it is.
@@ -272,6 +262,7 @@ function studioSteps(input, target) {
272
262
  }
273
263
  /** "+ script "dex"". */
274
264
  const scriptsDetail = (names) => `+ ${names.length === 1 ? "script" : "scripts"} ${names.map((name) => `"${name}"`).join(", ")}`;
265
+ const renamedDetail = (names) => `sudio → dex in ${listing(names.map((name) => `"${name}"`))}`;
275
266
  const studioDetail = (input, spec) => input.again?.upgrade ? `devDependency ${PACKAGE_NAME} ${input.again.upgrade.from} → ${spec}` : `+ devDependency ${PACKAGE_NAME} ${spec}`;
276
267
  /** The package's own package.json, and the root's, with the studio's scripts. */
277
268
  function scriptSteps(input, target) {
@@ -281,7 +272,12 @@ function scriptSteps(input, target) {
281
272
  if (!own || input.again) {
282
273
  const path = inPackage(target.package, "package.json");
283
274
  const scripts = own ? [] : Object.keys(missingScripts(input.scripts));
284
- const added = [...scripts.length > 0 ? [scriptsDetail(scripts)] : [], ...workspace?.studioSpec ? [studioDetail(input, workspace.studioSpec)] : []];
275
+ const renamed = Object.keys(renamedScripts(input.scripts));
276
+ const added = [
277
+ ...scripts.length > 0 ? [scriptsDetail(scripts)] : [],
278
+ ...renamed.length > 0 ? [renamedDetail(renamed)] : [],
279
+ ...workspace?.studioSpec ? [studioDetail(input, workspace.studioSpec)] : []
280
+ ];
285
281
  if (added.length > 0 && existing.has(path)) steps.push({
286
282
  action: "edit",
287
283
  write: "scripts",
@@ -124,7 +124,12 @@ export declare const USER_AGENT_RE: RegExp;
124
124
  export declare function packageManagerFinding(root: string, { userAgent }?: {
125
125
  userAgent?: string;
126
126
  }): Promise<Finding<PackageManagerChoice>>;
127
- /** Where the project already resolves the studio from, if it does. */
127
+ /**
128
+ * Where the project already resolves the studio from, if it does. Its own
129
+ * node_modules' entry is kept as it is, so `isLinked` sees a `bun link`; one
130
+ * above is followed through its links, as Node resolves it, so a workspace's
131
+ * install is never taken for a link.
132
+ */
128
133
  export declare function resolvedStudio(root: string): string | undefined;
129
134
  /** Whether the studio is a dependency already, linked in, or neither. */
130
135
  export declare function studioPackage(root: string): StudioPackage;
@@ -1,12 +1,11 @@
1
1
  import { PACKAGE_NAME, posix as posix$1 } from "../paths.mjs";
2
2
  import { STUDIO_FILES } from "../shared/studio-files.mjs";
3
- import { dependenciesOf, exportedComponents, filesImport, packageAt, packageFolder } from "../config/project-files.mjs";
3
+ import { dependenciesOf, exportedComponents, filesImport, installedPackageDir, packageAt, packageFolder } from "../config/project-files.mjs";
4
4
  import { found } from "./findings.mjs";
5
5
  import { findWorkspace, isInside } from "./detect/workspace.mjs";
6
6
  import { designMdFinding } from "./design-md-setup.mjs";
7
7
  import { builtGlobalCss, componentLibraries, detectAgentsWithEvidence, detectDesignSystem, globalCssFiles, isMixedFolder, libraryAt, runningAgent } from "./detect.mjs";
8
8
  import { providerFinding } from "./provider.mjs";
9
- import { createRequire } from "node:module";
10
9
  import { existsSync, lstatSync, readFileSync, realpathSync } from "node:fs";
11
10
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
12
11
  import { detect } from "package-manager-detector/detect";
@@ -168,16 +167,17 @@ async function packageManagerFinding(root, { userAgent = process.env.npm_config_
168
167
  agent: "npm"
169
168
  }, "no lockfile, so npm", "guess");
170
169
  }
171
- /** Where the project already resolves the studio from, if it does. */
170
+ /**
171
+ * Where the project already resolves the studio from, if it does. Its own
172
+ * node_modules' entry is kept as it is, so `isLinked` sees a `bun link`; one
173
+ * above is followed through its links, as Node resolves it, so a workspace's
174
+ * install is never taken for a link.
175
+ */
172
176
  function resolvedStudio(root) {
173
177
  const local = join(root, "node_modules", PACKAGE_NAME);
174
178
  if (existsSync(join(local, "package.json"))) return local;
175
- try {
176
- const require = createRequire(join(root, "package.json"));
177
- return dirname(require.resolve(`${PACKAGE_NAME}/package.json`));
178
- } catch {
179
- return;
180
- }
179
+ const above = installedPackageDir(dirname(resolve(root)), PACKAGE_NAME);
180
+ return above && realpathSync(above);
181
181
  }
182
182
  /**
183
183
  * Whether `dir` is a link to a studio outside the project (`bun link`, `npm
@@ -240,7 +240,7 @@ async function findProject(root, options = {}) {
240
240
  componentPackages: componentPackages(root, workspace, folders),
241
241
  designMd: designMdFinding(root, {
242
242
  componentsDir: components.value?.dir,
243
- exclude: join(root, "studio", STUDIO_FILES.instructions),
243
+ exclude: join(root, "dex", STUDIO_FILES.instructions),
244
244
  ...workspace.isWorkspace ? { workspaceRoot: workspace.root } : {}
245
245
  }),
246
246
  styles: stylesFinding(root, components.value, source),
@@ -62,7 +62,8 @@ export declare function parseAgents(text: string): AgentId[];
62
62
  export declare function packageManagerName(pm: string): PackageManagerName;
63
63
  /**
64
64
  * `--dir`, checked: a folder below the project, never the project itself
65
- * (setup would write the studio's files among its own) or a hidden one such as `.git`.
65
+ * (setup would write the studio's files among its own) or a hidden one such
66
+ * as `.git`. Without it, the Dex folder: `dex`.
66
67
  */
67
68
  export declare function studioDir(flag: string | undefined): string;
68
69
  /**
@@ -696,12 +696,13 @@ const FOLDER_RE = /^[\w.@-]+(?:\/[\w.@-]+)*$/;
696
696
  const LEADING_DOT_SLASH_RE = /^(?:\.\/)+/;
697
697
  /**
698
698
  * `--dir`, checked: a folder below the project, never the project itself
699
- * (setup would write the studio's files among its own) or a hidden one such as `.git`.
699
+ * (setup would write the studio's files among its own) or a hidden one such
700
+ * as `.git`. Without it, the Dex folder: `dex`.
700
701
  */
701
702
  function studioDir(flag) {
702
- const dir = (flag ?? "studio").replace(TRAILING_SLASHES_RE, "").replace(LEADING_DOT_SLASH_RE, "");
703
+ const dir = (flag ?? "dex").replace(TRAILING_SLASHES_RE, "").replace(LEADING_DOT_SLASH_RE, "");
703
704
  const hidden = dir.split("/").some((part) => part.startsWith("."));
704
- if (!FOLDER_RE.test(dir) || hidden) throw new Error(`--dir takes a folder inside the project, like "studio" or "design/studio", not "${flag}".`);
705
+ if (!FOLDER_RE.test(dir) || hidden) throw new Error(`--dir takes a folder inside the project, like "dex" or "design/dex", not "${flag}".`);
705
706
  return dir;
706
707
  }
707
708
  function decideDir(flags) {
@@ -1,4 +1,5 @@
1
1
  import { posix as posix$1 } from "../paths.mjs";
2
+ import "../shared/studio-files.mjs";
2
3
  import { fromProject } from "./design-md-setup.mjs";
3
4
  import { relative } from "node:path";
4
5
  //#region src/setup/questions.ts
@@ -167,10 +168,10 @@ const QUESTION = {
167
168
  },
168
169
  dir: {
169
170
  key: "dir",
170
- label: "Studio folder",
171
+ label: "Dex folder",
171
172
  flag: "--dir <folder>",
172
173
  asJson: (dir) => dir,
173
- asFlags: (dir, { placement }) => dir !== "studio" && placement?.kind !== "own-app" ? [`--dir ${dir}`] : []
174
+ asFlags: (dir, { placement }) => dir !== "dex" && placement?.kind !== "own-app" ? [`--dir ${dir}`] : []
174
175
  }
175
176
  };
176
177
  /** Every question, in the order they are shown. */
@@ -30,7 +30,7 @@ export interface Starter {
30
30
  /** The package manager when neither --pm nor the one running create says. */
31
31
  packageManager: PackageManagerName;
32
32
  shared: SharedFiles[];
33
- /** A workspace: the studio gets an app of its own (apps/studio). */
33
+ /** A workspace: the studio gets an app of its own (apps/dex). */
34
34
  workspace: boolean;
35
35
  }
36
36
  export declare const STARTERS: Record<StarterName, Starter>;
@@ -60,6 +60,8 @@ export interface StarterValues {
60
60
  pmVersion?: string;
61
61
  title: string;
62
62
  }
63
+ /** What a starter writes at the project's root: "package.json", "src". */
64
+ export declare function starterRootNames(starter: Starter): Promise<string[]>;
63
65
  /**
64
66
  * Copy `starter` into `root`, which is empty: its own files, then the files
65
67
  * it shares with another, with the name, title and package manager filled in.
@@ -17,7 +17,7 @@ const STARTERS = {
17
17
  vite: {
18
18
  name: "vite",
19
19
  label: "Vite + React app",
20
- hint: "an app in src/ with the studio beside it in studio/",
20
+ hint: "an app in src/ with the studio beside it in dex/",
21
21
  description: "a Vite + React app with shadcn on Base UI",
22
22
  packageManager: "npm",
23
23
  workspace: false,
@@ -59,7 +59,7 @@ const STARTERS = {
59
59
  turborepo: {
60
60
  name: "turborepo",
61
61
  label: "Turborepo",
62
- hint: "apps/web, a shared packages/ui and the studio in apps/studio",
62
+ hint: "apps/web, a shared packages/ui and the studio in apps/dex",
63
63
  description: "a Turborepo: apps/web, and packages/ui (@workspace/ui) with shadcn on Base UI",
64
64
  packageManager: "bun",
65
65
  workspace: true,
@@ -123,6 +123,12 @@ async function packageManagerVersion(pm, exec, cwd) {
123
123
  return version;
124
124
  }
125
125
  const RENAMED = { gitignore: ".gitignore" };
126
+ /** What a starter writes at the project's root: "package.json", "src". */
127
+ async function starterRootNames(starter) {
128
+ const own = await readdir(join(STARTERS_DIR, starter.name));
129
+ const shared = starter.shared.map(({ to }) => to.split("/")[0] ?? to);
130
+ return [.../* @__PURE__ */ new Set([...own.map((name) => RENAMED[name] ?? name), ...shared])];
131
+ }
126
132
  /** Copy a file or a folder, filling in the values and making the changes. */
127
133
  async function copyTree(from, to, fill) {
128
134
  if (!(await stat(from)).isDirectory()) {
@@ -174,4 +180,4 @@ async function copyStarter(starter, root, values) {
174
180
  else if (values.pm === "pnpm") await writePnpmWorkspace(root, void 0);
175
181
  }
176
182
  //#endregion
177
- export { DEFAULT_STARTER, STARTERS, STARTERS_DIR, STARTER_NAMES, TEMPLATE_FLAG, copyStarter, packageManagerVersion, starterNamed, starterPackageManager };
183
+ export { DEFAULT_STARTER, STARTERS, STARTERS_DIR, STARTER_NAMES, TEMPLATE_FLAG, copyStarter, packageManagerVersion, starterNamed, starterPackageManager, starterRootNames };
@@ -41,7 +41,7 @@ export interface DesignSystemFacts {
41
41
  export declare function designSystemConfig(facts: DesignSystemFacts, root: string): DesignSystemConfig;
42
42
  /**
43
43
  * dex.config.ts for a new studio: the choices made, and nothing the
44
- * project's files or the defaults say. `studio` is "studio", or "." for an
44
+ * project's files or the defaults say. `studio` is "dex", or "." for an
45
45
  * app of its own.
46
46
  */
47
47
  export declare function configSource(designSystem: DesignSystemConfig | undefined, { studio, primitives, next }: {
@@ -78,6 +78,12 @@ export declare function tsconfigJson({ extends: project, compile, exclude }: {
78
78
  compile: ProjectCompile;
79
79
  exclude: string[];
80
80
  }): string;
81
+ /**
82
+ * Whether the studio's tsconfig copies `paths`, as setups before 0.13 wrote
83
+ * it (with the kit's types and path through @sudio/core): made again, it
84
+ * extends the project's instead. One without is the person's to have changed.
85
+ */
86
+ export declare function copiesPaths(tsconfig: string): boolean;
81
87
  /** A path from the studio's folder, as `extends` writes it: "../tsconfig.json". */
82
88
  export declare const fromStudio: (content: string, file: string) => string;
83
89
  /**
@@ -85,8 +91,14 @@ export declare const fromStudio: (content: string, file: string) => string;
85
91
  * the project's own file changes by a dependency and a line.
86
92
  */
87
93
  export declare const STUDIO_SCRIPTS: Record<string, string>;
88
- /** A later setup leaves these, as anything of the project's own: as Dex wrote them, or Sudio. */
89
- export declare const OLD_SCRIPTS: Record<string, string[]>;
94
+ /**
95
+ * Scripts older setups added, as Dex wrote them and then as Sudio did. A
96
+ * later setup keeps them, as anything of the project's own, but runs Dex in
97
+ * Sudio's: `sudio` comes with the package only to say it is `dex` now.
98
+ */
99
+ export declare const OLD_SCRIPTS: Record<string, [dex: string, ...older: string[]]>;
100
+ /** The scripts an older setup wrote with Sudio's command, as Dex's. */
101
+ export declare const renamedScripts: (scripts: Record<string, string>) => Record<string, string>;
90
102
  /** The scripts missing from `scripts`. */
91
103
  export declare const missingScripts: (scripts: Record<string, string>) => Record<string, string>;
92
104
  /**
@@ -1,5 +1,6 @@
1
1
  import { PACKAGE_NAME, posix as posix$1 } from "../paths.mjs";
2
2
  import { stateIgnoreLine } from "../server/state.mjs";
3
+ import { parseJsonc } from "../config/project-files.mjs";
3
4
  import { componentName } from "../config/design-system.mjs";
4
5
  import { formattedJson } from "../shared/json-style.mjs";
5
6
  import { editConfig } from "./config-source.mjs";
@@ -50,7 +51,7 @@ function designSystemConfig(facts, root) {
50
51
  }
51
52
  /**
52
53
  * dex.config.ts for a new studio: the choices made, and nothing the
53
- * project's files or the defaults say. `studio` is "studio", or "." for an
54
+ * project's files or the defaults say. `studio` is "dex", or "." for an
54
55
  * app of its own.
55
56
  */
56
57
  function configSource(designSystem, { studio, primitives, next }) {
@@ -140,6 +141,19 @@ function tsconfigJson({ extends: project, compile, exclude }) {
140
141
  exclude
141
142
  });
142
143
  }
144
+ /**
145
+ * Whether the studio's tsconfig copies `paths`, as setups before 0.13 wrote
146
+ * it (with the kit's types and path through @sudio/core): made again, it
147
+ * extends the project's instead. One without is the person's to have changed.
148
+ */
149
+ function copiesPaths(tsconfig) {
150
+ try {
151
+ const { compilerOptions } = parseJsonc(tsconfig);
152
+ return typeof compilerOptions?.paths === "object";
153
+ } catch {
154
+ return false;
155
+ }
156
+ }
143
157
  /** A path from the studio's folder, as `extends` writes it: "../tsconfig.json". */
144
158
  const fromStudio = (content, file) => {
145
159
  const path = posix$1(relative(content, file));
@@ -150,12 +164,18 @@ const fromStudio = (content, file) => {
150
164
  * the project's own file changes by a dependency and a line.
151
165
  */
152
166
  const STUDIO_SCRIPTS = { dex: "dex dev" };
153
- /** A later setup leaves these, as anything of the project's own: as Dex wrote them, or Sudio. */
167
+ /**
168
+ * Scripts older setups added, as Dex wrote them and then as Sudio did. A
169
+ * later setup keeps them, as anything of the project's own, but runs Dex in
170
+ * Sudio's: `sudio` comes with the package only to say it is `dex` now.
171
+ */
154
172
  const OLD_SCRIPTS = {
155
173
  studio: ["dex dev", "sudio dev"],
156
174
  "studio:build": ["dex build", "sudio build"],
157
175
  "studio:claude": ["dex claude", "sudio claude"]
158
176
  };
177
+ /** The scripts an older setup wrote with Sudio's command, as Dex's. */
178
+ const renamedScripts = (scripts) => Object.fromEntries(Object.entries(OLD_SCRIPTS).flatMap(([name, [dex, ...older]]) => older.includes(scripts[name] ?? "") ? [[name, dex]] : []));
159
179
  /** The scripts missing from `scripts`. */
160
180
  const missingScripts = (scripts) => Object.fromEntries(Object.entries(STUDIO_SCRIPTS).filter(([name]) => !(name in scripts)));
161
181
  /**
@@ -228,4 +248,4 @@ const withPointer = (guide, studio) => {
228
248
  return body ? `${body}\n\n${pointerText(studio)}` : pointerText(studio);
229
249
  };
230
250
  //#endregion
231
- export { OLD_SCRIPTS, POINTER, STUDIO_SCRIPTS, STUDIO_TYPES, STUDIO_TYPES_FILE, configSource, designSystemConfig, fromRoot, fromStudio, hasPointer, ignoreFile, missingIgnoreLines, missingScripts, pnpmDecidesEsbuild, pointerPlace, pointerText, tsconfigJson, withEsbuildBuilds, withIgnoreLines, withPointer };
251
+ export { OLD_SCRIPTS, POINTER, STUDIO_SCRIPTS, STUDIO_TYPES, STUDIO_TYPES_FILE, configSource, copiesPaths, designSystemConfig, fromRoot, fromStudio, hasPointer, ignoreFile, missingIgnoreLines, missingScripts, pnpmDecidesEsbuild, pointerPlace, pointerText, renamedScripts, tsconfigJson, withEsbuildBuilds, withIgnoreLines, withPointer };
@@ -1,5 +1,5 @@
1
- import { isSlug } from "./prototypes-core.mjs";
2
1
  import { isRecord, isText } from "./checks.mjs";
2
+ import { isSlug } from "./prototypes-core.mjs";
3
3
  import { frameKey, isFrameUid, legacyFrameUid } from "./canvas-core.mjs";
4
4
  import { rowOwner } from "./people-core.mjs";
5
5
  //#region src/shared/annotations-core.ts
@@ -342,6 +342,19 @@ export declare const insertUnder: <F extends Stepped>(row: {
342
342
  export declare const insertInCell: <F extends Stepped>(row: {
343
343
  frames: F[];
344
344
  }, frame: F, cell: Pick<Cell, "beside" | "over" | "step" | "under">) => string;
345
+ /**
346
+ * The cell a request for a new view fills: a step in its row, or in a new
347
+ * row, right above the row `above` names (a step in a row has no row to go
348
+ * above), else at the end of the section.
349
+ */
350
+ export declare const requestCell: ({ above, row, section, step }: Pick<Cell, "above" | "row" | "section" | "step">) => Cell;
351
+ /**
352
+ * Put a new row among a section's rows: right above the row `above` names,
353
+ * as the + on the line between two rows asks, else below the others.
354
+ */
355
+ export declare const addRowAbove: <R extends {
356
+ id: string;
357
+ }>(rows: R[], row: R, above?: string) => void;
345
358
  /** A new, empty row for a section with `rows`, its id from `name`. A row
346
359
  * has no name of its own: only its frames are named. */
347
360
  export declare const emptyRow: <F>(rows: readonly {
@@ -389,15 +402,17 @@ interface CellFrame extends Stepped {
389
402
  export declare const sizeForCell: (canvas: CanvasShape<CellFrame>, cell: Cell) => PageSize | undefined;
390
403
  /**
391
404
  * Put a frame for a view in a cell: on its step in its row, or in a new row
392
- * at the end of the section when the cell names none. It takes `viewport`'s
393
- * size, else the size of the frame before it, else `fallback` (the team's
405
+ * when the cell names none (addRowAbove). It takes `viewport`'s size, else
406
+ * `size`, else the size of the frame before it, else `fallback` (the team's
394
407
  * default device), else desktop's. A frame for the view already on that step
395
408
  * (in that row, or any row of the section for a new row) is kept as it is.
396
409
  * Returns a new canvas, the frame's key and whether it was added; or the
397
410
  * problem when the section or row is not there.
398
411
  */
399
- export declare function placeViewInCell<C extends CanvasShape<CellFrame>>(canvas: C, cell: Cell, { view, viewport, fallback }: {
412
+ export declare function placeViewInCell<C extends CanvasShape<CellFrame>>(canvas: C, cell: Cell, { view, viewport, size, fallback }: {
400
413
  fallback?: PageSize;
414
+ /** The size asked for it: a request's, set on the canvas. */
415
+ size?: PageSize;
401
416
  view: string;
402
417
  viewport?: Viewport;
403
418
  }): {
@@ -408,10 +423,10 @@ export declare function placeViewInCell<C extends CanvasShape<CellFrame>>(canvas
408
423
  problem: string;
409
424
  };
410
425
  /**
411
- * Put a frame in a cell: on its step in its row, or in a new row at the end
412
- * of the section when the cell names none. A frame already on that step, and
413
- * those after it, move one step along. Returns a new canvas and the frame's
414
- * key, or the problem when the section or row is not there.
426
+ * Put a frame in a cell: on its step in its row, or in a new row when the
427
+ * cell names none (addRowAbove). A frame already on that step, and those
428
+ * after it, move one step along. Returns a new canvas and the frame's key,
429
+ * or the problem when the section or row is not there.
415
430
  */
416
431
  export declare function placeFrameInCell<F extends Stepped & {
417
432
  id: string;