@cuekit-ai/react 1.3.3 → 1.4.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/{chunk-ZGHSIEXZ.mjs → chunk-VQ6DNY3R.mjs} +287 -90
- package/dist/index.d.mts +40 -30
- package/dist/index.d.ts +40 -30
- package/dist/index.js +315 -120
- package/dist/index.mjs +38 -34
- package/dist/{webrtc-service-SDVOO4LS.mjs → webrtc-service-3TOBGQF7.mjs} +3 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -12,16 +12,18 @@ import {
|
|
|
12
12
|
_apiKey,
|
|
13
13
|
_appId,
|
|
14
14
|
authenticate,
|
|
15
|
-
|
|
15
|
+
captureAllInteractiveElements,
|
|
16
|
+
clearElementCache,
|
|
16
17
|
connectToRoom,
|
|
17
18
|
createAudioAnalyser,
|
|
18
19
|
disconnectFromRoom,
|
|
19
20
|
executeAction,
|
|
20
|
-
|
|
21
|
+
getCurrentPathParams,
|
|
21
22
|
getParticipants,
|
|
22
23
|
getRoom,
|
|
23
24
|
getRoomName,
|
|
24
25
|
onStateChange,
|
|
26
|
+
resolveRoutePath,
|
|
25
27
|
sendData,
|
|
26
28
|
sendRuntimeData,
|
|
27
29
|
sendScreenStatus,
|
|
@@ -33,8 +35,9 @@ import {
|
|
|
33
35
|
setNavigationHandler,
|
|
34
36
|
setServerUrl,
|
|
35
37
|
setWebRTCCallbacks,
|
|
36
|
-
setWebRTCConfig
|
|
37
|
-
|
|
38
|
+
setWebRTCConfig,
|
|
39
|
+
validateDynamicElements
|
|
40
|
+
} from "./chunk-VQ6DNY3R.mjs";
|
|
38
41
|
|
|
39
42
|
// node_modules/inline-style-parser/index.js
|
|
40
43
|
var require_inline_style_parser = __commonJS({
|
|
@@ -1282,28 +1285,15 @@ var CuekitProvider = ({
|
|
|
1282
1285
|
};
|
|
1283
1286
|
}, [navigationHandler]);
|
|
1284
1287
|
useEffect(() => {
|
|
1285
|
-
import("./webrtc-service-
|
|
1288
|
+
import("./webrtc-service-3TOBGQF7.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
|
|
1286
1289
|
setWebRTCCallbacks2({
|
|
1287
1290
|
onNavigationCommand: (command) => {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
navigationHandler(command.current_page, {
|
|
1295
|
-
intent: command.intent,
|
|
1296
|
-
text: command.text,
|
|
1297
|
-
confidence: command.confidence
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
break;
|
|
1302
|
-
case "user_speech_text":
|
|
1303
|
-
break;
|
|
1304
|
-
case "ai_speech_text":
|
|
1305
|
-
break;
|
|
1306
|
-
default:
|
|
1291
|
+
if (command.data.actionType === "navigate" && command.data.routeName) {
|
|
1292
|
+
if (navigationHandler) {
|
|
1293
|
+
navigationHandler(command.data.routeName);
|
|
1294
|
+
}
|
|
1295
|
+
} else if (command.data.actionType === "click" && command.data.elementId) {
|
|
1296
|
+
console.log("AI intent: Click element", command.data.elementId);
|
|
1307
1297
|
}
|
|
1308
1298
|
},
|
|
1309
1299
|
onConnectionStateChange: (state) => {
|
|
@@ -1526,6 +1516,14 @@ var useCuekit = (options) => {
|
|
|
1526
1516
|
const handleNavigationCommand = (event) => {
|
|
1527
1517
|
console.log(`\u2B07\uFE0F Received event from backend: ${event.type}`, event);
|
|
1528
1518
|
switch (event.type) {
|
|
1519
|
+
case "speech_text": {
|
|
1520
|
+
console.log("\u{1F5E3}\uFE0F AI Speech text:", event.data);
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
case "raw_text": {
|
|
1524
|
+
console.log("\u{1F4DD} Raw text message:", event.data);
|
|
1525
|
+
break;
|
|
1526
|
+
}
|
|
1529
1527
|
case "user_speech_chunk":
|
|
1530
1528
|
case "ai_speech_chunk": {
|
|
1531
1529
|
const role = event.type === "user_speech_chunk" ? "user" : "ai";
|
|
@@ -1561,16 +1559,21 @@ var useCuekit = (options) => {
|
|
|
1561
1559
|
}
|
|
1562
1560
|
case "ai_intent": {
|
|
1563
1561
|
const intent = event.data;
|
|
1564
|
-
|
|
1562
|
+
console.log("\u{1F3AF} AI Intent received:", intent);
|
|
1563
|
+
if (intent.actionType === "click" && intent.elementId) {
|
|
1564
|
+
console.log("\u{1F3AF} Executing click action:", intent.elementId);
|
|
1565
1565
|
executeAction({
|
|
1566
1566
|
action_type: "click",
|
|
1567
|
-
target_element: intent.
|
|
1567
|
+
target_element: intent.elementId
|
|
1568
1568
|
});
|
|
1569
|
-
} else if (intent.actionType === "navigate" && intent.
|
|
1569
|
+
} else if (intent.actionType === "navigate" && intent.routeName) {
|
|
1570
|
+
console.log("\u{1F3AF} Executing navigate action:", intent.routeName);
|
|
1570
1571
|
executeAction({
|
|
1571
1572
|
action_type: "navigate",
|
|
1572
|
-
target_element: intent.
|
|
1573
|
+
target_element: intent.routeName
|
|
1573
1574
|
});
|
|
1575
|
+
} else {
|
|
1576
|
+
console.log("\u{1F3AF} AI Intent not handled:", intent);
|
|
1574
1577
|
}
|
|
1575
1578
|
break;
|
|
1576
1579
|
}
|
|
@@ -17176,9 +17179,7 @@ var MicButton = ({
|
|
|
17176
17179
|
setStatus,
|
|
17177
17180
|
participants
|
|
17178
17181
|
} = useCuekit({
|
|
17179
|
-
|
|
17180
|
-
console.log("\u{1F3A4} MicButton: Navigation command received:", command);
|
|
17181
|
-
},
|
|
17182
|
+
// Don't override navigation command - let the provider handle it
|
|
17182
17183
|
onConnectionStateChange: (state) => {
|
|
17183
17184
|
console.log("\u{1F3A4} MicButton: Connection state changed:", state);
|
|
17184
17185
|
},
|
|
@@ -17569,15 +17570,18 @@ export {
|
|
|
17569
17570
|
InitCuekit,
|
|
17570
17571
|
MicButton,
|
|
17571
17572
|
VoiceIntensityVisualizer,
|
|
17572
|
-
|
|
17573
|
+
captureAllInteractiveElements,
|
|
17574
|
+
clearElementCache,
|
|
17573
17575
|
configureWebRTCServer,
|
|
17574
17576
|
executeAction,
|
|
17575
17577
|
generateDynamicId,
|
|
17576
|
-
|
|
17578
|
+
getCurrentPathParams,
|
|
17577
17579
|
getWebRTCServerConfig,
|
|
17578
17580
|
initWebRTC,
|
|
17579
17581
|
initWebRTCWithDeployedBackend,
|
|
17582
|
+
resolveRoutePath,
|
|
17580
17583
|
useCuekit,
|
|
17581
17584
|
useQubeContext,
|
|
17582
|
-
useWebRTC
|
|
17585
|
+
useWebRTC,
|
|
17586
|
+
validateDynamicElements
|
|
17583
17587
|
};
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
authenticate,
|
|
3
3
|
connectToRoom,
|
|
4
4
|
disconnectFromRoom,
|
|
5
|
+
getCurrentCallbacks,
|
|
5
6
|
getParticipants,
|
|
6
7
|
getRoom,
|
|
7
8
|
getRoomName,
|
|
@@ -14,11 +15,12 @@ import {
|
|
|
14
15
|
setAudioContainer,
|
|
15
16
|
setServerUrl,
|
|
16
17
|
setWebRTCCallbacks
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VQ6DNY3R.mjs";
|
|
18
19
|
export {
|
|
19
20
|
authenticate,
|
|
20
21
|
connectToRoom,
|
|
21
22
|
disconnectFromRoom,
|
|
23
|
+
getCurrentCallbacks,
|
|
22
24
|
getParticipants,
|
|
23
25
|
getRoom,
|
|
24
26
|
getRoomName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuekit-ai/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -47,5 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
51
52
|
}
|