@w0nna_dev/lina-widget 1.0.8 → 1.1.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.
|
@@ -3,6 +3,14 @@ type CallStatus = 'idle' | 'connecting' | 'connected' | 'agent-connected' | 'dis
|
|
|
3
3
|
interface MakeCallOptions {
|
|
4
4
|
agentId: string;
|
|
5
5
|
}
|
|
6
|
+
export interface AgentCommand {
|
|
7
|
+
type: 'change_color' | 'set_emotion' | 'agent_state';
|
|
8
|
+
payload?: {
|
|
9
|
+
color?: string;
|
|
10
|
+
emotion?: 'neutral' | 'joy' | 'thinking' | 'interrupted';
|
|
11
|
+
state?: 'idle' | 'listening' | 'thinking' | 'speaking';
|
|
12
|
+
};
|
|
13
|
+
}
|
|
6
14
|
export interface LiveKitCallManagerEvents {
|
|
7
15
|
'status-changed': CustomEvent<CallStatus>;
|
|
8
16
|
'room-connected': CustomEvent<{
|
|
@@ -33,6 +41,10 @@ export interface LiveKitCallManagerEvents {
|
|
|
33
41
|
'audio-playback-status-changed': CustomEvent<{
|
|
34
42
|
canPlayback: boolean;
|
|
35
43
|
}>;
|
|
44
|
+
'agent-command': CustomEvent<AgentCommand>;
|
|
45
|
+
'agent-speaking': CustomEvent<{
|
|
46
|
+
isSpeaking: boolean;
|
|
47
|
+
}>;
|
|
36
48
|
'microphone-enabled': Event;
|
|
37
49
|
'microphone-disabled': Event;
|
|
38
50
|
'audio-enabled': Event;
|
|
@@ -26,6 +26,7 @@ export declare class LinaWidget extends LitElement {
|
|
|
26
26
|
buttonTextColor: string;
|
|
27
27
|
private currentState;
|
|
28
28
|
private callStatus;
|
|
29
|
+
private isLoading;
|
|
29
30
|
private _hasMicPermission;
|
|
30
31
|
connectedCallback(): void;
|
|
31
32
|
disconnectedCallback(): void;
|
|
@@ -33,6 +34,25 @@ export declare class LinaWidget extends LitElement {
|
|
|
33
34
|
private checkMicrophonePermission;
|
|
34
35
|
private initializeOrb;
|
|
35
36
|
private initializeCallManager;
|
|
37
|
+
private _localAudioContext;
|
|
38
|
+
private _localAudioAnalyser;
|
|
39
|
+
private _localAudioMonitorId;
|
|
40
|
+
/**
|
|
41
|
+
* Monitor local audio to detect user speaking (for interruption)
|
|
42
|
+
*/
|
|
43
|
+
private startLocalAudioMonitoring;
|
|
44
|
+
private stopLocalAudioMonitoring;
|
|
45
|
+
private _agentIsSpeaking;
|
|
46
|
+
private _interruptionTimeout;
|
|
47
|
+
/**
|
|
48
|
+
* Handle commands received from the agent via data channel
|
|
49
|
+
*/
|
|
50
|
+
private handleAgentCommand;
|
|
51
|
+
private _lastInterruptionTime;
|
|
52
|
+
/**
|
|
53
|
+
* Handle user interruption - show red pulse temporarily
|
|
54
|
+
*/
|
|
55
|
+
private handleUserInterruption;
|
|
36
56
|
private handleCallStatusChange;
|
|
37
57
|
private cleanup;
|
|
38
58
|
private startIdleAnimation;
|