@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4
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.
- package/dist/es/AgentClientUI.mjs +97 -110
- package/dist/es/Dialog/AgentChat/index.mjs +516 -467
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
- package/dist/es/Dialog/FileCard/index.mjs +48 -55
- package/dist/es/Dialog/FilePreview/index.mjs +35 -42
- package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
- package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
- package/dist/es/Dialog/PromptManager/index.mjs +29 -36
- package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
- package/dist/es/Dialog/SessionAction/index.mjs +92 -91
- package/dist/es/Dialog/SessionList/index.mjs +135 -121
- package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
- package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
- package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
- package/dist/es/Dialog/index.mjs +125 -93
- package/dist/es/QuillEditor/index.mjs +91 -86
- package/dist/es/_virtual/index.mjs +2 -2
- package/dist/es/components/Markdown/Image/index.mjs +20 -20
- package/dist/es/components/Markdown/index.mjs +27 -22
- package/dist/es/constant.mjs +8 -5
- package/dist/es/index.mjs +178 -152
- package/dist/es/node_modules/classnames/index.mjs +1 -1
- package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
- package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
- package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
- package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
- package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
- package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
- package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
- package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
- package/dist/es/node_modules/longest-streak/index.mjs +12 -0
- package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
- package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
- package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
- package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
- package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
- package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
- package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
- package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
- package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
- package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/utils/index.mjs +44 -27
- package/dist/lib/index.js +278 -138
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
- package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
- package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +5 -4
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/Markdown/Text/index.d.ts +8 -0
- package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
- package/dist/src/components/MathJaxRender/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/contexts/MathJaxContext.d.ts +12 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +26 -6
- package/dist/src/utils/index.d.ts +15 -0
- package/package.json +18 -17
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/index4.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
|
@@ -1,171 +1,185 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var N = (V, E, f) => new Promise((a, i) => {
|
|
2
|
+
var v = (p) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
k(f.next(p));
|
|
5
|
+
} catch (s) {
|
|
6
|
+
i(s);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, g = (p) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
k(f.throw(p));
|
|
11
|
+
} catch (s) {
|
|
12
|
+
i(s);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, k = (p) => p.done ? a(p.value) : Promise.resolve(p.value).then(v, g);
|
|
15
|
+
k((f = f.apply(V, E)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { forwardRef as
|
|
19
|
-
import { Button as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
17
|
+
import { jsx as n, jsxs as r } from "../../_virtual/jsx-runtime.mjs";
|
|
18
|
+
import { forwardRef as U, useState as L, useContext as q, useEffect as x, useImperativeHandle as G } from "react";
|
|
19
|
+
import { Button as J, Popconfirm as H, Input as Q, Space as T } from "antd";
|
|
20
|
+
import W from "dayjs";
|
|
21
|
+
import X from "../../node_modules/classnames/index.mjs";
|
|
22
|
+
import O from "../../Iconfont/index.mjs";
|
|
23
|
+
import Y from "../../context.mjs";
|
|
24
24
|
import "./style.less.mjs";
|
|
25
|
-
import
|
|
26
|
-
const
|
|
27
|
-
var M;
|
|
25
|
+
import Z from "../../node_modules/ahooks/es/useMemoizedFn/index.mjs";
|
|
26
|
+
const $ = U((V, E) => {
|
|
28
27
|
const {
|
|
29
|
-
sider:
|
|
30
|
-
currentSession:
|
|
31
|
-
setCurrentSession:
|
|
32
|
-
checkKnowledges:
|
|
33
|
-
application:
|
|
34
|
-
networkStatus:
|
|
35
|
-
} =
|
|
36
|
-
agentClient:
|
|
37
|
-
mode:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
sider: f,
|
|
29
|
+
currentSession: a,
|
|
30
|
+
setCurrentSession: i,
|
|
31
|
+
checkKnowledges: v,
|
|
32
|
+
application: g,
|
|
33
|
+
networkStatus: k
|
|
34
|
+
} = V, [p, s] = L(), {
|
|
35
|
+
agentClient: m,
|
|
36
|
+
mode: P,
|
|
37
|
+
features: t
|
|
38
|
+
} = q(Y), [h, j] = L([]), [D, K] = L(v), M = Z(() => {
|
|
39
|
+
var e;
|
|
40
|
+
if (!((e = a == null ? void 0 : a.data) != null && e.id))
|
|
41
41
|
return;
|
|
42
|
-
const
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
42
|
+
const d = h.map((l) => {
|
|
43
|
+
var o, c;
|
|
44
|
+
return ((o = l.data) == null ? void 0 : o.id) === ((c = a.data) == null ? void 0 : c.id) ? a : l;
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
j([...d]);
|
|
47
47
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
|
|
48
|
+
x(() => {
|
|
49
|
+
m == null || m.getSessions().then((d) => N(void 0, null, function* () {
|
|
50
|
+
var e;
|
|
51
|
+
if (j([...d]), !((e = a == null ? void 0 : a.data) != null && e.id) && (d != null && d.length) && P === "inlay") {
|
|
52
|
+
const l = d[0];
|
|
53
|
+
i == null || i(l);
|
|
54
54
|
}
|
|
55
55
|
}));
|
|
56
|
-
}, []),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
}, []), x(() => {
|
|
57
|
+
var d;
|
|
58
|
+
if (!((d = a == null ? void 0 : a.data) != null && d.id) && v === void 0) {
|
|
59
|
+
const e = typeof (t == null ? void 0 : t.knowledges) == "object" && t.knowledges.default || void 0;
|
|
60
|
+
K(e);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
K(v);
|
|
64
|
+
}, [v]), x(() => {
|
|
65
|
+
a == null || a.addEventListener("data:updated", M);
|
|
66
|
+
}, [a]), G(E, () => ({
|
|
67
|
+
create(d) {
|
|
68
|
+
return C(d);
|
|
61
69
|
}
|
|
62
70
|
}));
|
|
63
|
-
const
|
|
64
|
-
var
|
|
65
|
-
const
|
|
66
|
-
name:
|
|
71
|
+
const C = (d) => new Promise((e) => N(void 0, null, function* () {
|
|
72
|
+
var c;
|
|
73
|
+
const l = typeof (t == null ? void 0 : t.promptVariables) == "object" ? (t == null ? void 0 : t.promptVariables.default) || [] : void 0, o = yield m == null ? void 0 : m.loadSession("", {
|
|
74
|
+
name: d == null ? void 0 : d.name,
|
|
67
75
|
// @ts-ignore netOpen入参是number 响应是boolen
|
|
68
76
|
// 只有对话有联网 其它没有
|
|
69
|
-
netOpen: (
|
|
70
|
-
knowledges: (
|
|
77
|
+
netOpen: (g == null ? void 0 : g.type) === 0 ? d == null ? void 0 : d.netOpen : void 0,
|
|
78
|
+
knowledges: (c = a == null ? void 0 : a.data) != null && c.id ? d == null ? void 0 : d.knowledges : D,
|
|
79
|
+
promptVariables: l
|
|
71
80
|
});
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
o == null || o.addEventListener("data:created", () => N(void 0, null, function* () {
|
|
82
|
+
j([o, ...h]), e(o);
|
|
74
83
|
}));
|
|
75
|
-
})),
|
|
76
|
-
|
|
77
|
-
netOpen: (
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
})), z = () => {
|
|
85
|
+
C({
|
|
86
|
+
netOpen: (h == null ? void 0 : h.length) > 0 ? 2 : k ? 1 : 2,
|
|
87
|
+
knowledges: D
|
|
88
|
+
}).then((d) => {
|
|
89
|
+
i == null || i(d);
|
|
80
90
|
});
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
const
|
|
85
|
-
var
|
|
86
|
-
return ((
|
|
91
|
+
}, A = (d) => {
|
|
92
|
+
m == null || m.removeSession(d, !0).then(() => N(void 0, null, function* () {
|
|
93
|
+
var l, o;
|
|
94
|
+
const e = h.filter((c) => {
|
|
95
|
+
var w, y;
|
|
96
|
+
return ((w = c.data) == null ? void 0 : w.id) !== ((y = d.data) == null ? void 0 : y.id);
|
|
87
97
|
});
|
|
88
|
-
((
|
|
98
|
+
((l = d.data) == null ? void 0 : l.id) === ((o = a == null ? void 0 : a.data) == null ? void 0 : o.id) && (e != null && e.length ? i == null || i(e[0]) : i == null || i(void 0)), j([...e]);
|
|
89
99
|
}));
|
|
90
|
-
},
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
}),
|
|
98
|
-
|
|
100
|
+
}, F = (d) => {
|
|
101
|
+
var e;
|
|
102
|
+
s((e = d.data) == null ? void 0 : e.name);
|
|
103
|
+
}, R = (d) => {
|
|
104
|
+
p && (d.rename(p), d == null || d.addEventListener("data:updated", M));
|
|
105
|
+
}, _ = (d) => N(void 0, null, function* () {
|
|
106
|
+
i == null || i(d);
|
|
107
|
+
}), B = (d) => {
|
|
108
|
+
s(d.target.value);
|
|
99
109
|
};
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
return x(() => {
|
|
111
|
+
var e, l, o, c;
|
|
112
|
+
if (!(a != null && a.id))
|
|
113
|
+
return;
|
|
114
|
+
const d = {};
|
|
115
|
+
typeof (t == null ? void 0 : t.knowledges) == "object" && ((e = t == null ? void 0 : t.knowledges) != null && e.default) && (d.knowledges = (l = t == null ? void 0 : t.knowledges) == null ? void 0 : l.default), typeof (t == null ? void 0 : t.promptVariables) == "object" && ((o = t == null ? void 0 : t.promptVariables) != null && o.default) && (d.promptVariables = (c = t == null ? void 0 : t.promptVariables) == null ? void 0 : c.default), m == null || m.loadSession(a.id, d);
|
|
116
|
+
}, [a]), /* @__PURE__ */ n("div", {
|
|
103
117
|
className: "bot-session-container",
|
|
104
|
-
children:
|
|
118
|
+
children: f && P === "inlay" && /* @__PURE__ */ r("div", {
|
|
105
119
|
className: "agent-sessions",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ r("div", {
|
|
107
121
|
className: "sessions-header",
|
|
108
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ n("span", {
|
|
109
123
|
className: "session-header-title",
|
|
110
124
|
children: "会话列表"
|
|
111
|
-
}), /* @__PURE__ */
|
|
125
|
+
}), /* @__PURE__ */ n(J, {
|
|
112
126
|
className: "session-header-btn",
|
|
113
|
-
onClick:
|
|
127
|
+
onClick: z,
|
|
114
128
|
children: "+ 新建会话"
|
|
115
129
|
})]
|
|
116
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ n("div", {
|
|
117
131
|
className: "sessions-main",
|
|
118
|
-
children:
|
|
119
|
-
var
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
className:
|
|
132
|
+
children: h == null ? void 0 : h.map((d) => {
|
|
133
|
+
var e, l, o, c, w, y;
|
|
134
|
+
return /* @__PURE__ */ n("div", {
|
|
135
|
+
className: X({
|
|
122
136
|
"session-item": !0,
|
|
123
|
-
"session-item__active": ((
|
|
137
|
+
"session-item__active": ((e = d.data) == null ? void 0 : e.id) === ((l = a == null ? void 0 : a.data) == null ? void 0 : l.id)
|
|
124
138
|
}),
|
|
125
|
-
onClick: () =>
|
|
126
|
-
children: /* @__PURE__ */
|
|
139
|
+
onClick: () => _(d),
|
|
140
|
+
children: /* @__PURE__ */ r("div", {
|
|
127
141
|
className: "session-item-wrapper",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ r("div", {
|
|
129
143
|
className: "session-item-top",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ n("span", {
|
|
131
145
|
className: "item-top-title",
|
|
132
|
-
children: ((
|
|
133
|
-
}), /* @__PURE__ */
|
|
146
|
+
children: ((o = d.data) == null ? void 0 : o.name) || "-"
|
|
147
|
+
}), /* @__PURE__ */ r("div", {
|
|
134
148
|
className: "item-top-action",
|
|
135
|
-
onClick: (
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
getPopupContainer: (
|
|
149
|
+
onClick: (b) => b.stopPropagation(),
|
|
150
|
+
children: [/* @__PURE__ */ n(H, {
|
|
151
|
+
getPopupContainer: (b) => b.parentNode,
|
|
138
152
|
icon: !1,
|
|
139
|
-
title: /* @__PURE__ */
|
|
153
|
+
title: /* @__PURE__ */ n(Q, {
|
|
140
154
|
placeholder: "请输入内容",
|
|
141
155
|
autoComplete: "off",
|
|
142
156
|
showCount: !0,
|
|
143
|
-
value:
|
|
144
|
-
onChange:
|
|
157
|
+
value: p,
|
|
158
|
+
onChange: B,
|
|
145
159
|
maxLength: 15
|
|
146
160
|
}),
|
|
147
|
-
onConfirm: () =>
|
|
148
|
-
children: /* @__PURE__ */
|
|
161
|
+
onConfirm: () => R(d),
|
|
162
|
+
children: /* @__PURE__ */ n(O, {
|
|
149
163
|
type: "icon-bianji2",
|
|
150
|
-
onClick: () =>
|
|
164
|
+
onClick: () => F(d),
|
|
151
165
|
className: "icon-action",
|
|
152
166
|
style: {
|
|
153
167
|
marginRight: "8px"
|
|
154
168
|
}
|
|
155
169
|
})
|
|
156
|
-
}), /* @__PURE__ */
|
|
157
|
-
getPopupContainer: (
|
|
170
|
+
}), /* @__PURE__ */ n(H, {
|
|
171
|
+
getPopupContainer: (b) => b.parentNode,
|
|
158
172
|
icon: !1,
|
|
159
|
-
title: /* @__PURE__ */
|
|
173
|
+
title: /* @__PURE__ */ r(T, {
|
|
160
174
|
direction: "vertical",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ n("div", {
|
|
162
176
|
children: "删除确认?"
|
|
163
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ n("div", {
|
|
164
178
|
children: "会话删除后不可恢复,请确认是否删除!"
|
|
165
179
|
})]
|
|
166
180
|
}),
|
|
167
|
-
onConfirm: () =>
|
|
168
|
-
children: /* @__PURE__ */
|
|
181
|
+
onConfirm: () => A(d),
|
|
182
|
+
children: /* @__PURE__ */ n(O, {
|
|
169
183
|
style: {
|
|
170
184
|
fontSize: "18px"
|
|
171
185
|
},
|
|
@@ -174,24 +188,24 @@ const X = B((x, w) => {
|
|
|
174
188
|
})
|
|
175
189
|
})]
|
|
176
190
|
})]
|
|
177
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ r("div", {
|
|
178
192
|
className: "session-item-bottom",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ n("span", {
|
|
180
194
|
className: "item-bottom-desc",
|
|
181
|
-
children: ((
|
|
182
|
-
}), /* @__PURE__ */
|
|
195
|
+
children: ((c = d.data) == null ? void 0 : c.finialMessage) || "-"
|
|
196
|
+
}), /* @__PURE__ */ n("span", {
|
|
183
197
|
className: "item-bottom-time",
|
|
184
|
-
children:
|
|
198
|
+
children: W((w = d.data) == null ? void 0 : w.createdAt).format("MM/DD HH:mm:ss")
|
|
185
199
|
})]
|
|
186
200
|
})]
|
|
187
201
|
})
|
|
188
|
-
}, (
|
|
202
|
+
}, (y = d.data) == null ? void 0 : y.id);
|
|
189
203
|
})
|
|
190
204
|
})]
|
|
191
205
|
})
|
|
192
206
|
});
|
|
193
207
|
});
|
|
194
|
-
|
|
208
|
+
$.displayName = "SessionList";
|
|
195
209
|
export {
|
|
196
|
-
|
|
210
|
+
$ as default
|
|
197
211
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as a, jsx as s } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { Popover as p, Button as c } from "antd";
|
|
3
3
|
import { useState as m } from "react";
|
|
4
|
-
import
|
|
4
|
+
import f from "./HistorySessionList/index.mjs";
|
|
5
5
|
import "./style.less.mjs";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import d from "../../Iconfont/index.mjs";
|
|
7
|
+
const C = (o) => {
|
|
8
8
|
const {
|
|
9
9
|
currentSessionId: t,
|
|
10
10
|
disabled: i = !1,
|
|
@@ -13,7 +13,8 @@ const h = (o) => {
|
|
|
13
13
|
return /* @__PURE__ */ a("div", {
|
|
14
14
|
className: "session-list-component",
|
|
15
15
|
children: [/* @__PURE__ */ s(p, {
|
|
16
|
-
placement: "
|
|
16
|
+
placement: "topRight",
|
|
17
|
+
showArrow: !1,
|
|
17
18
|
overlayClassName: "session-list-overlay",
|
|
18
19
|
overlayStyle: {
|
|
19
20
|
padding: "4px"
|
|
@@ -24,7 +25,7 @@ const h = (o) => {
|
|
|
24
25
|
className: "list-overlay-action",
|
|
25
26
|
disabled: i,
|
|
26
27
|
type: "text",
|
|
27
|
-
icon: /* @__PURE__ */ s(
|
|
28
|
+
icon: /* @__PURE__ */ s(d, {
|
|
28
29
|
type: "icon-lishijilu",
|
|
29
30
|
style: {
|
|
30
31
|
fontSize: 24
|
|
@@ -32,7 +33,7 @@ const h = (o) => {
|
|
|
32
33
|
}),
|
|
33
34
|
onClick: () => e(!0)
|
|
34
35
|
})
|
|
35
|
-
}), r && /* @__PURE__ */ s(
|
|
36
|
+
}), r && /* @__PURE__ */ s(f, {
|
|
36
37
|
currentSessionId: t || "",
|
|
37
38
|
onSessionChange: n,
|
|
38
39
|
onClose: () => e(!1)
|
|
@@ -40,5 +41,5 @@ const h = (o) => {
|
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
C as default
|
|
44
45
|
};
|
|
@@ -1,66 +1,59 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a = (p, e, n) => new Promise((l, i) => {
|
|
2
2
|
var m = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
i(
|
|
4
|
+
r(n.next(o));
|
|
5
|
+
} catch (c) {
|
|
6
|
+
i(c);
|
|
7
7
|
}
|
|
8
8
|
}, k = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
i(
|
|
10
|
+
r(n.throw(o));
|
|
11
|
+
} catch (c) {
|
|
12
|
+
i(c);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, r = (o) => o.done ? l(o.value) : Promise.resolve(o.value).then(m, k);
|
|
15
|
+
r((n = n.apply(p, e)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsxs as g, jsx as
|
|
17
|
+
import { jsxs as g, jsx as t } from "../../../_virtual/jsx-runtime.mjs";
|
|
18
18
|
import { useContext as w } from "react";
|
|
19
19
|
import { Space as h, Tooltip as I, Button as y } from "antd";
|
|
20
|
-
import "
|
|
21
|
-
import "../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
22
|
-
import { ISourceType as f, IversionInfo as b } from "../../../packages/apis/dist/es/aecpilot/model.mjs";
|
|
23
|
-
import "dayjs";
|
|
24
|
-
import "../../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
25
|
-
import "../../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
26
|
-
import "../../../packages/apis/dist/es/agentcliui/index.mjs";
|
|
27
|
-
import "../../../packages/apis/dist/es/aecpilotui/index.mjs";
|
|
20
|
+
import { ISourceType as f, IversionInfo as b } from "@glodon-aiot/apis";
|
|
28
21
|
import d from "../../../Iconfont/index.mjs";
|
|
29
22
|
import "./style.less.mjs";
|
|
30
23
|
import x from "../../../components/WebLink/index.mjs";
|
|
31
24
|
import C from "../../../context.mjs";
|
|
32
|
-
const
|
|
33
|
-
var o,
|
|
25
|
+
const F = (p) => {
|
|
26
|
+
var o, c;
|
|
34
27
|
const {
|
|
35
28
|
data: e,
|
|
36
|
-
onClick:
|
|
29
|
+
onClick: n,
|
|
37
30
|
loadPage: l
|
|
38
|
-
} =
|
|
31
|
+
} = p, {
|
|
39
32
|
transform: i
|
|
40
|
-
} = w(C), m = () =>
|
|
33
|
+
} = w(C), m = () => a(void 0, null, function* () {
|
|
41
34
|
return l ? yield l(e.knowledgeId, e.docId, e.textId) : 0;
|
|
42
|
-
}), k = e.sourceType === f.WebLink && !!e.webLink,
|
|
35
|
+
}), k = e.sourceType === f.WebLink && !!e.webLink, r = (
|
|
43
36
|
// data?.origin === IFileOrigin.AECPILOT ||
|
|
44
37
|
e.sourceType === f.SourceFile && !!e.sourceFileName && // data.sourceFileName 标识参考文件存在与否,不能使用其他字段判断
|
|
45
38
|
(e == null ? void 0 : e.versionInfo) !== b.ProtectUnauthorize
|
|
46
39
|
);
|
|
47
40
|
return /* @__PURE__ */ g(h, {
|
|
48
41
|
className: "session-refer-panel",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ t("span", {
|
|
50
43
|
className: "refer-panel-item",
|
|
51
44
|
children: (e.knowledgeSourceName || "") + (e.knowledgeTitleName || "") || "-"
|
|
52
|
-
}), k && ((o = i == null ? void 0 : i.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */
|
|
45
|
+
}), k && ((o = i == null ? void 0 : i.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */ t(I, {
|
|
53
46
|
overlayStyle: {
|
|
54
47
|
maxWidth: "90vw"
|
|
55
48
|
},
|
|
56
|
-
title: /* @__PURE__ */
|
|
49
|
+
title: /* @__PURE__ */ t(x, {
|
|
57
50
|
href: e.webLink,
|
|
58
51
|
onClick: (s) => {
|
|
59
52
|
s.stopPropagation();
|
|
60
53
|
}
|
|
61
54
|
}),
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
icon: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ t(y, {
|
|
56
|
+
icon: /* @__PURE__ */ t(d, {
|
|
64
57
|
type: e.sourceType === f.WebLink ? "icon-lianjie" : "icon-doc-link",
|
|
65
58
|
style: {
|
|
66
59
|
fontSize: 16
|
|
@@ -68,12 +61,12 @@ const D = (a) => {
|
|
|
68
61
|
}),
|
|
69
62
|
type: "link",
|
|
70
63
|
size: "small",
|
|
71
|
-
onClick: (s) =>
|
|
72
|
-
s.stopPropagation(),
|
|
64
|
+
onClick: (s) => a(void 0, null, function* () {
|
|
65
|
+
s.stopPropagation(), n(e);
|
|
73
66
|
})
|
|
74
67
|
})
|
|
75
|
-
}),
|
|
76
|
-
icon: /* @__PURE__ */
|
|
68
|
+
}), r && ((c = i == null ? void 0 : i.reference) == null ? void 0 : c.iconVisible) && /* @__PURE__ */ t(y, {
|
|
69
|
+
icon: /* @__PURE__ */ t(d, {
|
|
77
70
|
type: "icon-doc-link",
|
|
78
71
|
style: {
|
|
79
72
|
fontSize: 16
|
|
@@ -81,14 +74,14 @@ const D = (a) => {
|
|
|
81
74
|
}),
|
|
82
75
|
type: "link",
|
|
83
76
|
size: "small",
|
|
84
|
-
onClick: (s) =>
|
|
77
|
+
onClick: (s) => a(void 0, null, function* () {
|
|
85
78
|
s.stopPropagation();
|
|
86
79
|
const u = (yield m()) || 0;
|
|
87
|
-
|
|
80
|
+
n(e, u);
|
|
88
81
|
})
|
|
89
82
|
})]
|
|
90
83
|
});
|
|
91
84
|
};
|
|
92
85
|
export {
|
|
93
|
-
|
|
86
|
+
F as default
|
|
94
87
|
};
|
|
@@ -1,86 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as n } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { useContext as x } from "react";
|
|
3
3
|
import { Space as p, Collapse as f } from "antd";
|
|
4
4
|
import S from "../../Iconfont/index.mjs";
|
|
5
5
|
import "./style.less.mjs";
|
|
6
|
-
import "
|
|
7
|
-
import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
8
|
-
import { ISourceType as u } from "../../packages/apis/dist/es/aecpilot/model.mjs";
|
|
9
|
-
import "dayjs";
|
|
10
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
11
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
12
|
-
import "../../packages/apis/dist/es/agentcliui/index.mjs";
|
|
13
|
-
import "../../packages/apis/dist/es/aecpilotui/index.mjs";
|
|
6
|
+
import { ISourceType as u } from "@glodon-aiot/apis";
|
|
14
7
|
import D from "../../components/Markdown/index.mjs";
|
|
15
8
|
import y from "./ReferItem/index.mjs";
|
|
16
9
|
import F from "../../context.mjs";
|
|
17
10
|
const {
|
|
18
11
|
Panel: R
|
|
19
|
-
} = f,
|
|
20
|
-
var
|
|
12
|
+
} = f, E = (h) => {
|
|
13
|
+
var r, d, c, m;
|
|
21
14
|
const {
|
|
22
15
|
history: o,
|
|
23
16
|
docViewerUrl: w
|
|
24
17
|
} = h, {
|
|
25
|
-
transform:
|
|
26
|
-
service:
|
|
27
|
-
} = x(F), I = (e,
|
|
18
|
+
transform: i,
|
|
19
|
+
service: l
|
|
20
|
+
} = x(F), I = (e, a) => {
|
|
28
21
|
if (!(!(e != null && e.knowledgeId) || !(e != null && e.docId))) {
|
|
29
22
|
if (e.sourceType === u.WebLink) {
|
|
30
23
|
window.open(e.webLink);
|
|
31
24
|
return;
|
|
32
25
|
}
|
|
33
|
-
e.sourceType === u.SourceFile && window.open(`${w}#/doc?url=${encodeURIComponent(e.sourceFileUrl)}&page=${
|
|
26
|
+
e.sourceType === u.SourceFile && window.open(`${w}#/doc?url=${encodeURIComponent(e.sourceFileUrl)}&page=${a || 0}`);
|
|
34
27
|
}
|
|
35
28
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ s("div", {
|
|
37
30
|
className: "session-refer",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ s(p, {
|
|
39
32
|
className: "session-refer-header",
|
|
40
33
|
size: 8,
|
|
41
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ n(S, {
|
|
42
35
|
type: "icon-cankaolaiyuan",
|
|
43
36
|
style: {
|
|
44
37
|
color: "#0A51D1",
|
|
45
38
|
fontSize: 16
|
|
46
39
|
}
|
|
47
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ n("span", {
|
|
48
41
|
className: "refer-header-title",
|
|
49
42
|
children: "参考来源"
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
children: ["(共 ", ((
|
|
43
|
+
}), /* @__PURE__ */ s("span", {
|
|
44
|
+
children: ["(共 ", ((r = o == null ? void 0 : o.reference) == null ? void 0 : r.length) || 0, " 项)"]
|
|
52
45
|
})]
|
|
53
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ n("div", {
|
|
54
47
|
className: "session-refer-content",
|
|
55
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ n(f, {
|
|
56
49
|
ghost: !0,
|
|
57
|
-
defaultActiveKey: (d =
|
|
58
|
-
children: (
|
|
59
|
-
header: /* @__PURE__ */
|
|
50
|
+
defaultActiveKey: (d = i == null ? void 0 : i.reference) != null && d.isExpand ? (c = o == null ? void 0 : o.reference) == null ? void 0 : c.map((e, a) => e.docId + a) : [],
|
|
51
|
+
children: (m = o == null ? void 0 : o.reference) == null ? void 0 : m.map((e, a) => /* @__PURE__ */ n(R, {
|
|
52
|
+
header: /* @__PURE__ */ s(p, {
|
|
60
53
|
className: "session-refer-panel",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ s("span", {
|
|
62
55
|
className: "refer-panel-item",
|
|
63
|
-
children: [
|
|
64
|
-
}),
|
|
56
|
+
children: [a + 1, "."]
|
|
57
|
+
}), l && /* @__PURE__ */ n(y, {
|
|
65
58
|
data: e,
|
|
66
|
-
loadPage: (g, k, C) =>
|
|
67
|
-
const
|
|
68
|
-
return (
|
|
59
|
+
loadPage: (g, k, C) => l.getKnowledgeIdFileIdData(g, k, C).then((N) => {
|
|
60
|
+
const t = (N || []).find((v) => v.key === "pages_from");
|
|
61
|
+
return (t == null ? void 0 : t.value) || 0;
|
|
69
62
|
}),
|
|
70
63
|
onClick: I
|
|
71
64
|
})]
|
|
72
65
|
}),
|
|
73
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ n("div", {
|
|
74
67
|
className: "refer-markdown",
|
|
75
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ n(D, {
|
|
76
69
|
children: e.text || "-"
|
|
77
70
|
})
|
|
78
71
|
})
|
|
79
|
-
}, e.docId +
|
|
72
|
+
}, e.docId + a))
|
|
80
73
|
})
|
|
81
74
|
})]
|
|
82
75
|
});
|
|
83
76
|
};
|
|
84
77
|
export {
|
|
85
|
-
|
|
78
|
+
E as default
|
|
86
79
|
};
|