@inupedia/spotlight-vue 0.5.18 → 0.6.0
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 +124 -128
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -38
- package/dist/remote/runPipeline.d.ts +10 -1
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +210 -161
- package/dist/store/pipeline/displayText.d.ts +5 -0
- package/dist/store/pipeline/displayText.d.ts.map +1 -1
- package/dist/store/pipeline/displayText.js +38 -25
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
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
2
|
import { MdPreview as _t } from "md-editor-v3";
|
|
3
3
|
import "md-editor-v3/lib/preview.css";
|
|
4
4
|
import wt from "./SpotlightMarkdownPreview.vue.js";
|
|
5
|
-
import { isAnswerStep as
|
|
6
|
-
import { partitionToolCalls as
|
|
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
7
|
import { getSpotlightMemoryResultCopy as te } from "../store/memoryResultCopy.js";
|
|
8
8
|
const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-stack" }, ie = { class: "thinking-bar-title" }, se = {
|
|
9
9
|
key: 0,
|
|
@@ -31,16 +31,16 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
31
31
|
}, Te = {
|
|
32
32
|
key: 2,
|
|
33
33
|
class: "thinking-bar-gather-note"
|
|
34
|
-
},
|
|
34
|
+
}, $e = {
|
|
35
35
|
key: 1,
|
|
36
36
|
class: "thinking-bar-execution-details"
|
|
37
|
-
},
|
|
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 = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "thinking-bar-execution-planning"
|
|
40
40
|
}, Be = { class: "thinking-bar-tool-call-head" }, De = { class: "thinking-bar-tool-call-head-main" }, Fe = { class: "thinking-bar-tool-call-name" }, Ee = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "thinking-bar-tool-call-id"
|
|
43
|
-
},
|
|
43
|
+
}, Me = { class: "thinking-bar-tool-call-head-side" }, ze = { class: "thinking-bar-tool-call-body" }, He = {
|
|
44
44
|
key: 0,
|
|
45
45
|
class: "thinking-bar-tool-call-block"
|
|
46
46
|
}, Pe = { class: "thinking-bar-tool-call-pre" }, je = {
|
|
@@ -61,13 +61,13 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
61
61
|
}, Ue = {
|
|
62
62
|
key: 3,
|
|
63
63
|
class: "thinking-bar-tool-call-block"
|
|
64
|
-
}, Je = { class: "thinking-bar-tool-call-pre" },
|
|
64
|
+
}, Je = { class: "thinking-bar-tool-call-pre" }, Qe = {
|
|
65
65
|
key: 4,
|
|
66
66
|
class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--error"
|
|
67
|
-
},
|
|
67
|
+
}, We = { class: "thinking-bar-tool-call-pre" }, Xe = {
|
|
68
68
|
key: 5,
|
|
69
69
|
class: "thinking-bar-nested-tools"
|
|
70
|
-
},
|
|
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 = {
|
|
71
71
|
key: 0,
|
|
72
72
|
class: "thinking-bar-tool-call-block"
|
|
73
73
|
}, rn = { class: "thinking-bar-tool-call-pre" }, on = {
|
|
@@ -97,31 +97,31 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
97
97
|
}, wn = { class: "thinking-bar-tool-result-table" }, Tn = {
|
|
98
98
|
key: 3,
|
|
99
99
|
class: "thinking-bar-tool-call-pre"
|
|
100
|
-
},
|
|
100
|
+
}, $n = {
|
|
101
101
|
key: 1,
|
|
102
102
|
class: "thinking-bar-step-text thinking-bar-step-markdown"
|
|
103
|
-
},
|
|
103
|
+
}, Sn = {
|
|
104
104
|
key: 3,
|
|
105
105
|
class: "thinking-bar-attachments"
|
|
106
106
|
}, xn = ["href"], Rn = ["src", "alt"], An = { class: "thinking-bar-attachment-meta" }, Cn = { class: "thinking-bar-attachment-name" }, Bn = { class: "thinking-bar-attachment-type" }, Dn = {
|
|
107
107
|
key: 4,
|
|
108
108
|
class: "thinking-bar-workspace"
|
|
109
|
-
}, Fn = { class: "thinking-bar-workspace-shell" }, En = { class: "thinking-bar-file-tree-pane" },
|
|
109
|
+
}, Fn = { class: "thinking-bar-workspace-shell" }, En = { class: "thinking-bar-file-tree-pane" }, Mn = { class: "thinking-bar-file-tree-body" }, zn = {
|
|
110
110
|
key: 0,
|
|
111
111
|
class: "thinking-bar-tree-node"
|
|
112
|
-
},
|
|
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 = {
|
|
113
113
|
key: 0,
|
|
114
114
|
class: "thinking-bar-preview-chip"
|
|
115
115
|
}, Un = {
|
|
116
116
|
key: 0,
|
|
117
117
|
class: "thinking-bar-image-shell"
|
|
118
|
-
}, Jn = ["src", "alt"],
|
|
118
|
+
}, Jn = ["src", "alt"], Qn = {
|
|
119
119
|
key: 1,
|
|
120
120
|
class: "thinking-bar-empty-preview"
|
|
121
|
-
},
|
|
121
|
+
}, Wn = ["srcdoc", "title"], Xn = {
|
|
122
122
|
key: 2,
|
|
123
123
|
class: "thinking-bar-file-preview-body"
|
|
124
|
-
},
|
|
124
|
+
}, Yn = {
|
|
125
125
|
key: 1,
|
|
126
126
|
class: "thinking-bar-empty-preview"
|
|
127
127
|
}, oi = /* @__PURE__ */ Gt({
|
|
@@ -136,17 +136,17 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
136
136
|
emits: ["close", "force-refresh"],
|
|
137
137
|
setup(v) {
|
|
138
138
|
const et = N(!1), V = N(null), w = N({}), S = /* @__PURE__ */ new Map();
|
|
139
|
-
let E = null,
|
|
139
|
+
let E = null, x = null;
|
|
140
140
|
function q(e) {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
W(e), requestAnimationFrame(() => {
|
|
142
|
+
W(e);
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function St(e, t) {
|
|
146
146
|
const i = S.get(e);
|
|
147
|
-
i &&
|
|
147
|
+
i && x && x.unobserve(i);
|
|
148
148
|
const n = t instanceof HTMLElement ? t : null;
|
|
149
|
-
n ? (S.set(e, n),
|
|
149
|
+
n ? (S.set(e, n), x?.observe(n)) : S.delete(e);
|
|
150
150
|
}
|
|
151
151
|
function nt(e) {
|
|
152
152
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 96;
|
|
@@ -173,11 +173,11 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
173
173
|
return t ? !0 : w.value[e] !== !1;
|
|
174
174
|
}
|
|
175
175
|
Ut(() => {
|
|
176
|
-
typeof ResizeObserver < "u" && (
|
|
177
|
-
|
|
176
|
+
typeof ResizeObserver < "u" && (x = new ResizeObserver(() => {
|
|
177
|
+
W();
|
|
178
178
|
}), yt(() => {
|
|
179
179
|
S.forEach((e) => {
|
|
180
|
-
|
|
180
|
+
x?.observe(e);
|
|
181
181
|
});
|
|
182
182
|
})), requestAnimationFrame(() => {
|
|
183
183
|
et.value = !0;
|
|
@@ -185,7 +185,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
185
185
|
q(!0);
|
|
186
186
|
});
|
|
187
187
|
}), Jt(() => {
|
|
188
|
-
E != null && window.clearTimeout(E),
|
|
188
|
+
E != null && window.clearTimeout(E), x?.disconnect(), x = null, S.clear();
|
|
189
189
|
});
|
|
190
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 ? {
|
|
191
191
|
reuse: "已复用项目记忆",
|
|
@@ -203,18 +203,18 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
203
203
|
(e) => e.status === "done" || e.status === "error"
|
|
204
204
|
)
|
|
205
205
|
), Bt = p(() => {
|
|
206
|
-
const e = d.steps.find((t) =>
|
|
207
|
-
return e && ((
|
|
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
208
|
}), rt = p(
|
|
209
209
|
() => te(d.memoryReplay?.source)
|
|
210
210
|
), Dt = p(() => rt.value.heading), Ft = p(
|
|
211
211
|
() => rt.value.description
|
|
212
212
|
), Et = p(
|
|
213
213
|
() => d.steps.filter((e) => e.status === "active").length
|
|
214
|
-
),
|
|
214
|
+
), Mt = p(
|
|
215
215
|
() => d.steps.filter((e) => e.status === "done").length
|
|
216
216
|
);
|
|
217
|
-
function
|
|
217
|
+
function zt(e) {
|
|
218
218
|
return e.name.trim().toLowerCase();
|
|
219
219
|
}
|
|
220
220
|
function O(e) {
|
|
@@ -223,33 +223,29 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
223
223
|
function G(e) {
|
|
224
224
|
return tt(e.content ?? "").planning;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const { planning: t, answer: i } = tt(e.content ?? ""), n =
|
|
228
|
-
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;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
if (!
|
|
232
|
-
const { planning: t } = tt(e.content ?? ""), i =
|
|
230
|
+
function Ht(e) {
|
|
231
|
+
if (!I(e.id) && Z(e.id)) return "";
|
|
232
|
+
const { planning: t } = tt(e.content ?? ""), i = K(
|
|
233
233
|
Tt(e.content ?? "")
|
|
234
234
|
);
|
|
235
|
-
return i.trim() ? i : t.trim() ? "" :
|
|
235
|
+
return i.trim() ? i : t.trim() ? "" : K(
|
|
236
236
|
Tt(e.content ?? "")
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
-
function L(e) {
|
|
240
|
-
const t = e.trim();
|
|
241
|
-
return !t || t.startsWith("联网检索证据:") || t.includes("Tavily answer:") || t.includes("Hikari answer") || t.includes("Yuxi project knowledge") || t.includes("Spotlight knowledge") ? "" : t;
|
|
242
|
-
}
|
|
243
239
|
function ot(e) {
|
|
244
240
|
return e.toolCalls?.length ? e.toolCalls : (e.chatItems ?? []).filter(
|
|
245
241
|
(t) => t.type === "tool"
|
|
246
242
|
).map((t) => t.toolCall);
|
|
247
243
|
}
|
|
248
244
|
function U(e) {
|
|
249
|
-
return
|
|
245
|
+
return $t(ot(e)).visible;
|
|
250
246
|
}
|
|
251
247
|
function lt(e) {
|
|
252
|
-
return
|
|
248
|
+
return $t(ot(e)).nestedKnowledge;
|
|
253
249
|
}
|
|
254
250
|
function Pt(e) {
|
|
255
251
|
return Zt(e.name);
|
|
@@ -289,8 +285,8 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
289
285
|
return null;
|
|
290
286
|
}
|
|
291
287
|
}
|
|
292
|
-
function
|
|
293
|
-
const t =
|
|
288
|
+
function A(e) {
|
|
289
|
+
const t = zt(e), i = e.resultText?.trim() || "";
|
|
294
290
|
if (!i) return "";
|
|
295
291
|
if (t === "list_kbs") {
|
|
296
292
|
const n = J(i);
|
|
@@ -302,23 +298,23 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
302
298
|
}
|
|
303
299
|
return i;
|
|
304
300
|
}
|
|
305
|
-
function
|
|
301
|
+
function Q(e) {
|
|
306
302
|
const t = e.resultText?.trim() || "";
|
|
307
303
|
return t ? J(t) ?? t : null;
|
|
308
304
|
}
|
|
309
|
-
function
|
|
305
|
+
function M(e) {
|
|
310
306
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
311
307
|
}
|
|
312
308
|
function ut(e) {
|
|
313
309
|
return /<(table|html|body|svg|div|span|img|p|iframe)[\s>]/i.test(e);
|
|
314
310
|
}
|
|
315
|
-
function
|
|
316
|
-
const t =
|
|
311
|
+
function z(e) {
|
|
312
|
+
const t = Q(e);
|
|
317
313
|
if (typeof t == "string") {
|
|
318
314
|
const i = t.trim();
|
|
319
315
|
return /^data:image\//i.test(i) || /\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(i) ? i : null;
|
|
320
316
|
}
|
|
321
|
-
if (
|
|
317
|
+
if (M(t)) {
|
|
322
318
|
const i = [t.url, t.uri, t.path].find(
|
|
323
319
|
(n) => typeof n == "string" && /^data:image\//i.test(n)
|
|
324
320
|
);
|
|
@@ -326,11 +322,11 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
326
322
|
}
|
|
327
323
|
return null;
|
|
328
324
|
}
|
|
329
|
-
function
|
|
330
|
-
const t =
|
|
325
|
+
function H(e) {
|
|
326
|
+
const t = Q(e);
|
|
331
327
|
if (typeof t == "string" && ut(t.trim()))
|
|
332
328
|
return t;
|
|
333
|
-
if (
|
|
329
|
+
if (M(t)) {
|
|
334
330
|
const i = [t.html, t.content, t.markup].find(
|
|
335
331
|
(n) => typeof n == "string" && ut(n)
|
|
336
332
|
);
|
|
@@ -339,10 +335,10 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
339
335
|
return null;
|
|
340
336
|
}
|
|
341
337
|
function dt(e) {
|
|
342
|
-
return !Array.isArray(e) || e.length === 0 || !e.every((t) =>
|
|
338
|
+
return !Array.isArray(e) || e.length === 0 || !e.every((t) => M(t)) ? null : e;
|
|
343
339
|
}
|
|
344
340
|
function _(e) {
|
|
345
|
-
const t =
|
|
341
|
+
const t = Q(e);
|
|
346
342
|
if (Array.isArray(t) && t.length > 0 && t.every((n) => typeof n == "string"))
|
|
347
343
|
return {
|
|
348
344
|
columns: ["value"],
|
|
@@ -353,10 +349,10 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
353
349
|
const n = [...new Set(i.flatMap((l) => Object.keys(l)))];
|
|
354
350
|
return n.length > 0 ? { columns: n, rows: i } : null;
|
|
355
351
|
}
|
|
356
|
-
if (!
|
|
352
|
+
if (!M(t)) return null;
|
|
357
353
|
if (Array.isArray(t.columns) && Array.isArray(t.rows) && t.columns.every((n) => typeof n == "string")) {
|
|
358
354
|
const n = t.columns, l = t.rows.map(
|
|
359
|
-
(u) =>
|
|
355
|
+
(u) => M(u) ? u : Array.isArray(u) ? Object.fromEntries(
|
|
360
356
|
n.map((f, y) => [f, u[y]])
|
|
361
357
|
) : { value: u }
|
|
362
358
|
);
|
|
@@ -374,8 +370,8 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
374
370
|
return null;
|
|
375
371
|
}
|
|
376
372
|
function ht(e) {
|
|
377
|
-
const t =
|
|
378
|
-
return t && i && t.trim() === i ? !1 : !!(
|
|
373
|
+
const t = A(e), i = e.summary?.trim();
|
|
374
|
+
return t && i && t.trim() === i ? !1 : !!(z(e) || H(e) || _(e) || t);
|
|
379
375
|
}
|
|
380
376
|
function gt(e) {
|
|
381
377
|
if (e == null) return "-";
|
|
@@ -388,7 +384,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
388
384
|
return String(e);
|
|
389
385
|
}
|
|
390
386
|
}
|
|
391
|
-
async function
|
|
387
|
+
async function W(e = !1) {
|
|
392
388
|
await yt();
|
|
393
389
|
const t = V.value;
|
|
394
390
|
t && t.scrollTo({
|
|
@@ -484,26 +480,26 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
484
480
|
};
|
|
485
481
|
}
|
|
486
482
|
function Vt(e, t) {
|
|
487
|
-
const i = /* @__PURE__ */ new Map(), n = (y,
|
|
483
|
+
const i = /* @__PURE__ */ new Map(), n = (y, C, T) => (i.has(y) || i.set(y, {
|
|
488
484
|
path: y,
|
|
489
|
-
name:
|
|
485
|
+
name: C,
|
|
490
486
|
depth: T,
|
|
491
487
|
directoryChildren: [],
|
|
492
488
|
files: []
|
|
493
489
|
}), i.get(y)), l = n("", "root", -1);
|
|
494
490
|
for (const y of t) {
|
|
495
|
-
const
|
|
491
|
+
const C = y.path.split("/").filter(Boolean);
|
|
496
492
|
let T = "", j = l;
|
|
497
|
-
|
|
493
|
+
C.slice(0, -1).forEach((m, g) => {
|
|
498
494
|
T += `/${m}`;
|
|
499
495
|
const qt = n(T, m, g);
|
|
500
496
|
j.directoryChildren.includes(T) || j.directoryChildren.push(T), j = qt;
|
|
501
497
|
}), j.files.push(y);
|
|
502
498
|
}
|
|
503
499
|
const u = [], f = (y) => {
|
|
504
|
-
const
|
|
505
|
-
if (!
|
|
506
|
-
const T = [...
|
|
500
|
+
const C = i.get(y);
|
|
501
|
+
if (!C) return;
|
|
502
|
+
const T = [...C.directoryChildren].sort(
|
|
507
503
|
(m, g) => m.localeCompare(g, "zh-CN")
|
|
508
504
|
);
|
|
509
505
|
for (const m of T) {
|
|
@@ -516,7 +512,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
516
512
|
file: null
|
|
517
513
|
}), kt(e, g.path) && f(g.path));
|
|
518
514
|
}
|
|
519
|
-
[...
|
|
515
|
+
[...C.files].sort(
|
|
520
516
|
(m, g) => m.path.localeCompare(g.path, "zh-CN")
|
|
521
517
|
).forEach((m) => {
|
|
522
518
|
const g = Math.max(
|
|
@@ -534,25 +530,25 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
534
530
|
};
|
|
535
531
|
return f(""), u;
|
|
536
532
|
}
|
|
537
|
-
function
|
|
533
|
+
function X(e) {
|
|
538
534
|
return (e?.content || []).join(`
|
|
539
535
|
`).trim();
|
|
540
536
|
}
|
|
541
537
|
function mt(e) {
|
|
542
538
|
return /\.(png|jpe?g|gif|webp|svg)$/i.test(e);
|
|
543
539
|
}
|
|
544
|
-
function
|
|
540
|
+
function Y(e) {
|
|
545
541
|
return /\.(html?)$/i.test(e);
|
|
546
542
|
}
|
|
547
543
|
function bt(e) {
|
|
548
|
-
const t =
|
|
544
|
+
const t = X(e);
|
|
549
545
|
return /^data:image\//i.test(t) ? t : "";
|
|
550
546
|
}
|
|
551
547
|
function ft(e) {
|
|
552
|
-
return mt(e) ? "🖼" :
|
|
548
|
+
return mt(e) ? "🖼" : Y(e) ? "🌐" : /\.md$/i.test(e) ? "📝" : /\.(csv|xlsx?)$/i.test(e) ? "📊" : /\.(json|ya?ml|xml)$/i.test(e) ? "🧩" : "📄";
|
|
553
549
|
}
|
|
554
550
|
return (e, t) => (r(), o("div", {
|
|
555
|
-
class:
|
|
551
|
+
class: B(["thinking-bar", [
|
|
556
552
|
{ "thinking-bar--embedded": v.embedded },
|
|
557
553
|
{ "thinking-bar--open": et.value },
|
|
558
554
|
{ "thinking-bar--centered": v.centered },
|
|
@@ -586,7 +582,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
586
582
|
t[5] || (t[5] = s("em", null, "运行", -1))
|
|
587
583
|
]),
|
|
588
584
|
s("span", ae, [
|
|
589
|
-
s("strong", null, a(
|
|
585
|
+
s("strong", null, a(Mt.value), 1),
|
|
590
586
|
t[6] || (t[6] = s("em", null, "完成", -1))
|
|
591
587
|
])
|
|
592
588
|
])),
|
|
@@ -612,7 +608,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
612
608
|
s("section", he, [
|
|
613
609
|
t[9] || (t[9] = s("div", { class: "thinking-bar-memory-result-answer-label" }, "回答", -1)),
|
|
614
610
|
s("div", ge, [
|
|
615
|
-
|
|
611
|
+
L(wt, {
|
|
616
612
|
"model-value": Bt.value,
|
|
617
613
|
"format-knowledge": ""
|
|
618
614
|
}, null, 8, ["model-value"])
|
|
@@ -635,33 +631,33 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
635
631
|
}, [
|
|
636
632
|
(r(!0), o(h, null, b(v.steps, (i) => (r(), o("div", {
|
|
637
633
|
key: i.id,
|
|
638
|
-
class:
|
|
634
|
+
class: B(["thinking-bar-step", [i.status]])
|
|
639
635
|
}, [
|
|
640
636
|
s("div", me, [
|
|
641
637
|
s("span", {
|
|
642
|
-
class:
|
|
638
|
+
class: B(["thinking-bar-step-status", `is-${i.status}`]),
|
|
643
639
|
"aria-hidden": "true"
|
|
644
640
|
}, null, 2),
|
|
645
641
|
s("div", be, [
|
|
646
642
|
s("span", fe, a(i.label), 1),
|
|
647
643
|
s("div", {
|
|
648
644
|
ref_for: !0,
|
|
649
|
-
ref: (n) =>
|
|
645
|
+
ref: (n) => St(i.id, n),
|
|
650
646
|
class: "thinking-bar-step-body",
|
|
651
647
|
onScrollPassive: (n) => xt(i.id, n)
|
|
652
648
|
}, [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
(r(!0), o(h, null, b(
|
|
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", {
|
|
658
654
|
key: `${i.id}-source-${l}`
|
|
659
655
|
}, a(n), 1))), 128))
|
|
660
656
|
])) : c("", !0),
|
|
661
|
-
|
|
657
|
+
R(i)?.note ? (r(), o("p", Te, a(R(i)?.note), 1)) : c("", !0)
|
|
662
658
|
])) : c("", !0),
|
|
663
|
-
jt(i) ? (r(), o("details",
|
|
664
|
-
s("summary",
|
|
659
|
+
jt(i) ? (r(), o("details", $e, [
|
|
660
|
+
s("summary", Se, [
|
|
665
661
|
s("span", xe, a(i.label === "操作页面" ? "页面操作" : "本次检索"), 1),
|
|
666
662
|
s("span", Re, a(Nt(i)), 1),
|
|
667
663
|
t[11] || (t[11] = s("span", { class: "thinking-bar-execution-details-caret" }, "▾", -1))
|
|
@@ -677,34 +673,34 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
677
673
|
s("span", Fe, a(O(n)), 1),
|
|
678
674
|
n.name !== O(n) ? (r(), o("span", Ee, a(n.name), 1)) : c("", !0)
|
|
679
675
|
]),
|
|
680
|
-
s("div",
|
|
676
|
+
s("div", Me, [
|
|
681
677
|
s("span", {
|
|
682
|
-
class:
|
|
678
|
+
class: B(["thinking-bar-tool-call-status", `is-${n.status}`])
|
|
683
679
|
}, a(at(n.status)), 3),
|
|
684
680
|
t[12] || (t[12] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
|
|
685
681
|
])
|
|
686
682
|
]),
|
|
687
|
-
s("div",
|
|
688
|
-
n.argsText?.trim() ? (r(), o("div",
|
|
683
|
+
s("div", ze, [
|
|
684
|
+
n.argsText?.trim() ? (r(), o("div", He, [
|
|
689
685
|
t[13] || (t[13] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
|
|
690
686
|
s("pre", Pe, a(n.argsText), 1)
|
|
691
687
|
])) : c("", !0),
|
|
692
688
|
n.summary?.trim() ? (r(), o("div", je, [
|
|
693
689
|
t[14] || (t[14] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行摘要 ", -1)),
|
|
694
|
-
s("pre", Ne, a(
|
|
690
|
+
s("pre", Ne, a($(Qt)(n.summary)), 1)
|
|
695
691
|
])) : c("", !0),
|
|
696
692
|
ht(n) ? (r(), o("div", Oe, [
|
|
697
693
|
t[15] || (t[15] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
|
|
698
|
-
|
|
694
|
+
z(n) ? (r(), o("div", Le, [
|
|
699
695
|
s("img", {
|
|
700
696
|
class: "thinking-bar-tool-result-image",
|
|
701
|
-
src:
|
|
697
|
+
src: z(n) || "",
|
|
702
698
|
alt: n.name
|
|
703
699
|
}, null, 8, Ie)
|
|
704
|
-
])) :
|
|
700
|
+
])) : H(n) ? (r(), o("iframe", {
|
|
705
701
|
key: 1,
|
|
706
702
|
class: "thinking-bar-tool-result-html",
|
|
707
|
-
srcdoc:
|
|
703
|
+
srcdoc: H(n) || "",
|
|
708
704
|
title: n.name,
|
|
709
705
|
sandbox: ""
|
|
710
706
|
}, null, 8, Ke)) : _(n) ? (r(), o("div", Ve, [
|
|
@@ -728,17 +724,17 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
728
724
|
]))), 128))
|
|
729
725
|
])
|
|
730
726
|
])
|
|
731
|
-
])) :
|
|
727
|
+
])) : A(n) ? (r(), o("pre", Ge, a(A(n)), 1)) : c("", !0)
|
|
732
728
|
])) : c("", !0),
|
|
733
729
|
ct(n.trace) ? (r(), o("div", Ue, [
|
|
734
730
|
t[16] || (t[16] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行轨迹 ", -1)),
|
|
735
731
|
s("pre", Je, a(ct(n.trace)), 1)
|
|
736
732
|
])) : c("", !0),
|
|
737
|
-
n.errorCode ? (r(), o("div",
|
|
733
|
+
n.errorCode ? (r(), o("div", Qe, [
|
|
738
734
|
t[17] || (t[17] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 错误码 ", -1)),
|
|
739
|
-
s("pre",
|
|
735
|
+
s("pre", We, a(n.errorCode), 1)
|
|
740
736
|
])) : c("", !0),
|
|
741
|
-
Pt(n) && lt(i).length > 0 ? (r(), o("div",
|
|
737
|
+
Pt(n) && lt(i).length > 0 ? (r(), o("div", Xe, [
|
|
742
738
|
t[21] || (t[21] = s("div", { class: "thinking-bar-nested-tools-label" }, " 知识库内部步骤 ", -1)),
|
|
743
739
|
(r(!0), o(h, null, b(lt(
|
|
744
740
|
i
|
|
@@ -746,13 +742,13 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
746
742
|
key: l.id,
|
|
747
743
|
class: "thinking-bar-tool-call thinking-bar-tool-call--nested"
|
|
748
744
|
}, [
|
|
749
|
-
s("summary",
|
|
745
|
+
s("summary", Ye, [
|
|
750
746
|
s("div", Ze, [
|
|
751
747
|
s("span", tn, a(O(l)), 1)
|
|
752
748
|
]),
|
|
753
749
|
s("div", en, [
|
|
754
750
|
s("span", {
|
|
755
|
-
class:
|
|
751
|
+
class: B(["thinking-bar-tool-call-status", `is-${l.status}`])
|
|
756
752
|
}, a(at(l.status)), 3),
|
|
757
753
|
t[18] || (t[18] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
|
|
758
754
|
])
|
|
@@ -762,9 +758,9 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
762
758
|
t[19] || (t[19] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
|
|
763
759
|
s("pre", rn, a(l.argsText), 1)
|
|
764
760
|
])) : c("", !0),
|
|
765
|
-
|
|
761
|
+
A(l) ? (r(), o("div", on, [
|
|
766
762
|
t[20] || (t[20] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
|
|
767
|
-
s("pre", ln, a(
|
|
763
|
+
s("pre", ln, a(A(l)), 1)
|
|
768
764
|
])) : c("", !0)
|
|
769
765
|
])
|
|
770
766
|
]))), 128))
|
|
@@ -773,10 +769,10 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
773
769
|
]))), 128))
|
|
774
770
|
])
|
|
775
771
|
])) : c("", !0)
|
|
776
|
-
])) :
|
|
772
|
+
])) : $(I)(i.id) ? (r(), o(h, { key: 1 }, [
|
|
777
773
|
i.content ? (r(), o("div", an, [
|
|
778
|
-
|
|
779
|
-
"model-value":
|
|
774
|
+
L(wt, {
|
|
775
|
+
"model-value": $(K)(i.content),
|
|
780
776
|
"format-knowledge": ""
|
|
781
777
|
}, null, 8, ["model-value"])
|
|
782
778
|
])) : c("", !0)
|
|
@@ -787,8 +783,8 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
787
783
|
class: "thinking-bar-chat-item"
|
|
788
784
|
}, [
|
|
789
785
|
n.type === "text" && n.text.trim() ? (r(), o("div", un, [
|
|
790
|
-
|
|
791
|
-
"model-value":
|
|
786
|
+
L($(_t), {
|
|
787
|
+
"model-value": $(Wt)(n.text),
|
|
792
788
|
theme: "dark",
|
|
793
789
|
"preview-theme": "github",
|
|
794
790
|
"code-theme": "github",
|
|
@@ -801,7 +797,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
801
797
|
]),
|
|
802
798
|
s("div", mn, [
|
|
803
799
|
s("span", {
|
|
804
|
-
class:
|
|
800
|
+
class: B(["thinking-bar-tool-call-status", `is-${n.toolCall.status}`])
|
|
805
801
|
}, a(n.toolCall.status === "done" ? "已完成" : n.toolCall.status === "error" ? "失败" : n.toolCall.status === "running" ? "执行中" : "待执行"), 3),
|
|
806
802
|
t[22] || (t[22] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
|
|
807
803
|
])
|
|
@@ -809,16 +805,16 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
809
805
|
s("div", bn, [
|
|
810
806
|
ht(n.toolCall) ? (r(), o("div", fn, [
|
|
811
807
|
t[23] || (t[23] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 结果 ", -1)),
|
|
812
|
-
|
|
808
|
+
z(n.toolCall) ? (r(), o("div", yn, [
|
|
813
809
|
s("img", {
|
|
814
810
|
class: "thinking-bar-tool-result-image",
|
|
815
|
-
src:
|
|
811
|
+
src: z(n.toolCall) || "",
|
|
816
812
|
alt: n.toolCall.name
|
|
817
813
|
}, null, 8, pn)
|
|
818
|
-
])) :
|
|
814
|
+
])) : H(n.toolCall) ? (r(), o("iframe", {
|
|
819
815
|
key: 1,
|
|
820
816
|
class: "thinking-bar-tool-result-html",
|
|
821
|
-
srcdoc:
|
|
817
|
+
srcdoc: H(n.toolCall) || "",
|
|
822
818
|
title: n.toolCall.name,
|
|
823
819
|
sandbox: ""
|
|
824
820
|
}, null, 8, vn)) : _(n.toolCall) ? (r(), o("div", _n, [
|
|
@@ -844,14 +840,14 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
844
840
|
]))), 128))
|
|
845
841
|
])
|
|
846
842
|
])
|
|
847
|
-
])) :
|
|
843
|
+
])) : A(n.toolCall) ? (r(), o("pre", Tn, a(A(n.toolCall)), 1)) : c("", !0)
|
|
848
844
|
])) : c("", !0)
|
|
849
845
|
])
|
|
850
846
|
])) : c("", !0)
|
|
851
847
|
]))), 128))
|
|
852
|
-
])) : i.content ? (r(), o("div",
|
|
853
|
-
|
|
854
|
-
"model-value":
|
|
848
|
+
])) : i.content ? (r(), o("div", $n, [
|
|
849
|
+
L($(_t), {
|
|
850
|
+
"model-value": $(Xt)(i.content ?? ""),
|
|
855
851
|
theme: "dark",
|
|
856
852
|
"preview-theme": "github",
|
|
857
853
|
"code-theme": "github",
|
|
@@ -859,7 +855,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
859
855
|
}, null, 8, ["model-value"])
|
|
860
856
|
])) : c("", !0)
|
|
861
857
|
], 64)),
|
|
862
|
-
i.attachments && i.attachments.length > 0 ? (r(), o("div",
|
|
858
|
+
i.attachments && i.attachments.length > 0 ? (r(), o("div", Sn, [
|
|
863
859
|
(r(!0), o(h, null, b(i.attachments, (n) => (r(), o("a", {
|
|
864
860
|
key: n.id,
|
|
865
861
|
class: "thinking-bar-attachment",
|
|
@@ -884,11 +880,11 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
884
880
|
s("div", Fn, [
|
|
885
881
|
s("div", En, [
|
|
886
882
|
t[25] || (t[25] = s("div", { class: "thinking-bar-file-tree-head" }, "文件系统", -1)),
|
|
887
|
-
s("div",
|
|
883
|
+
s("div", Mn, [
|
|
888
884
|
(r(!0), o(h, null, b(Vt(i.id, i.files), (n) => (r(), o(h, {
|
|
889
885
|
key: `${i.id}:${n.path}`
|
|
890
886
|
}, [
|
|
891
|
-
n.type === "directory" ? (r(), o("div",
|
|
887
|
+
n.type === "directory" ? (r(), o("div", zn, [
|
|
892
888
|
s("button", {
|
|
893
889
|
type: "button",
|
|
894
890
|
class: "thinking-bar-tree-row thinking-bar-tree-row--directory",
|
|
@@ -900,11 +896,11 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
900
896
|
s("span", Pn, a(kt(i.id, n.path) ? "▾" : "▸"), 1),
|
|
901
897
|
t[24] || (t[24] = s("span", { class: "thinking-bar-tree-icon" }, "📁", -1)),
|
|
902
898
|
s("span", jn, a(n.name), 1)
|
|
903
|
-
], 12,
|
|
899
|
+
], 12, Hn)
|
|
904
900
|
])) : (r(), o("button", {
|
|
905
901
|
key: 1,
|
|
906
902
|
type: "button",
|
|
907
|
-
class:
|
|
903
|
+
class: B(["thinking-bar-tree-row thinking-bar-tree-row--file", {
|
|
908
904
|
active: k(i)?.id === n.file?.id
|
|
909
905
|
}]),
|
|
910
906
|
style: vt({ paddingLeft: `${n.depth * 14 + 26}px` }),
|
|
@@ -923,7 +919,7 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
923
919
|
s("span", qn, a(ft(k(i)?.path || "")), 1),
|
|
924
920
|
s("span", null, a(k(i)?.path), 1)
|
|
925
921
|
]),
|
|
926
|
-
|
|
922
|
+
Y(k(i)?.path || "") ? (r(), o("span", Gn, " HTML 预览 ")) : c("", !0)
|
|
927
923
|
]),
|
|
928
924
|
mt(k(i)?.path || "") ? (r(), o("div", Un, [
|
|
929
925
|
bt(k(i)) ? (r(), o("img", {
|
|
@@ -931,15 +927,15 @@ const ee = { class: "thinking-bar-header" }, ne = { class: "thinking-bar-title-s
|
|
|
931
927
|
class: "thinking-bar-image-preview",
|
|
932
928
|
src: bt(k(i)) || "",
|
|
933
929
|
alt: k(i)?.name || "图片预览"
|
|
934
|
-
}, null, 8, Jn)) : (r(), o("div",
|
|
935
|
-
])) :
|
|
930
|
+
}, null, 8, Jn)) : (r(), o("div", Qn, " 当前图片文件没有可直接渲染的内容。 "))
|
|
931
|
+
])) : Y(k(i)?.path || "") ? (r(), o("iframe", {
|
|
936
932
|
key: 1,
|
|
937
933
|
class: "thinking-bar-html-preview",
|
|
938
|
-
srcdoc:
|
|
934
|
+
srcdoc: X(k(i)),
|
|
939
935
|
title: k(i)?.path,
|
|
940
936
|
sandbox: ""
|
|
941
|
-
}, null, 8,
|
|
942
|
-
], 64)) : (r(), o("div",
|
|
937
|
+
}, null, 8, Wn)) : (r(), o("pre", Xn, a(X(k(i))), 1))
|
|
938
|
+
], 64)) : (r(), o("div", Yn, " 还没选中文件,左边点一个看看。 "))
|
|
943
939
|
])
|
|
944
940
|
])
|
|
945
941
|
])) : c("", !0)
|