@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,24 +1,17 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { memo as d, useContext as le, useState as se } from "react";
|
|
3
|
-
import
|
|
3
|
+
import c from "../../InputProgress/index.mjs";
|
|
4
4
|
import re from "../SessionRefer/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import "../../
|
|
8
|
-
import {
|
|
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";
|
|
14
|
-
import ae from "../../FileItem/index.mjs";
|
|
15
|
-
import { Popover as de, Space as q, Button as D, Row as pe, Col as ce, Collapse as V, Divider as me, message as W } from "antd";
|
|
5
|
+
import ae from "../SessionAction/index.mjs";
|
|
6
|
+
import { IHistoryRole as P, IThinkingStatus as Q } from "@glodon-aiot/apis";
|
|
7
|
+
import oe from "../../FileItem/index.mjs";
|
|
8
|
+
import { Popover as de, Space as q, Button as D, Row as ce, Col as pe, Collapse as V, Divider as me, message as W } from "antd";
|
|
16
9
|
import ue from "../SearchReference/index.mjs";
|
|
17
10
|
import "./style.less.mjs";
|
|
18
11
|
import he from "../HistoryContent/index.mjs";
|
|
19
12
|
import ge from "../../components/Markdown/index.mjs";
|
|
20
13
|
import Ne from "../../node_modules/classnames/index.mjs";
|
|
21
|
-
import
|
|
14
|
+
import p from "../../Iconfont/index.mjs";
|
|
22
15
|
import { CheckOutlined as $, CloseOutlined as G, LoadingOutlined as fe } from "@ant-design/icons";
|
|
23
16
|
import m from "../../components/JsonDisplay/index.mjs";
|
|
24
17
|
import ye from "../../context.mjs";
|
|
@@ -26,48 +19,49 @@ import Ce from "../SessionRelated/index.mjs";
|
|
|
26
19
|
import Le from "../ReferCollapse/index.mjs";
|
|
27
20
|
import ve from "../../node_modules/copy-to-clipboard/index.mjs";
|
|
28
21
|
import Re from "./think.svg.mjs";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
import { escapeSlash as Se } from "../../utils/index.mjs";
|
|
23
|
+
const be = (o) => {
|
|
24
|
+
if (!o)
|
|
25
|
+
return o;
|
|
32
26
|
try {
|
|
33
|
-
return JSON.parse(
|
|
27
|
+
return JSON.parse(o);
|
|
34
28
|
} catch (r) {
|
|
35
|
-
return
|
|
29
|
+
return o;
|
|
36
30
|
}
|
|
37
31
|
}, Ee = d(ue), K = d(re), C = d(ge);
|
|
38
32
|
d(he);
|
|
39
|
-
const
|
|
33
|
+
const ke = d(oe);
|
|
40
34
|
d(Le);
|
|
41
|
-
const u = (
|
|
42
|
-
if (!
|
|
35
|
+
const u = (o) => {
|
|
36
|
+
if (!o)
|
|
43
37
|
return !1;
|
|
44
38
|
try {
|
|
45
|
-
const r = JSON.parse(
|
|
39
|
+
const r = JSON.parse(o);
|
|
46
40
|
return !(r != null && r.code && (r.code < 200 || r.code > 300));
|
|
47
41
|
} catch (r) {
|
|
48
42
|
return !0;
|
|
49
43
|
}
|
|
50
|
-
}, X = (
|
|
44
|
+
}, X = (o) => {
|
|
51
45
|
var t;
|
|
52
|
-
const r = JSON.parse(JSON.stringify(
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
var b, E,
|
|
46
|
+
const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
|
|
47
|
+
return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
|
|
48
|
+
}, Ke = (o) => {
|
|
49
|
+
var S, b, E, k, T, A, O, x, F;
|
|
56
50
|
const {
|
|
57
51
|
application: r,
|
|
58
|
-
currentSession:
|
|
52
|
+
currentSession: a,
|
|
59
53
|
history: t,
|
|
60
54
|
isLastHistory: h,
|
|
61
55
|
onRelatedClick: Y,
|
|
62
56
|
onAgainClick: Z,
|
|
63
|
-
isLoading:
|
|
57
|
+
isLoading: Te,
|
|
64
58
|
docViewerUrl: g,
|
|
65
59
|
onEditClick: N
|
|
66
|
-
} =
|
|
60
|
+
} = o, {
|
|
67
61
|
debug: L,
|
|
68
62
|
transform: i,
|
|
69
63
|
popupContainer: f
|
|
70
|
-
} = le(ye), v = t.role ===
|
|
64
|
+
} = le(ye), v = t.role === P.User, R = t.role === P.Robot, {
|
|
71
65
|
Panel: ee
|
|
72
66
|
} = V, [y, te] = se(!0), ne = () => {
|
|
73
67
|
W.config({
|
|
@@ -100,7 +94,7 @@ const u = (a) => {
|
|
|
100
94
|
children: /* @__PURE__ */ e(D, {
|
|
101
95
|
type: "link",
|
|
102
96
|
size: "small",
|
|
103
|
-
icon: /* @__PURE__ */ e(
|
|
97
|
+
icon: /* @__PURE__ */ e(p, {
|
|
104
98
|
type: "icon-bianji2"
|
|
105
99
|
})
|
|
106
100
|
})
|
|
@@ -110,7 +104,7 @@ const u = (a) => {
|
|
|
110
104
|
children: /* @__PURE__ */ e(D, {
|
|
111
105
|
type: "link",
|
|
112
106
|
size: "small",
|
|
113
|
-
icon: /* @__PURE__ */ e(
|
|
107
|
+
icon: /* @__PURE__ */ e(p, {
|
|
114
108
|
type: "icon-fuzhi",
|
|
115
109
|
style: {
|
|
116
110
|
fontSize: "16px"
|
|
@@ -124,22 +118,22 @@ const u = (a) => {
|
|
|
124
118
|
children: /* @__PURE__ */ e("span", {
|
|
125
119
|
className: "item-user-content",
|
|
126
120
|
children: /* @__PURE__ */ e(C, {
|
|
127
|
-
children: t.content
|
|
121
|
+
children: Se(t.content)
|
|
128
122
|
})
|
|
129
123
|
})
|
|
130
124
|
})
|
|
131
125
|
})
|
|
132
126
|
}), /* @__PURE__ */ e("div", {
|
|
133
127
|
className: "item-user-file",
|
|
134
|
-
children: /* @__PURE__ */ e(
|
|
128
|
+
children: /* @__PURE__ */ e(ce, {
|
|
135
129
|
gutter: [12, 12],
|
|
136
130
|
justify: "end",
|
|
137
131
|
wrap: !0,
|
|
138
|
-
children: (
|
|
132
|
+
children: (S = t.files) == null ? void 0 : S.map((n) => /* @__PURE__ */ e(pe, {
|
|
139
133
|
className: "user-file-col",
|
|
140
|
-
children: /* @__PURE__ */ e(
|
|
134
|
+
children: /* @__PURE__ */ e(ke, {
|
|
141
135
|
docViewerUrl: g,
|
|
142
|
-
currentSession:
|
|
136
|
+
currentSession: a,
|
|
143
137
|
file: n
|
|
144
138
|
})
|
|
145
139
|
}, n.id))
|
|
@@ -154,8 +148,8 @@ const u = (a) => {
|
|
|
154
148
|
children: [/* @__PURE__ */ e(V, {
|
|
155
149
|
ghost: !0,
|
|
156
150
|
expandIconPosition: "right",
|
|
157
|
-
children: (
|
|
158
|
-
var _, I, U, z, j, B, w, M,
|
|
151
|
+
children: (b = t.actions) == null ? void 0 : b.map((n, ie) => {
|
|
152
|
+
var _, I, U, z, j, B, w, M, H, J;
|
|
159
153
|
return /* @__PURE__ */ s(ee, {
|
|
160
154
|
collapsible: L ? "header" : "icon",
|
|
161
155
|
showArrow: L,
|
|
@@ -221,7 +215,7 @@ const u = (a) => {
|
|
|
221
215
|
}), /* @__PURE__ */ e("div", {
|
|
222
216
|
className: "bot-plugin-json",
|
|
223
217
|
children: /* @__PURE__ */ e(m, {
|
|
224
|
-
josn: (
|
|
218
|
+
josn: (H = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : H.data.requestBody
|
|
225
219
|
})
|
|
226
220
|
}), /* @__PURE__ */ e("div", {
|
|
227
221
|
className: "bot-plugin-content",
|
|
@@ -229,7 +223,7 @@ const u = (a) => {
|
|
|
229
223
|
}), /* @__PURE__ */ e("div", {
|
|
230
224
|
className: "bot-plugin-json",
|
|
231
225
|
children: /* @__PURE__ */ e(m, {
|
|
232
|
-
josn: be((
|
|
226
|
+
josn: be((J = n.find((l) => l.type === "RESULT")) == null ? void 0 : J.data.result)
|
|
233
227
|
})
|
|
234
228
|
})]
|
|
235
229
|
}, ie);
|
|
@@ -239,7 +233,7 @@ const u = (a) => {
|
|
|
239
233
|
style: {
|
|
240
234
|
padding: "4px 0"
|
|
241
235
|
},
|
|
242
|
-
children: X(t.actions) ? null : /* @__PURE__ */ e(
|
|
236
|
+
children: X(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
243
237
|
size: 4,
|
|
244
238
|
text: "思考中"
|
|
245
239
|
})
|
|
@@ -249,7 +243,7 @@ const u = (a) => {
|
|
|
249
243
|
children: /* @__PURE__ */ e(Ee, {
|
|
250
244
|
history: t
|
|
251
245
|
})
|
|
252
|
-
}), (
|
|
246
|
+
}), (E = t == null ? void 0 : t.reference) != null && E.length && ((k = i == null ? void 0 : i.reference) != null && k.referenceFirst) ? /* @__PURE__ */ e(K, {
|
|
253
247
|
history: t,
|
|
254
248
|
docViewerUrl: g
|
|
255
249
|
}) : null, /* @__PURE__ */ s("div", {
|
|
@@ -270,12 +264,12 @@ const u = (a) => {
|
|
|
270
264
|
children: ["已完成推理(用时 ", (t == null ? void 0 : t.thinkingSecs) || 0, " 秒)"]
|
|
271
265
|
}), /* @__PURE__ */ e("span", {
|
|
272
266
|
className: "think-action",
|
|
273
|
-
children: y ? /* @__PURE__ */ e(
|
|
267
|
+
children: y ? /* @__PURE__ */ e(p, {
|
|
274
268
|
type: "icon-zhankai",
|
|
275
269
|
style: {
|
|
276
270
|
fontSize: 16
|
|
277
271
|
}
|
|
278
|
-
}) : /* @__PURE__ */ e(
|
|
272
|
+
}) : /* @__PURE__ */ e(p, {
|
|
279
273
|
type: "icon-shouqi",
|
|
280
274
|
style: {
|
|
281
275
|
fontSize: 16
|
|
@@ -309,7 +303,7 @@ const u = (a) => {
|
|
|
309
303
|
style: {
|
|
310
304
|
paddingBottom: 12
|
|
311
305
|
},
|
|
312
|
-
children: /* @__PURE__ */ e(
|
|
306
|
+
children: /* @__PURE__ */ e(c, {
|
|
313
307
|
size: 4
|
|
314
308
|
})
|
|
315
309
|
}) : null, t.isRelateLoading && /* @__PURE__ */ e("div", {
|
|
@@ -317,19 +311,20 @@ const u = (a) => {
|
|
|
317
311
|
style: {
|
|
318
312
|
padding: "4px 0"
|
|
319
313
|
},
|
|
320
|
-
children: X(t.actions) ? null : /* @__PURE__ */ e(
|
|
314
|
+
children: X(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
321
315
|
size: 4,
|
|
322
316
|
text: "思考中"
|
|
323
317
|
})
|
|
324
318
|
}), (i == null ? void 0 : i.relate) && h && !!((x = t.relatedQuesion) != null && x.length) && /* @__PURE__ */ e(Ce, {
|
|
325
319
|
relatedQuesion: t.relatedQuesion,
|
|
326
320
|
onRelatedClick: Y
|
|
327
|
-
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(
|
|
321
|
+
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
|
|
328
322
|
appId: r.id,
|
|
329
323
|
history: t,
|
|
330
|
-
sessionId: (F =
|
|
324
|
+
sessionId: (F = a == null ? void 0 : a.data) == null ? void 0 : F.id,
|
|
331
325
|
onAgainClick: Z,
|
|
332
|
-
isLastHistory: h
|
|
326
|
+
isLastHistory: h,
|
|
327
|
+
currentSession: a
|
|
333
328
|
})]
|
|
334
329
|
})
|
|
335
330
|
}), t.isContext && /* @__PURE__ */ s(me, {
|
|
@@ -342,7 +337,7 @@ const u = (a) => {
|
|
|
342
337
|
}), " "]
|
|
343
338
|
}), t.isWaiting && /* @__PURE__ */ e("div", {
|
|
344
339
|
className: "history-input-progress",
|
|
345
|
-
children: /* @__PURE__ */ e(
|
|
340
|
+
children: /* @__PURE__ */ e(c, {
|
|
346
341
|
size: 4,
|
|
347
342
|
text: "思考中"
|
|
348
343
|
})
|
|
@@ -350,6 +345,6 @@ const u = (a) => {
|
|
|
350
345
|
});
|
|
351
346
|
};
|
|
352
347
|
export {
|
|
353
|
-
|
|
348
|
+
Ke as default,
|
|
354
349
|
u as isResultExec
|
|
355
350
|
};
|
|
@@ -1,66 +1,73 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as x, jsx as A } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useContext as H, useState as i, useEffect as y } from "react";
|
|
3
3
|
import "./style.less.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { Space as
|
|
6
|
-
import
|
|
7
|
-
const P = (
|
|
8
|
-
var
|
|
4
|
+
import K from "../../context.mjs";
|
|
5
|
+
import { Space as q } from "antd";
|
|
6
|
+
import z from "./KnowledgeSelect/index.mjs";
|
|
7
|
+
const P = (v) => {
|
|
8
|
+
var j, u;
|
|
9
9
|
const {
|
|
10
|
-
currentSession:
|
|
11
|
-
application:
|
|
12
|
-
setCurrentSession:
|
|
13
|
-
reload:
|
|
14
|
-
setCheckKnowledges:
|
|
15
|
-
} =
|
|
16
|
-
mode:
|
|
17
|
-
transform:
|
|
18
|
-
|
|
10
|
+
currentSession: t,
|
|
11
|
+
application: n,
|
|
12
|
+
setCurrentSession: B,
|
|
13
|
+
reload: D,
|
|
14
|
+
setCheckKnowledges: g
|
|
15
|
+
} = v, {
|
|
16
|
+
mode: C,
|
|
17
|
+
transform: w,
|
|
18
|
+
features: o
|
|
19
|
+
} = H(K), [d, k] = i([]), [r, c] = i(typeof (o == null ? void 0 : o.knowledges) == "object" ? ((j = o.knowledges.default) == null ? void 0 : j.map((e) => e.id)) || [] : []), [E, p] = i(0), [h, b] = i(!1);
|
|
19
20
|
y(() => {
|
|
20
|
-
|
|
21
|
-
if (!(t != null && t.id))
|
|
21
|
+
if (!(n != null && n.id))
|
|
22
22
|
return;
|
|
23
|
-
const e =
|
|
23
|
+
const e = n.arrange;
|
|
24
24
|
if (!(e != null && e.length))
|
|
25
25
|
return;
|
|
26
26
|
const s = e[0].knowledges || [];
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
k(s);
|
|
28
|
+
const l = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || s;
|
|
29
|
+
if (!t) {
|
|
30
|
+
c(l.map((f) => f.id)), p(l.length), g == null || g(l);
|
|
29
31
|
return;
|
|
30
32
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const a = () => {
|
|
34
|
+
const f = t.knowledges || l;
|
|
35
|
+
p(f.length);
|
|
36
|
+
const F = f.map((N) => N.id);
|
|
37
|
+
c(F);
|
|
38
|
+
};
|
|
39
|
+
return a(), t.addEventListener("data:updated", a), () => {
|
|
40
|
+
t == null || t.removeEventListener("data:updated", a);
|
|
41
|
+
};
|
|
42
|
+
}, [n, t]), y(() => {
|
|
43
|
+
var m;
|
|
44
|
+
if (!h || (b(!1), !(n != null && n.id)))
|
|
38
45
|
return;
|
|
39
46
|
const e = [];
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
e.push(
|
|
43
|
-
}), (
|
|
44
|
-
}, [
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
47
|
+
r == null || r.map((s) => {
|
|
48
|
+
const l = d == null ? void 0 : d.find((a) => a.id === s);
|
|
49
|
+
e.push(l);
|
|
50
|
+
}), (m = t == null ? void 0 : t.data) != null && m.id && t.setKnowledges(e);
|
|
51
|
+
}, [h]);
|
|
52
|
+
const S = (e) => {
|
|
53
|
+
b(!0), c(e);
|
|
54
|
+
const m = [];
|
|
48
55
|
e == null || e.map((s) => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}),
|
|
56
|
+
const l = d == null ? void 0 : d.find((a) => a.id === s);
|
|
57
|
+
m.push(l);
|
|
58
|
+
}), g == null || g(m), p(e.length);
|
|
52
59
|
};
|
|
53
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ x("div", {
|
|
54
61
|
className: "chat-header",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ x(q, {
|
|
56
63
|
className: "header-title",
|
|
57
|
-
children: [
|
|
58
|
-
}), (
|
|
59
|
-
disabled: (
|
|
60
|
-
checkedValues:
|
|
61
|
-
currKnowledgeList:
|
|
62
|
-
selectCount:
|
|
63
|
-
onSelectChange:
|
|
64
|
+
children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (n == null ? void 0 : n.name)]
|
|
65
|
+
}), (w == null ? void 0 : w.knowledges) && d.length !== 0 && /* @__PURE__ */ A(z, {
|
|
66
|
+
disabled: (n == null ? void 0 : n.type) === 2 || typeof (o == null ? void 0 : o.knowledges) == "object" && (o == null ? void 0 : o.knowledges.diabled) || !1,
|
|
67
|
+
checkedValues: r,
|
|
68
|
+
currKnowledgeList: d,
|
|
69
|
+
selectCount: E,
|
|
70
|
+
onSelectChange: S
|
|
64
71
|
})]
|
|
65
72
|
});
|
|
66
73
|
};
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { useState as m, useContext as
|
|
1
|
+
import { jsx as r, Fragment as V } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { Popover as j, Tabs as C, Button as A } from "antd";
|
|
3
|
+
import { useState as m, useContext as E, useEffect as a } from "react";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "dayjs";
|
|
9
|
-
import { PROMPT_TITLE_MAX_LENGTH as I } from "../../packages/apis/dist/es/aecpilot/cosntant.mjs";
|
|
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";
|
|
14
|
-
import M from "./PromptList/PublicPromptList.mjs";
|
|
5
|
+
import M from "../../node_modules/classnames/index.mjs";
|
|
6
|
+
import { PROMPT_TITLE_MAX_LENGTH as I } from "@glodon-aiot/apis";
|
|
7
|
+
import _ from "./PromptList/PublicPromptList.mjs";
|
|
15
8
|
import z from "../../Iconfont/index.mjs";
|
|
16
9
|
import X from "../../context.mjs";
|
|
17
|
-
const
|
|
10
|
+
const $ = (S) => {
|
|
18
11
|
var x;
|
|
19
12
|
const {
|
|
20
|
-
appId:
|
|
13
|
+
appId: c,
|
|
21
14
|
list: s,
|
|
22
15
|
search: e,
|
|
23
16
|
disabled: W = !1,
|
|
@@ -28,15 +21,15 @@ const lt = (S) => {
|
|
|
28
21
|
service: i,
|
|
29
22
|
popupContainer: o,
|
|
30
23
|
mode: F
|
|
31
|
-
} =
|
|
24
|
+
} = E(X), [G, d] = m((s == null ? void 0 : s.filter((t) => t.type === "me")) || []), [k, h] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [b, v] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [w, N] = m("system"), [H, O] = m(!1);
|
|
32
25
|
a(() => {
|
|
33
|
-
f && i && (e && e.length > I ? (d([]), h([])) : (i.listPrompt(
|
|
26
|
+
f && i && (e && e.length > I ? (d([]), h([])) : (i.listPrompt(c, {
|
|
34
27
|
type: "system"
|
|
35
|
-
}).then((t) => O(!!t.length)), i.listPrompt(
|
|
28
|
+
}).then((t) => O(!!t.length)), i.listPrompt(c, e ? {
|
|
36
29
|
title: e
|
|
37
30
|
} : void 0).then((t) => {
|
|
38
|
-
const
|
|
39
|
-
d(
|
|
31
|
+
const p = t.filter((n) => n.type === "me"), l = t.filter((n) => n.type === "system");
|
|
32
|
+
d(p), h(l);
|
|
40
33
|
})));
|
|
41
34
|
}, [f]), a(() => {
|
|
42
35
|
T();
|
|
@@ -46,9 +39,9 @@ const lt = (S) => {
|
|
|
46
39
|
let t = o == null ? void 0 : o.current;
|
|
47
40
|
t ? t.clientWidth > 900 ? P(520) : P(t.clientWidth - 80) : P(400);
|
|
48
41
|
}, [(x = o == null ? void 0 : o.current) == null ? void 0 : x.clientWidth]), a(() => {
|
|
49
|
-
i == null || i.listPrompt(
|
|
50
|
-
const
|
|
51
|
-
v(
|
|
42
|
+
i == null || i.listPrompt(c).then((t) => {
|
|
43
|
+
const p = t.filter((l) => l.type === "system");
|
|
44
|
+
v(p);
|
|
52
45
|
});
|
|
53
46
|
}, [i]);
|
|
54
47
|
const T = () => {
|
|
@@ -56,14 +49,14 @@ const lt = (S) => {
|
|
|
56
49
|
d([]), h([]);
|
|
57
50
|
return;
|
|
58
51
|
}
|
|
59
|
-
i == null || i.listPrompt(
|
|
52
|
+
i == null || i.listPrompt(c, e ? {
|
|
60
53
|
title: e
|
|
61
54
|
} : void 0).then((t) => {
|
|
62
|
-
const
|
|
63
|
-
d(
|
|
55
|
+
const p = t.filter((n) => n.type === "me"), l = t.filter((n) => n.type === "system");
|
|
56
|
+
d(p), h(l), y(!!(l.length && (e != null && e.length))), e || v(l);
|
|
64
57
|
});
|
|
65
58
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ r(j, {
|
|
67
60
|
title: null,
|
|
68
61
|
placement: "topLeft",
|
|
69
62
|
overlayClassName: "propmt-manage-popover",
|
|
@@ -81,8 +74,8 @@ const lt = (S) => {
|
|
|
81
74
|
onOpenChange: (t) => {
|
|
82
75
|
y(t), !t && g && g();
|
|
83
76
|
},
|
|
84
|
-
content: /* @__PURE__ */
|
|
85
|
-
children: /* @__PURE__ */
|
|
77
|
+
content: /* @__PURE__ */ r(V, {
|
|
78
|
+
children: /* @__PURE__ */ r(C, {
|
|
86
79
|
activeKey: w,
|
|
87
80
|
style: {
|
|
88
81
|
padding: "0 16px"
|
|
@@ -90,10 +83,10 @@ const lt = (S) => {
|
|
|
90
83
|
onTabClick: (t) => {
|
|
91
84
|
N(t);
|
|
92
85
|
},
|
|
93
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ r(C.TabPane, {
|
|
94
87
|
tab: "快捷指令",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
appId:
|
|
88
|
+
children: /* @__PURE__ */ r(_, {
|
|
89
|
+
appId: c,
|
|
97
90
|
data: k,
|
|
98
91
|
search: e,
|
|
99
92
|
onItemClick: (t) => {
|
|
@@ -103,17 +96,17 @@ const lt = (S) => {
|
|
|
103
96
|
}, "system")
|
|
104
97
|
})
|
|
105
98
|
}),
|
|
106
|
-
children: b != null && b.length ? /* @__PURE__ */
|
|
99
|
+
children: b != null && b.length ? /* @__PURE__ */ r(A, {
|
|
107
100
|
disabled: W,
|
|
108
101
|
style: {
|
|
109
102
|
width: "24px"
|
|
110
103
|
},
|
|
111
|
-
className:
|
|
104
|
+
className: M({
|
|
112
105
|
"prompt-btn": !0,
|
|
113
106
|
active: f
|
|
114
107
|
}),
|
|
115
108
|
type: "text",
|
|
116
|
-
icon: /* @__PURE__ */
|
|
109
|
+
icon: /* @__PURE__ */ r(z, {
|
|
117
110
|
type: "icon-tishiyu1",
|
|
118
111
|
style: {
|
|
119
112
|
fontSize: 24
|
|
@@ -124,5 +117,5 @@ const lt = (S) => {
|
|
|
124
117
|
});
|
|
125
118
|
};
|
|
126
119
|
export {
|
|
127
|
-
|
|
120
|
+
$ as default
|
|
128
121
|
};
|