@yuku123/z-team-component 0.2.102 → 0.2.103

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 (58) hide show
  1. package/package.json +1 -1
  2. package/dist/ChangeLogView-BIlT58NX.js +0 -542
  3. package/dist/ComponentDoc-bhNM4jiY.js +0 -8035
  4. package/dist/InvitationManagementPage-9AmXUw6E.js +0 -495
  5. package/dist/OnboardingPage-B9oWippy.js +0 -393
  6. package/dist/ScheduledTasks-CkNxtgeb.js +0 -12127
  7. package/dist/SystemShell-Cz3bn2dt.js +0 -688
  8. package/dist/_commonjsHelpers-B52_cu2H.js +0 -26
  9. package/dist/admin-logs-BuwxECUY.js +0 -198
  10. package/dist/api-DL_MM5cW.js +0 -20
  11. package/dist/browser-jb_PFvU3.js +0 -1538
  12. package/dist/createWorkspaceWsHandler-B6LYCL3Q.js +0 -13142
  13. package/dist/ctc-sso-DtJHC-2M.js +0 -117
  14. package/dist/echarts-B1OU1xr4.js +0 -16
  15. package/dist/history-BlrA1eaW.js +0 -41
  16. package/dist/index-2dGExnjZ.js +0 -2217
  17. package/dist/index-B1AYMWHS.js +0 -10169
  18. package/dist/index-B5F1N9_V.js +0 -42049
  19. package/dist/index-B8O2io7L.js +0 -315
  20. package/dist/index-BIXeUFLa.js +0 -479
  21. package/dist/index-BPqoN-aE.js +0 -242
  22. package/dist/index-BTs7b4SV.js +0 -118
  23. package/dist/index-BYMhgsLe.js +0 -178
  24. package/dist/index-BZBxvwcT.js +0 -169
  25. package/dist/index-BZCQSW-G.js +0 -1222
  26. package/dist/index-B_LJRFsK.js +0 -339
  27. package/dist/index-BdmM-NHL.js +0 -5892
  28. package/dist/index-BmHFHD_e.js +0 -112
  29. package/dist/index-BohoJQPr.js +0 -7631
  30. package/dist/index-C1wsTstT.js +0 -434
  31. package/dist/index-C1wtrBjM.js +0 -8
  32. package/dist/index-C815hPWS.js +0 -430
  33. package/dist/index-CbH8YeqA.js +0 -913
  34. package/dist/index-CsweV-yM.js +0 -142
  35. package/dist/index-D3vyICxK.js +0 -2699
  36. package/dist/index-DKgyKXWm.js +0 -1640
  37. package/dist/index-DQHEr9-I.js +0 -93
  38. package/dist/index-DU-PHfEr.js +0 -189
  39. package/dist/index-DWsfQMp8.js +0 -208
  40. package/dist/index-DhDdFRHC.js +0 -279
  41. package/dist/index-DvTMESfc.js +0 -132
  42. package/dist/index-fl0m6QYf.js +0 -316
  43. package/dist/index-lux3nNJP.js +0 -574
  44. package/dist/index-mwtsohOK.js +0 -951
  45. package/dist/index-qd4awhFI.js +0 -956
  46. package/dist/index.js +0 -10
  47. package/dist/index.module-CAa-2T7m.js +0 -72
  48. package/dist/index.module-UI0iz8K0.js +0 -42
  49. package/dist/instance-4ACm8YFK.js +0 -216
  50. package/dist/menuPermission-C7yt7uNG.js +0 -60
  51. package/dist/mobile-client-O3yr9h6t.js +0 -24
  52. package/dist/pages.js +0 -21
  53. package/dist/send-default-agent-team-message-YRd0CkeT.js +0 -35
  54. package/dist/spark-md5-Dld54a-T.js +0 -178
  55. package/dist/sso-user-GnlYnP83.js +0 -43
  56. package/dist/training-CyK00fwu.js +0 -450
  57. package/dist/webide-SjnHsCZF.js +0 -5233
  58. package/dist/z-team-component.css +0 -1
