@dreamboard-games/sdk 0.4.0-alpha.0 → 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.
Files changed (84) hide show
  1. package/README.md +8 -1
  2. package/REFERENCE.md +1849 -379
  3. package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BuiNstXs.d.ts} +5 -1
  4. package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-B1sIoBlX.d.ts} +1 -1
  5. package/dist/attributes-DbvyMbXw.d.ts +68 -0
  6. package/dist/authoring/index.d.ts +66 -0
  7. package/dist/authoring/index.js +560 -0
  8. package/dist/authoring/index.js.map +1 -0
  9. package/dist/browser-interaction.d.ts +246 -44
  10. package/dist/browser-interaction.js +14 -1
  11. package/dist/{chunk-Q5O7GPVY.js → chunk-45FI6XII.js} +630 -375
  12. package/dist/chunk-45FI6XII.js.map +1 -0
  13. package/dist/{chunk-4G7552LO.js → chunk-6JQFGSLD.js} +216 -47
  14. package/dist/chunk-6JQFGSLD.js.map +1 -0
  15. package/dist/{chunk-NBAEEHAU.js → chunk-CP35NPPY.js} +5926 -5266
  16. package/dist/chunk-CP35NPPY.js.map +1 -0
  17. package/dist/{chunk-2LDZ5C3T.js → chunk-FWVV2X74.js} +2 -2
  18. package/dist/{chunk-MNKDSGIA.js → chunk-HWJS3VOJ.js} +6 -2
  19. package/dist/chunk-HWJS3VOJ.js.map +1 -0
  20. package/dist/chunk-K5ZRJTZZ.js +328 -0
  21. package/dist/chunk-K5ZRJTZZ.js.map +1 -0
  22. package/dist/{chunk-U5KBV2BA.js → chunk-N6ZDIMRB.js} +444 -223
  23. package/dist/chunk-N6ZDIMRB.js.map +1 -0
  24. package/dist/chunk-O6M6PN4E.js +1225 -0
  25. package/dist/chunk-O6M6PN4E.js.map +1 -0
  26. package/dist/chunk-PF7L4BMG.js +117 -0
  27. package/dist/chunk-PF7L4BMG.js.map +1 -0
  28. package/dist/{chunk-P7F4L2FF.js → chunk-WOWFONLZ.js} +609 -1287
  29. package/dist/chunk-WOWFONLZ.js.map +1 -0
  30. package/dist/{chunk-QLG6VEMW.js → chunk-WUIVY2KE.js} +318 -21
  31. package/dist/chunk-WUIVY2KE.js.map +1 -0
  32. package/dist/chunk-ZAS2SENW.js +12 -0
  33. package/dist/chunk-ZAS2SENW.js.map +1 -0
  34. package/dist/codegen.d.ts +11 -1
  35. package/dist/codegen.js +1 -1
  36. package/dist/{components-DaIqi9QM.d.ts → components-BbWPnZCF.d.ts} +37 -70
  37. package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-Kz9Q_zsv.d.ts} +1 -1
  38. package/dist/index.js +2 -1
  39. package/dist/package-set.d.ts +2 -2
  40. package/dist/package-set.js +2 -1
  41. package/dist/player-state-Cqpyeql0.d.ts +371 -0
  42. package/dist/protocol-BP193lva.d.ts +267 -0
  43. package/dist/reducer/advanced.d.ts +2 -2
  44. package/dist/reducer/advanced.js +1 -1
  45. package/dist/reducer-contract.js +1 -1
  46. package/dist/reducer.d.ts +7 -7
  47. package/dist/reducer.js +190 -183
  48. package/dist/reducer.js.map +1 -1
  49. package/dist/runtime/primitives.d.ts +10 -9
  50. package/dist/runtime/primitives.js +9 -6
  51. package/dist/runtime/runtime-api.d.ts +2 -2
  52. package/dist/runtime/workspace-contract.d.ts +28 -76
  53. package/dist/runtime/workspace-contract.js +7 -5
  54. package/dist/runtime-api-BJharVaj.d.ts +198 -0
  55. package/dist/runtime-api-C6aWo9c0.d.ts +95 -0
  56. package/dist/runtime-json-CQ9QbLZ5.d.ts +5 -0
  57. package/dist/runtime.d.ts +80 -11
  58. package/dist/runtime.js +89 -445
  59. package/dist/runtime.js.map +1 -1
  60. package/dist/testing.d.ts +643 -22
  61. package/dist/testing.js +1371 -76
  62. package/dist/testing.js.map +1 -1
  63. package/dist/types-CYeN0wLK.d.ts +29 -0
  64. package/dist/{attributes-BeRyboMS.d.ts → types-DJj5MJkl.d.ts} +32 -55
  65. package/dist/types.d.ts +14 -7
  66. package/dist/ui/components.d.ts +4 -5
  67. package/dist/ui/components.js +19 -1
  68. package/dist/ui/player-state.d.ts +2 -365
  69. package/dist/ui/plugin-styles.css +1 -1
  70. package/dist/{ui-contract-BUC6iS3s.d.ts → ui-contract-CY7cxsCC.d.ts} +17 -26
  71. package/dist/ui.d.ts +8 -13
  72. package/dist/ui.js +20 -2
  73. package/dist/{views-B0hlW6IT.d.ts → views-fn2RuXOx.d.ts} +59 -44
  74. package/package.json +28 -4
  75. package/dist/chunk-4G7552LO.js.map +0 -1
  76. package/dist/chunk-MNKDSGIA.js.map +0 -1
  77. package/dist/chunk-NBAEEHAU.js.map +0 -1
  78. package/dist/chunk-P7F4L2FF.js.map +0 -1
  79. package/dist/chunk-Q5O7GPVY.js.map +0 -1
  80. package/dist/chunk-QLG6VEMW.js.map +0 -1
  81. package/dist/chunk-U5KBV2BA.js.map +0 -1
  82. package/dist/hex-color-MhOyuY-o.d.ts +0 -8
  83. package/dist/runtime-api-BXd70c2e.d.ts +0 -490
  84. /package/dist/{chunk-2LDZ5C3T.js.map → chunk-FWVV2X74.js.map} +0 -0
