@yuku123/z-team-component 0.2.58 → 0.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{ChangeLogView-Cstbioyw.js → ChangeLogView-VRWVzP0r.js} +1 -1
  2. package/dist/{ComponentDoc-MWEULbua.js → ComponentDoc-DjfucAFW.js} +1497 -1387
  3. package/dist/{InvitationManagementPage-DHomiF0D.js → InvitationManagementPage-BQ_4HcPk.js} +1 -1
  4. package/dist/{OnboardingPage-D4ccf9Rj.js → OnboardingPage-DM8emo6P.js} +2 -2
  5. package/dist/{ScheduledTasks-xjtP-eIJ.js → ScheduledTasks-BYxdbsSa.js} +8 -8
  6. package/dist/SystemShell-BEdMWZ8d.js +670 -0
  7. package/dist/{admin-logs-B9KS6VJz.js → admin-logs-DCYof_u5.js} +2 -2
  8. package/dist/{api-BAOITIl4.js → api-Bz4pq8m7.js} +1 -1
  9. package/dist/{api-CALqShkO.js → api-DWt94BcM.js} +584 -572
  10. package/dist/{createWorkspaceWsHandler-DP30xvug.js → createWorkspaceWsHandler-3aHkBZE9.js} +4 -4
  11. package/dist/{index-4YxdJwFm.js → index-4LNRkvy6.js} +3 -3
  12. package/dist/{index-CDFDjyHa.js → index-BHUK6MwQ.js} +1794 -1784
  13. package/dist/{index-C2Wkg1b5.js → index-BIdcTXZW.js} +3 -3
  14. package/dist/index-BVEvns4M.js +2858 -0
  15. package/dist/{index-m8V5TniT.js → index-BVh0W8ck.js} +15861 -15586
  16. package/dist/{index-C4-Sn2rx.js → index-C0rbeCoZ.js} +12 -12
  17. package/dist/{index-8gCovDDT.js → index-C6jp_1-U.js} +6 -6
  18. package/dist/index-CQSTQAPg.js +112 -0
  19. package/dist/{index-lftFkqfI.js → index-CTKf6h2u.js} +4 -4
  20. package/dist/{index-Ot_5dG_I.js → index-Cf7WJqfM.js} +20 -16
  21. package/dist/{index-Bw0a0nRQ.js → index-Cip94Q-G.js} +3 -3
  22. package/dist/{index-DKeYG0Fu.js → index-CrIIInfs.js} +4 -4
  23. package/dist/{index-UjMCPXHz.js → index-DbEvwIck.js} +3 -3
  24. package/dist/{index-CLWgeKwr.js → index-DtVBFjaJ.js} +2 -2
  25. package/dist/{index-CGWttFLb.js → index-Dvhocfyo.js} +4 -4
  26. package/dist/index-DyE5noq6.js +118 -0
  27. package/dist/{index-DHXxiZa9.js → index-KqKj9E7y.js} +3 -3
  28. package/dist/{index-aw72ID7y.js → index-NPxrK-81.js} +1 -1
  29. package/dist/{index-CinRd7Nz.js → index-VY-pgcyl.js} +1 -1
  30. package/dist/{index-DJOyOVn_.js → index-VxO9i5r6.js} +1 -1
  31. package/dist/{index-DniCNHNJ.js → index-_gGu4e-w.js} +1 -1
  32. package/dist/{index-C3B7CbHo.js → index-bsGAZKaU.js} +624 -613
  33. package/dist/{index-Dtm6ORr2.js → index-eGX5rkV8.js} +5 -5
  34. package/dist/{index-DET70T3j.js → index-i6Ejgpao.js} +1 -1
  35. package/dist/index-ncjLe3A0.js +93 -0
  36. package/dist/index.js +1 -1
  37. package/dist/{instance-f3C-1qYl.js → instance-CbkHlDr4.js} +1 -1
  38. package/dist/menuPermission-BWqugXIc.js +60 -0
  39. package/dist/pages.js +1 -1
  40. package/dist/schedule-BRvmKoDG.js +587 -0
  41. package/dist/{send-default-agent-team-message-d_ECdczr.js → send-default-agent-team-message-8wnVWO7H.js} +1 -1
  42. package/dist/{sso-user-HcsSzg8P.js → sso-user-QZNVhjpR.js} +1 -1
  43. package/dist/{training-DnNQN0An.js → training-DYo1pvX7.js} +1 -1
  44. package/dist/{useAppStore-kRZEA5WZ.js → useAppStore-BGOxWep2.js} +6 -2
  45. package/dist/{webide-BcRzJX-h.js → webide-CWTbQs4I.js} +4 -4
  46. package/dist/z-team-component.css +2 -2
  47. package/package.json +1 -1
  48. package/dist/SystemShell-XnTCunV0.js +0 -907
  49. package/dist/index-BPOiMJa1.js +0 -2841
  50. package/dist/index-C0EIMJI2.js +0 -112
  51. package/dist/index-DRrBkbr_.js +0 -100
  52. package/dist/schedule-DfkgwPdE.js +0 -497
