@yuku123/z-team-component 0.2.9 → 0.2.11

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 (28) hide show
  1. package/dist/{InvitationManagementPage-Bu_T6Qnk.js → InvitationManagementPage-BJeNjZwz.js} +2 -2
  2. package/dist/{OnboardingPage-CVQsHBNI.js → OnboardingPage-C4IKDR7H.js} +2 -2
  3. package/dist/{ProjectApp-CZp1-5DE.js → ProjectApp-BzwYOzVU.js} +3 -3
  4. package/dist/{admin-logs-CjrLXc1w.js → admin-logs-D9_Q7x5S.js} +2 -2
  5. package/dist/{api-C3oQuHQN.js → api-DxGj2k96.js} +24 -24
  6. package/dist/{api-CGeI8Nl6.js → api-fqyi5hV8.js} +1 -1
  7. package/dist/{createWorkspaceWsHandler--EYvkQTh.js → createWorkspaceWsHandler-CO8CErPb.js} +5 -5
  8. package/dist/{index-CC82pWGq.js → index-8xyTb9mH.js} +4 -4
  9. package/dist/{index-BAbMvA6l.js → index-BPEHmsyH.js} +15 -15
  10. package/dist/{index-CibhFgCi.js → index-BRc2oNNo.js} +3 -3
  11. package/dist/{index-BnXt3lMS.js → index-C2WxsJfi.js} +2 -2
  12. package/dist/{index-EPCmZ1QV.js → index-CAyKJ_Kb.js} +4 -4
  13. package/dist/{index-DL3Nsor4.js → index-CoEkAZu6.js} +3405 -3401
  14. package/dist/{index-BbXwe7Mu.js → index-CqUVCMOn.js} +3 -3
  15. package/dist/{index-psNYztRR.js → index-DLRNcbNN.js} +6 -6
  16. package/dist/{index-DnqloQgt.js → index-DTRpN0nk.js} +1 -1
  17. package/dist/{index-DH7Mt7zI.js → index-bUfp5OSs.js} +3 -3
  18. package/dist/index-o_J49wn9.js +17014 -0
  19. package/dist/index.js +1 -1
  20. package/dist/{instance-DUBRC_44.js → instance-BnjcRI0U.js} +2 -2
  21. package/dist/pages.js +1 -1
  22. package/dist/{send-default-agent-team-message-DHaZl06Z.js → send-default-agent-team-message-4hgjqdo4.js} +1 -1
  23. package/dist/{sso-user-BRC1vEjR.js → sso-user-D1N_OzF2.js} +1 -1
  24. package/dist/{useAppStore-D1Z2M3Za.js → useAppStore-Cq9uSFGy.js} +1 -1
  25. package/dist/z-team-component.css +1 -1
  26. package/package.json +1 -1
  27. package/dist/index-89atN3Sn.js +0 -3299
  28. package/dist/index-B3WkjkoJ.js +0 -13641
