dreamboard 0.1.21 → 0.1.23

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 (186) hide show
  1. package/dist/{chunk-EYYWGWTO.js → chunk-2RCUHMGL.js} +343 -1911
  2. package/dist/chunk-2RCUHMGL.js.map +1 -0
  3. package/dist/{chunk-MOVHYB6E.js → chunk-GN7232BY.js} +1025 -695
  4. package/dist/chunk-GN7232BY.js.map +1 -0
  5. package/dist/{chunk-BMYC6772.js → chunk-H3O43F5P.js} +9765 -3068
  6. package/dist/chunk-H3O43F5P.js.map +1 -0
  7. package/dist/dev-host/dev-api-proxy-plugin.ts +330 -0
  8. package/dist/dev-host/dev-diagnostics.ts +62 -0
  9. package/dist/dev-host/dev-fallback-stylesheet.ts +50 -0
  10. package/dist/dev-host/dev-host-controller.ts +686 -0
  11. package/dist/dev-host/dev-host-player-query.ts +17 -0
  12. package/dist/dev-host/dev-host-session-transport.ts +52 -0
  13. package/dist/dev-host/dev-host-storage.ts +56 -0
  14. package/dist/dev-host/dev-log-relay-plugin.ts +469 -0
  15. package/dist/dev-host/dev-runtime-config.ts +14 -0
  16. package/dist/dev-host/dev-runtime-platform.ts +419 -0
  17. package/dist/dev-host/dev-virtual-modules-plugin.ts +63 -0
  18. package/dist/dev-host/host-main.css +182 -0
  19. package/dist/dev-host/host-main.tsx +754 -0
  20. package/dist/dev-host/index.html +56 -0
  21. package/dist/dev-host/plugin-main.ts +55 -0
  22. package/dist/dev-host/plugin.html +24 -0
  23. package/dist/dev-host/start-dev-server.ts +138 -0
  24. package/dist/dev-host/virtual-modules.d.ts +27 -0
  25. package/dist/dist-FEPN3BDN.js +16543 -0
  26. package/dist/dist-FEPN3BDN.js.map +1 -0
  27. package/dist/{dist-WJRJNFLI.js → dist-FRURQI7Q.js} +4 -2
  28. package/dist/index.js +3 -3
  29. package/dist/internal.js +159 -124
  30. package/dist/internal.js.map +1 -1
  31. package/dist/runtime-packages/tailwind-config/shared-styles.css +146 -0
  32. package/dist/runtime-packages/ui/src/components/.gitkeep +0 -0
  33. package/dist/runtime-packages/ui/src/components/accordion.tsx +66 -0
  34. package/dist/runtime-packages/ui/src/components/ai-elements/actions.tsx +65 -0
  35. package/dist/runtime-packages/ui/src/components/ai-elements/artifact.tsx +147 -0
  36. package/dist/runtime-packages/ui/src/components/ai-elements/branch.tsx +215 -0
  37. package/dist/runtime-packages/ui/src/components/ai-elements/canvas.tsx +22 -0
  38. package/dist/runtime-packages/ui/src/components/ai-elements/chain-of-thought.tsx +228 -0
  39. package/dist/runtime-packages/ui/src/components/ai-elements/code-block.tsx +179 -0
  40. package/dist/runtime-packages/ui/src/components/ai-elements/confirmation.tsx +158 -0
  41. package/dist/runtime-packages/ui/src/components/ai-elements/connection.tsx +28 -0
  42. package/dist/runtime-packages/ui/src/components/ai-elements/context.tsx +408 -0
  43. package/dist/runtime-packages/ui/src/components/ai-elements/controls.tsx +18 -0
  44. package/dist/runtime-packages/ui/src/components/ai-elements/conversation.tsx +97 -0
  45. package/dist/runtime-packages/ui/src/components/ai-elements/edge.tsx +140 -0
  46. package/dist/runtime-packages/ui/src/components/ai-elements/image.tsx +24 -0
  47. package/dist/runtime-packages/ui/src/components/ai-elements/inline-citation.tsx +287 -0
  48. package/dist/runtime-packages/ui/src/components/ai-elements/loader.tsx +96 -0
  49. package/dist/runtime-packages/ui/src/components/ai-elements/message.tsx +463 -0
  50. package/dist/runtime-packages/ui/src/components/ai-elements/node.tsx +71 -0
  51. package/dist/runtime-packages/ui/src/components/ai-elements/open-in-chat.tsx +365 -0
  52. package/dist/runtime-packages/ui/src/components/ai-elements/panel.tsx +15 -0
  53. package/dist/runtime-packages/ui/src/components/ai-elements/plan.tsx +142 -0
  54. package/dist/runtime-packages/ui/src/components/ai-elements/prompt-input.tsx +1380 -0
  55. package/dist/runtime-packages/ui/src/components/ai-elements/queue.tsx +274 -0
  56. package/dist/runtime-packages/ui/src/components/ai-elements/reasoning.tsx +182 -0
  57. package/dist/runtime-packages/ui/src/components/ai-elements/response.tsx +22 -0
  58. package/dist/runtime-packages/ui/src/components/ai-elements/shimmer.tsx +64 -0
  59. package/dist/runtime-packages/ui/src/components/ai-elements/sources.tsx +77 -0
  60. package/dist/runtime-packages/ui/src/components/ai-elements/suggestion.tsx +53 -0
  61. package/dist/runtime-packages/ui/src/components/ai-elements/task.tsx +87 -0
  62. package/dist/runtime-packages/ui/src/components/ai-elements/tool.tsx +165 -0
  63. package/dist/runtime-packages/ui/src/components/ai-elements/toolbar.tsx +16 -0
  64. package/dist/runtime-packages/ui/src/components/ai-elements/web-preview.tsx +263 -0
  65. package/dist/runtime-packages/ui/src/components/alert-dialog.tsx +157 -0
  66. package/dist/runtime-packages/ui/src/components/alert.tsx +66 -0
  67. package/dist/runtime-packages/ui/src/components/avatar.tsx +53 -0
  68. package/dist/runtime-packages/ui/src/components/badge.tsx +46 -0
  69. package/dist/runtime-packages/ui/src/components/button-group.tsx +83 -0
  70. package/dist/runtime-packages/ui/src/components/button.tsx +65 -0
  71. package/dist/runtime-packages/ui/src/components/card.tsx +92 -0
  72. package/dist/runtime-packages/ui/src/components/carousel.tsx +241 -0
  73. package/dist/runtime-packages/ui/src/components/collapsible.tsx +33 -0
  74. package/dist/runtime-packages/ui/src/components/command.tsx +184 -0
  75. package/dist/runtime-packages/ui/src/components/context-menu.tsx +252 -0
  76. package/dist/runtime-packages/ui/src/components/counter.tsx +11 -0
  77. package/dist/runtime-packages/ui/src/components/dialog.tsx +146 -0
  78. package/dist/runtime-packages/ui/src/components/drawer.tsx +132 -0
  79. package/dist/runtime-packages/ui/src/components/dropdown-menu.tsx +257 -0
  80. package/dist/runtime-packages/ui/src/components/form.tsx +168 -0
  81. package/dist/runtime-packages/ui/src/components/header.tsx +13 -0
  82. package/dist/runtime-packages/ui/src/components/hover-card.tsx +44 -0
  83. package/dist/runtime-packages/ui/src/components/input-group.tsx +178 -0
  84. package/dist/runtime-packages/ui/src/components/input.tsx +21 -0
  85. package/dist/runtime-packages/ui/src/components/item.tsx +193 -0
  86. package/dist/runtime-packages/ui/src/components/label.tsx +24 -0
  87. package/dist/runtime-packages/ui/src/components/navigation-menu.tsx +168 -0
  88. package/dist/runtime-packages/ui/src/components/popover.tsx +55 -0
  89. package/dist/runtime-packages/ui/src/components/progress.tsx +31 -0
  90. package/dist/runtime-packages/ui/src/components/radio-group.tsx +45 -0
  91. package/dist/runtime-packages/ui/src/components/resizable.tsx +56 -0
  92. package/dist/runtime-packages/ui/src/components/scroll-area.tsx +58 -0
  93. package/dist/runtime-packages/ui/src/components/select.tsx +187 -0
  94. package/dist/runtime-packages/ui/src/components/separator.tsx +28 -0
  95. package/dist/runtime-packages/ui/src/components/skeleton.tsx +13 -0
  96. package/dist/runtime-packages/ui/src/components/sonner.tsx +25 -0
  97. package/dist/runtime-packages/ui/src/components/spinner.tsx +16 -0
  98. package/dist/runtime-packages/ui/src/components/switch.tsx +31 -0
  99. package/dist/runtime-packages/ui/src/components/table.tsx +137 -0
  100. package/dist/runtime-packages/ui/src/components/tabs.tsx +74 -0
  101. package/dist/runtime-packages/ui/src/components/textarea.tsx +23 -0
  102. package/dist/runtime-packages/ui/src/components/theme-provider.tsx +73 -0
  103. package/dist/runtime-packages/ui/src/components/tooltip.tsx +61 -0
  104. package/dist/runtime-packages/ui/src/components/ui/file-upload.tsx +195 -0
  105. package/dist/runtime-packages/ui/src/hooks/.gitkeep +0 -0
  106. package/dist/runtime-packages/ui/src/index.ts +68 -0
  107. package/dist/runtime-packages/ui/src/lib/utils.ts +6 -0
  108. package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +68 -0
  109. package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +359 -0
  110. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +274 -0
  111. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +214 -0
  112. package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +135 -0
  113. package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +5 -0
  114. package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +194 -0
  115. package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +1 -0
  116. package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +1 -0
  117. package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +162 -0
  118. package/dist/runtime-packages/ui-host-runtime/src/index.ts +2 -0
  119. package/dist/runtime-packages/ui-host-runtime/src/logger.ts +11 -0
  120. package/dist/runtime-packages/ui-host-runtime/src/perf.ts +253 -0
  121. package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +195 -0
  122. package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +138 -0
  123. package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +159 -0
  124. package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +524 -0
  125. package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +12 -0
  126. package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +122 -0
  127. package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +26 -0
  128. package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +477 -0
  129. package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +209 -0
  130. package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +112 -0
  131. package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +318 -0
  132. package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +211 -0
  133. package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +814 -0
  134. package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +334 -0
  135. package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +180 -0
  136. package/dist/scaffold/assets/static/app/tsconfig.framework.json +3 -1
  137. package/dist/scaffold/assets/static/ui/tsconfig.framework.json +7 -19
  138. package/package.json +52 -17
  139. package/skills/dreamboard/SKILL.md +41 -75
  140. package/LICENSE +0 -89
  141. package/NOTICE +0 -1
  142. package/dist/chunk-BMYC6772.js.map +0 -1
  143. package/dist/chunk-EYYWGWTO.js.map +0 -1
  144. package/dist/chunk-MOVHYB6E.js.map +0 -1
  145. package/dist/scaffold/assets/static/ui/App.tsx +0 -22
  146. package/dist/src-CUL7EGGG.js +0 -634
  147. package/dist/src-CUL7EGGG.js.map +0 -1
  148. package/skills/dreamboard/references/authoring-lifecycle.md +0 -102
  149. package/skills/dreamboard/references/board-surfaces.md +0 -36
  150. package/skills/dreamboard/references/board-topology.md +0 -443
  151. package/skills/dreamboard/references/boards-and-topology.md +0 -100
  152. package/skills/dreamboard/references/card-actions.md +0 -107
  153. package/skills/dreamboard/references/cli.md +0 -120
  154. package/skills/dreamboard/references/core-concepts.md +0 -514
  155. package/skills/dreamboard/references/custom-renderers.md +0 -26
  156. package/skills/dreamboard/references/derived-values.md +0 -55
  157. package/skills/dreamboard/references/effects.md +0 -111
  158. package/skills/dreamboard/references/game-contract.md +0 -89
  159. package/skills/dreamboard/references/game-definition.md +0 -89
  160. package/skills/dreamboard/references/game-shell.md +0 -80
  161. package/skills/dreamboard/references/hand-surfaces.md +0 -33
  162. package/skills/dreamboard/references/index.md +0 -112
  163. package/skills/dreamboard/references/inputs-and-targets.md +0 -160
  164. package/skills/dreamboard/references/interactions.md +0 -158
  165. package/skills/dreamboard/references/manifest-fields.md +0 -137
  166. package/skills/dreamboard/references/manifest.md +0 -81
  167. package/skills/dreamboard/references/package-surfaces.md +0 -69
  168. package/skills/dreamboard/references/phases.md +0 -145
  169. package/skills/dreamboard/references/prompts-and-choices.md +0 -55
  170. package/skills/dreamboard/references/quickstart.md +0 -71
  171. package/skills/dreamboard/references/rule-authoring.md +0 -144
  172. package/skills/dreamboard/references/setup-bootstrap.md +0 -78
  173. package/skills/dreamboard/references/stages-and-zones.md +0 -59
  174. package/skills/dreamboard/references/static-views.md +0 -67
  175. package/skills/dreamboard/references/table-queries-and-ops.md +0 -103
  176. package/skills/dreamboard/references/testing-bases.md +0 -147
  177. package/skills/dreamboard/references/testing-generated-contracts.md +0 -142
  178. package/skills/dreamboard/references/testing-runtime-assertions.md +0 -124
  179. package/skills/dreamboard/references/testing-scenarios.md +0 -148
  180. package/skills/dreamboard/references/testing-ui-tests.md +0 -174
  181. package/skills/dreamboard/references/testing.md +0 -161
  182. package/skills/dreamboard/references/ui-architecture.md +0 -137
  183. package/skills/dreamboard/references/ui-components.md +0 -34
  184. package/skills/dreamboard/references/views.md +0 -72
  185. package/skills/dreamboard/references/workspace-layout.md +0 -136
  186. /package/dist/{dist-WJRJNFLI.js.map → dist-FRURQI7Q.js.map} +0 -0
