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