@cimulate/copilot-widget 1.29.0 → 1.30.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.
@@ -62,7 +62,7 @@ export declare const AgentForceWidget: (props: CopilotWidgetProps) => JSX_2.Elem
62
62
  * UIStateContext >
63
63
  * MessagingProvider (Agentforce/SCRT2 SDK)
64
64
  */
65
- export declare const AgentforceWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, globalClassName, isDevelopment, componentType, componentConfig, entryType, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, showProductDescription, resetConversationMessage, conversationHistory, messagingConfig, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
65
+ export declare const AgentforceWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, globalClassName, isDevelopment, componentType, componentConfig, entryType, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, showProductDescription, resetConversationMessage, conversationHistory, messagingConfig, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
66
66
  overridesUrl?: string;
67
67
  inlineOverrides?: ComponentOverrides;
68
68
  children: ReactNode;
@@ -82,6 +82,22 @@ declare type AllCopilotEvents = {
82
82
  bypassHandlers?: boolean;
83
83
  } & (AskCimAck | CopilotEvent | ConversationResetAck | Inquiry | DisplayProducts | FollowUp | PartialInquiry | RefinedSearch | RefinedBrowse | CopilotBrowseAck | Progress | ProductViewAck | CopilotError);
84
84
 
85
+ declare type AskCimEntryParams = Record<string, never>;
86
+
87
+ declare type BrowseEntryParams = BrowsePayload["browseParams"];
88
+
89
+ declare interface BrowsePayload extends CopilotBrowse {
90
+ browseParams: Omit<BrowseState, "page" | "pageSize" | "includeFacets"> & {
91
+ catalogSegment?: string;
92
+ pricebooks?: string[];
93
+ };
94
+ }
95
+
96
+ declare interface BrowseState extends CommonParams {
97
+ categoryId: string;
98
+ categoryName?: string;
99
+ }
100
+
85
101
  declare type CartDetails = {
86
102
  id: string;
87
103
  currencyCode: string;
@@ -168,6 +184,16 @@ declare interface ClientContext {
168
184
  [key: string]: string | number;
169
185
  }
170
186
 
187
+ declare interface CommonParams {
188
+ page?: number | null;
189
+ pageSize?: number | null;
190
+ includeFacets?: boolean;
191
+ facetFilters?: FacetFilters;
192
+ rangeFilters?: RangeFilters;
193
+ catalogSegment?: string | null;
194
+ pricebooks?: string[] | null;
195
+ }
196
+
171
197
  declare type ComparisonTableRow = {
172
198
  row_name: string;
173
199
  values: string[];
@@ -224,12 +250,15 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
224
250
  showProductDescription?: boolean;
225
251
  theme?: ThemeConfig;
226
252
  openLinksInNewTab?: boolean;
253
+ /**
254
+ * @deprecated This setting has been moved to the initialEntry object. Please use initialEntry.type instead.
255
+ */
227
256
  entryType?: EntryType;
257
+ initialEntry?: InitialEntry;
228
258
  entryMessage?: string;
229
259
  disclaimerText?: string;
230
260
  disclaimerMarkdown?: string;
231
261
  clientContext?: ClientContext;
232
- progressStepsLimit?: number;
233
262
  /**
234
263
  * Baseline catalog-scoping parameters (facetFilters, catalogSegment, pricebooks)
235
264
  * applied by the workflow as defaults on context-less requests (ask_cim, product view)
@@ -288,7 +317,9 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
288
317
 
289
318
  declare type DialogPosition = "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right" | "center";
290
319
 
291
- declare type EntryType = "search" | "browse" | "pdp" | "ask_cim";
320
+ declare const ENTRY_TYPES: readonly ["ask_cim", "search", "browse", "pdp"];
321
+
322
+ export declare type EntryType = (typeof ENTRY_TYPES)[number];
292
323
 
293
324
  export declare const eventHandlers: {
294
325
  components: {
@@ -308,6 +339,8 @@ export declare const eventHandlers: {
308
339
  };
309
340
  };
310
341
 
342
+ declare type FacetFilters = Record<string, string[]>;
343
+
311
344
  declare interface HeaderConfig {
312
345
  logoUrl?: string;
313
346
  headerText?: string;
@@ -319,6 +352,20 @@ declare interface HeaderConfig {
319
352
  headerTextTextAlign?: "left" | "center" | "right";
320
353
  }
321
354
 
355
+ export declare type InitialEntry = {
356
+ type: "search";
357
+ params: SearchEntryParams;
358
+ } | {
359
+ type: "browse";
360
+ params: BrowseEntryParams;
361
+ } | {
362
+ type: "pdp";
363
+ params: PdpEntryParams;
364
+ } | {
365
+ type: "ask_cim";
366
+ params?: AskCimEntryParams;
367
+ };
368
+
322
369
  export declare const injectMessagingWidget: ({ timeout, elementId, overridesUrl, overrides: inlineOverrides, ...props }: InjectMessagingWidgetOptions) => void;
323
370
 
324
371
  declare interface InjectMessagingWidgetOptions extends Omit<CopilotWidgetProps, "apiKey" | "apiToken" | "baseUrl" | "mode"> {
@@ -365,16 +412,13 @@ export declare interface MessagingContextType {
365
412
  isAgentTyping: boolean;
366
413
  conversationId: string | null;
367
414
  messages: MessagingMessage[];
368
- /** In-progress response blocks streamed before the final message arrives. */
369
415
  streamingBlocks: ResponseItem[];
370
416
  /**
371
417
  * Loading text for the action the agent is currently executing, from the
372
418
  * agent action's `progress_indicator_message`. Empty when none is active.
373
419
  */
374
420
  progressMessage: string;
375
- /** Accumulating list of progress step messages for the current turn. */
376
421
  progressSteps: string[];
377
- /** Whether the messaging is currently loading */
378
422
  loading: boolean;
379
423
  /**
380
424
  * True while a silent cart update is in flight. Silent sends leave `loading`
@@ -384,22 +428,12 @@ export declare interface MessagingContextType {
384
428
  cartUpdating: boolean;
385
429
  error: string | null;
386
430
  sendError: SendError | null;
387
- /**
388
- * True when an idle session expired in the background and its restart was
389
- * deferred until the user interacts. The composer stays enabled in this
390
- * state so the next message can trigger a fresh session.
391
- */
392
431
  sessionExpired: boolean;
393
432
  sendMessage: SendMessage;
394
433
  addToCart: (params: AddToCartParams) => void;
395
434
  resetConversation: () => void;
396
435
  retryLastMessage: () => ReturnType<SendMessage> | undefined;
397
436
  retryConnection: () => void;
398
- /**
399
- * Download the current conversation's transcript as a PDF. Resolves once the
400
- * browser download has been triggered; rejects if no conversation is active
401
- * or the request fails.
402
- */
403
437
  downloadTranscript: () => Promise<void>;
404
438
  }
405
439
 
@@ -434,7 +468,6 @@ export declare interface MessagingMessage {
434
468
  role: string;
435
469
  name?: string;
436
470
  };
437
- /** The raw event data for advanced consumers */
438
471
  raw?: AgentforceMessageEvent;
439
472
  }
