@yuku123/z-team-component 0.2.93 → 0.2.94

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 (46) hide show
  1. package/dist/{ChangeLogView-BjV4gBq4.js → ChangeLogView-DY_k1B64.js} +1 -1
  2. package/dist/{ComponentDoc-C9lt-45y.js → ComponentDoc-DOki_RNN.js} +28 -28
  3. package/dist/{InvitationManagementPage-CWtBWLd9.js → InvitationManagementPage-BY_80aYm.js} +1 -1
  4. package/dist/{OnboardingPage-B2fwh4gu.js → OnboardingPage-BJbMBrxH.js} +2 -2
  5. package/dist/ScheduledTasks-XTkQqn4w.js +12127 -0
  6. package/dist/{SystemShell-CTkRb3jk.js → SystemShell--qM7HCyt.js} +4 -4
  7. package/dist/{admin-logs-Dh41ezP6.js → admin-logs-Co7fE3re.js} +1 -1
  8. package/dist/{api-ChrRZOc4.js → api-775Bo4Bj.js} +1 -1
  9. package/dist/{createWorkspaceWsHandler-DMw_Vk6i.js → createWorkspaceWsHandler-BRfhB79M.js} +2572 -2565
  10. package/dist/{index-DdvzONMo.js → index-6st3qQNt.js} +3804 -3644
  11. package/dist/{index-CSXrOBjf.js → index-90EqwtNF.js} +5 -5
  12. package/dist/{index-CdqU0NUf.js → index-BIBfRHFf.js} +6 -6
  13. package/dist/{index-BnRRZ6Iv.js → index-BN3cy1Tm.js} +1 -1
  14. package/dist/{index-BYpA6zMn.js → index-BPD6fg3O.js} +2 -2
  15. package/dist/{index-DNo7i9f6.js → index-BSKD9lop.js} +3 -3
  16. package/dist/index-B_bk9bXb.js +189 -0
  17. package/dist/{index-Dy6vNz1c.js → index-BbFdWpYR.js} +4 -4
  18. package/dist/index-BjKdHw8Y.js +2217 -0
  19. package/dist/{index-CLSOhZRs.js → index-ByP1umXq.js} +2 -2
  20. package/dist/{index-Dq4oBpcb.js → index-C6r-MO3V.js} +2 -2
  21. package/dist/{index-C-XgeN0c.js → index-C7YHxq-O.js} +2 -2
  22. package/dist/{index-B_2fxZ6u.js → index-CEcQbI8N.js} +1 -1
  23. package/dist/{index-3JPBTMXq.js → index-CJMqiJom.js} +3 -3
  24. package/dist/{index-bkqC-Ys8.js → index-CP_x_8X-.js} +1 -1
  25. package/dist/{index-CLnmI_a7.js → index-CXQuOt1Z.js} +1 -1
  26. package/dist/{index-fab1eszg.js → index-Cee4Cg7R.js} +3 -3
  27. package/dist/{index-CIGBLmd6.js → index-CiJ5zEUK.js} +2 -2
  28. package/dist/{index-CnWYolUK.js → index-DRCHSrIn.js} +1 -1
  29. package/dist/{index-DtIPLfks.js → index-Df7MVpNC.js} +3 -3
  30. package/dist/{index-7glbcqX1.js → index-DzwWNvrE.js} +3 -3
  31. package/dist/{index-vIdK5WMU.js → index-OUSBycnF.js} +1 -1
  32. package/dist/{index-D1_tbmUH.js → index-eczy0dAy.js} +2 -2
  33. package/dist/{index-CrQpBHe1.js → index-yPSZNONn.js} +2 -2
  34. package/dist/index.js +1 -1
  35. package/dist/{instance-BY043pYn.js → instance-DZ2M9ud2.js} +1 -1
  36. package/dist/{menuPermission-BeYwZcoW.js → menuPermission-PpL-QSl7.js} +3 -3
  37. package/dist/pages.js +1 -1
  38. package/dist/{send-default-agent-team-message-BN61cG7q.js → send-default-agent-team-message-CMRf10FQ.js} +1 -1
  39. package/dist/{sso-user-DmsDr1MJ.js → sso-user-DRpyYb-C.js} +1 -1
  40. package/dist/{training-CU6j5m-5.js → training-Dgpwp_Hu.js} +1 -1
  41. package/dist/{webide-BYaEjOx6.js → webide-B83YQ9p1.js} +3 -3
  42. package/dist/z-team-component.css +1 -1
  43. package/package.json +1 -1
  44. package/dist/ScheduledTasks-CuQyjAK-.js +0 -10851
  45. package/dist/index-CA0ql0r3.js +0 -3495
  46. package/dist/index-DPyEBso8.js +0 -150
