@alwaysmeticulous/sdk-bundles-api 2.276.2 → 2.280.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.
@@ -0,0 +1,3 @@
1
+ export interface BackendRecorderHandle {
2
+ stopRecording: () => Promise<void>;
3
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fd2bca20-a220-5f4e-a17f-ccd7d02fceda")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=init-backend-recorder.js.map
6
+ //# debugId=fd2bca20-a220-5f4e-a17f-ccd7d02fceda
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-backend-recorder.js","sources":["../../../src/backend-recorder/bundle-to-sdk/init-backend-recorder.ts"],"sourceRoot":"","names":[],"mappings":"","debugId":"fd2bca20-a220-5f4e-a17f-ccd7d02fceda"}
@@ -0,0 +1,14 @@
1
+ export interface BackendRecorderConfig {
2
+ /** Enable/disable the recorder. Defaults to `true`. */
3
+ enabled?: boolean;
4
+ /** The name of the Meticulous project. */
5
+ meticulousProjectName?: string;
6
+ /** Token used to authenticate span uploads. */
7
+ recordingToken?: string;
8
+ /** Where to export spans. Defaults to `"local"`. */
9
+ exportMode?: "local" | "s3";
10
+ /** Directory for local exports. Only used when `exportMode` is `"local"`. */
11
+ localOutputDir?: string;
12
+ /** How often to flush spans, in milliseconds. */
13
+ flushIntervalMs?: number;
14
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e1e04efa-0626-5977-b3db-6efab04fc331")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=init-backend-recorder.js.map
6
+ //# debugId=e1e04efa-0626-5977-b3db-6efab04fc331
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-backend-recorder.js","sources":["../../../src/backend-recorder/sdk-to-bundle/init-backend-recorder.ts"],"sourceRoot":"","names":[],"mappings":"","debugId":"e1e04efa-0626-5977-b3db-6efab04fc331"}
package/dist/index.d.ts CHANGED
@@ -10,5 +10,7 @@ export { InProgressTestRun } from "./replay-orchestrator/bundle-to-sdk/execute-s
10
10
  export { InProgressTestRunChunk, ExecuteTestRunChunkResult, TestRunChunkExecution, } from "./replay-orchestrator/bundle-to-sdk/execute-scheduled-test-run-chunk";
11
11
  export { ReplayAndStoreResultsResult, ReplayExecution, BeforeUserEventResult, IndexedReplayableEvent, } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
12
12
  export { ScreenshotDiffData } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
13
- export { MeticulousPublicApi } from "./window-api/public-window-api";
13
+ export { MeticulousPublicApi, MeticulousPressureObserver, MeticulousPressureObserverConstructor, MeticulousPressureRecord, MeticulousPressureSource, MeticulousPressureState, } from "./window-api/public-window-api";
14
14
  export { MeticulousPrivateApi } from "./window-api/private-window-api";
15
+ export { BackendRecorderConfig } from "./backend-recorder/sdk-to-bundle/init-backend-recorder";
16
+ export { BackendRecorderHandle } from "./backend-recorder/bundle-to-sdk/init-backend-recorder";
@@ -133,6 +133,25 @@ export interface MeticulousPublicReplayApi {
133
133
  * @see https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
134
134
  */
135
135
  PerformanceObserver: typeof window.PerformanceObserver;
136
+ /**
137
+ * The native PressureObserver constructor from the Compute Pressure API,
138
+ * captured before any stubbing. Use this to observe CPU (and, where
139
+ * supported by the browser, thermal) pressure during a replay.
140
+ *
141
+ * Only defined in browsers that implement the Compute Pressure API
142
+ * (Chromium-based browsers at the time of writing). Undefined in other
143
+ * browsers; always check before use.
144
+ *
145
+ * Note: the browser does not expose a direct CPU usage percentage. The
146
+ * observer callback receives categorical pressure records with a `state`
147
+ * of `"nominal" | "fair" | "serious" | "critical"`. The pressure signal
148
+ * reflects system-wide pressure, affected by other apps and other tabs,
149
+ * so treat it as a noisy signal and aggregate over many replays.
150
+ *
151
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PressureObserver
152
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Compute_Pressure_API
153
+ */
154
+ PressureObserver?: MeticulousPressureObserverConstructor;
136
155
  };
137
156
  /**
138
157
  * Information about the commit being tested.
@@ -247,3 +266,54 @@ export interface MeticulousPublicContextApi {
247
266
  success: boolean;
248
267
  };
249
268
  }
269
+ /**
270
+ * Source that a {@link MeticulousPressureObserver} can observe. The set of
271
+ * sources a browser supports is exposed on
272
+ * {@link MeticulousPressureObserverConstructor.knownSources}.
273
+ *
274
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Compute_Pressure_API
275
+ */
276
+ export type MeticulousPressureSource = "cpu" | "thermals";
277
+ /**
278
+ * Categorical pressure state reported by a {@link MeticulousPressureObserver}.
279
+ * The browser deliberately does not expose a numeric CPU usage percentage; this
280
+ * coarse state is the only pressure signal available to page JavaScript.
281
+ *
282
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PressureRecord/state
283
+ */
284
+ export type MeticulousPressureState = "nominal" | "fair" | "serious" | "critical";
285
+ /**
286
+ * A single pressure sample delivered to a {@link MeticulousPressureObserver}
287
+ * callback.
288
+ *
289
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PressureRecord
290
+ */
291
+ export interface MeticulousPressureRecord {
292
+ source: MeticulousPressureSource;
293
+ state: MeticulousPressureState;
294
+ time: DOMHighResTimeStamp;
295
+ }
296
+ /**
297
+ * Minimal shape of a PressureObserver instance. Defined locally because the
298
+ * Compute Pressure API is not yet present in TypeScript's `lib.dom.d.ts`.
299
+ *
300
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PressureObserver
301
+ */
302
+ export interface MeticulousPressureObserver {
303
+ observe(source: MeticulousPressureSource, options?: {
304
+ sampleInterval?: number;
305
+ }): Promise<void>;
306
+ unobserve(source: MeticulousPressureSource): void;
307
+ disconnect(): void;
308
+ takeRecords(): MeticulousPressureRecord[];
309
+ }
310
+ /**
311
+ * Minimal shape of the PressureObserver constructor. Defined locally because
312
+ * the Compute Pressure API is not yet present in TypeScript's `lib.dom.d.ts`.
313
+ *
314
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PressureObserver/PressureObserver
315
+ */
316
+ export interface MeticulousPressureObserverConstructor {
317
+ new (callback: (records: MeticulousPressureRecord[], observer: MeticulousPressureObserver) => void): MeticulousPressureObserver;
318
+ readonly knownSources: readonly MeticulousPressureSource[];
319
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/sdk-bundles-api",
3
- "version": "2.276.2",
3
+ "version": "2.280.0",
4
4
  "description": "Meticulous common types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "depcheck": "depcheck --ignore-patterns=dist"
20
20
  },
21
21
  "dependencies": {
22
- "@alwaysmeticulous/api": "2.276.2"
22
+ "@alwaysmeticulous/api": "2.280.0"
23
23
  },
24
24
  "author": {
25
25
  "name": "The Meticulous Team",
@@ -38,5 +38,5 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
40
40
  },
41
- "gitHead": "01bc1fa14391f4a39322c7a70e5f51b5ebb45032"
41
+ "gitHead": "87ca975a232d16ea878caa5649a8b21221ebca02"
42
42
  }