@odin-ai/sdk 1.0.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +470 -0
  3. package/dist/BaseClient.d.ts +54 -0
  4. package/dist/BaseClient.d.ts.map +1 -0
  5. package/dist/ChatSDK.d.ts +93 -0
  6. package/dist/ChatSDK.d.ts.map +1 -0
  7. package/dist/SmartTablesSDK.d.ts +397 -0
  8. package/dist/SmartTablesSDK.d.ts.map +1 -0
  9. package/dist/VoiceSDK.d.ts +73 -0
  10. package/dist/VoiceSDK.d.ts.map +1 -0
  11. package/dist/WorkflowSDK.d.ts +188 -0
  12. package/dist/WorkflowSDK.d.ts.map +1 -0
  13. package/dist/examples/basic-chat.d.ts +2 -0
  14. package/dist/examples/basic-chat.d.ts.map +1 -0
  15. package/dist/examples/react-integration.d.ts +7 -0
  16. package/dist/examples/react-integration.d.ts.map +1 -0
  17. package/dist/examples/smart-tables-basic.d.ts +2 -0
  18. package/dist/examples/smart-tables-basic.d.ts.map +1 -0
  19. package/dist/examples/smart-tables-comprehensive.d.ts +2 -0
  20. package/dist/examples/smart-tables-comprehensive.d.ts.map +1 -0
  21. package/dist/examples/smart-tables-demo.d.ts +2 -0
  22. package/dist/examples/smart-tables-demo.d.ts.map +1 -0
  23. package/dist/examples/smart-tables-import.d.ts +2 -0
  24. package/dist/examples/smart-tables-import.d.ts.map +1 -0
  25. package/dist/examples/streaming-chat.d.ts +2 -0
  26. package/dist/examples/streaming-chat.d.ts.map +1 -0
  27. package/dist/index.d.ts +14 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.esm.js +2281 -0
  30. package/dist/index.esm.js.map +1 -0
  31. package/dist/index.js +2295 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/src/BaseClient.d.ts +48 -0
  34. package/dist/src/BaseClient.d.ts.map +1 -0
  35. package/dist/src/ChatSDK.d.ts +91 -0
  36. package/dist/src/ChatSDK.d.ts.map +1 -0
  37. package/dist/src/SmartTablesSDK.d.ts +312 -0
  38. package/dist/src/SmartTablesSDK.d.ts.map +1 -0
  39. package/dist/src/components/MessageBubble.d.ts +24 -0
  40. package/dist/src/components/MessageBubble.d.ts.map +1 -0
  41. package/dist/src/components/MessageList.d.ts +28 -0
  42. package/dist/src/components/MessageList.d.ts.map +1 -0
  43. package/dist/src/components/index.d.ts +4 -0
  44. package/dist/src/components/index.d.ts.map +1 -0
  45. package/dist/src/index.d.ts +10 -0
  46. package/dist/src/index.d.ts.map +1 -0
  47. package/dist/src/types.d.ts +348 -0
  48. package/dist/src/types.d.ts.map +1 -0
  49. package/dist/types.d.ts +262 -0
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/useVoiceConversation.d.ts +34 -0
  52. package/dist/useVoiceConversation.d.ts.map +1 -0
  53. package/dist/voice-types.d.ts +169 -0
  54. package/dist/voice-types.d.ts.map +1 -0
  55. package/dist/workflow-types.d.ts +431 -0
  56. package/dist/workflow-types.d.ts.map +1 -0
  57. package/package.json +78 -0