@@ -1,11 +1,11 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { CopyOutlined as se, ReloadOutlined as Ne, PlusOutlined as xe, DeleteOutlined as $e, ClearOutlined as Le, CloseOutlined as Oe, SendOutlined as Ue, RobotOutlined as ve, CloudServerOutlined as Re, MessageOutlined as De, KeyOutlined as He, ApiOutlined as Fe, ToolOutlined as je, BarChartOutlined as qe } from "@ant-design/icons";
3
- import { Tooltip as Q, Tabs as Te, Button as R, Modal as de, Input as Se, Drawer as we, Spin as Y, Statistic as E, Table as Ae, message as G, Tag as J, Select as Ge, Checkbox as Je } from "antd";
4
- import { useState as x, useEffect as X, useCallback as j, useRef as me, useMemo as Be, Suspense as We, lazy as Qe } from "react";
5
- import { u as ze } from "./useAppStore-kRZEA5WZ.js";
6
- import { AgentAppList as Ve, McpPage as Ye, SkillMarket as Xe } from "@yuku123/z-agent-component";
7
- const re = "ft_gateway_default_ak", Me = "system-default", Z = "", he = "";
8
- function ee(a = {}) {
2
+ import { CopyOutlined as oe, ReloadOutlined as ve, PlusOutlined as Te, DeleteOutlined as Oe, ClearOutlined as Ue, CloseOutlined as Re, SendOutlined as De, RobotOutlined as Se, CloudServerOutlined as He, MessageOutlined as Fe, KeyOutlined as je, ApiOutlined as qe, ToolOutlined as Ge, BarChartOutlined as Je } from "@ant-design/icons";
3
+ import { Tooltip as Y, Tabs as we, Input as pe, Button as D, Modal as ue, Drawer as Ae, Spin as X, Statistic as K, Table as Be, message as J, Tag as W, Select as We, Checkbox as Qe } from "antd";
4
+ import { useState as N, useEffect as Z, useCallback as j, useRef as he, useMemo as ze, Suspense as Ve, lazy as Ye } from "react";
5
+ import { u as Me } from "./useAppStore-BGOxWep2.js";
6
+ import { AgentAppList as Xe, McpPage as Ze, SkillMarket as et } from "@yuku123/z-agent-component";
7
+ const le = "ft_gateway_default_ak", Ie = "system-default", ee = "", ke = "";
8
+ function te(a = {}) {
9
9
  const n = { Accept: "application/json", ...a };
10
10
  try {
11
11
  const r = localStorage.getItem("token");
@@ -14,7 +14,7 @@ function ee(a = {}) {
14
14
  }
15
15
  return n;
16
16
  }
17
- function Ze(a) {
17
+ function tt(a) {
18
18
  return {
19
19
  modelName: String(a.modelName ?? a.model_name ?? a.service ?? ""),
20
20
  service: String(a.service ?? a.modelName ?? ""),
@@ -23,12 +23,12 @@ function Ze(a) {
23
23
  apiType: String(a.apiType ?? a.api_type ?? "OpenAPI")
24
24
  };
25
25
  }
26
- async function pe() {
26
+ async function fe() {
27
27
  let a;
28
28
  try {
29
- a = await fetch(`${Z}/api/scenario-instances/0/models`, {
29
+ a = await fetch(`${ee}/api/scenario-instances/0/models`, {
30
30
  credentials: "include",
31
- headers: ee({
31
+ headers: te({
32
32
  Accept: "application/json",
33
33
  "project-env": window.ENV_TYPE ?? "local"
34
34
  })
@@ -47,11 +47,11 @@ async function pe() {
47
47
  const r = n != null && n.success ? n.data : (n == null ? void 0 : n.data) ?? n;
48
48
  if (!Array.isArray(r))
49
49
  throw new Error("模型列表返回格式异常(非数组)");
50
- return r.map(Ze);
50
+ return r.map(tt);
51
51
  }
52
- async function et(a, n, r, i) {
53
- var B, L, w;
54
- const m = await fetch(`${he}/v1/chat/completions`, {
52
+ async function at(a, n, r, i) {
53
+ var z, O, w;
54
+ const u = await fetch(`${ke}/v1/chat/completions`, {
55
55
  method: "POST",
56
56
  headers: {
57
57
  "Content-Type": "application/json",
@@ -65,35 +65,35 @@ async function et(a, n, r, i) {
65
65
  }),
66
66
  signal: i.signal
67
67
  });
68
- if (!m.ok || !m.body) {
69
- const N = await m.text().catch(() => "");
70
- if (/<!doctype html/i.test(N.slice(0, 200)))
68
+ if (!u.ok || !u.body) {
69
+ const C = await u.text().catch(() => "");
70
+ if (/<!doctype html/i.test(C.slice(0, 200)))
71
71
  throw new Error("模型网关未接入(/v1/chat/completions 落到主壳 SPA,无网关响应)");
72
- let T = `HTTP ${m.status}`;
72
+ let v = `HTTP ${u.status}`;
73
73
  try {
74
- const h = JSON.parse(N);
75
- T = ((B = h == null ? void 0 : h.error) == null ? void 0 : B.message) ?? T;
74
+ const g = JSON.parse(C);
75
+ v = ((z = g == null ? void 0 : g.error) == null ? void 0 : z.message) ?? v;
76
76
  } catch {
77
- N && (T = N);
77
+ C && (v = C);
78
78
  }
79
- throw new Error(T);
79
+ throw new Error(v);
80
80
  }
81
- const y = m.body.getReader(), C = new TextDecoder();
82
- let f = "", p;
81
+ const f = u.body.getReader(), y = new TextDecoder();
82
+ let _ = "", p;
83
83
  try {
84
84
  for (; ; ) {
85
- const { done: N, value: T } = await y.read();
86
- if (N) break;
87
- f += C.decode(T, { stream: !0 });
88
- const h = f.split(`
85
+ const { done: C, value: v } = await f.read();
86
+ if (C) break;
87
+ _ += y.decode(v, { stream: !0 });
88
+ const g = _.split(`
89
89
 
90
90
  `);
91
- f = h.pop() ?? "";
92
- for (const c of h) {
91
+ _ = g.pop() ?? "";
92
+ for (const c of g) {
93
93
  let k = "";
94
- for (const d of c.split(`
94
+ for (const m of c.split(`
95
95
  `))
96
- d.startsWith("data:") && (k += d.slice(5).trim());
96
+ m.startsWith("data:") && (k += m.slice(5).trim());
97
97
  if (!k || k === "[DONE]") {
98
98
  if (k === "[DONE]") {
99
99
  i.onDone(p);
@@ -102,18 +102,18 @@ async function et(a, n, r, i) {
102
102
  continue;
103
103
  }
104
104
  try {
105
- const d = JSON.parse(k), A = d == null ? void 0 : d.choices;
106
- if (d != null && d.usage) {
107
- const M = {
108
- promptTokens: d.usage.prompt_tokens ?? 0,
109
- completionTokens: d.usage.completion_tokens ?? 0,
110
- totalTokens: d.usage.total_tokens ?? 0
105
+ const m = JSON.parse(k), A = m == null ? void 0 : m.choices;
106
+ if (m != null && m.usage) {
107
+ const I = {
108
+ promptTokens: m.usage.prompt_tokens ?? 0,
109
+ completionTokens: m.usage.completion_tokens ?? 0,
110
+ totalTokens: m.usage.total_tokens ?? 0
111
111
  };
112
- (!p || M.totalTokens > 0) && (p = M);
112
+ (!p || I.totalTokens > 0) && (p = I);
113
113
  }
114
114
  if (Array.isArray(A) && A.length > 0) {
115
- const M = (L = A[0]) == null ? void 0 : L.delta;
116
- M != null && M.content && i.onDelta(M.content);
115
+ const I = (O = A[0]) == null ? void 0 : O.delta;
116
+ I != null && I.content && i.onDelta(I.content);
117
117
  continue;
118
118
  }
119
119
  i.onDone(p);
@@ -123,12 +123,12 @@ async function et(a, n, r, i) {
123
123
  }
124
124
  }
125
125
  i.onDone(p);
126
- } catch (N) {
126
+ } catch (C) {
127
127
  if ((w = i.signal) != null && w.aborted) return;
128
- throw i.onError(N instanceof Error ? N : new Error(String(N))), N;
128
+ throw i.onError(C instanceof Error ? C : new Error(String(C))), C;
129
129
  }
130
130
  }
131
- async function ae(a, n) {
131
+ async function ne(a, n) {
132
132
  const r = await a.text();
133
133
  if (!a.ok)
134
134
  throw new Error(`${n}失败 HTTP ${a.status}${r ? `: ${r.slice(0, 120)}` : ""}`);
@@ -140,7 +140,7 @@ async function ae(a, n) {
140
140
  throw new Error(`${n}返回非 JSON:${r.slice(0, 120)}`);
141
141
  }
142
142
  }
143
- function tt(a) {
143
+ function nt(a) {
144
144
  const n = a.status === 1;
145
145
  return {
146
146
  id: Number(a.id),
@@ -162,10 +162,10 @@ function tt(a) {
162
162
  secret: a.secret_key
163
163
  };
164
164
  }
165
- async function Ie(a, n, r) {
166
- const i = await fetch(`${Z}/api/ak/create`, {
165
+ async function be(a, n, r) {
166
+ const i = await fetch(`${ee}/api/ak/create`, {
167
167
  method: "POST",
168
- headers: ee({ Accept: "application/json", "Content-Type": "application/json" }),
168
+ headers: te({ Accept: "application/json", "Content-Type": "application/json" }),
169
169
  credentials: "include",
170
170
  body: JSON.stringify({
171
171
  akName: r || `AK-${n || a}`,
@@ -174,113 +174,113 @@ async function Ie(a, n, r) {
174
174
  ownerUserId: a,
175
175
  ownerUserName: n
176
176
  })
177
- }), m = await ae(i, "创建 AK"), y = (m == null ? void 0 : m.data) ?? {}, C = y.accessKey ?? "", f = y.secretKey ?? "";
178
- return C && f && ke(C, f), { apiKey: f, akPrefix: C, message: "AK 已创建,secretKey 仅创建时可见" };
177
+ }), u = await ne(i, "创建 AK"), f = (u == null ? void 0 : u.data) ?? {}, y = f.accessKey ?? "", _ = f.secretKey ?? "";
178
+ return y && _ && ye(y, _), { apiKey: _, akPrefix: y, message: "AK 已创建,secretKey 仅创建时可见" };
179
179
  }
180
- async function le(a) {
180
+ async function ie(a) {
181
181
  const n = await fetch(
182
- `${Z}/api/ak/list`,
183
- { headers: ee({ Accept: "application/json" }), credentials: "include" }
184
- ), r = await ae(n, "获取 AK 列表"), i = Array.isArray(r == null ? void 0 : r.data) ? r.data : [];
185
- return (a ? i.filter((y) => (y.owner_user_id == null || y.owner_user_id === "" ? Me : String(y.owner_user_id)) === String(a)) : i).filter((y) => (y.is_deleted ?? 0) === 0).map(tt);
182
+ `${ee}/api/ak/list`,
183
+ { headers: te({ Accept: "application/json" }), credentials: "include" }
184
+ ), r = await ne(n, "获取 AK 列表"), i = Array.isArray(r == null ? void 0 : r.data) ? r.data : [];
185
+ return (a ? i.filter((f) => (f.owner_user_id == null || f.owner_user_id === "" ? Ie : String(f.owner_user_id)) === String(a)) : i).filter((f) => (f.is_deleted ?? 0) === 0).map(nt);
186
186
  }
187
- async function at(a) {
188
- const n = await fetch(`${Z}/api/ak/delete?id=${encodeURIComponent(String(a))}`, {
187
+ async function st(a) {
188
+ const n = await fetch(`${ee}/api/ak/delete?id=${encodeURIComponent(String(a))}`, {
189
189
  method: "POST",
190
- headers: ee({ Accept: "application/json" }),
190
+ headers: te({ Accept: "application/json" }),
191
191
  credentials: "include"
192
192
  });
193
- await ae(n, "吊销 AK");
193
+ await ne(n, "吊销 AK");
194
194
  }
195
- async function be(a) {
196
- var N, T;
195
+ async function Pe(a) {
196
+ var C, v;
197
197
  const n = await fetch(
198
- `${Z}/api/admin/llm-call-monitor/stats?hours=168`,
199
- { headers: ee({ Accept: "application/json" }), credentials: "include" }
200
- ), r = await ae(n, "获取调用统计"), m = ((r == null ? void 0 : r.data) ?? {}).summary ?? {};
201
- let y = [];
198
+ `${ee}/api/admin/llm-call-monitor/stats?hours=168`,
199
+ { headers: te({ Accept: "application/json" }), credentials: "include" }
200
+ ), r = await ne(n, "获取调用统计"), u = ((r == null ? void 0 : r.data) ?? {}).summary ?? {};
201
+ let f = [];
202
202
  try {
203
- const h = await fetch(
204
- `${Z}/api/admin/llm-call-monitor/recent?page=1&size=20`,
205
- { headers: ee({ Accept: "application/json" }), credentials: "include" }
206
- ), c = await ae(h, "获取调用明细");
207
- y = (Array.isArray((N = c == null ? void 0 : c.data) == null ? void 0 : N.records) ? c.data.records : []).map((d, A) => {
208
- const M = Number(d.promptTokens ?? 0), q = Number(d.completionTokens ?? 0);
203
+ const g = await fetch(
204
+ `${ee}/api/admin/llm-call-monitor/recent?page=1&size=20`,
205
+ { headers: te({ Accept: "application/json" }), credentials: "include" }
206
+ ), c = await ne(g, "获取调用明细");
207
+ f = (Array.isArray((C = c == null ? void 0 : c.data) == null ? void 0 : C.records) ? c.data.records : []).map((m, A) => {
208
+ const I = Number(m.promptTokens ?? 0), G = Number(m.completionTokens ?? 0);
209
209
  return {
210
- id: Number(d.id ?? A),
210
+ id: Number(m.id ?? A),
211
211
  apiKeyId: a,
212
212
  protocol: "chat/completions",
213
- model: String(d.model ?? ""),
214
- stream: Number(d.stream ?? 0),
215
- promptTokens: M,
216
- completionTokens: q,
217
- totalTokens: Number(d.totalTokens ?? M + q),
218
- latencyMs: Number(d.durationMs ?? 0),
219
- statusCode: d.success === !1 || d.success === 0 ? 500 : 200,
220
- errorMsg: d.errorType ?? null,
221
- createTime: String(d.createTime ?? "").replace("T", " ").slice(0, 19)
213
+ model: String(m.model ?? ""),
214
+ stream: Number(m.stream ?? 0),
215
+ promptTokens: I,
216
+ completionTokens: G,
217
+ totalTokens: Number(m.totalTokens ?? I + G),
218
+ latencyMs: Number(m.durationMs ?? 0),
219
+ statusCode: m.success === !1 || m.success === 0 ? 500 : 200,
220
+ errorMsg: m.errorType ?? null,
221
+ createTime: String(m.createTime ?? "").replace("T", " ").slice(0, 19)
222
222
  };
223
223
  });
224
224
  } catch {
225
225
  }
226
- const C = {}, f = {};
227
- for (const h of y) {
228
- const c = C[T = h.model] || (C[T] = [0, 0, 0]);
229
- c[0] += 1, c[1] += h.promptTokens, c[2] += h.completionTokens;
230
- const k = (h.createTime || "").slice(0, 10);
226
+ const y = {}, _ = {};
227
+ for (const g of f) {
228
+ const c = y[v = g.model] || (y[v] = [0, 0, 0]);
229
+ c[0] += 1, c[1] += g.promptTokens, c[2] += g.completionTokens;
230
+ const k = (g.createTime || "").slice(0, 10);
231
231
  if (k) {
232
- const d = f[k] || (f[k] = [0, 0, 0]);
233
- d[0] += 1, d[1] += h.promptTokens, d[2] += h.completionTokens;
232
+ const m = _[k] || (_[k] = [0, 0, 0]);
233
+ m[0] += 1, m[1] += g.promptTokens, m[2] += g.completionTokens;
234
234
  }
235
235
  }
236
- const p = Number(m.totalTokens ?? 0), B = y.reduce((h, c) => h + c.totalTokens, 0), L = y.reduce((h, c) => h + c.promptTokens, 0), w = y.reduce((h, c) => h + c.completionTokens, 0);
236
+ const p = Number(u.totalTokens ?? 0), z = f.reduce((g, c) => g + c.totalTokens, 0), O = f.reduce((g, c) => g + c.promptTokens, 0), w = f.reduce((g, c) => g + c.completionTokens, 0);
237
237
  return {
238
- totalRequests: Number(m.totalCount ?? 0),
238
+ totalRequests: Number(u.totalCount ?? 0),
239
239
  // 汇总口径优先用后端整窗合计(后端 selectStats 才有 token 合计),
240
240
  // 明细只有最近一页 ⇒ 只在汇总缺失时用明细兜底。
241
- totalPromptTokens: Number(m.totalPromptTokens ?? 0) || L,
242
- totalCompletionTokens: Number(m.totalCompletionTokens ?? 0) || w,
243
- totalTokens: p || B,
244
- avgLatencyMs: Number(m.avgDurationMs ?? 0),
245
- errorCount: Number(m.failCount ?? 0),
246
- daily: f,
247
- models: C,
248
- recent: y
241
+ totalPromptTokens: Number(u.totalPromptTokens ?? 0) || O,
242
+ totalCompletionTokens: Number(u.totalCompletionTokens ?? 0) || w,
243
+ totalTokens: p || z,
244
+ avgLatencyMs: Number(u.avgDurationMs ?? 0),
245
+ errorCount: Number(u.failCount ?? 0),
246
+ daily: _,
247
+ models: y,
248
+ recent: f
249
249
  };
250
250
  }
251
- function nt() {
252
- return typeof window < "u" ? `${window.location.origin}${he}` : he;
251
+ function ot() {
252
+ return typeof window < "u" ? `${window.location.origin}${ke}` : ke;
253
253
  }
254
- const ge = "ft_gateway_ak_cache";
255
- function ke(a, n) {
254
+ const _e = "ft_gateway_ak_cache";
255
+ function ye(a, n) {
256
256
  try {
257
- const r = JSON.parse(localStorage.getItem(ge) || "{}");
258
- r[a] = n, localStorage.setItem(ge, JSON.stringify(r));
257
+ const r = JSON.parse(localStorage.getItem(_e) || "{}");
258
+ r[a] = n, localStorage.setItem(_e, JSON.stringify(r));
259
259
  } catch {
260
260
  }
261
261
  }
262
- function st(a) {
262
+ function rt(a) {
263
263
  try {
264
- return JSON.parse(localStorage.getItem(ge) || "{}")[a] || null;
264
+ return JSON.parse(localStorage.getItem(_e) || "{}")[a] || null;
265
265
  } catch {
266
266
  return null;
267
267
  }
268
268
  }
269
- async function ot() {
269
+ async function lt() {
270
270
  try {
271
- const i = localStorage.getItem(re);
271
+ const i = localStorage.getItem(le);
272
272
  if (i) return i;
273
273
  } catch {
274
274
  }
275
- const n = (await le("").catch(() => [])).find((i) => i.active && i.secret);
275
+ const n = (await ie("").catch(() => [])).find((i) => i.active && i.secret);
276
276
  if (n != null && n.secret) {
277
277
  try {
278
- localStorage.setItem(re, n.secret);
278
+ localStorage.setItem(le, n.secret);
279
279
  } catch {
280
280
  }
281
- return n.akPrefix && ke(n.akPrefix, n.secret), n.secret;
281
+ return n.akPrefix && ye(n.akPrefix, n.secret), n.secret;
282
282
  }
283
- const r = await Ie(
283
+ const r = await be(
284
284
  "system-default",
285
285
  "系统默认",
286
286
  "智能工作台默认AK(自动创建)"
@@ -288,103 +288,103 @@ async function ot() {
288
288
  if (!r.apiKey)
289
289
  throw new Error("AK 创建成功但未返回 secretKey");
290
290
  try {
291
- localStorage.setItem(re, r.apiKey);
291
+ localStorage.setItem(le, r.apiKey);
292
292
  } catch {
293
293
  }
294
294
  return r.apiKey;
295
295
  }
296
- function Pe() {
296
+ function Ke() {
297
297
  try {
298
- localStorage.removeItem(re);
298
+ localStorage.removeItem(le);
299
299
  } catch {
300
300
  }
301
301
  }
302
- const rt = "_container_16zxg_7", lt = "_sidebar_16zxg_16", it = "_menuList_16zxg_26", ct = "_menuItem_16zxg_35", dt = "_menuItemActive_16zxg_53", mt = "_menuIcon_16zxg_59", ut = "_panelArea_16zxg_66", ht = "_modelMgmtHeader_16zxg_78", gt = "_modelMgmtTitle_16zxg_82", pt = "_modelMgmtSubtitle_16zxg_89", kt = "_modelGrid_16zxg_95", _t = "_modelCard_16zxg_101", ft = "_modelCardSelected_16zxg_130", yt = "_modelCardHeader_16zxg_135", Ct = "_modelIconWrap_16zxg_142", Nt = "_modelCardInfo_16zxg_155", xt = "_modelName_16zxg_160", vt = "_modelTags_16zxg_169", Tt = "_modelEndpoint_16zxg_185", St = "_modelCardFooter_16zxg_194", wt = "_modelCheckbox_16zxg_202", At = "_modelActionBar_16zxg_209", Bt = "_modelSelectionCount_16zxg_223", zt = "_chatContainer_16zxg_232", Mt = "_chatHeader_16zxg_239", It = "_chatTitle_16zxg_247", bt = "_chatPanels_16zxg_254", Pt = "_chatPanel_16zxg_254", Kt = "_chatPanelHeader_16zxg_281", Et = "_chatPanelClose_16zxg_291", $t = "_chatPanelBody_16zxg_303", Lt = "_chatMsgUser_16zxg_312", Ot = "_chatMsgAI_16zxg_324", Ut = "_chatMsgError_16zxg_337", Rt = "_chatStreamingCursor_16zxg_347", Dt = "_chatUsageBar_16zxg_366", Ht = "_chatThinkBlock_16zxg_376", Ft = "_chatInputBar_16zxg_425", jt = "_chatInput_16zxg_425", qt = "_addPanelBtn_16zxg_438", Gt = "_akContainer_16zxg_467", Jt = "_akIntegrationPanel_16zxg_473", Wt = "_akIntegrationTitle_16zxg_480", Qt = "_akIntegrationGrid_16zxg_487", Vt = "_akCodeBlock_16zxg_493", Yt = "_akCodeLabel_16zxg_505", Xt = "_akCard_16zxg_512", Zt = "_akCardRow_16zxg_530", ea = "_akTitle_16zxg_537", ta = "_akPrefixSmall_16zxg_547", aa = "_akStatus_16zxg_553", na = "_akStatusActive_16zxg_559", sa = "_akStatusRevoked_16zxg_565", oa = "_akCardActions_16zxg_571", ra = "_akCardRow2_16zxg_578", la = "_akMiniBar_16zxg_584", ia = "_akMiniBarFill_16zxg_593", ca = "_akUsageText_16zxg_600", da = "_akMetaText_16zxg_607", ma = "_akEmpty_16zxg_613", ua = "_akBaseUrlRow_16zxg_621", ha = "_akBaseUrlItem_16zxg_627", ga = "_akBaseUrlLabel_16zxg_637", pa = "_akBaseUrlValue_16zxg_643", ka = "_akCopyIcon_16zxg_653", _a = "_usageDrawerContent_16zxg_667", fa = "_usageStatsGrid_16zxg_673", ya = "_usageSection_16zxg_679", Ca = "_usageSectionTitle_16zxg_683", Na = "_usageBarChart_16zxg_693", xa = "_usageBarCol_16zxg_702", va = "_usageBar_16zxg_693", Ta = "_usageBarLabel_16zxg_725", Sa = "_modelBreakdown_16zxg_733", wa = "_modelBreakdownRow_16zxg_739", Aa = "_modelBreakdownName_16zxg_745", Ba = "_modelBreakdownBar_16zxg_755", za = "_modelBreakdownFill_16zxg_763", Ma = "_modelBreakdownCount_16zxg_770", Ia = "_usageEmpty_16zxg_777", t = {
303
- container: rt,
304
- sidebar: lt,
305
- menuList: it,
306
- menuItem: ct,
307
- menuItemActive: dt,
308
- menuIcon: mt,
309
- panelArea: ut,
310
- modelMgmtHeader: ht,
311
- modelMgmtTitle: gt,
312
- modelMgmtSubtitle: pt,
313
- modelGrid: kt,
314
- modelCard: _t,
315
- modelCardSelected: ft,
316
- modelCardHeader: yt,
317
- modelIconWrap: Ct,
318
- modelCardInfo: Nt,
319
- modelName: xt,
320
- modelTags: vt,
321
- modelEndpoint: Tt,
322
- modelCardFooter: St,
323
- modelCheckbox: wt,
324
- modelActionBar: At,
325
- modelSelectionCount: Bt,
326
- chatContainer: zt,
327
- chatHeader: Mt,
328
- chatTitle: It,
329
- chatPanels: bt,
330
- chatPanel: Pt,
331
- chatPanelHeader: Kt,
332
- chatPanelClose: Et,
333
- chatPanelBody: $t,
334
- chatMsgUser: Lt,
335
- chatMsgAI: Ot,
336
- chatMsgError: Ut,
337
- chatStreamingCursor: Rt,
338
- chatUsageBar: Dt,
339
- chatThinkBlock: Ht,
340
- chatInputBar: Ft,
341
- chatInput: jt,
342
- addPanelBtn: qt,
343
- akContainer: Gt,
344
- akIntegrationPanel: Jt,
345
- akIntegrationTitle: Wt,
346
- akIntegrationGrid: Qt,
347
- akCodeBlock: Vt,
348
- akCodeLabel: Yt,
349
- akCard: Xt,
350
- akCardRow: Zt,
351
- akTitle: ea,
352
- akPrefixSmall: ta,
353
- akStatus: aa,
354
- akStatusActive: na,
355
- akStatusRevoked: sa,
356
- akCardActions: oa,
357
- akCardRow2: ra,
358
- akMiniBar: la,
359
- akMiniBarFill: ia,
360
- akUsageText: ca,
361
- akMetaText: da,
362
- akEmpty: ma,
363
- akBaseUrlRow: ua,
364
- akBaseUrlItem: ha,
365
- akBaseUrlLabel: ga,
366
- akBaseUrlValue: pa,
367
- akCopyIcon: ka,
368
- usageDrawerContent: _a,
369
- usageStatsGrid: fa,
370
- usageSection: ya,
371
- usageSectionTitle: Ca,
372
- usageBarChart: Na,
373
- usageBarCol: xa,
374
- usageBar: va,
375
- usageBarLabel: Ta,
376
- modelBreakdown: Sa,
377
- modelBreakdownRow: wa,
378
- modelBreakdownName: Aa,
379
- modelBreakdownBar: Ba,
380
- modelBreakdownFill: za,
381
- modelBreakdownCount: Ma,
382
- usageEmpty: Ia
302
+ const it = "_container_16zxg_7", ct = "_sidebar_16zxg_16", dt = "_menuList_16zxg_26", mt = "_menuItem_16zxg_35", ut = "_menuItemActive_16zxg_53", ht = "_menuIcon_16zxg_59", gt = "_panelArea_16zxg_66", pt = "_modelMgmtHeader_16zxg_78", kt = "_modelMgmtTitle_16zxg_82", _t = "_modelMgmtSubtitle_16zxg_89", ft = "_modelGrid_16zxg_95", yt = "_modelCard_16zxg_101", Ct = "_modelCardSelected_16zxg_130", Nt = "_modelCardHeader_16zxg_135", xt = "_modelIconWrap_16zxg_142", vt = "_modelCardInfo_16zxg_155", Tt = "_modelName_16zxg_160", St = "_modelTags_16zxg_169", wt = "_modelEndpoint_16zxg_185", At = "_modelCardFooter_16zxg_194", Bt = "_modelCheckbox_16zxg_202", zt = "_modelActionBar_16zxg_209", Mt = "_modelSelectionCount_16zxg_223", It = "_chatContainer_16zxg_232", bt = "_chatHeader_16zxg_239", Pt = "_chatTitle_16zxg_247", Kt = "_chatPanels_16zxg_254", Et = "_chatPanel_16zxg_254", $t = "_chatPanelHeader_16zxg_281", Lt = "_chatPanelClose_16zxg_291", Ot = "_chatPanelBody_16zxg_303", Ut = "_chatMsgUser_16zxg_312", Rt = "_chatMsgAI_16zxg_324", Dt = "_chatMsgError_16zxg_337", Ht = "_chatStreamingCursor_16zxg_347", Ft = "_chatUsageBar_16zxg_366", jt = "_chatThinkBlock_16zxg_376", qt = "_chatInputBar_16zxg_425", Gt = "_chatInput_16zxg_425", Jt = "_addPanelBtn_16zxg_438", Wt = "_akContainer_16zxg_467", Qt = "_akIntegrationPanel_16zxg_473", Vt = "_akIntegrationTitle_16zxg_480", Yt = "_akIntegrationGrid_16zxg_487", Xt = "_akCodeBlock_16zxg_493", Zt = "_akCodeLabel_16zxg_505", ea = "_akCard_16zxg_512", ta = "_akCardRow_16zxg_530", aa = "_akTitle_16zxg_537", na = "_akPrefixSmall_16zxg_547", sa = "_akStatus_16zxg_553", oa = "_akStatusActive_16zxg_559", ra = "_akStatusRevoked_16zxg_565", la = "_akCardActions_16zxg_571", ia = "_akCardRow2_16zxg_578", ca = "_akMiniBar_16zxg_584", da = "_akMiniBarFill_16zxg_593", ma = "_akUsageText_16zxg_600", ua = "_akMetaText_16zxg_607", ha = "_akEmpty_16zxg_613", ga = "_akBaseUrlRow_16zxg_621", pa = "_akBaseUrlItem_16zxg_627", ka = "_akBaseUrlLabel_16zxg_637", _a = "_akBaseUrlValue_16zxg_643", fa = "_akCopyIcon_16zxg_653", ya = "_usageDrawerContent_16zxg_667", Ca = "_usageStatsGrid_16zxg_673", Na = "_usageSection_16zxg_679", xa = "_usageSectionTitle_16zxg_683", va = "_usageBarChart_16zxg_693", Ta = "_usageBarCol_16zxg_702", Sa = "_usageBar_16zxg_693", wa = "_usageBarLabel_16zxg_725", Aa = "_modelBreakdown_16zxg_733", Ba = "_modelBreakdownRow_16zxg_739", za = "_modelBreakdownName_16zxg_745", Ma = "_modelBreakdownBar_16zxg_755", Ia = "_modelBreakdownFill_16zxg_763", ba = "_modelBreakdownCount_16zxg_770", Pa = "_usageEmpty_16zxg_777", t = {
303
+ container: it,
304
+ sidebar: ct,
305
+ menuList: dt,
306
+ menuItem: mt,
307
+ menuItemActive: ut,
308
+ menuIcon: ht,
309
+ panelArea: gt,
310
+ modelMgmtHeader: pt,
311
+ modelMgmtTitle: kt,
312
+ modelMgmtSubtitle: _t,
313
+ modelGrid: ft,
314
+ modelCard: yt,
315
+ modelCardSelected: Ct,
316
+ modelCardHeader: Nt,
317
+ modelIconWrap: xt,
318
+ modelCardInfo: vt,
319
+ modelName: Tt,
320
+ modelTags: St,
321
+ modelEndpoint: wt,
322
+ modelCardFooter: At,
323
+ modelCheckbox: Bt,
324
+ modelActionBar: zt,
325
+ modelSelectionCount: Mt,
326
+ chatContainer: It,
327
+ chatHeader: bt,
328
+ chatTitle: Pt,
329
+ chatPanels: Kt,
330
+ chatPanel: Et,
331
+ chatPanelHeader: $t,
332
+ chatPanelClose: Lt,
333
+ chatPanelBody: Ot,
334
+ chatMsgUser: Ut,
335
+ chatMsgAI: Rt,
336
+ chatMsgError: Dt,
337
+ chatStreamingCursor: Ht,
338
+ chatUsageBar: Ft,
339
+ chatThinkBlock: jt,
340
+ chatInputBar: qt,
341
+ chatInput: Gt,
342
+ addPanelBtn: Jt,
343
+ akContainer: Wt,
344
+ akIntegrationPanel: Qt,
345
+ akIntegrationTitle: Vt,
346
+ akIntegrationGrid: Yt,
347
+ akCodeBlock: Xt,
348
+ akCodeLabel: Zt,
349
+ akCard: ea,
350
+ akCardRow: ta,
351
+ akTitle: aa,
352
+ akPrefixSmall: na,
353
+ akStatus: sa,
354
+ akStatusActive: oa,
355
+ akStatusRevoked: ra,
356
+ akCardActions: la,
357
+ akCardRow2: ia,
358
+ akMiniBar: ca,
359
+ akMiniBarFill: da,
360
+ akUsageText: ma,
361
+ akMetaText: ua,
362
+ akEmpty: ha,
363
+ akBaseUrlRow: ga,
364
+ akBaseUrlItem: pa,
365
+ akBaseUrlLabel: ka,
366
+ akBaseUrlValue: _a,
367
+ akCopyIcon: fa,
368
+ usageDrawerContent: ya,
369
+ usageStatsGrid: Ca,
370
+ usageSection: Na,
371
+ usageSectionTitle: xa,
372
+ usageBarChart: va,
373
+ usageBarCol: Ta,
374
+ usageBar: Sa,
375
+ usageBarLabel: wa,
376
+ modelBreakdown: Aa,
377
+ modelBreakdownRow: Ba,
378
+ modelBreakdownName: za,
379
+ modelBreakdownBar: Ma,
380
+ modelBreakdownFill: Ia,
381
+ modelBreakdownCount: ba,
382
+ usageEmpty: Pa
383
383
  };
384
- function ye(a) {
384
+ function Ne(a) {
385
385
  return a >= 1e6 ? `${(a / 1e6).toFixed(1)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : `${a}`;
386
386
  }
387
- function ba(a, n) {
387
+ function Ka(a, n) {
388
388
  return `# OpenAI 兼容
389
389
  curl -X POST ${a}/v1/chat/completions \\
390
390
  -H "Content-Type: application/json" \\
@@ -395,7 +395,7 @@ curl -X POST ${a}/v1/chat/completions \\
395
395
  "stream": true
396
396
  }'`;
397
397
  }
398
- function Pa(a, n) {
398
+ function Ea(a, n) {
399
399
  return `# Anthropic 兼容
400
400
  curl -X POST ${a}/v1/messages \\
401
401
  -H "Content-Type: application/json" \\
@@ -405,57 +405,57 @@ curl -X POST ${a}/v1/messages \\
405
405
  "messages": [{"role":"user","content":"你好"}]
406
406
  }'`;
407
407
  }
408
- function Ka() {
409
- const [a, n] = x("personal"), [r, i] = x([]), [m, y] = x([]), [C, f] = x(!0), [p, B] = x(!1), [L, w] = x(!1), [N, T] = x(""), [h, c] = x({ open: !1 }), [k, d] = x(null), [A, M] = x(null), [q, W] = x(!1), H = ze((u) => u.currentUser), l = String((H == null ? void 0 : H.id) ?? ""), b = (H == null ? void 0 : H.username) ?? "", P = nt(), [o, g] = x("<model-name>");
410
- X(() => {
411
- let u = !1;
412
- return pe().then((S) => {
413
- !u && S.length > 0 && g(S[0].modelName);
408
+ function $a() {
409
+ const [a, n] = N("personal"), [r, i] = N([]), [u, f] = N([]), [y, _] = N(!0), [p, z] = N(!1), [O, w] = N(!1), [C, v] = N(""), [g, c] = N({ open: !1 }), [k, m] = N(null), [A, I] = N(null), [G, Q] = N(!1), H = Me((d) => d.currentUser), l = String((H == null ? void 0 : H.id) ?? ""), b = (H == null ? void 0 : H.username) ?? "", [U, o] = N(""), h = ot(), [S, P] = N("<model-name>");
410
+ Z(() => {
411
+ let d = !1;
412
+ return fe().then((T) => {
413
+ !d && T.length > 0 && P(T[0].modelName);
414
414
  }).catch(() => {
415
415
  }), () => {
416
- u = !0;
416
+ d = !0;
417
417
  };
418
418
  }, []);
419
- const v = j(async () => {
420
- f(!0);
419
+ const B = j(async () => {
420
+ _(!0);
421
421
  try {
422
- const u = l ? await le(l).catch(() => []) : [], [S] = await Promise.all([
423
- le("system-default").catch(() => [])
422
+ const d = l ? await ie(l).catch(() => []) : [], [T] = await Promise.all([
423
+ ie("system-default").catch(() => [])
424
424
  ]);
425
- i(S), y(u);
425
+ i(T), f(d);
426
426
  } finally {
427
- f(!1);
427
+ _(!1);
428
428
  }
429
429
  }, [l]);
430
- X(() => {
431
- v();
432
- }, [v]);
433
- const K = () => {
434
- T(""), w(!0);
435
- }, I = async () => {
436
- if (!N.trim()) {
437
- G.warning("请输入 AK 名称");
430
+ Z(() => {
431
+ B();
432
+ }, [B]);
433
+ const M = () => {
434
+ v(""), w(!0);
435
+ }, q = async () => {
436
+ if (!C.trim()) {
437
+ J.warning("请输入 AK 名称");
438
438
  return;
439
439
  }
440
440
  if (!l) {
441
- G.warning("登录态不可用,无法生成 AK");
441
+ J.warning("登录态不可用,无法生成 AK");
442
442
  return;
443
443
  }
444
- B(!0);
444
+ z(!0);
445
445
  try {
446
- const u = await Ie(l, b, N.trim());
447
- ke(u.akPrefix, u.apiKey), w(!1), c({
446
+ const d = await be(l, b, C.trim());
447
+ ye(d.akPrefix, d.apiKey), w(!1), c({
448
448
  open: !0,
449
- apiKey: u.apiKey,
450
- akPrefix: u.akPrefix
451
- }), v();
452
- } catch (u) {
453
- G.error(u instanceof Error ? u.message : "创建 AK 失败");
449
+ apiKey: d.apiKey,
450
+ akPrefix: d.akPrefix
451
+ }), B();
452
+ } catch (d) {
453
+ J.error(d instanceof Error ? d.message : "创建 AK 失败");
454
454
  } finally {
455
- B(!1);
455
+ z(!1);
456
456
  }
457
- }, z = (u) => {
458
- de.confirm({
457
+ }, ce = (d) => {
458
+ ue.confirm({
459
459
  title: "确认吊销此 AK?",
460
460
  content: "吊销后此 AK 将立即失效,无法恢复。",
461
461
  okText: "确认吊销",
@@ -463,75 +463,75 @@ function Ka() {
463
463
  cancelText: "取消",
464
464
  onOk: async () => {
465
465
  try {
466
- await at(u), G.success("AK 已吊销"), v(), Pe();
467
- } catch (S) {
468
- G.error(S instanceof Error ? S.message : "吊销失败");
466
+ await st(d), J.success("AK 已吊销"), B(), Ke();
467
+ } catch (T) {
468
+ J.error(T instanceof Error ? T.message : "吊销失败");
469
469
  }
470
470
  }
471
471
  });
472
- }, O = (u) => {
473
- navigator.clipboard.writeText(u).then(() => G.success("已复制到剪贴板")).catch(() => G.warning("复制失败,请手动复制"));
474
- }, ie = (u) => {
475
- const S = st(u.akPrefix);
476
- S ? O(S) : (O(u.akPrefix), G.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
477
- }, U = async (u) => {
478
- d(u), W(!0), M(null);
472
+ }, E = (d) => {
473
+ navigator.clipboard.writeText(d).then(() => J.success("已复制到剪贴板")).catch(() => J.warning("复制失败,请手动复制"));
474
+ }, F = (d) => {
475
+ const T = rt(d.akPrefix);
476
+ T ? E(T) : (E(d.akPrefix), J.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
477
+ }, se = async (d) => {
478
+ m(d), Q(!0), I(null);
479
479
  try {
480
- const S = await be(u.id);
481
- M(S);
482
- } catch (S) {
483
- G.error(S instanceof Error ? S.message : "获取用量失败");
480
+ const T = await Pe(d.id);
481
+ I(T);
482
+ } catch (T) {
483
+ J.error(T instanceof Error ? T.message : "获取用量失败");
484
484
  } finally {
485
- W(!1);
485
+ Q(!1);
486
486
  }
487
- }, F = () => {
488
- d(null), M(null);
489
- }, ne = (u) => {
490
- const S = Object.entries(u);
491
- if (S.length === 0)
487
+ }, de = () => {
488
+ m(null), I(null);
489
+ }, Ee = (d) => {
490
+ const T = Object.entries(d);
491
+ if (T.length === 0)
492
492
  return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
493
- const V = Math.max(...S.map(([, _]) => _[1] + _[2]), 1);
494
- return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: S.map(([_, D]) => {
495
- const fe = D[1] + D[2], Ee = fe / V * 100;
493
+ const V = Math.max(...T.map(([, $]) => $[1] + $[2]), 1);
494
+ return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: T.map(([$, R]) => {
495
+ const x = R[1] + R[2], me = x / V * 100;
496
496
  return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
497
- /* @__PURE__ */ e(Q, { title: `${_}: ${D[0]}次 / ${fe} tokens`, children: /* @__PURE__ */ e(
497
+ /* @__PURE__ */ e(Y, { title: `${$}: ${R[0]}次 / ${x} tokens`, children: /* @__PURE__ */ e(
498
498
  "div",
499
499
  {
500
500
  className: t.usageBar,
501
- style: { height: `${Math.max(Ee, 2)}%` }
501
+ style: { height: `${Math.max(me, 2)}%` }
502
502
  }
503
503
  ) }),
504
- /* @__PURE__ */ e("span", { className: t.usageBarLabel, children: _ })
505
- ] }, _);
504
+ /* @__PURE__ */ e("span", { className: t.usageBarLabel, children: $ })
505
+ ] }, $);
506
506
  }) });
507
- }, ce = (u) => {
508
- const S = Object.entries(u);
509
- if (S.length === 0)
507
+ }, $e = (d) => {
508
+ const T = Object.entries(d);
509
+ if (T.length === 0)
510
510
  return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
511
- const V = Math.max(...S.map(([, _]) => _[0]), 1);
512
- return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: S.sort((_, D) => D[1][0] - _[1][0]).map(([_, D]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
513
- /* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: _ }),
511
+ const V = Math.max(...T.map(([, $]) => $[0]), 1);
512
+ return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: T.sort(($, R) => R[1][0] - $[1][0]).map(([$, R]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
513
+ /* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: $ }),
514
514
  /* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
515
515
  "div",
516
516
  {
517
517
  className: t.modelBreakdownFill,
518
- style: { width: `${D[0] / V * 100}%` }
518
+ style: { width: `${R[0] / V * 100}%` }
519
519
  }
520
520
  ) }),
521
521
  /* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
522
- D[0],
522
+ R[0],
523
523
  "次 / ",
524
- D[1] + (D[2] || 0),
524
+ R[1] + (R[2] || 0),
525
525
  "tokens"
526
526
  ] })
527
- ] }, _)) });
528
- }, Ke = [
527
+ ] }, $)) });
528
+ }, Le = [
529
529
  {
530
530
  title: "时间",
531
531
  dataIndex: "createTime",
532
532
  key: "createTime",
533
533
  width: 160,
534
- render: (u) => u ? new Date(u).toLocaleString("zh-CN") : "-"
534
+ render: (d) => d ? new Date(d).toLocaleString("zh-CN") : "-"
535
535
  },
536
536
  { title: "模型", dataIndex: "model", key: "model", width: 140 },
537
537
  {
@@ -539,7 +539,7 @@ function Ka() {
539
539
  dataIndex: "protocol",
540
540
  key: "protocol",
541
541
  width: 90,
542
- render: (u) => /* @__PURE__ */ e(J, { children: u })
542
+ render: (d) => /* @__PURE__ */ e(W, { children: d })
543
543
  },
544
544
  {
545
545
  title: "输入",
@@ -564,59 +564,61 @@ function Ka() {
564
564
  dataIndex: "latencyMs",
565
565
  key: "latencyMs",
566
566
  width: 70,
567
- render: (u) => u ? `${u}ms` : "-"
567
+ render: (d) => d ? `${d}ms` : "-"
568
568
  },
569
569
  {
570
570
  title: "状态",
571
571
  dataIndex: "statusCode",
572
572
  key: "statusCode",
573
573
  width: 60,
574
- render: (u) => u ? /* @__PURE__ */ e(J, { color: u < 400 ? "green" : "red", children: u }) : "-"
574
+ render: (d) => d ? /* @__PURE__ */ e(W, { color: d < 400 ? "green" : "red", children: d }) : "-"
575
575
  }
576
- ], _e = (u, S) => {
577
- const V = Array.isArray(u) ? u : [];
578
- return C ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(Y, { tip: "加载中..." }) }) : V.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: S ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: V.map((_) => /* @__PURE__ */ s(
576
+ ], Ce = (d, T) => {
577
+ const V = Array.isArray(d) ? d : [], $ = U.trim().toLowerCase(), R = $ ? V.filter(
578
+ (x) => `${x.description || ""} ${x.akPrefix || ""} ${x.defaultModel || ""}`.toLowerCase().includes($)
579
+ ) : V;
580
+ return y ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(X, { tip: "加载中..." }) }) : V.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: T ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : R.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "无匹配 AK" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: R.map((x) => /* @__PURE__ */ s(
579
581
  "div",
580
582
  {
581
583
  className: t.akCard,
582
- onClick: () => U(_),
584
+ onClick: () => se(x),
583
585
  children: [
584
586
  /* @__PURE__ */ s("div", { className: t.akCardRow, children: [
585
- /* @__PURE__ */ e("span", { className: t.akTitle, children: _.description || _.akPrefix.replace("...", "**") }),
586
- /* @__PURE__ */ e("code", { className: t.akPrefixSmall, children: _.akPrefix.replace("...", "**") }),
587
+ /* @__PURE__ */ e("span", { className: t.akTitle, children: x.description || x.akPrefix.replace("...", "**") }),
588
+ /* @__PURE__ */ e("code", { className: t.akPrefixSmall, children: x.akPrefix.replace("...", "**") }),
587
589
  /* @__PURE__ */ e(
588
590
  "span",
589
591
  {
590
- className: `${t.akStatus} ${_.active ? t.akStatusActive : t.akStatusRevoked}`,
591
- children: _.active ? "活跃" : "已吊销"
592
+ className: `${t.akStatus} ${x.active ? t.akStatusActive : t.akStatusRevoked}`,
593
+ children: x.active ? "活跃" : "已吊销"
592
594
  }
593
595
  ),
594
- _.defaultModel && /* @__PURE__ */ s(J, { style: { fontSize: 11 }, children: [
596
+ x.defaultModel && /* @__PURE__ */ s(W, { style: { fontSize: 11 }, children: [
595
597
  "默认: ",
596
- _.defaultModel
598
+ x.defaultModel
597
599
  ] }),
598
600
  /* @__PURE__ */ s(
599
601
  "div",
600
602
  {
601
603
  className: t.akCardActions,
602
- onClick: (D) => D.stopPropagation(),
604
+ onClick: (me) => me.stopPropagation(),
603
605
  children: [
604
- /* @__PURE__ */ e(Q, { title: "复制完整 AK", children: /* @__PURE__ */ e(
605
- R,
606
+ /* @__PURE__ */ e(Y, { title: "复制完整 AK", children: /* @__PURE__ */ e(
607
+ D,
606
608
  {
607
609
  size: "small",
608
- icon: /* @__PURE__ */ e(se, {}),
609
- onClick: () => ie(_),
610
+ icon: /* @__PURE__ */ e(oe, {}),
611
+ onClick: () => F(x),
610
612
  children: "复制"
611
613
  }
612
614
  ) }),
613
- !S && _.active && /* @__PURE__ */ e(
614
- R,
615
+ !T && x.active && /* @__PURE__ */ e(
616
+ D,
615
617
  {
616
618
  size: "small",
617
619
  danger: !0,
618
- icon: /* @__PURE__ */ e($e, {}),
619
- onClick: () => z(_.id),
620
+ icon: /* @__PURE__ */ e(Oe, {}),
621
+ onClick: () => ce(x.id),
620
622
  children: "吊销"
621
623
  }
622
624
  )
@@ -625,28 +627,28 @@ function Ka() {
625
627
  )
626
628
  ] }),
627
629
  /* @__PURE__ */ s("div", { className: t.akCardRow2, children: [
628
- _.tokenQuota > 0 && /* @__PURE__ */ e("div", { className: t.akMiniBar, children: /* @__PURE__ */ e(
630
+ x.tokenQuota > 0 && /* @__PURE__ */ e("div", { className: t.akMiniBar, children: /* @__PURE__ */ e(
629
631
  "div",
630
632
  {
631
633
  className: t.akMiniBarFill,
632
634
  style: {
633
635
  width: `${Math.min(
634
- (_.totalTokens || 0) / _.tokenQuota * 100,
636
+ (x.totalTokens || 0) / x.tokenQuota * 100,
635
637
  100
636
638
  )}%`
637
639
  }
638
640
  }
639
641
  ) }),
640
642
  /* @__PURE__ */ s("span", { className: t.akUsageText, children: [
641
- ye(_.totalTokens || 0),
642
- _.tokenQuota > 0 ? ` / ${ye(_.tokenQuota)}` : " tokens"
643
+ Ne(x.totalTokens || 0),
644
+ x.tokenQuota > 0 ? ` / ${Ne(x.tokenQuota)}` : " tokens"
643
645
  ] }),
644
- /* @__PURE__ */ e("span", { className: t.akMetaText, children: _.lastUsedAt ? `最近使用 ${_.lastUsedAt}` : "尚未使用" }),
645
- /* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(_.createTime).toLocaleDateString("zh-CN") })
646
+ /* @__PURE__ */ e("span", { className: t.akMetaText, children: x.lastUsedAt ? `最近使用 ${x.lastUsedAt}` : "尚未使用" }),
647
+ /* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(x.createTime).toLocaleDateString("zh-CN") })
646
648
  ] })
647
649
  ]
648
650
  },
649
- _.id
651
+ x.id
650
652
  )) });
651
653
  };
652
654
  return /* @__PURE__ */ s("div", { className: t.akContainer, children: [
@@ -655,23 +657,23 @@ function Ka() {
655
657
  /* @__PURE__ */ s("div", { className: t.akBaseUrlRow, children: [
656
658
  /* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
657
659
  /* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "OpenAI 兼容" }),
658
- /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: P }),
659
- /* @__PURE__ */ e(Q, { title: "复制 Base URL", children: /* @__PURE__ */ e(
660
- se,
660
+ /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: h }),
661
+ /* @__PURE__ */ e(Y, { title: "复制 Base URL", children: /* @__PURE__ */ e(
662
+ oe,
661
663
  {
662
664
  className: t.akCopyIcon,
663
- onClick: () => O(P)
665
+ onClick: () => E(h)
664
666
  }
665
667
  ) })
666
668
  ] }),
667
669
  /* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
668
670
  /* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "Anthropic 兼容" }),
669
- /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: P }),
670
- /* @__PURE__ */ e(Q, { title: "复制 Base URL", children: /* @__PURE__ */ e(
671
- se,
671
+ /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: h }),
672
+ /* @__PURE__ */ e(Y, { title: "复制 Base URL", children: /* @__PURE__ */ e(
673
+ oe,
672
674
  {
673
675
  className: t.akCopyIcon,
674
- onClick: () => O(P)
676
+ onClick: () => E(h)
675
677
  }
676
678
  ) })
677
679
  ] })
@@ -679,11 +681,11 @@ function Ka() {
679
681
  /* @__PURE__ */ s("div", { className: t.akIntegrationGrid, children: [
680
682
  /* @__PURE__ */ s("div", { children: [
681
683
  /* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "OpenAI 兼容 — curl 示例" }),
682
- /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: ba(P, o) })
684
+ /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: Ka(h, S) })
683
685
  ] }),
684
686
  /* @__PURE__ */ s("div", { children: [
685
687
  /* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "Anthropic 兼容 — curl 示例" }),
686
- /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: Pa(P, o) })
688
+ /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: Ea(h, S) })
687
689
  ] })
688
690
  ] })
689
691
  ] }),
@@ -699,10 +701,10 @@ function Ka() {
699
701
  },
700
702
  children: [
701
703
  /* @__PURE__ */ e(
702
- Te,
704
+ we,
703
705
  {
704
706
  activeKey: a,
705
- onChange: (u) => n(u),
707
+ onChange: (d) => n(d),
706
708
  items: [
707
709
  { key: "app", label: "应用 AK" },
708
710
  { key: "personal", label: "个人 AK" }
@@ -711,13 +713,22 @@ function Ka() {
711
713
  }
712
714
  ),
713
715
  /* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
714
- /* @__PURE__ */ e(R, { icon: /* @__PURE__ */ e(Ne, {}), onClick: v, size: "small", children: "刷新" }),
716
+ /* @__PURE__ */ e(
717
+ pe.Search,
718
+ {
719
+ allowClear: !0,
720
+ placeholder: "按名称 / 前缀过滤",
721
+ style: { width: 200 },
722
+ onChange: (d) => o(d.target.value)
723
+ }
724
+ ),
725
+ /* @__PURE__ */ e(D, { icon: /* @__PURE__ */ e(ve, {}), onClick: B, size: "small", children: "刷新" }),
715
726
  a === "personal" && /* @__PURE__ */ e(
716
- R,
727
+ D,
717
728
  {
718
729
  type: "primary",
719
- icon: /* @__PURE__ */ e(xe, {}),
720
- onClick: K,
730
+ icon: /* @__PURE__ */ e(Te, {}),
731
+ onClick: M,
721
732
  loading: p,
722
733
  children: "生成 AK"
723
734
  }
@@ -726,15 +737,15 @@ function Ka() {
726
737
  ]
727
738
  }
728
739
  ),
729
- a === "app" ? _e(r, !0) : _e(m, !1)
740
+ a === "app" ? Ce(r, !0) : Ce(u, !1)
730
741
  ] }),
731
742
  /* @__PURE__ */ s(
732
- de,
743
+ ue,
733
744
  {
734
- open: L,
745
+ open: O,
735
746
  title: "生成新 AK",
736
747
  onCancel: () => w(!1),
737
- onOk: I,
748
+ onOk: q,
738
749
  okText: "确认生成",
739
750
  cancelText: "取消",
740
751
  confirmLoading: p,
@@ -751,12 +762,12 @@ function Ka() {
751
762
  }
752
763
  ),
753
764
  /* @__PURE__ */ e(
754
- Se,
765
+ pe,
755
766
  {
756
767
  placeholder: "例如:测试用 AK、生产网关 AK",
757
- value: N,
758
- onChange: (u) => T(u.target.value),
759
- onPressEnter: I,
768
+ value: C,
769
+ onChange: (d) => v(d.target.value),
770
+ onPressEnter: q,
760
771
  maxLength: 50,
761
772
  autoFocus: !0
762
773
  }
@@ -765,23 +776,23 @@ function Ka() {
765
776
  }
766
777
  ),
767
778
  /* @__PURE__ */ s(
768
- de,
779
+ ue,
769
780
  {
770
- open: h.open,
781
+ open: g.open,
771
782
  title: "AK 创建成功",
772
783
  onCancel: () => c({ open: !1 }),
773
784
  footer: [
774
785
  /* @__PURE__ */ e(
775
- R,
786
+ D,
776
787
  {
777
- icon: /* @__PURE__ */ e(se, {}),
778
- onClick: () => h.apiKey && O(h.apiKey),
788
+ icon: /* @__PURE__ */ e(oe, {}),
789
+ onClick: () => g.apiKey && E(g.apiKey),
779
790
  children: "复制 AK"
780
791
  },
781
792
  "copy"
782
793
  ),
783
794
  /* @__PURE__ */ e(
784
- R,
795
+ D,
785
796
  {
786
797
  type: "primary",
787
798
  onClick: () => c({ open: !1 }),
@@ -804,47 +815,47 @@ function Ka() {
804
815
  wordBreak: "break-all",
805
816
  userSelect: "all"
806
817
  },
807
- children: h.apiKey
818
+ children: g.apiKey
808
819
  }
809
820
  ),
810
821
  /* @__PURE__ */ s("div", { style: { marginTop: 8, fontSize: 12, color: "var(--text-muted)" }, children: [
811
822
  "前缀: ",
812
- h.akPrefix
823
+ g.akPrefix
813
824
  ] })
814
825
  ]
815
826
  }
816
827
  ),
817
828
  /* @__PURE__ */ e(
818
- we,
829
+ Ae,
819
830
  {
820
831
  title: k ? /* @__PURE__ */ s("span", { children: [
821
832
  "AK 详情 — ",
822
833
  /* @__PURE__ */ e("code", { children: k.akPrefix })
823
834
  ] }) : "AK 详情",
824
835
  open: !!k,
825
- onClose: F,
836
+ onClose: de,
826
837
  size: "large",
827
- children: q ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Y, { tip: "加载用量数据..." }) }) : A ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
838
+ children: G ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载用量数据..." }) }) : A ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
828
839
  /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "以下为网关全局调用统计(近 7 天窗口), 监控侧不按 AK 留存;该 AK 自身的累计消耗见下方「本 AK 累计 Token」。" }),
829
840
  /* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
830
- /* @__PURE__ */ e(E, { title: "总请求数", value: A.totalRequests }),
831
- /* @__PURE__ */ e(E, { title: "总 Token", value: A.totalTokens }),
841
+ /* @__PURE__ */ e(K, { title: "总请求数", value: A.totalRequests }),
842
+ /* @__PURE__ */ e(K, { title: "总 Token", value: A.totalTokens }),
832
843
  /* @__PURE__ */ e(
833
- E,
844
+ K,
834
845
  {
835
846
  title: "输入 Token",
836
847
  value: A.totalPromptTokens
837
848
  }
838
849
  ),
839
850
  /* @__PURE__ */ e(
840
- E,
851
+ K,
841
852
  {
842
853
  title: "输出 Token",
843
854
  value: A.totalCompletionTokens
844
855
  }
845
856
  ),
846
857
  /* @__PURE__ */ e(
847
- E,
858
+ K,
848
859
  {
849
860
  title: "平均耗时",
850
861
  value: A.avgLatencyMs,
@@ -852,7 +863,7 @@ function Ka() {
852
863
  }
853
864
  ),
854
865
  /* @__PURE__ */ e(
855
- E,
866
+ K,
856
867
  {
857
868
  title: "错误数",
858
869
  value: A.errorCount,
@@ -864,7 +875,7 @@ function Ka() {
864
875
  }
865
876
  ),
866
877
  /* @__PURE__ */ e(
867
- E,
878
+ K,
868
879
  {
869
880
  title: "本 AK 累计 Token",
870
881
  value: (k == null ? void 0 : k.totalTokens) ?? 0
@@ -873,18 +884,18 @@ function Ka() {
873
884
  ] }),
874
885
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
875
886
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "每日调用曲线(按最近调用明细聚合)" }),
876
- ne(A.daily)
887
+ Ee(A.daily)
877
888
  ] }),
878
889
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
879
890
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "模型用量分布" }),
880
- ce(A.models)
891
+ $e(A.models)
881
892
  ] }),
882
893
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
883
894
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "最近调用记录" }),
884
895
  /* @__PURE__ */ e(
885
- Ae,
896
+ Be,
886
897
  {
887
- columns: Ke,
898
+ columns: Le,
888
899
  dataSource: A.recent,
889
900
  rowKey: "id",
890
901
  size: "small",
@@ -893,7 +904,7 @@ function Ka() {
893
904
  size: "small",
894
905
  showSizeChanger: !0,
895
906
  pageSizeOptions: ["10", "20", "50", "100"],
896
- showTotal: (u) => `共 ${u} 条`
907
+ showTotal: (d) => `共 ${d} 条`
897
908
  },
898
909
  scroll: { x: 760 }
899
910
  }
@@ -904,62 +915,62 @@ function Ka() {
904
915
  )
905
916
  ] });
906
917
  }
907
- function Ea(a) {
918
+ function La(a) {
908
919
  const n = [];
909
920
  if (!a) return n;
910
921
  const r = /<(think|thinking|reasoning)>([\s\S]*?)<\/\1>/gi;
911
- let i = 0, m;
912
- for (; (m = r.exec(a)) !== null; )
913
- m.index > i && n.push({ type: "text", text: a.slice(i, m.index) }), n.push({ type: "think", text: m[2] }), i = m.index + m[0].length;
922
+ let i = 0, u;
923
+ for (; (u = r.exec(a)) !== null; )
924
+ u.index > i && n.push({ type: "text", text: a.slice(i, u.index) }), n.push({ type: "think", text: u[2] }), i = u.index + u[0].length;
914
925
  return i < a.length && n.push({ type: "text", text: a.slice(i) }), n;
915
926
  }
916
- const oe = 4;
917
- let $a = 0;
918
- function La({ initialModels: a }) {
919
- const [n, r] = x([]), [i, m] = x([]), [y, C] = x(!0), [f, p] = x(null), [B, L] = x(""), [w, N] = x(!1), T = me(""), h = me(/* @__PURE__ */ new Map()), c = me(/* @__PURE__ */ new Map());
920
- X(() => {
927
+ const re = 4;
928
+ let Oa = 0;
929
+ function Ua({ initialModels: a }) {
930
+ const [n, r] = N([]), [i, u] = N([]), [f, y] = N(!0), [_, p] = N(null), [z, O] = N(""), [w, C] = N(!1), v = he(""), g = he(/* @__PURE__ */ new Map()), c = he(/* @__PURE__ */ new Map());
931
+ Z(() => {
921
932
  (async () => {
922
933
  try {
923
- const o = await pe();
924
- m(o), C(!1);
925
- const g = a.length > 0 ? a : o.slice(0, 1).map((v) => v.modelName);
926
- r(g.slice(0, oe).map((v) => ue(v)));
934
+ const o = await fe();
935
+ u(o), y(!1);
936
+ const h = a.length > 0 ? a : o.slice(0, 1).map((S) => S.modelName);
937
+ r(h.slice(0, re).map((S) => ge(S)));
927
938
  } catch (o) {
928
- C(!1), p(o instanceof Error ? o.message : "模型列表加载失败");
939
+ y(!1), p(o instanceof Error ? o.message : "模型列表加载失败");
929
940
  }
930
941
  })();
931
- }, []), X(() => {
942
+ }, []), Z(() => {
932
943
  if (a.length > 0 && i.length > 0) {
933
- const o = a.slice(0, oe).map((g) => ue(g));
944
+ const o = a.slice(0, re).map((h) => ge(h));
934
945
  r(o);
935
946
  }
936
947
  }, [a.join(",")]);
937
948
  const k = j((o) => {
938
- const g = c.current.get(o);
939
- g && (g.scrollTop = g.scrollHeight);
940
- }, []), d = j(
941
- (o, g) => {
942
- r((v) => v.map((K) => K.id === o ? g(K) : K));
949
+ const h = c.current.get(o);
950
+ h && (h.scrollTop = h.scrollHeight);
951
+ }, []), m = j(
952
+ (o, h) => {
953
+ r((S) => S.map((P) => P.id === o ? h(P) : P));
943
954
  },
944
955
  []
945
956
  ), A = j(async () => {
946
- if (T.current) return T.current;
947
- const o = await ot();
948
- return T.current = o, o;
949
- }, []), M = j(async () => {
950
- const o = B.trim();
957
+ if (v.current) return v.current;
958
+ const o = await lt();
959
+ return v.current = o, o;
960
+ }, []), I = j(async () => {
961
+ const o = z.trim();
951
962
  if (!o || w) return;
952
- let g;
963
+ let h;
953
964
  try {
954
- g = await A();
965
+ h = await A();
955
966
  } catch {
956
967
  return;
957
968
  }
958
- L(""), N(!0);
959
- const v = n.map((z) => ({
960
- ...z,
969
+ O(""), C(!0);
970
+ const S = n.map((M) => ({
971
+ ...M,
961
972
  messages: [
962
- ...z.messages,
973
+ ...M.messages,
963
974
  { role: "user", content: o },
964
975
  { role: "assistant", content: "" }
965
976
  ],
@@ -968,102 +979,102 @@ function La({ initialModels: a }) {
968
979
  error: null,
969
980
  usage: null
970
981
  }));
971
- r(v);
972
- const K = v;
973
- K.forEach((z) => {
974
- const O = new AbortController();
975
- h.current.set(z.id, O);
976
- const ie = z.messages.slice(0, -1);
977
- et(g, z.model, ie, {
978
- onDelta: (U) => {
979
- d(z.id, (F) => ({
982
+ r(S);
983
+ const P = S;
984
+ P.forEach((M) => {
985
+ const q = new AbortController();
986
+ g.current.set(M.id, q);
987
+ const ce = M.messages.slice(0, -1);
988
+ at(h, M.model, ce, {
989
+ onDelta: (E) => {
990
+ m(M.id, (F) => ({
980
991
  ...F,
981
- streamingContent: F.streamingContent + U,
992
+ streamingContent: F.streamingContent + E,
982
993
  messages: F.messages.map(
983
- (ne, ce) => ce === F.messages.length - 1 ? { ...ne, content: F.streamingContent + U } : ne
994
+ (se, de) => de === F.messages.length - 1 ? { ...se, content: F.streamingContent + E } : se
984
995
  )
985
- })), k(z.id);
996
+ })), k(M.id);
986
997
  },
987
- onDone: (U) => {
988
- d(z.id, (F) => ({
998
+ onDone: (E) => {
999
+ m(M.id, (F) => ({
989
1000
  ...F,
990
1001
  isStreaming: !1,
991
- usage: U ? {
992
- promptTokens: U.promptTokens,
993
- completionTokens: U.completionTokens,
994
- totalTokens: U.totalTokens
1002
+ usage: E ? {
1003
+ promptTokens: E.promptTokens,
1004
+ completionTokens: E.completionTokens,
1005
+ totalTokens: E.totalTokens
995
1006
  } : null
996
- })), h.current.delete(z.id);
1007
+ })), g.current.delete(M.id);
997
1008
  },
998
- onError: (U) => {
999
- (U.message.includes("401") || U.message.includes("API key")) && (Pe(), T.current = ""), d(z.id, (F) => ({
1009
+ onError: (E) => {
1010
+ (E.message.includes("401") || E.message.includes("API key")) && (Ke(), v.current = ""), m(M.id, (F) => ({
1000
1011
  ...F,
1001
1012
  isStreaming: !1,
1002
- error: U.message
1003
- })), h.current.delete(z.id);
1013
+ error: E.message
1014
+ })), g.current.delete(M.id);
1004
1015
  },
1005
- signal: O.signal
1016
+ signal: q.signal
1006
1017
  }).catch(() => {
1007
1018
  });
1008
1019
  });
1009
- const I = setInterval(() => {
1010
- K.every(
1011
- (O) => !h.current.has(O.id)
1012
- ) && (clearInterval(I), N(!1));
1020
+ const B = setInterval(() => {
1021
+ P.every(
1022
+ (q) => !g.current.has(q.id)
1023
+ ) && (clearInterval(B), C(!1));
1013
1024
  }, 200);
1014
1025
  setTimeout(() => {
1015
- clearInterval(I), N(!1);
1026
+ clearInterval(B), C(!1);
1016
1027
  }, 300 * 1e3);
1017
- }, [B, w, n, A, d, k]), q = j(() => {
1018
- h.current.forEach((o) => o.abort()), h.current.clear(), r((o) => o.map((g) => ({ ...g, isStreaming: !1 }))), N(!1);
1019
- }, []), W = j(() => {
1020
- var g;
1021
- if (n.length >= oe) return;
1022
- const o = (g = i.find((v) => !n.some((K) => K.model === v.modelName))) == null ? void 0 : g.modelName;
1023
- o && r((v) => [...v, ue(o)]);
1028
+ }, [z, w, n, A, m, k]), G = j(() => {
1029
+ g.current.forEach((o) => o.abort()), g.current.clear(), r((o) => o.map((h) => ({ ...h, isStreaming: !1 }))), C(!1);
1030
+ }, []), Q = j(() => {
1031
+ var h;
1032
+ if (n.length >= re) return;
1033
+ const o = (h = i.find((S) => !n.some((P) => P.model === S.modelName))) == null ? void 0 : h.modelName;
1034
+ o && r((S) => [...S, ge(o)]);
1024
1035
  }, [n, i]), H = j(() => {
1025
- h.current.forEach((o) => o.abort()), h.current.clear(), r(
1026
- (o) => o.map((g) => ({
1027
- ...g,
1036
+ g.current.forEach((o) => o.abort()), g.current.clear(), r(
1037
+ (o) => o.map((h) => ({
1038
+ ...h,
1028
1039
  messages: [],
1029
1040
  streamingContent: "",
1030
1041
  isStreaming: !1,
1031
1042
  error: null,
1032
1043
  usage: null
1033
1044
  }))
1034
- ), N(!1);
1045
+ ), C(!1);
1035
1046
  }, [w, n]), l = j((o) => {
1036
- const g = h.current.get(o);
1037
- g && g.abort(), h.current.delete(o), r((v) => v.filter((K) => K.id !== o));
1047
+ const h = g.current.get(o);
1048
+ h && h.abort(), g.current.delete(o), r((S) => S.filter((P) => P.id !== o));
1038
1049
  }, []), b = j(
1039
- (o, g) => {
1040
- d(o, (v) => ({ ...v, model: g }));
1050
+ (o, h) => {
1051
+ m(o, (S) => ({ ...S, model: h }));
1041
1052
  },
1042
- [d]
1043
- ), P = i.map((o) => ({
1053
+ [m]
1054
+ ), U = i.map((o) => ({
1044
1055
  label: o.modelName,
1045
1056
  value: o.modelName
1046
1057
  }));
1047
- return y ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Y, { tip: "加载模型列表..." }) }) : f ? /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
1058
+ return f ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载模型列表..." }) }) : _ ? /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
1048
1059
  /* @__PURE__ */ e("div", { className: t.chatHeader, children: /* @__PURE__ */ e("h3", { className: t.chatTitle, children: "模型对话" }) }),
1049
1060
  /* @__PURE__ */ s("div", { className: t.akEmpty, children: [
1050
1061
  "模型列表加载失败:",
1051
- f
1062
+ _
1052
1063
  ] })
1053
1064
  ] }) : /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
1054
1065
  /* @__PURE__ */ s("div", { className: t.chatHeader, children: [
1055
1066
  /* @__PURE__ */ s("h3", { className: t.chatTitle, children: [
1056
1067
  "模型对话",
1057
- n.length > 1 && /* @__PURE__ */ s(J, { color: "blue", style: { marginLeft: 12, fontSize: 12 }, children: [
1068
+ n.length > 1 && /* @__PURE__ */ s(W, { color: "blue", style: { marginLeft: 12, fontSize: 12 }, children: [
1058
1069
  n.length,
1059
1070
  " 个模型对比"
1060
1071
  ] })
1061
1072
  ] }),
1062
1073
  /* @__PURE__ */ e(
1063
- R,
1074
+ D,
1064
1075
  {
1065
1076
  size: "small",
1066
- icon: /* @__PURE__ */ e(Le, {}),
1077
+ icon: /* @__PURE__ */ e(Ue, {}),
1067
1078
  onClick: H,
1068
1079
  disabled: w || n.every((o) => o.messages.length === 0),
1069
1080
  children: "清空重新来"
@@ -1074,12 +1085,12 @@ function La({ initialModels: a }) {
1074
1085
  n.map((o) => /* @__PURE__ */ s("div", { className: t.chatPanel, children: [
1075
1086
  /* @__PURE__ */ s("div", { className: t.chatPanelHeader, children: [
1076
1087
  /* @__PURE__ */ e(
1077
- Ge,
1088
+ We,
1078
1089
  {
1079
1090
  size: "small",
1080
1091
  value: o.model,
1081
- onChange: (g) => b(o.id, g),
1082
- options: P,
1092
+ onChange: (h) => b(o.id, h),
1093
+ options: U,
1083
1094
  style: { minWidth: 140, flex: 1 },
1084
1095
  showSearch: !0,
1085
1096
  optionFilterProp: "label"
@@ -1090,7 +1101,7 @@ function La({ initialModels: a }) {
1090
1101
  {
1091
1102
  className: t.chatPanelClose,
1092
1103
  onClick: () => l(o.id),
1093
- children: /* @__PURE__ */ e(Oe, {})
1104
+ children: /* @__PURE__ */ e(Re, {})
1094
1105
  }
1095
1106
  )
1096
1107
  ] }),
@@ -1098,32 +1109,32 @@ function La({ initialModels: a }) {
1098
1109
  "div",
1099
1110
  {
1100
1111
  className: t.chatPanelBody,
1101
- ref: (g) => {
1102
- c.current.set(o.id, g);
1112
+ ref: (h) => {
1113
+ c.current.set(o.id, h);
1103
1114
  },
1104
1115
  children: [
1105
- o.messages.map((g, v) => /* @__PURE__ */ s(
1116
+ o.messages.map((h, S) => /* @__PURE__ */ s(
1106
1117
  "div",
1107
1118
  {
1108
- className: g.role === "user" ? t.chatMsgUser : t.chatMsgAI,
1119
+ className: h.role === "user" ? t.chatMsgUser : t.chatMsgAI,
1109
1120
  children: [
1110
- g.role === "assistant" ? Ea(g.content).map(
1111
- (K, I) => K.type === "think" ? /* @__PURE__ */ s(
1121
+ h.role === "assistant" ? La(h.content).map(
1122
+ (P, B) => P.type === "think" ? /* @__PURE__ */ s(
1112
1123
  "details",
1113
1124
  {
1114
1125
  className: t.chatThinkBlock,
1115
1126
  children: [
1116
1127
  /* @__PURE__ */ e("summary", { children: "思考过程" }),
1117
- /* @__PURE__ */ e("pre", { children: K.text })
1128
+ /* @__PURE__ */ e("pre", { children: P.text })
1118
1129
  ]
1119
1130
  },
1120
- I
1121
- ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: K.text }, I)
1122
- ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: g.content }),
1123
- o.isStreaming && v === o.messages.length - 1 && g.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
1131
+ B
1132
+ ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: P.text }, B)
1133
+ ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: h.content }),
1134
+ o.isStreaming && S === o.messages.length - 1 && h.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
1124
1135
  ]
1125
1136
  },
1126
- v
1137
+ S
1127
1138
  )),
1128
1139
  o.error && /* @__PURE__ */ e("div", { className: t.chatMsgError, children: o.error }),
1129
1140
  o.usage && /* @__PURE__ */ s("div", { className: t.chatUsageBar, children: [
@@ -1140,33 +1151,33 @@ function La({ initialModels: a }) {
1140
1151
  }
1141
1152
  )
1142
1153
  ] }, o.id)),
1143
- n.length < oe && /* @__PURE__ */ e(Q, { title: "添加面板", children: /* @__PURE__ */ e("div", { className: t.addPanelBtn, onClick: W, children: /* @__PURE__ */ e(xe, {}) }) })
1154
+ n.length < re && /* @__PURE__ */ e(Y, { title: "添加面板", children: /* @__PURE__ */ e("div", { className: t.addPanelBtn, onClick: Q, children: /* @__PURE__ */ e(Te, {}) }) })
1144
1155
  ] }),
1145
1156
  /* @__PURE__ */ s("div", { className: t.chatInputBar, children: [
1146
1157
  /* @__PURE__ */ e(
1147
- Se.TextArea,
1158
+ pe.TextArea,
1148
1159
  {
1149
1160
  className: t.chatInput,
1150
- value: B,
1151
- onChange: (o) => L(o.target.value),
1161
+ value: z,
1162
+ onChange: (o) => O(o.target.value),
1152
1163
  placeholder: "输入消息,所有面板将同时收到并流式输出...",
1153
1164
  autoSize: { minRows: 1, maxRows: 4 },
1154
1165
  onPressEnter: (o) => {
1155
- o.shiftKey || (o.preventDefault(), M());
1166
+ o.shiftKey || (o.preventDefault(), I());
1156
1167
  },
1157
1168
  disabled: w
1158
1169
  }
1159
1170
  ),
1160
- w ? /* @__PURE__ */ e(R, { danger: !0, onClick: q, children: "停止" }) : /* @__PURE__ */ s(R, { type: "primary", onClick: M, disabled: !B.trim(), children: [
1161
- /* @__PURE__ */ e(Ue, {}),
1171
+ w ? /* @__PURE__ */ e(D, { danger: !0, onClick: G, children: "停止" }) : /* @__PURE__ */ s(D, { type: "primary", onClick: I, disabled: !z.trim(), children: [
1172
+ /* @__PURE__ */ e(De, {}),
1162
1173
  " 发送"
1163
1174
  ] })
1164
1175
  ] })
1165
1176
  ] });
1166
1177
  }
1167
- function ue(a) {
1178
+ function ge(a) {
1168
1179
  return {
1169
- id: ++$a,
1180
+ id: ++Oa,
1170
1181
  model: a,
1171
1182
  messages: [],
1172
1183
  streamingContent: "",
@@ -1175,40 +1186,40 @@ function ue(a) {
1175
1186
  usage: null
1176
1187
  };
1177
1188
  }
1178
- function Oa({ onStartChat: a }) {
1179
- const [n, r] = x([]), [i, m] = x(!0), [y, C] = x(null), [f, p] = x(/* @__PURE__ */ new Set()), B = () => {
1180
- m(!0), C(null), pe().then((c) => {
1181
- r(c), m(!1);
1189
+ function Ra({ onStartChat: a }) {
1190
+ const [n, r] = N([]), [i, u] = N(!0), [f, y] = N(null), [_, p] = N(/* @__PURE__ */ new Set()), z = () => {
1191
+ u(!0), y(null), fe().then((c) => {
1192
+ r(c), u(!1);
1182
1193
  }).catch((c) => {
1183
- r([]), C(c instanceof Error ? c.message : "加载失败"), m(!1);
1194
+ r([]), y(c instanceof Error ? c.message : "加载失败"), u(!1);
1184
1195
  });
1185
1196
  };
1186
- X(() => {
1187
- B();
1197
+ Z(() => {
1198
+ z();
1188
1199
  }, []);
1189
- const L = (c) => {
1200
+ const O = (c) => {
1190
1201
  p((k) => {
1191
- const d = new Set(k);
1192
- return d.has(c) ? d.delete(c) : d.add(c), d;
1202
+ const m = new Set(k);
1203
+ return m.has(c) ? m.delete(c) : m.add(c), m;
1193
1204
  });
1194
- }, w = Array.from(f), N = (c) => {
1205
+ }, w = Array.from(_), C = (c) => {
1195
1206
  a([c]);
1196
- }, T = () => {
1207
+ }, v = () => {
1197
1208
  w.length > 0 && a(w);
1198
- }, h = (c) => {
1209
+ }, g = (c) => {
1199
1210
  if (!c) return "default";
1200
1211
  const k = c.toLowerCase();
1201
1212
  return k.includes("aliyun") || k.includes("ali") ? "blue" : k.includes("zhipu") || k.includes("glm") ? "purple" : k.includes("moonshot") || k.includes("kimi") ? "cyan" : k.includes("minimax") ? "orange" : "default";
1202
1213
  };
1203
- return i ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Y, { tip: "加载模型列表..." }) }) : y ? /* @__PURE__ */ s("div", { children: [
1214
+ return i ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载模型列表..." }) }) : f ? /* @__PURE__ */ s("div", { children: [
1204
1215
  /* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
1205
1216
  /* @__PURE__ */ e("h3", { className: t.modelMgmtTitle, children: "模型管理" }),
1206
1217
  /* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "数据库管理的可用模型,可选择单个或多个模型发起对话对比" })
1207
1218
  ] }),
1208
1219
  /* @__PURE__ */ s("div", { className: t.akEmpty, children: [
1209
1220
  "模型列表加载失败:",
1210
- y,
1211
- /* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(R, { type: "primary", onClick: B, children: "重试" }) })
1221
+ f,
1222
+ /* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(D, { type: "primary", onClick: z, children: "重试" }) })
1212
1223
  ] })
1213
1224
  ] }) : /* @__PURE__ */ s("div", { children: [
1214
1225
  /* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
@@ -1217,48 +1228,48 @@ function Oa({ onStartChat: a }) {
1217
1228
  ] }),
1218
1229
  n.length === 0 && /* @__PURE__ */ e("div", { className: t.akEmpty, children: "后端暂无启用模型(z_team_model_config 中 enable=1 的行),请先在数据库或网关配置中启用" }),
1219
1230
  /* @__PURE__ */ e("div", { className: t.modelGrid, children: n.map((c) => {
1220
- const k = f.has(c.modelName);
1231
+ const k = _.has(c.modelName);
1221
1232
  return /* @__PURE__ */ s(
1222
1233
  "div",
1223
1234
  {
1224
1235
  className: `${t.modelCard} ${k ? t.modelCardSelected : ""}`,
1225
- onClick: () => L(c.modelName),
1236
+ onClick: () => O(c.modelName),
1226
1237
  children: [
1227
1238
  /* @__PURE__ */ e(
1228
- Je,
1239
+ Qe,
1229
1240
  {
1230
1241
  className: t.modelCheckbox,
1231
1242
  checked: k,
1232
- onChange: (d) => {
1233
- d.stopPropagation(), L(c.modelName);
1243
+ onChange: (m) => {
1244
+ m.stopPropagation(), O(c.modelName);
1234
1245
  }
1235
1246
  }
1236
1247
  ),
1237
1248
  /* @__PURE__ */ s("div", { className: t.modelCardHeader, children: [
1238
- /* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(ve, {}) }),
1249
+ /* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(Se, {}) }),
1239
1250
  /* @__PURE__ */ s("div", { className: t.modelCardInfo, children: [
1240
1251
  /* @__PURE__ */ e("h4", { className: t.modelName, children: c.modelName }),
1241
1252
  /* @__PURE__ */ s("div", { className: t.modelTags, children: [
1242
1253
  c.modelProvider && /* @__PURE__ */ e(
1243
- J,
1254
+ W,
1244
1255
  {
1245
- color: h(c.modelProvider),
1256
+ color: g(c.modelProvider),
1246
1257
  style: { fontSize: 11, margin: 0 },
1247
1258
  children: c.modelProvider
1248
1259
  }
1249
1260
  ),
1250
- /* @__PURE__ */ e(J, { style: { fontSize: 11, margin: 0 }, children: c.apiType })
1261
+ /* @__PURE__ */ e(W, { style: { fontSize: 11, margin: 0 }, children: c.apiType })
1251
1262
  ] })
1252
1263
  ] })
1253
1264
  ] }),
1254
1265
  /* @__PURE__ */ e("p", { className: t.modelEndpoint, children: c.endpoint }),
1255
1266
  /* @__PURE__ */ e("div", { className: t.modelCardFooter, children: /* @__PURE__ */ e(
1256
- R,
1267
+ D,
1257
1268
  {
1258
1269
  type: "link",
1259
1270
  size: "small",
1260
- onClick: (d) => {
1261
- d.stopPropagation(), N(c.modelName);
1271
+ onClick: (m) => {
1272
+ m.stopPropagation(), C(c.modelName);
1262
1273
  },
1263
1274
  children: "发起对话"
1264
1275
  }
@@ -1275,10 +1286,10 @@ function Oa({ onStartChat: a }) {
1275
1286
  " 个模型"
1276
1287
  ] }),
1277
1288
  /* @__PURE__ */ e(
1278
- R,
1289
+ D,
1279
1290
  {
1280
1291
  type: "primary",
1281
- onClick: T,
1292
+ onClick: v,
1282
1293
  disabled: w.length === 0,
1283
1294
  children: "批量对比"
1284
1295
  }
@@ -1286,64 +1297,64 @@ function Oa({ onStartChat: a }) {
1286
1297
  ] })
1287
1298
  ] });
1288
1299
  }
1289
- const Ua = "_container_15pgq_5", Ra = "_page_15pgq_10", Da = "_kpiGrid_15pgq_16", Ha = "_kpiCard_15pgq_22", Fa = "_sectionCard_15pgq_29", ja = "_sectionHead_15pgq_36", qa = "_sectionHint_15pgq_42", Ga = "_akList_15pgq_47", Ja = "_errorState_15pgq_54", Wa = "_errorTitle_15pgq_66", Qa = "_errorDetail_15pgq_72", $ = {
1290
- container: Ua,
1291
- page: Ra,
1292
- kpiGrid: Da,
1293
- kpiCard: Ha,
1294
- sectionCard: Fa,
1295
- sectionHead: ja,
1296
- sectionHint: qa,
1297
- akList: Ga,
1298
- errorState: Ja,
1299
- errorTitle: Wa,
1300
- errorDetail: Qa
1301
- }, Va = Qe(
1300
+ const Da = "_container_15pgq_5", Ha = "_page_15pgq_10", Fa = "_kpiGrid_15pgq_16", ja = "_kpiCard_15pgq_22", qa = "_sectionCard_15pgq_29", Ga = "_sectionHead_15pgq_36", Ja = "_sectionHint_15pgq_42", Wa = "_akList_15pgq_47", Qa = "_errorState_15pgq_54", Va = "_errorTitle_15pgq_66", Ya = "_errorDetail_15pgq_72", L = {
1301
+ container: Da,
1302
+ page: Ha,
1303
+ kpiGrid: Fa,
1304
+ kpiCard: ja,
1305
+ sectionCard: qa,
1306
+ sectionHead: Ga,
1307
+ sectionHint: Ja,
1308
+ akList: Wa,
1309
+ errorState: Qa,
1310
+ errorTitle: Va,
1311
+ errorDetail: Ya
1312
+ }, Xa = Ye(
1302
1313
  () => import("@yuku123/z-agent-component").then((a) => ({ default: a.AgentDashboard }))
1303
1314
  );
1304
- function te(a) {
1315
+ function ae(a) {
1305
1316
  return a >= 1e6 ? `${(a / 1e6).toFixed(2)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : String(a ?? 0);
1306
1317
  }
1307
- function Ya({ daily: a }) {
1318
+ function Za({ daily: a }) {
1308
1319
  const n = Object.entries(a);
1309
1320
  if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
1310
1321
  const r = Math.max(...n.map(([, i]) => i[1] + i[2]), 1);
1311
- return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([i, m]) => {
1312
- const y = m[1] + m[2];
1322
+ return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([i, u]) => {
1323
+ const f = u[1] + u[2];
1313
1324
  return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
1314
- /* @__PURE__ */ e(Q, { title: `${i}: ${m[0]}次 / ${y} tokens`, children: /* @__PURE__ */ e(
1325
+ /* @__PURE__ */ e(Y, { title: `${i}: ${u[0]}次 / ${f} tokens`, children: /* @__PURE__ */ e(
1315
1326
  "div",
1316
1327
  {
1317
1328
  className: t.usageBar,
1318
- style: { height: `${Math.max(y / r * 100, 2)}%` }
1329
+ style: { height: `${Math.max(f / r * 100, 2)}%` }
1319
1330
  }
1320
1331
  ) }),
1321
1332
  /* @__PURE__ */ e("span", { className: t.usageBarLabel, children: i })
1322
1333
  ] }, i);
1323
1334
  }) });
1324
1335
  }
1325
- function Ce({ models: a }) {
1336
+ function xe({ models: a }) {
1326
1337
  const n = Object.entries(a);
1327
1338
  if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
1328
1339
  const r = Math.max(...n.map(([, i]) => i[0]), 1);
1329
- return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((i, m) => m[1][0] - i[1][0]).map(([i, m]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
1340
+ return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((i, u) => u[1][0] - i[1][0]).map(([i, u]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
1330
1341
  /* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: i }),
1331
1342
  /* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
1332
1343
  "div",
1333
1344
  {
1334
1345
  className: t.modelBreakdownFill,
1335
- style: { width: `${m[0] / r * 100}%` }
1346
+ style: { width: `${u[0] / r * 100}%` }
1336
1347
  }
1337
1348
  ) }),
1338
1349
  /* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
1339
- m[0],
1350
+ u[0],
1340
1351
  "次 / ",
1341
- te(m[1] + (m[2] || 0)),
1352
+ ae(u[1] + (u[2] || 0)),
1342
1353
  "tokens"
1343
1354
  ] })
1344
1355
  ] }, i)) });
1345
1356
  }
1346
- const Xa = [
1357
+ const en = [
1347
1358
  {
1348
1359
  title: "时间",
1349
1360
  dataIndex: "createTime",
@@ -1352,7 +1363,7 @@ const Xa = [
1352
1363
  render: (a) => a ? new Date(a).toLocaleString("zh-CN") : "-"
1353
1364
  },
1354
1365
  { title: "模型", dataIndex: "model", key: "model", width: 150 },
1355
- { title: "协议", dataIndex: "protocol", key: "protocol", width: 90, render: (a) => /* @__PURE__ */ e(J, { children: a }) },
1366
+ { title: "协议", dataIndex: "protocol", key: "protocol", width: 90, render: (a) => /* @__PURE__ */ e(W, { children: a }) },
1356
1367
  { title: "输入", dataIndex: "promptTokens", key: "promptTokens", width: 70 },
1357
1368
  { title: "输出", dataIndex: "completionTokens", key: "completionTokens", width: 70 },
1358
1369
  { title: "总Token", dataIndex: "totalTokens", key: "totalTokens", width: 80 },
@@ -1362,63 +1373,63 @@ const Xa = [
1362
1373
  dataIndex: "statusCode",
1363
1374
  key: "statusCode",
1364
1375
  width: 60,
1365
- render: (a) => a ? /* @__PURE__ */ e(J, { color: a < 400 ? "green" : "red", children: a }) : "-"
1376
+ render: (a) => a ? /* @__PURE__ */ e(W, { color: a < 400 ? "green" : "red", children: a }) : "-"
1366
1377
  }
1367
1378
  ];
1368
- function Za(a) {
1379
+ function tn(a) {
1369
1380
  var n;
1370
1381
  return ((n = a == null ? void 0 : a.stats) == null ? void 0 : n.recent) ?? [];
1371
1382
  }
1372
- function en() {
1373
- var k, d, A, M, q, W, H;
1374
- const [a, n] = x(!0), [r, i] = x(null), [m, y] = x([]), [C, f] = x(null), [p, B] = x(null), L = String(ze((l) => {
1383
+ function an() {
1384
+ var k, m, A, I, G, Q, H;
1385
+ const [a, n] = N(!0), [r, i] = N(null), [u, f] = N([]), [y, _] = N(null), [p, z] = N(null), O = String(Me((l) => {
1375
1386
  var b;
1376
1387
  return ((b = l.currentUser) == null ? void 0 : b.id) ?? "";
1377
1388
  })), w = Array.from(
1378
- new Set([L, Me].filter((l) => l !== ""))
1379
- ), N = j(async () => {
1389
+ new Set([O, Ie].filter((l) => l !== ""))
1390
+ ), C = j(async () => {
1380
1391
  n(!0), i(null);
1381
1392
  try {
1382
1393
  const l = await Promise.allSettled(
1383
- w.map((I) => le(I))
1384
- ), b = [], P = /* @__PURE__ */ new Set();
1394
+ w.map((B) => ie(B))
1395
+ ), b = [], U = /* @__PURE__ */ new Set();
1385
1396
  let o = 0;
1386
- for (const I of l)
1387
- if (I.status === "fulfilled")
1388
- for (const z of I.value) {
1389
- const O = String(z.id ?? z.akPrefix ?? "");
1390
- P.has(O) || (P.add(O), b.push(z));
1397
+ for (const B of l)
1398
+ if (B.status === "fulfilled")
1399
+ for (const M of B.value) {
1400
+ const q = String(M.id ?? M.akPrefix ?? "");
1401
+ U.has(q) || (U.add(q), b.push(M));
1391
1402
  }
1392
1403
  else o += 1;
1393
1404
  if (o === l.length)
1394
1405
  throw new Error("网关不可达:无法获取 AK 列表");
1395
- b.sort((I, z) => (I.id ?? 0) - (z.id ?? 0));
1396
- let g = null, v = null;
1406
+ b.sort((B, M) => (B.id ?? 0) - (M.id ?? 0));
1407
+ let h = null, S = null;
1397
1408
  try {
1398
- g = await be(0);
1399
- } catch (I) {
1400
- v = I instanceof Error ? I.message : "获取用量失败";
1409
+ h = await Pe(0);
1410
+ } catch (B) {
1411
+ S = B instanceof Error ? B.message : "获取用量失败";
1401
1412
  }
1402
- f(g);
1403
- const K = b.map((I) => ({
1404
- key: I,
1405
- stats: g,
1406
- statsError: v
1413
+ _(h);
1414
+ const P = b.map((B) => ({
1415
+ key: B,
1416
+ stats: h,
1417
+ statsError: S
1407
1418
  }));
1408
- y(K);
1419
+ f(P);
1409
1420
  } catch (l) {
1410
1421
  i(l instanceof Error ? l.message : "加载失败");
1411
1422
  } finally {
1412
1423
  n(!1);
1413
1424
  }
1414
1425
  }, [w.join(",")]);
1415
- X(() => {
1416
- N();
1417
- }, [N]);
1418
- const T = Be(() => {
1419
- const l = C, b = {};
1420
- for (const [P, o] of Object.entries((l == null ? void 0 : l.models) ?? {}))
1421
- b[P] = [o[0] ?? 0, o[1] ?? 0, o[2] ?? 0];
1426
+ Z(() => {
1427
+ C();
1428
+ }, [C]);
1429
+ const v = ze(() => {
1430
+ const l = y, b = {};
1431
+ for (const [U, o] of Object.entries((l == null ? void 0 : l.models) ?? {}))
1432
+ b[U] = [o[0] ?? 0, o[1] ?? 0, o[2] ?? 0];
1422
1433
  return {
1423
1434
  requests: (l == null ? void 0 : l.totalRequests) ?? 0,
1424
1435
  tokens: (l == null ? void 0 : l.totalTokens) ?? 0,
@@ -1426,40 +1437,40 @@ function en() {
1426
1437
  errors: (l == null ? void 0 : l.errorCount) ?? 0,
1427
1438
  models: b
1428
1439
  };
1429
- }, [C]), h = m.reduce((l, b) => l + (b.key.tokenQuota || 0), 0), c = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Y, { tip: "加载监控数据..." }) }) : r ? /* @__PURE__ */ s("div", { className: $.errorState, children: [
1430
- /* @__PURE__ */ e("div", { className: $.errorTitle, children: "模型监控数据加载失败" }),
1431
- /* @__PURE__ */ e("div", { className: $.errorDetail, children: r }),
1432
- /* @__PURE__ */ e(R, { icon: /* @__PURE__ */ e(Ne, {}), onClick: N, type: "primary", children: "重试" })
1433
- ] }) : /* @__PURE__ */ s("div", { className: $.page, children: [
1434
- /* @__PURE__ */ s("div", { className: $.kpiGrid, children: [
1435
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(E, { title: "总请求(近7天)", value: T.requests }) }),
1436
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(E, { title: "总 Tokens", value: te(T.tokens) }) }),
1437
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(E, { title: "平均延迟", value: T.avgLatency, suffix: "ms" }) }),
1438
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(
1439
- E,
1440
+ }, [y]), g = u.reduce((l, b) => l + (b.key.tokenQuota || 0), 0), c = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载监控数据..." }) }) : r ? /* @__PURE__ */ s("div", { className: L.errorState, children: [
1441
+ /* @__PURE__ */ e("div", { className: L.errorTitle, children: "模型监控数据加载失败" }),
1442
+ /* @__PURE__ */ e("div", { className: L.errorDetail, children: r }),
1443
+ /* @__PURE__ */ e(D, { icon: /* @__PURE__ */ e(ve, {}), onClick: C, type: "primary", children: "重试" })
1444
+ ] }) : /* @__PURE__ */ s("div", { className: L.page, children: [
1445
+ /* @__PURE__ */ s("div", { className: L.kpiGrid, children: [
1446
+ /* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "总请求(近7天)", value: v.requests }) }),
1447
+ /* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "总 Tokens", value: ae(v.tokens) }) }),
1448
+ /* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "平均延迟", value: v.avgLatency, suffix: "ms" }) }),
1449
+ /* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(
1450
+ K,
1440
1451
  {
1441
1452
  title: "错误数",
1442
- value: T.errors,
1443
- valueStyle: T.errors > 0 ? { color: "#ff4d4f" } : void 0
1453
+ value: v.errors,
1454
+ valueStyle: v.errors > 0 ? { color: "#ff4d4f" } : void 0
1444
1455
  }
1445
1456
  ) })
1446
1457
  ] }),
1447
- /* @__PURE__ */ s("div", { className: $.sectionCard, children: [
1448
- /* @__PURE__ */ s("div", { className: $.sectionHead, children: [
1458
+ /* @__PURE__ */ s("div", { className: L.sectionCard, children: [
1459
+ /* @__PURE__ */ s("div", { className: L.sectionHead, children: [
1449
1460
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "AK 用量" }),
1450
- h > 0 && /* @__PURE__ */ s("span", { className: $.sectionHint, children: [
1461
+ g > 0 && /* @__PURE__ */ s("span", { className: L.sectionHint, children: [
1451
1462
  "合计额度 ",
1452
- te(h),
1463
+ ae(g),
1453
1464
  " tokens"
1454
1465
  ] })
1455
1466
  ] }),
1456
- m.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: $.akList, children: m.map((l) => {
1457
- const b = l.key.totalTokens ?? 0, P = l.key.tokenQuota || 0, o = P > 0 ? Math.min(b / P * 100, 100) : 0;
1467
+ u.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: L.akList, children: u.map((l) => {
1468
+ const b = l.key.totalTokens ?? 0, U = l.key.tokenQuota || 0, o = U > 0 ? Math.min(b / U * 100, 100) : 0;
1458
1469
  return /* @__PURE__ */ s(
1459
1470
  "div",
1460
1471
  {
1461
1472
  className: t.akCard,
1462
- onClick: () => B(l),
1473
+ onClick: () => z(l),
1463
1474
  children: [
1464
1475
  /* @__PURE__ */ s("div", { className: t.akCardRow, children: [
1465
1476
  /* @__PURE__ */ e("span", { className: t.akTitle, children: l.key.description || l.key.userName || `AK #${l.key.id}` }),
@@ -1482,8 +1493,8 @@ function en() {
1482
1493
  }
1483
1494
  ) }),
1484
1495
  /* @__PURE__ */ s("span", { className: t.akUsageText, children: [
1485
- te(b),
1486
- P > 0 ? ` / ${te(P)}` : "",
1496
+ ae(b),
1497
+ U > 0 ? ` / ${ae(U)}` : "",
1487
1498
  " tokens"
1488
1499
  ] }),
1489
1500
  /* @__PURE__ */ e("span", { className: t.akMetaText, children: l.statsError ? l.statsError : l.key.lastUsedAt ? `最近使用 ${l.key.lastUsedAt}` : "尚未使用" })
@@ -1494,18 +1505,18 @@ function en() {
1494
1505
  );
1495
1506
  }) })
1496
1507
  ] }),
1497
- /* @__PURE__ */ s("div", { className: $.sectionCard, children: [
1508
+ /* @__PURE__ */ s("div", { className: L.sectionCard, children: [
1498
1509
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(网关全局)" }),
1499
- /* @__PURE__ */ e(Ce, { models: T.models })
1510
+ /* @__PURE__ */ e(xe, { models: v.models })
1500
1511
  ] })
1501
1512
  ] });
1502
- return /* @__PURE__ */ s("div", { className: $.container, children: [
1513
+ return /* @__PURE__ */ s("div", { className: L.container, children: [
1503
1514
  /* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
1504
1515
  /* @__PURE__ */ e("h2", { className: t.modelMgmtTitle, children: "模型监控" }),
1505
1516
  /* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "大模型网关管控视图 — 网关全局聚合调用量、Tokens 与延迟(近 7 天)" })
1506
1517
  ] }),
1507
1518
  /* @__PURE__ */ e(
1508
- Te,
1519
+ we,
1509
1520
  {
1510
1521
  defaultActiveKey: "usage",
1511
1522
  items: [
@@ -1513,59 +1524,59 @@ function en() {
1513
1524
  {
1514
1525
  key: "sessions",
1515
1526
  label: "会话统计",
1516
- children: /* @__PURE__ */ e(We, { fallback: /* @__PURE__ */ e(Y, { tip: "加载会话统计..." }), children: /* @__PURE__ */ e(Va, {}) })
1527
+ children: /* @__PURE__ */ e(Ve, { fallback: /* @__PURE__ */ e(X, { tip: "加载会话统计..." }), children: /* @__PURE__ */ e(Xa, {}) })
1517
1528
  }
1518
1529
  ]
1519
1530
  }
1520
1531
  ),
1521
1532
  /* @__PURE__ */ e(
1522
- we,
1533
+ Ae,
1523
1534
  {
1524
1535
  title: p ? `AK 用量 — ${p.key.description || p.key.akPrefix}` : "",
1525
1536
  width: 860,
1526
1537
  open: !!p,
1527
- onClose: () => B(null),
1538
+ onClose: () => z(null),
1528
1539
  destroyOnHidden: !0,
1529
1540
  children: p && /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
1530
1541
  /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "调用监控是网关全局维度(不按 AK 留存),以下统计覆盖全部 AK; 该 AK 自身的累计消耗见「本 AK 累计 Token」。" }),
1531
1542
  /* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
1532
- /* @__PURE__ */ e(E, { title: "总请求", value: ((k = p.stats) == null ? void 0 : k.totalRequests) ?? 0 }),
1533
- /* @__PURE__ */ e(E, { title: "总 Tokens", value: ((d = p.stats) == null ? void 0 : d.totalTokens) ?? 0 }),
1534
- /* @__PURE__ */ e(E, { title: "平均延迟", value: ((A = p.stats) == null ? void 0 : A.avgLatencyMs) ?? 0, suffix: "ms" }),
1535
- /* @__PURE__ */ e(E, { title: "输入 Tokens", value: ((M = p.stats) == null ? void 0 : M.totalPromptTokens) ?? 0 }),
1536
- /* @__PURE__ */ e(E, { title: "输出 Tokens", value: ((q = p.stats) == null ? void 0 : q.totalCompletionTokens) ?? 0 }),
1543
+ /* @__PURE__ */ e(K, { title: "总请求", value: ((k = p.stats) == null ? void 0 : k.totalRequests) ?? 0 }),
1544
+ /* @__PURE__ */ e(K, { title: "总 Tokens", value: ((m = p.stats) == null ? void 0 : m.totalTokens) ?? 0 }),
1545
+ /* @__PURE__ */ e(K, { title: "平均延迟", value: ((A = p.stats) == null ? void 0 : A.avgLatencyMs) ?? 0, suffix: "ms" }),
1546
+ /* @__PURE__ */ e(K, { title: "输入 Tokens", value: ((I = p.stats) == null ? void 0 : I.totalPromptTokens) ?? 0 }),
1547
+ /* @__PURE__ */ e(K, { title: "输出 Tokens", value: ((G = p.stats) == null ? void 0 : G.totalCompletionTokens) ?? 0 }),
1537
1548
  /* @__PURE__ */ e(
1538
- E,
1549
+ K,
1539
1550
  {
1540
1551
  title: "本 AK 累计 Token",
1541
1552
  value: p.key.totalTokens ?? 0
1542
1553
  }
1543
1554
  ),
1544
1555
  /* @__PURE__ */ e(
1545
- E,
1556
+ K,
1546
1557
  {
1547
1558
  title: "错误数",
1548
- value: ((W = p.stats) == null ? void 0 : W.errorCount) ?? 0,
1559
+ value: ((Q = p.stats) == null ? void 0 : Q.errorCount) ?? 0,
1549
1560
  valueStyle: (((H = p.stats) == null ? void 0 : H.errorCount) ?? 0) > 0 ? { color: "#ff4d4f" } : void 0
1550
1561
  }
1551
1562
  )
1552
1563
  ] }),
1553
1564
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
1554
1565
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "每日用量(按最近调用明细聚合)" }),
1555
- p.stats ? /* @__PURE__ */ e(Ya, { daily: p.stats.daily ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
1566
+ p.stats ? /* @__PURE__ */ e(Za, { daily: p.stats.daily ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
1556
1567
  ] }),
1557
1568
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
1558
1569
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(按最近调用明细聚合)" }),
1559
- p.stats ? /* @__PURE__ */ e(Ce, { models: p.stats.models ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
1570
+ p.stats ? /* @__PURE__ */ e(xe, { models: p.stats.models ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
1560
1571
  ] }),
1561
1572
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
1562
1573
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "最近调用" }),
1563
1574
  /* @__PURE__ */ e(
1564
- Ae,
1575
+ Be,
1565
1576
  {
1566
1577
  size: "small",
1567
- columns: Xa,
1568
- dataSource: Za(p),
1578
+ columns: en,
1579
+ dataSource: tn(p),
1569
1580
  rowKey: "id",
1570
1581
  pagination: {
1571
1582
  pageSize: 8,
@@ -1581,49 +1592,49 @@ function en() {
1581
1592
  )
1582
1593
  ] });
1583
1594
  }
1584
- const tn = [
1585
- { key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(Re, {}) },
1586
- { key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(De, {}) },
1587
- { key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(He, {}) },
1588
- { key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(ve, {}) },
1589
- { key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(Fe, {}) },
1590
- { key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(je, {}) },
1591
- { key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(qe, {}) }
1595
+ const nn = [
1596
+ { key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(He, {}) },
1597
+ { key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(Fe, {}) },
1598
+ { key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(je, {}) },
1599
+ { key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(Se, {}) },
1600
+ { key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(qe, {}) },
1601
+ { key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(Ge, {}) },
1602
+ { key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(Je, {}) }
1592
1603
  ];
1593
- function cn() {
1594
- const [a, n] = x("model-management"), [r, i] = x([]), m = (f) => {
1595
- i(f), n("model-chat");
1596
- }, y = Be(() => tn, []), C = (f, p, B = !1) => /* @__PURE__ */ e(
1604
+ function mn() {
1605
+ const [a, n] = N("model-management"), [r, i] = N([]), u = (_) => {
1606
+ i(_), n("model-chat");
1607
+ }, f = ze(() => nn, []), y = (_, p, z = !1) => /* @__PURE__ */ e(
1597
1608
  "div",
1598
1609
  {
1599
1610
  style: {
1600
- display: a === f ? B ? "flex" : "block" : "none",
1611
+ display: a === _ ? z ? "flex" : "block" : "none",
1601
1612
  height: "100%",
1602
- ...B ? { flexDirection: "column" } : {}
1613
+ ...z ? { flexDirection: "column" } : {}
1603
1614
  },
1604
1615
  children: p
1605
1616
  }
1606
1617
  );
1607
1618
  return /* @__PURE__ */ s("div", { className: t.container, children: [
1608
- /* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children: y.map((f) => /* @__PURE__ */ e(Q, { title: f.label, placement: "right", children: /* @__PURE__ */ e(
1619
+ /* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children: f.map((_) => /* @__PURE__ */ e(Y, { title: _.label, placement: "right", children: /* @__PURE__ */ e(
1609
1620
  "div",
1610
1621
  {
1611
- className: `${t.menuItem} ${a === f.key ? t.menuItemActive : ""}`,
1612
- onClick: () => n(f.key),
1613
- children: /* @__PURE__ */ e("span", { className: t.menuIcon, children: f.icon })
1622
+ className: `${t.menuItem} ${a === _.key ? t.menuItemActive : ""}`,
1623
+ onClick: () => n(_.key),
1624
+ children: /* @__PURE__ */ e("span", { className: t.menuIcon, children: _.icon })
1614
1625
  }
1615
- ) }, f.key)) }) }),
1626
+ ) }, _.key)) }) }),
1616
1627
  /* @__PURE__ */ s("main", { className: t.panelArea, children: [
1617
- C("model-management", /* @__PURE__ */ e(Oa, { onStartChat: m })),
1618
- C("model-chat", /* @__PURE__ */ e(La, { initialModels: r }), !0),
1619
- C("ak-management", /* @__PURE__ */ e(Ka, {})),
1620
- C("agent-app", /* @__PURE__ */ e(Ve, {})),
1621
- C("mcp-service", /* @__PURE__ */ e(Ye, {})),
1622
- C("skill-market", /* @__PURE__ */ e(Xe, {})),
1623
- C("model-monitor", /* @__PURE__ */ e(en, {}))
1628
+ y("model-management", /* @__PURE__ */ e(Ra, { onStartChat: u })),
1629
+ y("model-chat", /* @__PURE__ */ e(Ua, { initialModels: r }), !0),
1630
+ y("ak-management", /* @__PURE__ */ e($a, {})),
1631
+ y("agent-app", /* @__PURE__ */ e(Xe, {})),
1632
+ y("mcp-service", /* @__PURE__ */ e(Ze, {})),
1633
+ y("skill-market", /* @__PURE__ */ e(et, {})),
1634
+ y("model-monitor", /* @__PURE__ */ e(an, {}))
1624
1635
  ] })
1625
1636
  ] });
1626
1637
  }
1627
1638
  export {
1628
- cn as default
1639
+ mn as default
1629
1640
  };