@glodon-aiot/agent-cli-ui 3.3.6 → 3.4.0-alpha.3

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.
Files changed (54) hide show
  1. package/dist/es/AgentClientUI.mjs +59 -54
  2. package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +74 -0
  3. package/dist/es/Dialog/AgentChat/index.mjs +589 -560
  4. package/dist/es/Dialog/SessionList/index.mjs +255 -173
  5. package/dist/es/Dialog/index.mjs +117 -103
  6. package/dist/es/QuillEditor/index.mjs +19 -17
  7. package/dist/es/components/Sider/index.mjs +24 -0
  8. package/dist/es/constant.mjs +2 -0
  9. package/dist/es/index.mjs +100 -99
  10. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  11. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  12. package/dist/es/src/style10.css +1 -1
  13. package/dist/es/src/style11.css +1 -1
  14. package/dist/es/src/style12.css +1 -1
  15. package/dist/es/src/style13.css +1 -1
  16. package/dist/es/src/style14.css +1 -1
  17. package/dist/es/src/style15.css +1 -1
  18. package/dist/es/src/style16.css +1 -1
  19. package/dist/es/src/style17.css +1 -1
  20. package/dist/es/src/style18.css +1 -1
  21. package/dist/es/src/style19.css +1 -1
  22. package/dist/es/src/style20.css +1 -1
  23. package/dist/es/src/style21.css +1 -1
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +1 -1
  26. package/dist/es/src/style24.css +1 -1
  27. package/dist/es/src/style25.css +1 -1
  28. package/dist/es/src/style26.css +1 -1
  29. package/dist/es/src/style28.css +1 -1
  30. package/dist/es/src/style29.css +1 -1
  31. package/dist/es/src/style30.css +1 -1
  32. package/dist/es/src/style31.css +1 -1
  33. package/dist/es/src/style32.css +1 -0
  34. package/dist/es/src/style33.css +1 -0
  35. package/dist/es/src/style5.css +1 -1
  36. package/dist/es/src/style6.css +1 -1
  37. package/dist/es/src/style7.css +1 -1
  38. package/dist/es/src/style8.css +1 -1
  39. package/dist/es/src/style9.css +1 -1
  40. package/dist/lib/index.css +1 -1
  41. package/dist/lib/index.js +57 -57
  42. package/dist/src/AgentClientUI.d.ts +1 -0
  43. package/dist/src/Dialog/AgentChat/HistoryItem/FileItem/index.d.ts +1 -1
  44. package/dist/src/Dialog/AgentChat/HistoryItem/SessionAction/index.d.ts +1 -1
  45. package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +1 -1
  46. package/dist/src/Dialog/AgentChat/PromptSetting/index.d.ts +2 -2
  47. package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +2 -2
  48. package/dist/src/Dialog/AgentChat/index.d.ts +8 -3
  49. package/dist/src/Dialog/SessionList/index.d.ts +9 -5
  50. package/dist/src/Dialog/index.d.ts +1 -0
  51. package/dist/src/QuillEditor/index.d.ts +1 -0
  52. package/dist/src/components/KnowledgeList/index.d.ts +1 -1
  53. package/dist/src/types.d.ts +1 -0
  54. package/package.json +3 -3
@@ -1,26 +1,26 @@
1
- var Q = Object.defineProperty, T = Object.defineProperties;
1
+ var K = Object.defineProperty, Q = Object.defineProperties;
2
2
  var X = Object.getOwnPropertyDescriptors;
3
- var y = Object.getOwnPropertySymbols;
3
+ var x = Object.getOwnPropertySymbols;
4
4
  var Y = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable;
