@deepdesk/deepdesk-sdk 19.6.2-beta.0 → 19.6.2-beta.10
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 +9 -9
- package/dist/index.d.mts +93 -1
- package/dist/index.d.ts +93 -1
- package/dist/index.esm.js +9 -9
- package/dist/index.iife.js +39 -38
- 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
|
@@ -451,6 +451,12 @@ type State$9 = {
|
|
|
451
451
|
cues: Cue[];
|
|
452
452
|
threads: Record<number, AssistantInteraction[]>;
|
|
453
453
|
pending: string[];
|
|
454
|
+
widgetAssistantSessionId: string | null;
|
|
455
|
+
assistantThreads: Record<string, {
|
|
456
|
+
threadId: number;
|
|
457
|
+
}>;
|
|
458
|
+
activeAssistantCode: string | null;
|
|
459
|
+
nextLocalThreadId: number;
|
|
454
460
|
};
|
|
455
461
|
type Transcript = Array<{
|
|
456
462
|
source: string;
|
|
@@ -469,6 +475,14 @@ interface EvaluateInput {
|
|
|
469
475
|
skipState?: boolean;
|
|
470
476
|
}
|
|
471
477
|
|
|
478
|
+
type QueueMicrotaskErrorEventData = {
|
|
479
|
+
message: string;
|
|
480
|
+
stack: string | null;
|
|
481
|
+
typeofQueueMicrotask: string;
|
|
482
|
+
typeofWindowQueueMicrotask: string;
|
|
483
|
+
typeofGlobalThisQueueMicrotask: string;
|
|
484
|
+
};
|
|
485
|
+
|
|
472
486
|
type Fetch = typeof window.fetch;
|
|
473
487
|
type HTTPClientOptions = {
|
|
474
488
|
fetch?: typeof window.fetch;
|
|
@@ -720,6 +734,7 @@ declare namespace Server {
|
|
|
720
734
|
type EvaluationResponse = {
|
|
721
735
|
evaluation_id: string;
|
|
722
736
|
evaluation_status: EvaluationStatus;
|
|
737
|
+
session_id?: string;
|
|
723
738
|
output: EvaluationOutput | KAAnswer | string;
|
|
724
739
|
};
|
|
725
740
|
type EvaluationOutput = Array<{
|
|
@@ -869,6 +884,12 @@ declare namespace Server {
|
|
|
869
884
|
*/
|
|
870
885
|
knowledge_assistant: string | null;
|
|
871
886
|
knowledge_assistant_new: string | null;
|
|
887
|
+
widget_interactive_assistants: Array<{
|
|
888
|
+
code: string;
|
|
889
|
+
name: string;
|
|
890
|
+
display_name: string | null;
|
|
891
|
+
order: number;
|
|
892
|
+
}>;
|
|
872
893
|
on_demand_assistants: Array<OnDemandAssistant>;
|
|
873
894
|
active_config: {
|
|
874
895
|
default_locale: string;
|
|
@@ -1085,6 +1106,7 @@ type SendEventArgumentMap = {
|
|
|
1085
1106
|
'trigger on demand assistant': Event$1<{
|
|
1086
1107
|
assistantCode: string;
|
|
1087
1108
|
}>;
|
|
1109
|
+
'queueMicrotask error': Event$1<QueueMicrotaskErrorEventData>;
|
|
1088
1110
|
};
|
|
1089
1111
|
/**
|
|
1090
1112
|
* Request retry options
|
|
@@ -1177,6 +1199,10 @@ declare class DeepdeskAPI {
|
|
|
1177
1199
|
* Request autocomplete suggestions based on the agent text input
|
|
1178
1200
|
*/
|
|
1179
1201
|
getAutocompleteSuggestions(conversationId: string, params: CamelCaseKeys<Server.GetAutocompleteSuggestionsParams>): Promise<TextSuggestion[]>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Replace in-engine personal collection for the agent with items scoped to the conversation profile.
|
|
1204
|
+
*/
|
|
1205
|
+
syncPersonalCollection(conversationId: string | number): Promise<void>;
|
|
1180
1206
|
/**
|
|
1181
1207
|
* Request pinned messages
|
|
1182
1208
|
*/
|
|
@@ -1223,11 +1249,31 @@ declare class DeepdeskAPI {
|
|
|
1223
1249
|
externalConversationId?: string;
|
|
1224
1250
|
attachments?: EvaluationAttachment[];
|
|
1225
1251
|
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1252
|
+
interactWithAssistant(init: {
|
|
1253
|
+
assistantCode: string;
|
|
1254
|
+
message: string;
|
|
1255
|
+
sessionId?: string;
|
|
1256
|
+
externalConversationId?: string;
|
|
1257
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Clears the conversation of one assistant in a session, so the next `interactWithAssistant`
|
|
1260
|
+
* call starts fresh. Other assistants in the same session keep their conversation.
|
|
1261
|
+
*/
|
|
1262
|
+
resetAssistantThread(init: {
|
|
1263
|
+
assistantCode: string;
|
|
1264
|
+
sessionId: string;
|
|
1265
|
+
}): Promise<void>;
|
|
1266
|
+
/**
|
|
1267
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1268
|
+
*/
|
|
1226
1269
|
createAssistantThread(init: {
|
|
1227
1270
|
assistantCode: string;
|
|
1228
1271
|
}): Promise<{
|
|
1229
1272
|
id: number;
|
|
1230
1273
|
}>;
|
|
1274
|
+
/**
|
|
1275
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1276
|
+
*/
|
|
1231
1277
|
postMessageToAssistantThread(init: {
|
|
1232
1278
|
assistantCode: string;
|
|
1233
1279
|
threadId: number;
|
|
@@ -1248,6 +1294,9 @@ interface State$8 {
|
|
|
1248
1294
|
type State$7 = {
|
|
1249
1295
|
data: Profile | null;
|
|
1250
1296
|
fetchState: FetchState;
|
|
1297
|
+
/** Bumped on reset/clear so in-flight getProfile cannot repopulate profile. */
|
|
1298
|
+
generation: number;
|
|
1299
|
+
inFlightRequestId: string | null;
|
|
1251
1300
|
};
|
|
1252
1301
|
|
|
1253
1302
|
/**
|
|
@@ -1875,6 +1924,9 @@ type TextSuggestionStyles = typeof styles$3;
|
|
|
1875
1924
|
declare const styles$2: {
|
|
1876
1925
|
readonly "footer": string;
|
|
1877
1926
|
readonly "footerShortcut": string;
|
|
1927
|
+
readonly "interactiveAssistantTab": string;
|
|
1928
|
+
readonly "interactiveAssistantTabActive": string;
|
|
1929
|
+
readonly "interactiveAssistantTabs": string;
|
|
1878
1930
|
readonly "link": string;
|
|
1879
1931
|
readonly "loginText": string;
|
|
1880
1932
|
readonly "root": string;
|
|
@@ -2007,6 +2059,7 @@ type State = {
|
|
|
2007
2059
|
showTextSuggestions: boolean;
|
|
2008
2060
|
showEntitiesCommand: boolean;
|
|
2009
2061
|
showSummaryCommand: boolean;
|
|
2062
|
+
/** @deprecated Use the knowledge-assist widget block; still synced from profile for legacy consumers. */
|
|
2010
2063
|
showKnowledgeSearch: boolean;
|
|
2011
2064
|
textSuggestionsCount: number;
|
|
2012
2065
|
recommendTextSuggestions: boolean;
|
|
@@ -2663,7 +2716,8 @@ declare class DeepdeskSDK {
|
|
|
2663
2716
|
* @param settings.showTextSuggestions: Show text suggestions (default: true)
|
|
2664
2717
|
* @param settings.showEntitiesCommand: Show entities command (default: false)
|
|
2665
2718
|
* @param settings.showSummaryCommand: Show summary command (default: false)
|
|
2666
|
-
* @param settings.showKnowledgeSearch:
|
|
2719
|
+
* @param settings.showKnowledgeSearch: @deprecated Use the knowledge-assist widget block instead.
|
|
2720
|
+
* Still accepted for backward compatibility; profile load overwrites this from {@link deriveShowKnowledgeSearch}.
|
|
2667
2721
|
* @param settings.textSuggestionsCount: Number of text suggestions to show (default: 3)
|
|
2668
2722
|
* @param settings.recommendTextSuggestions: Recommend text suggestions (default: true)
|
|
2669
2723
|
* @param settings.searchTriggerKey: Key to trigger search (default: 'k')
|
|
@@ -2806,6 +2860,28 @@ declare class DeepdeskSDK {
|
|
|
2806
2860
|
* ```
|
|
2807
2861
|
*/
|
|
2808
2862
|
getAgentSettings<T = unknown>(): Promise<T>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Retrieves the currently logged-in agent's own Deepdesk profile.
|
|
2865
|
+
*
|
|
2866
|
+
* This is the agent's Deepdesk-side identity, including the display name
|
|
2867
|
+
* (`nickname`) they configured in Studio under Profile settings. Platform
|
|
2868
|
+
* integrations should prefer this `nickname` over any name supplied by the
|
|
2869
|
+
* host platform (e.g. Genesys Cloud, LiveEngage) when populating
|
|
2870
|
+
* `agentNickname` via `setAgentInfo`, since the agent's Deepdesk profile
|
|
2871
|
+
* setting is the one they explicitly chose to expose to customers.
|
|
2872
|
+
*
|
|
2873
|
+
* @returns Promise that resolves to the agent's Deepdesk profile
|
|
2874
|
+
*
|
|
2875
|
+
* @example
|
|
2876
|
+
* ```typescript
|
|
2877
|
+
* const me = await sdk.getMe();
|
|
2878
|
+
* await sdk.setAgentInfo({
|
|
2879
|
+
* agentId: platformAgent.id,
|
|
2880
|
+
* agentNickname: me.nickname || platformAgent.name,
|
|
2881
|
+
* });
|
|
2882
|
+
* ```
|
|
2883
|
+
*/
|
|
2884
|
+
getMe(): Promise<CamelCaseKeys<Server.Me>>;
|
|
2809
2885
|
/**
|
|
2810
2886
|
* Refreshes suggestions based on the current conversation.
|
|
2811
2887
|
*
|
|
@@ -3436,6 +3512,22 @@ declare class DeepdeskSDK {
|
|
|
3436
3512
|
private setupHandlingTime;
|
|
3437
3513
|
private handleError;
|
|
3438
3514
|
private loadProfileConfigPromise;
|
|
3515
|
+
private loadProfileConfigPromiseKey;
|
|
3516
|
+
private personalCollectionSyncPendingKey;
|
|
3517
|
+
private personalCollectionSyncDrainPromise;
|
|
3518
|
+
/**
|
|
3519
|
+
* Subscription/dedupe key for conversation + profile. Admin validates profile codes as
|
|
3520
|
+
* `[a-z0-9-]+` (no colon), so the last `:` separates conversation id from profileCode
|
|
3521
|
+
* even when the id contains `:`.
|
|
3522
|
+
*/
|
|
3523
|
+
private getConversationProfileKey;
|
|
3524
|
+
private getProfileLoadKey;
|
|
3525
|
+
private isCurrentProfileLoadKey;
|
|
3526
|
+
private getConversationLoadedKey;
|
|
3527
|
+
private resetProfileDerivedSettings;
|
|
3528
|
+
private syncPersonalCollectionForConversation;
|
|
3529
|
+
private ensurePersonalCollectionSyncDrain;
|
|
3530
|
+
private drainPersonalCollectionSync;
|
|
3439
3531
|
private loadProfileConfig;
|
|
3440
3532
|
/**
|
|
3441
3533
|
* Authenticates user via popup window.
|
package/dist/index.d.ts
CHANGED
|
@@ -451,6 +451,12 @@ type State$9 = {
|
|
|
451
451
|
cues: Cue[];
|
|
452
452
|
threads: Record<number, AssistantInteraction[]>;
|
|
453
453
|
pending: string[];
|
|
454
|
+
widgetAssistantSessionId: string | null;
|
|
455
|
+
assistantThreads: Record<string, {
|
|
456
|
+
threadId: number;
|
|
457
|
+
}>;
|
|
458
|
+
activeAssistantCode: string | null;
|
|
459
|
+
nextLocalThreadId: number;
|
|
454
460
|
};
|
|
455
461
|
type Transcript = Array<{
|
|
456
462
|
source: string;
|
|
@@ -469,6 +475,14 @@ interface EvaluateInput {
|
|
|
469
475
|
skipState?: boolean;
|
|
470
476
|
}
|
|
471
477
|
|
|
478
|
+
type QueueMicrotaskErrorEventData = {
|
|
479
|
+
message: string;
|
|
480
|
+
stack: string | null;
|
|
481
|
+
typeofQueueMicrotask: string;
|
|
482
|
+
typeofWindowQueueMicrotask: string;
|
|
483
|
+
typeofGlobalThisQueueMicrotask: string;
|
|
484
|
+
};
|
|
485
|
+
|
|
472
486
|
type Fetch = typeof window.fetch;
|
|
473
487
|
type HTTPClientOptions = {
|
|
474
488
|
fetch?: typeof window.fetch;
|
|
@@ -720,6 +734,7 @@ declare namespace Server {
|
|
|
720
734
|
type EvaluationResponse = {
|
|
721
735
|
evaluation_id: string;
|
|
722
736
|
evaluation_status: EvaluationStatus;
|
|
737
|
+
session_id?: string;
|
|
723
738
|
output: EvaluationOutput | KAAnswer | string;
|
|
724
739
|
};
|
|
725
740
|
type EvaluationOutput = Array<{
|
|
@@ -869,6 +884,12 @@ declare namespace Server {
|
|
|
869
884
|
*/
|
|
870
885
|
knowledge_assistant: string | null;
|
|
871
886
|
knowledge_assistant_new: string | null;
|
|
887
|
+
widget_interactive_assistants: Array<{
|
|
888
|
+
code: string;
|
|
889
|
+
name: string;
|
|
890
|
+
display_name: string | null;
|
|
891
|
+
order: number;
|
|
892
|
+
}>;
|
|
872
893
|
on_demand_assistants: Array<OnDemandAssistant>;
|
|
873
894
|
active_config: {
|
|
874
895
|
default_locale: string;
|
|
@@ -1085,6 +1106,7 @@ type SendEventArgumentMap = {
|
|
|
1085
1106
|
'trigger on demand assistant': Event$1<{
|
|
1086
1107
|
assistantCode: string;
|
|
1087
1108
|
}>;
|
|
1109
|
+
'queueMicrotask error': Event$1<QueueMicrotaskErrorEventData>;
|
|
1088
1110
|
};
|
|
1089
1111
|
/**
|
|
1090
1112
|
* Request retry options
|
|
@@ -1177,6 +1199,10 @@ declare class DeepdeskAPI {
|
|
|
1177
1199
|
* Request autocomplete suggestions based on the agent text input
|
|
1178
1200
|
*/
|
|
1179
1201
|
getAutocompleteSuggestions(conversationId: string, params: CamelCaseKeys<Server.GetAutocompleteSuggestionsParams>): Promise<TextSuggestion[]>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Replace in-engine personal collection for the agent with items scoped to the conversation profile.
|
|
1204
|
+
*/
|
|
1205
|
+
syncPersonalCollection(conversationId: string | number): Promise<void>;
|
|
1180
1206
|
/**
|
|
1181
1207
|
* Request pinned messages
|
|
1182
1208
|
*/
|
|
@@ -1223,11 +1249,31 @@ declare class DeepdeskAPI {
|
|
|
1223
1249
|
externalConversationId?: string;
|
|
1224
1250
|
attachments?: EvaluationAttachment[];
|
|
1225
1251
|
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1252
|
+
interactWithAssistant(init: {
|
|
1253
|
+
assistantCode: string;
|
|
1254
|
+
message: string;
|
|
1255
|
+
sessionId?: string;
|
|
1256
|
+
externalConversationId?: string;
|
|
1257
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Clears the conversation of one assistant in a session, so the next `interactWithAssistant`
|
|
1260
|
+
* call starts fresh. Other assistants in the same session keep their conversation.
|
|
1261
|
+
*/
|
|
1262
|
+
resetAssistantThread(init: {
|
|
1263
|
+
assistantCode: string;
|
|
1264
|
+
sessionId: string;
|
|
1265
|
+
}): Promise<void>;
|
|
1266
|
+
/**
|
|
1267
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1268
|
+
*/
|
|
1226
1269
|
createAssistantThread(init: {
|
|
1227
1270
|
assistantCode: string;
|
|
1228
1271
|
}): Promise<{
|
|
1229
1272
|
id: number;
|
|
1230
1273
|
}>;
|
|
1274
|
+
/**
|
|
1275
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1276
|
+
*/
|
|
1231
1277
|
postMessageToAssistantThread(init: {
|
|
1232
1278
|
assistantCode: string;
|
|
1233
1279
|
threadId: number;
|
|
@@ -1248,6 +1294,9 @@ interface State$8 {
|
|
|
1248
1294
|
type State$7 = {
|
|
1249
1295
|
data: Profile | null;
|
|
1250
1296
|
fetchState: FetchState;
|
|
1297
|
+
/** Bumped on reset/clear so in-flight getProfile cannot repopulate profile. */
|
|
1298
|
+
generation: number;
|
|
1299
|
+
inFlightRequestId: string | null;
|
|
1251
1300
|
};
|
|
1252
1301
|
|
|
1253
1302
|
/**
|
|
@@ -1875,6 +1924,9 @@ type TextSuggestionStyles = typeof styles$3;
|
|
|
1875
1924
|
declare const styles$2: {
|
|
1876
1925
|
readonly "footer": string;
|
|
1877
1926
|
readonly "footerShortcut": string;
|
|
1927
|
+
readonly "interactiveAssistantTab": string;
|
|
1928
|
+
readonly "interactiveAssistantTabActive": string;
|
|
1929
|
+
readonly "interactiveAssistantTabs": string;
|
|
1878
1930
|
readonly "link": string;
|
|
1879
1931
|
readonly "loginText": string;
|
|
1880
1932
|
readonly "root": string;
|
|
@@ -2007,6 +2059,7 @@ type State = {
|
|
|
2007
2059
|
showTextSuggestions: boolean;
|
|
2008
2060
|
showEntitiesCommand: boolean;
|
|
2009
2061
|
showSummaryCommand: boolean;
|
|
2062
|
+
/** @deprecated Use the knowledge-assist widget block; still synced from profile for legacy consumers. */
|
|
2010
2063
|
showKnowledgeSearch: boolean;
|
|
2011
2064
|
textSuggestionsCount: number;
|
|
2012
2065
|
recommendTextSuggestions: boolean;
|
|
@@ -2663,7 +2716,8 @@ declare class DeepdeskSDK {
|
|
|
2663
2716
|
* @param settings.showTextSuggestions: Show text suggestions (default: true)
|
|
2664
2717
|
* @param settings.showEntitiesCommand: Show entities command (default: false)
|
|
2665
2718
|
* @param settings.showSummaryCommand: Show summary command (default: false)
|
|
2666
|
-
* @param settings.showKnowledgeSearch:
|
|
2719
|
+
* @param settings.showKnowledgeSearch: @deprecated Use the knowledge-assist widget block instead.
|
|
2720
|
+
* Still accepted for backward compatibility; profile load overwrites this from {@link deriveShowKnowledgeSearch}.
|
|
2667
2721
|
* @param settings.textSuggestionsCount: Number of text suggestions to show (default: 3)
|
|
2668
2722
|
* @param settings.recommendTextSuggestions: Recommend text suggestions (default: true)
|
|
2669
2723
|
* @param settings.searchTriggerKey: Key to trigger search (default: 'k')
|
|
@@ -2806,6 +2860,28 @@ declare class DeepdeskSDK {
|
|
|
2806
2860
|
* ```
|
|
2807
2861
|
*/
|
|
2808
2862
|
getAgentSettings<T = unknown>(): Promise<T>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Retrieves the currently logged-in agent's own Deepdesk profile.
|
|
2865
|
+
*
|
|
2866
|
+
* This is the agent's Deepdesk-side identity, including the display name
|
|
2867
|
+
* (`nickname`) they configured in Studio under Profile settings. Platform
|
|
2868
|
+
* integrations should prefer this `nickname` over any name supplied by the
|
|
2869
|
+
* host platform (e.g. Genesys Cloud, LiveEngage) when populating
|
|
2870
|
+
* `agentNickname` via `setAgentInfo`, since the agent's Deepdesk profile
|
|
2871
|
+
* setting is the one they explicitly chose to expose to customers.
|
|
2872
|
+
*
|
|
2873
|
+
* @returns Promise that resolves to the agent's Deepdesk profile
|
|
2874
|
+
*
|
|
2875
|
+
* @example
|
|
2876
|
+
* ```typescript
|
|
2877
|
+
* const me = await sdk.getMe();
|
|
2878
|
+
* await sdk.setAgentInfo({
|
|
2879
|
+
* agentId: platformAgent.id,
|
|
2880
|
+
* agentNickname: me.nickname || platformAgent.name,
|
|
2881
|
+
* });
|
|
2882
|
+
* ```
|
|
2883
|
+
*/
|
|
2884
|
+
getMe(): Promise<CamelCaseKeys<Server.Me>>;
|
|
2809
2885
|
/**
|
|
2810
2886
|
* Refreshes suggestions based on the current conversation.
|
|
2811
2887
|
*
|
|
@@ -3436,6 +3512,22 @@ declare class DeepdeskSDK {
|
|
|
3436
3512
|
private setupHandlingTime;
|
|
3437
3513
|
private handleError;
|
|
3438
3514
|
private loadProfileConfigPromise;
|
|
3515
|
+
private loadProfileConfigPromiseKey;
|
|
3516
|
+
private personalCollectionSyncPendingKey;
|
|
3517
|
+
private personalCollectionSyncDrainPromise;
|
|
3518
|
+
/**
|
|
3519
|
+
* Subscription/dedupe key for conversation + profile. Admin validates profile codes as
|
|
3520
|
+
* `[a-z0-9-]+` (no colon), so the last `:` separates conversation id from profileCode
|
|
3521
|
+
* even when the id contains `:`.
|
|
3522
|
+
*/
|
|
3523
|
+
private getConversationProfileKey;
|
|
3524
|
+
private getProfileLoadKey;
|
|
3525
|
+
private isCurrentProfileLoadKey;
|
|
3526
|
+
private getConversationLoadedKey;
|
|
3527
|
+
private resetProfileDerivedSettings;
|
|
3528
|
+
private syncPersonalCollectionForConversation;
|
|
3529
|
+
private ensurePersonalCollectionSyncDrain;
|
|
3530
|
+
private drainPersonalCollectionSync;
|
|
3439
3531
|
private loadProfileConfig;
|
|
3440
3532
|
/**
|
|
3441
3533
|
* Authenticates user via popup window.
|