@glodon-aiot/agent-cli-ui 3.3.2-beta.14 → 3.3.2-beta.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.
Files changed (46) hide show
  1. package/dist/es/AgentClientUI.mjs +119 -109
  2. package/dist/es/Dialog/AgentChat/index.mjs +281 -269
  3. package/dist/es/Dialog/SessionList/index.mjs +35 -34
  4. package/dist/es/Dialog/index.mjs +101 -94
  5. package/dist/es/components/FilePreview/index.mjs +26 -25
  6. package/dist/es/index.mjs +212 -182
  7. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  8. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  9. package/dist/es/src/style.css +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/style16.css +1 -1
  17. package/dist/es/src/style17.css +1 -1
  18. package/dist/es/src/style18.css +1 -1
  19. package/dist/es/src/style19.css +1 -1
  20. package/dist/es/src/style20.css +1 -1
  21. package/dist/es/src/style21.css +1 -1
  22. package/dist/es/src/style22.css +1 -1
  23. package/dist/es/src/style23.css +1 -1
  24. package/dist/es/src/style24.css +1 -1
  25. package/dist/es/src/style25.css +1 -1
  26. package/dist/es/src/style26.css +1 -1
  27. package/dist/es/src/style27.css +1 -1
  28. package/dist/es/src/style28.css +1 -1
  29. package/dist/es/src/style29.css +1 -1
  30. package/dist/es/src/style3.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/style4.css +1 -1
  34. package/dist/es/src/style5.css +1 -1
  35. package/dist/es/src/style6.css +1 -1
  36. package/dist/es/src/style7.css +1 -1
  37. package/dist/es/src/style8.css +1 -1
  38. package/dist/es/src/style9.css +1 -1
  39. package/dist/lib/index.css +1 -1
  40. package/dist/lib/index.js +30 -30
  41. package/dist/src/AgentClientUI.d.ts +10 -2
  42. package/dist/src/Dialog/SessionList/index.d.ts +1 -0
  43. package/dist/src/Dialog/index.d.ts +9 -1
  44. package/dist/src/index.d.ts +7 -2
  45. package/dist/src/types.d.ts +2 -1
  46. package/package.json +3 -3
