@dexhq/canvas 0.0.0-stage → 0.14.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 (1281) hide show
  1. package/CHANGELOG.md +928 -0
  2. package/LICENSE +21 -0
  3. package/README.md +526 -2
  4. package/app/app.tsx +194 -0
  5. package/app/base.ts +99 -0
  6. package/app/canvas/activity-bar.tsx +223 -0
  7. package/app/canvas/activity-model.ts +461 -0
  8. package/app/canvas/activity-parts.tsx +237 -0
  9. package/app/canvas/activity.tsx +947 -0
  10. package/app/canvas/add-to-spec.ts +131 -0
  11. package/app/canvas/agent-changes.ts +122 -0
  12. package/app/canvas/anchoring.ts +439 -0
  13. package/app/canvas/canvas-chrome.tsx +531 -0
  14. package/app/canvas/canvas-clipboard.ts +172 -0
  15. package/app/canvas/canvas-commands.ts +542 -0
  16. package/app/canvas/canvas-context-menu.tsx +54 -0
  17. package/app/canvas/canvas-context.tsx +151 -0
  18. package/app/canvas/canvas-corners.tsx +86 -0
  19. package/app/canvas/canvas-document.ts +1024 -0
  20. package/app/canvas/canvas-input.ts +554 -0
  21. package/app/canvas/canvas-keys.ts +360 -0
  22. package/app/canvas/canvas-menus.tsx +289 -0
  23. package/app/canvas/canvas-merge.ts +547 -0
  24. package/app/canvas/canvas-model.ts +1048 -0
  25. package/app/canvas/canvas-panels.ts +187 -0
  26. package/app/canvas/canvas-scene.ts +679 -0
  27. package/app/canvas/canvas-ui.ts +119 -0
  28. package/app/canvas/canvas.css +1017 -0
  29. package/app/canvas/change-notice.tsx +133 -0
  30. package/app/canvas/command-menu.tsx +154 -0
  31. package/app/canvas/comment-layer.tsx +449 -0
  32. package/app/canvas/comments.tsx +2210 -0
  33. package/app/canvas/device-edits.ts +207 -0
  34. package/app/canvas/device-icons.ts +26 -0
  35. package/app/canvas/device-picker.tsx +117 -0
  36. package/app/canvas/devices-panel.tsx +287 -0
  37. package/app/canvas/draw-layer.tsx +373 -0
  38. package/app/canvas/draw-model.ts +105 -0
  39. package/app/canvas/editable-text.tsx +167 -0
  40. package/app/canvas/element-picker.ts +577 -0
  41. package/app/canvas/engine/camera.ts +263 -0
  42. package/app/canvas/engine/canvas-gestures.ts +816 -0
  43. package/app/canvas/engine/canvas-store.ts +407 -0
  44. package/app/canvas/engine/canvas-view.tsx +345 -0
  45. package/app/canvas/engine/engine.css +97 -0
  46. package/app/canvas/floating-panel.tsx +155 -0
  47. package/app/canvas/flow-canvas.tsx +808 -0
  48. package/app/canvas/flow-naming.ts +23 -0
  49. package/app/canvas/flow-renames.ts +118 -0
  50. package/app/canvas/follow-pin.ts +49 -0
  51. package/app/canvas/forced-states.ts +219 -0
  52. package/app/canvas/frame-choices.tsx +85 -0
  53. package/app/canvas/frame-context-menu.tsx +554 -0
  54. package/app/canvas/frame-copies.ts +538 -0
  55. package/app/canvas/frame-drops.ts +159 -0
  56. package/app/canvas/frame-node.tsx +1536 -0
  57. package/app/canvas/frame-pictures.ts +573 -0
  58. package/app/canvas/frame-resize.tsx +193 -0
  59. package/app/canvas/frame-shown.ts +31 -0
  60. package/app/canvas/frame-source.ts +107 -0
  61. package/app/canvas/frame-thumb.tsx +69 -0
  62. package/app/canvas/grid-overlay.tsx +50 -0
  63. package/app/canvas/grid-panel.tsx +379 -0
  64. package/app/canvas/imported-reviews.tsx +843 -0
  65. package/app/canvas/insert-hint.tsx +163 -0
  66. package/app/canvas/inspect-layer.tsx +66 -0
  67. package/app/canvas/inspect-tools.ts +134 -0
  68. package/app/canvas/jpeg-pdf.ts +141 -0
  69. package/app/canvas/label-action.tsx +50 -0
  70. package/app/canvas/large-canvas-notice.tsx +51 -0
  71. package/app/canvas/layout.ts +1253 -0
  72. package/app/canvas/live-page.ts +416 -0
  73. package/app/canvas/measure-box.tsx +23 -0
  74. package/app/canvas/new-frame.ts +279 -0
  75. package/app/canvas/note-placing.ts +110 -0
  76. package/app/canvas/number-field.tsx +89 -0
  77. package/app/canvas/open-page.ts +50 -0
  78. package/app/canvas/page-heights.tsx +134 -0
  79. package/app/canvas/page-scroll.ts +66 -0
  80. package/app/canvas/pass-wheel.ts +48 -0
  81. package/app/canvas/pasted-cuts.ts +38 -0
  82. package/app/canvas/person-busy.ts +32 -0
  83. package/app/canvas/picks-menu.tsx +178 -0
  84. package/app/canvas/picks.ts +139 -0
  85. package/app/canvas/point-menu.tsx +77 -0
  86. package/app/canvas/props-model.ts +123 -0
  87. package/app/canvas/props-panel.tsx +371 -0
  88. package/app/canvas/quick-bar.tsx +149 -0
  89. package/app/canvas/removed-views-panel.tsx +500 -0
  90. package/app/canvas/review-marker.tsx +74 -0
  91. package/app/canvas/review-panel.tsx +1422 -0
  92. package/app/canvas/row-node.tsx +59 -0
  93. package/app/canvas/scene-context.tsx +74 -0
  94. package/app/canvas/section-node.tsx +278 -0
  95. package/app/canvas/selection.ts +49 -0
  96. package/app/canvas/server-notice.tsx +71 -0
  97. package/app/canvas/size-label.tsx +31 -0
  98. package/app/canvas/sketch-boxes.css +57 -0
  99. package/app/canvas/sketch-boxes.tsx +407 -0
  100. package/app/canvas/sketch-layer.tsx +448 -0
  101. package/app/canvas/sketch-model.ts +542 -0
  102. package/app/canvas/slide-frame.tsx +165 -0
  103. package/app/canvas/slide-full-screen.tsx +201 -0
  104. package/app/canvas/slide-page.tsx +197 -0
  105. package/app/canvas/slide-pdf.tsx +222 -0
  106. package/app/canvas/snapping.ts +182 -0
  107. package/app/canvas/spec-copies.ts +117 -0
  108. package/app/canvas/spec-frame.tsx +440 -0
  109. package/app/canvas/spec-full-screen.tsx +351 -0
  110. package/app/canvas/spec-margin.tsx +323 -0
  111. package/app/canvas/spec-mode.tsx +147 -0
  112. package/app/canvas/spec-placing.tsx +273 -0
  113. package/app/canvas/spec-threads.ts +63 -0
  114. package/app/canvas/spec-title.tsx +63 -0
  115. package/app/canvas/spot-pins.tsx +67 -0
  116. package/app/canvas/stack-node.tsx +92 -0
  117. package/app/canvas/state-store.ts +52 -0
  118. package/app/canvas/sticker-model.ts +124 -0
  119. package/app/canvas/sticker-sheet.tsx +545 -0
  120. package/app/canvas/stored-viewport.ts +64 -0
  121. package/app/canvas/styles-layer.tsx +301 -0
  122. package/app/canvas/tell-open-page.tsx +76 -0
  123. package/app/canvas/text-layer.tsx +274 -0
  124. package/app/canvas/thread-focus.tsx +75 -0
  125. package/app/canvas/thread-place.ts +77 -0
  126. package/app/canvas/tip.tsx +118 -0
  127. package/app/canvas/tool-cursors.ts +170 -0
  128. package/app/canvas/tool-icons.tsx +68 -0
  129. package/app/canvas/toolbar-parts.tsx +173 -0
  130. package/app/canvas/toolbar.tsx +345 -0
  131. package/app/canvas/tools.ts +61 -0
  132. package/app/canvas/typing.ts +47 -0
  133. package/app/canvas/unknown-frame.tsx +70 -0
  134. package/app/canvas/use-activity.ts +293 -0
  135. package/app/canvas/use-agent-changes.tsx +327 -0
  136. package/app/canvas/use-canvas-clipboard.tsx +401 -0
  137. package/app/canvas/use-canvas-commands.ts +91 -0
  138. package/app/canvas/use-canvas-editor.ts +267 -0
  139. package/app/canvas/use-component-drops.ts +161 -0
  140. package/app/canvas/use-spec-copies.ts +102 -0
  141. package/app/canvas/viewports.ts +21 -0
  142. package/app/canvas/wireframe-panel.tsx +330 -0
  143. package/app/canvas/xray.ts +28 -0
  144. package/app/client.d.ts +27 -0
  145. package/app/content.d.ts +17 -0
  146. package/app/design-system/components-address.ts +6 -0
  147. package/app/design-system/components-canvas.ts +379 -0
  148. package/app/design-system/components-prototype.tsx +468 -0
  149. package/app/design-system/pseudo-states.ts +187 -0
  150. package/app/editor/annotations.ts +250 -0
  151. package/app/editor/blocks.ts +570 -0
  152. package/app/editor/document-context.tsx +75 -0
  153. package/app/editor/embed-arrange.tsx +405 -0
  154. package/app/editor/embed-box.ts +301 -0
  155. package/app/editor/extensions.ts +56 -0
  156. package/app/editor/markdown-source.ts +245 -0
  157. package/app/editor/node-views.tsx +376 -0
  158. package/app/editor/quote-bubble.tsx +84 -0
  159. package/app/editor/two-versions.ts +82 -0
  160. package/app/flags.ts +14 -0
  161. package/app/frame/file-errors.ts +39 -0
  162. package/app/frame/frame-app.tsx +147 -0
  163. package/app/frame/frame-history.ts +58 -0
  164. package/app/frame/frame-links.ts +66 -0
  165. package/app/frame/hold-window-focus.ts +45 -0
  166. package/app/frame/left-view.tsx +57 -0
  167. package/app/frame/studio-view.tsx +36 -0
  168. package/app/frame/view-files.ts +13 -0
  169. package/app/frame/views.ts +161 -0
  170. package/app/frame.css +14 -0
  171. package/app/frame.html +31 -0
  172. package/app/frame.tsx +40 -0
  173. package/app/git/branch-panel.tsx +831 -0
  174. package/app/git/change-list.tsx +119 -0
  175. package/app/git/clash.tsx +114 -0
  176. package/app/git/git-controls.tsx +424 -0
  177. package/app/git/git-state.ts +206 -0
  178. package/app/git/git-toasts.tsx +507 -0
  179. package/app/git/paused.tsx +192 -0
  180. package/app/git/saved-list.tsx +96 -0
  181. package/app/git/sync-panel.tsx +334 -0
  182. package/app/i18n/locales/en/messages.po +4924 -0
  183. package/app/i18n/locales/en/messages.ts +1 -0
  184. package/app/i18n/locales/pseudo/messages.po +4924 -0
  185. package/app/i18n/locales/pseudo/messages.ts +1 -0
  186. package/app/i18n/locales.ts +41 -0
  187. package/app/i18n/provider.tsx +27 -0
  188. package/app/icons/glyphs.tsx +251 -0
  189. package/app/icons/index.tsx +38 -0
  190. package/app/icons/types.ts +12 -0
  191. package/app/index.html +46 -0
  192. package/app/kit/inspect-runtime.ts +292 -0
  193. package/app/kit/sample-people.ts +77 -0
  194. package/app/kit/use-flow.ts +23 -0
  195. package/app/kit/use-simulated-load.ts +24 -0
  196. package/app/kit/use-simulated-stream.ts +50 -0
  197. package/app/kit/use-view-control.ts +31 -0
  198. package/app/kit/use-view-param.ts +9 -0
  199. package/app/live/deployed-preview.ts +34 -0
  200. package/app/live/focus-reporter.ts +96 -0
  201. package/app/live/guest-review.ts +515 -0
  202. package/app/live/restart-wait.ts +68 -0
  203. package/app/live/server-connection.ts +98 -0
  204. package/app/live/studio-action.ts +42 -0
  205. package/app/live/studio-api.ts +769 -0
  206. package/app/live/studio-data.ts +177 -0
  207. package/app/live/studio-live.ts +343 -0
  208. package/app/live/studio-request.ts +133 -0
  209. package/app/live/thread-state.ts +59 -0
  210. package/app/live/use-devices.ts +92 -0
  211. package/app/live/use-focus.ts +39 -0
  212. package/app/live/use-last-edited.ts +31 -0
  213. package/app/live/use-show-requests.ts +27 -0
  214. package/app/live/use-workspace.ts +88 -0
  215. package/app/main.tsx +50 -0
  216. package/app/next/fonts.ts +34 -0
  217. package/app/next/image.tsx +117 -0
  218. package/app/next/navigation.ts +64 -0
  219. package/app/next/router.ts +41 -0
  220. package/app/pages/agent-settings.tsx +57 -0
  221. package/app/pages/ask-the-agent.tsx +40 -0
  222. package/app/pages/canvas-settings.tsx +35 -0
  223. package/app/pages/canvas.tsx +789 -0
  224. package/app/pages/chrome-extension.tsx +132 -0
  225. package/app/pages/commands-settings.tsx +709 -0
  226. package/app/pages/deployment-settings.tsx +190 -0
  227. package/app/pages/doc.tsx +31 -0
  228. package/app/pages/file-sort.ts +49 -0
  229. package/app/pages/git-checks.tsx +174 -0
  230. package/app/pages/guidelines.tsx +202 -0
  231. package/app/pages/home.tsx +515 -0
  232. package/app/pages/host.tsx +21 -0
  233. package/app/pages/markup-demo.jpg +0 -0
  234. package/app/pages/markup-settings.tsx +274 -0
  235. package/app/pages/not-found.tsx +18 -0
  236. package/app/pages/people.tsx +115 -0
  237. package/app/pages/play-bar.tsx +433 -0
  238. package/app/pages/play-size.ts +86 -0
  239. package/app/pages/play.tsx +992 -0
  240. package/app/pages/profile.tsx +57 -0
  241. package/app/pages/prototype.tsx +136 -0
  242. package/app/pages/render.tsx +162 -0
  243. package/app/pages/settings.tsx +37 -0
  244. package/app/pages/workspace-general.tsx +323 -0
  245. package/app/pages/workspace-git.tsx +385 -0
  246. package/app/pages/your-guidelines.tsx +77 -0
  247. package/app/pages/your-picture.tsx +205 -0
  248. package/app/public/dex-192.png +0 -0
  249. package/app/public/dex-512.png +0 -0
  250. package/app/public/dex-apple-touch-icon.png +0 -0
  251. package/app/public/dex-icon-32.png +0 -0
  252. package/app/public/dex-icon.svg +1 -0
  253. package/app/public/dex-maskable-512.png +0 -0
  254. package/app/registry-files.ts +53 -0
  255. package/app/registry.ts +243 -0
  256. package/app/renamed-storage.ts +42 -0
  257. package/app/save-file.ts +13 -0
  258. package/app/shell/about.tsx +126 -0
  259. package/app/shell/agent-logos.tsx +98 -0
  260. package/app/shell/agent-manual.tsx +172 -0
  261. package/app/shell/avatar-pictures.ts +131 -0
  262. package/app/shell/avatar.tsx +128 -0
  263. package/app/shell/bell.tsx +382 -0
  264. package/app/shell/broke.tsx +46 -0
  265. package/app/shell/chrome-theme.tsx +91 -0
  266. package/app/shell/connect-agent.tsx +538 -0
  267. package/app/shell/copy-text.tsx +53 -0
  268. package/app/shell/deployed-preview-bar.tsx +23 -0
  269. package/app/shell/desktop-app.tsx +290 -0
  270. package/app/shell/empty-state.tsx +35 -0
  271. package/app/shell/feedback-details.ts +111 -0
  272. package/app/shell/feedback-form.tsx +630 -0
  273. package/app/shell/feedback-link.tsx +82 -0
  274. package/app/shell/file-bytes.ts +11 -0
  275. package/app/shell/host.ts +96 -0
  276. package/app/shell/info-tip.tsx +15 -0
  277. package/app/shell/install-prompt.ts +55 -0
  278. package/app/shell/instructions-editor.tsx +842 -0
  279. package/app/shell/instructions.tsx +114 -0
  280. package/app/shell/main-sidebar.tsx +346 -0
  281. package/app/shell/markdown.tsx +9 -0
  282. package/app/shell/open-agent.tsx +90 -0
  283. package/app/shell/page-header.tsx +154 -0
  284. package/app/shell/page-title.ts +129 -0
  285. package/app/shell/presence-style.ts +59 -0
  286. package/app/shell/presence.tsx +503 -0
  287. package/app/shell/prototype-menu.tsx +293 -0
  288. package/app/shell/quick-start.tsx +311 -0
  289. package/app/shell/recents.ts +113 -0
  290. package/app/shell/report-issue.ts +130 -0
  291. package/app/shell/restart-toast.tsx +258 -0
  292. package/app/shell/save-state.tsx +45 -0
  293. package/app/shell/scaled-frame.tsx +151 -0
  294. package/app/shell/settings-sections.ts +202 -0
  295. package/app/shell/settings-sidebar.tsx +81 -0
  296. package/app/shell/settings-ui.tsx +185 -0
  297. package/app/shell/shell-bar.ts +16 -0
  298. package/app/shell/sidebar.tsx +88 -0
  299. package/app/shell/skeleton.ts +376 -0
  300. package/app/shell/status-badge.tsx +29 -0
  301. package/app/shell/studio-shell.tsx +217 -0
  302. package/app/shell/thread-list.tsx +217 -0
  303. package/app/shell/time-ago.ts +45 -0
  304. package/app/shell/toasts.tsx +119 -0
  305. package/app/shell/update-notice.tsx +883 -0
  306. package/app/shell/use-copied.ts +26 -0
  307. package/app/shell/use-space.ts +27 -0
  308. package/app/shell/watch-switch.tsx +32 -0
  309. package/app/shell/welcome.tsx +205 -0
  310. package/app/shell/window-buttons.tsx +103 -0
  311. package/app/shell/working-on.tsx +35 -0
  312. package/app/shell/workspace-mark.tsx +278 -0
  313. package/app/shell/workspace-tile.jpg +0 -0
  314. package/app/studio-ui.d.ts +97 -0
  315. package/app/styles.css +571 -0
  316. package/app/types.ts +257 -0
  317. package/app/ui/boundary.tsx +48 -0
  318. package/app/ui/prompt-editor.tsx +474 -0
  319. package/app/ui/reference.tsx +114 -0
  320. package/app/ui/segmented.tsx +73 -0
  321. package/app/ui/shadcn/attachment.tsx +207 -0
  322. package/app/ui/shadcn/badge.tsx +51 -0
  323. package/app/ui/shadcn/button.tsx +62 -0
  324. package/app/ui/shadcn/card.tsx +102 -0
  325. package/app/ui/shadcn/checkbox.tsx +28 -0
  326. package/app/ui/shadcn/dialog.tsx +157 -0
  327. package/app/ui/shadcn/dropdown-menu.tsx +276 -0
  328. package/app/ui/shadcn/input-group.tsx +158 -0
  329. package/app/ui/shadcn/input.tsx +19 -0
  330. package/app/ui/shadcn/kbd.tsx +26 -0
  331. package/app/ui/shadcn/native-select.tsx +65 -0
  332. package/app/ui/shadcn/popover.tsx +89 -0
  333. package/app/ui/shadcn/separator.tsx +24 -0
  334. package/app/ui/shadcn/sheet.tsx +135 -0
  335. package/app/ui/shadcn/spinner.tsx +17 -0
  336. package/app/ui/shadcn/switch.tsx +31 -0
  337. package/app/ui/shadcn/tabs.tsx +82 -0
  338. package/app/ui/shadcn/textarea.tsx +17 -0
  339. package/app/ui/shadcn/toggle-group.tsx +89 -0
  340. package/app/ui/shadcn/toggle.tsx +44 -0
  341. package/app/ui/shadcn/tooltip.tsx +67 -0
  342. package/app/ui/theme-provider.tsx +31 -0
  343. package/app/ui/theme-switch.tsx +27 -0
  344. package/app/ui/theme.css +715 -0
  345. package/bin/dex.mjs +44 -0
  346. package/bin/sudio.mjs +9 -0
  347. package/dist/cli/banner.d.mts +75 -0
  348. package/dist/cli/banner.mjs +206 -0
  349. package/dist/cli/command.d.mts +47 -0
  350. package/dist/cli/command.mjs +40 -0
  351. package/dist/cli/commands/agents/add.d.mts +11 -0
  352. package/dist/cli/commands/agents/add.mjs +24 -0
  353. package/dist/cli/commands/agents.d.mts +5 -0
  354. package/dist/cli/commands/agents.mjs +13 -0
  355. package/dist/cli/commands/app.d.mts +5 -0
  356. package/dist/cli/commands/app.mjs +104 -0
  357. package/dist/cli/commands/build.d.mts +4 -0
  358. package/dist/cli/commands/build.mjs +33 -0
  359. package/dist/cli/commands/claude.d.mts +10 -0
  360. package/dist/cli/commands/claude.mjs +44 -0
  361. package/dist/cli/commands/cloud/args.d.mts +17 -0
  362. package/dist/cli/commands/cloud/args.mjs +18 -0
  363. package/dist/cli/commands/cloud/link.d.mts +15 -0
  364. package/dist/cli/commands/cloud/link.mjs +20 -0
  365. package/dist/cli/commands/cloud/live.d.mts +38 -0
  366. package/dist/cli/commands/cloud/live.mjs +29 -0
  367. package/dist/cli/commands/cloud/login.d.mts +15 -0
  368. package/dist/cli/commands/cloud/login.mjs +19 -0
  369. package/dist/cli/commands/cloud/publish.d.mts +5 -0
  370. package/dist/cli/commands/cloud/publish.mjs +51 -0
  371. package/dist/cli/commands/cloud/push.d.mts +4 -0
  372. package/dist/cli/commands/cloud/push.mjs +15 -0
  373. package/dist/cli/commands/cloud/status.d.mts +4 -0
  374. package/dist/cli/commands/cloud/status.mjs +15 -0
  375. package/dist/cli/commands/cloud/unlink.d.mts +4 -0
  376. package/dist/cli/commands/cloud/unlink.mjs +15 -0
  377. package/dist/cli/commands/cloud.d.mts +5 -0
  378. package/dist/cli/commands/cloud.mjs +21 -0
  379. package/dist/cli/commands/components.d.mts +14 -0
  380. package/dist/cli/commands/components.mjs +26 -0
  381. package/dist/cli/commands/create.d.mts +245 -0
  382. package/dist/cli/commands/create.mjs +153 -0
  383. package/dist/cli/commands/dev.d.mts +24 -0
  384. package/dist/cli/commands/dev.mjs +134 -0
  385. package/dist/cli/commands/doctor.d.mts +9 -0
  386. package/dist/cli/commands/doctor.mjs +24 -0
  387. package/dist/cli/commands/extension.d.mts +10 -0
  388. package/dist/cli/commands/extension.mjs +32 -0
  389. package/dist/cli/commands/hook.d.mts +19 -0
  390. package/dist/cli/commands/hook.mjs +72 -0
  391. package/dist/cli/commands/init.d.mts +99 -0
  392. package/dist/cli/commands/init.mjs +22 -0
  393. package/dist/cli/commands/mcp.d.mts +15 -0
  394. package/dist/cli/commands/mcp.mjs +48 -0
  395. package/dist/cli/commands/merge-contributors.d.mts +24 -0
  396. package/dist/cli/commands/merge-contributors.mjs +43 -0
  397. package/dist/cli/commands/merge-spec.d.mts +32 -0
  398. package/dist/cli/commands/merge-spec.mjs +75 -0
  399. package/dist/cli/commands/preview.d.mts +4 -0
  400. package/dist/cli/commands/preview.mjs +15 -0
  401. package/dist/cli/commands/stop.d.mts +4 -0
  402. package/dist/cli/commands/stop.mjs +21 -0
  403. package/dist/cli/commands/upgrade.d.mts +14 -0
  404. package/dist/cli/commands/upgrade.mjs +47 -0
  405. package/dist/cli/commands/work/args.d.mts +33 -0
  406. package/dist/cli/commands/work/args.mjs +34 -0
  407. package/dist/cli/commands/work/check.d.mts +4 -0
  408. package/dist/cli/commands/work/check.mjs +19 -0
  409. package/dist/cli/commands/work/contributor.d.mts +25 -0
  410. package/dist/cli/commands/work/contributor.mjs +36 -0
  411. package/dist/cli/commands/work/new.d.mts +30 -0
  412. package/dist/cli/commands/work/new.mjs +33 -0
  413. package/dist/cli/commands/work/presence.d.mts +34 -0
  414. package/dist/cli/commands/work/presence.mjs +38 -0
  415. package/dist/cli/commands/work/scope.d.mts +21 -0
  416. package/dist/cli/commands/work/scope.mjs +25 -0
  417. package/dist/cli/commands/work/snapshot.d.mts +20 -0
  418. package/dist/cli/commands/work/snapshot.mjs +28 -0
  419. package/dist/cli/commands/work/thread.d.mts +36 -0
  420. package/dist/cli/commands/work/thread.mjs +40 -0
  421. package/dist/cli/commands/work/threads.d.mts +14 -0
  422. package/dist/cli/commands/work/threads.mjs +25 -0
  423. package/dist/cli/commands/work/whoami.d.mts +4 -0
  424. package/dist/cli/commands/work/whoami.mjs +14 -0
  425. package/dist/cli/help.d.mts +9 -0
  426. package/dist/cli/help.mjs +161 -0
  427. package/dist/cli/main.d.mts +473 -0
  428. package/dist/cli/main.mjs +113 -0
  429. package/dist/cli/mcp-relay.d.mts +60 -0
  430. package/dist/cli/mcp-relay.mjs +342 -0
  431. package/dist/cli/recovery-server.d.mts +25 -0
  432. package/dist/cli/recovery-server.mjs +68 -0
  433. package/dist/cli/strict-flags.d.mts +30 -0
  434. package/dist/cli/strict-flags.mjs +115 -0
  435. package/dist/cli/supervise.d.mts +42 -0
  436. package/dist/cli/supervise.mjs +300 -0
  437. package/dist/cli/ui.d.mts +109 -0
  438. package/dist/cli/ui.mjs +240 -0
  439. package/dist/config/design-system.d.mts +75 -0
  440. package/dist/config/design-system.mjs +202 -0
  441. package/dist/config/index.d.mts +261 -0
  442. package/dist/config/index.mjs +20 -0
  443. package/dist/config/load.d.mts +55 -0
  444. package/dist/config/load.mjs +121 -0
  445. package/dist/config/package-manager.d.mts +15 -0
  446. package/dist/config/package-manager.mjs +61 -0
  447. package/dist/config/project-files.d.mts +91 -0
  448. package/dist/config/project-files.mjs +504 -0
  449. package/dist/config/renamed.d.mts +22 -0
  450. package/dist/config/renamed.mjs +34 -0
  451. package/dist/config/schema.d.mts +235 -0
  452. package/dist/config/schema.mjs +167 -0
  453. package/dist/content/biome.d.mts +10 -0
  454. package/dist/content/biome.mjs +35 -0
  455. package/dist/content/capture.d.mts +81 -0
  456. package/dist/content/capture.mjs +723 -0
  457. package/dist/content/commands.d.mts +67 -0
  458. package/dist/content/commands.mjs +180 -0
  459. package/dist/content/comments-log.d.mts +61 -0
  460. package/dist/content/comments-log.mjs +161 -0
  461. package/dist/content/component-props.d.mts +17 -0
  462. package/dist/content/component-props.mjs +354 -0
  463. package/dist/content/content.d.mts +581 -0
  464. package/dist/content/content.mjs +1366 -0
  465. package/dist/content/devices.d.mts +17 -0
  466. package/dist/content/devices.mjs +49 -0
  467. package/dist/content/file-turns.d.mts +9 -0
  468. package/dist/content/file-turns.mjs +35 -0
  469. package/dist/content/first-run.d.mts +9 -0
  470. package/dist/content/first-run.mjs +45 -0
  471. package/dist/content/flow-specs.d.mts +68 -0
  472. package/dist/content/flow-specs.mjs +161 -0
  473. package/dist/content/insert-edit.d.mts +24 -0
  474. package/dist/content/insert-edit.mjs +139 -0
  475. package/dist/content/jsx-source.d.mts +9 -0
  476. package/dist/content/jsx-source.mjs +30 -0
  477. package/dist/content/last-edited.d.mts +10 -0
  478. package/dist/content/last-edited.mjs +34 -0
  479. package/dist/content/layout.d.mts +10 -0
  480. package/dist/content/layout.mjs +23 -0
  481. package/dist/content/merge-rules.d.mts +16 -0
  482. package/dist/content/merge-rules.mjs +61 -0
  483. package/dist/content/prop-edit.d.mts +45 -0
  484. package/dist/content/prop-edit.mjs +151 -0
  485. package/dist/content/prototype-checks.d.mts +30 -0
  486. package/dist/content/prototype-checks.mjs +117 -0
  487. package/dist/content/prototype-summary.d.mts +93 -0
  488. package/dist/content/prototype-summary.mjs +86 -0
  489. package/dist/content/prototypes.d.mts +117 -0
  490. package/dist/content/prototypes.mjs +232 -0
  491. package/dist/content/read-text.d.mts +4 -0
  492. package/dist/content/read-text.mjs +12 -0
  493. package/dist/content/review-import.d.mts +13 -0
  494. package/dist/content/review-import.mjs +54 -0
  495. package/dist/content/review-pages.d.mts +26 -0
  496. package/dist/content/review-pages.mjs +240 -0
  497. package/dist/content/screenshot.d.mts +60 -0
  498. package/dist/content/screenshot.mjs +274 -0
  499. package/dist/content/snapshot-client.d.mts +25 -0
  500. package/dist/content/snapshot-client.mjs +60 -0
  501. package/dist/content/store.d.mts +52 -0
  502. package/dist/content/store.mjs +123 -0
  503. package/dist/content/text-edit.d.mts +24 -0
  504. package/dist/content/text-edit.mjs +92 -0
  505. package/dist/content/thread-module.d.mts +79 -0
  506. package/dist/content/thread-module.mjs +201 -0
  507. package/dist/content/threads.d.mts +29 -0
  508. package/dist/content/threads.mjs +193 -0
  509. package/dist/content/trash.d.mts +69 -0
  510. package/dist/content/trash.mjs +206 -0
  511. package/dist/paste/figma/appearance.d.mts +7 -0
  512. package/dist/paste/figma/appearance.mjs +156 -0
  513. package/dist/paste/figma/captures.d.mts +14 -0
  514. package/dist/paste/figma/captures.mjs +112 -0
  515. package/dist/paste/figma/decode.d.mts +376 -0
  516. package/dist/paste/figma/decode.mjs +235 -0
  517. package/dist/paste/figma/document.d.mts +70 -0
  518. package/dist/paste/figma/document.mjs +323 -0
  519. package/dist/paste/figma/layout.d.mts +19 -0
  520. package/dist/paste/figma/layout.mjs +190 -0
  521. package/dist/paste/figma/paint.d.mts +9 -0
  522. package/dist/paste/figma/paint.mjs +198 -0
  523. package/dist/paste/figma/render.d.mts +8 -0
  524. package/dist/paste/figma/render.mjs +102 -0
  525. package/dist/paste/figma/styles.d.mts +52 -0
  526. package/dist/paste/figma/styles.mjs +53 -0
  527. package/dist/paste/figma/text.d.mts +6 -0
  528. package/dist/paste/figma/text.mjs +282 -0
  529. package/dist/paste/figma/vector.d.mts +15 -0
  530. package/dist/paste/figma/vector.mjs +254 -0
  531. package/dist/paste/fonts.d.mts +9 -0
  532. package/dist/paste/fonts.mjs +81 -0
  533. package/dist/paste/paste.d.mts +27 -0
  534. package/dist/paste/paste.mjs +131 -0
  535. package/dist/paths.d.mts +66 -0
  536. package/dist/paths.mjs +138 -0
  537. package/dist/server/agent-env.d.mts +12 -0
  538. package/dist/server/agent-env.mjs +47 -0
  539. package/dist/server/agent-session.d.mts +62 -0
  540. package/dist/server/agent-session.mjs +131 -0
  541. package/dist/server/agents.d.mts +133 -0
  542. package/dist/server/agents.mjs +771 -0
  543. package/dist/server/allowed-request.d.mts +31 -0
  544. package/dist/server/allowed-request.mjs +54 -0
  545. package/dist/server/avatars.d.mts +18 -0
  546. package/dist/server/avatars.mjs +60 -0
  547. package/dist/server/brief.d.mts +37 -0
  548. package/dist/server/brief.mjs +242 -0
  549. package/dist/server/briefing.d.mts +97 -0
  550. package/dist/server/briefing.mjs +99 -0
  551. package/dist/server/build-pictures.d.mts +55 -0
  552. package/dist/server/build-pictures.mjs +209 -0
  553. package/dist/server/build-settings.d.mts +13 -0
  554. package/dist/server/build-settings.mjs +30 -0
  555. package/dist/server/changelog.d.mts +10 -0
  556. package/dist/server/changelog.mjs +39 -0
  557. package/dist/server/channel.d.mts +250 -0
  558. package/dist/server/channel.mjs +669 -0
  559. package/dist/server/claimed-presence.d.mts +17 -0
  560. package/dist/server/claimed-presence.mjs +50 -0
  561. package/dist/server/close-check.d.mts +31 -0
  562. package/dist/server/close-check.mjs +129 -0
  563. package/dist/server/cloud.d.mts +89 -0
  564. package/dist/server/cloud.mjs +229 -0
  565. package/dist/server/command-settings.d.mts +23 -0
  566. package/dist/server/command-settings.mjs +59 -0
  567. package/dist/server/component-catalogue.d.mts +47 -0
  568. package/dist/server/component-catalogue.mjs +166 -0
  569. package/dist/server/config-settings.d.mts +19 -0
  570. package/dist/server/config-settings.mjs +44 -0
  571. package/dist/server/content-type.d.mts +3 -0
  572. package/dist/server/content-type.mjs +25 -0
  573. package/dist/server/dependency-clash.d.mts +23 -0
  574. package/dist/server/dependency-clash.mjs +225 -0
  575. package/dist/server/dev-server.d.mts +11 -0
  576. package/dist/server/dev-server.mjs +198 -0
  577. package/dist/server/features.d.mts +29 -0
  578. package/dist/server/features.mjs +34 -0
  579. package/dist/server/file-errors.d.mts +22 -0
  580. package/dist/server/file-errors.mjs +111 -0
  581. package/dist/server/file-lock.d.mts +18 -0
  582. package/dist/server/file-lock.mjs +68 -0
  583. package/dist/server/git-asks.d.mts +23 -0
  584. package/dist/server/git-asks.mjs +57 -0
  585. package/dist/server/git-host.d.mts +38 -0
  586. package/dist/server/git-host.mjs +182 -0
  587. package/dist/server/git-paused.d.mts +19 -0
  588. package/dist/server/git-paused.mjs +163 -0
  589. package/dist/server/git-settings.d.mts +18 -0
  590. package/dist/server/git-settings.mjs +64 -0
  591. package/dist/server/git-sync.d.mts +67 -0
  592. package/dist/server/git-sync.mjs +499 -0
  593. package/dist/server/git.d.mts +148 -0
  594. package/dist/server/git.mjs +652 -0
  595. package/dist/server/instructions.d.mts +27 -0
  596. package/dist/server/instructions.mjs +71 -0
  597. package/dist/server/live-mirror.d.mts +60 -0
  598. package/dist/server/live-mirror.mjs +319 -0
  599. package/dist/server/live.d.mts +10 -0
  600. package/dist/server/live.mjs +155 -0
  601. package/dist/server/machine-update.d.mts +77 -0
  602. package/dist/server/machine-update.mjs +486 -0
  603. package/dist/server/mcp-handover.d.mts +37 -0
  604. package/dist/server/mcp-handover.mjs +76 -0
  605. package/dist/server/mcp.d.mts +63 -0
  606. package/dist/server/mcp.mjs +156 -0
  607. package/dist/server/me.d.mts +30 -0
  608. package/dist/server/me.mjs +43 -0
  609. package/dist/server/next.d.mts +21 -0
  610. package/dist/server/next.mjs +96 -0
  611. package/dist/server/notices.d.mts +84 -0
  612. package/dist/server/notices.mjs +281 -0
  613. package/dist/server/open-page.d.mts +58 -0
  614. package/dist/server/open-page.mjs +101 -0
  615. package/dist/server/own-copies.d.mts +64 -0
  616. package/dist/server/own-copies.mjs +260 -0
  617. package/dist/server/people.d.mts +19 -0
  618. package/dist/server/people.mjs +57 -0
  619. package/dist/server/personal-folder.d.mts +7 -0
  620. package/dist/server/personal-folder.mjs +32 -0
  621. package/dist/server/pictures.d.mts +39 -0
  622. package/dist/server/pictures.mjs +248 -0
  623. package/dist/server/port.d.mts +60 -0
  624. package/dist/server/port.mjs +106 -0
  625. package/dist/server/preferences.d.mts +7 -0
  626. package/dist/server/preferences.mjs +22 -0
  627. package/dist/server/presence.d.mts +40 -0
  628. package/dist/server/presence.mjs +98 -0
  629. package/dist/server/project-id.d.mts +4 -0
  630. package/dist/server/project-id.mjs +13 -0
  631. package/dist/server/project-public.d.mts +4 -0
  632. package/dist/server/project-public.mjs +53 -0
  633. package/dist/server/prototype-brief.d.mts +26 -0
  634. package/dist/server/prototype-brief.mjs +117 -0
  635. package/dist/server/push-notice.d.mts +23 -0
  636. package/dist/server/push-notice.mjs +43 -0
  637. package/dist/server/quiet-run.d.mts +25 -0
  638. package/dist/server/quiet-run.mjs +47 -0
  639. package/dist/server/registry.d.mts +23 -0
  640. package/dist/server/registry.mjs +113 -0
  641. package/dist/server/requests.d.mts +63 -0
  642. package/dist/server/requests.mjs +1483 -0
  643. package/dist/server/response-budget.d.mts +66 -0
  644. package/dist/server/response-budget.mjs +78 -0
  645. package/dist/server/restart.d.mts +77 -0
  646. package/dist/server/restart.mjs +115 -0
  647. package/dist/server/roster.d.mts +76 -0
  648. package/dist/server/roster.mjs +191 -0
  649. package/dist/server/saved.d.mts +18 -0
  650. package/dist/server/saved.mjs +46 -0
  651. package/dist/server/source-stamp.d.mts +19 -0
  652. package/dist/server/source-stamp.mjs +120 -0
  653. package/dist/server/spec-decisions.d.mts +31 -0
  654. package/dist/server/spec-decisions.mjs +59 -0
  655. package/dist/server/spec-suggestions.d.mts +21 -0
  656. package/dist/server/spec-suggestions.mjs +59 -0
  657. package/dist/server/state.d.mts +118 -0
  658. package/dist/server/state.mjs +165 -0
  659. package/dist/server/stop-studio.d.mts +17 -0
  660. package/dist/server/stop-studio.mjs +37 -0
  661. package/dist/server/studio-for.d.mts +58 -0
  662. package/dist/server/studio-for.mjs +73 -0
  663. package/dist/server/sync-install.d.mts +44 -0
  664. package/dist/server/sync-install.mjs +66 -0
  665. package/dist/server/thread-forms.d.mts +50 -0
  666. package/dist/server/thread-forms.mjs +159 -0
  667. package/dist/server/thread-place.d.mts +39 -0
  668. package/dist/server/thread-place.mjs +87 -0
  669. package/dist/server/thread-source.d.mts +60 -0
  670. package/dist/server/thread-source.mjs +197 -0
  671. package/dist/server/tools/close-reply.d.mts +6 -0
  672. package/dist/server/tools/close-reply.mjs +138 -0
  673. package/dist/server/tools/comment.d.mts +6 -0
  674. package/dist/server/tools/comment.mjs +49 -0
  675. package/dist/server/tools/context.d.mts +67 -0
  676. package/dist/server/tools/context.mjs +66 -0
  677. package/dist/server/tools/describe.d.mts +18 -0
  678. package/dist/server/tools/describe.mjs +35 -0
  679. package/dist/server/tools/feedback.d.mts +7 -0
  680. package/dist/server/tools/feedback.mjs +142 -0
  681. package/dist/server/tools/place-frame.d.mts +6 -0
  682. package/dist/server/tools/place-frame.mjs +104 -0
  683. package/dist/server/tools/prototype-name.d.mts +12 -0
  684. package/dist/server/tools/prototype-name.mjs +20 -0
  685. package/dist/server/tools/reading.d.mts +10 -0
  686. package/dist/server/tools/reading.mjs +152 -0
  687. package/dist/server/tools/result.d.mts +16 -0
  688. package/dist/server/tools/result.mjs +35 -0
  689. package/dist/server/tools/show.d.mts +7 -0
  690. package/dist/server/tools/show.mjs +87 -0
  691. package/dist/server/tools/snapshot.d.mts +10 -0
  692. package/dist/server/tools/snapshot.mjs +72 -0
  693. package/dist/server/tools/thread-list.d.mts +6 -0
  694. package/dist/server/tools/thread-list.mjs +105 -0
  695. package/dist/server/tools/watch.d.mts +6 -0
  696. package/dist/server/tools/watch.mjs +286 -0
  697. package/dist/server/unresolved-imports.d.mts +5 -0
  698. package/dist/server/unresolved-imports.mjs +82 -0
  699. package/dist/server/update-branch.d.mts +14 -0
  700. package/dist/server/update-branch.mjs +153 -0
  701. package/dist/server/update-studio.d.mts +38 -0
  702. package/dist/server/update-studio.mjs +101 -0
  703. package/dist/server/updates.d.mts +81 -0
  704. package/dist/server/updates.mjs +187 -0
  705. package/dist/server/vite.d.mts +115 -0
  706. package/dist/server/vite.mjs +751 -0
  707. package/dist/server/web-app.d.mts +24 -0
  708. package/dist/server/web-app.mjs +182 -0
  709. package/dist/server/welcome.d.mts +7 -0
  710. package/dist/server/welcome.mjs +43 -0
  711. package/dist/server/work-groups.d.mts +50 -0
  712. package/dist/server/work-groups.mjs +247 -0
  713. package/dist/server/workspace-settings.d.mts +55 -0
  714. package/dist/server/workspace-settings.mjs +340 -0
  715. package/dist/server/zip.d.mts +29 -0
  716. package/dist/server/zip.mjs +124 -0
  717. package/dist/setup/apply.d.mts +76 -0
  718. package/dist/setup/apply.mjs +458 -0
  719. package/dist/setup/commit-lint.d.mts +71 -0
  720. package/dist/setup/commit-lint.mjs +286 -0
  721. package/dist/setup/components.d.mts +27 -0
  722. package/dist/setup/components.mjs +67 -0
  723. package/dist/setup/config-choices.d.mts +14 -0
  724. package/dist/setup/config-choices.mjs +32 -0
  725. package/dist/setup/config-source.d.mts +58 -0
  726. package/dist/setup/config-source.mjs +384 -0
  727. package/dist/setup/create.d.mts +50 -0
  728. package/dist/setup/create.mjs +1015 -0
  729. package/dist/setup/design-md-setup.d.mts +91 -0
  730. package/dist/setup/design-md-setup.mjs +164 -0
  731. package/dist/setup/design-md.d.mts +144 -0
  732. package/dist/setup/design-md.mjs +773 -0
  733. package/dist/setup/design-system-checks.d.mts +39 -0
  734. package/dist/setup/design-system-checks.mjs +264 -0
  735. package/dist/setup/design-system-guide.d.mts +10 -0
  736. package/dist/setup/design-system-guide.mjs +41 -0
  737. package/dist/setup/desktop-app-script.d.mts +28 -0
  738. package/dist/setup/desktop-app-script.mjs +774 -0
  739. package/dist/setup/desktop-app-start.d.mts +59 -0
  740. package/dist/setup/desktop-app-start.mjs +114 -0
  741. package/dist/setup/desktop-app.d.mts +166 -0
  742. package/dist/setup/desktop-app.mjs +535 -0
  743. package/dist/setup/detect/workspace.d.mts +207 -0
  744. package/dist/setup/detect/workspace.mjs +747 -0
  745. package/dist/setup/detect.d.mts +90 -0
  746. package/dist/setup/detect.mjs +394 -0
  747. package/dist/setup/doctor.d.mts +48 -0
  748. package/dist/setup/doctor.mjs +288 -0
  749. package/dist/setup/existing-setup.d.mts +58 -0
  750. package/dist/setup/existing-setup.mjs +322 -0
  751. package/dist/setup/findings.d.mts +16 -0
  752. package/dist/setup/findings.mjs +9 -0
  753. package/dist/setup/git-checks.d.mts +41 -0
  754. package/dist/setup/git-checks.mjs +247 -0
  755. package/dist/setup/hints.d.mts +20 -0
  756. package/dist/setup/hints.mjs +171 -0
  757. package/dist/setup/host-format.d.mts +13 -0
  758. package/dist/setup/host-format.mjs +89 -0
  759. package/dist/setup/migrate/agent-files.d.mts +23 -0
  760. package/dist/setup/migrate/agent-files.mjs +112 -0
  761. package/dist/setup/migrate/config-name.d.mts +21 -0
  762. package/dist/setup/migrate/config-name.mjs +68 -0
  763. package/dist/setup/migrate/design-system.d.mts +62 -0
  764. package/dist/setup/migrate/design-system.mjs +484 -0
  765. package/dist/setup/migrate/explorations.d.mts +5 -0
  766. package/dist/setup/migrate/explorations.mjs +31 -0
  767. package/dist/setup/migrate/files-folder.d.mts +43 -0
  768. package/dist/setup/migrate/files-folder.mjs +293 -0
  769. package/dist/setup/migrate/guides.d.mts +5 -0
  770. package/dist/setup/migrate/guides.mjs +55 -0
  771. package/dist/setup/migrate/migration.d.mts +67 -0
  772. package/dist/setup/migrate/migration.mjs +7 -0
  773. package/dist/setup/migrate/migrations.d.mts +22 -0
  774. package/dist/setup/migrate/migrations.mjs +52 -0
  775. package/dist/setup/migrate/people-folders.d.mts +26 -0
  776. package/dist/setup/migrate/people-folders.mjs +206 -0
  777. package/dist/setup/migrate/project-files.d.mts +5 -0
  778. package/dist/setup/migrate/project-files.mjs +28 -0
  779. package/dist/setup/migrate/row-titles.d.mts +5 -0
  780. package/dist/setup/migrate/row-titles.mjs +35 -0
  781. package/dist/setup/migrate/studio-state.d.mts +22 -0
  782. package/dist/setup/migrate/studio-state.mjs +130 -0
  783. package/dist/setup/own-app.d.mts +68 -0
  784. package/dist/setup/own-app.mjs +258 -0
  785. package/dist/setup/placement.d.mts +32 -0
  786. package/dist/setup/placement.mjs +249 -0
  787. package/dist/setup/plan.d.mts +159 -0
  788. package/dist/setup/plan.mjs +413 -0
  789. package/dist/setup/project.d.mts +140 -0
  790. package/dist/setup/project.mjs +255 -0
  791. package/dist/setup/prompts.d.mts +78 -0
  792. package/dist/setup/prompts.mjs +753 -0
  793. package/dist/setup/provider.d.mts +19 -0
  794. package/dist/setup/provider.mjs +118 -0
  795. package/dist/setup/questions.d.mts +148 -0
  796. package/dist/setup/questions.mjs +217 -0
  797. package/dist/setup/starters.d.mts +68 -0
  798. package/dist/setup/starters.mjs +177 -0
  799. package/dist/setup/templates.d.mts +75 -0
  800. package/dist/setup/templates.mjs +148 -0
  801. package/dist/setup/workspace-setup.d.mts +37 -0
  802. package/dist/setup/workspace-setup.mjs +157 -0
  803. package/dist/setup/write.d.mts +127 -0
  804. package/dist/setup/write.mjs +231 -0
  805. package/dist/shared/agent-prompts.d.mts +10 -0
  806. package/dist/shared/agent-prompts.mjs +11 -0
  807. package/dist/shared/annotations-core.d.mts +158 -0
  808. package/dist/shared/annotations-core.mjs +263 -0
  809. package/dist/shared/avatar-file.d.mts +11 -0
  810. package/dist/shared/avatar-file.mjs +12 -0
  811. package/dist/shared/block-merge.d.mts +28 -0
  812. package/dist/shared/block-merge.mjs +176 -0
  813. package/dist/shared/build-settings.d.mts +13 -0
  814. package/dist/shared/build-settings.mjs +9 -0
  815. package/dist/shared/built-pictures.d.mts +29 -0
  816. package/dist/shared/built-pictures.mjs +34 -0
  817. package/dist/shared/canvas-core.d.mts +478 -0
  818. package/dist/shared/canvas-core.mjs +859 -0
  819. package/dist/shared/checks.d.mts +8 -0
  820. package/dist/shared/checks.mjs +9 -0
  821. package/dist/shared/commands-core.d.mts +117 -0
  822. package/dist/shared/commands-core.mjs +90 -0
  823. package/dist/shared/contributors-merge.d.mts +8 -0
  824. package/dist/shared/contributors-merge.mjs +54 -0
  825. package/dist/shared/design-system.d.mts +89 -0
  826. package/dist/shared/design-system.mjs +1 -0
  827. package/dist/shared/devices.d.mts +59 -0
  828. package/dist/shared/devices.mjs +172 -0
  829. package/dist/shared/element-steps.d.mts +38 -0
  830. package/dist/shared/element-steps.mjs +40 -0
  831. package/dist/shared/feedback.d.mts +79 -0
  832. package/dist/shared/feedback.mjs +192 -0
  833. package/dist/shared/file-errors.d.mts +25 -0
  834. package/dist/shared/file-errors.mjs +25 -0
  835. package/dist/shared/fix-prompt.d.mts +30 -0
  836. package/dist/shared/fix-prompt.mjs +43 -0
  837. package/dist/shared/frame-grids.d.mts +43 -0
  838. package/dist/shared/frame-grids.mjs +107 -0
  839. package/dist/shared/front-matter.d.mts +37 -0
  840. package/dist/shared/front-matter.mjs +74 -0
  841. package/dist/shared/generated-sections.d.mts +29 -0
  842. package/dist/shared/generated-sections.mjs +117 -0
  843. package/dist/shared/git-core.d.mts +207 -0
  844. package/dist/shared/git-core.mjs +122 -0
  845. package/dist/shared/json-style.d.mts +11 -0
  846. package/dist/shared/json-style.mjs +50 -0
  847. package/dist/shared/listing.d.mts +4 -0
  848. package/dist/shared/listing.mjs +10 -0
  849. package/dist/shared/live-core.d.mts +59 -0
  850. package/dist/shared/live-core.mjs +157 -0
  851. package/dist/shared/live-presence.d.mts +75 -0
  852. package/dist/shared/live-presence.mjs +128 -0
  853. package/dist/shared/markup-prompt.d.mts +17 -0
  854. package/dist/shared/markup-prompt.mjs +56 -0
  855. package/dist/shared/open-page-core.d.mts +38 -0
  856. package/dist/shared/open-page-core.mjs +39 -0
  857. package/dist/shared/page-messages.d.mts +68 -0
  858. package/dist/shared/page-messages.mjs +66 -0
  859. package/dist/shared/page-review.d.mts +100 -0
  860. package/dist/shared/page-review.mjs +138 -0
  861. package/dist/shared/paste-arrangement.d.mts +20 -0
  862. package/dist/shared/paste-arrangement.mjs +31 -0
  863. package/dist/shared/pasted-image.d.mts +16 -0
  864. package/dist/shared/pasted-image.mjs +11 -0
  865. package/dist/shared/people-core.d.mts +158 -0
  866. package/dist/shared/people-core.mjs +469 -0
  867. package/dist/shared/presence-core.d.mts +22 -0
  868. package/dist/shared/presence-core.mjs +7 -0
  869. package/dist/shared/product.d.mts +3 -0
  870. package/dist/shared/product.mjs +4 -0
  871. package/dist/shared/prototypes-core.d.mts +168 -0
  872. package/dist/shared/prototypes-core.mjs +270 -0
  873. package/dist/shared/references-core.d.mts +30 -0
  874. package/dist/shared/references-core.mjs +46 -0
  875. package/dist/shared/removed-views-core.d.mts +101 -0
  876. package/dist/shared/removed-views-core.mjs +115 -0
  877. package/dist/shared/review-file.d.mts +101 -0
  878. package/dist/shared/review-file.mjs +97 -0
  879. package/dist/shared/server-page.d.mts +74 -0
  880. package/dist/shared/server-page.mjs +300 -0
  881. package/dist/shared/signup.d.mts +42 -0
  882. package/dist/shared/signup.mjs +97 -0
  883. package/dist/shared/sketch-core.d.mts +61 -0
  884. package/dist/shared/sketch-core.mjs +329 -0
  885. package/dist/shared/snapshot-clipboard.d.mts +90 -0
  886. package/dist/shared/snapshot-clipboard.mjs +50 -0
  887. package/dist/shared/snapshot-images.d.mts +23 -0
  888. package/dist/shared/snapshot-images.mjs +80 -0
  889. package/dist/shared/spec-quote.d.mts +25 -0
  890. package/dist/shared/spec-quote.mjs +100 -0
  891. package/dist/shared/studio-events.d.mts +136 -0
  892. package/dist/shared/studio-events.mjs +95 -0
  893. package/dist/shared/studio-files.d.mts +50 -0
  894. package/dist/shared/studio-files.mjs +58 -0
  895. package/dist/shared/studio-routes.d.mts +844 -0
  896. package/dist/shared/studio-routes.mjs +137 -0
  897. package/dist/shared/threads-core.d.mts +455 -0
  898. package/dist/shared/threads-core.mjs +678 -0
  899. package/dist/shared/unzip.d.mts +9 -0
  900. package/dist/shared/unzip.mjs +56 -0
  901. package/dist/shared/update-core.d.mts +111 -0
  902. package/dist/shared/update-core.mjs +21 -0
  903. package/dist/shared/word-diff.d.mts +33 -0
  904. package/dist/shared/word-diff.mjs +118 -0
  905. package/dist/shared/workspace.d.mts +26 -0
  906. package/dist/shared/workspace.mjs +17 -0
  907. package/extension/dist/background.js +1 -0
  908. package/extension/dist/feedback.html +19 -0
  909. package/extension/dist/feedback.js +699 -0
  910. package/extension/dist/icons/128.png +0 -0
  911. package/extension/dist/icons/16.png +0 -0
  912. package/extension/dist/icons/32.png +0 -0
  913. package/extension/dist/icons/48.png +0 -0
  914. package/extension/dist/inter.woff2 +0 -0
  915. package/extension/dist/manifest.json +54 -0
  916. package/extension/dist/offscreen.html +9 -0
  917. package/extension/dist/offscreen.js +1 -0
  918. package/extension/dist/picker.js +678 -0
  919. package/package.json +190 -4
  920. package/src/cli/banner.ts +374 -0
  921. package/src/cli/command.ts +87 -0
  922. package/src/cli/commands/agents/add.ts +31 -0
  923. package/src/cli/commands/agents.ts +13 -0
  924. package/src/cli/commands/app.ts +128 -0
  925. package/src/cli/commands/build.ts +33 -0
  926. package/src/cli/commands/claude.ts +65 -0
  927. package/src/cli/commands/cloud/args.ts +19 -0
  928. package/src/cli/commands/cloud/link.ts +19 -0
  929. package/src/cli/commands/cloud/live.ts +26 -0
  930. package/src/cli/commands/cloud/login.ts +14 -0
  931. package/src/cli/commands/cloud/publish.ts +63 -0
  932. package/src/cli/commands/cloud/push.ts +16 -0
  933. package/src/cli/commands/cloud/status.ts +17 -0
  934. package/src/cli/commands/cloud/unlink.ts +17 -0
  935. package/src/cli/commands/cloud.ts +20 -0
  936. package/src/cli/commands/components.ts +25 -0
  937. package/src/cli/commands/create.ts +191 -0
  938. package/src/cli/commands/dev.ts +231 -0
  939. package/src/cli/commands/doctor.ts +34 -0
  940. package/src/cli/commands/extension.ts +33 -0
  941. package/src/cli/commands/hook.ts +99 -0
  942. package/src/cli/commands/init.ts +24 -0
  943. package/src/cli/commands/mcp.ts +58 -0
  944. package/src/cli/commands/merge-contributors.ts +39 -0
  945. package/src/cli/commands/merge-spec.ts +54 -0
  946. package/src/cli/commands/preview.ts +18 -0
  947. package/src/cli/commands/stop.ts +27 -0
  948. package/src/cli/commands/upgrade.ts +76 -0
  949. package/src/cli/commands/work/args.ts +38 -0
  950. package/src/cli/commands/work/check.ts +21 -0
  951. package/src/cli/commands/work/contributor.ts +34 -0
  952. package/src/cli/commands/work/new.ts +28 -0
  953. package/src/cli/commands/work/presence.ts +37 -0
  954. package/src/cli/commands/work/scope.ts +23 -0
  955. package/src/cli/commands/work/snapshot.ts +27 -0
  956. package/src/cli/commands/work/thread.ts +40 -0
  957. package/src/cli/commands/work/threads.ts +20 -0
  958. package/src/cli/commands/work/whoami.ts +12 -0
  959. package/src/cli/help.ts +213 -0
  960. package/src/cli/main.ts +140 -0
  961. package/src/cli/mcp-relay.ts +538 -0
  962. package/src/cli/recovery-server.ts +123 -0
  963. package/src/cli/strict-flags.ts +208 -0
  964. package/src/cli/supervise.ts +416 -0
  965. package/src/cli/ui.ts +402 -0
  966. package/src/config/design-system.ts +349 -0
  967. package/src/config/index.ts +289 -0
  968. package/src/config/load.ts +201 -0
  969. package/src/config/package-manager.ts +93 -0
  970. package/src/config/project-files.ts +851 -0
  971. package/src/config/renamed.ts +59 -0
  972. package/src/config/schema.ts +194 -0
  973. package/src/content/biome.ts +51 -0
  974. package/src/content/capture.ts +1114 -0
  975. package/src/content/commands.ts +288 -0
  976. package/src/content/comments-log.ts +288 -0
  977. package/src/content/component-props.ts +642 -0
  978. package/src/content/content.ts +2467 -0
  979. package/src/content/devices.ts +63 -0
  980. package/src/content/file-turns.ts +60 -0
  981. package/src/content/first-run.ts +62 -0
  982. package/src/content/flow-specs.ts +267 -0
  983. package/src/content/insert-edit.ts +225 -0
  984. package/src/content/jsx-source.ts +54 -0
  985. package/src/content/last-edited.ts +58 -0
  986. package/src/content/layout.ts +32 -0
  987. package/src/content/merge-rules.ts +77 -0
  988. package/src/content/prop-edit.ts +262 -0
  989. package/src/content/prototype-checks.ts +239 -0
  990. package/src/content/prototype-summary.ts +216 -0
  991. package/src/content/prototypes.ts +413 -0
  992. package/src/content/read-text.ts +12 -0
  993. package/src/content/review-import.ts +77 -0
  994. package/src/content/review-pages.ts +329 -0
  995. package/src/content/screenshot.ts +457 -0
  996. package/src/content/snapshot-client.ts +99 -0
  997. package/src/content/store.ts +237 -0
  998. package/src/content/text-edit.ts +134 -0
  999. package/src/content/thread-module.ts +368 -0
  1000. package/src/content/threads.ts +328 -0
  1001. package/src/content/trash.ts +350 -0
  1002. package/src/paste/figma/appearance.ts +253 -0
  1003. package/src/paste/figma/captures.ts +175 -0
  1004. package/src/paste/figma/decode.ts +604 -0
  1005. package/src/paste/figma/document.ts +541 -0
  1006. package/src/paste/figma/layout.ts +233 -0
  1007. package/src/paste/figma/paint.ts +327 -0
  1008. package/src/paste/figma/render.ts +149 -0
  1009. package/src/paste/figma/styles.ts +119 -0
  1010. package/src/paste/figma/text.ts +439 -0
  1011. package/src/paste/figma/vector.ts +405 -0
  1012. package/src/paste/fonts.ts +119 -0
  1013. package/src/paste/paste.ts +202 -0
  1014. package/src/paths.ts +208 -0
  1015. package/src/server/agent-env.ts +60 -0
  1016. package/src/server/agent-session.ts +209 -0
  1017. package/src/server/agents.ts +1220 -0
  1018. package/src/server/allowed-request.ts +95 -0
  1019. package/src/server/avatars.ts +87 -0
  1020. package/src/server/brief.ts +511 -0
  1021. package/src/server/briefing.ts +235 -0
  1022. package/src/server/build-pictures.ts +302 -0
  1023. package/src/server/build-settings.ts +47 -0
  1024. package/src/server/changelog.ts +59 -0
  1025. package/src/server/channel.ts +1119 -0
  1026. package/src/server/claimed-presence.ts +77 -0
  1027. package/src/server/close-check.ts +218 -0
  1028. package/src/server/cloud.ts +404 -0
  1029. package/src/server/command-settings.ts +100 -0
  1030. package/src/server/component-catalogue.ts +294 -0
  1031. package/src/server/config-settings.ts +63 -0
  1032. package/src/server/content-type.ts +25 -0
  1033. package/src/server/dependency-clash.ts +345 -0
  1034. package/src/server/dev-server.ts +356 -0
  1035. package/src/server/features.ts +58 -0
  1036. package/src/server/file-errors.ts +201 -0
  1037. package/src/server/file-lock.ts +114 -0
  1038. package/src/server/git-asks.ts +91 -0
  1039. package/src/server/git-host.ts +263 -0
  1040. package/src/server/git-paused.ts +204 -0
  1041. package/src/server/git-settings.ts +88 -0
  1042. package/src/server/git-sync.ts +729 -0
  1043. package/src/server/git.ts +991 -0
  1044. package/src/server/instructions.ts +124 -0
  1045. package/src/server/live-mirror.ts +483 -0
  1046. package/src/server/live.ts +275 -0
  1047. package/src/server/machine-update.ts +780 -0
  1048. package/src/server/mcp-handover.ts +147 -0
  1049. package/src/server/mcp.ts +294 -0
  1050. package/src/server/me.ts +68 -0
  1051. package/src/server/next.ts +135 -0
  1052. package/src/server/notices.ts +580 -0
  1053. package/src/server/open-page.ts +192 -0
  1054. package/src/server/own-copies.ts +419 -0
  1055. package/src/server/people.ts +98 -0
  1056. package/src/server/personal-folder.ts +34 -0
  1057. package/src/server/pictures.ts +365 -0
  1058. package/src/server/port.ts +178 -0
  1059. package/src/server/preferences.ts +34 -0
  1060. package/src/server/presence.ts +175 -0
  1061. package/src/server/project-id.ts +17 -0
  1062. package/src/server/project-public.ts +73 -0
  1063. package/src/server/prototype-brief.ts +208 -0
  1064. package/src/server/push-notice.ts +69 -0
  1065. package/src/server/quiet-run.ts +85 -0
  1066. package/src/server/registry.ts +161 -0
  1067. package/src/server/requests.ts +2387 -0
  1068. package/src/server/response-budget.ts +109 -0
  1069. package/src/server/restart.ts +187 -0
  1070. package/src/server/roster.ts +302 -0
  1071. package/src/server/saved.ts +77 -0
  1072. package/src/server/source-stamp.ts +194 -0
  1073. package/src/server/spec-decisions.ts +113 -0
  1074. package/src/server/spec-suggestions.ts +87 -0
  1075. package/src/server/state.ts +287 -0
  1076. package/src/server/stop-studio.ts +44 -0
  1077. package/src/server/studio-for.ts +161 -0
  1078. package/src/server/sync-install.ts +87 -0
  1079. package/src/server/thread-forms.ts +246 -0
  1080. package/src/server/thread-place.ts +160 -0
  1081. package/src/server/thread-source.ts +328 -0
  1082. package/src/server/tools/close-reply.ts +271 -0
  1083. package/src/server/tools/comment.ts +96 -0
  1084. package/src/server/tools/context.ts +179 -0
  1085. package/src/server/tools/describe.ts +53 -0
  1086. package/src/server/tools/feedback.ts +225 -0
  1087. package/src/server/tools/place-frame.ts +167 -0
  1088. package/src/server/tools/prototype-name.ts +50 -0
  1089. package/src/server/tools/reading.ts +271 -0
  1090. package/src/server/tools/result.ts +32 -0
  1091. package/src/server/tools/show.ts +159 -0
  1092. package/src/server/tools/snapshot.ts +114 -0
  1093. package/src/server/tools/thread-list.ts +185 -0
  1094. package/src/server/tools/watch.ts +436 -0
  1095. package/src/server/unresolved-imports.ts +103 -0
  1096. package/src/server/update-branch.ts +226 -0
  1097. package/src/server/update-studio.ts +164 -0
  1098. package/src/server/updates.ts +360 -0
  1099. package/src/server/vite.ts +1183 -0
  1100. package/src/server/web-app.ts +235 -0
  1101. package/src/server/welcome.ts +57 -0
  1102. package/src/server/work-groups.ts +373 -0
  1103. package/src/server/workspace-settings.ts +508 -0
  1104. package/src/server/zip.ts +151 -0
  1105. package/src/setup/apply.ts +796 -0
  1106. package/src/setup/commit-lint.ts +403 -0
  1107. package/src/setup/components.ts +124 -0
  1108. package/src/setup/config-choices.ts +56 -0
  1109. package/src/setup/config-source.ts +660 -0
  1110. package/src/setup/create.ts +1737 -0
  1111. package/src/setup/design-md-setup.ts +319 -0
  1112. package/src/setup/design-md.ts +1293 -0
  1113. package/src/setup/design-system-checks.ts +487 -0
  1114. package/src/setup/design-system-guide.ts +106 -0
  1115. package/src/setup/desktop-app-script.ts +814 -0
  1116. package/src/setup/desktop-app-start.ts +152 -0
  1117. package/src/setup/desktop-app.ts +828 -0
  1118. package/src/setup/detect/workspace.ts +1487 -0
  1119. package/src/setup/detect.ts +598 -0
  1120. package/src/setup/doctor.ts +526 -0
  1121. package/src/setup/existing-setup.ts +565 -0
  1122. package/src/setup/findings.ts +27 -0
  1123. package/src/setup/git-checks.ts +434 -0
  1124. package/src/setup/hints.ts +308 -0
  1125. package/src/setup/host-format.ts +153 -0
  1126. package/src/setup/migrate/agent-files.ts +161 -0
  1127. package/src/setup/migrate/config-name.ts +109 -0
  1128. package/src/setup/migrate/design-system.ts +888 -0
  1129. package/src/setup/migrate/explorations.ts +49 -0
  1130. package/src/setup/migrate/files-folder.ts +470 -0
  1131. package/src/setup/migrate/guides.ts +93 -0
  1132. package/src/setup/migrate/migration.ts +80 -0
  1133. package/src/setup/migrate/migrations.ts +82 -0
  1134. package/src/setup/migrate/people-folders.ts +347 -0
  1135. package/src/setup/migrate/project-files.ts +35 -0
  1136. package/src/setup/migrate/row-titles.ts +56 -0
  1137. package/src/setup/migrate/studio-state.ts +186 -0
  1138. package/src/setup/own-app.ts +439 -0
  1139. package/src/setup/placement.ts +408 -0
  1140. package/src/setup/plan.ts +792 -0
  1141. package/src/setup/project.ts +518 -0
  1142. package/src/setup/prompts.ts +1189 -0
  1143. package/src/setup/provider.ts +180 -0
  1144. package/src/setup/questions.ts +424 -0
  1145. package/src/setup/starters.ts +290 -0
  1146. package/src/setup/templates.ts +280 -0
  1147. package/src/setup/workspace-setup.ts +257 -0
  1148. package/src/setup/write.ts +380 -0
  1149. package/src/shared/agent-prompts.ts +14 -0
  1150. package/src/shared/annotations-core.ts +478 -0
  1151. package/src/shared/avatar-file.ts +22 -0
  1152. package/src/shared/block-merge.ts +271 -0
  1153. package/src/shared/build-settings.ts +22 -0
  1154. package/src/shared/built-pictures.ts +62 -0
  1155. package/src/shared/canvas-core.ts +1408 -0
  1156. package/src/shared/checks.ts +16 -0
  1157. package/src/shared/commands-core.ts +237 -0
  1158. package/src/shared/contributors-merge.ts +93 -0
  1159. package/src/shared/design-system.ts +136 -0
  1160. package/src/shared/devices.ts +292 -0
  1161. package/src/shared/element-steps.ts +99 -0
  1162. package/src/shared/feedback.ts +284 -0
  1163. package/src/shared/file-errors.ts +57 -0
  1164. package/src/shared/fix-prompt.ts +85 -0
  1165. package/src/shared/frame-grids.ts +182 -0
  1166. package/src/shared/front-matter.ts +119 -0
  1167. package/src/shared/generated-sections.ts +185 -0
  1168. package/src/shared/git-core.ts +398 -0
  1169. package/src/shared/json-style.ts +74 -0
  1170. package/src/shared/listing.ts +13 -0
  1171. package/src/shared/live-core.ts +255 -0
  1172. package/src/shared/live-presence.ts +217 -0
  1173. package/src/shared/markup-prompt.ts +69 -0
  1174. package/src/shared/open-page-core.ts +89 -0
  1175. package/src/shared/page-messages.ts +156 -0
  1176. package/src/shared/page-review.ts +287 -0
  1177. package/src/shared/paste-arrangement.ts +52 -0
  1178. package/src/shared/pasted-image.ts +23 -0
  1179. package/src/shared/people-core.ts +826 -0
  1180. package/src/shared/presence-core.ts +30 -0
  1181. package/src/shared/product.ts +4 -0
  1182. package/src/shared/prototypes-core.ts +450 -0
  1183. package/src/shared/references-core.ts +89 -0
  1184. package/src/shared/removed-views-core.ts +223 -0
  1185. package/src/shared/review-file.ts +216 -0
  1186. package/src/shared/server-page.ts +393 -0
  1187. package/src/shared/signup.ts +103 -0
  1188. package/src/shared/sketch-core.ts +425 -0
  1189. package/src/shared/snapshot-clipboard.ts +139 -0
  1190. package/src/shared/snapshot-images.ts +130 -0
  1191. package/src/shared/spec-quote.ts +153 -0
  1192. package/src/shared/studio-events.ts +215 -0
  1193. package/src/shared/studio-files.ts +131 -0
  1194. package/src/shared/studio-routes.ts +684 -0
  1195. package/src/shared/threads-core.ts +1485 -0
  1196. package/src/shared/unzip.ts +95 -0
  1197. package/src/shared/update-core.ts +126 -0
  1198. package/src/shared/word-diff.ts +163 -0
  1199. package/src/shared/workspace.ts +38 -0
  1200. package/templates/DESIGN.md +0 -0
  1201. package/templates/context/.gitkeep +0 -0
  1202. package/templates/feedback-workflow.md +1 -0
  1203. package/templates/mcp-instructions.md +1 -0
  1204. package/templates/methods/component-examples.md +75 -0
  1205. package/templates/methods/components.md +78 -0
  1206. package/templates/methods/critique.md +54 -0
  1207. package/templates/methods/design-md.md +92 -0
  1208. package/templates/methods/explore.md +101 -0
  1209. package/templates/methods/handoff.md +40 -0
  1210. package/templates/methods/hifi.md +24 -0
  1211. package/templates/methods/review.md +156 -0
  1212. package/templates/rules/always.md +38 -0
  1213. package/templates/rules/canvas-frames.md +104 -0
  1214. package/templates/rules/canvas.md +173 -0
  1215. package/templates/rules/commands.md +30 -0
  1216. package/templates/rules/prototypes.md +171 -0
  1217. package/templates/rules/scope.md +41 -0
  1218. package/templates/rules/snapshots.md +52 -0
  1219. package/templates/rules/studio.md +89 -0
  1220. package/templates/skills/break/SKILL.md +16 -0
  1221. package/templates/skills/connect-frames/SKILL.md +9 -0
  1222. package/templates/skills/duplicate-and-refine/SKILL.md +9 -0
  1223. package/templates/skills/polish-responsive/SKILL.md +9 -0
  1224. package/templates/skills/remember-as-guideline/SKILL.md +9 -0
  1225. package/templates/skills/remove/SKILL.md +8 -0
  1226. package/templates/skills/tighten-copy/SKILL.md +8 -0
  1227. package/templates/skills/use-design-system/SKILL.md +10 -0
  1228. package/templates/starter-prototype/welcome.tsx +47 -0
  1229. package/templates/starters/standalone/README.md +21 -0
  1230. package/templates/starters/standalone/components.json +25 -0
  1231. package/templates/starters/standalone/gitignore +4 -0
  1232. package/templates/starters/standalone/package.json +23 -0
  1233. package/templates/starters/standalone/tsconfig.json +14 -0
  1234. package/templates/starters/turborepo/README.md +22 -0
  1235. package/templates/starters/turborepo/apps/web/components.json +25 -0
  1236. package/templates/starters/turborepo/apps/web/index.html +12 -0
  1237. package/templates/starters/turborepo/apps/web/package.json +27 -0
  1238. package/templates/starters/turborepo/apps/web/src/app.tsx +43 -0
  1239. package/templates/starters/turborepo/apps/web/src/index.css +5 -0
  1240. package/templates/starters/turborepo/apps/web/src/main.tsx +13 -0
  1241. package/templates/starters/turborepo/apps/web/tsconfig.json +11 -0
  1242. package/templates/starters/turborepo/apps/web/vite.config.ts +11 -0
  1243. package/templates/starters/turborepo/gitignore +5 -0
  1244. package/templates/starters/turborepo/package.json +19 -0
  1245. package/templates/starters/turborepo/packages/ui/components.json +25 -0
  1246. package/templates/starters/turborepo/packages/ui/package.json +32 -0
  1247. package/templates/starters/turborepo/packages/ui/src/hooks/.gitkeep +0 -0
  1248. package/templates/starters/turborepo/packages/ui/tsconfig.json +7 -0
  1249. package/templates/starters/turborepo/tsconfig.json +14 -0
  1250. package/templates/starters/turborepo/turbo.json +19 -0
  1251. package/templates/starters/vite/README.md +19 -0
  1252. package/templates/starters/vite/components.json +25 -0
  1253. package/templates/starters/vite/gitignore +4 -0
  1254. package/templates/starters/vite/index.html +12 -0
  1255. package/templates/starters/vite/package.json +31 -0
  1256. package/templates/starters/vite/src/app.tsx +42 -0
  1257. package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
  1258. package/templates/starters/vite/src/components/ui/attachment.tsx +207 -0
  1259. package/templates/starters/vite/src/components/ui/badge.tsx +51 -0
  1260. package/templates/starters/vite/src/components/ui/button.tsx +62 -0
  1261. package/templates/starters/vite/src/components/ui/card.tsx +102 -0
  1262. package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
  1263. package/templates/starters/vite/src/components/ui/dialog.tsx +157 -0
  1264. package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +267 -0
  1265. package/templates/starters/vite/src/components/ui/field.tsx +238 -0
  1266. package/templates/starters/vite/src/components/ui/input-group.tsx +158 -0
  1267. package/templates/starters/vite/src/components/ui/input.tsx +19 -0
  1268. package/templates/starters/vite/src/components/ui/label.tsx +19 -0
  1269. package/templates/starters/vite/src/components/ui/native-select.tsx +60 -0
  1270. package/templates/starters/vite/src/components/ui/popover.tsx +89 -0
  1271. package/templates/starters/vite/src/components/ui/separator.tsx +24 -0
  1272. package/templates/starters/vite/src/components/ui/spinner.tsx +10 -0
  1273. package/templates/starters/vite/src/components/ui/switch.tsx +31 -0
  1274. package/templates/starters/vite/src/components/ui/textarea.tsx +17 -0
  1275. package/templates/starters/vite/src/components/ui/toggle-group.tsx +89 -0
  1276. package/templates/starters/vite/src/components/ui/toggle.tsx +44 -0
  1277. package/templates/starters/vite/src/index.css +552 -0
  1278. package/templates/starters/vite/src/lib/utils.ts +1 -0
  1279. package/templates/starters/vite/src/main.tsx +13 -0
  1280. package/templates/starters/vite/tsconfig.json +15 -0
  1281. package/templates/starters/vite/vite.config.ts +11 -0
