@utk09/ui-observability 0.4.1 → 0.6.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 (103) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +114 -59
  3. package/dist/bus/bus.d.ts +10 -10
  4. package/dist/bus/links.d.ts +1 -1
  5. package/dist/bus-BTMuVkDk.js +378 -0
  6. package/dist/bus-BTMuVkDk.js.map +1 -0
  7. package/dist/bus-ChIXDAWD.cjs +2 -0
  8. package/dist/bus-ChIXDAWD.cjs.map +1 -0
  9. package/dist/capture/network.d.ts +2 -2
  10. package/dist/capture/types.d.ts +10 -10
  11. package/dist/capture/web-vitals.d.ts +7 -4
  12. package/dist/{constants-DVbpJ1tv.js → constants-0-YchbAL.js} +9 -8
  13. package/dist/constants-0-YchbAL.js.map +1 -0
  14. package/dist/constants-TUFcy95w.cjs +2 -0
  15. package/dist/constants-TUFcy95w.cjs.map +1 -0
  16. package/dist/constants.d.ts +55 -40
  17. package/dist/core/breadcrumbs.d.ts +14 -14
  18. package/dist/core/config.d.ts +5 -4
  19. package/dist/core/context.d.ts +2 -2
  20. package/dist/core/diagnostics.d.ts +10 -9
  21. package/dist/core/journey.d.ts +28 -22
  22. package/dist/core/logger.d.ts +29 -10
  23. package/dist/core/pipeline.d.ts +34 -29
  24. package/dist/core/record.d.ts +6 -6
  25. package/dist/core/runtime.d.ts +119 -35
  26. package/dist/core/sampling.d.ts +15 -16
  27. package/dist/core/sender.d.ts +58 -0
  28. package/dist/errors-DRXBRqvm.cjs +3 -0
  29. package/dist/errors-DRXBRqvm.cjs.map +1 -0
  30. package/dist/errors-Dwm2SzBa.js +76 -0
  31. package/dist/errors-Dwm2SzBa.js.map +1 -0
  32. package/dist/index.cjs +1 -3
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.ts +6 -5
  35. package/dist/index.js +476 -2247
  36. package/dist/index.js.map +1 -1
  37. package/dist/indexeddb-storage-B5dwq4hW.cjs +2 -0
  38. package/dist/indexeddb-storage-B5dwq4hW.cjs.map +1 -0
  39. package/dist/{indexeddb-storage-B6uqejZb.js → indexeddb-storage-DjY4Ml6t.js} +18 -22
  40. package/dist/indexeddb-storage-DjY4Ml6t.js.map +1 -0
  41. package/dist/interactions-DVom6eYn.cjs +2 -0
  42. package/dist/interactions-DVom6eYn.cjs.map +1 -0
  43. package/dist/interactions-DZmLu7l2.js +67 -0
  44. package/dist/interactions-DZmLu7l2.js.map +1 -0
  45. package/dist/models/batch.d.ts +12 -9
  46. package/dist/models/bus.d.ts +12 -13
  47. package/dist/models/config.d.ts +84 -49
  48. package/dist/models/log-record.d.ts +12 -10
  49. package/dist/models/serializer.d.ts +3 -2
  50. package/dist/models/storage.d.ts +2 -2
  51. package/dist/network-C4d2uw2Z.js +111 -0
  52. package/dist/network-C4d2uw2Z.js.map +1 -0
  53. package/dist/network-CuqWadNn.cjs +2 -0
  54. package/dist/network-CuqWadNn.cjs.map +1 -0
  55. package/dist/platform-CXio0W2n.cjs +2 -0
  56. package/dist/platform-CXio0W2n.cjs.map +1 -0
  57. package/dist/platform-CY8S3hUs.js +48 -0
  58. package/dist/platform-CY8S3hUs.js.map +1 -0
  59. package/dist/sampling-CEthcmEX.cjs +2 -0
  60. package/dist/sampling-CEthcmEX.cjs.map +1 -0
  61. package/dist/sampling-CJsI_24L.js +251 -0
  62. package/dist/sampling-CJsI_24L.js.map +1 -0
  63. package/dist/sender-ByFAkXVd.cjs +3 -0
  64. package/dist/sender-ByFAkXVd.cjs.map +1 -0
  65. package/dist/sender-dpvR_bHM.js +907 -0
  66. package/dist/sender-dpvR_bHM.js.map +1 -0
  67. package/dist/storage/emergency-queue.d.ts +2 -2
  68. package/dist/storage/factory.d.ts +2 -1
  69. package/dist/storage/idb-driver.d.ts +19 -19
  70. package/dist/storage/indexeddb-storage.d.ts +18 -17
  71. package/dist/storage/keys.d.ts +1 -1
  72. package/dist/storage/local-storage.d.ts +19 -18
  73. package/dist/storage/memory-storage.d.ts +12 -11
  74. package/dist/transport/compression.d.ts +2 -2
  75. package/dist/transport/errors.d.ts +8 -7
  76. package/dist/transport/exit-flush.d.ts +27 -24
  77. package/dist/transport/http-transport.d.ts +19 -10
  78. package/dist/transport/retry-engine.d.ts +33 -28
  79. package/dist/transport/serializers/ecs.d.ts +1 -1
  80. package/dist/transport/serializers/otlp.d.ts +1 -1
  81. package/dist/transport/serializers/select.d.ts +8 -0
  82. package/dist/unref-16maCyKA.js +8 -0
  83. package/dist/unref-16maCyKA.js.map +1 -0
  84. package/dist/unref-CU9Nyz_9.cjs +2 -0
  85. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  86. package/dist/utils/console.d.ts +11 -3
  87. package/dist/utils/identity.d.ts +53 -8
  88. package/dist/utils/lock.d.ts +4 -4
  89. package/dist/utils/platform.d.ts +5 -3
  90. package/dist/utils/sanitize.d.ts +5 -2
  91. package/dist/utils/sequence.d.ts +2 -2
  92. package/dist/utils/tracing.d.ts +14 -12
  93. package/dist/web-vitals-B2FYsEAU.cjs +2 -0
  94. package/dist/web-vitals-B2FYsEAU.cjs.map +1 -0
  95. package/dist/web-vitals-DHZ0yA_H.js +51 -0
  96. package/dist/web-vitals-DHZ0yA_H.js.map +1 -0
  97. package/package.json +21 -11
  98. package/dist/constants-DVbpJ1tv.js.map +0 -1
  99. package/dist/constants-tQpoTzkY.cjs +0 -2
  100. package/dist/constants-tQpoTzkY.cjs.map +0 -1
  101. package/dist/indexeddb-storage-B6uqejZb.js.map +0 -1
  102. package/dist/indexeddb-storage-CgT1GLYj.cjs +0 -2
  103. package/dist/indexeddb-storage-CgT1GLYj.cjs.map +0 -1
@@ -8,39 +8,84 @@ export interface Identity {
8
8
  /** Unique execution realm identifier regenerated on every document load. */
9
9
  contextId: string;
10
10
  }
11
+ /** The three Storage methods that identity and journey code use. */
12
+ export interface KeyValueStore {
13
+ /**
14
+ * Reads one value.
15
+ * @param key Storage key.
16
+ * @returns Stored value, or null.
17
+ */
18
+ getItem(key: string): string | null;
19
+ /**
20
+ * Writes one value.
21
+ * @param key Storage key.
22
+ * @param value Value to write.
23
+ */
24
+ setItem(key: string, value: string): void;
25
+ /**
26
+ * Removes one value.
27
+ * @param key Storage key.
28
+ */
29
+ removeItem(key: string): void;
30
+ }
31
+ /** Stores for identity and journey keys. A getter can throw in a sandboxed frame. */
32
+ export interface IdentityStores {
33
+ /** Store that lasts across tabs and reloads. */
34
+ local(): KeyValueStore;
35
+ /** Store that lasts for one tab. */
36
+ session(): KeyValueStore;
37
+ }
38
+ /** Stores that write to the browser. The `identity: "storage"` option uses them. */
39
+ export declare const BROWSER_STORES: IdentityStores;
40
+ /**
41
+ * Creates stores that keep values in memory only. The `identity: "memory"` option uses them.
42
+ * @returns Stores that write nothing to the browser.
43
+ */
44
+ export declare function memoryStores(): IdentityStores;
11
45
  /**
12
46
  * Generates a random lowercase hexadecimal string of the specified byte length.
13
- * Uses crypto.getRandomValues when available, falling back to Math.random.
47
+ * It uses crypto.getRandomValues when it is available. Otherwise it uses Math.random.
14
48
  * @param byteLength Number of random bytes to generate.
15
49
  * @returns Hexadecimal string of length byteLength * 2.
16
50
  */
17
51
  export declare function randomHex(byteLength: number): string;
18
52
  /**
19
53
  * Generates a unique identifier string using crypto.randomUUID or randomHex fallback.
54
+ * @param diagnostics Diagnostics reporter. It counts a blocked crypto.randomUUID call.
20
55
  * @returns UUID or random hex identifier.
21
56
  */
22
- export declare function newId(): string;
57
+ export declare function newId(diagnostics: Diagnostics): string;
23
58
  /**
24
59
  * Resolves or initializes session, tab, and context identifiers for the active realm.
25
60
  * @param diagnostics Diagnostics reporter.
61
+ * @param stores Identity stores.
26
62
  * @returns Populated Identity object.
27
63
  */
28
- export declare function resolveIdentity(diagnostics: Diagnostics): Identity;
64
+ export declare function resolveIdentity(diagnostics: Diagnostics, stores?: IdentityStores): Identity;
65
+ /**
66
+ * Writes a new tab id to the session store.
67
+ * @param tabId New tab identifier.
68
+ * @param diagnostics Diagnostics reporter.
69
+ * @param stores Identity stores.
70
+ */
71
+ export declare function persistTabId(tabId: string, diagnostics: Diagnostics, stores: IdentityStores): void;
29
72
  /**
30
- * Writes the session's last-seen timestamp, throttled by `SESSION_TOUCH_MS`.
31
- * The throttle is instance state, not module state: two runtimes in one document
32
- * must not silence each other's session writes.
73
+ * Writes the last-seen timestamp of the session. `SESSION_TOUCH_MS` sets the throttle.
74
+ * The instance keeps the throttle state, not the module. Two runtimes in one document
75
+ * must not block the session writes of each other.
33
76
  */
