@dreamboard-games/cli 0.1.30-alpha.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 (134) hide show
  1. package/README.md +50 -0
  2. package/dist/agent-verifier/agent-workspace-verifier.mjs +227 -0
  3. package/dist/agent-verifier/chunk-2E5P5NWG.mjs +835 -0
  4. package/dist/agent-verifier/chunk-2GBBP27W.mjs +301 -0
  5. package/dist/agent-verifier/chunk-2NZNKIND.mjs +166 -0
  6. package/dist/agent-verifier/chunk-2QMNAVV4.mjs +14522 -0
  7. package/dist/agent-verifier/chunk-2SZHMP6F.mjs +264 -0
  8. package/dist/agent-verifier/chunk-54TAYXUD.mjs +12 -0
  9. package/dist/agent-verifier/chunk-6A5HRJMQ.mjs +3174 -0
  10. package/dist/agent-verifier/chunk-6UUJEYDV.mjs +213 -0
  11. package/dist/agent-verifier/chunk-7653FPGJ.mjs +381 -0
  12. package/dist/agent-verifier/chunk-BVVNBJM4.mjs +221 -0
  13. package/dist/agent-verifier/chunk-CEDUHGNH.mjs +74 -0
  14. package/dist/agent-verifier/chunk-CEQ2VJWN.mjs +149 -0
  15. package/dist/agent-verifier/chunk-CFU5EWIC.mjs +69 -0
  16. package/dist/agent-verifier/chunk-DTMJCPS4.mjs +730 -0
  17. package/dist/agent-verifier/chunk-EIQWDQWJ.mjs +186 -0
  18. package/dist/agent-verifier/chunk-EOQIV6PS.mjs +649 -0
  19. package/dist/agent-verifier/chunk-HBNDKQT5.mjs +8381 -0
  20. package/dist/agent-verifier/chunk-HJFQDSTU.mjs +225 -0
  21. package/dist/agent-verifier/chunk-LI3ZR3BI.mjs +41 -0
  22. package/dist/agent-verifier/chunk-LM3OZLZG.mjs +48 -0
  23. package/dist/agent-verifier/chunk-MINCYHXN.mjs +106 -0
  24. package/dist/agent-verifier/chunk-MRCUP5SW.mjs +128 -0
  25. package/dist/agent-verifier/chunk-PM3SVG6R.mjs +38 -0
  26. package/dist/agent-verifier/chunk-RBDDIIPM.mjs +19 -0
  27. package/dist/agent-verifier/chunk-RJBLBYHX.mjs +1681 -0
  28. package/dist/agent-verifier/chunk-SHUMAVAP.mjs +59 -0
  29. package/dist/agent-verifier/chunk-SYPLYRGB.mjs +2812 -0
  30. package/dist/agent-verifier/chunk-U6OJN7XS.mjs +8092 -0
  31. package/dist/agent-verifier/chunk-VYJTHSYR.mjs +44 -0
  32. package/dist/agent-verifier/chunk-XYDL7GY6.mjs +10 -0
  33. package/dist/agent-verifier/compile-WNCQQVOF.mjs +313 -0
  34. package/dist/agent-verifier/global-config-WX3ZZIVU.mjs +17 -0
  35. package/dist/agent-verifier/keychain-backend-TNOPQV3Z.mjs +134 -0
  36. package/dist/agent-verifier/local-files-MTPLP62S.mjs +46 -0
  37. package/dist/agent-verifier/local-typecheck-QFYYAZOK.mjs +9 -0
  38. package/dist/agent-verifier/materialize-workspace-EWGZIVOY.mjs +90 -0
  39. package/dist/agent-verifier/project-state-7GR6BQTQ.mjs +32 -0
  40. package/dist/agent-verifier/prompt-3BAINGAQ.mjs +755 -0
  41. package/dist/agent-verifier/reducer-bundle-preflight-C73LEXI2.mjs +23 -0
  42. package/dist/agent-verifier/reducer-contract-preflight-22X7DSZW.mjs +10 -0
  43. package/dist/agent-verifier/reducer-native-test-harness-GMWBUISX.mjs +53 -0
  44. package/dist/agent-verifier/static-scaffold-4YEQME5N.mjs +28 -0
  45. package/dist/agent-verifier/sync-LOQAH4RC.mjs +594 -0
  46. package/dist/agent-verifier/test-YOJERVHN.mjs +356 -0
  47. package/dist/agent-verifier/testing-5K2BJYF2.mjs +674 -0
  48. package/dist/agent-verifier/workspace-codegen-JDZJRSDV.mjs +11 -0
  49. package/dist/agent-verifier/workspace-dependencies-HZ6VVS4G.mjs +14 -0
  50. package/dist/chunk-2H7UOFLK.js +11 -0
  51. package/dist/chunk-2H7UOFLK.js.map +1 -0
  52. package/dist/chunk-3XNJT3RK.js +39809 -0
  53. package/dist/chunk-3XNJT3RK.js.map +1 -0
  54. package/dist/chunk-7FOO4AJI.js +50 -0
  55. package/dist/chunk-7FOO4AJI.js.map +1 -0
  56. package/dist/chunk-TSJVWTJO.js +430 -0
  57. package/dist/chunk-TSJVWTJO.js.map +1 -0
  58. package/dist/dev-host/components/drawer.tsx +132 -0
  59. package/dist/dev-host/components/input.tsx +21 -0
  60. package/dist/dev-host/dev-api-proxy-plugin.ts +328 -0
  61. package/dist/dev-host/dev-author-dom-warnings.ts +100 -0
  62. package/dist/dev-host/dev-diagnostics.ts +62 -0
  63. package/dist/dev-host/dev-fallback-stylesheet.ts +53 -0
  64. package/dist/dev-host/dev-hmr-guard-plugin.ts +47 -0
  65. package/dist/dev-host/dev-host-controller.ts +674 -0
  66. package/dist/dev-host/dev-host-player-query.ts +17 -0
  67. package/dist/dev-host/dev-host-session-transport.ts +52 -0
  68. package/dist/dev-host/dev-host-storage.ts +56 -0
  69. package/dist/dev-host/dev-log-relay-plugin.ts +510 -0
  70. package/dist/dev-host/dev-runtime-config.ts +14 -0
  71. package/dist/dev-host/dev-runtime-platform.ts +335 -0
  72. package/dist/dev-host/dev-virtual-modules-plugin.ts +64 -0
  73. package/dist/dev-host/host-main.css +224 -0
  74. package/dist/dev-host/host-main.tsx +948 -0
  75. package/dist/dev-host/index.html +56 -0
  76. package/dist/dev-host/lib/utils.ts +6 -0
  77. package/dist/dev-host/plugin-main.ts +61 -0
  78. package/dist/dev-host/plugin.html +24 -0
  79. package/dist/dev-host/shared-styles.css +144 -0
  80. package/dist/dev-host/start-dev-server.ts +140 -0
  81. package/dist/dev-host/virtual-modules.d.ts +27 -0
  82. package/dist/global-config-UKSWNDTX.js +15 -0
  83. package/dist/global-config-UKSWNDTX.js.map +1 -0
  84. package/dist/index.js +8473 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/internal.d.ts +311 -0
  87. package/dist/internal.js +52 -0
  88. package/dist/internal.js.map +1 -0
  89. package/dist/keychain-backend-JHTXAKWC.js +135 -0
  90. package/dist/keychain-backend-JHTXAKWC.js.map +1 -0
  91. package/dist/prompt-GMZABCJC.js +756 -0
  92. package/dist/prompt-GMZABCJC.js.map +1 -0
  93. package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +71 -0
  94. package/dist/runtime-packages/ui-host-runtime/src/browser-interaction.ts +139 -0
  95. package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +374 -0
  96. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +266 -0
  97. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +212 -0
  98. package/dist/runtime-packages/ui-host-runtime/src/components/host-primitives.tsx +271 -0
  99. package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +135 -0
  100. package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +5 -0
  101. package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +194 -0
  102. package/dist/runtime-packages/ui-host-runtime/src/gameplay-authority-transport.ts +626 -0
  103. package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +1 -0
  104. package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +1 -0
  105. package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +294 -0
  106. package/dist/runtime-packages/ui-host-runtime/src/index.ts +3 -0
  107. package/dist/runtime-packages/ui-host-runtime/src/logger.ts +11 -0
  108. package/dist/runtime-packages/ui-host-runtime/src/perf.ts +324 -0
  109. package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +195 -0
  110. package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +138 -0
  111. package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +159 -0
  112. package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +551 -0
  113. package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +13 -0
  114. package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +122 -0
  115. package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +26 -0
  116. package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +583 -0
  117. package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +219 -0
  118. package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +117 -0
  119. package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +431 -0
  120. package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +211 -0
  121. package/dist/runtime-packages/ui-host-runtime/src/session-recovery.ts +80 -0
  122. package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +1034 -0
  123. package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +416 -0
  124. package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +184 -0
  125. package/dist/scaffold/assets/static/app/tsconfig.framework.json +26 -0
  126. package/dist/scaffold/assets/static/app/tsconfig.json +3 -0
  127. package/dist/scaffold/assets/static/ui/index.tsx +13 -0
  128. package/dist/scaffold/assets/static/ui/style.css +4 -0
  129. package/dist/scaffold/assets/static/ui/tsconfig.framework.json +19 -0
  130. package/dist/scaffold/assets/static/ui/tsconfig.json +5 -0
  131. package/dist/testing-KLSV6CPJ.js +674 -0
  132. package/dist/testing-KLSV6CPJ.js.map +1 -0
  133. package/package.json +72 -0
  134. package/skills/dreamboard/SKILL.md +130 -0
