@utk09/ui-observability 0.3.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -2,44 +2,67 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [0.4.0] - 2026-09-09
6
+
7
+ ### Breaking changes - v0.4.0
8
+
9
+ - The OpenFin bus topic is scoped to one application uuid. Upgrade all windows of an application together. A 0.3.0 window and a 0.4.0 window do not share a bus.
10
+ - ECS documents write each attribute under `labels` as a flat dotted key. A nested attribute was an object. Update saved queries.
11
+ - ECS `log.level` is `warning` for a WARN record. It was `warn`.
12
+ - `logger.error(message, payload)` reads a plain object in the error slot as the payload. It was the error reason. An array, an `Error` and a class instance stay error reasons.
13
+ - `configure({ storage })` after startup reports `config.invalid` and keeps the built adapter. The call was accepted before and did nothing.
14
+ - One record sanitizes to 10,000 nodes. Values past the cap become `[MaxNodes]`.
15
+
16
+ ```ts
17
+ // ECS attributes
18
+ { labels: { order: { id: "ORD-1" } } } // 0.3.0
19
+ { labels: { "order.id": "ORD-1" } } // 0.4.0
20
+ ```
21
+
22
+ ### Fixed - v0.4.0
23
+
24
+ - A quota eviction dropped the write it made room for. Both persistent adapters retry the write. A failed retry counts a gap with `reason: "quota"`.
25
+ - Sampling dropped the breadcrumb with the record. A sampled-out record keeps its breadcrumb. A record dropped by `redact` does not.
26
+ - A typo inside a config section passed in silence. `capture: { webVital: true }` reports `unknown config key "capture.webVital"`. The guard reads one level into `sampling`, `bus` and `capture`.
27
+ - A console method that throws stopped the caller's log call. The mirror is guarded and reports `handler.threw`.
28
+ - The session touch throttle was module state. Two runtimes in one document silenced each other. Each runtime holds its own throttle.
29
+
5
30
  ## [0.3.0] - 2026-09-08
6
31
 
7
32
  ### Breaking changes - v0.3.0
8
33
 
9
- - `credentials` now defaults to `"omit"`. The library sends no cookies to the ingest endpoint. Set `credentials: "include"` for cookie auth.
10
- - A recorded URL carries no query string and no fragment. This applies to `page.url`, `url.full`, `resource.url`, `page.url.previous` and their breadcrumbs. Set `capture.fullUrls: true` to keep the full URL.
11
- - `@opentelemetry/api` is now an optional peer dependency. Install it to put records on the traces your spans carry. Without it, the library mints its own `trace_id` and reports `trace.otel_failed` once. Set `otelLoader` if your bundler cannot resolve the import.
34
+ - `credentials` defaults to `"omit"`. The library sends no cookie to the ingest endpoint. Set `credentials: "include"` for cookie auth.
35
+ - A recorded URL holds no query string and no fragment. This covers `page.url`, `url.full`, `resource.url`, `page.url.previous` and their breadcrumbs. Set `capture.fullUrls: true` to keep the full URL.
36
+ - `@opentelemetry/api` is an optional peer dependency. Install it to put records on the traces your spans carry. Without it, the library mints its own `trace_id` and reports `trace.otel_failed` one time. Set `otelLoader` when your bundler cannot resolve the import.
12
37
  - `getLogger(namespace, options)` builds a new logger on each call. Only `getLogger(namespace)` is cached. A per-call `scopedContext` no longer stays in memory for the life of the document.
13
38
 
14
39
  ```ts
15
- // cookie auth, previously the default
40
+ // cookie auth, the default before 0.3.0
16
41
  configure({ endpoint, credentials: "include" });
17
42
 
18
- // query strings, previously always recorded
43
+ // query strings, always recorded before 0.3.0
19
44
  configure({ endpoint, capture: { fullUrls: true } });
20
45
  ```
21
46
 
22
- To join your own traces, install the peer: `npm install @opentelemetry/api`.
23
-
24
47
  ### Fixed - v0.3.0
25
48
 
26
- - `flush()` sent in-flight batches again under a new `X-UiObs-Batch-Id`. The server could not deduplicate them. `flush()` now takes the stream buffers only. The exit flush still takes both, because a document that closes cannot confirm delivery.
27
- - The bus posted to a child frame with the target origin `"*"`. A frame that navigated away received the `journey.id` and the `tab.id`. The bus now posts to the origin the child last spoke from.
28
- - `ERROR` and `FATAL` records bypass sampling and had no limit. A fixed window now admits 500 of them per 10 seconds. It counts the rest as `record.dropped_by_ceiling`.
49
+ - `flush()` sent an in-flight batch again under a new `X-UiObs-Batch-Id`. The server could not deduplicate it. `flush()` takes the stream buffers only. The exit flush still takes both, because a closing document cannot confirm delivery.
50
+ - The bus posted to a child frame with the target origin `"*"`. A frame that navigated away received the `journey.id` and the `tab.id`. The bus posts to the origin the child last spoke from.
51
+ - An `ERROR` and a `FATAL` record bypass sampling and had no limit. A fixed window admits 500 of them per 10 seconds. It counts the rest as `record.dropped_by_ceiling`.
29
52
 
30
53
  ### Performance - v0.3.0
31
54
 
