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