@elevenlabs/convai-widget-core 0.9.0 → 0.10.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/PlaygroundSettings.d.ts +37 -0
- package/dist/contexts/conversation.d.ts +13 -13
- package/dist/index.dev.d.ts +1 -1
- package/dist/index.js +4600 -4552
- package/dist/mocks/browser.d.ts +11 -0
- package/dist/shadowdom.dev.d.ts +1 -0
- package/dist/types/attributes.d.ts +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/utils/display-transcript.d.ts +40 -0
- package/dist/utils/display-transcript.test.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/widget/Transcript.d.ts +2 -2
- package/dist/widget/TranscriptMessage.d.ts +2 -2
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -1,12 +1,6 @@
|
|
|
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];
|
|
10
4
|
export declare const ConversationContext: import("preact").Context<{
|
|
11
5
|
status: import("@preact/signals").Signal<Status>;
|
|
12
6
|
isSpeaking: import("@preact/signals").ReadonlySignal<boolean>;
|
|
@@ -18,7 +12,6 @@ export declare const ConversationContext: import("preact").Context<{
|
|
|
18
12
|
conversationIndex: import("@preact/signals").Signal<number>;
|
|
19
13
|
conversationTextOnly: import("@preact/signals").Signal<boolean | null>;
|
|
20
14
|
transcript: import("@preact/signals").Signal<TranscriptEntry[]>;
|
|
21
|
-
toolCallStatus: import("@preact/signals").Signal<Map<number, Map<string, ToolCallStatusType>>>;
|
|
22
15
|
startSession: (element: HTMLElement, initialMessage?: string) => Promise<string | undefined>;
|
|
23
16
|
endSession: () => Promise<void>;
|
|
24
17
|
getInputVolume: () => number;
|
|
@@ -39,6 +32,19 @@ export type TranscriptEntry = {
|
|
|
39
32
|
message: string;
|
|
40
33
|
isText: boolean;
|
|
41
34
|
conversationIndex: number;
|
|
35
|
+
eventId?: number;
|
|
36
|
+
} | {
|
|
37
|
+
type: "agent_tool_request";
|
|
38
|
+
toolName: string;
|
|
39
|
+
toolCallId: string;
|
|
40
|
+
eventId: number;
|
|
41
|
+
conversationIndex: number;
|
|
42
|
+
} | {
|
|
43
|
+
type: "agent_tool_response";
|
|
44
|
+
toolCallId: string;
|
|
45
|
+
eventId: number;
|
|
46
|
+
isError: boolean;
|
|
47
|
+
conversationIndex: number;
|
|
42
48
|
} | {
|
|
43
49
|
type: "disconnection";
|
|
44
50
|
role: Role;
|
|
@@ -52,11 +58,6 @@ export type TranscriptEntry = {
|
|
|
52
58
|
type: "mode_toggle";
|
|
53
59
|
mode: ConversationMode;
|
|
54
60
|
conversationIndex: number;
|
|
55
|
-
} | {
|
|
56
|
-
type: "tool_call";
|
|
57
|
-
eventId: number;
|
|
58
|
-
conversationIndex: number;
|
|
59
|
-
status?: ToolCallStatusType;
|
|
60
61
|
};
|
|
61
62
|
export declare function ConversationProvider({ children }: ConversationProviderProps): import("preact").JSX.Element;
|
|
62
63
|
export declare function useConversation(): {
|
|
@@ -70,7 +71,6 @@ export declare function useConversation(): {
|
|
|
70
71
|
conversationIndex: import("@preact/signals").Signal<number>;
|
|
71
72
|
conversationTextOnly: import("@preact/signals").Signal<boolean | null>;
|
|
72
73
|
transcript: import("@preact/signals").Signal<TranscriptEntry[]>;
|
|
73
|
-
toolCallStatus: import("@preact/signals").Signal<Map<number, Map<string, ToolCallStatusType>>>;
|
|
74
74
|
startSession: (element: HTMLElement, initialMessage?: string) => Promise<string | undefined>;
|
|
75
75
|
endSession: () => Promise<void>;
|
|
76
76
|
getInputVolume: () => number;
|
package/dist/index.dev.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "./playground.css";
|