@deepdesk/deepdesk-sdk 19.6.2-beta.2 → 19.6.2-beta.20
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/index.cjs.js +11 -9
- package/dist/index.d.mts +252 -26
- package/dist/index.d.ts +252 -26
- package/dist/index.esm.js +11 -9
- package/dist/index.iife.js +40 -37
- package/input.css +1 -1
- package/package.json +1 -1
- package/styles/index.js +1 -1
- package/styles.css +1 -1
- package/widget.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -406,7 +406,20 @@ declare enum FetchState {
|
|
|
406
406
|
ERROR = "error"
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
type State$a = {
|
|
410
|
+
data: Profile | null;
|
|
411
|
+
fetchState: FetchState;
|
|
412
|
+
/** Bumped on reset/clear so in-flight getProfile cannot repopulate profile. */
|
|
413
|
+
generation: number;
|
|
414
|
+
inFlightRequestId: string | null;
|
|
415
|
+
/**
|
|
416
|
+
* Runtime-only UI override used by widget wrappers (e.g. to hide/show certain widget blocks
|
|
417
|
+
* via config.allowedWidgetTypes). Must not participate in async getProfile lifecycle.
|
|
418
|
+
*/
|
|
419
|
+
widgetTypesOverride: Profile['uiConfig']['widget']['types'] | null;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
interface State$9 {
|
|
410
423
|
current: Conversation | null;
|
|
411
424
|
isSupported: boolean | null;
|
|
412
425
|
}
|
|
@@ -447,10 +460,28 @@ type AssistantInteraction = {
|
|
|
447
460
|
};
|
|
448
461
|
evaluationId: string;
|
|
449
462
|
};
|
|
450
|
-
type State$
|
|
463
|
+
type State$8 = {
|
|
451
464
|
cues: Cue[];
|
|
452
465
|
threads: Record<number, AssistantInteraction[]>;
|
|
453
466
|
pending: string[];
|
|
467
|
+
widgetAssistantSessionId: string | null;
|
|
468
|
+
assistantThreads: Record<string, {
|
|
469
|
+
threadId: number;
|
|
470
|
+
}>;
|
|
471
|
+
activeAssistantCode: string | null;
|
|
472
|
+
nextLocalThreadId: number;
|
|
473
|
+
/** Evaluation ids suppressed after {@link clearDisplayedAnswers} so late chunks do not repopulate UI. */
|
|
474
|
+
suppressedEvaluationIds: string[];
|
|
475
|
+
/**
|
|
476
|
+
* Silent parent cues (`evaluationId` + assistant code) that must not be recreated by a later
|
|
477
|
+
* websocket event. Child codes for the same evaluation stay allowed.
|
|
478
|
+
*/
|
|
479
|
+
suppressedSilentParentKeys: string[];
|
|
480
|
+
/** Bumped on {@link clearDisplayedAnswers} so in-flight evaluateAssistant results are dropped. */
|
|
481
|
+
assistantDisplayGeneration: number;
|
|
482
|
+
pendingEvaluationGenerations: Record<string, number>;
|
|
483
|
+
pendingEvaluationAssistantCodes: Record<string, string>;
|
|
484
|
+
evaluationIdDisplayGeneration: Record<string, number>;
|
|
454
485
|
};
|
|
455
486
|
type Transcript = Array<{
|
|
456
487
|
source: string;
|
|
@@ -467,8 +498,17 @@ interface EvaluateInput {
|
|
|
467
498
|
includeMetadata?: boolean;
|
|
468
499
|
externalConversationId?: string;
|
|
469
500
|
skipState?: boolean;
|
|
501
|
+
silent?: boolean;
|
|
470
502
|
}
|
|
471
503
|
|
|
504
|
+
type QueueMicrotaskErrorEventData = {
|
|
505
|
+
message: string;
|
|
506
|
+
stack: string | null;
|
|
507
|
+
typeofQueueMicrotask: string;
|
|
508
|
+
typeofWindowQueueMicrotask: string;
|
|
509
|
+
typeofGlobalThisQueueMicrotask: string;
|
|
510
|
+
};
|
|
511
|
+
|
|
472
512
|
type Fetch = typeof window.fetch;
|
|
473
513
|
type HTTPClientOptions = {
|
|
474
514
|
fetch?: typeof window.fetch;
|
|
@@ -720,6 +760,8 @@ declare namespace Server {
|
|
|
720
760
|
type EvaluationResponse = {
|
|
721
761
|
evaluation_id: string;
|
|
722
762
|
evaluation_status: EvaluationStatus;
|
|
763
|
+
session_id?: string;
|
|
764
|
+
is_silent?: boolean;
|
|
723
765
|
output: EvaluationOutput | KAAnswer | string;
|
|
724
766
|
};
|
|
725
767
|
type EvaluationOutput = Array<{
|
|
@@ -869,6 +911,12 @@ declare namespace Server {
|
|
|
869
911
|
*/
|
|
870
912
|
knowledge_assistant: string | null;
|
|
871
913
|
knowledge_assistant_new: string | null;
|
|
914
|
+
widget_interactive_assistants: Array<{
|
|
915
|
+
code: string;
|
|
916
|
+
name: string;
|
|
917
|
+
display_name: string | null;
|
|
918
|
+
order: number;
|
|
919
|
+
}>;
|
|
872
920
|
on_demand_assistants: Array<OnDemandAssistant>;
|
|
873
921
|
active_config: {
|
|
874
922
|
default_locale: string;
|
|
@@ -900,6 +948,7 @@ declare namespace Server {
|
|
|
900
948
|
assistant_name: string;
|
|
901
949
|
display_name?: string;
|
|
902
950
|
is_pinned: boolean;
|
|
951
|
+
is_silent?: boolean;
|
|
903
952
|
};
|
|
904
953
|
type ChatHistory = {
|
|
905
954
|
question: string;
|
|
@@ -1085,6 +1134,7 @@ type SendEventArgumentMap = {
|
|
|
1085
1134
|
'trigger on demand assistant': Event$1<{
|
|
1086
1135
|
assistantCode: string;
|
|
1087
1136
|
}>;
|
|
1137
|
+
'queueMicrotask error': Event$1<QueueMicrotaskErrorEventData>;
|
|
1088
1138
|
};
|
|
1089
1139
|
/**
|
|
1090
1140
|
* Request retry options
|
|
@@ -1177,6 +1227,10 @@ declare class DeepdeskAPI {
|
|
|
1177
1227
|
* Request autocomplete suggestions based on the agent text input
|
|
1178
1228
|
*/
|
|
1179
1229
|
getAutocompleteSuggestions(conversationId: string, params: CamelCaseKeys<Server.GetAutocompleteSuggestionsParams>): Promise<TextSuggestion[]>;
|
|
1230
|
+
/**
|
|
1231
|
+
* Replace in-engine personal collection for the agent with items scoped to the conversation profile.
|
|
1232
|
+
*/
|
|
1233
|
+
syncPersonalCollection(conversationId: string | number): Promise<void>;
|
|
1180
1234
|
/**
|
|
1181
1235
|
* Request pinned messages
|
|
1182
1236
|
*/
|
|
@@ -1223,11 +1277,31 @@ declare class DeepdeskAPI {
|
|
|
1223
1277
|
externalConversationId?: string;
|
|
1224
1278
|
attachments?: EvaluationAttachment[];
|
|
1225
1279
|
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1280
|
+
interactWithAssistant(init: {
|
|
1281
|
+
assistantCode: string;
|
|
1282
|
+
message: string;
|
|
1283
|
+
sessionId?: string;
|
|
1284
|
+
externalConversationId?: string;
|
|
1285
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Clears the conversation of one assistant in a session, so the next `interactWithAssistant`
|
|
1288
|
+
* call starts fresh. Other assistants in the same session keep their conversation.
|
|
1289
|
+
*/
|
|
1290
|
+
resetAssistantThread(init: {
|
|
1291
|
+
assistantCode: string;
|
|
1292
|
+
sessionId: string;
|
|
1293
|
+
}): Promise<void>;
|
|
1294
|
+
/**
|
|
1295
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1296
|
+
*/
|
|
1226
1297
|
createAssistantThread(init: {
|
|
1227
1298
|
assistantCode: string;
|
|
1228
1299
|
}): Promise<{
|
|
1229
1300
|
id: number;
|
|
1230
1301
|
}>;
|
|
1302
|
+
/**
|
|
1303
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1304
|
+
*/
|
|
1231
1305
|
postMessageToAssistantThread(init: {
|
|
1232
1306
|
assistantCode: string;
|
|
1233
1307
|
threadId: number;
|
|
@@ -1240,16 +1314,11 @@ declare class DeepdeskAPI {
|
|
|
1240
1314
|
}
|
|
1241
1315
|
|
|
1242
1316
|
type StyleSuggestion = CamelCaseKeys<Server.StyleSuggestion>;
|
|
1243
|
-
interface State$
|
|
1317
|
+
interface State$7 {
|
|
1244
1318
|
list: StyleSuggestion;
|
|
1245
1319
|
fetchState: FetchState;
|
|
1246
1320
|
}
|
|
1247
1321
|
|
|
1248
|
-
type State$7 = {
|
|
1249
|
-
data: Profile | null;
|
|
1250
|
-
fetchState: FetchState;
|
|
1251
|
-
};
|
|
1252
|
-
|
|
1253
1322
|
/**
|
|
1254
1323
|
* A selection range representation for textarea's and contenteditables only using offsets.
|
|
1255
1324
|
*/
|
|
@@ -1419,9 +1488,9 @@ interface StoreConfig {
|
|
|
1419
1488
|
preloadedState?: any;
|
|
1420
1489
|
}
|
|
1421
1490
|
declare const reducers: redux.Reducer<{
|
|
1422
|
-
assistants: State$
|
|
1491
|
+
assistants: State$8;
|
|
1423
1492
|
auth: State$2;
|
|
1424
|
-
conversation: State$
|
|
1493
|
+
conversation: State$9;
|
|
1425
1494
|
contentTypes: State$3;
|
|
1426
1495
|
passwordlessToken: State$4;
|
|
1427
1496
|
entities: State$1;
|
|
@@ -1473,9 +1542,9 @@ declare const reducers: redux.Reducer<{
|
|
|
1473
1542
|
enableFeedbackForm: boolean;
|
|
1474
1543
|
hasKeyboardInput: boolean;
|
|
1475
1544
|
};
|
|
1476
|
-
profile: State$
|
|
1545
|
+
profile: State$a;
|
|
1477
1546
|
search: State$b;
|
|
1478
|
-
styleSuggestions: State$
|
|
1547
|
+
styleSuggestions: State$7;
|
|
1479
1548
|
ui: {
|
|
1480
1549
|
showTabHint: boolean;
|
|
1481
1550
|
inputHasFocus: boolean;
|
|
@@ -1485,9 +1554,9 @@ declare const reducers: redux.Reducer<{
|
|
|
1485
1554
|
};
|
|
1486
1555
|
textSuggestions: TextSuggestionState;
|
|
1487
1556
|
}, redux.UnknownAction, Partial<{
|
|
1488
|
-
assistants: State$
|
|
1557
|
+
assistants: State$8 | undefined;
|
|
1489
1558
|
auth: State$2 | undefined;
|
|
1490
|
-
conversation: State$
|
|
1559
|
+
conversation: State$9 | undefined;
|
|
1491
1560
|
contentTypes: State$3 | undefined;
|
|
1492
1561
|
passwordlessToken: State$4 | undefined;
|
|
1493
1562
|
entities: State$1 | undefined;
|
|
@@ -1539,9 +1608,9 @@ declare const reducers: redux.Reducer<{
|
|
|
1539
1608
|
enableFeedbackForm: boolean;
|
|
1540
1609
|
hasKeyboardInput: boolean;
|
|
1541
1610
|
} | undefined;
|
|
1542
|
-
profile: State$
|
|
1611
|
+
profile: State$a | undefined;
|
|
1543
1612
|
search: State$b | undefined;
|
|
1544
|
-
styleSuggestions: State$
|
|
1613
|
+
styleSuggestions: State$7 | undefined;
|
|
1545
1614
|
ui: {
|
|
1546
1615
|
showTabHint: boolean;
|
|
1547
1616
|
inputHasFocus: boolean;
|
|
@@ -1552,9 +1621,9 @@ declare const reducers: redux.Reducer<{
|
|
|
1552
1621
|
textSuggestions: TextSuggestionState | undefined;
|
|
1553
1622
|
}>>;
|
|
1554
1623
|
declare function createStore(config: StoreConfig): _reduxjs_toolkit.EnhancedStore<{
|
|
1555
|
-
assistants: State$
|
|
1624
|
+
assistants: State$8;
|
|
1556
1625
|
auth: State$2;
|
|
1557
|
-
conversation: State$
|
|
1626
|
+
conversation: State$9;
|
|
1558
1627
|
contentTypes: State$3;
|
|
1559
1628
|
passwordlessToken: State$4;
|
|
1560
1629
|
entities: State$1;
|
|
@@ -1606,9 +1675,9 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit.EnhancedStor
|
|
|
1606
1675
|
enableFeedbackForm: boolean;
|
|
1607
1676
|
hasKeyboardInput: boolean;
|
|
1608
1677
|
};
|
|
1609
|
-
profile: State$
|
|
1678
|
+
profile: State$a;
|
|
1610
1679
|
search: State$b;
|
|
1611
|
-
styleSuggestions: State$
|
|
1680
|
+
styleSuggestions: State$7;
|
|
1612
1681
|
ui: {
|
|
1613
1682
|
showTabHint: boolean;
|
|
1614
1683
|
inputHasFocus: boolean;
|
|
@@ -1875,6 +1944,9 @@ type TextSuggestionStyles = typeof styles$3;
|
|
|
1875
1944
|
declare const styles$2: {
|
|
1876
1945
|
readonly "footer": string;
|
|
1877
1946
|
readonly "footerShortcut": string;
|
|
1947
|
+
readonly "interactiveAssistantTab": string;
|
|
1948
|
+
readonly "interactiveAssistantTabActive": string;
|
|
1949
|
+
readonly "interactiveAssistantTabs": string;
|
|
1878
1950
|
readonly "link": string;
|
|
1879
1951
|
readonly "loginText": string;
|
|
1880
1952
|
readonly "root": string;
|
|
@@ -2007,6 +2079,7 @@ type State = {
|
|
|
2007
2079
|
showTextSuggestions: boolean;
|
|
2008
2080
|
showEntitiesCommand: boolean;
|
|
2009
2081
|
showSummaryCommand: boolean;
|
|
2082
|
+
/** @deprecated Use the knowledge-assist widget block; still synced from profile for legacy consumers. */
|
|
2010
2083
|
showKnowledgeSearch: boolean;
|
|
2011
2084
|
textSuggestionsCount: number;
|
|
2012
2085
|
recommendTextSuggestions: boolean;
|
|
@@ -2106,6 +2179,20 @@ interface KnowledgeAssistOptions {
|
|
|
2106
2179
|
};
|
|
2107
2180
|
}
|
|
2108
2181
|
type OpenAdminFeedbackHandler = (feedbackPath: string) => void | Promise<void>;
|
|
2182
|
+
/**
|
|
2183
|
+
* Options for {@link DeepdeskSDK.reloadConversationContext}.
|
|
2184
|
+
*/
|
|
2185
|
+
type ReloadConversationContextOptions = {
|
|
2186
|
+
/** Conversation payload from the host (same shape as {@link DeepdeskSDK.upsertConversation}). */
|
|
2187
|
+
conversation: CreateConversation;
|
|
2188
|
+
/** Optional visitor fields to apply when refreshing metadata on the same session. */
|
|
2189
|
+
visitorInfo?: Partial<VisitorInfo>;
|
|
2190
|
+
/**
|
|
2191
|
+
* When `true`, clears on-screen assistant output after upsert (typical same-conversation refresh).
|
|
2192
|
+
* Visitor info is applied after upsert (and after the UI clear when requested).
|
|
2193
|
+
*/
|
|
2194
|
+
clearDisplayedUi?: boolean;
|
|
2195
|
+
};
|
|
2109
2196
|
interface WidgetOptions {
|
|
2110
2197
|
customStyles?: WidgetCustomStyles;
|
|
2111
2198
|
showImages?: boolean;
|
|
@@ -2142,6 +2229,12 @@ declare class DeepdeskSDK {
|
|
|
2142
2229
|
private floatingMenu;
|
|
2143
2230
|
private widgetElement;
|
|
2144
2231
|
private widgetRoot;
|
|
2232
|
+
/** Shared DialogOverlays root (SearchOverlay / CMD+K). Owned by mount and/or renderWidget. */
|
|
2233
|
+
private dialogOverlays;
|
|
2234
|
+
/** First `customStyles` passed to {@link ensureDialogOverlays} wins for the shared root. */
|
|
2235
|
+
private dialogOverlaysCustomStyles;
|
|
2236
|
+
/** OR of includeLoginOverlay across ensureDialogOverlays callers (mount can upgrade widget-only). */
|
|
2237
|
+
private dialogOverlaysIncludeLogin;
|
|
2145
2238
|
private nicknameDialogUnsubscribe;
|
|
2146
2239
|
private nicknameDialogFailed;
|
|
2147
2240
|
private dynamicThunkObject;
|
|
@@ -2184,9 +2277,9 @@ declare class DeepdeskSDK {
|
|
|
2184
2277
|
*/
|
|
2185
2278
|
constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, websocketClient, }: SDKOptions);
|
|
2186
2279
|
get state(): {
|
|
2187
|
-
assistants: State$
|
|
2280
|
+
assistants: State$8;
|
|
2188
2281
|
auth: State$2;
|
|
2189
|
-
conversation: State$
|
|
2282
|
+
conversation: State$9;
|
|
2190
2283
|
contentTypes: State$3;
|
|
2191
2284
|
passwordlessToken: State$4;
|
|
2192
2285
|
entities: State$1;
|
|
@@ -2238,9 +2331,9 @@ declare class DeepdeskSDK {
|
|
|
2238
2331
|
enableFeedbackForm: boolean;
|
|
2239
2332
|
hasKeyboardInput: boolean;
|
|
2240
2333
|
};
|
|
2241
|
-
profile: State$
|
|
2334
|
+
profile: State$a;
|
|
2242
2335
|
search: State$b;
|
|
2243
|
-
styleSuggestions: State$
|
|
2336
|
+
styleSuggestions: State$7;
|
|
2244
2337
|
ui: {
|
|
2245
2338
|
showTabHint: boolean;
|
|
2246
2339
|
inputHasFocus: boolean;
|
|
@@ -2641,6 +2734,106 @@ declare class DeepdeskSDK {
|
|
|
2641
2734
|
* ```
|
|
2642
2735
|
*/
|
|
2643
2736
|
resetConversation(): void;
|
|
2737
|
+
/**
|
|
2738
|
+
* Clears on-screen assistant answers and related suggestion UI for the loaded
|
|
2739
|
+
* conversation without unloading it from the store.
|
|
2740
|
+
*
|
|
2741
|
+
* **Preserved:** `conversation.current` (including `id`, `externalId`, and `metadata`),
|
|
2742
|
+
* visitor info, profile configuration, and active handling-time tracking.
|
|
2743
|
+
*
|
|
2744
|
+
* **Reset:** assistant panels, text/style/search/pinned suggestions, entities, and input
|
|
2745
|
+
* fields tied to displayed answers (same slices as after {@link resetConversation}, except
|
|
2746
|
+
* `conversation.current` and handling-time state stay set).
|
|
2747
|
+
*
|
|
2748
|
+
* Does not re-fetch CRM data or post transcript messages. For a host-driven refresh,
|
|
2749
|
+
* use {@link reloadConversationContext} with `clearDisplayedUi: true` and then
|
|
2750
|
+
* {@link publishConversationTranscript}.
|
|
2751
|
+
*
|
|
2752
|
+
* **Integrators:** do not dispatch private store actions (for example
|
|
2753
|
+
* `conversation/upsert/fulfilled`) to simulate a refresh; use the public methods above.
|
|
2754
|
+
*
|
|
2755
|
+
* No-op when no conversation is loaded.
|
|
2756
|
+
*
|
|
2757
|
+
* @example
|
|
2758
|
+
* ```typescript
|
|
2759
|
+
* // Same session, only wipe stale suggestions before reposting messages
|
|
2760
|
+
* sdk.clearDisplayedAnswers();
|
|
2761
|
+
* await sdk.publishConversationTranscript(messagesFromCrm);
|
|
2762
|
+
* ```
|
|
2763
|
+
*/
|
|
2764
|
+
clearDisplayedAnswers(): void;
|
|
2765
|
+
/**
|
|
2766
|
+
* Applies host-fetched conversation metadata to the current SDK session.
|
|
2767
|
+
*
|
|
2768
|
+
* Upserts via {@link upsertConversation} and optionally clears on-screen assistant UI.
|
|
2769
|
+
* The host must fetch CRM (or other) data itself; this method does not load emails or
|
|
2770
|
+
* transcript text. Call {@link publishConversationTranscript} afterward to push messages
|
|
2771
|
+
* and refresh the conversation query.
|
|
2772
|
+
*
|
|
2773
|
+
* When `clearDisplayedUi` is `true`, {@link clearDisplayedAnswers} runs after the upsert.
|
|
2774
|
+
* If `visitorInfo` is provided, it is applied after the upsert (and after the UI clear when
|
|
2775
|
+
* requested). {@link clearDisplayedAnswers} does not clear visitor info; apply visitor info
|
|
2776
|
+
* after upsert so it is not lost when upsert switches or resets conversation state.
|
|
2777
|
+
*
|
|
2778
|
+
* When switching to a different conversation, prefer {@link resetConversation} first,
|
|
2779
|
+
* then load or upsert the new conversation.
|
|
2780
|
+
*
|
|
2781
|
+
* @param options - Host conversation payload and optional visitor / UI flags.
|
|
2782
|
+
* @param options.conversation - Metadata to upsert (external id, platform, metadata, etc.).
|
|
2783
|
+
* @param options.visitorInfo - Visitor fields to merge when refreshing the same session.
|
|
2784
|
+
* @param options.clearDisplayedUi - Clear assistant/suggestion UI after upsert (default `false`).
|
|
2785
|
+
*
|
|
2786
|
+
* @example
|
|
2787
|
+
* ```typescript
|
|
2788
|
+
* const conversation = await fetchConversationFromCrm(caseId);
|
|
2789
|
+
* const messages = await fetchEmailsFromCrm(caseId);
|
|
2790
|
+
*
|
|
2791
|
+
* await sdk.reloadConversationContext({
|
|
2792
|
+
* conversation,
|
|
2793
|
+
* visitorInfo: { visitorId: contactId, visitorName: contactName },
|
|
2794
|
+
* clearDisplayedUi: true,
|
|
2795
|
+
* });
|
|
2796
|
+
*
|
|
2797
|
+
* // Optional: host-only widget state (assistant input, etc.)
|
|
2798
|
+
* updateWidgetAssistantInput(...);
|
|
2799
|
+
*
|
|
2800
|
+
* await sdk.publishConversationTranscript(messages);
|
|
2801
|
+
* ```
|
|
2802
|
+
*/
|
|
2803
|
+
reloadConversationContext({ conversation, visitorInfo, clearDisplayedUi, }: ReloadConversationContextOptions): Promise<void>;
|
|
2804
|
+
/**
|
|
2805
|
+
* Publishes a host-built transcript for the current conversation.
|
|
2806
|
+
*
|
|
2807
|
+
* Sets the dynamic conversation query to the given messages and, when the array is
|
|
2808
|
+
* non-empty, posts them through {@link postMessages}. Use after
|
|
2809
|
+
* {@link reloadConversationContext} when the host already fetched the latest thread
|
|
2810
|
+
* from an external system.
|
|
2811
|
+
*
|
|
2812
|
+
* @param messages - Transcript lines (`source`, `text`, and other {@link ConversationMessage} fields).
|
|
2813
|
+
*
|
|
2814
|
+
* @example
|
|
2815
|
+
* ```typescript
|
|
2816
|
+
* await sdk.publishConversationTranscript([
|
|
2817
|
+
* {
|
|
2818
|
+
* externalId: 'msg-1',
|
|
2819
|
+
* time: '2024-01-01T12:00:00Z',
|
|
2820
|
+
* source: 'visitor',
|
|
2821
|
+
* authorId: 'visitor-1',
|
|
2822
|
+
* text: 'Hello',
|
|
2823
|
+
* metadata: null,
|
|
2824
|
+
* },
|
|
2825
|
+
* {
|
|
2826
|
+
* externalId: 'msg-2',
|
|
2827
|
+
* time: '2024-01-01T12:01:00Z',
|
|
2828
|
+
* source: 'agent',
|
|
2829
|
+
* authorId: 'agent-1',
|
|
2830
|
+
* text: 'Hi, how can I help?',
|
|
2831
|
+
* metadata: null,
|
|
2832
|
+
* },
|
|
2833
|
+
* ]);
|
|
2834
|
+
* ```
|
|
2835
|
+
*/
|
|
2836
|
+
publishConversationTranscript(messages: ConversationMessage[]): Promise<void>;
|
|
2644
2837
|
/**
|
|
2645
2838
|
* Updates SDK configuration settings.
|
|
2646
2839
|
*
|
|
@@ -2663,7 +2856,8 @@ declare class DeepdeskSDK {
|
|
|
2663
2856
|
* @param settings.showTextSuggestions: Show text suggestions (default: true)
|
|
2664
2857
|
* @param settings.showEntitiesCommand: Show entities command (default: false)
|
|
2665
2858
|
* @param settings.showSummaryCommand: Show summary command (default: false)
|
|
2666
|
-
* @param settings.showKnowledgeSearch:
|
|
2859
|
+
* @param settings.showKnowledgeSearch: @deprecated Use the knowledge-assist widget block instead.
|
|
2860
|
+
* Still accepted for backward compatibility; profile load overwrites this from {@link deriveShowKnowledgeSearch}.
|
|
2667
2861
|
* @param settings.textSuggestionsCount: Number of text suggestions to show (default: 3)
|
|
2668
2862
|
* @param settings.recommendTextSuggestions: Recommend text suggestions (default: true)
|
|
2669
2863
|
* @param settings.searchTriggerKey: Key to trigger search (default: 'k')
|
|
@@ -3336,6 +3530,17 @@ declare class DeepdeskSDK {
|
|
|
3336
3530
|
private renderInlineSuggestions;
|
|
3337
3531
|
private renderAboveOrBelowSuggestions;
|
|
3338
3532
|
private renderFloatingMenu;
|
|
3533
|
+
/**
|
|
3534
|
+
* Mount DialogOverlays (SearchOverlay / CMD+K) once per SDK instance.
|
|
3535
|
+
* Used by both {@link mount} and {@link renderWidget} so iframe-only widgets
|
|
3536
|
+
* (Content Guru, Dimelo) get search without attaching to a host input.
|
|
3537
|
+
*
|
|
3538
|
+
* `customStyles`: first caller wins (later `mount` / `renderWidget` styles are ignored).
|
|
3539
|
+
* `includeLoginOverlay`: OR'd across callers — `mount` can upgrade a widget-only root
|
|
3540
|
+
* by re-rendering into the **existing** React root (preserves SearchOverlay local state).
|
|
3541
|
+
*/
|
|
3542
|
+
private ensureDialogOverlays;
|
|
3543
|
+
private disposeDialogOverlays;
|
|
3339
3544
|
private renderOverlays;
|
|
3340
3545
|
/**
|
|
3341
3546
|
* Renders the Deepdesk widget in a container element.
|
|
@@ -3347,6 +3552,11 @@ declare class DeepdeskSDK {
|
|
|
3347
3552
|
* **Important:** Make sure to set the container element to a fixed or minimum size
|
|
3348
3553
|
* (height and width) as the widget will grow to fill the container.
|
|
3349
3554
|
*
|
|
3555
|
+
* Also mounts dialog overlays (search command palette / CMD+K) so iframe-only
|
|
3556
|
+
* integrations that never call {@link mount} still get search. Shared with `mount()` —
|
|
3557
|
+
* only one overlays root exists per SDK instance. Does **not** mount `LoginOverlay`
|
|
3558
|
+
* (iframe apps use their own sign-in); `mount()` still can.
|
|
3559
|
+
*
|
|
3350
3560
|
* **Note:** Only one widget can be rendered per SDK instance.
|
|
3351
3561
|
*
|
|
3352
3562
|
* @param containerElement - Element to render widget in
|
|
@@ -3458,6 +3668,22 @@ declare class DeepdeskSDK {
|
|
|
3458
3668
|
private setupHandlingTime;
|
|
3459
3669
|
private handleError;
|
|
3460
3670
|
private loadProfileConfigPromise;
|
|
3671
|
+
private loadProfileConfigPromiseKey;
|
|
3672
|
+
private personalCollectionSyncPendingKey;
|
|
3673
|
+
private personalCollectionSyncDrainPromise;
|
|
3674
|
+
/**
|
|
3675
|
+
* Subscription/dedupe key for conversation + profile. Admin validates profile codes as
|
|
3676
|
+
* `[a-z0-9-]+` (no colon), so the last `:` separates conversation id from profileCode
|
|
3677
|
+
* even when the id contains `:`.
|
|
3678
|
+
*/
|
|
3679
|
+
private getConversationProfileKey;
|
|
3680
|
+
private getProfileLoadKey;
|
|
3681
|
+
private isCurrentProfileLoadKey;
|
|
3682
|
+
private getConversationLoadedKey;
|
|
3683
|
+
private resetProfileDerivedSettings;
|
|
3684
|
+
private syncPersonalCollectionForConversation;
|
|
3685
|
+
private ensurePersonalCollectionSyncDrain;
|
|
3686
|
+
private drainPersonalCollectionSync;
|
|
3461
3687
|
private loadProfileConfig;
|
|
3462
3688
|
/**
|
|
3463
3689
|
* Authenticates user via popup window.
|
|
@@ -3656,4 +3882,4 @@ declare function logEvent<T extends keyof SendEventArgumentMap>(event: LogEvent<
|
|
|
3656
3882
|
type CSSModule = Record<string, string>;
|
|
3657
3883
|
declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
|
|
3658
3884
|
|
|
3659
|
-
export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
|
|
3885
|
+
export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type ReloadConversationContextOptions, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
|