@glodon-aiot/agent-cli-ui 3.0.4 → 3.0.5-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.
@@ -288,7 +288,7 @@ ${t}` : t, r = new _(i, l, W.User, n);
288
288
  if (!t)
289
289
  return;
290
290
  const n = (i) => {
291
- if (i.sessionId && i.sessionId !== Ne.current || i.role === W.User)
291
+ if (!i.sessionId || i.sessionId && i.sessionId !== Ne.current || i.role === W.User)
292
292
  return;
293
293
  if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (H(!1), M(!1), h.current = h.current.filter((a) => !a.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
294
294
  return Qt.error({
@@ -46,7 +46,7 @@ const u = (o) => {
46
46
  const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
47
47
  return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
48
48
  }, Ke = (o) => {
49
- var S, b, E, k, T, A, O, x, F;
49
+ var S, b, E, k, T, A, x, O, F;
50
50
  const {
51
51
  application: r,
52
52
  currentSession: a,
@@ -118,6 +118,7 @@ const u = (o) => {
118
118
  children: /* @__PURE__ */ e("span", {
119
119
  className: "item-user-content",
120
120
  children: /* @__PURE__ */ e(C, {
121
+ showLatex: !1,
121
122
  children: Se(t.content)
122
123
  })
123
124
  })
@@ -296,7 +297,7 @@ const u = (o) => {
296
297
  }), /* @__PURE__ */ e(C, {
297
298
  children: t.content
298
299
  })]
299
- }), (A = t == null ? void 0 : t.reference) != null && A.length && !((O = i == null ? void 0 : i.reference) != null && O.referenceFirst) ? /* @__PURE__ */ e(K, {
300
+ }), (A = t == null ? void 0 : t.reference) != null && A.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(K, {
300
301
  history: t,
301
302
  docViewerUrl: g
302
303
  }) : null, t.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
@@ -315,7 +316,7 @@ const u = (o) => {
315
316
  size: 4,
316
317
  text: "思考中"
317
318
  })
318
- }), (i == null ? void 0 : i.relate) && h && !!((x = t.relatedQuesion) != null && x.length) && /* @__PURE__ */ e(Ce, {
319
+ }), (i == null ? void 0 : i.relate) && h && !!((O = t.relatedQuesion) != null && O.length) && /* @__PURE__ */ e(Ce, {
319
320
  relatedQuesion: t.relatedQuesion,
320
321
  onRelatedClick: Y
321
322
  }), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as p } from "../../_virtual/jsx-runtime.mjs";
1
+ import { jsx as e, jsxs as p } from "../../_virtual/jsx-runtime.mjs";
2
2
  import { ExclamationCircleFilled as f } from "@ant-design/icons";
3
3
  import { Modal as u, Button as s } from "antd";
4
4
  import { useContext as h } from "react";
@@ -14,28 +14,26 @@ const E = (r) => {
14
14
  service: n
15
15
  } = h(C), d = /* @__PURE__ */ p("div", {
16
16
  className: "title",
17
- children: [/* @__PURE__ */ o(f, {
17
+ children: [/* @__PURE__ */ e(f, {
18
18
  style: {
19
19
  color: "#FF9326",
20
20
  fontSize: 20
21
21
  }
22
- }), /* @__PURE__ */ o("span", {
22
+ }), /* @__PURE__ */ e("span", {
23
23
  children: "文件任务正在处理"
24
24
  })]
25
25
  }), m = () => {
26
26
  if (!l)
27
27
  return;
28
28
  const i = [];
29
- a.filter((e) => e.id).forEach((e) => i.push({
30
- id: e.id,
31
- status: e.status
29
+ a.filter((o) => o.id).forEach((o) => i.push({
30
+ id: o.id,
31
+ status: o.status
32
32
  })), n == null || n.deleteSessionKnowledgeFiles(l, {
33
33
  files: i
34
- }).then((e) => {
35
- console.log(e);
36
34
  }), t("abandon");
37
35
  };
38
- return /* @__PURE__ */ o(u, {
36
+ return /* @__PURE__ */ e(u, {
39
37
  className: "prompt-modal",
40
38
  width: 340,
41
39
  open: c,
@@ -44,19 +42,19 @@ const E = (r) => {
44
42
  maskClosable: !1,
45
43
  onCancel: () => t("close"),
46
44
  getContainer: document.getElementById("dialog-modal") || !1,
47
- footer: [/* @__PURE__ */ o(s, {
45
+ footer: [/* @__PURE__ */ e(s, {
48
46
  onClick: () => {
49
47
  m();
50
48
  },
51
49
  children: "放弃文件"
52
- }, "cancel"), /* @__PURE__ */ o(s, {
50
+ }, "cancel"), /* @__PURE__ */ e(s, {
53
51
  type: "primary",
54
52
  onClick: () => {
55
53
  t("continue");
56
54
  },
57
55
  children: "继续上传"
58
56
  }, "confirm")],
59
- children: /* @__PURE__ */ o("div", {
57
+ children: /* @__PURE__ */ e("div", {
60
58
  className: "content",
61
59
  children: "你可以选择后台继续上传,也可以直接离开放弃上传中的文件。"
62
60
  })
@@ -1,5 +1,5 @@
1
1
  import { jsxs as s, jsx as r } from "../_virtual/jsx-runtime.mjs";
2
- import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as f } from "react";
2
+ import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as g } from "react";
3
3
  import Z from "react-quill";
4
4
  import T from "../node_modules/classnames/index.mjs";
5
5
  import ee from "../Iconfont/index.mjs";
@@ -25,15 +25,14 @@ const ie = X((z, F) => {
25
25
  prevent: H,
26
26
  focus: x,
27
27
  update: W
28
- })), f(() => {
29
- l(N), n.current && (g(), x());
28
+ })), g(() => {
29
+ l(N), n.current && (f(), x());
30
30
  }, [N]);
31
31
  const W = (e) => {
32
32
  l(e);
33
33
  }, $ = () => {
34
34
  l(void 0), w(void 0);
35
35
  }, H = () => {
36
- console.log("prevent");
37
36
  }, x = () => {
38
37
  if (!n.current || b)
39
38
  return;
@@ -42,15 +41,15 @@ const ie = X((z, F) => {
42
41
  e.getLength() > 0 && e.setSelection(e.getLength(), e.getLength());
43
42
  });
44
43
  };
45
- f(() => {
44
+ g(() => {
46
45
  if (!n.current)
47
46
  return;
48
47
  const e = n.current.getEditor();
49
48
  c && (e.on("text-change", () => {
50
- e.getLength() > c && e.deleteText(c, e.getLength()), g(), K(), x();
49
+ e.getLength() > c && e.deleteText(c, e.getLength()), f(), K(), x();
51
50
  }), e.on("selection-change", K));
52
51
  }, [n, c]);
53
- const g = () => {
52
+ const f = () => {
54
53
  if (!n.current)
55
54
  return;
56
55
  const e = n.current.getEditor();
@@ -85,11 +84,11 @@ const ie = X((z, F) => {
85
84
  const e = (t = n.current) == null ? void 0 : t.getEditor();
86
85
  return e && (e == null ? void 0 : e.getLength()) > 2 && !((i = e.getText()) != null && i.includes(p.NETWORK)) && !((u = e.getText()) != null && u.includes(p.DOCUMENT));
87
86
  };
88
- return f(() => {
87
+ return g(() => {
89
88
  var e, t;
90
89
  m ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
91
- }, [m]), f(() => (window.addEventListener("resize", g), () => {
92
- window.removeEventListener("resize", g);
90
+ }, [m]), g(() => (window.addEventListener("resize", f), () => {
91
+ window.removeEventListener("resize", f);
93
92
  }), []), /* @__PURE__ */ s("div", {
94
93
  className: T({
95
94
  "quill-editor": !0,
@@ -1,53 +1,69 @@
1
- var f = Object.defineProperty, l = Object.defineProperties;
2
- var s = Object.getOwnPropertyDescriptors;
3
- var a = Object.getOwnPropertySymbols;
4
- var d = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
5
- var n = (e, r, o) => r in e ? f(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, m = (e, r) => {
6
- for (var o in r || (r = {}))
7
- d.call(r, o) && n(e, o, r[o]);
8
- if (a)
9
- for (var o of a(r))
10
- c.call(r, o) && n(e, o, r[o]);
11
- return e;
12
- }, p = (e, r) => l(e, s(r));
13
- import { jsx as t } from "../../_virtual/jsx-runtime.mjs";
14
- import { useRef as k } from "react";
15
- import h from "react-markdown";
16
- import u from "remark-gfm";
17
- import g from "rehype-raw";
18
- import w from "rehype-external-links";
1
+ var c = Object.defineProperty, g = Object.defineProperties;
2
+ var h = Object.getOwnPropertyDescriptors;
3
+ var t = Object.getOwnPropertySymbols;
4
+ var l = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
5
+ var f = (r, e, o) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, a = (r, e) => {
6
+ for (var o in e || (e = {}))
7
+ l.call(e, o) && f(r, o, e[o]);
8
+ if (t)
9
+ for (var o of t(e))
10
+ s.call(e, o) && f(r, o, e[o]);
11
+ return r;
12
+ }, d = (r, e) => g(r, h(e));
13
+ var k = (r, e) => {
14
+ var o = {};
15
+ for (var m in r)
16
+ l.call(r, m) && e.indexOf(m) < 0 && (o[m] = r[m]);
17
+ if (r != null && t)
18
+ for (var m of t(r))
19
+ e.indexOf(m) < 0 && s.call(r, m) && (o[m] = r[m]);
20
+ return o;
21
+ };
22
+ import { jsx as i } from "../../_virtual/jsx-runtime.mjs";
23
+ import { useRef as w } from "react";
24
+ import x from "react-markdown";
25
+ import M from "remark-gfm";
26
+ import y from "rehype-raw";
27
+ import R from "rehype-external-links";
19
28
  import "../../node_modules/katex/dist/katex.min.css.mjs";
20
29
  import "./style.less.mjs";
21
- import x from "./Image/index.mjs";
22
- import M from "./Code/index.mjs";
23
- import { replaceLatexDelimiters as y } from "../../utils/index.mjs";
24
- import R from "../../node_modules/rehype-katex/lib/index.mjs";
25
- import L from "../../node_modules/remark-math/lib/index.mjs";
26
- const z = (e) => {
27
- const r = k(null), o = y(e.children);
28
- return /* @__PURE__ */ t("div", {
29
- ref: r,
30
- children: /* @__PURE__ */ t(h, p(m({
30
+ import L from "./Image/index.mjs";
31
+ import P from "./Code/index.mjs";
32
+ import { replaceLatexDelimiters as b } from "../../utils/index.mjs";
33
+ import j from "../../node_modules/rehype-katex/lib/index.mjs";
34
+ import v from "../../node_modules/remark-math/lib/index.mjs";
35
+ const H = (m) => {
36
+ var p = m, {
37
+ showLatex: r = !0,
38
+ children: e
39
+ } = p, o = k(p, [
40
+ "showLatex",
41
+ "children"
42
+ ]);
43
+ const u = w(null);
44
+ return /* @__PURE__ */ i("div", {
45
+ ref: u,
46
+ children: /* @__PURE__ */ i(x, d(a({
31
47
  className: "markdown",
32
- rehypePlugins: [R, g, [w, {
48
+ rehypePlugins: [j, y, [R, {
33
49
  target: "_blank"
34
50
  }]],
35
- remarkPlugins: [L, [u, {
51
+ remarkPlugins: [v, [M, {
36
52
  singleTilde: !1
37
53
  }]]
38
- }, e), {
39
- children: o,
54
+ }, o), {
55
+ children: r ? b(e) : e,
40
56
  components: {
41
- img(i) {
42
- return /* @__PURE__ */ t(x, m({}, i));
57
+ img(n) {
58
+ return /* @__PURE__ */ i(L, a({}, n));
43
59
  },
44
- code(i) {
45
- return /* @__PURE__ */ t(M, m({}, i));
60
+ code(n) {
61
+ return /* @__PURE__ */ i(P, a({}, n));
46
62
  }
47
63
  }
48
64
  }))
49
65
  });
50
66
  };
51
67
  export {
52
- z as default
68
+ H as default
53
69
  };