@@ -0,0 +1,348 @@
1
+ import { BaseClientConfig } from './BaseClient';
2
+ /**
3
+ * Configuration for the Chat SDK
4
+ *
5
+ * Authentication options:
6
+ * 1. For external SDK usage: Provide apiKey and apiSecret
7
+ * 2. For web app usage: Provide accessToken
8
+ */
9
+ export interface ChatSDKConfig extends BaseClientConfig {
10
+ }
11
+ /**
12
+ * Chat object representing a conversation
13
+ */
14
+ export interface Chat {
15
+ /** Unique chat identifier */
16
+ id: string;
17
+ /** Display name of the chat */
18
+ name: string;
19
+ /** Unix timestamp when chat was created */
20
+ created_at: number;
21
+ /** Unix timestamp when chat was last updated */
22
+ updated_at: number;
23
+ /** Document keys associated with this chat for knowledge base context */
24
+ document_keys?: string[];
25
+ /** Custom agent ID if using a specific agent */
26
+ custom_agent?: string;
27
+ /** Additional metadata for the chat */
28
+ metadata?: Record<string, any>;
29
+ /** User ID who created the chat */
30
+ created_by: string;
31
+ /** Type of agent used in this chat */
32
+ agent_type?: string;
33
+ }
34
+ /**
35
+ * File metadata for uploaded files
36
+ */
37
+ export interface FileMetadata {
38
+ /** Original filename */
39
+ file_name: string;
40
+ /** MIME type of the file */
41
+ type: string;
42
+ /** Upload timestamp */
43
+ timestamp?: number;
44
+ /** Whether this file has been sent in a message */
45
+ message_sent?: boolean;
46
+ /** Chat ID this file belongs to */
47
+ chat_id?: string;
48
+ /** Project ID this file belongs to */
49
+ project_id?: string;
50
+ }
51
+ /**
52
+ * Message object representing a single message in a chat
53
+ */
54
+ export interface Message {
55
+ /** Unique message identifier */
56
+ id: string;
57
+ /** User's input message */
58
+ message: string;
59
+ /** AI's response to the message */
60
+ response?: string;
61
+ /** Unix timestamp when message was created */
62
+ created_at: number;
63
+ /** User feedback on the response (true = thumbs up, false = thumbs down) */
64
+ user_feedback?: boolean | null;
65
+ /** Metadata about uploaded files */
66
+ files_metadata?: FileMetadata[];
67
+ /** Response cards for structured responses */
68
+ response_cards?: any[];
69
+ /** Source URLs or documents used in the response */
70
+ sources?: string[];
71
+ /** URLs of generated or referenced images */
72
+ image_urls?: string[];
73
+ /** Name of the user who sent the message */
74
+ user_name?: string;
75
+ /** Error message if the message failed */
76
+ error_message?: string;
77
+ /** Whether this message was sent from an automator */
78
+ sent_from_automator?: boolean;
79
+ /** Generated SQL queries if applicable */
80
+ generated_sql?: any[];
81
+ /** UI form data for interactive responses */
82
+ ui_form?: Record<string, any>;
83
+ /** Images attached to the user's message */
84
+ message_images?: string[];
85
+ /** Chain of thought reasoning */
86
+ chain_of_thought?: string;
87
+ /** Actions performed by the AI */
88
+ actions?: Array<{
89
+ action: string;
90
+ action_input: string;
91
+ }>;
92
+ /** Citation sources for the response */
93
+ citation_source?: any;
94
+ /** Entity mapping for PII masking */
95
+ entity_map?: Record<string, any>;
96
+ /** Alternative responses generated */
97
+ alt_responses?: string[];
98
+ /** JSON response data */
99
+ json_response?: any;
100
+ /** Advanced context query metadata */
101
+ advanced_context_query_metadata?: {
102
+ intent?: string;
103
+ };
104
+ }
105
+ /**
106
+ * Options for sending a message
107
+ */
108
+ export interface SendMessageOptions {
109
+ /** Chat ID to send the message to (if not provided, creates a new chat) */
110
+ chatId?: string;
111
+ /** Type of agent to use */
112
+ agentType?: 'chat_agent' | 'document_agent' | 'meeting_agent' | 'app_builder_agent' | 'data_view_agent';
113
+ /** Specific agent ID to use */
114
+ agentId?: string;
115
+ /** Document keys for knowledge base context */
116
+ documentKeys?: string[];
117
+ /** Image files to upload with the message */
118
+ images?: File[];
119
+ /** Additional metadata to include with the request */
120
+ metadata?: Record<string, any>;
121
+ /** AI model to use for the response */
122
+ modelName?: string;
123
+ /** Whether to use the knowledge base for context */
124
+ useKnowledgebase?: boolean;
125
+ /** Whether this is a test message */
126
+ isTest?: boolean;
127
+ /** Whether to enable Google search */
128
+ googleSearch?: boolean;
129
+ /** Format instructions for the response */
130
+ formatInstructions?: string;
131
+ /** Whether to ignore chat history */
132
+ ignoreChatHistory?: boolean;
133
+ /** Example JSON for structured responses */
134
+ exampleJson?: string;
135
+ /** Whether to skip streaming */
136
+ skipStream?: boolean;
137
+ }
138
+ /**
139
+ * Callbacks for streaming message responses
140
+ */
141
+ export interface StreamCallbacks {
142
+ /** Called when a text chunk is received */
143
+ onChunk?: (chunk: string) => void;
144
+ /** Called when a structured message object is received */
145
+ onMessageObject?: (messageObject: any) => void;
146
+ /** Called when the message is complete */
147
+ onComplete?: (message: Message) => void;
148
+ /** Called when an error occurs */
149
+ onError?: (error: Error) => void;
150
+ /** Called when the chat name is updated */
151
+ onChatNameUpdate?: (chatName: string) => void;
152
+ /** Called when a document chunk is received */
153
+ onDocumentChunk?: (chunk: string) => void;
154
+ /** Called when the message ends (msmro signal) */
155
+ onMessageEnd?: () => void;
156
+ }
157
+ /**
158
+ * Response from creating a chat
159
+ */
160
+ export interface CreateChatResponse {
161
+ /** Display name of the created chat */
162
+ name: string;
163
+ /** Unique identifier of the created chat */
164
+ chat_id: string;
165
+ /** Additional metadata */
166
+ metadata?: Record<string, any>;
167
+ /** Document keys associated with the chat */
168
+ document_keys?: string[];
169
+ /** Document ID if created from a document */
170
+ document_id?: string;
171
+ /** Unix timestamp when chat was created */
172
+ created_at: number;
173
+ /** Custom agent ID if specified */
174
+ custom_agent?: string;
175
+ }
176
+ /**
177
+ * Response from sending a message
178
+ */
179
+ export interface SendMessageResponse {
180
+ /** The complete message object */
181
+ message: Record<string, any>;
182
+ /** Chat ID where the message was sent */
183
+ chat_id: string;
184
+ /** Unique identifier of the sent message */
185
+ message_id: string;
186
+ }
187
+ /**
188
+ * Response from listing chats
189
+ */
190
+ export interface ListChatsResponse {
191
+ /** Array of chat objects */
192
+ chats: Chat[];
193
+ /** Cursor for the next page of results */
194
+ next_cursor?: number;
195
+ /** Whether there are more chats to fetch */
196
+ has_more: boolean;
197
+ }
198
+ /**
199
+ * Response from getting chat history
200
+ */
201
+ export interface ChatHistoryResponse {
202
+ /** Chat ID */
203
+ id: string;
204
+ /** Chat metadata */
205
+ metadata?: Record<string, any>;
206
+ /** Unix timestamp when chat was created */
207
+ created_at?: number;
208
+ /** Array of messages in the chat */
209
+ messages?: Message[];
210
+ /** Display name of the chat */
211
+ name?: string;
212
+ /** Document ID if this is a document chat */
213
+ document_id?: string;
214
+ /** Document keys for knowledge base context */
215
+ document_keys?: string[];
216
+ /** Custom agent ID if using a specific agent */
217
+ custom_agent?: string;
218
+ /** File metadata for uploaded files */
219
+ chat_files_metadata?: FileMetadata[];
220
+ /** Debug information for prompt engineering */
221
+ debug_prompt_info?: Record<string, any>;
222
+ }
223
+ /**
224
+ * Error response from the API
225
+ */
226
+ export interface APIError {
227
+ /** Error message */
228
+ message: string;
229
+ /** HTTP status code */
230
+ status: number;
231
+ /** Additional error details */
232
+ detail?: string;
233
+ }
234
+ /**
235
+ * Agent types supported by the system
236
+ */
237
+ export type AgentType = 'chat_agent' | 'document_agent' | 'meeting_agent' | 'app_builder_agent' | 'data_view_agent';
238
+ /**
239
+ * Model names supported by the system
240
+ */
241
+ export type ModelName = 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4' | 'gpt-3.5-turbo' | 'claude-3-opus' | 'claude-3-sonnet' | 'claude-3-haiku';
242
+ /**
243
+ * Message response type used in chat components
244
+ */
245
+ export interface MessageResponseType {
246
+ id?: string;
247
+ message_id?: string;
248
+ message?: string;
249
+ response?: string;
250
+ created_at: number;
251
+ chat_id?: string;
252
+ project_id: string;
253
+ extracted_answer?: string;
254
+ sources?: string[];
255
+ image_urls?: string[];
256
+ response_cards?: any[];
257
+ error?: string;
258
+ ui_form?: any;
259
+ agent_id?: string;
260
+ msmro?: boolean;
261
+ enriched_sources?: any[];
262
+ user_feedback?: boolean | null;
263
+ user_name?: string;
264
+ files_metadata?: FileMetadata[];
265
+ message_images?: string[];
266
+ sent_from_automator?: boolean;
267
+ generated_sql?: any[];
268
+ chain_of_thought?: string;
269
+ actions?: any[];
270
+ citation_source?: any;
271
+ entity_map?: Record<string, any>;
272
+ alt_responses?: string[];
273
+ json_response?: any;
274
+ advanced_context_query_metadata?: {
275
+ intent?: string;
276
+ };
277
+ metadata?: any;
278
+ }
279
+ /**
280
+ * Project type used in chat components
281
+ */
282
+ export interface ProjectType {
283
+ id: string;
284
+ name?: string;
285
+ custom_chatbot?: {
286
+ welcomeMessage?: string;
287
+ primaryColor?: string;
288
+ fontSize?: number;
289
+ displaySources?: boolean;
290
+ textColor?: string;
291
+ };
292
+ }
293
+ /**
294
+ * Chat type used in components
295
+ */
296
+ export interface ChatType {
297
+ id: string;
298
+ name: string;
299
+ created_at: number;
300
+ updated_at: number;
301
+ created_by: string;
302
+ agent_type: string;
303
+ metadata: any;
304
+ document_keys: string[];
305
+ document_id: string;
306
+ use_knowledgebase: boolean;
307
+ custom_agent?: string;
308
+ context?: any;
309
+ }
310
+ export interface ChatComponentProps {
311
+ type: "ai" | "human";
312
+ id: string;
313
+ message: MessageResponseType;
314
+ chatId?: string;
315
+ isLastMessage?: boolean;
316
+ className?: string;
317
+ customStyles?: Record<string, any>;
318
+ }
319
+ export interface MessageListProps {
320
+ messages: MessageResponseType[];
321
+ chatId?: string;
322
+ className?: string;
323
+ showWelcomeMessage?: boolean;
324
+ welcomeMessage?: string;
325
+ onMessageAction?: (action: string, messageId: string) => void;
326
+ }
327
+ export interface ChatContextState {
328
+ messages: MessageResponseType[];
329
+ loading: boolean;
330
+ messagesLoading: boolean;
331
+ chatId: string | null;
332
+ selectedProject: ProjectType | null;
333
+ messageSent: boolean;
334
+ searchText: string;
335
+ }
336
+ export interface ChatActions {
337
+ setMessages: (messages: MessageResponseType[]) => void;
338
+ setLoading: (loading: boolean) => void;
339
+ setMessagesLoading: (loading: boolean) => void;
340
+ setChatId: (chatId: string | null) => void;
341
+ setSearchText: (text: string) => void;
342
+ handleSubmit: (params: {
343
+ event: any;
344
+ query: string;
345
+ }) => Promise<void>;
346
+ createNewChat: () => Promise<void>;
347
+ }
348
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,aAAc,SAAQ,gBAAgB;CAAG;AAE1D;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,mCAAmC;IACnC,UAAU,E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Config } from './BaseClient';
2
+ /**
3
+ * Configuration for the Chat SDK
4
+ *
5
+ * Authentication options:
6
+ * 1. For external SDK usage: Provide apiKey and apiSecret
7
+ * 2. For web app usage: Provide accessToken
8
+ */
9
+ export interface ChatSDKConfig extends BaseClientConfig {
10
+ }
11
+ /**
12
+ * Chat object representing a conversation
13
+ */
14
+ export interface Chat {
15
+ /** Unique chat identifier */
16
+ id: string;
17
+ /** Display name of the chat */
18
+ name: string;
19
+ /** Unix timestamp when chat was created */
20
+ created_at: number;
21
+ /** Unix timestamp when chat was last updated */
22
+ updated_at: number;
23
+ /** Document keys associated with this chat for knowledge base context */
24
+ document_keys?: string[];
25
+ /** Custom agent ID if using a specific agent */
26
+ custom_agent?: string;
27
+ /** Additional metadata for the chat */
28
+ metadata?: Record<string, any>;
29
+ /** User ID who created the chat */
30
+ created_by: string;
31
+ /** Type of agent used in this chat */
32
+ agent_type?: string;
33
+ }
34
+ /**
35
+ * File metadata for uploaded files
36
+ */
37
+ export interface FileMetadata {
38
+ /** Original filename */
39
+ file_name: string;
40
+ /** MIME type of the file */
41
+ type: string;
42
+ /** Upload timestamp */
43
+ timestamp?: number;
44
+ /** Whether this file has been sent in a message */
45
+ message_sent?: boolean;
46
+ /** Chat ID this file belongs to */
47
+ chat_id?: string;
48
+ /** Project ID this file belongs to */
49
+ project_id?: string;
50
+ }
51
+ /**
52
+ * Message object representing a single message in a chat
53
+ */
54
+ export interface Message {
55
+ /** Unique message identifier */
56
+ id: string;
57
+ /** User's input message */
58
+ message: string;
59
+ /** AI's response to the message */
60
+ response?: string;
61
+ /** Raw final AI message content (unprocessed) */
62
+ final_response?: string;
63
+ /** AI's thinking process structured as segments with action context */
64
+ thinking_response?: Array<{
65
+ thinking: string;
66
+ action_context: "before_action" | "after_action" | "reasoning" | "final_reasoning";
67
+ related_action_ids?: string[];
68
+ timestamp: number;
69
+ }>;
70
+ /** Unix timestamp when message was created */
71
+ created_at: number;
72
+ /** User feedback on the response (true = thumbs up, false = thumbs down) */
73
+ user_feedback?: boolean | null;
74
+ /** Metadata about uploaded files */
75
+ files_metadata?: FileMetadata[];
76
+ /** Response cards for structured responses */
77
+ response_cards?: any[];
78
+ /** Source URLs or documents used in the response */
79
+ sources?: string[];
80
+ /** URLs of generated or referenced images */
81
+ image_urls?: string[];
82
+ /** Name of the user who sent the message */
83
+ user_name?: string;
84
+ /** Error message if the message failed */
85
+ error_message?: string;
86
+ /** Whether this message was sent from an automator */
87
+ sent_from_automator?: boolean;
88
+ /** Generated SQL queries if applicable */
89
+ generated_sql?: any[];
90
+ /** UI form data for interactive responses */
91
+ ui_form?: Record<string, any>;
92
+ /** Images attached to the user's message */
93
+ message_images?: string[];
94
+ /** Chain of thought reasoning */
95
+ chain_of_thought?: string;
96
+ /** Actions performed by the AI */
97
+ actions?: Array<{
98
+ action: string;
99
+ action_input: string;
100
+ }>;
101
+ /** Citation sources for the response */
102
+ citation_source?: any;
103
+ /** Entity mapping for PII masking */
104
+ entity_map?: Record<string, any>;
105
+ /** Alternative responses generated */
106
+ alt_responses?: string[];
107
+ /** JSON response data */
108
+ json_response?: any;
109
+ /** Advanced context query metadata */
110
+ advanced_context_query_metadata?: {
111
+ intent?: string;
112
+ };
113
+ }
114
+ /**
115
+ * Options for sending a message
116
+ */
117
+ export interface SendMessageOptions {
118
+ /** Chat ID to send the message to (if not provided, creates a new chat) */
119
+ chatId?: string;
120
+ /** Type of agent to use */
121
+ agentType?: 'chat_agent' | 'document_agent' | 'meeting_agent' | 'app_builder_agent' | 'data_view_agent';
122
+ /** Specific agent ID to use */
123
+ agentId?: string;
124
+ /** Document keys for knowledge base context */
125
+ documentKeys?: string[];
126
+ /** Active knowledge base project IDs (for multi-KB support) */
127
+ activeKnowledgeBases?: string[];
128
+ /** Image files to upload with the message */
129
+ images?: File[];
130
+ /** Additional metadata to include with the request */
131
+ metadata?: Record<string, any>;
132
+ /** AI model to use for the response */
133
+ modelName?: string;
134
+ /** Whether to use the knowledge base for context */
135
+ useKnowledgebase?: boolean;
136
+ /** Whether this is a test message */
137
+ isTest?: boolean;
138
+ /** Whether to enable Google search */
139
+ googleSearch?: boolean;
140
+ /** Format instructions for the response */
141
+ formatInstructions?: string;
142
+ /** Whether to ignore chat history */
143
+ ignoreChatHistory?: boolean;
144
+ /** Example JSON for structured responses */
145
+ exampleJson?: string;
146
+ /** Whether to skip streaming */
147
+ skipStream?: boolean;
148
+ }
149
+ /**
150
+ * Callbacks for streaming message responses
151
+ */
152
+ export interface StreamCallbacks {
153
+ /** Called when streaming begins with the actual message ID */
154
+ onStart?: (messageId: string) => void;
155
+ /** Called when chat_id and message_id are provided via a dedicated streaming tag */
156
+ onMeta?: (meta: {
157
+ chat_id: string;
158
+ message_id: string;
159
+ }) => void;
160
+ /** Called when a text chunk is received */
161
+ onChunk?: (chunk: string) => void;
162
+ /** Called when a structured message object is received */
163
+ onMessageObject?: (messageObject: any) => void;
164
+ /** Called when the message is complete */
165
+ onComplete?: (message: Message) => void;
166
+ /** Called when an error occurs */
167
+ onError?: (error: Error) => void;
168
+ /** Called when the chat name is updated */
169
+ onChatNameUpdate?: (chatName: string) => void;
170
+ /** Called when a document chunk is received */
171
+ onDocumentChunk?: (chunk: string) => void;
172
+ /** Called when a document event is received */
173
+ onDocumentEventReceived?: (event: any) => void;
174
+ /** Called when the message ends (msmro signal) */
175
+ onMessageEnd?: () => void;
176
+ }
177
+ /**
178
+ * Response from creating a chat
179
+ */
180
+ export interface CreateChatResponse {
181
+ /** Display name of the created chat */
182
+ name: string;
183
+ /** Unique identifier of the created chat */
184
+ chat_id: string;
185
+ /** Additional metadata */
186
+ metadata?: Record<string, any>;
187
+ /** Document keys associated with the chat */
188
+ document_keys?: string[];
189
+ /** Document ID if created from a document */
190
+ document_id?: string;
191
+ /** Unix timestamp when chat was created */
192
+ created_at: number;
193
+ /** Custom agent ID if specified */
194
+ custom_agent?: string;
195
+ }
196
+ /**
197
+ * Response from sending a message
198
+ */
199
+ export interface SendMessageResponse {
200
+ /** The complete message object */
201
+ message: Record<string, any>;
202
+ /** Chat ID where the message was sent */
203
+ chat_id: string;
204
+ /** Unique identifier of the sent message */
205
+ message_id: string;
206
+ }
207
+ /**
208
+ * Response from listing chats
209
+ */
210
+ export interface ListChatsResponse {
211
+ /** Array of chat objects */
212
+ chats: Chat[];
213
+ /** Cursor for the next page of results */
214
+ next_cursor?: number;
215
+ /** Whether there are more chats to fetch */
216
+ has_more: boolean;
217
+ }
218
+ /**
219
+ * Response from getting chat history
220
+ */
221
+ export interface ChatHistoryResponse {
222
+ /** Chat ID */
223
+ id: string;
224
+ /** Chat metadata */
225
+ metadata?: Record<string, any>;
226
+ /** Unix timestamp when chat was created */
227
+ created_at?: number;
228
+ /** Array of messages in the chat */
229
+ messages?: Message[];
230
+ /** Display name of the chat */
231
+ name?: string;
232
+ /** Document ID if this is a document chat */
233
+ document_id?: string;
234
+ /** Document keys for knowledge base context */
235
+ document_keys?: string[];
236
+ /** Custom agent ID if using a specific agent */
237
+ custom_agent?: string;
238
+ /** File metadata for uploaded files */
239
+ chat_files_metadata?: FileMetadata[];
240
+ /** Debug information for prompt engineering */
241
+ debug_prompt_info?: Record<string, any>;
242
+ }
243
+ /**
244
+ * Error response from the API
245
+ */
246
+ export interface APIError {
247
+ /** Error message */
248
+ message: string;
249
+ /** HTTP status code */
250
+ status: number;
251
+ /** Additional error details */
252
+ detail?: string;
253
+ }
254
+ /**
255
+ * Agent types supported by the system
256
+ */
257
+ export type AgentType = 'chat_agent' | 'document_agent' | 'meeting_agent' | 'app_builder_agent' | 'data_view_agent';
258
+ /**
259
+ * Model names supported by the system
260
+ */
261
+ export type ModelName = 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4' | 'gpt-3.5-turbo' | 'claude-3-opus' | 'claude-3-sonnet' | 'claude-3-haiku';
262
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,E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ChB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,aAAa,GACb,OAAO,GACP,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,gBAAgB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { VoiceHookOptions, VoiceConversationState, VoiceSessionConfig, VoiceSDKConfig } from './voice-types';
2
+ import { VoiceSDK } from './VoiceSDK';
3
+ /**
4
+ * Enhanced useVoiceConversation hook with our SDK's chat integration and session management
5
+ */
6
+ export declare function useVoiceConversation(options?: VoiceHookOptions): {
7
+ startSession: (config?: VoiceSessionConfig & {
8
+ sdkConfig?: VoiceSDKConfig;
9
+ }) => Promise<string>;
10
+ endSession: () => Promise<void>;
11
+ setVolume: ({ volume }: {
12
+ volume: number;
13
+ }) => void;
14
+ getInputByteFrequencyData: () => Uint8Array<ArrayBufferLike>;
15
+ getOutputByteFrequencyData: () => Uint8Array<ArrayBufferLike>;
16
+ getInputVolume: () => number;
17
+ getOutputVolume: () => number;
18
+ sendContextualUpdate: (text: string) => void;
19
+ sendUserMessage: (text: string) => void;
20
+ sendUserActivity: () => void;
21
+ sendMCPToolApprovalResult: (toolCallId: string, isApproved: boolean) => void;
22
+ sendFeedback: (like: boolean) => void;
23
+ canSendFeedback: boolean;
24
+ status: import("@elevenlabs/react").Status;
25
+ micMuted: boolean;
26
+ isSpeaking: boolean;
27
+ getId: () => string | undefined;
28
+ currentSessionId: string;
29
+ conversationState: VoiceConversationState;
30
+ getConversationHistory: () => import("./voice-types").VoiceMessage[];
31
+ getVoiceState: () => VoiceConversationState;
32
+ voiceSDK: VoiceSDK;
33
+ };
34
+ //# sourceMappingURL=useVoiceConversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVoiceConversation.d.ts","sourceRoot":"","sources":["../src/useVoiceConversation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAElB,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,gBAAqB;4BAiGhB,kBAAkB,GAAG;QAAE,SAAS,CAAC,EAAE,cAAc,CAAA;KAAE;;4BAoDzD;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;iCA6Eb,MAAM;;;;;;;;;;;;;;;EA8EvD"}