@yuku123/z-team-component 0.2.79 → 0.2.80

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