@glodon-aiot/agent-cli-ui 3.0.10 → 3.0.11-alpha.1
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/es/Dialog/AgentChat/index.mjs +67 -67
- package/dist/es/Dialog/HistoryItem/index.mjs +109 -109
- package/dist/es/Dialog/SearchReference/index.mjs +64 -53
- package/dist/es/index.mjs +2 -2
- package/dist/lib/index.js +30 -30
- package/dist/src/Dialog/SearchReference/index.d.ts +3 -3
- package/package.json +3 -3
- /package/dist/es/{Dialog/HistoryItem → assets}/think.svg.mjs +0 -0
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as d, useContext as
|
|
1
|
+
import { jsxs as r, jsx as e } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { memo as d, useContext as se, useState as re } from "react";
|
|
3
3
|
import c from "../../InputProgress/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { IHistoryRole as
|
|
7
|
-
import
|
|
8
|
-
import { Popover as
|
|
9
|
-
import
|
|
4
|
+
import ae from "../SessionRefer/index.mjs";
|
|
5
|
+
import oe from "../SessionAction/index.mjs";
|
|
6
|
+
import { IHistoryRole as Q, IThinkingStatus as q } from "@glodon-aiot/apis";
|
|
7
|
+
import de from "../../FileItem/index.mjs";
|
|
8
|
+
import { Popover as ce, Space as D, Button as V, Row as pe, Col as me, Collapse as W, Divider as ue, message as G } from "antd";
|
|
9
|
+
import he from "../SearchReference/index.mjs";
|
|
10
10
|
import "./style.less.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import ge from "../HistoryContent/index.mjs";
|
|
12
|
+
import Ne from "../../components/Markdown/index.mjs";
|
|
13
|
+
import fe from "../../node_modules/classnames/index.mjs";
|
|
14
14
|
import p from "../../Iconfont/index.mjs";
|
|
15
|
-
import { CheckOutlined as
|
|
15
|
+
import { CheckOutlined as K, CloseOutlined as X, LoadingOutlined as ye } from "@ant-design/icons";
|
|
16
16
|
import m from "../../components/JsonDisplay/index.mjs";
|
|
17
|
-
import
|
|
17
|
+
import Le from "../../context.mjs";
|
|
18
18
|
import Ce from "../SessionRelated/index.mjs";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { escapeSlash as
|
|
23
|
-
const
|
|
19
|
+
import ve from "../ReferCollapse/index.mjs";
|
|
20
|
+
import Re from "../../node_modules/copy-to-clipboard/index.mjs";
|
|
21
|
+
import be from "../../assets/think.svg.mjs";
|
|
22
|
+
import { escapeSlash as Ee } from "../../utils/index.mjs";
|
|
23
|
+
const Se = (o) => {
|
|
24
24
|
if (!o)
|
|
25
25
|
return o;
|
|
26
26
|
try {
|
|
27
27
|
return JSON.parse(o);
|
|
28
|
-
} catch (
|
|
28
|
+
} catch (a) {
|
|
29
29
|
return o;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
d(
|
|
33
|
-
const
|
|
34
|
-
d(
|
|
31
|
+
}, ke = d(he), Y = d(ae), L = d(Ne);
|
|
32
|
+
d(ge);
|
|
33
|
+
const Te = d(de);
|
|
34
|
+
d(ve);
|
|
35
35
|
const u = (o) => {
|
|
36
36
|
if (!o)
|
|
37
37
|
return !1;
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
return !(
|
|
41
|
-
} catch (
|
|
39
|
+
const a = JSON.parse(o);
|
|
40
|
+
return !(a != null && a.code && (a.code < 200 || a.code > 300));
|
|
41
|
+
} catch (a) {
|
|
42
42
|
return !0;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, Z = (o) => {
|
|
45
45
|
var t;
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
var
|
|
46
|
+
const a = JSON.parse(JSON.stringify(o)) || [], l = (t = a == null ? void 0 : a.pop()) == null ? void 0 : t.pop();
|
|
47
|
+
return l ? (l == null ? void 0 : l.type) === "BEFORE_CALL" || (l == null ? void 0 : l.type) === "FUNCTION_CALL" : !1;
|
|
48
|
+
}, Ye = (o) => {
|
|
49
|
+
var b, E, S, k, T, A, O, x, F, _;
|
|
50
50
|
const {
|
|
51
|
-
application:
|
|
52
|
-
currentSession:
|
|
51
|
+
application: a,
|
|
52
|
+
currentSession: l,
|
|
53
53
|
history: t,
|
|
54
54
|
isLastHistory: h,
|
|
55
|
-
onRelatedClick:
|
|
56
|
-
onAgainClick:
|
|
57
|
-
isLoading:
|
|
55
|
+
onRelatedClick: $,
|
|
56
|
+
onAgainClick: ee,
|
|
57
|
+
isLoading: Ae,
|
|
58
58
|
docViewerUrl: g,
|
|
59
59
|
onEditClick: N
|
|
60
60
|
} = o, {
|
|
61
|
-
debug:
|
|
61
|
+
debug: C,
|
|
62
62
|
transform: i,
|
|
63
63
|
popupContainer: f
|
|
64
|
-
} =
|
|
65
|
-
Panel:
|
|
66
|
-
} =
|
|
67
|
-
|
|
64
|
+
} = se(Le), v = t.role === Q.User, R = t.role === Q.Robot, {
|
|
65
|
+
Panel: te
|
|
66
|
+
} = W, [y, ne] = re(!0), ie = () => {
|
|
67
|
+
G.config({
|
|
68
68
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
69
|
-
}),
|
|
69
|
+
}), Re(t.content), G.success("复制成功");
|
|
70
70
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
className:
|
|
71
|
+
return /* @__PURE__ */ r("div", {
|
|
72
|
+
className: fe({
|
|
73
73
|
"history-item": !0,
|
|
74
74
|
"history-item__user": v,
|
|
75
75
|
"history-item__bot": R
|
|
76
76
|
}),
|
|
77
|
-
children: [v && /* @__PURE__ */
|
|
77
|
+
children: [v && /* @__PURE__ */ r("div", {
|
|
78
78
|
className: "history-item-user",
|
|
79
79
|
children: [/* @__PURE__ */ e("div", {
|
|
80
80
|
className: "item-user-panel",
|
|
81
|
-
children: /* @__PURE__ */ e(
|
|
81
|
+
children: /* @__PURE__ */ e(ce, {
|
|
82
82
|
placement: "topLeft",
|
|
83
83
|
overlayStyle: {
|
|
84
84
|
padding: 4
|
|
85
85
|
},
|
|
86
86
|
overlayClassName: "session-item-overlay-popover",
|
|
87
87
|
getPopupContainer: (n) => n.parentNode,
|
|
88
|
-
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */
|
|
88
|
+
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(D, {
|
|
89
89
|
className: "item-user-popover",
|
|
90
90
|
size: 4,
|
|
91
91
|
children: [(i == null ? void 0 : i.userEdit) && /* @__PURE__ */ e("div", {
|
|
92
92
|
className: "user-pannel-item",
|
|
93
93
|
onClick: () => N == null ? void 0 : N(t.content),
|
|
94
|
-
children: /* @__PURE__ */ e(
|
|
94
|
+
children: /* @__PURE__ */ e(V, {
|
|
95
95
|
type: "link",
|
|
96
96
|
size: "small",
|
|
97
97
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -100,8 +100,8 @@ const u = (o) => {
|
|
|
100
100
|
})
|
|
101
101
|
}), (i == null ? void 0 : i.userCopy) && /* @__PURE__ */ e("div", {
|
|
102
102
|
className: "user-pannel-item",
|
|
103
|
-
onClick:
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
103
|
+
onClick: ie,
|
|
104
|
+
children: /* @__PURE__ */ e(V, {
|
|
105
105
|
type: "link",
|
|
106
106
|
size: "small",
|
|
107
107
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -117,24 +117,24 @@ const u = (o) => {
|
|
|
117
117
|
className: "user-panel-main",
|
|
118
118
|
children: /* @__PURE__ */ e("span", {
|
|
119
119
|
className: "item-user-content",
|
|
120
|
-
children: /* @__PURE__ */ e(
|
|
120
|
+
children: /* @__PURE__ */ e(L, {
|
|
121
121
|
showLatex: !1,
|
|
122
|
-
children:
|
|
122
|
+
children: Ee(t.content)
|
|
123
123
|
})
|
|
124
124
|
})
|
|
125
125
|
})
|
|
126
126
|
})
|
|
127
127
|
}), /* @__PURE__ */ e("div", {
|
|
128
128
|
className: "item-user-file",
|
|
129
|
-
children: /* @__PURE__ */ e(
|
|
129
|
+
children: /* @__PURE__ */ e(pe, {
|
|
130
130
|
gutter: [12, 12],
|
|
131
131
|
justify: "end",
|
|
132
132
|
wrap: !0,
|
|
133
|
-
children: (
|
|
133
|
+
children: (b = t.files) == null ? void 0 : b.map((n) => /* @__PURE__ */ e(me, {
|
|
134
134
|
className: "user-file-col",
|
|
135
|
-
children: /* @__PURE__ */ e(
|
|
135
|
+
children: /* @__PURE__ */ e(Te, {
|
|
136
136
|
docViewerUrl: g,
|
|
137
|
-
currentSession:
|
|
137
|
+
currentSession: l,
|
|
138
138
|
file: n
|
|
139
139
|
})
|
|
140
140
|
}, n.id))
|
|
@@ -142,51 +142,51 @@ const u = (o) => {
|
|
|
142
142
|
})]
|
|
143
143
|
}), R && /* @__PURE__ */ e("div", {
|
|
144
144
|
className: "history-item-bot",
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ r("div", {
|
|
146
146
|
className: "bot-content-wrapper",
|
|
147
|
-
children: [
|
|
147
|
+
children: [a.type === 2 && /* @__PURE__ */ r("div", {
|
|
148
148
|
className: "item-bot-plugin",
|
|
149
|
-
children: [/* @__PURE__ */ e(
|
|
149
|
+
children: [/* @__PURE__ */ e(W, {
|
|
150
150
|
ghost: !0,
|
|
151
151
|
expandIconPosition: "right",
|
|
152
|
-
children: (
|
|
153
|
-
var
|
|
154
|
-
return /* @__PURE__ */
|
|
155
|
-
collapsible:
|
|
156
|
-
showArrow:
|
|
157
|
-
header: /* @__PURE__ */
|
|
152
|
+
children: (E = t.actions) == null ? void 0 : E.map((n, le) => {
|
|
153
|
+
var I, U, z, j, B, w, M, J, P, H;
|
|
154
|
+
return /* @__PURE__ */ r(te, {
|
|
155
|
+
collapsible: C ? "header" : "icon",
|
|
156
|
+
showArrow: C,
|
|
157
|
+
header: /* @__PURE__ */ r(D, {
|
|
158
158
|
size: 8,
|
|
159
159
|
style: {
|
|
160
160
|
width: "100%"
|
|
161
161
|
},
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ r("span", {
|
|
163
163
|
className: "bot-plugin-status",
|
|
164
|
-
children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((
|
|
164
|
+
children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((I = n.find((s) => s.type === "RESULT")) == null ? void 0 : I.data.result) && /* @__PURE__ */ e("span", {
|
|
165
165
|
className: "plugin-status-success",
|
|
166
|
-
children: /* @__PURE__ */ e(
|
|
166
|
+
children: /* @__PURE__ */ e(K, {})
|
|
167
167
|
}), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
168
168
|
className: "plugin-status-error",
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
170
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((
|
|
169
|
+
children: /* @__PURE__ */ e(X, {})
|
|
170
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((U = n.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
|
|
171
171
|
className: "plugin-status-error",
|
|
172
|
-
children: /* @__PURE__ */ e(
|
|
172
|
+
children: /* @__PURE__ */ e(X, {})
|
|
173
173
|
}), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
174
174
|
className: "plugin-status-loading",
|
|
175
|
-
children: /* @__PURE__ */ e(
|
|
175
|
+
children: /* @__PURE__ */ e(ye, {})
|
|
176
176
|
})]
|
|
177
177
|
}), /* @__PURE__ */ e("span", {
|
|
178
178
|
className: "bot-plugin-title",
|
|
179
|
-
children: (
|
|
179
|
+
children: (z = n[n.length - 1].data) == null ? void 0 : z.pluginName
|
|
180
180
|
}), /* @__PURE__ */ e("span", {
|
|
181
181
|
className: "bot-plugin-action",
|
|
182
|
-
children: (
|
|
182
|
+
children: (j = n[n.length - 1].data) == null ? void 0 : j.funcName
|
|
183
183
|
}), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
184
184
|
className: "bot-plugin-result",
|
|
185
185
|
children: "执行中"
|
|
186
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((
|
|
186
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((B = n.find((s) => s.type === "RESULT")) == null ? void 0 : B.data.result) && /* @__PURE__ */ e("span", {
|
|
187
187
|
className: "bot-plugin-result",
|
|
188
188
|
children: "执行成功"
|
|
189
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((
|
|
189
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((w = n.find((s) => s.type === "RESULT")) == null ? void 0 : w.data.result) && /* @__PURE__ */ e("span", {
|
|
190
190
|
className: "bot-plugin-result",
|
|
191
191
|
children: "执行失败"
|
|
192
192
|
}), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
@@ -200,7 +200,7 @@ const u = (o) => {
|
|
|
200
200
|
}), /* @__PURE__ */ e("div", {
|
|
201
201
|
className: "bot-plugin-json",
|
|
202
202
|
children: /* @__PURE__ */ e(m, {
|
|
203
|
-
josn: (
|
|
203
|
+
josn: (M = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : M.data.thought
|
|
204
204
|
})
|
|
205
205
|
}), /* @__PURE__ */ e("div", {
|
|
206
206
|
className: "bot-plugin-content",
|
|
@@ -208,7 +208,7 @@ const u = (o) => {
|
|
|
208
208
|
}), /* @__PURE__ */ e("div", {
|
|
209
209
|
className: "bot-plugin-json",
|
|
210
210
|
children: /* @__PURE__ */ e(m, {
|
|
211
|
-
josn: (
|
|
211
|
+
josn: (J = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : J.data.parameters
|
|
212
212
|
})
|
|
213
213
|
}), /* @__PURE__ */ e("div", {
|
|
214
214
|
className: "bot-plugin-content",
|
|
@@ -216,7 +216,7 @@ const u = (o) => {
|
|
|
216
216
|
}), /* @__PURE__ */ e("div", {
|
|
217
217
|
className: "bot-plugin-json",
|
|
218
218
|
children: /* @__PURE__ */ e(m, {
|
|
219
|
-
josn: (
|
|
219
|
+
josn: (P = n.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : P.data.requestBody
|
|
220
220
|
})
|
|
221
221
|
}), /* @__PURE__ */ e("div", {
|
|
222
222
|
className: "bot-plugin-content",
|
|
@@ -224,44 +224,44 @@ const u = (o) => {
|
|
|
224
224
|
}), /* @__PURE__ */ e("div", {
|
|
225
225
|
className: "bot-plugin-json",
|
|
226
226
|
children: /* @__PURE__ */ e(m, {
|
|
227
|
-
josn:
|
|
227
|
+
josn: Se((H = n.find((s) => s.type === "RESULT")) == null ? void 0 : H.data.result)
|
|
228
228
|
})
|
|
229
229
|
})]
|
|
230
|
-
},
|
|
230
|
+
}, le);
|
|
231
231
|
})
|
|
232
232
|
}), t.isLoading && /* @__PURE__ */ e("div", {
|
|
233
233
|
className: "history-input-progress",
|
|
234
234
|
style: {
|
|
235
235
|
padding: "4px 0"
|
|
236
236
|
},
|
|
237
|
-
children:
|
|
237
|
+
children: Z(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
238
238
|
size: 4,
|
|
239
239
|
text: "思考中"
|
|
240
240
|
})
|
|
241
241
|
})]
|
|
242
|
-
}), /* @__PURE__ */ e("div", {
|
|
242
|
+
}), ((S = l == null ? void 0 : l.data) == null ? void 0 : S.netOpen) && /* @__PURE__ */ e("div", {
|
|
243
243
|
className: "item-bot-net",
|
|
244
|
-
children: /* @__PURE__ */ e(
|
|
244
|
+
children: /* @__PURE__ */ e(ke, {
|
|
245
245
|
history: t
|
|
246
246
|
})
|
|
247
|
-
}), (
|
|
247
|
+
}), (k = t == null ? void 0 : t.reference) != null && k.length && ((T = i == null ? void 0 : i.reference) != null && T.referenceFirst) ? /* @__PURE__ */ e(Y, {
|
|
248
248
|
history: t,
|
|
249
249
|
docViewerUrl: g
|
|
250
|
-
}) : null, /* @__PURE__ */
|
|
250
|
+
}) : null, /* @__PURE__ */ r("div", {
|
|
251
251
|
className: "item-bot-content",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ r("div", {
|
|
253
253
|
className: "content-think",
|
|
254
|
-
children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */
|
|
254
|
+
children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */ r("div", {
|
|
255
255
|
className: "think-top",
|
|
256
256
|
onClick: () => {
|
|
257
|
-
|
|
257
|
+
ne(!y);
|
|
258
258
|
},
|
|
259
259
|
children: [/* @__PURE__ */ e("img", {
|
|
260
|
-
src:
|
|
260
|
+
src: be,
|
|
261
261
|
alt: ""
|
|
262
262
|
}), (t == null ? void 0 : t.reasoningContent) && !(t != null && t.content) && /* @__PURE__ */ e("span", {
|
|
263
263
|
children: "我正在推理思考…"
|
|
264
|
-
}), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */
|
|
264
|
+
}), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */ r("span", {
|
|
265
265
|
children: ["已完成推理(用时 ", (t == null ? void 0 : t.thinkingSecs) || 0, " 秒)"]
|
|
266
266
|
}), /* @__PURE__ */ e("span", {
|
|
267
267
|
className: "think-action",
|
|
@@ -277,27 +277,27 @@ const u = (o) => {
|
|
|
277
277
|
}
|
|
278
278
|
})
|
|
279
279
|
})]
|
|
280
|
-
}), !!((
|
|
280
|
+
}), !!((A = t == null ? void 0 : t.reasoningContent) != null && A.trim()) && y && /* @__PURE__ */ r("div", {
|
|
281
281
|
className: "think-bottom",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ r("div", {
|
|
283
283
|
className: "bottom-left",
|
|
284
|
-
children: [(t == null ? void 0 : t.thinkingStatus) ===
|
|
284
|
+
children: [(t == null ? void 0 : t.thinkingStatus) === q.Start && /* @__PURE__ */ e("div", {
|
|
285
285
|
className: "thinking"
|
|
286
|
-
}), (t == null ? void 0 : t.thinkingStatus) ===
|
|
286
|
+
}), (t == null ? void 0 : t.thinkingStatus) === q.End && /* @__PURE__ */ e("div", {
|
|
287
287
|
className: "thinked",
|
|
288
|
-
children: /* @__PURE__ */ e(
|
|
288
|
+
children: /* @__PURE__ */ e(K, {})
|
|
289
289
|
})]
|
|
290
290
|
}), /* @__PURE__ */ e("div", {
|
|
291
291
|
className: "bottom-right",
|
|
292
|
-
children: /* @__PURE__ */ e(
|
|
292
|
+
children: /* @__PURE__ */ e(L, {
|
|
293
293
|
children: (t == null ? void 0 : t.reasoningContent) || ""
|
|
294
294
|
})
|
|
295
295
|
})]
|
|
296
296
|
})]
|
|
297
|
-
}), /* @__PURE__ */ e(
|
|
297
|
+
}), /* @__PURE__ */ e(L, {
|
|
298
298
|
children: t.content
|
|
299
299
|
})]
|
|
300
|
-
}), (
|
|
300
|
+
}), (O = t == null ? void 0 : t.reference) != null && O.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(Y, {
|
|
301
301
|
history: t,
|
|
302
302
|
docViewerUrl: g
|
|
303
303
|
}) : null, t.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
|
|
@@ -312,23 +312,23 @@ const u = (o) => {
|
|
|
312
312
|
style: {
|
|
313
313
|
padding: "4px 0"
|
|
314
314
|
},
|
|
315
|
-
children:
|
|
315
|
+
children: Z(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
316
316
|
size: 4,
|
|
317
317
|
text: "思考中"
|
|
318
318
|
})
|
|
319
|
-
}), (i == null ? void 0 : i.relate) && h && !!((
|
|
319
|
+
}), (i == null ? void 0 : i.relate) && h && !!((F = t.relatedQuesion) != null && F.length) && /* @__PURE__ */ e(Ce, {
|
|
320
320
|
relatedQuesion: t.relatedQuesion,
|
|
321
|
-
onRelatedClick:
|
|
322
|
-
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(
|
|
323
|
-
appId:
|
|
321
|
+
onRelatedClick: $
|
|
322
|
+
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(oe, {
|
|
323
|
+
appId: a.id,
|
|
324
324
|
history: t,
|
|
325
|
-
sessionId: (
|
|
326
|
-
onAgainClick:
|
|
325
|
+
sessionId: (_ = l == null ? void 0 : l.data) == null ? void 0 : _.id,
|
|
326
|
+
onAgainClick: ee,
|
|
327
327
|
isLastHistory: h,
|
|
328
|
-
currentSession:
|
|
328
|
+
currentSession: l
|
|
329
329
|
})]
|
|
330
330
|
})
|
|
331
|
-
}), t.isContext && /* @__PURE__ */
|
|
331
|
+
}), t.isContext && /* @__PURE__ */ r(ue, {
|
|
332
332
|
children: [/* @__PURE__ */ e("div", {
|
|
333
333
|
style: {
|
|
334
334
|
color: "#84868C",
|
|
@@ -346,6 +346,6 @@ const u = (o) => {
|
|
|
346
346
|
});
|
|
347
347
|
};
|
|
348
348
|
export {
|
|
349
|
-
|
|
349
|
+
Ye as default,
|
|
350
350
|
u as isResultExec
|
|
351
351
|
};
|
|
@@ -1,64 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as d } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import m from "../../assets/think.svg.mjs";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { CheckOutlined as u, CloseOutlined as g } from "@ant-design/icons";
|
|
6
|
+
import { Collapse as l, Space as f } from "antd";
|
|
7
|
+
const {
|
|
8
|
+
Panel: N
|
|
9
|
+
} = l, C = (i) => {
|
|
10
|
+
var t;
|
|
7
11
|
const {
|
|
8
12
|
history: n
|
|
9
|
-
} =
|
|
10
|
-
return /* @__PURE__ */ e("div", {
|
|
13
|
+
} = i, [h, o] = p(!1), s = n.searchingStatus ? n.searchingStatus : n.searchReference.length ? "end" : "";
|
|
14
|
+
return s ? /* @__PURE__ */ e("div", {
|
|
11
15
|
className: "search-reference",
|
|
12
|
-
children:
|
|
13
|
-
className: "bot-
|
|
16
|
+
children: /* @__PURE__ */ r("div", {
|
|
17
|
+
className: "item-bot-plugin",
|
|
14
18
|
onClick: () => {
|
|
15
|
-
|
|
19
|
+
o(!h);
|
|
16
20
|
},
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
children: ["
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
style: {
|
|
24
|
-
fontSize: 16
|
|
25
|
-
}
|
|
26
|
-
}) : /* @__PURE__ */ s(o, {
|
|
27
|
-
type: "icon-shouqi",
|
|
28
|
-
style: {
|
|
29
|
-
fontSize: 16
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
})]
|
|
33
|
-
}) : null, t && ((c = n.searchReference) == null ? void 0 : c.length) > 0 && /* @__PURE__ */ e("div", {
|
|
34
|
-
className: "bot-net-main",
|
|
35
|
-
children: [/* @__PURE__ */ s("div", {
|
|
36
|
-
className: "text",
|
|
37
|
-
children: "正在尝试为您在互联网搜索相关资料..."
|
|
38
|
-
}), /* @__PURE__ */ s("div", {
|
|
39
|
-
className: "text",
|
|
40
|
-
children: "开始获取资料..."
|
|
41
|
-
}), (i = n.searchReference) == null ? void 0 : i.map((l, r) => /* @__PURE__ */ e("div", {
|
|
42
|
-
className: "text",
|
|
43
|
-
children: [/* @__PURE__ */ e("span", {
|
|
44
|
-
children: ["找到了第 ", r + 1, " 篇资料:"]
|
|
45
|
-
}), /* @__PURE__ */ s("span", {
|
|
46
|
-
className: "link",
|
|
47
|
-
onClick: () => {
|
|
48
|
-
window.open(l.link);
|
|
49
|
-
},
|
|
50
|
-
children: l.title
|
|
21
|
+
children: [s === "start" && /* @__PURE__ */ r(d, {
|
|
22
|
+
children: [/* @__PURE__ */ e("img", {
|
|
23
|
+
src: m,
|
|
24
|
+
alt: ""
|
|
25
|
+
}), /* @__PURE__ */ e("span", {
|
|
26
|
+
children: "正在搜索…"
|
|
51
27
|
})]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
}), s === "end" && /* @__PURE__ */ e(l, {
|
|
29
|
+
ghost: !0,
|
|
30
|
+
expandIconPosition: "right",
|
|
31
|
+
children: /* @__PURE__ */ e(N, {
|
|
32
|
+
collapsible: "icon",
|
|
33
|
+
showArrow: !!(s === "end" && n.searchReference.length),
|
|
34
|
+
header: /* @__PURE__ */ r(f, {
|
|
35
|
+
size: 8,
|
|
36
|
+
style: {
|
|
37
|
+
width: "100%"
|
|
38
|
+
},
|
|
39
|
+
children: [/* @__PURE__ */ r("span", {
|
|
40
|
+
className: "bot-plugin-status",
|
|
41
|
+
children: [s === "end" && n.searchReference.length > 0 && /* @__PURE__ */ e("span", {
|
|
42
|
+
className: "plugin-status-success",
|
|
43
|
+
children: /* @__PURE__ */ e(u, {})
|
|
44
|
+
}), s === "end" && !n.searchReference.length && /* @__PURE__ */ e("span", {
|
|
45
|
+
className: "plugin-status-error",
|
|
46
|
+
children: /* @__PURE__ */ e(g, {})
|
|
47
|
+
})]
|
|
48
|
+
}), s === "end" && /* @__PURE__ */ e("span", {
|
|
49
|
+
className: "bot-plugin-title",
|
|
50
|
+
children: n.searchReference.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
|
|
51
|
+
})]
|
|
52
|
+
}),
|
|
53
|
+
children: /* @__PURE__ */ e("div", {
|
|
54
|
+
className: "bot-net-main",
|
|
55
|
+
children: (t = n.searchReference) == null ? void 0 : t.map((a, c) => /* @__PURE__ */ r("div", {
|
|
56
|
+
className: "text",
|
|
57
|
+
children: [/* @__PURE__ */ r("span", {
|
|
58
|
+
children: [c + 1, ". "]
|
|
59
|
+
}), /* @__PURE__ */ e("span", {
|
|
60
|
+
className: "link",
|
|
61
|
+
onClick: () => {
|
|
62
|
+
window.open(a.link);
|
|
63
|
+
},
|
|
64
|
+
children: a.title
|
|
65
|
+
})]
|
|
66
|
+
}, c))
|
|
67
|
+
})
|
|
68
|
+
}, "")
|
|
58
69
|
})]
|
|
59
|
-
})
|
|
60
|
-
});
|
|
70
|
+
})
|
|
71
|
+
}) : null;
|
|
61
72
|
};
|
|
62
73
|
export {
|
|
63
|
-
|
|
74
|
+
C as default
|
|
64
75
|
};
|