@siact/sime-x-vue 0.0.20 → 0.0.21

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.
@@ -107,7 +107,7 @@
107
107
  const _hoisted_10$2 = { class: "ai-chat__messages-inner" };
108
108
  const _hoisted_11$2 = { class: "ai-chat__message-content" };
109
109
  const _hoisted_12$2 = ["innerHTML"];
110
- const _hoisted_13$1 = {
110
+ const _hoisted_13$2 = {
111
111
  key: 1,
112
112
  class: "ai-chat__reasoning"
113
113
  };
@@ -470,7 +470,7 @@
470
470
  innerHTML: renderMarkdown(part.text)
471
471
  }, null, 8, _hoisted_12$2)
472
472
  ])
473
- ], 2)) : part.type === "reasoning" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, [
473
+ ], 2)) : part.type === "reasoning" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$2, [
474
474
  vue.createElementVNode("button", {
475
475
  class: "ai-chat__reasoning-trigger",
476
476
  onClick: ($event) => toggleReasoning(message.id)
@@ -1465,7 +1465,7 @@
1465
1465
  };
1466
1466
  const _hoisted_11$1 = { class: "input-bar" };
1467
1467
  const _hoisted_12$1 = ["disabled"];
1468
- const _hoisted_13 = ["disabled"];
1468
+ const _hoisted_13$1 = ["disabled"];
1469
1469
  const _hoisted_14 = {
1470
1470
  key: 0,
1471
1471
  class: "btn-spinner",
@@ -1672,7 +1672,7 @@
1672
1672
  "stroke-linejoin": "round"
1673
1673
  }, null, -1)
1674
1674
  ])]))
1675
- ], 8, _hoisted_13)
1675
+ ], 8, _hoisted_13$1)
1676
1676
  ])
1677
1677
  ]);
1678
1678
  };
@@ -2255,8 +2255,12 @@
2255
2255
  key: 2,
2256
2256
  class: "agent-text"
2257
2257
  };
2258
- const _hoisted_11 = { class: "fab-avatar-wrapper" };
2259
- const _hoisted_12 = ["src"];
2258
+ const _hoisted_11 = {
2259
+ key: 0,
2260
+ class: "status-pill"
2261
+ };
2262
+ const _hoisted_12 = { class: "fab-avatar-wrapper" };
2263
+ const _hoisted_13 = ["src"];
2260
2264
  const currentTheme = "dark";
2261
2265
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
2262
2266
  __name: "voice-assistant",
@@ -2327,10 +2331,14 @@
2327
2331
  tts.stop();
2328
2332
  bubble.hide();
2329
2333
  };
2330
- const speakTextWithBubble = (text) => {
2334
+ const speakTextWithBubble = async (text) => {
2331
2335
  bubble.open();
2332
2336
  agent.currentTextContent.value = text;
2333
- tts.speak(text);
2337
+ try {
2338
+ await tts.speak(text);
2339
+ } finally {
2340
+ bubble.scheduleDismiss();
2341
+ }
2334
2342
  };
2335
2343
  const voice = useVoiceRecognition({
2336
2344
  modelPath: props.modelPath,
@@ -2350,7 +2358,7 @@
2350
2358
  tts.warmUpAudio();
2351
2359
  await voice.toggleVoiceMode(targetState);
2352
2360
  };
2353
- const { voiceStatus, wakeAnimating, isTranscribing } = voice;
2361
+ const { voiceStatus, transcriptionText, wakeAnimating, isTranscribing } = voice;
2354
2362
  const { isInvoking, currentTextContent, currentToolParts, executingTools, hasAnyContent, toolDisplayName } = agent;
2355
2363
  aiChatbotX?.registerVoiceMethods({
2356
2364
  stopBroadcast: async () => interruptCurrentResponse(),
@@ -2450,14 +2458,15 @@
2450
2458
  class: "assistant-fab",
2451
2459
  onClick: _cache[0] || (_cache[0] = ($event) => toggleVoiceMode())
2452
2460
  }, [
2453
- vue.createElementVNode("div", _hoisted_11, [
2461
+ vue.unref(transcriptionText) || vue.unref(isInvoking) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, vue.toDisplayString(vue.unref(isInvoking) ? "正在思考中..." : vue.unref(transcriptionText)), 1)) : vue.createCommentVNode("", true),
2462
+ vue.createElementVNode("div", _hoisted_12, [
2454
2463
  vue.createElementVNode("img", {
2455
2464
  src: __props.xLogo ? __props.xLogo : "/x.png",
2456
2465
  alt: "voice assistant",
2457
2466
  style: vue.normalizeStyle({
2458
2467
  width: `${__props.xSize?.width || 88}px`
2459
2468
  })
2460
- }, null, 12, _hoisted_12),
2469
+ }, null, 12, _hoisted_13),
2461
2470
  vue.createVNode(vue.Transition, { name: "indicator-fade" }, {
2462
2471
  default: vue.withCtx(() => [
2463
2472
  vue.unref(voiceStatus) === "listening" ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -2499,7 +2508,7 @@
2499
2508
  }
2500
2509
  });
2501
2510
 
2502
- const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5f5506a2"]]);
2511
+ const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ac1884ea"]]);
2503
2512
 
2504
2513
  var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
2505
2514
  clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";