@yuku123/z-team-component 0.2.56 → 0.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{ChangeLogView-R6boINWk.js → ChangeLogView-Cstbioyw.js} +137 -137
  2. package/dist/{ComponentDoc-CXivBlKo.js → ComponentDoc-0L_mpFyu.js} +121 -121
  3. package/dist/{InvitationManagementPage-B2Kow6-8.js → InvitationManagementPage-Ba5yy-Hl.js} +1 -1
  4. package/dist/{OnboardingPage-DbK9iTSY.js → OnboardingPage-rEAorVv0.js} +2 -2
  5. package/dist/{ScheduledTasks-DcM_HA5v.js → ScheduledTasks-Db5a-nxu.js} +2992 -2957
  6. package/dist/{SystemShell-BDSLyt15.js → SystemShell-BbREgRq8.js} +1 -1
  7. package/dist/{admin-logs-DMF0dtG1.js → admin-logs-B9KS6VJz.js} +2 -2
  8. package/dist/{api-BPJ4ZHcq.js → api-B4-sB0Pv.js} +1 -1
  9. package/dist/{api-DhuqONeb.js → api-CALqShkO.js} +228 -210
  10. package/dist/createWorkspaceWsHandler-DP30xvug.js +13035 -0
  11. package/dist/{index-CZ9xxAL0.js → index-4YxdJwFm.js} +3 -3
  12. package/dist/{index-DnXcckr9.js → index-8gCovDDT.js} +6 -6
  13. package/dist/{index-2xlHrS59.js → index-9w4zGIUG.js} +1121 -1123
  14. package/dist/{index-vy0cRfLN.js → index-BVYQ8p6A.js} +5 -5
  15. package/dist/{index-B8eiFO_f.js → index-C2Wkg1b5.js} +3 -3
  16. package/dist/{index-BOcKPM37.js → index-C3B7CbHo.js} +1 -1
  17. package/dist/{index-BkX0I2aB.js → index-C6S3MIu4.js} +56 -56
  18. package/dist/index-C88kp8U2.js +1143 -0
  19. package/dist/{index-DdRJhUqt.js → index-C90C1lUS.js} +3 -3
  20. package/dist/{index-CzePRAbT.js → index-CGWttFLb.js} +4 -4
  21. package/dist/{index-B-XDBODG.js → index-CHb5cxi8.js} +1 -1
  22. package/dist/{index-Ct9MzvZV.js → index-CLWgeKwr.js} +2 -2
  23. package/dist/{index-JMzBzwiO.js → index-CinRd7Nz.js} +618 -617
  24. package/dist/index-CmToF3CG.js +9257 -0
  25. package/dist/{index-BKVWW3ba.js → index-DET70T3j.js} +1 -1
  26. package/dist/{index-D9UhloUj.js → index-DJGEEIGt.js} +2 -2
  27. package/dist/{index-Otx98G8z.js → index-DJOyOVn_.js} +87 -74
  28. package/dist/{index-CbUsvCMy.js → index-DKeYG0Fu.js} +4 -4
  29. package/dist/{index-DactZGbw.js → index-DRQFmqYV.js} +2 -2
  30. package/dist/index-DTGL9OWw.js +1195 -0
  31. package/dist/index-DWsfQMp8.js +208 -0
  32. package/dist/{index-BV5g5lsS.js → index-JpY3wmeg.js} +3 -3
  33. package/dist/index-WIsi8fln.js +339 -0
  34. package/dist/{index-BM6XpIcw.js → index-aw72ID7y.js} +1 -1
  35. package/dist/{index-BP97Ev-W.js → index-lftFkqfI.js} +4 -4
  36. package/dist/{index-CZxihNo5.js → index-m8V5TniT.js} +7 -7
  37. package/dist/index.js +1 -1
  38. package/dist/{instance-Cr4_XM2r.js → instance-f3C-1qYl.js} +1 -1
  39. package/dist/pages.js +1 -1
  40. package/dist/{schedule-BNLns-p4.js → schedule-DfkgwPdE.js} +1 -1
  41. package/dist/{send-default-agent-team-message-C9VWSWKJ.js → send-default-agent-team-message-d_ECdczr.js} +1 -1
  42. package/dist/{sso-user-Cme2tmGq.js → sso-user-HcsSzg8P.js} +1 -1
  43. package/dist/{training-SjRAdtNQ.js → training-DnNQN0An.js} +1 -1
  44. package/dist/{useAppStore-C63xiq3-.js → useAppStore-kRZEA5WZ.js} +1 -1
  45. package/dist/webide-BcRzJX-h.js +8255 -0
  46. package/dist/z-team-component.css +2 -2
  47. package/package.json +1 -1
  48. package/dist/createWorkspaceWsHandler-BJhBWCRa.js +0 -13035
  49. package/dist/index-B30K72xQ.js +0 -1330
  50. package/dist/index-BWgbbHyC.js +0 -8977
  51. package/dist/index-Ba9q3egm.js +0 -1182
  52. package/dist/webide-DDFxSedU.js +0 -7845
