@cimulate/copilot-widget 1.46.1 → 1.46.2

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,6 +2,10 @@
2
2
 
3
3
  `@cimulate/copilot-widget` follows [Semantic Versioning](https://semver.org/). Each entry is a released `package.json` version (deployed on merge to `master`), newest first.
4
4
 
5
+ ## 1.46.2 — 2026-10-05
6
+
7
+ - Messaging mode exposes a session update callback via `messagingConfig.onSessionUpdate` which reports whenever the session or conversation changes, and optional `conversationId`, `continuationToken`, and `lastEventId` configs to seed the next inject so the same SCRT2 conversation resumes.
8
+
5
9
  ## 1.46.1 — 2026-10-02
6
10
 
7
11
  - Messaging telemetry is now gated per release by a build-time switch, so each release explicitly opts in. Telemetry is not enabled in this release. No storefront action or configuration required.
@@ -14,7 +18,7 @@
14
18
 
15
19
  - Product detail cards now show the auto-selected variant's price immediately, including the struck-through original price when that variant has a promotional price.
16
20
 
17
- ## 1.45.0 — 2026-09-29
21
+ ## 1.45.0 — 2026-09-30
18
22
 
19
23
  - Add Cimulate-owned frontend observability for messaging mode. When the widget bundle is built with a Falcon o11y write key (`VITE_O11Y_API_KEY`, injected at build time — never merchant-supplied), it emits messaging lifecycle events (page view, connect/reconnect, disconnect, participant joined, conversation started/cleared/closed) and live connection/session state gauges to Salesforce o11y. A build with no key is a no-op. Storefronts embedding the widget cannot enable, disable, or redirect telemetry. The o11y SDK is an optional dependency, lazy-loaded into a separate chunk so the core bundle is unaffected. No shopper PII leaves the browser (host URL is origin-only), and telemetry failures never surface to the host page.
20
24
 
@@ -404,6 +404,12 @@ declare interface MessagingModeConfig {
404
404
  scrt2Url: string;
405
405
  orgId: string;
406
406
  esDeveloperName: string;
407
+ /**
408
+ * Keys to seed the next conversation injection to resume an existing session.
409
+ */
410
+ conversationId?: string;
411
+ continuationToken?: string;
412
+ lastEventId?: string;
407
413
  routingAttributes?: Record<string, string>;
408
414
  /**
409
415
  * Invoked whenever a finalized Agentforce message carries a product result
@@ -418,6 +424,12 @@ declare interface MessagingModeConfig {
418
424
  * or times out.
419
425
  */
420
426
  onEndConversation?: (conversationId: string | null) => Promise<void> | void;
427
+ /**
428
+ * Invoked when the stored guest session changes (`created`, `resumed`,
429
+ * `refreshed`, `ended`, or `reset`). Persist or drop the snapshot so a
430
+ * destroyed WebView can resume the same conversation on the next inject.
431
+ */
432
+ onSessionUpdate?: (update: MessagingSessionUpdate) => void;
421
433
  /**
422
434
  * Capabilities version for the SCRT2 token request. Required (>= "63", i.e.
423
435
  * release 254) for action progress indicators (`CONVERSATION_PROGRESS_INDICATOR`)
@@ -457,6 +469,20 @@ declare interface MessagingModeConfig {
457
469
  progressStepsLimit?: number;
458
470
  }
459
471
 
472
+ declare type MessagingSessionReason = "created" | "resumed" | "refreshed" | "ended" | "reset";
473
+
474
+ declare interface MessagingSessionSnapshot {
475
+ conversationId: string;
476
+ continuationToken: string;
477
+ lastEventId: string;
478
+ storedAt: number;
479
+ }
480
+
481
+ declare interface MessagingSessionUpdate {
482
+ reason: MessagingSessionReason;
483
+ snapshot: MessagingSessionSnapshot | null;
484
+ }
485
+
460
486
  /**
461
487
  * A component override is the tag name of a pre-registered custom element
462
488
  * (e.g. "product-card"). The widget creates the element via