@@ -0,0 +1,264 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ isPerPlayer,
4
+ perPlayerSchema
5
+ } from "./chunk-HBNDKQT5.mjs";
6
+ import {
7
+ importTypeScriptModule
8
+ } from "./chunk-CEDUHGNH.mjs";
9
+ import {
10
+ external_exports
11
+ } from "./chunk-2QMNAVV4.mjs";
12
+ import {
13
+ materializeManifestTable
14
+ } from "./chunk-U6OJN7XS.mjs";
15
+
16
+ // src/services/project/reducer-bundle-preflight.ts
17
+ import path from "path";
18
+ globalThis.__DREAMBOARD_AUTHORING_WARNINGS__ = true;
19
+ var REDUCER_BUNDLE_ENTRY_PATH = path.join("app", "index.ts");
20
+ var PREFLIGHT_RNG_SEED = 1337;
21
+ function buildPlayerIds(playerCount) {
22
+ const ids = [];
23
+ for (let index = 1; index <= playerCount; index += 1) {
24
+ ids.push(`player-${index}`);
25
+ }
26
+ return ids;
27
+ }
28
+ function buildScenarios(manifest) {
29
+ const rawCounts = [
30
+ manifest.players?.minPlayers,
31
+ manifest.players?.maxPlayers
32
+ ].filter(
33
+ (count) => typeof count === "number" && Number.isFinite(count) && count > 0
34
+ );
35
+ const playerCounts = Array.from(new Set(rawCounts));
36
+ if (playerCounts.length === 0) {
37
+ return [];
38
+ }
39
+ const profiles = manifest.setupProfiles ?? [];
40
+ const profileIds = profiles.length > 0 ? profiles.map((profile) => profile.id) : [null];
41
+ const scenarios = [];
42
+ const seen = /* @__PURE__ */ new Set();
43
+ for (const profileId of profileIds) {
44
+ for (const count of playerCounts) {
45
+ const key = `${profileId ?? "<default>"}:${count}`;
46
+ if (seen.has(key)) continue;
47
+ seen.add(key);
48
+ scenarios.push({ setupProfileId: profileId, playerCount: count });
49
+ }
50
+ }
51
+ return scenarios;
52
+ }
53
+ function describeScenario(scenario) {
54
+ const profileDesc = scenario.setupProfileId ? `setup profile '${scenario.setupProfileId}'` : "no setup profile";
55
+ return `${profileDesc}, ${scenario.playerCount} player${scenario.playerCount === 1 ? "" : "s"}`;
56
+ }
57
+ function summarizeError(error) {
58
+ if (error instanceof Error) {
59
+ const firstLine = error.message.split("\n").map((line) => line.trim()).find((line) => line.length > 0) ?? "Unknown failure";
60
+ const detail = error.stack && error.stack !== error.message ? error.stack : void 0;
61
+ return { headline: firstLine, detail };
62
+ }
63
+ return { headline: String(error ?? "Unknown failure") };
64
+ }
65
+ function assertViewPerPlayerSeatsValid(view, expectedPlayerIds, breadcrumb = []) {
66
+ if (view === null || view === void 0) {
67
+ return null;
68
+ }
69
+ if (isPerPlayer(view)) {
70
+ const schema = perPlayerSchema(external_exports.unknown(), {
71
+ players: expectedPlayerIds
72
+ });
73
+ const result = schema.safeParse(view);
74
+ if (!result.success) {
75
+ const firstIssue = result.error.issues[0];
76
+ const location = breadcrumb.length > 0 ? ` at view.${breadcrumb.join(".")}` : "";
77
+ const message = firstIssue?.message ?? "PerPlayer seat mismatch";
78
+ return `PerPlayer seat mismatch${location}: ${message}`;
79
+ }
80
+ return null;
81
+ }
82
+ if (Array.isArray(view)) {
83
+ for (let index = 0; index < view.length; index += 1) {
84
+ const result = assertViewPerPlayerSeatsValid(
85
+ view[index],
86
+ expectedPlayerIds,
87
+ [...breadcrumb, `[${index}]`]
88
+ );
89
+ if (result) return result;
90
+ }
91
+ return null;
92
+ }
93
+ if (typeof view === "object") {
94
+ for (const [key, value] of Object.entries(
95
+ view
96
+ )) {
97
+ const result = assertViewPerPlayerSeatsValid(value, expectedPlayerIds, [
98
+ ...breadcrumb,
99
+ key
100
+ ]);
101
+ if (result) return result;
102
+ }
103
+ return null;
104
+ }
105
+ return null;
106
+ }
107
+ function identityShuffle(values) {
108
+ return [...values];
109
+ }
110
+ async function driveReducerBundleThroughScenarios(options) {
111
+ const { manifest, bundle, scenarios } = options;
112
+ const rngSeed = options.rngSeed ?? PREFLIGHT_RNG_SEED;
113
+ const failures = [];
114
+ const tableCache = /* @__PURE__ */ new Map();
115
+ for (const scenario of scenarios) {
116
+ let tableEntry = tableCache.get(scenario.playerCount);
117
+ if (!tableEntry) {
118
+ try {
119
+ const playerIds2 = buildPlayerIds(scenario.playerCount);
120
+ const table2 = JSON.parse(
121
+ JSON.stringify(
122
+ materializeManifestTable({
123
+ manifest,
124
+ playerIds: playerIds2,
125
+ shuffleItems: identityShuffle
126
+ })
127
+ )
128
+ );
129
+ tableEntry = { table: table2, playerIds: playerIds2 };
130
+ } catch (error) {
131
+ tableEntry = { error };
132
+ }
133
+ tableCache.set(scenario.playerCount, tableEntry);
134
+ }
135
+ if ("error" in tableEntry) {
136
+ const summary = summarizeError(tableEntry.error);
137
+ failures.push({
138
+ scenario,
139
+ phase: "BUILD_GAME_STATE",
140
+ headline: summary.headline,
141
+ detail: summary.detail
142
+ });
143
+ continue;
144
+ }
145
+ const { table, playerIds } = tableEntry;
146
+ let sessionState;
147
+ try {
148
+ sessionState = await bundle.initialize({
149
+ table,
150
+ playerIds: [...playerIds],
151
+ rngSeed,
152
+ setup: scenario.setupProfileId ? { profileId: scenario.setupProfileId, optionValues: {} } : null
153
+ });
154
+ } catch (error) {
155
+ const summary = summarizeError(error);
156
+ failures.push({
157
+ scenario,
158
+ phase: "INITIALIZE",
159
+ headline: summary.headline,
160
+ detail: summary.detail
161
+ });
162
+ continue;
163
+ }
164
+ let projection;
165
+ try {
166
+ projection = bundle.projectSeatsDynamic({
167
+ state: sessionState,
168
+ playerIds: [...playerIds]
169
+ });
170
+ } catch (error) {
171
+ const summary = summarizeError(error);
172
+ failures.push({
173
+ scenario,
174
+ phase: "PROJECT_SEATS",
175
+ headline: summary.headline,
176
+ detail: summary.detail
177
+ });
178
+ continue;
179
+ }
180
+ const seats = projection?.seats ?? {};
181
+ for (const playerId of playerIds) {
182
+ const seat = seats[playerId];
183
+ if (!seat) {
184
+ failures.push({
185
+ scenario,
186
+ phase: "PROJECT_SEATS",
187
+ playerId,
188
+ headline: `projectSeatsDynamic() did not return an entry for seat '${playerId}'.`
189
+ });
190
+ continue;
191
+ }
192
+ const mismatch = assertViewPerPlayerSeatsValid(seat.view, playerIds);
193
+ if (mismatch) {
194
+ failures.push({
195
+ scenario,
196
+ phase: "VALIDATE_VIEW",
197
+ playerId,
198
+ headline: mismatch
199
+ });
200
+ }
201
+ }
202
+ }
203
+ return failures;
204
+ }
205
+ async function runReducerBundleSmoke(options) {
206
+ const { projectRoot, manifest } = options;
207
+ const scenarios = buildScenarios(manifest);
208
+ if (scenarios.length === 0) {
209
+ return [];
210
+ }
211
+ const entryPath = path.join(projectRoot, REDUCER_BUNDLE_ENTRY_PATH);
212
+ let module;
213
+ try {
214
+ module = await importTypeScriptModule(
215
+ entryPath
216
+ );
217
+ } catch (error) {
218
+ const summary = summarizeError(error);
219
+ throw new Error(
220
+ [
221
+ `Dreamboard could not import \`${REDUCER_BUNDLE_ENTRY_PATH}\` during \`dreamboard sync\`.`,
222
+ "Fix the reducer bundle entry so it can be imported locally, then run `dreamboard sync` again.",
223
+ `Original error: ${summary.headline}`
224
+ ].join(" ")
225
+ );
226
+ }
227
+ const bundle = module.default;
228
+ if (!bundle || typeof bundle.initialize !== "function") {
229
+ throw new Error(
230
+ [
231
+ `\`${REDUCER_BUNDLE_ENTRY_PATH}\` does not export a reducer bundle as its default export.`,
232
+ "Export `createReducerBundle(game)` from `app/index.ts` so the compile pipeline can smoke-test it."
233
+ ].join(" ")
234
+ );
235
+ }
236
+ return driveReducerBundleThroughScenarios({ manifest, bundle, scenarios });
237
+ }
238
+ function formatFailureLines(failures) {
239
+ return failures.map((failure) => {
240
+ const location = failure.playerId ? ` (seat ${failure.playerId})` : "";
241
+ return `\u2022 [${failure.phase}] ${describeScenario(failure.scenario)}${location}: ${failure.headline}`;
242
+ }).join("\n");
243
+ }
244
+ async function assertReducerBundleSmoke(options) {
245
+ const failures = await runReducerBundleSmoke(options);
246
+ if (failures.length === 0) {
247
+ return;
248
+ }
249
+ throw new Error(
250
+ [
251
+ "Reducer bundle preflight failed during `dreamboard sync`.",
252
+ "Fix the reported scenarios locally before syncing so the backend does not catch them after start-game:",
253
+ formatFailureLines(failures)
254
+ ].join("\n")
255
+ );
256
+ }
257
+
258
+ export {
259
+ buildScenarios,
260
+ assertViewPerPlayerSeatsValid,
261
+ driveReducerBundleThroughScenarios,
262
+ runReducerBundleSmoke,
263
+ assertReducerBundleSmoke
264
+ };
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ../../node_modules/.pnpm/@dreamboard-games+sdk@0.4.0-alpha.0_@types+react-dom@19.2.3_@types+react@19.2.17__@type_b74cbe125b074769500a56e94fa7f664/node_modules/@dreamboard-games/sdk/dist/chunk-PZ5AY32C.js
4
+ var __defProp = Object.defineProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+
10
+ export {
11
+ __export
12
+ };