@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
package/dist/testing.d.ts CHANGED
@@ -1,20 +1,302 @@
1
- import { G as SnapshotMatcherHandler, E as ExpectFn, o as ScenarioDefinitionGameLike, x as ScenarioReplayDefinition, h as ScenarioCheckpoint, k as ScenarioCommand } from './definitions-BgmV_GhC.js';
2
- export { A as AssertScenarioOptions, a as ExpectMatchers, I as InteractionAvailabilityLike, b as InteractionDescriptorLike, c as InteractionExplanationLike, R as RejectionExpectation, d as ReplayScenarioOptions, e as RuntimeParamsOfScenarioCommand, S as ScenarioActor, f as ScenarioAssertionContext, g as ScenarioAuthoring, i as ScenarioCheckpointId, j as ScenarioCheckpointSelector, l as ScenarioCommandOf, m as ScenarioCommandTraceEntry, n as ScenarioDefinition, p as ScenarioDefinitionValidationCode, q as ScenarioDefinitionValidationError, r as ScenarioDiagnostics, s as ScenarioFlowDiagnostics, t as ScenarioProbeAccepted, u as ScenarioProbeRejected, v as ScenarioProbeResult, w as ScenarioReplay, y as ScenarioReplayError, z as ScenarioReplayErrorOptions, B as ScenarioReplaySegment, C as ScenarioSchemaOutput, D as ScenarioSeatRef, F as ScenarioSetup, H as createScenarioAuthoring, J as resolveScenarioCheckpoint, K as toScenarioReplayDefinition } from './definitions-BgmV_GhC.js';
3
- import { R as ReducerDiagnosticEvent } from './diagnostics-DIi3ina7.js';
4
- import { g as ScenarioIdentity, f as PerspectiveSelector, e as InspectScenarioResult, P as PerspectiveRef, d as InspectNode, i as Sha256Digest, F as FlowDiagnostic, A as ActorRef, a as InspectEntropy, S as ScenarioDispatchTraceEntry } from './types-JWCYHmu7.js';
5
- export { I as InspectAction, b as InspectInteraction, c as InspectInteractionInput, j as assertScenario, p as probeScenarioCommand, r as replayScenario } from './types-JWCYHmu7.js';
6
- import { w as wire, a as ReducerBundleContract } from './index.d-DjzoK7zn.js';
7
- import { R as RuntimeJson } from './runtime-json-CQ9QbLZ5.js';
8
- import { B, y, z as z$1, v, E } from './protocol-dYgafTYY.js';
1
+ import { D as DispatchTraceSummaryEntry, b as ReducerDiagnosticEvent, a as ReducerBundleContract } from './diagnostics-B0lgnuZ6.js';
2
+ import { a6 as PhaseNamesOfDefinition, O as InteractionIdOfDefinitionPhase, Y as ManifestIdSchema, U as InteractionSpecByNameOfDefinitionPhase, o as GameStateOf, aY as ViewOfDefinition, av as RuntimeJson, g as ClientParamsOfInteractionOfDefinition, ak as ReducerSessionState, n as GameOutcome, l as GameInput, an as ReducerValidationResult, aH as SeatProjectionBundle, d as BoardStaticProjection, _ as OptionsOfContract } from './definition-BaHNPZol.js';
9
3
  import { z } from 'zod';
