@telia-ace/widget-conversational-agent 1.1.123-rc.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/connection-interface.d.ts +10 -0
- package/connection.d.ts +52 -0
- package/constants.d.ts +1 -0
- package/fake-connection.d.ts +16 -0
- package/index.d.ts +1 -0
- package/index.js +1416 -0
- package/index.mjs +8107 -0
- package/package.json +18 -0
- package/plugin.d.ts +2 -0
- package/provider.d.ts +32 -0
- package/types.d.ts +41 -0
- package/ui/restart-dialog.d.ts +7 -0
- package/widget-manifest.json +7 -0
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telia-ace/widget-conversational-agent",
|
|
3
|
+
"version": "1.1.123-rc.10",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@telia-ace/widget-conversation-flamingo": "1.1.123-rc.10",
|
|
10
|
+
"rxjs": "^7.8.2",
|
|
11
|
+
"@telia-ace/widget-core-flamingo": "1.1.123-rc.10",
|
|
12
|
+
"lit": "^3.0.2",
|
|
13
|
+
"@lit/context": "^1.1.4"
|
|
14
|
+
},
|
|
15
|
+
"main": "./index.js",
|
|
16
|
+
"module": "./index.mjs",
|
|
17
|
+
"typings": "./index.d.ts"
|
|
18
|
+
}
|
package/plugin.d.ts
ADDED
package/provider.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ConversationEntry, ConversationProvider } from '../../conversation/src/index.ts';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare class ConversationalAgentProvider extends ConversationProvider {
|
|
4
|
+
private isConnected;
|
|
5
|
+
private rehydrating;
|
|
6
|
+
private lastReceivedMessageWasComplete;
|
|
7
|
+
private isReady;
|
|
8
|
+
private connection;
|
|
9
|
+
private restartDialogEntry;
|
|
10
|
+
private lastWrittenEntry;
|
|
11
|
+
private agent;
|
|
12
|
+
private user;
|
|
13
|
+
private shouldRestartSubject$;
|
|
14
|
+
private constructor();
|
|
15
|
+
static getInstance(key: string, component: any): ConversationalAgentProvider;
|
|
16
|
+
setShouldRestart(value: boolean): void;
|
|
17
|
+
get shouldRestart$(): Observable<boolean>;
|
|
18
|
+
printAgent(text: string): ConversationEntry;
|
|
19
|
+
printUser(text: string): ConversationEntry;
|
|
20
|
+
printSystem(text: string): ConversationEntry;
|
|
21
|
+
showRestartDialog(): void;
|
|
22
|
+
onUserSubmit(action: {
|
|
23
|
+
text: string;
|
|
24
|
+
}): void;
|
|
25
|
+
private mergeMessageParts;
|
|
26
|
+
private updateEntry;
|
|
27
|
+
private createConnection;
|
|
28
|
+
restartConversation(): void;
|
|
29
|
+
save(data: any): void;
|
|
30
|
+
rehydrate(data: Record<string, any>): Promise<void>;
|
|
31
|
+
connect(_conversationOptions?: Record<string, any>): void;
|
|
32
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type ReceiveMessage = {
|
|
2
|
+
text: string;
|
|
3
|
+
isComplete: boolean;
|
|
4
|
+
sequenceNumber: number;
|
|
5
|
+
type: 'text' | 'stream';
|
|
6
|
+
sender?: 'user';
|
|
7
|
+
isHandover?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type SystemEvent = {
|
|
10
|
+
text: string;
|
|
11
|
+
event: 'connected' | 'disconnected' | 'error' | 'handover';
|
|
12
|
+
};
|
|
13
|
+
export type HandoverEvent = {
|
|
14
|
+
providerKey: string;
|
|
15
|
+
options: Record<string, any>;
|
|
16
|
+
} & SystemEvent;
|
|
17
|
+
type SendMessagePayload = {
|
|
18
|
+
sequenceNumber: number;
|
|
19
|
+
};
|
|
20
|
+
export type SendMessageTextPayload = {
|
|
21
|
+
inputPayload: {
|
|
22
|
+
textInputContent: {
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
} & SendMessagePayload;
|
|
27
|
+
export type SendMessageInitializePayload = {
|
|
28
|
+
initializeRequestPayload: {
|
|
29
|
+
extension: string;
|
|
30
|
+
};
|
|
31
|
+
} & SendMessagePayload;
|
|
32
|
+
export type SendMessageReconnectPayload = {
|
|
33
|
+
reconnectRequestPayload: {
|
|
34
|
+
lastReceivedSequenceNumber: number;
|
|
35
|
+
dialogId: string;
|
|
36
|
+
};
|
|
37
|
+
} & SendMessagePayload;
|
|
38
|
+
export type AgentInfo = {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
export {};
|