@glodon-aiot/agent-cli-ui 3.2.10-beta.8 → 3.3.0-beta.13

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