@dreamboard-games/sdk 0.4.0-alpha.13 → 0.4.0-alpha.14

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 (81) hide show
  1. package/README.md +29 -11
  2. package/dist/authoring/index.d.ts +3 -6
  3. package/dist/authoring/index.js +2 -2
  4. package/dist/authoring-compiler.d.ts +3 -3
  5. package/dist/authoring-compiler.js +3 -4
  6. package/dist/authoring-materialize-cli.js +5 -6
  7. package/dist/authoring-materialize-cli.js.map +1 -1
  8. package/dist/browser-interaction.d.ts +21 -21
  9. package/dist/{chunk-3PFDHTR7.js → chunk-3VSOH3TZ.js} +29 -2
  10. package/dist/chunk-3VSOH3TZ.js.map +1 -0
  11. package/dist/{chunk-OFIDC7DJ.js → chunk-73YISGYO.js} +4 -4
  12. package/dist/chunk-73YISGYO.js.map +1 -0
  13. package/dist/{chunk-YNW3KBDE.js → chunk-7QKE5BFU.js} +2 -2
  14. package/dist/{chunk-KZFHTUI5.js → chunk-CHOXM43O.js} +4 -4
  15. package/dist/chunk-CSIEFYTC.js +9 -0
  16. package/dist/chunk-CSIEFYTC.js.map +1 -0
  17. package/dist/{chunk-MLFHVYF7.js → chunk-KH6AET7P.js} +4 -4
  18. package/dist/chunk-KH6AET7P.js.map +1 -0
  19. package/dist/{chunk-MPVC2SU6.js → chunk-LMHCGCA6.js} +2 -2
  20. package/dist/{chunk-WAQUD4IG.js → chunk-NLZDRIVW.js} +16 -16
  21. package/dist/{chunk-5XTAQ4EQ.js → chunk-TO6WRLRN.js} +2 -2
  22. package/dist/{chunk-42HQLHVA.js → chunk-VJVKGWHW.js} +4 -7
  23. package/dist/chunk-VJVKGWHW.js.map +1 -0
  24. package/dist/{chunk-YOLIZMXR.js → chunk-VRRR6QZT.js} +3 -3
  25. package/dist/{chunk-YOLIZMXR.js.map → chunk-VRRR6QZT.js.map} +1 -1
  26. package/dist/{chunk-XDGRC6OR.js → chunk-WASWAYYX.js} +3 -3
  27. package/dist/{chunk-7JBPOJOF.js → chunk-ZGQGFXFG.js} +9 -9
  28. package/dist/{index.d-C7Ztirg6.d.ts → index.d-90ms7Mwh.d.ts} +124 -115
  29. package/dist/index.js +2 -2
  30. package/dist/package-set.d.ts +2 -2
  31. package/dist/package-set.js +2 -2
  32. package/dist/reducer/advanced.js +3 -3
  33. package/dist/reducer-contract.d.ts +1 -1
  34. package/dist/reducer-contract.js +3 -1
  35. package/dist/reducer.d.ts +1 -1
  36. package/dist/reducer.js +3 -3
  37. package/dist/reference-games/index.d.ts +29 -11
  38. package/dist/reference-games/index.js +43 -45
  39. package/dist/reference-games/index.js.map +1 -1
  40. package/dist/runtime/primitives.js +4 -4
  41. package/dist/runtime/workspace-contract.js +8 -8
  42. package/dist/runtime.js +12 -12
  43. package/dist/testing-compiler.d.ts +1 -1
  44. package/dist/testing-compiler.js +1 -4
  45. package/dist/testing-compiler.js.map +1 -1
  46. package/dist/testing-runtime.d.ts +3 -3
  47. package/dist/testing-runtime.js +5 -5
  48. package/dist/testing.d.ts +5 -140
  49. package/dist/testing.js +5 -450
  50. package/dist/testing.js.map +1 -1
  51. package/dist/{types-B-FI0jrx.d.ts → types-Cs_Jp0cf.d.ts} +1 -1
  52. package/dist/ui/components.js +1 -1
  53. package/dist/ui.js +2 -2
  54. package/package.json +22 -29
  55. package/REFERENCE.md +0 -25375
  56. package/dist/chunk-3PFDHTR7.js.map +0 -1
  57. package/dist/chunk-42HQLHVA.js.map +0 -1
  58. package/dist/chunk-MLFHVYF7.js.map +0 -1
  59. package/dist/chunk-OFIDC7DJ.js.map +0 -1
  60. package/dist/chunk-THWT4V3Z.js +0 -12
  61. package/dist/chunk-THWT4V3Z.js.map +0 -1
  62. package/dist/chunk-UNVCT5Z7.js +0 -73
  63. package/dist/chunk-UNVCT5Z7.js.map +0 -1
  64. package/dist/chunk-UTSBXZAM.js +0 -435
  65. package/dist/chunk-UTSBXZAM.js.map +0 -1
  66. package/dist/chunk-YN5W67YL.js +0 -174
  67. package/dist/chunk-YN5W67YL.js.map +0 -1
  68. package/dist/reference-game-compiler.d.ts +0 -45
  69. package/dist/reference-game-compiler.js +0 -25
  70. package/dist/reference-game-compiler.js.map +0 -1
  71. package/dist/reference-game-source-manifest-cli.d.ts +0 -1
  72. package/dist/reference-game-source-manifest-cli.js +0 -84
  73. package/dist/reference-game-source-manifest-cli.js.map +0 -1
  74. package/dist/schema-CJc0UfjJ.d.ts +0 -216
  75. /package/dist/{chunk-YNW3KBDE.js.map → chunk-7QKE5BFU.js.map} +0 -0
  76. /package/dist/{chunk-KZFHTUI5.js.map → chunk-CHOXM43O.js.map} +0 -0
  77. /package/dist/{chunk-MPVC2SU6.js.map → chunk-LMHCGCA6.js.map} +0 -0
  78. /package/dist/{chunk-WAQUD4IG.js.map → chunk-NLZDRIVW.js.map} +0 -0
  79. /package/dist/{chunk-5XTAQ4EQ.js.map → chunk-TO6WRLRN.js.map} +0 -0
  80. /package/dist/{chunk-XDGRC6OR.js.map → chunk-WASWAYYX.js.map} +0 -0
  81. /package/dist/{chunk-7JBPOJOF.js.map → chunk-ZGQGFXFG.js.map} +0 -0
