@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.
- package/README.md +179 -22
- package/dist/{chunk-C6UAT6EH.js → chunk-N7XPNNUI.js} +9 -12
- package/dist/chunk-N7XPNNUI.js.map +1 -0
- package/dist/chunk-SEGVTWSK.js +44 -0
- package/dist/{chunk-RS7UXJZV.js → chunk-TAQKH67O.js} +21300 -35881
- package/dist/chunk-TAQKH67O.js.map +1 -0
- package/dist/{global-config-AGFBDFYD.js → global-config-S4ZIPECE.js} +3 -3
- package/dist/index.js +415 -37
- package/dist/index.js.map +1 -1
- package/dist/internal.js +3 -4
- package/dist/{agent-verifier/keychain-backend-TNOPQV3Z.mjs → keychain-backend-HDF4TZDL.js} +2 -1
- package/dist/{agent-verifier/prompt-3BAINGAQ.mjs → prompt-NDV3AE5L.js} +2 -1
- package/package.json +6 -6
- 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/agent-workspace-verifier.mjs +0 -227
- package/dist/agent-verifier/chunk-2E5P5NWG.mjs +0 -835
- package/dist/agent-verifier/chunk-2GBBP27W.mjs +0 -301
- package/dist/agent-verifier/chunk-2QMNAVV4.mjs +0 -14522
- package/dist/agent-verifier/chunk-2SZHMP6F.mjs +0 -264
- package/dist/agent-verifier/chunk-4WD3YU2E.mjs +0 -166
- package/dist/agent-verifier/chunk-54TAYXUD.mjs +0 -12
- package/dist/agent-verifier/chunk-6A5HRJMQ.mjs +0 -3174
- package/dist/agent-verifier/chunk-6UUJEYDV.mjs +0 -213
- package/dist/agent-verifier/chunk-7653FPGJ.mjs +0 -381
- package/dist/agent-verifier/chunk-7E65UQLY.mjs +0 -38
- package/dist/agent-verifier/chunk-BVVNBJM4.mjs +0 -221
- package/dist/agent-verifier/chunk-CEDUHGNH.mjs +0 -74
- package/dist/agent-verifier/chunk-CEQ2VJWN.mjs +0 -149
- package/dist/agent-verifier/chunk-CFU5EWIC.mjs +0 -69
- package/dist/agent-verifier/chunk-CJEEA6NJ.mjs +0 -730
- package/dist/agent-verifier/chunk-EIQWDQWJ.mjs +0 -186
- package/dist/agent-verifier/chunk-EOQIV6PS.mjs +0 -649
- package/dist/agent-verifier/chunk-HBNDKQT5.mjs +0 -8381
- package/dist/agent-verifier/chunk-HJFQDSTU.mjs +0 -225
- package/dist/agent-verifier/chunk-JH22JNYD.mjs +0 -1681
- package/dist/agent-verifier/chunk-LI3ZR3BI.mjs +0 -41
- package/dist/agent-verifier/chunk-LM3OZLZG.mjs +0 -48
- package/dist/agent-verifier/chunk-MINCYHXN.mjs +0 -106
- package/dist/agent-verifier/chunk-MRCUP5SW.mjs +0 -128
- package/dist/agent-verifier/chunk-RBDDIIPM.mjs +0 -19
- package/dist/agent-verifier/chunk-SHUMAVAP.mjs +0 -59
- package/dist/agent-verifier/chunk-SYPLYRGB.mjs +0 -2812
- package/dist/agent-verifier/chunk-U6OJN7XS.mjs +0 -8092
- package/dist/agent-verifier/chunk-VYJTHSYR.mjs +0 -44
- package/dist/agent-verifier/chunk-XYDL7GY6.mjs +0 -10
- package/dist/agent-verifier/compile-5QSPIOUT.mjs +0 -313
- package/dist/agent-verifier/global-config-WX3ZZIVU.mjs +0 -17
- package/dist/agent-verifier/local-files-MTPLP62S.mjs +0 -46
- package/dist/agent-verifier/local-typecheck-QFYYAZOK.mjs +0 -9
- package/dist/agent-verifier/materialize-workspace-FKALAE2T.mjs +0 -90
- package/dist/agent-verifier/project-state-7GR6BQTQ.mjs +0 -32
- package/dist/agent-verifier/reducer-bundle-preflight-C73LEXI2.mjs +0 -23
- package/dist/agent-verifier/reducer-contract-preflight-22X7DSZW.mjs +0 -10
- package/dist/agent-verifier/reducer-native-test-harness-GMWBUISX.mjs +0 -53
- package/dist/agent-verifier/static-scaffold-AJMZZQWS.mjs +0 -28
- package/dist/agent-verifier/sync-3DUQH32H.mjs +0 -594
- package/dist/agent-verifier/test-P4U5INTD.mjs +0 -356
- package/dist/agent-verifier/testing-5K2BJYF2.mjs +0 -674
- package/dist/agent-verifier/workspace-codegen-JDZJRSDV.mjs +0 -11
- package/dist/agent-verifier/workspace-dependencies-HZ6VVS4G.mjs +0 -14
- package/dist/chunk-2H7UOFLK.js +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/keychain-backend-JHTXAKWC.js +0 -135
- package/dist/prompt-GMZABCJC.js +0 -756
- 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/{chunk-2H7UOFLK.js.map → chunk-SEGVTWSK.js.map} +0 -0
- /package/dist/{global-config-AGFBDFYD.js.map → global-config-S4ZIPECE.js.map} +0 -0
- /package/dist/{keychain-backend-JHTXAKWC.js.map → keychain-backend-HDF4TZDL.js.map} +0 -0
- /package/dist/{prompt-GMZABCJC.js.map → prompt-NDV3AE5L.js.map} +0 -0
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/templates/testing-types-content.ts
|
|
4
|
-
var DEFAULT_REJECTION_CODES = [
|
|
5
|
-
"NOT_YOUR_TURN",
|
|
6
|
-
"action-unavailable",
|
|
7
|
-
"invalid-action-params",
|
|
8
|
-
"prompt-not-owned"
|
|
9
|
-
];
|
|
10
|
-
function renderLiteralUnion(values) {
|
|
11
|
-
if (values.length === 0) {
|
|
12
|
-
return "never";
|
|
13
|
-
}
|
|
14
|
-
return values.map((value) => JSON.stringify(value)).join(" | ");
|
|
15
|
-
}
|
|
16
|
-
var REDUCER_TESTING_TYPES_WRAPPER_CONTENT = `// Generated by dreamboard \u2014 do not edit by hand.
|
|
17
|
-
import game from "../app/game";
|
|
18
|
-
import {
|
|
19
|
-
contractFingerprint,
|
|
20
|
-
createReducerBundle,
|
|
21
|
-
} from "@dreamboard-games/sdk/reducer";
|
|
22
|
-
import { createTestRuntime as createDreamboardTestRuntime } from "@dreamboard-games/sdk/testing";
|
|
23
|
-
import type { CreateTestRuntimeOptions } from "@dreamboard-games/sdk/testing";
|
|
24
|
-
import { literals } from "../shared/manifest-contract";
|
|
25
|
-
import type { PhaseName } from "../shared/generated/ui-contract";
|
|
26
|
-
import {
|
|
27
|
-
BASE_STATES,
|
|
28
|
-
BASE_STATES_CONTRACT_FINGERPRINT,
|
|
29
|
-
} from "./generated/base-states.generated";
|
|
30
|
-
import type {
|
|
31
|
-
BaseDefinition,
|
|
32
|
-
ScenarioDefinition,
|
|
33
|
-
TestRunner,
|
|
34
|
-
} from "./generated/testing-contract";
|
|
35
|
-
|
|
36
|
-
export * from "./generated/testing-contract";
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Workspace-narrowed \`defineBase\` wrapper. Accepts the generated
|
|
40
|
-
* \`BaseDefinition\` so \`setup({ seat, game })\` is typed against the
|
|
41
|
-
* workspace's player ids and interaction contract.
|
|
42
|
-
*/
|
|
43
|
-
export function defineBase<const Definition extends BaseDefinition>(
|
|
44
|
-
definition: Definition,
|
|
45
|
-
): Definition {
|
|
46
|
-
return definition;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Workspace-narrowed \`defineScenario\` wrapper. The generated
|
|
51
|
-
* \`ScenarioDefinition\` narrows \`ctx.view(playerId)\` in \`then\` based on
|
|
52
|
-
* the declared \`phase\`, keeps \`when\` union-typed, and constrains
|
|
53
|
-
* \`phase\` / \`stage\` to the manifest-derived literal types.
|
|
54
|
-
*/
|
|
55
|
-
export function defineScenario<
|
|
56
|
-
const Runners extends readonly TestRunner[] = readonly ["reducer"],
|
|
57
|
-
const Phase extends PhaseName | undefined = undefined,
|
|
58
|
-
>(
|
|
59
|
-
definition: ScenarioDefinition<Runners, Phase>,
|
|
60
|
-
): ScenarioDefinition<Runners, Phase> {
|
|
61
|
-
return definition;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function createTestRuntime(options: {
|
|
65
|
-
baseId: keyof typeof BASE_STATES & string;
|
|
66
|
-
phase?: PhaseName;
|
|
67
|
-
controllingPlayerId?: (typeof literals.playerIds)[number];
|
|
68
|
-
userId?: string | null;
|
|
69
|
-
}) {
|
|
70
|
-
const reducerBundle =
|
|
71
|
-
createReducerBundle(game) satisfies CreateTestRuntimeOptions["bundle"];
|
|
72
|
-
const baseStates =
|
|
73
|
-
BASE_STATES satisfies CreateTestRuntimeOptions["baseStates"];
|
|
74
|
-
const runtime = createDreamboardTestRuntime({
|
|
75
|
-
baseId: options.baseId,
|
|
76
|
-
baseStates,
|
|
77
|
-
bundle: reducerBundle,
|
|
78
|
-
contractFingerprint: contractFingerprint(game).value,
|
|
79
|
-
expectedBaseStateFingerprint: BASE_STATES_CONTRACT_FINGERPRINT,
|
|
80
|
-
phase: options.phase,
|
|
81
|
-
userId: options.userId ?? "test-user",
|
|
82
|
-
playerIds: literals.playerIds.slice(
|
|
83
|
-
0,
|
|
84
|
-
BASE_STATES[options.baseId]?.fingerprint.players ?? literals.playerIds.length,
|
|
85
|
-
),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (options.controllingPlayerId) {
|
|
89
|
-
runtime.setControllingPlayer(options.controllingPlayerId);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return runtime;
|
|
93
|
-
}
|
|
94
|
-
`;
|
|
95
|
-
function buildReducerTestingContractContent(options = {}) {
|
|
96
|
-
const rejectionCodes = Array.from(
|
|
97
|
-
/* @__PURE__ */ new Set([...options.rejectionCodes ?? [], ...DEFAULT_REJECTION_CODES])
|
|
98
|
-
).sort((left, right) => left.localeCompare(right));
|
|
99
|
-
return `// Generated by dreamboard \u2014 do not edit by hand.
|
|
100
|
-
import type game from "../../app/game";
|
|
101
|
-
import { literals, type SetupProfileId } from "../../shared/manifest-contract";
|
|
102
|
-
import {
|
|
103
|
-
type GameView,
|
|
104
|
-
type InteractionId,
|
|
105
|
-
type InteractionKey,
|
|
106
|
-
type InteractionParamsOf,
|
|
107
|
-
type PhaseName,
|
|
108
|
-
type StageName as WorkspaceStageName,
|
|
109
|
-
} from "../../shared/generated/ui-contract";
|
|
110
|
-
import type {
|
|
111
|
-
ExpectFn as SharedExpectFn,
|
|
112
|
-
TestRunner as SharedTestRunner,
|
|
113
|
-
} from "@dreamboard-games/sdk/testing";
|
|
114
|
-
import type { InteractionDescriptor } from "@dreamboard-games/sdk/runtime";
|
|
115
|
-
import { BASE_STATES } from "./base-states.generated";
|
|
116
|
-
|
|
117
|
-
export type GameDefinition = typeof game;
|
|
118
|
-
export type PlayerId = (typeof literals.playerIds)[number];
|
|
119
|
-
export type StateName = PhaseName;
|
|
120
|
-
export type BaseId = keyof typeof BASE_STATES & string;
|
|
121
|
-
export type InteractionDescriptorFor<Id extends string = string> =
|
|
122
|
-
InteractionDescriptor<Id>;
|
|
123
|
-
export type InteractionExplanation = {
|
|
124
|
-
interactionId: string;
|
|
125
|
-
phase: string;
|
|
126
|
-
step: string | null;
|
|
127
|
-
availability:
|
|
128
|
-
| "available"
|
|
129
|
-
| "notYourTurn"
|
|
130
|
-
| "wrongPhase"
|
|
131
|
-
| "wrongStep"
|
|
132
|
-
| "blocked";
|
|
133
|
-
rules: ReadonlyArray<{
|
|
134
|
-
ruleId: string;
|
|
135
|
-
outcome: "passed" | "failed" | "notEvaluated";
|
|
136
|
-
errorCode?: string;
|
|
137
|
-
message?: string;
|
|
138
|
-
}>;
|
|
139
|
-
actor: { required: readonly string[]; playerIsActor: boolean };
|
|
140
|
-
inputs: ReadonlyArray<{
|
|
141
|
-
key: string;
|
|
142
|
-
kind: string;
|
|
143
|
-
eligibleCount: number | "lazy";
|
|
144
|
-
}>;
|
|
145
|
-
};
|
|
146
|
-
export type TestRunner = SharedTestRunner;
|
|
147
|
-
export type ExpectFn = SharedExpectFn;
|
|
148
|
-
export type KnownRejectionCode = ${renderLiteralUnion(rejectionCodes)};
|
|
149
|
-
export type RejectionCode = [KnownRejectionCode] extends [never]
|
|
150
|
-
? string
|
|
151
|
-
: KnownRejectionCode;
|
|
152
|
-
|
|
153
|
-
type DefaultRunners = readonly ["reducer"];
|
|
154
|
-
type PhaseTaggedView<Phase extends PhaseName> = Extract<
|
|
155
|
-
GameView,
|
|
156
|
-
{ phase: Phase } | { currentPhase: Phase } | { state: Phase }
|
|
157
|
-
>;
|
|
158
|
-
type NarrowedView<Phase extends PhaseName> = [PhaseTaggedView<Phase>] extends [never]
|
|
159
|
-
? GameView
|
|
160
|
-
: PhaseTaggedView<Phase>;
|
|
161
|
-
|
|
162
|
-
export type ViewByPhase = {
|
|
163
|
-
[Phase in PhaseName]: NarrowedView<Phase>;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
type InteractionKeyForId<Id extends InteractionId> = Extract<
|
|
167
|
-
InteractionKey,
|
|
168
|
-
\`\${string}.\${Id}\`
|
|
169
|
-
>;
|
|
170
|
-
type InteractionParamsForKey<Key extends InteractionKey> =
|
|
171
|
-
Key extends InteractionKey ? InteractionParamsOf<Key> : never;
|
|
172
|
-
type InteractionParamsOfId<Id extends InteractionId> =
|
|
173
|
-
InteractionParamsForKey<InteractionKeyForId<Id>>;
|
|
174
|
-
|
|
175
|
-
export interface BrowserRunnerSnapshot {
|
|
176
|
-
sessionId: string | null;
|
|
177
|
-
shortCode: string | null;
|
|
178
|
-
version: number;
|
|
179
|
-
currentPhase: string | null;
|
|
180
|
-
controllingPlayerId: string;
|
|
181
|
-
controllablePlayerIds: string[];
|
|
182
|
-
view: unknown;
|
|
183
|
-
availableInteractions?: string[];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface BrowserRunnerBridge {
|
|
187
|
-
snapshot(): Promise<BrowserRunnerSnapshot>;
|
|
188
|
-
submitInteraction(
|
|
189
|
-
playerId: PlayerId,
|
|
190
|
-
interactionId: string,
|
|
191
|
-
params: unknown,
|
|
192
|
-
): Promise<void>;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export interface BrowserRunnerDriver {
|
|
196
|
-
onReady?(bridge: BrowserRunnerBridge): Promise<void> | void;
|
|
197
|
-
interaction?(
|
|
198
|
-
bridge: BrowserRunnerBridge,
|
|
199
|
-
input: { playerId: PlayerId; interactionId: string; params: unknown },
|
|
200
|
-
): Promise<boolean | void> | boolean | void;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export interface ScenarioGameApi {
|
|
204
|
-
start(): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Patch the reducer snapshot for deterministic setup-heavy scenarios.
|
|
207
|
-
* This is limited to reducer snapshot materialization and is rejected by
|
|
208
|
-
* live replay/browser runners so authored gameplay verification still
|
|
209
|
-
* submits real interactions.
|
|
210
|
-
*/
|
|
211
|
-
patchState(mutator: (state: Record<string, unknown>) => void): Promise<void>;
|
|
212
|
-
/**
|
|
213
|
-
* Submit a player interaction (action-kind or prompt-kind) to the game.
|
|
214
|
-
* The \`interactionId\` matches an \`InteractionId\` from the generated
|
|
215
|
-
* \`ui-contract\`; \`params\` is typed per interaction id.
|
|
216
|
-
*/
|
|
217
|
-
submit<Id extends InteractionId>(
|
|
218
|
-
playerId: PlayerId,
|
|
219
|
-
interactionId: Id,
|
|
220
|
-
params?: InteractionParamsOfId<Id>,
|
|
221
|
-
): Promise<void>;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export interface BaseContext {
|
|
225
|
-
game: ScenarioGameApi;
|
|
226
|
-
players(): readonly PlayerId[];
|
|
227
|
-
/**
|
|
228
|
-
* Resolve the seat at \`index\` in the base's players list.
|
|
229
|
-
* Throws if the index is out of range. Prefer \`seat(0)\`/\`seat(1)\` over
|
|
230
|
-
* literal player ids so bases stay portable across player counts and
|
|
231
|
-
* we never hard-code wire-shape assumptions like "player-1".
|
|
232
|
-
*/
|
|
233
|
-
seat(index: number): PlayerId;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface SharedScenarioContext {
|
|
237
|
-
game: ScenarioGameApi;
|
|
238
|
-
players(): readonly PlayerId[];
|
|
239
|
-
/**
|
|
240
|
-
* Resolve the seat at \`index\` in the current scenario's players list.
|
|
241
|
-
* Throws if the index is out of range. Prefer \`seat(0)\`/\`seat(1)\` over
|
|
242
|
-
* literal player ids so scenarios stay portable across player counts and
|
|
243
|
-
* we never hard-code wire-shape assumptions like "player-1".
|
|
244
|
-
*/
|
|
245
|
-
seat(index: number): PlayerId;
|
|
246
|
-
state(): StateName;
|
|
247
|
-
view(playerId: PlayerId): GameView;
|
|
248
|
-
interactions(playerId: PlayerId): readonly InteractionDescriptorFor[];
|
|
249
|
-
explain(playerId: PlayerId, interactionId: InteractionId): InteractionExplanation;
|
|
250
|
-
expect: ExpectFn;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export type ScenarioContext<
|
|
254
|
-
Phase extends PhaseName | undefined = undefined,
|
|
255
|
-
> = Omit<SharedScenarioContext, "state" | "view"> & {
|
|
256
|
-
state(): Phase extends PhaseName ? Phase : StateName;
|
|
257
|
-
view(playerId: PlayerId): Phase extends PhaseName ? ViewByPhase[Phase] : GameView;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
export type ScenarioThenContext<
|
|
261
|
-
_Runners extends readonly TestRunner[] = DefaultRunners,
|
|
262
|
-
Phase extends PhaseName | undefined = undefined,
|
|
263
|
-
> = ScenarioContext<Phase>;
|
|
264
|
-
|
|
265
|
-
export interface BaseDefinition {
|
|
266
|
-
id: string;
|
|
267
|
-
seed?: number;
|
|
268
|
-
players?: number;
|
|
269
|
-
setupProfileId?: SetupProfileId;
|
|
270
|
-
extends?: BaseId | string;
|
|
271
|
-
setup: (ctx: BaseContext) => void | Promise<void>;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export interface ScenarioDefinition<
|
|
275
|
-
Runners extends readonly TestRunner[] = DefaultRunners,
|
|
276
|
-
Phase extends PhaseName | undefined = undefined,
|
|
277
|
-
> {
|
|
278
|
-
id: string;
|
|
279
|
-
description?: string;
|
|
280
|
-
from: BaseId | string;
|
|
281
|
-
runners?: Runners;
|
|
282
|
-
phase?: Phase;
|
|
283
|
-
stage?: Phase extends PhaseName ? WorkspaceStageName<Phase> : never;
|
|
284
|
-
when: (ctx: ScenarioContext<Phase>) => void | Promise<void>;
|
|
285
|
-
then: (ctx: ScenarioThenContext<Runners, Phase>) => void | Promise<void>;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export type {
|
|
289
|
-
GameView,
|
|
290
|
-
InteractionId,
|
|
291
|
-
InteractionParamsOf,
|
|
292
|
-
PhaseName,
|
|
293
|
-
WorkspaceStageName,
|
|
294
|
-
};
|
|
295
|
-
`;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export {
|
|
299
|
-
REDUCER_TESTING_TYPES_WRAPPER_CONTENT,
|
|
300
|
-
buildReducerTestingContractContent
|
|
301
|
-
};
|