@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
@@ -0,0 +1,201 @@
1
+ import { CanvasPoint, SlideLayout, Viewport } from "./canvas-core.mjs";
2
+ import { Sketch } from "./sketch-core.mjs";
3
+ import { FrameGrid, FrameGuide } from "./frame-grids.mjs";
4
+ //#region src/shared/canvas-file.d.ts
5
+ interface FrameBase {
6
+ /**
7
+ * On a column's first frame: the id of a frame stacked further down a
8
+ * column to its left, in its row, for this column to start level with
9
+ * rather than at the row's top.
10
+ */
11
+ beside?: string;
12
+ id: string;
13
+ /**
14
+ * The step this frame shows, counted from 1: its column on the canvas. Leave
15
+ * out to follow the previous frame in the row.
16
+ */
17
+ step?: number;
18
+ title?: string;
19
+ /**
20
+ * Which frame this is, for good: kept when it moves or is renamed, new on
21
+ * a copy. Picks follow it. Given to the saver's frames that have none when
22
+ * they save.
23
+ */
24
+ uid?: string;
25
+ /**
26
+ * Stacked directly below the frame before it in its row, in that frame's
27
+ * column, rather than in a column of its own.
28
+ */
29
+ under?: true;
30
+ }
31
+ /** A live, interactive render of one of the prototype's views. */
32
+ export interface ViewFrame extends FrameBase {
33
+ doc?: undefined;
34
+ /** The frame's own grids, shown in place of the canvas's (Figma's, pasted). */
35
+ grids?: FrameGrid[];
36
+ /** Guide lines on the frame. */
37
+ guides?: FrameGuide[];
38
+ params?: Record<string, string>;
39
+ /** A fixed size in pixels, for a snapshot of one element; else the viewport's. */
40
+ size?: {
41
+ height: number;
42
+ width: number;
43
+ };
44
+ sketch?: undefined;
45
+ /**
46
+ * Where a snapshot was captured from, and when; and the image it is, when
47
+ * it is one, in the prototype's folder: "images/….png".
48
+ */
49
+ snapshot?: {
50
+ captured: string;
51
+ image?: string;
52
+ url: string;
53
+ };
54
+ spec?: undefined;
55
+ view: string;
56
+ viewport?: Viewport;
57
+ }
58
+ /** A markdown document from the prototype's docs folder. */
59
+ export interface DocFrame extends FrameBase {
60
+ doc: string;
61
+ /** A size of its own in pixels, set by resizing it; else 640 by 900. */
62
+ size?: {
63
+ height: number;
64
+ width: number;
65
+ };
66
+ sketch?: undefined;
67
+ spec?: undefined;
68
+ view?: undefined;
69
+ }
70
+ /**
71
+ * A spec, edited in place on the canvas: a markdown file in its placer's
72
+ * folder. In a section, it is that section's spec; outside any section, it is part
73
+ * of the file spec.
74
+ */
75
+ export interface SpecFrame extends FrameBase {
76
+ doc?: undefined;
77
+ /**
78
+ * A slide's layout: its first frame beside its words (the default), or
79
+ * centred above them. Only a slide (people/<person>/slides/) has one.
80
+ */
81
+ layout?: SlideLayout;
82
+ /**
83
+ * A width of its own in pixels, set by resizing it; else 520. With a
84
+ * height, it is never taller than that, and scrolls; without one, it is
85
+ * as tall as its words (never less than 240). A slide's is fixed, both
86
+ * ways: 1920 by 1080 until resized.
87
+ */
88
+ size?: {
89
+ height?: number;
90
+ width: number;
91
+ };
92
+ sketch?: undefined;
93
+ /** Its file, from the file's folder: "people/ana/specs/checkout.md". */
94
+ spec: string;
95
+ view?: undefined;
96
+ }
97
+ export interface SketchFrame extends FrameBase {
98
+ doc?: undefined;
99
+ sketch: Sketch;
100
+ spec?: undefined;
101
+ /** Required, as an older Dex names a frame by its title or view. */
102
+ title: string;
103
+ view?: undefined;
104
+ }
105
+ declare const readFromDisk: unique symbol;
106
+ /**
107
+ * A frame this Dex cannot show: a kind from a newer Dex, or a mistake.
108
+ * Only reading a canvas makes one, so Dex never writes a frame that shows
109
+ * nothing.
110
+ */
111
+ export interface UnknownFrame extends FrameBase {
112
+ doc?: undefined;
113
+ sketch?: undefined;
114
+ spec?: undefined;
115
+ view?: undefined;
116
+ readonly [readFromDisk]: true;
117
+ }
118
+ export type Frame = ViewFrame | DocFrame | SpecFrame | SketchFrame | UnknownFrame;
119
+ /**
120
+ * One pass through the section's steps: the main path, an error state, an
121
+ * alternative. Its frames are the steps, left to right.
122
+ */
123
+ export interface Row {
124
+ /**
125
+ * In a person's copy of someone else's section: the id of their row this one
126
+ * is shown under (people-core.ts).
127
+ */
128
+ after?: string;
129
+ /**
130
+ * Whose it is, when not its section's: someone's version of a row in
131
+ * another person's section. Set when the canvas is read, never written.
132
+ */
133
+ author?: string;
134
+ /** The id of the section in its author's file that keeps it. */
135
+ copy?: string;
136
+ frames: Frame[];
137
+ id: string;
138
+ title?: string;
139
+ }
140
+ /**
141
+ * A section. Rows below the first are iterations of it. With `at`, a frame of
142
+ * its own instead: one frame, drawn at that point, with no section around it.
143
+ */
144
+ export interface Section {
145
+ /** Where a frame of its own's top left corner is, in canvas pixels. */
146
+ at?: CanvasPoint;
147
+ /**
148
+ * Whose it is: the person whose people/<person>/canvas.json it is in. Set
149
+ * when the canvas is read, never written; only they change it.
150
+ */
151
+ author?: string;
152
+ /** The id of the section it is a copy of, shown right below it. */
153
+ copyOf?: string;
154
+ /** When it was added, as an ISO date. */
155
+ created?: string;
156
+ description?: string;
157
+ /** Whose section it was copied from, when it is a copy. */
158
+ from?: string;
159
+ id: string;
160
+ /**
161
+ * Where the section's area starts, its top left corner in canvas pixels,
162
+ * once someone has drawn it or dragged it there. None stacks it with the
163
+ * others, top to bottom.
164
+ */
165
+ position?: CanvasPoint;
166
+ rows: Row[];
167
+ /**
168
+ * The least size of a section's area, in canvas pixels, once someone has
169
+ * sized it or frames have left it: its frames still grow it, but it never
170
+ * shrinks below this.
171
+ */
172
+ size?: {
173
+ height: number;
174
+ width: number;
175
+ };
176
+ title: string;
177
+ }
178
+ /**
179
+ * canvas.json: sections stacked top to bottom, and frames of their own where
180
+ * they were drawn. In each section, steps run left to right and iterations
181
+ * (states, errors, alternatives) top to bottom.
182
+ */
183
+ export interface Canvas {
184
+ /**
185
+ * Set in a person's file once their frames have uids: from then on, a
186
+ * frame of theirs with none is new.
187
+ */
188
+ frameUids?: true;
189
+ /**
190
+ * Whose sections come first, as the canvas was read: each
191
+ * person by when they joined. Never saved.
192
+ */
193
+ people?: readonly string[];
194
+ sections: Section[];
195
+ /**
196
+ * Whose canvas.json has given its frames uids, as the canvas was read: a
197
+ * frame of theirs with none is new. Never saved.
198
+ */
199
+ uidsGiven?: readonly string[];
200
+ }
201
+ //#endregion
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,53 @@
1
+ import { Sketch } from "../sketch-core.mjs";
2
+ import { ThreadAudience, ThreadStatus, ThreadTarget, ThreadWithPrototype } from "../threads-core.mjs";
3
+ import { z } from "zod";
4
+ //#region src/shared/comments/routes.d.ts
5
+ /**
6
+ * A comment to start: what it is on, its first message (left out with a
7
+ * wireframe), who it is for, and a wireframe for an agent to build.
8
+ */
9
+ export declare const NEW_COMMENT: z.ZodObject<{
10
+ target: z.ZodCustom<ThreadTarget, ThreadTarget>;
11
+ body: z.ZodOptional<z.ZodString>;
12
+ for: z.ZodOptional<z.ZodCustom<ThreadAudience, ThreadAudience>>;
13
+ sketch: z.ZodOptional<z.ZodCustom<Sketch, Sketch>>;
14
+ }, z.core.$strip>;
15
+ /**
16
+ * A person's change to a comment, by its id: a reply, a status, who it is
17
+ * for, a reaction, an edit or removal of their own message (`on`, by its
18
+ * `at`), or a review's comment hidden from the published site.
19
+ */
20
+ export declare const COMMENT_CHANGE: z.ZodObject<{
21
+ id: z.ZodString;
22
+ body: z.ZodOptional<z.ZodString>;
23
+ edit: z.ZodOptional<z.ZodString>;
24
+ for: z.ZodOptional<z.ZodCustom<ThreadAudience, ThreadAudience>>;
25
+ hidden: z.ZodOptional<z.ZodBoolean>;
26
+ on: z.ZodOptional<z.ZodString>;
27
+ react: z.ZodOptional<z.ZodString>;
28
+ remove: z.ZodOptional<z.ZodBoolean>;
29
+ status: z.ZodOptional<z.ZodCustom<ThreadStatus, ThreadStatus>>;
30
+ }, z.core.$strip>;
31
+ /**
32
+ * Each comment request, by name, and its answer to each method it takes.
33
+ * The query a request needs is in its comment.
34
+ */
35
+ export interface CommentAnswers {
36
+ /** ?slug= for one prototype's, or none for every one's. */
37
+ threads: {
38
+ GET: ThreadWithPrototype[];
39
+ POST: ThreadWithPrototype;
40
+ };
41
+ }
42
+ /** The bodies they take, by request and method, as the schemas above check them. */
43
+ export interface CommentBodies {
44
+ /** A comment to start, or a change to one, by its id. */
45
+ threads: {
46
+ POST: z.input<typeof NEW_COMMENT> | z.input<typeof COMMENT_CHANGE>;
47
+ };
48
+ }
49
+ /** The comment requests and the methods each takes. */
50
+ export declare const COMMENT_ROUTES: {
51
+ readonly threads: readonly ["GET", "POST"];
52
+ };
53
+ //#endregion
@@ -0,0 +1,37 @@
1
+ import { isRecord } from "../checks.mjs";
2
+ import { z } from "zod";
3
+ //#region src/shared/comments/routes.ts
4
+ /** An object, of a type whose fields the thread rules check. */
5
+ const record = (what) => z.custom(isRecord, `Expected ${what}`);
6
+ /** Text, of a type whose words the thread rules check. */
7
+ const word = () => z.custom((value) => typeof value === "string", "Expected text");
8
+ /**
9
+ * A comment to start: what it is on, its first message (left out with a
10
+ * wireframe), who it is for, and a wireframe for an agent to build.
11
+ */
12
+ const NEW_COMMENT = z.object({
13
+ target: record("what the comment is on, with its kind"),
14
+ body: z.string().optional(),
15
+ for: word().optional(),
16
+ sketch: record("a wireframe").optional()
17
+ });
18
+ /**
19
+ * A person's change to a comment, by its id: a reply, a status, who it is
20
+ * for, a reaction, an edit or removal of their own message (`on`, by its
21
+ * `at`), or a review's comment hidden from the published site.
22
+ */
23
+ const COMMENT_CHANGE = z.object({
24
+ id: z.string(),
25
+ body: z.string().optional(),
26
+ edit: z.string().optional(),
27
+ for: word().optional(),
28
+ hidden: z.boolean().optional(),
29
+ on: z.string().optional(),
30
+ react: z.string().optional(),
31
+ remove: z.boolean().optional(),
32
+ status: word().optional()
33
+ });
34
+ /** The comment requests and the methods each takes. */
35
+ const COMMENT_ROUTES = { threads: ["GET", "POST"] };
36
+ //#endregion
37
+ export { COMMENT_CHANGE, COMMENT_ROUTES, NEW_COMMENT };
@@ -76,4 +76,12 @@ export interface SendOptions {
76
76
  }
