@opentiny/tiny-robot 0.4.2-alpha.2 → 0.4.2-alpha.4

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/index6.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as S, openBlock as g, createElementBlock as C, renderSlot as E, ref as L, computed as y, watch as U, unref as B, normalizeClass as K, createVNode as j, watchEffect as q, nextTick as ee, Fragment as F, createElementVNode as x, mergeProps as $, toDisplayString as z, withDirectives as Z, vShow as Q, createBlock as T, resolveDynamicComponent as Y, normalizeProps as P, guardReactiveProps as D, createCommentVNode as se, useCssModule as We, renderList as W, markRaw as w, inject as I, provide as A, toValue as k, reactive as je, readonly as ze, withCtx as M, onMounted as ve, onUnmounted as Ve } from "vue";
1
+ import { defineComponent as S, openBlock as g, createElementBlock as C, renderSlot as E, ref as L, computed as y, watch as U, unref as B, normalizeClass as K, createVNode as W, watchEffect as q, nextTick as ee, Fragment as F, createElementVNode as x, mergeProps as $, toDisplayString as z, withDirectives as Z, vShow as Q, createBlock as T, resolveDynamicComponent as Y, normalizeProps as P, guardReactiveProps as D, createCommentVNode as se, useCssModule as je, renderList as j, markRaw as w, inject as I, provide as A, toValue as k, reactive as We, readonly as ze, withCtx as M, onMounted as ve, onUnmounted as Ve } from "vue";
2
2
  import { _ as N } from "./_plugin-vue_export-helper.js";
3
3
  import { IconLoading as he, IconAtom as Xe, IconArrowDown as ye, IconPlugin as be, IconError as qe, IconCancelled as Ze } from "@opentiny/tiny-robot-svgs";
4
- import { l as Qe, w as et, g as tt, a as nt } from "./index4.js";
4
+ import { j as Qe, m as et, d as tt, u as nt } from "./index4.js";
5
5
  const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matches"), Be = Symbol("bubble-box-fallback-renderer"), Ce = Symbol("bubble-box-attributes"), Ee = Symbol(
6
6
  "bubble-box-prop-fallback-renderer"
7
7
  ), ke = Symbol("bubble-content-renderer-matches"), Se = Symbol(
@@ -67,7 +67,7 @@ const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matc
67
67
  },
68
68
  setup(t) {
69
69
  return (e, n) => (g(), C("div", lt, [
70
- j(B(he))
70
+ W(B(he))
71
71
  ]));
72
72
  }
73
73
  }), $e = /* @__PURE__ */ N(ct, [["__scopeId", "data-v-bc1b5ff4"]]), ut = { class: "title" }, it = { class: "detail" }, dt = /* @__PURE__ */ S({
@@ -110,10 +110,10 @@ const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matc
110
110
  x("div", {
111
111
  class: K(["icon-and-text", { thinking: (p = e.message.state) == null ? void 0 : p.thinking }])
112
112
  }, [
113
- j(B(Xe)),
113
+ W(B(Xe)),
114
114
  x("span", ut, z((f = e.message.state) != null && f.thinking ? "正在思考" : "已思考"), 1)
115
115
  ], 2),
116
- j(B(ye), {
116
+ W(B(ye), {
117
117
  class: K(["expand-icon", { "-rotate-90": !i.value }])
118
118
  }, null, 8, ["class"])
119
119
  ]),
@@ -189,7 +189,7 @@ const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matc
189
189
  } catch {
190
190
  }
191
191
  return R;
192
- }, u = We(), b = (_) => _.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), m = (_) => {
192
+ }, u = je(), b = (_) => _.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), m = (_) => {
193
193
  if (!_)
194
194
  return "";
195
195
  let v = b(_);
@@ -236,7 +236,7 @@ const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matc
236
236
  ])
237
237
  ]),