package/dist/testing.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { G as SnapshotMatcherHandler, E as ExpectFn, o as ScenarioDefinitionGameLike, x as ScenarioReplayDefinition, h as ScenarioCheckpoint, k as ScenarioCommand } from './definitions-BezxXhhP.js';
2
2
  export { A as AssertScenarioOptions, a as ExpectMatchers, I as InteractionAvailabilityLike, b as InteractionDescriptorLike, c as InteractionExplanationLike, R as RejectionExpectation, d as ReplayScenarioOptions, e as RuntimeParamsOfScenarioCommand, S as ScenarioActor, f as ScenarioAssertionContext, g as ScenarioAuthoring, i as ScenarioCheckpointId, j as ScenarioCheckpointSelector, l as ScenarioCommandOf, m as ScenarioCommandTraceEntry, n as ScenarioDefinition, p as ScenarioDefinitionValidationCode, q as ScenarioDefinitionValidationError, r as ScenarioDiagnostics, s as ScenarioFlowDiagnostics, t as ScenarioProbeAccepted, u as ScenarioProbeRejected, v as ScenarioProbeResult, w as ScenarioReplay, y as ScenarioReplayError, z as ScenarioReplayErrorOptions, B as ScenarioReplaySegment, C as ScenarioSchemaOutput, D as ScenarioSeatRef, F as ScenarioSetup, H as createScenarioAuthoring, J as resolveScenarioCheckpoint, K as toScenarioReplayDefinition } from './definitions-BezxXhhP.js';
3
3
  import { R as ReducerDiagnosticEvent } from './diagnostics-DIi3ina7.js';
4
- import { g as ScenarioIdentity, f as PerspectiveSelector, e as InspectScenarioResult, P as PerspectiveRef, d as InspectNode, i as Sha256Digest, F as FlowDiagnostic, A as ActorRef, a as InspectEntropy, S as ScenarioDispatchTraceEntry } from './types-B-FI0jrx.js';
5
- export { I as InspectAction, b as InspectInteraction, c as InspectInteractionInput, j as assertScenario, p as probeScenarioCommand, r as replayScenario } from './types-B-FI0jrx.js';
6
- import { w as wire, a as ReducerBundleContract } from './index.d-C7Ztirg6.js';
4
+ import { g as ScenarioIdentity, f as PerspectiveSelector, e as InspectScenarioResult, P as PerspectiveRef, d as InspectNode, i as Sha256Digest, F as FlowDiagnostic, A as ActorRef, a as InspectEntropy, S as ScenarioDispatchTraceEntry } from './types-Cs_Jp0cf.js';
5
+ export { I as InspectAction, b as InspectInteraction, c as InspectInteractionInput, j as assertScenario, p as probeScenarioCommand, r as replayScenario } from './types-Cs_Jp0cf.js';
6
+ import { w as wire, a as ReducerBundleContract } from './index.d-90ms7Mwh.js';
7
7
  import { R as RuntimeJson } from './runtime-json-CQ9QbLZ5.js';
8
- import { B, y, z as z$1, v, e, E } from './protocol-Bcas2Xa8.js';
8
+ import { B, y, z as z$1, v, E } from './protocol-Bcas2Xa8.js';
9
9
  import { z } from 'zod';
10
10
  import { r as BrowserInteractionIntentRequest, l as BrowserInteractionEffectRequest } from './types-DJj5MJkl.js';
11
11
  import { b as PluginTransport, P as PluginRuntimeClient } from './types-CR9yEmXt.js';
@@ -642,141 +642,6 @@ declare function canonicalizeUIScenarioFixture(fixture: UIScenarioFixture): UISc
642
642
  declare function serializeUIScenarioFixture(fixture: UIScenarioFixture): string;
643
643
  declare function digestUIScenarioFixture(fixture: UIScenarioFixture): string;
644
644
 
