@descryy/mcp 0.9.1 → 0.11.0

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 (206) hide show
  1. package/dist/browser/auth.d.ts +76 -0
  2. package/dist/browser/auth.d.ts.map +1 -0
  3. package/dist/browser/auth.js +223 -0
  4. package/dist/browser/auth.js.map +1 -0
  5. package/dist/browser/capability-probe.d.ts +109 -0
  6. package/dist/browser/capability-probe.d.ts.map +1 -0
  7. package/dist/browser/capability-probe.js +201 -0
  8. package/dist/browser/capability-probe.js.map +1 -0
  9. package/dist/browser/driver.d.ts +342 -4
  10. package/dist/browser/driver.d.ts.map +1 -1
  11. package/dist/browser/driver.js +79 -1
  12. package/dist/browser/driver.js.map +1 -1
  13. package/dist/browser/evidence.d.ts +3 -0
  14. package/dist/browser/evidence.d.ts.map +1 -1
  15. package/dist/browser/evidence.js +6 -1
  16. package/dist/browser/evidence.js.map +1 -1
  17. package/dist/browser/fake-driver.d.ts +65 -8
  18. package/dist/browser/fake-driver.d.ts.map +1 -1
  19. package/dist/browser/fake-driver.js +235 -8
  20. package/dist/browser/fake-driver.js.map +1 -1
  21. package/dist/browser/fault-attribution.d.ts +178 -0
  22. package/dist/browser/fault-attribution.d.ts.map +1 -0
  23. package/dist/browser/fault-attribution.js +266 -0
  24. package/dist/browser/fault-attribution.js.map +1 -0
  25. package/dist/browser/identity-graph-write.d.ts +55 -0
  26. package/dist/browser/identity-graph-write.d.ts.map +1 -0
  27. package/dist/browser/identity-graph-write.js +45 -0
  28. package/dist/browser/identity-graph-write.js.map +1 -0
  29. package/dist/browser/page-probe.d.ts +81 -0
  30. package/dist/browser/page-probe.d.ts.map +1 -0
  31. package/dist/browser/page-probe.js +202 -0
  32. package/dist/browser/page-probe.js.map +1 -0
  33. package/dist/browser/playwright-driver.d.ts +79 -0
  34. package/dist/browser/playwright-driver.d.ts.map +1 -1
  35. package/dist/browser/playwright-driver.js +1138 -180
  36. package/dist/browser/playwright-driver.js.map +1 -1
  37. package/dist/browser/reach-recording-session.d.ts +44 -0
  38. package/dist/browser/reach-recording-session.d.ts.map +1 -0
  39. package/dist/browser/reach-recording-session.js +143 -0
  40. package/dist/browser/reach-recording-session.js.map +1 -0
  41. package/dist/browser/reachability.d.ts +168 -0
  42. package/dist/browser/reachability.d.ts.map +1 -0
  43. package/dist/browser/reachability.js +294 -0
  44. package/dist/browser/reachability.js.map +1 -0
  45. package/dist/browser/registry.d.ts +24 -0
  46. package/dist/browser/registry.d.ts.map +1 -1
  47. package/dist/browser/registry.js +21 -2
  48. package/dist/browser/registry.js.map +1 -1
  49. package/dist/browser/scenario-provenance.d.ts +1 -1
  50. package/dist/browser/scenario-provenance.d.ts.map +1 -1
  51. package/dist/browser/scenario-provenance.js +15 -1
  52. package/dist/browser/scenario-provenance.js.map +1 -1
  53. package/dist/browser/scenario-runner.d.ts +10 -2
  54. package/dist/browser/scenario-runner.d.ts.map +1 -1
  55. package/dist/browser/scenario-runner.js +77 -9
  56. package/dist/browser/scenario-runner.js.map +1 -1
  57. package/dist/browser/tool-support.d.ts +5 -1
  58. package/dist/browser/tool-support.d.ts.map +1 -1
  59. package/dist/browser/tool-support.js +80 -4
  60. package/dist/browser/tool-support.js.map +1 -1
  61. package/dist/browser/wait-target.d.ts +37 -0
  62. package/dist/browser/wait-target.d.ts.map +1 -0
  63. package/dist/browser/wait-target.js +54 -0
  64. package/dist/browser/wait-target.js.map +1 -0
  65. package/dist/heap.d.ts +61 -0
  66. package/dist/heap.d.ts.map +1 -0
  67. package/dist/heap.js +82 -0
  68. package/dist/heap.js.map +1 -0
  69. package/dist/heartbeat.d.ts +46 -0
  70. package/dist/heartbeat.d.ts.map +1 -0
  71. package/dist/heartbeat.js +66 -0
  72. package/dist/heartbeat.js.map +1 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/planner/predict-then-propose.d.ts +101 -0
  78. package/dist/planner/predict-then-propose.d.ts.map +1 -0
  79. package/dist/planner/predict-then-propose.js +88 -0
  80. package/dist/planner/predict-then-propose.js.map +1 -0
  81. package/dist/planner/propose-journey.d.ts +60 -0
  82. package/dist/planner/propose-journey.d.ts.map +1 -0
  83. package/dist/planner/propose-journey.js +96 -0
  84. package/dist/planner/propose-journey.js.map +1 -0
  85. package/dist/registry.d.ts +10 -1
  86. package/dist/registry.d.ts.map +1 -1
  87. package/dist/registry.js +5 -1
  88. package/dist/registry.js.map +1 -1
  89. package/dist/render.d.ts +4 -4
  90. package/dist/render.js +3 -3
  91. package/dist/scenarios/browser-run-plan-projection.d.ts +143 -0
  92. package/dist/scenarios/browser-run-plan-projection.d.ts.map +1 -0
  93. package/dist/scenarios/browser-run-plan-projection.js +228 -0
  94. package/dist/scenarios/browser-run-plan-projection.js.map +1 -0
  95. package/dist/scenarios/credential-ref.d.ts +102 -0
  96. package/dist/scenarios/credential-ref.d.ts.map +1 -0
  97. package/dist/scenarios/credential-ref.js +148 -0
  98. package/dist/scenarios/credential-ref.js.map +1 -0
  99. package/dist/scenarios/index.d.ts +4 -1
  100. package/dist/scenarios/index.d.ts.map +1 -1
  101. package/dist/scenarios/index.js +4 -1
  102. package/dist/scenarios/index.js.map +1 -1
  103. package/dist/scenarios/parse.d.ts.map +1 -1
  104. package/dist/scenarios/parse.js +42 -9
  105. package/dist/scenarios/parse.js.map +1 -1
  106. package/dist/scenarios/scenario.d.ts +39 -5
  107. package/dist/scenarios/scenario.d.ts.map +1 -1
  108. package/dist/scenarios/scenario.js +15 -2
  109. package/dist/scenarios/scenario.js.map +1 -1
  110. package/dist/scenarios/secret-ref.d.ts +86 -0
  111. package/dist/scenarios/secret-ref.d.ts.map +1 -0
  112. package/dist/scenarios/secret-ref.js +125 -0
  113. package/dist/scenarios/secret-ref.js.map +1 -0
  114. package/dist/server.d.ts +1 -1
  115. package/dist/server.d.ts.map +1 -1
  116. package/dist/server.js +8 -4
  117. package/dist/server.js.map +1 -1
  118. package/dist/session.d.ts +19 -0
  119. package/dist/session.d.ts.map +1 -1
  120. package/dist/session.js +36 -0
  121. package/dist/session.js.map +1 -1
  122. package/dist/tools/analyze-workspace.d.ts +52 -0
  123. package/dist/tools/analyze-workspace.d.ts.map +1 -0
  124. package/dist/tools/analyze-workspace.js +207 -0
  125. package/dist/tools/analyze-workspace.js.map +1 -0
  126. package/dist/tools/analyze.d.ts +50 -4
  127. package/dist/tools/analyze.d.ts.map +1 -1
  128. package/dist/tools/analyze.js +225 -5
  129. package/dist/tools/analyze.js.map +1 -1
  130. package/dist/tools/browser-close-session.d.ts +21 -1
  131. package/dist/tools/browser-close-session.d.ts.map +1 -1
  132. package/dist/tools/browser-close-session.js +71 -7
  133. package/dist/tools/browser-close-session.js.map +1 -1
  134. package/dist/tools/browser-navigate.d.ts +1 -1
  135. package/dist/tools/browser-navigate.d.ts.map +1 -1
  136. package/dist/tools/browser-navigate.js +5 -3
  137. package/dist/tools/browser-navigate.js.map +1 -1
  138. package/dist/tools/browser-run-scenario.d.ts.map +1 -1
  139. package/dist/tools/browser-run-scenario.js +6 -1
  140. package/dist/tools/browser-run-scenario.js.map +1 -1
  141. package/dist/tools/browser-save-scenario.d.ts.map +1 -1
  142. package/dist/tools/browser-save-scenario.js +84 -4
  143. package/dist/tools/browser-save-scenario.js.map +1 -1
  144. package/dist/tools/browser-select.d.ts +20 -0
  145. package/dist/tools/browser-select.d.ts.map +1 -0
  146. package/dist/tools/browser-select.js +120 -0
  147. package/dist/tools/browser-select.js.map +1 -0
  148. package/dist/tools/browser-snapshot.d.ts +17 -1
  149. package/dist/tools/browser-snapshot.d.ts.map +1 -1
  150. package/dist/tools/browser-snapshot.js +18 -5
  151. package/dist/tools/browser-snapshot.js.map +1 -1
  152. package/dist/tools/browser-start-session.d.ts.map +1 -1
  153. package/dist/tools/browser-start-session.js +161 -9
  154. package/dist/tools/browser-start-session.js.map +1 -1
  155. package/dist/tools/browser-submit.d.ts +18 -0
  156. package/dist/tools/browser-submit.d.ts.map +1 -0
  157. package/dist/tools/browser-submit.js +106 -0
  158. package/dist/tools/browser-submit.js.map +1 -0
  159. package/dist/tools/browser-wait-for.d.ts +41 -0
  160. package/dist/tools/browser-wait-for.d.ts.map +1 -0
  161. package/dist/tools/browser-wait-for.js +148 -0
  162. package/dist/tools/browser-wait-for.js.map +1 -0
  163. package/dist/tools/chain.d.ts +41 -0
  164. package/dist/tools/chain.d.ts.map +1 -0
  165. package/dist/tools/chain.js +105 -0
  166. package/dist/tools/chain.js.map +1 -0
  167. package/dist/tools/draw-conclusion.d.ts +44 -0
  168. package/dist/tools/draw-conclusion.d.ts.map +1 -0
  169. package/dist/tools/draw-conclusion.js +250 -0
  170. package/dist/tools/draw-conclusion.js.map +1 -0
  171. package/dist/tools/index.d.ts +7 -0
  172. package/dist/tools/index.d.ts.map +1 -1
  173. package/dist/tools/index.js +16 -0
  174. package/dist/tools/index.js.map +1 -1
  175. package/dist/tools/kit.d.ts +17 -0
  176. package/dist/tools/kit.d.ts.map +1 -1
  177. package/dist/tools/kit.js.map +1 -1
  178. package/dist/tools/observe-runtime.d.ts +17 -0
  179. package/dist/tools/observe-runtime.d.ts.map +1 -1
  180. package/dist/tools/observe-runtime.js +174 -10
  181. package/dist/tools/observe-runtime.js.map +1 -1
  182. package/dist/tools/predict-reach.d.ts +57 -0
  183. package/dist/tools/predict-reach.d.ts.map +1 -0
  184. package/dist/tools/predict-reach.js +159 -0
  185. package/dist/tools/predict-reach.js.map +1 -0
  186. package/dist/tools/propagation.d.ts +8 -3
  187. package/dist/tools/propagation.d.ts.map +1 -1
  188. package/dist/tools/propagation.js +16 -9
  189. package/dist/tools/propagation.js.map +1 -1
  190. package/dist/tools/propose-journey.d.ts +16 -0
  191. package/dist/tools/propose-journey.d.ts.map +1 -0
  192. package/dist/tools/propose-journey.js +121 -0
  193. package/dist/tools/propose-journey.js.map +1 -0
  194. package/dist/tools/runtime-journey-drive.d.ts +102 -0
  195. package/dist/tools/runtime-journey-drive.d.ts.map +1 -0
  196. package/dist/tools/runtime-journey-drive.js +247 -0
  197. package/dist/tools/runtime-journey-drive.js.map +1 -0
  198. package/dist/tools/scope.d.ts +3 -0
  199. package/dist/tools/scope.d.ts.map +1 -1
  200. package/dist/tools/scope.js +33 -6
  201. package/dist/tools/scope.js.map +1 -1
  202. package/dist/workspace-index.d.ts +164 -0
  203. package/dist/workspace-index.d.ts.map +1 -0
  204. package/dist/workspace-index.js +381 -0
  205. package/dist/workspace-index.js.map +1 -0
  206. package/package.json +32 -31
