@cimulate/copilot-widget 1.55.0 → 1.55.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,15 @@
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.55.2 — 2026-11-10
6
+
7
+ - Messaging `eventHandlers.cart.update` now updates only the internal cart-diff baseline. It no longer rewrites the latest cart message or changes its summary, totals, payment controls, or historical content. Empty baskets still seed the next diff, and the call does not emit `cimulate:cart-update`.
8
+ - Storefront cart baselines can be supplied as soon as the messaging API is available, before mount or during startup. The latest pre-mount value is retained, startup history and duplicate replay cannot overwrite a newer baseline, and snapshots supplied synchronously by host callbacks are preserved. Natural agent cart messages still render normally. Without a storefront seed, the latest restored cart initializes the baseline before the next operation.
9
+
10
+ ## 1.55.1 — 2026-11-06
11
+
12
+ - With page context enabled, queued messages wait for the agent welcome before sending. If welcome does not arrive within 12 seconds, the send fails with a welcome timeout instead of waiting indefinitely. Integrations without page context keep the existing fallback.
13
+
5
14
  ## 1.55.0 — 2026-11-06
6
15
 
7
16
  - Messaging mode: `eventHandlers.cart.update` updates the latest cart message in the chat and does not emit `cimulate:cart-update`. The next agent cart result is compared with that basket. Cart messages restored while the conversation is resuming do not emit `cimulate:cart-update`.
package/README.md CHANGED
@@ -230,9 +230,11 @@ eventHandlers.cart.update({
230
230
  });
231
231
  ```
232
232
 
233
- The object is the full basket (`CartDetails`), not a quantity stub. An empty `items` array means an empty cart. A payload without an `items` array is ignored. A call before the widget is mounted is ignored.
233
+ The object is the full basket (`CartDetails`), not a quantity stub. An empty `items` array means an empty cart. A payload without an `items` array is ignored. The latest valid call made before the widget mounts is retained and applied at mount.
234
234
 
235
- Call it after the widget is mounted, on page load, after the shopper changes the basket outside the widget, and again after a restored conversation. The latest cart message in the chat updates to that basket. Older cart messages stay as they were. The call does not emit `cimulate:cart-update`. The next agent cart result is compared with that basket.
235
+ Call it as soon as the messaging API is available and the storefront has a fresh basket, including before mount or during startup. Startup history and duplicate replay cannot replace a storefront seed; later live agent cart responses advance the baseline normally. Call again after storefront basket changes. The storefront must discard stale fetch results rather than submit them as new snapshots.
236
+
237
+ Only the internal cart-diff baseline is updated. The call does not emit `cimulate:cart-update`. The next agent cart result is compared with that basket.
236
238
 
237
239
  ## Linting and pre-commit hooks
238
240
 
@@ -857,7 +857,7 @@ export declare interface MessagingModeConfig {
857
857
  connectingMessages?: readonly string[] | null;
858
858
  }
859
859
 
860
- export declare const MessagingProvider: ({ scrt2Url, orgId, esDeveloperName, routingAttributes, conversationId: configConversationId, continuationToken: configContinuationToken, lastEventId: configLastEventId, capabilitiesVersion, enablePageContext, enableLogging, onConnect, onMessage, onError, onProductResult, onEndConversation, onSessionUpdate, children, }: MessagingProviderProps) => JSX_2.Element;
860
+ export declare const MessagingProvider: ({ scrt2Url, orgId, esDeveloperName, routingAttributes, conversationId: configConversationId, continuationToken: configContinuationToken, lastEventId: configLastEventId, capabilitiesVersion, enablePageContext, enableLogging, onConnect, onMessage, onError, onProductResult, onEndConversation, onSessionUpdate, onWelcomeTimeout, children, }: MessagingProviderProps) => JSX_2.Element;
861
861
 
862
862
  declare interface MessagingProviderProps {
863
863
  scrt2Url: string;
@@ -877,6 +877,7 @@ declare interface MessagingProviderProps {
877
877
  onProductResult?: (detail: ProductResultDetail) => void;
878
878
  onEndConversation?: (conversationId: string | null) => Promise<void> | void;
879
879
  onSessionUpdate?: (update: MessagingSessionUpdate) => void;
880
+ onWelcomeTimeout?: () => void;
880
881
  children: ReactNode;
881
882
  }
882
883
 
@@ -1514,14 +1515,15 @@ declare type ToolResultsResponse = {
1514
1515
  };
1515
1516
 
1516
1517
  /**
1517
- * Show the storefront's current basket on the latest cart message.
1518
+ * Set the internal basket baseline for subsequent cart-change diffs.
1518
1519
  * Pass the full basket. `items` is required; an empty array means an empty cart.
1519
1520
  * A payload without an `items` array is ignored.
1520
1521
  *
1521
- * Call from the messaging entry after the widget is mounted, on page load and
1522
- * after the shopper changes the basket outside the widget, and again after a
1523
- * restored conversation. Older cart messages stay as they were. A call before
1524
- * the widget is mounted is ignored. Does not emit `cimulate:cart-update`.
1522
+ * Call once the messaging API is available, including before widget mount or
1523
+ * during conversation startup. The latest pre-mount call is retained until mount.
1524
+ * A storefront baseline takes precedence over startup history; later live agent
1525
+ * carts advance it normally. No messages or cart components are changed, and the
1526
+ * call does not emit `cimulate:cart-update`.
1525
1527
  */
1526
1528
  declare function updateCart(cart: CartDetails): void;
1527
1529