@dreamboard-games/sdk 0.5.0-alpha.2 → 0.5.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +136 -45
  2. package/dist/chunk-DMFVAZI2.js +16 -0
  3. package/dist/chunk-DMFVAZI2.js.map +1 -0
  4. package/dist/chunk-FMM5LVJW.js +833 -0
  5. package/dist/chunk-FMM5LVJW.js.map +1 -0
  6. package/dist/{chunk-S2JEDVWH.js → chunk-LRILEVKC.js} +6113 -6489
  7. package/dist/chunk-LRILEVKC.js.map +1 -0
  8. package/dist/chunk-SP234IY4.js +1363 -0
  9. package/dist/chunk-SP234IY4.js.map +1 -0
  10. package/dist/chunk-VUWNJXLJ.js +52 -0
  11. package/dist/chunk-VUWNJXLJ.js.map +1 -0
  12. package/dist/chunk-ZPRKWPEP.js +511 -0
  13. package/dist/chunk-ZPRKWPEP.js.map +1 -0
  14. package/dist/definition-BaHNPZol.d.ts +4639 -0
  15. package/dist/diagnostics-B0lgnuZ6.d.ts +65 -0
  16. package/dist/index.d.ts +3553 -1
  17. package/dist/index.js +1045 -6
  18. package/dist/index.js.map +1 -1
  19. package/dist/model-BHro6yXu.d.ts +288 -0
  20. package/dist/react.d.ts +32 -0
  21. package/dist/react.js +80 -0
  22. package/dist/react.js.map +1 -0
  23. package/dist/reducer.d.ts +1194 -79
  24. package/dist/reducer.js +4326 -121
  25. package/dist/reducer.js.map +1 -1
  26. package/dist/testing.d.ts +518 -564
  27. package/dist/testing.js +2448 -915
  28. package/dist/testing.js.map +1 -1
  29. package/dist/types-DimqnJBq.d.ts +86 -0
  30. package/package.json +26 -131
  31. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  32. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  33. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  34. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  35. package/dist/browser-interaction.d.ts +0 -910
  36. package/dist/browser-interaction.js +0 -119
  37. package/dist/browser-interaction.js.map +0 -1
  38. package/dist/chunk-32PFKDV7.js +0 -11705
  39. package/dist/chunk-32PFKDV7.js.map +0 -1
  40. package/dist/chunk-3BAD4VC2.js +0 -263
  41. package/dist/chunk-3BAD4VC2.js.map +0 -1
  42. package/dist/chunk-3SKDNDPG.js +0 -104
  43. package/dist/chunk-3SKDNDPG.js.map +0 -1
  44. package/dist/chunk-5YV2WHJ4.js +0 -25
  45. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  46. package/dist/chunk-ANRB4XKA.js +0 -90
  47. package/dist/chunk-ANRB4XKA.js.map +0 -1
  48. package/dist/chunk-BI4G3PM2.js +0 -1864
  49. package/dist/chunk-BI4G3PM2.js.map +0 -1
  50. package/dist/chunk-EVCLTY4Q.js +0 -935
  51. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  52. package/dist/chunk-GDPKTBUR.js +0 -564
  53. package/dist/chunk-GDPKTBUR.js.map +0 -1
  54. package/dist/chunk-H6VDGFL5.js +0 -2903
  55. package/dist/chunk-H6VDGFL5.js.map +0 -1
  56. package/dist/chunk-LR3ZTWQF.js +0 -5960
  57. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  58. package/dist/chunk-PF7L4BMG.js +0 -117
  59. package/dist/chunk-PF7L4BMG.js.map +0 -1
  60. package/dist/chunk-PN5O6GG2.js +0 -32
  61. package/dist/chunk-PN5O6GG2.js.map +0 -1
  62. package/dist/chunk-PZ5AY32C.js +0 -10
  63. package/dist/chunk-PZ5AY32C.js.map +0 -1
  64. package/dist/chunk-S2JEDVWH.js.map +0 -1
  65. package/dist/chunk-T3ZKNUZ7.js +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  67. package/dist/chunk-UGH54WZ2.js +0 -223
  68. package/dist/chunk-UGH54WZ2.js.map +0 -1
  69. package/dist/chunk-VCDWP5VL.js +0 -746
  70. package/dist/chunk-VCDWP5VL.js.map +0 -1
  71. package/dist/chunk-VDXOF4FW.js +0 -69
  72. package/dist/chunk-VDXOF4FW.js.map +0 -1
  73. package/dist/chunk-WHR5UW3F.js +0 -1988
  74. package/dist/chunk-WHR5UW3F.js.map +0 -1
  75. package/dist/chunk-Y75CFE77.js +0 -17
  76. package/dist/chunk-Y75CFE77.js.map +0 -1
  77. package/dist/chunk-Z7QCREWI.js +0 -3435
  78. package/dist/chunk-Z7QCREWI.js.map +0 -1
  79. package/dist/chunk-ZZGN2ATS.js +0 -1941
  80. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  81. package/dist/components-gAbIz7hK.d.ts +0 -1284
  82. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  83. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  84. package/dist/digest.d.ts +0 -8
  85. package/dist/game-CsZScpcn.d.ts +0 -763
  86. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  87. package/dist/index-CcT9Q7N7.d.ts +0 -193
  88. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  89. package/dist/package-set.d.ts +0 -13
  90. package/dist/package-set.js +0 -12
  91. package/dist/package-set.js.map +0 -1
  92. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  93. package/dist/plugin-runtime-contract.d.ts +0 -17
  94. package/dist/plugin-runtime-contract.js +0 -92
  95. package/dist/plugin-runtime-contract.js.map +0 -1
  96. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  97. package/dist/protocol-dYgafTYY.d.ts +0 -314
  98. package/dist/reducer/advanced.d.ts +0 -82
  99. package/dist/reducer/advanced.js +0 -51
  100. package/dist/reducer/advanced.js.map +0 -1
  101. package/dist/reducer-contract.d.ts +0 -11
  102. package/dist/reducer-contract.js +0 -16
  103. package/dist/reducer-contract.js.map +0 -1
  104. package/dist/reference-games/index.d.ts +0 -31
  105. package/dist/reference-games/index.js +0 -48
  106. package/dist/reference-games/index.js.map +0 -1
  107. package/dist/runtime/primitives.d.ts +0 -250
  108. package/dist/runtime/primitives.js +0 -189
  109. package/dist/runtime/primitives.js.map +0 -1
  110. package/dist/runtime/runtime-api.d.ts +0 -2
  111. package/dist/runtime/runtime-api.js +0 -1
  112. package/dist/runtime/runtime-api.js.map +0 -1
  113. package/dist/runtime/workspace-contract.d.ts +0 -392
  114. package/dist/runtime/workspace-contract.js +0 -28
  115. package/dist/runtime/workspace-contract.js.map +0 -1
  116. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  117. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  118. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  119. package/dist/runtime.d.ts +0 -83
  120. package/dist/runtime.js +0 -242
  121. package/dist/runtime.js.map +0 -1
  122. package/dist/schema.d.ts +0 -379
  123. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  124. package/dist/testing-compiler.d.ts +0 -37
  125. package/dist/testing-compiler.js +0 -272
  126. package/dist/testing-compiler.js.map +0 -1
  127. package/dist/testing-runtime.d.ts +0 -119
  128. package/dist/testing-runtime.js +0 -212
  129. package/dist/testing-runtime.js.map +0 -1
  130. package/dist/types-DJj5MJkl.d.ts +0 -256
  131. package/dist/types-DR7DoB1x.d.ts +0 -28
  132. package/dist/types-JWCYHmu7.d.ts +0 -122
  133. package/dist/types.d.ts +0 -1958
  134. package/dist/types.js +0 -14
  135. package/dist/types.js.map +0 -1
  136. package/dist/ui/components.d.ts +0 -17
  137. package/dist/ui/components.js +0 -216
  138. package/dist/ui/components.js.map +0 -1
  139. package/dist/ui/defaults.d.ts +0 -19
  140. package/dist/ui/defaults.js +0 -104
  141. package/dist/ui/defaults.js.map +0 -1
  142. package/dist/ui/player-state.d.ts +0 -2
  143. package/dist/ui/player-state.js +0 -1
  144. package/dist/ui/player-state.js.map +0 -1
  145. package/dist/ui/plugin-styles.css +0 -2
  146. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  147. package/dist/ui.d.ts +0 -317
  148. package/dist/ui.js +0 -277
  149. package/dist/ui.js.map +0 -1
  150. package/dist/views-BpuWcOyN.d.ts +0 -1641
