@dexhq/canvas 0.13.0 → 0.15.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 (341) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +21 -18
  3. package/app/canvas/activity.tsx +8 -15
  4. package/app/canvas/anchoring.ts +3 -5
  5. package/app/canvas/canvas-input.ts +151 -14
  6. package/app/canvas/canvas-keys.ts +9 -0
  7. package/app/canvas/canvas-model.ts +5 -42
  8. package/app/canvas/canvas-panels.ts +1 -17
  9. package/app/canvas/canvas-scene.ts +7 -3
  10. package/app/canvas/canvas-ui.ts +2 -1
  11. package/app/canvas/canvas.css +61 -26
  12. package/app/canvas/change-notice.tsx +10 -1
  13. package/app/canvas/comment-layer.tsx +2 -1
  14. package/app/canvas/comments.tsx +204 -82
  15. package/app/canvas/element-picker.ts +200 -27
  16. package/app/canvas/engine/canvas-gestures.ts +72 -17
  17. package/app/canvas/engine/canvas-store.ts +17 -1
  18. package/app/canvas/engine/engine.css +6 -3
  19. package/app/canvas/find-bar.tsx +817 -0
  20. package/app/canvas/find-model.ts +135 -0
  21. package/app/canvas/flow-canvas.tsx +18 -2
  22. package/app/canvas/follow-pin.ts +26 -6
  23. package/app/canvas/frame-node.tsx +43 -26
  24. package/app/canvas/imported-reviews.tsx +12 -22
  25. package/app/canvas/layout.ts +27 -0
  26. package/app/canvas/live-page.ts +142 -19
  27. package/app/canvas/page-find.ts +220 -0
  28. package/app/canvas/page-style.ts +23 -0
  29. package/app/canvas/section-node.tsx +2 -0
  30. package/app/canvas/spec-threads.ts +24 -23
  31. package/app/canvas/thread-focus.tsx +14 -12
  32. package/app/canvas/tool-cursors.ts +16 -16
  33. package/app/canvas/use-activity.ts +0 -8
  34. package/app/canvas/use-agent-changes.tsx +34 -40
  35. package/app/canvas/use-canvas-clipboard.tsx +11 -14
  36. package/app/canvas/xray.ts +3 -12
  37. package/app/frame.tsx +5 -0
  38. package/app/i18n/locales/en/messages.po +114 -12
  39. package/app/i18n/locales/en/messages.ts +1 -1
  40. package/app/i18n/locales/pseudo/messages.po +114 -12
  41. package/app/i18n/locales/pseudo/messages.ts +1 -1
  42. package/app/icons/{sets/lucide.tsx → glyphs.tsx} +7 -5
  43. package/app/icons/index.tsx +3 -3
  44. package/app/icons/types.ts +3 -10
  45. package/app/index.html +3 -3
  46. package/app/main.tsx +3 -0
  47. package/app/pages/canvas-settings.tsx +35 -0
  48. package/app/pages/canvas.tsx +27 -8
  49. package/app/pages/commands-settings.tsx +16 -2
  50. package/app/shell/about.tsx +5 -4
  51. package/app/shell/feedback-details.ts +0 -3
  52. package/app/shell/feedback-form.tsx +10 -21
  53. package/app/shell/feedback-link.tsx +2 -1
  54. package/app/shell/instructions-editor.tsx +1 -1
  55. package/app/shell/presence-style.ts +59 -0
  56. package/app/shell/presence.tsx +6 -3
  57. package/app/shell/scaled-frame.tsx +21 -9
  58. package/app/shell/settings-sections.ts +12 -0
  59. package/app/shell/sidebar.tsx +1 -1
  60. package/app/studio-ui.d.ts +0 -9
  61. package/app/types.ts +21 -205
  62. package/app/ui/file-drop.ts +128 -0
  63. package/app/ui/prompt-editor.tsx +1 -1
  64. package/app/ui/shadcn/input-group.tsx +2 -2
  65. package/dist/cli/banner.d.mts +4 -2
  66. package/dist/cli/banner.mjs +34 -11
  67. package/dist/cli/commands/app.mjs +19 -11
  68. package/dist/cli/commands/create.d.mts +26 -14
  69. package/dist/cli/commands/create.mjs +13 -7
  70. package/dist/cli/commands/dev.mjs +2 -3
  71. package/dist/cli/commands/hook.mjs +2 -1
  72. package/dist/cli/commands/init.d.mts +11 -6
  73. package/dist/cli/help.d.mts +1 -1
  74. package/dist/cli/help.mjs +3 -3
  75. package/dist/cli/main.d.mts +22 -12
  76. package/dist/config/index.d.mts +6 -5
  77. package/dist/config/project-files.d.mts +6 -3
  78. package/dist/config/project-files.mjs +14 -5
  79. package/dist/config/renamed.d.mts +0 -2
  80. package/dist/config/renamed.mjs +1 -3
  81. package/dist/config/schema.d.mts +0 -5
  82. package/dist/config/schema.mjs +0 -5
  83. package/dist/content/capture.d.mts +2 -2
  84. package/dist/content/capture.mjs +2 -2
  85. package/dist/content/content.d.mts +3 -141
  86. package/dist/content/content.mjs +7 -65
  87. package/dist/content/flow-specs.mjs +1 -1
  88. package/dist/content/prototype-summary.d.mts +3 -39
  89. package/dist/content/prototype-summary.mjs +2 -3
  90. package/dist/content/prototypes.mjs +1 -1
  91. package/dist/content/snapshot-client.mjs +1 -1
  92. package/dist/content/text-replace.d.mts +30 -0
  93. package/dist/content/text-replace.mjs +309 -0
  94. package/dist/content/thread-module.mjs +1 -1
  95. package/dist/content/threads.mjs +1 -1
  96. package/dist/paths.d.mts +0 -2
  97. package/dist/paths.mjs +1 -3
  98. package/dist/server/agent-env.d.mts +5 -1
  99. package/dist/server/agent-env.mjs +7 -2
  100. package/dist/server/agent-session.d.mts +14 -1
  101. package/dist/server/agent-session.mjs +84 -19
  102. package/dist/server/brief.mjs +3 -3
  103. package/dist/server/build-pictures.mjs +1 -1
  104. package/dist/server/channel.d.mts +19 -24
  105. package/dist/server/channel.mjs +70 -37
  106. package/dist/server/claimed-presence.d.mts +18 -0
  107. package/dist/server/claimed-presence.mjs +58 -0
  108. package/dist/server/close-check.mjs +2 -2
  109. package/dist/server/comments/actions.d.mts +153 -0
  110. package/dist/server/comments/actions.mjs +154 -0
  111. package/dist/server/comments/routes.d.mts +25 -0
  112. package/dist/server/comments/routes.mjs +88 -0
  113. package/dist/server/comments/tools.d.mts +6 -0
  114. package/dist/server/comments/tools.mjs +154 -0
  115. package/dist/server/dev-server.mjs +36 -13
  116. package/dist/server/file-errors.d.mts +7 -2
  117. package/dist/server/file-errors.mjs +31 -8
  118. package/dist/server/file-lock.d.mts +2 -2
  119. package/dist/server/file-lock.mjs +130 -36
  120. package/dist/server/mcp.d.mts +0 -2
  121. package/dist/server/mcp.mjs +7 -8
  122. package/dist/server/me.d.mts +1 -1
  123. package/dist/server/open-page.d.mts +22 -0
  124. package/dist/server/open-page.mjs +20 -2
  125. package/dist/server/outcome.d.mts +22 -0
  126. package/dist/server/outcome.mjs +8 -0
  127. package/dist/server/own-copies.mjs +2 -2
  128. package/dist/server/people.d.mts +1 -1
  129. package/dist/server/port.d.mts +12 -0
  130. package/dist/server/port.mjs +66 -14
  131. package/dist/server/presence.d.mts +4 -1
  132. package/dist/server/presence.mjs +2 -2
  133. package/dist/server/requests.d.mts +5 -1
  134. package/dist/server/requests.mjs +32 -47
  135. package/dist/server/studio-for.d.mts +5 -0
  136. package/dist/server/studio-for.mjs +18 -4
  137. package/dist/server/sync-install.d.mts +8 -12
  138. package/dist/server/sync-install.mjs +12 -30
  139. package/dist/server/thread-source.mjs +2 -2
  140. package/dist/server/tools/describe.d.mts +1 -1
  141. package/dist/server/tools/describe.mjs +1 -1
  142. package/dist/server/tools/feedback.d.mts +1 -1
  143. package/dist/server/tools/reading.mjs +13 -4
  144. package/dist/server/tools/show.d.mts +1 -1
  145. package/dist/server/tools/snapshot.d.mts +1 -1
  146. package/dist/server/tools/thread-list.mjs +1 -1
  147. package/dist/server/tools/watch.mjs +5 -3
  148. package/dist/server/vite.mjs +28 -31
  149. package/dist/server/web-app.mjs +7 -10
  150. package/dist/server/work-groups.mjs +1 -1
  151. package/dist/setup/apply.mjs +8 -14
  152. package/dist/setup/create.d.mts +4 -2
  153. package/dist/setup/create.mjs +118 -36
  154. package/dist/setup/design-system-checks.mjs +3 -12
  155. package/dist/setup/desktop-app-script.mjs +4 -3
  156. package/dist/setup/desktop-app-start.d.mts +8 -2
  157. package/dist/setup/desktop-app-start.mjs +64 -29
  158. package/dist/setup/desktop-app.d.mts +8 -0
  159. package/dist/setup/desktop-app.mjs +20 -4
  160. package/dist/setup/detect.d.mts +14 -7
  161. package/dist/setup/detect.mjs +56 -10
  162. package/dist/setup/doctor.mjs +2 -4
  163. package/dist/setup/existing-setup.d.mts +1 -3
  164. package/dist/setup/existing-setup.mjs +10 -11
  165. package/dist/setup/migrate/row-titles.mjs +1 -1
  166. package/dist/setup/own-app.d.mts +1 -2
  167. package/dist/setup/own-app.mjs +4 -5
  168. package/dist/setup/plan.d.mts +8 -6
  169. package/dist/setup/plan.mjs +64 -48
  170. package/dist/setup/project.d.mts +6 -17
  171. package/dist/setup/project.mjs +17 -61
  172. package/dist/setup/prompts.d.mts +5 -5
  173. package/dist/setup/prompts.mjs +28 -61
  174. package/dist/setup/questions.d.mts +12 -4
  175. package/dist/setup/questions.mjs +10 -25
  176. package/dist/setup/starters.d.mts +2 -0
  177. package/dist/setup/starters.mjs +26 -9
  178. package/dist/setup/workspace-setup.d.mts +1 -2
  179. package/dist/setup/workspace-setup.mjs +4 -6
  180. package/dist/setup/write.d.mts +15 -5
  181. package/dist/setup/write.mjs +35 -9
  182. package/dist/shared/annotations-core.mjs +1 -1
  183. package/dist/shared/canvas-core.mjs +1 -1
  184. package/dist/shared/canvas-file.d.mts +201 -0
  185. package/dist/shared/canvas-file.mjs +1 -0
  186. package/dist/shared/comments/routes.d.mts +53 -0
  187. package/dist/shared/comments/routes.mjs +37 -0
  188. package/dist/shared/feedback.d.mts +8 -0
  189. package/dist/shared/feedback.mjs +10 -2
  190. package/dist/shared/page-review.d.mts +2 -11
  191. package/dist/shared/page-review.mjs +4 -13
  192. package/dist/shared/presence-core.d.mts +11 -0
  193. package/dist/shared/presence-core.mjs +11 -2
  194. package/dist/shared/review-file.d.mts +5 -0
  195. package/dist/shared/review-file.mjs +23 -13
  196. package/dist/shared/server-page.mjs +7 -1
  197. package/dist/shared/signup.d.mts +2 -5
  198. package/dist/shared/signup.mjs +2 -35
  199. package/dist/shared/studio-events.d.mts +0 -6
  200. package/dist/shared/studio-events.mjs +1 -5
  201. package/dist/shared/studio-files.d.mts +12 -0
  202. package/dist/shared/studio-files.mjs +6 -1
  203. package/dist/shared/studio-routes.d.mts +16 -62
  204. package/dist/shared/studio-routes.mjs +1 -69
  205. package/dist/shared/threads-core.d.mts +2 -2
  206. package/dist/shared/threads-core.mjs +1 -1
  207. package/extension/dist/feedback.js +148 -138
  208. package/extension/dist/manifest.json +1 -1
  209. package/extension/dist/picker.js +146 -136
  210. package/package.json +3 -20
  211. package/src/cli/banner.ts +45 -11
  212. package/src/cli/commands/app.ts +23 -8
  213. package/src/cli/commands/create.ts +17 -9
  214. package/src/cli/commands/dev.ts +0 -3
  215. package/src/cli/commands/hook.ts +4 -1
  216. package/src/cli/help.ts +3 -3
  217. package/src/config/index.ts +6 -5
  218. package/src/config/project-files.ts +21 -11
  219. package/src/config/renamed.ts +0 -3
  220. package/src/config/schema.ts +0 -1
  221. package/src/content/capture.ts +6 -12
  222. package/src/content/content.ts +7 -244
  223. package/src/content/flow-specs.ts +2 -1
  224. package/src/content/prototype-summary.ts +4 -44
  225. package/src/content/review-pages.ts +2 -1
  226. package/src/content/snapshot-client.ts +1 -1
  227. package/src/content/text-replace.ts +449 -0
  228. package/src/paths.ts +0 -8
  229. package/src/server/agent-env.ts +12 -2
  230. package/src/server/agent-session.ts +124 -34
  231. package/src/server/brief.ts +8 -3
  232. package/src/server/channel.ts +121 -52
  233. package/src/server/claimed-presence.ts +93 -0
  234. package/src/server/comments/actions.ts +352 -0
  235. package/src/server/comments/routes.ts +176 -0
  236. package/src/server/comments/tools.ts +317 -0
  237. package/src/server/dev-server.ts +49 -15
  238. package/src/server/file-errors.ts +47 -13
  239. package/src/server/file-lock.ts +205 -54
  240. package/src/server/mcp.ts +13 -14
  241. package/src/server/me.ts +2 -5
  242. package/src/server/open-page.ts +54 -4
  243. package/src/server/outcome.ts +26 -0
  244. package/src/server/people.ts +2 -1
  245. package/src/server/port.ts +94 -20
  246. package/src/server/presence.ts +11 -3
  247. package/src/server/requests.ts +60 -70
  248. package/src/server/studio-for.ts +27 -3
  249. package/src/server/sync-install.ts +35 -26
  250. package/src/server/thread-place.ts +2 -4
  251. package/src/server/tools/reading.ts +16 -3
  252. package/src/server/tools/watch.ts +7 -7
  253. package/src/server/vite.ts +37 -40
  254. package/src/server/web-app.ts +14 -12
  255. package/src/setup/apply.ts +10 -16
  256. package/src/setup/create.ts +143 -37
  257. package/src/setup/design-system-checks.ts +7 -15
  258. package/src/setup/desktop-app-script.ts +4 -3
  259. package/src/setup/desktop-app-start.ts +94 -26
  260. package/src/setup/desktop-app.ts +24 -3
  261. package/src/setup/detect.ts +56 -14
  262. package/src/setup/doctor.ts +4 -4
  263. package/src/setup/existing-setup.ts +10 -12
  264. package/src/setup/own-app.ts +2 -5
  265. package/src/setup/plan.ts +93 -84
  266. package/src/setup/project.ts +25 -118
  267. package/src/setup/prompts.ts +44 -127
  268. package/src/setup/questions.ts +27 -29
  269. package/src/setup/starters.ts +35 -10
  270. package/src/setup/workspace-setup.ts +8 -18
  271. package/src/setup/write.ts +52 -9
  272. package/src/shared/canvas-file.ts +205 -0
  273. package/src/shared/comments/routes.ts +79 -0
  274. package/src/shared/feedback.ts +14 -4
  275. package/src/shared/page-review.ts +11 -16
  276. package/src/shared/presence-core.ts +16 -2
  277. package/src/shared/review-file.ts +28 -12
  278. package/src/shared/server-page.ts +11 -1
  279. package/src/shared/signup.ts +4 -28
  280. package/src/shared/studio-events.ts +0 -13
  281. package/src/shared/studio-files.ts +14 -0
  282. package/src/shared/studio-routes.ts +21 -64
  283. package/src/shared/threads-core.ts +2 -2
  284. package/templates/methods/review.md +2 -2
  285. package/templates/rules/canvas-frames.md +104 -0
  286. package/templates/rules/canvas.md +8 -142
  287. package/templates/rules/prototypes.md +1 -1
  288. package/templates/rules/snapshots.md +52 -0
  289. package/templates/starters/standalone/README.md +7 -7
  290. package/templates/starters/standalone/components.json +1 -1
  291. package/templates/starters/standalone/package.json +1 -2
  292. package/templates/starters/turborepo/README.md +6 -6
  293. package/templates/starters/turborepo/apps/web/components.json +1 -1
  294. package/templates/starters/turborepo/apps/web/package.json +1 -2
  295. package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
  296. package/templates/starters/turborepo/packages/ui/components.json +1 -1
  297. package/templates/starters/turborepo/packages/ui/package.json +1 -2
  298. package/templates/starters/vite/README.md +7 -6
  299. package/templates/starters/vite/components.json +1 -1
  300. package/templates/starters/vite/package.json +1 -2
  301. package/templates/starters/vite/src/app.tsx +3 -4
  302. package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
  303. package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
  304. package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
  305. package/templates/starters/vite/src/components/ui/button.tsx +17 -12
  306. package/templates/starters/vite/src/components/ui/card.tsx +1 -1
  307. package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
  308. package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
  309. package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
  310. package/templates/starters/vite/src/components/ui/field.tsx +3 -1
  311. package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
  312. package/templates/starters/vite/src/components/ui/input.tsx +1 -1
  313. package/templates/starters/vite/src/components/ui/label.tsx +2 -0
  314. package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
  315. package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
  316. package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
  317. package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
  318. package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
  319. package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
  320. package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
  321. package/templates/starters/vite/src/index.css +533 -111
  322. package/app/icons/sets/hugeicons.tsx +0 -259
  323. package/app/icons/sets/phosphor.tsx +0 -251
  324. package/dist/server/icon-set.d.mts +0 -15
  325. package/dist/server/icon-set.mjs +0 -31
  326. package/dist/server/tools/close-reply.d.mts +0 -6
  327. package/dist/server/tools/close-reply.mjs +0 -138
  328. package/dist/server/tools/comment.d.mts +0 -6
  329. package/dist/server/tools/comment.mjs +0 -49
  330. package/dist/shared/icon-sets.d.mts +0 -9
  331. package/dist/shared/icon-sets.mjs +0 -21
  332. package/src/server/icon-set.ts +0 -56
  333. package/src/server/tools/close-reply.ts +0 -271
  334. package/src/server/tools/comment.ts +0 -96
  335. package/src/shared/icon-sets.ts +0 -23
  336. /package/app/public/{sudio-192.png → dex-192.png} +0 -0
  337. /package/app/public/{sudio-512.png → dex-512.png} +0 -0
  338. /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
  339. /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
  340. /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
  341. /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
