@siact/sime-x-vue 0.0.22 → 0.0.24
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/sime-x-vue.mjs +26 -9
- package/dist/sime-x-vue.mjs.map +1 -1
- package/dist/sime-x-vue.umd.js +26 -9
- package/dist/sime-x-vue.umd.js.map +1 -1
- package/dist/style.css +109 -109
- package/package.json +1 -1
- package/types/components/voice-assistant.vue.d.ts +5 -1
- package/types/types.d.ts +7 -2
package/dist/sime-x-vue.umd.js
CHANGED
|
@@ -1519,7 +1519,9 @@
|
|
|
1519
1519
|
"3你好,世界,今天是想起五天气横扫的缺点"
|
|
1520
1520
|
].forEach((text, index) => {
|
|
1521
1521
|
setTimeout(() => {
|
|
1522
|
-
aiChatbotX.speakText(text)
|
|
1522
|
+
aiChatbotX.speakText(text).call(() => {
|
|
1523
|
+
console.log("speak end");
|
|
1524
|
+
});
|
|
1523
1525
|
}, index * 1e3);
|
|
1524
1526
|
});
|
|
1525
1527
|
};
|
|
@@ -1687,7 +1689,7 @@
|
|
|
1687
1689
|
}
|
|
1688
1690
|
});
|
|
1689
1691
|
|
|
1690
|
-
const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
1692
|
+
const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3d80e12e"]]);
|
|
1691
1693
|
|
|
1692
1694
|
class CommandManager {
|
|
1693
1695
|
commands = /* @__PURE__ */ new Map();
|
|
@@ -1789,7 +1791,8 @@
|
|
|
1789
1791
|
voiceAssistantRef.value?.agentInvoke(text);
|
|
1790
1792
|
},
|
|
1791
1793
|
speakText: (text) => {
|
|
1792
|
-
voiceAssistantRef.value?.speakText(text)
|
|
1794
|
+
return voiceAssistantRef.value?.speakText(text) ?? { call: () => {
|
|
1795
|
+
} };
|
|
1793
1796
|
},
|
|
1794
1797
|
stopSpeak: () => {
|
|
1795
1798
|
voiceAssistantRef.value?.stopSpeak();
|
|
@@ -2323,8 +2326,10 @@
|
|
|
2323
2326
|
bubbleSize: {},
|
|
2324
2327
|
bubbleDismissDelay: {}
|
|
2325
2328
|
},
|
|
2326
|
-
|
|
2329
|
+
emits: ["wake-up"],
|
|
2330
|
+
setup(__props, { emit: __emit }) {
|
|
2327
2331
|
const props = __props;
|
|
2332
|
+
const emit = __emit;
|
|
2328
2333
|
const aiChatbotX = injectStrict(AiChatbotXKey);
|
|
2329
2334
|
const getVoiceConfig = () => {
|
|
2330
2335
|
if (props.voiceConfig) return props.voiceConfig;
|
|
@@ -2383,14 +2388,19 @@
|
|
|
2383
2388
|
isProcessingSpeakQueue = true;
|
|
2384
2389
|
tts.hasPendingAudio.value = true;
|
|
2385
2390
|
while (speakQueue.length > 0) {
|
|
2386
|
-
const
|
|
2391
|
+
const item = speakQueue.shift();
|
|
2387
2392
|
bubble.open();
|
|
2388
|
-
agent.currentTextContent.value = text;
|
|
2393
|
+
agent.currentTextContent.value = item.text;
|
|
2389
2394
|
try {
|
|
2390
|
-
await tts.speakAndWait(text);
|
|
2395
|
+
await tts.speakAndWait(item.text);
|
|
2391
2396
|
} catch (e) {
|
|
2392
2397
|
console.error("[speakQueue] 播报失败:", e);
|
|
2393
2398
|
}
|
|
2399
|
+
try {
|
|
2400
|
+
item.onComplete?.();
|
|
2401
|
+
} catch (e) {
|
|
2402
|
+
console.error("[speakQueue] onComplete 回调出错:", e);
|
|
2403
|
+
}
|
|
2394
2404
|
if (speakQueue.length > 0) {
|
|
2395
2405
|
tts.hasPendingAudio.value = true;
|
|
2396
2406
|
}
|
|
@@ -2400,10 +2410,16 @@
|
|
|
2400
2410
|
bubble.scheduleDismiss();
|
|
2401
2411
|
};
|
|
2402
2412
|
const speakTextWithBubble = (text) => {
|
|
2403
|
-
|
|
2413
|
+
const item = { text };
|
|
2414
|
+
speakQueue.push(item);
|
|
2404
2415
|
if (!isProcessingSpeakQueue) {
|
|
2405
2416
|
processSpeakQueue();
|
|
2406
2417
|
}
|
|
2418
|
+
return {
|
|
2419
|
+
call: (fn) => {
|
|
2420
|
+
item.onComplete = fn;
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2407
2423
|
};
|
|
2408
2424
|
const stopSpeak = () => {
|
|
2409
2425
|
speakQueue.length = 0;
|
|
@@ -2415,6 +2431,7 @@
|
|
|
2415
2431
|
wakeWords: props.wakeWords,
|
|
2416
2432
|
getVoiceConfig,
|
|
2417
2433
|
onWake: () => {
|
|
2434
|
+
emit("wake-up");
|
|
2418
2435
|
interruptCurrentResponse();
|
|
2419
2436
|
tts.warmUpAudio();
|
|
2420
2437
|
const text = wakeResponses.value[Math.floor(Math.random() * wakeResponses.value.length)];
|
|
@@ -2578,7 +2595,7 @@
|
|
|
2578
2595
|
}
|
|
2579
2596
|
});
|
|
2580
2597
|
|
|
2581
|
-
const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
2598
|
+
const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ce9ddda"]]);
|
|
2582
2599
|
|
|
2583
2600
|
var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
|
|
2584
2601
|
clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";
|