avin-ai 0.1.7 → 0.1.8

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.d.ts CHANGED
@@ -3,46 +3,40 @@ export declare interface Agent {
3
3
  }
4
4
 
5
5
  export declare class AvinWidget extends HTMLElement {
6
- private isPanelOpen;
7
- private callActive;
8
- private transcript;
9
- private client;
10
6
  private shadow;
7
+ private provider;
11
8
  private widgetId;
12
- private serverUrl;
13
9
  private agentId;
14
- private clientId;
15
- private widgetMode;
16
- private widgetIcon;
17
- private messages;
18
- private prospectId;
19
- private chatId;
20
- private isLoading;
10
+ private serverUrl;
11
+ private position;
12
+ private primaryColor;
13
+ private secondaryColor;
14
+ private gradient;
21
15
  static get observedAttributes(): string[];
22
16
  constructor();
23
17
  connectedCallback(): void;
24
- initializeConfig(): Promise<void>;
25
- initializeChatSession(): Promise<void>;
26
- render(position: string, primaryColor: string): void;
27
- private position;
28
- private primaryColor;
29
- private renderForMode;
30
- private getFabContent;
31
- private getPanelTitle;
32
- private getPanelContent;
33
- private getVoiceOnlyContent;
34
- private getChatOnlyContent;
35
- private getChatVoiceContent;
36
- private getAvatarOnlyContent;
37
- private getChatAvatarContent;
38
- private renderChatMessages;
39
- private attachWidgetButtonHandlers;
40
- private handleChatSend;
41
- attachEventListeners(): void;
42
- updateStatus(text: string, type: 'idle' | 'connecting' | 'connected' | 'error'): void;
43
- startCall(): Promise<void>;
44
- stopCall(): void;
45
- disconnectedCallback(): void;
18
+ private readAttributes;
19
+ initializeExpandedConfig(): Promise<void>;
20
+ }
21
+
22
+ declare interface ChatMessage {
23
+ role: 'user' | 'assistant';
24
+ content: string;
25
+ widget?: {
26
+ type: 'carousel' | 'button_list';
27
+ data: any;
28
+ };
29
+ }
30
+
31
+ export declare class ChatService {
32
+ static createChatProspect(prospectGroupId: string): Promise<string>;
33
+ static fetchWelcomeMessage(agentId: string, prospectId: string): Promise<ChatMessage | null>;
34
+ static sendChatMessage(agentId: string, prospectId: string, message: string, chatId: string | null, onChunk: (text: string) => void, onWidget: (widget: any) => void, onDone: (newChatId: string | null) => void): Promise<void>;
35
+ static createCall(agentId: string, prospectId: string | null, widgetMode: string): Promise<string>;
36
+ }
37
+
38
+ export declare class ConfigService {
39
+ static fetchWidgetConfig(widgetId: string): Promise<WidgetConfig>;
46
40
  }
47
41
 
48
42
  export declare interface ControlEvent {
@@ -52,8 +46,6 @@ export declare interface ControlEvent {
52
46
  name?: string;
53
47
  }
54
48
 
55
- export declare function fetchWidgetConfig(widgetId: string): Promise<WidgetConfig>;
56
-
57
49
  export declare interface TTSProvider {
58
50
  root_name: string;
59
51
  provider_country?: string;
@@ -119,7 +111,11 @@ export declare interface WidgetConfig {
119
111
  client_id: string;
120
112
  mode: WidgetMode;
121
113
  icon?: string;
114
+ gradient?: string;
122
115
  agent?: Agent;
116
+ client?: {
117
+ base_prospect_group_id?: string;
118
+ };
123
119
  }
124
120
 
125
121
  export declare type WidgetMode = 'voice_only' | 'chat_voice' | 'avatar_only' | 'chat_avatar' | 'chat_only';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avin-ai",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "AvinAI Voice Widget SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/avin-ai.umd.js",