@tavus/embed 0.0.1-beta.1 → 0.0.1-beta.11
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/index.d.ts +14 -1
- package/dist/index.iife.js +170 -0
- package/dist/index.mjs +27689 -0
- package/dist/integration.d.ts +80 -0
- package/package.json +9 -6
- package/dist/index.js +0 -58
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export type TavusInteraction = {
|
|
2
|
+
event_type: "conversation.echo";
|
|
3
|
+
properties: {
|
|
4
|
+
text: string;
|
|
5
|
+
modality?: "text";
|
|
6
|
+
};
|
|
7
|
+
} | {
|
|
8
|
+
event_type: "conversation.respond";
|
|
9
|
+
properties: {
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
event_type: "conversation.interrupt";
|
|
14
|
+
properties?: Record<string, never>;
|
|
15
|
+
} | {
|
|
16
|
+
event_type: "conversation.append_llm_context";
|
|
17
|
+
properties: {
|
|
18
|
+
context: string;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
event_type: "conversation.overwrite_llm_context";
|
|
22
|
+
properties: {
|
|
23
|
+
context: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type TavusEventName = "tavus:ready" | "tavus:conversation-started" | "tavus:conversation-ended" | "tavus:error" | "tavus:state-change" | "tavus:chat-message"
|
|
27
|
+
/** Retained for type-back-compat; never emitted at runtime. */
|
|
28
|
+
| "tavus:message" | "tavus:protocol-message" | "tavus:tool-call" | "tavus:mode-change";
|
|
29
|
+
export interface TavusEventMap {
|
|
30
|
+
"tavus:ready": {
|
|
31
|
+
deploymentId: string;
|
|
32
|
+
};
|
|
33
|
+
"tavus:conversation-started": {
|
|
34
|
+
conversationId: string;
|
|
35
|
+
};
|
|
36
|
+
"tavus:conversation-ended": {
|
|
37
|
+
conversationId: string;
|
|
38
|
+
};
|
|
39
|
+
"tavus:error": {
|
|
40
|
+
code: string;
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
"tavus:state-change": {
|
|
44
|
+
state: string;
|
|
45
|
+
};
|
|
46
|
+
"tavus:chat-message": unknown;
|
|
47
|
+
/** Retained for type-back-compat; never emitted at runtime. */
|
|
48
|
+
"tavus:message": unknown;
|
|
49
|
+
/** Firehose: fires for every observable protocol event. Switch on `event.detail.kind` or `event.detail.event_type`. */
|
|
50
|
+
"tavus:protocol-message": unknown;
|
|
51
|
+
"tavus:tool-call": {
|
|
52
|
+
name: string;
|
|
53
|
+
arguments: string;
|
|
54
|
+
seq?: number;
|
|
55
|
+
turn_idx?: number;
|
|
56
|
+
};
|
|
57
|
+
"tavus:mode-change": {
|
|
58
|
+
mode: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export declare const TAVUS_EVENT_NAMES: TavusEventName[];
|
|
62
|
+
export declare class TavusIntegration {
|
|
63
|
+
private element;
|
|
64
|
+
private tagName;
|
|
65
|
+
constructor(tagName?: "tavus-widget" | "tavus-embed");
|
|
66
|
+
private getElement;
|
|
67
|
+
open(): void;
|
|
68
|
+
close(): void;
|
|
69
|
+
startConversation(): void;
|
|
70
|
+
endConversation(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Send a typed interaction or a plain text string (back-compat shim).
|
|
73
|
+
* String input is wrapped as `conversation.respond`.
|
|
74
|
+
*/
|
|
75
|
+
sendMessage(input: TavusInteraction | string): void;
|
|
76
|
+
updateConfig(config: Record<string, unknown>): void;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
on<K extends TavusEventName>(event: K, handler: (e: CustomEvent<TavusEventMap[K]>) => void): void;
|
|
79
|
+
off<K extends TavusEventName>(event: K, handler: (e: CustomEvent<TavusEventMap[K]>) => void): void;
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tavus/embed",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.11",
|
|
4
4
|
"description": "Tavus conversational video AI <tavus-embed> custom element for the web.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -29,15 +29,18 @@
|
|
|
29
29
|
"LICENSE"
|
|
30
30
|
],
|
|
31
31
|
"type": "module",
|
|
32
|
-
"sideEffects":
|
|
33
|
-
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"./dist/index.iife.js",
|
|
34
|
+
"./dist/index.mjs"
|
|
35
|
+
],
|
|
36
|
+
"main": "./dist/index.mjs",
|
|
34
37
|
"types": "./dist/index.d.ts",
|
|
35
|
-
"unpkg": "./dist/index.js",
|
|
36
|
-
"jsdelivr": "./dist/index.js",
|
|
38
|
+
"unpkg": "./dist/index.iife.js",
|
|
39
|
+
"jsdelivr": "./dist/index.iife.js",
|
|
37
40
|
"exports": {
|
|
38
41
|
".": {
|
|
39
42
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"default": "./dist/index.
|
|
43
|
+
"default": "./dist/index.mjs"
|
|
41
44
|
},
|
|
42
45
|
"./package.json": "./package.json"
|
|
43
46
|
},
|