@dreamboard-games/cli 0.1.30-alpha.1 → 0.1.30-alpha.2

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 (114) hide show
  1. package/README.md +179 -22
  2. package/dist/{chunk-C6UAT6EH.js → chunk-N7XPNNUI.js} +9 -12
  3. package/dist/chunk-N7XPNNUI.js.map +1 -0
  4. package/dist/chunk-SEGVTWSK.js +44 -0
  5. package/dist/{chunk-RS7UXJZV.js → chunk-TAQKH67O.js} +21300 -35881
  6. package/dist/chunk-TAQKH67O.js.map +1 -0
  7. package/dist/{global-config-AGFBDFYD.js → global-config-S4ZIPECE.js} +3 -3
  8. package/dist/index.js +415 -37
  9. package/dist/index.js.map +1 -1
  10. package/dist/internal.js +3 -4
  11. package/dist/{agent-verifier/keychain-backend-TNOPQV3Z.mjs → keychain-backend-HDF4TZDL.js} +2 -1
  12. package/dist/{agent-verifier/prompt-3BAINGAQ.mjs → prompt-NDV3AE5L.js} +2 -1
  13. package/package.json +6 -6
  14. package/skills/dreamboard/references/building-your-first-game.md +510 -0
  15. package/skills/dreamboard/references/cli.md +104 -0
  16. package/skills/dreamboard/references/game-interface.md +548 -0
  17. package/skills/dreamboard/references/manifest-authoring.md +597 -0
  18. package/skills/dreamboard/references/quickstart.md +66 -0
  19. package/skills/dreamboard/references/reducer.md +864 -0
  20. package/skills/dreamboard/references/rule-authoring.md +147 -0
  21. package/skills/dreamboard/references/testing.md +249 -0
  22. package/skills/dreamboard/scripts/events-extract.mjs +218 -0
  23. package/dist/agent-verifier/agent-workspace-verifier.mjs +0 -227
  24. package/dist/agent-verifier/chunk-2E5P5NWG.mjs +0 -835
  25. package/dist/agent-verifier/chunk-2GBBP27W.mjs +0 -301
  26. package/dist/agent-verifier/chunk-2QMNAVV4.mjs +0 -14522
  27. package/dist/agent-verifier/chunk-2SZHMP6F.mjs +0 -264
  28. package/dist/agent-verifier/chunk-4WD3YU2E.mjs +0 -166
  29. package/dist/agent-verifier/chunk-54TAYXUD.mjs +0 -12
  30. package/dist/agent-verifier/chunk-6A5HRJMQ.mjs +0 -3174
  31. package/dist/agent-verifier/chunk-6UUJEYDV.mjs +0 -213
  32. package/dist/agent-verifier/chunk-7653FPGJ.mjs +0 -381
  33. package/dist/agent-verifier/chunk-7E65UQLY.mjs +0 -38
  34. package/dist/agent-verifier/chunk-BVVNBJM4.mjs +0 -221
  35. package/dist/agent-verifier/chunk-CEDUHGNH.mjs +0 -74
  36. package/dist/agent-verifier/chunk-CEQ2VJWN.mjs +0 -149
  37. package/dist/agent-verifier/chunk-CFU5EWIC.mjs +0 -69
  38. package/dist/agent-verifier/chunk-CJEEA6NJ.mjs +0 -730
  39. package/dist/agent-verifier/chunk-EIQWDQWJ.mjs +0 -186
  40. package/dist/agent-verifier/chunk-EOQIV6PS.mjs +0 -649
  41. package/dist/agent-verifier/chunk-HBNDKQT5.mjs +0 -8381
  42. package/dist/agent-verifier/chunk-HJFQDSTU.mjs +0 -225
  43. package/dist/agent-verifier/chunk-JH22JNYD.mjs +0 -1681
  44. package/dist/agent-verifier/chunk-LI3ZR3BI.mjs +0 -41
  45. package/dist/agent-verifier/chunk-LM3OZLZG.mjs +0 -48
  46. package/dist/agent-verifier/chunk-MINCYHXN.mjs +0 -106
  47. package/dist/agent-verifier/chunk-MRCUP5SW.mjs +0 -128
  48. package/dist/agent-verifier/chunk-RBDDIIPM.mjs +0 -19
  49. package/dist/agent-verifier/chunk-SHUMAVAP.mjs +0 -59
  50. package/dist/agent-verifier/chunk-SYPLYRGB.mjs +0 -2812
  51. package/dist/agent-verifier/chunk-U6OJN7XS.mjs +0 -8092
  52. package/dist/agent-verifier/chunk-VYJTHSYR.mjs +0 -44
  53. package/dist/agent-verifier/chunk-XYDL7GY6.mjs +0 -10
  54. package/dist/agent-verifier/compile-5QSPIOUT.mjs +0 -313
  55. package/dist/agent-verifier/global-config-WX3ZZIVU.mjs +0 -17
  56. package/dist/agent-verifier/local-files-MTPLP62S.mjs +0 -46
  57. package/dist/agent-verifier/local-typecheck-QFYYAZOK.mjs +0 -9
  58. package/dist/agent-verifier/materialize-workspace-FKALAE2T.mjs +0 -90
  59. package/dist/agent-verifier/project-state-7GR6BQTQ.mjs +0 -32
  60. package/dist/agent-verifier/reducer-bundle-preflight-C73LEXI2.mjs +0 -23
  61. package/dist/agent-verifier/reducer-contract-preflight-22X7DSZW.mjs +0 -10
  62. package/dist/agent-verifier/reducer-native-test-harness-GMWBUISX.mjs +0 -53
  63. package/dist/agent-verifier/static-scaffold-AJMZZQWS.mjs +0 -28
  64. package/dist/agent-verifier/sync-3DUQH32H.mjs +0 -594
  65. package/dist/agent-verifier/test-P4U5INTD.mjs +0 -356
  66. package/dist/agent-verifier/testing-5K2BJYF2.mjs +0 -674
  67. package/dist/agent-verifier/workspace-codegen-JDZJRSDV.mjs +0 -11
  68. package/dist/agent-verifier/workspace-dependencies-HZ6VVS4G.mjs +0 -14
  69. package/dist/chunk-2H7UOFLK.js +0 -11
  70. package/dist/chunk-7FOO4AJI.js +0 -50
  71. package/dist/chunk-7FOO4AJI.js.map +0 -1
  72. package/dist/chunk-C6UAT6EH.js.map +0 -1
  73. package/dist/chunk-RS7UXJZV.js.map +0 -1
  74. package/dist/internal.d.ts +0 -311
  75. package/dist/keychain-backend-JHTXAKWC.js +0 -135
  76. package/dist/prompt-GMZABCJC.js +0 -756
  77. package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +0 -71
  78. package/dist/runtime-packages/ui-host-runtime/src/browser-interaction.ts +0 -139
  79. package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +0 -374
  80. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +0 -266
  81. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +0 -212
  82. package/dist/runtime-packages/ui-host-runtime/src/components/host-primitives.tsx +0 -271
  83. package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +0 -135
  84. package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +0 -5
  85. package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +0 -194
  86. package/dist/runtime-packages/ui-host-runtime/src/gameplay-authority-transport.ts +0 -626
  87. package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +0 -1
  88. package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +0 -1
  89. package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +0 -294
  90. package/dist/runtime-packages/ui-host-runtime/src/index.ts +0 -3
  91. package/dist/runtime-packages/ui-host-runtime/src/logger.ts +0 -11
  92. package/dist/runtime-packages/ui-host-runtime/src/perf.ts +0 -324
  93. package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +0 -195
  94. package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +0 -138
  95. package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +0 -159
  96. package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +0 -551
  97. package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +0 -13
  98. package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +0 -122
  99. package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +0 -26
  100. package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +0 -583
  101. package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +0 -219
  102. package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +0 -117
  103. package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +0 -431
  104. package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +0 -211
  105. package/dist/runtime-packages/ui-host-runtime/src/session-recovery.ts +0 -80
  106. package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +0 -1034
  107. package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +0 -416
  108. package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +0 -184
  109. package/dist/testing-KLSV6CPJ.js +0 -674
  110. package/dist/testing-KLSV6CPJ.js.map +0 -1
  111. /package/dist/{chunk-2H7UOFLK.js.map → chunk-SEGVTWSK.js.map} +0 -0
  112. /package/dist/{global-config-AGFBDFYD.js.map → global-config-S4ZIPECE.js.map} +0 -0
  113. /package/dist/{keychain-backend-JHTXAKWC.js.map → keychain-backend-HDF4TZDL.js.map} +0 -0
  114. /package/dist/{prompt-GMZABCJC.js.map → prompt-NDV3AE5L.js.map} +0 -0
