@cimulate/copilot-widget 1.46.2 → 1.47.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 +4 -0
- package/README.md +11 -1
- package/dist/messaging.d.ts +15 -2
- package/dist/messaging.es.js +4295 -4226
- package/dist/messaging.umd.js +29 -29
- package/package.json +1 -1
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.47.0 — 2026-10-05
|
|
6
|
+
|
|
7
|
+
- Messaging page context now accepts Search Results Page (SRP) state with a query, optional refinements, and optional price bounds. Each shopper turn sends the normalized SRP snapshot to SCRT2, while retries and session recovery reuse the original snapshot. PDP and SRP context remain mutually exclusive.
|
|
8
|
+
|
|
5
9
|
## 1.46.2 — 2026-10-05
|
|
6
10
|
|
|
7
11
|
- 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.
|
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ Settings are in `public/index.html`. Example configurations you can modify:
|
|
|
152
152
|
|
|
153
153
|
### Messaging Page Context
|
|
154
154
|
|
|
155
|
-
Messaging integrations provide normalized storefront state through the generic page-context API
|
|
155
|
+
Messaging integrations provide normalized Product Detail Page (PDP) or Search Results Page (SRP) storefront state through the generic page-context API:
|
|
156
156
|
|
|
157
157
|
```ts
|
|
158
158
|
import { eventHandlers } from "@cimulate/copilot-widget/messaging";
|
|
@@ -162,11 +162,21 @@ eventHandlers.pageContext.set({
|
|
|
162
162
|
id: "product-123",
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
+
eventHandlers.pageContext.set({
|
|
166
|
+
type: "srp",
|
|
167
|
+
query: "running shoes",
|
|
168
|
+
refinements: [{ name: "color", values: ["blue"] }],
|
|
169
|
+
minPrice: 50,
|
|
170
|
+
maxPrice: 150,
|
|
171
|
+
});
|
|
172
|
+
|
|
165
173
|
const current = eventHandlers.pageContext.get();
|
|
166
174
|
|
|
167
175
|
eventHandlers.pageContext.clear();
|
|
168
176
|
```
|
|
169
177
|
|
|
178
|
+
`refinements`, `minPrice`, and `maxPrice` are optional for SRP context. The widget omits empty refinements and undefined price bounds. PDP and SRP context are mutually exclusive.
|
|
179
|
+
|
|
170
180
|
The widget snapshots the latest context immediately before a shopper turn is first sent. It reuses that snapshot for retries and session recovery, and sends the shopper's text unchanged.
|
|
171
181
|
|
|
172
182
|
## Linting and pre-commit hooks
|
package/dist/messaging.d.ts
CHANGED
|
@@ -1009,9 +1009,9 @@ declare interface OverrideSendMessageOptions {
|
|
|
1009
1009
|
*/
|
|
1010
1010
|
export declare type OverrideTagName = string;
|
|
1011
1011
|
|
|
1012
|
-
export declare type PageContext = PdpPageContext;
|
|
1012
|
+
export declare type PageContext = PdpPageContext | SrpPageContext;
|
|
1013
1013
|
|
|
1014
|
-
export declare type PageContextInput =
|
|
1014
|
+
export declare type PageContextInput = PageContext;
|
|
1015
1015
|
|
|
1016
1016
|
declare type PdpEntryParams = ProductView & {
|
|
1017
1017
|
productName?: string;
|
|
@@ -1267,6 +1267,19 @@ export declare type SendMessageResult = {
|
|
|
1267
1267
|
|
|
1268
1268
|
export declare function setPageContext(context: PageContextInput): void;
|
|
1269
1269
|
|
|
1270
|
+
export declare interface SrpPageContext {
|
|
1271
|
+
type: "srp";
|
|
1272
|
+
query: string;
|
|
1273
|
+
refinements?: SrpRefinement[];
|
|
1274
|
+
minPrice?: number;
|
|
1275
|
+
maxPrice?: number;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
export declare interface SrpRefinement {
|
|
1279
|
+
name: string;
|
|
1280
|
+
values: string[];
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1270
1283
|
declare type StaticQuestionsConfig = {
|
|
1271
1284
|
staticQuestions?: string[];
|
|
1272
1285
|
staticQuestionsStrategy?: StaticQuestionsStrategy;
|