@heybello/bello-sdk 0.1.0 → 0.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/dist/types.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- export type OrbStyle = 'galaxy' | 'ocean-depths' | 'caribbean' | 'cherry-blossom' | 'emerald' | 'multi-color' | 'golden-glow' | 'volcanic';
2
- export type Theme = 'light' | 'dark' | 'glass';
1
+ export type Theme = 'light' | 'dark';
3
2
  export type InitOptions = {
4
3
  projectId: string;
4
+ widgetApiKey: string;
5
5
  apiBaseUrl?: string;
6
6
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
7
7
  theme?: Theme;
8
- orbStyle?: OrbStyle;
8
+ accentColor?: string;
9
9
  widgetTitle?: string;
10
+ widgetSubtitle?: string;
10
11
  widgetButtonTitle?: string;
11
12
  /** Master switch: when false, no LiveKit connect (UI-only). Default: true */
12
13
  agentEnabled?: boolean;
@@ -17,8 +18,9 @@ export type InitOptions = {
17
18
  };
18
19
  export type PublicConfig = {
19
20
  widgetTitle: string;
21
+ widgetSubtitle: string;
20
22
  widgetButtonTitle: string;
21
- orbStyle: OrbStyle;
23
+ accentColor: string;
22
24
  theme: Theme;
23
25
  position: NonNullable<InitOptions['position']>;
24
26
  /** Server-provided CSS variables */
@@ -27,8 +29,21 @@ export type PublicConfig = {
27
29
  export type ConnectionDetails = {
28
30
  serverUrl: string;
29
31
  participantToken: string;
32
+ sessionId: string;
30
33
  };
31
34
  export type Cmd = ['init', InitOptions] | ['open'] | ['close'] | ['update', Partial<InitOptions>];
32
35
  export type BelloQueue = Cmd[] & {
33
36
  push?: (c: Cmd) => number;
34
37
  };
38
+ export type AgentRichMessage = {
39
+ id: string;
40
+ message: string;
41
+ url?: string | null;
42
+ timestamp: number;
43
+ };
44
+ export type InfoModalState = {
45
+ open: boolean;
46
+ fields: string[];
47
+ reason: string;
48
+ resolve: ((value: string) => void) | null;
49
+ };
@@ -4,6 +4,3 @@ export declare function BelloWidget({ opts, theme, onClose, }: {
4
4
  theme: Theme;
5
5
  onClose: () => void;
6
6
  }): import("react/jsx-runtime").JSX.Element;
7
- /** Messages only (no input here anymore) */
8
- declare function ChatRegion(): import("react/jsx-runtime").JSX.Element;
9
- export default ChatRegion;
@@ -0,0 +1,6 @@
1
+ import type { AgentRichMessage } from '../types';
2
+ export interface ChatTranscriptProps {
3
+ agentState?: string;
4
+ agentMessages?: AgentRichMessage[];
5
+ }
6
+ export declare function ChatTranscript({ agentState, agentMessages }: ChatTranscriptProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface ControlBarProps {
2
+ onDisconnect?: () => void;
3
+ isConnected?: boolean;
4
+ }
5
+ export declare function ControlBar({ onDisconnect, isConnected, }: ControlBarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ type InfoCollectionModalProps = {
2
+ open: boolean;
3
+ fields: string[];
4
+ reason: string;
5
+ onSubmit: (data: Record<string, string>) => void;
6
+ onDismiss: () => void;
7
+ };
8
+ export declare function InfoCollectionModal({ open, fields, reason, onSubmit, onDismiss, }: InfoCollectionModalProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Domain validation utilities for RPC-based navigation.
3
+ * Ensures the agent can only navigate to URLs on the same domain
4
+ * as the embedding website.
5
+ */
6
+ export declare function getRootDomain(hostname: string): string;
7
+ export declare function isSameDomain(currentHostname: string, targetUrl: string): boolean;
@@ -0,0 +1,2 @@
1
+ /** Play a soft repeating dial tone using Web Audio API while the agent is connecting. */
2
+ export declare function useCallingTone(active: boolean): void;
@@ -4,7 +4,9 @@ import type { InitOptions } from '../types';
4
4
  * Reliable LiveKit connect flow for embedded usage:
5
5
  * - Resumes AudioContext (autoplay policy)
6
6
  * - Atomic mic + connect with preConnectBuffer
7
- * - Basic event handling + cleanup
7
+ * - ParticipantDisconnected handler (agent leaves → client disconnects)
8
+ * - Session end reporting on disconnect
9
+ * - Token caching to avoid redundant fetches on re-open
8
10
  */
9
11
  export declare function useLiveKit(opts: InitOptions, enabled: boolean): {
10
12
  room: Room;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { type LocalAudioTrack, type RemoteAudioTrack } from 'livekit-client';
3
+ import { type AgentState, type TrackReferenceOrPlaceholder } from '@livekit/components-react';
4
+ export interface AuraVisualizerProps {
5
+ size?: 'icon' | 'sm' | 'md' | 'lg' | 'xl';
6
+ state?: AgentState;
7
+ color?: string;
8
+ colorShift?: number;
9
+ themeMode?: 'dark' | 'light';
10
+ audioTrack?: LocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder;
11
+ }
12
+ export declare function AuraVisualizer({ size, state, color, colorShift, audioTrack, themeMode, className, ...props }: AuraVisualizerProps & React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import React, { type ComponentPropsWithoutRef } from 'react';
2
+ type Vector4<T = number> = [T, T, T, T];
3
+ type Uniform = {
4
+ type: string;
5
+ value: number[] | number;
6
+ };
7
+ type Uniforms = Record<string, Uniform>;
8
+ export interface ReactShaderToyProps {
9
+ fs: string;
10
+ vs?: string;
11
+ uniforms?: Uniforms;
12
+ clearColor?: Vector4;
13
+ precision?: 'highp' | 'lowp' | 'mediump';
14
+ style?: React.CSSProperties;
15
+ contextAttributes?: Record<string, unknown>;
16
+ lerp?: number;
17
+ devicePixelRatio?: number;
18
+ onDoneLoadingTextures?: () => void;
19
+ onError?: (error: string) => void;
20
+ onWarning?: (warning: string) => void;
21
+ }
22
+ export declare function ReactShaderToy({ fs, vs, uniforms: propUniforms, clearColor, precision, style, contextAttributes, lerp, devicePixelRatio, onDoneLoadingTextures, onError, onWarning, ...canvasProps }: ReactShaderToyProps & ComponentPropsWithoutRef<'canvas'>): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type LocalAudioTrack, type RemoteAudioTrack } from 'livekit-client';
2
+ import { type AgentState, type TrackReferenceOrPlaceholder } from '@livekit/components-react';
3
+ export declare function useAuraVisualizer(state: AgentState | undefined, audioTrack?: LocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder): {
4
+ speed: number;
5
+ scale: number;
6
+ amplitude: number;
7
+ frequency: number;
8
+ brightness: number;
9
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@heybello/bello-sdk",
3
3
  "private": false,
4
4
  "description": "Bello SDK for embedding Bello in your applications",
5
- "version": "0.1.0",
5
+ "version": "0.2.0",
6
6
  "type": "module",
7
7
  "main": "dist/bello-embed.umd.cjs",
8
8
  "module": "dist/bello-embed.es.js",
@@ -11,7 +11,9 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "sideEffects": false,
14
+ "sideEffects": [
15
+ "./dist/bello-embed.iife.js"
16
+ ],
15
17
  "exports": {
16
18
  ".": {
17
19
  "types": "./dist/types.d.ts",
@@ -37,14 +39,15 @@
37
39
  "build:types": "tsc -p tsconfig.build.json",
38
40
  "build": "rm -rf dist && pnpm build:embed && pnpm build:react && pnpm build:types"
39
41
  },
42
+ "peerDependencies": {
43
+ "react": "^18 || ^19",
44
+ "react-dom": "^18 || ^19"
45
+ },
40
46
  "dependencies": {
41
47
  "@livekit/components-react": "^2.9.14",
42
- "framer-motion": "^12.23.12",
43
48
  "livekit-client": "^2.15.6",
44
- "lucide": "^0.544.0",
45
- "lucide-react": "^0.544.0",
49
+ "motion": "^12.23.12",
46
50
  "react": "^19.0.0",
47
- "react-ai-orb": "^1.0.13",
48
51
  "react-dom": "^19.0.0"
49
52
  },
50
53
  "devDependencies": {
@@ -1,4 +0,0 @@
1
- import type { ReceivedChatMessage } from '@livekit/components-react';
2
- export default function ChatEntry({ entry, }: {
3
- entry: ReceivedChatMessage;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- export default function ChatInput({ onSend, disabled, }: {
2
- onSend: (text: string) => void;
3
- disabled?: boolean;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import type { TextStreamData, ReceivedChatMessage } from '@livekit/components-react';
2
- import type { Room } from 'livekit-client';
3
- /**
4
- * Public helper used by the hook, intentionally mimicking your Next.js signature:
5
- * transcriptionToChatMessage(transcription, room)
6
- */
7
- export declare function transcriptionToChatMessage(t: TextStreamData, room?: Room): ReceivedChatMessage;