645
- interface UIParityViewport {
646
- readonly width: number;
647
- readonly height: number;
648
- }
649
- interface UIParityObservationEnvironment {
650
- readonly project: string;
651
- readonly viewport: UIParityViewport;
652
- }
653
- interface UIParityDiagnostic {
654
- readonly code: string;
655
- readonly message: string;
656
- }
657
- interface UIParityObservationCheckpoint {
658
- readonly stepId: string;
659
- readonly interactionKey?: string;
660
- readonly interactionId?: string;
661
- readonly actuatorId?: string;
662
- readonly descriptorDigest?: string;
663
- readonly draftDigest?: string;
664
- readonly basis: e;
665
- readonly projectionDigest: string;
666
- readonly semanticDigest: string;
667
- readonly submissionDigest?: string;
668
- readonly screenshot?: string;
669
- }
670
- interface UIParityObservationProvenance {
671
- readonly kind: "fixture-expectation" | "source-workbench" | "packed-real-host";
672
- readonly evidence?: string;
673
- }
674
- interface UIParityObservation {
675
- readonly schemaVersion: 2;
676
- readonly scenarioId: string;
677
- readonly fixtureDigest: string;
678
- readonly sdkCandidateDigest: string;
679
- readonly pluginRuntimeProtocol: 4;
680
- readonly browserInteractionProtocol: string;
681
- readonly environment: UIParityObservationEnvironment;
682
- readonly provenance: UIParityObservationProvenance;
683
- readonly checkpoints: readonly UIParityObservationCheckpoint[];
684
- readonly diagnostics: readonly UIParityDiagnostic[];
685
- }
686
- interface UIParityArtifactReference {
687
- readonly path: string;
688
- readonly sha256: string;
689
- }
690
- interface UIParityRunScenario {
691
- readonly id: string;
692
- readonly fixture: UIParityArtifactReference;
693
- readonly renderModule: UIParityArtifactReference;
694
- readonly expectation: UIParityArtifactReference;
695
- readonly source: UIParityArtifactReference;
696
- }
697
- interface UIParityRunInput {
698
- readonly schemaVersion: 2;
699
- readonly sdk: {
700
- readonly tarball: UIParityArtifactReference;
701
- };
702
- readonly referenceBundle: UIParityArtifactReference;
703
- readonly fixtureBundle: {
704
- readonly index: UIParityArtifactReference;
705
- readonly scenarios: readonly UIParityRunScenario[];
706
- };
707
- readonly project: string;
708
- }
709
- interface UIParityReceiptComparison {
710
- readonly scenarioId: string;
711
- readonly actual: string;
712
- readonly comparison: string;
713
- readonly evidence?: string;
714
- }
715
- interface UIParityRealHostReceipt {
716
- readonly schemaVersion: 2;
717
- readonly kind: "dreamboard-ui-real-host-parity";
718
- readonly mode: "real-host-parity";
719
- readonly result: "passed";
720
- readonly realHostExecutor: true;
721
- readonly input: UIParityArtifactReference;
722
- readonly sdkTarballSha256: string;
723
- readonly fixtureBundleSha256: string;
724
- readonly scenarios: readonly {
725
- readonly id: string;
726
- readonly fixtureDigest: string;
727
- }[];
728
- readonly source: {
729
- readonly result: "passed";
730
- readonly comparisons: readonly UIParityReceiptComparison[];
731
- };
732
- readonly internal: {
733
- readonly result: "passed";
734
- readonly comparisons: ReadonlyArray<{
735
- readonly scenarioId: string;
736
- readonly actual: string;
737
- readonly expectationComparison: string;
738
- readonly sourceComparison: string;
739
- }>;
740
- };
741
- readonly project: string;
742
- readonly host: {
743
- readonly route: string;
744
- readonly pluginIframe: true;
745
- readonly pluginSessionGateway: true;
746
- readonly playwright: "chromium";
747
- readonly webLogPath: string;
748
- };
749
- }
750
- 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";
751
- interface UIParityComparisonFailure {
752
- readonly code: UIParityFailureCode;
753
- readonly message: string;
754
- readonly path: string;
755
- readonly expected: unknown;
756
- readonly actual: unknown;
757
- readonly checkpointIndex?: number;
758
- readonly stepId?: string;
759
- }
760
- type UIParityComparisonResult = {
761
- readonly ok: true;
762
- } | {
763
- readonly ok: false;
764
- readonly failure: UIParityComparisonFailure;
765
- };
766
- interface CreateUIParityObservationFromFixtureOptions {
767
- readonly fixture: UIScenarioFixture;
768
- readonly sdkCandidateDigest: string;
769
- readonly environment: UIParityObservationEnvironment;
770
- readonly fixtureDigest?: string;
771
- readonly screenshotsByStepId?: Readonly<Record<string, string>>;
772
- readonly diagnostics?: readonly UIParityDiagnostic[];
773
- }
774
- declare function createUIParityObservationFromFixture({ fixture, sdkCandidateDigest, environment, fixtureDigest, screenshotsByStepId, diagnostics, }: CreateUIParityObservationFromFixtureOptions): UIParityObservation;
775
- declare function parseUIParityObservation(value: unknown): UIParityObservation;
776
- declare function compareUIParityObservations(expected: UIParityObservation, actual: UIParityObservation): UIParityComparisonResult;
777
- declare function parseUIParityRunInput(value: unknown): UIParityRunInput;
778
- declare function parseUIParityRealHostReceipt(value: unknown): UIParityRealHostReceipt;
779
-
780
645
  interface FixtureHostEvent {
781
646
  readonly sequence: number;
782
647
  readonly atMs: number;
@@ -875,4 +740,4 @@ declare function drag(options: DragReplayStepOptions): UIScenarioReplayStep;
875
740
  declare function submit(options: ReplayStepOptions): UIScenarioReplayStep;
876
741
  declare function assertStep(stepId: string, expect: UIStepExpectation): UIScenarioReplayStep;
877
742
 
878
- export { ActorRef, type CompilePluginProtocolTapeOptions, type CompileUIScenarioFixtureOptions, type CreateFixtureHostHarnessOptions, type CreateReducerScenarioRunnerOptions, type CreateUIParityObservationFromFixtureOptions, type DeterministicIdFactory, ExpectFn, type ExploreScenarioOptions, type ExploreScenarioResult, type ExploreSeedResult, type ExploreTransitionResult, type FixtureEnvironmentInit, type FixtureHostEvent, type FixtureHostHarness, FixturePluginRuntime, FlowDiagnostic, InspectEntropy, InspectNode, type InspectScenarioOptions, InspectScenarioResult, PerspectiveRef, PerspectiveSelector, type PluginProtocolTape, type PortableSemanticReplayStep, type ProtocolUIScenarioAuthority, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type ReducerUIScenarioAuthority, ScenarioAssertionError, ScenarioCheckpoint, ScenarioCommand, ScenarioDispatchTraceEntry, ScenarioIdentity, ScenarioReplayDefinition, Sha256Digest, SnapshotMatcherHandler, type UIFixtureFrame, type UIFixtureProtocolStep, type UIParityArtifactReference, type UIParityComparisonFailure, type UIParityComparisonResult, type UIParityDiagnostic, type UIParityFailureCode, type UIParityObservation, type UIParityObservationCheckpoint, type UIParityObservationEnvironment, type UIParityObservationProvenance, type UIParityRealHostReceipt, type UIParityReceiptComparison, type UIParityRunInput, type UIParityRunScenario, type UIParityViewport, 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, createUIParityObservationFromFixture, defaultFixtureEnvironmentInit, defineUIScenario, digestPluginProtocolTape, digestUIFixtureJson, digestUIFixtureRequest, digestUIFixtureTransportRequest, digestUIScenarioFixture, drag, exploreScenario, fill, fixtureEnvironmentInitFor, inspectScenario, isSha256Digest, parseUIParityObservation, parseUIParityRealHostReceipt, parseUIParityRunInput, parseUIScenarioFixture, parseUIScenarioFixtureBundleIndex, pluginProtocolTapeSchema, portableSemanticReplayStepSchema, press, serializeUIScenarioFixture, submit, uiFixtureFrameSchema, uiFixtureProtocolStepSchema, uiReplayExecutionSchema, uiReplayRequestSchema, uiResolvedReplayIdentitySchema, uiScenarioFixtureBundleIndexSchema, uiScenarioFixtureSchema, uiScenarioReplayStepSchema, uiStepExpectationSchema };
743
+ export { ActorRef, type CompilePluginProtocolTapeOptions, type CompileUIScenarioFixtureOptions, type CreateFixtureHostHarnessOptions, type CreateReducerScenarioRunnerOptions, type DeterministicIdFactory, ExpectFn, type ExploreScenarioOptions, type ExploreScenarioResult, type ExploreSeedResult, type ExploreTransitionResult, type FixtureEnvironmentInit, type FixtureHostEvent, type FixtureHostHarness, FixturePluginRuntime, FlowDiagnostic, InspectEntropy, InspectNode, type InspectScenarioOptions, InspectScenarioResult, PerspectiveRef, PerspectiveSelector, type PluginProtocolTape, type PortableSemanticReplayStep, type ProtocolUIScenarioAuthority, type ReducerScenarioBundle, type ReducerScenarioDiagnostic, type ReducerScenarioExchange, type ReducerScenarioFrame, type ReducerScenarioOperation, type ReducerScenarioRunner, type ReducerScenarioTrace, type ReducerScenarioViewer, type ReducerUIScenarioAuthority, ScenarioAssertionError, ScenarioCheckpoint, ScenarioCommand, ScenarioDispatchTraceEntry, ScenarioIdentity, ScenarioReplayDefinition, Sha256Digest, SnapshotMatcherHandler, type UIFixtureFrame, type UIFixtureProtocolStep, type UIReplayExecution, type UIReplayIdentityCandidate, type UIReplayRequest, type UIResolvedReplayIdentity, type UIScenarioAuthority, type UIScenarioAuthorityKind, type UIScenarioDefinition, type UIScenarioEnvironmentDefinition, type UIScenarioFixture, type UIScenarioFixtureBundleIndex, type UIScenarioReplayStep, type UIStepExpectation, UI_SCENARIO_FIXTURE_BUNDLE_SCHEMA_VERSION, UI_SCENARIO_FIXTURE_PLUGIN_RUNTIME_PROTOCOL, UI_SCENARIO_FIXTURE_SCHEMA_VERSION, UI_SCENARIO_FIXTURE_SUPPORTED_BROWSER_PROTOCOL_MAJOR, activate, assertDeterministicUIScenarioFixture, assertStep, assertSupportedBrowserInteractionProtocol, assertUIStepExpectationSatisfied, assertUniqueReplayIdentity, canonicalUIFixtureJson, canonicalizeUIFixtureJson, canonicalizeUIScenarioFixture, compilePluginProtocolTape, compileUIScenarioFixture, createDeterministicIdFactory, createExpectApi, createFixtureHostHarness, createReducerScenarioRunner, defaultFixtureEnvironmentInit, defineUIScenario, digestPluginProtocolTape, digestUIFixtureJson, digestUIFixtureRequest, digestUIFixtureTransportRequest, digestUIScenarioFixture, drag, exploreScenario, fill, fixtureEnvironmentInitFor, inspectScenario, isSha256Digest, parseUIScenarioFixture, parseUIScenarioFixtureBundleIndex, pluginProtocolTapeSchema, portableSemanticReplayStepSchema, press, serializeUIScenarioFixture, submit, uiFixtureFrameSchema, uiFixtureProtocolStepSchema, uiReplayExecutionSchema, uiReplayRequestSchema, uiResolvedReplayIdentitySchema, uiScenarioFixtureBundleIndexSchema, uiScenarioFixtureSchema, uiScenarioReplayStepSchema, uiStepExpectationSchema };
package/dist/testing.js CHANGED
@@ -20,13 +20,13 @@ import {
20
20
  replayScenario,
21
21
  resolveScenarioCheckpoint,
22
22
  toScenarioReplayDefinition
23
- } from "./chunk-KZFHTUI5.js";
23
+ } from "./chunk-CHOXM43O.js";
24
24
  import {
25
25
  StaleContractArtifactError,
26
26
  isStaleContractArtifactError
27
- } from "./chunk-XDGRC6OR.js";
28
- import "./chunk-5XTAQ4EQ.js";
29
- import "./chunk-YNW3KBDE.js";
27
+ } from "./chunk-WASWAYYX.js";
28
+ import "./chunk-TO6WRLRN.js";
29
+ import "./chunk-7QKE5BFU.js";
30
30
  import {
31
31
  BROWSER_INTERACTION_ACTUATOR_KINDS,
32
32
  DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION,
@@ -45,7 +45,7 @@ import {
45
45
  digestPluginRuntimeJson,
46
46
  materializePluginGameplayFrame
47
47
  } from "./chunk-FBQNCOPQ.js";
48
- import "./chunk-3PFDHTR7.js";
48
+ import "./chunk-3VSOH3TZ.js";
49
49
  import "./chunk-PZ5AY32C.js";
50
50
 
51
51
  // src/testing/inspection/flow-diagnostic.ts
@@ -855,446 +855,6 @@ function defineUIScenario(scenario) {
855
855
  return Object.freeze(scenario);
856
856
  }
857
857
 
858
- // src/testing/ui-fixture/parity.ts
859
- var topLevelComparisons = [
860
- { path: "scenarioId", code: "fixture-source-mismatch" },
861
- { path: "fixtureDigest", code: "candidate-mismatch" },
862
- { path: "sdkCandidateDigest", code: "candidate-mismatch" },
863
- { path: "pluginRuntimeProtocol", code: "protocol-mismatch" },
864
- { path: "browserInteractionProtocol", code: "protocol-mismatch" },
865
- { path: "environment.project", code: "host-setup-failure" },
866
- { path: "environment.viewport.width", code: "host-setup-failure" },
867
- { path: "environment.viewport.height", code: "host-setup-failure" }
868
- ];
869
- var checkpointComparisons = [
870
- { path: "stepId", code: "interaction-resolution-mismatch" },
871
- { path: "interactionKey", code: "interaction-resolution-mismatch" },
872
- { path: "interactionId", code: "interaction-resolution-mismatch" },
873
- { path: "actuatorId", code: "interaction-resolution-mismatch" },
874
- { path: "descriptorDigest", code: "interaction-resolution-mismatch" },
875
- { path: "basis.generation", code: "projection-mismatch" },
876
- { path: "basis.version", code: "projection-mismatch" },
877
- { path: "basis.actionSetVersion", code: "projection-mismatch" },
878
- { path: "basis.perspectivePlayerId", code: "projection-mismatch" },
879
- { path: "projectionDigest", code: "projection-mismatch" },
880
- { path: "semanticDigest", code: "semantic-snapshot-mismatch" },
881
- { path: "draftDigest", code: "draft-mismatch" },
882
- { path: "submissionDigest", code: "submission-mismatch" },
883
- { path: "screenshot", code: "visual-mismatch" }
884
- ];
885
- function createUIParityObservationFromFixture({
886
- fixture,
887
- sdkCandidateDigest,
888
- environment,
889
- fixtureDigest = digestUIScenarioFixture(fixture),
890
- screenshotsByStepId = {},
891
- diagnostics = []
892
- }) {
893
- const frameById = new Map(
894
- fixture.protocol.frames.map((frame) => [frame.id, frame])
895
- );
896
- const firstFrame = fixture.protocol.frames[0];
897
- if (!firstFrame) {
898
- throw new Error(
899
- `Fixture '${fixture.id}' does not contain protocol frames.`
900
- );
901
- }
902
- const checkpoints = fixture.replay.map((step, index) => {
903
- const expectedFrameId = step.expect.frameId ?? firstFrame.id;
904
- const frame = frameById.get(expectedFrameId);
905
- if (!frame) {
906
- throw new Error(
907
- `Fixture '${fixture.id}' replay step '${step.stepId}' references missing frame '${expectedFrameId}'.`
908
- );
909
- }
910
- const identity = "expectedIdentity" in step ? step.expectedIdentity : null;
911
- const projectionDigest = step.expect.projectionDigest ?? frame.projectionDigest;
912
- const isFinal = index === fixture.replay.length - 1;
913
- const semanticDigest = step.expect.semanticDigest ?? (isFinal ? fixture.expected.finalSemanticDigest : digestUIFixtureJson({
914
- scenarioId: fixture.id,
915
- stepId: step.stepId,
916
- frameId: frame.id,
917
- projectionDigest
918
- }));
919
- const submissionDigest = step.expect.submissionDigest ?? (isFinal ? fixture.expected.submissionDigest : void 0);
920
- return {
921
- stepId: step.stepId,
922
- interactionKey: identity?.interactionKey,
923
- interactionId: identity?.interactionId,
924
- actuatorId: identity?.actuatorId,
925
- descriptorDigest: identity?.descriptorDigest,
926
- draftDigest: step.expect.draftDigest ?? identity?.draftDigest,
927
- basis: frame.frame.basis,
928
- projectionDigest,
929
- semanticDigest,
930
- submissionDigest,
931
- screenshot: screenshotsByStepId[step.stepId]
932
- };
933
- });
934
- return {
935
- schemaVersion: 2,
936
- scenarioId: fixture.id,
937
- fixtureDigest,
938
- sdkCandidateDigest,
939
- pluginRuntimeProtocol: fixture.pluginRuntimeProtocol,
940
- browserInteractionProtocol: fixture.browserInteractionProtocol,
941
- environment,
942
- provenance: {
943
- kind: "fixture-expectation"
944
- },
945
- checkpoints,
946
- diagnostics
947
- };
948
- }
949
- function parseUIParityObservation(value) {
950
- const observation = assertRecord(value, "observation");
951
- if (observation.schemaVersion !== 2) {
952
- throw new Error("UI parity observation schemaVersion must be 2.");
953
- }
954
- assertString(observation.scenarioId, "scenarioId");
955
- assertString(observation.fixtureDigest, "fixtureDigest");
956
- assertString(observation.sdkCandidateDigest, "sdkCandidateDigest");
957
- if (observation.pluginRuntimeProtocol !== 4) {
958
- throw new Error("UI parity observation pluginRuntimeProtocol must be 4.");
959
- }
960
- assertString(
961
- observation.browserInteractionProtocol,
962
- "browserInteractionProtocol"
963
- );
964
- const environment = assertRecord(observation.environment, "environment");
965
- assertString(environment.project, "environment.project");
966
- const viewport = assertRecord(environment.viewport, "environment.viewport");
967
- assertNumber(viewport.width, "environment.viewport.width");
968
- assertNumber(viewport.height, "environment.viewport.height");
969
- const provenance = assertRecord(
970
- observation.provenance,
971
- "observation.provenance"
972
- );
973
- if (provenance.kind !== "fixture-expectation" && provenance.kind !== "source-workbench" && provenance.kind !== "packed-real-host") {
974
- throw new Error(
975
- "observation.provenance.kind must identify fixture, source Workbench, or packed real-host measurement."
976
- );
977
- }
978
- assertOptionalString(provenance.evidence, "observation.provenance.evidence");
979
- if (typeof provenance.evidence === "string") {
980
- assertPortablePath(provenance.evidence, "observation.provenance.evidence");
981
- }
982
- const checkpoints = assertArray(observation.checkpoints, "checkpoints");
983
- for (let index = 0; index < checkpoints.length; index += 1) {
984
- const checkpoint = assertRecord(
985
- checkpoints[index],
986
- `checkpoints[${index}]`
987
- );
988
- assertString(checkpoint.stepId, `checkpoints[${index}].stepId`);
989
- assertOptionalString(
990
- checkpoint.interactionKey,
991
- `checkpoints[${index}].interactionKey`
992
- );
993
- assertOptionalString(
994
- checkpoint.interactionId,
995
- `checkpoints[${index}].interactionId`
996
- );
997
- assertOptionalString(
998
- checkpoint.actuatorId,
999
- `checkpoints[${index}].actuatorId`
1000
- );
1001
- assertOptionalString(
1002
- checkpoint.descriptorDigest,
1003
- `checkpoints[${index}].descriptorDigest`
1004
- );
1005
- assertOptionalString(
1006
- checkpoint.draftDigest,
1007
- `checkpoints[${index}].draftDigest`
1008
- );
1009
- parseGameplayBasis(checkpoint.basis, `checkpoints[${index}].basis`);
1010
- assertString(
1011
- checkpoint.projectionDigest,
1012
- `checkpoints[${index}].projectionDigest`
1013
- );
1014
- assertString(
1015
- checkpoint.semanticDigest,
1016
- `checkpoints[${index}].semanticDigest`
1017
- );
1018
- assertOptionalString(
1019
- checkpoint.submissionDigest,
1020
- `checkpoints[${index}].submissionDigest`
1021
- );
1022
- assertOptionalString(
1023
- checkpoint.screenshot,
1024
- `checkpoints[${index}].screenshot`
1025
- );
1026
- }
1027
- const diagnostics = assertArray(observation.diagnostics, "diagnostics");
1028
- for (let index = 0; index < diagnostics.length; index += 1) {
1029
- const diagnostic = assertRecord(
1030
- diagnostics[index],
1031
- `diagnostics[${index}]`
1032
- );
1033
- assertString(diagnostic.code, `diagnostics[${index}].code`);
1034
- assertString(diagnostic.message, `diagnostics[${index}].message`);
1035
- }
1036
- return observation;
1037
- }
1038
- function compareUIParityObservations(expected, actual) {
1039
- for (const comparison of topLevelComparisons) {
1040
- const result = comparePath(expected, actual, comparison);
1041
- if (result) {
1042
- return result;
1043
- }
1044
- }
1045
- if (expected.checkpoints.length !== actual.checkpoints.length) {
1046
- return mismatch({
1047
- code: "interaction-resolution-mismatch",
1048
- path: "checkpoints.length",
1049
- expected: expected.checkpoints.length,
1050
- actual: actual.checkpoints.length
1051
- });
1052
- }
1053
- for (let index = 0; index < expected.checkpoints.length; index += 1) {
1054
- const expectedCheckpoint = expected.checkpoints[index];
1055
- const actualCheckpoint = actual.checkpoints[index];
1056
- for (const comparison of checkpointComparisons) {
1057
- const result = comparePath(
1058
- expectedCheckpoint,
1059
- actualCheckpoint,
1060
- comparison,
1061
- {
1062
- prefix: `checkpoints[${index}]`,
1063
- checkpointIndex: index,
1064
- stepId: expectedCheckpoint.stepId
1065
- }
1066
- );
1067
- if (result) {
1068
- return result;
1069
- }
1070
- }
1071
- }
1072
- if (!sameValue(expected.diagnostics, actual.diagnostics)) {
1073
- return mismatch({
1074
- code: "host-setup-failure",
1075
- path: "diagnostics",
1076
- expected: expected.diagnostics,
1077
- actual: actual.diagnostics
1078
- });
1079
- }
1080
- return { ok: true };
1081
- }
1082
- function parseUIParityRunInput(value) {
1083
- const input = assertRecord(value, "input");
1084
- if (input.schemaVersion !== 2) {
1085
- throw new Error("UI parity run input schemaVersion must be 2.");
1086
- }
1087
- const sdk = assertRecord(input.sdk, "input.sdk");
1088
- parseArtifactReference(sdk.tarball, "input.sdk.tarball");
1089
- parseArtifactReference(input.referenceBundle, "input.referenceBundle");
1090
- const fixtureBundle = assertRecord(
1091
- input.fixtureBundle,
1092
- "input.fixtureBundle"
1093
- );
1094
- parseArtifactReference(fixtureBundle.index, "input.fixtureBundle.index");
1095
- const scenarios = assertArray(
1096
- fixtureBundle.scenarios,
1097
- "input.fixtureBundle.scenarios"
1098
- );
1099
- if (scenarios.length === 0) {
1100
- throw new Error("input.fixtureBundle.scenarios must not be empty.");
1101
- }
1102
- const ids = /* @__PURE__ */ new Set();
1103
- for (let index = 0; index < scenarios.length; index += 1) {
1104
- const path = `input.fixtureBundle.scenarios[${index}]`;
1105
- const scenario = assertRecord(scenarios[index], path);
1106
- assertString(scenario.id, `${path}.id`);
1107
- const id = scenario.id;
1108
- if (ids.has(id)) {
1109
- throw new Error(`${path}.id duplicates scenario '${id}'.`);
1110
- }
1111
- ids.add(id);
1112
- parseArtifactReference(scenario.fixture, `${path}.fixture`);
1113
- parseArtifactReference(scenario.renderModule, `${path}.renderModule`);
1114
- parseArtifactReference(scenario.expectation, `${path}.expectation`);
1115
- parseArtifactReference(scenario.source, `${path}.source`);
1116
- }
1117
- assertString(input.project, "input.project");
1118
- return input;
1119
- }
1120
- function parseUIParityRealHostReceipt(value) {
1121
- const receipt = assertRecord(value, "receipt");
1122
- if (receipt.schemaVersion !== 2) {
1123
- throw new Error("UI parity real-host receipt schemaVersion must be 2.");
1124
- }
1125
- if (receipt.kind !== "dreamboard-ui-real-host-parity" || receipt.mode !== "real-host-parity" || receipt.result !== "passed" || receipt.realHostExecutor !== true) {
1126
- throw new Error(
1127
- "UI parity real-host receipt must be a passing real-host proof."
1128
- );
1129
- }
1130
- parseArtifactReference(receipt.input, "receipt.input");
1131
- assertString(receipt.sdkTarballSha256, "receipt.sdkTarballSha256");
1132
- assertString(receipt.fixtureBundleSha256, "receipt.fixtureBundleSha256");
1133
- assertString(receipt.project, "receipt.project");
1134
- const scenarios = assertArray(receipt.scenarios, "receipt.scenarios");
1135
- if (scenarios.length === 0) {
1136
- throw new Error("receipt.scenarios must not be empty.");
1137
- }
1138
- for (let index = 0; index < scenarios.length; index += 1) {
1139
- const scenario = assertRecord(
1140
- scenarios[index],
1141
- `receipt.scenarios[${index}]`
1142
- );
1143
- assertString(scenario.id, `receipt.scenarios[${index}].id`);
1144
- assertString(
1145
- scenario.fixtureDigest,
1146
- `receipt.scenarios[${index}].fixtureDigest`
1147
- );
1148
- }
1149
- parseReceiptComparisonGroup(receipt.source, "receipt.source", false);
1150
- parseReceiptComparisonGroup(receipt.internal, "receipt.internal", true);
1151
- const host = assertRecord(receipt.host, "receipt.host");
1152
- assertString(host.route, "receipt.host.route");
1153
- assertString(host.webLogPath, "receipt.host.webLogPath");
1154
- assertPortablePath(host.webLogPath, "receipt.host.webLogPath");
1155
- if (host.pluginIframe !== true || host.pluginSessionGateway !== true || host.playwright !== "chromium") {
1156
- throw new Error(
1157
- "receipt.host must prove PluginIframe, PluginSessionGateway, and Chromium."
1158
- );
1159
- }
1160
- return receipt;
1161
- }
1162
- function comparePath(expected, actual, comparison, options = {}) {
1163
- const expectedValue = getPath(expected, comparison.path);
1164
- const actualValue = getPath(actual, comparison.path);
1165
- if (sameValue(expectedValue, actualValue)) {
1166
- return null;
1167
- }
1168
- const path = options.prefix ? `${options.prefix}.${comparison.path}` : comparison.path;
1169
- return mismatch({
1170
- code: comparison.code,
1171
- path,
1172
- expected: expectedValue,
1173
- actual: actualValue,
1174
- checkpointIndex: options.checkpointIndex,
1175
- stepId: options.stepId
1176
- });
1177
- }
1178
- function mismatch(input) {
1179
- return {
1180
- ok: false,
1181
- failure: {
1182
- ...input,
1183
- message: `${input.code} at ${input.path}`
1184
- }
1185
- };
1186
- }
1187
- function sameValue(left, right) {
1188
- if (left === void 0 || right === void 0) {
1189
- return left === right;
1190
- }
1191
- return canonicalUIFixtureJson(left) === canonicalUIFixtureJson(right);
1192
- }
1193
- function getPath(value, path) {
1194
- return path.split(".").reduce((current, key) => {
1195
- if (current === null || typeof current !== "object") {
1196
- return void 0;
1197
- }
1198
- return current[key];
1199
- }, value);
1200
- }
1201
- function parseGameplayBasis(value, path) {
1202
- const basis = assertRecord(value, path);
1203
- assertNonNegativeInteger(basis.generation, `${path}.generation`);
1204
- assertNonNegativeInteger(basis.version, `${path}.version`);
1205
- assertString(basis.actionSetVersion, `${path}.actionSetVersion`);
1206
- assertString(basis.perspectivePlayerId, `${path}.perspectivePlayerId`);
1207
- return basis;
1208
- }
1209
- function parseArtifactReference(value, path) {
1210
- const reference = assertRecord(value, path);
1211
- assertString(reference.path, `${path}.path`);
1212
- assertPortablePath(reference.path, `${path}.path`);
1213
- assertString(reference.sha256, `${path}.sha256`);
1214
- if (!reference.sha256.startsWith("sha256:")) {
1215
- throw new Error(`${path}.sha256 must be a sha256 digest.`);
1216
- }
1217
- return reference;
1218
- }
1219
- function parseReceiptComparisonGroup(value, path, internal) {
1220
- const group = assertRecord(value, path);
1221
- if (group.result !== "passed") {
1222
- throw new Error(`${path}.result must be passed.`);
1223
- }
1224
- const comparisons = assertArray(group.comparisons, `${path}.comparisons`);
1225
- for (let index = 0; index < comparisons.length; index += 1) {
1226
- const itemPath = `${path}.comparisons[${index}]`;
1227
- const comparison = assertRecord(comparisons[index], itemPath);
1228
- assertString(comparison.scenarioId, `${itemPath}.scenarioId`);
1229
- assertString(comparison.actual, `${itemPath}.actual`);
1230
- assertPortablePath(comparison.actual, `${itemPath}.actual`);
1231
- if (internal) {
1232
- assertString(
1233
- comparison.expectationComparison,
1234
- `${itemPath}.expectationComparison`
1235
- );
1236
- assertString(comparison.sourceComparison, `${itemPath}.sourceComparison`);
1237
- assertPortablePath(
1238
- comparison.expectationComparison,
1239
- `${itemPath}.expectationComparison`
1240
- );
1241
- assertPortablePath(
1242
- comparison.sourceComparison,
1243
- `${itemPath}.sourceComparison`
1244
- );
1245
- } else {
1246
- assertString(comparison.comparison, `${itemPath}.comparison`);
1247
- assertOptionalString(comparison.evidence, `${itemPath}.evidence`);
1248
- assertPortablePath(
1249
- comparison.comparison,
1250
- `${itemPath}.comparison`
1251
- );
1252
- if (typeof comparison.evidence === "string") {
1253
- assertPortablePath(comparison.evidence, `${itemPath}.evidence`);
1254
- }
1255
- }
1256
- }
1257
- }
1258
- function assertPortablePath(value, path) {
1259
- if (value.length === 0 || value.startsWith("/") || value.startsWith("\\") || /^[a-zA-Z]:[\\/]/.test(value) || value.split(/[\\/]+/).includes("..")) {
1260
- throw new Error(
1261
- `${path} must be a relative path within its portable bundle.`
1262
- );
1263
- }
1264
- }
1265
- function assertRecord(value, path) {
1266
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
1267
- throw new Error(`${path} must be an object.`);
1268
- }
1269
- return value;
1270
- }
1271
- function assertArray(value, path) {
1272
- if (!Array.isArray(value)) {
1273
- throw new Error(`${path} must be an array.`);
1274
- }
1275
- return value;
1276
- }
1277
- function assertString(value, path) {
1278
- if (typeof value !== "string" || value.length === 0) {
1279
- throw new Error(`${path} must be a non-empty string.`);
1280
- }
1281
- }
1282
- function assertOptionalString(value, path) {
1283
- if (value !== void 0 && (typeof value !== "string" || value.length === 0)) {
1284
- throw new Error(`${path} must be a non-empty string when present.`);
1285
- }
1286
- }
1287
- function assertNumber(value, path) {
1288
- if (typeof value !== "number" || !Number.isFinite(value)) {
1289
- throw new Error(`${path} must be a finite number.`);
1290
- }
1291
- }
1292
- function assertNonNegativeInteger(value, path) {
1293
- if (!Number.isInteger(value) || value < 0) {
1294
- throw new Error(`${path} must be a non-negative integer.`);
1295
- }
1296
- }
1297
-
1298
858
  // src/testing/ui-fixture/create-fixture-host-harness.ts