@@ -1,434 +0,0 @@
1
- import { jsxs as a, jsx as i, Fragment as B } from "react/jsx-runtime";
2
- import { useState as d, useRef as F, useCallback as D, useEffect as R } from "react";
3
- import { T as O, k as U, d as P } from "./ComponentDoc-bhNM4jiY.js";
4
- /* empty css */
5
- async function y(o, s) {
6
- const n = await o.text().catch(() => "");
7
- let t = {};
8
- if (n)
9
- try {
10
- t = JSON.parse(n);
11
- } catch {
12
- if (!o.ok) throw new Error(s);
13
- return n;
14
- }
15
- if (typeof t.success == "boolean") {
16
- if (t.success)
17
- return U(t.data !== void 0 ? t.data : !0);
18
- throw new Error(t.message || s);
19
- }
20
- if (!o.ok) throw new Error(s);
21
- return U(t);
22
- }
23
- const m = O;
24
- async function q(o, s) {
25
- const n = s ? `?token=${encodeURIComponent(s)}` : "", t = { ...o, extend_params: { skip_init_task: "true" } }, r = await fetch(`${m}/scenario-instances${n}`, {
26
- method: "POST",
27
- credentials: "include",
28
- headers: {
29
- Accept: "application/json",
30
- "Content-Type": "application/json",
31
- "project-env": "local"
32
- },
33
- body: JSON.stringify(t)
34
- });
35
- return y(r, "Failed to create scenario instance");
36
- }
37
- async function K(o) {
38
- const s = o ? `?token=${encodeURIComponent(o)}` : "", n = await fetch(`${m}/scenario-instances${s}`, {
39
- credentials: "include",
40
- headers: {
41
- Accept: "application/json",
42
- "project-env": "local"
43
- }
44
- });
45
- return y(n, "Failed to list scenario instances");
46
- }
47
- async function G(o, s, n) {
48
- const t = n ? `?token=${encodeURIComponent(n)}` : "", r = await fetch(
49
- `${m}/scenario-instances/${o}/messages${t}`,
50
- {
51
- method: "POST",
52
- credentials: "include",
53
- headers: {
54
- Accept: "application/json",
55
- "Content-Type": "application/json",
56
- "project-env": "local"
57
- },
58
- body: JSON.stringify(s)
59
- }
60
- );
61
- return y(r, "Failed to send message");
62
- }
63
- async function _(o, s = 50, n, t) {
64
- const r = new URLSearchParams({ limit: String(s) });
65
- t && r.set("token", t);
66
- const h = await fetch(
67
- `${m}/scenario-instances/${o}/messages?${r}`,
68
- {
69
- credentials: "include",
70
- headers: {
71
- Accept: "application/json",
72
- "project-env": "local"
73
- }
74
- }
75
- );
76
- return y(h, "Failed to list messages");
77
- }
78
- async function J(o, s) {
79
- const n = s ? `?token=${encodeURIComponent(s)}` : "", t = await fetch(
80
- // 后端成员列表在 /team(TeamController),没有 /members
81
- `${m}/scenario-instances/${o}/team${n}`,
82
- {
83
- credentials: "include",
84
- headers: {
85
- Accept: "application/json",
86
- "project-env": "local"
87
- }
88
- }
89
- );
90
- return y(t, "Failed to list members");
91
- }
92
- const L = "dev_brain_scenario";
93
- function Z() {
94
- var M;
95
- const [o, s] = d([]), [n, t] = d(
96
- null
97
- ), [r, h] = d([]), [u, z] = d([]), [v, b] = d(""), [W, w] = d(!1), [g, S] = d(!1), [A, T] = d(""), k = F(null), { token: f } = P(), C = D(() => {
98
- var e;
99
- (e = k.current) == null || e.scrollIntoView({ behavior: "smooth" });
100
- }, []);
101
- R(() => {
102
- C();
103
- }, [r, C]), R(() => {
104
- I();
105
- }, []);
106
- const I = async () => {
107
- try {
108
- const e = await K(f || void 0);
109
- s(e || []);
110
- } catch (e) {
111
- console.error("Failed to load instances:", e);
112
- }
113
- }, N = async () => {
114
- const e = A.trim();
115
- if (e) {
116
- S(!0);
117
- try {
118
- const c = await q(
119
- { scenario_code: L, name: e },
120
- f || void 0
121
- );
122
- T(""), await I(), $(c);
123
- } catch (c) {
124
- alert(c instanceof Error ? c.message : "Create failed");
125
- } finally {
126
- S(!1);
127
- }
128
- }
129
- }, $ = async (e) => {
130
- t(e), w(!0);
131
- try {
132
- const [c, p] = await Promise.all([
133
- _(e.id, 50, void 0, f || void 0),
134
- J(e.id, f || void 0)
135
- ]);
136
- h(c || []), z(p || []);
137
- } catch (c) {
138
- console.error("Failed to load instance data:", c);
139
- } finally {
140
- w(!1);
141
- }
142
- }, E = async () => {
143
- const e = v.trim();
144
- if (!e || !n) return;
145
- const c = u.filter((l) => l.memberType === "AGENT");
146
- let p, j = "TEXT";
147
- for (const l of c)
148
- if (e.includes(`@${l.displayName}`)) {
149
- p = String(l.id), j = "AT_AGENT";
150
- break;
151
- }
152
- b("");
153
- try {
154
- await G(
155
- n.id,
156
- {
157
- content: e,
158
- message_type: j,
159
- ...p ? { at_agent_ref_id: p } : {}
160
- },
161
- f || void 0
162
- );
163
- const l = await _(
164
- n.id,
165
- 50,
166
- void 0,
167
- f || void 0
168
- );
169
- h(l || []);
170
- } catch (l) {
171
- alert(l instanceof Error ? l.message : "Send failed");
172
- }
173
- }, x = u.filter((e) => e.memberType === "AGENT"), H = u.filter((e) => e.memberType === "HUMAN");
174
- return /* @__PURE__ */ a("div", { style: { display: "flex", height: "100vh", fontFamily: "sans-serif" }, children: [
175
- /* @__PURE__ */ a(
176
- "div",
177
- {
178
- style: {
179
- width: 260,
180
- borderRight: "1px solid #e8e8e8",
181
- display: "flex",
182
- flexDirection: "column",
183
- background: "#fafafa"
184
- },
185
- children: [
186
- /* @__PURE__ */ a("div", { style: { padding: 16, borderBottom: "1px solid #e8e8e8" }, children: [
187
- /* @__PURE__ */ i("h3", { style: { margin: "0 0 12px" }, children: "Scenario Instances" }),
188
- /* @__PURE__ */ a("div", { style: { display: "flex", gap: 8 }, children: [
189
- /* @__PURE__ */ i(
190
- "input",
191
- {
192
- style: {
193
- flex: 1,
194
- padding: "6px 8px",
195
- border: "1px solid #d9d9d9",
196
- borderRadius: 4
197
- },
198
- placeholder: "Instance name",
199
- value: A,
200
- onChange: (e) => T(e.target.value),
201
- onKeyDown: (e) => e.key === "Enter" && N()
202
- }
203
- ),
204
- /* @__PURE__ */ i(
205
- "button",
206
- {
207
- style: {
208
- padding: "6px 12px",
209
- background: "#1677ff",
210
- color: "#fff",
211
- border: "none",
212
- borderRadius: 4,
213
- cursor: g ? "not-allowed" : "pointer"
214
- },
215
- disabled: g,
216
- onClick: N,
217
- children: g ? "..." : "+"
218
- }
219
- )
220
- ] })
221
- ] }),
222
- /* @__PURE__ */ a("div", { style: { flex: 1, overflow: "auto" }, children: [
223
- o.map((e) => /* @__PURE__ */ a(
224
- "div",
225
- {
226
- onClick: () => $(e),
227
- style: {
228
- padding: "10px 16px",
229
- cursor: "pointer",
230
- background: (n == null ? void 0 : n.id) === e.id ? "#e6f4ff" : "transparent",
231
- borderBottom: "1px solid #f0f0f0"
232
- },
233
- children: [
234
- /* @__PURE__ */ i("div", { style: { fontWeight: 500, fontSize: 13 }, children: e.name }),
235
- /* @__PURE__ */ a("div", { style: { fontSize: 11, color: "#999" }, children: [
236
- e.scenarioCode,
237
- " · ",
238
- e.status
239
- ] })
240
- ]
241
- },
242
- e.id
243
- )),
244
- o.length === 0 ? /* @__PURE__ */ i("div", { style: { padding: 16, color: "#999", fontSize: 12 }, children: "No instances yet. Create one above." }) : null
245
- ] })
246
- ]
247
- }
248
- ),
249
- /* @__PURE__ */ i("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: n ? /* @__PURE__ */ a(B, { children: [
250
- /* @__PURE__ */ a(
251
- "div",
252
- {
253
- style: {
254
- padding: "12px 20px",
255
- borderBottom: "1px solid #e8e8e8",
256
- display: "flex",
257
- justifyContent: "space-between",
258
- alignItems: "center"
259
- },
260
- children: [
261
- /* @__PURE__ */ a("div", { children: [
262
- /* @__PURE__ */ i("span", { style: { fontWeight: 600, fontSize: 15 }, children: n.name }),
263
- /* @__PURE__ */ a("span", { style: { marginLeft: 8, fontSize: 12, color: "#999" }, children: [
264
- "ID: ",
265
- n.id
266
- ] })
267
- ] }),
268
- /* @__PURE__ */ a("div", { style: { fontSize: 12, color: "#666" }, children: [
269
- "Members: ",
270
- H.length,
271
- " human · ",
272
- x.length,
273
- " ",
274
- "agent"
275
- ] })
276
- ]
277
- }
278
- ),
279
- /* @__PURE__ */ a(
280
- "div",
281
- {
282
- style: {
283
- flex: 1,
284
- overflow: "auto",
285
- padding: "16px 20px",
286
- background: "#fff"
287
- },
288
- children: [
289
- r.length === 0 ? /* @__PURE__ */ i(
290
- "div",
291
- {
292
- style: { color: "#999", textAlign: "center", marginTop: 80 },
293
- children: "Send a message to start. Use @agent_name to mention an agent."
294
- }
295
- ) : null,
296
- r.map((e) => /* @__PURE__ */ a(
297
- "div",
298
- {
299
- style: {
300
- marginBottom: 12,
301
- display: "flex",
302
- flexDirection: e.senderType === "HUMAN" ? "row-reverse" : "row",
303
- gap: 8
304
- },
305
- children: [
306
- /* @__PURE__ */ i(
307
- "div",
308
- {
309
- style: {
310
- width: 32,
311
- height: 32,
312
- borderRadius: "50%",
313
- background: e.senderType === "HUMAN" ? "#1677ff" : "#52c41a",
314
- color: "#fff",
315
- display: "flex",
316
- alignItems: "center",
317
- justifyContent: "center",
318
- fontSize: 14,
319
- flexShrink: 0
320
- },
321
- children: e.senderType === "HUMAN" ? "U" : "A"
322
- }
323
- ),
324
- /* @__PURE__ */ a("div", { style: { maxWidth: "70%" }, children: [
325
- /* @__PURE__ */ a(
326
- "div",
327
- {
328
- style: {
329
- fontSize: 11,
330
- color: "#999",
331
- marginBottom: 2,
332
- textAlign: e.senderType === "HUMAN" ? "right" : "left"
333
- },
334
- children: [
335
- e.senderType === "HUMAN" ? "You" : "Agent",
336
- " ·",
337
- " ",
338
- e.messageType
339
- ]
340
- }
341
- ),
342
- /* @__PURE__ */ i(
343
- "div",
344
- {
345
- style: {
346
- padding: "8px 12px",
347
- borderRadius: 8,
348
- background: e.senderType === "HUMAN" ? "#1677ff" : "#f5f5f5",
349
- color: e.senderType === "HUMAN" ? "#fff" : "#333",
350
- fontSize: 13,
351
- whiteSpace: "pre-wrap",
352
- wordBreak: "break-word"
353
- },
354
- children: e.content
355
- }
356
- )
357
- ] })
358
- ]
359
- },
360
- e.id
361
- )),
362
- /* @__PURE__ */ i("div", { ref: k })
363
- ]
364
- }
365
- ),
366
- /* @__PURE__ */ a(
367
- "div",
368
- {
369
- style: {
370
- padding: "12px 20px",
371
- borderTop: "1px solid #e8e8e8",
372
- display: "flex",
373
- gap: 8,
374
- background: "#fafafa"
375
- },
376
- children: [
377
- /* @__PURE__ */ i(
378
- "textarea",
379
- {
380
- style: {
381
- flex: 1,
382
- padding: "8px 12px",
383
- border: "1px solid #d9d9d9",
384
- borderRadius: 4,
385
- resize: "none",
386
- minHeight: 40,
387
- maxHeight: 120,
388
- fontSize: 13
389
- },
390
- placeholder: x.length > 0 ? `Type message. @${(M = x[0]) == null ? void 0 : M.displayName} to mention agent.` : "Type message...",
391
- value: v,
392
- onChange: (e) => b(e.target.value),
393
- onKeyDown: (e) => {
394
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), E());
395
- }
396
- }
397
- ),
398
- /* @__PURE__ */ i(
399
- "button",
400
- {
401
- style: {
402
- padding: "8px 20px",
403
- background: "#1677ff",
404
- color: "#fff",
405
- border: "none",
406
- borderRadius: 4,
407
- cursor: "pointer",
408
- fontSize: 13
409
- },
410
- onClick: E,
411
- children: "Send"
412
- }
413
- )
414
- ]
415
- }
416
- )
417
- ] }) : /* @__PURE__ */ i(
418
- "div",
419
- {
420
- style: {
421
- flex: 1,
422
- display: "flex",
423
- alignItems: "center",
424
- justifyContent: "center",
425
- color: "#999"
426
- },
427
- children: "Select or create a scenario instance to start"
428
- }
429
- ) })
430
- ] });
431
- }
432
- export {
433
- Z as default
434
- };
@@ -1,8 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { C as r } from "./ChangeLogView-BIlT58NX.js";
3
- function n() {
4
- return /* @__PURE__ */ e(r, { variant: "page" });
5
- }
6
- export {
7
- n as default
8
- };