@alxxsck/ai-assistant 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 (56) hide show
  1. package/README.md +345 -0
  2. package/dist/App.d.ts +26 -0
  3. package/dist/Avatar-XISRbl7X.js +29627 -0
  4. package/dist/OrbitControls-XelJ40xM.js +458 -0
  5. package/dist/api/messages.api.d.ts +20 -0
  6. package/dist/api/messages.api.types.d.ts +88 -0
  7. package/dist/api/messages.api.utils.d.ts +2 -0
  8. package/dist/api/voice.api.d.ts +65 -0
  9. package/dist/api/voice.api.types.d.ts +37 -0
  10. package/dist/avatar/AnimationManager.d.ts +39 -0
  11. package/dist/avatar/Avatar.d.ts +69 -0
  12. package/dist/avatar/BlendShapeScenario.d.ts +19 -0
  13. package/dist/bridge-ai-chat-widget.es.js +10194 -0
  14. package/dist/constants.d.ts +2 -0
  15. package/dist/context/ChatWidgetContext.d.ts +32 -0
  16. package/dist/domain/command/CommandRuntime.d.ts +50 -0
  17. package/dist/domain/command/command.types.d.ts +70 -0
  18. package/dist/domain/message/cable/AnyCable.service.d.ts +34 -0
  19. package/dist/domain/message/cable/CableContext.d.ts +17 -0
  20. package/dist/domain/message/cable/CableContext.types.d.ts +19 -0
  21. package/dist/domain/message/cable/WidgetChat.channel.d.ts +4 -0
  22. package/dist/domain/message/cable/widget-message.d.ts +3 -0
  23. package/dist/domain/message/message.store.d.ts +51 -0
  24. package/dist/domain/scenario/scenario-choice.d.ts +17 -0
  25. package/dist/domain/ui/ui.service.d.ts +7 -0
  26. package/dist/domain/voice/voice.store.d.ts +69 -0
  27. package/dist/hooks/useDeviceManager.d.ts +25 -0
  28. package/dist/hooks/useSessionExpiryChecks.d.ts +3 -0
  29. package/dist/index.d.ts +41 -0
  30. package/dist/index.types.d.ts +50 -0
  31. package/dist/lib/isSessionExpired.d.ts +2 -0
  32. package/dist/lib/logger.d.ts +12 -0
  33. package/dist/lib/retrieveContent.d.ts +6 -0
  34. package/dist/lib/utils.d.ts +2 -0
  35. package/dist/lib//321/201ontentRenderer.d.ts +6 -0
  36. package/dist/lil-gui.esm-BicvE3D7.js +1263 -0
  37. package/dist/react/mount.d.ts +3 -0
  38. package/dist/types/index.d.ts +9 -0
  39. package/dist/ui/chat-routes.d.ts +11 -0
  40. package/dist/ui/components/ChatFooter.d.ts +2 -0
  41. package/dist/ui/components/ChatListItem.d.ts +10 -0
  42. package/dist/ui/components/ChatListPage.d.ts +1 -0
  43. package/dist/ui/components/ChatMessage.d.ts +8 -0
  44. package/dist/ui/components/ChatTextMode.d.ts +1 -0
  45. package/dist/ui/components/ChatTopControls.d.ts +1 -0
  46. package/dist/ui/components/ChatTypingIndicator.d.ts +4 -0
  47. package/dist/ui/components/ChatUnreadIndicator.d.ts +1 -0
  48. package/dist/ui/components/ChatVoiceMode.d.ts +1 -0
  49. package/dist/ui/components/ChatWidget.d.ts +4 -0
  50. package/dist/ui/components/ErrorMessage.d.ts +7 -0
  51. package/dist/ui/components/VoiceModeMessage.d.ts +12 -0
  52. package/dist/ui/components/overlays/ChatBlurOverlayBottom.d.ts +1 -0
  53. package/dist/ui/components/overlays/ChatBlurOverlayTop.d.ts +1 -0
  54. package/dist/ui/components/overlays/ChatDarkOverlay.d.ts +1 -0
  55. package/dist/ui/error-messages.d.ts +7 -0
  56. package/package.json +102 -0