1299
859
  var DEFAULT_CHANNEL_ID = "fixture-channel";
1300
860
  function createFixtureHostHarness(options) {
@@ -2095,7 +1655,6 @@ export {
2095
1655
  canonicalUIFixtureJson,
2096
1656
  canonicalizeUIFixtureJson,
2097
1657
  canonicalizeUIScenarioFixture,
2098
- compareUIParityObservations,
2099
1658
  compilePluginProtocolTape,
2100
1659
  compileUIScenarioFixture,
2101
1660
  createDeterministicIdFactory,
@@ -2103,7 +1662,6 @@ export {
2103
1662
  createFixtureHostHarness,
2104
1663
  createReducerScenarioRunner,
2105
1664
  createScenarioAuthoring,
2106
- createUIParityObservationFromFixture,
2107
1665
  defaultFixtureEnvironmentInit,
2108
1666
  defineUIScenario,
2109
1667
  digestPluginProtocolTape,
@@ -2118,9 +1676,6 @@ export {
2118
1676
  inspectScenario,
2119
1677
  isSha256Digest,
2120
1678
  isStaleContractArtifactError,
2121
- parseUIParityObservation,
2122
- parseUIParityRealHostReceipt,
2123
- parseUIParityRunInput,
2124
1679
  parseUIScenarioFixture,
2125
1680
  parseUIScenarioFixtureBundleIndex,
2126
1681
  pluginProtocolTapeSchema,