@tavus/widget 0.12.0 → 0.13.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.
@@ -1,3 +1,5 @@
1
+ import { StartConversationOptions } from './host-types.ts';
2
+ export type { StartConversationOptions } from './host-types.ts';
1
3
  export type TavusInteraction = {
2
4
  event_type: "conversation.echo";
3
5
  properties: {
@@ -59,6 +61,24 @@ export interface TavusEventMap {
59
61
  };
60
62
  }
61
63
  export declare const TAVUS_EVENT_NAMES: TavusEventName[];
64
+ interface TavusElementTavusApi {
65
+ start?: () => Promise<void>;
66
+ end?: () => Promise<void>;
67
+ sendChat?: (text: string) => void;
68
+ sendMessage?: (interaction: TavusInteraction) => void;
69
+ }
70
+ export interface TavusElement extends HTMLElement {
71
+ open?: () => void;
72
+ close?: () => void;
73
+ /** Resolves even when the start fails — failures arrive as `tavus:error`. */
74
+ startConversation?: (options?: StartConversationOptions) => Promise<void>;
75
+ endConversation?: () => Promise<void>;
76
+ /** Legacy string-based send; prefer el.tavus.sendMessage for typed interactions. */
77
+ sendMessage?: (input: TavusInteraction | string) => void;
78
+ updateConfig?: (config: Record<string, unknown>) => void;
79
+ destroy?: () => void;
80
+ tavus?: TavusElementTavusApi;
81
+ }
62
82
  export declare class TavusIntegration {
63
83
  private element;
64
84
  private tagName;
@@ -66,7 +86,7 @@ export declare class TavusIntegration {
66
86
  private getElement;
67
87
  open(): void;
68
88
  close(): void;
69
- startConversation(): void;
89
+ startConversation(options?: StartConversationOptions): void;
70
90
  endConversation(): void;
71
91
  /**
72
92
  * Send a typed interaction or a plain text string (back-compat shim).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/widget",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Tavus conversational video AI <tavus-widget> launcher custom element for the web.",
5
5
  "keywords": [
6
6
  "ai",