@glodon-aiot/agent-cli-ui 3.4.1-beta.1 β†’ 3.4.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.
Files changed (36) hide show
  1. package/dist/es/AgentClientUI.mjs +41 -38
  2. package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +17 -23
  3. package/dist/es/Dialog/AgentChat/index.mjs +120 -122
  4. package/dist/es/Dialog/SessionList/index.mjs +94 -94
  5. package/dist/es/Dialog/index.mjs +107 -102
  6. package/dist/es/context/SessionContext.mjs +26 -0
  7. package/dist/es/hooks/useSessionState.mjs +6 -0
  8. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  9. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  10. package/dist/es/src/style10.css +1 -1
  11. package/dist/es/src/style11.css +1 -1
  12. package/dist/es/src/style12.css +1 -1
  13. package/dist/es/src/style13.css +1 -1
  14. package/dist/es/src/style14.css +1 -1
  15. package/dist/es/src/style15.css +1 -1
  16. package/dist/es/src/style17.css +1 -1
  17. package/dist/es/src/style18.css +1 -1
  18. package/dist/es/src/style19.css +1 -1
  19. package/dist/es/src/style20.css +1 -1
  20. package/dist/es/src/style21.css +1 -1
  21. package/dist/es/src/style23.css +1 -1
  22. package/dist/es/src/style26.css +1 -1
  23. package/dist/es/src/style27.css +1 -1
  24. package/dist/es/src/style28.css +1 -1
  25. package/dist/es/src/style31.css +1 -1
  26. package/dist/es/src/style32.css +1 -1
  27. package/dist/es/src/style33.css +1 -1
  28. package/dist/es/src/style7.css +1 -1
  29. package/dist/es/src/style9.css +1 -1
  30. package/dist/lib/index.js +36 -36
  31. package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +0 -2
  32. package/dist/src/Dialog/AgentChat/index.d.ts +0 -2
  33. package/dist/src/Dialog/SessionList/index.d.ts +0 -2
  34. package/dist/src/context/SessionContext.d.ts +15 -0
  35. package/dist/src/hooks/useSessionState.d.ts +7 -0
  36. package/package.json +3 -3