32
- - Sampling runs before the library builds the record. A dropped record costs one hash. It no longer pays for sanitize, the resource block, `redact` or truncation.
55
+ - Sampling runs before the library builds the record. A dropped record costs one hash. It does not pay for sanitize, the resource block, `redact` or truncation.
33
56
 
34
57
  ## [0.2.0] - 2026-09-08
35
58
 
36
59
  ### Breaking changes - v0.2.0
37
60
 
38
- - Config was reduced from 63 keys in 9 sections to 31 keys in 3 sections.
39
- - Removed config keys are now fixed library defaults.
40
- - Unknown keys are ignored and reported through `onDiagnostic` as `config.invalid` with the message `unknown config key "<key>", ignored. Typo?`.
41
- - `storage` is now a strategy string instead of an object.
42
- - `console` is now a boolean or log level instead of an object.
61
+ - Config holds 31 keys in 3 sections. It held 63 keys in 9 sections.
62
+ - A removed key is a fixed library default.
63
+ - An unknown key is ignored. `onDiagnostic` reports `config.invalid` with the message `unknown config key "<key>", ignored. Typo?`.
64
+ - `storage` is a strategy string. It was an object.
65
+ - `console` is a boolean or a level name. It was an object.
43
66
 
44
67
  ```ts
45
68
  // 0.1.x
@@ -67,19 +90,19 @@ configure({ endpoint, console: "WARN" });
67
90
 
68
91
  ### Removed
69
92
 
70
- - `rxjs` replaced with the library's own buffering, batching, queueing, and deferral logic.
71
- - `dexie` replaced with raw IndexedDB behind `IdbDriver`.
72
- - Runtime dependency footprint reduced to `@opentelemetry/api`; `web-vitals` remains the optional peer dependency.
93
+ - The library replaces `rxjs` with its own buffering, batching, queueing and deferral.
94
+ - The library replaces `dexie` with raw IndexedDB behind `IdbDriver`.
95
+ - `@opentelemetry/api` is the only runtime dependency. `web-vitals` stays the optional peer.
73
96
 
74
97
  ### Changed - v0.2.0
75
98
 
76
- - IndexedDB database version increased to 11. Existing 0.1.x batches remain readable and are retried automatically after upgrade.
99
+ - The IndexedDB database version is 11. The upgrade keeps a 0.1.x batch readable and retries it.
77
100
 
78
101
  ## [0.1.2] - 2026-08-30
79
102
 
80
103
  ### Fixed - v0.1.2
81
104
 
82
- - `telemetry.sdk.version` was reporting `0.1.0` for records produced by `0.1.1`; the version constant and package version are now kept in sync.
105
+ - `telemetry.sdk.version` reported `0.1.0` for a record from `0.1.1`. The version constant and the package version stay in sync now.
83
106
 
84
107
  ## [0.1.1] - 2026-08-30
85
108
 
@@ -91,5 +114,5 @@ configure({ endpoint, console: "WARN" });
91
114
 
92
115
  ### Added
93
116
 
94
- - Initial release of `@utk09/ui-observability`.
95
- - Batching, gzip compression, OTLP/JSON and ECS serialization, durable IndexedDB and localStorage storage, retry/backoff delivery, `sendBeacon` exit flush, iframe/worker/OpenFin cross-context bus, and automatic capture of errors, network, interactions, navigation, and web vitals.
117
+ - First release of `@utk09/ui-observability`.
118
+ - Batching, gzip compression, OTLP/JSON and ECS serialization, IndexedDB and localStorage storage, retry with backoff, `sendBeacon` exit flush, an iframe, worker and OpenFin bus, and auto-capture of errors, network, interactions, navigation and web vitals.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @utk09/ui-observability
2
2
 
3
- Framework-agnostic UI observability and structured logging for browsers, embedded webviews, and OpenFin desktop containers.
3
+ Structured logging and UI observability for browsers, embedded webviews and OpenFin containers. The library imports no framework.
4
4
 
5
- Features include automatic batching, compression, persistent offline storage, exponential backoff retries, unload exit flushing, cross-realm bus coordination, and guaranteed never-throw execution. Payloads export as OTLP/JSON over HTTP.
5
+ The library batches records and sends them over HTTP as OTLP/JSON. A failed send persists to storage and retries. A closing document flushes what is left. Iframes, workers and OpenFin windows share one sender through the bus. A log call never throws.
6
6
 
7
- > **Status: Early Development.** Public APIs may change between minor releases. Pin exact versions.
7
+ > **Status: early development.** A minor release can change a public API. Pin the exact version.
8
8
 
9
9
  ---
10
10
 
@@ -16,9 +16,9 @@ npm install @utk09/ui-observability
16
16
 
17
17
  ### Peer Dependencies
18
18
 
19
- Both peers are optional. The library has no runtime dependencies.
19
+ Both peers are optional. The library has no runtime dependency.
20
20
 
21
- `web-vitals` (`^4 || ^5 || ^6`). Install it only when enabling `capture.webVitals`:
21
+ Install `web-vitals` (`^4 || ^5 || ^6`) for `capture.webVitals`:
22
22
 
23
23
  ```ts
