@dreamboard-games/sdk 0.4.0-alpha.4 → 0.4.0-alpha.6
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 +1089 -123
- package/dist/{HandView-x8MhbhFl.d.ts → HandView-Bi2lxzQP.d.ts} +3 -3
- package/dist/{ThemeProvider-DRalAWzY.d.ts → ThemeProvider-CElaL2ik.d.ts} +1 -1
- package/dist/authoring/index.js +2 -2
- package/dist/browser-interaction.js +1 -1
- package/dist/{chunk-E3X552YM.js → chunk-2TRZSZGD.js} +1061 -425
- package/dist/chunk-2TRZSZGD.js.map +1 -0
- package/dist/{chunk-CP35NPPY.js → chunk-52DH7VQF.js} +61 -7
- package/dist/chunk-52DH7VQF.js.map +1 -0
- package/dist/{chunk-N6ZDIMRB.js → chunk-B2YBS3SG.js} +1 -1
- package/dist/chunk-B2YBS3SG.js.map +1 -0
- package/dist/{chunk-LKJLAGND.js → chunk-DDST4U2P.js} +2 -2
- package/dist/{chunk-SUMZ5OEH.js → chunk-HK3WN4U7.js} +2 -2
- package/dist/{chunk-SUMZ5OEH.js.map → chunk-HK3WN4U7.js.map} +1 -1
- package/dist/{chunk-QOFFRHZR.js → chunk-OV6JC2BM.js} +64 -28
- package/dist/chunk-OV6JC2BM.js.map +1 -0
- package/dist/{chunk-K5ZRJTZZ.js → chunk-PAPIAMYX.js} +6 -3
- package/dist/chunk-PAPIAMYX.js.map +1 -0
- package/dist/{chunk-TTISZQNI.js → chunk-SOBNI363.js} +39 -28
- package/dist/chunk-SOBNI363.js.map +1 -0
- package/dist/{chunk-Y6Y2YABD.js → chunk-TGMXBRKY.js} +22 -6
- package/dist/chunk-TGMXBRKY.js.map +1 -0
- package/dist/{chunk-XZ667T4K.js → chunk-UC2UXAC6.js} +2 -2
- package/dist/{chunk-O6M6PN4E.js → chunk-UUQNOGZV.js} +94 -53
- package/dist/chunk-UUQNOGZV.js.map +1 -0
- package/dist/{chunk-WUIVY2KE.js → chunk-WHR5UW3F.js} +1 -1
- package/dist/chunk-WHR5UW3F.js.map +1 -0
- package/dist/codegen.d.ts +13 -0
- package/dist/codegen.js +1 -1
- package/dist/{components-B7hFaEn_.d.ts → components-BTwSIjXj.d.ts} +77 -206
- package/dist/{hex-board-view-BFlWDb9k.d.ts → hex-board-view-aKkblDp6.d.ts} +180 -1
- package/dist/{index-gjxQichK.d.ts → index-CFTjJIXd.d.ts} +5 -4
- package/dist/{index.d-BL3bT5lt.d.ts → index.d-DMASeF6M.d.ts} +294 -27
- package/dist/index.js +2 -2
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -2
- package/dist/{runtime-api-BJharVaj.d.ts → plugin-state-BRH3UiUp.d.ts} +19 -3
- package/dist/{protocol-BP193lva.d.ts → protocol-835hEGne.d.ts} +42 -1
- package/dist/reducer/advanced.d.ts +4 -2
- package/dist/reducer/advanced.js +1 -1
- package/dist/reducer-contract.d.ts +1 -1
- package/dist/reducer-contract.js +2 -2
- package/dist/reducer.d.ts +10 -4
- package/dist/reducer.js +317 -15
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +32 -7
- package/dist/runtime/primitives.js +9 -5
- package/dist/runtime/runtime-api.d.ts +1 -1
- package/dist/runtime/workspace-contract.d.ts +7 -7
- package/dist/runtime/workspace-contract.js +6 -6
- package/dist/runtime-Dkfm1x2r.d.ts +1670 -0
- package/dist/runtime.d.ts +10 -9
- package/dist/runtime.js +240 -16
- package/dist/runtime.js.map +1 -1
- package/dist/testing.d.ts +78 -15
- package/dist/testing.js +69 -8
- package/dist/testing.js.map +1 -1
- package/dist/{types-CYeN0wLK.d.ts → types-aI4V9CWe.d.ts} +5 -5
- package/dist/types.d.ts +13 -0
- package/dist/ui/components.d.ts +6 -3
- package/dist/ui/components.js +15 -3
- package/dist/ui/plugin-styles.css +2 -2
- package/dist/{ui-contract-B4NjRlvC.d.ts → ui-contract-Ue6SywvO.d.ts} +24 -10
- package/dist/ui.d.ts +9 -6
- package/dist/ui.js +16 -4
- package/dist/views-32rSsfeU.d.ts +1559 -0
- package/package.json +21 -20
- package/dist/chunk-CP35NPPY.js.map +0 -1
- package/dist/chunk-E3X552YM.js.map +0 -1
- package/dist/chunk-K5ZRJTZZ.js.map +0 -1
- package/dist/chunk-N6ZDIMRB.js.map +0 -1
- package/dist/chunk-O6M6PN4E.js.map +0 -1
- package/dist/chunk-QOFFRHZR.js.map +0 -1
- package/dist/chunk-TTISZQNI.js.map +0 -1
- package/dist/chunk-WUIVY2KE.js.map +0 -1
- package/dist/chunk-Y6Y2YABD.js.map +0 -1
- package/dist/views-fn2RuXOx.d.ts +0 -3168
- /package/dist/{chunk-LKJLAGND.js.map → chunk-DDST4U2P.js.map} +0 -0
- /package/dist/{chunk-XZ667T4K.js.map → chunk-UC2UXAC6.js.map} +0 -0
package/dist/testing.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
import { w as wire, a as ReducerBundleContract } from './index.d-
|
|
4
|
-
import {
|
|
3
|
+
import { w as wire, a as ReducerBundleContract } from './index.d-DMASeF6M.js';
|
|
4
|
+
import { p, w, v, t, u } from './protocol-835hEGne.js';
|
|
5
5
|
import { R as RuntimeAPI, V as ValidationResult } from './runtime-api-C6aWo9c0.js';
|
|
6
6
|
import { R as RuntimeJson } from './runtime-json-CQ9QbLZ5.js';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { r as BrowserInteractionIntentRequest, l as BrowserInteractionEffectRequest } from './types-DJj5MJkl.js';
|
|
9
|
-
import { b as PluginTransport, P as PluginRuntimeClient } from './types-
|
|
9
|
+
import { b as PluginTransport, P as PluginRuntimeClient } from './types-aI4V9CWe.js';
|
|
10
10
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
11
|
import react__default from 'react';
|
|
12
12
|
|
|
@@ -172,8 +172,8 @@ type CreateTestRuntimeOptions = {
|
|
|
172
172
|
};
|
|
173
173
|
type CreatedTestRuntime = {
|
|
174
174
|
runtime: RuntimeAPI;
|
|
175
|
-
getFrame():
|
|
176
|
-
getSessionDescriptor():
|
|
175
|
+
getFrame(): p;
|
|
176
|
+
getSessionDescriptor(): w;
|
|
177
177
|
players(): readonly string[];
|
|
178
178
|
seat(index: number): string;
|
|
179
179
|
submit(playerId: string, interactionId: string, params?: unknown): Promise<void>;
|
|
@@ -264,7 +264,7 @@ declare const UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR = 3;
|
|
|
264
264
|
declare const UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL: 3;
|
|
265
265
|
declare const uiFixtureFrameSchema: z.ZodObject<{
|
|
266
266
|
id: z.ZodString;
|
|
267
|
-
frame: z.ZodType<
|
|
267
|
+
frame: z.ZodType<p<unknown, string, string, string>, unknown, z.core.$ZodTypeInternals<p<unknown, string, string, string>, unknown>>;
|
|
268
268
|
projectionDigest: z.ZodString;
|
|
269
269
|
}, z.core.$strict>;
|
|
270
270
|
declare const uiFixtureProtocolStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -294,7 +294,7 @@ declare const uiFixtureProtocolStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
294
294
|
message: z.ZodOptional<z.ZodString>;
|
|
295
295
|
}, z.core.$strict>], "accepted">;
|
|
296
296
|
}, z.core.$strict>], "kind">;
|
|
297
|
-
declare const pluginProtocolTapeSchema: z.ZodType<
|
|
297
|
+
declare const pluginProtocolTapeSchema: z.ZodType<v, unknown, z.core.$ZodTypeInternals<v, unknown>>;
|
|
298
298
|
declare const uiReplayRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
299
299
|
surface: z.ZodString;
|
|
300
300
|
scopeId: z.ZodOptional<z.ZodString>;
|
|
@@ -519,6 +519,7 @@ declare const uiScenarioFixtureSchema: z.ZodObject<{
|
|
|
519
519
|
renderModule: z.ZodString;
|
|
520
520
|
renderModuleDigest: z.ZodString;
|
|
521
521
|
sourceDigest: z.ZodString;
|
|
522
|
+
sourceFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
522
523
|
}, z.core.$strict>;
|
|
523
524
|
viewer: z.ZodObject<{
|
|
524
525
|
seatId: z.ZodString;
|
|
@@ -536,7 +537,7 @@ declare const uiScenarioFixtureSchema: z.ZodObject<{
|
|
|
536
537
|
phone: "phone";
|
|
537
538
|
}>>;
|
|
538
539
|
}, z.core.$strict>;
|
|
539
|
-
protocol: z.ZodType<
|
|
540
|
+
protocol: z.ZodType<v, unknown, z.core.$ZodTypeInternals<v, unknown>>;
|
|
540
541
|
replay: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
541
542
|
stepId: z.ZodString;
|
|
542
543
|
requestDigest: z.ZodString;
|
|
@@ -645,9 +646,9 @@ type UIStepExpectation = z.infer<typeof uiStepExpectationSchema>;
|
|
|
645
646
|
type UIResolvedReplayIdentity = z.infer<typeof uiResolvedReplayIdentitySchema>;
|
|
646
647
|
type PortableSemanticReplayStep = z.infer<typeof portableSemanticReplayStepSchema>;
|
|
647
648
|
type UIScenarioReplayStep = z.infer<typeof uiScenarioReplayStepSchema>;
|
|
648
|
-
type UIFixtureFrame =
|
|
649
|
-
type UIFixtureProtocolStep =
|
|
650
|
-
type PluginProtocolTape =
|
|
649
|
+
type UIFixtureFrame = t;
|
|
650
|
+
type UIFixtureProtocolStep = u;
|
|
651
|
+
type PluginProtocolTape = v;
|
|
651
652
|
type UIScenarioFixture = Omit<z.infer<typeof uiScenarioFixtureSchema>, "protocol" | "replay"> & {
|
|
652
653
|
readonly protocol: PluginProtocolTape;
|
|
653
654
|
readonly replay: readonly UIScenarioReplayStep[];
|
|
@@ -657,6 +658,40 @@ declare function parseUIScenarioFixture(value: unknown): UIScenarioFixture;
|
|
|
657
658
|
declare function parseUIScenarioFixtureBundleIndex(value: unknown): UIScenarioFixtureBundleIndex;
|
|
658
659
|
declare function assertSupportedBrowserInteractionProtocol(version: string): void;
|
|
659
660
|
|
|
661
|
+
type UIScenarioAuthorityKind = "protocol" | "reducer";
|
|
662
|
+
interface UIScenarioEnvironmentDefinition {
|
|
663
|
+
readonly viewport?: "desktop" | "tablet" | "phone";
|
|
664
|
+
readonly browsers?: readonly ("chromium" | "webkit")[];
|
|
665
|
+
readonly input?: readonly ("mouse" | "touch" | "keyboard")[];
|
|
666
|
+
}
|
|
667
|
+
interface ProtocolUIScenarioAuthority {
|
|
668
|
+
readonly kind: "protocol";
|
|
669
|
+
readonly tape: PluginProtocolTape;
|
|
670
|
+
}
|
|
671
|
+
interface ReducerUIScenarioAuthority {
|
|
672
|
+
readonly kind: "reducer";
|
|
673
|
+
readonly referenceGame: unknown;
|
|
674
|
+
readonly coverage: unknown;
|
|
675
|
+
readonly bundle: unknown;
|
|
676
|
+
readonly initialState: unknown;
|
|
677
|
+
readonly viewer: unknown;
|
|
678
|
+
readonly playerIds?: readonly string[];
|
|
679
|
+
readonly operations: readonly unknown[];
|
|
680
|
+
}
|
|
681
|
+
type UIScenarioAuthority = ProtocolUIScenarioAuthority | ReducerUIScenarioAuthority;
|
|
682
|
+
interface UIScenarioDefinition {
|
|
683
|
+
readonly id: string;
|
|
684
|
+
readonly title?: string;
|
|
685
|
+
readonly contracts: readonly string[];
|
|
686
|
+
readonly capabilities: readonly string[];
|
|
687
|
+
readonly sourceFiles: readonly string[];
|
|
688
|
+
readonly environment?: UIScenarioEnvironmentDefinition;
|
|
689
|
+
readonly authority: UIScenarioAuthority;
|
|
690
|
+
readonly replay: readonly UIScenarioReplayStep[];
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare function defineUIScenario<const TScenario extends UIScenarioDefinition>(scenario: TScenario): Readonly<TScenario>;
|
|
694
|
+
|
|
660
695
|
type CanonicalJson = null | boolean | number | string | readonly CanonicalJson[] | {
|
|
661
696
|
readonly [key: string]: CanonicalJson;
|
|
662
697
|
};
|
|
@@ -707,6 +742,10 @@ interface UIParityObservationCheckpointV1 {
|
|
|
707
742
|
readonly submissionDigest?: string;
|
|
708
743
|
readonly screenshot?: string;
|
|
709
744
|
}
|
|
745
|
+
interface UIParityObservationProvenanceV1 {
|
|
746
|
+
readonly kind: "fixture-expectation" | "source-workbench" | "packed-real-host";
|
|
747
|
+
readonly evidence?: string;
|
|
748
|
+
}
|
|
710
749
|
interface UIParityObservationV1 {
|
|
711
750
|
readonly schemaVersion: 1;
|
|
712
751
|
readonly scenarioId: string;
|
|
@@ -715,6 +754,7 @@ interface UIParityObservationV1 {
|
|
|
715
754
|
readonly pluginRuntimeProtocol: 3;
|
|
716
755
|
readonly browserInteractionProtocol: string;
|
|
717
756
|
readonly environment: UIParityObservationEnvironmentV1;
|
|
757
|
+
readonly provenance: UIParityObservationProvenanceV1;
|
|
718
758
|
readonly checkpoints: readonly UIParityObservationCheckpointV1[];
|
|
719
759
|
readonly diagnostics: readonly UIParityDiagnosticV1[];
|
|
720
760
|
}
|
|
@@ -757,7 +797,7 @@ interface FixtureHostEvent {
|
|
|
757
797
|
}
|
|
758
798
|
interface FixtureHostHarness {
|
|
759
799
|
readonly transport: PluginTransport;
|
|
760
|
-
readonly tape:
|
|
800
|
+
readonly tape: v;
|
|
761
801
|
reset(): void;
|
|
762
802
|
flush(): Promise<void>;
|
|
763
803
|
advanceHost(): Promise<void>;
|
|
@@ -766,7 +806,7 @@ interface FixtureHostHarness {
|
|
|
766
806
|
assertConsumed(): void;
|
|
767
807
|
}
|
|
768
808
|
interface CreateFixtureHostHarnessOptions {
|
|
769
|
-
readonly tape:
|
|
809
|
+
readonly tape: v;
|
|
770
810
|
readonly strict?: boolean;
|
|
771
811
|
readonly latencyMs?: number;
|
|
772
812
|
readonly channelId?: string;
|
|
@@ -783,7 +823,7 @@ declare function FixturePluginRuntime({ harness, runtime, children, }: {
|
|
|
783
823
|
|
|
784
824
|
interface CompilePluginProtocolTapeOptions {
|
|
785
825
|
readonly trace: ReducerScenarioTrace;
|
|
786
|
-
readonly session:
|
|
826
|
+
readonly session: w;
|
|
787
827
|
}
|
|
788
828
|
declare function compilePluginProtocolTape(options: CompilePluginProtocolTapeOptions): PluginProtocolTape;
|
|
789
829
|
|
|
@@ -821,4 +861,27 @@ declare function assertDeterministicUIScenarioFixture(first: UIScenarioFixture,
|
|
|
821
861
|
declare function assertUniqueReplayIdentity(step: Pick<PortableSemanticReplayStep, "stepId" | "expectedIdentity">, candidates: readonly UIReplayIdentityCandidate[]): UIReplayIdentityCandidate;
|
|
822
862
|
declare function assertUIStepExpectationSatisfied(stepId: string, expected: UIStepExpectation, actual: UIStepExpectation): void;
|
|
823
863
|
|
|
824
|
-
|
|
864
|
+
type ReplayRequest = PortableSemanticReplayStep["resolve"];
|
|
865
|
+
type DragTarget = Extract<PortableSemanticReplayStep["execute"], {
|
|
866
|
+
kind: "drag";
|
|
867
|
+
}>["target"];
|
|
868
|
+
interface ReplayStepOptions {
|
|
869
|
+
readonly stepId: string;
|
|
870
|
+
readonly resolve: ReplayRequest;
|
|
871
|
+
readonly expect: UIStepExpectation;
|
|
872
|
+
readonly expectedIdentity?: UIResolvedReplayIdentity;
|
|
873
|
+
}
|
|
874
|
+
interface FillReplayStepOptions extends ReplayStepOptions {
|
|
875
|
+
readonly value: string;
|
|
876
|
+
}
|
|
877
|
+
interface DragReplayStepOptions extends ReplayStepOptions {
|
|
878
|
+
readonly target: DragTarget;
|
|
879
|
+
}
|
|
880
|
+
declare function activate(options: ReplayStepOptions): UIScenarioReplayStep;
|
|
881
|
+
declare function fill(options: FillReplayStepOptions): UIScenarioReplayStep;
|
|
882
|
+
declare function press(options: ReplayStepOptions): UIScenarioReplayStep;
|
|
883
|
+
declare function drag(options: DragReplayStepOptions): UIScenarioReplayStep;
|
|
884
|
+
declare function submit(options: ReplayStepOptions): UIScenarioReplayStep;
|
|
885
|
+
declare function assertStep(stepId: string, expect: UIStepExpectation): UIScenarioReplayStep;
|
|
886
|
+
|
|
887
|
+
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 ProtocolUIScenarioAuthority, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type ReducerUIScenarioAuthority, type RejectionExpectation, type ScenarioDefinition, type SharedScenarioContext, type SnapshotMatcherHandler, type TestRunner, 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, compareUIParityObservations, compilePluginProtocolTape, compileUIScenarioFixture, createDeterministicIdFactory, createExpectApi, createFixtureHostHarness, createReducerScenarioRunner, createTestRuntime, createUIParityObservationFromFixture, defaultFixtureEnvironmentInit, defineBase, defineScenario, defineUIScenario, digestPluginProtocolTape, digestUIFixtureJson, digestUIFixtureRequest, digestUIFixtureTransportRequest, digestUIScenarioFixture, drag, fill, fixtureEnvironmentInitFor, isSha256Digest, parseUIParityObservationV1, parseUIScenarioFixture, parseUIScenarioFixtureBundleIndex, pluginProtocolTapeSchema, portableSemanticReplayStepSchema, press, serializeUIScenarioFixture, submit, uiFixtureFrameSchema, uiFixtureProtocolStepSchema, uiReplayExecutionSchema, uiReplayRequestSchema, uiResolvedReplayIdentitySchema, uiScenarioFixtureBundleIndexSchema, uiScenarioFixtureSchema, uiScenarioReplayStepSchema, uiStepExpectationSchema };
|
package/dist/testing.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
PluginRuntimeBoundary,
|
|
7
7
|
createPluginRuntimeClient
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PAPIAMYX.js";
|
|
9
9
|
import {
|
|
10
10
|
DREAMBOARD_PLUGIN_PROTOCOL,
|
|
11
11
|
DREAMBOARD_PLUGIN_PROTOCOL_VERSION,
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
PluginProtocolTapeSchema,
|
|
15
15
|
computePluginActionSetVersion,
|
|
16
16
|
materializePluginGameplayFrame
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UUQNOGZV.js";
|
|
18
18
|
import {
|
|
19
19
|
BROWSER_INTERACTION_ACTUATOR_KINDS,
|
|
20
20
|
DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION,
|
|
21
21
|
browserInteractionEffectSchema
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WHR5UW3F.js";
|
|
23
23
|
import {
|
|
24
24
|
RuntimeJsonSchema
|
|
25
25
|
} from "./chunk-PF7L4BMG.js";
|
|
@@ -488,6 +488,7 @@ function buildPluginFrame(options) {
|
|
|
488
488
|
simultaneousPhase: projection.simultaneousPhase ?? null
|
|
489
489
|
},
|
|
490
490
|
availableInteractions,
|
|
491
|
+
recentEvents: [],
|
|
491
492
|
zones
|
|
492
493
|
};
|
|
493
494
|
}
|
|
@@ -519,7 +520,7 @@ function createTestRuntime(options) {
|
|
|
519
520
|
};
|
|
520
521
|
let version = 0;
|
|
521
522
|
let submissionCounter = 0;
|
|
522
|
-
|
|
523
|
+
const currentPlayerId = playerIds[0] ?? "";
|
|
523
524
|
const diagnosticEvents = [];
|
|
524
525
|
let lastDispatch = null;
|
|
525
526
|
const toReadySessionState = (frame) => ({
|
|
@@ -558,7 +559,7 @@ function createTestRuntime(options) {
|
|
|
558
559
|
message: result.message
|
|
559
560
|
};
|
|
560
561
|
};
|
|
561
|
-
const
|
|
562
|
+
const submit2 = async (playerId, interactionId, params = {}) => {
|
|
562
563
|
submissionCounter += 1;
|
|
563
564
|
const submissionId = `sub-${submissionCounter}`;
|
|
564
565
|
diagnosticEvents.push({
|
|
@@ -620,7 +621,7 @@ function createTestRuntime(options) {
|
|
|
620
621
|
};
|
|
621
622
|
const runtime = {
|
|
622
623
|
validateInteraction: (interactionId, params) => validate(currentPlayerId, interactionId, params),
|
|
623
|
-
submitInteraction: (interactionId, params) =>
|
|
624
|
+
submitInteraction: (interactionId, params) => submit2(currentPlayerId, interactionId, params),
|
|
624
625
|
getSessionState: () => lastSessionState,
|
|
625
626
|
disconnect: () => void 0
|
|
626
627
|
};
|
|
@@ -637,7 +638,7 @@ function createTestRuntime(options) {
|
|
|
637
638
|
}
|
|
638
639
|
return playerIds[index];
|
|
639
640
|
},
|
|
640
|
-
submit,
|
|
641
|
+
submit: submit2,
|
|
641
642
|
validate,
|
|
642
643
|
explain,
|
|
643
644
|
diagnostics: {
|
|
@@ -857,6 +858,11 @@ function readFlowState2(state) {
|
|
|
857
858
|
};
|
|
858
859
|
}
|
|
859
860
|
|
|
861
|
+
// src/testing/ui-scenario/define-ui-scenario.ts
|
|
862
|
+
function defineUIScenario(scenario) {
|
|
863
|
+
return Object.freeze(scenario);
|
|
864
|
+
}
|
|
865
|
+
|
|
860
866
|
// src/testing/ui-fixture/parity.ts
|
|
861
867
|
var topLevelComparisons = [
|
|
862
868
|
{ path: "scenarioId", code: "fixture-source-mismatch" },
|
|
@@ -942,6 +948,9 @@ function createUIParityObservationFromFixture({
|
|
|
942
948
|
pluginRuntimeProtocol: fixture.pluginRuntimeProtocol,
|
|
943
949
|
browserInteractionProtocol: fixture.browserInteractionProtocol,
|
|
944
950
|
environment,
|
|
951
|
+
provenance: {
|
|
952
|
+
kind: "fixture-expectation"
|
|
953
|
+
},
|
|
945
954
|
checkpoints,
|
|
946
955
|
diagnostics
|
|
947
956
|
};
|
|
@@ -966,6 +975,16 @@ function parseUIParityObservationV1(value) {
|
|
|
966
975
|
const viewport = assertRecord(environment.viewport, "environment.viewport");
|
|
967
976
|
assertNumber(viewport.width, "environment.viewport.width");
|
|
968
977
|
assertNumber(viewport.height, "environment.viewport.height");
|
|
978
|
+
const provenance = assertRecord(
|
|
979
|
+
observation.provenance,
|
|
980
|
+
"observation.provenance"
|
|
981
|
+
);
|
|
982
|
+
if (provenance.kind !== "fixture-expectation" && provenance.kind !== "source-workbench" && provenance.kind !== "packed-real-host") {
|
|
983
|
+
throw new Error(
|
|
984
|
+
"observation.provenance.kind must identify fixture, source Workbench, or packed real-host measurement."
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
assertOptionalString(provenance.evidence, "observation.provenance.evidence");
|
|
969
988
|
const checkpoints = assertArray(observation.checkpoints, "checkpoints");
|
|
970
989
|
for (let index = 0; index < checkpoints.length; index += 1) {
|
|
971
990
|
const checkpoint = assertRecord(
|
|
@@ -1679,7 +1698,8 @@ var uiScenarioFixtureSchema = z.object({
|
|
|
1679
1698
|
uiContractFingerprint: nonEmptyStringSchema,
|
|
1680
1699
|
renderModule: nonEmptyStringSchema,
|
|
1681
1700
|
renderModuleDigest: digestSchema,
|
|
1682
|
-
sourceDigest: digestSchema
|
|
1701
|
+
sourceDigest: digestSchema,
|
|
1702
|
+
sourceFiles: z.array(nonEmptyStringSchema).optional()
|
|
1683
1703
|
}).strict(),
|
|
1684
1704
|
viewer: z.object({
|
|
1685
1705
|
seatId: nonEmptyStringSchema,
|
|
@@ -1919,6 +1939,40 @@ function assertUIStepExpectationSatisfied(stepId, expected, actual) {
|
|
|
1919
1939
|
}
|
|
1920
1940
|
}
|
|
1921
1941
|
}
|
|
1942
|
+
|
|
1943
|
+
// src/testing/ui-scenario/replay-builders.ts
|
|
1944
|
+
function semanticStep(options, execute) {
|
|
1945
|
+
return {
|
|
1946
|
+
stepId: options.stepId,
|
|
1947
|
+
requestDigest: digestUIFixtureRequest(options.resolve),
|
|
1948
|
+
resolve: options.resolve,
|
|
1949
|
+
execute,
|
|
1950
|
+
expectedIdentity: options.expectedIdentity,
|
|
1951
|
+
expect: options.expect
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
function activate(options) {
|
|
1955
|
+
return semanticStep(options, { kind: "activate" });
|
|
1956
|
+
}
|
|
1957
|
+
function fill(options) {
|
|
1958
|
+
return semanticStep(options, { kind: "fill", value: options.value });
|
|
1959
|
+
}
|
|
1960
|
+
function press(options) {
|
|
1961
|
+
return activate(options);
|
|
1962
|
+
}
|
|
1963
|
+
function drag(options) {
|
|
1964
|
+
return semanticStep(options, { kind: "drag", target: options.target });
|
|
1965
|
+
}
|
|
1966
|
+
function submit(options) {
|
|
1967
|
+
return activate(options);
|
|
1968
|
+
}
|
|
1969
|
+
function assertStep(stepId, expect) {
|
|
1970
|
+
return {
|
|
1971
|
+
stepId,
|
|
1972
|
+
kind: "assert",
|
|
1973
|
+
expect
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1922
1976
|
export {
|
|
1923
1977
|
FixturePluginRuntime,
|
|
1924
1978
|
StaleContractArtifactError,
|
|
@@ -1926,7 +1980,9 @@ export {
|
|
|
1926
1980
|
UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL,
|
|
1927
1981
|
UI_SCENARIO_FIXTURE_SCHEMA_VERSION,
|
|
1928
1982
|
UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR,
|
|
1983
|
+
activate,
|
|
1929
1984
|
assertDeterministicUIScenarioFixture,
|
|
1985
|
+
assertStep,
|
|
1930
1986
|
assertSupportedBrowserInteractionProtocol,
|
|
1931
1987
|
assertUIStepExpectationSatisfied,
|
|
1932
1988
|
assertUniqueReplayIdentity,
|
|
@@ -1945,11 +2001,14 @@ export {
|
|
|
1945
2001
|
defaultFixtureEnvironmentInit,
|
|
1946
2002
|
defineBase,
|
|
1947
2003
|
defineScenario,
|
|
2004
|
+
defineUIScenario,
|
|
1948
2005
|
digestPluginProtocolTape,
|
|
1949
2006
|
digestUIFixtureJson,
|
|
1950
2007
|
digestUIFixtureRequest,
|
|
1951
2008
|
digestUIFixtureTransportRequest,
|
|
1952
2009
|
digestUIScenarioFixture,
|
|
2010
|
+
drag,
|
|
2011
|
+
fill,
|
|
1953
2012
|
fixtureEnvironmentInitFor,
|
|
1954
2013
|
isSha256Digest,
|
|
1955
2014
|
isStaleContractArtifactError,
|
|
@@ -1958,7 +2017,9 @@ export {
|
|
|
1958
2017
|
parseUIScenarioFixtureBundleIndex,
|
|
1959
2018
|
pluginProtocolTapeSchema,
|
|
1960
2019
|
portableSemanticReplayStepSchema,
|
|
2020
|
+
press,
|
|
1961
2021
|
serializeUIScenarioFixture,
|
|
2022
|
+
submit,
|
|
1962
2023
|
uiFixtureFrameSchema,
|
|
1963
2024
|
uiFixtureProtocolStepSchema,
|
|
1964
2025
|
uiReplayExecutionSchema,
|