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