34
77
  export declare class SessionTouch {
35
78
  private diagnostics;
79
+ private readonly stores;
36
80
  /** Epoch milliseconds of the last write this instance made. */
37
81
  private lastTouchAt;
38
82
  /**
39
83
  * @param diagnostics Diagnostics reporter.
84
+ * @param stores Identity stores.
40
85
  */
41
- constructor(diagnostics: Diagnostics);
86
+ constructor(diagnostics: Diagnostics, stores?: IdentityStores);
42
87
  /**
43
- * Updates the session activity timestamp in localStorage, at most once per window.
88
+ * Writes the session activity time to the local store. It writes one time in each throttle window.
44
89
  * @param sessionId Active session identifier.
45
90
  */
46
91
  touch(sessionId: string): void;
@@ -1,14 +1,14 @@
1
1
  import type { Diagnostics } from "../core/diagnostics";
2
2
  /**
3
3
  * Executes an asynchronous function under a Web Locks API origin-wide lock.
4
- * Falls back to direct execution in environments without Web Locks support.
4
+ * It runs the task directly when the Web Locks API is not available.
5
5
  * @param name Origin-scoped lock identifier.
6
6
  * @param diagnostics Diagnostics reporter.
7
7
  * @param fn Asynchronous task to execute while holding the lock.
8
8
  * @param options Lock acquisition options.
9
- * @param options.skipIfBusy Skips execution if lock is currently held by another context.
10
- * @returns Promise resolving to the task result, or undefined if the lock was held
11
- * and nothing ran. A caller that conflates the two stops rescheduling.
9
+ * @param options.skipIfBusy When true, the task does not run if another context holds the lock.
10
+ * @returns Promise of the task result. It resolves to undefined when another context holds the
11
+ * lock. A caller that reads undefined as a task result stops rescheduling.
12
12
  */
13
13
  export declare function withDrainLock<T>(name: string, diagnostics: Diagnostics, fn: () => Promise<T>, { skipIfBusy }?: {
14
14
  skipIfBusy?: boolean;
@@ -24,17 +24,19 @@ export interface PlatformMetadata {
24
24
  export declare function detectPlatform(diagnostics: Diagnostics): PlatformMetadata;
25
25
  /**
26
26
  * Determines whether the current window is the top-level browsing context.
27
+ * @param diagnostics Diagnostics reporter. It counts a blocked read of window.top.
27
28
  * @returns True if top-level, false if framed or inaccessible due to cross-origin boundaries.
28
29
  */
29
- export declare function isTopLevel(): boolean;
30
+ export declare function isTopLevel(diagnostics: Diagnostics): boolean;
30
31
  /**
31
32
  * Retrieves the current document URL without caching.
33
+ * @param diagnostics Diagnostics reporter. It counts a blocked read of location.href.
32
34
  * @returns Current location.href or empty string.
33
35
  */
34
- export declare function currentUrl(): string;
36
+ export declare function currentUrl(diagnostics: Diagnostics): string;
35
37
  /**
36
38
  * Drops the query string and fragment from a URL.
37
- * A string cut, not a URL parse: a relative request target has no base to parse against.
39
+ * It cuts the string and does not parse a URL. A relative request target has no base URL.
38
40
  * @param url Absolute or relative URL.
39
41
  * @returns The URL up to the first "?" or "#".
40
42
  */
@@ -1,3 +1,4 @@
1
+ import type { Diagnostics } from "../core/diagnostics";
1
2
  /** Structural depth and size limits enforced during object sanitization. */
2
3
  export interface SanitizeLimits {
3
4
  /** Maximum recursion depth before truncating nested objects. */
@@ -31,16 +32,18 @@ export interface SanitizeResult {
31
32
  * Sanitizes arbitrary values into JSON-safe structures without throwing.
32
33
  * @param value Raw value to sanitize.
33
34
  * @param limits Configuration limits for depth, count, and character lengths.
35
+ * @param diagnostics Diagnostics reporter. It counts a value that throws during the walk.
34
36
  * @returns JSON-safe sanitized value.
35
37
  */
36
- export declare function sanitize(value: unknown, limits: SanitizeLimits): unknown;
38
+ export declare function sanitize(value: unknown, limits: SanitizeLimits, diagnostics: Diagnostics): unknown;
37
39
  /**
38
40
  * Sanitizes arbitrary values and calculates approximate serialized byte sizes.
39
41
  * @param value Raw value to sanitize.
40
42
  * @param limits Configuration limits.
43
+ * @param diagnostics Diagnostics reporter. It counts a value that throws during the walk.
41
44
  * @returns SanitizeResult containing sanitized value and byte count.
42
45
  */
43
- export declare function sanitizeWithSize(value: unknown, limits: SanitizeLimits): SanitizeResult;
46
+ export declare function sanitizeWithSize(value: unknown, limits: SanitizeLimits, diagnostics: Diagnostics): SanitizeResult;
44
47
  /**
45
48
  * Estimates UTF-8 encoded byte length for a string.
46
49
  * @param value Target string.
@@ -8,8 +8,8 @@ export declare class Sequence {
8
8
  */
9
9
  next(): number;
10
10
  /**
11
- * Resets the sequence counter to zero, for a runtime configured afresh.
12
- * Continuing the count implies continuity with the previous run.
11
+ * Resets the sequence counter to zero when the runtime gets a new configuration.
12
+ * A continued count shows a false link to the previous run.
13
13
  */
14
14
  reset(): void;
15
15
  }
@@ -12,9 +12,9 @@ export interface TraceContext {
12
12
  /** Trigger classification for rotating the ambient trace context. */
13
13
  export type RotateReason = "start" | "interaction" | "navigation" | "explicit" | "maxAge";
14
14
  /**
15
- * Generates a random 32-character hex string conforming to W3C trace ID format.
16
- * Exported for callers starting their own trace. A wrong-width id is dropped by
17
- * the backend without a word.
15
+ * Generates a random 32-character hex string in the W3C trace ID format.
16
+ * Use it to start your own trace. The backend drops an id with the wrong width
17
+ * and reports no error.
18
18
  * @returns 32-character hexadecimal trace ID.
19
19
  */
20
20
  export declare function newTraceId(): string;
@@ -27,23 +27,24 @@ export declare function newSpanId(): string;
27
27
  export declare class TraceEngine {
28
28
  private readonly diagnostics;
29
29
  private readonly maxAgeMs;
30
- private readonly load;
30
+ private readonly load?;
31
31
  /**
32
- * Active ambient trace context. Instance state, never module state. Two runtimes
33
- * in one document must not share a trace id.
32
+ * Active ambient trace context. The instance keeps this state, not the module. Two
33
+ * runtimes in one document must not share a trace id.
34
34
  */
35
35
  private ambient;
36
- /** The optional peer once loaded. Undefined while it loads, and forever if it is absent. */
36
+ /** The optional peer after it loads. It is undefined while it loads or when it is absent. */
37
37
  private otel;
38
38
  /**
39
39
  * @param diagnostics Diagnostics reporter.
40
40
  * @param maxAgeMs Maximum lifetime of an un-rotated ambient trace in milliseconds.
41
- * @param load Supplies the OpenTelemetry API.
41
+ * @param load Loader for the OpenTelemetry API. If it is not set, OTel is off.
42
+ * Do not import the peer by name. The Vite dev server fails if the peer is not installed.
42
43
  */
43
- constructor(diagnostics: Diagnostics, maxAgeMs?: number, load?: OtelLoader);
44
+ constructor(diagnostics: Diagnostics, maxAgeMs?: number, load?: OtelLoader | undefined);
44
45
  /**
45
- * Loads the OpenTelemetry API. Records built before this resolves, and every
46
- * record when the package is absent, carry the ambient trace instead.
46
+ * Loads the OpenTelemetry API. Until the load completes, records use the ambient trace.
47
+ * If there is no loader or the load fails, all records use the ambient trace.
47
48
  * @returns Promise resolving once the attempt has settled.
48
49
  */
49
50
  loadOtel(): Promise<void>;
@@ -64,7 +65,8 @@ export declare class TraceEngine {
64
65
  */
65
66
  rotate(_reason: RotateReason): TraceContext;
66
67
  /**
67
- * Generates W3C traceparent headers using registered OpenTelemetry propagators or ambient fallback.
68
+ * Generates W3C traceparent headers with the registered OpenTelemetry propagators.
69
+ * Without a traceparent from OpenTelemetry, it uses the ambient trace.
68
70
  * @returns Header map containing traceparent.
69
71
  */
70
72
  headers(): Record<string, string>;
@@ -0,0 +1,2 @@
1
+ var e=class{ctx;name=`web-vitals`;installed=!1;constructor(e){this.ctx=e}install(){if(this.installed||(this.installed=!0,this.reportNavigationTiming(),this.ctx.once.webVitals))return;let e=this.ctx.config.capture.webVitalsLoader;e?(this.ctx.once.webVitals=!0,this.loadWebVitals(e)):this.ctx.diagnostics.report(`config.invalid`,`capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.`)}uninstall(){this.installed=!1}async loadWebVitals(e){let t=await this.ctx.diagnostics.guardAsync(`capture.install_failed`,`The library could not load web-vitals.`,e);if(!t){this.ctx.diagnostics.report(`capture.install_failed`,`The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.`);return}let n=(e,t)=>n=>{this.ctx.logger.logMetric(`web_vitals.${e}`,Math.round(n.value*1e3)/1e3,t,`gauge`,{"metric.rating":n.rating,"metric.id":n.id})};t.onLCP(n(`lcp`,`ms`)),t.onCLS(n(`cls`,`1`)),t.onINP(n(`inp`,`ms`)),t.onFCP(n(`fcp`,`ms`)),t.onTTFB(n(`ttfb`,`ms`))}reportNavigationTiming(){this.ctx.once.navigationTiming||(this.ctx.once.navigationTiming=!0,this.ctx.diagnostics.guard(`capture.install_failed`,`The library could not read the navigation timing.`,()=>{let e=performance.getEntriesByType(`navigation`)[0];if(!e)return;let t={"navigation.dns_ms":e.domainLookupEnd-e.domainLookupStart,"navigation.tcp_ms":e.connectEnd-e.connectStart,"navigation.ttfb_ms":e.responseStart-e.requestStart,"navigation.response_ms":e.responseEnd-e.responseStart,"navigation.dom_interactive_ms":e.domInteractive,"navigation.dom_complete_ms":e.domComplete,"navigation.load_ms":e.loadEventEnd};for(let[n,r]of Object.entries(t))Number.isFinite(r)&&r>=0&&this.ctx.logger.logMetric(n,Math.round(r),`ms`,`gauge`,{"navigation.type":e.type})}))}};exports.WebVitalsCapture=e;
2
+ //# sourceMappingURL=web-vitals-B2FYsEAU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-vitals-B2FYsEAU.cjs","names":["WebVitalsCapture","ctx","loader","module","send","name","metric","unit","nav","metrics","value"],"sources":["../src/capture/web-vitals.ts"],"sourcesContent":["// src/capture/web-vitals.ts\n//\n// Captures browser navigation timing and Core Web Vitals metrics through an optional peer.\n\nimport type { WebVitalsMetric, WebVitalsModule, WebVitalsReporter } from \"../models/config\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Captures browser navigation timing benchmarks and Core Web Vitals. */\nexport class WebVitalsCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"web-vitals\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /**\n * @param ctx Capture context containing configuration, diagnostics, and logger.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports navigation timing and starts to load web-vitals. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n\n this.reportNavigationTiming();\n\n if (this.ctx.once.webVitals) {\n return;\n }\n\n // Do not import the peer by name. The Vite dev server fails if the peer is not installed.\n // Do not set once here. A later configure() call with a loader must subscribe.\n const loader = this.ctx.config.capture.webVitalsLoader;\n if (!loader) {\n this.ctx.diagnostics.report(\n \"config.invalid\",\n \"capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Set the flag before the load, not after. Without this order, two configure() calls\n // in one turn both pass this check and subscribe two times.\n this.ctx.once.webVitals = true;\n\n void this.loadWebVitals(loader);\n }\n\n /**\n * Marks the module as uninstalled. The web-vitals reporters stay subscribed\n * because the package has no unsubscribe. `ctx.once` prevents a second set.\n */\n uninstall(): void {\n this.installed = false;\n }\n\n /**\n * Loads the web-vitals module and registers metric reporters.\n * @param loader Loader that the consumer supplies.\n */\n private async loadWebVitals(loader: () => Promise<WebVitalsModule>): Promise<void> {\n const module = await this.ctx.diagnostics.guardAsync(\n \"capture.install_failed\",\n \"The library could not load web-vitals.\",\n loader,\n );\n\n if (!module) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n const send =\n (name: string, unit: string): WebVitalsReporter =>\n (metric: WebVitalsMetric): void => {\n this.ctx.logger.logMetric(\n `web_vitals.${name}`,\n // Keep three decimals. CLS is a small fraction. An integer value\n // reports each layout shift as zero.\n Math.round(metric.value * 1000) / 1000,\n unit,\n \"gauge\",\n { \"metric.rating\": metric.rating, \"metric.id\": metric.id },\n );\n };\n\n module.onLCP(send(\"lcp\", \"ms\"));\n module.onCLS(send(\"cls\", \"1\"));\n module.onINP(send(\"inp\", \"ms\"));\n module.onFCP(send(\"fcp\", \"ms\"));\n module.onTTFB(send(\"ttfb\", \"ms\"));\n }\n\n /** Extracts and logs PerformanceNavigationTiming benchmarks one time for each document. */\n private reportNavigationTiming(): void {\n // The entry describes the one navigation of this document. A second report after a\n // reconfigure duplicates the seven metrics.\n if (this.ctx.once.navigationTiming) {\n return;\n }\n this.ctx.once.navigationTiming = true;\n\n this.ctx.diagnostics.guard(\n \"capture.install_failed\",\n \"The library could not read the navigation timing.\",\n () => {\n const nav = performance.getEntriesByType(\"navigation\")[0] as\n PerformanceNavigationTiming | undefined;\n if (!nav) {\n return;\n }\n\n const metrics: Record<string, number> = {\n \"navigation.dns_ms\": nav.domainLookupEnd - nav.domainLookupStart,\n \"navigation.tcp_ms\": nav.connectEnd - nav.connectStart,\n \"navigation.ttfb_ms\": nav.responseStart - nav.requestStart,\n \"navigation.response_ms\": nav.responseEnd - nav.responseStart,\n \"navigation.dom_interactive_ms\": nav.domInteractive,\n \"navigation.dom_complete_ms\": nav.domComplete,\n \"navigation.load_ms\": nav.loadEventEnd,\n };\n\n for (const [name, value] of Object.entries(metrics)) {\n // Filters unrecorded or negative timings to avoid false zero readings.\n if (Number.isFinite(value) && value >= 0) {\n this.ctx.logger.logMetric(name, Math.round(value), \"ms\", \"gauge\", {\n \"navigation.type\": nav.type,\n });\n }\n }\n },\n );\n }\n}\n"],"mappings":"AAQA,IAAaA,EAAb,KAAiD,CAUlB,IAR7B,KAAgB,aAGhB,UAAoB,GAKpB,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CAQd,GAPI,KAAK,YAGT,KAAK,UAAY,GAEjB,KAAK,uBAAuB,EAExB,KAAK,IAAI,KAAK,WAChB,OAKF,IAAMC,EAAS,KAAK,IAAI,OAAO,QAAQ,gBAClCA,GAUL,KAAK,IAAI,KAAK,UAAY,GAE1B,KAAU,cAAcA,CAAM,GAX5B,KAAK,IAAI,YAAY,OACnB,iBACA,yGACF,CASJ,CAMA,WAAkB,CAChB,KAAK,UAAY,EACnB,CAMA,MAAc,cAAc,EAAuD,CACjF,IAAMC,EAAS,MAAM,KAAK,IAAI,YAAY,WACxC,yBACA,yCACAD,CACF,EAEA,GAAI,CAACC,EAAQ,CACX,KAAK,IAAI,YAAY,OACnB,yBACA,gGACF,EACA,MACF,CAEA,IAAMC,GACH,EAAc,IACd,GAAkC,CACjC,KAAK,IAAI,OAAO,UACd,cAAcC,IAGd,KAAK,MAAMC,EAAO,MAAQ,GAAI,EAAI,IAClCC,EACA,QACA,CAAE,gBAAiBD,EAAO,OAAQ,YAAaA,EAAO,EAAG,CAC3D,CACF,EAEFH,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,MAAMC,EAAK,MAAO,GAAG,CAAC,EAC7BD,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,OAAOC,EAAK,OAAQ,IAAI,CAAC,CAClC,CAGA,wBAAuC,CAGjC,KAAK,IAAI,KAAK,mBAGlB,KAAK,IAAI,KAAK,iBAAmB,GAEjC,KAAK,IAAI,YAAY,MACnB,yBACA,wDACM,CACJ,IAAMI,EAAM,YAAY,iBAAiB,YAAY,CAAC,CAAC,GAEvD,GAAI,CAACA,EACH,OAGF,IAAMC,EAAkC,CACtC,oBAAqBD,EAAI,gBAAkBA,EAAI,kBAC/C,oBAAqBA,EAAI,WAAaA,EAAI,aAC1C,qBAAsBA,EAAI,cAAgBA,EAAI,aAC9C,yBAA0BA,EAAI,YAAcA,EAAI,cAChD,gCAAiCA,EAAI,eACrC,6BAA8BA,EAAI,YAClC,qBAAsBA,EAAI,YAC5B,EAEA,IAAK,GAAM,CAACH,EAAMK,KAAU,OAAO,QAAQD,CAAO,EAE5C,OAAO,SAASC,CAAK,GAAKA,GAAS,GACrC,KAAK,IAAI,OAAO,UAAUL,EAAM,KAAK,MAAMK,CAAK,EAAG,KAAM,QAAS,CAChE,kBAAmBF,EAAI,IACzB,CAAC,CAGP,CACF,EACF,CACF"}
@@ -0,0 +1,51 @@
1
+ //#region src/capture/web-vitals.ts
2
+ var e = class {
3
+ ctx;
4
+ name = "web-vitals";
5
+ installed = !1;
6
+ constructor(e) {
7
+ this.ctx = e;
8
+ }
9
+ install() {
10
+ if (this.installed || (this.installed = !0, this.reportNavigationTiming(), this.ctx.once.webVitals)) return;
11
+ let e = this.ctx.config.capture.webVitalsLoader;
12
+ e ? (this.ctx.once.webVitals = !0, this.loadWebVitals(e)) : this.ctx.diagnostics.report("config.invalid", "capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.");
13
+ }
14
+ uninstall() {
15
+ this.installed = !1;
16
+ }
17
+ async loadWebVitals(e) {
18
+ let t = await this.ctx.diagnostics.guardAsync("capture.install_failed", "The library could not load web-vitals.", e);
19
+ if (!t) {
20
+ this.ctx.diagnostics.report("capture.install_failed", "The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.");
21
+ return;
22
+ }
23
+ let n = (e, t) => (n) => {
24
+ this.ctx.logger.logMetric(`web_vitals.${e}`, Math.round(n.value * 1e3) / 1e3, t, "gauge", {
25
+ "metric.rating": n.rating,
26
+ "metric.id": n.id
27
+ });
28
+ };
29
+ t.onLCP(n("lcp", "ms")), t.onCLS(n("cls", "1")), t.onINP(n("inp", "ms")), t.onFCP(n("fcp", "ms")), t.onTTFB(n("ttfb", "ms"));
30
+ }
31
+ reportNavigationTiming() {
32
+ this.ctx.once.navigationTiming || (this.ctx.once.navigationTiming = !0, this.ctx.diagnostics.guard("capture.install_failed", "The library could not read the navigation timing.", () => {
33
+ let e = performance.getEntriesByType("navigation")[0];
34
+ if (!e) return;
35
+ let t = {
36
+ "navigation.dns_ms": e.domainLookupEnd - e.domainLookupStart,
37
+ "navigation.tcp_ms": e.connectEnd - e.connectStart,
38
+ "navigation.ttfb_ms": e.responseStart - e.requestStart,
39
+ "navigation.response_ms": e.responseEnd - e.responseStart,
40
+ "navigation.dom_interactive_ms": e.domInteractive,
41
+ "navigation.dom_complete_ms": e.domComplete,
42
+ "navigation.load_ms": e.loadEventEnd
43
+ };
44
+ for (let [n, r] of Object.entries(t)) Number.isFinite(r) && r >= 0 && this.ctx.logger.logMetric(n, Math.round(r), "ms", "gauge", { "navigation.type": e.type });
45
+ }));
46
+ }
47
+ };
48
+ //#endregion
49
+ export { e as WebVitalsCapture };
50
+
51
+ //# sourceMappingURL=web-vitals-DHZ0yA_H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-vitals-DHZ0yA_H.js","names":["WebVitalsCapture","ctx","loader","module","send","name","metric","unit","nav","metrics","value"],"sources":["../src/capture/web-vitals.ts"],"sourcesContent":["// src/capture/web-vitals.ts\n//\n// Captures browser navigation timing and Core Web Vitals metrics through an optional peer.\n\nimport type { WebVitalsMetric, WebVitalsModule, WebVitalsReporter } from \"../models/config\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Captures browser navigation timing benchmarks and Core Web Vitals. */\nexport class WebVitalsCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"web-vitals\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /**\n * @param ctx Capture context containing configuration, diagnostics, and logger.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports navigation timing and starts to load web-vitals. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n\n this.reportNavigationTiming();\n\n if (this.ctx.once.webVitals) {\n return;\n }\n\n // Do not import the peer by name. The Vite dev server fails if the peer is not installed.\n // Do not set once here. A later configure() call with a loader must subscribe.\n const loader = this.ctx.config.capture.webVitalsLoader;\n if (!loader) {\n this.ctx.diagnostics.report(\n \"config.invalid\",\n \"capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Set the flag before the load, not after. Without this order, two configure() calls\n // in one turn both pass this check and subscribe two times.\n this.ctx.once.webVitals = true;\n\n void this.loadWebVitals(loader);\n }\n\n /**\n * Marks the module as uninstalled. The web-vitals reporters stay subscribed\n * because the package has no unsubscribe. `ctx.once` prevents a second set.\n */\n uninstall(): void {\n this.installed = false;\n }\n\n /**\n * Loads the web-vitals module and registers metric reporters.\n * @param loader Loader that the consumer supplies.\n */\n private async loadWebVitals(loader: () => Promise<WebVitalsModule>): Promise<void> {\n const module = await this.ctx.diagnostics.guardAsync(\n \"capture.install_failed\",\n \"The library could not load web-vitals.\",\n loader,\n );\n\n if (!module) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n const send =\n (name: string, unit: string): WebVitalsReporter =>\n (metric: WebVitalsMetric): void => {\n this.ctx.logger.logMetric(\n `web_vitals.${name}`,\n // Keep three decimals. CLS is a small fraction. An integer value\n // reports each layout shift as zero.\n Math.round(metric.value * 1000) / 1000,\n unit,\n \"gauge\",\n { \"metric.rating\": metric.rating, \"metric.id\": metric.id },\n );\n };\n\n module.onLCP(send(\"lcp\", \"ms\"));\n module.onCLS(send(\"cls\", \"1\"));\n module.onINP(send(\"inp\", \"ms\"));\n module.onFCP(send(\"fcp\", \"ms\"));\n module.onTTFB(send(\"ttfb\", \"ms\"));\n }\n\n /** Extracts and logs PerformanceNavigationTiming benchmarks one time for each document. */\n private reportNavigationTiming(): void {\n // The entry describes the one navigation of this document. A second report after a\n // reconfigure duplicates the seven metrics.\n if (this.ctx.once.navigationTiming) {\n return;\n }\n this.ctx.once.navigationTiming = true;\n\n this.ctx.diagnostics.guard(\n \"capture.install_failed\",\n \"The library could not read the navigation timing.\",\n () => {\n const nav = performance.getEntriesByType(\"navigation\")[0] as\n PerformanceNavigationTiming | undefined;\n if (!nav) {\n return;\n }\n\n const metrics: Record<string, number> = {\n \"navigation.dns_ms\": nav.domainLookupEnd - nav.domainLookupStart,\n \"navigation.tcp_ms\": nav.connectEnd - nav.connectStart,\n \"navigation.ttfb_ms\": nav.responseStart - nav.requestStart,\n \"navigation.response_ms\": nav.responseEnd - nav.responseStart,\n \"navigation.dom_interactive_ms\": nav.domInteractive,\n \"navigation.dom_complete_ms\": nav.domComplete,\n \"navigation.load_ms\": nav.loadEventEnd,\n };\n\n for (const [name, value] of Object.entries(metrics)) {\n // Filters unrecorded or negative timings to avoid false zero readings.\n if (Number.isFinite(value) && value >= 0) {\n this.ctx.logger.logMetric(name, Math.round(value), \"ms\", \"gauge\", {\n \"navigation.type\": nav.type,\n });\n }\n }\n },\n );\n }\n}\n"],"mappings":";AAQA,IAAaA,IAAb,MAAiD;CAUlB;CAR7B,OAAgB;CAGhB,YAAoB;CAKpB,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EAQd,IAPI,KAAK,cAGT,KAAK,YAAY,IAEjB,KAAK,uBAAuB,GAExB,KAAK,IAAI,KAAK,YAChB;EAKF,IAAMC,IAAS,KAAK,IAAI,OAAO,QAAQ;EACvC,AAAKA,KAUL,KAAK,IAAI,KAAK,YAAY,IAE1B,KAAU,cAAcA,CAAM,KAX5B,KAAK,IAAI,YAAY,OACnB,kBACA,yGACF;CASJ;CAMA,YAAkB;EAChB,KAAK,YAAY;CACnB;CAMA,MAAc,cAAc,GAAuD;EACjF,IAAMC,IAAS,MAAM,KAAK,IAAI,YAAY,WACxC,0BACA,0CACAD,CACF;EAEA,IAAI,CAACC,GAAQ;GACX,KAAK,IAAI,YAAY,OACnB,0BACA,gGACF;GACA;EACF;EAEA,IAAMC,KACH,GAAc,OACd,MAAkC;GACjC,KAAK,IAAI,OAAO,UACd,cAAcC,KAGd,KAAK,MAAMC,EAAO,QAAQ,GAAI,IAAI,KAClCC,GACA,SACA;IAAE,iBAAiBD,EAAO;IAAQ,aAAaA,EAAO;GAAG,CAC3D;EACF;EAMF,AAJAH,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,MAAMC,EAAK,OAAO,GAAG,CAAC,GAC7BD,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,OAAOC,EAAK,QAAQ,IAAI,CAAC;CAClC;CAGA,yBAAuC;EAGrC,AAAI,KAAK,IAAI,KAAK,qBAGlB,KAAK,IAAI,KAAK,mBAAmB,IAEjC,KAAK,IAAI,YAAY,MACnB,0BACA,2DACM;GACJ,IAAMI,IAAM,YAAY,iBAAiB,YAAY,CAAC,CAAC;GAEvD,IAAI,CAACA,GACH;GAGF,IAAMC,IAAkC;IACtC,qBAAqBD,EAAI,kBAAkBA,EAAI;IAC/C,qBAAqBA,EAAI,aAAaA,EAAI;IAC1C,sBAAsBA,EAAI,gBAAgBA,EAAI;IAC9C,0BAA0BA,EAAI,cAAcA,EAAI;IAChD,iCAAiCA,EAAI;IACrC,8BAA8BA,EAAI;IAClC,sBAAsBA,EAAI;GAC5B;GAEA,KAAK,IAAM,CAACH,GAAMK,MAAU,OAAO,QAAQD,CAAO,GAEhD,AAAI,OAAO,SAASC,CAAK,KAAKA,KAAS,KACrC,KAAK,IAAI,OAAO,UAAUL,GAAM,KAAK,MAAMK,CAAK,GAAG,MAAM,SAAS,EAChE,mBAAmBF,EAAI,KACzB,CAAC;EAGP,CACF;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utk09/ui-observability",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "UI observability and logging for browser, OpenFin and webview applications",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -51,7 +51,8 @@
51
51
  "playground/angular",
52
52
  "playground/microfrontend/host",
53
53
  "playground/microfrontend/remote-blotter",
54
- "playground/microfrontend/remote-ticket"
54
+ "playground/microfrontend/remote-ticket",
55
+ "playground/console-only"
55
56
  ],
56
57
  "scripts": {
57
58
  "dev": "concurrently -k \"npm:dev:*\"",
@@ -61,6 +62,7 @@
61
62
  "example:react": "npm run dev --workspace @example/react",
62
63
  "example:angular": "npm run dev --workspace @example/angular",
63
64
  "example:microfrontend": "concurrently -k \"npm run dev --workspace @example/mf-blotter\" \"npm run dev --workspace @example/mf-ticket\" \"npm run dev --workspace @example/mf-host\"",
65
+ "example:console-only": "npm run dev --workspace @example/console-only",
64
66
  "build": "rimraf dist && tsc --project tsconfig.build.json && vite build",
65
67
  "build:watch": "vite build --watch",
66
68
  "lint": "eslint .",
@@ -72,7 +74,8 @@
72
74
  "test:coverage": "vitest run --coverage",
73
75
  "typecheck": "tsc --noEmit",
74
76
  "check:version": "node tools/check-version-sync.mjs",
75
- "verify": "npm run format:check && npm run check:version && npm run typecheck && npm run lint && npm run build && npm run test:coverage",
77
+ "check:peers": "node tools/check-peer-imports.mjs",
78
+ "verify": "npm run format:check && npm run check:version && npm run typecheck && npm run lint && npm run build && npm run check:peers && npm run test:coverage",
76
79
  "prepublishOnly": "npm run verify"
77
80
  },
78
81
  "peerDependencies": {
@@ -90,19 +93,26 @@
90
93
  "devDependencies": {
91
94
  "@eslint/js": "10.0.1",
92
95
  "@opentelemetry/api": "1.9.1",
93
- "@types/node": "26.2.0",
96
+ "@types/node": "26.6.5",
94
97
  "@vitest/coverage-istanbul": "4.1.11",
95
- "concurrently": "10.0.5",
96
- "eslint": "10.10.0",
98
+ "concurrently": "10.0.6",
99
+ "eslint": "10.12.0",
97
100
  "eslint-config-prettier": "10.1.8",
98
101
  "fake-indexeddb": "6.2.5",
99
- "happy-dom": "20.14.0",
100
- "prettier": "3.9.6",
102
+ "happy-dom": "20.14.6",
103
+ "prettier": "3.9.10",
101
104
  "rimraf": "6.1.3",
102
105
  "typescript": "~5.9.3",
103
- "typescript-eslint": "8.70.0",
104
- "vite": "8.2.2",
106
+ "typescript-eslint": "8.71.1",
107
+ "vite": "8.3.4",
105
108
  "vitest": "4.1.11",
106
- "web-vitals": "6.2.1"
109
+ "web-vitals": "6.2.3"
110
+ },
111
+ "allowScripts": {
112
+ "@parcel/watcher@2.6.0": true,
113
+ "esbuild@0.28.1": true,
114
+ "lmdb@3.5.1": true,
115
+ "msgpackr-extract@3.0.4": true,
116
+ "fsevents@2.3.3": true
107
117
  }
108
118
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-DVbpJ1tv.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["// src/constants.ts\n//\n// All limits, thresholds, timing windows, storage keys, patterns, and\n// defaults used by the library.\n\nimport type { ResolvedConfig } from \"./models/config\";\nimport type { LogLevel, LogType } from \"./models/log-record\";\nimport type { StorageLimits } from \"./models/storage\";\n\n// ----------------------------------\n// Library-wide\n// ----------------------------------\n\n/** Prefix on console messages this library writes. */\nexport const LIBRARY_LOG_PREFIX = \"[ui-observability]\";\n\n// ----------------------------------\n// Diagnostics\n// ----------------------------------\n\n/** Throttle window per diagnostic code, in milliseconds. Limits how often an error loop can spam the handler. */\nexport const DIAGNOSTIC_THROTTLE_MS = 1000;\n\n// ----------------------------------\n// Identity\n// ----------------------------------\n\n/** `localStorage` key for the session id and its last-seen time. */\nexport const SESSION_ID_KEY = \"ui-observability.session\";\n\n/** `sessionStorage` key for the tab id. */\nexport const TAB_ID_KEY = \"ui-observability.tab\";\n\n/** Session idle timeout, in milliseconds. */\nexport const SESSION_IDLE_MS = 30 * 60 * 1000;\n\n/** Min gap between session last-seen writes, in milliseconds. */\nexport const SESSION_TOUCH_MS = 60_000;\n\n/** Random id length, in bytes, used when `crypto.randomUUID` is unavailable. */\nexport const ID_BYTE_LENGTH = 16;\n\n/** Distinct values in one byte (256). */\nexport const BYTE_VALUE_COUNT = 256;\n\n// ----------------------------------\n// Platform detection\n// ----------------------------------\n\n/** Matches OpenFin's user agent. */\nexport const OPENFIN_UA_PATTERN = /OpenFin/i;\n\n/** Matches Android's webview token (`wv`). */\nexport const ANDROID_WEBVIEW_UA_PATTERN = /\\bwv\\b/;\n\n/** Matches iOS hardware: iPhone, iPad, iPod. */\nexport const IOS_DEVICE_UA_PATTERN = /\\b(iPhone|iPad|iPod)\\b/;\n\n/** Matches desktop macOS in a user agent. */\nexport const MACINTOSH_UA_PATTERN = /\\bMacintosh\\b/;\n\n/** Matches the mobile token. */\nexport const MOBILE_UA_PATTERN = /\\bMobile\\b/;\n\n/** WebKit engine token, present in every WebKit browser including webviews. */\nexport const WEBKIT_UA_TOKEN = \"AppleWebKit\";\n\n/** Safari token sent by real iOS browsers, not in-app webviews. */\nexport const SAFARI_UA_TOKEN = \"Safari/\";\n\n// ----------------------------------\n// Sanitizing and size estimation\n// ----------------------------------\n\n/** First UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/** Last UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/** Code units below this encode as one UTF-8 byte. */\nexport const UTF8_ONE_BYTE_CEILING = 0x80;\n\n/** Code units below this, and at or above the one-byte ceiling, encode as two UTF-8 bytes. */\nexport const UTF8_TWO_BYTE_CEILING = 0x800;\n\n/** Class names kept in a `describeNode` selector. */\nexport const MAX_NODE_CLASS_NAMES = 3;\n\n/** Byte cost of a null or undefined value. */\nexport const BYTES_PER_NULL = 4;\n\n/** Byte cost of a number (flat estimate). */\nexport const BYTES_PER_NUMBER = 8;\n\n/** Byte cost of a boolean. */\nexport const BYTES_PER_BOOLEAN = 5;\n\n/** Byte cost of an object or array's wrapping braces or brackets. */\nexport const BYTES_PER_CONTAINER = 2;\n\n/** Byte cost of a string's wrapping quotes. */\nexport const BYTES_PER_QUOTED_STRING = 2;\n\n/** Byte cost of one key's punctuation: quotes, colon, comma. */\nexport const BYTES_PER_KEY_OVERHEAD = 4;\n\n// ----------------------------------\n// Record model\n// ----------------------------------\n\n/**\n * Log level to OpenTelemetry severity number.\n * @see {@link LEVEL_ORDER}\n */\nexport const SEVERITY_NUMBER: Record<LogLevel, number> = {\n TRACE: 1,\n DEBUG: 5,\n INFO: 9,\n WARN: 13,\n ERROR: 17,\n FATAL: 21,\n};\n\n/**\n * Alias for `SEVERITY_NUMBER`, used by the level filter.\n * @see {@link SEVERITY_NUMBER}\n */\nexport const LEVEL_ORDER: Record<LogLevel, number> = SEVERITY_NUMBER;\n\n// ----------------------------------\n// Attribute and resource keys\n// ----------------------------------\n//\n// Attribute and resource key names records carry on the wire, following\n// OpenTelemetry conventions. `uiobs.` marks this library's own fields.\n\n/** Record kind attribute key. */\nexport const ATTR_LOG_TYPE = \"log.type\";\n\n/** Record sequence number within its context, from zero. */\nexport const ATTR_LOG_SEQ = \"log.seq\";\n\n/** Logger namespace attribute key. */\nexport const ATTR_APP_NAMESPACE = \"app.namespace\";\n\n/** Document URL when the record was built. */\nexport const ATTR_PAGE_URL = \"page.url\";\n\n/**\n * HTTP request URL attribute key, set by network capture. Don't reuse `ATTR_PAGE_URL`; it would overwrite the request's target.\n * @see {@link ATTR_PAGE_URL}\n */\nexport const ATTR_URL_FULL = \"url.full\";\n\n/** Journey id attribute key. */\nexport const ATTR_JOURNEY_ID = \"journey.id\";\n\n/** Journey name attribute key. */\nexport const ATTR_JOURNEY_NAME = \"journey.name\";\n\n/** Parent journey id, present only on a child journey. */\nexport const ATTR_JOURNEY_PARENT_ID = \"journey.parent_id\";\n\n/** Marks a record whose attributes failed to sanitize. */\nexport const ATTR_SANITIZE_FAILED = \"uiobs.sanitize_failed\";\n\n/**\n * Marks a record whose attributes were dropped for exceeding the byte budget.\n * @see {@link ATTR_ATTRIBUTES_BYTES}\n */\nexport const ATTR_ATTRIBUTES_DROPPED = \"uiobs.attributes_dropped\";\n\n/**\n * Byte size of the dropped attributes.\n * @see {@link ATTR_ATTRIBUTES_DROPPED}\n */\nexport const ATTR_ATTRIBUTES_BYTES = \"uiobs.attributes_bytes\";\n\n/** Application name resource key. */\nexport const RESOURCE_SERVICE_NAME = \"service.name\";\n\n/** Application build version resource key. */\nexport const RESOURCE_SERVICE_VERSION = \"service.version\";\n\n/** Deployment environment resource key. */\nexport const RESOURCE_DEPLOYMENT_ENVIRONMENT = \"deployment.environment\";\n\n/**\n * Producer library name resource key.\n * @see {@link TELEMETRY_SDK_NAME}\n */\nexport const RESOURCE_TELEMETRY_SDK_NAME = \"telemetry.sdk.name\";\n\n/**\n * Producer library version resource key.\n * @see {@link TELEMETRY_SDK_VERSION}\n */\nexport const RESOURCE_TELEMETRY_SDK_VERSION = \"telemetry.sdk.version\";\n\n/**\n * Producer SDK language resource key.\n * @see {@link TELEMETRY_SDK_LANGUAGE}\n */\nexport const RESOURCE_TELEMETRY_SDK_LANGUAGE = \"telemetry.sdk.language\";\n\n/** Host platform resource key: browser, webview, or OpenFin. */\nexport const RESOURCE_HOST_PLATFORM = \"host.platform\";\n\n/** Session id resource key. */\nexport const RESOURCE_SESSION_ID = \"session.id\";\n\n/** Tab id resource key. */\nexport const RESOURCE_TAB_ID = \"tab.id\";\n\n/** Context (realm) id resource key. */\nexport const RESOURCE_CONTEXT_ID = \"context.id\";\n\n/** Raw user agent resource key. */\nexport const RESOURCE_BROWSER_USER_AGENT = \"browser.user_agent\";\n\n/** OpenFin application uuid resource key. */\nexport const RESOURCE_OPENFIN_UUID = \"openfin.uuid\";\n\n/** OpenFin window or view name resource key. */\nexport const RESOURCE_OPENFIN_NAME = \"openfin.name\";\n\n/**\n * Value of `telemetry.sdk.name`.\n * @see {@link RESOURCE_TELEMETRY_SDK_NAME}\n */\nexport const TELEMETRY_SDK_NAME = \"@utk09/ui-observability\";\n\n/**\n * Value of `telemetry.sdk.version`. A literal, not read from package.json. Bump by hand alongside package.json.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = \"0.4.1\";\n\n/**\n * Value of `telemetry.sdk.language`.\n * @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}\n */\nexport const TELEMETRY_SDK_LANGUAGE = \"webjs\";\n\n// ----------------------------------\n// Serializers\n// ----------------------------------\n\n/** OTLP/JSON serializer name. */\nexport const SERIALIZER_NAME_OTLP = \"otlp\";\n\n/** ECS serializer name. */\nexport const SERIALIZER_NAME_ECS = \"ecs\";\n\n/**\n * ECS `log.level` names that differ from the lowercased severity text. ECS spells\n * the warning level in full; every other level matches once lowercased.\n * @see {@link SERIALIZER_NAME_ECS}\n */\nexport const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>> = { WARN: \"warning\" };\n\n/** Content type for an OTLP/JSON body. */\nexport const CONTENT_TYPE_JSON = \"application/json\";\n\n/** Content type for newline-delimited JSON. */\nexport const CONTENT_TYPE_NDJSON = \"application/x-ndjson\";\n\n/** Nanoseconds per millisecond. */\nexport const NANOS_PER_MILLI = 1000000n;\n\n/**\n * Matches a nanosecond epoch written as decimal digits, e.g. \"1755543600123000000\".\n * @see {@link NANOS_PER_MILLI}\n */\nexport const NANOS_PATTERN = /^\\d+$/;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Content-Type header name. */\nexport const HEADER_CONTENT_TYPE = \"Content-Type\";\n\n/** Content-Encoding header name. */\nexport const HEADER_CONTENT_ENCODING = \"Content-Encoding\";\n\n/** Retry-After header name. */\nexport const HEADER_RETRY_AFTER = \"Retry-After\";\n\n/**\n * Batch deduplication key header name.\n * @see {@link QUERY_PARAM_BATCH_ID}\n */\nexport const HEADER_BATCH_ID = \"X-UiObs-Batch-Id\";\n\n/** Delivery attempt number header name. */\nexport const HEADER_ATTEMPT = \"X-UiObs-Attempt\";\n\n/** Gzip encoding name. */\nexport const ENCODING_GZIP = \"gzip\";\n\n/** 401, credentials missing or rejected. */\nexport const HTTP_UNAUTHORIZED = 401;\n\n/** 403, valid credentials but access denied. */\nexport const HTTP_FORBIDDEN = 403;\n\n/** 408, the server closed the connection after a timeout. Retryable. */\nexport const HTTP_REQUEST_TIMEOUT = 408;\n\n/** 413, payload too large; batch must be split. */\nexport const HTTP_PAYLOAD_TOO_LARGE = 413;\n\n/** 429, backpressure. */\nexport const HTTP_TOO_MANY_REQUESTS = 429;\n\n/** 500, floor for server-side errors. */\nexport const HTTP_SERVER_ERROR_MIN = 500;\n\n/** 503, temporary unavailability. */\nexport const HTTP_SERVICE_UNAVAILABLE = 503;\n\n/** Milliseconds per second. */\nexport const MILLIS_PER_SECOND = 1000;\n\n// ----------------------------------\n// Exit flush\n// ----------------------------------\n\n/** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */\nexport const BEACON_LIMIT_BYTES = 60_000;\n\n/** Content type for an exit payload. CORS-safelisted, avoids a preflight. */\nexport const CONTENT_TYPE_TEXT_PLAIN = \"text/plain;charset=UTF-8\";\n\n/**\n * Batch id query param name, for the exit path.\n * @see {@link HEADER_BATCH_ID}\n */\nexport const QUERY_PARAM_BATCH_ID = \"uiobs_batch_id\";\n\n/** Exit reason query param name, for logs only. */\nexport const QUERY_PARAM_EXIT_REASON = \"uiobs_exit\";\n\n// ----------------------------------\n// Storage\n// ----------------------------------\n\n/** localStorage key prefix for a parked batch. */\nexport const BATCH_STORAGE_KEY_PREFIX = \"ui-observability.batch.\";\n\n/** Zero-padded digit width for the creation time in a batch key. */\nexport const BATCH_KEY_TIME_WIDTH = 14;\n\n/** localStorage key prefix for a batch parked by exit flush. */\nexport const EMERGENCY_STORAGE_KEY_PREFIX = \"ui-observability.emergency.\";\n\n/** Max exit batches held at once. */\nexport const EMERGENCY_MAX_ENTRIES = 20;\n\n/** Key used to test whether localStorage accepts writes. */\nexport const STORAGE_PROBE_KEY = \"ui-observability.probe\";\n\n/** Fraction of the store evicted on a quota error (1 in N). */\nexport const QUOTA_EVICTION_DIVISOR = 4;\n\n/** DOMException name for a full store. */\nexport const QUOTA_EXCEEDED_ERROR = \"QuotaExceededError\";\n\n/**\n * Native IndexedDB version. It starts at 11 because Dexie, which this replaced,\n * opened the same database at ten times its own declared version. Anything below\n * 11 makes open() fail with VersionError for an existing installation and every\n * batch already stored there is stranded.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 11;\n\n/** IndexedDB object store holding batches. Named by Dexie before it was removed. */\nexport const INDEXEDDB_STORE_NAME = \"batches\";\n\n/** Index on the batch store that orders reads by creation time. */\nexport const INDEXEDDB_CREATED_AT_INDEX = \"createdAt\";\n\n/** IndexedDB adapter/strategy name. */\nexport const STORAGE_NAME_INDEXEDDB = \"indexeddb\";\n\n/** localStorage adapter/strategy name. */\nexport const STORAGE_NAME_LOCAL = \"localstorage\";\n\n/** In-memory adapter/strategy name. */\nexport const STORAGE_NAME_MEMORY = \"memory\";\n\n/** No-op adapter/strategy name. */\nexport const STORAGE_NAME_NONE = \"none\";\n\n// ----------------------------------\n// Retry\n// ----------------------------------\n\n/**\n * Origin-wide lock name a drain runs under.\n * @see {@link EMERGENCY_LOCK_NAME}\n */\nexport const DRAIN_LOCK_NAME = \"ui-observability.drain\";\n\n/**\n * Lock name startup recovery runs under.\n * @see {@link DRAIN_LOCK_NAME}\n */\nexport const EMERGENCY_LOCK_NAME = \"ui-observability.emergency\";\n\n/** Batches sent per drain tick. */\nexport const BATCHES_PER_DRAIN = 20;\n\n// ----------------------------------\n// Journey\n// ----------------------------------\n\n/** `sessionStorage` key for the current journey. */\nexport const JOURNEY_STORAGE_KEY = \"ui-observability.journey\";\n\n/**\n * Max journey name length in a token, in characters.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;\n\n/**\n * Max whole-token length, in characters. A tripwire, not validation.\n * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_MAX_CHARS = 256;\n\n/**\n * How long to wait for `fin.me.getOptions()` before giving up on a seeded journey,\n * in milliseconds.\n * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}\n */\nexport const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;\n\n/** Key under an OpenFin window's `customData` carrying a seeded journey token. */\nexport const OPENFIN_JOURNEY_CUSTOM_DATA_KEY = \"uiObsJourney\";\n\n/** Matches `+` in standard base64 (`-` in URL-safe). */\nexport const BASE64_PLUS_PATTERN = /\\+/g;\n\n/** Matches `/` in standard base64 (`_` in URL-safe). */\nexport const BASE64_SLASH_PATTERN = /\\//g;\n\n/** Matches trailing `=` padding. */\nexport const BASE64_PADDING_PATTERN = /=+$/;\n\n/** Matches `-` in URL-safe base64 (`+` in standard). */\nexport const BASE64URL_DASH_PATTERN = /-/g;\n\n/** Matches `_` in URL-safe base64 (`/` in standard). */\nexport const BASE64URL_UNDERSCORE_PATTERN = /_/g;\n\n/** Base64 characters per 3-byte group. */\nexport const BASE64_GROUP_CHARS = 4;\n\n// ----------------------------------\n// Tracing\n// ----------------------------------\n\n/** W3C trace id width, in bytes. */\nexport const TRACE_ID_BYTES = 16;\n\n/** W3C span id width, in bytes. */\nexport const SPAN_ID_BYTES = 8;\n\n/** Max ambient trace lifetime with no activity, in milliseconds. */\nexport const TRACE_MAX_AGE_MS = 5 * 60 * 1000;\n\n/** trace-flags value with the sampled bit set. */\nexport const TRACE_FLAGS_SAMPLED = 1;\n\n/** Mask for the one-byte trace-flags field. */\nexport const TRACE_FLAGS_MASK = 0xff;\n\n/**\n * W3C trace context header name\n * @see {@link TRACEPARENT_VERSION}\n */\nexport const TRACEPARENT_HEADER = \"traceparent\";\n\n/** traceparent header version prefix. */\nexport const TRACEPARENT_VERSION = \"00\";\n\n// ----------------------------------\n// Breadcrumbs\n// ----------------------------------\n\n/** Smallest valid breadcrumb buffer capacity. */\nexport const BREADCRUMB_MIN_CAPACITY = 1;\n\n// ----------------------------------\n// Sampling\n// ----------------------------------\n//\n// FNV-1a hash constants, used to turn a sampling key into a stable 0-1\n// fraction.\n\n/** FNV-1a 32-bit offset basis. */\nexport const FNV_OFFSET_BASIS = 0x811c9dc5;\n\n/** FNV-1a 32-bit prime. */\nexport const FNV_PRIME = 0x01000193;\n\n/** Largest 32-bit unsigned value. */\nexport const UINT32_MAX = 0xffffffff;\n\n// ----------------------------------\n// Pipeline\n// ----------------------------------\n\n/** Record kind routed to the metric stream. */\nexport const LOG_TYPE_METRIC: LogType = \"metric\";\n\n// ----------------------------------\n// Bus\n// ----------------------------------\n\n/** Protocol identifier for bus envelopes. Mismatched versions are dropped. */\nexport const BUS_PROTOCOL = \"ui-observability/1\";\n\n/** Global window property key used to locate a same-origin runtime instance. */\nexport const RUNTIME_GLOBAL_KEY = \"ui-observability.runtime\";\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Maximum error records captured per throttling window before suppression. */\nexport const ERROR_STORM_MAX_PER_WINDOW = 20;\n\n/** Error rate-limiting window duration in milliseconds. */\nexport const ERROR_STORM_WINDOW_MS = 10_000;\n\n/**\n * Max ERROR and FATAL records admitted to the pipeline per storm window.\n * A backstop against a render loop, not a shaper: ERROR and FATAL bypass sampling,\n * and a direct logger.error call has no other limit.\n */\nexport const ERROR_CEILING_MAX_PER_WINDOW = 500;\n\n/** Maximum distinct error signatures tracked for deduplication before LRU eviction. */\nexport const MAX_TRACKED_ERROR_SIGNATURES = 200;\n\n/** Maximum character length retained from clicked element text in breadcrumbs. */\nexport const CLICK_TEXT_MAX_CHARS = 50;\n\n/** Maximum character length retained from an aria-label attribute in generated selectors. */\nexport const ARIA_LABEL_MAX_CHARS = 40;\n\n/** Maximum class names included per element in generated CSS selectors. */\nexport const SELECTOR_MAX_CLASSES = 2;\n\n/** CSS styling applied to console prefix labels. */\nexport const CONSOLE_PREFIX_STYLE = \"color:#888\";\n\n/** Scaling factor for rounding duration measurements to three decimal places. */\nexport const DURATION_PRECISION = 1000;\n\n// ----------------------------------\n// Runtime\n// ----------------------------------\n\n/** Minimum duration in milliseconds between storage gap warning reports. */\nexport const GAP_REPORT_THROTTLE_MS = 60_000;\n\n/** Default namespace for telemetry records emitted by auto-capture modules. */\nexport const CAPTURE_NAMESPACE = \"uiobs.capture\";\n\n/** Default namespace for telemetry records emitted by storage subsystems. */\nexport const STORAGE_NAMESPACE = \"uiobs.storage\";\n\n/** Fallback measurement unit applied when none is specified. */\nexport const DEFAULT_METRIC_UNIT = \"count\";\n\n// ----------------------------------\n// Configuration\n// ----------------------------------\n\n/** Default `service.name` when a consumer sets none. */\nexport const UNKNOWN_SERVICE_NAME = \"unknown-service\";\n\n/** Lowest sampling rate (drop everything). */\nexport const SAMPLING_RATE_MIN = 0;\n\n/** Highest sampling rate (keep everything). */\nexport const SAMPLING_RATE_MAX = 1;\n\n/**\n * Fallback for an invalid sampling rate (keep everything).\n * @see {@link SAMPLING_RATE_MAX}\n */\nexport const SAMPLING_RATE_FALLBACK = 1;\n\n/**\n * Config keys with no default, excluded from `DEFAULT_CONFIG`.\n * @see {@link DEFAULT_CONFIG}\n */\nexport const UNDEFAULTED_CONFIG_KEYS = [\n \"redact\",\n \"onDiagnostic\",\n \"headers\",\n \"serializer\",\n \"otelLoader\",\n] as const;\n\n/**\n * Nested config section keys.\n * @see {@link ResolvedConfig}\n */\nexport const CONFIG_SECTIONS = [\"sampling\", \"bus\", \"capture\"] as const;\n\n/**\n * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]> = {\n sampling: [],\n bus: [],\n capture: [\"webVitalsLoader\"],\n};\n\n/**\n * Default runtime config, before a consumer's `configure()` call.\n * Excludes `serializer`; `resolveConfig` supplies its default to avoid a circular import.\n * @see {@link ResolvedConfig}\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const DEFAULT_CONFIG: Omit<ResolvedConfig, \"serializer\"> = {\n endpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n compression: \"gzip\",\n credentials: \"omit\",\n storage: \"auto\",\n sampling: { defaultRate: 1, rates: {}, alwaysSampleTypes: [\"action\"] },\n bus: { mode: \"auto\", trustedOrigins: [], openFinRole: \"auto\" },\n capture: {\n errors: true,\n rejections: true,\n resourceErrors: false,\n fetch: false,\n xhr: false,\n interactions: false,\n navigation: false,\n webVitals: false,\n fullUrls: false,\n ignoreUrls: [],\n propagateTraceHeaderTo: [],\n },\n console: null,\n};\n\n/** Console mirroring level used when a consumer passes `console: true`. */\nexport const CONSOLE_DEFAULT_LEVEL: LogLevel = \"DEBUG\";\n\n// ----------------------------------\n// Batching\n// ----------------------------------\n\n/** Max time a partial log batch waits before it is sent, in milliseconds. */\nexport const LOG_FLUSH_INTERVAL_MS = 2000;\n\n/** Max records per log batch before it is sent early. */\nexport const LOG_BATCH_SIZE = 100;\n\n/** Max time a partial metric batch waits before it is sent, in milliseconds. Metrics batch harder than logs: higher volume, nothing waits on them. */\nexport const METRIC_FLUSH_INTERVAL_MS = 10_000;\n\n/** Max records per metric batch before it is sent early. */\nexport const METRIC_BATCH_SIZE = 500;\n\n/** Max concurrent ingest requests, across both streams. */\nexport const MAX_CONCURRENT_REQUESTS = 2;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Max time one ingest request may take before it is aborted and retried, in milliseconds. */\nexport const REQUEST_TIMEOUT_MS = 15_000;\n\n/** Min payload size to compress, in bytes. */\nexport const COMPRESSION_THRESHOLD_BYTES = 1024;\n\n// ----------------------------------\n// Storage retention\n// ----------------------------------\n\n/** IndexedDB database name. */\nexport const STORAGE_DB_NAME = \"UiObservability\";\n\n/** Capacity and retention thresholds every storage adapter enforces. */\nexport const STORAGE_LIMITS: StorageLimits = {\n maxBatches: 500,\n maxAgeMs: 24 * 60 * 60 * 1000,\n maxAttempts: 5,\n};\n\n/**\n * Max time one storage call may take before it is treated as failed, in milliseconds.\n * A call that does not settle holds a dispatch slot or the drain flag.\n */\nexport const STORAGE_DEADLINE_MS = 10_000;\n\n// ----------------------------------\n// Retry backoff\n// ----------------------------------\n\n/** First backoff step, in milliseconds. Each attempt doubles it. */\nexport const RETRY_BASE_DELAY_MS = 2000;\n\n/** Backoff ceiling, in milliseconds. */\nexport const RETRY_MAX_DELAY_MS = 60_000;\n\n/** How often to check for stored work when nothing has failed recently, in milliseconds. */\nexport const RETRY_IDLE_DELAY_MS = 30_000;\n\n// ----------------------------------\n// Journey lifetime\n// ----------------------------------\n\n/** Max time a journey stays open before it is treated as abandoned, in milliseconds. */\nexport const JOURNEY_MAX_AGE_MS = 30 * 60 * 1000;\n\n/** Whether closing the owning context ends the journey for everyone. */\nexport const JOURNEY_END_ON_OWNER_CLOSE = false;\n\n/** Query parameter checked at boot for a seeded journey token. */\nexport const JOURNEY_URL_PARAM = \"__uiobs_journey\";\n\n// ----------------------------------\n// Bus handshake\n// ----------------------------------\n\n/** BroadcastChannel name for the control plane. */\nexport const BUS_CHANNEL_NAME = \"ui_observability_control\";\n\n/** Max time a forwarder waits for an owner to answer before it promotes itself, in milliseconds. */\nexport const BUS_HANDSHAKE_TIMEOUT_MS = 1500;\n\n/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */\nexport const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;\n\n/** Max records a context buffers before its bus role is determined. */\nexport const BUS_MAX_BOOT_BUFFER_RECORDS = 500;\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Breadcrumbs kept as context for the next error. */\nexport const MAX_BREADCRUMBS = 50;\n\n/** Window within which identical errors are counted but not re-sent, in milliseconds. */\nexport const ERROR_DEDUPE_MS = 5000;\n\n// ----------------------------------\n// Per-record size caps\n// ----------------------------------\n\n/** Size caps applied to every record, enforced after sanitize and after redact. */\nexport const RECORD_LIMITS = {\n maxBodyChars: 4096,\n maxAttributeChars: 8192,\n maxAttributeCount: 128,\n maxStackChars: 8192,\n maxDepth: 6,\n maxArrayLength: 100,\n maxNodes: 10_000,\n maxRecordBytes: 32_768,\n};\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- var ee=/OpenFin/i,te=/\bwv\b/,e=/\b(iPhone|iPad|iPod)\b/,t=/\bMacintosh\b/,n=/\bMobile\b/,r={TRACE:1,DEBUG:5,INFO:9,WARN:13,ERROR:17,FATAL:21},i=r,a=`log.type`,o=`log.seq`,s=`app.namespace`,c=`page.url`,l=`url.full`,u=`journey.id`,d=`journey.name`,f=`journey.parent_id`,p=`uiobs.sanitize_failed`,m=`uiobs.attributes_dropped`,h=`uiobs.attributes_bytes`,g=`service.name`,_=`service.version`,v=`deployment.environment`,y=`telemetry.sdk.name`,b=`telemetry.sdk.version`,x=`telemetry.sdk.language`,S=`host.platform`,C=`session.id`,w=`tab.id`,T=`context.id`,E=`browser.user_agent`,D=`openfin.uuid`,O=`openfin.name`,k=`@utk09/ui-observability`,A=`0.4.1`,j=`webjs`,M=`otlp`,N={WARN:`warning`},P=`application/json`,F=`application/x-ndjson`,I=1000000n,L=/^\d+$/,R=`Content-Type`,z=`Content-Encoding`,B=`Retry-After`,V=`X-UiObs-Batch-Id`,H=`X-UiObs-Attempt`,U=`gzip`,W=1e3,G=6e4,K=`text/plain;charset=UTF-8`,q=`uiobs_batch_id`,J=`uiobs_exit`,Y=`ui-observability.batch.`,X=`ui-observability.emergency.`,Z=`ui-observability.probe`,Q=`QuotaExceededError`,ne=`batches`,$=`createdAt`,re=`indexeddb`,ie=`localstorage`,ae=`memory`,oe=`none`,se=`ui-observability.drain`,ce=`ui-observability.emergency`,le=`ui-observability.journey`,ue=2e3,de=`uiObsJourney`,fe=/\+/g,pe=/\//g,me=/=+$/,he=/-/g,ge=/_/g,_e=3e5,ve=`traceparent`,ye=2166136261,be=16777619,xe=4294967295,Se=`metric`,Ce=`ui-observability/1`,we=`ui-observability.runtime`,Te=1e4,Ee=`color:#888`,De=1e3,Oe=6e4,ke=`uiobs.capture`,Ae=`uiobs.storage`,je=`count`,Me=`unknown-service`,Ne=[`redact`,`onDiagnostic`,`headers`,`serializer`,`otelLoader`],Pe=[`sampling`,`bus`,`capture`],Fe={sampling:[],bus:[],capture:[`webVitalsLoader`]},Ie={endpoint:``,serviceName:``,serviceVersion:``,environment:``,enabled:!0,minLevel:`INFO`,compression:`gzip`,credentials:`omit`,storage:`auto`,sampling:{defaultRate:1,rates:{},alwaysSampleTypes:[`action`]},bus:{mode:`auto`,trustedOrigins:[],openFinRole:`auto`},capture:{errors:!0,rejections:!0,resourceErrors:!1,fetch:!1,xhr:!1,interactions:!1,navigation:!1,webVitals:!1,fullUrls:!1,ignoreUrls:[],propagateTraceHeaderTo:[]},console:null},Le=`DEBUG`,Re=2e3,ze=1e4,Be=15e3,Ve=1024,He=`UiObservability`,Ue={maxBatches:500,maxAgeMs:864e5,maxAttempts:5},We=1e4,Ge=2e3,Ke=6e4,qe=3e4,Je=18e5,Ye=`__uiobs_journey`,Xe=`ui_observability_control`,Ze=1500,Qe=5e3,$e={maxBodyChars:4096,maxAttributeChars:8192,maxAttributeCount:128,maxStackChars:8192,maxDepth:6,maxArrayLength:100,maxNodes:1e4,maxRecordBytes:32768};Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return`ui-observability.session`}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return 6e4}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return 18e5}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return 56319}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return 55296}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return`[ui-observability]`}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return`AppleWebKit`}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return`ui-observability.tab`}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return 2048}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return`Safari/`}});
2
- //# sourceMappingURL=constants-tQpoTzkY.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-tQpoTzkY.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["// src/constants.ts\n//\n// All limits, thresholds, timing windows, storage keys, patterns, and\n// defaults used by the library.\n\nimport type { ResolvedConfig } from \"./models/config\";\nimport type { LogLevel, LogType } from \"./models/log-record\";\nimport type { StorageLimits } from \"./models/storage\";\n\n// ----------------------------------\n// Library-wide\n// ----------------------------------\n\n/** Prefix on console messages this library writes. */\nexport const LIBRARY_LOG_PREFIX = \"[ui-observability]\";\n\n// ----------------------------------\n// Diagnostics\n// ----------------------------------\n\n/** Throttle window per diagnostic code, in milliseconds. Limits how often an error loop can spam the handler. */\nexport const DIAGNOSTIC_THROTTLE_MS = 1000;\n\n// ----------------------------------\n// Identity\n// ----------------------------------\n\n/** `localStorage` key for the session id and its last-seen time. */\nexport const SESSION_ID_KEY = \"ui-observability.session\";\n\n/** `sessionStorage` key for the tab id. */\nexport const TAB_ID_KEY = \"ui-observability.tab\";\n\n/** Session idle timeout, in milliseconds. */\nexport const SESSION_IDLE_MS = 30 * 60 * 1000;\n\n/** Min gap between session last-seen writes, in milliseconds. */\nexport const SESSION_TOUCH_MS = 60_000;\n\n/** Random id length, in bytes, used when `crypto.randomUUID` is unavailable. */\nexport const ID_BYTE_LENGTH = 16;\n\n/** Distinct values in one byte (256). */\nexport const BYTE_VALUE_COUNT = 256;\n\n// ----------------------------------\n// Platform detection\n// ----------------------------------\n\n/** Matches OpenFin's user agent. */\nexport const OPENFIN_UA_PATTERN = /OpenFin/i;\n\n/** Matches Android's webview token (`wv`). */\nexport const ANDROID_WEBVIEW_UA_PATTERN = /\\bwv\\b/;\n\n/** Matches iOS hardware: iPhone, iPad, iPod. */\nexport const IOS_DEVICE_UA_PATTERN = /\\b(iPhone|iPad|iPod)\\b/;\n\n/** Matches desktop macOS in a user agent. */\nexport const MACINTOSH_UA_PATTERN = /\\bMacintosh\\b/;\n\n/** Matches the mobile token. */\nexport const MOBILE_UA_PATTERN = /\\bMobile\\b/;\n\n/** WebKit engine token, present in every WebKit browser including webviews. */\nexport const WEBKIT_UA_TOKEN = \"AppleWebKit\";\n\n/** Safari token sent by real iOS browsers, not in-app webviews. */\nexport const SAFARI_UA_TOKEN = \"Safari/\";\n\n// ----------------------------------\n// Sanitizing and size estimation\n// ----------------------------------\n\n/** First UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/** Last UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/** Code units below this encode as one UTF-8 byte. */\nexport const UTF8_ONE_BYTE_CEILING = 0x80;\n\n/** Code units below this, and at or above the one-byte ceiling, encode as two UTF-8 bytes. */\nexport const UTF8_TWO_BYTE_CEILING = 0x800;\n\n/** Class names kept in a `describeNode` selector. */\nexport const MAX_NODE_CLASS_NAMES = 3;\n\n/** Byte cost of a null or undefined value. */\nexport const BYTES_PER_NULL = 4;\n\n/** Byte cost of a number (flat estimate). */\nexport const BYTES_PER_NUMBER = 8;\n\n/** Byte cost of a boolean. */\nexport const BYTES_PER_BOOLEAN = 5;\n\n/** Byte cost of an object or array's wrapping braces or brackets. */\nexport const BYTES_PER_CONTAINER = 2;\n\n/** Byte cost of a string's wrapping quotes. */\nexport const BYTES_PER_QUOTED_STRING = 2;\n\n/** Byte cost of one key's punctuation: quotes, colon, comma. */\nexport const BYTES_PER_KEY_OVERHEAD = 4;\n\n// ----------------------------------\n// Record model\n// ----------------------------------\n\n/**\n * Log level to OpenTelemetry severity number.\n * @see {@link LEVEL_ORDER}\n */\nexport const SEVERITY_NUMBER: Record<LogLevel, number> = {\n TRACE: 1,\n DEBUG: 5,\n INFO: 9,\n WARN: 13,\n ERROR: 17,\n FATAL: 21,\n};\n\n/**\n * Alias for `SEVERITY_NUMBER`, used by the level filter.\n * @see {@link SEVERITY_NUMBER}\n */\nexport const LEVEL_ORDER: Record<LogLevel, number> = SEVERITY_NUMBER;\n\n// ----------------------------------\n// Attribute and resource keys\n// ----------------------------------\n//\n// Attribute and resource key names records carry on the wire, following\n// OpenTelemetry conventions. `uiobs.` marks this library's own fields.\n\n/** Record kind attribute key. */\nexport const ATTR_LOG_TYPE = \"log.type\";\n\n/** Record sequence number within its context, from zero. */\nexport const ATTR_LOG_SEQ = \"log.seq\";\n\n/** Logger namespace attribute key. */\nexport const ATTR_APP_NAMESPACE = \"app.namespace\";\n\n/** Document URL when the record was built. */\nexport const ATTR_PAGE_URL = \"page.url\";\n\n/**\n * HTTP request URL attribute key, set by network capture. Don't reuse `ATTR_PAGE_URL`; it would overwrite the request's target.\n * @see {@link ATTR_PAGE_URL}\n */\nexport const ATTR_URL_FULL = \"url.full\";\n\n/** Journey id attribute key. */\nexport const ATTR_JOURNEY_ID = \"journey.id\";\n\n/** Journey name attribute key. */\nexport const ATTR_JOURNEY_NAME = \"journey.name\";\n\n/** Parent journey id, present only on a child journey. */\nexport const ATTR_JOURNEY_PARENT_ID = \"journey.parent_id\";\n\n/** Marks a record whose attributes failed to sanitize. */\nexport const ATTR_SANITIZE_FAILED = \"uiobs.sanitize_failed\";\n\n/**\n * Marks a record whose attributes were dropped for exceeding the byte budget.\n * @see {@link ATTR_ATTRIBUTES_BYTES}\n */\nexport const ATTR_ATTRIBUTES_DROPPED = \"uiobs.attributes_dropped\";\n\n/**\n * Byte size of the dropped attributes.\n * @see {@link ATTR_ATTRIBUTES_DROPPED}\n */\nexport const ATTR_ATTRIBUTES_BYTES = \"uiobs.attributes_bytes\";\n\n/** Application name resource key. */\nexport const RESOURCE_SERVICE_NAME = \"service.name\";\n\n/** Application build version resource key. */\nexport const RESOURCE_SERVICE_VERSION = \"service.version\";\n\n/** Deployment environment resource key. */\nexport const RESOURCE_DEPLOYMENT_ENVIRONMENT = \"deployment.environment\";\n\n/**\n * Producer library name resource key.\n * @see {@link TELEMETRY_SDK_NAME}\n */\nexport const RESOURCE_TELEMETRY_SDK_NAME = \"telemetry.sdk.name\";\n\n/**\n * Producer library version resource key.\n * @see {@link TELEMETRY_SDK_VERSION}\n */\nexport const RESOURCE_TELEMETRY_SDK_VERSION = \"telemetry.sdk.version\";\n\n/**\n * Producer SDK language resource key.\n * @see {@link TELEMETRY_SDK_LANGUAGE}\n */\nexport const RESOURCE_TELEMETRY_SDK_LANGUAGE = \"telemetry.sdk.language\";\n\n/** Host platform resource key: browser, webview, or OpenFin. */\nexport const RESOURCE_HOST_PLATFORM = \"host.platform\";\n\n/** Session id resource key. */\nexport const RESOURCE_SESSION_ID = \"session.id\";\n\n/** Tab id resource key. */\nexport const RESOURCE_TAB_ID = \"tab.id\";\n\n/** Context (realm) id resource key. */\nexport const RESOURCE_CONTEXT_ID = \"context.id\";\n\n/** Raw user agent resource key. */\nexport const RESOURCE_BROWSER_USER_AGENT = \"browser.user_agent\";\n\n/** OpenFin application uuid resource key. */\nexport const RESOURCE_OPENFIN_UUID = \"openfin.uuid\";\n\n/** OpenFin window or view name resource key. */\nexport const RESOURCE_OPENFIN_NAME = \"openfin.name\";\n\n/**\n * Value of `telemetry.sdk.name`.\n * @see {@link RESOURCE_TELEMETRY_SDK_NAME}\n */\nexport const TELEMETRY_SDK_NAME = \"@utk09/ui-observability\";\n\n/**\n * Value of `telemetry.sdk.version`. A literal, not read from package.json. Bump by hand alongside package.json.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = \"0.4.1\";\n\n/**\n * Value of `telemetry.sdk.language`.\n * @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}\n */\nexport const TELEMETRY_SDK_LANGUAGE = \"webjs\";\n\n// ----------------------------------\n// Serializers\n// ----------------------------------\n\n/** OTLP/JSON serializer name. */\nexport const SERIALIZER_NAME_OTLP = \"otlp\";\n\n/** ECS serializer name. */\nexport const SERIALIZER_NAME_ECS = \"ecs\";\n\n/**\n * ECS `log.level` names that differ from the lowercased severity text. ECS spells\n * the warning level in full; every other level matches once lowercased.\n * @see {@link SERIALIZER_NAME_ECS}\n */\nexport const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>> = { WARN: \"warning\" };\n\n/** Content type for an OTLP/JSON body. */\nexport const CONTENT_TYPE_JSON = \"application/json\";\n\n/** Content type for newline-delimited JSON. */\nexport const CONTENT_TYPE_NDJSON = \"application/x-ndjson\";\n\n/** Nanoseconds per millisecond. */\nexport const NANOS_PER_MILLI = 1000000n;\n\n/**\n * Matches a nanosecond epoch written as decimal digits, e.g. \"1755543600123000000\".\n * @see {@link NANOS_PER_MILLI}\n */\nexport const NANOS_PATTERN = /^\\d+$/;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Content-Type header name. */\nexport const HEADER_CONTENT_TYPE = \"Content-Type\";\n\n/** Content-Encoding header name. */\nexport const HEADER_CONTENT_ENCODING = \"Content-Encoding\";\n\n/** Retry-After header name. */\nexport const HEADER_RETRY_AFTER = \"Retry-After\";\n\n/**\n * Batch deduplication key header name.\n * @see {@link QUERY_PARAM_BATCH_ID}\n */\nexport const HEADER_BATCH_ID = \"X-UiObs-Batch-Id\";\n\n/** Delivery attempt number header name. */\nexport const HEADER_ATTEMPT = \"X-UiObs-Attempt\";\n\n/** Gzip encoding name. */\nexport const ENCODING_GZIP = \"gzip\";\n\n/** 401, credentials missing or rejected. */\nexport const HTTP_UNAUTHORIZED = 401;\n\n/** 403, valid credentials but access denied. */\nexport const HTTP_FORBIDDEN = 403;\n\n/** 408, the server closed the connection after a timeout. Retryable. */\nexport const HTTP_REQUEST_TIMEOUT = 408;\n\n/** 413, payload too large; batch must be split. */\nexport const HTTP_PAYLOAD_TOO_LARGE = 413;\n\n/** 429, backpressure. */\nexport const HTTP_TOO_MANY_REQUESTS = 429;\n\n/** 500, floor for server-side errors. */\nexport const HTTP_SERVER_ERROR_MIN = 500;\n\n/** 503, temporary unavailability. */\nexport const HTTP_SERVICE_UNAVAILABLE = 503;\n\n/** Milliseconds per second. */\nexport const MILLIS_PER_SECOND = 1000;\n\n// ----------------------------------\n// Exit flush\n// ----------------------------------\n\n/** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */\nexport const BEACON_LIMIT_BYTES = 60_000;\n\n/** Content type for an exit payload. CORS-safelisted, avoids a preflight. */\nexport const CONTENT_TYPE_TEXT_PLAIN = \"text/plain;charset=UTF-8\";\n\n/**\n * Batch id query param name, for the exit path.\n * @see {@link HEADER_BATCH_ID}\n */\nexport const QUERY_PARAM_BATCH_ID = \"uiobs_batch_id\";\n\n/** Exit reason query param name, for logs only. */\nexport const QUERY_PARAM_EXIT_REASON = \"uiobs_exit\";\n\n// ----------------------------------\n// Storage\n// ----------------------------------\n\n/** localStorage key prefix for a parked batch. */\nexport const BATCH_STORAGE_KEY_PREFIX = \"ui-observability.batch.\";\n\n/** Zero-padded digit width for the creation time in a batch key. */\nexport const BATCH_KEY_TIME_WIDTH = 14;\n\n/** localStorage key prefix for a batch parked by exit flush. */\nexport const EMERGENCY_STORAGE_KEY_PREFIX = \"ui-observability.emergency.\";\n\n/** Max exit batches held at once. */\nexport const EMERGENCY_MAX_ENTRIES = 20;\n\n/** Key used to test whether localStorage accepts writes. */\nexport const STORAGE_PROBE_KEY = \"ui-observability.probe\";\n\n/** Fraction of the store evicted on a quota error (1 in N). */\nexport const QUOTA_EVICTION_DIVISOR = 4;\n\n/** DOMException name for a full store. */\nexport const QUOTA_EXCEEDED_ERROR = \"QuotaExceededError\";\n\n/**\n * Native IndexedDB version. It starts at 11 because Dexie, which this replaced,\n * opened the same database at ten times its own declared version. Anything below\n * 11 makes open() fail with VersionError for an existing installation and every\n * batch already stored there is stranded.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 11;\n\n/** IndexedDB object store holding batches. Named by Dexie before it was removed. */\nexport const INDEXEDDB_STORE_NAME = \"batches\";\n\n/** Index on the batch store that orders reads by creation time. */\nexport const INDEXEDDB_CREATED_AT_INDEX = \"createdAt\";\n\n/** IndexedDB adapter/strategy name. */\nexport const STORAGE_NAME_INDEXEDDB = \"indexeddb\";\n\n/** localStorage adapter/strategy name. */\nexport const STORAGE_NAME_LOCAL = \"localstorage\";\n\n/** In-memory adapter/strategy name. */\nexport const STORAGE_NAME_MEMORY = \"memory\";\n\n/** No-op adapter/strategy name. */\nexport const STORAGE_NAME_NONE = \"none\";\n\n// ----------------------------------\n// Retry\n// ----------------------------------\n\n/**\n * Origin-wide lock name a drain runs under.\n * @see {@link EMERGENCY_LOCK_NAME}\n */\nexport const DRAIN_LOCK_NAME = \"ui-observability.drain\";\n\n/**\n * Lock name startup recovery runs under.\n * @see {@link DRAIN_LOCK_NAME}\n */\nexport const EMERGENCY_LOCK_NAME = \"ui-observability.emergency\";\n\n/** Batches sent per drain tick. */\nexport const BATCHES_PER_DRAIN = 20;\n\n// ----------------------------------\n// Journey\n// ----------------------------------\n\n/** `sessionStorage` key for the current journey. */\nexport const JOURNEY_STORAGE_KEY = \"ui-observability.journey\";\n\n/**\n * Max journey name length in a token, in characters.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;\n\n/**\n * Max whole-token length, in characters. A tripwire, not validation.\n * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_MAX_CHARS = 256;\n\n/**\n * How long to wait for `fin.me.getOptions()` before giving up on a seeded journey,\n * in milliseconds.\n * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}\n */\nexport const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;\n\n/** Key under an OpenFin window's `customData` carrying a seeded journey token. */\nexport const OPENFIN_JOURNEY_CUSTOM_DATA_KEY = \"uiObsJourney\";\n\n/** Matches `+` in standard base64 (`-` in URL-safe). */\nexport const BASE64_PLUS_PATTERN = /\\+/g;\n\n/** Matches `/` in standard base64 (`_` in URL-safe). */\nexport const BASE64_SLASH_PATTERN = /\\//g;\n\n/** Matches trailing `=` padding. */\nexport const BASE64_PADDING_PATTERN = /=+$/;\n\n/** Matches `-` in URL-safe base64 (`+` in standard). */\nexport const BASE64URL_DASH_PATTERN = /-/g;\n\n/** Matches `_` in URL-safe base64 (`/` in standard). */\nexport const BASE64URL_UNDERSCORE_PATTERN = /_/g;\n\n/** Base64 characters per 3-byte group. */\nexport const BASE64_GROUP_CHARS = 4;\n\n// ----------------------------------\n// Tracing\n// ----------------------------------\n\n/** W3C trace id width, in bytes. */\nexport const TRACE_ID_BYTES = 16;\n\n/** W3C span id width, in bytes. */\nexport const SPAN_ID_BYTES = 8;\n\n/** Max ambient trace lifetime with no activity, in milliseconds. */\nexport const TRACE_MAX_AGE_MS = 5 * 60 * 1000;\n\n/** trace-flags value with the sampled bit set. */\nexport const TRACE_FLAGS_SAMPLED = 1;\n\n/** Mask for the one-byte trace-flags field. */\nexport const TRACE_FLAGS_MASK = 0xff;\n\n/**\n * W3C trace context header name\n * @see {@link TRACEPARENT_VERSION}\n */\nexport const TRACEPARENT_HEADER = \"traceparent\";\n\n/** traceparent header version prefix. */\nexport const TRACEPARENT_VERSION = \"00\";\n\n// ----------------------------------\n// Breadcrumbs\n// ----------------------------------\n\n/** Smallest valid breadcrumb buffer capacity. */\nexport const BREADCRUMB_MIN_CAPACITY = 1;\n\n// ----------------------------------\n// Sampling\n// ----------------------------------\n//\n// FNV-1a hash constants, used to turn a sampling key into a stable 0-1\n// fraction.\n\n/** FNV-1a 32-bit offset basis. */\nexport const FNV_OFFSET_BASIS = 0x811c9dc5;\n\n/** FNV-1a 32-bit prime. */\nexport const FNV_PRIME = 0x01000193;\n\n/** Largest 32-bit unsigned value. */\nexport const UINT32_MAX = 0xffffffff;\n\n// ----------------------------------\n// Pipeline\n// ----------------------------------\n\n/** Record kind routed to the metric stream. */\nexport const LOG_TYPE_METRIC: LogType = \"metric\";\n\n// ----------------------------------\n// Bus\n// ----------------------------------\n\n/** Protocol identifier for bus envelopes. Mismatched versions are dropped. */\nexport const BUS_PROTOCOL = \"ui-observability/1\";\n\n/** Global window property key used to locate a same-origin runtime instance. */\nexport const RUNTIME_GLOBAL_KEY = \"ui-observability.runtime\";\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Maximum error records captured per throttling window before suppression. */\nexport const ERROR_STORM_MAX_PER_WINDOW = 20;\n\n/** Error rate-limiting window duration in milliseconds. */\nexport const ERROR_STORM_WINDOW_MS = 10_000;\n\n/**\n * Max ERROR and FATAL records admitted to the pipeline per storm window.\n * A backstop against a render loop, not a shaper: ERROR and FATAL bypass sampling,\n * and a direct logger.error call has no other limit.\n */\nexport const ERROR_CEILING_MAX_PER_WINDOW = 500;\n\n/** Maximum distinct error signatures tracked for deduplication before LRU eviction. */\nexport const MAX_TRACKED_ERROR_SIGNATURES = 200;\n\n/** Maximum character length retained from clicked element text in breadcrumbs. */\nexport const CLICK_TEXT_MAX_CHARS = 50;\n\n/** Maximum character length retained from an aria-label attribute in generated selectors. */\nexport const ARIA_LABEL_MAX_CHARS = 40;\n\n/** Maximum class names included per element in generated CSS selectors. */\nexport const SELECTOR_MAX_CLASSES = 2;\n\n/** CSS styling applied to console prefix labels. */\nexport const CONSOLE_PREFIX_STYLE = \"color:#888\";\n\n/** Scaling factor for rounding duration measurements to three decimal places. */\nexport const DURATION_PRECISION = 1000;\n\n// ----------------------------------\n// Runtime\n// ----------------------------------\n\n/** Minimum duration in milliseconds between storage gap warning reports. */\nexport const GAP_REPORT_THROTTLE_MS = 60_000;\n\n/** Default namespace for telemetry records emitted by auto-capture modules. */\nexport const CAPTURE_NAMESPACE = \"uiobs.capture\";\n\n/** Default namespace for telemetry records emitted by storage subsystems. */\nexport const STORAGE_NAMESPACE = \"uiobs.storage\";\n\n/** Fallback measurement unit applied when none is specified. */\nexport const DEFAULT_METRIC_UNIT = \"count\";\n\n// ----------------------------------\n// Configuration\n// ----------------------------------\n\n/** Default `service.name` when a consumer sets none. */\nexport const UNKNOWN_SERVICE_NAME = \"unknown-service\";\n\n/** Lowest sampling rate (drop everything). */\nexport const SAMPLING_RATE_MIN = 0;\n\n/** Highest sampling rate (keep everything). */\nexport const SAMPLING_RATE_MAX = 1;\n\n/**\n * Fallback for an invalid sampling rate (keep everything).\n * @see {@link SAMPLING_RATE_MAX}\n */\nexport const SAMPLING_RATE_FALLBACK = 1;\n\n/**\n * Config keys with no default, excluded from `DEFAULT_CONFIG`.\n * @see {@link DEFAULT_CONFIG}\n */\nexport const UNDEFAULTED_CONFIG_KEYS = [\n \"redact\",\n \"onDiagnostic\",\n \"headers\",\n \"serializer\",\n \"otelLoader\",\n] as const;\n\n/**\n * Nested config section keys.\n * @see {@link ResolvedConfig}\n */\nexport const CONFIG_SECTIONS = [\"sampling\", \"bus\", \"capture\"] as const;\n\n/**\n * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]> = {\n sampling: [],\n bus: [],\n capture: [\"webVitalsLoader\"],\n};\n\n/**\n * Default runtime config, before a consumer's `configure()` call.\n * Excludes `serializer`; `resolveConfig` supplies its default to avoid a circular import.\n * @see {@link ResolvedConfig}\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const DEFAULT_CONFIG: Omit<ResolvedConfig, \"serializer\"> = {\n endpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n compression: \"gzip\",\n credentials: \"omit\",\n storage: \"auto\",\n sampling: { defaultRate: 1, rates: {}, alwaysSampleTypes: [\"action\"] },\n bus: { mode: \"auto\", trustedOrigins: [], openFinRole: \"auto\" },\n capture: {\n errors: true,\n rejections: true,\n resourceErrors: false,\n fetch: false,\n xhr: false,\n interactions: false,\n navigation: false,\n webVitals: false,\n fullUrls: false,\n ignoreUrls: [],\n propagateTraceHeaderTo: [],\n },\n console: null,\n};\n\n/** Console mirroring level used when a consumer passes `console: true`. */\nexport const CONSOLE_DEFAULT_LEVEL: LogLevel = \"DEBUG\";\n\n// ----------------------------------\n// Batching\n// ----------------------------------\n\n/** Max time a partial log batch waits before it is sent, in milliseconds. */\nexport const LOG_FLUSH_INTERVAL_MS = 2000;\n\n/** Max records per log batch before it is sent early. */\nexport const LOG_BATCH_SIZE = 100;\n\n/** Max time a partial metric batch waits before it is sent, in milliseconds. Metrics batch harder than logs: higher volume, nothing waits on them. */\nexport const METRIC_FLUSH_INTERVAL_MS = 10_000;\n\n/** Max records per metric batch before it is sent early. */\nexport const METRIC_BATCH_SIZE = 500;\n\n/** Max concurrent ingest requests, across both streams. */\nexport const MAX_CONCURRENT_REQUESTS = 2;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Max time one ingest request may take before it is aborted and retried, in milliseconds. */\nexport const REQUEST_TIMEOUT_MS = 15_000;\n\n/** Min payload size to compress, in bytes. */\nexport const COMPRESSION_THRESHOLD_BYTES = 1024;\n\n// ----------------------------------\n// Storage retention\n// ----------------------------------\n\n/** IndexedDB database name. */\nexport const STORAGE_DB_NAME = \"UiObservability\";\n\n/** Capacity and retention thresholds every storage adapter enforces. */\nexport const STORAGE_LIMITS: StorageLimits = {\n maxBatches: 500,\n maxAgeMs: 24 * 60 * 60 * 1000,\n maxAttempts: 5,\n};\n\n/**\n * Max time one storage call may take before it is treated as failed, in milliseconds.\n * A call that does not settle holds a dispatch slot or the drain flag.\n */\nexport const STORAGE_DEADLINE_MS = 10_000;\n\n// ----------------------------------\n// Retry backoff\n// ----------------------------------\n\n/** First backoff step, in milliseconds. Each attempt doubles it. */\nexport const RETRY_BASE_DELAY_MS = 2000;\n\n/** Backoff ceiling, in milliseconds. */\nexport const RETRY_MAX_DELAY_MS = 60_000;\n\n/** How often to check for stored work when nothing has failed recently, in milliseconds. */\nexport const RETRY_IDLE_DELAY_MS = 30_000;\n\n// ----------------------------------\n// Journey lifetime\n// ----------------------------------\n\n/** Max time a journey stays open before it is treated as abandoned, in milliseconds. */\nexport const JOURNEY_MAX_AGE_MS = 30 * 60 * 1000;\n\n/** Whether closing the owning context ends the journey for everyone. */\nexport const JOURNEY_END_ON_OWNER_CLOSE = false;\n\n/** Query parameter checked at boot for a seeded journey token. */\nexport const JOURNEY_URL_PARAM = \"__uiobs_journey\";\n\n// ----------------------------------\n// Bus handshake\n// ----------------------------------\n\n/** BroadcastChannel name for the control plane. */\nexport const BUS_CHANNEL_NAME = \"ui_observability_control\";\n\n/** Max time a forwarder waits for an owner to answer before it promotes itself, in milliseconds. */\nexport const BUS_HANDSHAKE_TIMEOUT_MS = 1500;\n\n/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */\nexport const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;\n\n/** Max records a context buffers before its bus role is determined. */\nexport const BUS_MAX_BOOT_BUFFER_RECORDS = 500;\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Breadcrumbs kept as context for the next error. */\nexport const MAX_BREADCRUMBS = 50;\n\n/** Window within which identical errors are counted but not re-sent, in milliseconds. */\nexport const ERROR_DEDUPE_MS = 5000;\n\n// ----------------------------------\n// Per-record size caps\n// ----------------------------------\n\n/** Size caps applied to every record, enforced after sanitize and after redact. */\nexport const RECORD_LIMITS = {\n maxBodyChars: 4096,\n maxAttributeChars: 8192,\n maxAttributeCount: 128,\n maxStackChars: 8192,\n maxDepth: 6,\n maxArrayLength: 100,\n maxNodes: 10_000,\n maxRecordBytes: 32_768,\n};\n"],"mappings":"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"}