@inupedia/spotlight-vue 0.5.16 → 0.5.18

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,115 +1,130 @@
1
- import { defineComponent as qt, ref as O, onMounted as Ut, nextTick as bt, onBeforeUnmount as Jt, computed as y, watch as ft, openBlock as r, createElementBlock as o, normalizeClass as A, createElementVNode as s, toDisplayString as a, createCommentVNode as c, createVNode as L, Fragment as h, renderList as f, unref as j, normalizeStyle as pt } from "vue";
2
- import { MdPreview as yt } from "md-editor-v3";
1
+ import { defineComponent as Gt, ref as N, onMounted as Ut, nextTick as yt, onBeforeUnmount as Jt, computed as p, watch as pt, openBlock as r, createElementBlock as o, normalizeClass as C, createElementVNode as s, toDisplayString as a, createCommentVNode as c, createVNode as I, Fragment as h, renderList as b, unref as B, normalizeStyle as vt } from "vue";
2
+ import { MdPreview as _t } from "md-editor-v3";
3
3
  import "md-editor-v3/lib/preview.css";
4
- import vt from "./SpotlightMarkdownPreview.vue.js";
5
- import { isToolExecutionStep as _t, splitToolStepContent as wt, sanitizeToolStepAnswerText as Tt, humanizeSpotlightStepContent as Wt, getIntentStepDisplayContent as Gt } from "../store/pipeline/displayText.js";
6
- import { partitionToolCalls as St, isUserFacingKnowledgeTool as Qt } from "../store/pipeline/toolDisplay.js";
7
- import { getSpotlightMemoryResultCopy as Xt } from "../store/memoryResultCopy.js";
8
- const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-stack" }, te = { class: "thinking-bar-title" }, ee = {
4
+ import wt from "./SpotlightMarkdownPreview.vue.js";
5
+ import { isAnswerStep as K, isToolExecutionStep as Z, splitToolStepContent as tt, sanitizeToolStepAnswerText as Tt, formatGatherProcessText as Wt, humanizeSpotlightStepContent as Yt, getIntentStepDisplayContent as Qt, parseGatherProcessDisplay as Xt } from "../store/pipeline/displayText.js";
6
+ import { partitionToolCalls as St, isUserFacingKnowledgeTool as Zt } from "../store/pipeline/toolDisplay.js";
7
+ import { getSpotlightMemoryResultCopy as te } from "../store/memoryResultCopy.js";
8
+ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-stack" }, ie = { class: "thinking-bar-title" }, se = {
9
9
  key: 0,
10
10
  class: "thinking-bar-memory-badge"
