@inupedia/spotlight-vue 0.1.9 → 0.2.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/SpotlightCommandPanel.vue.d.ts.map +1 -1
- package/dist/components/SpotlightCommandPanel.vue.js +1 -1
- package/dist/components/SpotlightCommandPanel2.vue.js +114 -131
- package/dist/components/SpotlightThinking.vue.d.ts.map +1 -1
- package/dist/components/SpotlightThinking.vue.js +2 -2
- package/dist/components/SpotlightThinking2.vue.js +134 -134
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +59 -60
- package/dist/remote/types.d.ts +1 -0
- package/dist/remote/types.d.ts.map +1 -1
- package/dist/session/agentSession.d.ts +14 -0
- package/dist/session/agentSession.d.ts.map +1 -1
- package/dist/session/agentSession.js +61 -51
- package/dist/session/agentSessionPersistence.d.ts +18 -0
- package/dist/session/agentSessionPersistence.d.ts.map +1 -0
- package/dist/session/agentSessionPersistence.js +34 -0
- package/dist/store/memoryPreferenceStore.d.ts.map +1 -1
- package/dist/store/memoryPreferenceStore.js +13 -9
- package/dist/store/spotlightStore.d.ts.map +1 -1
- package/dist/store/spotlightStore.js +41 -39
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as jt, ref as D, onMounted as
|
|
1
|
+
import { defineComponent as jt, ref as D, onMounted as It, nextTick as kt, onBeforeUnmount as Pt, computed as M, watch as bt, openBlock as r, createElementBlock as o, normalizeClass as B, createElementVNode as s, toDisplayString as a, createCommentVNode as u, Fragment as d, renderList as m, createBlock as Vt, unref as N, createVNode as W, normalizeStyle as ft } from "vue";
|
|
2
2
|
import { MdPreview as mt } from "md-editor-v3";
|
|
3
3
|
import "md-editor-v3/lib/preview.css";
|
|
4
4
|
import qt from "./SpotlightMarkdownPreview.vue.js";
|
|
5
5
|
import { isToolExecutionStep as Kt, humanizeSpotlightStepContent as Jt, getIntentStepDisplayContent as Ut, splitToolStepContent as pt, sanitizeToolStepAnswerText as yt } from "../store/pipeline/displayText.js";
|
|
6
6
|
import { partitionToolCalls as _t } from "../store/pipeline/toolDisplay.js";
|
|
7
7
|
import { TOOL_NAMES as Wt } from "../constants/toolNames.js";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import Gt from "./OfficialBorderBeam.js";
|
|
9
|
+
const Qt = { class: "thinking-bar-header" }, Xt = { class: "thinking-bar-title-stack" }, Yt = { class: "thinking-bar-title" }, Zt = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "thinking-bar-memory-badge"
|
|
12
12
|
}, te = {
|
|
@@ -27,31 +27,31 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
27
27
|
}, _e = { class: "thinking-bar-tool-call-head-side" }, ve = { class: "thinking-bar-tool-call-body" }, we = {
|
|
28
28
|
key: 0,
|
|
29
29
|
class: "thinking-bar-tool-call-block"
|
|
30
|
-
}, Te = { class: "thinking-bar-tool-call-pre" },
|
|
30
|
+
}, Te = { class: "thinking-bar-tool-call-pre" }, xe = {
|
|
31
31
|
key: 1,
|
|
32
32
|
class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
|
|
33
|
-
},
|
|
33
|
+
}, Se = { class: "thinking-bar-tool-call-pre" }, $e = {
|
|
34
34
|
key: 2,
|
|
35
35
|
class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
|
|
36
36
|
}, Ae = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "thinking-bar-tool-result-image-shell"
|
|
39
|
-
}, Be = ["src", "alt"], Ce = ["srcdoc", "title"],
|
|
39
|
+
}, Be = ["src", "alt"], Ce = ["srcdoc", "title"], Fe = {
|
|
40
40
|
key: 2,
|
|
41
41
|
class: "thinking-bar-tool-result-table-wrap"
|
|
42
|
-
},
|
|
42
|
+
}, Re = { class: "thinking-bar-tool-result-table" }, Ee = {
|
|
43
43
|
key: 3,
|
|
44
44
|
class: "thinking-bar-tool-call-pre"
|
|
45
|
-
},
|
|
45
|
+
}, ze = {
|
|
46
46
|
key: 3,
|
|
47
47
|
class: "thinking-bar-tool-call-block"
|
|
48
|
-
},
|
|
48
|
+
}, Oe = { class: "thinking-bar-tool-call-pre" }, De = {
|
|
49
49
|
key: 4,
|
|
50
50
|
class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--error"
|
|
51
|
-
},
|
|
51
|
+
}, Me = { class: "thinking-bar-tool-call-pre" }, Ne = {
|
|
52
52
|
key: 5,
|
|
53
53
|
class: "thinking-bar-nested-tools"
|
|
54
|
-
},
|
|
54
|
+
}, He = { class: "thinking-bar-tool-call-head" }, Le = { class: "thinking-bar-tool-call-head-main" }, je = { class: "thinking-bar-tool-call-name" }, Ie = { class: "thinking-bar-tool-call-head-side" }, Pe = { class: "thinking-bar-tool-call-body" }, Ve = {
|
|
55
55
|
key: 0,
|
|
56
56
|
class: "thinking-bar-tool-call-block"
|
|
57
57
|
}, qe = { class: "thinking-bar-tool-call-pre" }, Ke = {
|
|
@@ -60,13 +60,13 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
60
60
|
}, Je = { class: "thinking-bar-tool-call-pre" }, Ue = {
|
|
61
61
|
key: 1,
|
|
62
62
|
class: "thinking-bar-step-answer-section"
|
|
63
|
-
}, We = { class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer" },
|
|
63
|
+
}, We = { class: "thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer" }, Ge = {
|
|
64
64
|
key: 0,
|
|
65
65
|
class: "thinking-bar-chat-items"
|
|
66
|
-
},
|
|
66
|
+
}, Qe = {
|
|
67
67
|
key: 0,
|
|
68
68
|
class: "thinking-bar-step-text thinking-bar-step-markdown"
|
|
69
|
-
},
|
|
69
|
+
}, Xe = ["open"], 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 = {
|
|
70
70
|
key: 0,
|
|
71
71
|
class: "thinking-bar-tool-call-block thinking-bar-tool-call-block--result"
|
|
72
72
|
}, rn = {
|
|
@@ -90,16 +90,16 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
90
90
|
}, yn = { class: "thinking-bar-workspace-shell" }, _n = { class: "thinking-bar-file-tree-pane" }, vn = { class: "thinking-bar-file-tree-body" }, wn = {
|
|
91
91
|
key: 0,
|
|
92
92
|
class: "thinking-bar-tree-node"
|
|
93
|
-
}, Tn = ["onClick"],
|
|
93
|
+
}, Tn = ["onClick"], xn = { class: "thinking-bar-tree-caret" }, Sn = { class: "thinking-bar-tree-label" }, $n = ["onClick"], An = { class: "thinking-bar-tree-icon" }, Bn = { class: "thinking-bar-tree-label" }, Cn = { class: "thinking-bar-file-preview" }, Fn = { class: "thinking-bar-file-preview-head" }, Rn = { class: "thinking-bar-file-preview-title" }, En = { class: "thinking-bar-tree-icon" }, zn = {
|
|
94
94
|
key: 0,
|
|
95
95
|
class: "thinking-bar-preview-chip"
|
|
96
|
-
},
|
|
96
|
+
}, On = {
|
|
97
97
|
key: 0,
|
|
98
98
|
class: "thinking-bar-image-shell"
|
|
99
|
-
}, Dn = ["src", "alt"],
|
|
99
|
+
}, Dn = ["src", "alt"], Mn = {
|
|
100
100
|
key: 1,
|
|
101
101
|
class: "thinking-bar-empty-preview"
|
|
102
|
-
},
|
|
102
|
+
}, Nn = ["srcdoc", "title"], Hn = {
|
|
103
103
|
key: 2,
|
|
104
104
|
class: "thinking-bar-file-preview-body"
|
|
105
105
|
}, Ln = {
|
|
@@ -115,8 +115,8 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
115
115
|
},
|
|
116
116
|
emits: ["close"],
|
|
117
117
|
setup(w) {
|
|
118
|
-
const
|
|
119
|
-
let C = null,
|
|
118
|
+
const G = D(!1), L = D(null), _ = D({}), T = /* @__PURE__ */ new Map();
|
|
119
|
+
let C = null, x = null;
|
|
120
120
|
function j(e) {
|
|
121
121
|
K(e), requestAnimationFrame(() => {
|
|
122
122
|
K(e);
|
|
@@ -124,22 +124,22 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
124
124
|
}
|
|
125
125
|
function vt(e, t) {
|
|
126
126
|
const i = T.get(e);
|
|
127
|
-
i &&
|
|
127
|
+
i && x && x.unobserve(i);
|
|
128
128
|
const n = t instanceof HTMLElement ? t : null;
|
|
129
|
-
n ? (T.set(e, n),
|
|
129
|
+
n ? (T.set(e, n), x?.observe(n)) : T.delete(e);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Q(e) {
|
|
132
132
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 96;
|
|
133
133
|
}
|
|
134
134
|
function wt(e, t) {
|
|
135
135
|
const i = t.target;
|
|
136
136
|
C != null && window.clearTimeout(C), _.value = {
|
|
137
137
|
..._.value,
|
|
138
|
-
[e]:
|
|
138
|
+
[e]: Q(i)
|
|
139
139
|
}, C = window.setTimeout(() => {
|
|
140
140
|
_.value = {
|
|
141
141
|
..._.value,
|
|
142
|
-
[e]:
|
|
142
|
+
[e]: Q(i)
|
|
143
143
|
};
|
|
144
144
|
}, 120);
|
|
145
145
|
}
|
|
@@ -149,33 +149,33 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
149
149
|
const t = h.steps[h.steps.length - 1];
|
|
150
150
|
return t ? [t.id] : [];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function X(e, t) {
|
|
153
153
|
return t ? !0 : _.value[e] !== !1;
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
typeof ResizeObserver < "u" && (
|
|
155
|
+
It(() => {
|
|
156
|
+
typeof ResizeObserver < "u" && (x = new ResizeObserver(() => {
|
|
157
157
|
K();
|
|
158
158
|
}), kt(() => {
|
|
159
159
|
T.forEach((e) => {
|
|
160
|
-
|
|
160
|
+
x?.observe(e);
|
|
161
161
|
});
|
|
162
162
|
})), requestAnimationFrame(() => {
|
|
163
|
-
|
|
163
|
+
G.value = !0;
|
|
164
164
|
}), requestAnimationFrame(() => {
|
|
165
165
|
j(!0);
|
|
166
166
|
});
|
|
167
|
-
}),
|
|
168
|
-
C != null && window.clearTimeout(C),
|
|
167
|
+
}), Pt(() => {
|
|
168
|
+
C != null && window.clearTimeout(C), x?.disconnect(), x = null, T.clear();
|
|
169
169
|
});
|
|
170
|
-
const h = w,
|
|
170
|
+
const h = w, xt = M(() => h.steps.length > 0 && h.steps.every((t) => t.status === "done" || t.status === "error") ? "执行完成" : "思考中"), Y = M(() => h.memoryReplay ? h.memoryReplay.source === "semantic" ? "语义缓存" : h.memoryReplay.source === "exact" ? "Memory 缓存" : "Session 缓存" : ""), St = M(
|
|
171
171
|
() => h.steps.some(
|
|
172
172
|
(e) => e.status === "active" || e.status === "pending" || e.toolCalls?.some(
|
|
173
173
|
(t) => t.status === "pending" || t.status === "running"
|
|
174
174
|
)
|
|
175
175
|
)
|
|
176
|
-
), $t =
|
|
176
|
+
), $t = M(
|
|
177
177
|
() => h.steps.filter((e) => e.status === "active").length
|
|
178
|
-
), At =
|
|
178
|
+
), At = M(
|
|
179
179
|
() => h.steps.filter((e) => e.status === "done").length
|
|
180
180
|
);
|
|
181
181
|
function Bt(e) {
|
|
@@ -193,10 +193,10 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
193
193
|
function Ct(e) {
|
|
194
194
|
return e.name.trim().toLowerCase();
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function H(e) {
|
|
197
197
|
return e.displayName?.trim() || e.name;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function I(e) {
|
|
200
200
|
return pt(e.content ?? "").planning;
|
|
201
201
|
}
|
|
202
202
|
function Z(e) {
|
|
@@ -216,23 +216,23 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
216
216
|
(t) => t.type === "tool"
|
|
217
217
|
).map((t) => t.toolCall);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function P(e) {
|
|
220
220
|
return _t(et(e)).visible;
|
|
221
221
|
}
|
|
222
222
|
function nt(e) {
|
|
223
223
|
return _t(et(e)).nestedKnowledge;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
225
|
+
function Ft(e) {
|
|
226
|
+
return Rt(e.name) === Wt.knowledge.answer;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Rt(e) {
|
|
229
229
|
return e.trim().toLowerCase();
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
return !!(
|
|
231
|
+
function Et(e) {
|
|
232
|
+
return !!(I(e).trim() || P(e).length > 0);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const t =
|
|
234
|
+
function zt(e) {
|
|
235
|
+
const t = P(e).length;
|
|
236
236
|
return t > 0 ? `${t} 个工具调用` : "规划记录";
|
|
237
237
|
}
|
|
238
238
|
function it(e) {
|
|
@@ -264,7 +264,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
264
264
|
return null;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function S(e) {
|
|
268
268
|
const t = Ct(e), i = e.resultText?.trim() || "";
|
|
269
269
|
if (!i) return "";
|
|
270
270
|
if (t === "list_kbs") {
|
|
@@ -281,19 +281,19 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
281
281
|
const t = e.resultText?.trim() || "";
|
|
282
282
|
return t ? V(t) ?? t : null;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function F(e) {
|
|
285
285
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
286
286
|
}
|
|
287
287
|
function ot(e) {
|
|
288
288
|
return /<(table|html|body|svg|div|span|img|p|iframe)[\s>]/i.test(e);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function R(e) {
|
|
291
291
|
const t = q(e);
|
|
292
292
|
if (typeof t == "string") {
|
|
293
293
|
const i = t.trim();
|
|
294
294
|
return /^data:image\//i.test(i) || /\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(i) ? i : null;
|
|
295
295
|
}
|
|
296
|
-
if (
|
|
296
|
+
if (F(t)) {
|
|
297
297
|
const i = [t.url, t.uri, t.path].find(
|
|
298
298
|
(n) => typeof n == "string" && /^data:image\//i.test(n)
|
|
299
299
|
);
|
|
@@ -301,11 +301,11 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
301
301
|
}
|
|
302
302
|
return null;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function E(e) {
|
|
305
305
|
const t = q(e);
|
|
306
306
|
if (typeof t == "string" && ot(t.trim()))
|
|
307
307
|
return t;
|
|
308
|
-
if (
|
|
308
|
+
if (F(t)) {
|
|
309
309
|
const i = [t.html, t.content, t.markup].find(
|
|
310
310
|
(n) => typeof n == "string" && ot(n)
|
|
311
311
|
);
|
|
@@ -314,7 +314,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
314
314
|
return null;
|
|
315
315
|
}
|
|
316
316
|
function lt(e) {
|
|
317
|
-
return !Array.isArray(e) || e.length === 0 || !e.every((t) =>
|
|
317
|
+
return !Array.isArray(e) || e.length === 0 || !e.every((t) => F(t)) ? null : e;
|
|
318
318
|
}
|
|
319
319
|
function y(e) {
|
|
320
320
|
const t = q(e);
|
|
@@ -328,10 +328,10 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
328
328
|
const n = [...new Set(i.flatMap((l) => Object.keys(l)))];
|
|
329
329
|
return n.length > 0 ? { columns: n, rows: i } : null;
|
|
330
330
|
}
|
|
331
|
-
if (!
|
|
331
|
+
if (!F(t)) return null;
|
|
332
332
|
if (Array.isArray(t.columns) && Array.isArray(t.rows) && t.columns.every((n) => typeof n == "string")) {
|
|
333
333
|
const n = t.columns, l = t.rows.map(
|
|
334
|
-
(c) =>
|
|
334
|
+
(c) => F(c) ? c : Array.isArray(c) ? Object.fromEntries(
|
|
335
335
|
n.map((f, p) => [f, c[p]])
|
|
336
336
|
) : { value: c }
|
|
337
337
|
);
|
|
@@ -349,8 +349,8 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
351
|
function at(e) {
|
|
352
|
-
const t =
|
|
353
|
-
return t && i && t.trim() === i ? !1 : !!(
|
|
352
|
+
const t = S(e), i = e.summary?.trim();
|
|
353
|
+
return t && i && t.trim() === i ? !1 : !!(R(e) || E(e) || y(e) || t);
|
|
354
354
|
}
|
|
355
355
|
function ct(e) {
|
|
356
356
|
if (e == null) return "-";
|
|
@@ -373,7 +373,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
373
373
|
const i = Tt();
|
|
374
374
|
for (const n of i) {
|
|
375
375
|
const l = T.get(n);
|
|
376
|
-
!l || !
|
|
376
|
+
!l || !X(n, e) || l.scrollTo({
|
|
377
377
|
top: l.scrollHeight,
|
|
378
378
|
behavior: e ? "auto" : "smooth"
|
|
379
379
|
});
|
|
@@ -386,7 +386,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
386
386
|
});
|
|
387
387
|
for (const l of i) {
|
|
388
388
|
const c = T.get(l);
|
|
389
|
-
!c || !
|
|
389
|
+
!c || !X(l, e) || c.scrollTo({
|
|
390
390
|
top: c.scrollHeight,
|
|
391
391
|
behavior: "auto"
|
|
392
392
|
});
|
|
@@ -396,7 +396,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
396
396
|
bt(
|
|
397
397
|
() => h.steps,
|
|
398
398
|
() => {
|
|
399
|
-
if (
|
|
399
|
+
if (St.value) {
|
|
400
400
|
const e = h.steps.find((t) => t.status === "active");
|
|
401
401
|
e && !(e.id in _.value) && (_.value = {
|
|
402
402
|
..._.value,
|
|
@@ -408,40 +408,40 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
408
408
|
},
|
|
409
409
|
{ deep: !0 }
|
|
410
410
|
);
|
|
411
|
-
const
|
|
411
|
+
const z = D({}), A = D({});
|
|
412
412
|
bt(
|
|
413
413
|
() => h.steps,
|
|
414
414
|
(e) => {
|
|
415
|
-
const t = { ...
|
|
415
|
+
const t = { ...z.value }, i = { ...A.value };
|
|
416
416
|
for (const n of e) {
|
|
417
417
|
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) {
|
|
418
418
|
const l = new Set(i[n.id] || []);
|
|
419
419
|
for (const c of n.files)
|
|
420
|
-
|
|
420
|
+
Mt(c.path).forEach(
|
|
421
421
|
(f) => l.add(f)
|
|
422
422
|
);
|
|
423
423
|
i[n.id] = [...l];
|
|
424
424
|
}
|
|
425
425
|
!n.files?.length && i[n.id] && delete i[n.id];
|
|
426
426
|
}
|
|
427
|
-
|
|
427
|
+
z.value = t, A.value = i;
|
|
428
428
|
},
|
|
429
429
|
{ deep: !0, immediate: !0 }
|
|
430
430
|
);
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
...
|
|
431
|
+
function Ot(e, t) {
|
|
432
|
+
z.value = {
|
|
433
|
+
...z.value,
|
|
434
434
|
[e]: t
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
function Dt(e, t) {
|
|
438
|
-
t &&
|
|
438
|
+
t && Ot(e, t.id);
|
|
439
439
|
}
|
|
440
440
|
function k(e) {
|
|
441
|
-
const t =
|
|
441
|
+
const t = z.value[e.id];
|
|
442
442
|
return e.files?.find((i) => i.id === t) ?? e.files?.[0] ?? null;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Mt(e) {
|
|
445
445
|
const t = e.split("/").filter(Boolean), i = [];
|
|
446
446
|
let n = "";
|
|
447
447
|
return t.slice(0, -1).forEach((l) => {
|
|
@@ -451,14 +451,14 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
451
451
|
function ut(e, t) {
|
|
452
452
|
return (A.value[e] || []).includes(t);
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Nt(e, t) {
|
|
455
455
|
const i = new Set(A.value[e] || []);
|
|
456
456
|
i.has(t) ? i.delete(t) : i.add(t), A.value = {
|
|
457
457
|
...A.value,
|
|
458
458
|
[e]: [...i]
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Ht(e, t) {
|
|
462
462
|
const i = /* @__PURE__ */ new Map(), n = (p, $, v) => (i.has(p) || i.set(p, {
|
|
463
463
|
path: p,
|
|
464
464
|
name: $,
|
|
@@ -468,12 +468,12 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
468
468
|
}), i.get(p)), l = n("", "root", -1);
|
|
469
469
|
for (const p of t) {
|
|
470
470
|
const $ = p.path.split("/").filter(Boolean);
|
|
471
|
-
let v = "",
|
|
471
|
+
let v = "", O = l;
|
|
472
472
|
$.slice(0, -1).forEach((b, g) => {
|
|
473
473
|
v += `/${b}`;
|
|
474
474
|
const Lt = n(v, b, g);
|
|
475
|
-
|
|
476
|
-
}),
|
|
475
|
+
O.directoryChildren.includes(v) || O.directoryChildren.push(v), O = Lt;
|
|
476
|
+
}), O.files.push(p);
|
|
477
477
|
}
|
|
478
478
|
const c = [], f = (p) => {
|
|
479
479
|
const $ = i.get(p);
|
|
@@ -529,7 +529,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
529
529
|
return (e, t) => (r(), o("div", {
|
|
530
530
|
class: B(["thinking-bar", [
|
|
531
531
|
{ "thinking-bar--embedded": w.embedded },
|
|
532
|
-
{ "thinking-bar--open":
|
|
532
|
+
{ "thinking-bar--open": G.value },
|
|
533
533
|
{ "thinking-bar--centered": w.centered },
|
|
534
534
|
{ "thinking-bar--corner": !w.centered && !w.embedded }
|
|
535
535
|
]])
|
|
@@ -538,11 +538,11 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
538
538
|
class: "thinking-bar-grid",
|
|
539
539
|
"aria-hidden": "true"
|
|
540
540
|
}, null, -1)),
|
|
541
|
-
s("div",
|
|
542
|
-
s("div",
|
|
543
|
-
t[1] || (t[1] = s("span", { class: "thinking-bar-kicker" }, "
|
|
544
|
-
s("span",
|
|
545
|
-
|
|
541
|
+
s("div", Qt, [
|
|
542
|
+
s("div", Xt, [
|
|
543
|
+
t[1] || (t[1] = s("span", { class: "thinking-bar-kicker" }, "Spotlight", -1)),
|
|
544
|
+
s("span", Yt, a(xt.value), 1),
|
|
545
|
+
Y.value ? (r(), o("span", Zt, a(Y.value), 1)) : u("", !0)
|
|
546
546
|
]),
|
|
547
547
|
s("div", te, [
|
|
548
548
|
s("span", ee, [
|
|
@@ -574,14 +574,14 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
574
574
|
key: i.id,
|
|
575
575
|
class: B(["thinking-bar-step", [i.status]])
|
|
576
576
|
}, [
|
|
577
|
-
i.status === "active" ? (r(), Vt(
|
|
577
|
+
i.status === "active" ? (r(), Vt(Gt, {
|
|
578
578
|
key: 0,
|
|
579
579
|
class: "thinking-bar-step-beam",
|
|
580
580
|
size: 88,
|
|
581
581
|
duration: 6,
|
|
582
582
|
"border-width": 1.5,
|
|
583
|
-
"color-from": "#
|
|
584
|
-
"color-to": "#
|
|
583
|
+
"color-from": "#0A84FF",
|
|
584
|
+
"color-to": "#64D2FF"
|
|
585
585
|
})) : u("", !0),
|
|
586
586
|
s("div", se, [
|
|
587
587
|
s("span", re, a(Bt(i.status)), 1),
|
|
@@ -593,24 +593,24 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
593
593
|
class: "thinking-bar-step-body",
|
|
594
594
|
onScrollPassive: (n) => wt(i.id, n)
|
|
595
595
|
}, [
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
N(Kt)(i.id) ? (r(), o("div", ce, [
|
|
597
|
+
Et(i) ? (r(), o("details", ue, [
|
|
598
598
|
s("summary", de, [
|
|
599
599
|
t[5] || (t[5] = s("span", { class: "thinking-bar-execution-details-title" }, "调用工具", -1)),
|
|
600
|
-
s("span", he, a(
|
|
600
|
+
s("span", he, a(zt(i)), 1),
|
|
601
601
|
t[6] || (t[6] = s("span", { class: "thinking-bar-execution-details-caret" }, "▾", -1))
|
|
602
602
|
]),
|
|
603
603
|
s("div", ge, [
|
|
604
|
-
|
|
605
|
-
(r(!0), o(d, null, m(
|
|
604
|
+
I(i) ? (r(), o("pre", ke, a(I(i)), 1)) : u("", !0),
|
|
605
|
+
(r(!0), o(d, null, m(P(i), (n) => (r(), o("details", {
|
|
606
606
|
key: n.id,
|
|
607
607
|
class: "thinking-bar-tool-call",
|
|
608
608
|
open: rt(n)
|
|
609
609
|
}, [
|
|
610
610
|
s("summary", fe, [
|
|
611
611
|
s("div", me, [
|
|
612
|
-
s("span", pe, a(
|
|
613
|
-
n.name !==
|
|
612
|
+
s("span", pe, a(H(n)), 1),
|
|
613
|
+
n.name !== H(n) ? (r(), o("span", ye, a(n.name), 1)) : u("", !0)
|
|
614
614
|
]),
|
|
615
615
|
s("div", _e, [
|
|
616
616
|
s("span", {
|
|
@@ -624,26 +624,26 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
624
624
|
t[8] || (t[8] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
|
|
625
625
|
s("pre", Te, a(n.argsText), 1)
|
|
626
626
|
])) : u("", !0),
|
|
627
|
-
n.summary?.trim() ? (r(), o("div",
|
|
627
|
+
n.summary?.trim() ? (r(), o("div", xe, [
|
|
628
628
|
t[9] || (t[9] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行摘要 ", -1)),
|
|
629
|
-
s("pre",
|
|
629
|
+
s("pre", Se, a(n.summary), 1)
|
|
630
630
|
])) : u("", !0),
|
|
631
631
|
at(n) ? (r(), o("div", $e, [
|
|
632
632
|
t[10] || (t[10] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
|
|
633
|
-
|
|
633
|
+
R(n) ? (r(), o("div", Ae, [
|
|
634
634
|
s("img", {
|
|
635
635
|
class: "thinking-bar-tool-result-image",
|
|
636
|
-
src:
|
|
636
|
+
src: R(n) || "",
|
|
637
637
|
alt: n.name
|
|
638
638
|
}, null, 8, Be)
|
|
639
|
-
])) :
|
|
639
|
+
])) : E(n) ? (r(), o("iframe", {
|
|
640
640
|
key: 1,
|
|
641
641
|
class: "thinking-bar-tool-result-html",
|
|
642
|
-
srcdoc:
|
|
642
|
+
srcdoc: E(n) || "",
|
|
643
643
|
title: n.name,
|
|
644
644
|
sandbox: ""
|
|
645
|
-
}, null, 8, Ce)) : y(n) ? (r(), o("div",
|
|
646
|
-
s("table",
|
|
645
|
+
}, null, 8, Ce)) : y(n) ? (r(), o("div", Fe, [
|
|
646
|
+
s("table", Re, [
|
|
647
647
|
s("thead", null, [
|
|
648
648
|
s("tr", null, [
|
|
649
649
|
(r(!0), o(d, null, m(y(
|
|
@@ -663,17 +663,17 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
663
663
|
]))), 128))
|
|
664
664
|
])
|
|
665
665
|
])
|
|
666
|
-
])) :
|
|
666
|
+
])) : S(n) ? (r(), o("pre", Ee, a(S(n)), 1)) : u("", !0)
|
|
667
667
|
])) : u("", !0),
|
|
668
|
-
st(n.trace) ? (r(), o("div",
|
|
668
|
+
st(n.trace) ? (r(), o("div", ze, [
|
|
669
669
|
t[11] || (t[11] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 执行轨迹 ", -1)),
|
|
670
|
-
s("pre",
|
|
670
|
+
s("pre", Oe, a(st(n.trace)), 1)
|
|
671
671
|
])) : u("", !0),
|
|
672
672
|
n.errorCode ? (r(), o("div", De, [
|
|
673
673
|
t[12] || (t[12] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 错误码 ", -1)),
|
|
674
|
-
s("pre",
|
|
674
|
+
s("pre", Me, a(n.errorCode), 1)
|
|
675
675
|
])) : u("", !0),
|
|
676
|
-
|
|
676
|
+
Ft(n) && nt(i).length > 0 ? (r(), o("div", Ne, [
|
|
677
677
|
t[16] || (t[16] = s("div", { class: "thinking-bar-nested-tools-label" }, " 知识库内部步骤 ", -1)),
|
|
678
678
|
(r(!0), o(d, null, m(nt(
|
|
679
679
|
i
|
|
@@ -681,25 +681,25 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
681
681
|
key: l.id,
|
|
682
682
|
class: "thinking-bar-tool-call thinking-bar-tool-call--nested"
|
|
683
683
|
}, [
|
|
684
|
-
s("summary",
|
|
684
|
+
s("summary", He, [
|
|
685
685
|
s("div", Le, [
|
|
686
|
-
s("span", je, a(
|
|
686
|
+
s("span", je, a(H(l)), 1)
|
|
687
687
|
]),
|
|
688
|
-
s("div",
|
|
688
|
+
s("div", Ie, [
|
|
689
689
|
s("span", {
|
|
690
690
|
class: B(["thinking-bar-tool-call-status", `is-${l.status}`])
|
|
691
691
|
}, a(it(l.status)), 3),
|
|
692
692
|
t[13] || (t[13] = s("span", { class: "thinking-bar-tool-call-caret" }, "▾", -1))
|
|
693
693
|
])
|
|
694
694
|
]),
|
|
695
|
-
s("div",
|
|
695
|
+
s("div", Pe, [
|
|
696
696
|
l.argsText?.trim() ? (r(), o("div", Ve, [
|
|
697
697
|
t[14] || (t[14] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 请求参数 ", -1)),
|
|
698
698
|
s("pre", qe, a(l.argsText), 1)
|
|
699
699
|
])) : u("", !0),
|
|
700
|
-
|
|
700
|
+
S(l) ? (r(), o("div", Ke, [
|
|
701
701
|
t[15] || (t[15] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 接口结果 ", -1)),
|
|
702
|
-
s("pre", Je, a(
|
|
702
|
+
s("pre", Je, a(S(l)), 1)
|
|
703
703
|
])) : u("", !0)
|
|
704
704
|
])
|
|
705
705
|
]))), 128))
|
|
@@ -718,14 +718,14 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
718
718
|
])
|
|
719
719
|
])) : u("", !0)
|
|
720
720
|
])) : (r(), o(d, { key: 1 }, [
|
|
721
|
-
i.chatItems && i.chatItems.length > 0 ? (r(), o("div",
|
|
721
|
+
i.chatItems && i.chatItems.length > 0 ? (r(), o("div", Ge, [
|
|
722
722
|
(r(!0), o(d, null, m(i.chatItems, (n) => (r(), o("div", {
|
|
723
723
|
key: n.id,
|
|
724
724
|
class: "thinking-bar-chat-item"
|
|
725
725
|
}, [
|
|
726
|
-
n.type === "text" && n.text.trim() ? (r(), o("div",
|
|
727
|
-
W(
|
|
728
|
-
"model-value":
|
|
726
|
+
n.type === "text" && n.text.trim() ? (r(), o("div", Qe, [
|
|
727
|
+
W(N(mt), {
|
|
728
|
+
"model-value": N(Jt)(n.text),
|
|
729
729
|
theme: "dark",
|
|
730
730
|
"preview-theme": "github",
|
|
731
731
|
"code-theme": "github",
|
|
@@ -736,9 +736,9 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
736
736
|
class: "thinking-bar-tool-call",
|
|
737
737
|
open: rt(n.toolCall)
|
|
738
738
|
}, [
|
|
739
|
-
s("summary",
|
|
739
|
+
s("summary", Ye, [
|
|
740
740
|
s("div", Ze, [
|
|
741
|
-
s("span", tn, a(
|
|
741
|
+
s("span", tn, a(H(n.toolCall)), 1)
|
|
742
742
|
]),
|
|
743
743
|
s("div", en, [
|
|
744
744
|
s("span", {
|
|
@@ -750,16 +750,16 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
750
750
|
s("div", nn, [
|
|
751
751
|
at(n.toolCall) ? (r(), o("div", sn, [
|
|
752
752
|
t[19] || (t[19] = s("div", { class: "thinking-bar-tool-call-block-title" }, " 结果 ", -1)),
|
|
753
|
-
|
|
753
|
+
R(n.toolCall) ? (r(), o("div", rn, [
|
|
754
754
|
s("img", {
|
|
755
755
|
class: "thinking-bar-tool-result-image",
|
|
756
|
-
src:
|
|
756
|
+
src: R(n.toolCall) || "",
|
|
757
757
|
alt: n.toolCall.name
|
|
758
758
|
}, null, 8, on)
|
|
759
|
-
])) :
|
|
759
|
+
])) : E(n.toolCall) ? (r(), o("iframe", {
|
|
760
760
|
key: 1,
|
|
761
761
|
class: "thinking-bar-tool-result-html",
|
|
762
|
-
srcdoc:
|
|
762
|
+
srcdoc: E(n.toolCall) || "",
|
|
763
763
|
title: n.toolCall.name,
|
|
764
764
|
sandbox: ""
|
|
765
765
|
}, null, 8, ln)) : y(n.toolCall) ? (r(), o("div", an, [
|
|
@@ -785,14 +785,14 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
785
785
|
]))), 128))
|
|
786
786
|
])
|
|
787
787
|
])
|
|
788
|
-
])) :
|
|
788
|
+
])) : S(n.toolCall) ? (r(), o("pre", un, a(S(n.toolCall)), 1)) : u("", !0)
|
|
789
789
|
])) : u("", !0)
|
|
790
790
|
])
|
|
791
|
-
], 8,
|
|
791
|
+
], 8, Xe)) : u("", !0)
|
|
792
792
|
]))), 128))
|
|
793
793
|
])) : i.content ? (r(), o("div", dn, [
|
|
794
|
-
W(
|
|
795
|
-
"model-value":
|
|
794
|
+
W(N(mt), {
|
|
795
|
+
"model-value": N(Ut)(i.content ?? ""),
|
|
796
796
|
theme: "dark",
|
|
797
797
|
"preview-theme": "github",
|
|
798
798
|
"code-theme": "github",
|
|
@@ -826,7 +826,7 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
826
826
|
s("div", _n, [
|
|
827
827
|
t[21] || (t[21] = s("div", { class: "thinking-bar-file-tree-head" }, "文件系统", -1)),
|
|
828
828
|
s("div", vn, [
|
|
829
|
-
(r(!0), o(d, null, m(
|
|
829
|
+
(r(!0), o(d, null, m(Ht(i.id, i.files), (n) => (r(), o(d, {
|
|
830
830
|
key: `${i.id}:${n.path}`
|
|
831
831
|
}, [
|
|
832
832
|
n.type === "directory" ? (r(), o("div", wn, [
|
|
@@ -836,11 +836,11 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
836
836
|
style: ft({
|
|
837
837
|
paddingLeft: `${n.depth * 14 + 10}px`
|
|
838
838
|
}),
|
|
839
|
-
onClick: (l) =>
|
|
839
|
+
onClick: (l) => Nt(i.id, n.path)
|
|
840
840
|
}, [
|
|
841
|
-
s("span",
|
|
841
|
+
s("span", xn, a(ut(i.id, n.path) ? "▾" : "▸"), 1),
|
|
842
842
|
t[20] || (t[20] = s("span", { class: "thinking-bar-tree-icon" }, "📁", -1)),
|
|
843
|
-
s("span",
|
|
843
|
+
s("span", Sn, a(n.name), 1)
|
|
844
844
|
], 12, Tn)
|
|
845
845
|
])) : (r(), o("button", {
|
|
846
846
|
key: 1,
|
|
@@ -859,27 +859,27 @@ const Gt = { class: "thinking-bar-header" }, Qt = { class: "thinking-bar-title-s
|
|
|
859
859
|
]),
|
|
860
860
|
s("div", Cn, [
|
|
861
861
|
k(i) ? (r(), o(d, { key: 0 }, [
|
|
862
|
-
s("div",
|
|
863
|
-
s("div",
|
|
864
|
-
s("span",
|
|
862
|
+
s("div", Fn, [
|
|
863
|
+
s("div", Rn, [
|
|
864
|
+
s("span", En, a(gt(k(i)?.path || "")), 1),
|
|
865
865
|
s("span", null, a(k(i)?.path), 1)
|
|
866
866
|
]),
|
|
867
|
-
U(k(i)?.path || "") ? (r(), o("span",
|
|
867
|
+
U(k(i)?.path || "") ? (r(), o("span", zn, " HTML 预览 ")) : u("", !0)
|
|
868
868
|
]),
|
|
869
|
-
dt(k(i)?.path || "") ? (r(), o("div",
|
|
869
|
+
dt(k(i)?.path || "") ? (r(), o("div", On, [
|
|
870
870
|
ht(k(i)) ? (r(), o("img", {
|
|
871
871
|
key: 0,
|
|
872
872
|
class: "thinking-bar-image-preview",
|
|
873
873
|
src: ht(k(i)) || "",
|
|
874
874
|
alt: k(i)?.name || "图片预览"
|
|
875
|
-
}, null, 8, Dn)) : (r(), o("div",
|
|
875
|
+
}, null, 8, Dn)) : (r(), o("div", Mn, " 当前图片文件没有可直接渲染的内容。 "))
|
|
876
876
|
])) : U(k(i)?.path || "") ? (r(), o("iframe", {
|
|
877
877
|
key: 1,
|
|
878
878
|
class: "thinking-bar-html-preview",
|
|
879
879
|
srcdoc: J(k(i)),
|
|
880
880
|
title: k(i)?.path,
|
|
881
881
|
sandbox: ""
|
|
882
|
-
}, null, 8,
|
|
882
|
+
}, null, 8, Nn)) : (r(), o("pre", Hn, a(J(k(i))), 1))
|
|
883
883
|
], 64)) : (r(), o("div", Ln, " 还没选中文件,左边点一个看看。 "))
|
|
884
884
|
])
|
|
885
885
|
])
|