@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,44 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ importTypeScriptModule
4
+ } from "./chunk-CEDUHGNH.mjs";
5
+
6
+ // src/services/project/reducer-contract-preflight.ts
7
+ import path from "path";
8
+ var GAME_CONTRACT_ENTRY_PATH = path.join("app", "game-contract.ts");
9
+ function normalizeErrorMessage(error) {
10
+ const rawMessage = error instanceof Error ? error.message : String(error ?? "Unknown error");
11
+ return rawMessage.split("\n").map((line) => line.trim()).find(Boolean)?.replace(/^Error:\s*/u, "") ?? "Unknown error";
12
+ }
13
+ function isManifestScopedIdBrandingError(message) {
14
+ return message.includes("defineGameContract:") && message.includes("manifest-scoped") && (message.includes("uses a raw z.string()") || message.includes("uses z.array(z.string())"));
15
+ }
16
+ async function assertReducerContractPreflight(projectRoot) {
17
+ const entryPath = path.join(projectRoot, GAME_CONTRACT_ENTRY_PATH);
18
+ try {
19
+ await importTypeScriptModule(entryPath);
20
+ } catch (error) {
21
+ const message = normalizeErrorMessage(error);
22
+ if (isManifestScopedIdBrandingError(message)) {
23
+ throw new Error(
24
+ [
25
+ `Dreamboard could not validate \`${GAME_CONTRACT_ENTRY_PATH}\` during \`dreamboard sync\`.`,
26
+ "This happens because a state field name looks like a manifest-scoped id, but the schema uses a plain string instead of the manifest-backed id schema.",
27
+ "Workaround: use `gameContract.schemas.<id>` (or `manifest.ids.<id>`) for manifest ids. If the field is intentionally free-form text, rename it so it does not look like a manifest id field.",
28
+ `Original error: ${message}`
29
+ ].join(" ")
30
+ );
31
+ }
32
+ throw new Error(
33
+ [
34
+ `Dreamboard could not validate \`${GAME_CONTRACT_ENTRY_PATH}\` during \`dreamboard sync\`.`,
35
+ "Fix the authored reducer contract module so it can be imported locally, then run `dreamboard sync` again.",
36
+ `Original error: ${message}`
37
+ ].join(" ")
38
+ );
39
+ }
40
+ }
41
+
42
+ export {
43
+ assertReducerContractPreflight
44
+ };
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ export {
9
+ __export
10
+ };
@@ -0,0 +1,313 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ resolveRemoteProject
4
+ } from "./chunk-PM3SVG6R.mjs";
5
+ import {
6
+ CONFIG_FLAG_ARGS,
7
+ findProjectCompiledResultsForRevision,
8
+ parseCompileCommandArgs,
9
+ queueProjectRevisionCompileSdk,
10
+ waitForCompiledResultJobSdk
11
+ } from "./chunk-EOQIV6PS.mjs";
12
+ import {
13
+ formatCliError
14
+ } from "./chunk-BVVNBJM4.mjs";
15
+ import {
16
+ getProjectAuthoringState,
17
+ getProjectPendingAuthoringSync,
18
+ setLatestCompileAttempt
19
+ } from "./chunk-MRCUP5SW.mjs";
20
+ import {
21
+ runLocalTypecheck
22
+ } from "./chunk-CEQ2VJWN.mjs";
23
+ import {
24
+ assertCompilerPortableDependencies,
25
+ assertReleaseEnvironmentPortableDependencies,
26
+ consola,
27
+ resolveProjectContext
28
+ } from "./chunk-RJBLBYHX.mjs";
29
+ import "./chunk-HJFQDSTU.mjs";
30
+ import {
31
+ getLocalDiff
32
+ } from "./chunk-EIQWDQWJ.mjs";
33
+ import {
34
+ assertCliStaticScaffoldComplete
35
+ } from "./chunk-DTMJCPS4.mjs";
36
+ import "./chunk-2GBBP27W.mjs";
37
+ import {
38
+ updateProjectState
39
+ } from "./chunk-2NZNKIND.mjs";
40
+ import "./chunk-SYPLYRGB.mjs";
41
+ import "./chunk-2QMNAVV4.mjs";
42
+ import "./chunk-6UUJEYDV.mjs";
43
+ import "./chunk-2E5P5NWG.mjs";
44
+ import "./chunk-MINCYHXN.mjs";
45
+ import "./chunk-U6OJN7XS.mjs";
46
+ import "./chunk-54TAYXUD.mjs";
47
+ import "./chunk-LM3OZLZG.mjs";
48
+ import "./chunk-RBDDIIPM.mjs";
49
+ import "./chunk-SHUMAVAP.mjs";
50
+ import "./chunk-XYDL7GY6.mjs";
51
+
52
+ // src/commands/compile.ts
53
+ import { defineCommand } from "citty";
54
+ function formatDiagnosticsSummary(diagnostics) {
55
+ const firstMessage = diagnostics?.find(
56
+ (diagnostic) => diagnostic.message
57
+ )?.message;
58
+ return firstMessage?.trim() || void 0;
59
+ }
60
+ function formatCompileJobProgressMessage(job) {
61
+ const phase = job.phase ? ` [${job.phase}]` : "";
62
+ const detail = job.message ? ` ${job.message}` : "";
63
+ if (job.status === "PENDING") {
64
+ const queue = typeof job.queuePosition === "number" ? ` (queue ${job.queuePosition + 1})` : "";
65
+ return `Compile queued${queue}${phase}${detail}`.trim();
66
+ }
67
+ if (job.status === "RUNNING") {
68
+ return `Compile running${phase}${detail}`.trim();
69
+ }
70
+ if (job.status === "FAILED") {
71
+ return `Compile failed${phase}${detail}`.trim();
72
+ }
73
+ return `Compile ${job.status.toLowerCase()}${phase}${detail}`.trim();
74
+ }
75
+ function formatFailedCompileJobSummary(job) {
76
+ return formatCompileJobProgressMessage({
77
+ status: "FAILED",
78
+ phase: job.phase,
79
+ message: job.errorMessage ?? job.message ?? void 0
80
+ });
81
+ }
82
+ function formatFailedCompileJobWithCompiledResultMessage(options) {
83
+ return `${formatFailedCompileJobSummary(options.job)}. The backend created compiled result ${options.compiledResultId}, but the compile job did not complete cleanly. Run 'dreamboard compile' again after fixing the backend/compiler issue.`;
84
+ }
85
+ function formatRemoteCompileCommandError(options) {
86
+ const detail = options.message.trim();
87
+ const hasActionableTerminalContext = /^Compile\s+(failed|completed|cancelled|interrupted)\b/i.test(detail);
88
+ if (options.jobId) {
89
+ if (hasActionableTerminalContext) {
90
+ return `Remote compile job ${options.jobId} could not be completed. ${detail}`;
91
+ }
92
+ return `Remote compile job ${options.jobId} could not be completed. ${detail} Check backend health and try 'dreamboard compile' again.`;
93
+ }
94
+ return `Remote compile could not be started. ${detail} Check backend health and try 'dreamboard compile' again.`;
95
+ }
96
+ async function persistFailedCompileAttempt(options) {
97
+ const nextProjectConfig = setLatestCompileAttempt(options.projectConfig, {
98
+ resultId: void 0,
99
+ jobId: options.jobId,
100
+ revisionDigest: options.revisionDigest,
101
+ authoringStateId: options.authoringStateId ?? options.revisionDigest,
102
+ status: "failed",
103
+ diagnosticsSummary: options.diagnosticsSummary
104
+ });
105
+ await updateProjectState(options.projectRoot, nextProjectConfig);
106
+ }
107
+ var compile_default = defineCommand({
108
+ meta: {
109
+ name: "compile",
110
+ description: "Compile the current remote authoring head"
111
+ },
112
+ args: {
113
+ debug: {
114
+ type: "boolean",
115
+ description: "Print additional compile progress context",
116
+ default: false
117
+ },
118
+ "skip-local-check": {
119
+ type: "boolean",
120
+ description: "Skip the best-effort local typecheck before compiling",
121
+ default: false
122
+ },
123
+ ...CONFIG_FLAG_ARGS
124
+ },
125
+ async run({ args }) {
126
+ const parsedArgs = parseCompileCommandArgs(args);
127
+ const { projectRoot, projectConfig, config } = await resolveProjectContext(parsedArgs);
128
+ let nextProjectConfig = projectConfig;
129
+ await assertReleaseEnvironmentPortableDependencies({
130
+ projectRoot,
131
+ projectConfig: nextProjectConfig,
132
+ environment: config.environment
133
+ });
134
+ await assertCompilerPortableDependencies({
135
+ projectRoot,
136
+ projectConfig: nextProjectConfig
137
+ });
138
+ const diff = await getLocalDiff(projectRoot);
139
+ await assertCliStaticScaffoldComplete(projectRoot, diff.deleted);
140
+ if (diff.modified.length > 0 || diff.added.length > 0 || diff.deleted.length > 0) {
141
+ throw new Error(
142
+ "Local authored changes are not synced yet. Run 'dreamboard sync' before compiling."
143
+ );
144
+ }
145
+ const remoteProject = await resolveRemoteProject({
146
+ projectRoot,
147
+ projectConfig: nextProjectConfig,
148
+ config
149
+ });
150
+ nextProjectConfig = remoteProject.projectConfig;
151
+ const localAuthoring = getProjectAuthoringState(nextProjectConfig);
152
+ const pendingSync = getProjectPendingAuthoringSync(nextProjectConfig);
153
+ if (pendingSync) {
154
+ if (pendingSync.phase === "authoring_state_created") {
155
+ throw new Error(
156
+ "Previous sync reached the remote authored head, but local scaffold finalization did not complete. Run 'dreamboard sync' again before compiling."
157
+ );
158
+ }
159
+ throw new Error(
160
+ "Previous sync uploaded source changes but did not finish creating the authored head. Run 'dreamboard sync' again before compiling."
161
+ );
162
+ }
163
+ const localRevisionDigest = localAuthoring.revisionDigest ?? nextProjectConfig.remoteHeadDigest;
164
+ if (!localRevisionDigest) {
165
+ throw new Error(
166
+ "This workspace does not know its authored revision yet. Run 'dreamboard sync' first."
167
+ );
168
+ }
169
+ const remoteRevisionDigest = remoteProject.project.head?.revisionDigest;
170
+ if (!remoteRevisionDigest) {
171
+ throw new Error("Remote has no authored project revision to compile yet.");
172
+ }
173
+ if (remoteRevisionDigest !== localRevisionDigest) {
174
+ throw new Error(
175
+ `Remote project head is ${remoteRevisionDigest} but this workspace is based on ${localRevisionDigest}. Run 'dreamboard pull' before compiling.`
176
+ );
177
+ }
178
+ if (!parsedArgs["skip-local-check"]) {
179
+ consola.start("Running local typecheck...");
180
+ const typecheckResult = await runLocalTypecheck(projectRoot);
181
+ if (typecheckResult.skipped) {
182
+ if (typecheckResult.output) {
183
+ consola.warn(typecheckResult.output);
184
+ }
185
+ } else if (!typecheckResult.success) {
186
+ if (typecheckResult.output) {
187
+ consola.error(typecheckResult.output);
188
+ }
189
+ throw new Error(
190
+ "Local typecheck failed. Fix the diagnostics or re-run with --skip-local-check."
191
+ );
192
+ } else {
193
+ consola.success("Local typecheck passed.");
194
+ }
195
+ }
196
+ const existingCompiledResult = (await findProjectCompiledResultsForRevision({
197
+ projectId: nextProjectConfig.projectId,
198
+ revisionDigest: localRevisionDigest
199
+ })).find((result) => result.success);
200
+ if (existingCompiledResult) {
201
+ nextProjectConfig = setLatestCompileAttempt(nextProjectConfig, {
202
+ resultId: existingCompiledResult.id,
203
+ jobId: void 0,
204
+ revisionDigest: localRevisionDigest,
205
+ authoringStateId: existingCompiledResult.authoringStateId ?? localRevisionDigest,
206
+ status: "successful",
207
+ diagnosticsSummary: void 0
208
+ });
209
+ await updateProjectState(projectRoot, nextProjectConfig);
210
+ consola.success(
211
+ `Reusing compiled ${existingCompiledResult.id} for authored state ${existingCompiledResult.authoringStateId}.`
212
+ );
213
+ return;
214
+ }
215
+ let compileJobId;
216
+ let compileJobStatus;
217
+ let compileJobPhase;
218
+ let compileJobMessage;
219
+ let compileJobErrorMessage;
220
+ let compiledResult;
221
+ try {
222
+ const compileJob = await queueProjectRevisionCompileSdk({
223
+ projectId: nextProjectConfig.projectId,
224
+ revisionDigest: localRevisionDigest
225
+ });
226
+ compileJobId = compileJob.jobId;
227
+ if (!compileJobId) {
228
+ throw new Error("Failed to create compile job: missing jobId.");
229
+ }
230
+ ({
231
+ job: {
232
+ status: compileJobStatus,
233
+ phase: compileJobPhase,
234
+ message: compileJobMessage,
235
+ errorMessage: compileJobErrorMessage
236
+ },
237
+ compiledResult
238
+ } = await waitForCompiledResultJobSdk({
239
+ projectId: nextProjectConfig.projectId,
240
+ jobId: compileJobId,
241
+ onProgress: (job) => {
242
+ const message = formatCompileJobProgressMessage(job);
243
+ if (parsedArgs.debug) {
244
+ consola.info(message);
245
+ } else {
246
+ consola.start(message);
247
+ }
248
+ }
249
+ }));
250
+ } catch (error) {
251
+ const message = formatCliError(error);
252
+ if (compileJobId) {
253
+ await persistFailedCompileAttempt({
254
+ projectRoot,
255
+ projectConfig: nextProjectConfig,
256
+ revisionDigest: localRevisionDigest,
257
+ authoringStateId: localAuthoring.authoringStateId,
258
+ diagnosticsSummary: message,
259
+ jobId: compileJobId
260
+ });
261
+ }
262
+ throw new Error(
263
+ formatRemoteCompileCommandError({
264
+ message,
265
+ jobId: compileJobId
266
+ })
267
+ );
268
+ }
269
+ const failedJobProducedCompiledResult = compileJobStatus === "FAILED" && compiledResult.success;
270
+ const failedJobWithCompiledResultSummary = failedJobProducedCompiledResult ? formatFailedCompileJobSummary({
271
+ phase: compileJobPhase,
272
+ message: compileJobMessage,
273
+ errorMessage: compileJobErrorMessage
274
+ }) : void 0;
275
+ nextProjectConfig = setLatestCompileAttempt(nextProjectConfig, {
276
+ resultId: compiledResult.id,
277
+ jobId: compileJobId,
278
+ revisionDigest: localRevisionDigest,
279
+ authoringStateId: compiledResult.authoringStateId ?? localRevisionDigest,
280
+ status: compiledResult.success && !failedJobProducedCompiledResult ? "successful" : "failed",
281
+ diagnosticsSummary: failedJobWithCompiledResultSummary ?? formatDiagnosticsSummary(compiledResult.diagnostics)
282
+ });
283
+ await updateProjectState(projectRoot, nextProjectConfig);
284
+ if (failedJobProducedCompiledResult) {
285
+ throw new Error(
286
+ formatFailedCompileJobWithCompiledResultMessage({
287
+ compiledResultId: compiledResult.id,
288
+ job: {
289
+ phase: compileJobPhase,
290
+ message: compileJobMessage,
291
+ errorMessage: compileJobErrorMessage
292
+ }
293
+ })
294
+ );
295
+ }
296
+ if (!compiledResult.success) {
297
+ for (const diagnostic of compiledResult.diagnostics ?? []) {
298
+ if (diagnostic.message) {
299
+ consola.error(diagnostic.message);
300
+ }
301
+ }
302
+ throw new Error(
303
+ "Remote compile failed, but your authored state is synced. Fix the diagnostics and run 'dreamboard compile' again."
304
+ );
305
+ }
306
+ consola.success(
307
+ `Compiled ${compiledResult.id} for revision ${localRevisionDigest}.`
308
+ );
309
+ }
310
+ });
311
+ export {
312
+ compile_default as default
313
+ };
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ getGlobalAuthPath,
4
+ getGlobalConfigPath,
5
+ loadGlobalConfig,
6
+ saveGlobalConfig
7
+ } from "./chunk-HJFQDSTU.mjs";
8
+ import "./chunk-MINCYHXN.mjs";
9
+ import "./chunk-LM3OZLZG.mjs";
10
+ import "./chunk-SHUMAVAP.mjs";
11
+ import "./chunk-XYDL7GY6.mjs";
12
+ export {
13
+ getGlobalAuthPath,
14
+ getGlobalConfigPath,
15
+ loadGlobalConfig,
16
+ saveGlobalConfig
17
+ };
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env node
2
+ import "./chunk-XYDL7GY6.mjs";
3
+
4
+ // src/config/keychain-backend.ts
5
+ var KEYCHAIN_SERVICE = "dreamboard-cli";
6
+ var KEYCHAIN_ACCOUNT = "session";
7
+ var cachedModule;
8
+ async function loadKeyringModule() {
9
+ if (cachedModule !== void 0) return cachedModule;
10
+ try {
11
+ const mod = await import("@napi-rs/keyring");
12
+ cachedModule = mod;
13
+ } catch {
14
+ cachedModule = null;
15
+ }
16
+ return cachedModule;
17
+ }
18
+ function keychainProbe(entry) {
19
+ try {
20
+ entry.getPassword();
21
+ return true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+ function parsePayload(raw) {
27
+ if (raw === null || raw === void 0) return null;
28
+ const trimmed = raw.trim();
29
+ if (trimmed.length === 0) return null;
30
+ try {
31
+ const parsed = JSON.parse(trimmed);
32
+ if (!parsed.accessToken && !parsed.refreshToken) return null;
33
+ return {
34
+ accessToken: parsed.accessToken || void 0,
35
+ refreshToken: parsed.refreshToken || void 0,
36
+ tokenExpiresAt: parsed.tokenExpiresAt || void 0,
37
+ clerkOAuthIssuer: parsed.clerkOAuthIssuer || void 0,
38
+ clerkOAuthClientId: parsed.clerkOAuthClientId || void 0,
39
+ clerkOAuthTokenUrl: parsed.clerkOAuthTokenUrl || void 0,
40
+ environment: parsed.environment || void 0
41
+ };
42
+ } catch {
43
+ return null;
44
+ }
45
+ }
46
+ function writeFull(entry, creds) {
47
+ if (!creds.accessToken || !creds.refreshToken) {
48
+ throw new Error(
49
+ "Refusing to persist credentials with an empty accessToken or refreshToken."
50
+ );
51
+ }
52
+ const payload = {
53
+ accessToken: creds.accessToken,
54
+ refreshToken: creds.refreshToken,
55
+ tokenExpiresAt: creds.tokenExpiresAt,
56
+ clerkOAuthIssuer: creds.clerkOAuthIssuer,
57
+ clerkOAuthClientId: creds.clerkOAuthClientId,
58
+ clerkOAuthTokenUrl: creds.clerkOAuthTokenUrl,
59
+ environment: creds.environment
60
+ };
61
+ entry.setPassword(JSON.stringify(payload));
62
+ }
63
+ function writeAccessOnly(entry, accessToken) {
64
+ if (!accessToken) {
65
+ throw new Error("Refusing to persist an empty access token.");
66
+ }
67
+ const payload = { accessToken };
68
+ entry.setPassword(JSON.stringify(payload));
69
+ }
70
+ function clear(entry) {
71
+ try {
72
+ entry.deletePassword();
73
+ } catch {
74
+ }
75
+ }
76
+ async function tryKeychainBackend() {
77
+ const mod = await loadKeyringModule();
78
+ if (!mod) {
79
+ return {
80
+ available: false,
81
+ reason: "@napi-rs/keyring is not installed for this platform"
82
+ };
83
+ }
84
+ let entry;
85
+ try {
86
+ entry = new mod.Entry(KEYCHAIN_SERVICE, KEYCHAIN_ACCOUNT);
87
+ } catch (err) {
88
+ return {
89
+ available: false,
90
+ reason: `Failed to construct keyring entry: ${String(err.message ?? err)}`
91
+ };
92
+ }
93
+ if (!keychainProbe(entry)) {
94
+ return {
95
+ available: false,
96
+ reason: "OS keyring is not accessible from this process"
97
+ };
98
+ }
99
+ const backend = {
100
+ name: "keychain",
101
+ async read() {
102
+ try {
103
+ return parsePayload(entry.getPassword());
104
+ } catch (err) {
105
+ const message = String(err.message ?? err);
106
+ if (/no matching entry|not found/i.test(message)) {
107
+ return null;
108
+ }
109
+ throw err;
110
+ }
111
+ },
112
+ async writeFull(creds) {
113
+ writeFull(entry, creds);
114
+ },
115
+ async writeAccessOnly(accessToken) {
116
+ writeAccessOnly(entry, accessToken);
117
+ },
118
+ async clear() {
119
+ clear(entry);
120
+ }
121
+ };
122
+ return { available: true, backend };
123
+ }
124
+ function _setKeyringModuleForTests(mod) {
125
+ cachedModule = mod;
126
+ }
127
+ function _resetKeyringModuleForTests() {
128
+ cachedModule = void 0;
129
+ }
130
+ export {
131
+ _resetKeyringModuleForTests,
132
+ _setKeyringModuleForTests,
133
+ tryKeychainBackend
134
+ };
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ collectLocalFiles,
4
+ getLocalDiff,
5
+ isAllowedGamePath,
6
+ isLibraryPath,
7
+ loadManifest,
8
+ loadRule,
9
+ removeExtraneousFiles,
10
+ walkDir,
11
+ writeManifest,
12
+ writeRule,
13
+ writeScaffoldFiles,
14
+ writeSnapshot,
15
+ writeSnapshotFromFiles,
16
+ writeSourceFiles
17
+ } from "./chunk-EIQWDQWJ.mjs";
18
+ import {
19
+ computeManifestHash
20
+ } from "./chunk-SYPLYRGB.mjs";
21
+ import "./chunk-2QMNAVV4.mjs";
22
+ import "./chunk-6UUJEYDV.mjs";
23
+ import "./chunk-2E5P5NWG.mjs";
24
+ import "./chunk-MINCYHXN.mjs";
25
+ import "./chunk-U6OJN7XS.mjs";
26
+ import "./chunk-54TAYXUD.mjs";
27
+ import "./chunk-LM3OZLZG.mjs";
28
+ import "./chunk-SHUMAVAP.mjs";
29
+ import "./chunk-XYDL7GY6.mjs";
30
+ export {
31
+ collectLocalFiles,
32
+ computeManifestHash,
33
+ getLocalDiff,
34
+ isAllowedGamePath,
35
+ isLibraryPath,
36
+ loadManifest,
37
+ loadRule,
38
+ removeExtraneousFiles,
39
+ walkDir,
40
+ writeManifest,
41
+ writeRule,
42
+ writeScaffoldFiles,
43
+ writeSnapshot,
44
+ writeSnapshotFromFiles,
45
+ writeSourceFiles
46
+ };
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ runLocalTypecheck
4
+ } from "./chunk-CEQ2VJWN.mjs";
5
+ import "./chunk-SHUMAVAP.mjs";
6
+ import "./chunk-XYDL7GY6.mjs";
7
+ export {
8
+ runLocalTypecheck
9
+ };
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ updateProjectAuthoringState,
4
+ updateProjectLocalMaintainerRegistry
5
+ } from "./chunk-MRCUP5SW.mjs";
6
+ import {
7
+ writeManifest,
8
+ writeRule,
9
+ writeSnapshot
10
+ } from "./chunk-EIQWDQWJ.mjs";
11
+ import {
12
+ scaffoldStaticWorkspace
13
+ } from "./chunk-DTMJCPS4.mjs";
14
+ import "./chunk-2GBBP27W.mjs";
15
+ import {
16
+ updateProjectState
17
+ } from "./chunk-2NZNKIND.mjs";
18
+ import "./chunk-SYPLYRGB.mjs";
19
+ import "./chunk-2QMNAVV4.mjs";
20
+ import "./chunk-6UUJEYDV.mjs";
21
+ import "./chunk-2E5P5NWG.mjs";
22
+ import "./chunk-MINCYHXN.mjs";
23
+ import {
24
+ applyWorkspaceCodegen
25
+ } from "./chunk-CFU5EWIC.mjs";
26
+ import "./chunk-U6OJN7XS.mjs";
27
+ import "./chunk-54TAYXUD.mjs";
28
+ import {
29
+ ensureDir
30
+ } from "./chunk-LM3OZLZG.mjs";
31
+ import {
32
+ installWorkspaceDependencies
33
+ } from "./chunk-7653FPGJ.mjs";
34
+ import "./chunk-RBDDIIPM.mjs";
35
+ import "./chunk-SHUMAVAP.mjs";
36
+ import "./chunk-XYDL7GY6.mjs";
37
+
38
+ // src/services/project/materialize-workspace.ts
39
+ import path from "path";
40
+ async function materializeWorkspaceProject(input) {
41
+ const targetDir = path.resolve(input.targetDir);
42
+ await ensureDir(targetDir);
43
+ await writeManifest(targetDir, input.manifest);
44
+ await writeRule(targetDir, input.ruleText);
45
+ await scaffoldStaticWorkspace(targetDir, "new", {
46
+ localMaintainerRegistry: input.localMaintainerRegistry
47
+ });
48
+ await applyWorkspaceCodegen({
49
+ projectRoot: targetDir,
50
+ manifest: input.manifest
51
+ });
52
+ if (input.installDependencies ?? true) {
53
+ await installWorkspaceDependencies(targetDir);
54
+ }
55
+ const authoringConfig = input.ruleId && input.manifestId && input.manifestContentHash ? updateProjectAuthoringState(baseProjectConfig(input), {
56
+ ruleId: input.ruleId,
57
+ manifestId: input.manifestId,
58
+ manifestContentHash: input.manifestContentHash
59
+ }) : baseProjectConfig(input);
60
+ const projectConfig = updateProjectLocalMaintainerRegistry(
61
+ authoringConfig,
62
+ input.localMaintainerRegistry ?? void 0
63
+ );
64
+ await updateProjectState(targetDir, projectConfig);
65
+ await writeSnapshot(targetDir);
66
+ return projectConfig;
67
+ }
68
+ function baseProjectConfig(input) {
69
+ return {
70
+ schemaVersion: 2,
71
+ projectId: input.projectId ?? input.gameId,
72
+ gameId: input.gameId,
73
+ deploymentId: input.deploymentId ?? "legacy",
74
+ ownerScopeId: input.ownerScopeId ?? "default",
75
+ bindingKey: input.bindingKey,
76
+ remoteHeadDigest: input.remoteHeadDigest,
77
+ slug: input.slug,
78
+ jobId: input.jobId,
79
+ agentManaged: input.agentManaged,
80
+ workspacePrepared: input.workspacePrepared,
81
+ allowCreateGame: input.allowCreateGame,
82
+ apiBaseUrl: input.apiBaseUrl,
83
+ webBaseUrl: input.webBaseUrl,
84
+ packageManifest: input.packageManifest,
85
+ environmentManifest: input.environmentManifest
86
+ };
87
+ }
88
+ export {
89
+ materializeWorkspaceProject
90
+ };
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ clearProjectCompileState,
4
+ clearProjectPendingAuthoringSync,
5
+ finalizeProjectPendingAuthoringSync,
6
+ getProjectAuthoringState,
7
+ getProjectCompileState,
8
+ getProjectLocalMaintainerRegistry,
9
+ getProjectPendingAuthoringSync,
10
+ sanitizeProjectLocalMaintainerRegistry,
11
+ setLatestCompileAttempt,
12
+ setProjectPendingAuthoringSync,
13
+ updateProjectAuthoringState,
14
+ updateProjectCompileState,
15
+ updateProjectLocalMaintainerRegistry
16
+ } from "./chunk-MRCUP5SW.mjs";
17
+ import "./chunk-XYDL7GY6.mjs";
18
+ export {
19
+ clearProjectCompileState,
20
+ clearProjectPendingAuthoringSync,
21
+ finalizeProjectPendingAuthoringSync,
22
+ getProjectAuthoringState,
23
+ getProjectCompileState,
24
+ getProjectLocalMaintainerRegistry,
25
+ getProjectPendingAuthoringSync,
26
+ sanitizeProjectLocalMaintainerRegistry,
27
+ setLatestCompileAttempt,
28
+ setProjectPendingAuthoringSync,
29
+ updateProjectAuthoringState,
30
+ updateProjectCompileState,
31
+ updateProjectLocalMaintainerRegistry
32
+ };