@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.
Files changed (150) hide show
  1. package/dist/es/AgentClientUI.mjs +97 -110
  2. package/dist/es/Dialog/AgentChat/index.mjs +516 -467
  3. package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
  4. package/dist/es/Dialog/FileCard/index.mjs +48 -55
  5. package/dist/es/Dialog/FilePreview/index.mjs +35 -42
  6. package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
  7. package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
  8. package/dist/es/Dialog/PromptManager/index.mjs +29 -36
  9. package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
  10. package/dist/es/Dialog/SessionAction/index.mjs +92 -91
  11. package/dist/es/Dialog/SessionList/index.mjs +135 -121
  12. package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
  13. package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
  14. package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
  15. package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
  16. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
  17. package/dist/es/Dialog/index.mjs +125 -93
  18. package/dist/es/QuillEditor/index.mjs +91 -86
  19. package/dist/es/_virtual/index.mjs +2 -2
  20. package/dist/es/components/Markdown/Image/index.mjs +20 -20
  21. package/dist/es/components/Markdown/index.mjs +27 -22
  22. package/dist/es/constant.mjs +8 -5
  23. package/dist/es/index.mjs +178 -152
  24. package/dist/es/node_modules/classnames/index.mjs +1 -1
  25. package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
  26. package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
  27. package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
  28. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
  29. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
  30. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
  31. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
  32. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
  33. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
  34. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
  35. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
  36. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
  37. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
  38. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
  39. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
  40. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
  41. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
  42. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
  43. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
  44. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
  45. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
  46. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
  47. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
  48. package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
  49. package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
  50. package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
  51. package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
  52. package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
  53. package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
  54. package/dist/es/node_modules/longest-streak/index.mjs +12 -0
  55. package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
  56. package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
  57. package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
  58. package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
  59. package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
  60. package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
  61. package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
  62. package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
  63. package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
  64. package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
  65. package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
  66. package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
  67. package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
  68. package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
  69. package/dist/es/utils/index.mjs +44 -27
  70. package/dist/lib/index.js +278 -138
  71. package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
  72. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
  73. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
  74. package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
  75. package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
  76. package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
  77. package/dist/src/Dialog/SessionList/index.d.ts +5 -4
  78. package/dist/src/QuillEditor/index.d.ts +1 -0
  79. package/dist/src/components/Markdown/Text/index.d.ts +8 -0
  80. package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
  81. package/dist/src/components/MathJaxRender/index.d.ts +6 -0
  82. package/dist/src/constant.d.ts +1 -1
  83. package/dist/src/contexts/MathJaxContext.d.ts +12 -0
  84. package/dist/src/index.d.ts +4 -1
  85. package/dist/src/types.d.ts +26 -6
  86. package/dist/src/utils/index.d.ts +15 -0
  87. package/package.json +18 -17
  88. package/dist/es/_virtual/index2.mjs +0 -4
  89. package/dist/es/_virtual/index3.mjs +0 -4
  90. package/dist/es/_virtual/index4.mjs +0 -4
  91. package/dist/es/_virtual/minio-zj.mjs +0 -4
  92. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
  93. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
  94. package/dist/es/node_modules/base64-js/index.mjs +0 -47
  95. package/dist/es/node_modules/buffer/index.mjs +0 -927
  96. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
  97. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
  98. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
  99. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
  100. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
  101. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
  102. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
  103. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
  104. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
  105. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
  106. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
  107. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
  108. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
  109. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
  110. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
  111. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
  112. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
  113. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
  114. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
  115. package/dist/es/node_modules/ieee754/index.mjs +0 -28
  116. package/dist/es/node_modules/js-base64/base64.mjs +0 -31
  117. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
  118. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
  119. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
  120. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
  121. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
  122. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
  123. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
  124. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
  125. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
  126. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
  127. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
  128. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
  129. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
  130. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
  131. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
  132. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
  133. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
  134. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
  135. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
  136. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
  137. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
  138. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
  139. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
  140. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
  141. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
  142. package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
  143. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
  144. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
  145. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
  146. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
  147. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
  148. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
  149. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
  150. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