@@ -0,0 +1,39 @@
1
+ import { Object3D } from "three";
2
+ import type { VisemeData } from "./Avatar";
3
+ import { Avatar } from "./Avatar";
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
+ export type BlendShapeKey = (typeof BLEND_SHAPE_KEYS)[number];
6
+ export default class AnimationManager {
7
+ private model;
8
+ private avatar;
9
+ activeActionName: string;
10
+ private animations;
11
+ private zeroMorphingInfluences;
12
+ private visemeDataIndex;
13
+ private visemeData;
14
+ private mixer;
15
+ private actions;
16
+ private loadingManager;
17
+ private fbxLoader;
18
+ private totalAnimations;
19
+ private loadedAnimations;
20
+ constructor(model: Object3D, avatar: Avatar);
21
+ init(): Promise<void>;
22
+ private loadAnimationMandatoryInitial;
23
+ private loadAnimationLazy;
24
+ private onLoadAnimation;
25
+ private fadeDuration;
26
+ fadeToAction(name: string): void;
27
+ applyActiveActionBlendShapeScenario(): void;
28
+ resetVisemeData(): void;
29
+ setVisemeData(): void;
30
+ convertVisemeDataToAnimationScenario(): void;
31
+ update(delta: number, timePassed?: number): void;
32
+ resetMorphing(): void;
33
+ private blendShapeAnimationLength;
34
+ private blendShapeResetAnimationLength;
35
+ playVisemeAnimation(timePassed: number, visemeNext: VisemeData, visemeAfterNext: VisemeData): void;
36
+ private shapeFadeInDuration;
37
+ private shapeFadeOutDuration;
38
+ showcaseBlendShape(dictionaryKey: string): void;
39
+ }
@@ -0,0 +1,69 @@
1
+ import { Mesh, Vector3 } from "three";
2
+ import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader.js";
3
+ import type { AppApi } from "@/App";
4
+ import type { WidgetConfig } from "@/index.types";
5
+ export interface VisemeData {
6
+ viseme: Viseme;
7
+ time: number;
8
+ }
9
+ export type Viseme = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "X";
10
+ type CameraParams = {
11
+ position: Vector3;
12
+ lookAt: Vector3;
13
+ fov: number;
14
+ };
15
+ export type ExternallyAvailableActions = "excited" | "fix_hair" | "spin" | "kiss" | "win_small" | "deposit";
16
+ export declare class Avatar extends EventTarget {
17
+ private canvas;
18
+ private videoContainer;
19
+ private config;
20
+ api: AppApi;
21
+ initialAssetsfbxLoader: FBXLoader;
22
+ head: Mesh;
23
+ private renderer;
24
+ private sound;
25
+ private gui?;
26
+ private cubeTexture;
27
+ private textureLoader;
28
+ private clock;
29
+ private scene;
30
+ private camera;
31
+ private hair;
32
+ private body;
33
+ private animationManager;
34
+ private cameraParams;
35
+ private controls?;
36
+ private locale?;
37
+ constructor(canvas: HTMLCanvasElement, videoContainer: HTMLDivElement, config: WidgetConfig, api: AppApi);
38
+ private lightAmbient;
39
+ private lightDirectional;
40
+ private loadingManager;
41
+ private sounds;
42
+ init(): Promise<void>;
43
+ initSounds(locale: string): void;
44
+ private tempLookAt;
45
+ setCamera(params: CameraParams, cb?: () => void): void;
46
+ private width;
47
+ private height;
48
+ onResize: (width?: number, height?: number) => void;
49
+ animate: () => void;
50
+ private SPEAKING_ANIMATION_NAME_1;
51
+ private SPEAKING_ANIMATION_NAME_2;
52
+ private IDLE_ANIMATION_NAME_1;
53
+ private IDLE_ANIMATION_NAME_2;
54
+ private speakingAnimationName;
55
+ private idleAnimationName;
56
+ setTalking(talking: boolean): void;
57
+ playReaction(speech: string, animation: string): void;
58
+ speakPhrase(phrase: string): void;
59
+ externalLaunchAnimationAction: (name: ExternallyAvailableActions) => void;
60
+ private playAction;
61
+ playVideo: (id: string, speak?: boolean) => Promise<unknown>;
62
+ shutDownVideo: () => void;
63
+ showcaseBlendShape(shapeName: string): void;
64
+ render(): void;
65
+ onAllAssetsLoaded: () => void;
66
+ private initDebugControls;
67
+ private addDebugGui;
68
+ }
69
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { Mesh } from "three";
2
+ type BlendShapeAnimationData = {
3
+ timeStart: number;
4
+ timeFinish: number;
5
+ target: number;
6
+ };
7
+ type BlendShapeScenarioData = {
8
+ [blendShapeName: string]: BlendShapeAnimationData[];
9
+ };
10
+ export declare class BlendShapeScenario {
11
+ private head;
12
+ private timeline;
13
+ private morphingInfluences;
14
+ constructor(data: BlendShapeScenarioData, head: Mesh, loop?: boolean);
15
+ play(): void;
16
+ pause(): void;
17
+ stop(): void;
18
+ }
19
+ export {};