@alxxsck/ai-assistant 1.8.0 → 2.2.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 +121 -314
- package/dist/App.d.ts +0 -7
- package/dist/{Avatar-BAlmduYw.js → Avatar-DKGkEfXe.js} +2608 -2716
- package/dist/ChatWidgetContent-Coj_NDep.js +8570 -0
- package/dist/avatar/AnimationManager.d.ts +45 -15
- package/dist/avatar/Avatar.d.ts +15 -19
- package/dist/avatar/publicAnimations.d.ts +3 -0
- package/dist/bridge-ai-chat-widget.es.js +4 -14123
- package/dist/config/runtime-config.d.ts +4 -0
- package/dist/context/ChatWidgetContext.d.ts +6 -5
- package/dist/domain/command/CommandRuntime.d.ts +1 -0
- package/dist/domain/command/command.types.d.ts +15 -24
- package/dist/domain/message/cable/AnyCable.service.d.ts +2 -1
- package/dist/domain/message/cable/CableContext.d.ts +2 -1
- package/dist/domain/message/cable/CableContext.types.d.ts +2 -4
- package/dist/domain/speech/LipSyncCueSource.d.ts +25 -0
- package/dist/domain/speech/LipSyncRuntime.d.ts +54 -0
- package/dist/domain/speech/RealtimeLipSyncCueSource.d.ts +13 -0
- package/dist/domain/speech/SpeechPlayer.d.ts +10 -0
- package/dist/domain/ui/ui.service.d.ts +7 -1
- package/dist/domain/ui/widget-geometry.d.ts +23 -0
- package/dist/domain/voice/voice.store.d.ts +1 -0
- package/dist/index-Dt2DYOP-.js +9632 -0
- package/dist/index.d.ts +18 -21
- package/dist/index.types.d.ts +6 -43
- package/dist/lib/isAuthenticationError.d.ts +1 -0
- package/dist/lib/logger.d.ts +5 -2
- package/dist/lib/markdownRenderer.d.ts +4 -0
- package/dist/types/index.d.ts +4 -6
- package/dist/ui/chat-routes.d.ts +2 -0
- package/dist/ui/components/ChatAvatarStage.d.ts +1 -0
- package/dist/ui/components/ChatWidget.d.ts +0 -2
- package/dist/ui/components/ChatWidgetContent.d.ts +1 -0
- package/dist/ui/components/ChatWidgetFrame.d.ts +13 -0
- package/dist/ui/components/StreamingMessageText.d.ts +2 -1
- package/dist/ui/hooks/useSmoothStreamingText.d.ts +2 -1
- package/dist/ui/streaming/smooth-text.d.ts +5 -0
- package/package.json +7 -20
- package/dist/OrbitControls-BhEr8WlG.js +0 -458
- package/dist/lil-gui.esm-BicvE3D7.js +0 -1263
- package/dist/ui/components/ChatFooter.d.ts +0 -2
|
@@ -1,39 +1,69 @@
|
|
|
1
|
-
import { Object3D } from "three";
|
|
2
|
-
import type {
|
|
1
|
+
import { Object3D, Group } from "three";
|
|
2
|
+
import type { Viseme } from "@/domain/speech/LipSyncRuntime";
|
|
3
3
|
import type { Avatar } from "./Avatar";
|
|
4
4
|
export declare const BLEND_SHAPE_KEYS: readonly ["blendShape1.AE", "blendShape1.ChJ", "blendShape1.FV", "blendShape1.Oh", "blendShape1.Ah", "blendShape1.Ih", "blendShape1.L", "blendShape1.SZ", "blendShape1.Woo", "blendShape1.MBP", "blendShape1.Smile_Closed", "blendShape1.Smile_Open", "blendShape1.Kiss"];
|
|
5
5
|
export type BlendShapeKey = (typeof BLEND_SHAPE_KEYS)[number];
|
|
6
|
+
type AnimationAsset = {
|
|
7
|
+
name: string;
|
|
8
|
+
blendShapeScenario?: boolean;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type AnimationAssetsData = {
|
|
12
|
+
mandatory_initial_animations: AnimationAsset[];
|
|
13
|
+
lazy_load_animations: AnimationAsset[];
|
|
14
|
+
};
|
|
15
|
+
type InitialAnimationAssets = {
|
|
16
|
+
animationData: AnimationAssetsData;
|
|
17
|
+
mandatoryAnimations: Array<{
|
|
18
|
+
data: AnimationAsset;
|
|
19
|
+
animation: Group;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
6
22
|
export default class AnimationManager {
|
|
7
23
|
private model;
|
|
8
24
|
private avatar;
|
|
9
25
|
activeActionName: string;
|
|
10
|
-
private animations;
|
|
11
26
|
private zeroMorphingInfluences;
|
|
12
|
-
private visemeDataIndex;
|
|
13
|
-
private previousSpeechTime;
|
|
14
|
-
private visemeData;
|
|
15
27
|
private mixer;
|
|
16
28
|
private actions;
|
|
29
|
+
private lazyAnimations;
|
|
30
|
+
private animationLoads;
|
|
17
31
|
private loadingManager;
|
|
18
32
|
private fbxLoader;
|
|
19
|
-
|
|
33
|
+
private initialAssets;
|
|
34
|
+
private backgroundPreloadCancelled;
|
|
35
|
+
private latestActionRequest;
|
|
36
|
+
private pendingActionLoads;
|
|
37
|
+
private idleFallbackPending;
|
|
38
|
+
private lipSyncActive;
|
|
39
|
+
private lipSyncTarget;
|
|
40
|
+
private lipSyncWeight;
|
|
41
|
+
private lipSyncViseme;
|
|
42
|
+
private lipSyncPreviousViseme;
|
|
43
|
+
private lipSyncVisemeMix;
|
|
44
|
+
constructor(model: Object3D, avatar: Avatar, initialAssets?: Promise<InitialAnimationAssets>);
|
|
45
|
+
static preloadInitialAssets(avatar: Avatar): Promise<InitialAnimationAssets>;
|
|
20
46
|
init(): Promise<void>;
|
|
21
|
-
private loadAnimationMandatoryInitial;
|
|
22
47
|
private loadAnimationLazy;
|
|
48
|
+
loadAction(name: string): Promise<void>;
|
|
49
|
+
cancelBackgroundPreload(): void;
|
|
50
|
+
private scheduleBackgroundPreload;
|
|
51
|
+
private waitForBackgroundOpportunity;
|
|
52
|
+
private preloadRemainingAnimations;
|
|
23
53
|
private onLoadAnimation;
|
|
24
54
|
private fadeDuration;
|
|
25
55
|
hasAction(name: string): boolean;
|
|
26
|
-
fadeToAction(name: string): void
|
|
56
|
+
fadeToAction(name: string): Promise<void>;
|
|
27
57
|
applyActiveActionBlendShapeScenario(): void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
58
|
+
setLipSyncTarget(mouthOpen: number, activeViseme: Viseme | null): void;
|
|
59
|
+
resetLipSync(): void;
|
|
60
|
+
private clearSpeechMorphs;
|
|
61
|
+
private updateLipSync;
|
|
62
|
+
update(delta: number): void;
|
|
32
63
|
resetMorphing(): void;
|
|
33
|
-
private blendShapeAnimationLength;
|
|
34
64
|
private blendShapeResetAnimationLength;
|
|
35
|
-
playVisemeAnimation(timePassed: number, visemeNext: VisemeData, visemeAfterNext: VisemeData): void;
|
|
36
65
|
private shapeFadeInDuration;
|
|
37
66
|
private shapeFadeOutDuration;
|
|
38
67
|
showcaseBlendShape(dictionaryKey: string): void;
|
|
39
68
|
}
|
|
69
|
+
export {};
|
package/dist/avatar/Avatar.d.ts
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import { Mesh, Vector3 } from "three";
|
|
2
2
|
import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
3
3
|
import type { AppApi } from "@/App";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
time: number;
|
|
8
|
-
}
|
|
9
|
-
export type Viseme = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "X";
|
|
4
|
+
import type { LipSyncSnapshot } from "@/domain/speech/LipSyncRuntime";
|
|
5
|
+
import type { ExternallyAvailableActions } from "./publicAnimations";
|
|
6
|
+
export type { ExternallyAvailableActions } from "./publicAnimations";
|
|
10
7
|
type CameraParams = {
|
|
11
8
|
position: Vector3;
|
|
12
9
|
lookAt: Vector3;
|
|
13
10
|
fov: number;
|
|
14
11
|
};
|
|
15
|
-
export type ExternallyAvailableActions = "excited" | "fix_hair" | "spin" | "kiss" | "win_small" | "deposit";
|
|
16
12
|
export declare class Avatar extends EventTarget {
|
|
17
13
|
private canvas;
|
|
18
14
|
private videoContainer;
|
|
19
|
-
private config;
|
|
20
15
|
api: AppApi;
|
|
21
16
|
initialAssetsfbxLoader: FBXLoader;
|
|
22
17
|
head: Mesh;
|
|
23
18
|
private renderer;
|
|
24
|
-
private sound
|
|
25
|
-
private gui?;
|
|
19
|
+
private sound?;
|
|
26
20
|
private cubeTexture;
|
|
27
21
|
private textureLoader;
|
|
28
22
|
private clock;
|
|
@@ -32,15 +26,17 @@ export declare class Avatar extends EventTarget {
|
|
|
32
26
|
private body;
|
|
33
27
|
private animationManager;
|
|
34
28
|
private cameraParams;
|
|
35
|
-
private controls?;
|
|
36
29
|
private locale?;
|
|
37
30
|
private animationFrame;
|
|
38
31
|
private renderingEnabled;
|
|
39
|
-
|
|
32
|
+
private backgroundPreloadCancelled;
|
|
33
|
+
constructor(canvas: HTMLCanvasElement, videoContainer: HTMLDivElement, api: AppApi);
|
|
40
34
|
private lightAmbient;
|
|
41
35
|
private lightDirectional;
|
|
42
36
|
private loadingManager;
|
|
37
|
+
private criticalAssetsReady;
|
|
43
38
|
private sounds;
|
|
39
|
+
private soundsReady;
|
|
44
40
|
init(): Promise<void>;
|
|
45
41
|
initSounds(locale: string): void;
|
|
46
42
|
private tempLookAt;
|
|
@@ -50,6 +46,8 @@ export declare class Avatar extends EventTarget {
|
|
|
50
46
|
onResize: (width?: number, height?: number) => void;
|
|
51
47
|
animate: () => void;
|
|
52
48
|
setRenderingEnabled(enabled: boolean): void;
|
|
49
|
+
cancelBackgroundPreload(): void;
|
|
50
|
+
waitForCriticalAssets(): Promise<void>;
|
|
53
51
|
private SPEAKING_ANIMATION_NAME_1;
|
|
54
52
|
private SPEAKING_ANIMATION_NAME_2;
|
|
55
53
|
private IDLE_ANIMATION_NAME_1;
|
|
@@ -58,19 +56,17 @@ export declare class Avatar extends EventTarget {
|
|
|
58
56
|
private idleAnimationName;
|
|
59
57
|
private talkingRequested;
|
|
60
58
|
private talkingApplied;
|
|
59
|
+
private reportOptionalAnimationFailure;
|
|
60
|
+
applyLipSyncSnapshot(snapshot: LipSyncSnapshot): void;
|
|
61
61
|
setTalking(talking: boolean): void;
|
|
62
62
|
private applyTalkingWhenReady;
|
|
63
63
|
onAnimationLoaded(name: string): void;
|
|
64
|
-
playReaction(speech: string, animation: string): void
|
|
64
|
+
playReaction(speech: string, animation: string): Promise<void>;
|
|
65
65
|
speakPhrase(phrase: string): void;
|
|
66
|
-
externalLaunchAnimationAction: (name: ExternallyAvailableActions) => void
|
|
67
|
-
private playAction;
|
|
66
|
+
externalLaunchAnimationAction: (name: ExternallyAvailableActions) => Promise<void>;
|
|
68
67
|
playVideo: (id: string, speak?: boolean) => Promise<unknown>;
|
|
69
68
|
shutDownVideo: () => void;
|
|
70
69
|
showcaseBlendShape(shapeName: string): void;
|
|
71
70
|
render(): void;
|
|
72
|
-
|
|
73
|
-
private initDebugControls;
|
|
74
|
-
private addDebugGui;
|
|
71
|
+
onCriticalAssetsReady: () => void;
|
|
75
72
|
}
|
|
76
|
-
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const EXTERNALLY_AVAILABLE_ACTIONS: readonly ["deposit", "excited", "fix_hair", "kiss", "spin", "win_small"];
|
|
2
|
+
export type ExternallyAvailableActions = (typeof EXTERNALLY_AVAILABLE_ACTIONS)[number];
|
|
3
|
+
export declare function isExternallyAvailableAction(value: string): value is ExternallyAvailableActions;
|