@centive/aria-sdk 0.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.
- package/LICENSE +22 -0
- package/README.md +435 -0
- package/dist/components/AnamTriggerButton.d.ts +9 -0
- package/dist/components/AnamTriggerButton.d.ts.map +1 -0
- package/dist/components/AriaAssistant.d.ts +3 -0
- package/dist/components/AriaAssistant.d.ts.map +1 -0
- package/dist/components/AriaTriggerButton.d.ts +10 -0
- package/dist/components/AriaTriggerButton.d.ts.map +1 -0
- package/dist/components/AriaWidget.d.ts +7 -0
- package/dist/components/AriaWidget.d.ts.map +1 -0
- package/dist/components/ChatPanel.d.ts +3 -0
- package/dist/components/ChatPanel.d.ts.map +1 -0
- package/dist/components/SessionInfo.d.ts +7 -0
- package/dist/components/SessionInfo.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/context/AriaContext.d.ts +26 -0
- package/dist/context/AriaContext.d.ts.map +1 -0
- package/dist/context/AriaProvider.d.ts +9 -0
- package/dist/context/AriaProvider.d.ts.map +1 -0
- package/dist/hooks/useAria.d.ts +3 -0
- package/dist/hooks/useAria.d.ts.map +1 -0
- package/dist/index-C78Qd1Uk.js +6232 -0
- package/dist/index-C78Qd1Uk.js.map +1 -0
- package/dist/index-DyttThh2.js +17 -0
- package/dist/index-DyttThh2.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/types/index.d.ts +108 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Centive
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# Aria React SDK
|
|
2
|
+
|
|
3
|
+
A production-ready React SDK for [Anam AI](https://docs.anam.ai/) with dual-mode operation, WebSocket integration, and comprehensive message accumulation for seamless AI assistant experiences.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@centive/aria-sdk)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## ✨ Key Features
|
|
9
|
+
|
|
10
|
+
### 🎯 Dual-Mode Operation
|
|
11
|
+
- **Floating Button Mode** - Always-visible button for user-initiated conversations
|
|
12
|
+
- **Center Modal Mode** - Auto-opens when WebSocket events arrive (e.g., incoming calls)
|
|
13
|
+
- **Both modes work simultaneously** - Maximum flexibility for any use case
|
|
14
|
+
|
|
15
|
+
### 🔌 WebSocket Integration
|
|
16
|
+
- Real-time bidirectional communication
|
|
17
|
+
- Automatic session management
|
|
18
|
+
- Message accumulation and persistence
|
|
19
|
+
- Auto-save and circuit breaker patterns
|
|
20
|
+
|
|
21
|
+
### 💬 Full-Featured Communication
|
|
22
|
+
- Real-time video streaming with AI personas
|
|
23
|
+
- Toggle-able chat panel with conversation history
|
|
24
|
+
- Mute/unmute audio controls
|
|
25
|
+
- Live transcription display
|
|
26
|
+
- Message history tracking
|
|
27
|
+
|
|
28
|
+
### 🎨 Modern UI
|
|
29
|
+
- Video-call-style interface
|
|
30
|
+
- Light and dark theme support
|
|
31
|
+
- Landscape video (16:9) optimization
|
|
32
|
+
- Built with Shad/CN UI components
|
|
33
|
+
- Fully responsive design
|
|
34
|
+
|
|
35
|
+
### 🔧 Developer-Friendly
|
|
36
|
+
- TypeScript support with full type safety
|
|
37
|
+
- Simple React components and hooks
|
|
38
|
+
- Comprehensive documentation
|
|
39
|
+
- Example servers included
|
|
40
|
+
|
|
41
|
+
## 📦 Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @centive/aria-sdk
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Peer Dependencies
|
|
48
|
+
|
|
49
|
+
The SDK requires React 18+ as a peer dependency:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install react@^18.0.0 react-dom@^18.0.0
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 🚀 Quick Start
|
|
56
|
+
|
|
57
|
+
### 1. Wrap Your App with AriaProvider
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { AriaProvider, AriaAssistant, AriaTriggerButton } from '@centive/aria-sdk';
|
|
61
|
+
import '@centive/aria-sdk/styles.css';
|
|
62
|
+
|
|
63
|
+
function App() {
|
|
64
|
+
const config = {
|
|
65
|
+
websocketUrl: 'ws://localhost:8000/ws',
|
|
66
|
+
userId: 'user_123', // Required for message accumulation
|
|
67
|
+
theme: 'light', // or 'dark'
|
|
68
|
+
personaConfig: {
|
|
69
|
+
name: 'Aria',
|
|
70
|
+
avatarId: 'your-avatar-id',
|
|
71
|
+
voiceId: 'your-voice-id',
|
|
72
|
+
llmId: 'your-llm-id',
|
|
73
|
+
systemPrompt: 'You are Aria, a helpful AI assistant.',
|
|
74
|
+
},
|
|
75
|
+
onWebSocketEvent: (event) => {
|
|
76
|
+
console.log('Incoming WebSocket event:', event);
|
|
77
|
+
},
|
|
78
|
+
onError: (error) => console.error('Error:', error),
|
|
79
|
+
onSessionReady: () => console.log('Session ready!'),
|
|
80
|
+
onConnectionStateChange: (connected) => console.log('Connected:', connected),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<AriaProvider config={config}>
|
|
85
|
+
<YourApp />
|
|
86
|
+
|
|
87
|
+
{/* Floating trigger button */}
|
|
88
|
+
<AriaTriggerButton showAvatar={true} />
|
|
89
|
+
|
|
90
|
+
{/* Assistant widget */}
|
|
91
|
+
<AriaAssistant />
|
|
92
|
+
</AriaProvider>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 2. Import Styles
|
|
98
|
+
|
|
99
|
+
Make sure to import the CSS file in your app:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import '@centive/aria-sdk/styles.css';
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 3. Set Up Backend WebSocket Server
|
|
106
|
+
|
|
107
|
+
The SDK requires a backend WebSocket server that:
|
|
108
|
+
- Handles session token generation via Anam AI API
|
|
109
|
+
- Manages WebSocket connections
|
|
110
|
+
- Accumulates and persists messages
|
|
111
|
+
- Handles trigger events
|
|
112
|
+
|
|
113
|
+
See the included example servers:
|
|
114
|
+
- `example-ws-server.js` - Basic WebSocket server
|
|
115
|
+
- `example-server.js` - Full-featured server with message accumulation
|
|
116
|
+
|
|
117
|
+
## 📖 Core Concepts
|
|
118
|
+
|
|
119
|
+
### Dual-Mode Operation
|
|
120
|
+
|
|
121
|
+
#### User-Initiated Mode (Floating Button)
|
|
122
|
+
```tsx
|
|
123
|
+
// User clicks the floating button
|
|
124
|
+
<AriaTriggerButton showAvatar={true} label="Chat with Aria" />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Opens in bottom-right corner with landscape video display.
|
|
128
|
+
|
|
129
|
+
#### WebSocket-Triggered Mode (Center Modal)
|
|
130
|
+
```tsx
|
|
131
|
+
// Server sends trigger event
|
|
132
|
+
{
|
|
133
|
+
"type": "trigger_event",
|
|
134
|
+
"data": {
|
|
135
|
+
"message": "Incoming call",
|
|
136
|
+
"caller": "John Doe"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Automatically opens in center with large display.
|
|
142
|
+
|
|
143
|
+
### Message Accumulation
|
|
144
|
+
|
|
145
|
+
The SDK automatically:
|
|
146
|
+
- Sends message history to your backend via WebSocket
|
|
147
|
+
- Tracks real-time message streams
|
|
148
|
+
- Handles session end events
|
|
149
|
+
- Supports auto-save for long sessions
|
|
150
|
+
- Includes circuit breaker for API failures
|
|
151
|
+
|
|
152
|
+
## 🎨 Components
|
|
153
|
+
|
|
154
|
+
### AriaProvider
|
|
155
|
+
|
|
156
|
+
Main provider component that wraps your application.
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
<AriaProvider config={config}>
|
|
160
|
+
{children}
|
|
161
|
+
</AriaProvider>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### AriaAssistant
|
|
165
|
+
|
|
166
|
+
Main assistant widget component.
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<AriaAssistant />
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### AriaTriggerButton
|
|
173
|
+
|
|
174
|
+
Floating trigger button for user-initiated mode.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
<AriaTriggerButton
|
|
178
|
+
showAvatar={true}
|
|
179
|
+
label="Talk to Aria"
|
|
180
|
+
variant="default"
|
|
181
|
+
size="default"
|
|
182
|
+
/>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### useAria Hook
|
|
186
|
+
|
|
187
|
+
Access SDK state and methods from any component.
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
import { useAria } from '@centive/aria-sdk';
|
|
191
|
+
|
|
192
|
+
function MyComponent() {
|
|
193
|
+
const {
|
|
194
|
+
isOpen,
|
|
195
|
+
isConnected,
|
|
196
|
+
displayMode,
|
|
197
|
+
triggerMode,
|
|
198
|
+
theme,
|
|
199
|
+
chatMessages,
|
|
200
|
+
sessionState,
|
|
201
|
+
openAssistant,
|
|
202
|
+
closeAssistant,
|
|
203
|
+
toggleChat,
|
|
204
|
+
sendMessage,
|
|
205
|
+
toggleMute,
|
|
206
|
+
startSession,
|
|
207
|
+
stopSession,
|
|
208
|
+
triggerSession,
|
|
209
|
+
} = useAria();
|
|
210
|
+
|
|
211
|
+
// Use the methods and state
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## ⚙️ Configuration
|
|
216
|
+
|
|
217
|
+
### AriaSDKConfig
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
interface AriaSDKConfig {
|
|
221
|
+
websocketUrl: string; // WebSocket server URL
|
|
222
|
+
personaConfig: PersonaConfig; // AI persona configuration
|
|
223
|
+
userId?: string; // User ID for message accumulation
|
|
224
|
+
theme?: 'light' | 'dark'; // Initial theme (default: 'light')
|
|
225
|
+
triggerLabel?: string; // Button label text
|
|
226
|
+
onError?: (error: Error) => void;
|
|
227
|
+
onSessionReady?: () => void;
|
|
228
|
+
onConnectionStateChange?: (connected: boolean) => void;
|
|
229
|
+
onWebSocketEvent?: (event: any) => void;
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### PersonaConfig
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
interface PersonaConfig {
|
|
237
|
+
name: string; // Display name
|
|
238
|
+
avatarId: string; // Anam avatar ID
|
|
239
|
+
voiceId: string; // Anam voice ID
|
|
240
|
+
llmId: string; // Anam LLM ID
|
|
241
|
+
systemPrompt: string; // AI system prompt
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## 🌐 WebSocket Events
|
|
246
|
+
|
|
247
|
+
### Automatic Session Trigger (Backend → Frontend)
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"status": "success",
|
|
252
|
+
"message": "Session created successfully",
|
|
253
|
+
"session_data": {
|
|
254
|
+
"session_id": "sess_abc123",
|
|
255
|
+
"token": "tok_xyz789",
|
|
256
|
+
"expires_at": "2025-12-30T12:00:00Z"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Manual Session Trigger (Frontend → Backend)
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"user_trigger": true
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Message History Event (Frontend → Backend)
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"type": "message_history",
|
|
274
|
+
"session_id": "sess_abc123",
|
|
275
|
+
"user_id": "user_123",
|
|
276
|
+
"messages": [
|
|
277
|
+
{
|
|
278
|
+
"role": "user",
|
|
279
|
+
"content": "Hello",
|
|
280
|
+
"timestamp": "2026-01-06T10:00:00Z"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"role": "persona",
|
|
284
|
+
"content": "Hi! How can I help?",
|
|
285
|
+
"timestamp": "2026-01-06T10:00:02Z"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Session End Event (Frontend → Backend)
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"type": "session_end",
|
|
296
|
+
"session_id": "sess_abc123",
|
|
297
|
+
"user_id": "user_123"
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## 💡 Advanced Usage
|
|
302
|
+
|
|
303
|
+
### Programmatic Control
|
|
304
|
+
|
|
305
|
+
```tsx
|
|
306
|
+
function CustomController() {
|
|
307
|
+
const { openAssistant, closeAssistant, triggerSession } = useAria();
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<div>
|
|
311
|
+
{/* Open in user mode */}
|
|
312
|
+
<button onClick={() => openAssistant('user')}>
|
|
313
|
+
Start Chat
|
|
314
|
+
</button>
|
|
315
|
+
|
|
316
|
+
{/* Open in center mode */}
|
|
317
|
+
<button onClick={() => openAssistant('websocket')}>
|
|
318
|
+
Start Video Call
|
|
319
|
+
</button>
|
|
320
|
+
|
|
321
|
+
{/* Manually trigger session */}
|
|
322
|
+
<button onClick={triggerSession}>
|
|
323
|
+
Create New Session
|
|
324
|
+
</button>
|
|
325
|
+
</div>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Custom Event Handling
|
|
331
|
+
|
|
332
|
+
```tsx
|
|
333
|
+
const config = {
|
|
334
|
+
websocketUrl: 'ws://localhost:8000/ws',
|
|
335
|
+
userId: 'user_123',
|
|
336
|
+
personaConfig: { /* ... */ },
|
|
337
|
+
|
|
338
|
+
onWebSocketEvent: (event) => {
|
|
339
|
+
if (event.data.eventType === 'incoming_call') {
|
|
340
|
+
showNotification(`Call from ${event.data.caller}`);
|
|
341
|
+
playRingtone();
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
onSessionReady: () => {
|
|
346
|
+
console.log('AI assistant is ready!');
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
onError: (error) => {
|
|
350
|
+
captureError(error);
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Access Session State
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
function SessionMonitor() {
|
|
359
|
+
const { sessionState } = useAria();
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<div>
|
|
363
|
+
<p>Session ID: {sessionState.session_id}</p>
|
|
364
|
+
<p>Expires: {sessionState.expires_at}</p>
|
|
365
|
+
<p>Ready: {sessionState.isSessionReady ? 'Yes' : 'No'}</p>
|
|
366
|
+
{sessionState.lastError && <p>Error: {sessionState.lastError}</p>}
|
|
367
|
+
</div>
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## 🎯 Use Cases
|
|
373
|
+
|
|
374
|
+
- **Customer Support** - Floating help button + proactive agent-initiated conversations
|
|
375
|
+
- **Healthcare** - Patient consultations + appointment reminders
|
|
376
|
+
- **Financial Services** - Account questions + market alert notifications
|
|
377
|
+
- **E-commerce** - Product inquiries + order status updates
|
|
378
|
+
- **Education** - Student support + class notifications
|
|
379
|
+
- **Sales** - Lead qualification + follow-up calls
|
|
380
|
+
|
|
381
|
+
## 📋 Requirements
|
|
382
|
+
|
|
383
|
+
- React 18.0.0 or higher
|
|
384
|
+
- React DOM 18.0.0 or higher
|
|
385
|
+
- Node.js 18+ (for backend server)
|
|
386
|
+
- Modern browser with WebRTC support
|
|
387
|
+
- Anam AI API key ([Get one here](https://docs.anam.ai/get-your-api-key))
|
|
388
|
+
|
|
389
|
+
## 🌍 Browser Support
|
|
390
|
+
|
|
391
|
+
- Chrome/Edge (latest)
|
|
392
|
+
- Firefox (latest)
|
|
393
|
+
- Safari (latest)
|
|
394
|
+
- Opera (latest)
|
|
395
|
+
|
|
396
|
+
## 🔒 Security Best Practices
|
|
397
|
+
|
|
398
|
+
- Never expose your Anam API key in frontend code
|
|
399
|
+
- Use secure WebSocket connections (WSS) in production
|
|
400
|
+
- Implement proper CORS configuration
|
|
401
|
+
- Validate user IDs on the backend
|
|
402
|
+
- Use environment variables for sensitive data
|
|
403
|
+
|
|
404
|
+
## 📚 Documentation
|
|
405
|
+
|
|
406
|
+
For more detailed documentation, see:
|
|
407
|
+
- [WebSocket Guide](./WEBSOCKET_GUIDE.md) - WebSocket integration details
|
|
408
|
+
- [Publishing Guide](./PUBLISHING_GUIDE.md) - npm publishing instructions
|
|
409
|
+
- [Setup Summary](./SETUP_SUMMARY.md) - Complete setup overview
|
|
410
|
+
|
|
411
|
+
## 🤝 Contributing
|
|
412
|
+
|
|
413
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
414
|
+
|
|
415
|
+
## 📄 License
|
|
416
|
+
|
|
417
|
+
MIT © Centive
|
|
418
|
+
|
|
419
|
+
## 🆘 Support
|
|
420
|
+
|
|
421
|
+
- 📚 [Anam AI Documentation](https://docs.anam.ai/)
|
|
422
|
+
- 🐛 [GitHub Issues](https://github.com/centive/aria-sdk/issues)
|
|
423
|
+
|
|
424
|
+
## 🙏 Acknowledgments
|
|
425
|
+
|
|
426
|
+
Built with:
|
|
427
|
+
- [Anam AI](https://anam.ai/) - AI persona platform
|
|
428
|
+
- [Shad/CN UI](https://ui.shadcn.com/) - UI components
|
|
429
|
+
- [Tailwind CSS](https://tailwindcss.com/) - Styling
|
|
430
|
+
- [Lucide Icons](https://lucide.dev/) - Icons
|
|
431
|
+
- [React](https://react.dev/) - UI framework
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
**Made with ❤️ by Centive**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '@/components/ui/button';
|
|
3
|
+
interface AriaTriggerButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
4
|
+
label?: string;
|
|
5
|
+
showIcon?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AriaTriggerButton: React.FC<AriaTriggerButtonProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=AnamTriggerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnamTriggerButton.d.ts","sourceRoot":"","sources":["../../src/components/AnamTriggerButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,UAAU,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAsB9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaAssistant.d.ts","sourceRoot":"","sources":["../../src/components/AriaAssistant.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAkBjC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '@/components/ui/button';
|
|
3
|
+
interface AriaTriggerButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
4
|
+
label?: string;
|
|
5
|
+
showIcon?: boolean;
|
|
6
|
+
showAvatar?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const AriaTriggerButton: React.FC<AriaTriggerButtonProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=AriaTriggerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaTriggerButton.d.ts","sourceRoot":"","sources":["../../src/components/AriaTriggerButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,UAAU,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAiE9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaWidget.d.ts","sourceRoot":"","sources":["../../src/components/AriaWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAQjD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgOhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EA4J7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionInfo.d.ts","sourceRoot":"","sources":["../../src/components/SessionInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4IlD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'success';
|
|
4
|
+
}
|
|
5
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Badge };
|
|
7
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAA;CAC1E;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAmBtE;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
4
|
+
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
5
|
+
}
|
|
6
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export { Button };
|
|
8
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IAChF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;CACxC;AAED,QAAA,MAAM,MAAM,uFA4BX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
9
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,IAAI,6GAYR,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,QAAA,MAAM,SAAS,uHAYb,CAAA;AAGF,QAAA,MAAM,eAAe,yHASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAKf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface DialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface DialogContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const Dialog: ({ open, onOpenChange, children }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DialogHeader: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const DialogClose: {
|
|
18
|
+
({ className, onClick, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export { Dialog, DialogContent, DialogHeader, DialogTitle, DialogClose };
|
|
22
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,QAAA,MAAM,MAAM,GAAI,kCAAkC,WAAW,4CAc5D,CAAA;AAED,QAAA,MAAM,aAAa,2FAalB,CAAA;AAGD,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,WAAW,qHAYf,CAAA;AAGF,QAAA,MAAM,WAAW;uCAId,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;;CAY/C,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
}
|
|
4
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export { Input };
|
|
6
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAExD,QAAA,MAAM,KAAK,qFAcV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ChatMessage, AriaSDKConfig, DisplayMode, TriggerMode, Theme, SessionState } from '@/types';
|
|
2
|
+
export interface AriaContextType {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
isConnected: boolean;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
chatMessages: ChatMessage[];
|
|
7
|
+
liveTranscript: string;
|
|
8
|
+
isChatVisible: boolean;
|
|
9
|
+
isMuted: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
sessionState: SessionState;
|
|
12
|
+
openAssistant: (mode: TriggerMode) => void;
|
|
13
|
+
closeAssistant: () => void;
|
|
14
|
+
toggleChat: () => void;
|
|
15
|
+
sendMessage: (message: string) => Promise<void>;
|
|
16
|
+
toggleMute: () => void;
|
|
17
|
+
startSession: () => Promise<void>;
|
|
18
|
+
stopSession: () => Promise<void>;
|
|
19
|
+
triggerSession: () => void;
|
|
20
|
+
displayMode: DisplayMode;
|
|
21
|
+
triggerMode: TriggerMode;
|
|
22
|
+
theme: Theme;
|
|
23
|
+
config: AriaSDKConfig;
|
|
24
|
+
}
|
|
25
|
+
export declare const AriaContext: import("react").Context<AriaContextType | null>;
|
|
26
|
+
//# sourceMappingURL=AriaContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaContext.d.ts","sourceRoot":"","sources":["../../src/context/AriaContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzG,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,iDAA8C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AriaSDKConfig } from '@/types';
|
|
3
|
+
interface AriaProviderProps {
|
|
4
|
+
config: AriaSDKConfig;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const AriaProvider: React.FC<AriaProviderProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=AriaProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaProvider.d.ts","sourceRoot":"","sources":["../../src/context/AriaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,UAAU,iBAAiB;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2dpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAria.d.ts","sourceRoot":"","sources":["../../src/hooks/useAria.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,eAAO,MAAM,OAAO,QAAO,eAM1B,CAAC"}
|