@yuku123/z-team-component 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{InvitationManagementPage-BVBwdTi0.js → InvitationManagementPage-DEBZvFZU.js} +2 -2
  2. package/dist/{LowCodePage-DH-DYM7K.js → LowCodePage-yemTBcZ4.js} +1 -1
  3. package/dist/{OnboardingPage-Cy2YU_Og.js → OnboardingPage-Bi3S5eug.js} +2 -2
  4. package/dist/{ProjectApp-YRqDFopZ.js → ProjectApp-9qtrgr7d.js} +154 -168
  5. package/dist/admin-logs-BIRWnOwM.js +254 -0
  6. package/dist/api-3Ur1kq2A.js +2049 -0
  7. package/dist/{api-B6evTauY.js → api-B2d2enyL.js} +1 -1
  8. package/dist/{createWorkspaceWsHandler-DrV9AaO7.js → createWorkspaceWsHandler-CSAGqlPX.js} +3568 -3269
  9. package/dist/{index-l8P_AuvD.js → index-BIVN--Bi.js} +1 -1
  10. package/dist/index-B_YVSwmJ.js +11710 -0
  11. package/dist/{index-DM_AMiPz.js → index-C6SfK489.js} +36 -35
  12. package/dist/{index-BK9rSfN3.js → index-C8uSn9eX.js} +10 -10
  13. package/dist/{index-CuuZlPvb.js → index-CPUeMpa8.js} +4 -4
  14. package/dist/{index-CHSnuHux.js → index-Cml0C09P.js} +12241 -23651
  15. package/dist/{index-Bw02b5qJ.js → index-CsCPAoPb.js} +14819 -13930
  16. package/dist/{index-DYXWNyaR.js → index-D3DF6vFc.js} +17 -17
  17. package/dist/{index-D-oG0ReT.js → index-DMEjkEMq.js} +3 -3
  18. package/dist/{index-D_SjmsjB.js → index-DNyYOedu.js} +4 -4
  19. package/dist/{index-Bh5PFiY9.js → index-wXqXyXmm.js} +33 -32
  20. package/dist/index.js +1 -1
  21. package/dist/instance-ClduEMxs.js +215 -0
  22. package/dist/pages.js +1 -1
  23. package/dist/{send-default-agent-team-message-DxD_vD7Z.js → send-default-agent-team-message-B3Qon0X2.js} +1 -1
  24. package/dist/{sso-user-D1eNVXkY.js → sso-user-BOEGMUJA.js} +1 -1
  25. package/dist/{useAppStore-C12Ala1u.js → useAppStore-D8PnbXea.js} +1 -1
  26. package/dist/z-team-component.css +2 -2
  27. package/package.json +4 -1
  28. package/dist/api-W2_U7Nxd.js +0 -3866
  29. package/dist/ctc-signout-C_dAvsu5.js +0 -9
