saltfish 0.3.73 → 0.3.74

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.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * DOM Snapshot Capture
3
+ *
4
+ * Captures DOM snapshots using rrweb-snapshot for debugging element finding failures.
5
+ * Loads rrweb-snapshot from Saltfish CDN to avoid adding to bundle size - only loaded when needed.
6
+ * Hosted on Saltfish domain to work with customer CSP rules that whitelist *.saltfish.ai
7
+ */
8
+ export type DOMSnapshot = Record<string, unknown>;
9
+ /**
10
+ * Captures a snapshot of the current DOM state.
11
+ * Loads rrweb-snapshot from Saltfish CDN to keep bundle size zero.
12
+ *
13
+ * @returns Serialized DOM snapshot or null if capture fails
14
+ */
15
+ export declare function captureDOMSnapshot(): Promise<DOMSnapshot | null>;
16
+ /**
17
+ * Captures a snapshot and serializes it to a JSON string.
18
+ * Useful for sending to API endpoints.
19
+ *
20
+ * @returns JSON string of DOM snapshot or null if capture fails
21
+ */
22
+ export declare function captureDOMSnapshotAsString(): Promise<string | null>;
23
+ //# sourceMappingURL=domSnapshotCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domSnapshotCapture.d.ts","sourceRoot":"","sources":["../../src/utils/domSnapshotCapture.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAIlD;;;;;GAKG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAUtE;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYzE"}
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * Reports element finding failures to the backend API for tracking.
5
5
  * Used when cursor/transition element finding fails after all retries.
6
+ *
7
+ * Captures a DOM snapshot using rrweb-snapshot for all failures,
8
+ * allowing reconstruction of the page state for debugging.
6
9
  */
7
10
  import type { ExpectedElement, ExpectedSize } from './elementSizeValidator';
8
11
  export type ElementErrorReason = 'no_elements' | 'tag_mismatch' | 'text_mismatch' | 'size_mismatch';
@@ -11,10 +14,14 @@ export interface ElementErrorPayload {
11
14
  stepId: string;
12
15
  failureReason: ElementErrorReason;
13
16
  selector: string;
17
+ domSnapshot?: string;
14
18
  }
15
19
  /**
16
20
  * Reports an element finding error to the backend.
17
21
  * Fire-and-forget - does not block or throw.
22
+ *
23
+ * Always captures a DOM snapshot to allow reconstruction of the page state
24
+ * for debugging, regardless of failure type.
18
25
  */
19
26
  export declare function reportElementError(playlistId: string, stepId: string, selector: string, expectedElement?: ExpectedElement, expectedSize?: ExpectedSize): void;
20
27
  //# sourceMappingURL=elementErrorReporter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementErrorReporter.d.ts","sourceRoot":"","sources":["../../src/utils/elementErrorReporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAEpG,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAyCD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,YAAY,GAC1B,IAAI,CAqBN"}
1
+ {"version":3,"file":"elementErrorReporter.d.ts","sourceRoot":"","sources":["../../src/utils/elementErrorReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAEpG,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAyCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,YAAY,GAC1B,IAAI,CA+BN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saltfish",
3
- "version": "0.3.73",
3
+ "version": "0.3.74",
4
4
  "description": "An interactive video-guided tour system for web applications",
5
5
  "main": "dist/saltfish-playlist-player.umd.js",
6
6
  "types": "dist/index.d.ts",