@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.
- package/dist/assets/spotlight-vue.css +1 -1
- package/dist/components/SpotlightThinking.vue.d.ts.map +1 -1
- package/dist/components/SpotlightThinking.vue.js +2 -2
- package/dist/components/SpotlightThinking2.vue.js +439 -390
- package/dist/store/memoryResultCopy.d.ts +6 -0
- package/dist/store/memoryResultCopy.d.ts.map +1 -0
- package/dist/store/memoryResultCopy.js +12 -0
- package/package.json +3 -3
|
@@ -1,110 +1,116 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { MdPreview as
|
|
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
|
|
5
|
-
import { isToolExecutionStep as
|
|
6
|
-
import { partitionToolCalls as
|
|
7
|
-
import {
|
|
8
|
-
|
|
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
|
-
},
|
|
12
|
+
}, ie = {
|
|
13
|
+
key: 0,
|
|
12
14
|
class: "thinking-bar-metrics",
|
|
13
15
|
"aria-label": "执行状态概览"
|
|
14
|
-
},
|
|
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
|
-
},
|
|
23
|
+
}, pe = {
|
|
18
24
|
key: 0,
|
|
19
25
|
class: "thinking-bar-execution-details"
|
|
20
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
41
|
+
}, ze = {
|
|
36
42
|
key: 0,
|
|
37
43
|
class: "thinking-bar-tool-result-image-shell"
|
|
38
|
-
},
|
|
44
|
+
}, Oe = ["src", "alt"], He = ["srcdoc", "title"], Ne = {
|
|
39
45
|
key: 2,
|
|
40
46
|
class: "thinking-bar-tool-result-table-wrap"
|
|
41
|
-
},
|
|
47
|
+
}, Le = { class: "thinking-bar-tool-result-table" }, je = {
|
|
42
48
|
key: 3,
|
|
43
49
|
class: "thinking-bar-tool-call-pre"
|
|
44
|
-
},
|
|
50
|
+
}, Pe = {
|
|
45
51
|
key: 3,
|
|
46
52
|
class: "thinking-bar-tool-call-block"
|
|
47
|
-
},
|
|
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
|
-
},
|
|
56
|
+
}, qe = { class: "thinking-bar-tool-call-pre" }, Ke = {
|
|
51
57
|
key: 5,
|
|
52
58
|
class: "thinking-bar-nested-tools"
|
|
53
|
-
},
|
|
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
|
-
},
|
|
62
|
+
}, Ye = { class: "thinking-bar-tool-call-pre" }, Ze = {
|
|
57
63
|
key: 1,
|
|
58
64
|
class: "thinking-bar-tool-call-block"
|
|
59
|
-
},
|
|
65
|
+
}, tn = { class: "thinking-bar-tool-call-pre" }, en = {
|
|
60
66
|
key: 1,
|
|
61
67
|
class: "thinking-bar-step-answer-section"
|
|
62
|
-
},
|
|
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
|
-
},
|
|
71
|
+
}, rn = {
|
|
66
72
|
key: 0,
|
|
67
73
|
class: "thinking-bar-step-text thinking-bar-step-markdown"
|
|
68
|
-
},
|
|
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
|
-
},
|
|
77
|
+
}, gn = {
|
|
72
78
|
key: 0,
|
|
73
79
|
class: "thinking-bar-tool-result-image-shell"
|
|
74
|
-
},
|
|
80
|
+
}, kn = ["src", "alt"], mn = ["srcdoc", "title"], bn = {
|
|
75
81
|
key: 2,
|
|
76
82
|
class: "thinking-bar-tool-result-table-wrap"
|
|
77
|
-
},
|
|
83
|
+
}, fn = { class: "thinking-bar-tool-result-table" }, pn = {
|
|
78
84
|
key: 3,
|
|
79
85
|
class: "thinking-bar-tool-call-pre"
|
|
80
|
-
},
|
|
86
|
+
}, yn = {
|
|
81
87
|
key: 1,
|
|
82
88
|
class: "thinking-bar-step-text thinking-bar-step-markdown"
|
|
83
|
-
},
|
|
89
|
+
}, vn = {
|
|
84
90
|
key: 2,
|
|
85
91
|
class: "thinking-bar-attachments"
|
|
86
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
101
|
+
}, In = {
|
|
96
102
|
key: 0,
|
|
97
103
|
class: "thinking-bar-image-shell"
|
|
98
|
-
},
|
|
104
|
+
}, Vn = ["src", "alt"], qn = {
|
|
99
105
|
key: 1,
|
|
100
106
|
class: "thinking-bar-empty-preview"
|
|
101
|
-
},
|
|
107
|
+
}, Kn = ["srcdoc", "title"], Jn = {
|
|
102
108
|
key: 2,
|
|
103
109
|
class: "thinking-bar-file-preview-body"
|
|
104
|
-
},
|
|
110
|
+
}, Un = {
|
|
105
111
|
key: 1,
|
|
106
112
|
class: "thinking-bar-empty-preview"
|
|
107
|
-
},
|
|
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
|
|
119
|
-
let
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
126
|
-
const i =
|
|
127
|
-
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 ? (
|
|
135
|
+
n ? (S.set(e, n), $?.observe(n)) : S.delete(e);
|
|
130
136
|
}
|
|
131
|
-
function
|
|
137
|
+
function Y(e) {
|
|
132
138
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 96;
|
|
133
139
|
}
|
|
134
|
-
function
|
|
140
|
+
function xt(e, t) {
|
|
135
141
|
const i = t.target;
|
|
136
|
-
|
|
137
|
-
...
|
|
138
|
-
[e]:
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
...
|
|
142
|
-
[e]:
|
|
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
|
|
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
|
|
153
|
-
return t ? !0 :
|
|
158
|
+
function Z(e, t) {
|
|
159
|
+
return t ? !0 : w.value[e] !== !1;
|
|
154
160
|
}
|
|
155
|
-
|
|
156
|
-
typeof ResizeObserver < "u" && (
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
169
|
+
X.value = !0;
|
|
164
170
|
}), requestAnimationFrame(() => {
|
|
165
|
-
|
|
171
|
+
I(!0);
|
|
166
172
|
});
|
|
167
|
-
}),
|
|
168
|
-
|
|
173
|
+
}), Wt(() => {
|
|
174
|
+
D != null && window.clearTimeout(D), $?.disconnect(), $ = null, S.clear();
|
|
169
175
|
});
|
|
170
|
-
const d =
|
|
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 缓存" : ""),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
200
|
+
), Mt = y(
|
|
184
201
|
() => d.steps.filter((e) => e.status === "done").length
|
|
185
202
|
);
|
|
186
|
-
function
|
|
203
|
+
function zt(e) {
|
|
187
204
|
return e.name.trim().toLowerCase();
|
|
188
205
|
}
|
|
189
|
-
function
|
|
206
|
+
function L(e) {
|
|
190
207
|
return e.displayName?.trim() || e.name;
|
|
191
208
|
}
|
|
192
|
-
function
|
|
193
|
-
return
|
|
209
|
+
function V(e) {
|
|
210
|
+
return wt(e.content ?? "").planning;
|
|
194
211
|
}
|
|
195
|
-
function
|
|
196
|
-
const { planning: t } =
|
|
197
|
-
|
|
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() ? "" :
|
|
200
|
-
|
|
216
|
+
return i.trim() ? i : t.trim() ? "" : nt(
|
|
217
|
+
Tt(e.content ?? "")
|
|
201
218
|
);
|
|
202
219
|
}
|
|
203
|
-
function
|
|
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
|
|
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
|
|
213
|
-
return
|
|
229
|
+
function K(e) {
|
|
230
|
+
return St(it(e)).visible;
|
|
214
231
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
232
|
+
function st(e) {
|
|
233
|
+
return St(it(e)).nestedKnowledge;
|
|
217
234
|
}
|
|
218
|
-
function
|
|
219
|
-
return
|
|
235
|
+
function Ot(e) {
|
|
236
|
+
return Ht(e.name) === Yt.knowledge.answer;
|
|
220
237
|
}
|
|
221
|
-
function
|
|
238
|
+
function Ht(e) {
|
|
222
239
|
return e.trim().toLowerCase();
|
|
223
240
|
}
|
|
224
|
-
function
|
|
225
|
-
return !!(
|
|
241
|
+
function Nt(e) {
|
|
242
|
+
return !!(V(e).trim() || K(e).length > 0);
|
|
226
243
|
}
|
|
227
|
-
function
|
|
228
|
-
const t =
|
|
244
|
+
function Lt(e) {
|
|
245
|
+
const t = K(e).length;
|
|
229
246
|
return t > 0 ? `${t} 个工具调用` : "规划记录";
|
|
230
247
|
}
|
|
231
|
-
function
|
|
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
|
|
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
|
|
266
|
+
function lt(e) {
|
|
250
267
|
return e.status === "running" || e.status === "pending";
|
|
251
268
|
}
|
|
252
|
-
function
|
|
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 =
|
|
278
|
+
const t = zt(e), i = e.resultText?.trim() || "";
|
|
262
279
|
if (!i) return "";
|
|
263
280
|
if (t === "list_kbs") {
|
|
264
|
-
const n =
|
|
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 =
|
|
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
|
|
290
|
+
function U(e) {
|
|
274
291
|
const t = e.resultText?.trim() || "";
|
|
275
|
-
return t ?
|
|
292
|
+
return t ? J(t) ?? t : null;
|
|
276
293
|
}
|
|
277
|
-
function
|
|
294
|
+
function F(e) {
|
|
278
295
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
279
296
|
}
|
|
280
|
-
function
|
|
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 =
|
|
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 (
|
|
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
|
|
298
|
-
const t =
|
|
299
|
-
if (typeof t == "string" &&
|
|
314
|
+
function M(e) {
|
|
315
|
+
const t = U(e);
|
|
316
|
+
if (typeof t == "string" && at(t.trim()))
|
|
300
317
|
return t;
|
|
301
|
-
if (
|
|
318
|
+
if (F(t)) {
|
|
302
319
|
const i = [t.html, t.content, t.markup].find(
|
|
303
|
-
(n) => typeof n == "string" &&
|
|
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
|
|
310
|
-
return !Array.isArray(e) || e.length === 0 || !e.every((t) =>
|
|
326
|
+
function ct(e) {
|
|
327
|
+
return !Array.isArray(e) || e.length === 0 || !e.every((t) => F(t)) ? null : e;
|
|
311
328
|
}
|
|
312
|
-
function
|
|
313
|
-
const t =
|
|
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 =
|
|
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 (!
|
|
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
|
-
(
|
|
328
|
-
n.map((
|
|
329
|
-
) : { value:
|
|
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 =
|
|
351
|
+
const n = ct(t.data);
|
|
335
352
|
if (n) {
|
|
336
353
|
const l = [
|
|
337
|
-
...new Set(n.flatMap((
|
|
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
|
|
361
|
+
function ut(e) {
|
|
345
362
|
const t = x(e), i = e.summary?.trim();
|
|
346
|
-
return t && i && t.trim() === i ? !1 : !!(E(e) ||
|
|
363
|
+
return t && i && t.trim() === i ? !1 : !!(E(e) || M(e) || _(e) || t);
|
|
347
364
|
}
|
|
348
|
-
function
|
|
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
|
|
360
|
-
await
|
|
361
|
-
const t =
|
|
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 =
|
|
383
|
+
const i = Rt();
|
|
367
384
|
for (const n of i) {
|
|
368
|
-
const l =
|
|
369
|
-
!l || !
|
|
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 =
|
|
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
|
|
382
|
-
!
|
|
383
|
-
top:
|
|
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
|
-
|
|
406
|
+
ft(
|
|
390
407
|
() => d.steps,
|
|
391
408
|
() => {
|
|
392
|
-
if (
|
|
409
|
+
if (Ct.value) {
|
|
393
410
|
const e = d.steps.find((t) => t.status === "active");
|
|
394
|
-
e && !(e.id in
|
|
395
|
-
...
|
|
411
|
+
e && !(e.id in w.value) && (w.value = {
|
|
412
|
+
...w.value,
|
|
396
413
|
[e.id]: !0
|
|
397
|
-
}),
|
|
414
|
+
}), I(!1);
|
|
398
415
|
return;
|
|
399
416
|
}
|
|
400
|
-
|
|
417
|
+
I(!1);
|
|
401
418
|
},
|
|
402
419
|
{ deep: !0 }
|
|
403
420
|
);
|
|
404
|
-
const
|
|
405
|
-
|
|
421
|
+
const z = H({}), B = H({});
|
|
422
|
+
ft(
|
|
406
423
|
() => d.steps,
|
|
407
424
|
(e) => {
|
|
408
|
-
const t = { ...
|
|
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
|
|
413
|
-
|
|
414
|
-
(
|
|
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
|
-
|
|
437
|
+
z.value = t, B.value = i;
|
|
421
438
|
},
|
|
422
439
|
{ deep: !0, immediate: !0 }
|
|
423
440
|
);
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
...
|
|
441
|
+
function jt(e, t) {
|
|
442
|
+
z.value = {
|
|
443
|
+
...z.value,
|
|
427
444
|
[e]: t
|
|
428
445
|
};
|
|
429
446
|
}
|
|
430
|
-
function
|
|
431
|
-
t &&
|
|
447
|
+
function Pt(e, t) {
|
|
448
|
+
t && jt(e, t.id);
|
|
432
449
|
}
|
|
433
450
|
function k(e) {
|
|
434
|
-
const t =
|
|
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
|
|
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
|
|
445
|
-
return (
|
|
461
|
+
function ht(e, t) {
|
|
462
|
+
return (B.value[e] || []).includes(t);
|
|
446
463
|
}
|
|
447
|
-
function
|
|
448
|
-
const i = new Set(
|
|
449
|
-
i.has(t) ? i.delete(t) : i.add(t),
|
|
450
|
-
...
|
|
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
|
|
455
|
-
const i = /* @__PURE__ */ new Map(), n = (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:
|
|
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
|
|
464
|
-
let
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
}),
|
|
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
|
|
472
|
-
const
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
(
|
|
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
|
|
478
|
-
const g = i.get(
|
|
479
|
-
g && (
|
|
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
|
-
}),
|
|
502
|
+
}), ht(e, g.path) && b(g.path));
|
|
486
503
|
}
|
|
487
|
-
[
|
|
488
|
-
(
|
|
489
|
-
).forEach((
|
|
504
|
+
[...R.files].sort(
|
|
505
|
+
(m, g) => m.path.localeCompare(g.path, "zh-CN")
|
|
506
|
+
).forEach((m) => {
|
|
490
507
|
const g = Math.max(
|
|
491
|
-
|
|
508
|
+
m.path.split("/").filter(Boolean).length - 1,
|
|
492
509
|
0
|
|
493
510
|
);
|
|
494
|
-
|
|
511
|
+
u.push({
|
|
495
512
|
type: "file",
|
|
496
|
-
path:
|
|
497
|
-
name:
|
|
513
|
+
path: m.path,
|
|
514
|
+
name: m.name,
|
|
498
515
|
depth: g,
|
|
499
|
-
file:
|
|
516
|
+
file: m
|
|
500
517
|
});
|
|
501
518
|
});
|
|
502
519
|
};
|
|
503
|
-
return
|
|
520
|
+
return b(""), u;
|
|
504
521
|
}
|
|
505
|
-
function
|
|
522
|
+
function G(e) {
|
|
506
523
|
return (e?.content || []).join(`
|
|
507
524
|
`).trim();
|
|
508
525
|
}
|
|
509
|
-
function
|
|
526
|
+
function gt(e) {
|
|
510
527
|
return /\.(png|jpe?g|gif|webp|svg)$/i.test(e);
|
|
511
528
|
}
|
|
512
|
-
function
|
|
529
|
+
function Q(e) {
|
|
513
530
|
return /\.(html?)$/i.test(e);
|
|
514
531
|
}
|
|
515
|
-
function
|
|
516
|
-
const t =
|
|
532
|
+
function kt(e) {
|
|
533
|
+
const t = G(e);
|
|
517
534
|
return /^data:image\//i.test(t) ? t : "";
|
|
518
535
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
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":
|
|
525
|
-
{ "thinking-bar--open":
|
|
526
|
-
{ "thinking-bar--centered":
|
|
527
|
-
{ "thinking-bar--corner": !
|
|
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[
|
|
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",
|
|
535
|
-
s("div",
|
|
536
|
-
t[
|
|
537
|
-
s("span",
|
|
538
|
-
|
|
539
|
-
|
|
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
|
-
}, " 重新查询 ")) :
|
|
562
|
+
}, " 重新查询 ")) : c("", !0)
|
|
545
563
|
]),
|
|
546
|
-
|
|
547
|
-
s("span",
|
|
548
|
-
s("strong", null, a(
|
|
549
|
-
t[
|
|
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",
|
|
552
|
-
s("strong", null, a(
|
|
553
|
-
t[
|
|
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",
|
|
556
|
-
s("strong", null, a(
|
|
557
|
-
t[
|
|
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
|
-
|
|
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:
|
|
618
|
+
ref: P,
|
|
570
619
|
class: "thinking-bar-steps"
|
|
571
620
|
}, [
|
|
572
|
-
(r(!0), o(h, null,
|
|
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",
|
|
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",
|
|
582
|
-
s("span",
|
|
630
|
+
s("div", ke, [
|
|
631
|
+
s("span", me, a(i.label), 1),
|
|
583
632
|
s("div", {
|
|
584
633
|
ref_for: !0,
|
|
585
|
-
ref: (n) =>
|
|
634
|
+
ref: (n) => $t(i.id, n),
|
|
586
635
|
class: "thinking-bar-step-body",
|
|
587
|
-
onScrollPassive: (n) =>
|
|
636
|
+
onScrollPassive: (n) => xt(i.id, n)
|
|
588
637
|
}, [
|
|
589
|
-
N(
|
|
590
|
-
|
|
591
|
-
s("summary",
|
|
592
|
-
t[
|
|
593
|
-
s("span",
|
|
594
|
-
t[
|
|
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",
|
|
597
|
-
|
|
598
|
-
(r(!0), o(h, null,
|
|
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:
|
|
650
|
+
open: lt(n)
|
|
602
651
|
}, [
|
|
603
|
-
s("summary",
|
|
604
|
-
s("div",
|
|
605
|
-
s("span",
|
|
606
|
-
n.name !==
|
|
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",
|
|
657
|
+
s("div", Ae, [
|
|
609
658
|
s("span", {
|
|
610
659
|
class: A(["thinking-bar-tool-call-status", `is-${n.status}`])
|
|
611
|
-
}, a(
|
|
612
|
-
t[
|
|
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",
|
|
616
|
-
n.argsText?.trim() ? (r(), o("div",
|
|
617
|
-
t[
|
|
618
|
-
s("pre",
|
|
619
|
-
])) :
|
|
620
|
-
n.summary?.trim() ? (r(), o("div",
|
|
621
|
-
t[
|
|
622
|
-
s("pre",
|
|
623
|
-
])) :
|
|
624
|
-
|
|
625
|
-
t[
|
|
626
|
-
E(n) ? (r(), o("div",
|
|
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,
|
|
632
|
-
])) :
|
|
680
|
+
}, null, 8, Oe)
|
|
681
|
+
])) : M(n) ? (r(), o("iframe", {
|
|
633
682
|
key: 1,
|
|
634
683
|
class: "thinking-bar-tool-result-html",
|
|
635
|
-
srcdoc:
|
|
684
|
+
srcdoc: M(n) || "",
|
|
636
685
|
title: n.name,
|
|
637
686
|
sandbox: ""
|
|
638
|
-
}, null, 8,
|
|
639
|
-
s("table",
|
|
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,
|
|
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,
|
|
649
|
-
key: `${n.id}-${
|
|
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,
|
|
700
|
+
(r(!0), o(h, null, f(_(
|
|
652
701
|
n
|
|
653
|
-
)?.columns, (
|
|
654
|
-
key: `${n.id}-${
|
|
655
|
-
}, a(
|
|
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",
|
|
660
|
-
])) :
|
|
661
|
-
|
|
662
|
-
t[
|
|
663
|
-
s("pre",
|
|
664
|
-
])) :
|
|
665
|
-
n.errorCode ? (r(), o("div",
|
|
666
|
-
t[
|
|
667
|
-
s("pre",
|
|
668
|
-
])) :
|
|
669
|
-
|
|
670
|
-
t[
|
|
671
|
-
(r(!0), o(h, null,
|
|
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",
|
|
678
|
-
s("div",
|
|
679
|
-
s("span",
|
|
726
|
+
s("summary", Je, [
|
|
727
|
+
s("div", Ue, [
|
|
728
|
+
s("span", We, a(L(l)), 1)
|
|
680
729
|
]),
|
|
681
|
-
s("div",
|
|
730
|
+
s("div", Ge, [
|
|
682
731
|
s("span", {
|
|
683
732
|
class: A(["thinking-bar-tool-call-status", `is-${l.status}`])
|
|
684
|
-
}, a(
|
|
685
|
-
t[
|
|
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",
|
|
689
|
-
l.argsText?.trim() ? (r(), o("div",
|
|
690
|
-
t[
|
|
691
|
-
s("pre",
|
|
692
|
-
])) :
|
|
693
|
-
x(l) ? (r(), o("div",
|
|
694
|
-
t[
|
|
695
|
-
s("pre",
|
|
696
|
-
])) :
|
|
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
|
-
])) :
|
|
748
|
+
])) : c("", !0)
|
|
700
749
|
])
|
|
701
|
-
], 8,
|
|
750
|
+
], 8, Te))), 128))
|
|
702
751
|
])
|
|
703
|
-
])) :
|
|
704
|
-
|
|
705
|
-
t[
|
|
706
|
-
s("div",
|
|
707
|
-
|
|
708
|
-
"model-value":
|
|
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
|
-
])) :
|
|
761
|
+
])) : c("", !0)
|
|
713
762
|
])) : (r(), o(h, { key: 1 }, [
|
|
714
|
-
i.chatItems && i.chatItems.length > 0 ? (r(), o("div",
|
|
715
|
-
(r(!0), o(h, null,
|
|
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",
|
|
720
|
-
|
|
721
|
-
"model-value": N(
|
|
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:
|
|
779
|
+
open: lt(n.toolCall)
|
|
731
780
|
}, [
|
|
732
|
-
s("summary",
|
|
733
|
-
s("div",
|
|
734
|
-
s("span",
|
|
781
|
+
s("summary", ln, [
|
|
782
|
+
s("div", an, [
|
|
783
|
+
s("span", cn, a(L(n.toolCall)), 1)
|
|
735
784
|
]),
|
|
736
|
-
s("div",
|
|
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[
|
|
789
|
+
t[24] || (t[24] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
|
|
741
790
|
])
|
|
742
791
|
]),
|
|
743
|
-
s("div",
|
|
744
|
-
|
|
745
|
-
t[
|
|
746
|
-
E(n.toolCall) ? (r(), o("div",
|
|
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,
|
|
752
|
-
])) :
|
|
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:
|
|
804
|
+
srcdoc: M(n.toolCall) || "",
|
|
756
805
|
title: n.toolCall.name,
|
|
757
806
|
sandbox: ""
|
|
758
|
-
}, null, 8,
|
|
759
|
-
s("table",
|
|
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,
|
|
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,
|
|
817
|
+
(r(!0), o(h, null, f(_(
|
|
769
818
|
n.toolCall
|
|
770
|
-
)?.rows, (l,
|
|
771
|
-
key: `${n.toolCall.id}-${
|
|
819
|
+
)?.rows, (l, u) => (r(), o("tr", {
|
|
820
|
+
key: `${n.toolCall.id}-${u}`
|
|
772
821
|
}, [
|
|
773
|
-
(r(!0), o(h, null,
|
|
822
|
+
(r(!0), o(h, null, f(_(
|
|
774
823
|
n.toolCall
|
|
775
|
-
)?.columns, (
|
|
776
|
-
key: `${n.toolCall.id}-${
|
|
777
|
-
}, a(
|
|
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",
|
|
782
|
-
])) :
|
|
830
|
+
])) : x(n.toolCall) ? (r(), o("pre", pn, a(x(n.toolCall)), 1)) : c("", !0)
|
|
831
|
+
])) : c("", !0)
|
|
783
832
|
])
|
|
784
|
-
], 8,
|
|
833
|
+
], 8, on)) : c("", !0)
|
|
785
834
|
]))), 128))
|
|
786
|
-
])) : i.content ? (r(), o("div",
|
|
787
|
-
|
|
788
|
-
"model-value": N(
|
|
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
|
-
])) :
|
|
843
|
+
])) : c("", !0)
|
|
795
844
|
], 64)),
|
|
796
|
-
i.attachments && i.attachments.length > 0 ? (r(), o("div",
|
|
797
|
-
(r(!0), o(h, null,
|
|
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,
|
|
810
|
-
s("div",
|
|
811
|
-
s("span",
|
|
812
|
-
s("span",
|
|
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,
|
|
815
|
-
])) :
|
|
816
|
-
i.files && i.files.length > 0 ? (r(), o("div",
|
|
817
|
-
t[
|
|
818
|
-
s("div",
|
|
819
|
-
s("div",
|
|
820
|
-
t[
|
|
821
|
-
s("div",
|
|
822
|
-
(r(!0), o(h, null,
|
|
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",
|
|
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:
|
|
878
|
+
style: pt({
|
|
830
879
|
paddingLeft: `${n.depth * 14 + 10}px`
|
|
831
880
|
}),
|
|
832
|
-
onClick: (l) =>
|
|
881
|
+
onClick: (l) => Vt(i.id, n.path)
|
|
833
882
|
}, [
|
|
834
|
-
s("span",
|
|
835
|
-
t[
|
|
836
|
-
s("span",
|
|
837
|
-
], 12,
|
|
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:
|
|
845
|
-
onClick: (l) =>
|
|
893
|
+
style: pt({ paddingLeft: `${n.depth * 14 + 26}px` }),
|
|
894
|
+
onClick: (l) => Pt(i.id, n.file)
|
|
846
895
|
}, [
|
|
847
|
-
s("span",
|
|
848
|
-
s("span",
|
|
849
|
-
], 14,
|
|
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",
|
|
902
|
+
s("div", Hn, [
|
|
854
903
|
k(i) ? (r(), o(h, { key: 0 }, [
|
|
855
|
-
s("div",
|
|
856
|
-
s("div",
|
|
857
|
-
s("span",
|
|
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
|
-
|
|
909
|
+
Q(k(i)?.path || "") ? (r(), o("span", Pn, " HTML 预览 ")) : c("", !0)
|
|
861
910
|
]),
|
|
862
|
-
|
|
863
|
-
|
|
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:
|
|
915
|
+
src: kt(k(i)) || "",
|
|
867
916
|
alt: k(i)?.name || "图片预览"
|
|
868
|
-
}, null, 8,
|
|
869
|
-
])) :
|
|
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:
|
|
921
|
+
srcdoc: G(k(i)),
|
|
873
922
|
title: k(i)?.path,
|
|
874
923
|
sandbox: ""
|
|
875
|
-
}, null, 8,
|
|
876
|
-
], 64)) : (r(), o("div",
|
|
924
|
+
}, null, 8, Kn)) : (r(), o("pre", Jn, a(G(k(i))), 1))
|
|
925
|
+
], 64)) : (r(), o("div", Un, " 还没选中文件,左边点一个看看。 "))
|
|
877
926
|
])
|
|
878
927
|
])
|
|
879
|
-
])) :
|
|
880
|
-
], 40,
|
|
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
|
-
|
|
938
|
+
ni as default
|
|
890
939
|
};
|