@dexhq/canvas 0.13.0 → 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 (159) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +16 -15
  3. package/app/canvas/frame-node.tsx +34 -17
  4. package/app/canvas/tool-cursors.ts +16 -16
  5. package/app/i18n/locales/en/messages.po +26 -4
  6. package/app/i18n/locales/en/messages.ts +1 -1
  7. package/app/i18n/locales/pseudo/messages.po +26 -4
  8. package/app/i18n/locales/pseudo/messages.ts +1 -1
  9. package/app/icons/{sets/lucide.tsx → glyphs.tsx} +3 -5
  10. package/app/icons/index.tsx +3 -3
  11. package/app/icons/types.ts +3 -10
  12. package/app/index.html +3 -3
  13. package/app/pages/canvas-settings.tsx +35 -0
  14. package/app/shell/about.tsx +5 -4
  15. package/app/shell/feedback-details.ts +0 -3
  16. package/app/shell/instructions-editor.tsx +1 -1
  17. package/app/shell/presence-style.ts +59 -0
  18. package/app/shell/presence.tsx +6 -3
  19. package/app/shell/settings-sections.ts +12 -0
  20. package/app/shell/sidebar.tsx +1 -1
  21. package/app/studio-ui.d.ts +0 -9
  22. package/app/ui/prompt-editor.tsx +1 -1
  23. package/dist/cli/commands/create.d.mts +26 -14
  24. package/dist/cli/commands/create.mjs +13 -7
  25. package/dist/cli/commands/dev.mjs +2 -3
  26. package/dist/cli/commands/init.d.mts +11 -6
  27. package/dist/cli/help.d.mts +1 -1
  28. package/dist/cli/help.mjs +3 -3
  29. package/dist/cli/main.d.mts +22 -12
  30. package/dist/config/index.d.mts +6 -5
  31. package/dist/config/project-files.d.mts +0 -3
  32. package/dist/config/project-files.mjs +0 -3
  33. package/dist/config/schema.d.mts +0 -5
  34. package/dist/config/schema.mjs +0 -5
  35. package/dist/content/content.mjs +0 -3
  36. package/dist/content/snapshot-client.mjs +1 -1
  37. package/dist/paste/paste.mjs +1 -1
  38. package/dist/server/brief.mjs +3 -3
  39. package/dist/server/channel.d.mts +6 -0
  40. package/dist/server/channel.mjs +16 -1
  41. package/dist/server/claimed-presence.d.mts +17 -0
  42. package/dist/server/claimed-presence.mjs +50 -0
  43. package/dist/server/dev-server.mjs +9 -0
  44. package/dist/server/file-errors.d.mts +7 -2
  45. package/dist/server/file-errors.mjs +31 -8
  46. package/dist/server/requests.mjs +1 -1
  47. package/dist/server/studio-for.mjs +1 -1
  48. package/dist/server/vite.mjs +26 -29
  49. package/dist/server/web-app.mjs +3 -3
  50. package/dist/setup/apply.mjs +8 -14
  51. package/dist/setup/create.mjs +51 -19
  52. package/dist/setup/desktop-app.mjs +1 -1
  53. package/dist/setup/detect.d.mts +14 -5
  54. package/dist/setup/detect.mjs +56 -8
  55. package/dist/setup/doctor.mjs +1 -3
  56. package/dist/setup/existing-setup.d.mts +1 -3
  57. package/dist/setup/existing-setup.mjs +10 -11
  58. package/dist/setup/own-app.d.mts +1 -2
  59. package/dist/setup/own-app.mjs +4 -5
  60. package/dist/setup/plan.d.mts +8 -6
  61. package/dist/setup/plan.mjs +64 -48
  62. package/dist/setup/project.d.mts +0 -16
  63. package/dist/setup/project.mjs +8 -52
  64. package/dist/setup/prompts.d.mts +5 -5
  65. package/dist/setup/prompts.mjs +28 -61
  66. package/dist/setup/questions.d.mts +12 -4
  67. package/dist/setup/questions.mjs +10 -25
  68. package/dist/setup/starters.mjs +19 -8
  69. package/dist/setup/workspace-setup.d.mts +1 -2
  70. package/dist/setup/workspace-setup.mjs +4 -6
  71. package/dist/setup/write.d.mts +15 -5
  72. package/dist/setup/write.mjs +35 -9
  73. package/dist/shared/server-page.mjs +6 -0
  74. package/extension/dist/feedback.js +1 -1
  75. package/extension/dist/manifest.json +1 -1
  76. package/package.json +2 -19
  77. package/src/cli/commands/create.ts +17 -9
  78. package/src/cli/commands/dev.ts +0 -3
  79. package/src/cli/help.ts +3 -3
  80. package/src/config/index.ts +6 -5
  81. package/src/config/project-files.ts +0 -5
  82. package/src/config/schema.ts +0 -1
  83. package/src/content/content.ts +0 -3
  84. package/src/content/snapshot-client.ts +1 -1
  85. package/src/server/brief.ts +8 -3
  86. package/src/server/channel.ts +27 -0
  87. package/src/server/claimed-presence.ts +77 -0
  88. package/src/server/dev-server.ts +13 -0
  89. package/src/server/file-errors.ts +47 -13
  90. package/src/server/studio-for.ts +1 -1
  91. package/src/server/vite.ts +37 -40
  92. package/src/server/web-app.ts +3 -3
  93. package/src/setup/apply.ts +10 -16
  94. package/src/setup/create.ts +52 -20
  95. package/src/setup/desktop-app.ts +1 -1
  96. package/src/setup/detect.ts +56 -10
  97. package/src/setup/doctor.ts +4 -4
  98. package/src/setup/existing-setup.ts +10 -12
  99. package/src/setup/own-app.ts +2 -5
  100. package/src/setup/plan.ts +93 -84
  101. package/src/setup/project.ts +16 -110
  102. package/src/setup/prompts.ts +44 -127
  103. package/src/setup/questions.ts +27 -29
  104. package/src/setup/starters.ts +27 -9
  105. package/src/setup/workspace-setup.ts +8 -18
  106. package/src/setup/write.ts +52 -9
  107. package/src/shared/server-page.ts +9 -0
  108. package/templates/methods/review.md +2 -2
  109. package/templates/rules/canvas-frames.md +104 -0
  110. package/templates/rules/canvas.md +8 -142
  111. package/templates/rules/prototypes.md +1 -1
  112. package/templates/rules/snapshots.md +52 -0
  113. package/templates/starters/standalone/README.md +7 -7
  114. package/templates/starters/standalone/components.json +1 -1
  115. package/templates/starters/standalone/package.json +1 -2
  116. package/templates/starters/turborepo/README.md +6 -6
  117. package/templates/starters/turborepo/apps/web/components.json +1 -1
  118. package/templates/starters/turborepo/apps/web/package.json +1 -2
  119. package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
  120. package/templates/starters/turborepo/packages/ui/components.json +1 -1
  121. package/templates/starters/turborepo/packages/ui/package.json +1 -2
  122. package/templates/starters/vite/README.md +7 -6
  123. package/templates/starters/vite/components.json +1 -1
  124. package/templates/starters/vite/package.json +1 -2
  125. package/templates/starters/vite/src/app.tsx +3 -4
  126. package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
  127. package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
  128. package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
  129. package/templates/starters/vite/src/components/ui/button.tsx +17 -12
  130. package/templates/starters/vite/src/components/ui/card.tsx +1 -1
  131. package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
  132. package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
  133. package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
  134. package/templates/starters/vite/src/components/ui/field.tsx +3 -1
  135. package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
  136. package/templates/starters/vite/src/components/ui/input.tsx +1 -1
  137. package/templates/starters/vite/src/components/ui/label.tsx +2 -0
  138. package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
  139. package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
  140. package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
  141. package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
  142. package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
  143. package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
  144. package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
  145. package/templates/starters/vite/src/index.css +533 -111
  146. package/app/icons/sets/hugeicons.tsx +0 -259
  147. package/app/icons/sets/phosphor.tsx +0 -251
  148. package/dist/server/icon-set.d.mts +0 -15
  149. package/dist/server/icon-set.mjs +0 -31
  150. package/dist/shared/icon-sets.d.mts +0 -9
  151. package/dist/shared/icon-sets.mjs +0 -21
  152. package/src/server/icon-set.ts +0 -56
  153. package/src/shared/icon-sets.ts +0 -23
  154. /package/app/public/{sudio-192.png → dex-192.png} +0 -0
  155. /package/app/public/{sudio-512.png → dex-512.png} +0 -0
  156. /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
  157. /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
  158. /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
  159. /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
