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