@cuekit-ai/react 1.2.3 → 1.3.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.
@@ -22668,11 +22668,334 @@ var setWebRTCConnectionState = (state) => {
22668
22668
  };
22669
22669
 
22670
22670
  // src/constants/index.ts
22671
- var WEBRTC_BACKEND_SERVER_URL = "https://api-webrtc.cuekit.ai";
22671
+ var WEBRTC_BACKEND_SERVER_URL = "https://api-webrtc-dev.cuekit.ai";
22672
+
22673
+ // src/utils/jsx-encoder.ts
22674
+ function generateStableDOMId(element) {
22675
+ const tagName = element.tagName.toLowerCase();
22676
+ const text = (element.textContent || "").trim().substring(0, 50);
22677
+ let sibling = element.previousElementSibling;
22678
+ let position = 1;
22679
+ while (sibling) {
22680
+ if (sibling.tagName === element.tagName) {
22681
+ position++;
22682
+ }
22683
+ sibling = sibling.previousElementSibling;
22684
+ }
22685
+ const path = getElementPath(element);
22686
+ const idString = `${tagName}[${position}]_(${text})_${path}`;
22687
+ let hash = 0;
22688
+ for (let i = 0; i < idString.length; i++) {
22689
+ const char = idString.charCodeAt(i);
22690
+ hash = (hash << 5) - hash + char;
22691
+ hash |= 0;
22692
+ }
22693
+ return hash.toString(36);
22694
+ }
22695
+ function getElementPath(element) {
22696
+ if (element.id) {
22697
+ return `id(${element.id})`;
22698
+ }
22699
+ if (element.tagName.toLowerCase() === "body") {
22700
+ return "/body";
22701
+ }
22702
+ let ix = 0;
22703
+ const siblings = element.parentNode?.children || new HTMLCollection();
22704
+ for (let i = 0; i < siblings.length; i++) {
22705
+ const sibling = siblings[i];
22706
+ if (sibling === element) {
22707
+ return `${getElementPath(element.parentNode)}/${element.tagName}[${ix + 1}]`;
22708
+ }
22709
+ if (sibling.nodeType === 1 && sibling.tagName === element.tagName) {
22710
+ ix++;
22711
+ }
22712
+ }
22713
+ return "not_found";
22714
+ }
22715
+
22716
+ // src/utils/patch-react.ts
22717
+ function getImmediateText(element) {
22718
+ let text = "";
22719
+ if (element.childNodes) {
22720
+ for (const node of Array.from(element.childNodes)) {
22721
+ if (node.nodeType === 3) {
22722
+ text += node.textContent || "";
22723
+ }
22724
+ }
22725
+ }
22726
+ return text.trim();
22727
+ }
22728
+ function captureFullDOMStructure() {
22729
+ console.log("\u{1F333} Capturing full DOM structure...");
22730
+ const components = [];
22731
+ const interactiveElements = document.querySelectorAll(
22732
+ 'a, button, input, textarea, select, [role="button"], [onclick]'
22733
+ );
22734
+ interactiveElements.forEach((element) => {
22735
+ if (element instanceof HTMLElement && !element.closest("[data-cuekit-ignore]")) {
22736
+ const nodeData = buildFlatDOMNode(element);
22737
+ if (nodeData) {
22738
+ components.push(nodeData);
22739
+ }
22740
+ }
22741
+ });
22742
+ const result = { components };
22743
+ console.log("\u{1F333} Full DOM structure captured:", result);
22744
+ return result;
22745
+ }
22746
+ function buildFlatDOMNode(element) {
22747
+ if (element.tagName.toLowerCase() === "script" || element.hasAttribute("data-cuekit-ignore") || element.style.display === "none" || element.style.visibility === "hidden") {
22748
+ return null;
22749
+ }
22750
+ const hash = generateStableDOMId(element);
22751
+ const text = getImmediateText(element).substring(0, 100);
22752
+ const isClickable = isElementClickable(element);
22753
+ const componentType = element.tagName.toLowerCase();
22754
+ return {
22755
+ hash,
22756
+ text,
22757
+ isClickable,
22758
+ componentType,
22759
+ children: []
22760
+ // No children in a flat structure
22761
+ };
22762
+ }
22763
+ function isElementClickable(element) {
22764
+ const interactiveSelectors = [
22765
+ "button",
22766
+ "a",
22767
+ "input",
22768
+ "select",
22769
+ "textarea",
22770
+ '[role="button"]',
22771
+ '[role="link"]',
22772
+ '[role="tab"]',
22773
+ "[data-onclick-id]",
22774
+ "[data-on-press-id]",
22775
+ "[onclick]",
22776
+ "[onmousedown]",
22777
+ "[onmouseup]",
22778
+ "[ontouchstart]",
22779
+ "[ontouchend]",
22780
+ "[onkeydown]",
22781
+ "[onkeyup]",
22782
+ "[onkeypress]"
22783
+ ];
22784
+ for (const selector of interactiveSelectors) {
22785
+ if (element.matches(selector)) {
22786
+ return true;
22787
+ }
22788
+ }
22789
+ const hasClickEvents = element.onclick !== null || element.getAttribute("onclick") !== null;
22790
+ const hasInteractiveEvents = element.ontouchstart !== null || element.getAttribute("ontouchstart") !== null || element.ontouchend !== null || element.getAttribute("ontouchend") !== null || element.onkeydown !== null || element.getAttribute("onkeydown") !== null || element.onkeyup !== null || element.getAttribute("onkeyup") !== null || element.onkeypress !== null || element.getAttribute("onkeypress") !== null;
22791
+ const hasPointerCursor = element.style.cursor === "pointer" || getComputedStyle(element).cursor === "pointer";
22792
+ const hasTabIndex = element.hasAttribute("tabindex") && parseInt(element.getAttribute("tabindex") || "0") >= 0;
22793
+ const hasInteractiveDataAttrs = element.hasAttribute("data-clickable") || element.hasAttribute("data-interactive") || element.hasAttribute("data-action") || element.hasAttribute("data-handler");
22794
+ const hasInteractiveAria = element.hasAttribute("aria-pressed") || element.hasAttribute("aria-expanded") || element.hasAttribute("aria-selected") || element.hasAttribute("aria-checked");
22795
+ return hasClickEvents || hasInteractiveEvents || hasPointerCursor || hasTabIndex || hasInteractiveDataAttrs || hasInteractiveAria;
22796
+ }
22797
+
22798
+ // src/core/intent-store.ts
22799
+ var store = {
22800
+ screenMetadata: {},
22801
+ allElementsData: []
22802
+ };
22803
+ var GlobalStore = {
22804
+ // 🔹 Screen Metadata Methods
22805
+ setMetadata(screen, metadata) {
22806
+ store.screenMetadata[screen] = metadata;
22807
+ },
22808
+ getMetadata(screen) {
22809
+ return store.screenMetadata[screen];
22810
+ },
22811
+ clearMetadata(screen) {
22812
+ delete store.screenMetadata[screen];
22813
+ },
22814
+ // 🔹 Generic Store Access Methods
22815
+ setData(key, value) {
22816
+ store[key] = value;
22817
+ },
22818
+ getData(key) {
22819
+ return store[key];
22820
+ },
22821
+ clearData(key) {
22822
+ delete store[key];
22823
+ },
22824
+ // 🔹 Element Data Management
22825
+ setElement(elementData) {
22826
+ const index = store.allElementsData.findIndex((e2) => e2.elementId === elementData.elementId);
22827
+ if (index >= 0) {
22828
+ console.log("Updating existing element");
22829
+ store.allElementsData[index] = elementData;
22830
+ } else {
22831
+ console.log("Adding new element");
22832
+ store.allElementsData.push(elementData);
22833
+ }
22834
+ },
22835
+ getElementById(elementId) {
22836
+ const match = store.allElementsData.find((e2) => e2.elementId === elementId);
22837
+ if (!match) {
22838
+ console.warn(`[GlobalStore] No element found for ID: ${elementId}`);
22839
+ console.log("All elements in store:", store.allElementsData);
22840
+ }
22841
+ return match;
22842
+ },
22843
+ deleteElementById(id) {
22844
+ store.allElementsData = store.allElementsData.filter((e2) => e2.elementId !== id);
22845
+ },
22846
+ clearAllElements() {
22847
+ store.allElementsData = [];
22848
+ }
22849
+ };
22850
+
22851
+ // src/core/navigation.ts
22852
+ var navigation;
22853
+ var navigationHandler = null;
22854
+ function setNavigationHandler(handler) {
22855
+ navigationHandler = handler;
22856
+ }
22857
+ function navigate(path, params) {
22858
+ const safeParams = params || {};
22859
+ const absolutePath = path.startsWith("/") ? path : `/${path}`;
22860
+ if (navigationHandler) {
22861
+ try {
22862
+ navigationHandler(absolutePath, safeParams);
22863
+ } catch (error) {
22864
+ console.error("[CueKit] navigation handler failed, falling back to default:", error);
22865
+ }
22866
+ return;
22867
+ }
22868
+ let fullPath = absolutePath;
22869
+ if (safeParams) {
22870
+ const searchParams = new URLSearchParams(safeParams).toString();
22871
+ if (searchParams) {
22872
+ fullPath += `?${searchParams}`;
22873
+ }
22874
+ }
22875
+ if (navigation) {
22876
+ navigation.push(fullPath);
22877
+ } else {
22878
+ if (typeof window !== "undefined") {
22879
+ window.location.href = fullPath;
22880
+ }
22881
+ }
22882
+ }
22883
+ var getCurrentPath = () => {
22884
+ if (typeof window === "undefined") return "";
22885
+ return window.location.pathname;
22886
+ };
22887
+ var getSearchParams = () => {
22888
+ if (typeof window === "undefined") return new URLSearchParams();
22889
+ return new URLSearchParams(window.location.search);
22890
+ };
22891
+ var safeNavigate = (name, params = {}) => {
22892
+ if (name) {
22893
+ navigate(name, params);
22894
+ } else {
22895
+ console.warn("[CueKit] route name not provided");
22896
+ }
22897
+ };
22898
+ function getCurrentScreenName() {
22899
+ try {
22900
+ const path = getCurrentPath();
22901
+ return path || "UnknownScreen";
22902
+ } catch (e2) {
22903
+ return "UnknownScreen";
22904
+ }
22905
+ }
22906
+ function getCurrentRouteParams() {
22907
+ try {
22908
+ const params = {};
22909
+ const searchParams = getSearchParams();
22910
+ if (searchParams instanceof URLSearchParams) {
22911
+ searchParams.forEach((value, key) => {
22912
+ params[key] = value;
22913
+ });
22914
+ } else {
22915
+ return searchParams;
22916
+ }
22917
+ return params;
22918
+ } catch (e2) {
22919
+ return {};
22920
+ }
22921
+ }
22922
+ function onStateChange() {
22923
+ const routeName = getCurrentScreenName();
22924
+ const params = getCurrentRouteParams();
22925
+ if (params && params.metadata) {
22926
+ try {
22927
+ const metadata = JSON.parse(params.metadata);
22928
+ GlobalStore.setMetadata(routeName, metadata);
22929
+ } catch (error) {
22930
+ console.error("Failed to parse metadata from URL:", error);
22931
+ }
22932
+ }
22933
+ }
22934
+ var handleNavigationAndClick = (routeName, elementHash) => {
22935
+ safeNavigate(routeName);
22936
+ if (typeof MutationObserver === "undefined" || typeof document === "undefined") return;
22937
+ const observer = new MutationObserver((mutationsList, observer2) => {
22938
+ setTimeout(() => {
22939
+ const allElements = document.querySelectorAll("*");
22940
+ let elementToClick = null;
22941
+ for (const element of allElements) {
22942
+ if (element instanceof HTMLElement) {
22943
+ const tagName = element.tagName.toLowerCase();
22944
+ const text = (element.textContent || "").trim().substring(0, 50);
22945
+ let sibling = element.previousElementSibling;
22946
+ let position = 1;
22947
+ while (sibling) {
22948
+ if (sibling.tagName === element.tagName) {
22949
+ position++;
22950
+ }
22951
+ sibling = sibling.previousElementSibling;
22952
+ }
22953
+ const path = getElementPath2(element);
22954
+ const idString = `${tagName}[${position}]_(${text})_${path}`;
22955
+ let hash = 0;
22956
+ for (let i = 0; i < idString.length; i++) {
22957
+ const char = idString.charCodeAt(i);
22958
+ hash = (hash << 5) - hash + char;
22959
+ hash |= 0;
22960
+ }
22961
+ const elementHashValue = hash.toString(36);
22962
+ if (elementHashValue === elementHash) {
22963
+ elementToClick = element;
22964
+ break;
22965
+ }
22966
+ }
22967
+ }
22968
+ if (elementToClick) {
22969
+ elementToClick.click();
22970
+ observer2.disconnect();
22971
+ }
22972
+ }, 100);
22973
+ });
22974
+ observer.observe(document.body, { childList: true, subtree: true });
22975
+ };
22976
+ function getElementPath2(element) {
22977
+ if (element.id) {
22978
+ return `id(${element.id})`;
22979
+ }
22980
+ const path = [];
22981
+ let current = element;
22982
+ while (current && current !== document.body) {
22983
+ let index = 1;
22984
+ let sibling = current.previousElementSibling;
22985
+ while (sibling) {
22986
+ if (sibling.tagName === current.tagName) {
22987
+ index++;
22988
+ }
22989
+ sibling = sibling.previousElementSibling;
22990
+ }
22991
+ path.unshift(`${current.tagName.toLowerCase()}[${index}]`);
22992
+ current = current.parentElement;
22993
+ }
22994
+ return path.join("/");
22995
+ }
22672
22996
 
