@scalebun/web 1.2.3 → 1.2.4

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 (116) hide show
  1. package/dist/bootstrap/SDKBootstrapper.d.ts.map +1 -1
  2. package/dist/bootstrap/SDKBootstrapper.js +37 -1
  3. package/dist/bootstrap/SDKBootstrapper.js.map +1 -1
  4. package/dist/core/prune.d.ts +28 -4
  5. package/dist/core/prune.d.ts.map +1 -1
  6. package/dist/core/prune.js +92 -11
  7. package/dist/core/prune.js.map +1 -1
  8. package/dist/features/bugreport/BugReportFeature.d.ts +3 -2
  9. package/dist/features/bugreport/BugReportFeature.d.ts.map +1 -1
  10. package/dist/features/bugreport/BugReportFeature.js +2 -1
  11. package/dist/features/bugreport/BugReportFeature.js.map +1 -1
  12. package/dist/features/bugreport/widget.d.ts +21 -2
  13. package/dist/features/bugreport/widget.d.ts.map +1 -1
  14. package/dist/features/bugreport/widget.js +37 -4
  15. package/dist/features/bugreport/widget.js.map +1 -1
  16. package/dist/features/coach/overlay.d.ts.map +1 -1
  17. package/dist/features/coach/overlay.js +26 -5
  18. package/dist/features/coach/overlay.js.map +1 -1
  19. package/dist/features/engage/EngageFeature.d.ts +7 -1
  20. package/dist/features/engage/EngageFeature.d.ts.map +1 -1
  21. package/dist/features/engage/EngageFeature.js +32 -10
  22. package/dist/features/engage/EngageFeature.js.map +1 -1
  23. package/dist/features/engage/normalize.d.ts.map +1 -1
  24. package/dist/features/engage/normalize.js +7 -0
  25. package/dist/features/engage/normalize.js.map +1 -1
  26. package/dist/features/engage/runtime.d.ts +11 -0
  27. package/dist/features/engage/runtime.d.ts.map +1 -1
  28. package/dist/features/engage/runtime.js +25 -10
  29. package/dist/features/engage/runtime.js.map +1 -1
  30. package/dist/features/engage/throttle.d.ts +16 -6
  31. package/dist/features/engage/throttle.d.ts.map +1 -1
  32. package/dist/features/engage/throttle.js +96 -6
  33. package/dist/features/engage/throttle.js.map +1 -1
  34. package/dist/features/engage/types.d.ts +6 -0
  35. package/dist/features/engage/types.d.ts.map +1 -1
  36. package/dist/features/engage/types.js.map +1 -1
  37. package/dist/features/inapp/InApp2Feature.d.ts.map +1 -1
  38. package/dist/features/inapp/InApp2Feature.js +1 -0
  39. package/dist/features/inapp/InApp2Feature.js.map +1 -1
  40. package/dist/features/inapp/blocks/styles.d.ts +1 -1
  41. package/dist/features/inapp/blocks/styles.d.ts.map +1 -1
  42. package/dist/features/inapp/blocks/styles.js +30 -3
  43. package/dist/features/inapp/blocks/styles.js.map +1 -1
  44. package/dist/features/inapp/center/panel.d.ts +1 -1
  45. package/dist/features/inapp/center/panel.d.ts.map +1 -1
  46. package/dist/features/inapp/center/panel.js +40 -6
  47. package/dist/features/inapp/center/panel.js.map +1 -1
  48. package/dist/features/inapp/core/engine.d.ts +2 -0
  49. package/dist/features/inapp/core/engine.d.ts.map +1 -1
  50. package/dist/features/inapp/core/engine.js +1 -1
  51. package/dist/features/inapp/core/engine.js.map +1 -1
  52. package/dist/features/inapp/core/host.d.ts.map +1 -1
  53. package/dist/features/inapp/core/host.js +5 -1
  54. package/dist/features/inapp/core/host.js.map +1 -1
  55. package/dist/features/inapp/core/targeting.d.ts +29 -2
  56. package/dist/features/inapp/core/targeting.d.ts.map +1 -1
  57. package/dist/features/inapp/core/targeting.js +78 -4
  58. package/dist/features/inapp/core/targeting.js.map +1 -1
  59. package/dist/features/inapp/surfaces/coachmark.d.ts.map +1 -1
  60. package/dist/features/inapp/surfaces/coachmark.js +5 -2
  61. package/dist/features/inapp/surfaces/coachmark.js.map +1 -1
  62. package/dist/features/inapp/surfaces/hotspot.d.ts.map +1 -1
  63. package/dist/features/inapp/surfaces/hotspot.js +5 -2
  64. package/dist/features/inapp/surfaces/hotspot.js.map +1 -1
  65. package/dist/features/inapp/surfaces/inline.d.ts.map +1 -1
  66. package/dist/features/inapp/surfaces/inline.js +7 -1
  67. package/dist/features/inapp/surfaces/inline.js.map +1 -1
  68. package/dist/features/inapp/surfaces/popover.d.ts.map +1 -1
  69. package/dist/features/inapp/surfaces/popover.js +5 -2
  70. package/dist/features/inapp/surfaces/popover.js.map +1 -1
  71. package/dist/features/inapp/surfaces/styles.d.ts +1 -1
  72. package/dist/features/inapp/surfaces/styles.d.ts.map +1 -1
  73. package/dist/features/inapp/surfaces/styles.js +60 -11
  74. package/dist/features/inapp/surfaces/styles.js.map +1 -1
  75. package/dist/features/inapp/surfaces/toolbar.d.ts.map +1 -1
  76. package/dist/features/inapp/surfaces/toolbar.js +5 -2
  77. package/dist/features/inapp/surfaces/toolbar.js.map +1 -1
  78. package/dist/features/inapp/surfaces/tour.d.ts.map +1 -1
  79. package/dist/features/inapp/surfaces/tour.js +5 -2
  80. package/dist/features/inapp/surfaces/tour.js.map +1 -1
  81. package/dist/features/inapp/types.d.ts +2 -0
  82. package/dist/features/inapp/types.d.ts.map +1 -1
  83. package/dist/features/journey/InteractionTracker.d.ts.map +1 -1
  84. package/dist/features/journey/InteractionTracker.js +137 -0
  85. package/dist/features/journey/InteractionTracker.js.map +1 -1
  86. package/dist/features/manifest.d.ts +21 -0
  87. package/dist/features/manifest.d.ts.map +1 -1
  88. package/dist/features/manifest.js +27 -10
  89. package/dist/features/manifest.js.map +1 -1
  90. package/dist/features/replay/ReplayFeature.d.ts +20 -0
  91. package/dist/features/replay/ReplayFeature.d.ts.map +1 -1
  92. package/dist/features/replay/ReplayFeature.js +155 -5
  93. package/dist/features/replay/ReplayFeature.js.map +1 -1
  94. package/dist/features/replay/lifecycle/recorder.d.ts +21 -1
  95. package/dist/features/replay/lifecycle/recorder.d.ts.map +1 -1
  96. package/dist/features/replay/lifecycle/recorder.js +20 -4
  97. package/dist/features/replay/lifecycle/recorder.js.map +1 -1
  98. package/dist/features/session/sessionStore.d.ts +17 -1
  99. package/dist/features/session/sessionStore.d.ts.map +1 -1
  100. package/dist/features/session/sessionStore.js +17 -1
  101. package/dist/features/session/sessionStore.js.map +1 -1
  102. package/dist/pipeline/pipeline.d.ts +82 -0
  103. package/dist/pipeline/pipeline.d.ts.map +1 -1
  104. package/dist/pipeline/pipeline.js +307 -14
  105. package/dist/pipeline/pipeline.js.map +1 -1
  106. package/dist/public/ScaleBunFacade.d.ts +31 -0
  107. package/dist/public/ScaleBunFacade.d.ts.map +1 -1
  108. package/dist/public/ScaleBunFacade.js +43 -7
  109. package/dist/public/ScaleBunFacade.js.map +1 -1
  110. package/dist/scalebun.min.js +147 -65
  111. package/dist/scalebun.min.js.map +4 -4
  112. package/dist/transport/httpClient.d.ts +56 -2
  113. package/dist/transport/httpClient.d.ts.map +1 -1
  114. package/dist/transport/httpClient.js +81 -5
  115. package/dist/transport/httpClient.js.map +1 -1
  116. package/package.json +9 -3
