@elevenlabs/convai-widget-core 0.8.2 → 0.9.1

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.
@@ -0,0 +1,37 @@
1
+ import { Location } from "./types/config";
2
+ export declare function usePlaygroundSettings(): {
3
+ variant: "tiny" | "compact" | "full";
4
+ setVariant: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<"tiny" | "compact" | "full">>;
5
+ placement: "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right";
6
+ setPlacement: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<"top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right">>;
7
+ location: Location;
8
+ setLocation: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<Location>>;
9
+ micMuting: boolean;
10
+ setMicMuting: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
11
+ transcript: boolean;
12
+ setTranscript: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
13
+ textInput: boolean;
14
+ setTextInput: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
15
+ textOnly: boolean;
16
+ setTextOnly: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
17
+ alwaysExpanded: boolean;
18
+ setAlwaysExpanded: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
19
+ dismissible: boolean;
20
+ setDismissible: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
21
+ showAgentStatus: boolean;
22
+ setShowAgentStatus: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
23
+ dynamicVariablesStr: string;
24
+ setDynamicVariablesStr: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>;
25
+ dynamicVariables: Record<string, string>;
26
+ expanded: boolean;
27
+ setExpanded: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
28
+ overrideFirstMessage: boolean;
29
+ setOverrideFirstMessage: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
30
+ firstMessage: string;
31
+ setFirstMessage: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<string>>;
32
+ };
33
+ export type PlaygroundSettingsState = ReturnType<typeof usePlaygroundSettings>;
34
+ export declare function PlaygroundSettingsPanel({ state, onToggleExpand, }: {
35
+ state: PlaygroundSettingsState;
36
+ onToggleExpand: () => void;
37
+ }): import("preact").JSX.Element;
@@ -16,6 +16,8 @@ declare const ICON_MAP: {
16
16
  wrap: typeof WrapTextIcon;
17
17
  maximize: typeof MaximizeIcon;
18
18
  minimize: typeof MinimizeIcon;
19
+ loader: typeof LoaderIcon;
20
+ x: typeof XIcon;
19
21
  };
20
22
  declare const SIZE_CLASSES: {
21
23
  xs: string;
@@ -52,4 +54,6 @@ export declare function FeedbackIcon({ orbColor, circleBackgroundColor, starColo
52
54
  }): JSX.Element;
53
55
  declare function MaximizeIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
54
56
  declare function MinimizeIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
57
+ declare function LoaderIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
58
+ declare function XIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
55
59
  export {};
@@ -1,6 +1,12 @@
1
1
  import { Mode, Role, Status } from "@elevenlabs/client";
2
2
  import { ComponentChildren } from "preact";
3
3
  import { ConversationMode } from "./conversation-mode";
4
+ export declare const ToolCallStatus: {
5
+ readonly LOADING: "loading";
6
+ readonly SUCCESS: "success";
7
+ readonly ERROR: "error";
8
+ };
9
+ export type ToolCallStatusType = (typeof ToolCallStatus)[keyof typeof ToolCallStatus];
4
10
  export declare const ConversationContext: import("preact").Context<{
5
11
  status: import("@preact/signals").Signal<Status>;
6
12
  isSpeaking: import("@preact/signals").ReadonlySignal<boolean>;
@@ -12,6 +18,7 @@ export declare const ConversationContext: import("preact").Context<{
12
18
  conversationIndex: import("@preact/signals").Signal<number>;
13
19
  conversationTextOnly: import("@preact/signals").Signal<boolean | null>;
14
20
  transcript: import("@preact/signals").Signal<TranscriptEntry[]>;
21
+ toolCallStatus: import("@preact/signals").Signal<Map<number, Map<string, ToolCallStatusType>>>;
15
22
  startSession: (element: HTMLElement, initialMessage?: string) => Promise<string | undefined>;
16
23
  endSession: () => Promise<void>;
17
24
  getInputVolume: () => number;
@@ -45,6 +52,11 @@ export type TranscriptEntry = {
45
52
  type: "mode_toggle";
46
53
  mode: ConversationMode;
47
54
  conversationIndex: number;
55
+ } | {
56
+ type: "tool_call";
57
+ eventId: number;
58
+ conversationIndex: number;
59
+ status?: ToolCallStatusType;
48
60
  };
49
61
  export declare function ConversationProvider({ children }: ConversationProviderProps): import("preact").JSX.Element;
50
62
  export declare function useConversation(): {
@@ -58,6 +70,7 @@ export declare function useConversation(): {
58
70
  conversationIndex: import("@preact/signals").Signal<number>;
59
71
  conversationTextOnly: import("@preact/signals").Signal<boolean | null>;
60
72
  transcript: import("@preact/signals").Signal<TranscriptEntry[]>;
73
+ toolCallStatus: import("@preact/signals").Signal<Map<number, Map<string, ToolCallStatusType>>>;
61
74
  startSession: (element: HTMLElement, initialMessage?: string) => Promise<string | undefined>;
62
75
  endSession: () => Promise<void>;
63
76
  getInputVolume: () => number;
@@ -1 +1 @@
1
- export {};
1
+ import "./playground.css";