@alxxsck/ai-assistant 1.4.0 → 1.7.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/README.md +24 -10
- package/dist/App.d.ts +6 -0
- package/dist/{Avatar-B6ktAPlH.js → Avatar-_GvrPzkn.js} +296 -295
- package/dist/{OrbitControls-BE3BANZi.js → OrbitControls-BCIW0o5s.js} +1 -1
- package/dist/api/messages.api.d.ts +1 -1
- package/dist/api/messages.api.types.d.ts +6 -0
- package/dist/api/voice.api.d.ts +3 -2
- package/dist/api/voice.api.types.d.ts +11 -13
- package/dist/avatar/AnimationManager.d.ts +0 -2
- package/dist/bridge-ai-chat-widget.es.js +7893 -4449
- package/dist/domain/command/CommandRuntime.d.ts +1 -1
- package/dist/domain/command/command.errors.d.ts +2 -2
- package/dist/domain/command/command.types.d.ts +0 -1
- package/dist/domain/message/cable/widget-frame.d.ts +1 -1
- package/dist/domain/message/cable/widget-message.d.ts +2 -1
- package/dist/domain/message/message-stream.d.ts +10 -0
- package/dist/domain/message/message.store.d.ts +24 -1
- package/dist/domain/voice/voice.store.d.ts +4 -4
- package/dist/index.d.ts +7 -0
- package/dist/index.types.d.ts +1 -1
- package/dist/lib/retrieveContent.d.ts +2 -1
- package/dist/ui/components/ChatMessage.d.ts +1 -1
- package/dist/ui/components/ChatTypingIndicator.d.ts +4 -2
- package/dist/ui/components/OptimisticCustomerMessage.d.ts +6 -0
- package/dist/ui/components/PendingAssistantMessage.d.ts +6 -0
- package/dist/ui/components/StreamingMessageText.d.ts +10 -0
- package/dist/ui/hooks/usePinnedAutoScroll.d.ts +10 -0
- package/dist/ui/hooks/useSmoothStreamingText.d.ts +7 -0
- package/dist/ui/streaming/smooth-text.d.ts +21 -0
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as S, V as p, M as u, T as _, Q as E, S as P, a as c, R as w, P as O, b as R } from "./Avatar-
|
|
1
|
+
import { C as S, V as p, M as u, T as _, Q as E, S as P, a as c, R as w, P as O, b as R } from "./Avatar-_GvrPzkn.js";
|
|
2
2
|
const D = { type: "change" }, b = { type: "start" }, M = { type: "end" }, f = new w(), T = new O(), j = Math.cos(70 * R.DEG2RAD), n = new p(), r = 2 * Math.PI, o = {
|
|
3
3
|
NONE: -1,
|
|
4
4
|
ROTATE: 0,
|
|
@@ -16,5 +16,5 @@ export declare const listConversations: (config: WidgetConfig, api: AppApi) => P
|
|
|
16
16
|
export declare const listConversationMessages: (config: WidgetConfig, api: AppApi, conversationId: string) => Promise<MessageData[]>;
|
|
17
17
|
export declare const createConversation: (config: WidgetConfig, api: AppApi) => Promise<ConversationData>;
|
|
18
18
|
export declare const selectConversation: (config: WidgetConfig, api: AppApi, conversationId: string) => Promise<ConversationData>;
|
|
19
|
-
export declare function sendMessage(config: WidgetConfig, api: AppApi, messageText: string, conversationId?: string): Promise<MessageData>;
|
|
19
|
+
export declare function sendMessage(config: WidgetConfig, api: AppApi, messageText: string, conversationId?: string, clientMessageId?: `${string}-${string}-${string}-${string}-${string}`): Promise<MessageData>;
|
|
20
20
|
export {};
|
package/dist/api/voice.api.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AppApi } from "@/App";
|
|
2
2
|
import type { WidgetConfig } from "@/index.types";
|
|
3
|
-
import type {
|
|
3
|
+
import type { VoiceSessionData } from "./voice.api.types";
|
|
4
4
|
export declare class VoiceApiError extends Error {
|
|
5
5
|
readonly status: number;
|
|
6
6
|
constructor(status: number, message: string);
|
|
7
7
|
}
|
|
8
|
+
export declare const parseVoiceSession: (value: unknown) => VoiceSessionData;
|
|
8
9
|
export declare const startVoiceSession: (config: WidgetConfig, api: AppApi, conversationId?: string) => Promise<VoiceSessionData>;
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const getVoiceSession: (config: WidgetConfig, api: AppApi, voiceSessionId: string) => Promise<VoiceSessionData>;
|
|
10
11
|
export declare const endVoiceSession: (config: WidgetConfig, api: AppApi, voiceSessionId: string, reason?: string) => Promise<VoiceSessionData>;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
+
export type VoiceSessionStatus = "CREATED" | "CONNECTING" | "ACTIVE" | "ENDED" | "FAILED" | "EXPIRED";
|
|
2
|
+
export type VoiceWebsocketContract = {
|
|
3
|
+
namespace: "/assistant";
|
|
4
|
+
connectEvent: "voice.connect";
|
|
5
|
+
audioAppendEvent: "voice.audio.append";
|
|
6
|
+
disconnectEvent: "voice.disconnect";
|
|
7
|
+
serverEvent: "voice.event";
|
|
8
|
+
eventProtocol: "xai-realtime-v1";
|
|
9
|
+
};
|
|
1
10
|
export type VoiceSessionData = {
|
|
2
11
|
voiceSessionId: string;
|
|
3
12
|
conversationId: string;
|
|
4
|
-
status:
|
|
13
|
+
status: VoiceSessionStatus;
|
|
5
14
|
voiceConfig: {
|
|
6
15
|
voice: string;
|
|
7
16
|
};
|
|
8
17
|
voiceProtocolVersion: number;
|
|
9
|
-
|
|
10
|
-
offerPath: string;
|
|
11
|
-
dataChannel: string;
|
|
12
|
-
eventProtocol: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type ConnectVoiceSessionData = {
|
|
16
|
-
voiceSessionId: string;
|
|
17
|
-
answerSdp: string;
|
|
18
|
-
model: string;
|
|
19
|
-
voice: string;
|
|
20
|
-
dataChannel: string;
|
|
18
|
+
websocket: VoiceWebsocketContract;
|
|
21
19
|
};
|
|
@@ -16,8 +16,6 @@ export default class AnimationManager {
|
|
|
16
16
|
private actions;
|
|
17
17
|
private loadingManager;
|
|
18
18
|
private fbxLoader;
|
|
19
|
-
private totalAnimations;
|
|
20
|
-
private loadedAnimations;
|
|
21
19
|
constructor(model: Object3D, avatar: Avatar);
|
|
22
20
|
init(): Promise<void>;
|
|
23
21
|
private loadAnimationMandatoryInitial;
|