@@ -34,10 +34,57 @@ export declare class HttpClient {
34
34
  private signedHeaders;
35
35
  /** Open the session (parity with the current backend's start-session). */
36
36
  startSession(head: SessionHead): Promise<void>;
37
- /** Send one batched envelope. Returns true on 2xx. */
37
+ /**
38
+ * Send one batched envelope, and return WHAT THE SERVER DID WITH IT — not whether the request
39
+ * completed.
40
+ *
41
+ * THE BUG THIS FIXES. This returned `res.ok`, and the backend answers `200 {ok:true}` even when a
42
+ * whole item kind was rejected: `BatchService.ingest` catches per-kind handler failures so one bad
43
+ * kind cannot fail the envelope, then reports success anyway. So a `frame` group refused for an
44
+ * unknown session, a closed entitlement, the 100-frame cap or the 8 MB domPayload cap was cleared
45
+ * from the queue AND from the IndexedDB mirror, while `event`/`performance` in the same envelope
46
+ * landed normally. That is exactly the shape of the `missing` replay bucket — SDK demonstrably ran,
47
+ * other lanes uploaded, zero frames stored — and it was invisible from both ends.
48
+ *
49
+ * Returns `null` when the REQUEST failed (network, non-2xx, suspended): unchanged meaning, retry
50
+ * everything. Otherwise the server's per-kind verdict, where a kind absent from the map was stored
51
+ * fine. Parsing is guarded: a 200 whose body is not the expected JSON is treated as full acceptance,
52
+ * which is the pre-existing behaviour and the right fallback for an older backend that does not
53
+ * send `results` at all.
54
+ */
38
55
  sendBatch(envelope: SessionEnvelope, opts?: {
39
56
  keepalive?: boolean;
40
- }): Promise<boolean>;
57
+ }): Promise<Record<string, {
58
+ ok: boolean;
59
+ retry?: boolean;
60
+ reason?: string;
61
+ }> | null>;
62
+ /**
63
+ * Close the session server-side. Called from `pipeline.stop()` — a HOST-INITIATED shutdown — and
64
+ * from nowhere else.
65
+ *
66
+ * ⚠️ DO NOT WIRE THIS TO `pagehide` OR `visibilitychange`. It reads like the obvious fix for
67
+ * "sessions sit in `recording` for half an hour after the tab closes", and it is not.
68
+ *
69
+ * `pagehide` fires on every same-tab NAVIGATION, not only on tab close, and a web session
70
+ * deliberately survives navigation (see features/session/sessionStore.ts — persisting the id across
71
+ * refreshes and navigations is the entire reason that file exists). Finalizing here would therefore
72
+ * stamp `endedAt` at the visitor's first page change while the SAME session id keeps sending
73
+ * batches from every page after it.
74
+ *
75
+ * The server then makes that permanent in two ways. `bumpActivityAndCounters` freezes
76
+ * `lastActivityAt` once `endedAt` is set but keeps incrementing the counters (its "D3" comment),
77
+ * and `finalizeSession` is idempotent, so the row can never reopen. The rows this produced when it
78
+ * last happened are recorded in that comment: `durationMs` 98.1 min against a real span of 813.0
79
+ * min — a negative idle tail, which is impossible and silently poisons anything reading both
80
+ * columns.
81
+ *
82
+ * The 30-minute gap is not a defect that needs closing here. `IngestionService.reapStaleSessions`
83
+ * runs every 5 minutes and closes anything idle past `STALE_SESSION_MINUTES`, writing
84
+ * `endedAt = COALESCE(lastActivityAt, startedAt)` — the correct value, just later. A browser cannot
85
+ * distinguish "closing this tab" from "going to the next page", so the server, which can simply
86
+ * wait and see, is the right place to decide.
87
+ */
41
88
  finalize(sessionId: string): Promise<void>;