11
- }, ne = {
11
+ }, re = {
12
12
  key: 0,
13
13
  class: "thinking-bar-metrics",
14
14
  "aria-label": "执行状态概览"
15
- }, ie = { class: "thinking-bar-metric" }, se = { class: "thinking-bar-metric" }, re = { class: "thinking-bar-metric" }, oe = {
15
+ }, oe = { class: "thinking-bar-metric" }, le = { class: "thinking-bar-metric" }, ae = { class: "thinking-bar-metric" }, ce = {
16
16
  key: 0,
17
17
  class: "thinking-bar-memory-result",
18
18
  "aria-label": "项目记忆回答"
19
- }, le = { class: "thinking-bar-memory-result-intro" }, ae = { class: "thinking-bar-memory-result-copy" }, ce = { class: "thinking-bar-memory-result-answer" }, ue = { class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer" }, de = { class: "thinking-bar-memory-result-footer" }, he = { class: "thinking-bar-step-inner" }, ge = { class: "thinking-bar-step-column" }, ke = { class: "thinking-bar-step-label" }, me = ["onScrollPassive"], be = {
19
+ }, ue = { class: "thinking-bar-memory-result-intro" }, de = { class: "thinking-bar-memory-result-copy" }, he = { class: "thinking-bar-memory-result-answer" }, ge = { class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer" }, ke = { class: "thinking-bar-memory-result-footer" }, me = { class: "thinking-bar-step-inner" }, be = { class: "thinking-bar-step-column" }, fe = { class: "thinking-bar-step-label" }, ye = ["onScrollPassive"], pe = {
20
20
  key: 0,
21
21
  class: "thinking-bar-tool-step-flow"
22
- }, fe = {
22
+ }, ve = {
23
23
  key: 0,
24
+ class: "thinking-bar-gather-process"
25
+ }, _e = {
26
+ key: 0,
27
+ class: "thinking-bar-gather-headline"
28
+ }, we = {
29
+ key: 1,
30
+ class: "thinking-bar-source-list"
31
+ }, Te = {
32
+ key: 2,
33
+ class: "thinking-bar-gather-note"
34
+ }, Se = {
35
+ key: 1,
24
36
  class: "thinking-bar-execution-details"
25
- }, pe = { class: "thinking-bar-execution-details-summary" }, ye = { class: "thinking-bar-execution-details-meta" }, ve = { class: "thinking-bar-execution-details-body" }, _e = {
37
+ }, $e = { class: "thinking-bar-execution-details-summary" }, xe = { class: "thinking-bar-execution-details-title" }, Re = { class: "thinking-bar-execution-details-meta" }, Ae = { class: "thinking-bar-execution-details-body" }, Ce = {
26
38
  key: 0,
27
39
  class: "thinking-bar-execution-planning"
28
- }, we = ["open"], Te = { class: "thinking-bar-tool-call-head" }, Se = { class: "thinking-bar-tool-call-head-main" }, $e = { class: "thinking-bar-tool-call-name" }, xe = {
40
+ }, Be = { class: "thinking-bar-tool-call-head" }, De = { class: "thinking-bar-tool-call-head-main" }, Fe = { class: "thinking-bar-tool-call-name" }, Ee = {
29
41
  key: 0,
30
42
  class: "thinking-bar-tool-call-id"
31
- }, Re = { class: "thinking-bar-tool-call-head-side" }, Ae = { class: "thinking-bar-tool-call-body" }, Ce = {
43
+ }, He = { class: "thinking-bar-tool-call-head-side" }, Me = { class: "thinking-bar-tool-call-body" }, ze = {
32
44
  key: 0,
33
45
  class: "thinking-bar-tool-call-block"
34
- }, Be = { class: "thinking-bar-tool-call-pre" }, Fe = {
46
+ }, Pe = { class: "thinking-bar-tool-call-pre" }, je = {
35
47
  key: 1,
36
48
  class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
37
- }, De = { class: "thinking-bar-tool-call-pre" }, Ee = {
49
+ }, Ne = { class: "thinking-bar-tool-call-pre" }, Oe = {
38
50
  key: 2,
39
51
  class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
40
- }, Me = {
52
+ }, Le = {
41
53
  key: 0,
42
54
  class: "thinking-bar-tool-result-image-shell"
43
- }, ze = ["src", "alt"], He = ["srcdoc", "title"], Oe = {
55
+ }, Ie = ["src", "alt"], Ke = ["srcdoc", "title"], Ve = {
44
56
  key: 2,
45
57
  class: "thinking-bar-tool-result-table-wrap"
46
- }, je = { class: "thinking-bar-tool-result-table" }, Ne = {
58
+ }, qe = { class: "thinking-bar-tool-result-table" }, Ge = {
47
59
  key: 3,
48
60
  class: "thinking-bar-tool-call-pre"
49
- }, Le = {
61
+ }, Ue = {
50
62
  key: 3,
51
63
  class: "thinking-bar-tool-call-block"
52
- }, Pe = { class: "thinking-bar-tool-call-pre" }, Ie = {
64
+ }, Je = { class: "thinking-bar-tool-call-pre" }, We = {
53
65
  key: 4,
54
66
  class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--error"
55
- }, Ke = { class: "thinking-bar-tool-call-pre" }, Ve = {
67
+ }, Ye = { class: "thinking-bar-tool-call-pre" }, Qe = {
56
68
  key: 5,
57
69
  class: "thinking-bar-nested-tools"
58
- }, qe = { class: "thinking-bar-tool-call-head" }, Ue = { class: "thinking-bar-tool-call-head-main" }, Je = { class: "thinking-bar-tool-call-name" }, We = { class: "thinking-bar-tool-call-head-side" }, Ge = { class: "thinking-bar-tool-call-body" }, Qe = {
70
+ }, Xe = { class: "thinking-bar-tool-call-head" }, Ze = { class: "thinking-bar-tool-call-head-main" }, tn = { class: "thinking-bar-tool-call-name" }, en = { class: "thinking-bar-tool-call-head-side" }, nn = { class: "thinking-bar-tool-call-body" }, sn = {
59
71
  key: 0,
60
72
  class: "thinking-bar-tool-call-block"
61
- }, Xe = { class: "thinking-bar-tool-call-pre" }, Ye = {
73
+ }, rn = { class: "thinking-bar-tool-call-pre" }, on = {
62
74
  key: 1,
63
75
  class: "thinking-bar-tool-call-block"
64
- }, Ze = { class: "thinking-bar-tool-call-pre" }, tn = {
65
- key: 1,
66
- class: "thinking-bar-step-answer-section"
67
- }, en = { class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer" }, nn = {
76
+ }, ln = { class: "thinking-bar-tool-call-pre" }, an = {
77
+ key: 0,
78
+ class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer"
79
+ }, cn = {
68
80
  key: 0,
69
81
  class: "thinking-bar-chat-items"
70
- }, sn = {
82
+ }, un = {
71
83
  key: 0,
72
84
  class: "thinking-bar-step-text thinking-bar-step-markdown"
73
- }, rn = ["open"], on = { class: "thinking-bar-tool-call-head" }, ln = { class: "thinking-bar-tool-call-head-main" }, an = { class: "thinking-bar-tool-call-name" }, cn = { class: "thinking-bar-tool-call-head-side" }, un = { class: "thinking-bar-tool-call-body" }, dn = {
85
+ }, dn = {
86
+ key: 1,
87
+ class: "thinking-bar-tool-call"
88
+ }, hn = { class: "thinking-bar-tool-call-head" }, gn = { class: "thinking-bar-tool-call-head-main" }, kn = { class: "thinking-bar-tool-call-name" }, mn = { class: "thinking-bar-tool-call-head-side" }, bn = { class: "thinking-bar-tool-call-body" }, fn = {
74
89
  key: 0,
75
90
  class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
76
- }, hn = {
91
+ }, yn = {
77
92
  key: 0,
78
93
  class: "thinking-bar-tool-result-image-shell"
79
- }, gn = ["src", "alt"], kn = ["srcdoc", "title"], mn = {
94
+ }, pn = ["src", "alt"], vn = ["srcdoc", "title"], _n = {
80
95
  key: 2,
81
96
  class: "thinking-bar-tool-result-table-wrap"
82
- }, bn = { class: "thinking-bar-tool-result-table" }, fn = {
97
+ }, wn = { class: "thinking-bar-tool-result-table" }, Tn = {
83
98
  key: 3,
84
99
  class: "thinking-bar-tool-call-pre"
85
- }, pn = {
100
+ }, Sn = {
86
101
  key: 1,
87
102
  class: "thinking-bar-step-text thinking-bar-step-markdown"
88
- }, yn = {
89
- key: 2,
90
- class: "thinking-bar-attachments"
91
- }, vn = ["href"], _n = ["src", "alt"], wn = { class: "thinking-bar-attachment-meta" }, Tn = { class: "thinking-bar-attachment-name" }, Sn = { class: "thinking-bar-attachment-type" }, $n = {
103
+ }, $n = {
92
104
  key: 3,
105
+ class: "thinking-bar-attachments"
106
+ }, xn = ["href"], Rn = ["src", "alt"], An = { class: "thinking-bar-attachment-meta" }, Cn = { class: "thinking-bar-attachment-name" }, Bn = { class: "thinking-bar-attachment-type" }, Dn = {
107
+ key: 4,
93
108
  class: "thinking-bar-workspace"
94
- }, xn = { class: "thinking-bar-workspace-shell" }, Rn = { class: "thinking-bar-file-tree-pane" }, An = { class: "thinking-bar-file-tree-body" }, Cn = {
109
+ }, Fn = { class: "thinking-bar-workspace-shell" }, En = { class: "thinking-bar-file-tree-pane" }, Hn = { class: "thinking-bar-file-tree-body" }, Mn = {
95
110
  key: 0,
96
111
  class: "thinking-bar-tree-node"
97
- }, Bn = ["onClick"], Fn = { class: "thinking-bar-tree-caret" }, Dn = { class: "thinking-bar-tree-label" }, En = ["onClick"], Mn = { class: "thinking-bar-tree-icon" }, zn = { class: "thinking-bar-tree-label" }, Hn = { class: "thinking-bar-file-preview" }, On = { class: "thinking-bar-file-preview-head" }, jn = { class: "thinking-bar-file-preview-title" }, Nn = { class: "thinking-bar-tree-icon" }, Ln = {
112
+ }, zn = ["onClick"], Pn = { class: "thinking-bar-tree-caret" }, jn = { class: "thinking-bar-tree-label" }, Nn = ["onClick"], On = { class: "thinking-bar-tree-icon" }, Ln = { class: "thinking-bar-tree-label" }, In = { class: "thinking-bar-file-preview" }, Kn = { class: "thinking-bar-file-preview-head" }, Vn = { class: "thinking-bar-file-preview-title" }, qn = { class: "thinking-bar-tree-icon" }, Gn = {
98
113
  key: 0,
99
114
  class: "thinking-bar-preview-chip"
100
- }, Pn = {
115
+ }, Un = {
101
116
  key: 0,
102
117
  class: "thinking-bar-image-shell"
103
- }, In = ["src", "alt"], Kn = {
118
+ }, Jn = ["src", "alt"], Wn = {
104
119
  key: 1,
105
120
  class: "thinking-bar-empty-preview"
106
- }, Vn = ["srcdoc", "title"], qn = {
121
+ }, Yn = ["srcdoc", "title"], Qn = {
107
122
  key: 2,
108
123
  class: "thinking-bar-file-preview-body"
109
- }, Un = {
124
+ }, Xn = {
110
125
  key: 1,
111
126
  class: "thinking-bar-empty-preview"
112
- }, ti = /* @__PURE__ */ qt({
127
+ }, oi = /* @__PURE__ */ Gt({
113
128
  __name: "SpotlightThinking",
114
129
  props: {
115
130
  steps: {},
@@ -120,11 +135,11 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
120
135
  },
121
136
  emits: ["close", "force-refresh"],
122
137
  setup(v) {
123
- const X = O(!1), P = O(null), w = O({}), S = /* @__PURE__ */ new Map();
124
- let F = null, $ = null;
125
- function I(e) {
126
- W(e), requestAnimationFrame(() => {
127
- W(e);
138
+ const et = N(!1), V = N(null), w = N({}), S = /* @__PURE__ */ new Map();
139
+ let E = null, $ = null;
140
+ function q(e) {
141
+ Y(e), requestAnimationFrame(() => {
142
+ Y(e);
128
143
  });
129
144
  }
130
145
  function $t(e, t) {
@@ -133,18 +148,18 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
133
148
  const n = t instanceof HTMLElement ? t : null;
134
149
  n ? (S.set(e, n), $?.observe(n)) : S.delete(e);
135
150
  }
136
- function Y(e) {
151
+ function nt(e) {
137
152
  return e.scrollHeight - e.scrollTop - e.clientHeight <= 96;
138
153
  }
139
154
  function xt(e, t) {
140
155
  const i = t.target;
141
- F != null && window.clearTimeout(F), w.value = {
156
+ E != null && window.clearTimeout(E), w.value = {
142
157
  ...w.value,
143
- [e]: Y(i)
144
- }, F = window.setTimeout(() => {
158
+ [e]: nt(i)
159
+ }, E = window.setTimeout(() => {
145
160
  w.value = {
146
161
  ...w.value,
147
- [e]: Y(i)
162
+ [e]: nt(i)
148
163
  };
149
164
  }, 120);
150
165
  }
@@ -154,94 +169,101 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
154
169
  const t = d.steps[d.steps.length - 1];
155
170
  return t ? [t.id] : [];
156
171
  }
157
- function Z(e, t) {
172
+ function it(e, t) {
158
173
  return t ? !0 : w.value[e] !== !1;
159
174
  }
160
175
  Ut(() => {
161
176
  typeof ResizeObserver < "u" && ($ = new ResizeObserver(() => {
162
- W();
163
- }), bt(() => {
177
+ Y();
178
+ }), yt(() => {
164
179
  S.forEach((e) => {
165
180
  $?.observe(e);
166
181
  });
167
182
  })), requestAnimationFrame(() => {
168
- X.value = !0;
183
+ et.value = !0;
169
184
  }), requestAnimationFrame(() => {
170
- I(!0);
185
+ q(!0);
171
186
  });
172
187
  }), Jt(() => {
173
- F != null && window.clearTimeout(F), $?.disconnect(), $ = null, S.clear();
188
+ E != null && window.clearTimeout(E), $?.disconnect(), $ = null, S.clear();
174
189
  });
175
- const d = v, At = y(() => C.value ? "项目记忆已回答" : d.steps.length > 0 && d.steps.every((t) => t.status === "done" || t.status === "error") ? "执行完成" : "思考中"), tt = y(() => d.memoryDecision ? {
190
+ const d = v, At = p(() => D.value ? "项目记忆已回答" : d.steps.length > 0 && d.steps.every((t) => t.status === "done" || t.status === "error") ? "执行完成" : "思考中"), st = p(() => d.memoryDecision ? {
176
191
  reuse: "已复用项目记忆",
177
192
  augment: "已结合项目记忆",
178
193
  refresh: "已重新验证资料",
179
194
  ignore: ""
180
- }[d.memoryDecision.action] : d.memoryReplay ? d.memoryReplay.source === "semantic" ? "语义缓存" : d.memoryReplay.source === "exact" ? "Memory 缓存" : "Session 缓存" : ""), Ct = y(
195
+ }[d.memoryDecision.action] : d.memoryReplay ? d.memoryReplay.source === "semantic" ? "语义缓存" : d.memoryReplay.source === "exact" ? "Memory 缓存" : "Session 缓存" : ""), Ct = p(
181
196
  () => d.steps.some(
182
197
  (e) => e.status === "active" || e.status === "pending" || e.toolCalls?.some(
183
198
  (t) => t.status === "pending" || t.status === "running"
184
199
  )
185
200
  )
186
- ), C = y(
201
+ ), D = p(
187
202
  () => d.memoryDecision?.action === "reuse" && d.steps.length > 0 && d.steps.every(
188
203
  (e) => e.status === "done" || e.status === "error"
189
204
  )
190
- ), Bt = y(() => {
191
- const e = d.steps.find((t) => _t(t.id));
192
- return e && (V(e).trim() || e.content?.trim()) || "项目记忆中没有可展示的回答。";
193
- }), et = y(
194
- () => Xt(d.memoryReplay?.source)
195
- ), Ft = y(() => et.value.heading), Dt = y(
196
- () => et.value.description
197
- ), Et = y(
205
+ ), Bt = p(() => {
206
+ const e = d.steps.find((t) => K(t.id)) ?? d.steps.find((t) => Z(t.id));
207
+ return e && ((K(e.id) ? e.content?.trim() : zt(e).trim()) || e.content?.trim()) || "项目记忆中没有可展示的回答。";
208
+ }), rt = p(
209
+ () => te(d.memoryReplay?.source)
210
+ ), Dt = p(() => rt.value.heading), Ft = p(
211
+ () => rt.value.description
212
+ ), Et = p(
198
213
  () => d.steps.filter((e) => e.status === "active").length
199
- ), Mt = y(
214
+ ), Ht = p(
200
215
  () => d.steps.filter((e) => e.status === "done").length
201
216
  );
202
- function zt(e) {
217
+ function Mt(e) {
203
218
  return e.name.trim().toLowerCase();
204
219
  }
205
- function N(e) {
220
+ function O(e) {
206
221
  return e.displayName?.trim() || e.name;
207
222
  }
208
- function K(e) {
209
- return wt(e.content ?? "").planning;
223
+ function G(e) {
224
+ return tt(e.content ?? "").planning;
225
+ }
226
+ function x(e) {
227
+ const { planning: t, answer: i } = tt(e.content ?? ""), n = L((t || i).trim());
228
+ return n ? Xt(n) : null;
210
229
  }
211
- function V(e) {
212
- const { planning: t } = wt(e.content ?? ""), i = nt(
230
+ function zt(e) {
231
+ if (!K(e.id) && Z(e.id)) return "";
232
+ const { planning: t } = tt(e.content ?? ""), i = L(
213
233
  Tt(e.content ?? "")
214
234
  );
215
- return i.trim() ? i : t.trim() ? "" : nt(
235
+ return i.trim() ? i : t.trim() ? "" : L(
216
236
  Tt(e.content ?? "")
217
237
  );
218
238
  }
219
- function nt(e) {
239
+ function L(e) {
220
240
  const t = e.trim();
221
- return !t || t.startsWith("联网检索证据:") || t.includes("Tavily answer:") ? "" : t;
241
+ return !t || t.startsWith("联网检索证据:") || t.includes("Tavily answer:") || t.includes("Hikari answer") || t.includes("Yuxi project knowledge") || t.includes("Spotlight knowledge") ? "" : t;
222
242
  }
223
- function it(e) {
243
+ function ot(e) {
224
244
  return e.toolCalls?.length ? e.toolCalls : (e.chatItems ?? []).filter(
225
245
  (t) => t.type === "tool"
226
246
  ).map((t) => t.toolCall);
227
247
  }
228
- function q(e) {
229
- return St(it(e)).visible;
230
- }
231
- function st(e) {
232
- return St(it(e)).nestedKnowledge;
248
+ function U(e) {
249
+ return St(ot(e)).visible;
233
250
  }
234
- function Ht(e) {
235
- return Qt(e.name);
251
+ function lt(e) {
252
+ return St(ot(e)).nestedKnowledge;
236
253
  }
237
- function Ot(e) {
238
- return !!(K(e).trim() || q(e).length > 0);
254
+ function Pt(e) {
255
+ return Zt(e.name);
239
256
  }
240
257
  function jt(e) {
241
- const t = q(e).length;
242
- return t > 0 ? `${t} 个工具调用` : "规划记录";
258
+ return !!(G(e).trim() || U(e).length > 0);
243
259
  }
244
- function rt(e) {
260
+ function Nt(e) {
261
+ const t = U(e);
262
+ return t.length === 0 ? "规划记录" : t.some(
263
+ (n) => n.status === "running" || n.status === "pending"
264
+ ) ? `${t.length} 个工具 · 执行中` : `${t.length} 个工具调用`;
265
+ }
266
+ function at(e) {
245
267
  switch (e) {
246
268
  case "done":
247
269
  return "已完成";
@@ -253,16 +275,13 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
253
275
  return "待执行";
254
276
  }
255
277
  }
256
- function ot(e) {
278
+ function ct(e) {
257
279
  return e?.length ? e.map(
258
280
  (t) => `[${t.phase}/${t.type}] ${t.tool}${t.detail ? ` · ${t.detail}` : ""}`
259
281
  ).join(`
260
282
  `) : "";
261
283
  }
262
- function lt(e) {
263
- return e.status === "running" || e.status === "pending";
264
- }
265
- function U(e) {
284
+ function J(e) {
266
285
  if (!e) return null;
267
286
  try {
268
287
  return JSON.parse(e);
@@ -270,36 +289,36 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
270
289
  return null;
271
290
  }
272
291
  }
273
- function x(e) {
274
- const t = zt(e), i = e.resultText?.trim() || "";
292
+ function R(e) {
293
+ const t = Mt(e), i = e.resultText?.trim() || "";
275
294
  if (!i) return "";
276
295
  if (t === "list_kbs") {
277
- const n = U(i);
296
+ const n = J(i);
278
297
  return Array.isArray(n) && n.length === 0 ? "当前没有可访问的知识库" : i;
279
298
  }
280
299
  if (t === "list_directory" || t === "ls") {
281
- const n = U(i);
300
+ const n = J(i);
282
301
  return Array.isArray(n) && n.length === 0 ? "" : i;
283
302
  }
284
303
  return i;
285
304
  }
286
- function J(e) {
305
+ function W(e) {
287
306
  const t = e.resultText?.trim() || "";
288
- return t ? U(t) ?? t : null;
307
+ return t ? J(t) ?? t : null;
289
308
  }
290
- function D(e) {
309
+ function H(e) {
291
310
  return typeof e == "object" && e !== null && !Array.isArray(e);
292
311
  }
293
- function at(e) {
312
+ function ut(e) {
294
313
  return /<(table|html|body|svg|div|span|img|p|iframe)[\s>]/i.test(e);
295
314
  }
296
- function E(e) {
297
- const t = J(e);
315
+ function M(e) {
316
+ const t = W(e);
298
317
  if (typeof t == "string") {
299
318
  const i = t.trim();
300
319
  return /^data:image\//i.test(i) || /\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(i) ? i : null;
301
320
  }
302
- if (D(t)) {
321
+ if (H(t)) {
303
322
  const i = [t.url, t.uri, t.path].find(
304
323
  (n) => typeof n == "string" && /^data:image\//i.test(n)
305
324
  );
@@ -307,44 +326,44 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
307
326
  }
308
327
  return null;
309
328
  }
310
- function M(e) {
311
- const t = J(e);
312
- if (typeof t == "string" && at(t.trim()))
329
+ function z(e) {
330
+ const t = W(e);
331
+ if (typeof t == "string" && ut(t.trim()))
313
332
  return t;
314
- if (D(t)) {
333
+ if (H(t)) {
315
334
  const i = [t.html, t.content, t.markup].find(
316
- (n) => typeof n == "string" && at(n)
335
+ (n) => typeof n == "string" && ut(n)
317
336
  );
318
337
  return typeof i == "string" ? i : null;
319
338
  }
320
339
  return null;
321
340
  }
322
- function ct(e) {
323
- return !Array.isArray(e) || e.length === 0 || !e.every((t) => D(t)) ? null : e;
341
+ function dt(e) {
342
+ return !Array.isArray(e) || e.length === 0 || !e.every((t) => H(t)) ? null : e;
324
343
  }
325
344
  function _(e) {
326
- const t = J(e);
345
+ const t = W(e);
327
346
  if (Array.isArray(t) && t.length > 0 && t.every((n) => typeof n == "string"))
328
347
  return {
329
348
  columns: ["value"],
330
349
  rows: t.map((n) => ({ value: n }))
331
350
  };
332
- const i = ct(t);
351
+ const i = dt(t);
333
352
  if (i) {
334
353
  const n = [...new Set(i.flatMap((l) => Object.keys(l)))];
335
354
  return n.length > 0 ? { columns: n, rows: i } : null;
336
355
  }
337
- if (!D(t)) return null;
356
+ if (!H(t)) return null;
338
357
  if (Array.isArray(t.columns) && Array.isArray(t.rows) && t.columns.every((n) => typeof n == "string")) {
339
358
  const n = t.columns, l = t.rows.map(
340
- (u) => D(u) ? u : Array.isArray(u) ? Object.fromEntries(
341
- n.map((b, p) => [b, u[p]])
359
+ (u) => H(u) ? u : Array.isArray(u) ? Object.fromEntries(
360
+ n.map((f, y) => [f, u[y]])
342
361
  ) : { value: u }
343
362
  );
344
363
  return n.length > 0 ? { columns: n, rows: l } : null;
345
364
  }
346
365
  if (Array.isArray(t.data)) {
347
- const n = ct(t.data);
366
+ const n = dt(t.data);
348
367
  if (n) {
349
368
  const l = [
350
369
  ...new Set(n.flatMap((u) => Object.keys(u)))
@@ -354,11 +373,11 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
354
373
  }
355
374
  return null;
356
375
  }
357
- function ut(e) {
358
- const t = x(e), i = e.summary?.trim();
359
- return t && i && t.trim() === i ? !1 : !!(E(e) || M(e) || _(e) || t);
376
+ function ht(e) {
377
+ const t = R(e), i = e.summary?.trim();
378
+ return t && i && t.trim() === i ? !1 : !!(M(e) || z(e) || _(e) || t);
360
379
  }
361
- function dt(e) {
380
+ function gt(e) {
362
381
  if (e == null) return "-";
363
382
  if (typeof e == "string") return e;
364
383
  if (typeof e == "number" || typeof e == "boolean")
@@ -369,9 +388,9 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
369
388
  return String(e);
370
389
  }
371
390
  }
372
- async function W(e = !1) {
373
- await bt();
374
- const t = P.value;
391
+ async function Y(e = !1) {
392
+ await yt();
393
+ const t = V.value;
375
394
  t && t.scrollTo({
376
395
  top: t.scrollHeight,
377
396
  behavior: e ? "auto" : "smooth"
@@ -379,27 +398,27 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
379
398
  const i = Rt();
380
399
  for (const n of i) {
381
400
  const l = S.get(n);
382
- !l || !Z(n, e) || l.scrollTo({
401
+ !l || !it(n, e) || l.scrollTo({
383
402
  top: l.scrollHeight,
384
403
  behavior: e ? "auto" : "smooth"
385
404
  });
386
405
  }
387
406
  window.setTimeout(() => {
388
- const n = P.value;
407
+ const n = V.value;
389
408
  n && n.scrollTo({
390
409
  top: n.scrollHeight,
391
410
  behavior: "auto"
392
411
  });
393
412
  for (const l of i) {
394
413
  const u = S.get(l);
395
- !u || !Z(l, e) || u.scrollTo({
414
+ !u || !it(l, e) || u.scrollTo({
396
415
  top: u.scrollHeight,
397
416
  behavior: "auto"
398
417
  });
399
418
  }
400
419
  }, 120);
401
420
  }
402
- ft(
421
+ pt(
403
422
  () => d.steps,
404
423
  () => {
405
424
  if (Ct.value) {
@@ -407,84 +426,84 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
407
426
  e && !(e.id in w.value) && (w.value = {
408
427
  ...w.value,
409
428
  [e.id]: !0
410
- }), I(!1);
429
+ }), q(!1);
411
430
  return;
412
431
  }
413
- I(!1);
432
+ q(!1);
414
433
  },
415
434
  { deep: !0 }
416
435
  );
417
- const z = O({}), B = O({});
418
- ft(
436
+ const P = N({}), F = N({});
437
+ pt(
419
438
  () => d.steps,
420
439
  (e) => {
421
- const t = { ...z.value }, i = { ...B.value };
440
+ const t = { ...P.value }, i = { ...F.value };
422
441
  for (const n of e) {
423
442
  if (n.files?.length && !t[n.id] && (t[n.id] = n.files[0].id), !n.files?.length && t[n.id] && delete t[n.id], n.files?.length) {
424
443
  const l = new Set(i[n.id] || []);
425
444
  for (const u of n.files)
426
- Pt(u.path).forEach(
427
- (b) => l.add(b)
445
+ It(u.path).forEach(
446
+ (f) => l.add(f)
428
447
  );
429
448
  i[n.id] = [...l];
430
449
  }
431
450
  !n.files?.length && i[n.id] && delete i[n.id];
432
451
  }
433
- z.value = t, B.value = i;
452
+ P.value = t, F.value = i;
434
453
  },
435
454
  { deep: !0, immediate: !0 }
436
455
  );
437
- function Nt(e, t) {
438
- z.value = {
439
- ...z.value,
456
+ function Ot(e, t) {
457
+ P.value = {
458
+ ...P.value,
440
459
  [e]: t
441
460
  };
442
461
  }
443
462
  function Lt(e, t) {
444
- t && Nt(e, t.id);
463
+ t && Ot(e, t.id);
445
464
  }
446
465
  function k(e) {
447
- const t = z.value[e.id];
466
+ const t = P.value[e.id];
448
467
  return e.files?.find((i) => i.id === t) ?? e.files?.[0] ?? null;
449
468
  }
450
- function Pt(e) {
469
+ function It(e) {
451
470
  const t = e.split("/").filter(Boolean), i = [];
452
471
  let n = "";
453
472
  return t.slice(0, -1).forEach((l) => {
454
473
  n += `/${l}`, i.push(n);
455
474
  }), i;
456
475
  }
457
- function ht(e, t) {
458
- return (B.value[e] || []).includes(t);
476
+ function kt(e, t) {
477
+ return (F.value[e] || []).includes(t);
459
478
  }
460
- function It(e, t) {
461
- const i = new Set(B.value[e] || []);
462
- i.has(t) ? i.delete(t) : i.add(t), B.value = {
463
- ...B.value,
479
+ function Kt(e, t) {
480
+ const i = new Set(F.value[e] || []);
481
+ i.has(t) ? i.delete(t) : i.add(t), F.value = {
482
+ ...F.value,
464
483
  [e]: [...i]
465
484
  };
466
485
  }
467
- function Kt(e, t) {
468
- const i = /* @__PURE__ */ new Map(), n = (p, R, T) => (i.has(p) || i.set(p, {
469
- path: p,
470
- name: R,
486
+ function Vt(e, t) {
487
+ const i = /* @__PURE__ */ new Map(), n = (y, A, T) => (i.has(y) || i.set(y, {
488
+ path: y,
489
+ name: A,
471
490
  depth: T,
472
491
  directoryChildren: [],
473
492
  files: []
474
- }), i.get(p)), l = n("", "root", -1);
475
- for (const p of t) {
476
- const R = p.path.split("/").filter(Boolean);
477
- let T = "", H = l;
478
- R.slice(0, -1).forEach((m, g) => {
493
+ }), i.get(y)), l = n("", "root", -1);
494
+ for (const y of t) {
495
+ const A = y.path.split("/").filter(Boolean);
496
+ let T = "", j = l;
497
+ A.slice(0, -1).forEach((m, g) => {
479
498
  T += `/${m}`;
480
- const Vt = n(T, m, g);
481
- H.directoryChildren.includes(T) || H.directoryChildren.push(T), H = Vt;
482
- }), H.files.push(p);
499
+ const qt = n(T, m, g);
500
+ j.directoryChildren.includes(T) || j.directoryChildren.push(T), j = qt;
501
+ }), j.files.push(y);
483
502
  }
484
- const u = [], b = (p) => {
485
- const R = i.get(p);
486
- if (!R) return;
487
- const T = [...R.directoryChildren].sort(
503
+ const u = [], f = (y) => {
504
+ const A = i.get(y);
505
+ if (!A) return;
506
+ const T = [...A.directoryChildren].sort(
488
507
  (m, g) => m.localeCompare(g, "zh-CN")
489
508
  );
490
509
  for (const m of T) {
@@ -495,9 +514,9 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
495
514
  name: g.name,
496
515
  depth: g.depth,
497
516
  file: null
498
- }), ht(e, g.path) && b(g.path));
517
+ }), kt(e, g.path) && f(g.path));
499
518
  }
500
- [...R.files].sort(
519
+ [...A.files].sort(
501
520
  (m, g) => m.path.localeCompare(g.path, "zh-CN")
502
521
  ).forEach((m) => {
503
522
  const g = Math.max(
@@ -513,61 +532,61 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
513
532
  });
514
533
  });
515
534
  };
516
- return b(""), u;
535
+ return f(""), u;
517
536
  }
518
- function G(e) {
537
+ function Q(e) {
519
538
  return (e?.content || []).join(`
520
539
  `).trim();
521
540
  }
522
- function gt(e) {
541
+ function mt(e) {
523
542
  return /\.(png|jpe?g|gif|webp|svg)$/i.test(e);
524
543
  }
525
- function Q(e) {
544
+ function X(e) {
526
545
  return /\.(html?)$/i.test(e);
527
546
  }
528
- function kt(e) {
529
- const t = G(e);
547
+ function bt(e) {
548
+ const t = Q(e);
530
549
  return /^data:image\//i.test(t) ? t : "";
531
550
  }
532
- function mt(e) {
533
- return gt(e) ? "🖼" : Q(e) ? "🌐" : /\.md$/i.test(e) ? "📝" : /\.(csv|xlsx?)$/i.test(e) ? "📊" : /\.(json|ya?ml|xml)$/i.test(e) ? "🧩" : "📄";
551
+ function ft(e) {
552
+ return mt(e) ? "🖼" : X(e) ? "🌐" : /\.md$/i.test(e) ? "📝" : /\.(csv|xlsx?)$/i.test(e) ? "📊" : /\.(json|ya?ml|xml)$/i.test(e) ? "🧩" : "📄";
534
553
  }
535
554
  return (e, t) => (r(), o("div", {
536
- class: A(["thinking-bar", [
555
+ class: C(["thinking-bar", [
537
556
  { "thinking-bar--embedded": v.embedded },
538
- { "thinking-bar--open": X.value },
557
+ { "thinking-bar--open": et.value },
539
558
  { "thinking-bar--centered": v.centered },
540
559
  { "thinking-bar--corner": !v.centered && !v.embedded },
541
- { "thinking-bar--memory-result": C.value }
560
+ { "thinking-bar--memory-result": D.value }
542
561
  ]])
543
562
  }, [
544
- t[29] || (t[29] = s("div", {
563
+ t[27] || (t[27] = s("div", {
545
564
  class: "thinking-bar-grid",
546
565
  "aria-hidden": "true"
547
566
  }, null, -1)),
548
- s("div", Yt, [
549
- s("div", Zt, [
567
+ s("div", ee, [
568
+ s("div", ne, [
550
569
  t[3] || (t[3] = s("span", { class: "thinking-bar-kicker" }, "Spotlight", -1)),
551
- s("span", te, a(At.value), 1),
552
- tt.value && !C.value ? (r(), o("span", ee, a(tt.value), 1)) : c("", !0),
553
- v.memoryDecision?.canForceRefresh && !C.value ? (r(), o("button", {
570
+ s("span", ie, a(At.value), 1),
571
+ st.value && !D.value ? (r(), o("span", se, a(st.value), 1)) : c("", !0),
572
+ v.memoryDecision?.canForceRefresh && !D.value ? (r(), o("button", {
554
573
  key: 1,
555
574
  type: "button",
556
575
  class: "thinking-bar-memory-refresh",
557
576
  onClick: t[0] || (t[0] = (i) => e.$emit("force-refresh"))
558
577
  }, " 重新查询 ")) : c("", !0)
559
578
  ]),
560
- C.value ? c("", !0) : (r(), o("div", ne, [
561
- s("span", ie, [
579
+ D.value ? c("", !0) : (r(), o("div", re, [
580
+ s("span", oe, [
562
581
  s("strong", null, a(v.steps.length), 1),
563
582
  t[4] || (t[4] = s("em", null, "阶段", -1))
564
583
  ]),
565
- s("span", se, [
584
+ s("span", le, [
566
585
  s("strong", null, a(Et.value), 1),
567
586
  t[5] || (t[5] = s("em", null, "运行", -1))
568
587
  ]),
569
- s("span", re, [
570
- s("strong", null, a(Mt.value), 1),
588
+ s("span", ae, [
589
+ s("strong", null, a(Ht.value), 1),
571
590
  t[6] || (t[6] = s("em", null, "完成", -1))
572
591
  ])
573
592
  ])),
@@ -578,28 +597,28 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
578
597
  onClick: t[1] || (t[1] = (i) => e.$emit("close"))
579
598
  }, " × ")
580
599
  ]),
581
- C.value ? (r(), o("main", oe, [
582
- s("div", le, [
600
+ D.value ? (r(), o("main", ce, [
601
+ s("div", ue, [
583
602
  t[8] || (t[8] = s("span", {
584
603
  class: "thinking-bar-memory-result-icon",
585
604
  "aria-hidden": "true"
586
605
  }, "✓", -1)),
587
- s("div", ae, [
606
+ s("div", de, [
588
607
  t[7] || (t[7] = s("span", { class: "thinking-bar-memory-result-eyebrow" }, "来自项目记忆", -1)),
589
- s("strong", null, a(Ft.value), 1),
590
- s("p", null, a(Dt.value), 1)
608
+ s("strong", null, a(Dt.value), 1),
609
+ s("p", null, a(Ft.value), 1)
591
610
  ])
592
611
  ]),
593
- s("section", ce, [
612
+ s("section", he, [
594
613
  t[9] || (t[9] = s("div", { class: "thinking-bar-memory-result-answer-label" }, "回答", -1)),
595
- s("div", ue, [
596
- L(vt, {
614
+ s("div", ge, [
615
+ I(wt, {
597
616
  "model-value": Bt.value,
598
617
  "format-knowledge": ""
599
618
  }, null, 8, ["model-value"])
600
619
  ])
601
620
  ]),
602
- s("footer", de, [
621
+ s("footer", ke, [
603
622
  t[10] || (t[10] = s("span", null, "本次直接复用已验证答案,未重新查询数据源。", -1)),
604
623
  v.memoryDecision?.canForceRefresh ? (r(), o("button", {
605
624
  key: 0,
@@ -611,226 +630,228 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
611
630
  ])) : (r(), o("div", {
612
631
  key: 1,
613
632
  ref_key: "stepsContainerRef",
614
- ref: P,
633
+ ref: V,
615
634
  class: "thinking-bar-steps"
616
635
  }, [
617
- (r(!0), o(h, null, f(v.steps, (i) => (r(), o("div", {
636
+ (r(!0), o(h, null, b(v.steps, (i) => (r(), o("div", {
618
637
  key: i.id,
619
- class: A(["thinking-bar-step", [i.status]])
638
+ class: C(["thinking-bar-step", [i.status]])
620
639
  }, [
621
- s("div", he, [
640
+ s("div", me, [
622
641
  s("span", {
623
- class: A(["thinking-bar-step-status", `is-${i.status}`]),
642
+ class: C(["thinking-bar-step-status", `is-${i.status}`]),
624
643
  "aria-hidden": "true"
625
644
  }, null, 2),
626
- s("div", ge, [
627
- s("span", ke, a(i.label), 1),
645
+ s("div", be, [
646
+ s("span", fe, a(i.label), 1),
628
647
  s("div", {
629
648
  ref_for: !0,
630
649
  ref: (n) => $t(i.id, n),
631
650
  class: "thinking-bar-step-body",
632
651
  onScrollPassive: (n) => xt(i.id, n)
633
652
  }, [
634
- j(_t)(i.id) ? (r(), o("div", be, [
635
- Ot(i) ? (r(), o("details", fe, [
636
- s("summary", pe, [
637
- t[11] || (t[11] = s("span", { class: "thinking-bar-execution-details-title" }, "调用工具", -1)),
638
- s("span", ye, a(jt(i)), 1),
639
- t[12] || (t[12] = s("span", { class: "thinking-bar-execution-details-caret" }, "▾", -1))
653
+ B(Z)(i.id) ? (r(), o("div", pe, [
654
+ x(i) ? (r(), o("div", ve, [
655
+ x(i)?.headline ? (r(), o("p", _e, a(x(i)?.headline), 1)) : c("", !0),
656
+ x(i)?.items.length ? (r(), o("ol", we, [
657
+ (r(!0), o(h, null, b(x(i)?.items, (n, l) => (r(), o("li", {
658
+ key: `${i.id}-source-${l}`
659
+ }, a(n), 1))), 128))
660
+ ])) : c("", !0),
661
+ x(i)?.note ? (r(), o("p", Te, a(x(i)?.note), 1)) : c("", !0)
662
+ ])) : c("", !0),
663
+ jt(i) ? (r(), o("details", Se, [
664
+ s("summary", $e, [
665
+ s("span", xe, a(i.label === "操作页面" ? "页面操作" : "本次检索"), 1),
666
+ s("span", Re, a(Nt(i)), 1),
667
+ t[11] || (t[11] = s("span", { class: "thinking-bar-execution-details-caret" }, "▾", -1))
640
668
  ]),
641
- s("div", ve, [
642
- K(i) ? (r(), o("pre", _e, a(K(i)), 1)) : c("", !0),
643
- (r(!0), o(h, null, f(q(i), (n) => (r(), o("details", {
669
+ s("div", Ae, [
670
+ G(i) ? (r(), o("pre", Ce, a(G(i)), 1)) : c("", !0),
671
+ (r(!0), o(h, null, b(U(i), (n) => (r(), o("details", {
644
672
  key: n.id,
645
- class: "thinking-bar-tool-call",
646
- open: lt(n)
673
+ class: "thinking-bar-tool-call"
647
674
  }, [
648
- s("summary", Te, [
649
- s("div", Se, [
650
- s("span", $e, a(N(n)), 1),
651
- n.name !== N(n) ? (r(), o("span", xe, a(n.name), 1)) : c("", !0)
675
+ s("summary", Be, [
676
+ s("div", De, [
677
+ s("span", Fe, a(O(n)), 1),
678
+ n.name !== O(n) ? (r(), o("span", Ee, a(n.name), 1)) : c("", !0)
652
679
  ]),
653
- s("div", Re, [
680
+ s("div", He, [
654
681
  s("span", {
655
- class: A(["thinking-bar-tool-call-status", `is-${n.status}`])
656
- }, a(rt(n.status)), 3),
657
- t[13] || (t[13] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
682
+ class: C(["thinking-bar-tool-call-status", `is-${n.status}`])
683
+ }, a(at(n.status)), 3),
684
+ t[12] || (t[12] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
658
685
  ])
659
686
  ]),
660
- s("div", Ae, [
661
- n.argsText?.trim() ? (r(), o("div", Ce, [
662
- t[14] || (t[14] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
663
- s("pre", Be, a(n.argsText), 1)
687
+ s("div", Me, [
688
+ n.argsText?.trim() ? (r(), o("div", ze, [
689
+ t[13] || (t[13] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
690
+ s("pre", Pe, a(n.argsText), 1)
664
691
  ])) : c("", !0),
665
- n.summary?.trim() ? (r(), o("div", Fe, [
666
- t[15] || (t[15] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行摘要 ", -1)),
667
- s("pre", De, a(n.summary), 1)
692
+ n.summary?.trim() ? (r(), o("div", je, [
693
+ t[14] || (t[14] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行摘要 ", -1)),
694
+ s("pre", Ne, a(B(Wt)(n.summary)), 1)
668
695
  ])) : c("", !0),
669
- ut(n) ? (r(), o("div", Ee, [
670
- t[16] || (t[16] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
671
- E(n) ? (r(), o("div", Me, [
696
+ ht(n) ? (r(), o("div", Oe, [
697
+ t[15] || (t[15] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
698
+ M(n) ? (r(), o("div", Le, [
672
699
  s("img", {
673
700
  class: "thinking-bar-tool-result-image",
674
- src: E(n) || "",
701
+ src: M(n) || "",
675
702
  alt: n.name
676
- }, null, 8, ze)
677
- ])) : M(n) ? (r(), o("iframe", {
703
+ }, null, 8, Ie)
704
+ ])) : z(n) ? (r(), o("iframe", {
678
705
  key: 1,
679
706
  class: "thinking-bar-tool-result-html",
680
- srcdoc: M(n) || "",
707
+ srcdoc: z(n) || "",
681
708
  title: n.name,
682
709
  sandbox: ""
683
- }, null, 8, He)) : _(n) ? (r(), o("div", Oe, [
684
- s("table", je, [
710
+ }, null, 8, Ke)) : _(n) ? (r(), o("div", Ve, [
711
+ s("table", qe, [
685
712
  s("thead", null, [
686
713
  s("tr", null, [
687
- (r(!0), o(h, null, f(_(
714
+ (r(!0), o(h, null, b(_(
688
715
  n
689
716
  )?.columns, (l) => (r(), o("th", { key: l }, a(l), 1))), 128))
690
717
  ])
691
718
  ]),
692
719
  s("tbody", null, [
693
- (r(!0), o(h, null, f(_(n)?.rows, (l, u) => (r(), o("tr", {
720
+ (r(!0), o(h, null, b(_(n)?.rows, (l, u) => (r(), o("tr", {
694
721
  key: `${n.id}-${u}`
695
722
  }, [
696
- (r(!0), o(h, null, f(_(
723
+ (r(!0), o(h, null, b(_(
697
724
  n
698
- )?.columns, (b) => (r(), o("td", {
699
- key: `${n.id}-${u}-${b}`
700
- }, a(dt(l[b])), 1))), 128))
725
+ )?.columns, (f) => (r(), o("td", {
726
+ key: `${n.id}-${u}-${f}`
727
+ }, a(gt(l[f])), 1))), 128))
701
728
  ]))), 128))
702
729
  ])
703
730
  ])
704
- ])) : x(n) ? (r(), o("pre", Ne, a(x(n)), 1)) : c("", !0)
731
+ ])) : R(n) ? (r(), o("pre", Ge, a(R(n)), 1)) : c("", !0)
705
732
  ])) : c("", !0),
706
- ot(n.trace) ? (r(), o("div", Le, [
707
- t[17] || (t[17] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行轨迹 ", -1)),
708
- s("pre", Pe, a(ot(n.trace)), 1)
733
+ ct(n.trace) ? (r(), o("div", Ue, [
734
+ t[16] || (t[16] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行轨迹 ", -1)),
735
+ s("pre", Je, a(ct(n.trace)), 1)
709
736
  ])) : c("", !0),
710
- n.errorCode ? (r(), o("div", Ie, [
711
- t[18] || (t[18] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 错误码 ", -1)),
712
- s("pre", Ke, a(n.errorCode), 1)
737
+ n.errorCode ? (r(), o("div", We, [
738
+ t[17] || (t[17] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 错误码 ", -1)),
739
+ s("pre", Ye, a(n.errorCode), 1)
713
740
  ])) : c("", !0),
714
- Ht(n) && st(i).length > 0 ? (r(), o("div", Ve, [
715
- t[22] || (t[22] = s("div", { class: "thinking-bar-nested-tools-label" }, " 知识库内部步骤 ", -1)),
716
- (r(!0), o(h, null, f(st(
741
+ Pt(n) && lt(i).length > 0 ? (r(), o("div", Qe, [
742
+ t[21] || (t[21] = s("div", { class: "thinking-bar-nested-tools-label" }, " 知识库内部步骤 ", -1)),
743
+ (r(!0), o(h, null, b(lt(
717
744
  i
718
745
  ), (l) => (r(), o("details", {
719
746
  key: l.id,
720
747
  class: "thinking-bar-tool-call thinking-bar-tool-call--nested"
721
748
  }, [
722
- s("summary", qe, [
723
- s("div", Ue, [
724
- s("span", Je, a(N(l)), 1)
749
+ s("summary", Xe, [
750
+ s("div", Ze, [
751
+ s("span", tn, a(O(l)), 1)
725
752
  ]),
726
- s("div", We, [
753
+ s("div", en, [
727
754
  s("span", {
728
- class: A(["thinking-bar-tool-call-status", `is-${l.status}`])
729
- }, a(rt(l.status)), 3),
730
- t[19] || (t[19] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
755
+ class: C(["thinking-bar-tool-call-status", `is-${l.status}`])
756
+ }, a(at(l.status)), 3),
757
+ t[18] || (t[18] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
731
758
  ])
732
759
  ]),
733
- s("div", Ge, [
734
- l.argsText?.trim() ? (r(), o("div", Qe, [
735
- t[20] || (t[20] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
736
- s("pre", Xe, a(l.argsText), 1)
760
+ s("div", nn, [
761
+ l.argsText?.trim() ? (r(), o("div", sn, [
762
+ t[19] || (t[19] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
763
+ s("pre", rn, a(l.argsText), 1)
737
764
  ])) : c("", !0),
738
- x(l) ? (r(), o("div", Ye, [
739
- t[21] || (t[21] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
740
- s("pre", Ze, a(x(l)), 1)
765
+ R(l) ? (r(), o("div", on, [
766
+ t[20] || (t[20] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
767
+ s("pre", ln, a(R(l)), 1)
741
768
  ])) : c("", !0)
742
769
  ])
743
770
  ]))), 128))
744
771
  ])) : c("", !0)
745
772
  ])
746
- ], 8, we))), 128))
747
- ])
748
- ])) : c("", !0),
749
- V(i) ? (r(), o("section", tn, [
750
- t[23] || (t[23] = s("div", { class: "thinking-bar-step-section-label" }, "回答", -1)),
751
- s("div", en, [
752
- L(vt, {
753
- "model-value": V(i),
754
- "format-knowledge": ""
755
- }, null, 8, ["model-value"])
773
+ ]))), 128))
756
774
  ])
757
775
  ])) : c("", !0)
758
- ])) : (r(), o(h, { key: 1 }, [
759
- i.chatItems && i.chatItems.length > 0 ? (r(), o("div", nn, [
760
- (r(!0), o(h, null, f(i.chatItems, (n) => (r(), o("div", {
776
+ ])) : B(K)(i.id) ? (r(), o(h, { key: 1 }, [
777
+ i.content ? (r(), o("div", an, [
778
+ I(wt, {
779
+ "model-value": L(i.content),
780
+ "format-knowledge": ""
781
+ }, null, 8, ["model-value"])
782
+ ])) : c("", !0)
783
+ ], 64)) : (r(), o(h, { key: 2 }, [
784
+ i.chatItems && i.chatItems.length > 0 ? (r(), o("div", cn, [
785
+ (r(!0), o(h, null, b(i.chatItems, (n) => (r(), o("div", {
761
786
  key: n.id,
762
787
  class: "thinking-bar-chat-item"
763
788
  }, [
764
- n.type === "text" && n.text.trim() ? (r(), o("div", sn, [
765
- L(j(yt), {
766
- "model-value": j(Wt)(n.text),
789
+ n.type === "text" && n.text.trim() ? (r(), o("div", un, [
790
+ I(B(_t), {
791
+ "model-value": B(Yt)(n.text),
767
792
  theme: "dark",
768
793
  "preview-theme": "github",
769
794
  "code-theme": "github",
770
795
  class: "thinking-bar-md-preview"
771
796
  }, null, 8, ["model-value"])
772
- ])) : n.type === "tool" ? (r(), o("details", {
773
- key: 1,
774
- class: "thinking-bar-tool-call",
775
- open: lt(n.toolCall)
776
- }, [
777
- s("summary", on, [
778
- s("div", ln, [
779
- s("span", an, a(N(n.toolCall)), 1)
797
+ ])) : n.type === "tool" ? (r(), o("details", dn, [
798
+ s("summary", hn, [
799
+ s("div", gn, [
800
+ s("span", kn, a(O(n.toolCall)), 1)
780
801
  ]),
781
- s("div", cn, [
802
+ s("div", mn, [
782
803
  s("span", {
783
- class: A(["thinking-bar-tool-call-status", `is-${n.toolCall.status}`])
804
+ class: C(["thinking-bar-tool-call-status", `is-${n.toolCall.status}`])
784
805
  }, a(n.toolCall.status === "done" ? "已完成" : n.toolCall.status === "error" ? "失败" : n.toolCall.status === "running" ? "执行中" : "待执行"), 3),
785
- t[24] || (t[24] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
806
+ t[22] || (t[22] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
786
807
  ])
787
808
  ]),
788
- s("div", un, [
789
- ut(n.toolCall) ? (r(), o("div", dn, [
790
- t[25] || (t[25] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 结果 ", -1)),
791
- E(n.toolCall) ? (r(), o("div", hn, [
809
+ s("div", bn, [
810
+ ht(n.toolCall) ? (r(), o("div", fn, [
811
+ t[23] || (t[23] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 结果 ", -1)),
812
+ M(n.toolCall) ? (r(), o("div", yn, [
792
813
  s("img", {
793
814
  class: "thinking-bar-tool-result-image",
794
- src: E(n.toolCall) || "",
815
+ src: M(n.toolCall) || "",
795
816
  alt: n.toolCall.name
796
- }, null, 8, gn)
797
- ])) : M(n.toolCall) ? (r(), o("iframe", {
817
+ }, null, 8, pn)
818
+ ])) : z(n.toolCall) ? (r(), o("iframe", {
798
819
  key: 1,
799
820
  class: "thinking-bar-tool-result-html",
800
- srcdoc: M(n.toolCall) || "",
821
+ srcdoc: z(n.toolCall) || "",
801
822
  title: n.toolCall.name,
802
823
  sandbox: ""
803
- }, null, 8, kn)) : _(n.toolCall) ? (r(), o("div", mn, [
804
- s("table", bn, [
824
+ }, null, 8, vn)) : _(n.toolCall) ? (r(), o("div", _n, [
825
+ s("table", wn, [
805
826
  s("thead", null, [
806
827
  s("tr", null, [
807
- (r(!0), o(h, null, f(_(
828
+ (r(!0), o(h, null, b(_(
808
829
  n.toolCall
809
830
  )?.columns, (l) => (r(), o("th", { key: l }, a(l), 1))), 128))
810
831
  ])
811
832
  ]),
812
833
  s("tbody", null, [
813
- (r(!0), o(h, null, f(_(
834
+ (r(!0), o(h, null, b(_(
814
835
  n.toolCall
815
836
  )?.rows, (l, u) => (r(), o("tr", {
816
837
  key: `${n.toolCall.id}-${u}`
817
838
  }, [
818
- (r(!0), o(h, null, f(_(
839
+ (r(!0), o(h, null, b(_(
819
840
  n.toolCall
820
- )?.columns, (b) => (r(), o("td", {
821
- key: `${n.toolCall.id}-${u}-${b}`
822
- }, a(dt(l[b])), 1))), 128))
841
+ )?.columns, (f) => (r(), o("td", {
842
+ key: `${n.toolCall.id}-${u}-${f}`
843
+ }, a(gt(l[f])), 1))), 128))
823
844
  ]))), 128))
824
845
  ])
825
846
  ])
826
- ])) : x(n.toolCall) ? (r(), o("pre", fn, a(x(n.toolCall)), 1)) : c("", !0)
847
+ ])) : R(n.toolCall) ? (r(), o("pre", Tn, a(R(n.toolCall)), 1)) : c("", !0)
827
848
  ])) : c("", !0)
828
849
  ])
829
- ], 8, rn)) : c("", !0)
850
+ ])) : c("", !0)
830
851
  ]))), 128))
831
- ])) : i.content ? (r(), o("div", pn, [
832
- L(j(yt), {
833
- "model-value": j(Gt)(i.content ?? ""),
852
+ ])) : i.content ? (r(), o("div", Sn, [
853
+ I(B(_t), {
854
+ "model-value": B(Qt)(i.content ?? ""),
834
855
  theme: "dark",
835
856
  "preview-theme": "github",
836
857
  "code-theme": "github",
@@ -838,8 +859,8 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
838
859
  }, null, 8, ["model-value"])
839
860
  ])) : c("", !0)
840
861
  ], 64)),
841
- i.attachments && i.attachments.length > 0 ? (r(), o("div", yn, [
842
- (r(!0), o(h, null, f(i.attachments, (n) => (r(), o("a", {
862
+ i.attachments && i.attachments.length > 0 ? (r(), o("div", $n, [
863
+ (r(!0), o(h, null, b(i.attachments, (n) => (r(), o("a", {
843
864
  key: n.id,
844
865
  class: "thinking-bar-attachment",
845
866
  href: n.url,
@@ -851,78 +872,78 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
851
872
  class: "thinking-bar-attachment-image",
852
873
  src: n.url,
853
874
  alt: n.name || "图表预览"
854
- }, null, 8, _n)) : c("", !0),
855
- s("div", wn, [
856
- s("span", Tn, a(n.name || n.url), 1),
857
- s("span", Sn, a(n.type === "image" ? "图片预览" : n.type === "html" ? "打开图表" : "打开文件"), 1)
875
+ }, null, 8, Rn)) : c("", !0),
876
+ s("div", An, [
877
+ s("span", Cn, a(n.name || n.url), 1),
878
+ s("span", Bn, a(n.type === "image" ? "图片预览" : n.type === "html" ? "打开图表" : "打开文件"), 1)
858
879
  ])
859
- ], 8, vn))), 128))
880
+ ], 8, xn))), 128))
860
881
  ])) : c("", !0),
861
- i.files && i.files.length > 0 ? (r(), o("div", $n, [
862
- t[28] || (t[28] = s("div", { class: "thinking-bar-workspace-title" }, "状态工作台", -1)),
863
- s("div", xn, [
864
- s("div", Rn, [
865
- t[27] || (t[27] = s("div", { class: "thinking-bar-file-tree-head" }, "文件系统", -1)),
866
- s("div", An, [
867
- (r(!0), o(h, null, f(Kt(i.id, i.files), (n) => (r(), o(h, {
882
+ i.files && i.files.length > 0 ? (r(), o("div", Dn, [
883
+ t[26] || (t[26] = s("div", { class: "thinking-bar-workspace-title" }, "状态工作台", -1)),
884
+ s("div", Fn, [
885
+ s("div", En, [
886
+ t[25] || (t[25] = s("div", { class: "thinking-bar-file-tree-head" }, "文件系统", -1)),
887
+ s("div", Hn, [
888
+ (r(!0), o(h, null, b(Vt(i.id, i.files), (n) => (r(), o(h, {
868
889
  key: `${i.id}:${n.path}`
869
890
  }, [
870
- n.type === "directory" ? (r(), o("div", Cn, [
891
+ n.type === "directory" ? (r(), o("div", Mn, [
871
892
  s("button", {
872
893
  type: "button",
873
894
  class: "thinking-bar-tree-row thinking-bar-tree-row--directory",
874
- style: pt({
895
+ style: vt({
875
896
  paddingLeft: `${n.depth * 14 + 10}px`
876
897
  }),
877
- onClick: (l) => It(i.id, n.path)
898
+ onClick: (l) => Kt(i.id, n.path)
878
899
  }, [
879
- s("span", Fn, a(ht(i.id, n.path) ? "▾" : "▸"), 1),
880
- t[26] || (t[26] = s("span", { class: "thinking-bar-tree-icon" }, "📁", -1)),
881
- s("span", Dn, a(n.name), 1)
882
- ], 12, Bn)
900
+ s("span", Pn, a(kt(i.id, n.path) ? "▾" : "▸"), 1),
901
+ t[24] || (t[24] = s("span", { class: "thinking-bar-tree-icon" }, "📁", -1)),
902
+ s("span", jn, a(n.name), 1)
903
+ ], 12, zn)
883
904
  ])) : (r(), o("button", {
884
905
  key: 1,
885
906
  type: "button",
886
- class: A(["thinking-bar-tree-row thinking-bar-tree-row--file", {
907
+ class: C(["thinking-bar-tree-row thinking-bar-tree-row--file", {
887
908
  active: k(i)?.id === n.file?.id
888
909
  }]),
889
- style: pt({ paddingLeft: `${n.depth * 14 + 26}px` }),
910
+ style: vt({ paddingLeft: `${n.depth * 14 + 26}px` }),
890
911
  onClick: (l) => Lt(i.id, n.file)
891
912
  }, [
892
- s("span", Mn, a(mt(n.file?.path || "")), 1),
893
- s("span", zn, a(n.name), 1)
894
- ], 14, En))
913
+ s("span", On, a(ft(n.file?.path || "")), 1),
914
+ s("span", Ln, a(n.name), 1)
915
+ ], 14, Nn))
895
916
  ], 64))), 128))
896
917
  ])
897
918
  ]),
898
- s("div", Hn, [
919
+ s("div", In, [
899
920
  k(i) ? (r(), o(h, { key: 0 }, [
900
- s("div", On, [
901
- s("div", jn, [
902
- s("span", Nn, a(mt(k(i)?.path || "")), 1),
921
+ s("div", Kn, [
922
+ s("div", Vn, [
923
+ s("span", qn, a(ft(k(i)?.path || "")), 1),
903
924
  s("span", null, a(k(i)?.path), 1)
904
925
  ]),
905
- Q(k(i)?.path || "") ? (r(), o("span", Ln, " HTML 预览 ")) : c("", !0)
926
+ X(k(i)?.path || "") ? (r(), o("span", Gn, " HTML 预览 ")) : c("", !0)
906
927
  ]),
907
- gt(k(i)?.path || "") ? (r(), o("div", Pn, [
908
- kt(k(i)) ? (r(), o("img", {
928
+ mt(k(i)?.path || "") ? (r(), o("div", Un, [
929
+ bt(k(i)) ? (r(), o("img", {
909
930
  key: 0,
910
931
  class: "thinking-bar-image-preview",
911
- src: kt(k(i)) || "",
932
+ src: bt(k(i)) || "",
912
933
  alt: k(i)?.name || "图片预览"
913
- }, null, 8, In)) : (r(), o("div", Kn, " 当前图片文件没有可直接渲染的内容。 "))
914
- ])) : Q(k(i)?.path || "") ? (r(), o("iframe", {
934
+ }, null, 8, Jn)) : (r(), o("div", Wn, " 当前图片文件没有可直接渲染的内容。 "))
935
+ ])) : X(k(i)?.path || "") ? (r(), o("iframe", {
915
936
  key: 1,
916
937
  class: "thinking-bar-html-preview",
917
- srcdoc: G(k(i)),
938
+ srcdoc: Q(k(i)),
918
939
  title: k(i)?.path,
919
940
  sandbox: ""
920
- }, null, 8, Vn)) : (r(), o("pre", qn, a(G(k(i))), 1))
921
- ], 64)) : (r(), o("div", Un, " 还没选中文件,左边点一个看看。 "))
941
+ }, null, 8, Yn)) : (r(), o("pre", Qn, a(Q(k(i))), 1))
942
+ ], 64)) : (r(), o("div", Xn, " 还没选中文件,左边点一个看看。 "))
922
943
  ])
923
944
  ])
924
945
  ])) : c("", !0)
925
- ], 40, me)
946
+ ], 40, ye)
926
947
  ])
927
948
  ])
928
949
  ], 2))), 128))
@@ -931,5 +952,5 @@ const Yt = { class: "thinking-bar-header" }, Zt = { class: "thinking-bar-title-s
931
952
  }
932
953
  });
933
954
  export {
934
- ti as default
955
+ oi as default
935
956
  };