10
- import { r as BrowserInteractionIntentRequest, l as BrowserInteractionEffectRequest } from './types-DJj5MJkl.js';
11
- import { b as PluginTransport, P as PluginRuntimeClient } from './types-DR7DoB1x.js';
12
- import * as react_jsx_runtime from 'react/jsx-runtime';
13
- import react__default from 'react';
14
- export { S as StaleContractArtifactError, a as StaleContractArtifactErrorOptions, b as StaleContractArtifactKind, i as isStaleContractArtifactError } from './stale-contract-artifact-error-XLaweZtF.js';
15
- import './views-BpuWcOyN.js';
16
- import './runtime-RJ5orDJU.js';
17
- import './types.js';
4
+ import { i as SubmitResult, C as CommandSource, g as SourceSnapshot, a as ApplySource } from './types-DimqnJBq.js';
5
+ import 'honeycomb-grid';
6
+ import '@tanstack/store';
7
+
8
+ type ScenarioDefinitionValidationCode = "INVALID_TYPE" | "UNKNOWN_FIELD" | "INVALID_VALUE" | "UNSAFE_INTEGER" | "OUT_OF_RANGE" | "UNKNOWN_INTERACTION" | "INVALID_COMMAND_PARAMS" | "NON_SERIALIZABLE" | "NORMAL_SETUP_UNAVAILABLE";
9
+ declare class ScenarioDefinitionValidationError extends Error {
10
+ readonly code: ScenarioDefinitionValidationCode;
11
+ readonly path: string;
12
+ constructor(options: {
13
+ readonly code: ScenarioDefinitionValidationCode;
14
+ readonly path: string;
15
+ readonly reason: string;
16
+ });
17
+ }
18
+ type NormalSetupLike = {
19
+ readonly minPlayers: number;
20
+ readonly maxPlayers: number;
21
+ readonly createInitialTable: (options: {
22
+ readonly playerIds: readonly string[];
23
+ }) => unknown;
24
+ };
25
+ type ScenarioDefinitionGameLike = {
26
+ readonly contract: {
27
+ readonly manifest: {
28
+ readonly normalSetup?: NormalSetupLike;
29
+ readonly literals: {
30
+ readonly playerIds: readonly string[];
31
+ };
32
+ };
33
+ };
34
+ readonly phases: Readonly<Record<string, unknown>>;
35
+ };
36
+
37
+ type InteractionDescriptorLike = {
38
+ interactionId?: string;
39
+ surface?: string;
40
+ kind?: string;
41
+ availability?: InteractionAvailabilityLike;
42
+ } & Record<string, unknown>;
43
+ type InteractionAvailabilityLike = {
44
+ status: "available";
45
+ } | {
46
+ status: "notYourTurn";
47
+ reason: string;
48
+ } | {
49
+ status: "blocked";
50
+ reason: string;
51
+ code?: string;
52
+ };
53
+ type InteractionExplanationLike = {
54
+ interactionId: string;
55
+ phase: string;
56
+ step: string | null;
57
+ availability: "available" | "notYourTurn" | "wrongPhase" | "wrongStep" | "blocked";
58
+ rules: ReadonlyArray<{
59
+ ruleId: string;
60
+ outcome: "passed" | "failed" | "notEvaluated";
61
+ errorCode?: string;
62
+ message?: string;
63
+ }>;
64
+ actor: {
65
+ required: readonly string[];
66
+ playerIsActor: boolean;
67
+ };
68
+ inputs: ReadonlyArray<{
69
+ key: string;
70
+ kind: string;
71
+ eligibleCount: number | "unknown";
72
+ }>;
73
+ };
74
+ type SnapshotMatcherHandler = (name: string | undefined, actual: unknown) => void;
75
+ type RejectionExpectation = {
76
+ errorCode?: string;
77
+ message?: string | RegExp;
78
+ };
79
+ type ExpectMatchers = {
80
+ toBe: (expected: unknown) => void;
81
+ toEqual: (expected: unknown) => void;
82
+ toMatchObject: (expected: Record<string, unknown>) => void;
83
+ toBeDefined: () => void;
84
+ toBeUndefined: () => void;
85
+ toBeNull: () => void;
86
+ toContain: (expected: unknown) => void;
87
+ toContainEqual: (expected: unknown) => void;
88
+ toHaveLength: (expected: number) => void;
89
+ toBeGreaterThan: (expected: number) => void;
90
+ toBeGreaterThanOrEqual: (expected: number) => void;
91
+ toThrow: (predicate?: string | RegExp | ((error: Error) => boolean)) => void;
92
+ toMatchSnapshot: (filename?: string) => void;
93
+ toRejectWith: (expected: RejectionExpectation) => Promise<void>;
94
+ toHaveInteraction: (interactionId: string, opts?: Partial<InteractionDescriptorLike>) => void;
95
+ toBeGatedBy: (reason: string, opts?: {
96
+ interactionId?: string;
97
+ }) => void;
98
+ toBeAvailable: (explanation?: InteractionExplanationLike) => void;
99
+ not: {
100
+ toHaveInteraction: (interactionId: string) => void;
101
+ };
102
+ };
103
+ type ExpectFn = (actual: unknown) => ExpectMatchers;
104
+ type ScenarioSeatRef = {
105
+ readonly seat: number;
106
+ };
107
+ type ScenarioActor = ScenarioSeatRef;
108
+ type ScenarioSetup = {
109
+ readonly players: number;
110
+ readonly seed: number;
111
+ readonly options?: Readonly<Record<string, RuntimeJson>>;
112
+ };
113
+ type ScenarioTupleOutput<Items extends readonly z.core.SomeType[], Rest extends z.core.SomeType | null> = Rest extends z.core.SomeType ? readonly [
114
+ ...{
115
+ [Index in keyof Items]: ScenarioSchemaOutput<Items[Index]>;
116
+ },
117
+ ...ScenarioSchemaOutput<Rest>[]
118
+ ] : readonly [
119
+ ...{
120
+ [Index in keyof Items]: ScenarioSchemaOutput<Items[Index]>;
121
+ }
122
+ ];
123
+ type OptionalScenarioObjectKeys<Shape extends z.core.$ZodShape> = {
124
+ [Key in keyof Shape]: undefined extends z.output<Shape[Key]> ? Key : never;
125
+ }[keyof Shape];
126
+ type ScenarioObjectOutput<Shape extends z.core.$ZodShape> = {
127
+ readonly [Key in Exclude<keyof Shape, OptionalScenarioObjectKeys<Shape>>]: ScenarioSchemaOutput<Shape[Key]>;
128
+ } & {
129
+ readonly [Key in OptionalScenarioObjectKeys<Shape>]?: ScenarioSchemaOutput<Shape[Key]>;
130
+ };
131
+ /**
132
+ * Authoring projection of an input schema. Only semantic player-id leaves are
133
+ * replaced; ordinary strings retain their original type.
134
+ */
135
+ 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>;
136
+ type InputCollectorsOfInteraction<Interaction> = Interaction extends {
137
+ readonly steps: {
138
+ readonly collectors: infer Collectors extends Readonly<Record<string, unknown>>;
139
+ };
140
+ } ? Collectors : Interaction extends {
141
+ readonly inputs?: infer Collectors;
142
+ } ? NonNullable<Collectors> extends Readonly<Record<string, unknown>> ? NonNullable<Collectors> : Record<string, never> : Record<string, never>;
143
+ type ScenarioParamsOfCollectors<Collectors extends Readonly<Record<string, unknown>>> = {
144
+ readonly [Key in keyof Collectors as Collectors[Key] extends {
145
+ readonly kind: "rng";
146
+ } ? never : Key]: Collectors[Key] extends {
147
+ readonly schema: infer Schema extends z.core.SomeType;
148
+ } ? ScenarioSchemaOutput<Schema> : never;
149
+ };
150
+ type ScenarioStepParams<Params> = {
151
+ [Key in keyof Params]: Pick<Params, Key> & Partial<Record<Exclude<keyof Params, Key>, never>>;
152
+ }[keyof Params];
153
+ type ScenarioParamsOfInteraction<Interaction> = Interaction extends {
154
+ readonly steps: unknown;
155
+ } ? ScenarioStepParams<ScenarioParamsOfCollectors<InputCollectorsOfInteraction<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> = ViewOfDefinition<Game>;
185
+ type ScenarioFlowDiagnostics = {
186
+ readonly currentPhase: string | null;
187
+ readonly activeSeats: readonly ScenarioSeatRef[];
188
+ };
189
+ type ScenarioDiagnostics = {
190
+ readonly events: readonly ReducerDiagnosticEvent[];
191
+ readonly lastDispatch: {
192
+ readonly submissionId: string;
193
+ readonly trace: readonly DispatchTraceSummaryEntry[];
194
+ } | null;
195
+ readonly flow: ScenarioFlowDiagnostics;
196
+ };
197
+ type ScenarioProbeAccepted<Game> = {
198
+ readonly kind: "accepted";
199
+ readonly command: ScenarioCommandOf<Game>;
200
+ readonly checkpointDigest: string;
201
+ readonly trace: readonly DispatchTraceSummaryEntry[];
202
+ toBeAccepted(): void;
203
+ toRejectWith(expected: RejectionExpectation): never;
204
+ };
205
+ type ScenarioProbeRejected<Game> = {
206
+ readonly kind: "rejected";
207
+ readonly command: ScenarioCommandOf<Game>;
208
+ readonly errorCode: string;
209
+ readonly message?: string;
210
+ readonly trace: readonly DispatchTraceSummaryEntry[];
211
+ toBeAccepted(): never;
212
+ toRejectWith(expected: RejectionExpectation): void;
213
+ };
214
+ type ScenarioProbeResult<Game> = ScenarioProbeAccepted<Game> | ScenarioProbeRejected<Game>;
215
+ type ScenarioAssertionContext<Game> = {
216
+ readonly expect: ExpectFn;
217
+ state(): DeepReadonly<GameStateOf<Game>>;
218
+ view(seat: ScenarioSeatRef): DeepReadonly<ScenarioPlayerView<Game>>;
219
+ interactions(seat: ScenarioSeatRef): readonly InteractionDescriptorLike[];
220
+ explain(seat: ScenarioSeatRef, interactionId: string): InteractionExplanationLike;
221
+ readonly diagnostics: ScenarioDiagnostics;
222
+ probe(command: ScenarioCommandOf<Game>): Promise<ScenarioProbeResult<Game>>;
223
+ };
224
+ type ScenarioDefinition<Game> = ScenarioReplayDefinition<Game> & {
225
+ /** Named authored states for CLI, Workbench, demo, and test adapters. */
226
+ readonly checkpoints?: Readonly<Record<ScenarioCheckpointId, ScenarioCheckpoint>>;
227
+ readonly then: (context: ScenarioAssertionContext<Game>) => void | Promise<void>;
228
+ };
229
+ type ScenarioCheckpoint = {
230
+ readonly segment: "setup";
231
+ readonly completed: 0;
232
+ } | {
233
+ readonly segment: "given";
234
+ readonly completed: number;
235
+ } | {
236
+ readonly segment: "when";
237
+ readonly completed: number;
238
+ };
239
+ type ScenarioCheckpointId = string;
240
+ type ScenarioCheckpointSelector = ScenarioCheckpoint | ScenarioCheckpointId;
241
+ /** Resolve authored names while keeping replay DTOs structurally checkpointed. */
242
+ declare function resolveScenarioCheckpoint<Game>(definition: Pick<ScenarioDefinition<Game>, "checkpoints" | "given" | "id" | "when">, selector: ScenarioCheckpointSelector): ScenarioCheckpoint;
243
+ type ScenarioReplaySegment = "given" | "when";
244
+ type ScenarioCommandTraceEntry<Game> = {
245
+ readonly segment: ScenarioReplaySegment;
246
+ readonly index: number;
247
+ readonly command: ScenarioCommandOf<Game>;
248
+ readonly trace: readonly DispatchTraceSummaryEntry[];
249
+ };
250
+ type ScenarioReplay<Game> = {
251
+ readonly scenarioId: string;
252
+ readonly checkpoint: ScenarioCheckpoint;
253
+ readonly checkpointDigest: string;
254
+ readonly complete: boolean;
255
+ readonly trace: readonly ScenarioCommandTraceEntry<Game>[];
256
+ state(): DeepReadonly<GameStateOf<Game>>;
257
+ view(seat: ScenarioSeatRef): DeepReadonly<ScenarioPlayerView<Game>>;
258
+ interactions(seat: ScenarioSeatRef): readonly InteractionDescriptorLike[];
259
+ explain(seat: ScenarioSeatRef, interactionId: string): InteractionExplanationLike;
260
+ readonly diagnostics: ScenarioDiagnostics;
261
+ clone(): ScenarioReplay<Game>;
262
+ };
263
+ type ReplayScenarioOptions<Game> = {
264
+ /** Exact production artifact to execute; omitted for ordinary authored replay. */
265
+ readonly bundle?: ReducerBundleContract;
266
+ readonly game: Game;
267
+ readonly scenario: ScenarioReplayDefinition<Game>;
268
+ readonly at?: ScenarioCheckpoint;
269
+ };
270
+ type AssertScenarioOptions<Game> = {
271
+ readonly replay: ScenarioReplay<Game>;
272
+ readonly assertion: ScenarioDefinition<Game>["then"];
273
+ };
274
+ type ScenarioReplayErrorOptions = {
275
+ readonly scenarioId: string;
276
+ readonly segment: ScenarioReplaySegment;
277
+ readonly index: number;
278
+ readonly interactionId: string;
279
+ readonly errorCode: string;
280
+ readonly reducerMessage?: string;
281
+ readonly trace?: readonly DispatchTraceSummaryEntry[];
282
+ };
283
+ declare class ScenarioReplayError extends Error {
284
+ readonly scenarioId: string;
285
+ readonly segment: ScenarioReplaySegment;
286
+ readonly index: number;
287
+ readonly interactionId: string;
288
+ readonly errorCode: string;
289
+ readonly reducerMessage?: string;
290
+ readonly trace: readonly DispatchTraceSummaryEntry[];
291
+ constructor(options: ScenarioReplayErrorOptions);
292
+ }
293
+ type NoExtraScenarioFields<Actual, Expected> = Record<Exclude<keyof Actual, keyof Expected>, never>;
294
+ type ScenarioAuthoring<Game> = {
295
+ defineScenario<const Definition extends ScenarioDefinition<Game>>(definition: Definition & NoExtraScenarioFields<Definition, ScenarioDefinition<Game>>): Definition;
296
+ };
297
+ declare function createScenarioAuthoring<const Game extends ScenarioDefinitionGameLike>(game: Game): ScenarioAuthoring<Game>;
298
+ /** Select and clone the only serializable portion of a loaded scenario. */
299
+ declare function toScenarioReplayDefinition<Game>(definition: ScenarioDefinition<Game>): ScenarioReplayDefinition<Game>;
18
300
 