@@ -2,18 +2,61 @@
2
2
  * issuance/invalidation, drain-not-peek, crash invalidation, flushing close), and
3
3
  * `browser-driver-contract.test.ts` runs the same assertions against it as the real driver.
4
4
  * Non-goals: no simulated DOM (pages are declared via `setPage`), no classification. */
5
- import { type BrowserDriver, type BrowserStorageState, type ObservedRequest } from "./driver.ts";
6
- /** A page as a test declares it. `ref` is issued by the fake, not written here. `selector` may be
7
- * `null` — a test simulating an element with no stable hook (id/test attribute/name), the case
8
- * `browser_save_scenario`'s B1 check refuses regardless of provenance. */
5
+ import { type BrowserDriver, type BrowserStorageState, type StorageStateInjectionResult, type ObservedRequest, type FrameRef, type ElementComponentIdentity } from "./driver.ts";
6
+ import type { PageFingerprint } from "./capability-probe.ts";
7
+ /** An element as a test declares it. `ref` is issued by the fake, not written here. `selector`
8
+ * may be `null` — a test simulating an element with no stable hook (id/test attribute/name), the
9
+ * case `browser_save_scenario`'s B1 check refuses regardless of provenance. */
10
+ export interface FakeElement {
11
+ readonly role: string;
12
+ readonly name: string;
13
+ readonly selector: string | null;
14
+ /** Put this element inside an iframe. The fake enforces the port's own rule rather than
15
+ * trusting the test: a framed element's `selector` comes back null however it was declared,
16
+ * because the scenario format has no field to name a frame. */
17
+ readonly frame?: FrameRef;
18
+ /** Put this element inside an open shadow root. */
19
+ readonly inShadowRoot?: boolean;
20
+ /** This element does not exist until a reveal pass scrolls to it — a lazily-rendered row. */
21
+ readonly revealedByScroll?: boolean;
22
+ /** This element exists now and is destroyed by a reveal pass — a virtualized row recycled
23
+ * out of the DOM as the list scrolls past it. */
24
+ readonly recycledByScroll?: boolean;
25
+ /** The option values this element offers, in order. Present makes it a chooser — what
26
+ * `select` tests against. The real driver reads the equivalent off the DOM. */
27
+ readonly options?: readonly string[];
28
+ /** True when submitting this element is a real thing the page would do. Absent means it
29
+ * submits nothing, which is what most elements are. */
30
+ readonly submits?: boolean;
31
+ /** What a configured grounder would say about this element's producing component. Absent
32
+ * (not merely `undefined`) means no grounder was configured for this session and the
33
+ * snapshot must report `identity: null` — same distinction the real driver makes between
34
+ * "did not run" and "ran and refused". */
35
+ readonly identity?: ElementComponentIdentity;
36
+ }
37
+ /** A page as a test declares it. */
9
38
  export interface FakePage {
10
39
  readonly url: string;
11
40
  readonly title: string;
12
- readonly elements: readonly {
13
- readonly role: string;
14
- readonly name: string;
15
- readonly selector: string | null;
41
+ readonly elements: readonly FakeElement[];
42
+ /** Frames the page holds that cannot be read, each with the reason — a snapshot must report
43
+ * them rather than drop them, and this is how a test declares one. */
44
+ readonly unreachableFrames?: readonly {
45
+ readonly frame: FrameRef;
46
+ readonly reason: string;
16
47
  }[];
48
+ /** Custom elements whose shadow root is closed. No API confirms one, so this is what the
49
+ * real driver can only *suspect*; the fake lets a test declare the number it should report. */
50
+ readonly suspectedClosedHosts?: number;
51
+ /**
52
+ * What the session-start capability probe should find here. **Absent means the
53
+ * session has no `fingerprint` method at all**, which is the port's own way of
54
+ * saying "this driver cannot probe" — a fake that always answered with a
55
+ * fingerprint of zeroes would make an unexamined page indistinguishable from a
56
+ * clean one, which is the exact confusion the optional method exists to
57
+ * prevent. Only the fields a test cares about are written; the rest read zero.
58
+ */
59
+ readonly fingerprint?: Partial<PageFingerprint>;
17
60
  }
18
61
  export interface FakeBrowserDriver extends BrowserDriver {
19
62
  /** Declare what is served at `url`. Navigating anywhere undeclared yields an empty page, not an error — an empty page is a real thing a URL can serve. */
@@ -54,6 +97,20 @@ export interface FakeBrowserDriver extends BrowserDriver {
54
97
  /** The storageState a launch actually received, or undefined if none was given —
55
98
  * what 11.4-b's tests assert reached the driver rather than being dropped en route. */
56
99
  storageStateReceivedFor(sessionId: string): BrowserStorageState | undefined;
100
+ /** The extra headers a launch actually received, or undefined if none — B1's plumbing assertion, for the same reason `storageStateReceivedFor` exists. */
101
+ extraHttpHeadersReceivedFor(sessionId: string): Readonly<Record<string, string>> | undefined;
102
+ /** Where a launch was asked to save its state, or undefined. */
103
+ saveStorageStateToFor(sessionId: string): string | undefined;
104
+ /** Every `injectStorageState()` call a session actually received, in order — the mid-session
105
+ * sign-in primitive's own plumbing assertion, same reasoning `storageStateReceivedFor` gives
106
+ * for the launch-time seed. */
107
+ injectStorageStateCallsFor(sessionId: string): readonly InjectStorageStateCall[] | undefined;
108
+ }
109
+ /** One `injectStorageState()` call as the fake recorded it, alongside what the fake decided about it — the same shape a caller sees back as `StorageStateInjectionResult`, plus the inputs, so a test can assert both what was asked for and what happened. */
110
+ export interface InjectStorageStateCall {
111
+ readonly origin: string;
112
+ readonly state: BrowserStorageState;
113
+ readonly result: StorageStateInjectionResult;
57
114
  }
58
115
  export declare function createFakeBrowserDriver(): FakeBrowserDriver;
59
116
  //# sourceMappingURL=fake-driver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fake-driver.d.ts","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA;;;yFAGyF;AAIzF,OAAO,EAGL,KAAK,aAAa,EAKlB,KAAK,mBAAmB,EAGxB,KAAK,eAAe,EAIrB,MAAM,aAAa,CAAC;AAErB;;2EAE2E;AAC3E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,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AChE,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7D;;oCAEgC;IAChC,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,sBAAsB,EAAE,GAAG,SAAS,CAAC;CAC9F;AAED,+PAA+P;AAC/P,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;CAC9C;AAuED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAkW3D"}
@@ -3,12 +3,88 @@
3
3
  * `browser-driver-contract.test.ts` runs the same assertions against it as the real driver.
4
4
  * Non-goals: no simulated DOM (pages are declared via `setPage`), no classification. */
5
5
  import { randomUUID } from "node:crypto";
6
- import { BrowserSessionCrashedError, UnknownElementRefError, } from "./driver.js";
6
+ import { BrowserSessionCrashedError, NO_HIDDEN_REACH, NoSuchOptionError, NotSelectableError, NotSubmittableError, UnknownElementRefError, } from "./driver.js";
7
+ import { clampWaitTimeout, describeWaitTarget, isEmptyWaitTarget, matchesWaitTarget, WAIT_POLL_INTERVAL_MS, } from "./wait-target.js";
8
+ /** Everything a fingerprint counts, at zero. A declared fingerprint is merged over this. */
9
+ const NO_RISKS = {
10
+ url: "",
11
+ interactiveElements: 0,
12
+ openShadowRoots: 0,
13
+ shadowInteractiveElements: 0,
14
+ childFrames: 0,
15
+ crossOriginChildFrames: 0,
16
+ scrollableRegions: 0,
17
+ canvasViewportShare: 0,
18
+ largestCanvasArea: 0,
19
+ fixedOverlays: 0,
20
+ inertSubtrees: 0,
21
+ openModalDialogs: 0,
22
+ passwordFields: 0,
23
+ oneTimeCodeFields: 0,
24
+ challengeMarkers: [],
25
+ clientSideRouting: null,
26
+ documentHeightRatio: 1,
27
+ };
7
28
  const EMPTY_PAGE = (url) => ({ url, title: "", elements: [] });
29
+ /** Main document first, then every frame the page presented, then every frame it could not read. */
30
+ function fakeFrames(elements, page) {
31
+ const reach = [
32
+ { frame: null, enumerated: true, elements: elements.filter((e) => e.frame === null).length, reason: null },
33
+ ];
34
+ const seen = new Set();
35
+ for (const element of elements) {
36
+ if (element.frame === null || seen.has(element.frame.id))
37
+ continue;
38
+ seen.add(element.frame.id);
39
+ reach.push({
40
+ frame: element.frame,
41
+ enumerated: true,
42
+ elements: elements.filter((e) => e.frame?.id === element.frame?.id).length,
43
+ reason: null,
44
+ });
45
+ }
46
+ for (const unreachable of page.unreachableFrames ?? []) {
47
+ reach.push({ frame: unreachable.frame, enumerated: false, elements: 0, reason: unreachable.reason });
48
+ }
49
+ return reach;
50
+ }
51
+ function fakeShadow(elements, page) {
52
+ const pierced = elements.filter((e) => e.inShadowRoot);
53
+ return {
54
+ piercedElements: pierced.length,
55
+ ambiguousInDocument: pierced.filter((e) => e.selector === null && e.frame === null).length,
56
+ suspectedClosedHosts: page.suspectedClosedHosts ?? 0,
57
+ // The fake is told the number rather than probing for it, so it always "probed".
58
+ probed: true,
59
+ };
60
+ }
61
+ function fakeReveal(page) {
62
+ const frames = new Set();
63
+ for (const element of page.elements)
64
+ if (element.frame !== undefined)
65
+ frames.add(element.frame.name ?? element.frame.id);
66
+ return {
67
+ passes: 1,
68
+ revealedElements: page.elements.filter((e) => e.revealedByScroll === true).length,
69
+ recycledElements: page.elements.filter((e) => e.recycledByScroll === true).length,
70
+ stoppedAtCap: false,
71
+ // The fake has no DOM, so it has no containers to scroll and says so rather than guessing.
72
+ containersScrolled: 0,
73
+ // The fake has no viewport; a scroll position it invented would be a fact nothing produced.
74
+ finalScrollY: 0,
75
+ framesNotScrolled: [...frames],
76
+ reason: null,
77
+ };
78
+ }
8
79
  export function createFakeBrowserDriver() {
9
80
  const pages = new Map();
10
81
  const states = new Map();
11
82
  const storageStateReceived = new Map();
83
+ const headersReceived = new Map();
84
+ const savePathReceived = new Map();
85
+ /** Every `injectStorageState()` call a session actually received, in order — what a
86
+ * sign-in-step test asserts reached the driver rather than being dropped en route. */
87
+ const injectStorageStateCalls = new Map();
12
88
  let chromiumMissing = null;
13
89
  // Monotonic across the driver, so a ref from one session can never resolve
14
90
  // in another — the same property real refs have by being page-scoped.
@@ -26,6 +102,9 @@ export function createFakeBrowserDriver() {
26
102
  requests: state.buffer.requests,
27
103
  // The fake page has no network, so nothing can be left in flight.
28
104
  unsettled: [],
105
+ // The fake builds its own records directly; nothing crosses the untyped
106
+ // collector boundary that `evidenceWarnings` reports on.
107
+ evidenceWarnings: [],
29
108
  };
30
109
  state.buffer.actions = [];
31
110
  state.buffer.consoleErrors = [];
@@ -75,16 +154,60 @@ export function createFakeBrowserDriver() {
75
154
  record("navigate", null);
76
155
  recordPerformed("navigate", null, to, null);
77
156
  },
78
- async snapshot() {
157
+ async snapshot(options) {
79
158
  assertUsable();
80
159
  const page = pages.get(url) ?? EMPTY_PAGE(url);
160
+ const revealing = options?.reveal === true;
161
+ // What the page presents *now*: without a reveal pass the lazily-rendered rows are not
162
+ // there yet; with one they are, and the virtualized rows it scrolled past are gone.
163
+ const present = page.elements.filter((e) => revealing ? e.recycledByScroll !== true : e.revealedByScroll !== true);
81
164
  snapshotGeneration += 1;
82
- refs = new Map(page.elements.map((element, index) => {
165
+ refs = new Map(present.map((element, index) => {
83
166
  const ref = `ref-${snapshotGeneration}-${index}`;
84
- return [ref, { ref, role: element.role, name: element.name, selector: element.selector }];
167
+ const frame = element.frame ?? null;
168
+ return [
169
+ ref,
170
+ {
171
+ ref,
172
+ role: element.role,
173
+ name: element.name,
174
+ // The port's rule, enforced here so the contract test can assert it of both drivers.
175
+ selector: frame === null ? element.selector : null,
176
+ frame,
177
+ inShadowRoot: element.inShadowRoot === true,
178
+ // Grounding resolves a *document* selector; a framed element has none (same
179
+ // reasoning as `selector` above), and an unconfigured session never attempted it.
180
+ identity: frame === null ? (element.identity ?? null) : null,
181
+ ...(element.options === undefined ? {} : { options: element.options }),
182
+ ...(element.submits === undefined ? {} : { submits: element.submits }),
183
+ },
184
+ ];
185
+ }));
186
+ // Reach is computed off the full refs, which carry the fake's private declarations;
187
+ // what is returned is the port's own shape. `options`/`submits` are the fake's
188
+ // bookkeeping and must not leak into what a caller sees a snapshot return.
189
+ const held = [...refs.values()];
190
+ const elements = held.map((e) => ({
191
+ ref: e.ref,
192
+ role: e.role,
193
+ name: e.name,
194
+ selector: e.selector,
195
+ identity: e.identity,
196
+ frame: e.frame,
197
+ inShadowRoot: e.inShadowRoot,
85
198
  }));
86
- const elements = [...refs.values()];
87
- return { url, title: page.title, elements, totalElements: elements.length };
199
+ return {
200
+ url,
201
+ title: page.title,
202
+ elements,
203
+ totalElements: elements.length,
204
+ frames: fakeFrames(held, page),
205
+ shadow: fakeShadow(held, page),
206
+ // The fake page is a list of elements, not a rendering of one: every element it holds
207
+ // is one a test put there, so nothing is withheld and nothing went unanswered.
208
+ hidden: NO_HIDDEN_REACH,
209
+ reveal: revealing ? fakeReveal(page) : null,
210
+ };
88
211
  },
89
212
  async click(ref) {
90
213
  assertUsable();
@@ -104,6 +227,85 @@ export function createFakeBrowserDriver() {
104
227
  record("fill", ref, "replace");
105
228
  recordPerformed("fill", { role: element.role, name: element.name, selector: element.selector }, null, text);
106
229
  },
230
+ async select(ref, value) {
231
+ assertUsable();
232
+ const element = resolve(ref);
233
+ if (element.options === undefined)
234
+ throw new NotSelectableError(ref, element.role);
235
+ // Exact, and nothing else. A near match would choose an option the caller did not name.
236
+ if (!element.options.includes(value))
237
+ throw new NoSuchOptionError(ref, value, element.options);
238
+ record("select", ref, "replace");
239
+ recordPerformed("select", { role: element.role, name: element.name, selector: element.selector }, null, value);
240
+ },
241
+ async submit(ref) {
242
+ assertUsable();
243
+ const element = resolve(ref);
244
+ // The fake has no DOM, so it cannot tell "no form" from "form with no control" —
245
+ // it declares one reason and the contract asserts only the error type. The real
246
+ // driver distinguishes them because it can.
247
+ if (element.submits !== true)
248
+ throw new NotSubmittableError(ref, "noForm");
249
+ record("submit", ref, null);
250
+ recordPerformed("submit", { role: element.role, name: element.name, selector: element.selector }, null, null);
251
+ },
252
+ async waitFor(target, waitOptions = {}) {
253
+ assertUsable();
254
+ if (isEmptyWaitTarget(target)) {
255
+ throw new Error("browser_wait_for needs a target: give a role, a name, or both. Waiting for nothing in particular " +
256
+ `would return the first element on the page, which is not what any caller means. Got: ${describeWaitTarget(target)}.`);
257
+ }
258
+ const timeoutMs = clampWaitTimeout(waitOptions.timeoutMs);
259
+ const startedAt = Date.now();
260
+ for (;;) {
261
+ assertUsable();
262
+ // Re-snapshots each poll, so refs are re-issued — the same invalidation a real
263
+ // page change forces, rather than a cheaper lie.
264
+ const snapshot = await session.snapshot();
265
+ const matches = snapshot.elements.filter((e) => matchesWaitTarget(e, target));
266
+ const waitedMs = Date.now() - startedAt;
267
+ if (matches.length > 0) {
268
+ return { appeared: true, waitedMs, timeoutMs, matched: matches[0], matchCount: matches.length, snapshot };
269
+ }
270
+ if (waitedMs >= timeoutMs) {
271
+ return { appeared: false, waitedMs, timeoutMs, matched: null, matchCount: 0, snapshot };
272
+ }
273
+ await new Promise((done) => setTimeout(done, WAIT_POLL_INTERVAL_MS));
274
+ }
275
+ },
276
+ async injectStorageState(origin, state) {
277
+ assertUsable();
278
+ const cookies = state.cookies ?? [];
279
+ const storedEntries = Object.entries(state.localStorage ?? {});
280
+ let localStorageInjected = 0;
281
+ let localStorageSkipped = null;
282
+ if (storedEntries.length > 0) {
283
+ // Same honest degradation the real driver's runtime primitive
284
+ // applies: localStorage can only be written for the origin the
285
+ // page is actually on, and the fake's "page" is just `url`.
286
+ let currentOrigin = null;
287
+ try {
288
+ currentOrigin = new URL(url).origin;
289
+ }
290
+ catch {
291
+ currentOrigin = null;
292
+ }
293
+ if (currentOrigin === origin) {
294
+ localStorageInjected = storedEntries.length;
295
+ }
296
+ else {
297
+ localStorageSkipped =
298
+ `the page is currently on ${currentOrigin ?? "an origin that could not be read from its URL"}, not ` +
299
+ `${origin} -- localStorage can only be written for the origin a page is actually showing, so ` +
300
+ `${storedEntries.length} ${storedEntries.length === 1 ? "entry was" : "entries were"} not injected. ` +
301
+ "Navigate to that origin first, then call injectStorageState again.";
302
+ }
303
+ }
304
+ const result = { cookiesInjected: cookies.length, localStorageInjected, localStorageSkipped };
305
+ const existing = injectStorageStateCalls.get(sessionId) ?? [];
306
+ injectStorageStateCalls.set(sessionId, [...existing, { origin, state, result }]);
307
+ return result;
308
+ },
107
309
  async drainEvidence() {
108
310
  // Deliberately usable on a crashed session: the whole point of the
109
311
  // flush-on-every-path rule is that a crash must not take the evidence
@@ -119,8 +321,22 @@ export function createFakeBrowserDriver() {
119
321
  return drain(state);
120
322
  },
121
323
  };
122
- states.set(sessionId, { session, buffer, crashed: false, closed: false });
123
- return session;
324
+ // Spread in rather than declared inline: the port's `fingerprint` is optional
325
+ // *as a member*, and a page that declared none must leave a session on which
326
+ // `fingerprint === undefined`, not one whose method returns nothing.
327
+ // Whether the method *exists* is decided once, from the page this session
328
+ // opened on: a driver either probes or it does not, and that must not flicker
329
+ // mid-session. What it *answers* is read at call time from wherever the
330
+ // session currently is.
331
+ const probes = pages.get(targetUrl)?.fingerprint !== undefined;
332
+ const withProbe = probes
333
+ ? {
334
+ ...session,
335
+ fingerprint: async () => ({ ...NO_RISKS, ...(pages.get(url)?.fingerprint ?? {}), url }),
336
+ }
337
+ : session;
338
+ states.set(sessionId, { session: withProbe, buffer, crashed: false, closed: false });
339
+ return withProbe;
124
340
  }
125
341
  return {
126
342
  async launch(options) {
@@ -136,6 +352,8 @@ export function createFakeBrowserDriver() {
136
352
  }
137
353
  const session = openSession(options.targetUrl);
138
354
  storageStateReceived.set(session.sessionId, options.storageState);
355
+ headersReceived.set(session.sessionId, options.extraHttpHeaders);
356
+ savePathReceived.set(session.sessionId, options.saveStorageStateTo);
139
357
  return { launched: true, session };
140
358
  },
141
359
  setPage(url, page) {
@@ -184,6 +402,15 @@ export function createFakeBrowserDriver() {
184
402
  storageStateReceivedFor(sessionId) {
185
403
  return storageStateReceived.get(sessionId);
186
404
  },
405
+ extraHttpHeadersReceivedFor(sessionId) {
406
+ return headersReceived.get(sessionId);
407
+ },
408
+ saveStorageStateToFor(sessionId) {
409
+ return savePathReceived.get(sessionId);
410
+ },
411
+ injectStorageStateCallsFor(sessionId) {
412
+ return injectStorageStateCalls.get(sessionId);
413
+ },
187
414
  };
188
415
  }
189
416
  //# sourceMappingURL=fake-driver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fake-driver.js","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA;;;yFAGyF;AAEzF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAavB,MAAM,aAAa,CAAC;AAyDrB,MAAM,UAAU,GAAG,CAAC,GAAW,EAAY,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAEjF,MAAM,UAAU,uBAAuB;IACrC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IACnD,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA2C,CAAC;IAChF,IAAI,eAAe,GAA8B,IAAI,CAAC;IACtD,2EAA2E;IAC3E,sEAAsE;IACtE,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAE3B,SAAS,OAAO,CAAC,SAAiB;QAChC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;QAC/E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,KAAK,CAAC,KAAuB;QACpC,MAAM,WAAW,GAAuB;YACtC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,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AG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,uBAAuB,CAAC,SAAiB;YACvC,OAAO,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,2BAA2B,CAAC,SAAiB;YAC3C,OAAO,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxC,CAAC;QACD,qBAAqB,CAAC,SAAiB;YACrC,OAAO,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QACD,0BAA0B,CAAC,SAAiB;YAC1C,OAAO,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * When a browser action fails: whose fault was it?
3
+ *
4
+ * ## This concept did not already exist
5
+ *
6
+ * `browser-reliability.md` §4.5 says "the product already carries this
7
+ * concept". Checked before building: it does not. `descry-runtime` has four
8
+ * incidental uses of the word "attributable" — a log envelope naming its
9
+ * unwrapper, evidence carrying a process id, a correlator comment about not
10
+ * blaming a producer, a test runner locating a fact — and no fault-domain type,
11
+ * no owner vocabulary and nothing that decides between them. The nearest real
12
+ * neighbours are `@descryy/ir`'s five **result states** and five **report
13
+ * categories**, and both answer a different question: they say how much Descry
14
+ * can claim, never who broke it. So this is new, and it is deliberately shaped
15
+ * like its neighbours — a small closed vocabulary, one function that decides,
16
+ * and an explicit value for "do not know".
17
+ *
18
+ * ## The one rule everything else serves
19
+ *
20
+ * **A timeout with nothing corroborating it is never the application's fault.**
21
+ * A wait that expired is a fact about Descry: the page did not reach a state
22
+ * Descry was waiting for, within a budget Descry chose. It is equally
23
+ * consistent with a broken button, a slow one, an overlay, and an animation.
24
+ * Reporting it as the user's bug is the single fastest way to make a testing
25
+ * tool untrusted, and the cost of being wrong is asymmetric — an
26
+ * `undetermined` that was really a bug costs one missed finding, and an
27
+ * `application` that was really our timeout costs the tool's credibility.
28
+ * That is rule 2 (precision over recall) applied to blame rather than to edges.
29
+ *
30
+ * So `application` is only ever named with a **first-party corroborating
31
+ * signal** in the same window: the page threw, or a request to the
32
+ * application's own origin failed. Never on the timeout alone.
33
+ *
34
+ * ## Where the corroborating signal comes from (C3)
35
+ *
36
+ * It does not exist yet when the failure happens. The recording decorator sees
37
+ * the throw and must not drain evidence to enrich it — evidence is drained, not
38
+ * peeked, and reading it there would steal what the calling tool is about to
39
+ * report. So `attributeActionFailure` runs on the error and the clock alone and
40
+ * most real failures start `undetermined`, which is the honest answer to what
41
+ * it was given. `evidenceInWindow` and `refineAttribution` below are the second
42
+ * half: the next drain of that session hands over what the page actually
43
+ * produced, the counts are narrowed to the failed action's own window, and the
44
+ * attribution is re-decided once. Wired at the two places a drain happens —
45
+ * `observeAndCorrelate` for every evidence-bearing tool call, and the
46
+ * registry's `reap` for the tail no tool call ever returns.
47
+ */
48
+ import { type BrowserObservation } from "./driver.ts";
49
+ /**
50
+ * The four fault domains, plus the fifth value that keeps the other four
51
+ * honest. `undetermined` is not a failure to classify — it is the correct
52
+ * answer whenever the evidence does not reach one of the four, and a
53
+ * vocabulary without it would force every case into a guess.
54
+ */
55
+ export declare const FAULT_OWNERS: readonly ["application", "automation", "environment", "dependency", "undetermined"];
56
+ export type FaultOwner = (typeof FAULT_OWNERS)[number];
57
+ export interface FaultAttribution {
58
+ readonly owner: FaultOwner;
59
+ /** What happened, in the report's voice. Never an accusation. */
60
+ readonly reason: string;
61
+ /** What was observed that led here. Deliberately distinct from `reason`: a
62
+ * reader who disagrees with the attribution must be able to see the input
63
+ * that produced it without re-running anything. */
64
+ readonly evidence: string;
65
+ }
66
+ /** Everything known about one failed action at the moment it failed. */
67
+ export interface ActionFailure {
68
+ readonly verb: string;
69
+ readonly error: unknown;
70
+ /** How long the action ran before throwing. */
71
+ readonly elapsedMs: number;
72
+ /** Console errors the page produced in the same window. */
73
+ readonly pageErrors: number;
74
+ /** Requests that failed in the same window. */
75
+ readonly failedRequests: number;
76
+ /** How many of those were to an origin other than the application's own. */
77
+ readonly thirdPartyFailedRequests: number;
78
+ }
79
+ export declare function attributeActionFailure(failure: ActionFailure): FaultAttribution;
80
+ /** The bounds of one failed action, in epoch milliseconds: when the verb was
81
+ * called and when it threw. Evidence outside them is about something else. */
82
+ export interface ActionWindow {
83
+ readonly from: number;
84
+ readonly to: number;
85
+ }
86
+ /** What `evidenceInWindow` found — the three counts `ActionFailure` could not
87
+ * carry at the moment of failure. */
88
+ export interface LaterEvidence {
89
+ readonly pageErrors: number;
90
+ readonly failedRequests: number;
91
+ readonly thirdPartyFailedRequests: number;
92
+ }
93
+ /**
94
+ * Counts, out of one drained observation, only what happened **inside a failed
95
+ * action's own window**.
96
+ *
97
+ * ## Why the window, and not the drain
98
+ *
99
+ * A drain is not a window. A drained observation covers everything since the
100
+ * last drain, which — because a failed verb throws and the tool never gets to
101
+ * drain — routinely includes a later, unrelated action. Counting the whole
102
+ * drain would let a console error caused by the *next* click decide who broke
103
+ * the previous one, and it would say so in the report's voice. The action's own
104
+ * start and end are recorded by the decorator for exactly this, and everything
105
+ * outside them is discarded rather than discounted.
106
+ *
107
+ * ## What is excluded, and why each exclusion goes the same way
108
+ *
109
+ * A timestamp that will not parse, a request URL that will not parse, and an
110
+ * `unattributed` request all resolve *away* from `application`. That is not
111
+ * symmetry for its own sake: the asymmetric cost this module was built around
112
+ * says an `undetermined` that was really a bug costs one finding, and an
113
+ * `application` that was really Descry's own timeout costs the tool. So an
114
+ * unreadable URL is counted as third-party (it cannot name the application), an
115
+ * unreadable timestamp is counted as outside the window, and a request whose
116
+ * terminal event could not be assigned to it is not counted as a failure at
117
+ * all — otherwise C3's own refusal to guess a join would come straight back as
118
+ * a guess about blame.
119
+ */
120
+ export declare function evidenceInWindow(observation: Pick<BrowserObservation, "consoleErrors" | "requests">, window: ActionWindow, applicationOrigin: string): LaterEvidence;
121
+ /**
122
+ * Re-decide an attribution once evidence that was not available at the moment
123
+ * of failure has arrived. Only ever called on `undetermined`: an attribution
124
+ * that already reached one of the four rested on a signal this later evidence
125
+ * cannot withdraw, and silently rewriting it would make the same failure read
126
+ * two ways in two replies.
127
+ */
128
+ export declare function refineAttribution(attribution: FaultAttribution, failure: ActionFailure, later: LaterEvidence): FaultAttribution;
129
+ export declare function faultNote(attribution: FaultAttribution): string;
130
+ /**
131
+ * RG-12(b): the vocabulary reconciliation. The site names three layers to a
132
+ * user — "your product", "your environment", "a dependency" — and this
133
+ * module's own five values are `application`, `automation`, `environment`,
134
+ * `dependency`, `undetermined`. Two real gaps, not one:
135
+ *
136
+ * 1. `automation` (Descry's *own* fault — a bad ref, a stale handle, a
137
+ * harness bug) has nowhere to go in the site's three layers, and it is
138
+ * the one value that most protects a user's trust: folding it into
139
+ * "your environment" would let Descry's own mistake read as the user's
140
+ * infrastructure being at fault, which is backwards.
141
+ * 2. `undetermined` has nowhere to go either, and collapsing it into any of
142
+ * the three would state a layer the evidence did not actually reach.
143
+ *
144
+ * **Recommendation (implemented here, not on the site — that copy is a
145
+ * different lane's to change): the site gains a fourth and fifth category
146
+ * rather than losing this module's granularity.** "Descry itself" for
147
+ * `automation` (visible, not hidden — this is the layer that most needs to
148
+ * be named when the tool is the one that got it wrong) and "not
149
+ * determined" for `undetermined` (an honest refusal is not a hidden
150
+ * failure). No code value is deleted to fit the narrower copy; this
151
+ * function is the one place that maps the closed five-value set onto
152
+ * display text, so a copy change only ever touches this map.
153
+ */
154
+ export declare const FAULT_OWNER_DISPLAY_LABELS: Readonly<Record<FaultOwner, string>>;
155
+ /**
156
+ * RG-12(c): the type-level half of "every failure carries a layer, by
157
+ * construction, not by convention." A `switch` with no `default` fails to
158
+ * compile the moment `FAULT_OWNERS` gains or loses a value without this
159
+ * function being updated to match — the same guarantee `ActionRecord`'s
160
+ * discriminated union (`reachability.ts`) gives the *presence* of an
161
+ * attribution; this is what gives the *display* side the same guarantee.
162
+ */
163
+ export declare function faultOwnerDisplayLabel(owner: FaultOwner): string;
164
+ /**
165
+ * RG-12(c): the run-level half. Not a convention check — `ActionRecord`'s
166
+ * discriminated union already makes `{ succeeded: false, attribution: null }`
167
+ * uncoinstructable inside this module. This is the belt for a caller
168
+ * reaching in from outside the type system (a cast, a deserialised record,
169
+ * a future refactor that widens the type back out) — the same "trust but
170
+ * verify" `report()`'s own filter used to need before the union made it
171
+ * unnecessary there. Throws by name rather than silently dropping the
172
+ * finding, which is the failure mode this whole item exists to close.
173
+ */
174
+ export declare function assertEveryFailureAttributed(actions: readonly {
175
+ readonly succeeded: boolean;
176
+ readonly attribution?: FaultAttribution | null;
177
+ }[]): void;
178
+ //# sourceMappingURL=fault-attribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fault-attribution.d.ts","sourceRoot":"","sources":["../../src/browser/fault-attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAuE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE3H;;;;;GAKG;AACH,eAAO,MAAM,YAAY,qFAAsF,CAAC;AAEhH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;wDAEoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,K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