@cimulate/copilot-widget 1.39.1 → 1.41.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 +8 -0
- package/README.md +5 -0
- package/dist/cimulate-copilot-widget.d.ts +12 -11
- package/dist/messaging.d.ts +33 -12
- package/dist/messaging.es.js +8414 -8325
- package/dist/messaging.umd.js +29 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.41.0 — 2026-09-21
|
|
6
|
+
|
|
7
|
+
- Agentforce messaging mode now exposes `sendMessage()` for storefronts (CDN and NPM). Hosts can submit a shopper query from a search bar or embedded question before the widget is open; the query is queued until the widget opens and the agent's welcome message has arrived. Pair with `eventHandlers.components.toggleWidgetOpen(true)` to show the widget. Exposed as `window.CimulateMessaging.sendMessage()` and `eventHandlers.session.sendMessage()`. React hosts continue to use `useMessaging().sendMessage()`.
|
|
8
|
+
|
|
9
|
+
## 1.40.0 — 2026-09-18
|
|
10
|
+
|
|
11
|
+
- Messaging mode: the follow-up suggestion buttons shown after an agent message are now overridable via the `Suggestions` key in `ComponentOverrides`, consistent with `ProductTile`/`ProductCarousel`/`ProductDetailCard`/`ProductComparison`/`ProgressSteps`. The override receives `{ suggestions }` (the follow-up strings, in order) and the standard `api`; posting a suggestion back to the agent goes through `api.sendMessage`, same as every other override.
|
|
12
|
+
|
|
5
13
|
## 1.39.1 — 2026-09-16
|
|
6
14
|
|
|
7
15
|
- NPM installs no longer ship React: `react` and `react-dom` are peer-only (`^18.3 || ^19`). Host apps must provide React 18.3+ or 19 when using NPM integration. CDN/UMD bundles are unchanged and still include React.
|
package/README.md
CHANGED
|
@@ -112,6 +112,11 @@ Settings are in `public/index.html`. Example configurations you can modify:
|
|
|
112
112
|
eventHandlers.components.toggleWidgetOpen(true);
|
|
113
113
|
eventHandlers.pdp.setPdpContext({ productId: "product-123" });
|
|
114
114
|
eventHandlers.browse.setBrowseContext({ categoryId: "outdoor-gear" });
|
|
115
|
+
|
|
116
|
+
// Messaging mode: submit a query from a storefront search bar or embedded question
|
|
117
|
+
const { sendMessage, eventHandlers: messagingHandlers } = window.CimulateMessaging;
|
|
118
|
+
sendMessage("running shoes");
|
|
119
|
+
messagingHandlers.components.toggleWidgetOpen(true);
|
|
115
120
|
</script>
|
|
116
121
|
```
|
|
117
122
|
|
|
@@ -108,20 +108,20 @@ declare interface CommonParams {
|
|
|
108
108
|
/**
|
|
109
109
|
* One flat map from override key to custom-element tag name.
|
|
110
110
|
*
|
|
111
|
-
* `ProductTile`, `ProductCarousel`, `ProductDetailCard`, `ProductComparison`,
|
|
112
|
-
* `ProgressSteps` are the named keys the widget consults for
|
|
113
|
-
* register one and the widget mounts your element in place of
|
|
114
|
-
* tile/carousel/detail card/comparison table/progress panel
|
|
115
|
-
* the built-in renders). Every other key
|
|
116
|
-
* `type:"tool_results"` block's top-level `output_name`
|
|
117
|
-
* the arbitrary `data` payload); an unmatched block
|
|
118
|
-
* receive the same `OverrideProps`.
|
|
111
|
+
* `ProductTile`, `ProductCarousel`, `ProductDetailCard`, `ProductComparison`,
|
|
112
|
+
* `ProgressSteps`, and `Suggestions` are the named keys the widget consults for
|
|
113
|
+
* its built-in UI: register one and the widget mounts your element in place of
|
|
114
|
+
* the default tile/carousel/detail card/comparison table/progress panel/
|
|
115
|
+
* follow-up buttons (leave it unset and the built-in renders). Every other key
|
|
116
|
+
* is matched against a `type:"tool_results"` block's top-level `output_name`
|
|
117
|
+
* (never a field inside the arbitrary `data` payload); an unmatched block
|
|
118
|
+
* renders nothing. All of them receive the same `OverrideProps`.
|
|
119
119
|
*
|
|
120
120
|
* { ProductTile: "cx-product-card", recentOrders: "cx-recent-orders" }
|
|
121
121
|
*
|
|
122
|
-
* Widget chrome (header, search bar
|
|
123
|
-
*
|
|
124
|
-
*
|
|
122
|
+
* Widget chrome (header, search bar) is intentionally NOT overridable: those
|
|
123
|
+
* keys are accepted by the open index signature but have no render path, so
|
|
124
|
+
* they are silently ignored.
|
|
125
125
|
*/
|
|
126
126
|
declare interface ComponentOverrides {
|
|
127
127
|
ProductTile?: OverrideTagName;
|
|
@@ -129,6 +129,7 @@ declare interface ComponentOverrides {
|
|
|
129
129
|
ProductDetailCard?: OverrideTagName;
|
|
130
130
|
ProductComparison?: OverrideTagName;
|
|
131
131
|
ProgressSteps?: OverrideTagName;
|
|
132
|
+
Suggestions?: OverrideTagName;
|
|
132
133
|
[key: string]: OverrideTagName | undefined;
|
|
133
134
|
}
|
|
134
135
|
|
package/dist/messaging.d.ts
CHANGED
|
@@ -213,20 +213,20 @@ declare type ComparisonTableRow = {
|
|
|
213
213
|
/**
|
|
214
214
|
* One flat map from override key to custom-element tag name.
|
|
215
215
|
*
|
|
216
|
-
* `ProductTile`, `ProductCarousel`, `ProductDetailCard`, `ProductComparison`,
|
|
217
|
-
* `ProgressSteps` are the named keys the widget consults for
|
|
218
|
-
* register one and the widget mounts your element in place of
|
|
219
|
-
* tile/carousel/detail card/comparison table/progress panel
|
|
220
|
-
* the built-in renders). Every other key
|
|
221
|
-
* `type:"tool_results"` block's top-level `output_name`
|
|
222
|
-
* the arbitrary `data` payload); an unmatched block
|
|
223
|
-
* receive the same `OverrideProps`.
|
|
216
|
+
* `ProductTile`, `ProductCarousel`, `ProductDetailCard`, `ProductComparison`,
|
|
217
|
+
* `ProgressSteps`, and `Suggestions` are the named keys the widget consults for
|
|
218
|
+
* its built-in UI: register one and the widget mounts your element in place of
|
|
219
|
+
* the default tile/carousel/detail card/comparison table/progress panel/
|
|
220
|
+
* follow-up buttons (leave it unset and the built-in renders). Every other key
|
|
221
|
+
* is matched against a `type:"tool_results"` block's top-level `output_name`
|
|
222
|
+
* (never a field inside the arbitrary `data` payload); an unmatched block
|
|
223
|
+
* renders nothing. All of them receive the same `OverrideProps`.
|
|
224
224
|
*
|
|
225
225
|
* { ProductTile: "cx-product-card", recentOrders: "cx-recent-orders" }
|
|
226
226
|
*
|
|
227
|
-
* Widget chrome (header, search bar
|
|
228
|
-
*
|
|
229
|
-
*
|
|
227
|
+
* Widget chrome (header, search bar) is intentionally NOT overridable: those
|
|
228
|
+
* keys are accepted by the open index signature but have no render path, so
|
|
229
|
+
* they are silently ignored.
|
|
230
230
|
*/
|
|
231
231
|
export declare interface ComponentOverrides {
|
|
232
232
|
ProductTile?: OverrideTagName;
|
|
@@ -234,6 +234,7 @@ export declare interface ComponentOverrides {
|
|
|
234
234
|
ProductDetailCard?: OverrideTagName;
|
|
235
235
|
ProductComparison?: OverrideTagName;
|
|
236
236
|
ProgressSteps?: OverrideTagName;
|
|
237
|
+
Suggestions?: OverrideTagName;
|
|
237
238
|
[key: string]: OverrideTagName | undefined;
|
|
238
239
|
}
|
|
239
240
|
|
|
@@ -359,6 +360,7 @@ export declare const eventHandlers: {
|
|
|
359
360
|
session: {
|
|
360
361
|
resetConversation: () => void;
|
|
361
362
|
endConversation: () => void;
|
|
363
|
+
sendMessage: typeof sendMessage;
|
|
362
364
|
};
|
|
363
365
|
};
|
|
364
366
|
|
|
@@ -744,10 +746,12 @@ export declare class OverrideElement extends HTMLElement {
|
|
|
744
746
|
* - "ProgressSteps" → { steps: string[] } — one entry per progress-indicator
|
|
745
747
|
* message received so far, in order; the last entry is
|
|
746
748
|
* the current (active) step.
|
|
749
|
+
* - "Suggestions" → { suggestions: string[] } — the follow-up suggestion
|
|
750
|
+
* strings shown after an agent message, in order.
|
|
747
751
|
* - any custom-block key → the `tool_results` block's raw `data`, your own shape
|
|
748
752
|
*/
|
|
749
753
|
export declare interface OverrideProps {
|
|
750
|
-
/** The resolved override key: "ProductTile"/"ProductCarousel"/"ProductDetailCard"/"ProductComparison"/"ProgressSteps" for the built-in slots, else the `tool_results` block's `output_name`. */
|
|
754
|
+
/** The resolved override key: "ProductTile"/"ProductCarousel"/"ProductDetailCard"/"ProductComparison"/"ProgressSteps"/"Suggestions" for the built-in slots, else the `tool_results` block's `output_name`. */
|
|
751
755
|
name: string;
|
|
752
756
|
payload: unknown;
|
|
753
757
|
api: OverrideApi;
|
|
@@ -988,6 +992,23 @@ declare interface SendError {
|
|
|
988
992
|
|
|
989
993
|
export declare type SendMessage = (text: string, options?: SendMessageOptions) => Promise<SendMessageResult>;
|
|
990
994
|
|
|
995
|
+
/**
|
|
996
|
+
* Send a shopper query into the current conversation.
|
|
997
|
+
*
|
|
998
|
+
* Safe to call before the widget is open: the query is queued until the
|
|
999
|
+
* widget opens and the agent's welcome message has arrived. Pair with
|
|
1000
|
+
* `eventHandlers.components.toggleWidgetOpen(true)` to show the widget.
|
|
1001
|
+
* Rejects if called before `injectMessagingWidget()` has mounted the widget.
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```js
|
|
1005
|
+
* const { sendMessage, eventHandlers } = window.CimulateMessaging;
|
|
1006
|
+
* sendMessage("running shoes");
|
|
1007
|
+
* eventHandlers.components.toggleWidgetOpen(true);
|
|
1008
|
+
* ```
|
|
1009
|
+
*/
|
|
1010
|
+
export declare function sendMessage(text: string, options?: SendMessageOptions): Promise<SendMessageResult>;
|
|
1011
|
+
|
|
991
1012
|
export declare interface SendMessageOptions {
|
|
992
1013
|
silent?: boolean;
|
|
993
1014
|
reconcileMessageId?: string;
|