@dreamboard-games/sdk 0.4.0-alpha.9 → 0.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -11
- package/dist/authoring/index.d.ts +3 -6
- package/dist/authoring/index.js +3 -3
- package/dist/authoring-compiler.d.ts +3 -3
- package/dist/authoring-compiler.js +4 -5
- package/dist/authoring-materialize-cli.js +6 -7
- package/dist/authoring-materialize-cli.js.map +1 -1
- package/dist/browser-interaction.d.ts +21 -21
- package/dist/{chunk-3PFDHTR7.js → chunk-2GQIALJL.js} +37 -11
- package/dist/chunk-2GQIALJL.js.map +1 -0
- package/dist/{chunk-XDGRC6OR.js → chunk-533O7C4L.js} +94 -38
- package/dist/chunk-533O7C4L.js.map +1 -0
- package/dist/{chunk-BUOODBVO.js → chunk-6LMESVGT.js} +9 -28
- package/dist/chunk-6LMESVGT.js.map +1 -0
- package/dist/{chunk-GMOBG7Y7.js → chunk-DQS2EG5E.js} +5 -5
- package/dist/{chunk-GMOBG7Y7.js.map → chunk-DQS2EG5E.js.map} +1 -1
- package/dist/{chunk-L3W2FPRQ.js → chunk-EOEA3I64.js} +84 -13
- package/dist/chunk-EOEA3I64.js.map +1 -0
- package/dist/{chunk-YNW3KBDE.js → chunk-FL67RDID.js} +2 -2
- package/dist/{chunk-SACZWUA6.js → chunk-HIH6Y4FA.js} +86 -1224
- package/dist/{chunk-SACZWUA6.js.map → chunk-HIH6Y4FA.js.map} +1 -1
- package/dist/{chunk-P6IJ5YVY.js → chunk-HUK4234C.js} +21 -9
- package/dist/chunk-HUK4234C.js.map +1 -0
- package/dist/{chunk-7ADPYKFT.js → chunk-KGV2EUNN.js} +5 -5
- package/dist/chunk-KGV2EUNN.js.map +1 -0
- package/dist/{chunk-JRGP6W4V.js → chunk-KRJPRYEA.js} +49 -4
- package/dist/chunk-KRJPRYEA.js.map +1 -0
- package/dist/chunk-KWHOFBDM.js +9 -0
- package/dist/chunk-KWHOFBDM.js.map +1 -0
- package/dist/{chunk-UC2UXAC6.js → chunk-LMHCGCA6.js} +2 -2
- package/dist/{chunk-NGYFBNBP.js → chunk-N33CGX2F.js} +15 -85
- package/dist/chunk-N33CGX2F.js.map +1 -0
- package/dist/{chunk-5XTAQ4EQ.js → chunk-TXELBVTG.js} +2 -2
- package/dist/{chunk-2TRZSZGD.js → chunk-VRRR6QZT.js} +9 -12
- package/dist/chunk-VRRR6QZT.js.map +1 -0
- package/dist/chunk-VWTKGIYF.js +90 -0
- package/dist/chunk-VWTKGIYF.js.map +1 -0
- package/dist/{chunk-QQNL4WTX.js → chunk-XFMSLL3P.js} +120 -61
- package/dist/chunk-XFMSLL3P.js.map +1 -0
- package/dist/{chunk-WDR7SKBM.js → chunk-ZSTCUJKZ.js} +4 -4
- package/dist/chunk-ZSTCUJKZ.js.map +1 -0
- package/dist/codegen.js +1 -1
- package/dist/{components-BPzsSRs8.d.ts → components-CNAt5J1p.d.ts} +1 -1
- package/dist/{definitions-0kjPV9wh.d.ts → definitions-bZSBaPjj.d.ts} +9 -3
- package/dist/digest.d.ts +8 -0
- package/dist/{index-CWzWpQzM.d.ts → index-CR69MyWr.d.ts} +2 -2
- package/dist/{index.d-C7Ztirg6.d.ts → index.d-Bw8AOcgp.d.ts} +324 -225
- package/dist/index.js +2 -2
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -2
- package/dist/plugin-runtime-contract.d.ts +17 -0
- package/dist/plugin-runtime-contract.js +94 -0
- package/dist/{protocol-B2LWcqB4.d.ts → protocol-CVaSqPgX.d.ts} +45 -47
- package/dist/reducer/advanced.d.ts +5 -4
- package/dist/reducer/advanced.js +10 -85
- package/dist/reducer/advanced.js.map +1 -1
- package/dist/reducer-contract.d.ts +1 -1
- package/dist/reducer-contract.js +6 -4
- package/dist/reducer.d.ts +9 -93
- package/dist/reducer.js +3 -3
- package/dist/reducer.js.map +1 -1
- package/dist/reference-games/index.d.ts +29 -11
- package/dist/reference-games/index.js +43 -45
- package/dist/reference-games/index.js.map +1 -1
- package/dist/runtime/primitives.d.ts +3 -3
- package/dist/runtime/primitives.js +5 -5
- package/dist/runtime/runtime-api.d.ts +1 -1
- package/dist/runtime/workspace-contract.d.ts +343 -11
- package/dist/runtime/workspace-contract.js +12 -6
- package/dist/{runtime-B_w9AO2n.d.ts → runtime-C7Z2acNU.d.ts} +7 -26
- package/dist/{runtime-api-xCWLMQRT.d.ts → runtime-api-CgPuEVeF.d.ts} +2 -13
- package/dist/runtime.d.ts +7 -7
- package/dist/runtime.js +18 -14
- package/dist/runtime.js.map +1 -1
- package/dist/schema.d.ts +405 -0
- package/dist/testing-compiler.d.ts +6 -5
- package/dist/testing-compiler.js +41 -5
- package/dist/testing-compiler.js.map +1 -1
- package/dist/testing-runtime.d.ts +7 -6
- package/dist/testing-runtime.js +6 -6
- package/dist/testing.d.ts +30 -107
- package/dist/testing.js +44 -371
- package/dist/testing.js.map +1 -1
- package/dist/{types-Bvptkukh.d.ts → types-DN4O7kH_.d.ts} +2 -2
- package/dist/{types-_zfC_7CD.d.ts → types-q1Guidm5.d.ts} +4 -5
- package/dist/types.d.ts +0 -1
- package/dist/ui/components.d.ts +3 -2
- package/dist/ui/components.js +1 -1
- package/dist/ui/plugin-styles.css +1 -1
- package/dist/{ui-contract-CUC7Lyoc.d.ts → ui-contract-BC4JpysE.d.ts} +2 -6
- package/dist/ui.d.ts +4 -3
- package/dist/ui.js +2 -2
- package/dist/{views-DE2eZxPz.d.ts → views-D2Cfzr3h.d.ts} +3 -3
- package/package.json +28 -29
- package/REFERENCE.md +0 -23787
- package/dist/chunk-2TRZSZGD.js.map +0 -1
- package/dist/chunk-3PFDHTR7.js.map +0 -1
- package/dist/chunk-45P5CEGH.js +0 -176
- package/dist/chunk-45P5CEGH.js.map +0 -1
- package/dist/chunk-7ADPYKFT.js.map +0 -1
- package/dist/chunk-BUOODBVO.js.map +0 -1
- package/dist/chunk-JRGP6W4V.js.map +0 -1
- package/dist/chunk-L3W2FPRQ.js.map +0 -1
- package/dist/chunk-NGYFBNBP.js.map +0 -1
- package/dist/chunk-P6IJ5YVY.js.map +0 -1
- package/dist/chunk-QQNL4WTX.js.map +0 -1
- package/dist/chunk-SFOAY5H4.js +0 -12
- package/dist/chunk-SFOAY5H4.js.map +0 -1
- package/dist/chunk-UNVCT5Z7.js +0 -73
- package/dist/chunk-UNVCT5Z7.js.map +0 -1
- package/dist/chunk-WDR7SKBM.js.map +0 -1
- package/dist/chunk-XDGRC6OR.js.map +0 -1
- package/dist/chunk-XLHLFTLI.js +0 -399
- package/dist/chunk-XLHLFTLI.js.map +0 -1
- package/dist/reference-game-compiler.d.ts +0 -45
- package/dist/reference-game-compiler.js +0 -25
- package/dist/reference-game-source-manifest-cli.d.ts +0 -1
- package/dist/reference-game-source-manifest-cli.js +0 -84
- package/dist/reference-game-source-manifest-cli.js.map +0 -1
- package/dist/schema-9jZzlEWZ.d.ts +0 -220
- /package/dist/{chunk-YNW3KBDE.js.map → chunk-FL67RDID.js.map} +0 -0
- /package/dist/{chunk-UC2UXAC6.js.map → chunk-LMHCGCA6.js.map} +0 -0
- /package/dist/{chunk-5XTAQ4EQ.js.map → chunk-TXELBVTG.js.map} +0 -0
- /package/dist/{reference-game-compiler.js.map → plugin-runtime-contract.js.map} +0 -0
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
spendPlayerResourcesInPlace,
|
|
104
104
|
transferPlayerResources,
|
|
105
105
|
transferPlayerResourcesInPlace
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-FL67RDID.js";
|
|
107
107
|
import {
|
|
108
108
|
RuntimeJsonSchema,
|
|
109
109
|
assertJsonWithinLimits
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
REDUCER_CONTRACT_VERSION,
|
|
113
113
|
builders_exports,
|
|
114
114
|
zod_exports
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-2GQIALJL.js";
|
|
116
116
|
|
|
117
117
|
// src/reducer/diagnostics.ts
|
|
118
118
|
var noopDiagnosticsSink = {
|
|
@@ -1342,6 +1342,8 @@ function createRuntimeInstructionEngine({
|
|
|
1342
1342
|
const prepareForInstructionDrain = (state) => prepareInstructionState ? prepareInstructionState(state) : state;
|
|
1343
1343
|
function drainInstructions(state, instructionsToDrain) {
|
|
1344
1344
|
let workingState = state;
|
|
1345
|
+
let terminal;
|
|
1346
|
+
const events = [];
|
|
1345
1347
|
const instructionQueue = [...instructionsToDrain];
|
|
1346
1348
|
const systemQueue = [];
|
|
1347
1349
|
while (instructionQueue.length > 0 || systemQueue.length > 0) {
|
|
@@ -1353,6 +1355,8 @@ function createRuntimeInstructionEngine({
|
|
|
1353
1355
|
if (instruction === void 0) break;
|
|
1354
1356
|
const resolved = resolveInstruction(workingState, instruction);
|
|
1355
1357
|
workingState = resolved.state;
|
|
1358
|
+
terminal ??= resolved.terminal;
|
|
1359
|
+
events.push(...resolved.events ?? []);
|
|
1356
1360
|
if (resolved.queuedInstructions.length > 0) {
|
|
1357
1361
|
instructionQueue.unshift(...resolved.queuedInstructions);
|
|
1358
1362
|
}
|
|
@@ -1368,10 +1372,12 @@ function createRuntimeInstructionEngine({
|
|
|
1368
1372
|
);
|
|
1369
1373
|
}
|
|
1370
1374
|
workingState = result.state;
|
|
1375
|
+
terminal ??= result.terminal;
|
|
1376
|
+
events.push(...result.events ?? []);
|
|
1371
1377
|
instructionQueue.push(...result.instructions ?? []);
|
|
1372
1378
|
}
|
|
1373
1379
|
}
|
|
1374
|
-
return workingState;
|
|
1380
|
+
return { state: workingState, ...terminal ? { terminal } : {}, events };
|
|
1375
1381
|
}
|
|
1376
1382
|
function dispatch(state, input) {
|
|
1377
1383
|
let workingState = state;
|
|
@@ -1420,6 +1426,8 @@ function createRuntimeInstructionEngine({
|
|
|
1420
1426
|
});
|
|
1421
1427
|
const resolved = resolveInstruction(workingState, instruction);
|
|
1422
1428
|
workingState = resolved.state;
|
|
1429
|
+
terminal ??= resolved.terminal;
|
|
1430
|
+
events.push(...resolved.events ?? []);
|
|
1423
1431
|
trace.push(...resolved.trace);
|
|
1424
1432
|
if (resolved.queuedInstructions.length > 0) {
|
|
1425
1433
|
instructionQueue.unshift(...resolved.queuedInstructions);
|
|
@@ -1840,6 +1848,8 @@ function createFlowInstructionResolver(lifecycle) {
|
|
|
1840
1848
|
);
|
|
1841
1849
|
return {
|
|
1842
1850
|
state: initialized.state,
|
|
1851
|
+
...initialized.terminal ? { terminal: initialized.terminal } : {},
|
|
1852
|
+
events: initialized.events,
|
|
1843
1853
|
queuedInputs: [],
|
|
1844
1854
|
queuedInstructions: initialized.instructions,
|
|
1845
1855
|
trace: initialized.consumptions.map((consumption) => ({
|
|
@@ -2720,6 +2730,7 @@ function createTrustedInstructionRunner(scope, interactions, lifecycle) {
|
|
|
2720
2730
|
runtime: { ...stateWithSubmission.runtime, rng: random.currentRng() }
|
|
2721
2731
|
}),
|
|
2722
2732
|
instructions: resolved.instructions ?? [],
|
|
2733
|
+
...resolved.terminal ? { terminal: resolved.terminal } : {},
|
|
2723
2734
|
events: resolved.events ?? [],
|
|
2724
2735
|
trace: rngTrace(random.consumptions())
|
|
2725
2736
|
};
|
|
@@ -2753,6 +2764,7 @@ function createTrustedInstructionRunner(scope, interactions, lifecycle) {
|
|
|
2753
2764
|
}
|
|
2754
2765
|
},
|
|
2755
2766
|
instructions: result.instructions ?? [],
|
|
2767
|
+
...result.terminal ? { terminal: result.terminal } : {},
|
|
2756
2768
|
events: result.events ?? [],
|
|
2757
2769
|
trace: rngTrace([
|
|
2758
2770
|
...sampled.consumptions,
|
|
@@ -5005,6 +5017,8 @@ function createLifecycleRunner(scope, interactions) {
|
|
|
5005
5017
|
let nextState = workingState;
|
|
5006
5018
|
const instructions = [];
|
|
5007
5019
|
const consumptions = [];
|
|
5020
|
+
let terminal;
|
|
5021
|
+
const events = [];
|
|
5008
5022
|
if (phase.enter) {
|
|
5009
5023
|
const random = createMutableRandomHelpers(workingState.runtime.rng);
|
|
5010
5024
|
const entered = normalizeResult(
|
|
@@ -5029,6 +5043,8 @@ function createLifecycleRunner(scope, interactions) {
|
|
|
5029
5043
|
...entered.state,
|
|
5030
5044
|
runtime: { ...workingState.runtime, rng: random.currentRng() }
|
|
5031
5045
|
};
|
|
5046
|
+
terminal ??= entered.terminal;
|
|
5047
|
+
events.push(...entered.events ?? []);
|
|
5032
5048
|
consumptions.push(...random.consumptions());
|
|
5033
5049
|
if (entered.instructions) instructions.push(...entered.instructions);
|
|
5034
5050
|
}
|
|
@@ -5057,12 +5073,20 @@ function createLifecycleRunner(scope, interactions) {
|
|
|
5057
5073
|
...stageEntered.state,
|
|
5058
5074
|
runtime: { ...nextState.runtime, rng: random.currentRng() }
|
|
5059
5075
|
};
|
|
5076
|
+
terminal ??= stageEntered.terminal;
|
|
5077
|
+
events.push(...stageEntered.events ?? []);
|
|
5060
5078
|
consumptions.push(...random.consumptions());
|
|
5061
5079
|
if (stageEntered.instructions) {
|
|
5062
5080
|
instructions.push(...stageEntered.instructions);
|
|
5063
5081
|
}
|
|
5064
5082
|
}
|
|
5065
|
-
return {
|
|
5083
|
+
return {
|
|
5084
|
+
state: nextState,
|
|
5085
|
+
instructions,
|
|
5086
|
+
consumptions,
|
|
5087
|
+
...terminal ? { terminal } : {},
|
|
5088
|
+
events
|
|
5089
|
+
};
|
|
5066
5090
|
}
|
|
5067
5091
|
function initializePhaseResult(state, phaseName) {
|
|
5068
5092
|
return enterPhase({
|
|
@@ -5218,9 +5242,13 @@ function createLifecycleRunner(scope, interactions) {
|
|
|
5218
5242
|
playerIds: input.playerIds,
|
|
5219
5243
|
event: "initialize"
|
|
5220
5244
|
});
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5245
|
+
const drained = drainInstructions(entered.state, entered.instructions);
|
|
5246
|
+
const terminal = entered.terminal ?? drained.terminal;
|
|
5247
|
+
return {
|
|
5248
|
+
state: scope.toSessionState(drained.state),
|
|
5249
|
+
...terminal ? { terminal } : {},
|
|
5250
|
+
events: [...entered.events, ...drained.events]
|
|
5251
|
+
};
|
|
5224
5252
|
}
|
|
5225
5253
|
return {
|
|
5226
5254
|
createInitialState,
|
|
@@ -5616,7 +5644,7 @@ function createProjectionBuilder(scope, interactions) {
|
|
|
5616
5644
|
};
|
|
5617
5645
|
return view.project(viewArgs);
|
|
5618
5646
|
}
|
|
5619
|
-
function
|
|
5647
|
+
function project({
|
|
5620
5648
|
state,
|
|
5621
5649
|
playerIds,
|
|
5622
5650
|
projectionMode = "full"
|
|
@@ -5693,7 +5721,7 @@ function createProjectionBuilder(scope, interactions) {
|
|
|
5693
5721
|
);
|
|
5694
5722
|
}
|
|
5695
5723
|
return {
|
|
5696
|
-
|
|
5724
|
+
project,
|
|
5697
5725
|
resolveCurrentStageFor,
|
|
5698
5726
|
resolveSchedulerFlowFor,
|
|
5699
5727
|
resolveStageSeatsFor,
|
|
@@ -6096,7 +6124,7 @@ function createStaticViewQueries(manifest) {
|
|
|
6096
6124
|
}
|
|
6097
6125
|
function createStaticProjectionBuilder(scope) {
|
|
6098
6126
|
return {
|
|
6099
|
-
|
|
6127
|
+
boardStatic() {
|
|
6100
6128
|
const staticView = scope.definition.staticView;
|
|
6101
6129
|
if (!staticView) return null;
|
|
6102
6130
|
const manifest = scope.definition.contract.manifest;
|
|
@@ -6167,7 +6195,7 @@ function createTrustedReducerBundle(definition, options = {}) {
|
|
|
6167
6195
|
instructions.drainInstructions(
|
|
6168
6196
|
initialized.state,
|
|
6169
6197
|
initialized.instructions
|
|
6170
|
-
)
|
|
6198
|
+
).state
|
|
6171
6199
|
);
|
|
6172
6200
|
},
|
|
6173
6201
|
async validateInput({ state, input }) {
|
|
@@ -6275,11 +6303,11 @@ function createTrustedReducerBundle(definition, options = {}) {
|
|
|
6275
6303
|
...result.terminal ? { terminal: result.terminal } : {}
|
|
6276
6304
|
};
|
|
6277
6305
|
},
|
|
6278
|
-
|
|
6279
|
-
return staticProjection.
|
|
6306
|
+
boardStatic() {
|
|
6307
|
+
return staticProjection.boardStatic();
|
|
6280
6308
|
},
|
|
6281
|
-
|
|
6282
|
-
return projection.
|
|
6309
|
+
project(input) {
|
|
6310
|
+
return projection.project(input);
|
|
6283
6311
|
}
|
|
6284
6312
|
};
|
|
6285
6313
|
}
|
|
@@ -6791,7 +6819,7 @@ function toWireDispatchResult(result, serializeState) {
|
|
|
6791
6819
|
function toWireDispatchTrace(result) {
|
|
6792
6820
|
return toWireDispatchResult(result, (state) => state).trace;
|
|
6793
6821
|
}
|
|
6794
|
-
function
|
|
6822
|
+
function createReducerTestingBundle(definition, options = {}) {
|
|
6795
6823
|
const trustedBundle = createTrustedReducerBundle(definition, options);
|
|
6796
6824
|
const codec = createIngressRuntimeCodec(definition);
|
|
6797
6825
|
function parseTrustedState(state) {
|
|
@@ -6806,12 +6834,12 @@ function createReducerBundle(definition, options = {}) {
|
|
|
6806
6834
|
return codec.parsePlayerId(playerId);
|
|
6807
6835
|
}
|
|
6808
6836
|
const bundle = {
|
|
6809
|
-
|
|
6810
|
-
// Top-level protocol version. The Kotlin ReducerBundleAdapter reads this
|
|
6811
|
-
// on bundle load and rejects bundles whose major version does not match
|
|
6812
|
-
// the host's compiled-in REDUCER_CONTRACT_VERSION.
|
|
6837
|
+
// Hosts require this exact runner contract version.
|
|
6813
6838
|
reducerContractVersion: REDUCER_CONTRACT_VERSION,
|
|
6814
|
-
async initialize({
|
|
6839
|
+
async initialize(input) {
|
|
6840
|
+
return (await bundle.initializeResult(input)).state;
|
|
6841
|
+
},
|
|
6842
|
+
async initializeResult({
|
|
6815
6843
|
table,
|
|
6816
6844
|
playerIds,
|
|
6817
6845
|
rngSeed,
|
|
@@ -6821,14 +6849,31 @@ function createReducerBundle(definition, options = {}) {
|
|
|
6821
6849
|
table,
|
|
6822
6850
|
playerIds
|
|
6823
6851
|
);
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6852
|
+
const initialized = await trustedBundle.initialize({
|
|
6853
|
+
table: parsedTable,
|
|
6854
|
+
playerIds: parsedPlayerIds,
|
|
6855
|
+
rngSeed,
|
|
6856
|
+
setup
|
|
6857
|
+
});
|
|
6858
|
+
return {
|
|
6859
|
+
state: codec.serializeState(initialized.state),
|
|
6860
|
+
...initialized.terminal ? {
|
|
6861
|
+
terminal: {
|
|
6862
|
+
reason: initialized.terminal.reason,
|
|
6863
|
+
standings: initialized.terminal.standings.map(
|
|
6864
|
+
({ scoreBreakdown, tieBreaks, ...standing }) => ({
|
|
6865
|
+
...standing,
|
|
6866
|
+
...scoreBreakdown ? { scoreBreakdown: [...scoreBreakdown] } : {},
|
|
6867
|
+
...tieBreaks ? { tieBreaks: [...tieBreaks] } : {}
|
|
6868
|
+
})
|
|
6869
|
+
)
|
|
6870
|
+
}
|
|
6871
|
+
} : {},
|
|
6872
|
+
events: initialized.events.map(({ details, ...event }) => ({
|
|
6873
|
+
...event,
|
|
6874
|
+
...details ? { details: [...details] } : {}
|
|
6875
|
+
}))
|
|
6876
|
+
};
|
|
6832
6877
|
},
|
|
6833
6878
|
async initializePhase({ state, to }) {
|
|
6834
6879
|
const decodedState = parseTrustedState(state);
|
|
@@ -6910,17 +6955,17 @@ function createReducerBundle(definition, options = {}) {
|
|
|
6910
6955
|
* thereafter merges it back into every seat view on the client. Returns
|
|
6911
6956
|
* `null` when `defineGame` did not declare a `staticView`.
|
|
6912
6957
|
*/
|
|
6913
|
-
|
|
6914
|
-
return trustedBundle.
|
|
6958
|
+
boardStatic() {
|
|
6959
|
+
return trustedBundle.boardStatic();
|
|
6915
6960
|
},
|
|
6916
|
-
|
|
6961
|
+
project({
|
|
6917
6962
|
state,
|
|
6918
6963
|
playerIds,
|
|
6919
6964
|
projectionMode
|
|
6920
6965
|
}) {
|
|
6921
6966
|
const parsedState = parseTrustedState(state);
|
|
6922
6967
|
const parsedPlayerIds = playerIds.map((pid) => codec.parsePlayerId(pid));
|
|
6923
|
-
return trustedBundle.
|
|
6968
|
+
return trustedBundle.project({
|
|
6924
6969
|
state: parsedState,
|
|
6925
6970
|
playerIds: parsedPlayerIds,
|
|
6926
6971
|
projectionMode: projectionMode ?? void 0
|
|
@@ -6940,12 +6985,12 @@ function createReducerBundle(definition, options = {}) {
|
|
|
6940
6985
|
table,
|
|
6941
6986
|
playerIds
|
|
6942
6987
|
);
|
|
6943
|
-
state = await trustedBundle.initialize({
|
|
6988
|
+
state = (await trustedBundle.initialize({
|
|
6944
6989
|
table: parsedTable,
|
|
6945
6990
|
playerIds: parsedPlayerIds,
|
|
6946
6991
|
rngSeed,
|
|
6947
6992
|
setup
|
|
6948
|
-
});
|
|
6993
|
+
})).state;
|
|
6949
6994
|
},
|
|
6950
6995
|
hydrate({ state: snapshot }) {
|
|
6951
6996
|
state = parseTrustedState(snapshot);
|
|
@@ -6973,11 +7018,11 @@ function createReducerBundle(definition, options = {}) {
|
|
|
6973
7018
|
trace: toWireDispatchTrace(result)
|
|
6974
7019
|
};
|
|
6975
7020
|
},
|
|
6976
|
-
|
|
7021
|
+
project({ playerIds, projectionMode }) {
|
|
6977
7022
|
const parsedPlayerIds = playerIds.map(
|
|
6978
7023
|
(pid) => parseRuntimePlayerId(pid)
|
|
6979
7024
|
);
|
|
6980
|
-
return trustedBundle.
|
|
7025
|
+
return trustedBundle.project({
|
|
6981
7026
|
state: requireState(),
|
|
6982
7027
|
playerIds: parsedPlayerIds,
|
|
6983
7028
|
projectionMode: projectionMode ?? void 0
|
|
@@ -7020,6 +7065,16 @@ function createReducerBundle(definition, options = {}) {
|
|
|
7020
7065
|
};
|
|
7021
7066
|
return bundle;
|
|
7022
7067
|
}
|
|
7068
|
+
function createReducerBundle(definition, options = {}) {
|
|
7069
|
+
const runtime = createReducerTestingBundle(definition, options);
|
|
7070
|
+
return {
|
|
7071
|
+
reducerContractVersion: runtime.reducerContractVersion,
|
|
7072
|
+
boardStatic: runtime.boardStatic,
|
|
7073
|
+
initialize: runtime.initializeResult,
|
|
7074
|
+
dispatch: runtime.dispatch,
|
|
7075
|
+
project: ({ state, playerIds }) => runtime.project({ state, playerIds })
|
|
7076
|
+
};
|
|
7077
|
+
}
|
|
7023
7078
|
|
|
7024
7079
|
export {
|
|
7025
7080
|
noopDiagnosticsSink,
|
|
@@ -7034,6 +7089,7 @@ export {
|
|
|
7034
7089
|
contractFingerprint,
|
|
7035
7090
|
StaleContractArtifactError,
|
|
7036
7091
|
isStaleContractArtifactError,
|
|
7092
|
+
createReducerTestingBundle,
|
|
7037
7093
|
createReducerBundle
|
|
7038
7094
|
};
|
|
7039
|
-
//# sourceMappingURL=chunk-
|
|
7095
|
+
//# sourceMappingURL=chunk-533O7C4L.js.map
|