@@ -0,0 +1,2217 @@
1
+ import { jsxs as i, jsx as e, Fragment as ge } from "react/jsx-runtime";
2
+ import { S as Tn, P as In } from "./webide-B83YQ9p1.js";
3
+ import { message as Me, Tooltip as Qe, Dropdown as fn } from "antd";
4
+ import { MessageOutlined as Sn, MoreOutlined as st, DashboardOutlined as Ln, MenuUnfoldOutlined as lt, MenuFoldOutlined as ot, RightOutlined as it, SettingOutlined as An, TeamOutlined as ct, FolderOpenOutlined as rt, BarChartOutlined as dt, PieChartOutlined as ut, CodeOutlined as mt, LinkOutlined as pt, UnorderedListOutlined as On, FileTextOutlined as nn, ReadOutlined as ht, ConsoleSqlOutlined as gt, PlayCircleOutlined as bt, PlusOutlined as yt, ClockCircleOutlined as ft, AppstoreOutlined as vt } from "@ant-design/icons";
5
+ import { useState as d, useRef as Oe, useCallback as U, useEffect as A, useMemo as X } from "react";
6
+ import { d as re, _ as Dn, n as q, $ as Nt, a0 as _t, a1 as kt, a2 as Ct, a3 as wt, a4 as Tt, t as It, a5 as St, a6 as je, a7 as Lt, a8 as At } from "./ComponentDoc-DOki_RNN.js";
7
+ import { f as Xe, c as Ye, a as Ot, d as Dt, b as $n, s, T as $t, R as Je, D as Ke, e as xt, g as Bt, F as qe, P as Rt, L as Pt, A as Et, C as Mt, h as jt, i as Ht, p as Ft, j as Kt, k as vn, l as Nn, W as Wt, m as Ut, S as Vt, n as Gt, o as Zt, r as zt, q as Qt, U as Xt, t as Yt, u as Jt, v as qt } from "./index-6st3qQNt.js";
8
+ import { a as Fe, u as xn, i as ea, s as _n } from "./createWorkspaceWsHandler-BRfhB79M.js";
9
+ import { h as Bn, f as na } from "./index-CXQuOt1Z.js";
10
+ import { W as en, b as We, T as Rn, c as Pn, a as En, L as Mn, P as jn, S as ta, E as aa, C as sa } from "./ScheduledTasks-XTkQqn4w.js";
11
+ import { TodoTab as Hn } from "@yuku123/z-task-component";
12
+ const la = "_sidebarInner_1vu3c_1", oa = "_header_1vu3c_8", ia = "_headerActions_1vu3c_19", ca = "_tabBar_1vu3c_26", ra = "_tab_1vu3c_26", da = "_tabActive_1vu3c_50", ua = "_btnSm_1vu3c_66", ma = "_agentSection_1vu3c_84", pa = "_agentItem_1vu3c_90", ha = "_agentItemActive_1vu3c_112", ga = "_agentAvatar_1vu3c_117", ba = "_agentName_1vu3c_130", ya = "_emptyState_1vu3c_156", fa = "_createInputRow_1vu3c_168", va = "_createInput_1vu3c_168", Na = "_createConfirmBtn_1vu3c_188", _a = "_contextMenu_1vu3c_205", ka = "_contextMenuItem_1vu3c_216", Ca = "_contextMenuItemDanger_1vu3c_231", wa = "_contextMenuDivider_1vu3c_239", Ta = "_renameOverlay_1vu3c_246", Ia = "_renameDialog_1vu3c_259", Sa = "_renameTitle_1vu3c_267", La = "_renameInput_1vu3c_274", Aa = "_renameActions_1vu3c_289", Oa = "_renameBtn_1vu3c_295", Da = "_renameBtnPrimary_1vu3c_309", $a = "_agentDetailBtn_1vu3c_326", xa = "_agentItemShared_1vu3c_358", Ba = "_agentInfo_1vu3c_362", Ra = "_agentOwner_1vu3c_374", Pa = "_sharedBadge_1vu3c_382", Ea = "_createLocalDialog_1vu3c_430", Ma = "_createLocalLabel_1vu3c_438", ja = "_agentTypeCards_1vu3c_446", Ha = "_agentTypeCard_1vu3c_446", Fa = "_agentTypeIcon_1vu3c_474", Ka = "_agentTypeBody_1vu3c_487", Wa = "_agentTypeTitle_1vu3c_494", Ua = "_agentTypeDesc_1vu3c_500", Va = "_agentTypeBadge_1vu3c_506", l = {
13
+ sidebarInner: la,
14
+ header: oa,
15
+ headerActions: ia,
16
+ tabBar: ca,
17
+ tab: ra,
18
+ tabActive: da,
19
+ btnSm: ua,
20
+ agentSection: ma,
21
+ agentItem: pa,
22
+ agentItemActive: ha,
23
+ agentAvatar: ga,
24
+ agentName: ba,
25
+ emptyState: ya,
26
+ createInputRow: fa,
27
+ createInput: va,
28
+ createConfirmBtn: Na,
29
+ contextMenu: _a,
30
+ contextMenuItem: ka,
31
+ contextMenuItemDanger: Ca,
32
+ contextMenuDivider: wa,
33
+ renameOverlay: Ta,
34
+ renameDialog: Ia,
35
+ renameTitle: Sa,
36
+ renameInput: La,
37
+ renameActions: Aa,
38
+ renameBtn: Oa,
39
+ renameBtnPrimary: Da,
40
+ agentDetailBtn: $a,
41
+ agentItemShared: xa,
42
+ agentInfo: Ba,
43
+ agentOwner: Ra,
44
+ sharedBadge: Pa,
45
+ createLocalDialog: Ea,
46
+ createLocalLabel: Ma,
47
+ agentTypeCards: ja,
48
+ agentTypeCard: Ha,
49
+ agentTypeIcon: Fa,
50
+ agentTypeBody: Ka,
51
+ agentTypeTitle: Wa,
52
+ agentTypeDesc: Ua,
53
+ agentTypeBadge: Va
54
+ }, kn = [
55
+ "#2F70F1",
56
+ "#52c41a",
57
+ "#fa8c16",
58
+ "#eb2f96",
59
+ "#722ed1",
60
+ "#13c2c2",
61
+ "#f5222d",
62
+ "#faad14"
63
+ ];
64
+ function Cn(c) {
65
+ let m = 0;
66
+ for (let p = 0; p < c.length; p++) m = m * 31 + c.charCodeAt(p) | 0;
67
+ return kn[Math.abs(m) % kn.length];
68
+ }
69
+ function wn(c) {
70
+ return c ? c.charAt(0).toUpperCase() : "?";
71
+ }
72
+ const He = "-1";
73
+ function Ga({
74
+ selectedAgentId: c,
75
+ selectedLocalAgentId: m,
76
+ onSelectAgent: p,
77
+ onShowDetail: N,
78
+ onChatWithAgent: C
79
+ }) {
80
+ const T = re((t) => t.token), g = re((t) => t.personalChatNav), [I, B] = d(
81
+ g.tab === "shared" ? "shared" : "remote"
82
+ ), [S, R] = d([]), [j, O] = d(!1), [y, b] = d(!1), [P, _] = d(""), [D, E] = d(!1), [L, F] = d(null), [M, $] = d(null), [Z, oe] = d(!1), [V, w] = d([]), [K, h] = d(!1), [ie, Y] = d(null), [we, ee] = d(!1), [Te, Ie] = d([]), [be, ce] = d(!1), [ne, De] = d(!1), ye = Oe(null), z = U(async () => {
83
+ O(!0);
84
+ try {
85
+ const t = await Dn(T);
86
+ R(t), c && !t.find((f) => q(f.id, c)) && p(null);
87
+ } catch {
88
+ } finally {
89
+ O(!1);
90
+ }
91
+ }, [T, c, p]), fe = U(async () => {
92
+ h(!0);
93
+ try {
94
+ const t = await Nt(T);
95
+ w(t);
96
+ } catch {
97
+ } finally {
98
+ h(!1);
99
+ }
100
+ }, [T]);
101
+ A(() => {
102
+ g.trigger > 0 && g.tab && B(g.tab);
103
+ }, [g.trigger]), A(() => {
104
+ I === "remote" ? z() : I === "shared" && fe();
105
+ }, [z, fe, I]);
106
+ const de = U(async () => {
107
+ try {
108
+ const t = await Xe();
109
+ Ie(t);
110
+ } catch {
111
+ Ie([]);
112
+ }
113
+ }, []);
114
+ A(() => {
115
+ I === "local" && Ye().then((t) => {
116
+ ee(t), t && de();
117
+ });
118
+ }, [I, de]), A(() => {
119
+ if (!L) return;
120
+ const t = (f) => {
121
+ ye.current && !ye.current.contains(f.target) && F(null);
122
+ };
123
+ return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
124
+ }, [L]);
125
+ const ue = async () => {
126
+ const t = P.trim();
127
+ if (t) {
128
+ E(!0);
129
+ try {
130
+ const f = await _t(t, T);
131
+ R((W) => [...W, f]), _(""), b(!1), p(f);
132
+ } catch {
133
+ } finally {
134
+ E(!1);
135
+ }
136
+ }
137
+ }, Se = async (t) => {
138
+ if (t === "jar") {
139
+ ce(!1), C({
140
+ id: He,
141
+ userId: "local",
142
+ agentHubAgentId: null,
143
+ agentCode: "local-default",
144
+ displayName: "本地 Agent",
145
+ avatar: null,
146
+ isLocal: !0
147
+ });
148
+ return;
149
+ }
150
+ if (!we) {
151
+ if (!await Ye()) {
152
+ Me.error(
153
+ "本地 Agent 未启动,请通过菜单栏「重启 Agent」启动后再试"
154
+ );
155
+ return;
156
+ }
157
+ ee(!0);
158
+ }
159
+ De(!0);
160
+ try {
161
+ const f = t === "hermes" ? "hermes" : "claude-code";
162
+ await Ot(f, t), Me.success(`已引入 ${f},点击列表项即可开始对话`), ce(!1), await de();
163
+ } catch (f) {
164
+ Me.error(
165
+ f.message || "创建失败,请检查本地 Agent 是否正常运行"
166
+ );
167
+ } finally {
168
+ De(!1);
169
+ }
170
+ }, $e = async (t) => {
171
+ if (await Fe({ content: "确定删除此 Agent?" }))
172
+ try {
173
+ await Dt(t), await de();
174
+ } catch (f) {
175
+ Me.error(f.message || "删除失败");
176
+ }
177
+ }, te = async (t) => {
178
+ if (await Fe({
179
+ content: `确定删除 Agent「${t.displayName}」吗?所有会话记录将一并删除。`
180
+ }))
181
+ try {
182
+ await kt(t.id, T), R((f) => f.filter((W) => W.id !== t.id)), q(c, t.id) && p(null);
183
+ } catch {
184
+ }
185
+ }, Le = async () => {
186
+ if (!M) return;
187
+ const t = M.value.trim();
188
+ if (!t || t === M.agent.displayName) {
189
+ $(null);
190
+ return;
191
+ }
192
+ oe(!0);
193
+ try {
194
+ const f = await Ct(
195
+ M.agent.id,
196
+ t,
197
+ T
198
+ );
199
+ R((W) => W.map((Ne) => Ne.id === f.id ? f : Ne)), q(c, f.id) && p(f), $(null);
200
+ } catch {
201
+ } finally {
202
+ oe(!1);
203
+ }
204
+ }, J = async (t) => {
205
+ const f = t.shared === 1;
206
+ if (await Fe({
207
+ title: f ? "取消共享" : "共享 Agent",
208
+ content: f ? `确定取消共享 Agent「${t.displayName}」吗?取消后其他用户将无法与此 Agent 聊天。` : `确定共享 Agent「${t.displayName}」吗?共享后其他用户可以与此 Agent 发起聊天。`,
209
+ danger: !1
210
+ })) {
211
+ Y(t.id);
212
+ try {
213
+ const W = await wt(
214
+ t.id,
215
+ !f,
216
+ T
217
+ );
218
+ R((Ne) => Ne.map((H) => H.id === W.id ? W : H));
219
+ } catch {
220
+ } finally {
221
+ Y(null);
222
+ }
223
+ }
224
+ }, ve = (t, f) => {
225
+ t.preventDefault(), t.stopPropagation(), F({ x: t.clientX, y: t.clientY, agent: f });
226
+ };
227
+ return /* @__PURE__ */ i("div", { className: l.sidebarInner, children: [
228
+ /* @__PURE__ */ i("div", { className: l.header, children: [
229
+ /* @__PURE__ */ e("span", { children: "个人 Agent" }),
230
+ I === "remote" && /* @__PURE__ */ e("div", { className: l.headerActions, children: /* @__PURE__ */ e(
231
+ "button",
232
+ {
233
+ type: "button",
234
+ className: l.btnSm,
235
+ onClick: () => {
236
+ b((t) => !t), _("");
237
+ },
238
+ title: "新建个人 Agent",
239
+ children: "+ 新建"
240
+ }
241
+ ) }),
242
+ I === "local" && /* @__PURE__ */ e("div", { className: l.headerActions, children: /* @__PURE__ */ e(
243
+ "button",
244
+ {
245
+ type: "button",
246
+ className: l.btnSm,
247
+ onClick: () => ce(!0),
248
+ title: "新建本地 Agent",
249
+ children: "+ 新增"
250
+ }
251
+ ) })
252
+ ] }),
253
+ /* @__PURE__ */ i("div", { className: l.tabBar, children: [
254
+ /* @__PURE__ */ e(
255
+ "button",
256
+ {
257
+ type: "button",
258
+ className: `${l.tab} ${I === "local" ? l.tabActive : ""}`,
259
+ onClick: () => B("local"),
260
+ title: "本地 Agent",
261
+ children: "本地"
262
+ }
263
+ ),
264
+ /* @__PURE__ */ e(
265
+ "button",
266
+ {
267
+ type: "button",
268
+ className: `${l.tab} ${I === "remote" ? l.tabActive : ""}`,
269
+ onClick: () => B("remote"),
270
+ children: "远程"
271
+ }
272
+ ),
273
+ /* @__PURE__ */ e(
274
+ "button",
275
+ {
276
+ type: "button",
277
+ className: `${l.tab} ${I === "shared" ? l.tabActive : ""}`,
278
+ onClick: () => B("shared"),
279
+ children: "共享"
280
+ }
281
+ )
282
+ ] }),
283
+ I === "local" ? /* @__PURE__ */ e("div", { className: l.agentSection, children: we ? /* @__PURE__ */ e(ge, { children: Te.map((t) => /* @__PURE__ */ i(
284
+ "div",
285
+ {
286
+ className: `${l.agentItem} ${q(c, He) && (t.type === "jar" && !m || m === t.id) ? l.agentItemActive : ""}`,
287
+ onClick: () => {
288
+ t.type === "jar" ? p({
289
+ id: He,
290
+ userId: "local",
291
+ agentHubAgentId: null,
292
+ agentCode: "local-default",
293
+ displayName: t.name,
294
+ avatar: null,
295
+ isLocal: !0
296
+ }) : p({
297
+ id: He,
298
+ userId: "local",
299
+ agentHubAgentId: null,
300
+ agentCode: t.name,
301
+ displayName: t.name,
302
+ avatar: null,
303
+ isLocal: !0,
304
+ localAgentId: t.id,
305
+ localAgentType: t.type
306
+ });
307
+ },
308
+ children: [
309
+ /* @__PURE__ */ e(
310
+ "div",
311
+ {
312
+ className: l.agentAvatar,
313
+ style: {
314
+ backgroundColor: t.type === "hermes" ? "#722ed1" : t.type === "claude-code" ? "#eb2f96" : "#52c41a"
315
+ },
316
+ children: t.type === "hermes" ? "H" : t.type === "claude-code" ? "C" : "L"
317
+ }
318
+ ),
319
+ /* @__PURE__ */ e("span", { className: l.agentName, children: t.name }),
320
+ t.type !== "jar" && /* @__PURE__ */ e(
321
+ "button",
322
+ {
323
+ type: "button",
324
+ className: l.agentDetailBtn,
325
+ onClick: (f) => {
326
+ f.stopPropagation(), $e(t.id);
327
+ },
328
+ title: "删除",
329
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 14 }, children: "×" })
330
+ }
331
+ )
332
+ ]
333
+ },
334
+ t.id
335
+ )) }) : /* @__PURE__ */ i("div", { className: l.emptyState, children: [
336
+ /* @__PURE__ */ e("span", { children: "本地 Agent 未启动" }),
337
+ /* @__PURE__ */ e("span", { children: "请检查桌面端是否正常运行" })
338
+ ] }) }) : I === "shared" ? /* @__PURE__ */ e("div", { className: l.agentSection, children: K && V.length === 0 ? /* @__PURE__ */ e("div", { className: l.emptyState, children: "加载中..." }) : V.length === 0 ? /* @__PURE__ */ i("div", { className: l.emptyState, children: [
339
+ /* @__PURE__ */ e("span", { children: "暂无共享 Agent" }),
340
+ /* @__PURE__ */ e("span", { children: "其他用户共享的 Agent 会显示在这里" })
341
+ ] }) : V.map((t) => /* @__PURE__ */ i(
342
+ "div",
343
+ {
344
+ className: `${l.agentItem} ${l.agentItemShared}`,
345
+ onClick: () => C(t),
346
+ title: `点击与「${t.displayName}」聊天`,
347
+ children: [
348
+ /* @__PURE__ */ e(
349
+ "div",
350
+ {
351
+ className: l.agentAvatar,
352
+ style: {
353
+ backgroundColor: Cn(
354
+ t.agentCode || t.displayName
355
+ )
356
+ },
357
+ children: wn(t.displayName)
358
+ }
359
+ ),
360
+ /* @__PURE__ */ i("div", { className: l.agentInfo, children: [
361
+ /* @__PURE__ */ e("span", { className: l.agentName, children: t.displayName }),
362
+ /* @__PURE__ */ i("span", { className: l.agentOwner, children: [
363
+ "来自: ",
364
+ t.userId
365
+ ] })
366
+ ] }),
367
+ /* @__PURE__ */ e(
368
+ "button",
369
+ {
370
+ type: "button",
371
+ className: l.agentDetailBtn,
372
+ onClick: (f) => {
373
+ f.stopPropagation(), C(t);
374
+ },
375
+ title: "开始聊天",
376
+ children: /* @__PURE__ */ e(Sn, { style: { fontSize: 12 } })
377
+ }
378
+ )
379
+ ]
380
+ },
381
+ t.id
382
+ )) }) : /* @__PURE__ */ i(ge, { children: [
383
+ y && /* @__PURE__ */ i("div", { className: l.createInputRow, children: [
384
+ /* @__PURE__ */ e(
385
+ "input",
386
+ {
387
+ className: l.createInput,
388
+ type: "text",
389
+ placeholder: "输入 Agent 名称",
390
+ value: P,
391
+ autoFocus: !0,
392
+ onChange: (t) => _(t.target.value),
393
+ onKeyDown: (t) => {
394
+ t.key === "Enter" && ue(), t.key === "Escape" && (b(!1), _(""));
395
+ }
396
+ }
397
+ ),
398
+ /* @__PURE__ */ e(
399
+ "button",
400
+ {
401
+ type: "button",
402
+ className: l.createConfirmBtn,
403
+ disabled: !P.trim() || D,
404
+ onClick: ue,
405
+ children: D ? "..." : "创建"
406
+ }
407
+ )
408
+ ] }),
409
+ /* @__PURE__ */ e("div", { className: l.agentSection, children: j && S.length === 0 ? /* @__PURE__ */ e("div", { className: l.emptyState, children: "加载中..." }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: l.emptyState, children: [
410
+ /* @__PURE__ */ e("span", { children: "暂无个人 Agent" }),
411
+ /* @__PURE__ */ e("span", { children: "点击「新建」创建一个" })
412
+ ] }) : S.map((t) => /* @__PURE__ */ i(
413
+ "div",
414
+ {
415
+ className: `${l.agentItem} ${q(c, t.id) ? l.agentItemActive : ""}`,
416
+ onClick: () => p(t),
417
+ onContextMenu: (f) => ve(f, t),
418
+ children: [
419
+ /* @__PURE__ */ e(
420
+ "div",
421
+ {
422
+ className: l.agentAvatar,
423
+ style: {
424
+ backgroundColor: Cn(
425
+ t.agentCode || t.displayName
426
+ )
427
+ },
428
+ children: wn(t.displayName)
429
+ }
430
+ ),
431
+ /* @__PURE__ */ i("span", { className: l.agentName, children: [
432
+ t.displayName,
433
+ t.shared === 1 && /* @__PURE__ */ e("span", { className: l.sharedBadge, children: "共享" })
434
+ ] }),
435
+ /* @__PURE__ */ e(
436
+ "button",
437
+ {
438
+ type: "button",
439
+ className: l.agentDetailBtn,
440
+ onClick: (f) => {
441
+ f.stopPropagation();
442
+ const W = f.currentTarget.getBoundingClientRect();
443
+ F({
444
+ x: W.right - 120,
445
+ y: W.bottom + 4,
446
+ agent: t
447
+ });
448
+ },
449
+ title: "更多操作",
450
+ children: /* @__PURE__ */ e(st, { style: { fontSize: 14 } })
451
+ }
452
+ )
453
+ ]
454
+ },
455
+ t.id
456
+ )) })
457
+ ] }),
458
+ L && /* @__PURE__ */ i(
459
+ "div",
460
+ {
461
+ ref: ye,
462
+ className: l.contextMenu,
463
+ style: { top: L.y, left: L.x },
464
+ children: [
465
+ /* @__PURE__ */ e(
466
+ "div",
467
+ {
468
+ className: l.contextMenuItem,
469
+ onClick: () => {
470
+ C(L.agent), F(null);
471
+ },
472
+ children: "开始聊天"
473
+ }
474
+ ),
475
+ /* @__PURE__ */ e(
476
+ "div",
477
+ {
478
+ className: l.contextMenuItem,
479
+ onClick: () => {
480
+ N(L.agent), F(null);
481
+ },
482
+ children: "Agent 配置"
483
+ }
484
+ ),
485
+ /* @__PURE__ */ e("div", { className: l.contextMenuDivider }),
486
+ /* @__PURE__ */ e(
487
+ "div",
488
+ {
489
+ className: l.contextMenuItem,
490
+ onClick: () => {
491
+ $({
492
+ agent: L.agent,
493
+ value: L.agent.displayName
494
+ }), F(null);
495
+ },
496
+ children: "重命名"
497
+ }
498
+ ),
499
+ /* @__PURE__ */ e(
500
+ "div",
501
+ {
502
+ className: l.contextMenuItem,
503
+ onClick: () => {
504
+ ie === null && J(L.agent), F(null);
505
+ },
506
+ children: L.agent.shared === 1 ? "取消共享" : "共享给他人"
507
+ }
508
+ ),
509
+ /* @__PURE__ */ e("div", { className: l.contextMenuDivider }),
510
+ /* @__PURE__ */ e(
511
+ "div",
512
+ {
513
+ className: `${l.contextMenuItem} ${l.contextMenuItemDanger}`,
514
+ onClick: () => {
515
+ te(L.agent), F(null);
516
+ },
517
+ children: "删除"
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ ),
523
+ be && /* @__PURE__ */ e(
524
+ "div",
525
+ {
526
+ className: l.renameOverlay,
527
+ onClick: () => !ne && ce(!1),
528
+ children: /* @__PURE__ */ i(
529
+ "div",
530
+ {
531
+ className: l.createLocalDialog,
532
+ onClick: (t) => t.stopPropagation(),
533
+ children: [
534
+ /* @__PURE__ */ e("div", { className: l.renameTitle, children: "新建本地 Agent" }),
535
+ /* @__PURE__ */ e("div", { className: l.createLocalLabel, children: ne ? "正在创建..." : "点击选择,直接开始聊天" }),
536
+ /* @__PURE__ */ i("div", { className: l.agentTypeCards, children: [
537
+ /* @__PURE__ */ i(
538
+ "div",
539
+ {
540
+ className: l.agentTypeCard,
541
+ onClick: () => Se("jar"),
542
+ children: [
543
+ /* @__PURE__ */ e(
544
+ "div",
545
+ {
546
+ className: l.agentTypeIcon,
547
+ style: { backgroundColor: "#52c41a" },
548
+ children: "L"
549
+ }
550
+ ),
551
+ /* @__PURE__ */ i("div", { className: l.agentTypeBody, children: [
552
+ /* @__PURE__ */ i("div", { className: l.agentTypeTitle, children: [
553
+ "自研",
554
+ " ",
555
+ /* @__PURE__ */ e("span", { className: l.agentTypeBadge, children: "已运行" })
556
+ ] }),
557
+ /* @__PURE__ */ e("div", { className: l.agentTypeDesc, children: "自研 Java Agent,内置 ReAct 推理引擎与工具调用" })
558
+ ] })
559
+ ]
560
+ }
561
+ ),
562
+ /* @__PURE__ */ i(
563
+ "div",
564
+ {
565
+ className: l.agentTypeCard,
566
+ onClick: () => Se("hermes"),
567
+ children: [
568
+ /* @__PURE__ */ e(
569
+ "div",
570
+ {
571
+ className: l.agentTypeIcon,
572
+ style: { backgroundColor: "#722ed1" },
573
+ children: "H"
574
+ }
575
+ ),
576
+ /* @__PURE__ */ i("div", { className: l.agentTypeBody, children: [
577
+ /* @__PURE__ */ e("div", { className: l.agentTypeTitle, children: "Hermes" }),
578
+ /* @__PURE__ */ e("div", { className: l.agentTypeDesc, children: "本地 Hermes CLI,支持 tool-calling 与多模型切换" })
579
+ ] })
580
+ ]
581
+ }
582
+ ),
583
+ /* @__PURE__ */ i(
584
+ "div",
585
+ {
586
+ className: l.agentTypeCard,
587
+ onClick: () => Se("claude-code"),
588
+ children: [
589
+ /* @__PURE__ */ e(
590
+ "div",
591
+ {
592
+ className: l.agentTypeIcon,
593
+ style: { backgroundColor: "#eb2f96" },
594
+ children: "C"
595
+ }
596
+ ),
597
+ /* @__PURE__ */ i("div", { className: l.agentTypeBody, children: [
598
+ /* @__PURE__ */ e("div", { className: l.agentTypeTitle, children: "Claude Code" }),
599
+ /* @__PURE__ */ e("div", { className: l.agentTypeDesc, children: "Anthropic Claude CLI 编码助手" })
600
+ ] })
601
+ ]
602
+ }
603
+ )
604
+ ] }),
605
+ /* @__PURE__ */ e("div", { className: l.renameActions, children: /* @__PURE__ */ e(
606
+ "button",
607
+ {
608
+ type: "button",
609
+ className: l.renameBtn,
610
+ onClick: () => ce(!1),
611
+ disabled: ne,
612
+ children: "取消"
613
+ }
614
+ ) })
615
+ ]
616
+ }
617
+ )
618
+ }
619
+ ),
620
+ M && /* @__PURE__ */ e(
621
+ "div",
622
+ {
623
+ className: l.renameOverlay,
624
+ onClick: () => !Z && $(null),
625
+ children: /* @__PURE__ */ i(
626
+ "div",
627
+ {
628
+ className: l.renameDialog,
629
+ onClick: (t) => t.stopPropagation(),
630
+ children: [
631
+ /* @__PURE__ */ e("div", { className: l.renameTitle, children: "重命名 Agent" }),
632
+ /* @__PURE__ */ e(
633
+ "input",
634
+ {
635
+ className: l.renameInput,
636
+ type: "text",
637
+ value: M.value,
638
+ autoFocus: !0,
639
+ onChange: (t) => $({ ...M, value: t.target.value }),
640
+ onKeyDown: (t) => {
641
+ t.key === "Enter" && Le(), t.key === "Escape" && $(null);
642
+ }
643
+ }
644
+ ),
645
+ /* @__PURE__ */ i("div", { className: l.renameActions, children: [
646
+ /* @__PURE__ */ e(
647
+ "button",
648
+ {
649
+ type: "button",
650
+ className: l.renameBtn,
651
+ onClick: () => $(null),
652
+ disabled: Z,
653
+ children: "取消"
654
+ }
655
+ ),
656
+ /* @__PURE__ */ e(
657
+ "button",
658
+ {
659
+ type: "button",
660
+ className: l.renameBtnPrimary,
661
+ disabled: !M.value.trim() || Z,
662
+ onClick: Le,
663
+ children: Z ? "..." : "确定"
664
+ }
665
+ )
666
+ ] })
667
+ ]
668
+ }
669
+ )
670
+ }
671
+ )
672
+ ] });
673
+ }
674
+ const Za = "_shell_1w53k_2", za = "_inset_1w53k_33", Qa = "_main_1w53k_40", Xa = "_pane_1w53k_52", Ya = "_skipLink_1w53k_62", Ja = "_personalMainArea_1w53k_82", qa = "_personalSidebar_1w53k_90", es = "_personalChatArea_1w53k_103", pe = {
675
+ shell: Za,
676
+ inset: za,
677
+ main: Qa,
678
+ pane: Xa,
679
+ skipLink: Ya,
680
+ personalMainArea: Ja,
681
+ personalSidebar: qa,
682
+ personalChatArea: es
683
+ }, ns = "_sidebar_y5tuo_1", ts = "_collapsed_y5tuo_12", as = "_sideHeader_y5tuo_17", ss = "_sideHeaderIcon_y5tuo_32", ls = "_sideHeaderTitle_y5tuo_45", os = "_sideContent_y5tuo_54", is = "_groupLabel_y5tuo_61", cs = "_navList_y5tuo_71", rs = "_navItem_y5tuo_77", ds = "_navItemActive_y5tuo_109", us = "_navIcon_y5tuo_114", ms = "_navLabel_y5tuo_120", ps = "_sideFooter_y5tuo_131", hs = "_footHint_y5tuo_138", x = {
684
+ sidebar: ns,
685
+ collapsed: ts,
686
+ sideHeader: as,
687
+ sideHeaderIcon: ss,
688
+ sideHeaderTitle: ls,
689
+ sideContent: os,
690
+ groupLabel: is,
691
+ navList: cs,
692
+ navItem: rs,
693
+ navItemActive: ds,
694
+ navIcon: us,
695
+ navLabel: ms,
696
+ sideFooter: ps,
697
+ footHint: hs
698
+ };
699
+ function gs({
700
+ items: c,
701
+ activeTab: m,
702
+ collapsed: p,
703
+ footerItems: N,
704
+ onSelect: C,
705
+ onSwitchMode: T
706
+ }) {
707
+ return /* @__PURE__ */ i(
708
+ "aside",
709
+ {
710
+ className: `${x.sidebar} ${p ? x.collapsed : ""}`,
711
+ "aria-label": "个人工作台导航",
712
+ children: [
713
+ /* @__PURE__ */ i("div", { className: x.sideHeader, children: [
714
+ /* @__PURE__ */ e("span", { className: x.sideHeaderIcon, children: /* @__PURE__ */ e(Ln, {}) }),
715
+ !p && /* @__PURE__ */ e("span", { className: x.sideHeaderTitle, children: "个人工作台" })
716
+ ] }),
717
+ /* @__PURE__ */ i("div", { className: x.sideContent, children: [
718
+ !p && /* @__PURE__ */ e("p", { className: x.groupLabel, children: "我的工作空间" }),
719
+ /* @__PURE__ */ e("nav", { className: x.navList, "aria-label": "个人模块", children: c.map((g) => {
720
+ const I = m === g.key, B = /* @__PURE__ */ i(
721
+ "button",
722
+ {
723
+ type: "button",
724
+ className: `${x.navItem} ${I ? x.navItemActive : ""}`,
725
+ onClick: () => C(g.key),
726
+ "aria-current": I ? "page" : void 0,
727
+ children: [
728
+ /* @__PURE__ */ e("span", { className: x.navIcon, children: g.icon }),
729
+ !p && /* @__PURE__ */ e("span", { className: x.navLabel, children: g.label })
730
+ ]
731
+ },
732
+ g.key
733
+ );
734
+ return p ? /* @__PURE__ */ e(Qe, { placement: "right", title: g.label, children: B }, g.key) : B;
735
+ }) })
736
+ ] }),
737
+ /* @__PURE__ */ i("div", { className: x.sideFooter, children: [
738
+ N.length > 0 && /* @__PURE__ */ e("nav", { className: x.navList, "aria-label": "快捷切换", children: N.map((g) => {
739
+ const I = /* @__PURE__ */ i(
740
+ "button",
741
+ {
742
+ type: "button",
743
+ className: x.navItem,
744
+ onClick: () => T == null ? void 0 : T(g.mode),
745
+ children: [
746
+ /* @__PURE__ */ e("span", { className: x.navIcon, children: g.icon }),
747
+ !p && /* @__PURE__ */ e("span", { className: x.navLabel, children: g.label })
748
+ ]
749
+ },
750
+ g.mode
751
+ );
752
+ return p ? /* @__PURE__ */ e(Qe, { placement: "right", title: g.label, children: I }, g.mode) : I;
753
+ }) }),
754
+ !p && /* @__PURE__ */ e("p", { className: x.footHint, children: "⌘ / Ctrl + B 切换导航" })
755
+ ] })
756
+ ]
757
+ }
758
+ );
759
+ }
760
+ const bs = "_topbar_ms4b7_1", ys = "_topbarLeft_ms4b7_14", fs = "_collapseBtn_ms4b7_22", vs = "_crumbs_ms4b7_49", Ns = "_crumbsRoot_ms4b7_57", _s = "_crumbsSep_ms4b7_62", ks = "_crumbsCurrent_ms4b7_68", Cs = "_topbarRight_ms4b7_76", he = {
761
+ topbar: bs,
762
+ topbarLeft: ys,
763
+ collapseBtn: fs,
764
+ crumbs: vs,
765
+ crumbsRoot: Ns,
766
+ crumbsSep: _s,
767
+ crumbsCurrent: ks,
768
+ topbarRight: Cs
769
+ };
770
+ function ws({
771
+ label: c,
772
+ collapsed: m,
773
+ onToggleCollapse: p
774
+ }) {
775
+ return /* @__PURE__ */ i("header", { className: he.topbar, children: [
776
+ /* @__PURE__ */ i("div", { className: he.topbarLeft, children: [
777
+ /* @__PURE__ */ e(
778
+ Qe,
779
+ {
780
+ title: m ? "展开个人菜单" : "收起个人菜单",
781
+ placement: "bottom",
782
+ children: /* @__PURE__ */ e(
783
+ "button",
784
+ {
785
+ type: "button",
786
+ className: he.collapseBtn,
787
+ onClick: p,
788
+ "aria-label": "展开或收起个人菜单",
789
+ "aria-expanded": !m,
790
+ children: m ? /* @__PURE__ */ e(lt, {}) : /* @__PURE__ */ e(ot, {})
791
+ }
792
+ )
793
+ }
794
+ ),
795
+ /* @__PURE__ */ i("div", { className: he.crumbs, "aria-label": "当前位置", children: [
796
+ /* @__PURE__ */ e("span", { className: he.crumbsRoot, children: "个人" }),
797
+ /* @__PURE__ */ e(it, { className: he.crumbsSep }),
798
+ /* @__PURE__ */ e("span", { className: he.crumbsCurrent, children: c })
799
+ ] })
800
+ ] }),
801
+ /* @__PURE__ */ e("div", { className: he.topbarRight })
802
+ ] });
803
+ }
804
+ const Fn = [
805
+ { key: "workbench", label: "场景工作台", icon: /* @__PURE__ */ e(Ln, {}) },
806
+ { key: "projects", label: "工作单管理", icon: /* @__PURE__ */ e(rt, {}) },
807
+ { key: "personal", label: "个人统计", icon: /* @__PURE__ */ e(dt, {}) },
808
+ { key: "business-stats", label: "业务指标", icon: /* @__PURE__ */ e(ut, {}) },
809
+ { key: "tools", label: "常用工具", icon: /* @__PURE__ */ e(mt, {}) },
810
+ { key: "websites", label: "常用网站", icon: /* @__PURE__ */ e(pt, {}) },
811
+ { key: "smart-partner", label: "智能伙伴", icon: /* @__PURE__ */ e(Sn, {}) },
812
+ { key: "todo", label: "工作待办", icon: /* @__PURE__ */ e(On, {}) },
813
+ { key: "notes", label: "个人笔记", icon: /* @__PURE__ */ e(nn, {}) },
814
+ {
815
+ key: "training",
816
+ label: "培训中心",
817
+ icon: /* @__PURE__ */ e(ht, {}),
818
+ // 学员侧学习入口与培训管理(TRAINING)解耦:按需单独分配,不随培训入口发放
819
+ permission: "TRAINING_CENTER"
820
+ },
821
+ { key: "webide", label: "WebIDE", icon: /* @__PURE__ */ e(gt, {}) }
822
+ ], Kn = "ft_pw_sidebar_collapsed";
823
+ function Ts() {
824
+ try {
825
+ return localStorage.getItem(Kn) === "1";
826
+ } catch {
827
+ return !1;
828
+ }
829
+ }
830
+ function Is(c) {
831
+ const m = c;
832
+ return m ? m.tagName === "INPUT" || m.tagName === "TEXTAREA" || m.isContentEditable === !0 : !1;
833
+ }
834
+ function Ss() {
835
+ try {
836
+ const c = new URLSearchParams(window.location.search).get("tab");
837
+ return c && Fn.some((m) => m.key === c) ? c : null;
838
+ } catch {
839
+ return null;
840
+ }
841
+ }
842
+ function Ls({
843
+ onOpenProject: c,
844
+ openTodoId: m,
845
+ selectedPersonalAgent: p,
846
+ personalView: N,
847
+ newSessionTrigger: C,
848
+ onSelectPersonalAgent: T,
849
+ onShowPersonalAgentDetail: g,
850
+ onChatWithPersonalAgent: I,
851
+ onSwitchMode: B
852
+ }) {
853
+ var V;
854
+ const [S, R] = d(
855
+ // 惰性初始化:命中深链时直接以目标 Tab 首屏渲染,不先渲染场景工作台再切
856
+ () => Ss() ?? "workbench"
857
+ );
858
+ A(() => {
859
+ try {
860
+ const w = new URL(window.location.href);
861
+ if (!w.searchParams.has("tab")) return;
862
+ w.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", w.toString());
863
+ } catch {
864
+ }
865
+ }, []);
866
+ const [j, O] = d(Ts);
867
+ A(() => {
868
+ try {
869
+ localStorage.setItem(Kn, j ? "1" : "0");
870
+ } catch {
871
+ }
872
+ }, [j]);
873
+ const y = U(() => {
874
+ O((w) => !w), window.setTimeout(() => window.dispatchEvent(new Event("resize")), 300);
875
+ }, []);
876
+ A(() => {
877
+ function w(K) {
878
+ !(K.metaKey || K.ctrlKey) || K.altKey || K.key.toLowerCase() === "b" && (Is(K.target) || (K.preventDefault(), y()));
879
+ }
880
+ return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
881
+ }, [y]);
882
+ const b = re((w) => w.currentUser), P = Fn.filter(
883
+ (w) => !w.permission || Bn(b, w.permission)
884
+ ), _ = X(() => B ? [
885
+ { mode: "admin", label: "运营工作台", icon: /* @__PURE__ */ e(An, {}) },
886
+ { mode: "collaboration", label: "协作工作台", icon: /* @__PURE__ */ e(ct, {}) }
887
+ ].filter(
888
+ (K) => $n(b, K.mode)
889
+ ) : [], [b, B]), D = ((V = P.find((w) => w.key === S)) == null ? void 0 : V.label) ?? "个人工作台", [E, L] = d(null), [F, M] = d(null), $ = U((w) => {
890
+ R(w);
891
+ }, []), Z = U((w) => {
892
+ R("notes"), L({ id: w, ts: Date.now() });
893
+ }, []), oe = U((w) => {
894
+ R("todo"), M({ id: w, ts: Date.now() });
895
+ }, []);
896
+ return A(() => {
897
+ m != null && m.id && (R("todo"), M({ id: m.id, ts: m.ts }));
898
+ }, [m == null ? void 0 : m.id, m == null ? void 0 : m.ts]), /* @__PURE__ */ i("div", { className: pe.shell, children: [
899
+ /* @__PURE__ */ e("a", { className: pe.skipLink, href: "#pw-content", children: "跳到个人工作台内容" }),
900
+ /* @__PURE__ */ e(
901
+ gs,
902
+ {
903
+ items: P,
904
+ activeTab: S,
905
+ collapsed: j,
906
+ footerItems: _,
907
+ onSelect: R,
908
+ onSwitchMode: B
909
+ }
910
+ ),
911
+ /* @__PURE__ */ i("div", { className: pe.inset, children: [
912
+ /* @__PURE__ */ e(
913
+ ws,
914
+ {
915
+ label: D,
916
+ collapsed: j,
917
+ onToggleCollapse: y
918
+ }
919
+ ),
920
+ /* @__PURE__ */ e(
921
+ "main",
922
+ {
923
+ id: "pw-content",
924
+ tabIndex: -1,
925
+ "aria-label": `${D}内容`,
926
+ className: pe.main,
927
+ children: /* @__PURE__ */ i("div", { className: pe.pane, children: [
928
+ (S === "workbench" || S === "projects" || S === "personal") && /* @__PURE__ */ e(
929
+ en,
930
+ {
931
+ activeTab: S,
932
+ onActiveTabChange: $,
933
+ onOpenProject: c,
934
+ hideTabs: !0
935
+ }
936
+ ),
937
+ S === "business-stats" && /* @__PURE__ */ e(Tn, { source: "scenario" }),
938
+ S === "tools" && /* @__PURE__ */ e(We, { showTools: !0, showWebsites: !1 }),
939
+ S === "websites" && /* @__PURE__ */ e(We, { showTools: !1, showWebsites: !0 }),
940
+ S === "todo" && /* @__PURE__ */ e(
941
+ Hn,
942
+ {
943
+ onOpenProject: c,
944
+ onOpenNote: Z,
945
+ openTodoId: F
946
+ }
947
+ ),
948
+ S === "notes" && /* @__PURE__ */ e(
949
+ In,
950
+ {
951
+ onOpenProject: c,
952
+ onOpenTodo: oe,
953
+ openNoteId: E
954
+ }
955
+ ),
956
+ S === "training" && /* @__PURE__ */ e(Rn, {}),
957
+ S === "webide" && /* @__PURE__ */ e(Pn, {}),
958
+ S === "smart-partner" && /* @__PURE__ */ i("div", { className: pe.personalMainArea, children: [
959
+ /* @__PURE__ */ e("div", { className: pe.personalSidebar, children: /* @__PURE__ */ e(
960
+ Ga,
961
+ {
962
+ selectedAgentId: (p == null ? void 0 : p.id) ?? null,
963
+ selectedLocalAgentId: (p == null ? void 0 : p.localAgentId) ?? null,
964
+ onSelectAgent: T,
965
+ onShowDetail: g,
966
+ onChatWithAgent: I
967
+ }
968
+ ) }),
969
+ /* @__PURE__ */ e("div", { className: pe.personalChatArea, children: N === "detail" && p && !p.isLocal ? /* @__PURE__ */ e(
970
+ En,
971
+ {
972
+ agent: p,
973
+ onBack: () => T(p)
974
+ }
975
+ ) : p != null && p.isLocal ? /* @__PURE__ */ e(
976
+ Mn,
977
+ {
978
+ agent: p,
979
+ newSessionTrigger: C
980
+ }
981
+ ) : /* @__PURE__ */ e(
982
+ jn,
983
+ {
984
+ agent: p,
985
+ newSessionTrigger: C
986
+ }
987
+ ) })
988
+ ] })
989
+ ] })
990
+ }
991
+ )
992
+ ] })
993
+ ] });
994
+ }
995
+ const As = [
996
+ "帮我排查一个线上问题",
997
+ "总结一下今天的群聊进展",
998
+ "把这周的变更整理成周报"
999
+ ], Os = [
1000
+ {
1001
+ key: "video",
1002
+ label: "视频生成",
1003
+ icon: /* @__PURE__ */ e(bt, {}),
1004
+ action: "chat",
1005
+ prompt: "帮我写一条 15 秒短视频脚本,主题是:"
1006
+ },
1007
+ {
1008
+ key: "docs",
1009
+ label: "文档办公",
1010
+ icon: /* @__PURE__ */ e(nn, {}),
1011
+ action: "tools"
1012
+ },
1013
+ {
1014
+ key: "vibe",
1015
+ label: "Vibe Coding",
1016
+ icon: /* @__PURE__ */ e(Mt, {}),
1017
+ action: "webide"
1018
+ },
1019
+ {
1020
+ key: "design",
1021
+ label: "设计视觉",
1022
+ icon: /* @__PURE__ */ e(jt, {}),
1023
+ action: "chat",
1024
+ prompt: "帮我出一版视觉设计稿,风格偏:"
1025
+ },
1026
+ {
1027
+ key: "ask",
1028
+ label: "问问 Z-OPC",
1029
+ icon: /* @__PURE__ */ e(Je, {}),
1030
+ action: "ask"
1031
+ }
1032
+ ];
1033
+ function Ds() {
1034
+ const c = (/* @__PURE__ */ new Date()).getHours();
1035
+ return c < 5 ? "夜深了" : c < 12 ? "早上好" : c < 14 ? "中午好" : c < 18 ? "下午好" : "晚上好";
1036
+ }
1037
+ function $s(c) {
1038
+ if (!c) return "";
1039
+ const m = new Date(c), p = /* @__PURE__ */ new Date(), N = p.getTime() - c;
1040
+ if (N < 6e4) return "刚刚";
1041
+ if (N < 36e5) return `${Math.floor(N / 6e4)} 分钟前`;
1042
+ if (m.toDateString() === p.toDateString()) {
1043
+ const T = (g) => String(g).padStart(2, "0");
1044
+ return `${T(m.getHours())}:${T(m.getMinutes())}`;
1045
+ }
1046
+ const C = new Date(p);
1047
+ return C.setDate(p.getDate() - 1), m.toDateString() === C.toDateString() ? "昨天" : `${m.getMonth() + 1}月${m.getDate()}日`;
1048
+ }
1049
+ function xs({
1050
+ agents: c,
1051
+ activeAgent: m,
1052
+ onSwitchAgent: p,
1053
+ localAgentName: N,
1054
+ onLocalSend: C,
1055
+ localOffline: T = !1,
1056
+ initialSpace: g,
1057
+ onSend: I,
1058
+ onOpenTab: B,
1059
+ onQuickAsk: S,
1060
+ recentTasks: R = [],
1061
+ onOpenHistory: j
1062
+ }) {
1063
+ const O = re((h) => h.token), y = re((h) => h.currentUser), b = xn(), [P, _] = d(""), D = Oe(null), [E, L] = d(!1), [F, M] = d(!1), [$, Z] = d(g ?? null), [oe, V] = d(!1);
1064
+ A(() => {
1065
+ g && Z(g);
1066
+ }, [g]);
1067
+ const w = U(async () => {
1068
+ const h = P.trim();
1069
+ if (!(!h || E) && !T) {
1070
+ if (N && C) {
1071
+ C(h), _("");
1072
+ return;
1073
+ }
1074
+ if (m) {
1075
+ L(!0);
1076
+ try {
1077
+ await I(h, $), _(""), Z(null);
1078
+ } finally {
1079
+ L(!1);
1080
+ }
1081
+ }
1082
+ }
1083
+ }, [P, E, T, N, C, m, I, $]), K = b.nickname || (y == null ? void 0 : y.display_name) || (y == null ? void 0 : y.username) || "";
1084
+ return /* @__PURE__ */ e("div", { className: `${s.landing} ${s.xwScope}`, children: /* @__PURE__ */ i("div", { className: s.landingInner, children: [
1085
+ /* @__PURE__ */ e("div", { className: s.mascot, "aria-hidden": "true", children: /* @__PURE__ */ e("img", { src: $t, alt: "" }) }),
1086
+ /* @__PURE__ */ e("h1", { className: s.landingTitle, children: b.greetingEnabled ? `${Ds()}${K ? `,${K}` : ""}` : "开始新的对话" }),
1087
+ /* @__PURE__ */ e("p", { className: s.landingSub, children: N ? T ? "本机 Agent 未运行 —— 启动 Z-OPC 桌面端(伴生服务起来后自动连上)" : "本地模式:任务在你的电脑上执行,文件与上下文都不上云" : b.bio || "我是你的智能伙伴,有什么可以帮你?" }),
1088
+ /* @__PURE__ */ i("div", { className: s.landingBox, children: [
1089
+ /* @__PURE__ */ e(
1090
+ "textarea",
1091
+ {
1092
+ ref: D,
1093
+ className: s.landingInput,
1094
+ placeholder: N ? T ? "本机 Agent 未运行,启动桌面端后即可在本地执行" : `给本机 Agent 发送消息,${_n(b.sendKey)}` : `给智能伙伴发送消息,${_n(b.sendKey)}`,
1095
+ rows: 3,
1096
+ value: P,
1097
+ autoFocus: !0,
1098
+ onChange: (h) => _(h.target.value),
1099
+ onKeyDown: (h) => {
1100
+ ea(h, b.sendKey) && !h.nativeEvent.isComposing && (h.preventDefault(), w());
1101
+ }
1102
+ }
1103
+ ),
1104
+ /* @__PURE__ */ i("div", { className: s.landingBoxBar, children: [
1105
+ N ? /* @__PURE__ */ i("span", { className: s.agentChip, children: [
1106
+ /* @__PURE__ */ e(Je, {}),
1107
+ /* @__PURE__ */ i("span", { children: [
1108
+ N,
1109
+ "(本机)"
1110
+ ] })
1111
+ ] }) : m ? /* @__PURE__ */ i("div", { className: s.agentChipWrap, children: [
1112
+ /* @__PURE__ */ i(
1113
+ "button",
1114
+ {
1115
+ type: "button",
1116
+ className: s.agentChip,
1117
+ onClick: () => M((h) => !h),
1118
+ children: [
1119
+ /* @__PURE__ */ e(Je, {}),
1120
+ /* @__PURE__ */ e("span", { children: m.displayName }),
1121
+ c.length > 1 && /* @__PURE__ */ e(Ke, { className: s.chipCaret })
1122
+ ]
1123
+ }
1124
+ ),
1125
+ F && c.length > 1 && /* @__PURE__ */ i(ge, { children: [
1126
+ /* @__PURE__ */ e(
1127
+ "div",
1128
+ {
1129
+ className: s.agentMenuMask,
1130
+ onClick: () => M(!1)
1131
+ }
1132
+ ),
1133
+ /* @__PURE__ */ e("div", { className: s.agentMenu, role: "menu", children: c.map((h) => /* @__PURE__ */ i(
1134
+ "button",
1135
+ {
1136
+ type: "button",
1137
+ role: "menuitem",
1138
+ className: `${s.agentMenuItem} ${h.id === m.id ? s.agentMenuItemActive : ""}`,
1139
+ onClick: () => {
1140
+ p(h), M(!1);
1141
+ },
1142
+ children: [
1143
+ /* @__PURE__ */ e(
1144
+ "span",
1145
+ {
1146
+ className: s.agentDot,
1147
+ style: { background: Bt(h.displayName) },
1148
+ children: xt(h.displayName)
1149
+ }
1150
+ ),
1151
+ h.displayName
1152
+ ]
1153
+ },
1154
+ h.id
1155
+ )) })
1156
+ ] })
1157
+ ] }) : /* @__PURE__ */ e("span", { className: s.agentChipEmpty, children: "还没有云端伙伴,可到个人工作台创建" }),
1158
+ !N && m && /* @__PURE__ */ i("div", { className: s.agentChipWrap, children: [
1159
+ /* @__PURE__ */ i(
1160
+ "button",
1161
+ {
1162
+ type: "button",
1163
+ className: s.agentChip,
1164
+ title: "本次新建任务归入的项目空间(可选)",
1165
+ onClick: () => V((h) => !h),
1166
+ children: [
1167
+ /* @__PURE__ */ e(qe, {}),
1168
+ /* @__PURE__ */ e("span", { children: $ ? $.title : "不归组" }),
1169
+ /* @__PURE__ */ e(Ke, { className: s.chipCaret })
1170
+ ]
1171
+ }
1172
+ ),
1173
+ oe && /* @__PURE__ */ i(ge, { children: [
1174
+ /* @__PURE__ */ e(
1175
+ "div",
1176
+ {
1177
+ className: s.agentMenuMask,
1178
+ onClick: () => V(!1)
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ e(
1182
+ Rt,
1183
+ {
1184
+ token: O,
1185
+ currentId: ($ == null ? void 0 : $.id) ?? null,
1186
+ onPick: (h) => {
1187
+ Z(h), V(!1);
1188
+ }
1189
+ }
1190
+ )
1191
+ ] })
1192
+ ] }),
1193
+ /* @__PURE__ */ e(
1194
+ "button",
1195
+ {
1196
+ type: "button",
1197
+ className: s.landingSend,
1198
+ disabled: !P.trim() || E || T || !m && !N,
1199
+ onClick: () => void w(),
1200
+ "aria-label": "发送",
1201
+ children: E ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ e(Et, {})
1202
+ }
1203
+ )
1204
+ ] })
1205
+ ] }),
1206
+ R.length > 0 && /* @__PURE__ */ i("section", { className: s.recentBlock, "aria-label": "继续最近任务", children: [
1207
+ /* @__PURE__ */ i("div", { className: s.recentHead, children: [
1208
+ /* @__PURE__ */ e("span", { children: "继续最近任务" }),
1209
+ j && /* @__PURE__ */ e(
1210
+ "button",
1211
+ {
1212
+ type: "button",
1213
+ className: s.recentAll,
1214
+ onClick: j,
1215
+ children: "全部 →"
1216
+ }
1217
+ )
1218
+ ] }),
1219
+ /* @__PURE__ */ e("div", { className: s.recentList, children: R.map((h) => /* @__PURE__ */ i(
1220
+ "button",
1221
+ {
1222
+ type: "button",
1223
+ className: s.recentRow,
1224
+ title: h.title,
1225
+ onClick: h.open,
1226
+ children: [
1227
+ /* @__PURE__ */ e(
1228
+ "span",
1229
+ {
1230
+ className: `${s.recentLane} ${h.lane === "local" ? s.recentLaneLocal : ""}`,
1231
+ children: h.lane === "local" ? "本地" : "云端"
1232
+ }
1233
+ ),
1234
+ /* @__PURE__ */ e("span", { className: s.recentTitle, children: h.title }),
1235
+ /* @__PURE__ */ e("span", { className: s.recentTime, children: $s(h.updatedAt) })
1236
+ ]
1237
+ },
1238
+ h.key
1239
+ )) })
1240
+ ] }),
1241
+ /* @__PURE__ */ e("div", { className: s.chipRow, children: Os.map((h) => /* @__PURE__ */ i(
1242
+ "button",
1243
+ {
1244
+ type: "button",
1245
+ className: s.capChip,
1246
+ onClick: () => {
1247
+ var ie;
1248
+ if (h.action === "tools") {
1249
+ B("tools");
1250
+ return;
1251
+ }
1252
+ if (h.action === "webide") {
1253
+ B("webide");
1254
+ return;
1255
+ }
1256
+ if (h.action === "ask") {
1257
+ S();
1258
+ return;
1259
+ }
1260
+ _(h.prompt ?? ""), (ie = D.current) == null || ie.focus();
1261
+ },
1262
+ children: [
1263
+ /* @__PURE__ */ e("span", { className: s.capChipIcon, children: h.icon }),
1264
+ /* @__PURE__ */ e("span", { children: h.label })
1265
+ ]
1266
+ },
1267
+ h.key
1268
+ )) }),
1269
+ /* @__PURE__ */ e("div", { className: s.chipRow, children: As.map((h) => /* @__PURE__ */ e(
1270
+ "button",
1271
+ {
1272
+ type: "button",
1273
+ className: s.suggestChip,
1274
+ onClick: () => {
1275
+ var ie;
1276
+ _(h), (ie = D.current) == null || ie.focus();
1277
+ },
1278
+ children: h
1279
+ },
1280
+ h
1281
+ )) }),
1282
+ /* @__PURE__ */ i("p", { className: s.shortcutHint, children: [
1283
+ /* @__PURE__ */ e("kbd", { className: s.shortcutKbd, children: "⌘K" }),
1284
+ /* @__PURE__ */ e("span", { children: "搜索与命令" }),
1285
+ /* @__PURE__ */ e("span", { className: s.shortcutDot, children: "·" }),
1286
+ /* @__PURE__ */ e("kbd", { className: s.shortcutKbd, children: "⌘N" }),
1287
+ /* @__PURE__ */ e("span", { children: "新建任务" })
1288
+ ] })
1289
+ ] }) });
1290
+ }
1291
+ const Ae = Jt() || typeof localStorage < "u" && localStorage.getItem("ft_exclusive_force_desktop") === "1";
1292
+ function Bs(c) {
1293
+ return c.type === "jar" ? {
1294
+ id: "-1",
1295
+ userId: "local",
1296
+ agentHubAgentId: null,
1297
+ agentCode: "local-default",
1298
+ displayName: c.name || "本地 Agent",
1299
+ avatar: null,
1300
+ isLocal: !0
1301
+ } : {
1302
+ id: "-1",
1303
+ userId: "local",
1304
+ agentHubAgentId: null,
1305
+ agentCode: c.name,
1306
+ displayName: c.name,
1307
+ avatar: null,
1308
+ isLocal: !0,
1309
+ localAgentId: c.id,
1310
+ localAgentType: c.type
1311
+ };
1312
+ }
1313
+ function Gs({
1314
+ onSwitchMode: c,
1315
+ onOpenProject: m,
1316
+ openAgentRequest: p
1317
+ }) {
1318
+ const N = re((n) => n.token), C = re((n) => n.currentUser), T = xn(), [g, I] = d([]), [B, S] = d(!0), [R, j] = d(null), [O, y] = d("landing"), [b, P] = d(null), [_, D] = d(
1319
+ Ae ? "local" : "cloud"
1320
+ ), [E, L] = d(
1321
+ []
1322
+ ), [F, M] = d([]), [$, Z] = d(!0), [oe, V] = d(!1), [w, K] = d(null), h = U(
1323
+ (n) => {
1324
+ K({ tab: n === "skills" ? "bind" : n === "plugins" || n === "connectors" ? "soon" : "agents", ts: Date.now() }), y("extensions");
1325
+ },
1326
+ []
1327
+ ), ie = re((n) => n.projects), [Y, we] = d([]), [ee, Te] = d(null), [Ie, be] = d(
1328
+ /* @__PURE__ */ new Set()
1329
+ ), [ce, ne] = d(0), [De, ye] = d(null), [z, fe] = d(null), [de, ue] = d(""), [Se, $e] = d(!1), [te, Le] = d(!1), [J, ve] = d([]), [t, f] = d(null), [W, Ne] = d(!1), H = Ae || W, [xe, tn] = d(null), _e = U(
1330
+ (n) => {
1331
+ const a = Ht(n);
1332
+ a && !Bn(C, a) || (Ge(n), y("personalTab"));
1333
+ },
1334
+ [C]
1335
+ ), [Wn, Ue] = d(!1), [an, Ve] = d(
1336
+ null
1337
+ ), [Un, Vn] = d(
1338
+ null
1339
+ ), [Gn, Zn] = d(
1340
+ null
1341
+ ), ke = U(
1342
+ (n, a) => {
1343
+ m == null || m(n, a);
1344
+ },
1345
+ [m]
1346
+ ), zn = U((n) => {
1347
+ Ge("todo"), Zn({ id: n, ts: Date.now() });
1348
+ }, []), [ae, Ge] = d("personal"), sn = Oe(!1), Q = X(() => Ft(g), [g]), me = X(
1349
+ () => g.find((n) => n.id === R) ?? Q,
1350
+ [g, R, Q]
1351
+ );
1352
+ H && te && J.length > 0;
1353
+ const G = X(
1354
+ () => J.find((n) => n.id === t) ?? null,
1355
+ [J, t]
1356
+ );
1357
+ A(() => {
1358
+ let n = !0;
1359
+ return S(!0), Dn(N).then((a) => {
1360
+ n && I(a);
1361
+ }).catch(() => {
1362
+ }).finally(() => {
1363
+ n && S(!1);
1364
+ }), () => {
1365
+ n = !1;
1366
+ };
1367
+ }, [N]), A(() => {
1368
+ let n = !0;
1369
+ const a = async () => {
1370
+ if (!Ae) {
1371
+ let u = !1;
1372
+ try {
1373
+ u = !!(await Zt(N)).online;
1374
+ } catch {
1375
+ u = !1;
1376
+ }
1377
+ if (!n) return;
1378
+ if (Ne(u), qt(u ? "tunnel" : "direct", N), Le(u), !u) {
1379
+ ve([]);
1380
+ return;
1381
+ }
1382
+ try {
1383
+ const v = await Xe();
1384
+ n && ve(v);
1385
+ } catch {
1386
+ }
1387
+ return;
1388
+ }
1389
+ const r = await Ye();
1390
+ if (n) {
1391
+ if (Le(r), !r) {
1392
+ ve([]);
1393
+ return;
1394
+ }
1395
+ try {
1396
+ const u = await Xe();
1397
+ n && ve(u);
1398
+ } catch {
1399
+ }
1400
+ }
1401
+ };
1402
+ a();
1403
+ const o = window.setInterval(() => void a(), 3e4);
1404
+ return () => {
1405
+ n = !1, window.clearInterval(o);
1406
+ };
1407
+ }, [N]), A(() => {
1408
+ if (!H || J.length === 0 || t && J.some((a) => a.id === t))
1409
+ return;
1410
+ const n = J.find((a) => a.type === "jar");
1411
+ f((n ?? J[0]).id);
1412
+ }, [J, t]);
1413
+ const Be = X(() => {
1414
+ const n = /* @__PURE__ */ new Map();
1415
+ for (const a of g) n.set(a.id, a);
1416
+ return n;
1417
+ }, [g]), ln = U(async () => {
1418
+ Z(!0);
1419
+ const [n, a] = await Promise.allSettled([
1420
+ Tt(N),
1421
+ na(N)
1422
+ ]);
1423
+ if (n.status === "fulfilled" && L(n.value || []), a.status === "fulfilled") {
1424
+ const o = /* @__PURE__ */ new Set(), r = [];
1425
+ for (const u of [...a.value.owned, ...a.value.joined])
1426
+ o.has(u.id) || (o.add(u.id), r.push(u));
1427
+ M(r);
1428
+ }
1429
+ Z(!1);
1430
+ }, [N]);
1431
+ A(() => {
1432
+ ln();
1433
+ }, [ln, b == null ? void 0 : b.ts]);
1434
+ const Ce = X(() => {
1435
+ const n = /* @__PURE__ */ new Map();
1436
+ for (const v of F)
1437
+ n.set(`sp:${String(v.id)}`, {
1438
+ key: `sp:${String(v.id)}`,
1439
+ title: v.title,
1440
+ sessions: []
1441
+ });
1442
+ const a = [], o = [...E].sort(
1443
+ (v, k) => (k.updateTime || k.createTime || "").localeCompare(
1444
+ v.updateTime || v.createTime || ""
1445
+ )
1446
+ );
1447
+ for (const v of o)
1448
+ if (v.projectSpaceId != null) {
1449
+ const k = `sp:${String(v.projectSpaceId)}`;
1450
+ n.has(k) || n.set(k, {
1451
+ key: k,
1452
+ title: v.projectSpaceTitle || `空间 ${v.projectSpaceId}`,
1453
+ sessions: []
1454
+ }), n.get(k).sessions.push(v);
1455
+ } else
1456
+ a.push(v);
1457
+ const r = (v) => {
1458
+ var k, yn;
1459
+ return ((k = v.sessions[0]) == null ? void 0 : k.updateTime) || ((yn = v.sessions[0]) == null ? void 0 : yn.createTime) || "";
1460
+ }, u = [...n.values()];
1461
+ return u.sort((v, k) => v.sessions.length > 0 && k.sessions.length > 0 ? r(k).localeCompare(r(v)) : v.sessions.length > 0 ? -1 : k.sessions.length > 0 ? 1 : v.title.localeCompare(k.title)), a.length > 0 && u.push({ key: "sp:none", title: "未归组", sessions: a }), u;
1462
+ }, [F, E]), on = X(
1463
+ () => {
1464
+ var n;
1465
+ return b != null && b.sessionId ? ((n = Ce.find(
1466
+ (a) => a.sessions.some((o) => o.id === b.sessionId)
1467
+ )) == null ? void 0 : n.key) ?? null : null;
1468
+ },
1469
+ [Ce, b == null ? void 0 : b.sessionId]
1470
+ );
1471
+ A(() => {
1472
+ var a;
1473
+ const n = on ?? (sn.current ? null : ((a = Ce.find((o) => o.sessions.length > 0)) == null ? void 0 : a.key) ?? null);
1474
+ n && (sn.current = !0, be(
1475
+ (o) => o.has(n) ? o : new Set(o).add(n)
1476
+ ));
1477
+ }, [on, Ce]);
1478
+ const cn = Oe(!1);
1479
+ A(() => {
1480
+ Ae || !W || cn.current || (cn.current = !0, D("local"));
1481
+ }, [W]);
1482
+ const rn = G && G.type !== "jar" ? G.id : void 0;
1483
+ A(() => {
1484
+ if (!H || _ !== "local" || !te) return;
1485
+ let n = !0;
1486
+ return Kt(rn).then((a) => {
1487
+ n && we([...a].sort((o, r) => r.updatedAt - o.updatedAt));
1488
+ }).catch(() => {
1489
+ n && we([]);
1490
+ }), () => {
1491
+ n = !1;
1492
+ };
1493
+ }, [
1494
+ _,
1495
+ te,
1496
+ rn,
1497
+ ee,
1498
+ ce
1499
+ ]);
1500
+ const Re = X(() => {
1501
+ const n = /* @__PURE__ */ new Map(), a = [];
1502
+ for (const r of Y) {
1503
+ const u = r.workdir ?? null;
1504
+ if (!u) {
1505
+ a.push(r);
1506
+ continue;
1507
+ }
1508
+ const v = `wd:${u}`;
1509
+ if (!n.has(v)) {
1510
+ const k = u.split("/").filter(Boolean);
1511
+ n.set(v, {
1512
+ key: v,
1513
+ title: k.length ? k[k.length - 1] : u,
1514
+ path: u,
1515
+ sessions: []
1516
+ });
1517
+ }
1518
+ n.get(v).sessions.push(r);
1519
+ }
1520
+ const o = [...n.values()].sort(
1521
+ (r, u) => {
1522
+ var v, k;
1523
+ return (((v = u.sessions[0]) == null ? void 0 : v.updatedAt) ?? 0) - (((k = r.sessions[0]) == null ? void 0 : k.updatedAt) ?? 0);
1524
+ }
1525
+ );
1526
+ return a.length > 0 && o.push({ key: "wd:none", title: "未绑定目录", path: null, sessions: a }), o;
1527
+ }, [Y]), Pe = X(() => {
1528
+ if (!ee) return null;
1529
+ const n = Y.find((a) => a.id === ee);
1530
+ return n ? n.workdir ? `wd:${n.workdir}` : "wd:none" : null;
1531
+ }, [Y, ee]);
1532
+ A(() => {
1533
+ Pe && be(
1534
+ (n) => n.has(Pe) ? n : new Set(n).add(Pe)
1535
+ );
1536
+ }, [Pe]);
1537
+ const dn = Oe(!1);
1538
+ A(() => {
1539
+ dn.current || Re.length === 0 || (dn.current = !0, be((n) => {
1540
+ const a = new Set(n);
1541
+ for (const o of Re)
1542
+ o.sessions.length > 0 && a.add(o.key);
1543
+ return a;
1544
+ }));
1545
+ }, [Re]);
1546
+ const Qn = U(() => Te(null), []), Ze = (n) => {
1547
+ if (n !== _ && (D(n), !(O !== "chat" && O !== "landing"))) {
1548
+ if (n === "cloud") {
1549
+ y(b ? "chat" : "landing");
1550
+ return;
1551
+ }
1552
+ y(te ? "chat" : "landing");
1553
+ }
1554
+ }, ze = (n) => {
1555
+ D("local"), Te(n), y("chat");
1556
+ }, un = (n, a, o) => {
1557
+ fe({ lane: n, id: a }), ue(o || "");
1558
+ }, mn = () => {
1559
+ fe(null), ue("");
1560
+ }, pn = async () => {
1561
+ if (!z || Se) return;
1562
+ const n = z, a = de.trim();
1563
+ if (fe(null), ue(""), !!a) {
1564
+ $e(!0);
1565
+ try {
1566
+ if (n.lane === "cloud") {
1567
+ const o = E.find((r) => q(r.id, n.id));
1568
+ if (!o) return;
1569
+ await St(
1570
+ o.personalAgentId,
1571
+ o.id,
1572
+ a,
1573
+ N
1574
+ ), L(
1575
+ (r) => r.map((u) => q(u.id, n.id) ? { ...u, title: a } : u)
1576
+ );
1577
+ } else
1578
+ await zt(n.id, a), ne((o) => o + 1);
1579
+ je("已重命名会话", "success");
1580
+ } catch (o) {
1581
+ je(o instanceof Error ? o.message : "重命名失败", "error");
1582
+ } finally {
1583
+ $e(!1);
1584
+ }
1585
+ }
1586
+ }, hn = async (n, a, o) => {
1587
+ if (await Fe({
1588
+ content: `确定删除会话「${o || "未命名会话"}」吗?删除后不可恢复。`
1589
+ }))
1590
+ try {
1591
+ if (n === "cloud") {
1592
+ const u = E.find((v) => q(v.id, a));
1593
+ if (!u) return;
1594
+ await Lt(u.personalAgentId, u.id, N), L((v) => v.filter((k) => !q(k.id, a))), q(b == null ? void 0 : b.sessionId, a) && (P(null), y("landing"));
1595
+ } else
1596
+ await Qt(a), ne((u) => u + 1), ee === a && (Te(null), y("landing"));
1597
+ je("已删除会话", "success");
1598
+ } catch (u) {
1599
+ je(u instanceof Error ? u.message : "删除失败", "error");
1600
+ }
1601
+ }, se = (n, a = null, o = null) => {
1602
+ D("cloud"), j(n.id), P(
1603
+ (r) => r && r.agent.id === n.id && r.sessionId === a && !o ? r : { agent: n, sessionId: a, draft: o, ts: Date.now() }
1604
+ ), y("chat");
1605
+ };
1606
+ A(() => {
1607
+ const n = p;
1608
+ if (!(n != null && n.agent) || !n.ts) return;
1609
+ const a = n.agent;
1610
+ if (j(a.id), n.view === "detail") {
1611
+ Ve(a), y("agentDetail");
1612
+ return;
1613
+ }
1614
+ se(a, n.sessionId ?? null), n.newSession > 0 && ne((o) => o + 1);
1615
+ }, [p == null ? void 0 : p.ts]);
1616
+ const gn = () => {
1617
+ D("cloud"), j((Q == null ? void 0 : Q.id) ?? null), P(null), y("landing");
1618
+ }, bn = () => {
1619
+ D("local"), ne((n) => n + 1), y("chat");
1620
+ }, Xn = () => {
1621
+ if (_ === "local" && H && G) {
1622
+ bn();
1623
+ return;
1624
+ }
1625
+ if (Q) {
1626
+ se(Q);
1627
+ return;
1628
+ }
1629
+ gn();
1630
+ }, Yn = async (n, a) => {
1631
+ if (me)
1632
+ try {
1633
+ const o = n.length > 20 ? `${n.slice(0, 20)}…` : n, r = await At(
1634
+ me.id,
1635
+ o,
1636
+ N,
1637
+ a
1638
+ );
1639
+ tn(null), D("cloud"), P({
1640
+ agent: me,
1641
+ sessionId: r.id,
1642
+ draft: n,
1643
+ ts: Date.now()
1644
+ }), y("chat");
1645
+ } catch {
1646
+ }
1647
+ }, Jn = (n) => {
1648
+ D("local"), ye(n), y("chat");
1649
+ }, Ee = U(() => {
1650
+ if (H && _ === "local" && G) {
1651
+ ne((n) => n + 1), y("chat");
1652
+ return;
1653
+ }
1654
+ D("cloud"), j((Q == null ? void 0 : Q.id) ?? null), P(null), y("landing");
1655
+ }, [H, _, G, Q]), qn = X(() => {
1656
+ const n = [
1657
+ {
1658
+ key: "new-task",
1659
+ label: "新建任务",
1660
+ icon: /* @__PURE__ */ e(yt, {}),
1661
+ hint: "⌘N",
1662
+ run: Ee
1663
+ },
1664
+ {
1665
+ key: "schedule",
1666
+ label: "定时任务",
1667
+ icon: /* @__PURE__ */ e(ft, {}),
1668
+ run: () => y("schedule")
1669
+ },
1670
+ {
1671
+ key: "extensions",
1672
+ label: "更多能力",
1673
+ icon: /* @__PURE__ */ e(vt, {}),
1674
+ run: () => y("extensions")
1675
+ },
1676
+ {
1677
+ key: "todo",
1678
+ label: "工作待办",
1679
+ icon: /* @__PURE__ */ e(On, {}),
1680
+ run: () => _e("todo")
1681
+ },
1682
+ {
1683
+ key: "notes",
1684
+ label: "个人笔记",
1685
+ icon: /* @__PURE__ */ e(nn, {}),
1686
+ run: () => _e("notes")
1687
+ },
1688
+ {
1689
+ key: "settings",
1690
+ label: "设置",
1691
+ icon: /* @__PURE__ */ e(An, {}),
1692
+ run: () => Ue(!0)
1693
+ }
1694
+ ];
1695
+ return H && n.push({
1696
+ key: "switch-lane",
1697
+ label: _ === "local" ? "切换到云端车道" : "切换到本地车道",
1698
+ icon: _ === "local" ? /* @__PURE__ */ e(vn, {}) : /* @__PURE__ */ e(Nn, {}),
1699
+ run: () => Ze(_ === "local" ? "cloud" : "local")
1700
+ }), n;
1701
+ }, [Ee, _e, H, _]);
1702
+ A(() => {
1703
+ const n = (a) => {
1704
+ if (!(a.metaKey || a.ctrlKey) || a.altKey) return;
1705
+ const o = a.key.toLowerCase();
1706
+ if (o === "k") {
1707
+ a.preventDefault(), V((r) => !r);
1708
+ return;
1709
+ }
1710
+ o === "n" && (a.preventDefault(), Ee());
1711
+ };
1712
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
1713
+ }, [Ee]);
1714
+ const et = X(() => {
1715
+ const n = [];
1716
+ if (H)
1717
+ for (const a of Y)
1718
+ n.push({
1719
+ key: `l-${a.id}`,
1720
+ title: a.title || "未命名会话",
1721
+ lane: "local",
1722
+ updatedAt: a.updatedAt ?? 0,
1723
+ open: () => ze(a.id)
1724
+ });
1725
+ for (const a of E) {
1726
+ const o = Be.get(a.personalAgentId);
1727
+ if (!o) continue;
1728
+ const r = new Date(
1729
+ (a.updateTime || a.createTime || "").replace(" ", "T")
1730
+ ).getTime();
1731
+ n.push({
1732
+ key: `c-${a.id}`,
1733
+ title: a.title || "未命名会话",
1734
+ lane: "cloud",
1735
+ updatedAt: Number.isNaN(r) ? 0 : r,
1736
+ open: () => se(o, a.id)
1737
+ });
1738
+ }
1739
+ return n.sort((a, o) => o.updatedAt - a.updatedAt), n.slice(0, 5);
1740
+ }, [H, Y, E, Be]), nt = T.nickname || (C == null ? void 0 : C.display_name) || (C == null ? void 0 : C.username) || "", tt = X(() => c ? [
1741
+ {
1742
+ mode: "personal",
1743
+ label: "个人工作台",
1744
+ icon: /* @__PURE__ */ e(Xt, {})
1745
+ },
1746
+ {
1747
+ mode: "collaboration",
1748
+ label: "协作工作台",
1749
+ icon: /* @__PURE__ */ e(Yt, {})
1750
+ }
1751
+ ].filter(
1752
+ (a) => $n(C, a.mode)
1753
+ ) : [], [C, c]), at = b ? `${b.agent.id}-${b.sessionId ?? 0}-${b.ts}` : "none";
1754
+ let le;
1755
+ return O === "agentDetail" && an ? le = /* @__PURE__ */ e("div", { className: s.detailHost, children: /* @__PURE__ */ e(
1756
+ En,
1757
+ {
1758
+ agent: an,
1759
+ onBack: () => y("extensions")
1760
+ }
1761
+ ) }) : O === "schedule" ? le = /* @__PURE__ */ e(
1762
+ ta,
1763
+ {
1764
+ localOnline: te,
1765
+ agents: g,
1766
+ token: N,
1767
+ localAgents: J,
1768
+ defaultLane: _,
1769
+ defaultAgentId: (me == null ? void 0 : me.id) ?? null
1770
+ }
1771
+ ) : O === "extensions" ? le = /* @__PURE__ */ e(
1772
+ aa,
1773
+ {
1774
+ agents: g,
1775
+ loading: B,
1776
+ skillsAgent: Q,
1777
+ token: N,
1778
+ currentUser: C,
1779
+ lane: _,
1780
+ onChat: (n) => se(n),
1781
+ onConfig: (n) => {
1782
+ Ve(n), y("agentDetail");
1783
+ },
1784
+ onCreated: (n) => I((a) => [...a, n]),
1785
+ onOpenPersonalTab: _e,
1786
+ onOpenWorkbenchShell: () => y("workbenchShell"),
1787
+ onOpenHistory: () => y("history"),
1788
+ capTabRequest: w
1789
+ }
1790
+ ) : O === "history" ? le = /* @__PURE__ */ e(
1791
+ sa,
1792
+ {
1793
+ agents: g,
1794
+ token: N,
1795
+ onOpenSession: (n, a) => se(n, a),
1796
+ onBack: () => y("extensions")
1797
+ }
1798
+ ) : O === "workbenchShell" ? le = /* @__PURE__ */ e(
1799
+ Ls,
1800
+ {
1801
+ onOpenProject: ke,
1802
+ selectedPersonalAgent: me,
1803
+ personalView: "chat",
1804
+ newSessionTrigger: ce,
1805
+ onSelectPersonalAgent: (n) => j((n == null ? void 0 : n.id) ?? null),
1806
+ onShowPersonalAgentDetail: (n) => {
1807
+ Ve(n), y("agentDetail");
1808
+ },
1809
+ onChatWithPersonalAgent: (n) => se(n),
1810
+ onSwitchMode: c
1811
+ }
1812
+ ) : O === "personalTab" ? le = /* @__PURE__ */ i("div", { className: s.personalTabHost, children: [
1813
+ ae === "projects" && /* @__PURE__ */ e(
1814
+ en,
1815
+ {
1816
+ activeTab: "projects",
1817
+ onActiveTabChange: () => {
1818
+ },
1819
+ onOpenProject: ke,
1820
+ hideTabs: !0
1821
+ }
1822
+ ),
1823
+ ae === "personal" && /* @__PURE__ */ e(
1824
+ en,
1825
+ {
1826
+ activeTab: "personal",
1827
+ onActiveTabChange: () => {
1828
+ },
1829
+ onOpenProject: ke,
1830
+ hideTabs: !0
1831
+ }
1832
+ ),
1833
+ ae === "business-stats" && /* @__PURE__ */ e(Tn, { source: "scenario" }),
1834
+ ae === "tools" && /* @__PURE__ */ e(We, { showTools: !0, showWebsites: !1 }),
1835
+ ae === "websites" && /* @__PURE__ */ e(We, { showTools: !1, showWebsites: !0 }),
1836
+ ae === "todo" && /* @__PURE__ */ e(
1837
+ Hn,
1838
+ {
1839
+ onOpenProject: ke,
1840
+ onOpenNote: (n) => {
1841
+ Ge("notes"), Vn({ id: n, ts: Date.now() });
1842
+ },
1843
+ onOpenAgentSession: (n, a) => {
1844
+ const o = g.find((r) => q(r.id, a));
1845
+ o && se(o, n);
1846
+ },
1847
+ openTodoId: Gn
1848
+ }
1849
+ ),
1850
+ ae === "notes" && /* @__PURE__ */ e(
1851
+ In,
1852
+ {
1853
+ onOpenProject: ke,
1854
+ onOpenTodo: zn,
1855
+ openNoteId: Un
1856
+ }
1857
+ ),
1858
+ ae === "training" && /* @__PURE__ */ e(Rn, {}),
1859
+ ae === "webide" && /* @__PURE__ */ e(Pn, {})
1860
+ ] }) : _ === "cloud" && b ? le = /* @__PURE__ */ e("div", { className: s.chatHost, children: /* @__PURE__ */ e(
1861
+ jn,
1862
+ {
1863
+ agent: b.agent,
1864
+ initialSessionId: b.sessionId,
1865
+ autoSendDraft: b.draft,
1866
+ chromeless: !0,
1867
+ agents: g,
1868
+ onSwitchAgent: (n) => se(n)
1869
+ },
1870
+ at
1871
+ ) }) : _ === "local" && H && G && O !== "landing" ? le = /* @__PURE__ */ e("div", { className: s.chatHost, children: /* @__PURE__ */ e(
1872
+ Mn,
1873
+ {
1874
+ agent: Bs(G),
1875
+ newSessionTrigger: ce,
1876
+ autoSendDraft: De,
1877
+ onAutoSendConsumed: () => ye(null),
1878
+ openSessionId: ee,
1879
+ onOpenSessionConsumed: Qn,
1880
+ onSessionsMutated: () => ne((n) => n + 1)
1881
+ },
1882
+ G.id
1883
+ ) }) : le = /* @__PURE__ */ e(
1884
+ xs,
1885
+ {
1886
+ agents: g,
1887
+ activeAgent: me,
1888
+ onSwitchAgent: (n) => j(n.id),
1889
+ localAgentName: _ === "local" ? (G == null ? void 0 : G.name) ?? "本机 Agent" : null,
1890
+ onLocalSend: _ === "local" ? Jn : void 0,
1891
+ localOffline: _ === "local" && !te,
1892
+ initialSpace: xe,
1893
+ onSend: Yn,
1894
+ onOpenTab: _e,
1895
+ onQuickAsk: Xn,
1896
+ recentTasks: et,
1897
+ onOpenHistory: () => y("history")
1898
+ }
1899
+ ), /* @__PURE__ */ i("div", { className: s.shell, children: [
1900
+ /* @__PURE__ */ i("aside", { className: s.sidebar, "aria-label": "个人专享工作台导航", children: [
1901
+ /* @__PURE__ */ i("div", { className: s.sideContent, children: [
1902
+ H && /* @__PURE__ */ i("div", { className: s.laneTabs, role: "tablist", "aria-label": "任务车道", children: [
1903
+ /* @__PURE__ */ i(
1904
+ "button",
1905
+ {
1906
+ type: "button",
1907
+ role: "tab",
1908
+ "aria-selected": _ === "local",
1909
+ className: `${s.laneTab} ${_ === "local" ? s.laneTabActive : ""}`,
1910
+ onClick: () => Ze("local"),
1911
+ title: te ? "本机 Agent 已连接:任务在你的电脑上执行" : "本机 Agent 未运行:启动 Z-OPC 桌面端伴生服务后可用",
1912
+ children: [
1913
+ /* @__PURE__ */ e(Nn, { className: s.laneIcon }),
1914
+ /* @__PURE__ */ e("span", { className: s.laneText, children: "本地" })
1915
+ ]
1916
+ }
1917
+ ),
1918
+ /* @__PURE__ */ i(
1919
+ "button",
1920
+ {
1921
+ type: "button",
1922
+ role: "tab",
1923
+ "aria-selected": _ === "cloud",
1924
+ className: `${s.laneTab} ${_ === "cloud" ? s.laneTabActive : ""}`,
1925
+ onClick: () => Ze("cloud"),
1926
+ title: "云端任务:跨设备同步,手机/网页都能继续",
1927
+ children: [
1928
+ /* @__PURE__ */ e(vn, { className: s.laneIcon }),
1929
+ /* @__PURE__ */ e("span", { className: s.laneText, children: "云端" })
1930
+ ]
1931
+ }
1932
+ )
1933
+ ] }),
1934
+ /* @__PURE__ */ e(
1935
+ Wt,
1936
+ {
1937
+ currentUser: C,
1938
+ token: N,
1939
+ isDesktop: Ae,
1940
+ activeNav: O === "schedule" ? "schedule" : null,
1941
+ extensionsGroupActive: [
1942
+ "extensions",
1943
+ "agentDetail",
1944
+ // 聊天记录已收进「更多能力」浮层(2026-10-30):进入后组行应点亮,
1945
+ // 否则整页没有当前位置指示
1946
+ "history",
1947
+ "personalTab",
1948
+ "workbenchShell"
1949
+ ].includes(O),
1950
+ activePersonalTab: O === "personalTab" ? ae : null,
1951
+ onDesktopNewTask: _ === "local" && G ? bn : void 0,
1952
+ onPickSpace: (n) => {
1953
+ tn(n), gn();
1954
+ },
1955
+ currentSpaceId: (xe == null ? void 0 : xe.id) ?? null,
1956
+ onOpenSchedule: () => y("schedule"),
1957
+ onOpenExtensions: h,
1958
+ onOpenHistory: () => y("history"),
1959
+ onOpenSearch: () => {
1960
+ V(!0), re.getState().loadProjects();
1961
+ },
1962
+ searchActive: oe,
1963
+ onOpenPersonalTab: _e,
1964
+ onOpenWorkbenchShell: () => y("workbenchShell")
1965
+ }
1966
+ ),
1967
+ /* @__PURE__ */ e("div", { className: s.sideTasks, children: _ === "cloud" ? /* @__PURE__ */ i(ge, { children: [
1968
+ /* @__PURE__ */ e("div", { className: s.tasksLabel, children: "项目" }),
1969
+ Ce.length === 0 && !$ && /* @__PURE__ */ e("div", { className: s.tasksEmpty, children: "还没有项目空间或云端任务" }),
1970
+ Ce.map((n) => {
1971
+ const a = Ie.has(n.key);
1972
+ return /* @__PURE__ */ i("div", { children: [
1973
+ /* @__PURE__ */ i(
1974
+ "button",
1975
+ {
1976
+ type: "button",
1977
+ className: s.projFolder,
1978
+ "aria-expanded": a,
1979
+ onClick: () => be((o) => {
1980
+ const r = new Set(o);
1981
+ return r.has(n.key) ? r.delete(n.key) : r.add(n.key), r;
1982
+ }),
1983
+ children: [
1984
+ /* @__PURE__ */ e(
1985
+ Ke,
1986
+ {
1987
+ className: `${s.projCaret} ${a ? s.projCaretOpen : ""}`
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ e(qe, { className: s.projIcon }),
1991
+ /* @__PURE__ */ e("span", { className: s.projName, title: n.title, children: n.title }),
1992
+ /* @__PURE__ */ e("span", { className: s.projMeta, children: n.sessions.length > 0 ? n.sessions.length : "暂无任务" })
1993
+ ]
1994
+ }
1995
+ ),
1996
+ a && n.sessions.length > 0 && /* @__PURE__ */ e("div", { className: s.projRows, children: n.sessions.map((o) => {
1997
+ const r = Be.get(o.personalAgentId), u = It(o.id), v = (z == null ? void 0 : z.lane) === "cloud" && z.id === u;
1998
+ return /* @__PURE__ */ e("div", { className: s.sessionRow, children: v ? /* @__PURE__ */ e(
1999
+ "input",
2000
+ {
2001
+ className: s.rowRenameInput,
2002
+ value: de,
2003
+ autoFocus: !0,
2004
+ "aria-label": "重命名会话",
2005
+ onChange: (k) => ue(k.target.value),
2006
+ onBlur: () => void pn(),
2007
+ onKeyDown: (k) => {
2008
+ k.key === "Enter" ? (k.preventDefault(), k.currentTarget.blur()) : k.key === "Escape" && (k.preventDefault(), mn());
2009
+ }
2010
+ }
2011
+ ) : /* @__PURE__ */ i(ge, { children: [
2012
+ /* @__PURE__ */ e(
2013
+ "button",
2014
+ {
2015
+ type: "button",
2016
+ className: `${s.recentItem} ${(b == null ? void 0 : b.sessionId) === o.id ? s.recentItemActive : ""}`,
2017
+ disabled: !r,
2018
+ title: r ? o.title || "未命名会话" : "伙伴已不存在,无法打开",
2019
+ onClick: () => r && se(r, o.id),
2020
+ children: /* @__PURE__ */ e("span", { className: s.recentItemText, children: o.title || "未命名会话" })
2021
+ }
2022
+ ),
2023
+ /* @__PURE__ */ e(
2024
+ fn,
2025
+ {
2026
+ trigger: ["click"],
2027
+ menu: {
2028
+ items: [
2029
+ { key: "rename", label: "重命名" },
2030
+ {
2031
+ key: "delete",
2032
+ label: "删除",
2033
+ danger: !0
2034
+ }
2035
+ ],
2036
+ onClick: ({ key: k }) => {
2037
+ r && (k === "rename" ? un(
2038
+ "cloud",
2039
+ u,
2040
+ o.title || ""
2041
+ ) : k === "delete" && hn(
2042
+ "cloud",
2043
+ u,
2044
+ o.title || ""
2045
+ ));
2046
+ }
2047
+ },
2048
+ children: /* @__PURE__ */ e(
2049
+ "button",
2050
+ {
2051
+ type: "button",
2052
+ className: s.rowMore,
2053
+ title: "会话操作",
2054
+ "aria-label": "会话操作",
2055
+ "aria-haspopup": "menu",
2056
+ disabled: !r,
2057
+ children: "⋯"
2058
+ }
2059
+ )
2060
+ }
2061
+ )
2062
+ ] }) }, o.id);
2063
+ }) })
2064
+ ] }, n.key);
2065
+ })
2066
+ ] }) : /* @__PURE__ */ i(ge, { children: [
2067
+ /* @__PURE__ */ e("div", { className: s.tasksLabel, children: "目录" }),
2068
+ Re.map((n) => {
2069
+ const a = Ie.has(n.key);
2070
+ return /* @__PURE__ */ i("div", { children: [
2071
+ /* @__PURE__ */ i(
2072
+ "button",
2073
+ {
2074
+ type: "button",
2075
+ className: s.projFolder,
2076
+ "aria-expanded": a,
2077
+ title: n.path ?? "未绑定目录:任务不带目录上下文",
2078
+ onClick: () => be((o) => {
2079
+ const r = new Set(o);
2080
+ return r.has(n.key) ? r.delete(n.key) : r.add(n.key), r;
2081
+ }),
2082
+ children: [
2083
+ /* @__PURE__ */ e(
2084
+ Ke,
2085
+ {
2086
+ className: `${s.projCaret} ${a ? s.projCaretOpen : ""}`
2087
+ }
2088
+ ),
2089
+ /* @__PURE__ */ e(qe, { className: s.projIcon }),
2090
+ /* @__PURE__ */ e("span", { className: s.projName, children: n.title }),
2091
+ /* @__PURE__ */ e("span", { className: s.projMeta, children: n.sessions.length })
2092
+ ]
2093
+ }
2094
+ ),
2095
+ a && /* @__PURE__ */ e("div", { className: s.projRows, children: n.sessions.map((o) => {
2096
+ const r = (z == null ? void 0 : z.lane) === "local" && z.id === o.id;
2097
+ return /* @__PURE__ */ e("div", { className: s.sessionRow, children: r ? /* @__PURE__ */ e(
2098
+ "input",
2099
+ {
2100
+ className: s.rowRenameInput,
2101
+ value: de,
2102
+ autoFocus: !0,
2103
+ "aria-label": "重命名会话",
2104
+ onChange: (u) => ue(u.target.value),
2105
+ onBlur: () => void pn(),
2106
+ onKeyDown: (u) => {
2107
+ u.key === "Enter" ? (u.preventDefault(), u.currentTarget.blur()) : u.key === "Escape" && (u.preventDefault(), mn());
2108
+ }
2109
+ }
2110
+ ) : /* @__PURE__ */ i(ge, { children: [
2111
+ /* @__PURE__ */ e(
2112
+ "button",
2113
+ {
2114
+ type: "button",
2115
+ className: `${s.recentItem} ${ee === o.id ? s.recentItemActive : ""}`,
2116
+ title: o.title,
2117
+ onClick: () => ze(o.id),
2118
+ children: /* @__PURE__ */ e("span", { className: s.recentItemText, children: o.title || "未命名会话" })
2119
+ }
2120
+ ),
2121
+ /* @__PURE__ */ e(
2122
+ fn,
2123
+ {
2124
+ trigger: ["click"],
2125
+ menu: {
2126
+ items: [
2127
+ { key: "rename", label: "重命名" },
2128
+ {
2129
+ key: "delete",
2130
+ label: "删除",
2131
+ danger: !0
2132
+ }
2133
+ ],
2134
+ onClick: ({ key: u }) => {
2135
+ u === "rename" ? un(
2136
+ "local",
2137
+ o.id,
2138
+ o.title || ""
2139
+ ) : u === "delete" && hn(
2140
+ "local",
2141
+ o.id,
2142
+ o.title || ""
2143
+ );
2144
+ }
2145
+ },
2146
+ children: /* @__PURE__ */ e(
2147
+ "button",
2148
+ {
2149
+ type: "button",
2150
+ className: s.rowMore,
2151
+ title: "会话操作",
2152
+ "aria-label": "会话操作",
2153
+ "aria-haspopup": "menu",
2154
+ children: "⋯"
2155
+ }
2156
+ )
2157
+ }
2158
+ )
2159
+ ] }) }, o.id);
2160
+ }) })
2161
+ ] }, n.key);
2162
+ }),
2163
+ Y.length === 0 && /* @__PURE__ */ e("div", { className: s.tasksEmpty, children: te ? "暂无本地任务,点上方「新建任务」开始" : "本机 Agent 未运行 —— 启动 Z-OPC 桌面端后自动连上" })
2164
+ ] }) })
2165
+ ] }),
2166
+ /* @__PURE__ */ e(
2167
+ Ut,
2168
+ {
2169
+ displayName: nt,
2170
+ subtitle: "Z-OPC · 个人(专享)",
2171
+ onOpenSettings: () => Ue(!0),
2172
+ children: tt.map((n) => /* @__PURE__ */ i(
2173
+ "button",
2174
+ {
2175
+ type: "button",
2176
+ role: "menuitem",
2177
+ className: s.agentMenuItem,
2178
+ onClick: () => c == null ? void 0 : c(n.mode),
2179
+ children: [
2180
+ /* @__PURE__ */ e("span", { className: s.navIcon, children: n.icon }),
2181
+ /* @__PURE__ */ e("span", { children: n.label })
2182
+ ]
2183
+ },
2184
+ n.mode
2185
+ ))
2186
+ }
2187
+ )
2188
+ ] }),
2189
+ /* @__PURE__ */ e("main", { className: s.main, "aria-label": "个人专享工作台内容", children: B && !b && !G ? /* @__PURE__ */ e("div", { className: s.emptyState, children: /* @__PURE__ */ e("span", { className: s.emptyTitle, children: "正在加载智能伙伴…" }) }) : le }),
2190
+ /* @__PURE__ */ e(
2191
+ Vt,
2192
+ {
2193
+ open: Wn,
2194
+ onClose: () => Ue(!1),
2195
+ token: N
2196
+ }
2197
+ ),
2198
+ oe && /* @__PURE__ */ e(
2199
+ Gt,
2200
+ {
2201
+ sessions: E,
2202
+ localSessions: H ? Y : [],
2203
+ agentsById: Be,
2204
+ projects: ie,
2205
+ token: N,
2206
+ actions: qn,
2207
+ onOpenSession: (n, a) => se(n, a),
2208
+ onOpenLocalSession: ze,
2209
+ onOpenProject: (n) => ke(n.id),
2210
+ onClose: () => V(!1)
2211
+ }
2212
+ )
2213
+ ] });
2214
+ }
2215
+ export {
2216
+ Gs as default
2217
+ };