@@ -1,154 +0,0 @@
1
- var f = Object.defineProperty, c = Object.getOwnPropertySymbols, g = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable, d = (o, r, t) => r in o ? f(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t, p = (o, r) => {
2
- for (var t in r || (r = {}))
3
- g.call(r, t) && d(o, t, r[t]);
4
- if (c)
5
- for (var t of c(r))
6
- m.call(r, t) && d(o, t, r[t]);
7
- return o;
8
- }, s = (o, r, t) => new Promise((e, n) => {
9
- var i = (l) => {
10
- try {
11
- a(t.next(l));
12
- } catch (h) {
13
- n(h);
14
- }
15
- }, u = (l) => {
16
- try {
17
- a(t.throw(l));
18
- } catch (h) {
19
- n(h);
20
- }
21
- }, a = (l) => l.done ? e(l.value) : Promise.resolve(l.value).then(i, u);
22
- a((t = t.apply(o, r)).next());
23
- });
24
- class E {
25
- constructor(r, t) {
26
- this.axios = r, this.errorHandler = t;
27
- }
28
- get(r, t, e) {
29
- return s(this, null, function* () {
30
- const n = this.axios.get(r, {
31
- params: t
32
- });
33
- return this.handleResponse(n, e);
34
- });
35
- }
36
- listPaged(r, t) {
37
- return s(this, null, function* () {
38
- const e = this.axios.get(r, {
39
- params: t
40
- });
41
- return this.handleResponse(e);
42
- });
43
- }
44
- list(r, t) {
45
- return s(this, null, function* () {
46
- const e = this.axios.get(r, {
47
- params: t
48
- });
49
- return this.handleResponse(e);
50
- });
51
- }
52
- delete(r, t) {
53
- return s(this, null, function* () {
54
- const e = this.axios.delete(r, {
55
- params: t
56
- });
57
- return this.handleResponse(e);
58
- });
59
- }
60
- post(r, t, e, n) {
61
- return s(this, null, function* () {
62
- const i = this.axios.post(r, t, p({
63
- params: e
64
- }, n));
65
- return this.handleResponse(i);
66
- });
67
- }
68
- postForm(r, t, e) {
69
- return s(this, null, function* () {
70
- const n = this.axios.post(r, t, {
71
- params: e,
72
- headers: {
73
- "Content-Type": "multipart/form-data"
74
- }
75
- });
76
- return this.handleResponse(n);
77
- });
78
- }
79
- patch(r, t, e) {
80
- return s(this, null, function* () {
81
- const n = this.axios.patch(r, t, {
82
- params: e
83
- });
84
- return this.handleResponse(n);
85
- });
86
- }
87
- put(r, t) {
88
- return s(this, null, function* () {
89
- const e = this.axios.put(r, t);
90
- return this.handleResponse(e);
91
- });
92
- }
93
- upload(r, t, e) {
94
- return s(this, null, function* () {
95
- const n = this.axios.post(r, t, p({}, e));
96
- return this.handleResponse(n);
97
- });
98
- }
99
- getNonStandard(r, t) {
100
- return s(this, null, function* () {
101
- const e = this.axios.get(r, t);
102
- try {
103
- const n = yield e;
104
- if (n.status === 200)
105
- return n;
106
- } catch (n) {
107
- throw this.handleError(n);
108
- }
109
- });
110
- }
111
- postNonStandard(r, t, e, n) {
112
- return s(this, null, function* () {
113
- var i, u;
114
- const a = yield this.axios.post(r, t, p({
115
- params: e
116
- }, n));
117
- if (a.status === 200)
118
- if ((i = a.data) != null && i.code)
119
- (u = this.errorHandler) != null && u.onAppStatusError && this.errorHandler.onAppStatusError(a.data.code, a.data.message);
120
- else
121
- return a.data;
122
- });
123
- }
124
- handleResponse(r, t) {
125
- return s(this, null, function* () {
126
- try {
127
- const e = yield r;
128
- return this.handleAppError(e.data, t).data;
129
- } catch (e) {
130
- throw this.handleError(e);
131
- }
132
- });
133
- }
134
- handleAppError(r, t) {
135
- var e;
136
- if (r.code < 200 || r.code >= 300)
137
- throw (e = this.errorHandler) != null && e.onAppStatusError ? this.errorHandler.onAppStatusError(r.code, x(r.code, r.message), t) : console.error("未处理应用错误:", r), {
138
- isAxiosError: !1,
139
- message: r.message
140
- };
141
- return r;
142
- }
143
- // https://github.com/axios/axios#handling-errors
144
- handleError(r) {
145
- var t, e;
146
- return r.response ? (console.log(r.response.data), console.log(r.response.status), console.log(r.response.headers), (t = this.errorHandler) != null && t.onHttpStatusError && (console.log("HTTP 错误", this.errorHandler), this.errorHandler.onHttpStatusError(r.response.status, "", r.response))) : r.request ? (console.log(r.request), (e = this.errorHandler) != null && e.onNetworkError && this.errorHandler.onNetworkError()) : console.error("axios request config error:", r), new Error(r.message);
147
- }
148
- }
149
- const y = (o) => o >= 10002 && o <= 10012, x = (o, r) => y(o) ? "数据操作错误" : r || "未知接口错误";
150
- export {
151
- E as BaseApi,
152
- y as needPrettifyMsg,
153
- x as prettifyMsg
154
- };
@@ -1,431 +0,0 @@
1
- import h from "axios";
2
- import { BaseApi as d } from "../base/index.mjs";
3
- import { m as c } from "../../../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
4
- var e = (a, t, n) => new Promise((i, r) => {
5
- var l = (s) => {
6
- try {
7
- u(n.next(s));
8
- } catch (o) {
9
- r(o);
10
- }
11
- }, p = (s) => {
12
- try {
13
- u(n.throw(s));
14
- } catch (o) {
15
- r(o);
16
- }
17
- }, u = (s) => s.done ? i(s.value) : Promise.resolve(s.value).then(l, p);
18
- u((n = n.apply(a, t)).next());
19
- });
20
- class m extends d {
21
- constructor(t, n) {
22
- super(t != null ? t : h.create(), n);
23
- }
24
- getKnowledge(t, n) {
25
- return e(this, null, function* () {
26
- return this.get("/knowledge", {
27
- docId: t,
28
- name: n
29
- });
30
- });
31
- }
32
- postKnowledge(t) {
33
- return e(this, null, function* () {
34
- return this.post("/knowledge", t);
35
- });
36
- }
37
- getKnowledgeId(t) {
38
- return e(this, null, function* () {
39
- return this.get(`/knowledge/${t}`);
40
- });
41
- }
42
- patchKnowledgeId(t, n) {
43
- return e(this, null, function* () {
44
- return this.patch(`/knowledge/${t}`, n);
45
- });
46
- }
47
- delKnowledgeId(t) {
48
- return e(this, null, function* () {
49
- return this.delete(`/knowledge/${t}`);
50
- });
51
- }
52
- getKnowledgeIdFile(t) {
53
- return e(this, null, function* () {
54
- return this.get(`/knowledge/${t}/file`);
55
- });
56
- }
57
- getKnowledgeIdFileList(t, n) {
58
- return e(this, null, function* () {
59
- return this.listPaged(`/knowledge/${t}/file`, n);
60
- });
61
- }
62
- postKnowledgeIdFile(t, n) {
63
- return e(this, null, function* () {
64
- return this.post(`/knowledge/${t}/file`, n);
65
- });
66
- }
67
- getUploadTicket(t) {
68
- return e(this, null, function* () {
69
- return this.get("/upload/ticket", t);
70
- });
71
- }
72
- delKnowledgeIdFileFid(t, n) {
73
- return e(this, null, function* () {
74
- return this.delete(`/knowledge/${t}/file/${n}`);
75
- });
76
- }
77
- patchKnowledgeIdFileFid(t, n, i) {
78
- return e(this, null, function* () {
79
- return this.patch(`/knowledge/${t}/file/${n}`, i);
80
- });
81
- }
82
- listSessions(t, n) {
83
- return e(this, null, function* () {
84
- return this.get(`/application/${t}/sessionsa`, n);
85
- });
86
- }
87
- postSession(t, n) {
88
- return e(this, null, function* () {
89
- return this.post(`/application/${t}/sessions`, n);
90
- });
91
- }
92
- getSession(t, n) {
93
- return e(this, null, function* () {
94
- return this.get(`/application/${t}/sessions/${n}`);
95
- });
96
- }
97
- patchSessionsId(t, n, i) {
98
- return e(this, null, function* () {
99
- return this.patch(`/application/${t}/sessions/${n}`, i);
100
- });
101
- }
102
- delSessionsId(t, n) {
103
- return e(this, null, function* () {
104
- return this.delete(`/application/${t}/sessions/${n}`);
105
- });
106
- }
107
- getSessionKnowledgeFile(t, n, i) {
108
- return e(this, null, function* () {
109
- return this.get(`/application/${t}session/${n}/file/${i}`);
110
- });
111
- }
112
- postSessionKnowledgeFile(t, n, i) {
113
- return e(this, null, function* () {
114
- return this.post(`/application/${t}session/${n}/file`, i);
115
- });
116
- }
117
- postComments(t) {
118
- return e(this, null, function* () {
119
- return this.post("/comments", t);
120
- });
121
- }
122
- /**
123
- * 查询会话记录
124
- * 规则:
125
- * 1. startTime + pageSize:向后查询
126
- * 2. startTime + pageSize:向前查询
127
- * 3. startTIme + endTime :查询区间(忽略pageSize)
128
- * 4. pageSize 必须是偶数,问答必须一同查询。不严谨,但前端没有办法😭
129
- * 5. 这里的time对应的是对话记录里的messageTime字段,该字段只精确到秒,并不严谨,导致规则4的出现
130
- **/
131
- getChatHistorySessionId(t, n, i) {
132
- return e(this, null, function* () {
133
- return this.get(`application/${t}/chatHistory/${n}`, i);
134
- });
135
- }
136
- postChatHistorySessionId(t, n) {
137
- return e(this, null, function* () {
138
- return this.post(`/chatHistory/${t}`, n);
139
- });
140
- }
141
- getApplications(t) {
142
- return e(this, null, function* () {
143
- return this.get("/applications", t);
144
- });
145
- }
146
- postApplication(t) {
147
- return e(this, null, function* () {
148
- return this.post("/applications", t);
149
- });
150
- }
151
- getApplicationId(t) {
152
- return e(this, null, function* () {
153
- return this.get(`/applications/${t}`);
154
- });
155
- }
156
- patchApplicationId(t, n) {
157
- return e(this, null, function* () {
158
- return this.patch(`/applications/${t}`, n);
159
- });
160
- }
161
- delApplicationId(t) {
162
- return e(this, null, function* () {
163
- return this.delete(`/applications/${t}`);
164
- });
165
- }
166
- getApplicationIdSessions(t) {
167
- return e(this, null, function* () {
168
- return this.get(`/applications/${t}/session`);
169
- });
170
- }
171
- patchFileId(t, n) {
172
- return e(this, null, function* () {
173
- return this.patch(`/file/${t}`, n);
174
- });
175
- }
176
- getCvforceResource(t) {
177
- return e(this, null, function* () {
178
- return this.get("/cvforce/resource", t);
179
- });
180
- }
181
- postKnowledgeIdComposedFiles(t, n) {
182
- return e(this, null, function* () {
183
- return this.post(`/knowledge/${t}/composedFiles`, n);
184
- });
185
- }
186
- getTokensApplicationId(t, n) {
187
- return e(this, null, function* () {
188
- return this.get(`/tokens/${t}`, n);
189
- });
190
- }
191
- getTokens(t) {
192
- return e(this, null, function* () {
193
- return this.get("/tokens", t);
194
- });
195
- }
196
- uploadMinioFile(t, n) {
197
- return e(this, null, function* () {
198
- return new Promise((i, r) => {
199
- const l = new FileReader();
200
- l.readAsArrayBuffer(n), l.onload = (p) => {
201
- c.initMinio({
202
- endPoint: t.endpoints[0],
203
- useSSL: t.useSSL,
204
- accessKey: t.accessKey,
205
- secretKey: t.secretKey
206
- });
207
- const u = Buffer.from(p.target.result), s = {
208
- "Content-Type": "application/octet-stream"
209
- };
210
- c.putObjectBuffer(t.bucket, t.fileKeys[0], u, s, (o) => {
211
- if (o)
212
- throw console.error(o), Error(o);
213
- i(t.fileKeys[0]);
214
- });
215
- };
216
- });
217
- });
218
- }
219
- uploadFile(t, n) {
220
- return e(this, null, function* () {
221
- const i = {
222
- files: [n.name],
223
- isv: "minio",
224
- knowledgeId: t
225
- };
226
- return this.getUploadTicket(i).then((r) => this.uploadMinioFile(r.minio, n)).catch((r) => {
227
- throw Error(r);
228
- });
229
- });
230
- }
231
- uploadFiles(t, n) {
232
- return e(this, null, function* () {
233
- const i = {
234
- files: n.map((r) => r.name),
235
- isv: "minio",
236
- knowledgeId: t
237
- };
238
- return this.getUploadTicket(i).then((r) => Promise.all(n.map((l) => this.uploadMinioFile(r.minio, l)))).catch((r) => {
239
- throw Error(r);
240
- });
241
- });
242
- }
243
- getAecModels() {
244
- return e(this, null, function* () {
245
- return this.get("/aecModels");
246
- });
247
- }
248
- postTextFilter(t) {
249
- return e(this, null, function* () {
250
- return this.post("/textFilter", t);
251
- });
252
- }
253
- getTenantModel() {
254
- return e(this, null, function* () {
255
- return this.get("/tenantModel");
256
- });
257
- }
258
- // 获取prompt变量列表
259
- getPrompts(t, n) {
260
- return e(this, null, function* () {
261
- return this.get(`application/${t}/promptVariables`, n);
262
- });
263
- }
264
- // 新增prompt
265
- postPrompt(t, n) {
266
- return e(this, null, function* () {
267
- return this.post(`application/${t}/promptVariables`, n);
268
- });
269
- }
270
- // 修改单个prompt
271
- patchPromptId(t, n, i) {
272
- return e(this, null, function* () {
273
- return this.patch(`application/${t}/promptVariables/${n}`, i);
274
- });
275
- }
276
- // 删除单个prompt
277
- delPromptId(t, n) {
278
- return e(this, null, function* () {
279
- return this.delete(`application/${t}/promptVariables/${n}`);
280
- });
281
- }
282
- // 获取session下的prompt变量列表
283
- getSessionPrompts(t) {
284
- return e(this, null, function* () {
285
- return this.get(`session/${t}/promptVariables`);
286
- });
287
- }
288
- // 修改session单个prompt
289
- patchSessionPromptId(t, n, i) {
290
- return e(this, null, function* () {
291
- return this.patch(`session/${n}/promptVariables/${t}`, i);
292
- });
293
- }
294
- getApplicationIdSessionIdPromptVariables(t, n) {
295
- return e(this, null, function* () {
296
- return this.get(`/application/${t}/session/${n}/promptVariables`);
297
- });
298
- }
299
- patchApplicationIdSessionpromptVariablesId(t, n, i, r) {
300
- return e(this, null, function* () {
301
- return this.patch(`/application/${t}/session/${n}/promptVariables/${i}`, r);
302
- });
303
- }
304
- // 查询预置应用
305
- getPresetApplication(t) {
306
- return e(this, null, function* () {
307
- return this.get("presetApplication", t);
308
- });
309
- }
310
- // 新建知识库配置
311
- postKnowledgeConfig(t) {
312
- return e(this, null, function* () {
313
- return this.post("/knowledgeConfig", t);
314
- });
315
- }
316
- // 获取知识库配置
317
- getKnowledgeConfig(t) {
318
- return e(this, null, function* () {
319
- return this.get(`/knowledgeConfig/${t}`);
320
- });
321
- }
322
- // 编辑知识库配置
323
- patchKnowledgeConfig(t, n) {
324
- return e(this, null, function* () {
325
- return this.patch(`/knowledgeConfig/${t}`, n);
326
- });
327
- }
328
- getKnowledgeIdFileId(t, n) {
329
- return e(this, null, function* () {
330
- return this.get(`/knowledge/${t}/file/${n}`);
331
- });
332
- }
333
- getKnowledgeIdFileIdData(t, n, i) {
334
- return e(this, null, function* () {
335
- return this.listPaged(`/knowledge/${t}/file/${n}/data`, i);
336
- });
337
- }
338
- postKnowledgeIdFileIdData(t, n, i) {
339
- return e(this, null, function* () {
340
- return this.post(`/knowledge/${t}/file/${n}/data`, {
341
- data: i
342
- });
343
- });
344
- }
345
- patchKnowledgeIdFileIdData(t, n, i, r) {
346
- return e(this, null, function* () {
347
- return this.patch(`/knowledge/${t}/file/${n}/data/${i}`, {
348
- data: r
349
- });
350
- });
351
- }
352
- delKnowledgeIdFileIdDataDid(t, n, i) {
353
- return e(this, null, function* () {
354
- return this.delete(`/knowledge/${t}/file/${n}/data/${i}`);
355
- });
356
- }
357
- // 获取预置知识库
358
- getPresetKnowledge(t) {
359
- return e(this, null, function* () {
360
- return this.get("/presetKnowledge", t);
361
- });
362
- }
363
- patchSessionsIdContext(t) {
364
- return e(this, null, function* () {
365
- return this.patch(`/sessions/${t}/context`, {});
366
- });
367
- }
368
- postResourceToken(t) {
369
- return e(this, null, function* () {
370
- return this.post("/resourceToken", t);
371
- });
372
- }
373
- // 应用嵌入接口
374
- getApplicationIdSession(t) {
375
- return e(this, null, function* () {
376
- return this.get(`/application/${t}/session`);
377
- });
378
- }
379
- patchApplicationIdSessionsIdContext(t, n) {
380
- return e(this, null, function* () {
381
- return this.patch(`/application/${t}/sessions/${n}/context`, {});
382
- });
383
- }
384
- postApplicationIdSessions(t, n) {
385
- return e(this, null, function* () {
386
- return this.post(`/application/${t}/sessions`, n);
387
- });
388
- }
389
- getApplicationIdChatHistorySessionId(t, n) {
390
- return e(this, null, function* () {
391
- return this.get(`/application/${t}/chatHistory/${n}`);
392
- });
393
- }
394
- postApplicationIdChatHistorySessionIdComments(t, n, i) {
395
- return e(this, null, function* () {
396
- return this.post(`/application/${t}/sessions/${n}/comments`, i);
397
- });
398
- }
399
- getApplicationIdPrompts(t, n) {
400
- return e(this, null, function* () {
401
- return this.get(`/application/${t}/promptVariables`, n);
402
- });
403
- }
404
- // 上传知识库内文件的知识引用源文件
405
- postKnowledgeSourceFile(t, n, i) {
406
- return e(this, null, function* () {
407
- return this.post(`/knowledge/${t}/sourceFile/${n}`, i);
408
- });
409
- }
410
- //元数据接口
411
- getMetadata(t) {
412
- return e(this, null, function* () {
413
- return this.get("/metadata", t);
414
- });
415
- }
416
- postGeneques(t) {
417
- return e(this, null, function* () {
418
- return this.post("/geneques", t);
419
- });
420
- }
421
- getBaseModel(t) {
422
- return e(this, null, function* () {
423
- return this.get("/baseModelInfo", {
424
- serviceId: t
425
- });
426
- });
427
- }
428
- }
429
- export {
430
- m as CVForceApi
431
- };
@@ -1,6 +0,0 @@
1
- var s = /* @__PURE__ */ ((e) => (e[e.Robot = 1] = "Robot", e[e.User = 2] = "User", e[e.System = 3] = "System", e))(s || {}), t = /* @__PURE__ */ ((e) => (e[e.Processing = 1] = "Processing", e[e.Success = 2] = "Success", e[e.Failed = 3] = "Failed", e))(t || {}), a = /* @__PURE__ */ ((e) => (e[e.Dialog = 0] = "Dialog", e[e.Text = 1] = "Text", e[e.Agent = 2] = "Agent", e[e.All = 3] = "All", e))(a || {});
2
- export {
3
- a as ApplicationTypes,
4
- s as ChatMessageRole,
5
- t as KnowledgeFileStatus
6
- };
@@ -1,6 +0,0 @@
1
- const o = typeof crypto != "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto), t = {
2
- randomUUID: o
3
- };
4
- export {
5
- t as default
6
- };
@@ -1,10 +0,0 @@
1
- let t;
2
- const e = new Uint8Array(16);
3
- function o() {
4
- if (!t && (t = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
5
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return t(e);
7
- }
8
- export {
9
- o as default
10
- };
@@ -1,9 +0,0 @@
1
- const i = [];
2
- for (let t = 0; t < 256; ++t)
3
- i.push((t + 256).toString(16).slice(1));
4
- function e(t, r = 0) {
5
- return i[t[r + 0]] + i[t[r + 1]] + i[t[r + 2]] + i[t[r + 3]] + "-" + i[t[r + 4]] + i[t[r + 5]] + "-" + i[t[r + 6]] + i[t[r + 7]] + "-" + i[t[r + 8]] + i[t[r + 9]] + "-" + i[t[r + 10]] + i[t[r + 11]] + i[t[r + 12]] + i[t[r + 13]] + i[t[r + 14]] + i[t[r + 15]];
6
- }
7
- export {
8
- e as unsafeStringify
9
- };
@@ -1,19 +0,0 @@
1
- import i from "./native.mjs";
2
- import n from "./rng.mjs";
3
- import { unsafeStringify as e } from "./stringify.mjs";
4
- function p(o, t, a) {
5
- if (i.randomUUID && !t && !o)
6
- return i.randomUUID();
7
- o = o || {};
8
- const r = o.random || (o.rng || n)();
9
- if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
10
- a = a || 0;
11
- for (let f = 0; f < 16; ++f)
12
- t[a + f] = r[f];
13
- return t;
14
- }
15
- return e(r);
16
- }
17
- export {
18
- p as default
19
- };