@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
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
contractFingerprint,
|
|
4
|
-
createReducerBundle,
|
|
5
|
-
zod_exports
|
|
6
|
-
} from "./chunk-HBNDKQT5.mjs";
|
|
7
2
|
import {
|
|
8
3
|
bundleTypeScriptModuleText,
|
|
9
4
|
importTypeScriptModule
|
|
10
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XKCJBIRY.mjs";
|
|
11
6
|
import {
|
|
12
7
|
STALE_CONTRACT_ARTIFACT_CODE,
|
|
13
8
|
isStaleContractArtifactError,
|
|
14
9
|
toDreamboardApiError
|
|
15
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-COB56ESI.mjs";
|
|
16
11
|
import {
|
|
17
12
|
loadManifest
|
|
18
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UWJIZML3.mjs";
|
|
19
14
|
import {
|
|
20
15
|
REDUCER_TESTING_TYPES_WRAPPER_CONTENT,
|
|
21
16
|
buildReducerTestingContractContent
|
|
22
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-F2DIOJJZ.mjs";
|
|
23
18
|
import {
|
|
24
19
|
createGameplayCapability,
|
|
25
20
|
createProjectSession,
|
|
@@ -27,23 +22,20 @@ import {
|
|
|
27
22
|
getSessionSnapshot,
|
|
28
23
|
hashContent,
|
|
29
24
|
startGame
|
|
30
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-6XRC5PWB.mjs";
|
|
31
26
|
import {
|
|
32
27
|
external_exports
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
materializeManifestTable
|
|
36
|
-
} from "./chunk-U6OJN7XS.mjs";
|
|
28
|
+
} from "./chunk-JZTH3EMV.mjs";
|
|
37
29
|
import {
|
|
38
30
|
ensureDir,
|
|
39
31
|
exists,
|
|
40
32
|
readTextFileIfExists,
|
|
41
33
|
writeJsonFile,
|
|
42
34
|
writeTextFile
|
|
43
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-IAYRNVUC.mjs";
|
|
44
36
|
import {
|
|
45
37
|
PROJECT_DIR_NAME
|
|
46
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-M7UVBANQ.mjs";
|
|
47
39
|
|
|
48
40
|
// src/services/testing/reducer-native-test-harness.ts
|
|
49
41
|
import path2 from "path";
|
|
@@ -57,11 +49,19 @@ import {
|
|
|
57
49
|
} from "fs";
|
|
58
50
|
import { readdir } from "fs/promises";
|
|
59
51
|
import { isDeepStrictEqual } from "util";
|
|
52
|
+
import {
|
|
53
|
+
contractFingerprint,
|
|
54
|
+
createReducerBundle
|
|
55
|
+
} from "@dreamboard-games/sdk/reducer";
|
|
56
|
+
import {
|
|
57
|
+
ReducerWireZod as ReducerContractZod
|
|
58
|
+
} from "@dreamboard-games/sdk/reducer-contract";
|
|
59
|
+
import { materializeManifestTable } from "@dreamboard-games/sdk/codegen";
|
|
60
60
|
|
|
61
61
|
// src/services/gameplay-authority-submit.ts
|
|
62
62
|
import { randomUUID } from "crypto";
|
|
63
63
|
|
|
64
|
-
// ../../node_modules/.pnpm/@dreamboard-games+gameplay-authority-protocol@0.1.0-alpha.0/node_modules/@dreamboard-games/gameplay-authority-protocol/
|
|
64
|
+
// ../../node_modules/.pnpm/@dreamboard-games+gameplay-authority-protocol@0.1.0-alpha.0/node_modules/@dreamboard-games/gameplay-authority-protocol/dist/frames.js
|
|
65
65
|
var GAMEPLAY_AUTHORITY_AUDIENCE = "dreamboard-gameplay-authority";
|
|
66
66
|
var GAMEPLAY_TUNNEL_AUDIENCE = "dreamboard-gameplay-authority-tunnel";
|
|
67
67
|
var GameplayPermissionSchema = external_exports.enum([
|
|
@@ -114,14 +114,11 @@ var PerfGameplayCapabilityClaimsSchema = BaseGameplayCapabilityClaimsSchema.exte
|
|
|
114
114
|
perfRunId: external_exports.string().uuid(),
|
|
115
115
|
laneId: external_exports.string().min(1)
|
|
116
116
|
});
|
|
117
|
-
var GameplayCapabilityClaimsSchema = external_exports.discriminatedUnion(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
PerfGameplayCapabilityClaimsSchema
|
|
123
|
-
]
|
|
124
|
-
);
|
|
117
|
+
var GameplayCapabilityClaimsSchema = external_exports.discriminatedUnion("actorKind", [
|
|
118
|
+
UserGameplayCapabilityClaimsSchema,
|
|
119
|
+
DemoGameplayCapabilityClaimsSchema,
|
|
120
|
+
PerfGameplayCapabilityClaimsSchema
|
|
121
|
+
]);
|
|
125
122
|
var GameplayTunnelClaimsSchema = external_exports.object({
|
|
126
123
|
aud: external_exports.literal(GAMEPLAY_TUNNEL_AUDIENCE),
|
|
127
124
|
iss: external_exports.string().min(1),
|
|
@@ -261,7 +258,7 @@ var TunnelServerFrameSchema = external_exports.discriminatedUnion("type", [
|
|
|
261
258
|
HistoryRestoreRejectedFrameSchema
|
|
262
259
|
]);
|
|
263
260
|
|
|
264
|
-
// ../../node_modules/.pnpm/@dreamboard-games+gameplay-authority-client@0.1.0-alpha.1/node_modules/@dreamboard-games/gameplay-authority-client/
|
|
261
|
+
// ../../node_modules/.pnpm/@dreamboard-games+gameplay-authority-client@0.1.0-alpha.1/node_modules/@dreamboard-games/gameplay-authority-client/dist/index.js
|
|
265
262
|
var DEFAULT_OPEN_TIMEOUT_MS = 5e3;
|
|
266
263
|
var DEFAULT_REQUEST_TIMEOUT_MS = 1e4;
|
|
267
264
|
var GameplayAuthorityRecoveringError = class extends Error {
|
|
@@ -279,17 +276,11 @@ async function connectGameplayAuthority(input) {
|
|
|
279
276
|
const socket = new webSocketFactory(input.websocketUrl, input.webSocketInit);
|
|
280
277
|
try {
|
|
281
278
|
await waitUntilOpen(socket, openTimeoutMs);
|
|
282
|
-
socket.send(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
);
|
|
288
|
-
await waitForServerFrame(
|
|
289
|
-
socket,
|
|
290
|
-
(frame) => frame.type === "auth.accepted",
|
|
291
|
-
requestTimeoutMs
|
|
292
|
-
);
|
|
279
|
+
socket.send(JSON.stringify({
|
|
280
|
+
type: "auth.connect",
|
|
281
|
+
capabilityToken: input.capabilityToken
|
|
282
|
+
}));
|
|
283
|
+
await waitForServerFrame(socket, (frame) => frame.type === "auth.accepted", requestTimeoutMs);
|
|
293
284
|
return new WebSocketGameplayAuthorityClient(socket, requestTimeoutMs);
|
|
294
285
|
} catch (error) {
|
|
295
286
|
socket.close();
|
|
@@ -297,38 +288,30 @@ async function connectGameplayAuthority(input) {
|
|
|
297
288
|
}
|
|
298
289
|
}
|
|
299
290
|
var WebSocketGameplayAuthorityClient = class {
|
|
291
|
+
socket;
|
|
292
|
+
requestTimeoutMs;
|
|
300
293
|
constructor(socket, requestTimeoutMs) {
|
|
301
294
|
this.socket = socket;
|
|
302
295
|
this.requestTimeoutMs = requestTimeoutMs;
|
|
303
296
|
}
|
|
304
|
-
socket;
|
|
305
|
-
requestTimeoutMs;
|
|
306
297
|
resume(input = {}) {
|
|
307
|
-
this.socket.send(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
})
|
|
314
|
-
);
|
|
298
|
+
this.socket.send(JSON.stringify({
|
|
299
|
+
type: "session.resume",
|
|
300
|
+
lastSeenGeneration: input.lastSeenGeneration ?? null,
|
|
301
|
+
lastSeenVersion: input.lastSeenVersion ?? null,
|
|
302
|
+
unacknowledgedClientActionIds: input.unacknowledgedClientActionIds ?? []
|
|
303
|
+
}));
|
|
315
304
|
}
|
|
316
305
|
async submitCommand(input) {
|
|
317
|
-
this.socket.send(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
);
|
|
327
|
-
const frame = await waitForServerFrame(
|
|
328
|
-
this.socket,
|
|
329
|
-
(candidate) => candidate.type === "authority.recovering" || candidate.type === "command.accepted" && candidate.clientActionId === input.clientActionId || candidate.type === "command.rejected" && (candidate.clientActionId === void 0 || candidate.clientActionId === input.clientActionId),
|
|
330
|
-
this.requestTimeoutMs
|
|
331
|
-
);
|
|
306
|
+
this.socket.send(JSON.stringify({
|
|
307
|
+
type: "command.submit",
|
|
308
|
+
clientActionId: input.clientActionId,
|
|
309
|
+
expectedVersion: input.expectedVersion,
|
|
310
|
+
actionSetVersion: input.actionSetVersion,
|
|
311
|
+
interactionId: input.interactionId,
|
|
312
|
+
inputs: input.inputs
|
|
313
|
+
}));
|
|
314
|
+
const frame = await waitForServerFrame(this.socket, (candidate) => candidate.type === "authority.recovering" || candidate.type === "command.accepted" && candidate.clientActionId === input.clientActionId || candidate.type === "command.rejected" && (candidate.clientActionId === void 0 || candidate.clientActionId === input.clientActionId), this.requestTimeoutMs);
|
|
332
315
|
throwIfRecovering(frame);
|
|
333
316
|
if (frame.type !== "command.accepted" && frame.type !== "command.rejected") {
|
|
334
317
|
throw new Error("Unexpected gameplay authority command frame.");
|
|
@@ -336,19 +319,13 @@ var WebSocketGameplayAuthorityClient = class {
|
|
|
336
319
|
return frame;
|
|
337
320
|
}
|
|
338
321
|
async restoreHistory(input) {
|
|
339
|
-
this.socket.send(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
);
|
|
347
|
-
const frame = await waitForServerFrame(
|
|
348
|
-
this.socket,
|
|
349
|
-
(candidate) => candidate.type === "authority.recovering" || candidate.type === "history.restored" && candidate.restoreId === input.restoreId || candidate.type === "history.restoreRejected" && (candidate.restoreId === void 0 || candidate.restoreId === input.restoreId),
|
|
350
|
-
this.requestTimeoutMs
|
|
351
|
-
);
|
|
322
|
+
this.socket.send(JSON.stringify({
|
|
323
|
+
type: "history.restore",
|
|
324
|
+
restoreId: input.restoreId,
|
|
325
|
+
targetGeneration: input.targetGeneration,
|
|
326
|
+
targetVersion: input.targetVersion
|
|
327
|
+
}));
|
|
328
|
+
const frame = await waitForServerFrame(this.socket, (candidate) => candidate.type === "authority.recovering" || candidate.type === "history.restored" && candidate.restoreId === input.restoreId || candidate.type === "history.restoreRejected" && (candidate.restoreId === void 0 || candidate.restoreId === input.restoreId), this.requestTimeoutMs);
|
|
352
329
|
throwIfRecovering(frame);
|
|
353
330
|
if (frame.type !== "history.restored" && frame.type !== "history.restoreRejected") {
|
|
354
331
|
throw new Error("Unexpected gameplay authority history frame.");
|
|
@@ -364,10 +341,7 @@ var WebSocketGameplayAuthorityClient = class {
|
|
|
364
341
|
};
|
|
365
342
|
function throwIfRecovering(frame) {
|
|
366
343
|
if (frame.type === "authority.recovering") {
|
|
367
|
-
throw new GameplayAuthorityRecoveringError(
|
|
368
|
-
frame.message,
|
|
369
|
-
frame.retryAfterMs
|
|
370
|
-
);
|
|
344
|
+
throw new GameplayAuthorityRecoveringError(frame.message, frame.retryAfterMs);
|
|
371
345
|
}
|
|
372
346
|
}
|
|
373
347
|
function browserWebSocketFactory() {
|
|
@@ -378,9 +352,7 @@ var BrowserGameplayAuthorityWebSocket = class {
|
|
|
378
352
|
listeners = /* @__PURE__ */ new Map();
|
|
379
353
|
constructor(url, init) {
|
|
380
354
|
if (init?.headers && Object.keys(init.headers).length > 0) {
|
|
381
|
-
throw new Error(
|
|
382
|
-
"Browser WebSocket does not support custom headers; provide a webSocketFactory for header-aware runtimes."
|
|
383
|
-
);
|
|
355
|
+
throw new Error("Browser WebSocket does not support custom headers; provide a webSocketFactory for header-aware runtimes.");
|
|
384
356
|
}
|
|
385
357
|
this.socket = new WebSocket(url);
|
|
386
358
|
}
|
|
@@ -428,9 +400,7 @@ async function waitForEvent(socket, event, timeoutMs) {
|
|
|
428
400
|
},
|
|
429
401
|
onError(error) {
|
|
430
402
|
cleanup();
|
|
431
|
-
reject(
|
|
432
|
-
error instanceof Error ? error : new Error("gameplay socket error")
|
|
433
|
-
);
|
|
403
|
+
reject(error instanceof Error ? error : new Error("gameplay socket error"));
|
|
434
404
|
},
|
|
435
405
|
onClose() {
|
|
436
406
|
cleanup();
|
|
@@ -450,14 +420,10 @@ async function waitForServerFrame(socket, predicate, timeoutMs) {
|
|
|
450
420
|
onMessage(data) {
|
|
451
421
|
let frame;
|
|
452
422
|
try {
|
|
453
|
-
frame = ServerGameplayFrameSchema.parse(
|
|
454
|
-
JSON.parse(messageToString(data))
|
|
455
|
-
);
|
|
423
|
+
frame = ServerGameplayFrameSchema.parse(JSON.parse(messageToString(data)));
|
|
456
424
|
} catch (error) {
|
|
457
425
|
cleanup();
|
|
458
|
-
reject(
|
|
459
|
-
error instanceof Error ? error : new Error("invalid gameplay authority frame")
|
|
460
|
-
);
|
|
426
|
+
reject(error instanceof Error ? error : new Error("invalid gameplay authority frame"));
|
|
461
427
|
return;
|
|
462
428
|
}
|
|
463
429
|
if (predicate(frame)) {
|
|
@@ -467,9 +433,7 @@ async function waitForServerFrame(socket, predicate, timeoutMs) {
|
|
|
467
433
|
},
|
|
468
434
|
onError(error) {
|
|
469
435
|
cleanup();
|
|
470
|
-
reject(
|
|
471
|
-
error instanceof Error ? error : new Error("gameplay socket error")
|
|
472
|
-
);
|
|
436
|
+
reject(error instanceof Error ? error : new Error("gameplay socket error"));
|
|
473
437
|
},
|
|
474
438
|
onClose() {
|
|
475
439
|
cleanup();
|
|
@@ -511,9 +475,7 @@ function readServerFrames(socket, signal) {
|
|
|
511
475
|
};
|
|
512
476
|
const onMessage = (data) => {
|
|
513
477
|
try {
|
|
514
|
-
queue.push(
|
|
515
|
-
ServerGameplayFrameSchema.parse(JSON.parse(messageToString(data)))
|
|
516
|
-
);
|
|
478
|
+
queue.push(ServerGameplayFrameSchema.parse(JSON.parse(messageToString(data))));
|
|
517
479
|
} catch (candidate) {
|
|
518
480
|
error = candidate instanceof Error ? candidate : new Error("invalid gameplay authority frame");
|
|
519
481
|
}
|
|
@@ -810,7 +772,7 @@ function escapeRegExp(value) {
|
|
|
810
772
|
}
|
|
811
773
|
var testingExpectApiFactoryPromise;
|
|
812
774
|
async function loadTestingExpectApiFactory() {
|
|
813
|
-
testingExpectApiFactoryPromise ??= import("
|
|
775
|
+
testingExpectApiFactoryPromise ??= import("@dreamboard-games/sdk/testing").then(
|
|
814
776
|
(module) => module.createExpectApi
|
|
815
777
|
);
|
|
816
778
|
return testingExpectApiFactoryPromise;
|
|
@@ -1540,7 +1502,7 @@ function assertDispatchResultWireContract(result) {
|
|
|
1540
1502
|
"dispatch",
|
|
1541
1503
|
result,
|
|
1542
1504
|
"DispatchResult",
|
|
1543
|
-
|
|
1505
|
+
ReducerContractZod.DispatchResultSchema
|
|
1544
1506
|
);
|
|
1545
1507
|
}
|
|
1546
1508
|
async function createBrowserBridgeClient(page) {
|
|
@@ -3172,3 +3134,4 @@ export {
|
|
|
3172
3134
|
generateReducerNativeArtifacts,
|
|
3173
3135
|
runReducerNativeScenarios
|
|
3174
3136
|
};
|
|
3137
|
+
//# sourceMappingURL=chunk-4GU3PCHV.mjs.map
|