@yuku123/z-team-component 0.2.28 → 0.2.30

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 (45) hide show
  1. package/dist/{ChangeLogView-CG-o5YP1.js → ChangeLogView-FLd1wS8H.js} +1 -1
  2. package/dist/{InvitationManagementPage-DpA3Xlq1.js → InvitationManagementPage-CttWZdu8.js} +87 -82
  3. package/dist/{OnboardingPage-DFRAwruv.js → OnboardingPage-CAI-P20Q.js} +2 -2
  4. package/dist/ProjectApp-ZR_QUlPs.js +3839 -0
  5. package/dist/{SystemShell-BLXTOqFb.js → SystemShell-BKNdXqXt.js} +1 -1
  6. package/dist/{admin-logs-C2V1ElH9.js → admin-logs-Dv86pFvY.js} +2 -2
  7. package/dist/{api--Fg0hL9Y.js → api-19TXED_O.js} +52 -39
  8. package/dist/api-BNwdLozd.js +20 -0
  9. package/dist/{createWorkspaceWsHandler-CqGqcTh_.js → createWorkspaceWsHandler-CBk4DqP4.js} +6 -5
  10. package/dist/{index-hPzswwk2.js → index-B5_xKK08.js} +1139 -1152
  11. package/dist/{index-D5u3BjCZ.js → index-BIJnjJd5.js} +2 -2
  12. package/dist/{index-BylksTyk.js → index-BKwpQ-HW.js} +136 -134
  13. package/dist/{index-bbwTcNjB.js → index-BTLD5gUt.js} +3 -3
  14. package/dist/{index-C9BOtjtQ.js → index-BTaLAs80.js} +9 -9
  15. package/dist/{index-CiMxCTOS.js → index-B_EBV24V.js} +1 -1
  16. package/dist/{index-BafC42Cl.js → index-Bd57t_yF.js} +1 -1
  17. package/dist/{index-C2aPiQSz.js → index-BjqYiZpC.js} +3 -3
  18. package/dist/{index-BaCiSbPR.js → index-BoGVJ0hC.js} +1 -1
  19. package/dist/{index-C01UUprh.js → index-BpuJ9Njb.js} +7016 -6946
  20. package/dist/{index-CcFJEYgr.js → index-C815hPWS.js} +55 -52
  21. package/dist/{index-DIxwe_pk.js → index-C8GK1bOQ.js} +358 -347
  22. package/dist/{index-DvIHX7lZ.js → index-CcpWacSZ.js} +243 -236
  23. package/dist/{index-Da7ls5q6.js → index-DOPkM2W8.js} +6 -6
  24. package/dist/index-DQNZE7Go.js +169 -0
  25. package/dist/{index-BYEx4vlI.js → index-DR_FCf71.js} +1134 -1132
  26. package/dist/{index-CTD7k9dP.js → index-DYgD6BuB.js} +4 -4
  27. package/dist/{index-dSnK7qcL.js → index-DdN9Apqq.js} +5 -5
  28. package/dist/{index-CPF3LS0x.js → index-DuGWlMWm.js} +3 -3
  29. package/dist/index-JMzBzwiO.js +1746 -0
  30. package/dist/{index-Dao4uqQd.js → index-x4-W5ClM.js} +4 -4
  31. package/dist/index.js +1 -1
  32. package/dist/{instance-1QEDBRqA.js → instance-D951fRuD.js} +1 -1
  33. package/dist/pages.js +5 -4
  34. package/dist/{schedule-C89oiqIR.js → schedule-DD50-7cs.js} +1 -1
  35. package/dist/{send-default-agent-team-message-CxkWi3XC.js → send-default-agent-team-message-Bbs2rMNf.js} +1 -1
  36. package/dist/{sso-user-BE1Ell5F.js → sso-user-BEY5ICaR.js} +1 -1
  37. package/dist/{training-o-vSBkqP.js → training-B-9tNFQw.js} +1 -1
  38. package/dist/{useAppStore-wgWaxcyc.js → useAppStore-BQN-26ns.js} +1 -1
  39. package/dist/{webide-BxD6cYe-.js → webide-P867RFZi.js} +4 -4
  40. package/dist/z-team-component.css +1 -1
  41. package/package.json +3 -3
  42. package/dist/ProjectApp-BquB_X7K.js +0 -4591
  43. package/dist/api-CX7MUpws.js +0 -19
  44. package/dist/index-CcTdM5kT.js +0 -178
  45. package/dist/index-pfzY68PH.js +0 -1408
