@cimulate/copilot-widget 1.30.0 → 1.30.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 +119 -0
- package/dist/messaging.d.ts +12 -4
- package/dist/messaging.es.js +4481 -4461
- package/dist/messaging.umd.js +29 -29
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## 1.30.2 — 2026-08-20
|
|
6
|
+
|
|
7
|
+
- CHANGELOG.md is now published with the npm package and visible on the npmjs.com package page, so customers can see release notes when deciding whether to bump `cc_cdnVersion`.
|
|
8
|
+
|
|
9
|
+
## 1.30.1 — 2026-08-19
|
|
10
|
+
|
|
11
|
+
- Cart and order-confirmation coupon/promotion values are now normalized to a display code at render time, handling both the plain string and structured `{status, id, code}` shapes the agent can return. Agent messages are now wrapped in an error boundary that falls back to a plain message instead of crashing the whole widget when a block fails to render.
|
|
12
|
+
|
|
13
|
+
## 1.30.0 — 2026-08-18
|
|
14
|
+
|
|
15
|
+
- Added a `displayContent` option to `sendMessage` (`sendMessage(utterance, { displayContent })`), letting a send show a short label in the user bubble while delivering a fuller utterance to the agent.
|
|
16
|
+
- Added an `initialEntry` widget config (`{ type, params }`, discriminated on the existing `EntryType`) that seeds the widget's entry type and the matching context params once at mount. Wired up to messaging mode for PDPContext only.
|
|
17
|
+
- Wired up Prompts questions pills in messaging mode to submit questions with the product context as part of utterance.
|
|
18
|
+
|
|
19
|
+
## 1.29.1 — 2026-08-17
|
|
20
|
+
|
|
21
|
+
- Refactored by removing redundant top level entry of `progressStepsLimit` and make it part of `messagingConfig` only.
|
|
22
|
+
|
|
23
|
+
## 1.29.0 — 2026-08-17
|
|
24
|
+
|
|
25
|
+
- Added an `onProductResult` callback (`{ agentSessionId, kind, productIds }`) to `messagingConfig`, invoked whenever a finalized Agentforce message carries a product result block, so storefronts can observe product searches and product-detail lookups. `kind` is `"search"` for a product carousel or `"detail"` for a product tile, and `productIds` lists the product ids involved. Requires `@cimulate/agentforce-sdk` 1.2.0, which now surfaces the Salesforce MessagingSession record Id on message events.
|
|
26
|
+
|
|
27
|
+
## 1.28.0 — 2026-08-13
|
|
28
|
+
|
|
29
|
+
- Made the in-chat product detail card and product comparison table overridable in Agentforce messaging mode via two new Component Override keys: `ProductDetailCard` (payload `{ id, data }`) and `ProductComparison` (payload `{ products, table }`). Both receive the standard `{ name, payload, api }` contract; the `api` is unchanged, so an override drives cart actions through `api.sendMessage` rather than a structured method. Overriding `ProductDetailCard` replaces the entire built-in card, including the Apple Pay / Google Pay express-checkout button — the override gets the raw `data.expressPaymentUrl` and must build its own checkout UI. Fully additive and backwards compatible: the built-in renders whenever the slot is unset.
|
|
30
|
+
|
|
31
|
+
## 1.27.1 — 2026-08-13
|
|
32
|
+
|
|
33
|
+
- Fixed several bugs in the Agentforce messaging silent-update flow (cart quantity edits). Silent-request state is now tracked per in-flight request in `MessagingProvider` (not as global reducer state cleared by unrelated actions), so it survives retries and session recovery without wedging the loading/typing chrome for later messages. A silent send now resolves through an explicit completion path with a bounded 10-second timeout as a backstop against a permanently spinning quantity input, and a late or out-of-order response can no longer be mistaken for the wrong request's result. Cart-message replacement no longer depends on the reducer inferring a hidden `silent` flag on the previous message; callers now pass the exact message ID to replace via a `reconcileMessageId` option, and its ID is preserved so the UI doesn't remount. The override-facing `OverrideApi.sendMessage` accepts only the `silent` option (not the internal `reconcileMessageId`), so a component override cannot overwrite an arbitrary message in the transcript by id. While a silent cart edit is in flight the whole cart's chrome is now locked (Remove buttons, coupon field, and every quantity input), so a second cart action can't race the pending update — a silent edit leaves the global `loading` flag untouched, so the cart tracks its own in-flight state instead. The sibling quantity inputs are now genuinely disabled rather than only blocked at send time, so a value typed into another row mid-edit can no longer linger unsent and leave the item count out of sync with the displayed quantities once the first edit resolves.
|
|
34
|
+
- Fixed the Agentforce messaging cart's two-column layout being wired to the `isWidgetStandalone` mode flag. The embedded chat had to falsely claim it was standalone to get the layout, which also mislabeled unrelated children (processing/connecting indicators, product carousel spacing, follow-up suggestions) as standalone. The two-column layout is now scoped to its layout container (`cim-widget-embedded-chat` / the standalone `cim-widget-modal`) in CSS, and the embedded chat reports its true, non-standalone mode. No visible change to the cart layout itself.
|
|
35
|
+
- Component overrides can now pass the `silent` option to `api.sendMessage(text, { silent })`, suppressing the user bubble for a machine-readable payload (e.g. a form's final JSON) that would be noise in the transcript. Only the outgoing bubble is suppressed; the agent's reply still renders normally. Additive and backwards compatible.
|
|
36
|
+
|
|
37
|
+
## 1.27.0 — 2026-08-13
|
|
38
|
+
|
|
39
|
+
- Surfaced prompts configs to load config-based questions for both copilot and messaging modes. Fixed some UI bugs (suggestion button alignment, product descriptions in markup, search input font-size).
|
|
40
|
+
|
|
41
|
+
## 1.26.2 — 2026-08-12
|
|
42
|
+
|
|
43
|
+
- Fixed product detail cards briefly showing "Adding..." while the agent was still loading the card. The button now shows "Adding..." only after the shopper clicks Add to cart, and returns to Add to cart when that messaging turn completes (W-23731001).
|
|
44
|
+
|
|
45
|
+
## 1.26.1 — 2026-08-11
|
|
46
|
+
|
|
47
|
+
- Fixed a registered `ProductTile` override receiving an empty payload for every card inside a product carousel, so custom tiles rendered with no image, price, or name (and a "View details for undefined" label). The carousel had stopped forwarding the raw product to each tile in 1.24.0; it now passes it through again. Storefronts using the built-in tile were unaffected; only `ProductTile` overrides saw the empty data.
|
|
48
|
+
|
|
49
|
+
## 1.26.0 — 2026-08-07
|
|
50
|
+
|
|
51
|
+
- Added Apple Pay / Google Pay express checkout to product detail cards in Agentforce messaging mode. The widget retargets the storefront's cart express-checkout URL to `Payments-ExpressProduct`, pins the currently selected variant and quantity, and requests the order confirmation after a successful payment. Requires matching `plugin_commerce_client` product express-checkout support.
|
|
52
|
+
|
|
53
|
+
## 1.25.1 — 2026-08-07
|
|
54
|
+
|
|
55
|
+
- Added an optional `progressStepsLimit` property in `ProgressStepsPanel` which can be set to customize how many AI agent reasoning steps are shown while a response is being generated. This field is under `messageConfig`. Previously this panel was able to grow with unlimited number of step elements and would cover up the entire chat view and created bad user experience. This property defaults to 3 if a panel is created without this property defined. Can choose to hide (0), display unlimited (-n), or limit to any set number (n).
|
|
56
|
+
|
|
57
|
+
## 1.25.0 — 2026-08-06
|
|
58
|
+
|
|
59
|
+
- Hardened SCRT2 session resume so a copilot conversation survives the mobile background/lock cycle instead of tearing down with "session ended due to inactivity" and starting fresh (W-23597021). On returning to the foreground the widget now resumes the existing conversation whenever the session is still valid, only starting over when the server authoritatively reports the conversation gone or closed. A resume that fails on a transient/network error keeps the stored identity and continuation token so the next attempt can recover, rather than discarding the session on an unverified failure. A recovery failure on a user turn now surfaces as a retryable send error, and a message or retry sent mid-resume is serialized onto the resumed connection. Continuation-token expiry is gated on the token's own JWT `exp` (72h server ceiling), treating an unreadable/opaque token as valid so the server owns the expiry decision.
|
|
60
|
+
|
|
61
|
+
## 1.24.7 — 2026-08-07
|
|
62
|
+
|
|
63
|
+
- Replaced the +/- quantity stepper in the Agentforce messaging cart with a text input: typing a new quantity and pressing Enter or blurring the field sends a silent cart-update, showing a shimmer on the item price and totals instead of the full loading/typing indicators. Added a two-column layout for the cart in chat/modal modes (items on the left, totals on the right, 768px+ screens) and refreshed cart typography. (The silent cart-update path this built on had failure-mode bugs — a stuck spinner and suppressed chrome for later messages — fixed in 1.26.1.)
|
|
64
|
+
|
|
65
|
+
## 1.24.6 — 2026-08-07
|
|
66
|
+
|
|
67
|
+
- Added infrastructure for silent background messages in Agentforce messaging mode: a `silent` option on `sendMessage` that suppresses loading/typing indicators, streaming previews, and progress steps, and excludes the message from chat history. Cart responses to a silent request replace the existing cart message in place (preserving its ID) instead of appending a new one. No user-visible change on its own — enables upcoming cart-editing features built on top of it. (This first cut tracked silent state as global reducer state and inferred which cart to replace by sniffing the previous message for a hidden `silent` flag; both proved fragile and were reworked in 1.26.1 into per-request tracking with an explicit `reconcileMessageId`.)
|
|
68
|
+
|
|
69
|
+
## 1.24.5 — 2026-08-06
|
|
70
|
+
|
|
71
|
+
- Added an ESLint rule and pre-commit hook enforcing this project's no-redundant-comments guideline, and cleaned up existing comments that violated it. No functional changes.
|
|
72
|
+
|
|
73
|
+
## 1.24.4 — 2026-08-06
|
|
74
|
+
|
|
75
|
+
- Fixed the express-checkout (Apple Pay / Google Pay) button not appearing in the Agentforce messaging cart. The `Payments-Express` iframe posts its lifecycle events to a target origin; the widget now passes its real `window.location.origin` to that iframe via a `parentOrigin` query param, so the messages reach the page instead of being silently dropped. This is required on internally-routed SFCC deployments where the storefront can't derive the public origin from the request Host header. Requires the matching `plugin_commerce_client` change that reads and validates the `parentOrigin` param. Also dropped the express button's bottom margin so it sits flush above the Checkout button.
|
|
76
|
+
|
|
77
|
+
## 1.24.3 — 2026-08-05
|
|
78
|
+
|
|
79
|
+
- Fixed the minimized widget FAB (floating action button) being hidden behind storefront content on some layouts. The `.cim-widget-minimized-container` used `position: fixed` without a `z-index`, so page elements with their own stacking context could paint over it (reported on Brooks Running, where the FAB was hidden until the browser width was shrunk). It now uses `z-index: 9999`, matching the widget's other top-level layers (the expanded dialog and modal).
|
|
80
|
+
|
|
81
|
+
## 1.24.2 — 2026-08-04
|
|
82
|
+
|
|
83
|
+
- Fixed broken PDP gallery images when a customer's CDN has no `medium` variant. The gallery now falls back to the original `large` URL when the medium image fails to load, and hides each image until it loads so no broken state flashes.
|
|
84
|
+
|
|
85
|
+
## 1.24.1 — 2026-08-03
|
|
86
|
+
|
|
87
|
+
- Added `ProgressSteps` as an overridable component slot, joining `ProductTile` and `ProductCarousel`. Registering a tag name under this key replaces the built-in streaming progress panel; the element receives `{ steps: string[] }` with one entry per progress message received so far, the last being the active step. Additive and backwards compatible — the built-in panel renders when no override is registered.
|
|
88
|
+
|
|
89
|
+
## 1.24.0 — 2026-07-30
|
|
90
|
+
|
|
91
|
+
- Updated product tiles in carousel to show price ranges when available, and optionally, the product description and AI-generated caption. Fixed button loading state in product details card and removed quantity editor when cart management is not enabled.
|
|
92
|
+
|
|
93
|
+
## 1.23.0 — 2026-07-30
|
|
94
|
+
|
|
95
|
+
- Added a component override SDK (Agentforce messaging mode) so storefronts can replace the widget's product-rendering components and handle agent-action payloads with their own branded custom elements, using one `{ name, payload, api }` tag-name contract. Overrides are supplied inline via the new React `overrides` prop or script-loaded via `window.CimulateOverrides`. Overridable product slots are `ProductTile` and `ProductCarousel`; agent-action results arrive as `tool_results` blocks routed by top-level `output_name` to the matching registered tag. Additive and backwards compatible — the widget renders its built-ins when no override is registered. An optional `OverrideElement` base class implementing the props/render lifecycle is exported from `@cimulate/copilot-widget/messaging` (`CimulateMessaging.OverrideElement` on the UMD bundle).
|
|
96
|
+
|
|
97
|
+
## 1.22.1 — 2026-07-29
|
|
98
|
+
|
|
99
|
+
- **Behavior change:** `messagingConfig.enableEscalationToAgent` now defaults to `false` (previously `true`). The "Connect to a human agent" button is hidden unless the flag is explicitly set to `true`. This matches the guidance that most orgs handle escalation server-side in AgentScript, and the reference agent template ships with human-escalation disabled. Existing embeds that relied on the button being on by default must now pass `messagingConfig={{ enableEscalationToAgent: true }}` to keep it visible.
|
|
100
|
+
|
|
101
|
+
## 1.22.0 — 2026-07-27
|
|
102
|
+
|
|
103
|
+
- Added an `order_confirmation` structured message block and `MessageOrderConfirmation` component, rendered once an order is placed in Agentforce messaging mode. Reuses the `cart` block's item/promotion/coupon/totals contract plus order number and ordered-on date, in a read-only view (no remove, coupon input, checkout, or express payment). Requires the storefront's `plugin_commerce_client` cartridge to emit the `order_confirmation` payload.
|
|
104
|
+
|
|
105
|
+
## 1.21.0 — 2026-07-24
|
|
106
|
+
|
|
107
|
+
- Added a `messagingConfig.enableEscalationToAgent` flag (Agentforce messaging mode) that shows/hides the "Connect to a human agent" button in the search bar. On by default; set to `false` to hide it. The button asks the agent to escalate the conversation to a human, so it requires the org's Agentforce agent to be configured with an escalation path/topic.
|
|
108
|
+
|
|
109
|
+
## 1.20.0 — 2026-07-22
|
|
110
|
+
|
|
111
|
+
- Render single-item carousels within carousel instead of extracting it. Update price display logic to use listPrice. Remove unneeded prompts staticQuestions implementation.
|
|
112
|
+
|
|
113
|
+
## 1.19.0 — 2026-07-22
|
|
114
|
+
|
|
115
|
+
- Added an Apple Pay / Google Pay express checkout button to the cart in Agentforce messaging mode. Rendered above the Checkout button in `MessageCart`, it loads the storefront's `Payments-Express` iframe so shoppers can pay with a digital wallet without leaving the conversation. Requires the storefront's `plugin_commerce_client` cartridge (with `plugin_salesforcepayments` on the site path) and Salesforce Payments express-checkout-on-cart enabled.
|
|
116
|
+
|
|
117
|
+
## 1.18.0 — 2026-07-21
|
|
118
|
+
|
|
119
|
+
- Added a "Download transcript" option to the chat widget header (overflow menu) in Agentforce messaging mode that exports the current conversation as a PDF. Gated by the new `messagingConfig.enableDownloadTranscript` flag (on by default; set to `false` to hide). Fetches the server-generated PDF via the Salesforce MIAW `retrieveConversationTranscript` endpoint (requires `@cimulate/agentforce-sdk` `>= 1.1.0`, and the org's messaging channel must allow transcript download).
|
package/dist/messaging.d.ts
CHANGED
|
@@ -111,8 +111,8 @@ declare type CartDetails = {
|
|
|
111
111
|
promotionsDiscount: number | null;
|
|
112
112
|
promotions: string[];
|
|
113
113
|
couponsDiscount: number | null;
|
|
114
|
-
couponsApplied:
|
|
115
|
-
coupons:
|
|
114
|
+
couponsApplied: CouponEntry[];
|
|
115
|
+
coupons: CouponEntry[];
|
|
116
116
|
headerMessage: string | null;
|
|
117
117
|
/** May contain inline HTML (e.g. <strong>) — render as sanitized markup. */
|
|
118
118
|
bodyMessage: string | null;
|
|
@@ -131,7 +131,7 @@ declare type CartItem = {
|
|
|
131
131
|
originalSubtotal: number;
|
|
132
132
|
variants: CartItemVariant[];
|
|
133
133
|
promotions: string[];
|
|
134
|
-
coupons:
|
|
134
|
+
coupons: CouponEntry[];
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
declare type CartItemVariant = {
|
|
@@ -315,6 +315,8 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
315
315
|
__features?: Record<string, boolean>;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
+
declare type CouponEntry = string | StructuredCoupon;
|
|
319
|
+
|
|
318
320
|
declare type DialogPosition = "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right" | "center";
|
|
319
321
|
|
|
320
322
|
declare const ENTRY_TYPES: readonly ["ask_cim", "search", "browse", "pdp"];
|
|
@@ -604,7 +606,7 @@ declare type OrderDetails = {
|
|
|
604
606
|
promotionsDiscount: number | null;
|
|
605
607
|
promotions: string[];
|
|
606
608
|
couponsDiscount: number | null;
|
|
607
|
-
couponsApplied:
|
|
609
|
+
couponsApplied: CouponEntry[];
|
|
608
610
|
headerMessage: string | null;
|
|
609
611
|
bodyMessage: string | null;
|
|
610
612
|
footerMessage: string | null;
|
|
@@ -947,6 +949,12 @@ export declare type SendMessageResult = {
|
|
|
947
949
|
|
|
948
950
|
declare type StaticQuestionsStrategy = "override" | "append" | "prepend";
|
|
949
951
|
|
|
952
|
+
declare type StructuredCoupon = {
|
|
953
|
+
code: string;
|
|
954
|
+
id?: string;
|
|
955
|
+
status?: string;
|
|
956
|
+
};
|
|
957
|
+
|
|
950
958
|
declare type Suggestion = CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion | CopilotBrowseSuggestion;
|
|
951
959
|
|
|
952
960
|
declare interface SuggestionButtonConfig {
|