@@ -1,3299 +0,0 @@
1
- import { jsx as e, jsxs as t, Fragment as ie } from "react/jsx-runtime";
2
- import { S as Kt, P as qt } from "./index-BAbMvA6l.js";
3
- import { DashboardOutlined as Ut, BarChartOutlined as Vt, PieChartOutlined as Jt, UnorderedListOutlined as Qt, FileTextOutlined as Yt, ReadOutlined as Xt, ConsoleSqlOutlined as Zt } from "@ant-design/icons";
4
- import { createElement as en, useState as m, useEffect as V, useMemo as se, useCallback as X, useRef as Fe } from "react";
5
- import { createPortal as tn } from "react-dom";
6
- import { e as we, f as Te, B as Ie, d as je, af as It, ag as nn, ah as an, ai as sn, aj as cn } from "./api-C3oQuHQN.js";
7
- import { f as ln, t as on, a as rn, c as dn, b as mn, i as hn } from "./index-DL3Nsor4.js";
8
- import { u as ut } from "./useAppStore-D1Z2M3Za.js";
9
- import { s as un } from "./admin-logs-CjrLXc1w.js";
10
- import { f as jt, c as pn, P as _n, L as yn, a as gn, b as bn, W as pt, d as _t, T as Nn, e as kn, g as vn } from "./index-B3WkjkoJ.js";
11
- async function fn(a = {}, c = "") {
12
- const l = new URLSearchParams();
13
- a.keyword && l.set("keyword", a.keyword), a.category && l.set("category", a.category), a.status !== void 0 && l.set("status", String(a.status)), c && l.set("token", c);
14
- const h = await we(
15
- `${Ie}/admin/ft-skills?${l.toString()}`,
16
- Te
17
- );
18
- return je(h, "获取 FT skill 列表失败");
19
- }
20
- async function Cn(a, c = "") {
21
- const l = c ? `?token=${encodeURIComponent(c)}` : "", h = await we(
22
- `${Ie}/admin/ft-skills/${a}${l}`,
23
- Te
24
- );
25
- return je(h, "获取 FT skill 详情失败");
26
- }
27
- function C(a) {
28
- function c({ className: l, spin: h, style: b, ..._ }) {
29
- return /* @__PURE__ */ e(
30
- "svg",
31
- {
32
- xmlns: "http://www.w3.org/2000/svg",
33
- width: "1em",
34
- height: "1em",
35
- viewBox: "0 0 24 24",
36
- fill: "none",
37
- stroke: "currentColor",
38
- strokeWidth: 1.75,
39
- strokeLinecap: "round",
40
- strokeLinejoin: "round",
41
- "aria-hidden": "true",
42
- className: h ? [l, "anticon-spin"].filter(Boolean).join(" ") : l,
43
- style: {
44
- display: "inline-block",
45
- verticalAlign: "-0.15em",
46
- flexShrink: 0,
47
- ...b
48
- },
49
- ..._,
50
- children: a.map(
51
- ([$, p], A) => en($, { ...p, key: A })
52
- )
53
- }
54
- );
55
- }
56
- return c;
57
- }
58
- const yt = C([
59
- [
60
- "path",
61
- {
62
- d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
63
- key: "k3hazp"
64
- }
65
- ]
66
- ]), wn = C([
67
- [
68
- "path",
69
- {
70
- d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
71
- key: "1gvzjb"
72
- }
73
- ],
74
- ["path", { d: "M9 18h6", key: "x1upvd" }],
75
- ["path", { d: "M10 22h4", key: "ceow96" }]
76
- ]), Tn = C([
77
- ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
78
- ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
79
- ]), In = C([
80
- [
81
- "path",
82
- {
83
- d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",
84
- key: "mvr1a0"
85
- }
86
- ]
87
- ]), jn = C([
88
- [
89
- "path",
90
- { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }
91
- ],
92
- ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
93
- ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
94
- ]), Mn = C([
95
- ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
96
- ["path", { d: "M21 12H9", key: "dn1m92" }],
97
- ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
98
- ]), ze = C([
99
- [
100
- "path",
101
- {
102
- d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
103
- key: "1i5ecw"
104
- }
105
- ],
106
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
107
- ]), Sn = C([
108
- ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
109
- ["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
110
- ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
111
- ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
112
- ]), Mt = C([
113
- ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
114
- ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
115
- ]), xn = C([
116
- [
117
- "path",
118
- { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }
119
- ],
120
- ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
121
- [
122
- "path",
123
- { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }
124
- ],
125
- ["path", { d: "M8 16H3v5", key: "1cv678" }]
126
- ]), et = C([
127
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
128
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
129
- ]), St = C([
130
- ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
131
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
132
- ]), qe = C([
133
- ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
134
- ]), $n = C([
135
- ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
136
- ["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
137
- ["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
138
- [
139
- "line",
140
- { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }
141
- ],
142
- ["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
143
- ]), An = C([
144
- [
145
- "path",
146
- {
147
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
148
- key: "1xq2db"
149
- }
150
- ]
151
- ]), Dn = C([
152
- ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
153
- ["path", { d: "M12 19V5", key: "x0mq9r" }]
154
- ]), gt = C([
155
- ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
156
- ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
157
- ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
158
- ]), Bn = C([
159
- [
160
- "path",
161
- {
162
- d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
163
- key: "1cjeqo"
164
- }
165
- ],
166
- [
167
- "path",
168
- {
169
- d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",
170
- key: "19qd67"
171
- }
172
- ]
173
- ]), Ee = C([
174
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
175
- [
176
- "rect",
177
- { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }
178
- ],
179
- ["path", { d: "M2 14h2", key: "vft8re" }],
180
- ["path", { d: "M20 14h2", key: "4cs60a" }],
181
- ["path", { d: "M15 13v2", key: "1xurst" }],
182
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
183
- ]), On = C([
184
- [
185
- "path",
186
- {
187
- d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
188
- key: "1ngwbx"
189
- }
190
- ]
191
- ]), Ln = C([
192
- [
193
- "path",
194
- {
195
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
196
- key: "1xq2db"
197
- }
198
- ]
199
- ]), Rn = C([
200
- ["path", { d: "M12 20v2", key: "1lh1kg" }],
201
- ["path", { d: "M12 2v2", key: "tus03m" }],
202
- ["path", { d: "M17 20v2", key: "1rnc9c" }],
203
- ["path", { d: "M17 2v2", key: "11trls" }],
204
- ["path", { d: "M2 12h2", key: "1t8f8n" }],
205
- ["path", { d: "M2 17h2", key: "7oei6x" }],
206
- ["path", { d: "M2 7h2", key: "asdhe0" }],
207
- ["path", { d: "M20 12h2", key: "1q8mjw" }],
208
- ["path", { d: "M20 17h2", key: "1fpfkl" }],
209
- ["path", { d: "M20 7h2", key: "1o8tra" }],
210
- ["path", { d: "M7 20v2", key: "4gnj0m" }],
211
- ["path", { d: "M7 2v2", key: "1i4yhu" }],
212
- [
213
- "rect",
214
- { x: "4", y: "4", width: "16", height: "16", rx: "2", key: "1vbyd7" }
215
- ],
216
- ["rect", { x: "8", y: "8", width: "8", height: "8", rx: "1", key: "z9xiuo" }]
217
- ]), Hn = C([
218
- ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
219
- ]);
220
- function Xe(a) {
221
- return /* @__PURE__ */ e(Hn, { spin: !0, ...a });
222
- }
223
- const xt = C([
224
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
225
- ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
226
- ["path", { d: "M12 17h.01", key: "p32p05" }]
227
- ]), $t = C([
228
- [
229
- "path",
230
- {
231
- d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",
232
- key: "cloud1"
233
- }
234
- ]
235
- ]), En = C([
236
- ["circle", { cx: "12", cy: "12", r: "10", key: "globe1" }],
237
- [
238
- "path",
239
- { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "globe2" }
240
- ],
241
- ["path", { d: "M2 12h20", key: "globe3" }]
242
- ]), Gn = C([
243
- ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "arch1" }],
244
- ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "arch2" }],
245
- ["path", { d: "M10 12h4", key: "arch3" }]
246
- ]), At = C([
247
- [
248
- "rect",
249
- {
250
- width: "14",
251
- height: "20",
252
- x: "5",
253
- y: "2",
254
- rx: "2",
255
- ry: "2",
256
- key: "phone1"
257
- }
258
- ],
259
- ["path", { d: "M12 18h.01", key: "phone2" }]
260
- ]), Dt = C([
261
- ["circle", { cx: "13.5", cy: "6.5", r: ".5", key: "pal1" }],
262
- ["circle", { cx: "17.5", cy: "10.5", r: ".5", key: "pal2" }],
263
- ["circle", { cx: "8.5", cy: "7.5", r: ".5", key: "pal3" }],
264
- ["circle", { cx: "6.5", cy: "12.5", r: ".5", key: "pal4" }],
265
- [
266
- "path",
267
- {
268
- d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",
269
- key: "pal5"
270
- }
271
- ]
272
- ]), Bt = C([
273
- ["path", { d: "M10 8h.01", key: "kb1" }],
274
- ["path", { d: "M12 12h.01", key: "kb2" }],
275
- ["path", { d: "M14 8h.01", key: "kb3" }],
276
- ["path", { d: "M16 12h.01", key: "kb4" }],
277
- ["path", { d: "M18 8h.01", key: "kb5" }],
278
- ["path", { d: "M6 8h.01", key: "kb6" }],
279
- ["path", { d: "M7 16h10", key: "kb7" }],
280
- ["path", { d: "M8 12h.01", key: "kb8" }],
281
- ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "kb9" }]
282
- ]), Pn = C([
283
- [
284
- "path",
285
- {
286
- d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1 1 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
287
- key: "shield1"
288
- }
289
- ]
290
- ]), Fn = C([
291
- ["circle", { cx: "12", cy: "12", r: "10", key: "info1" }],
292
- ["path", { d: "M12 16v-4", key: "info2" }],
293
- ["path", { d: "M12 8h.01", key: "info3" }]
294
- ]), tt = C([
295
- ["path", { d: "M5 12h14", key: "1ays0h" }],
296
- ["path", { d: "M12 5v14", key: "s699le" }]
297
- ]), Se = C([
298
- [
299
- "path",
300
- {
301
- d: "m6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2",
302
- key: "1bpw5t"
303
- }
304
- ]
305
- ]), nt = C([
306
- ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
307
- [
308
- "rect",
309
- { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }
310
- ],
311
- [
312
- "rect",
313
- { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "1q86j2" }
314
- ],
315
- [
316
- "rect",
317
- { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }
318
- ]
319
- ]), zn = "_host_11m4k_1", Wn = "_header_11m4k_11", Kn = "_title_11m4k_18", qn = "_subtitle_11m4k_25", Un = "_searchWrap_11m4k_31", Vn = "_searchIcon_11m4k_47", Jn = "_searchInput_11m4k_52", Qn = "_dimBar_11m4k_66", Yn = "_dimBarLabel_11m4k_73", Xn = "_dimChip_11m4k_78", Zn = "_dimChipActive_11m4k_96", ea = "_dimOrder_11m4k_102", ta = "_dimReset_11m4k_115", na = "_dimSummary_11m4k_128", aa = "_listHost_11m4k_135", sa = "_groupHeader_11m4k_141", ca = "_groupCaret_11m4k_158", la = "_groupCaretOpen_11m4k_165", oa = "_groupLabel_11m4k_169", ia = "_groupCount_11m4k_175", ra = "_rowWrap_11m4k_183", da = "_row_11m4k_183", ma = "_agentDot_11m4k_212", ha = "_rowTitle_11m4k_225", ua = "_spacePill_11m4k_235", pa = "_rowAgent_11m4k_251", _a = "_rowTime_11m4k_265", ya = "_rowActions_11m4k_273", ga = "_rowActionBtn_11m4k_281", ba = "_rowActionBtnActive_11m4k_297", Na = "_rowUpdating_11m4k_310", ka = "_menuMask_11m4k_315", va = "_empty_11m4k_322", fa = "_emptySpinner_11m4k_332", Ca = "_emptyTitle_11m4k_336", f = {
320
- host: zn,
321
- header: Wn,
322
- title: Kn,
323
- subtitle: qn,
324
- searchWrap: Un,
325
- searchIcon: Vn,
326
- searchInput: Jn,
327
- dimBar: Qn,
328
- dimBarLabel: Yn,
329
- dimChip: Xn,
330
- dimChipActive: Zn,
331
- dimOrder: ea,
332
- dimReset: ta,
333
- dimSummary: na,
334
- listHost: aa,
335
- groupHeader: sa,
336
- groupCaret: ca,
337
- groupCaretOpen: la,
338
- groupLabel: oa,
339
- groupCount: ia,
340
- rowWrap: ra,
341
- row: da,
342
- agentDot: ma,
343
- rowTitle: ha,
344
- spacePill: ua,
345
- rowAgent: pa,
346
- rowTime: _a,
347
- rowActions: ya,
348
- rowActionBtn: ga,
349
- rowActionBtnActive: ba,
350
- rowUpdating: Na,
351
- menuMask: ka,
352
- empty: va,
353
- emptySpinner: fa,
354
- emptyTitle: Ca
355
- }, wa = "_shell_jxhej_3", Ta = "_sidebar_jxhej_28", Ia = "_sideContent_jxhej_38", ja = "_newTaskBtn_jxhej_49", Ma = "_sideNav_jxhej_80", Sa = "_moreGear_jxhej_87", xa = "_moreFlyout_jxhej_113", $a = "_moreFlyoutItem_jxhej_127", Aa = "_moreFlyoutIcon_jxhej_152", Da = "_moreFlyoutDivider_jxhej_159", Ba = "_sideTasks_jxhej_166", Oa = "_segToggle_jxhej_175", La = "_segBtn_jxhej_185", Ra = "_segBtnActive_jxhej_208", Ha = "_tasksLabel_jxhej_215", Ea = "_projFolder_jxhej_223", Ga = "_projCaret_jxhej_249", Pa = "_projCaretOpen_jxhej_257", Fa = "_projIcon_jxhej_261", za = "_projName_jxhej_267", Wa = "_projMeta_jxhej_276", Ka = "_projRows_jxhej_282", qa = "_tasksEmpty_jxhej_291", Ua = "_recentItem_jxhej_297", Va = "_recentItemActive_jxhej_328", Ja = "_recentItemText_jxhej_334", Qa = "_agentDot_jxhej_341", Ya = "_navItem_jxhej_354", Xa = "_navItemActive_jxhej_385", Za = "_navIcon_jxhej_390", es = "_sideFooter_jxhej_396", ts = "_agentMenu_jxhej_406", ns = "_settingsMenu_jxhej_407", as = "_accountHeader_jxhej_415", ss = "_accountAvatar_jxhej_424", cs = "_accountName_jxhej_437", ls = "_accountItemDisabled_jxhej_447", os = "_menuDivider_jxhej_457", is = "_footerCard_jxhej_464", rs = "_footerAvatar_jxhej_471", ds = "_footerMeta_jxhej_484", ms = "_footerName_jxhej_492", hs = "_footerSub_jxhej_501", us = "_footerGear_jxhej_509", ps = "_main_jxhej_530", _s = "_chatHost_jxhej_539", ys = "_detailHost_jxhej_544", gs = "_personalTabHost_jxhej_550", bs = "_landing_jxhej_560", Ns = "_landingInner_jxhej_570", ks = "_landingTitle_jxhej_578", vs = "_landingSub_jxhej_586", fs = "_landingBox_jxhej_592", Cs = "_landingInput_jxhej_608", ws = "_landingBoxBar_jxhej_624", Ts = "_agentChipWrap_jxhej_631", Is = "_agentChip_jxhej_631", js = "_chipCaret_jxhej_656", Ms = "_agentChipEmpty_jxhej_661", Ss = "_agentMenuMask_jxhej_666", xs = "_agentMenuItem_jxhej_690", $s = "_agentMenuItemActive_jxhej_711", As = "_landingSend_jxhej_716", Ds = "_chipRow_jxhej_741", Bs = "_suggestChip_jxhej_748", Os = "_emptyState_jxhej_768", Ls = "_emptyTitle_jxhej_780", Rs = "_newTaskWrap_jxhej_799", Hs = "_dropDownMenu_jxhej_803", Es = "_spaceMenu_jxhej_808", Gs = "_spaceIcon_jxhej_813", Ps = "_spaceName_jxhej_823", Fs = "_spaceEmpty_jxhej_829", zs = "_spaceMenuRight_jxhej_835", s = {
356
- shell: wa,
357
- sidebar: Ta,
358
- sideContent: Ia,
359
- newTaskBtn: ja,
360
- sideNav: Ma,
361
- moreGear: Sa,
362
- moreFlyout: xa,
363
- moreFlyoutItem: $a,
364
- moreFlyoutIcon: Aa,
365
- moreFlyoutDivider: Da,
366
- sideTasks: Ba,
367
- segToggle: Oa,
368
- segBtn: La,
369
- segBtnActive: Ra,
370
- tasksLabel: Ha,
371
- projFolder: Ea,
372
- projCaret: Ga,
373
- projCaretOpen: Pa,
374
- projIcon: Fa,
375
- projName: za,
376
- projMeta: Wa,
377
- projRows: Ka,
378
- tasksEmpty: qa,
379
- recentItem: Ua,
380
- recentItemActive: Va,
381
- recentItemText: Ja,
382
- agentDot: Qa,
383
- navItem: Ya,
384
- navItemActive: Xa,
385
- navIcon: Za,
386
- sideFooter: es,
387
- agentMenu: ts,
388
- settingsMenu: ns,
389
- accountHeader: as,
390
- accountAvatar: ss,
391
- accountName: cs,
392
- accountItemDisabled: ls,
393
- menuDivider: os,
394
- footerCard: is,
395
- footerAvatar: rs,
396
- footerMeta: ds,
397
- footerName: ms,
398
- footerSub: hs,
399
- footerGear: us,
400
- main: ps,
401
- chatHost: _s,
402
- detailHost: ys,
403
- personalTabHost: gs,
404
- landing: bs,
405
- landingInner: Ns,
406
- landingTitle: ks,
407
- landingSub: vs,
408
- landingBox: fs,
409
- landingInput: Cs,
410
- landingBoxBar: ws,
411
- agentChipWrap: Ts,
412
- agentChip: Is,
413
- chipCaret: js,
414
- agentChipEmpty: Ms,
415
- agentMenuMask: Ss,
416
- agentMenuItem: xs,
417
- agentMenuItemActive: $s,
418
- landingSend: As,
419
- chipRow: Ds,
420
- suggestChip: Bs,
421
- emptyState: Os,
422
- emptyTitle: Ls,
423
- newTaskWrap: Rs,
424
- dropDownMenu: Hs,
425
- spaceMenu: Es,
426
- spaceIcon: Gs,
427
- spaceName: Ps,
428
- spaceEmpty: Fs,
429
- spaceMenuRight: zs
430
- };
431
- function Ze({
432
- token: a,
433
- down: c = !1,
434
- alignRight: l = !1,
435
- currentId: h = null,
436
- onPick: b
437
- }) {
438
- const [_, $] = m(null);
439
- return V(() => {
440
- let p = !0;
441
- return jt(a).then((A) => {
442
- if (!p) return;
443
- const F = /* @__PURE__ */ new Set(), w = [];
444
- for (const T of [...A.owned, ...A.joined])
445
- F.has(T.id) || (F.add(T.id), w.push(T));
446
- $(w);
447
- }).catch(() => {
448
- p && $([]);
449
- }), () => {
450
- p = !1;
451
- };
452
- }, [a]), /* @__PURE__ */ t(
453
- "div",
454
- {
455
- className: `${s.agentMenu} ${s.spaceMenu} ${c ? s.dropDownMenu : ""} ${l ? s.spaceMenuRight : ""}`,
456
- role: "menu",
457
- "aria-label": "选择项目空间",
458
- children: [
459
- /* @__PURE__ */ t(
460
- "button",
461
- {
462
- type: "button",
463
- role: "menuitem",
464
- className: `${s.agentMenuItem} ${h == null ? s.agentMenuItemActive : ""}`,
465
- onClick: () => b(null),
466
- children: [
467
- /* @__PURE__ */ e("span", { className: s.spaceIcon, children: /* @__PURE__ */ e(Se, {}) }),
468
- /* @__PURE__ */ e("span", { children: "不归组" })
469
- ]
470
- }
471
- ),
472
- (_ ?? []).map((p) => /* @__PURE__ */ t(
473
- "button",
474
- {
475
- type: "button",
476
- role: "menuitem",
477
- className: `${s.agentMenuItem} ${p.id === h ? s.agentMenuItemActive : ""}`,
478
- onClick: () => b({ id: p.id, title: p.title }),
479
- children: [
480
- /* @__PURE__ */ e("span", { className: s.spaceIcon, children: p.icon || /* @__PURE__ */ e(Se, {}) }),
481
- /* @__PURE__ */ e("span", { className: s.spaceName, children: p.title })
482
- ]
483
- },
484
- p.id
485
- )),
486
- _ != null && _.length === 0 && /* @__PURE__ */ e("div", { className: s.spaceEmpty, children: "还没有项目空间,可在待办看板创建" }),
487
- _ == null && /* @__PURE__ */ e("div", { className: s.spaceEmpty, children: "加载中…" })
488
- ]
489
- }
490
- );
491
- }
492
- const bt = [
493
- { key: "time", label: "时间" },
494
- { key: "space", label: "项目空间" },
495
- { key: "agent", label: "伙伴" }
496
- ], Nt = "ft_exclusive_history_groupDims", kt = ["#2F70F1", "#52c41a", "#fa8c16", "#722ed1", "#13c2c2"];
497
- function Ws(a) {
498
- let c = 0;
499
- for (let l = 0; l < a.length; l++) c = c * 31 + a.charCodeAt(l) | 0;
500
- return kt[Math.abs(c) % kt.length];
501
- }
502
- function Ks(a) {
503
- const c = a.updateTime || a.createTime || "";
504
- return c.length >= 16 ? c.slice(5, 16) : c || "--";
505
- }
506
- function qs(a) {
507
- const c = a.updateTime || a.createTime || "";
508
- if (!c) return ["5", "未知时间"];
509
- const l = new Date(c.replace(" ", "T"));
510
- if (Number.isNaN(l.getTime())) return ["5", "未知时间"];
511
- const h = /* @__PURE__ */ new Date(), b = new Date(
512
- h.getFullYear(),
513
- h.getMonth(),
514
- h.getDate()
515
- ).getTime(), _ = l.getTime();
516
- return _ >= b ? ["1", "今天"] : _ >= b - 864e5 ? ["2", "昨天"] : _ >= b - 7 * 864e5 ? ["3", "近7天"] : ["4", "更早"];
517
- }
518
- function Us({
519
- agents: a,
520
- token: c,
521
- onOpenSession: l
522
- }) {
523
- const [h, b] = m([]), [_, $] = m(!0), [p, A] = m(() => {
524
- try {
525
- const d = localStorage.getItem(Nt);
526
- return (d ? JSON.parse(d) : []).filter(
527
- (D) => bt.some((H) => H.key === D)
528
- );
529
- } catch {
530
- return [];
531
- }
532
- }), [F, w] = m(
533
- /* @__PURE__ */ new Set()
534
- ), [T, N] = m(""), [W, L] = m(null), [U, G] = m(null);
535
- V(() => {
536
- let d = !0;
537
- return $(!0), It(c).then((g) => {
538
- d && b(g || []);
539
- }).catch(() => {
540
- d && b([]);
541
- }).finally(() => {
542
- d && $(!1);
543
- }), () => {
544
- d = !1;
545
- };
546
- }, [c]), V(() => {
547
- localStorage.setItem(Nt, JSON.stringify(p));
548
- }, [p]);
549
- const J = se(() => {
550
- const d = /* @__PURE__ */ new Map();
551
- for (const g of a) d.set(g.id, g);
552
- return d;
553
- }, [a]), K = X((d) => {
554
- A(
555
- (g) => g.includes(d) ? g.filter((D) => D !== d) : [...g, d]
556
- );
557
- }, []), Z = X((d) => {
558
- w((g) => {
559
- const D = new Set(g);
560
- return D.has(d) ? D.delete(d) : D.add(d), D;
561
- });
562
- }, []), R = se(() => {
563
- const d = T.trim().toLowerCase(), g = d ? h.filter((z) => (z.title || "").toLowerCase().includes(d)) : h;
564
- if (p.length === 0)
565
- return [{ key: "__all__", label: "", rawKey: "", sessions: g }];
566
- function D(z, ce) {
567
- var ue;
568
- switch (ce) {
569
- case "time":
570
- return qs(z);
571
- case "space":
572
- return z.projectSpaceId != null ? [
573
- String(z.projectSpaceId),
574
- z.projectSpaceTitle || `空间 ${z.projectSpaceId}`
575
- ] : ["none", "未归组"];
576
- case "agent":
577
- return [
578
- String(z.personalAgentId),
579
- ((ue = J.get(z.personalAgentId)) == null ? void 0 : ue.displayName) || "未知伙伴"
580
- ];
581
- }
582
- }
583
- function H(z, ce, ue) {
584
- if (ce.length === 0) return [];
585
- const [le, ...be] = ce, S = /* @__PURE__ */ new Map();
586
- for (const P of z) {
587
- const [ee, de] = D(P, le);
588
- S.has(ee) || S.set(ee, { label: de, items: [] }), S.get(ee).items.push(P);
589
- }
590
- const Ne = [];
591
- for (const [P, { label: ee, items: de }] of S) {
592
- const oe = `${ue}::${le}=${P}`;
593
- Ne.push({
594
- key: oe,
595
- label: ee,
596
- rawKey: P,
597
- sessions: de,
598
- children: be.length > 0 ? H(de, be, oe) : void 0
599
- });
600
- }
601
- return Ne.sort(
602
- (P, ee) => le === "time" ? P.rawKey.localeCompare(ee.rawKey) : ee.sessions.length - P.sessions.length
603
- ), Ne;
604
- }
605
- return H(g, p, "");
606
- }, [h, p, T, J]), y = se(
607
- () => R.reduce((d, g) => d + g.sessions.length, 0),
608
- [R]
609
- ), q = X(
610
- async (d, g) => {
611
- L(null), G(d.id);
612
- try {
613
- const D = await nn(
614
- d.personalAgentId,
615
- d.id,
616
- c,
617
- g
618
- );
619
- b(
620
- (H) => H.map((z) => z.id === D.id ? { ...z, ...D } : z)
621
- );
622
- } catch {
623
- } finally {
624
- G(null);
625
- }
626
- },
627
- [c]
628
- ), j = X(
629
- (d) => {
630
- const g = J.get(d.personalAgentId), D = W === d.id;
631
- return /* @__PURE__ */ t("div", { className: f.rowWrap, children: [
632
- /* @__PURE__ */ t(
633
- "button",
634
- {
635
- type: "button",
636
- className: f.row,
637
- disabled: !g,
638
- title: g ? d.title : "伙伴已不存在,无法打开",
639
- onClick: () => g && l(g, d.id),
640
- children: [
641
- /* @__PURE__ */ e(
642
- "span",
643
- {
644
- className: f.agentDot,
645
- style: {
646
- background: Ws(
647
- (g == null ? void 0 : g.displayName) || String(d.personalAgentId)
648
- )
649
- },
650
- children: ((g == null ? void 0 : g.displayName) || "?").charAt(0).toUpperCase()
651
- }
652
- ),
653
- /* @__PURE__ */ e("span", { className: f.rowTitle, children: d.title || "未命名会话" }),
654
- d.projectSpaceId != null && /* @__PURE__ */ t("span", { className: f.spacePill, children: [
655
- /* @__PURE__ */ e(Se, {}),
656
- d.projectSpaceTitle || `空间 ${d.projectSpaceId}`
657
- ] }),
658
- /* @__PURE__ */ t("span", { className: f.rowAgent, children: [
659
- /* @__PURE__ */ e(Ee, {}),
660
- (g == null ? void 0 : g.displayName) || "未知伙伴"
661
- ] }),
662
- /* @__PURE__ */ e("span", { className: f.rowTime, children: Ks(d) })
663
- ]
664
- }
665
- ),
666
- /* @__PURE__ */ t("div", { className: f.rowActions, children: [
667
- /* @__PURE__ */ e(
668
- "button",
669
- {
670
- type: "button",
671
- className: `${f.rowActionBtn} ${d.projectSpaceId != null ? f.rowActionBtnActive : ""}`,
672
- title: "归入项目空间",
673
- onClick: () => L(D ? null : d.id),
674
- children: /* @__PURE__ */ e(Se, {})
675
- }
676
- ),
677
- U === d.id && /* @__PURE__ */ e(Xe, { className: f.rowUpdating }),
678
- D && /* @__PURE__ */ t(ie, { children: [
679
- /* @__PURE__ */ e(
680
- "div",
681
- {
682
- className: f.menuMask,
683
- onClick: () => L(null)
684
- }
685
- ),
686
- /* @__PURE__ */ e(
687
- Ze,
688
- {
689
- token: c,
690
- alignRight: !0,
691
- currentId: d.projectSpaceId ?? null,
692
- onPick: (H) => void q(d, H)
693
- }
694
- )
695
- ] })
696
- ] })
697
- ] }, d.id);
698
- },
699
- [J, W, l, c, q, U]
700
- ), M = X(
701
- (d, g) => {
702
- const D = F.has(d.key);
703
- return /* @__PURE__ */ t("div", { children: [
704
- d.label && /* @__PURE__ */ t(
705
- "button",
706
- {
707
- type: "button",
708
- className: f.groupHeader,
709
- style: { paddingLeft: 16 + g * 20 },
710
- onClick: () => Z(d.key),
711
- "aria-expanded": !D,
712
- children: [
713
- /* @__PURE__ */ e(
714
- qe,
715
- {
716
- className: `${f.groupCaret} ${D ? "" : f.groupCaretOpen}`
717
- }
718
- ),
719
- /* @__PURE__ */ e("span", { className: f.groupLabel, children: d.label }),
720
- /* @__PURE__ */ e("span", { className: f.groupCount, children: d.sessions.length })
721
- ]
722
- }
723
- ),
724
- !D && (d.children && d.children.length > 0 ? d.children.map((H) => M(H, g + 1)) : d.sessions.map((H) => j(H)))
725
- ] }, d.key);
726
- },
727
- [F, Z, j]
728
- );
729
- return /* @__PURE__ */ t("div", { className: f.host, children: [
730
- /* @__PURE__ */ t("div", { className: f.header, children: [
731
- /* @__PURE__ */ t("div", { children: [
732
- /* @__PURE__ */ e("h2", { className: f.title, children: "聊天记录" }),
733
- /* @__PURE__ */ e("p", { className: f.subtitle, children: "跨伙伴的全部会话,支持多维分组与项目空间归组" })
734
- ] }),
735
- /* @__PURE__ */ t("div", { className: f.searchWrap, children: [
736
- /* @__PURE__ */ e(et, { className: f.searchIcon }),
737
- /* @__PURE__ */ e(
738
- "input",
739
- {
740
- className: f.searchInput,
741
- placeholder: "搜索会话标题",
742
- value: T,
743
- onChange: (d) => N(d.target.value)
744
- }
745
- )
746
- ] })
747
- ] }),
748
- /* @__PURE__ */ t("div", { className: f.dimBar, children: [
749
- /* @__PURE__ */ e("span", { className: f.dimBarLabel, children: "分组" }),
750
- bt.map((d) => {
751
- const g = p.indexOf(d.key);
752
- return /* @__PURE__ */ t(
753
- "button",
754
- {
755
- type: "button",
756
- className: `${f.dimChip} ${g >= 0 ? f.dimChipActive : ""}`,
757
- title: `按${d.label}分组${g >= 0 ? `(第 ${g + 1} 层)` : ""}`,
758
- onClick: () => K(d.key),
759
- children: [
760
- d.label,
761
- g >= 0 && /* @__PURE__ */ e("span", { className: f.dimOrder, children: g + 1 })
762
- ]
763
- },
764
- d.key
765
- );
766
- }),
767
- p.length > 0 && /* @__PURE__ */ e(
768
- "button",
769
- {
770
- type: "button",
771
- className: f.dimReset,
772
- onClick: () => A([]),
773
- children: "重置"
774
- }
775
- ),
776
- /* @__PURE__ */ e("span", { className: f.dimSummary, children: _ ? "加载中…" : `${y} 个会话` })
777
- ] }),
778
- /* @__PURE__ */ e("div", { className: f.listHost, children: _ ? /* @__PURE__ */ t("div", { className: f.empty, children: [
779
- /* @__PURE__ */ e(Xe, { className: f.emptySpinner }),
780
- /* @__PURE__ */ e("span", { children: "正在加载聊天记录…" })
781
- ] }) : y === 0 ? /* @__PURE__ */ e("div", { className: f.empty, children: /* @__PURE__ */ e("span", { className: f.emptyTitle, children: h.length === 0 ? "还没有会话,去新建任务开始第一段对话吧" : "没有匹配的会话" }) }) : R.map((d) => M(d, 0)) })
782
- ] });
783
- }
784
- const Vs = "_host_11by3_1", Js = "_header_11by3_11", Qs = "_title_11by3_17", Ys = "_subtitle_11by3_24", Xs = "_section_11by3_30", Zs = "_sectionHead_11by3_36", ec = "_sectionIcon_11by3_42", tc = "_sectionTitle_11by3_48", nc = "_sectionDesc_11by3_54", ac = "_empty_11by3_59", sc = "_agentList_11by3_69", cc = "_agentRow_11by3_78", lc = "_agentDot_11by3_90", oc = "_agentMain_11by3_103", ic = "_agentName_11by3_111", rc = "_sharedBadge_11by3_120", dc = "_agentCode_11by3_129", mc = "_rowBtn_11by3_137", hc = "_rowBtnGhost_11by3_156", uc = "_createRow_11by3_160", pc = "_createInput_11by3_167", _c = "_createBtn_11by3_182", yc = "_skillGrid_11by3_202", gc = "_skillCard_11by3_208", bc = "_skillHead_11by3_218", Nc = "_skillName_11by3_225", kc = "_skillToggle_11by3_231", vc = "_skillToggleOn_11by3_254", fc = "_skillToggling_11by3_262", Cc = "_skillCategory_11by3_267", wc = "_skillDesc_11by3_276", Tc = "_marketToolbar_11by3_286", Ic = "_marketSearch_11by3_292", jc = "_marketSearchIcon_11by3_307", Mc = "_chipRow_11by3_324", Sc = "_chipRowLabel_11by3_331", xc = "_tagChip_11by3_339", $c = "_chip_11by3_324", Ac = "_chipActive_11by3_361", Dc = "_marketGroups_11by3_368", Bc = "_marketGroup_11by3_368", Oc = "_marketGroupHead_11by3_380", Lc = "_marketGroupName_11by3_388", Rc = "_marketGroupCount_11by3_394", Hc = "_marketGrid_11by3_399", Ec = "_marketCard_11by3_405", Gc = "_cardHead_11by3_427", Pc = "_cardIcon_11by3_433", Fc = "_cardTitle_11by3_445", zc = "_cardName_11by3_452", Wc = "_cardCode_11by3_461", Kc = "_cardDesc_11by3_470", qc = "_tagRow_11by3_479", Uc = "_tagPill_11by3_485", Vc = "_cardSymptom_11by3_495", Jc = "_cardFoot_11by3_515", Qc = "_footTag_11by3_523", Yc = "_footMeta_11by3_532", Xc = "_detailMask_11by3_542", Zc = "_detailPanel_11by3_549", el = "_detailHead_11by3_567", tl = "_detailTitleWrap_11by3_574", nl = "_detailTitle_11by3_574", al = "_detailCode_11by3_587", sl = "_detailClose_11by3_593", cl = "_detailMeta_11by3_610", ll = "_metaItem_11by3_616", ol = "_detailSymptoms_11by3_624", il = "_detailSymptomLabel_11by3_635", rl = "_detailBody_11by3_642", dl = "_detailRefs_11by3_657", ml = "_detailRefsBody_11by3_663", hl = "_detailNote_11by3_678", ul = "_placeholderGrid_11by3_686", pl = "_placeholderCard_11by3_692", _l = "_placeholderName_11by3_701", yl = "_placeholderDesc_11by3_707", i = {
785
- host: Vs,
786
- header: Js,
787
- title: Qs,
788
- subtitle: Ys,
789
- section: Xs,
790
- sectionHead: Zs,
791
- sectionIcon: ec,
792
- sectionTitle: tc,
793
- sectionDesc: nc,
794
- empty: ac,
795
- agentList: sc,
796
- agentRow: cc,
797
- agentDot: lc,
798
- agentMain: oc,
799
- agentName: ic,
800
- sharedBadge: rc,
801
- agentCode: dc,
802
- rowBtn: mc,
803
- rowBtnGhost: hc,
804
- createRow: uc,
805
- createInput: pc,
806
- createBtn: _c,
807
- skillGrid: yc,
808
- skillCard: gc,
809
- skillHead: bc,
810
- skillName: Nc,
811
- skillToggle: kc,
812
- skillToggleOn: vc,
813
- skillToggling: fc,
814
- skillCategory: Cc,
815
- skillDesc: wc,
816
- marketToolbar: Tc,
817
- marketSearch: Ic,
818
- marketSearchIcon: jc,
819
- chipRow: Mc,
820
- chipRowLabel: Sc,
821
- tagChip: xc,
822
- chip: $c,
823
- chipActive: Ac,
824
- marketGroups: Dc,
825
- marketGroup: Bc,
826
- marketGroupHead: Oc,
827
- marketGroupName: Lc,
828
- marketGroupCount: Rc,
829
- marketGrid: Hc,
830
- marketCard: Ec,
831
- cardHead: Gc,
832
- cardIcon: Pc,
833
- cardTitle: Fc,
834
- cardName: zc,
835
- cardCode: Wc,
836
- cardDesc: Kc,
837
- tagRow: qc,
838
- tagPill: Uc,
839
- cardSymptom: Vc,
840
- cardFoot: Jc,
841
- footTag: Qc,
842
- footMeta: Yc,
843
- detailMask: Xc,
844
- detailPanel: Zc,
845
- detailHead: el,
846
- detailTitleWrap: tl,
847
- detailTitle: nl,
848
- detailCode: al,
849
- detailClose: sl,
850
- detailMeta: cl,
851
- metaItem: ll,
852
- detailSymptoms: ol,
853
- detailSymptomLabel: il,
854
- detailBody: rl,
855
- detailRefs: dl,
856
- detailRefsBody: ml,
857
- detailNote: hl,
858
- placeholderGrid: ul,
859
- placeholderCard: pl,
860
- placeholderName: _l,
861
- placeholderDesc: yl
862
- };
863
- function gl({
864
- agents: a,
865
- loading: c,
866
- skillsAgent: l,
867
- token: h,
868
- onChat: b,
869
- onConfig: _,
870
- onCreated: $
871
- }) {
872
- var Ge;
873
- const p = a.filter((r) => !r.isLocal), [A, F] = m([]), [w, T] = m(!1), [N, W] = m(null), [L, U] = m(""), [G, J] = m(!1), [K, Z] = m([]), [R, y] = m(!1), [q, j] = m(""), [M, d] = m(""), [g, D] = m(""), [H, z] = m(null), [ce, ue] = m(null), [le, be] = m(!1), [S, Ne] = m(null), [P, ee] = m(null), [de, oe] = m(!1);
874
- V(() => {
875
- const r = setTimeout(() => D(M.trim()), 300);
876
- return () => clearTimeout(r);
877
- }, [M]);
878
- const $e = X(async () => {
879
- y(!0), j("");
880
- try {
881
- const r = await fn(
882
- { status: 1, keyword: g || void 0 },
883
- h
884
- );
885
- Z(r);
886
- } catch (r) {
887
- Z([]), j(r instanceof Error ? r.message : "技能市场加载失败");
888
- } finally {
889
- y(!1);
890
- }
891
- }, [g, h]);
892
- V(() => {
893
- $e();
894
- }, [$e]);
895
- const Ae = "未分组", De = (r) => {
896
- const B = String(r.tags ?? "").split(/[,,;;]/).map((x) => x.trim()).filter(Boolean);
897
- return B.length ? B : [r.category || "通用"];
898
- }, ke = (r) => {
899
- var B;
900
- return ((B = r.skillGroup) == null ? void 0 : B.trim()) || Ae;
901
- }, ne = Array.from(new Set(K.map(ke))).sort(
902
- (r, B) => (r === Ae ? 1 : 0) - (B === Ae ? 1 : 0) || r.localeCompare(B, "zh")
903
- ), Be = Array.from(new Set(K.flatMap(De))).sort(
904
- (r, B) => r.localeCompare(B, "zh")
905
- ), Ue = K.filter(
906
- (r) => (H === null || ke(r) === H) && (ce === null || De(r).includes(ce))
907
- ), Oe = ne.map((r) => ({
908
- group: r,
909
- items: Ue.filter((B) => ke(B) === r)
910
- })).filter((r) => r.items.length > 0), Ve = async (r) => {
911
- if (Ne(r), ee(null), be(!0), !!r.id) {
912
- oe(!0);
913
- try {
914
- ee(await Cn(r.id, h));
915
- } catch {
916
- ee(null);
917
- } finally {
918
- oe(!1);
919
- }
920
- }
921
- }, Le = X(async () => {
922
- if (l) {
923
- T(!0);
924
- try {
925
- const r = await ln(
926
- l.id,
927
- 1,
928
- 50,
929
- h
930
- );
931
- F(r.items);
932
- } catch {
933
- F([]);
934
- } finally {
935
- T(!1);
936
- }
937
- }
938
- }, [l, h]);
939
- V(() => {
940
- Le();
941
- }, [Le]);
942
- const Me = async (r) => {
943
- if (!(!l || N)) {
944
- W(r.skill_code);
945
- try {
946
- await on(
947
- l.id,
948
- r.skill_code,
949
- !r.enabled,
950
- h
951
- ), F(
952
- (B) => B.map(
953
- (x) => x.skill_code === r.skill_code ? { ...x, enabled: !r.enabled } : x
954
- )
955
- );
956
- } catch {
957
- } finally {
958
- W(null);
959
- }
960
- }
961
- }, pe = async () => {
962
- const r = L.trim();
963
- if (!(!r || G)) {
964
- J(!0);
965
- try {
966
- const B = await an(r, h);
967
- $(B), U("");
968
- } catch {
969
- } finally {
970
- J(!1);
971
- }
972
- }
973
- };
974
- return /* @__PURE__ */ t("div", { className: i.host, children: [
975
- /* @__PURE__ */ t("div", { className: i.header, children: [
976
- /* @__PURE__ */ e("h2", { className: i.title, children: "更多能力" }),
977
- /* @__PURE__ */ e("p", { className: i.subtitle, children: "伙伴的能力与管理,先复刻个人工作台已有功能" })
978
- ] }),
979
- /* @__PURE__ */ t("section", { className: i.section, children: [
980
- /* @__PURE__ */ t("div", { className: i.sectionHead, children: [
981
- /* @__PURE__ */ e("span", { className: i.sectionIcon, children: /* @__PURE__ */ e(Ee, {}) }),
982
- /* @__PURE__ */ e("span", { className: i.sectionTitle, children: "智能体" }),
983
- /* @__PURE__ */ t("span", { className: i.sectionDesc, children: [
984
- p.length,
985
- " 个云端伙伴 · 可聊天 / 配置"
986
- ] })
987
- ] }),
988
- /* @__PURE__ */ t("div", { className: i.agentList, children: [
989
- c && /* @__PURE__ */ e("div", { className: i.empty, children: "加载中…" }),
990
- !c && p.length === 0 && /* @__PURE__ */ e("div", { className: i.empty, children: "还没有云端伙伴" }),
991
- p.map((r) => /* @__PURE__ */ t("div", { className: i.agentRow, children: [
992
- /* @__PURE__ */ e(
993
- "span",
994
- {
995
- className: i.agentDot,
996
- style: { background: ft(r.displayName) },
997
- children: r.displayName.charAt(0).toUpperCase()
998
- }
999
- ),
1000
- /* @__PURE__ */ t("div", { className: i.agentMain, children: [
1001
- /* @__PURE__ */ t("div", { className: i.agentName, children: [
1002
- r.displayName,
1003
- r.shared === 1 && /* @__PURE__ */ e("span", { className: i.sharedBadge, children: "共享" })
1004
- ] }),
1005
- /* @__PURE__ */ e("div", { className: i.agentCode, children: r.agentCode })
1006
- ] }),
1007
- /* @__PURE__ */ e(
1008
- "button",
1009
- {
1010
- type: "button",
1011
- className: i.rowBtn,
1012
- onClick: () => b(r),
1013
- children: "聊天"
1014
- }
1015
- ),
1016
- /* @__PURE__ */ e(
1017
- "button",
1018
- {
1019
- type: "button",
1020
- className: `${i.rowBtn} ${i.rowBtnGhost}`,
1021
- onClick: () => _(r),
1022
- children: "配置"
1023
- }
1024
- )
1025
- ] }, r.id))
1026
- ] }),
1027
- /* @__PURE__ */ t("div", { className: i.createRow, children: [
1028
- /* @__PURE__ */ e(
1029
- "input",
1030
- {
1031
- className: i.createInput,
1032
- value: L,
1033
- placeholder: "新智能体名称",
1034
- onChange: (r) => U(r.target.value),
1035
- onKeyDown: (r) => {
1036
- r.key === "Enter" && !r.nativeEvent.isComposing && pe();
1037
- }
1038
- }
1039
- ),
1040
- /* @__PURE__ */ t(
1041
- "button",
1042
- {
1043
- type: "button",
1044
- className: i.createBtn,
1045
- disabled: !L.trim() || G,
1046
- onClick: () => void pe(),
1047
- children: [
1048
- /* @__PURE__ */ e(tt, {}),
1049
- "新建"
1050
- ]
1051
- }
1052
- )
1053
- ] })
1054
- ] }),
1055
- /* @__PURE__ */ t("section", { className: i.section, children: [
1056
- /* @__PURE__ */ t("div", { className: i.sectionHead, children: [
1057
- /* @__PURE__ */ e("span", { className: i.sectionIcon, children: /* @__PURE__ */ e(yt, {}) }),
1058
- /* @__PURE__ */ e("span", { className: i.sectionTitle, children: "技能市场" }),
1059
- /* @__PURE__ */ e("span", { className: i.sectionDesc, children: R ? "加载中…" : `${K.length} 个上架技能 · FT 内置技能渠道` })
1060
- ] }),
1061
- /* @__PURE__ */ t("div", { className: i.marketToolbar, children: [
1062
- /* @__PURE__ */ t("div", { className: i.marketSearch, children: [
1063
- /* @__PURE__ */ e(et, { className: i.marketSearchIcon }),
1064
- /* @__PURE__ */ e(
1065
- "input",
1066
- {
1067
- value: M,
1068
- placeholder: "搜索名称 / code / 适用症状",
1069
- onChange: (r) => d(r.target.value)
1070
- }
1071
- )
1072
- ] }),
1073
- /* @__PURE__ */ t("div", { className: i.chipRow, children: [
1074
- /* @__PURE__ */ e(
1075
- "button",
1076
- {
1077
- type: "button",
1078
- className: `${i.chip} ${H === null ? i.chipActive : ""}`,
1079
- onClick: () => z(null),
1080
- children: "全部技能"
1081
- }
1082
- ),
1083
- ne.map((r) => /* @__PURE__ */ t(
1084
- "button",
1085
- {
1086
- type: "button",
1087
- className: `${i.chip} ${H === r ? i.chipActive : ""}`,
1088
- onClick: () => z(H === r ? null : r),
1089
- children: [
1090
- r,
1091
- " · ",
1092
- K.filter((B) => ke(B) === r).length
1093
- ]
1094
- },
1095
- r
1096
- ))
1097
- ] }),
1098
- Be.length > 0 && /* @__PURE__ */ t("div", { className: i.chipRow, children: [
1099
- /* @__PURE__ */ e("span", { className: i.chipRowLabel, children: "分类标" }),
1100
- Be.map((r) => /* @__PURE__ */ e(
1101
- "button",
1102
- {
1103
- type: "button",
1104
- className: `${i.chip} ${i.tagChip} ${ce === r ? i.chipActive : ""}`,
1105
- onClick: () => ue(ce === r ? null : r),
1106
- children: r
1107
- },
1108
- r
1109
- ))
1110
- ] })
1111
- ] }),
1112
- R && K.length === 0 ? /* @__PURE__ */ e("div", { className: i.empty, children: "技能市场加载中…" }) : q ? /* @__PURE__ */ e("div", { className: i.empty, children: q }) : Oe.length === 0 ? /* @__PURE__ */ e("div", { className: i.empty, children: K.length === 0 ? "渠道暂无上架技能" : "没有匹配的技能" }) : /* @__PURE__ */ e("div", { className: i.marketGroups, children: Oe.map(({ group: r, items: B }) => /* @__PURE__ */ t("div", { className: i.marketGroup, children: [
1113
- /* @__PURE__ */ t("div", { className: i.marketGroupHead, children: [
1114
- /* @__PURE__ */ e("span", { className: i.marketGroupName, children: r }),
1115
- /* @__PURE__ */ t("span", { className: i.marketGroupCount, children: [
1116
- B.length,
1117
- " 个技能"
1118
- ] })
1119
- ] }),
1120
- /* @__PURE__ */ e("div", { className: i.marketGrid, children: B.map((x) => {
1121
- var ve;
1122
- return /* @__PURE__ */ t(
1123
- "button",
1124
- {
1125
- type: "button",
1126
- className: i.marketCard,
1127
- onClick: () => void Ve(x),
1128
- children: [
1129
- /* @__PURE__ */ t("div", { className: i.cardHead, children: [
1130
- /* @__PURE__ */ e(
1131
- "span",
1132
- {
1133
- className: i.cardIcon,
1134
- style: { background: ft(x.category || "通用") },
1135
- children: /* @__PURE__ */ e(yt, {})
1136
- }
1137
- ),
1138
- /* @__PURE__ */ t("div", { className: i.cardTitle, children: [
1139
- /* @__PURE__ */ e("span", { className: i.cardName, children: x.name }),
1140
- /* @__PURE__ */ e("span", { className: i.cardCode, children: x.code })
1141
- ] })
1142
- ] }),
1143
- x.description && /* @__PURE__ */ e("div", { className: i.cardDesc, children: x.description }),
1144
- /* @__PURE__ */ e("div", { className: i.tagRow, children: De(x).map((We) => /* @__PURE__ */ e("span", { className: i.tagPill, children: We }, We)) }),
1145
- x.symptoms && /* @__PURE__ */ t("div", { className: i.cardSymptom, children: [
1146
- /* @__PURE__ */ e("span", { children: "适用" }),
1147
- x.symptoms
1148
- ] }),
1149
- /* @__PURE__ */ t("div", { className: i.cardFoot, children: [
1150
- /* @__PURE__ */ e("span", { className: i.footTag, children: ((ve = x.skillGroup) == null ? void 0 : ve.trim()) || x.category || "通用" }),
1151
- /* @__PURE__ */ e("span", { className: i.footMeta, children: [
1152
- x.maintainer,
1153
- x.version ? `v${x.version}` : "",
1154
- x.updateTime ? String(x.updateTime).slice(0, 10) : ""
1155
- ].filter(Boolean).join(" · ") })
1156
- ] })
1157
- ]
1158
- },
1159
- x.id ?? x.code
1160
- );
1161
- }) })
1162
- ] }, r)) })
1163
- ] }),
1164
- /* @__PURE__ */ t("section", { className: i.section, children: [
1165
- /* @__PURE__ */ t("div", { className: i.sectionHead, children: [
1166
- /* @__PURE__ */ e("span", { className: i.sectionIcon, children: /* @__PURE__ */ e(nt, {}) }),
1167
- /* @__PURE__ */ e("span", { className: i.sectionTitle, children: "伙伴技能" }),
1168
- /* @__PURE__ */ e("span", { className: i.sectionDesc, children: l ? `Galaxy 技能绑定 · ${l.displayName},开关即时生效` : "暂无可用伙伴" })
1169
- ] }),
1170
- w ? /* @__PURE__ */ e("div", { className: i.empty, children: "技能加载中…" }) : A.length === 0 ? /* @__PURE__ */ e("div", { className: i.empty, children: "暂无可用 Skill" }) : /* @__PURE__ */ e("div", { className: i.skillGrid, children: A.map((r) => /* @__PURE__ */ t("div", { className: i.skillCard, children: [
1171
- /* @__PURE__ */ t("div", { className: i.skillHead, children: [
1172
- /* @__PURE__ */ e("span", { className: i.skillName, children: r.name }),
1173
- /* @__PURE__ */ e(
1174
- "span",
1175
- {
1176
- className: `${i.skillToggle} ${r.enabled ? i.skillToggleOn : ""} ${N === r.skill_code ? i.skillToggling : ""}`,
1177
- role: "switch",
1178
- "aria-checked": r.enabled,
1179
- onClick: () => void Me(r),
1180
- children: /* @__PURE__ */ e("i", {})
1181
- }
1182
- )
1183
- ] }),
1184
- r.category && /* @__PURE__ */ e("span", { className: i.skillCategory, children: r.category }),
1185
- /* @__PURE__ */ e("div", { className: i.skillDesc, children: r.description })
1186
- ] }, r.skill_code)) })
1187
- ] }),
1188
- /* @__PURE__ */ t("section", { className: i.section, children: [
1189
- /* @__PURE__ */ t("div", { className: i.sectionHead, children: [
1190
- /* @__PURE__ */ e("span", { className: i.sectionIcon, children: /* @__PURE__ */ e($t, {}) }),
1191
- /* @__PURE__ */ e("span", { className: i.sectionTitle, children: "即将上线" })
1192
- ] }),
1193
- /* @__PURE__ */ t("div", { className: i.placeholderGrid, children: [
1194
- /* @__PURE__ */ t("div", { className: i.placeholderCard, children: [
1195
- /* @__PURE__ */ e("span", { className: i.placeholderName, children: "插件" }),
1196
- /* @__PURE__ */ e("span", { className: i.placeholderDesc, children: "插件市场接入后开放" })
1197
- ] }),
1198
- /* @__PURE__ */ t("div", { className: i.placeholderCard, children: [
1199
- /* @__PURE__ */ e("span", { className: i.placeholderName, children: "连接器" }),
1200
- /* @__PURE__ */ e("span", { className: i.placeholderDesc, children: "外部系统连接器接入后开放" })
1201
- ] })
1202
- ] })
1203
- ] }),
1204
- le && S && /* @__PURE__ */ t(ie, { children: [
1205
- /* @__PURE__ */ e(
1206
- "div",
1207
- {
1208
- className: i.detailMask,
1209
- onClick: () => be(!1)
1210
- }
1211
- ),
1212
- /* @__PURE__ */ t("div", { className: i.detailPanel, role: "dialog", children: [
1213
- /* @__PURE__ */ t("div", { className: i.detailHead, children: [
1214
- /* @__PURE__ */ t("div", { className: i.detailTitleWrap, children: [
1215
- /* @__PURE__ */ e("span", { className: i.detailTitle, children: S.name }),
1216
- /* @__PURE__ */ e("span", { className: i.detailCode, children: S.code })
1217
- ] }),
1218
- /* @__PURE__ */ e(
1219
- "button",
1220
- {
1221
- type: "button",
1222
- className: i.detailClose,
1223
- onClick: () => be(!1),
1224
- "aria-label": "关闭",
1225
- children: "×"
1226
- }
1227
- )
1228
- ] }),
1229
- /* @__PURE__ */ e("div", { className: i.detailMeta, children: ((Ge = S.skillGroup) != null && Ge.trim() ? [`技能组 · ${S.skillGroup.trim()}`] : []).concat(De(S).map((r) => `标签 · ${r}`)).concat([
1230
- S.category || "通用",
1231
- S.maintainer ? `维护 ${S.maintainer}` : "",
1232
- S.version ? `v${S.version}` : "",
1233
- S.updateTime ? `更新 ${String(S.updateTime).slice(0, 10)}` : ""
1234
- ]).filter(Boolean).map((r, B) => /* @__PURE__ */ e("span", { className: i.metaItem, children: r }, B)) }),
1235
- S.symptoms && /* @__PURE__ */ t("div", { className: i.detailSymptoms, children: [
1236
- /* @__PURE__ */ e("span", { className: i.detailSymptomLabel, children: "适用症状" }),
1237
- S.symptoms
1238
- ] }),
1239
- de ? /* @__PURE__ */ e("div", { className: i.empty, children: "册子正文加载中…" }) : P != null && P.content ? /* @__PURE__ */ t(ie, { children: [
1240
- /* @__PURE__ */ e("pre", { className: i.detailBody, children: P.content }),
1241
- P.refFiles && /* @__PURE__ */ t("div", { className: i.detailRefs, children: [
1242
- /* @__PURE__ */ e("span", { className: i.detailSymptomLabel, children: "附属文件" }),
1243
- /* @__PURE__ */ e("pre", { className: i.detailRefsBody, children: P.refFiles })
1244
- ] })
1245
- ] }) : /* @__PURE__ */ e("div", { className: i.empty, children: "无册子正文" }),
1246
- /* @__PURE__ */ e("div", { className: i.detailNote, children: "伙伴运行时按「适用症状」经 skill 工具自动装册(search → fetch),无需手动安装" })
1247
- ] })
1248
- ] })
1249
- ] });
1250
- }
1251
- const vt = ["#2F70F1", "#52c41a", "#fa8c16", "#722ed1", "#13c2c2"];
1252
- function ft(a) {
1253
- let c = 0;
1254
- for (let l = 0; l < a.length; l++) c = c * 31 + a.charCodeAt(l) | 0;
1255
- return vt[Math.abs(c) % vt.length];
1256
- }
1257
- const bl = "_host_yz5cm_1", Nl = "_header_yz5cm_11", kl = "_title_yz5cm_18", vl = "_subtitle_yz5cm_25", fl = "_newBtn_yz5cm_31", Cl = "_schedulerBanner_yz5cm_47", wl = "_statusDot_yz5cm_57", Tl = "_statusDotOn_yz5cm_65", Il = "_schedulerText_yz5cm_70", jl = "_schedulerTitle_yz5cm_77", Ml = "_schedulerDesc_yz5cm_83", Sl = "_demoBadge_yz5cm_88", xl = "_taskList_yz5cm_97", $l = "_sectionHead_yz5cm_104", Al = "_sectionTitle_yz5cm_111", Dl = "_sectionCount_yz5cm_117", Bl = "_recordList_yz5cm_123", Ol = "_recordRow_yz5cm_129", Ll = "_runStatus_yz5cm_139", Rl = "_run_success_yz5cm_149", Hl = "_run_failed_yz5cm_154", El = "_run_running_yz5cm_159", Gl = "_recordMain_yz5cm_164", Pl = "_recordTask_yz5cm_172", Fl = "_recordSummary_yz5cm_178", zl = "_recordMeta_yz5cm_186", Wl = "_taskRow_yz5cm_196", Kl = "_toggle_yz5cm_206", ql = "_taskMain_yz5cm_227", Ul = "_taskName_yz5cm_235", Vl = "_taskDesc_yz5cm_241", Jl = "_taskMeta_yz5cm_249", Ql = "_metaLine_yz5cm_256", Yl = "_metaNext_yz5cm_264", Xl = "_footerHint_yz5cm_272", k = {
1258
- host: bl,
1259
- header: Nl,
1260
- title: kl,
1261
- subtitle: vl,
1262
- newBtn: fl,
1263
- schedulerBanner: Cl,
1264
- statusDot: wl,
1265
- statusDotOn: Tl,
1266
- schedulerText: Il,
1267
- schedulerTitle: jl,
1268
- schedulerDesc: Ml,
1269
- demoBadge: Sl,
1270
- taskList: xl,
1271
- sectionHead: $l,
1272
- sectionTitle: Al,
1273
- sectionCount: Dl,
1274
- recordList: Bl,
1275
- recordRow: Ol,
1276
- runStatus: Ll,
1277
- run_success: Rl,
1278
- run_failed: Hl,
1279
- run_running: El,
1280
- recordMain: Gl,
1281
- recordTask: Pl,
1282
- recordSummary: Fl,
1283
- recordMeta: zl,
1284
- taskRow: Wl,
1285
- toggle: Kl,
1286
- taskMain: ql,
1287
- taskName: Ul,
1288
- taskDesc: Vl,
1289
- taskMeta: Jl,
1290
- metaLine: Ql,
1291
- metaNext: Yl,
1292
- footerHint: Xl
1293
- };
1294
- function Zl(a) {
1295
- const c = a.trim().split(/\s+/);
1296
- if (c.length !== 5) return a;
1297
- const [l, h, b, _, $] = c;
1298
- if (_ !== "*" || b !== "*") return a;
1299
- const p = l.padStart(2, "0"), A = h.padStart(2, "0");
1300
- return $ === "*" ? `每天 ${A}:${p}` : $ === "1-5" ? `工作日 ${A}:${p}` : $ === "1" ? `每周一 ${A}:${p}` : $ === "0" || $ === "7" ? `每周日 ${A}:${p}` : a;
1301
- }
1302
- const Ct = [
1303
- {
1304
- id: 1,
1305
- name: "每日晨报",
1306
- desc: "汇总昨夜群聊进展与变更,整理成晨报发给我",
1307
- cron: "0 9 * * *",
1308
- agent: "Super Agent",
1309
- next: "明天 09:00"
1310
- },
1311
- {
1312
- id: 2,
1313
- name: "站会前提醒整理",
1314
- desc: "站会前 30 分钟整理我昨日的工作项与今日计划",
1315
- cron: "30 8 * * 1-5",
1316
- agent: "应用工坊-主控Agent",
1317
- next: "明天 08:30"
1318
- },
1319
- {
1320
- id: 3,
1321
- name: "每周变更周报",
1322
- desc: "把这周的代码变更与工单收敛成周报草稿",
1323
- cron: "0 18 * * 1",
1324
- agent: "Super Agent",
1325
- next: "周一 18:00"
1326
- }
1327
- ], wt = [
1328
- {
1329
- id: 1,
1330
- task: "每日晨报",
1331
- status: "success",
1332
- time: "今天 09:00",
1333
- duration: "1 分 12 秒",
1334
- summary: "晨报已生成并发送到聊天:昨日 12 条群聊进展、5 个代码变更"
1335
- },
1336
- {
1337
- id: 2,
1338
- task: "站会前提醒整理",
1339
- status: "success",
1340
- time: "今天 08:30",
1341
- duration: "48 秒",
1342
- summary: "已整理昨日工作项 6 条、今日计划 4 条,提醒已送达"
1343
- },
1344
- {
1345
- id: 3,
1346
- task: "每周变更周报",
1347
- status: "failed",
1348
- time: "周一 18:00",
1349
- duration: "3 分 05 秒",
1350
- summary: "执行失败:变更仓库拉取超时,下次触发自动重试"
1351
- },
1352
- {
1353
- id: 4,
1354
- task: "每日晨报",
1355
- status: "success",
1356
- time: "昨天 09:00",
1357
- duration: "1 分 03 秒",
1358
- summary: "晨报已生成并发送到聊天:昨日 8 条群聊进展、2 个代码变更"
1359
- }
1360
- ], eo = {
1361
- success: "成功",
1362
- failed: "失败",
1363
- running: "进行中"
1364
- };
1365
- function to({
1366
- localOnline: a
1367
- }) {
1368
- return /* @__PURE__ */ t("div", { className: k.host, children: [
1369
- /* @__PURE__ */ t("div", { className: k.header, children: [
1370
- /* @__PURE__ */ t("div", { children: [
1371
- /* @__PURE__ */ e("h2", { className: k.title, children: "定时任务" }),
1372
- /* @__PURE__ */ e("p", { className: k.subtitle, children: "让伙伴按计划自动干活,结果回到聊天" })
1373
- ] }),
1374
- /* @__PURE__ */ t(
1375
- "button",
1376
- {
1377
- type: "button",
1378
- className: k.newBtn,
1379
- disabled: !0,
1380
- title: "细节讨论中,样式先行",
1381
- children: [
1382
- /* @__PURE__ */ e(tt, {}),
1383
- /* @__PURE__ */ e("span", { children: "新建定时任务" })
1384
- ]
1385
- }
1386
- )
1387
- ] }),
1388
- /* @__PURE__ */ t("div", { className: k.schedulerBanner, children: [
1389
- /* @__PURE__ */ e(
1390
- "span",
1391
- {
1392
- className: `${k.statusDot} ${a ? k.statusDotOn : ""}`
1393
- }
1394
- ),
1395
- /* @__PURE__ */ t("div", { className: k.schedulerText, children: [
1396
- /* @__PURE__ */ e("span", { className: k.schedulerTitle, children: a ? "调度方:本机伴生服务" : "调度方:待定(本机伴生服务未运行)" }),
1397
- /* @__PURE__ */ e("span", { className: k.schedulerDesc, children: a ? "桌面端在线,定时任务由本机伴生代理服务调度执行" : "桌面端打开后,定时任务由随桌面端启动的伴生代理服务调度" })
1398
- ] })
1399
- ] }),
1400
- /* @__PURE__ */ e("div", { className: k.demoBadge, children: "示例数据 · 结构预览" }),
1401
- /* @__PURE__ */ t("div", { className: k.sectionHead, children: [
1402
- /* @__PURE__ */ e("span", { className: k.sectionTitle, children: "任务配置" }),
1403
- /* @__PURE__ */ t("span", { className: k.sectionCount, children: [
1404
- Ct.length,
1405
- " 个任务"
1406
- ] })
1407
- ] }),
1408
- /* @__PURE__ */ e("div", { className: k.taskList, children: Ct.map((c) => /* @__PURE__ */ t("div", { className: k.taskRow, children: [
1409
- /* @__PURE__ */ e("span", { className: k.toggle, title: "示例数据,不可操作", children: /* @__PURE__ */ e("i", {}) }),
1410
- /* @__PURE__ */ t("div", { className: k.taskMain, children: [
1411
- /* @__PURE__ */ e("div", { className: k.taskName, children: c.name }),
1412
- /* @__PURE__ */ e("div", { className: k.taskDesc, children: c.desc })
1413
- ] }),
1414
- /* @__PURE__ */ t("div", { className: k.taskMeta, children: [
1415
- /* @__PURE__ */ t("span", { className: k.metaLine, children: [
1416
- /* @__PURE__ */ e(St, {}),
1417
- Zl(c.cron)
1418
- ] }),
1419
- /* @__PURE__ */ t("span", { className: k.metaLine, children: [
1420
- /* @__PURE__ */ e(Ee, {}),
1421
- c.agent
1422
- ] }),
1423
- /* @__PURE__ */ t("span", { className: k.metaNext, children: [
1424
- "下次 ",
1425
- c.next
1426
- ] })
1427
- ] })
1428
- ] }, c.id)) }),
1429
- /* @__PURE__ */ t("div", { className: k.sectionHead, children: [
1430
- /* @__PURE__ */ e("span", { className: k.sectionTitle, children: "定时任务记录" }),
1431
- /* @__PURE__ */ t("span", { className: k.sectionCount, children: [
1432
- "最近 ",
1433
- wt.length,
1434
- " 次执行"
1435
- ] })
1436
- ] }),
1437
- /* @__PURE__ */ e("div", { className: k.recordList, children: wt.map((c) => /* @__PURE__ */ t("div", { className: k.recordRow, children: [
1438
- /* @__PURE__ */ e(
1439
- "span",
1440
- {
1441
- className: `${k.runStatus} ${k[`run_${c.status}`]}`,
1442
- children: eo[c.status]
1443
- }
1444
- ),
1445
- /* @__PURE__ */ t("div", { className: k.recordMain, children: [
1446
- /* @__PURE__ */ e("div", { className: k.recordTask, children: c.task }),
1447
- /* @__PURE__ */ e("div", { className: k.recordSummary, children: c.summary })
1448
- ] }),
1449
- /* @__PURE__ */ t("div", { className: k.recordMeta, children: [
1450
- /* @__PURE__ */ e("span", { children: c.time }),
1451
- /* @__PURE__ */ e("span", { children: c.duration })
1452
- ] })
1453
- ] }, c.id)) }),
1454
- /* @__PURE__ */ e("p", { className: k.footerHint, children: "失败重试与通知策略讨论中——先看形态,细节后续对齐" })
1455
- ] });
1456
- }
1457
- async function no(a) {
1458
- const c = a ? `?token=${encodeURIComponent(a)}` : "", l = await we(
1459
- `${Ie}/personal-agents/custom-models${c}`,
1460
- Te
1461
- );
1462
- return je(l, "获取自定义模型失败");
1463
- }
1464
- async function ao(a, c) {
1465
- const l = a ? `?token=${encodeURIComponent(a)}` : "", h = await we(`${Ie}/personal-agents/custom-models${l}`, {
1466
- ...Te,
1467
- method: "POST",
1468
- headers: { "Content-Type": "application/json" },
1469
- body: JSON.stringify(c)
1470
- });
1471
- return je(h, "创建自定义模型失败");
1472
- }
1473
- async function so(a, c, l) {
1474
- const h = a ? `?token=${encodeURIComponent(a)}` : "", b = await we(
1475
- `${Ie}/personal-agents/custom-models/${c}/toggle${h}`,
1476
- {
1477
- ...Te,
1478
- method: "POST",
1479
- headers: { "Content-Type": "application/json" },
1480
- body: JSON.stringify({ enable: l })
1481
- }
1482
- );
1483
- return je(b, "切换自定义模型失败");
1484
- }
1485
- async function co(a, c) {
1486
- const l = a ? `?token=${encodeURIComponent(a)}` : "", h = await we(
1487
- `${Ie}/personal-agents/custom-models/${c}${l}`,
1488
- { ...Te, method: "DELETE" }
1489
- );
1490
- await je(h, "删除自定义模型失败");
1491
- }
1492
- async function lo(a) {
1493
- const c = a ? `?token=${encodeURIComponent(a)}` : "", l = await we(
1494
- `${Ie}/personal-agents/user-settings${c}`,
1495
- Te
1496
- ), h = await je(l, "获取设置失败");
1497
- try {
1498
- return JSON.parse(h.config || "{}");
1499
- } catch {
1500
- return {};
1501
- }
1502
- }
1503
- async function oo(a, c) {
1504
- const l = a ? `?token=${encodeURIComponent(a)}` : "", h = await we(`${Ie}/personal-agents/user-settings${l}`, {
1505
- ...Te,
1506
- method: "POST",
1507
- headers: { "Content-Type": "application/json" },
1508
- body: JSON.stringify({ config: JSON.stringify(c) })
1509
- });
1510
- await je(h, "保存设置失败");
1511
- }
1512
- const io = "_overlay_5bnt0_1", ro = "_modal_5bnt0_11", mo = "_closeBtn_5bnt0_24", ho = "_menuCol_5bnt0_45", uo = "_searchBox_5bnt0_56", po = "_menuGroup_5bnt0_78", _o = "_menuGroupTitle_5bnt0_84", yo = "_menuItem_5bnt0_91", go = "_menuItemActive_5bnt0_112", bo = "_menuItemDisabled_5bnt0_118", No = "_menuIcon_5bnt0_123", ko = "_menuEmpty_5bnt0_128", vo = "_contentCol_5bnt0_136", fo = "_contentHeader_5bnt0_144", Co = "_contentHeaderRow_5bnt0_151", wo = "_saveStatus_5bnt0_162", To = "_saveStatusError_5bnt0_168", Io = "_contentBody_5bnt0_172", jo = "_section_5bnt0_178", Mo = "_sectionTitle_5bnt0_182", So = "_card_5bnt0_189", xo = "_row_5bnt0_196", $o = "_rowMain_5bnt0_208", Ao = "_rowTitle_5bnt0_212", Do = "_rowDesc_5bnt0_218", Bo = "_selectBox_5bnt0_225", Oo = "_disabled_5bnt0_258", Lo = "_placeholderHost_5bnt0_264", Ro = "_placeholderIcon_5bnt0_274", Ho = "_placeholderTitle_5bnt0_279", Eo = "_placeholderDesc_5bnt0_284", Go = "_fieldInput_5bnt0_289", Po = "_formGrid_5bnt0_304", Fo = "_formActions_5bnt0_310", zo = "_primaryBtn_5bnt0_314", Wo = "_ghostBtn_5bnt0_328", Ko = "_switchBtn_5bnt0_343", qo = "_switchOn_5bnt0_367", Uo = "_mono_5bnt0_373", Vo = "_hint_5bnt0_378", Jo = "_errorTip_5bnt0_384", Qo = "_emptyTip_5bnt0_389", Yo = "_selectWrap_5bnt0_396", Xo = "_inputCell_5bnt0_431", Zo = "_sectionHeadRow_5bnt0_436", ei = "_formHint_5bnt0_452", ti = "_successTip_5bnt0_458", ni = "_enablePill_5bnt0_464", ai = "_enableOn_5bnt0_476", o = {
1513
- overlay: io,
1514
- modal: ro,
1515
- closeBtn: mo,
1516
- menuCol: ho,
1517
- searchBox: uo,
1518
- menuGroup: po,
1519
- menuGroupTitle: _o,
1520
- menuItem: yo,
1521
- menuItemActive: go,
1522
- menuItemDisabled: bo,
1523
- menuIcon: No,
1524
- menuEmpty: ko,
1525
- contentCol: vo,
1526
- contentHeader: fo,
1527
- contentHeaderRow: Co,
1528
- saveStatus: wo,
1529
- saveStatusError: To,
1530
- contentBody: Io,
1531
- section: jo,
1532
- sectionTitle: Mo,
1533
- card: So,
1534
- row: xo,
1535
- rowMain: $o,
1536
- rowTitle: Ao,
1537
- rowDesc: Do,
1538
- selectBox: Bo,
1539
- disabled: Oo,
1540
- placeholderHost: Lo,
1541
- placeholderIcon: Ro,
1542
- placeholderTitle: Ho,
1543
- placeholderDesc: Eo,
1544
- fieldInput: Go,
1545
- formGrid: Po,
1546
- formActions: Fo,
1547
- primaryBtn: zo,
1548
- ghostBtn: Wo,
1549
- switchBtn: Ko,
1550
- switchOn: qo,
1551
- mono: Uo,
1552
- hint: Vo,
1553
- errorTip: Jo,
1554
- emptyTip: Qo,
1555
- selectWrap: Yo,
1556
- inputCell: Xo,
1557
- sectionHeadRow: Zo,
1558
- formHint: ei,
1559
- successTip: ti,
1560
- enablePill: ni,
1561
- enableOn: ai
1562
- }, Ke = [
1563
- {
1564
- title: "设置",
1565
- items: [
1566
- { key: "general", label: "通用", icon: /* @__PURE__ */ e(ze, {}) },
1567
- { key: "profile", label: "个人主页", icon: /* @__PURE__ */ e(Mt, {}) },
1568
- {
1569
- key: "plan",
1570
- label: "套餐与积分",
1571
- icon: /* @__PURE__ */ e(gt, {}),
1572
- disabled: !0
1573
- },
1574
- { key: "appearance", label: "外观", icon: /* @__PURE__ */ e(Dt, {}) },
1575
- { key: "shortcuts", label: "快捷键", icon: /* @__PURE__ */ e(Bt, {}) }
1576
- ]
1577
- },
1578
- {
1579
- title: "功能",
1580
- items: [
1581
- { key: "personalize", label: "个性化", icon: /* @__PURE__ */ e(In, {}) },
1582
- { key: "memory", label: "记忆与进化", icon: /* @__PURE__ */ e(wn, {}) },
1583
- { key: "agents", label: "智能体", icon: /* @__PURE__ */ e(Ee, {}) },
1584
- { key: "models", label: "模型", icon: /* @__PURE__ */ e(Rn, {}) },
1585
- { key: "assistant", label: "助理", icon: /* @__PURE__ */ e(Ln, {}) },
1586
- { key: "devices", label: "设备连接", icon: /* @__PURE__ */ e(At, {}) }
1587
- ]
1588
- },
1589
- {
1590
- title: "数据与安全",
1591
- items: [
1592
- { key: "data", label: "数据管理", icon: /* @__PURE__ */ e(gt, {}) },
1593
- {
1594
- key: "apps",
1595
- label: "应用管理",
1596
- icon: /* @__PURE__ */ e(nt, {}),
1597
- disabled: !0
1598
- },
1599
- { key: "security", label: "安全中心", icon: /* @__PURE__ */ e(Pn, {}) }
1600
- ]
1601
- },
1602
- {
1603
- title: "",
1604
- items: [
1605
- { key: "about", label: "关于", icon: /* @__PURE__ */ e(Fn, {}), disabled: !0 },
1606
- {
1607
- key: "feedback",
1608
- label: "获取帮助",
1609
- icon: /* @__PURE__ */ e(xt, {}),
1610
- disabled: !0
1611
- }
1612
- ]
1613
- }
1614
- ];
1615
- function ge(a, c, l, h = "") {
1616
- var _;
1617
- const b = (_ = a[c]) == null ? void 0 : _[l];
1618
- return typeof b == "string" ? b : h;
1619
- }
1620
- function he(a, c, l, h = !1) {
1621
- var _;
1622
- const b = (_ = a[c]) == null ? void 0 : _[l];
1623
- return typeof b == "boolean" ? b : h;
1624
- }
1625
- function re({
1626
- checked: a,
1627
- onChange: c,
1628
- title: l
1629
- }) {
1630
- return /* @__PURE__ */ e(
1631
- "button",
1632
- {
1633
- type: "button",
1634
- title: l,
1635
- className: `${o.switchBtn} ${a ? o.switchOn : ""}`,
1636
- "aria-pressed": a,
1637
- onClick: () => c(!a)
1638
- }
1639
- );
1640
- }
1641
- function xe({
1642
- value: a,
1643
- options: c,
1644
- onChange: l
1645
- }) {
1646
- return /* @__PURE__ */ e("span", { className: o.selectWrap, children: /* @__PURE__ */ e("select", { value: a, onChange: (h) => l(h.target.value), children: c.map((h) => /* @__PURE__ */ e("option", { value: h.value, children: h.label }, h.value)) }) });
1647
- }
1648
- function E({
1649
- title: a,
1650
- desc: c,
1651
- children: l
1652
- }) {
1653
- return /* @__PURE__ */ t("div", { className: o.row, children: [
1654
- /* @__PURE__ */ t("div", { className: o.rowMain, children: [
1655
- /* @__PURE__ */ e("div", { className: o.rowTitle, children: a }),
1656
- c && /* @__PURE__ */ e("div", { className: o.rowDesc, children: c })
1657
- ] }),
1658
- l
1659
- ] });
1660
- }
1661
- function si({
1662
- config: a,
1663
- update: c
1664
- }) {
1665
- return /* @__PURE__ */ t(ie, { children: [
1666
- /* @__PURE__ */ t("section", { className: o.section, children: [
1667
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "常规" }),
1668
- /* @__PURE__ */ t("div", { className: o.card, children: [
1669
- /* @__PURE__ */ e(E, { title: "语言", desc: "界面与回复语言。", children: /* @__PURE__ */ e(
1670
- xe,
1671
- {
1672
- value: ge(a, "general", "language", "zh-CN"),
1673
- options: [
1674
- { value: "zh-CN", label: "简体中文" },
1675
- { value: "en-US", label: "English" }
1676
- ],
1677
- onChange: (l) => c("general", { language: l })
1678
- }
1679
- ) }),
1680
- /* @__PURE__ */ e(E, { title: "字体大小", desc: "调节对话与界面文字大小。", children: /* @__PURE__ */ e(
1681
- xe,
1682
- {
1683
- value: ge(a, "general", "fontSize", "medium"),
1684
- options: [
1685
- { value: "small", label: "小" },
1686
- { value: "medium", label: "标准" },
1687
- { value: "large", label: "大" }
1688
- ],
1689
- onChange: (l) => c("general", { fontSize: l })
1690
- }
1691
- ) })
1692
- ] })
1693
- ] }),
1694
- /* @__PURE__ */ t("section", { className: o.section, children: [
1695
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "存储" }),
1696
- /* @__PURE__ */ e("div", { className: o.card, children: /* @__PURE__ */ e(E, { title: "本地会话缓存", desc: "缓存会话记录以加速历史加载。", children: /* @__PURE__ */ e(
1697
- re,
1698
- {
1699
- checked: he(a, "general", "chatCache", !0),
1700
- onChange: (l) => c("general", { chatCache: l })
1701
- }
1702
- ) }) })
1703
- ] })
1704
- ] });
1705
- }
1706
- function ci({
1707
- config: a,
1708
- update: c
1709
- }) {
1710
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1711
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "个人主页" }),
1712
- /* @__PURE__ */ e("p", { className: o.hint, children: "这里配置你在个人主页与伙伴对话中展示的信息,保存后生效时机以后续版本为准。" }),
1713
- /* @__PURE__ */ t("div", { className: o.card, children: [
1714
- /* @__PURE__ */ e(E, { title: "昵称", children: /* @__PURE__ */ e("div", { className: o.inputCell, children: /* @__PURE__ */ e(
1715
- "input",
1716
- {
1717
- className: o.fieldInput,
1718
- placeholder: "怎么称呼你",
1719
- value: ge(a, "profile", "nickname"),
1720
- onChange: (l) => c("profile", { nickname: l.target.value })
1721
- }
1722
- ) }) }),
1723
- /* @__PURE__ */ e(E, { title: "个性签名", desc: "会展示在个人主页。", children: /* @__PURE__ */ e("div", { className: o.inputCell, children: /* @__PURE__ */ e(
1724
- "input",
1725
- {
1726
- className: o.fieldInput,
1727
- placeholder: "一句话介绍自己",
1728
- value: ge(a, "profile", "bio"),
1729
- onChange: (l) => c("profile", { bio: l.target.value })
1730
- }
1731
- ) }) })
1732
- ] })
1733
- ] });
1734
- }
1735
- function li({
1736
- config: a,
1737
- update: c
1738
- }) {
1739
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1740
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "外观" }),
1741
- /* @__PURE__ */ t("div", { className: o.card, children: [
1742
- /* @__PURE__ */ e(E, { title: "主题", desc: "深浅色主题(生效时机后续接入)。", children: /* @__PURE__ */ e(
1743
- xe,
1744
- {
1745
- value: ge(a, "appearance", "theme", "light"),
1746
- options: [
1747
- { value: "light", label: "浅色" },
1748
- { value: "dark", label: "深色" },
1749
- { value: "system", label: "跟随系统" }
1750
- ],
1751
- onChange: (l) => c("appearance", { theme: l })
1752
- }
1753
- ) }),
1754
- /* @__PURE__ */ e(E, { title: "紧凑消息密度", desc: "聊天消息行距更紧凑。", children: /* @__PURE__ */ e(
1755
- re,
1756
- {
1757
- checked: he(a, "appearance", "compact"),
1758
- onChange: (l) => c("appearance", { compact: l })
1759
- }
1760
- ) })
1761
- ] })
1762
- ] });
1763
- }
1764
- function oi({
1765
- config: a,
1766
- update: c
1767
- }) {
1768
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1769
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "快捷键" }),
1770
- /* @__PURE__ */ t("div", { className: o.card, children: [
1771
- /* @__PURE__ */ e(E, { title: "发送消息", desc: "聊天输入框的发送方式。", children: /* @__PURE__ */ e(
1772
- xe,
1773
- {
1774
- value: ge(a, "shortcuts", "sendKey", "enter"),
1775
- options: [
1776
- { value: "enter", label: "Enter 发送" },
1777
- { value: "mod-enter", label: "Cmd/Ctrl + Enter 发送" }
1778
- ],
1779
- onChange: (l) => c("shortcuts", { sendKey: l })
1780
- }
1781
- ) }),
1782
- /* @__PURE__ */ e(E, { title: "新建任务", desc: "固定快捷键,暂不可更改。", children: /* @__PURE__ */ e("span", { className: o.mono, children: "⌘ K" }) })
1783
- ] })
1784
- ] });
1785
- }
1786
- function ii({
1787
- config: a,
1788
- update: c
1789
- }) {
1790
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1791
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "个性化" }),
1792
- /* @__PURE__ */ t("div", { className: o.card, children: [
1793
- /* @__PURE__ */ e(E, { title: "回复风格", desc: "伙伴回复的详略倾向。", children: /* @__PURE__ */ e(
1794
- xe,
1795
- {
1796
- value: ge(a, "personalize", "replyStyle", "balanced"),
1797
- options: [
1798
- { value: "concise", label: "简洁" },
1799
- { value: "balanced", label: "均衡" },
1800
- { value: "detailed", label: "详细" }
1801
- ],
1802
- onChange: (l) => c("personalize", { replyStyle: l })
1803
- }
1804
- ) }),
1805
- /* @__PURE__ */ e(E, { title: "建议追问", desc: "回复结束后给出可点的追问建议。", children: /* @__PURE__ */ e(
1806
- re,
1807
- {
1808
- checked: he(a, "personalize", "suggestReplies", !0),
1809
- onChange: (l) => c("personalize", { suggestReplies: l })
1810
- }
1811
- ) })
1812
- ] })
1813
- ] });
1814
- }
1815
- function ri({
1816
- config: a,
1817
- update: c
1818
- }) {
1819
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1820
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "记忆与进化" }),
1821
- /* @__PURE__ */ t("div", { className: o.card, children: [
1822
- /* @__PURE__ */ e(E, { title: "对话记忆", desc: "允许伙伴记住对话要点,越用越懂你。", children: /* @__PURE__ */ e(
1823
- re,
1824
- {
1825
- checked: he(a, "memory", "enabled", !0),
1826
- onChange: (l) => c("memory", { enabled: l })
1827
- }
1828
- ) }),
1829
- /* @__PURE__ */ e(E, { title: "记忆范围", desc: "记忆生效的会话范围。", children: /* @__PURE__ */ e(
1830
- xe,
1831
- {
1832
- value: ge(a, "memory", "scope", "all"),
1833
- options: [
1834
- { value: "all", label: "全部会话" },
1835
- { value: "current", label: "仅当前会话" }
1836
- ],
1837
- onChange: (l) => c("memory", { scope: l })
1838
- }
1839
- ) })
1840
- ] })
1841
- ] });
1842
- }
1843
- function di({
1844
- config: a,
1845
- update: c
1846
- }) {
1847
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1848
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "智能体" }),
1849
- /* @__PURE__ */ t("div", { className: o.card, children: [
1850
- /* @__PURE__ */ e(E, { title: "会话自动小结", desc: "会话结束时自动生成轮次小结。", children: /* @__PURE__ */ e(
1851
- re,
1852
- {
1853
- checked: he(a, "agents", "autoSummary", !0),
1854
- onChange: (l) => c("agents", { autoSummary: l })
1855
- }
1856
- ) }),
1857
- /* @__PURE__ */ e(E, { title: "开场问候", desc: "新任务页显示伙伴问候语。", children: /* @__PURE__ */ e(
1858
- re,
1859
- {
1860
- checked: he(a, "agents", "greeting", !0),
1861
- onChange: (l) => c("agents", { greeting: l })
1862
- }
1863
- ) })
1864
- ] })
1865
- ] });
1866
- }
1867
- function mi({
1868
- config: a,
1869
- update: c
1870
- }) {
1871
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1872
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "助理" }),
1873
- /* @__PURE__ */ t("div", { className: o.card, children: [
1874
- /* @__PURE__ */ e(E, { title: "任务到期提醒", desc: "定时任务到期时提醒你。", children: /* @__PURE__ */ e(
1875
- re,
1876
- {
1877
- checked: he(a, "assistant", "reminders", !0),
1878
- onChange: (l) => c("assistant", { reminders: l })
1879
- }
1880
- ) }),
1881
- /* @__PURE__ */ e(E, { title: "每日工作摘要", desc: "每天汇总你的任务进展。", children: /* @__PURE__ */ e(
1882
- re,
1883
- {
1884
- checked: he(a, "assistant", "dailyDigest"),
1885
- onChange: (l) => c("assistant", { dailyDigest: l })
1886
- }
1887
- ) })
1888
- ] })
1889
- ] });
1890
- }
1891
- function hi({
1892
- config: a,
1893
- update: c
1894
- }) {
1895
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1896
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "设备连接" }),
1897
- /* @__PURE__ */ t("div", { className: o.card, children: [
1898
- /* @__PURE__ */ e(E, { title: "当前设备", desc: "当前登录使用的端。", children: /* @__PURE__ */ e("span", { className: o.mono, children: "Web 浏览器" }) }),
1899
- /* @__PURE__ */ e(E, { title: "桌面端系统通知", desc: "客户端收到回复时系统通知。", children: /* @__PURE__ */ e(
1900
- re,
1901
- {
1902
- checked: he(a, "devices", "desktopNotify", !0),
1903
- onChange: (l) => c("devices", { desktopNotify: l })
1904
- }
1905
- ) })
1906
- ] })
1907
- ] });
1908
- }
1909
- function ui({
1910
- config: a,
1911
- update: c
1912
- }) {
1913
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1914
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "安全中心" }),
1915
- /* @__PURE__ */ t("div", { className: o.card, children: [
1916
- /* @__PURE__ */ e(E, { title: "登录提醒", desc: "新设备登录时通知你。", children: /* @__PURE__ */ e(
1917
- re,
1918
- {
1919
- checked: he(a, "security", "loginNotify", !0),
1920
- onChange: (l) => c("security", { loginNotify: l })
1921
- }
1922
- ) }),
1923
- /* @__PURE__ */ t("div", { className: o.row, children: [
1924
- /* @__PURE__ */ t("div", { className: o.rowMain, children: [
1925
- /* @__PURE__ */ e("div", { className: o.rowTitle, children: "双重验证" }),
1926
- /* @__PURE__ */ e("div", { className: o.rowDesc, children: "即将支持。" })
1927
- ] }),
1928
- /* @__PURE__ */ e("span", { className: `${o.selectBox} ${o.disabled}`, children: "未开启" })
1929
- ] })
1930
- ] })
1931
- ] });
1932
- }
1933
- function pi({
1934
- config: a,
1935
- update: c
1936
- }) {
1937
- return /* @__PURE__ */ t("section", { className: o.section, children: [
1938
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "数据管理" }),
1939
- /* @__PURE__ */ t("div", { className: o.card, children: [
1940
- /* @__PURE__ */ e(E, { title: "会话保留时长", desc: "超过时限的会话自动归档。", children: /* @__PURE__ */ e(
1941
- xe,
1942
- {
1943
- value: ge(a, "data", "retention", "180d"),
1944
- options: [
1945
- { value: "90d", label: "保留 90 天" },
1946
- { value: "180d", label: "保留 180 天" },
1947
- { value: "forever", label: "永久保留" }
1948
- ],
1949
- onChange: (l) => c("data", { retention: l })
1950
- }
1951
- ) }),
1952
- /* @__PURE__ */ e(E, { title: "导出聊天记录", desc: "即将支持。", children: /* @__PURE__ */ e("button", { type: "button", className: o.ghostBtn, disabled: !0, children: "导出" }) })
1953
- ] })
1954
- ] });
1955
- }
1956
- const Je = {
1957
- name: "",
1958
- endpoint: "",
1959
- apiKey: "",
1960
- modelName: ""
1961
- };
1962
- function _i({ token: a }) {
1963
- const [c, l] = m([]), [h, b] = m(!0), [_, $] = m(Je), [p, A] = m(!1), [F, w] = m(!1), [T, N] = m(""), [W, L] = m(""), U = X(async () => {
1964
- b(!0);
1965
- try {
1966
- const y = await no(a);
1967
- l(y || []), N("");
1968
- } catch (y) {
1969
- N(y instanceof Error ? y.message : String(y));
1970
- } finally {
1971
- b(!1);
1972
- }
1973
- }, [a]);
1974
- V(() => {
1975
- U();
1976
- }, [U]);
1977
- const G = /^https?:\/\/.+/i.test(_.endpoint.trim()), J = !F && _.name.trim() !== "" && G && _.apiKey.trim() !== "" && _.modelName.trim() !== "", K = async () => {
1978
- if (J) {
1979
- w(!0);
1980
- try {
1981
- await ao(a, {
1982
- name: _.name.trim(),
1983
- endpoint: _.endpoint.trim(),
1984
- apiKey: _.apiKey.trim(),
1985
- modelName: _.modelName.trim()
1986
- }), $(Je), A(!1), L("模型已添加,输入区模型菜单即可选用"), window.setTimeout(() => L(""), 3e3), await U();
1987
- } catch (y) {
1988
- N(y instanceof Error ? y.message : String(y));
1989
- } finally {
1990
- w(!1);
1991
- }
1992
- }
1993
- }, Z = async (y) => {
1994
- try {
1995
- await so(a, y.id, !y.enable), await U();
1996
- } catch (q) {
1997
- N(q instanceof Error ? q.message : String(q));
1998
- }
1999
- }, R = async (y) => {
2000
- if (window.confirm(`确定删除自定义模型「${y.name}」吗?`))
2001
- try {
2002
- await co(a, y.id), await U();
2003
- } catch (q) {
2004
- N(q instanceof Error ? q.message : String(q));
2005
- }
2006
- };
2007
- return /* @__PURE__ */ t(ie, { children: [
2008
- /* @__PURE__ */ t("section", { className: o.section, children: [
2009
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "自定义模型" }),
2010
- /* @__PURE__ */ e("p", { className: o.hint, children: "配置指向 OpenAI 兼容端点的模型供聊天直接选用,例如自研 LLM Gateway(端点形如 http://host:9099/v1,密钥填网关签发的 AK)。 配置后输入区右侧模型菜单会出现「自定义模型」分组。" }),
2011
- T && /* @__PURE__ */ e("p", { className: o.errorTip, children: T }),
2012
- W && /* @__PURE__ */ e("p", { className: o.successTip, children: W }),
2013
- /* @__PURE__ */ e("div", { className: o.card, children: h ? /* @__PURE__ */ e("div", { className: o.emptyTip, children: "加载中…" }) : c.length === 0 ? /* @__PURE__ */ t("div", { className: o.emptyTip, children: [
2014
- "还没有自定义模型",
2015
- p ? ",填写下方表单添加。" : ",点右上角「添加模型」。"
2016
- ] }) : c.map((y) => /* @__PURE__ */ t("div", { className: o.row, children: [
2017
- /* @__PURE__ */ t("div", { className: o.rowMain, children: [
2018
- /* @__PURE__ */ t("div", { className: o.rowTitle, children: [
2019
- y.name,
2020
- /* @__PURE__ */ e(
2021
- "span",
2022
- {
2023
- className: `${o.enablePill} ${y.enable ? o.enableOn : ""}`,
2024
- children: y.enable ? "已启用" : "已停用"
2025
- }
2026
- )
2027
- ] }),
2028
- /* @__PURE__ */ t("div", { className: `${o.rowDesc} ${o.mono}`, children: [
2029
- y.modelName,
2030
- " · ",
2031
- y.endpoint,
2032
- " · ",
2033
- y.apiKeyMasked
2034
- ] })
2035
- ] }),
2036
- /* @__PURE__ */ e(
2037
- re,
2038
- {
2039
- checked: y.enable,
2040
- title: y.enable ? "停用" : "启用",
2041
- onChange: () => void Z(y)
2042
- }
2043
- ),
2044
- /* @__PURE__ */ e(
2045
- "button",
2046
- {
2047
- type: "button",
2048
- className: o.ghostBtn,
2049
- onClick: () => void R(y),
2050
- children: "删除"
2051
- }
2052
- )
2053
- ] }, y.id)) })
2054
- ] }),
2055
- /* @__PURE__ */ t("section", { className: o.section, children: [
2056
- /* @__PURE__ */ t("div", { className: o.sectionHeadRow, children: [
2057
- /* @__PURE__ */ e("h3", { className: o.sectionTitle, children: "添加模型" }),
2058
- !p && /* @__PURE__ */ e(
2059
- "button",
2060
- {
2061
- type: "button",
2062
- className: o.primaryBtn,
2063
- onClick: () => A(!0),
2064
- children: "添加模型"
2065
- }
2066
- )
2067
- ] }),
2068
- p && /* @__PURE__ */ t("div", { className: o.card, children: [
2069
- /* @__PURE__ */ t("div", { className: o.formGrid, children: [
2070
- /* @__PURE__ */ e(
2071
- "input",
2072
- {
2073
- className: o.fieldInput,
2074
- placeholder: "显示名,如 My Gateway 模型",
2075
- value: _.name,
2076
- onChange: (y) => $({ ..._, name: y.target.value })
2077
- }
2078
- ),
2079
- /* @__PURE__ */ e(
2080
- "input",
2081
- {
2082
- className: o.fieldInput,
2083
- placeholder: "模型名,如 qwen3.6-flash",
2084
- value: _.modelName,
2085
- onChange: (y) => $({ ..._, modelName: y.target.value })
2086
- }
2087
- )
2088
- ] }),
2089
- /* @__PURE__ */ t("div", { className: o.formGrid, children: [
2090
- /* @__PURE__ */ t("div", { children: [
2091
- /* @__PURE__ */ e(
2092
- "input",
2093
- {
2094
- className: o.fieldInput,
2095
- placeholder: "Endpoint(OpenAI 兼容 base url)",
2096
- value: _.endpoint,
2097
- onChange: (y) => $({ ..._, endpoint: y.target.value })
2098
- }
2099
- ),
2100
- _.endpoint.trim() !== "" && !G && /* @__PURE__ */ e("div", { className: o.formHint, children: "端点需以 http:// 或 https:// 开头" })
2101
- ] }),
2102
- /* @__PURE__ */ e(
2103
- "input",
2104
- {
2105
- className: o.fieldInput,
2106
- type: "password",
2107
- placeholder: "API Key",
2108
- value: _.apiKey,
2109
- onChange: (y) => $({ ..._, apiKey: y.target.value })
2110
- }
2111
- )
2112
- ] }),
2113
- /* @__PURE__ */ t("div", { className: o.formActions, children: [
2114
- /* @__PURE__ */ e(
2115
- "button",
2116
- {
2117
- type: "button",
2118
- className: o.ghostBtn,
2119
- onClick: () => {
2120
- A(!1), $(Je);
2121
- },
2122
- children: "取消"
2123
- }
2124
- ),
2125
- /* @__PURE__ */ e(
2126
- "button",
2127
- {
2128
- type: "button",
2129
- className: o.primaryBtn,
2130
- disabled: !J,
2131
- onClick: () => void K(),
2132
- children: F ? "保存中…" : "保存"
2133
- }
2134
- )
2135
- ] })
2136
- ] })
2137
- ] })
2138
- ] });
2139
- }
2140
- function yi({ label: a }) {
2141
- return /* @__PURE__ */ t("div", { className: o.placeholderHost, children: [
2142
- /* @__PURE__ */ e("span", { className: o.placeholderIcon, children: /* @__PURE__ */ e(ze, {}) }),
2143
- /* @__PURE__ */ e("span", { className: o.placeholderTitle, children: a }),
2144
- /* @__PURE__ */ e("span", { className: o.placeholderDesc, children: "该设置项即将上线" })
2145
- ] });
2146
- }
2147
- function gi({
2148
- open: a,
2149
- onClose: c,
2150
- token: l
2151
- }) {
2152
- const [h, b] = m("general"), [_, $] = m(""), [p, A] = m({}), [F, w] = m(!1), [T, N] = m(!1), [W, L] = m("idle"), U = Fe({}), G = Fe(null);
2153
- U.current = p;
2154
- const J = se(() => {
2155
- const j = _.trim().toLowerCase();
2156
- return j ? Ke.map((M) => ({
2157
- ...M,
2158
- items: M.items.filter((d) => d.label.toLowerCase().includes(j))
2159
- })).filter((M) => M.items.length > 0) : Ke;
2160
- }, [_]), K = se(() => {
2161
- for (const j of Ke) {
2162
- const M = j.items.find((d) => d.key === h);
2163
- if (M) return M;
2164
- }
2165
- return Ke[0].items[0];
2166
- }, [h]);
2167
- V(() => {
2168
- if (!a) return;
2169
- let j = !0;
2170
- return w(!1), N(!1), lo(l).then((M) => {
2171
- j && (A(M || {}), w(!0));
2172
- }).catch(() => {
2173
- j && N(!0);
2174
- }), () => {
2175
- j = !1;
2176
- };
2177
- }, [a, l]);
2178
- const Z = X(async () => {
2179
- G.current != null && (window.clearTimeout(G.current), G.current = null), L("saving");
2180
- try {
2181
- await oo(l, U.current), L("saved");
2182
- } catch {
2183
- L("error");
2184
- }
2185
- }, [l]), R = X(
2186
- (j, M) => {
2187
- A((d) => ({
2188
- ...d,
2189
- [j]: { ...d[j] ?? {}, ...M }
2190
- })), L("saving"), G.current != null && window.clearTimeout(G.current), G.current = window.setTimeout(() => void Z(), 600);
2191
- },
2192
- [Z]
2193
- ), y = X(() => {
2194
- G.current != null && Z(), c();
2195
- }, [Z, c]);
2196
- if (V(
2197
- () => () => {
2198
- G.current != null && window.clearTimeout(G.current);
2199
- },
2200
- []
2201
- ), !a) return null;
2202
- const q = () => {
2203
- if (!F)
2204
- return T ? /* @__PURE__ */ e("div", { className: o.emptyTip, children: "设置加载失败,请关闭后重试。" }) : /* @__PURE__ */ e("div", { className: o.emptyTip, children: "加载中…" });
2205
- switch (K.key) {
2206
- case "general":
2207
- return /* @__PURE__ */ e(si, { config: p, update: R });
2208
- case "profile":
2209
- return /* @__PURE__ */ e(ci, { config: p, update: R });
2210
- case "appearance":
2211
- return /* @__PURE__ */ e(li, { config: p, update: R });
2212
- case "shortcuts":
2213
- return /* @__PURE__ */ e(oi, { config: p, update: R });
2214
- case "personalize":
2215
- return /* @__PURE__ */ e(ii, { config: p, update: R });
2216
- case "memory":
2217
- return /* @__PURE__ */ e(ri, { config: p, update: R });
2218
- case "agents":
2219
- return /* @__PURE__ */ e(di, { config: p, update: R });
2220
- case "assistant":
2221
- return /* @__PURE__ */ e(mi, { config: p, update: R });
2222
- case "devices":
2223
- return /* @__PURE__ */ e(hi, { config: p, update: R });
2224
- case "security":
2225
- return /* @__PURE__ */ e(ui, { config: p, update: R });
2226
- case "data":
2227
- return /* @__PURE__ */ e(pi, { config: p, update: R });
2228
- case "models":
2229
- return /* @__PURE__ */ e(_i, { token: l });
2230
- default:
2231
- return /* @__PURE__ */ e(yi, { label: K.label });
2232
- }
2233
- };
2234
- return /* @__PURE__ */ e("div", { className: o.overlay, onClick: y, children: /* @__PURE__ */ t(
2235
- "div",
2236
- {
2237
- className: o.modal,
2238
- role: "dialog",
2239
- "aria-label": "设置",
2240
- onClick: (j) => j.stopPropagation(),
2241
- children: [
2242
- /* @__PURE__ */ t("aside", { className: o.menuCol, children: [
2243
- /* @__PURE__ */ t("div", { className: o.searchBox, children: [
2244
- /* @__PURE__ */ e(et, {}),
2245
- /* @__PURE__ */ e(
2246
- "input",
2247
- {
2248
- value: _,
2249
- onChange: (j) => $(j.target.value),
2250
- placeholder: "搜索设置项"
2251
- }
2252
- )
2253
- ] }),
2254
- J.map((j) => /* @__PURE__ */ t("div", { className: o.menuGroup, children: [
2255
- j.title && /* @__PURE__ */ e("div", { className: o.menuGroupTitle, children: j.title }),
2256
- j.items.map((M) => /* @__PURE__ */ t(
2257
- "button",
2258
- {
2259
- type: "button",
2260
- className: `${o.menuItem} ${M.key === h ? o.menuItemActive : ""} ${M.disabled ? o.menuItemDisabled : ""}`,
2261
- onClick: () => b(M.key),
2262
- children: [
2263
- /* @__PURE__ */ e("span", { className: o.menuIcon, children: M.icon }),
2264
- /* @__PURE__ */ e("span", { children: M.label })
2265
- ]
2266
- },
2267
- M.key
2268
- ))
2269
- ] }, j.title || "misc")),
2270
- J.length === 0 && /* @__PURE__ */ e("div", { className: o.menuEmpty, children: "无匹配设置项" })
2271
- ] }),
2272
- /* @__PURE__ */ t("main", { className: o.contentCol, children: [
2273
- /* @__PURE__ */ t("div", { className: o.contentHeaderRow, children: [
2274
- /* @__PURE__ */ e("span", { className: o.contentHeader, children: K.label }),
2275
- F && !T && K.key !== "models" && /* @__PURE__ */ t(
2276
- "span",
2277
- {
2278
- className: `${o.saveStatus} ${W === "error" ? o.saveStatusError : ""}`,
2279
- children: [
2280
- W === "saving" && "保存中…",
2281
- W === "saved" && "已保存",
2282
- W === "error" && "保存失败,改动会在下次修改时重试"
2283
- ]
2284
- }
2285
- )
2286
- ] }),
2287
- /* @__PURE__ */ e("div", { className: o.contentBody, children: q() })
2288
- ] }),
2289
- /* @__PURE__ */ e(
2290
- "button",
2291
- {
2292
- type: "button",
2293
- className: o.closeBtn,
2294
- onClick: y,
2295
- "aria-label": "关闭设置",
2296
- children: "×"
2297
- }
2298
- )
2299
- ]
2300
- }
2301
- ) });
2302
- }
2303
- const Y = hn() || typeof localStorage < "u" && localStorage.getItem("ft_exclusive_force_desktop") === "1", bi = [
2304
- "帮我排查一个线上问题",
2305
- "总结一下今天的群聊进展",
2306
- "把这周的变更整理成周报"
2307
- ], Ni = [
2308
- { label: "插件", icon: /* @__PURE__ */ e(On, {}) },
2309
- { label: "技能", icon: /* @__PURE__ */ e(An, {}) },
2310
- { label: "连接器", icon: /* @__PURE__ */ e($n, {}) }
2311
- ], ki = [
2312
- { label: "页面", icon: /* @__PURE__ */ e(En, {}), title: "实验位:页面发布后续接入" },
2313
- { label: "云盘", icon: /* @__PURE__ */ e(Gn, {}), title: "实验位:云盘后续接入" },
2314
- {
2315
- label: "IM 频道",
2316
- icon: /* @__PURE__ */ e(At, {}),
2317
- title: "实验位:IM 频道后续接入"
2318
- }
2319
- ], vi = [
2320
- { tab: "projects", label: "工作单管理", icon: /* @__PURE__ */ e(Se, {}) },
2321
- { tab: "personal", label: "个人统计", icon: /* @__PURE__ */ e(Vt, {}) },
2322
- { tab: "business-stats", label: "业务指标", icon: /* @__PURE__ */ e(Jt, {}) },
2323
- { tab: "tools", label: "常用工具", icon: /* @__PURE__ */ e(Tn, {}) },
2324
- { tab: "websites", label: "常用网站", icon: /* @__PURE__ */ e(Bn, {}) },
2325
- { tab: "todo", label: "工作待办", icon: /* @__PURE__ */ e(Qt, {}) },
2326
- { tab: "notes", label: "个人笔记", icon: /* @__PURE__ */ e(Yt, {}) },
2327
- { tab: "training", label: "培训中心", icon: /* @__PURE__ */ e(Xt, {}) },
2328
- { tab: "webide", label: "WebIDE", icon: /* @__PURE__ */ e(Zt, {}) }
2329
- ];
2330
- function fi() {
2331
- const a = (/* @__PURE__ */ new Date()).getHours();
2332
- return a < 5 ? "夜深了" : a < 12 ? "早上好" : a < 14 ? "中午好" : a < 18 ? "下午好" : "晚上好";
2333
- }
2334
- function Qe(a) {
2335
- return a ? a.charAt(0).toUpperCase() : "?";
2336
- }
2337
- const Tt = ["#2F70F1", "#52c41a", "#fa8c16", "#722ed1", "#13c2c2"];
2338
- function Ye(a) {
2339
- let c = 0;
2340
- for (let l = 0; l < a.length; l++) c = c * 31 + a.charCodeAt(l) | 0;
2341
- return Tt[Math.abs(c) % Tt.length];
2342
- }
2343
- function Ci(a) {
2344
- return a.type === "jar" ? {
2345
- id: "-1",
2346
- userId: "local",
2347
- agentHubAgentId: null,
2348
- agentCode: "local-default",
2349
- displayName: a.name || "本地 Agent",
2350
- avatar: null,
2351
- isLocal: !0
2352
- } : {
2353
- id: "-1",
2354
- userId: "local",
2355
- agentHubAgentId: null,
2356
- agentCode: a.name,
2357
- displayName: a.name,
2358
- avatar: null,
2359
- isLocal: !0,
2360
- localAgentId: a.id,
2361
- localAgentType: a.type
2362
- };
2363
- }
2364
- function Bi({
2365
- onSwitchMode: a,
2366
- onOpenProject: c
2367
- }) {
2368
- const l = ut((n) => n.token), h = ut((n) => n.currentUser), [b, _] = m([]), [$, p] = m(!0), [A, F] = m(null), [w, T] = m("landing"), [N, W] = m(null), [L, U] = m(
2369
- Y ? "local" : "cloud"
2370
- ), [G, J] = m(
2371
- []
2372
- ), [K, Z] = m([]), [R, y] = m(!0), [q, j] = m([]), [M, d] = m(null), [g, D] = m(
2373
- /* @__PURE__ */ new Set()
2374
- ), [H, z] = m(0), [ce, ue] = m(null), [le, be] = m(!1), [S, Ne] = m([]), [P, ee] = m(null), [de, oe] = m(""), [$e, Ae] = m(!1), [De, ke] = m(!1), [ne, Be] = m(null), [Ue, Oe] = m(!1), [Ve, Le] = m(!1), [Me, pe] = m(null), Ge = Fe(null), r = Fe(null);
2375
- V(() => {
2376
- if (!Me) return;
2377
- const n = (v) => {
2378
- var ae, O;
2379
- const I = v.target;
2380
- (ae = Ge.current) != null && ae.contains(I) || (O = r.current) != null && O.contains(I) || pe(null);
2381
- }, u = (v) => {
2382
- v.key === "Escape" && pe(null);
2383
- };
2384
- return document.addEventListener("mousedown", n), document.addEventListener("keydown", u), () => {
2385
- document.removeEventListener("mousedown", n), document.removeEventListener("keydown", u);
2386
- };
2387
- }, [Me]);
2388
- const B = X(
2389
- (n) => {
2390
- lt(n), T("personalTab");
2391
- },
2392
- []
2393
- ), [x, ve] = m(!1), [We, at] = m(!1), [st, ct] = m(
2394
- null
2395
- ), [Ot, Lt] = m(
2396
- null
2397
- ), Pe = X(
2398
- (n, u) => {
2399
- c == null || c(n, u);
2400
- },
2401
- [c]
2402
- ), [_e, lt] = m("personal"), ot = Fe(!1), fe = se(
2403
- () => b.find((n) => n.agentCode === "agent_super_agent") ?? b[0] ?? null,
2404
- [b]
2405
- ), ye = se(
2406
- () => b.find((n) => n.id === A) ?? fe,
2407
- [b, A, fe]
2408
- );
2409
- Y && le && S.length > 0;
2410
- const te = se(
2411
- () => S.find((n) => n.id === P) ?? null,
2412
- [S, P]
2413
- );
2414
- V(() => {
2415
- let n = !0;
2416
- return p(!0), sn(l).then((u) => {
2417
- n && _(u);
2418
- }).catch(() => {
2419
- }).finally(() => {
2420
- n && p(!1);
2421
- }), () => {
2422
- n = !1;
2423
- };
2424
- }, [l]), V(() => {
2425
- if (!Y) return;
2426
- let n = !0;
2427
- const u = async () => {
2428
- const I = await dn();
2429
- if (n) {
2430
- if (be(I), !I) {
2431
- Ne([]);
2432
- return;
2433
- }
2434
- try {
2435
- const ae = await mn();
2436
- n && Ne(ae);
2437
- } catch {
2438
- }
2439
- }
2440
- };
2441
- u();
2442
- const v = window.setInterval(() => void u(), 3e4);
2443
- return () => {
2444
- n = !1, window.clearInterval(v);
2445
- };
2446
- }, []), V(() => {
2447
- if (!Y || S.length === 0 || P && S.some((u) => u.id === P))
2448
- return;
2449
- const n = S.find((u) => u.type === "jar");
2450
- ee((n ?? S[0]).id);
2451
- }, [S, P]);
2452
- const Rt = se(() => {
2453
- const n = /* @__PURE__ */ new Map();
2454
- for (const u of b) n.set(u.id, u);
2455
- return n;
2456
- }, [b]), it = X(async () => {
2457
- y(!0);
2458
- const [n, u] = await Promise.allSettled([
2459
- It(l),
2460
- jt(l)
2461
- ]);
2462
- if (n.status === "fulfilled" && J(n.value || []), u.status === "fulfilled") {
2463
- const v = /* @__PURE__ */ new Set(), I = [];
2464
- for (const ae of [...u.value.owned, ...u.value.joined])
2465
- v.has(ae.id) || (v.add(ae.id), I.push(ae));
2466
- Z(I);
2467
- }
2468
- y(!1);
2469
- }, [l]);
2470
- V(() => {
2471
- it();
2472
- }, [it, N == null ? void 0 : N.ts]);
2473
- const Re = se(() => {
2474
- const n = /* @__PURE__ */ new Map();
2475
- for (const O of K)
2476
- n.set(`sp:${O.id}`, {
2477
- key: `sp:${O.id}`,
2478
- title: O.title,
2479
- sessions: []
2480
- });
2481
- const u = [], v = [...G].sort(
2482
- (O, Q) => (Q.updateTime || Q.createTime || "").localeCompare(
2483
- O.updateTime || O.createTime || ""
2484
- )
2485
- );
2486
- for (const O of v)
2487
- if (O.projectSpaceId != null) {
2488
- const Q = `sp:${O.projectSpaceId}`;
2489
- n.has(Q) || n.set(Q, {
2490
- key: Q,
2491
- title: O.projectSpaceTitle || `空间 ${O.projectSpaceId}`,
2492
- sessions: []
2493
- }), n.get(Q).sessions.push(O);
2494
- } else
2495
- u.push(O);
2496
- const I = (O) => {
2497
- var Q, ht;
2498
- return ((Q = O.sessions[0]) == null ? void 0 : Q.updateTime) || ((ht = O.sessions[0]) == null ? void 0 : ht.createTime) || "";
2499
- }, ae = [...n.values()];
2500
- return ae.sort((O, Q) => O.sessions.length > 0 && Q.sessions.length > 0 ? I(Q).localeCompare(I(O)) : O.sessions.length > 0 ? -1 : Q.sessions.length > 0 ? 1 : O.title.localeCompare(Q.title)), u.length > 0 && ae.push({ key: "sp:none", title: "未归组", sessions: u }), ae;
2501
- }, [K, G]), rt = se(
2502
- () => {
2503
- var n;
2504
- return N != null && N.sessionId ? ((n = Re.find(
2505
- (u) => u.sessions.some((v) => v.id === N.sessionId)
2506
- )) == null ? void 0 : n.key) ?? null : null;
2507
- },
2508
- [Re, N == null ? void 0 : N.sessionId]
2509
- );
2510
- V(() => {
2511
- var u;
2512
- const n = rt ?? (ot.current ? null : ((u = Re.find((v) => v.sessions.length > 0)) == null ? void 0 : u.key) ?? null);
2513
- n && (ot.current = !0, D(
2514
- (v) => v.has(n) ? v : new Set(v).add(n)
2515
- ));
2516
- }, [rt, Re]);
2517
- const dt = te && te.type !== "jar" ? te.id : void 0;
2518
- V(() => {
2519
- if (!Y || L !== "local" || !le) return;
2520
- let n = !0;
2521
- return rn(dt).then((u) => {
2522
- n && j([...u].sort((v, I) => I.updatedAt - v.updatedAt));
2523
- }).catch(() => {
2524
- n && j([]);
2525
- }), () => {
2526
- n = !1;
2527
- };
2528
- }, [
2529
- L,
2530
- le,
2531
- dt,
2532
- M,
2533
- H
2534
- ]);
2535
- const Ht = X(() => d(null), []), Et = (n) => {
2536
- W(null), d(n), T("chat");
2537
- }, He = (n, u = null, v = null) => {
2538
- F(n.id), W(
2539
- (I) => I && I.agent.id === n.id && I.sessionId === u && !v ? I : { agent: n, sessionId: u, draft: v, ts: Date.now() }
2540
- ), T("chat");
2541
- }, Gt = () => {
2542
- F((fe == null ? void 0 : fe.id) ?? null), W(null), oe(""), T("landing");
2543
- }, Pt = () => {
2544
- if (Y && te) {
2545
- z((n) => n + 1), W(null), T("chat");
2546
- return;
2547
- }
2548
- Oe((n) => !n);
2549
- }, Ft = () => {
2550
- N ? T("chat") : fe && He(fe);
2551
- }, mt = async () => {
2552
- const n = de.trim();
2553
- if (!(!n || $e)) {
2554
- if (Y && te) {
2555
- ue(n), oe(""), T("chat");
2556
- return;
2557
- }
2558
- if (ye) {
2559
- Ae(!0);
2560
- try {
2561
- const u = n.length > 20 ? `${n.slice(0, 20)}…` : n, v = await cn(
2562
- ye.id,
2563
- u,
2564
- l,
2565
- ne
2566
- );
2567
- Be(null), W({
2568
- agent: ye,
2569
- sessionId: v.id,
2570
- draft: n,
2571
- ts: Date.now()
2572
- }), oe(""), T("chat");
2573
- } catch {
2574
- } finally {
2575
- Ae(!1);
2576
- }
2577
- }
2578
- }
2579
- }, Ce = (h == null ? void 0 : h.display_name) || (h == null ? void 0 : h.username) || "", zt = se(() => a ? [
2580
- {
2581
- mode: "personal",
2582
- label: "个人工作台",
2583
- icon: /* @__PURE__ */ e(Mt, {})
2584
- },
2585
- {
2586
- mode: "collaboration",
2587
- label: "协作工作台",
2588
- icon: /* @__PURE__ */ e(Sn, {})
2589
- }
2590
- ].filter(
2591
- (u) => pn(h, u.mode)
2592
- ) : [], [h, a]), Wt = N ? `${N.agent.id}-${N.sessionId ?? 0}-${N.ts}` : "none";
2593
- let me;
2594
- return w === "agentDetail" && st ? me = /* @__PURE__ */ e("div", { className: s.detailHost, children: /* @__PURE__ */ e(
2595
- gn,
2596
- {
2597
- agent: st,
2598
- onBack: () => T("extensions")
2599
- }
2600
- ) }) : w === "schedule" ? me = /* @__PURE__ */ e(to, { localOnline: le }) : w === "extensions" ? me = /* @__PURE__ */ e(
2601
- gl,
2602
- {
2603
- agents: b,
2604
- loading: $,
2605
- skillsAgent: fe,
2606
- token: l,
2607
- onChat: (n) => He(n),
2608
- onConfig: (n) => {
2609
- ct(n), T("agentDetail");
2610
- },
2611
- onCreated: (n) => _((u) => [...u, n])
2612
- }
2613
- ) : w === "history" ? me = /* @__PURE__ */ e(
2614
- Us,
2615
- {
2616
- agents: b,
2617
- token: l,
2618
- onOpenSession: (n, u) => He(n, u)
2619
- }
2620
- ) : w === "workbenchShell" ? me = /* @__PURE__ */ e(
2621
- bn,
2622
- {
2623
- onOpenProject: Pe,
2624
- selectedPersonalAgent: ye,
2625
- personalView: "chat",
2626
- newSessionTrigger: H,
2627
- onSelectPersonalAgent: (n) => F((n == null ? void 0 : n.id) ?? null),
2628
- onShowPersonalAgentDetail: (n) => {
2629
- ct(n), T("agentDetail");
2630
- },
2631
- onChatWithPersonalAgent: (n) => He(n),
2632
- onSwitchMode: a
2633
- }
2634
- ) : w === "personalTab" ? me = /* @__PURE__ */ t("div", { className: s.personalTabHost, children: [
2635
- _e === "projects" && /* @__PURE__ */ e(
2636
- pt,
2637
- {
2638
- activeTab: "projects",
2639
- onActiveTabChange: () => {
2640
- },
2641
- onOpenProject: Pe,
2642
- hideTabs: !0
2643
- }
2644
- ),
2645
- _e === "personal" && /* @__PURE__ */ e(
2646
- pt,
2647
- {
2648
- activeTab: "personal",
2649
- onActiveTabChange: () => {
2650
- },
2651
- onOpenProject: Pe,
2652
- hideTabs: !0
2653
- }
2654
- ),
2655
- _e === "business-stats" && /* @__PURE__ */ e(Kt, { source: "scenario" }),
2656
- _e === "tools" && /* @__PURE__ */ e(_t, { showTools: !0, showWebsites: !1 }),
2657
- _e === "websites" && /* @__PURE__ */ e(_t, { showTools: !1, showWebsites: !0 }),
2658
- _e === "todo" && /* @__PURE__ */ e(
2659
- Nn,
2660
- {
2661
- onOpenProject: Pe,
2662
- onOpenNote: (n) => {
2663
- lt("notes"), Lt({ id: n, ts: Date.now() });
2664
- }
2665
- }
2666
- ),
2667
- _e === "notes" && /* @__PURE__ */ e(
2668
- qt,
2669
- {
2670
- onOpenProject: Pe,
2671
- openNoteId: Ot
2672
- }
2673
- ),
2674
- _e === "training" && /* @__PURE__ */ e(kn, {}),
2675
- _e === "webide" && /* @__PURE__ */ e(vn, {})
2676
- ] }) : N ? me = /* @__PURE__ */ e("div", { className: s.chatHost, children: /* @__PURE__ */ e(
2677
- _n,
2678
- {
2679
- agent: N.agent,
2680
- initialSessionId: N.sessionId,
2681
- autoSendDraft: N.draft,
2682
- chromeless: !0,
2683
- agents: b,
2684
- onSwitchAgent: (n) => He(n)
2685
- },
2686
- Wt
2687
- ) }) : Y && te && w !== "landing" ? me = /* @__PURE__ */ e("div", { className: s.chatHost, children: /* @__PURE__ */ e(
2688
- yn,
2689
- {
2690
- agent: Ci(te),
2691
- newSessionTrigger: H,
2692
- autoSendDraft: ce,
2693
- onAutoSendConsumed: () => ue(null),
2694
- openSessionId: M,
2695
- onOpenSessionConsumed: Ht
2696
- },
2697
- te.id
2698
- ) }) : me = /* @__PURE__ */ e("div", { className: s.landing, children: /* @__PURE__ */ t("div", { className: s.landingInner, children: [
2699
- /* @__PURE__ */ t("h1", { className: s.landingTitle, children: [
2700
- fi(),
2701
- Ce ? `,${Ce}` : ""
2702
- ] }),
2703
- /* @__PURE__ */ e("p", { className: s.landingSub, children: "我是你的智能伙伴,有什么可以帮你?" }),
2704
- /* @__PURE__ */ t("div", { className: s.landingBox, children: [
2705
- /* @__PURE__ */ e(
2706
- "textarea",
2707
- {
2708
- className: s.landingInput,
2709
- placeholder: "给智能伙伴发送消息,Enter 发送,Shift+Enter 换行",
2710
- rows: 3,
2711
- value: de,
2712
- autoFocus: !0,
2713
- onChange: (n) => oe(n.target.value),
2714
- onKeyDown: (n) => {
2715
- n.key === "Enter" && !n.shiftKey && !n.nativeEvent.isComposing && (n.preventDefault(), mt());
2716
- }
2717
- }
2718
- ),
2719
- /* @__PURE__ */ t("div", { className: s.landingBoxBar, children: [
2720
- Y && te ? /* @__PURE__ */ t("span", { className: s.agentChip, children: [
2721
- /* @__PURE__ */ e(Ee, {}),
2722
- /* @__PURE__ */ t("span", { children: [
2723
- te.name,
2724
- "(本机)"
2725
- ] })
2726
- ] }) : ye ? /* @__PURE__ */ t("div", { className: s.agentChipWrap, children: [
2727
- /* @__PURE__ */ t(
2728
- "button",
2729
- {
2730
- type: "button",
2731
- className: s.agentChip,
2732
- onClick: () => ke((n) => !n),
2733
- children: [
2734
- /* @__PURE__ */ e(Ee, {}),
2735
- /* @__PURE__ */ e("span", { children: ye.displayName }),
2736
- b.length > 1 && /* @__PURE__ */ e(qe, { className: s.chipCaret })
2737
- ]
2738
- }
2739
- ),
2740
- De && b.length > 1 && /* @__PURE__ */ t(ie, { children: [
2741
- /* @__PURE__ */ e(
2742
- "div",
2743
- {
2744
- className: s.agentMenuMask,
2745
- onClick: () => ke(!1)
2746
- }
2747
- ),
2748
- /* @__PURE__ */ e("div", { className: s.agentMenu, role: "menu", children: b.map((n) => /* @__PURE__ */ t(
2749
- "button",
2750
- {
2751
- type: "button",
2752
- role: "menuitem",
2753
- className: `${s.agentMenuItem} ${n.id === ye.id ? s.agentMenuItemActive : ""}`,
2754
- onClick: () => {
2755
- F(n.id), ke(!1);
2756
- },
2757
- children: [
2758
- /* @__PURE__ */ e(
2759
- "span",
2760
- {
2761
- className: s.agentDot,
2762
- style: { background: Ye(n.displayName) },
2763
- children: Qe(n.displayName)
2764
- }
2765
- ),
2766
- n.displayName
2767
- ]
2768
- },
2769
- n.id
2770
- )) })
2771
- ] })
2772
- ] }) : /* @__PURE__ */ e("span", { className: s.agentChipEmpty, children: "还没有云端伙伴,可到个人工作台创建" }),
2773
- !(Y && te) && ye && /* @__PURE__ */ t("div", { className: s.agentChipWrap, children: [
2774
- /* @__PURE__ */ t(
2775
- "button",
2776
- {
2777
- type: "button",
2778
- className: s.agentChip,
2779
- title: "本次新建任务归入的项目空间(可选)",
2780
- onClick: () => Le((n) => !n),
2781
- children: [
2782
- /* @__PURE__ */ e(Se, {}),
2783
- /* @__PURE__ */ e("span", { children: ne ? ne.title : "不归组" }),
2784
- /* @__PURE__ */ e(qe, { className: s.chipCaret })
2785
- ]
2786
- }
2787
- ),
2788
- Ve && /* @__PURE__ */ t(ie, { children: [
2789
- /* @__PURE__ */ e(
2790
- "div",
2791
- {
2792
- className: s.agentMenuMask,
2793
- onClick: () => Le(!1)
2794
- }
2795
- ),
2796
- /* @__PURE__ */ e(
2797
- Ze,
2798
- {
2799
- token: l,
2800
- currentId: (ne == null ? void 0 : ne.id) ?? null,
2801
- onPick: (n) => {
2802
- Be(n), Le(!1);
2803
- }
2804
- }
2805
- )
2806
- ] })
2807
- ] }),
2808
- /* @__PURE__ */ e(
2809
- "button",
2810
- {
2811
- type: "button",
2812
- className: s.landingSend,
2813
- disabled: !de.trim() || $e || !ye && !(Y && te),
2814
- onClick: () => void mt(),
2815
- "aria-label": "发送",
2816
- children: $e ? /* @__PURE__ */ e(Xe, {}) : /* @__PURE__ */ e(Dn, {})
2817
- }
2818
- )
2819
- ] })
2820
- ] }),
2821
- /* @__PURE__ */ e("div", { className: s.chipRow, children: bi.map((n) => /* @__PURE__ */ e(
2822
- "button",
2823
- {
2824
- type: "button",
2825
- className: s.suggestChip,
2826
- onClick: () => oe(n),
2827
- children: n
2828
- },
2829
- n
2830
- )) })
2831
- ] }) }), /* @__PURE__ */ t("div", { className: s.shell, children: [
2832
- /* @__PURE__ */ t("aside", { className: s.sidebar, "aria-label": "个人专享工作台导航", children: [
2833
- /* @__PURE__ */ t("div", { className: s.sideContent, children: [
2834
- /* @__PURE__ */ t("div", { className: s.newTaskWrap, children: [
2835
- /* @__PURE__ */ t(
2836
- "button",
2837
- {
2838
- type: "button",
2839
- className: s.newTaskBtn,
2840
- onClick: Pt,
2841
- children: [
2842
- /* @__PURE__ */ e(tt, {}),
2843
- /* @__PURE__ */ e("span", { children: Y ? "新建任务" : "云端任务" })
2844
- ]
2845
- }
2846
- ),
2847
- Ue && /* @__PURE__ */ t(ie, { children: [
2848
- /* @__PURE__ */ e(
2849
- "div",
2850
- {
2851
- className: s.agentMenuMask,
2852
- onClick: () => Oe(!1)
2853
- }
2854
- ),
2855
- /* @__PURE__ */ e(
2856
- Ze,
2857
- {
2858
- token: l,
2859
- down: !0,
2860
- currentId: (ne == null ? void 0 : ne.id) ?? null,
2861
- onPick: (n) => {
2862
- Oe(!1), Be(n), Gt();
2863
- }
2864
- }
2865
- )
2866
- ] })
2867
- ] }),
2868
- /* @__PURE__ */ t("nav", { "aria-label": "专享模块", className: s.sideNav, children: [
2869
- Y && /* @__PURE__ */ t(
2870
- "button",
2871
- {
2872
- type: "button",
2873
- className: `${s.navItem} ${w === "chat" && N ? s.navItemActive : ""}`,
2874
- "aria-current": w === "chat" && N ? "page" : void 0,
2875
- onClick: Ft,
2876
- children: [
2877
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e($t, {}) }),
2878
- /* @__PURE__ */ e("span", { children: "云端任务" })
2879
- ]
2880
- }
2881
- ),
2882
- /* @__PURE__ */ t(
2883
- "button",
2884
- {
2885
- type: "button",
2886
- className: `${s.navItem} ${w === "schedule" ? s.navItemActive : ""}`,
2887
- "aria-current": w === "schedule" ? "page" : void 0,
2888
- onClick: () => T("schedule"),
2889
- children: [
2890
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(St, {}) }),
2891
- /* @__PURE__ */ e("span", { children: "定时任务" })
2892
- ]
2893
- }
2894
- ),
2895
- /* @__PURE__ */ t(
2896
- "div",
2897
- {
2898
- role: "button",
2899
- tabIndex: 0,
2900
- className: `${s.navItem} ${w === "extensions" || w === "agentDetail" || w === "personalTab" || w === "workbenchShell" ? s.navItemActive : ""}`,
2901
- "aria-current": w === "extensions" || w === "agentDetail" || w === "personalTab" || w === "workbenchShell" ? "page" : void 0,
2902
- onClick: () => T("extensions"),
2903
- onKeyDown: (n) => {
2904
- (n.key === "Enter" || n.key === " ") && T("extensions");
2905
- },
2906
- children: [
2907
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(nt, {}) }),
2908
- /* @__PURE__ */ e("span", { children: "更多能力" }),
2909
- /* @__PURE__ */ e(
2910
- "button",
2911
- {
2912
- ref: r,
2913
- type: "button",
2914
- className: s.moreGear,
2915
- title: "更多能力菜单",
2916
- onClick: (n) => {
2917
- n.stopPropagation();
2918
- const u = n.currentTarget.getBoundingClientRect(), v = Math.max(8, window.innerHeight - 430);
2919
- pe(
2920
- (I) => I ? null : {
2921
- top: Math.min(u.top - 6, v),
2922
- left: u.right + 10
2923
- }
2924
- );
2925
- },
2926
- children: /* @__PURE__ */ e(ze, {})
2927
- }
2928
- )
2929
- ]
2930
- }
2931
- ),
2932
- Me && tn(
2933
- /* @__PURE__ */ t(
2934
- "div",
2935
- {
2936
- ref: Ge,
2937
- className: s.moreFlyout,
2938
- style: { top: Me.top, left: Me.left },
2939
- children: [
2940
- Ni.map((n) => /* @__PURE__ */ t(
2941
- "button",
2942
- {
2943
- type: "button",
2944
- className: s.moreFlyoutItem,
2945
- onClick: () => {
2946
- pe(null), T("extensions");
2947
- },
2948
- children: [
2949
- /* @__PURE__ */ e("span", { className: s.moreFlyoutIcon, children: n.icon }),
2950
- /* @__PURE__ */ e("span", { children: n.label })
2951
- ]
2952
- },
2953
- n.label
2954
- )),
2955
- ki.map((n) => /* @__PURE__ */ t(
2956
- "button",
2957
- {
2958
- type: "button",
2959
- className: s.moreFlyoutItem,
2960
- disabled: !0,
2961
- title: n.title,
2962
- children: [
2963
- /* @__PURE__ */ e("span", { className: s.moreFlyoutIcon, children: n.icon }),
2964
- /* @__PURE__ */ e("span", { children: n.label })
2965
- ]
2966
- },
2967
- n.label
2968
- )),
2969
- /* @__PURE__ */ e("div", { className: s.moreFlyoutDivider }),
2970
- vi.map((n) => /* @__PURE__ */ t(
2971
- "button",
2972
- {
2973
- type: "button",
2974
- className: s.moreFlyoutItem,
2975
- onClick: () => {
2976
- pe(null), B(n.tab);
2977
- },
2978
- children: [
2979
- /* @__PURE__ */ e("span", { className: s.moreFlyoutIcon, children: n.icon }),
2980
- /* @__PURE__ */ e("span", { children: n.label })
2981
- ]
2982
- },
2983
- n.tab
2984
- )),
2985
- /* @__PURE__ */ e("div", { className: s.moreFlyoutDivider }),
2986
- /* @__PURE__ */ t(
2987
- "button",
2988
- {
2989
- type: "button",
2990
- className: s.moreFlyoutItem,
2991
- onClick: () => {
2992
- pe(null), T("workbenchShell");
2993
- },
2994
- children: [
2995
- /* @__PURE__ */ e("span", { className: s.moreFlyoutIcon, children: /* @__PURE__ */ e(Ut, {}) }),
2996
- /* @__PURE__ */ e("span", { children: "完整工作台" })
2997
- ]
2998
- }
2999
- )
3000
- ]
3001
- }
3002
- ),
3003
- document.body
3004
- ),
3005
- /* @__PURE__ */ t(
3006
- "button",
3007
- {
3008
- type: "button",
3009
- className: `${s.navItem} ${w === "history" ? s.navItemActive : ""}`,
3010
- "aria-current": w === "history" ? "page" : void 0,
3011
- onClick: () => T("history"),
3012
- children: [
3013
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(jn, {}) }),
3014
- /* @__PURE__ */ e("span", { children: "聊天记录" })
3015
- ]
3016
- }
3017
- )
3018
- ] }),
3019
- /* @__PURE__ */ t("div", { className: s.sideTasks, children: [
3020
- Y && /* @__PURE__ */ t(
3021
- "div",
3022
- {
3023
- className: s.segToggle,
3024
- role: "tablist",
3025
- "aria-label": "任务范围切换",
3026
- children: [
3027
- /* @__PURE__ */ e(
3028
- "button",
3029
- {
3030
- type: "button",
3031
- role: "tab",
3032
- "aria-selected": L === "local",
3033
- className: `${s.segBtn} ${L === "local" ? s.segBtnActive : ""}`,
3034
- onClick: () => U("local"),
3035
- children: "本地"
3036
- }
3037
- ),
3038
- /* @__PURE__ */ e(
3039
- "button",
3040
- {
3041
- type: "button",
3042
- role: "tab",
3043
- "aria-selected": L === "cloud",
3044
- className: `${s.segBtn} ${L === "cloud" ? s.segBtnActive : ""}`,
3045
- onClick: () => U("cloud"),
3046
- children: "云端"
3047
- }
3048
- )
3049
- ]
3050
- }
3051
- ),
3052
- Y && L === "local" ? /* @__PURE__ */ t(ie, { children: [
3053
- /* @__PURE__ */ e("div", { className: s.tasksLabel, children: "本地任务" }),
3054
- q.map((n) => /* @__PURE__ */ e(
3055
- "button",
3056
- {
3057
- type: "button",
3058
- className: `${s.recentItem} ${M === n.id ? s.recentItemActive : ""}`,
3059
- title: n.title,
3060
- onClick: () => Et(n.id),
3061
- children: /* @__PURE__ */ e("span", { className: s.recentItemText, children: n.title || "未命名会话" })
3062
- },
3063
- n.id
3064
- )),
3065
- q.length === 0 && /* @__PURE__ */ e("div", { className: s.tasksEmpty, children: le ? "暂无本地任务,点上方新建任务开始" : "本机 Agent 未运行" })
3066
- ] }) : /* @__PURE__ */ t(ie, { children: [
3067
- /* @__PURE__ */ e("div", { className: s.tasksLabel, children: "项目" }),
3068
- Re.length === 0 && !R && /* @__PURE__ */ e("div", { className: s.tasksEmpty, children: "还没有项目空间或云端任务" }),
3069
- Re.map((n) => {
3070
- const u = g.has(n.key);
3071
- return /* @__PURE__ */ t("div", { children: [
3072
- /* @__PURE__ */ t(
3073
- "button",
3074
- {
3075
- type: "button",
3076
- className: s.projFolder,
3077
- "aria-expanded": u,
3078
- onClick: () => D((v) => {
3079
- const I = new Set(v);
3080
- return I.has(n.key) ? I.delete(n.key) : I.add(n.key), I;
3081
- }),
3082
- children: [
3083
- /* @__PURE__ */ e(
3084
- qe,
3085
- {
3086
- className: `${s.projCaret} ${u ? s.projCaretOpen : ""}`
3087
- }
3088
- ),
3089
- /* @__PURE__ */ e(Se, { className: s.projIcon }),
3090
- /* @__PURE__ */ e("span", { className: s.projName, title: n.title, children: n.title }),
3091
- /* @__PURE__ */ e("span", { className: s.projMeta, children: n.sessions.length > 0 ? n.sessions.length : "暂无任务" })
3092
- ]
3093
- }
3094
- ),
3095
- u && n.sessions.length > 0 && /* @__PURE__ */ e("div", { className: s.projRows, children: n.sessions.map((v) => {
3096
- const I = Rt.get(v.personalAgentId);
3097
- return /* @__PURE__ */ e(
3098
- "button",
3099
- {
3100
- type: "button",
3101
- className: `${s.recentItem} ${(N == null ? void 0 : N.sessionId) === v.id ? s.recentItemActive : ""}`,
3102
- disabled: !I,
3103
- title: I ? v.title || "未命名会话" : "伙伴已不存在,无法打开",
3104
- onClick: () => I && He(I, v.id),
3105
- children: /* @__PURE__ */ e("span", { className: s.recentItemText, children: v.title || "未命名会话" })
3106
- },
3107
- v.id
3108
- );
3109
- }) })
3110
- ] }, n.key);
3111
- })
3112
- ] })
3113
- ] })
3114
- ] }),
3115
- /* @__PURE__ */ t("div", { className: s.sideFooter, children: [
3116
- x && /* @__PURE__ */ t(ie, { children: [
3117
- /* @__PURE__ */ e(
3118
- "div",
3119
- {
3120
- className: s.agentMenuMask,
3121
- onClick: () => ve(!1)
3122
- }
3123
- ),
3124
- /* @__PURE__ */ t(
3125
- "div",
3126
- {
3127
- className: `${s.agentMenu} ${s.settingsMenu}`,
3128
- role: "menu",
3129
- "aria-label": "账号与设置",
3130
- children: [
3131
- /* @__PURE__ */ t("div", { className: s.accountHeader, children: [
3132
- /* @__PURE__ */ e(
3133
- "span",
3134
- {
3135
- className: s.accountAvatar,
3136
- style: { background: Ye(Ce || "用户") },
3137
- children: Qe(Ce || "用户")
3138
- }
3139
- ),
3140
- /* @__PURE__ */ e("span", { className: s.accountName, children: Ce || "用户" })
3141
- ] }),
3142
- /* @__PURE__ */ t(
3143
- "button",
3144
- {
3145
- type: "button",
3146
- role: "menuitem",
3147
- className: s.agentMenuItem,
3148
- onClick: () => {
3149
- ve(!1), at(!0);
3150
- },
3151
- children: [
3152
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(ze, {}) }),
3153
- /* @__PURE__ */ e("span", { children: "设置" })
3154
- ]
3155
- }
3156
- ),
3157
- zt.map((n) => /* @__PURE__ */ t(
3158
- "button",
3159
- {
3160
- type: "button",
3161
- role: "menuitem",
3162
- className: s.agentMenuItem,
3163
- onClick: () => {
3164
- ve(!1), a == null || a(n.mode);
3165
- },
3166
- children: [
3167
- /* @__PURE__ */ e("span", { className: s.navIcon, children: n.icon }),
3168
- /* @__PURE__ */ e("span", { children: n.label })
3169
- ]
3170
- },
3171
- n.mode
3172
- )),
3173
- /* @__PURE__ */ e("div", { className: s.menuDivider }),
3174
- /* @__PURE__ */ t(
3175
- "button",
3176
- {
3177
- type: "button",
3178
- role: "menuitem",
3179
- className: `${s.agentMenuItem} ${s.accountItemDisabled}`,
3180
- disabled: !0,
3181
- title: "即将上线",
3182
- children: [
3183
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(Dt, {}) }),
3184
- /* @__PURE__ */ e("span", { children: "外观" })
3185
- ]
3186
- }
3187
- ),
3188
- /* @__PURE__ */ t(
3189
- "button",
3190
- {
3191
- type: "button",
3192
- role: "menuitem",
3193
- className: `${s.agentMenuItem} ${s.accountItemDisabled}`,
3194
- disabled: !0,
3195
- title: "即将上线",
3196
- children: [
3197
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(Bt, {}) }),
3198
- /* @__PURE__ */ e("span", { children: "快捷键" })
3199
- ]
3200
- }
3201
- ),
3202
- /* @__PURE__ */ t(
3203
- "button",
3204
- {
3205
- type: "button",
3206
- role: "menuitem",
3207
- className: `${s.agentMenuItem} ${s.accountItemDisabled}`,
3208
- disabled: !0,
3209
- title: "即将上线",
3210
- children: [
3211
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(xt, {}) }),
3212
- /* @__PURE__ */ e("span", { children: "意见反馈" })
3213
- ]
3214
- }
3215
- ),
3216
- /* @__PURE__ */ t(
3217
- "button",
3218
- {
3219
- type: "button",
3220
- role: "menuitem",
3221
- className: `${s.agentMenuItem} ${s.accountItemDisabled}`,
3222
- disabled: !0,
3223
- title: "即将上线",
3224
- children: [
3225
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(xn, {}) }),
3226
- /* @__PURE__ */ e("span", { children: "检查更新" })
3227
- ]
3228
- }
3229
- ),
3230
- /* @__PURE__ */ e("div", { className: s.menuDivider }),
3231
- /* @__PURE__ */ t(
3232
- "button",
3233
- {
3234
- type: "button",
3235
- role: "menuitem",
3236
- className: s.agentMenuItem,
3237
- onClick: () => void un(),
3238
- children: [
3239
- /* @__PURE__ */ e("span", { className: s.navIcon, children: /* @__PURE__ */ e(Mn, {}) }),
3240
- /* @__PURE__ */ e("span", { children: "退出登录" })
3241
- ]
3242
- }
3243
- )
3244
- ]
3245
- }
3246
- )
3247
- ] }),
3248
- /* @__PURE__ */ t(
3249
- "div",
3250
- {
3251
- className: s.footerCard,
3252
- onClick: () => ve((n) => !n),
3253
- role: "button",
3254
- "aria-expanded": x,
3255
- children: [
3256
- /* @__PURE__ */ e(
3257
- "span",
3258
- {
3259
- className: s.footerAvatar,
3260
- style: { background: Ye(Ce || "用户") },
3261
- children: Qe(Ce || "用户")
3262
- }
3263
- ),
3264
- /* @__PURE__ */ t("span", { className: s.footerMeta, children: [
3265
- /* @__PURE__ */ e("span", { className: s.footerName, children: Ce || "用户" }),
3266
- /* @__PURE__ */ e("span", { className: s.footerSub, children: "Future-Team · 个人(专享)" })
3267
- ] }),
3268
- /* @__PURE__ */ e(
3269
- "button",
3270
- {
3271
- type: "button",
3272
- className: s.footerGear,
3273
- onClick: (n) => {
3274
- n.stopPropagation(), ve((u) => !u);
3275
- },
3276
- "aria-expanded": x,
3277
- "aria-label": "账号与设置",
3278
- children: /* @__PURE__ */ e(ze, {})
3279
- }
3280
- )
3281
- ]
3282
- }
3283
- )
3284
- ] })
3285
- ] }),
3286
- /* @__PURE__ */ e("main", { className: s.main, "aria-label": "个人专享工作台内容", children: $ && !N && !te ? /* @__PURE__ */ e("div", { className: s.emptyState, children: /* @__PURE__ */ e("span", { className: s.emptyTitle, children: "正在加载智能伙伴…" }) }) : me }),
3287
- /* @__PURE__ */ e(
3288
- gi,
3289
- {
3290
- open: We,
3291
- onClose: () => at(!1),
3292
- token: l
3293
- }
3294
- )
3295
- ] });
3296
- }
3297
- export {
3298
- Bi as default
3299
- };