@yuku123/z-team-component 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,3866 @@
1
+ import { message as ee } from "antd";
2
+ function f(e) {
3
+ return e == null || e === "" ? "" : typeof e == "string" ? e : String(e);
4
+ }
5
+ function en(e) {
6
+ const n = f(e);
7
+ return n === "" ? null : n;
8
+ }
9
+ function nn(e, n) {
10
+ return f(e) === f(n);
11
+ }
12
+ function tn(e) {
13
+ const n = f(e);
14
+ return n !== "" && n.startsWith("-");
15
+ }
16
+ function ie(e) {
17
+ const n = f(e);
18
+ return n !== "" && ge(n, "0") > 0;
19
+ }
20
+ function ge(e, n) {
21
+ const t = f(e), s = f(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 Se = 101012001;
36
+ function we() {
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 Te() {
41
+ const e = new URL(window.location.href);
42
+ e.searchParams.has("_from_login") || e.searchParams.set("_from_login", "1");
43
+ const n = `${we()}/login?redirect=${encodeURIComponent(
44
+ e.toString()
45
+ )}`;
46
+ window.location.href = n;
47
+ }
48
+ let ce = [];
49
+ function Ce(e) {
50
+ ce.forEach((n) => n(e));
51
+ }
52
+ function Ie() {
53
+ Ce("disconnected"), ce = [];
54
+ }
55
+ const Ue = { credentials: "include" };
56
+ function z(e, n = "error") {
57
+ n === "warning" ? ee.warning(e) : ee.error(e);
58
+ }
59
+ typeof window < "u" && window.addEventListener(
60
+ "unhandledrejection",
61
+ (e) => {
62
+ const n = e.reason;
63
+ n && typeof n == "object" && n._apiUserError && e.preventDefault();
64
+ }
65
+ );
66
+ let ne = !1;
67
+ const te = "登录已失效,请重新登录";
68
+ function be(e) {
69
+ if (!e) return !1;
70
+ if (Number(e.code) === Se) return !0;
71
+ const n = typeof e.message == "string" ? e.message : "";
72
+ return /登录(?:已)?(?:失效|过期)|重新登录|未登录/.test(n);
73
+ }
74
+ function se() {
75
+ if (!ne) {
76
+ ne = !0;
77
+ try {
78
+ Ie();
79
+ } catch {
80
+ }
81
+ try {
82
+ localStorage.removeItem("ft_token"), localStorage.removeItem("USER_INFO"), delete window.USER_INFO;
83
+ } catch {
84
+ }
85
+ Te();
86
+ }
87
+ throw {
88
+ _apiUserError: !0,
89
+ userMessage: te,
90
+ message: te
91
+ };
92
+ }
93
+ function oe(e, n) {
94
+ return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, n);
95
+ }
96
+ const Ae = "/z-team", Re = typeof window < "u" && /(zteam[-.]ft\.(zteam\.local|zteam\.local)|team\.zteam\.local)/i.test(
97
+ window.location.hostname
98
+ ), de = Re, Oe = `${de ? "/kapi" : ""}${Ae}/api`, _e = window.ENV_TYPE || window.envType || "", sn = Oe, on = `${de ? "/kapi" : ""}/z-team-bench/api`, Pe = _e || "local";
99
+ async function an(e, n) {
100
+ try {
101
+ const t = {
102
+ "project-env": Pe,
103
+ ...n == null ? void 0 : n.headers
104
+ };
105
+ return await fetch(e, { ...Ue, ...n, headers: t });
106
+ } catch {
107
+ const t = "无法连接服务器,请确认 Java 服务已启动(如 127.0.0.1:8080)且前端代理 /z-team 已配置";
108
+ throw z(t), { _apiUserError: !0, userMessage: t, message: t };
109
+ }
110
+ }
111
+ async function Ee(e, n) {
112
+ e.status === 401 && se();
113
+ const t = await e.text().catch(() => "");
114
+ let s = {};
115
+ if (t)
116
+ try {
117
+ s = JSON.parse(t);
118
+ } catch {
119
+ if (!e.ok) {
120
+ const o = oe(e, n);
121
+ throw z(
122
+ e.status >= 500 ? o : `${o}(HTTP ${e.status},响应非 JSON)`
123
+ ), {
124
+ _apiUserError: !0,
125
+ userMessage: o,
126
+ message: o
127
+ };
128
+ }
129
+ return t;
130
+ }
131
+ if (be(s) && se(), typeof s.success == "boolean") {
132
+ if (s.success)
133
+ return s.data !== void 0 ? s.data : !0;
134
+ const o = s.message || // z-team 另有 7 个 admin controller 挂 bench Result({code,msg,data,success})
135
+ s.msg || s.detail || n;
136
+ throw z(o), {
137
+ _apiUserError: !0,
138
+ userMessage: o,
139
+ message: o
140
+ };
141
+ }
142
+ if (!e.ok) {
143
+ const o = s.detail || s.message || oe(e, n);
144
+ throw z(o), {
145
+ _apiUserError: !0,
146
+ userMessage: o,
147
+ message: o
148
+ };
149
+ }
150
+ return s;
151
+ }
152
+ const ke = /_+([a-z0-9])/gi;
153
+ function Ne(e) {
154
+ return e.replace(ke, (n, t) => t.toUpperCase());
155
+ }
156
+ function V(e) {
157
+ if (Array.isArray(e)) return e.map((n) => V(n));
158
+ if (e && typeof e == "object" && !(e instanceof Date)) {
159
+ const n = {};
160
+ for (const [t, s] of Object.entries(e))
161
+ n[Ne(t)] = V(s);
162
+ return n;
163
+ }
164
+ return e;
165
+ }
166
+ async function rn(e, n) {
167
+ return V(await Ee(e, n));
168
+ }
169
+ const a = {
170
+ credentials: "include",
171
+ // 强制标识为 XHR/fetch API 请求,使后端 SsoInterceptor 走 JSON 401 分支
172
+ // 而不是返回 302 跳到 SSO 登录页(避免 fetch follow redirect 后拿到 SPA HTML 导致解析失败)
173
+ headers: { Accept: "application/json" }
174
+ };
175
+ class ve extends Error {
176
+ constructor(n) {
177
+ super(n), this._apiUserError = !0, this.name = "ApiUserError", this.userMessage = n;
178
+ }
179
+ }
180
+ function cn(e) {
181
+ return e instanceof ve ? !0 : !!(e && typeof e == "object" && e._apiUserError);
182
+ }
183
+ function A(e, n = "error") {
184
+ console[n === "warning" ? "warn" : "error"]("[api]", e);
185
+ }
186
+ typeof window < "u" && window.addEventListener(
187
+ "unhandledrejection",
188
+ (e) => {
189
+ const n = e.reason;
190
+ n && typeof n == "object" && n._apiUserError && e.preventDefault();
191
+ }
192
+ );
193
+ function ae(e, n) {
194
+ return e.status === 401 ? "登录已失效,请重新登录" : e.status === 403 ? "没有权限访问该资源" : e.status === 404 ? "接口不存在,请确认后端已启动且路径为 /z-team" : e.status >= 500 ? "服务暂时不可用,请稍后重试" : (e.status >= 400, n);
195
+ }
196
+ const ue = "/z-team", qe = typeof window < "u" && window.ZTEAM_USE_KAPI === !0, Q = qe, le = `${Q ? "/kapi" : ""}${ue}/api`, je = `${Q ? "/kapi" : ""}${ue}/v1/scenario-instances`, De = window.ENV_TYPE || window.envType || "", c = le, S = `${Q ? "/kapi" : ""}/z-team-evolution/api`, G = typeof window < "u" && window.ZTEAM_AGENTHUB_AI_ORIGIN || "", Le = "/kapi/agenthub-ai/api/dev-brain/agent", Je = String(
197
+ typeof window < "u" && window.ZTEAM_AGENTHUB_SAME_ORIGIN_SUFFIXES || ""
198
+ ).split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
199
+ function me(e) {
200
+ const n = (e || "").toLowerCase();
201
+ return n === "localhost" || n === "127.0.0.1" ? !0 : Je.some(
202
+ (t) => n === t || n.endsWith(`.${t}`)
203
+ );
204
+ }
205
+ function K(e, n) {
206
+ const t = e.startsWith("/") ? e : `/${e}`, s = n ? `?${new URLSearchParams(n).toString()}` : "", o = `${Le}${t}${s}`;
207
+ if (typeof window > "u")
208
+ return `${G}${o}`;
209
+ const d = window.location.hostname;
210
+ return me(d) ? `${window.location.origin}${o}` : `${G}${o}`;
211
+ }
212
+ function Me(e) {
213
+ return K("/ticket", { ticketId: e });
214
+ }
215
+ function Be(e) {
216
+ const t = `/kapi/agenthub-ai${e.startsWith("/") ? e : `/${e}`}`;
217
+ if (typeof window > "u")
218
+ return `${G}${t}`;
219
+ const s = window.location.hostname;
220
+ return me(s) ? `${window.location.origin}${t}` : `${G}${t}`;
221
+ }
222
+ async function Fe(e) {
223
+ const n = new FormData();
224
+ n.append("file", e);
225
+ const t = await Z(Be("/common/uploadImage"), {
226
+ method: "POST",
227
+ body: n
228
+ });
229
+ return i(t, "上传图片失败");
230
+ }
231
+ async function dn(e) {
232
+ return Promise.all(e.map((n) => Fe(n)));
233
+ }
234
+ K("/ticket");
235
+ const pe = De || "local";
236
+ async function Z(e, n) {
237
+ try {
238
+ const t = {
239
+ ...a.headers,
240
+ "project-env": pe,
241
+ ...n == null ? void 0 : n.headers
242
+ };
243
+ return await fetch(e, {
244
+ ...a,
245
+ ...n,
246
+ credentials: "include",
247
+ mode: "cors",
248
+ headers: t
249
+ });
250
+ } catch {
251
+ const t = "无法连接 AgentHub-AI 服务,请确认服务地址配置正确";
252
+ throw A(t), { _apiUserError: !0, userMessage: t, message: t };
253
+ }
254
+ }
255
+ async function r(e, n) {
256
+ try {
257
+ const t = {
258
+ ...a.headers,
259
+ "project-env": pe,
260
+ ...n == null ? void 0 : n.headers
261
+ };
262
+ return await fetch(e, { ...a, ...n, headers: t });
263
+ } catch {
264
+ const t = "无法连接服务器,请确认 Java 服务已启动(如 127.0.0.1:8080)且前端代理 /z-team 已配置";
265
+ throw A(t), { _apiUserError: !0, userMessage: t, message: t };
266
+ }
267
+ }
268
+ function fe(e) {
269
+ const n = e.id ?? e.staff_id ?? e.staffId ?? e.user_id ?? e.userId;
270
+ return {
271
+ // FE-PRECISION-FIX: 雪花 ID 保持字符串,禁止走 Number()
272
+ id: f(n),
273
+ username: String(e.username ?? ""),
274
+ display_name: String(e.display_name ?? e.displayName ?? ""),
275
+ avatar: String(e.avatar ?? "👤"),
276
+ created_at: String(e.created_at ?? e.createdAt ?? ""),
277
+ is_global_admin: !!(e.is_global_admin ?? e.globalAdmin ?? e.global_admin ?? !1)
278
+ };
279
+ }
280
+ async function i(e, n) {
281
+ const t = await e.text().catch(() => "");
282
+ let s = {};
283
+ if (t)
284
+ try {
285
+ s = JSON.parse(t);
286
+ } catch {
287
+ if (!e.ok) {
288
+ const u = ae(e, n);
289
+ throw A(
290
+ e.status >= 500 ? u : `${u}(HTTP ${e.status},响应非 JSON)`
291
+ ), {
292
+ _apiUserError: !0,
293
+ userMessage: u,
294
+ message: u
295
+ };
296
+ }
297
+ return t;
298
+ }
299
+ const o = s.status_code ?? s.statusCode, d = s.success === !0 || typeof o == "number" && o >= 200 && o < 300;
300
+ if (typeof s.success == "boolean" || typeof o == "number") {
301
+ if (d)
302
+ return s.data !== void 0 ? s.data : !0;
303
+ const u = s.message || s.msg || s.detail || n;
304
+ throw A(u), {
305
+ _apiUserError: !0,
306
+ userMessage: u,
307
+ message: u
308
+ };
309
+ }
310
+ if (!e.ok) {
311
+ const u = s.detail || s.message || ae(e, n);
312
+ throw A(u), {
313
+ _apiUserError: !0,
314
+ userMessage: u,
315
+ message: u
316
+ };
317
+ }
318
+ return s;
319
+ }
320
+ async function un(e, n) {
321
+ const t = await fetch("/api/ctc/authn/login", {
322
+ ...a,
323
+ method: "POST",
324
+ headers: { "Content-Type": "application/json" },
325
+ credentials: "include",
326
+ body: JSON.stringify({ identifier: e, password: n })
327
+ }), s = await i(t, "登录失败"), o = (s == null ? void 0 : s.userInfo) ?? (s == null ? void 0 : s.user_info) ?? (s == null ? void 0 : s.user) ?? s, d = fe(o);
328
+ return { token: (s == null ? void 0 : s.token) ?? "", user: d };
329
+ }
330
+ async function ln(e) {
331
+ const n = await fetch("/api/ctc/authn/whoami", {
332
+ ...a,
333
+ credentials: "include"
334
+ }), t = await i(
335
+ n,
336
+ "获取用户信息失败"
337
+ );
338
+ return fe(t);
339
+ }
340
+ async function mn(e) {
341
+ await i(
342
+ await fetch("/api/ctc/authn/logout", {
343
+ ...a,
344
+ method: "POST",
345
+ credentials: "include"
346
+ }),
347
+ "退出失败"
348
+ );
349
+ try {
350
+ localStorage.removeItem("token"), localStorage.removeItem("z_team_token"), localStorage.removeItem("userInfo"), localStorage.removeItem("USER_INFO");
351
+ } catch {
352
+ }
353
+ }
354
+ async function pn(e, n) {
355
+ try {
356
+ const t = await fetch(
357
+ `/api/ctc/authz/users/permissions?userId=${e}`,
358
+ {
359
+ headers: {
360
+ Authorization: `Bearer ${n}`
361
+ }
362
+ }
363
+ );
364
+ if (!t.ok) return [];
365
+ const s = await t.json(), o = (s == null ? void 0 : s.data) ?? s;
366
+ 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) : [];
367
+ } catch {
368
+ return [];
369
+ }
370
+ }
371
+ async function fn(e = "", n) {
372
+ const t = new URLSearchParams();
373
+ e && t.set("token", e), n && t.set("create_time_start", n);
374
+ const s = t.toString(), o = await r(
375
+ `${c}/scenario-instances/${s ? `?${s}` : ""}`,
376
+ a
377
+ );
378
+ return i(o, "获取项目列表失败");
379
+ }
380
+ async function $n(e, n = "") {
381
+ const t = new URLSearchParams();
382
+ n && t.set("token", n), e.scenario_code && t.set("scenario_code", e.scenario_code), e.status && t.set("status", e.status), e.name && t.set("name", e.name), e.role && t.set("role", e.role), e.create_time_start && t.set("create_time_start", e.create_time_start), e.create_time_end && t.set("create_time_end", e.create_time_end), t.set("page", String(e.page ?? 1)), t.set("size", String(e.size ?? 20));
383
+ const s = await r(
384
+ `${c}/scenario-instances/page?${t.toString()}`,
385
+ a
386
+ );
387
+ return i(s, "获取工作项列表失败");
388
+ }
389
+ async function yn(e = "") {
390
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/scenarios${n}`, a);
391
+ return i(t, "获取场景列表失败");
392
+ }
393
+ async function xe(e, n = "") {
394
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = {
395
+ ...e,
396
+ extend_params: { ...e.extend_params, skip_init_task: "true" }
397
+ }, o = await r(`${c}/scenario-instances/${t}`, {
398
+ ...a,
399
+ method: "POST",
400
+ headers: { "Content-Type": "application/json" },
401
+ body: JSON.stringify(s)
402
+ }), d = await i(o, "创建项目失败");
403
+ return w(d);
404
+ }
405
+ const hn = xe;
406
+ function w(e) {
407
+ return {
408
+ // FE-PRECISION-FIX: 雪花 ID 是 19 位 bigint, Number() 会丢末位精度
409
+ // (后端 Jackson Long→String 已序列化为字符串, 这里保持字符串避免回退到 Number)
410
+ id: e.id == null ? "" : String(e.id),
411
+ name: String(e.name ?? ""),
412
+ description: String(e.description ?? ""),
413
+ workspace_path: String(e.workspace_path ?? e.workspacePath ?? ""),
414
+ status: String(e.status ?? "ACTIVE"),
415
+ created_at: String(e.created_at ?? e.createdAt ?? ""),
416
+ mode: e.mode != null ? String(e.mode) : void 0,
417
+ // FEATURE-ID-AS-STRING: 雪花 ID 一律 string, 严禁 Number() (JS Number 精度会丢末位)
418
+ scenario_id: e.scenario_id != null ? String(e.scenario_id) : e.scenarioId != null ? String(e.scenarioId) : void 0,
419
+ scenario_code: e.scenario_code != null ? String(e.scenario_code) : e.scenarioCode != null ? String(e.scenarioCode) : void 0,
420
+ scenario_name: e.scenario_name != null ? String(e.scenario_name) : e.scenarioName != null ? String(e.scenarioName) : void 0,
421
+ role: e.role != null ? String(e.role) : void 0,
422
+ llm_code: e.llm_code != null ? String(e.llm_code) : e.llmCode != null ? String(e.llmCode) : void 0,
423
+ close_feedback: F(e, "close_feedback"),
424
+ close_tags: F(e, "close_tags"),
425
+ close_time: F(e, "close_time"),
426
+ close_user: F(e, "close_user"),
427
+ members: Array.isArray(e.members) ? e.members.map((n) => String(n)) : void 0,
428
+ parent_id: ze(e)
429
+ };
430
+ }
431
+ function F(e, n) {
432
+ const t = n.replace(/_([a-z])/g, (u, m) => m.toUpperCase());
433
+ if (e[n] != null) return e[n];
434
+ if (e[t] != null) return e[t];
435
+ const s = e.close_info ?? e.closeInfo;
436
+ if (s) {
437
+ if (s[n] != null) return s[n];
438
+ if (s[t] != null) return s[t];
439
+ }
440
+ const o = e.ext;
441
+ if (!o) return;
442
+ const d = o.params;
443
+ if (d)
444
+ return d[n] ?? void 0;
445
+ }
446
+ function ze(e) {
447
+ const n = e.ext;
448
+ if (!n) return;
449
+ const t = n.params;
450
+ if (!t) return;
451
+ const s = t.parent_id;
452
+ if (s == null) return;
453
+ const o = f(s);
454
+ return o === "" ? void 0 : o;
455
+ }
456
+ async function gn(e) {
457
+ const n = await r(
458
+ `${c}/scenario-instances/${e}/models`
459
+ );
460
+ return await i(n, "获取模型列表失败") ?? [];
461
+ }
462
+ async function Sn(e, n) {
463
+ const t = await r(
464
+ `${c}/scenario-instances/${e}/llm-code`,
465
+ {
466
+ ...a,
467
+ method: "PUT",
468
+ headers: { "Content-Type": "application/json" },
469
+ body: JSON.stringify({ llmCode: n || null })
470
+ }
471
+ ), s = await i(t, "设置模型失败");
472
+ return w(s);
473
+ }
474
+ const We = "develop_brain_scenario", wn = "qa_support";
475
+ async function Tn(e) {
476
+ const n = await Z(Me(e), {
477
+ method: "GET"
478
+ });
479
+ return i(n, "获取工单信息失败");
480
+ }
481
+ function Cn(e) {
482
+ const n = e.futureTeamProjectId ?? e.future_team_project_id ?? "", t = f(String(n).trim());
483
+ return ie(t) ? t : null;
484
+ }
485
+ function In(e) {
486
+ return String(e.currentStage ?? e.current_stage ?? "").trim();
487
+ }
488
+ async function Un(e, n, t) {
489
+ const s = K("/update-z-team"), o = new URLSearchParams({
490
+ ticketId: e,
491
+ futureTeamProjectId: String(n),
492
+ stage: t
493
+ }), d = await Z(s, {
494
+ method: "POST",
495
+ headers: {
496
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
497
+ },
498
+ body: o.toString()
499
+ });
500
+ await i(d, "回写工单关联工程失败");
501
+ }
502
+ function Ge(e) {
503
+ const n = e.trim().replace(/[/\\:*?"<>|]/g, "_");
504
+ return n.length > 0 ? n.slice(0, 80) : "workspace";
505
+ }
506
+ function bn(e, n) {
507
+ var d;
508
+ const t = e.requirementTitle && e.requirementTitle.trim() || n, s = { ticket_id: n }, o = (d = e.foneUrl) == null ? void 0 : d.trim();
509
+ return o && (s.work_order_url = o), {
510
+ name: t,
511
+ description: `ticket_id_${n}_${t}`,
512
+ workspace_path: Ge(t),
513
+ scenario_code: We,
514
+ extend_params: s
515
+ };
516
+ }
517
+ async function An(e) {
518
+ const n = await r(
519
+ `${c}/scenario-instances/${e}/team/`,
520
+ a
521
+ );
522
+ return i(n, "获取团队成员失败");
523
+ }
524
+ async function Rn(e, n) {
525
+ const t = await r(`${c}/scenario-instances/${e}/team/`, {
526
+ ...a,
527
+ method: "POST",
528
+ headers: { "Content-Type": "application/json" },
529
+ body: JSON.stringify(n)
530
+ });
531
+ return i(t, "添加成员失败");
532
+ }
533
+ async function On(e, n) {
534
+ const t = await r(
535
+ `${c}/scenario-instances/${e}/team/${n}`,
536
+ {
537
+ ...a,
538
+ method: "DELETE"
539
+ }
540
+ );
541
+ return i(t, "移除成员失败");
542
+ }
543
+ async function _n(e) {
544
+ const n = await r(
545
+ `${c}/scenario-instances/${e}/team/available-agents`,
546
+ a
547
+ );
548
+ return i(n, "获取Agent列表失败");
549
+ }
550
+ async function Pn(e) {
551
+ const n = await r(
552
+ `${c}/scenario-instances/${e}/team/available-humans`,
553
+ a
554
+ );
555
+ return i(n, "获取用户列表失败");
556
+ }
557
+ async function En(e) {
558
+ const n = await r(
559
+ `${c}/scenario-instances/${e}/skills`,
560
+ a
561
+ );
562
+ return i(n, "获取技能列表失败");
563
+ }
564
+ async function kn(e) {
565
+ const n = await r(
566
+ `${c}/scenario-instances/${e}/all-skills`,
567
+ a
568
+ );
569
+ return i(n, "获取全部技能列表失败");
570
+ }
571
+ async function Nn(e, n) {
572
+ const t = await r(`${c}/scenario-instances/${e}/skills`, {
573
+ ...a,
574
+ method: "POST",
575
+ headers: { "Content-Type": "application/json" },
576
+ body: JSON.stringify({ skill_id: n })
577
+ });
578
+ return i(t, "添加技能失败");
579
+ }
580
+ async function vn(e, n) {
581
+ const t = await r(
582
+ `${c}/scenario-instances/${e}/skills/${n}`,
583
+ {
584
+ ...a,
585
+ method: "DELETE"
586
+ }
587
+ );
588
+ return i(t, "移除技能失败");
589
+ }
590
+ async function qn(e, n) {
591
+ const t = await r(
592
+ `${c}/scenario-instances/${e}/agent-skills/refresh`,
593
+ {
594
+ ...a,
595
+ method: "POST",
596
+ headers: { "Content-Type": "application/json" },
597
+ body: JSON.stringify({ agent_skills_path: n })
598
+ }
599
+ );
600
+ return i(t, "刷新技能失败");
601
+ }
602
+ async function jn(e) {
603
+ const n = await r(
604
+ `${c}/scenario-instances/${e}/all-agent-skills/refresh`,
605
+ {
606
+ ...a,
607
+ method: "POST"
608
+ }
609
+ );
610
+ return i(n, "刷新所有技能失败");
611
+ }
612
+ async function Dn(e, n = 50, t) {
613
+ let s = `${c}/scenario-instances/${e}/messages?limit=${n}`;
614
+ t && (s += `&before=${t}`);
615
+ const o = await r(s, a);
616
+ return i(o, "加载聊天记录失败,请稍后重试");
617
+ }
618
+ async function Ln(e) {
619
+ const n = await r(
620
+ `${c}/scenario-instances/${e}/messages/export`,
621
+ a
622
+ );
623
+ return i(n, "导出聊天记录失败");
624
+ }
625
+ async function Jn(e, n, t = "") {
626
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
627
+ `${c}/scenario-instances/${e}/messages/${n}/read${s}`,
628
+ {
629
+ ...a,
630
+ method: "POST"
631
+ }
632
+ );
633
+ return i(o, "标记已读失败");
634
+ }
635
+ async function Mn(e) {
636
+ const n = await r(
637
+ `${c}/scenario-instances/${e}/compress`,
638
+ {
639
+ ...a,
640
+ method: "POST"
641
+ }
642
+ );
643
+ return i(n, "触发压缩失败");
644
+ }
645
+ async function Bn(e) {
646
+ const n = await r(
647
+ `${c}/scenario-instances/${e}/summary`,
648
+ {
649
+ ...a,
650
+ method: "POST"
651
+ }
652
+ );
653
+ return i(n, "生成摘要失败");
654
+ }
655
+ async function Fn(e) {
656
+ const n = await r(
657
+ `${c}/scenario-instances/${e}/reset`,
658
+ {
659
+ ...a,
660
+ method: "POST"
661
+ }
662
+ );
663
+ return i(n, "重置失败");
664
+ }
665
+ async function xn(e) {
666
+ const t = await r(
667
+ `${S}/evolution/trigger`,
668
+ {
669
+ ...a,
670
+ method: "POST"
671
+ }
672
+ ), s = await i(t, "触发学习失败"), o = s.reduce(
673
+ (u, m) => u + (m.totalCount || 0),
674
+ 0
675
+ ), d = s.reduce(
676
+ (u, m) => u + (m.passedCount || 0),
677
+ 0
678
+ );
679
+ return { totalCount: o, passedCount: d };
680
+ }
681
+ async function zn(e, n, t = "") {
682
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
683
+ `${c}/scenario-instances/${e}/messages${s}`,
684
+ {
685
+ ...a,
686
+ method: "POST",
687
+ headers: { "Content-Type": "application/json" },
688
+ body: JSON.stringify(n)
689
+ }
690
+ );
691
+ return i(o, "发送消息失败");
692
+ }
693
+ async function Wn(e, n, t, s, o = "") {
694
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await r(
695
+ `${c}/scenario-instances/${e}/messages/${n}/card-form/submit${d}`,
696
+ {
697
+ ...a,
698
+ method: "POST",
699
+ headers: { "Content-Type": "application/json" },
700
+ body: JSON.stringify({
701
+ block_id: t,
702
+ value: s
703
+ })
704
+ }
705
+ );
706
+ return i(u, "提交卡片表单失败");
707
+ }
708
+ async function Gn(e, n) {
709
+ const t = await r(
710
+ `${c}/scenario-instances/${e}/cancel/${n}`,
711
+ { ...a, method: "POST" }
712
+ ), s = await i(t, "取消失败");
713
+ if (s != null && s.warning)
714
+ throw new Error(String(s.warning));
715
+ return s;
716
+ }
717
+ async function Hn(e, n) {
718
+ const t = await r(
719
+ `${c}/scenario-instances/${e}/cancel/${n}/queue`,
720
+ { ...a, method: "POST" }
721
+ );
722
+ return i(t, "停止队列失败");
723
+ }
724
+ async function Vn(e) {
725
+ const n = await r(
726
+ `${c}/scenario-instances/${e}/executions`,
727
+ a
728
+ );
729
+ return i(n, "获取执行列表失败");
730
+ }
731
+ async function Qn(e, n = "") {
732
+ const t = n ? `?subdir=${encodeURIComponent(n)}` : "", s = await r(
733
+ `${c}/scenario-instances/${e}/workspace/tree${t}`,
734
+ a
735
+ );
736
+ return i(s, "获取文件树失败");
737
+ }
738
+ async function Kn() {
739
+ const e = await r(`${c}/workspace/env`, a);
740
+ return i(e, "获取环境信息失败");
741
+ }
742
+ async function Zn(e) {
743
+ const n = await r(
744
+ `${c}/scenario-instances/${e}/workspace/sync-from-prod`,
745
+ {
746
+ ...a,
747
+ method: "POST",
748
+ headers: { "Content-Type": "application/json" }
749
+ }
750
+ );
751
+ return i(n, "同步失败");
752
+ }
753
+ async function Xn(e, n) {
754
+ const t = await r(
755
+ `${c}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
756
+ n
757
+ )}`,
758
+ a
759
+ );
760
+ return i(t, "获取文件内容失败");
761
+ }
762
+ async function Yn(e) {
763
+ const n = await r(
764
+ `${c}/scenario-instances/${e}/workspace/client-conversation-view`,
765
+ a
766
+ );
767
+ if (!n.ok) throw new Error(`HTTP ${n.status}`);
768
+ return n.text();
769
+ }
770
+ async function et(e, n, t) {
771
+ const s = await r(
772
+ `${c}/scenario-instances/${e}/workspace/file?file_path=${encodeURIComponent(
773
+ n
774
+ )}`,
775
+ {
776
+ ...a,
777
+ method: "POST",
778
+ headers: { "Content-Type": "application/json" },
779
+ body: JSON.stringify({ content: t })
780
+ }
781
+ );
782
+ return i(s, "保存文件失败");
783
+ }
784
+ async function nt(e, n, t) {
785
+ const s = await r(
786
+ `${c}/scenario-instances/${e}/workspace/rename`,
787
+ {
788
+ ...a,
789
+ method: "PUT",
790
+ headers: { "Content-Type": "application/json" },
791
+ body: JSON.stringify({ old_path: n, new_name: t })
792
+ }
793
+ );
794
+ return i(s, "重命名失败");
795
+ }
796
+ async function tt(e, n, t) {
797
+ const s = await r(
798
+ `${c}/scenario-instances/${e}/workspace/new-file`,
799
+ {
800
+ ...a,
801
+ method: "POST",
802
+ headers: { "Content-Type": "application/json" },
803
+ body: JSON.stringify({ parent_path: n, name: t })
804
+ }
805
+ );
806
+ return i(s, "新建文件失败");
807
+ }
808
+ async function st(e, n, t) {
809
+ const s = await r(
810
+ `${c}/scenario-instances/${e}/workspace/new-folder`,
811
+ {
812
+ ...a,
813
+ method: "POST",
814
+ headers: { "Content-Type": "application/json" },
815
+ body: JSON.stringify({ parent_path: n, name: t })
816
+ }
817
+ );
818
+ return i(s, "新建文件夹失败");
819
+ }
820
+ async function ot(e, n) {
821
+ const t = await r(
822
+ `${c}/scenario-instances/${e}/workspace/delete`,
823
+ {
824
+ ...a,
825
+ method: "POST",
826
+ headers: { "Content-Type": "application/json" },
827
+ body: JSON.stringify({ path: n })
828
+ }
829
+ );
830
+ return i(t, "删除失败");
831
+ }
832
+ async function at(e, n, t) {
833
+ const s = new FormData();
834
+ s.append("file", t), s.append("parent_path", n);
835
+ const o = await r(
836
+ `${c}/scenario-instances/${e}/workspace/upload-file`,
837
+ {
838
+ ...a,
839
+ method: "POST",
840
+ body: s
841
+ }
842
+ );
843
+ return i(o, "上传文件失败");
844
+ }
845
+ async function rt(e, n, t) {
846
+ const s = new FormData();
847
+ t.forEach((d) => s.append("files", d)), s.append("parent_path", n);
848
+ const o = await r(
849
+ `${c}/scenario-instances/${e}/workspace/upload-folder`,
850
+ {
851
+ ...a,
852
+ method: "POST",
853
+ body: s
854
+ }
855
+ );
856
+ return i(o, "上传文件夹失败");
857
+ }
858
+ async function it(e, n) {
859
+ const t = await r(
860
+ `${c}/scenario-instances/${e}/workspace/download?file_path=${encodeURIComponent(
861
+ n
862
+ )}`,
863
+ a
864
+ );
865
+ if (!t.ok) throw new Error("下载失败");
866
+ return t.blob();
867
+ }
868
+ async function He(e, n = "") {
869
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
870
+ `${c}/scenario-instances/${e}${t}`,
871
+ a
872
+ ), o = await i(s, "获取项目失败"), d = o.status === "FOUND" ? "FOUND" : "NOT_FOUND", u = o.scenario_instance ?? o.scenarioInstance ?? null;
873
+ return {
874
+ status: d,
875
+ scenarioInstance: u ? w(u) : null
876
+ };
877
+ }
878
+ async function Ve(e, n = "") {
879
+ const t = await He(e, n);
880
+ if (t.status === "NOT_FOUND" || !t.scenarioInstance)
881
+ throw {
882
+ _apiUserError: !0,
883
+ userMessage: "项目不存在",
884
+ message: "项目不存在"
885
+ };
886
+ return t.scenarioInstance;
887
+ }
888
+ async function Qe(e, n = "") {
889
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
890
+ `${c}/scenario-instances/${e}/join-self${t}`,
891
+ {
892
+ ...a,
893
+ method: "POST"
894
+ }
895
+ ), o = await i(s, "加入工程失败");
896
+ return w(o);
897
+ }
898
+ async function ct(e = "") {
899
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/self-support${n}`, a), s = await i(t, "获取自身答疑群组失败"), o = f(s.scenario_instance_id);
900
+ if (!ie(o))
901
+ throw {
902
+ _apiUserError: !0,
903
+ userMessage: "自身答疑群组无效",
904
+ message: "自身答疑群组无效"
905
+ };
906
+ return {
907
+ scenario_instance_id: o,
908
+ name: String(s.name ?? "Z-Team 自身答疑"),
909
+ scenario_code: String(s.scenario_code ?? "qa_support"),
910
+ workspace_path: String(s.workspace_path ?? ""),
911
+ status: String(s.status ?? "ACTIVE")
912
+ };
913
+ }
914
+ async function dt(e, n = "") {
915
+ return await Ve(e, n), Qe(e, n);
916
+ }
917
+ async function ut(e) {
918
+ const n = await r(`${c}/scenario-instances/${e}`, {
919
+ ...a,
920
+ method: "DELETE"
921
+ });
922
+ return i(n, "删除项目失败");
923
+ }
924
+ async function lt(e, n = "") {
925
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
926
+ `${c}/scenario-instances/${e}/forks${t}`,
927
+ a
928
+ ), o = await i(s, "获取 Fork 列表失败");
929
+ return (Array.isArray(o) ? o : []).map(
930
+ (u) => w(u)
931
+ );
932
+ }
933
+ async function mt(e, n, t = "") {
934
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
935
+ `${c}/scenario-instances/${e}/fork${s}`,
936
+ {
937
+ ...a,
938
+ method: "POST",
939
+ headers: { "Content-Type": "application/json" },
940
+ body: JSON.stringify({ mode: n })
941
+ }
942
+ ), d = await i(o, "Fork 项目失败");
943
+ return w(d);
944
+ }
945
+ async function pt(e, n) {
946
+ const t = await r(`${c}/scenario-instances/${e}`, {
947
+ ...a,
948
+ method: "PATCH",
949
+ headers: { "Content-Type": "application/json" },
950
+ body: JSON.stringify(n)
951
+ }), s = await i(t, "更新项目失败");
952
+ return w(s);
953
+ }
954
+ async function ft(e) {
955
+ const n = await r(
956
+ `${c}/scenario-instances/${e}/close-feedback-tags`,
957
+ {
958
+ ...a,
959
+ method: "GET"
960
+ }
961
+ );
962
+ return await i(n, "获取关单标签失败");
963
+ }
964
+ async function $t(e) {
965
+ const n = await r(`${c}/scenario-instances/${e}/reopen`, {
966
+ ...a,
967
+ method: "POST",
968
+ headers: { "Content-Type": "application/json" }
969
+ }), t = await i(n, "重新开启失败");
970
+ return w(t);
971
+ }
972
+ async function yt(e, n) {
973
+ const t = await r(`${c}/scenario-instances/${e}/close`, {
974
+ ...a,
975
+ method: "POST",
976
+ headers: { "Content-Type": "application/json" },
977
+ body: JSON.stringify(n)
978
+ }), s = await i(t, "关单失败");
979
+ return w(s);
980
+ }
981
+ async function ht(e) {
982
+ const n = await r(
983
+ `${c}/scenario-instances/${e}/retry-image-parse`,
984
+ {
985
+ ...a,
986
+ method: "POST",
987
+ headers: { "Content-Type": "application/json" }
988
+ }
989
+ ), s = await i(n, "图片重新解析失败");
990
+ return {
991
+ success: !!s.success,
992
+ message: s.message
993
+ };
994
+ }
995
+ let p = null, v = [], q = [], b = 0, re = "", x = null, N = 0, C = null, $e = "disconnected";
996
+ function W(e) {
997
+ $e = e, q.forEach((n) => n(e));
998
+ }
999
+ function Ke(e, n = "") {
1000
+ const t = window.location.protocol === "https:" ? "wss:" : "ws:", s = window.location.host, o = n ? `?token=${encodeURIComponent(n)}` : "";
1001
+ return `${t}//${s}${je}/${e}/ws${o}`;
1002
+ }
1003
+ function gt(e) {
1004
+ return q.push(e), e($e), () => {
1005
+ q = q.filter((n) => n !== e);
1006
+ };
1007
+ }
1008
+ function Ze(e, n = "", t) {
1009
+ if (p && (p.readyState === WebSocket.CONNECTING || p.readyState === WebSocket.OPEN) && b === e)
1010
+ return;
1011
+ p && (p.onclose = null, p.close(), p = null), C != null && (clearTimeout(C), C = null);
1012
+ const s = Ke(e, n);
1013
+ b = e, re = n, t && (x = t), W("connecting"), p = new WebSocket(s), p.onopen = () => {
1014
+ N = 0, W("connected"), console.log("[WS] connected");
1015
+ }, p.onmessage = (o) => {
1016
+ try {
1017
+ const d = JSON.parse(o.data);
1018
+ console.log("[WS recv]", d.type, d), v.forEach((u) => u(d));
1019
+ } catch {
1020
+ }
1021
+ }, p.onerror = () => {
1022
+ console.warn("[WS] connection error:", s);
1023
+ }, p.onclose = (o) => {
1024
+ const d = o.wasClean;
1025
+ if (p = null, W("disconnected"), b === 0) return;
1026
+ N += 1;
1027
+ const u = Math.min(3e3 * N, 3e4);
1028
+ console.warn(
1029
+ `[WS] closed (clean=${d}), reconnect #${N} in ${u}ms`
1030
+ ), C = setTimeout(() => {
1031
+ C = null, b !== 0 && b !== "" && (Ze(b, re), x == null || x());
1032
+ }, u);
1033
+ };
1034
+ }
1035
+ function St(e) {
1036
+ return v.push(e), () => {
1037
+ v = v.filter((n) => n !== e);
1038
+ };
1039
+ }
1040
+ async function wt(e) {
1041
+ p && p.readyState === WebSocket.OPEN && p.send(JSON.stringify(e));
1042
+ }
1043
+ function Tt() {
1044
+ b = 0, C != null && (clearTimeout(C), C = null), p && (p.onclose = null, p.close(), p = null), N = 0, W("disconnected"), v = [], q = [];
1045
+ }
1046
+ async function Ct(e, n) {
1047
+ const t = n != null && n.trim() !== "" ? { result: n } : void 0, s = await r(`${c}/tasks/${e}/complete`, {
1048
+ ...a,
1049
+ method: "POST",
1050
+ headers: { "Content-Type": "application/json" },
1051
+ body: t ? JSON.stringify(t) : void 0
1052
+ });
1053
+ return i(s, "完成任务失败");
1054
+ }
1055
+ async function It(e, n) {
1056
+ const t = await r(`${c}/tasks/${e}/suspend`, {
1057
+ ...a,
1058
+ method: "POST",
1059
+ headers: { "Content-Type": "application/json" },
1060
+ body: void 0
1061
+ });
1062
+ return i(t, "挂起任务失败");
1063
+ }
1064
+ async function Ut(e, n) {
1065
+ const t = await r(`${c}/tasks/${e}/cancel`, {
1066
+ ...a,
1067
+ method: "POST",
1068
+ headers: { "Content-Type": "application/json" },
1069
+ body: void 0
1070
+ });
1071
+ return i(t, "取消任务失败");
1072
+ }
1073
+ async function bt(e) {
1074
+ const n = await r(`${c}/tasks/${e}/continue`, {
1075
+ ...a,
1076
+ method: "POST",
1077
+ headers: { "Content-Type": "application/json" }
1078
+ });
1079
+ return i(n, "继续执行失败");
1080
+ }
1081
+ async function At(e) {
1082
+ const n = await r(`${c}/tasks/${e}/reset`, {
1083
+ ...a,
1084
+ method: "POST",
1085
+ headers: { "Content-Type": "application/json" }
1086
+ });
1087
+ return i(n, "重置执行失败");
1088
+ }
1089
+ async function Rt(e) {
1090
+ const n = await r(`${c}/tasks/${e}`, a);
1091
+ return i(n, "加载任务失败");
1092
+ }
1093
+ async function Ot(e, n, t = "") {
1094
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1095
+ `${c}/scenario-instances/${e}/task-sessions/${n}${s}`,
1096
+ {
1097
+ ...a,
1098
+ method: "POST",
1099
+ headers: { "Content-Type": "application/json" }
1100
+ }
1101
+ );
1102
+ return i(o, "创建任务会话失败");
1103
+ }
1104
+ async function _t(e, n, t = 50, s, o = "") {
1105
+ let d = `${c}/scenario-instances/${e}/task-sessions/${n}/messages?limit=${t}`;
1106
+ s && (d += `&before=${s}`), o && (d += `&token=${encodeURIComponent(o)}`);
1107
+ const u = await r(d, a);
1108
+ return i(u, "获取任务消息失败");
1109
+ }
1110
+ async function Pt(e, n, t, s = "", o) {
1111
+ const d = s ? `?token=${encodeURIComponent(s)}` : "", u = { content: t };
1112
+ o && o.length > 0 && (u.image_urls = o);
1113
+ const m = await r(
1114
+ `${c}/scenario-instances/${e}/task-sessions/${n}/messages${d}`,
1115
+ {
1116
+ ...a,
1117
+ method: "POST",
1118
+ headers: { "Content-Type": "application/json" },
1119
+ body: JSON.stringify(u)
1120
+ }
1121
+ );
1122
+ return i(m, "发送任务消息失败");
1123
+ }
1124
+ async function Et(e = "") {
1125
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/scenarios${n}`, a);
1126
+ return i(t, "获取场景列表失败");
1127
+ }
1128
+ async function kt(e, n = "") {
1129
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenarios${t}`, {
1130
+ ...a,
1131
+ method: "POST",
1132
+ headers: { "Content-Type": "application/json" },
1133
+ body: JSON.stringify(e)
1134
+ });
1135
+ return i(s, "新建场景失败");
1136
+ }
1137
+ async function Nt(e, n, t = "") {
1138
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/scenarios/${e}${s}`, {
1139
+ ...a,
1140
+ method: "PUT",
1141
+ headers: { "Content-Type": "application/json" },
1142
+ body: JSON.stringify(n)
1143
+ });
1144
+ return i(o, "更新场景失败");
1145
+ }
1146
+ async function vt(e, n = "") {
1147
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenarios/${e}${t}`, {
1148
+ ...a,
1149
+ method: "DELETE"
1150
+ });
1151
+ return i(s, "删除场景失败");
1152
+ }
1153
+ async function qt(e = "") {
1154
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/agents${n}`, a);
1155
+ return i(t, "获取 Agent 列表失败");
1156
+ }
1157
+ async function jt(e = "") {
1158
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1159
+ `${c}/admin/agent-categories${n}`,
1160
+ a
1161
+ );
1162
+ return i(t, "获取 Agent 分类树失败");
1163
+ }
1164
+ async function Dt(e, n = "") {
1165
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/agent-categories${t}`, {
1166
+ ...a,
1167
+ method: "POST",
1168
+ body: JSON.stringify(e)
1169
+ });
1170
+ return i(s, "创建分类失败");
1171
+ }
1172
+ async function Lt(e = "") {
1173
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1174
+ `${c}/admin/skill-categories${n}`,
1175
+ a
1176
+ );
1177
+ return i(t, "获取 Skill 分类树失败");
1178
+ }
1179
+ async function Jt(e, n = "") {
1180
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/skill-categories${t}`, {
1181
+ ...a,
1182
+ method: "POST",
1183
+ body: JSON.stringify(e)
1184
+ });
1185
+ return i(s, "创建 Skill 分类失败");
1186
+ }
1187
+ async function Mt(e, n = "") {
1188
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1189
+ `${c}/admin/agents/${encodeURIComponent(e)}${t}`,
1190
+ a
1191
+ );
1192
+ return i(s, "获取 Agent 详情失败");
1193
+ }
1194
+ async function Bt(e, n = "") {
1195
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1196
+ `${c}/admin/agents/${encodeURIComponent(e)}/identity${t}`,
1197
+ a
1198
+ );
1199
+ return i(s, "获取 Agent 身份绑定失败");
1200
+ }
1201
+ async function Ft(e, n, t = "") {
1202
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1203
+ `${c}/admin/agents/${encodeURIComponent(e)}/identity${s}`,
1204
+ {
1205
+ ...a,
1206
+ method: "PUT",
1207
+ headers: { "Content-Type": "application/json" },
1208
+ body: JSON.stringify(n)
1209
+ }
1210
+ );
1211
+ return i(o, "绑定 Agent 身份失败");
1212
+ }
1213
+ async function xt(e, n = "", t) {
1214
+ let s = n ? `?token=${encodeURIComponent(n)}` : "";
1215
+ t && (s += (s ? "&" : "?") + `envCode=${encodeURIComponent(t)}`);
1216
+ const o = await r(
1217
+ `${c}/admin/agents/${encodeURIComponent(e)}/identity${s}`,
1218
+ {
1219
+ ...a,
1220
+ method: "DELETE"
1221
+ }
1222
+ );
1223
+ return i(o, "解绑 Agent 身份失败");
1224
+ }
1225
+ async function zt(e, n, t = "") {
1226
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1227
+ `${c}/admin/agents/${encodeURIComponent(
1228
+ e
1229
+ )}/identity/test-login${s}`,
1230
+ {
1231
+ ...a,
1232
+ method: "POST",
1233
+ headers: { "Content-Type": "application/json" },
1234
+ body: JSON.stringify(n)
1235
+ }
1236
+ );
1237
+ return i(o, "测试登录失败");
1238
+ }
1239
+ async function Wt(e, n, t = "") {
1240
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1241
+ `${c}/admin/agents/${encodeURIComponent(
1242
+ e
1243
+ )}/identity/verify${s}`,
1244
+ {
1245
+ ...a,
1246
+ method: "POST",
1247
+ headers: { "Content-Type": "application/json" },
1248
+ body: JSON.stringify({ envCode: n })
1249
+ }
1250
+ );
1251
+ return i(o, "验证身份失败");
1252
+ }
1253
+ async function Gt(e = "") {
1254
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1255
+ `${c}/admin/agents/identity-envs${n}`,
1256
+ a
1257
+ );
1258
+ return i(t, "获取身份绑定环境列表失败");
1259
+ }
1260
+ async function Ht(e, n = "") {
1261
+ const t = new URLSearchParams();
1262
+ e && t.set("envCode", e), n && t.set("token", n);
1263
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(
1264
+ `${c}/admin/agents/ctc-members${s}`,
1265
+ a
1266
+ );
1267
+ return i(o, "获取成员列表失败") ?? [];
1268
+ }
1269
+ async function Vt(e, n = "") {
1270
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/agents${t}`, {
1271
+ ...a,
1272
+ method: "POST",
1273
+ headers: { "Content-Type": "application/json" },
1274
+ body: JSON.stringify(e)
1275
+ });
1276
+ return i(s, "创建 Agent 失败");
1277
+ }
1278
+ async function Qt(e, n, t = "") {
1279
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/agents/${e}${s}`, {
1280
+ ...a,
1281
+ method: "PUT",
1282
+ headers: { "Content-Type": "application/json" },
1283
+ body: JSON.stringify(n)
1284
+ });
1285
+ return i(o, "更新 Agent 失败");
1286
+ }
1287
+ async function Kt(e, n, t = "") {
1288
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/agents/${e}/move${s}`, {
1289
+ ...a,
1290
+ method: "POST",
1291
+ headers: { "Content-Type": "application/json" },
1292
+ body: JSON.stringify(n)
1293
+ });
1294
+ return i(o, "移动 Agent 分类失败");
1295
+ }
1296
+ async function Zt(e, n = "") {
1297
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/agents/${e}${t}`, {
1298
+ ...a,
1299
+ method: "DELETE"
1300
+ });
1301
+ return i(s, "删除 Agent 失败");
1302
+ }
1303
+ async function Xt(e = "") {
1304
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/agents/refresh-cache${n}`, {
1305
+ ...a,
1306
+ method: "POST"
1307
+ });
1308
+ return i(t, "刷新 Agent 缓存失败");
1309
+ }
1310
+ async function Yt(e = "") {
1311
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/agents/models${n}`, a);
1312
+ return i(t, "获取模型列表失败");
1313
+ }
1314
+ function j(e) {
1315
+ const n = Object.entries(e).filter(([, t]) => t !== void 0 && t !== "").map(([t, s]) => `${t}=${encodeURIComponent(s)}`);
1316
+ return n.length ? `?${n.join("&")}` : "";
1317
+ }
1318
+ async function es(e, n = "") {
1319
+ const t = await r(
1320
+ `${c}/admin/agents/${encodeURIComponent(
1321
+ e
1322
+ )}/ontology${j({ token: n })}`,
1323
+ a
1324
+ );
1325
+ return (await i(
1326
+ t,
1327
+ "获取前置处理配置失败"
1328
+ ) ?? []).map((o) => ({
1329
+ ...o,
1330
+ nodeInfo: { ...o.nodeInfo, dataPrepareEnabled: !1 }
1331
+ }));
1332
+ }
1333
+ async function ns(e, n, t = "") {
1334
+ const s = await r(
1335
+ `${c}/admin/agents/${encodeURIComponent(
1336
+ e
1337
+ )}/ontology${j({ token: t })}`,
1338
+ {
1339
+ ...a,
1340
+ method: "PUT",
1341
+ headers: { "Content-Type": "application/json" },
1342
+ body: JSON.stringify(n)
1343
+ }
1344
+ );
1345
+ return i(s, "保存本体绑定失败");
1346
+ }
1347
+ async function ts(e, n = "") {
1348
+ const t = await r(
1349
+ `${c}/admin/agents/ontology/ontologies${j({
1350
+ ontologyType: e,
1351
+ token: n
1352
+ })}`,
1353
+ a
1354
+ );
1355
+ return i(t, "获取本体列表失败") ?? [];
1356
+ }
1357
+ async function ss(e, n = "") {
1358
+ const t = await r(
1359
+ `${c}/admin/agents/ontology/knowledges${j({
1360
+ ontologyCode: e,
1361
+ token: n
1362
+ })}`,
1363
+ a
1364
+ );
1365
+ return i(t, "获取知识列表失败") ?? [];
1366
+ }
1367
+ async function os(e, n = "") {
1368
+ const t = await r(
1369
+ `${c}/admin/agents/ontology/knowledges/${encodeURIComponent(
1370
+ e
1371
+ )}${j({ token: n })}`,
1372
+ a
1373
+ );
1374
+ return i(t, "获取知识详情失败");
1375
+ }
1376
+ async function as(e = "") {
1377
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/skills${n}`, a);
1378
+ return i(t, "获取 Skill 列表失败");
1379
+ }
1380
+ async function rs(e, n = "") {
1381
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/skills${t}`, {
1382
+ ...a,
1383
+ method: "POST",
1384
+ headers: { "Content-Type": "application/json" },
1385
+ body: JSON.stringify(e)
1386
+ });
1387
+ return i(s, "创建 Skill 失败");
1388
+ }
1389
+ async function is(e, n, t = "") {
1390
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/skills/${e}${s}`, {
1391
+ ...a,
1392
+ method: "PUT",
1393
+ headers: { "Content-Type": "application/json" },
1394
+ body: JSON.stringify(n)
1395
+ });
1396
+ return i(o, "更新 Skill 失败");
1397
+ }
1398
+ async function cs(e, n, t = "") {
1399
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/skills/${e}/move${s}`, {
1400
+ ...a,
1401
+ method: "POST",
1402
+ headers: { "Content-Type": "application/json" },
1403
+ body: JSON.stringify(n)
1404
+ });
1405
+ return i(o, "移动 Skill 分类失败");
1406
+ }
1407
+ async function ds(e, n = "") {
1408
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/skills/${e}${t}`, {
1409
+ ...a,
1410
+ method: "DELETE"
1411
+ });
1412
+ return i(s, "删除 Skill 失败");
1413
+ }
1414
+ async function us(e = "") {
1415
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/skills/refresh-cache${n}`, {
1416
+ ...a,
1417
+ method: "POST"
1418
+ });
1419
+ return i(t, "刷新 Skill 缓存失败");
1420
+ }
1421
+ async function ls(e = "") {
1422
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1423
+ `${c}/admin/scenarios/available-agents${n}`,
1424
+ a
1425
+ );
1426
+ return i(t, "获取可用 Agent 列表失败");
1427
+ }
1428
+ async function ms(e = "") {
1429
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1430
+ `${c}/admin/scenarios/available-skills${n}`,
1431
+ a
1432
+ );
1433
+ return i(t, "获取可用 Skill 列表失败");
1434
+ }
1435
+ async function ps(e = "", n = "") {
1436
+ const t = new URLSearchParams();
1437
+ e && t.append("keyword", e), n && t.append("token", n);
1438
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(
1439
+ `${c}/admin/profiles/ctc-staff${s}`,
1440
+ a
1441
+ );
1442
+ return i(o, "获取员工列表失败");
1443
+ }
1444
+ async function fs(e, n, t = "", s = "") {
1445
+ const o = new URLSearchParams();
1446
+ o.append("profileScope", e), o.append("memberType", n), t && o.append("scenarioCode", t), s && o.append("token", s);
1447
+ const d = o.toString() ? `?${o.toString()}` : "", u = await r(`${c}/admin/profiles${d}`, a);
1448
+ return i(u, "获取画像列表失败");
1449
+ }
1450
+ async function $s(e, n = "") {
1451
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/profiles${t}`, {
1452
+ ...a,
1453
+ method: "POST",
1454
+ headers: { "Content-Type": "application/json" },
1455
+ body: JSON.stringify(e)
1456
+ });
1457
+ return i(s, "保存画像失败");
1458
+ }
1459
+ async function ys(e, n, t, s = "", o = "") {
1460
+ const d = new URLSearchParams();
1461
+ s && d.append("scenarioCode", s), o && d.append("token", o);
1462
+ const u = d.toString() ? `?${d.toString()}` : "", m = await r(
1463
+ `${c}/admin/profiles/${encodeURIComponent(
1464
+ e
1465
+ )}/${encodeURIComponent(n)}/${encodeURIComponent(t)}${u}`,
1466
+ {
1467
+ ...a,
1468
+ method: "DELETE"
1469
+ }
1470
+ );
1471
+ return i(m, "删除画像失败");
1472
+ }
1473
+ async function hs(e = "", n = "") {
1474
+ const t = new URLSearchParams();
1475
+ e && t.append("scenarioCode", e), n && t.append("token", n);
1476
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(`${c}/admin/human-on-calls${s}`, a);
1477
+ return i(o, "获取值班信息失败");
1478
+ }
1479
+ async function gs(e, n, t, s = "") {
1480
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(`${c}/admin/human-on-calls/batch${o}`, {
1481
+ ...a,
1482
+ method: "POST",
1483
+ headers: { "Content-Type": "application/json" },
1484
+ body: JSON.stringify({ scenarioCode: e, dayOfWeek: n, onCalls: t })
1485
+ });
1486
+ return i(d, "保存值班信息失败");
1487
+ }
1488
+ async function Ss(e, n, t, s = "") {
1489
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
1490
+ `${c}/admin/human-on-calls/${encodeURIComponent(
1491
+ e
1492
+ )}/${t}/${encodeURIComponent(n)}${o}`,
1493
+ { ...a, method: "DELETE" }
1494
+ );
1495
+ return i(d, "删除值班信息失败");
1496
+ }
1497
+ async function ws(e = "") {
1498
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1499
+ `${c}/admin/tool-definitions${n}`,
1500
+ a
1501
+ );
1502
+ return i(t, "获取工具定义失败");
1503
+ }
1504
+ async function Ts(e = "") {
1505
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1506
+ `${c}/admin/tool-definitions/built-in${n}`,
1507
+ a
1508
+ );
1509
+ return i(t, "获取内置工具失败");
1510
+ }
1511
+ async function Cs(e, n = "") {
1512
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/tool-definitions${t}`, {
1513
+ ...a,
1514
+ method: "POST",
1515
+ headers: { "Content-Type": "application/json" },
1516
+ body: JSON.stringify(e)
1517
+ });
1518
+ return i(s, "保存工具定义失败");
1519
+ }
1520
+ async function Is(e, n = "") {
1521
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1522
+ `${c}/admin/tool-definitions/${encodeURIComponent(e)}${t}`,
1523
+ {
1524
+ ...a,
1525
+ method: "DELETE"
1526
+ }
1527
+ );
1528
+ return i(s, "删除工具定义失败");
1529
+ }
1530
+ async function Us(e = "") {
1531
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/tool-groups${n}`, a);
1532
+ return i(t, "获取工具组失败");
1533
+ }
1534
+ async function bs(e, n = "") {
1535
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1536
+ `${c}/admin/tool-groups/${encodeURIComponent(e)}${t}`,
1537
+ a
1538
+ );
1539
+ return i(s, "获取工具组详情失败");
1540
+ }
1541
+ async function As(e, n = "") {
1542
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/tool-groups${t}`, {
1543
+ ...a,
1544
+ method: "POST",
1545
+ headers: { "Content-Type": "application/json" },
1546
+ body: JSON.stringify(e)
1547
+ });
1548
+ return i(s, "保存工具组失败");
1549
+ }
1550
+ async function Rs(e, n, t = "") {
1551
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1552
+ `${c}/admin/tool-groups/${encodeURIComponent(e)}/tools${s}`,
1553
+ {
1554
+ ...a,
1555
+ method: "PUT",
1556
+ headers: { "Content-Type": "application/json" },
1557
+ body: JSON.stringify(n)
1558
+ }
1559
+ );
1560
+ return i(o, "更新工具组工具失败");
1561
+ }
1562
+ async function Os(e, n = "") {
1563
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1564
+ `${c}/admin/tool-groups/${encodeURIComponent(e)}${t}`,
1565
+ {
1566
+ ...a,
1567
+ method: "DELETE"
1568
+ }
1569
+ );
1570
+ return i(s, "删除工具组失败");
1571
+ }
1572
+ async function _s(e, n = "") {
1573
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1574
+ `${c}/admin/agent-tool-configs/${encodeURIComponent(e)}${t}`,
1575
+ a
1576
+ );
1577
+ return i(s, "获取 Agent 工具配置失败");
1578
+ }
1579
+ async function Ps(e, n = "") {
1580
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1581
+ `${c}/admin/agent-tool-configs/${encodeURIComponent(
1582
+ e
1583
+ )}/resolved${t}`,
1584
+ a
1585
+ );
1586
+ return i(s, "解析 Agent 工具失败");
1587
+ }
1588
+ async function Es(e, n, t, s = "") {
1589
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
1590
+ `${c}/admin/agent-tool-configs/${encodeURIComponent(e)}${o}`,
1591
+ {
1592
+ ...a,
1593
+ method: "POST",
1594
+ headers: { "Content-Type": "application/json" },
1595
+ body: JSON.stringify({ configType: n, configValue: t })
1596
+ }
1597
+ );
1598
+ return i(d, "添加 Agent 工具配置失败");
1599
+ }
1600
+ async function ks(e, n = "") {
1601
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/agent-tool-configs/${e}${t}`, {
1602
+ ...a,
1603
+ method: "DELETE"
1604
+ });
1605
+ return i(s, "删除 Agent 工具配置失败");
1606
+ }
1607
+ async function Ns(e = {}) {
1608
+ const n = new URLSearchParams(), {
1609
+ scenarioCode: t,
1610
+ status: s,
1611
+ name: o,
1612
+ workspacePath: d,
1613
+ mode: u,
1614
+ createTimeStart: m,
1615
+ createTimeEnd: T,
1616
+ createBy: D,
1617
+ memberRefId: $,
1618
+ sortField: L,
1619
+ sortOrder: J,
1620
+ durationMinStart: O,
1621
+ durationMinEnd: U,
1622
+ closeTag: _,
1623
+ page: H = 1,
1624
+ size: M = 50,
1625
+ token: B = ""
1626
+ } = e;
1627
+ t && n.set("scenario_code", t), s && n.set("status", s), o && n.set("name", o), d && n.set("workspace_path", d), u && n.set("mode", u), m && n.set("create_time_start", m), T && n.set("create_time_end", T), D != null && n.set("create_by", String(D)), $ && n.set("member_ref_id", $), L && n.set("sort_field", L), J && n.set("sort_order", J), O != null && n.set("duration_min_start", String(O)), U != null && n.set("duration_min_end", String(U)), _ && n.set("close_tag", _), n.set("page", String(H)), n.set("size", String(M)), B && n.set("token", B);
1628
+ const h = n.toString(), P = `${c}/admin/scenario-instances${h ? `?${h}` : ""}`, he = await r(P, a);
1629
+ return i(he, "获取场景实例列表失败");
1630
+ }
1631
+ async function vs(e, n = "") {
1632
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1633
+ `${c}/admin/scenario-instances/${e}${t}`,
1634
+ a
1635
+ );
1636
+ return i(s, "获取场景实例详情失败");
1637
+ }
1638
+ async function qs(e, n = "") {
1639
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenario-instances/${e}${t}`, {
1640
+ ...a,
1641
+ method: "DELETE"
1642
+ });
1643
+ return i(s, "删除场景实例失败");
1644
+ }
1645
+ async function js(e, n = "") {
1646
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1647
+ `${c}/admin/scenario-instances/batch-delete${t}`,
1648
+ {
1649
+ ...a,
1650
+ method: "POST",
1651
+ headers: { "Content-Type": "application/json" },
1652
+ body: JSON.stringify({ ids: e })
1653
+ }
1654
+ );
1655
+ return i(s, "批量删除场景实例失败");
1656
+ }
1657
+ async function Ds(e = {}, n = "") {
1658
+ const t = [];
1659
+ e.scenarioCode && t.push(`scenario_code=${encodeURIComponent(e.scenarioCode)}`), e.status && t.push(`status=${encodeURIComponent(e.status)}`), n && t.push(`token=${encodeURIComponent(n)}`);
1660
+ const s = t.length > 0 ? `?${t.join("&")}` : "", o = await r(
1661
+ `${c}/admin/scenario-instances/refresh-all-skills${s}`,
1662
+ {
1663
+ ...a,
1664
+ method: "POST"
1665
+ }
1666
+ );
1667
+ return i(o, "全量刷新技能失败");
1668
+ }
1669
+ async function Ls(e, n = "") {
1670
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1671
+ `${c}/admin/scenario-instances/${e}/refresh-skills${t}`,
1672
+ {
1673
+ ...a,
1674
+ method: "POST"
1675
+ }
1676
+ );
1677
+ return i(s, "刷新技能失败");
1678
+ }
1679
+ function E(e) {
1680
+ const n = (...s) => {
1681
+ for (const o of s) {
1682
+ const d = e[o];
1683
+ if (d != null && d !== "") return String(d);
1684
+ }
1685
+ return "";
1686
+ }, t = e.shared;
1687
+ return {
1688
+ id: e.id,
1689
+ userId: n("user_id", "userId"),
1690
+ // FE-PRECISION-FIX: agentHubAgentId 声明为 Id,禁止 Number()(会按 float64 抹掉末位)
1691
+ agentHubAgentId: e.agent_hub_agent_id != null ? f(e.agent_hub_agent_id) : e.agenthub_agent_id != null ? f(e.agenthub_agent_id) : e.agentHubAgentId != null ? f(e.agentHubAgentId) : null,
1692
+ agentCode: n("agent_code", "agentCode"),
1693
+ displayName: n("display_name", "displayName"),
1694
+ avatar: e.avatar == null ? null : String(e.avatar),
1695
+ shared: t == null ? void 0 : Number(t),
1696
+ isLocal: e.isLocal,
1697
+ localAgentId: e.localAgentId,
1698
+ localAgentType: e.localAgentType,
1699
+ createTime: e.create_time == null ? e.createTime : String(e.create_time),
1700
+ updateTime: e.update_time == null ? e.updateTime : String(e.update_time)
1701
+ };
1702
+ }
1703
+ async function Js(e = "") {
1704
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/personal-agents${n}`, a), s = await i(t, "获取个人 Agent 列表失败");
1705
+ return (Array.isArray(s) ? s : []).map((o) => E(o));
1706
+ }
1707
+ async function Ms(e, n = "") {
1708
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-agents${t}`, {
1709
+ ...a,
1710
+ method: "POST",
1711
+ headers: { "Content-Type": "application/json" },
1712
+ body: JSON.stringify({ display_name: e })
1713
+ });
1714
+ return E(
1715
+ await i(s, "创建个人 Agent 失败")
1716
+ );
1717
+ }
1718
+ async function Bs(e, n, t, s, o = "") {
1719
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await r(`${c}/personal-agents/ensure${d}`, {
1720
+ ...a,
1721
+ method: "POST",
1722
+ headers: { "Content-Type": "application/json" },
1723
+ body: JSON.stringify({
1724
+ agenthub_agent_id: e,
1725
+ agent_code: n,
1726
+ display_name: t,
1727
+ avatar: s ?? ""
1728
+ })
1729
+ });
1730
+ return E(
1731
+ await i(u, "创建个人 Agent 失败")
1732
+ );
1733
+ }
1734
+ async function Fs(e, n = "") {
1735
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-agents/${e}${t}`, {
1736
+ ...a,
1737
+ method: "DELETE"
1738
+ });
1739
+ return i(s, "删除个人 Agent 失败");
1740
+ }
1741
+ async function xs(e, n, t = "") {
1742
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/personal-agents/${e}${s}`, {
1743
+ ...a,
1744
+ method: "PUT",
1745
+ headers: { "Content-Type": "application/json" },
1746
+ body: JSON.stringify({ display_name: n })
1747
+ });
1748
+ return E(
1749
+ await i(o, "重命名个人 Agent 失败")
1750
+ );
1751
+ }
1752
+ async function zs(e = "") {
1753
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
1754
+ `${c}/personal-agents/shared${n}`,
1755
+ a
1756
+ ), s = await i(
1757
+ t,
1758
+ "获取共享 Agent 列表失败"
1759
+ );
1760
+ return (Array.isArray(s) ? s : []).map(
1761
+ (o) => E(o)
1762
+ );
1763
+ }
1764
+ async function Ws(e, n, t = "") {
1765
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/personal-agents/${e}/share${s}`, {
1766
+ ...a,
1767
+ method: "PUT",
1768
+ headers: { "Content-Type": "application/json" },
1769
+ body: JSON.stringify({ shared: n })
1770
+ });
1771
+ return E(
1772
+ await i(o, "切换共享状态失败")
1773
+ );
1774
+ }
1775
+ async function Gs(e, n = "") {
1776
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1777
+ `${c}/personal-agents/${e}/sessions${t}`,
1778
+ a
1779
+ );
1780
+ return i(s, "获取会话列表失败");
1781
+ }
1782
+ async function Hs(e, n = "新会话", t = "") {
1783
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1784
+ `${c}/personal-agents/${e}/sessions${s}`,
1785
+ {
1786
+ ...a,
1787
+ method: "POST",
1788
+ headers: { "Content-Type": "application/json" },
1789
+ body: JSON.stringify({ title: n })
1790
+ }
1791
+ );
1792
+ return i(o, "创建会话失败");
1793
+ }
1794
+ async function Vs(e, n, t = "") {
1795
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1796
+ `${c}/personal-agents/${e}/sessions/${n}${s}`,
1797
+ { ...a, method: "DELETE" }
1798
+ );
1799
+ return i(o, "删除会话失败");
1800
+ }
1801
+ async function Qs(e, n, t, s = "") {
1802
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
1803
+ `${c}/personal-agents/${e}/sessions/${n}${o}`,
1804
+ {
1805
+ ...a,
1806
+ method: "PUT",
1807
+ headers: { "Content-Type": "application/json" },
1808
+ body: JSON.stringify({ title: t })
1809
+ }
1810
+ );
1811
+ return i(d, "重命名会话失败");
1812
+ }
1813
+ async function Ks(e, n, t = "") {
1814
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
1815
+ `${c}/personal-agents/${e}/sessions/${n}/messages${s}`,
1816
+ a
1817
+ );
1818
+ return i(o, "获取消息历史失败");
1819
+ }
1820
+ async function Zs(e, n, t, s, o, d, u, m) {
1821
+ const T = s ? `?token=${encodeURIComponent(s)}` : "", D = `${c}/personal-agents/${e}/sessions/${n}/chat/stream${T}`;
1822
+ try {
1823
+ const $ = await fetch(D, {
1824
+ ...a,
1825
+ method: "POST",
1826
+ headers: { "Content-Type": "application/json" },
1827
+ body: JSON.stringify({ message: t })
1828
+ });
1829
+ if (!$.ok || !$.body) {
1830
+ const _ = await $.text().catch(() => "");
1831
+ d(new Error(_ || `HTTP ${$.status}`));
1832
+ return;
1833
+ }
1834
+ const L = $.body.getReader(), J = new TextDecoder();
1835
+ let O = "", U = "";
1836
+ for (; ; ) {
1837
+ const { done: _, value: H } = await L.read();
1838
+ if (_) break;
1839
+ O += J.decode(H, { stream: !0 });
1840
+ const M = O.split(`
1841
+ `);
1842
+ O = M.pop() || "";
1843
+ for (const B of M) {
1844
+ const h = B.trim();
1845
+ if (!h) {
1846
+ U = "";
1847
+ continue;
1848
+ }
1849
+ if (!h.startsWith(":")) {
1850
+ if (h.startsWith("event:")) {
1851
+ U = h.slice(6).trim();
1852
+ continue;
1853
+ }
1854
+ if (h.startsWith("data:")) {
1855
+ const P = h.slice(5).trim();
1856
+ if (U === "replace") {
1857
+ m && m(P), U = "";
1858
+ continue;
1859
+ }
1860
+ if (P.startsWith("[error]")) {
1861
+ d(new Error(P.slice(7).trim()));
1862
+ return;
1863
+ }
1864
+ o(P);
1865
+ }
1866
+ }
1867
+ }
1868
+ }
1869
+ u();
1870
+ } catch ($) {
1871
+ d($ instanceof Error ? $ : new Error(String($)));
1872
+ }
1873
+ }
1874
+ const g = "http://127.0.0.1:28080";
1875
+ async function Xs(e) {
1876
+ const n = e ? `${g}/v1/sessions?agentId=${encodeURIComponent(e)}` : `${g}/v1/sessions`, t = await fetch(n);
1877
+ if (!t.ok) throw new Error("获取本地会话列表失败");
1878
+ return t.json();
1879
+ }
1880
+ async function Ys(e, n) {
1881
+ const t = { title: e };
1882
+ n && (t.agentId = n);
1883
+ const s = await fetch(`${g}/v1/sessions`, {
1884
+ method: "POST",
1885
+ headers: { "Content-Type": "application/json" },
1886
+ body: JSON.stringify(t)
1887
+ });
1888
+ if (!s.ok) throw new Error("创建本地会话失败");
1889
+ return s.json();
1890
+ }
1891
+ async function eo(e) {
1892
+ const n = await fetch(`${g}/v1/sessions/${e}`);
1893
+ if (!n.ok) throw new Error("获取本地会话详情失败");
1894
+ return n.json();
1895
+ }
1896
+ async function no(e) {
1897
+ await fetch(`${g}/v1/sessions/${e}`, {
1898
+ method: "DELETE"
1899
+ });
1900
+ }
1901
+ async function to() {
1902
+ try {
1903
+ return (await fetch(`${g}/health`)).ok;
1904
+ } catch {
1905
+ return !1;
1906
+ }
1907
+ }
1908
+ async function so() {
1909
+ const e = await fetch(`${g}/v1/agents`);
1910
+ if (!e.ok) throw new Error("获取本地 Agent 列表失败");
1911
+ return (await e.json()).agents || [];
1912
+ }
1913
+ async function oo(e, n, t, s) {
1914
+ const o = { name: e, type: n }, d = await fetch(`${g}/v1/agents`, {
1915
+ method: "POST",
1916
+ headers: { "Content-Type": "application/json" },
1917
+ body: JSON.stringify(o)
1918
+ });
1919
+ if (!d.ok) {
1920
+ const u = await d.text();
1921
+ throw new Error(u || "创建 Agent 失败");
1922
+ }
1923
+ return d.json();
1924
+ }
1925
+ async function ao(e) {
1926
+ if (!(await fetch(`${g}/v1/agents/${e}`, {
1927
+ method: "DELETE"
1928
+ })).ok) throw new Error("删除 Agent 失败");
1929
+ }
1930
+ async function ro(e, n = "", t = "") {
1931
+ const s = new URLSearchParams();
1932
+ n && s.set("subdir", n), t && s.set("token", t);
1933
+ const o = s.toString(), d = await r(
1934
+ `${c}/personal-agents/${e}/files/tree${o ? "?" + o : ""}`,
1935
+ a
1936
+ );
1937
+ return i(d, "获取文件列表失败");
1938
+ }
1939
+ async function io(e, n = "", t = "") {
1940
+ const s = new URLSearchParams();
1941
+ n && s.set("path", n), t && s.set("token", t);
1942
+ const o = s.toString(), d = await r(
1943
+ `${c}/personal-agents/${e}/files/content${o ? "?" + o : ""}`,
1944
+ a
1945
+ );
1946
+ return i(d, "读取文件内容失败");
1947
+ }
1948
+ async function co(e, n = 1, t = 20, s = "") {
1949
+ const o = new URLSearchParams();
1950
+ o.set("page", String(n)), o.set("size", String(t)), s && o.set("token", s);
1951
+ const d = await r(
1952
+ `${c}/personal-agents/${e}/skills?${o.toString()}`,
1953
+ a
1954
+ );
1955
+ return i(d, "获取 Skill 列表失败");
1956
+ }
1957
+ async function uo(e, n, t, s = "") {
1958
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
1959
+ `${c}/personal-agents/${e}/skills/${encodeURIComponent(
1960
+ n
1961
+ )}/toggle${o}`,
1962
+ {
1963
+ ...a,
1964
+ method: "POST",
1965
+ headers: { "Content-Type": "application/json" },
1966
+ body: JSON.stringify({ enable: t })
1967
+ }
1968
+ );
1969
+ return i(d, "切换 Skill 失败");
1970
+ }
1971
+ async function lo(e, n = "") {
1972
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
1973
+ `${c}/personal-agents/${e}/schedules${t}`,
1974
+ a
1975
+ );
1976
+ return i(s, "获取定时任务列表失败");
1977
+ }
1978
+ async function mo(e, n, t, s, o = "", d = "", u = "") {
1979
+ const m = u ? `?token=${encodeURIComponent(u)}` : "", T = await r(
1980
+ `${c}/personal-agents/${e}/schedules${m}`,
1981
+ {
1982
+ ...a,
1983
+ method: "POST",
1984
+ headers: { "Content-Type": "application/json" },
1985
+ body: JSON.stringify({
1986
+ name: n,
1987
+ prompt: t,
1988
+ cron_expression: s,
1989
+ notify_user_id: o,
1990
+ notify_user_name: d
1991
+ })
1992
+ }
1993
+ );
1994
+ return i(T, "创建定时任务失败");
1995
+ }
1996
+ async function po(e, n, t, s = "") {
1997
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
1998
+ `${c}/personal-agents/${e}/schedules/${n}${o}`,
1999
+ {
2000
+ ...a,
2001
+ method: "PUT",
2002
+ headers: { "Content-Type": "application/json" },
2003
+ body: JSON.stringify(t)
2004
+ }
2005
+ );
2006
+ return i(d, "更新定时任务失败");
2007
+ }
2008
+ async function fo(e, n, t = "") {
2009
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2010
+ `${c}/personal-agents/${e}/schedules/${n}${s}`,
2011
+ {
2012
+ ...a,
2013
+ method: "DELETE"
2014
+ }
2015
+ );
2016
+ return i(o, "删除定时任务失败");
2017
+ }
2018
+ async function $o(e, n, t, s = "") {
2019
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
2020
+ `${c}/personal-agents/${e}/schedules/${n}/toggle${o}`,
2021
+ {
2022
+ ...a,
2023
+ method: "POST",
2024
+ headers: { "Content-Type": "application/json" },
2025
+ body: JSON.stringify({ enable: t })
2026
+ }
2027
+ );
2028
+ return i(d, "切换定时任务状态失败");
2029
+ }
2030
+ async function yo(e, n, t = 1, s = 20, o = "") {
2031
+ const d = new URLSearchParams();
2032
+ d.set("page", String(t)), d.set("size", String(s)), o && d.set("token", o);
2033
+ const u = await r(
2034
+ `${c}/personal-agents/${e}/schedules/${n}/logs?${d.toString()}`,
2035
+ a
2036
+ );
2037
+ return i(u, "获取执行历史失败");
2038
+ }
2039
+ async function ho(e, n, t = "") {
2040
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2041
+ `${c}/personal-agents/${e}/schedules/${n}/run${s}`,
2042
+ {
2043
+ ...a,
2044
+ method: "POST"
2045
+ }
2046
+ );
2047
+ return i(o, "手动触发任务失败");
2048
+ }
2049
+ async function go(e, n = "", t = "") {
2050
+ const s = new URLSearchParams();
2051
+ n && s.set("keyword", n), t && s.set("token", t);
2052
+ const o = await r(
2053
+ `${c}/personal-agents/${e}/schedules/staff-search?${s.toString()}`,
2054
+ a
2055
+ );
2056
+ return i(o, "搜索员工失败");
2057
+ }
2058
+ async function So(e = "", n = 50) {
2059
+ const t = new URLSearchParams();
2060
+ t.set("limit", String(n)), e && t.set("token", e);
2061
+ const s = await r(
2062
+ `${c}/personal-agents/schedules/notifications?${t.toString()}`,
2063
+ a
2064
+ );
2065
+ return i(s, "获取通知失败");
2066
+ }
2067
+ async function wo(e, n = "") {
2068
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
2069
+ `${c}/personal-agents/schedules/notifications/${e}/read${t}`,
2070
+ {
2071
+ ...a,
2072
+ method: "POST"
2073
+ }
2074
+ );
2075
+ return i(s, "标记已读失败");
2076
+ }
2077
+ async function To(e = "") {
2078
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
2079
+ `${c}/personal-agents/schedules/notifications/read-all${n}`,
2080
+ {
2081
+ ...a,
2082
+ method: "POST"
2083
+ }
2084
+ );
2085
+ return i(t, "标记已读失败");
2086
+ }
2087
+ async function Co(e, n = 50) {
2088
+ const t = await r(
2089
+ `${c}/scenario-instances/${e}/observer-dispatch-logs?limit=${n}`,
2090
+ { ...a }
2091
+ );
2092
+ return i(t, "查询派发日志失败");
2093
+ }
2094
+ async function Io(e, n) {
2095
+ const t = await r(
2096
+ `${c}/scenario-instances/${e}/observer-dispatch-logs/${n}`,
2097
+ { ...a }
2098
+ );
2099
+ return i(t, "查询派发日志详情失败");
2100
+ }
2101
+ async function Uo(e) {
2102
+ const n = await r(
2103
+ `${c}/scenario-instances/${e}/observer/trigger`,
2104
+ { ...a, method: "POST" }
2105
+ );
2106
+ return i(n, "触发观察失败");
2107
+ }
2108
+ async function bo(e = {}) {
2109
+ const n = new URLSearchParams(), { name: t, scenarioInstanceId: s, page: o = 1, size: d = 50, token: u = "" } = e;
2110
+ 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);
2111
+ const m = n.toString(), T = await r(
2112
+ `${c}/admin/tasks${m ? `?${m}` : ""}`,
2113
+ a
2114
+ );
2115
+ return i(T, "获取任务列表失败");
2116
+ }
2117
+ function R(e) {
2118
+ const n = new URLSearchParams();
2119
+ Object.entries(e).forEach(([s, o]) => {
2120
+ o != null && o !== "" && n.append(s, String(o));
2121
+ });
2122
+ const t = n.toString();
2123
+ return t ? `?${t}` : "";
2124
+ }
2125
+ async function Ao(e) {
2126
+ const n = await r(
2127
+ `${c}/admin/tool-call-logs${R(e)}`,
2128
+ a
2129
+ );
2130
+ return i(n, "查询工具调用日志失败");
2131
+ }
2132
+ async function Ro(e, n = "") {
2133
+ const t = await r(
2134
+ `${c}/admin/tool-call-logs/${e}${R({ token: n })}`,
2135
+ a
2136
+ );
2137
+ return i(t, "查询工具调用日志详情失败");
2138
+ }
2139
+ async function Oo(e = "") {
2140
+ const n = await r(
2141
+ `${c}/admin/tool-call-logs/tool-types${R({ token: e })}`,
2142
+ a
2143
+ );
2144
+ return i(n, "查询工具类型失败");
2145
+ }
2146
+ async function _o(e = "") {
2147
+ const n = await r(
2148
+ `${c}/admin/tool-call-logs/agents/names${R({ token: e })}`,
2149
+ a
2150
+ );
2151
+ return i(n, "查询 Agent 名称失败");
2152
+ }
2153
+ async function Po(e) {
2154
+ const n = await r(
2155
+ `${c}/admin/tool-call-logs/stats${R(e)}`,
2156
+ a
2157
+ );
2158
+ return i(n, "查询工具调用统计失败");
2159
+ }
2160
+ async function Eo(e) {
2161
+ const n = await r(
2162
+ `${c}/admin/tool-call-logs/overview${R(e)}`,
2163
+ a
2164
+ );
2165
+ return i(n, "查询工具调用概览统计失败");
2166
+ }
2167
+ async function ko(e) {
2168
+ const n = await r(
2169
+ `${c}/admin/tool-call-logs/timeline${R(e)}`,
2170
+ a
2171
+ );
2172
+ return i(n, "查询工具调用时间轴统计失败");
2173
+ }
2174
+ function I(e) {
2175
+ const n = [];
2176
+ return e.startDate && n.push(`startDate=${encodeURIComponent(e.startDate)}`), e.endDate && n.push(`endDate=${encodeURIComponent(e.endDate)}`), e.scenarioCode && n.push(`scenarioCode=${encodeURIComponent(e.scenarioCode)}`), e.token && n.push(`token=${encodeURIComponent(e.token)}`), n.length > 0 ? `?${n.join("&")}` : "";
2177
+ }
2178
+ async function No(e) {
2179
+ const n = await r(
2180
+ `${c}/admin/statistics/overview${I(e)}`,
2181
+ a
2182
+ );
2183
+ return i(n, "获取统计总览失败");
2184
+ }
2185
+ async function vo(e) {
2186
+ const n = await r(
2187
+ `${c}/admin/statistics/team-chat${I(e)}`,
2188
+ a
2189
+ );
2190
+ return i(n, "获取群聊统计失败");
2191
+ }
2192
+ async function qo(e) {
2193
+ const n = await r(
2194
+ `${c}/admin/statistics/personal-chat${I(e)}`,
2195
+ a
2196
+ );
2197
+ return i(n, "获取单聊统计失败");
2198
+ }
2199
+ async function jo(e) {
2200
+ const n = await r(
2201
+ `${c}/admin/statistics/tasks${I(e)}`,
2202
+ a
2203
+ );
2204
+ return i(n, "获取任务统计失败");
2205
+ }
2206
+ async function Do(e) {
2207
+ const n = await r(
2208
+ `${c}/admin/statistics/agent-executions${I(e)}`,
2209
+ a
2210
+ );
2211
+ return i(n, "获取执行统计失败");
2212
+ }
2213
+ async function Lo(e) {
2214
+ const n = await r(
2215
+ `${c}/admin/statistics/tech-metrics${I(e)}`,
2216
+ a
2217
+ );
2218
+ return i(n, "获取技术指标失败");
2219
+ }
2220
+ async function Jo(e) {
2221
+ const n = await r(
2222
+ `${c}/admin/statistics/personal-users${I(e)}`,
2223
+ a
2224
+ ), t = await i(n, "获取人员统计失败");
2225
+ return Array.isArray(t) ? t : (console.warn("[Statistics] personal-users 响应非数组", t), []);
2226
+ }
2227
+ async function Mo(e) {
2228
+ const n = [];
2229
+ e.date && n.push(`date=${encodeURIComponent(e.date)}`), e.scenarioCode && n.push(`scenarioCode=${encodeURIComponent(e.scenarioCode)}`), e.token && n.push(`token=${encodeURIComponent(e.token)}`);
2230
+ const t = n.length > 0 ? `?${n.join("&")}` : "", s = await r(
2231
+ `${c}/admin/statistics/scenario-daily${t}`,
2232
+ a
2233
+ );
2234
+ return i(s, "获取单日统计失败");
2235
+ }
2236
+ async function Bo(e) {
2237
+ const n = await r(
2238
+ `${c}/admin/statistics/token-multi${I(e)}`,
2239
+ a
2240
+ );
2241
+ return i(n, "获取 Token 多日统计失败");
2242
+ }
2243
+ async function Fo(e) {
2244
+ const n = [];
2245
+ e.date && n.push(`date=${encodeURIComponent(e.date)}`), e.scenarioCode && n.push(`scenarioCode=${encodeURIComponent(e.scenarioCode)}`), e.token && n.push(`token=${encodeURIComponent(e.token)}`);
2246
+ const t = n.length > 0 ? `?${n.join("&")}` : "", s = await r(
2247
+ `${c}/admin/statistics/token-daily${t}`,
2248
+ a
2249
+ );
2250
+ return i(s, "获取 Token 单日统计失败");
2251
+ }
2252
+ async function xo(e = "z-team") {
2253
+ const n = await r(
2254
+ `${c}/change-log/versions?repo=${encodeURIComponent(e)}`,
2255
+ a
2256
+ );
2257
+ return i(n, "获取变更日志版本列表失败");
2258
+ }
2259
+ async function zo(e, n, t = "z-team") {
2260
+ const s = new URLSearchParams();
2261
+ e != null && s.set("versionId", String(e)), s.set("repo", t);
2262
+ const o = await r(
2263
+ `${c}/change-log/detail?${s.toString()}`,
2264
+ a
2265
+ );
2266
+ return i(o, "获取变更日志详情失败");
2267
+ }
2268
+ async function Wo(e = "") {
2269
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
2270
+ `${c}/admin/permissions/all-mappings${n}`,
2271
+ a
2272
+ );
2273
+ return i(t, "获取权限映射失败") ?? {};
2274
+ }
2275
+ async function Go(e = "") {
2276
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
2277
+ `${c}/admin/permissions/points${n}`,
2278
+ a
2279
+ );
2280
+ return i(t, "获取权限点列表失败") ?? [];
2281
+ }
2282
+ async function Ho(e, n, t, s, o = "") {
2283
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await r(
2284
+ `${c}/admin/permissions/users/${e}${d}`,
2285
+ {
2286
+ ...a,
2287
+ method: "PUT",
2288
+ headers: { "Content-Type": "application/json" },
2289
+ body: JSON.stringify({ staffName: n, accountNo: t, permissionCodes: s })
2290
+ }
2291
+ );
2292
+ return i(u, "更新用户权限失败");
2293
+ }
2294
+ async function Vo(e) {
2295
+ try {
2296
+ const n = await r(
2297
+ `${S}/evolution/groups/learning-status-by-query?groupId=${encodeURIComponent(
2298
+ e
2299
+ )}`,
2300
+ a
2301
+ );
2302
+ return n.ok ? await n.json() : { status: "ERROR", error: `HTTP ${n.status}` };
2303
+ } catch (n) {
2304
+ return { status: "ERROR", error: n.message };
2305
+ }
2306
+ }
2307
+ async function Qo(e) {
2308
+ const n = await r(
2309
+ `${S}/evolution/groups/${encodeURIComponent(
2310
+ e
2311
+ )}/learn`,
2312
+ { ...a, method: "POST" }
2313
+ );
2314
+ return i(n, "触发学习失败");
2315
+ }
2316
+ async function Ko(e) {
2317
+ const n = await r(
2318
+ `${S}/evolution/groups/${encodeURIComponent(
2319
+ e
2320
+ )}/pool-learn`,
2321
+ { ...a, method: "POST" }
2322
+ );
2323
+ return i(n, "触发池化学习失败");
2324
+ }
2325
+ async function Zo(e) {
2326
+ return (await r(
2327
+ `${S}/evolution/groups/${encodeURIComponent(
2328
+ e
2329
+ )}/restructure`,
2330
+ { ...a, method: "POST" }
2331
+ )).json();
2332
+ }
2333
+ async function Xo(e) {
2334
+ return (await r(
2335
+ `${S}/evolution/groups/${encodeURIComponent(
2336
+ e
2337
+ )}/contributions`,
2338
+ a
2339
+ )).json();
2340
+ }
2341
+ async function Yo(e) {
2342
+ const n = await r(
2343
+ `${S}/evolution/records/${e}/approve`,
2344
+ { ...a, method: "POST" }
2345
+ );
2346
+ return i(n, "审批失败");
2347
+ }
2348
+ async function ea(e, n = "") {
2349
+ const t = await r(
2350
+ `${S}/evolution/records/${e}/reject`,
2351
+ {
2352
+ ...a,
2353
+ method: "POST",
2354
+ headers: { "Content-Type": "application/json" },
2355
+ body: JSON.stringify({ reason: n })
2356
+ }
2357
+ );
2358
+ return i(t, "操作失败");
2359
+ }
2360
+ async function na(e) {
2361
+ const n = await r(
2362
+ `${S}/evolution/records/${e}/reset`,
2363
+ { ...a, method: "POST" }
2364
+ );
2365
+ return i(n, "操作失败");
2366
+ }
2367
+ function l(e) {
2368
+ const n = new URLSearchParams();
2369
+ Object.entries(e).forEach(([s, o]) => {
2370
+ o != null && o !== "" && n.append(s, String(o));
2371
+ });
2372
+ const t = n.toString();
2373
+ return t ? `?${t}` : "";
2374
+ }
2375
+ async function ta(e) {
2376
+ const n = await r(
2377
+ `${c}/admin/qa-eval/closed-instances${l({
2378
+ close_date: e.closeDate,
2379
+ close_date_start: e.closeDateStart,
2380
+ close_date_end: e.closeDateEnd,
2381
+ scenario_code: e.scenarioCode,
2382
+ token: e.token
2383
+ })}`,
2384
+ a
2385
+ ), t = await i(
2386
+ n,
2387
+ "获取已关单实例列表失败"
2388
+ );
2389
+ return Array.isArray(t == null ? void 0 : t.list) ? t.list : [];
2390
+ }
2391
+ async function sa(e, n = "") {
2392
+ const t = await r(
2393
+ `${c}/admin/qa-eval/trigger${l({ token: n })}`,
2394
+ {
2395
+ ...a,
2396
+ method: "POST",
2397
+ headers: { "Content-Type": "application/json" },
2398
+ body: JSON.stringify(e)
2399
+ }
2400
+ );
2401
+ return i(t, "发起评测失败");
2402
+ }
2403
+ async function oa(e, n = "") {
2404
+ const t = await r(
2405
+ `${c}/admin/qa-eval/reports/progress${l({
2406
+ report_ids: e.join(","),
2407
+ token: n
2408
+ })}`,
2409
+ a
2410
+ ), s = await i(
2411
+ t,
2412
+ "获取评测进度失败"
2413
+ );
2414
+ return Array.isArray(s == null ? void 0 : s.items) ? s.items : [];
2415
+ }
2416
+ async function aa(e, n = "") {
2417
+ const t = await r(
2418
+ `${c}/admin/qa-eval/report/by-instance/${e}${l(
2419
+ { token: n }
2420
+ )}`,
2421
+ a
2422
+ );
2423
+ return i(t, "获取实例评测报告失败");
2424
+ }
2425
+ async function ra(e) {
2426
+ const n = await r(
2427
+ `${c}/admin/qa-eval/overview${l({
2428
+ close_date: e.closeDate,
2429
+ close_date_start: e.closeDateStart,
2430
+ close_date_end: e.closeDateEnd,
2431
+ scenario_code: e.scenarioCode,
2432
+ token: e.token
2433
+ })}`,
2434
+ a
2435
+ );
2436
+ return i(n, "获取 QA 评测总览失败");
2437
+ }
2438
+ async function ia(e, n = "") {
2439
+ const t = await r(
2440
+ `${c}/admin/qa-eval/report/${e}/cancel${l({
2441
+ token: n
2442
+ })}`,
2443
+ { ...a, method: "POST" }
2444
+ );
2445
+ return i(t, "取消评测失败");
2446
+ }
2447
+ async function ca(e, n, t = "") {
2448
+ const s = new URLSearchParams();
2449
+ e && s.set("scenario_code", e), n && s.set("sub_scenario_code", n), t && s.set("token", t);
2450
+ const o = s.toString() ? `?${s.toString()}` : "", d = await r(
2451
+ `${c}/admin/scenario-templates${o}`,
2452
+ a
2453
+ );
2454
+ return i(d, "获取场景模板列表失败");
2455
+ }
2456
+ async function da(e, n = "") {
2457
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenario-templates${t}`, {
2458
+ ...a,
2459
+ method: "POST",
2460
+ headers: { "Content-Type": "application/json" },
2461
+ body: JSON.stringify(e)
2462
+ });
2463
+ return i(s, "新建场景模板失败");
2464
+ }
2465
+ async function ua(e, n = "") {
2466
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
2467
+ `${c}/admin/scenario-templates/${e}${t}`,
2468
+ {
2469
+ ...a,
2470
+ method: "DELETE"
2471
+ }
2472
+ );
2473
+ return i(s, "删除场景模板失败");
2474
+ }
2475
+ async function la(e, n = "") {
2476
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
2477
+ `${c}/admin/scenario-templates/${e}/versions${t}`,
2478
+ a
2479
+ );
2480
+ return i(s, "获取版本列表失败");
2481
+ }
2482
+ async function ma(e, n, t = "") {
2483
+ const s = `?from_published=${n}${t ? `&token=${encodeURIComponent(t)}` : ""}`, o = await r(
2484
+ `${c}/admin/scenario-templates/${e}/versions${s}`,
2485
+ { ...a, method: "POST" }
2486
+ );
2487
+ return i(o, "新建版本失败");
2488
+ }
2489
+ async function pa(e, n, t, s = "") {
2490
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
2491
+ `${c}/admin/scenario-templates/${e}/versions/${n}${o}`,
2492
+ {
2493
+ ...a,
2494
+ method: "PUT",
2495
+ headers: { "Content-Type": "application/json" },
2496
+ body: JSON.stringify(t)
2497
+ }
2498
+ );
2499
+ return i(d, "保存版本失败");
2500
+ }
2501
+ async function fa(e, n, t = "") {
2502
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2503
+ `${c}/admin/scenario-templates/${e}/versions/${n}/publish${s}`,
2504
+ { ...a, method: "POST" }
2505
+ );
2506
+ return i(o, "发布失败");
2507
+ }
2508
+ async function $a(e, n, t = "") {
2509
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2510
+ `${c}/admin/scenario-templates/${e}/versions/${n}/archive${s}`,
2511
+ { ...a, method: "POST" }
2512
+ );
2513
+ return i(o, "归档失败");
2514
+ }
2515
+ async function ya(e, n, t = "") {
2516
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2517
+ `${c}/admin/scenario-templates/preview${s}`,
2518
+ {
2519
+ ...a,
2520
+ method: "POST",
2521
+ headers: { "Content-Type": "application/json" },
2522
+ body: JSON.stringify({ html: e, data: n })
2523
+ }
2524
+ );
2525
+ if (!o.ok) throw new Error(`HTTP ${o.status}`);
2526
+ return o.text();
2527
+ }
2528
+ async function ha(e, n = "") {
2529
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
2530
+ `${c}/tasks/${e}/human-assist${t}`,
2531
+ { ...a, method: "GET" }
2532
+ );
2533
+ return i(s, "查询人机协助卡片失败");
2534
+ }
2535
+ async function ga(e, n, t, s = "") {
2536
+ const o = s ? `?token=${encodeURIComponent(s)}` : "", d = await r(
2537
+ `${c}/scenario-instances/${e}/card-forms/${n}/submit${o}`,
2538
+ {
2539
+ ...a,
2540
+ method: "POST",
2541
+ headers: { "Content-Type": "application/json" },
2542
+ body: JSON.stringify({ value: t })
2543
+ }
2544
+ );
2545
+ return i(d, "提交卡片表单失败");
2546
+ }
2547
+ async function Sa(e, n, t = "") {
2548
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2549
+ `${c}/tasks/${e}/submit-assist${s}`,
2550
+ {
2551
+ ...a,
2552
+ method: "POST",
2553
+ headers: { "Content-Type": "application/json" },
2554
+ body: JSON.stringify({ value: n })
2555
+ }
2556
+ );
2557
+ return i(o, "提交人机协助任务失败");
2558
+ }
2559
+ const ye = typeof window < "u" && window.ZTEAM_WEBIDE_BASE || "/kapi/webide/inspect";
2560
+ function wa(e) {
2561
+ const n = new URLSearchParams();
2562
+ return n.set("type", e.type), e.name && n.set("name", e.name), e.type === "git" ? (e.giturl && n.set("giturl", e.giturl), e.branch && n.set("branch", e.branch), e.workspace && n.set("workspace", e.workspace)) : e.path && n.set("path", e.path), `${ye}/embed?${n.toString()}`;
2563
+ }
2564
+ async function Ta(e = "", n = "") {
2565
+ const t = [];
2566
+ e && t.push(`keyword=${encodeURIComponent(e)}`), n && t.push(`token=${encodeURIComponent(n)}`);
2567
+ const s = t.length ? `?${t.join("&")}` : "", o = await r(
2568
+ `${c}/admin/generic-configs${s}`,
2569
+ a
2570
+ );
2571
+ return i(o, "获取通用配置列表失败");
2572
+ }
2573
+ async function Ca(e, n = "") {
2574
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/generic-configs${t}`, {
2575
+ ...a,
2576
+ method: "POST",
2577
+ headers: { "Content-Type": "application/json" },
2578
+ body: JSON.stringify(e)
2579
+ });
2580
+ return i(s, "新建通用配置失败");
2581
+ }
2582
+ async function Ia(e, n, t = "") {
2583
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/generic-configs/${e}${s}`, {
2584
+ ...a,
2585
+ method: "PUT",
2586
+ headers: { "Content-Type": "application/json" },
2587
+ body: JSON.stringify(n)
2588
+ });
2589
+ return i(o, "更新通用配置失败");
2590
+ }
2591
+ async function Ua(e, n = "") {
2592
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/generic-configs/${e}${t}`, {
2593
+ ...a,
2594
+ method: "DELETE"
2595
+ });
2596
+ return i(s, "删除通用配置失败");
2597
+ }
2598
+ async function ba(e = "", n = !1) {
2599
+ const t = new URLSearchParams();
2600
+ e && t.set("token", e), n && t.set("allUsers", "true");
2601
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(`${c}/personal-note/tree${s}`, a);
2602
+ return i(o, "获取笔记文件树失败");
2603
+ }
2604
+ async function Aa(e, n = "") {
2605
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note${t}`, {
2606
+ ...a,
2607
+ method: "POST",
2608
+ headers: { "Content-Type": "application/json" },
2609
+ body: JSON.stringify(e)
2610
+ });
2611
+ return i(s, "新建笔记失败");
2612
+ }
2613
+ async function Ra(e, n = "") {
2614
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note/${e}${t}`, a);
2615
+ return i(s, "获取笔记内容失败");
2616
+ }
2617
+ async function Oa(e, n, t = "") {
2618
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/personal-note/${e}${s}`, {
2619
+ ...a,
2620
+ method: "PUT",
2621
+ headers: { "Content-Type": "application/json" },
2622
+ body: JSON.stringify(n)
2623
+ });
2624
+ return i(o, "保存笔记失败");
2625
+ }
2626
+ async function _a(e, n, t = "") {
2627
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/personal-note/${e}/rename${s}`, {
2628
+ ...a,
2629
+ method: "PUT",
2630
+ headers: { "Content-Type": "application/json" },
2631
+ body: JSON.stringify({ title: n })
2632
+ });
2633
+ return i(o, "重命名失败");
2634
+ }
2635
+ async function Pa(e, n, t = "") {
2636
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/personal-note/${e}/move${s}`, {
2637
+ ...a,
2638
+ method: "PUT",
2639
+ headers: { "Content-Type": "application/json" },
2640
+ body: JSON.stringify(n)
2641
+ });
2642
+ return i(o, "移动节点失败");
2643
+ }
2644
+ async function Ea(e, n = "") {
2645
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note/${e}${t}`, {
2646
+ ...a,
2647
+ method: "DELETE"
2648
+ });
2649
+ return i(s, "删除笔记失败");
2650
+ }
2651
+ async function ka(e, n, t, s = "") {
2652
+ const o = new URLSearchParams();
2653
+ o.set("bindKey", e), o.set("defaultTitle", n), o.set("extraInfo", t), s && o.set("token", s);
2654
+ const d = await r(
2655
+ `${c}/personal-note/bound?${o.toString()}`,
2656
+ a
2657
+ );
2658
+ return i(d, "获取绑定笔记失败");
2659
+ }
2660
+ async function Na(e, n = "") {
2661
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note/${e}/share${t}`, {
2662
+ ...a,
2663
+ method: "POST"
2664
+ });
2665
+ return i(s, "生成分享链接失败");
2666
+ }
2667
+ async function X(e, n) {
2668
+ const t = await fetch(`${ye}${e}`, {
2669
+ credentials: "include",
2670
+ headers: { Accept: "application/json" },
2671
+ ...n
2672
+ });
2673
+ if (!t.ok)
2674
+ throw new Error(`z-team-webide 请求失败 (${t.status})`);
2675
+ return t.json();
2676
+ }
2677
+ function va() {
2678
+ return X("/instances");
2679
+ }
2680
+ function qa(e) {
2681
+ return X(`/instances/${e}/stop`, { method: "POST" });
2682
+ }
2683
+ function ja(e) {
2684
+ return X(`/instances/${e}`, { method: "DELETE" });
2685
+ }
2686
+ async function Da(e = "", n = 1, t = 20) {
2687
+ const s = await r(
2688
+ `${c}/admin/runtime-monitor/queue${l({
2689
+ token: e,
2690
+ page: n,
2691
+ // 控制器 @RequestParam 名是 pageSize(无下划线),不可写成 page_size
2692
+ pageSize: t
2693
+ })}`,
2694
+ a
2695
+ );
2696
+ return i(s, "查询排队队列状态失败");
2697
+ }
2698
+ async function La(e = "") {
2699
+ const n = await r(
2700
+ `${c}/admin/runtime-monitor/schedule${l({ token: e })}`,
2701
+ a
2702
+ );
2703
+ return i(n, "查询定时任务概览失败");
2704
+ }
2705
+ async function Ja(e = "", n = 6) {
2706
+ const t = await r(
2707
+ `${c}/admin/runtime-monitor/history${l({
2708
+ token: e,
2709
+ hours: n
2710
+ })}`,
2711
+ a
2712
+ );
2713
+ return i(t, "查询历史趋势失败");
2714
+ }
2715
+ async function Ma(e) {
2716
+ const n = new URLSearchParams();
2717
+ 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);
2718
+ const t = await r(
2719
+ `${c}/admin/statistics/business?${n.toString()}`,
2720
+ a
2721
+ ), s = await i(t, "业务指标查询失败");
2722
+ return {
2723
+ total: Number((s == null ? void 0 : s.total) ?? 0),
2724
+ trend: Array.isArray(s == null ? void 0 : s.trend) ? s.trend : [],
2725
+ ranking: Array.isArray(s == null ? void 0 : s.ranking) ? s.ranking : [],
2726
+ tagCoverage: (s == null ? void 0 : s.tagCoverage) ?? void 0,
2727
+ creatorDistribution: Array.isArray(s == null ? void 0 : s.creatorDistribution) ? s.creatorDistribution : void 0,
2728
+ dailyAvg: (s == null ? void 0 : s.dailyAvg) ?? void 0,
2729
+ activeCreators: (s == null ? void 0 : s.activeCreators) ?? void 0
2730
+ };
2731
+ }
2732
+ async function Ba(e, n = "", t) {
2733
+ const s = new URLSearchParams();
2734
+ e && s.set("scenarioCode", e), n && s.set("token", n), t && s.set("source", t);
2735
+ const o = await r(
2736
+ `${c}/admin/scenario-tags?${s.toString()}`,
2737
+ a
2738
+ );
2739
+ return i(o, "获取标签定义失败");
2740
+ }
2741
+ async function Fa(e, n = "") {
2742
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenario-tags${t}`, {
2743
+ ...a,
2744
+ method: "POST",
2745
+ headers: { "Content-Type": "application/json" },
2746
+ body: JSON.stringify(e)
2747
+ });
2748
+ return i(s, "创建标签定义失败");
2749
+ }
2750
+ async function xa(e, n, t = "") {
2751
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/scenario-tags/${e}${s}`, {
2752
+ ...a,
2753
+ method: "PUT",
2754
+ headers: { "Content-Type": "application/json" },
2755
+ body: JSON.stringify(n)
2756
+ });
2757
+ return i(o, "更新标签定义失败");
2758
+ }
2759
+ async function za(e, n = "") {
2760
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/scenario-tags/${e}${t}`, {
2761
+ ...a,
2762
+ method: "DELETE"
2763
+ });
2764
+ return i(s, "删除标签定义失败");
2765
+ }
2766
+ async function Wa(e, n = "", t) {
2767
+ const s = new URLSearchParams();
2768
+ n && s.set("token", n), t && s.set("source", t);
2769
+ const o = s.toString(), d = o ? `?${o}` : "", u = await r(
2770
+ `${c}/admin/scenario-tags/${e}/values${d}`,
2771
+ a
2772
+ );
2773
+ return i(u, "获取标签值失败");
2774
+ }
2775
+ async function Ga(e, n, t = "") {
2776
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2777
+ `${c}/admin/scenario-tags/${e}/values${s}`,
2778
+ {
2779
+ ...a,
2780
+ method: "POST",
2781
+ headers: { "Content-Type": "application/json" },
2782
+ body: JSON.stringify(n)
2783
+ }
2784
+ );
2785
+ return i(o, "创建标签值失败");
2786
+ }
2787
+ async function Ha(e, n, t = "") {
2788
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2789
+ `${c}/admin/scenario-tags/values/${e}${s}`,
2790
+ {
2791
+ ...a,
2792
+ method: "PUT",
2793
+ headers: { "Content-Type": "application/json" },
2794
+ body: JSON.stringify(n)
2795
+ }
2796
+ );
2797
+ return i(o, "更新标签值失败");
2798
+ }
2799
+ async function Va(e, n = "") {
2800
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
2801
+ `${c}/admin/scenario-tags/values/${e}${t}`,
2802
+ {
2803
+ ...a,
2804
+ method: "DELETE"
2805
+ }
2806
+ );
2807
+ return i(s, "删除标签值失败");
2808
+ }
2809
+ async function Qa(e, n, t) {
2810
+ const s = await r(
2811
+ `${c}/scenario-instances/${e}/workspace/git-clone`,
2812
+ {
2813
+ ...a,
2814
+ method: "POST",
2815
+ headers: { "Content-Type": "application/json" },
2816
+ body: JSON.stringify({
2817
+ parent_path: n,
2818
+ url: t.url,
2819
+ branch: t.branch ?? "",
2820
+ folder_name: t.folderName ?? ""
2821
+ })
2822
+ }
2823
+ );
2824
+ return i(s, "Git Clone 失败");
2825
+ }
2826
+ async function Ka(e) {
2827
+ const n = await r(
2828
+ `${c}/scenario-instances/${e}/retry-init`,
2829
+ {
2830
+ ...a,
2831
+ method: "POST",
2832
+ headers: { "Content-Type": "application/json" }
2833
+ }
2834
+ );
2835
+ return i(n, "初始化补偿失败");
2836
+ }
2837
+ async function Za() {
2838
+ const e = await r(
2839
+ `${c}/scenarios/biz-consult-domains`,
2840
+ a
2841
+ );
2842
+ return i(e, "获取业务域选项失败");
2843
+ }
2844
+ function k(e) {
2845
+ const n = (s) => {
2846
+ if (typeof s != "string" || !s.trim()) return [];
2847
+ try {
2848
+ const o = JSON.parse(s);
2849
+ return Array.isArray(o) ? o.filter((d) => typeof d == "string") : [];
2850
+ } catch {
2851
+ return [];
2852
+ }
2853
+ }, t = (s) => {
2854
+ if (typeof s != "string" || !s.trim()) return [];
2855
+ try {
2856
+ const o = JSON.parse(s);
2857
+ return Array.isArray(o) ? o.filter(
2858
+ (d) => !!d && typeof d == "object" && typeof d.type == "string"
2859
+ ) : [];
2860
+ } catch {
2861
+ return [];
2862
+ }
2863
+ };
2864
+ return {
2865
+ // FE-PRECISION-FIX: 雪花 ID 保持字符串
2866
+ id: e.id == null ? "" : String(e.id),
2867
+ projectId: e.projectId == null ? null : String(e.projectId),
2868
+ userId: String(e.userId ?? ""),
2869
+ title: String(e.title ?? ""),
2870
+ detail: e.detail == null ? null : String(e.detail),
2871
+ status: e.status ?? "TODO",
2872
+ priority: e.priority ?? "MEDIUM",
2873
+ dueDate: e.dueDate == null ? null : String(e.dueDate).slice(0, 10),
2874
+ assigneeUserId: e.assigneeUserId == null ? null : String(e.assigneeUserId),
2875
+ tags: n(e.tags),
2876
+ links: t(e.links),
2877
+ // FE-PRECISION-FIX: 顶层(无父事项)用空串哨兵 —— 消费方一律 `!parentId` 判定,
2878
+ // 若这里给 "0" 则字符串 "0" 为真,收集箱过滤会静默失效。
2879
+ parentId: f(e.parentId),
2880
+ sortOrder: e.sortOrder == null ? 0 : Number(e.sortOrder),
2881
+ completedAt: e.completedAt == null ? null : String(e.completedAt),
2882
+ completedBy: e.completedBy == null ? null : String(e.completedBy),
2883
+ createByName: e.createByName == null ? null : String(e.createByName),
2884
+ updateTime: e.updateTime == null ? null : String(e.updateTime)
2885
+ };
2886
+ }
2887
+ async function Xa(e = "") {
2888
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/todo/projects${n}`, a);
2889
+ return i(t, "获取代办项目失败");
2890
+ }
2891
+ async function Ya(e, n = "") {
2892
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/projects${t}`, {
2893
+ ...a,
2894
+ method: "POST",
2895
+ headers: { "Content-Type": "application/json" },
2896
+ body: JSON.stringify(e)
2897
+ });
2898
+ return i(s, "新建项目失败");
2899
+ }
2900
+ async function er(e, n, t = "") {
2901
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/todo/projects/${e}${s}`, {
2902
+ ...a,
2903
+ method: "PUT",
2904
+ headers: { "Content-Type": "application/json" },
2905
+ body: JSON.stringify(n)
2906
+ });
2907
+ return i(o, "更新项目失败");
2908
+ }
2909
+ async function nr(e, n = "") {
2910
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/projects/${e}${t}`, {
2911
+ ...a,
2912
+ method: "DELETE"
2913
+ });
2914
+ return i(s, "删除项目失败");
2915
+ }
2916
+ async function tr(e, n, t = "") {
2917
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/todo/projects/${e}/members${s}`, {
2918
+ ...a,
2919
+ method: "POST",
2920
+ headers: { "Content-Type": "application/json" },
2921
+ body: JSON.stringify(n)
2922
+ });
2923
+ return i(o, "添加成员失败");
2924
+ }
2925
+ async function sr(e, n, t = "") {
2926
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
2927
+ `${c}/todo/projects/${e}/members/${encodeURIComponent(n)}${s}`,
2928
+ { ...a, method: "DELETE" }
2929
+ );
2930
+ return i(o, "移除成员失败");
2931
+ }
2932
+ async function or(e = {}, n = "") {
2933
+ const t = new URLSearchParams();
2934
+ n && t.set("token", n), e.view && t.set("view", e.view), e.projectId != null && t.set("projectId", String(e.projectId)), e.status && t.set("status", e.status), e.keyword && t.set("keyword", e.keyword);
2935
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(`${c}/todo/items${s}`, a);
2936
+ return (await i(
2937
+ o,
2938
+ "获取事项失败"
2939
+ ) ?? []).map(k);
2940
+ }
2941
+ async function ar(e, n = "") {
2942
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/items${t}`, {
2943
+ ...a,
2944
+ method: "POST",
2945
+ headers: { "Content-Type": "application/json" },
2946
+ body: JSON.stringify(e)
2947
+ }), o = await i(s, "新建事项失败");
2948
+ return k(o);
2949
+ }
2950
+ async function rr(e, n, t = "") {
2951
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/todo/items/${e}${s}`, {
2952
+ ...a,
2953
+ method: "PUT",
2954
+ headers: { "Content-Type": "application/json" },
2955
+ body: JSON.stringify(n)
2956
+ }), d = await i(o, "更新事项失败");
2957
+ return k(d);
2958
+ }
2959
+ async function ir(e, n = "", t = "") {
2960
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/todo/items/${e}/complete${s}`, {
2961
+ ...a,
2962
+ method: "POST",
2963
+ headers: { "Content-Type": "application/json" },
2964
+ body: JSON.stringify({ result: n })
2965
+ }), d = await i(o, "完成事项失败");
2966
+ return k(d);
2967
+ }
2968
+ async function cr(e, n = "") {
2969
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/items/${e}/reopen${t}`, {
2970
+ ...a,
2971
+ method: "POST"
2972
+ }), o = await i(s, "重开事项失败");
2973
+ return k(o);
2974
+ }
2975
+ async function dr(e, n, t = "") {
2976
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/todo/items/${e}/reorder${s}`, {
2977
+ ...a,
2978
+ method: "POST",
2979
+ headers: { "Content-Type": "application/json" },
2980
+ body: JSON.stringify(n)
2981
+ }), d = await i(o, "调整排序失败");
2982
+ return k(d);
2983
+ }
2984
+ async function ur(e, n = "") {
2985
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/items/reorder-batch${t}`, {
2986
+ ...a,
2987
+ method: "POST",
2988
+ headers: { "Content-Type": "application/json" },
2989
+ body: JSON.stringify({ updates: e })
2990
+ });
2991
+ return i(s, "调整排序失败");
2992
+ }
2993
+ async function lr(e, n = "") {
2994
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/projects/reorder-batch${t}`, {
2995
+ ...a,
2996
+ method: "POST",
2997
+ headers: { "Content-Type": "application/json" },
2998
+ body: JSON.stringify({ updates: e })
2999
+ });
3000
+ return i(s, "调整项目排序失败");
3001
+ }
3002
+ async function mr(e, n = "") {
3003
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/todo/items/${e}${t}`, {
3004
+ ...a,
3005
+ method: "DELETE"
3006
+ });
3007
+ return i(s, "删除事项失败");
3008
+ }
3009
+ async function pr(e, n = "") {
3010
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
3011
+ `${c}/admin/agent-ext-configs/${encodeURIComponent(e)}${t}`,
3012
+ a
3013
+ );
3014
+ return i(s, "加载扩展配置失败");
3015
+ }
3016
+ async function fr(e, n, t = "") {
3017
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
3018
+ `${c}/admin/agent-ext-configs/${encodeURIComponent(e)}${s}`,
3019
+ {
3020
+ ...a,
3021
+ method: "POST",
3022
+ headers: { "Content-Type": "application/json" },
3023
+ body: JSON.stringify(n)
3024
+ }
3025
+ );
3026
+ return i(o, "新增扩展配置失败");
3027
+ }
3028
+ async function $r(e, n = "") {
3029
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/agent-ext-configs/${e}${t}`, {
3030
+ ...a,
3031
+ method: "DELETE"
3032
+ });
3033
+ return i(s, "删除扩展配置失败");
3034
+ }
3035
+ async function yr(e = "") {
3036
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
3037
+ `${c}/personal-note/favorites${n}`,
3038
+ a
3039
+ );
3040
+ return i(t, "获取收藏列表失败");
3041
+ }
3042
+ async function hr(e, n = "") {
3043
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note/${e}/favorite${t}`, {
3044
+ ...a,
3045
+ method: "POST"
3046
+ });
3047
+ return i(s, "收藏笔记失败");
3048
+ }
3049
+ async function gr(e, n = "") {
3050
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/personal-note/${e}/favorite${t}`, {
3051
+ ...a,
3052
+ method: "DELETE"
3053
+ });
3054
+ return i(s, "取消收藏失败");
3055
+ }
3056
+ async function Sr(e = "", n = 24) {
3057
+ const t = await r(
3058
+ `${c}/admin/runtime-monitor/config${l({
3059
+ token: e,
3060
+ hours: n
3061
+ })}`,
3062
+ a
3063
+ );
3064
+ return i(t, "查询配置生效值失败");
3065
+ }
3066
+ async function wr(e = 1, n = "") {
3067
+ const t = await r(
3068
+ `${c}/admin/llm-call-monitor/stats${l({ hours: e, token: n })}`,
3069
+ a
3070
+ );
3071
+ return i(t, "查询调用监控汇总失败");
3072
+ }
3073
+ async function Tr(e = {}) {
3074
+ const { page: n = 1, size: t = 50, token: s = "" } = e, o = { page: n, size: t, token: s };
3075
+ e.success !== void 0 && (o.success = e.success), e.agentName && (o.agentName = e.agentName), e.scenarioInstanceId && (o.scenarioInstanceId = e.scenarioInstanceId), e.errorType && (o.errorType = e.errorType);
3076
+ const d = await r(
3077
+ `${c}/admin/llm-call-monitor/recent${l(o)}`,
3078
+ a
3079
+ );
3080
+ return i(d, "查询调用明细失败");
3081
+ }
3082
+ async function Cr(e, n = "") {
3083
+ const t = await r(
3084
+ `${c}/admin/llm-call-monitor/conversation${l({
3085
+ executionId: e,
3086
+ token: n
3087
+ })}`,
3088
+ a
3089
+ );
3090
+ return i(t, "查询对话详情失败");
3091
+ }
3092
+ async function Ir(e) {
3093
+ const n = new URLSearchParams();
3094
+ 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.deptId && n.set("deptId", e.deptId), e.source && n.set("source", e.source), e.token && n.set("token", e.token);
3095
+ const t = await r(
3096
+ `${c}/admin/statistics/business/export/workitems?${n.toString()}`,
3097
+ a
3098
+ ), s = await i(t, "工单明细导出失败");
3099
+ return {
3100
+ total: Number((s == null ? void 0 : s.total) ?? 0),
3101
+ truncated: !!(s != null && s.truncated),
3102
+ headers: Array.isArray(s == null ? void 0 : s.headers) ? s.headers : [],
3103
+ rows: Array.isArray(s == null ? void 0 : s.rows) ? s.rows : []
3104
+ };
3105
+ }
3106
+ async function Ur(e = "") {
3107
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
3108
+ `${c}/admin/statistics/dept-tree${n}`,
3109
+ a
3110
+ );
3111
+ return i(t, "获取组织部门树失败");
3112
+ }
3113
+ async function br(e = "") {
3114
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
3115
+ `${c}/admin/statistics/current-dept${n}`,
3116
+ a
3117
+ );
3118
+ return i(t, "获取当前用户部门信息失败");
3119
+ }
3120
+ function Y(e) {
3121
+ const n = new URLSearchParams();
3122
+ Object.entries(e).forEach(([s, o]) => {
3123
+ o != null && o !== "" && n.append(s, String(o));
3124
+ });
3125
+ const t = n.toString();
3126
+ return t ? `?${t}` : "";
3127
+ }
3128
+ async function Ar(e) {
3129
+ const n = await r(
3130
+ `${c}/admin/evaluation/closed-instances${Y({
3131
+ scenario_code: e.scenarioCode,
3132
+ close_tag: e.closeTag,
3133
+ close_time_start: e.closeTimeStart,
3134
+ close_time_end: e.closeTimeEnd,
3135
+ include_forks: e.includeForks ? "true" : void 0,
3136
+ page: e.page,
3137
+ size: e.size,
3138
+ token: e.token
3139
+ })}`,
3140
+ a
3141
+ );
3142
+ return i(n, "获取群聊评测关单列表失败");
3143
+ }
3144
+ async function Rr(e, n = "") {
3145
+ const t = await r(
3146
+ `${c}/admin/evaluation/instances/${e}/trace-summary${Y(
3147
+ { token: n }
3148
+ )}`,
3149
+ a
3150
+ );
3151
+ return i(t, "获取轨迹摘要失败");
3152
+ }
3153
+ async function Or(e) {
3154
+ const n = await r(
3155
+ `${c}/admin/evaluation/instances/${e.id}/snapshot-preview${Y({
3156
+ section: e.section,
3157
+ page: e.page,
3158
+ size: e.size,
3159
+ task_id: e.taskId,
3160
+ token: e.token
3161
+ })}`,
3162
+ a
3163
+ );
3164
+ return i(n, "获取快照预览失败");
3165
+ }
3166
+ const Xe = typeof window < "u" && window.ZTEAM_WEBIDE_ADMIN_BASE || "http://localhost/kapi/webide/admin";
3167
+ async function y(e, n) {
3168
+ try {
3169
+ const t = await fetch(`${Xe}${e}`, {
3170
+ credentials: "include",
3171
+ headers: {
3172
+ Accept: "application/json",
3173
+ "Content-Type": "application/json"
3174
+ },
3175
+ ...n
3176
+ });
3177
+ return t.ok ? t.json() : {};
3178
+ } catch {
3179
+ return {};
3180
+ }
3181
+ }
3182
+ function _r() {
3183
+ return y("/overview");
3184
+ }
3185
+ function Pr() {
3186
+ return y("/trends");
3187
+ }
3188
+ function Er() {
3189
+ return y("/users");
3190
+ }
3191
+ function kr() {
3192
+ return y("/instances/all");
3193
+ }
3194
+ function Nr() {
3195
+ return y("/machines");
3196
+ }
3197
+ function vr(e) {
3198
+ return y(`/instances/${e}/stop`, {
3199
+ method: "POST"
3200
+ });
3201
+ }
3202
+ function qr() {
3203
+ return y("/presets");
3204
+ }
3205
+ function jr(e) {
3206
+ return y("/presets", {
3207
+ method: "POST",
3208
+ body: JSON.stringify(e)
3209
+ });
3210
+ }
3211
+ function Dr(e, n) {
3212
+ return y(`/presets/${e}`, {
3213
+ method: "PUT",
3214
+ body: JSON.stringify(n)
3215
+ });
3216
+ }
3217
+ function Lr(e) {
3218
+ return y(`/presets/${e}`, { method: "DELETE" });
3219
+ }
3220
+ const Jr = le;
3221
+ async function Mr(e) {
3222
+ const n = new FormData();
3223
+ n.append("file", e);
3224
+ const t = await r(`${c}/common/upload-video`, {
3225
+ method: "POST",
3226
+ body: n
3227
+ }), s = await i(t, "上传视频失败"), o = typeof (s == null ? void 0 : s.url) == "string" ? s.url : "";
3228
+ if (!o) {
3229
+ const d = "上传视频失败:响应缺少视频地址";
3230
+ throw A(d), { _apiUserError: !0, userMessage: d, message: d };
3231
+ }
3232
+ return o;
3233
+ }
3234
+ function Br() {
3235
+ const e = "登录已失效,请重新登录";
3236
+ throw A(e), { _apiUserError: !0, userMessage: e, message: e };
3237
+ }
3238
+ async function Fr(e) {
3239
+ const n = await r(
3240
+ `${c}/scenario-instances/${e}/interaction-mode`,
3241
+ { ...a }
3242
+ ), t = await i(
3243
+ n,
3244
+ "查询交互模式失败"
3245
+ );
3246
+ return (t == null ? void 0 : t.mode) ?? "dispatch";
3247
+ }
3248
+ async function xr(e, n) {
3249
+ const t = await r(
3250
+ `${c}/scenario-instances/${e}/interaction-mode`,
3251
+ {
3252
+ ...a,
3253
+ method: "PUT",
3254
+ headers: { "Content-Type": "application/json" },
3255
+ body: JSON.stringify({ mode: n })
3256
+ }
3257
+ ), s = await i(
3258
+ t,
3259
+ "切换交互模式失败"
3260
+ );
3261
+ return (s == null ? void 0 : s.mode) ?? n;
3262
+ }
3263
+ async function zr(e = "") {
3264
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
3265
+ `${c}/admin/indexer/overview${n}`,
3266
+ a
3267
+ );
3268
+ return i(t, "获取索引概览失败");
3269
+ }
3270
+ async function Wr(e = "") {
3271
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/indexer/repos${n}`, a), s = await i(
3272
+ t,
3273
+ "获取索引仓库列表失败"
3274
+ );
3275
+ return Array.isArray(s == null ? void 0 : s.repos) ? s.repos : [];
3276
+ }
3277
+ async function Gr(e, n = "") {
3278
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/indexer/repos${t}`, {
3279
+ ...a,
3280
+ method: "POST",
3281
+ headers: { "Content-Type": "application/json" },
3282
+ body: JSON.stringify(e)
3283
+ });
3284
+ return i(s, "保存索引仓库失败");
3285
+ }
3286
+ async function Hr(e, n = "") {
3287
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
3288
+ `${c}/admin/indexer/repos/${encodeURIComponent(e)}${t}`,
3289
+ { ...a, method: "DELETE" }
3290
+ );
3291
+ return i(s, "删除索引仓库失败");
3292
+ }
3293
+ async function Vr(e, n, t = "") {
3294
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(
3295
+ `${c}/admin/indexer/repos/${encodeURIComponent(
3296
+ e
3297
+ )}/enabled${s}`,
3298
+ {
3299
+ ...a,
3300
+ method: "PUT",
3301
+ headers: { "Content-Type": "application/json" },
3302
+ body: JSON.stringify({ enabled: n })
3303
+ }
3304
+ );
3305
+ return i(o, "切换仓库启停失败");
3306
+ }
3307
+ async function Qr(e, n = "") {
3308
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
3309
+ `${c}/admin/indexer/repos/${encodeURIComponent(
3310
+ e
3311
+ )}/rebuild${t}`,
3312
+ { ...a, method: "POST" }
3313
+ );
3314
+ return i(s, "触发重建失败");
3315
+ }
3316
+ async function Kr(e = "") {
3317
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/indexer/poll${n}`, {
3318
+ ...a,
3319
+ method: "POST"
3320
+ });
3321
+ return i(t, "触发轮询失败");
3322
+ }
3323
+ async function Zr(e = "") {
3324
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(
3325
+ `${c}/admin/notify-channel/list${n}`,
3326
+ a
3327
+ ), s = await i(
3328
+ t,
3329
+ "获取消息渠道状态失败"
3330
+ );
3331
+ return Array.isArray(s == null ? void 0 : s.channels) ? s.channels : [];
3332
+ }
3333
+ async function Xr(e, n = "") {
3334
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/notify-channel/test${t}`, {
3335
+ ...a,
3336
+ method: "POST",
3337
+ headers: { "Content-Type": "application/json" },
3338
+ body: JSON.stringify(e)
3339
+ });
3340
+ return i(s, "测试发送失败");
3341
+ }
3342
+ async function Yr(e, n = "") {
3343
+ const t = await r(
3344
+ `${c}/admin/schedule-task${l({
3345
+ token: n,
3346
+ task_type: e.taskType,
3347
+ page: e.page,
3348
+ size: e.size
3349
+ })}`,
3350
+ a
3351
+ );
3352
+ return i(t, "查询定时任务模版失败");
3353
+ }
3354
+ async function ei(e, n = "") {
3355
+ const t = await r(
3356
+ `${c}/admin/schedule-task${l({ token: n })}`,
3357
+ {
3358
+ ...a,
3359
+ method: "POST",
3360
+ headers: { "Content-Type": "application/json" },
3361
+ body: JSON.stringify(e)
3362
+ }
3363
+ );
3364
+ return i(t, "新建定时任务模版失败");
3365
+ }
3366
+ async function ni(e, n, t = "") {
3367
+ const s = await r(
3368
+ `${c}/admin/schedule-task/${encodeURIComponent(
3369
+ e
3370
+ )}${l({ token: t })}`,
3371
+ {
3372
+ ...a,
3373
+ method: "PUT",
3374
+ headers: { "Content-Type": "application/json" },
3375
+ body: JSON.stringify(n)
3376
+ }
3377
+ );
3378
+ return i(s, "更新定时任务模版失败");
3379
+ }
3380
+ async function ti(e, n, t = "") {
3381
+ const s = await r(
3382
+ `${c}/admin/schedule-task/${encodeURIComponent(
3383
+ e
3384
+ )}/toggle${l({ token: t })}`,
3385
+ {
3386
+ ...a,
3387
+ method: "POST",
3388
+ headers: { "Content-Type": "application/json" },
3389
+ body: JSON.stringify({ enabled: n })
3390
+ }
3391
+ );
3392
+ return i(s, "切换模版状态失败");
3393
+ }
3394
+ async function si(e, n = "") {
3395
+ const t = await r(
3396
+ `${c}/admin/schedule-task/${encodeURIComponent(
3397
+ e
3398
+ )}/activate${l({ token: n })}`,
3399
+ { ...a, method: "POST" }
3400
+ );
3401
+ return i(t, "激活模版失败");
3402
+ }
3403
+ async function oi(e, n = "") {
3404
+ const t = await r(
3405
+ `${c}/admin/schedule-task/${encodeURIComponent(
3406
+ e
3407
+ )}${l({ token: n })}`,
3408
+ { ...a, method: "DELETE" }
3409
+ );
3410
+ return i(t, "删除模版失败");
3411
+ }
3412
+ async function ai(e, n = "") {
3413
+ const t = await r(
3414
+ `${c}/admin/schedule-task/${encodeURIComponent(
3415
+ e
3416
+ )}/run${l({ token: n })}`,
3417
+ { ...a, method: "POST" }
3418
+ );
3419
+ return i(t, "手动执行失败");
3420
+ }
3421
+ async function ri(e, n = "") {
3422
+ const t = await r(
3423
+ `${c}/admin/schedule-task/history-all${l({
3424
+ token: n,
3425
+ task_type: e.taskType,
3426
+ page: e.page,
3427
+ size: e.size
3428
+ })}`,
3429
+ a
3430
+ );
3431
+ return i(t, "查询运行记录失败");
3432
+ }
3433
+ async function ii(e, n = "") {
3434
+ const t = new URLSearchParams();
3435
+ n && t.set("token", n);
3436
+ const s = t.toString() ? `?${t.toString()}` : "", o = await r(
3437
+ `${c}/admin/agents/ctc-members${s}`,
3438
+ a
3439
+ );
3440
+ return i(o, "获取 Apex 成员列表失败") ?? [];
3441
+ }
3442
+ async function ci(e, n, t, s, o = "") {
3443
+ const d = o ? `?token=${encodeURIComponent(o)}` : "", u = await r(
3444
+ `${c}/admin/permissions/users/${e}/roles${d}`,
3445
+ {
3446
+ ...a,
3447
+ method: "PUT",
3448
+ headers: { "Content-Type": "application/json" },
3449
+ body: JSON.stringify({ staffName: n, accountNo: t, roleIds: s })
3450
+ }
3451
+ );
3452
+ return i(u, "更新用户角色失败");
3453
+ }
3454
+ async function di(e, n = "") {
3455
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
3456
+ `${c}/admin/permissions/users/${e}/detail${t}`,
3457
+ a
3458
+ );
3459
+ return i(s, "获取用户授权详情失败");
3460
+ }
3461
+ async function ui(e = "") {
3462
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", t = await r(`${c}/admin/roles${n}`, a);
3463
+ return i(t, "获取角色列表失败") ?? [];
3464
+ }
3465
+ async function li(e, n = "") {
3466
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(
3467
+ `${c}/admin/roles/${e}${t}`,
3468
+ a
3469
+ );
3470
+ return i(s, "获取角色详情失败");
3471
+ }
3472
+ async function mi(e, n = "") {
3473
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/roles${t}`, {
3474
+ ...a,
3475
+ method: "POST",
3476
+ headers: { "Content-Type": "application/json" },
3477
+ body: JSON.stringify(e)
3478
+ });
3479
+ return i(s, "创建角色失败");
3480
+ }
3481
+ async function pi(e, n, t = "") {
3482
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/roles/${e}${s}`, {
3483
+ ...a,
3484
+ method: "PUT",
3485
+ headers: { "Content-Type": "application/json" },
3486
+ body: JSON.stringify(n)
3487
+ });
3488
+ return i(o, "更新角色失败");
3489
+ }
3490
+ async function fi(e, n = "") {
3491
+ const t = n ? `?token=${encodeURIComponent(n)}` : "", s = await r(`${c}/admin/roles/${e}${t}`, {
3492
+ ...a,
3493
+ method: "DELETE"
3494
+ });
3495
+ return i(s, "删除角色失败");
3496
+ }
3497
+ async function $i(e, n, t = "") {
3498
+ const s = t ? `?token=${encodeURIComponent(t)}` : "", o = await r(`${c}/admin/roles/${e}/users${s}`, {
3499
+ ...a,
3500
+ method: "PUT",
3501
+ headers: { "Content-Type": "application/json" },
3502
+ body: JSON.stringify({ users: n })
3503
+ });
3504
+ return i(o, "更新角色成员失败");
3505
+ }
3506
+ export {
3507
+ kn as $,
3508
+ Vn as A,
3509
+ Pt as B,
3510
+ _t as C,
3511
+ dt as D,
3512
+ Ot as E,
3513
+ Zn as F,
3514
+ Qn as G,
3515
+ Kn as H,
3516
+ Hn as I,
3517
+ cn as J,
3518
+ Gn as K,
3519
+ wt as L,
3520
+ it as M,
3521
+ rt as N,
3522
+ at as O,
3523
+ ot as P,
3524
+ wn as Q,
3525
+ st as R,
3526
+ tt as S,
3527
+ le as T,
3528
+ nt as U,
3529
+ et as V,
3530
+ Xn as W,
3531
+ jn as X,
3532
+ qn as Y,
3533
+ vn as Z,
3534
+ Nn as _,
3535
+ He as a,
3536
+ Ka as a$,
3537
+ En as a0,
3538
+ Jn as a1,
3539
+ Dn as a2,
3540
+ On as a3,
3541
+ Rn as a4,
3542
+ _n as a5,
3543
+ Pn as a6,
3544
+ An as a7,
3545
+ pt as a8,
3546
+ mt as a9,
3547
+ Uo as aA,
3548
+ Fr as aB,
3549
+ xr as aC,
3550
+ gn as aD,
3551
+ Mn as aE,
3552
+ Bn as aF,
3553
+ Fn as aG,
3554
+ Sn as aH,
3555
+ Ln as aI,
3556
+ Qo as aJ,
3557
+ r as aK,
3558
+ i as aL,
3559
+ ct as aM,
3560
+ Ke as aN,
3561
+ Jr as aO,
3562
+ Br as aP,
3563
+ Vo as aQ,
3564
+ Yo as aR,
3565
+ ea as aS,
3566
+ na as aT,
3567
+ Ko as aU,
3568
+ Zo as aV,
3569
+ Xo as aW,
3570
+ ft as aX,
3571
+ $t as aY,
3572
+ yt as aZ,
3573
+ ht as a_,
3574
+ ut as aa,
3575
+ fn as ab,
3576
+ w as ac,
3577
+ un as ad,
3578
+ an as ae,
3579
+ Ee as af,
3580
+ Ue as ag,
3581
+ sn as ah,
3582
+ ka as ai,
3583
+ Oa as aj,
3584
+ Na as ak,
3585
+ Fe as al,
3586
+ Yn as am,
3587
+ Wn as an,
3588
+ ha as ao,
3589
+ Sa as ap,
3590
+ ga as aq,
3591
+ Rt as ar,
3592
+ bt as as,
3593
+ At as at,
3594
+ Ct as au,
3595
+ It as av,
3596
+ Ut as aw,
3597
+ c as ax,
3598
+ Co as ay,
3599
+ Io as az,
3600
+ bn as b,
3601
+ or as b$,
3602
+ lt as b0,
3603
+ Ve as b1,
3604
+ Qa as b2,
3605
+ rn as b3,
3606
+ Mr as b4,
3607
+ S as b5,
3608
+ Bs as b6,
3609
+ Za as b7,
3610
+ yn as b8,
3611
+ Xs as b9,
3612
+ Vs as bA,
3613
+ Zs as bB,
3614
+ Js as bC,
3615
+ zs as bD,
3616
+ so as bE,
3617
+ to as bF,
3618
+ Ms as bG,
3619
+ oo as bH,
3620
+ ao as bI,
3621
+ Fs as bJ,
3622
+ xs as bK,
3623
+ Ws as bL,
3624
+ tr as bM,
3625
+ ar as bN,
3626
+ rr as bO,
3627
+ Ra as bP,
3628
+ yr as bQ,
3629
+ gr as bR,
3630
+ hr as bS,
3631
+ ba as bT,
3632
+ cr as bU,
3633
+ ir as bV,
3634
+ mr as bW,
3635
+ sr as bX,
3636
+ Ya as bY,
3637
+ er as bZ,
3638
+ nr as b_,
3639
+ Ys as ba,
3640
+ eo as bb,
3641
+ no as bc,
3642
+ lo as bd,
3643
+ So as be,
3644
+ Ks as bf,
3645
+ go as bg,
3646
+ yo as bh,
3647
+ mo as bi,
3648
+ po as bj,
3649
+ fo as bk,
3650
+ $o as bl,
3651
+ ho as bm,
3652
+ wo as bn,
3653
+ To as bo,
3654
+ co as bp,
3655
+ Mt as bq,
3656
+ Yt as br,
3657
+ Qt as bs,
3658
+ ro as bt,
3659
+ uo as bu,
3660
+ io as bv,
3661
+ Gs as bw,
3662
+ xn as bx,
3663
+ Hs as by,
3664
+ Qs as bz,
3665
+ xe as c,
3666
+ ko as c$,
3667
+ Xa as c0,
3668
+ ur as c1,
3669
+ dr as c2,
3670
+ lr as c3,
3671
+ va as c4,
3672
+ wa as c5,
3673
+ qa as c6,
3674
+ ja as c7,
3675
+ $n as c8,
3676
+ Ht as c9,
3677
+ zt as cA,
3678
+ Wt as cB,
3679
+ xt as cC,
3680
+ ws as cD,
3681
+ Ts as cE,
3682
+ Us as cF,
3683
+ _s as cG,
3684
+ Ps as cH,
3685
+ bs as cI,
3686
+ Cs as cJ,
3687
+ Is as cK,
3688
+ As as cL,
3689
+ Os as cM,
3690
+ Rs as cN,
3691
+ Es as cO,
3692
+ ks as cP,
3693
+ se as cQ,
3694
+ be as cR,
3695
+ Ns as cS,
3696
+ vs as cT,
3697
+ bo as cU,
3698
+ Oo as cV,
3699
+ _o as cW,
3700
+ Ao as cX,
3701
+ Ro as cY,
3702
+ Eo as cZ,
3703
+ Po as c_,
3704
+ ps as ca,
3705
+ pn as cb,
3706
+ on as cc,
3707
+ Aa as cd,
3708
+ _a as ce,
3709
+ Ea as cf,
3710
+ Pa as cg,
3711
+ es as ch,
3712
+ ns as ci,
3713
+ ts as cj,
3714
+ ss as ck,
3715
+ os as cl,
3716
+ jt as cm,
3717
+ as as cn,
3718
+ Dt as co,
3719
+ qt as cp,
3720
+ Kt as cq,
3721
+ pr as cr,
3722
+ fr as cs,
3723
+ $r as ct,
3724
+ Xt as cu,
3725
+ Vt as cv,
3726
+ Zt as cw,
3727
+ Gt as cx,
3728
+ Bt as cy,
3729
+ Ft as cz,
3730
+ In as d,
3731
+ ua as d$,
3732
+ Ta as d0,
3733
+ Ia as d1,
3734
+ Ca as d2,
3735
+ Ua as d3,
3736
+ Et as d4,
3737
+ Ar as d5,
3738
+ Rr as d6,
3739
+ Or as d7,
3740
+ fs as d8,
3741
+ ys as d9,
3742
+ di as dA,
3743
+ Ho as dB,
3744
+ ci as dC,
3745
+ aa as dD,
3746
+ oa as dE,
3747
+ ia as dF,
3748
+ ta as dG,
3749
+ sa as dH,
3750
+ ra as dI,
3751
+ Ja as dJ,
3752
+ Da as dK,
3753
+ Sr as dL,
3754
+ ls as dM,
3755
+ ms as dN,
3756
+ Nt as dO,
3757
+ kt as dP,
3758
+ vt as dQ,
3759
+ qs as dR,
3760
+ js as dS,
3761
+ Ls as dT,
3762
+ Ds as dU,
3763
+ ca as dV,
3764
+ la as dW,
3765
+ ma as dX,
3766
+ pa as dY,
3767
+ da as dZ,
3768
+ ya as d_,
3769
+ $s as da,
3770
+ Wr as db,
3771
+ zr as dc,
3772
+ Qr as dd,
3773
+ Vr as de,
3774
+ Hr as df,
3775
+ Kr as dg,
3776
+ Gr as dh,
3777
+ Cr as di,
3778
+ wr as dj,
3779
+ Tr as dk,
3780
+ Zr as dl,
3781
+ Xr as dm,
3782
+ hs as dn,
3783
+ gs as dp,
3784
+ Ss as dq,
3785
+ Go as dr,
3786
+ ui as ds,
3787
+ ii as dt,
3788
+ Wo as du,
3789
+ li as dv,
3790
+ mi as dw,
3791
+ pi as dx,
3792
+ fi as dy,
3793
+ $i as dz,
3794
+ hn as e,
3795
+ fa as e0,
3796
+ $a as e1,
3797
+ La as e2,
3798
+ ri as e3,
3799
+ Yr as e4,
3800
+ ni as e5,
3801
+ ei as e6,
3802
+ ti as e7,
3803
+ si as e8,
3804
+ ai as e9,
3805
+ za as eA,
3806
+ Ha as eB,
3807
+ Ga as eC,
3808
+ Va as eD,
3809
+ _r as eE,
3810
+ Er as eF,
3811
+ kr as eG,
3812
+ Nr as eH,
3813
+ Pr as eI,
3814
+ qr as eJ,
3815
+ vr as eK,
3816
+ Dr as eL,
3817
+ jr as eM,
3818
+ Lr as eN,
3819
+ oi as ea,
3820
+ Lt as eb,
3821
+ Jt as ec,
3822
+ cs as ed,
3823
+ us as ee,
3824
+ is as ef,
3825
+ rs as eg,
3826
+ ds as eh,
3827
+ No as ei,
3828
+ Do as ej,
3829
+ vo as ek,
3830
+ jo as el,
3831
+ qo as em,
3832
+ Jo as en,
3833
+ Lo as eo,
3834
+ Ir as ep,
3835
+ Ma as eq,
3836
+ Ur as er,
3837
+ br as es,
3838
+ Ba as et,
3839
+ Wa as eu,
3840
+ Bo as ev,
3841
+ Fo as ew,
3842
+ Mo as ex,
3843
+ xa as ey,
3844
+ Fa as ez,
3845
+ Tn as f,
3846
+ ln as g,
3847
+ V as h,
3848
+ ie as i,
3849
+ Qe as j,
3850
+ xo as k,
3851
+ mn as l,
3852
+ zo as m,
3853
+ nn as n,
3854
+ gt as o,
3855
+ Cn as p,
3856
+ Ze as q,
3857
+ St as r,
3858
+ zn as s,
3859
+ f as t,
3860
+ Un as u,
3861
+ Tt as v,
3862
+ dn as w,
3863
+ tn as x,
3864
+ ge as y,
3865
+ en as z
3866
+ };