bridgeapp-ai-chat-widget 0.1.4 → 0.1.6

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 CHANGED
@@ -15,19 +15,19 @@ import { ChatWidgetInstance } from "bridge-ai-chat-widget";
15
15
 
16
16
  const widget = new ChatWidgetInstance({
17
17
  mountElementId: "chat-widget-root",
18
- agentId: "AGENT_ID",
18
+ agentId: "222d810a-92dd-4bb4-9ce6-1fee92238e7f",
19
19
  customerInteractionSession: {
20
20
  accessToken: "ACCESS_TOKEN",
21
21
  chatId: "CHAT_ID",
22
22
  expiresAt: new Date(Date.now() + 86400000).toISOString(),
23
23
  },
24
- assetsUrl: "ASSETS_URL",
25
- wsUrl: "wss://ws.brid93.dev/ws",
26
- apiUrl: "https://api.brid93.dev",
24
+ assetsUrl: "https://metamediastatic.com",
25
+ wsUrl: "wss://ws.brid93.com/ws",
26
+ apiUrl: "https://api.brid93.com",
27
27
  AIAvatar: true,
28
28
  background: false,
29
29
  voiceEnabled: true,
30
- footer: falseб
30
+ footer: false,
31
31
  manualOpen: false
32
32
  });
33
33
 
package/dist/App.d.ts CHANGED
@@ -4,6 +4,7 @@ export type AppApi = {
4
4
  onAvatarReady: OnAvatarReadyCB;
5
5
  onSessionExpired: () => void;
6
6
  registerSetOpen: (fn: ((open: boolean) => void) | null) => void;
7
+ resolveAssetPath: (path: string) => string;
7
8
  };
8
9
  type AppProps = {
9
10
  config: WidgetConfig;
@@ -2,6 +2,11 @@ import type { MessageData } from "./api.types";
2
2
  import type { WidgetConfig } from "@/index.types";
3
3
  import type { AppApi } from "@/App";
4
4
  export declare const MAX_FETCH_MESSAGES = 100;
5
- export declare const listMessages: (config: WidgetConfig, api: AppApi, afterMessageId?: string) => Promise<MessageData[]>;
5
+ export type PaginationParams = {
6
+ beforeMessageId?: string;
7
+ afterMessageId?: string;
8
+ pageSize: number;
9
+ };
10
+ export declare const listMessages: (config: WidgetConfig, api: AppApi, paginationParams?: PaginationParams) => Promise<MessageData[]>;
6
11
  export declare function listMessagesForThreads(config: WidgetConfig, api: AppApi, threadIds: string[]): Promise<MessageData[]>;
7
12
  export declare function sendMessage(config: WidgetConfig, api: AppApi, messageText: string, threadId?: string): Promise<MessageData>;
@@ -1,14 +1,10 @@
1
- import { Object3D, type Mesh } from "three";
1
+ import { Object3D } from "three";
2
2
  import type { VisemeData } from "./Avatar";
3
- import { FBXLoader } from "three/examples/jsm/Addons.js";
4
3
  import { Avatar } from "./Avatar";
5
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"];
6
5
  export type BlendShapeKey = (typeof BLEND_SHAPE_KEYS)[number];
7
6
  export default class AnimationManager {
8
7
  private model;
9
- private head;
10
- private initialAssetsfbxLoader;
11
- private assetsUrl;
12
8
  private avatar;
13
9
  private animations;
14
10
  private zeroMorphingInfluences;
@@ -21,9 +17,8 @@ export default class AnimationManager {
21
17
  private fbxLoader;
22
18
  private totalAnimations;
23
19
  private loadedAnimations;
24
- constructor(model: Object3D, head: Mesh, initialAssetsfbxLoader: FBXLoader, assetsUrl: string, avatar: Avatar);
20
+ constructor(model: Object3D, avatar: Avatar);
25
21
  init(): Promise<void>;
26
- private resolveAsset;
27
22
  private loadAnimationMandatoryInitial;
28
23
  private loadAnimationLazy;
29
24
  private onLoadAnimation;
@@ -1,6 +1,7 @@
1
- import { Vector3 } from "three";
1
+ import { Mesh, Vector3 } from "three";
2
+ import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader.js";
2
3
  import type { WidgetConfig } from "@/index.types";
3
- import type { OnAvatarReadyCB } from "@/react/mount";
4
+ import type { AppApi } from "@/App";
4
5
  export interface VisemeData {
5
6
  viseme: Viseme;
6
7
  time: number;
@@ -16,25 +17,23 @@ export declare class Avatar extends EventTarget {
16
17
  private canvas;
17
18
  private videoContainer;
18
19
  private config;
19
- private onAvatarReady;
20
+ api: AppApi;
21
+ initialAssetsfbxLoader: FBXLoader;
22
+ head: Mesh;
20
23
  private renderer;
21
24
  private sound;
22
25
  private gui?;
23
26
  private cubeTexture;
24
- private initialAssetsfbxLoader;
25
27
  private textureLoader;
26
28
  private clock;
27
29
  private scene;
28
30
  private camera;
29
31
  private hair;
30
- private head;
31
32
  private body;
32
33
  private animationManager;
33
34
  private cameraParams;
34
35
  private controls?;
35
- constructor(canvas: HTMLCanvasElement, videoContainer: HTMLDivElement, config: WidgetConfig, onAvatarReady: OnAvatarReadyCB);
36
- private get baseUrl();
37
- private resolveAsset;
36
+ constructor(canvas: HTMLCanvasElement, videoContainer: HTMLDivElement, config: WidgetConfig, api: AppApi);
38
37
  private lightAmbient;
39
38
  private lightDirectional;
40
39
  private loadingManager;