@@ -11,47 +11,48 @@ var y = (o, t, e) => t in o ? K(o, t, { enumerable: !0, configurable: !0, writab
11
11
  return o;
12
12
  }, g = (o, t) => Q(o, X(t));
13
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";
14
+ import { forwardRef as _, useRef as S, useState as m, useEffect as U, 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
- import { ConfigProvider as A, Spin as ne, Button as L } from "antd";
19
- import oe from "antd/es/locale/zh_CN";
20
- const Ie = _((o, t) => {
18
+ import { SessionProvider as ne } from "./context/SessionContext.mjs";
19
+ import { ConfigProvider as k, Spin as oe, Button as A } from "antd";
20
+ import ie from "antd/es/locale/zh_CN";
21
+ const xe = _((o, t) => {
21
22
  const {
22
23
  className: e,
23
- triggerButton: a,
24
+ triggerButton: r,
24
25
  size: n,
25
- theme: S,
26
+ theme: L,
26
27
  icon: p,
27
28
  docViewerUrl: $,
28
- token: ie,
29
- debug: se,
30
- env: le,
29
+ token: se,
30
+ debug: le,
31
+ env: re,
31
32
  plugins: ae,
32
- mcp: re,
33
+ mcp: de,
33
34
  footer: H,
34
- defaultInput: j,
35
- onComment: M,
36
- onSessionLoad: P,
35
+ defaultInput: P,
36
+ onComment: j,
37
+ onSessionLoad: M,
37
38
  onSessionUnload: T,
38
39
  onMessage: W,
39
40
  beforeMessageSend: D,
40
41
  bodyStyle: u,
41
- apiUrl: de,
42
+ apiUrl: me,
42
43
  sessionId: E,
43
44
  disabled: O,
44
45
  transform: V,
45
46
  features: q,
46
- stream: me,
47
+ stream: ce,
47
48
  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
- k(() => {
51
- r && (console.log("[AgentClientUI] token", c, r), G(r.id));
52
- }, [r]), A.config({
53
- theme: S
54
- }), k(() => {
49
+ application: a
50
+ } = o, b = S(null), [F, he] = m(!1), [C, G] = m(), [i, v] = m(n), [w, I] = m(o.open), d = S(null);
51
+ U(() => {
52
+ a && (console.log("[AgentClientUI] token", c, a), G(a.id));
53
+ }, [a]), k.config({
54
+ theme: L
55
+ }), U(() => {
55
56
  n && v(n);
56
57
  }, [n]);
57
58
  const J = (l, {
@@ -77,16 +78,16 @@ const Ie = _((o, t) => {
77
78
  var l;
78
79
  return (l = d.current) == null ? void 0 : l.getCurrentInputText();
79
80
  }
80
- })), /* @__PURE__ */ s(A, {
81
- locale: oe,
81
+ })), /* @__PURE__ */ s(k, {
82
+ locale: ie,
82
83
  children: /* @__PURE__ */ R(z, {
83
84
  value: g(f({}, o), {
84
85
  popupContainer: b,
85
86
  agentClient: c,
86
87
  footer: H,
87
- defaultInput: j,
88
- onComment: M,
89
- onSessionLoad: P,
88
+ defaultInput: P,
89
+ onComment: j,
90
+ onSessionLoad: M,
90
91
  onSessionUnload: T,
91
92
  onMessage: W,
92
93
  beforeMessageSend: D,
@@ -116,14 +117,16 @@ const Ie = _((o, t) => {
116
117
  ref: b,
117
118
  children: [F ? /* @__PURE__ */ s("div", {
118
119
  className: "loading",
119
- children: /* @__PURE__ */ s(ne, {})
120
- }) : C && c ? /* @__PURE__ */ s(te, {
121
- ref: d,
122
- appId: C,
123
- docViewerUrl: $,
124
- bodyStyle: u,
125
- sessionId: E
126
- }) : null, (a == null ? void 0 : a.visible) && /* @__PURE__ */ s(L, {
120
+ children: /* @__PURE__ */ s(oe, {})
121
+ }) : C && c ? /* @__PURE__ */ s(ne, {
122
+ children: /* @__PURE__ */ s(te, {
123
+ ref: d,
124
+ appId: C,
125
+ docViewerUrl: $,
126
+ bodyStyle: u,
127
+ sessionId: E
128
+ })
129
+ }) : null, (r == null ? void 0 : r.visible) && /* @__PURE__ */ s(A, {
127
130
  className: "trigger-btn close-btn",
128
131
  icon: /* @__PURE__ */ s("img", {
129
132
  src: p
@@ -131,9 +134,9 @@ const Ie = _((o, t) => {
131
134
  onClick: () => I(!1)
132
135
  })]
133
136
  })
134
- }), (a == null ? void 0 : a.visible) && !w && /* @__PURE__ */ s(L, {
137
+ }), (r == null ? void 0 : r.visible) && !w && /* @__PURE__ */ s(A, {
135
138
  className: `${e}-trigger-btn open-btn`,
136
- style: a.style,
139
+ style: r.style,
137
140
  icon: /* @__PURE__ */ s("img", {
138
141
  src: p
139
142
  }),
@@ -143,5 +146,5 @@ const Ie = _((o, t) => {
143
146
  });
144
147
  });
145
148
  export {
146
- Ie as default
149
+ xe as default
147
150
  };
@@ -1,26 +1,22 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Drawer as u } from "antd";
3
- import { useContext as C } from "react";
4
- /* empty css */import S from "../../../../context.mjs";
5
- import y from "../../../../components/Sider/index.mjs";
6
- const z = (l) => {
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { Drawer as c } from "antd";
3
+ import { useContext as p } from "react";
4
+ /* empty css */import u from "../../../../context.mjs";
5
+ import C from "../../../../components/Sider/index.mjs";
6
+ const V = (l) => {
7
7
  const {
8
8
  currentSession: e,
9
- disabled: b = !1,
9
+ disabled: y = !1,
10
10
  application: m,
11
11
  networkStatus: d,
12
12
  setCurrentSession: f,
13
- sessions: c,
14
- // πŸ‘ˆ ζ–°ε’ž
15
- setSessions: p,
16
- // πŸ‘ˆ ζ–°ε’ž
17
- isSessionHistoryVisible: w,
13
+ isSessionHistoryVisible: S,
18
14
  setIsSessionHistoryVisible: o,
19
- onSessionChange: s
15
+ onSessionChange: t
20
16
  } = l, {
21
- popupContainer: t
22
- } = C(S);
23
- return /* @__PURE__ */ a(u, {
17
+ popupContainer: s
18
+ } = p(u);
19
+ return /* @__PURE__ */ n(c, {
24
20
  title: "δΌšθ―εŽ†ε²",
25
21
  open: !0,
26
22
  placement: "bottom",
@@ -29,26 +25,24 @@ const z = (l) => {
29
25
  },
30
26
  className: "session-history-drawer",
31
27
  size: "large",
32
- getContainer: () => (t == null ? void 0 : t.current) || document.body,
28
+ getContainer: () => (s == null ? void 0 : s.current) || document.body,
33
29
  destroyOnClose: !0,
34
30
  style: {
35
31
  position: "absolute"
36
32
  },
37
- children: /* @__PURE__ */ a(y, {
33
+ children: /* @__PURE__ */ n(C, {
38
34
  isShowHeader: !1,
39
35
  application: m,
40
36
  networkStatus: d,
41
37
  currentSession: e,
42
38
  setCurrentSession: f,
43
- sessions: c,
44
- setSessions: p,
45
39
  afterSessionClick: (r) => {
46
- var i, n;
47
- ((i = r.data) == null ? void 0 : i.id) !== ((n = e == null ? void 0 : e.data) == null ? void 0 : n.id) && (o(!1), s == null || s(r));
40
+ var i, a;
41
+ ((i = r.data) == null ? void 0 : i.id) !== ((a = e == null ? void 0 : e.data) == null ? void 0 : a.id) && (o(!1), t == null || t(r));
48
42
  }
49
43
  })
50
44
  });
51
45
  };
52
46
  export {
53
- z as default
47
+ V as default
54
48
  };