@dreamboard-games/sdk 0.4.0-alpha.1 → 0.4.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REFERENCE.md +1215 -125
- package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BuiNstXs.d.ts} +5 -1
- package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-B1sIoBlX.d.ts} +1 -1
- package/dist/{attributes-BrZtP9az.d.ts → attributes-DbvyMbXw.d.ts} +17 -2
- package/dist/authoring/index.d.ts +66 -0
- package/dist/authoring/index.js +560 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/browser-interaction.d.ts +205 -5
- package/dist/browser-interaction.js +14 -2
- package/dist/{chunk-7W6TQO3X.js → chunk-45FI6XII.js} +613 -366
- package/dist/chunk-45FI6XII.js.map +1 -0
- package/dist/{chunk-3K362ZKR.js → chunk-6JQFGSLD.js} +202 -38
- package/dist/chunk-6JQFGSLD.js.map +1 -0
- package/dist/{chunk-XXBSIPJX.js → chunk-CP35NPPY.js} +131 -59
- package/dist/chunk-CP35NPPY.js.map +1 -0
- package/dist/{chunk-XJYUSD5F.js → chunk-FWVV2X74.js} +2 -2
- package/dist/{chunk-IUGKW2GS.js → chunk-HWJS3VOJ.js} +6 -2
- package/dist/chunk-HWJS3VOJ.js.map +1 -0
- package/dist/chunk-K5ZRJTZZ.js +328 -0
- package/dist/chunk-K5ZRJTZZ.js.map +1 -0
- package/dist/{chunk-7LZZEI25.js → chunk-N6ZDIMRB.js} +1 -1
- package/dist/chunk-N6ZDIMRB.js.map +1 -0
- package/dist/chunk-O6M6PN4E.js +1225 -0
- package/dist/chunk-O6M6PN4E.js.map +1 -0
- package/dist/{chunk-AEUXCFGM.js → chunk-PF7L4BMG.js} +1 -8
- package/dist/{chunk-AEUXCFGM.js.map → chunk-PF7L4BMG.js.map} +1 -1
- package/dist/{chunk-CZMFAS3E.js → chunk-WOWFONLZ.js} +517 -1274
- package/dist/chunk-WOWFONLZ.js.map +1 -0
- package/dist/{chunk-MALRKLRR.js → chunk-WUIVY2KE.js} +301 -12
- package/dist/chunk-WUIVY2KE.js.map +1 -0
- package/dist/chunk-ZAS2SENW.js +12 -0
- package/dist/chunk-ZAS2SENW.js.map +1 -0
- package/dist/codegen.d.ts +11 -3
- package/dist/codegen.js +1 -1
- package/dist/{components-Dqr_LuZJ.d.ts → components-BbWPnZCF.d.ts} +37 -6
- package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-Kz9Q_zsv.d.ts} +1 -1
- package/dist/index.js +2 -1
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -1
- package/dist/player-state-Cqpyeql0.d.ts +371 -0
- package/dist/protocol-BP193lva.d.ts +267 -0
- package/dist/reducer/advanced.js +1 -1
- package/dist/reducer-contract.js +1 -1
- package/dist/reducer.js +2 -2
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +10 -10
- package/dist/runtime/primitives.js +9 -7
- package/dist/runtime/runtime-api.d.ts +2 -2
- package/dist/runtime/workspace-contract.d.ts +23 -12
- package/dist/runtime/workspace-contract.js +7 -6
- package/dist/runtime-api-BJharVaj.d.ts +198 -0
- package/dist/runtime-api-C6aWo9c0.d.ts +95 -0
- package/dist/runtime.d.ts +35 -31
- package/dist/runtime.js +87 -797
- package/dist/runtime.js.map +1 -1
- package/dist/testing.d.ts +254 -140
- package/dist/testing.js +964 -149
- package/dist/testing.js.map +1 -1
- package/dist/types-CYeN0wLK.d.ts +29 -0
- package/dist/{types-BqzHkNMA.d.ts → types-DJj5MJkl.d.ts} +32 -5
- package/dist/types.d.ts +13 -8
- package/dist/ui/components.d.ts +4 -5
- package/dist/ui/components.js +19 -1
- package/dist/ui/player-state.d.ts +2 -365
- package/dist/{ui-contract-W2-kxObe.d.ts → ui-contract-CY7cxsCC.d.ts} +16 -26
- package/dist/ui.d.ts +7 -8
- package/dist/ui.js +20 -2
- package/package.json +25 -19
- package/dist/chunk-3K362ZKR.js.map +0 -1
- package/dist/chunk-7LZZEI25.js.map +0 -1
- package/dist/chunk-7W6TQO3X.js.map +0 -1
- package/dist/chunk-CZMFAS3E.js.map +0 -1
- package/dist/chunk-IUGKW2GS.js.map +0 -1
- package/dist/chunk-MALRKLRR.js.map +0 -1
- package/dist/chunk-XXBSIPJX.js.map +0 -1
- package/dist/hex-color-MhOyuY-o.d.ts +0 -8
- package/dist/runtime-api-BXd70c2e.d.ts +0 -490
- /package/dist/{chunk-XJYUSD5F.js.map → chunk-FWVV2X74.js.map} +0 -0
package/dist/testing.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { R as ReducerDiagnosticEvent, D as DispatchTraceSummaryEntry } from './stale-contract-artifact-error-BelRiIDR.js';
|
|
2
2
|
export { S as StaleContractArtifactError, b as StaleContractArtifactErrorOptions, c as StaleContractArtifactKind, i as isStaleContractArtifactError } from './stale-contract-artifact-error-BelRiIDR.js';
|
|
3
3
|
import { w as wire, a as ReducerBundleContract } from './index.d-BL3bT5lt.js';
|
|
4
|
-
import {
|
|
4
|
+
import { o, v, u, s, t } from './protocol-BP193lva.js';
|
|
5
|
+
import { R as RuntimeAPI, V as ValidationResult } from './runtime-api-C6aWo9c0.js';
|
|
5
6
|
import { R as RuntimeJson } from './runtime-json-CQ9QbLZ5.js';
|
|
6
7
|
import { z } from 'zod';
|
|
7
|
-
import { r as BrowserInteractionIntentRequest, l as BrowserInteractionEffectRequest } from './types-
|
|
8
|
-
import './
|
|
8
|
+
import { r as BrowserInteractionIntentRequest, l as BrowserInteractionEffectRequest } from './types-DJj5MJkl.js';
|
|
9
|
+
import { b as PluginTransport, P as PluginRuntimeClient } from './types-CYeN0wLK.js';
|
|
10
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
|
+
import react__default from 'react';
|
|
9
12
|
|
|
10
13
|
type TestRunner = "reducer" | "remote" | "browser";
|
|
11
14
|
type InteractionDescriptorLike = {
|
|
@@ -137,17 +140,6 @@ type CreateExpectApiOptions = {
|
|
|
137
140
|
};
|
|
138
141
|
declare function createExpectApi(options?: CreateExpectApiOptions): ExpectFn;
|
|
139
142
|
|
|
140
|
-
type GameView = Record<string, unknown>;
|
|
141
|
-
|
|
142
|
-
type PhaseName = string;
|
|
143
|
-
|
|
144
|
-
type StageName = string;
|
|
145
|
-
type InteractionId = string;
|
|
146
|
-
type GameplaySnapshot = GameplaySnapshot$1<PhaseName, StageName, InteractionId>;
|
|
147
|
-
type PluginStateSnapshot = Omit<PluginStateSnapshot$1<GameView, PhaseName, StageName, InteractionId>, "gameplay"> & {
|
|
148
|
-
gameplay: GameplaySnapshot;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
143
|
type ReducerBundleLike = Pick<ReducerBundleContract, "projectSeatsDynamic" | "validateInput" | "dispatch"> & {
|
|
152
144
|
explainInteraction?: (input: {
|
|
153
145
|
state: wire.ReducerSessionState;
|
|
@@ -179,12 +171,9 @@ type CreateTestRuntimeOptions = {
|
|
|
179
171
|
expectedBaseStateFingerprint?: string;
|
|
180
172
|
};
|
|
181
173
|
type CreatedTestRuntime = {
|
|
182
|
-
runtime: RuntimeAPI
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
_subscribeToSessionState(listener: (state: PluginSessionState) => void): () => void;
|
|
186
|
-
};
|
|
187
|
-
getSnapshot(): PluginStateSnapshot;
|
|
174
|
+
runtime: RuntimeAPI;
|
|
175
|
+
getFrame(): o;
|
|
176
|
+
getSessionDescriptor(): v;
|
|
188
177
|
players(): readonly string[];
|
|
189
178
|
seat(index: number): string;
|
|
190
179
|
submit(playerId: string, interactionId: string, params?: unknown): Promise<void>;
|
|
@@ -198,79 +187,114 @@ type CreatedTestRuntime = {
|
|
|
198
187
|
} | null;
|
|
199
188
|
clear(): void;
|
|
200
189
|
};
|
|
201
|
-
setControllingPlayer(playerId: string): void;
|
|
202
190
|
};
|
|
203
191
|
declare function createTestRuntime(options: CreateTestRuntimeOptions): CreatedTestRuntime;
|
|
204
192
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
193
|
+
type ReducerScenarioBundle = Pick<ReducerBundleContract, "projectSeatsDynamic" | "validateInput" | "dispatch" | "projectStatic">;
|
|
194
|
+
interface ReducerScenarioViewer {
|
|
195
|
+
readonly seatId: string;
|
|
196
|
+
readonly playerId: string;
|
|
197
|
+
}
|
|
198
|
+
interface ReducerScenarioFrame {
|
|
199
|
+
readonly id: string;
|
|
200
|
+
readonly reducerState: wire.ReducerSessionState;
|
|
201
|
+
readonly dynamicProjection: wire.SeatProjectionBundle;
|
|
202
|
+
readonly staticProjection?: wire.BoardStaticProjection | null;
|
|
203
|
+
readonly gameVersion: number;
|
|
204
|
+
readonly actionSetVersion: string;
|
|
205
|
+
readonly projectionDigest: string;
|
|
206
|
+
}
|
|
207
|
+
interface ReducerScenarioTrace {
|
|
208
|
+
readonly scenarioId: string;
|
|
209
|
+
readonly gameId: string;
|
|
210
|
+
readonly viewer: ReducerScenarioViewer;
|
|
211
|
+
readonly frames: readonly ReducerScenarioFrame[];
|
|
212
|
+
readonly exchanges: readonly ReducerScenarioExchange[];
|
|
213
|
+
}
|
|
214
|
+
type ReducerScenarioExchange = {
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly operation: "validate";
|
|
217
|
+
readonly fromFrameId: string;
|
|
218
|
+
readonly input: wire.GameInput;
|
|
219
|
+
readonly result: wire.ReducerInputValidationResult;
|
|
220
|
+
} | {
|
|
221
|
+
readonly id: string;
|
|
222
|
+
readonly operation: "submit";
|
|
223
|
+
readonly fromFrameId: string;
|
|
224
|
+
readonly input: wire.GameInput;
|
|
225
|
+
readonly result: {
|
|
226
|
+
readonly kind: "accepted";
|
|
227
|
+
readonly toFrameId: string;
|
|
228
|
+
} | {
|
|
229
|
+
readonly kind: "rejected";
|
|
230
|
+
readonly diagnostics: readonly ReducerScenarioDiagnostic[];
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
interface ReducerScenarioDiagnostic {
|
|
234
|
+
readonly code: string;
|
|
235
|
+
readonly message: string;
|
|
236
|
+
}
|
|
237
|
+
type ReducerScenarioOperation = {
|
|
238
|
+
readonly id: string;
|
|
239
|
+
readonly operation: "validate";
|
|
240
|
+
readonly input: wire.GameInput;
|
|
241
|
+
} | {
|
|
242
|
+
readonly id: string;
|
|
243
|
+
readonly operation: "submit";
|
|
244
|
+
readonly input: wire.GameInput;
|
|
245
|
+
};
|
|
246
|
+
interface CreateReducerScenarioRunnerOptions {
|
|
247
|
+
readonly scenarioId: string;
|
|
248
|
+
readonly gameId: string;
|
|
249
|
+
readonly initialState: wire.ReducerSessionState;
|
|
250
|
+
readonly bundle: ReducerScenarioBundle;
|
|
251
|
+
readonly viewer: ReducerScenarioViewer;
|
|
252
|
+
readonly playerIds: readonly string[];
|
|
253
|
+
readonly initialGameVersion?: number;
|
|
254
|
+
}
|
|
255
|
+
interface ReducerScenarioRunner {
|
|
256
|
+
run(operations: readonly ReducerScenarioOperation[]): Promise<ReducerScenarioTrace>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
declare function createReducerScenarioRunner(options: CreateReducerScenarioRunnerOptions): ReducerScenarioRunner;
|
|
260
|
+
|
|
261
|
+
declare const UI_SCENARIO_FIXTURE_SCHEMA_VERSION = 2;
|
|
262
|
+
declare const UI_SCENARIO_FIXTURE_BUNDLE_SCHEMA_VERSION = 2;
|
|
263
|
+
declare const UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR = 3;
|
|
264
|
+
declare const UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL: 3;
|
|
229
265
|
declare const uiFixtureFrameSchema: z.ZodObject<{
|
|
230
266
|
id: z.ZodString;
|
|
231
|
-
|
|
232
|
-
view: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
233
|
-
gameplay: z.ZodObject<{
|
|
234
|
-
currentPhase: z.ZodNullable<z.ZodString>;
|
|
235
|
-
currentStage: z.ZodNullable<z.ZodString>;
|
|
236
|
-
activePlayers: z.ZodArray<z.ZodString>;
|
|
237
|
-
simultaneousPhase: z.ZodOptional<z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
238
|
-
availableInteractions: z.ZodArray<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
239
|
-
zones: z.ZodRecord<z.ZodString, z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
240
|
-
}, z.core.$catchall<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
241
|
-
lobby: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
242
|
-
notifications: z.ZodArray<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
243
|
-
session: z.ZodObject<{
|
|
244
|
-
sessionId: z.ZodString;
|
|
245
|
-
controllablePlayerIds: z.ZodArray<z.ZodString>;
|
|
246
|
-
controllingPlayerId: z.ZodNullable<z.ZodString>;
|
|
247
|
-
userId: z.ZodNullable<z.ZodString>;
|
|
248
|
-
}, z.core.$catchall<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
249
|
-
history: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
250
|
-
syncId: z.ZodNumber;
|
|
251
|
-
}, z.core.$strict>;
|
|
267
|
+
frame: z.ZodType<o<unknown, string, string, string>, unknown, z.core.$ZodTypeInternals<o<unknown, string, string, string>, unknown>>;
|
|
252
268
|
projectionDigest: z.ZodString;
|
|
253
269
|
}, z.core.$strict>;
|
|
254
|
-
declare const
|
|
270
|
+
declare const uiFixtureProtocolStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
kind: z.ZodLiteral<"host.frame">;
|
|
273
|
+
frameId: z.ZodString;
|
|
274
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
255
275
|
id: z.ZodString;
|
|
276
|
+
kind: z.ZodLiteral<"client.validate">;
|
|
256
277
|
fromFrameId: z.ZodString;
|
|
257
|
-
operation: z.ZodEnum<{
|
|
258
|
-
validate: "validate";
|
|
259
|
-
submit: "submit";
|
|
260
|
-
refresh: "refresh";
|
|
261
|
-
}>;
|
|
262
278
|
requestDigest: z.ZodString;
|
|
263
|
-
response: z.
|
|
264
|
-
|
|
265
|
-
|
|
279
|
+
response: z.ZodObject<{
|
|
280
|
+
valid: z.ZodBoolean;
|
|
281
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
282
|
+
message: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strict>;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
kind: z.ZodLiteral<"client.submit">;
|
|
287
|
+
fromFrameId: z.ZodString;
|
|
288
|
+
requestDigest: z.ZodString;
|
|
289
|
+
response: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
290
|
+
accepted: z.ZodLiteral<true>;
|
|
266
291
|
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}, z.core.$strict>;
|
|
292
|
+
accepted: z.ZodLiteral<false>;
|
|
293
|
+
errorCode: z.ZodString;
|
|
294
|
+
message: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, z.core.$strict>], "accepted">;
|
|
296
|
+
}, z.core.$strict>], "kind">;
|
|
297
|
+
declare const pluginProtocolTapeSchema: z.ZodType<u, unknown, z.core.$ZodTypeInternals<u, unknown>>;
|
|
274
298
|
declare const uiReplayRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
275
299
|
surface: z.ZodString;
|
|
276
300
|
scopeId: z.ZodOptional<z.ZodString>;
|
|
@@ -481,8 +505,9 @@ declare const uiScenarioReplayStepSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
481
505
|
}, z.core.$strict>;
|
|
482
506
|
}, z.core.$strict>]>;
|
|
483
507
|
declare const uiScenarioFixtureSchema: z.ZodObject<{
|
|
484
|
-
schemaVersion: z.ZodLiteral<
|
|
485
|
-
browserInteractionProtocol: z.ZodLiteral<"
|
|
508
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
509
|
+
browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
|
|
510
|
+
pluginRuntimeProtocol: z.ZodLiteral<3>;
|
|
486
511
|
id: z.ZodString;
|
|
487
512
|
title: z.ZodString;
|
|
488
513
|
gameId: z.ZodString;
|
|
@@ -511,51 +536,7 @@ declare const uiScenarioFixtureSchema: z.ZodObject<{
|
|
|
511
536
|
phone: "phone";
|
|
512
537
|
}>>;
|
|
513
538
|
}, z.core.$strict>;
|
|
514
|
-
|
|
515
|
-
id: z.ZodString;
|
|
516
|
-
snapshot: z.ZodObject<{
|
|
517
|
-
view: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
518
|
-
gameplay: z.ZodObject<{
|
|
519
|
-
currentPhase: z.ZodNullable<z.ZodString>;
|
|
520
|
-
currentStage: z.ZodNullable<z.ZodString>;
|
|
521
|
-
activePlayers: z.ZodArray<z.ZodString>;
|
|
522
|
-
simultaneousPhase: z.ZodOptional<z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
523
|
-
availableInteractions: z.ZodArray<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
524
|
-
zones: z.ZodRecord<z.ZodString, z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
525
|
-
}, z.core.$catchall<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
526
|
-
lobby: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
527
|
-
notifications: z.ZodArray<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
528
|
-
session: z.ZodObject<{
|
|
529
|
-
sessionId: z.ZodString;
|
|
530
|
-
controllablePlayerIds: z.ZodArray<z.ZodString>;
|
|
531
|
-
controllingPlayerId: z.ZodNullable<z.ZodString>;
|
|
532
|
-
userId: z.ZodNullable<z.ZodString>;
|
|
533
|
-
}, z.core.$catchall<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>;
|
|
534
|
-
history: z.ZodNullable<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
|
|
535
|
-
syncId: z.ZodNumber;
|
|
536
|
-
}, z.core.$strict>;
|
|
537
|
-
projectionDigest: z.ZodString;
|
|
538
|
-
}, z.core.$strict>>;
|
|
539
|
-
transport: z.ZodArray<z.ZodObject<{
|
|
540
|
-
id: z.ZodString;
|
|
541
|
-
fromFrameId: z.ZodString;
|
|
542
|
-
operation: z.ZodEnum<{
|
|
543
|
-
validate: "validate";
|
|
544
|
-
submit: "submit";
|
|
545
|
-
refresh: "refresh";
|
|
546
|
-
}>;
|
|
547
|
-
requestDigest: z.ZodString;
|
|
548
|
-
response: z.ZodUnion<readonly [z.ZodObject<{
|
|
549
|
-
kind: z.ZodLiteral<"accepted">;
|
|
550
|
-
nextFrameId: z.ZodString;
|
|
551
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
552
|
-
kind: z.ZodLiteral<"rejected">;
|
|
553
|
-
diagnostics: z.ZodArray<z.ZodObject<{
|
|
554
|
-
code: z.ZodString;
|
|
555
|
-
message: z.ZodString;
|
|
556
|
-
}, z.core.$strict>>;
|
|
557
|
-
}, z.core.$strict>]>;
|
|
558
|
-
}, z.core.$strict>>;
|
|
539
|
+
protocol: z.ZodType<u, unknown, z.core.$ZodTypeInternals<u, unknown>>;
|
|
559
540
|
replay: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
560
541
|
stepId: z.ZodString;
|
|
561
542
|
requestDigest: z.ZodString;
|
|
@@ -643,10 +624,11 @@ declare const uiScenarioFixtureSchema: z.ZodObject<{
|
|
|
643
624
|
}, z.core.$strict>;
|
|
644
625
|
}, z.core.$strict>;
|
|
645
626
|
declare const uiScenarioFixtureBundleIndexSchema: z.ZodObject<{
|
|
646
|
-
schemaVersion: z.ZodLiteral<
|
|
627
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
647
628
|
bundleId: z.ZodString;
|
|
648
629
|
sdkCommit: z.ZodString;
|
|
649
|
-
|
|
630
|
+
pluginRuntimeProtocol: z.ZodLiteral<3>;
|
|
631
|
+
browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
|
|
650
632
|
fixtures: z.ZodArray<z.ZodObject<{
|
|
651
633
|
id: z.ZodString;
|
|
652
634
|
file: z.ZodString;
|
|
@@ -663,12 +645,11 @@ type UIStepExpectation = z.infer<typeof uiStepExpectationSchema>;
|
|
|
663
645
|
type UIResolvedReplayIdentity = z.infer<typeof uiResolvedReplayIdentitySchema>;
|
|
664
646
|
type PortableSemanticReplayStep = z.infer<typeof portableSemanticReplayStepSchema>;
|
|
665
647
|
type UIScenarioReplayStep = z.infer<typeof uiScenarioReplayStepSchema>;
|
|
666
|
-
type UIFixtureFrame =
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
type
|
|
670
|
-
|
|
671
|
-
readonly frames: readonly UIFixtureFrame[];
|
|
648
|
+
type UIFixtureFrame = s;
|
|
649
|
+
type UIFixtureProtocolStep = t;
|
|
650
|
+
type PluginProtocolTape = u;
|
|
651
|
+
type UIScenarioFixture = Omit<z.infer<typeof uiScenarioFixtureSchema>, "protocol" | "replay"> & {
|
|
652
|
+
readonly protocol: PluginProtocolTape;
|
|
672
653
|
readonly replay: readonly UIScenarioReplayStep[];
|
|
673
654
|
};
|
|
674
655
|
type UIScenarioFixtureBundleIndex = z.infer<typeof uiScenarioFixtureBundleIndexSchema>;
|
|
@@ -684,10 +665,144 @@ declare function canonicalizeUIFixtureJson(value: unknown): CanonicalJson;
|
|
|
684
665
|
declare function canonicalUIFixtureJson(value: unknown): string;
|
|
685
666
|
declare function digestUIFixtureJson(value: unknown): string;
|
|
686
667
|
declare function digestUIFixtureRequest(request: UIReplayRequest): string;
|
|
668
|
+
declare function digestUIFixtureTransportRequest(request: {
|
|
669
|
+
readonly operation: "validate" | "submit";
|
|
670
|
+
readonly basis?: {
|
|
671
|
+
readonly gameVersion: number;
|
|
672
|
+
readonly actionSetVersion: string;
|
|
673
|
+
readonly perspectivePlayerId: string | null;
|
|
674
|
+
};
|
|
675
|
+
readonly interactionId?: string;
|
|
676
|
+
readonly payload?: unknown;
|
|
677
|
+
}): string;
|
|
678
|
+
declare function digestPluginProtocolTape(tape: PluginProtocolTape): string;
|
|
687
679
|
declare function canonicalizeUIScenarioFixture(fixture: UIScenarioFixture): UIScenarioFixture;
|
|
688
680
|
declare function serializeUIScenarioFixture(fixture: UIScenarioFixture): string;
|
|
689
681
|
declare function digestUIScenarioFixture(fixture: UIScenarioFixture): string;
|
|
690
682
|
|
|
683
|
+
interface UIParityViewport {
|
|
684
|
+
readonly width: number;
|
|
685
|
+
readonly height: number;
|
|
686
|
+
}
|
|
687
|
+
interface UIParityObservationEnvironmentV1 {
|
|
688
|
+
readonly project: string;
|
|
689
|
+
readonly viewport: UIParityViewport;
|
|
690
|
+
}
|
|
691
|
+
interface UIParityDiagnosticV1 {
|
|
692
|
+
readonly code: string;
|
|
693
|
+
readonly message: string;
|
|
694
|
+
}
|
|
695
|
+
interface UIParityObservationCheckpointV1 {
|
|
696
|
+
readonly stepId: string;
|
|
697
|
+
readonly interactionKey?: string;
|
|
698
|
+
readonly interactionId?: string;
|
|
699
|
+
readonly actuatorId?: string;
|
|
700
|
+
readonly descriptorDigest?: string;
|
|
701
|
+
readonly draftDigest?: string;
|
|
702
|
+
readonly gameVersion: number;
|
|
703
|
+
readonly actionSetVersion: string;
|
|
704
|
+
readonly perspectivePlayerId: string | null;
|
|
705
|
+
readonly projectionDigest: string;
|
|
706
|
+
readonly semanticDigest: string;
|
|
707
|
+
readonly submissionDigest?: string;
|
|
708
|
+
readonly screenshot?: string;
|
|
709
|
+
}
|
|
710
|
+
interface UIParityObservationV1 {
|
|
711
|
+
readonly schemaVersion: 1;
|
|
712
|
+
readonly scenarioId: string;
|
|
713
|
+
readonly fixtureDigest: string;
|
|
714
|
+
readonly sdkCandidateDigest: string;
|
|
715
|
+
readonly pluginRuntimeProtocol: 3;
|
|
716
|
+
readonly browserInteractionProtocol: string;
|
|
717
|
+
readonly environment: UIParityObservationEnvironmentV1;
|
|
718
|
+
readonly checkpoints: readonly UIParityObservationCheckpointV1[];
|
|
719
|
+
readonly diagnostics: readonly UIParityDiagnosticV1[];
|
|
720
|
+
}
|
|
721
|
+
type UIParityFailureCode = "candidate-mismatch" | "fixture-source-mismatch" | "protocol-mismatch" | "interaction-resolution-mismatch" | "preparation-mismatch" | "draft-mismatch" | "submission-mismatch" | "projection-mismatch" | "semantic-snapshot-mismatch" | "visual-mismatch" | "host-setup-failure";
|
|
722
|
+
interface UIParityComparisonFailure {
|
|
723
|
+
readonly code: UIParityFailureCode;
|
|
724
|
+
readonly message: string;
|
|
725
|
+
readonly path: string;
|
|
726
|
+
readonly expected: unknown;
|
|
727
|
+
readonly actual: unknown;
|
|
728
|
+
readonly checkpointIndex?: number;
|
|
729
|
+
readonly stepId?: string;
|
|
730
|
+
}
|
|
731
|
+
type UIParityComparisonResult = {
|
|
732
|
+
readonly ok: true;
|
|
733
|
+
} | {
|
|
734
|
+
readonly ok: false;
|
|
735
|
+
readonly failure: UIParityComparisonFailure;
|
|
736
|
+
};
|
|
737
|
+
interface CreateUIParityObservationFromFixtureOptions {
|
|
738
|
+
readonly fixture: UIScenarioFixture;
|
|
739
|
+
readonly sdkCandidateDigest: string;
|
|
740
|
+
readonly environment: UIParityObservationEnvironmentV1;
|
|
741
|
+
readonly fixtureDigest?: string;
|
|
742
|
+
readonly screenshotsByStepId?: Readonly<Record<string, string>>;
|
|
743
|
+
readonly diagnostics?: readonly UIParityDiagnosticV1[];
|
|
744
|
+
}
|
|
745
|
+
declare function createUIParityObservationFromFixture({ fixture, sdkCandidateDigest, environment, fixtureDigest, screenshotsByStepId, diagnostics, }: CreateUIParityObservationFromFixtureOptions): UIParityObservationV1;
|
|
746
|
+
declare function parseUIParityObservationV1(value: unknown): UIParityObservationV1;
|
|
747
|
+
declare function compareUIParityObservations(expected: UIParityObservationV1, actual: UIParityObservationV1): UIParityComparisonResult;
|
|
748
|
+
|
|
749
|
+
interface FixtureHostEvent {
|
|
750
|
+
readonly sequence: number;
|
|
751
|
+
readonly atMs: number;
|
|
752
|
+
readonly kind: "frame-sent" | "validate-received" | "submit-received" | "ack-received" | "ready-received" | "diagnostic";
|
|
753
|
+
readonly requestDigest?: string;
|
|
754
|
+
readonly frameId?: string;
|
|
755
|
+
readonly projectionDigest?: string;
|
|
756
|
+
readonly result?: "accepted" | "rejected";
|
|
757
|
+
}
|
|
758
|
+
interface FixtureHostHarness {
|
|
759
|
+
readonly transport: PluginTransport;
|
|
760
|
+
readonly tape: u;
|
|
761
|
+
reset(): void;
|
|
762
|
+
flush(): Promise<void>;
|
|
763
|
+
advanceHost(): Promise<void>;
|
|
764
|
+
getCurrentFrameId(): string;
|
|
765
|
+
getEvents(): readonly FixtureHostEvent[];
|
|
766
|
+
assertConsumed(): void;
|
|
767
|
+
}
|
|
768
|
+
interface CreateFixtureHostHarnessOptions {
|
|
769
|
+
readonly tape: u;
|
|
770
|
+
readonly strict?: boolean;
|
|
771
|
+
readonly latencyMs?: number;
|
|
772
|
+
readonly channelId?: string;
|
|
773
|
+
readonly onEvent?: (event: FixtureHostEvent) => void;
|
|
774
|
+
readonly nowMs?: () => number;
|
|
775
|
+
}
|
|
776
|
+
declare function createFixtureHostHarness(options: CreateFixtureHostHarnessOptions): FixtureHostHarness;
|
|
777
|
+
|
|
778
|
+
declare function FixturePluginRuntime({ harness, runtime, children, }: {
|
|
779
|
+
harness: FixtureHostHarness;
|
|
780
|
+
runtime?: PluginRuntimeClient;
|
|
781
|
+
children: react__default.ReactNode;
|
|
782
|
+
}): react_jsx_runtime.JSX.Element;
|
|
783
|
+
|
|
784
|
+
interface CompilePluginProtocolTapeOptions {
|
|
785
|
+
readonly trace: ReducerScenarioTrace;
|
|
786
|
+
readonly session: v;
|
|
787
|
+
}
|
|
788
|
+
declare function compilePluginProtocolTape(options: CompilePluginProtocolTapeOptions): PluginProtocolTape;
|
|
789
|
+
|
|
790
|
+
interface FixtureEnvironmentInit {
|
|
791
|
+
readonly clockIso: string;
|
|
792
|
+
readonly randomSeed: string;
|
|
793
|
+
readonly locale: "en-US";
|
|
794
|
+
readonly timezone: "UTC";
|
|
795
|
+
readonly reducedMotion: true;
|
|
796
|
+
readonly network: "blocked";
|
|
797
|
+
}
|
|
798
|
+
declare const defaultFixtureEnvironmentInit: FixtureEnvironmentInit;
|
|
799
|
+
type DeterministicIdFactory = () => string;
|
|
800
|
+
declare function createDeterministicIdFactory(seed: string): DeterministicIdFactory;
|
|
801
|
+
declare function fixtureEnvironmentInitFor(options: {
|
|
802
|
+
readonly clockIso: string;
|
|
803
|
+
readonly randomSeed: string;
|
|
804
|
+
}): FixtureEnvironmentInit;
|
|
805
|
+
|
|
691
806
|
interface CompileUIScenarioFixtureOptions {
|
|
692
807
|
readonly id: string;
|
|
693
808
|
readonly title: string;
|
|
@@ -696,8 +811,7 @@ interface CompileUIScenarioFixtureOptions {
|
|
|
696
811
|
readonly source: UIScenarioFixture["source"];
|
|
697
812
|
readonly viewer: UIScenarioFixture["viewer"];
|
|
698
813
|
readonly environment: UIScenarioFixture["environment"];
|
|
699
|
-
readonly
|
|
700
|
-
readonly transport?: readonly UIFixtureTransportExchange[];
|
|
814
|
+
readonly protocol: PluginProtocolTape;
|
|
701
815
|
readonly replay?: readonly UIScenarioReplayStep[];
|
|
702
816
|
readonly expected?: Partial<UIScenarioFixture["expected"]>;
|
|
703
817
|
}
|
|
@@ -707,4 +821,4 @@ declare function assertDeterministicUIScenarioFixture(first: UIScenarioFixture,
|
|
|
707
821
|
declare function assertUniqueReplayIdentity(step: Pick<PortableSemanticReplayStep, "stepId" | "expectedIdentity">, candidates: readonly UIReplayIdentityCandidate[]): UIReplayIdentityCandidate;
|
|
708
822
|
declare function assertUIStepExpectationSatisfied(stepId: string, expected: UIStepExpectation, actual: UIStepExpectation): void;
|
|
709
823
|
|
|
710
|
-
export { type BaseContext, type BaseDefinition, type CompileUIScenarioFixtureOptions, type CreateTestRuntimeOptions, type CreatedTestRuntime, type ExpectFn, type ExpectMatchers, type InteractionAvailabilityLike, type InteractionDescriptorLike, type InteractionExplanationLike, type PortableSemanticReplayStep, type RejectionExpectation, type ScenarioDefinition, type SharedScenarioContext, type SnapshotMatcherHandler, type TestRunner, type UIFixtureFrame, type
|
|
824
|
+
export { type BaseContext, type BaseDefinition, type CompilePluginProtocolTapeOptions, type CompileUIScenarioFixtureOptions, type CreateFixtureHostHarnessOptions, type CreateReducerScenarioRunnerOptions, type CreateTestRuntimeOptions, type CreatedTestRuntime, type DeterministicIdFactory, type ExpectFn, type ExpectMatchers, type FixtureEnvironmentInit, type FixtureHostEvent, type FixtureHostHarness, FixturePluginRuntime, type InteractionAvailabilityLike, type InteractionDescriptorLike, type InteractionExplanationLike, type PluginProtocolTape, type PortableSemanticReplayStep, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type RejectionExpectation, type ScenarioDefinition, type SharedScenarioContext, type SnapshotMatcherHandler, type TestRunner, type UIFixtureFrame, type UIFixtureProtocolStep, type UIReplayExecution, type UIReplayIdentityCandidate, type UIReplayRequest, type UIResolvedReplayIdentity, 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, assertDeterministicUIScenarioFixture, assertSupportedBrowserInteractionProtocol, assertUIStepExpectationSatisfied, assertUniqueReplayIdentity, canonicalUIFixtureJson, canonicalizeUIFixtureJson, canonicalizeUIScenarioFixture, compareUIParityObservations, compilePluginProtocolTape, compileUIScenarioFixture, createDeterministicIdFactory, createExpectApi, createFixtureHostHarness, createReducerScenarioRunner, createTestRuntime, createUIParityObservationFromFixture, defaultFixtureEnvironmentInit, defineBase, defineScenario, digestPluginProtocolTape, digestUIFixtureJson, digestUIFixtureRequest, digestUIFixtureTransportRequest, digestUIScenarioFixture, fixtureEnvironmentInitFor, isSha256Digest, parseUIParityObservationV1, parseUIScenarioFixture, parseUIScenarioFixtureBundleIndex, pluginProtocolTapeSchema, portableSemanticReplayStepSchema, serializeUIScenarioFixture, uiFixtureFrameSchema, uiFixtureProtocolStepSchema, uiReplayExecutionSchema, uiReplayRequestSchema, uiResolvedReplayIdentitySchema, uiScenarioFixtureBundleIndexSchema, uiScenarioFixtureSchema, uiScenarioReplayStepSchema, uiStepExpectationSchema };
|