@rqmii_immersive/agent-react-sdk 1.0.10 → 1.0.12
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 +44 -0
- package/dist/rqmii-react-agent-sdk.cjs +612 -612
- package/dist/rqmii-react-agent-sdk.cjs.map +1 -1
- package/dist/rqmii-react-agent-sdk.js +4049 -3987
- package/dist/rqmii-react-agent-sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,16 @@ export type ConnectionState =
|
|
|
18
18
|
| 'ended'
|
|
19
19
|
| (string & {});
|
|
20
20
|
|
|
21
|
+
export type SessionState =
|
|
22
|
+
| 'idle'
|
|
23
|
+
| 'user_speaking'
|
|
24
|
+
| 'agent_thinking'
|
|
25
|
+
| 'agent_speaking'
|
|
26
|
+
| 'tool_executing'
|
|
27
|
+
| 'terminating'
|
|
28
|
+
| 'terminated'
|
|
29
|
+
| (string & {});
|
|
30
|
+
|
|
21
31
|
export type CloudStreamState =
|
|
22
32
|
| 'idle'
|
|
23
33
|
| 'connecting'
|
|
@@ -139,6 +149,14 @@ export interface UseRqmiiConnectionReturn {
|
|
|
139
149
|
error: string | null;
|
|
140
150
|
reconnectAttempt: number;
|
|
141
151
|
session: RqmiiSessionInfo;
|
|
152
|
+
creditExhausted?: boolean;
|
|
153
|
+
creditError?: string | null;
|
|
154
|
+
sessionState: SessionState;
|
|
155
|
+
isSessionTerminated: boolean;
|
|
156
|
+
isSessionTerminating: boolean;
|
|
157
|
+
isAgentThinking: boolean;
|
|
158
|
+
isAgentSpeaking: boolean;
|
|
159
|
+
isToolExecuting: boolean;
|
|
142
160
|
initializeSession: (args?: InitializeSessionArgs) => Promise<any>;
|
|
143
161
|
joinDesktopSession: (args: JoinDesktopSessionArgs) => Promise<any>;
|
|
144
162
|
disconnect: () => void;
|
|
@@ -148,6 +166,15 @@ export interface UseRqmiiConnectionReturn {
|
|
|
148
166
|
changeSessionLanguage: (language: string) => boolean;
|
|
149
167
|
}
|
|
150
168
|
|
|
169
|
+
export interface UseRqmiiSessionStateReturn {
|
|
170
|
+
sessionState: SessionState;
|
|
171
|
+
isSessionTerminated: boolean;
|
|
172
|
+
isSessionTerminating: boolean;
|
|
173
|
+
isAgentThinking: boolean;
|
|
174
|
+
isAgentSpeaking: boolean;
|
|
175
|
+
isToolExecuting: boolean;
|
|
176
|
+
}
|
|
177
|
+
|
|
151
178
|
export interface UseRqmiiMessagesReturn {
|
|
152
179
|
messages: RqmiiMessage[];
|
|
153
180
|
sendTextMessage: (text: string) => boolean;
|
|
@@ -224,6 +251,12 @@ export interface UseRqmiiVADReturn {
|
|
|
224
251
|
export interface RqmiiAgentContextValue extends UseRqmiiConnectionReturn {
|
|
225
252
|
isAudioPlaying: boolean;
|
|
226
253
|
isAvatarSpeaking: boolean;
|
|
254
|
+
sessionState: SessionState;
|
|
255
|
+
isSessionTerminated: boolean;
|
|
256
|
+
isSessionTerminating: boolean;
|
|
257
|
+
isAgentThinking: boolean;
|
|
258
|
+
isAgentSpeaking: boolean;
|
|
259
|
+
isToolExecuting: boolean;
|
|
227
260
|
cloudStream: {
|
|
228
261
|
state: CloudStreamState;
|
|
229
262
|
error: string | null;
|
|
@@ -258,6 +291,16 @@ export const AGENT_TYPES: {
|
|
|
258
291
|
readonly DESKTOP_AVATAR: 'desktop_avatar';
|
|
259
292
|
};
|
|
260
293
|
|
|
294
|
+
export const SESSION_STATE: {
|
|
295
|
+
readonly IDLE: 'idle';
|
|
296
|
+
readonly USER_SPEAKING: 'user_speaking';
|
|
297
|
+
readonly AGENT_THINKING: 'agent_thinking';
|
|
298
|
+
readonly AGENT_SPEAKING: 'agent_speaking';
|
|
299
|
+
readonly TOOL_EXECUTING: 'tool_executing';
|
|
300
|
+
readonly TERMINATING: 'terminating';
|
|
301
|
+
readonly TERMINATED: 'terminated';
|
|
302
|
+
};
|
|
303
|
+
|
|
261
304
|
export const SOCKET_EVENTS: Record<string, string>;
|
|
262
305
|
|
|
263
306
|
export const CONNECTION_STATE: {
|
|
@@ -284,6 +327,7 @@ export function useRqmiiAgentContext(): RqmiiAgentContextValue;
|
|
|
284
327
|
|
|
285
328
|
export function useRqmiiAgent(): RqmiiAgentContextValue;
|
|
286
329
|
export function useRqmiiConnection(): UseRqmiiConnectionReturn;
|
|
330
|
+
export function useRqmiiSessionState(): UseRqmiiSessionStateReturn;
|
|
287
331
|
export function useRqmiiMessages(): UseRqmiiMessagesReturn;
|
|
288
332
|
export function useRqmiiVoice(): UseRqmiiVoiceReturn;
|
|
289
333
|
export function useRqmiiAvatar(): UseRqmiiAvatarReturn;
|