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