package/dist/testing.d.ts CHANGED
@@ -1,9 +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 { d as PluginStateSnapshot$1, G as GameplaySnapshot$1, R as RuntimeAPI, c as PluginSessionState, V as ValidationResult } from './runtime-api-BXd70c2e.js';
5
- import 'zod';
6
- import './hex-color-MhOyuY-o.js';
4
+ import { o, v, u, s, t } from './protocol-BP193lva.js';
5
+ import { R as RuntimeAPI, V as ValidationResult } from './runtime-api-C6aWo9c0.js';
6
+ import { R as RuntimeJson } from './runtime-json-CQ9QbLZ5.js';
7
+ import { z } from 'zod';
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';
7
12
 
8
13
  type TestRunner = "reducer" | "remote" | "browser";
9
14
  type InteractionDescriptorLike = {
@@ -135,17 +140,6 @@ type CreateExpectApiOptions = {
135
140
  };
136
141
  declare function createExpectApi(options?: CreateExpectApiOptions): ExpectFn;
137
142
 
138
- type GameView = Record<string, unknown>;
139
-
140
- type PhaseName = string;
141
-
142
- type StageName = string;
143
- type InteractionId = string;
144
- type GameplaySnapshot = GameplaySnapshot$1<PhaseName, StageName, InteractionId>;
145
- type PluginStateSnapshot = Omit<PluginStateSnapshot$1<GameView, PhaseName, StageName, InteractionId>, "gameplay"> & {
146
- gameplay: GameplaySnapshot;
147
- };
148
-
149
143
  type ReducerBundleLike = Pick<ReducerBundleContract, "projectSeatsDynamic" | "validateInput" | "dispatch"> & {
150
144
  explainInteraction?: (input: {
151
145
  state: wire.ReducerSessionState;
@@ -177,12 +171,9 @@ type CreateTestRuntimeOptions = {
177
171
  expectedBaseStateFingerprint?: string;
178
172
  };
179
173
  type CreatedTestRuntime = {
180
- runtime: RuntimeAPI & {
181
- getSnapshot(): PluginStateSnapshot;
182
- subscribeToState(listener: (state: PluginStateSnapshot) => void): () => void;
183
- _subscribeToSessionState(listener: (state: PluginSessionState) => void): () => void;
184
- };
185
- getSnapshot(): PluginStateSnapshot;
174
+ runtime: RuntimeAPI;
175
+ getFrame(): o;
176
+ getSessionDescriptor(): v;
186
177
  players(): readonly string[];
187
178
  seat(index: number): string;
188
179
  submit(playerId: string, interactionId: string, params?: unknown): Promise<void>;
@@ -196,8 +187,638 @@ type CreatedTestRuntime = {
196
187
  } | null;
197
188
  clear(): void;
198
189
  };
199
- setControllingPlayer(playerId: string): void;
200
190
  };
201
191
  declare function createTestRuntime(options: CreateTestRuntimeOptions): CreatedTestRuntime;
202
192
 
203
- export { type BaseContext, type BaseDefinition, type CreateTestRuntimeOptions, type CreatedTestRuntime, type ExpectFn, type ExpectMatchers, type InteractionAvailabilityLike, type InteractionDescriptorLike, type InteractionExplanationLike, type RejectionExpectation, type ScenarioDefinition, type SharedScenarioContext, type SnapshotMatcherHandler, type TestRunner, createExpectApi, createTestRuntime, defineBase, defineScenario };
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;
265
+ declare const uiFixtureFrameSchema: z.ZodObject<{
266
+ id: z.ZodString;
267
+ frame: z.ZodType<o<unknown, string, string, string>, unknown, z.core.$ZodTypeInternals<o<unknown, string, string, string>, unknown>>;
268
+ projectionDigest: z.ZodString;
269
+ }, z.core.$strict>;
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<{
275
+ id: z.ZodString;
276
+ kind: z.ZodLiteral<"client.validate">;
277
+ fromFrameId: z.ZodString;
278
+ requestDigest: z.ZodString;
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>;
291
+ }, z.core.$strict>, z.ZodObject<{
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>>;
298
+ declare const uiReplayRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
299
+ surface: z.ZodString;
300
+ scopeId: z.ZodOptional<z.ZodString>;
301
+ interactionKey: z.ZodOptional<z.ZodString>;
302
+ interactionId: z.ZodOptional<z.ZodString>;
303
+ intent: z.ZodString;
304
+ inputKey: z.ZodOptional<z.ZodString>;
305
+ candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
306
+ candidateValueKey: z.ZodOptional<z.ZodString>;
307
+ actuatorKind: z.ZodOptional<z.ZodEnum<{
308
+ fill: "fill";
309
+ pointer: "pointer";
310
+ keyboard: "keyboard";
311
+ click: "click";
312
+ }>>;
313
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
314
+ }, z.core.$strict>, z.ZodObject<{
315
+ surface: z.ZodString;
316
+ scopeId: z.ZodOptional<z.ZodString>;
317
+ interactionKey: z.ZodOptional<z.ZodString>;
318
+ interactionId: z.ZodOptional<z.ZodString>;
319
+ effect: z.ZodObject<{
320
+ kind: z.ZodString;
321
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
322
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
323
+ }, z.core.$strict>]>;
324
+ declare const uiReplayExecutionSchema: z.ZodUnion<readonly [z.ZodObject<{
325
+ kind: z.ZodLiteral<"activate">;
326
+ }, z.core.$strict>, z.ZodObject<{
327
+ kind: z.ZodLiteral<"fill">;
328
+ value: z.ZodString;
329
+ }, z.core.$strict>, z.ZodObject<{
330
+ kind: z.ZodLiteral<"drag">;
331
+ target: z.ZodObject<{
332
+ surface: z.ZodString;
333
+ scopeId: z.ZodOptional<z.ZodString>;
334
+ interactionKey: z.ZodOptional<z.ZodString>;
335
+ interactionId: z.ZodOptional<z.ZodString>;
336
+ effect: z.ZodObject<{
337
+ kind: z.ZodString;
338
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
339
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
340
+ }, z.core.$strict>;
341
+ }, z.core.$strict>]>;
342
+ declare const uiStepExpectationSchema: z.ZodObject<{
343
+ frameId: z.ZodOptional<z.ZodString>;
344
+ projectionDigest: z.ZodOptional<z.ZodString>;
345
+ semanticDigest: z.ZodOptional<z.ZodString>;
346
+ draftDigest: z.ZodOptional<z.ZodString>;
347
+ submissionDigest: z.ZodOptional<z.ZodString>;
348
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
349
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
350
+ }, z.core.$strict>;
351
+ declare const uiResolvedReplayIdentitySchema: z.ZodObject<{
352
+ stepId: z.ZodString;
353
+ surface: z.ZodString;
354
+ scopeId: z.ZodString;
355
+ interactionKey: z.ZodString;
356
+ interactionId: z.ZodString;
357
+ actuatorId: z.ZodString;
358
+ descriptorDigest: z.ZodOptional<z.ZodString>;
359
+ draftDigest: z.ZodOptional<z.ZodString>;
360
+ }, z.core.$strict>;
361
+ declare const portableSemanticReplayStepSchema: z.ZodObject<{
362
+ stepId: z.ZodString;
363
+ requestDigest: z.ZodString;
364
+ resolve: z.ZodUnion<readonly [z.ZodObject<{
365
+ surface: z.ZodString;
366
+ scopeId: z.ZodOptional<z.ZodString>;
367
+ interactionKey: z.ZodOptional<z.ZodString>;
368
+ interactionId: z.ZodOptional<z.ZodString>;
369
+ intent: z.ZodString;
370
+ inputKey: z.ZodOptional<z.ZodString>;
371
+ candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
372
+ candidateValueKey: z.ZodOptional<z.ZodString>;
373
+ actuatorKind: z.ZodOptional<z.ZodEnum<{
374
+ fill: "fill";
375
+ pointer: "pointer";
376
+ keyboard: "keyboard";
377
+ click: "click";
378
+ }>>;
379
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ surface: z.ZodString;
382
+ scopeId: z.ZodOptional<z.ZodString>;
383
+ interactionKey: z.ZodOptional<z.ZodString>;
384
+ interactionId: z.ZodOptional<z.ZodString>;
385
+ effect: z.ZodObject<{
386
+ kind: z.ZodString;
387
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
388
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
389
+ }, z.core.$strict>]>;
390
+ execute: z.ZodUnion<readonly [z.ZodObject<{
391
+ kind: z.ZodLiteral<"activate">;
392
+ }, z.core.$strict>, z.ZodObject<{
393
+ kind: z.ZodLiteral<"fill">;
394
+ value: z.ZodString;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ kind: z.ZodLiteral<"drag">;
397
+ target: z.ZodObject<{
398
+ surface: z.ZodString;
399
+ scopeId: z.ZodOptional<z.ZodString>;
400
+ interactionKey: z.ZodOptional<z.ZodString>;
401
+ interactionId: z.ZodOptional<z.ZodString>;
402
+ effect: z.ZodObject<{
403
+ kind: z.ZodString;
404
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
405
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
406
+ }, z.core.$strict>;
407
+ }, z.core.$strict>]>;
408
+ expectedIdentity: z.ZodOptional<z.ZodObject<{
409
+ stepId: z.ZodString;
410
+ surface: z.ZodString;
411
+ scopeId: z.ZodString;
412
+ interactionKey: z.ZodString;
413
+ interactionId: z.ZodString;
414
+ actuatorId: z.ZodString;
415
+ descriptorDigest: z.ZodOptional<z.ZodString>;
416
+ draftDigest: z.ZodOptional<z.ZodString>;
417
+ }, z.core.$strict>>;
418
+ expect: z.ZodObject<{
419
+ frameId: z.ZodOptional<z.ZodString>;
420
+ projectionDigest: z.ZodOptional<z.ZodString>;
421
+ semanticDigest: z.ZodOptional<z.ZodString>;
422
+ draftDigest: z.ZodOptional<z.ZodString>;
423
+ submissionDigest: z.ZodOptional<z.ZodString>;
424
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
425
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
426
+ }, z.core.$strict>;
427
+ }, z.core.$strict>;
428
+ declare const uiScenarioReplayStepSchema: z.ZodUnion<readonly [z.ZodObject<{
429
+ stepId: z.ZodString;
430
+ requestDigest: z.ZodString;
431
+ resolve: z.ZodUnion<readonly [z.ZodObject<{
432
+ surface: z.ZodString;
433
+ scopeId: z.ZodOptional<z.ZodString>;
434
+ interactionKey: z.ZodOptional<z.ZodString>;
435
+ interactionId: z.ZodOptional<z.ZodString>;
436
+ intent: z.ZodString;
437
+ inputKey: z.ZodOptional<z.ZodString>;
438
+ candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
439
+ candidateValueKey: z.ZodOptional<z.ZodString>;
440
+ actuatorKind: z.ZodOptional<z.ZodEnum<{
441
+ fill: "fill";
442
+ pointer: "pointer";
443
+ keyboard: "keyboard";
444
+ click: "click";
445
+ }>>;
446
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
447
+ }, z.core.$strict>, z.ZodObject<{
448
+ surface: z.ZodString;
449
+ scopeId: z.ZodOptional<z.ZodString>;
450
+ interactionKey: z.ZodOptional<z.ZodString>;
451
+ interactionId: z.ZodOptional<z.ZodString>;
452
+ effect: z.ZodObject<{
453
+ kind: z.ZodString;
454
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
455
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
456
+ }, z.core.$strict>]>;
457
+ execute: z.ZodUnion<readonly [z.ZodObject<{
458
+ kind: z.ZodLiteral<"activate">;
459
+ }, z.core.$strict>, z.ZodObject<{
460
+ kind: z.ZodLiteral<"fill">;
461
+ value: z.ZodString;
462
+ }, z.core.$strict>, z.ZodObject<{
463
+ kind: z.ZodLiteral<"drag">;
464
+ target: z.ZodObject<{
465
+ surface: z.ZodString;
466
+ scopeId: z.ZodOptional<z.ZodString>;
467
+ interactionKey: z.ZodOptional<z.ZodString>;
468
+ interactionId: z.ZodOptional<z.ZodString>;
469
+ effect: z.ZodObject<{
470
+ kind: z.ZodString;
471
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
472
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
473
+ }, z.core.$strict>;
474
+ }, z.core.$strict>]>;
475
+ expectedIdentity: z.ZodOptional<z.ZodObject<{
476
+ stepId: z.ZodString;
477
+ surface: z.ZodString;
478
+ scopeId: z.ZodString;
479
+ interactionKey: z.ZodString;
480
+ interactionId: z.ZodString;
481
+ actuatorId: z.ZodString;
482
+ descriptorDigest: z.ZodOptional<z.ZodString>;
483
+ draftDigest: z.ZodOptional<z.ZodString>;
484
+ }, z.core.$strict>>;
485
+ expect: z.ZodObject<{
486
+ frameId: z.ZodOptional<z.ZodString>;
487
+ projectionDigest: z.ZodOptional<z.ZodString>;
488
+ semanticDigest: z.ZodOptional<z.ZodString>;
489
+ draftDigest: z.ZodOptional<z.ZodString>;
490
+ submissionDigest: z.ZodOptional<z.ZodString>;
491
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
492
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
493
+ }, z.core.$strict>;
494
+ }, z.core.$strict>, z.ZodObject<{
495
+ stepId: z.ZodString;
496
+ kind: z.ZodLiteral<"assert">;
497
+ expect: z.ZodObject<{
498
+ frameId: z.ZodOptional<z.ZodString>;
499
+ projectionDigest: z.ZodOptional<z.ZodString>;
500
+ semanticDigest: z.ZodOptional<z.ZodString>;
501
+ draftDigest: z.ZodOptional<z.ZodString>;
502
+ submissionDigest: z.ZodOptional<z.ZodString>;
503
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
504
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
505
+ }, z.core.$strict>;
506
+ }, z.core.$strict>]>;
507
+ declare const uiScenarioFixtureSchema: z.ZodObject<{
508
+ schemaVersion: z.ZodLiteral<2>;
509
+ browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
510
+ pluginRuntimeProtocol: z.ZodLiteral<3>;
511
+ id: z.ZodString;
512
+ title: z.ZodString;
513
+ gameId: z.ZodString;
514
+ tags: z.ZodArray<z.ZodString>;
515
+ source: z.ZodObject<{
516
+ scenarioId: z.ZodString;
517
+ reducerFingerprint: z.ZodString;
518
+ uiContractFingerprint: z.ZodString;
519
+ renderModule: z.ZodString;
520
+ renderModuleDigest: z.ZodString;
521
+ sourceDigest: z.ZodString;
522
+ }, z.core.$strict>;
523
+ viewer: z.ZodObject<{
524
+ seatId: z.ZodString;
525
+ playerId: z.ZodOptional<z.ZodString>;
526
+ }, z.core.$strict>;
527
+ environment: z.ZodObject<{
528
+ clockIso: z.ZodString;
529
+ randomSeed: z.ZodString;
530
+ locale: z.ZodLiteral<"en-US">;
531
+ timezone: z.ZodLiteral<"UTC">;
532
+ viewportTags: z.ZodArray<z.ZodEnum<{
533
+ touch: "touch";
534
+ desktop: "desktop";
535
+ tablet: "tablet";
536
+ phone: "phone";
537
+ }>>;
538
+ }, z.core.$strict>;
539
+ protocol: z.ZodType<u, unknown, z.core.$ZodTypeInternals<u, unknown>>;
540
+ replay: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
541
+ stepId: z.ZodString;
542
+ requestDigest: z.ZodString;
543
+ resolve: z.ZodUnion<readonly [z.ZodObject<{
544
+ surface: z.ZodString;
545
+ scopeId: z.ZodOptional<z.ZodString>;
546
+ interactionKey: z.ZodOptional<z.ZodString>;
547
+ interactionId: z.ZodOptional<z.ZodString>;
548
+ intent: z.ZodString;
549
+ inputKey: z.ZodOptional<z.ZodString>;
550
+ candidateValue: z.ZodOptional<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>;
551
+ candidateValueKey: z.ZodOptional<z.ZodString>;
552
+ actuatorKind: z.ZodOptional<z.ZodEnum<{
553
+ fill: "fill";
554
+ pointer: "pointer";
555
+ keyboard: "keyboard";
556
+ click: "click";
557
+ }>>;
558
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
559
+ }, z.core.$strict>, z.ZodObject<{
560
+ surface: z.ZodString;
561
+ scopeId: z.ZodOptional<z.ZodString>;
562
+ interactionKey: z.ZodOptional<z.ZodString>;
563
+ interactionId: z.ZodOptional<z.ZodString>;
564
+ effect: z.ZodObject<{
565
+ kind: z.ZodString;
566
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
567
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
568
+ }, z.core.$strict>]>;
569
+ execute: z.ZodUnion<readonly [z.ZodObject<{
570
+ kind: z.ZodLiteral<"activate">;
571
+ }, z.core.$strict>, z.ZodObject<{
572
+ kind: z.ZodLiteral<"fill">;
573
+ value: z.ZodString;
574
+ }, z.core.$strict>, z.ZodObject<{
575
+ kind: z.ZodLiteral<"drag">;
576
+ target: z.ZodObject<{
577
+ surface: z.ZodString;
578
+ scopeId: z.ZodOptional<z.ZodString>;
579
+ interactionKey: z.ZodOptional<z.ZodString>;
580
+ interactionId: z.ZodOptional<z.ZodString>;
581
+ effect: z.ZodObject<{
582
+ kind: z.ZodString;
583
+ }, z.core.$catchall<z.ZodPreprocess<z.ZodType<RuntimeJson, unknown, z.core.$ZodTypeInternals<RuntimeJson, unknown>>>>>;
584
+ allowDisabled: z.ZodOptional<z.ZodBoolean>;
585
+ }, z.core.$strict>;
586
+ }, z.core.$strict>]>;
587
+ expectedIdentity: z.ZodOptional<z.ZodObject<{
588
+ stepId: z.ZodString;
589
+ surface: z.ZodString;
590
+ scopeId: z.ZodString;
591
+ interactionKey: z.ZodString;
592
+ interactionId: z.ZodString;
593
+ actuatorId: z.ZodString;
594
+ descriptorDigest: z.ZodOptional<z.ZodString>;
595
+ draftDigest: z.ZodOptional<z.ZodString>;
596
+ }, z.core.$strict>>;
597
+ expect: z.ZodObject<{
598
+ frameId: z.ZodOptional<z.ZodString>;
599
+ projectionDigest: z.ZodOptional<z.ZodString>;
600
+ semanticDigest: z.ZodOptional<z.ZodString>;
601
+ draftDigest: z.ZodOptional<z.ZodString>;
602
+ submissionDigest: z.ZodOptional<z.ZodString>;
603
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
604
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
605
+ }, z.core.$strict>;
606
+ }, z.core.$strict>, z.ZodObject<{
607
+ stepId: z.ZodString;
608
+ kind: z.ZodLiteral<"assert">;
609
+ expect: z.ZodObject<{
610
+ frameId: z.ZodOptional<z.ZodString>;
611
+ projectionDigest: z.ZodOptional<z.ZodString>;
612
+ semanticDigest: z.ZodOptional<z.ZodString>;
613
+ draftDigest: z.ZodOptional<z.ZodString>;
614
+ submissionDigest: z.ZodOptional<z.ZodString>;
615
+ focusedInteractionKey: z.ZodOptional<z.ZodString>;
616
+ visibleInteractionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
617
+ }, z.core.$strict>;
618
+ }, z.core.$strict>]>>;
619
+ expected: z.ZodObject<{
620
+ initialProjectionDigest: z.ZodString;
621
+ finalProjectionDigest: z.ZodString;
622
+ finalSemanticDigest: z.ZodString;
623
+ submissionDigest: z.ZodString;
624
+ }, z.core.$strict>;
625
+ }, z.core.$strict>;
626
+ declare const uiScenarioFixtureBundleIndexSchema: z.ZodObject<{
627
+ schemaVersion: z.ZodLiteral<2>;
628
+ bundleId: z.ZodString;
629
+ sdkCommit: z.ZodString;
630
+ pluginRuntimeProtocol: z.ZodLiteral<3>;
631
+ browserInteractionProtocol: z.ZodLiteral<"3.0.0">;
632
+ fixtures: z.ZodArray<z.ZodObject<{
633
+ id: z.ZodString;
634
+ file: z.ZodString;
635
+ sha256: z.ZodString;
636
+ renderModule: z.ZodString;
637
+ renderModuleSha256: z.ZodString;
638
+ components: z.ZodArray<z.ZodString>;
639
+ capabilities: z.ZodArray<z.ZodString>;
640
+ }, z.core.$strict>>;
641
+ }, z.core.$strict>;
642
+ type UIReplayRequest = BrowserInteractionIntentRequest | BrowserInteractionEffectRequest;
643
+ type UIReplayExecution = z.infer<typeof uiReplayExecutionSchema>;
644
+ type UIStepExpectation = z.infer<typeof uiStepExpectationSchema>;
645
+ type UIResolvedReplayIdentity = z.infer<typeof uiResolvedReplayIdentitySchema>;
646
+ type PortableSemanticReplayStep = z.infer<typeof portableSemanticReplayStepSchema>;
647
+ type UIScenarioReplayStep = z.infer<typeof uiScenarioReplayStepSchema>;
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;
653
+ readonly replay: readonly UIScenarioReplayStep[];
654
+ };
655
+ type UIScenarioFixtureBundleIndex = z.infer<typeof uiScenarioFixtureBundleIndexSchema>;
656
+ declare function parseUIScenarioFixture(value: unknown): UIScenarioFixture;
657
+ declare function parseUIScenarioFixtureBundleIndex(value: unknown): UIScenarioFixtureBundleIndex;
658
+ declare function assertSupportedBrowserInteractionProtocol(version: string): void;
659
+
660
+ type CanonicalJson = null | boolean | number | string | readonly CanonicalJson[] | {
661
+ readonly [key: string]: CanonicalJson;
662
+ };
663
+ declare function isSha256Digest(value: string): boolean;
664
+ declare function canonicalizeUIFixtureJson(value: unknown): CanonicalJson;
665
+ declare function canonicalUIFixtureJson(value: unknown): string;
666
+ declare function digestUIFixtureJson(value: unknown): string;
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;
679
+ declare function canonicalizeUIScenarioFixture(fixture: UIScenarioFixture): UIScenarioFixture;
680
+ declare function serializeUIScenarioFixture(fixture: UIScenarioFixture): string;
681
+ declare function digestUIScenarioFixture(fixture: UIScenarioFixture): string;
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
+
806
+ interface CompileUIScenarioFixtureOptions {
807
+ readonly id: string;
808
+ readonly title: string;
809
+ readonly gameId: string;
810
+ readonly tags?: readonly string[];
811
+ readonly source: UIScenarioFixture["source"];
812
+ readonly viewer: UIScenarioFixture["viewer"];
813
+ readonly environment: UIScenarioFixture["environment"];
814
+ readonly protocol: PluginProtocolTape;
815
+ readonly replay?: readonly UIScenarioReplayStep[];
816
+ readonly expected?: Partial<UIScenarioFixture["expected"]>;
817
+ }
818
+ type UIReplayIdentityCandidate = UIResolvedReplayIdentity;
819
+ declare function compileUIScenarioFixture(options: CompileUIScenarioFixtureOptions): UIScenarioFixture;
820
+ declare function assertDeterministicUIScenarioFixture(first: UIScenarioFixture, second: UIScenarioFixture): void;
821
+ declare function assertUniqueReplayIdentity(step: Pick<PortableSemanticReplayStep, "stepId" | "expectedIdentity">, candidates: readonly UIReplayIdentityCandidate[]): UIReplayIdentityCandidate;
822
+ declare function assertUIStepExpectationSatisfied(stepId: string, expected: UIStepExpectation, actual: UIStepExpectation): void;
823
+
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 };