@bytexbyte/nxtlinq-ai-agent-ui-react-development 0.1.1
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/NxtlinqAgentChat.d.ts +26 -0
- package/dist/NxtlinqAgentChat.d.ts.map +1 -0
- package/dist/NxtlinqAgentChat.js +28 -0
- package/dist/components/AgentAssistantShell.d.ts +5 -0
- package/dist/components/AgentAssistantShell.d.ts.map +1 -0
- package/dist/components/AgentAssistantShell.js +52 -0
- package/dist/components/AgentComposer.d.ts +3 -0
- package/dist/components/AgentComposer.d.ts.map +1 -0
- package/dist/components/AgentComposer.js +60 -0
- package/dist/components/AgentMessageList.d.ts +3 -0
- package/dist/components/AgentMessageList.d.ts.map +1 -0
- package/dist/components/AgentMessageList.js +37 -0
- package/dist/components/AgentRemoteAudio.d.ts +4 -0
- package/dist/components/AgentRemoteAudio.d.ts.map +1 -0
- package/dist/components/AgentRemoteAudio.js +34 -0
- package/dist/components/AgentVoiceBar.d.ts +3 -0
- package/dist/components/AgentVoiceBar.d.ts.map +1 -0
- package/dist/components/AgentVoiceBar.js +91 -0
- package/dist/components/PresetMessageChips.d.ts +3 -0
- package/dist/components/PresetMessageChips.d.ts.map +1 -0
- package/dist/components/PresetMessageChips.js +23 -0
- package/dist/context/AgentAssistantContext.d.ts +32 -0
- package/dist/context/AgentAssistantContext.d.ts.map +1 -0
- package/dist/context/AgentAssistantContext.js +159 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.d.ts +2 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.d.ts.map +1 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.js +1 -0
- package/dist/legacy/chatbot/ChatBot.d.ts +5 -0
- package/dist/legacy/chatbot/ChatBot.d.ts.map +1 -0
- package/dist/legacy/chatbot/ChatBot.js +35 -0
- package/dist/legacy/chatbot/context/ChatBotContext.d.ts +5 -0
- package/dist/legacy/chatbot/context/ChatBotContext.d.ts.map +1 -0
- package/dist/legacy/chatbot/context/ChatBotContext.js +2908 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.d.ts +166 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.d.ts.map +1 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.js +1 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.d.ts +17 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.js +110 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.d.ts +3 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.js +625 -0
- package/dist/legacy/chatbot/ui/MessageInput.d.ts +3 -0
- package/dist/legacy/chatbot/ui/MessageInput.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/MessageInput.js +321 -0
- package/dist/legacy/chatbot/ui/MessageList.d.ts +4 -0
- package/dist/legacy/chatbot/ui/MessageList.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/MessageList.js +455 -0
- package/dist/legacy/chatbot/ui/ModelSelector.d.ts +4 -0
- package/dist/legacy/chatbot/ui/ModelSelector.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/ModelSelector.js +122 -0
- package/dist/legacy/chatbot/ui/NotificationModal.d.ts +15 -0
- package/dist/legacy/chatbot/ui/NotificationModal.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/NotificationModal.js +53 -0
- package/dist/legacy/chatbot/ui/PermissionForm.d.ts +8 -0
- package/dist/legacy/chatbot/ui/PermissionForm.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/PermissionForm.js +465 -0
- package/dist/legacy/chatbot/ui/PresetMessages.d.ts +4 -0
- package/dist/legacy/chatbot/ui/PresetMessages.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/PresetMessages.js +33 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.d.ts +3 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.js +95 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.d.ts +73 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.js +985 -0
- package/dist/legacy/index.d.ts +14 -0
- package/dist/legacy/index.d.ts.map +1 -0
- package/dist/legacy/index.js +12 -0
- package/dist/theme/defaultTheme.d.ts +3 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +20 -0
- package/dist/types.d.ts +62 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/voice/useVoiceConnectOrchestration.d.ts +21 -0
- package/dist/voice/useVoiceConnectOrchestration.d.ts.map +1 -0
- package/dist/voice/useVoiceConnectOrchestration.js +86 -0
- package/dist/voice/useVoiceMicState.d.ts +15 -0
- package/dist/voice/useVoiceMicState.d.ts.map +1 -0
- package/dist/voice/useVoiceMicState.js +94 -0
- package/dist/voice/useVoiceSilenceCommit.d.ts +10 -0
- package/dist/voice/useVoiceSilenceCommit.d.ts.map +1 -0
- package/dist/voice/useVoiceSilenceCommit.js +67 -0
- package/dist/voice/useVoiceTranscriptMessages.d.ts +16 -0
- package/dist/voice/useVoiceTranscriptMessages.d.ts.map +1 -0
- package/dist/voice/useVoiceTranscriptMessages.js +129 -0
- package/dist/voice/useWsRealtimeAudio.d.ts +18 -0
- package/dist/voice/useWsRealtimeAudio.d.ts.map +1 -0
- package/dist/voice/useWsRealtimeAudio.js +102 -0
- package/dist/voice/voiceMicConstants.d.ts +4 -0
- package/dist/voice/voiceMicConstants.d.ts.map +1 -0
- package/dist/voice/voiceMicConstants.js +10 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.d.ts +23 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.d.ts.map +1 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.js +137 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.d.ts +17 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.d.ts.map +1 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.js +71 -0
- package/dist/voice/ws/float32ToPcm16.d.ts +2 -0
- package/dist/voice/ws/float32ToPcm16.d.ts.map +1 -0
- package/dist/voice/ws/float32ToPcm16.js +8 -0
- package/dist/voice/ws/voiceSilenceConstants.d.ts +5 -0
- package/dist/voice/ws/voiceSilenceConstants.d.ts.map +1 -0
- package/dist/voice/ws/voiceSilenceConstants.js +4 -0
- package/dist/voice/ws/wsRealtimeConstants.d.ts +2 -0
- package/dist/voice/ws/wsRealtimeConstants.d.ts.map +1 -0
- package/dist/voice/ws/wsRealtimeConstants.js +1 -0
- package/package.json +60 -0
- package/src/NxtlinqAgentChat.tsx +79 -0
- package/src/components/AgentAssistantShell.tsx +104 -0
- package/src/components/AgentComposer.tsx +134 -0
- package/src/components/AgentMessageList.tsx +78 -0
- package/src/components/AgentRemoteAudio.tsx +34 -0
- package/src/components/AgentVoiceBar.tsx +173 -0
- package/src/components/PresetMessageChips.tsx +41 -0
- package/src/context/AgentAssistantContext.tsx +276 -0
- package/src/index.ts +78 -0
- package/src/legacy/assets/images/adiSideItalicDataUri.ts +1 -0
- package/src/legacy/chatbot/ChatBot.tsx +61 -0
- package/src/legacy/chatbot/context/ChatBotContext.tsx +3227 -0
- package/src/legacy/chatbot/types/ChatBotTypes.ts +195 -0
- package/src/legacy/chatbot/ui/BerifyMeModal.tsx +145 -0
- package/src/legacy/chatbot/ui/ChatBotUI.tsx +949 -0
- package/src/legacy/chatbot/ui/MessageInput.tsx +517 -0
- package/src/legacy/chatbot/ui/MessageList.tsx +764 -0
- package/src/legacy/chatbot/ui/ModelSelector.tsx +190 -0
- package/src/legacy/chatbot/ui/NotificationModal.tsx +110 -0
- package/src/legacy/chatbot/ui/PermissionForm.tsx +632 -0
- package/src/legacy/chatbot/ui/PresetMessages.tsx +50 -0
- package/src/legacy/chatbot/ui/VoiceModePanel.tsx +168 -0
- package/src/legacy/chatbot/ui/styles/isolatedStyles.ts +1058 -0
- package/src/legacy/index.ts +26 -0
- package/src/theme/defaultTheme.ts +22 -0
- package/src/types.ts +65 -0
- package/src/voice/useVoiceConnectOrchestration.ts +117 -0
- package/src/voice/useVoiceMicState.ts +117 -0
- package/src/voice/useVoiceTranscriptMessages.ts +173 -0
- package/src/voice/voiceMicConstants.ts +13 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import type { VoiceStatus } from '@bytexbyte/nxtlinq-ai-agent-core-development';
|
|
2
|
+
import {
|
|
3
|
+
useNxtlinqAgent,
|
|
4
|
+
useNxtlinqVoice,
|
|
5
|
+
type UseNxtlinqAgentResult,
|
|
6
|
+
type UseNxtlinqVoiceResult,
|
|
7
|
+
} from '@bytexbyte/nxtlinq-ai-agent-web-development';
|
|
8
|
+
import React, {
|
|
9
|
+
createContext,
|
|
10
|
+
useCallback,
|
|
11
|
+
useContext,
|
|
12
|
+
useEffect,
|
|
13
|
+
useMemo,
|
|
14
|
+
useState,
|
|
15
|
+
type ReactNode,
|
|
16
|
+
} from 'react';
|
|
17
|
+
import { defaultAgentAssistantTheme } from '../theme/defaultTheme';
|
|
18
|
+
import type { AgentAssistantTheme, NxtlinqAgentChatProps, PresetMessage } from '../types';
|
|
19
|
+
import { useVoiceConnectOrchestration } from '../voice/useVoiceConnectOrchestration';
|
|
20
|
+
import { useVoiceMicState } from '../voice/useVoiceMicState';
|
|
21
|
+
import { useVoiceTranscriptMessages } from '../voice/useVoiceTranscriptMessages';
|
|
22
|
+
|
|
23
|
+
export type InteractionMode = 'text' | 'voice';
|
|
24
|
+
|
|
25
|
+
export type AgentAssistantContextValue = UseNxtlinqAgentResult &
|
|
26
|
+
UseNxtlinqVoiceResult & {
|
|
27
|
+
theme: AgentAssistantTheme;
|
|
28
|
+
title: string;
|
|
29
|
+
placeholder: string;
|
|
30
|
+
presetMessages: PresetMessage[];
|
|
31
|
+
interactionMode: InteractionMode;
|
|
32
|
+
setInteractionMode: (mode: InteractionMode) => void;
|
|
33
|
+
inputText: string;
|
|
34
|
+
setInputText: (text: string) => void;
|
|
35
|
+
isVoiceAvailable: boolean;
|
|
36
|
+
isVoiceConnecting: boolean;
|
|
37
|
+
isMicMuted: boolean;
|
|
38
|
+
isMicHeldForAssistant: boolean;
|
|
39
|
+
toggleVoiceMicMute: () => void;
|
|
40
|
+
isVoiceChannelReady: boolean;
|
|
41
|
+
enableFileUpload: boolean;
|
|
42
|
+
sendText: () => Promise<void>;
|
|
43
|
+
selectPreset: (preset: PresetMessage) => Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const AgentAssistantContext = createContext<AgentAssistantContextValue | null>(null);
|
|
47
|
+
|
|
48
|
+
export type AgentAssistantProviderProps = {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
ui: Pick<
|
|
51
|
+
NxtlinqAgentChatProps,
|
|
52
|
+
| 'title'
|
|
53
|
+
| 'placeholder'
|
|
54
|
+
| 'presetMessages'
|
|
55
|
+
| 'enableVoice'
|
|
56
|
+
| 'enableFileUpload'
|
|
57
|
+
| 'theme'
|
|
58
|
+
| 'startWithMicMuted'
|
|
59
|
+
| 'holdMicDuringAssistant'
|
|
60
|
+
>;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export function AgentAssistantProvider({
|
|
64
|
+
children,
|
|
65
|
+
ui,
|
|
66
|
+
}: AgentAssistantProviderProps): React.ReactElement {
|
|
67
|
+
const agent = useNxtlinqAgent();
|
|
68
|
+
const voice = useNxtlinqVoice();
|
|
69
|
+
const [interactionMode, setInteractionModeState] = useState<InteractionMode>('text');
|
|
70
|
+
const [inputText, setInputText] = useState('');
|
|
71
|
+
const [isVoiceConnecting, setIsVoiceConnecting] = useState(false);
|
|
72
|
+
|
|
73
|
+
const isVoiceAvailable = ui.enableVoice !== false;
|
|
74
|
+
const micStartsMuted = ui.startWithMicMuted ?? true;
|
|
75
|
+
|
|
76
|
+
const handleVoiceBargeIn = useCallback(() => {
|
|
77
|
+
voice.interrupt();
|
|
78
|
+
}, [voice]);
|
|
79
|
+
|
|
80
|
+
const {
|
|
81
|
+
isMicMuted,
|
|
82
|
+
isMicHeldForAssistant,
|
|
83
|
+
toggleVoiceMicMute,
|
|
84
|
+
prepareForVoiceConnect,
|
|
85
|
+
resetMicState,
|
|
86
|
+
clearAssistantMicHold,
|
|
87
|
+
} = useVoiceMicState(voice, isVoiceConnecting, {
|
|
88
|
+
startWithMicMuted: micStartsMuted,
|
|
89
|
+
holdMicDuringAssistant: ui.holdMicDuringAssistant ?? true,
|
|
90
|
+
onBargeIn: handleVoiceBargeIn,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const voiceTranscriptApi = useMemo(
|
|
94
|
+
() => ({
|
|
95
|
+
getMessages: () => agent.agent.getSnapshot().messages,
|
|
96
|
+
setMessages: agent.setMessages,
|
|
97
|
+
syncVoiceTurnHistory: agent.syncVoiceTurnHistory,
|
|
98
|
+
}),
|
|
99
|
+
[agent.agent, agent.setMessages, agent.syncVoiceTurnHistory],
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const { handleTranscript, handleDone, clearVoiceStream } = useVoiceTranscriptMessages(
|
|
103
|
+
voiceTranscriptApi,
|
|
104
|
+
interactionMode,
|
|
105
|
+
voice.voiceSessionId,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const setInteractionMode = useCallback(
|
|
109
|
+
(mode: InteractionMode) => {
|
|
110
|
+
if (mode === 'text' && interactionMode === 'voice') {
|
|
111
|
+
void voice.stopVoice('switch_to_text').then(() => {
|
|
112
|
+
clearVoiceStream();
|
|
113
|
+
resetMicState();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
setInteractionModeState(mode);
|
|
117
|
+
},
|
|
118
|
+
[interactionMode, voice, resetMicState, clearVoiceStream],
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (interactionMode === 'text' && voice.voiceSessionId != null) {
|
|
123
|
+
void voice.stopVoice('mode_text_cleanup').then(() => {
|
|
124
|
+
clearVoiceStream();
|
|
125
|
+
resetMicState();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}, [interactionMode, voice.voiceSessionId, voice, resetMicState, clearVoiceStream]);
|
|
129
|
+
|
|
130
|
+
const orchestrationCallbacks = useMemo(
|
|
131
|
+
() => ({
|
|
132
|
+
handleTranscript,
|
|
133
|
+
handleDone,
|
|
134
|
+
clearVoiceStream,
|
|
135
|
+
prepareForVoiceConnect,
|
|
136
|
+
resetMicState,
|
|
137
|
+
clearAssistantMicHold,
|
|
138
|
+
setInteractionMode,
|
|
139
|
+
setIsVoiceConnecting,
|
|
140
|
+
}),
|
|
141
|
+
[
|
|
142
|
+
handleTranscript,
|
|
143
|
+
handleDone,
|
|
144
|
+
clearVoiceStream,
|
|
145
|
+
prepareForVoiceConnect,
|
|
146
|
+
resetMicState,
|
|
147
|
+
clearAssistantMicHold,
|
|
148
|
+
setInteractionMode,
|
|
149
|
+
],
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const {
|
|
153
|
+
wrappedStartVoice,
|
|
154
|
+
wrappedStopVoice,
|
|
155
|
+
wrappedInterrupt,
|
|
156
|
+
isVoiceChannelReady,
|
|
157
|
+
} = useVoiceConnectOrchestration(
|
|
158
|
+
agent,
|
|
159
|
+
voice,
|
|
160
|
+
interactionMode,
|
|
161
|
+
micStartsMuted,
|
|
162
|
+
orchestrationCallbacks,
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const theme = useMemo(
|
|
166
|
+
() => ({
|
|
167
|
+
...defaultAgentAssistantTheme,
|
|
168
|
+
...ui.theme,
|
|
169
|
+
colors: { ...defaultAgentAssistantTheme.colors, ...ui.theme?.colors },
|
|
170
|
+
spacing: { ...defaultAgentAssistantTheme.spacing, ...ui.theme?.spacing },
|
|
171
|
+
radius: { ...defaultAgentAssistantTheme.radius, ...ui.theme?.radius },
|
|
172
|
+
typography: {
|
|
173
|
+
...defaultAgentAssistantTheme.typography,
|
|
174
|
+
...ui.theme?.typography,
|
|
175
|
+
},
|
|
176
|
+
}),
|
|
177
|
+
[ui.theme],
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
const sendText = useCallback(async () => {
|
|
181
|
+
const text = inputText.trim();
|
|
182
|
+
if (!text || agent.isLoading) return;
|
|
183
|
+
setInputText('');
|
|
184
|
+
await agent.sendMessage(text);
|
|
185
|
+
}, [agent, inputText]);
|
|
186
|
+
|
|
187
|
+
const selectPreset = useCallback(
|
|
188
|
+
async (preset: PresetMessage) => {
|
|
189
|
+
if (preset.autoSend) {
|
|
190
|
+
await agent.sendMessage(preset.text);
|
|
191
|
+
} else {
|
|
192
|
+
setInputText(preset.text);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
[agent],
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const value = useMemo<AgentAssistantContextValue>(
|
|
199
|
+
() => ({
|
|
200
|
+
...agent,
|
|
201
|
+
...voice,
|
|
202
|
+
startVoice: wrappedStartVoice,
|
|
203
|
+
stopVoice: wrappedStopVoice,
|
|
204
|
+
interrupt: wrappedInterrupt,
|
|
205
|
+
theme,
|
|
206
|
+
title: ui.title ?? 'AI Assistant',
|
|
207
|
+
placeholder: ui.placeholder ?? 'Type a message…',
|
|
208
|
+
presetMessages: ui.presetMessages ?? [],
|
|
209
|
+
interactionMode,
|
|
210
|
+
setInteractionMode,
|
|
211
|
+
inputText,
|
|
212
|
+
setInputText,
|
|
213
|
+
isVoiceAvailable,
|
|
214
|
+
isVoiceConnecting,
|
|
215
|
+
isMicMuted,
|
|
216
|
+
isMicHeldForAssistant,
|
|
217
|
+
toggleVoiceMicMute,
|
|
218
|
+
isVoiceChannelReady,
|
|
219
|
+
enableFileUpload: ui.enableFileUpload !== false,
|
|
220
|
+
sendText,
|
|
221
|
+
selectPreset,
|
|
222
|
+
}),
|
|
223
|
+
[
|
|
224
|
+
agent,
|
|
225
|
+
voice,
|
|
226
|
+
wrappedStartVoice,
|
|
227
|
+
wrappedStopVoice,
|
|
228
|
+
wrappedInterrupt,
|
|
229
|
+
theme,
|
|
230
|
+
ui.title,
|
|
231
|
+
ui.placeholder,
|
|
232
|
+
ui.presetMessages,
|
|
233
|
+
ui.enableFileUpload,
|
|
234
|
+
interactionMode,
|
|
235
|
+
setInteractionMode,
|
|
236
|
+
inputText,
|
|
237
|
+
isVoiceAvailable,
|
|
238
|
+
isVoiceConnecting,
|
|
239
|
+
isMicMuted,
|
|
240
|
+
isMicHeldForAssistant,
|
|
241
|
+
toggleVoiceMicMute,
|
|
242
|
+
isVoiceChannelReady,
|
|
243
|
+
sendText,
|
|
244
|
+
selectPreset,
|
|
245
|
+
voice.voiceStatus,
|
|
246
|
+
],
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
return (
|
|
250
|
+
<AgentAssistantContext.Provider value={value}>
|
|
251
|
+
{children}
|
|
252
|
+
</AgentAssistantContext.Provider>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function useAgentAssistant(): AgentAssistantContextValue {
|
|
257
|
+
const ctx = useContext(AgentAssistantContext);
|
|
258
|
+
if (!ctx) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
'useAgentAssistant must be used within <NxtlinqAgentChat> or <AgentAssistantProvider>',
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
return ctx;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function voiceStatusLabel(status: VoiceStatus): string {
|
|
267
|
+
const labels: Record<VoiceStatus, string> = {
|
|
268
|
+
idle: 'Ready',
|
|
269
|
+
listening: 'Listening',
|
|
270
|
+
transcribing: 'Transcribing',
|
|
271
|
+
thinking: 'Thinking',
|
|
272
|
+
generating: 'Generating',
|
|
273
|
+
speaking: 'Speaking',
|
|
274
|
+
};
|
|
275
|
+
return labels[status] ?? status;
|
|
276
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export { NxtlinqAgentChat } from './NxtlinqAgentChat';
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
ChatBot,
|
|
5
|
+
NxtlinqChatBot,
|
|
6
|
+
ChatBotProvider,
|
|
7
|
+
useChatBot,
|
|
8
|
+
ChatBotUI,
|
|
9
|
+
MessageInput,
|
|
10
|
+
MessageList,
|
|
11
|
+
ModelSelector,
|
|
12
|
+
NotificationModal,
|
|
13
|
+
PermissionForm,
|
|
14
|
+
PresetMessages,
|
|
15
|
+
BerifyMeModal,
|
|
16
|
+
} from './legacy';
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
AIModel,
|
|
20
|
+
AITMetadata,
|
|
21
|
+
ChatBotContextType,
|
|
22
|
+
ChatBotProps,
|
|
23
|
+
NovaError,
|
|
24
|
+
NovaResponse,
|
|
25
|
+
ToolCall,
|
|
26
|
+
} from './legacy';
|
|
27
|
+
|
|
28
|
+
export type {
|
|
29
|
+
NxtlinqAgentChatProps,
|
|
30
|
+
AgentAssistantTheme,
|
|
31
|
+
PresetMessage,
|
|
32
|
+
Message,
|
|
33
|
+
ToolUse,
|
|
34
|
+
} from './types';
|
|
35
|
+
|
|
36
|
+
export { defaultAgentAssistantTheme } from './theme/defaultTheme';
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
AgentAssistantProvider,
|
|
40
|
+
useAgentAssistant,
|
|
41
|
+
voiceStatusLabel,
|
|
42
|
+
type AgentAssistantContextValue,
|
|
43
|
+
type InteractionMode,
|
|
44
|
+
} from './context/AgentAssistantContext';
|
|
45
|
+
|
|
46
|
+
export { AgentMessageList } from './components/AgentMessageList';
|
|
47
|
+
export { AgentComposer } from './components/AgentComposer';
|
|
48
|
+
export { AgentVoiceBar } from './components/AgentVoiceBar';
|
|
49
|
+
export { AgentRemoteAudio } from './components/AgentRemoteAudio';
|
|
50
|
+
export { PresetMessageChips } from './components/PresetMessageChips';
|
|
51
|
+
export { AgentAssistantShell } from './components/AgentAssistantShell';
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
NxtlinqAgentProvider,
|
|
55
|
+
useNxtlinqAgent,
|
|
56
|
+
useNxtlinqVoice,
|
|
57
|
+
createNxtlinqAgentWeb,
|
|
58
|
+
fileToAttachment,
|
|
59
|
+
type NxtlinqAgentProviderProps,
|
|
60
|
+
} from '@bytexbyte/nxtlinq-ai-agent-web-development';
|
|
61
|
+
|
|
62
|
+
export type {
|
|
63
|
+
AgentEnvironment,
|
|
64
|
+
AgentConfig,
|
|
65
|
+
Attachment,
|
|
66
|
+
AgentResponse,
|
|
67
|
+
SendMessageOptions,
|
|
68
|
+
NxtlinqAgentSnapshot,
|
|
69
|
+
VoiceSession,
|
|
70
|
+
VoiceStatus,
|
|
71
|
+
} from '@bytexbyte/nxtlinq-ai-agent-core-development';
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
NxtlinqAgent,
|
|
75
|
+
setApiHosts,
|
|
76
|
+
VoiceNotSupportedError,
|
|
77
|
+
STORAGE_KEYS,
|
|
78
|
+
} from '@bytexbyte/nxtlinq-ai-agent-core-development';
|