@yuku123/z-team-component 0.2.163 → 0.2.165
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/{AdminModuleContent-lCylVCLX.js → AdminModuleContent-BVcs90y4.js} +6 -6
- package/dist/{ChangeLogView-CVKT53I9.js → ChangeLogView-DsP-MFf1.js} +1 -1
- package/dist/{ComponentDoc-MaYPgO3K.js → ComponentDoc-DFAGtOt3.js} +821 -820
- package/dist/{InvitationManagementPage-Dev8U8h2.js → InvitationManagementPage-Dbm3mP8h.js} +1 -1
- package/dist/{OnboardingPage-DJkIQ1Y5.js → OnboardingPage-B8CJqJBU.js} +2 -2
- package/dist/{ScheduledTasks-BWEfixiz.js → ScheduledTasks-CXUUD2ct.js} +9 -9
- package/dist/{SettingsModal-DtU0DWZT.js → SettingsModal-BdbZA1Te.js} +4 -4
- package/dist/{SystemShell-DNGziBSC.js → SystemShell-Bi3z5hkO.js} +14 -12
- package/dist/{admin-logs-DoVv2avU.js → admin-logs-Bbg-48gW.js} +1 -1
- package/dist/{api-BtlsClxN.js → api-CawczYe1.js} +1 -1
- package/dist/{api-DjRdOXXX.js → api-Da4iGaAJ.js} +1 -1
- package/dist/{browser-BfzikSHk.js → browser-BJsZ3Sii.js} +1 -1
- package/dist/{createWorkspaceWsHandler-Bdbpxyse.js → createWorkspaceWsHandler-B7DEdNfj.js} +3 -3
- package/dist/index-0RxFtVbt.js +15 -0
- package/dist/{index-g5sT770M.js → index-42bX8gez.js} +8 -8
- package/dist/{index-CbQjeO0U.js → index-B0rtOawD.js} +2 -2
- package/dist/{index-Ctn7S_4T.js → index-BIXa6eC4.js} +4 -4
- package/dist/{index-DmAxVyI-.js → index-BJXpWdBh.js} +3 -3
- package/dist/{index-DBttEprw.js → index-BKInjNWQ.js} +3 -3
- package/dist/{index-DcxDtKxw.js → index-BVdVTavH.js} +3 -3
- package/dist/{index-BrCT2Ck3.js → index-BYOtlNsM.js} +4 -4
- package/dist/{index-DfWvL__y.js → index-B_t78LZv.js} +2 -2
- package/dist/{index-D7qWy4SJ.js → index-BeWt_erd.js} +1 -1
- package/dist/{index-ArTnytPI.js → index-BjkfSXrt.js} +2 -2
- package/dist/{index-sNtT6K9U.js → index-C5pI1LOK.js} +1 -1
- package/dist/{index-CTAZzqPB.js → index-CAEZ76di.js} +1 -1
- package/dist/{index-FCu1ppaZ.js → index-CSGsdXnf.js} +2 -2
- package/dist/{index-BZ7P1Ixw.js → index-CU9hQFNw.js} +2 -2
- package/dist/{index-Cb89sASO.js → index-CrMsFd5Z.js} +2 -2
- package/dist/{index-B3mIg8O0.js → index-CzCVAKeC.js} +2 -2
- package/dist/{index-Dv3QAGBr.js → index-DUkacK_g.js} +1 -1
- package/dist/{index-CoPN_6jY.js → index-DdHHhSPt.js} +3 -3
- package/dist/{index-CPIBUoqa.js → index-Dk9xo9y0.js} +1 -1
- package/dist/{index-DhJAtcv8.js → index-DyObEiTJ.js} +2 -2
- package/dist/{index-DQiwiyzP.js → index-EuTFdSRS.js} +1 -1
- package/dist/{index-C2Rj_tJi.js → index-bAhL-Q2C.js} +2 -2
- package/dist/{index-DQmw_PKQ.js → index-uiJ4rwL8.js} +6 -6
- package/dist/{index-CE55iwz_.js → index-xffkKBkf.js} +1 -1
- package/dist/{index-99EA0PHL.js → index-yI37Olsa.js} +268 -290
- package/dist/index.js +1 -1
- package/dist/{instance-CLLr_Ca3.js → instance-PCTQ6l-6.js} +1 -1
- package/dist/{menuPermission-CYtDMVJ5.js → menuPermission-CxpO_Rus.js} +3 -3
- package/dist/pages.js +1 -1
- package/dist/{send-default-agent-team-message-B3yfqSPJ.js → send-default-agent-team-message-3zrK42dX.js} +1 -1
- package/dist/{spark-md5-BiM6vI98.js → spark-md5-RBHbNhZ5.js} +1 -1
- package/dist/{training-FCBrkduO.js → training-DnTPFJ6u.js} +1 -1
- package/dist/{webide-hX3pNS-j.js → webide-Mt--n4WP.js} +3 -3
- package/package.json +2 -1
- package/dist/index-CTZxAP07.js +0 -15
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { configureTodoStore as
|
|
2
|
-
import { create as
|
|
3
|
-
import { message as x, ConfigProvider as
|
|
1
|
+
import { configureTodoStore as Or } from "@yuku123/z-task-component";
|
|
2
|
+
import { create as Mr } from "zustand";
|
|
3
|
+
import { message as x, ConfigProvider as Nr, Row as se, Col as D, Typography as pe, Alert as ee, Card as F, Space as U, Input as B, Button as M, Table as ie, Drawer as tt, Descriptions as z, Tag as E, Tooltip as Oe, Modal as je, Statistic as Y, Select as te, Tabs as nt, Form as j, Upload as jr, Popconfirm as nn, Spin as kt, Radio as de, InputNumber as xt, Empty as Ur } from "antd";
|
|
4
4
|
import { jsx as a, jsxs as p, Fragment as Ht } from "react/jsx-runtime";
|
|
5
|
-
import { lazy as
|
|
6
|
-
import { useLocation as
|
|
7
|
-
import { antdTheme as
|
|
8
|
-
import { SettingOutlined as
|
|
9
|
-
import { PageHeader as Ue, GradientStatCard as ct, SectionHeader as
|
|
5
|
+
import { lazy as zr, Suspense as nr, useState as A, useEffect as X, useRef as rr } from "react";
|
|
6
|
+
import { useLocation as Lr, useNavigate as rt, useParams as sr, Routes as ar, Route as ue, Navigate as or, useSearchParams as Dr } from "react-router-dom";
|
|
7
|
+
import { antdTheme as Fr } from "@yuku123/z-frontend-common";
|
|
8
|
+
import { SettingOutlined as qr, ProjectOutlined as Ct, UserOutlined as ir, AuditOutlined as Kt, RobotOutlined as Gt, ApiOutlined as rn, AppstoreOutlined as Br, ThunderboltOutlined as It, BarChartOutlined as Hr, ScheduleOutlined as Kr, FileTextOutlined as sn, ReloadOutlined as ce, ExperimentOutlined as Gr, PlayCircleOutlined as Jr, FileSearchOutlined as Wr, VideoCameraOutlined as Vr, SearchOutlined as cr, GlobalOutlined as Zr, CopyOutlined as Yr, CodeOutlined as We, InfoCircleOutlined as Xr, FunctionOutlined as it, ImportOutlined as Jt, CloudUploadOutlined as hn, FileAddOutlined as Qr, PlusOutlined as lr, ExclamationCircleOutlined as es, SaveOutlined as dr, ArrowLeftOutlined as ur, CheckCircleOutlined as ts, SendOutlined as ns } from "@ant-design/icons";
|
|
9
|
+
import { PageHeader as Ue, GradientStatCard as ct, SectionHeader as rs, FeatureCard as ss, DarkBanner as as, ListTable as ye, TableToolbar as os, ErrorState as is, ComponentDoc as cs } from "@yuku123/z-frontend-common/ui";
|
|
10
10
|
import an from "axios";
|
|
11
11
|
function q(e) {
|
|
12
12
|
return e == null || e === "" ? "" : typeof e == "string" ? e : String(e);
|
|
@@ -41,7 +41,7 @@ function At(e, t) {
|
|
|
41
41
|
return n < r ? -1 : 1;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const pr = `[[REASONING:正在分析…]]
|
|
45
45
|
正在分析…
|
|
46
46
|
[[/REASONING]]
|
|
47
47
|
|
|
@@ -50,7 +50,7 @@ function yn(e) {
|
|
|
50
50
|
const t = e.trim();
|
|
51
51
|
return t === "正在分析…" || t === "正在分析...";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function fi(e) {
|
|
54
54
|
var n;
|
|
55
55
|
if (e.type != null && e.type !== "reasoning")
|
|
56
56
|
return !1;
|
|
@@ -59,33 +59,34 @@ function mi(e) {
|
|
|
59
59
|
const t = ((n = e.name) == null ? void 0 : n.trim()) ?? "";
|
|
60
60
|
return yn(t);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Wt(e) {
|
|
63
63
|
if (e === "处理中..." || e === "🔄 正在处理中...")
|
|
64
64
|
return !0;
|
|
65
65
|
const t = e.trim();
|
|
66
|
-
return t ? t ===
|
|
66
|
+
return t ? t === pr.trim() ? !0 : /^\[\[REASONING:正在分析[\s\S]*?\[\[\/REASONING\]\]\s*$/u.test(
|
|
67
67
|
t
|
|
68
68
|
) : !1;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return e === "处理中..." || e === "🔄 正在处理中..." ? !0 : e.trim() ===
|
|
70
|
+
function yi(e) {
|
|
71
|
+
return e === "处理中..." || e === "🔄 正在处理中..." ? !0 : e.trim() === pr.trim();
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
function
|
|
73
|
+
const ls = 101012001;
|
|
74
|
+
function ds() {
|
|
75
75
|
const e = typeof window < "u" && window.ZTEAM_SSO_BASE || "";
|
|
76
76
|
return e ? e.replace(/\/+$/, "") : typeof window > "u" ? "http://localhost" : window.location.origin;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function us() {
|
|
79
79
|
const e = new URL(window.location.href);
|
|
80
80
|
e.searchParams.has("_from_login") || e.searchParams.set("_from_login", "1");
|
|
81
|
-
const t = `${
|
|
81
|
+
const t = `${ds()}/login?redirect=${encodeURIComponent(
|
|
82
82
|
e.toString()
|
|
83
83
|
)}`;
|
|
84
84
|
window.location.href = t;
|
|
85
85
|
}
|
|
86
|
-
const ge = { credentials: "include" };
|
|
86
|
+
const ge = { credentials: "include" }, ps = 15e3, gn = /* @__PURE__ */ new Map();
|
|
87
87
|
function _t(e, t = "error") {
|
|
88
|
-
|
|
88
|
+
const n = Date.now(), r = gn.get(e) || 0;
|
|
89
|
+
n - r < ps || (gn.set(e, n), t === "warning" ? x.warning(e) : x.error(e));
|
|
89
90
|
}
|
|
90
91
|
typeof window < "u" && window.addEventListener(
|
|
91
92
|
"unhandledrejection",
|
|
@@ -94,17 +95,17 @@ typeof window < "u" && window.addEventListener(
|
|
|
94
95
|
t && typeof t == "object" && t._apiUserError && e.preventDefault();
|
|
95
96
|
}
|
|
96
97
|
);
|
|
97
|
-
let
|
|
98
|
-
const
|
|
99
|
-
function
|
|
98
|
+
let bn = !1;
|
|
99
|
+
const Sn = "登录已失效,请重新登录";
|
|
100
|
+
function ms(e) {
|
|
100
101
|
if (!e) return !1;
|
|
101
|
-
if (Number(e.code) ===
|
|
102
|
+
if (Number(e.code) === ls) return !0;
|
|
102
103
|
const t = typeof e.message == "string" ? e.message : "";
|
|
103
104
|
return /登录(?:已)?(?:失效|过期)|重新登录|未登录/.test(t);
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
-
if (!
|
|
107
|
-
|
|
106
|
+
function _n() {
|
|
107
|
+
if (!bn) {
|
|
108
|
+
bn = !0;
|
|
108
109
|
try {
|
|
109
110
|
Zt();
|
|
110
111
|
} catch {
|
|
@@ -113,20 +114,20 @@ function Sn() {
|
|
|
113
114
|
localStorage.removeItem("ft_token"), localStorage.removeItem("USER_INFO"), delete window.USER_INFO;
|
|
114
115
|
} catch {
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
us();
|
|
117
118
|
}
|
|
118
119
|
throw {
|
|
119
120
|
_apiUserError: !0,
|
|
120
|
-
userMessage:
|
|
121
|
-
message:
|
|
121
|
+
userMessage: Sn,
|
|
122
|
+
message: Sn
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function wn(e, t) {
|
|
125
126
|
return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, t);
|
|
126
127
|
}
|
|
127
|
-
const
|
|
128
|
+
const mr = "/z-team", hs = typeof window < "u" && /(zteam[-.]ft\.(zteam\.local|zteam\.local)|team\.zteam\.local)/i.test(
|
|
128
129
|
window.location.hostname
|
|
129
|
-
), on =
|
|
130
|
+
), on = hs, fs = `${on ? "/kapi" : ""}${mr}/api`, ys = `${on ? "/kapi" : ""}${mr}`, gs = `${ys}/v1/scenario-instances`, bs = window.ENV_TYPE || window.envType || "", Te = fs, gi = `${on ? "/kapi" : ""}/z-team-bench/api`, Ss = bs || "local";
|
|
130
131
|
async function ke(e, t) {
|
|
131
132
|
try {
|
|
132
133
|
const n = {
|
|
@@ -135,7 +136,7 @@ async function ke(e, t) {
|
|
|
135
136
|
// 302 分支(跳登录页 ⇒ 200 + text/html ⇒ res.json() 抛错)。
|
|
136
137
|
// init?.headers 在最后 ⇒ 调用方仍可用自己的 Accept 覆盖(如 SSE 的 text/event-stream)。
|
|
137
138
|
Accept: "application/json",
|
|
138
|
-
"project-env":
|
|
139
|
+
"project-env": Ss,
|
|
139
140
|
...t == null ? void 0 : t.headers
|
|
140
141
|
};
|
|
141
142
|
return await fetch(e, { ...ge, ...t, headers: n });
|
|
@@ -145,7 +146,7 @@ async function ke(e, t) {
|
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
async function Ce(e, t) {
|
|
148
|
-
e.status === 401 &&
|
|
149
|
+
e.status === 401 && _n();
|
|
149
150
|
const n = await e.text().catch(() => "");
|
|
150
151
|
let r = {};
|
|
151
152
|
if (n)
|
|
@@ -153,7 +154,7 @@ async function Ce(e, t) {
|
|
|
153
154
|
r = JSON.parse(n);
|
|
154
155
|
} catch {
|
|
155
156
|
if (!e.ok) {
|
|
156
|
-
const s =
|
|
157
|
+
const s = wn(e, t);
|
|
157
158
|
throw _t(
|
|
158
159
|
e.status >= 500 ? s : `${s}(HTTP ${e.status},响应非 JSON)`
|
|
159
160
|
), {
|
|
@@ -164,7 +165,7 @@ async function Ce(e, t) {
|
|
|
164
165
|
}
|
|
165
166
|
return n;
|
|
166
167
|
}
|
|
167
|
-
if (
|
|
168
|
+
if (ms(r) && _n(), typeof r.success == "boolean") {
|
|
168
169
|
if (r.success)
|
|
169
170
|
return r.data !== void 0 ? r.data : !0;
|
|
170
171
|
const s = r.message || // z-team 另有 7 个 admin controller 挂 bench Result({code,msg,data,success})
|
|
@@ -176,7 +177,7 @@ async function Ce(e, t) {
|
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
if (!e.ok) {
|
|
179
|
-
const s = r.detail || r.message ||
|
|
180
|
+
const s = r.detail || r.message || wn(e, t);
|
|
180
181
|
throw _t(s), {
|
|
181
182
|
_apiUserError: !0,
|
|
182
183
|
userMessage: s,
|
|
@@ -185,24 +186,24 @@ async function Ce(e, t) {
|
|
|
185
186
|
}
|
|
186
187
|
return r;
|
|
187
188
|
}
|
|
188
|
-
const
|
|
189
|
-
function
|
|
190
|
-
return e.replace(
|
|
189
|
+
const _s = /_+([a-z0-9])/gi;
|
|
190
|
+
function ws(e) {
|
|
191
|
+
return e.replace(_s, (t, n) => n.toUpperCase());
|
|
191
192
|
}
|
|
192
|
-
function
|
|
193
|
-
if (Array.isArray(e)) return e.map((t) =>
|
|
193
|
+
function Vt(e) {
|
|
194
|
+
if (Array.isArray(e)) return e.map((t) => Vt(t));
|
|
194
195
|
if (e && typeof e == "object" && !(e instanceof Date)) {
|
|
195
196
|
const t = {};
|
|
196
197
|
for (const [n, r] of Object.entries(e))
|
|
197
|
-
t[
|
|
198
|
+
t[ws(n)] = Vt(r);
|
|
198
199
|
return t;
|
|
199
200
|
}
|
|
200
201
|
return e;
|
|
201
202
|
}
|
|
202
|
-
async function
|
|
203
|
-
return
|
|
203
|
+
async function bi(e, t) {
|
|
204
|
+
return Vt(await Ce(e, t));
|
|
204
205
|
}
|
|
205
|
-
async function
|
|
206
|
+
async function Ts() {
|
|
206
207
|
try {
|
|
207
208
|
const e = await ke(`${Te}/sso/attach-ctc-token`, {
|
|
208
209
|
...ge,
|
|
@@ -216,7 +217,7 @@ async function _s() {
|
|
|
216
217
|
return !1;
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
|
-
async function
|
|
220
|
+
async function Si(e, t) {
|
|
220
221
|
const n = t != null && t.trim() !== "" ? { result: t } : void 0, r = await ke(`${Te}/tasks/${e}/complete`, {
|
|
221
222
|
...ge,
|
|
222
223
|
method: "POST",
|
|
@@ -225,7 +226,7 @@ async function gi(e, t) {
|
|
|
225
226
|
});
|
|
226
227
|
return Ce(r, "完成任务失败");
|
|
227
228
|
}
|
|
228
|
-
async function
|
|
229
|
+
async function _i(e, t) {
|
|
229
230
|
const n = await ke(`${Te}/tasks/${e}/suspend`, {
|
|
230
231
|
...ge,
|
|
231
232
|
method: "POST",
|
|
@@ -234,7 +235,7 @@ async function bi(e, t) {
|
|
|
234
235
|
});
|
|
235
236
|
return Ce(n, "挂起任务失败");
|
|
236
237
|
}
|
|
237
|
-
async function
|
|
238
|
+
async function wi(e, t) {
|
|
238
239
|
const n = await ke(`${Te}/tasks/${e}/cancel`, {
|
|
239
240
|
...ge,
|
|
240
241
|
method: "POST",
|
|
@@ -243,7 +244,7 @@ async function Si(e, t) {
|
|
|
243
244
|
});
|
|
244
245
|
return Ce(n, "取消任务失败");
|
|
245
246
|
}
|
|
246
|
-
async function
|
|
247
|
+
async function Ti(e) {
|
|
247
248
|
const t = await ke(`${Te}/tasks/${e}/continue`, {
|
|
248
249
|
...ge,
|
|
249
250
|
method: "POST",
|
|
@@ -251,7 +252,7 @@ async function _i(e) {
|
|
|
251
252
|
});
|
|
252
253
|
return Ce(t, "继续执行失败");
|
|
253
254
|
}
|
|
254
|
-
async function
|
|
255
|
+
async function ki(e) {
|
|
255
256
|
const t = await ke(`${Te}/tasks/${e}/reset`, {
|
|
256
257
|
...ge,
|
|
257
258
|
method: "POST",
|
|
@@ -259,65 +260,65 @@ async function wi(e) {
|
|
|
259
260
|
});
|
|
260
261
|
return Ce(t, "重置执行失败");
|
|
261
262
|
}
|
|
262
|
-
async function
|
|
263
|
+
async function Ci(e) {
|
|
263
264
|
const t = await ke(`${Te}/tasks/${e}`, ge);
|
|
264
265
|
return Ce(t, "加载任务失败");
|
|
265
266
|
}
|
|
266
|
-
const
|
|
267
|
-
let
|
|
267
|
+
const Ii = "http://127.0.0.1/kapi/z-webide/inspect";
|
|
268
|
+
let W = null, Ve = [], Ze = [], Me = 0, Tn = "", lt = null, Je = 0, fe = null, hr = "disconnected";
|
|
268
269
|
function wt(e) {
|
|
269
|
-
|
|
270
|
+
hr = e, Ze.forEach((t) => t(e));
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
+
function kn() {
|
|
272
273
|
return Me !== 0 && Me !== "";
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function ks(e, t = "") {
|
|
275
276
|
const n = window.location.protocol === "https:" ? "wss:" : "ws:", r = window.location.host, s = t ? `?token=${encodeURIComponent(t)}` : "";
|
|
276
|
-
return `${n}//${r}${
|
|
277
|
+
return `${n}//${r}${gs}/${e}/ws${s}`;
|
|
277
278
|
}
|
|
278
|
-
function
|
|
279
|
-
return Ze.push(e), e(
|
|
279
|
+
function $i(e) {
|
|
280
|
+
return Ze.push(e), e(hr), () => {
|
|
280
281
|
Ze = Ze.filter((t) => t !== e);
|
|
281
282
|
};
|
|
282
283
|
}
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
284
|
+
function Cs(e, t = "", n) {
|
|
285
|
+
if (W && (W.readyState === WebSocket.CONNECTING || W.readyState === WebSocket.OPEN) && Me === e)
|
|
285
286
|
return;
|
|
286
|
-
|
|
287
|
-
const r =
|
|
288
|
-
Me = e,
|
|
287
|
+
W && (W.onclose = null, W.close(), W = null), fe != null && (clearTimeout(fe), fe = null);
|
|
288
|
+
const r = ks(e, t);
|
|
289
|
+
Me = e, Tn = t, n && (lt = n), wt("connecting"), W = new WebSocket(r), W.onopen = () => {
|
|
289
290
|
Je = 0, wt("connected"), console.log("[WS] connected");
|
|
290
|
-
},
|
|
291
|
+
}, W.onmessage = (s) => {
|
|
291
292
|
try {
|
|
292
293
|
const o = JSON.parse(s.data);
|
|
293
|
-
console.log("[WS recv]", o.type, o),
|
|
294
|
+
console.log("[WS recv]", o.type, o), Ve.forEach((i) => i(o));
|
|
294
295
|
} catch {
|
|
295
296
|
}
|
|
296
|
-
},
|
|
297
|
+
}, W.onerror = () => {
|
|
297
298
|
console.warn("[WS] connection error:", r);
|
|
298
|
-
},
|
|
299
|
+
}, W.onclose = (s) => {
|
|
299
300
|
const o = s.wasClean;
|
|
300
|
-
if (
|
|
301
|
+
if (W = null, wt("disconnected"), !kn()) return;
|
|
301
302
|
Je += 1;
|
|
302
303
|
const i = Math.min(3e3 * Je, 3e4);
|
|
303
304
|
console.warn(
|
|
304
305
|
`[WS] closed (clean=${o}), reconnect #${Je} in ${i}ms`
|
|
305
306
|
), fe = setTimeout(() => {
|
|
306
|
-
fe = null,
|
|
307
|
+
fe = null, kn() && (Cs(Me, Tn), lt == null || lt());
|
|
307
308
|
}, i);
|
|
308
309
|
};
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
-
return
|
|
312
|
-
|
|
311
|
+
function Ai(e) {
|
|
312
|
+
return Ve.push(e), () => {
|
|
313
|
+
Ve = Ve.filter((t) => t !== e);
|
|
313
314
|
};
|
|
314
315
|
}
|
|
315
|
-
async function
|
|
316
|
-
await
|
|
317
|
-
}),
|
|
316
|
+
async function Is(e) {
|
|
317
|
+
await Ts().catch(() => {
|
|
318
|
+
}), W && W.readyState === WebSocket.OPEN && W.send(JSON.stringify(e));
|
|
318
319
|
}
|
|
319
320
|
function Zt() {
|
|
320
|
-
Me = 0, fe != null && (clearTimeout(fe), fe = null),
|
|
321
|
+
Me = 0, fe != null && (clearTimeout(fe), fe = null), W && (W.onclose = null, W.close(), W = null), Je = 0, wt("disconnected"), Ve = [], Ze = [];
|
|
321
322
|
}
|
|
322
323
|
const g = {
|
|
323
324
|
credentials: "include",
|
|
@@ -325,10 +326,10 @@ const g = {
|
|
|
325
326
|
// 而不是返回 302 跳到 SSO 登录页(避免 fetch follow redirect 后拿到 SPA HTML 导致解析失败)
|
|
326
327
|
headers: { Accept: "application/json" }
|
|
327
328
|
}, Ye = "zindexer_admin_token";
|
|
328
|
-
function
|
|
329
|
+
function vi() {
|
|
329
330
|
return typeof localStorage > "u" ? "" : localStorage.getItem(Ye) || "";
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
+
function xi(e) {
|
|
332
333
|
if (typeof localStorage > "u") return;
|
|
333
334
|
const t = (e || "").trim();
|
|
334
335
|
if (!t) {
|
|
@@ -337,7 +338,7 @@ function Ai(e) {
|
|
|
337
338
|
}
|
|
338
339
|
localStorage.setItem(Ye, t), localStorage.setItem("zindexer_token", t);
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function Pi() {
|
|
341
342
|
typeof localStorage > "u" || localStorage.removeItem(Ye);
|
|
342
343
|
}
|
|
343
344
|
function Ie(e = {}) {
|
|
@@ -352,13 +353,13 @@ function Ie(e = {}) {
|
|
|
352
353
|
}
|
|
353
354
|
};
|
|
354
355
|
}
|
|
355
|
-
class
|
|
356
|
+
class $s extends Error {
|
|
356
357
|
constructor(t) {
|
|
357
358
|
super(t), this._apiUserError = !0, this.name = "ApiUserError", this.userMessage = t;
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
361
|
function Pt(e) {
|
|
361
|
-
return e instanceof
|
|
362
|
+
return e instanceof $s ? !0 : !!(e && typeof e == "object" && e._apiUserError);
|
|
362
363
|
}
|
|
363
364
|
function we(e, t = "error") {
|
|
364
365
|
console[t === "warning" ? "warn" : "error"]("[api]", e);
|
|
@@ -370,11 +371,11 @@ typeof window < "u" && window.addEventListener(
|
|
|
370
371
|
t && typeof t == "object" && t._apiUserError && e.preventDefault();
|
|
371
372
|
}
|
|
372
373
|
);
|
|
373
|
-
function
|
|
374
|
+
function Cn(e, t) {
|
|
374
375
|
return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, t);
|
|
375
376
|
}
|
|
376
|
-
const
|
|
377
|
-
async function
|
|
377
|
+
const As = "/z-team", vs = typeof window < "u" && window.ZTEAM_USE_KAPI === !0, fr = vs, yr = `${fr ? "/kapi" : ""}${As}/api`, xs = window.ENV_TYPE || window.envType || "", b = yr, Ei = `${fr ? "/kapi" : ""}/z-team-evolution/api`;
|
|
378
|
+
async function Ps(e) {
|
|
378
379
|
const t = new FormData();
|
|
379
380
|
t.append("file", e);
|
|
380
381
|
const n = await S(`${b}/common/upload-image`, {
|
|
@@ -387,10 +388,10 @@ async function vs(e) {
|
|
|
387
388
|
}
|
|
388
389
|
return s;
|
|
389
390
|
}
|
|
390
|
-
async function
|
|
391
|
-
return Promise.all(e.map((t) =>
|
|
391
|
+
async function Ri(e) {
|
|
392
|
+
return Promise.all(e.map((t) => Ps(t)));
|
|
392
393
|
}
|
|
393
|
-
const
|
|
394
|
+
const Es = xs || "local";
|
|
394
395
|
async function S(e, t) {
|
|
395
396
|
try {
|
|
396
397
|
const n = {
|
|
@@ -400,7 +401,7 @@ async function S(e, t) {
|
|
|
400
401
|
// init?.headers 在最后 ⇒ 调用方仍可用自己的 Accept 覆盖(如 SSE 的 text/event-stream)。
|
|
401
402
|
Accept: "application/json",
|
|
402
403
|
...g.headers,
|
|
403
|
-
"project-env":
|
|
404
|
+
"project-env": Es,
|
|
404
405
|
...t == null ? void 0 : t.headers
|
|
405
406
|
};
|
|
406
407
|
return await fetch(e, { ...g, ...t, headers: n });
|
|
@@ -409,7 +410,7 @@ async function S(e, t) {
|
|
|
409
410
|
throw we(n), { _apiUserError: !0, userMessage: n, message: n };
|
|
410
411
|
}
|
|
411
412
|
}
|
|
412
|
-
function
|
|
413
|
+
function gr(e) {
|
|
413
414
|
const t = e.id ?? e.staff_id ?? e.staffId ?? e.user_id ?? e.userId;
|
|
414
415
|
return {
|
|
415
416
|
// FE-PRECISION-FIX: 雪花 ID 保持字符串,禁止走 Number()
|
|
@@ -429,7 +430,7 @@ async function y(e, t) {
|
|
|
429
430
|
r = JSON.parse(n);
|
|
430
431
|
} catch {
|
|
431
432
|
if (!e.ok) {
|
|
432
|
-
const i =
|
|
433
|
+
const i = Cn(e, t);
|
|
433
434
|
throw we(
|
|
434
435
|
e.status >= 500 ? i : `${i}(HTTP ${e.status},响应非 JSON)`
|
|
435
436
|
), {
|
|
@@ -452,7 +453,7 @@ async function y(e, t) {
|
|
|
452
453
|
};
|
|
453
454
|
}
|
|
454
455
|
if (!e.ok) {
|
|
455
|
-
const i = r.detail || r.message ||
|
|
456
|
+
const i = r.detail || r.message || Cn(e, t);
|
|
456
457
|
throw we(i), {
|
|
457
458
|
_apiUserError: !0,
|
|
458
459
|
userMessage: i,
|
|
@@ -461,17 +462,17 @@ async function y(e, t) {
|
|
|
461
462
|
}
|
|
462
463
|
return r;
|
|
463
464
|
}
|
|
464
|
-
async function
|
|
465
|
+
async function Rs(e, t) {
|
|
465
466
|
const n = await fetch("/kapi/z-ctc/api/ctc/authn/login", {
|
|
466
467
|
...g,
|
|
467
468
|
method: "POST",
|
|
468
469
|
headers: { Accept: "application/json", "Content-Type": "application/json" },
|
|
469
470
|
credentials: "include",
|
|
470
471
|
body: JSON.stringify({ identifier: e, password: t })
|
|
471
|
-
}), r = await y(n, "登录失败"), s = (r == null ? void 0 : r.userInfo) ?? (r == null ? void 0 : r.user_info) ?? (r == null ? void 0 : r.user) ?? r, o =
|
|
472
|
+
}), r = await y(n, "登录失败"), s = (r == null ? void 0 : r.userInfo) ?? (r == null ? void 0 : r.user_info) ?? (r == null ? void 0 : r.user) ?? r, o = gr(s);
|
|
472
473
|
return { token: (r == null ? void 0 : r.token) ?? "", user: o };
|
|
473
474
|
}
|
|
474
|
-
async function
|
|
475
|
+
async function Oi(e) {
|
|
475
476
|
const t = await fetch("/kapi/z-ctc/api/ctc/authn/whoami", {
|
|
476
477
|
headers: { Accept: "application/json" },
|
|
477
478
|
...g,
|
|
@@ -480,9 +481,9 @@ async function Ei(e) {
|
|
|
480
481
|
t,
|
|
481
482
|
"获取用户信息失败"
|
|
482
483
|
);
|
|
483
|
-
return
|
|
484
|
+
return gr(n);
|
|
484
485
|
}
|
|
485
|
-
async function
|
|
486
|
+
async function Mi() {
|
|
486
487
|
const e = await fetch("/kapi/z-ctc/api/ctc/authn/my-tenants", {
|
|
487
488
|
...g,
|
|
488
489
|
headers: { Accept: "application/json" },
|
|
@@ -498,7 +499,7 @@ async function Ri() {
|
|
|
498
499
|
isOrphan: !!((t == null ? void 0 : t.isOrphan) ?? (t == null ? void 0 : t.orphan) ?? (t == null ? void 0 : t.is_orphan) ?? s.length === 0)
|
|
499
500
|
};
|
|
500
501
|
}
|
|
501
|
-
async function
|
|
502
|
+
async function Ni(e) {
|
|
502
503
|
const t = e ? `?tenantCode=${encodeURIComponent(e)}` : "", n = await fetch(`/kapi/z-ctc/api/ctc/ac/domains/list${t}`, {
|
|
503
504
|
...g,
|
|
504
505
|
headers: { Accept: "application/json" },
|
|
@@ -512,7 +513,7 @@ async function Oi(e) {
|
|
|
512
513
|
status: s(i, "status", "status")
|
|
513
514
|
})).filter((i) => i.domainCode);
|
|
514
515
|
}
|
|
515
|
-
async function
|
|
516
|
+
async function ji(e, t) {
|
|
516
517
|
const n = await fetch("/kapi/z-ctc/api/ctc/authn/select-tenant", {
|
|
517
518
|
...g,
|
|
518
519
|
method: "POST",
|
|
@@ -522,7 +523,7 @@ async function Mi(e, t) {
|
|
|
522
523
|
}), r = await y(n, "切换租户失败");
|
|
523
524
|
return { token: (r == null ? void 0 : r.token) ?? "", account: (r == null ? void 0 : r.account) ?? null };
|
|
524
525
|
}
|
|
525
|
-
async function
|
|
526
|
+
async function Os(e) {
|
|
526
527
|
await y(
|
|
527
528
|
await fetch("/kapi/z-ctc/api/ctc/authn/logout", {
|
|
528
529
|
headers: { Accept: "application/json" },
|
|
@@ -537,11 +538,11 @@ async function Es(e) {
|
|
|
537
538
|
} catch {
|
|
538
539
|
}
|
|
539
540
|
}
|
|
540
|
-
const Ae = /* @__PURE__ */ new Map(),
|
|
541
|
-
async function
|
|
541
|
+
const Ae = /* @__PURE__ */ new Map(), Ms = 300 * 1e3, Ns = 30 * 1e3;
|
|
542
|
+
async function Ui(e, t) {
|
|
542
543
|
const n = `${e}`, r = Ae.get(n);
|
|
543
544
|
if (r) {
|
|
544
|
-
const s = r.failed ?
|
|
545
|
+
const s = r.failed ? Ns : Ms;
|
|
545
546
|
if (Date.now() - r.at < s)
|
|
546
547
|
return { codes: r.codes, failed: r.failed };
|
|
547
548
|
Ae.delete(n);
|
|
@@ -567,7 +568,7 @@ async function Ni(e, t) {
|
|
|
567
568
|
return Ae.set(n, { codes: [], failed: !0, at: Date.now() }), { codes: [], failed: !0 };
|
|
568
569
|
}
|
|
569
570
|
}
|
|
570
|
-
async function
|
|
571
|
+
async function js(e = "", t) {
|
|
571
572
|
const n = new URLSearchParams();
|
|
572
573
|
e && n.set("token", e), t && n.set("create_time_start", t);
|
|
573
574
|
const r = n.toString(), s = await S(
|
|
@@ -576,11 +577,11 @@ async function Ms(e = "", t) {
|
|
|
576
577
|
);
|
|
577
578
|
return y(s, "获取项目列表失败");
|
|
578
579
|
}
|
|
579
|
-
async function
|
|
580
|
+
async function zi(e = "") {
|
|
580
581
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/scenarios${t}`, g);
|
|
581
582
|
return y(n, "获取专家团列表失败");
|
|
582
583
|
}
|
|
583
|
-
async function
|
|
584
|
+
async function br(e, t = "") {
|
|
584
585
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = {
|
|
585
586
|
...e,
|
|
586
587
|
extend_params: { ...e.extend_params, skip_init_task: "true" }
|
|
@@ -592,7 +593,7 @@ async function gr(e, t = "") {
|
|
|
592
593
|
}), o = await y(s, "创建项目失败");
|
|
593
594
|
return $e(o);
|
|
594
595
|
}
|
|
595
|
-
const
|
|
596
|
+
const Li = br;
|
|
596
597
|
function $e(e) {
|
|
597
598
|
return {
|
|
598
599
|
// FE-PRECISION-FIX: 雪花 ID 是 19 位 bigint, Number() 会丢末位精度
|
|
@@ -611,10 +612,10 @@ function $e(e) {
|
|
|
611
612
|
role: e.role != null ? String(e.role) : void 0,
|
|
612
613
|
llm_code: e.llm_code != null ? String(e.llm_code) : e.llmCode != null ? String(e.llmCode) : void 0,
|
|
613
614
|
members: Array.isArray(e.members) ? e.members.map((t) => String(t)) : void 0,
|
|
614
|
-
parent_id:
|
|
615
|
+
parent_id: Us(e)
|
|
615
616
|
};
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
+
function Us(e) {
|
|
618
619
|
const t = e.ext;
|
|
619
620
|
if (!t) return;
|
|
620
621
|
const n = t.params;
|
|
@@ -624,7 +625,7 @@ function Ns(e) {
|
|
|
624
625
|
const s = q(r);
|
|
625
626
|
return s === "" ? void 0 : s;
|
|
626
627
|
}
|
|
627
|
-
async function
|
|
628
|
+
async function Di(e, t) {
|
|
628
629
|
const n = await S(
|
|
629
630
|
`${b}/scenario-instances/${e}/llm-code`,
|
|
630
631
|
{
|
|
@@ -636,12 +637,12 @@ async function zi(e, t) {
|
|
|
636
637
|
), r = await y(n, "设置模型失败");
|
|
637
638
|
return $e(r);
|
|
638
639
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
640
|
+
const zs = "qa_support";
|
|
641
|
+
function Fi(e) {
|
|
641
642
|
const t = e.futureTeamProjectId ?? e.future_team_project_id ?? "", n = q(String(t).trim());
|
|
642
643
|
return _e(n) ? n : null;
|
|
643
644
|
}
|
|
644
|
-
async function
|
|
645
|
+
async function qi(e, t, n) {
|
|
645
646
|
const r = new URLSearchParams({
|
|
646
647
|
ticketId: e,
|
|
647
648
|
futureTeamProjectId: String(t),
|
|
@@ -655,14 +656,14 @@ async function Di(e, t, n) {
|
|
|
655
656
|
});
|
|
656
657
|
await y(s, "回写工单关联工程失败");
|
|
657
658
|
}
|
|
658
|
-
async function
|
|
659
|
+
async function Ls(e) {
|
|
659
660
|
const t = await S(
|
|
660
661
|
`${b}/scenario-instances/${e}/team/`,
|
|
661
662
|
g
|
|
662
663
|
);
|
|
663
664
|
return y(t, "获取团队成员失败");
|
|
664
665
|
}
|
|
665
|
-
async function
|
|
666
|
+
async function Ds(e, t) {
|
|
666
667
|
const n = await S(`${b}/scenario-instances/${e}/team/`, {
|
|
667
668
|
...g,
|
|
668
669
|
method: "POST",
|
|
@@ -671,7 +672,7 @@ async function zs(e, t) {
|
|
|
671
672
|
});
|
|
672
673
|
return y(n, "添加成员失败");
|
|
673
674
|
}
|
|
674
|
-
async function
|
|
675
|
+
async function Fs(e, t) {
|
|
675
676
|
const n = await S(
|
|
676
677
|
`${b}/scenario-instances/${e}/team/${t}`,
|
|
677
678
|
{
|
|
@@ -681,35 +682,35 @@ async function Ls(e, t) {
|
|
|
681
682
|
);
|
|
682
683
|
return y(n, "移除成员失败");
|
|
683
684
|
}
|
|
684
|
-
async function
|
|
685
|
+
async function qs(e) {
|
|
685
686
|
const t = await S(
|
|
686
687
|
`${b}/scenario-instances/${e}/team/available-agents`,
|
|
687
688
|
g
|
|
688
689
|
);
|
|
689
690
|
return y(t, "获取Agent列表失败");
|
|
690
691
|
}
|
|
691
|
-
async function
|
|
692
|
+
async function Bs(e) {
|
|
692
693
|
const t = await S(
|
|
693
694
|
`${b}/scenario-instances/${e}/team/available-humans`,
|
|
694
695
|
g
|
|
695
696
|
);
|
|
696
697
|
return y(t, "获取用户列表失败");
|
|
697
698
|
}
|
|
698
|
-
async function
|
|
699
|
+
async function Hs(e) {
|
|
699
700
|
const t = await S(
|
|
700
701
|
`${b}/scenario-instances/${e}/skills`,
|
|
701
702
|
g
|
|
702
703
|
);
|
|
703
704
|
return y(t, "获取技能列表失败");
|
|
704
705
|
}
|
|
705
|
-
async function
|
|
706
|
+
async function Ks(e) {
|
|
706
707
|
const t = await S(
|
|
707
708
|
`${b}/scenario-instances/${e}/all-skills`,
|
|
708
709
|
g
|
|
709
710
|
);
|
|
710
711
|
return y(t, "获取全部技能列表失败");
|
|
711
712
|
}
|
|
712
|
-
async function
|
|
713
|
+
async function Gs(e, t) {
|
|
713
714
|
const n = await S(`${b}/scenario-instances/${e}/skills`, {
|
|
714
715
|
...g,
|
|
715
716
|
method: "POST",
|
|
@@ -718,7 +719,7 @@ async function Hs(e, t) {
|
|
|
718
719
|
});
|
|
719
720
|
return y(n, "添加技能失败");
|
|
720
721
|
}
|
|
721
|
-
async function
|
|
722
|
+
async function Js(e, t) {
|
|
722
723
|
const n = await S(
|
|
723
724
|
`${b}/scenario-instances/${e}/skills/${t}`,
|
|
724
725
|
{
|
|
@@ -728,7 +729,7 @@ async function Ks(e, t) {
|
|
|
728
729
|
);
|
|
729
730
|
return y(n, "移除技能失败");
|
|
730
731
|
}
|
|
731
|
-
async function
|
|
732
|
+
async function Ws(e, t) {
|
|
732
733
|
const n = await S(
|
|
733
734
|
`${b}/scenario-instances/${e}/agent-skills/refresh`,
|
|
734
735
|
{
|
|
@@ -740,7 +741,7 @@ async function Gs(e, t) {
|
|
|
740
741
|
);
|
|
741
742
|
return y(n, "刷新技能失败");
|
|
742
743
|
}
|
|
743
|
-
async function
|
|
744
|
+
async function Vs(e) {
|
|
744
745
|
const t = await S(
|
|
745
746
|
`${b}/scenario-instances/${e}/all-agent-skills/refresh`,
|
|
746
747
|
{
|
|
@@ -750,13 +751,13 @@ async function Js(e) {
|
|
|
750
751
|
);
|
|
751
752
|
return y(t, "刷新所有技能失败");
|
|
752
753
|
}
|
|
753
|
-
async function
|
|
754
|
+
async function In(e, t = 50, n) {
|
|
754
755
|
let r = `${b}/scenario-instances/${e}/messages?limit=${t}`;
|
|
755
756
|
n && (r += `&before=${n}`);
|
|
756
757
|
const s = await S(r, g);
|
|
757
758
|
return y(s, "加载聊天记录失败,请稍后重试");
|
|
758
759
|
}
|
|
759
|
-
async function
|
|
760
|
+
async function Zs(e, t, n = "") {
|
|
760
761
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
761
762
|
`${b}/scenario-instances/${e}/messages/${t}/read${r}`,
|
|
762
763
|
{
|
|
@@ -778,7 +779,7 @@ async function dt(e, t, n = "") {
|
|
|
778
779
|
);
|
|
779
780
|
return y(s, "发送消息失败");
|
|
780
781
|
}
|
|
781
|
-
async function
|
|
782
|
+
async function Ys(e, t) {
|
|
782
783
|
const n = await S(
|
|
783
784
|
`${b}/scenario-instances/${e}/cancel/${t}`,
|
|
784
785
|
{ ...g, method: "POST" }
|
|
@@ -787,32 +788,32 @@ async function Ws(e, t) {
|
|
|
787
788
|
throw new Error(String(r.warning));
|
|
788
789
|
return r;
|
|
789
790
|
}
|
|
790
|
-
async function
|
|
791
|
+
async function Xs(e, t) {
|
|
791
792
|
const n = await S(
|
|
792
793
|
`${b}/scenario-instances/${e}/cancel/${t}/queue`,
|
|
793
794
|
{ ...g, method: "POST" }
|
|
794
795
|
);
|
|
795
796
|
return y(n, "停止队列失败");
|
|
796
797
|
}
|
|
797
|
-
async function
|
|
798
|
+
async function Qs(e) {
|
|
798
799
|
const t = await S(
|
|
799
800
|
`${b}/scenario-instances/${e}/executions`,
|
|
800
801
|
g
|
|
801
802
|
);
|
|
802
803
|
return y(t, "获取执行列表失败");
|
|
803
804
|
}
|
|
804
|
-
async function
|
|
805
|
+
async function $n(e, t = "") {
|
|
805
806
|
const n = t ? `?subdir=${encodeURIComponent(t)}` : "", r = await S(
|
|
806
807
|
`${b}/scenario-instances/${e}/workspace/tree${n}`,
|
|
807
808
|
g
|
|
808
809
|
);
|
|
809
810
|
return y(r, "获取文件树失败");
|
|
810
811
|
}
|
|
811
|
-
async function
|
|
812
|
+
async function ea() {
|
|
812
813
|
const e = await S(`${b}/workspace/env`, g);
|
|
813
814
|
return y(e, "获取环境信息失败");
|
|
814
815
|
}
|
|
815
|
-
async function
|
|
816
|
+
async function ta(e) {
|
|
816
817
|
const t = await S(
|
|
817
818
|
`${b}/scenario-instances/${e}/workspace/sync-from-prod`,
|
|
818
819
|
{
|
|
@@ -823,7 +824,7 @@ async function Qs(e) {
|
|
|
823
824
|
);
|
|
824
825
|
return y(t, "同步失败");
|
|
825
826
|
}
|
|
826
|
-
async function
|
|
827
|
+
async function na(e, t) {
|
|
827
828
|
const n = await S(
|
|
828
829
|
`${b}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
|
|
829
830
|
t
|
|
@@ -832,7 +833,7 @@ async function ea(e, t) {
|
|
|
832
833
|
);
|
|
833
834
|
return y(n, "获取文件内容失败");
|
|
834
835
|
}
|
|
835
|
-
async function
|
|
836
|
+
async function ra(e, t, n) {
|
|
836
837
|
const r = await S(
|
|
837
838
|
`${b}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
|
|
838
839
|
t
|
|
@@ -846,7 +847,7 @@ async function ta(e, t, n) {
|
|
|
846
847
|
);
|
|
847
848
|
return y(r, "保存文件失败");
|
|
848
849
|
}
|
|
849
|
-
async function
|
|
850
|
+
async function sa(e, t, n) {
|
|
850
851
|
const r = await S(
|
|
851
852
|
`${b}/scenario-instances/${e}/workspace/rename`,
|
|
852
853
|
{
|
|
@@ -858,7 +859,7 @@ async function na(e, t, n) {
|
|
|
858
859
|
);
|
|
859
860
|
return y(r, "重命名失败");
|
|
860
861
|
}
|
|
861
|
-
async function
|
|
862
|
+
async function aa(e, t, n) {
|
|
862
863
|
const r = await S(
|
|
863
864
|
`${b}/scenario-instances/${e}/workspace/new-file`,
|
|
864
865
|
{
|
|
@@ -870,7 +871,7 @@ async function ra(e, t, n) {
|
|
|
870
871
|
);
|
|
871
872
|
return y(r, "新建文件失败");
|
|
872
873
|
}
|
|
873
|
-
async function
|
|
874
|
+
async function oa(e, t, n) {
|
|
874
875
|
const r = await S(
|
|
875
876
|
`${b}/scenario-instances/${e}/workspace/new-folder`,
|
|
876
877
|
{
|
|
@@ -882,7 +883,7 @@ async function sa(e, t, n) {
|
|
|
882
883
|
);
|
|
883
884
|
return y(r, "新建文件夹失败");
|
|
884
885
|
}
|
|
885
|
-
async function
|
|
886
|
+
async function ia(e, t) {
|
|
886
887
|
const n = await S(
|
|
887
888
|
`${b}/scenario-instances/${e}/workspace/delete`,
|
|
888
889
|
{
|
|
@@ -894,7 +895,7 @@ async function aa(e, t) {
|
|
|
894
895
|
);
|
|
895
896
|
return y(n, "删除失败");
|
|
896
897
|
}
|
|
897
|
-
async function
|
|
898
|
+
async function ca(e, t, n) {
|
|
898
899
|
const r = new FormData();
|
|
899
900
|
r.append("file", n), r.append("parent_path", t);
|
|
900
901
|
const s = await S(
|
|
@@ -907,7 +908,7 @@ async function oa(e, t, n) {
|
|
|
907
908
|
);
|
|
908
909
|
return y(s, "上传文件失败");
|
|
909
910
|
}
|
|
910
|
-
async function
|
|
911
|
+
async function la(e, t, n) {
|
|
911
912
|
const r = new FormData();
|
|
912
913
|
n.forEach((o) => r.append("files", o)), r.append("parent_path", t);
|
|
913
914
|
const s = await S(
|
|
@@ -920,7 +921,7 @@ async function ia(e, t, n) {
|
|
|
920
921
|
);
|
|
921
922
|
return y(s, "上传文件夹失败");
|
|
922
923
|
}
|
|
923
|
-
async function
|
|
924
|
+
async function da(e, t) {
|
|
924
925
|
const n = await S(
|
|
925
926
|
`${b}/scenario-instances/${e}/workspace/download?file_path=${encodeURIComponent(
|
|
926
927
|
t
|
|
@@ -930,7 +931,7 @@ async function ca(e, t) {
|
|
|
930
931
|
if (!n.ok) throw new Error("下载失败");
|
|
931
932
|
return n.blob();
|
|
932
933
|
}
|
|
933
|
-
async function
|
|
934
|
+
async function ua(e, t = "") {
|
|
934
935
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
935
936
|
`${b}/scenario-instances/${e}${n}`,
|
|
936
937
|
g
|
|
@@ -940,8 +941,8 @@ async function la(e, t = "") {
|
|
|
940
941
|
scenarioInstance: i ? $e(i) : null
|
|
941
942
|
};
|
|
942
943
|
}
|
|
943
|
-
async function
|
|
944
|
-
const n = await
|
|
944
|
+
async function pa(e, t = "") {
|
|
945
|
+
const n = await ua(e, t);
|
|
945
946
|
if (n.status === "NOT_FOUND" || !n.scenarioInstance)
|
|
946
947
|
throw {
|
|
947
948
|
_apiUserError: !0,
|
|
@@ -950,7 +951,7 @@ async function da(e, t = "") {
|
|
|
950
951
|
};
|
|
951
952
|
return n.scenarioInstance;
|
|
952
953
|
}
|
|
953
|
-
async function
|
|
954
|
+
async function ma(e, t = "") {
|
|
954
955
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
955
956
|
`${b}/scenario-instances/${e}/join-self${n}`,
|
|
956
957
|
{
|
|
@@ -960,17 +961,17 @@ async function ua(e, t = "") {
|
|
|
960
961
|
), s = await y(r, "加入工程失败");
|
|
961
962
|
return $e(s);
|
|
962
963
|
}
|
|
963
|
-
async function
|
|
964
|
-
return await
|
|
964
|
+
async function ha(e, t = "") {
|
|
965
|
+
return await pa(e, t), ma(e, t);
|
|
965
966
|
}
|
|
966
|
-
async function
|
|
967
|
+
async function fa(e) {
|
|
967
968
|
const t = await S(`${b}/scenario-instances/${e}`, {
|
|
968
969
|
...g,
|
|
969
970
|
method: "DELETE"
|
|
970
971
|
});
|
|
971
972
|
return y(t, "删除项目失败");
|
|
972
973
|
}
|
|
973
|
-
async function
|
|
974
|
+
async function ya(e, t, n = "", r) {
|
|
974
975
|
const s = n ? `?token=${encodeURIComponent(n)}` : "", o = await S(
|
|
975
976
|
`${b}/scenario-instances/${e}/fork${s}`,
|
|
976
977
|
{
|
|
@@ -984,7 +985,7 @@ async function ha(e, t, n = "", r) {
|
|
|
984
985
|
), i = await y(o, "Fork 项目失败");
|
|
985
986
|
return $e(i);
|
|
986
987
|
}
|
|
987
|
-
async function
|
|
988
|
+
async function ga(e, t) {
|
|
988
989
|
const n = await S(`${b}/scenario-instances/${e}`, {
|
|
989
990
|
...g,
|
|
990
991
|
method: "PATCH",
|
|
@@ -993,7 +994,7 @@ async function fa(e, t) {
|
|
|
993
994
|
}), r = await y(n, "更新项目失败");
|
|
994
995
|
return $e(r);
|
|
995
996
|
}
|
|
996
|
-
async function
|
|
997
|
+
async function Bi(e) {
|
|
997
998
|
const t = await S(
|
|
998
999
|
`${b}/scenario-instances/${e}/retry-image-parse`,
|
|
999
1000
|
{
|
|
@@ -1007,7 +1008,7 @@ async function Fi(e) {
|
|
|
1007
1008
|
message: r.message
|
|
1008
1009
|
};
|
|
1009
1010
|
}
|
|
1010
|
-
async function
|
|
1011
|
+
async function ba(e, t, n = "") {
|
|
1011
1012
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1012
1013
|
`${b}/scenario-instances/${e}/task-sessions/${t}${r}`,
|
|
1013
1014
|
{
|
|
@@ -1018,13 +1019,13 @@ async function ya(e, t, n = "") {
|
|
|
1018
1019
|
);
|
|
1019
1020
|
return y(s, "创建任务会话失败");
|
|
1020
1021
|
}
|
|
1021
|
-
async function
|
|
1022
|
+
async function Sa(e, t, n = 50, r, s = "") {
|
|
1022
1023
|
let o = `${b}/scenario-instances/${e}/task-sessions/${t}/messages?limit=${n}`;
|
|
1023
1024
|
r && (o += `&before=${r}`), s && (o += `&token=${encodeURIComponent(s)}`);
|
|
1024
1025
|
const i = await S(o, g);
|
|
1025
1026
|
return y(i, "获取任务消息失败");
|
|
1026
1027
|
}
|
|
1027
|
-
async function
|
|
1028
|
+
async function _a(e, t, n, r = "", s) {
|
|
1028
1029
|
const o = r ? `?token=${encodeURIComponent(r)}` : "", i = { content: n };
|
|
1029
1030
|
s && s.length > 0 && (i.image_urls = s);
|
|
1030
1031
|
const c = await S(
|
|
@@ -1038,11 +1039,11 @@ async function ba(e, t, n, r = "", s) {
|
|
|
1038
1039
|
);
|
|
1039
1040
|
return y(c, "发送任务消息失败");
|
|
1040
1041
|
}
|
|
1041
|
-
async function
|
|
1042
|
+
async function Hi(e = "") {
|
|
1042
1043
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/admin/scenarios${t}`, g);
|
|
1043
1044
|
return y(n, "获取专家团列表失败");
|
|
1044
1045
|
}
|
|
1045
|
-
async function
|
|
1046
|
+
async function Ki(e, t, n = "") {
|
|
1046
1047
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1047
1048
|
`${b}/admin/agents/${encodeURIComponent(
|
|
1048
1049
|
e
|
|
@@ -1056,14 +1057,14 @@ async function Bi(e, t, n = "") {
|
|
|
1056
1057
|
);
|
|
1057
1058
|
return y(s, "测试登录失败");
|
|
1058
1059
|
}
|
|
1059
|
-
async function
|
|
1060
|
+
async function Gi(e = "") {
|
|
1060
1061
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1061
1062
|
`${b}/admin/agents/identity-envs${t}`,
|
|
1062
1063
|
g
|
|
1063
1064
|
);
|
|
1064
1065
|
return y(n, "获取身份绑定环境列表失败");
|
|
1065
1066
|
}
|
|
1066
|
-
async function
|
|
1067
|
+
async function Ji(e, t = "") {
|
|
1067
1068
|
const n = new URLSearchParams();
|
|
1068
1069
|
e && n.set("envCode", e), t && n.set("token", t);
|
|
1069
1070
|
const r = n.toString() ? `?${n.toString()}` : "", s = await S(
|
|
@@ -1072,7 +1073,7 @@ async function Ki(e, t = "") {
|
|
|
1072
1073
|
);
|
|
1073
1074
|
return y(s, "获取成员列表失败") ?? [];
|
|
1074
1075
|
}
|
|
1075
|
-
async function
|
|
1076
|
+
async function Wi(e, t, n = "") {
|
|
1076
1077
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(`${b}/admin/agents/${e}/move${r}`, {
|
|
1077
1078
|
...g,
|
|
1078
1079
|
method: "POST",
|
|
@@ -1081,7 +1082,7 @@ async function Gi(e, t, n = "") {
|
|
|
1081
1082
|
});
|
|
1082
1083
|
return y(s, "移动 Agent 分类失败");
|
|
1083
1084
|
}
|
|
1084
|
-
async function
|
|
1085
|
+
async function Vi(e = "") {
|
|
1085
1086
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/admin/agents/models${t}`, g);
|
|
1086
1087
|
return y(n, "获取模型列表失败");
|
|
1087
1088
|
}
|
|
@@ -1089,7 +1090,7 @@ function cn(e) {
|
|
|
1089
1090
|
const t = Object.entries(e).filter(([, n]) => n !== void 0 && n !== "").map(([n, r]) => `${n}=${encodeURIComponent(r)}`);
|
|
1090
1091
|
return t.length ? `?${t.join("&")}` : "";
|
|
1091
1092
|
}
|
|
1092
|
-
async function
|
|
1093
|
+
async function Zi(e, t = "") {
|
|
1093
1094
|
const n = await S(
|
|
1094
1095
|
`${b}/admin/agents/${encodeURIComponent(
|
|
1095
1096
|
e
|
|
@@ -1104,7 +1105,7 @@ async function Vi(e, t = "") {
|
|
|
1104
1105
|
nodeInfo: { ...s.nodeInfo, dataPrepareEnabled: !1 }
|
|
1105
1106
|
}));
|
|
1106
1107
|
}
|
|
1107
|
-
async function
|
|
1108
|
+
async function Yi(e, t = "") {
|
|
1108
1109
|
const n = await S(
|
|
1109
1110
|
`${b}/admin/agents/ontology/ontologies${cn({
|
|
1110
1111
|
ontologyType: e,
|
|
@@ -1114,7 +1115,7 @@ async function Wi(e, t = "") {
|
|
|
1114
1115
|
);
|
|
1115
1116
|
return y(n, "获取本体列表失败") ?? [];
|
|
1116
1117
|
}
|
|
1117
|
-
async function
|
|
1118
|
+
async function Xi(e, t = "") {
|
|
1118
1119
|
const n = await S(
|
|
1119
1120
|
`${b}/admin/agents/ontology/knowledges${cn({
|
|
1120
1121
|
ontologyCode: e,
|
|
@@ -1124,7 +1125,7 @@ async function Zi(e, t = "") {
|
|
|
1124
1125
|
);
|
|
1125
1126
|
return y(n, "获取知识列表失败") ?? [];
|
|
1126
1127
|
}
|
|
1127
|
-
async function
|
|
1128
|
+
async function Qi(e = "", t = "") {
|
|
1128
1129
|
const n = new URLSearchParams();
|
|
1129
1130
|
e && n.append("keyword", e), t && n.append("token", t);
|
|
1130
1131
|
const r = n.toString() ? `?${n.toString()}` : "", s = await S(
|
|
@@ -1133,13 +1134,13 @@ async function Yi(e = "", t = "") {
|
|
|
1133
1134
|
);
|
|
1134
1135
|
return y(s, "获取员工列表失败");
|
|
1135
1136
|
}
|
|
1136
|
-
async function
|
|
1137
|
+
async function ec(e, t, n = "", r = "") {
|
|
1137
1138
|
const s = new URLSearchParams();
|
|
1138
1139
|
s.append("profileScope", e), s.append("memberType", t), n && s.append("scenarioCode", n), r && s.append("token", r);
|
|
1139
1140
|
const o = s.toString() ? `?${s.toString()}` : "", i = await S(`${b}/admin/profiles${o}`, g);
|
|
1140
1141
|
return y(i, "获取画像列表失败");
|
|
1141
1142
|
}
|
|
1142
|
-
async function
|
|
1143
|
+
async function tc(e, t = "") {
|
|
1143
1144
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(`${b}/admin/profiles${n}`, {
|
|
1144
1145
|
...g,
|
|
1145
1146
|
method: "POST",
|
|
@@ -1148,7 +1149,7 @@ async function Qi(e, t = "") {
|
|
|
1148
1149
|
});
|
|
1149
1150
|
return y(r, "保存画像失败");
|
|
1150
1151
|
}
|
|
1151
|
-
async function
|
|
1152
|
+
async function nc(e, t, n, r = "", s = "") {
|
|
1152
1153
|
const o = new URLSearchParams();
|
|
1153
1154
|
r && o.append("scenarioCode", r), s && o.append("token", s);
|
|
1154
1155
|
const i = o.toString() ? `?${o.toString()}` : "", c = await S(
|
|
@@ -1162,13 +1163,13 @@ async function ec(e, t, n, r = "", s = "") {
|
|
|
1162
1163
|
);
|
|
1163
1164
|
return y(c, "删除画像失败");
|
|
1164
1165
|
}
|
|
1165
|
-
async function
|
|
1166
|
+
async function rc(e = "", t = "") {
|
|
1166
1167
|
const n = new URLSearchParams();
|
|
1167
1168
|
e && n.append("scenarioCode", e), t && n.append("token", t);
|
|
1168
1169
|
const r = n.toString() ? `?${n.toString()}` : "", s = await S(`${b}/admin/human-on-calls${r}`, g);
|
|
1169
1170
|
return y(s, "获取值班信息失败");
|
|
1170
1171
|
}
|
|
1171
|
-
async function
|
|
1172
|
+
async function sc(e, t, n, r = "") {
|
|
1172
1173
|
const s = r ? `?token=${encodeURIComponent(r)}` : "", o = await S(`${b}/admin/human-on-calls/batch${s}`, {
|
|
1173
1174
|
...g,
|
|
1174
1175
|
method: "POST",
|
|
@@ -1177,7 +1178,7 @@ async function nc(e, t, n, r = "") {
|
|
|
1177
1178
|
});
|
|
1178
1179
|
return y(o, "保存值班信息失败");
|
|
1179
1180
|
}
|
|
1180
|
-
async function
|
|
1181
|
+
async function ac(e, t, n, r = "") {
|
|
1181
1182
|
const s = r ? `?token=${encodeURIComponent(r)}` : "", o = await S(
|
|
1182
1183
|
`${b}/admin/human-on-calls/${encodeURIComponent(
|
|
1183
1184
|
e
|
|
@@ -1186,7 +1187,7 @@ async function rc(e, t, n, r = "") {
|
|
|
1186
1187
|
);
|
|
1187
1188
|
return y(o, "删除值班信息失败");
|
|
1188
1189
|
}
|
|
1189
|
-
async function
|
|
1190
|
+
async function oc(e = {}, t = "") {
|
|
1190
1191
|
const n = [];
|
|
1191
1192
|
e.scenarioCode && n.push(`scenario_code=${encodeURIComponent(e.scenarioCode)}`), e.status && n.push(`status=${encodeURIComponent(e.status)}`), t && n.push(`token=${encodeURIComponent(t)}`);
|
|
1192
1193
|
const r = n.length > 0 ? `?${n.join("&")}` : "", s = await S(
|
|
@@ -1198,7 +1199,7 @@ async function sc(e = {}, t = "") {
|
|
|
1198
1199
|
);
|
|
1199
1200
|
return y(s, "全量刷新技能失败");
|
|
1200
1201
|
}
|
|
1201
|
-
async function
|
|
1202
|
+
async function ic(e, t = "") {
|
|
1202
1203
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1203
1204
|
`${b}/admin/scenario-instances/${e}/refresh-skills${n}`,
|
|
1204
1205
|
{
|
|
@@ -1208,7 +1209,7 @@ async function ac(e, t = "") {
|
|
|
1208
1209
|
);
|
|
1209
1210
|
return y(r, "刷新技能失败");
|
|
1210
1211
|
}
|
|
1211
|
-
function
|
|
1212
|
+
function Sr(e) {
|
|
1212
1213
|
const t = (...r) => {
|
|
1213
1214
|
for (const s of r) {
|
|
1214
1215
|
const o = e[s];
|
|
@@ -1232,11 +1233,11 @@ function br(e) {
|
|
|
1232
1233
|
updateTime: e.update_time == null ? e.updateTime : String(e.update_time)
|
|
1233
1234
|
};
|
|
1234
1235
|
}
|
|
1235
|
-
async function
|
|
1236
|
+
async function cc(e = "") {
|
|
1236
1237
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/personal-agents${t}`, g), r = await y(n, "获取个人 Agent 列表失败");
|
|
1237
|
-
return (Array.isArray(r) ? r : []).map((s) =>
|
|
1238
|
+
return (Array.isArray(r) ? r : []).map((s) => Sr(s));
|
|
1238
1239
|
}
|
|
1239
|
-
async function
|
|
1240
|
+
async function lc(e, t, n, r, s = "") {
|
|
1240
1241
|
const o = s ? `?token=${encodeURIComponent(s)}` : "", i = await S(`${b}/personal-agents/ensure${o}`, {
|
|
1241
1242
|
...g,
|
|
1242
1243
|
method: "POST",
|
|
@@ -1248,11 +1249,11 @@ async function ic(e, t, n, r, s = "") {
|
|
|
1248
1249
|
avatar: r ?? ""
|
|
1249
1250
|
})
|
|
1250
1251
|
});
|
|
1251
|
-
return
|
|
1252
|
+
return Sr(
|
|
1252
1253
|
await y(i, "创建个人 Agent 失败")
|
|
1253
1254
|
);
|
|
1254
1255
|
}
|
|
1255
|
-
async function
|
|
1256
|
+
async function dc(e, t = "") {
|
|
1256
1257
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1257
1258
|
`${b}/personal-agents/${e}/sessions${n}`,
|
|
1258
1259
|
g
|
|
@@ -1266,7 +1267,7 @@ async function cc(e, t = "") {
|
|
|
1266
1267
|
userMeta: (s == null ? void 0 : s.userMeta) ?? {}
|
|
1267
1268
|
};
|
|
1268
1269
|
}
|
|
1269
|
-
async function
|
|
1270
|
+
async function uc(e, t = "新会话", n = "", r) {
|
|
1270
1271
|
const s = n ? `?token=${encodeURIComponent(n)}` : "", o = await S(
|
|
1271
1272
|
`${b}/personal-agents/${e}/sessions${s}`,
|
|
1272
1273
|
{
|
|
@@ -1306,7 +1307,7 @@ function st(e) {
|
|
|
1306
1307
|
updateTime: i || void 0
|
|
1307
1308
|
};
|
|
1308
1309
|
}
|
|
1309
|
-
async function
|
|
1310
|
+
async function pc(e, t = "") {
|
|
1310
1311
|
const n = t ? `&token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1311
1312
|
`${b}/personal-agents/sessions/search?keyword=${encodeURIComponent(
|
|
1312
1313
|
e
|
|
@@ -1322,14 +1323,14 @@ async function dc(e, t = "") {
|
|
|
1322
1323
|
};
|
|
1323
1324
|
});
|
|
1324
1325
|
}
|
|
1325
|
-
async function
|
|
1326
|
+
async function mc(e = "") {
|
|
1326
1327
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1327
1328
|
`${b}/personal-agents/sessions/all${t}`,
|
|
1328
1329
|
g
|
|
1329
1330
|
), r = await y(n, "获取聊天记录失败");
|
|
1330
1331
|
return (Array.isArray(r) ? r : []).map(st);
|
|
1331
1332
|
}
|
|
1332
|
-
async function
|
|
1333
|
+
async function hc(e, t, n = "", r) {
|
|
1333
1334
|
const s = n ? `?token=${encodeURIComponent(n)}` : "", o = await S(
|
|
1334
1335
|
`${b}/personal-agents/${e}/sessions/${t}${s}`,
|
|
1335
1336
|
{
|
|
@@ -1345,25 +1346,25 @@ async function pc(e, t, n = "", r) {
|
|
|
1345
1346
|
await y(o, "会话归组失败")
|
|
1346
1347
|
);
|
|
1347
1348
|
}
|
|
1348
|
-
async function
|
|
1349
|
+
async function fc(e) {
|
|
1349
1350
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/personal-agents/models${t}`, g);
|
|
1350
1351
|
return y(n, "获取模型列表失败");
|
|
1351
1352
|
}
|
|
1352
|
-
async function
|
|
1353
|
+
async function yc(e) {
|
|
1353
1354
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1354
1355
|
`${b}/personal-agents/custom-models${t}`,
|
|
1355
1356
|
g
|
|
1356
1357
|
);
|
|
1357
1358
|
return y(n, "获取自定义模型失败");
|
|
1358
1359
|
}
|
|
1359
|
-
async function
|
|
1360
|
+
async function gc(e, t, n = "") {
|
|
1360
1361
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1361
1362
|
`${b}/personal-agents/${e}/sessions/${t}${r}`,
|
|
1362
1363
|
{ ...g, method: "DELETE" }
|
|
1363
1364
|
);
|
|
1364
1365
|
return y(s, "删除会话失败");
|
|
1365
1366
|
}
|
|
1366
|
-
async function
|
|
1367
|
+
async function bc(e, t, n, r = "") {
|
|
1367
1368
|
const s = r ? `?token=${encodeURIComponent(r)}` : "", o = await S(
|
|
1368
1369
|
`${b}/personal-agents/${e}/sessions/${t}${s}`,
|
|
1369
1370
|
{
|
|
@@ -1375,14 +1376,14 @@ async function yc(e, t, n, r = "") {
|
|
|
1375
1376
|
);
|
|
1376
1377
|
return y(o, "重命名会话失败");
|
|
1377
1378
|
}
|
|
1378
|
-
async function
|
|
1379
|
+
async function Sc(e, t, n = "") {
|
|
1379
1380
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1380
1381
|
`${b}/personal-agents/${e}/sessions/${t}/messages${r}`,
|
|
1381
1382
|
g
|
|
1382
1383
|
);
|
|
1383
1384
|
return y(s, "获取消息历史失败");
|
|
1384
1385
|
}
|
|
1385
|
-
async function
|
|
1386
|
+
async function _c(e, t, n, r, s, o, i, c, l, d, u) {
|
|
1386
1387
|
const m = r ? `?token=${encodeURIComponent(r)}` : "", h = `${b}/personal-agents/${e}/sessions/${t}/chat/stream${m}`;
|
|
1387
1388
|
try {
|
|
1388
1389
|
const I = await fetch(h, {
|
|
@@ -1445,13 +1446,13 @@ async function bc(e, t, n, r, s, o, i, c, l, d, u) {
|
|
|
1445
1446
|
o(I instanceof Error ? I : new Error(String(I)));
|
|
1446
1447
|
}
|
|
1447
1448
|
}
|
|
1448
|
-
const
|
|
1449
|
-
async function
|
|
1450
|
-
await fetch(`${
|
|
1449
|
+
const wa = "http://127.0.0.1:28080";
|
|
1450
|
+
async function wc(e) {
|
|
1451
|
+
await fetch(`${wa}/v1/sessions/${e}`, {
|
|
1451
1452
|
method: "DELETE"
|
|
1452
1453
|
});
|
|
1453
1454
|
}
|
|
1454
|
-
async function
|
|
1455
|
+
async function Tc(e = {}) {
|
|
1455
1456
|
const t = new URLSearchParams(), { name: n, scenarioInstanceId: r, page: s = 1, size: o = 50, token: i = "" } = e;
|
|
1456
1457
|
n && t.set("name", n), r != null && r !== "" && t.set("scenarioInstanceId", String(r)), t.set("page", String(s)), t.set("size", String(o)), i && t.set("token", i);
|
|
1457
1458
|
const c = t.toString(), l = await S(
|
|
@@ -1460,7 +1461,7 @@ async function _c(e = {}) {
|
|
|
1460
1461
|
);
|
|
1461
1462
|
return y(l, "获取任务列表失败");
|
|
1462
1463
|
}
|
|
1463
|
-
function
|
|
1464
|
+
function Ta(e) {
|
|
1464
1465
|
const t = new URLSearchParams();
|
|
1465
1466
|
Object.entries(e).forEach(([r, s]) => {
|
|
1466
1467
|
s != null && s !== "" && t.append(r, String(s));
|
|
@@ -1468,14 +1469,14 @@ function _a(e) {
|
|
|
1468
1469
|
const n = t.toString();
|
|
1469
1470
|
return n ? `?${n}` : "";
|
|
1470
1471
|
}
|
|
1471
|
-
async function
|
|
1472
|
+
async function kc(e) {
|
|
1472
1473
|
const t = await S(
|
|
1473
|
-
`${b}/admin/tool-call-logs/timeline${
|
|
1474
|
+
`${b}/admin/tool-call-logs/timeline${Ta(e)}`,
|
|
1474
1475
|
g
|
|
1475
1476
|
);
|
|
1476
1477
|
return y(t, "查询工具调用时间轴统计失败");
|
|
1477
1478
|
}
|
|
1478
|
-
async function
|
|
1479
|
+
async function Cc(e) {
|
|
1479
1480
|
const t = [];
|
|
1480
1481
|
e.date && t.push(`date=${encodeURIComponent(e.date)}`), e.scenarioCode && t.push(`scenarioCode=${encodeURIComponent(e.scenarioCode)}`), e.token && t.push(`token=${encodeURIComponent(e.token)}`);
|
|
1481
1482
|
const n = t.length > 0 ? `?${t.join("&")}` : "", r = await S(
|
|
@@ -1484,14 +1485,14 @@ async function Tc(e) {
|
|
|
1484
1485
|
);
|
|
1485
1486
|
return y(r, "获取 Token 单日统计失败");
|
|
1486
1487
|
}
|
|
1487
|
-
async function
|
|
1488
|
+
async function Ic(e = "z-team") {
|
|
1488
1489
|
const t = await S(
|
|
1489
1490
|
`${b}/change-log/versions?repo=${encodeURIComponent(e)}`,
|
|
1490
1491
|
g
|
|
1491
1492
|
);
|
|
1492
1493
|
return y(t, "获取变更日志版本列表失败");
|
|
1493
1494
|
}
|
|
1494
|
-
async function
|
|
1495
|
+
async function $c(e, t, n = "z-team") {
|
|
1495
1496
|
const r = new URLSearchParams();
|
|
1496
1497
|
e != null && r.set("versionId", String(e)), r.set("repo", n);
|
|
1497
1498
|
const s = await S(
|
|
@@ -1508,7 +1509,7 @@ function ae(e) {
|
|
|
1508
1509
|
const n = t.toString();
|
|
1509
1510
|
return n ? `?${n}` : "";
|
|
1510
1511
|
}
|
|
1511
|
-
async function
|
|
1512
|
+
async function Ac(e) {
|
|
1512
1513
|
const t = await S(
|
|
1513
1514
|
`${b}/admin/qa-eval/closed-instances${ae({
|
|
1514
1515
|
close_date: e.closeDate,
|
|
@@ -1524,7 +1525,7 @@ async function Ic(e) {
|
|
|
1524
1525
|
);
|
|
1525
1526
|
return Array.isArray(n == null ? void 0 : n.list) ? n.list : [];
|
|
1526
1527
|
}
|
|
1527
|
-
async function
|
|
1528
|
+
async function vc(e) {
|
|
1528
1529
|
const t = await S(
|
|
1529
1530
|
`${b}/admin/qa-eval/overview${ae({
|
|
1530
1531
|
close_date: e.closeDate,
|
|
@@ -1537,7 +1538,7 @@ async function $c(e) {
|
|
|
1537
1538
|
);
|
|
1538
1539
|
return y(t, "获取 QA 评测总览失败");
|
|
1539
1540
|
}
|
|
1540
|
-
async function
|
|
1541
|
+
async function xc(e, t = "") {
|
|
1541
1542
|
const n = await S(
|
|
1542
1543
|
`${b}/admin/qa-eval/report/${e}/cancel${ae({
|
|
1543
1544
|
token: t
|
|
@@ -1546,7 +1547,7 @@ async function Ac(e, t = "") {
|
|
|
1546
1547
|
);
|
|
1547
1548
|
return y(n, "取消评测失败");
|
|
1548
1549
|
}
|
|
1549
|
-
async function
|
|
1550
|
+
async function Pc(e, t, n = "") {
|
|
1550
1551
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1551
1552
|
`${b}/admin/scenario-templates/preview${r}`,
|
|
1552
1553
|
{
|
|
@@ -1559,14 +1560,14 @@ async function vc(e, t, n = "") {
|
|
|
1559
1560
|
if (!s.ok) throw new Error(`HTTP ${s.status}`);
|
|
1560
1561
|
return s.text();
|
|
1561
1562
|
}
|
|
1562
|
-
async function
|
|
1563
|
+
async function Ec(e, t = "") {
|
|
1563
1564
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1564
1565
|
`${b}/tasks/${e}/human-assist${n}`,
|
|
1565
1566
|
{ ...g, method: "GET" }
|
|
1566
1567
|
);
|
|
1567
1568
|
return y(r, "查询人机协助卡片失败");
|
|
1568
1569
|
}
|
|
1569
|
-
async function
|
|
1570
|
+
async function Rc(e, t, n, r = "") {
|
|
1570
1571
|
const s = r ? `?token=${encodeURIComponent(r)}` : "", o = await S(
|
|
1571
1572
|
`${b}/scenario-instances/${e}/card-forms/${t}/submit${s}`,
|
|
1572
1573
|
{
|
|
@@ -1578,7 +1579,7 @@ async function Pc(e, t, n, r = "") {
|
|
|
1578
1579
|
);
|
|
1579
1580
|
return y(o, "提交卡片表单失败");
|
|
1580
1581
|
}
|
|
1581
|
-
async function
|
|
1582
|
+
async function Oc(e, t, n = "") {
|
|
1582
1583
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1583
1584
|
`${b}/tasks/${e}/submit-assist${r}`,
|
|
1584
1585
|
{
|
|
@@ -1590,17 +1591,17 @@ async function Ec(e, t, n = "") {
|
|
|
1590
1591
|
);
|
|
1591
1592
|
return y(s, "提交人机协助任务失败");
|
|
1592
1593
|
}
|
|
1593
|
-
function
|
|
1594
|
+
function Mc(e) {
|
|
1594
1595
|
return webIdeFetch(`/instances/${e}`, { method: "DELETE" });
|
|
1595
1596
|
}
|
|
1596
|
-
async function
|
|
1597
|
+
async function Nc(e = "") {
|
|
1597
1598
|
const t = await S(
|
|
1598
1599
|
`${b}/admin/runtime-monitor/schedule${ae({ token: e })}`,
|
|
1599
1600
|
g
|
|
1600
1601
|
);
|
|
1601
1602
|
return y(t, "查询定时任务概览失败");
|
|
1602
1603
|
}
|
|
1603
|
-
async function
|
|
1604
|
+
async function jc(e) {
|
|
1604
1605
|
const t = new URLSearchParams();
|
|
1605
1606
|
t.set("scenarioCode", e.scenarioCode), e.startDate && t.set("startDate", e.startDate), e.endDate && t.set("endDate", e.endDate), e.creatorId && t.set("creatorId", e.creatorId), e.tagFilters && Object.keys(e.tagFilters).length > 0 && t.set("tagFilters", JSON.stringify(e.tagFilters)), e.groupBy && t.set("groupBy", e.groupBy), e.token && t.set("token", e.token);
|
|
1606
1607
|
const n = await S(
|
|
@@ -1617,7 +1618,7 @@ async function Mc(e) {
|
|
|
1617
1618
|
activeCreators: (r == null ? void 0 : r.activeCreators) ?? void 0
|
|
1618
1619
|
};
|
|
1619
1620
|
}
|
|
1620
|
-
async function
|
|
1621
|
+
async function Uc(e, t = "") {
|
|
1621
1622
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1622
1623
|
`${b}/admin/scenario-tags/values/${e}${n}`,
|
|
1623
1624
|
{
|
|
@@ -1627,14 +1628,14 @@ async function Nc(e, t = "") {
|
|
|
1627
1628
|
);
|
|
1628
1629
|
return y(r, "删除标签值失败");
|
|
1629
1630
|
}
|
|
1630
|
-
async function
|
|
1631
|
+
async function zc(e = "") {
|
|
1631
1632
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1632
1633
|
`${b}/admin/statistics/current-dept${t}`,
|
|
1633
1634
|
g
|
|
1634
1635
|
);
|
|
1635
1636
|
return y(n, "获取当前用户部门信息失败");
|
|
1636
1637
|
}
|
|
1637
|
-
function
|
|
1638
|
+
function ka(e) {
|
|
1638
1639
|
const t = new URLSearchParams();
|
|
1639
1640
|
Object.entries(e).forEach(([r, s]) => {
|
|
1640
1641
|
s != null && s !== "" && t.append(r, String(s));
|
|
@@ -1642,9 +1643,9 @@ function wa(e) {
|
|
|
1642
1643
|
const n = t.toString();
|
|
1643
1644
|
return n ? `?${n}` : "";
|
|
1644
1645
|
}
|
|
1645
|
-
async function
|
|
1646
|
+
async function Lc(e) {
|
|
1646
1647
|
const t = await S(
|
|
1647
|
-
`${b}/admin/evaluation/instances/${e.id}/snapshot-preview${
|
|
1648
|
+
`${b}/admin/evaluation/instances/${e.id}/snapshot-preview${ka({
|
|
1648
1649
|
section: e.section,
|
|
1649
1650
|
page: e.page,
|
|
1650
1651
|
size: e.size,
|
|
@@ -1655,10 +1656,10 @@ async function Uc(e) {
|
|
|
1655
1656
|
);
|
|
1656
1657
|
return y(t, "获取快照预览失败");
|
|
1657
1658
|
}
|
|
1658
|
-
const
|
|
1659
|
-
async function
|
|
1659
|
+
const Ca = typeof window < "u" && window.ZTEAM_WEBIDE_ADMIN_BASE || "http://localhost/kapi/webide/admin";
|
|
1660
|
+
async function Ia(e, t) {
|
|
1660
1661
|
try {
|
|
1661
|
-
const n = await fetch(`${
|
|
1662
|
+
const n = await fetch(`${Ca}${e}`, {
|
|
1662
1663
|
credentials: "include",
|
|
1663
1664
|
headers: {
|
|
1664
1665
|
Accept: "application/json",
|
|
@@ -1671,11 +1672,11 @@ async function ka(e, t) {
|
|
|
1671
1672
|
return {};
|
|
1672
1673
|
}
|
|
1673
1674
|
}
|
|
1674
|
-
function
|
|
1675
|
-
return
|
|
1675
|
+
function Dc(e) {
|
|
1676
|
+
return Ia(`/presets/${e}`, { method: "DELETE" });
|
|
1676
1677
|
}
|
|
1677
|
-
const
|
|
1678
|
-
async function
|
|
1678
|
+
const Fc = yr;
|
|
1679
|
+
async function qc(e) {
|
|
1679
1680
|
const t = new FormData();
|
|
1680
1681
|
t.append("file", e);
|
|
1681
1682
|
const n = await S(`${b}/common/upload-video`, {
|
|
@@ -1688,11 +1689,11 @@ async function Dc(e) {
|
|
|
1688
1689
|
}
|
|
1689
1690
|
return s;
|
|
1690
1691
|
}
|
|
1691
|
-
function
|
|
1692
|
+
function Bc() {
|
|
1692
1693
|
const e = "登录已失效,请重新登录";
|
|
1693
1694
|
throw we(e), { _apiUserError: !0, userMessage: e, message: e };
|
|
1694
1695
|
}
|
|
1695
|
-
async function
|
|
1696
|
+
async function Hc(e) {
|
|
1696
1697
|
const t = await S(
|
|
1697
1698
|
`${b}/scenario-instances/${e}/interaction-mode`,
|
|
1698
1699
|
{ ...g }
|
|
@@ -1702,7 +1703,7 @@ async function qc(e) {
|
|
|
1702
1703
|
);
|
|
1703
1704
|
return (n == null ? void 0 : n.mode) ?? "dispatch";
|
|
1704
1705
|
}
|
|
1705
|
-
async function
|
|
1706
|
+
async function Kc(e, t) {
|
|
1706
1707
|
const n = await S(
|
|
1707
1708
|
`${b}/scenario-instances/${e}/interaction-mode`,
|
|
1708
1709
|
{
|
|
@@ -1717,21 +1718,21 @@ async function Bc(e, t) {
|
|
|
1717
1718
|
);
|
|
1718
1719
|
return (r == null ? void 0 : r.mode) ?? t;
|
|
1719
1720
|
}
|
|
1720
|
-
async function
|
|
1721
|
+
async function Gc(e = "") {
|
|
1721
1722
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1722
1723
|
`${b}/admin/indexer/overview${t}`,
|
|
1723
1724
|
Ie()
|
|
1724
1725
|
);
|
|
1725
1726
|
return y(n, "获取索引概览失败");
|
|
1726
1727
|
}
|
|
1727
|
-
async function
|
|
1728
|
+
async function Jc(e = "") {
|
|
1728
1729
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/admin/indexer/repos${t}`, Ie()), r = await y(
|
|
1729
1730
|
n,
|
|
1730
1731
|
"获取索引仓库列表失败"
|
|
1731
1732
|
);
|
|
1732
1733
|
return Array.isArray(r == null ? void 0 : r.repos) ? r.repos : [];
|
|
1733
1734
|
}
|
|
1734
|
-
async function
|
|
1735
|
+
async function Wc(e, t = "") {
|
|
1735
1736
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(`${b}/admin/indexer/repos${n}`, Ie({
|
|
1736
1737
|
method: "POST",
|
|
1737
1738
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1739,14 +1740,14 @@ async function Gc(e, t = "") {
|
|
|
1739
1740
|
}));
|
|
1740
1741
|
return y(r, "保存索引仓库失败");
|
|
1741
1742
|
}
|
|
1742
|
-
async function
|
|
1743
|
+
async function Vc(e, t = "") {
|
|
1743
1744
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1744
1745
|
`${b}/admin/indexer/repos/${encodeURIComponent(e)}${n}`,
|
|
1745
1746
|
Ie({ method: "DELETE" })
|
|
1746
1747
|
);
|
|
1747
1748
|
return y(r, "删除索引仓库失败");
|
|
1748
1749
|
}
|
|
1749
|
-
async function
|
|
1750
|
+
async function Zc(e, t, n = "") {
|
|
1750
1751
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(
|
|
1751
1752
|
`${b}/admin/indexer/repos/${encodeURIComponent(
|
|
1752
1753
|
e
|
|
@@ -1759,7 +1760,7 @@ async function Vc(e, t, n = "") {
|
|
|
1759
1760
|
);
|
|
1760
1761
|
return y(s, "切换仓库启停失败");
|
|
1761
1762
|
}
|
|
1762
|
-
async function
|
|
1763
|
+
async function Yc(e, t = "") {
|
|
1763
1764
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1764
1765
|
`${b}/admin/indexer/repos/${encodeURIComponent(
|
|
1765
1766
|
e
|
|
@@ -1768,13 +1769,13 @@ async function Wc(e, t = "") {
|
|
|
1768
1769
|
);
|
|
1769
1770
|
return y(r, "触发重建失败");
|
|
1770
1771
|
}
|
|
1771
|
-
async function
|
|
1772
|
+
async function Xc(e = "") {
|
|
1772
1773
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/admin/indexer/poll${t}`, Ie({
|
|
1773
1774
|
method: "POST"
|
|
1774
1775
|
}));
|
|
1775
1776
|
return y(n, "触发轮询失败");
|
|
1776
1777
|
}
|
|
1777
|
-
async function
|
|
1778
|
+
async function Qc(e = "") {
|
|
1778
1779
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(
|
|
1779
1780
|
`${b}/admin/notify-channel/list${t}`,
|
|
1780
1781
|
g
|
|
@@ -1784,7 +1785,7 @@ async function Yc(e = "") {
|
|
|
1784
1785
|
);
|
|
1785
1786
|
return Array.isArray(r == null ? void 0 : r.channels) ? r.channels : [];
|
|
1786
1787
|
}
|
|
1787
|
-
async function
|
|
1788
|
+
async function el(e, t = "") {
|
|
1788
1789
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(`${b}/admin/notify-channel/test${n}`, {
|
|
1789
1790
|
...g,
|
|
1790
1791
|
method: "POST",
|
|
@@ -1793,7 +1794,7 @@ async function Xc(e, t = "") {
|
|
|
1793
1794
|
});
|
|
1794
1795
|
return y(r, "测试发送失败");
|
|
1795
1796
|
}
|
|
1796
|
-
async function
|
|
1797
|
+
async function tl(e, t = "") {
|
|
1797
1798
|
const n = await S(
|
|
1798
1799
|
`${b}/admin/schedule-task${ae({
|
|
1799
1800
|
token: t,
|
|
@@ -1805,7 +1806,7 @@ async function Qc(e, t = "") {
|
|
|
1805
1806
|
);
|
|
1806
1807
|
return y(n, "查询定时任务模版失败");
|
|
1807
1808
|
}
|
|
1808
|
-
async function
|
|
1809
|
+
async function nl(e, t = "") {
|
|
1809
1810
|
const n = await S(
|
|
1810
1811
|
`${b}/admin/schedule-task${ae({ token: t })}`,
|
|
1811
1812
|
{
|
|
@@ -1817,7 +1818,7 @@ async function el(e, t = "") {
|
|
|
1817
1818
|
);
|
|
1818
1819
|
return y(n, "新建定时任务模版失败");
|
|
1819
1820
|
}
|
|
1820
|
-
async function
|
|
1821
|
+
async function rl(e, t, n = "") {
|
|
1821
1822
|
const r = await S(
|
|
1822
1823
|
`${b}/admin/schedule-task/${encodeURIComponent(
|
|
1823
1824
|
e
|
|
@@ -1831,7 +1832,7 @@ async function tl(e, t, n = "") {
|
|
|
1831
1832
|
);
|
|
1832
1833
|
return y(r, "更新定时任务模版失败");
|
|
1833
1834
|
}
|
|
1834
|
-
async function
|
|
1835
|
+
async function sl(e, t, n = "") {
|
|
1835
1836
|
const r = await S(
|
|
1836
1837
|
`${b}/admin/schedule-task/${encodeURIComponent(
|
|
1837
1838
|
e
|
|
@@ -1845,7 +1846,7 @@ async function nl(e, t, n = "") {
|
|
|
1845
1846
|
);
|
|
1846
1847
|
return y(r, "切换模版状态失败");
|
|
1847
1848
|
}
|
|
1848
|
-
async function
|
|
1849
|
+
async function al(e, t = "") {
|
|
1849
1850
|
const n = await S(
|
|
1850
1851
|
`${b}/admin/schedule-task/${encodeURIComponent(
|
|
1851
1852
|
e
|
|
@@ -1854,7 +1855,7 @@ async function rl(e, t = "") {
|
|
|
1854
1855
|
);
|
|
1855
1856
|
return y(n, "激活模版失败");
|
|
1856
1857
|
}
|
|
1857
|
-
async function
|
|
1858
|
+
async function ol(e, t = "") {
|
|
1858
1859
|
const n = await S(
|
|
1859
1860
|
`${b}/admin/schedule-task/${encodeURIComponent(
|
|
1860
1861
|
e
|
|
@@ -1863,7 +1864,7 @@ async function sl(e, t = "") {
|
|
|
1863
1864
|
);
|
|
1864
1865
|
return y(n, "删除模版失败");
|
|
1865
1866
|
}
|
|
1866
|
-
async function
|
|
1867
|
+
async function il(e, t = "") {
|
|
1867
1868
|
const n = await S(
|
|
1868
1869
|
`${b}/admin/schedule-task/${encodeURIComponent(
|
|
1869
1870
|
e
|
|
@@ -1872,7 +1873,7 @@ async function al(e, t = "") {
|
|
|
1872
1873
|
);
|
|
1873
1874
|
return y(n, "手动执行失败");
|
|
1874
1875
|
}
|
|
1875
|
-
async function
|
|
1876
|
+
async function cl(e, t = "") {
|
|
1876
1877
|
const n = await S(
|
|
1877
1878
|
`${b}/admin/schedule-task/history-all${ae({
|
|
1878
1879
|
token: t,
|
|
@@ -1884,7 +1885,7 @@ async function ol(e, t = "") {
|
|
|
1884
1885
|
);
|
|
1885
1886
|
return y(n, "查询运行记录失败");
|
|
1886
1887
|
}
|
|
1887
|
-
async function
|
|
1888
|
+
async function ll(e, t, n, r, s = "") {
|
|
1888
1889
|
const o = s ? `?token=${encodeURIComponent(s)}` : "", i = await S(
|
|
1889
1890
|
`${b}/admin/permissions/users/${e}/roles${o}`,
|
|
1890
1891
|
{
|
|
@@ -1896,25 +1897,25 @@ async function il(e, t, n, r, s = "") {
|
|
|
1896
1897
|
);
|
|
1897
1898
|
return y(i, "更新用户角色失败");
|
|
1898
1899
|
}
|
|
1899
|
-
async function
|
|
1900
|
+
async function dl(e, t = "") {
|
|
1900
1901
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1901
1902
|
`${b}/admin/permissions/users/${e}/detail${n}`,
|
|
1902
1903
|
g
|
|
1903
1904
|
);
|
|
1904
1905
|
return y(r, "获取用户授权详情失败");
|
|
1905
1906
|
}
|
|
1906
|
-
async function
|
|
1907
|
+
async function ul(e = "") {
|
|
1907
1908
|
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await S(`${b}/admin/roles${t}`, g);
|
|
1908
1909
|
return y(n, "获取角色列表失败") ?? [];
|
|
1909
1910
|
}
|
|
1910
|
-
async function
|
|
1911
|
+
async function pl(e, t = "") {
|
|
1911
1912
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(
|
|
1912
1913
|
`${b}/admin/roles/${e}${n}`,
|
|
1913
1914
|
g
|
|
1914
1915
|
);
|
|
1915
1916
|
return y(r, "获取角色详情失败");
|
|
1916
1917
|
}
|
|
1917
|
-
async function
|
|
1918
|
+
async function ml(e, t = "") {
|
|
1918
1919
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(`${b}/admin/roles${n}`, {
|
|
1919
1920
|
...g,
|
|
1920
1921
|
method: "POST",
|
|
@@ -1923,7 +1924,7 @@ async function ul(e, t = "") {
|
|
|
1923
1924
|
});
|
|
1924
1925
|
return y(r, "创建角色失败");
|
|
1925
1926
|
}
|
|
1926
|
-
async function
|
|
1927
|
+
async function hl(e, t, n = "") {
|
|
1927
1928
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(`${b}/admin/roles/${e}${r}`, {
|
|
1928
1929
|
...g,
|
|
1929
1930
|
method: "PUT",
|
|
@@ -1932,14 +1933,14 @@ async function pl(e, t, n = "") {
|
|
|
1932
1933
|
});
|
|
1933
1934
|
return y(s, "更新角色失败");
|
|
1934
1935
|
}
|
|
1935
|
-
async function
|
|
1936
|
+
async function fl(e, t = "") {
|
|
1936
1937
|
const n = t ? `?token=${encodeURIComponent(t)}` : "", r = await S(`${b}/admin/roles/${e}${n}`, {
|
|
1937
1938
|
...g,
|
|
1938
1939
|
method: "DELETE"
|
|
1939
1940
|
});
|
|
1940
1941
|
return y(r, "删除角色失败");
|
|
1941
1942
|
}
|
|
1942
|
-
async function
|
|
1943
|
+
async function yl(e, t, n = "") {
|
|
1943
1944
|
const r = n ? `?token=${encodeURIComponent(n)}` : "", s = await S(`${b}/admin/roles/${e}/users${r}`, {
|
|
1944
1945
|
...g,
|
|
1945
1946
|
method: "PUT",
|
|
@@ -1975,36 +1976,36 @@ function Et(e, t) {
|
|
|
1975
1976
|
return o === r || o.startsWith(`${r}(`);
|
|
1976
1977
|
});
|
|
1977
1978
|
}
|
|
1978
|
-
function
|
|
1979
|
+
function _r(e) {
|
|
1979
1980
|
return !!(e != null && e.is_global_admin);
|
|
1980
1981
|
}
|
|
1981
|
-
function
|
|
1982
|
-
return
|
|
1982
|
+
function gl(e) {
|
|
1983
|
+
return _r(e);
|
|
1983
1984
|
}
|
|
1984
|
-
function
|
|
1985
|
+
function $a(e) {
|
|
1985
1986
|
var n;
|
|
1986
|
-
return ((n = e == null ? void 0 : e.scenario_code) == null ? void 0 : n.trim().toLowerCase()) ===
|
|
1987
|
+
return ((n = e == null ? void 0 : e.scenario_code) == null ? void 0 : n.trim().toLowerCase()) === zs;
|
|
1987
1988
|
}
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
1989
|
+
function wr(e, t) {
|
|
1990
|
+
return $a(e) && !_r(t);
|
|
1990
1991
|
}
|
|
1991
|
-
function
|
|
1992
|
-
return
|
|
1992
|
+
function An(e, t, n) {
|
|
1993
|
+
return wr(e, t) || (n ?? (e == null ? void 0 : e.mode) ?? "build").trim().toLowerCase() === "plan" ? "plan" : "build";
|
|
1993
1994
|
}
|
|
1994
1995
|
function $t(e, t) {
|
|
1995
1996
|
if (e == null || t == null) return !1;
|
|
1996
1997
|
const n = Number(e), r = Number(t);
|
|
1997
1998
|
return !Number.isNaN(n) && !Number.isNaN(r) && n > 0 && n === r;
|
|
1998
1999
|
}
|
|
1999
|
-
function
|
|
2000
|
+
function Tr(e) {
|
|
2000
2001
|
return String(e.sender_type || "HUMAN").toUpperCase() === "HUMAN";
|
|
2001
2002
|
}
|
|
2002
|
-
function
|
|
2003
|
+
function Aa(e, t) {
|
|
2003
2004
|
var s;
|
|
2004
2005
|
const n = e.trim(), r = (s = t == null ? void 0 : t.display_name) == null ? void 0 : s.trim();
|
|
2005
2006
|
return !n || !r ? !1 : n === r || n.startsWith(`${r}(`);
|
|
2006
2007
|
}
|
|
2007
|
-
function
|
|
2008
|
+
function kr(e, t) {
|
|
2008
2009
|
const n = e.sender_id;
|
|
2009
2010
|
if (n == null)
|
|
2010
2011
|
return;
|
|
@@ -2015,23 +2016,23 @@ function Tr(e, t) {
|
|
|
2015
2016
|
(s) => s.member_type === "HUMAN" && String(s.ref_id) === String(n)
|
|
2016
2017
|
);
|
|
2017
2018
|
}
|
|
2018
|
-
function
|
|
2019
|
-
if (!
|
|
2019
|
+
function va(e, t, n, r) {
|
|
2020
|
+
if (!Tr(e))
|
|
2020
2021
|
return !1;
|
|
2021
|
-
const s =
|
|
2022
|
+
const s = kr(e, r);
|
|
2022
2023
|
return !s || t && $t(s.id, t.id) ? !1 : !ln(s, n);
|
|
2023
2024
|
}
|
|
2024
|
-
function
|
|
2025
|
+
function Cr(e, t, n, r) {
|
|
2025
2026
|
var i;
|
|
2026
|
-
if (!
|
|
2027
|
+
if (!Tr(e))
|
|
2027
2028
|
return !1;
|
|
2028
2029
|
if (e.is_own === !0 || t && e.sender_id != null && $t(e.sender_id, t.id) || n != null && n.id && e.sender_id != null && $t(e.sender_id, n.id))
|
|
2029
2030
|
return !0;
|
|
2030
|
-
const s =
|
|
2031
|
+
const s = kr(e, r);
|
|
2031
2032
|
if (s)
|
|
2032
2033
|
return ln(s, n);
|
|
2033
2034
|
const o = (i = e.sender_name) == null ? void 0 : i.trim();
|
|
2034
|
-
if (o && n &&
|
|
2035
|
+
if (o && n && Aa(o, n))
|
|
2035
2036
|
return !0;
|
|
2036
2037
|
if (o && (t != null && t.display_name)) {
|
|
2037
2038
|
const c = t.display_name.trim();
|
|
@@ -2040,10 +2041,10 @@ function kr(e, t, n, r) {
|
|
|
2040
2041
|
}
|
|
2041
2042
|
return !1;
|
|
2042
2043
|
}
|
|
2043
|
-
function
|
|
2044
|
+
function bl(e) {
|
|
2044
2045
|
return Number(e.sender_id) === 0 ? !0 : (e.content || "").trim().startsWith("【任务 #");
|
|
2045
2046
|
}
|
|
2046
|
-
function
|
|
2047
|
+
function Sl(e) {
|
|
2047
2048
|
if (!e) return "";
|
|
2048
2049
|
try {
|
|
2049
2050
|
const t = e.trim(), n = /[zZ]$|[+-]\d{2}:?\d{2}$/.test(t) ? new Date(t) : /* @__PURE__ */ new Date(`${t.replace(" ", "T")}+08:00`);
|
|
@@ -2055,7 +2056,7 @@ function gl(e) {
|
|
|
2055
2056
|
return "";
|
|
2056
2057
|
}
|
|
2057
2058
|
}
|
|
2058
|
-
function
|
|
2059
|
+
function _l(e, t) {
|
|
2059
2060
|
if (e.sender_type !== "AGENT")
|
|
2060
2061
|
return !1;
|
|
2061
2062
|
const n = e.task_id ?? null;
|
|
@@ -2066,7 +2067,7 @@ function bl(e, t) {
|
|
|
2066
2067
|
}
|
|
2067
2068
|
return !1;
|
|
2068
2069
|
}
|
|
2069
|
-
function
|
|
2070
|
+
function wl(e, t) {
|
|
2070
2071
|
const n = e.content === "处理中..." || e.content === "🔄 正在处理中...", r = e.content.includes("[[REASONING:");
|
|
2071
2072
|
if (!n && !r)
|
|
2072
2073
|
return !1;
|
|
@@ -2086,15 +2087,15 @@ function Sl(e, t) {
|
|
|
2086
2087
|
}
|
|
2087
2088
|
return !1;
|
|
2088
2089
|
}
|
|
2089
|
-
function
|
|
2090
|
+
function Tl(e) {
|
|
2090
2091
|
return typeof e.content == "string" && (e.content.includes("【卡片表单已确认】") || e.content.includes("【卡片表单已提交】"));
|
|
2091
2092
|
}
|
|
2092
2093
|
function at(e) {
|
|
2093
2094
|
return e.sender_type !== "AGENT" ? !1 : e.message_type === "TURN_SUMMARY" ? !0 : e.content.includes("**本轮小结**") || e.content.includes("[[TURN_SUMMARY_REF");
|
|
2094
2095
|
}
|
|
2095
|
-
const
|
|
2096
|
-
function
|
|
2097
|
-
const t = e.match(
|
|
2096
|
+
const Ir = /\[\[TURN_SUMMARY_REF trigger_message_id=(\d+) agent_reply_id=(\d+)(?: preview="([^"]*)")?\]\]/;
|
|
2097
|
+
function $r(e) {
|
|
2098
|
+
const t = e.match(Ir);
|
|
2098
2099
|
return t ? {
|
|
2099
2100
|
// 正则抓到的是数字串,**原样保留**。曾经写成 Number(match[1]):
|
|
2100
2101
|
// 19 位 message_id 进 float64 后末位被抹掉,再拿去和字符串 m.id 比较,
|
|
@@ -2104,25 +2105,25 @@ function Ir(e) {
|
|
|
2104
2105
|
preview: t[3] || void 0
|
|
2105
2106
|
} : null;
|
|
2106
2107
|
}
|
|
2107
|
-
function
|
|
2108
|
-
return e.replace(
|
|
2108
|
+
function xa(e) {
|
|
2109
|
+
return e.replace(Ir, "").trimEnd();
|
|
2109
2110
|
}
|
|
2110
|
-
function
|
|
2111
|
-
let t =
|
|
2111
|
+
function kl(e) {
|
|
2112
|
+
let t = xa(e);
|
|
2112
2113
|
return t = t.replace(/^\*\*本轮小结\*\*\s*/i, ""), t = t.replace(/^>\s*针对用户消息[^\n]*\n+/m, ""), t = t.replace(/^_生成中…_\s*/m, ""), t.trim();
|
|
2113
2114
|
}
|
|
2114
|
-
function
|
|
2115
|
+
function Cl(e) {
|
|
2115
2116
|
const t = /* @__PURE__ */ new Map();
|
|
2116
2117
|
for (const n of e) {
|
|
2117
2118
|
if (!at(n))
|
|
2118
2119
|
continue;
|
|
2119
|
-
const r =
|
|
2120
|
+
const r = $r(n.content);
|
|
2120
2121
|
(r == null ? void 0 : r.agentReplyId) != null && t.set(r.agentReplyId, n);
|
|
2121
2122
|
}
|
|
2122
2123
|
return t;
|
|
2123
2124
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const n =
|
|
2125
|
+
function Il(e, t) {
|
|
2126
|
+
const n = $r(e.content);
|
|
2126
2127
|
if (n != null && n.preview)
|
|
2127
2128
|
return n.preview;
|
|
2128
2129
|
if ((n == null ? void 0 : n.triggerMessageId) != null) {
|
|
@@ -2134,8 +2135,8 @@ function kl(e, t) {
|
|
|
2134
2135
|
}
|
|
2135
2136
|
return "";
|
|
2136
2137
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return e.sender_type !== "AGENT" || at(e) || e.content === "已取消" ? !1 : e.content === "处理中..." || e.content === "🔄 正在处理中..." ||
|
|
2138
|
+
function Pa(e) {
|
|
2139
|
+
return e.sender_type !== "AGENT" || at(e) || e.content === "已取消" ? !1 : e.content === "处理中..." || e.content === "🔄 正在处理中..." || Wt(e.content) || e.content.includes("[[REASONING:") || e.content.includes("[[TOOL_CALL:");
|
|
2139
2140
|
}
|
|
2140
2141
|
function Rt(e, t, n, r, s, o) {
|
|
2141
2142
|
if (_e(o))
|
|
@@ -2152,11 +2153,11 @@ function Rt(e, t, n, r, s, o) {
|
|
|
2152
2153
|
continue;
|
|
2153
2154
|
if (!(e && d.sender_name !== e || Object.values(n).some(
|
|
2154
2155
|
(m) => m.loadingMessageId === d.id
|
|
2155
|
-
)) && (
|
|
2156
|
+
)) && (Pa(d) || d.content === "处理中..." || d.content === "🔄 正在处理中..."))
|
|
2156
2157
|
return d.id;
|
|
2157
2158
|
}
|
|
2158
2159
|
}
|
|
2159
|
-
function
|
|
2160
|
+
function Ea(e, t) {
|
|
2160
2161
|
if (e.sender_type !== "AGENT" || at(e) || e.content === "已取消")
|
|
2161
2162
|
return null;
|
|
2162
2163
|
for (const [n, r] of Object.entries(t))
|
|
@@ -2164,10 +2165,10 @@ function xa(e, t) {
|
|
|
2164
2165
|
return Number(n);
|
|
2165
2166
|
return null;
|
|
2166
2167
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return e.sender_type !== "AGENT" || at(e) ? null :
|
|
2168
|
+
function $l(e, t) {
|
|
2169
|
+
return e.sender_type !== "AGENT" || at(e) ? null : Ea(e, t);
|
|
2169
2170
|
}
|
|
2170
|
-
const
|
|
2171
|
+
const vn = [
|
|
2171
2172
|
"#2F70F1",
|
|
2172
2173
|
"#52c41a",
|
|
2173
2174
|
"#fa8c16",
|
|
@@ -2177,16 +2178,16 @@ const An = [
|
|
|
2177
2178
|
"#f5222d",
|
|
2178
2179
|
"#faad14"
|
|
2179
2180
|
];
|
|
2180
|
-
function
|
|
2181
|
+
function Al(e) {
|
|
2181
2182
|
let t = 0;
|
|
2182
2183
|
for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) | 0;
|
|
2183
|
-
return
|
|
2184
|
+
return vn[Math.abs(t) % vn.length];
|
|
2184
2185
|
}
|
|
2185
|
-
function
|
|
2186
|
+
function vl(e) {
|
|
2186
2187
|
return e ? e.charAt(0).toUpperCase() : "?";
|
|
2187
2188
|
}
|
|
2188
|
-
function
|
|
2189
|
-
return
|
|
2189
|
+
function xl(e, t, n, r, s) {
|
|
2190
|
+
return Cr(t, n, r, s);
|
|
2190
2191
|
}
|
|
2191
2192
|
function oe(e, t = "success", n) {
|
|
2192
2193
|
switch (t) {
|
|
@@ -2203,10 +2204,10 @@ function oe(e, t = "success", n) {
|
|
|
2203
2204
|
x.success(e, n);
|
|
2204
2205
|
}
|
|
2205
2206
|
}
|
|
2206
|
-
function
|
|
2207
|
+
function Pl() {
|
|
2207
2208
|
return null;
|
|
2208
2209
|
}
|
|
2209
|
-
const
|
|
2210
|
+
const xn = 20, Pn = 200;
|
|
2210
2211
|
function ut(e) {
|
|
2211
2212
|
const t = e == null ? void 0 : e.trim();
|
|
2212
2213
|
if (!t) return 0;
|
|
@@ -2217,7 +2218,7 @@ function ut(e) {
|
|
|
2217
2218
|
return 0;
|
|
2218
2219
|
}
|
|
2219
2220
|
}
|
|
2220
|
-
function
|
|
2221
|
+
function El(e) {
|
|
2221
2222
|
const t = e == null ? void 0 : e.trim();
|
|
2222
2223
|
if (!t)
|
|
2223
2224
|
return "";
|
|
@@ -2238,10 +2239,10 @@ function xl(e) {
|
|
|
2238
2239
|
return t;
|
|
2239
2240
|
}
|
|
2240
2241
|
}
|
|
2241
|
-
const
|
|
2242
|
-
function
|
|
2242
|
+
const Ra = "USER_INFO";
|
|
2243
|
+
function Oa() {
|
|
2243
2244
|
try {
|
|
2244
|
-
const e = localStorage.getItem(
|
|
2245
|
+
const e = localStorage.getItem(Ra);
|
|
2245
2246
|
return e ? JSON.parse(e) : null;
|
|
2246
2247
|
} catch {
|
|
2247
2248
|
return null;
|
|
@@ -2254,10 +2255,10 @@ function dn(e) {
|
|
|
2254
2255
|
const n = typeof e.name == "string" ? e.name.trim() : "";
|
|
2255
2256
|
return n || (typeof e.username == "string" ? e.username.trim() : "") || "";
|
|
2256
2257
|
}
|
|
2257
|
-
function
|
|
2258
|
+
function Rl(e) {
|
|
2258
2259
|
return !!dn(e);
|
|
2259
2260
|
}
|
|
2260
|
-
function
|
|
2261
|
+
function Ma(e) {
|
|
2261
2262
|
var d;
|
|
2262
2263
|
const t = dn(e) || "user", n = typeof e.name == "string" && e.name.trim() || t;
|
|
2263
2264
|
let r = "👤";
|
|
@@ -2278,7 +2279,7 @@ function Ra(e) {
|
|
|
2278
2279
|
function Yt(e, t) {
|
|
2279
2280
|
return `${t ?? ""}\0${e ?? ""}`;
|
|
2280
2281
|
}
|
|
2281
|
-
function
|
|
2282
|
+
function Ol(e) {
|
|
2282
2283
|
const t = /* @__PURE__ */ new Map();
|
|
2283
2284
|
for (const r of Object.values(e)) {
|
|
2284
2285
|
const s = Yt(r.agentName, r.task_id), o = t.get(s) ?? [];
|
|
@@ -2304,7 +2305,7 @@ function El(e) {
|
|
|
2304
2305
|
}
|
|
2305
2306
|
return n;
|
|
2306
2307
|
}
|
|
2307
|
-
function
|
|
2308
|
+
function En(e, t) {
|
|
2308
2309
|
const n = e[t] ?? Object.values(e).find(
|
|
2309
2310
|
(s) => {
|
|
2310
2311
|
var o;
|
|
@@ -2316,25 +2317,25 @@ function Pn(e, t) {
|
|
|
2316
2317
|
const r = Yt(n.agentName, n.task_id);
|
|
2317
2318
|
return Object.values(e).filter((s) => Yt(s.agentName, s.task_id) === r).map((s) => s.executionId);
|
|
2318
2319
|
}
|
|
2319
|
-
const
|
|
2320
|
+
const Ar = "$ref";
|
|
2320
2321
|
function ze(e) {
|
|
2321
2322
|
const t = q(e);
|
|
2322
2323
|
return _e(t) ? t : void 0;
|
|
2323
2324
|
}
|
|
2324
|
-
function
|
|
2325
|
+
function vr(e) {
|
|
2325
2326
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2326
2327
|
return !1;
|
|
2327
2328
|
const t = Object.keys(e);
|
|
2328
|
-
return t.length === 1 && t[0] ===
|
|
2329
|
+
return t.length === 1 && t[0] === Ar;
|
|
2329
2330
|
}
|
|
2330
2331
|
function Ne(e) {
|
|
2331
|
-
if (!(!e || typeof e != "object" || Array.isArray(e)) && !
|
|
2332
|
+
if (!(!e || typeof e != "object" || Array.isArray(e)) && !vr(e))
|
|
2332
2333
|
return e;
|
|
2333
2334
|
}
|
|
2334
2335
|
function Xe(e) {
|
|
2335
|
-
return !e ||
|
|
2336
|
+
return !e || vr(e) ? !1 : Object.entries(e).some(([t, n]) => t === Ar ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "string" ? n.trim() !== "" : typeof n == "number" || typeof n == "boolean");
|
|
2336
2337
|
}
|
|
2337
|
-
function
|
|
2338
|
+
function Na(e) {
|
|
2338
2339
|
var s;
|
|
2339
2340
|
const t = Ne(e.submittedValue);
|
|
2340
2341
|
if (Xe(t))
|
|
@@ -2345,7 +2346,7 @@ function Oa(e) {
|
|
|
2345
2346
|
const r = typeof e.result == "string" && e.result.trim() ? e.result.trim() : "";
|
|
2346
2347
|
return r ? { response: r } : {};
|
|
2347
2348
|
}
|
|
2348
|
-
function
|
|
2349
|
+
function ja(e) {
|
|
2349
2350
|
if (e == null || e === "")
|
|
2350
2351
|
return null;
|
|
2351
2352
|
if (typeof e == "object" && !Array.isArray(e))
|
|
@@ -2359,23 +2360,23 @@ function Ma(e) {
|
|
|
2359
2360
|
return null;
|
|
2360
2361
|
}
|
|
2361
2362
|
}
|
|
2362
|
-
function
|
|
2363
|
-
const n = t.result == null || t.result === "" ? e.result : String(t.result), r =
|
|
2363
|
+
function Ml(e, t) {
|
|
2364
|
+
const n = t.result == null || t.result === "" ? e.result : String(t.result), r = ja(t.ext), s = Ne(
|
|
2364
2365
|
(r == null ? void 0 : r.submittedValue) ?? (r == null ? void 0 : r.submitted_value)
|
|
2365
2366
|
), o = {
|
|
2366
2367
|
...e,
|
|
2367
2368
|
result: n,
|
|
2368
2369
|
submittedValue: Xe(e.submittedValue) ? e.submittedValue : s ?? e.submittedValue
|
|
2369
2370
|
};
|
|
2370
|
-
return
|
|
2371
|
+
return xr(o) ?? o;
|
|
2371
2372
|
}
|
|
2372
|
-
function
|
|
2373
|
+
function xr(e) {
|
|
2373
2374
|
if (!e || typeof e != "object")
|
|
2374
2375
|
return null;
|
|
2375
2376
|
const t = e, n = ze(t.humanTaskId ?? t.human_task_id);
|
|
2376
2377
|
if (n == null)
|
|
2377
2378
|
return null;
|
|
2378
|
-
const r = Ne(t.cardForm) ?? Ne(t.card_form), s = Ne(t.submittedValue ?? t.submitted_value), o = typeof t.result == "string" ? t.result : void 0, i =
|
|
2379
|
+
const r = Ne(t.cardForm) ?? Ne(t.card_form), s = Ne(t.submittedValue ?? t.submitted_value), o = typeof t.result == "string" ? t.result : void 0, i = Na({
|
|
2379
2380
|
submittedValue: s,
|
|
2380
2381
|
cardForm: r,
|
|
2381
2382
|
result: o
|
|
@@ -2387,7 +2388,7 @@ function vr(e) {
|
|
|
2387
2388
|
t.scenarioInstanceId ?? t.scenario_instance_id
|
|
2388
2389
|
),
|
|
2389
2390
|
// humanTaskStatus 是状态码而非 ID,不能走 idOrUndefined(会变成字符串)
|
|
2390
|
-
humanTaskStatus:
|
|
2391
|
+
humanTaskStatus: Ua(t.humanTaskStatus ?? t.human_task_status),
|
|
2391
2392
|
assistType: typeof t.assistType == "string" ? t.assistType : typeof t.assist_type == "string" ? t.assist_type : void 0,
|
|
2392
2393
|
assignee: t.assignee && typeof t.assignee == "object" ? t.assignee : void 0,
|
|
2393
2394
|
cardForm: c,
|
|
@@ -2402,7 +2403,7 @@ function vr(e) {
|
|
|
2402
2403
|
canSubmit: t.canSubmit === !0 || t.can_submit === !0
|
|
2403
2404
|
};
|
|
2404
2405
|
}
|
|
2405
|
-
function
|
|
2406
|
+
function Ua(e) {
|
|
2406
2407
|
const t = Number(e);
|
|
2407
2408
|
return Number.isFinite(t) ? t : void 0;
|
|
2408
2409
|
}
|
|
@@ -2439,12 +2440,12 @@ function Xt(e) {
|
|
|
2439
2440
|
sender_avatar: String(e.sender_avatar ?? e.senderAvatar ?? ""),
|
|
2440
2441
|
is_own: c,
|
|
2441
2442
|
read_status: m,
|
|
2442
|
-
human_assist_card:
|
|
2443
|
+
human_assist_card: xr(
|
|
2443
2444
|
e.human_assist_card ?? e.humanAssistCard
|
|
2444
2445
|
)
|
|
2445
2446
|
};
|
|
2446
2447
|
}
|
|
2447
|
-
function
|
|
2448
|
+
function za(e, t) {
|
|
2448
2449
|
var o, i, c, l;
|
|
2449
2450
|
const n = (o = e.sender_name) == null ? void 0 : o.trim();
|
|
2450
2451
|
if (n)
|
|
@@ -2468,7 +2469,7 @@ function ja(e, t) {
|
|
|
2468
2469
|
return r === "AGENT" ? "助手" : r === "HUMAN" ? "成员" : "";
|
|
2469
2470
|
}
|
|
2470
2471
|
function Tt(e, t) {
|
|
2471
|
-
const n =
|
|
2472
|
+
const n = za(e, t);
|
|
2472
2473
|
return n === e.sender_name ? e : { ...e, sender_name: n };
|
|
2473
2474
|
}
|
|
2474
2475
|
const Ot = /* @__PURE__ */ new Map(), Mt = /* @__PURE__ */ new Map(), Nt = /* @__PURE__ */ new Map();
|
|
@@ -2510,19 +2511,19 @@ function Ut(e) {
|
|
|
2510
2511
|
const t = e.task_id;
|
|
2511
2512
|
return t == null || At(t, "0") <= 0;
|
|
2512
2513
|
}
|
|
2513
|
-
function
|
|
2514
|
+
function La(e) {
|
|
2514
2515
|
if (!e) return !1;
|
|
2515
2516
|
const t = e.cardForm;
|
|
2516
2517
|
return !!(t && t.status === "pending");
|
|
2517
2518
|
}
|
|
2518
|
-
function
|
|
2519
|
+
function Rn(e) {
|
|
2519
2520
|
const t = /* @__PURE__ */ new Set();
|
|
2520
2521
|
for (const n of e)
|
|
2521
2522
|
if (n.message_type === "AGENT_RESULT" && n.ext)
|
|
2522
2523
|
try {
|
|
2523
2524
|
const r = typeof n.ext == "string" ? JSON.parse(n.ext) : n.ext;
|
|
2524
2525
|
if ((r == null ? void 0 : r.taskId) != null) {
|
|
2525
|
-
if (
|
|
2526
|
+
if (La(r))
|
|
2526
2527
|
continue;
|
|
2527
2528
|
t.add(q(r.taskId));
|
|
2528
2529
|
}
|
|
@@ -2541,16 +2542,16 @@ function En(e) {
|
|
|
2541
2542
|
function Qt(e, t) {
|
|
2542
2543
|
return e.map((n) => Xt(n)).map((n) => Tt(n, t));
|
|
2543
2544
|
}
|
|
2544
|
-
function
|
|
2545
|
+
function Da(e, t, n) {
|
|
2545
2546
|
return Qt(e, t).map((r) => ({
|
|
2546
2547
|
...r,
|
|
2547
2548
|
task_id: r.task_id ?? n
|
|
2548
2549
|
}));
|
|
2549
2550
|
}
|
|
2550
2551
|
function ht(e) {
|
|
2551
|
-
return e.length <=
|
|
2552
|
+
return e.length <= Pn ? e : e.slice(e.length - Pn);
|
|
2552
2553
|
}
|
|
2553
|
-
function
|
|
2554
|
+
function Fa(e, t, n) {
|
|
2554
2555
|
if (t.sender_id == null)
|
|
2555
2556
|
return null;
|
|
2556
2557
|
const r = e.findIndex(
|
|
@@ -2561,7 +2562,7 @@ function La(e, t, n) {
|
|
|
2561
2562
|
const s = [...e];
|
|
2562
2563
|
return s[r] = { ...t, id: t.id }, s;
|
|
2563
2564
|
}
|
|
2564
|
-
function
|
|
2565
|
+
function qa(e) {
|
|
2565
2566
|
var r;
|
|
2566
2567
|
const t = (r = e.currentProject) == null ? void 0 : r.id;
|
|
2567
2568
|
if (t == null)
|
|
@@ -2580,8 +2581,8 @@ function Da(e) {
|
|
|
2580
2581
|
};
|
|
2581
2582
|
}
|
|
2582
2583
|
const ft = 80;
|
|
2583
|
-
let
|
|
2584
|
-
function
|
|
2584
|
+
let On = 0;
|
|
2585
|
+
function Ba(e) {
|
|
2585
2586
|
let t = (e || "").trim();
|
|
2586
2587
|
if (!t) return "";
|
|
2587
2588
|
t.length > 2e3 && (t = t.slice(0, 2e3));
|
|
@@ -2596,7 +2597,7 @@ function Fa(e) {
|
|
|
2596
2597
|
const o = s.split(/[。;;!?\n]/)[0].trim();
|
|
2597
2598
|
return o.length > 48 ? o.slice(0, 48) + "…" : o;
|
|
2598
2599
|
}
|
|
2599
|
-
function
|
|
2600
|
+
function Nl(e) {
|
|
2600
2601
|
let t = (e || "").trim();
|
|
2601
2602
|
if (!t) return "";
|
|
2602
2603
|
t.length > 200 && (t = t.slice(0, 200));
|
|
@@ -2607,7 +2608,7 @@ function yt() {
|
|
|
2607
2608
|
const e = /* @__PURE__ */ new Date(), t = (n) => String(n).padStart(2, "0");
|
|
2608
2609
|
return `${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`;
|
|
2609
2610
|
}
|
|
2610
|
-
const
|
|
2611
|
+
const jl = 3, Ul = 4, zl = 5, Mn = Mr((e, t) => ({
|
|
2611
2612
|
// 从 localStorage USER_INFO 同步水合(whoami / 登录每次成功都会写回)。
|
|
2612
2613
|
// 不水合的代价:工作台每次全新挂载(F5、/workspace/phone 与桌面版互甩、
|
|
2613
2614
|
// welcome/portal 进工作台)都先渲染门禁过渡页「正在接入 4A 统一登录…」,
|
|
@@ -2615,8 +2616,8 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2615
2616
|
// 水合只影响首帧;token 过期预检与 whoami 权限刷新仍照常在挂载后执行。
|
|
2616
2617
|
currentUser: (() => {
|
|
2617
2618
|
try {
|
|
2618
|
-
const n =
|
|
2619
|
-
return !n || !dn(n) ? null :
|
|
2619
|
+
const n = Oa();
|
|
2620
|
+
return !n || !dn(n) ? null : Ma(n);
|
|
2620
2621
|
} catch (n) {
|
|
2621
2622
|
return console.error("[useAppStore] hydrate currentUser failed", n), null;
|
|
2622
2623
|
}
|
|
@@ -2733,7 +2734,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2733
2734
|
},
|
|
2734
2735
|
/* ──── 认证 ──── */
|
|
2735
2736
|
login: async (n, r) => {
|
|
2736
|
-
const { user: s, token: o } = await
|
|
2737
|
+
const { user: s, token: o } = await Rs(n, r);
|
|
2737
2738
|
localStorage.setItem("token", o), localStorage.setItem("z_team_token", o);
|
|
2738
2739
|
const i = {
|
|
2739
2740
|
userId: s.id,
|
|
@@ -2747,7 +2748,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2747
2748
|
},
|
|
2748
2749
|
logout: async () => {
|
|
2749
2750
|
const { token: n } = t();
|
|
2750
|
-
n && await
|
|
2751
|
+
n && await Os().catch(() => {
|
|
2751
2752
|
}), localStorage.removeItem("token"), localStorage.removeItem("z_team_token"), localStorage.removeItem("userInfo"), localStorage.removeItem("USER_INFO"), e({ currentUser: null, token: "", permissionState: "unknown" });
|
|
2752
2753
|
},
|
|
2753
2754
|
updateCurrentUser: (n) => {
|
|
@@ -2761,7 +2762,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2761
2762
|
e({ loading: !0 });
|
|
2762
2763
|
const { token: r } = t();
|
|
2763
2764
|
try {
|
|
2764
|
-
const s = await
|
|
2765
|
+
const s = await js(r, n), i = (Array.isArray(s) ? s : []).map((c) => $e(c)).sort(
|
|
2765
2766
|
(c, l) => ut(l.created_at) - ut(c.created_at)
|
|
2766
2767
|
);
|
|
2767
2768
|
e({ projects: i, loading: !1 });
|
|
@@ -2772,7 +2773,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2772
2773
|
createScenarioInstance: async (n, r, s, o) => {
|
|
2773
2774
|
const i = t().token || "", c = { name: n, description: r, workspace_path: n };
|
|
2774
2775
|
s && s.trim() && (c.scenario_code = s.trim()), o && Object.keys(o).length > 0 && (c.extend_params = o);
|
|
2775
|
-
const l = await
|
|
2776
|
+
const l = await br(c, i), d = l.scenario_name && l.scenario_code ? `${l.scenario_name}(${l.scenario_code})` : l.scenario_code || "未知专家团";
|
|
2776
2777
|
return oe(`已按专家团「${d}」创建项目`, "success"), c.scenario_code === "qa_support" && l.scenario_code === "default" && oe(
|
|
2777
2778
|
"警告:请求答疑专家团但实际为默认专家团,请检查数据库 ft_scenario",
|
|
2778
2779
|
"error"
|
|
@@ -2825,7 +2826,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2825
2826
|
},
|
|
2826
2827
|
deleteScenarioInstance: async (n) => {
|
|
2827
2828
|
var r;
|
|
2828
|
-
if (await
|
|
2829
|
+
if (await fa(n), e((s) => ({ projects: s.projects.filter((o) => o.id !== n) })), ((r = t().currentProject) == null ? void 0 : r.id) === n) {
|
|
2829
2830
|
const { [n]: s, ...o } = t().fileTrees, { [n]: i, ...c } = t().projectCache;
|
|
2830
2831
|
e({
|
|
2831
2832
|
currentProject: null,
|
|
@@ -2838,7 +2839,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2838
2839
|
}
|
|
2839
2840
|
},
|
|
2840
2841
|
forkScenarioInstance: async (n, r, s) => {
|
|
2841
|
-
const o = await
|
|
2842
|
+
const o = await ya(
|
|
2842
2843
|
n,
|
|
2843
2844
|
r,
|
|
2844
2845
|
t().token,
|
|
@@ -2851,7 +2852,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2851
2852
|
})), await t().expandProject(o), o;
|
|
2852
2853
|
},
|
|
2853
2854
|
updateScenarioInstance: async (n, r) => {
|
|
2854
|
-
const s = await
|
|
2855
|
+
const s = await ga(n, r);
|
|
2855
2856
|
e((o) => {
|
|
2856
2857
|
var i;
|
|
2857
2858
|
return {
|
|
@@ -2869,7 +2870,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2869
2870
|
return s;
|
|
2870
2871
|
const o = (async () => {
|
|
2871
2872
|
try {
|
|
2872
|
-
const c = (await
|
|
2873
|
+
const c = (await Ls(n.id)).map((l) => ({
|
|
2873
2874
|
...l,
|
|
2874
2875
|
ref_id: String(l.ref_id ?? "")
|
|
2875
2876
|
}));
|
|
@@ -2905,8 +2906,8 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2905
2906
|
const o = (async () => {
|
|
2906
2907
|
try {
|
|
2907
2908
|
const [i, c] = await Promise.all([
|
|
2908
|
-
|
|
2909
|
-
|
|
2909
|
+
qs(n.id),
|
|
2910
|
+
Bs(n.id)
|
|
2910
2911
|
]), l = (Array.isArray(i) ? i : []).map(
|
|
2911
2912
|
(d) => ({
|
|
2912
2913
|
...d,
|
|
@@ -2940,7 +2941,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2940
2941
|
},
|
|
2941
2942
|
addMember: async (n, r, s, o) => {
|
|
2942
2943
|
const i = t().currentProject;
|
|
2943
|
-
i && (await
|
|
2944
|
+
i && (await Ds(i.id, {
|
|
2944
2945
|
member_type: n,
|
|
2945
2946
|
ref_id: r,
|
|
2946
2947
|
display_name: s,
|
|
@@ -2949,7 +2950,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2949
2950
|
},
|
|
2950
2951
|
removeMember: async (n) => {
|
|
2951
2952
|
const r = t().currentProject;
|
|
2952
|
-
r && (await
|
|
2953
|
+
r && (await Fs(r.id, n), await Promise.all([t().loadMembers(), t().loadTeamPickerOptions()]));
|
|
2953
2954
|
},
|
|
2954
2955
|
/* ──── 聊天 ──── */
|
|
2955
2956
|
loadMessages: async () => {
|
|
@@ -2957,8 +2958,8 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2957
2958
|
if (!n) return;
|
|
2958
2959
|
const r = String(n.id);
|
|
2959
2960
|
try {
|
|
2960
|
-
const s = await
|
|
2961
|
-
|
|
2961
|
+
const s = await In(n.id, xn), o = s.messages || [], i = t().members, c = mt(
|
|
2962
|
+
Rn(
|
|
2962
2963
|
Qt(o, i).filter(Ut)
|
|
2963
2964
|
)
|
|
2964
2965
|
), l = !!s.has_more;
|
|
@@ -2984,13 +2985,13 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
2984
2985
|
if (!n || !s || r.length === 0) return;
|
|
2985
2986
|
const o = r[0].id;
|
|
2986
2987
|
try {
|
|
2987
|
-
const i = await
|
|
2988
|
+
const i = await In(
|
|
2988
2989
|
n.id,
|
|
2989
|
-
|
|
2990
|
+
xn,
|
|
2990
2991
|
o
|
|
2991
2992
|
), c = i.messages || [];
|
|
2992
2993
|
if (c.length > 0) {
|
|
2993
|
-
const l =
|
|
2994
|
+
const l = Rn(
|
|
2994
2995
|
Qt(
|
|
2995
2996
|
c,
|
|
2996
2997
|
t().members
|
|
@@ -3024,12 +3025,12 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3024
3025
|
const c = String(r.sender_type || "HUMAN").toUpperCase() === "HUMAN", l = Et(o.members, o.currentUser) ?? null, d = String(r.scenario_instance_id ?? ""), u = (v = o.currentProject) != null && v.id ? String(o.currentProject.id) : "";
|
|
3025
3026
|
if (d && d !== "0" && u && d !== u)
|
|
3026
3027
|
return;
|
|
3027
|
-
const m = !!o.pendingTeamChatContent && o.pendingTeamChatContent === r.content && c, h =
|
|
3028
|
+
const m = !!o.pendingTeamChatContent && o.pendingTeamChatContent === r.content && c, h = va(
|
|
3028
3029
|
r,
|
|
3029
3030
|
l,
|
|
3030
3031
|
o.currentUser,
|
|
3031
3032
|
o.members
|
|
3032
|
-
), I =
|
|
3033
|
+
), I = Cr(
|
|
3033
3034
|
r,
|
|
3034
3035
|
l,
|
|
3035
3036
|
o.currentUser,
|
|
@@ -3102,7 +3103,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3102
3103
|
) : !1);
|
|
3103
3104
|
if (l.length !== 0)
|
|
3104
3105
|
for (const d of l)
|
|
3105
|
-
|
|
3106
|
+
Zs(r.id, d.id, s).catch(() => {
|
|
3106
3107
|
});
|
|
3107
3108
|
},
|
|
3108
3109
|
sendChatMessage: async (n) => {
|
|
@@ -3163,7 +3164,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3163
3164
|
if (!n) return;
|
|
3164
3165
|
const r = String(n.id);
|
|
3165
3166
|
try {
|
|
3166
|
-
const s = await
|
|
3167
|
+
const s = await Hs(n.id);
|
|
3167
3168
|
e((o) => {
|
|
3168
3169
|
var c;
|
|
3169
3170
|
if (((c = o.currentProject) == null ? void 0 : c.id) !== r)
|
|
@@ -3184,24 +3185,24 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3184
3185
|
const n = t().currentProject;
|
|
3185
3186
|
if (n)
|
|
3186
3187
|
try {
|
|
3187
|
-
const r = await
|
|
3188
|
+
const r = await Ks(n.id);
|
|
3188
3189
|
e({ allSkills: r });
|
|
3189
3190
|
} catch {
|
|
3190
3191
|
}
|
|
3191
3192
|
},
|
|
3192
3193
|
addProjectSkill: async (n) => {
|
|
3193
3194
|
const r = t().currentProject;
|
|
3194
|
-
r && (await
|
|
3195
|
+
r && (await Gs(r.id, n), await t().loadSkills(), await t().loadFileTree(t().currentDir, !0));
|
|
3195
3196
|
},
|
|
3196
3197
|
removeProjectSkill: async (n) => {
|
|
3197
3198
|
const r = t().currentProject;
|
|
3198
|
-
r && (await
|
|
3199
|
+
r && (await Js(r.id, n), await t().loadSkills(), await t().loadFileTree(t().currentDir, !0));
|
|
3199
3200
|
},
|
|
3200
3201
|
refreshAgentSkills: async (n) => {
|
|
3201
3202
|
const r = t().currentProject;
|
|
3202
3203
|
if (r)
|
|
3203
3204
|
try {
|
|
3204
|
-
const s = await
|
|
3205
|
+
const s = await Ws(r.id, n), o = s && typeof s.message == "string" ? s.message : "技能已刷新";
|
|
3205
3206
|
oe(o, (s == null ? void 0 : s.ok) === !1 ? "warning" : "success"), await t().loadFileTree(t().currentDir, !0);
|
|
3206
3207
|
} catch {
|
|
3207
3208
|
}
|
|
@@ -3209,7 +3210,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3209
3210
|
refreshAllAgentSkills: async (n) => {
|
|
3210
3211
|
if (n)
|
|
3211
3212
|
try {
|
|
3212
|
-
const r = await
|
|
3213
|
+
const r = await Vs(n), s = r && typeof r.message == "string" ? r.message : "所有技能已刷新";
|
|
3213
3214
|
oe(s, (r == null ? void 0 : r.ok) === !1 ? "warning" : "success");
|
|
3214
3215
|
const o = t().currentProject;
|
|
3215
3216
|
o && String(o.id) === String(n) && await t().loadFileTree(t().currentDir, !0);
|
|
@@ -3223,7 +3224,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3223
3224
|
return;
|
|
3224
3225
|
const o = String(s.id);
|
|
3225
3226
|
try {
|
|
3226
|
-
const i = await
|
|
3227
|
+
const i = await $n(s.id, n);
|
|
3227
3228
|
e((c) => {
|
|
3228
3229
|
var l;
|
|
3229
3230
|
return ((l = c.currentProject) == null ? void 0 : l.id) !== o ? {} : r ? {
|
|
@@ -3247,14 +3248,14 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3247
3248
|
selectedFileContent: null,
|
|
3248
3249
|
lastSelectedFilePath: n
|
|
3249
3250
|
}), localStorage.setItem("ft_last_file_path", n);
|
|
3250
|
-
const { content: s } = await
|
|
3251
|
+
const { content: s } = await na(r.id, n);
|
|
3251
3252
|
e({ selectedFileContent: s, editingFileContent: s ?? "" });
|
|
3252
3253
|
},
|
|
3253
3254
|
saveFileContent: async (n) => {
|
|
3254
3255
|
const r = t().currentProject, s = t().selectedFilePath;
|
|
3255
3256
|
if (!(!r || !s))
|
|
3256
3257
|
try {
|
|
3257
|
-
await
|
|
3258
|
+
await ra(r.id, s, n), e({ selectedFileContent: n, editingFileContent: n }), console.log("文件保存成功:", s);
|
|
3258
3259
|
} catch (o) {
|
|
3259
3260
|
throw console.error("保存文件失败:", o), console.log("保存失败的文件路径:", s), o;
|
|
3260
3261
|
}
|
|
@@ -3265,19 +3266,19 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3265
3266
|
},
|
|
3266
3267
|
renameFile: async (n, r) => {
|
|
3267
3268
|
const s = t().currentProject;
|
|
3268
|
-
s && (await
|
|
3269
|
+
s && (await sa(s.id, n, r), await t().loadFileTree(t().currentDir), t()._bumpVersion());
|
|
3269
3270
|
},
|
|
3270
3271
|
createFile: async (n, r) => {
|
|
3271
3272
|
const s = t().currentProject;
|
|
3272
|
-
s && (await
|
|
3273
|
+
s && (await aa(s.id, n, r), await t().loadFileTree(t().currentDir), t()._bumpVersion());
|
|
3273
3274
|
},
|
|
3274
3275
|
createFolder: async (n, r) => {
|
|
3275
3276
|
const s = t().currentProject;
|
|
3276
|
-
s && (await
|
|
3277
|
+
s && (await oa(s.id, n, r), await t().loadFileTree(t().currentDir), t()._bumpVersion());
|
|
3277
3278
|
},
|
|
3278
3279
|
deleteFile: async (n) => {
|
|
3279
3280
|
const r = t().currentProject;
|
|
3280
|
-
r && (await
|
|
3281
|
+
r && (await ia(r.id, n), t().selectedFilePath === n && (e({
|
|
3281
3282
|
selectedFilePath: null,
|
|
3282
3283
|
selectedFileContent: null,
|
|
3283
3284
|
editingFileContent: null
|
|
@@ -3285,16 +3286,16 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3285
3286
|
},
|
|
3286
3287
|
uploadFile: async (n, r) => {
|
|
3287
3288
|
const s = t().currentProject;
|
|
3288
|
-
s && (await
|
|
3289
|
+
s && (await ca(s.id, n, r), await t().loadFileTree(t().currentDir), t()._bumpVersion());
|
|
3289
3290
|
},
|
|
3290
3291
|
uploadFolder: async (n, r) => {
|
|
3291
3292
|
const s = t().currentProject;
|
|
3292
|
-
s && (await
|
|
3293
|
+
s && (await la(s.id, n, r), await t().loadFileTree(t().currentDir), t()._bumpVersion());
|
|
3293
3294
|
},
|
|
3294
3295
|
downloadFile: async (n) => {
|
|
3295
3296
|
const r = t().currentProject;
|
|
3296
3297
|
if (!r) return;
|
|
3297
|
-
const s = await
|
|
3298
|
+
const s = await da(r.id, n), o = window.URL.createObjectURL(s), i = document.createElement("a");
|
|
3298
3299
|
i.href = o, i.download = n.split("/").pop() || "download", document.body.appendChild(i), i.click(), window.URL.revokeObjectURL(o), document.body.removeChild(i);
|
|
3299
3300
|
},
|
|
3300
3301
|
toggleProjectExpand: async (n) => {
|
|
@@ -3338,7 +3339,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3338
3339
|
},
|
|
3339
3340
|
expandProject: async (n, r) => {
|
|
3340
3341
|
var T, v;
|
|
3341
|
-
const s = String(n.id), o = (r == null ? void 0 : r.expandTree) === !0, i = t(), c =
|
|
3342
|
+
const s = String(n.id), o = (r == null ? void 0 : r.expandTree) === !0, i = t(), c = qa(i), l = An(n, i.currentUser, n.mode), d = i.expandedProjectIds.includes(s), u = c[s], m = !i.fileTrees[s] || i.fileTrees[s].length === 0;
|
|
3342
3343
|
if (((T = i.currentProject) == null ? void 0 : T.id) === s && i.projectSwitchSeq > 0) {
|
|
3343
3344
|
o && !d && (e({
|
|
3344
3345
|
expandedProjectIds: [
|
|
@@ -3395,14 +3396,14 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3395
3396
|
/* 模式切换 */
|
|
3396
3397
|
switchMode: (n) => {
|
|
3397
3398
|
const { agentMode: r, currentProject: s, currentUser: o } = t();
|
|
3398
|
-
if (
|
|
3399
|
+
if (wr(s, o)) {
|
|
3399
3400
|
r !== "plan" && (e({ agentMode: "plan" }), localStorage.setItem("ft_agent_mode", "plan"));
|
|
3400
3401
|
return;
|
|
3401
3402
|
}
|
|
3402
|
-
r !== n && (e({ agentMode: n }), localStorage.setItem("ft_agent_mode", n),
|
|
3403
|
+
r !== n && (e({ agentMode: n }), localStorage.setItem("ft_agent_mode", n), Is({ type: "mode", mode: n }));
|
|
3403
3404
|
},
|
|
3404
3405
|
enforceTeamModePolicy: () => {
|
|
3405
|
-
const { currentProject: n, currentUser: r, agentMode: s } = t(), o =
|
|
3406
|
+
const { currentProject: n, currentUser: r, agentMode: s } = t(), o = An(
|
|
3406
3407
|
n,
|
|
3407
3408
|
r,
|
|
3408
3409
|
n == null ? void 0 : n.mode
|
|
@@ -3443,7 +3444,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3443
3444
|
const o = s;
|
|
3444
3445
|
t().applyExecutionCancelled(o);
|
|
3445
3446
|
try {
|
|
3446
|
-
await
|
|
3447
|
+
await Ys(r.id, o);
|
|
3447
3448
|
} catch (c) {
|
|
3448
3449
|
console.error("[ChatPanel] 停止失败:", c), Pt(c) || oe(
|
|
3449
3450
|
"停止失败:" + (c instanceof Error ? c.message : "未知错误"),
|
|
@@ -3454,11 +3455,11 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3454
3455
|
cancelExecutionQueue: async (n) => {
|
|
3455
3456
|
const r = t().currentProject;
|
|
3456
3457
|
if (!r) return;
|
|
3457
|
-
const s = t().runningExecutions, o = s[n] ? n :
|
|
3458
|
+
const s = t().runningExecutions, o = s[n] ? n : En(s, n)[0] ?? n, i = En(s, o);
|
|
3458
3459
|
for (const c of i)
|
|
3459
3460
|
t().applyExecutionCancelled(c);
|
|
3460
3461
|
try {
|
|
3461
|
-
await
|
|
3462
|
+
await Xs(r.id, o);
|
|
3462
3463
|
} catch (c) {
|
|
3463
3464
|
console.error("[ChatPanel] 停止队列失败:", c), Pt(c) || oe(
|
|
3464
3465
|
"停止队列失败:" + (c instanceof Error ? c.message : "未知错误"),
|
|
@@ -3577,7 +3578,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3577
3578
|
},
|
|
3578
3579
|
fetchWorkspaceEnv: async () => {
|
|
3579
3580
|
try {
|
|
3580
|
-
const n = await
|
|
3581
|
+
const n = await ea();
|
|
3581
3582
|
e({ isLocal: !!n.is_local });
|
|
3582
3583
|
} catch {
|
|
3583
3584
|
e({ isLocal: !1 });
|
|
@@ -3590,11 +3591,11 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3590
3591
|
syncingProjectIds: /* @__PURE__ */ new Set([...r.syncingProjectIds, n])
|
|
3591
3592
|
});
|
|
3592
3593
|
try {
|
|
3593
|
-
const s = await
|
|
3594
|
+
const s = await ta(n), o = `同步完成:${s.files_synced} 个文件,${s.dirs_created} 个目录` + (s.errors.length > 0 ? `,${s.errors.length} 个错误` : "");
|
|
3594
3595
|
oe(o, s.errors.length > 0 ? "warning" : "success"), e((c) => ({ fileTreeVersion: c.fileTreeVersion + 1 }));
|
|
3595
3596
|
const i = t().currentProject;
|
|
3596
3597
|
if (i && i.id === n) {
|
|
3597
|
-
const c = await
|
|
3598
|
+
const c = await $n(n, "");
|
|
3598
3599
|
e((l) => ({
|
|
3599
3600
|
fileTrees: { ...l.fileTrees, [n]: c || [] }
|
|
3600
3601
|
}));
|
|
@@ -3616,7 +3617,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3616
3617
|
n
|
|
3617
3618
|
), s = q(r.task_id);
|
|
3618
3619
|
if (_e(s)) {
|
|
3619
|
-
const m =
|
|
3620
|
+
const m = Ba(r.content);
|
|
3620
3621
|
m && t().pushTaskActivity(
|
|
3621
3622
|
s,
|
|
3622
3623
|
m,
|
|
@@ -3644,11 +3645,11 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3644
3645
|
jt(h, c)
|
|
3645
3646
|
)
|
|
3646
3647
|
};
|
|
3647
|
-
if (c.sender_type === "AGENT" &&
|
|
3648
|
-
const T =
|
|
3648
|
+
if (c.sender_type === "AGENT" && Wt(c.content)) {
|
|
3649
|
+
const T = Fa(
|
|
3649
3650
|
h,
|
|
3650
3651
|
c,
|
|
3651
|
-
|
|
3652
|
+
Wt
|
|
3652
3653
|
);
|
|
3653
3654
|
if (T)
|
|
3654
3655
|
return { taskMessages: ht(T) };
|
|
@@ -3682,7 +3683,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3682
3683
|
}
|
|
3683
3684
|
if (u && u.text === c) return {};
|
|
3684
3685
|
const m = {
|
|
3685
|
-
id: ++
|
|
3686
|
+
id: ++On,
|
|
3686
3687
|
time: yt(),
|
|
3687
3688
|
text: c,
|
|
3688
3689
|
sender: s || void 0,
|
|
@@ -3713,7 +3714,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3713
3714
|
}
|
|
3714
3715
|
if (m && m.text === l) return {};
|
|
3715
3716
|
const h = {
|
|
3716
|
-
id: ++
|
|
3717
|
+
id: ++On,
|
|
3717
3718
|
time: yt(),
|
|
3718
3719
|
text: l,
|
|
3719
3720
|
sender: i || void 0,
|
|
@@ -3733,7 +3734,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3733
3734
|
...s != null && s.switchToTasksTab ? { navigateToTasksTick: t().navigateToTasksTick + 1 } : {}
|
|
3734
3735
|
});
|
|
3735
3736
|
try {
|
|
3736
|
-
const c = await
|
|
3737
|
+
const c = await ba(o.id, n), l = {
|
|
3737
3738
|
task_id: q(c.task_id ?? c.taskId ?? n),
|
|
3738
3739
|
scenario_instance_id: q(
|
|
3739
3740
|
c.scenario_instance_id ?? c.scenarioInstanceId ?? o.id
|
|
@@ -3766,7 +3767,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3766
3767
|
let c = t().projects.find((d) => d.id === o);
|
|
3767
3768
|
if (!c)
|
|
3768
3769
|
try {
|
|
3769
|
-
c = await
|
|
3770
|
+
c = await ha(o, i), e((d) => ({
|
|
3770
3771
|
projects: d.projects.some((m) => m.id === o) ? d.projects : [...d.projects, c]
|
|
3771
3772
|
}));
|
|
3772
3773
|
} catch (d) {
|
|
@@ -3780,12 +3781,12 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3780
3781
|
const o = t().currentProject;
|
|
3781
3782
|
if (o)
|
|
3782
3783
|
try {
|
|
3783
|
-
const i = await
|
|
3784
|
+
const i = await Sa(
|
|
3784
3785
|
o.id,
|
|
3785
3786
|
n,
|
|
3786
3787
|
r,
|
|
3787
3788
|
s
|
|
3788
|
-
), c = Array.isArray(i == null ? void 0 : i.messages) ? i.messages : [], l =
|
|
3789
|
+
), c = Array.isArray(i == null ? void 0 : i.messages) ? i.messages : [], l = Da(c, t().members, n), d = !!i.has_more;
|
|
3789
3790
|
s ? e((u) => ({
|
|
3790
3791
|
taskMessages: mt([...l, ...u.taskMessages]),
|
|
3791
3792
|
taskHasMoreMessages: d
|
|
@@ -3801,7 +3802,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3801
3802
|
const o = t().currentProject;
|
|
3802
3803
|
if (!(!o || !r.trim() && !(s != null && s.length)))
|
|
3803
3804
|
try {
|
|
3804
|
-
await
|
|
3805
|
+
await _a(o.id, n, r, t().token, s), await t().loadTaskMessages(n), t().requestChatScrollBottom("task", !0);
|
|
3805
3806
|
} catch (i) {
|
|
3806
3807
|
throw console.error("Failed to send task message", i), i;
|
|
3807
3808
|
}
|
|
@@ -3810,7 +3811,7 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3810
3811
|
const n = t().currentProject;
|
|
3811
3812
|
if (n)
|
|
3812
3813
|
try {
|
|
3813
|
-
const r = await
|
|
3814
|
+
const r = await Qs(n.id);
|
|
3814
3815
|
e((s) => {
|
|
3815
3816
|
var i;
|
|
3816
3817
|
const o = {};
|
|
@@ -3847,14 +3848,14 @@ const Ml = 3, Nl = 4, jl = 5, On = Or((e, t) => ({
|
|
|
3847
3848
|
}
|
|
3848
3849
|
}
|
|
3849
3850
|
}));
|
|
3850
|
-
|
|
3851
|
-
useToken: () =>
|
|
3852
|
-
useCurrentUser: () =>
|
|
3851
|
+
Or({
|
|
3852
|
+
useToken: () => Mn((e) => e.token),
|
|
3853
|
+
useCurrentUser: () => Mn((e) => e.currentUser)
|
|
3853
3854
|
});
|
|
3854
|
-
function
|
|
3855
|
+
function Ha(e) {
|
|
3855
3856
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3856
3857
|
}
|
|
3857
|
-
function
|
|
3858
|
+
function Ll(e) {
|
|
3858
3859
|
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
3859
3860
|
var t = e.default;
|
|
3860
3861
|
if (typeof t == "function") {
|
|
@@ -3873,9 +3874,9 @@ function Ul(e) {
|
|
|
3873
3874
|
});
|
|
3874
3875
|
}), n;
|
|
3875
3876
|
}
|
|
3876
|
-
var Le = {}, zt = { exports: {} },
|
|
3877
|
+
var Le = {}, zt = { exports: {} }, Nn;
|
|
3877
3878
|
function un() {
|
|
3878
|
-
return
|
|
3879
|
+
return Nn || (Nn = 1, (function(e) {
|
|
3879
3880
|
function t(n) {
|
|
3880
3881
|
return n && n.__esModule ? n : {
|
|
3881
3882
|
default: n
|
|
@@ -3884,10 +3885,10 @@ function un() {
|
|
|
3884
3885
|
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3885
3886
|
})(zt)), zt.exports;
|
|
3886
3887
|
}
|
|
3887
|
-
var De = {},
|
|
3888
|
-
function
|
|
3889
|
-
if (
|
|
3890
|
-
|
|
3888
|
+
var De = {}, jn;
|
|
3889
|
+
function Ka() {
|
|
3890
|
+
if (jn) return De;
|
|
3891
|
+
jn = 1, Object.defineProperty(De, "__esModule", {
|
|
3891
3892
|
value: !0
|
|
3892
3893
|
}), De.default = void 0;
|
|
3893
3894
|
const e = {
|
|
@@ -3907,9 +3908,9 @@ function Ba() {
|
|
|
3907
3908
|
};
|
|
3908
3909
|
return De.default = e, De;
|
|
3909
3910
|
}
|
|
3910
|
-
var Fe = {}, qe = {}, Be = {}, He = {},
|
|
3911
|
-
function
|
|
3912
|
-
return
|
|
3911
|
+
var Fe = {}, qe = {}, Be = {}, He = {}, Un;
|
|
3912
|
+
function Ga() {
|
|
3913
|
+
return Un || (Un = 1, Object.defineProperty(He, "__esModule", {
|
|
3913
3914
|
value: !0
|
|
3914
3915
|
}), He.commonLocale = void 0, He.commonLocale = {
|
|
3915
3916
|
yearFormat: "YYYY",
|
|
@@ -3918,13 +3919,13 @@ function Ha() {
|
|
|
3918
3919
|
monthBeforeYear: !0
|
|
3919
3920
|
}), He;
|
|
3920
3921
|
}
|
|
3921
|
-
var
|
|
3922
|
-
function
|
|
3923
|
-
if (
|
|
3924
|
-
|
|
3922
|
+
var zn;
|
|
3923
|
+
function Ja() {
|
|
3924
|
+
if (zn) return Be;
|
|
3925
|
+
zn = 1, Object.defineProperty(Be, "__esModule", {
|
|
3925
3926
|
value: !0
|
|
3926
3927
|
}), Be.default = void 0;
|
|
3927
|
-
var e =
|
|
3928
|
+
var e = Ga();
|
|
3928
3929
|
const t = {
|
|
3929
3930
|
...e.commonLocale,
|
|
3930
3931
|
locale: "zh_CN",
|
|
@@ -3956,10 +3957,10 @@ function Ka() {
|
|
|
3956
3957
|
};
|
|
3957
3958
|
return Be.default = t, Be;
|
|
3958
3959
|
}
|
|
3959
|
-
var Ke = {},
|
|
3960
|
-
function
|
|
3961
|
-
if (
|
|
3962
|
-
|
|
3960
|
+
var Ke = {}, Ln;
|
|
3961
|
+
function Pr() {
|
|
3962
|
+
if (Ln) return Ke;
|
|
3963
|
+
Ln = 1, Object.defineProperty(Ke, "__esModule", {
|
|
3963
3964
|
value: !0
|
|
3964
3965
|
}), Ke.default = void 0;
|
|
3965
3966
|
const e = {
|
|
@@ -3968,15 +3969,15 @@ function xr() {
|
|
|
3968
3969
|
};
|
|
3969
3970
|
return Ke.default = e, Ke;
|
|
3970
3971
|
}
|
|
3971
|
-
var
|
|
3972
|
-
function
|
|
3973
|
-
if (
|
|
3974
|
-
|
|
3972
|
+
var Dn;
|
|
3973
|
+
function Er() {
|
|
3974
|
+
if (Dn) return qe;
|
|
3975
|
+
Dn = 1;
|
|
3975
3976
|
var e = un().default;
|
|
3976
3977
|
Object.defineProperty(qe, "__esModule", {
|
|
3977
3978
|
value: !0
|
|
3978
3979
|
}), qe.default = void 0;
|
|
3979
|
-
var t = e(
|
|
3980
|
+
var t = e(Ja()), n = e(/* @__PURE__ */ Pr());
|
|
3980
3981
|
const r = {
|
|
3981
3982
|
lang: {
|
|
3982
3983
|
placeholder: "请选择日期",
|
|
@@ -3997,26 +3998,26 @@ function Pr() {
|
|
|
3997
3998
|
};
|
|
3998
3999
|
return r.lang.ok = "确定", qe.default = r, qe;
|
|
3999
4000
|
}
|
|
4000
|
-
var
|
|
4001
|
-
function
|
|
4002
|
-
if (
|
|
4003
|
-
|
|
4001
|
+
var Fn;
|
|
4002
|
+
function Wa() {
|
|
4003
|
+
if (Fn) return Fe;
|
|
4004
|
+
Fn = 1;
|
|
4004
4005
|
var e = un().default;
|
|
4005
4006
|
Object.defineProperty(Fe, "__esModule", {
|
|
4006
4007
|
value: !0
|
|
4007
4008
|
}), Fe.default = void 0;
|
|
4008
|
-
var t = e(/* @__PURE__ */
|
|
4009
|
+
var t = e(/* @__PURE__ */ Er());
|
|
4009
4010
|
return Fe.default = t.default, Fe;
|
|
4010
4011
|
}
|
|
4011
|
-
var
|
|
4012
|
-
function
|
|
4013
|
-
if (
|
|
4014
|
-
|
|
4012
|
+
var qn;
|
|
4013
|
+
function Va() {
|
|
4014
|
+
if (qn) return Le;
|
|
4015
|
+
qn = 1;
|
|
4015
4016
|
var e = un().default;
|
|
4016
4017
|
Object.defineProperty(Le, "__esModule", {
|
|
4017
4018
|
value: !0
|
|
4018
4019
|
}), Le.default = void 0;
|
|
4019
|
-
var t = e(
|
|
4020
|
+
var t = e(Ka()), n = e(/* @__PURE__ */ Wa()), r = e(/* @__PURE__ */ Er()), s = e(/* @__PURE__ */ Pr());
|
|
4020
4021
|
const o = "${label}不是一个有效的${type}", i = {
|
|
4021
4022
|
locale: "zh-cn",
|
|
4022
4023
|
Pagination: t.default,
|
|
@@ -4165,12 +4166,12 @@ function Ja() {
|
|
|
4165
4166
|
};
|
|
4166
4167
|
return Le.default = i, Le;
|
|
4167
4168
|
}
|
|
4168
|
-
var Lt,
|
|
4169
|
-
function
|
|
4170
|
-
return
|
|
4169
|
+
var Lt, Bn;
|
|
4170
|
+
function Za() {
|
|
4171
|
+
return Bn || (Bn = 1, Lt = /* @__PURE__ */ Va()), Lt;
|
|
4171
4172
|
}
|
|
4172
|
-
var
|
|
4173
|
-
const
|
|
4173
|
+
var Ya = /* @__PURE__ */ Za();
|
|
4174
|
+
const Xa = /* @__PURE__ */ Ha(Ya), Dl = [
|
|
4174
4175
|
"/config",
|
|
4175
4176
|
// z-config 配置中心
|
|
4176
4177
|
"/mist",
|
|
@@ -4197,42 +4198,42 @@ const Za = /* @__PURE__ */ qa(Wa), zl = [
|
|
|
4197
4198
|
// z-oss 对象存储
|
|
4198
4199
|
"/schedule"
|
|
4199
4200
|
// z-schedule 调度中心(2026-11-09 从系统面孤儿路由收编到中间件面)
|
|
4200
|
-
],
|
|
4201
|
+
], Qa = [
|
|
4201
4202
|
"/ops",
|
|
4202
4203
|
// DevOps 运维 + 部署编排(渠道/环境/部署/仓库)
|
|
4203
4204
|
"/resource"
|
|
4204
4205
|
// 资源管理(域名 / ECS / RDS / OSS)
|
|
4205
4206
|
];
|
|
4206
|
-
function
|
|
4207
|
+
function eo(e, t) {
|
|
4207
4208
|
return e === t || e.startsWith(t + "/");
|
|
4208
4209
|
}
|
|
4209
|
-
function
|
|
4210
|
-
return e &&
|
|
4210
|
+
function to(e) {
|
|
4211
|
+
return e && Qa.some((t) => eo(e, t)) ? "ops" : "system";
|
|
4211
4212
|
}
|
|
4212
|
-
const
|
|
4213
|
+
const no = 30, ro = ["/api/", "/kapi/", "/z-team/", "/auth/", "/sso/"], Qe = "__zteam_api_error_monitor__", et = globalThis;
|
|
4213
4214
|
function Dt(e) {
|
|
4214
|
-
return e.startsWith(location.origin) && (e = e.slice(location.origin.length)),
|
|
4215
|
+
return e.startsWith(location.origin) && (e = e.slice(location.origin.length)), ro.some((t) => e.includes(t));
|
|
4215
4216
|
}
|
|
4216
4217
|
function Ft(e) {
|
|
4217
4218
|
const t = et[Qe];
|
|
4218
4219
|
if (!t) return;
|
|
4219
|
-
t.failures.push(e), t.failures.length >
|
|
4220
|
+
t.failures.push(e), t.failures.length > no && t.failures.shift();
|
|
4220
4221
|
const n = [...t.failures];
|
|
4221
4222
|
t.listeners.forEach((r) => r(n));
|
|
4222
4223
|
}
|
|
4223
|
-
function
|
|
4224
|
+
function Fl() {
|
|
4224
4225
|
var e;
|
|
4225
4226
|
return ((e = et[Qe]) == null ? void 0 : e.failures) ?? [];
|
|
4226
4227
|
}
|
|
4227
|
-
function
|
|
4228
|
+
function ql(e) {
|
|
4228
4229
|
const t = et[Qe];
|
|
4229
4230
|
return t ? (t.listeners.add(e), e(t.failures), () => t.listeners.delete(e)) : () => {
|
|
4230
4231
|
};
|
|
4231
4232
|
}
|
|
4232
|
-
function
|
|
4233
|
+
function Hn(e) {
|
|
4233
4234
|
return e >= 400 && e !== 401;
|
|
4234
4235
|
}
|
|
4235
|
-
function
|
|
4236
|
+
function so() {
|
|
4236
4237
|
if (et[Qe]) return;
|
|
4237
4238
|
const e = { failures: [], listeners: /* @__PURE__ */ new Set() };
|
|
4238
4239
|
et[Qe] = e;
|
|
@@ -4242,7 +4243,7 @@ function no() {
|
|
|
4242
4243
|
const o = s[0], i = typeof o == "string" ? o : o instanceof URL ? o.href : o.url, c = (((l = s[1]) == null ? void 0 : l.method) ?? (typeof o == "object" && o && "method" in o ? o.method : void 0) ?? "GET").toUpperCase();
|
|
4243
4244
|
try {
|
|
4244
4245
|
const d = await t(...s);
|
|
4245
|
-
return
|
|
4246
|
+
return Hn(d.status) && Dt(i) && Ft({ method: c, url: i, status: d.status, route: location.pathname, at: Date.now() }), d;
|
|
4246
4247
|
} catch (d) {
|
|
4247
4248
|
throw Dt(i) && Ft({ method: c, url: i, status: 0, route: location.pathname, at: Date.now() }), d;
|
|
4248
4249
|
}
|
|
@@ -4256,27 +4257,27 @@ function no() {
|
|
|
4256
4257
|
if (c && Dt(c)) {
|
|
4257
4258
|
const l = i.__method ?? "GET";
|
|
4258
4259
|
this.addEventListener("loadend", () => {
|
|
4259
|
-
|
|
4260
|
+
Hn(this.status) && Ft({ method: l, url: c, status: this.status, route: location.pathname, at: Date.now() });
|
|
4260
4261
|
});
|
|
4261
4262
|
}
|
|
4262
4263
|
return o;
|
|
4263
4264
|
};
|
|
4264
4265
|
}
|
|
4265
|
-
|
|
4266
|
+
so();
|
|
4266
4267
|
const ne = (e) => {
|
|
4267
|
-
const t =
|
|
4268
|
-
return (n) => /* @__PURE__ */ a(
|
|
4269
|
-
}, ve = ne(() => import("./index-
|
|
4270
|
-
ne(() => import("./index-
|
|
4271
|
-
const
|
|
4272
|
-
function
|
|
4273
|
-
const { pathname: t } =
|
|
4274
|
-
return e === "system" ? /* @__PURE__ */ a(ve, { forcedChatMode:
|
|
4275
|
-
}
|
|
4276
|
-
function
|
|
4277
|
-
return /* @__PURE__ */ a(
|
|
4278
|
-
}
|
|
4279
|
-
function
|
|
4268
|
+
const t = zr(e);
|
|
4269
|
+
return (n) => /* @__PURE__ */ a(nr, { fallback: null, children: /* @__PURE__ */ a(t, { ...n }) });
|
|
4270
|
+
}, ve = ne(() => import("./index-42bX8gez.js").then((e) => e.aF)), ao = ne(() => import("./index-BYOtlNsM.js")), oo = ne(() => import("./index-B_t78LZv.js")), io = ne(() => import("./index-B0rtOawD.js")), co = ne(() => import("./index-bAhL-Q2C.js")), lo = ne(() => import("./index-CrMsFd5Z.js"));
|
|
4271
|
+
ne(() => import("./index-BIXa6eC4.js"));
|
|
4272
|
+
const uo = ne(() => import("./index-C815hPWS.js")), po = ne(() => import("./index-BYn7uqV3.js")), mo = ne(() => import("./index-QNpTaU--.js")), ho = ne(() => import("./index-Dk9xo9y0.js")), fo = ne(() => import("./index-BeWt_erd.js")), yo = ne(() => import("./index-B_LJRFsK.js")), go = ne(() => import("./index-C5pI1LOK.js"));
|
|
4273
|
+
function bo({ forcedMode: e }) {
|
|
4274
|
+
const { pathname: t } = Lr(), n = t.replace(/\/+$/, "") || "/";
|
|
4275
|
+
return e === "system" ? /* @__PURE__ */ a(ve, { forcedChatMode: to(n) }) : e === "dev" ? /* @__PURE__ */ a(ve, { forcedChatMode: "dev" }) : e === "knowledge" ? /* @__PURE__ */ a(ve, { forcedChatMode: "knowledge" }) : n === "/workspace" ? /* @__PURE__ */ a(ve, {}) : n === "/workspace/phone" ? /* @__PURE__ */ a(ao, {}) : n === "/workspace/from-ticket" ? /* @__PURE__ */ a(oo, {}) : n === "/workspace/from-scenario" ? /* @__PURE__ */ a(io, {}) : n === "/workspace/build-by-form" ? /* @__PURE__ */ a(co, {}) : n === "/scenario" ? /* @__PURE__ */ a(lo, {}) : n === "/admin" ? /* @__PURE__ */ a(ve, {}) : n === "/welcome" ? /* @__PURE__ */ a(po, {}) : n === "/portal" ? /* @__PURE__ */ a(mo, {}) : n === "/chatdemo" ? /* @__PURE__ */ a(uo, {}) : n === "/embed/chat" || n.startsWith("/embed/chat/") ? /* @__PURE__ */ a(go, {}) : n === "/change-log" ? /* @__PURE__ */ a(ho, {}) : n === "/docs" ? /* @__PURE__ */ a(fo, {}) : n === "/download" ? /* @__PURE__ */ a(yo, {}) : /* @__PURE__ */ a(ve, {});
|
|
4276
|
+
}
|
|
4277
|
+
function Bl({ forcedMode: e }) {
|
|
4278
|
+
return /* @__PURE__ */ a(Nr, { locale: Xa, theme: Fr, children: /* @__PURE__ */ a(nr, { fallback: null, children: /* @__PURE__ */ a(bo, { forcedMode: e }) }) });
|
|
4279
|
+
}
|
|
4280
|
+
function So(e) {
|
|
4280
4281
|
if (!e || typeof e != "string") return null;
|
|
4281
4282
|
const t = e.split(".");
|
|
4282
4283
|
if (t.length !== 3) return null;
|
|
@@ -4290,12 +4291,12 @@ function go(e) {
|
|
|
4290
4291
|
return null;
|
|
4291
4292
|
}
|
|
4292
4293
|
}
|
|
4293
|
-
function
|
|
4294
|
-
const n =
|
|
4294
|
+
function _o(e, t = 30) {
|
|
4295
|
+
const n = So(e);
|
|
4295
4296
|
return !n || typeof n.exp != "number" ? !0 : Date.now() / 1e3 > n.exp - t;
|
|
4296
4297
|
}
|
|
4297
|
-
let
|
|
4298
|
-
const
|
|
4298
|
+
let Kn = !1;
|
|
4299
|
+
const wo = [
|
|
4299
4300
|
"/ctc/authn/login",
|
|
4300
4301
|
"/ctc/authn/register",
|
|
4301
4302
|
"/ctc/authn/send-code",
|
|
@@ -4313,12 +4314,12 @@ const So = [
|
|
|
4313
4314
|
"/sso/login",
|
|
4314
4315
|
"/sso/callback"
|
|
4315
4316
|
];
|
|
4316
|
-
function
|
|
4317
|
-
return
|
|
4317
|
+
function To(e) {
|
|
4318
|
+
return wo.some((t) => e.includes(t));
|
|
4318
4319
|
}
|
|
4319
|
-
function
|
|
4320
|
-
if (
|
|
4321
|
-
|
|
4320
|
+
function Gn(e) {
|
|
4321
|
+
if (Kn || typeof window > "u" || window.location.pathname.startsWith("/login")) return;
|
|
4322
|
+
Kn = !0;
|
|
4322
4323
|
try {
|
|
4323
4324
|
localStorage.removeItem("token"), localStorage.removeItem("userInfo");
|
|
4324
4325
|
} catch {
|
|
@@ -4327,19 +4328,19 @@ function Kn(e) {
|
|
|
4327
4328
|
const t = window.location.pathname + window.location.search, n = encodeURIComponent(t);
|
|
4328
4329
|
window.location.href = `/login?redirect=${n}`;
|
|
4329
4330
|
}
|
|
4330
|
-
function
|
|
4331
|
+
function ko(e) {
|
|
4331
4332
|
if (e && typeof e == "object" && "code" in e && "data" in e) {
|
|
4332
4333
|
const t = e;
|
|
4333
4334
|
return (typeof t.success == "boolean" ? t.success : typeof t.code == "number" && t.code >= 200 && t.code < 300) ? t.data : Promise.reject(new Error(t.message || "请求失败"));
|
|
4334
4335
|
}
|
|
4335
4336
|
return e;
|
|
4336
4337
|
}
|
|
4337
|
-
function
|
|
4338
|
+
function Co(e, t = {}) {
|
|
4338
4339
|
const { tokenKey: n = "token", userInfoKey: r = "userInfo" } = t;
|
|
4339
4340
|
e.interceptors.request.use((s) => {
|
|
4340
4341
|
const o = localStorage.getItem(n);
|
|
4341
|
-
if (o &&
|
|
4342
|
-
return
|
|
4342
|
+
if (o && _o(o))
|
|
4343
|
+
return Gn(`请求前检测到 token 已过期 (${s.url || ""})`), Promise.reject(new an.CanceledError("token expired"));
|
|
4343
4344
|
try {
|
|
4344
4345
|
const i = localStorage.getItem(r);
|
|
4345
4346
|
if (i) {
|
|
@@ -4353,11 +4354,11 @@ function To(e, t = {}) {
|
|
|
4353
4354
|
}
|
|
4354
4355
|
return s;
|
|
4355
4356
|
}), e.interceptors.response.use(
|
|
4356
|
-
(s) =>
|
|
4357
|
+
(s) => ko(s.data),
|
|
4357
4358
|
(s) => {
|
|
4358
4359
|
var c, l;
|
|
4359
4360
|
const o = (c = s.response) == null ? void 0 : c.status, i = ((l = s.config) == null ? void 0 : l.url) || "";
|
|
4360
|
-
return o === 401 ?
|
|
4361
|
+
return o === 401 ? To(i) ? console.warn(`[401] 公开接口返回 401 (不是 token 问题): ${i}`) : Gn(`接口 ${i} 返回 401`) : o === 403 ? console.warn("[403] 没有权限访问该资源:", i) : o === 404 ? console.warn("[404] 接口不存在:", i) : o === 500 && console.error("[500] 服务器内部错误:", i), Promise.reject(s);
|
|
4361
4362
|
}
|
|
4362
4363
|
);
|
|
4363
4364
|
}
|
|
@@ -4368,12 +4369,12 @@ function pn(e = {}) {
|
|
|
4368
4369
|
withCredentials: !0
|
|
4369
4370
|
// Cookie 模式:浏览器自动携带 Cookie
|
|
4370
4371
|
});
|
|
4371
|
-
return
|
|
4372
|
+
return Co(t, {
|
|
4372
4373
|
tokenKey: e.tokenKey,
|
|
4373
4374
|
userInfoKey: e.userInfoKey
|
|
4374
4375
|
}), t;
|
|
4375
4376
|
}
|
|
4376
|
-
const K = pn(),
|
|
4377
|
+
const K = pn(), Hl = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e) => e ? typeof e.total == "number" ? e.total : Array.isArray(e) ? e.length : Array.isArray(e.records) ? e.records.length : Array.isArray(e.data) ? e.data.length : 0 : 0, Io = [
|
|
4377
4378
|
{
|
|
4378
4379
|
key: "ai",
|
|
4379
4380
|
color: "violet",
|
|
@@ -4401,7 +4402,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4401
4402
|
{
|
|
4402
4403
|
title: "模板市场",
|
|
4403
4404
|
description: "精选 AI 应用模板, 一键复制即可使用",
|
|
4404
|
-
icon: /* @__PURE__ */ a(
|
|
4405
|
+
icon: /* @__PURE__ */ a(Br, {}),
|
|
4405
4406
|
color: "pink",
|
|
4406
4407
|
tags: [{ label: "模板", color: "pink" }],
|
|
4407
4408
|
meta: "24 个模板"
|
|
@@ -4427,14 +4428,14 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4427
4428
|
{
|
|
4428
4429
|
title: "任务仪表盘",
|
|
4429
4430
|
description: "实时任务执行情况, 成功率与时长统计",
|
|
4430
|
-
icon: /* @__PURE__ */ a(
|
|
4431
|
+
icon: /* @__PURE__ */ a(Hr, {}),
|
|
4431
4432
|
color: "green",
|
|
4432
4433
|
tags: [{ label: "看板", color: "green" }]
|
|
4433
4434
|
},
|
|
4434
4435
|
{
|
|
4435
4436
|
title: "任务列表",
|
|
4436
4437
|
description: "所有定时/手动任务, 支持 Cron 表达式",
|
|
4437
|
-
icon: /* @__PURE__ */ a(
|
|
4438
|
+
icon: /* @__PURE__ */ a(Kr, {}),
|
|
4438
4439
|
color: "blue",
|
|
4439
4440
|
tags: [{ label: "调度", color: "blue" }]
|
|
4440
4441
|
},
|
|
@@ -4471,7 +4472,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4471
4472
|
}
|
|
4472
4473
|
]
|
|
4473
4474
|
}
|
|
4474
|
-
],
|
|
4475
|
+
], Kl = () => {
|
|
4475
4476
|
const [e, t] = A({
|
|
4476
4477
|
configCount: null,
|
|
4477
4478
|
projectCount: null,
|
|
@@ -4506,7 +4507,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4506
4507
|
/* @__PURE__ */ a(D, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ a(
|
|
4507
4508
|
ct,
|
|
4508
4509
|
{
|
|
4509
|
-
icon: /* @__PURE__ */ a(
|
|
4510
|
+
icon: /* @__PURE__ */ a(qr, {}),
|
|
4510
4511
|
label: "配置中心",
|
|
4511
4512
|
value: e.configCount,
|
|
4512
4513
|
suffix: "条",
|
|
@@ -4530,7 +4531,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4530
4531
|
/* @__PURE__ */ a(D, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ a(
|
|
4531
4532
|
ct,
|
|
4532
4533
|
{
|
|
4533
|
-
icon: /* @__PURE__ */ a(
|
|
4534
|
+
icon: /* @__PURE__ */ a(ir, {}),
|
|
4534
4535
|
label: "账号数",
|
|
4535
4536
|
value: e.userCount,
|
|
4536
4537
|
suffix: "人",
|
|
@@ -4552,9 +4553,9 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4552
4553
|
}
|
|
4553
4554
|
) })
|
|
4554
4555
|
] }),
|
|
4555
|
-
|
|
4556
|
+
Io.map((n) => /* @__PURE__ */ p("div", { style: { marginBottom: 32 }, children: [
|
|
4556
4557
|
/* @__PURE__ */ a(
|
|
4557
|
-
|
|
4558
|
+
rs,
|
|
4558
4559
|
{
|
|
4559
4560
|
color: n.color,
|
|
4560
4561
|
title: n.title,
|
|
@@ -4572,7 +4573,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4572
4573
|
xl: 6,
|
|
4573
4574
|
xxl: 6,
|
|
4574
4575
|
children: /* @__PURE__ */ a(
|
|
4575
|
-
|
|
4576
|
+
ss,
|
|
4576
4577
|
{
|
|
4577
4578
|
title: r.title,
|
|
4578
4579
|
description: r.description,
|
|
@@ -4588,7 +4589,7 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4588
4589
|
)) })
|
|
4589
4590
|
] }, n.key)),
|
|
4590
4591
|
/* @__PURE__ */ a(
|
|
4591
|
-
|
|
4592
|
+
as,
|
|
4592
4593
|
{
|
|
4593
4594
|
tag: "FOR ENGINEERS",
|
|
4594
4595
|
title: "把 Z-One Company 接入你的工作流",
|
|
@@ -4599,12 +4600,12 @@ const K = pn(), ql = pn(), gt = pn({ baseURL: "/api", timeout: 1e4 }), bt = (e)
|
|
|
4599
4600
|
)
|
|
4600
4601
|
] });
|
|
4601
4602
|
};
|
|
4602
|
-
let
|
|
4603
|
-
function
|
|
4604
|
-
return an.create({ baseURL:
|
|
4603
|
+
let $o = "/api";
|
|
4604
|
+
function Rr() {
|
|
4605
|
+
return an.create({ baseURL: $o, timeout: 15e3, withCredentials: !0 });
|
|
4605
4606
|
}
|
|
4606
|
-
const ot =
|
|
4607
|
-
|
|
4607
|
+
const ot = Rr(), Ao = Rr();
|
|
4608
|
+
Ao.interceptors.request.use((e) => e);
|
|
4608
4609
|
ot.interceptors.request.use((e) => e);
|
|
4609
4610
|
const vt = "/mock-platform", Q = (e, t) => ot.get(`${vt}${e}`, { params: t }).then((n) => n.data), Z = (e, t, n) => ot.post(`${vt}${e}`, t, { params: n }).then((r) => r.data), St = (e, t, n) => ot.put(`${vt}${e}`, t, { params: n }).then((r) => r.data), xe = (e, t) => ot.delete(`${vt}${e}`, { params: t }).then((n) => n.data), J = {
|
|
4610
4611
|
stats: () => Q("/stats"),
|
|
@@ -4671,7 +4672,7 @@ const vt = "/mock-platform", Q = (e, t) => ot.get(`${vt}${e}`, { params: t }).th
|
|
|
4671
4672
|
importBatch: (e) => Z("/openapi/import-batch", e),
|
|
4672
4673
|
sample: (e) => Q("/openapi/sample", { format: e })
|
|
4673
4674
|
}
|
|
4674
|
-
}, { Text: me, Paragraph:
|
|
4675
|
+
}, { Text: me, Paragraph: vo } = pe, Jn = { GET: "green", POST: "blue", PUT: "orange", DELETE: "red", PATCH: "purple" };
|
|
4675
4676
|
function en({ activeEnvCode: e }) {
|
|
4676
4677
|
const [t, n] = A([]), [r, s] = A(!1), [o, i] = A(null), [c, l] = A(!1), [d, u] = A(null), [m, h] = A(""), I = m.trim() ? t.filter((f) => `${f.path || ""} ${f.mock_code || ""}`.toLowerCase().includes(m.trim().toLowerCase())) : t;
|
|
4677
4678
|
X(() => {
|
|
@@ -4694,7 +4695,7 @@ function en({ activeEnvCode: e }) {
|
|
|
4694
4695
|
key: "path",
|
|
4695
4696
|
width: 280,
|
|
4696
4697
|
render: (f, $) => /* @__PURE__ */ p(U, { children: [
|
|
4697
|
-
/* @__PURE__ */ a(E, { color:
|
|
4698
|
+
/* @__PURE__ */ a(E, { color: Jn[$.method] || "default", children: $.method }),
|
|
4698
4699
|
/* @__PURE__ */ a(me, { code: !0, copyable: { text: f }, children: f })
|
|
4699
4700
|
] })
|
|
4700
4701
|
},
|
|
@@ -4843,7 +4844,7 @@ function en({ activeEnvCode: e }) {
|
|
|
4843
4844
|
tt,
|
|
4844
4845
|
{
|
|
4845
4846
|
title: /* @__PURE__ */ p(U, { children: [
|
|
4846
|
-
/* @__PURE__ */ a(
|
|
4847
|
+
/* @__PURE__ */ a(Gr, {}),
|
|
4847
4848
|
"端点详情: ",
|
|
4848
4849
|
d == null ? void 0 : d.mock_code
|
|
4849
4850
|
] }),
|
|
@@ -4854,7 +4855,7 @@ function en({ activeEnvCode: e }) {
|
|
|
4854
4855
|
/* @__PURE__ */ p(z, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
|
|
4855
4856
|
/* @__PURE__ */ a(z.Item, { label: "编码", children: d.mock_code }),
|
|
4856
4857
|
/* @__PURE__ */ a(z.Item, { label: "名称", children: d.mock_name }),
|
|
4857
|
-
/* @__PURE__ */ a(z.Item, { label: "方法", children: /* @__PURE__ */ a(E, { color:
|
|
4858
|
+
/* @__PURE__ */ a(z.Item, { label: "方法", children: /* @__PURE__ */ a(E, { color: Jn[d.method], children: d.method }) }),
|
|
4858
4859
|
/* @__PURE__ */ a(z.Item, { label: "环境", children: d.env_code }),
|
|
4859
4860
|
/* @__PURE__ */ a(z.Item, { label: "路径", span: 2, children: d.path }),
|
|
4860
4861
|
/* @__PURE__ */ a(z.Item, { label: "状态码", children: d.status_code }),
|
|
@@ -4872,7 +4873,7 @@ function en({ activeEnvCode: e }) {
|
|
|
4872
4873
|
/* @__PURE__ */ a(z.Item, { label: "状态", span: 2, children: d.status === 1 ? /* @__PURE__ */ a(E, { color: "green", children: "启用" }) : /* @__PURE__ */ a(E, { children: "禁用" }) }),
|
|
4873
4874
|
/* @__PURE__ */ a(z.Item, { label: "完整 URL", span: 2, children: /* @__PURE__ */ a(me, { copyable: !0, children: T(d) }) })
|
|
4874
4875
|
] }),
|
|
4875
|
-
/* @__PURE__ */ a(
|
|
4876
|
+
/* @__PURE__ */ a(vo, { strong: !0, children: "响应模板:" }),
|
|
4876
4877
|
/* @__PURE__ */ a("pre", { style: {
|
|
4877
4878
|
background: "#f5f5f5",
|
|
4878
4879
|
padding: 12,
|
|
@@ -4889,7 +4890,7 @@ function en({ activeEnvCode: e }) {
|
|
|
4889
4890
|
)
|
|
4890
4891
|
] });
|
|
4891
4892
|
}
|
|
4892
|
-
const { Text: qt } = pe,
|
|
4893
|
+
const { Text: qt } = pe, xo = { MOCK: "green", REAL: "blue", MIXED: "orange" };
|
|
4893
4894
|
function tn({ onEnvChange: e }) {
|
|
4894
4895
|
const [t, n] = A([]), [r, s] = A(!1), [o, i] = A(""), c = o.trim() ? t.filter((u) => `${u.env_code || ""} ${u.env_name || ""}`.toLowerCase().includes(o.trim().toLowerCase())) : t;
|
|
4895
4896
|
X(() => {
|
|
@@ -4919,7 +4920,7 @@ function tn({ onEnvChange: e }) {
|
|
|
4919
4920
|
dataIndex: "env_type",
|
|
4920
4921
|
key: "env_type",
|
|
4921
4922
|
width: 240,
|
|
4922
|
-
render: (u) => /* @__PURE__ */ a(E, { color:
|
|
4923
|
+
render: (u) => /* @__PURE__ */ a(E, { color: xo[u] || "default", children: u })
|
|
4923
4924
|
},
|
|
4924
4925
|
{
|
|
4925
4926
|
title: "真实服务地址",
|
|
@@ -5008,8 +5009,8 @@ function tn({ onEnvChange: e }) {
|
|
|
5008
5009
|
)
|
|
5009
5010
|
] });
|
|
5010
5011
|
}
|
|
5011
|
-
const { Text:
|
|
5012
|
-
function
|
|
5012
|
+
const { Text: Po } = pe;
|
|
5013
|
+
function Eo() {
|
|
5013
5014
|
const [e, t] = A([]), [n, r] = A(!1), [s, o] = A(!1), [i, c] = A(null), [l, d] = A(""), u = l.trim() ? e.filter((T) => `${T.scenario_code || ""} ${T.scenario_name || ""}`.toLowerCase().includes(l.trim().toLowerCase())) : e;
|
|
5014
5015
|
X(() => {
|
|
5015
5016
|
m();
|
|
@@ -5043,7 +5044,7 @@ function xo() {
|
|
|
5043
5044
|
dataIndex: "scenario_code",
|
|
5044
5045
|
key: "scenario_code",
|
|
5045
5046
|
width: 160,
|
|
5046
|
-
render: (T) => /* @__PURE__ */ a(
|
|
5047
|
+
render: (T) => /* @__PURE__ */ a(Po, { code: !0, children: T })
|
|
5047
5048
|
},
|
|
5048
5049
|
{ title: "场景名称", dataIndex: "scenario_name", key: "scenario_name", width: 200 },
|
|
5049
5050
|
{
|
|
@@ -5153,8 +5154,8 @@ function xo() {
|
|
|
5153
5154
|
)
|
|
5154
5155
|
] });
|
|
5155
5156
|
}
|
|
5156
|
-
const { Text: be } = pe, Bt = { PASS: "green", FAIL: "red", SKIP: "default" },
|
|
5157
|
-
function
|
|
5157
|
+
const { Text: be } = pe, Bt = { PASS: "green", FAIL: "red", SKIP: "default" }, Ro = { P0: "red", P1: "orange", P2: "blue", P3: "default" };
|
|
5158
|
+
function Oo() {
|
|
5158
5159
|
const [e, t] = A([]), [n, r] = A(!1), [s, o] = A([]), [i, c] = A(!1), [l, d] = A(null), [u, m] = A(null), [h, I] = A(!1), [O, T] = A(""), v = O.trim() ? e.filter((C) => `${C.case_code || ""} ${C.case_name || ""} ${C.request_url || ""}`.toLowerCase().includes(O.trim().toLowerCase())) : e;
|
|
5159
5160
|
X(() => {
|
|
5160
5161
|
f();
|
|
@@ -5223,7 +5224,7 @@ function Eo() {
|
|
|
5223
5224
|
key: "priority",
|
|
5224
5225
|
width: 80,
|
|
5225
5226
|
align: "center",
|
|
5226
|
-
render: (C) => /* @__PURE__ */ a(E, { color:
|
|
5227
|
+
render: (C) => /* @__PURE__ */ a(E, { color: Ro[C], children: C || "P1" })
|
|
5227
5228
|
},
|
|
5228
5229
|
{
|
|
5229
5230
|
title: "上次结果",
|
|
@@ -5291,7 +5292,7 @@ function Eo() {
|
|
|
5291
5292
|
M,
|
|
5292
5293
|
{
|
|
5293
5294
|
type: "primary",
|
|
5294
|
-
icon: /* @__PURE__ */ a(
|
|
5295
|
+
icon: /* @__PURE__ */ a(Jr, {}),
|
|
5295
5296
|
onClick: k,
|
|
5296
5297
|
disabled: s.length === 0,
|
|
5297
5298
|
children: [
|
|
@@ -5324,7 +5325,7 @@ function Eo() {
|
|
|
5324
5325
|
tt,
|
|
5325
5326
|
{
|
|
5326
5327
|
title: /* @__PURE__ */ p(U, { children: [
|
|
5327
|
-
/* @__PURE__ */ a(
|
|
5328
|
+
/* @__PURE__ */ a(Wr, {}),
|
|
5328
5329
|
"用例执行结果"
|
|
5329
5330
|
] }),
|
|
5330
5331
|
open: i,
|
|
@@ -5450,13 +5451,13 @@ function Eo() {
|
|
|
5450
5451
|
)
|
|
5451
5452
|
] });
|
|
5452
5453
|
}
|
|
5453
|
-
const { Text: Pe } = pe,
|
|
5454
|
+
const { Text: Pe } = pe, Wn = {
|
|
5454
5455
|
IDLE: "default",
|
|
5455
5456
|
RECORDING: "red",
|
|
5456
5457
|
STOPPED: "green",
|
|
5457
5458
|
EXPIRED: "gray"
|
|
5458
5459
|
};
|
|
5459
|
-
function
|
|
5460
|
+
function Mo() {
|
|
5460
5461
|
const [e, t] = A([]), [n, r] = A(!1), [s, o] = A(!1), [i, c] = A(null), [l, d] = A([]), [u, m] = A(""), h = u.trim() ? e.filter((v) => `${v.recording_code || ""} ${v.recording_name || ""} ${v.target_url || ""}`.toLowerCase().includes(u.trim().toLowerCase())) : e;
|
|
5461
5462
|
X(() => {
|
|
5462
5463
|
I();
|
|
@@ -5492,7 +5493,7 @@ function Ro() {
|
|
|
5492
5493
|
dataIndex: "record_status",
|
|
5493
5494
|
key: "record_status",
|
|
5494
5495
|
width: 110,
|
|
5495
|
-
render: (v) => /* @__PURE__ */ a(E, { color:
|
|
5496
|
+
render: (v) => /* @__PURE__ */ a(E, { color: Wn[v], children: v })
|
|
5496
5497
|
},
|
|
5497
5498
|
{
|
|
5498
5499
|
title: "请求数",
|
|
@@ -5584,7 +5585,7 @@ function Ro() {
|
|
|
5584
5585
|
/* @__PURE__ */ p(z, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
|
|
5585
5586
|
/* @__PURE__ */ a(z.Item, { label: "编码", children: i.recording_code }),
|
|
5586
5587
|
/* @__PURE__ */ a(z.Item, { label: "名称", children: i.recording_name }),
|
|
5587
|
-
/* @__PURE__ */ a(z.Item, { label: "状态", children: /* @__PURE__ */ a(E, { color:
|
|
5588
|
+
/* @__PURE__ */ a(z.Item, { label: "状态", children: /* @__PURE__ */ a(E, { color: Wn[i.record_status], children: i.record_status }) }),
|
|
5588
5589
|
/* @__PURE__ */ a(z.Item, { label: "请求数", children: i.total_requests }),
|
|
5589
5590
|
/* @__PURE__ */ a(z.Item, { label: "目标 URL", span: 2, children: /* @__PURE__ */ a(Pe, { copyable: !0, children: i.target_url }) }),
|
|
5590
5591
|
/* @__PURE__ */ a(z.Item, { label: "开始", children: i.start_time }),
|
|
@@ -5641,8 +5642,8 @@ function Ro() {
|
|
|
5641
5642
|
)
|
|
5642
5643
|
] });
|
|
5643
5644
|
}
|
|
5644
|
-
const { Text: Ee } = pe,
|
|
5645
|
-
function
|
|
5645
|
+
const { Text: Ee } = pe, No = { MOCK: "green", PROXY: "blue", 404: "red", 502: "orange" };
|
|
5646
|
+
function jo() {
|
|
5646
5647
|
const [e, t] = A([]), [n, r] = A(null), [s, o] = A(!1), [i, c] = A(null), [l, d] = A(!1), [u, m] = A(""), [h, I] = A();
|
|
5647
5648
|
X(() => {
|
|
5648
5649
|
O();
|
|
@@ -5716,7 +5717,7 @@ function Mo() {
|
|
|
5716
5717
|
dataIndex: "fallback_type",
|
|
5717
5718
|
key: "fallback_type",
|
|
5718
5719
|
width: 100,
|
|
5719
|
-
render: (f) => f ? /* @__PURE__ */ a(E, { color:
|
|
5720
|
+
render: (f) => f ? /* @__PURE__ */ a(E, { color: No[f], children: f }) : "-"
|
|
5720
5721
|
},
|
|
5721
5722
|
{
|
|
5722
5723
|
title: "耗时",
|
|
@@ -5791,7 +5792,7 @@ function Mo() {
|
|
|
5791
5792
|
B,
|
|
5792
5793
|
{
|
|
5793
5794
|
placeholder: "搜索路径",
|
|
5794
|
-
prefix: /* @__PURE__ */ a(
|
|
5795
|
+
prefix: /* @__PURE__ */ a(cr, {}),
|
|
5795
5796
|
allowClear: !0,
|
|
5796
5797
|
style: { width: 240 },
|
|
5797
5798
|
value: u,
|
|
@@ -5920,12 +5921,12 @@ function Mo() {
|
|
|
5920
5921
|
const { Text: le } = pe, Vn = [
|
|
5921
5922
|
{ key: "endpoints", label: "Mock 端点", component: en },
|
|
5922
5923
|
{ key: "environments", label: "环境 (MOCK/REAL/MIXED)", component: tn },
|
|
5923
|
-
{ key: "scenarios", label: "场景状态机", component:
|
|
5924
|
-
{ key: "cases", label: "测试用例", component:
|
|
5925
|
-
{ key: "recordings", label: "录制回放", component:
|
|
5926
|
-
{ key: "request-logs", label: "请求日志", component:
|
|
5924
|
+
{ key: "scenarios", label: "场景状态机", component: Eo },
|
|
5925
|
+
{ key: "cases", label: "测试用例", component: Oo },
|
|
5926
|
+
{ key: "recordings", label: "录制回放", component: Mo },
|
|
5927
|
+
{ key: "request-logs", label: "请求日志", component: jo }
|
|
5927
5928
|
];
|
|
5928
|
-
function
|
|
5929
|
+
function Uo() {
|
|
5929
5930
|
var u;
|
|
5930
5931
|
const [e, t] = A("endpoints"), [n, r] = A([]), [s, o] = A("default"), [i, c] = A(null);
|
|
5931
5932
|
X(() => {
|
|
@@ -5963,7 +5964,7 @@ function No() {
|
|
|
5963
5964
|
type: "card",
|
|
5964
5965
|
tabBarExtraContent: /* @__PURE__ */ p(U, { size: "large", wrap: !0, children: [
|
|
5965
5966
|
/* @__PURE__ */ p(U, { children: [
|
|
5966
|
-
/* @__PURE__ */ a(
|
|
5967
|
+
/* @__PURE__ */ a(Zr, {}),
|
|
5967
5968
|
/* @__PURE__ */ a(le, { children: "当前环境:" }),
|
|
5968
5969
|
/* @__PURE__ */ a(
|
|
5969
5970
|
te,
|
|
@@ -6018,13 +6019,13 @@ function No() {
|
|
|
6018
6019
|
)
|
|
6019
6020
|
] });
|
|
6020
6021
|
}
|
|
6021
|
-
const
|
|
6022
|
+
const Gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6022
6023
|
__proto__: null,
|
|
6023
|
-
default:
|
|
6024
|
-
}, Symbol.toStringTag, { value: "Module" })), { Text: Ge, Paragraph:
|
|
6024
|
+
default: Uo
|
|
6025
|
+
}, Symbol.toStringTag, { value: "Module" })), { Text: Ge, Paragraph: Jl } = pe, Zn = [
|
|
6025
6026
|
{
|
|
6026
6027
|
group: "基础数据",
|
|
6027
|
-
icon: /* @__PURE__ */ a(
|
|
6028
|
+
icon: /* @__PURE__ */ a(We, {}),
|
|
6028
6029
|
items: [
|
|
6029
6030
|
{ syntax: "@uuid", desc: "随机 UUID", example: "a3f2e1b7-8c4d-4e6f-9a1b-2c3d4e5f6a7b" },
|
|
6030
6031
|
{ syntax: "@int(1, 100)", desc: "随机整数(含边界)", example: "42" },
|
|
@@ -6077,7 +6078,7 @@ const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6077
6078
|
]
|
|
6078
6079
|
}
|
|
6079
6080
|
];
|
|
6080
|
-
function
|
|
6081
|
+
function Wl({ onInsert: e, form: t, formField: n = "responseTemplate" }) {
|
|
6081
6082
|
const [r, s] = A(""), o = (m) => {
|
|
6082
6083
|
var h;
|
|
6083
6084
|
try {
|
|
@@ -6099,32 +6100,32 @@ function Gl({ onInsert: e, form: t, formField: n = "responseTemplate" }) {
|
|
|
6099
6100
|
} catch {
|
|
6100
6101
|
x.warning("复制失败,请手动选择");
|
|
6101
6102
|
}
|
|
6102
|
-
}, c = r.toLowerCase(), l =
|
|
6103
|
+
}, c = r.toLowerCase(), l = Zn.map((m) => ({
|
|
6103
6104
|
...m,
|
|
6104
6105
|
items: m.items.filter(
|
|
6105
6106
|
(h) => !c || h.syntax.toLowerCase().includes(c) || h.desc.toLowerCase().includes(c) || h.example.toLowerCase().includes(c)
|
|
6106
6107
|
)
|
|
6107
|
-
})).filter((m) => m.items.length > 0), d =
|
|
6108
|
+
})).filter((m) => m.items.length > 0), d = Zn.reduce((m, h) => m + h.items.length, 0), u = l.reduce((m, h) => m + h.items.length, 0);
|
|
6108
6109
|
return /* @__PURE__ */ p(
|
|
6109
6110
|
F,
|
|
6110
6111
|
{
|
|
6111
6112
|
size: "small",
|
|
6112
6113
|
title: /* @__PURE__ */ p(U, { children: [
|
|
6113
|
-
/* @__PURE__ */ a(
|
|
6114
|
+
/* @__PURE__ */ a(We, {}),
|
|
6114
6115
|
/* @__PURE__ */ a(Ge, { strong: !0, children: "模板表达式" }),
|
|
6115
6116
|
/* @__PURE__ */ p(E, { color: "blue", children: [
|
|
6116
6117
|
u,
|
|
6117
6118
|
"/",
|
|
6118
6119
|
d
|
|
6119
6120
|
] }),
|
|
6120
|
-
/* @__PURE__ */ a(Oe, { title: "点击按钮即可插入到上方响应模板;点击 syntax 文本可复制", children: /* @__PURE__ */ a(
|
|
6121
|
+
/* @__PURE__ */ a(Oe, { title: "点击按钮即可插入到上方响应模板;点击 syntax 文本可复制", children: /* @__PURE__ */ a(Xr, { style: { color: "#999" } }) })
|
|
6121
6122
|
] }),
|
|
6122
6123
|
extra: /* @__PURE__ */ a(
|
|
6123
6124
|
B,
|
|
6124
6125
|
{
|
|
6125
6126
|
size: "small",
|
|
6126
6127
|
placeholder: "搜索 @ 表达式",
|
|
6127
|
-
prefix: /* @__PURE__ */ a(
|
|
6128
|
+
prefix: /* @__PURE__ */ a(cr, {}),
|
|
6128
6129
|
value: r,
|
|
6129
6130
|
onChange: (m) => s(m.target.value),
|
|
6130
6131
|
style: { width: 180 },
|
|
@@ -6170,7 +6171,7 @@ function Gl({ onInsert: e, form: t, formField: n = "responseTemplate" }) {
|
|
|
6170
6171
|
{
|
|
6171
6172
|
size: "small",
|
|
6172
6173
|
type: "text",
|
|
6173
|
-
icon: /* @__PURE__ */ a(
|
|
6174
|
+
icon: /* @__PURE__ */ a(Yr, {}),
|
|
6174
6175
|
onClick: () => o(h.syntax)
|
|
6175
6176
|
}
|
|
6176
6177
|
) })
|
|
@@ -6182,8 +6183,8 @@ function Gl({ onInsert: e, form: t, formField: n = "responseTemplate" }) {
|
|
|
6182
6183
|
}
|
|
6183
6184
|
);
|
|
6184
6185
|
}
|
|
6185
|
-
const { TextArea:
|
|
6186
|
-
function
|
|
6186
|
+
const { TextArea: Yn } = B, { Text: Re, Paragraph: zo } = pe;
|
|
6187
|
+
function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
6187
6188
|
const [s, o] = A(""), [i, c] = A(null), [l, d] = A(null), [u, m] = A(!1), [h, I] = A(null), [O, T] = A(!1), [v, f] = A("import"), [$] = j.useForm(), [k] = j.useForm(), P = () => {
|
|
6188
6189
|
o(""), c(null), d(null), I(null), $.resetFields(), k.resetFields();
|
|
6189
6190
|
}, C = () => {
|
|
@@ -6196,13 +6197,13 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6196
6197
|
}
|
|
6197
6198
|
d(null), c(null), I(null);
|
|
6198
6199
|
try {
|
|
6199
|
-
const
|
|
6200
|
-
|
|
6201
|
-
caseName: `from-curl-${((L =
|
|
6200
|
+
const V = await J.curl.parse(s);
|
|
6201
|
+
V.success ? (c(V.data), $.setFieldsValue({
|
|
6202
|
+
caseName: `from-curl-${((L = V.data) == null ? void 0 : L.method) || "GET"}-${(((R = V.data) == null ? void 0 : R.path) || "").replace(/\W+/g, "-")}`,
|
|
6202
6203
|
caseGroup: "imported",
|
|
6203
6204
|
envCode: r[0] || "default"
|
|
6204
6205
|
}), k.setFieldsValue({
|
|
6205
|
-
mockName: `mock-${((G =
|
|
6206
|
+
mockName: `mock-${((G = V.data) == null ? void 0 : G.method) || "GET"}-${(((re = V.data) == null ? void 0 : re.path) || "").replace(/\W+/g, "-")}`,
|
|
6206
6207
|
envCode: r[0] || "default",
|
|
6207
6208
|
projectCode: "default",
|
|
6208
6209
|
responseTemplate: `{
|
|
@@ -6210,9 +6211,9 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6210
6211
|
"message": "ok",
|
|
6211
6212
|
"data": {}
|
|
6212
6213
|
}`
|
|
6213
|
-
})) : d(
|
|
6214
|
-
} catch (
|
|
6215
|
-
d(String((
|
|
6214
|
+
})) : d(V.message || "解析失败");
|
|
6215
|
+
} catch (V) {
|
|
6216
|
+
d(String((V == null ? void 0 : V.message) || V));
|
|
6216
6217
|
}
|
|
6217
6218
|
}, H = async () => {
|
|
6218
6219
|
if (!s.trim()) {
|
|
@@ -6284,7 +6285,7 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6284
6285
|
je,
|
|
6285
6286
|
{
|
|
6286
6287
|
title: /* @__PURE__ */ p(U, { children: [
|
|
6287
|
-
/* @__PURE__ */ a(
|
|
6288
|
+
/* @__PURE__ */ a(We, {}),
|
|
6288
6289
|
" 粘贴 curl 一键导入"
|
|
6289
6290
|
] }),
|
|
6290
6291
|
open: e,
|
|
@@ -6293,9 +6294,9 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6293
6294
|
size: "large",
|
|
6294
6295
|
destroyOnHidden: !0,
|
|
6295
6296
|
children: [
|
|
6296
|
-
/* @__PURE__ */ a(
|
|
6297
|
+
/* @__PURE__ */ a(zo, { type: "secondary", style: { marginBottom: 12 }, children: "从浏览器 DevTools / Postman / 终端复制 curl 命令,粘贴到下方即可解析、试跑、入库。" }),
|
|
6297
6298
|
/* @__PURE__ */ a(
|
|
6298
|
-
|
|
6299
|
+
Yn,
|
|
6299
6300
|
{
|
|
6300
6301
|
value: s,
|
|
6301
6302
|
onChange: (L) => o(L.target.value),
|
|
@@ -6313,7 +6314,7 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6313
6314
|
] }),
|
|
6314
6315
|
l && /* @__PURE__ */ a(ee, { type: "error", showIcon: !0, style: { marginTop: 12 }, title: "解析失败", description: l }),
|
|
6315
6316
|
i && /* @__PURE__ */ a(F, { size: "small", style: { marginTop: 16 }, title: "解析结果", children: /* @__PURE__ */ p(z, { column: 1, size: "small", bordered: !0, children: [
|
|
6316
|
-
/* @__PURE__ */ a(z.Item, { label: "Method", children: /* @__PURE__ */ a(E, { color:
|
|
6317
|
+
/* @__PURE__ */ a(z.Item, { label: "Method", children: /* @__PURE__ */ a(E, { color: Lo(i.method), children: i.method }) }),
|
|
6317
6318
|
/* @__PURE__ */ a(z.Item, { label: "URL", children: /* @__PURE__ */ a(Re, { code: !0, copyable: !0, children: i.url }) }),
|
|
6318
6319
|
/* @__PURE__ */ a(z.Item, { label: "Path", children: /* @__PURE__ */ a(Re, { code: !0, children: i.path }) }),
|
|
6319
6320
|
i.query && /* @__PURE__ */ a(z.Item, { label: "Query", children: /* @__PURE__ */ a(Re, { code: !0, children: i.query }) }),
|
|
@@ -6390,7 +6391,7 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6390
6391
|
{
|
|
6391
6392
|
key: "mock",
|
|
6392
6393
|
label: /* @__PURE__ */ p("span", { children: [
|
|
6393
|
-
/* @__PURE__ */ a(
|
|
6394
|
+
/* @__PURE__ */ a(We, {}),
|
|
6394
6395
|
" 导入为 Mock 端点"
|
|
6395
6396
|
] }),
|
|
6396
6397
|
children: /* @__PURE__ */ p(j, { form: k, layout: "vertical", children: [
|
|
@@ -6400,7 +6401,7 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6400
6401
|
/* @__PURE__ */ a(D, { span: 6, children: /* @__PURE__ */ a(j.Item, { name: "projectCode", label: "项目", children: /* @__PURE__ */ a(B, {}) }) })
|
|
6401
6402
|
] }),
|
|
6402
6403
|
/* @__PURE__ */ a(j.Item, { name: "responseTemplate", label: "响应模板 (JSON)", children: /* @__PURE__ */ a(
|
|
6403
|
-
|
|
6404
|
+
Yn,
|
|
6404
6405
|
{
|
|
6405
6406
|
autoSize: { minRows: 3, maxRows: 8 },
|
|
6406
6407
|
style: { fontFamily: "Menlo, Monaco, monospace" }
|
|
@@ -6412,7 +6413,7 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6412
6413
|
type: "primary",
|
|
6413
6414
|
onClick: _,
|
|
6414
6415
|
loading: O,
|
|
6415
|
-
icon: /* @__PURE__ */ a(
|
|
6416
|
+
icon: /* @__PURE__ */ a(We, {}),
|
|
6416
6417
|
children: "保存为 Mock 端点"
|
|
6417
6418
|
}
|
|
6418
6419
|
)
|
|
@@ -6425,12 +6426,12 @@ function Jl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6425
6426
|
}
|
|
6426
6427
|
);
|
|
6427
6428
|
}
|
|
6428
|
-
function
|
|
6429
|
+
function Lo(e) {
|
|
6429
6430
|
return { GET: "blue", POST: "green", PUT: "orange", DELETE: "red", PATCH: "purple" }[e] || "default";
|
|
6430
6431
|
}
|
|
6431
|
-
const { TextArea:
|
|
6432
|
-
function
|
|
6433
|
-
const [s, o] = A("paste"), [i, c] = A(""), [l, d] = A(null), [u, m] = A(null), [h, I] = A(!1), [O, T] = A([]), [v, f] = A(!1), [$] = j.useForm(), k =
|
|
6432
|
+
const { TextArea: Xn } = B;
|
|
6433
|
+
function Zl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
6434
|
+
const [s, o] = A("paste"), [i, c] = A(""), [l, d] = A(null), [u, m] = A(null), [h, I] = A(!1), [O, T] = A([]), [v, f] = A(!1), [$] = j.useForm(), k = rr(null), P = () => {
|
|
6434
6435
|
c(""), d(null), m(null), T([]), $.resetFields();
|
|
6435
6436
|
}, C = () => {
|
|
6436
6437
|
P(), t();
|
|
@@ -6469,8 +6470,8 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6469
6470
|
}, w = (R) => {
|
|
6470
6471
|
const G = new FileReader();
|
|
6471
6472
|
return G.onload = (re) => {
|
|
6472
|
-
var
|
|
6473
|
-
c(String(((
|
|
6473
|
+
var V;
|
|
6474
|
+
c(String(((V = re.target) == null ? void 0 : V.result) || "")), x.success(`已读取 ${R.name}(${(R.size / 1024).toFixed(1)}KB)`);
|
|
6474
6475
|
}, G.onerror = () => x.error("文件读取失败"), G.readAsText(R), !1;
|
|
6475
6476
|
}, _ = async () => {
|
|
6476
6477
|
if (!l) {
|
|
@@ -6485,10 +6486,10 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6485
6486
|
}
|
|
6486
6487
|
f(!0);
|
|
6487
6488
|
try {
|
|
6488
|
-
const G = (l.endpoints || []).map((
|
|
6489
|
-
method:
|
|
6490
|
-
path:
|
|
6491
|
-
})).filter((
|
|
6489
|
+
const G = (l.endpoints || []).map((V, mn) => ({
|
|
6490
|
+
method: V.method,
|
|
6491
|
+
path: V.path
|
|
6492
|
+
})).filter((V, mn) => O.includes(mn)), re = await J.openapi.importBatch({
|
|
6492
6493
|
content: i,
|
|
6493
6494
|
selected: G,
|
|
6494
6495
|
envCode: R.envCode,
|
|
@@ -6509,7 +6510,7 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6509
6510
|
title: "Method",
|
|
6510
6511
|
dataIndex: "method",
|
|
6511
6512
|
width: 90,
|
|
6512
|
-
render: (R) => /* @__PURE__ */ a(E, { color:
|
|
6513
|
+
render: (R) => /* @__PURE__ */ a(E, { color: Do(R), children: R })
|
|
6513
6514
|
},
|
|
6514
6515
|
{ title: "Path", dataIndex: "path", width: 240, ellipsis: !0 },
|
|
6515
6516
|
{ title: "Summary", dataIndex: "summary", ellipsis: !0 },
|
|
@@ -6561,7 +6562,7 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6561
6562
|
] }),
|
|
6562
6563
|
children: /* @__PURE__ */ p("div", { children: [
|
|
6563
6564
|
/* @__PURE__ */ a(
|
|
6564
|
-
|
|
6565
|
+
Xn,
|
|
6565
6566
|
{
|
|
6566
6567
|
value: i,
|
|
6567
6568
|
onChange: (R) => c(R.target.value),
|
|
@@ -6580,11 +6581,11 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6580
6581
|
{
|
|
6581
6582
|
key: "upload",
|
|
6582
6583
|
label: /* @__PURE__ */ p("span", { children: [
|
|
6583
|
-
/* @__PURE__ */ a(
|
|
6584
|
+
/* @__PURE__ */ a(Qr, {}),
|
|
6584
6585
|
" 上传文件"
|
|
6585
6586
|
] }),
|
|
6586
6587
|
children: /* @__PURE__ */ p(
|
|
6587
|
-
|
|
6588
|
+
jr.Dragger,
|
|
6588
6589
|
{
|
|
6589
6590
|
ref: k,
|
|
6590
6591
|
accept: ".json,.yaml,.yml,application/json,text/yaml",
|
|
@@ -6645,7 +6646,7 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6645
6646
|
/* @__PURE__ */ a(D, { span: 4, children: /* @__PURE__ */ a(j.Item, { name: "tagPrefix", label: "Tag 前缀", children: /* @__PURE__ */ a(B, {}) }) })
|
|
6646
6647
|
] }),
|
|
6647
6648
|
/* @__PURE__ */ a(j.Item, { name: "defaultResponse", label: "默认响应(无 example 时使用)", children: /* @__PURE__ */ a(
|
|
6648
|
-
|
|
6649
|
+
Xn,
|
|
6649
6650
|
{
|
|
6650
6651
|
autoSize: { minRows: 3, maxRows: 6 },
|
|
6651
6652
|
style: { fontFamily: "Menlo, Monaco, monospace" }
|
|
@@ -6672,22 +6673,22 @@ function Vl({ open: e, onClose: t, onSuccess: n, envOptions: r = [] }) {
|
|
|
6672
6673
|
}
|
|
6673
6674
|
);
|
|
6674
6675
|
}
|
|
6675
|
-
function
|
|
6676
|
+
function Do(e) {
|
|
6676
6677
|
return { GET: "blue", POST: "green", PUT: "orange", DELETE: "red", PATCH: "purple" }[e] || "default";
|
|
6677
6678
|
}
|
|
6678
|
-
const
|
|
6679
|
+
const Fo = {
|
|
6679
6680
|
STANDARD_JSON: { label: "标准 JSON", color: "blue" },
|
|
6680
6681
|
RSS_XML: { label: "RSS 2.0", color: "orange" },
|
|
6681
6682
|
ATOM_XML: { label: "Atom 1.0", color: "gold" },
|
|
6682
6683
|
CUSTOM_SCRIPT: { label: "自定义脚本", color: "purple" },
|
|
6683
6684
|
INTERNAL_BEAN: { label: "内部 Bean", color: "cyan" }
|
|
6684
|
-
},
|
|
6685
|
+
}, qo = {
|
|
6685
6686
|
PENDING_VERIFY: { color: "default", text: "待验证" },
|
|
6686
6687
|
VERIFIED: { color: "green", text: "已验证" },
|
|
6687
6688
|
INVALID_AUTH: { color: "red", text: "鉴权失败" },
|
|
6688
6689
|
FATAL: { color: "red", text: "永久失败" },
|
|
6689
6690
|
DISABLED: { color: "default", text: "已停用" }
|
|
6690
|
-
},
|
|
6691
|
+
}, Qn = {
|
|
6691
6692
|
PENDING: { color: "default" },
|
|
6692
6693
|
RUNNING: { color: "processing" },
|
|
6693
6694
|
SUCCESS: { color: "green" },
|
|
@@ -6695,7 +6696,7 @@ const Lo = {
|
|
|
6695
6696
|
FAILED: { color: "red" },
|
|
6696
6697
|
FATAL: { color: "red" }
|
|
6697
6698
|
};
|
|
6698
|
-
function
|
|
6699
|
+
function Bo() {
|
|
6699
6700
|
const e = rt(), [t, n] = A([]), [r, s] = A(!1), [o, i] = A(null), [c, l] = A([]), [d, u] = A({}), [m, h] = A(null), [I, O] = A([]), T = async () => {
|
|
6700
6701
|
s(!0);
|
|
6701
6702
|
try {
|
|
@@ -6713,7 +6714,7 @@ function Fo() {
|
|
|
6713
6714
|
const v = (w) => {
|
|
6714
6715
|
je.confirm({
|
|
6715
6716
|
title: "确认删除",
|
|
6716
|
-
icon: /* @__PURE__ */ a(
|
|
6717
|
+
icon: /* @__PURE__ */ a(es, {}),
|
|
6717
6718
|
content: `确定要删除订阅 "${w.name}" 吗? 运行历史会保留.`,
|
|
6718
6719
|
onOk: async () => {
|
|
6719
6720
|
try {
|
|
@@ -6827,7 +6828,7 @@ function Fo() {
|
|
|
6827
6828
|
dataIndex: "extractorType",
|
|
6828
6829
|
width: 140,
|
|
6829
6830
|
render: (w) => {
|
|
6830
|
-
const _ =
|
|
6831
|
+
const _ = Fo[w] || { label: w, color: "default" };
|
|
6831
6832
|
return /* @__PURE__ */ a(E, { color: _.color, children: _.label });
|
|
6832
6833
|
}
|
|
6833
6834
|
},
|
|
@@ -6842,7 +6843,7 @@ function Fo() {
|
|
|
6842
6843
|
dataIndex: "status",
|
|
6843
6844
|
width: 110,
|
|
6844
6845
|
render: (w) => {
|
|
6845
|
-
const _ =
|
|
6846
|
+
const _ = qo[w] || { color: "default", text: w };
|
|
6846
6847
|
return /* @__PURE__ */ a(E, { color: _.color, children: _.text });
|
|
6847
6848
|
}
|
|
6848
6849
|
},
|
|
@@ -6858,7 +6859,7 @@ function Fo() {
|
|
|
6858
6859
|
width: 110,
|
|
6859
6860
|
render: (w, _) => {
|
|
6860
6861
|
var L;
|
|
6861
|
-
return w ? /* @__PURE__ */ a(Oe, { title: _.lastError || "", children: /* @__PURE__ */ a(E, { color: ((L =
|
|
6862
|
+
return w ? /* @__PURE__ */ a(Oe, { title: _.lastError || "", children: /* @__PURE__ */ a(E, { color: ((L = Qn[w]) == null ? void 0 : L.color) || "default", children: w }) }) : /* @__PURE__ */ a("span", { style: { color: "#ccc" }, children: "-" });
|
|
6862
6863
|
}
|
|
6863
6864
|
},
|
|
6864
6865
|
{
|
|
@@ -6951,7 +6952,7 @@ function Fo() {
|
|
|
6951
6952
|
M,
|
|
6952
6953
|
{
|
|
6953
6954
|
type: "primary",
|
|
6954
|
-
icon: /* @__PURE__ */ a(
|
|
6955
|
+
icon: /* @__PURE__ */ a(lr, {}),
|
|
6955
6956
|
onClick: () => e("/subscribe/new"),
|
|
6956
6957
|
children: "新建订阅"
|
|
6957
6958
|
}
|
|
@@ -7006,7 +7007,7 @@ function Fo() {
|
|
|
7006
7007
|
width: 90,
|
|
7007
7008
|
render: (w) => {
|
|
7008
7009
|
var _;
|
|
7009
|
-
return /* @__PURE__ */ a(E, { color: (_ =
|
|
7010
|
+
return /* @__PURE__ */ a(E, { color: (_ = Qn[w]) == null ? void 0 : _.color, children: w });
|
|
7010
7011
|
}
|
|
7011
7012
|
},
|
|
7012
7013
|
{
|
|
@@ -7106,12 +7107,12 @@ function Fo() {
|
|
|
7106
7107
|
}
|
|
7107
7108
|
]
|
|
7108
7109
|
}
|
|
7109
|
-
) : /* @__PURE__ */ a(
|
|
7110
|
+
) : /* @__PURE__ */ a(Ho, { result: o == null ? void 0 : o.result })
|
|
7110
7111
|
}
|
|
7111
7112
|
)
|
|
7112
7113
|
] });
|
|
7113
7114
|
}
|
|
7114
|
-
function
|
|
7115
|
+
function Ho({ result: e }) {
|
|
7115
7116
|
return e ? e.success ? /* @__PURE__ */ p(U, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
7116
7117
|
/* @__PURE__ */ a(F, { size: "small", title: "调用结果", children: /* @__PURE__ */ p(U, { size: "large", wrap: !0, children: [
|
|
7117
7118
|
/* @__PURE__ */ p("span", { children: [
|
|
@@ -7156,26 +7157,26 @@ function qo({ result: e }) {
|
|
|
7156
7157
|
e.fieldErrors && e.fieldErrors.length > 0 && /* @__PURE__ */ a(ee, { type: "warning", showIcon: !0, message: "字段问题", description: /* @__PURE__ */ a("ul", { children: e.fieldErrors.map((t, n) => /* @__PURE__ */ a("li", { children: t }, n)) }) })
|
|
7157
7158
|
] }) : /* @__PURE__ */ a(ee, { type: "error", showIcon: !0, title: "试运行失败", description: e.errorMessage || "未知错误" }) : null;
|
|
7158
7159
|
}
|
|
7159
|
-
const
|
|
7160
|
+
const Ko = [
|
|
7160
7161
|
{ value: "STANDARD_JSON", label: "标准 JSON (按统一契约返回的 JSON)" },
|
|
7161
7162
|
{ value: "RSS_XML", label: "RSS 2.0 (XML feed)" },
|
|
7162
7163
|
{ value: "ATOM_XML", label: "Atom 1.0 (XML feed)" },
|
|
7163
7164
|
{ value: "CUSTOM_SCRIPT", label: "自定义脚本 (z-script 平台)" },
|
|
7164
7165
|
{ value: "INTERNAL_BEAN", label: "内部 Bean (我们自己的模块, 暂未启用)" }
|
|
7165
|
-
],
|
|
7166
|
+
], Go = [
|
|
7166
7167
|
{ value: "NONE", label: "无鉴权" },
|
|
7167
7168
|
{ value: "BEARER", label: "Bearer (Authorization: Bearer xxx)" },
|
|
7168
7169
|
{ value: "API_KEY", label: "API Key (Authorization: xxx)" },
|
|
7169
7170
|
{ value: "BASIC", label: "Basic (user:password base64)" }
|
|
7170
|
-
],
|
|
7171
|
+
], Jo = [
|
|
7171
7172
|
{ label: "每 5 分钟", value: "0 */5 * * * ?" },
|
|
7172
7173
|
{ label: "每 15 分钟", value: "0 */15 * * * ?" },
|
|
7173
7174
|
{ label: "每小时", value: "0 0 * * * ?" },
|
|
7174
7175
|
{ label: "每 6 小时", value: "0 0 */6 * * ?" },
|
|
7175
7176
|
{ label: "每天 8 点", value: "0 0 8 * * ?" }
|
|
7176
7177
|
];
|
|
7177
|
-
function
|
|
7178
|
-
const { id: e } =
|
|
7178
|
+
function er() {
|
|
7179
|
+
const { id: e } = sr(), t = rt(), n = !!e, [r] = j.useForm(), [s, o] = A(!1), [i, c] = A(!1), [l, d] = A([]), [u, m] = A([]), h = j.useWatch("sourceType", r), I = j.useWatch("extractorType", r), O = j.useWatch("authType", r);
|
|
7179
7180
|
X(() => {
|
|
7180
7181
|
T(), v(), n && f();
|
|
7181
7182
|
}, [e]);
|
|
@@ -7233,7 +7234,7 @@ function Qn() {
|
|
|
7233
7234
|
back: !0,
|
|
7234
7235
|
extra: /* @__PURE__ */ p(U, { children: [
|
|
7235
7236
|
/* @__PURE__ */ a(M, { onClick: () => t("/subscribe/list"), children: "取消" }),
|
|
7236
|
-
/* @__PURE__ */ a(M, { type: "primary", icon: /* @__PURE__ */ a(
|
|
7237
|
+
/* @__PURE__ */ a(M, { type: "primary", icon: /* @__PURE__ */ a(dr, {}), loading: i, onClick: $, children: "保存 (自动验证)" })
|
|
7237
7238
|
] })
|
|
7238
7239
|
}
|
|
7239
7240
|
),
|
|
@@ -7285,7 +7286,7 @@ function Qn() {
|
|
|
7285
7286
|
] })
|
|
7286
7287
|
] }),
|
|
7287
7288
|
/* @__PURE__ */ p(F, { type: "inner", title: "鉴权 (从 z-mist 拉取 secret)", style: { marginBottom: 16 }, children: [
|
|
7288
|
-
/* @__PURE__ */ a(j.Item, { label: "鉴权方式", name: "authType", children: /* @__PURE__ */ a(te, { options:
|
|
7289
|
+
/* @__PURE__ */ a(j.Item, { label: "鉴权方式", name: "authType", children: /* @__PURE__ */ a(te, { options: Go }) }),
|
|
7289
7290
|
O && O !== "NONE" && /* @__PURE__ */ a(
|
|
7290
7291
|
j.Item,
|
|
7291
7292
|
{
|
|
@@ -7315,7 +7316,7 @@ function Qn() {
|
|
|
7315
7316
|
name: "extractorType",
|
|
7316
7317
|
rules: [{ required: !0 }],
|
|
7317
7318
|
extra: "STANDARD_JSON/RSS_XML/ATOM_XML 直接解析; CUSTOM_SCRIPT 调 z-script 平台",
|
|
7318
|
-
children: /* @__PURE__ */ a(te, { options:
|
|
7319
|
+
children: /* @__PURE__ */ a(te, { options: Ko })
|
|
7319
7320
|
}
|
|
7320
7321
|
),
|
|
7321
7322
|
I === "CUSTOM_SCRIPT" && /* @__PURE__ */ a(
|
|
@@ -7352,7 +7353,7 @@ function Qn() {
|
|
|
7352
7353
|
{
|
|
7353
7354
|
style: { width: 140 },
|
|
7354
7355
|
placeholder: "常用",
|
|
7355
|
-
options:
|
|
7356
|
+
options: Jo,
|
|
7356
7357
|
onChange: (k) => r.setFieldValue("cronExpr", k),
|
|
7357
7358
|
value: null
|
|
7358
7359
|
}
|
|
@@ -7389,7 +7390,7 @@ function Qn() {
|
|
|
7389
7390
|
) }) })
|
|
7390
7391
|
] });
|
|
7391
7392
|
}
|
|
7392
|
-
const
|
|
7393
|
+
const Wo = {
|
|
7393
7394
|
PENDING: "default",
|
|
7394
7395
|
RUNNING: "processing",
|
|
7395
7396
|
SUCCESS: "green",
|
|
@@ -7397,7 +7398,7 @@ const Go = {
|
|
|
7397
7398
|
FAILED: "red",
|
|
7398
7399
|
FATAL: "red"
|
|
7399
7400
|
};
|
|
7400
|
-
function
|
|
7401
|
+
function Vo() {
|
|
7401
7402
|
const [e, t] = A([]), [n, r] = A(null), [s, o] = A([]), [i, c] = A([]), [l, d] = A(null), [u, m] = A(!1);
|
|
7402
7403
|
X(() => {
|
|
7403
7404
|
h();
|
|
@@ -7439,7 +7440,7 @@ function Jo() {
|
|
|
7439
7440
|
}
|
|
7440
7441
|
),
|
|
7441
7442
|
/* @__PURE__ */ a(
|
|
7442
|
-
|
|
7443
|
+
os,
|
|
7443
7444
|
{
|
|
7444
7445
|
left: /* @__PURE__ */ a(
|
|
7445
7446
|
te,
|
|
@@ -7509,7 +7510,7 @@ function Jo() {
|
|
|
7509
7510
|
title: "状态",
|
|
7510
7511
|
dataIndex: "status",
|
|
7511
7512
|
width: 80,
|
|
7512
|
-
render: ($) => /* @__PURE__ */ a(E, { color:
|
|
7513
|
+
render: ($) => /* @__PURE__ */ a(E, { color: Wo[$], children: $ })
|
|
7513
7514
|
},
|
|
7514
7515
|
{
|
|
7515
7516
|
title: "拉取/成功/死信",
|
|
@@ -7568,25 +7569,25 @@ function Jo() {
|
|
|
7568
7569
|
] })
|
|
7569
7570
|
] });
|
|
7570
7571
|
}
|
|
7571
|
-
function
|
|
7572
|
-
return /* @__PURE__ */ p(
|
|
7573
|
-
/* @__PURE__ */ a(ue, { index: !0, element: /* @__PURE__ */ a(
|
|
7574
|
-
/* @__PURE__ */ a(ue, { path: "list", element: /* @__PURE__ */ a(
|
|
7575
|
-
/* @__PURE__ */ a(ue, { path: "new", element: /* @__PURE__ */ a(
|
|
7576
|
-
/* @__PURE__ */ a(ue, { path: "edit/:id", element: /* @__PURE__ */ a(
|
|
7577
|
-
/* @__PURE__ */ a(ue, { path: "runs", element: /* @__PURE__ */ a(
|
|
7572
|
+
function Zo() {
|
|
7573
|
+
return /* @__PURE__ */ p(ar, { children: [
|
|
7574
|
+
/* @__PURE__ */ a(ue, { index: !0, element: /* @__PURE__ */ a(or, { to: "list", replace: !0 }) }),
|
|
7575
|
+
/* @__PURE__ */ a(ue, { path: "list", element: /* @__PURE__ */ a(Bo, {}) }),
|
|
7576
|
+
/* @__PURE__ */ a(ue, { path: "new", element: /* @__PURE__ */ a(er, {}) }),
|
|
7577
|
+
/* @__PURE__ */ a(ue, { path: "edit/:id", element: /* @__PURE__ */ a(er, {}) }),
|
|
7578
|
+
/* @__PURE__ */ a(ue, { path: "runs", element: /* @__PURE__ */ a(Vo, {}) })
|
|
7578
7579
|
] });
|
|
7579
7580
|
}
|
|
7580
|
-
const
|
|
7581
|
+
const Yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7581
7582
|
__proto__: null,
|
|
7582
|
-
default:
|
|
7583
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
7583
|
+
default: Zo
|
|
7584
|
+
}, Symbol.toStringTag, { value: "Module" })), Yo = {
|
|
7584
7585
|
OPEN: { color: "blue", text: "待开始" },
|
|
7585
7586
|
IN_PROGRESS: { color: "green", text: "进行中" },
|
|
7586
7587
|
COMPLETED: { color: "default", text: "已完成" },
|
|
7587
7588
|
ARCHIVED: { color: "default", text: "已归档" }
|
|
7588
7589
|
};
|
|
7589
|
-
function
|
|
7590
|
+
function Xo() {
|
|
7590
7591
|
const e = rt(), [t, n] = A("mine"), [r, s] = A([]), [o, i] = A(!1), [c, l] = A(null), d = async () => {
|
|
7591
7592
|
i(!0), l(null);
|
|
7592
7593
|
try {
|
|
@@ -7618,7 +7619,7 @@ function Zo() {
|
|
|
7618
7619
|
breadcrumb: [{ label: "项目中心" }]
|
|
7619
7620
|
}
|
|
7620
7621
|
),
|
|
7621
|
-
c && !o && /* @__PURE__ */ a("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ a(
|
|
7622
|
+
c && !o && /* @__PURE__ */ a("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ a(is, { error: c, onRetry: d }) }),
|
|
7622
7623
|
/* @__PURE__ */ p("div", { style: {
|
|
7623
7624
|
background: "#ffffff",
|
|
7624
7625
|
borderRadius: 16,
|
|
@@ -7636,7 +7637,7 @@ function Zo() {
|
|
|
7636
7637
|
M,
|
|
7637
7638
|
{
|
|
7638
7639
|
type: "primary",
|
|
7639
|
-
icon: /* @__PURE__ */ a(
|
|
7640
|
+
icon: /* @__PURE__ */ a(lr, {}),
|
|
7640
7641
|
onClick: () => e("/project/new"),
|
|
7641
7642
|
children: "新建项目"
|
|
7642
7643
|
}
|
|
@@ -7676,7 +7677,7 @@ function Zo() {
|
|
|
7676
7677
|
dataIndex: "status",
|
|
7677
7678
|
width: 100,
|
|
7678
7679
|
render: (h) => {
|
|
7679
|
-
const I =
|
|
7680
|
+
const I = Yo[h] || { color: "default", text: h };
|
|
7680
7681
|
return /* @__PURE__ */ a(E, { color: I.color, children: I.text });
|
|
7681
7682
|
}
|
|
7682
7683
|
},
|
|
@@ -7727,15 +7728,15 @@ function Zo() {
|
|
|
7727
7728
|
] })
|
|
7728
7729
|
] });
|
|
7729
7730
|
}
|
|
7730
|
-
const
|
|
7731
|
+
const Qo = [
|
|
7731
7732
|
{ value: "general", label: "通用助手" },
|
|
7732
7733
|
{ value: "analyst", label: "分析师" },
|
|
7733
7734
|
{ value: "writer", label: "写手" },
|
|
7734
7735
|
{ value: "pm", label: "产品经理" },
|
|
7735
7736
|
{ value: "ops", label: "运营" }
|
|
7736
7737
|
];
|
|
7737
|
-
function
|
|
7738
|
-
const e = rt(), [t] =
|
|
7738
|
+
function ei() {
|
|
7739
|
+
const e = rt(), [t] = Dr(), [n] = j.useForm(), [r, s] = A(!1), [o, i] = A("from-subscribe"), [c, l] = A([]), [d, u] = A([]), [m, h] = A(!1), [I, O] = A([]), [T, v] = A(null);
|
|
7739
7740
|
X(() => {
|
|
7740
7741
|
const P = t.get("subscriptionId"), C = t.get("itemIds");
|
|
7741
7742
|
P && (v(Number(P)), n.setFieldValue("sourceSubscriptionId", Number(P)), $(P)), C && O(C.split(",").map(Number).filter(Boolean));
|
|
@@ -7768,7 +7769,7 @@ function Xo() {
|
|
|
7768
7769
|
F,
|
|
7769
7770
|
{
|
|
7770
7771
|
title: /* @__PURE__ */ p(U, { children: [
|
|
7771
|
-
/* @__PURE__ */ a(M, { type: "text", icon: /* @__PURE__ */ a(
|
|
7772
|
+
/* @__PURE__ */ a(M, { type: "text", icon: /* @__PURE__ */ a(ur, {}), onClick: () => e("/project/list") }),
|
|
7772
7773
|
/* @__PURE__ */ a(rn, {}),
|
|
7773
7774
|
"新建项目 (立项)"
|
|
7774
7775
|
] }),
|
|
@@ -7778,7 +7779,7 @@ function Xo() {
|
|
|
7778
7779
|
M,
|
|
7779
7780
|
{
|
|
7780
7781
|
type: "primary",
|
|
7781
|
-
icon: /* @__PURE__ */ a(
|
|
7782
|
+
icon: /* @__PURE__ */ a(dr, {}),
|
|
7782
7783
|
loading: r,
|
|
7783
7784
|
onClick: async () => {
|
|
7784
7785
|
try {
|
|
@@ -7898,7 +7899,7 @@ function Xo() {
|
|
|
7898
7899
|
] })
|
|
7899
7900
|
] }),
|
|
7900
7901
|
/* @__PURE__ */ p(F, { type: "inner", title: "Agent 配置", style: { marginBottom: 16 }, children: [
|
|
7901
|
-
/* @__PURE__ */ a(j.Item, { label: "Agent 角色", name: "agentRole", extra: "决定 system prompt 的语气 / 视角", children: /* @__PURE__ */ a(te, { options:
|
|
7902
|
+
/* @__PURE__ */ a(j.Item, { label: "Agent 角色", name: "agentRole", extra: "决定 system prompt 的语气 / 视角", children: /* @__PURE__ */ a(te, { options: Qo }) }),
|
|
7902
7903
|
/* @__PURE__ */ a(
|
|
7903
7904
|
j.Item,
|
|
7904
7905
|
{
|
|
@@ -7921,18 +7922,18 @@ function Xo() {
|
|
|
7921
7922
|
}
|
|
7922
7923
|
) });
|
|
7923
7924
|
}
|
|
7924
|
-
const
|
|
7925
|
-
USER: { color: "blue", icon: /* @__PURE__ */ a(
|
|
7925
|
+
const tr = {
|
|
7926
|
+
USER: { color: "blue", icon: /* @__PURE__ */ a(ir, {}), label: "CEO" },
|
|
7926
7927
|
ASSISTANT: { color: "purple", icon: /* @__PURE__ */ a(Gt, {}), label: "Agent" },
|
|
7927
7928
|
SYSTEM: { color: "default", icon: null, label: "系统" }
|
|
7928
|
-
},
|
|
7929
|
+
}, ti = {
|
|
7929
7930
|
OPEN: { color: "blue", text: "待开始" },
|
|
7930
7931
|
IN_PROGRESS: { color: "green", text: "进行中" },
|
|
7931
7932
|
COMPLETED: { color: "default", text: "已完成" },
|
|
7932
7933
|
ARCHIVED: { color: "default", text: "已归档" }
|
|
7933
7934
|
};
|
|
7934
|
-
function
|
|
7935
|
-
const { id: e } =
|
|
7935
|
+
function ni() {
|
|
7936
|
+
const { id: e } = sr(), t = rt(), [n, r] = A(null), [s, o] = A([]), [i, c] = A(""), [l, d] = A(!1), u = rr(null);
|
|
7936
7937
|
X(() => {
|
|
7937
7938
|
e && m();
|
|
7938
7939
|
}, [e]), X(() => {
|
|
@@ -7975,13 +7976,13 @@ function ei() {
|
|
|
7975
7976
|
}
|
|
7976
7977
|
};
|
|
7977
7978
|
if (!n) return /* @__PURE__ */ a("div", { style: { padding: 24 }, children: /* @__PURE__ */ a(kt, {}) });
|
|
7978
|
-
const O =
|
|
7979
|
+
const O = ti[n.status] || { color: "default", text: n.status };
|
|
7979
7980
|
return /* @__PURE__ */ p("div", { style: { padding: 24, height: "calc(100vh - 64px)", display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
7980
7981
|
/* @__PURE__ */ p(
|
|
7981
7982
|
F,
|
|
7982
7983
|
{
|
|
7983
7984
|
title: /* @__PURE__ */ p(U, { children: [
|
|
7984
|
-
/* @__PURE__ */ a(M, { type: "text", icon: /* @__PURE__ */ a(
|
|
7985
|
+
/* @__PURE__ */ a(M, { type: "text", icon: /* @__PURE__ */ a(ur, {}), onClick: () => t("/project/list") }),
|
|
7985
7986
|
/* @__PURE__ */ a(rn, {}),
|
|
7986
7987
|
/* @__PURE__ */ a("span", { style: { fontWeight: 500 }, children: n.name }),
|
|
7987
7988
|
/* @__PURE__ */ a(E, { color: O.color, children: O.text })
|
|
@@ -7994,7 +7995,7 @@ function ei() {
|
|
|
7994
7995
|
] }),
|
|
7995
7996
|
/* @__PURE__ */ a(E, { children: n.agentRole }),
|
|
7996
7997
|
n.modelCode && /* @__PURE__ */ a(E, { color: "purple", children: n.modelCode }),
|
|
7997
|
-
n.status !== "COMPLETED" && n.status !== "ARCHIVED" && /* @__PURE__ */ a(nn, { title: "标记完成?", onConfirm: I, children: /* @__PURE__ */ a(M, { icon: /* @__PURE__ */ a(
|
|
7998
|
+
n.status !== "COMPLETED" && n.status !== "ARCHIVED" && /* @__PURE__ */ a(nn, { title: "标记完成?", onConfirm: I, children: /* @__PURE__ */ a(M, { icon: /* @__PURE__ */ a(ts, {}), children: "标记完成" }) })
|
|
7998
7999
|
] }),
|
|
7999
8000
|
children: [
|
|
8000
8001
|
n.description && /* @__PURE__ */ a("div", { style: { color: "#666", marginBottom: 8 }, children: n.description }),
|
|
@@ -8018,9 +8019,9 @@ function ei() {
|
|
|
8018
8019
|
style: { flex: 1, display: "flex", flexDirection: "column" },
|
|
8019
8020
|
styles: { body: { flex: 1, display: "flex", flexDirection: "column", padding: 0 } },
|
|
8020
8021
|
children: [
|
|
8021
|
-
/* @__PURE__ */ a("div", { ref: u, style: { flex: 1, overflow: "auto", padding: 16, background: "#fafafa" }, children: s.length === 0 ? /* @__PURE__ */ a(
|
|
8022
|
+
/* @__PURE__ */ a("div", { ref: u, style: { flex: 1, overflow: "auto", padding: 16, background: "#fafafa" }, children: s.length === 0 ? /* @__PURE__ */ a(Ur, { description: "还没有消息, 跟 Agent 说点什么?" }) : /* @__PURE__ */ p(U, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
8022
8023
|
s.map((T) => {
|
|
8023
|
-
const v =
|
|
8024
|
+
const v = tr[T.role] || tr.SYSTEM, f = T.role === "USER";
|
|
8024
8025
|
return /* @__PURE__ */ a("div", { style: {
|
|
8025
8026
|
display: "flex",
|
|
8026
8027
|
justifyContent: f ? "flex-end" : "flex-start"
|
|
@@ -8089,7 +8090,7 @@ function ei() {
|
|
|
8089
8090
|
M,
|
|
8090
8091
|
{
|
|
8091
8092
|
type: "primary",
|
|
8092
|
-
icon: /* @__PURE__ */ a(
|
|
8093
|
+
icon: /* @__PURE__ */ a(ns, {}),
|
|
8093
8094
|
loading: l,
|
|
8094
8095
|
onClick: h,
|
|
8095
8096
|
disabled: !i.trim(),
|
|
@@ -8102,227 +8103,227 @@ function ei() {
|
|
|
8102
8103
|
)
|
|
8103
8104
|
] });
|
|
8104
8105
|
}
|
|
8105
|
-
function
|
|
8106
|
-
return /* @__PURE__ */ p(
|
|
8107
|
-
/* @__PURE__ */ a(ue, { index: !0, element: /* @__PURE__ */ a(
|
|
8108
|
-
/* @__PURE__ */ a(ue, { path: "list", element: /* @__PURE__ */ a(
|
|
8109
|
-
/* @__PURE__ */ a(ue, { path: "new", element: /* @__PURE__ */ a(
|
|
8110
|
-
/* @__PURE__ */ a(ue, { path: ":id", element: /* @__PURE__ */ a(
|
|
8106
|
+
function ri() {
|
|
8107
|
+
return /* @__PURE__ */ p(ar, { children: [
|
|
8108
|
+
/* @__PURE__ */ a(ue, { index: !0, element: /* @__PURE__ */ a(or, { to: "list", replace: !0 }) }),
|
|
8109
|
+
/* @__PURE__ */ a(ue, { path: "list", element: /* @__PURE__ */ a(Xo, {}) }),
|
|
8110
|
+
/* @__PURE__ */ a(ue, { path: "new", element: /* @__PURE__ */ a(ei, {}) }),
|
|
8111
|
+
/* @__PURE__ */ a(ue, { path: ":id", element: /* @__PURE__ */ a(ni, {}) })
|
|
8111
8112
|
] });
|
|
8112
8113
|
}
|
|
8113
|
-
const
|
|
8114
|
+
const Xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8114
8115
|
__proto__: null,
|
|
8115
|
-
default:
|
|
8116
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
8117
|
-
function
|
|
8118
|
-
return /* @__PURE__ */ a(
|
|
8116
|
+
default: ri
|
|
8117
|
+
}, Symbol.toStringTag, { value: "Module" })), si = "# z-team-component\n\nz-team(团队工作台)的**跨仓唯一前端面**:把「多模式工作台 / 模式切换 / z-opc 业务套件聚合 / 订阅域 / 项目域」\n这一整套团队工作台页面收敛成一个可复用的 React 组件包,由主壳(z-opc 主前端)挂载。\n\n- **npm 包名**:`@yuku123/z-team-component`\n- **宿主接入**:双入口 —— `.`(`ZTeamApp` / `SubscribeApp` / `ProjectApp`)与 `./pages`(`routes` / `appMeta` / `menuItems`)\n- **后端**:与 z-opc 主壳同源的 `/api/**`(axios `baseURL = '/api'`,Cookie 模式 `withCredentials`)\n- **技术栈**:React 19 + antd 6 + react-router-dom 7 + vite(**library mode**,双入口 `index` / `pages`,\n 基座与全部 `@yuku123/*` 一律 **external**,由消费方用自己的 node_modules 解析)\n\n> ⚠ z-team 是**主壳的总控包**:它自己不承载某个业务域,而是把 z-opc 的业务套件(`/ctc/*`、`/ai/*`、`/config/*` …)\n> 聚合进工作台外壳里渲染。所以本文档描述的是 **z-team 自身的能力**(工作台 / 模式切换 / 套件聚合 / 订阅 / 项目)。\n\n---\n\n## 一、能力概览\n\n### 1.1 顶层路由(`src/pages-manifest.ts` 的 `routes`)\n\n| 路由 | 组件 | 能力 |\n|------|------|------|\n| `/team/subscribe` | `SubscribeApp` | 订阅域:订阅列表 / 编辑 / 运行历史 |\n| `/team/project` | `ProjectApp` | 项目域:项目列表 / 创建 / 详情 |\n| `/team/docs` | `ComponentDocPage` | 本文件渲染页(左侧 240px TOC + 右侧正文) |\n| `/team/:rest*` | `ZTeamApp` | **兜底**:`ZTeamApp` 内部按 `useLocation().pathname` 懒加载分发到下面 15 个域 |\n\n`menuItems`:`/team/subscribe`(订阅)/ `/team/project`(项目)/ `/team/workspace`(工作台)/ `/team/docs`(组件文档,末项)。\n\n### 1.2 `ZTeamApp` 顶层分发(`src/zteam-adapter/App.tsx`)\n\n| pathname | 渲染的域 | 源文件 |\n|----------|----------|--------|\n| `/workspace` | 工作台 | `src/zteam/pages/workspace/index.tsx` |\n| `/workspace/phone` | 移动端工作台 | `src/zteam/pages/workspace/phone/index.tsx` |\n| `/workspace/from-ticket` | 从工单进入 | `src/zteam/pages/workspace/from-ticket.tsx` |\n| `/workspace/from-scenario` | 从场景进入 | `src/zteam/pages/workspace/from-scenario.tsx` |\n| `/workspace/build-by-form` | 表单构建 | `src/zteam/pages/workspace/build-by-form.tsx` |\n| `/scenario` | 场景 | `src/zteam/pages/scenario/index.tsx` |\n| `/admin` | 管理后台(走工作台外壳的 admin 分支) | `src/zteam/pages/admin/index.tsx` |\n| `/welcome` | 产品介绍 | `src/zteam/pages/welcome/index.tsx` |\n| `/portal` | 场景入口 | `src/zteam/pages/portal/index.tsx` |\n| `/chatdemo` | 聊天演示 | `src/zteam/pages/chatdemo/index.tsx` |\n| `/embed/chat` | 嵌入式聊天 | `src/zteam/pages/embed/chat/index.tsx` |\n| `/change-log` | 变更记录 | `src/zteam/pages/change-log/index.tsx` |\n| `/docs` | **操作手册页**(52KB 手写暗色主题页,**与本文件的组件文档页不是一回事**) | `src/zteam/pages/docs/index.tsx` |\n\n`src/zteam/pages/` 下共 **14 个域目录**:`admin` / `agenthub-digital-brain-test` / `change-log` / `chatdemo` /\n`docs` / `download` / `embed` / `login` / `note` / `phone` / `portal` / `scenario` / `welcome` / `workspace`。\n其中 `agenthub-digital-brain-test` / `download` / `login` / `note` **没有** `ZTeamApp` 顶层分支,\n由域内路由或别的入口进入。\n\n> **2026-11-07:`rpa` 域目录已删除(RPA 入口整体下线)。** RPA 是脚本中心(z-script)的产品皮,\n> 前端 tab / `/rpa/*` 路由 / 页面全部移除,执行能力留在脚本中心继续增强;老链接 `/rpa/*` 由主壳重定向到 `/workspace`。\n\n### 1.3 工作台模式切换(`src/zteam/pages/workspace/utils/chatMode.ts`)\n\n`ChatMode` 共 12 种:`personal` / `collaboration` / `smart` / `product` / `dev` / `test` / `ops` / `admin` /\n`system` / `life` / `training` / `knowledge`(默认 `collaboration`)。\n\n模式切换统一走 `history.push` 到对应顶层路由(`Layout/index.tsx` 的 `handleModeSwitch`):\n\n| 模式 | 落点 |\n|------|------|\n| `system` | `/ctc/4a/account`(z-opc 业务路径;已在业务路径上时不重复跳) |\n| `test` | `/test/qa/dashboard` |\n| `admin` | `/admin?mode=admin` |\n| 其余模式 | `/workspace?mode=xxx`(必须带 `?desktop=1`,否则窄视口会被重定向到移动端工作台) |\n\n模式持久化在 URL query 上(`?mode=xxx`,`replaceState` 不污染历史记录);\n`/admin*` → `admin`、`/ops/*` → `ops`、`/lc/*` → `dev` 由 `readModeFromUrl()` 自动识别。\n\n### 1.4 套件聚合(`src/zteam/pages/workspace/components/Layout/SystemShell.tsx`)\n\n`SystemShell` 用一张 `SYSTEM_ROUTES` 表把 **z-opc 的业务套件**接进工作台的右侧内容区,\n用 `matchSystemPath()` 做 pathname 匹配(精确 → 通配 `*` / 参数 `:param`),支持 `/ctc/*`、`/ai/*`、`/config/*`、\n`/task/*`、`/workflow/*`、`/schedule/*`、`/mist/*`、`/meta/*`、`/msg/*`、`/rpc/*`、`/kb/*`、`/product/*`、`/ops/*` 等前缀。\n\n## 二、导出面\n\n```js\n// 主入口(. 桶):工作台主壳 + 订阅 / 项目域 + 公共设施\nimport ZTeamApp, {SubscribeApp, ProjectApp, history, isTokenExpired, ComponentDocPage}\n from '@yuku123/z-team-component'\n\n// 宿主组装面(./pages 桶):路由清单 + 菜单\nimport {routes, appMeta, menuItems, ComponentDocPage} from '@yuku123/z-team-component/pages'\n```\n\n- `routes`:`/team/subscribe`、`/team/project`、`/team/docs`、`/team/:rest*`(兜底)。\n- `appMeta`:`{ title: 'Z-OPC 一人公司基建', short: 'team' }`。\n- `ComponentDocPage`:组件文档页,**主入口与 `./pages` 桶都具名导出**(名字全仓统一,主壳按这个名字取)。\n\n## 三、API 端点\n\n请求实例由 `src/common/services/api.js` 的 axios 工厂创建:`baseURL = '/api'`(可用 `configureBaseURL()` 改),\n`timeout = 15000`,`withCredentials = true`(**Cookie 模式,不设 Authorization Header**)。\n下表路径是 `src/common/services/`、`src/services/`、`src/subscribe/services/`、`src/project/services/` 里\n**实际调用**的路径(已补上 `/api` 前缀)。\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/api/ctc/authn/login` | 登录 |\n| GET | `/api/ctc/authn/my-tenants` | 我的租户 |\n| POST | `/api/ctc/authn/select-tenant` | 选择租户 |\n| POST | `/api/ctc/authn/switch-tenant` | 切换租户 |\n| GET | `/api/ctc/app-menu/tree` | 应用菜单树 |\n| GET/POST | `/api/ctc/ac/invitations`、`/accept`、`/redeem`、`/leave` | 邀请(加入 / 兑换 / 退出) |\n| GET/POST | `/api/ctc/ac/invitations/members`、`/members/{memberId}/remove`、`/{id}/revoke` | 邀请成员管理 |\n| GET/POST/PUT/DELETE | `/api/agent/team/workspace`、`/workspace/{id}` | Agent 团队工作区 |\n| GET | `/api/agent/team/workspace/list`、`/file-tree-by-path`、`/file-content` | 工作区列表 / 文件树 / 文件内容 |\n| GET/POST/PUT/DELETE | `/api/agent/team/work-item`、`/work-item/{id}` | 工作项 |\n| GET | `/api/agent/team/conversation/{conversationId}/work-items` | 会话下的工作项 |\n| POST | `/api/agent/skill/register`、`/heartbeat`、`/pull`、`/sync-logs` | 技能注册 / 心跳 / 拉取 / 日志回传 |\n| POST/GET | `/api/agent/skill/bind`、`/unbind`、`/bindings` | 技能绑定 |\n| GET/POST/DELETE | `/api/agent/instance/list`、`/get`、`/create`、`/create-container`、`/create-external`、`/destroy-container`、`/destroy-local-process`、`/agent-types`、`/health`、`/status` | Agent 实例(容器 / 外部 / 本地进程) |\n| POST/GET | `/api/bot/feedback`、`/feedback/recent`、`/feedback/score` | Bot 反馈 |\n| GET | `/api/skill/get`、`/api/skill/page` | 技能查询 |\n| GET/POST | `/api/task`、`/task/list`、`/task/complete`、`/task/move`、`/task/project/list` | 任务 |\n| GET/POST | `/api/project`、`/api/project/archive`、`/api/project/user/list` | 项目 |\n| GET/POST/PUT/DELETE | `/api/mock-platform/{environments,endpoints,scenarios,cases,recordings,...}` | Mock 平台(`z-script-web` 的 `MockPlatformController`) |\n| GET | `/api/{name}/list`、`/api/{name}/page`、`/api/{name}/byId` | 通用 CRUD 工厂(`makeApi(name)`,`src/common/services/api.js`) |\n\n各服务模块另有自己的探活端点(`/api/agentTeam/health`、`/api/ctcAc/health`、`/api/ctcAcDomain/health`、\n`/api/ctcSurl/health`、`/api/ctcUser/health`、`/api/job/health`、`/api/metaApp/health`、\n`/api/privateConfig/health`、`/api/webide/health`)。\n\n## 四、页面说明\n\n### 4.1 工作台(`src/zteam/pages/workspace/`)\n\n工作台是本包最大的域,含 `Layout`(顶栏 + 模式切换 + 内容区)、`ProductWorkbench` / `SmartWorkbench` /\n`DevWorkbench` / `OpsWorkbench` 等工作台壳,以及聊天、笔记、代码编辑、知识图谱等通用组件。\n\n### 4.2 套件聚合壳(`SystemShell`)\n\n工作台的「系统」模式用它把 z-opc 业务页面(账号 / 角色 / 应用 / 租户 / 组织 / 权限 / 短链 / 字典 / 审计 /\nwebide / Agent / LLM / MCP / 技能 / OSS / 任务 / 流程 / 调度 / 密钥 / 运维 等)渲染进工作台右侧内容区,\n而不是回到 z-opc 旧 Layout。\n\n### 4.3 订阅域(`src/subscribe/pages/`)\n\n`SubscribeApp` + `SubscriptionList` / `SubscriptionEdit` / `RunHistory`:订阅的列表、编辑与运行历史。\n\n### 4.4 项目域(`src/project/pages/`)\n\n`ProjectApp` + `ProjectList` / `ProjectCreate` / `ProjectDetail`:项目的列表、创建与详情。\n\n### 4.5 组件文档\n\n本文件。内容以 `?raw` 在编译期内联,零额外请求;左侧 240px TOC 随滚动联动。\n渲染用基座的 `ComponentDoc`(`@yuku123/z-frontend-common/ui`),不在本包重写 TOC / 两栏 / 滚动联动。\n\n## 五、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| `configureBaseURL(baseURL)` | `'/api'` | 改写 axios `baseURL`(`src/common/services/api.js`) |\n| 请求 `timeout` | `15000` | axios 实例默认值 |\n| `withCredentials` | `true` | Cookie 模式;**不设 Authorization Header** |\n| vite `external` | 25 个精确包 + 4 条前缀规则 | `react` / `react-dom` / `antd` / `@ant-design/icons` / `@yuku123/*` / `@zopc-mock/*` / `echarts/*` / `highlight.js/*` 等一律 external,**消费方必须自备** |\n| vite alias | `@` → `src/`、`@zteam` → `src/zteam/` | 仅 standalone 构建用;打包后路径已解析 |\n| 模式 URL 参数 | `?mode=xxx` | 持久化在 query 上;`collaboration` 是默认值,不写入 URL |\n| `?desktop=1` | — | 强制桌面版工作台(窄视口默认跳 `/workspace/phone`) |\n\n## 六、已知限制\n\n- **`/team/docs` 目前没有可达路径**:主壳 `z-opc-main-starter-frontend/src/domainRoutes.ts` 的 `DOMAINS` 数组里\n **没有注册 z-team 域**(截至 2026-10-23),所以 z-team 的 `routes` 清单还没有被主壳消费。\n ⇒ 需要主控决定是否接线(注册 z-team 域,或在主壳里显式挂 `ComponentDocPage`)。\n- **`ZTeamApp` 内部没有 `/team/docs` 分支**:它按**绝对 pathname** 分发(`/workspace`、`/scenario`、`/docs` …),\n 未知路径兜底渲染工作台。所以即使走了 `/team/:rest*` 兜底路由,`/team/docs` 也会落进工作台而不是文档页。\n (`ZTeamApp` 不在本批次的改动范围内,需要单独接线。)\n- **已有另一个「文档页」**:`src/zteam/pages/docs/index.tsx` 是 52KB 的手写暗色主题**操作手册**页,\n 路由是 `/docs`。它与本 §7 的**组件文档页**不是一回事(内容、样式、来源都不同),别混淆。\n- **本仓没有 `tsconfig.json`,构建不做类型检查**(`npm run build` = `vite build` + 产物守卫脚本)。\n 基座只发 JS 不发 `.d.ts`,`src/z-frontend-common-ui.d.ts` 是手写的最小声明;\n 新增基座组件时要同步补声明(当前该声明文件里**还没有** `ComponentDoc`,因为本包的文档页走的是 `.jsx`,不参与类型检查)。\n- **组件包必须 external 基座**:`@yuku123/z-frontend-common/ui` 在 dist 里保持裸 import,\n 消费方(主壳)必须自己装基座,否则会出现两份 UI 主题。\n- **工作台下的部分工作台壳仍在改造中**(`ProductWorkbench` / `SmartWorkbench` 等),页面结构可能继续变,\n 本文档只描述到「域 + 顶层路由 + 模式」这一层,域内二级页面未逐页展开。\n- **请求是 Cookie 模式**:后端 `SsoInterceptor` 靠 `Accept` / `Content-Type` 判断「是不是 API 请求」,\n 裸 `fetch` 不带 `Accept` 会被当成页面访问而 302 跳登录页(构建产物有 `guard-fetch-accept.mjs` 守卫)。\n\n## 七、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 0.2.96 | 协作壳本地车道(合并第 3 步):`hooks/useLocalLane.ts`(30s 轮询 + web 隧道 / Tauri 直连),Sidebar 单聊分区并列「本机任务」组(`ft_exclusive_force_desktop=1` 浏览器可验桌面链路),CollabPersonalHost chat 视图按 lane 渲染 LocalChatArea / PersonalChatArea |\n| 0.2.93 | 顶部「个人」tab 下线(协作侧栏单聊分区已承载个人会话);RPA 前端入口整体下线(ChatMode 移除 rpa / Layout tab 分支 / `/rpa/*` 路由 → 主壳重定向 `/workspace`;RpaShell 与 `pages/rpa/` 删除),执行能力留在脚本中心 |\n| 0.2.30(未发布) | 新增组件文档页 `ComponentDocPage`(lead 008 §7):`src/DOC.md` + 基座 `ComponentDoc` 薄包装 + 菜单末项 `/team/docs` |\n| 0.2.30 | 工作台模式体系(13 种 `ChatMode`)+ `SystemShell` 套件聚合 + 订阅 / 项目双域 |\n";
|
|
8118
|
+
function Ql() {
|
|
8119
|
+
return /* @__PURE__ */ a(cs, { markdown: si, title: "组件文档 — Z-OPC 一人公司基建" });
|
|
8119
8120
|
}
|
|
8120
8121
|
export {
|
|
8121
|
-
|
|
8122
|
-
|
|
8122
|
+
Co as $,
|
|
8123
|
+
gc as A,
|
|
8123
8124
|
Te as B,
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8125
|
+
Ql as C,
|
|
8126
|
+
uc as D,
|
|
8127
|
+
Ri as E,
|
|
8128
|
+
Os as F,
|
|
8129
|
+
bi as G,
|
|
8130
|
+
Fl as H,
|
|
8131
|
+
ql as I,
|
|
8132
|
+
Ha as J,
|
|
8133
|
+
Vl as K,
|
|
8133
8134
|
en as L,
|
|
8134
8135
|
tn as M,
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8136
|
+
Uo as N,
|
|
8137
|
+
Wl as O,
|
|
8138
|
+
ri as P,
|
|
8139
|
+
Zl as Q,
|
|
8140
|
+
Kl as R,
|
|
8141
|
+
Zo as S,
|
|
8142
|
+
yr as T,
|
|
8143
|
+
Mo as U,
|
|
8144
|
+
jo as V,
|
|
8145
|
+
Eo as W,
|
|
8146
|
+
Oo as X,
|
|
8146
8147
|
pn as Y,
|
|
8147
|
-
|
|
8148
|
+
Bl as Z,
|
|
8148
8149
|
K as _,
|
|
8149
8150
|
ke as a,
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8151
|
+
Il as a$,
|
|
8152
|
+
$i as a0,
|
|
8153
|
+
Cs as a1,
|
|
8154
|
+
Ai as a2,
|
|
8154
8155
|
Zt as a3,
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8156
|
+
El as a4,
|
|
8157
|
+
Pl as a5,
|
|
8158
|
+
so as a6,
|
|
8159
|
+
Dl as a7,
|
|
8160
|
+
Qi as a8,
|
|
8161
|
+
Ps as a9,
|
|
8162
|
+
Ji as aA,
|
|
8162
8163
|
ut as aB,
|
|
8163
8164
|
At as aC,
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8165
|
+
$n as aD,
|
|
8166
|
+
to as aE,
|
|
8167
|
+
Ui as aF,
|
|
8168
|
+
na as aG,
|
|
8169
|
+
fi as aH,
|
|
8169
8170
|
Xt as aI,
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8171
|
+
Ec as aJ,
|
|
8172
|
+
Oc as aK,
|
|
8173
|
+
Rc as aL,
|
|
8173
8174
|
Xe as aM,
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8175
|
+
Na as aN,
|
|
8176
|
+
xr as aO,
|
|
8177
|
+
Ci as aP,
|
|
8178
|
+
Ml as aQ,
|
|
8179
|
+
jl as aR,
|
|
8180
|
+
zl as aS,
|
|
8181
|
+
Ul as aT,
|
|
8182
|
+
Ti as aU,
|
|
8183
|
+
ki as aV,
|
|
8184
|
+
Si as aW,
|
|
8185
|
+
_i as aX,
|
|
8186
|
+
wi as aY,
|
|
8187
|
+
$r as aZ,
|
|
8188
|
+
kl as a_,
|
|
8189
|
+
qc as aa,
|
|
8190
|
+
Hi as ab,
|
|
8191
|
+
jc as ac,
|
|
8192
|
+
zc as ad,
|
|
8193
|
+
Ii as ae,
|
|
8194
|
+
wc as af,
|
|
8195
|
+
Sc as ag,
|
|
8196
|
+
Vi as ah,
|
|
8197
|
+
fc as ai,
|
|
8198
|
+
yc as aj,
|
|
8199
|
+
dc as ak,
|
|
8200
|
+
_c as al,
|
|
8201
|
+
zi as am,
|
|
8202
|
+
Mc as an,
|
|
8203
|
+
hc as ao,
|
|
8204
|
+
Ll as ap,
|
|
8205
|
+
ys as aq,
|
|
8206
|
+
Bc as ar,
|
|
8206
8207
|
Pt as as,
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8208
|
+
Ei as at,
|
|
8209
|
+
lc as au,
|
|
8210
|
+
Ni as av,
|
|
8211
|
+
Mi as aw,
|
|
8212
|
+
ji as ax,
|
|
8213
|
+
pc as ay,
|
|
8214
|
+
gl as az,
|
|
8214
8215
|
Ce as b,
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8216
|
+
hl as b$,
|
|
8217
|
+
za as b0,
|
|
8218
|
+
vl as b1,
|
|
8219
|
+
Al as b2,
|
|
8220
|
+
yi as b3,
|
|
8220
8221
|
b as b4,
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8222
|
+
bl as b5,
|
|
8223
|
+
Cl as b6,
|
|
8224
|
+
Tl as b7,
|
|
8224
8225
|
at as b8,
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8226
|
+
Wt as b9,
|
|
8227
|
+
Ki as bA,
|
|
8228
|
+
_n as bB,
|
|
8229
|
+
ms as bC,
|
|
8230
|
+
Tc as bD,
|
|
8231
|
+
kc as bE,
|
|
8232
|
+
Lc as bF,
|
|
8233
|
+
ec as bG,
|
|
8234
|
+
nc as bH,
|
|
8235
|
+
tc as bI,
|
|
8236
|
+
vi as bJ,
|
|
8237
|
+
Jc as bK,
|
|
8238
|
+
Gc as bL,
|
|
8239
|
+
Yc as bM,
|
|
8240
|
+
Zc as bN,
|
|
8241
|
+
Vc as bO,
|
|
8242
|
+
Xc as bP,
|
|
8243
|
+
xi as bQ,
|
|
8244
|
+
Pi as bR,
|
|
8245
|
+
Wc as bS,
|
|
8246
|
+
Qc as bT,
|
|
8247
|
+
el as bU,
|
|
8248
|
+
rc as bV,
|
|
8249
|
+
sc as bW,
|
|
8250
|
+
ac as bX,
|
|
8251
|
+
ul as bY,
|
|
8252
|
+
pl as bZ,
|
|
8253
|
+
ml as b_,
|
|
8254
|
+
$l as ba,
|
|
8255
|
+
_l as bb,
|
|
8256
|
+
wl as bc,
|
|
8257
|
+
Sl as bd,
|
|
8258
|
+
xl as be,
|
|
8259
|
+
Cr as bf,
|
|
8259
8260
|
Et as bg,
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8261
|
+
Hc as bh,
|
|
8262
|
+
Kc as bi,
|
|
8263
|
+
Vs as bj,
|
|
8264
|
+
Di as bk,
|
|
8265
|
+
Ol as bl,
|
|
8265
8266
|
y as bm,
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8267
|
+
In as bn,
|
|
8268
|
+
Ls as bo,
|
|
8269
|
+
ks as bp,
|
|
8270
|
+
Fc as bq,
|
|
8271
|
+
Bi as br,
|
|
8272
|
+
Nl as bs,
|
|
8273
|
+
wr as bt,
|
|
8274
|
+
gi as bu,
|
|
8275
|
+
Zi as bv,
|
|
8276
|
+
Yi as bw,
|
|
8277
|
+
Xi as bx,
|
|
8278
|
+
Wi as by,
|
|
8279
|
+
Gi as bz,
|
|
8280
|
+
Vt as c,
|
|
8281
|
+
fl as c0,
|
|
8282
|
+
yl as c1,
|
|
8283
|
+
dl as c2,
|
|
8284
|
+
ll as c3,
|
|
8285
|
+
xc as c4,
|
|
8286
|
+
Ac as c5,
|
|
8287
|
+
vc as c6,
|
|
8288
|
+
ic as c7,
|
|
8289
|
+
oc as c8,
|
|
8290
|
+
Pc as c9,
|
|
8291
|
+
Nc as ca,
|
|
8292
|
+
cl as cb,
|
|
8293
|
+
tl as cc,
|
|
8294
|
+
rl as cd,
|
|
8295
|
+
nl as ce,
|
|
8296
|
+
sl as cf,
|
|
8297
|
+
al as cg,
|
|
8298
|
+
il as ch,
|
|
8299
|
+
ol as ci,
|
|
8300
|
+
Cc as cj,
|
|
8301
|
+
Uc as ck,
|
|
8302
|
+
Dc as cl,
|
|
8303
|
+
Gl as cm,
|
|
8304
|
+
Yl as cn,
|
|
8305
|
+
Xl as co,
|
|
8306
|
+
Hl as d,
|
|
8306
8307
|
_e as e,
|
|
8307
8308
|
ge as f,
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8309
|
+
br as g,
|
|
8310
|
+
qi as h,
|
|
8311
|
+
_o as i,
|
|
8312
|
+
Li as j,
|
|
8313
|
+
Rl as k,
|
|
8314
|
+
Ma as l,
|
|
8315
|
+
Oi as m,
|
|
8316
|
+
Ic as n,
|
|
8317
|
+
$c as o,
|
|
8318
|
+
Fi as p,
|
|
8319
|
+
us as q,
|
|
8320
|
+
Oa as r,
|
|
8320
8321
|
dt as s,
|
|
8321
8322
|
q as t,
|
|
8322
|
-
|
|
8323
|
+
Mn as u,
|
|
8323
8324
|
he as v,
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8325
|
+
cc as w,
|
|
8326
|
+
mc as x,
|
|
8327
|
+
bc as y,
|
|
8327
8328
|
oe as z
|
|
8328
8329
|
};
|