@yuku123/z-team-component 0.2.80 → 0.2.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChangeLogView-_bRZ55Yi.js +542 -0
- package/dist/ComponentDoc-BFoF51we.js +3998 -0
- package/dist/InvitationManagementPage-CTPCZXHu.js +495 -0
- package/dist/OnboardingPage-DwtuTL61.js +393 -0
- package/dist/ScheduledTasks-yeTm2bOY.js +9407 -0
- package/dist/SystemShell-D9OzKxL-.js +689 -0
- package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
- package/dist/api-CIhVblfa.js +2155 -0
- package/dist/api-DXLNhtCX.js +20 -0
- package/dist/browser-jb_PFvU3.js +1538 -0
- package/dist/createWorkspaceWsHandler-BWP5S5X3.js +12951 -0
- package/dist/ctc-sso-DtJHC-2M.js +117 -0
- package/dist/echarts-B1OU1xr4.js +16 -0
- package/dist/history-BlrA1eaW.js +41 -0
- package/dist/index-BCp5EtqR.js +914 -0
- package/dist/index-BHrMl3Jq.js +9585 -0
- package/dist/index-BP7WTzVH.js +137 -0
- package/dist/index-B_LJRFsK.js +339 -0
- package/dist/index-BgIheStI.js +133 -0
- package/dist/index-BohoJQPr.js +7631 -0
- package/dist/index-BydWNuk5.js +1229 -0
- package/dist/index-C815hPWS.js +430 -0
- package/dist/index-CBQMS6rx.js +178 -0
- package/dist/index-CESmMALI.js +242 -0
- package/dist/index-CUVdeb8y.js +638 -0
- package/dist/index-CijskN6t.js +316 -0
- package/dist/index-CoBZZQBy.js +112 -0
- package/dist/index-Co_0idJY.js +2936 -0
- package/dist/index-Cvx6rrxD.js +956 -0
- package/dist/index-Cwr5Slv1.js +480 -0
- package/dist/index-CxFAICql.js +42050 -0
- package/dist/index-DK70mOTz.js +143 -0
- package/dist/index-DT80Pwa_.js +5893 -0
- package/dist/index-DWsfQMp8.js +208 -0
- package/dist/index-DhDdFRHC.js +279 -0
- package/dist/index-Dm3wmB0K.js +435 -0
- package/dist/index-DzS6-D3M.js +1640 -0
- package/dist/index-PKkV63Sw.js +1143 -0
- package/dist/index-SbMjh8t4.js +574 -0
- package/dist/index-cdB5K3gx.js +814 -0
- package/dist/index-mnWs_wA3.js +93 -0
- package/dist/index-nU-V276i.js +170 -0
- package/dist/index-nW0ikV2R.js +2700 -0
- package/dist/index-uF04Ucsi.js +8 -0
- package/dist/index-x_7Rmav9.js +118 -0
- package/dist/index.js +10 -0
- package/dist/index.module-CAa-2T7m.js +72 -0
- package/dist/index.module-UI0iz8K0.js +42 -0
- package/dist/{menuPermission-D9NGpBZP.js → menuPermission-DHUqvHfu.js} +1 -1
- package/dist/pages.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { jsxs as m, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { message as T } from "antd";
|
|
3
|
+
import { useState as b, useRef as D, useCallback as K, useEffect as J } from "react";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const X = "/z-team", Y = typeof window < "u" && window.ZTEAM_USE_KAPI === !0, Z = Y, G = window.ENV_TYPE || window.envType || "", x = `${Z ? "/kapi" : ""}${X}/api/chatdemo`, Q = G || "local", $ = {
|
|
6
|
+
Accept: "application/json",
|
|
7
|
+
"project-env": Q
|
|
8
|
+
};
|
|
9
|
+
async function U(e, a) {
|
|
10
|
+
const s = await e.text().catch(() => "");
|
|
11
|
+
let i = {};
|
|
12
|
+
if (s)
|
|
13
|
+
try {
|
|
14
|
+
i = JSON.parse(s);
|
|
15
|
+
} catch {
|
|
16
|
+
if (!e.ok) throw new Error(a);
|
|
17
|
+
return s;
|
|
18
|
+
}
|
|
19
|
+
if (typeof i.success == "boolean") {
|
|
20
|
+
if (i.success)
|
|
21
|
+
return i.data !== void 0 ? i.data : !0;
|
|
22
|
+
throw new Error(i.message || a);
|
|
23
|
+
}
|
|
24
|
+
if (!e.ok) throw new Error(a);
|
|
25
|
+
return i;
|
|
26
|
+
}
|
|
27
|
+
async function tt(e) {
|
|
28
|
+
const a = e != null && e.trim() ? `?model=${encodeURIComponent(e.trim())}` : "", s = await fetch(`${x}/sessions${a}`, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
credentials: "include",
|
|
31
|
+
headers: $
|
|
32
|
+
});
|
|
33
|
+
return U(s, "创建会话失败");
|
|
34
|
+
}
|
|
35
|
+
async function et(e) {
|
|
36
|
+
const a = await fetch(`${x}/sessions/${encodeURIComponent(e)}`, {
|
|
37
|
+
credentials: "include",
|
|
38
|
+
headers: $
|
|
39
|
+
});
|
|
40
|
+
return U(a, "加载会话失败");
|
|
41
|
+
}
|
|
42
|
+
async function nt(e, a, s) {
|
|
43
|
+
const i = await fetch(
|
|
44
|
+
`${x}/sessions/${encodeURIComponent(e)}/chat`,
|
|
45
|
+
{
|
|
46
|
+
method: "POST",
|
|
47
|
+
credentials: "include",
|
|
48
|
+
headers: { Accept: "application/json", ...$, "Content-Type": "application/json" },
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
message: a,
|
|
51
|
+
...s != null && s.trim() ? { model: s.trim() } : {}
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
return U(i, "发送失败");
|
|
56
|
+
}
|
|
57
|
+
function st(e, a) {
|
|
58
|
+
const s = e.split(`
|
|
59
|
+
|
|
60
|
+
`), i = s.pop() ?? "";
|
|
61
|
+
for (const g of s) {
|
|
62
|
+
let u = "";
|
|
63
|
+
for (const _ of g.split(`
|
|
64
|
+
`))
|
|
65
|
+
_.startsWith("data:") && (u += _.slice(5).trim());
|
|
66
|
+
if (!(!u || u === "[DONE]"))
|
|
67
|
+
try {
|
|
68
|
+
a(JSON.parse(u));
|
|
69
|
+
} catch {
|
|
70
|
+
a({ type: "token", data: u });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return i;
|
|
74
|
+
}
|
|
75
|
+
async function ot(e, a, s, i) {
|
|
76
|
+
var N, p;
|
|
77
|
+
const g = await fetch(
|
|
78
|
+
`${x}/sessions/${encodeURIComponent(e)}/chat/stream`,
|
|
79
|
+
{
|
|
80
|
+
method: "POST",
|
|
81
|
+
credentials: "include",
|
|
82
|
+
headers: {
|
|
83
|
+
...$,
|
|
84
|
+
"Content-Type": "application/json",
|
|
85
|
+
Accept: "text/event-stream"
|
|
86
|
+
},
|
|
87
|
+
body: JSON.stringify({
|
|
88
|
+
message: a,
|
|
89
|
+
...i != null && i.trim() ? { model: i.trim() } : {}
|
|
90
|
+
}),
|
|
91
|
+
signal: s.signal
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
if (!g.ok || !g.body)
|
|
95
|
+
throw new Error(`流式请求失败 HTTP ${g.status}`);
|
|
96
|
+
const u = g.body.getReader(), _ = new TextDecoder();
|
|
97
|
+
let h = "";
|
|
98
|
+
try {
|
|
99
|
+
for (; ; ) {
|
|
100
|
+
const { done: f, value: w } = await u.read();
|
|
101
|
+
if (f) break;
|
|
102
|
+
h += _.decode(w, { stream: !0 }), h = st(h, s.onEvent);
|
|
103
|
+
}
|
|
104
|
+
} catch (f) {
|
|
105
|
+
if ((N = s.signal) != null && N.aborted) return;
|
|
106
|
+
throw (p = s.onError) == null || p.call(s, f instanceof Error ? f : new Error(String(f))), f;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const at = "_page_1u2ag_1", rt = "_header_1u2ag_9", ct = "_title_1u2ag_16", it = "_sub_1u2ag_22", lt = "_toolbar_1u2ag_29", ut = "_modelInput_1u2ag_37", dt = "_btn_1u2ag_47", gt = "_btnSecondary_1u2ag_57", pt = "_status_1u2ag_72", mt = "_panel_1u2ag_79", ft = "_messages_1u2ag_91", _t = "_empty_1u2ag_100", ht = "_msgOwn_1u2ag_107", yt = "_msgOwnBubble_1u2ag_112", bt = "_msgAgent_1u2ag_123", wt = "_avatar_1u2ag_129", vt = "_msgAgentBody_1u2ag_141", St = "_msgMeta_1u2ag_145", Nt = "_reasoning_1u2ag_151", At = "_msgAgentBubble_1u2ag_162", kt = "_toolHint_1u2ag_184", Et = "_inputArea_1u2ag_190", Ct = "_textarea_1u2ag_197", Tt = "_inputActions_1u2ag_215", xt = "_tokenUsage_1u2ag_222", o = {
|
|
110
|
+
page: at,
|
|
111
|
+
header: rt,
|
|
112
|
+
title: ct,
|
|
113
|
+
sub: it,
|
|
114
|
+
toolbar: lt,
|
|
115
|
+
modelInput: ut,
|
|
116
|
+
btn: dt,
|
|
117
|
+
btnSecondary: gt,
|
|
118
|
+
status: pt,
|
|
119
|
+
panel: mt,
|
|
120
|
+
messages: ft,
|
|
121
|
+
empty: _t,
|
|
122
|
+
msgOwn: ht,
|
|
123
|
+
msgOwnBubble: yt,
|
|
124
|
+
msgAgent: bt,
|
|
125
|
+
avatar: wt,
|
|
126
|
+
msgAgentBody: vt,
|
|
127
|
+
msgMeta: St,
|
|
128
|
+
reasoning: Nt,
|
|
129
|
+
msgAgentBubble: At,
|
|
130
|
+
toolHint: kt,
|
|
131
|
+
inputArea: Et,
|
|
132
|
+
textarea: Ct,
|
|
133
|
+
inputActions: Tt,
|
|
134
|
+
tokenUsage: xt
|
|
135
|
+
};
|
|
136
|
+
function $t(e, a, s) {
|
|
137
|
+
if (!s)
|
|
138
|
+
return { parts: e, lastKind: a };
|
|
139
|
+
if (a === "tool")
|
|
140
|
+
return {
|
|
141
|
+
parts: [...e, { kind: "tool", hint: s }],
|
|
142
|
+
lastKind: "tool"
|
|
143
|
+
};
|
|
144
|
+
const i = a === "thought" ? "reasoning" : "text", g = e[e.length - 1];
|
|
145
|
+
if (g && g.kind === i) {
|
|
146
|
+
const u = e.slice(0, -1);
|
|
147
|
+
return u.push({
|
|
148
|
+
kind: i,
|
|
149
|
+
content: g.content + s
|
|
150
|
+
}), { parts: u, lastKind: a };
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
parts: [...e, { kind: i, content: s }],
|
|
154
|
+
lastKind: a
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function L(e) {
|
|
158
|
+
const a = (e == null ? void 0 : e.trim()) ?? "";
|
|
159
|
+
return a ? [{ kind: "text", content: a }] : [];
|
|
160
|
+
}
|
|
161
|
+
const Ot = "deepseek-v4-flash";
|
|
162
|
+
function S() {
|
|
163
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
164
|
+
}
|
|
165
|
+
function Bt(e, a) {
|
|
166
|
+
return { id: e, role: "assistant", parts: [], streaming: a };
|
|
167
|
+
}
|
|
168
|
+
function Mt() {
|
|
169
|
+
const [e, a] = b(""), [s, i] = b(Ot), [g, u] = b([]), [_, h] = b(""), [N, p] = b(""), [f, w] = b(!1), [A, j] = b(!1), k = D(null), I = D(null), E = D(
|
|
170
|
+
/* @__PURE__ */ new Map()
|
|
171
|
+
), M = K(() => {
|
|
172
|
+
var t;
|
|
173
|
+
(t = I.current) == null || t.scrollIntoView({ behavior: "smooth" });
|
|
174
|
+
}, []);
|
|
175
|
+
J(() => {
|
|
176
|
+
M();
|
|
177
|
+
}, [g, M]);
|
|
178
|
+
const P = (t) => {
|
|
179
|
+
u(
|
|
180
|
+
t.map(
|
|
181
|
+
(n) => n.role === "user" ? { id: S(), role: "user", content: n.content || "" } : {
|
|
182
|
+
id: S(),
|
|
183
|
+
role: "assistant",
|
|
184
|
+
parts: L(n.content || "")
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
);
|
|
188
|
+
}, R = K(async () => {
|
|
189
|
+
w(!0), p("创建会话…");
|
|
190
|
+
try {
|
|
191
|
+
const t = await tt(s);
|
|
192
|
+
a(t.sessionId), P(t.messages || []), p("");
|
|
193
|
+
} catch (t) {
|
|
194
|
+
const n = t instanceof Error ? t.message : "创建失败";
|
|
195
|
+
p(n), T.error(n);
|
|
196
|
+
} finally {
|
|
197
|
+
w(!1);
|
|
198
|
+
}
|
|
199
|
+
}, [s]);
|
|
200
|
+
J(() => {
|
|
201
|
+
R();
|
|
202
|
+
}, []);
|
|
203
|
+
const V = async () => {
|
|
204
|
+
if (e) {
|
|
205
|
+
p("刷新中…");
|
|
206
|
+
try {
|
|
207
|
+
const t = await et(e);
|
|
208
|
+
P(t.messages || []), p("");
|
|
209
|
+
} catch (t) {
|
|
210
|
+
T.error(t instanceof Error ? t.message : "刷新失败");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}, F = () => {
|
|
214
|
+
const t = S();
|
|
215
|
+
return E.current.set(t, null), u((n) => [...n, Bt(t, !0)]), t;
|
|
216
|
+
}, O = (t, n) => {
|
|
217
|
+
u(
|
|
218
|
+
(l) => l.map(
|
|
219
|
+
(r) => r.id === t && r.role === "assistant" ? { ...r, ...n } : r
|
|
220
|
+
)
|
|
221
|
+
);
|
|
222
|
+
}, v = (t, n, l) => {
|
|
223
|
+
u(
|
|
224
|
+
(r) => r.map((c) => {
|
|
225
|
+
if (c.id !== t || c.role !== "assistant")
|
|
226
|
+
return c;
|
|
227
|
+
const { parts: y, lastKind: B } = $t(
|
|
228
|
+
c.parts,
|
|
229
|
+
n,
|
|
230
|
+
l
|
|
231
|
+
);
|
|
232
|
+
return E.current.set(t, B), { ...c, parts: y };
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
}, W = (t, n) => {
|
|
236
|
+
const l = n.type, r = n.data;
|
|
237
|
+
if (l === "token" && typeof r == "string")
|
|
238
|
+
v(t, "token", r);
|
|
239
|
+
else if (l === "thought" && typeof r == "string")
|
|
240
|
+
v(t, "thought", r);
|
|
241
|
+
else if (l === "tool_call" && r && typeof r == "object") {
|
|
242
|
+
const c = String(r.tool ?? "tool");
|
|
243
|
+
v(t, "tool", `🔧 ${c} …`);
|
|
244
|
+
} else if (l === "tool_result" && r && typeof r == "object") {
|
|
245
|
+
const c = r, y = String(c.tool ?? ""), B = String(c.result ?? "").slice(0, 120), z = !!c.error;
|
|
246
|
+
v(
|
|
247
|
+
t,
|
|
248
|
+
"tool",
|
|
249
|
+
`${z ? "✗" : "✓"} ${y}: ${B}`
|
|
250
|
+
);
|
|
251
|
+
} else if (l === "error")
|
|
252
|
+
v(t, "token", `
|
|
253
|
+
[错误] ${typeof r == "string" ? r : "error"}`);
|
|
254
|
+
else if (l === "done") {
|
|
255
|
+
E.current.delete(t);
|
|
256
|
+
const c = r && typeof r == "object" ? r.tokenUsage : void 0;
|
|
257
|
+
O(t, {
|
|
258
|
+
streaming: !1,
|
|
259
|
+
...c && typeof c == "object" ? { tokenUsage: c } : {}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}, H = async () => {
|
|
263
|
+
var l, r;
|
|
264
|
+
const t = _.trim();
|
|
265
|
+
if (!t || !e || A) return;
|
|
266
|
+
h(""), u((c) => [
|
|
267
|
+
...c,
|
|
268
|
+
{ id: S(), role: "user", content: t }
|
|
269
|
+
]);
|
|
270
|
+
const n = F();
|
|
271
|
+
j(!0), p("生成中…"), (l = k.current) == null || l.abort(), k.current = new AbortController();
|
|
272
|
+
try {
|
|
273
|
+
await ot(
|
|
274
|
+
e,
|
|
275
|
+
t,
|
|
276
|
+
{
|
|
277
|
+
signal: k.current.signal,
|
|
278
|
+
onEvent: (c) => W(n, c)
|
|
279
|
+
},
|
|
280
|
+
s
|
|
281
|
+
), O(n, { streaming: !1 }), E.current.delete(n), p("");
|
|
282
|
+
} catch (c) {
|
|
283
|
+
if (!((r = k.current) != null && r.signal.aborted)) {
|
|
284
|
+
const y = c instanceof Error ? c.message : "流式失败";
|
|
285
|
+
T.error(y), v(n, "token", `[失败] ${y}`), O(n, { streaming: !1 }), p(y);
|
|
286
|
+
}
|
|
287
|
+
} finally {
|
|
288
|
+
j(!1);
|
|
289
|
+
}
|
|
290
|
+
}, q = async () => {
|
|
291
|
+
const t = _.trim();
|
|
292
|
+
if (!(!t || !e || A)) {
|
|
293
|
+
h(""), u((n) => [
|
|
294
|
+
...n,
|
|
295
|
+
{ id: S(), role: "user", content: t }
|
|
296
|
+
]), w(!0), p("同步请求中…");
|
|
297
|
+
try {
|
|
298
|
+
const n = await nt(e, t, s);
|
|
299
|
+
u((l) => [
|
|
300
|
+
...l,
|
|
301
|
+
{
|
|
302
|
+
id: S(),
|
|
303
|
+
role: "assistant",
|
|
304
|
+
parts: L(n.reply || "")
|
|
305
|
+
}
|
|
306
|
+
]), p("");
|
|
307
|
+
} catch (n) {
|
|
308
|
+
T.error(n instanceof Error ? n.message : "发送失败");
|
|
309
|
+
} finally {
|
|
310
|
+
w(!1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}, C = !e || f || A;
|
|
314
|
+
return /* @__PURE__ */ m("div", { className: o.page, children: [
|
|
315
|
+
/* @__PURE__ */ m("div", { className: o.header, children: [
|
|
316
|
+
/* @__PURE__ */ d("div", { className: o.title, children: "AINative Chat Demo" }),
|
|
317
|
+
/* @__PURE__ */ d("div", { className: o.sub, children: e ? `Session: ${e} · SSE(非 WebSocket)` : "正在初始化…" }),
|
|
318
|
+
/* @__PURE__ */ m("div", { className: o.toolbar, children: [
|
|
319
|
+
/* @__PURE__ */ d(
|
|
320
|
+
"input",
|
|
321
|
+
{
|
|
322
|
+
className: o.modelInput,
|
|
323
|
+
placeholder: "model / llmCode(可选)",
|
|
324
|
+
value: s,
|
|
325
|
+
onChange: (t) => i(t.target.value)
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
/* @__PURE__ */ d(
|
|
329
|
+
"button",
|
|
330
|
+
{
|
|
331
|
+
type: "button",
|
|
332
|
+
className: o.btnSecondary,
|
|
333
|
+
onClick: R,
|
|
334
|
+
disabled: f || A,
|
|
335
|
+
children: "新会话"
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ d(
|
|
339
|
+
"button",
|
|
340
|
+
{
|
|
341
|
+
type: "button",
|
|
342
|
+
className: o.btnSecondary,
|
|
343
|
+
onClick: V,
|
|
344
|
+
disabled: C,
|
|
345
|
+
children: "刷新历史"
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
] })
|
|
349
|
+
] }),
|
|
350
|
+
N ? /* @__PURE__ */ d("div", { className: o.status, children: N }) : null,
|
|
351
|
+
/* @__PURE__ */ m("div", { className: o.panel, children: [
|
|
352
|
+
/* @__PURE__ */ m("div", { className: o.messages, children: [
|
|
353
|
+
g.length === 0 ? /* @__PURE__ */ d("div", { className: o.empty, children: "发送消息开始对话" }) : null,
|
|
354
|
+
g.map(
|
|
355
|
+
(t) => t.role === "user" ? /* @__PURE__ */ d("div", { className: o.msgOwn, children: /* @__PURE__ */ d("div", { className: o.msgOwnBubble, children: t.content }) }, t.id) : t.role === "assistant" ? /* @__PURE__ */ m("div", { className: o.msgAgent, children: [
|
|
356
|
+
/* @__PURE__ */ d("div", { className: o.avatar, children: "🤖" }),
|
|
357
|
+
/* @__PURE__ */ m("div", { className: o.msgAgentBody, children: [
|
|
358
|
+
/* @__PURE__ */ m("div", { className: o.msgMeta, children: [
|
|
359
|
+
"Assistant",
|
|
360
|
+
t.streaming ? " · 生成中" : ""
|
|
361
|
+
] }),
|
|
362
|
+
t.parts.length === 0 && t.streaming ? /* @__PURE__ */ d("div", { className: o.msgAgentBubble, children: "…" }) : null,
|
|
363
|
+
t.parts.map((n, l) => {
|
|
364
|
+
const c = l === t.parts.length - 1 && t.streaming ? "…" : "";
|
|
365
|
+
return n.kind === "reasoning" ? /* @__PURE__ */ m("div", { className: o.reasoning, children: [
|
|
366
|
+
n.content,
|
|
367
|
+
c
|
|
368
|
+
] }, l) : n.kind === "text" ? /* @__PURE__ */ m("div", { className: o.msgAgentBubble, children: [
|
|
369
|
+
n.content,
|
|
370
|
+
c
|
|
371
|
+
] }, l) : /* @__PURE__ */ d("div", { className: o.toolHint, children: n.hint }, l);
|
|
372
|
+
}),
|
|
373
|
+
t.tokenUsage && !t.streaming ? /* @__PURE__ */ m("div", { className: o.tokenUsage, children: [
|
|
374
|
+
"Token in ",
|
|
375
|
+
t.tokenUsage.inputTokenCount ?? 0,
|
|
376
|
+
" / out",
|
|
377
|
+
" ",
|
|
378
|
+
t.tokenUsage.outputTokenCount ?? 0,
|
|
379
|
+
" / total",
|
|
380
|
+
" ",
|
|
381
|
+
t.tokenUsage.totalTokenCount ?? 0
|
|
382
|
+
] }) : null
|
|
383
|
+
] })
|
|
384
|
+
] }, t.id) : null
|
|
385
|
+
),
|
|
386
|
+
/* @__PURE__ */ d("div", { ref: I })
|
|
387
|
+
] }),
|
|
388
|
+
/* @__PURE__ */ m("div", { className: o.inputArea, children: [
|
|
389
|
+
/* @__PURE__ */ d(
|
|
390
|
+
"textarea",
|
|
391
|
+
{
|
|
392
|
+
className: o.textarea,
|
|
393
|
+
placeholder: "输入消息,Enter 发送(Shift+Enter 换行)",
|
|
394
|
+
value: _,
|
|
395
|
+
disabled: C,
|
|
396
|
+
onChange: (t) => h(t.target.value),
|
|
397
|
+
onKeyDown: (t) => {
|
|
398
|
+
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), H());
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
),
|
|
402
|
+
/* @__PURE__ */ m("div", { className: o.inputActions, children: [
|
|
403
|
+
/* @__PURE__ */ d(
|
|
404
|
+
"button",
|
|
405
|
+
{
|
|
406
|
+
type: "button",
|
|
407
|
+
className: o.btnSecondary,
|
|
408
|
+
disabled: C,
|
|
409
|
+
onClick: q,
|
|
410
|
+
children: "同步"
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
/* @__PURE__ */ d(
|
|
414
|
+
"button",
|
|
415
|
+
{
|
|
416
|
+
type: "button",
|
|
417
|
+
className: o.btn,
|
|
418
|
+
disabled: C,
|
|
419
|
+
onClick: H,
|
|
420
|
+
children: "发送(SSE)"
|
|
421
|
+
}
|
|
422
|
+
)
|
|
423
|
+
] })
|
|
424
|
+
] })
|
|
425
|
+
] })
|
|
426
|
+
] });
|
|
427
|
+
}
|
|
428
|
+
export {
|
|
429
|
+
Mt as default
|
|
430
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { AppLayout as v, ErrorBoundary as H, LoginPage as _, StatusTag as z, defaultStatusMap as F } from "@yuku123/z-frontend-common";
|
|
2
|
+
import { a as y } from "./ComponentDoc-BFoF51we.js";
|
|
3
|
+
import { c as J, E as Q, d as X, e as Y, f as Z, O as $, h as ee, R as te, j as re, k as ae, T as oe, l as ne, r as le, r as ie, m as se } from "./ComponentDoc-BFoF51we.js";
|
|
4
|
+
import { jsxs as r, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
5
|
+
import { useState as n, useEffect as T } from "react";
|
|
6
|
+
import { Alert as I, Space as x, Button as l, Tag as c, Result as R } from "antd";
|
|
7
|
+
import { ReloadOutlined as g, UserAddOutlined as E, TeamOutlined as b, PlusOutlined as w, CodeOutlined as A } from "@ant-design/icons";
|
|
8
|
+
import { ListTable as f } from "@yuku123/z-frontend-common/ui";
|
|
9
|
+
const G = y, O = {
|
|
10
|
+
LEADER: "red",
|
|
11
|
+
WORKER: "blue",
|
|
12
|
+
OBSERVER: "default"
|
|
13
|
+
};
|
|
14
|
+
function K() {
|
|
15
|
+
const [i] = n(!1), [s] = n([]);
|
|
16
|
+
return /* @__PURE__ */ r(h, { children: [
|
|
17
|
+
/* @__PURE__ */ e(
|
|
18
|
+
I,
|
|
19
|
+
{
|
|
20
|
+
type: "info",
|
|
21
|
+
showIcon: !0,
|
|
22
|
+
style: { marginBottom: 16 },
|
|
23
|
+
title: "IM 群组 (含 STOMP 实时消息) 后端服务尚未启动",
|
|
24
|
+
description: "当前展示群组列表占位。等 z-agent-team 后端就绪后切换为完整 IM 客户端。"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
f,
|
|
29
|
+
{
|
|
30
|
+
cardTitle: /* @__PURE__ */ r("span", { children: [
|
|
31
|
+
/* @__PURE__ */ e(b, { style: { marginRight: 8 } }),
|
|
32
|
+
"Agent 群组 IM"
|
|
33
|
+
] }),
|
|
34
|
+
cardExtra: /* @__PURE__ */ r(x, { children: [
|
|
35
|
+
/* @__PURE__ */ e(l, { icon: /* @__PURE__ */ e(g, {}), loading: i, children: "刷新" }),
|
|
36
|
+
/* @__PURE__ */ e(l, { type: "primary", icon: /* @__PURE__ */ e(E, {}), disabled: !0, children: "创建群组" })
|
|
37
|
+
] }),
|
|
38
|
+
rows: s,
|
|
39
|
+
columns: [
|
|
40
|
+
{ title: "群组编码", dataIndex: "teamCode", width: 200, ellipsis: !0 },
|
|
41
|
+
{ title: "群组名称", dataIndex: "teamName", width: 200 },
|
|
42
|
+
{
|
|
43
|
+
title: "我的角色",
|
|
44
|
+
dataIndex: "role",
|
|
45
|
+
width: 120,
|
|
46
|
+
render: (a) => /* @__PURE__ */ e(c, { color: O[a] || "default", children: a || "-" })
|
|
47
|
+
},
|
|
48
|
+
{ title: "成员数", dataIndex: "memberCount", width: 100 },
|
|
49
|
+
{ title: "最近消息", dataIndex: "lastMessage", width: 240, ellipsis: !0 },
|
|
50
|
+
{ title: "更新时间", dataIndex: "updatedAt", width: 180 }
|
|
51
|
+
],
|
|
52
|
+
rowKey: "teamCode",
|
|
53
|
+
loading: i,
|
|
54
|
+
searchKeys: ["teamCode", "teamName"],
|
|
55
|
+
searchPlaceholder: "按群组编码 / 名称过滤",
|
|
56
|
+
emptyTitle: "暂无群组",
|
|
57
|
+
emptyDescription: "当前还没有 IM 群组。"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
const M = {
|
|
63
|
+
CREATING: { text: "创建中", color: "processing" },
|
|
64
|
+
RUNNING: { text: "运行中", color: "success" },
|
|
65
|
+
STOPPED: { text: "已停止", color: "default" },
|
|
66
|
+
ERROR: { text: "错误", color: "error" }
|
|
67
|
+
}, D = {
|
|
68
|
+
GIT: { text: "GIT 模式", color: "blue" },
|
|
69
|
+
SHARED: { text: "SHARED 模式", color: "purple" }
|
|
70
|
+
};
|
|
71
|
+
function U() {
|
|
72
|
+
const [i, s] = n([]), [d, a] = n(!1), [u, m] = n(null), p = async () => {
|
|
73
|
+
a(!0), m(null);
|
|
74
|
+
try {
|
|
75
|
+
s([]);
|
|
76
|
+
} catch (t) {
|
|
77
|
+
m((t == null ? void 0 : t.message) || "加载失败");
|
|
78
|
+
} finally {
|
|
79
|
+
a(!1);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return T(() => {
|
|
83
|
+
p();
|
|
84
|
+
}, []), /* @__PURE__ */ r(h, { children: [
|
|
85
|
+
u && /* @__PURE__ */ e(
|
|
86
|
+
I,
|
|
87
|
+
{
|
|
88
|
+
type: "warning",
|
|
89
|
+
showIcon: !0,
|
|
90
|
+
style: { marginBottom: 16 },
|
|
91
|
+
title: "后端 API 暂未连接",
|
|
92
|
+
description: u
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ e(
|
|
96
|
+
f,
|
|
97
|
+
{
|
|
98
|
+
cardTitle: /* @__PURE__ */ r("span", { children: [
|
|
99
|
+
/* @__PURE__ */ e(A, { style: { marginRight: 8 } }),
|
|
100
|
+
"WebIDE 容器管理"
|
|
101
|
+
] }),
|
|
102
|
+
cardExtra: /* @__PURE__ */ r(x, { children: [
|
|
103
|
+
/* @__PURE__ */ e(l, { icon: /* @__PURE__ */ e(g, {}), onClick: p, loading: d, children: "刷新" }),
|
|
104
|
+
/* @__PURE__ */ e(l, { type: "primary", icon: /* @__PURE__ */ e(w, {}), disabled: !0, children: "新建 WebIDE" })
|
|
105
|
+
] }),
|
|
106
|
+
rows: i,
|
|
107
|
+
columns: [
|
|
108
|
+
{ title: "容器ID", dataIndex: "containerId", width: 220, ellipsis: !0 },
|
|
109
|
+
{
|
|
110
|
+
title: "模式",
|
|
111
|
+
dataIndex: "mode",
|
|
112
|
+
width: 120,
|
|
113
|
+
render: (t) => {
|
|
114
|
+
const o = D[t] || { text: t, color: "default" };
|
|
115
|
+
return /* @__PURE__ */ e(c, { color: o.color, children: o.text });
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{ title: "Git URL", dataIndex: "gitUrl", width: 240, ellipsis: !0 },
|
|
119
|
+
{ title: "分支", dataIndex: "branch", width: 120 },
|
|
120
|
+
{
|
|
121
|
+
title: "状态",
|
|
122
|
+
dataIndex: "status",
|
|
123
|
+
width: 120,
|
|
124
|
+
render: (t) => {
|
|
125
|
+
const o = M[t] || { text: t, color: "default" };
|
|
126
|
+
return /* @__PURE__ */ e(c, { color: o.color, children: o.text });
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{ title: "创建时间", dataIndex: "createdAt", width: 180 }
|
|
130
|
+
],
|
|
131
|
+
rowKey: "containerId",
|
|
132
|
+
loading: d,
|
|
133
|
+
scroll: { x: 1e3 },
|
|
134
|
+
searchKeys: ["containerId", "branch"],
|
|
135
|
+
searchPlaceholder: "按容器 ID / 分支过滤",
|
|
136
|
+
emptyTitle: "暂无容器",
|
|
137
|
+
emptyDescription: "后端 z-webide 服务尚未启动"
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] });
|
|
141
|
+
}
|
|
142
|
+
function k() {
|
|
143
|
+
return /* @__PURE__ */ e(
|
|
144
|
+
R,
|
|
145
|
+
{
|
|
146
|
+
title: "Debug Playground",
|
|
147
|
+
subTitle: "AI 调试沙盒功能开发中...",
|
|
148
|
+
extra: /* @__PURE__ */ e(l, { type: "primary", children: "敬请期待" })
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
K as AgentTeamIM,
|
|
154
|
+
v as AppLayout,
|
|
155
|
+
J as CurlImportModal,
|
|
156
|
+
k as DebugPlayground,
|
|
157
|
+
Q as EndpointsTab,
|
|
158
|
+
X as EnvironmentsTab,
|
|
159
|
+
H as ErrorBoundary,
|
|
160
|
+
_ as LoginPage,
|
|
161
|
+
Y as MockPlatform,
|
|
162
|
+
Z as MockTemplateHelper,
|
|
163
|
+
$ as OpenApiImportModal,
|
|
164
|
+
ee as Overview,
|
|
165
|
+
te as RecordingsTab,
|
|
166
|
+
re as RequestLogsTab,
|
|
167
|
+
ae as ScenariosTab,
|
|
168
|
+
z as StatusTag,
|
|
169
|
+
oe as TestCasesTab,
|
|
170
|
+
U as Webide,
|
|
171
|
+
y as authRequest,
|
|
172
|
+
ne as createRequest,
|
|
173
|
+
G as ctcRequest,
|
|
174
|
+
le as default,
|
|
175
|
+
F as defaultStatusMap,
|
|
176
|
+
ie as request,
|
|
177
|
+
se as setupInterceptors
|
|
178
|
+
};
|