@siact/sime-x-vue 0.0.23 → 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.
@@ -1518,7 +1518,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1518
1518
  "3你好,世界,今天是想起五天气横扫的缺点"
1519
1519
  ].forEach((text, index) => {
1520
1520
  setTimeout(() => {
1521
- aiChatbotX.speakText(text);
1521
+ aiChatbotX.speakText(text).call(() => {
1522
+ console.log("speak end");
1523
+ });
1522
1524
  }, index * 1e3);
1523
1525
  });
1524
1526
  };
@@ -1686,7 +1688,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1686
1688
  }
1687
1689
  });
1688
1690
 
1689
- const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-36096054"]]);
1691
+ const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3d80e12e"]]);
1690
1692
 
1691
1693
  class CommandManager {
1692
1694
  commands = /* @__PURE__ */ new Map();
@@ -1788,7 +1790,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1788
1790
  voiceAssistantRef.value?.agentInvoke(text);
1789
1791
  },
1790
1792
  speakText: (text) => {
1791
- voiceAssistantRef.value?.speakText(text);
1793
+ return voiceAssistantRef.value?.speakText(text) ?? { call: () => {
1794
+ } };
1792
1795
  },
1793
1796
  stopSpeak: () => {
1794
1797
  voiceAssistantRef.value?.stopSpeak();
@@ -2384,14 +2387,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2384
2387
  isProcessingSpeakQueue = true;
2385
2388
  tts.hasPendingAudio.value = true;
2386
2389
  while (speakQueue.length > 0) {
2387
- const text = speakQueue.shift();
2390
+ const item = speakQueue.shift();
2388
2391
  bubble.open();
2389
- agent.currentTextContent.value = text;
2392
+ agent.currentTextContent.value = item.text;
2390
2393
  try {
2391
- await tts.speakAndWait(text);
2394
+ await tts.speakAndWait(item.text);
2392
2395
  } catch (e) {
2393
2396
  console.error("[speakQueue] 播报失败:", e);
2394
2397
  }
2398
+ try {
2399
+ item.onComplete?.();
2400
+ } catch (e) {
2401
+ console.error("[speakQueue] onComplete 回调出错:", e);
2402
+ }
2395
2403
  if (speakQueue.length > 0) {
2396
2404
  tts.hasPendingAudio.value = true;
2397
2405
  }
@@ -2401,10 +2409,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2401
2409
  bubble.scheduleDismiss();
2402
2410
  };
2403
2411
  const speakTextWithBubble = (text) => {
2404
- speakQueue.push(text);
2412
+ const item = { text };
2413
+ speakQueue.push(item);
2405
2414
  if (!isProcessingSpeakQueue) {
2406
2415
  processSpeakQueue();
2407
2416
  }
2417
+ return {
2418
+ call: (fn) => {
2419
+ item.onComplete = fn;
2420
+ }
2421
+ };
2408
2422
  };
2409
2423
  const stopSpeak = () => {
2410
2424
  speakQueue.length = 0;
@@ -2580,7 +2594,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2580
2594
  }
2581
2595
  });
2582
2596
 
2583
- const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-177013f4"]]);
2597
+ const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ce9ddda"]]);
2584
2598
 
2585
2599
  var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
2586
2600
  clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";