@dreamboard-games/cli 0.1.30-alpha.1 → 0.1.30-alpha.11
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.
- package/README.md +179 -22
- package/dist/agent-verifier/agent-workspace-verifier.mjs +31 -30
- package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-4WD3YU2E.mjs → chunk-3IJBOLGT.mjs} +4 -12
- package/dist/agent-verifier/chunk-3IJBOLGT.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-6A5HRJMQ.mjs → chunk-4GU3PCHV.mjs} +62 -99
- package/dist/agent-verifier/chunk-4GU3PCHV.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-SYPLYRGB.mjs → chunk-6XRC5PWB.mjs} +119 -310
- package/dist/agent-verifier/chunk-6XRC5PWB.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-BVVNBJM4.mjs → chunk-COB56ESI.mjs} +2 -1
- package/dist/agent-verifier/chunk-COB56ESI.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2GBBP27W.mjs → chunk-F2DIOJJZ.mjs} +1 -0
- package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CFU5EWIC.mjs → chunk-G42BGGG2.mjs} +7 -6
- package/dist/agent-verifier/chunk-G42BGGG2.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-XYDL7GY6.mjs → chunk-H6XDQJ3N.mjs} +1 -0
- package/dist/agent-verifier/{chunk-LM3OZLZG.mjs → chunk-IAYRNVUC.mjs} +1 -0
- package/dist/agent-verifier/chunk-IAYRNVUC.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2QMNAVV4.mjs → chunk-JZTH3EMV.mjs} +2 -1
- package/dist/agent-verifier/chunk-JZTH3EMV.mjs.map +1 -0
- package/dist/agent-verifier/chunk-KK47X7RV.mjs +14 -0
- package/dist/agent-verifier/chunk-KK47X7RV.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-SHUMAVAP.mjs → chunk-M7UVBANQ.mjs} +8 -9
- package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2E5P5NWG.mjs → chunk-NAK77WXW.mjs} +58 -126
- package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CEQ2VJWN.mjs → chunk-POBFNXD4.mjs} +2 -1
- package/dist/agent-verifier/chunk-POBFNXD4.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-6UUJEYDV.mjs → chunk-QBAF7EYR.mjs} +1 -0
- package/dist/agent-verifier/chunk-QBAF7EYR.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-7653FPGJ.mjs → chunk-RHI6S4SU.mjs} +3 -2
- package/dist/agent-verifier/chunk-RHI6S4SU.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-MINCYHXN.mjs → chunk-TAEQKBJB.mjs} +1 -0
- package/dist/agent-verifier/chunk-TAEQKBJB.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-7E65UQLY.mjs → chunk-TLYGTHXU.mjs} +3 -2
- package/dist/agent-verifier/chunk-TLYGTHXU.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-JH22JNYD.mjs → chunk-UIJ2NDG6.mjs} +93 -24
- package/dist/agent-verifier/chunk-UIJ2NDG6.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-EIQWDQWJ.mjs → chunk-UWJIZML3.mjs} +13 -14
- package/dist/agent-verifier/chunk-UWJIZML3.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CJEEA6NJ.mjs → chunk-VLOIZDR6.mjs} +15 -31
- package/dist/agent-verifier/chunk-VLOIZDR6.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-HJFQDSTU.mjs → chunk-W2MDP5ZN.mjs} +6 -5
- package/dist/agent-verifier/chunk-W2MDP5ZN.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CEDUHGNH.mjs → chunk-XKCJBIRY.mjs} +2 -1
- package/dist/agent-verifier/chunk-XKCJBIRY.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-VYJTHSYR.mjs → chunk-YDIOW2BO.mjs} +2 -1
- package/dist/agent-verifier/chunk-YDIOW2BO.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-MRCUP5SW.mjs → chunk-YE7UAO3T.mjs} +1 -0
- package/dist/agent-verifier/chunk-YE7UAO3T.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-EOQIV6PS.mjs → chunk-YR664DJX.mjs} +111 -116
- package/dist/agent-verifier/chunk-YR664DJX.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2SZHMP6F.mjs → chunk-Z6OZWUIZ.mjs} +6 -9
- package/dist/agent-verifier/chunk-Z6OZWUIZ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-RBDDIIPM.mjs → chunk-ZEELHSY3.mjs} +1 -0
- package/dist/agent-verifier/chunk-ZEELHSY3.mjs.map +1 -0
- package/dist/agent-verifier/{compile-5QSPIOUT.mjs → compile-WZ7X6I2A.mjs} +27 -27
- package/dist/agent-verifier/compile-WZ7X6I2A.mjs.map +1 -0
- package/dist/agent-verifier/{global-config-WX3ZZIVU.mjs → global-config-XHL7BCKN.mjs} +6 -5
- package/dist/agent-verifier/global-config-XHL7BCKN.mjs.map +1 -0
- package/dist/agent-verifier/{keychain-backend-TNOPQV3Z.mjs → keychain-backend-A3MRWLPF.mjs} +2 -1
- package/dist/agent-verifier/keychain-backend-A3MRWLPF.mjs.map +1 -0
- package/dist/agent-verifier/{local-files-MTPLP62S.mjs → local-files-ZW52HSVT.mjs} +10 -11
- package/dist/agent-verifier/local-files-ZW52HSVT.mjs.map +1 -0
- package/dist/agent-verifier/local-typecheck-3JXL2NMG.mjs +10 -0
- package/dist/agent-verifier/local-typecheck-3JXL2NMG.mjs.map +1 -0
- package/dist/agent-verifier/{materialize-workspace-FKALAE2T.mjs → materialize-workspace-BKZLLFI4.mjs} +20 -20
- package/dist/agent-verifier/materialize-workspace-BKZLLFI4.mjs.map +1 -0
- package/dist/agent-verifier/{project-state-7GR6BQTQ.mjs → project-state-XKUSCFSV.mjs} +3 -2
- package/dist/agent-verifier/project-state-XKUSCFSV.mjs.map +1 -0
- package/dist/agent-verifier/{prompt-3BAINGAQ.mjs → prompt-VKHMCQT6.mjs} +2 -1
- package/dist/agent-verifier/prompt-VKHMCQT6.mjs.map +1 -0
- package/dist/agent-verifier/{reducer-bundle-preflight-C73LEXI2.mjs → reducer-bundle-preflight-7NYZF5ZT.mjs} +6 -9
- package/dist/agent-verifier/reducer-bundle-preflight-7NYZF5ZT.mjs.map +1 -0
- package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs +11 -0
- package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs.map +1 -0
- package/dist/agent-verifier/{reducer-native-test-harness-GMWBUISX.mjs → reducer-native-test-harness-D4VWPIAC.mjs} +14 -17
- package/dist/agent-verifier/reducer-native-test-harness-D4VWPIAC.mjs.map +1 -0
- package/dist/agent-verifier/static-scaffold-JCRBDKEH.mjs +26 -0
- package/dist/agent-verifier/static-scaffold-JCRBDKEH.mjs.map +1 -0
- package/dist/agent-verifier/{sync-3DUQH32H.mjs → sync-ELLJEWMB.mjs} +41 -39
- package/dist/agent-verifier/sync-ELLJEWMB.mjs.map +1 -0
- package/dist/agent-verifier/{test-P4U5INTD.mjs → test-OSXBPLSP.mjs} +29 -31
- package/dist/agent-verifier/test-OSXBPLSP.mjs.map +1 -0
- package/dist/agent-verifier/workspace-codegen-WPZHMATU.mjs +10 -0
- package/dist/agent-verifier/workspace-codegen-WPZHMATU.mjs.map +1 -0
- package/dist/agent-verifier/{workspace-dependencies-HZ6VVS4G.mjs → workspace-dependencies-ULZZZPNX.mjs} +5 -4
- package/dist/agent-verifier/workspace-dependencies-ULZZZPNX.mjs.map +1 -0
- package/dist/{chunk-C6UAT6EH.js → chunk-GXM7RRZJ.js} +9 -11
- package/dist/chunk-GXM7RRZJ.js.map +1 -0
- package/dist/{chunk-RS7UXJZV.js → chunk-P5TITCD3.js} +790 -17875
- package/dist/chunk-P5TITCD3.js.map +1 -0
- package/dist/{global-config-AGFBDFYD.js → global-config-WPJRXVDO.js} +2 -2
- package/dist/global-config-WPJRXVDO.js.map +1 -0
- package/dist/index.js +455 -54
- package/dist/index.js.map +1 -1
- package/dist/internal.js +2 -3
- package/package.json +8 -7
- package/skills/dreamboard/references/building-your-first-game.md +510 -0
- package/skills/dreamboard/references/cli.md +104 -0
- package/skills/dreamboard/references/game-interface.md +548 -0
- package/skills/dreamboard/references/manifest-authoring.md +597 -0
- package/skills/dreamboard/references/quickstart.md +66 -0
- package/skills/dreamboard/references/reducer.md +864 -0
- package/skills/dreamboard/references/rule-authoring.md +147 -0
- package/skills/dreamboard/references/testing.md +249 -0
- package/skills/dreamboard/scripts/events-extract.mjs +218 -0
- package/dist/agent-verifier/chunk-54TAYXUD.mjs +0 -12
- package/dist/agent-verifier/chunk-HBNDKQT5.mjs +0 -8381
- package/dist/agent-verifier/chunk-LI3ZR3BI.mjs +0 -41
- package/dist/agent-verifier/chunk-U6OJN7XS.mjs +0 -8092
- package/dist/agent-verifier/local-typecheck-QFYYAZOK.mjs +0 -9
- package/dist/agent-verifier/reducer-contract-preflight-22X7DSZW.mjs +0 -10
- package/dist/agent-verifier/static-scaffold-AJMZZQWS.mjs +0 -28
- package/dist/agent-verifier/testing-5K2BJYF2.mjs +0 -674
- package/dist/agent-verifier/workspace-codegen-JDZJRSDV.mjs +0 -11
- package/dist/chunk-7FOO4AJI.js +0 -50
- package/dist/chunk-7FOO4AJI.js.map +0 -1
- package/dist/chunk-C6UAT6EH.js.map +0 -1
- package/dist/chunk-RS7UXJZV.js.map +0 -1
- package/dist/internal.d.ts +0 -311
- package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +0 -71
- package/dist/runtime-packages/ui-host-runtime/src/browser-interaction.ts +0 -139
- package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +0 -374
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +0 -266
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +0 -212
- package/dist/runtime-packages/ui-host-runtime/src/components/host-primitives.tsx +0 -271
- package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +0 -135
- package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +0 -5
- package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +0 -194
- package/dist/runtime-packages/ui-host-runtime/src/gameplay-authority-transport.ts +0 -626
- package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +0 -1
- package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +0 -1
- package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +0 -294
- package/dist/runtime-packages/ui-host-runtime/src/index.ts +0 -3
- package/dist/runtime-packages/ui-host-runtime/src/logger.ts +0 -11
- package/dist/runtime-packages/ui-host-runtime/src/perf.ts +0 -324
- package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +0 -195
- package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +0 -138
- package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +0 -159
- package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +0 -551
- package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +0 -13
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +0 -122
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +0 -26
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +0 -583
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +0 -219
- package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +0 -117
- package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +0 -431
- package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +0 -211
- package/dist/runtime-packages/ui-host-runtime/src/session-recovery.ts +0 -80
- package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +0 -1034
- package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +0 -416
- package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +0 -184
- package/dist/testing-KLSV6CPJ.js +0 -674
- package/dist/testing-KLSV6CPJ.js.map +0 -1
- /package/dist/{global-config-AGFBDFYD.js.map → agent-verifier/chunk-H6XDQJ3N.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -13,13 +13,14 @@ import {
|
|
|
13
13
|
collectLocalFiles,
|
|
14
14
|
computeManifestHash,
|
|
15
15
|
configureClient,
|
|
16
|
-
|
|
16
|
+
createGameRevision,
|
|
17
17
|
createPkcePair,
|
|
18
|
-
|
|
18
|
+
createProjectSession,
|
|
19
|
+
createProjectSourceBlobUploadSession,
|
|
19
20
|
createSessionFromScenario,
|
|
20
21
|
didLocalMaintainerSnapshotChange,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
ensureProject,
|
|
23
|
+
ensureProjectDevCompile,
|
|
23
24
|
exchangeClerkOAuthCode,
|
|
24
25
|
external_exports,
|
|
25
26
|
findProjectCompiledResultsForRevision,
|
|
@@ -29,36 +30,32 @@ import {
|
|
|
29
30
|
getApiVersion,
|
|
30
31
|
getAuthTokenExpiry,
|
|
31
32
|
getCliErrorExitCode,
|
|
33
|
+
getCurrentAuthUser,
|
|
32
34
|
getLocalDiff,
|
|
33
35
|
getProjectAuthoringState,
|
|
34
|
-
|
|
36
|
+
getProjectBySlug,
|
|
35
37
|
getProjectCompileState,
|
|
36
38
|
getProjectCompiledResultSdk,
|
|
37
39
|
getProjectLocalMaintainerRegistry,
|
|
38
40
|
getProjectPendingAuthoringSync,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
getProjectRevisionSources,
|
|
42
|
+
getProjectSources,
|
|
41
43
|
getSessionEventBatch,
|
|
42
44
|
getSessionSnapshot,
|
|
43
45
|
importTypeScriptModule,
|
|
44
46
|
isAllowedGamePath,
|
|
45
|
-
isAuthoritativeGeneratedPath,
|
|
46
47
|
isDreamboardApiError,
|
|
48
|
+
isDynamicGeneratedPath,
|
|
47
49
|
isDynamicSeedPath,
|
|
48
50
|
isLibraryPath,
|
|
49
51
|
isLocalMaintainerRegistryEnabled,
|
|
50
|
-
isPerPlayer,
|
|
51
52
|
isReducerNativeTestingWorkspace,
|
|
52
53
|
isStaleContractArtifactError,
|
|
53
54
|
isStaleContractArtifactMessage,
|
|
54
55
|
loadManifest,
|
|
55
56
|
loadProjectConfig,
|
|
56
|
-
loadRemoteProjectIdentity,
|
|
57
57
|
loadRule,
|
|
58
|
-
mapUpsertBlobContentsByContentHash,
|
|
59
58
|
materializeManifest,
|
|
60
|
-
materializeManifestTable,
|
|
61
|
-
materializeSourceChangeOperations,
|
|
62
59
|
normalizeSlug,
|
|
63
60
|
parseAuthCommandArgs,
|
|
64
61
|
parseCloneCommandArgs,
|
|
@@ -75,7 +72,6 @@ import {
|
|
|
75
72
|
parseQueryCommandArgs,
|
|
76
73
|
parseStatusCommandArgs,
|
|
77
74
|
parseSyncCommandArgs,
|
|
78
|
-
perPlayerSchema,
|
|
79
75
|
projectIdFromSessionGameSource,
|
|
80
76
|
queryWorkshopRulebook,
|
|
81
77
|
queueProjectRevisionCompileSdk,
|
|
@@ -91,13 +87,13 @@ import {
|
|
|
91
87
|
setLatestCompileAttempt,
|
|
92
88
|
shortHash,
|
|
93
89
|
submitGameplayAuthorityAction,
|
|
90
|
+
titleFromSlug,
|
|
94
91
|
toApiProblem,
|
|
95
92
|
toDreamboardApiError,
|
|
96
93
|
updateProjectAuthoringState,
|
|
97
94
|
updateProjectLocalMaintainerRegistry,
|
|
98
95
|
updateProjectState,
|
|
99
|
-
|
|
100
|
-
uploadProjectSourceBlobsSdk,
|
|
96
|
+
uploadInitialProjection,
|
|
101
97
|
valueOrUndefined,
|
|
102
98
|
waitForCompiledResultJobSdk,
|
|
103
99
|
writeManifest,
|
|
@@ -105,13 +101,12 @@ import {
|
|
|
105
101
|
writeSnapshot,
|
|
106
102
|
writeSnapshotFromFiles,
|
|
107
103
|
writeSourceFiles
|
|
108
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-P5TITCD3.js";
|
|
109
105
|
import {
|
|
110
106
|
DEFAULT_LOGIN_TIMEOUT_MS,
|
|
111
107
|
DEFAULT_WEB_BASE_URL,
|
|
112
108
|
MANIFEST_FILE,
|
|
113
109
|
MANIFEST_TYPECHECK_CONFIG_FILE,
|
|
114
|
-
PROJECT_CONFIG_FILE,
|
|
115
110
|
PROJECT_DIR_NAME,
|
|
116
111
|
RULE_FILE,
|
|
117
112
|
clearCredentials,
|
|
@@ -130,12 +125,11 @@ import {
|
|
|
130
125
|
setCredentials,
|
|
131
126
|
writeJsonFile,
|
|
132
127
|
writeTextFile
|
|
133
|
-
} from "./chunk-
|
|
134
|
-
import "./chunk-7FOO4AJI.js";
|
|
128
|
+
} from "./chunk-GXM7RRZJ.js";
|
|
135
129
|
import "./chunk-2H7UOFLK.js";
|
|
136
130
|
|
|
137
131
|
// src/commands/auth.ts
|
|
138
|
-
import
|
|
132
|
+
import crypto2 from "crypto";
|
|
139
133
|
|
|
140
134
|
// ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/_chunks/libs/scule.mjs
|
|
141
135
|
var NUMBER_CHAR_RE = /\d/;
|
|
@@ -1867,7 +1861,7 @@ function openBrowser(url) {
|
|
|
1867
1861
|
|
|
1868
1862
|
// src/commands/auth.ts
|
|
1869
1863
|
async function loginWithBrowser(config, quiet) {
|
|
1870
|
-
const state =
|
|
1864
|
+
const state = crypto2.randomUUID();
|
|
1871
1865
|
const pkce = createPkcePair();
|
|
1872
1866
|
const server = await startOAuthCallbackServer(
|
|
1873
1867
|
state,
|
|
@@ -2207,6 +2201,360 @@ var query_default = defineCommand({
|
|
|
2207
2201
|
// src/commands/clone.ts
|
|
2208
2202
|
import path5 from "path";
|
|
2209
2203
|
|
|
2204
|
+
// src/services/api/project-api.ts
|
|
2205
|
+
async function loadRemoteProjectIdentity() {
|
|
2206
|
+
const [versionResponse, userResponse] = await Promise.all([
|
|
2207
|
+
getApiVersion(),
|
|
2208
|
+
getCurrentAuthUser()
|
|
2209
|
+
]);
|
|
2210
|
+
if (versionResponse.error || !versionResponse.data) {
|
|
2211
|
+
throw toDreamboardApiError(
|
|
2212
|
+
versionResponse.error,
|
|
2213
|
+
versionResponse.response,
|
|
2214
|
+
"Failed to resolve backend deployment identity"
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
if (userResponse.error || !userResponse.data) {
|
|
2218
|
+
throw toDreamboardApiError(
|
|
2219
|
+
userResponse.error,
|
|
2220
|
+
userResponse.response,
|
|
2221
|
+
"Failed to resolve authenticated owner scope"
|
|
2222
|
+
);
|
|
2223
|
+
}
|
|
2224
|
+
const deploymentId = versionResponse.data.deploymentId;
|
|
2225
|
+
const ownerScopeId = userResponse.data.ownerScopeId;
|
|
2226
|
+
return {
|
|
2227
|
+
deploymentId,
|
|
2228
|
+
ownerScopeId,
|
|
2229
|
+
bindingKey: `${deploymentId}:${ownerScopeId}`
|
|
2230
|
+
};
|
|
2231
|
+
}
|
|
2232
|
+
async function ensureProjectSdk(options) {
|
|
2233
|
+
const { data, error, response } = await ensureProject({
|
|
2234
|
+
path: { projectId: options.projectId },
|
|
2235
|
+
body: {
|
|
2236
|
+
slug: options.slug,
|
|
2237
|
+
name: titleFromSlug(options.slug),
|
|
2238
|
+
description: options.description ?? `Dreamboard workspace for ${options.slug}.`,
|
|
2239
|
+
...options.updateAlias ? { updateAlias: true } : {}
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
if (error || !data) {
|
|
2243
|
+
throw toDreamboardApiError(error, response, "Failed to ensure project");
|
|
2244
|
+
}
|
|
2245
|
+
return data;
|
|
2246
|
+
}
|
|
2247
|
+
async function getProjectBySlugSdk(slug) {
|
|
2248
|
+
const { data, error, response } = await getProjectBySlug({
|
|
2249
|
+
path: { slug }
|
|
2250
|
+
});
|
|
2251
|
+
if (error || !data) {
|
|
2252
|
+
throw toDreamboardApiError(
|
|
2253
|
+
error,
|
|
2254
|
+
response,
|
|
2255
|
+
`Project '${slug}' not found`
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
return data;
|
|
2259
|
+
}
|
|
2260
|
+
async function createGameRevisionSdk(options) {
|
|
2261
|
+
const { data, error, response } = await createGameRevision({
|
|
2262
|
+
path: { projectId: options.projectId },
|
|
2263
|
+
body: options.request
|
|
2264
|
+
});
|
|
2265
|
+
if (error || !data) {
|
|
2266
|
+
throw toDreamboardApiError(
|
|
2267
|
+
error,
|
|
2268
|
+
response,
|
|
2269
|
+
"Failed to create game revision"
|
|
2270
|
+
);
|
|
2271
|
+
}
|
|
2272
|
+
return data;
|
|
2273
|
+
}
|
|
2274
|
+
async function getProjectSourcesSdk(projectId) {
|
|
2275
|
+
const { data, error, response } = await getProjectSources({
|
|
2276
|
+
path: { projectId }
|
|
2277
|
+
});
|
|
2278
|
+
if (response?.status === 404) {
|
|
2279
|
+
return null;
|
|
2280
|
+
}
|
|
2281
|
+
if (error || !data) {
|
|
2282
|
+
throw toDreamboardApiError(
|
|
2283
|
+
error,
|
|
2284
|
+
response,
|
|
2285
|
+
"Failed to fetch project sources"
|
|
2286
|
+
);
|
|
2287
|
+
}
|
|
2288
|
+
return data;
|
|
2289
|
+
}
|
|
2290
|
+
async function getProjectRevisionSourcesSdk(options) {
|
|
2291
|
+
const { data, error, response } = await getProjectRevisionSources({
|
|
2292
|
+
path: {
|
|
2293
|
+
projectId: options.projectId,
|
|
2294
|
+
revisionDigest: options.revisionDigest
|
|
2295
|
+
}
|
|
2296
|
+
});
|
|
2297
|
+
if (error || !data) {
|
|
2298
|
+
throw toDreamboardApiError(
|
|
2299
|
+
error,
|
|
2300
|
+
response,
|
|
2301
|
+
"Failed to fetch project revision sources"
|
|
2302
|
+
);
|
|
2303
|
+
}
|
|
2304
|
+
return data;
|
|
2305
|
+
}
|
|
2306
|
+
async function ensureProjectDevCompileSdk(options) {
|
|
2307
|
+
const { data, error, response } = await ensureProjectDevCompile({
|
|
2308
|
+
path: { projectId: options.projectId },
|
|
2309
|
+
body: options.request
|
|
2310
|
+
});
|
|
2311
|
+
if (error || !data) {
|
|
2312
|
+
throw toDreamboardApiError(error, response, "Failed to ensure dev compile");
|
|
2313
|
+
}
|
|
2314
|
+
return data;
|
|
2315
|
+
}
|
|
2316
|
+
async function createProjectSessionSdk(options) {
|
|
2317
|
+
const { data, error, response } = await createProjectSession({
|
|
2318
|
+
path: { projectId: options.projectId },
|
|
2319
|
+
body: options.request
|
|
2320
|
+
});
|
|
2321
|
+
if (error || !data) {
|
|
2322
|
+
throw toDreamboardApiError(error, response, "Failed to create session");
|
|
2323
|
+
}
|
|
2324
|
+
return data;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
// src/services/api/preview-api.ts
|
|
2328
|
+
async function uploadInitialProjectionSdk(gameId, projectionJson) {
|
|
2329
|
+
const { error, response } = await uploadInitialProjection({
|
|
2330
|
+
path: { gameId },
|
|
2331
|
+
body: { projectionJson }
|
|
2332
|
+
});
|
|
2333
|
+
if (error) {
|
|
2334
|
+
throw toDreamboardApiError(
|
|
2335
|
+
error,
|
|
2336
|
+
response,
|
|
2337
|
+
"Failed to upload initial preview projection"
|
|
2338
|
+
);
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
// ../../packages/api-client/dist/source-revisions.js
|
|
2343
|
+
var textEncoder = new TextEncoder();
|
|
2344
|
+
var SOURCE_BLOB_UPLOAD_SESSION_BATCH_SIZE = 20;
|
|
2345
|
+
function bytesToHex(bytes) {
|
|
2346
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2347
|
+
}
|
|
2348
|
+
async function sha256Hex(bytes) {
|
|
2349
|
+
const normalizedBytes = new Uint8Array(bytes.byteLength);
|
|
2350
|
+
normalizedBytes.set(bytes);
|
|
2351
|
+
const digest = await crypto.subtle.digest("SHA-256", normalizedBytes.buffer);
|
|
2352
|
+
return bytesToHex(new Uint8Array(digest));
|
|
2353
|
+
}
|
|
2354
|
+
function getUtf8ByteSize(content) {
|
|
2355
|
+
return textEncoder.encode(content).byteLength;
|
|
2356
|
+
}
|
|
2357
|
+
async function computeSourceContentHash(content) {
|
|
2358
|
+
return sha256Hex(textEncoder.encode(content));
|
|
2359
|
+
}
|
|
2360
|
+
async function describeSourceBlob(content) {
|
|
2361
|
+
return {
|
|
2362
|
+
contentHash: await computeSourceContentHash(content),
|
|
2363
|
+
byteSize: getUtf8ByteSize(content)
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2366
|
+
async function materializeSourceChangeOperations(changes) {
|
|
2367
|
+
const blobsByHash = /* @__PURE__ */ new Map();
|
|
2368
|
+
const materialized = await Promise.all(Array.from(changes, async (change) => {
|
|
2369
|
+
if (change.kind === "delete") {
|
|
2370
|
+
return change;
|
|
2371
|
+
}
|
|
2372
|
+
const blob = await describeSourceBlob(change.content);
|
|
2373
|
+
const existing = blobsByHash.get(blob.contentHash);
|
|
2374
|
+
if (!existing) {
|
|
2375
|
+
blobsByHash.set(blob.contentHash, blob);
|
|
2376
|
+
}
|
|
2377
|
+
return {
|
|
2378
|
+
kind: "upsert",
|
|
2379
|
+
path: change.path,
|
|
2380
|
+
contentHash: blob.contentHash,
|
|
2381
|
+
byteSize: blob.byteSize
|
|
2382
|
+
};
|
|
2383
|
+
}));
|
|
2384
|
+
return {
|
|
2385
|
+
blobs: Array.from(blobsByHash.values()).sort((left, right) => left.contentHash.localeCompare(right.contentHash)),
|
|
2386
|
+
changes: materialized
|
|
2387
|
+
};
|
|
2388
|
+
}
|
|
2389
|
+
function mapUpsertBlobContentsByContentHash(localChanges, materializedChanges) {
|
|
2390
|
+
const uploadBlobs = /* @__PURE__ */ new Map();
|
|
2391
|
+
const length = Math.min(localChanges.length, materializedChanges.length);
|
|
2392
|
+
for (let index = 0; index < length; index += 1) {
|
|
2393
|
+
const localChange = localChanges[index];
|
|
2394
|
+
const materializedChange = materializedChanges[index];
|
|
2395
|
+
if (localChange?.kind !== "upsert" || materializedChange?.kind !== "upsert") {
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
uploadBlobs.set(materializedChange.contentHash, {
|
|
2399
|
+
contentHash: materializedChange.contentHash,
|
|
2400
|
+
byteSize: materializedChange.byteSize,
|
|
2401
|
+
content: localChange.content
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
return uploadBlobs;
|
|
2405
|
+
}
|
|
2406
|
+
var SourceBlobUploadError = class extends Error {
|
|
2407
|
+
constructor(status, details) {
|
|
2408
|
+
const suffix = details.trim().length > 0 ? `: ${details.trim()}` : "";
|
|
2409
|
+
super(`Failed to upload source blob (HTTP ${status}${suffix})`);
|
|
2410
|
+
this.name = "SourceBlobUploadError";
|
|
2411
|
+
this.status = status;
|
|
2412
|
+
this.details = details;
|
|
2413
|
+
}
|
|
2414
|
+
};
|
|
2415
|
+
function isDuplicateDirectUploadError(error) {
|
|
2416
|
+
if (!(error instanceof SourceBlobUploadError)) {
|
|
2417
|
+
return false;
|
|
2418
|
+
}
|
|
2419
|
+
if (error.status === 409) {
|
|
2420
|
+
return true;
|
|
2421
|
+
}
|
|
2422
|
+
const normalizedDetails = error.details.toLowerCase();
|
|
2423
|
+
return normalizedDetails.includes("duplicate") || normalizedDetails.includes("already exists") || normalizedDetails.includes("resource already exists");
|
|
2424
|
+
}
|
|
2425
|
+
async function uploadSourceBlob(uploadTarget, content) {
|
|
2426
|
+
const response = await fetch(uploadTarget.url, {
|
|
2427
|
+
method: uploadTarget.method,
|
|
2428
|
+
headers: uploadTarget.headers,
|
|
2429
|
+
body: textEncoder.encode(content)
|
|
2430
|
+
});
|
|
2431
|
+
if (response.ok) {
|
|
2432
|
+
return;
|
|
2433
|
+
}
|
|
2434
|
+
const details = await response.text().catch(() => "");
|
|
2435
|
+
throw new SourceBlobUploadError(response.status, details);
|
|
2436
|
+
}
|
|
2437
|
+
var SourceBlobSessionRequestError = class extends Error {
|
|
2438
|
+
constructor(message, apiError, response) {
|
|
2439
|
+
super(message);
|
|
2440
|
+
this.name = "SourceBlobSessionRequestError";
|
|
2441
|
+
this.apiError = apiError;
|
|
2442
|
+
this.response = response;
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
function assertSourceBlobUploadSession(data, response) {
|
|
2446
|
+
if (!data || typeof data !== "object" || !Array.isArray(data.uploads)) {
|
|
2447
|
+
throw new SourceBlobSessionRequestError("Source blob upload session response did not include an uploads array", data, response);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
async function confirmSourceBlobAlreadyExists(options) {
|
|
2451
|
+
const { requestUploadSession, blob } = options;
|
|
2452
|
+
const { data, error, response } = await requestUploadSession([
|
|
2453
|
+
{
|
|
2454
|
+
contentHash: blob.contentHash,
|
|
2455
|
+
byteSize: blob.byteSize
|
|
2456
|
+
}
|
|
2457
|
+
]);
|
|
2458
|
+
if (error || !data) {
|
|
2459
|
+
throw new SourceBlobSessionRequestError("Failed to create source blob upload session", error, response);
|
|
2460
|
+
}
|
|
2461
|
+
assertSourceBlobUploadSession(data, response);
|
|
2462
|
+
return data.uploads[0]?.status === "exists";
|
|
2463
|
+
}
|
|
2464
|
+
async function uploadSourceBlobs(options) {
|
|
2465
|
+
const { blobs, requestUploadSession } = options;
|
|
2466
|
+
const uniqueBlobs = /* @__PURE__ */ new Map();
|
|
2467
|
+
for (const blob of blobs) {
|
|
2468
|
+
const existing = uniqueBlobs.get(blob.contentHash);
|
|
2469
|
+
if (!existing) {
|
|
2470
|
+
uniqueBlobs.set(blob.contentHash, blob);
|
|
2471
|
+
continue;
|
|
2472
|
+
}
|
|
2473
|
+
if (existing.byteSize !== blob.byteSize) {
|
|
2474
|
+
throw new Error(`Source blob ${blob.contentHash} has conflicting byte sizes.`);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
if (uniqueBlobs.size === 0) {
|
|
2478
|
+
return;
|
|
2479
|
+
}
|
|
2480
|
+
for (const uploadBatch of chunkSourceBlobs(Array.from(uniqueBlobs.values()), SOURCE_BLOB_UPLOAD_SESSION_BATCH_SIZE)) {
|
|
2481
|
+
const { data, error, response } = await requestUploadSession(uploadBatch.map(({ contentHash, byteSize }) => ({
|
|
2482
|
+
contentHash,
|
|
2483
|
+
byteSize
|
|
2484
|
+
})));
|
|
2485
|
+
if (error || !data) {
|
|
2486
|
+
throw new SourceBlobSessionRequestError("Failed to create source blob upload session", error, response);
|
|
2487
|
+
}
|
|
2488
|
+
assertSourceBlobUploadSession(data, response);
|
|
2489
|
+
for (const upload of data.uploads) {
|
|
2490
|
+
if (upload.status !== "upload_required") {
|
|
2491
|
+
continue;
|
|
2492
|
+
}
|
|
2493
|
+
const blob = uniqueBlobs.get(upload.contentHash);
|
|
2494
|
+
if (!blob) {
|
|
2495
|
+
throw new Error(`Upload session referenced unknown source blob ${upload.contentHash}.`);
|
|
2496
|
+
}
|
|
2497
|
+
if (!upload.uploadTarget) {
|
|
2498
|
+
throw new Error(`Upload target missing for source blob ${upload.contentHash}.`);
|
|
2499
|
+
}
|
|
2500
|
+
try {
|
|
2501
|
+
await uploadSourceBlob(upload.uploadTarget, blob.content);
|
|
2502
|
+
if (!await confirmSourceBlobAlreadyExists({ requestUploadSession, blob })) {
|
|
2503
|
+
throw new Error(`Source blob ${blob.contentHash} was uploaded but not registered.`);
|
|
2504
|
+
}
|
|
2505
|
+
} catch (error2) {
|
|
2506
|
+
if (isDuplicateDirectUploadError(error2) && await confirmSourceBlobAlreadyExists({ requestUploadSession, blob })) {
|
|
2507
|
+
continue;
|
|
2508
|
+
}
|
|
2509
|
+
throw error2;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
function chunkSourceBlobs(blobs, batchSize) {
|
|
2515
|
+
const chunks = [];
|
|
2516
|
+
for (let index = 0; index < blobs.length; index += batchSize) {
|
|
2517
|
+
chunks.push(blobs.slice(index, index + batchSize));
|
|
2518
|
+
}
|
|
2519
|
+
return chunks;
|
|
2520
|
+
}
|
|
2521
|
+
async function uploadProjectSourceBlobs(options) {
|
|
2522
|
+
const { projectId, blobs } = options;
|
|
2523
|
+
return uploadSourceBlobs({
|
|
2524
|
+
blobs,
|
|
2525
|
+
requestUploadSession: (uploadBlobs) => createProjectSourceBlobUploadSession({
|
|
2526
|
+
path: { projectId },
|
|
2527
|
+
body: { blobs: uploadBlobs }
|
|
2528
|
+
})
|
|
2529
|
+
});
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
// src/services/api/source-revisions-api.ts
|
|
2533
|
+
var SOURCE_BLOB_UPLOAD_BATCH_SIZE = 20;
|
|
2534
|
+
async function uploadProjectSourceBlobsSdk(projectId, blobs) {
|
|
2535
|
+
try {
|
|
2536
|
+
for (const batch of chunkSourceBlobs2(blobs)) {
|
|
2537
|
+
await uploadProjectSourceBlobs({ projectId, blobs: batch });
|
|
2538
|
+
}
|
|
2539
|
+
} catch (error) {
|
|
2540
|
+
if (error instanceof SourceBlobSessionRequestError) {
|
|
2541
|
+
throw toDreamboardApiError(
|
|
2542
|
+
error.apiError,
|
|
2543
|
+
error.response,
|
|
2544
|
+
error.message
|
|
2545
|
+
);
|
|
2546
|
+
}
|
|
2547
|
+
throw error;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
function chunkSourceBlobs2(blobs) {
|
|
2551
|
+
const chunks = [];
|
|
2552
|
+
for (let index = 0; index < blobs.length; index += SOURCE_BLOB_UPLOAD_BATCH_SIZE) {
|
|
2553
|
+
chunks.push(blobs.slice(index, index + SOURCE_BLOB_UPLOAD_BATCH_SIZE));
|
|
2554
|
+
}
|
|
2555
|
+
return chunks;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2210
2558
|
// src/services/project/static-scaffold.ts
|
|
2211
2559
|
import { existsSync, readFileSync } from "fs";
|
|
2212
2560
|
import { readdir, readFile, rm, rmdir, unlink } from "fs/promises";
|
|
@@ -2715,24 +3063,12 @@ async function getDynamicStaticEntries(projectRoot, mode, options = {}) {
|
|
|
2715
3063
|
}
|
|
2716
3064
|
return entries;
|
|
2717
3065
|
}
|
|
2718
|
-
async function readProjectLocalMaintainerRegistry(projectRoot) {
|
|
2719
|
-
const projectConfigPath = path.join(
|
|
2720
|
-
projectRoot,
|
|
2721
|
-
PROJECT_DIR_NAME,
|
|
2722
|
-
PROJECT_CONFIG_FILE
|
|
2723
|
-
);
|
|
2724
|
-
if (!await exists(projectConfigPath)) {
|
|
2725
|
-
return null;
|
|
2726
|
-
}
|
|
2727
|
-
const projectConfig = await loadProjectConfig(projectRoot);
|
|
2728
|
-
return projectConfig.localMaintainerRegistry ?? null;
|
|
2729
|
-
}
|
|
2730
3066
|
async function getExpectedStaticEntries(projectRoot) {
|
|
2731
3067
|
const entries = [
|
|
2732
|
-
...await getStaticAssetEntries()
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
3068
|
+
...(await getStaticAssetEntries()).filter(
|
|
3069
|
+
(entry) => entry.targetPath !== ".npmrc"
|
|
3070
|
+
),
|
|
3071
|
+
...await getDynamicStaticEntries(projectRoot, "update")
|
|
2736
3072
|
];
|
|
2737
3073
|
entries.sort(
|
|
2738
3074
|
(left, right) => left.targetPath.localeCompare(right.targetPath)
|
|
@@ -2913,7 +3249,7 @@ import { unlink as unlink2 } from "fs/promises";
|
|
|
2913
3249
|
import path3 from "path";
|
|
2914
3250
|
|
|
2915
3251
|
// src/services/project/workspace-dependencies.ts
|
|
2916
|
-
import
|
|
3252
|
+
import crypto3 from "crypto";
|
|
2917
3253
|
import { spawn as spawn2 } from "child_process";
|
|
2918
3254
|
import "events";
|
|
2919
3255
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -3173,7 +3509,7 @@ async function readRepoPackageManager() {
|
|
|
3173
3509
|
return hasExactPnpmVersion(packageManager) ? packageManager : DEFAULT_PACKAGE_MANAGER;
|
|
3174
3510
|
}
|
|
3175
3511
|
function fingerprintContent(parts) {
|
|
3176
|
-
return
|
|
3512
|
+
return crypto3.createHash("sha256").update(parts.join("\n---\n")).digest("hex");
|
|
3177
3513
|
}
|
|
3178
3514
|
function resolvePnpmInstallInvocation(installArgs) {
|
|
3179
3515
|
const corepackPath = path2.join(path2.dirname(process.execPath), "corepack");
|
|
@@ -3830,16 +4166,24 @@ var UNPORTABLE_SPECIFIER_PATTERN = /^(file|link|portal|workspace):/;
|
|
|
3830
4166
|
async function buildSourceDependencyProfile(options) {
|
|
3831
4167
|
const packageJson = await readProjectPackageJson(options.projectRoot);
|
|
3832
4168
|
const packages = collectDreamboardPackageSpecifiers(packageJson);
|
|
4169
|
+
const hasLocalSnapshotPackage = Object.values(packages).some(
|
|
4170
|
+
(value) => value.includes("-local.")
|
|
4171
|
+
);
|
|
4172
|
+
const localMaintainerRegistry = hasLocalSnapshotPackage ? options.projectConfig?.localMaintainerRegistry : void 0;
|
|
3833
4173
|
return {
|
|
3834
4174
|
kind: "npm-registry",
|
|
3835
4175
|
packageManager: packageJson.packageManager,
|
|
3836
|
-
dreamboardRegistryUrl: await readDreamboardRegistryFromNpmrc(options.projectRoot) ??
|
|
3837
|
-
localSnapshotId:
|
|
4176
|
+
dreamboardRegistryUrl: await readDreamboardRegistryFromNpmrc(options.projectRoot) ?? localMaintainerRegistry?.registryUrl,
|
|
4177
|
+
localSnapshotId: localMaintainerRegistry?.snapshotId,
|
|
3838
4178
|
packages
|
|
3839
4179
|
};
|
|
3840
4180
|
}
|
|
3841
4181
|
async function assertCompilerPortableDependencies(options) {
|
|
3842
4182
|
const packageJson = await readProjectPackageJson(options.projectRoot);
|
|
4183
|
+
const legacyProblems = collectLegacyDreamboardSpecifiers(packageJson);
|
|
4184
|
+
if (legacyProblems.length > 0) {
|
|
4185
|
+
throwLegacyDreamboardPackageError(legacyProblems);
|
|
4186
|
+
}
|
|
3843
4187
|
const problems = collectUnportableDreamboardSpecifiers(packageJson);
|
|
3844
4188
|
if (problems.length > 0) {
|
|
3845
4189
|
const details = problems.map(
|
|
@@ -3849,7 +4193,7 @@ async function assertCompilerPortableDependencies(options) {
|
|
|
3849
4193
|
[
|
|
3850
4194
|
"Compiler-bound workspaces must install Dreamboard packages from a registry.",
|
|
3851
4195
|
`Found unportable Dreamboard dependency specifier(s): ${details}.`,
|
|
3852
|
-
"Run `dreamboard sync` from a workspace that uses registry-pinned @dreamboard/* and dreamboard versions before compiling."
|
|
4196
|
+
"Run `dreamboard sync` from a workspace that uses registry-pinned @dreamboard-games/* and dreamboard versions before compiling."
|
|
3853
4197
|
].join(" ")
|
|
3854
4198
|
);
|
|
3855
4199
|
}
|
|
@@ -3865,6 +4209,11 @@ async function assertCompilerPortableDependencies(options) {
|
|
|
3865
4209
|
return profile;
|
|
3866
4210
|
}
|
|
3867
4211
|
async function assertReleaseEnvironmentPortableDependencies(options) {
|
|
4212
|
+
const packageJson = await readProjectPackageJson(options.projectRoot);
|
|
4213
|
+
const legacyProblems = collectLegacyDreamboardSpecifiers(packageJson);
|
|
4214
|
+
if (legacyProblems.length > 0) {
|
|
4215
|
+
throwLegacyDreamboardPackageError(legacyProblems);
|
|
4216
|
+
}
|
|
3868
4217
|
const profile = await buildSourceDependencyProfile(options);
|
|
3869
4218
|
if (!isReleaseEnvironment(options.environment)) {
|
|
3870
4219
|
return profile;
|
|
@@ -3898,7 +4247,7 @@ function collectDreamboardPackageSpecifiers(packageJson) {
|
|
|
3898
4247
|
const dependencies = packageJson[field];
|
|
3899
4248
|
if (!dependencies) continue;
|
|
3900
4249
|
for (const [packageName, specifier] of Object.entries(dependencies)) {
|
|
3901
|
-
if (
|
|
4250
|
+
if (isPortableDreamboardPackage(packageName)) {
|
|
3902
4251
|
packages[packageName] = specifier;
|
|
3903
4252
|
}
|
|
3904
4253
|
}
|
|
@@ -3906,7 +4255,7 @@ function collectDreamboardPackageSpecifiers(packageJson) {
|
|
|
3906
4255
|
const overrides = packageJson.pnpm?.overrides;
|
|
3907
4256
|
if (overrides) {
|
|
3908
4257
|
for (const [packageName, specifier] of Object.entries(overrides)) {
|
|
3909
|
-
if (
|
|
4258
|
+
if (isPortableDreamboardPackage(packageName) && typeof specifier === "string" && packages[packageName] === void 0) {
|
|
3910
4259
|
packages[packageName] = specifier;
|
|
3911
4260
|
}
|
|
3912
4261
|
}
|
|
@@ -3919,7 +4268,7 @@ function collectUnportableDreamboardSpecifiers(packageJson) {
|
|
|
3919
4268
|
const dependencies = packageJson[field];
|
|
3920
4269
|
if (!dependencies) continue;
|
|
3921
4270
|
for (const [packageName, specifier] of Object.entries(dependencies)) {
|
|
3922
|
-
if (
|
|
4271
|
+
if (isPortableDreamboardPackage(packageName) && UNPORTABLE_SPECIFIER_PATTERN.test(specifier)) {
|
|
3923
4272
|
problems.push({ location: field, packageName, specifier });
|
|
3924
4273
|
}
|
|
3925
4274
|
}
|
|
@@ -3927,7 +4276,7 @@ function collectUnportableDreamboardSpecifiers(packageJson) {
|
|
|
3927
4276
|
const overrides = packageJson.pnpm?.overrides;
|
|
3928
4277
|
if (overrides) {
|
|
3929
4278
|
for (const [packageName, specifier] of Object.entries(overrides)) {
|
|
3930
|
-
if (
|
|
4279
|
+
if (isPortableDreamboardPackage(packageName) && typeof specifier === "string" && UNPORTABLE_SPECIFIER_PATTERN.test(specifier)) {
|
|
3931
4280
|
problems.push({
|
|
3932
4281
|
location: "pnpm.overrides",
|
|
3933
4282
|
packageName,
|
|
@@ -3938,8 +4287,42 @@ function collectUnportableDreamboardSpecifiers(packageJson) {
|
|
|
3938
4287
|
}
|
|
3939
4288
|
return problems;
|
|
3940
4289
|
}
|
|
3941
|
-
function
|
|
3942
|
-
|
|
4290
|
+
function collectLegacyDreamboardSpecifiers(packageJson) {
|
|
4291
|
+
const problems = [];
|
|
4292
|
+
for (const field of DEPENDENCY_FIELDS) {
|
|
4293
|
+
const dependencies = packageJson[field];
|
|
4294
|
+
if (!dependencies) continue;
|
|
4295
|
+
for (const packageName of Object.keys(dependencies)) {
|
|
4296
|
+
if (isLegacyDreamboardPackage(packageName)) {
|
|
4297
|
+
problems.push({ location: field, packageName });
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
const overrides = packageJson.pnpm?.overrides;
|
|
4302
|
+
if (overrides) {
|
|
4303
|
+
for (const packageName of Object.keys(overrides)) {
|
|
4304
|
+
if (isLegacyDreamboardPackage(packageName)) {
|
|
4305
|
+
problems.push({ location: "pnpm.overrides", packageName });
|
|
4306
|
+
}
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
return problems;
|
|
4310
|
+
}
|
|
4311
|
+
function throwLegacyDreamboardPackageError(problems) {
|
|
4312
|
+
const details = problems.map((problem) => `${problem.location} ${problem.packageName}`).join("; ");
|
|
4313
|
+
throw new Error(
|
|
4314
|
+
[
|
|
4315
|
+
"Legacy @dreamboard/* package dependencies are no longer supported in compiler-bound workspaces.",
|
|
4316
|
+
`Found ${details}.`,
|
|
4317
|
+
"Repin to the public @dreamboard-games/* packages and rerun the command."
|
|
4318
|
+
].join(" ")
|
|
4319
|
+
);
|
|
4320
|
+
}
|
|
4321
|
+
function isPortableDreamboardPackage(packageName) {
|
|
4322
|
+
return packageName === "dreamboard" || packageName.startsWith("@dreamboard-games/");
|
|
4323
|
+
}
|
|
4324
|
+
function isLegacyDreamboardPackage(packageName) {
|
|
4325
|
+
return packageName.startsWith("@dreamboard/");
|
|
3943
4326
|
}
|
|
3944
4327
|
function isReleaseEnvironment(environment) {
|
|
3945
4328
|
return environment === "staging" || environment === "prod";
|
|
@@ -5676,6 +6059,9 @@ async function assertReducerContractPreflight(projectRoot) {
|
|
|
5676
6059
|
|
|
5677
6060
|
// src/services/project/reducer-bundle-preflight.ts
|
|
5678
6061
|
import path13 from "path";
|
|
6062
|
+
import { isPerPlayer, perPlayerSchema } from "@dreamboard-games/sdk/reducer";
|
|
6063
|
+
import "@dreamboard-games/sdk/reducer-contract";
|
|
6064
|
+
import { materializeManifestTable } from "@dreamboard-games/sdk/codegen";
|
|
5679
6065
|
globalThis.__DREAMBOARD_AUTHORING_WARNINGS__ = true;
|
|
5680
6066
|
var REDUCER_BUNDLE_ENTRY_PATH = path13.join("app", "index.ts");
|
|
5681
6067
|
var PREFLIGHT_RNG_SEED = 1337;
|
|
@@ -5921,7 +6307,7 @@ function isSourceRevisionPath(filePath) {
|
|
|
5921
6307
|
return filePath !== RULE_FILE && isAllowedGamePath(filePath);
|
|
5922
6308
|
}
|
|
5923
6309
|
function shouldAlwaysUpsertSourcePath(filePath) {
|
|
5924
|
-
return filePath === ".npmrc" ||
|
|
6310
|
+
return filePath === ".npmrc" || isDynamicGeneratedPath(filePath);
|
|
5925
6311
|
}
|
|
5926
6312
|
|
|
5927
6313
|
// src/commands/dev.ts
|
|
@@ -6329,6 +6715,12 @@ async function ensureDevCompiledResult(options) {
|
|
|
6329
6715
|
const existingLocalMaintainerRegistry = getProjectLocalMaintainerRegistry(
|
|
6330
6716
|
options.projectConfig
|
|
6331
6717
|
);
|
|
6718
|
+
if (!localMaintainerEnabled && existingLocalMaintainerRegistry) {
|
|
6719
|
+
await updateProjectState(
|
|
6720
|
+
options.projectRoot,
|
|
6721
|
+
updateProjectLocalMaintainerRegistry(options.projectConfig, void 0)
|
|
6722
|
+
);
|
|
6723
|
+
}
|
|
6332
6724
|
const refreshedLocalMaintainerRegistry = localMaintainerEnabled ? await runLoggedStep(
|
|
6333
6725
|
"Checking local SDK snapshot...",
|
|
6334
6726
|
() => ensureLocalMaintainerSnapshot(options.config.apiBaseUrl)
|
|
@@ -6496,12 +6888,12 @@ async function readWorkspacePackageJson(projectRoot) {
|
|
|
6496
6888
|
return {
|
|
6497
6889
|
dependencies: Object.fromEntries(
|
|
6498
6890
|
Object.entries(parsed.dependencies ?? {}).filter(
|
|
6499
|
-
([name]) => name
|
|
6891
|
+
([name]) => isDreamboardPublicPackage(name)
|
|
6500
6892
|
)
|
|
6501
6893
|
),
|
|
6502
6894
|
devDependencies: Object.fromEntries(
|
|
6503
6895
|
Object.entries(parsed.devDependencies ?? {}).filter(
|
|
6504
|
-
([name]) => name
|
|
6896
|
+
([name]) => isDreamboardPublicPackage(name)
|
|
6505
6897
|
)
|
|
6506
6898
|
)
|
|
6507
6899
|
};
|
|
@@ -6509,6 +6901,9 @@ async function readWorkspacePackageJson(projectRoot) {
|
|
|
6509
6901
|
return null;
|
|
6510
6902
|
}
|
|
6511
6903
|
}
|
|
6904
|
+
function isDreamboardPublicPackage(packageName) {
|
|
6905
|
+
return packageName === "dreamboard" || packageName.startsWith("@dreamboard-games/");
|
|
6906
|
+
}
|
|
6512
6907
|
function stableJson(value) {
|
|
6513
6908
|
if (value === null || typeof value !== "object") {
|
|
6514
6909
|
return JSON.stringify(value);
|
|
@@ -7638,7 +8033,7 @@ async function assertKnownPlayerId(sessionId, playerId) {
|
|
|
7638
8033
|
}
|
|
7639
8034
|
|
|
7640
8035
|
// src/commands/login.ts
|
|
7641
|
-
import
|
|
8036
|
+
import crypto4 from "crypto";
|
|
7642
8037
|
var login_default = defineCommand({
|
|
7643
8038
|
meta: {
|
|
7644
8039
|
name: "login",
|
|
@@ -7664,7 +8059,7 @@ var login_default = defineCommand({
|
|
|
7664
8059
|
void 0,
|
|
7665
8060
|
storedSession
|
|
7666
8061
|
);
|
|
7667
|
-
const state =
|
|
8062
|
+
const state = crypto4.randomUUID();
|
|
7668
8063
|
const pkce = createPkcePair();
|
|
7669
8064
|
const server = await startOAuthCallbackServer(
|
|
7670
8065
|
state,
|
|
@@ -8285,6 +8680,12 @@ var sync_default = defineCommand({
|
|
|
8285
8680
|
config.apiBaseUrl
|
|
8286
8681
|
);
|
|
8287
8682
|
const existingLocalMaintainerRegistry = getProjectLocalMaintainerRegistry(projectConfig);
|
|
8683
|
+
if (!localMaintainerEnabled && existingLocalMaintainerRegistry) {
|
|
8684
|
+
nextProjectConfig = updateProjectLocalMaintainerRegistry(
|
|
8685
|
+
nextProjectConfig,
|
|
8686
|
+
void 0
|
|
8687
|
+
);
|
|
8688
|
+
}
|
|
8288
8689
|
const refreshedLocalMaintainerRegistry = localMaintainerEnabled ? await runLoggedStep2(
|
|
8289
8690
|
"Checking local SDK snapshot...",
|
|
8290
8691
|
() => ensureLocalMaintainerSnapshot(config.apiBaseUrl)
|