@@ -1,8 +1,11 @@
1
- import { jsxs as p, jsx as d } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as d } from "react/jsx-runtime";
2
2
  import { message as T } from "antd";
3
3
  import { useState as b, useRef as D, useCallback as K, useEffect as J } from "react";
4
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", $ = { "project-env": Q };
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
+ };
6
9
  async function U(e, a) {
7
10
  const s = await e.text().catch(() => "");
8
11
  let i = {};
@@ -42,7 +45,7 @@ async function nt(e, a, s) {
42
45
  {
43
46
  method: "POST",
44
47
  credentials: "include",
45
- headers: { ...$, "Content-Type": "application/json" },
48
+ headers: { Accept: "application/json", ...$, "Content-Type": "application/json" },
46
49
  body: JSON.stringify({
47
50
  message: a,
48
51
  ...s != null && s.trim() ? { model: s.trim() } : {}
@@ -70,7 +73,7 @@ function st(e, a) {
70
73
  return i;
71
74
  }
72
75
  async function ot(e, a, s, i) {
73
- var N, m;
76
+ var N, p;
74
77
  const g = await fetch(
75
78
  `${x}/sessions/${encodeURIComponent(e)}/chat/stream`,
76
79
  {
@@ -100,10 +103,10 @@ async function ot(e, a, s, i) {
100
103
  }
101
104
  } catch (f) {
102
105
  if ((N = s.signal) != null && N.aborted) return;
103
- throw (m = s.onError) == null || m.call(s, f instanceof Error ? f : new Error(String(f))), f;
106
+ throw (p = s.onError) == null || p.call(s, f instanceof Error ? f : new Error(String(f))), f;
104
107
  }
105
108
  }
106
- 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", mt = "_status_1u2ag_72", pt = "_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", kt = "_msgAgentBubble_1u2ag_162", At = "_toolHint_1u2ag_184", Et = "_inputArea_1u2ag_190", Ct = "_textarea_1u2ag_197", Tt = "_inputActions_1u2ag_215", xt = "_tokenUsage_1u2ag_222", o = {
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 = {
107
110
  page: at,
108
111
  header: rt,
109
112
  title: ct,
@@ -112,8 +115,8 @@ const at = "_page_1u2ag_1", rt = "_header_1u2ag_9", ct = "_title_1u2ag_16", it =
112
115
  modelInput: ut,
113
116
  btn: dt,
114
117
  btnSecondary: gt,
115
- status: mt,
116
- panel: pt,
118
+ status: pt,
119
+ panel: mt,
117
120
  messages: ft,
118
121
  empty: _t,
119
122
  msgOwn: ht,
@@ -123,8 +126,8 @@ const at = "_page_1u2ag_1", rt = "_header_1u2ag_9", ct = "_title_1u2ag_16", it =
123
126
  msgAgentBody: vt,
124
127
  msgMeta: St,
125
128
  reasoning: Nt,
126
- msgAgentBubble: kt,
127
- toolHint: At,
129
+ msgAgentBubble: At,
130
+ toolHint: kt,
128
131
  inputArea: Et,
129
132
  textarea: Ct,
130
133
  inputActions: Tt,
@@ -162,17 +165,17 @@ function S() {
162
165
  function Bt(e, a) {
163
166
  return { id: e, role: "assistant", parts: [], streaming: a };
164
167
  }
165
- function Pt() {
166
- const [e, a] = b(""), [s, i] = b(Ot), [g, u] = b([]), [_, h] = b(""), [N, m] = b(""), [f, w] = b(!1), [k, I] = b(!1), A = D(null), M = D(null), E = D(
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(
167
170
  /* @__PURE__ */ new Map()
168
- ), P = K(() => {
171
+ ), M = K(() => {
169
172
  var t;
170
- (t = M.current) == null || t.scrollIntoView({ behavior: "smooth" });
173
+ (t = I.current) == null || t.scrollIntoView({ behavior: "smooth" });
171
174
  }, []);
172
175
  J(() => {
173
- P();
174
- }, [g, P]);
175
- const R = (t) => {
176
+ M();
177
+ }, [g, M]);
178
+ const P = (t) => {
176
179
  u(
177
180
  t.map(
178
181
  (n) => n.role === "user" ? { id: S(), role: "user", content: n.content || "" } : {
@@ -182,27 +185,27 @@ function Pt() {
182
185
  }
183
186
  )
184
187
  );
185
- }, j = K(async () => {
186
- w(!0), m("创建会话…");
188
+ }, R = K(async () => {
189
+ w(!0), p("创建会话…");
187
190
  try {
188
191
  const t = await tt(s);
189
- a(t.sessionId), R(t.messages || []), m("");
192
+ a(t.sessionId), P(t.messages || []), p("");
190
193
  } catch (t) {
191
194
  const n = t instanceof Error ? t.message : "创建失败";
192
- m(n), T.error(n);
195
+ p(n), T.error(n);
193
196
  } finally {
194
197
  w(!1);
195
198
  }
196
199
  }, [s]);
197
200
  J(() => {
198
- j();
201
+ R();
199
202
  }, []);
200
203
  const V = async () => {
201
204
  if (e) {
202
- m("刷新中…");
205
+ p("刷新中…");
203
206
  try {
204
207
  const t = await et(e);
205
- R(t.messages || []), m("");
208
+ P(t.messages || []), p("");
206
209
  } catch (t) {
207
210
  T.error(t instanceof Error ? t.message : "刷新失败");
208
211
  }
@@ -259,38 +262,38 @@ function Pt() {
259
262
  }, H = async () => {
260
263
  var l, r;
261
264
  const t = _.trim();
262
- if (!t || !e || k) return;
265
+ if (!t || !e || A) return;
263
266
  h(""), u((c) => [
264
267
  ...c,
265
268
  { id: S(), role: "user", content: t }
266
269
  ]);
267
270
  const n = F();
268
- I(!0), m("生成中…"), (l = A.current) == null || l.abort(), A.current = new AbortController();
271
+ j(!0), p("生成中…"), (l = k.current) == null || l.abort(), k.current = new AbortController();
269
272
  try {
270
273
  await ot(
271
274
  e,
272
275
  t,
273
276
  {
274
- signal: A.current.signal,
277
+ signal: k.current.signal,
275
278
  onEvent: (c) => W(n, c)
276
279
  },
277
280
  s
278
- ), O(n, { streaming: !1 }), E.current.delete(n), m("");
281
+ ), O(n, { streaming: !1 }), E.current.delete(n), p("");
279
282
  } catch (c) {
280
- if (!((r = A.current) != null && r.signal.aborted)) {
283
+ if (!((r = k.current) != null && r.signal.aborted)) {
281
284
  const y = c instanceof Error ? c.message : "流式失败";
282
- T.error(y), v(n, "token", `[失败] ${y}`), O(n, { streaming: !1 }), m(y);
285
+ T.error(y), v(n, "token", `[失败] ${y}`), O(n, { streaming: !1 }), p(y);
283
286
  }
284
287
  } finally {
285
- I(!1);
288
+ j(!1);
286
289
  }
287
290
  }, q = async () => {
288
291
  const t = _.trim();
289
- if (!(!t || !e || k)) {
292
+ if (!(!t || !e || A)) {
290
293
  h(""), u((n) => [
291
294
  ...n,
292
295
  { id: S(), role: "user", content: t }
293
- ]), w(!0), m("同步请求中…");
296
+ ]), w(!0), p("同步请求中…");
294
297
  try {
295
298
  const n = await nt(e, t, s);
296
299
  u((l) => [
@@ -300,19 +303,19 @@ function Pt() {
300
303
  role: "assistant",
301
304
  parts: L(n.reply || "")
302
305
  }
303
- ]), m("");
306
+ ]), p("");
304
307
  } catch (n) {
305
308
  T.error(n instanceof Error ? n.message : "发送失败");
306
309
  } finally {
307
310
  w(!1);
308
311
  }
309
312
  }
310
- }, C = !e || f || k;
311
- return /* @__PURE__ */ p("div", { className: o.page, children: [
312
- /* @__PURE__ */ p("div", { className: o.header, children: [
313
+ }, C = !e || f || A;
314
+ return /* @__PURE__ */ m("div", { className: o.page, children: [
315
+ /* @__PURE__ */ m("div", { className: o.header, children: [
313
316
  /* @__PURE__ */ d("div", { className: o.title, children: "AINative Chat Demo" }),
314
317
  /* @__PURE__ */ d("div", { className: o.sub, children: e ? `Session: ${e} · SSE(非 WebSocket)` : "正在初始化…" }),
315
- /* @__PURE__ */ p("div", { className: o.toolbar, children: [
318
+ /* @__PURE__ */ m("div", { className: o.toolbar, children: [
316
319
  /* @__PURE__ */ d(
317
320
  "input",
318
321
  {
@@ -327,8 +330,8 @@ function Pt() {
327
330
  {
328
331
  type: "button",
329
332
  className: o.btnSecondary,
330
- onClick: j,
331
- disabled: f || k,
333
+ onClick: R,
334
+ disabled: f || A,
332
335
  children: "新会话"
333
336
  }
334
337
  ),
@@ -345,29 +348,29 @@ function Pt() {
345
348
  ] })
346
349
  ] }),
347
350
  N ? /* @__PURE__ */ d("div", { className: o.status, children: N }) : null,
348
- /* @__PURE__ */ p("div", { className: o.panel, children: [
349
- /* @__PURE__ */ p("div", { className: o.messages, children: [
351
+ /* @__PURE__ */ m("div", { className: o.panel, children: [
352
+ /* @__PURE__ */ m("div", { className: o.messages, children: [
350
353
  g.length === 0 ? /* @__PURE__ */ d("div", { className: o.empty, children: "发送消息开始对话" }) : null,
351
354
  g.map(
352
- (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__ */ p("div", { className: o.msgAgent, children: [
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: [
353
356
  /* @__PURE__ */ d("div", { className: o.avatar, children: "🤖" }),
354
- /* @__PURE__ */ p("div", { className: o.msgAgentBody, children: [
355
- /* @__PURE__ */ p("div", { className: o.msgMeta, children: [
357
+ /* @__PURE__ */ m("div", { className: o.msgAgentBody, children: [
358
+ /* @__PURE__ */ m("div", { className: o.msgMeta, children: [
356
359
  "Assistant",
357
360
  t.streaming ? " · 生成中" : ""
358
361
  ] }),
359
362
  t.parts.length === 0 && t.streaming ? /* @__PURE__ */ d("div", { className: o.msgAgentBubble, children: "…" }) : null,
360
363
  t.parts.map((n, l) => {
361
364
  const c = l === t.parts.length - 1 && t.streaming ? "…" : "";
362
- return n.kind === "reasoning" ? /* @__PURE__ */ p("div", { className: o.reasoning, children: [
365
+ return n.kind === "reasoning" ? /* @__PURE__ */ m("div", { className: o.reasoning, children: [
363
366
  n.content,
364
367
  c
365
- ] }, l) : n.kind === "text" ? /* @__PURE__ */ p("div", { className: o.msgAgentBubble, children: [
368
+ ] }, l) : n.kind === "text" ? /* @__PURE__ */ m("div", { className: o.msgAgentBubble, children: [
366
369
  n.content,
367
370
  c
368
371
  ] }, l) : /* @__PURE__ */ d("div", { className: o.toolHint, children: n.hint }, l);
369
372
  }),
370
- t.tokenUsage && !t.streaming ? /* @__PURE__ */ p("div", { className: o.tokenUsage, children: [
373
+ t.tokenUsage && !t.streaming ? /* @__PURE__ */ m("div", { className: o.tokenUsage, children: [
371
374
  "Token in ",
372
375
  t.tokenUsage.inputTokenCount ?? 0,
373
376
  " / out",
@@ -380,9 +383,9 @@ function Pt() {
380
383
  ] })
381
384
  ] }, t.id) : null
382
385
  ),
383
- /* @__PURE__ */ d("div", { ref: M })
386
+ /* @__PURE__ */ d("div", { ref: I })
384
387
  ] }),
385
- /* @__PURE__ */ p("div", { className: o.inputArea, children: [
388
+ /* @__PURE__ */ m("div", { className: o.inputArea, children: [
386
389
  /* @__PURE__ */ d(
387
390
  "textarea",
388
391
  {
@@ -396,7 +399,7 @@ function Pt() {
396
399
  }
397
400
  }
398
401
  ),
399
- /* @__PURE__ */ p("div", { className: o.inputActions, children: [
402
+ /* @__PURE__ */ m("div", { className: o.inputActions, children: [
400
403
  /* @__PURE__ */ d(
401
404
  "button",
402
405
  {
@@ -423,5 +426,5 @@ function Pt() {
423
426
  ] });
424
427
  }
425
428
  export {
426
- Pt as default
429
+ Mt as default
427
430
  };