19
301
  type CreateExpectApiOptions = {
20
302
  matchSnapshot?: SnapshotMatcherHandler;
@@ -30,6 +312,126 @@ declare class ScenarioAssertionError extends Error {
30
312
  constructor(message: string);
31
313
  }
32
314
 
315
+ declare function replayScenario<const Game extends ScenarioDefinitionGameLike>(options: ReplayScenarioOptions<Game>): Promise<ScenarioReplay<Game>>;
316
+ type ScenarioRuntimeCheckpointMaterialization = {
317
+ readonly checkpoint: ScenarioCheckpoint;
318
+ readonly checkpointDigest: string;
319
+ readonly playerIds: readonly string[];
320
+ readonly state: ReducerSessionState;
321
+ readonly terminal: GameOutcome | null;
322
+ };
323
+ /**
324
+ * Trusted tool-side materialization for CLI, Workbench, and backend adapters.
325
+ * The returned reducer snapshot must never cross a player/browser boundary.
326
+ */
327
+ declare function materializeScenarioRuntimeCheckpoint<const Game extends ScenarioDefinitionGameLike>(options: ReplayScenarioOptions<Game>): Promise<ScenarioRuntimeCheckpointMaterialization>;
328
+ declare function assertScenario<Game>(options: AssertScenarioOptions<Game>): Promise<void>;
329
+ declare function probeScenarioCommand<Game>(options: {
330
+ readonly replay: ScenarioReplay<Game>;
331
+ readonly command: ScenarioCommandOf<Game>;
332
+ }): Promise<ScenarioProbeResult<Game>>;
333
+
334
+ type Sha256Digest = `sha256:${string}`;
335
+ type ScenarioIdentity = {
336
+ readonly id: string;
337
+ readonly path: string;
338
+ readonly sourceDigest: Sha256Digest;
339
+ };
340
+ type ActorRef = {
341
+ readonly seat: number;
342
+ readonly playerId: string;
343
+ };
344
+ type PerspectiveRef = {
345
+ readonly kind: "player";
346
+ readonly actor: ActorRef;
347
+ } | {
348
+ readonly kind: "spectator";
349
+ };
350
+ type PerspectiveSelector = {
351
+ readonly kind: "player";
352
+ readonly seat: number;
353
+ } | {
354
+ readonly kind: "spectator";
355
+ };
356
+ type FlowDiagnostic = {
357
+ readonly phase: string;
358
+ readonly step: string | null;
359
+ readonly activeActors: readonly ActorRef[];
360
+ readonly pendingActors: readonly ActorRef[];
361
+ readonly continuationWaiters: readonly ActorRef[];
362
+ readonly blockedBy: readonly {
363
+ readonly actor: ActorRef;
364
+ readonly blockers: readonly ActorRef[];
365
+ readonly source: "scheduler";
366
+ }[];
367
+ };
368
+ type InspectInteractionInput = {
369
+ readonly key: string;
370
+ readonly kind: string;
371
+ readonly eligibleCount: number | "unknown";
372
+ };
373
+ type InspectInteraction = {
374
+ readonly actor: ActorRef;
375
+ readonly interactionId: string;
376
+ readonly availability: {
377
+ readonly status: "available" | "notYourTurn" | "blocked";
378
+ readonly code?: string;
379
+ readonly reason?: string;
380
+ };
381
+ readonly inputs: readonly InspectInteractionInput[];
382
+ readonly explanation: InteractionExplanationLike;
383
+ };
384
+ type InspectAction = {
385
+ readonly actor: ActorRef;
386
+ readonly interactionId: string;
387
+ readonly inputs: readonly InspectInteractionInput[];
388
+ readonly explanation: InteractionExplanationLike;
389
+ readonly hasConcreteCommand: true;
390
+ };
391
+ type ScenarioDispatchTraceEntry = {
392
+ readonly kind: "acceptedCommand";
393
+ readonly actor: ActorRef;
394
+ readonly interactionId: string;
395
+ } | {
396
+ readonly kind: "phaseEntered";
397
+ readonly from: string;
398
+ readonly to: string;
399
+ } | {
400
+ readonly kind: "entropyDraw";
401
+ readonly drawIndex: number;
402
+ };
403
+ type InspectEntropy = {
404
+ readonly seed: number;
405
+ readonly draws: readonly {
406
+ readonly index: number;
407
+ readonly cursorBefore: number;
408
+ readonly cursorAfter: number;
409
+ readonly operation: {
410
+ readonly kind: string;
411
+ readonly parameters: Readonly<Record<string, string | number | boolean>>;
412
+ };
413
+ }[];
414
+ };
415
+ type InspectNode = {
416
+ readonly checkpoint: ScenarioCheckpoint;
417
+ readonly checkpointDigest: Sha256Digest;
418
+ readonly setup: ScenarioSetup;
419
+ readonly flow: FlowDiagnostic;
420
+ readonly perspective: PerspectiveRef;
421
+ readonly publicState: unknown;
422
+ readonly view: unknown;
423
+ readonly interactions: readonly InspectInteraction[];
424
+ readonly actions: readonly InspectAction[];
425
+ readonly entropy: InspectEntropy;
426
+ readonly dispatchTrace: readonly ScenarioDispatchTraceEntry[];
427
+ };
428
+ type InspectScenarioResult = {
429
+ readonly schemaVersion: 1;
430
+ readonly scenario: ScenarioIdentity;
431
+ readonly node: InspectNode;
432
+ readonly seedSource: "scenario" | "override";
433
+ };
434
+
33
435
  type InspectScenarioOptions<Game extends ScenarioDefinitionGameLike> = {
34
436
  readonly game: Game;
35
437
  readonly scenario: ScenarioReplayDefinition<Game>;
@@ -96,7 +498,7 @@ type ExploreSeedResult = {
96
498
  readonly actions: readonly {
97
499
  readonly seat: number;
98
500
  readonly interactionId: string;
99
- readonly concreteOptionCount: number | "lazy";
501
+ readonly concreteOptionCount: number | "unknown";
100
502
  }[];
101
503
  };
102
504
  readonly rejection?: {
@@ -129,9 +531,9 @@ interface ReducerScenarioViewer {
129
531
  }
130
532
  interface ReducerScenarioFrame {
131
533
  readonly id: string;
132
- readonly reducerState: wire.ReducerSessionState;
133
- readonly dynamicProjection: wire.SeatProjectionBundle;
134
- readonly staticProjection?: wire.BoardStaticProjection | null;
534
+ readonly reducerState: ReducerSessionState;
535
+ readonly dynamicProjection: SeatProjectionBundle;
536
+ readonly staticProjection?: BoardStaticProjection | null;
135
537
  readonly gameVersion: number;
136
538
  readonly actionSetVersion: string;
137
539
  readonly projectionDigest: string;
@@ -147,13 +549,13 @@ type ReducerScenarioExchange = {
147
549
  readonly id: string;
148
550
  readonly operation: "validate";
149
551
  readonly fromFrameId: string;
150
- readonly input: wire.GameInput;
151
- readonly result: wire.ReducerInputValidationResult;
552
+ readonly input: GameInput;
553
+ readonly result: ReducerValidationResult;
152
554
  } | {
153
555
  readonly id: string;
154
556
  readonly operation: "submit";
155
557
  readonly fromFrameId: string;
156
- readonly input: wire.GameInput;
558
+ readonly input: GameInput;
157
559
  readonly result: {
158
560
  readonly kind: "accepted";
159
561
  readonly toFrameId: string;
@@ -169,16 +571,16 @@ interface ReducerScenarioDiagnostic {
169
571
  type ReducerScenarioOperation = {
170
572
  readonly id: string;
171
573
  readonly operation: "validate";
172
- readonly input: wire.GameInput;
574
+ readonly input: GameInput;
173
575
  } | {
174
576
  readonly id: string;
175
577
  readonly operation: "submit";
176
- readonly input: wire.GameInput;
578
+ readonly input: GameInput;
177
579
  };
178
580
  interface CreateReducerScenarioRunnerOptions {
179
581
  readonly scenarioId: string;
180
582
  readonly gameId: string;
181
- readonly initialState: wire.ReducerSessionState;
583
+ readonly initialState: ReducerSessionState;
182
584
  readonly bundle: ReducerScenarioBundle;
183
585
  readonly viewer: ReducerScenarioViewer;
184
586
  readonly playerIds: readonly string[];
@@ -190,553 +592,105 @@ interface ReducerScenarioRunner {
190
592
 
191
593
  declare function createReducerScenarioRunner(options: CreateReducerScenarioRunnerOptions): ReducerScenarioRunner;
192
594
 
193
- declare const UI_SCENARIO_FIXTURE_SCHEMA_VERSION = 2;
194
- declare const UI_SCENARIO_FIXTURE_BUNDLE_SCHEMA_VERSION = 2;
195
- declare const UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR = 3;
196
- declare const UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL: 4;
197
- declare const uiFixtureFrameSchema: z.ZodObject<{
198
- id: z.ZodString;
199
- frame: z.ZodType<v<unknown, string, string, string>, unknown, z.core.$ZodTypeInternals<v<unknown, string, string, string>, unknown>>;
200
- projectionDigest: z.ZodString;
201
- }, z.core.$strict>;
202
- declare const uiFixtureProtocolStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
- id: z.ZodString;
204
- kind: z.ZodLiteral<"host.frame">;
205
- frameId: z.ZodString;
206
- }, z.core.$strict>, z.ZodObject<{
207
- id: z.ZodString;
208
- kind: z.ZodLiteral<"client.submit">;
209
- fromFrameId: z.ZodString;
210
- requestDigest: z.ZodString;
211
- response: z.ZodDiscriminatedUnion<[z.ZodObject<{
212
- type: z.ZodLiteral<"interaction.result">;
213
- clientActionId: z.ZodString;
214
- accepted: z.ZodLiteral<true>;
215
- }, z.core.$strict>, z.ZodObject<{
216
- type: z.ZodLiteral<"interaction.result">;
217
- clientActionId: z.ZodString;
218
- accepted: z.ZodLiteral<false>;
219
- errorCode: z.ZodString;
220
- message: z.ZodOptional<z.ZodString>;
221
- }, z.core.$strict>], "accepted">;
222
- }, z.core.$strict>], "kind">;
223
- declare const pluginProtocolTapeSchema: z.ZodType<B, unknown, z.core.$ZodTypeInternals<B, unknown>>;
224
- declare const uiReplayRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
225
- surface: z.ZodString;
226
- scopeId: z.ZodOptional<z.ZodString>;
227
- interactionKey: z.ZodOptional<z.ZodString>;
228
- interactionId: z.ZodOptional<z.ZodString>;
229
- intent: z.ZodString;
230
- inputKey: z.ZodOptional<z.ZodString>;
231
- candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
232
- candidateValueKey: z.ZodOptional<z.ZodString>;
233
- actuatorKind: z.ZodOptional<z.ZodEnum<{
234
- fill: "fill";
235
- pointer: "pointer";
236
- keyboard: "keyboard";
237
- click: "click";
238
- }>>;
239
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
240
- }, z.core.$strict>, z.ZodObject<{
241
- surface: z.ZodString;
242
- scopeId: z.ZodOptional<z.ZodString>;
243
- interactionKey: z.ZodOptional<z.ZodString>;
244
- interactionId: z.ZodOptional<z.ZodString>;
245
- effect: z.ZodObject<{
246
- kind: z.ZodString;
247
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
248
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
249
- }, z.core.$strict>]>;
250
- declare const uiReplayExecutionSchema: z.ZodUnion<readonly [z.ZodObject<{
251
- kind: z.ZodLiteral<"activate">;
252
- }, z.core.$strict>, z.ZodObject<{
253
- kind: z.ZodLiteral<"fill">;
254
- value: z.ZodString;
255
- }, z.core.$strict>, z.ZodObject<{
256
- kind: z.ZodLiteral<"drag">;
257
- target: z.ZodObject<{
258
- surface: z.ZodString;
259
- scopeId: z.ZodOptional<z.ZodString>;
260
- interactionKey: z.ZodOptional<z.ZodString>;
261
- interactionId: z.ZodOptional<z.ZodString>;
262
- effect: z.ZodObject<{
263
- kind: z.ZodString;
264
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
265
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
266
- }, z.core.$strict>;
267
- }, z.core.$strict>]>;
268
- declare const uiStepExpectationSchema: z.ZodObject<{
269
- frameId: z.ZodOptional<z.ZodString>;
270
- projectionDigest: z.ZodOptional<z.ZodString>;
271
- semanticDigest: z.ZodOptional<z.ZodString>;
272
- draftDigest: z.ZodOptional<z.ZodString>;
273
- submissionDigest: z.ZodOptional<z.ZodString>;
274
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
275
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
- }, z.core.$strict>;
277
- declare const uiResolvedReplayIdentitySchema: z.ZodObject<{
278
- stepId: z.ZodString;
279
- surface: z.ZodString;
280
- scopeId: z.ZodString;
281
- interactionKey: z.ZodString;
282
- interactionId: z.ZodString;
283
- actuatorId: z.ZodString;
284
- descriptorDigest: z.ZodOptional<z.ZodString>;
285
- draftDigest: z.ZodOptional<z.ZodString>;
286
- }, z.core.$strict>;
287
- declare const portableSemanticReplayStepSchema: z.ZodObject<{
288
- stepId: z.ZodString;
289
- requestDigest: z.ZodString;
290
- resolve: z.ZodUnion<readonly [z.ZodObject<{
291
- surface: z.ZodString;
292
- scopeId: z.ZodOptional<z.ZodString>;
293
- interactionKey: z.ZodOptional<z.ZodString>;
294
- interactionId: z.ZodOptional<z.ZodString>;
295
- intent: z.ZodString;
296
- inputKey: z.ZodOptional<z.ZodString>;
297
- candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
298
- candidateValueKey: z.ZodOptional<z.ZodString>;
299
- actuatorKind: z.ZodOptional<z.ZodEnum<{
300
- fill: "fill";
301
- pointer: "pointer";
302
- keyboard: "keyboard";
303
- click: "click";
304
- }>>;
305
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
306
- }, z.core.$strict>, z.ZodObject<{
307
- surface: z.ZodString;
308
- scopeId: z.ZodOptional<z.ZodString>;
309
- interactionKey: z.ZodOptional<z.ZodString>;
310
- interactionId: z.ZodOptional<z.ZodString>;
311
- effect: z.ZodObject<{
312
- kind: z.ZodString;
313
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
314
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
315
- }, z.core.$strict>]>;
316
- execute: z.ZodUnion<readonly [z.ZodObject<{
317
- kind: z.ZodLiteral<"activate">;
318
- }, z.core.$strict>, z.ZodObject<{
319
- kind: z.ZodLiteral<"fill">;
320
- value: z.ZodString;
321
- }, z.core.$strict>, z.ZodObject<{
322
- kind: z.ZodLiteral<"drag">;
323
- target: z.ZodObject<{
324
- surface: z.ZodString;
325
- scopeId: z.ZodOptional<z.ZodString>;
326
- interactionKey: z.ZodOptional<z.ZodString>;
327
- interactionId: z.ZodOptional<z.ZodString>;
328
- effect: z.ZodObject<{
329
- kind: z.ZodString;
330
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
331
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
332
- }, z.core.$strict>;
333
- }, z.core.$strict>]>;
334
- expectedIdentity: z.ZodOptional<z.ZodObject<{
335
- stepId: z.ZodString;
336
- surface: z.ZodString;
337
- scopeId: z.ZodString;
338
- interactionKey: z.ZodString;
339
- interactionId: z.ZodString;
340
- actuatorId: z.ZodString;
341
- descriptorDigest: z.ZodOptional<z.ZodString>;
342
- draftDigest: z.ZodOptional<z.ZodString>;
343
- }, z.core.$strict>>;
344
- expect: z.ZodObject<{
345
- frameId: z.ZodOptional<z.ZodString>;
346
- projectionDigest: z.ZodOptional<z.ZodString>;
347
- semanticDigest: z.ZodOptional<z.ZodString>;
348
- draftDigest: z.ZodOptional<z.ZodString>;
349
- submissionDigest: z.ZodOptional<z.ZodString>;
350
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
351
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
352
- }, z.core.$strict>;
353
- }, z.core.$strict>;
354
- declare const uiScenarioReplayStepSchema: z.ZodUnion<readonly [z.ZodObject<{
355
- stepId: z.ZodString;
356
- requestDigest: z.ZodString;
357
- resolve: z.ZodUnion<readonly [z.ZodObject<{
358
- surface: z.ZodString;
359
- scopeId: z.ZodOptional<z.ZodString>;
360
- interactionKey: z.ZodOptional<z.ZodString>;
361
- interactionId: z.ZodOptional<z.ZodString>;
362
- intent: z.ZodString;
363
- inputKey: z.ZodOptional<z.ZodString>;
364
- candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
365
- candidateValueKey: z.ZodOptional<z.ZodString>;
366
- actuatorKind: z.ZodOptional<z.ZodEnum<{
367
- fill: "fill";
368
- pointer: "pointer";
369
- keyboard: "keyboard";
370
- click: "click";
371
- }>>;
372
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
373
- }, z.core.$strict>, z.ZodObject<{
374
- surface: z.ZodString;
375
- scopeId: z.ZodOptional<z.ZodString>;
376
- interactionKey: z.ZodOptional<z.ZodString>;
377
- interactionId: z.ZodOptional<z.ZodString>;
378
- effect: z.ZodObject<{
379
- kind: z.ZodString;
380
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
381
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
382
- }, z.core.$strict>]>;
383
- execute: z.ZodUnion<readonly [z.ZodObject<{
384
- kind: z.ZodLiteral<"activate">;
385
- }, z.core.$strict>, z.ZodObject<{
386
- kind: z.ZodLiteral<"fill">;
387
- value: z.ZodString;
388
- }, z.core.$strict>, z.ZodObject<{
389
- kind: z.ZodLiteral<"drag">;
390
- target: z.ZodObject<{
391
- surface: z.ZodString;
392
- scopeId: z.ZodOptional<z.ZodString>;
393
- interactionKey: z.ZodOptional<z.ZodString>;
394
- interactionId: z.ZodOptional<z.ZodString>;
395
- effect: z.ZodObject<{
396
- kind: z.ZodString;
397
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
398
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
399
- }, z.core.$strict>;
400
- }, z.core.$strict>]>;
401
- expectedIdentity: z.ZodOptional<z.ZodObject<{
402
- stepId: z.ZodString;
403
- surface: z.ZodString;
404
- scopeId: z.ZodString;
405
- interactionKey: z.ZodString;
406
- interactionId: z.ZodString;
407
- actuatorId: z.ZodString;
408
- descriptorDigest: z.ZodOptional<z.ZodString>;
409
- draftDigest: z.ZodOptional<z.ZodString>;
410
- }, z.core.$strict>>;
411
- expect: z.ZodObject<{
412
- frameId: z.ZodOptional<z.ZodString>;
413
- projectionDigest: z.ZodOptional<z.ZodString>;
414
- semanticDigest: z.ZodOptional<z.ZodString>;
415
- draftDigest: z.ZodOptional<z.ZodString>;
416
- submissionDigest: z.ZodOptional<z.ZodString>;
417
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
418
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
419
- }, z.core.$strict>;
420
- }, z.core.$strict>, z.ZodObject<{
421
- stepId: z.ZodString;
422
- kind: z.ZodLiteral<"assert">;
423
- expect: z.ZodObject<{
424
- frameId: z.ZodOptional<z.ZodString>;
425
- projectionDigest: z.ZodOptional<z.ZodString>;
426
- semanticDigest: z.ZodOptional<z.ZodString>;
427
- draftDigest: z.ZodOptional<z.ZodString>;
428
- submissionDigest: z.ZodOptional<z.ZodString>;
429
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
430
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
431
- }, z.core.$strict>;
432
- }, z.core.$strict>]>;
433
- declare const uiScenarioFixtureSchema: z.ZodObject<{
434
- schemaVersion: z.ZodLiteral<2>;
435
- browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
436
- pluginRuntimeProtocol: z.ZodLiteral<4>;
437
- id: z.ZodString;
438
- title: z.ZodString;
439
- gameId: z.ZodString;
440
- tags: z.ZodArray<z.ZodString>;
441
- source: z.ZodObject<{
442
- scenarioId: z.ZodString;
443
- reducerFingerprint: z.ZodString;
444
- uiContractFingerprint: z.ZodString;
445
- renderModule: z.ZodString;
446
- renderModuleDigest: z.ZodString;
447
- sourceDigest: z.ZodString;
448
- sourceFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
449
- }, z.core.$strict>;
450
- viewer: z.ZodObject<{
451
- seatId: z.ZodString;
452
- playerId: z.ZodOptional<z.ZodString>;
453
- }, z.core.$strict>;
454
- environment: z.ZodObject<{
455
- clockIso: z.ZodString;
456
- randomSeed: z.ZodString;
457
- locale: z.ZodLiteral<"en-US">;
458
- timezone: z.ZodLiteral<"UTC">;
459
- viewportTags: z.ZodArray<z.ZodEnum<{
460
- touch: "touch";
461
- desktop: "desktop";
462
- tablet: "tablet";
463
- phone: "phone";
464
- }>>;
465
- }, z.core.$strict>;
466
- protocol: z.ZodType<B, unknown, z.core.$ZodTypeInternals<B, unknown>>;
467
- replay: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
468
- stepId: z.ZodString;
469
- requestDigest: z.ZodString;
470
- resolve: z.ZodUnion<readonly [z.ZodObject<{
471
- surface: z.ZodString;
472
- scopeId: z.ZodOptional<z.ZodString>;
473
- interactionKey: z.ZodOptional<z.ZodString>;
474
- interactionId: z.ZodOptional<z.ZodString>;
475
- intent: z.ZodString;
476
- inputKey: z.ZodOptional<z.ZodString>;
477
- candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
478
- candidateValueKey: z.ZodOptional<z.ZodString>;
479
- actuatorKind: z.ZodOptional<z.ZodEnum<{
480
- fill: "fill";
481
- pointer: "pointer";
482
- keyboard: "keyboard";
483
- click: "click";
484
- }>>;
485
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
486
- }, z.core.$strict>, z.ZodObject<{
487
- surface: z.ZodString;
488
- scopeId: z.ZodOptional<z.ZodString>;
489
- interactionKey: z.ZodOptional<z.ZodString>;
490
- interactionId: z.ZodOptional<z.ZodString>;
491
- effect: z.ZodObject<{
492
- kind: z.ZodString;
493
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
494
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
495
- }, z.core.$strict>]>;
496
- execute: z.ZodUnion<readonly [z.ZodObject<{
497
- kind: z.ZodLiteral<"activate">;
498
- }, z.core.$strict>, z.ZodObject<{
499
- kind: z.ZodLiteral<"fill">;
500
- value: z.ZodString;
501
- }, z.core.$strict>, z.ZodObject<{
502
- kind: z.ZodLiteral<"drag">;
503
- target: z.ZodObject<{
504
- surface: z.ZodString;
505
- scopeId: z.ZodOptional<z.ZodString>;
506
- interactionKey: z.ZodOptional<z.ZodString>;
507
- interactionId: z.ZodOptional<z.ZodString>;
508
- effect: z.ZodObject<{
509
- kind: z.ZodString;
510
- }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
511
- allowDisabled: z.ZodOptional<z.ZodBoolean>;
512
- }, z.core.$strict>;
513
- }, z.core.$strict>]>;
514
- expectedIdentity: z.ZodOptional<z.ZodObject<{
515
- stepId: z.ZodString;
516
- surface: z.ZodString;
517
- scopeId: z.ZodString;
518
- interactionKey: z.ZodString;
519
- interactionId: z.ZodString;
520
- actuatorId: z.ZodString;
521
- descriptorDigest: z.ZodOptional<z.ZodString>;
522
- draftDigest: z.ZodOptional<z.ZodString>;
523
- }, z.core.$strict>>;
524
- expect: z.ZodObject<{
525
- frameId: z.ZodOptional<z.ZodString>;
526
- projectionDigest: z.ZodOptional<z.ZodString>;
527
- semanticDigest: z.ZodOptional<z.ZodString>;
528
- draftDigest: z.ZodOptional<z.ZodString>;
529
- submissionDigest: z.ZodOptional<z.ZodString>;
530
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
531
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
532
- }, z.core.$strict>;
533
- }, z.core.$strict>, z.ZodObject<{
534
- stepId: z.ZodString;
535
- kind: z.ZodLiteral<"assert">;
536
- expect: z.ZodObject<{
537
- frameId: z.ZodOptional<z.ZodString>;
538
- projectionDigest: z.ZodOptional<z.ZodString>;
539
- semanticDigest: z.ZodOptional<z.ZodString>;
540
- draftDigest: z.ZodOptional<z.ZodString>;
541
- submissionDigest: z.ZodOptional<z.ZodString>;
542
- focusedInteractionKey: z.ZodOptional<z.ZodString>;
543
- visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
544
- }, z.core.$strict>;
545
- }, z.core.$strict>]>>;
546
- expected: z.ZodObject<{
547
- initialProjectionDigest: z.ZodString;
548
- finalProjectionDigest: z.ZodString;
549
- finalSemanticDigest: z.ZodString;
550
- submissionDigest: z.ZodString;
551
- }, z.core.$strict>;
552
- }, z.core.$strict>;
553
- declare const uiScenarioFixtureBundleIndexSchema: z.ZodObject<{
554
- schemaVersion: z.ZodLiteral<2>;
555
- bundleId: z.ZodString;
556
- sdkCommit: z.ZodString;
557
- pluginRuntimeProtocol: z.ZodLiteral<4>;
558
- browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
559
- fixtures: z.ZodArray<z.ZodObject<{
560
- id: z.ZodString;
561
- file: z.ZodString;
562
- sha256: z.ZodString;
563
- renderModule: z.ZodString;
564
- renderModuleSha256: z.ZodString;
565
- components: z.ZodArray<z.ZodString>;
566
- capabilities: z.ZodArray<z.ZodString>;
567
- }, z.core.$strict>>;
568
- }, z.core.$strict>;
569
- type UIReplayRequest = BrowserInteractionIntentRequest | BrowserInteractionEffectRequest;
570
- type UIReplayExecution = z.infer<typeof uiReplayExecutionSchema>;
571
- type UIStepExpectation = z.infer<typeof uiStepExpectationSchema>;
572
- type UIResolvedReplayIdentity = z.infer<typeof uiResolvedReplayIdentitySchema>;
573
- type PortableSemanticReplayStep = z.infer<typeof portableSemanticReplayStepSchema>;
574
- type UIScenarioReplayStep = z.infer<typeof uiScenarioReplayStepSchema>;
575
- type UIFixtureFrame = y;
576
- type UIFixtureProtocolStep = z$1;
577
- type PluginProtocolTape = B;
578
- type UIScenarioFixture = Omit<z.infer<typeof uiScenarioFixtureSchema>, "protocol" | "replay"> & {
579
- readonly protocol: PluginProtocolTape;
580
- readonly replay: readonly UIScenarioReplayStep[];
581
- };
582
- type UIScenarioFixtureBundleIndex = z.infer<typeof uiScenarioFixtureBundleIndexSchema>;
583
- declare function parseUIScenarioFixture(value: unknown): UIScenarioFixture;
584
- declare function parseUIScenarioFixtureBundleIndex(value: unknown): UIScenarioFixtureBundleIndex;
585
- declare function assertSupportedBrowserInteractionProtocol(version: string): void;
586
-
587
- type UIScenarioAuthorityKind = "protocol" | "reducer";
588
- interface UIScenarioEnvironmentDefinition {
589
- readonly viewport?: "desktop" | "tablet" | "phone";
590
- readonly browsers?: readonly ("chromium" | "webkit")[];
591
- readonly input?: readonly ("mouse" | "touch" | "keyboard")[];
595
+ interface CapturedSubmission {
596
+ readonly operation: "submit" | "cancel";
597
+ readonly interactionId: string;
598
+ readonly params?: RuntimeJson;
599
+ resolve(result: SubmitResult): void;
592
600
  }
593
- interface ProtocolUIScenarioAuthority {
594
- readonly kind: "protocol";
595
- readonly tape: PluginProtocolTape;
601
+ interface TestSource extends CommandSource {
602
+ readonly submissions: readonly CapturedSubmission[];
603
+ emit(snapshot: SourceSnapshot): void;
596
604
  }
597
- interface ReducerUIScenarioAuthority {
598
- readonly kind: "reducer";
599
- readonly referenceGame: unknown;
600
- readonly coverage: unknown;
601
- readonly bundle: unknown;
602
- readonly initialState: unknown;
603
- readonly viewer: unknown;
604
- readonly playerIds?: readonly string[];
605
- readonly operations: readonly unknown[];
606
- }
607
- type UIScenarioAuthority = ProtocolUIScenarioAuthority | ReducerUIScenarioAuthority;
608
- interface UIScenarioDefinition {
609
- readonly id: string;
610
- readonly title?: string;
611
- readonly contracts: readonly string[];
612
- readonly capabilities: readonly string[];
613
- readonly sourceFiles: readonly string[];
614
- readonly environment?: UIScenarioEnvironmentDefinition;
615
- readonly authority: UIScenarioAuthority;
616
- readonly replay: readonly UIScenarioReplayStep[];
617
- }
618
-
619
- declare function defineUIScenario<const TScenario extends UIScenarioDefinition>(scenario: TScenario): Readonly<TScenario>;
620
-
621
- type CanonicalJson = null | boolean | number | string | readonly CanonicalJson[] | {
622
- readonly [key: string]: CanonicalJson;
623
- };
624
- declare function isSha256Digest(value: string): boolean;
625
- declare function canonicalizeUIFixtureJson(value: unknown): CanonicalJson;
626
- declare function canonicalUIFixtureJson(value: unknown): string;
627
- declare function digestUIFixtureJson(value: unknown): string;
628
- declare function digestUIFixtureRequest(request: UIReplayRequest): string;
629
- declare function digestUIFixtureTransportRequest(request: {
630
- readonly operation: "validate" | "submit";
631
- readonly basis?: {
632
- readonly version: number;
633
- readonly actionSetVersion: string;
634
- readonly perspectivePlayerId: string;
635
- };
636
- readonly interactionId?: string;
637
- readonly payload?: unknown;
638
- }): string;
639
- declare function digestPluginProtocolTape(tape: PluginProtocolTape): string;
640
- declare function canonicalizeUIScenarioFixture(fixture: UIScenarioFixture): UIScenarioFixture;
641
- declare function serializeUIScenarioFixture(fixture: UIScenarioFixture): string;
642
- declare function digestUIScenarioFixture(fixture: UIScenarioFixture): string;
605
+ /** Test-owned transport control; all request/barrier behavior remains production code. */
606
+ declare function createTestSource(initial: SourceSnapshot): TestSource;
643
607
 
644
- interface FixtureHostEvent {
645
- readonly sequence: number;
646
- readonly atMs: number;
647
- readonly kind: "frame-sent" | "submit-received" | "ack-received" | "ready-received" | "diagnostic";
648
- readonly requestDigest?: string;
649
- readonly frameId?: string;
650
- readonly projectionDigest?: string;
651
- readonly result?: "accepted" | "rejected";
608
+ /** JSON round-trippable tooling checkpoint. Private state stays in testing. */
609
+ interface LocalCheckpoint {
610
+ readonly state: ReducerSessionState;
611
+ readonly terminal: GameOutcome | null;
652
612
  }
653
- interface FixtureHostHarness {
654
- readonly transport: PluginTransport;
655
- readonly tape: B;
656
- reset(): void;
657
- flush(): Promise<void>;
658
- advanceHost(): Promise<void>;
659
- getCurrentFrameId(): string;
660
- getEvents(): readonly FixtureHostEvent[];
661
- assertConsumed(): void;
613
+ interface LocalSource<Game> extends CommandSource, ApplySource<ScenarioCommandOf<Game>, Promise<SubmitResult>> {
614
+ switchSeat(playerId: string): void;
615
+ checkpoint(): LocalCheckpoint;
616
+ /** Parses untrusted checkpoint JSON before replacing state. */
617
+ restore(checkpoint: unknown): void;
618
+ inspect(): SourceSnapshot;
619
+ explore(options: {
620
+ maxEvaluations: number;
621
+ }): Promise<readonly ScenarioCommandOf<Game>[]>;
662
622
  }
663
- interface CreateFixtureHostHarnessOptions {
664
- readonly tape: B;
665
- readonly strict?: boolean;
666
- readonly latencyMs?: number;
667
- readonly channelId?: string;
668
- readonly onEvent?: (event: FixtureHostEvent) => void;
669
- readonly nowMs?: () => number;
670
- }
671
- declare function createFixtureHostHarness(options: CreateFixtureHostHarnessOptions): FixtureHostHarness;
672
623
 
673
- declare function FixturePluginRuntime({ harness, runtime, children, }: {
674
- harness: FixtureHostHarness;
675
- runtime?: PluginRuntimeClient;
676
- children: react__default.ReactNode;
677
- }): react_jsx_runtime.JSX.Element;
624
+ declare function localSource<const Game extends ScenarioDefinitionGameLike>(game: Game, options: {
625
+ players: number;
626
+ seed: number;
627
+ as?: string;
628
+ options?: OptionsOfContract<Game["contract"]>;
629
+ }): Promise<LocalSource<Game>>;
678
630
 
679
- interface CompilePluginProtocolTapeOptions {
680
- readonly trace: ReducerScenarioTrace;
681
- readonly session: E;
682
- }
683
- declare function compilePluginProtocolTape(options: CompilePluginProtocolTapeOptions): PluginProtocolTape;
631
+ declare function scenarioSource<const Game extends ScenarioDefinitionGameLike>(game: Game, scenario: ScenarioDefinition<Game>, options?: {
632
+ at?: ScenarioCheckpointSelector;
633
+ as?: string;
634
+ }): Promise<LocalSource<Game>>;
684
635
 
685
- interface FixtureEnvironmentInit {
686
- readonly clockIso: string;
687
- readonly randomSeed: string;
688
- readonly locale: "en-US";
689
- readonly timezone: "UTC";
690
- readonly reducedMotion: true;
691
- readonly network: "blocked";
636
+ interface FuzzResult<Game> {
637
+ readonly commands: readonly ScenarioCommandOf<Game>[];
638
+ readonly checkpoint: LocalCheckpoint;
639
+ readonly error?: Error;
692
640
  }
693
- declare const defaultFixtureEnvironmentInit: FixtureEnvironmentInit;
694
- type DeterministicIdFactory = () => string;
695
- declare function createDeterministicIdFactory(seed: string): DeterministicIdFactory;
696
- declare function fixtureEnvironmentInitFor(options: {
697
- readonly clockIso: string;
698
- readonly randomSeed: string;
699
- }): FixtureEnvironmentInit;
641
+ /** Deterministic testing choice RNG is independent from the game's authoritative RNG. */
642
+ declare function fuzz<const Game extends ScenarioDefinitionGameLike>(game: Game, options: {
643
+ seed: number;
644
+ steps: number;
645
+ players?: number;
646
+ maxEvaluations?: number;
647
+ }): Promise<FuzzResult<Game>>;
700
648
 
701
- interface CompileUIScenarioFixtureOptions {
649
+ type CandidateVerificationScenario<Game extends ScenarioDefinitionGameLike> = ScenarioDefinition<Game>;
650
+ type CandidateVerificationInput<Game extends ScenarioDefinitionGameLike> = {
651
+ /** The exact compiled production artifact under verification. */
652
+ readonly bundle: ReducerBundleContract;
653
+ /** Authored scenario schemas and inspection metadata; not execution authority. */
654
+ readonly reducer: Game;
655
+ readonly scenarios: Readonly<Record<string, CandidateVerificationScenario<Game>>> | readonly CandidateVerificationScenario<Game>[];
656
+ readonly maxScenarios?: number;
657
+ readonly maxStepsPerScenario?: number;
658
+ };
659
+ type CandidateVerificationReplayDiagnostic = {
660
+ readonly kind: "replay";
661
+ readonly message: string;
662
+ readonly scenarioId?: string;
663
+ readonly segment?: "given" | "when";
664
+ readonly index?: number;
665
+ readonly interactionId?: string;
666
+ readonly errorCode?: string;
667
+ readonly reducerMessage?: string;
668
+ readonly trace?: readonly DispatchTraceSummaryEntry[];
669
+ };
670
+ type CandidateVerificationAssertionDiagnostic = {
671
+ readonly kind: "assertion";
672
+ readonly message: string;
673
+ };
674
+ type CandidateVerificationLimitDiagnostic = {
675
+ readonly kind: "limit";
676
+ readonly message: string;
677
+ readonly actualSteps: number;
678
+ readonly maxStepsPerScenario: number;
679
+ };
680
+ type CandidateVerificationScenarioResult = {
702
681
  readonly id: string;
703
- readonly title: string;
704
- readonly gameId: string;
705
- readonly tags?: readonly string[];
706
- readonly source: UIScenarioFixture["source"];
707
- readonly viewer: UIScenarioFixture["viewer"];
708
- readonly environment: UIScenarioFixture["environment"];
709
- readonly protocol: PluginProtocolTape;
710
- readonly replay?: readonly UIScenarioReplayStep[];
711
- readonly expected?: Partial<UIScenarioFixture["expected"]>;
712
- }
713
- type UIReplayIdentityCandidate = UIResolvedReplayIdentity;
714
- declare function compileUIScenarioFixture(options: CompileUIScenarioFixtureOptions): UIScenarioFixture;
715
- declare function assertDeterministicUIScenarioFixture(first: UIScenarioFixture, second: UIScenarioFixture): void;
716
- declare function assertUniqueReplayIdentity(step: Pick<PortableSemanticReplayStep, "stepId" | "expectedIdentity">, candidates: readonly UIReplayIdentityCandidate[]): UIReplayIdentityCandidate;
717
- declare function assertUIStepExpectationSatisfied(stepId: string, expected: UIStepExpectation, actual: UIStepExpectation): void;
718
-
719
- type ReplayRequest = PortableSemanticReplayStep["resolve"];
720
- type DragTarget = Extract<PortableSemanticReplayStep["execute"], {
721
- kind: "drag";
722
- }>["target"];
723
- interface ReplayStepOptions {
724
- readonly stepId: string;
725
- readonly resolve: ReplayRequest;
726
- readonly expect: UIStepExpectation;
727
- readonly expectedIdentity?: UIResolvedReplayIdentity;
728
- }
729
- interface FillReplayStepOptions extends ReplayStepOptions {
730
- readonly value: string;
731
- }
732
- interface DragReplayStepOptions extends ReplayStepOptions {
733
- readonly target: DragTarget;
734
- }
735
- declare function activate(options: ReplayStepOptions): UIScenarioReplayStep;
736
- declare function fill(options: FillReplayStepOptions): UIScenarioReplayStep;
737
- declare function press(options: ReplayStepOptions): UIScenarioReplayStep;
738
- declare function drag(options: DragReplayStepOptions): UIScenarioReplayStep;
739
- declare function submit(options: ReplayStepOptions): UIScenarioReplayStep;
740
- declare function assertStep(stepId: string, expect: UIStepExpectation): UIScenarioReplayStep;
682
+ readonly status: "passed" | "failed";
683
+ readonly diagnostic?: CandidateVerificationReplayDiagnostic | CandidateVerificationAssertionDiagnostic | CandidateVerificationLimitDiagnostic;
684
+ };
685
+ type CandidateVerificationResult = {
686
+ readonly status: "passed" | "failed";
687
+ readonly scenarioSummary: {
688
+ readonly total: number;
689
+ readonly passed: number;
690
+ readonly failed: number;
691
+ readonly scenarios: readonly CandidateVerificationScenarioResult[];
692
+ };
693
+ };
694
+ declare function runCandidateVerification<const Game extends ScenarioDefinitionGameLike>(input: CandidateVerificationInput<Game>): Promise<CandidateVerificationResult>;
741
695
 
742
- export { ActorRef, type CompilePluginProtocolTapeOptions, type CompileUIScenarioFixtureOptions, type CreateFixtureHostHarnessOptions, type CreateReducerScenarioRunnerOptions, type DeterministicIdFactory, ExpectFn, type ExploreScenarioOptions, type ExploreScenarioResult, type ExploreSeedResult, type ExploreTransitionResult, type FixtureEnvironmentInit, type FixtureHostEvent, type FixtureHostHarness, FixturePluginRuntime, FlowDiagnostic, InspectEntropy, InspectNode, type InspectScenarioOptions, InspectScenarioResult, PerspectiveRef, PerspectiveSelector, type PluginProtocolTape, type PortableSemanticReplayStep, type ProtocolUIScenarioAuthority, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type ReducerUIScenarioAuthority, ScenarioAssertionError, ScenarioCheckpoint, ScenarioCommand, ScenarioDispatchTraceEntry, ScenarioIdentity, ScenarioReplayDefinition, Sha256Digest, SnapshotMatcherHandler, type UIFixtureFrame, type UIFixtureProtocolStep, type UIReplayExecution, type UIReplayIdentityCandidate, type UIReplayRequest, type UIResolvedReplayIdentity, type UIScenarioAuthority, type UIScenarioAuthorityKind, type UIScenarioDefinition, type UIScenarioEnvironmentDefinition, type UIScenarioFixture, type UIScenarioFixtureBundleIndex, type UIScenarioReplayStep, type UIStepExpectation, UI_SCENARIO_FIXTURE_BUNDLE_SCHEMA_VERSION, UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL, UI_SCENARIO_FIXTURE_SCHEMA_VERSION, UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR, activate, assertDeterministicUIScenarioFixture, assertStep, assertSupportedBrowserInteractionProtocol, assertUIStepExpectationSatisfied, assertUniqueReplayIdentity, canonicalUIFixtureJson, canonicalizeUIFixtureJson, canonicalizeUIScenarioFixture, compilePluginProtocolTape, compileUIScenarioFixture, createDeterministicIdFactory, createExpectApi, createFixtureHostHarness, createReducerScenarioRunner, defaultFixtureEnvironmentInit, defineUIScenario, digestPluginProtocolTape, digestUIFixtureJson, digestUIFixtureRequest, digestUIFixtureTransportRequest, digestUIScenarioFixture, drag, exploreScenario, fill, fixtureEnvironmentInitFor, inspectScenario, isSha256Digest, parseUIScenarioFixture, parseUIScenarioFixtureBundleIndex, pluginProtocolTapeSchema, portableSemanticReplayStepSchema, press, serializeUIScenarioFixture, submit, uiFixtureFrameSchema, uiFixtureProtocolStepSchema, uiReplayExecutionSchema, uiReplayRequestSchema, uiResolvedReplayIdentitySchema, uiScenarioFixtureBundleIndexSchema, uiScenarioFixtureSchema, uiScenarioReplayStepSchema, uiStepExpectationSchema };
696
+ export { type ActorRef, type AssertScenarioOptions, type CandidateVerificationAssertionDiagnostic, type CandidateVerificationInput, type CandidateVerificationLimitDiagnostic, type CandidateVerificationReplayDiagnostic, type CandidateVerificationResult, type CandidateVerificationScenario, type CandidateVerificationScenarioResult, type CapturedSubmission, type CreateReducerScenarioRunnerOptions, type ExpectFn, type ExpectMatchers, type ExploreScenarioOptions, type ExploreScenarioResult, type ExploreSeedResult, type ExploreTransitionResult, type FlowDiagnostic, type FuzzResult, type InspectAction, type InspectEntropy, type InspectInteraction, type InspectInteractionInput, type InspectNode, type InspectScenarioOptions, type InspectScenarioResult, type InteractionAvailabilityLike, type InteractionDescriptorLike, type InteractionExplanationLike, type LocalCheckpoint, type LocalSource, type PerspectiveRef, type PerspectiveSelector, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type RejectionExpectation, type ReplayScenarioOptions, type RuntimeParamsOfScenarioCommand, type ScenarioActor, type ScenarioAssertionContext, ScenarioAssertionError, type ScenarioAuthoring, type ScenarioCheckpoint, type ScenarioCheckpointId, type ScenarioCheckpointSelector, type ScenarioCommand, type ScenarioCommandOf, type ScenarioCommandTraceEntry, type ScenarioDefinition, type ScenarioDefinitionValidationCode, ScenarioDefinitionValidationError, type ScenarioDiagnostics, type ScenarioDispatchTraceEntry, type ScenarioFlowDiagnostics, type ScenarioIdentity, type ScenarioProbeAccepted, type ScenarioProbeRejected, type ScenarioProbeResult, type ScenarioReplay, type ScenarioReplayDefinition, ScenarioReplayError, type ScenarioReplayErrorOptions, type ScenarioReplaySegment, type ScenarioRuntimeCheckpointMaterialization, type ScenarioSchemaOutput, type ScenarioSeatRef, type ScenarioSetup, type Sha256Digest, type SnapshotMatcherHandler, type TestSource, assertScenario, createExpectApi, createReducerScenarioRunner, createScenarioAuthoring, createTestSource, exploreScenario, fuzz, inspectScenario, localSource, materializeScenarioRuntimeCheckpoint, probeScenarioCommand, replayScenario, resolveScenarioCheckpoint, runCandidateVerification, scenarioSource, toScenarioReplayDefinition };