@@ -0,0 +1,35 @@
1
+ import { useLingui } from "@lingui/react/macro";
2
+ import {
3
+ type PresenceStyle,
4
+ setPresenceStyle,
5
+ usePresenceStyle,
6
+ } from "../shell/presence-style";
7
+ import { SettingRow, SettingsCard } from "../shell/settings-ui";
8
+ import { Segmented } from "../ui/segmented";
9
+
10
+ // Settings → Canvas: how the canvas looks to you, in this browser.
11
+
12
+ export const CanvasSettings = () => {
13
+ const { t } = useLingui();
14
+ const style = usePresenceStyle();
15
+ const styles: { id: PresenceStyle; label: string }[] = [
16
+ { id: "blocks", label: t`Blocks` },
17
+ { id: "edge", label: t`Edge only` },
18
+ { id: "off", label: t`Off` },
19
+ ];
20
+ return (
21
+ <SettingsCard>
22
+ <SettingRow
23
+ hint={t`How a frame an agent is changing shows it: drawn in blocks while it works, an edge round the frame, or nothing.`}
24
+ label={t`Agents at work`}
25
+ >
26
+ <Segmented
27
+ label={t`Agents at work`}
28
+ onChange={setPresenceStyle}
29
+ segments={styles}
30
+ value={style}
31
+ />
32
+ </SettingRow>
33
+ </SettingsCard>
34
+ );
35
+ };
@@ -8,7 +8,7 @@ import {
8
8
  DialogTitle,
9
9
  } from "@studio/ui/shadcn/dialog";
10
10
  import { useEffect, useState } from "react";
11
- import { homepage, license, version } from "../../package.json";
11
+ import { license, name, version } from "../../package.json";
12
12
  import { PRODUCT } from "../../src/shared/product.ts";
13
13
  import { versionsLine } from "../../src/shared/update-core.ts";
14
14
  import { CAN_WRITE } from "../live/studio-api";
@@ -25,7 +25,8 @@ import { useCopied } from "./use-copied";
25
25
  // Dexes" (server/roster.ts). Reporting one is Feedback's, at the foot of
26
26
  // the sidebar, so it isn't here too.
27
27
 