@@ -0,0 +1,419 @@
1
+ import { createRequire } from "node:module";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { existsSync } from "node:fs";
5
+ import type { Alias, ServerOptions } from "vite";
6
+ import { resolveDevDiagnosticsLevel } from "./dev-diagnostics.js";
7
+
8
+ export interface DevRuntimePlatformOptions {
9
+ importMetaUrl: string;
10
+ projectRoot: string;
11
+ debug: boolean;
12
+ port?: number;
13
+ host?: string | boolean;
14
+ allowedHosts?: string[];
15
+ tailwindCssEntry: string;
16
+ }
17
+
18
+ export interface DevRuntimePlatform {
19
+ devHostRoot: string;
20
+ repoRoot: string;
21
+ cliRoot: string;
22
+ diagnosticsLevel: ReturnType<typeof resolveDevDiagnosticsLevel>;
23
+ viteLogLevel: "info" | "warn";
24
+ serverConfig: ServerOptions;
25
+ resolveDedupe: string[];
26
+ resolveAlias: Alias[];
27
+ optimizeDepsExclude: string[];
28
+ }
29
+
30
+ export function createDevRuntimePlatform(
31
+ options: DevRuntimePlatformOptions,
32
+ ): DevRuntimePlatform {
33
+ const devHostRoot = resolveDevHostRoot(options.importMetaUrl);
34
+ const cliRoot = resolveCliRoot(options.importMetaUrl);
35
+ const repoRoot = resolveRepoRoot(cliRoot);
36
+ const require = createRequire(options.importMetaUrl);
37
+ const diagnosticsLevel = resolveDevDiagnosticsLevel(options.debug);
38
+ const uiSdkRoot = resolvePackageRoot(
39
+ require,
40
+ cliRoot,
41
+ "@dreamboard/ui-sdk",
42
+ "@dreamboard-games/ui-sdk",
43
+ "packages/ui-sdk",
44
+ );
45
+ const apiClientClientGen = resolvePackageSubpath(
46
+ require,
47
+ "@dreamboard/api-client/client.gen",
48
+ "@dreamboard-games/api-client/client.gen",
49
+ );
50
+ const uiHostRuntimeRoot = resolveWorkspaceOrPackagedSource(
51
+ repoRoot,
52
+ cliRoot,
53
+ "packages/ui-host-runtime",
54
+ "dist/runtime-packages/ui-host-runtime",
55
+ );
56
+ const uiRoot = resolveWorkspaceOrPackagedSource(
57
+ repoRoot,
58
+ cliRoot,
59
+ "packages/ui",
60
+ "dist/runtime-packages/ui",
61
+ );
62
+ const tailwindConfigRoot = resolveWorkspaceOrPackagedSource(
63
+ repoRoot,
64
+ cliRoot,
65
+ "packages/tailwind-config",
66
+ "dist/runtime-packages/tailwind-config",
67
+ );
68
+
69
+ return {
70
+ devHostRoot,
71
+ repoRoot,
72
+ cliRoot,
73
+ diagnosticsLevel,
74
+ viteLogLevel: diagnosticsLevel === "verbose" ? "info" : "warn",
75
+ serverConfig: {
76
+ host: options.host ?? "localhost",
77
+ allowedHosts: options.allowedHosts,
78
+ port: options.port ?? 5352,
79
+ strictPort: false,
80
+ watch: {
81
+ ignored: createProjectOnlyWatchIgnored(options.projectRoot),
82
+ },
83
+ headers: {
84
+ "Access-Control-Allow-Origin": "*",
85
+ "Access-Control-Allow-Methods": "GET, OPTIONS",
86
+ },
87
+ fs: {
88
+ allow: [options.projectRoot, repoRoot],
89
+ },
90
+ },
91
+ resolveDedupe: [
92
+ "react",
93
+ "react-dom",
94
+ "@dreamboard/ui-sdk",
95
+ "@dreamboard/sdk-types",
96
+ ],
97
+ resolveAlias: [
98
+ {
99
+ find: /^react$/,
100
+ replacement: resolveCliDependency(
101
+ require,
102
+ cliRoot,
103
+ "react",
104
+ "node_modules/react/index.js",
105
+ ),
106
+ },
107
+ {
108
+ find: /^react\/jsx-runtime$/,
109
+ replacement: resolveCliDependency(
110
+ require,
111
+ cliRoot,
112
+ "react/jsx-runtime",
113
+ "node_modules/react/jsx-runtime.js",
114
+ ),
115
+ },
116
+ {
117
+ find: /^react\/jsx-dev-runtime$/,
118
+ replacement: resolveCliDependency(
119
+ require,
120
+ cliRoot,
121
+ "react/jsx-dev-runtime",
122
+ "node_modules/react/jsx-dev-runtime.js",
123
+ ),
124
+ },
125
+ {
126
+ find: /^react-dom$/,
127
+ replacement: resolveCliDependency(
128
+ require,
129
+ cliRoot,
130
+ "react-dom",
131
+ "node_modules/react-dom/index.js",
132
+ ),
133
+ },
134
+ {
135
+ find: /^react-dom\/client$/,
136
+ replacement: resolveCliDependency(
137
+ require,
138
+ cliRoot,
139
+ "react-dom/client",
140
+ "node_modules/react-dom/client.js",
141
+ ),
142
+ },
143
+ {
144
+ find: /^@dreamboard\/ui-sdk$/,
145
+ replacement: path.resolve(uiSdkRoot, "src/index.ts"),
146
+ },
147
+ {
148
+ find: /^@dreamboard\/ui-sdk\/reducer$/,
149
+ replacement: path.resolve(uiSdkRoot, "src/reducer.ts"),
150
+ },
151
+ {
152
+ // Must resolve to the same source tree as the `@dreamboard/ui-sdk`
153
+ // alias. If this subpath falls through to `node_modules/.../dist` it
154
+ // creates a second RuntimeContext identity, and consumers calling
155
+ // `useRuntimeContext` on the workspace-source copy will never find
156
+ // the provider that's set up via the dist copy (and vice versa).
157
+ find: /^@dreamboard\/ui-sdk\/components$/,
158
+ replacement: path.resolve(uiSdkRoot, "src/components/index.ts"),
159
+ },
160
+ {
161
+ // Keep generated workspace adapters and legacy internal imports on the
162
+ // same source instance as PluginRuntime so React context identity stays
163
+ // shared in dev.
164
+ find: /^@dreamboard\/ui-sdk\/internal$/,
165
+ replacement: path.resolve(uiSdkRoot, "src/internal.ts"),
166
+ },
167
+ {
168
+ find: /^@dreamboard\/ui-sdk\/workspace-contract$/,
169
+ replacement: path.resolve(uiSdkRoot, "src/workspace-contract.ts"),
170
+ },
171
+ {
172
+ find: /^@dreamboard\/ui-sdk\/internal\/runtime-context$/,
173
+ replacement: path.resolve(
174
+ uiSdkRoot,
175
+ "src/context/RuntimeContext.tsx",
176
+ ),
177
+ },
178
+ {
179
+ find: /^@dreamboard\/ui-sdk\/internal\/usePluginRuntime$/,
180
+ replacement: path.resolve(
181
+ uiSdkRoot,
182
+ "src/hooks/usePluginRuntime.ts",
183
+ ),
184
+ },
185
+ {
186
+ find: /^@dreamboard\/ui-sdk\/internal\/createPluginRuntimeAPI$/,
187
+ replacement: path.resolve(
188
+ uiSdkRoot,
189
+ "src/runtime/createPluginRuntimeAPI.ts",
190
+ ),
191
+ },
192
+ {
193
+ find: /^@dreamboard\/ui-sdk\/internal\/useHandLayout$/,
194
+ replacement: path.resolve(uiSdkRoot, "src/hooks/useHandLayout.ts"),
195
+ },
196
+ {
197
+ find: /^@dreamboard\/ui-sdk\/internal\/usePanZoom$/,
198
+ replacement: path.resolve(uiSdkRoot, "src/hooks/usePanZoom.ts"),
199
+ },
200
+ {
201
+ find: /^@dreamboard\/ui-sdk\/internal\/useIsMobile$/,
202
+ replacement: path.resolve(uiSdkRoot, "src/hooks/useIsMobile.ts"),
203
+ },
204
+ {
205
+ find: /^@dreamboard\/ui-sdk\/internal\/player-state$/,
206
+ replacement: path.resolve(
207
+ uiSdkRoot,
208
+ "src/types/player-state.ts",
209
+ ),
210
+ },
211
+ {
212
+ find: /^@dreamboard\/ui-sdk\/internal\/tiled-board$/,
213
+ replacement: path.resolve(
214
+ uiSdkRoot,
215
+ "src/types/tiled-board.ts",
216
+ ),
217
+ },
218
+ {
219
+ find: /^@dreamboard\/ui-sdk\/internal\/plugin-state$/,
220
+ replacement: path.resolve(
221
+ uiSdkRoot,
222
+ "src/types/plugin-state.ts",
223
+ ),
224
+ },
225
+ {
226
+ find: /^@dreamboard\/ui-sdk\/types\/runtime-api$/,
227
+ replacement: path.resolve(
228
+ uiSdkRoot,
229
+ "src/types/runtime-api.ts",
230
+ ),
231
+ },
232
+ {
233
+ find: /^@dreamboard\/ui-host-runtime\/components$/,
234
+ replacement: path.resolve(uiHostRuntimeRoot, "src/components/index.ts"),
235
+ },
236
+ {
237
+ find: /^@dreamboard\/ui-host-runtime\/runtime$/,
238
+ replacement: path.resolve(uiHostRuntimeRoot, "src/runtime/index.ts"),
239
+ },
240
+ {
241
+ find: /^@dreamboard\/ui\/components\/(.*)$/,
242
+ replacement: path.resolve(uiRoot, "src/components/$1.tsx"),
243
+ },
244
+ {
245
+ find: /^@dreamboard\/ui\/lib\/(.*)$/,
246
+ replacement: path.resolve(uiRoot, "src/lib/$1.ts"),
247
+ },
248
+ {
249
+ find: /^@dreamboard\/tailwind-config$/,
250
+ replacement: path.resolve(tailwindConfigRoot, "shared-styles.css"),
251
+ },
252
+ {
253
+ find: /^@dreamboard\/manifest-contract$/,
254
+ replacement: path.resolve(
255
+ options.projectRoot,
256
+ "shared/manifest-contract.ts",
257
+ ),
258
+ },
259
+ {
260
+ find: /^@dreamboard\/ui-contract$/,
261
+ replacement: path.resolve(
262
+ options.projectRoot,
263
+ "shared/generated/ui-contract.ts",
264
+ ),
265
+ },
266
+ {
267
+ find: /^@dreamboard\/ui-sdk\/plugin-styles\.css$/,
268
+ replacement: resolveCliDependency(
269
+ require,
270
+ cliRoot,
271
+ "@dreamboard/ui-sdk/plugin-styles.css",
272
+ "packages/ui-sdk/src/plugin-styles.css",
273
+ ),
274
+ },
275
+ {
276
+ find: /^@dreamboard\/api-client\/client\.gen$/,
277
+ replacement: apiClientClientGen,
278
+ },
279
+ {
280
+ find: /^@shared\/(.*)$/,
281
+ replacement: path.resolve(options.projectRoot, "shared/$1"),
282
+ },
283
+ {
284
+ find: /^tailwindcss$/,
285
+ replacement: options.tailwindCssEntry,
286
+ },
287
+ ],
288
+ // Author SDKs are resolved from the project, not the CLI root. Let Vite
289
+ // transform them fresh so its CLI-scoped dependency cache cannot pin an
290
+ // older local snapshot after `dreamboard sync`.
291
+ optimizeDepsExclude: [
292
+ "@dreamboard/ui-sdk",
293
+ "@dreamboard/ui-sdk/workspace-contract",
294
+ "@dreamboard/app-sdk",
295
+ "@dreamboard/app-sdk/reducer",
296
+ "@dreamboard/sdk-types",
297
+ ],
298
+ };
299
+ }
300
+
301
+ function createProjectOnlyWatchIgnored(
302
+ projectRoot: string,
303
+ ): (file: string) => boolean {
304
+ const normalizedProjectRoot = path.resolve(projectRoot);
305
+
306
+ return (file) => {
307
+ const normalizedFile = path.resolve(file);
308
+ const relativePath = path.relative(normalizedProjectRoot, normalizedFile);
309
+ const isInsideProject =
310
+ relativePath === "" ||
311
+ (relativePath.length > 0 &&
312
+ !relativePath.startsWith("..") &&
313
+ !path.isAbsolute(relativePath));
314
+
315
+ if (!isInsideProject) {
316
+ return true;
317
+ }
318
+
319
+ const pathSegments = relativePath.split(path.sep);
320
+ return (
321
+ pathSegments.includes(".dreamboard") ||
322
+ pathSegments.includes("node_modules")
323
+ );
324
+ };
325
+ }
326
+
327
+ function resolveWorkspaceOrPackagedSource(
328
+ repoRoot: string,
329
+ cliRoot: string,
330
+ workspaceRelativePath: string,
331
+ packagedRelativePath: string,
332
+ ): string {
333
+ const workspacePath = path.resolve(repoRoot, workspaceRelativePath);
334
+ if (existsSync(workspacePath)) return workspacePath;
335
+ return path.resolve(cliRoot, packagedRelativePath);
336
+ }
337
+
338
+ function resolvePackageRoot(
339
+ require: NodeJS.Require,
340
+ cliRoot: string,
341
+ specifier: string,
342
+ publicSpecifier: string,
343
+ fallbackRelativePath: string,
344
+ ): string {
345
+ try {
346
+ return path.dirname(require.resolve(`${specifier}/package.json`));
347
+ } catch {
348
+ try {
349
+ return path.dirname(require.resolve(`${publicSpecifier}/package.json`));
350
+ } catch {
351
+ return path.resolve(cliRoot, "..", "..", fallbackRelativePath);
352
+ }
353
+ }
354
+ }
355
+
356
+ function resolvePackageSubpath(
357
+ require: NodeJS.Require,
358
+ specifier: string,
359
+ publicSpecifier: string,
360
+ ): string {
361
+ try {
362
+ return require.resolve(specifier);
363
+ } catch {
364
+ return require.resolve(publicSpecifier);
365
+ }
366
+ }
367
+
368
+ function resolveCliDependency(
369
+ require: NodeJS.Require,
370
+ cliRoot: string,
371
+ specifier: string,
372
+ fallbackRelativePath: string,
373
+ ): string {
374
+ try {
375
+ return require.resolve(specifier);
376
+ } catch {
377
+ return path.resolve(cliRoot, fallbackRelativePath);
378
+ }
379
+ }
380
+
381
+ function resolveDevHostRoot(importMetaUrl: string): string {
382
+ const currentDir = path.dirname(fileURLToPath(importMetaUrl));
383
+ const packagedDirCandidate = path.resolve(currentDir, "dev-host");
384
+ if (existsSync(packagedDirCandidate)) return packagedDirCandidate;
385
+ const sourceDirCandidate = path.resolve(currentDir, "../src/dev-host");
386
+ return existsSync(sourceDirCandidate) ? sourceDirCandidate : currentDir;
387
+ }
388
+
389
+ function resolveCliRoot(importMetaUrl: string): string {
390
+ let currentDir = path.dirname(fileURLToPath(importMetaUrl));
391
+
392
+ while (true) {
393
+ if (existsSync(path.join(currentDir, "package.json"))) {
394
+ return currentDir;
395
+ }
396
+
397
+ const parentDir = path.dirname(currentDir);
398
+ if (parentDir === currentDir) {
399
+ return path.resolve(resolveDevHostRoot(importMetaUrl), "../..");
400
+ }
401
+ currentDir = parentDir;
402
+ }
403
+ }
404
+
405
+ function resolveRepoRoot(cliRoot: string): string {
406
+ let currentDir = cliRoot;
407
+
408
+ while (true) {
409
+ if (existsSync(path.join(currentDir, "pnpm-workspace.yaml"))) {
410
+ return currentDir;
411
+ }
412
+
413
+ const parentDir = path.dirname(currentDir);
414
+ if (parentDir === currentDir) {
415
+ return cliRoot;
416
+ }
417
+ currentDir = parentDir;
418
+ }
419
+ }
@@ -0,0 +1,63 @@
1
+ import path from "node:path";
2
+ import { normalizePath, type Plugin } from "vite";
3
+ import type { DreamboardDevRuntimeConfig } from "./dev-runtime-config.js";
4
+
5
+ export function createVirtualDevModulesPlugin(options: {
6
+ projectRoot: string;
7
+ runtimeConfig: DreamboardDevRuntimeConfig;
8
+ generatedFallbackStylesheetPath: string | null;
9
+ }): Plugin {
10
+ const configModuleId = "virtual:dreamboard-dev-config";
11
+ const resolvedConfigModuleId = `\0${configModuleId}`;
12
+ const projectEntryModuleId = "virtual:dreamboard-project-entry";
13
+ const resolvedProjectEntryModuleId = `\0${projectEntryModuleId}`;
14
+ const projectAppPath = path.resolve(options.projectRoot, "ui/App.tsx");
15
+ const projectStylePath = path.resolve(options.projectRoot, "ui/style.css");
16
+
17
+ return {
18
+ name: "dreamboard-dev-virtual-modules",
19
+ resolveId(id) {
20
+ if (id === configModuleId) {
21
+ return resolvedConfigModuleId;
22
+ }
23
+ if (id === projectEntryModuleId) {
24
+ return resolvedProjectEntryModuleId;
25
+ }
26
+ return null;
27
+ },
28
+ load(id) {
29
+ if (id === resolvedConfigModuleId) {
30
+ return `export const devConfig = ${JSON.stringify(options.runtimeConfig)};\nexport default devConfig;\n`;
31
+ }
32
+ if (id === resolvedProjectEntryModuleId) {
33
+ const fallbackImport = options.generatedFallbackStylesheetPath
34
+ ? `import "/@fs/${normalizePath(options.generatedFallbackStylesheetPath)}";\n`
35
+ : "";
36
+ return `${fallbackImport}import { createElement } from "react";
37
+ import { createRoot } from "react-dom/client";
38
+ import { ErrorBoundary, PluginRuntime } from "@dreamboard/ui-sdk";
39
+ import "/@fs/${normalizePath(projectStylePath)}";
40
+ import App from "/@fs/${normalizePath(projectAppPath)}";
41
+
42
+ const rootElement = document.getElementById("root");
43
+ if (!rootElement) {
44
+ throw new Error("Dreamboard dev plugin root element was not found.");
45
+ }
46
+
47
+ createRoot(rootElement).render(
48
+ createElement(
49
+ ErrorBoundary,
50
+ null,
51
+ createElement(
52
+ PluginRuntime,
53
+ null,
54
+ createElement(App),
55
+ ),
56
+ ),
57
+ );
58
+ `;
59
+ }
60
+ return null;
61
+ },
62
+ };
63
+ }
@@ -0,0 +1,182 @@
1
+ @import "@dreamboard/tailwind-config";
2
+ @import url("https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Patrick+Hand&display=swap");
3
+
4
+ :root {
5
+ color-scheme: light;
6
+ --background: oklch(0.985 0.005 85);
7
+ --foreground: oklch(0.25 0 0);
8
+ --card: oklch(0.985 0.005 85);
9
+ --card-foreground: oklch(0.25 0 0);
10
+ --popover: oklch(0.985 0.005 85);
11
+ --popover-foreground: oklch(0.25 0 0);
12
+ --primary: oklch(0.6 0.2 25);
13
+ --primary-foreground: oklch(1 0 0);
14
+ --secondary: oklch(0.92 0.01 85);
15
+ --secondary-foreground: oklch(0.25 0 0);
16
+ --muted: oklch(0.92 0.01 85);
17
+ --muted-foreground: oklch(0.5 0 0);
18
+ --accent: oklch(0.97 0.05 100);
19
+ --accent-foreground: oklch(0.25 0 0);
20
+ --destructive: oklch(0.6 0.2 25);
21
+ --destructive-foreground: oklch(1 0 0);
22
+ --border: oklch(0.25 0 0);
23
+ --input: oklch(0.25 0 0);
24
+ --ring: oklch(0.45 0.15 250);
25
+ --radius: 0.75rem;
26
+ --font-display: "Kalam", cursive;
27
+ --font-sans: "Patrick Hand", cursive;
28
+ }
29
+
30
+ html,
31
+ body,
32
+ #app {
33
+ height: 100%;
34
+ min-height: 100%;
35
+ margin: 0;
36
+ }
37
+
38
+ body {
39
+ min-height: 100vh;
40
+ background-color: #f5f1e7;
41
+ background-image:
42
+ radial-gradient(
43
+ circle at top left,
44
+ rgba(255, 255, 255, 0.9),
45
+ transparent 40%
46
+ ),
47
+ radial-gradient(#dcd5c9 1px, transparent 1px);
48
+ background-size: 100% 100%, 24px 24px;
49
+ background-attachment: fixed, fixed;
50
+ color: #1f2937;
51
+ font-family: var(--font-sans);
52
+ }
53
+
54
+ #app {
55
+ display: block;
56
+ }
57
+
58
+ #app > * {
59
+ min-height: 100%;
60
+ }
61
+
62
+ h1,
63
+ h2,
64
+ h3,
65
+ h4,
66
+ h5,
67
+ h6 {
68
+ font-family: var(--font-display);
69
+ font-weight: 700;
70
+ }
71
+
72
+ .wobbly-border {
73
+ border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
74
+ }
75
+
76
+ .wobbly-border-md {
77
+ border-radius: 25px 8px 25px 8px / 8px 25px 8px 25px;
78
+ }
79
+
80
+ .wobbly-border-lg {
81
+ border-radius: 45px 15px 45px 15px / 15px 45px 15px 45px;
82
+ }
83
+
84
+ .hard-shadow {
85
+ box-shadow: 4px 4px 0 0 #2d2d2d;
86
+ }
87
+
88
+ .hard-shadow-lg {
89
+ box-shadow: 8px 8px 0 0 #2d2d2d;
90
+ }
91
+
92
+ .dev-drawer-content {
93
+ background-color: rgba(247, 239, 220, 0.96);
94
+ color: #1f2937;
95
+ }
96
+
97
+ .dev-drawer-surface {
98
+ background-image:
99
+ linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08)),
100
+ radial-gradient(rgba(80, 58, 34, 0.09) 1px, transparent 1px);
101
+ background-size: 100% 100%, 18px 18px;
102
+ color: #1f2937;
103
+ }
104
+
105
+ .dev-drawer-header {
106
+ background-color: rgba(255, 252, 244, 0.96);
107
+ color: #1f2937;
108
+ }
109
+
110
+ .dev-drawer-label {
111
+ background-color: #e5e0d8;
112
+ color: #6b5a45;
113
+ }
114
+
115
+ .dev-drawer-session-pill {
116
+ background-color: #fff3b5;
117
+ color: #1f2937;
118
+ }
119
+
120
+ .dev-drawer-session-dot {
121
+ background-color: #d97706;
122
+ }
123
+
124
+ .dev-drawer-close {
125
+ background-color: #fff;
126
+ color: #6b7280;
127
+ }
128
+
129
+ .dev-drawer-close:hover {
130
+ background-color: #e5e0d8;
131
+ }
132
+
133
+ .dev-drawer-note {
134
+ background-color: rgba(255, 255, 255, 0.72);
135
+ color: rgba(31, 41, 55, 0.8);
136
+ }
137
+
138
+ .dev-drawer-card {
139
+ background-color: #fffdf7;
140
+ color: #1f2937;
141
+ }
142
+
143
+ .dev-drawer-card-title {
144
+ color: #7a6956;
145
+ }
146
+
147
+ .dev-drawer-controls-card {
148
+ background-color: #fff3b5;
149
+ color: #1f2937;
150
+ }
151
+
152
+ .dev-drawer-feedback-card {
153
+ background-color: #fffaf0;
154
+ color: #1f2937;
155
+ }
156
+
157
+ .dev-drawer-input {
158
+ background-color: #fff;
159
+ color: #1f2937;
160
+ }
161
+
162
+ .dev-drawer-primary-button {
163
+ background-color: #1f2937;
164
+ color: #fff8e8;
165
+ }
166
+
167
+ .dev-drawer-primary-button:hover {
168
+ background-color: #111827;
169
+ }
170
+
171
+ .dev-drawer-danger-button {
172
+ background-color: #ff4d4d;
173
+ color: #fff;
174
+ }
175
+
176
+ .dev-drawer-danger-button:hover {
177
+ background-color: #e60000;
178
+ }
179
+
180
+ .dev-drawer-toolbar-shell {
181
+ background-color: rgba(255, 255, 255, 0.72);
182
+ }