440
473
 
@@ -707,6 +740,10 @@ declare interface OverrideSendMessageOptions {
707
740
  */
708
741
  export declare type OverrideTagName = string;
709
742
 
743
+ declare type PdpEntryParams = ProductView & {
744
+ productName?: string;
745
+ };
746
+
710
747
  declare type PriceBreakdown = {
711
748
  original?: PriceBucket | null;
712
749
  sales?: PriceBucket | null;
@@ -857,8 +894,27 @@ declare type PromptsExtensionState = {
857
894
 
858
895
  declare type PromptsParams = AskCimSuggestions | CopilotSearchSuggestions | CopilotBrowseSuggestions | ProductViewSuggestions;
859
896
 
897
+ declare type RangeFilters = Array<{
898
+ field: string;
899
+ min: number;
900
+ max: number;
901
+ }>;
902
+
860
903
  declare type ResponseItem = MarkdownResponse | ProductCarouselResponse | ProductTileResponse | ProductComparisonResponse | SuggestionsResponse | CartResponse | OrderConfirmationResponse | ToolResultsResponse;
861
904
 
905
+ declare type SearchEntryParams = SearchPayload["searchParams"];
906
+
907
+ declare interface SearchPayload extends CopilotSearch {
908
+ searchParams: Omit<SearchState, "page" | "pageSize" | "includeFacets"> & {
909
+ catalogSegment?: string;
910
+ pricebooks?: string[];
911
+ };
912
+ }
913
+
914
+ declare interface SearchState extends CommonParams {
915
+ query: string;
916
+ }
917
+
862
918
  /**
863
919
  * A retryable message-send failure: the connection is live but the send itself
864
920
  * failed (5xx / network / timeout, not a session expiry). Holds what's needed
@@ -877,6 +933,7 @@ export declare type SendMessage = (text: string, options?: SendMessageOptions) =
877
933
  export declare interface SendMessageOptions {
878
934
  silent?: boolean;
879
935
  reconcileMessageId?: string;
936
+ displayContent?: string;
880
937
  }
881
938
 
882
939
  export declare type SendMessageResult = {