@glodon-aiot/agent-cli-ui 3.3.1 → 3.3.2-beta.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/HistoryItem/index.mjs +88 -88
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +55 -51
- package/dist/es/Dialog/AgentChat/index.mjs +125 -124
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +36 -36
- package/package.json +3 -3
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as u, useContext as
|
|
2
|
+
import { memo as u, useContext as oe, useState as de } from "react";
|
|
3
3
|
import d from "./InputProgress/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { IHistoryRole as
|
|
7
|
-
import
|
|
8
|
-
import { Popover as
|
|
9
|
-
import
|
|
4
|
+
import ce from "./SessionRefer/index.mjs";
|
|
5
|
+
import pe from "./SessionAction/index.mjs";
|
|
6
|
+
import { IHistoryRole as V, IThinkingStatus as W } from "@glodon-aiot/apis";
|
|
7
|
+
import me from "./FileItem/index.mjs";
|
|
8
|
+
import { Popover as ue, Space as G, Button as K, Row as he, Col as ge, Collapse as X, Divider as Ne, message as L } from "antd";
|
|
9
|
+
import fe from "./SearchReference/index.mjs";
|
|
10
10
|
/* empty css */import "../../../packages/react-components/dist/es/index.mjs";
|
|
11
|
-
import
|
|
11
|
+
import Ce from "classnames";
|
|
12
12
|
import c from "../../../components/Iconfont/index.mjs";
|
|
13
|
-
import { CheckOutlined as
|
|
13
|
+
import { CheckOutlined as Y, CloseOutlined as Z, LoadingOutlined as Le } from "@ant-design/icons";
|
|
14
14
|
import p from "../../../components/JsonDisplay/index.mjs";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { escapeSlash as
|
|
19
|
-
import
|
|
20
|
-
import { Markdown as
|
|
21
|
-
const
|
|
15
|
+
import ye from "../../../context.mjs";
|
|
16
|
+
import ve from "./SessionRelated/index.mjs";
|
|
17
|
+
import Re from "copy-to-clipboard";
|
|
18
|
+
import { escapeSlash as Se } from "../../../utils/index.mjs";
|
|
19
|
+
import be from "../../../assets/think.svg.mjs";
|
|
20
|
+
import { Markdown as Ee } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
|
|
21
|
+
const ke = (o) => {
|
|
22
22
|
if (!o)
|
|
23
23
|
return o;
|
|
24
24
|
try {
|
|
25
25
|
return JSON.parse(o);
|
|
26
|
-
} catch (
|
|
26
|
+
} catch (i) {
|
|
27
27
|
return o;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, Te = u(fe), $ = u(ce), y = u(Ee), Ae = u(me), m = (o) => {
|
|
30
30
|
if (!o)
|
|
31
31
|
return !1;
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
34
|
-
return !(
|
|
35
|
-
} catch (
|
|
33
|
+
const i = JSON.parse(o);
|
|
34
|
+
return !(i != null && i.code && (i.code < 200 || i.code > 300));
|
|
35
|
+
} catch (i) {
|
|
36
36
|
return !0;
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, ee = (o) => {
|
|
39
39
|
var n;
|
|
40
|
-
const
|
|
40
|
+
const i = JSON.parse(JSON.stringify(o)) || [], a = (n = i == null ? void 0 : i.pop()) == null ? void 0 : n.pop();
|
|
41
41
|
return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
|
|
42
|
-
},
|
|
42
|
+
}, Ye = (o) => {
|
|
43
43
|
var b, E, k, T, A, O, x, F, _, I;
|
|
44
44
|
const {
|
|
45
|
-
application:
|
|
45
|
+
application: i,
|
|
46
46
|
currentSession: a,
|
|
47
47
|
history: n,
|
|
48
48
|
isLastHistory: h,
|
|
49
|
-
onRelatedClick:
|
|
50
|
-
onAgainClick:
|
|
51
|
-
isLoading:
|
|
49
|
+
onRelatedClick: ne,
|
|
50
|
+
onAgainClick: te,
|
|
51
|
+
isLoading: Oe,
|
|
52
52
|
docViewerUrl: g,
|
|
53
53
|
onEditClick: N,
|
|
54
|
-
actions:
|
|
54
|
+
actions: le = !0
|
|
55
55
|
} = o, {
|
|
56
56
|
debug: v,
|
|
57
|
-
transform:
|
|
57
|
+
transform: l,
|
|
58
58
|
popupContainer: f
|
|
59
|
-
} =
|
|
60
|
-
Panel:
|
|
61
|
-
} =
|
|
62
|
-
|
|
59
|
+
} = oe(ye), R = n.role === V.User, S = n.role === V.Robot, {
|
|
60
|
+
Panel: ie
|
|
61
|
+
} = X, [C, se] = de(!0), re = () => {
|
|
62
|
+
L.config({
|
|
63
63
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
64
|
-
}),
|
|
64
|
+
}), Re(n.content), L.success("复制成功"), L.config({
|
|
65
65
|
getContainer: void 0
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ r("div", {
|
|
69
|
-
className:
|
|
69
|
+
className: Ce({
|
|
70
70
|
"history-item": !0,
|
|
71
71
|
"history-item__user": R,
|
|
72
72
|
"history-item__bot": S
|
|
@@ -75,30 +75,30 @@ const be = (o) => {
|
|
|
75
75
|
className: "history-item-user",
|
|
76
76
|
children: [/* @__PURE__ */ e("div", {
|
|
77
77
|
className: "item-user-panel",
|
|
78
|
-
children: /* @__PURE__ */ e(
|
|
78
|
+
children: /* @__PURE__ */ e(ue, {
|
|
79
79
|
placement: "topLeft",
|
|
80
80
|
overlayStyle: {
|
|
81
81
|
padding: 4
|
|
82
82
|
},
|
|
83
83
|
overlayClassName: "session-item-overlay-popover",
|
|
84
84
|
getPopupContainer: (t) => t.parentNode,
|
|
85
|
-
content:
|
|
85
|
+
content: l != null && l.userEdit || l != null && l.userCopy ? /* @__PURE__ */ r(G, {
|
|
86
86
|
className: "item-user-popover",
|
|
87
87
|
size: 4,
|
|
88
|
-
children: [(
|
|
88
|
+
children: [(l == null ? void 0 : l.userEdit) && /* @__PURE__ */ e("div", {
|
|
89
89
|
className: "user-pannel-item",
|
|
90
90
|
onClick: () => N == null ? void 0 : N(n.content),
|
|
91
|
-
children: /* @__PURE__ */ e(
|
|
91
|
+
children: /* @__PURE__ */ e(K, {
|
|
92
92
|
type: "link",
|
|
93
93
|
size: "small",
|
|
94
94
|
icon: /* @__PURE__ */ e(c, {
|
|
95
95
|
type: "icon-bianji2"
|
|
96
96
|
})
|
|
97
97
|
})
|
|
98
|
-
}), (
|
|
98
|
+
}), (l == null ? void 0 : l.userCopy) && /* @__PURE__ */ e("div", {
|
|
99
99
|
className: "user-pannel-item",
|
|
100
|
-
onClick:
|
|
101
|
-
children: /* @__PURE__ */ e(
|
|
100
|
+
onClick: re,
|
|
101
|
+
children: /* @__PURE__ */ e(K, {
|
|
102
102
|
type: "link",
|
|
103
103
|
size: "small",
|
|
104
104
|
icon: /* @__PURE__ */ e(c, {
|
|
@@ -114,22 +114,22 @@ const be = (o) => {
|
|
|
114
114
|
className: "user-panel-main",
|
|
115
115
|
children: /* @__PURE__ */ e("span", {
|
|
116
116
|
className: "item-user-content",
|
|
117
|
-
children: /* @__PURE__ */ e(
|
|
117
|
+
children: /* @__PURE__ */ e(y, {
|
|
118
118
|
showLatex: !1,
|
|
119
|
-
children:
|
|
119
|
+
children: Se(n.content)
|
|
120
120
|
})
|
|
121
121
|
})
|
|
122
122
|
})
|
|
123
123
|
})
|
|
124
124
|
}), /* @__PURE__ */ e("div", {
|
|
125
125
|
className: "item-user-file",
|
|
126
|
-
children: /* @__PURE__ */ e(
|
|
126
|
+
children: /* @__PURE__ */ e(he, {
|
|
127
127
|
gutter: [12, 12],
|
|
128
128
|
justify: "end",
|
|
129
129
|
wrap: !0,
|
|
130
|
-
children: (b = n.files) == null ? void 0 : b.map((t) => /* @__PURE__ */ e(
|
|
130
|
+
children: (b = n.files) == null ? void 0 : b.map((t) => /* @__PURE__ */ e(ge, {
|
|
131
131
|
className: "user-file-col",
|
|
132
|
-
children: /* @__PURE__ */ e(
|
|
132
|
+
children: /* @__PURE__ */ e(Ae, {
|
|
133
133
|
docViewerUrl: g,
|
|
134
134
|
currentSession: a,
|
|
135
135
|
file: t
|
|
@@ -141,17 +141,17 @@ const be = (o) => {
|
|
|
141
141
|
className: "history-item-bot",
|
|
142
142
|
children: /* @__PURE__ */ r("div", {
|
|
143
143
|
className: "bot-content-wrapper",
|
|
144
|
-
children: [
|
|
144
|
+
children: [i.type === 2 && /* @__PURE__ */ r("div", {
|
|
145
145
|
className: "item-bot-plugin",
|
|
146
|
-
children: [/* @__PURE__ */ e(
|
|
146
|
+
children: [/* @__PURE__ */ e(X, {
|
|
147
147
|
ghost: !0,
|
|
148
148
|
expandIconPosition: "right",
|
|
149
|
-
children: (E = n.actions) == null ? void 0 : E.map((t,
|
|
150
|
-
var U, z, j, B, w, M, J, P, Q, q;
|
|
151
|
-
return /* @__PURE__ */ r(
|
|
149
|
+
children: (E = n.actions) == null ? void 0 : E.map((t, ae) => {
|
|
150
|
+
var U, z, j, B, w, M, J, P, Q, q, H, D;
|
|
151
|
+
return /* @__PURE__ */ r(ie, {
|
|
152
152
|
collapsible: v ? "header" : "icon",
|
|
153
153
|
showArrow: v,
|
|
154
|
-
header: /* @__PURE__ */ r(
|
|
154
|
+
header: /* @__PURE__ */ r(G, {
|
|
155
155
|
size: 8,
|
|
156
156
|
style: {
|
|
157
157
|
width: "100%"
|
|
@@ -160,30 +160,30 @@ const be = (o) => {
|
|
|
160
160
|
className: "bot-plugin-status",
|
|
161
161
|
children: [(t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && m((U = t.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
|
|
162
162
|
className: "plugin-status-success",
|
|
163
|
-
children: /* @__PURE__ */ e(
|
|
163
|
+
children: /* @__PURE__ */ e(Y, {})
|
|
164
164
|
}), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
165
165
|
className: "plugin-status-error",
|
|
166
|
-
children: /* @__PURE__ */ e(
|
|
166
|
+
children: /* @__PURE__ */ e(Z, {})
|
|
167
167
|
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !m((z = t.find((s) => s.type === "RESULT")) == null ? void 0 : z.data.result) && /* @__PURE__ */ e("span", {
|
|
168
168
|
className: "plugin-status-error",
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
169
|
+
children: /* @__PURE__ */ e(Z, {})
|
|
170
170
|
}), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
171
171
|
className: "plugin-status-loading",
|
|
172
|
-
children: /* @__PURE__ */ e(
|
|
172
|
+
children: /* @__PURE__ */ e(Le, {})
|
|
173
173
|
})]
|
|
174
174
|
}), /* @__PURE__ */ e("span", {
|
|
175
175
|
className: "bot-plugin-title",
|
|
176
|
-
children: (j = t[t.length - 1].data) == null ? void 0 : j.pluginName
|
|
176
|
+
children: ((j = t[t.length - 1].data) == null ? void 0 : j.pluginName) || ((B = t[t.length - 1].data) == null ? void 0 : B.pluginCode)
|
|
177
177
|
}), /* @__PURE__ */ e("span", {
|
|
178
178
|
className: "bot-plugin-action",
|
|
179
|
-
children: (
|
|
179
|
+
children: ((w = t[t.length - 1].data) == null ? void 0 : w.funcName) || ((M = t[t.length - 1].data) == null ? void 0 : M.funcCode)
|
|
180
180
|
}), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
181
181
|
className: "bot-plugin-result",
|
|
182
182
|
children: "执行中"
|
|
183
|
-
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && m((
|
|
183
|
+
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && m((J = t.find((s) => s.type === "RESULT")) == null ? void 0 : J.data.result) && /* @__PURE__ */ e("span", {
|
|
184
184
|
className: "bot-plugin-result",
|
|
185
185
|
children: "执行成功"
|
|
186
|
-
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !m((
|
|
186
|
+
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !m((P = t.find((s) => s.type === "RESULT")) == null ? void 0 : P.data.result) && /* @__PURE__ */ e("span", {
|
|
187
187
|
className: "bot-plugin-result",
|
|
188
188
|
children: "执行失败"
|
|
189
189
|
}), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
@@ -197,7 +197,7 @@ const be = (o) => {
|
|
|
197
197
|
}), /* @__PURE__ */ e("div", {
|
|
198
198
|
className: "bot-plugin-json",
|
|
199
199
|
children: /* @__PURE__ */ e(p, {
|
|
200
|
-
josn: (
|
|
200
|
+
josn: (Q = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : Q.data.thought
|
|
201
201
|
})
|
|
202
202
|
}), /* @__PURE__ */ e("div", {
|
|
203
203
|
className: "bot-plugin-content",
|
|
@@ -205,7 +205,7 @@ const be = (o) => {
|
|
|
205
205
|
}), /* @__PURE__ */ e("div", {
|
|
206
206
|
className: "bot-plugin-json",
|
|
207
207
|
children: /* @__PURE__ */ e(p, {
|
|
208
|
-
josn: (
|
|
208
|
+
josn: (q = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : q.data.parameters
|
|
209
209
|
})
|
|
210
210
|
}), /* @__PURE__ */ e("div", {
|
|
211
211
|
className: "bot-plugin-content",
|
|
@@ -213,7 +213,7 @@ const be = (o) => {
|
|
|
213
213
|
}), /* @__PURE__ */ e("div", {
|
|
214
214
|
className: "bot-plugin-json",
|
|
215
215
|
children: /* @__PURE__ */ e(p, {
|
|
216
|
-
josn: (
|
|
216
|
+
josn: (H = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : H.data.requestBody
|
|
217
217
|
})
|
|
218
218
|
}), /* @__PURE__ */ e("div", {
|
|
219
219
|
className: "bot-plugin-content",
|
|
@@ -221,27 +221,27 @@ const be = (o) => {
|
|
|
221
221
|
}), /* @__PURE__ */ e("div", {
|
|
222
222
|
className: "bot-plugin-json",
|
|
223
223
|
children: /* @__PURE__ */ e(p, {
|
|
224
|
-
josn:
|
|
224
|
+
josn: ke((D = t.find((s) => s.type === "RESULT")) == null ? void 0 : D.data.result)
|
|
225
225
|
})
|
|
226
226
|
})]
|
|
227
|
-
},
|
|
227
|
+
}, ae);
|
|
228
228
|
})
|
|
229
229
|
}), n.isLoading && /* @__PURE__ */ e("div", {
|
|
230
230
|
className: "history-input-progress",
|
|
231
231
|
style: {
|
|
232
232
|
padding: "4px 0"
|
|
233
233
|
},
|
|
234
|
-
children:
|
|
234
|
+
children: ee(n.actions) ? null : /* @__PURE__ */ e(d, {
|
|
235
235
|
size: 4,
|
|
236
236
|
text: "思考中"
|
|
237
237
|
})
|
|
238
238
|
})]
|
|
239
239
|
}), !!((k = n.searchReference) != null && k.length) && /* @__PURE__ */ e("div", {
|
|
240
240
|
className: "item-bot-net",
|
|
241
|
-
children: /* @__PURE__ */ e(
|
|
241
|
+
children: /* @__PURE__ */ e(Te, {
|
|
242
242
|
history: n
|
|
243
243
|
})
|
|
244
|
-
}), (T = n == null ? void 0 : n.reference) != null && T.length && ((A =
|
|
244
|
+
}), (T = n == null ? void 0 : n.reference) != null && T.length && ((A = l == null ? void 0 : l.reference) != null && A.referenceFirst) ? /* @__PURE__ */ e($, {
|
|
245
245
|
history: n,
|
|
246
246
|
docViewerUrl: g
|
|
247
247
|
}) : null, /* @__PURE__ */ r("div", {
|
|
@@ -251,10 +251,10 @@ const be = (o) => {
|
|
|
251
251
|
children: [(n == null ? void 0 : n.reasoningContent) && /* @__PURE__ */ r("div", {
|
|
252
252
|
className: "think-top",
|
|
253
253
|
onClick: () => {
|
|
254
|
-
|
|
254
|
+
se(!C);
|
|
255
255
|
},
|
|
256
256
|
children: [/* @__PURE__ */ e("img", {
|
|
257
|
-
src:
|
|
257
|
+
src: be,
|
|
258
258
|
alt: ""
|
|
259
259
|
}), (n == null ? void 0 : n.reasoningContent) && !(n != null && n.content) && /* @__PURE__ */ e("span", {
|
|
260
260
|
children: "我正在推理思考…"
|
|
@@ -262,7 +262,7 @@ const be = (o) => {
|
|
|
262
262
|
children: ["已完成推理(用时 ", (n == null ? void 0 : n.thinkingSecs) || 0, " 秒)"]
|
|
263
263
|
}), /* @__PURE__ */ e("span", {
|
|
264
264
|
className: "think-action",
|
|
265
|
-
children:
|
|
265
|
+
children: C ? /* @__PURE__ */ e(c, {
|
|
266
266
|
type: "icon-zhankai",
|
|
267
267
|
style: {
|
|
268
268
|
fontSize: 16
|
|
@@ -274,27 +274,27 @@ const be = (o) => {
|
|
|
274
274
|
}
|
|
275
275
|
})
|
|
276
276
|
})]
|
|
277
|
-
}), !!((O = n == null ? void 0 : n.reasoningContent) != null && O.trim()) &&
|
|
277
|
+
}), !!((O = n == null ? void 0 : n.reasoningContent) != null && O.trim()) && C && /* @__PURE__ */ r("div", {
|
|
278
278
|
className: "think-bottom",
|
|
279
279
|
children: [/* @__PURE__ */ r("div", {
|
|
280
280
|
className: "bottom-left",
|
|
281
|
-
children: [(n == null ? void 0 : n.thinkingStatus) ===
|
|
281
|
+
children: [(n == null ? void 0 : n.thinkingStatus) === W.Start && /* @__PURE__ */ e("div", {
|
|
282
282
|
className: "thinking"
|
|
283
|
-
}), (n == null ? void 0 : n.thinkingStatus) ===
|
|
283
|
+
}), (n == null ? void 0 : n.thinkingStatus) === W.End && /* @__PURE__ */ e("div", {
|
|
284
284
|
className: "thinked",
|
|
285
|
-
children: /* @__PURE__ */ e(
|
|
285
|
+
children: /* @__PURE__ */ e(Y, {})
|
|
286
286
|
})]
|
|
287
287
|
}), /* @__PURE__ */ e("div", {
|
|
288
288
|
className: "bottom-right",
|
|
289
|
-
children: /* @__PURE__ */ e(
|
|
289
|
+
children: /* @__PURE__ */ e(y, {
|
|
290
290
|
children: (n == null ? void 0 : n.reasoningContent) || ""
|
|
291
291
|
})
|
|
292
292
|
})]
|
|
293
293
|
})]
|
|
294
|
-
}), /* @__PURE__ */ e(
|
|
294
|
+
}), /* @__PURE__ */ e(y, {
|
|
295
295
|
children: n.content
|
|
296
296
|
})]
|
|
297
|
-
}), (x = n == null ? void 0 : n.reference) != null && x.length && !((F =
|
|
297
|
+
}), (x = n == null ? void 0 : n.reference) != null && x.length && !((F = l == null ? void 0 : l.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e($, {
|
|
298
298
|
history: n,
|
|
299
299
|
docViewerUrl: g
|
|
300
300
|
}) : null, n.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
|
|
@@ -309,23 +309,23 @@ const be = (o) => {
|
|
|
309
309
|
style: {
|
|
310
310
|
padding: "4px 0"
|
|
311
311
|
},
|
|
312
|
-
children:
|
|
312
|
+
children: ee(n.actions) ? null : /* @__PURE__ */ e(d, {
|
|
313
313
|
size: 4,
|
|
314
314
|
text: "思考中"
|
|
315
315
|
})
|
|
316
|
-
}),
|
|
316
|
+
}), i.arrange[0].recommendQuestionOpen && (l == null ? void 0 : l.relate) && h && !!((_ = n.relatedQuesion) != null && _.length) && /* @__PURE__ */ e(ve, {
|
|
317
317
|
relatedQuesion: n.relatedQuesion,
|
|
318
|
-
onRelatedClick:
|
|
319
|
-
}),
|
|
320
|
-
appId:
|
|
318
|
+
onRelatedClick: ne
|
|
319
|
+
}), le && !n.isSensitive && !!n.messageId && /* @__PURE__ */ e(pe, {
|
|
320
|
+
appId: i.id,
|
|
321
321
|
history: n,
|
|
322
322
|
sessionId: (I = a == null ? void 0 : a.data) == null ? void 0 : I.id,
|
|
323
|
-
onAgainClick:
|
|
323
|
+
onAgainClick: te,
|
|
324
324
|
isLastHistory: h,
|
|
325
325
|
currentSession: a
|
|
326
326
|
})]
|
|
327
327
|
})
|
|
328
|
-
}), n.isContext && /* @__PURE__ */ r(
|
|
328
|
+
}), n.isContext && /* @__PURE__ */ r(Ne, {
|
|
329
329
|
children: [/* @__PURE__ */ e("div", {
|
|
330
330
|
style: {
|
|
331
331
|
color: "#84868C",
|
|
@@ -343,6 +343,6 @@ const be = (o) => {
|
|
|
343
343
|
});
|
|
344
344
|
};
|
|
345
345
|
export {
|
|
346
|
-
|
|
346
|
+
Ye as default,
|
|
347
347
|
m as isResultExec
|
|
348
348
|
};
|
|
@@ -1,85 +1,89 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var P = Object.prototype.hasOwnProperty,
|
|
4
|
-
var
|
|
1
|
+
var q = Object.defineProperty;
|
|
2
|
+
var y = Object.getOwnPropertySymbols;
|
|
3
|
+
var P = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var v = (r, t, e) => t in r ? q(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, g = (r, t) => {
|
|
5
5
|
for (var e in t || (t = {}))
|
|
6
|
-
P.call(t, e) &&
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
10
|
-
return
|
|
6
|
+
P.call(t, e) && v(r, e, t[e]);
|
|
7
|
+
if (y)
|
|
8
|
+
for (var e of y(t))
|
|
9
|
+
B.call(t, e) && v(r, e, t[e]);
|
|
10
|
+
return r;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { forwardRef as
|
|
14
|
-
/* empty css */import { Form as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
const
|
|
12
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef as L, useState as S, useContext as b, useImperativeHandle as w, useEffect as k } from "react";
|
|
14
|
+
/* empty css */import { Form as u, Space as C, Button as E, Popover as j, Input as A } from "antd";
|
|
15
|
+
import z from "../../../context.mjs";
|
|
16
|
+
import f from "../../../components/Iconfont/index.mjs";
|
|
17
|
+
const D = L((r, t) => {
|
|
18
18
|
const {
|
|
19
19
|
promptVariables: e,
|
|
20
|
-
setPromptVariables:
|
|
21
|
-
currentSession:
|
|
22
|
-
setCurrentSession:
|
|
23
|
-
} =
|
|
24
|
-
|
|
20
|
+
setPromptVariables: h,
|
|
21
|
+
currentSession: s,
|
|
22
|
+
setCurrentSession: H
|
|
23
|
+
} = r, [c] = u.useForm(), [m, N] = S(!0), {
|
|
24
|
+
agentClient: d,
|
|
25
|
+
depId: M,
|
|
26
|
+
features: R
|
|
27
|
+
} = b(z);
|
|
28
|
+
w(t, () => ({
|
|
25
29
|
clear() {
|
|
26
30
|
c.resetFields();
|
|
27
31
|
}
|
|
28
|
-
})),
|
|
29
|
-
if (!
|
|
32
|
+
})), k(() => {
|
|
33
|
+
if (!s)
|
|
30
34
|
return;
|
|
31
35
|
const o = () => {
|
|
32
|
-
const a =
|
|
33
|
-
|
|
36
|
+
const a = s.promptVariables.filter((i) => i.key !== "query");
|
|
37
|
+
h(a.sort((i, I) => i.key.localeCompare(I.key)));
|
|
34
38
|
};
|
|
35
|
-
return
|
|
36
|
-
|
|
39
|
+
return s.addEventListener("activated", o), () => {
|
|
40
|
+
s == null || s.removeEventListener("activated", o);
|
|
37
41
|
};
|
|
38
|
-
}, [
|
|
42
|
+
}, [s]), k(() => {
|
|
39
43
|
if (!e)
|
|
40
44
|
return;
|
|
41
|
-
const o = e == null ? void 0 : e.reduce((
|
|
42
|
-
c.setFieldsValue(
|
|
45
|
+
const o = e == null ? void 0 : e.reduce((l, a) => (l[a.key] = a.value, l), {});
|
|
46
|
+
c.setFieldsValue(g({}, o));
|
|
43
47
|
}, [e]);
|
|
44
|
-
const
|
|
48
|
+
const x = (o, l) => {
|
|
45
49
|
e.map((a) => {
|
|
46
|
-
a.id === o && (a.value =
|
|
47
|
-
}),
|
|
50
|
+
a.id === o && (a.value = l.target.value);
|
|
51
|
+
}), h([...e].sort((a, i) => a.key.localeCompare(i.key)));
|
|
48
52
|
}, F = () => {
|
|
49
|
-
|
|
53
|
+
N(!m);
|
|
50
54
|
};
|
|
51
|
-
return e != null && e.length ? /* @__PURE__ */
|
|
55
|
+
return e != null && e.length ? /* @__PURE__ */ n("div", {
|
|
52
56
|
className: "prompt-setting-panel",
|
|
53
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ p("div", {
|
|
54
58
|
className: "agent-prompt",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ n("div", {
|
|
56
60
|
className: "prompt-header",
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ p(C, {
|
|
62
|
+
children: [/* @__PURE__ */ n(E, {
|
|
59
63
|
className: "prompt-action",
|
|
60
|
-
icon: m ? /* @__PURE__ */
|
|
64
|
+
icon: m ? /* @__PURE__ */ n(f, {
|
|
61
65
|
type: "icon-biaoge-shouqi"
|
|
62
|
-
}) : /* @__PURE__ */
|
|
66
|
+
}) : /* @__PURE__ */ n(f, {
|
|
63
67
|
type: "icon-biaoge-zhankai"
|
|
64
68
|
}),
|
|
65
69
|
type: "link",
|
|
66
70
|
onClick: F
|
|
67
|
-
}), /* @__PURE__ */
|
|
71
|
+
}), /* @__PURE__ */ p(C, {
|
|
68
72
|
className: "prompt-title",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ n("span", {
|
|
70
74
|
children: "变量输入"
|
|
71
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ n(j, {
|
|
72
76
|
placement: "top",
|
|
73
77
|
overlayClassName: "title-popover",
|
|
74
78
|
content: "填入变量的值,每次启动新会话时该变量将自动替换提示词中的变量",
|
|
75
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ n(f, {
|
|
76
80
|
className: "icon-prompt-question",
|
|
77
81
|
type: "icon-wenti"
|
|
78
82
|
})
|
|
79
83
|
})]
|
|
80
84
|
})]
|
|
81
85
|
})
|
|
82
|
-
}), m && /* @__PURE__ */
|
|
86
|
+
}), m && /* @__PURE__ */ n(u, {
|
|
83
87
|
autoComplete: "off",
|
|
84
88
|
form: c,
|
|
85
89
|
labelWrap: !0,
|
|
@@ -90,7 +94,7 @@ const z = B((n, t) => {
|
|
|
90
94
|
}
|
|
91
95
|
},
|
|
92
96
|
className: "prompt-form",
|
|
93
|
-
children: e == null ? void 0 : e.map((o) => /* @__PURE__ */
|
|
97
|
+
children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ n(u.Item, {
|
|
94
98
|
label: o.name,
|
|
95
99
|
name: o.key,
|
|
96
100
|
style: {
|
|
@@ -100,17 +104,17 @@ const z = B((n, t) => {
|
|
|
100
104
|
required: !0,
|
|
101
105
|
message: "请输入"
|
|
102
106
|
}],
|
|
103
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ n(A, {
|
|
104
108
|
placeholder: "请输入",
|
|
105
|
-
maxLength:
|
|
106
|
-
onBlur: (
|
|
109
|
+
maxLength: d == null ? void 0 : d.questionContextMaxLength,
|
|
110
|
+
onBlur: (l) => x(o.id, l)
|
|
107
111
|
})
|
|
108
112
|
}, o.key))
|
|
109
113
|
})]
|
|
110
114
|
})
|
|
111
115
|
}) : null;
|
|
112
116
|
});
|
|
113
|
-
|
|
117
|
+
D.displayName = "PromptSetting";
|
|
114
118
|
export {
|
|
115
|
-
|
|
119
|
+
D as default
|
|
116
120
|
};
|