@deepdesk/deepdesk-sdk 19.6.2-beta.1 → 19.6.2-beta.11
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 +72 -1
- package/dist/index.d.ts +72 -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;
|
|
@@ -900,6 +921,7 @@ declare namespace Server {
|
|
|
900
921
|
assistant_name: string;
|
|
901
922
|
display_name?: string;
|
|
902
923
|
is_pinned: boolean;
|
|
924
|
+
is_silent?: boolean;
|
|
903
925
|
};
|
|
904
926
|
type ChatHistory = {
|
|
905
927
|
question: string;
|
|
@@ -1085,6 +1107,7 @@ type SendEventArgumentMap = {
|
|
|
1085
1107
|
'trigger on demand assistant': Event$1<{
|
|
1086
1108
|
assistantCode: string;
|
|
1087
1109
|
}>;
|
|
1110
|
+
'queueMicrotask error': Event$1<QueueMicrotaskErrorEventData>;
|
|
1088
1111
|
};
|
|
1089
1112
|
/**
|
|
1090
1113
|
* Request retry options
|
|
@@ -1177,6 +1200,10 @@ declare class DeepdeskAPI {
|
|
|
1177
1200
|
* Request autocomplete suggestions based on the agent text input
|
|
1178
1201
|
*/
|
|
1179
1202
|
getAutocompleteSuggestions(conversationId: string, params: CamelCaseKeys<Server.GetAutocompleteSuggestionsParams>): Promise<TextSuggestion[]>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Replace in-engine personal collection for the agent with items scoped to the conversation profile.
|
|
1205
|
+
*/
|
|
1206
|
+
syncPersonalCollection(conversationId: string | number): Promise<void>;
|
|
1180
1207
|
/**
|
|
1181
1208
|
* Request pinned messages
|
|
1182
1209
|
*/
|
|
@@ -1223,11 +1250,31 @@ declare class DeepdeskAPI {
|
|
|
1223
1250
|
externalConversationId?: string;
|
|
1224
1251
|
attachments?: EvaluationAttachment[];
|
|
1225
1252
|
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1253
|
+
interactWithAssistant(init: {
|
|
1254
|
+
assistantCode: string;
|
|
1255
|
+
message: string;
|
|
1256
|
+
sessionId?: string;
|
|
1257
|
+
externalConversationId?: string;
|
|
1258
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Clears the conversation of one assistant in a session, so the next `interactWithAssistant`
|
|
1261
|
+
* call starts fresh. Other assistants in the same session keep their conversation.
|
|
1262
|
+
*/
|
|
1263
|
+
resetAssistantThread(init: {
|
|
1264
|
+
assistantCode: string;
|
|
1265
|
+
sessionId: string;
|
|
1266
|
+
}): Promise<void>;
|
|
1267
|
+
/**
|
|
1268
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1269
|
+
*/
|
|
1226
1270
|
createAssistantThread(init: {
|
|
1227
1271
|
assistantCode: string;
|
|
1228
1272
|
}): Promise<{
|
|
1229
1273
|
id: number;
|
|
1230
1274
|
}>;
|
|
1275
|
+
/**
|
|
1276
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1277
|
+
*/
|
|
1231
1278
|
postMessageToAssistantThread(init: {
|
|
1232
1279
|
assistantCode: string;
|
|
1233
1280
|
threadId: number;
|
|
@@ -1248,6 +1295,9 @@ interface State$8 {
|
|
|
1248
1295
|
type State$7 = {
|
|
1249
1296
|
data: Profile | null;
|
|
1250
1297
|
fetchState: FetchState;
|
|
1298
|
+
/** Bumped on reset/clear so in-flight getProfile cannot repopulate profile. */
|
|
1299
|
+
generation: number;
|
|
1300
|
+
inFlightRequestId: string | null;
|
|
1251
1301
|
};
|
|
1252
1302
|
|
|
1253
1303
|
/**
|
|
@@ -1875,6 +1925,9 @@ type TextSuggestionStyles = typeof styles$3;
|
|
|
1875
1925
|
declare const styles$2: {
|
|
1876
1926
|
readonly "footer": string;
|
|
1877
1927
|
readonly "footerShortcut": string;
|
|
1928
|
+
readonly "interactiveAssistantTab": string;
|
|
1929
|
+
readonly "interactiveAssistantTabActive": string;
|
|
1930
|
+
readonly "interactiveAssistantTabs": string;
|
|
1878
1931
|
readonly "link": string;
|
|
1879
1932
|
readonly "loginText": string;
|
|
1880
1933
|
readonly "root": string;
|
|
@@ -2007,6 +2060,7 @@ type State = {
|
|
|
2007
2060
|
showTextSuggestions: boolean;
|
|
2008
2061
|
showEntitiesCommand: boolean;
|
|
2009
2062
|
showSummaryCommand: boolean;
|
|
2063
|
+
/** @deprecated Use the knowledge-assist widget block; still synced from profile for legacy consumers. */
|
|
2010
2064
|
showKnowledgeSearch: boolean;
|
|
2011
2065
|
textSuggestionsCount: number;
|
|
2012
2066
|
recommendTextSuggestions: boolean;
|
|
@@ -2663,7 +2717,8 @@ declare class DeepdeskSDK {
|
|
|
2663
2717
|
* @param settings.showTextSuggestions: Show text suggestions (default: true)
|
|
2664
2718
|
* @param settings.showEntitiesCommand: Show entities command (default: false)
|
|
2665
2719
|
* @param settings.showSummaryCommand: Show summary command (default: false)
|
|
2666
|
-
* @param settings.showKnowledgeSearch:
|
|
2720
|
+
* @param settings.showKnowledgeSearch: @deprecated Use the knowledge-assist widget block instead.
|
|
2721
|
+
* Still accepted for backward compatibility; profile load overwrites this from {@link deriveShowKnowledgeSearch}.
|
|
2667
2722
|
* @param settings.textSuggestionsCount: Number of text suggestions to show (default: 3)
|
|
2668
2723
|
* @param settings.recommendTextSuggestions: Recommend text suggestions (default: true)
|
|
2669
2724
|
* @param settings.searchTriggerKey: Key to trigger search (default: 'k')
|
|
@@ -3458,6 +3513,22 @@ declare class DeepdeskSDK {
|
|
|
3458
3513
|
private setupHandlingTime;
|
|
3459
3514
|
private handleError;
|
|
3460
3515
|
private loadProfileConfigPromise;
|
|
3516
|
+
private loadProfileConfigPromiseKey;
|
|
3517
|
+
private personalCollectionSyncPendingKey;
|
|
3518
|
+
private personalCollectionSyncDrainPromise;
|
|
3519
|
+
/**
|
|
3520
|
+
* Subscription/dedupe key for conversation + profile. Admin validates profile codes as
|
|
3521
|
+
* `[a-z0-9-]+` (no colon), so the last `:` separates conversation id from profileCode
|
|
3522
|
+
* even when the id contains `:`.
|
|
3523
|
+
*/
|
|
3524
|
+
private getConversationProfileKey;
|
|
3525
|
+
private getProfileLoadKey;
|
|
3526
|
+
private isCurrentProfileLoadKey;
|
|
3527
|
+
private getConversationLoadedKey;
|
|
3528
|
+
private resetProfileDerivedSettings;
|
|
3529
|
+
private syncPersonalCollectionForConversation;
|
|
3530
|
+
private ensurePersonalCollectionSyncDrain;
|
|
3531
|
+
private drainPersonalCollectionSync;
|
|
3461
3532
|
private loadProfileConfig;
|
|
3462
3533
|
/**
|
|
3463
3534
|
* 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;
|
|
@@ -900,6 +921,7 @@ declare namespace Server {
|
|
|
900
921
|
assistant_name: string;
|
|
901
922
|
display_name?: string;
|
|
902
923
|
is_pinned: boolean;
|
|
924
|
+
is_silent?: boolean;
|
|
903
925
|
};
|
|
904
926
|
type ChatHistory = {
|
|
905
927
|
question: string;
|
|
@@ -1085,6 +1107,7 @@ type SendEventArgumentMap = {
|
|
|
1085
1107
|
'trigger on demand assistant': Event$1<{
|
|
1086
1108
|
assistantCode: string;
|
|
1087
1109
|
}>;
|
|
1110
|
+
'queueMicrotask error': Event$1<QueueMicrotaskErrorEventData>;
|
|
1088
1111
|
};
|
|
1089
1112
|
/**
|
|
1090
1113
|
* Request retry options
|
|
@@ -1177,6 +1200,10 @@ declare class DeepdeskAPI {
|
|
|
1177
1200
|
* Request autocomplete suggestions based on the agent text input
|
|
1178
1201
|
*/
|
|
1179
1202
|
getAutocompleteSuggestions(conversationId: string, params: CamelCaseKeys<Server.GetAutocompleteSuggestionsParams>): Promise<TextSuggestion[]>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Replace in-engine personal collection for the agent with items scoped to the conversation profile.
|
|
1205
|
+
*/
|
|
1206
|
+
syncPersonalCollection(conversationId: string | number): Promise<void>;
|
|
1180
1207
|
/**
|
|
1181
1208
|
* Request pinned messages
|
|
1182
1209
|
*/
|
|
@@ -1223,11 +1250,31 @@ declare class DeepdeskAPI {
|
|
|
1223
1250
|
externalConversationId?: string;
|
|
1224
1251
|
attachments?: EvaluationAttachment[];
|
|
1225
1252
|
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1253
|
+
interactWithAssistant(init: {
|
|
1254
|
+
assistantCode: string;
|
|
1255
|
+
message: string;
|
|
1256
|
+
sessionId?: string;
|
|
1257
|
+
externalConversationId?: string;
|
|
1258
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Clears the conversation of one assistant in a session, so the next `interactWithAssistant`
|
|
1261
|
+
* call starts fresh. Other assistants in the same session keep their conversation.
|
|
1262
|
+
*/
|
|
1263
|
+
resetAssistantThread(init: {
|
|
1264
|
+
assistantCode: string;
|
|
1265
|
+
sessionId: string;
|
|
1266
|
+
}): Promise<void>;
|
|
1267
|
+
/**
|
|
1268
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1269
|
+
*/
|
|
1226
1270
|
createAssistantThread(init: {
|
|
1227
1271
|
assistantCode: string;
|
|
1228
1272
|
}): Promise<{
|
|
1229
1273
|
id: number;
|
|
1230
1274
|
}>;
|
|
1275
|
+
/**
|
|
1276
|
+
* @deprecated Prefer `interactWithAssistant` for widget chat. Kept for existing SDK consumers.
|
|
1277
|
+
*/
|
|
1231
1278
|
postMessageToAssistantThread(init: {
|
|
1232
1279
|
assistantCode: string;
|
|
1233
1280
|
threadId: number;
|
|
@@ -1248,6 +1295,9 @@ interface State$8 {
|
|
|
1248
1295
|
type State$7 = {
|
|
1249
1296
|
data: Profile | null;
|
|
1250
1297
|
fetchState: FetchState;
|
|
1298
|
+
/** Bumped on reset/clear so in-flight getProfile cannot repopulate profile. */
|
|
1299
|
+
generation: number;
|
|
1300
|
+
inFlightRequestId: string | null;
|
|
1251
1301
|
};
|
|
1252
1302
|
|
|
1253
1303
|
/**
|
|
@@ -1875,6 +1925,9 @@ type TextSuggestionStyles = typeof styles$3;
|
|
|
1875
1925
|
declare const styles$2: {
|
|
1876
1926
|
readonly "footer": string;
|
|
1877
1927
|
readonly "footerShortcut": string;
|
|
1928
|
+
readonly "interactiveAssistantTab": string;
|
|
1929
|
+
readonly "interactiveAssistantTabActive": string;
|
|
1930
|
+
readonly "interactiveAssistantTabs": string;
|
|
1878
1931
|
readonly "link": string;
|
|
1879
1932
|
readonly "loginText": string;
|
|
1880
1933
|
readonly "root": string;
|
|
@@ -2007,6 +2060,7 @@ type State = {
|
|
|
2007
2060
|
showTextSuggestions: boolean;
|
|
2008
2061
|
showEntitiesCommand: boolean;
|
|
2009
2062
|
showSummaryCommand: boolean;
|
|
2063
|
+
/** @deprecated Use the knowledge-assist widget block; still synced from profile for legacy consumers. */
|
|
2010
2064
|
showKnowledgeSearch: boolean;
|
|
2011
2065
|
textSuggestionsCount: number;
|
|
2012
2066
|
recommendTextSuggestions: boolean;
|
|
@@ -2663,7 +2717,8 @@ declare class DeepdeskSDK {
|
|
|
2663
2717
|
* @param settings.showTextSuggestions: Show text suggestions (default: true)
|
|
2664
2718
|
* @param settings.showEntitiesCommand: Show entities command (default: false)
|
|
2665
2719
|
* @param settings.showSummaryCommand: Show summary command (default: false)
|
|
2666
|
-
* @param settings.showKnowledgeSearch:
|
|
2720
|
+
* @param settings.showKnowledgeSearch: @deprecated Use the knowledge-assist widget block instead.
|
|
2721
|
+
* Still accepted for backward compatibility; profile load overwrites this from {@link deriveShowKnowledgeSearch}.
|
|
2667
2722
|
* @param settings.textSuggestionsCount: Number of text suggestions to show (default: 3)
|
|
2668
2723
|
* @param settings.recommendTextSuggestions: Recommend text suggestions (default: true)
|
|
2669
2724
|
* @param settings.searchTriggerKey: Key to trigger search (default: 'k')
|
|
@@ -3458,6 +3513,22 @@ declare class DeepdeskSDK {
|
|
|
3458
3513
|
private setupHandlingTime;
|
|
3459
3514
|
private handleError;
|
|
3460
3515
|
private loadProfileConfigPromise;
|
|
3516
|
+
private loadProfileConfigPromiseKey;
|
|
3517
|
+
private personalCollectionSyncPendingKey;
|
|
3518
|
+
private personalCollectionSyncDrainPromise;
|
|
3519
|
+
/**
|
|
3520
|
+
* Subscription/dedupe key for conversation + profile. Admin validates profile codes as
|
|
3521
|
+
* `[a-z0-9-]+` (no colon), so the last `:` separates conversation id from profileCode
|
|
3522
|
+
* even when the id contains `:`.
|
|
3523
|
+
*/
|
|
3524
|
+
private getConversationProfileKey;
|
|
3525
|
+
private getProfileLoadKey;
|
|
3526
|
+
private isCurrentProfileLoadKey;
|
|
3527
|
+
private getConversationLoadedKey;
|
|
3528
|
+
private resetProfileDerivedSettings;
|
|
3529
|
+
private syncPersonalCollectionForConversation;
|
|
3530
|
+
private ensurePersonalCollectionSyncDrain;
|
|
3531
|
+
private drainPersonalCollectionSync;
|
|
3461
3532
|
private loadProfileConfig;
|
|
3462
3533
|
/**
|
|
3463
3534
|
* Authenticates user via popup window.
|