@cimulate/copilot-widget 1.29.1 → 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.
- package/dist/cimulate-copilot-widget.d.ts +38 -10
- package/dist/cimulate-copilot-widget.es.js +3433 -3429
- package/dist/cimulate-copilot-widget.umd.js +28 -28
- package/dist/copilot.d.ts +2 -0
- package/dist/copilot.es.js +3433 -3429
- package/dist/copilot.umd.js +28 -28
- package/dist/messaging.d.ts +74 -16
- package/dist/messaging.es.js +9537 -9363
- package/dist/messaging.umd.js +30 -30
- package/package.json +1 -1
package/dist/messaging.d.ts
CHANGED
|
@@ -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,7 +250,11 @@ 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;
|
|
@@ -287,7 +317,9 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
287
317
|
|
|
288
318
|
declare type DialogPosition = "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right" | "center";
|
|
289
319
|
|
|
290
|
-
declare
|
|
320
|
+
declare const ENTRY_TYPES: readonly ["ask_cim", "search", "browse", "pdp"];
|
|
321
|
+
|
|
322
|
+
export declare type EntryType = (typeof ENTRY_TYPES)[number];
|
|
291
323
|
|
|
292
324
|
export declare const eventHandlers: {
|
|
293
325
|
components: {
|
|
@@ -307,6 +339,8 @@ export declare const eventHandlers: {
|
|
|
307
339
|
};
|
|
308
340
|
};
|
|
309
341
|
|
|
342
|
+
declare type FacetFilters = Record<string, string[]>;
|
|
343
|
+
|
|
310
344
|
declare interface HeaderConfig {
|
|
311
345
|
logoUrl?: string;
|
|
312
346
|
headerText?: string;
|
|
@@ -318,6 +352,20 @@ declare interface HeaderConfig {
|
|
|
318
352
|
headerTextTextAlign?: "left" | "center" | "right";
|
|
319
353
|
}
|
|
320
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
|
+
|
|
321
369
|
export declare const injectMessagingWidget: ({ timeout, elementId, overridesUrl, overrides: inlineOverrides, ...props }: InjectMessagingWidgetOptions) => void;
|
|
322
370
|
|
|
323
371
|
declare interface InjectMessagingWidgetOptions extends Omit<CopilotWidgetProps, "apiKey" | "apiToken" | "baseUrl" | "mode"> {
|
|
@@ -364,16 +412,13 @@ export declare interface MessagingContextType {
|
|
|
364
412
|
isAgentTyping: boolean;
|
|
365
413
|
conversationId: string | null;
|
|
366
414
|
messages: MessagingMessage[];
|
|
367
|
-
/** In-progress response blocks streamed before the final message arrives. */
|
|
368
415
|
streamingBlocks: ResponseItem[];
|
|
369
416
|
/**
|
|
370
417
|
* Loading text for the action the agent is currently executing, from the
|
|
371
418
|
* agent action's `progress_indicator_message`. Empty when none is active.
|
|
372
419
|
*/
|
|
373
420
|
progressMessage: string;
|
|
374
|
-
/** Accumulating list of progress step messages for the current turn. */
|
|
375
421
|
progressSteps: string[];
|
|
376
|
-
/** Whether the messaging is currently loading */
|
|
377
422
|
loading: boolean;
|
|
378
423
|
/**
|
|
379
424
|
* True while a silent cart update is in flight. Silent sends leave `loading`
|
|
@@ -383,22 +428,12 @@ export declare interface MessagingContextType {
|
|
|
383
428
|
cartUpdating: boolean;
|
|
384
429
|
error: string | null;
|
|
385
430
|
sendError: SendError | null;
|
|
386
|
-
/**
|
|
387
|
-
* True when an idle session expired in the background and its restart was
|
|
388
|
-
* deferred until the user interacts. The composer stays enabled in this
|
|
389
|
-
* state so the next message can trigger a fresh session.
|
|
390
|
-
*/
|
|
391
431
|
sessionExpired: boolean;
|
|
392
432
|
sendMessage: SendMessage;
|
|
393
433
|
addToCart: (params: AddToCartParams) => void;
|
|
394
434
|
resetConversation: () => void;
|
|
395
435
|
retryLastMessage: () => ReturnType<SendMessage> | undefined;
|
|
396
436
|
retryConnection: () => void;
|
|
397
|
-
/**
|
|
398
|
-
* Download the current conversation's transcript as a PDF. Resolves once the
|
|
399
|
-
* browser download has been triggered; rejects if no conversation is active
|
|
400
|
-
* or the request fails.
|
|
401
|
-
*/
|
|
402
437
|
downloadTranscript: () => Promise<void>;
|
|
403
438
|
}
|
|
404
439
|
|
|
@@ -433,7 +468,6 @@ export declare interface MessagingMessage {
|
|
|
433
468
|
role: string;
|
|
434
469
|
name?: string;
|
|
435
470
|
};
|
|
436
|
-
/** The raw event data for advanced consumers */
|
|
437
471
|
raw?: AgentforceMessageEvent;
|
|
438
472
|
}
|
|
439
473
|
|
|
@@ -706,6 +740,10 @@ declare interface OverrideSendMessageOptions {
|
|
|
706
740
|
*/
|
|
707
741
|
export declare type OverrideTagName = string;
|
|
708
742
|
|
|
743
|
+
declare type PdpEntryParams = ProductView & {
|
|
744
|
+
productName?: string;
|
|
745
|
+
};
|
|
746
|
+
|
|
709
747
|
declare type PriceBreakdown = {
|
|
710
748
|
original?: PriceBucket | null;
|
|
711
749
|
sales?: PriceBucket | null;
|
|
@@ -856,8 +894,27 @@ declare type PromptsExtensionState = {
|
|
|
856
894
|
|
|
857
895
|
declare type PromptsParams = AskCimSuggestions | CopilotSearchSuggestions | CopilotBrowseSuggestions | ProductViewSuggestions;
|
|
858
896
|
|
|
897
|
+
declare type RangeFilters = Array<{
|
|
898
|
+
field: string;
|
|
899
|
+
min: number;
|
|
900
|
+
max: number;
|
|
901
|
+
}>;
|
|
902
|
+
|
|
859
903
|
declare type ResponseItem = MarkdownResponse | ProductCarouselResponse | ProductTileResponse | ProductComparisonResponse | SuggestionsResponse | CartResponse | OrderConfirmationResponse | ToolResultsResponse;
|
|
860
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
|
+
|
|
861
918
|
/**
|
|
862
919
|
* A retryable message-send failure: the connection is live but the send itself
|
|
863
920
|
* failed (5xx / network / timeout, not a session expiry). Holds what's needed
|
|
@@ -876,6 +933,7 @@ export declare type SendMessage = (text: string, options?: SendMessageOptions) =
|
|
|
876
933
|
export declare interface SendMessageOptions {
|
|
877
934
|
silent?: boolean;
|
|
878
935
|
reconcileMessageId?: string;
|
|
936
|
+
displayContent?: string;
|
|
879
937
|
}
|
|
880
938
|
|
|
881
939
|
export declare type SendMessageResult = {
|