42
89
  /**
43
90
  * Submit a bug report (F-BUG). Interactive (not batched) — returns the created report's id so the
@@ -47,6 +94,13 @@ export declare class HttpClient {
47
94
  id?: string;
48
95
  } | null>;
49
96
  private static readonly GZIP_MIN_BYTES;
97
+ /**
98
+ * Returns the Response on 2xx, or `null` for every failure (suspended, non-2xx, thrown).
99
+ *
100
+ * It returned `boolean`. `sendBatch` needs the BODY — the per-kind delivery verdict lives there, and
101
+ * the status code does not describe it (see sendBatch). Callers that only care whether it worked
102
+ * read the result as truthy, which is what `startSession`/`finalize` already do by ignoring it.
103
+ */
50
104
  private post;
51
105
  /**
52
106
  * Arm the suspend backoff from a 403. Only the backend's workspace-suspend verdict
@@ -1 +1 @@
1
- {"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../src/transport/httpClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAEnD;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc,CAAK;IAE3B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,OAAO;IAIf;;;;;OAKG;YACW,aAAa;IAO3B,0EAA0E;IACpE,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BpD,sDAAsD;IAChD,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAKtF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD;;;OAGG;IACG,eAAe,CAAC,SAAS,EAAE,MAA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M,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAWpF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD;;;OAGG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAoB3F,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAQ;IAE9C;;;;;;OAMG;YACW,IAAI;IAuBlB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAgB5B"}
@@ -62,14 +62,83 @@ export class HttpClient {
62
62
  * a host that widens `sessionTimeoutMs` gets bands drawn against its own value rather than ours.
63
63
  */
