@glodon-aiot/agent-cli-ui 3.3.1-beta.1 → 3.3.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +55 -51
- package/dist/es/Dialog/AgentChat/index.mjs +239 -236
- package/dist/es/index.mjs +151 -144
- 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/style18.css +1 -1
- package/dist/es/src/style20.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/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +53 -53
- package/dist/src/types.d.ts +15 -1
- package/package.json +3 -3
|
@@ -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
|
};
|