22673
22997
  // src/utils/webrtc-service.ts
22674
22998
  var room = null;
22675
- var eventSource = null;
22676
22999
  var reconnectTimeout = null;
22677
23000
  var serverUrl = WEBRTC_BACKEND_SERVER_URL || "https://bdd4c945f073.ngrok-free.app";
22678
23001
  var callbacks = {};
@@ -22792,19 +23115,17 @@ function setupEventListeners() {
22792
23115
  }).on(RoomEvent.TrackUnsubscribed, (track) => {
22793
23116
  track.detach().forEach((element) => element.remove());
22794
23117
  }).on(RoomEvent.DataReceived, (payload, participant) => {
22795
- handleDataReceived(payload, participant);
23118
+ try {
23119
+ const message = JSON.parse(new TextDecoder().decode(payload));
23120
+ callbacks.onNavigationCommand?.(message);
23121
+ } catch (error) {
23122
+ const message = new TextDecoder().decode(payload);
23123
+ callbacks.onNavigationCommand?.({ type: "raw_text", data: message });
23124
+ }
22796
23125
  }).on(RoomEvent.Disconnected, () => {
22797
23126
  setWebRTCConnectionState({ isConnected: false, isConnecting: false });
22798
23127
  });
22799
23128
  }
22800
- function handleDataReceived(payload, participant) {
22801
- try {
22802
- const message = JSON.parse(new TextDecoder().decode(payload));
22803
- callbacks.onNavigationCommand?.(message);
22804
- } catch (error) {
22805
- console.error("\u{1F3A4} WebRTCService: Error parsing data:", error);
22806
- }
22807
- }
22808
23129
  function updateParticipantsList() {
22809
23130
  if (!room) return;
22810
23131
  const participants = [
@@ -22817,7 +23138,9 @@ function updateParticipantsList() {
22817
23138
  async function sendData(data, reliable = true) {
22818
23139
  if (!room) throw new Error("Not connected to room");
22819
23140
  try {
22820
- await room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify(data)), {
23141
+ const encoder = new TextEncoder();
23142
+ const encodedData = encoder.encode(data);
23143
+ await room.localParticipant.publishData(encodedData, {
22821
23144
  reliable
22822
23145
  });
22823
23146
  } catch (error) {
@@ -22848,14 +23171,28 @@ function getParticipants() {
22848
23171
  }
22849
23172
  async function sendUserCommand(command) {
22850
23173
  if (!room) return;
22851
- const userCommand = {
22852
- type: "user_command",
22853
- data: {
22854
- command,
22855
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
22856
- }
22857
- };
22858
- await sendData(userCommand);
23174
+ await sendData(command);
23175
+ }
23176
+ async function sendRuntimeData() {
23177
+ if (!room) {
23178
+ console.error("\u274C Cannot send runtime data without a room connection");
23179
+ return;
23180
+ }
23181
+ try {
23182
+ const domStructure = captureFullDOMStructure();
23183
+ const screenName = getCurrentScreenName();
23184
+ const response = {
23185
+ type: "runtime_data_response",
23186
+ data: {
23187
+ components: domStructure.components,
23188
+ current_screen: screenName
23189
+ }
23190
+ };
23191
+ await sendData(JSON.stringify(response));
23192
+ console.log("\u{1F4E6} Runtime data sent successfully");
23193
+ } catch (error) {
23194
+ console.error("\u274C Failed to send runtime data:", error);
23195
+ }
22859
23196
  }
22860
23197
  async function sendStaticData(componentData, appId = "default") {
22861
23198
  try {
@@ -22886,10 +23223,6 @@ async function disconnectFromRoom() {
22886
23223
  await room.disconnect();
22887
23224
  room = null;
22888
23225
  }
22889
- if (eventSource) {
22890
- eventSource.close();
22891
- eventSource = null;
22892
- }
22893
23226
  if (reconnectTimeout) {
22894
23227
  clearTimeout(reconnectTimeout);
22895
23228
  reconnectTimeout = null;
@@ -22913,6 +23246,11 @@ export {
22913
23246
  setApiKey,
22914
23247
  setAppId,
22915
23248
  setWebRTCConfig,
23249
+ GlobalStore,
23250
+ setNavigationHandler,
23251
+ safeNavigate,
23252
+ onStateChange,
23253
+ handleNavigationAndClick,
22916
23254
  WEBRTC_BACKEND_SERVER_URL,
22917
23255
  RoomEvent,
22918
23256
  ParticipantEvent,
@@ -22920,6 +23258,7 @@ export {
22920
23258
  createAudioAnalyser,
22921
23259
  Participant,
22922
23260
  ConnectionState,
23261
+ captureFullDOMStructure,
22923
23262
  setServerUrl,
22924
23263
  setAudioContainer,
22925
23264
  setWebRTCCallbacks,
@@ -22931,6 +23270,7 @@ export {
22931
23270
  getRoomName,
22932
23271
  getParticipants,
22933
23272
  sendUserCommand,
23273
+ sendRuntimeData,
22934
23274
  sendStaticData,
22935
23275
  disconnectFromRoom,
22936
23276
  getRoom
package/dist/index.d.mts CHANGED
@@ -149,7 +149,7 @@ interface NavigationCommand {
149
149
  duration?: number;
150
150
  timestamp?: number;
151
151
  }
152
- declare function sendData(data: any, reliable?: boolean): Promise<void>;
152
+ declare function sendData(data: string, reliable?: boolean): Promise<void>;
153
153
  declare function sendScreenStatus(screenData: any): Promise<void>;
154
154
  declare function sendUserCommand(command: string): Promise<void>;
155
155
  declare function sendStaticData(componentData: any, appId?: string): Promise<{
@@ -162,97 +162,6 @@ declare function sendStaticData(componentData: any, appId?: string): Promise<{
162
162
  data?: undefined;
163
163
  }>;
164
164
 
165
- interface UserSpeechChunkData {
166
- text_chunk: string;
167
- is_final: boolean;
168
- }
169
- interface AISpeechChunkData {
170
- text_chunk: string;
171
- is_final: boolean;
172
- }
173
- interface AIIntentData {
174
- intent: string;
175
- routeName: string | null;
176
- actionType: string;
177
- confidence: number;
178
- actionMetadata: {
179
- elementId: string | null;
180
- routeName: string | null;
181
- };
182
- }
183
- interface AIInterruptedData {
184
- message: string;
185
- }
186
- interface RequestRuntimeData {
187
- session_id: string;
188
- }
189
- interface StaticDataReadyData {
190
- [key: string]: any;
191
- }
192
- interface ToolLogData {
193
- [key: string]: any;
194
- }
195
- type SSEActionEvent = {
196
- type: 'user_speech_chunk';
197
- timestamp?: number;
198
- data: UserSpeechChunkData;
199
- } | {
200
- type: 'ai_speech_chunk';
201
- timestamp?: number;
202
- data: AISpeechChunkData;
203
- } | {
204
- type: 'ai_intent';
205
- timestamp?: number;
206
- data: AIIntentData;
207
- } | {
208
- type: 'ai_interrupted';
209
- timestamp?: number;
210
- data: AIInterruptedData;
211
- } | {
212
- type: 'request_runtime_data';
213
- timestamp?: number;
214
- data: RequestRuntimeData;
215
- } | {
216
- type: 'static_data_ready';
217
- data: StaticDataReadyData;
218
- } | {
219
- type: 'tool_log';
220
- data: ToolLogData;
221
- } | {
222
- type: 'connection';
223
- status: 'connected';
224
- app_id?: string;
225
- } | {
226
- type: 'keepalive';
227
- timestamp?: number;
228
- };
229
- interface SSEServiceCallbacks {
230
- onActionEvent?: (event: SSEActionEvent) => void;
231
- onConnectionChange?: (isConnected: boolean) => void;
232
- onConversationUpdate?: (entry: {
233
- speaker: 'user' | 'ai';
234
- text: string;
235
- is_final: boolean;
236
- }) => void;
237
- onIntentUpdate?: (intent: AIIntentData) => void;
238
- onToolStatusUpdate?: (status: any) => void;
239
- onStaticDataUpdate?: (data: any) => void;
240
- onError?: (error: string) => void;
241
- }
242
- declare function setSSECallbacks(newCallbacks: SSEServiceCallbacks): void;
243
- declare function connectSSE(newSessionId: string): Promise<void>;
244
- declare function sendRuntimeData(): Promise<void>;
245
- declare function sendDashboardData(dashboardData: any): Promise<void>;
246
- declare function sendElementData(appId?: string): Promise<{
247
- app_id: string;
248
- current_page: string;
249
- dom_structure: FullDOMStructure;
250
- timestamp: number;
251
- }>;
252
- declare function disconnectSSE(): void;
253
- declare function getSSEConnectionStatus(): boolean;
254
- declare function getSSEConnectionState(): string;
255
-
256
165
  interface ChatMessage {
257
166
  id: string;
258
167
  role: 'user' | 'ai';
@@ -269,8 +178,6 @@ declare const useCuekit: (options?: {
269
178
  onAISpeechEnd?: (trackId: string) => void;
270
179
  appId?: string;
271
180
  }) => {
272
- isSseConnected: boolean;
273
- lastActionEvent: SSEActionEvent | null;
274
181
  messages: ChatMessage[];
275
182
  micState: MicState;
276
183
  setMicState: React.Dispatch<React.SetStateAction<MicState>>;
@@ -372,4 +279,4 @@ declare function getFullDOMStructure(): FullDOMStructure;
372
279
  */
373
280
  declare function captureFullDOMStructure(): FullDOMStructure;
374
281
 
375
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type SSEActionEvent, type SSEServiceCallbacks, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, connectSSE, disconnectSSE, executeAction, getFullDOMStructure, getSSEConnectionState, getSSEConnectionStatus, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, sendDashboardData, sendElementData, sendRuntimeData, setSSECallbacks, useCuekit, useQubeContext, useWebRTC };
282
+ export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };
package/dist/index.d.ts CHANGED
@@ -149,7 +149,7 @@ interface NavigationCommand {
149
149
  duration?: number;
150
150
  timestamp?: number;
151
151
  }
152
- declare function sendData(data: any, reliable?: boolean): Promise<void>;
152
+ declare function sendData(data: string, reliable?: boolean): Promise<void>;
153
153
  declare function sendScreenStatus(screenData: any): Promise<void>;
154
154
  declare function sendUserCommand(command: string): Promise<void>;
155
155
  declare function sendStaticData(componentData: any, appId?: string): Promise<{
@@ -162,97 +162,6 @@ declare function sendStaticData(componentData: any, appId?: string): Promise<{
162
162
  data?: undefined;
163
163
  }>;
164
164
 
165
- interface UserSpeechChunkData {
166
- text_chunk: string;
167
- is_final: boolean;
168
- }
169
- interface AISpeechChunkData {
170
- text_chunk: string;
171
- is_final: boolean;
172
- }
173
- interface AIIntentData {
174
- intent: string;
175
- routeName: string | null;
176
- actionType: string;
177
- confidence: number;
178
- actionMetadata: {
179
- elementId: string | null;
180
- routeName: string | null;
181
- };
182
- }
183
- interface AIInterruptedData {
184
- message: string;
185
- }
186
- interface RequestRuntimeData {
187
- session_id: string;
188
- }
189
- interface StaticDataReadyData {
190
- [key: string]: any;
191
- }
192
- interface ToolLogData {
193
- [key: string]: any;
194
- }
195
- type SSEActionEvent = {
196
- type: 'user_speech_chunk';
197
- timestamp?: number;
198
- data: UserSpeechChunkData;
199
- } | {
200
- type: 'ai_speech_chunk';
201
- timestamp?: number;
202
- data: AISpeechChunkData;
203
- } | {
204
- type: 'ai_intent';
205
- timestamp?: number;
206
- data: AIIntentData;
207
- } | {
208
- type: 'ai_interrupted';
209
- timestamp?: number;
210
- data: AIInterruptedData;
211
- } | {
212
- type: 'request_runtime_data';
213
- timestamp?: number;
214
- data: RequestRuntimeData;
215
- } | {
216
- type: 'static_data_ready';
217
- data: StaticDataReadyData;
218
- } | {
219
- type: 'tool_log';
220
- data: ToolLogData;
221
- } | {
222
- type: 'connection';
223
- status: 'connected';
224
- app_id?: string;
225
- } | {
226
- type: 'keepalive';
227
- timestamp?: number;
228
- };
229
- interface SSEServiceCallbacks {
230
- onActionEvent?: (event: SSEActionEvent) => void;
231
- onConnectionChange?: (isConnected: boolean) => void;
232
- onConversationUpdate?: (entry: {
233
- speaker: 'user' | 'ai';
234
- text: string;
235
- is_final: boolean;
236
- }) => void;
237
- onIntentUpdate?: (intent: AIIntentData) => void;
238
- onToolStatusUpdate?: (status: any) => void;
239
- onStaticDataUpdate?: (data: any) => void;
240
- onError?: (error: string) => void;
241
- }
242
- declare function setSSECallbacks(newCallbacks: SSEServiceCallbacks): void;
243
- declare function connectSSE(newSessionId: string): Promise<void>;
244
- declare function sendRuntimeData(): Promise<void>;
245
- declare function sendDashboardData(dashboardData: any): Promise<void>;
246
- declare function sendElementData(appId?: string): Promise<{
247
- app_id: string;
248
- current_page: string;
249
- dom_structure: FullDOMStructure;
250
- timestamp: number;
251
- }>;
252
- declare function disconnectSSE(): void;
253
- declare function getSSEConnectionStatus(): boolean;
254
- declare function getSSEConnectionState(): string;
255
-
256
165
  interface ChatMessage {
257
166
  id: string;
258
167
  role: 'user' | 'ai';
@@ -269,8 +178,6 @@ declare const useCuekit: (options?: {
269
178
  onAISpeechEnd?: (trackId: string) => void;
270
179
  appId?: string;
271
180
  }) => {
272
- isSseConnected: boolean;
273
- lastActionEvent: SSEActionEvent | null;
274
181
  messages: ChatMessage[];
275
182
  micState: MicState;
276
183
  setMicState: React.Dispatch<React.SetStateAction<MicState>>;
@@ -372,4 +279,4 @@ declare function getFullDOMStructure(): FullDOMStructure;
372
279
  */
373
280
  declare function captureFullDOMStructure(): FullDOMStructure;
374
281
 
375
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type SSEActionEvent, type SSEServiceCallbacks, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, connectSSE, disconnectSSE, executeAction, getFullDOMStructure, getSSEConnectionState, getSSEConnectionStatus, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, sendDashboardData, sendElementData, sendRuntimeData, setSSECallbacks, useCuekit, useQubeContext, useWebRTC };
282
+ export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };