wi-chat 0.5.1 → 0.6.1

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.
@@ -1,6 +1,6 @@
1
1
  import { createAnswerContentMap as re, provideOutputFileConfig as de, DeepThinkingSteps as ce, AiAnswerBubble as ue } from "wi-chat/renderers";
2
- import { AiAnswerBubble as Es, ClarificationCard as xs, DeepThinkingSteps as Os, IframePage as Ds, KnowledgeStreamResult as Qs, OutputFile as Ns, createAnswerContentMap as js, injectIframeResizerChild as Hs, provideIframePageConfig as Ws, provideOutputFileConfig as qs, resolveIframePlaceholders as Ks, useIframePage as Ys } from "wi-chat/renderers";
3
- import { defineComponent as D, computed as k, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as $, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as ae, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as se, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
2
+ import { AiAnswerBubble as Es, ClarificationCard as xs, DeepThinkingSteps as Os, HostActionStatus as Ds, IframePage as Qs, KnowledgeStreamResult as Ns, OutputFile as js, createAnswerContentMap as Hs, injectIframeResizerChild as Ws, provideIframePageConfig as qs, provideOutputFileConfig as Ks, resolveIframePlaceholders as Ys, useIframePage as Xs } from "wi-chat/renderers";
3
+ import { defineComponent as D, computed as k, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as $, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as le, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as se, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
4
4
  import { ElImage as me, ElPopover as be, ElCheckbox as fe, ElInput as ge, ElTooltip as ee } from "element-plus";
5
5
  import { isImageAttachment as ye, resolveAttachPreviewUrl as ke, normalizeAttachment as $e, resolveRemoteFileUrl as Ce, parseRealtimeAttachment as Ue } from "wi-chat/parser";
6
6
  import { downloadAttachment as Ae, useAutoScroll as Be } from "wi-chat/tools";
@@ -60,7 +60,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
60
60
  fill: "none",
61
61
  stroke: "currentColor",
62
62
  "stroke-width": "2"
63
- }, Ve = /* @__PURE__ */ ae('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
63
+ }, Ve = /* @__PURE__ */ le('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
64
64
  Ve
65
65
  ], Te = {
66
66
  key: 2,
@@ -82,7 +82,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
82
82
  fill: "none",
83
83
  stroke: "currentColor",
84
84
  "stroke-width": "2"
85
- }, Oe = /* @__PURE__ */ ae('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
85
+ }, Oe = /* @__PURE__ */ le('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
86
86
  Oe
87
87
  ], Qe = { class: "wi-web-attach-card__info" }, Ne = ["title"], je = {
88
88
  key: 0,
@@ -120,7 +120,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
120
120
  const i = p, r = C, _ = k(() => {
121
121
  var o;
122
122
  return ((o = i.item) == null ? void 0 : o.attachContent) || {};
123
- }), m = k(() => ye(i.item)), b = k(() => ke(i.item, i.baseURL, i.getFileUrl)), l = k(() => {
123
+ }), m = k(() => ye(i.item)), b = k(() => ke(i.item, i.baseURL, i.getFileUrl)), a = k(() => {
124
124
  if (i.removable)
125
125
  return !1;
126
126
  if (i.downloadable !== void 0)
@@ -139,7 +139,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
139
139
  getFileUrl: i.getFileUrl
140
140
  });
141
141
  };
142
- return (o, a) => (s(), n("div", {
142
+ return (o, l) => (s(), n("div", {
143
143
  class: z(["wi-web-attach-card", { "is-clickable": o.clickable || !!o.$attrs.onClick }]),
144
144
  onClick: u
145
145
  }, [
@@ -153,7 +153,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
153
153
  "preview-teleported": "",
154
154
  fit: "cover",
155
155
  class: "wi-web-attach-card__image",
156
- onClick: a[0] || (a[0] = te(() => {
156
+ onClick: l[0] || (l[0] = te(() => {
157
157
  }, ["stop"]))
158
158
  }, {
159
159
  placeholder: $(() => [
@@ -183,7 +183,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
183
183
  ]),
184
184
  t("div", He, [
185
185
  S(o.$slots, "actions", { item: o.item }, () => [
186
- l.value ? (s(), n("button", {
186
+ a.value ? (s(), n("button", {
187
187
  key: 0,
188
188
  type: "button",
189
189
  class: "wi-web-attach-card__action-btn wi-web-attach-card__download",
@@ -223,7 +223,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
223
223
  setup(p, { emit: C }) {
224
224
  const i = p, r = C, _ = k(() => (i.items || []).map((d, h) => {
225
225
  var c, f;
226
- const o = $e(d), a = (c = o.attachContent) == null ? void 0 : c.raw, U = ((f = o.attachContent) == null ? void 0 : f.fileId) || (a ? `${a.name}_${a.size}_${h}` : `${o.name}_${h}`);
226
+ const o = $e(d), l = (c = o.attachContent) == null ? void 0 : c.raw, U = ((f = o.attachContent) == null ? void 0 : f.fileId) || (l ? `${l.name}_${l.size}_${h}` : `${o.name}_${h}`);
227
227
  return {
228
228
  ...o,
229
229
  key: U
@@ -232,7 +232,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
232
232
  r("remove", u, d);
233
233
  }, b = (u, d) => {
234
234
  r("click", u, d);
235
- }, l = (u, d) => {
235
+ }, a = (u, d) => {
236
236
  r("download", u, d);
237
237
  };
238
238
  return (u, d) => _.value.length > 0 ? (s(), n("div", Xe, [
@@ -244,21 +244,21 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
244
244
  clickable: u.clickable || !!u.$attrs.onClick,
245
245
  "base-u-r-l": u.baseURL,
246
246
  "get-file-url": u.getFileUrl,
247
- onClick: (a) => b(h, o),
248
- onRemove: (a) => m(o, h),
249
- onDownload: (a) => l(h, o)
247
+ onClick: (l) => b(h, o),
248
+ onRemove: (l) => m(o, h),
249
+ onDownload: (l) => a(h, o)
250
250
  }, {
251
- icon: $((a) => [
252
- S(u.$slots, "icon", Z(G(a)), void 0, !0)
251
+ icon: $((l) => [
252
+ S(u.$slots, "icon", Z(G(l)), void 0, !0)
253
253
  ]),
254
- title: $((a) => [
255
- S(u.$slots, "title", Z(G(a)), void 0, !0)
254
+ title: $((l) => [
255
+ S(u.$slots, "title", Z(G(l)), void 0, !0)
256
256
  ]),
257
- description: $((a) => [
258
- S(u.$slots, "description", Z(G(a)), void 0, !0)
257
+ description: $((l) => [
258
+ S(u.$slots, "description", Z(G(l)), void 0, !0)
259
259
  ]),
260
- actions: $((a) => [
261
- S(u.$slots, "actions", Z(G(a)), void 0, !0)
260
+ actions: $((l) => [
261
+ S(u.$slots, "actions", Z(G(l)), void 0, !0)
262
262
  ]),
263
263
  _: 2
264
264
  }, 1032, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
@@ -277,13 +277,13 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
277
277
  fill: "none",
278
278
  stroke: "currentColor",
279
279
  "stroke-width": "2"
280
- }, lt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("circle", {
280
+ }, at = /* @__PURE__ */ T(() => /* @__PURE__ */ t("circle", {
281
281
  cx: "12",
282
282
  cy: "8",
283
283
  r: "4"
284
- }, null, -1)), at = /* @__PURE__ */ T(() => /* @__PURE__ */ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" }, null, -1)), nt = [
285
- lt,
286
- at
284
+ }, null, -1)), lt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" }, null, -1)), nt = [
285
+ at,
286
+ lt
287
287
  ], it = { class: "wi-web-inputbox__agent-title" }, rt = /* @__PURE__ */ T(() => /* @__PURE__ */ t("path", {
288
288
  d: "M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",
289
289
  fill: "currentColor"
@@ -388,8 +388,8 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
388
388
  },
389
389
  emits: ["update:modelValue", "submit", "stop", "selectAgent", "update:files", "update:attachments", "update:incPrevQuestion"],
390
390
  setup(p, { expose: C, emit: i }) {
391
- const r = p, _ = i, m = x(null), b = x(null), l = x(!1), u = (e) => Ue(e), d = x([]), h = k(() => !!!(r.modelValue && r.modelValue.trim())), o = (e) => e ? r.getFileUrl ? r.getFileUrl(e) : Ce(e, r.baseURL, "/algorithm/get_file_data") : "", a = (e) => {
392
- _("selectAgent", e), l.value = !1;
391
+ const r = p, _ = i, m = x(null), b = x(null), a = x(!1), u = (e) => Ue(e), d = x([]), h = k(() => !!!(r.modelValue && r.modelValue.trim())), o = (e) => e ? r.getFileUrl ? r.getFileUrl(e) : Ce(e, r.baseURL, "/algorithm/get_file_data") : "", l = (e) => {
392
+ _("selectAgent", e), a.value = !1;
393
393
  }, U = (e) => {
394
394
  _("update:incPrevQuestion", e ? "N" : "Y");
395
395
  }, c = () => {
@@ -402,8 +402,8 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
402
402
  const v = Array.from(w.files);
403
403
  for (const y of v)
404
404
  d.value.some((W) => {
405
- var le;
406
- const X = ((le = W.attachContent) == null ? void 0 : le.raw) || W.raw;
405
+ var ae;
406
+ const X = ((ae = W.attachContent) == null ? void 0 : ae.raw) || W.raw;
407
407
  return X && X.name === y.name && X.size === y.size && X.lastModified === y.lastModified;
408
408
  }) || d.value.push(u(y));
409
409
  const R = d.value.map((y) => {
@@ -459,8 +459,8 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
459
459
  e.showAgentBar || e.showIncPrevQuestion ? (s(), n("div", Je, [
460
460
  e.showAgentBar ? (s(), n("div", et, [
461
461
  L(I(be), {
462
- visible: l.value,
463
- "onUpdate:visible": w[0] || (w[0] = (v) => l.value = v),
462
+ visible: a.value,
463
+ "onUpdate:visible": w[0] || (w[0] = (v) => a.value = v),
464
464
  placement: "top-start",
465
465
  width: 260,
466
466
  trigger: "click",
@@ -481,7 +481,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
481
481
  ]),
482
482
  t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((y = e.currentAgent) == null ? void 0 : y.entry_id) || e.defaultAgentTitle), 1),
483
483
  (s(), n("svg", {
484
- class: z(["wi-web-inputbox__agent-arrow", { "is-active": l.value }]),
484
+ class: z(["wi-web-inputbox__agent-arrow", { "is-active": a.value }]),
485
485
  viewBox: "0 0 1024 1024",
486
486
  width: "12",
487
487
  height: "12"
@@ -498,7 +498,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
498
498
  return s(), n("div", {
499
499
  key: v.entry_id,
500
500
  class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((R = e.currentAgent) == null ? void 0 : R.entry_id) }]),
501
- onClick: (E) => a(v)
501
+ onClick: (E) => l(v)
502
502
  }, [
503
503
  t("div", _t, [
504
504
  v.image_id && o(v.image_id) ? (s(), n("img", {
@@ -664,17 +664,17 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
664
664
  const r = p, _ = i;
665
665
  de(
666
666
  r.outputFileConfig ?? {
667
- getFileUrl: (a) => {
667
+ getFileUrl: (l) => {
668
668
  var U;
669
- return ((U = r.getFileUrl) == null ? void 0 : U.call(r, a)) ?? (r.baseURL ? `${r.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(a)}` : "");
669
+ return ((U = r.getFileUrl) == null ? void 0 : U.call(r, l)) ?? (r.baseURL ? `${r.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(l)}` : "");
670
670
  }
671
671
  }
672
672
  );
673
- const m = x(), { showScrollToBottom: b, forceScrollToBottom: l, requestScrollToBottom: u, resetScrollState: d, onReachTop: h } = Be(m), o = k(() => Qt(r.parsers));
673
+ const m = x(), { showScrollToBottom: b, forceScrollToBottom: a, requestScrollToBottom: u, resetScrollState: d, onReachTop: h } = Be(m), o = k(() => Qt(r.parsers));
674
674
  return se(
675
675
  () => r.messages.length === 0,
676
- (a) => {
677
- a && d();
676
+ (l) => {
677
+ l && d();
678
678
  }
679
679
  ), se(
680
680
  () => r.messages[r.messages.length - 1],
@@ -684,20 +684,20 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
684
684
  { deep: !0 }
685
685
  ), h(() => _("loadOlder")), C({
686
686
  /** 强制滚动到底部 */
687
- forceScrollToBottom: l,
687
+ forceScrollToBottom: a,
688
688
  /** 自动滚动开启时请求滚动到底部 */
689
689
  requestScrollToBottom: u
690
- }), (a, U) => (s(), n("div", {
690
+ }), (l, U) => (s(), n("div", {
691
691
  ref_key: "scrollEl",
692
692
  ref: m,
693
693
  class: "wi-web-chat-messages"
694
694
  }, [
695
- a.loading ? (s(), n("div", jt, "历史加载中...")) : a.messages.length === 0 ? (s(), n("div", Ht, [
695
+ l.loading ? (s(), n("div", jt, "历史加载中...")) : l.messages.length === 0 ? (s(), n("div", Ht, [
696
696
  Wt,
697
- t("div", qt, A(a.emptyTitle), 1),
698
- t("div", Kt, A(a.emptyDescription), 1)
697
+ t("div", qt, A(l.emptyTitle), 1),
698
+ t("div", Kt, A(l.emptyDescription), 1)
699
699
  ])) : g("", !0),
700
- (s(!0), n(P, null, j(a.messages, (c) => (s(), n(P, {
700
+ (s(!0), n(P, null, j(l.messages, (c) => (s(), n(P, {
701
701
  key: c.id
702
702
  }, [
703
703
  c.role === "user" ? (s(), n("div", Yt, [
@@ -706,8 +706,8 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
706
706
  key: 0,
707
707
  class: "wi-web-chat-messages__attachments",
708
708
  items: c.attachments,
709
- "base-u-r-l": a.baseURL,
710
- "get-file-url": a.getFileUrl
709
+ "base-u-r-l": l.baseURL,
710
+ "get-file-url": l.getFileUrl
711
711
  }, null, 8, ["items", "base-u-r-l", "get-file-url"])) : g("", !0),
712
712
  t("div", Zt, A(c.content), 1)
713
713
  ])
@@ -732,7 +732,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
732
732
  type: "button",
733
733
  class: "wi-web-chat-messages__bottom",
734
734
  onClick: U[0] || (U[0] = //@ts-ignore
735
- (...c) => I(l) && I(l)(...c))
735
+ (...c) => I(a) && I(a)(...c))
736
736
  }, " 回到底部 ")) : g("", !0)
737
737
  ]),
738
738
  _: 1
@@ -762,42 +762,42 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
762
762
  },
763
763
  emits: ["update:question", "update:incPrevQuestion", "submit", "stop", "selectAgent", "loadOlder", "updateThinkingExpanded"],
764
764
  setup(p, { emit: C }) {
765
- const i = p, r = C, _ = (l) => {
766
- r("submit", l);
765
+ const i = p, r = C, _ = (a) => {
766
+ r("submit", a);
767
767
  }, m = () => {
768
768
  i.hasMore && r("loadOlder");
769
- }, b = (l) => {
770
- r("selectAgent", l);
769
+ }, b = (a) => {
770
+ r("selectAgent", a);
771
771
  };
772
- return (l, u) => (s(), n("section", ts, [
773
- S(l.$slots, "messages", {}, () => [
772
+ return (a, u) => (s(), n("section", ts, [
773
+ S(a.$slots, "messages", {}, () => [
774
774
  L(es, {
775
- messages: l.messages,
776
- parsers: l.parsers,
777
- "base-u-r-l": l.baseURL,
778
- "get-file-url": l.getFileUrl,
779
- "output-file-config": l.outputFileConfig,
780
- loading: l.loading,
781
- "empty-title": l.emptyTitle,
782
- "empty-description": l.emptyDescription,
775
+ messages: a.messages,
776
+ parsers: a.parsers,
777
+ "base-u-r-l": a.baseURL,
778
+ "get-file-url": a.getFileUrl,
779
+ "output-file-config": a.outputFileConfig,
780
+ loading: a.loading,
781
+ "empty-title": a.emptyTitle,
782
+ "empty-description": a.emptyDescription,
783
783
  onLoadOlder: m,
784
784
  onUpdateThinkingExpanded: u[0] || (u[0] = (d, h) => r("updateThinkingExpanded", d, h))
785
785
  }, null, 8, ["messages", "parsers", "base-u-r-l", "get-file-url", "output-file-config", "loading", "empty-title", "empty-description"])
786
786
  ], !0),
787
- S(l.$slots, "above-input", {}, void 0, !0),
787
+ S(a.$slots, "above-input", {}, void 0, !0),
788
788
  t("footer", ss, [
789
789
  L(Ot, {
790
- "model-value": l.question,
790
+ "model-value": a.question,
791
791
  "onUpdate:modelValue": u[1] || (u[1] = (d) => r("update:question", d)),
792
- "inc-prev-question": l.incPrevQuestion,
792
+ "inc-prev-question": a.incPrevQuestion,
793
793
  "onUpdate:incPrevQuestion": u[2] || (u[2] = (d) => r("update:incPrevQuestion", d)),
794
- "base-u-r-l": l.baseURL,
795
- disabled: l.disabled || !l.session,
796
- talking: l.talking,
797
- "agent-list": l.agentList,
798
- "current-agent": l.currentAgent,
799
- placeholder: l.placeholder,
800
- "get-file-url": l.getFileUrl,
794
+ "base-u-r-l": a.baseURL,
795
+ disabled: a.disabled || !a.session,
796
+ talking: a.talking,
797
+ "agent-list": a.agentList,
798
+ "current-agent": a.currentAgent,
799
+ placeholder: a.placeholder,
800
+ "get-file-url": a.getFileUrl,
801
801
  onSelectAgent: b,
802
802
  onSubmit: _,
803
803
  onStop: u[3] || (u[3] = (d) => r("stop"))
@@ -805,10 +805,10 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
805
805
  ])
806
806
  ]));
807
807
  }
808
- }), Ts = /* @__PURE__ */ Q(os, [["__scopeId", "data-v-8663b501"]]), ie = (p) => (q("data-v-96941d57"), p = p(), K(), p), ls = {
808
+ }), Ts = /* @__PURE__ */ Q(os, [["__scopeId", "data-v-8663b501"]]), ie = (p) => (q("data-v-96941d57"), p = p(), K(), p), as = {
809
809
  key: 0,
810
810
  class: "wi-web-recordset"
811
- }, as = { class: "wi-web-recordset__header" }, ns = { class: "wi-web-recordset__title" }, is = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
811
+ }, ls = { class: "wi-web-recordset__header" }, ns = { class: "wi-web-recordset__title" }, is = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
812
812
  type: "button",
813
813
  class: "wi-web-recordset__columns-btn",
814
814
  title: "选择展示列"
@@ -846,7 +846,7 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
846
846
  }))), b = k(() => {
847
847
  const c = Number(i.value.max_cols);
848
848
  return Number.isFinite(c) && c > 0 ? c : 1 / 0;
849
- }), l = k(() => m.value.length > b.value), u = x([]), d = k(() => new Set(u.value)), h = k(() => m.value.filter((c) => d.value.has(c.key)));
849
+ }), a = k(() => m.value.length > b.value), u = x([]), d = k(() => new Set(u.value)), h = k(() => m.value.filter((c) => d.value.has(c.key)));
850
850
  se(
851
851
  () => m.value.map((c) => c.key).join("|"),
852
852
  () => {
@@ -859,19 +859,19 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
859
859
  return m.value.forEach((M, N) => {
860
860
  B[M.key] = Array.isArray(f) ? f[N] : void 0;
861
861
  }), B;
862
- })), a = x(!1), U = (c, f) => {
862
+ })), l = x(!1), U = (c, f) => {
863
863
  const B = new Set(u.value);
864
864
  f ? B.add(c) : B.delete(c), u.value = m.value.filter((M) => B.has(M.key)).map((M) => M.key);
865
865
  };
866
866
  return (c, f) => {
867
867
  const B = J("el-checkbox"), M = J("el-popover"), N = J("el-table-column"), Y = J("el-table");
868
- return r.value ? (s(), n("div", ls, [
869
- t("div", as, [
868
+ return r.value ? (s(), n("div", as, [
869
+ t("div", ls, [
870
870
  t("div", ns, A(_.value), 1),
871
- l.value ? (s(), V(M, {
871
+ a.value ? (s(), V(M, {
872
872
  key: 0,
873
- visible: a.value,
874
- "onUpdate:visible": f[0] || (f[0] = (F) => a.value = F),
873
+ visible: l.value,
874
+ "onUpdate:visible": f[0] || (f[0] = (F) => l.value = F),
875
875
  placement: "bottom-end",
876
876
  width: 220,
877
877
  trigger: "click",
@@ -985,16 +985,16 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
985
985
  ], m = { default: 3, small: 2 }, b = k(() => {
986
986
  const h = i.options ?? [];
987
987
  return h.length > 0 ? h : _;
988
- }), l = k(() => {
988
+ }), a = k(() => {
989
989
  if (!i.showHint)
990
990
  return null;
991
991
  const h = b.value;
992
992
  return h.find((o) => o.value === i.modelValue) ?? h[0] ?? null;
993
993
  }), u = k(() => {
994
- const h = b.value, o = h.length || 1, a = Math.max(h.findIndex((c) => c.value === i.modelValue), 0), U = m[i.size] ?? m.default;
994
+ const h = b.value, o = h.length || 1, l = Math.max(h.findIndex((c) => c.value === i.modelValue), 0), U = m[i.size] ?? m.default;
995
995
  return {
996
996
  width: `calc(${100 / o}% - ${2 * U / o}px)`,
997
- transform: `translateX(${a * 100}%)`
997
+ transform: `translateX(${l * 100}%)`
998
998
  };
999
999
  }), d = (h) => {
1000
1000
  i.disabled || h.disabled || h.value !== i.modelValue && (r("update:modelValue", h.value), r("change", h));
@@ -1008,27 +1008,27 @@ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-
1008
1008
  style: we(u.value)
1009
1009
  }, null, 4),
1010
1010
  t("div", _s, [
1011
- (s(!0), n(P, null, j(b.value, (a) => (s(), n("button", {
1012
- key: a.value,
1011
+ (s(!0), n(P, null, j(b.value, (l) => (s(), n("button", {
1012
+ key: l.value,
1013
1013
  type: "button",
1014
- class: z(["wi-web-env-switch__item", { "is-active": a.value === h.modelValue, "is-disabled": a.disabled }]),
1015
- disabled: h.disabled || a.disabled,
1016
- onClick: (U) => d(a)
1014
+ class: z(["wi-web-env-switch__item", { "is-active": l.value === h.modelValue, "is-disabled": l.disabled }]),
1015
+ disabled: h.disabled || l.disabled,
1016
+ onClick: (U) => d(l)
1017
1017
  }, [
1018
1018
  t("span", ws, [
1019
- a.value === "cloud" ? (s(), n("svg", ms, fs)) : (s(), n("svg", gs, $s))
1019
+ l.value === "cloud" ? (s(), n("svg", ms, fs)) : (s(), n("svg", gs, $s))
1020
1020
  ]),
1021
- t("span", Cs, A(a.label), 1)
1021
+ t("span", Cs, A(l.label), 1)
1022
1022
  ], 10, vs))), 128))
1023
1023
  ])
1024
1024
  ]),
1025
- l.value ? (s(), n("div", Us, [
1026
- t("span", As, A(l.value.description), 1),
1027
- l.value.status ? (s(), n("span", Bs, [
1025
+ a.value ? (s(), n("div", Us, [
1026
+ t("span", As, A(a.value.description), 1),
1027
+ a.value.status ? (s(), n("span", Bs, [
1028
1028
  t("i", {
1029
- class: z(["wi-web-env-switch__dot", { "is-online": l.value.online }])
1029
+ class: z(["wi-web-env-switch__dot", { "is-online": a.value.online }])
1030
1030
  }, null, 2),
1031
- O(" " + A(l.value.status), 1)
1031
+ O(" " + A(a.value.status), 1)
1032
1032
  ])) : g("", !0)
1033
1033
  ])) : g("", !0)
1034
1034
  ], 2));
@@ -1043,17 +1043,18 @@ export {
1043
1043
  xs as ClarificationCard,
1044
1044
  Os as DeepThinkingSteps,
1045
1045
  Ms as EnvSwitch,
1046
- Ds as IframePage,
1046
+ Ds as HostActionStatus,
1047
+ Qs as IframePage,
1047
1048
  Ot as Inputbox,
1048
- Qs as KnowledgeStreamResult,
1049
- Ns as OutputFile,
1049
+ Ns as KnowledgeStreamResult,
1050
+ js as OutputFile,
1050
1051
  us as RecordsetTable,
1051
- js as createAnswerContentMap,
1052
+ Hs as createAnswerContentMap,
1052
1053
  Qt as createWebAnswerContentMap,
1053
- Hs as injectIframeResizerChild,
1054
- Ws as provideIframePageConfig,
1055
- qs as provideOutputFileConfig,
1056
- Ks as resolveIframePlaceholders,
1057
- Ys as useIframePage
1054
+ Ws as injectIframeResizerChild,
1055
+ qs as provideIframePageConfig,
1056
+ Ks as provideOutputFileConfig,
1057
+ Ys as resolveIframePlaceholders,
1058
+ Xs as useIframePage
1058
1059
  };
1059
1060
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wi-chat",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "description": "AI 对话能力包(原 wi-chat-request/parser/theme/tools/core/renderers-ui/web-ui/mobile-ui 八包合并):请求层 + SSE/历史解析 + 主题 + 通用工具 + 对话状态机 + 共享回答渲染 + Web(Element Plus)/ 移动端(Vant)UI",
5
5
  "author": "gerson wu <gersonwu@qq.com>",
6
6
  "license": "MIT",
@@ -1,28 +0,0 @@
1
- import { AiAnswerReport } from '../../answer';
2
- import { AnswerParser, AnswerParseOptions } from '../../registry';
3
- import { StreamChunk } from '../../sse';
4
- import { ClarificationViewModel } from './types';
5
-
6
- /** 确认卡片的回答类型(也是历史 report 的分发键) */
7
- export declare const ACTION_EXECUTE_ANSWER_TYPE = "collect_clarifications";
8
- /**
9
- * 处理实时流的 front_reply 帧
10
- * @param chunk 流式数据块
11
- * @param reports 回答 reports 数组(registry 预取的同一引用,push 即累积)
12
- * @param answerValues 回答整体结构(本 parser 不使用)
13
- * @param options 解析配置(frontReply 提供回包通道与 host 执行器)
14
- * @returns 是否消费了该 chunk(仅 front_reply 返回 true)
15
- */
16
- export declare const applyActionExecuteChunk: (chunk: StreamChunk, reports: AiAnswerReport<any>[], _answerValues?: unknown, options?: AnswerParseOptions) => boolean;
17
- /**
18
- * 历史归一化:历史里的确认卡片没有在途请求,统一标为已失效(只读展示)。
19
- * 实时链路产出的 pending 报告若仍有在途请求则保持原状。
20
- * @param report 历史 reports 中的确认卡片报告(就地修改)
21
- */
22
- export declare const normalizeActionExecuteReport: (report: AiAnswerReport<ClarificationViewModel>) => void;
23
- /**
24
- * action_execute 答案类型的注册表条目(registry 内置):
25
- * - 实时链路:`applyChunk` 只消费 `front_reply` 帧(确认卡片产出报告,host 指令只回包);
26
- * - 历史链路:`answerType` 命中 `collect_clarifications` 时把 pending 标为已失效。
27
- */
28
- export declare const actionExecuteParser: AnswerParser<ClarificationViewModel>;