5
- var R = (o, t, e) => t in o ? Q(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, f = (o, t) => {
5
+ var y = (o, t, e) => t in o ? K(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, f = (o, t) => {
6
6
  for (var e in t || (t = {}))
7
- Y.call(t, e) && R(o, e, t[e]);
8
- if (y)
9
- for (var e of y(t))
10
- Z.call(t, e) && R(o, e, t[e]);
7
+ Y.call(t, e) && y(o, e, t[e]);
8
+ if (x)
9
+ for (var e of x(t))
10
+ Z.call(t, e) && y(o, e, t[e]);
11
11
  return o;
12
- }, g = (o, t) => T(o, X(t));
13
- import { jsx as s, jsxs as x } from "react/jsx-runtime";
14
- import { forwardRef as _, useRef as U, useState as r, useEffect as k, useImperativeHandle as B } from "react";
12
+ }, g = (o, t) => Q(o, X(t));
13
+ import { jsx as s, jsxs as R } from "react/jsx-runtime";
14
+ import { forwardRef as _, useRef as U, useState as m, useEffect as k, useImperativeHandle as B } from "react";
15
15
  /* empty css */import { AgentClientProvider as z } from "./context.mjs";
16
16
  import { Resizable as ee } from "react-resizable";
17
17
  import te from "./Dialog/index.mjs";
18
18
  import { ConfigProvider as A, Spin as ne, Button as L } from "antd";
19
19
  import oe from "antd/es/locale/zh_CN";
20
- const Ne = _((o, t) => {
20
+ const Ie = _((o, t) => {
21
21
  const {
22
22
  className: e,
23
- triggerButton: l,
23
+ triggerButton: a,
24
24
  size: n,
25
25
  theme: S,
26
26
  icon: p,
@@ -29,78 +29,83 @@ const Ne = _((o, t) => {
29
29
  debug: se,
30
30
  env: le,
31
31
  plugins: ae,
32
- mcp: de,
32
+ mcp: re,
33
33
  footer: H,
34
34
  defaultInput: j,
35
35
  onComment: M,
36
36
  onSessionLoad: P,
37
- onSessionUnload: W,
38
- onMessage: D,
39
- beforeMessageSend: E,
37
+ onSessionUnload: T,
38
+ onMessage: W,
39
+ beforeMessageSend: D,
40
40
  bodyStyle: u,
41
- apiUrl: re,
42
- sessionId: O,
43
- disabled: V,
44
- transform: q,
45
- features: F,
41
+ apiUrl: de,
42
+ sessionId: E,
43
+ disabled: O,
44
+ transform: V,
45
+ features: q,
46
46
  stream: me,
47
- agentClient: m,
48
- application: d
49
- } = o, b = U(null), [G, ce] = r(!1), [C, J] = r(), [i, v] = r(n), [w, N] = r(o.open), c = U(null);
47
+ agentClient: c,
48
+ application: r
49
+ } = o, b = U(null), [F, ce] = m(!1), [C, G] = m(), [i, v] = m(n), [w, I] = m(o.open), d = U(null);
50
50
  k(() => {
51
- d && (console.log("[AgentClientUI] token", m, d), J(d.id));
52
- }, [d]), A.config({
51
+ r && (console.log("[AgentClientUI] token", c, r), G(r.id));
52
+ }, [r]), A.config({
53
53
  theme: S
54
54
  }), k(() => {
55
55
  n && v(n);
56
56
  }, [n]);
57
- const K = (a, {
57
+ const J = (l, {
58
58
  element: h,
59
- size: I
59
+ size: N
60
60
  }) => {
61
61
  v({
62
- width: Number(I.width),
63
- height: I.height
62
+ width: Number(N.width),
63
+ height: N.height
64
64
  });
65
65
  };
66
66
  return B(t, () => ({
67
- createSession: (a) => {
67
+ createSession: (l) => {
68
68
  var h;
69
- return (h = c.current) == null ? void 0 : h.createSession(a);
69
+ return (h = d.current) == null ? void 0 : h.createSession(l);
70
70
  },
71
71
  getSessionList: () => {
72
- var a;
73
- return (a = c.current) == null ? void 0 : a.getSessionList();
72
+ var l;
73
+ return (l = d.current) == null ? void 0 : l.getSessionList();
74
+ },
75
+ // 新增:获取当前输入框内容
76
+ getCurrentInputText: () => {
77
+ var l;
78
+ return (l = d.current) == null ? void 0 : l.getCurrentInputText();
74
79
  }
75
80
  })), /* @__PURE__ */ s(A, {
76
81
  locale: oe,
77
- children: /* @__PURE__ */ x(z, {
82
+ children: /* @__PURE__ */ R(z, {
78
83
  value: g(f({}, o), {
79
84
  popupContainer: b,
80
- agentClient: m,
85
+ agentClient: c,
81
86
  footer: H,
82
87
  defaultInput: j,
83
88
  onComment: M,
84
89
  onSessionLoad: P,
85
- onSessionUnload: W,
86
- onMessage: D,
87
- beforeMessageSend: E,
90
+ onSessionUnload: T,
91
+ onMessage: W,
92
+ beforeMessageSend: D,
88
93
  bodyStyle: u,
89
- disabled: V,
90
- transform: q,
91
- features: F
94
+ disabled: O,
95
+ transform: V,
96
+ features: q
92
97
  }),
93
98
  children: [/* @__PURE__ */ s(ee, {
94
99
  height: (i == null ? void 0 : i.height) || "100%",
95
100
  width: (i == null ? void 0 : i.width) || "100%",
96
101
  maxConstraints: [document.body.clientWidth - 45],
97
102
  minConstraints: [Number(n == null ? void 0 : n.minWidth)],
98
- onResize: K,
103
+ onResize: J,
99
104
  handle: /* @__PURE__ */ s("span", {
100
105
  className: "resize-handle-ew"
101
106
  }),
102
107
  resizeHandles: e == "float" ? ["w"] : [],
103
- children: /* @__PURE__ */ x("div", {
108
+ children: /* @__PURE__ */ R("div", {
104
109
  id: "dialog-modal",
105
110
  className: `gbot-dialog-modal ${e} ${w ? "opened" : "closed"}`,
106
111
  style: g(f({}, n), {
@@ -109,34 +114,34 @@ const Ne = _((o, t) => {
109
114
  maxHeight: "100vh"
110
115
  }),
111
116
  ref: b,
112
- children: [G ? /* @__PURE__ */ s("div", {
117
+ children: [F ? /* @__PURE__ */ s("div", {
113
118
  className: "loading",
114
119
  children: /* @__PURE__ */ s(ne, {})
115
- }) : C && m ? /* @__PURE__ */ s(te, {
116
- ref: c,
120
+ }) : C && c ? /* @__PURE__ */ s(te, {
121
+ ref: d,
117
122
  appId: C,
118
123
  docViewerUrl: $,
119
124
  bodyStyle: u,
120
- sessionId: O
121
- }) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(L, {
125
+ sessionId: E
126
+ }) : null, (a == null ? void 0 : a.visible) && /* @__PURE__ */ s(L, {
122
127
  className: "trigger-btn close-btn",
123
128
  icon: /* @__PURE__ */ s("img", {
124
129
  src: p
125
130
  }),
126
- onClick: () => N(!1)
131
+ onClick: () => I(!1)
127
132
  })]
128
133
  })
129
- }), (l == null ? void 0 : l.visible) && !w && /* @__PURE__ */ s(L, {
134
+ }), (a == null ? void 0 : a.visible) && !w && /* @__PURE__ */ s(L, {
130
135
  className: `${e}-trigger-btn open-btn`,
131
- style: l.style,
136
+ style: a.style,
132
137
  icon: /* @__PURE__ */ s("img", {
133
138
  src: p
134
139
  }),
135
- onClick: () => N(!0)
140
+ onClick: () => I(!0)
136
141
  })]
137
142
  })
138
143
  });
139
144
  });
140
145
  export {
141
- Ne as default
146
+ Ie as default
142
147
  };
@@ -0,0 +1,74 @@
1
+ import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { Popover as S, Button as h, Drawer as C } from "antd";
3
+ import { useState as w, useContext as x } from "react";
4
+ /* empty css */import b from "../../../../components/Iconfont/index.mjs";
5
+ import g from "../../../../context.mjs";
6
+ import v from "../../../../components/Sider/index.mjs";
7
+ const V = (a) => {
8
+ const {
9
+ currentSession: s,
10
+ disabled: l = !1,
11
+ application: c,
12
+ networkStatus: m,
13
+ setCurrentSession: d,
14
+ sessions: p,
15
+ // 👈 新增
16
+ setSessions: f
17
+ // 👈 新增
18
+ } = a, [y, t] = w(!1), {
19
+ popupContainer: o
20
+ } = x(g);
21
+ return /* @__PURE__ */ u("div", {
22
+ className: "session-history-drawer-component",
23
+ children: [/* @__PURE__ */ e(S, {
24
+ placement: "topRight",
25
+ showArrow: !1,
26
+ overlayClassName: "session-history-overlay",
27
+ overlayStyle: {
28
+ padding: "4px"
29
+ },
30
+ getPopupContainer: (i) => i.parentNode,
31
+ content: "会话历史记录",
32
+ children: /* @__PURE__ */ e(h, {
33
+ className: "history-overlay-action",
34
+ disabled: l,
35
+ type: "text",
36
+ icon: /* @__PURE__ */ e(b, {
37
+ type: "icon-lishijilu",
38
+ style: {
39
+ fontSize: 24
40
+ }
41
+ }),
42
+ onClick: () => t(!0)
43
+ })
44
+ }), y && /* @__PURE__ */ e(C, {
45
+ title: "分组会话列表",
46
+ open: !0,
47
+ placement: "bottom",
48
+ onClose: () => t(!1),
49
+ className: "session-history-drawer",
50
+ size: "large",
51
+ getContainer: () => (o == null ? void 0 : o.current) || document.body,
52
+ destroyOnClose: !0,
53
+ style: {
54
+ position: "absolute"
55
+ },
56
+ children: /* @__PURE__ */ e(v, {
57
+ isShowHeader: !1,
58
+ application: c,
59
+ networkStatus: m,
60
+ currentSession: s,
61
+ setCurrentSession: d,
62
+ sessions: p,
63
+ setSessions: f,
64
+ afterSessionClick: (i) => {
65
+ var r, n;
66
+ ((r = i.data) == null ? void 0 : r.id) !== ((n = s == null ? void 0 : s.data) == null ? void 0 : n.id) && t(!1);
67
+ }
68
+ })
69
+ })]
70
+ });
71
+ };
72
+ export {
73
+ V as default
74
+ };