@@ -1,91 +1,91 @@
1
- import { jsx as e, jsxs as i, Fragment as Me } from "react/jsx-runtime";
2
- import { S as xt, T as Rt, P as Et } from "./webide-DDFxSedU.js";
3
- import { RightOutlined as $t, PlusOutlined as Zt, LeftOutlined as en, CheckOutlined as Ot, LoadingOutlined as kt, EditOutlined as Tt, DeleteOutlined as tn, UpOutlined as wt, RedoOutlined as nn, DownOutlined as sn, StopOutlined as an, CopyOutlined as ln, MessageOutlined as Ht, MoreOutlined as cn, DashboardOutlined as Pt, MenuUnfoldOutlined as on, MenuFoldOutlined as rn, SettingOutlined as dn, TeamOutlined as un, FolderOpenOutlined as mn, BarChartOutlined as hn, PieChartOutlined as pn, CodeOutlined as gn, LinkOutlined as _n, UnorderedListOutlined as fn, FileTextOutlined as Ft, ReadOutlined as yn, ConsoleSqlOutlined as vn, PlayCircleOutlined as bn } from "@ant-design/icons";
4
- import { useState as m, useRef as j, useMemo as De, useEffect as x, useCallback as V } from "react";
5
- import { x as Nn, y as jt, k as nt, z as Cn, A as kn, C as Tn, D as wn, E as In, F as Sn, G as An } from "./api-DhuqONeb.js";
6
- import { f as Wt, c as gt, a as Bn, b as Ln, r as Dn, s as Mn, t as xn, d as Kt, e as vt, g as Rn, h as En, i as Ut, j as $n, p as On, k as h, R as rt, D as _t, l as Hn, m as Pn, F as ft, L as Fn, A as jn, C as Wn, W as Kn, n as Un, S as Vn, U as Gn, T as zn, o as qn, q as Qn, P as Xn } from "./index-BWgbbHyC.js";
7
- import { u as Je } from "./useAppStore-C63xiq3-.js";
8
- import { h as Vt, f as Jn } from "./schedule-BNLns-p4.js";
9
- import Yn from "react-markdown";
10
- import Zn from "rehype-highlight";
11
- import es from "remark-gfm";
12
- import { T as ts, a as ns } from "./createWorkspaceWsHandler-BJhBWCRa.js";
13
- import { W as bt, b as dt, T as Gt, c as zt, a as qt, P as Qt, S as ss, E as as, C as ls } from "./ScheduledTasks-DcM_HA5v.js";
14
- import { message as ct, Tooltip as Nt } from "antd";
15
- const is = "_container_3gc15_1", cs = "_sessionPanel_3gc15_9", os = "_sessionHeader_3gc15_19", rs = "_sessionHeaderActions_3gc15_32", ds = "_sessionBtnSm_3gc15_37", us = "_sessionList_3gc15_55", ms = "_sessionItem_3gc15_61", hs = "_sessionItemActive_3gc15_79", ps = "_sessionItemTitle_3gc15_84", gs = "_sessionLiveDot_3gc15_93", _s = "_sessionItemTime_3gc15_100", fs = "_sessionDeleteBtn_3gc15_106", ys = "_sessionRenameBtn_3gc15_127", vs = "_sessionRenameInput_3gc15_148", bs = "_sessionCreateRow_3gc15_160", Ns = "_sessionCreateInput_3gc15_166", Cs = "_sessionCreateConfirm_3gc15_180", ks = "_sessionCreateCancel_3gc15_181", Ts = "_sessionSearchRow_3gc15_203", ws = "_sessionSearchInput_3gc15_209", Is = "_sessionSearchClear_3gc15_224", Ss = "_sessionEmpty_3gc15_245", As = "_sessionExpandBtn_3gc15_255", Bs = "_chatPanel_3gc15_275", Ls = "_chatHeader_3gc15_284", Ds = "_agentAvatar_3gc15_296", Ms = "_chatHeaderMeta_3gc15_309", xs = "_chatHeaderName_3gc15_317", Rs = "_chatHeaderSession_3gc15_324", Es = "_chatHeaderBadge_3gc15_332", $s = "_streamingIndicator_3gc15_342", Os = "_threadScroll_3gc15_351", Hs = "_threadInner_3gc15_357", Ps = "_landing_3gc15_368", Fs = "_landingLogo_3gc15_378", js = "_landingTitle_3gc15_392", Ws = "_landingHint_3gc15_398", Ks = "_newChatLanding_3gc15_404", Us = "_landingComposer_3gc15_415", Vs = "_landingInput_3gc15_432", Gs = "_chatEmpty_3gc15_448", zs = "_userRow_3gc15_459", qs = "_userBubble_3gc15_464", Qs = "_assistantBlock_3gc15_478", Xs = "_md_3gc15_488", Js = "_mdPreWrap_3gc15_546", Ys = "_mdPreCopy_3gc15_550", Zs = "_caretCursor_3gc15_585", ea = "_errorBar_3gc15_602", ta = "_errorRetryBtn_3gc15_611", na = "_stoppedBar_3gc15_626", sa = "_scrollTopBtn_3gc15_636", aa = "_scrollTopBtnVisible_3gc15_658", la = "_composerWrap_3gc15_669", ia = "_composer_3gc15_669", ca = "_composerInput_3gc15_691", oa = "_sendBtn_3gc15_709", ra = "_stopBtn_3gc15_710", da = "_sendBtnReady_3gc15_730", ua = "_composerHint_3gc15_748", ma = "_msgMeta_3gc15_758", ha = "_copyBtn_3gc15_769", pa = "_copyBtnInline_3gc15_799", ga = "_copyBtnDone_3gc15_806", _a = "_landingChips_3gc15_811", fa = "_landingChip_3gc15_811", ya = "_userActions_3gc15_838", va = "_userActionBtn_3gc15_851", ba = "_editingBar_3gc15_874", Na = "_pendingBar_3gc15_889", Ca = "_editingCancel_3gc15_910", c = {
16
- container: is,
17
- sessionPanel: cs,
18
- sessionHeader: os,
19
- sessionHeaderActions: rs,
20
- sessionBtnSm: ds,
21
- sessionList: us,
22
- sessionItem: ms,
23
- sessionItemActive: hs,
24
- sessionItemTitle: ps,
25
- sessionLiveDot: gs,
26
- sessionItemTime: _s,
27
- sessionDeleteBtn: fs,
28
- sessionRenameBtn: ys,
29
- sessionRenameInput: vs,
30
- sessionCreateRow: bs,
31
- sessionCreateInput: Ns,
32
- sessionCreateConfirm: Cs,
33
- sessionCreateCancel: ks,
34
- sessionSearchRow: Ts,
35
- sessionSearchInput: ws,
36
- sessionSearchClear: Is,
37
- sessionEmpty: Ss,
38
- sessionExpandBtn: As,
39
- chatPanel: Bs,
40
- chatHeader: Ls,
41
- agentAvatar: Ds,
42
- chatHeaderMeta: Ms,
43
- chatHeaderName: xs,
44
- chatHeaderSession: Rs,
45
- chatHeaderBadge: Es,
46
- streamingIndicator: $s,
47
- threadScroll: Os,
48
- threadInner: Hs,
49
- landing: Ps,
50
- landingLogo: Fs,
51
- landingTitle: js,
52
- landingHint: Ws,
53
- newChatLanding: Ks,
54
- landingComposer: Us,
55
- landingInput: Vs,
56
- chatEmpty: Gs,
57
- userRow: zs,
58
- userBubble: qs,
59
- assistantBlock: Qs,
60
- md: Xs,
61
- mdPreWrap: Js,
62
- mdPreCopy: Ys,
63
- caretCursor: Zs,
64
- errorBar: ea,
65
- errorRetryBtn: ta,
66
- stoppedBar: na,
67
- scrollTopBtn: sa,
68
- scrollTopBtnVisible: aa,
69
- composerWrap: la,
70
- composer: ia,
71
- composerInput: ca,
72
- sendBtn: oa,
73
- stopBtn: ra,
74
- sendBtnReady: da,
75
- composerHint: ua,
76
- msgMeta: ma,
77
- copyBtn: ha,
78
- copyBtnInline: pa,
79
- copyBtnDone: ga,
80
- landingChips: _a,
81
- landingChip: fa,
82
- userActions: ya,
83
- userActionBtn: va,
84
- editingBar: ba,
85
- pendingBar: Na,
86
- editingCancel: Ca
1
+ import { jsx as e, jsxs as i, Fragment as xe } from "react/jsx-runtime";
2
+ import { S as Rt, T as Et, P as $t } from "./webide-BcRzJX-h.js";
3
+ import { RightOutlined as Ot, PlusOutlined as nn, LeftOutlined as sn, CheckOutlined as Ht, LoadingOutlined as Tt, EditOutlined as wt, DeleteOutlined as an, UpOutlined as It, RedoOutlined as ln, DownOutlined as cn, StopOutlined as on, CopyOutlined as rn, MessageOutlined as Pt, MoreOutlined as dn, DashboardOutlined as Ft, MenuUnfoldOutlined as un, MenuFoldOutlined as mn, SettingOutlined as pn, TeamOutlined as hn, FolderOpenOutlined as gn, BarChartOutlined as _n, PieChartOutlined as fn, CodeOutlined as yn, LinkOutlined as vn, UnorderedListOutlined as bn, FileTextOutlined as jt, ReadOutlined as Nn, ConsoleSqlOutlined as Cn, PlayCircleOutlined as kn } from "@ant-design/icons";
4
+ import { useState as m, useRef as P, useMemo as Me, useEffect as R, useCallback as z } from "react";
5
+ import { x as Tn, y as Wt, k as st, z as wn, A as In, C as Sn, D as An, E as Bn, F as Ln, G as Dn } from "./api-CALqShkO.js";
6
+ import { f as Kt, c as _t, a as Mn, b as xn, r as Rn, s as En, t as $n, d as Ut, e as bt, g as On, h as Hn, i as Vt, j as Pn, p as Fn, k as p, R as dt, D as ft, l as jn, m as Wn, F as yt, L as Kn, A as Un, C as Vn, W as Gn, n as zn, S as qn, U as Qn, T as Xn, o as Jn, q as Yn, P as Zn } from "./index-CmToF3CG.js";
7
+ import { u as Gt, i as zt, T as es, a as ts, s as ns } from "./createWorkspaceWsHandler-DP30xvug.js";
8
+ import { u as Ye } from "./useAppStore-kRZEA5WZ.js";
9
+ import { h as qt, f as ss } from "./schedule-DfkgwPdE.js";
10
+ import as from "react-markdown";
11
+ import ls from "rehype-highlight";
12
+ import is from "remark-gfm";
13
+ import { W as Nt, b as ut, T as Qt, c as Xt, a as Jt, P as Yt, S as cs, E as os, C as rs } from "./ScheduledTasks-Db5a-nxu.js";
14
+ import { message as ot, Tooltip as Ct } from "antd";
15
+ const ds = "_container_3gc15_1", us = "_sessionPanel_3gc15_9", ms = "_sessionHeader_3gc15_19", ps = "_sessionHeaderActions_3gc15_32", hs = "_sessionBtnSm_3gc15_37", gs = "_sessionList_3gc15_55", _s = "_sessionItem_3gc15_61", fs = "_sessionItemActive_3gc15_79", ys = "_sessionItemTitle_3gc15_84", vs = "_sessionLiveDot_3gc15_93", bs = "_sessionItemTime_3gc15_100", Ns = "_sessionDeleteBtn_3gc15_106", Cs = "_sessionRenameBtn_3gc15_127", ks = "_sessionRenameInput_3gc15_148", Ts = "_sessionCreateRow_3gc15_160", ws = "_sessionCreateInput_3gc15_166", Is = "_sessionCreateConfirm_3gc15_180", Ss = "_sessionCreateCancel_3gc15_181", As = "_sessionSearchRow_3gc15_203", Bs = "_sessionSearchInput_3gc15_209", Ls = "_sessionSearchClear_3gc15_224", Ds = "_sessionEmpty_3gc15_245", Ms = "_sessionExpandBtn_3gc15_255", xs = "_chatPanel_3gc15_275", Rs = "_chatHeader_3gc15_284", Es = "_agentAvatar_3gc15_296", $s = "_chatHeaderMeta_3gc15_309", Os = "_chatHeaderName_3gc15_317", Hs = "_chatHeaderSession_3gc15_324", Ps = "_chatHeaderBadge_3gc15_332", Fs = "_streamingIndicator_3gc15_342", js = "_threadScroll_3gc15_351", Ws = "_threadInner_3gc15_357", Ks = "_landing_3gc15_368", Us = "_landingLogo_3gc15_378", Vs = "_landingTitle_3gc15_392", Gs = "_landingHint_3gc15_398", zs = "_newChatLanding_3gc15_404", qs = "_landingComposer_3gc15_415", Qs = "_landingInput_3gc15_432", Xs = "_chatEmpty_3gc15_448", Js = "_userRow_3gc15_459", Ys = "_userBubble_3gc15_464", Zs = "_assistantBlock_3gc15_478", ea = "_md_3gc15_488", ta = "_mdPreWrap_3gc15_546", na = "_mdPreCopy_3gc15_550", sa = "_caretCursor_3gc15_585", aa = "_errorBar_3gc15_602", la = "_errorRetryBtn_3gc15_611", ia = "_stoppedBar_3gc15_626", ca = "_scrollTopBtn_3gc15_636", oa = "_scrollTopBtnVisible_3gc15_658", ra = "_composerWrap_3gc15_669", da = "_composer_3gc15_669", ua = "_composerInput_3gc15_691", ma = "_sendBtn_3gc15_709", pa = "_stopBtn_3gc15_710", ha = "_sendBtnReady_3gc15_730", ga = "_composerHint_3gc15_748", _a = "_msgMeta_3gc15_758", fa = "_copyBtn_3gc15_769", ya = "_copyBtnInline_3gc15_799", va = "_copyBtnDone_3gc15_806", ba = "_landingChips_3gc15_811", Na = "_landingChip_3gc15_811", Ca = "_userActions_3gc15_838", ka = "_userActionBtn_3gc15_851", Ta = "_editingBar_3gc15_874", wa = "_pendingBar_3gc15_889", Ia = "_editingCancel_3gc15_910", c = {
16
+ container: ds,
17
+ sessionPanel: us,
18
+ sessionHeader: ms,
19
+ sessionHeaderActions: ps,
20
+ sessionBtnSm: hs,
21
+ sessionList: gs,
22
+ sessionItem: _s,
23
+ sessionItemActive: fs,
24
+ sessionItemTitle: ys,
25
+ sessionLiveDot: vs,
26
+ sessionItemTime: bs,
27
+ sessionDeleteBtn: Ns,
28
+ sessionRenameBtn: Cs,
29
+ sessionRenameInput: ks,
30
+ sessionCreateRow: Ts,
31
+ sessionCreateInput: ws,
32
+ sessionCreateConfirm: Is,
33
+ sessionCreateCancel: Ss,
34
+ sessionSearchRow: As,
35
+ sessionSearchInput: Bs,
36
+ sessionSearchClear: Ls,
37
+ sessionEmpty: Ds,
38
+ sessionExpandBtn: Ms,
39
+ chatPanel: xs,
40
+ chatHeader: Rs,
41
+ agentAvatar: Es,
42
+ chatHeaderMeta: $s,
43
+ chatHeaderName: Os,
44
+ chatHeaderSession: Hs,
45
+ chatHeaderBadge: Ps,
46
+ streamingIndicator: Fs,
47
+ threadScroll: js,
48
+ threadInner: Ws,
49
+ landing: Ks,
50
+ landingLogo: Us,
51
+ landingTitle: Vs,
52
+ landingHint: Gs,
53
+ newChatLanding: zs,
54
+ landingComposer: qs,
55
+ landingInput: Qs,
56
+ chatEmpty: Xs,
57
+ userRow: Js,
58
+ userBubble: Ys,
59
+ assistantBlock: Zs,
60
+ md: ea,
61
+ mdPreWrap: ta,
62
+ mdPreCopy: na,
63
+ caretCursor: sa,
64
+ errorBar: aa,
65
+ errorRetryBtn: la,
66
+ stoppedBar: ia,
67
+ scrollTopBtn: ca,
68
+ scrollTopBtnVisible: oa,
69
+ composerWrap: ra,
70
+ composer: da,
71
+ composerInput: ua,
72
+ sendBtn: ma,
73
+ stopBtn: pa,
74
+ sendBtnReady: ha,
75
+ composerHint: ga,
76
+ msgMeta: _a,
77
+ copyBtn: fa,
78
+ copyBtnInline: ya,
79
+ copyBtnDone: va,
80
+ landingChips: ba,
81
+ landingChip: Na,
82
+ userActions: Ca,
83
+ userActionBtn: ka,
84
+ editingBar: Ta,
85
+ pendingBar: wa,
86
+ editingCancel: Ia
87
87
  };
88
- function ka(s) {
88
+ function Sa(s) {
89
89
  if (s && s.trim().startsWith("{"))
90
90
  try {
91
91
  const d = JSON.parse(s);
@@ -100,26 +100,26 @@ function ka(s) {
100
100
  }
101
101
  return null;
102
102
  }
103
- function It(s) {
103
+ function St(s) {
104
104
  return (s || []).map((d, u) => {
105
- const y = ka(d.content);
105
+ const f = Sa(d.content);
106
106
  return {
107
107
  id: `local-${d.timestamp}-${d.role}-${u}`,
108
108
  role: d.role === "assistant" ? "assistant" : "user",
109
- blocks: y ? y.blocks : [{ type: "text", text: d.content }],
110
- totalMs: y == null ? void 0 : y.totalMs,
111
- usage: y == null ? void 0 : y.usage,
112
- stopped: (y == null ? void 0 : y.stopped) === !0
109
+ blocks: f ? f.blocks : [{ type: "text", text: d.content }],
110
+ totalMs: f == null ? void 0 : f.totalMs,
111
+ usage: f == null ? void 0 : f.usage,
112
+ stopped: (f == null ? void 0 : f.stopped) === !0
113
113
  };
114
114
  });
115
115
  }
116
- function Xe(s) {
116
+ function Je(s) {
117
117
  return s.filter((d) => d.type === "text").map((d) => d.text).join("");
118
118
  }
119
- function Ta(s) {
119
+ function Aa(s) {
120
120
  return s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${(s / 1e3).toFixed(1)}k` : String(s);
121
121
  }
122
- function wa(s) {
122
+ function Ba(s) {
123
123
  if (s == null || s <= 0) return "";
124
124
  const d = Date.now() - s;
125
125
  if (d < 6e4) return "刚刚";
@@ -127,10 +127,10 @@ function wa(s) {
127
127
  if (d < 864e5) return `${Math.floor(d / 36e5)} 小时前`;
128
128
  const u = new Date(Date.now() - 864e5);
129
129
  if (new Date(s).toDateString() === u.toDateString()) return "昨天";
130
- const y = new Date(s);
131
- return `${y.getMonth() + 1}-${String(y.getDate()).padStart(2, "0")}`;
130
+ const f = new Date(s);
131
+ return `${f.getMonth() + 1}-${String(f.getDate()).padStart(2, "0")}`;
132
132
  }
133
- const St = [
133
+ const At = [
134
134
  "#2F70F1",
135
135
  "#52c41a",
136
136
  "#fa8c16",
@@ -140,42 +140,42 @@ const St = [
140
140
  "#f522d0",
141
141
  "#faad14"
142
142
  ];
143
- function At(s) {
143
+ function Bt(s) {
144
144
  let d = 0;
145
145
  for (let u = 0; u < s.length; u++) d = d * 31 + s.charCodeAt(u) | 0;
146
- return St[Math.abs(d) % St.length];
146
+ return At[Math.abs(d) % At.length];
147
147
  }
148
- function yt(s) {
148
+ function vt(s) {
149
149
  return s ? s.charAt(0).toUpperCase() : "?";
150
150
  }
151
- function Ia({ children: s }) {
152
- const d = j(null);
151
+ function La({ children: s }) {
152
+ const d = P(null);
153
153
  return /* @__PURE__ */ i("div", { className: c.mdPreWrap, children: [
154
- /* @__PURE__ */ e("div", { className: c.mdPreCopy, children: /* @__PURE__ */ e(Ct, { getText: () => {
154
+ /* @__PURE__ */ e("div", { className: c.mdPreCopy, children: /* @__PURE__ */ e(kt, { getText: () => {
155
155
  var u;
156
156
  return ((u = d.current) == null ? void 0 : u.textContent) ?? "";
157
157
  } }) }),
158
158
  /* @__PURE__ */ e("pre", { ref: d, children: s })
159
159
  ] });
160
160
  }
161
- function Sa({ text: s }) {
161
+ function Da({ text: s }) {
162
162
  return /* @__PURE__ */ e("div", { className: c.md, children: /* @__PURE__ */ e(
163
- Yn,
163
+ as,
164
164
  {
165
- remarkPlugins: [es],
166
- rehypePlugins: [Zn],
165
+ remarkPlugins: [is],
166
+ rehypePlugins: [ls],
167
167
  components: {
168
- pre: (d) => /* @__PURE__ */ e(Ia, { children: d.children })
168
+ pre: (d) => /* @__PURE__ */ e(La, { children: d.children })
169
169
  },
170
170
  children: s
171
171
  }
172
172
  ) });
173
173
  }
174
- function Aa({ startedAtMs: s }) {
174
+ function Ma({ startedAtMs: s }) {
175
175
  const [, d] = m(0);
176
- x(() => {
177
- const y = window.setInterval(() => d((w) => w + 1), 1e3);
178
- return () => window.clearInterval(y);
176
+ R(() => {
177
+ const f = window.setInterval(() => d((I) => I + 1), 1e3);
178
+ return () => window.clearInterval(f);
179
179
  }, []);
180
180
  const u = Math.max(1, Math.round((Date.now() - s) / 1e3));
181
181
  return /* @__PURE__ */ i("div", { className: c.msgMeta, children: [
@@ -183,7 +183,7 @@ function Aa({ startedAtMs: s }) {
183
183
  "s…"
184
184
  ] });
185
185
  }
186
- function Ba(s) {
186
+ function xa(s) {
187
187
  var d;
188
188
  if ((d = navigator.clipboard) != null && d.writeText)
189
189
  return navigator.clipboard.writeText(s).catch(() => {
@@ -191,214 +191,214 @@ function Ba(s) {
191
191
  try {
192
192
  const u = document.createElement("textarea");
193
193
  u.value = s, u.style.position = "fixed", u.style.opacity = "0", document.body.appendChild(u), u.select();
194
- const y = document.execCommand("copy");
195
- return document.body.removeChild(u), y;
194
+ const f = document.execCommand("copy");
195
+ return document.body.removeChild(u), f;
196
196
  } catch {
197
197
  return !1;
198
198
  }
199
199
  }
200
- function Ct({
200
+ function kt({
201
201
  getText: s,
202
202
  inline: d,
203
203
  label: u = "复制正文"
204
204
  }) {
205
- const [y, w] = m(!1);
205
+ const [f, I] = m(!1);
206
206
  return /* @__PURE__ */ e(
207
207
  "button",
208
208
  {
209
209
  type: "button",
210
- className: `${c.copyBtn} ${d ? c.copyBtnInline : ""} ${y ? c.copyBtnDone : ""}`,
210
+ className: `${c.copyBtn} ${d ? c.copyBtnInline : ""} ${f ? c.copyBtnDone : ""}`,
211
211
  onClick: () => {
212
- const b = s();
213
- !b || !Ba(b) || (w(!0), window.setTimeout(() => w(!1), 1600));
212
+ const A = s();
213
+ !A || !xa(A) || (I(!0), window.setTimeout(() => I(!1), 1600));
214
214
  },
215
215
  title: u,
216
216
  "aria-label": u,
217
- children: y ? /* @__PURE__ */ e(Ot, {}) : /* @__PURE__ */ e(ln, {})
217
+ children: f ? /* @__PURE__ */ e(Ht, {}) : /* @__PURE__ */ e(rn, {})
218
218
  }
219
219
  );
220
220
  }
221
- const Bt = [
221
+ const Lt = [
222
222
  "查看当前目录的文件列表",
223
223
  "总结当前目录里各文件的内容",
224
224
  "帮我写一个脚本统计各文件的行数",
225
225
  "说明一下你能使用哪些工具"
226
226
  ];
227
- function Xt({
227
+ function Zt({
228
228
  agent: s,
229
229
  newSessionTrigger: d = 0,
230
230
  autoSendDraft: u = null,
231
- onAutoSendConsumed: y,
232
- openSessionId: w = null,
233
- onOpenSessionConsumed: b
231
+ onAutoSendConsumed: f,
232
+ openSessionId: I = null,
233
+ onOpenSessionConsumed: A
234
234
  }) {
235
- var C;
236
- const I = Je((t) => t.currentUser), [A, $] = m([]), [D, O] = m(""), [H, M] = m(null), [k, J] = m(""), W = j(!1), ue = De(() => {
237
- const t = D.trim().toLowerCase();
238
- return t ? A.filter((o) => o.title.toLowerCase().includes(t)) : A;
239
- }, [A, D]), [B, Y] = m(
235
+ var k;
236
+ const y = Ye((t) => t.currentUser), x = Gt(), [$, S] = m([]), [W, q] = m(""), [O, L] = m(null), [C, se] = m(""), K = P(!1), ge = Me(() => {
237
+ const t = W.trim().toLowerCase();
238
+ return t ? $.filter((o) => o.title.toLowerCase().includes(t)) : $;
239
+ }, [$, W]), [B, M] = m(
240
240
  null
241
- ), [R, S] = m([]), [K, P] = m(""), [F, we] = m(!1), se = j(!1), T = j(null), [Z, _e] = m(null), G = j(null), fe = j(null), ye = j(null);
242
- x(() => {
241
+ ), [F, T] = m([]), [J, U] = m(""), [j, _e] = m(!1), w = P(!1), V = P(null), [Re, Ce] = m(null), G = P(null), fe = P(null), ye = P(null);
242
+ R(() => {
243
243
  ye.current = B;
244
244
  }, [B]);
245
- const Ce = j(/* @__PURE__ */ new Map()), ke = j(null), Ie = (t) => {
246
- se.current = t, we(t);
247
- }, [me, ve] = m(!1), [le, Pe] = m(""), [be, he] = m(!1), [Se, ie] = m(!1), [xe, pe] = m(""), [Ae, ee] = m(
245
+ const Ie = P(/* @__PURE__ */ new Map()), ve = P(null), Ee = (t) => {
246
+ w.current = t, _e(t);
247
+ }, [ee, Se] = m(!1), [ce, $e] = m(""), [ke, ue] = m(!1), [be, me] = m(!1), [Ae, Te] = m(""), [Be, Y] = m(
248
248
  () => localStorage.getItem("ft_local_session_collapsed") !== "false"
249
- ), [Re, Ve] = m(!0), [Fe, l] = m(!1), [f, U] = m(null), ce = j(null), z = j(null), je = j(null), Ee = j(null), We = j(!0), Ye = j(!1), te = j(null), Ge = V(
249
+ ), [je, Ge] = m(!0), [l, v] = m(!1), [H, pe] = m(null), he = P(null), ae = P(null), We = P(null), Oe = P(null), Ke = P(!0), Ze = P(!1), te = P(null), ze = z(
250
250
  (t, o) => {
251
251
  const a = te.current;
252
252
  if (a && a.sid === t) {
253
- a.messages = o(a.messages), ye.current === t && S(a.messages);
253
+ a.messages = o(a.messages), ye.current === t && T(a.messages);
254
254
  return;
255
255
  }
256
- S((_) => o(_));
256
+ T((_) => o(_));
257
257
  },
258
258
  []
259
- ), ge = F ? ((C = te.current) == null ? void 0 : C.sid) ?? null : null, ze = V(async () => {
259
+ ), oe = j ? ((k = te.current) == null ? void 0 : k.sid) ?? null : null, qe = z(async () => {
260
260
  try {
261
- const t = await Wt(s == null ? void 0 : s.localAgentId);
262
- return $(t), Ve(!0), t;
261
+ const t = await Kt(s == null ? void 0 : s.localAgentId);
262
+ return S(t), Ge(!0), t;
263
263
  } catch {
264
- return Ve(!1), $([]), [];
264
+ return Ge(!1), S([]), [];
265
265
  }
266
266
  }, [s == null ? void 0 : s.localAgentId]);
267
- x(() => {
268
- Y(null), S([]), O(""), ze().then((t) => {
267
+ R(() => {
268
+ M(null), T([]), q(""), qe().then((t) => {
269
269
  if (t.length > 0) {
270
270
  const o = [...t].sort(
271
271
  (a, _) => new Date(_.updatedAt).getTime() - new Date(a.updatedAt).getTime()
272
272
  )[0];
273
- Y(o.id);
273
+ M(o.id);
274
274
  }
275
275
  });
276
- }, [ze]), x(() => {
276
+ }, [qe]), R(() => {
277
277
  d > 0 && (async () => {
278
278
  try {
279
- const t = await gt(
279
+ const t = await _t(
280
280
  "新会话",
281
281
  s == null ? void 0 : s.localAgentId
282
282
  );
283
- $((o) => [t, ...o]), Y(t.id), S([]), O("");
283
+ S((o) => [t, ...o]), M(t.id), T([]), q("");
284
284
  } catch {
285
- ie(!0), pe("");
285
+ me(!0), Te("");
286
286
  }
287
287
  })();
288
288
  }, [d]);
289
- const Ze = j(!1);
290
- x(() => {
291
- !u || Ze.current || (Ze.current = !0, y == null || y(), Ue(u));
289
+ const et = P(!1);
290
+ R(() => {
291
+ !u || et.current || (et.current = !0, f == null || f(), Ve(u));
292
292
  }, []);
293
- const re = j(null);
294
- x(() => {
295
- !w || re.current === w || (re.current = w, Y(w), b == null || b());
296
- }, [w, b]), x(() => {
297
- const t = ke.current;
293
+ const re = P(null);
294
+ R(() => {
295
+ !I || re.current === I || (re.current = I, M(I), A == null || A());
296
+ }, [I, A]), R(() => {
297
+ const t = ve.current;
298
298
  if (t != null && t !== B) {
299
- Ce.current.set(t, K);
300
- const _ = Ce.current.get(B ?? "") ?? "";
301
- P(_), requestAnimationFrame(() => {
302
- const p = z.current;
303
- p && (p.style.height = "auto", p.style.height = Math.min(p.scrollHeight, 180) + "px");
299
+ Ie.current.set(t, J);
300
+ const _ = Ie.current.get(B ?? "") ?? "";
301
+ U(_), requestAnimationFrame(() => {
302
+ const h = ae.current;
303
+ h && (h.style.height = "auto", h.style.height = Math.min(h.scrollHeight, 180) + "px");
304
304
  });
305
305
  }
306
- if (ke.current = B, !B) {
307
- S([]);
306
+ if (ve.current = B, !B) {
307
+ T([]);
308
308
  return;
309
309
  }
310
310
  const o = te.current;
311
311
  if (o && o.sid === B) {
312
- if (We.current = !0, S(o.messages), o.messages.some((_) => _.streaming || _.error)) return;
312
+ if (Ke.current = !0, T(o.messages), o.messages.some((_) => _.streaming || _.error)) return;
313
313
  te.current = null;
314
314
  }
315
- if (Ye.current) {
316
- Ye.current = !1;
315
+ if (Ze.current) {
316
+ Ze.current = !1;
317
317
  return;
318
318
  }
319
319
  let a = !1;
320
- return ve(!0), Bn(B).then((_) => {
321
- a || S(It(_.messages));
320
+ return Se(!0), Mn(B).then((_) => {
321
+ a || T(St(_.messages));
322
322
  }).catch(() => {
323
- a || S([]);
323
+ a || T([]);
324
324
  }).finally(() => {
325
- a || ve(!1);
325
+ a || Se(!1);
326
326
  }), () => {
327
327
  a = !0;
328
328
  };
329
- }, [B]), x(() => {
330
- We.current && ce.current && (ce.current.scrollTop = ce.current.scrollHeight);
331
- }, [R]);
332
- const Ne = V(() => {
333
- const t = ce.current;
329
+ }, [B]), R(() => {
330
+ Ke.current && he.current && (he.current.scrollTop = he.current.scrollHeight);
331
+ }, [F]);
332
+ const Ne = z(() => {
333
+ const t = he.current;
334
334
  if (!t) return;
335
335
  const o = t.scrollHeight - t.scrollTop - t.clientHeight;
336
- We.current = o < 80, l(o > 120);
337
- }, []), q = V(() => {
338
- const t = ce.current;
339
- t && (t.scrollTop = t.scrollHeight), We.current = !0, l(!1);
336
+ Ke.current = o < 80, v(o > 120);
337
+ }, []), Q = z(() => {
338
+ const t = he.current;
339
+ t && (t.scrollTop = t.scrollHeight), Ke.current = !0, v(!1);
340
340
  }, []);
341
- x(() => {
341
+ R(() => {
342
342
  localStorage.setItem(
343
343
  "ft_local_session_collapsed",
344
- Ae ? "true" : "false"
344
+ Be ? "true" : "false"
345
345
  );
346
- }, [Ae]);
347
- const st = async () => {
348
- const t = xe.trim() || "新会话";
346
+ }, [Be]);
347
+ const at = async () => {
348
+ const t = Ae.trim() || "新会话";
349
349
  try {
350
- const o = await gt(t, s == null ? void 0 : s.localAgentId);
351
- $((a) => [o, ...a]), Y(o.id), S([]), ie(!1), pe(""), O("");
350
+ const o = await _t(t, s == null ? void 0 : s.localAgentId);
351
+ S((a) => [o, ...a]), M(o.id), T([]), me(!1), Te(""), q("");
352
352
  } catch {
353
353
  }
354
- }, et = (t) => {
355
- M(t.id), J(t.title), W.current = !1;
356
- }, Be = async () => {
357
- if (W.current) return;
358
- W.current = !0;
359
- const t = H, o = k.trim();
360
- if (M(null), !(!t || !o))
354
+ }, tt = (t) => {
355
+ L(t.id), se(t.title), K.current = !1;
356
+ }, Le = async () => {
357
+ if (K.current) return;
358
+ K.current = !0;
359
+ const t = O, o = C.trim();
360
+ if (L(null), !(!t || !o))
361
361
  try {
362
- await Dn(t, o), $(
362
+ await Rn(t, o), S(
363
363
  (a) => a.map((_) => _.id === t ? { ..._, title: o } : _)
364
364
  );
365
365
  } catch {
366
366
  }
367
- }, at = async (t) => {
367
+ }, lt = async (t) => {
368
368
  if (window.confirm("确定删除此会话吗?")) {
369
- se.current && Ee.current === t && Ke();
369
+ w.current && Oe.current === t && Ue();
370
370
  try {
371
- await Nn(t), $((o) => o.filter((a) => a.id !== t)), B === t && (Y(null), S([]));
371
+ await Tn(t), S((o) => o.filter((a) => a.id !== t)), B === t && (M(null), T([]));
372
372
  } catch {
373
373
  }
374
374
  }
375
- }, tt = V(
375
+ }, nt = z(
376
376
  (t, o, a, _) => {
377
- Ge(
377
+ ze(
378
378
  t,
379
- (p) => p.map((N) => {
379
+ (h) => h.map((N) => {
380
380
  if (N.id !== o) return N;
381
- const L = Date.now();
382
- let v = {};
383
- a === "thinking" && N.thinkingStartMs == null ? v = { thinkingStartMs: L } : a === "text" && N.thinkingStartMs != null && N.thinkingMs == null && (v = { thinkingMs: L - N.thinkingStartMs });
381
+ const D = Date.now();
382
+ let b = {};
383
+ a === "thinking" && N.thinkingStartMs == null ? b = { thinkingStartMs: D } : a === "text" && N.thinkingStartMs != null && N.thinkingMs == null && (b = { thinkingMs: D - N.thinkingStartMs });
384
384
  const E = [...N.blocks], ne = E[E.length - 1];
385
385
  return ne != null && (a === "text" && ne.type === "text" || a === "thinking" && ne.type === "thinking") && ne ? E[E.length - 1] = {
386
386
  ...ne,
387
387
  text: ne.text + _
388
- } : E.push({ type: a, text: _ }), { ...N, ...v, blocks: E };
388
+ } : E.push({ type: a, text: _ }), { ...N, ...b, blocks: E };
389
389
  })
390
390
  );
391
391
  },
392
- [Ge]
393
- ), ut = V(
392
+ [ze]
393
+ ), mt = z(
394
394
  (t, o, a) => {
395
- Ge(
395
+ ze(
396
396
  t,
397
- (_) => _.map((p) => {
398
- if (p.id !== o) return p;
399
- const N = Date.now(), L = p.thinkingStartMs != null && p.thinkingMs == null ? { thinkingMs: N - p.thinkingStartMs } : {}, v = [...p.blocks];
397
+ (_) => _.map((h) => {
398
+ if (h.id !== o) return h;
399
+ const N = Date.now(), D = h.thinkingStartMs != null && h.thinkingMs == null ? { thinkingMs: N - h.thinkingStartMs } : {}, b = [...h.blocks];
400
400
  if (a.kind === "tool_call")
401
- v.push({
401
+ b.push({
402
402
  type: "tool_call",
403
403
  id: a.id,
404
404
  name: a.name,
@@ -406,250 +406,250 @@ function Xt({
406
406
  _t0: N
407
407
  });
408
408
  else if (a.kind === "tool_end")
409
- for (let E = v.length - 1; E >= 0; E--) {
410
- const ne = v[E];
409
+ for (let E = b.length - 1; E >= 0; E--) {
410
+ const ne = b[E];
411
411
  if (ne.type === "tool_call" && a.id && ne.id === a.id) {
412
- v[E] = { ...ne, input: a.input };
412
+ b[E] = { ...ne, input: a.input };
413
413
  break;
414
414
  }
415
415
  }
416
- else a.kind === "tool_result" && v.push({
416
+ else a.kind === "tool_result" && b.push({
417
417
  type: "tool_result",
418
418
  id: a.id,
419
419
  content: a.content,
420
420
  _t1: N
421
421
  });
422
- return { ...p, ...L, blocks: v };
422
+ return { ...h, ...D, blocks: b };
423
423
  })
424
424
  );
425
425
  },
426
- [Ge]
427
- ), Ke = V(() => {
428
- var p;
429
- const t = Ee.current;
430
- Ee.current = null, (p = je.current) == null || p.abort(), je.current = null, Ie(!1), t && Ln(t).catch(() => {
426
+ [ze]
427
+ ), Ue = z(() => {
428
+ var h;
429
+ const t = Oe.current;
430
+ Oe.current = null, (h = We.current) == null || h.abort(), We.current = null, Ee(!1), t && xn(t).catch(() => {
431
431
  });
432
432
  const o = te.current;
433
433
  te.current = null;
434
434
  const a = (N) => N.map(
435
- (L) => L.streaming ? {
436
- ...L,
435
+ (D) => D.streaming ? {
436
+ ...D,
437
437
  streaming: !1,
438
438
  stopped: !0,
439
439
  // 停止回合也结算耗时(与 onComplete 一致),避免「已停止生成」缺耗时显示
440
- durationMs: L.startedAtMs != null ? Date.now() - L.startedAtMs : void 0
441
- } : L
440
+ durationMs: D.startedAtMs != null ? Date.now() - D.startedAtMs : void 0
441
+ } : D
442
442
  );
443
- o && t && o.sid === t ? ye.current === t && S(a(o.messages)) : S((N) => a(N));
443
+ o && t && o.sid === t ? ye.current === t && T(a(o.messages)) : T((N) => a(N));
444
444
  const _ = G.current;
445
- G.current = null, fe.current = null, _e(null), _ && P((N) => N ? N + `
445
+ G.current = null, fe.current = null, Ce(null), _ && U((N) => N ? N + `
446
446
  ` + _ : _);
447
447
  }, []);
448
- x(() => {
448
+ R(() => {
449
449
  const t = (o) => {
450
450
  if (o.key !== "Escape" || o.isComposing) return;
451
451
  const a = o.target;
452
- a && (a.tagName === "TEXTAREA" || a.tagName === "INPUT") || (F ? (o.preventDefault(), Ke()) : f != null && (o.preventDefault(), U(null), z.current && (z.current.style.height = "auto")));
452
+ a && (a.tagName === "TEXTAREA" || a.tagName === "INPUT") || (j ? (o.preventDefault(), Ue()) : H != null && (o.preventDefault(), pe(null), ae.current && (ae.current.style.height = "auto")));
453
453
  };
454
454
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
455
- }, [F, f, Ke]);
456
- const ae = async (t, o) => {
455
+ }, [j, H, Ue]);
456
+ const le = async (t, o) => {
457
457
  const a = o ?? B;
458
- if (!a || !t || se.current) return;
459
- T.current = null;
458
+ if (!a || !t || w.current) return;
459
+ V.current = null;
460
460
  const _ = {
461
461
  id: `local-user-${Date.now()}`,
462
462
  role: "user",
463
463
  blocks: [{ type: "text", text: t }]
464
- }, p = `local-assistant-${Date.now()}`, N = {
465
- id: p,
464
+ }, h = `local-assistant-${Date.now()}`, N = {
465
+ id: h,
466
466
  role: "assistant",
467
467
  blocks: [],
468
468
  streaming: !0,
469
469
  startedAtMs: Date.now()
470
470
  };
471
- S((v) => {
472
- const E = [...v, _, N];
471
+ T((b) => {
472
+ const E = [...b, _, N];
473
473
  return te.current = { sid: a, messages: E }, E;
474
- }), Ie(!0), Ee.current = a, We.current = !0;
475
- const L = new AbortController();
476
- je.current = L, await Mn(
474
+ }), Ee(!0), Oe.current = a, Ke.current = !0;
475
+ const D = new AbortController();
476
+ We.current = D, await En(
477
477
  a,
478
478
  t,
479
479
  {
480
- onToken: (v) => tt(a, p, "text", v),
481
- onReasoning: (v) => tt(a, p, "thinking", v),
482
- onEvent: (v) => ut(a, p, v),
483
- onFinal: (v) => {
484
- T.current = v;
480
+ onToken: (b) => nt(a, h, "text", b),
481
+ onReasoning: (b) => nt(a, h, "thinking", b),
482
+ onEvent: (b) => mt(a, h, b),
483
+ onFinal: (b) => {
484
+ V.current = b;
485
485
  },
486
- onError: (v) => {
487
- T.current = null, Ie(!1), je.current = null, Ee.current = null;
488
- const E = te.current, ne = (Te) => Te.map(
489
- (de) => de.id === p ? {
486
+ onError: (b) => {
487
+ V.current = null, Ee(!1), We.current = null, Oe.current = null;
488
+ const E = te.current, ne = (we) => we.map(
489
+ (de) => de.id === h ? {
490
490
  ...de,
491
491
  streaming: !1,
492
492
  // 出错回合也结算耗时(重发/重试前能看到该回合跑了多久)
493
493
  durationMs: de.startedAtMs != null ? Date.now() - de.startedAtMs : void 0,
494
- error: de.blocks.length ? v.message : `[错误] ${v.message}`
494
+ error: de.blocks.length ? b.message : `[错误] ${b.message}`
495
495
  } : de
496
496
  );
497
- E && E.sid === a ? (E.messages = ne(E.messages), ye.current === a && S(E.messages)) : S((Te) => ne(Te));
498
- const Le = G.current;
499
- G.current = null, fe.current = null, _e(null), Le && P((Te) => Te ? Te + `
500
- ` + Le : Le);
497
+ E && E.sid === a ? (E.messages = ne(E.messages), ye.current === a && T(E.messages)) : T((we) => ne(we));
498
+ const De = G.current;
499
+ G.current = null, fe.current = null, Ce(null), De && U((we) => we ? we + `
500
+ ` + De : De);
501
501
  },
502
502
  onComplete: () => {
503
- Ie(!1), je.current = null, Ee.current = null;
504
- const v = T.current;
505
- T.current = null;
503
+ Ee(!1), We.current = null, Oe.current = null;
504
+ const b = V.current;
505
+ V.current = null;
506
506
  const E = te.current;
507
507
  te.current = null;
508
508
  const ne = (de) => de.map(
509
- ($e) => $e.id === p ? {
510
- ...$e,
509
+ (He) => He.id === h ? {
510
+ ...He,
511
511
  streaming: !1,
512
- durationMs: (v == null ? void 0 : v.totalMs) ?? ($e.startedAtMs != null ? Date.now() - $e.startedAtMs : void 0),
513
- totalMs: (v == null ? void 0 : v.totalMs) ?? $e.totalMs,
514
- stopped: $e.stopped || (v == null ? void 0 : v.stopped) === !0,
515
- usage: $e.usage ?? (v == null ? void 0 : v.usage)
516
- } : $e
512
+ durationMs: (b == null ? void 0 : b.totalMs) ?? (He.startedAtMs != null ? Date.now() - He.startedAtMs : void 0),
513
+ totalMs: (b == null ? void 0 : b.totalMs) ?? He.totalMs,
514
+ stopped: He.stopped || (b == null ? void 0 : b.stopped) === !0,
515
+ usage: He.usage ?? (b == null ? void 0 : b.usage)
516
+ } : He
517
517
  );
518
- E && E.sid === a ? ye.current === a && S(ne(E.messages)) : S((de) => ne(de));
519
- const Le = G.current, Te = fe.current;
520
- G.current = null, fe.current = null, _e(null), Le && (Te && ye.current === Te ? ae(Le, Te) : P((de) => de ? de + `
521
- ` + Le : Le));
518
+ E && E.sid === a ? ye.current === a && T(ne(E.messages)) : T((de) => ne(de));
519
+ const De = G.current, we = fe.current;
520
+ G.current = null, fe.current = null, Ce(null), De && (we && ye.current === we ? le(De, we) : U((de) => de ? de + `
521
+ ` + De : De));
522
522
  }
523
523
  },
524
524
  {
525
525
  agentType: s == null ? void 0 : s.localAgentType,
526
526
  agentId: s == null ? void 0 : s.localAgentId,
527
- signal: L.signal
527
+ signal: D.signal
528
528
  }
529
529
  );
530
- }, qe = async (t, o) => {
530
+ }, Qe = async (t, o) => {
531
531
  if (B)
532
532
  try {
533
- const { session: a, previousId: _ } = await xn(
533
+ const { session: a, previousId: _ } = await $n(
534
534
  B,
535
535
  t
536
536
  );
537
- Ye.current = !0, $(
538
- (p) => p.map((N) => N.id === _ ? a : N)
539
- ), Y(a.id), S(It(a.messages)), await ae(o, a.id);
537
+ Ze.current = !0, S(
538
+ (h) => h.map((N) => N.id === _ ? a : N)
539
+ ), M(a.id), T(St(a.messages)), await le(o, a.id);
540
540
  } catch {
541
- await ae(o);
541
+ await le(o);
542
542
  }
543
- }, lt = (t, o) => {
544
- F || (P(o), U(t), requestAnimationFrame(() => {
545
- const a = z.current;
543
+ }, it = (t, o) => {
544
+ j || (U(o), pe(t), requestAnimationFrame(() => {
545
+ const a = ae.current;
546
546
  a && (a.focus(), a.style.height = "auto", a.style.height = Math.min(a.scrollHeight, 180) + "px");
547
547
  }));
548
- }, it = () => {
549
- U(null), z.current && (z.current.style.height = "auto");
550
- }, mt = () => {
548
+ }, ct = () => {
549
+ pe(null), ae.current && (ae.current.style.height = "auto");
550
+ }, pt = () => {
551
551
  const t = G.current;
552
- G.current = null, _e(null), t && P((o) => o ? o + `
552
+ G.current = null, Ce(null), t && U((o) => o ? o + `
553
553
  ` + t : t);
554
- }, Ue = async (t) => {
555
- const o = (t ?? le).trim();
556
- if (!(!o || be || se.current)) {
557
- he(!0);
554
+ }, Ve = async (t) => {
555
+ const o = (t ?? ce).trim();
556
+ if (!(!o || ke || w.current)) {
557
+ ue(!0);
558
558
  try {
559
- const a = /* @__PURE__ */ new Date(), _ = (L) => String(L).padStart(2, "0"), p = `${_(a.getMonth() + 1)}${_(a.getDate())} ${_(
559
+ const a = /* @__PURE__ */ new Date(), _ = (D) => String(D).padStart(2, "0"), h = `${_(a.getMonth() + 1)}${_(a.getDate())} ${_(
560
560
  a.getHours()
561
- )}:${_(a.getMinutes())}`, N = await gt(p, s == null ? void 0 : s.localAgentId);
562
- $((L) => [N, ...L]), Y(N.id), S([]), Pe(""), await ae(o, N.id);
561
+ )}:${_(a.getMinutes())}`, N = await _t(h, s == null ? void 0 : s.localAgentId);
562
+ S((D) => [N, ...D]), M(N.id), T([]), $e(""), await le(o, N.id);
563
563
  } catch {
564
564
  } finally {
565
- he(!1);
565
+ ue(!1);
566
566
  }
567
567
  }
568
- }, Qe = () => {
569
- const t = K.trim();
568
+ }, Xe = () => {
569
+ const t = J.trim();
570
570
  if (t) {
571
- if (F) {
571
+ if (j) {
572
572
  G.current = G.current ? G.current + `
573
- ` + t : t, fe.current = B, _e(G.current), P(""), Ce.current.delete(B ?? ""), z.current && (z.current.style.height = "auto");
573
+ ` + t : t, fe.current = B, Ce(G.current), U(""), Ie.current.delete(B ?? ""), ae.current && (ae.current.style.height = "auto");
574
574
  return;
575
575
  }
576
- if (P(""), Ce.current.delete(B ?? ""), z.current && (z.current.style.height = "auto"), f != null) {
577
- const o = f;
578
- U(null), qe(o, t);
576
+ if (U(""), Ie.current.delete(B ?? ""), ae.current && (ae.current.style.height = "auto"), H != null) {
577
+ const o = H;
578
+ pe(null), Qe(o, t);
579
579
  return;
580
580
  }
581
- ae(t);
581
+ le(t);
582
582
  }
583
583
  }, ht = (t) => {
584
- t.key === "Enter" && !t.shiftKey && !t.nativeEvent.isComposing && (t.preventDefault(), Qe()), t.key === "Escape" && (F ? Ke() : f != null && it());
585
- }, pt = (t) => {
586
- P(t.target.value);
584
+ zt(t, x.sendKey) && !t.nativeEvent.isComposing && (t.preventDefault(), Xe()), t.key === "Escape" && (j ? Ue() : H != null && ct());
585
+ }, gt = (t) => {
586
+ U(t.target.value);
587
587
  const o = t.target;
588
588
  o.style.height = "auto", o.style.height = Math.min(o.scrollHeight, 180) + "px";
589
- }, oe = At("local-default");
590
- At(
591
- (I == null ? void 0 : I.username) || (I == null ? void 0 : I.display_name) || "user"
589
+ }, ie = Bt("local-default");
590
+ Bt(
591
+ (y == null ? void 0 : y.username) || (y == null ? void 0 : y.display_name) || "user"
592
592
  );
593
593
  const n = (t) => {
594
594
  const o = /* @__PURE__ */ new Map();
595
- for (const p of t.blocks)
596
- p.type === "tool_result" && p.id && o.set(p.id, p);
595
+ for (const h of t.blocks)
596
+ h.type === "tool_result" && h.id && o.set(h.id, h);
597
597
  const a = /* @__PURE__ */ new Set();
598
- for (const p of t.blocks)
599
- p.type === "tool_call" && p.id && o.has(p.id) && a.add(p.id);
598
+ for (const h of t.blocks)
599
+ h.type === "tool_call" && h.id && o.has(h.id) && a.add(h.id);
600
600
  const _ = [];
601
- return t.blocks.forEach((p, N) => {
602
- if (p.type === "thinking")
601
+ return t.blocks.forEach((h, N) => {
602
+ if (h.type === "thinking")
603
603
  _.push(
604
604
  /* @__PURE__ */ e(
605
- ts,
605
+ es,
606
606
  {
607
- text: p.text,
607
+ text: h.text,
608
608
  streaming: !!t.streaming,
609
609
  startedAtMs: t.thinkingStartMs,
610
- durationMs: t.thinkingMs ?? p.durationMs
610
+ durationMs: t.thinkingMs ?? h.durationMs
611
611
  },
612
612
  N
613
613
  )
614
614
  );
615
- else if (p.type === "tool_call") {
616
- const L = p.id ? o.get(p.id) : void 0, v = p._t0 != null && (L == null ? void 0 : L._t1) != null ? Math.max(1, L._t1 - p._t0) : p.durationMs;
615
+ else if (h.type === "tool_call") {
616
+ const D = h.id ? o.get(h.id) : void 0, b = h._t0 != null && (D == null ? void 0 : D._t1) != null ? Math.max(1, D._t1 - h._t0) : h.durationMs;
617
617
  _.push(
618
618
  /* @__PURE__ */ e(
619
- ns,
619
+ ts,
620
620
  {
621
- call: p,
622
- result: L,
623
- running: !!t.streaming && L === void 0,
624
- durationMs: v,
625
- startedAtMs: p._t0
621
+ call: h,
622
+ result: D,
623
+ running: !!t.streaming && D === void 0,
624
+ durationMs: b,
625
+ startedAtMs: h._t0
626
626
  },
627
627
  N
628
628
  )
629
629
  );
630
- } else if (p.type === "tool_result") {
631
- if (p.id && a.has(p.id)) return;
630
+ } else if (h.type === "tool_result") {
631
+ if (h.id && a.has(h.id)) return;
632
632
  _.push(
633
633
  /* @__PURE__ */ e("div", { className: c.toolItem, children: /* @__PURE__ */ i("div", { className: c.toolBody, children: [
634
634
  /* @__PURE__ */ e("div", { className: c.toolSectionLabel, children: "工具结果" }),
635
- /* @__PURE__ */ e("pre", { className: c.toolPre, children: p.content || "(空)" })
635
+ /* @__PURE__ */ e("pre", { className: c.toolPre, children: h.content || "(空)" })
636
636
  ] }) }, N)
637
637
  );
638
- } else p.type === "text" && p.text && _.push(/* @__PURE__ */ e(Sa, { text: p.text }, N));
638
+ } else h.type === "text" && h.text && _.push(/* @__PURE__ */ e(Da, { text: h.text }, N));
639
639
  }), _;
640
640
  };
641
- if (!Re)
641
+ if (!je)
642
642
  return /* @__PURE__ */ e("div", { className: c.container, children: /* @__PURE__ */ e("div", { className: c.chatPanel, children: /* @__PURE__ */ e("div", { className: c.chatEmpty, children: "本地 Agent 未启动,请检查桌面端是否正常运行" }) }) });
643
- const g = A.find((t) => t.id === B);
643
+ const g = $.find((t) => t.id === B);
644
644
  return /* @__PURE__ */ i("div", { className: c.container, children: [
645
- Ae ? /* @__PURE__ */ e(
645
+ Be ? /* @__PURE__ */ e(
646
646
  "button",
647
647
  {
648
648
  type: "button",
649
649
  className: c.sessionExpandBtn,
650
- onClick: () => ee(!1),
650
+ onClick: () => Y(!1),
651
651
  title: "展开会话列表",
652
- children: /* @__PURE__ */ e($t, {})
652
+ children: /* @__PURE__ */ e(Ot, {})
653
653
  }
654
654
  ) : /* @__PURE__ */ i("div", { className: c.sessionPanel, children: [
655
655
  /* @__PURE__ */ i("div", { className: c.sessionHeader, children: [
@@ -661,10 +661,10 @@ function Xt({
661
661
  type: "button",
662
662
  className: c.sessionBtnSm,
663
663
  onClick: () => {
664
- ie(!0), pe("");
664
+ me(!0), Te("");
665
665
  },
666
666
  title: "新建会话",
667
- children: /* @__PURE__ */ e(Zt, {})
667
+ children: /* @__PURE__ */ e(nn, {})
668
668
  }
669
669
  ),
670
670
  /* @__PURE__ */ e(
@@ -672,9 +672,9 @@ function Xt({
672
672
  {
673
673
  type: "button",
674
674
  className: c.sessionBtnSm,
675
- onClick: () => ee(!0),
675
+ onClick: () => Y(!0),
676
676
  title: "收起会话列表",
677
- children: /* @__PURE__ */ e(en, {})
677
+ children: /* @__PURE__ */ e(sn, {})
678
678
  }
679
679
  )
680
680
  ] })
@@ -686,34 +686,34 @@ function Xt({
686
686
  className: c.sessionSearchInput,
687
687
  type: "text",
688
688
  placeholder: "搜索会话",
689
- value: D,
690
- onChange: (t) => O(t.target.value)
689
+ value: W,
690
+ onChange: (t) => q(t.target.value)
691
691
  }
692
692
  ),
693
- D && /* @__PURE__ */ e(
693
+ W && /* @__PURE__ */ e(
694
694
  "button",
695
695
  {
696
696
  type: "button",
697
697
  className: c.sessionSearchClear,
698
- onClick: () => O(""),
698
+ onClick: () => q(""),
699
699
  title: "清除搜索",
700
700
  children: "✕"
701
701
  }
702
702
  )
703
703
  ] }),
704
704
  /* @__PURE__ */ i("div", { className: c.sessionList, children: [
705
- Se && /* @__PURE__ */ i("div", { className: c.sessionCreateRow, children: [
705
+ be && /* @__PURE__ */ i("div", { className: c.sessionCreateRow, children: [
706
706
  /* @__PURE__ */ e(
707
707
  "input",
708
708
  {
709
709
  className: c.sessionCreateInput,
710
710
  type: "text",
711
711
  placeholder: "输入会话名称",
712
- value: xe,
712
+ value: Ae,
713
713
  autoFocus: !0,
714
- onChange: (t) => pe(t.target.value),
714
+ onChange: (t) => Te(t.target.value),
715
715
  onKeyDown: (t) => {
716
- t.key === "Enter" && st(), t.key === "Escape" && (ie(!1), pe(""));
716
+ t.key === "Enter" && at(), t.key === "Escape" && (me(!1), Te(""));
717
717
  }
718
718
  }
719
719
  ),
@@ -722,9 +722,9 @@ function Xt({
722
722
  {
723
723
  type: "button",
724
724
  className: c.sessionCreateConfirm,
725
- onClick: () => void st(),
725
+ onClick: () => void at(),
726
726
  title: "确认创建",
727
- children: /* @__PURE__ */ e(Ot, {})
727
+ children: /* @__PURE__ */ e(Ht, {})
728
728
  }
729
729
  ),
730
730
  /* @__PURE__ */ e(
@@ -733,49 +733,49 @@ function Xt({
733
733
  type: "button",
734
734
  className: c.sessionCreateCancel,
735
735
  onClick: () => {
736
- ie(!1), pe("");
736
+ me(!1), Te("");
737
737
  },
738
738
  title: "取消",
739
739
  children: "✕"
740
740
  }
741
741
  )
742
742
  ] }),
743
- A.length === 0 && !Se ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
743
+ $.length === 0 && !be ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
744
744
  /* @__PURE__ */ e("span", { children: "暂无会话" }),
745
745
  /* @__PURE__ */ e("span", { children: "点击「+」开始聊天" })
746
- ] }) : ue.length === 0 ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
746
+ ] }) : ge.length === 0 ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
747
747
  /* @__PURE__ */ e("span", { children: "无匹配会话" }),
748
748
  /* @__PURE__ */ e("span", { children: "换个关键词试试" })
749
- ] }) : ue.map((t) => /* @__PURE__ */ i(
749
+ ] }) : ge.map((t) => /* @__PURE__ */ i(
750
750
  "div",
751
751
  {
752
752
  className: `${c.sessionItem} ${B === t.id ? c.sessionItemActive : ""}`,
753
- onClick: () => Y(t.id),
753
+ onClick: () => M(t.id),
754
754
  children: [
755
- H === t.id ? /* @__PURE__ */ e(
755
+ O === t.id ? /* @__PURE__ */ e(
756
756
  "input",
757
757
  {
758
758
  className: c.sessionRenameInput,
759
759
  type: "text",
760
- value: k,
760
+ value: C,
761
761
  autoFocus: !0,
762
762
  onFocus: (o) => o.currentTarget.select(),
763
763
  onClick: (o) => o.stopPropagation(),
764
- onChange: (o) => J(o.target.value),
764
+ onChange: (o) => se(o.target.value),
765
765
  onKeyDown: (o) => {
766
- o.key === "Enter" && Be(), o.key === "Escape" && (W.current = !0, M(null));
766
+ o.key === "Enter" && Le(), o.key === "Escape" && (K.current = !0, L(null));
767
767
  },
768
- onBlur: () => void Be()
768
+ onBlur: () => void Le()
769
769
  }
770
770
  ) : /* @__PURE__ */ i(
771
771
  "span",
772
772
  {
773
773
  className: c.sessionItemTitle,
774
774
  title: t.title,
775
- onDoubleClick: () => et(t),
775
+ onDoubleClick: () => tt(t),
776
776
  children: [
777
- t.id === ge && /* @__PURE__ */ e(
778
- kt,
777
+ t.id === oe && /* @__PURE__ */ e(
778
+ Tt,
779
779
  {
780
780
  spin: !0,
781
781
  className: c.sessionLiveDot
@@ -785,17 +785,17 @@ function Xt({
785
785
  ]
786
786
  }
787
787
  ),
788
- H !== t.id && /* @__PURE__ */ e("span", { className: c.sessionItemTime, children: wa(t.updatedAt) }),
788
+ O !== t.id && /* @__PURE__ */ e("span", { className: c.sessionItemTime, children: Ba(t.updatedAt) }),
789
789
  /* @__PURE__ */ e(
790
790
  "button",
791
791
  {
792
792
  type: "button",
793
793
  className: c.sessionRenameBtn,
794
794
  onClick: (o) => {
795
- o.stopPropagation(), et(t);
795
+ o.stopPropagation(), tt(t);
796
796
  },
797
797
  title: "重命名会话",
798
- children: /* @__PURE__ */ e(Tt, {})
798
+ children: /* @__PURE__ */ e(wt, {})
799
799
  }
800
800
  ),
801
801
  /* @__PURE__ */ e(
@@ -804,10 +804,10 @@ function Xt({
804
804
  type: "button",
805
805
  className: c.sessionDeleteBtn,
806
806
  onClick: (o) => {
807
- o.stopPropagation(), at(t.id);
807
+ o.stopPropagation(), lt(t.id);
808
808
  },
809
809
  title: "删除会话",
810
- children: /* @__PURE__ */ e(tn, {})
810
+ children: /* @__PURE__ */ e(an, {})
811
811
  }
812
812
  )
813
813
  ]
@@ -822,8 +822,8 @@ function Xt({
822
822
  "div",
823
823
  {
824
824
  className: c.agentAvatar,
825
- style: { backgroundColor: oe },
826
- children: yt((s == null ? void 0 : s.displayName) || "本地 Agent")
825
+ style: { backgroundColor: ie },
826
+ children: vt((s == null ? void 0 : s.displayName) || "本地 Agent")
827
827
  }
828
828
  ),
829
829
  /* @__PURE__ */ i("div", { className: c.chatHeaderMeta, children: [
@@ -831,25 +831,25 @@ function Xt({
831
831
  g && /* @__PURE__ */ e("span", { className: c.chatHeaderSession, children: g.title })
832
832
  ] }),
833
833
  /* @__PURE__ */ e("span", { className: c.chatHeaderBadge, children: (s == null ? void 0 : s.localAgentType) === "jar" ? "内置模型" : s == null ? void 0 : s.localAgentType }),
834
- F && /* @__PURE__ */ i("span", { className: c.streamingIndicator, children: [
835
- /* @__PURE__ */ e(kt, {}),
834
+ j && /* @__PURE__ */ i("span", { className: c.streamingIndicator, children: [
835
+ /* @__PURE__ */ e(Tt, {}),
836
836
  " 工作中…"
837
837
  ] })
838
838
  ] }),
839
- B ? /* @__PURE__ */ i(Me, { children: [
839
+ B ? /* @__PURE__ */ i(xe, { children: [
840
840
  /* @__PURE__ */ e(
841
841
  "div",
842
842
  {
843
843
  className: c.threadScroll,
844
- ref: ce,
844
+ ref: he,
845
845
  onScroll: Ne,
846
- children: /* @__PURE__ */ e("div", { className: c.threadInner, children: me && R.length === 0 ? /* @__PURE__ */ e("div", { className: c.chatEmpty, children: "加载中…" }) : R.length === 0 ? /* @__PURE__ */ i("div", { className: c.landing, children: [
846
+ children: /* @__PURE__ */ e("div", { className: c.threadInner, children: ee && F.length === 0 ? /* @__PURE__ */ e("div", { className: c.chatEmpty, children: "加载中…" }) : F.length === 0 ? /* @__PURE__ */ i("div", { className: c.landing, children: [
847
847
  /* @__PURE__ */ e(
848
848
  "div",
849
849
  {
850
850
  className: c.landingLogo,
851
- style: { backgroundColor: oe },
852
- children: yt((s == null ? void 0 : s.displayName) || "本地 Agent")
851
+ style: { backgroundColor: ie },
852
+ children: vt((s == null ? void 0 : s.displayName) || "本地 Agent")
853
853
  }
854
854
  ),
855
855
  /* @__PURE__ */ i("div", { className: c.landingTitle, children: [
@@ -858,26 +858,26 @@ function Xt({
858
858
  " 协作"
859
859
  ] }),
860
860
  /* @__PURE__ */ e("div", { className: c.landingHint, children: "思考过程与工具调用实时可见 · Enter 发送 · Esc 停止" }),
861
- /* @__PURE__ */ e("div", { className: c.landingChips, children: Bt.map((t) => /* @__PURE__ */ e(
861
+ /* @__PURE__ */ e("div", { className: c.landingChips, children: Lt.map((t) => /* @__PURE__ */ e(
862
862
  "button",
863
863
  {
864
864
  type: "button",
865
865
  className: c.landingChip,
866
- onClick: () => void ae(t),
866
+ onClick: () => void le(t),
867
867
  children: t
868
868
  },
869
869
  t
870
870
  )) })
871
- ] }) : R.map(
871
+ ] }) : F.map(
872
872
  (t, o) => t.role === "user" ? /* @__PURE__ */ i("div", { className: c.userRow, children: [
873
- /* @__PURE__ */ e("div", { className: c.userBubble, children: Xe(t.blocks) }),
874
- !F && /* @__PURE__ */ i("div", { className: c.userActions, children: [
873
+ /* @__PURE__ */ e("div", { className: c.userBubble, children: Je(t.blocks) }),
874
+ !j && /* @__PURE__ */ i("div", { className: c.userActions, children: [
875
875
  /* @__PURE__ */ e(
876
- Ct,
876
+ kt,
877
877
  {
878
878
  inline: !0,
879
879
  label: "复制",
880
- getText: () => Xe(t.blocks)
880
+ getText: () => Je(t.blocks)
881
881
  }
882
882
  ),
883
883
  /* @__PURE__ */ e(
@@ -887,8 +887,8 @@ function Xt({
887
887
  className: c.userActionBtn,
888
888
  title: "编辑重发(其后内容将被截断)",
889
889
  "aria-label": "编辑重发",
890
- onClick: () => lt(o, Xe(t.blocks)),
891
- children: /* @__PURE__ */ e(Tt, {})
890
+ onClick: () => it(o, Je(t.blocks)),
891
+ children: /* @__PURE__ */ e(wt, {})
892
892
  }
893
893
  ),
894
894
  /* @__PURE__ */ e(
@@ -898,17 +898,17 @@ function Xt({
898
898
  className: c.userActionBtn,
899
899
  title: "重发(截断后原样重发)",
900
900
  "aria-label": "重发",
901
- onClick: () => void qe(
901
+ onClick: () => void Qe(
902
902
  o,
903
- Xe(t.blocks)
903
+ Je(t.blocks)
904
904
  ),
905
- children: /* @__PURE__ */ e(nn, {})
905
+ children: /* @__PURE__ */ e(ln, {})
906
906
  }
907
907
  )
908
908
  ] })
909
909
  ] }, t.id) : /* @__PURE__ */ i("div", { className: c.assistantBlock, children: [
910
910
  n(t),
911
- t.streaming && t.startedAtMs != null && /* @__PURE__ */ e(Aa, { startedAtMs: t.startedAtMs }),
911
+ t.streaming && t.startedAtMs != null && /* @__PURE__ */ e(Ma, { startedAtMs: t.startedAtMs }),
912
912
  t.streaming && t.blocks.every(
913
913
  (a) => a.type !== "tool_call" && a.type !== "thinking"
914
914
  ) && /* @__PURE__ */ e("span", { className: c.caretCursor }),
@@ -916,20 +916,20 @@ function Xt({
916
916
  ((t.durationMs ?? t.totalMs) / 1e3).toFixed(1),
917
917
  "s",
918
918
  (() => {
919
- var N, L;
920
- const a = ((N = t.usage) == null ? void 0 : N.inputTokens) ?? 0, _ = ((L = t.usage) == null ? void 0 : L.outputTokens) ?? 0, p = a + _;
921
- return p > 0 ? ` · ${Ta(p)} tokens` : "";
919
+ var N, D;
920
+ const a = ((N = t.usage) == null ? void 0 : N.inputTokens) ?? 0, _ = ((D = t.usage) == null ? void 0 : D.outputTokens) ?? 0, h = a + _;
921
+ return h > 0 ? ` · ${Aa(h)} tokens` : "";
922
922
  })()
923
923
  ] }),
924
924
  !t.streaming && /* @__PURE__ */ e(
925
- Ct,
925
+ kt,
926
926
  {
927
- getText: () => Xe(t.blocks)
927
+ getText: () => Je(t.blocks)
928
928
  }
929
929
  ),
930
930
  t.error && /* @__PURE__ */ i("div", { className: c.errorBar, children: [
931
931
  t.error,
932
- !F && f == null && /* @__PURE__ */ e(
932
+ !j && H == null && /* @__PURE__ */ e(
933
933
  "button",
934
934
  {
935
935
  type: "button",
@@ -937,11 +937,11 @@ function Xt({
937
937
  title: "重试:重发上一条用户消息(其后内容截断)",
938
938
  onClick: () => {
939
939
  let a = o - 1;
940
- for (; a >= 0 && R[a].role !== "user"; )
940
+ for (; a >= 0 && F[a].role !== "user"; )
941
941
  a--;
942
- a >= 0 && qe(
942
+ a >= 0 && Qe(
943
943
  a,
944
- Xe(R[a].blocks)
944
+ Je(F[a].blocks)
945
945
  );
946
946
  },
947
947
  children: "重试"
@@ -957,32 +957,32 @@ function Xt({
957
957
  "button",
958
958
  {
959
959
  type: "button",
960
- className: `${c.scrollTopBtn} ${Fe ? c.scrollTopBtnVisible : ""}`,
961
- onClick: q,
960
+ className: `${c.scrollTopBtn} ${l ? c.scrollTopBtnVisible : ""}`,
961
+ onClick: Q,
962
962
  title: "回到最新消息",
963
963
  "aria-label": "回到最新消息",
964
- children: /* @__PURE__ */ e(sn, {})
964
+ children: /* @__PURE__ */ e(cn, {})
965
965
  }
966
966
  ),
967
967
  /* @__PURE__ */ i("div", { className: c.composerWrap, children: [
968
- f != null && /* @__PURE__ */ i("div", { className: c.editingBar, children: [
968
+ H != null && /* @__PURE__ */ i("div", { className: c.editingBar, children: [
969
969
  /* @__PURE__ */ e("span", { children: "正在编辑历史消息:发送后其后内容将被丢弃,并以全新上下文重发" }),
970
970
  /* @__PURE__ */ e(
971
971
  "button",
972
972
  {
973
973
  type: "button",
974
974
  className: c.editingCancel,
975
- onClick: it,
975
+ onClick: ct,
976
976
  title: "取消编辑",
977
977
  children: "取消"
978
978
  }
979
979
  )
980
980
  ] }),
981
- Z != null && /* @__PURE__ */ i("div", { className: c.pendingBar, children: [
981
+ Re != null && /* @__PURE__ */ i("div", { className: c.pendingBar, children: [
982
982
  /* @__PURE__ */ i("span", { children: [
983
983
  "已排队:「",
984
- Z.slice(0, 30),
985
- Z.length > 30 ? "…" : "",
984
+ Re.slice(0, 30),
985
+ Re.length > 30 ? "…" : "",
986
986
  "」生成结束后自动发送"
987
987
  ] }),
988
988
  /* @__PURE__ */ e(
@@ -990,7 +990,7 @@ function Xt({
990
990
  {
991
991
  type: "button",
992
992
  className: c.editingCancel,
993
- onClick: mt,
993
+ onClick: pt,
994
994
  title: "取消排队消息(回填输入框)",
995
995
  children: "取消"
996
996
  }
@@ -1000,49 +1000,49 @@ function Xt({
1000
1000
  /* @__PURE__ */ e(
1001
1001
  "textarea",
1002
1002
  {
1003
- ref: z,
1003
+ ref: ae,
1004
1004
  className: c.composerInput,
1005
- placeholder: F ? B === ge ? "正在工作中…(Esc 停止)" : "后台回合进行中,输入将排队发送" : "向 Agent 发消息,Enter 发送,Shift+Enter 换行",
1006
- value: K,
1007
- onChange: pt,
1005
+ placeholder: j ? B === oe ? "正在工作中…(Esc 停止)" : "后台回合进行中,输入将排队发送" : "向 Agent 发消息,Enter 发送,Shift+Enter 换行",
1006
+ value: J,
1007
+ onChange: gt,
1008
1008
  onKeyDown: ht,
1009
1009
  rows: 1
1010
1010
  }
1011
1011
  ),
1012
- F ? /* @__PURE__ */ e(
1012
+ j ? /* @__PURE__ */ e(
1013
1013
  "button",
1014
1014
  {
1015
1015
  type: "button",
1016
1016
  className: c.stopBtn,
1017
- onClick: Ke,
1017
+ onClick: Ue,
1018
1018
  title: "停止生成(Esc)",
1019
1019
  "aria-label": "停止生成",
1020
- children: /* @__PURE__ */ e(an, {})
1020
+ children: /* @__PURE__ */ e(on, {})
1021
1021
  }
1022
1022
  ) : /* @__PURE__ */ e(
1023
1023
  "button",
1024
1024
  {
1025
1025
  type: "button",
1026
- className: `${c.sendBtn} ${K.trim() ? c.sendBtnReady : ""}`,
1027
- disabled: !K.trim(),
1028
- onClick: Qe,
1026
+ className: `${c.sendBtn} ${J.trim() ? c.sendBtnReady : ""}`,
1027
+ disabled: !J.trim(),
1028
+ onClick: Xe,
1029
1029
  title: "发送",
1030
1030
  "aria-label": "发送",
1031
- children: /* @__PURE__ */ e(wt, {})
1031
+ children: /* @__PURE__ */ e(It, {})
1032
1032
  }
1033
1033
  )
1034
1034
  ] }),
1035
- /* @__PURE__ */ e("div", { className: c.composerHint, children: F ? "Agent 正在工作中,可按 Esc 或点击停止按钮中断" : "Enter 发送 · Shift+Enter 换行 · 思考与工具调用自动展示" })
1035
+ /* @__PURE__ */ e("div", { className: c.composerHint, children: j ? "Agent 正在工作中,可按 Esc 或点击停止按钮中断" : "Enter 发送 · Shift+Enter 换行 · 思考与工具调用自动展示" })
1036
1036
  ] })
1037
- ] }) : A.length === 0 ? (
1037
+ ] }) : $.length === 0 ? (
1038
1038
  /* 无会话:居中大输入框,发送自动建会话(时间戳命名) */
1039
1039
  /* @__PURE__ */ i("div", { className: c.newChatLanding, children: [
1040
1040
  /* @__PURE__ */ e(
1041
1041
  "div",
1042
1042
  {
1043
1043
  className: c.landingLogo,
1044
- style: { backgroundColor: oe },
1045
- children: yt((s == null ? void 0 : s.displayName) || "本地 Agent")
1044
+ style: { backgroundColor: ie },
1045
+ children: vt((s == null ? void 0 : s.displayName) || "本地 Agent")
1046
1046
  }
1047
1047
  ),
1048
1048
  /* @__PURE__ */ i("div", { className: c.landingTitle, children: [
@@ -1057,11 +1057,11 @@ function Xt({
1057
1057
  {
1058
1058
  className: c.landingInput,
1059
1059
  placeholder: "描述你的任务,发送后自动创建会话…",
1060
- value: le,
1060
+ value: ce,
1061
1061
  autoFocus: !0,
1062
- onChange: (t) => Pe(t.target.value),
1062
+ onChange: (t) => $e(t.target.value),
1063
1063
  onKeyDown: (t) => {
1064
- t.key === "Enter" && !t.shiftKey && !t.nativeEvent.isComposing && (t.preventDefault(), Ue());
1064
+ t.key === "Enter" && !t.shiftKey && !t.nativeEvent.isComposing && (t.preventDefault(), Ve());
1065
1065
  },
1066
1066
  rows: 3
1067
1067
  }
@@ -1070,21 +1070,21 @@ function Xt({
1070
1070
  "button",
1071
1071
  {
1072
1072
  type: "button",
1073
- className: `${c.sendBtn} ${le.trim() && !be ? c.sendBtnReady : ""}`,
1074
- disabled: !le.trim() || be,
1075
- onClick: () => void Ue(),
1073
+ className: `${c.sendBtn} ${ce.trim() && !ke ? c.sendBtnReady : ""}`,
1074
+ disabled: !ce.trim() || ke,
1075
+ onClick: () => void Ve(),
1076
1076
  title: "发送并创建会话",
1077
1077
  "aria-label": "发送并创建会话",
1078
- children: /* @__PURE__ */ e(wt, {})
1078
+ children: /* @__PURE__ */ e(It, {})
1079
1079
  }
1080
1080
  )
1081
1081
  ] }),
1082
- /* @__PURE__ */ e("div", { className: c.landingChips, children: Bt.map((t) => /* @__PURE__ */ e(
1082
+ /* @__PURE__ */ e("div", { className: c.landingChips, children: Lt.map((t) => /* @__PURE__ */ e(
1083
1083
  "button",
1084
1084
  {
1085
1085
  type: "button",
1086
1086
  className: c.landingChip,
1087
- onClick: () => void Ue(t),
1087
+ onClick: () => void Ve(t),
1088
1088
  children: t
1089
1089
  },
1090
1090
  t
@@ -1094,49 +1094,49 @@ function Xt({
1094
1094
  ] })
1095
1095
  ] });
1096
1096
  }
1097
- const La = "_sidebarInner_1vu3c_1", Da = "_header_1vu3c_8", Ma = "_headerActions_1vu3c_19", xa = "_tabBar_1vu3c_26", Ra = "_tab_1vu3c_26", Ea = "_tabActive_1vu3c_50", $a = "_btnSm_1vu3c_66", Oa = "_agentSection_1vu3c_84", Ha = "_agentItem_1vu3c_90", Pa = "_agentItemActive_1vu3c_112", Fa = "_agentAvatar_1vu3c_117", ja = "_agentName_1vu3c_130", Wa = "_emptyState_1vu3c_156", Ka = "_createInputRow_1vu3c_168", Ua = "_createInput_1vu3c_168", Va = "_createConfirmBtn_1vu3c_188", Ga = "_contextMenu_1vu3c_205", za = "_contextMenuItem_1vu3c_216", qa = "_contextMenuItemDanger_1vu3c_231", Qa = "_contextMenuDivider_1vu3c_239", Xa = "_renameOverlay_1vu3c_246", Ja = "_renameDialog_1vu3c_259", Ya = "_renameTitle_1vu3c_267", Za = "_renameInput_1vu3c_274", el = "_renameActions_1vu3c_289", tl = "_renameBtn_1vu3c_295", nl = "_renameBtnPrimary_1vu3c_309", sl = "_agentDetailBtn_1vu3c_326", al = "_agentItemShared_1vu3c_358", ll = "_agentInfo_1vu3c_362", il = "_agentOwner_1vu3c_374", cl = "_sharedBadge_1vu3c_382", ol = "_createLocalDialog_1vu3c_430", rl = "_createLocalLabel_1vu3c_438", dl = "_agentTypeCards_1vu3c_446", ul = "_agentTypeCard_1vu3c_446", ml = "_agentTypeIcon_1vu3c_474", hl = "_agentTypeBody_1vu3c_487", pl = "_agentTypeTitle_1vu3c_494", gl = "_agentTypeDesc_1vu3c_500", _l = "_agentTypeBadge_1vu3c_506", r = {
1098
- sidebarInner: La,
1099
- header: Da,
1100
- headerActions: Ma,
1101
- tabBar: xa,
1102
- tab: Ra,
1103
- tabActive: Ea,
1104
- btnSm: $a,
1105
- agentSection: Oa,
1106
- agentItem: Ha,
1107
- agentItemActive: Pa,
1108
- agentAvatar: Fa,
1109
- agentName: ja,
1110
- emptyState: Wa,
1111
- createInputRow: Ka,
1112
- createInput: Ua,
1113
- createConfirmBtn: Va,
1114
- contextMenu: Ga,
1115
- contextMenuItem: za,
1116
- contextMenuItemDanger: qa,
1117
- contextMenuDivider: Qa,
1118
- renameOverlay: Xa,
1119
- renameDialog: Ja,
1120
- renameTitle: Ya,
1121
- renameInput: Za,
1122
- renameActions: el,
1123
- renameBtn: tl,
1124
- renameBtnPrimary: nl,
1125
- agentDetailBtn: sl,
1126
- agentItemShared: al,
1127
- agentInfo: ll,
1128
- agentOwner: il,
1129
- sharedBadge: cl,
1130
- createLocalDialog: ol,
1131
- createLocalLabel: rl,
1132
- agentTypeCards: dl,
1133
- agentTypeCard: ul,
1134
- agentTypeIcon: ml,
1135
- agentTypeBody: hl,
1136
- agentTypeTitle: pl,
1137
- agentTypeDesc: gl,
1138
- agentTypeBadge: _l
1139
- }, Lt = [
1097
+ const Ra = "_sidebarInner_1vu3c_1", Ea = "_header_1vu3c_8", $a = "_headerActions_1vu3c_19", Oa = "_tabBar_1vu3c_26", Ha = "_tab_1vu3c_26", Pa = "_tabActive_1vu3c_50", Fa = "_btnSm_1vu3c_66", ja = "_agentSection_1vu3c_84", Wa = "_agentItem_1vu3c_90", Ka = "_agentItemActive_1vu3c_112", Ua = "_agentAvatar_1vu3c_117", Va = "_agentName_1vu3c_130", Ga = "_emptyState_1vu3c_156", za = "_createInputRow_1vu3c_168", qa = "_createInput_1vu3c_168", Qa = "_createConfirmBtn_1vu3c_188", Xa = "_contextMenu_1vu3c_205", Ja = "_contextMenuItem_1vu3c_216", Ya = "_contextMenuItemDanger_1vu3c_231", Za = "_contextMenuDivider_1vu3c_239", el = "_renameOverlay_1vu3c_246", tl = "_renameDialog_1vu3c_259", nl = "_renameTitle_1vu3c_267", sl = "_renameInput_1vu3c_274", al = "_renameActions_1vu3c_289", ll = "_renameBtn_1vu3c_295", il = "_renameBtnPrimary_1vu3c_309", cl = "_agentDetailBtn_1vu3c_326", ol = "_agentItemShared_1vu3c_358", rl = "_agentInfo_1vu3c_362", dl = "_agentOwner_1vu3c_374", ul = "_sharedBadge_1vu3c_382", ml = "_createLocalDialog_1vu3c_430", pl = "_createLocalLabel_1vu3c_438", hl = "_agentTypeCards_1vu3c_446", gl = "_agentTypeCard_1vu3c_446", _l = "_agentTypeIcon_1vu3c_474", fl = "_agentTypeBody_1vu3c_487", yl = "_agentTypeTitle_1vu3c_494", vl = "_agentTypeDesc_1vu3c_500", bl = "_agentTypeBadge_1vu3c_506", r = {
1098
+ sidebarInner: Ra,
1099
+ header: Ea,
1100
+ headerActions: $a,
1101
+ tabBar: Oa,
1102
+ tab: Ha,
1103
+ tabActive: Pa,
1104
+ btnSm: Fa,
1105
+ agentSection: ja,
1106
+ agentItem: Wa,
1107
+ agentItemActive: Ka,
1108
+ agentAvatar: Ua,
1109
+ agentName: Va,
1110
+ emptyState: Ga,
1111
+ createInputRow: za,
1112
+ createInput: qa,
1113
+ createConfirmBtn: Qa,
1114
+ contextMenu: Xa,
1115
+ contextMenuItem: Ja,
1116
+ contextMenuItemDanger: Ya,
1117
+ contextMenuDivider: Za,
1118
+ renameOverlay: el,
1119
+ renameDialog: tl,
1120
+ renameTitle: nl,
1121
+ renameInput: sl,
1122
+ renameActions: al,
1123
+ renameBtn: ll,
1124
+ renameBtnPrimary: il,
1125
+ agentDetailBtn: cl,
1126
+ agentItemShared: ol,
1127
+ agentInfo: rl,
1128
+ agentOwner: dl,
1129
+ sharedBadge: ul,
1130
+ createLocalDialog: ml,
1131
+ createLocalLabel: pl,
1132
+ agentTypeCards: hl,
1133
+ agentTypeCard: gl,
1134
+ agentTypeIcon: _l,
1135
+ agentTypeBody: fl,
1136
+ agentTypeTitle: yl,
1137
+ agentTypeDesc: vl,
1138
+ agentTypeBadge: bl
1139
+ }, Dt = [
1140
1140
  "#2F70F1",
1141
1141
  "#52c41a",
1142
1142
  "#fa8c16",
@@ -1146,83 +1146,83 @@ const La = "_sidebarInner_1vu3c_1", Da = "_header_1vu3c_8", Ma = "_headerActions
1146
1146
  "#f5222d",
1147
1147
  "#faad14"
1148
1148
  ];
1149
- function Dt(s) {
1149
+ function Mt(s) {
1150
1150
  let d = 0;
1151
1151
  for (let u = 0; u < s.length; u++) d = d * 31 + s.charCodeAt(u) | 0;
1152
- return Lt[Math.abs(d) % Lt.length];
1152
+ return Dt[Math.abs(d) % Dt.length];
1153
1153
  }
1154
- function Mt(s) {
1154
+ function xt(s) {
1155
1155
  return s ? s.charAt(0).toUpperCase() : "?";
1156
1156
  }
1157
- const ot = "-1";
1158
- function fl({
1157
+ const rt = "-1";
1158
+ function Nl({
1159
1159
  selectedAgentId: s,
1160
1160
  selectedLocalAgentId: d,
1161
1161
  onSelectAgent: u,
1162
- onShowDetail: y,
1163
- onChatWithAgent: w
1162
+ onShowDetail: f,
1163
+ onChatWithAgent: I
1164
1164
  }) {
1165
- const b = Je((l) => l.token), I = Je((l) => l.personalChatNav), [A, $] = m(
1166
- I.tab === "shared" ? "shared" : "remote"
1167
- ), [D, O] = m([]), [H, M] = m(!1), [k, J] = m(!1), [W, ue] = m(""), [B, Y] = m(!1), [R, S] = m(null), [K, P] = m(null), [F, we] = m(!1), [se, T] = m([]), [Z, _e] = m(!1), [G, fe] = m(null), [ye, Ce] = m(!1), [ke, Ie] = m([]), [me, ve] = m(!1), [le, Pe] = m(!1), be = j(null), he = V(async () => {
1168
- M(!0);
1165
+ const A = Ye((l) => l.token), y = Ye((l) => l.personalChatNav), [x, $] = m(
1166
+ y.tab === "shared" ? "shared" : "remote"
1167
+ ), [S, W] = m([]), [q, O] = m(!1), [L, C] = m(!1), [se, K] = m(""), [ge, B] = m(!1), [M, F] = m(null), [T, J] = m(null), [U, j] = m(!1), [_e, w] = m([]), [V, Re] = m(!1), [Ce, G] = m(null), [fe, ye] = m(!1), [Ie, ve] = m([]), [Ee, ee] = m(!1), [Se, ce] = m(!1), $e = P(null), ke = z(async () => {
1168
+ O(!0);
1169
1169
  try {
1170
- const l = await jt(b);
1171
- O(l), s && !l.find((f) => nt(f.id, s)) && u(null);
1170
+ const l = await Wt(A);
1171
+ W(l), s && !l.find((v) => st(v.id, s)) && u(null);
1172
1172
  } catch {
1173
1173
  } finally {
1174
- M(!1);
1174
+ O(!1);
1175
1175
  }
1176
- }, [b, s, u]), Se = V(async () => {
1177
- _e(!0);
1176
+ }, [A, s, u]), ue = z(async () => {
1177
+ Re(!0);
1178
1178
  try {
1179
- const l = await Cn(b);
1180
- T(l);
1179
+ const l = await wn(A);
1180
+ w(l);
1181
1181
  } catch {
1182
1182
  } finally {
1183
- _e(!1);
1183
+ Re(!1);
1184
1184
  }
1185
- }, [b]);
1186
- x(() => {
1187
- I.trigger > 0 && I.tab && $(I.tab);
1188
- }, [I.trigger]), x(() => {
1189
- A === "remote" ? he() : A === "shared" && Se();
1190
- }, [he, Se, A]);
1191
- const ie = V(async () => {
1185
+ }, [A]);
1186
+ R(() => {
1187
+ y.trigger > 0 && y.tab && $(y.tab);
1188
+ }, [y.trigger]), R(() => {
1189
+ x === "remote" ? ke() : x === "shared" && ue();
1190
+ }, [ke, ue, x]);
1191
+ const be = z(async () => {
1192
1192
  try {
1193
- const l = await Kt();
1194
- Ie(l);
1193
+ const l = await Ut();
1194
+ ve(l);
1195
1195
  } catch {
1196
- Ie([]);
1196
+ ve([]);
1197
1197
  }
1198
1198
  }, []);
1199
- x(() => {
1200
- A === "local" && vt().then((l) => {
1201
- Ce(l), l && ie();
1199
+ R(() => {
1200
+ x === "local" && bt().then((l) => {
1201
+ ye(l), l && be();
1202
1202
  });
1203
- }, [A, ie]), x(() => {
1204
- if (!R) return;
1205
- const l = (f) => {
1206
- be.current && !be.current.contains(f.target) && S(null);
1203
+ }, [x, be]), R(() => {
1204
+ if (!M) return;
1205
+ const l = (v) => {
1206
+ $e.current && !$e.current.contains(v.target) && F(null);
1207
1207
  };
1208
1208
  return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
1209
- }, [R]);
1210
- const xe = async () => {
1211
- const l = W.trim();
1209
+ }, [M]);
1210
+ const me = async () => {
1211
+ const l = se.trim();
1212
1212
  if (l) {
1213
- Y(!0);
1213
+ B(!0);
1214
1214
  try {
1215
- const f = await kn(l, b);
1216
- O((U) => [...U, f]), ue(""), J(!1), u(f);
1215
+ const v = await In(l, A);
1216
+ W((H) => [...H, v]), K(""), C(!1), u(v);
1217
1217
  } catch {
1218
1218
  } finally {
1219
- Y(!1);
1219
+ B(!1);
1220
1220
  }
1221
1221
  }
1222
- }, pe = async (l) => {
1222
+ }, Ae = async (l) => {
1223
1223
  if (l === "jar") {
1224
- ve(!1), w({
1225
- id: ot,
1224
+ ee(!1), I({
1225
+ id: rt,
1226
1226
  userId: "local",
1227
1227
  agentHubAgentId: null,
1228
1228
  agentCode: "local-default",
@@ -1232,102 +1232,102 @@ function fl({
1232
1232
  });
1233
1233
  return;
1234
1234
  }
1235
- if (!ye) {
1236
- if (!await vt()) {
1237
- ct.error(
1235
+ if (!fe) {
1236
+ if (!await bt()) {
1237
+ ot.error(
1238
1238
  "本地 Agent 未启动,请通过菜单栏「重启 Agent」启动后再试"
1239
1239
  );
1240
1240
  return;
1241
1241
  }
1242
- Ce(!0);
1242
+ ye(!0);
1243
1243
  }
1244
- Pe(!0);
1244
+ ce(!0);
1245
1245
  try {
1246
- const f = l === "hermes" ? "hermes" : "claude-code";
1247
- await Rn(f, l), ct.success(`已引入 ${f},点击列表项即可开始对话`), ve(!1), await ie();
1248
- } catch (f) {
1249
- ct.error(
1250
- f.message || "创建失败,请检查本地 Agent 是否正常运行"
1246
+ const v = l === "hermes" ? "hermes" : "claude-code";
1247
+ await On(v, l), ot.success(`已引入 ${v},点击列表项即可开始对话`), ee(!1), await be();
1248
+ } catch (v) {
1249
+ ot.error(
1250
+ v.message || "创建失败,请检查本地 Agent 是否正常运行"
1251
1251
  );
1252
1252
  } finally {
1253
- Pe(!1);
1253
+ ce(!1);
1254
1254
  }
1255
- }, Ae = async (l) => {
1255
+ }, Te = async (l) => {
1256
1256
  if (window.confirm("确定删除此 Agent?"))
1257
1257
  try {
1258
- await En(l), await ie();
1259
- } catch (f) {
1260
- ct.error(f.message || "删除失败");
1258
+ await Hn(l), await be();
1259
+ } catch (v) {
1260
+ ot.error(v.message || "删除失败");
1261
1261
  }
1262
- }, ee = async (l) => {
1262
+ }, Be = async (l) => {
1263
1263
  if (window.confirm(
1264
1264
  `确定删除 Agent「${l.displayName}」吗?所有会话记录将一并删除。`
1265
1265
  ))
1266
1266
  try {
1267
- await Tn(l.id, b), O((f) => f.filter((U) => U.id !== l.id)), nt(s, l.id) && u(null);
1267
+ await Sn(l.id, A), W((v) => v.filter((H) => H.id !== l.id)), st(s, l.id) && u(null);
1268
1268
  } catch {
1269
1269
  }
1270
- }, Re = async () => {
1271
- if (!K) return;
1272
- const l = K.value.trim();
1273
- if (!l || l === K.agent.displayName) {
1274
- P(null);
1270
+ }, Y = async () => {
1271
+ if (!T) return;
1272
+ const l = T.value.trim();
1273
+ if (!l || l === T.agent.displayName) {
1274
+ J(null);
1275
1275
  return;
1276
1276
  }
1277
- we(!0);
1277
+ j(!0);
1278
1278
  try {
1279
- const f = await wn(
1280
- K.agent.id,
1279
+ const v = await An(
1280
+ T.agent.id,
1281
1281
  l,
1282
- b
1282
+ A
1283
1283
  );
1284
- O((U) => U.map((ce) => ce.id === f.id ? f : ce)), nt(s, f.id) && u(f), P(null);
1284
+ W((H) => H.map((pe) => pe.id === v.id ? v : pe)), st(s, v.id) && u(v), J(null);
1285
1285
  } catch {
1286
1286
  } finally {
1287
- we(!1);
1287
+ j(!1);
1288
1288
  }
1289
- }, Ve = async (l) => {
1290
- const f = l.shared === 1;
1289
+ }, je = async (l) => {
1290
+ const v = l.shared === 1;
1291
1291
  if (window.confirm(
1292
- f ? `确定取消共享 Agent「${l.displayName}」吗?取消后其他用户将无法与此 Agent 聊天。` : `确定共享 Agent「${l.displayName}」吗?共享后其他用户可以与此 Agent 发起聊天。`
1292
+ v ? `确定取消共享 Agent「${l.displayName}」吗?取消后其他用户将无法与此 Agent 聊天。` : `确定共享 Agent「${l.displayName}」吗?共享后其他用户可以与此 Agent 发起聊天。`
1293
1293
  )) {
1294
- fe(l.id);
1294
+ G(l.id);
1295
1295
  try {
1296
- const U = await In(
1296
+ const H = await Bn(
1297
1297
  l.id,
1298
- !f,
1299
- b
1298
+ !v,
1299
+ A
1300
1300
  );
1301
- O((ce) => ce.map((z) => z.id === U.id ? U : z));
1301
+ W((pe) => pe.map((he) => he.id === H.id ? H : he));
1302
1302
  } catch {
1303
1303
  } finally {
1304
- fe(null);
1304
+ G(null);
1305
1305
  }
1306
1306
  }
1307
- }, Fe = (l, f) => {
1308
- l.preventDefault(), l.stopPropagation(), S({ x: l.clientX, y: l.clientY, agent: f });
1307
+ }, Ge = (l, v) => {
1308
+ l.preventDefault(), l.stopPropagation(), F({ x: l.clientX, y: l.clientY, agent: v });
1309
1309
  };
1310
1310
  return /* @__PURE__ */ i("div", { className: r.sidebarInner, children: [
1311
1311
  /* @__PURE__ */ i("div", { className: r.header, children: [
1312
1312
  /* @__PURE__ */ e("span", { children: "个人 Agent" }),
1313
- A === "remote" && /* @__PURE__ */ e("div", { className: r.headerActions, children: /* @__PURE__ */ e(
1313
+ x === "remote" && /* @__PURE__ */ e("div", { className: r.headerActions, children: /* @__PURE__ */ e(
1314
1314
  "button",
1315
1315
  {
1316
1316
  type: "button",
1317
1317
  className: r.btnSm,
1318
1318
  onClick: () => {
1319
- J((l) => !l), ue("");
1319
+ C((l) => !l), K("");
1320
1320
  },
1321
1321
  title: "新建个人 Agent",
1322
1322
  children: "+ 新建"
1323
1323
  }
1324
1324
  ) }),
1325
- A === "local" && /* @__PURE__ */ e("div", { className: r.headerActions, children: /* @__PURE__ */ e(
1325
+ x === "local" && /* @__PURE__ */ e("div", { className: r.headerActions, children: /* @__PURE__ */ e(
1326
1326
  "button",
1327
1327
  {
1328
1328
  type: "button",
1329
1329
  className: r.btnSm,
1330
- onClick: () => ve(!0),
1330
+ onClick: () => ee(!0),
1331
1331
  title: "新建本地 Agent",
1332
1332
  children: "+ 新增"
1333
1333
  }
@@ -1338,7 +1338,7 @@ function fl({
1338
1338
  "button",
1339
1339
  {
1340
1340
  type: "button",
1341
- className: `${r.tab} ${A === "local" ? r.tabActive : ""}`,
1341
+ className: `${r.tab} ${x === "local" ? r.tabActive : ""}`,
1342
1342
  onClick: () => $("local"),
1343
1343
  title: "本地 Agent",
1344
1344
  children: "本地"
@@ -1348,7 +1348,7 @@ function fl({
1348
1348
  "button",
1349
1349
  {
1350
1350
  type: "button",
1351
- className: `${r.tab} ${A === "remote" ? r.tabActive : ""}`,
1351
+ className: `${r.tab} ${x === "remote" ? r.tabActive : ""}`,
1352
1352
  onClick: () => $("remote"),
1353
1353
  children: "远程"
1354
1354
  }
@@ -1357,19 +1357,19 @@ function fl({
1357
1357
  "button",
1358
1358
  {
1359
1359
  type: "button",
1360
- className: `${r.tab} ${A === "shared" ? r.tabActive : ""}`,
1360
+ className: `${r.tab} ${x === "shared" ? r.tabActive : ""}`,
1361
1361
  onClick: () => $("shared"),
1362
1362
  children: "共享"
1363
1363
  }
1364
1364
  )
1365
1365
  ] }),
1366
- A === "local" ? /* @__PURE__ */ e("div", { className: r.agentSection, children: ye ? /* @__PURE__ */ e(Me, { children: ke.map((l) => /* @__PURE__ */ i(
1366
+ x === "local" ? /* @__PURE__ */ e("div", { className: r.agentSection, children: fe ? /* @__PURE__ */ e(xe, { children: Ie.map((l) => /* @__PURE__ */ i(
1367
1367
  "div",
1368
1368
  {
1369
- className: `${r.agentItem} ${nt(s, ot) && (l.type === "jar" && !d || d === l.id) ? r.agentItemActive : ""}`,
1369
+ className: `${r.agentItem} ${st(s, rt) && (l.type === "jar" && !d || d === l.id) ? r.agentItemActive : ""}`,
1370
1370
  onClick: () => {
1371
1371
  l.type === "jar" ? u({
1372
- id: ot,
1372
+ id: rt,
1373
1373
  userId: "local",
1374
1374
  agentHubAgentId: null,
1375
1375
  agentCode: "local-default",
@@ -1377,7 +1377,7 @@ function fl({
1377
1377
  avatar: null,
1378
1378
  isLocal: !0
1379
1379
  }) : u({
1380
- id: ot,
1380
+ id: rt,
1381
1381
  userId: "local",
1382
1382
  agentHubAgentId: null,
1383
1383
  agentCode: l.name,
@@ -1405,8 +1405,8 @@ function fl({
1405
1405
  {
1406
1406
  type: "button",
1407
1407
  className: r.agentDetailBtn,
1408
- onClick: (f) => {
1409
- f.stopPropagation(), Ae(l.id);
1408
+ onClick: (v) => {
1409
+ v.stopPropagation(), Te(l.id);
1410
1410
  },
1411
1411
  title: "删除",
1412
1412
  children: /* @__PURE__ */ e("span", { style: { fontSize: 14 }, children: "×" })
@@ -1418,14 +1418,14 @@ function fl({
1418
1418
  )) }) : /* @__PURE__ */ i("div", { className: r.emptyState, children: [
1419
1419
  /* @__PURE__ */ e("span", { children: "本地 Agent 未启动" }),
1420
1420
  /* @__PURE__ */ e("span", { children: "请检查桌面端是否正常运行" })
1421
- ] }) }) : A === "shared" ? /* @__PURE__ */ e("div", { className: r.agentSection, children: Z && se.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, children: "加载中..." }) : se.length === 0 ? /* @__PURE__ */ i("div", { className: r.emptyState, children: [
1421
+ ] }) }) : x === "shared" ? /* @__PURE__ */ e("div", { className: r.agentSection, children: V && _e.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, children: "加载中..." }) : _e.length === 0 ? /* @__PURE__ */ i("div", { className: r.emptyState, children: [
1422
1422
  /* @__PURE__ */ e("span", { children: "暂无共享 Agent" }),
1423
1423
  /* @__PURE__ */ e("span", { children: "其他用户共享的 Agent 会显示在这里" })
1424
- ] }) : se.map((l) => /* @__PURE__ */ i(
1424
+ ] }) : _e.map((l) => /* @__PURE__ */ i(
1425
1425
  "div",
1426
1426
  {
1427
1427
  className: `${r.agentItem} ${r.agentItemShared}`,
1428
- onClick: () => w(l),
1428
+ onClick: () => I(l),
1429
1429
  title: `点击与「${l.displayName}」聊天`,
1430
1430
  children: [
1431
1431
  /* @__PURE__ */ e(
@@ -1433,11 +1433,11 @@ function fl({
1433
1433
  {
1434
1434
  className: r.agentAvatar,
1435
1435
  style: {
1436
- backgroundColor: Dt(
1436
+ backgroundColor: Mt(
1437
1437
  l.agentCode || l.displayName
1438
1438
  )
1439
1439
  },
1440
- children: Mt(l.displayName)
1440
+ children: xt(l.displayName)
1441
1441
  }
1442
1442
  ),
1443
1443
  /* @__PURE__ */ i("div", { className: r.agentInfo, children: [
@@ -1452,29 +1452,29 @@ function fl({
1452
1452
  {
1453
1453
  type: "button",
1454
1454
  className: r.agentDetailBtn,
1455
- onClick: (f) => {
1456
- f.stopPropagation(), w(l);
1455
+ onClick: (v) => {
1456
+ v.stopPropagation(), I(l);
1457
1457
  },
1458
1458
  title: "开始聊天",
1459
- children: /* @__PURE__ */ e(Ht, { style: { fontSize: 12 } })
1459
+ children: /* @__PURE__ */ e(Pt, { style: { fontSize: 12 } })
1460
1460
  }
1461
1461
  )
1462
1462
  ]
1463
1463
  },
1464
1464
  l.id
1465
- )) }) : /* @__PURE__ */ i(Me, { children: [
1466
- k && /* @__PURE__ */ i("div", { className: r.createInputRow, children: [
1465
+ )) }) : /* @__PURE__ */ i(xe, { children: [
1466
+ L && /* @__PURE__ */ i("div", { className: r.createInputRow, children: [
1467
1467
  /* @__PURE__ */ e(
1468
1468
  "input",
1469
1469
  {
1470
1470
  className: r.createInput,
1471
1471
  type: "text",
1472
1472
  placeholder: "输入 Agent 名称",
1473
- value: W,
1473
+ value: se,
1474
1474
  autoFocus: !0,
1475
- onChange: (l) => ue(l.target.value),
1475
+ onChange: (l) => K(l.target.value),
1476
1476
  onKeyDown: (l) => {
1477
- l.key === "Enter" && xe(), l.key === "Escape" && (J(!1), ue(""));
1477
+ l.key === "Enter" && me(), l.key === "Escape" && (C(!1), K(""));
1478
1478
  }
1479
1479
  }
1480
1480
  ),
@@ -1483,32 +1483,32 @@ function fl({
1483
1483
  {
1484
1484
  type: "button",
1485
1485
  className: r.createConfirmBtn,
1486
- disabled: !W.trim() || B,
1487
- onClick: xe,
1488
- children: B ? "..." : "创建"
1486
+ disabled: !se.trim() || ge,
1487
+ onClick: me,
1488
+ children: ge ? "..." : "创建"
1489
1489
  }
1490
1490
  )
1491
1491
  ] }),
1492
- /* @__PURE__ */ e("div", { className: r.agentSection, children: H && D.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, children: "加载中..." }) : D.length === 0 ? /* @__PURE__ */ i("div", { className: r.emptyState, children: [
1492
+ /* @__PURE__ */ e("div", { className: r.agentSection, children: q && S.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, children: "加载中..." }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: r.emptyState, children: [
1493
1493
  /* @__PURE__ */ e("span", { children: "暂无个人 Agent" }),
1494
1494
  /* @__PURE__ */ e("span", { children: "点击「新建」创建一个" })
1495
- ] }) : D.map((l) => /* @__PURE__ */ i(
1495
+ ] }) : S.map((l) => /* @__PURE__ */ i(
1496
1496
  "div",
1497
1497
  {
1498
- className: `${r.agentItem} ${nt(s, l.id) ? r.agentItemActive : ""}`,
1498
+ className: `${r.agentItem} ${st(s, l.id) ? r.agentItemActive : ""}`,
1499
1499
  onClick: () => u(l),
1500
- onContextMenu: (f) => Fe(f, l),
1500
+ onContextMenu: (v) => Ge(v, l),
1501
1501
  children: [
1502
1502
  /* @__PURE__ */ e(
1503
1503
  "div",
1504
1504
  {
1505
1505
  className: r.agentAvatar,
1506
1506
  style: {
1507
- backgroundColor: Dt(
1507
+ backgroundColor: Mt(
1508
1508
  l.agentCode || l.displayName
1509
1509
  )
1510
1510
  },
1511
- children: Mt(l.displayName)
1511
+ children: xt(l.displayName)
1512
1512
  }
1513
1513
  ),
1514
1514
  /* @__PURE__ */ i("span", { className: r.agentName, children: [
@@ -1520,17 +1520,17 @@ function fl({
1520
1520
  {
1521
1521
  type: "button",
1522
1522
  className: r.agentDetailBtn,
1523
- onClick: (f) => {
1524
- f.stopPropagation();
1525
- const U = f.currentTarget.getBoundingClientRect();
1526
- S({
1527
- x: U.right - 120,
1528
- y: U.bottom + 4,
1523
+ onClick: (v) => {
1524
+ v.stopPropagation();
1525
+ const H = v.currentTarget.getBoundingClientRect();
1526
+ F({
1527
+ x: H.right - 120,
1528
+ y: H.bottom + 4,
1529
1529
  agent: l
1530
1530
  });
1531
1531
  },
1532
1532
  title: "更多操作",
1533
- children: /* @__PURE__ */ e(cn, { style: { fontSize: 14 } })
1533
+ children: /* @__PURE__ */ e(dn, { style: { fontSize: 14 } })
1534
1534
  }
1535
1535
  )
1536
1536
  ]
@@ -1538,19 +1538,19 @@ function fl({
1538
1538
  l.id
1539
1539
  )) })
1540
1540
  ] }),
1541
- R && /* @__PURE__ */ i(
1541
+ M && /* @__PURE__ */ i(
1542
1542
  "div",
1543
1543
  {
1544
- ref: be,
1544
+ ref: $e,
1545
1545
  className: r.contextMenu,
1546
- style: { top: R.y, left: R.x },
1546
+ style: { top: M.y, left: M.x },
1547
1547
  children: [
1548
1548
  /* @__PURE__ */ e(
1549
1549
  "div",
1550
1550
  {
1551
1551
  className: r.contextMenuItem,
1552
1552
  onClick: () => {
1553
- w(R.agent), S(null);
1553
+ I(M.agent), F(null);
1554
1554
  },
1555
1555
  children: "开始聊天"
1556
1556
  }
@@ -1560,7 +1560,7 @@ function fl({
1560
1560
  {
1561
1561
  className: r.contextMenuItem,
1562
1562
  onClick: () => {
1563
- y(R.agent), S(null);
1563
+ f(M.agent), F(null);
1564
1564
  },
1565
1565
  children: "Agent 配置"
1566
1566
  }
@@ -1571,10 +1571,10 @@ function fl({
1571
1571
  {
1572
1572
  className: r.contextMenuItem,
1573
1573
  onClick: () => {
1574
- P({
1575
- agent: R.agent,
1576
- value: R.agent.displayName
1577
- }), S(null);
1574
+ J({
1575
+ agent: M.agent,
1576
+ value: M.agent.displayName
1577
+ }), F(null);
1578
1578
  },
1579
1579
  children: "重命名"
1580
1580
  }
@@ -1584,9 +1584,9 @@ function fl({
1584
1584
  {
1585
1585
  className: r.contextMenuItem,
1586
1586
  onClick: () => {
1587
- G === null && Ve(R.agent), S(null);
1587
+ Ce === null && je(M.agent), F(null);
1588
1588
  },
1589
- children: R.agent.shared === 1 ? "取消共享" : "共享给他人"
1589
+ children: M.agent.shared === 1 ? "取消共享" : "共享给他人"
1590
1590
  }
1591
1591
  ),
1592
1592
  /* @__PURE__ */ e("div", { className: r.contextMenuDivider }),
@@ -1595,7 +1595,7 @@ function fl({
1595
1595
  {
1596
1596
  className: `${r.contextMenuItem} ${r.contextMenuItemDanger}`,
1597
1597
  onClick: () => {
1598
- ee(R.agent), S(null);
1598
+ Be(M.agent), F(null);
1599
1599
  },
1600
1600
  children: "删除"
1601
1601
  }
@@ -1603,11 +1603,11 @@ function fl({
1603
1603
  ]
1604
1604
  }
1605
1605
  ),
1606
- me && /* @__PURE__ */ e(
1606
+ Ee && /* @__PURE__ */ e(
1607
1607
  "div",
1608
1608
  {
1609
1609
  className: r.renameOverlay,
1610
- onClick: () => !le && ve(!1),
1610
+ onClick: () => !Se && ee(!1),
1611
1611
  children: /* @__PURE__ */ i(
1612
1612
  "div",
1613
1613
  {
@@ -1615,13 +1615,13 @@ function fl({
1615
1615
  onClick: (l) => l.stopPropagation(),
1616
1616
  children: [
1617
1617
  /* @__PURE__ */ e("div", { className: r.renameTitle, children: "新建本地 Agent" }),
1618
- /* @__PURE__ */ e("div", { className: r.createLocalLabel, children: le ? "正在创建..." : "点击选择,直接开始聊天" }),
1618
+ /* @__PURE__ */ e("div", { className: r.createLocalLabel, children: Se ? "正在创建..." : "点击选择,直接开始聊天" }),
1619
1619
  /* @__PURE__ */ i("div", { className: r.agentTypeCards, children: [
1620
1620
  /* @__PURE__ */ i(
1621
1621
  "div",
1622
1622
  {
1623
1623
  className: r.agentTypeCard,
1624
- onClick: () => pe("jar"),
1624
+ onClick: () => Ae("jar"),
1625
1625
  children: [
1626
1626
  /* @__PURE__ */ e(
1627
1627
  "div",
@@ -1646,7 +1646,7 @@ function fl({
1646
1646
  "div",
1647
1647
  {
1648
1648
  className: r.agentTypeCard,
1649
- onClick: () => pe("hermes"),
1649
+ onClick: () => Ae("hermes"),
1650
1650
  children: [
1651
1651
  /* @__PURE__ */ e(
1652
1652
  "div",
@@ -1667,7 +1667,7 @@ function fl({
1667
1667
  "div",
1668
1668
  {
1669
1669
  className: r.agentTypeCard,
1670
- onClick: () => pe("claude-code"),
1670
+ onClick: () => Ae("claude-code"),
1671
1671
  children: [
1672
1672
  /* @__PURE__ */ e(
1673
1673
  "div",
@@ -1690,8 +1690,8 @@ function fl({
1690
1690
  {
1691
1691
  type: "button",
1692
1692
  className: r.renameBtn,
1693
- onClick: () => ve(!1),
1694
- disabled: le,
1693
+ onClick: () => ee(!1),
1694
+ disabled: Se,
1695
1695
  children: "取消"
1696
1696
  }
1697
1697
  ) })
@@ -1700,11 +1700,11 @@ function fl({
1700
1700
  )
1701
1701
  }
1702
1702
  ),
1703
- K && /* @__PURE__ */ e(
1703
+ T && /* @__PURE__ */ e(
1704
1704
  "div",
1705
1705
  {
1706
1706
  className: r.renameOverlay,
1707
- onClick: () => !F && P(null),
1707
+ onClick: () => !U && J(null),
1708
1708
  children: /* @__PURE__ */ i(
1709
1709
  "div",
1710
1710
  {
@@ -1717,11 +1717,11 @@ function fl({
1717
1717
  {
1718
1718
  className: r.renameInput,
1719
1719
  type: "text",
1720
- value: K.value,
1720
+ value: T.value,
1721
1721
  autoFocus: !0,
1722
- onChange: (l) => P({ ...K, value: l.target.value }),
1722
+ onChange: (l) => J({ ...T, value: l.target.value }),
1723
1723
  onKeyDown: (l) => {
1724
- l.key === "Enter" && Re(), l.key === "Escape" && P(null);
1724
+ l.key === "Enter" && Y(), l.key === "Escape" && J(null);
1725
1725
  }
1726
1726
  }
1727
1727
  ),
@@ -1731,8 +1731,8 @@ function fl({
1731
1731
  {
1732
1732
  type: "button",
1733
1733
  className: r.renameBtn,
1734
- onClick: () => P(null),
1735
- disabled: F,
1734
+ onClick: () => J(null),
1735
+ disabled: U,
1736
1736
  children: "取消"
1737
1737
  }
1738
1738
  ),
@@ -1741,9 +1741,9 @@ function fl({
1741
1741
  {
1742
1742
  type: "button",
1743
1743
  className: r.renameBtnPrimary,
1744
- disabled: !K.value.trim() || F,
1745
- onClick: Re,
1746
- children: F ? "..." : "确定"
1744
+ disabled: !T.value.trim() || U,
1745
+ onClick: Y,
1746
+ children: U ? "..." : "确定"
1747
1747
  }
1748
1748
  )
1749
1749
  ] })
@@ -1754,111 +1754,111 @@ function fl({
1754
1754
  )
1755
1755
  ] });
1756
1756
  }
1757
- const yl = "_shell_1w53k_2", vl = "_inset_1w53k_33", bl = "_main_1w53k_40", Nl = "_pane_1w53k_52", Cl = "_skipLink_1w53k_62", kl = "_personalMainArea_1w53k_82", Tl = "_personalSidebar_1w53k_90", wl = "_personalChatArea_1w53k_103", Oe = {
1758
- shell: yl,
1759
- inset: vl,
1760
- main: bl,
1761
- pane: Nl,
1762
- skipLink: Cl,
1763
- personalMainArea: kl,
1764
- personalSidebar: Tl,
1765
- personalChatArea: wl
1766
- }, Il = "_sidebar_y5tuo_1", Sl = "_collapsed_y5tuo_12", Al = "_sideHeader_y5tuo_17", Bl = "_sideHeaderIcon_y5tuo_32", Ll = "_sideHeaderTitle_y5tuo_45", Dl = "_sideContent_y5tuo_54", Ml = "_groupLabel_y5tuo_61", xl = "_navList_y5tuo_71", Rl = "_navItem_y5tuo_77", El = "_navItemActive_y5tuo_109", $l = "_navIcon_y5tuo_114", Ol = "_navLabel_y5tuo_120", Hl = "_sideFooter_y5tuo_131", Pl = "_footHint_y5tuo_138", Q = {
1767
- sidebar: Il,
1768
- collapsed: Sl,
1769
- sideHeader: Al,
1770
- sideHeaderIcon: Bl,
1771
- sideHeaderTitle: Ll,
1772
- sideContent: Dl,
1773
- groupLabel: Ml,
1774
- navList: xl,
1775
- navItem: Rl,
1776
- navItemActive: El,
1777
- navIcon: $l,
1778
- navLabel: Ol,
1779
- sideFooter: Hl,
1780
- footHint: Pl
1757
+ const Cl = "_shell_1w53k_2", kl = "_inset_1w53k_33", Tl = "_main_1w53k_40", wl = "_pane_1w53k_52", Il = "_skipLink_1w53k_62", Sl = "_personalMainArea_1w53k_82", Al = "_personalSidebar_1w53k_90", Bl = "_personalChatArea_1w53k_103", Pe = {
1758
+ shell: Cl,
1759
+ inset: kl,
1760
+ main: Tl,
1761
+ pane: wl,
1762
+ skipLink: Il,
1763
+ personalMainArea: Sl,
1764
+ personalSidebar: Al,
1765
+ personalChatArea: Bl
1766
+ }, Ll = "_sidebar_y5tuo_1", Dl = "_collapsed_y5tuo_12", Ml = "_sideHeader_y5tuo_17", xl = "_sideHeaderIcon_y5tuo_32", Rl = "_sideHeaderTitle_y5tuo_45", El = "_sideContent_y5tuo_54", $l = "_groupLabel_y5tuo_61", Ol = "_navList_y5tuo_71", Hl = "_navItem_y5tuo_77", Pl = "_navItemActive_y5tuo_109", Fl = "_navIcon_y5tuo_114", jl = "_navLabel_y5tuo_120", Wl = "_sideFooter_y5tuo_131", Kl = "_footHint_y5tuo_138", X = {
1767
+ sidebar: Ll,
1768
+ collapsed: Dl,
1769
+ sideHeader: Ml,
1770
+ sideHeaderIcon: xl,
1771
+ sideHeaderTitle: Rl,
1772
+ sideContent: El,
1773
+ groupLabel: $l,
1774
+ navList: Ol,
1775
+ navItem: Hl,
1776
+ navItemActive: Pl,
1777
+ navIcon: Fl,
1778
+ navLabel: jl,
1779
+ sideFooter: Wl,
1780
+ footHint: Kl
1781
1781
  };
1782
- function Fl({
1782
+ function Ul({
1783
1783
  items: s,
1784
1784
  activeTab: d,
1785
1785
  collapsed: u,
1786
- footerItems: y,
1787
- onSelect: w,
1788
- onSwitchMode: b
1786
+ footerItems: f,
1787
+ onSelect: I,
1788
+ onSwitchMode: A
1789
1789
  }) {
1790
1790
  return /* @__PURE__ */ i(
1791
1791
  "aside",
1792
1792
  {
1793
- className: `${Q.sidebar} ${u ? Q.collapsed : ""}`,
1793
+ className: `${X.sidebar} ${u ? X.collapsed : ""}`,
1794
1794
  "aria-label": "个人工作台导航",
1795
1795
  children: [
1796
- /* @__PURE__ */ i("div", { className: Q.sideHeader, children: [
1797
- /* @__PURE__ */ e("span", { className: Q.sideHeaderIcon, children: /* @__PURE__ */ e(Pt, {}) }),
1798
- !u && /* @__PURE__ */ e("span", { className: Q.sideHeaderTitle, children: "个人工作台" })
1796
+ /* @__PURE__ */ i("div", { className: X.sideHeader, children: [
1797
+ /* @__PURE__ */ e("span", { className: X.sideHeaderIcon, children: /* @__PURE__ */ e(Ft, {}) }),
1798
+ !u && /* @__PURE__ */ e("span", { className: X.sideHeaderTitle, children: "个人工作台" })
1799
1799
  ] }),
1800
- /* @__PURE__ */ i("div", { className: Q.sideContent, children: [
1801
- !u && /* @__PURE__ */ e("p", { className: Q.groupLabel, children: "我的工作空间" }),
1802
- /* @__PURE__ */ e("nav", { className: Q.navList, "aria-label": "个人模块", children: s.map((I) => {
1803
- const A = d === I.key, $ = /* @__PURE__ */ i(
1800
+ /* @__PURE__ */ i("div", { className: X.sideContent, children: [
1801
+ !u && /* @__PURE__ */ e("p", { className: X.groupLabel, children: "我的工作空间" }),
1802
+ /* @__PURE__ */ e("nav", { className: X.navList, "aria-label": "个人模块", children: s.map((y) => {
1803
+ const x = d === y.key, $ = /* @__PURE__ */ i(
1804
1804
  "button",
1805
1805
  {
1806
1806
  type: "button",
1807
- className: `${Q.navItem} ${A ? Q.navItemActive : ""}`,
1808
- onClick: () => w(I.key),
1809
- "aria-current": A ? "page" : void 0,
1807
+ className: `${X.navItem} ${x ? X.navItemActive : ""}`,
1808
+ onClick: () => I(y.key),
1809
+ "aria-current": x ? "page" : void 0,
1810
1810
  children: [
1811
- /* @__PURE__ */ e("span", { className: Q.navIcon, children: I.icon }),
1812
- !u && /* @__PURE__ */ e("span", { className: Q.navLabel, children: I.label })
1811
+ /* @__PURE__ */ e("span", { className: X.navIcon, children: y.icon }),
1812
+ !u && /* @__PURE__ */ e("span", { className: X.navLabel, children: y.label })
1813
1813
  ]
1814
1814
  },
1815
- I.key
1815
+ y.key
1816
1816
  );
1817
- return u ? /* @__PURE__ */ e(Nt, { placement: "right", title: I.label, children: $ }, I.key) : $;
1817
+ return u ? /* @__PURE__ */ e(Ct, { placement: "right", title: y.label, children: $ }, y.key) : $;
1818
1818
  }) })
1819
1819
  ] }),
1820
- /* @__PURE__ */ i("div", { className: Q.sideFooter, children: [
1821
- y.length > 0 && /* @__PURE__ */ e("nav", { className: Q.navList, "aria-label": "快捷切换", children: y.map((I) => {
1822
- const A = /* @__PURE__ */ i(
1820
+ /* @__PURE__ */ i("div", { className: X.sideFooter, children: [
1821
+ f.length > 0 && /* @__PURE__ */ e("nav", { className: X.navList, "aria-label": "快捷切换", children: f.map((y) => {
1822
+ const x = /* @__PURE__ */ i(
1823
1823
  "button",
1824
1824
  {
1825
1825
  type: "button",
1826
- className: Q.navItem,
1827
- onClick: () => b == null ? void 0 : b(I.mode),
1826
+ className: X.navItem,
1827
+ onClick: () => A == null ? void 0 : A(y.mode),
1828
1828
  children: [
1829
- /* @__PURE__ */ e("span", { className: Q.navIcon, children: I.icon }),
1830
- !u && /* @__PURE__ */ e("span", { className: Q.navLabel, children: I.label })
1829
+ /* @__PURE__ */ e("span", { className: X.navIcon, children: y.icon }),
1830
+ !u && /* @__PURE__ */ e("span", { className: X.navLabel, children: y.label })
1831
1831
  ]
1832
1832
  },
1833
- I.mode
1833
+ y.mode
1834
1834
  );
1835
- return u ? /* @__PURE__ */ e(Nt, { placement: "right", title: I.label, children: A }, I.mode) : A;
1835
+ return u ? /* @__PURE__ */ e(Ct, { placement: "right", title: y.label, children: x }, y.mode) : x;
1836
1836
  }) }),
1837
- !u && /* @__PURE__ */ e("p", { className: Q.footHint, children: "⌘ / Ctrl + B 切换导航" })
1837
+ !u && /* @__PURE__ */ e("p", { className: X.footHint, children: "⌘ / Ctrl + B 切换导航" })
1838
1838
  ] })
1839
1839
  ]
1840
1840
  }
1841
1841
  );
1842
1842
  }
1843
- const jl = "_topbar_ms4b7_1", Wl = "_topbarLeft_ms4b7_14", Kl = "_collapseBtn_ms4b7_22", Ul = "_crumbs_ms4b7_49", Vl = "_crumbsRoot_ms4b7_57", Gl = "_crumbsSep_ms4b7_62", zl = "_crumbsCurrent_ms4b7_68", ql = "_topbarRight_ms4b7_76", He = {
1844
- topbar: jl,
1845
- topbarLeft: Wl,
1846
- collapseBtn: Kl,
1847
- crumbs: Ul,
1848
- crumbsRoot: Vl,
1849
- crumbsSep: Gl,
1850
- crumbsCurrent: zl,
1851
- topbarRight: ql
1843
+ const Vl = "_topbar_ms4b7_1", Gl = "_topbarLeft_ms4b7_14", zl = "_collapseBtn_ms4b7_22", ql = "_crumbs_ms4b7_49", Ql = "_crumbsRoot_ms4b7_57", Xl = "_crumbsSep_ms4b7_62", Jl = "_crumbsCurrent_ms4b7_68", Yl = "_topbarRight_ms4b7_76", Fe = {
1844
+ topbar: Vl,
1845
+ topbarLeft: Gl,
1846
+ collapseBtn: zl,
1847
+ crumbs: ql,
1848
+ crumbsRoot: Ql,
1849
+ crumbsSep: Xl,
1850
+ crumbsCurrent: Jl,
1851
+ topbarRight: Yl
1852
1852
  };
1853
- function Ql({
1853
+ function Zl({
1854
1854
  label: s,
1855
1855
  collapsed: d,
1856
1856
  onToggleCollapse: u
1857
1857
  }) {
1858
- return /* @__PURE__ */ i("header", { className: He.topbar, children: [
1859
- /* @__PURE__ */ i("div", { className: He.topbarLeft, children: [
1858
+ return /* @__PURE__ */ i("header", { className: Fe.topbar, children: [
1859
+ /* @__PURE__ */ i("div", { className: Fe.topbarLeft, children: [
1860
1860
  /* @__PURE__ */ e(
1861
- Nt,
1861
+ Ct,
1862
1862
  {
1863
1863
  title: d ? "展开个人菜单" : "收起个人菜单",
1864
1864
  placement: "bottom",
@@ -1866,138 +1866,138 @@ function Ql({
1866
1866
  "button",
1867
1867
  {
1868
1868
  type: "button",
1869
- className: He.collapseBtn,
1869
+ className: Fe.collapseBtn,
1870
1870
  onClick: u,
1871
1871
  "aria-label": "展开或收起个人菜单",
1872
1872
  "aria-expanded": !d,
1873
- children: d ? /* @__PURE__ */ e(on, {}) : /* @__PURE__ */ e(rn, {})
1873
+ children: d ? /* @__PURE__ */ e(un, {}) : /* @__PURE__ */ e(mn, {})
1874
1874
  }
1875
1875
  )
1876
1876
  }
1877
1877
  ),
1878
- /* @__PURE__ */ i("div", { className: He.crumbs, "aria-label": "当前位置", children: [
1879
- /* @__PURE__ */ e("span", { className: He.crumbsRoot, children: "个人" }),
1880
- /* @__PURE__ */ e($t, { className: He.crumbsSep }),
1881
- /* @__PURE__ */ e("span", { className: He.crumbsCurrent, children: s })
1878
+ /* @__PURE__ */ i("div", { className: Fe.crumbs, "aria-label": "当前位置", children: [
1879
+ /* @__PURE__ */ e("span", { className: Fe.crumbsRoot, children: "个人" }),
1880
+ /* @__PURE__ */ e(Ot, { className: Fe.crumbsSep }),
1881
+ /* @__PURE__ */ e("span", { className: Fe.crumbsCurrent, children: s })
1882
1882
  ] })
1883
1883
  ] }),
1884
- /* @__PURE__ */ e("div", { className: He.topbarRight })
1884
+ /* @__PURE__ */ e("div", { className: Fe.topbarRight })
1885
1885
  ] });
1886
1886
  }
1887
- const Jt = [
1888
- { key: "workbench", label: "场景工作台", icon: /* @__PURE__ */ e(Pt, {}) },
1889
- { key: "projects", label: "工作单管理", icon: /* @__PURE__ */ e(mn, {}) },
1890
- { key: "personal", label: "个人统计", icon: /* @__PURE__ */ e(hn, {}) },
1891
- { key: "business-stats", label: "业务指标", icon: /* @__PURE__ */ e(pn, {}) },
1892
- { key: "tools", label: "常用工具", icon: /* @__PURE__ */ e(gn, {}) },
1893
- { key: "websites", label: "常用网站", icon: /* @__PURE__ */ e(_n, {}) },
1894
- { key: "smart-partner", label: "智能伙伴", icon: /* @__PURE__ */ e(Ht, {}) },
1895
- { key: "todo", label: "工作待办", icon: /* @__PURE__ */ e(fn, {}) },
1896
- { key: "notes", label: "个人笔记", icon: /* @__PURE__ */ e(Ft, {}) },
1887
+ const en = [
1888
+ { key: "workbench", label: "场景工作台", icon: /* @__PURE__ */ e(Ft, {}) },
1889
+ { key: "projects", label: "工作单管理", icon: /* @__PURE__ */ e(gn, {}) },
1890
+ { key: "personal", label: "个人统计", icon: /* @__PURE__ */ e(_n, {}) },
1891
+ { key: "business-stats", label: "业务指标", icon: /* @__PURE__ */ e(fn, {}) },
1892
+ { key: "tools", label: "常用工具", icon: /* @__PURE__ */ e(yn, {}) },
1893
+ { key: "websites", label: "常用网站", icon: /* @__PURE__ */ e(vn, {}) },
1894
+ { key: "smart-partner", label: "智能伙伴", icon: /* @__PURE__ */ e(Pt, {}) },
1895
+ { key: "todo", label: "工作待办", icon: /* @__PURE__ */ e(bn, {}) },
1896
+ { key: "notes", label: "个人笔记", icon: /* @__PURE__ */ e(jt, {}) },
1897
1897
  {
1898
1898
  key: "training",
1899
1899
  label: "培训中心",
1900
- icon: /* @__PURE__ */ e(yn, {}),
1900
+ icon: /* @__PURE__ */ e(Nn, {}),
1901
1901
  // 学员侧学习入口与培训管理(TRAINING)解耦:按需单独分配,不随培训入口发放
1902
1902
  permission: "TRAINING_CENTER"
1903
1903
  },
1904
- { key: "webide", label: "WebIDE", icon: /* @__PURE__ */ e(vn, {}) }
1905
- ], Yt = "ft_pw_sidebar_collapsed";
1906
- function Xl() {
1904
+ { key: "webide", label: "WebIDE", icon: /* @__PURE__ */ e(Cn, {}) }
1905
+ ], tn = "ft_pw_sidebar_collapsed";
1906
+ function ei() {
1907
1907
  try {
1908
- return localStorage.getItem(Yt) === "1";
1908
+ return localStorage.getItem(tn) === "1";
1909
1909
  } catch {
1910
1910
  return !1;
1911
1911
  }
1912
1912
  }
1913
- function Jl(s) {
1913
+ function ti(s) {
1914
1914
  const d = s;
1915
1915
  return d ? d.tagName === "INPUT" || d.tagName === "TEXTAREA" || d.isContentEditable === !0 : !1;
1916
1916
  }
1917
- function Yl() {
1917
+ function ni() {
1918
1918
  try {
1919
1919
  const s = new URLSearchParams(window.location.search).get("tab");
1920
- return s && Jt.some((d) => d.key === s) ? s : null;
1920
+ return s && en.some((d) => d.key === s) ? s : null;
1921
1921
  } catch {
1922
1922
  return null;
1923
1923
  }
1924
1924
  }
1925
- function Zl({
1925
+ function si({
1926
1926
  onOpenProject: s,
1927
1927
  openTodoId: d,
1928
1928
  selectedPersonalAgent: u,
1929
- personalView: y,
1930
- newSessionTrigger: w,
1931
- onSelectPersonalAgent: b,
1932
- onShowPersonalAgentDetail: I,
1933
- onChatWithPersonalAgent: A,
1929
+ personalView: f,
1930
+ newSessionTrigger: I,
1931
+ onSelectPersonalAgent: A,
1932
+ onShowPersonalAgentDetail: y,
1933
+ onChatWithPersonalAgent: x,
1934
1934
  onSwitchMode: $
1935
1935
  }) {
1936
- var se;
1937
- const [D, O] = m(
1936
+ var _e;
1937
+ const [S, W] = m(
1938
1938
  // 惰性初始化:命中深链时直接以目标 Tab 首屏渲染,不先渲染场景工作台再切
1939
- () => Yl() ?? "workbench"
1939
+ () => ni() ?? "workbench"
1940
1940
  );
1941
- x(() => {
1941
+ R(() => {
1942
1942
  try {
1943
- const T = new URL(window.location.href);
1944
- if (!T.searchParams.has("tab")) return;
1945
- T.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", T.toString());
1943
+ const w = new URL(window.location.href);
1944
+ if (!w.searchParams.has("tab")) return;
1945
+ w.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", w.toString());
1946
1946
  } catch {
1947
1947
  }
1948
1948
  }, []);
1949
- const [H, M] = m(Xl);
1950
- x(() => {
1949
+ const [q, O] = m(ei);
1950
+ R(() => {
1951
1951
  try {
1952
- localStorage.setItem(Yt, H ? "1" : "0");
1952
+ localStorage.setItem(tn, q ? "1" : "0");
1953
1953
  } catch {
1954
1954
  }
1955
- }, [H]);
1956
- const k = V(() => {
1957
- M((T) => !T), window.setTimeout(() => window.dispatchEvent(new Event("resize")), 300);
1955
+ }, [q]);
1956
+ const L = z(() => {
1957
+ O((w) => !w), window.setTimeout(() => window.dispatchEvent(new Event("resize")), 300);
1958
1958
  }, []);
1959
- x(() => {
1960
- function T(Z) {
1961
- !(Z.metaKey || Z.ctrlKey) || Z.altKey || Z.key.toLowerCase() === "b" && (Jl(Z.target) || (Z.preventDefault(), k()));
1959
+ R(() => {
1960
+ function w(V) {
1961
+ !(V.metaKey || V.ctrlKey) || V.altKey || V.key.toLowerCase() === "b" && (ti(V.target) || (V.preventDefault(), L()));
1962
1962
  }
1963
- return window.addEventListener("keydown", T), () => window.removeEventListener("keydown", T);
1964
- }, [k]);
1965
- const J = Je((T) => T.currentUser), W = Jt.filter(
1966
- (T) => !T.permission || Vt(J, T.permission)
1967
- ), ue = De(() => $ ? [
1968
- { mode: "admin", label: "运营工作台", icon: /* @__PURE__ */ e(dn, {}) },
1969
- { mode: "collaboration", label: "协作工作台", icon: /* @__PURE__ */ e(un, {}) }
1963
+ return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
1964
+ }, [L]);
1965
+ const C = Ye((w) => w.currentUser), se = en.filter(
1966
+ (w) => !w.permission || qt(C, w.permission)
1967
+ ), K = Me(() => $ ? [
1968
+ { mode: "admin", label: "运营工作台", icon: /* @__PURE__ */ e(pn, {}) },
1969
+ { mode: "collaboration", label: "协作工作台", icon: /* @__PURE__ */ e(hn, {}) }
1970
1970
  ].filter(
1971
- (Z) => Ut(J, Z.mode)
1972
- ) : [], [J, $]), B = ((se = W.find((T) => T.key === D)) == null ? void 0 : se.label) ?? "个人工作台", [Y, R] = m(null), [S, K] = m(null), P = V((T) => {
1973
- O(T);
1974
- }, []), F = V((T) => {
1975
- O("notes"), R({ id: T, ts: Date.now() });
1976
- }, []), we = V((T) => {
1977
- O("todo"), K({ id: T, ts: Date.now() });
1971
+ (V) => Vt(C, V.mode)
1972
+ ) : [], [C, $]), ge = ((_e = se.find((w) => w.key === S)) == null ? void 0 : _e.label) ?? "个人工作台", [B, M] = m(null), [F, T] = m(null), J = z((w) => {
1973
+ W(w);
1974
+ }, []), U = z((w) => {
1975
+ W("notes"), M({ id: w, ts: Date.now() });
1976
+ }, []), j = z((w) => {
1977
+ W("todo"), T({ id: w, ts: Date.now() });
1978
1978
  }, []);
1979
- return x(() => {
1980
- d != null && d.id && (O("todo"), K({ id: d.id, ts: d.ts }));
1981
- }, [d == null ? void 0 : d.id, d == null ? void 0 : d.ts]), /* @__PURE__ */ i("div", { className: Oe.shell, children: [
1982
- /* @__PURE__ */ e("a", { className: Oe.skipLink, href: "#pw-content", children: "跳到个人工作台内容" }),
1979
+ return R(() => {
1980
+ d != null && d.id && (W("todo"), T({ id: d.id, ts: d.ts }));
1981
+ }, [d == null ? void 0 : d.id, d == null ? void 0 : d.ts]), /* @__PURE__ */ i("div", { className: Pe.shell, children: [
1982
+ /* @__PURE__ */ e("a", { className: Pe.skipLink, href: "#pw-content", children: "跳到个人工作台内容" }),
1983
1983
  /* @__PURE__ */ e(
1984
- Fl,
1984
+ Ul,
1985
1985
  {
1986
- items: W,
1987
- activeTab: D,
1988
- collapsed: H,
1989
- footerItems: ue,
1990
- onSelect: O,
1986
+ items: se,
1987
+ activeTab: S,
1988
+ collapsed: q,
1989
+ footerItems: K,
1990
+ onSelect: W,
1991
1991
  onSwitchMode: $
1992
1992
  }
1993
1993
  ),
1994
- /* @__PURE__ */ i("div", { className: Oe.inset, children: [
1994
+ /* @__PURE__ */ i("div", { className: Pe.inset, children: [
1995
1995
  /* @__PURE__ */ e(
1996
- Ql,
1996
+ Zl,
1997
1997
  {
1998
- label: B,
1999
- collapsed: H,
2000
- onToggleCollapse: k
1998
+ label: ge,
1999
+ collapsed: q,
2000
+ onToggleCollapse: L
2001
2001
  }
2002
2002
  ),
2003
2003
  /* @__PURE__ */ e(
@@ -2005,67 +2005,67 @@ function Zl({
2005
2005
  {
2006
2006
  id: "pw-content",
2007
2007
  tabIndex: -1,
2008
- "aria-label": `${B}内容`,
2009
- className: Oe.main,
2010
- children: /* @__PURE__ */ i("div", { className: Oe.pane, children: [
2011
- (D === "workbench" || D === "projects" || D === "personal") && /* @__PURE__ */ e(
2012
- bt,
2008
+ "aria-label": `${ge}内容`,
2009
+ className: Pe.main,
2010
+ children: /* @__PURE__ */ i("div", { className: Pe.pane, children: [
2011
+ (S === "workbench" || S === "projects" || S === "personal") && /* @__PURE__ */ e(
2012
+ Nt,
2013
2013
  {
2014
- activeTab: D,
2015
- onActiveTabChange: P,
2014
+ activeTab: S,
2015
+ onActiveTabChange: J,
2016
2016
  onOpenProject: s,
2017
2017
  hideTabs: !0
2018
2018
  }
2019
2019
  ),
2020
- D === "business-stats" && /* @__PURE__ */ e(xt, { source: "scenario" }),
2021
- D === "tools" && /* @__PURE__ */ e(dt, { showTools: !0, showWebsites: !1 }),
2022
- D === "websites" && /* @__PURE__ */ e(dt, { showTools: !1, showWebsites: !0 }),
2023
- D === "todo" && /* @__PURE__ */ e(
2024
- Rt,
2020
+ S === "business-stats" && /* @__PURE__ */ e(Rt, { source: "scenario" }),
2021
+ S === "tools" && /* @__PURE__ */ e(ut, { showTools: !0, showWebsites: !1 }),
2022
+ S === "websites" && /* @__PURE__ */ e(ut, { showTools: !1, showWebsites: !0 }),
2023
+ S === "todo" && /* @__PURE__ */ e(
2024
+ Et,
2025
2025
  {
2026
2026
  onOpenProject: s,
2027
- onOpenNote: F,
2028
- openTodoId: S
2027
+ onOpenNote: U,
2028
+ openTodoId: F
2029
2029
  }
2030
2030
  ),
2031
- D === "notes" && /* @__PURE__ */ e(
2032
- Et,
2031
+ S === "notes" && /* @__PURE__ */ e(
2032
+ $t,
2033
2033
  {
2034
2034
  onOpenProject: s,
2035
- onOpenTodo: we,
2036
- openNoteId: Y
2035
+ onOpenTodo: j,
2036
+ openNoteId: B
2037
2037
  }
2038
2038
  ),
2039
- D === "training" && /* @__PURE__ */ e(Gt, {}),
2040
- D === "webide" && /* @__PURE__ */ e(zt, {}),
2041
- D === "smart-partner" && /* @__PURE__ */ i("div", { className: Oe.personalMainArea, children: [
2042
- /* @__PURE__ */ e("div", { className: Oe.personalSidebar, children: /* @__PURE__ */ e(
2043
- fl,
2039
+ S === "training" && /* @__PURE__ */ e(Qt, {}),
2040
+ S === "webide" && /* @__PURE__ */ e(Xt, {}),
2041
+ S === "smart-partner" && /* @__PURE__ */ i("div", { className: Pe.personalMainArea, children: [
2042
+ /* @__PURE__ */ e("div", { className: Pe.personalSidebar, children: /* @__PURE__ */ e(
2043
+ Nl,
2044
2044
  {
2045
2045
  selectedAgentId: (u == null ? void 0 : u.id) ?? null,
2046
2046
  selectedLocalAgentId: (u == null ? void 0 : u.localAgentId) ?? null,
2047
- onSelectAgent: b,
2048
- onShowDetail: I,
2049
- onChatWithAgent: A
2047
+ onSelectAgent: A,
2048
+ onShowDetail: y,
2049
+ onChatWithAgent: x
2050
2050
  }
2051
2051
  ) }),
2052
- /* @__PURE__ */ e("div", { className: Oe.personalChatArea, children: y === "detail" && u && !u.isLocal ? /* @__PURE__ */ e(
2053
- qt,
2052
+ /* @__PURE__ */ e("div", { className: Pe.personalChatArea, children: f === "detail" && u && !u.isLocal ? /* @__PURE__ */ e(
2053
+ Jt,
2054
2054
  {
2055
2055
  agent: u,
2056
- onBack: () => b(u)
2056
+ onBack: () => A(u)
2057
2057
  }
2058
2058
  ) : u != null && u.isLocal ? /* @__PURE__ */ e(
2059
- Xt,
2059
+ Zt,
2060
2060
  {
2061
2061
  agent: u,
2062
- newSessionTrigger: w
2062
+ newSessionTrigger: I
2063
2063
  }
2064
2064
  ) : /* @__PURE__ */ e(
2065
- Qt,
2065
+ Yt,
2066
2066
  {
2067
2067
  agent: u,
2068
- newSessionTrigger: w
2068
+ newSessionTrigger: I
2069
2069
  }
2070
2070
  ) })
2071
2071
  ] })
@@ -2075,49 +2075,49 @@ function Zl({
2075
2075
  ] })
2076
2076
  ] });
2077
2077
  }
2078
- const X = qn() || typeof localStorage < "u" && localStorage.getItem("ft_exclusive_force_desktop") === "1", ei = `${window.publicPath ?? "/"}logo.svg`, ti = [
2078
+ const Z = Jn() || typeof localStorage < "u" && localStorage.getItem("ft_exclusive_force_desktop") === "1", ai = `${window.publicPath ?? "/"}logo.svg`, li = [
2079
2079
  "帮我排查一个线上问题",
2080
2080
  "总结一下今天的群聊进展",
2081
2081
  "把这周的变更整理成周报"
2082
- ], ni = [
2082
+ ], ii = [
2083
2083
  {
2084
2084
  key: "video",
2085
2085
  label: "视频生成",
2086
- icon: /* @__PURE__ */ e(bn, {}),
2086
+ icon: /* @__PURE__ */ e(kn, {}),
2087
2087
  action: "chat",
2088
2088
  prompt: "帮我写一条 15 秒短视频脚本,主题是:"
2089
2089
  },
2090
2090
  {
2091
2091
  key: "docs",
2092
2092
  label: "文档办公",
2093
- icon: /* @__PURE__ */ e(Ft, {}),
2093
+ icon: /* @__PURE__ */ e(jt, {}),
2094
2094
  action: "tools"
2095
2095
  },
2096
2096
  {
2097
2097
  key: "vibe",
2098
2098
  label: "Vibe Coding",
2099
- icon: /* @__PURE__ */ e(Qn, {}),
2099
+ icon: /* @__PURE__ */ e(Yn, {}),
2100
2100
  action: "webide"
2101
2101
  },
2102
2102
  {
2103
2103
  key: "design",
2104
2104
  label: "设计视觉",
2105
- icon: /* @__PURE__ */ e(Xn, {}),
2105
+ icon: /* @__PURE__ */ e(Zn, {}),
2106
2106
  action: "chat",
2107
2107
  prompt: "帮我出一版视觉设计稿,风格偏:"
2108
2108
  },
2109
2109
  {
2110
2110
  key: "ask",
2111
2111
  label: "问问 Z-Team",
2112
- icon: /* @__PURE__ */ e(rt, {}),
2112
+ icon: /* @__PURE__ */ e(dt, {}),
2113
2113
  action: "ask"
2114
2114
  }
2115
2115
  ];
2116
- function si() {
2116
+ function ci() {
2117
2117
  const s = (/* @__PURE__ */ new Date()).getHours();
2118
2118
  return s < 5 ? "夜深了" : s < 12 ? "早上好" : s < 14 ? "中午好" : s < 18 ? "下午好" : "晚上好";
2119
2119
  }
2120
- function ai(s) {
2120
+ function oi(s) {
2121
2121
  return s.type === "jar" ? {
2122
2122
  id: "-1",
2123
2123
  userId: "local",
@@ -2138,118 +2138,118 @@ function ai(s) {
2138
2138
  localAgentType: s.type
2139
2139
  };
2140
2140
  }
2141
- function vi({
2141
+ function ki({
2142
2142
  onSwitchMode: s,
2143
2143
  onOpenProject: d,
2144
2144
  openAgentRequest: u
2145
2145
  }) {
2146
- const y = Je((n) => n.token), w = Je((n) => n.currentUser), [b, I] = m([]), [A, $] = m(!0), [D, O] = m(null), [H, M] = m("landing"), [k, J] = m(null), [W, ue] = m(
2147
- X ? "local" : "cloud"
2148
- ), [B, Y] = m(
2146
+ const f = Ye((n) => n.token), I = Ye((n) => n.currentUser), A = Gt(), [y, x] = m([]), [$, S] = m(!0), [W, q] = m(null), [O, L] = m("landing"), [C, se] = m(null), [K, ge] = m(
2147
+ Z ? "local" : "cloud"
2148
+ ), [B, M] = m(
2149
2149
  []
2150
- ), [R, S] = m([]), [K, P] = m(!0), [F, we] = m([]), [se, T] = m(null), [Z, _e] = m(
2150
+ ), [F, T] = m([]), [J, U] = m(!0), [j, _e] = m([]), [w, V] = m(null), [Re, Ce] = m(
2151
2151
  /* @__PURE__ */ new Set()
2152
- ), [G, fe] = m(0), [ye, Ce] = m(null), [ke, Ie] = m(!1), [me, ve] = m([]), [le, Pe] = m(null), [be, he] = m(""), Se = j(null), [ie, xe] = m(!1), [pe, Ae] = m(!1), [ee, Re] = m(null), [Ve, Fe] = m(!1), l = V(
2152
+ ), [G, fe] = m(0), [ye, Ie] = m(null), [ve, Ee] = m(!1), [ee, Se] = m([]), [ce, $e] = m(null), [ke, ue] = m(""), be = P(null), [me, Ae] = m(!1), [Te, Be] = m(!1), [Y, je] = m(null), [Ge, l] = m(!1), v = z(
2153
2153
  (n) => {
2154
- const g = $n(n);
2155
- g && !Vt(w, g) || (ze(n), M("personalTab"));
2154
+ const g = Pn(n);
2155
+ g && !qt(I, g) || (qe(n), L("personalTab"));
2156
2156
  },
2157
- [w]
2158
- ), [f, U] = m(!1), [ce, z] = m(
2157
+ [I]
2158
+ ), [H, pe] = m(!1), [he, ae] = m(
2159
2159
  null
2160
- ), [je, Ee] = m(
2160
+ ), [We, Oe] = m(
2161
2161
  null
2162
- ), [We, Ye] = m(
2162
+ ), [Ke, Ze] = m(
2163
2163
  null
2164
- ), te = V(
2164
+ ), te = z(
2165
2165
  (n, g) => {
2166
2166
  d == null || d(n, g);
2167
2167
  },
2168
2168
  [d]
2169
- ), Ge = V((n) => {
2170
- ze("todo"), Ye({ id: n, ts: Date.now() });
2171
- }, []), [ge, ze] = m("personal"), Ze = j(!1), re = De(() => On(b), [b]), Ne = De(
2172
- () => b.find((n) => n.id === D) ?? re,
2173
- [b, D, re]
2169
+ ), ze = z((n) => {
2170
+ qe("todo"), Ze({ id: n, ts: Date.now() });
2171
+ }, []), [oe, qe] = m("personal"), et = P(!1), re = Me(() => Fn(y), [y]), Ne = Me(
2172
+ () => y.find((n) => n.id === W) ?? re,
2173
+ [y, W, re]
2174
2174
  );
2175
- X && ke && me.length > 0;
2176
- const q = De(
2177
- () => me.find((n) => n.id === le) ?? null,
2178
- [me, le]
2175
+ Z && ve && ee.length > 0;
2176
+ const Q = Me(
2177
+ () => ee.find((n) => n.id === ce) ?? null,
2178
+ [ee, ce]
2179
2179
  );
2180
- x(() => {
2180
+ R(() => {
2181
2181
  let n = !0;
2182
- return $(!0), jt(y).then((g) => {
2183
- n && I(g);
2182
+ return S(!0), Wt(f).then((g) => {
2183
+ n && x(g);
2184
2184
  }).catch(() => {
2185
2185
  }).finally(() => {
2186
- n && $(!1);
2186
+ n && S(!1);
2187
2187
  }), () => {
2188
2188
  n = !1;
2189
2189
  };
2190
- }, [y]), x(() => {
2191
- if (!X) return;
2190
+ }, [f]), R(() => {
2191
+ if (!Z) return;
2192
2192
  let n = !0;
2193
2193
  const g = async () => {
2194
- const t = await vt();
2194
+ const t = await bt();
2195
2195
  if (n) {
2196
- if (Ie(t), !t) {
2197
- ve([]);
2196
+ if (Ee(t), !t) {
2197
+ Se([]);
2198
2198
  return;
2199
2199
  }
2200
2200
  try {
2201
- const o = await Kt();
2202
- n && ve(o);
2201
+ const o = await Ut();
2202
+ n && Se(o);
2203
2203
  } catch {
2204
2204
  }
2205
2205
  }
2206
2206
  };
2207
2207
  g();
2208
- const C = window.setInterval(() => void g(), 3e4);
2208
+ const k = window.setInterval(() => void g(), 3e4);
2209
2209
  return () => {
2210
- n = !1, window.clearInterval(C);
2210
+ n = !1, window.clearInterval(k);
2211
2211
  };
2212
- }, []), x(() => {
2213
- if (!X || me.length === 0 || le && me.some((g) => g.id === le))
2212
+ }, []), R(() => {
2213
+ if (!Z || ee.length === 0 || ce && ee.some((g) => g.id === ce))
2214
2214
  return;
2215
- const n = me.find((g) => g.type === "jar");
2216
- Pe((n ?? me[0]).id);
2217
- }, [me, le]);
2218
- const st = De(() => {
2215
+ const n = ee.find((g) => g.type === "jar");
2216
+ $e((n ?? ee[0]).id);
2217
+ }, [ee, ce]);
2218
+ const at = Me(() => {
2219
2219
  const n = /* @__PURE__ */ new Map();
2220
- for (const g of b) n.set(g.id, g);
2220
+ for (const g of y) n.set(g.id, g);
2221
2221
  return n;
2222
- }, [b]), et = V(async () => {
2223
- P(!0);
2222
+ }, [y]), tt = z(async () => {
2223
+ U(!0);
2224
2224
  const [n, g] = await Promise.allSettled([
2225
- Sn(y),
2226
- Jn(y)
2225
+ Ln(f),
2226
+ ss(f)
2227
2227
  ]);
2228
- if (n.status === "fulfilled" && Y(n.value || []), g.status === "fulfilled") {
2229
- const C = /* @__PURE__ */ new Set(), t = [];
2228
+ if (n.status === "fulfilled" && M(n.value || []), g.status === "fulfilled") {
2229
+ const k = /* @__PURE__ */ new Set(), t = [];
2230
2230
  for (const o of [...g.value.owned, ...g.value.joined])
2231
- C.has(o.id) || (C.add(o.id), t.push(o));
2232
- S(t);
2231
+ k.has(o.id) || (k.add(o.id), t.push(o));
2232
+ T(t);
2233
2233
  }
2234
- P(!1);
2235
- }, [y]);
2236
- x(() => {
2237
- et();
2238
- }, [et, k == null ? void 0 : k.ts]);
2239
- const Be = De(() => {
2234
+ U(!1);
2235
+ }, [f]);
2236
+ R(() => {
2237
+ tt();
2238
+ }, [tt, C == null ? void 0 : C.ts]);
2239
+ const Le = Me(() => {
2240
2240
  const n = /* @__PURE__ */ new Map();
2241
- for (const a of R)
2241
+ for (const a of F)
2242
2242
  n.set(`sp:${String(a.id)}`, {
2243
2243
  key: `sp:${String(a.id)}`,
2244
2244
  title: a.title,
2245
2245
  sessions: []
2246
2246
  });
2247
- const g = [], C = [...B].sort(
2247
+ const g = [], k = [...B].sort(
2248
2248
  (a, _) => (_.updateTime || _.createTime || "").localeCompare(
2249
2249
  a.updateTime || a.createTime || ""
2250
2250
  )
2251
2251
  );
2252
- for (const a of C)
2252
+ for (const a of k)
2253
2253
  if (a.projectSpaceId != null) {
2254
2254
  const _ = `sp:${String(a.projectSpaceId)}`;
2255
2255
  n.has(_) || n.set(_, {
@@ -2260,163 +2260,163 @@ function vi({
2260
2260
  } else
2261
2261
  g.push(a);
2262
2262
  const t = (a) => {
2263
- var _, p;
2264
- return ((_ = a.sessions[0]) == null ? void 0 : _.updateTime) || ((p = a.sessions[0]) == null ? void 0 : p.createTime) || "";
2263
+ var _, h;
2264
+ return ((_ = a.sessions[0]) == null ? void 0 : _.updateTime) || ((h = a.sessions[0]) == null ? void 0 : h.createTime) || "";
2265
2265
  }, o = [...n.values()];
2266
2266
  return o.sort((a, _) => a.sessions.length > 0 && _.sessions.length > 0 ? t(_).localeCompare(t(a)) : a.sessions.length > 0 ? -1 : _.sessions.length > 0 ? 1 : a.title.localeCompare(_.title)), g.length > 0 && o.push({ key: "sp:none", title: "未归组", sessions: g }), o;
2267
- }, [R, B]), at = De(
2267
+ }, [F, B]), lt = Me(
2268
2268
  () => {
2269
2269
  var n;
2270
- return k != null && k.sessionId ? ((n = Be.find(
2271
- (g) => g.sessions.some((C) => C.id === k.sessionId)
2270
+ return C != null && C.sessionId ? ((n = Le.find(
2271
+ (g) => g.sessions.some((k) => k.id === C.sessionId)
2272
2272
  )) == null ? void 0 : n.key) ?? null : null;
2273
2273
  },
2274
- [Be, k == null ? void 0 : k.sessionId]
2274
+ [Le, C == null ? void 0 : C.sessionId]
2275
2275
  );
2276
- x(() => {
2276
+ R(() => {
2277
2277
  var g;
2278
- const n = at ?? (Ze.current ? null : ((g = Be.find((C) => C.sessions.length > 0)) == null ? void 0 : g.key) ?? null);
2279
- n && (Ze.current = !0, _e(
2280
- (C) => C.has(n) ? C : new Set(C).add(n)
2278
+ const n = lt ?? (et.current ? null : ((g = Le.find((k) => k.sessions.length > 0)) == null ? void 0 : g.key) ?? null);
2279
+ n && (et.current = !0, Ce(
2280
+ (k) => k.has(n) ? k : new Set(k).add(n)
2281
2281
  ));
2282
- }, [at, Be]);
2283
- const tt = q && q.type !== "jar" ? q.id : void 0;
2284
- x(() => {
2285
- if (!X || W !== "local" || !ke) return;
2282
+ }, [lt, Le]);
2283
+ const nt = Q && Q.type !== "jar" ? Q.id : void 0;
2284
+ R(() => {
2285
+ if (!Z || K !== "local" || !ve) return;
2286
2286
  let n = !0;
2287
- return Wt(tt).then((g) => {
2288
- n && we([...g].sort((C, t) => t.updatedAt - C.updatedAt));
2287
+ return Kt(nt).then((g) => {
2288
+ n && _e([...g].sort((k, t) => t.updatedAt - k.updatedAt));
2289
2289
  }).catch(() => {
2290
- n && we([]);
2290
+ n && _e([]);
2291
2291
  }), () => {
2292
2292
  n = !1;
2293
2293
  };
2294
2294
  }, [
2295
- W,
2296
- ke,
2297
- tt,
2298
- se,
2295
+ K,
2296
+ ve,
2297
+ nt,
2298
+ w,
2299
2299
  G
2300
2300
  ]);
2301
- const ut = V(() => T(null), []), Ke = (n) => {
2302
- J(null), T(n), M("chat");
2303
- }, ae = (n, g = null, C = null) => {
2304
- O(n.id), J(
2305
- (t) => t && t.agent.id === n.id && t.sessionId === g && !C ? t : { agent: n, sessionId: g, draft: C, ts: Date.now() }
2306
- ), M("chat");
2301
+ const mt = z(() => V(null), []), Ue = (n) => {
2302
+ se(null), V(n), L("chat");
2303
+ }, le = (n, g = null, k = null) => {
2304
+ q(n.id), se(
2305
+ (t) => t && t.agent.id === n.id && t.sessionId === g && !k ? t : { agent: n, sessionId: g, draft: k, ts: Date.now() }
2306
+ ), L("chat");
2307
2307
  };
2308
- x(() => {
2308
+ R(() => {
2309
2309
  const n = u;
2310
2310
  if (!(n != null && n.agent) || !n.ts) return;
2311
2311
  const g = n.agent;
2312
- if (O(g.id), n.view === "detail") {
2313
- z(g), M("agentDetail");
2312
+ if (q(g.id), n.view === "detail") {
2313
+ ae(g), L("agentDetail");
2314
2314
  return;
2315
2315
  }
2316
- ae(g, n.sessionId ?? null), n.newSession > 0 && fe((C) => C + 1);
2316
+ le(g, n.sessionId ?? null), n.newSession > 0 && fe((k) => k + 1);
2317
2317
  }, [u == null ? void 0 : u.ts]);
2318
- const qe = () => {
2319
- O((re == null ? void 0 : re.id) ?? null), J(null), he(""), M("landing");
2320
- }, lt = () => {
2321
- fe((n) => n + 1), J(null), M("chat");
2318
+ const Qe = () => {
2319
+ q((re == null ? void 0 : re.id) ?? null), se(null), ue(""), L("landing");
2322
2320
  }, it = () => {
2323
- if (X && q) {
2324
- lt();
2321
+ fe((n) => n + 1), se(null), L("chat");
2322
+ }, ct = () => {
2323
+ if (Z && Q) {
2324
+ it();
2325
2325
  return;
2326
2326
  }
2327
2327
  if (re) {
2328
- ae(re);
2328
+ le(re);
2329
2329
  return;
2330
2330
  }
2331
- qe();
2332
- }, mt = () => {
2333
- k ? M("chat") : re && ae(re);
2334
- }, Ue = async () => {
2335
- const n = be.trim();
2336
- if (!(!n || ie)) {
2337
- if (X && q) {
2338
- Ce(n), he(""), M("chat");
2331
+ Qe();
2332
+ }, pt = () => {
2333
+ C ? L("chat") : re && le(re);
2334
+ }, Ve = async () => {
2335
+ const n = ke.trim();
2336
+ if (!(!n || me)) {
2337
+ if (Z && Q) {
2338
+ Ie(n), ue(""), L("chat");
2339
2339
  return;
2340
2340
  }
2341
2341
  if (Ne) {
2342
- xe(!0);
2342
+ Ae(!0);
2343
2343
  try {
2344
- const g = n.length > 20 ? `${n.slice(0, 20)}…` : n, C = await An(
2344
+ const g = n.length > 20 ? `${n.slice(0, 20)}…` : n, k = await Dn(
2345
2345
  Ne.id,
2346
2346
  g,
2347
- y,
2348
- ee
2347
+ f,
2348
+ Y
2349
2349
  );
2350
- Re(null), J({
2350
+ je(null), se({
2351
2351
  agent: Ne,
2352
- sessionId: C.id,
2352
+ sessionId: k.id,
2353
2353
  draft: n,
2354
2354
  ts: Date.now()
2355
- }), he(""), M("chat");
2355
+ }), ue(""), L("chat");
2356
2356
  } catch {
2357
2357
  } finally {
2358
- xe(!1);
2358
+ Ae(!1);
2359
2359
  }
2360
2360
  }
2361
2361
  }
2362
- }, Qe = (w == null ? void 0 : w.display_name) || (w == null ? void 0 : w.username) || "", ht = De(() => s ? [
2362
+ }, Xe = A.nickname || (I == null ? void 0 : I.display_name) || (I == null ? void 0 : I.username) || "", ht = Me(() => s ? [
2363
2363
  {
2364
2364
  mode: "personal",
2365
2365
  label: "个人工作台",
2366
- icon: /* @__PURE__ */ e(Gn, {})
2366
+ icon: /* @__PURE__ */ e(Qn, {})
2367
2367
  },
2368
2368
  {
2369
2369
  mode: "collaboration",
2370
2370
  label: "协作工作台",
2371
- icon: /* @__PURE__ */ e(zn, {})
2371
+ icon: /* @__PURE__ */ e(Xn, {})
2372
2372
  }
2373
2373
  ].filter(
2374
- (g) => Ut(w, g.mode)
2375
- ) : [], [w, s]), pt = k ? `${k.agent.id}-${k.sessionId ?? 0}-${k.ts}` : "none";
2376
- let oe;
2377
- return H === "agentDetail" && ce ? oe = /* @__PURE__ */ e("div", { className: h.detailHost, children: /* @__PURE__ */ e(
2378
- qt,
2374
+ (g) => Vt(I, g.mode)
2375
+ ) : [], [I, s]), gt = C ? `${C.agent.id}-${C.sessionId ?? 0}-${C.ts}` : "none";
2376
+ let ie;
2377
+ return O === "agentDetail" && he ? ie = /* @__PURE__ */ e("div", { className: p.detailHost, children: /* @__PURE__ */ e(
2378
+ Jt,
2379
2379
  {
2380
- agent: ce,
2381
- onBack: () => M("extensions")
2380
+ agent: he,
2381
+ onBack: () => L("extensions")
2382
2382
  }
2383
- ) }) : H === "schedule" ? oe = /* @__PURE__ */ e(ss, { localOnline: ke }) : H === "extensions" ? oe = /* @__PURE__ */ e(
2384
- as,
2383
+ ) }) : O === "schedule" ? ie = /* @__PURE__ */ e(cs, { localOnline: ve }) : O === "extensions" ? ie = /* @__PURE__ */ e(
2384
+ os,
2385
2385
  {
2386
- agents: b,
2387
- loading: A,
2386
+ agents: y,
2387
+ loading: $,
2388
2388
  skillsAgent: re,
2389
- token: y,
2390
- onChat: (n) => ae(n),
2389
+ token: f,
2390
+ onChat: (n) => le(n),
2391
2391
  onConfig: (n) => {
2392
- z(n), M("agentDetail");
2392
+ ae(n), L("agentDetail");
2393
2393
  },
2394
- onCreated: (n) => I((g) => [...g, n])
2394
+ onCreated: (n) => x((g) => [...g, n])
2395
2395
  }
2396
- ) : H === "history" ? oe = /* @__PURE__ */ e(
2397
- ls,
2396
+ ) : O === "history" ? ie = /* @__PURE__ */ e(
2397
+ rs,
2398
2398
  {
2399
- agents: b,
2400
- token: y,
2401
- onOpenSession: (n, g) => ae(n, g)
2399
+ agents: y,
2400
+ token: f,
2401
+ onOpenSession: (n, g) => le(n, g)
2402
2402
  }
2403
- ) : H === "workbenchShell" ? oe = /* @__PURE__ */ e(
2404
- Zl,
2403
+ ) : O === "workbenchShell" ? ie = /* @__PURE__ */ e(
2404
+ si,
2405
2405
  {
2406
2406
  onOpenProject: te,
2407
2407
  selectedPersonalAgent: Ne,
2408
2408
  personalView: "chat",
2409
2409
  newSessionTrigger: G,
2410
- onSelectPersonalAgent: (n) => O((n == null ? void 0 : n.id) ?? null),
2410
+ onSelectPersonalAgent: (n) => q((n == null ? void 0 : n.id) ?? null),
2411
2411
  onShowPersonalAgentDetail: (n) => {
2412
- z(n), M("agentDetail");
2412
+ ae(n), L("agentDetail");
2413
2413
  },
2414
- onChatWithPersonalAgent: (n) => ae(n),
2414
+ onChatWithPersonalAgent: (n) => le(n),
2415
2415
  onSwitchMode: s
2416
2416
  }
2417
- ) : H === "personalTab" ? oe = /* @__PURE__ */ i("div", { className: h.personalTabHost, children: [
2418
- ge === "projects" && /* @__PURE__ */ e(
2419
- bt,
2417
+ ) : O === "personalTab" ? ie = /* @__PURE__ */ i("div", { className: p.personalTabHost, children: [
2418
+ oe === "projects" && /* @__PURE__ */ e(
2419
+ Nt,
2420
2420
  {
2421
2421
  activeTab: "projects",
2422
2422
  onActiveTabChange: () => {
@@ -2425,8 +2425,8 @@ function vi({
2425
2425
  hideTabs: !0
2426
2426
  }
2427
2427
  ),
2428
- ge === "personal" && /* @__PURE__ */ e(
2429
- bt,
2428
+ oe === "personal" && /* @__PURE__ */ e(
2429
+ Nt,
2430
2430
  {
2431
2431
  activeTab: "personal",
2432
2432
  onActiveTabChange: () => {
@@ -2435,119 +2435,116 @@ function vi({
2435
2435
  hideTabs: !0
2436
2436
  }
2437
2437
  ),
2438
- ge === "business-stats" && /* @__PURE__ */ e(xt, { source: "scenario" }),
2439
- ge === "tools" && /* @__PURE__ */ e(dt, { showTools: !0, showWebsites: !1 }),
2440
- ge === "websites" && /* @__PURE__ */ e(dt, { showTools: !1, showWebsites: !0 }),
2441
- ge === "todo" && /* @__PURE__ */ e(
2442
- Rt,
2438
+ oe === "business-stats" && /* @__PURE__ */ e(Rt, { source: "scenario" }),
2439
+ oe === "tools" && /* @__PURE__ */ e(ut, { showTools: !0, showWebsites: !1 }),
2440
+ oe === "websites" && /* @__PURE__ */ e(ut, { showTools: !1, showWebsites: !0 }),
2441
+ oe === "todo" && /* @__PURE__ */ e(
2442
+ Et,
2443
2443
  {
2444
2444
  onOpenProject: te,
2445
2445
  onOpenNote: (n) => {
2446
- ze("notes"), Ee({ id: n, ts: Date.now() });
2446
+ qe("notes"), Oe({ id: n, ts: Date.now() });
2447
2447
  },
2448
- openTodoId: We
2448
+ openTodoId: Ke
2449
2449
  }
2450
2450
  ),
2451
- ge === "notes" && /* @__PURE__ */ e(
2452
- Et,
2451
+ oe === "notes" && /* @__PURE__ */ e(
2452
+ $t,
2453
2453
  {
2454
2454
  onOpenProject: te,
2455
- onOpenTodo: Ge,
2456
- openNoteId: je
2455
+ onOpenTodo: ze,
2456
+ openNoteId: We
2457
2457
  }
2458
2458
  ),
2459
- ge === "training" && /* @__PURE__ */ e(Gt, {}),
2460
- ge === "webide" && /* @__PURE__ */ e(zt, {})
2461
- ] }) : k ? oe = /* @__PURE__ */ e("div", { className: h.chatHost, children: /* @__PURE__ */ e(
2462
- Qt,
2459
+ oe === "training" && /* @__PURE__ */ e(Qt, {}),
2460
+ oe === "webide" && /* @__PURE__ */ e(Xt, {})
2461
+ ] }) : C ? ie = /* @__PURE__ */ e("div", { className: p.chatHost, children: /* @__PURE__ */ e(
2462
+ Yt,
2463
2463
  {
2464
- agent: k.agent,
2465
- initialSessionId: k.sessionId,
2466
- autoSendDraft: k.draft,
2464
+ agent: C.agent,
2465
+ initialSessionId: C.sessionId,
2466
+ autoSendDraft: C.draft,
2467
2467
  chromeless: !0,
2468
- agents: b,
2469
- onSwitchAgent: (n) => ae(n)
2468
+ agents: y,
2469
+ onSwitchAgent: (n) => le(n)
2470
2470
  },
2471
- pt
2472
- ) }) : X && q && H !== "landing" ? oe = /* @__PURE__ */ e("div", { className: h.chatHost, children: /* @__PURE__ */ e(
2473
- Xt,
2471
+ gt
2472
+ ) }) : Z && Q && O !== "landing" ? ie = /* @__PURE__ */ e("div", { className: p.chatHost, children: /* @__PURE__ */ e(
2473
+ Zt,
2474
2474
  {
2475
- agent: ai(q),
2475
+ agent: oi(Q),
2476
2476
  newSessionTrigger: G,
2477
2477
  autoSendDraft: ye,
2478
- onAutoSendConsumed: () => Ce(null),
2479
- openSessionId: se,
2480
- onOpenSessionConsumed: ut
2478
+ onAutoSendConsumed: () => Ie(null),
2479
+ openSessionId: w,
2480
+ onOpenSessionConsumed: mt
2481
2481
  },
2482
- q.id
2483
- ) }) : oe = /* @__PURE__ */ e("div", { className: h.landing, children: /* @__PURE__ */ i("div", { className: h.landingInner, children: [
2484
- /* @__PURE__ */ e("div", { className: h.mascot, "aria-hidden": "true", children: /* @__PURE__ */ e("img", { src: ei, alt: "" }) }),
2485
- /* @__PURE__ */ i("h1", { className: h.landingTitle, children: [
2486
- si(),
2487
- Qe ? `,${Qe}` : ""
2488
- ] }),
2489
- /* @__PURE__ */ e("p", { className: h.landingSub, children: "我是你的智能伙伴,有什么可以帮你?" }),
2490
- /* @__PURE__ */ i("div", { className: h.landingBox, children: [
2482
+ Q.id
2483
+ ) }) : ie = /* @__PURE__ */ e("div", { className: p.landing, children: /* @__PURE__ */ i("div", { className: p.landingInner, children: [
2484
+ /* @__PURE__ */ e("div", { className: p.mascot, "aria-hidden": "true", children: /* @__PURE__ */ e("img", { src: ai, alt: "" }) }),
2485
+ /* @__PURE__ */ e("h1", { className: p.landingTitle, children: A.greetingEnabled ? `${ci()}${Xe ? `,${Xe}` : ""}` : "开始新的对话" }),
2486
+ /* @__PURE__ */ e("p", { className: p.landingSub, children: A.bio || "我是你的智能伙伴,有什么可以帮你?" }),
2487
+ /* @__PURE__ */ i("div", { className: p.landingBox, children: [
2491
2488
  /* @__PURE__ */ e(
2492
2489
  "textarea",
2493
2490
  {
2494
- ref: Se,
2495
- className: h.landingInput,
2496
- placeholder: "给智能伙伴发送消息,Enter 发送,Shift+Enter 换行",
2491
+ ref: be,
2492
+ className: p.landingInput,
2493
+ placeholder: `给智能伙伴发送消息,${ns(A.sendKey)}`,
2497
2494
  rows: 3,
2498
- value: be,
2495
+ value: ke,
2499
2496
  autoFocus: !0,
2500
- onChange: (n) => he(n.target.value),
2497
+ onChange: (n) => ue(n.target.value),
2501
2498
  onKeyDown: (n) => {
2502
- n.key === "Enter" && !n.shiftKey && !n.nativeEvent.isComposing && (n.preventDefault(), Ue());
2499
+ zt(n, A.sendKey) && !n.nativeEvent.isComposing && (n.preventDefault(), Ve());
2503
2500
  }
2504
2501
  }
2505
2502
  ),
2506
- /* @__PURE__ */ i("div", { className: h.landingBoxBar, children: [
2507
- X && q ? /* @__PURE__ */ i("span", { className: h.agentChip, children: [
2508
- /* @__PURE__ */ e(rt, {}),
2503
+ /* @__PURE__ */ i("div", { className: p.landingBoxBar, children: [
2504
+ Z && Q ? /* @__PURE__ */ i("span", { className: p.agentChip, children: [
2505
+ /* @__PURE__ */ e(dt, {}),
2509
2506
  /* @__PURE__ */ i("span", { children: [
2510
- q.name,
2507
+ Q.name,
2511
2508
  "(本机)"
2512
2509
  ] })
2513
- ] }) : Ne ? /* @__PURE__ */ i("div", { className: h.agentChipWrap, children: [
2510
+ ] }) : Ne ? /* @__PURE__ */ i("div", { className: p.agentChipWrap, children: [
2514
2511
  /* @__PURE__ */ i(
2515
2512
  "button",
2516
2513
  {
2517
2514
  type: "button",
2518
- className: h.agentChip,
2519
- onClick: () => Ae((n) => !n),
2515
+ className: p.agentChip,
2516
+ onClick: () => Be((n) => !n),
2520
2517
  children: [
2521
- /* @__PURE__ */ e(rt, {}),
2518
+ /* @__PURE__ */ e(dt, {}),
2522
2519
  /* @__PURE__ */ e("span", { children: Ne.displayName }),
2523
- b.length > 1 && /* @__PURE__ */ e(_t, { className: h.chipCaret })
2520
+ y.length > 1 && /* @__PURE__ */ e(ft, { className: p.chipCaret })
2524
2521
  ]
2525
2522
  }
2526
2523
  ),
2527
- pe && b.length > 1 && /* @__PURE__ */ i(Me, { children: [
2524
+ Te && y.length > 1 && /* @__PURE__ */ i(xe, { children: [
2528
2525
  /* @__PURE__ */ e(
2529
2526
  "div",
2530
2527
  {
2531
- className: h.agentMenuMask,
2532
- onClick: () => Ae(!1)
2528
+ className: p.agentMenuMask,
2529
+ onClick: () => Be(!1)
2533
2530
  }
2534
2531
  ),
2535
- /* @__PURE__ */ e("div", { className: h.agentMenu, role: "menu", children: b.map((n) => /* @__PURE__ */ i(
2532
+ /* @__PURE__ */ e("div", { className: p.agentMenu, role: "menu", children: y.map((n) => /* @__PURE__ */ i(
2536
2533
  "button",
2537
2534
  {
2538
2535
  type: "button",
2539
2536
  role: "menuitem",
2540
- className: `${h.agentMenuItem} ${n.id === Ne.id ? h.agentMenuItemActive : ""}`,
2537
+ className: `${p.agentMenuItem} ${n.id === Ne.id ? p.agentMenuItemActive : ""}`,
2541
2538
  onClick: () => {
2542
- O(n.id), Ae(!1);
2539
+ q(n.id), Be(!1);
2543
2540
  },
2544
2541
  children: [
2545
2542
  /* @__PURE__ */ e(
2546
2543
  "span",
2547
2544
  {
2548
- className: h.agentDot,
2549
- style: { background: Pn(n.displayName) },
2550
- children: Hn(n.displayName)
2545
+ className: p.agentDot,
2546
+ style: { background: Wn(n.displayName) },
2547
+ children: jn(n.displayName)
2551
2548
  }
2552
2549
  ),
2553
2550
  n.displayName
@@ -2556,37 +2553,37 @@ function vi({
2556
2553
  n.id
2557
2554
  )) })
2558
2555
  ] })
2559
- ] }) : /* @__PURE__ */ e("span", { className: h.agentChipEmpty, children: "还没有云端伙伴,可到个人工作台创建" }),
2560
- !(X && q) && Ne && /* @__PURE__ */ i("div", { className: h.agentChipWrap, children: [
2556
+ ] }) : /* @__PURE__ */ e("span", { className: p.agentChipEmpty, children: "还没有云端伙伴,可到个人工作台创建" }),
2557
+ !(Z && Q) && Ne && /* @__PURE__ */ i("div", { className: p.agentChipWrap, children: [
2561
2558
  /* @__PURE__ */ i(
2562
2559
  "button",
2563
2560
  {
2564
2561
  type: "button",
2565
- className: h.agentChip,
2562
+ className: p.agentChip,
2566
2563
  title: "本次新建任务归入的项目空间(可选)",
2567
- onClick: () => Fe((n) => !n),
2564
+ onClick: () => l((n) => !n),
2568
2565
  children: [
2569
- /* @__PURE__ */ e(ft, {}),
2570
- /* @__PURE__ */ e("span", { children: ee ? ee.title : "不归组" }),
2571
- /* @__PURE__ */ e(_t, { className: h.chipCaret })
2566
+ /* @__PURE__ */ e(yt, {}),
2567
+ /* @__PURE__ */ e("span", { children: Y ? Y.title : "不归组" }),
2568
+ /* @__PURE__ */ e(ft, { className: p.chipCaret })
2572
2569
  ]
2573
2570
  }
2574
2571
  ),
2575
- Ve && /* @__PURE__ */ i(Me, { children: [
2572
+ Ge && /* @__PURE__ */ i(xe, { children: [
2576
2573
  /* @__PURE__ */ e(
2577
2574
  "div",
2578
2575
  {
2579
- className: h.agentMenuMask,
2580
- onClick: () => Fe(!1)
2576
+ className: p.agentMenuMask,
2577
+ onClick: () => l(!1)
2581
2578
  }
2582
2579
  ),
2583
2580
  /* @__PURE__ */ e(
2584
2581
  ProjectSpaceMenu,
2585
2582
  {
2586
- token: y,
2587
- currentId: (ee == null ? void 0 : ee.id) ?? null,
2583
+ token: f,
2584
+ currentId: (Y == null ? void 0 : Y.id) ?? null,
2588
2585
  onPick: (n) => {
2589
- Re(n), Fe(!1);
2586
+ je(n), l(!1);
2590
2587
  }
2591
2588
  }
2592
2589
  )
@@ -2596,108 +2593,109 @@ function vi({
2596
2593
  "button",
2597
2594
  {
2598
2595
  type: "button",
2599
- className: h.landingSend,
2600
- disabled: !be.trim() || ie || !Ne && !(X && q),
2601
- onClick: () => void Ue(),
2596
+ className: p.landingSend,
2597
+ disabled: !ke.trim() || me || !Ne && !(Z && Q),
2598
+ onClick: () => void Ve(),
2602
2599
  "aria-label": "发送",
2603
- children: ie ? /* @__PURE__ */ e(Fn, {}) : /* @__PURE__ */ e(jn, {})
2600
+ children: me ? /* @__PURE__ */ e(Kn, {}) : /* @__PURE__ */ e(Un, {})
2604
2601
  }
2605
2602
  )
2606
2603
  ] })
2607
2604
  ] }),
2608
- /* @__PURE__ */ i("div", { className: h.contextRow, children: [
2609
- /* @__PURE__ */ i("span", { className: h.contextChip, children: [
2610
- /* @__PURE__ */ e(ft, {}),
2611
- /* @__PURE__ */ e("span", { children: ee ? ee.title : "未归组" })
2605
+ /* @__PURE__ */ i("div", { className: p.contextRow, children: [
2606
+ /* @__PURE__ */ i("span", { className: p.contextChip, children: [
2607
+ /* @__PURE__ */ e(yt, {}),
2608
+ /* @__PURE__ */ e("span", { children: Y ? Y.title : "未归组" })
2612
2609
  ] }),
2613
- /* @__PURE__ */ e("span", { className: h.contextChip, children: X && q ? /* @__PURE__ */ i(Me, { children: [
2614
- /* @__PURE__ */ e(rt, {}),
2610
+ /* @__PURE__ */ e("span", { className: p.contextChip, children: Z && Q ? /* @__PURE__ */ i(xe, { children: [
2611
+ /* @__PURE__ */ e(dt, {}),
2615
2612
  /* @__PURE__ */ i("span", { children: [
2616
- q.name,
2613
+ Q.name,
2617
2614
  "(本机)"
2618
2615
  ] })
2619
- ] }) : /* @__PURE__ */ i(Me, { children: [
2620
- /* @__PURE__ */ e(Wn, {}),
2616
+ ] }) : /* @__PURE__ */ i(xe, { children: [
2617
+ /* @__PURE__ */ e(Vn, {}),
2621
2618
  /* @__PURE__ */ e("span", { children: "云端" })
2622
2619
  ] }) })
2623
2620
  ] }),
2624
- /* @__PURE__ */ e("div", { className: h.chipRow, children: ni.map((n) => /* @__PURE__ */ i(
2621
+ /* @__PURE__ */ e("div", { className: p.chipRow, children: ii.map((n) => /* @__PURE__ */ i(
2625
2622
  "button",
2626
2623
  {
2627
2624
  type: "button",
2628
- className: h.capChip,
2625
+ className: p.capChip,
2629
2626
  onClick: () => {
2630
2627
  var g;
2631
2628
  if (n.action === "tools") {
2632
- l("tools");
2629
+ v("tools");
2633
2630
  return;
2634
2631
  }
2635
2632
  if (n.action === "webide") {
2636
- l("webide");
2633
+ v("webide");
2637
2634
  return;
2638
2635
  }
2639
2636
  if (n.action === "ask") {
2640
- it();
2637
+ ct();
2641
2638
  return;
2642
2639
  }
2643
- he(n.prompt ?? ""), (g = Se.current) == null || g.focus();
2640
+ ue(n.prompt ?? ""), (g = be.current) == null || g.focus();
2644
2641
  },
2645
2642
  children: [
2646
- /* @__PURE__ */ e("span", { className: h.capChipIcon, children: n.icon }),
2643
+ /* @__PURE__ */ e("span", { className: p.capChipIcon, children: n.icon }),
2647
2644
  /* @__PURE__ */ e("span", { children: n.label })
2648
2645
  ]
2649
2646
  },
2650
2647
  n.key
2651
2648
  )) }),
2652
- /* @__PURE__ */ e("div", { className: h.chipRow, children: ti.map((n) => /* @__PURE__ */ e(
2649
+ /* @__PURE__ */ e("div", { className: p.chipRow, children: li.map((n) => /* @__PURE__ */ e(
2653
2650
  "button",
2654
2651
  {
2655
2652
  type: "button",
2656
- className: h.suggestChip,
2653
+ className: p.suggestChip,
2657
2654
  onClick: () => {
2658
2655
  var g;
2659
- he(n), (g = Se.current) == null || g.focus();
2656
+ ue(n), (g = be.current) == null || g.focus();
2660
2657
  },
2661
2658
  children: n
2662
2659
  },
2663
2660
  n
2664
2661
  )) })
2665
- ] }) }), /* @__PURE__ */ i("div", { className: h.shell, children: [
2666
- /* @__PURE__ */ i("aside", { className: h.sidebar, "aria-label": "个人专享工作台导航", children: [
2667
- /* @__PURE__ */ i("div", { className: h.sideContent, children: [
2662
+ ] }) }), /* @__PURE__ */ i("div", { className: p.shell, children: [
2663
+ /* @__PURE__ */ i("aside", { className: p.sidebar, "aria-label": "个人专享工作台导航", children: [
2664
+ /* @__PURE__ */ i("div", { className: p.sideContent, children: [
2668
2665
  /* @__PURE__ */ e(
2669
- Kn,
2666
+ Gn,
2670
2667
  {
2671
- currentUser: w,
2672
- token: y,
2673
- isDesktop: X,
2674
- activeNav: H === "schedule" ? "schedule" : H === "history" ? "history" : null,
2668
+ currentUser: I,
2669
+ token: f,
2670
+ isDesktop: Z,
2671
+ activeNav: O === "schedule" ? "schedule" : O === "history" ? "history" : null,
2675
2672
  extensionsGroupActive: [
2676
2673
  "extensions",
2677
2674
  "agentDetail",
2678
2675
  "personalTab",
2679
2676
  "workbenchShell"
2680
- ].includes(H),
2681
- onDesktopNewTask: X && q ? lt : void 0,
2677
+ ].includes(O),
2678
+ activePersonalTab: O === "personalTab" ? oe : null,
2679
+ onDesktopNewTask: Z && Q ? it : void 0,
2682
2680
  onPickSpace: (n) => {
2683
- Re(n), qe();
2681
+ je(n), Qe();
2684
2682
  },
2685
- currentSpaceId: (ee == null ? void 0 : ee.id) ?? null,
2686
- onOpenSchedule: () => M("schedule"),
2687
- onOpenExtensions: () => M("extensions"),
2688
- onOpenHistory: () => M("history"),
2689
- onOpenSearch: () => M("history"),
2690
- onOpenPersonalTab: l,
2691
- onOpenWorkbenchShell: () => M("workbenchShell"),
2692
- onCloudNav: X ? mt : void 0,
2693
- cloudNavActive: H === "chat" && !!k
2683
+ currentSpaceId: (Y == null ? void 0 : Y.id) ?? null,
2684
+ onOpenSchedule: () => L("schedule"),
2685
+ onOpenExtensions: () => L("extensions"),
2686
+ onOpenHistory: () => L("history"),
2687
+ onOpenSearch: () => L("history"),
2688
+ onOpenPersonalTab: v,
2689
+ onOpenWorkbenchShell: () => L("workbenchShell"),
2690
+ onCloudNav: Z ? pt : void 0,
2691
+ cloudNavActive: O === "chat" && !!C
2694
2692
  }
2695
2693
  ),
2696
- /* @__PURE__ */ i("div", { className: h.sideTasks, children: [
2697
- X && /* @__PURE__ */ i(
2694
+ /* @__PURE__ */ i("div", { className: p.sideTasks, children: [
2695
+ Z && /* @__PURE__ */ i(
2698
2696
  "div",
2699
2697
  {
2700
- className: h.segToggle,
2698
+ className: p.segToggle,
2701
2699
  role: "tablist",
2702
2700
  "aria-label": "任务范围切换",
2703
2701
  children: [
@@ -2706,9 +2704,9 @@ function vi({
2706
2704
  {
2707
2705
  type: "button",
2708
2706
  role: "tab",
2709
- "aria-selected": W === "local",
2710
- className: `${h.segBtn} ${W === "local" ? h.segBtnActive : ""}`,
2711
- onClick: () => ue("local"),
2707
+ "aria-selected": K === "local",
2708
+ className: `${p.segBtn} ${K === "local" ? p.segBtnActive : ""}`,
2709
+ onClick: () => ge("local"),
2712
2710
  children: "本地"
2713
2711
  }
2714
2712
  ),
@@ -2717,71 +2715,71 @@ function vi({
2717
2715
  {
2718
2716
  type: "button",
2719
2717
  role: "tab",
2720
- "aria-selected": W === "cloud",
2721
- className: `${h.segBtn} ${W === "cloud" ? h.segBtnActive : ""}`,
2722
- onClick: () => ue("cloud"),
2718
+ "aria-selected": K === "cloud",
2719
+ className: `${p.segBtn} ${K === "cloud" ? p.segBtnActive : ""}`,
2720
+ onClick: () => ge("cloud"),
2723
2721
  children: "云端"
2724
2722
  }
2725
2723
  )
2726
2724
  ]
2727
2725
  }
2728
2726
  ),
2729
- X && W === "local" ? /* @__PURE__ */ i(Me, { children: [
2730
- /* @__PURE__ */ e("div", { className: h.tasksLabel, children: "本地任务" }),
2731
- F.map((n) => /* @__PURE__ */ e(
2727
+ Z && K === "local" ? /* @__PURE__ */ i(xe, { children: [
2728
+ /* @__PURE__ */ e("div", { className: p.tasksLabel, children: "本地任务" }),
2729
+ j.map((n) => /* @__PURE__ */ e(
2732
2730
  "button",
2733
2731
  {
2734
2732
  type: "button",
2735
- className: `${h.recentItem} ${se === n.id ? h.recentItemActive : ""}`,
2733
+ className: `${p.recentItem} ${w === n.id ? p.recentItemActive : ""}`,
2736
2734
  title: n.title,
2737
- onClick: () => Ke(n.id),
2738
- children: /* @__PURE__ */ e("span", { className: h.recentItemText, children: n.title || "未命名会话" })
2735
+ onClick: () => Ue(n.id),
2736
+ children: /* @__PURE__ */ e("span", { className: p.recentItemText, children: n.title || "未命名会话" })
2739
2737
  },
2740
2738
  n.id
2741
2739
  )),
2742
- F.length === 0 && /* @__PURE__ */ e("div", { className: h.tasksEmpty, children: ke ? "暂无本地任务,点上方新建任务开始" : "本机 Agent 未运行" })
2743
- ] }) : /* @__PURE__ */ i(Me, { children: [
2744
- /* @__PURE__ */ e("div", { className: h.tasksLabel, children: "项目" }),
2745
- Be.length === 0 && !K && /* @__PURE__ */ e("div", { className: h.tasksEmpty, children: "还没有项目空间或云端任务" }),
2746
- Be.map((n) => {
2747
- const g = Z.has(n.key);
2740
+ j.length === 0 && /* @__PURE__ */ e("div", { className: p.tasksEmpty, children: ve ? "暂无本地任务,点上方新建任务开始" : "本机 Agent 未运行" })
2741
+ ] }) : /* @__PURE__ */ i(xe, { children: [
2742
+ /* @__PURE__ */ e("div", { className: p.tasksLabel, children: "项目" }),
2743
+ Le.length === 0 && !J && /* @__PURE__ */ e("div", { className: p.tasksEmpty, children: "还没有项目空间或云端任务" }),
2744
+ Le.map((n) => {
2745
+ const g = Re.has(n.key);
2748
2746
  return /* @__PURE__ */ i("div", { children: [
2749
2747
  /* @__PURE__ */ i(
2750
2748
  "button",
2751
2749
  {
2752
2750
  type: "button",
2753
- className: h.projFolder,
2751
+ className: p.projFolder,
2754
2752
  "aria-expanded": g,
2755
- onClick: () => _e((C) => {
2756
- const t = new Set(C);
2753
+ onClick: () => Ce((k) => {
2754
+ const t = new Set(k);
2757
2755
  return t.has(n.key) ? t.delete(n.key) : t.add(n.key), t;
2758
2756
  }),
2759
2757
  children: [
2760
2758
  /* @__PURE__ */ e(
2761
- _t,
2759
+ ft,
2762
2760
  {
2763
- className: `${h.projCaret} ${g ? h.projCaretOpen : ""}`
2761
+ className: `${p.projCaret} ${g ? p.projCaretOpen : ""}`
2764
2762
  }
2765
2763
  ),
2766
- /* @__PURE__ */ e(ft, { className: h.projIcon }),
2767
- /* @__PURE__ */ e("span", { className: h.projName, title: n.title, children: n.title }),
2768
- /* @__PURE__ */ e("span", { className: h.projMeta, children: n.sessions.length > 0 ? n.sessions.length : "暂无任务" })
2764
+ /* @__PURE__ */ e(yt, { className: p.projIcon }),
2765
+ /* @__PURE__ */ e("span", { className: p.projName, title: n.title, children: n.title }),
2766
+ /* @__PURE__ */ e("span", { className: p.projMeta, children: n.sessions.length > 0 ? n.sessions.length : "暂无任务" })
2769
2767
  ]
2770
2768
  }
2771
2769
  ),
2772
- g && n.sessions.length > 0 && /* @__PURE__ */ e("div", { className: h.projRows, children: n.sessions.map((C) => {
2773
- const t = st.get(C.personalAgentId);
2770
+ g && n.sessions.length > 0 && /* @__PURE__ */ e("div", { className: p.projRows, children: n.sessions.map((k) => {
2771
+ const t = at.get(k.personalAgentId);
2774
2772
  return /* @__PURE__ */ e(
2775
2773
  "button",
2776
2774
  {
2777
2775
  type: "button",
2778
- className: `${h.recentItem} ${(k == null ? void 0 : k.sessionId) === C.id ? h.recentItemActive : ""}`,
2776
+ className: `${p.recentItem} ${(C == null ? void 0 : C.sessionId) === k.id ? p.recentItemActive : ""}`,
2779
2777
  disabled: !t,
2780
- title: t ? C.title || "未命名会话" : "伙伴已不存在,无法打开",
2781
- onClick: () => t && ae(t, C.id),
2782
- children: /* @__PURE__ */ e("span", { className: h.recentItemText, children: C.title || "未命名会话" })
2778
+ title: t ? k.title || "未命名会话" : "伙伴已不存在,无法打开",
2779
+ onClick: () => t && le(t, k.id),
2780
+ children: /* @__PURE__ */ e("span", { className: p.recentItemText, children: k.title || "未命名会话" })
2783
2781
  },
2784
- C.id
2782
+ k.id
2785
2783
  );
2786
2784
  }) })
2787
2785
  ] }, n.key);
@@ -2790,20 +2788,20 @@ function vi({
2790
2788
  ] })
2791
2789
  ] }),
2792
2790
  /* @__PURE__ */ e(
2793
- Un,
2791
+ zn,
2794
2792
  {
2795
- displayName: Qe,
2793
+ displayName: Xe,
2796
2794
  subtitle: "Z-Team · 个人(专享)",
2797
- onOpenSettings: () => U(!0),
2795
+ onOpenSettings: () => pe(!0),
2798
2796
  children: ht.map((n) => /* @__PURE__ */ i(
2799
2797
  "button",
2800
2798
  {
2801
2799
  type: "button",
2802
2800
  role: "menuitem",
2803
- className: h.agentMenuItem,
2801
+ className: p.agentMenuItem,
2804
2802
  onClick: () => s == null ? void 0 : s(n.mode),
2805
2803
  children: [
2806
- /* @__PURE__ */ e("span", { className: h.navIcon, children: n.icon }),
2804
+ /* @__PURE__ */ e("span", { className: p.navIcon, children: n.icon }),
2807
2805
  /* @__PURE__ */ e("span", { children: n.label })
2808
2806
  ]
2809
2807
  },
@@ -2812,17 +2810,17 @@ function vi({
2812
2810
  }
2813
2811
  )
2814
2812
  ] }),
2815
- /* @__PURE__ */ e("main", { className: h.main, "aria-label": "个人专享工作台内容", children: A && !k && !q ? /* @__PURE__ */ e("div", { className: h.emptyState, children: /* @__PURE__ */ e("span", { className: h.emptyTitle, children: "正在加载智能伙伴…" }) }) : oe }),
2813
+ /* @__PURE__ */ e("main", { className: p.main, "aria-label": "个人专享工作台内容", children: $ && !C && !Q ? /* @__PURE__ */ e("div", { className: p.emptyState, children: /* @__PURE__ */ e("span", { className: p.emptyTitle, children: "正在加载智能伙伴…" }) }) : ie }),
2816
2814
  /* @__PURE__ */ e(
2817
- Vn,
2815
+ qn,
2818
2816
  {
2819
- open: f,
2820
- onClose: () => U(!1),
2821
- token: y
2817
+ open: H,
2818
+ onClose: () => pe(!1),
2819
+ token: f
2822
2820
  }
2823
2821
  )
2824
2822
  ] });
2825
2823
  }
2826
2824
  export {
2827
- vi as default
2825
+ ki as default
2828
2826
  };