@@ -1,145 +1,155 @@
1
- var Z = Object.defineProperty, _ = Object.defineProperties;
2
- var B = Object.getOwnPropertyDescriptors;
3
- var N = Object.getOwnPropertySymbols;
4
- var z = Object.prototype.hasOwnProperty, ee = Object.prototype.propertyIsEnumerable;
5
- var y = (n, e, o) => e in n ? Z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, d = (n, e) => {
6
- for (var o in e || (e = {}))
7
- z.call(e, o) && y(n, o, e[o]);
8
- if (N)
9
- for (var o of N(e))
10
- ee.call(e, o) && y(n, o, e[o]);
1
+ var z = Object.defineProperty, ee = Object.defineProperties;
2
+ var te = Object.getOwnPropertyDescriptors;
3
+ var y = Object.getOwnPropertySymbols;
4
+ var oe = Object.prototype.hasOwnProperty, ne = Object.prototype.propertyIsEnumerable;
5
+ var I = (n, t, e) => t in n ? z(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, f = (n, t) => {
6
+ for (var e in t || (t = {}))
7
+ oe.call(t, e) && I(n, e, t[e]);
8
+ if (y)
9
+ for (var e of y(t))
10
+ ne.call(t, e) && I(n, e, t[e]);
11
11
  return n;
12
- }, m = (n, e) => _(n, B(e));
12
+ }, h = (n, t) => ee(n, te(t));
13
13
  import { jsx as s, jsxs as x } from "react/jsx-runtime";
14
- import { useRef as oe, useState as l, useEffect as I } from "react";
15
- /* empty css */import { AgentClientProvider as te } from "./context.mjs";
16
- import { Resizable as ne } from "react-resizable";
17
- import ie from "./Dialog/index.mjs";
18
- import { configure as se, BotClient as le } from "@glodon-aiot/bot-client-sdk";
19
- import { JWT as ae } from "./utils/index.mjs";
20
- import { ConfigProvider as R, Spin as de, Button as k } from "antd";
21
- import me from "antd/es/locale/zh_CN";
22
- const ye = (n) => {
14
+ import { forwardRef as ie, useRef as k, useState as d, useEffect as A, useImperativeHandle as se } from "react";
15
+ /* empty css */import { AgentClientProvider as le } from "./context.mjs";
16
+ import { Resizable as ae } from "react-resizable";
17
+ import re from "./Dialog/index.mjs";
18
+ import { configure as de, BotClient as me } from "@glodon-aiot/bot-client-sdk";
19
+ import { JWT as ce } from "./utils/index.mjs";
20
+ import { ConfigProvider as L, Spin as fe, Button as U } from "antd";
21
+ import he from "antd/es/locale/zh_CN";
22
+ const ke = ie((n, t) => {
23
23
  const {
24
24
  className: e,
25
- triggerButton: o,
26
- size: t,
27
- theme: A,
28
- icon: r,
29
- docViewerUrl: U,
30
- token: a,
31
- debug: $,
32
- env: W,
33
- plugins: j,
34
- mcp: H,
35
- footer: L,
36
- defaultInput: M,
37
- onComment: P,
38
- onSessionLoad: T,
39
- onSessionUnload: D,
40
- onMessage: E,
41
- beforeMessageSend: J,
42
- bodyStyle: c,
43
- apiUrl: O,
44
- sessionId: V,
45
- disabled: q,
46
- transform: F,
47
- features: G,
48
- stream: K
49
- } = n, h = oe(null), [Q, re] = l(!1), [f, S] = l(), [p, X] = l(), [i, g] = l(t), [b, C] = l(n.open);
50
- I(() => {
51
- if (!a)
25
+ triggerButton: l,
26
+ size: o,
27
+ theme: $,
28
+ icon: g,
29
+ docViewerUrl: H,
30
+ token: m,
31
+ debug: W,
32
+ env: j,
33
+ plugins: M,
34
+ mcp: P,
35
+ footer: S,
36
+ defaultInput: T,
37
+ onComment: D,
38
+ onSessionLoad: E,
39
+ onSessionUnload: J,
40
+ onMessage: O,
41
+ beforeMessageSend: V,
42
+ bodyStyle: p,
43
+ apiUrl: q,
44
+ sessionId: F,
45
+ disabled: G,
46
+ transform: K,
47
+ features: Q,
48
+ stream: X
49
+ } = n, u = k(null), [Y, ge] = d(!1), [C, Z] = d(), [b, _] = d(), [i, w] = d(o), [v, N] = d(n.open), c = k(null);
50
+ A(() => {
51
+ if (!m)
52
52
  return;
53
- const u = ae(a);
54
- S(u.rid), se({
55
- debug: $,
56
- env: W,
57
- apiRoot: O
53
+ const a = ce(m);
54
+ Z(a.rid), de({
55
+ debug: W,
56
+ env: j,
57
+ apiRoot: q
58
58
  });
59
- const w = new le(a, {
60
- plugins: j,
61
- mcp: H,
62
- stream: K
59
+ const r = new me(m, {
60
+ plugins: M,
61
+ mcp: P,
62
+ stream: X
63
63
  });
64
- X(w);
65
- }, [a]), R.config({
66
- theme: A
67
- }), I(() => {
68
- t && g(t);
69
- }, [t]);
70
- const Y = (u, {
71
- element: w,
72
- size: v
64
+ _(r);
65
+ }, [m]), L.config({
66
+ theme: $
67
+ }), A(() => {
68
+ o && w(o);
69
+ }, [o]);
70
+ const B = (a, {
71
+ element: r,
72
+ size: R
73
73
  }) => {
74
- g({
75
- width: Number(v.width),
76
- height: v.height
74
+ w({
75
+ width: Number(R.width),
76
+ height: R.height
77
77
  });
78
78
  };
79
- return /* @__PURE__ */ s(R, {
80
- locale: me,
81
- children: /* @__PURE__ */ x(te, {
82
- value: m(d({}, n), {
83
- popupContainer: h,
84
- agentClient: p,
85
- footer: L,
86
- defaultInput: M,
87
- onComment: P,
88
- onSessionLoad: T,
89
- onSessionUnload: D,
90
- onMessage: E,
91
- beforeMessageSend: J,
92
- bodyStyle: c,
93
- disabled: q,
94
- transform: F,
95
- features: G
79
+ return se(t, () => ({
80
+ sessionCreate: (a) => {
81
+ var r;
82
+ return (r = c.current) == null ? void 0 : r.sessionCreate(a);
83
+ },
84
+ getSessionList: () => {
85
+ var a;
86
+ return (a = c.current) == null ? void 0 : a.getSessionList();
87
+ }
88
+ })), /* @__PURE__ */ s(L, {
89
+ locale: he,
90
+ children: /* @__PURE__ */ x(le, {
91
+ value: h(f({}, n), {
92
+ popupContainer: u,
93
+ agentClient: b,
94
+ footer: S,
95
+ defaultInput: T,
96
+ onComment: D,
97
+ onSessionLoad: E,
98
+ onSessionUnload: J,
99
+ onMessage: O,
100
+ beforeMessageSend: V,
101
+ bodyStyle: p,
102
+ disabled: G,
103
+ transform: K,
104
+ features: Q
96
105
  }),
97
- children: [/* @__PURE__ */ s(ne, {
106
+ children: [/* @__PURE__ */ s(ae, {
98
107
  height: (i == null ? void 0 : i.height) || "100%",
99
108
  width: (i == null ? void 0 : i.width) || "100%",
100
109
  maxConstraints: [document.body.clientWidth - 45],
101
- minConstraints: [Number(t == null ? void 0 : t.minWidth)],
102
- onResize: Y,
110
+ minConstraints: [Number(o == null ? void 0 : o.minWidth)],
111
+ onResize: B,
103
112
  handle: /* @__PURE__ */ s("span", {
104
113
  className: "resize-handle-ew"
105
114
  }),
106
115
  resizeHandles: e == "float" ? ["w"] : [],
107
116
  children: /* @__PURE__ */ x("div", {
108
117
  id: "dialog-modal",
109
- className: `gbot-dialog-modal ${e} ${b ? "opened" : "closed"}`,
110
- style: m(d({}, t), {
111
- width: e == "float" ? i == null ? void 0 : i.width : t == null ? void 0 : t.width,
112
- height: e === "float" ? i == null ? void 0 : i.height : t == null ? void 0 : t.height,
118
+ className: `gbot-dialog-modal ${e} ${v ? "opened" : "closed"}`,
119
+ style: h(f({}, o), {
120
+ width: e == "float" ? i == null ? void 0 : i.width : o == null ? void 0 : o.width,
121
+ height: e === "float" ? i == null ? void 0 : i.height : o == null ? void 0 : o.height,
113
122
  maxHeight: "100vh"
114
123
  }),
115
- ref: h,
116
- children: [Q ? /* @__PURE__ */ s("div", {
124
+ ref: u,
125
+ children: [Y ? /* @__PURE__ */ s("div", {
117
126
  className: "loading",
118
- children: /* @__PURE__ */ s(de, {})
119
- }) : f && p ? /* @__PURE__ */ s(ie, {
120
- appId: f,
121
- docViewerUrl: U,
122
- bodyStyle: c,
123
- sessionId: V
124
- }) : null, (o == null ? void 0 : o.visible) && /* @__PURE__ */ s(k, {
127
+ children: /* @__PURE__ */ s(fe, {})
128
+ }) : C && b ? /* @__PURE__ */ s(re, {
129
+ ref: c,
130
+ appId: C,
131
+ docViewerUrl: H,
132
+ bodyStyle: p,
133
+ sessionId: F
134
+ }) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(U, {
125
135
  className: "trigger-btn close-btn",
126
136
  icon: /* @__PURE__ */ s("img", {
127
- src: r
137
+ src: g
128
138
  }),
129
- onClick: () => C(!1)
139
+ onClick: () => N(!1)
130
140
  })]
131
141
  })
132
- }), (o == null ? void 0 : o.visible) && !b && /* @__PURE__ */ s(k, {
142
+ }), (l == null ? void 0 : l.visible) && !v && /* @__PURE__ */ s(U, {
133
143
  className: `${e}-trigger-btn open-btn`,
134
- style: o.style,
144
+ style: l.style,
135
145
  icon: /* @__PURE__ */ s("img", {
136
- src: r
146
+ src: g
137
147
  }),
138
- onClick: () => C(!0)
148
+ onClick: () => N(!0)
139
149
  })]
140
150
  })
141
151
  });
142
- };
152
+ });
143
153
  export {
144
- ye as default
154
+ ke as default
145
155
  };