@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
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # Dreamboard CLI
2
+
3
+ Dreamboard CLI supports three main workflows:
4
+
5
+ - Authoring: `dreamboard sync`, `dreamboard compile`, `dreamboard pull`
6
+ - Interactive verification: `dreamboard dev`
7
+ - Scripted verification: `dreamboard test generate`, `dreamboard test run`
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g dreamboard
13
+ dreamboard login
14
+ ```
15
+
16
+ ## Create a game
17
+
18
+ ```bash
19
+ dreamboard new my-game --description "A short game description"
20
+ cd my-game
21
+ ```
22
+
23
+ ## Iterate
24
+
25
+ ```bash
26
+ dreamboard sync
27
+ dreamboard compile
28
+ dreamboard dev
29
+ ```
30
+
31
+ `dreamboard dev` starts the local iframe host for the current project while gameplay continues on the backend.
32
+
33
+ ## Test
34
+
35
+ ```bash
36
+ dreamboard test generate
37
+ dreamboard test run
38
+ dreamboard test run --scenario test/scenarios/example.scenario.ts
39
+ ```
40
+
41
+ Scenario assertions must use the projection-only API from `test/testing-types.ts`:
42
+
43
+ - `players()`
44
+ - `state()`
45
+ - `view(playerId)`
46
+ - `expect`
47
+
48
+ ## Scaffold ownership
49
+
50
+ Framework-owned static scaffold files are restored by `dreamboard sync`. Generated projects no longer expose wire-format message typings.
@@ -0,0 +1,227 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ assertCompilerPortableDependencies,
4
+ consola,
5
+ resolveProjectContext
6
+ } from "./chunk-RJBLBYHX.mjs";
7
+ import "./chunk-HJFQDSTU.mjs";
8
+ import "./chunk-2NZNKIND.mjs";
9
+ import "./chunk-2E5P5NWG.mjs";
10
+ import "./chunk-MINCYHXN.mjs";
11
+ import "./chunk-LM3OZLZG.mjs";
12
+ import "./chunk-SHUMAVAP.mjs";
13
+ import "./chunk-XYDL7GY6.mjs";
14
+
15
+ // src/agent-workspace-verifier.ts
16
+ import { readFile } from "fs/promises";
17
+ main().catch((error) => {
18
+ console.error(error instanceof Error ? error.message : String(error));
19
+ process.exit(1);
20
+ });
21
+ async function main() {
22
+ const [command, ...args] = process.argv.slice(2);
23
+ if (command === "--help" || command === "help") {
24
+ printHelp();
25
+ return;
26
+ }
27
+ if (command === "materialize-prepared-workspace") {
28
+ if (args.includes("--help")) {
29
+ printHelp();
30
+ return;
31
+ }
32
+ await materializePreparedWorkspace(args);
33
+ return;
34
+ }
35
+ await verifyAgentWorkspace(command ?? "verify", args);
36
+ }
37
+ function printHelp() {
38
+ console.log(`Dreamboard agent workspace verifier
39
+
40
+ Usage:
41
+ agent-workspace-verifier materialize-prepared-workspace --input <path>
42
+ agent-workspace-verifier preflight [--env local|dev|prod]
43
+ agent-workspace-verifier verify [--env local|dev|prod]
44
+ agent-workspace-verifier fin [--env local|dev|prod]
45
+ `);
46
+ }
47
+ async function materializePreparedWorkspace(args) {
48
+ const inputPath = readRequiredOption(args, "--input");
49
+ const input = JSON.parse(await readFile(inputPath, "utf8"));
50
+ const { materializeWorkspaceProject } = await import("./materialize-workspace-EWGZIVOY.mjs");
51
+ await materializeWorkspaceProject({
52
+ ...input,
53
+ agentManaged: true,
54
+ workspacePrepared: true,
55
+ allowCreateGame: false,
56
+ installDependencies: false
57
+ });
58
+ consola.success(`Prepared workspace in ${input.targetDir}`);
59
+ }
60
+ async function verifyAgentWorkspace(rawMode, args) {
61
+ const requestedMode = parseVerificationMode(rawMode);
62
+ const parsedFlags = parseConfigArgs(args);
63
+ const { projectRoot, projectConfig, config } = await resolveProjectContext(parsedFlags);
64
+ await assertCompilerPortableDependencies({ projectRoot, projectConfig });
65
+ if (requestedMode === "preflight") {
66
+ consola.success("Agent workspace preflight passed.");
67
+ return;
68
+ }
69
+ if (process.env.DREAMBOARD_AGENT_FINAL_SYNC_VERIFY === "1") {
70
+ await runFullBackendConnectedVerification(parsedFlags);
71
+ return;
72
+ }
73
+ if (requestedMode === "cloud-local" || requestedMode === "verify" || requestedMode === "fin") {
74
+ await runCloudLocalVerification(projectRoot, projectConfig, config);
75
+ return;
76
+ }
77
+ throw new Error(
78
+ "Agent workspaces now run cloud-local verification directly. Use `fin` only through the generated wrapper."
79
+ );
80
+ }
81
+ async function runFullBackendConnectedVerification(parsedFlags) {
82
+ const [{ default: cmdSync }, { default: cmdCompile }, { default: cmdTest }] = await Promise.all([
83
+ import("./sync-LOQAH4RC.mjs"),
84
+ import("./compile-WNCQQVOF.mjs"),
85
+ import("./test-YOJERVHN.mjs")
86
+ ]);
87
+ await runCommandDefinition(cmdSync, { ...parsedFlags, force: true });
88
+ await runCommandDefinition(cmdCompile, parsedFlags);
89
+ await runCommandDefinition(
90
+ resolveTestSubCommand(cmdTest, "generate"),
91
+ parsedFlags
92
+ );
93
+ await runCommandDefinition(
94
+ resolveTestSubCommand(cmdTest, "run"),
95
+ parsedFlags
96
+ );
97
+ }
98
+ async function runCommandDefinition(command, args) {
99
+ if (!command.run) {
100
+ throw new Error("Verifier command is missing a runnable step.");
101
+ }
102
+ await command.run({ args, rawArgs: [], cmd: command });
103
+ }
104
+ function resolveTestSubCommand(cmdTest, name) {
105
+ const subCommands = cmdTest.subCommands;
106
+ const command = subCommands?.[name];
107
+ if (!command) {
108
+ throw new Error(`Verifier command is missing test ${name}.`);
109
+ }
110
+ return command;
111
+ }
112
+ function parseVerificationMode(value) {
113
+ if (value === "preflight" || value === "verify" || value === "fin" || value === "cloud-local") {
114
+ return value;
115
+ }
116
+ throw new Error(
117
+ `Expected mode to be one of preflight, verify, fin, or cloud-local. Received: ${String(value)}`
118
+ );
119
+ }
120
+ function parseConfigArgs(args) {
121
+ const flags = {};
122
+ for (let index = 0; index < args.length; index += 1) {
123
+ const arg = args[index];
124
+ if (arg === "--env") {
125
+ const value = args[++index];
126
+ if (value === "local" || value === "staging" || value === "prod") {
127
+ flags.env = value;
128
+ continue;
129
+ }
130
+ throw new Error(`Invalid --env value: ${String(value)}`);
131
+ }
132
+ if (arg === "--token") {
133
+ flags.token = args[++index];
134
+ continue;
135
+ }
136
+ if (arg === "--skip-install") {
137
+ continue;
138
+ }
139
+ throw new Error(`Unknown verifier argument: ${arg}`);
140
+ }
141
+ return flags;
142
+ }
143
+ async function runCloudLocalVerification(projectRoot, projectConfig, config) {
144
+ const [
145
+ { scaffoldStaticWorkspace },
146
+ { loadManifest },
147
+ { applyWorkspaceCodegen },
148
+ { reconcileWorkspaceDependencies },
149
+ { assertReducerContractPreflight },
150
+ { getProjectLocalMaintainerRegistry }
151
+ ] = await Promise.all([
152
+ import("./static-scaffold-4YEQME5N.mjs"),
153
+ import("./local-files-MTPLP62S.mjs"),
154
+ import("./workspace-codegen-JDZJRSDV.mjs"),
155
+ import("./workspace-dependencies-HZ6VVS4G.mjs"),
156
+ import("./reducer-contract-preflight-22X7DSZW.mjs"),
157
+ import("./project-state-7GR6BQTQ.mjs")
158
+ ]);
159
+ consola.start("Refreshing static scaffold...");
160
+ await scaffoldStaticWorkspace(projectRoot, "update", {
161
+ localMaintainerRegistry: getProjectLocalMaintainerRegistry(projectConfig)
162
+ });
163
+ consola.start("Applying workspace codegen...");
164
+ const manifest = await loadManifest(projectRoot);
165
+ await applyWorkspaceCodegen({ projectRoot, manifest });
166
+ consola.start("Reconciling workspace dependencies...");
167
+ await reconcileWorkspaceDependencies(projectRoot);
168
+ consola.start("Validating reducer contract...");
169
+ await assertReducerContractPreflight(projectRoot);
170
+ const [{ runLocalTypecheck }, { assertReducerBundleSmoke }] = await Promise.all([
171
+ import("./local-typecheck-QFYYAZOK.mjs"),
172
+ import("./reducer-bundle-preflight-C73LEXI2.mjs")
173
+ ]);
174
+ consola.start("Running local typecheck...");
175
+ const typecheckResult = await runLocalTypecheck(projectRoot);
176
+ if (typecheckResult.skipped) {
177
+ if (typecheckResult.output) consola.warn(typecheckResult.output);
178
+ } else if (!typecheckResult.success) {
179
+ if (typecheckResult.output) consola.error(typecheckResult.output);
180
+ throw new Error(
181
+ "Local typecheck failed. Fix the diagnostics before syncing."
182
+ );
183
+ }
184
+ consola.start("Smoke-testing reducer bundle...");
185
+ await assertReducerBundleSmoke({ projectRoot, manifest });
186
+ const {
187
+ generateReducerNativeArtifacts,
188
+ isReducerNativeTestingWorkspace,
189
+ runReducerNativeScenarios
190
+ } = await import("./reducer-native-test-harness-GMWBUISX.mjs");
191
+ if (await isReducerNativeTestingWorkspace(projectRoot)) {
192
+ const { bases } = await generateReducerNativeArtifacts({
193
+ projectRoot,
194
+ gameId: projectConfig.gameId,
195
+ compiledResultId: projectConfig.compile?.latestSuccessful?.resultId
196
+ });
197
+ const summary = await runReducerNativeScenarios({
198
+ projectRoot,
199
+ projectConfig,
200
+ resolvedConfig: config,
201
+ runner: "reducer",
202
+ gameId: projectConfig.gameId,
203
+ compiledResultId: projectConfig.compile?.latestSuccessful?.resultId
204
+ });
205
+ if (summary.failed > 0) {
206
+ const failures = summary.results.filter((result) => !result.success).map(
207
+ (result) => result.error ? `FAIL ${result.id}: ${result.error}` : `FAIL ${result.id}`
208
+ );
209
+ throw new Error(
210
+ [
211
+ `Reducer-native verification failed: ${summary.failed} failed, ${summary.passed} passed.`,
212
+ ...failures
213
+ ].join("\n")
214
+ );
215
+ }
216
+ consola.success(`Generated ${bases.length} reducer-native base state(s).`);
217
+ }
218
+ consola.success("Agent workspace cloud-local verification passed.");
219
+ }
220
+ function readRequiredOption(args, name) {
221
+ const index = args.indexOf(name);
222
+ const value = index >= 0 ? args[index + 1] : void 0;
223
+ if (!value) {
224
+ throw new Error(`${name} is required.`);
225
+ }
226
+ return value;
227
+ }