@@ -32,6 +32,16 @@ const SETUP_ARGS = {
32
32
  type: "boolean",
33
33
  description: "No components yet: set up shadcn first"
34
34
  },
35
+ preset: {
36
+ type: "string",
37
+ valueHint: "code",
38
+ description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)"
39
+ },
40
+ base: {
41
+ type: "string",
42
+ valueHint: "library",
43
+ description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)"
44
+ },
35
45
  styles: {
36
46
  type: "string",
37
47
  valueHint: "file",
@@ -39,12 +49,7 @@ const SETUP_ARGS = {
39
49
  },
40
50
  primitives: {
41
51
  type: "boolean",
42
- description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)"
43
- },
44
- icons: {
45
- type: "string",
46
- valueHint: "set",
47
- description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)"
52
+ description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)"
48
53
  },
49
54
  provider: {
50
55
  type: "string",
@@ -93,15 +98,16 @@ const SETUP_ARGS = {
93
98
  const setupFlags = (args) => ({
94
99
  agent: args.agent,
95
100
  app: args.app,
101
+ base: args.base,
96
102
  in: args.in,
97
103
  components: args.components,
98
104
  designMd: args["design-md"],
99
105
  dir: args.dir,
100
106
  dryRun: args["dry-run"],
101
- icons: args.icons,
102
107
  import: args.import,
103
108
  json: args.json,
104
109
  pm: args.pm,
110
+ preset: args.preset,
105
111
  primitives: args.primitives,
106
112
  provider: args.provider,
107
113
  shadcn: args.shadcn,
@@ -46,11 +46,10 @@ var dev_default = defineCommand({
46
46
  const { superviseDev } = await import("../supervise.mjs");
47
47
  process.exit(await superviseDev());
48
48
  }
49
- const [{ createServer }, { unbuiltPackages }, { viteConfig }, { iconSetWarnings }, { listenOnPort, PortInUseError }, { lookOf, machineLines, movedLines, noteLine, portTakenLines, startedLines, updateLine }, { studioVersion }, { checkForUpdate }, { logMachineLine, machineState, updateMachine }, { queueSync }, { FROM_APP_ENV }] = await Promise.all([
49
+ const [{ createServer }, { unbuiltPackages }, { viteConfig }, { listenOnPort, PortInUseError }, { lookOf, machineLines, movedLines, noteLine, portTakenLines, startedLines, updateLine }, { studioVersion }, { checkForUpdate }, { logMachineLine, machineState, updateMachine }, { queueSync }, { FROM_APP_ENV }] = await Promise.all([
50
50
  import("vite"),
51
51
  import("../../setup/design-system-checks.mjs"),
52
52
  import("../../server/vite.mjs"),
53
- import("../../server/icon-set.mjs"),
54
53
  import("../../server/port.mjs"),
55
54
  import("../banner.mjs"),
56
55
  import("../../paths.mjs"),
@@ -115,7 +114,7 @@ var dev_default = defineCommand({
115
114
  if (!restarted) checkForUpdate(project.content, project.root).then((fresh) => {
116
115
  if (fresh && fresh.latest !== update?.latest) print(updateLine(fresh, look));
117
116
  }).catch(() => void 0);
118
- const warnings = [...iconSetWarnings(project), ...unbuiltPackages(project).map(({ name }) => `${name} is not built, so views cannot import it. Build it first (in a monorepo, \`npx turbo run build --filter=${name}\`).`)];
117
+ const warnings = [...unbuiltPackages(project).map(({ name }) => `${name} is not built, so views cannot import it. Build it first (in a monorepo, \`npx turbo run build --filter=${name}\`).`)];
119
118
  for (const line of warnings) print(noteLine("warn", line, look));
120
119
  import("../../content/content.mjs").then(({ linkGithub }) => linkGithub(project.content)).then((login) => {
121
120
  if (login) print(noteLine("note", `Your comments now show your GitHub avatar (@${login}).`, look));
@@ -1,4 +1,5 @@
1
1
  import { contentRoot, print } from "../command.mjs";
2
+ import { workerSession } from "../../shared/presence-core.mjs";
2
3
  import { defineCommand } from "citty";
3
4
  //#region src/cli/commands/hook.ts
4
5
  const STOPPED = /* @__PURE__ */ new Set([
@@ -39,7 +40,7 @@ var hook_default = defineCommand({
39
40
  const [root, { openPresence }] = await Promise.all([contentRoot(args.root), import("../../server/presence.mjs")]);
40
41
  const presence = openPresence(root);
41
42
  const session = event.session_id ?? "claude";
42
- const worker = event.agent_id ? `${session}/${event.agent_id}` : session;
43
+ const worker = event.agent_id ? workerSession(session, event.agent_id) : session;
43
44
  if (event.hook_event_name === "UserPromptSubmit") {
44
45
  const { promptNotices } = await import("../../server/notices.mjs");
45
46
  const context = await promptNotices(root, session, event.cwd);
@@ -33,6 +33,16 @@ declare const _default: import("citty").CommandDef<{
33
33
  readonly type: "boolean";
34
34
  readonly description: "No components yet: set up shadcn first";
35
35
  };
36
+ readonly preset: {
37
+ readonly type: "string";
38
+ readonly valueHint: "code";
39
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
40
+ };
41
+ readonly base: {
42
+ readonly type: "string";
43
+ readonly valueHint: "library";
44
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
45
+ };
36
46
  readonly styles: {
37
47
  readonly type: "string";
38
48
  readonly valueHint: "file";
@@ -40,12 +50,7 @@ declare const _default: import("citty").CommandDef<{
40
50
  };
41
51
  readonly primitives: {
42
52
  readonly type: "boolean";
43
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
44
- };
45
- readonly icons: {
46
- readonly type: "string";
47
- readonly valueHint: "set";
48
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
53
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
49
54
  };
50
55
  readonly provider: {
51
56
  readonly type: "string";
@@ -1,7 +1,7 @@
1
1
  import { Described } from "./command.mjs";
2
2
  //#region src/cli/help.d.ts
3
3
  /** `dex --help`. Every command and flag in it is tested to exist. */
4
- export declare const ROOT_HELP = "Dex\n\nUsage: dex <command> [options]\n dex <command> --help that command's options\n\nSet up and maintain\n create [folder] [--yes] [--dry-run] [--json]\n [--template vite|standalone|turborepo]\n [--components <folder>|none] [--import <specifier>] [--shadcn]\n [--styles <file>|none] [--primitives | --no-primitives]\n [--icons lucide|phosphor|hugeicons]\n [--agent <ids>|none] [--dir studio] [--pm <manager>]\n [--provider <module>|none] [--design-md draft|none|<path>|<url>]\n [--app <name> | --in <package>]\n [--studio <spec>] [--skip-install]\n Set up a studio: in a project it adds one in studio/,\n in a workspace its own app (--app) or inside an app\n (--in), in an empty folder a new project from a\n starter (--template). It confirms what it finds,\n shows the plan, then says what it does. Without a\n terminal, or with --yes, it takes what it finds;\n --dry-run only shows the plan\n agents add <agent> Add the studio to claude, codex, cursor, copilot or\n opencode, as the studio's \"Add MCP config\" does\n doctor [--json] Check the setup and say how to fix it; --json prints\n one JSON object per check\n components [--json] [--components <folder>]\n List the design system's components and how to\n import them; --components scans another folder and\n prints the config that points at it\n upgrade [--dry-run] Bring a studio set up by an older version up to date:\n rename studio.config.ts to dex.config.ts, move\n design-system/index.ts into it (its prose into\n DESIGN.md), its state into .studio/, use the\n installed rules and delete old explorations/\n folders. --dry-run says what would change and\n writes nothing\n\nRun\n dev [--live] Start the studio; --live also keeps it in step with\n the linked cloud workspace (see cloud live)\n stop Stop this checkout's studio, and no other\n build Check, then build a static site\n preview Serve the built site\n extension Install the Chrome extension that copies elements from\n any page to paste on a canvas\n app install On a Mac, make ~/Applications/Dex.app: it starts\n the studio when it isn't running and opens it in its\n own window\n app remove Remove that app\n app start What that app runs when it opens: starts the studio\n unless this project's Dex already holds its port\n\nWork (usually run by your agent)\n whoami Who you are, from GitHub or git: added the first time\n new [--person <slug>] --title \"<title>\"\n contributor --name \"<name>\" --git \"<git user>\" --discipline <product|brand|engineering> [--github <username>]\n threads [--slug <file>] [--all]\n Comments and requests waiting for an agent\n thread --id <id> [--note \"<message, or what changed>\"] [--acknowledge | --resolve | --dismiss]\n Answer one\n check Validate files, canvases and references\n scope --person <slug>\n Changes outside that contributor's folders\n presence --slug <file> --view <view> [--agent <name>] [--clear]\n snapshot --slug <file> [--view <view>]\n\nCloud workspaces (Team)\n cloud login --token <token> [--url <service url>]\n cloud link --workspace <slug> [--url <service url>]\n Keep comments in the workspace, shared by the team\n cloud live [--workspace <slug>] [--url <service url>] [--token <token>]\n Work live with the team: this studio's files stay\n in step with the workspace, both ways, while it runs.\n Your own agents work on them as usual\n cloud status What this studio is linked to\n cloud push Copy comment threads into the workspace\n cloud publish Build and publish the studio; prints a share link\n cloud unlink\n\nAgents\n claude [...] Claude Code, with feedback from the studio arriving in\n the session as it is left (a channel; no watching)\n mcp [--agent \"<name>\"] The studio's MCP server (stdio): guidelines and feedback\n hook Claude Code hook: presence and guidelines\n";
4
+ export declare const ROOT_HELP = "Dex\n\nUsage: dex <command> [options]\n dex <command> --help that command's options\n\nSet up and maintain\n create [folder] [--yes] [--dry-run] [--json]\n [--template vite|standalone|turborepo]\n [--components <folder>|none] [--import <specifier>]\n [--shadcn] [--preset <code>] [--base base|radix|aria]\n [--styles <file>|none] [--primitives]\n [--agent <ids>|none] [--dir studio] [--pm <manager>]\n [--provider <module>|none] [--design-md draft|none|<path>|<url>]\n [--app <name> | --in <package>]\n [--studio <spec>] [--skip-install]\n Set up a studio: in a project it adds one in studio/,\n in a workspace its own app (--app) or inside an app\n (--in), in an empty folder a new project from a\n starter (--template). It confirms what it finds,\n shows the plan, then says what it does. Without a\n terminal, or with --yes, it takes what it finds;\n --dry-run only shows the plan\n agents add <agent> Add the studio to claude, codex, cursor, copilot or\n opencode, as the studio's \"Add MCP config\" does\n doctor [--json] Check the setup and say how to fix it; --json prints\n one JSON object per check\n components [--json] [--components <folder>]\n List the design system's components and how to\n import them; --components scans another folder and\n prints the config that points at it\n upgrade [--dry-run] Bring a studio set up by an older version up to date:\n rename studio.config.ts to dex.config.ts, move\n design-system/index.ts into it (its prose into\n DESIGN.md), its state into .studio/, use the\n installed rules and delete old explorations/\n folders. --dry-run says what would change and\n writes nothing\n\nRun\n dev [--live] Start the studio; --live also keeps it in step with\n the linked cloud workspace (see cloud live)\n stop Stop this checkout's studio, and no other\n build Check, then build a static site\n preview Serve the built site\n extension Install the Chrome extension that copies elements from\n any page to paste on a canvas\n app install On a Mac, make ~/Applications/Dex.app: it starts\n the studio when it isn't running and opens it in its\n own window\n app remove Remove that app\n app start What that app runs when it opens: starts the studio\n unless this project's Dex already holds its port\n\nWork (usually run by your agent)\n whoami Who you are, from GitHub or git: added the first time\n new [--person <slug>] --title \"<title>\"\n contributor --name \"<name>\" --git \"<git user>\" --discipline <product|brand|engineering> [--github <username>]\n threads [--slug <file>] [--all]\n Comments and requests waiting for an agent\n thread --id <id> [--note \"<message, or what changed>\"] [--acknowledge | --resolve | --dismiss]\n Answer one\n check Validate files, canvases and references\n scope --person <slug>\n Changes outside that contributor's folders\n presence --slug <file> --view <view> [--agent <name>] [--clear]\n snapshot --slug <file> [--view <view>]\n\nCloud workspaces (Team)\n cloud login --token <token> [--url <service url>]\n cloud link --workspace <slug> [--url <service url>]\n Keep comments in the workspace, shared by the team\n cloud live [--workspace <slug>] [--url <service url>] [--token <token>]\n Work live with the team: this studio's files stay\n in step with the workspace, both ways, while it runs.\n Your own agents work on them as usual\n cloud status What this studio is linked to\n cloud push Copy comment threads into the workspace\n cloud publish Build and publish the studio; prints a share link\n cloud unlink\n\nAgents\n claude [...] Claude Code, with feedback from the studio arriving in\n the session as it is left (a channel; no watching)\n mcp [--agent \"<name>\"] The studio's MCP server (stdio): guidelines and feedback\n hook Claude Code hook: presence and guidelines\n";
5
5
  /** `dex --help`, with its headings in bold in a terminal. */
6
6
  export declare const rootHelp: () => string;
7
7
  /** `dex <command> --help`: what it does, and its arguments and options. */
package/dist/cli/help.mjs CHANGED
@@ -11,9 +11,9 @@ Usage: dex <command> [options]
11
11
  Set up and maintain
12
12
  create [folder] [--yes] [--dry-run] [--json]
13
13
  [--template vite|standalone|turborepo]
14
- [--components <folder>|none] [--import <specifier>] [--shadcn]
15
- [--styles <file>|none] [--primitives | --no-primitives]
16
- [--icons lucide|phosphor|hugeicons]
14
+ [--components <folder>|none] [--import <specifier>]
15
+ [--shadcn] [--preset <code>] [--base base|radix|aria]
16
+ [--styles <file>|none] [--primitives]
17
17
  [--agent <ids>|none] [--dir studio] [--pm <manager>]
18
18
  [--provider <module>|none] [--design-md draft|none|<path>|<url>]
19
19
  [--app <name> | --in <package>]
@@ -31,6 +31,16 @@ export declare const COMMANDS: {
31
31
  readonly type: "boolean";
32
32
  readonly description: "No components yet: set up shadcn first";
33
33
  };
34
+ readonly preset: {
35
+ readonly type: "string";
36
+ readonly valueHint: "code";
37
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
38
+ };
39
+ readonly base: {
40
+ readonly type: "string";
41
+ readonly valueHint: "library";
42
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
43
+ };
34
44
  readonly styles: {
35
45
  readonly type: "string";
36
46
  readonly valueHint: "file";
@@ -38,12 +48,7 @@ export declare const COMMANDS: {
38
48
  };
39
49
  readonly primitives: {
40
50
  readonly type: "boolean";
41
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
42
- };
43
- readonly icons: {
44
- readonly type: "string";
45
- readonly valueHint: "set";
46
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
51
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
47
52
  };
48
53
  readonly provider: {
49
54
  readonly type: "string";
@@ -133,6 +138,16 @@ export declare const COMMANDS: {
133
138
  readonly type: "boolean";
134
139
  readonly description: "No components yet: set up shadcn first";
135
140
  };
141
+ readonly preset: {
142
+ readonly type: "string";
143
+ readonly valueHint: "code";
144
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
145
+ };
146
+ readonly base: {
147
+ readonly type: "string";
148
+ readonly valueHint: "library";
149
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
150
+ };
136
151
  readonly styles: {
137
152
  readonly type: "string";
138
153
  readonly valueHint: "file";
@@ -140,12 +155,7 @@ export declare const COMMANDS: {
140
155
  };
141
156
  readonly primitives: {
142
157
  readonly type: "boolean";
143
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
144
- };
145
- readonly icons: {
146
- readonly type: "string";
147
- readonly valueHint: "set";
148
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
158
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
149
159
  };
150
160
  readonly provider: {
151
161
  readonly type: "string";
@@ -123,10 +123,10 @@ export interface StudioInterface {
123
123
  */
124
124
  components?: string;
125
125
  /**
126
- * The interface's icons: "lucide" (the default), "phosphor" or
127
- * "hugeicons". Every icon swaps at once; only the chosen set is bundled.
126
+ * @deprecated No longer read: the interface always draws with Lucide.
127
+ * `create` takes it out of the config.
128
128
  */
129
- icons?: "phosphor" | "lucide" | "hugeicons";
129
+ icons?: string;
130
130
  /**
131
131
  * The interface's language, when not the person's browser's: "en", or
132
132
  * "pseudo" to check that every string is localised. ?locale= overrides it.
@@ -138,8 +138,9 @@ export interface StudioInterface {
138
138
  * ("./src/components/ui") or an import path ("@acme/ui/shadcn"). Each is
139
139
  * used when you have one of that name; the studio's own fills the gaps.
140
140
  * `true` uses `designSystem.components`: its import, or its folder.
141
- * They need shadcn's Base UI API (a components.json style of "base-…"),
142
- * which `init` checks before setting this.
141
+ * They need shadcn's Base UI API (a components.json style of "base-…").
142
+ * Off by default, so the interface looks like Dex whatever your
143
+ * components' corners and icons: `create --primitives` sets it.
143
144
  */
144
145
  primitives?: string | true;
145
146
  /** Under the title in the sidebar. Default: your design system's name. */
@@ -1,5 +1,4 @@
1
1
  import { StylingApproach } from "../shared/design-system.mjs";
2
- import { InterfaceIcons } from "../shared/icon-sets.mjs";
3
2
  import { Alias } from "vite";
4
3
  //#region src/config/project-files.d.ts
5
4
  type Json = Record<string, unknown>;
@@ -33,6 +32,12 @@ export declare const stylingIn: (all: Record<string, string>) => StylingApproach
33
32
  /** The folder the app's framework serves at "/": what root-relative URLs name. */
34
33
  export declare function publicFolder(root: string): string | undefined;
35
34
  export declare function packageFolder(dir: string): string | undefined;
35
+ /**
36
+ * Where package `name` is installed: the first node_modules folder that holds
37
+ * it, looking up from `from` as Node does. Not `require.resolve`, which under
38
+ * Bun, with no node_modules above, finds Bun's global cache instead.
39
+ */
40
+ export declare function installedPackageDir(from: string, name: string): string | undefined;
36
41
  export declare function workspaceDirs(root: string): string[];
37
42
  export interface Manifest extends Json {
38
43
  exports?: unknown;
@@ -58,8 +63,6 @@ export interface ComponentsJson {
58
63
  file: string;
59
64
  /** The folder its `ui` alias points at. */
60
65
  folder: string;
61
- /** The icon set it draws with (`iconLibrary`), when the interface has it. */
62
- icons: InterfaceIcons | undefined;
63
66
  /** How code at the root imports the folder's files: "@/components/ui". */
64
67
  import: string;
65
68
  }
@@ -1,6 +1,5 @@
1
1
  import { highestMajor, isDirectory, isFile, posix as posix$1 } from "../paths.mjs";
2
2
  import { isRecord } from "../shared/checks.mjs";
3
- import { INTERFACE_ICONS } from "../shared/icon-sets.mjs";
4
3
  import { createRequire } from "node:module";
5
4
  import { existsSync, readFileSync, readdirSync } from "node:fs";
6
5
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -199,6 +198,18 @@ function packageFolder(dir) {
199
198
  if (dirname(at) === at) return;
200
199
  }
201
200
  }
201
+ /**
202
+ * Where package `name` is installed: the first node_modules folder that holds
203
+ * it, looking up from `from` as Node does. Not `require.resolve`, which under
204
+ * Bun, with no node_modules above, finds Bun's global cache instead.
205
+ */
206
+ function installedPackageDir(from, name) {
207
+ for (let at = resolve(from);; at = dirname(at)) {
208
+ const dir = join(at, "node_modules", name);
209
+ if (isFile(join(dir, "package.json"))) return dir;
210
+ if (dirname(at) === at) return;
211
+ }
212
+ }
202
213
  const GLOB_STAR_RE = /\/\*$/;
203
214
  const QUOTES_RE = /["']/g;
204
215
  function workspaceDirs(root) {
@@ -345,13 +356,11 @@ function readComponentsJson(dir, root) {
345
356
  const exported = exportedFolder(alias, root);
346
357
  const folder = resolveAlias(alias, dir) ?? exported ?? join(dir, "components", "ui");
347
358
  const css = stringAt(objectAt(config, "tailwind"), "css");
348
- const iconLibrary = stringAt(config, "iconLibrary");
349
359
  return {
350
360
  file,
351
361
  folder,
352
362
  import: dir === root || exported === resolve(folder) ? alias : importBaseFor(folder, root) ?? alias,
353
363
  css: css ? join(dir, css) : void 0,
354
- icons: INTERFACE_ICONS.find((set) => set === iconLibrary),
355
364
  baseUi: String(config.style ?? "").startsWith("base-")
356
365
  };
357
366
  }
@@ -411,7 +420,7 @@ function packageDir(name, from) {
411
420
  folders.push(at);
412
421
  if (dirname(at) === at) break;
413
422
  }
414
- return folders.flatMap(workspaceDirs).find((dir) => readJson(join(dir, "package.json"))?.name === name) ?? folders.map((at) => join(at, "node_modules", name)).find((dir) => isFile(join(dir, "package.json")));
423
+ return folders.flatMap(workspaceDirs).find((dir) => readJson(join(dir, "package.json"))?.name === name) ?? installedPackageDir(from, name);
415
424
  }
416
425
  function packageEntry(name, from) {
417
426
  const dir = packageDir(name, from);
@@ -504,4 +513,4 @@ function exportedNames(file) {
504
513
  const COMPONENT_EXPORT_RE = /^[A-Z](?=[\dA-Za-z]*[a-z])[\dA-Za-z]*$/;
505
514
  const exportedComponents = (file) => exportedNames(file).filter((name) => COMPONENT_EXPORT_RE.test(name));
506
515
  //#endregion
507
- export { canImport, compilerOption, componentsJsonError, dependenciesOf, exportedComponents, exportedFolder, exportedNames, filesImport, importBaseFor, packageAt, packageEntry, packageFolder, parseJsonc, projectAliases, projectBaseUrl, projectPaths, publicFolder, readComponentsJson, readJson, resolveAlias, runtimeDependencies, stringRecord, stylingIn, tailwind3Config, tailwindSetup, tsconfigFile, workspaceDirs };
516
+ export { canImport, compilerOption, componentsJsonError, dependenciesOf, exportedComponents, exportedFolder, exportedNames, filesImport, importBaseFor, installedPackageDir, packageAt, packageEntry, packageFolder, parseJsonc, projectAliases, projectBaseUrl, projectPaths, publicFolder, readComponentsJson, readJson, resolveAlias, runtimeDependencies, stringRecord, stylingIn, tailwind3Config, tailwindSetup, tsconfigFile, workspaceDirs };
@@ -1,6 +1,4 @@
1
1
  //#region src/config/renamed.d.ts
2
- /** The product's name before Dex, as old names start with it. */
3
- export declare const OLD_PRODUCT = "sudio";
4
2
  /** Notices said so far, for tests. */
5
3
  export declare const resetRenamedNotices: () => void;
6
4
  /**
@@ -1,6 +1,4 @@
1
1
  //#region src/config/renamed.ts
2
- /** The product's name before Dex, as old names start with it. */
3
- const OLD_PRODUCT = "sudio";
4
2
  const said = /* @__PURE__ */ new Set();
5
3
  /** Notices said so far, for tests. */
6
4
  const resetRenamedNotices = () => said.clear();
@@ -31,4 +29,4 @@ const importsOldPackage = (source) => source.match(OLD_PACKAGE_RE) !== null;
31
29
  /** `source` with its imports of @sudio/core pointed at @dexhq/canvas. */
32
30
  const withNewPackage = (source) => source.replace(OLD_PACKAGE_RE, (_match, quote, path = "") => `${quote}@dexhq/canvas${path}${quote}`);
33
31
  //#endregion
34
- export { OLD_PRODUCT, dexEnv, importsOldPackage, renamedNotice, resetRenamedNotices, withNewPackage };
32
+ export { dexEnv, importsOldPackage, renamedNotice, resetRenamedNotices, withNewPackage };
@@ -215,11 +215,6 @@ export declare const configSchema: z.ZodObject<{
215
215
  "studio-presence": "studio-presence";
216
216
  }> & core.$partial, z.ZodString>>;
217
217
  components: z.ZodOptional<z.ZodString>;
218
- icons: z.ZodOptional<z.ZodEnum<{
219
- phosphor: "phosphor";
220
- lucide: "lucide";
221
- hugeicons: "hugeicons";
222
- }>>;
223
218
  locale: z.ZodOptional<z.ZodString>;
224
219
  primitives: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<true>]>>;
225
220
  subtitle: z.ZodOptional<z.ZodString>;
@@ -105,11 +105,6 @@ const ui = z.looseObject({
105
105
  accent: z.string().optional(),
106
106
  chromeTheme: z.partialRecord(z.enum(CHROME_VARIABLES), z.string()).optional(),
107
107
  components: text.optional(),
108
- icons: z.enum([
109
- "phosphor",
110
- "lucide",
111
- "hugeicons"
112
- ]).optional(),
113
108
  locale: z.string().optional(),
114
109
  primitives: z.union([text, z.literal(true)]).optional(),
115
110
  subtitle: z.string().optional(),
@@ -1,5 +1,5 @@
1
1
  import { Cell } from "../shared/canvas-core.mjs";
2
- import { Canvas, CanvasFrame } from "./content.mjs";
2
+ import { Canvas, Frame } from "../shared/canvas-file.mjs";
3
3
  import { Capture } from "../shared/snapshot-clipboard.mjs";
4
4
  //#region src/content/capture.d.ts
5
5
  /** The longest side a snapshot's frame may have, in pixels. */
@@ -26,7 +26,7 @@ export interface Placed {
26
26
  /** A snapshot about to be saved, as placing its frame sees it. */
27
27
  export interface Snapshot {
28
28
  capture: Capture;
29
- frame: CanvasFrame;
29
+ frame: Frame;
30
30
  name: string;
31
31
  }
32
32
  /** Where a saved snapshot went: its view, its frame's key. */
@@ -1,7 +1,7 @@
1
- import { isSlug, prototypeFiles, prototypePage, slugify } from "../shared/prototypes-core.mjs";
2
- import { prototypeExists, prototypePaths } from "./prototypes.mjs";
3
1
  import { gridProblems } from "../shared/frame-grids.mjs";
2
+ import { isSlug, prototypeFiles, prototypePage, slugify } from "../shared/prototypes-core.mjs";
4
3
  import { appendRow, insertRowBelow, parseFrameKey, placeFrameInCell, uniqueId } from "../shared/canvas-core.mjs";
4
+ import { prototypeExists, prototypePaths } from "./prototypes.mjs";
5
5
  import { knownFor, ownCell, readCanvas, writeCanvas } from "./content.mjs";
6
6
  import { arrangeRows } from "../shared/paste-arrangement.mjs";
7
7
  import { posix } from "node:path";
@@ -1,145 +1,10 @@
1
- import { CanvasPoint, Cell, Viewport } from "../shared/canvas-core.mjs";
2
- import { Sketch } from "../shared/sketch-core.mjs";
1
+ import { Cell, Viewport } from "../shared/canvas-core.mjs";
3
2
  import { ResolvedDesignSystem } from "../config/design-system.mjs";
4
3
  import { Authored } from "../shared/annotations-core.mjs";
5
- import { FrameGrid, FrameGuide } from "../shared/frame-grids.mjs";
4
+ import { Canvas, ViewFrame } from "../shared/canvas-file.mjs";
6
5
  import { PresenceTarget } from "../shared/presence-core.mjs";
6
+ import { Contributor } from "../shared/studio-files.mjs";
7
7
  //#region src/content/content.d.ts
8
- /** A person who makes prototypes, from contributors.json. */
9
- export interface Contributor {
10
- discipline: string;
11
- /** Git user names that identify this person. */
12
- git: string[];
13
- /** Their GitHub username, for their avatar. */
14
- github?: string;
15
- name: string;
16
- slug: string;
17
- }
18
- interface FrameBase {
19
- /** On a column's first frame: the stacked frame its column starts level with. */
20
- beside?: string;
21
- id: string;
22
- step?: number;
23
- title?: string;
24
- /**
25
- * Which frame this is, for good: kept when it moves or is renamed, new on
26
- * a copy. Picks follow it. Given to the saver's frames that have none when
27
- * they save.
28
- */
29
- uid?: string;
30
- /** Stacked below the frame before it, in its column. */
31
- under?: true;
32
- }
33
- /** A frame that shows one of the prototype's views. */
34
- export interface ViewFrame extends FrameBase {
35
- doc?: undefined;
36
- /** The frame's own grids and guides, shown in place of the canvas's grid. */
37
- grids?: FrameGrid[];
38
- guides?: FrameGuide[];
39
- params?: Record<string, string>;
40
- /** A fixed size in pixels, for a snapshot of one element. */
41
- size?: {
42
- height: number;
43
- width: number;
44
- };
45
- sketch?: undefined;
46
- /**
47
- * Where a snapshot was captured from, and when; and the image it is, when
48
- * it is one, in the prototype's folder: "images/….png".
49
- */
50
- snapshot?: {
51
- captured: string;
52
- image?: string;
53
- url: string;
54
- };
55
- spec?: undefined;
56
- view: string;
57
- viewport?: Viewport;
58
- }
59
- /** A frame that shows one of the prototype's docs. */
60
- export interface DocFrame extends FrameBase {
61
- doc: string;
62
- sketch?: undefined;
63
- spec?: undefined;
64
- view?: undefined;
65
- }
66
- /** A spec, edited in place: its markdown file, from the file's folder. */
67
- export interface SpecFrame extends FrameBase {
68
- doc?: undefined;
69
- size?: {
70
- height: number;
71
- width: number;
72
- };
73
- sketch?: undefined;
74
- spec: string;
75
- view?: undefined;
76
- }
77
- export interface SketchFrame extends FrameBase {
78
- doc?: undefined;
79
- sketch: Sketch;
80
- spec?: undefined;
81
- /** Required, as an older Dex names a frame by its title or view. */
82
- title: string;
83
- view?: undefined;
84
- }
85
- declare const readFromDisk: unique symbol;
86
- /**
87
- * A frame this Dex cannot show: a kind from a newer Dex, or a mistake.
88
- * Only reading a canvas makes one, so Dex never writes a frame that shows
89
- * nothing.
90
- */
91
- export interface UnknownFrame extends FrameBase {
92
- doc?: undefined;
93
- sketch?: undefined;
94
- spec?: undefined;
95
- view?: undefined;
96
- readonly [readFromDisk]: true;
97
- }
98
- export type CanvasFrame = ViewFrame | DocFrame | SpecFrame | SketchFrame | UnknownFrame;
99
- /** A pass through a section; its frames are the steps, left to right. */
100
- export interface CanvasRow {
101
- /**
102
- * In a person's copy of someone else's section: the id of their row this one
103
- * is shown under (people-core.ts).
104
- */
105
- after?: string;
106
- /** Whose it is, when not its section's: set when read, never written. */
107
- author?: string;
108
- /** The id of the section in its author's file that keeps it. */
109
- copy?: string;
110
- frames: CanvasFrame[];
111
- id: string;
112
- title?: string;
113
- }
114
- /** A section on the canvas; with `at`, a frame of its own drawn at that point. */
115
- export interface CanvasSection {
116
- at?: CanvasPoint;
117
- /** Whose it is, from the folder it was read from; never written to a file. */
118
- author?: string;
119
- /** The id of the section it is a copy of, shown right below it. */
120
- copyOf?: string;
121
- /** When it was added, as an ISO date. */
122
- created?: string;
123
- description?: string;
124
- /** Whose section it was copied from, when it is a copy. */
125
- from?: string;
126
- id: string;
127
- /** Where a placed section's area starts; none stacks it with the others. */
128
- position?: CanvasPoint;
129
- rows: CanvasRow[];
130
- title: string;
131
- }
132
- /** canvas.json: sections stacked top to bottom. */
133
- export interface Canvas {
134
- /**
135
- * Set once the person's frames have uids (with uids on): from then on, a
136
- * frame of theirs with none is new. Read, a canvas lists whose files have
137
- * it in `uidsGiven`.
138
- */
139
- frameUids?: true;
140
- sections: CanvasSection[];
141
- uidsGiven?: string[];
142
- }
143
8
  /** The views and docs that exist in a prototype, which frames may show. */
144
9
  export interface Known {
145
10
  docs: string[];
@@ -206,7 +71,6 @@ export interface CommandValues {
206
71
  wait?: string;
207
72
  }
208
73
  export declare const STATUSES: string[];
209
- export declare const DISCIPLINES: string[];
210
74
  export declare function contributorProblems(contributors: unknown): string[];
211
75
  export declare function manifestProblems(manifest: unknown): string[];
212
76
  export declare function loadStudio(root: string): Promise<{
@@ -220,8 +84,6 @@ export interface CheckReport {
220
84
  problems: string[];
221
85
  warnings: string[];
222
86
  }
223
- /** The studio's own interface must not import a design system. */
224
- export declare function chromeIssues(appDir: string): Promise<string[]>;
225
87
  /**
226
88
  * Every problem in the studio, as readable lines, and the warnings the
227
89
  * prototype checks found (prototype-checks.ts). No problems when all is