238
238
  x("div", vt, [
239
- j(B(ye), {
239
+ W(B(ye), {
240
240
  class: K(["expand-icon", { "-rotate-90": !d.value }]),
241
241
  onClick: c
242
242
  }, null, 8, ["class"])
@@ -276,7 +276,7 @@ const xe = Symbol("bubble-message-group"), Re = Symbol("bubble-box-renderer-matc
276
276
  return (i, s) => (g(), C(F, null, [
277
277
  (g(), T(Y(B(r).renderer), P(D({ ...B(r).attributes, ...B(o) })), null, 16)),
278
278
  x("div", $({ class: "tr-bubble__tools" }, i.$attrs), [
279
- (g(!0), C(F, null, W(e.message.tool_calls, (a, u) => (g(), T(we, $({
279
+ (g(!0), C(F, null, j(e.message.tool_calls, (a, u) => (g(), T(we, $({
280
280
  key: a.id
281
281
  }, { ref_for: !0 }, e, { "tool-call-index": u }), null, 16, ["tool-call-index"]))), 128))
282
282
  ], 16)
@@ -401,7 +401,7 @@ function ce(t) {
401
401
  const e = I(oe, void 0);
402
402
  if (e)
403
403
  return e;
404
- const n = je(t || {});
404
+ const n = We(t || {});
405
405
  return A(oe, n), n;
406
406
  }
407
407
  function ue() {
@@ -616,7 +616,7 @@ const Ft = async () => {
616
616
  class: K(["tr-bubble__avatar", l.$style["tr-bubble__avatar"]])
617
617
  }, null, 8, ["class"])) : se("", !0),
618
618
  x("div", Ht, [
619
- m.value ? (g(!0), C(F, { key: 0 }, W(m.value, (h, c) => (g(), T(_e, {
619
+ m.value ? (g(!0), C(F, { key: 0 }, j(m.value, (h, c) => (g(), T(_e, {
620
620
  key: c,
621
621
  class: "tr-bubble__box",
622
622
  role: n.role,
@@ -626,7 +626,7 @@ const Ft = async () => {
626
626
  "content-index": c
627
627
  }, {
628
628
  default: M(() => [
629
- j(me, {
629
+ W(me, {
630
630
  message: a.value.at(0),
631
631
  "content-index": c,
632
632
  onStateChange: d[0] || (d[0] = (_) => r("state-change", { ..._, messageIndex: 0 }))
@@ -646,10 +646,10 @@ const Ft = async () => {
646
646
  messages: a.value
647
647
  }, {
648
648
  default: M(() => [
649
- (g(!0), C(F, null, W(a.value, (h, c) => (g(), C(F, {
649
+ (g(!0), C(F, null, j(a.value, (h, c) => (g(), C(F, {
650
650
  key: `message-${c}`
651
651
  }, [
652
- (g(!0), C(F, null, W(u(h), (_, v) => (g(), T(me, {
652
+ (g(!0), C(F, null, j(u(h), (_, v) => (g(), T(me, {
653
653
  key: `content-${v}`,
654
654
  message: h,
655
655
  "content-index": v,
@@ -690,7 +690,7 @@ function ge(t, e) {
690
690
  });
691
691
  return n;
692
692
  }
693
- function Wt(t, e, n) {
693
+ function jt(t, e, n) {
694
694
  const { scrollOnMount: o = !0, bottomThreshold: r = 20, scrollThrottle: i = 0 } = n ?? {}, s = L(!0);
695
695
  let a = !1;
696
696
  const u = /* @__PURE__ */ new Set(), b = () => nt(t), { y: m, isScrolling: p, arrivedState: f } = Qe(b, { throttle: i }), l = (c) => c.scrollHeight - c.scrollTop - c.clientHeight <= r, d = async (c = "auto") => {
@@ -737,7 +737,7 @@ function Wt(t, e, n) {
737
737
  arrivedState: f
738
738
  };
739
739
  }
740
- const jt = /* @__PURE__ */ S({
740
+ const Wt = /* @__PURE__ */ S({
741
741
  __name: "BubbleItem",
742
742
  props: {
743
743
  messageGroup: {},
@@ -792,7 +792,7 @@ const jt = /* @__PURE__ */ S({
792
792
  let a = async () => {
793
793
  };
794
794
  if (o.autoScroll) {
795
- const p = y(() => o.messages.at(-1)), { scrollToBottom: f } = Wt(s, () => {
795
+ const p = y(() => o.messages.at(-1)), { scrollToBottom: f } = jt(s, () => {
796
796
  var l, d;
797
797
  return [
798
798
  o.messages.length,
@@ -848,9 +848,9 @@ const jt = /* @__PURE__ */ S({
848
848
  ref_key: "listRef",
849
849
  ref: s
850
850
  }, [
851
- (g(!0), C(F, null, W(m.value, (l, d) => {
851
+ (g(!0), C(F, null, j(m.value, (l, d) => {
852
852
  var h;
853
- return g(), T(jt, {
853
+ return g(), T(Wt, {
854
854
  key: d,
855
855
  role: l.role || o.fallbackRole,
856
856
  "role-config": (h = o.roleConfigs) == null ? void 0 : h[l.role || o.fallbackRole],
@@ -974,5 +974,5 @@ export {
974
974
  ie as h,
975
975
  Ye as i,
976
976
  Pt as j,
977
- Wt as u
977
+ jt as u
978
978
  };
package/dist/index7.js CHANGED
@@ -1,7 +1,7 @@
1
- import { onMounted as ne, onBeforeUnmount as oe, ref as _, defineComponent as P, openBlock as r, createElementBlock as a, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, useModel as W, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, mergeModels as j, nextTick as se, normalizeClass as U, createCommentVNode as G, renderSlot as q, withDirectives as A, withKeys as F, isRef as le, withModifiers as J, vModelText as re, vShow as ae } from "vue";
2
- import { IconEmptySearch as ue, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
1
+ import { onMounted as ne, onBeforeUnmount as oe, ref as _, defineComponent as P, openBlock as r, createElementBlock as u, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, useModel as W, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, mergeModels as j, nextTick as se, normalizeClass as U, createCommentVNode as G, renderSlot as q, withDirectives as A, withKeys as F, isRef as le, withModifiers as J, vModelText as re, vShow as ue } from "vue";
2
+ import { IconEmptySearch as ae, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMore as pe } from "@opentiny/tiny-robot-svgs";
3
3
  import { _ as z } from "./_plugin-vue_export-helper.js";
4
- import { o as Z, d as ve, c as ge, b as ye } from "./index4.js";
4
+ import { o as Z, b as ve, c as ge, l as ye } from "./index4.js";
5
5
  import { t as O } from "./utils.js";
6
6
  const D = _(!1);
7
7
  let b = 0, $;
@@ -38,9 +38,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
38
38
  },
39
39
  setup(s) {
40
40
  const m = s;
41
- return (t, c) => (r(), a("div", ke, [
41
+ return (t, c) => (r(), u("div", ke, [
42
42
  w("span", Le, [
43
- T(n(ue))
43
+ T(n(ae))
44
44
  ]),
45
45
  w("span", Ee, B(m.text), 1)
46
46
  ]));
@@ -76,19 +76,19 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
76
76
  }), v = (L) => {
77
77
  C("item-click", L), t.value = null, c.value = null;
78
78
  };
79
- return (L, g) => (r(), a("ul", {
79
+ return (L, g) => (r(), u("ul", {
80
80
  class: "tr-history__menu-list",
81
81
  ref_key: "menuRef",
82
82
  ref: E,
83
83
  style: ie(o.value)
84
84
  }, [
85
- (r(!0), a(S, null, V(h.items, (u) => (r(), a("li", {
85
+ (r(!0), u(S, null, V(h.items, (a) => (r(), u("li", {
86
86
  class: "tr-history__menu-list__item",
87
- key: u.id,
88
- onClick: (K) => v(u)
87
+ key: a.id,
88
+ onClick: (K) => v(a)
89
89
  }, [
90
- (r(), H(Y(u.icon))),
91
- w("span", null, B(u.text), 1)
90
+ (r(), H(Y(a.icon))),
91
+ w("span", null, B(a.text), 1)
92
92
  ], 8, Ie))), 128))
93
93
  ], 4));
94
94
  }
@@ -170,41 +170,41 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
170
170
  onItemTitleChange: (i, e) => {
171
171
  c("item-title-change", i, e);
172
172
  }
173
- }), { isTouchDevice: L } = Ce(), g = _(null), u = _(null), K = (i, e) => {
173
+ }), { isTouchDevice: L } = Ce(), g = _(null), a = _(null), K = (i, e) => {
174
174
  if (i.currentTarget instanceof HTMLButtonElement) {
175
- if (u.value === e) {
176
- g.value = null, u.value = null;
175
+ if (a.value === e) {
176
+ g.value = null, a.value = null;
177
177
  return;
178
178
  }
179
- g.value = i.currentTarget, u.value = e;
179
+ g.value = i.currentTarget, a.value = e;
180
180
  } else
181
- g.value = null, u.value = null;
181
+ g.value = null, a.value = null;
182
182
  }, ee = (i) => {
183
- const e = u.value;
183
+ const e = a.value;
184
184
  e && (i.id === "rename" && R(e), c("item-action", i, e));
185
185
  };
186
- return (i, e) => (r(), a("div", {
186
+ return (i, e) => (r(), u("div", {
187
187
  class: U(["tr-history", { "touch-device": n(L) }])
188
188
  }, [
189
- E.value ? (r(), H(Re, { key: 1 })) : (r(), a(S, { key: 0 }, [
190
- (r(!0), a(S, null, V(C.value, (f) => (r(), a("div", {
189
+ E.value ? (r(), H(Re, { key: 1 })) : (r(), u(S, { key: 0 }, [
190
+ (r(!0), u(S, null, V(C.value, (f) => (r(), u("div", {
191
191
  class: "tr-history__group",
192
192
  key: f.group
193
193
  }, [
194
- f.group !== n(X) ? (r(), a("div", Te, B(f.group), 1)) : G("", !0),
194
+ f.group !== n(X) ? (r(), u("div", Te, B(f.group), 1)) : G("", !0),
195
195
  w("div", $e, [
196
- (r(!0), a(S, null, V(f.items, (l, te) => (r(), a("div", {
196
+ (r(!0), u(S, null, V(f.items, (l, te) => (r(), u("div", {
197
197
  class: U(["tr-history__item", {
198
198
  selected: l.id && l.id === t.selected,
199
199
  editing: n(p) === l,
200
- active: u.value === l
200
+ active: a.value === l
201
201
  }]),
202
202
  key: l.id || te,
203
203
  onClick: (d) => c("item-click", l)
204
204
  }, [
205
205
  q(i.$slots, "item-prefix", { item: l }, void 0, !0),
206
206
  l.icon ? (r(), H(Y(l.icon), { key: 0 })) : G("", !0),
207
- n(p) === l ? A((r(), a("input", {
207
+ n(p) === l ? A((r(), u("input", {
208
208
  key: 1,
209
209
  class: "tr-history__item-editor",
210
210
  type: "text",
@@ -242,7 +242,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
242
242
  onClick: e[6] || (e[6] = J(() => {
243
243
  }, ["stop"]))
244
244
  }, [
245
- t.showRenameControls && n(p) === l ? (r(), a("button", {
245
+ t.showRenameControls && n(p) === l ? (r(), u("button", {
246
246
  key: 0,
247
247
  class: "editor-confirm",
248
248
  ref_for: !0,
@@ -253,7 +253,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
253
253
  }, [
254
254
  T(n(me))
255
255
  ], 512)) : G("", !0),
256
- t.showRenameControls && n(p) === l ? (r(), a("button", {
256
+ t.showRenameControls && n(p) === l ? (r(), u("button", {
257
257
  key: 1,
258
258
  class: "editor-cancel",
259
259
  ref_for: !0,
@@ -277,18 +277,18 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
277
277
  A(T(Me, {
278
278
  trigger: g.value,
279
279
  "onUpdate:trigger": e[7] || (e[7] = (f) => g.value = f),
280
- data: u.value,
281
- "onUpdate:data": e[8] || (e[8] = (f) => u.value = f),
280
+ data: a.value,
281
+ "onUpdate:data": e[8] || (e[8] = (f) => a.value = f),
282
282
  items: t.menuItems,
283
283
  "menu-list-gap": t.menuListGap,
284
284
  onItemClick: ee
285
285
  }, null, 8, ["trigger", "data", "items", "menu-list-gap"]), [
286
- [ae, g.value]
286
+ [ue, g.value]
287
287
  ])
288
288
  ], 64))
289
289
  ], 2));
290
290
  }
291
- }), N = /* @__PURE__ */ z(Be, [["__scopeId", "data-v-97a7e8a2"]]), De = function(s) {
291
+ }), N = /* @__PURE__ */ z(Be, [["__scopeId", "data-v-125148d2"]]), De = function(s) {
292
292
  s.component(N.name, N);
293
293
  };
294
294
  Object.assign(N, {
package/dist/index8.js CHANGED
@@ -1,9 +1,9 @@
1
- import { onMounted as U, nextTick as B, h as C, render as R, onBeforeUnmount as D, defineComponent as _, Teleport as W, computed as h, ref as E, openBlock as g, createBlock as F, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, renderSlot as J, createCommentVNode as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
- import { a as oe, d as re, c as ne } from "./index4.js";
1
+ import { onMounted as U, nextTick as B, h as C, render as R, onBeforeUnmount as D, defineComponent as b, Teleport as W, computed as h, ref as E, openBlock as g, createBlock as F, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, renderSlot as J, createCommentVNode as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
+ import { u as oe, b as re, c as ne } from "./index4.js";
3
3
  import { t as u } from "./utils.js";
4
4
  import { _ as N } from "./_plugin-vue_export-helper.js";
5
5
  import { u as se } from "./useSlotRefs.js";
6
- const pe = _({
6
+ const pe = b({
7
7
  setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
8
8
  props: ["propsFactory", "vnodeFactory"]
9
9
  });
@@ -34,7 +34,7 @@ function ce(r, n) {
34
34
  return d;
35
35
  });
36
36
  }
37
- const ie = /* @__PURE__ */ _({
37
+ const ie = /* @__PURE__ */ b({
38
38
  __name: "Popper",
39
39
  props: {
40
40
  show: { type: Boolean },
@@ -58,7 +58,7 @@ const ie = /* @__PURE__ */ _({
58
58
  _: 3
59
59
  }, 16));
60
60
  }
61
- }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ _({
61
+ }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ b({
62
62
  inheritAttrs: !1,
63
63
  __name: "index",
64
64
  props: {
@@ -88,7 +88,7 @@ const ie = /* @__PURE__ */ _({
88
88
  for (const [c, a] of Object.entries(o))
89
89
  /^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
90
90
  return p;
91
- }, f = E(null), b = h(() => {
91
+ }, f = E(null), _ = h(() => {
92
92
  var o;
93
93
  return ((o = f.value) == null ? void 0 : o.popperRef) || null;
94
94
  }), m = h(() => {
@@ -110,7 +110,7 @@ const ie = /* @__PURE__ */ _({
110
110
  } = re(i), {
111
111
  width: x,
112
112
  height: P
113
- } = ne(b, void 0, {
113
+ } = ne(_, void 0, {
114
114
  box: "border-box"
115
115
  }), H = h(() => {
116
116
  const {
@@ -146,7 +146,7 @@ const ie = /* @__PURE__ */ _({
146
146
  }
147
147
  })), n({
148
148
  triggerRef: i,
149
- popperRef: b,
149
+ popperRef: _,
150
150
  update: A
151
151
  }), (o, p) => (g(), F(ee(S(s)[0]), k({
152
152
  ref: S(d)