24
24
  configure({
@@ -30,7 +30,7 @@ configure({
30
30
  });
31
31
  ```
32
32
 
33
- `@opentelemetry/api` (`^1`). Install it to put records on the traces your spans carry. Without it, the library mints its own `trace_id` and reports `trace.otel_failed` once. The library imports the package when it is installed. Set `otelLoader` if your bundler cannot resolve the import:
33
+ Install `@opentelemetry/api` (`^1`) to put records on the traces your spans carry. Without it, the library mints its own `trace_id` and reports `trace.otel_failed` one time. The library imports the package when it is installed. Set `otelLoader` when your bundler cannot resolve the import:
34
34
 
35
35
  ```ts
36
36
  configure({
@@ -43,7 +43,7 @@ configure({
43
43
 
44
44
  ## Quick Start
45
45
 
46
- Initialize once at application startup before logging:
46
+ Call `configure()` one time at startup, before the first log call.
47
47
 
48
48
  ```ts
49
49
  import { configure, getLogger } from "@utk09/ui-observability";
@@ -62,9 +62,9 @@ log.logAction("ORDER_SUBMIT", { orderId: "ORD-1001", qty: 100 });
62
62
  log.error("pricing call failed", caughtError);
63
63
  ```
64
64
 
65
- - `configure()` is idempotent. Re-calling it updates the existing runtime singleton in place.
66
- - Exactly one context per document calls `configure()`. A second call renames `service.name` on every record the others emit, so in a composed page the shell configures and each microfrontend takes a namespace.
67
- - Calls before `configure()` record safely to an unconfigured implicit runtime without throwing.
65
+ - `configure()` is idempotent. A later call updates the runtime singleton in place. `storage` is fixed at startup. A later change to it is reported and ignored.
66
+ - One context per document calls `configure()`. A second call renames `service.name` on the records of every other context. In a composed page, the shell configures, and each microfrontend takes a namespace.
67
+ - A log call before `configure()` goes to an implicit runtime. It does not throw.
68
68
 
69
69
  ---
70
70
 
@@ -72,81 +72,81 @@ log.error("pricing call failed", caughtError);
72
72
 
73
73
  ### Lifecycle & Setup
74
74
 
75
- | Function | Description |
76
- | ------------------- | ------------------------------------------------------ |
77
- | `configure(config)` | Initializes or updates the active runtime singleton. |
78
- | `shutdown()` | Flushes pending records and terminates all subsystems. |
75
+ | Function | Description |
76
+ | ------------------- | -------------------------------------------------- |
77
+ | `configure(config)` | Starts the runtime singleton, or updates it. |
78
+ | `shutdown()` | Flushes pending records and stops every subsystem. |
79
79
 
80
80
  ### Logging Methods
81
81
 
82
- | Function | Description |
83
- | ---------------------------------------------- | ----------------------------------------------------------------------------------------- |
84
- | `getLogger(namespace, options?)` | Returns a cached `OneLogger` for a namespace. With `options`, returns a new uncached one. |
85
- | `trace(msg, payload?)` | Logs a TRACE level record. |
86
- | `debug(msg, payload?)` | Logs a DEBUG level record. |
87
- | `info(msg, payload?)` | Logs an INFO level record. |
88
- | `warn(msg, payload?)` | Logs a WARN level record. |
89
- | `error(msg, err?, payload?)` | Logs an ERROR record with error instance and breadcrumb snapshot. |
90
- | `logAction(name, payload?)` | Logs a discrete user action. |
91
- | `logEvent(name, payload?)` | Logs a domain or lifecycle event. |
92
- | `logMetric(name, value, unit?, type?, attrs?)` | Logs a metric measurement (`gauge`, `counter`, `histogram`). |
93
- | `timeSync(label, fn, attrs?)` | Times a synchronous function and emits a duration histogram. |
94
- | `timeAsync(label, fn, attrs?)` | Times an asynchronous promise and emits a duration histogram. |
82
+ | Function | Description |
83
+ | ---------------------------------------------- | --------------------------------------------------------------------------------------- |
84
+ | `getLogger(namespace, options?)` | Returns the cached logger for a namespace. With `options`, returns a new one, uncached. |
85
+ | `trace(msg, payload?)` | Logs a TRACE record. |
86
+ | `debug(msg, payload?)` | Logs a DEBUG record. |
87
+ | `info(msg, payload?)` | Logs an INFO record. |
88
+ | `warn(msg, payload?)` | Logs a WARN record. |
89
+ | `error(msg, err?, payload?)` | Logs an ERROR record with the error and the breadcrumb trail. |
90
+ | `logAction(name, payload?)` | Logs one user action. |
91
+ | `logEvent(name, payload?)` | Logs one domain or lifecycle event. |
92
+ | `logMetric(name, value, unit?, type?, attrs?)` | Logs a measurement (`gauge`, `counter`, `histogram`). |
93
+ | `timeSync(label, fn, attrs?)` | Times a function and emits a duration histogram. |
94
+ | `timeAsync(label, fn, attrs?)` | Times a promise and emits a duration histogram. |
95
95
 
96
96
  ### Context & Correlation
97
97
 
98
98
  | Function | Description |
99
99
  | ------------------------------ | ------------------------------------------------------------- |
100
- | `setContext(key, value)` | Sets an ambient attribute on all subsequent records. |
100
+ | `setContext(key, value)` | Sets one ambient attribute on every later record. |
101
101
  | `setContextMap(values)` | Merges an attribute map into the ambient context. |
102
- | `removeContext(key)` | Removes an attribute from ambient context. |
103
- | `startJourney(name, options?)` | Starts a multi-window user journey workflow. |
104
- | `endJourney()` | Terminates the active journey. |
105
- | `currentJourney()` | Returns the active `Journey` instance or null. |
106
- | `getJourneyToken()` | Serializes the active journey into a cross-context URL token. |
107
- | `adoptJourney(token)` | Adopts a serialized journey token into the current context. |
108
- | `startTrace()` | Rotates the ambient distributed trace context. |
109
- | `getTraceHeaders()` | Returns W3C `traceparent` headers for outgoing HTTP requests. |
102
+ | `removeContext(key)` | Removes one attribute from the ambient context. |
103
+ | `startJourney(name, options?)` | Starts a journey across windows. |
104
+ | `endJourney()` | Ends the active journey. |
105
+ | `currentJourney()` | Returns the active `Journey`, or null. |
106
+ | `getJourneyToken()` | Serializes the active journey into a URL token. |
107
+ | `adoptJourney(token)` | Adopts a journey token into this context. |
108
+ | `startTrace()` | Rotates the ambient trace context. |
109
+ | `getTraceHeaders()` | Returns the W3C `traceparent` header for an outgoing request. |
110
110
  | `registerWorker(worker)` | Attaches a Web Worker or MessagePort to the bus. |
111
111
 
112
112
  ### Delivery & Diagnostics
113
113
 
114
- | Function | Description |
115
- | ------------------------- | ---------------------------------------------------------- |
116
- | `flush()` | Flushes pending records in the pipeline or forward buffer. |
117
- | `getQueueDepth()` | Returns the number of batches waiting in storage. |
118
- | `getDiagnosticCounters()` | Returns cumulative occurrence counts per diagnostic code. |
114
+ | Function | Description |
115
+ | ------------------------- | ------------------------------------------------------------- |
116
+ | `flush()` | Sends the records held in the pipeline or the forward buffer. |
117
+ | `getQueueDepth()` | Returns the number of batches in storage. |
118
+ | `getDiagnosticCounters()` | Returns the count of each diagnostic code. |
119
119
 
120
120
  ---
121
121
 
122
122
  ## Configuration Options
123
123
 
124
- `endpoint` is the only required property.
125
-
126
- | Key | Default | Description |
127
- | ---------------------------- | ------------ | -------------------------------------------------------------------------------- |
128
- | `endpoint` | _required_ | Target HTTP endpoint URL for log ingestion. |
129
- | `serviceName` | `""` | Service identifier attached to all records. |
130
- | `serviceVersion` | `""` | Application version attached to all records. |
131
- | `environment` | `""` | Deployment environment label (`production`, `staging`). |
132
- | `enabled` | `true` | Master kill-switch. When `false`, suppresses all logging. |
133
- | `minLevel` | `"INFO"` | Minimum severity threshold (`TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`). |
134
- | `compression` | `"gzip"` | Compression algorithm (`gzip`, `none`). Applies to payloads over 1 KB. |
135
- | `serializer` | `"otlp"` | Wire format (`otlp`, `ecs`, or custom `LogSerializer`). |
136
- | `credentials` | `"omit"` | Fetch credentials policy. Set `"include"` for cookie auth. |
137
- | `headers` | `{}` | Static headers or dynamic header resolver function. |
138
- | `storage` | `"auto"` | Persistence engine (`auto`, `indexeddb`, `localstorage`, `memory`, `none`). |
139
- | `sampling.defaultRate` | `1` | Keep rate applied when no namespace rule matches. |
140
- | `sampling.rates` | `{}` | Per-namespace keep rates, longest matching prefix wins. |
141
- | `sampling.alwaysSampleTypes` | `["action"]` | Record types kept regardless of rate. |
142
- | `bus.mode` | `"auto"` | Bus role (`auto`, `sender`, `forwarder`, `off`). |
143
- | `bus.trustedOrigins` | `[]` | Origins allowed to post records to this document from a cross-origin frame. |
144
- | `bus.openFinRole` | `"auto"` | OpenFin context role (`auto`, `provider`, `client`). |
145
- | `capture` | See below | Browser auto-instrumentation settings. |
146
- | `console` | `false` | Mirrors records to devtools. `true` mirrors from `DEBUG`, or name a level. |
147
- | `otelLoader()` | `undefined` | Supplies `@opentelemetry/api`. Omit it and the library imports the package. |
148
- | `redact(record)` | `undefined` | Hook to mutate or drop (`null`) records before ingest. |
149
- | `onDiagnostic(event)` | `undefined` | Listener for internal diagnostics and telemetry faults. |
124
+ `endpoint` is the only required key.
125
+
126
+ | Key | Default | Description |
127
+ | ---------------------------- | ------------ | --------------------------------------------------------------------------------- |
128
+ | `endpoint` | _required_ | HTTP endpoint that receives the batches. |
129
+ | `serviceName` | `""` | `service.name` on every record. |
130
+ | `serviceVersion` | `""` | `service.version` on every record. |
131
+ | `environment` | `""` | `deployment.environment` on every record. |
132
+ | `enabled` | `true` | Kill switch. `false` makes every log call a no-op. |
133
+ | `minLevel` | `"INFO"` | Lowest level that ships (`TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`). |
134
+ | `compression` | `"gzip"` | `gzip` or `none`. It applies above 1 KB. |
135
+ | `serializer` | `"otlp"` | `otlp`, `ecs`, or a custom `LogSerializer`. |
136
+ | `credentials` | `"omit"` | Fetch credentials mode. Set `"include"` for cookie auth. |
137
+ | `headers` | `{}` | Static headers, or a function that returns them. |
138
+ | `storage` | `"auto"` | `auto`, `indexeddb`, `localstorage`, `memory` or `none`. Fixed at startup. |
139
+ | `sampling.defaultRate` | `1` | Keep rate for a namespace with no rule. |
140
+ | `sampling.rates` | `{}` | Keep rate per namespace. The longest matching prefix wins. |
141
+ | `sampling.alwaysSampleTypes` | `["action"]` | Record types that ignore the rate. |
142
+ | `bus.mode` | `"auto"` | `auto`, `sender`, `forwarder` or `off`. |
143
+ | `bus.trustedOrigins` | `[]` | Origins that may post records from a cross-origin frame. |
144
+ | `bus.openFinRole` | `"auto"` | `auto`, `provider` or `client`. |
145
+ | `capture` | See below | Auto-capture settings. |
146
+ | `console` | `false` | Mirrors records to devtools. `true` starts at `DEBUG`. A level name starts there. |
147
+ | `otelLoader()` | `undefined` | Supplies `@opentelemetry/api`. Omit it and the library imports the package. |
148
+ | `redact(record)` | `undefined` | Mutates a record before it ships. Return `null` to drop it. |
149
+ | `onDiagnostic(event)` | `undefined` | Receives this library's own faults. |
150
150
 
151
151
  ### Auto-Capture Options
152
152
 
@@ -166,31 +166,28 @@ capture: {
166
166
  }
167
167
  ```
168
168
 
169
- `fullUrls` is off, so page URLs, request targets and failed resource URLs are recorded up to the first `?` or `#`. `ignoreUrls` and `propagateTraceHeaderTo` still match against the whole URL.
169
+ `fullUrls` is off. The library cuts a page URL, a request target and a failed resource URL at the first `?` or `#`. `ignoreUrls` and `propagateTraceHeaderTo` match the whole URL.
170
170
 
171
171
  ---
172
172
 
173
173
  ## Core Architecture
174
174
 
175
- - **Document Singleton:** The runtime pins to `globalThis[Symbol.for("ui-observability.runtime")]`. Federated microfrontends and separate bundles share one ring buffer, sequence generator, and transport.
176
- - **Single Sender Coordination:** Iframes, Web Workers, and OpenFin views discover the nearest long-lived context and forward records across the bus. That one context handles batching, storage, and network delivery for all of them.
177
- - **Five Correlation Dimensions:** Every record maps to `session.id`, `tab.id`, `context.id`, `journey.id`, and `trace_id`.
178
- - **Durability & Exit Flush:** Failed deliveries persist to IndexedDB/LocalStorage and retry with exponential jittered backoff. During `pagehide` or `freeze`, pending records drain via `navigator.sendBeacon` (under a 60 KB threshold) or persist to emergency storage.
179
- - **Deterministic Journey Sampling:** FNV-1a hashing applies sampling rates consistently across entire journeys. Errors and explicit actions bypass sampling filters.
175
+ - **Document singleton:** The runtime pins to `globalThis[Symbol.for("ui-observability.runtime")]`. Federated microfrontends and separate bundles share one buffer, one sequence and one transport.
176
+ - **One sender:** Iframes, workers and OpenFin views find the nearest long-lived context. They forward their records to it over the bus. That context batches, stores and sends for all of them.
177
+ - **Five correlation ids:** Each record carries `session.id`, `tab.id`, `context.id`, `journey.id` and `trace_id`.
178
+ - **Durability and exit flush:** A failed send persists to IndexedDB or localStorage, then retries with exponential jittered backoff. On `pagehide` or `freeze`, pending records go out with `navigator.sendBeacon` below 60 KB. A larger payload goes to the emergency queue.
179
+ - **Deterministic sampling:** FNV-1a hashing applies one keep rate to a whole journey. An error and an explicit action bypass sampling.
180
180
 
181
181
  ---
182
182
 
183
183
  ## Ingest Server Requirements
184
184
 
185
- Receiving servers must implement the following contract:
185
+ The server must obey this contract:
186
186
 
187
- 1. **Protocol & Method:** Accept HTTP `POST` requests with `Content-Type: application/json` or `Content-Type: text/plain;charset=UTF-8` (used by `sendBeacon` to avoid CORS preflights).
188
- 2. **Idempotency & Deduplication:** Deduplicate on `X-UiObs-Batch-Id` header and `uiobs_batch_id` query parameter for at least 24 hours.
189
- 3. **Throttling & CORS:** Return `429` or `503` with a `Retry-After` header, and expose it via `Access-Control-Expose-Headers: retry-after`.
190
- 4. **Payload Handling:**
191
- - `200`, `202`, or `204`: Accepted.
192
- - `413`: Payload too large. Prompts client batch splitting.
193
- - `4xx`: Non-retryable client error. Drops batch.
187
+ 1. **Protocol:** Accept `POST` with `Content-Type: application/json` or `text/plain;charset=UTF-8`. `sendBeacon` sends the second one to avoid a CORS preflight.
188
+ 2. **Deduplication:** Deduplicate on the `X-UiObs-Batch-Id` header and the `uiobs_batch_id` query parameter. Hold the ids for 24 hours minimum.
189
+ 3. **Throttling:** Return `429` or `503` with `Retry-After`. Expose the header with `Access-Control-Expose-Headers: retry-after`.
190
+ 4. **Status codes:** `200`, `202` and `204` accept the batch. `413` makes the client split the batch. Another `4xx` drops the batch.
194
191
 
195
192
  ---
196
193
 
@@ -198,8 +195,8 @@ Receiving servers must implement the following contract:
198
195
 
199
196
  ```bash
200
197
  npm install
201
- npm run dev # Starts playground, mock ingest server, and iframe host
202
- npm run verify # Runs format check, typecheck, lint, build, and tests
198
+ npm run dev # Playground, mock ingest server and iframe host
199
+ npm run verify # Format check, version sync, typecheck, lint, build and tests
203
200
  ```
204
201
 
205
202
  - Vanilla playground: `http://localhost:5173/playground/vanilla/index.html`
@@ -207,20 +204,20 @@ npm run verify # Runs format check, typecheck, lint, build, and tests
207
204
 
208
205
  ### Example Applications
209
206
 
210
- Build the package before running framework examples:
207
+ Build the package first:
211
208
 
212
209
  ```bash
213
210
  npm run build
214
211
  npm run example:react # http://localhost:5180
215
212
  npm run example:angular # http://localhost:4200
216
- npm run example:microfrontend # Shell on http://localhost:5191, remotes on 5192/5193
213
+ npm run example:microfrontend # Shell on http://localhost:5191, remotes on 5192 and 5193
217
214
  ```
218
215
 
219
216
  ---
220
217
 
221
218
  ## Changelog
222
219
 
223
- Released versions and their breaking changes are in [CHANGELOG.md](CHANGELOG.md).
220
+ [CHANGELOG.md](CHANGELOG.md) holds the released versions and their breaking changes.
224
221
 
225
222
  ---
226
223
 
@@ -80,13 +80,14 @@ export declare function createChildrenLink(receive: Receive, trustedOrigins: str
80
80
  */
81
81
  export declare function createBroadcastLink(channelName: string, receive: Receive, diagnostics: Diagnostics): Link | null;
82
82
  /**
83
- * Creates an OpenFin InterApplicationBus link across desktop views and applications.
84
- * @param topic InterApplicationBus topic identifier.
83
+ * Creates an OpenFin InterApplicationBus link scoped to one application.
84
+ * @param topic InterApplicationBus topic prefix.
85
+ * @param appUuid OpenFin application uuid owning this context.
85
86
  * @param receive Callback for received topic messages.
86
87
  * @param diagnostics Diagnostics reporter.
87
- * @returns OpenFin link, or null if InterApplicationBus is unavailable.
88
+ * @returns OpenFin link, or null if InterApplicationBus or the identity is unavailable.
88
89
  */
89
- export declare function createOpenFinLink(topic: string, receive: Receive, diagnostics: Diagnostics): Link | null;
90
+ export declare function createOpenFinLink(topic: string, appUuid: string | undefined, receive: Receive, diagnostics: Diagnostics): Link | null;
90
91
  /**
91
92
  * Creates the worker-side link pointing at the document that created this
92
93
  * worker. Emits `kind: "owner"`.
@@ -0,0 +1,2 @@
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.0`,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=2e3,Ge=6e4,Ke=3e4,qe=18e5,Je=`__uiobs_journey`,Ye=`ui_observability_control`,Xe=1500,Ze=5e3,Qe={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`ui-observability.tab`}}),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 Ze}}),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 We}}),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 Ke}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Ge}}),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 Z}}),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 ae}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return 55296}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return oe}}),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 xe}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return`[ui-observability]`}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return j}}),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 _e}}),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 2048}}),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 A}}),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 Ne}}),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 Ae}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return Fe}}),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 k}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return`AppleWebKit`}}),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 Xe}}),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-BpFlszME.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-BpFlszME.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.0\";\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// 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":"AAcA,IAoCa,GAAqB,WAGrB,GAA6B,SAG7B,EAAwB,yBAGxB,EAAuB,gBAGvB,EAAoB,aAqDpB,EAA4C,CACvD,MAAO,EACP,MAAO,EACP,KAAM,EACN,KAAM,GACN,MAAO,GACP,MAAO,EACT,EAMa,EAAwC,EAUxC,EAAgB,WAGhB,EAAe,UAGf,EAAqB,gBAGrB,EAAgB,WAMhB,EAAgB,WAGhB,EAAkB,aAGlB,EAAoB,eAGpB,EAAyB,oBAGzB,EAAuB,wBAMvB,EAA0B,2BAM1B,EAAwB,yBAGxB,EAAwB,eAGxB,EAA2B,kBAG3B,EAAkC,yBAMlC,EAA8B,qBAM9B,EAAiC,wBAMjC,EAAkC,yBAGlC,EAAyB,gBAGzB,EAAsB,aAGtB,EAAkB,SAGlB,EAAsB,aAGtB,EAA8B,qBAG9B,EAAwB,eAGxB,EAAwB,eAMxB,EAAqB,0BAMrB,EAAwB,QAMxB,EAAyB,QAOzB,EAAuB,OAUvB,EAAqD,CAAE,KAAM,SAAU,EAGvE,EAAoB,mBAGpB,EAAsB,uBAGtB,EAAkB,SAMlB,EAAgB,QAOhB,EAAsB,eAGtB,EAA0B,mBAG1B,EAAqB,cAMrB,EAAkB,mBAGlB,EAAiB,kBAGjB,EAAgB,OAwBhB,EAAoB,IAOpB,EAAqB,IAGrB,EAA0B,2BAM1B,EAAuB,iBAGvB,EAA0B,aAO1B,EAA2B,0BAM3B,EAA+B,8BAM/B,EAAoB,yBAMpB,EAAuB,qBAWvB,GAAuB,UAGvB,EAA6B,YAG7B,GAAyB,YAGzB,GAAqB,eAGrB,GAAsB,SAGtB,GAAoB,OAUpB,GAAkB,yBAMlB,GAAsB,6BAUtB,GAAsB,2BAmBtB,GAA6B,IAG7B,GAAkC,eAGlC,GAAsB,MAGtB,GAAuB,MAGvB,GAAyB,MAGzB,GAAyB,KAGzB,GAA+B,KAgB/B,GAAmB,IAYnB,GAAqB,cAoBrB,GAAmB,WAGnB,GAAY,SAGZ,GAAa,WAOb,GAA2B,SAO3B,GAAe,qBAGf,GAAqB,2BAUrB,GAAwB,IAsBxB,GAAuB,aAGvB,GAAqB,IAOrB,GAAyB,IAGzB,GAAoB,gBAGpB,GAAoB,gBAGpB,GAAsB,QAOtB,GAAuB,kBAkBvB,GAA0B,CACrC,SACA,eACA,UACA,aACA,YACF,EAMa,GAAkB,CAAC,WAAY,MAAO,SAAS,EAM/C,GAA+E,CAC1F,SAAU,CAAC,EACX,IAAK,CAAC,EACN,QAAS,CAAC,iBAAiB,CAC7B,EAQa,GAAqD,CAChE,SAAU,GACV,YAAa,GACb,eAAgB,GAChB,YAAa,GACb,QAAS,GACT,SAAU,OACV,YAAa,OACb,YAAa,OACb,QAAS,OACT,SAAU,CAAE,YAAa,EAAG,MAAO,CAAC,EAAG,kBAAmB,CAAC,QAAQ,CAAE,EACrE,IAAK,CAAE,KAAM,OAAQ,eAAgB,CAAC,EAAG,YAAa,MAAO,EAC7D,QAAS,CACP,OAAQ,GACR,WAAY,GACZ,eAAgB,GAChB,MAAO,GACP,IAAK,GACL,aAAc,GACd,WAAY,GACZ,UAAW,GACX,SAAU,GACV,WAAY,CAAC,EACb,uBAAwB,CAAC,CAC3B,EACA,QAAS,IACX,EAGa,GAAkC,QAOlC,GAAwB,IAMxB,GAA2B,IAa3B,GAAqB,KAGrB,GAA8B,KAO9B,GAAkB,kBAGlB,GAAgC,CAC3C,WAAY,IACZ,SAAU,MACV,YAAa,CACf,EAOa,GAAsB,IAGtB,GAAqB,IAGrB,GAAsB,IAOtB,GAAqB,KAMrB,GAAoB,kBAOpB,GAAmB,2BAGnB,GAA2B,KAgB3B,GAAkB,IAOlB,GAAgB,CAC3B,aAAc,KACd,kBAAmB,KACnB,kBAAmB,IACnB,cAAe,KACf,SAAU,EACV,eAAgB,IAChB,SAAU,IACV,eAAgB,KAClB"}
@@ -0,0 +1,74 @@
1
+ //#region src/constants.ts
2
+ var ee = "[ui-observability]", te = 1e3, e = "ui-observability.session", t = "ui-observability.tab", n = 18e5, r = 6e4, i = /OpenFin/i, a = /\bwv\b/, o = /\b(iPhone|iPad|iPod)\b/, s = /\bMacintosh\b/, c = /\bMobile\b/, l = "AppleWebKit", u = "Safari/", d = 55296, f = 56319, p = 2048, m = {
3
+ TRACE: 1,
4
+ DEBUG: 5,
5
+ INFO: 9,
6
+ WARN: 13,
7
+ ERROR: 17,
8
+ FATAL: 21
9
+ }, h = m, g = "log.type", _ = "log.seq", v = "app.namespace", y = "page.url", b = "url.full", x = "journey.id", S = "journey.name", C = "journey.parent_id", w = "uiobs.sanitize_failed", T = "uiobs.attributes_dropped", E = "uiobs.attributes_bytes", D = "service.name", O = "service.version", k = "deployment.environment", A = "telemetry.sdk.name", j = "telemetry.sdk.version", M = "telemetry.sdk.language", N = "host.platform", P = "session.id", F = "tab.id", I = "context.id", L = "browser.user_agent", R = "openfin.uuid", z = "openfin.name", B = "@utk09/ui-observability", V = "0.4.0", H = "webjs", U = "otlp", W = { WARN: "warning" }, G = "application/json", K = "application/x-ndjson", q = 1000000n, J = /^\d+$/, Y = "Content-Type", X = "Content-Encoding", Z = "Retry-After", Q = "X-UiObs-Batch-Id", ne = "X-UiObs-Attempt", re = "gzip", ie = 1e3, ae = 6e4, oe = "text/plain;charset=UTF-8", $ = "uiobs_batch_id", se = "uiobs_exit", ce = "ui-observability.batch.", le = "ui-observability.emergency.", ue = "ui-observability.probe", de = "QuotaExceededError", fe = "batches", pe = "createdAt", me = "indexeddb", he = "localstorage", ge = "memory", _e = "none", ve = "ui-observability.drain", ye = "ui-observability.emergency", be = "ui-observability.journey", xe = 2e3, Se = "uiObsJourney", Ce = /\+/g, we = /\//g, Te = /=+$/, Ee = /-/g, De = /_/g, Oe = 3e5, ke = "traceparent", Ae = 2166136261, je = 16777619, Me = 4294967295, Ne = "metric", Pe = "ui-observability/1", Fe = "ui-observability.runtime", Ie = 1e4, Le = "color:#888", Re = 1e3, ze = 6e4, Be = "uiobs.capture", Ve = "uiobs.storage", He = "count", Ue = "unknown-service", We = [
10
+ "redact",
11
+ "onDiagnostic",
12
+ "headers",
13
+ "serializer",
14
+ "otelLoader"
15
+ ], Ge = [
16
+ "sampling",
17
+ "bus",
18
+ "capture"
19
+ ], Ke = {
20
+ sampling: [],
21
+ bus: [],
22
+ capture: ["webVitalsLoader"]
23
+ }, qe = {
24
+ endpoint: "",
25
+ serviceName: "",
26
+ serviceVersion: "",
27
+ environment: "",
28
+ enabled: !0,
29
+ minLevel: "INFO",
30
+ compression: "gzip",
31
+ credentials: "omit",
32
+ storage: "auto",
33
+ sampling: {
34
+ defaultRate: 1,
35
+ rates: {},
36
+ alwaysSampleTypes: ["action"]
37
+ },
38
+ bus: {
39
+ mode: "auto",
40
+ trustedOrigins: [],
41
+ openFinRole: "auto"
42
+ },
43
+ capture: {
44
+ errors: !0,
45
+ rejections: !0,
46
+ resourceErrors: !1,
47
+ fetch: !1,
48
+ xhr: !1,
49
+ interactions: !1,
50
+ navigation: !1,
51
+ webVitals: !1,
52
+ fullUrls: !1,
53
+ ignoreUrls: [],
54
+ propagateTraceHeaderTo: []
55
+ },
56
+ console: null
57
+ }, Je = "DEBUG", Ye = 2e3, Xe = 1e4, Ze = 15e3, Qe = 1024, $e = "UiObservability", et = {
58
+ maxBatches: 500,
59
+ maxAgeMs: 864e5,
60
+ maxAttempts: 5
61
+ }, tt = 2e3, nt = 6e4, rt = 3e4, it = 18e5, at = "__uiobs_journey", ot = "ui_observability_control", st = 1500, ct = 5e3, lt = {
62
+ maxBodyChars: 4096,
63
+ maxAttributeChars: 8192,
64
+ maxAttributeCount: 128,
65
+ maxStackChars: 8192,
66
+ maxDepth: 6,
67
+ maxArrayLength: 100,
68
+ maxNodes: 1e4,
69
+ maxRecordBytes: 32768
70
+ };
71
+ //#endregion
72
+ export { fe as $, t as $t, oe as A, P as At, ct as B, U as Bt, Be as C, I as Ct, Le as D, R as Dt, Je as E, z as Et, Re as F, tt as Ft, ne as G, $e as Gt, Ae as H, e as Ht, W as I, rt as It, Y as J, me as Jt, Q as K, et as Kt, ye as L, nt as Lt, He as M, M as Mt, te as N, A as Nt, G as O, D as Ot, ve as P, j as Pt, pe as Q, ue as Qt, le as R, Fe as Rt, Pe as S, L as St, Ge as T, N as Tt, je as U, r as Ut, Ie as V, n as Vt, ze as W, m as Wt, f as X, ge as Xt, Z as Y, he as Yt, d as Z, _e as Zt, we as _, $ as _t, x as a, Me as an, ee as at, ot as b, lt as bt, _ as c, Ue as cn, s as ct, w as d, c as dt, H as en, o as et, b as f, J as ft, Ce as g, i as gt, Te as h, xe as ht, T as i, Oe as in, h as it, qe as j, F as jt, K as k, O as kt, g as l, p as ln, Xe as lt, De as m, Se as mt, v as n, V as nn, be as nt, S as o, We as on, Ye as ot, Ee as p, q as pt, X as q, Ve as qt, E as r, ke as rn, at as rt, C as s, Ke as sn, Ne as st, a as t, B as tn, it as tt, y as u, l as un, ie as ut, ce as v, se as vt, Qe as w, k as wt, st as x, Ze as xt, ae as y, de as yt, re as z, u as zt };
73
+
74
+ //# sourceMappingURL=constants-CrU3IUyy.js.map