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