64
64
  idleThresholdMs: this.config.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS,
65
+ /**
66
+ * P1b — the SDK BUILD that recorded this session, and the reason it was missing is instructive.
67
+ *
68
+ * `buildClient()` has always produced `{ platform, renderer, sdk:{ name, version } }`, and the
69
+ * batch envelope carries it — so "the SDK already sends its version" was true, and led straight
70
+ * to a wrong conclusion: this method does not send `head.client`. It ENUMERATES a flat payload,
71
+ * which is exactly the enumerating-hook failure CLAUDE.md §2 warns about, here on the client
72
+ * side. Every field added to `ClientInfo` after this method was written is silently absent from
73
+ * session start, with no error anywhere.
74
+ *
75
+ * Found by the Phase 2 browser harness, not by reading: the backend read `client.sdk.version`,
76
+ * the unit-level harness hand-fed that shape and passed, and only a real page proved the wire
77
+ * never carries it. Sent flat here to match how every other field on this payload is sent.
78
+ *
79
+ * `appVersion` above stays the HOST app's version. They are different facts and a single column
80
+ * cannot answer "did SDK 1.2.3 improve the ready rate".
81
+ */
82
+ sdkVersion: head.client.sdk?.version,
65
83
  startedAt: Date.now(),
66
84
  });
67
85
  }
68
- /** Send one batched envelope. Returns true on 2xx. */
86
+ /**
87
+ * Send one batched envelope, and return WHAT THE SERVER DID WITH IT — not whether the request
88
+ * completed.
89
+ *
90
+ * THE BUG THIS FIXES. This returned `res.ok`, and the backend answers `200 {ok:true}` even when a
91
+ * whole item kind was rejected: `BatchService.ingest` catches per-kind handler failures so one bad
92
+ * kind cannot fail the envelope, then reports success anyway. So a `frame` group refused for an
93
+ * unknown session, a closed entitlement, the 100-frame cap or the 8 MB domPayload cap was cleared
94
+ * from the queue AND from the IndexedDB mirror, while `event`/`performance` in the same envelope
95
+ * landed normally. That is exactly the shape of the `missing` replay bucket — SDK demonstrably ran,
96
+ * other lanes uploaded, zero frames stored — and it was invisible from both ends.
97
+ *
98
+ * Returns `null` when the REQUEST failed (network, non-2xx, suspended): unchanged meaning, retry
99
+ * everything. Otherwise the server's per-kind verdict, where a kind absent from the map was stored
100
+ * fine. Parsing is guarded: a 200 whose body is not the expected JSON is treated as full acceptance,
101
+ * which is the pre-existing behaviour and the right fallback for an older backend that does not
102
+ * send `results` at all.
103
+ */
69
104
  async sendBatch(envelope, opts) {
70
105
  const url = `${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(envelope.sessionId)}/batch`;
71
- return this.post(url, envelope, opts?.keepalive);
106
+ const res = await this.post(url, envelope, opts?.keepalive);
107
+ if (!res)
108
+ return null;
109
+ try {
110
+ return (await res.json())?.results ?? {};
111
+ }
112
+ catch {
113
+ return {};
114
+ }
72
115
  }
116
+ /**
117
+ * Close the session server-side. Called from `pipeline.stop()` — a HOST-INITIATED shutdown — and
118
+ * from nowhere else.
119
+ *
120
+ * ⚠️ DO NOT WIRE THIS TO `pagehide` OR `visibilitychange`. It reads like the obvious fix for
121
+ * "sessions sit in `recording` for half an hour after the tab closes", and it is not.
122
+ *
123
+ * `pagehide` fires on every same-tab NAVIGATION, not only on tab close, and a web session
124
+ * deliberately survives navigation (see features/session/sessionStore.ts — persisting the id across
125
+ * refreshes and navigations is the entire reason that file exists). Finalizing here would therefore
126
+ * stamp `endedAt` at the visitor's first page change while the SAME session id keeps sending
127
+ * batches from every page after it.
128
+ *
129
+ * The server then makes that permanent in two ways. `bumpActivityAndCounters` freezes
130
+ * `lastActivityAt` once `endedAt` is set but keeps incrementing the counters (its "D3" comment),
131
+ * and `finalizeSession` is idempotent, so the row can never reopen. The rows this produced when it
132
+ * last happened are recorded in that comment: `durationMs` 98.1 min against a real span of 813.0
133
+ * min — a negative idle tail, which is impossible and silently poisons anything reading both
134
+ * columns.
135
+ *
136
+ * The 30-minute gap is not a defect that needs closing here. `IngestionService.reapStaleSessions`
137
+ * runs every 5 minutes and closes anything idle past `STALE_SESSION_MINUTES`, writing
138
+ * `endedAt = COALESCE(lastActivityAt, startedAt)` — the correct value, just later. A browser cannot
139
+ * distinguish "closing this tab" from "going to the next page", so the server, which can simply
140
+ * wait and see, is the right place to decide.
141
+ */
73
142
  async finalize(sessionId) {
74
143
  const url = `${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(sessionId)}/finalize`;
75
144
  await this.post(url, { endedAt: Date.now() }, true);
@@ -97,10 +166,17 @@ export class HttpClient {
97
166
  return null;
98
167
  }
99
168
  }
