@glodon-aiot/agent-cli-ui 3.3.2-beta.9 → 3.3.5-alpha.16
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/AgentClientUI.mjs +2 -2
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +83 -98
- package/dist/es/Dialog/AgentChat/index.mjs +254 -253
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +383 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/parse.mjs +97 -0
- package/dist/es/ReactTextGenerationUI/index.mjs +79 -0
- package/dist/es/index.mjs +409 -257
- package/dist/es/node_modules/moment/dist/moment.mjs +2301 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +162 -0
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style10.css +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/style19.css +1 -1
- package/dist/es/src/style2.css +1 -1
- package/dist/es/src/style20.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/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -0
- package/dist/es/src/style31.css +1 -0
- 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/style7.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 +67 -56
- package/dist/src/ReactTextGenerationUI/components/TextSiders/index.d.ts +21 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSource/fetch.d.ts +44 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSource/index.d.ts +1 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSource/parse.d.ts +36 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/fetch.d.ts +44 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/index.d.ts +1 -0
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/parse.d.ts +36 -0
- package/dist/src/ReactTextGenerationUI/index.d.ts +4 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +3 -2
- package/package.json +3 -3
|
@@ -95,8 +95,8 @@ const ye = (n) => {
|
|
|
95
95
|
features: G
|
|
96
96
|
}),
|
|
97
97
|
children: [/* @__PURE__ */ s(ne, {
|
|
98
|
-
height: i == null ? void 0 : i.height,
|
|
99
|
-
width: i == null ? void 0 : i.width,
|
|
98
|
+
height: (i == null ? void 0 : i.height) || "100%",
|
|
99
|
+
width: (i == null ? void 0 : i.width) || "100%",
|
|
100
100
|
maxConstraints: [document.body.clientWidth - 45],
|
|
101
101
|
minConstraints: [Number(t == null ? void 0 : t.minWidth)],
|
|
102
102
|
onResize: Y,
|
|
@@ -1,102 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
B.call(t, e) && v(r, e, t[e]);
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
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) => {
|
|
1
|
+
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useContext as L, useImperativeHandle as S, useEffect as h } from "react";
|
|
3
|
+
/* empty css */import { Form as i, Collapse as v, Input as g } from "antd";
|
|
4
|
+
import { PromptVariableType as a } from "@glodon-aiot/apis";
|
|
5
|
+
import q from "../../../context.mjs";
|
|
6
|
+
const {
|
|
7
|
+
Panel: p
|
|
8
|
+
} = v, B = C((k, P) => {
|
|
18
9
|
const {
|
|
19
|
-
promptVariables:
|
|
20
|
-
setPromptVariables:
|
|
21
|
-
currentSession:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
features: R
|
|
27
|
-
} = b(z);
|
|
28
|
-
w(t, () => ({
|
|
10
|
+
promptVariables: t,
|
|
11
|
+
setPromptVariables: d,
|
|
12
|
+
currentSession: o
|
|
13
|
+
} = k, [u] = i.useForm(), {
|
|
14
|
+
agentClient: m
|
|
15
|
+
} = L(q);
|
|
16
|
+
S(P, () => ({
|
|
29
17
|
clear() {
|
|
30
|
-
|
|
18
|
+
u.resetFields();
|
|
31
19
|
}
|
|
32
|
-
})),
|
|
33
|
-
if (!
|
|
20
|
+
})), h(() => {
|
|
21
|
+
if (!o)
|
|
34
22
|
return;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
23
|
+
const e = () => {
|
|
24
|
+
const r = o.promptVariables.filter((l) => !(l.type === a.User && l.key === "query") && !(l.type === a.System && l.key === "datetime"));
|
|
25
|
+
d(r.sort((l, x) => l.key.localeCompare(x.key)));
|
|
38
26
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
27
|
+
return o.addEventListener("activated", e), () => {
|
|
28
|
+
o == null || o.removeEventListener("activated", e);
|
|
41
29
|
};
|
|
42
|
-
}, [
|
|
43
|
-
if (!
|
|
30
|
+
}, [o]), h(() => {
|
|
31
|
+
if (!t)
|
|
44
32
|
return;
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
})
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
children: /* @__PURE__ */ n(f, {
|
|
80
|
-
className: "icon-prompt-question",
|
|
81
|
-
type: "icon-wenti"
|
|
82
|
-
})
|
|
83
|
-
})]
|
|
84
|
-
})]
|
|
85
|
-
})
|
|
86
|
-
}), m && /* @__PURE__ */ n(u, {
|
|
87
|
-
autoComplete: "off",
|
|
88
|
-
form: c,
|
|
89
|
-
labelWrap: !0,
|
|
90
|
-
labelAlign: "left",
|
|
91
|
-
labelCol: {
|
|
33
|
+
const e = {}, s = {};
|
|
34
|
+
t.forEach((r) => {
|
|
35
|
+
r.type === a.System ? s[r.key] = r.value : e[r.key] = r.value;
|
|
36
|
+
}), u.setFieldsValue({
|
|
37
|
+
userPrompts: e,
|
|
38
|
+
systemPrompts: s
|
|
39
|
+
});
|
|
40
|
+
}, [t]);
|
|
41
|
+
const c = (e, s) => {
|
|
42
|
+
t.map((r) => {
|
|
43
|
+
r.id === e && (r.value = s.target.value);
|
|
44
|
+
}), d([...t].sort((r, l) => r.key.localeCompare(l.key)));
|
|
45
|
+
}, y = (t == null ? void 0 : t.filter((e) => e.type === a.System)) || [], f = (t == null ? void 0 : t.filter((e) => e.type === a.User)) || [];
|
|
46
|
+
return t != null && t.length ? /* @__PURE__ */ n(i, {
|
|
47
|
+
autoComplete: "off",
|
|
48
|
+
form: u,
|
|
49
|
+
labelWrap: !0,
|
|
50
|
+
labelAlign: "left",
|
|
51
|
+
labelCol: {
|
|
52
|
+
style: {
|
|
53
|
+
width: 120
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
className: "prompt-form",
|
|
57
|
+
children: /* @__PURE__ */ b(v, {
|
|
58
|
+
bordered: !1,
|
|
59
|
+
ghost: !0,
|
|
60
|
+
className: "prompt-variables-collapse",
|
|
61
|
+
defaultActiveKey: [a.System, a.User],
|
|
62
|
+
children: [y.length && /* @__PURE__ */ n(p, {
|
|
63
|
+
header: "角色设定变量",
|
|
64
|
+
children: y.map((e) => /* @__PURE__ */ n(i.Item, {
|
|
65
|
+
label: e.name,
|
|
66
|
+
name: ["systemPrompts", e.key],
|
|
92
67
|
style: {
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
68
|
+
marginBottom: 8
|
|
69
|
+
},
|
|
70
|
+
rules: [{
|
|
71
|
+
required: !0,
|
|
72
|
+
message: "请输入"
|
|
73
|
+
}],
|
|
74
|
+
children: /* @__PURE__ */ n(g, {
|
|
75
|
+
placeholder: "请输入",
|
|
76
|
+
maxLength: m == null ? void 0 : m.questionContextMaxLength,
|
|
77
|
+
onBlur: (s) => c(e.id, s)
|
|
78
|
+
})
|
|
79
|
+
}, e.key))
|
|
80
|
+
}, a.System), f.length && /* @__PURE__ */ n(p, {
|
|
81
|
+
header: "用户指令变量",
|
|
82
|
+
children: f.map((e) => /* @__PURE__ */ n(i.Item, {
|
|
83
|
+
label: e.name,
|
|
84
|
+
name: ["userPrompts", e.key],
|
|
100
85
|
style: {
|
|
101
86
|
marginBottom: 8
|
|
102
87
|
},
|
|
@@ -104,17 +89,17 @@ const D = L((r, t) => {
|
|
|
104
89
|
required: !0,
|
|
105
90
|
message: "请输入"
|
|
106
91
|
}],
|
|
107
|
-
children: /* @__PURE__ */ n(
|
|
92
|
+
children: /* @__PURE__ */ n(g, {
|
|
108
93
|
placeholder: "请输入",
|
|
109
|
-
maxLength:
|
|
110
|
-
onBlur: (
|
|
94
|
+
maxLength: m == null ? void 0 : m.questionContextMaxLength,
|
|
95
|
+
onBlur: (s) => c(e.id, s)
|
|
111
96
|
})
|
|
112
|
-
},
|
|
113
|
-
})]
|
|
97
|
+
}, e.key))
|
|
98
|
+
}, a.User)]
|
|
114
99
|
})
|
|
115
100
|
}) : null;
|
|
116
101
|
});
|
|
117
|
-
|
|
102
|
+
B.displayName = "PromptSetting";
|
|
118
103
|
export {
|
|
119
|
-
|
|
104
|
+
B as default
|
|
120
105
|
};
|