@tavus/widget 0.13.0 → 0.14.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.
@@ -25,13 +25,17 @@ export type TavusInteraction = {
25
25
  context: string;
26
26
  };
27
27
  };
28
- export type TavusEventName = "tavus:ready" | "tavus:conversation-started" | "tavus:conversation-ended" | "tavus:error" | "tavus:state-change" | "tavus:chat-message"
28
+ export type TavusEventName = "tavus:ready" | "tavus:conversation-created" | "tavus:conversation-started" | "tavus:conversation-ended" | "tavus:error" | "tavus:state-change" | "tavus:chat-message"
29
29
  /** Retained for type-back-compat; never emitted at runtime. */
30
30
  | "tavus:message" | "tavus:protocol-message" | "tavus:tool-call" | "tavus:mode-change";
31
31
  export interface TavusEventMap {
32
32
  "tavus:ready": {
33
33
  deploymentId: string;
34
34
  };
35
+ /** The room exists and the replica is warming up; nobody has joined yet. */
36
+ "tavus:conversation-created": {
37
+ conversationId: string;
38
+ };
35
39
  "tavus:conversation-started": {
36
40
  conversationId: string;
37
41
  };
@@ -70,6 +74,10 @@ interface TavusElementTavusApi {
70
74
  export interface TavusElement extends HTMLElement {
71
75
  open?: () => void;
72
76
  close?: () => void;
77
+ /** Creates the room without joining it; the next start joins it. Rejects on failure. */
78
+ createConversation?: () => Promise<{
79
+ conversationId: string;
80
+ }>;
73
81
  /** Resolves even when the start fails — failures arrive as `tavus:error`. */
74
82
  startConversation?: (options?: StartConversationOptions) => Promise<void>;
75
83
  endConversation?: () => Promise<void>;
@@ -86,6 +94,15 @@ export declare class TavusIntegration {
86
94
  private getElement;
87
95
  open(): void;
88
96
  close(): void;
97
+ /**
98
+ * Create the conversation now and join it on the next `startConversation()`.
99
+ * Lets the replica warm up while the visitor is still on the preview or the
100
+ * host's own haircheck. Rejects when the room could not be created; a later
101
+ * start then creates one as usual.
102
+ */
103
+ createConversation(): Promise<{
104
+ conversationId: string;
105
+ }>;
89
106
  startConversation(options?: StartConversationOptions): void;
90
107
  endConversation(): void;
91
108
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/widget",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Tavus conversational video AI <tavus-widget> launcher custom element for the web.",
5
5
  "keywords": [
6
6
  "ai",