169
+ /**
170
+ * Returns the Response on 2xx, or `null` for every failure (suspended, non-2xx, thrown).
171
+ *
172
+ * It returned `boolean`. `sendBatch` needs the BODY — the per-kind delivery verdict lives there, and
173
+ * the status code does not describe it (see sendBatch). Callers that only care whether it worked
174
+ * read the result as truthy, which is what `startSession`/`finalize` already do by ignoring it.
175
+ */
100
176
  async post(url, body, keepalive = false) {
101
177
  // Suspended workspace: short-circuit before touching the network.
102
178
  if (this.isSuspended())
103
- return false;
179
+ return null;
104
180
  try {
105
181
  const serialized = JSON.stringify(body);
106
182
  const headers = await this.signedHeaders(serialized); // sign the UNCOMPRESSED JSON (backend inflates → verifies)
@@ -116,10 +192,10 @@ export class HttpClient {
116
192
  const res = await fetch(url, { method: 'POST', headers, body: payload, keepalive });
117
193
  if (res.status === 403)
118
194
  this.maybeEnterSuspended(res);
119
- return res.ok;
195
+ return res.ok ? res : null;
120
196
  }
121
197
  catch {
122
- return false;
198
+ return null;
123
199
  }
124
200
  }
125
201
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../src/transport/httpClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAU9E,MAAM,OAAO,UAAU;IACrB,YAA6B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;QAEnD;;;;;;;WAOG;QACK,mBAAc,GAAG,CAAC,CAAC;IAV2B,CAAC;IAY/C,WAAW;QACjB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC;IAC1C,CAAC;IAEO,OAAO;QACb,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAChG,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,aAAa,CAAC,IAAY;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC;QAC9C,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;IAC/E,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,YAAY,CAAC,IAAiB;QAClC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,qBAAqB,EAAE;YAC9D,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;YACxB,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AC,IAAI,CAAC,CAAC;QAClE,KAAK,GAAG;aACL,KAAK,EAAE;aACP,IAAI,EAAE;aACN,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE;YACf,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,KAAK,qBAAqB,IAAI,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC;YAC5E,IAAI,CAAC,SAAS,IAAI,CAAC,aAAa;gBAAE,OAAO;YACzC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,aAAa,IAAI,IAAI,CAAC;YACtE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC;QACpD,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,2DAA2D;YAC3D,IAAI,aAAa;gBAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC;;AAxDD,mGAAmG;AACnG,mGAAmG;AACnG,qBAAqB;AACG,yBAAc,GAAG,IAAI,AAAP,CAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalebun/web",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "The ScaleBun web SDK — unified-session observability for the browser (errors, network, performance, replay, sessions). Framework-agnostic core.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@scalebun/protocol": "^1.2.2",
29
- "@scalebun/sdk-contracts": "^1.2.2"
29
+ "@scalebun/sdk-contracts": "^1.2.3"
30
30
  },
31
31
  "devDependencies": {
32
32
  "esbuild": "^0.21.5",
@@ -55,6 +55,12 @@
55
55
  "size:check": "node scripts/size-check.mjs",
56
56
  "e2e:offline": "node e2e/offline.mjs",
57
57
  "e2e:p4": "node e2e/p4-capture.mjs",
58
- "e2e:inapp": "node e2e/inapp-render.mjs"
58
+ "e2e:inapp": "node e2e/inapp-render.mjs",
59
+ "e2e:p2": "node e2e/p2-capture-matrix.mjs",
60
+ "e2e:p4d": "node e2e/p4-keyframe-durability.mjs",
61
+ "e2e:p5": "node e2e/p5-capture-floor.mjs",
62
+ "e2e:p13": "node e2e/p13-post-change-cohort.mjs",
63
+ "e2e:layout": "node e2e/inapp-layout.mjs",
64
+ "gallery": "node scripts/variant-gallery.mjs"
59
65
  }
60
66
  }