@@ -1,300 +0,0 @@
1
- import { z } from 'zod';
2
- import { av as PhaseNamesOfDefinition, a8 as InteractionIdOfDefinitionPhase, ag as InteractionSpecByNameOfDefinitionPhase, X as GameStateOf, bd as ViewNamesOfDefinition, be as ViewOfDefinition, x as ClientParamsOfInteractionOfDefinition } from './views-BpuWcOyN.js';
3
- import { ae as ManifestIdSchema } from './runtime-RJ5orDJU.js';
4
- import { R as ReducerDiagnosticEvent, D as DispatchTraceSummaryEntry } from './diagnostics-DIi3ina7.js';
5
-
6
- type ScenarioDefinitionValidationCode = "INVALID_TYPE" | "UNKNOWN_FIELD" | "INVALID_VALUE" | "UNSAFE_INTEGER" | "OUT_OF_RANGE" | "UNKNOWN_SETUP_PROFILE" | "UNKNOWN_INTERACTION" | "INVALID_COMMAND_PARAMS" | "NON_SERIALIZABLE" | "NORMAL_SETUP_UNAVAILABLE";
7
- declare class ScenarioDefinitionValidationError extends Error {
8
- readonly code: ScenarioDefinitionValidationCode;
9
- readonly path: string;
10
- constructor(options: {
11
- readonly code: ScenarioDefinitionValidationCode;
12
- readonly path: string;
13
- readonly reason: string;
14
- });
15
- }
16
- type NormalSetupLike = {
17
- readonly minPlayers: number;
18
- readonly maxPlayers: number;
19
- readonly createInitialTable: (options: {
20
- readonly playerIds: readonly string[];
21
- }) => unknown;
22
- };
23
- type ScenarioDefinitionGameLike = {
24
- readonly contract: {
25
- readonly manifest: {
26
- readonly normalSetup?: NormalSetupLike;
27
- readonly literals: {
28
- readonly playerIds: readonly string[];
29
- };
30
- readonly setupProfilesById: Readonly<Record<string, unknown>>;
31
- };
32
- };
33
- readonly phases: Readonly<Record<string, unknown>>;
34
- };
35
-
36
- type InteractionDescriptorLike = {
37
- interactionId?: string;
38
- surface?: string;
39
- kind?: string;
40
- availability?: InteractionAvailabilityLike;
41
- context?: {
42
- to?: string;
43
- };
44
- } & Record<string, unknown>;
45
- type InteractionAvailabilityLike = {
46
- status: "available";
47
- } | {
48
- status: "notYourTurn";
49
- reason: string;
50
- } | {
51
- status: "insufficientResources";
52
- reason: string;
53
- missingResources?: Record<string, unknown>;
54
- } | {
55
- status: "blocked";
56
- reason: string;
57
- code?: string;
58
- };
59
- type InteractionExplanationLike = {
60
- interactionId: string;
61
- phase: string;
62
- step: string | null;
63
- availability: "available" | "notYourTurn" | "wrongPhase" | "wrongStep" | "blocked";
64
- rules: ReadonlyArray<{
65
- ruleId: string;
66
- outcome: "passed" | "failed" | "notEvaluated";
67
- errorCode?: string;
68
- message?: string;
69
- }>;
70
- actor: {
71
- required: readonly string[];
72
- playerIsActor: boolean;
73
- };
74
- inputs: ReadonlyArray<{
75
- key: string;
76
- kind: string;
77
- eligibleCount: number | "lazy";
78
- }>;
79
- };
80
- type SnapshotMatcherHandler = (name: string | undefined, actual: unknown) => void;
81
- type RejectionExpectation = {
82
- errorCode?: string;
83
- message?: string | RegExp;
84
- };
85
- type ExpectMatchers = {
86
- toBe: (expected: unknown) => void;
87
- toEqual: (expected: unknown) => void;
88
- toMatchObject: (expected: Record<string, unknown>) => void;
89
- toBeDefined: () => void;
90
- toBeUndefined: () => void;
91
- toBeNull: () => void;
92
- toContain: (expected: unknown) => void;
93
- toContainEqual: (expected: unknown) => void;
94
- toHaveLength: (expected: number) => void;
95
- toBeGreaterThan: (expected: number) => void;
96
- toBeGreaterThanOrEqual: (expected: number) => void;
97
- toThrow: (predicate?: string | RegExp | ((error: Error) => boolean)) => void;
98
- toMatchSnapshot: (filename?: string) => void;
99
- toRejectWith: (expected: RejectionExpectation) => Promise<void>;
100
- toHaveInteraction: (interactionId: string, opts?: Partial<InteractionDescriptorLike>) => void;
101
- toBeGatedBy: (reason: string, opts?: {
102
- interactionId?: string;
103
- }) => void;
104
- toBeAvailable: (explanation?: InteractionExplanationLike) => void;
105
- toBeActiveFor: (playerId: string, opts?: {
106
- interactionId?: string;
107
- }) => void;
108
- not: {
109
- toHaveInteraction: (interactionId: string) => void;
110
- };
111
- };
112
- type ExpectFn = (actual: unknown) => ExpectMatchers;
113
- type ScenarioSeatRef = {
114
- readonly seat: number;
115
- };
116
- type ScenarioActor = ScenarioSeatRef;
117
- type ScenarioSetup = {
118
- readonly players: number;
119
- readonly seed: number;
120
- readonly setupProfileId?: string | null;
121
- };
122
- type ScenarioTupleOutput<Items extends readonly z.core.SomeType[], Rest extends z.core.SomeType | null> = Rest extends z.core.SomeType ? readonly [
123
- ...{
124
- [Index in keyof Items]: ScenarioSchemaOutput<Items[Index]>;
125
- },
126
- ...ScenarioSchemaOutput<Rest>[]
127
- ] : readonly [
128
- ...{
129
- [Index in keyof Items]: ScenarioSchemaOutput<Items[Index]>;
130
- }
131
- ];
132
- type OptionalScenarioObjectKeys<Shape extends z.core.$ZodShape> = {
133
- [Key in keyof Shape]: undefined extends z.output<Shape[Key]> ? Key : never;
134
- }[keyof Shape];
135
- type ScenarioObjectOutput<Shape extends z.core.$ZodShape> = {
136
- readonly [Key in Exclude<keyof Shape, OptionalScenarioObjectKeys<Shape>>]: ScenarioSchemaOutput<Shape[Key]>;
137
- } & {
138
- readonly [Key in OptionalScenarioObjectKeys<Shape>]?: ScenarioSchemaOutput<Shape[Key]>;
139
- };
140
- /**
141
- * Authoring projection of an input schema. Only semantic player-id leaves are
142
- * replaced; ordinary strings retain their original type.
143
- */
144
- type ScenarioSchemaOutput<Schema extends z.core.SomeType> = Schema extends ManifestIdSchema<unknown, "playerId"> ? ScenarioSeatRef : Schema extends z.ZodOptional<infer Inner> ? ScenarioSchemaOutput<Inner> | undefined : Schema extends z.ZodExactOptional<infer Inner> ? ScenarioSchemaOutput<Inner> | undefined : Schema extends z.ZodNullable<infer Inner> ? ScenarioSchemaOutput<Inner> | null : Schema extends z.ZodDefault<infer Inner> ? ScenarioSchemaOutput<Inner> : Schema extends z.ZodPrefault<infer Inner> ? ScenarioSchemaOutput<Inner> : Schema extends z.ZodCatch<infer Inner> ? ScenarioSchemaOutput<Inner> : Schema extends z.ZodReadonly<infer Inner> ? Readonly<ScenarioSchemaOutput<Inner>> : Schema extends z.ZodNonOptional<infer Inner> ? Exclude<ScenarioSchemaOutput<Inner>, undefined> : Schema extends z.ZodArray<infer Element> ? readonly ScenarioSchemaOutput<Element>[] : Schema extends z.ZodTuple<infer Items, infer Rest> ? ScenarioTupleOutput<Items, Rest> : Schema extends z.ZodObject<infer Shape> ? ScenarioObjectOutput<Shape> : Schema extends z.ZodRecord<infer Key, infer Value> ? Key extends ManifestIdSchema<unknown, "playerId"> ? never : Readonly<Record<Extract<z.output<Key>, string | number | symbol>, ScenarioSchemaOutput<Value>>> : Schema extends z.ZodIntersection<infer Left, infer Right> ? ScenarioSchemaOutput<Left> & ScenarioSchemaOutput<Right> : Schema extends z.ZodPipe<infer Input, z.ZodType> ? ScenarioSchemaOutput<Input> : Schema extends z.ZodLazy<infer Inner> ? ScenarioSchemaOutput<Inner> : Schema extends z.ZodUnion<infer Options> ? ScenarioSchemaOutput<Options[number]> : z.output<Schema>;
145
- type InputCollectorsOfInteraction<Interaction> = Interaction extends {
146
- readonly inputs?: infer Collectors;
147
- } ? NonNullable<Collectors> extends Readonly<Record<string, unknown>> ? NonNullable<Collectors> : Record<string, never> : Record<string, never>;
148
- type ScenarioParamsOfCollectors<Collectors extends Readonly<Record<string, unknown>>> = {
149
- readonly [Key in keyof Collectors as Collectors[Key] extends {
150
- readonly kind: "rng";
151
- } ? never : Key]: Collectors[Key] extends {
152
- readonly schema: infer Schema extends z.core.SomeType;
153
- } ? ScenarioSchemaOutput<Schema> : never;
154
- };
155
- type ScenarioParamsOfInteraction<Interaction> = Interaction extends {
156
- readonly cardType: unknown;
157
- readonly playFrom: unknown;
158
- } ? {
159
- readonly cardId: string;
160
- } & ScenarioParamsOfCollectors<InputCollectorsOfInteraction<Interaction>> : ScenarioParamsOfCollectors<InputCollectorsOfInteraction<Interaction>>;
161
- type ScenarioCommand<InteractionId extends string = string, Params = Record<string, unknown>> = {
162
- readonly actor: ScenarioActor;
163
- readonly interactionId: InteractionId;
164
- readonly params: Params;
165
- };
166
- type ScenarioCommandForPhase<Game, Phase extends PhaseNamesOfDefinition<Game>> = {
167
- [InteractionId in InteractionIdOfDefinitionPhase<Game, Phase>]: ScenarioCommand<InteractionId, ScenarioParamsOfInteraction<InteractionSpecByNameOfDefinitionPhase<Game, Phase, InteractionId>>>;
168
- }[InteractionIdOfDefinitionPhase<Game, Phase>];
169
- type ScenarioCommandOf<Game> = {
170
- [Phase in PhaseNamesOfDefinition<Game>]: ScenarioCommandForPhase<Game, Phase>;
171
- }[PhaseNamesOfDefinition<Game>];
172
- /** Production params remain available for runtime implementors and diagnostics. */
173
- type RuntimeParamsOfScenarioCommand<Game, Phase extends PhaseNamesOfDefinition<Game>, InteractionId extends InteractionIdOfDefinitionPhase<Game, Phase>> = ClientParamsOfInteractionOfDefinition<Game, Phase, InteractionId>;
174
- type ScenarioReplayDefinition<Game> = {
175
- readonly id: string;
176
- readonly description?: string;
177
- readonly setup: ScenarioSetup;
178
- readonly given: readonly ScenarioCommandOf<Game>[];
179
- readonly when: readonly ScenarioCommandOf<Game>[];
180
- };
181
- type DeepReadonly<Value> = Value extends string | number | boolean | bigint | symbol ? Value : Value extends (...args: never[]) => unknown ? Value : Value extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : Value extends object ? {
182
- readonly [Key in keyof Value]: DeepReadonly<Value[Key]>;
183
- } : Value;
184
- type ScenarioPlayerView<Game> = Extract<"player", ViewNamesOfDefinition<Game>> extends infer ViewName ? ViewName extends ViewNamesOfDefinition<Game> ? ViewOfDefinition<Game, ViewName> : unknown : unknown;
185
- type ScenarioFlowDiagnostics = {
186
- readonly currentPhase: string | null;
187
- readonly currentStage: string | null;
188
- readonly activeSeats: readonly ScenarioSeatRef[];
189
- };
190
- type ScenarioDiagnostics = {
191
- readonly events: readonly ReducerDiagnosticEvent[];
192
- readonly lastDispatch: {
193
- readonly submissionId: string;
194
- readonly trace: readonly DispatchTraceSummaryEntry[];
195
- } | null;
196
- readonly flow: ScenarioFlowDiagnostics;
197
- };
198
- type ScenarioProbeAccepted<Game> = {
199
- readonly kind: "accepted";
200
- readonly command: ScenarioCommandOf<Game>;
201
- readonly checkpointDigest: string;
202
- readonly trace: readonly DispatchTraceSummaryEntry[];
203
- toBeAccepted(): void;
204
- toRejectWith(expected: RejectionExpectation): never;
205
- };
206
- type ScenarioProbeRejected<Game> = {
207
- readonly kind: "rejected";
208
- readonly command: ScenarioCommandOf<Game>;
209
- readonly errorCode: string;
210
- readonly message?: string;
211
- readonly trace: readonly DispatchTraceSummaryEntry[];
212
- toBeAccepted(): never;
213
- toRejectWith(expected: RejectionExpectation): void;
214
- };
215
- type ScenarioProbeResult<Game> = ScenarioProbeAccepted<Game> | ScenarioProbeRejected<Game>;
216
- type ScenarioAssertionContext<Game> = {
217
- readonly expect: ExpectFn;
218
- state(): DeepReadonly<GameStateOf<Game>>;
219
- view(seat: ScenarioSeatRef): DeepReadonly<ScenarioPlayerView<Game>>;
220
- interactions(seat: ScenarioSeatRef): readonly InteractionDescriptorLike[];
221
- explain(seat: ScenarioSeatRef, interactionId: string): InteractionExplanationLike;
222
- readonly diagnostics: ScenarioDiagnostics;
223
- probe(command: ScenarioCommandOf<Game>): Promise<ScenarioProbeResult<Game>>;
224
- };
225
- type ScenarioDefinition<Game> = ScenarioReplayDefinition<Game> & {
226
- /** Named authored states for CLI, Workbench, demo, and test adapters. */
227
- readonly checkpoints?: Readonly<Record<ScenarioCheckpointId, ScenarioCheckpoint>>;
228
- readonly then: (context: ScenarioAssertionContext<Game>) => void | Promise<void>;
229
- };
230
- type ScenarioCheckpoint = {
231
- readonly segment: "setup";
232
- readonly completed: 0;
233
- } | {
234
- readonly segment: "given";
235
- readonly completed: number;
236
- } | {
237
- readonly segment: "when";
238
- readonly completed: number;
239
- };
240
- type ScenarioCheckpointId = string;
241
- type ScenarioCheckpointSelector = ScenarioCheckpoint | ScenarioCheckpointId;
242
- /** Resolve authored names while keeping replay DTOs structurally checkpointed. */
243
- declare function resolveScenarioCheckpoint<Game>(definition: Pick<ScenarioDefinition<Game>, "checkpoints" | "given" | "id" | "when">, selector: ScenarioCheckpointSelector): ScenarioCheckpoint;
244
- type ScenarioReplaySegment = "given" | "when";
245
- type ScenarioCommandTraceEntry<Game> = {
246
- readonly segment: ScenarioReplaySegment;
247
- readonly index: number;
248
- readonly command: ScenarioCommandOf<Game>;
249
- readonly trace: readonly DispatchTraceSummaryEntry[];
250
- };
251
- type ScenarioReplay<Game> = {
252
- readonly scenarioId: string;
253
- readonly checkpoint: ScenarioCheckpoint;
254
- readonly checkpointDigest: string;
255
- readonly complete: boolean;
256
- readonly trace: readonly ScenarioCommandTraceEntry<Game>[];
257
- state(): DeepReadonly<GameStateOf<Game>>;
258
- view(seat: ScenarioSeatRef): DeepReadonly<ScenarioPlayerView<Game>>;
259
- interactions(seat: ScenarioSeatRef): readonly InteractionDescriptorLike[];
260
- explain(seat: ScenarioSeatRef, interactionId: string): InteractionExplanationLike;
261
- readonly diagnostics: ScenarioDiagnostics;
262
- clone(): ScenarioReplay<Game>;
263
- };
264
- type ReplayScenarioOptions<Game> = {
265
- readonly game: Game;
266
- readonly scenario: ScenarioReplayDefinition<Game>;
267
- readonly at?: ScenarioCheckpoint;
268
- };
269
- type AssertScenarioOptions<Game> = {
270
- readonly replay: ScenarioReplay<Game>;
271
- readonly assertion: ScenarioDefinition<Game>["then"];
272
- };
273
- type ScenarioReplayErrorOptions = {
274
- readonly scenarioId: string;
275
- readonly segment: ScenarioReplaySegment;
276
- readonly index: number;
277
- readonly interactionId: string;
278
- readonly errorCode: string;
279
- readonly reducerMessage?: string;
280
- readonly trace?: readonly DispatchTraceSummaryEntry[];
281
- };
282
- declare class ScenarioReplayError extends Error {
283
- readonly scenarioId: string;
284
- readonly segment: ScenarioReplaySegment;
285
- readonly index: number;
286
- readonly interactionId: string;
287
- readonly errorCode: string;
288
- readonly reducerMessage?: string;
289
- readonly trace: readonly DispatchTraceSummaryEntry[];
290
- constructor(options: ScenarioReplayErrorOptions);
291
- }
292
- type NoExtraScenarioFields<Actual, Expected> = Record<Exclude<keyof Actual, keyof Expected>, never>;
293
- type ScenarioAuthoring<Game> = {
294
- defineScenario<const Definition extends ScenarioDefinition<Game>>(definition: Definition & NoExtraScenarioFields<Definition, ScenarioDefinition<Game>>): Definition;
295
- };
296
- declare function createScenarioAuthoring<const Game extends ScenarioDefinitionGameLike>(game: Game): ScenarioAuthoring<Game>;
297
- /** Select and clone the only serializable portion of a loaded scenario. */
298
- declare function toScenarioReplayDefinition<Game>(definition: ScenarioDefinition<Game>): ScenarioReplayDefinition<Game>;
299
-
300
- export { type AssertScenarioOptions as A, type ScenarioReplaySegment as B, type ScenarioSchemaOutput as C, type ScenarioSeatRef as D, type ExpectFn as E, type ScenarioSetup as F, type SnapshotMatcherHandler as G, createScenarioAuthoring as H, type InteractionAvailabilityLike as I, resolveScenarioCheckpoint as J, toScenarioReplayDefinition as K, type RejectionExpectation as R, type ScenarioActor as S, type ExpectMatchers as a, type InteractionDescriptorLike as b, type InteractionExplanationLike as c, type ReplayScenarioOptions as d, type RuntimeParamsOfScenarioCommand as e, type ScenarioAssertionContext as f, type ScenarioAuthoring as g, type ScenarioCheckpoint as h, type ScenarioCheckpointId as i, type ScenarioCheckpointSelector as j, type ScenarioCommand as k, type ScenarioCommandOf as l, type ScenarioCommandTraceEntry as m, type ScenarioDefinition as n, type ScenarioDefinitionGameLike as o, type ScenarioDefinitionValidationCode as p, ScenarioDefinitionValidationError as q, type ScenarioDiagnostics as r, type ScenarioFlowDiagnostics as s, type ScenarioProbeAccepted as t, type ScenarioProbeRejected as u, type ScenarioProbeResult as v, type ScenarioReplay as w, type ScenarioReplayDefinition as x, ScenarioReplayError as y, type ScenarioReplayErrorOptions as z };
@@ -1,50 +0,0 @@
1
- type DispatchTraceSummaryEntry = {
2
- kind: "acceptedClientInput";
3
- interactionId: string;
4
- playerId: string;
5
- } | {
6
- kind: "appliedInstruction";
7
- instruction: string;
8
- } | {
9
- kind: "rngConsumption";
10
- version: 2;
11
- operation: string;
12
- drawIndex: number;
13
- };
14
- type ReducerDiagnosticEvent = {
15
- type: "submitReceived";
16
- submissionId: string;
17
- playerId: string;
18
- interactionId: string;
19
- phase: string;
20
- } | {
21
- type: "submitRejected";
22
- submissionId: string;
23
- errorCode: string;
24
- ruleId?: string;
25
- message?: string;
26
- } | {
27
- type: "submitAccepted";
28
- submissionId: string;
29
- trace: readonly DispatchTraceSummaryEntry[];
30
- } | {
31
- type: "phaseTransition";
32
- from: string;
33
- to: string;
34
- reason: "effect" | "lifecycle";
35
- } | {
36
- type: "authoringWarning";
37
- code: string;
38
- message: string;
39
- } | {
40
- type: "internalError";
41
- submissionId?: string;
42
- message: string;
43
- stack?: string;
44
- };
45
- type ReducerDiagnosticsSink = {
46
- event(event: ReducerDiagnosticEvent): void;
47
- };
48
- declare const noopDiagnosticsSink: ReducerDiagnosticsSink;
49
-
50
- export { type DispatchTraceSummaryEntry as D, type ReducerDiagnosticEvent as R, type ReducerDiagnosticsSink as a, noopDiagnosticsSink as n };
package/dist/digest.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { a as ActionSetVersionInput, N as SubmitInteractionCommand, v as PluginGameplayFrame } from './protocol-dYgafTYY.js';
2
- export { T as canonicalizePluginRuntimeJson, U as digestPluginRuntimeJson, V as encodeCanonicalPluginRuntimeJson } from './protocol-dYgafTYY.js';
3
-
4
- declare function computePluginActionSetVersion(input: ActionSetVersionInput): string;
5
- declare function digestPluginGameplayFrame(frame: PluginGameplayFrame): string;
6
- declare function digestPluginCommandRequest(command: SubmitInteractionCommand): string;
7
-
8
- export { computePluginActionSetVersion, digestPluginCommandRequest, digestPluginGameplayFrame };