77
77
  /** Send feedback to the relay, if it is ready; never throws. */
78
78
  export declare const sendFeedback: (feedback: Feedback, { fetch, url }?: SendOptions) => Promise<Sent>;
79
+ /**
80
+ * Post a form to a relay and read its answer: the tracker's id, or why not.
81
+ * A form, so a simple request with no preflight; sign-ups travel this way
82
+ * too (signup.ts). Never throws.
83
+ */
84
+ export declare const postToRelay: (url: string, form: FormData, fetch: NonNullable<SendOptions["fetch"]>) => Promise<Exclude<Sent, {
85
+ reason: "invalid";
86
+ }>>;
79
87
  //#endregion
@@ -154,10 +154,18 @@ const sendFeedback = async (feedback, { fetch = globalThis.fetch, url = FEEDBACK
154
154
  reason: "invalid",
155
155
  problems
156
156
  };
157
+ return await postToRelay(url, toForm(feedback), fetch);
158
+ };
159
+ /**
160
+ * Post a form to a relay and read its answer: the tracker's id, or why not.
161
+ * A form, so a simple request with no preflight; sign-ups travel this way
162
+ * too (signup.ts). Never throws.
163
+ */
164
+ const postToRelay = async (url, form, fetch) => {
157
165
  try {
158
166
  const response = await fetch(url, {
159
167
  method: "POST",
160
- body: toForm(feedback)
168
+ body: form
161
169
  });
162
170
  if (response.ok) {
163
171
  const { id } = await response.json();
@@ -189,4 +197,4 @@ const sendFeedback = async (feedback, { fetch = globalThis.fetch, url = FEEDBACK
189
197
  }
190
198
  };
191
199
  //#endregion
192
- export { FEEDBACK_ACCEPT, FEEDBACK_KINDS, FEEDBACK_LIMITS, FEEDBACK_SOURCES, FEEDBACK_URL, checkFeedback, feedbackFileType, feedbackTypeOfName, isFeedbackFile, receiveFeedback, sendFeedback };
200
+ export { FEEDBACK_ACCEPT, FEEDBACK_KINDS, FEEDBACK_LIMITS, FEEDBACK_SOURCES, FEEDBACK_URL, checkFeedback, feedbackFileType, feedbackTypeOfName, isFeedbackFile, postToRelay, receiveFeedback, sendFeedback };
@@ -1,3 +1,4 @@
1
+ import { ReviewFile } from "./review-file.mjs";
1
2
  //#region src/shared/page-review.d.ts
2
3
  /** A spot, in pixels. */
3
4
  interface Point {
@@ -51,7 +52,7 @@ export interface ReviewPage {
51
52
  viewport: Size;
52
53
  }
53
54
  /** A Markup review, checked. */
54
- export interface PageReviewFile {
55
+ export interface PageReviewFile extends Pick<ReviewFile, "review" | "reviewer"> {
55
56
  /** The app it is of: its origin, unless its config names it. */
56
57
  app: string;
57
58
  /** The outline's tasks, in its order. */
@@ -62,16 +63,6 @@ export interface PageReviewFile {
62
63
  }[];
63
64
  };
64
65
  pages: ReviewPage[];
65
- review: {
66
- completed?: string;
67
- created?: string;
68
- id: string;
69
- title: string;
70
- };
71
- reviewer: {
72
- key: string;
73
- name: string;
74
- };
75
66
  threads: PageComment[];
76
67
  }
77
68
  export type PageReviewAnswer = {
@@ -1,6 +1,6 @@
1
1
  import { isRecord, isText } from "./checks.mjs";
2
2
  import { THREAD_ID_RE } from "./threads-core.mjs";
3
- import { GUEST_NAME, isReviewFormat } from "./review-file.mjs";
3
+ import { isReviewFormat, reviewHeader } from "./review-file.mjs";
4
4
  import { unzip } from "./unzip.mjs";
5
5
  //#region src/shared/page-review.ts
6
6
  const isNumber = (value) => typeof value === "number" && Number.isFinite(value);
@@ -76,8 +76,8 @@ const outlineOf = (value) => {
76
76
  function parsePageReview(value) {
77
77
  if (!(isRecord(value) && isRecord(value.review) && isRecord(value.reviewer))) return { problem: "unreadable" };
78
78
  if (value.version !== 1) return { problem: "newer" };
79
- const { review, reviewer } = value;
80
- if (!(isText(review.id) && isText(reviewer.key) && isText(value.app))) return { problem: "unreadable" };
79
+ const header = reviewHeader(value.review, value.reviewer);
80
+ if (!(header && isText(value.app))) return { problem: "unreadable" };
81
81
  const listed = Array.isArray(value.threads) ? value.threads : [];
82
82
  const threads = listed.flatMap((each) => commentOf(each) ?? []);
83
83
  if (threads.length < listed.length) return { problem: "unreadable" };
@@ -85,16 +85,7 @@ function parsePageReview(value) {
85
85
  const outline = outlineOf(value.outline);
86
86
  return { review: {
87
87
  app: value.app,
88
- review: {
89
- id: review.id,
90
- title: isText(review.title) ? review.title.trim() : "",
91
- ...isText(review.created) ? { created: review.created } : {},
92
- ...isText(review.completed) ? { completed: review.completed } : {}
93
- },
94
- reviewer: {
95
- key: reviewer.key,
96
- name: isText(reviewer.name) ? reviewer.name.trim() : GUEST_NAME
97
- },
88
+ ...header,
98
89
  ...outline ? { outline } : {},
99
90
  threads,
100
91
  pages
@@ -13,8 +13,19 @@ export interface PresenceEntry extends PresenceTarget {
13
13
  /** When it was last marked, as an ISO date. */
14
14
  updated: string;
15
15
  }
16
+ /**
17
+ * The session a Claude Code sub-agent's marks are under: its agent's
18
+ * session, then its own id, so each sub-agent shows on its own.
19
+ */
20
+ export declare const workerSession: (session: string, agentId: string) => string;
21
+ /** Whether marks under session `marked` are `session`'s own or its sub-agents'. */
22
+ export declare const underSession: (marked: string, session: string) => boolean;
16
23
  /** How long an entry lasts after it was last marked. */
17
24
  export declare const PRESENCE_TTL_MS = 120000;
25
+ /** When an entry ends, unless it is marked again first: as an epoch time. */
26
+ export declare const endsAt: (entry: {
27
+ updated: string;
28
+ }) => number;
18
29
  /** The entries that have not expired at `now`. */
19
30
  export declare const freshPresence: <Entry extends {
20
31
  updated: string;
@@ -1,7 +1,16 @@
1
1
  //#region src/shared/presence-core.ts
2
+ /**
3
+ * The session a Claude Code sub-agent's marks are under: its agent's
4
+ * session, then its own id, so each sub-agent shows on its own.
5
+ */
6
+ const workerSession = (session, agentId) => `${session}/${agentId}`;
7
+ /** Whether marks under session `marked` are `session`'s own or its sub-agents'. */
8
+ const underSession = (marked, session) => marked === session || marked.startsWith(`${session}/`);
2
9
  /** How long an entry lasts after it was last marked. */
3
10
  const PRESENCE_TTL_MS = 12e4;
11
+ /** When an entry ends, unless it is marked again first: as an epoch time. */
12
+ const endsAt = (entry) => Date.parse(entry.updated) + PRESENCE_TTL_MS;
4
13
  /** The entries that have not expired at `now`. */
5
- const freshPresence = (entries, now) => entries.filter((entry) => now - Date.parse(entry.updated) < PRESENCE_TTL_MS);
14
+ const freshPresence = (entries, now) => entries.filter((entry) => now < endsAt(entry));
6
15
  //#endregion
7
- export { PRESENCE_TTL_MS, freshPresence };
16
+ export { PRESENCE_TTL_MS, endsAt, freshPresence, underSession, workerSession };
@@ -57,6 +57,11 @@ export interface ReviewImport {
57
57
  added: number;
58
58
  skipped: number;
59
59
  }
60
+ /**
61
+ * Who reviewed and which review, as a review file and a Markup review both
62
+ * keep them; undefined without the review's id and the reviewer's key.
63
+ */
64
+ export declare const reviewHeader: (review: Record<string, unknown>, reviewer: Record<string, unknown>) => Pick<ReviewFile, "review" | "reviewer"> | undefined;
60
65
  /** A file's review, checked, or why it cannot be imported. */
61
66
  export declare function parseReviewFile(value: unknown): ReviewFileAnswer;
62
67
  /**
@@ -30,17 +30,13 @@ const commentOf = (value) => {
30
30
  }))
31
31
  };
32
32
  };
33
- /** A file's review, checked, or why it cannot be imported. */
34
- function parseReviewFile(value) {
35
- if (!(isRecord(value) && isReviewFormat(value.format) && isRecord(value.review) && isRecord(value.reviewer))) return { problem: "not-a-review" };
36
- if (value.version !== 1) return { problem: "newer" };
37
- const { review, reviewer } = value;
38
- if (!(isText(review.id) && isText(reviewer.key))) return { problem: "not-a-review" };
39
- const threads = (Array.isArray(value.threads) ? value.threads : []).map(commentOf);
40
- const read = threads.filter((thread) => thread !== void 0);
41
- if (read.length < threads.length) return { problem: "unreadable" };
42
- return { review: {
43
- ...isText(value.prototype) ? { prototype: value.prototype } : {},
33
+ /**
34
+ * Who reviewed and which review, as a review file and a Markup review both
35
+ * keep them; undefined without the review's id and the reviewer's key.
36
+ */
37
+ const reviewHeader = (review, reviewer) => {
38
+ if (!(isText(review.id) && isText(reviewer.key))) return;
39
+ return {
44
40
  review: {
45
41
  id: review.id,
46
42
  title: isText(review.title) ? review.title.trim() : "",
@@ -50,7 +46,21 @@ function parseReviewFile(value) {
50
46
  reviewer: {
51
47
  key: reviewer.key,
52
48
  name: isText(reviewer.name) ? reviewer.name.trim() : GUEST_NAME
53
- },
49
+ }
50
+ };
51
+ };
52
+ /** A file's review, checked, or why it cannot be imported. */
53
+ function parseReviewFile(value) {
54
+ if (!(isRecord(value) && isReviewFormat(value.format) && isRecord(value.review) && isRecord(value.reviewer))) return { problem: "not-a-review" };
55
+ if (value.version !== 1) return { problem: "newer" };
56
+ const header = reviewHeader(value.review, value.reviewer);
57
+ if (!header) return { problem: "not-a-review" };
58
+ const threads = (Array.isArray(value.threads) ? value.threads : []).map(commentOf);
59
+ const read = threads.filter((thread) => thread !== void 0);
60
+ if (read.length < threads.length) return { problem: "unreadable" };
61
+ return { review: {
62
+ ...isText(value.prototype) ? { prototype: value.prototype } : {},
63
+ ...header,
54
64
  threads: read
55
65
  } };
56
66
  }
@@ -94,4 +104,4 @@ const isReviewIn = (threads, file) => {
94
104
  return added.length === 0 && edited.length === 0;
95
105
  };
96
106
  //#endregion
97
- export { GUEST_NAME, OLD_REVIEW_FORMAT, REVIEW_FORMAT, REVIEW_VERSION, isReviewFormat, isReviewIn, parseReviewFile, reviewFor, reviewNews };
107
+ export { GUEST_NAME, OLD_REVIEW_FORMAT, REVIEW_FORMAT, REVIEW_VERSION, isReviewFormat, isReviewIn, parseReviewFile, reviewFor, reviewHeader, reviewNews };
@@ -27,7 +27,7 @@ const FAILURE_CAUSES = [
27
27
  cause: "Its packages aren't installed in {project}. Install them, then try again."
28
28
  },
29
29
  {
30
- pattern: "EADDRINUSE",
30
+ pattern: "EADDRINUSE|Port [0-9]+ is in use",
31
31
  cause: "Another program is using its port. Close it, then try again."
32
32
  },
33
33
  {
@@ -250,6 +250,11 @@ setInterval(() => {
250
250
  else if (Date.now() - lastCheck >= 1000) { lastCheck = Date.now(); post("check"); }
251
251
  }, CONFIG.inApp ? 500 : 2000);
252
252
  `;
253
+ /**
254
+ * The tab's icon, inlined, as this page shows while the server that serves
255
+ * app/public/dex-icon.svg is down. Drawn by scripts/studio-icons.mjs.
256
+ */
257
+ const ICON = `data:image/svg+xml,${encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" rx=\"5.5\" fill=\"#155dfc\"/><path transform=\"translate(6.206 4.750) scale(0.3625)\" fill=\"#ffffff\" d=\"M0,10.13333l0,-10.13333h14.5c7.45773,0 13.96208,4.08187 17.4008,10.13333zM34.5,20c0,1.75052 -0.2249,3.44852 -0.64737,5.06667l-33.85263,0l0,-10.13333l33.85263,0c0.42247,1.61815 0.64737,3.31614 0.64737,5.06667zM31.9008,29.86667c-3.43872,6.05147 -9.94307,10.13333 -17.4008,10.13333h-14.5l0,-10.13333z\"/></svg>")}`;
253
258
  /** The whole page, saying `options.state` first. */
254
259
  const serverPage = (options) => {
255
260
  const name = escapeHtml(options.name);
@@ -262,6 +267,7 @@ const serverPage = (options) => {
262
267
  <meta name="viewport" content="width=device-width, initial-scale=1">
263
268
  <meta name="color-scheme" content="light dark">
264
269
  <title>${name}</title>
270
+ <link rel="icon" href="${ICON}" type="image/svg+xml">
265
271
  <style>${STYLE}</style>
266
272
  </head>
267
273
  <body>
@@ -1,3 +1,4 @@
1
+ import { SendOptions } from "./feedback.mjs";
1
2
  //#region src/shared/signup.d.ts
2
3
  /** Where sign-ups go: the relay on Dex's site. */
3
4
  export declare const SIGNUP_URL = "https://sudio-site.vercel.app/api/signup";
@@ -33,10 +34,6 @@ export type SignupSent = {
33
34
  ok: false;
34
35
  reason: "invalid" | "limited" | "unavailable" | "failed";
35
36
  };
36
- export interface SignupSendOptions {
37
- fetch?: (url: string, init: RequestInit) => Promise<Response>;
38
- url?: string;
39
- }
40
37
  /** Send a sign-up to the relay, if it is ready; never throws. */
41
- export declare const sendSignup: (signup: Signup, { fetch, url }?: SignupSendOptions) => Promise<SignupSent>;
38
+ export declare const sendSignup: (signup: Signup, { fetch, url }?: SendOptions) => Promise<SignupSent>;
42
39
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { postToRelay } from "./feedback.mjs";
1
2
  //#region src/shared/signup.ts
2
3
  /** Where sign-ups go: the relay on Dex's site. */
3
4
  const SIGNUP_URL = "https://sudio-site.vercel.app/api/signup";
@@ -48,8 +49,6 @@ const receiveSignup = (form) => {
48
49
  signup
49
50
  };
50
51
  };
51
- const TOO_MANY_REQUESTS = 429;
52
- const SERVICE_UNAVAILABLE = 503;
53
52
  /** Send a sign-up to the relay, if it is ready; never throws. */
54
53
  const sendSignup = async (signup, { fetch = globalThis.fetch, url = SIGNUP_URL } = {}) => {
55
54
  if (checkSignup(signup).length > 0) return {
@@ -59,39 +58,7 @@ const sendSignup = async (signup, { fetch = globalThis.fetch, url = SIGNUP_URL }
59
58
  const form = new FormData();
60
59
  form.set("name", signup.name.trim());
61
60
  form.set("email", signup.email.trim());
62
- try {
63
- const response = await fetch(url, {
64
- method: "POST",
65
- body: form
66
- });
67
- if (response.ok) {
68
- const { id } = await response.json();
69
- return typeof id === "string" && id ? {
70
- ok: true,
71
- id
72
- } : {
73
- ok: false,
74
- reason: "failed"
75
- };
76
- }
77
- if (response.status === TOO_MANY_REQUESTS) return {
78
- ok: false,
79
- reason: "limited"
80
- };
81
- if (response.status === SERVICE_UNAVAILABLE) return {
82
- ok: false,
83
- reason: "unavailable"
84
- };
85
- return {
86
- ok: false,
87
- reason: "failed"
88
- };
89
- } catch {
90
- return {
91
- ok: false,
92
- reason: "failed"
93
- };
94
- }
61
+ return await postToRelay(url, form, fetch);
95
62
  };
96
63
  //#endregion
97
64
  export { SIGNUP_LIMITS, SIGNUP_URL, checkSignup, receiveSignup, sendSignup };
@@ -33,12 +33,6 @@ export interface ConnectedAgent {
33
33
  */
34
34
  watching?: boolean;
35
35
  }
36
- /**
37
- * How an agent comes by new feedback: pushed to it as it is left, pushed
38
- * with nothing yet to say it arrives, or only when it is asked or watches.
39
- */
40
- export type Hearing = "pushed" | "unproven" | "asked";
41
- export declare const hearingOf: (agent: ConnectedAgent) => Hearing;
42
36
  export type StudioEvent = {
43
37
  type: "presence";
44
38
  presence: PresenceEntry[];
@@ -1,10 +1,6 @@
1
1
  import { UNSEEN_PARTS, splitPrototypePath } from "./prototypes-core.mjs";
2
2
  import { classify } from "./studio-files.mjs";
3
3
  //#region src/shared/studio-events.ts
4
- const hearingOf = (agent) => {
5
- if (agent.channel) return "pushed";
6
- return agent.unproven ? "unproven" : "asked";
7
- };
8
4
  /** Each event, made from what it carries. */
9
5
  const studioEvent = {
10
6
  presence: (presence) => ({
@@ -92,4 +88,4 @@ function eventsForFile(file) {
92
88
  return [];
93
89
  }
94
90
  //#endregion
95
- export { STUDIO_EVENT_TYPES, eventMessage, eventsForFile, handleStudioEvent, hearingOf, studioEvent };
91
+ export { STUDIO_EVENT_TYPES, eventMessage, eventsForFile, handleStudioEvent, studioEvent };
@@ -1,4 +1,16 @@
1
1
  //#region src/shared/studio-files.d.ts
2
+ export declare const DISCIPLINES: readonly ["product", "brand", "engineering"];
3
+ export type Discipline = (typeof DISCIPLINES)[number];
4
+ /** A person who makes prototypes, from contributors.json. */
5
+ export interface Contributor {
6
+ discipline: Discipline;
7
+ /** Git user names that identify this person, so the agent knows who it is working for. */
8
+ git: string[];
9
+ /** Their GitHub username, for their avatar. */
10
+ github?: string;
11
+ name: string;
12
+ slug: string;
13
+ }
2
14
  /** Where each of the studio's own files is, relative to its content root. */
3
15
  export declare const STUDIO_FILES: {
4
16
  /** Who works in the studio, and the git users that are them. */