28
- const SOURCE_URL = homepage.replace("#readme", "");
28
+ // Dex's page on npm, where its source is too (the Code tab).
29
+ const PACKAGE_URL = `https://www.npmjs.com/package/${name}`;
29
30
 
30
31
  export const AboutDialog = ({
31
32
  onOpenChange,
@@ -103,11 +104,11 @@ export const AboutDialog = ({
103
104
  <div className="flex items-center justify-between gap-2">
104
105
  <a
105
106
  className="studio-small text-muted-foreground hover:text-foreground hover:underline"
106
- href={SOURCE_URL}
107
+ href={PACKAGE_URL}
107
108
  rel="noopener"
108
109
  target="_blank"
109
110
  >
110
- <Trans>Source on GitHub</Trans>
111
+ <Trans>{PRODUCT} on npm</Trans>
111
112
  </a>
112
113
  <Button
113
114
  onClick={() => copy(details)}
@@ -24,7 +24,6 @@ export interface FeedbackContext {
24
24
  environment: IssueEnvironment;
25
25
  /** Unreleased features turned on (only in a copy being worked on). */
26
26
  features: string[];
27
- icons: string | undefined;
28
27
  locale: string | undefined;
29
28
  workspace: string;
30
29
  }
@@ -70,7 +69,6 @@ export const feedbackDetails = (
70
69
  ["Design system", designSystemDetail(context.designSystem)],
71
70
  ["Agents", context.agents.join(", ")],
72
71
  ["Default agent", context.defaultAgent],
73
- ["Icons", context.icons],
74
72
  ["Language", context.locale],
75
73
  ["Features on", context.features.join(", ")],
76
74
  ]),
@@ -105,7 +103,6 @@ export const useFeedbackDetails = (): FeedbackDetailGroup[] => {
105
103
  },
106
104
  agents: [...new Set(agents.map((connected) => agentName(connected.agent)))],
107
105
  defaultAgent: agent && AGENT_NAMES[agent],
108
- icons: ui.icons,
109
106
  locale: ui.locale,
110
107
  features: Object.entries(features)
111
108
  .filter(([, on]) => on)
@@ -404,7 +404,7 @@ const SlashMenu = ({
404
404
  {/* biome-ignore lint/a11y/useKeyWithClickEvents: the editor's keys choose (arrows, Enter), as focus stays in the text */}
405
405
  <div
406
406
  aria-selected={index === active}
407
- className="studio-small flex min-h-7 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
407
+ className="studio-small flex min-h-7 shrink-0 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
408
408
  id={`${MENU_ID}-${index}`}
409
409
  onClick={() => choose(format)}
410
410
  // Keep the caret in the editor.
@@ -0,0 +1,59 @@
1
+ import { useSyncExternalStore } from "react";
2
+
3
+ // How an agent at work shows on a frame, as each person likes it: drawn in
4
+ // blocks (presence.tsx), only the edge round the frame, or not at all. Kept
5
+ // in this browser, and the same in every tab of it.
6
+
7
+ export const PRESENCE_STYLES = ["blocks", "edge", "off"] as const;
8
+ export type PresenceStyle = (typeof PRESENCE_STYLES)[number];
9
+
10
+ const KEY = "dex.presence.style";
11
+ const DEFAULT: PresenceStyle = "blocks";
12
+
13
+ const listeners = new Set<() => void>();
14
+ /** The choice made where storage is refused (a private window). */
15
+ let unsaved: PresenceStyle | undefined;
16
+
17
+ const read = (): PresenceStyle => {
18
+ if (unsaved) {
19
+ return unsaved;
20
+ }
21
+ try {
22
+ const saved = window.localStorage.getItem(KEY);
23
+ return PRESENCE_STYLES.find((style) => style === saved) ?? DEFAULT;
24
+ } catch {
25
+ return DEFAULT;
26
+ }
27
+ };
28
+
29
+ const subscribe = (listener: () => void) => {
30
+ listeners.add(listener);
31
+ // Another tab chose.
32
+ const onStorage = (event: StorageEvent) => {
33
+ if (event.key === KEY) {
34
+ listener();
35
+ }
36
+ };
37
+ window.addEventListener("storage", onStorage);
38
+ return () => {
39
+ listeners.delete(listener);
40
+ window.removeEventListener("storage", onStorage);
41
+ };
42
+ };
43
+
44
+ /** How this person has agents at work shown. */
45
+ export const usePresenceStyle = (): PresenceStyle =>
46
+ useSyncExternalStore(subscribe, read, () => DEFAULT);
47
+
48
+ /** Show agents at work as `style`, here and in this browser's other tabs. */
49
+ export const setPresenceStyle = (style: PresenceStyle): void => {
50
+ try {
51
+ window.localStorage.setItem(KEY, style);
52
+ } catch {
53
+ // Not remembered, in a private window: it holds until reload.
54
+ unsaved = style;
55
+ }
56
+ for (const listener of listeners) {
57
+ listener();
58
+ }
59
+ };
@@ -6,6 +6,7 @@ import {
6
6
  useState,
7
7
  } from "react";
8
8
  import type { Sketch } from "../types";
9
+ import { usePresenceStyle } from "./presence-style";
9
10
  import {
10
11
  type Bone,
11
12
  changedElements,
@@ -400,7 +401,8 @@ const PresenceBlocks = ({
400
401
  * An agent at work on a view, while `active`. Given the frame's `iframe`,
401
402
  * the view in blocks from its layout; with `blank`, a page still to come,
402
403
  * in blocks as `guess` has it or as a generic page; with neither, only an
403
- * edge round it.
404
+ * edge round it. Each person may have only the edge, or nothing
405
+ * (presence-style.ts).
404
406
  */
405
407
  export const Presence = ({
406
408
  active,
@@ -413,11 +415,12 @@ export const Presence = ({
413
415
  guess?: Guess;
414
416
  iframe?: HTMLIFrameElement | null;
415
417
  }) => {
418
+ const style = usePresenceStyle();
416
419
  const { leaving, shown } = usePresenceExit(active);
417
- if (!shown) {
420
+ if (!shown || style === "off") {
418
421
  return null;
419
422
  }
420
- if (iframe === undefined && !blank) {
423
+ if (style === "edge" || (iframe === undefined && !blank)) {
421
424
  return <PresenceEdge leaving={leaving} />;
422
425
  }
423
426
  return (
@@ -61,6 +61,18 @@ export const SETTINGS_SECTIONS: SettingsPageRow[] = [
61
61
  () => import("../pages/profile"),
62
62
  "ProfileSettings"
63
63
  ),
64
+ page(
65
+ {
66
+ group: PERSONAL,
67
+ id: "canvas",
68
+ icon: "Eye",
69
+ label: msg`Canvas`,
70
+ lead: msg`How the canvas shows you what agents are doing. Kept in this browser.`,
71
+ running: true,
72
+ },
73
+ () => import("../pages/canvas-settings"),
74
+ "CanvasSettings"
75
+ ),
64
76
  page(
65
77
  {
66
78
  group: WORKSPACE,
@@ -84,5 +84,5 @@ export const SidebarSection = ({
84
84
  /** Dex's own mark, from the app's icon. */
85
85
  export const ProductMark = () => (
86
86
  // biome-ignore lint/performance/noImgElement: the studio runs on Vite, not Next
87
- <img alt="" height={18} src={`${BASE}/favicon.svg`} width={18} />
87
+ <img alt="" height={18} src={`${BASE}/dex-icon.svg`} width={18} />
88
88
  );
@@ -10,8 +10,6 @@ declare module "virtual:studio-ui" {
10
10
  export const ui: {
11
11
  /** `ui.chromeTheme`: the interface's variables mapped to the design system's. */
12
12
  chromeTheme?: ChromeTheme;
13
- /** `ui.icons`: the set the interface draws with, Lucide if unset. */
14
- icons?: "phosphor" | "lucide" | "hugeicons";
15
13
  locale?: string;
16
14
  subtitle?: string;
17
15
  theme?: "studio" | "design-system";
@@ -58,13 +56,6 @@ declare module "virtual:studio-threads" {
58
56
  export const threads: PublicThread[];
59
57
  }
60
58
 
61
- declare module "virtual:studio-icons" {
62
- import type { IconGlyphs } from "./icons/types";
63
-
64
- /** The chosen set's glyphs (`ui.icons`), by name. */
65
- export const glyphs: IconGlyphs;
66
- }
67
-
68
59
  declare module "virtual:studio-design-system" {
69
60
  import type { StudioDesignSystem } from "../src/shared/design-system.ts";
70
61
 
@@ -314,7 +314,7 @@ const TriggerMenu = ({
314
314
  // biome-ignore lint/a11y/useKeyWithClickEvents: the editor's keys choose (arrows, Enter), as focus stays in the text
315
315
  <div
316
316
  aria-selected={index === active}
317
- className="flex min-h-7 cursor-default flex-col justify-center rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
317
+ className="flex min-h-7 shrink-0 cursor-default flex-col justify-center rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
318
318
  id={`${id}-${index}`}
319
319
  key={choice.id}
320
320
  onClick={() => pick(choice)}
@@ -30,6 +30,16 @@ export declare const SETUP_ARGS: {
30
30
  readonly type: "boolean";
31
31
  readonly description: "No components yet: set up shadcn first";
32
32
  };
33
+ readonly preset: {
34
+ readonly type: "string";
35
+ readonly valueHint: "code";
36
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
37
+ };
38
+ readonly base: {
39
+ readonly type: "string";
40
+ readonly valueHint: "library";
41
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
42
+ };
33
43
  readonly styles: {
34
44
  readonly type: "string";
35
45
  readonly valueHint: "file";
@@ -37,12 +47,7 @@ export declare const SETUP_ARGS: {
37
47
  };
38
48
  readonly primitives: {
39
49
  readonly type: "boolean";
40
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
41
- };
42
- readonly icons: {
43
- readonly type: "string";
44
- readonly valueHint: "set";
45
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
50
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
46
51
  };
47
52
  readonly provider: {
48
53
  readonly type: "string";
@@ -91,15 +96,16 @@ export declare const SETUP_ARGS: {
91
96
  export declare const setupFlags: (args: {
92
97
  agent?: string;
93
98
  app?: string;
99
+ base?: string;
94
100
  in?: string;
95
101
  components?: string;
96
102
  "design-md"?: string;
97
103
  dir?: string;
98
104
  "dry-run"?: boolean;
99
- icons?: string;
100
105
  import?: string;
101
106
  json?: boolean;
102
107
  pm?: string;
108
+ preset?: string;
103
109
  primitives?: boolean;
104
110
  provider?: string;
105
111
  shadcn?: boolean;
@@ -110,15 +116,16 @@ export declare const setupFlags: (args: {
110
116
  }) => {
111
117
  agent: string | undefined;
112
118
  app: string | undefined;
119
+ base: string | undefined;
113
120
  in: string | undefined;
114
121
  components: string | undefined;
115
122
  designMd: string | undefined;
116
123
  dir: string | undefined;
117
124
  dryRun: boolean | undefined;
118
- icons: string | undefined;
119
125
  import: string | undefined;
120
126
  json: boolean | undefined;
121
127
  pm: string | undefined;
128
+ preset: string | undefined;
122
129
  primitives: boolean | undefined;
123
130
  provider: string | undefined;
124
131
  shadcn: boolean | undefined;
@@ -157,6 +164,16 @@ declare const _default: import("citty").CommandDef<{
157
164
  readonly type: "boolean";
158
165
  readonly description: "No components yet: set up shadcn first";
159
166
  };
167
+ readonly preset: {
168
+ readonly type: "string";
169
+ readonly valueHint: "code";
170
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
171
+ };
172
+ readonly base: {
173
+ readonly type: "string";
174
+ readonly valueHint: "library";
175
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
176
+ };
160
177
  readonly styles: {
161
178
  readonly type: "string";
162
179
  readonly valueHint: "file";
@@ -164,12 +181,7 @@ declare const _default: import("citty").CommandDef<{
164
181
  };
165
182
  readonly primitives: {
166
183
  readonly type: "boolean";
167
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
168
- };
169
- readonly icons: {
170
- readonly type: "string";
171
- readonly valueHint: "set";
172
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
184
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
173
185
  };
174
186
  readonly provider: {
175
187
  readonly type: "string";
@@ -32,6 +32,16 @@ const SETUP_ARGS = {
32
32
  type: "boolean",
33
33
  description: "No components yet: set up shadcn first"
34
34
  },
35
+ preset: {
36
+ type: "string",
37
+ valueHint: "code",
38
+ description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)"
39
+ },
40
+ base: {
41
+ type: "string",
42
+ valueHint: "library",
43
+ description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)"
44
+ },
35
45
  styles: {
36
46
  type: "string",
37
47
  valueHint: "file",
@@ -39,12 +49,7 @@ const SETUP_ARGS = {
39
49
  },
40
50
  primitives: {
41
51
  type: "boolean",
42
- description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)"
43
- },
44
- icons: {
45
- type: "string",
46
- valueHint: "set",
47
- description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)"
52
+ description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)"
48
53
  },
49
54
  provider: {
50
55
  type: "string",
@@ -93,15 +98,16 @@ const SETUP_ARGS = {
93
98
  const setupFlags = (args) => ({
94
99
  agent: args.agent,
95
100
  app: args.app,
101
+ base: args.base,
96
102
  in: args.in,
97
103
  components: args.components,
98
104
  designMd: args["design-md"],
99
105
  dir: args.dir,
100
106
  dryRun: args["dry-run"],
101
- icons: args.icons,
102
107
  import: args.import,
103
108
  json: args.json,
104
109
  pm: args.pm,
110
+ preset: args.preset,
105
111
  primitives: args.primitives,
106
112
  provider: args.provider,
107
113
  shadcn: args.shadcn,
@@ -46,11 +46,10 @@ var dev_default = defineCommand({
46
46
  const { superviseDev } = await import("../supervise.mjs");
47
47
  process.exit(await superviseDev());
48
48
  }
49
- const [{ createServer }, { unbuiltPackages }, { viteConfig }, { iconSetWarnings }, { listenOnPort, PortInUseError }, { lookOf, machineLines, movedLines, noteLine, portTakenLines, startedLines, updateLine }, { studioVersion }, { checkForUpdate }, { logMachineLine, machineState, updateMachine }, { queueSync }, { FROM_APP_ENV }] = await Promise.all([
49
+ const [{ createServer }, { unbuiltPackages }, { viteConfig }, { listenOnPort, PortInUseError }, { lookOf, machineLines, movedLines, noteLine, portTakenLines, startedLines, updateLine }, { studioVersion }, { checkForUpdate }, { logMachineLine, machineState, updateMachine }, { queueSync }, { FROM_APP_ENV }] = await Promise.all([
50
50
  import("vite"),
51
51
  import("../../setup/design-system-checks.mjs"),
52
52
  import("../../server/vite.mjs"),
53
- import("../../server/icon-set.mjs"),
54
53
  import("../../server/port.mjs"),
55
54
  import("../banner.mjs"),
56
55
  import("../../paths.mjs"),
@@ -115,7 +114,7 @@ var dev_default = defineCommand({
115
114
  if (!restarted) checkForUpdate(project.content, project.root).then((fresh) => {
116
115
  if (fresh && fresh.latest !== update?.latest) print(updateLine(fresh, look));
117
116
  }).catch(() => void 0);
118
- const warnings = [...iconSetWarnings(project), ...unbuiltPackages(project).map(({ name }) => `${name} is not built, so views cannot import it. Build it first (in a monorepo, \`npx turbo run build --filter=${name}\`).`)];
117
+ const warnings = [...unbuiltPackages(project).map(({ name }) => `${name} is not built, so views cannot import it. Build it first (in a monorepo, \`npx turbo run build --filter=${name}\`).`)];
119
118
  for (const line of warnings) print(noteLine("warn", line, look));
120
119
  import("../../content/content.mjs").then(({ linkGithub }) => linkGithub(project.content)).then((login) => {
121
120
  if (login) print(noteLine("note", `Your comments now show your GitHub avatar (@${login}).`, look));
@@ -33,6 +33,16 @@ declare const _default: import("citty").CommandDef<{
33
33
  readonly type: "boolean";
34
34
  readonly description: "No components yet: set up shadcn first";
35
35
  };
36
+ readonly preset: {
37
+ readonly type: "string";
38
+ readonly valueHint: "code";
39
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
40
+ };
41
+ readonly base: {
42
+ readonly type: "string";
43
+ readonly valueHint: "library";
44
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
45
+ };
36
46
  readonly styles: {
37
47
  readonly type: "string";
38
48
  readonly valueHint: "file";
@@ -40,12 +50,7 @@ declare const _default: import("citty").CommandDef<{
40
50
  };
41
51
  readonly primitives: {
42
52
  readonly type: "boolean";
43
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
44
- };
45
- readonly icons: {
46
- readonly type: "string";
47
- readonly valueHint: "set";
48
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
53
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
49
54
  };
50
55
  readonly provider: {
51
56
  readonly type: "string";
@@ -1,7 +1,7 @@
1
1
  import { Described } from "./command.mjs";
2
2
  //#region src/cli/help.d.ts
3
3
  /** `dex --help`. Every command and flag in it is tested to exist. */
4
- export declare const ROOT_HELP = "Dex\n\nUsage: dex <command> [options]\n dex <command> --help that command's options\n\nSet up and maintain\n create [folder] [--yes] [--dry-run] [--json]\n [--template vite|standalone|turborepo]\n [--components <folder>|none] [--import <specifier>] [--shadcn]\n [--styles <file>|none] [--primitives | --no-primitives]\n [--icons lucide|phosphor|hugeicons]\n [--agent <ids>|none] [--dir studio] [--pm <manager>]\n [--provider <module>|none] [--design-md draft|none|<path>|<url>]\n [--app <name> | --in <package>]\n [--studio <spec>] [--skip-install]\n Set up a studio: in a project it adds one in studio/,\n in a workspace its own app (--app) or inside an app\n (--in), in an empty folder a new project from a\n starter (--template). It confirms what it finds,\n shows the plan, then says what it does. Without a\n terminal, or with --yes, it takes what it finds;\n --dry-run only shows the plan\n agents add <agent> Add the studio to claude, codex, cursor, copilot or\n opencode, as the studio's \"Add MCP config\" does\n doctor [--json] Check the setup and say how to fix it; --json prints\n one JSON object per check\n components [--json] [--components <folder>]\n List the design system's components and how to\n import them; --components scans another folder and\n prints the config that points at it\n upgrade [--dry-run] Bring a studio set up by an older version up to date:\n rename studio.config.ts to dex.config.ts, move\n design-system/index.ts into it (its prose into\n DESIGN.md), its state into .studio/, use the\n installed rules and delete old explorations/\n folders. --dry-run says what would change and\n writes nothing\n\nRun\n dev [--live] Start the studio; --live also keeps it in step with\n the linked cloud workspace (see cloud live)\n stop Stop this checkout's studio, and no other\n build Check, then build a static site\n preview Serve the built site\n extension Install the Chrome extension that copies elements from\n any page to paste on a canvas\n app install On a Mac, make ~/Applications/Dex.app: it starts\n the studio when it isn't running and opens it in its\n own window\n app remove Remove that app\n app start What that app runs when it opens: starts the studio\n unless this project's Dex already holds its port\n\nWork (usually run by your agent)\n whoami Who you are, from GitHub or git: added the first time\n new [--person <slug>] --title \"<title>\"\n contributor --name \"<name>\" --git \"<git user>\" --discipline <product|brand|engineering> [--github <username>]\n threads [--slug <file>] [--all]\n Comments and requests waiting for an agent\n thread --id <id> [--note \"<message, or what changed>\"] [--acknowledge | --resolve | --dismiss]\n Answer one\n check Validate files, canvases and references\n scope --person <slug>\n Changes outside that contributor's folders\n presence --slug <file> --view <view> [--agent <name>] [--clear]\n snapshot --slug <file> [--view <view>]\n\nCloud workspaces (Team)\n cloud login --token <token> [--url <service url>]\n cloud link --workspace <slug> [--url <service url>]\n Keep comments in the workspace, shared by the team\n cloud live [--workspace <slug>] [--url <service url>] [--token <token>]\n Work live with the team: this studio's files stay\n in step with the workspace, both ways, while it runs.\n Your own agents work on them as usual\n cloud status What this studio is linked to\n cloud push Copy comment threads into the workspace\n cloud publish Build and publish the studio; prints a share link\n cloud unlink\n\nAgents\n claude [...] Claude Code, with feedback from the studio arriving in\n the session as it is left (a channel; no watching)\n mcp [--agent \"<name>\"] The studio's MCP server (stdio): guidelines and feedback\n hook Claude Code hook: presence and guidelines\n";
4
+ export declare const ROOT_HELP = "Dex\n\nUsage: dex <command> [options]\n dex <command> --help that command's options\n\nSet up and maintain\n create [folder] [--yes] [--dry-run] [--json]\n [--template vite|standalone|turborepo]\n [--components <folder>|none] [--import <specifier>]\n [--shadcn] [--preset <code>] [--base base|radix|aria]\n [--styles <file>|none] [--primitives]\n [--agent <ids>|none] [--dir studio] [--pm <manager>]\n [--provider <module>|none] [--design-md draft|none|<path>|<url>]\n [--app <name> | --in <package>]\n [--studio <spec>] [--skip-install]\n Set up a studio: in a project it adds one in studio/,\n in a workspace its own app (--app) or inside an app\n (--in), in an empty folder a new project from a\n starter (--template). It confirms what it finds,\n shows the plan, then says what it does. Without a\n terminal, or with --yes, it takes what it finds;\n --dry-run only shows the plan\n agents add <agent> Add the studio to claude, codex, cursor, copilot or\n opencode, as the studio's \"Add MCP config\" does\n doctor [--json] Check the setup and say how to fix it; --json prints\n one JSON object per check\n components [--json] [--components <folder>]\n List the design system's components and how to\n import them; --components scans another folder and\n prints the config that points at it\n upgrade [--dry-run] Bring a studio set up by an older version up to date:\n rename studio.config.ts to dex.config.ts, move\n design-system/index.ts into it (its prose into\n DESIGN.md), its state into .studio/, use the\n installed rules and delete old explorations/\n folders. --dry-run says what would change and\n writes nothing\n\nRun\n dev [--live] Start the studio; --live also keeps it in step with\n the linked cloud workspace (see cloud live)\n stop Stop this checkout's studio, and no other\n build Check, then build a static site\n preview Serve the built site\n extension Install the Chrome extension that copies elements from\n any page to paste on a canvas\n app install On a Mac, make ~/Applications/Dex.app: it starts\n the studio when it isn't running and opens it in its\n own window\n app remove Remove that app\n app start What that app runs when it opens: starts the studio\n unless this project's Dex already holds its port\n\nWork (usually run by your agent)\n whoami Who you are, from GitHub or git: added the first time\n new [--person <slug>] --title \"<title>\"\n contributor --name \"<name>\" --git \"<git user>\" --discipline <product|brand|engineering> [--github <username>]\n threads [--slug <file>] [--all]\n Comments and requests waiting for an agent\n thread --id <id> [--note \"<message, or what changed>\"] [--acknowledge | --resolve | --dismiss]\n Answer one\n check Validate files, canvases and references\n scope --person <slug>\n Changes outside that contributor's folders\n presence --slug <file> --view <view> [--agent <name>] [--clear]\n snapshot --slug <file> [--view <view>]\n\nCloud workspaces (Team)\n cloud login --token <token> [--url <service url>]\n cloud link --workspace <slug> [--url <service url>]\n Keep comments in the workspace, shared by the team\n cloud live [--workspace <slug>] [--url <service url>] [--token <token>]\n Work live with the team: this studio's files stay\n in step with the workspace, both ways, while it runs.\n Your own agents work on them as usual\n cloud status What this studio is linked to\n cloud push Copy comment threads into the workspace\n cloud publish Build and publish the studio; prints a share link\n cloud unlink\n\nAgents\n claude [...] Claude Code, with feedback from the studio arriving in\n the session as it is left (a channel; no watching)\n mcp [--agent \"<name>\"] The studio's MCP server (stdio): guidelines and feedback\n hook Claude Code hook: presence and guidelines\n";
5
5
  /** `dex --help`, with its headings in bold in a terminal. */
6
6
  export declare const rootHelp: () => string;
7
7
  /** `dex <command> --help`: what it does, and its arguments and options. */
package/dist/cli/help.mjs CHANGED
@@ -11,9 +11,9 @@ Usage: dex <command> [options]
11
11
  Set up and maintain
12
12
  create [folder] [--yes] [--dry-run] [--json]
13
13
  [--template vite|standalone|turborepo]
14
- [--components <folder>|none] [--import <specifier>] [--shadcn]
15
- [--styles <file>|none] [--primitives | --no-primitives]
16
- [--icons lucide|phosphor|hugeicons]
14
+ [--components <folder>|none] [--import <specifier>]
15
+ [--shadcn] [--preset <code>] [--base base|radix|aria]
16
+ [--styles <file>|none] [--primitives]
17
17
  [--agent <ids>|none] [--dir studio] [--pm <manager>]
18
18
  [--provider <module>|none] [--design-md draft|none|<path>|<url>]
19
19
  [--app <name> | --in <package>]
@@ -31,6 +31,16 @@ export declare const COMMANDS: {
31
31
  readonly type: "boolean";
32
32
  readonly description: "No components yet: set up shadcn first";
33
33
  };
34
+ readonly preset: {
35
+ readonly type: "string";
36
+ readonly valueHint: "code";
37
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
38
+ };
39
+ readonly base: {
40
+ readonly type: "string";
41
+ readonly valueHint: "library";
42
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
43
+ };
34
44
  readonly styles: {
35
45
  readonly type: "string";
36
46
  readonly valueHint: "file";
@@ -38,12 +48,7 @@ export declare const COMMANDS: {
38
48
  };
39
49
  readonly primitives: {
40
50
  readonly type: "boolean";
41
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
42
- };
43
- readonly icons: {
44
- readonly type: "string";
45
- readonly valueHint: "set";
46
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
51
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
47
52
  };
48
53
  readonly provider: {
49
54
  readonly type: "string";
@@ -133,6 +138,16 @@ export declare const COMMANDS: {
133
138
  readonly type: "boolean";
134
139
  readonly description: "No components yet: set up shadcn first";
135
140
  };
141
+ readonly preset: {
142
+ readonly type: "string";
143
+ readonly valueHint: "code";
144
+ readonly description: "shadcn's look for --shadcn: a preset's name (nova, lyra) or the code ui.shadcn.com/create gives you; implies --shadcn (default: shadcn's, base-nova)";
145
+ };
146
+ readonly base: {
147
+ readonly type: "string";
148
+ readonly valueHint: "library";
149
+ readonly description: "shadcn's component library for --shadcn: base (Base UI), radix or aria; implies --shadcn (default: the preset's)";
150
+ };
136
151
  readonly styles: {
137
152
  readonly type: "string";
138
153
  readonly valueHint: "file";
@@ -140,12 +155,7 @@ export declare const COMMANDS: {
140
155
  };
141
156
  readonly primitives: {
142
157
  readonly type: "boolean";
143
- readonly description: "Build the studio's own buttons, menus and dialogs from your components; --no-primitives keeps its own (default: yes for shadcn on Base UI)";
144
- };
145
- readonly icons: {
146
- readonly type: "string";
147
- readonly valueHint: "set";
148
- readonly description: "The icon set Dex's interface draws with: lucide, phosphor or hugeicons (default: the one your components use, else lucide)";
158
+ readonly description: "Build the studio's own buttons, menus and dialogs from your components, shadcn on Base UI (default: no, Dex's own)";
149
159
  };
150
160
  readonly provider: {
151
161
  readonly type: "string";
@@ -123,10 +123,10 @@ export interface StudioInterface {
123
123
  */
124
124
  components?: string;
125
125
  /**
126
- * The interface's icons: "lucide" (the default), "phosphor" or
127
- * "hugeicons". Every icon swaps at once; only the chosen set is bundled.
126
+ * @deprecated No longer read: the interface always draws with Lucide.
127
+ * `create` takes it out of the config.
128
128
  */
129
- icons?: "phosphor" | "lucide" | "hugeicons";
129
+ icons?: string;
130
130
  /**
131
131
  * The interface's language, when not the person's browser's: "en", or
132
132
  * "pseudo" to check that every string is localised. ?locale= overrides it.
@@ -138,8 +138,9 @@ export interface StudioInterface {
138
138
  * ("./src/components/ui") or an import path ("@acme/ui/shadcn"). Each is
139
139
  * used when you have one of that name; the studio's own fills the gaps.
140
140
  * `true` uses `designSystem.components`: its import, or its folder.
141
- * They need shadcn's Base UI API (a components.json style of "base-…"),
142
- * which `init` checks before setting this.
141
+ * They need shadcn's Base UI API (a components.json style of "base-…").
142
+ * Off by default, so the interface looks like Dex whatever your
143
+ * components' corners and icons: `create --primitives` sets it.
143
144
  */
144
145
  primitives?: string | true;
145
146
  /** Under the title in the sidebar. Default: your design system's name. */
@@ -1,5 +1,4 @@
1
1
  import { StylingApproach } from "../shared/design-system.mjs";
2
- import { InterfaceIcons } from "../shared/icon-sets.mjs";
3
2
  import { Alias } from "vite";
4
3
  //#region src/config/project-files.d.ts
5
4
  type Json = Record<string, unknown>;
@@ -58,8 +57,6 @@ export interface ComponentsJson {
58
57
  file: string;
59
58
  /** The folder its `ui` alias points at. */
60
59
  folder: string;
61
- /** The icon set it draws with (`iconLibrary`), when the interface has it. */
62
- icons: InterfaceIcons | undefined;
63
60
  /** How code at the root imports the folder's files: "@/components/ui". */
64
61
  import: string;
65
62
  }
@@ -1,6 +1,5 @@
1
1
  import { highestMajor, isDirectory, isFile, posix as posix$1 } from "../paths.mjs";
2
2
  import { isRecord } from "../shared/checks.mjs";
3
- import { INTERFACE_ICONS } from "../shared/icon-sets.mjs";
4
3
  import { createRequire } from "node:module";
5
4
  import { existsSync, readFileSync, readdirSync } from "node:fs";
6
5
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -345,13 +344,11 @@ function readComponentsJson(dir, root) {
345
344
  const exported = exportedFolder(alias, root);
346
345
  const folder = resolveAlias(alias, dir) ?? exported ?? join(dir, "components", "ui");
347
346
  const css = stringAt(objectAt(config, "tailwind"), "css");
348
- const iconLibrary = stringAt(config, "iconLibrary");
349
347
  return {
350
348
  file,
351
349
  folder,
352
350
  import: dir === root || exported === resolve(folder) ? alias : importBaseFor(folder, root) ?? alias,
353
351
  css: css ? join(dir, css) : void 0,
354
- icons: INTERFACE_ICONS.find((set) => set === iconLibrary),
355
352
  baseUi: String(config.style ?? "").startsWith("base-")
356
353
  };
357
354
  }
@@ -215,11 +215,6 @@ export declare const configSchema: z.ZodObject<{
215
215
  "studio-presence": "studio-presence";
216
216
  }> & core.$partial, z.ZodString>>;
217
217
  components: z.ZodOptional<z.ZodString>;
218
- icons: z.ZodOptional<z.ZodEnum<{
219
- phosphor: "phosphor";
220
- lucide: "lucide";
221
- hugeicons: "hugeicons";
222
- }>>;
223
218
  locale: z.ZodOptional<z.ZodString>;
224
219
  primitives: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<true>]>>;
225
220
  subtitle: z.ZodOptional<z.ZodString>;