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