@cimulate/copilot-widget 1.41.2 → 1.42.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.
@@ -31,6 +31,7 @@ import { ReactNode } from 'react';
31
31
  import { RefinedBrowse } from '@cimulate/copilot-sdk';
32
32
  import { RefinedSearch } from '@cimulate/copilot-sdk';
33
33
  import { SearchParams } from '@cimulate/copilot-sdk';
34
+ import { SessionContextEntry } from '@cimulate/agentforce-sdk';
34
35
 
35
36
  declare interface AddToCartParams {
36
37
  productName?: string;
@@ -191,6 +192,8 @@ export declare interface CimulateWidgetReadyDetail {
191
192
  abort: () => void;
192
193
  }
193
194
 
195
+ export declare function clearPageContext(): void;
196
+
194
197
  declare interface ClientContext {
195
198
  [key: string]: string | number;
196
199
  }
@@ -362,6 +365,11 @@ export declare const eventHandlers: {
362
365
  endConversation: () => void;
363
366
  sendMessage: typeof sendMessage;
364
367
  };
368
+ pageContext: {
369
+ set: typeof setPageContext;
370
+ get: typeof getPageContext;
371
+ clear: typeof clearPageContext;
372
+ };
365
373
  };
366
374
 
367
375
  declare type FacetFilters = Record<string, string[]>;
@@ -377,6 +385,8 @@ declare type FacetFilters = Record<string, string[]>;
377
385
  */
378
386
  export declare function getAuthLinkKey(): Promise<string>;
379
387
 
388
+ export declare function getPageContext(): PageContext | null;
389
+
380
390
  declare interface HeaderConfig {
381
391
  logoUrl?: string;
382
392
  headerText?: string;
@@ -790,10 +800,19 @@ declare interface OverrideSendMessageOptions {
790
800
  */
791
801
  export declare type OverrideTagName = string;
792
802
 
803
+ export declare type PageContext = PdpPageContext;
804
+
805
+ export declare type PageContextInput = PdpPageContext;
806
+
793
807
  declare type PdpEntryParams = ProductView & {
794
808
  productName?: string;
795
809
  };
796
810
 
811
+ export declare interface PdpPageContext {
812
+ type: "pdp";
813
+ id: string;
814
+ }
815
+
797
816
  declare type PriceBreakdown = {
798
817
  original?: PriceBucket | null;
799
818
  sales?: PriceBucket | null;
@@ -990,6 +1009,7 @@ declare interface SendError {
990
1009
  displayContent?: string;
991
1010
  message: string;
992
1011
  options?: SendMessageOptions;
1012
+ sessionContext?: SessionContextEntry[] | null;
993
1013
  }
994
1014
 
995
1015
  export declare type SendMessage = (text: string, options?: SendMessageOptions) => Promise<SendMessageResult>;
@@ -1026,6 +1046,8 @@ export declare type SendMessageResult = {
1026
1046
  outcome: "timeout";
1027
1047
  };
1028
1048
 
1049
+ export declare function setPageContext(context: PageContextInput): void;
1050
+
1029
1051
  declare type StaticQuestionsConfig = {
1030
1052
  staticQuestions?: string[];
1031
1053
  staticQuestionsStrategy?: StaticQuestionsStrategy;