@@ -0,0 +1,2049 @@
1
+ import { message as z } from "antd";
2
+ function m(e) {
3
+ return e == null || e === "" ? "" : typeof e == "string" ? e : String(e);
4
+ }
5
+ function Ke(e) {
6
+ const n = m(e);
7
+ return n === "" ? null : n;
8
+ }
9
+ function Xe(e, n) {
10
+ return m(e) === m(n);
11
+ }
12
+ function Ye(e) {
13
+ const n = m(e);
14
+ return n !== "" && n.startsWith("-");
15
+ }
16
+ function pe(e) {
17
+ const n = m(e);
18
+ return n !== "" && fe(n, "0") > 0;
19
+ }
20
+ function fe(e, n) {
21
+ const t = m(e), s = m(n);
22
+ if (t === s)
23
+ return 0;
24
+ if (t === "")
25
+ return 1;
26
+ if (s === "")
27
+ return -1;
28
+ try {
29
+ const o = BigInt(t), d = BigInt(s);
30
+ return o < d ? -1 : 1;
31
+ } catch {
32
+ return t < s ? -1 : 1;
33
+ }
34
+ }
35
+ const $e = 101012001;
36
+ function ye() {
37
+ const e = typeof window < "u" && window.ZTEAM_SSO_BASE || "";
38
+ return e ? e.replace(/\/+$/, "") : typeof window > "u" ? "http://localhost" : window.location.origin;
39
+ }
40
+ function he() {
41
+ const e = new URL(window.location.href);
42
+ e.searchParams.has("_from_login") || e.searchParams.set("_from_login", "1");
43
+ const n = `${ye()}/login?redirect=${encodeURIComponent(
44
+ e.toString()
45
+ )}`;
46
+ window.location.href = n;
47
+ }
48
+ let O = [], _ = [], Z = "disconnected";
49
+ function ge(e) {
50
+ Z = e, _.forEach((n) => n(e));
51
+ }
52
+ function en(e, n = "") {
53
+ const t = window.location.protocol === "https:" ? "wss:" : "ws:", s = window.location.host, o = n ? `?token=${encodeURIComponent(n)}` : "";
54
+ return `${t}//${s}${_e}/${e}/ws${o}`;
55
+ }
56
+ function nn(e) {
57
+ return _.push(e), e(Z), () => {
58
+ _ = _.filter((n) => n !== e);
59
+ };
60
+ }
61
+ function tn(e) {
62
+ return O.push(e), () => {
63
+ O = O.filter((n) => n !== e);
64
+ };
65
+ }
66
+ function Se() {
67
+ ge("disconnected"), O = [], _ = [];
68
+ }
69
+ const V = { credentials: "include" };
70
+ function C(e, n = "error") {
71
+ n === "warning" ? z.warning(e) : z.error(e);
72
+ }
73
+ typeof window < "u" && window.addEventListener(
74
+ "unhandledrejection",
75
+ (e) => {
76
+ const n = e.reason;
77
+ n && typeof n == "object" && n._apiUserError && e.preventDefault();
78
+ }
79
+ );
80
+ let M = !1;
81
+ const B = "登录已失效,请重新登录";
82
+ function we(e) {
83
+ if (!e) return !1;
84
+ if (Number(e.code) === $e) return !0;
85
+ const n = typeof e.message == "string" ? e.message : "";
86
+ return /登录(?:已)?(?:失效|过期)|重新登录|未登录/.test(n);
87
+ }
88
+ function F() {
89
+ if (!M) {
90
+ M = !0;
91
+ try {
92
+ Se();
93
+ } catch {
94
+ }
95
+ try {
96
+ localStorage.removeItem("ft_token"), localStorage.removeItem("USER_INFO"), delete window.USER_INFO;
97
+ } catch {
98
+ }
99
+ he();
100
+ }
101
+ throw {
102
+ _apiUserError: !0,
103
+ userMessage: B,
104
+ message: B
105
+ };
106
+ }
107
+ function x(e, n) {
108
+ return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, n);
109
+ }
110
+ const Q = "/z-team", Te = typeof window < "u" && /(zteam[-.]ft\.(zteam\.local|zteam\.local)|team\.zteam\.local)/i.test(
111
+ window.location.hostname
112
+ ), k = Te, Ie = `${k ? "/kapi" : ""}${Q}/api`, _e = `${k ? "/kapi" : ""}${Q}/v1/scenario-instances`, Ce = window.ENV_TYPE || window.envType || "", sn = Ie, on = `${k ? "/kapi" : ""}/z-team-evolution/api`, an = `${k ? "/kapi" : ""}/z-team-bench/api`, W = "https://zteam-agent.zteam.local", be = "/kapi/zteam-agent/api/dev-brain/agent";
113
+ function K(e, n) {
114
+ const t = e.startsWith("/") ? e : `/${e}`, s = n ? `?${new URLSearchParams(n).toString()}` : "", o = `${be}${t}${s}`;
115
+ if (typeof window > "u")
116
+ return `${W}${o}`;
117
+ const d = window.location.hostname;
118
+ return /\.zteam\.local$/i.test(d) || /zteam[-.]ft\.zteam\.local$/i.test(d) || d === "localhost" || d === "127.0.0.1" || d === "127.0.0.1" ? `${window.location.origin}${o}` : `${W}${o}`;
119
+ }
120
+ function rn(e) {
121
+ return K("/ticket", { ticketId: e });
122
+ }
123
+ K("/ticket");
124
+ const X = Ce || "local";
125
+ async function cn(e, n) {
126
+ try {
127
+ const t = {
128
+ "project-env": X,
129
+ ...n == null ? void 0 : n.headers
130
+ };
131
+ return await fetch(e, {
132
+ ...V,
133
+ ...n,
134
+ credentials: "include",
135
+ mode: "cors",
136
+ headers: t
137
+ });
138
+ } catch {
139
+ const t = "无法连接 ZTeam-Agent 服务,请确认可访问 zteam-agent.zteam.local";
140
+ throw C(t), { _apiUserError: !0, userMessage: t, message: t };
141
+ }
142
+ }
143
+ async function dn(e, n) {
144
+ try {
145
+ const t = {
146
+ "project-env": X,
147
+ ...n == null ? void 0 : n.headers
148
+ };
149
+ return await fetch(e, { ...V, ...n, headers: t });
150
+ } catch {
151
+ const t = "无法连接服务器,请确认 Java 服务已启动(如 127.0.0.1:8080)且前端代理 /z-team 已配置";
152
+ throw C(t), { _apiUserError: !0, userMessage: t, message: t };
153
+ }
154
+ }
155
+ async function Ae(e, n) {
156
+ e.status === 401 && F();
157
+ const t = await e.text().catch(() => "");
158
+ let s = {};
159
+ if (t)
160
+ try {
161
+ s = JSON.parse(t);
162
+ } catch {
163
+ if (!e.ok) {
164
+ const o = x(e, n);
165
+ throw C(
166
+ e.status >= 500 ? o : `${o}(HTTP ${e.status},响应非 JSON)`
167
+ ), {
168
+ _apiUserError: !0,
169
+ userMessage: o,
170
+ message: o
171
+ };
172
+ }
173
+ return t;
174
+ }
175
+ if (we(s) && F(), typeof s.success == "boolean") {
176
+ if (s.success)
177
+ return s.data !== void 0 ? s.data : !0;
178
+ const o = s.message || // z-team 另有 7 个 admin controller 挂 bench Result({code,msg,data,success})
179
+ s.msg || s.detail || n;
180
+ throw C(o), {
181
+ _apiUserError: !0,
182
+ userMessage: o,
183
+ message: o
184
+ };
185
+ }
186
+ if (!e.ok) {
187
+ const o = s.detail || s.message || x(e, n);
188
+ throw C(o), {
189
+ _apiUserError: !0,
190
+ userMessage: o,
191
+ message: o
192
+ };
193
+ }
194
+ return s;
195
+ }
196
+ const Ee = /_+([a-z0-9])/gi;
197
+ function Ue(e) {
198
+ return e.replace(Ee, (n, t) => t.toUpperCase());
199
+ }
200
+ function q(e) {
201
+ if (Array.isArray(e)) return e.map((n) => q(n));
202
+ if (e && typeof e == "object" && !(e instanceof Date)) {
203
+ const n = {};
204
+ for (const [t, s] of Object.entries(e))
205
+ n[Ue(t)] = q(s);
206
+ return n;
207
+ }
208
+ return e;
209
+ }
210
+ async function un(e, n) {
211
+ return q(await Ae(e, n));
212
+ }
213
+ const a = {
214
+ credentials: "include",
215
+ // 强制标识为 XHR/fetch API 请求,使后端 SsoInterceptor 走 JSON 401 分支
216
+ // 而不是返回 302 跳到 SSO 登录页(避免 fetch follow redirect 后拿到 SPA HTML 导致解析失败)
217
+ headers: { Accept: "application/json" }
218
+ };
219
+ class Oe extends Error {
220
+ constructor(n) {
221
+ super(n), this._apiUserError = !0, this.name = "ApiUserError", this.userMessage = n;
222
+ }
223
+ }
224
+ function ln(e) {
225
+ return e instanceof Oe ? !0 : !!(e && typeof e == "object" && e._apiUserError);
226
+ }
227
+ function g(e, n = "error") {
228
+ console[n === "warning" ? "warn" : "error"]("[api]", e);
229
+ }
230
+ typeof window < "u" && window.addEventListener(
231
+ "unhandledrejection",
232
+ (e) => {
233
+ const n = e.reason;
234
+ n && typeof n == "object" && n._apiUserError && e.preventDefault();
235
+ }
236
+ );
237
+ function H(e, n) {
238
+ return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, n);
239
+ }
240
+ const Y = "/z-team", Pe = typeof window < "u" && window.ZTEAM_USE_KAPI === !0, D = Pe, ee = `${D ? "/kapi" : ""}${Y}/api`, Re = `${D ? "/kapi" : ""}${Y}/v1/scenario-instances`, ke = window.ENV_TYPE || window.envType || "", i = ee, Ne = `${D ? "/kapi" : ""}/z-team-evolution/api`, R = typeof window < "u" && window.ZTEAM_AGENTHUB_AI_ORIGIN || "", ve = "/kapi/agenthub-ai/api/dev-brain/agent", je = String(
241
+ typeof window < "u" && window.ZTEAM_AGENTHUB_SAME_ORIGIN_SUFFIXES || ""
242
+ ).split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
243
+ function ne(e) {
244
+ const n = (e || "").toLowerCase();
245
+ return n === "localhost" || n === "127.0.0.1" ? !0 : je.some(
246
+ (t) => n === t || n.endsWith(`.${t}`)
247
+ );
248
+ }
249
+ function te(e, n) {
250
+ const t = e.startsWith("/") ? e : `/${e}`, o = `${ve}${t}`;
251
+ if (typeof window > "u")
252
+ return `${R}${o}`;
253
+ const d = window.location.hostname;
254
+ return ne(d) ? `${window.location.origin}${o}` : `${R}${o}`;
255
+ }
256
+ function qe(e) {
257
+ const t = `/kapi/agenthub-ai${e.startsWith("/") ? e : `/${e}`}`;
258
+ if (typeof window > "u")
259
+ return `${R}${t}`;
260
+ const s = window.location.hostname;
261
+ return ne(s) ? `${window.location.origin}${t}` : `${R}${t}`;
262
+ }
263
+ async function De(e) {
264
+ const n = new FormData();
265
+ n.append("file", e);
266
+ const t = await oe(qe("/common/uploadImage"), {
267
+ method: "POST",
268
+ body: n
269
+ });
270
+ return r(t, "上传图片失败");
271
+ }
272
+ async function mn(e) {
273
+ return Promise.all(e.map((n) => De(n)));
274
+ }
275
+ te("/ticket");
276
+ const se = ke || "local";
277
+ async function oe(e, n) {
278
+ try {
279
+ const t = {
280
+ ...a.headers,
281
+ "project-env": se,
282
+ ...n == null ? void 0 : n.headers
283
+ };
284
+ return await fetch(e, {
285
+ ...a,
286
+ ...n,
287
+ credentials: "include",
288
+ mode: "cors",
289
+ headers: t
290
+ });
291
+ } catch {
292
+ const t = "无法连接 AgentHub-AI 服务,请确认服务地址配置正确";
293
+ throw g(t), { _apiUserError: !0, userMessage: t, message: t };
294
+ }
295
+ }
296
+ async function c(e, n) {
297
+ try {
298
+ const t = {
299
+ ...a.headers,
300
+ "project-env": se,
301
+ ...n == null ? void 0 : n.headers
302
+ };
303
+ return await fetch(e, { ...a, ...n, headers: t });
304
+ } catch {
305
+ const t = "无法连接服务器,请确认 Java 服务已启动(如 127.0.0.1:8080)且前端代理 /z-team 已配置";
306
+ throw g(t), { _apiUserError: !0, userMessage: t, message: t };
307
+ }
308
+ }
309
+ function ae(e) {
310
+ const n = e.id ?? e.staff_id ?? e.staffId ?? e.user_id ?? e.userId;
311
+ return {
312
+ // FE-PRECISION-FIX: 雪花 ID 保持字符串,禁止走 Number()
313
+ id: m(n),
314
+ username: String(e.username ?? ""),
315
+ display_name: String(e.display_name ?? e.displayName ?? ""),
316
+ avatar: String(e.avatar ?? "👤"),
317
+ created_at: String(e.created_at ?? e.createdAt ?? ""),
318
+ is_global_admin: !!(e.is_global_admin ?? e.globalAdmin ?? e.global_admin ?? !1)
319
+ };
320
+ }
321
+ async function r(e, n) {
322
+ const t = await e.text().catch(() => "");
323
+ let s = {};
324
+ if (t)
325
+ try {
326
+ s = JSON.parse(t);
327
+ } catch {
328
+ if (!e.ok) {
329
+ const u = H(e, n);
330
+ throw g(
331
+ e.status >= 500 ? u : `${u}(HTTP ${e.status},响应非 JSON)`
332
+ ), {
333
+ _apiUserError: !0,
334
+ userMessage: u,
335
+ message: u
336
+ };
337
+ }
338
+ return t;
339
+ }
340
+ const o = s.status_code ?? s.statusCode, d = s.success === !0 || typeof o == "number" && o >= 200 && o < 300;
341
+ if (typeof s.success == "boolean" || typeof o == "number") {
342
+ if (d)
343
+ return s.data !== void 0 ? s.data : !0;
344
+ const u = s.message || s.msg || s.detail || n;
345
+ throw g(u), {
346
+ _apiUserError: !0,
347
+ userMessage: u,
348
+ message: u
349
+ };
350
+ }
351
+ if (!e.ok) {
352
+ const u = s.detail || s.message || H(e, n);
353
+ throw g(u), {
354
+ _apiUserError: !0,
355
+ userMessage: u,
356
+ message: u
357
+ };
358
+ }
359
+ return s;
360
+ }
361
+ async function pn(e, n) {
362
+ const t = await fetch("/kapi/z-ctc/api/ctc/authn/login", {
363
+ ...a,
364
+ method: "POST",
365
+ headers: { "Content-Type": "application/json" },
366
+ credentials: "include",
367
+ body: JSON.stringify({ identifier: e, password: n })
368
+ }), s = await r(t, "登录失败"), o = (s == null ? void 0 : s.userInfo) ?? (s == null ? void 0 : s.user_info) ?? (s == null ? void 0 : s.user) ?? s, d = ae(o);
369
+ return { token: (s == null ? void 0 : s.token) ?? "", user: d };
370
+ }
371
+ async function fn(e) {
372
+ const n = await fetch("/kapi/z-ctc/api/ctc/authn/whoami", {
373
+ ...a,
374
+ credentials: "include"
375
+ }), t = await r(
376
+ n,
377
+ "获取用户信息失败"
378
+ );
379
+ return ae(t);
380
+ }
381
+ async function $n(e) {
382
+ await r(
383
+ await fetch("/kapi/z-ctc/api/ctc/authn/logout", {
384
+ ...a,
385
+ method: "POST",
386
+ credentials: "include"
387
+ }),
388
+ "退出失败"
389
+ );
390
+ try {
391
+ localStorage.removeItem("token"), localStorage.removeItem("z_team_token"), localStorage.removeItem("userInfo"), localStorage.removeItem("USER_INFO");
392
+ } catch {
393
+ }
394
+ }
395
+ async function yn(e, n) {
396
+ try {
397
+ const t = await fetch(
398
+ `/kapi/z-ctc/api/ctc/authz/users/permissions?userId=${e}`,
399
+ {
400
+ headers: {
401
+ Authorization: `Bearer ${n}`
402
+ }
403
+ }
404
+ );
405
+ if (!t.ok) return [];
406
+ const s = await t.json(), o = (s == null ? void 0 : s.data) ?? s;
407
+ return Array.isArray(o) ? o.map((d) => (d == null ? void 0 : d.resource_code) ?? (d == null ? void 0 : d.resourceCode)).filter((d) => typeof d == "string" && d) : [];
408
+ } catch {
409
+ return [];
410
+ }
411
+ }
412
+ async function hn(e = "", n) {
413
+ const t = new URLSearchParams();
414
+ e && t.set("token", e), n && t.set("create_time_start", n);
415
+ const s = t.toString(), o = await c(
416
+ `${i}/scenario-instances/${s ? `?${s}` : ""}`,
417
+ a
418
+ );
419
+ return r(o, "获取项目列表失败");
420
+ }
421
+ async function gn(e = "") {
422
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/scenarios${n}`, a);
423
+ return r(t, "获取场景列表失败");
424
+ }
425
+ async function Le(e, n = "") {
426
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = {
427
+ ...e,
428
+ extend_params: { ...e.extend_params, skip_init_task: "true" }
429
+ }, o = await c(`${i}/scenario-instances/${t}`, {
430
+ ...a,
431
+ method: "POST",
432
+ headers: { "Content-Type": "application/json" },
433
+ body: JSON.stringify(s)
434
+ }), d = await r(o, "创建项目失败");
435
+ return w(d);
436
+ }
437
+ const Sn = Le;
438
+ function w(e) {
439
+ return {
440
+ // FE-PRECISION-FIX: 雪花 ID 是 19 位 bigint, Number() 会丢末位精度
441
+ // (后端 Jackson Long→String 已序列化为字符串, 这里保持字符串避免回退到 Number)
442
+ id: e.id == null ? "" : String(e.id),
443
+ name: String(e.name ?? ""),
444
+ description: String(e.description ?? ""),
445
+ workspace_path: String(e.workspace_path ?? e.workspacePath ?? ""),
446
+ status: String(e.status ?? "ACTIVE"),
447
+ created_at: String(e.created_at ?? e.createdAt ?? ""),
448
+ mode: e.mode != null ? String(e.mode) : void 0,
449
+ // FEATURE-ID-AS-STRING: 雪花 ID 一律 string, 严禁 Number() (JS Number 精度会丢末位)
450
+ scenario_id: e.scenario_id != null ? String(e.scenario_id) : e.scenarioId != null ? String(e.scenarioId) : void 0,
451
+ scenario_code: e.scenario_code != null ? String(e.scenario_code) : e.scenarioCode != null ? String(e.scenarioCode) : void 0,
452
+ scenario_name: e.scenario_name != null ? String(e.scenario_name) : e.scenarioName != null ? String(e.scenarioName) : void 0,
453
+ role: e.role != null ? String(e.role) : void 0,
454
+ llm_code: e.llm_code != null ? String(e.llm_code) : e.llmCode != null ? String(e.llmCode) : void 0,
455
+ close_feedback: E(e, "close_feedback"),
456
+ close_tags: E(e, "close_tags"),
457
+ close_time: E(e, "close_time"),
458
+ close_user: E(e, "close_user"),
459
+ members: Array.isArray(e.members) ? e.members.map((n) => String(n)) : void 0,
460
+ parent_id: Je(e)
461
+ };
462
+ }
463
+ function E(e, n) {
464
+ const t = n.replace(/_([a-z])/g, (u, f) => f.toUpperCase());
465
+ if (e[n] != null) return e[n];
466
+ if (e[t] != null) return e[t];
467
+ const s = e.close_info ?? e.closeInfo;
468
+ if (s) {
469
+ if (s[n] != null) return s[n];
470
+ if (s[t] != null) return s[t];
471
+ }
472
+ const o = e.ext;
473
+ if (!o) return;
474
+ const d = o.params;
475
+ if (d)
476
+ return d[n] ?? void 0;
477
+ }
478
+ function Je(e) {
479
+ const n = e.ext;
480
+ if (!n) return;
481
+ const t = n.params;
482
+ if (!t) return;
483
+ const s = t.parent_id;
484
+ if (s == null) return;
485
+ const o = m(s);
486
+ return o === "" ? void 0 : o;
487
+ }
488
+ async function wn(e, n) {
489
+ const t = await c(
490
+ `${i}/scenario-instances/${e}/llm-code`,
491
+ {
492
+ ...a,
493
+ method: "PUT",
494
+ headers: { "Content-Type": "application/json" },
495
+ body: JSON.stringify({ llmCode: n || null })
496
+ }
497
+ ), s = await r(t, "设置模型失败");
498
+ return w(s);
499
+ }
500
+ const Tn = "qa_support";
501
+ function In(e) {
502
+ const n = e.futureTeamProjectId ?? e.future_team_project_id ?? "", t = m(String(n).trim());
503
+ return pe(t) ? t : null;
504
+ }
505
+ async function _n(e, n, t) {
506
+ const s = te("/update-z-team"), o = new URLSearchParams({
507
+ ticketId: e,
508
+ futureTeamProjectId: String(n),
509
+ stage: t
510
+ }), d = await oe(s, {
511
+ method: "POST",
512
+ headers: {
513
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
514
+ },
515
+ body: o.toString()
516
+ });
517
+ await r(d, "回写工单关联工程失败");
518
+ }
519
+ async function Cn(e) {
520
+ const n = await c(
521
+ `${i}/scenario-instances/${e}/team/`,
522
+ a
523
+ );
524
+ return r(n, "获取团队成员失败");
525
+ }
526
+ async function bn(e, n) {
527
+ const t = await c(`${i}/scenario-instances/${e}/team/`, {
528
+ ...a,
529
+ method: "POST",
530
+ headers: { "Content-Type": "application/json" },
531
+ body: JSON.stringify(n)
532
+ });
533
+ return r(t, "添加成员失败");
534
+ }
535
+ async function An(e, n) {
536
+ const t = await c(
537
+ `${i}/scenario-instances/${e}/team/${n}`,
538
+ {
539
+ ...a,
540
+ method: "DELETE"
541
+ }
542
+ );
543
+ return r(t, "移除成员失败");
544
+ }
545
+ async function En(e) {
546
+ const n = await c(
547
+ `${i}/scenario-instances/${e}/team/available-agents`,
548
+ a
549
+ );
550
+ return r(n, "获取Agent列表失败");
551
+ }
552
+ async function Un(e) {
553
+ const n = await c(
554
+ `${i}/scenario-instances/${e}/team/available-humans`,
555
+ a
556
+ );
557
+ return r(n, "获取用户列表失败");
558
+ }
559
+ async function On(e) {
560
+ const n = await c(
561
+ `${i}/scenario-instances/${e}/skills`,
562
+ a
563
+ );
564
+ return r(n, "获取技能列表失败");
565
+ }
566
+ async function Pn(e) {
567
+ const n = await c(
568
+ `${i}/scenario-instances/${e}/all-skills`,
569
+ a
570
+ );
571
+ return r(n, "获取全部技能列表失败");
572
+ }
573
+ async function Rn(e, n) {
574
+ const t = await c(`${i}/scenario-instances/${e}/skills`, {
575
+ ...a,
576
+ method: "POST",
577
+ headers: { "Content-Type": "application/json" },
578
+ body: JSON.stringify({ skill_id: n })
579
+ });
580
+ return r(t, "添加技能失败");
581
+ }
582
+ async function kn(e, n) {
583
+ const t = await c(
584
+ `${i}/scenario-instances/${e}/skills/${n}`,
585
+ {
586
+ ...a,
587
+ method: "DELETE"
588
+ }
589
+ );
590
+ return r(t, "移除技能失败");
591
+ }
592
+ async function Nn(e, n) {
593
+ const t = await c(
594
+ `${i}/scenario-instances/${e}/agent-skills/refresh`,
595
+ {
596
+ ...a,
597
+ method: "POST",
598
+ headers: { "Content-Type": "application/json" },
599
+ body: JSON.stringify({ agent_skills_path: n })
600
+ }
601
+ );
602
+ return r(t, "刷新技能失败");
603
+ }
604
+ async function vn(e) {
605
+ const n = await c(
606
+ `${i}/scenario-instances/${e}/all-agent-skills/refresh`,
607
+ {
608
+ ...a,
609
+ method: "POST"
610
+ }
611
+ );
612
+ return r(n, "刷新所有技能失败");
613
+ }
614
+ async function jn(e, n = 50, t) {
615
+ let s = `${i}/scenario-instances/${e}/messages?limit=${n}`;
616
+ t && (s += `&before=${t}`);
617
+ const o = await c(s, a);
618
+ return r(o, "加载聊天记录失败,请稍后重试");
619
+ }
620
+ async function qn(e, n, t = "") {
621
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
622
+ `${i}/scenario-instances/${e}/messages/${n}/read${s}`,
623
+ {
624
+ ...a,
625
+ method: "POST"
626
+ }
627
+ );
628
+ return r(o, "标记已读失败");
629
+ }
630
+ async function Dn(e, n, t = "") {
631
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
632
+ `${i}/scenario-instances/${e}/messages${s}`,
633
+ {
634
+ ...a,
635
+ method: "POST",
636
+ headers: { "Content-Type": "application/json" },
637
+ body: JSON.stringify(n)
638
+ }
639
+ );
640
+ return r(o, "发送消息失败");
641
+ }
642
+ async function Ln(e, n) {
643
+ const t = await c(
644
+ `${i}/scenario-instances/${e}/cancel/${n}`,
645
+ { ...a, method: "POST" }
646
+ ), s = await r(t, "取消失败");
647
+ if (s != null && s.warning)
648
+ throw new Error(String(s.warning));
649
+ return s;
650
+ }
651
+ async function Jn(e, n) {
652
+ const t = await c(
653
+ `${i}/scenario-instances/${e}/cancel/${n}/queue`,
654
+ { ...a, method: "POST" }
655
+ );
656
+ return r(t, "停止队列失败");
657
+ }
658
+ async function zn(e) {
659
+ const n = await c(
660
+ `${i}/scenario-instances/${e}/executions`,
661
+ a
662
+ );
663
+ return r(n, "获取执行列表失败");
664
+ }
665
+ async function Mn(e, n = "") {
666
+ const t = n ? `?subdir=${encodeURIComponent(n)}` : "", s = await c(
667
+ `${i}/scenario-instances/${e}/workspace/tree${t}`,
668
+ a
669
+ );
670
+ return r(s, "获取文件树失败");
671
+ }
672
+ async function Bn() {
673
+ const e = await c(`${i}/workspace/env`, a);
674
+ return r(e, "获取环境信息失败");
675
+ }
676
+ async function Fn(e) {
677
+ const n = await c(
678
+ `${i}/scenario-instances/${e}/workspace/sync-from-prod`,
679
+ {
680
+ ...a,
681
+ method: "POST",
682
+ headers: { "Content-Type": "application/json" }
683
+ }
684
+ );
685
+ return r(n, "同步失败");
686
+ }
687
+ async function xn(e, n) {
688
+ const t = await c(
689
+ `${i}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
690
+ n
691
+ )}`,
692
+ a
693
+ );
694
+ return r(t, "获取文件内容失败");
695
+ }
696
+ async function Wn(e, n, t) {
697
+ const s = await c(
698
+ `${i}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
699
+ n
700
+ )}`,
701
+ {
702
+ ...a,
703
+ method: "POST",
704
+ headers: { "Content-Type": "application/json" },
705
+ body: JSON.stringify({ content: t })
706
+ }
707
+ );
708
+ return r(s, "保存文件失败");
709
+ }
710
+ async function Hn(e, n, t) {
711
+ const s = await c(
712
+ `${i}/scenario-instances/${e}/workspace/rename`,
713
+ {
714
+ ...a,
715
+ method: "PUT",
716
+ headers: { "Content-Type": "application/json" },
717
+ body: JSON.stringify({ old_path: n, new_name: t })
718
+ }
719
+ );
720
+ return r(s, "重命名失败");
721
+ }
722
+ async function Gn(e, n, t) {
723
+ const s = await c(
724
+ `${i}/scenario-instances/${e}/workspace/new-file`,
725
+ {
726
+ ...a,
727
+ method: "POST",
728
+ headers: { "Content-Type": "application/json" },
729
+ body: JSON.stringify({ parent_path: n, name: t })
730
+ }
731
+ );
732
+ return r(s, "新建文件失败");
733
+ }
734
+ async function Zn(e, n, t) {
735
+ const s = await c(
736
+ `${i}/scenario-instances/${e}/workspace/new-folder`,
737
+ {
738
+ ...a,
739
+ method: "POST",
740
+ headers: { "Content-Type": "application/json" },
741
+ body: JSON.stringify({ parent_path: n, name: t })
742
+ }
743
+ );
744
+ return r(s, "新建文件夹失败");
745
+ }
746
+ async function Vn(e, n) {
747
+ const t = await c(
748
+ `${i}/scenario-instances/${e}/workspace/delete`,
749
+ {
750
+ ...a,
751
+ method: "POST",
752
+ headers: { "Content-Type": "application/json" },
753
+ body: JSON.stringify({ path: n })
754
+ }
755
+ );
756
+ return r(t, "删除失败");
757
+ }
758
+ async function Qn(e, n, t) {
759
+ const s = new FormData();
760
+ s.append("file", t), s.append("parent_path", n);
761
+ const o = await c(
762
+ `${i}/scenario-instances/${e}/workspace/upload-file`,
763
+ {
764
+ ...a,
765
+ method: "POST",
766
+ body: s
767
+ }
768
+ );
769
+ return r(o, "上传文件失败");
770
+ }
771
+ async function Kn(e, n, t) {
772
+ const s = new FormData();
773
+ t.forEach((d) => s.append("files", d)), s.append("parent_path", n);
774
+ const o = await c(
775
+ `${i}/scenario-instances/${e}/workspace/upload-folder`,
776
+ {
777
+ ...a,
778
+ method: "POST",
779
+ body: s
780
+ }
781
+ );
782
+ return r(o, "上传文件夹失败");
783
+ }
784
+ async function Xn(e, n) {
785
+ const t = await c(
786
+ `${i}/scenario-instances/${e}/workspace/download?file_path=${encodeURIComponent(
787
+ n
788
+ )}`,
789
+ a
790
+ );
791
+ if (!t.ok) throw new Error("下载失败");
792
+ return t.blob();
793
+ }
794
+ async function ze(e, n = "") {
795
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
796
+ `${i}/scenario-instances/${e}${t}`,
797
+ a
798
+ ), o = await r(s, "获取项目失败"), d = o.status === "FOUND" ? "FOUND" : "NOT_FOUND", u = o.scenario_instance ?? o.scenarioInstance ?? null;
799
+ return {
800
+ status: d,
801
+ scenarioInstance: u ? w(u) : null
802
+ };
803
+ }
804
+ async function Me(e, n = "") {
805
+ const t = await ze(e, n);
806
+ if (t.status === "NOT_FOUND" || !t.scenarioInstance)
807
+ throw {
808
+ _apiUserError: !0,
809
+ userMessage: "项目不存在",
810
+ message: "项目不存在"
811
+ };
812
+ return t.scenarioInstance;
813
+ }
814
+ async function Be(e, n = "") {
815
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
816
+ `${i}/scenario-instances/${e}/join-self${t}`,
817
+ {
818
+ ...a,
819
+ method: "POST"
820
+ }
821
+ ), o = await r(s, "加入工程失败");
822
+ return w(o);
823
+ }
824
+ async function Yn(e, n = "") {
825
+ return await Me(e, n), Be(e, n);
826
+ }
827
+ async function et(e) {
828
+ const n = await c(`${i}/scenario-instances/${e}`, {
829
+ ...a,
830
+ method: "DELETE"
831
+ });
832
+ return r(n, "删除项目失败");
833
+ }
834
+ async function nt(e, n, t = "") {
835
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
836
+ `${i}/scenario-instances/${e}/fork${s}`,
837
+ {
838
+ ...a,
839
+ method: "POST",
840
+ headers: { "Content-Type": "application/json" },
841
+ body: JSON.stringify({ mode: n })
842
+ }
843
+ ), d = await r(o, "Fork 项目失败");
844
+ return w(d);
845
+ }
846
+ async function tt(e, n) {
847
+ const t = await c(`${i}/scenario-instances/${e}`, {
848
+ ...a,
849
+ method: "PATCH",
850
+ headers: { "Content-Type": "application/json" },
851
+ body: JSON.stringify(n)
852
+ }), s = await r(t, "更新项目失败");
853
+ return w(s);
854
+ }
855
+ async function st(e) {
856
+ const n = await c(
857
+ `${i}/scenario-instances/${e}/retry-image-parse`,
858
+ {
859
+ ...a,
860
+ method: "POST",
861
+ headers: { "Content-Type": "application/json" }
862
+ }
863
+ ), s = await r(n, "图片重新解析失败");
864
+ return {
865
+ success: !!s.success,
866
+ message: s.message
867
+ };
868
+ }
869
+ let l = null, re = [], ie = [], h = 0, G = "", U = null, I = 0, y = null;
870
+ function P(e) {
871
+ ie.forEach((n) => n(e));
872
+ }
873
+ function Fe(e, n = "") {
874
+ const t = window.location.protocol === "https:" ? "wss:" : "ws:", s = window.location.host, o = n ? `?token=${encodeURIComponent(n)}` : "";
875
+ return `${t}//${s}${Re}/${e}/ws${o}`;
876
+ }
877
+ function xe(e, n = "", t) {
878
+ if (l && (l.readyState === WebSocket.CONNECTING || l.readyState === WebSocket.OPEN) && h === e)
879
+ return;
880
+ l && (l.onclose = null, l.close(), l = null), y != null && (clearTimeout(y), y = null);
881
+ const s = Fe(e, n);
882
+ h = e, G = n, t && (U = t), P("connecting"), l = new WebSocket(s), l.onopen = () => {
883
+ I = 0, P("connected"), console.log("[WS] connected");
884
+ }, l.onmessage = (o) => {
885
+ try {
886
+ const d = JSON.parse(o.data);
887
+ console.log("[WS recv]", d.type, d), re.forEach((u) => u(d));
888
+ } catch {
889
+ }
890
+ }, l.onerror = () => {
891
+ console.warn("[WS] connection error:", s);
892
+ }, l.onclose = (o) => {
893
+ const d = o.wasClean;
894
+ if (l = null, P("disconnected"), h === 0) return;
895
+ I += 1;
896
+ const u = Math.min(3e3 * I, 3e4);
897
+ console.warn(
898
+ `[WS] closed (clean=${d}), reconnect #${I} in ${u}ms`
899
+ ), y = setTimeout(() => {
900
+ y = null, h !== 0 && h !== "" && (xe(h, G), U == null || U());
901
+ }, u);
902
+ };
903
+ }
904
+ async function ot(e) {
905
+ l && l.readyState === WebSocket.OPEN && l.send(JSON.stringify(e));
906
+ }
907
+ function at() {
908
+ h = 0, y != null && (clearTimeout(y), y = null), l && (l.onclose = null, l.close(), l = null), I = 0, P("disconnected"), re = [], ie = [];
909
+ }
910
+ async function rt(e, n, t = "") {
911
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
912
+ `${i}/scenario-instances/${e}/task-sessions/${n}${s}`,
913
+ {
914
+ ...a,
915
+ method: "POST",
916
+ headers: { "Content-Type": "application/json" }
917
+ }
918
+ );
919
+ return r(o, "创建任务会话失败");
920
+ }
921
+ async function it(e, n, t = 50, s, o = "") {
922
+ let d = `${i}/scenario-instances/${e}/task-sessions/${n}/messages?limit=${t}`;
923
+ s && (d += `&before=${s}`), o && (d += `&token=${encodeURIComponent(o)}`);
924
+ const u = await c(d, a);
925
+ return r(u, "获取任务消息失败");
926
+ }
927
+ async function ct(e, n, t, s = "", o) {
928
+ const d = s ? `?token=${encodeURIComponent(s)}` : "", u = { content: t };
929
+ o && o.length > 0 && (u.image_urls = o);
930
+ const f = await c(
931
+ `${i}/scenario-instances/${e}/task-sessions/${n}/messages${d}`,
932
+ {
933
+ ...a,
934
+ method: "POST",
935
+ headers: { "Content-Type": "application/json" },
936
+ body: JSON.stringify(u)
937
+ }
938
+ );
939
+ return r(f, "发送任务消息失败");
940
+ }
941
+ async function dt(e = "") {
942
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/admin/scenarios${n}`, a);
943
+ return r(t, "获取场景列表失败");
944
+ }
945
+ async function ut(e, n, t = "") {
946
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
947
+ `${i}/admin/agents/${encodeURIComponent(
948
+ e
949
+ )}/identity/test-login${s}`,
950
+ {
951
+ ...a,
952
+ method: "POST",
953
+ headers: { "Content-Type": "application/json" },
954
+ body: JSON.stringify(n)
955
+ }
956
+ );
957
+ return r(o, "测试登录失败");
958
+ }
959
+ async function lt(e = "") {
960
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(
961
+ `${i}/admin/agents/identity-envs${n}`,
962
+ a
963
+ );
964
+ return r(t, "获取身份绑定环境列表失败");
965
+ }
966
+ async function mt(e, n = "") {
967
+ const t = new URLSearchParams();
968
+ e && t.set("envCode", e), n && t.set("token", n);
969
+ const s = t.toString() ? `?${t.toString()}` : "", o = await c(
970
+ `${i}/admin/agents/ctc-members${s}`,
971
+ a
972
+ );
973
+ return r(o, "获取成员列表失败") ?? [];
974
+ }
975
+ async function pt(e, n, t = "") {
976
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/admin/agents/${e}/move${s}`, {
977
+ ...a,
978
+ method: "POST",
979
+ headers: { "Content-Type": "application/json" },
980
+ body: JSON.stringify(n)
981
+ });
982
+ return r(o, "移动 Agent 分类失败");
983
+ }
984
+ async function ft(e = "") {
985
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/admin/agents/models${n}`, a);
986
+ return r(t, "获取模型列表失败");
987
+ }
988
+ function L(e) {
989
+ const n = Object.entries(e).filter(([, t]) => t !== void 0 && t !== "").map(([t, s]) => `${t}=${encodeURIComponent(s)}`);
990
+ return n.length ? `?${n.join("&")}` : "";
991
+ }
992
+ async function $t(e, n = "") {
993
+ const t = await c(
994
+ `${i}/admin/agents/${encodeURIComponent(
995
+ e
996
+ )}/ontology${L({ token: n })}`,
997
+ a
998
+ );
999
+ return (await r(
1000
+ t,
1001
+ "获取前置处理配置失败"
1002
+ ) ?? []).map((o) => ({
1003
+ ...o,
1004
+ nodeInfo: { ...o.nodeInfo, dataPrepareEnabled: !1 }
1005
+ }));
1006
+ }
1007
+ async function yt(e, n = "") {
1008
+ const t = await c(
1009
+ `${i}/admin/agents/ontology/ontologies${L({
1010
+ ontologyType: e,
1011
+ token: n
1012
+ })}`,
1013
+ a
1014
+ );
1015
+ return r(t, "获取本体列表失败") ?? [];
1016
+ }
1017
+ async function ht(e, n = "") {
1018
+ const t = await c(
1019
+ `${i}/admin/agents/ontology/knowledges${L({
1020
+ ontologyCode: e,
1021
+ token: n
1022
+ })}`,
1023
+ a
1024
+ );
1025
+ return r(t, "获取知识列表失败") ?? [];
1026
+ }
1027
+ async function gt(e, n, t = "") {
1028
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/admin/skills/${e}/move${s}`, {
1029
+ ...a,
1030
+ method: "POST",
1031
+ headers: { "Content-Type": "application/json" },
1032
+ body: JSON.stringify(n)
1033
+ });
1034
+ return r(o, "移动 Skill 分类失败");
1035
+ }
1036
+ async function St(e = "", n = "") {
1037
+ const t = new URLSearchParams();
1038
+ e && t.append("keyword", e), n && t.append("token", n);
1039
+ const s = t.toString() ? `?${t.toString()}` : "", o = await c(
1040
+ `${i}/admin/profiles/ctc-staff${s}`,
1041
+ a
1042
+ );
1043
+ return r(o, "获取员工列表失败");
1044
+ }
1045
+ async function wt(e, n, t = "", s = "") {
1046
+ const o = new URLSearchParams();
1047
+ o.append("profileScope", e), o.append("memberType", n), t && o.append("scenarioCode", t), s && o.append("token", s);
1048
+ const d = o.toString() ? `?${o.toString()}` : "", u = await c(`${i}/admin/profiles${d}`, a);
1049
+ return r(u, "获取画像列表失败");
1050
+ }
1051
+ async function Tt(e, n = "") {
1052
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/admin/profiles${t}`, {
1053
+ ...a,
1054
+ method: "POST",
1055
+ headers: { "Content-Type": "application/json" },
1056
+ body: JSON.stringify(e)
1057
+ });
1058
+ return r(s, "保存画像失败");
1059
+ }
1060
+ async function It(e, n, t, s = "", o = "") {
1061
+ const d = new URLSearchParams();
1062
+ s && d.append("scenarioCode", s), o && d.append("token", o);
1063
+ const u = d.toString() ? `?${d.toString()}` : "", f = await c(
1064
+ `${i}/admin/profiles/${encodeURIComponent(
1065
+ e
1066
+ )}/${encodeURIComponent(n)}/${encodeURIComponent(t)}${u}`,
1067
+ {
1068
+ ...a,
1069
+ method: "DELETE"
1070
+ }
1071
+ );
1072
+ return r(f, "删除画像失败");
1073
+ }
1074
+ async function _t(e = "", n = "") {
1075
+ const t = new URLSearchParams();
1076
+ e && t.append("scenarioCode", e), n && t.append("token", n);
1077
+ const s = t.toString() ? `?${t.toString()}` : "", o = await c(`${i}/admin/human-on-calls${s}`, a);
1078
+ return r(o, "获取值班信息失败");
1079
+ }
1080
+ async function Ct(e, n, t, s = "") {
1081
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await c(`${i}/admin/human-on-calls/batch${o}`, {
1082
+ ...a,
1083
+ method: "POST",
1084
+ headers: { "Content-Type": "application/json" },
1085
+ body: JSON.stringify({ scenarioCode: e, dayOfWeek: n, onCalls: t })
1086
+ });
1087
+ return r(d, "保存值班信息失败");
1088
+ }
1089
+ async function bt(e, n, t, s = "") {
1090
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await c(
1091
+ `${i}/admin/human-on-calls/${encodeURIComponent(
1092
+ e
1093
+ )}/${t}/${encodeURIComponent(n)}${o}`,
1094
+ { ...a, method: "DELETE" }
1095
+ );
1096
+ return r(d, "删除值班信息失败");
1097
+ }
1098
+ async function At(e = {}, n = "") {
1099
+ const t = [];
1100
+ e.scenarioCode && t.push(`scenario_code=${encodeURIComponent(e.scenarioCode)}`), e.status && t.push(`status=${encodeURIComponent(e.status)}`), n && t.push(`token=${encodeURIComponent(n)}`);
1101
+ const s = t.length > 0 ? `?${t.join("&")}` : "", o = await c(
1102
+ `${i}/admin/scenario-instances/refresh-all-skills${s}`,
1103
+ {
1104
+ ...a,
1105
+ method: "POST"
1106
+ }
1107
+ );
1108
+ return r(o, "全量刷新技能失败");
1109
+ }
1110
+ async function Et(e, n = "") {
1111
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1112
+ `${i}/admin/scenario-instances/${e}/refresh-skills${t}`,
1113
+ {
1114
+ ...a,
1115
+ method: "POST"
1116
+ }
1117
+ );
1118
+ return r(s, "刷新技能失败");
1119
+ }
1120
+ function T(e) {
1121
+ const n = (...s) => {
1122
+ for (const o of s) {
1123
+ const d = e[o];
1124
+ if (d != null && d !== "") return String(d);
1125
+ }
1126
+ return "";
1127
+ }, t = e.shared;
1128
+ return {
1129
+ id: e.id,
1130
+ userId: n("user_id", "userId"),
1131
+ // FE-PRECISION-FIX: agentHubAgentId 声明为 Id,禁止 Number()(会按 float64 抹掉末位)
1132
+ agentHubAgentId: e.agent_hub_agent_id != null ? m(e.agent_hub_agent_id) : e.agenthub_agent_id != null ? m(e.agenthub_agent_id) : e.agentHubAgentId != null ? m(e.agentHubAgentId) : null,
1133
+ agentCode: n("agent_code", "agentCode"),
1134
+ displayName: n("display_name", "displayName"),
1135
+ avatar: e.avatar == null ? null : String(e.avatar),
1136
+ shared: t == null ? void 0 : Number(t),
1137
+ isLocal: e.isLocal,
1138
+ localAgentId: e.localAgentId,
1139
+ localAgentType: e.localAgentType,
1140
+ createTime: e.create_time == null ? e.createTime : String(e.create_time),
1141
+ updateTime: e.update_time == null ? e.updateTime : String(e.update_time)
1142
+ };
1143
+ }
1144
+ async function Ut(e = "") {
1145
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/personal-agents${n}`, a), s = await r(t, "获取个人 Agent 列表失败");
1146
+ return (Array.isArray(s) ? s : []).map((o) => T(o));
1147
+ }
1148
+ async function Ot(e, n = "") {
1149
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/personal-agents${t}`, {
1150
+ ...a,
1151
+ method: "POST",
1152
+ headers: { "Content-Type": "application/json" },
1153
+ body: JSON.stringify({ display_name: e })
1154
+ });
1155
+ return T(
1156
+ await r(s, "创建个人 Agent 失败")
1157
+ );
1158
+ }
1159
+ async function Pt(e, n, t, s, o = "") {
1160
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await c(`${i}/personal-agents/ensure${d}`, {
1161
+ ...a,
1162
+ method: "POST",
1163
+ headers: { "Content-Type": "application/json" },
1164
+ body: JSON.stringify({
1165
+ agenthub_agent_id: e,
1166
+ agent_code: n,
1167
+ display_name: t,
1168
+ avatar: s ?? ""
1169
+ })
1170
+ });
1171
+ return T(
1172
+ await r(u, "创建个人 Agent 失败")
1173
+ );
1174
+ }
1175
+ async function Rt(e, n = "") {
1176
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/personal-agents/${e}${t}`, {
1177
+ ...a,
1178
+ method: "DELETE"
1179
+ });
1180
+ return r(s, "删除个人 Agent 失败");
1181
+ }
1182
+ async function kt(e, n, t = "") {
1183
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/personal-agents/${e}${s}`, {
1184
+ ...a,
1185
+ method: "PUT",
1186
+ headers: { "Content-Type": "application/json" },
1187
+ body: JSON.stringify({ display_name: n })
1188
+ });
1189
+ return T(
1190
+ await r(o, "重命名个人 Agent 失败")
1191
+ );
1192
+ }
1193
+ async function Nt(e = "") {
1194
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(
1195
+ `${i}/personal-agents/shared${n}`,
1196
+ a
1197
+ ), s = await r(
1198
+ t,
1199
+ "获取共享 Agent 列表失败"
1200
+ );
1201
+ return (Array.isArray(s) ? s : []).map(
1202
+ (o) => T(o)
1203
+ );
1204
+ }
1205
+ async function vt(e, n, t = "") {
1206
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/personal-agents/${e}/share${s}`, {
1207
+ ...a,
1208
+ method: "PUT",
1209
+ headers: { "Content-Type": "application/json" },
1210
+ body: JSON.stringify({ shared: n })
1211
+ });
1212
+ return T(
1213
+ await r(o, "切换共享状态失败")
1214
+ );
1215
+ }
1216
+ async function jt(e, n = "") {
1217
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1218
+ `${i}/personal-agents/${e}/sessions${t}`,
1219
+ a
1220
+ );
1221
+ return r(s, "获取会话列表失败");
1222
+ }
1223
+ async function qt(e, n = "新会话", t = "") {
1224
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1225
+ `${i}/personal-agents/${e}/sessions${s}`,
1226
+ {
1227
+ ...a,
1228
+ method: "POST",
1229
+ headers: { "Content-Type": "application/json" },
1230
+ body: JSON.stringify({ title: n })
1231
+ }
1232
+ );
1233
+ return r(o, "创建会话失败");
1234
+ }
1235
+ async function Dt(e, n, t = "") {
1236
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1237
+ `${i}/personal-agents/${e}/sessions/${n}${s}`,
1238
+ { ...a, method: "DELETE" }
1239
+ );
1240
+ return r(o, "删除会话失败");
1241
+ }
1242
+ async function Lt(e, n, t, s = "") {
1243
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await c(
1244
+ `${i}/personal-agents/${e}/sessions/${n}${o}`,
1245
+ {
1246
+ ...a,
1247
+ method: "PUT",
1248
+ headers: { "Content-Type": "application/json" },
1249
+ body: JSON.stringify({ title: t })
1250
+ }
1251
+ );
1252
+ return r(d, "重命名会话失败");
1253
+ }
1254
+ async function Jt(e, n, t = "") {
1255
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1256
+ `${i}/personal-agents/${e}/sessions/${n}/messages${s}`,
1257
+ a
1258
+ );
1259
+ return r(o, "获取消息历史失败");
1260
+ }
1261
+ async function zt(e, n, t, s, o, d, u, f) {
1262
+ const N = s ? `?token=${encodeURIComponent(s)}` : "", ce = `${i}/personal-agents/${e}/sessions/${n}/chat/stream${N}`;
1263
+ try {
1264
+ const $ = await fetch(ce, {
1265
+ ...a,
1266
+ method: "POST",
1267
+ headers: { "Content-Type": "application/json" },
1268
+ body: JSON.stringify({ message: t })
1269
+ });
1270
+ if (!$.ok || !$.body) {
1271
+ const j = await $.text().catch(() => "");
1272
+ d(new Error(j || `HTTP ${$.status}`));
1273
+ return;
1274
+ }
1275
+ const de = $.body.getReader(), ue = new TextDecoder();
1276
+ let v = "", b = "";
1277
+ for (; ; ) {
1278
+ const { done: j, value: le } = await de.read();
1279
+ if (j) break;
1280
+ v += ue.decode(le, { stream: !0 });
1281
+ const J = v.split(`
1282
+ `);
1283
+ v = J.pop() || "";
1284
+ for (const me of J) {
1285
+ const S = me.trim();
1286
+ if (!S) {
1287
+ b = "";
1288
+ continue;
1289
+ }
1290
+ if (!S.startsWith(":")) {
1291
+ if (S.startsWith("event:")) {
1292
+ b = S.slice(6).trim();
1293
+ continue;
1294
+ }
1295
+ if (S.startsWith("data:")) {
1296
+ const A = S.slice(5).trim();
1297
+ if (b === "replace") {
1298
+ f && f(A), b = "";
1299
+ continue;
1300
+ }
1301
+ if (A.startsWith("[error]")) {
1302
+ d(new Error(A.slice(7).trim()));
1303
+ return;
1304
+ }
1305
+ o(A);
1306
+ }
1307
+ }
1308
+ }
1309
+ }
1310
+ u();
1311
+ } catch ($) {
1312
+ d($ instanceof Error ? $ : new Error(String($)));
1313
+ }
1314
+ }
1315
+ const We = "http://127.0.0.1:28080";
1316
+ async function Mt(e) {
1317
+ await fetch(`${We}/v1/sessions/${e}`, {
1318
+ method: "DELETE"
1319
+ });
1320
+ }
1321
+ async function Bt(e = {}) {
1322
+ const n = new URLSearchParams(), { name: t, scenarioInstanceId: s, page: o = 1, size: d = 50, token: u = "" } = e;
1323
+ t && n.set("name", t), s != null && s !== "" && n.set("scenarioInstanceId", String(s)), n.set("page", String(o)), n.set("size", String(d)), u && n.set("token", u);
1324
+ const f = n.toString(), N = await c(
1325
+ `${i}/admin/tasks${f ? `?${f}` : ""}`,
1326
+ a
1327
+ );
1328
+ return r(N, "获取任务列表失败");
1329
+ }
1330
+ function He(e) {
1331
+ const n = new URLSearchParams();
1332
+ Object.entries(e).forEach(([s, o]) => {
1333
+ o != null && o !== "" && n.append(s, String(o));
1334
+ });
1335
+ const t = n.toString();
1336
+ return t ? `?${t}` : "";
1337
+ }
1338
+ async function Ft(e) {
1339
+ const n = await c(
1340
+ `${i}/admin/tool-call-logs/timeline${He(e)}`,
1341
+ a
1342
+ );
1343
+ return r(n, "查询工具调用时间轴统计失败");
1344
+ }
1345
+ async function xt(e) {
1346
+ const n = [];
1347
+ e.date && n.push(`date=${encodeURIComponent(e.date)}`), e.scenarioCode && n.push(`scenarioCode=${encodeURIComponent(e.scenarioCode)}`), e.token && n.push(`token=${encodeURIComponent(e.token)}`);
1348
+ const t = n.length > 0 ? `?${n.join("&")}` : "", s = await c(
1349
+ `${i}/admin/statistics/token-daily${t}`,
1350
+ a
1351
+ );
1352
+ return r(s, "获取 Token 单日统计失败");
1353
+ }
1354
+ async function Wt(e = "z-team") {
1355
+ const n = await c(
1356
+ `${i}/change-log/versions?repo=${encodeURIComponent(e)}`,
1357
+ a
1358
+ );
1359
+ return r(n, "获取变更日志版本列表失败");
1360
+ }
1361
+ async function Ht(e, n, t = "z-team") {
1362
+ const s = new URLSearchParams();
1363
+ e != null && s.set("versionId", String(e)), s.set("repo", t);
1364
+ const o = await c(
1365
+ `${i}/change-log/detail?${s.toString()}`,
1366
+ a
1367
+ );
1368
+ return r(o, "获取变更日志详情失败");
1369
+ }
1370
+ async function Gt(e) {
1371
+ const n = await c(
1372
+ `${Ne}/evolution/records/${e}/reset`,
1373
+ { ...a, method: "POST" }
1374
+ );
1375
+ return r(n, "操作失败");
1376
+ }
1377
+ function p(e) {
1378
+ const n = new URLSearchParams();
1379
+ Object.entries(e).forEach(([s, o]) => {
1380
+ o != null && o !== "" && n.append(s, String(o));
1381
+ });
1382
+ const t = n.toString();
1383
+ return t ? `?${t}` : "";
1384
+ }
1385
+ async function Zt(e) {
1386
+ const n = await c(
1387
+ `${i}/admin/qa-eval/closed-instances${p({
1388
+ close_date: e.closeDate,
1389
+ close_date_start: e.closeDateStart,
1390
+ close_date_end: e.closeDateEnd,
1391
+ scenario_code: e.scenarioCode,
1392
+ token: e.token
1393
+ })}`,
1394
+ a
1395
+ ), t = await r(
1396
+ n,
1397
+ "获取已关单实例列表失败"
1398
+ );
1399
+ return Array.isArray(t == null ? void 0 : t.list) ? t.list : [];
1400
+ }
1401
+ async function Vt(e) {
1402
+ const n = await c(
1403
+ `${i}/admin/qa-eval/overview${p({
1404
+ close_date: e.closeDate,
1405
+ close_date_start: e.closeDateStart,
1406
+ close_date_end: e.closeDateEnd,
1407
+ scenario_code: e.scenarioCode,
1408
+ token: e.token
1409
+ })}`,
1410
+ a
1411
+ );
1412
+ return r(n, "获取 QA 评测总览失败");
1413
+ }
1414
+ async function Qt(e, n = "") {
1415
+ const t = await c(
1416
+ `${i}/admin/qa-eval/report/${e}/cancel${p({
1417
+ token: n
1418
+ })}`,
1419
+ { ...a, method: "POST" }
1420
+ );
1421
+ return r(t, "取消评测失败");
1422
+ }
1423
+ async function Kt(e, n, t = "") {
1424
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1425
+ `${i}/admin/scenario-templates/preview${s}`,
1426
+ {
1427
+ ...a,
1428
+ method: "POST",
1429
+ headers: { "Content-Type": "application/json" },
1430
+ body: JSON.stringify({ html: e, data: n })
1431
+ }
1432
+ );
1433
+ if (!o.ok) throw new Error(`HTTP ${o.status}`);
1434
+ return o.text();
1435
+ }
1436
+ async function Xt(e, n = "") {
1437
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1438
+ `${i}/tasks/${e}/human-assist${t}`,
1439
+ { ...a, method: "GET" }
1440
+ );
1441
+ return r(s, "查询人机协助卡片失败");
1442
+ }
1443
+ async function Yt(e, n, t, s = "") {
1444
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await c(
1445
+ `${i}/scenario-instances/${e}/card-forms/${n}/submit${o}`,
1446
+ {
1447
+ ...a,
1448
+ method: "POST",
1449
+ headers: { "Content-Type": "application/json" },
1450
+ body: JSON.stringify({ value: t })
1451
+ }
1452
+ );
1453
+ return r(d, "提交卡片表单失败");
1454
+ }
1455
+ async function es(e, n, t = "") {
1456
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1457
+ `${i}/tasks/${e}/submit-assist${s}`,
1458
+ {
1459
+ ...a,
1460
+ method: "POST",
1461
+ headers: { "Content-Type": "application/json" },
1462
+ body: JSON.stringify({ value: n })
1463
+ }
1464
+ );
1465
+ return r(o, "提交人机协助任务失败");
1466
+ }
1467
+ function ns(e) {
1468
+ return webIdeFetch(`/instances/${e}`, { method: "DELETE" });
1469
+ }
1470
+ async function ts(e = "") {
1471
+ const n = await c(
1472
+ `${i}/admin/runtime-monitor/schedule${p({ token: e })}`,
1473
+ a
1474
+ );
1475
+ return r(n, "查询定时任务概览失败");
1476
+ }
1477
+ async function ss(e) {
1478
+ const n = new URLSearchParams();
1479
+ n.set("scenarioCode", e.scenarioCode), e.startDate && n.set("startDate", e.startDate), e.endDate && n.set("endDate", e.endDate), e.creatorId && n.set("creatorId", e.creatorId), e.tagFilters && Object.keys(e.tagFilters).length > 0 && n.set("tagFilters", JSON.stringify(e.tagFilters)), e.groupBy && n.set("groupBy", e.groupBy), e.token && n.set("token", e.token);
1480
+ const t = await c(
1481
+ `${i}/admin/statistics/business?${n.toString()}`,
1482
+ a
1483
+ ), s = await r(t, "业务指标查询失败");
1484
+ return {
1485
+ total: Number((s == null ? void 0 : s.total) ?? 0),
1486
+ trend: Array.isArray(s == null ? void 0 : s.trend) ? s.trend : [],
1487
+ ranking: Array.isArray(s == null ? void 0 : s.ranking) ? s.ranking : [],
1488
+ tagCoverage: (s == null ? void 0 : s.tagCoverage) ?? void 0,
1489
+ creatorDistribution: Array.isArray(s == null ? void 0 : s.creatorDistribution) ? s.creatorDistribution : void 0,
1490
+ dailyAvg: (s == null ? void 0 : s.dailyAvg) ?? void 0,
1491
+ activeCreators: (s == null ? void 0 : s.activeCreators) ?? void 0
1492
+ };
1493
+ }
1494
+ async function os(e, n = "") {
1495
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1496
+ `${i}/admin/scenario-tags/values/${e}${t}`,
1497
+ {
1498
+ ...a,
1499
+ method: "DELETE"
1500
+ }
1501
+ );
1502
+ return r(s, "删除标签值失败");
1503
+ }
1504
+ async function as(e, n, t) {
1505
+ const s = await c(
1506
+ `${i}/scenario-instances/${e}/workspace/git-clone`,
1507
+ {
1508
+ ...a,
1509
+ method: "POST",
1510
+ headers: { "Content-Type": "application/json" },
1511
+ body: JSON.stringify({
1512
+ parent_path: n,
1513
+ url: t.url,
1514
+ branch: t.branch ?? "",
1515
+ folder_name: t.folderName ?? ""
1516
+ })
1517
+ }
1518
+ );
1519
+ return r(s, "Git Clone 失败");
1520
+ }
1521
+ async function rs() {
1522
+ const e = await c(
1523
+ `${i}/scenarios/biz-consult-domains`,
1524
+ a
1525
+ );
1526
+ return r(e, "获取业务域选项失败");
1527
+ }
1528
+ async function is(e, n, t = "") {
1529
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/todo/projects/${e}${s}`, {
1530
+ ...a,
1531
+ method: "PUT",
1532
+ headers: { "Content-Type": "application/json" },
1533
+ body: JSON.stringify(n)
1534
+ });
1535
+ return r(o, "更新项目失败");
1536
+ }
1537
+ async function cs(e, n = "") {
1538
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/todo/items/reorder-batch${t}`, {
1539
+ ...a,
1540
+ method: "POST",
1541
+ headers: { "Content-Type": "application/json" },
1542
+ body: JSON.stringify({ updates: e })
1543
+ });
1544
+ return r(s, "调整排序失败");
1545
+ }
1546
+ async function ds(e, n = "") {
1547
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/todo/projects/reorder-batch${t}`, {
1548
+ ...a,
1549
+ method: "POST",
1550
+ headers: { "Content-Type": "application/json" },
1551
+ body: JSON.stringify({ updates: e })
1552
+ });
1553
+ return r(s, "调整项目排序失败");
1554
+ }
1555
+ async function us(e = "") {
1556
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(
1557
+ `${i}/admin/statistics/current-dept${n}`,
1558
+ a
1559
+ );
1560
+ return r(t, "获取当前用户部门信息失败");
1561
+ }
1562
+ function Ge(e) {
1563
+ const n = new URLSearchParams();
1564
+ Object.entries(e).forEach(([s, o]) => {
1565
+ o != null && o !== "" && n.append(s, String(o));
1566
+ });
1567
+ const t = n.toString();
1568
+ return t ? `?${t}` : "";
1569
+ }
1570
+ async function ls(e) {
1571
+ const n = await c(
1572
+ `${i}/admin/evaluation/instances/${e.id}/snapshot-preview${Ge({
1573
+ section: e.section,
1574
+ page: e.page,
1575
+ size: e.size,
1576
+ task_id: e.taskId,
1577
+ token: e.token
1578
+ })}`,
1579
+ a
1580
+ );
1581
+ return r(n, "获取快照预览失败");
1582
+ }
1583
+ const Ze = typeof window < "u" && window.ZTEAM_WEBIDE_ADMIN_BASE || "http://localhost/kapi/webide/admin";
1584
+ async function Ve(e, n) {
1585
+ try {
1586
+ const t = await fetch(`${Ze}${e}`, {
1587
+ credentials: "include",
1588
+ headers: {
1589
+ Accept: "application/json",
1590
+ "Content-Type": "application/json"
1591
+ },
1592
+ ...n
1593
+ });
1594
+ return t.ok ? t.json() : {};
1595
+ } catch {
1596
+ return {};
1597
+ }
1598
+ }
1599
+ function ms(e) {
1600
+ return Ve(`/presets/${e}`, { method: "DELETE" });
1601
+ }
1602
+ const ps = ee;
1603
+ async function fs(e) {
1604
+ const n = new FormData();
1605
+ n.append("file", e);
1606
+ const t = await c(`${i}/common/upload-video`, {
1607
+ method: "POST",
1608
+ body: n
1609
+ }), s = await r(t, "上传视频失败"), o = typeof (s == null ? void 0 : s.url) == "string" ? s.url : "";
1610
+ if (!o) {
1611
+ const d = "上传视频失败:响应缺少视频地址";
1612
+ throw g(d), { _apiUserError: !0, userMessage: d, message: d };
1613
+ }
1614
+ return o;
1615
+ }
1616
+ function $s() {
1617
+ const e = "登录已失效,请重新登录";
1618
+ throw g(e), { _apiUserError: !0, userMessage: e, message: e };
1619
+ }
1620
+ async function ys(e) {
1621
+ const n = await c(
1622
+ `${i}/scenario-instances/${e}/interaction-mode`,
1623
+ { ...a }
1624
+ ), t = await r(
1625
+ n,
1626
+ "查询交互模式失败"
1627
+ );
1628
+ return (t == null ? void 0 : t.mode) ?? "dispatch";
1629
+ }
1630
+ async function hs(e, n) {
1631
+ const t = await c(
1632
+ `${i}/scenario-instances/${e}/interaction-mode`,
1633
+ {
1634
+ ...a,
1635
+ method: "PUT",
1636
+ headers: { "Content-Type": "application/json" },
1637
+ body: JSON.stringify({ mode: n })
1638
+ }
1639
+ ), s = await r(
1640
+ t,
1641
+ "切换交互模式失败"
1642
+ );
1643
+ return (s == null ? void 0 : s.mode) ?? n;
1644
+ }
1645
+ async function gs(e = "") {
1646
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(
1647
+ `${i}/admin/indexer/overview${n}`,
1648
+ a
1649
+ );
1650
+ return r(t, "获取索引概览失败");
1651
+ }
1652
+ async function Ss(e = "") {
1653
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/admin/indexer/repos${n}`, a), s = await r(
1654
+ t,
1655
+ "获取索引仓库列表失败"
1656
+ );
1657
+ return Array.isArray(s == null ? void 0 : s.repos) ? s.repos : [];
1658
+ }
1659
+ async function ws(e, n = "") {
1660
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/admin/indexer/repos${t}`, {
1661
+ ...a,
1662
+ method: "POST",
1663
+ headers: { "Content-Type": "application/json" },
1664
+ body: JSON.stringify(e)
1665
+ });
1666
+ return r(s, "保存索引仓库失败");
1667
+ }
1668
+ async function Ts(e, n = "") {
1669
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1670
+ `${i}/admin/indexer/repos/${encodeURIComponent(e)}${t}`,
1671
+ { ...a, method: "DELETE" }
1672
+ );
1673
+ return r(s, "删除索引仓库失败");
1674
+ }
1675
+ async function Is(e, n, t = "") {
1676
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(
1677
+ `${i}/admin/indexer/repos/${encodeURIComponent(
1678
+ e
1679
+ )}/enabled${s}`,
1680
+ {
1681
+ ...a,
1682
+ method: "PUT",
1683
+ headers: { "Content-Type": "application/json" },
1684
+ body: JSON.stringify({ enabled: n })
1685
+ }
1686
+ );
1687
+ return r(o, "切换仓库启停失败");
1688
+ }
1689
+ async function _s(e, n = "") {
1690
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1691
+ `${i}/admin/indexer/repos/${encodeURIComponent(
1692
+ e
1693
+ )}/rebuild${t}`,
1694
+ { ...a, method: "POST" }
1695
+ );
1696
+ return r(s, "触发重建失败");
1697
+ }
1698
+ async function Cs(e = "") {
1699
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/admin/indexer/poll${n}`, {
1700
+ ...a,
1701
+ method: "POST"
1702
+ });
1703
+ return r(t, "触发轮询失败");
1704
+ }
1705
+ async function bs(e = "") {
1706
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(
1707
+ `${i}/admin/notify-channel/list${n}`,
1708
+ a
1709
+ ), s = await r(
1710
+ t,
1711
+ "获取消息渠道状态失败"
1712
+ );
1713
+ return Array.isArray(s == null ? void 0 : s.channels) ? s.channels : [];
1714
+ }
1715
+ async function As(e, n = "") {
1716
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/admin/notify-channel/test${t}`, {
1717
+ ...a,
1718
+ method: "POST",
1719
+ headers: { "Content-Type": "application/json" },
1720
+ body: JSON.stringify(e)
1721
+ });
1722
+ return r(s, "测试发送失败");
1723
+ }
1724
+ async function Es(e, n = "") {
1725
+ const t = await c(
1726
+ `${i}/admin/schedule-task${p({
1727
+ token: n,
1728
+ task_type: e.taskType,
1729
+ page: e.page,
1730
+ size: e.size
1731
+ })}`,
1732
+ a
1733
+ );
1734
+ return r(t, "查询定时任务模版失败");
1735
+ }
1736
+ async function Us(e, n = "") {
1737
+ const t = await c(
1738
+ `${i}/admin/schedule-task${p({ token: n })}`,
1739
+ {
1740
+ ...a,
1741
+ method: "POST",
1742
+ headers: { "Content-Type": "application/json" },
1743
+ body: JSON.stringify(e)
1744
+ }
1745
+ );
1746
+ return r(t, "新建定时任务模版失败");
1747
+ }
1748
+ async function Os(e, n, t = "") {
1749
+ const s = await c(
1750
+ `${i}/admin/schedule-task/${encodeURIComponent(
1751
+ e
1752
+ )}${p({ token: t })}`,
1753
+ {
1754
+ ...a,
1755
+ method: "PUT",
1756
+ headers: { "Content-Type": "application/json" },
1757
+ body: JSON.stringify(n)
1758
+ }
1759
+ );
1760
+ return r(s, "更新定时任务模版失败");
1761
+ }
1762
+ async function Ps(e, n, t = "") {
1763
+ const s = await c(
1764
+ `${i}/admin/schedule-task/${encodeURIComponent(
1765
+ e
1766
+ )}/toggle${p({ token: t })}`,
1767
+ {
1768
+ ...a,
1769
+ method: "POST",
1770
+ headers: { "Content-Type": "application/json" },
1771
+ body: JSON.stringify({ enabled: n })
1772
+ }
1773
+ );
1774
+ return r(s, "切换模版状态失败");
1775
+ }
1776
+ async function Rs(e, n = "") {
1777
+ const t = await c(
1778
+ `${i}/admin/schedule-task/${encodeURIComponent(
1779
+ e
1780
+ )}/activate${p({ token: n })}`,
1781
+ { ...a, method: "POST" }
1782
+ );
1783
+ return r(t, "激活模版失败");
1784
+ }
1785
+ async function ks(e, n = "") {
1786
+ const t = await c(
1787
+ `${i}/admin/schedule-task/${encodeURIComponent(
1788
+ e
1789
+ )}${p({ token: n })}`,
1790
+ { ...a, method: "DELETE" }
1791
+ );
1792
+ return r(t, "删除模版失败");
1793
+ }
1794
+ async function Ns(e, n = "") {
1795
+ const t = await c(
1796
+ `${i}/admin/schedule-task/${encodeURIComponent(
1797
+ e
1798
+ )}/run${p({ token: n })}`,
1799
+ { ...a, method: "POST" }
1800
+ );
1801
+ return r(t, "手动执行失败");
1802
+ }
1803
+ async function vs(e, n = "") {
1804
+ const t = await c(
1805
+ `${i}/admin/schedule-task/history-all${p({
1806
+ token: n,
1807
+ task_type: e.taskType,
1808
+ page: e.page,
1809
+ size: e.size
1810
+ })}`,
1811
+ a
1812
+ );
1813
+ return r(t, "查询运行记录失败");
1814
+ }
1815
+ async function js(e, n, t, s, o = "") {
1816
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await c(
1817
+ `${i}/admin/permissions/users/${e}/roles${d}`,
1818
+ {
1819
+ ...a,
1820
+ method: "PUT",
1821
+ headers: { "Content-Type": "application/json" },
1822
+ body: JSON.stringify({ staffName: n, accountNo: t, roleIds: s })
1823
+ }
1824
+ );
1825
+ return r(u, "更新用户角色失败");
1826
+ }
1827
+ async function qs(e, n = "") {
1828
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1829
+ `${i}/admin/permissions/users/${e}/detail${t}`,
1830
+ a
1831
+ );
1832
+ return r(s, "获取用户授权详情失败");
1833
+ }
1834
+ async function Ds(e = "") {
1835
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await c(`${i}/admin/roles${n}`, a);
1836
+ return r(t, "获取角色列表失败") ?? [];
1837
+ }
1838
+ async function Ls(e, n = "") {
1839
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(
1840
+ `${i}/admin/roles/${e}${t}`,
1841
+ a
1842
+ );
1843
+ return r(s, "获取角色详情失败");
1844
+ }
1845
+ async function Js(e, n = "") {
1846
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/admin/roles${t}`, {
1847
+ ...a,
1848
+ method: "POST",
1849
+ headers: { "Content-Type": "application/json" },
1850
+ body: JSON.stringify(e)
1851
+ });
1852
+ return r(s, "创建角色失败");
1853
+ }
1854
+ async function zs(e, n, t = "") {
1855
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/admin/roles/${e}${s}`, {
1856
+ ...a,
1857
+ method: "PUT",
1858
+ headers: { "Content-Type": "application/json" },
1859
+ body: JSON.stringify(n)
1860
+ });
1861
+ return r(o, "更新角色失败");
1862
+ }
1863
+ async function Ms(e, n = "") {
1864
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await c(`${i}/admin/roles/${e}${t}`, {
1865
+ ...a,
1866
+ method: "DELETE"
1867
+ });
1868
+ return r(s, "删除角色失败");
1869
+ }
1870
+ async function Bs(e, n, t = "") {
1871
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await c(`${i}/admin/roles/${e}/users${s}`, {
1872
+ ...a,
1873
+ method: "PUT",
1874
+ headers: { "Content-Type": "application/json" },
1875
+ body: JSON.stringify({ users: n })
1876
+ });
1877
+ return r(o, "更新角色成员失败");
1878
+ }
1879
+ export {
1880
+ Rn as $,
1881
+ zn as A,
1882
+ sn as B,
1883
+ ct as C,
1884
+ it as D,
1885
+ Yn as E,
1886
+ rt as F,
1887
+ Fn as G,
1888
+ Mn as H,
1889
+ Bn as I,
1890
+ Jn as J,
1891
+ ln as K,
1892
+ Ln as L,
1893
+ ot as M,
1894
+ Xn as N,
1895
+ Kn as O,
1896
+ Qn as P,
1897
+ Tn as Q,
1898
+ Vn as R,
1899
+ Zn as S,
1900
+ ee as T,
1901
+ Gn as U,
1902
+ Hn as V,
1903
+ Wn as W,
1904
+ xn as X,
1905
+ vn as Y,
1906
+ Nn as Z,
1907
+ kn as _,
1908
+ cn as a,
1909
+ lt as a$,
1910
+ Pn as a0,
1911
+ On as a1,
1912
+ qn as a2,
1913
+ jn as a3,
1914
+ An as a4,
1915
+ bn as a5,
1916
+ En as a6,
1917
+ Un as a7,
1918
+ Cn as a8,
1919
+ tt as a9,
1920
+ on as aA,
1921
+ Xt as aB,
1922
+ es as aC,
1923
+ Yt as aD,
1924
+ i as aE,
1925
+ ys as aF,
1926
+ hs as aG,
1927
+ wn as aH,
1928
+ r as aI,
1929
+ en as aJ,
1930
+ ps as aK,
1931
+ $s as aL,
1932
+ Gt as aM,
1933
+ st as aN,
1934
+ as as aO,
1935
+ fs as aP,
1936
+ Ne as aQ,
1937
+ Pt as aR,
1938
+ rs as aS,
1939
+ mt as aT,
1940
+ St as aU,
1941
+ yn as aV,
1942
+ an as aW,
1943
+ $t as aX,
1944
+ yt as aY,
1945
+ ht as aZ,
1946
+ pt as a_,
1947
+ nt as aa,
1948
+ et as ab,
1949
+ hn as ac,
1950
+ w as ad,
1951
+ pn as ae,
1952
+ Mt as af,
1953
+ Jt as ag,
1954
+ ft as ah,
1955
+ jt as ai,
1956
+ qt as aj,
1957
+ Lt as ak,
1958
+ Dt as al,
1959
+ zt as am,
1960
+ Ut as an,
1961
+ Nt as ao,
1962
+ Ot as ap,
1963
+ Rt as aq,
1964
+ kt as ar,
1965
+ vt as as,
1966
+ De as at,
1967
+ is as au,
1968
+ cs as av,
1969
+ ds as aw,
1970
+ ns as ax,
1971
+ gn as ay,
1972
+ un as az,
1973
+ rn as b,
1974
+ ut as b0,
1975
+ F as b1,
1976
+ we as b2,
1977
+ Bt as b3,
1978
+ Ft as b4,
1979
+ dt as b5,
1980
+ ls as b6,
1981
+ wt as b7,
1982
+ It as b8,
1983
+ Tt as b9,
1984
+ ts as bA,
1985
+ vs as bB,
1986
+ Es as bC,
1987
+ Os as bD,
1988
+ Us as bE,
1989
+ Ps as bF,
1990
+ Rs as bG,
1991
+ Ns as bH,
1992
+ ks as bI,
1993
+ gt as bJ,
1994
+ ss as bK,
1995
+ us as bL,
1996
+ xt as bM,
1997
+ os as bN,
1998
+ ms as bO,
1999
+ Ss as ba,
2000
+ gs as bb,
2001
+ _s as bc,
2002
+ Is as bd,
2003
+ Ts as be,
2004
+ Cs as bf,
2005
+ ws as bg,
2006
+ bs as bh,
2007
+ As as bi,
2008
+ _t as bj,
2009
+ Ct as bk,
2010
+ bt as bl,
2011
+ Ds as bm,
2012
+ Ls as bn,
2013
+ Js as bo,
2014
+ zs as bp,
2015
+ Ms as bq,
2016
+ Bs as br,
2017
+ qs as bs,
2018
+ js as bt,
2019
+ Qt as bu,
2020
+ Zt as bv,
2021
+ Vt as bw,
2022
+ Et as bx,
2023
+ At as by,
2024
+ Kt as bz,
2025
+ Le as c,
2026
+ Ae as d,
2027
+ dn as e,
2028
+ V as f,
2029
+ Sn as g,
2030
+ fn as h,
2031
+ pe as i,
2032
+ q as j,
2033
+ Wt as k,
2034
+ Ht as l,
2035
+ Xe as m,
2036
+ xe as n,
2037
+ nn as o,
2038
+ In as p,
2039
+ tn as q,
2040
+ at as r,
2041
+ Dn as s,
2042
+ m as t,
2043
+ _n as u,
2044
+ mn as v,
2045
+ $n as w,
2046
+ Ye as x,
2047
+ fe as y,
2048
+ Ke as z
2049
+ };