@@ -1,264 +0,0 @@
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
- };
@@ -1,166 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- atomicWriteFile
4
- } from "./chunk-MINCYHXN.mjs";
5
- import {
6
- ensureDir,
7
- exists,
8
- readJsonFile
9
- } from "./chunk-LM3OZLZG.mjs";
10
- import {
11
- PROJECT_CONFIG_FILE,
12
- PROJECT_DIR_NAME,
13
- PROJECT_STATE_FILE
14
- } from "./chunk-SHUMAVAP.mjs";
15
-
16
- // src/build-target.ts
17
- var injectedBuildChannel = true ? "development" : void 0;
18
- var BUILD_CHANNEL = injectedBuildChannel === "published" ? "published" : "development";
19
- var IS_PUBLISHED_BUILD = BUILD_CHANNEL === "published";
20
- var PUBLISHED_ENVIRONMENT = "prod";
21
-
22
- // src/config/project-config.ts
23
- import path from "path";
24
- var LEGACY_DEFAULT_DEPLOYMENT_ID = "legacy";
25
- var LEGACY_DEFAULT_OWNER_SCOPE_ID = "default";
26
- var LEGACY_DEFAULT_BINDING_KEY = `${LEGACY_DEFAULT_DEPLOYMENT_ID}:${LEGACY_DEFAULT_OWNER_SCOPE_ID}`;
27
- function normalizeProjectManifest(config) {
28
- return {
29
- schemaVersion: 2,
30
- projectId: config.projectId,
31
- slug: config.slug
32
- };
33
- }
34
- function normalizeProjectBinding(config) {
35
- return {
36
- deploymentId: config.deploymentId ?? LEGACY_DEFAULT_DEPLOYMENT_ID,
37
- ownerScopeId: config.ownerScopeId ?? LEGACY_DEFAULT_OWNER_SCOPE_ID,
38
- gameId: config.gameId,
39
- remoteHeadDigest: config.remoteHeadDigest,
40
- jobId: config.jobId,
41
- agentManaged: config.agentManaged,
42
- workspacePrepared: config.workspacePrepared,
43
- allowCreateGame: config.allowCreateGame,
44
- environment: config.environment,
45
- authoring: config.authoring,
46
- compile: config.compile,
47
- localMaintainerRegistry: config.localMaintainerRegistry,
48
- apiBaseUrl: config.apiBaseUrl,
49
- webBaseUrl: config.webBaseUrl,
50
- packageManifest: config.packageManifest,
51
- environmentManifest: config.environmentManifest
52
- };
53
- }
54
- function normalizeProjectState(config, existing) {
55
- const binding = normalizeProjectBinding(config);
56
- const bindingKey = config.bindingKey || `${binding.deploymentId}:${binding.ownerScopeId}`;
57
- return {
58
- schemaVersion: 1,
59
- bindings: {
60
- ...existing?.bindings ?? {},
61
- [bindingKey]: binding
62
- }
63
- };
64
- }
65
- function mergeManifestAndBinding(manifest, binding, bindingKey) {
66
- return {
67
- ...manifest,
68
- ...binding ?? {
69
- deploymentId: LEGACY_DEFAULT_DEPLOYMENT_ID,
70
- ownerScopeId: LEGACY_DEFAULT_OWNER_SCOPE_ID
71
- },
72
- gameId: binding?.gameId ?? manifest.projectId,
73
- bindingKey: bindingKey ?? `${binding?.deploymentId ?? LEGACY_DEFAULT_DEPLOYMENT_ID}:${binding?.ownerScopeId ?? LEGACY_DEFAULT_OWNER_SCOPE_ID}`
74
- };
75
- }
76
- function isProjectManifestV2(value) {
77
- const candidate = value;
78
- return candidate?.schemaVersion === 2 && typeof candidate.projectId === "string" && typeof candidate.slug === "string";
79
- }
80
- function normalizeLegacyProjectConfig(config) {
81
- return {
82
- schemaVersion: 2,
83
- projectId: config.projectId ?? config.gameId,
84
- slug: config.slug,
85
- bindingKey: LEGACY_DEFAULT_BINDING_KEY,
86
- deploymentId: LEGACY_DEFAULT_DEPLOYMENT_ID,
87
- ownerScopeId: LEGACY_DEFAULT_OWNER_SCOPE_ID,
88
- gameId: config.gameId,
89
- jobId: config.jobId,
90
- agentManaged: config.agentManaged,
91
- workspacePrepared: config.workspacePrepared,
92
- allowCreateGame: config.allowCreateGame,
93
- environment: config.environment,
94
- authoring: config.authoring,
95
- compile: config.compile,
96
- localMaintainerRegistry: config.localMaintainerRegistry,
97
- apiBaseUrl: config.apiBaseUrl,
98
- webBaseUrl: config.webBaseUrl,
99
- packageManifest: config.packageManifest,
100
- environmentManifest: config.environmentManifest
101
- };
102
- }
103
- async function loadProjectEnvironmentState(rootDir) {
104
- const filePath = path.join(rootDir, PROJECT_DIR_NAME, PROJECT_STATE_FILE);
105
- if (!await exists(filePath)) {
106
- return { schemaVersion: 1, bindings: {} };
107
- }
108
- const state = await readJsonFile(filePath);
109
- return state.schemaVersion === 1 && state.bindings ? state : { schemaVersion: 1, bindings: {} };
110
- }
111
- async function loadProjectConfig(rootDir) {
112
- const filePath = path.join(rootDir, PROJECT_DIR_NAME, PROJECT_CONFIG_FILE);
113
- const rawConfig = await readJsonFile(
114
- filePath
115
- );
116
- if (!isProjectManifestV2(rawConfig)) {
117
- const migrated = normalizeLegacyProjectConfig(
118
- rawConfig
119
- );
120
- await updateProjectState(rootDir, migrated);
121
- return migrated;
122
- }
123
- const state = await loadProjectEnvironmentState(rootDir);
124
- const entries = Object.entries(state.bindings);
125
- const [bindingKey, binding] = entries.find(([key]) => key !== LEGACY_DEFAULT_BINDING_KEY) ?? entries.find(([key]) => key === LEGACY_DEFAULT_BINDING_KEY) ?? [];
126
- return mergeManifestAndBinding(rawConfig, binding, bindingKey);
127
- }
128
- async function updateProjectState(rootDir, config) {
129
- const dir = path.join(rootDir, PROJECT_DIR_NAME);
130
- await ensureDir(dir);
131
- const existingState = await loadProjectEnvironmentState(rootDir);
132
- await atomicWriteFile(
133
- path.join(dir, PROJECT_CONFIG_FILE),
134
- `${JSON.stringify(normalizeProjectManifest(config), null, 2)}
135
- `,
136
- { mode: 420 }
137
- );
138
- await atomicWriteFile(
139
- path.join(dir, PROJECT_STATE_FILE),
140
- `${JSON.stringify(normalizeProjectState(config, existingState), null, 2)}
141
- `,
142
- { mode: 384 }
143
- );
144
- }
145
- async function findProjectRoot(startDir) {
146
- let current = path.resolve(startDir);
147
- for (let i = 0; i < 25; i++) {
148
- const candidate = path.join(current, PROJECT_DIR_NAME, PROJECT_CONFIG_FILE);
149
- if (await exists(candidate)) {
150
- return current;
151
- }
152
- const parent = path.dirname(current);
153
- if (parent === current) break;
154
- current = parent;
155
- }
156
- return null;
157
- }
158
-
159
- export {
160
- BUILD_CHANNEL,
161
- IS_PUBLISHED_BUILD,
162
- PUBLISHED_ENVIRONMENT,
163
- loadProjectConfig,
164
- updateProjectState,
165
- findProjectRoot
166
- };
@@ -1,12 +0,0 @@
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
- };