@@ -0,0 +1,393 @@
1
+ // The page a window shows while Dex's server isn't there: starting it,
2
+ // still starting, failed to start, or stopped; or, from the supervisor
3
+ // (cli/supervise.ts), a Dex that didn't start just after it restarted. The Mac app shows it in its
4
+ // window (setup/desktop-app-script.ts) and a browser gets it from the
5
+ // service worker (server/web-app.ts). Both draw the same thing: the home
6
+ // page's shape in grey blocks, with what's happening in a card on top.
7
+ //
8
+ // Plain HTML with its own styles and script: it is shown exactly when the
9
+ // server that serves the interface is not there. Browser-safe, no Node.
10
+
11
+ import {
12
+ DESKTOP_APP_INSTALLED,
13
+ MANIFEST_FILE,
14
+ PROJECT_ID_HEADER,
15
+ } from "./studio-routes.ts";
16
+
17
+ /**
18
+ * What the page says. "browser" is stopped, in a browser that can't start
19
+ * it; "recovery", a Dex that didn't start just after a restart, which
20
+ * the supervisor offers to start again or take back to the last version
21
+ * that worked.
22
+ */
23
+ export type ServerPageState =
24
+ | "starting"
25
+ | "slow"
26
+ | "failed"
27
+ | "stopped"
28
+ | "browser"
29
+ | "recovery";
30
+
31
+ /** Where the supervisor says how a restart goes; POST starts it again. */
32
+ export const RESTART_PATH = "/__studio/restart";
33
+ /** POST: go back to the last version that worked, then start it. */
34
+ export const GO_BACK_PATH = "/__studio/go-back";
35
+
36
+ /**
37
+ * In place of a state: the Mac app makes its page once, with this where
38
+ * the state goes, and puts in the state it needs each time it shows it.
39
+ */
40
+ export const STATE_SLOT = "dex-state-slot";
41
+
42
+ /** When starting turns into "still starting". */
43
+ export const SLOW_AFTER_MS = 15_000;
44
+ /** When a start that never answers counts as failed. */
45
+ export const GIVE_UP_AFTER_MS = 60_000;
46
+
47
+ /**
48
+ * Why a start failed, from the end of its log: the first pattern that
49
+ * matches. `{project}` is the project's folder as its owner types it.
50
+ */
51
+ export const FAILURE_CAUSES: readonly { pattern: string; cause: string }[] = [
52
+ {
53
+ pattern: "Dex needs .+ to start, and .+ is gone",
54
+ cause:
55
+ "The Node it was set up with is gone, and no other was found. Install Node, then try again.",
56
+ },
57
+ {
58
+ pattern: "ERR_MODULE_NOT_FOUND|Cannot find (package|module)",
59
+ cause:
60
+ "Its packages aren't installed in {project}. Install them, then try again.",
61
+ },
62
+ {
63
+ pattern: "EADDRINUSE",
64
+ cause: "Another program is using its port. Close it, then try again.",
65
+ },
66
+ {
67
+ pattern: "(?:dex|sudio)\\.config\\.[cm]?[jt]s",
68
+ cause: "Its config, dex.config.ts, has an error. Fix it, then try again.",
69
+ },
70
+ ];
71
+ /** A failure no pattern names. */
72
+ export const UNKNOWN_CAUSE = "It stopped with an error. Its log ends:";
73
+ /** A start that is still running but never answered. */
74
+ export const NO_ANSWER_CAUSE =
75
+ "It hasn't answered after a minute. Its log ends:";
76
+
77
+ /** Why a start failed, from the end of its log, for `project`. */
78
+ export const failureCause = (log: string, project: string): string => {
79
+ const known = FAILURE_CAUSES.find(({ pattern }) =>
80
+ new RegExp(pattern).test(log)
81
+ );
82
+ return known ? known.cause.replaceAll("{project}", project) : UNKNOWN_CAUSE;
83
+ };
84
+
85
+ /** A project's folder as its owner types it: under ~ when it is. */
86
+ export const shownPath = (
87
+ root: string,
88
+ home: string,
89
+ separator = "/"
90
+ ): string =>
91
+ root === home || root.startsWith(home + separator)
92
+ ? `~${root.slice(home.length)}`
93
+ : root;
94
+
95
+ export interface ServerPageOptions {
96
+ /**
97
+ * In the Mac app: buttons talk to it, and the page leaves room for the
98
+ * window's buttons. In a browser: the command to run instead.
99
+ */
100
+ inApp: boolean;
101
+ /** The localStorage key that says the app is installed (DESKTOP_APP_KEY). */
102
+ installedKey?: string;
103
+ /** "Dex", or the workspace's title. */
104
+ name: string;
105
+ /** The project's folder as its owner types it, under ~ when it is. */
106
+ project: string;
107
+ /**
108
+ * In the app, the project whose Dex to open, as projectId names it:
109
+ * whatever else answers on the port is never opened.
110
+ */
111
+ projectId?: string;
112
+ /** In a browser, the app's start link when this Mac has the app. */
113
+ startLink?: string;
114
+ /** What the page says first, or STATE_SLOT for the app to fill in. */
115
+ state: ServerPageState | typeof STATE_SLOT;
116
+ /**
117
+ * Served by the supervisor: the page asks it how the restart goes
118
+ * (RESTART_PATH), and offers Try again and Go back when it failed.
119
+ */
120
+ supervised?: boolean;
121
+ /** In the app, where to go once the server answers. */
122
+ url?: string;
123
+ /**
124
+ * The Dex that made the page. A browser keeps it until a Dex on the
125
+ * same port serves a newer one, so it says which made it.
126
+ */
127
+ version: string;
128
+ }
129
+
130
+ const escapeHtml = (text: string): string =>
131
+ text
132
+ .replaceAll("&", "&")
133
+ .replaceAll("<", "&lt;")
134
+ .replaceAll(">", "&gt;")
135
+ .replaceAll('"', "&quot;");
136
+
137
+ // Within a <script>: no "</" ends it early.
138
+ const scriptJson = (value: unknown): string =>
139
+ JSON.stringify(value).replaceAll("</", "<\\/");
140
+
141
+ const STYLE = `
142
+ :root { color-scheme: light dark; --bg: #fff; --fg: #0a0a0a; --muted: #737373; --line: #e5e5e5; --block: rgb(10 10 10 / 0.055); --side: #fafafa; --card: #fff; --code: #f5f5f5; --button: #171717; --button-fg: #fafafa; --bad: #dc2626; }
143
+ @media (prefers-color-scheme: dark) { :root { --bg: #0a0a0a; --fg: #fafafa; --muted: #a1a1a1; --line: rgb(255 255 255 / 0.1); --block: rgb(255 255 255 / 0.06); --side: #111; --card: #171717; --code: #0a0a0a; --button: #fafafa; --button-fg: #171717; --bad: #f87171; } }
144
+ * { box-sizing: border-box; }
145
+ body { margin: 0; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
146
+ #page, .shape { height: 100%; }
147
+ .shape { display: flex; }
148
+ .block { display: block; border-radius: 6px; background: var(--block); }
149
+ aside { width: 15rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; padding: 6px 14px 0; background: var(--side); border-right: 1px solid var(--line); }
150
+ .in-app aside { padding-top: var(--dex-titlebar-height, 45px); }
151
+ aside .head { display: flex; align-items: center; gap: 8px; height: 44px; }
152
+ aside nav { display: flex; flex-direction: column; gap: 14px; }
153
+ aside nav span { display: flex; align-items: center; gap: 10px; }
154
+ .shape main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 40px; padding: 64px 40px 0; overflow: hidden; }
155
+ .files { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 24px 20px; }
156
+ .file { display: flex; flex-direction: column; gap: 10px; }
157
+ .thumb { aspect-ratio: 16 / 10; border-radius: 10px; }
158
+ @media (max-width: 760px) { aside { display: none; } }
159
+ .over { position: fixed; inset: 0; display: grid; place-items: center; padding: 32px; background: color-mix(in srgb, var(--bg) 40%, transparent); }
160
+ .card { width: min(28rem, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.06); }
161
+ .mark { width: 36px; height: 36px; color: var(--muted); }
162
+ .starting .mark, .slow .mark { color: var(--fg); }
163
+ .failed .mark, .recovery .mark { color: var(--bad); }
164
+ .mark .cell { fill: none; stroke: currentColor; stroke-opacity: 0.35; stroke-width: 1.5; }
165
+ .mark .moving { fill: currentColor; }
166
+ .starting .mark .moving, .slow .mark .moving { animation: round 2.2s ease-in-out infinite; }
167
+ @keyframes round { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(11px, 0); } 50% { transform: translate(11px, 11px); } 75% { transform: translate(0, 11px); } }
168
+ @media (prefers-reduced-motion: reduce) { .mark .moving { animation: none !important; } }
169
+ h1 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.3; }
170
+ p { margin: 0; color: var(--muted); text-wrap: pretty; }
171
+ .words { display: flex; flex-direction: column; gap: 6px; align-items: center; }
172
+ pre, .command { width: 100%; margin: 0; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--code); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
173
+ pre { max-height: 10rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
174
+ .command { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 13px; }
175
+ .command code { display: flex; flex-direction: column; overflow-wrap: anywhere; }
176
+ .command code span::before { content: "$ "; color: var(--muted); user-select: none; }
177
+ .actions { display: flex; gap: 8px; justify-content: center; }
178
+ button, .button { font: inherit; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 8px; border: 0; cursor: default; text-decoration: none; background: var(--button); color: var(--button-fg); }
179
+ button.quiet { background: transparent; color: var(--fg); }
180
+ button.quiet:hover { background: var(--block); }
181
+ .command button { padding: 2px 6px; font-size: 12px; color: var(--muted); }
182
+ .small { font-size: 13px; }
183
+ .version { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 12px; }
184
+ [data-show] { display: none; }
185
+ .starting [data-show~=starting], .slow [data-show~=slow], .failed [data-show~=failed], .recovery [data-show~=recovery], .stopped [data-show~=stopped], .browser [data-show~=browser], .browser:not(.installed) [data-show~=command], .browser.installed [data-show~=start-link] { display: flex; }
186
+ .failed pre[data-show], .recovery pre[data-show], .browser:not(.installed) p[data-show] { display: block; }
187
+ pre[hidden] { display: none !important; }
188
+ `;
189
+
190
+ const NAV = [80, 96, 64, 80, 56];
191
+ const FILES = 12;
192
+
193
+ /** The home page's shape: no names, no pictures, nothing that may be stale. */
194
+ const SHAPE = `<div class="shape" aria-hidden="true">
195
+ <aside><div class="head"><span class="block" style="width:24px;height:24px"></span><span class="block" style="width:96px;height:12px"></span></div>
196
+ <nav>${NAV.map((width) => `<span><span class="block" style="width:16px;height:16px"></span><span class="block" style="width:${width}px;height:10px"></span></span>`).join("")}</nav></aside>
197
+ <main><div style="display:flex;flex-direction:column;gap:12px"><span class="block" style="width:192px;height:24px"></span><span class="block" style="width:320px;height:12px"></span></div>
198
+ <div class="files">${Array.from({ length: FILES }, () => `<div class="file"><span class="block thumb"></span><span class="block" style="width:66%;height:12px"></span><span class="block" style="width:33%;height:10px"></span></div>`).join("")}</div></main>
199
+ </div>`;
200
+
201
+ /** Dex's mark: four frames, the filled one moving round them while it starts. */
202
+ const MARK = `<svg class="mark" viewBox="0 0 24 24" aria-hidden="true">
203
+ <rect class="cell" x="2.75" y="2.75" width="7.5" height="7.5" rx="1.5"/><rect class="cell" x="13.75" y="2.75" width="7.5" height="7.5" rx="1.5"/>
204
+ <rect class="cell" x="2.75" y="13.75" width="7.5" height="7.5" rx="1.5"/><rect class="cell" x="13.75" y="13.75" width="7.5" height="7.5" rx="1.5"/>
205
+ <rect class="moving" x="2" y="2" width="9" height="9" rx="2.25"/></svg>`;
206
+
207
+ /**
208
+ * The page's script. In the app it asks the server every half second and
209
+ * opens Dex once it answers; while starting, it asks the app each second
210
+ * whether the start is still alive (the app calls `dexStatus.fail` with
211
+ * the log's end when it isn't); after 15s it says "still starting", after a
212
+ * minute it gives up. In a browser it asks every 2s and reloads, offering
213
+ * Start Dex when Settings installed the app. One interval only.
214
+ */
215
+ const script = (options: ServerPageOptions): string => `
216
+ const CONFIG = ${scriptJson({
217
+ inApp: options.inApp,
218
+ url: options.url ?? null,
219
+ project: options.project,
220
+ projectId: options.projectId ?? null,
221
+ manifest: MANIFEST_FILE,
222
+ projectHeader: PROJECT_ID_HEADER,
223
+ causes: FAILURE_CAUSES,
224
+ unknown: UNKNOWN_CAUSE,
225
+ noAnswer: NO_ANSWER_CAUSE,
226
+ slowAfter: SLOW_AFTER_MS,
227
+ giveUpAfter: GIVE_UP_AFTER_MS,
228
+ installedKey: options.installedKey ?? null,
229
+ installedValue: DESKTOP_APP_INSTALLED,
230
+ supervisor: options.supervised
231
+ ? { status: RESTART_PATH, goBack: GO_BACK_PATH }
232
+ : null,
233
+ })};
234
+ const page = document.getElementById("page");
235
+ let state = ${scriptJson(options.state)};
236
+ let installed = false;
237
+ let begun = Date.now();
238
+ let lastCheck = 0;
239
+ // The supervisor's page is served into the app's window too, where it
240
+ // leaves room for the window's buttons.
241
+ // An app made before Sudio was Dex listens as "sudio" until it is made again.
242
+ const handler = globalThis.webkit && globalThis.webkit.messageHandlers && (globalThis.webkit.messageHandlers.dex || globalThis.webkit.messageHandlers.sudio);
243
+ const inApp = CONFIG.inApp || Boolean(CONFIG.supervisor && handler);
244
+ const show = (next) => {
245
+ state = next;
246
+ page.className = state + (installed ? " installed" : "") + (inApp ? " in-app" : "");
247
+ };
248
+ const post = (message) => {
249
+ try { handler.postMessage(message); } catch {}
250
+ };
251
+ const causeOf = (log) => {
252
+ const known = CONFIG.causes.find((each) => new RegExp(each.pattern).test(log));
253
+ return known ? known.cause.split("{project}").join(CONFIG.project) : CONFIG.unknown;
254
+ };
255
+ globalThis.dexStatus = {
256
+ fail: (log, alive) => {
257
+ if (state !== "starting" && state !== "slow") { return; }
258
+ document.getElementById("cause").textContent = alive ? CONFIG.noAnswer : causeOf(log);
259
+ document.getElementById("log").textContent = log;
260
+ document.getElementById("log").hidden = !log;
261
+ show("failed");
262
+ },
263
+ };
264
+ const start = () => { begun = Date.now(); show("starting"); post("start"); };
265
+ for (const id of ["start", "retry"]) {
266
+ const button = document.getElementById(id);
267
+ if (button) { button.onclick = start; }
268
+ }
269
+ const copied = (id, text) => {
270
+ const button = document.getElementById(id);
271
+ if (!button) { return; }
272
+ const was = button.textContent;
273
+ button.textContent = text;
274
+ setTimeout(() => { button.textContent = was; }, 1500);
275
+ };
276
+ const copyLog = document.getElementById("copy-log");
277
+ if (copyLog) { copyLog.onclick = () => { post("copy-log"); copied("copy-log", "Copied"); }; }
278
+ // From the supervisor: how the restart goes, and what to do when it failed.
279
+ const recovered = (status) => {
280
+ if (!status || status.state === "ready") { return; }
281
+ if (status.state === "failed") {
282
+ document.getElementById("recovery-version").textContent = status.version ? "Dex " + status.version : "Dex";
283
+ document.getElementById("recovery-log").textContent = status.log.join("\\n");
284
+ document.getElementById("recovery-log").hidden = status.log.length === 0;
285
+ const back = document.getElementById("go-back");
286
+ back.hidden = !status.lastWorked;
287
+ back.textContent = "Go back to Dex " + (status.lastWorked || "");
288
+ if (state !== "recovery") { show("recovery"); }
289
+ } else if (state === "recovery") { begun = Date.now(); show("starting"); }
290
+ };
291
+ const askSupervisor = () => {
292
+ if (!CONFIG.supervisor) { return; }
293
+ fetch(CONFIG.supervisor.status, { cache: "no-store" }).then((response) => response.ok ? response.json() : null).then(recovered, () => undefined);
294
+ };
295
+ const tellSupervisor = (path) => () => {
296
+ begun = Date.now();
297
+ show("starting");
298
+ fetch(path, { method: "POST" }).then(askSupervisor, () => undefined);
299
+ };
300
+ if (CONFIG.supervisor) {
301
+ document.getElementById("try-again").onclick = tellSupervisor(CONFIG.supervisor.status);
302
+ document.getElementById("go-back").onclick = tellSupervisor(CONFIG.supervisor.goBack);
303
+ document.getElementById("copy-recovery").onclick = () => {
304
+ navigator.clipboard.writeText(document.getElementById("recovery-log").textContent).then(() => copied("copy-recovery", "Copied"), () => undefined);
305
+ };
306
+ askSupervisor();
307
+ }
308
+ const copyCommand = document.getElementById("copy-command");
309
+ if (copyCommand) {
310
+ copyCommand.onclick = () => {
311
+ navigator.clipboard.writeText(document.getElementById("command").textContent.trim()).then(() => copied("copy-command", "Copied"), () => undefined);
312
+ };
313
+ }
314
+ if (CONFIG.installedKey) {
315
+ try { installed = localStorage.getItem(CONFIG.installedKey) === CONFIG.installedValue; } catch {}
316
+ }
317
+ show(state);
318
+ // Failed before it started (the launcher found no Node): ask the app why.
319
+ if (CONFIG.inApp && state === "failed") { state = "starting"; post("check"); }
320
+ // Open the server once it answers: in the app, only this project's Dex,
321
+ // by the project its manifest names, never whatever else holds the port.
322
+ const answered = (target) =>
323
+ CONFIG.projectId
324
+ ? fetch(new URL(CONFIG.manifest, target), { cache: "no-store" }).then((response) =>
325
+ response.ok && response.headers.get(CONFIG.projectHeader) === CONFIG.projectId)
326
+ : fetch(target, { method: "HEAD", cache: "no-store" }).then((response) => response.ok);
327
+ setInterval(() => {
328
+ askSupervisor();
329
+ const target = CONFIG.url ?? location.href;
330
+ answered(target).then((ours) => {
331
+ if (!ours) { return; }
332
+ if (CONFIG.url) { location.replace(CONFIG.url); } else { location.reload(); }
333
+ }, () => undefined);
334
+ if (state !== "starting" && state !== "slow") { return; }
335
+ const waited = Date.now() - begun;
336
+ if (state === "starting" && waited > CONFIG.slowAfter) { show("slow"); }
337
+ if (CONFIG.supervisor) { return; }
338
+ if (waited > CONFIG.giveUpAfter) { post("give-up"); }
339
+ else if (Date.now() - lastCheck >= 1000) { lastCheck = Date.now(); post("check"); }
340
+ }, CONFIG.inApp ? 500 : 2000);
341
+ `;
342
+
343
+ /**
344
+ * The tab's icon, inlined, as this page shows while the server that serves
345
+ * app/public/dex-icon.svg is down. Drawn by scripts/studio-icons.mjs.
346
+ */
347
+ const ICON = `data:image/svg+xml,${encodeURIComponent(
348
+ '<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>'
349
+ )}`;
350
+
351
+ /** The whole page, saying `options.state` first. */
352
+ export const serverPage = (options: ServerPageOptions): string => {
353
+ const name = escapeHtml(options.name);
354
+ const project = escapeHtml(options.project);
355
+ const start = options.startLink
356
+ ? `<a class="button" href="${escapeHtml(options.startLink)}">Start ${name}</a>`
357
+ : "";
358
+ return `<!doctype html>
359
+ <html lang="en">
360
+ <head>
361
+ <meta charset="utf-8">
362
+ <meta name="viewport" content="width=device-width, initial-scale=1">
363
+ <meta name="color-scheme" content="light dark">
364
+ <title>${name}</title>
365
+ <link rel="icon" href="${ICON}" type="image/svg+xml">
366
+ <style>${STYLE}</style>
367
+ </head>
368
+ <body>
369
+ <div id="page" class="${options.state}${options.inApp ? " in-app" : ""}">
370
+ ${SHAPE}
371
+ <div class="over"><div class="card" role="status">
372
+ ${MARK}
373
+ <div class="words" data-show="starting"><h1>Starting ${name}</h1><p>Usually ready in about 5 seconds.</p></div>
374
+ <div class="words" data-show="slow"><h1>Still starting</h1><p>Taking longer than usual. The first start after an update can take up to a minute.</p></div>
375
+ <div class="words" data-show="failed"><h1>${name} didn't start</h1><p id="cause"></p></div>
376
+ <pre id="log" data-show="failed" hidden></pre>
377
+ <div class="actions" data-show="failed"><button id="retry">Try again</button><button class="quiet" id="copy-log">Copy log</button></div>
378
+ <div class="words" data-show="recovery"><h1><span id="recovery-version">Dex</span> didn't start</h1><p>It stopped just after restarting. Its log ends:</p></div>
379
+ <pre id="recovery-log" data-show="recovery" hidden></pre>
380
+ <div class="actions" data-show="recovery"><button id="try-again">Try again</button><button class="quiet" id="go-back" hidden>Go back</button><button class="quiet" id="copy-recovery">Copy log</button></div>
381
+ <div class="words" data-show="stopped browser"><h1>${name} isn't running</h1></div>
382
+ <div class="actions" data-show="stopped"><button id="start">Start ${name}</button></div>
383
+ <div class="actions" data-show="start-link">${start}</div>
384
+ <div class="words" data-show="command"><p>Start it from your project's folder:</p></div>
385
+ <div class="command" data-show="command"><code id="command"><span>cd ${project}</span><span>npx dex dev</span></code><button class="quiet" id="copy-command">Copy</button></div>
386
+ <p class="small" data-show="command">On a Mac, Desktop app… in the menu under your name can start it from here.</p>
387
+ </div><p class="version">Dex ${escapeHtml(options.version)}</p></div>
388
+ </div>
389
+ <script>${script(options)}</script>
390
+ </body>
391
+ </html>
392
+ `;
393
+ };
@@ -0,0 +1,103 @@
1
+ // Signing up: the name and email a person gives Dex's welcome the first
2
+ // time they open it, sent to the relay on Dex's site, which files it in the
3
+ // team's tracker. The whole contract between the welcome and the relay, as
4
+ // feedback.ts is for feedback. Browser-safe and Node-safe.
5
+ //
6
+ // Only what the person typed is sent, and only when they choose Send.
7
+
8
+ /** Where sign-ups go: the relay on Dex's site. */
9
+ export const SIGNUP_URL = "https://sudio-site.vercel.app/api/signup";
10
+
11
+ export const SIGNUP_LIMITS = { name: 100, email: 254 } as const;
12
+
13
+ const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14
+
15
+ export interface Signup {
16
+ email: string;
17
+ name: string;
18
+ }
19
+
20
+ export type SignupField = keyof Signup;
21
+
22
+ export interface SignupProblem {
23
+ field: SignupField;
24
+ reason: "missing" | "invalid" | "long";
25
+ }
26
+
27
+ /** What stops this sign-up from being sent: none when it is ready. */
28
+ export const checkSignup = (signup: Signup): SignupProblem[] => {
29
+ const problems: SignupProblem[] = [];
30
+ const name = signup.name.trim();
31
+ if (!name) {
32
+ problems.push({ field: "name", reason: "missing" });
33
+ } else if (name.length > SIGNUP_LIMITS.name) {
34
+ problems.push({ field: "name", reason: "long" });
35
+ }
36
+ const email = signup.email.trim();
37
+ if (!email) {
38
+ problems.push({ field: "email", reason: "missing" });
39
+ } else if (email.length > SIGNUP_LIMITS.email || !EMAIL.test(email)) {
40
+ problems.push({ field: "email", reason: "invalid" });
41
+ }
42
+ return problems;
43
+ };
44
+
45
+ export type ReceivedSignup =
46
+ | { ok: true; signup: Signup }
47
+ | { ok: false; problems: SignupProblem[] };
48
+
49
+ /** The relay's side: a sign-up from a sent form, checked as the welcome checks it. */
50
+ export const receiveSignup = (form: FormData): ReceivedSignup => {
51
+ const text = (name: string) => {
52
+ const value = form.get(name);
53
+ return typeof value === "string" ? value.trim() : "";
54
+ };
55
+ const signup = { name: text("name"), email: text("email") };
56
+ const problems = checkSignup(signup);
57
+ return problems.length > 0 ? { ok: false, problems } : { ok: true, signup };
58
+ };
59
+
60
+ /** What came of sending: the tracker's id for it, or why not. */
61
+ export type SignupSent =
62
+ | { ok: true; id: string }
63
+ | { ok: false; reason: "invalid" | "limited" | "unavailable" | "failed" };
64
+
65
+ const TOO_MANY_REQUESTS = 429;
66
+ const SERVICE_UNAVAILABLE = 503;
67
+
68
+ export interface SignupSendOptions {
69
+ fetch?: (url: string, init: RequestInit) => Promise<Response>;
70
+ url?: string;
71
+ }
72
+
73
+ /** Send a sign-up to the relay, if it is ready; never throws. */
74
+ export const sendSignup = async (
75
+ signup: Signup,
76
+ { fetch = globalThis.fetch, url = SIGNUP_URL }: SignupSendOptions = {}
77
+ ): Promise<SignupSent> => {
78
+ if (checkSignup(signup).length > 0) {
79
+ return { ok: false, reason: "invalid" };
80
+ }
81
+ // A form, as feedback travels: a simple request, with no preflight.
82
+ const form = new FormData();
83
+ form.set("name", signup.name.trim());
84
+ form.set("email", signup.email.trim());
85
+ try {
86
+ const response = await fetch(url, { method: "POST", body: form });
87
+ if (response.ok) {
88
+ const { id } = (await response.json()) as { id?: unknown };
89
+ return typeof id === "string" && id
90
+ ? { ok: true, id }
91
+ : { ok: false, reason: "failed" };
92
+ }
93
+ if (response.status === TOO_MANY_REQUESTS) {
94
+ return { ok: false, reason: "limited" };
95
+ }
96
+ if (response.status === SERVICE_UNAVAILABLE) {
97
+ return { ok: false, reason: "unavailable" };
98
+ }
99
+ return { ok: false, reason: "failed" };
100
+ } catch {
101
+ return { ok: false, reason: "failed" };
102
+ }
103
+ };