@yuku123/z-team-component 0.2.55 → 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.
- package/dist/{ChangeLogView-R6boINWk.js → ChangeLogView-Cstbioyw.js} +137 -137
- package/dist/{ComponentDoc-DTJyJAy-.js → ComponentDoc-0L_mpFyu.js} +121 -121
- package/dist/{InvitationManagementPage-BZOxuoM5.js → InvitationManagementPage-Ba5yy-Hl.js} +1 -1
- package/dist/{OnboardingPage-Be3MXW9i.js → OnboardingPage-rEAorVv0.js} +2 -2
- package/dist/{ScheduledTasks-CxDbixJe.js → ScheduledTasks-Db5a-nxu.js} +2992 -2957
- package/dist/{SystemShell-BEKwj3WF.js → SystemShell-BbREgRq8.js} +1 -1
- package/dist/{admin-logs-DMF0dtG1.js → admin-logs-B9KS6VJz.js} +2 -2
- package/dist/{api-DqNgdbLm.js → api-B4-sB0Pv.js} +1 -1
- package/dist/{api-DhuqONeb.js → api-CALqShkO.js} +228 -210
- package/dist/createWorkspaceWsHandler-DP30xvug.js +13035 -0
- package/dist/{index-CZ9xxAL0.js → index-4YxdJwFm.js} +3 -3
- package/dist/{index-C5O0cK8A.js → index-8gCovDDT.js} +6 -6
- package/dist/{index-DQmgOqd1.js → index-9w4zGIUG.js} +1121 -1123
- package/dist/{index-DV8rmjvN.js → index-BVYQ8p6A.js} +5 -5
- package/dist/{index-B8eiFO_f.js → index-C2Wkg1b5.js} +3 -3
- package/dist/{index-BOcKPM37.js → index-C3B7CbHo.js} +1 -1
- package/dist/{index-BkX0I2aB.js → index-C6S3MIu4.js} +56 -56
- package/dist/index-C88kp8U2.js +1143 -0
- package/dist/{index-DpNZTqcn.js → index-C90C1lUS.js} +3 -3
- package/dist/{index-CzePRAbT.js → index-CGWttFLb.js} +4 -4
- package/dist/{index-B7cZdoRq.js → index-CHb5cxi8.js} +1 -1
- package/dist/{index-Ct9MzvZV.js → index-CLWgeKwr.js} +2 -2
- package/dist/{index-JMzBzwiO.js → index-CinRd7Nz.js} +618 -617
- package/dist/index-CmToF3CG.js +9257 -0
- package/dist/{index-BKVWW3ba.js → index-DET70T3j.js} +1 -1
- package/dist/{index-TPTesErt.js → index-DJGEEIGt.js} +2 -2
- package/dist/{index-Otx98G8z.js → index-DJOyOVn_.js} +87 -74
- package/dist/{index-CbUsvCMy.js → index-DKeYG0Fu.js} +4 -4
- package/dist/{index-8Qtz0IKN.js → index-DRQFmqYV.js} +2 -2
- package/dist/index-DTGL9OWw.js +1195 -0
- package/dist/index-DWsfQMp8.js +208 -0
- package/dist/{index-DQk6Pt6U.js → index-JpY3wmeg.js} +3 -3
- package/dist/index-WIsi8fln.js +339 -0
- package/dist/{index-BM6XpIcw.js → index-aw72ID7y.js} +1 -1
- package/dist/{index-BP97Ev-W.js → index-lftFkqfI.js} +4 -4
- package/dist/{index-CZxihNo5.js → index-m8V5TniT.js} +7 -7
- package/dist/index.js +1 -1
- package/dist/{instance-Cr4_XM2r.js → instance-f3C-1qYl.js} +1 -1
- package/dist/pages.js +1 -1
- package/dist/{schedule-BNLns-p4.js → schedule-DfkgwPdE.js} +1 -1
- package/dist/{send-default-agent-team-message-C9VWSWKJ.js → send-default-agent-team-message-d_ECdczr.js} +1 -1
- package/dist/{sso-user-Cme2tmGq.js → sso-user-HcsSzg8P.js} +1 -1
- package/dist/{training-SjRAdtNQ.js → training-DnNQN0An.js} +1 -1
- package/dist/{useAppStore-C63xiq3-.js → useAppStore-kRZEA5WZ.js} +1 -1
- package/dist/webide-BcRzJX-h.js +8255 -0
- package/dist/z-team-component.css +2 -2
- package/package.json +1 -1
- package/dist/createWorkspaceWsHandler-BKcAIc4B.js +0 -13034
- package/dist/index-B30K72xQ.js +0 -1330
- package/dist/index-C8Wkx3H_.js +0 -8960
- package/dist/index-mXMdvUYD.js +0 -1182
- package/dist/webide-DDFxSedU.js +0 -7845
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { S as
|
|
3
|
-
import { RightOutlined as
|
|
4
|
-
import { useState as m, useRef as
|
|
5
|
-
import { x as
|
|
6
|
-
import { f as
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { W as
|
|
14
|
-
import { message as
|
|
15
|
-
const
|
|
16
|
-
container:
|
|
17
|
-
sessionPanel:
|
|
18
|
-
sessionHeader:
|
|
19
|
-
sessionHeaderActions:
|
|
20
|
-
sessionBtnSm:
|
|
21
|
-
sessionList:
|
|
22
|
-
sessionItem:
|
|
23
|
-
sessionItemActive:
|
|
24
|
-
sessionItemTitle:
|
|
25
|
-
sessionLiveDot:
|
|
26
|
-
sessionItemTime:
|
|
27
|
-
sessionDeleteBtn:
|
|
28
|
-
sessionRenameBtn:
|
|
29
|
-
sessionRenameInput:
|
|
30
|
-
sessionCreateRow:
|
|
31
|
-
sessionCreateInput:
|
|
32
|
-
sessionCreateConfirm:
|
|
33
|
-
sessionCreateCancel:
|
|
34
|
-
sessionSearchRow:
|
|
35
|
-
sessionSearchInput:
|
|
36
|
-
sessionSearchClear:
|
|
37
|
-
sessionEmpty:
|
|
38
|
-
sessionExpandBtn:
|
|
39
|
-
chatPanel:
|
|
40
|
-
chatHeader:
|
|
41
|
-
agentAvatar:
|
|
42
|
-
chatHeaderMeta:
|
|
43
|
-
chatHeaderName:
|
|
44
|
-
chatHeaderSession:
|
|
45
|
-
chatHeaderBadge:
|
|
46
|
-
streamingIndicator:
|
|
47
|
-
threadScroll:
|
|
48
|
-
threadInner:
|
|
49
|
-
landing:
|
|
50
|
-
landingLogo:
|
|
51
|
-
landingTitle:
|
|
52
|
-
landingHint:
|
|
53
|
-
newChatLanding:
|
|
54
|
-
landingComposer:
|
|
55
|
-
landingInput:
|
|
56
|
-
chatEmpty:
|
|
57
|
-
userRow:
|
|
58
|
-
userBubble:
|
|
59
|
-
assistantBlock:
|
|
60
|
-
md:
|
|
61
|
-
mdPreWrap:
|
|
62
|
-
mdPreCopy:
|
|
63
|
-
caretCursor:
|
|
64
|
-
errorBar:
|
|
65
|
-
errorRetryBtn:
|
|
66
|
-
stoppedBar:
|
|
67
|
-
scrollTopBtn:
|
|
68
|
-
scrollTopBtnVisible:
|
|
69
|
-
composerWrap:
|
|
70
|
-
composer:
|
|
71
|
-
composerInput:
|
|
72
|
-
sendBtn:
|
|
73
|
-
stopBtn:
|
|
74
|
-
sendBtnReady:
|
|
75
|
-
composerHint:
|
|
76
|
-
msgMeta:
|
|
77
|
-
copyBtn:
|
|
78
|
-
copyBtnInline:
|
|
79
|
-
copyBtnDone:
|
|
80
|
-
landingChips:
|
|
81
|
-
landingChip:
|
|
82
|
-
userActions:
|
|
83
|
-
userActionBtn:
|
|
84
|
-
editingBar:
|
|
85
|
-
pendingBar:
|
|
86
|
-
editingCancel:
|
|
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
|
|
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
|
|
103
|
+
function St(s) {
|
|
104
104
|
return (s || []).map((d, u) => {
|
|
105
|
-
const
|
|
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:
|
|
110
|
-
totalMs:
|
|
111
|
-
usage:
|
|
112
|
-
stopped: (
|
|
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
|
|
116
|
+
function Je(s) {
|
|
117
117
|
return s.filter((d) => d.type === "text").map((d) => d.text).join("");
|
|
118
118
|
}
|
|
119
|
-
function
|
|
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
|
|
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
|
|
131
|
-
return `${
|
|
130
|
+
const f = new Date(s);
|
|
131
|
+
return `${f.getMonth() + 1}-${String(f.getDate()).padStart(2, "0")}`;
|
|
132
132
|
}
|
|
133
|
-
const
|
|
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
|
|
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
|
|
146
|
+
return At[Math.abs(d) % At.length];
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function vt(s) {
|
|
149
149
|
return s ? s.charAt(0).toUpperCase() : "?";
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
const d =
|
|
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(
|
|
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
|
|
161
|
+
function Da({ text: s }) {
|
|
162
162
|
return /* @__PURE__ */ e("div", { className: c.md, children: /* @__PURE__ */ e(
|
|
163
|
-
|
|
163
|
+
as,
|
|
164
164
|
{
|
|
165
|
-
remarkPlugins: [
|
|
166
|
-
rehypePlugins: [
|
|
165
|
+
remarkPlugins: [is],
|
|
166
|
+
rehypePlugins: [ls],
|
|
167
167
|
components: {
|
|
168
|
-
pre: (d) => /* @__PURE__ */ e(
|
|
168
|
+
pre: (d) => /* @__PURE__ */ e(La, { children: d.children })
|
|
169
169
|
},
|
|
170
170
|
children: s
|
|
171
171
|
}
|
|
172
172
|
) });
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Ma({ startedAtMs: s }) {
|
|
175
175
|
const [, d] = m(0);
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
return () => window.clearInterval(
|
|
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
|
|
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
|
|
195
|
-
return document.body.removeChild(u),
|
|
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
|
|
200
|
+
function kt({
|
|
201
201
|
getText: s,
|
|
202
202
|
inline: d,
|
|
203
203
|
label: u = "复制正文"
|
|
204
204
|
}) {
|
|
205
|
-
const [
|
|
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 : ""} ${
|
|
210
|
+
className: `${c.copyBtn} ${d ? c.copyBtnInline : ""} ${f ? c.copyBtnDone : ""}`,
|
|
211
211
|
onClick: () => {
|
|
212
|
-
const
|
|
213
|
-
!
|
|
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:
|
|
217
|
+
children: f ? /* @__PURE__ */ e(Ht, {}) : /* @__PURE__ */ e(rn, {})
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const Lt = [
|
|
222
222
|
"查看当前目录的文件列表",
|
|
223
223
|
"总结当前目录里各文件的内容",
|
|
224
224
|
"帮我写一个脚本统计各文件的行数",
|
|
225
225
|
"说明一下你能使用哪些工具"
|
|
226
226
|
];
|
|
227
|
-
function
|
|
227
|
+
function Zt({
|
|
228
228
|
agent: s,
|
|
229
229
|
newSessionTrigger: d = 0,
|
|
230
230
|
autoSendDraft: u = null,
|
|
231
|
-
onAutoSendConsumed:
|
|
232
|
-
openSessionId:
|
|
233
|
-
onOpenSessionConsumed:
|
|
231
|
+
onAutoSendConsumed: f,
|
|
232
|
+
openSessionId: I = null,
|
|
233
|
+
onOpenSessionConsumed: A
|
|
234
234
|
}) {
|
|
235
|
-
var
|
|
236
|
-
const
|
|
237
|
-
const t =
|
|
238
|
-
return t ?
|
|
239
|
-
}, [
|
|
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
|
-
), [
|
|
242
|
-
|
|
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
|
|
246
|
-
|
|
247
|
-
}, [
|
|
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
|
-
), [
|
|
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 &&
|
|
253
|
+
a.messages = o(a.messages), ye.current === t && T(a.messages);
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
T((_) => o(_));
|
|
257
257
|
},
|
|
258
258
|
[]
|
|
259
|
-
),
|
|
259
|
+
), oe = j ? ((k = te.current) == null ? void 0 : k.sid) ?? null : null, qe = z(async () => {
|
|
260
260
|
try {
|
|
261
|
-
const t = await
|
|
262
|
-
return
|
|
261
|
+
const t = await Kt(s == null ? void 0 : s.localAgentId);
|
|
262
|
+
return S(t), Ge(!0), t;
|
|
263
263
|
} catch {
|
|
264
|
-
return
|
|
264
|
+
return Ge(!1), S([]), [];
|
|
265
265
|
}
|
|
266
266
|
}, [s == null ? void 0 : s.localAgentId]);
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
273
|
+
M(o.id);
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
|
-
}, [
|
|
276
|
+
}, [qe]), R(() => {
|
|
277
277
|
d > 0 && (async () => {
|
|
278
278
|
try {
|
|
279
|
-
const t = await
|
|
279
|
+
const t = await _t(
|
|
280
280
|
"新会话",
|
|
281
281
|
s == null ? void 0 : s.localAgentId
|
|
282
282
|
);
|
|
283
|
-
|
|
283
|
+
S((o) => [t, ...o]), M(t.id), T([]), q("");
|
|
284
284
|
} catch {
|
|
285
|
-
|
|
285
|
+
me(!0), Te("");
|
|
286
286
|
}
|
|
287
287
|
})();
|
|
288
288
|
}, [d]);
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
!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 =
|
|
294
|
-
|
|
295
|
-
!
|
|
296
|
-
}, [
|
|
297
|
-
const t =
|
|
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
|
-
|
|
300
|
-
const _ =
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
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 (
|
|
307
|
-
|
|
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 (
|
|
312
|
+
if (Ke.current = !0, T(o.messages), o.messages.some((_) => _.streaming || _.error)) return;
|
|
313
313
|
te.current = null;
|
|
314
314
|
}
|
|
315
|
-
if (
|
|
316
|
-
|
|
315
|
+
if (Ze.current) {
|
|
316
|
+
Ze.current = !1;
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
319
|
let a = !1;
|
|
320
|
-
return
|
|
321
|
-
a ||
|
|
320
|
+
return Se(!0), Mn(B).then((_) => {
|
|
321
|
+
a || T(St(_.messages));
|
|
322
322
|
}).catch(() => {
|
|
323
|
-
a ||
|
|
323
|
+
a || T([]);
|
|
324
324
|
}).finally(() => {
|
|
325
|
-
a ||
|
|
325
|
+
a || Se(!1);
|
|
326
326
|
}), () => {
|
|
327
327
|
a = !0;
|
|
328
328
|
};
|
|
329
|
-
}, [B]),
|
|
330
|
-
|
|
331
|
-
}, [
|
|
332
|
-
const Ne =
|
|
333
|
-
const t =
|
|
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
|
-
|
|
337
|
-
}, []),
|
|
338
|
-
const t =
|
|
339
|
-
t && (t.scrollTop = t.scrollHeight),
|
|
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
|
-
|
|
341
|
+
R(() => {
|
|
342
342
|
localStorage.setItem(
|
|
343
343
|
"ft_local_session_collapsed",
|
|
344
|
-
|
|
344
|
+
Be ? "true" : "false"
|
|
345
345
|
);
|
|
346
|
-
}, [
|
|
347
|
-
const
|
|
348
|
-
const t =
|
|
346
|
+
}, [Be]);
|
|
347
|
+
const at = async () => {
|
|
348
|
+
const t = Ae.trim() || "新会话";
|
|
349
349
|
try {
|
|
350
|
-
const o = await
|
|
351
|
-
|
|
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
|
-
},
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
const t =
|
|
360
|
-
if (
|
|
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
|
|
362
|
+
await Rn(t, o), S(
|
|
363
363
|
(a) => a.map((_) => _.id === t ? { ..._, title: o } : _)
|
|
364
364
|
);
|
|
365
365
|
} catch {
|
|
366
366
|
}
|
|
367
|
-
},
|
|
367
|
+
}, lt = async (t) => {
|
|
368
368
|
if (window.confirm("确定删除此会话吗?")) {
|
|
369
|
-
|
|
369
|
+
w.current && Oe.current === t && Ue();
|
|
370
370
|
try {
|
|
371
|
-
await
|
|
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
|
-
},
|
|
375
|
+
}, nt = z(
|
|
376
376
|
(t, o, a, _) => {
|
|
377
|
-
|
|
377
|
+
ze(
|
|
378
378
|
t,
|
|
379
|
-
(
|
|
379
|
+
(h) => h.map((N) => {
|
|
380
380
|
if (N.id !== o) return N;
|
|
381
|
-
const
|
|
382
|
-
let
|
|
383
|
-
a === "thinking" && N.thinkingStartMs == null ?
|
|
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, ...
|
|
388
|
+
} : E.push({ type: a, text: _ }), { ...N, ...b, blocks: E };
|
|
389
389
|
})
|
|
390
390
|
);
|
|
391
391
|
},
|
|
392
|
-
[
|
|
393
|
-
),
|
|
392
|
+
[ze]
|
|
393
|
+
), mt = z(
|
|
394
394
|
(t, o, a) => {
|
|
395
|
-
|
|
395
|
+
ze(
|
|
396
396
|
t,
|
|
397
|
-
(_) => _.map((
|
|
398
|
-
if (
|
|
399
|
-
const N = Date.now(),
|
|
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
|
-
|
|
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 =
|
|
410
|
-
const ne =
|
|
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
|
-
|
|
412
|
+
b[E] = { ...ne, input: a.input };
|
|
413
413
|
break;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
else a.kind === "tool_result" &&
|
|
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 { ...
|
|
422
|
+
return { ...h, ...D, blocks: b };
|
|
423
423
|
})
|
|
424
424
|
);
|
|
425
425
|
},
|
|
426
|
-
[
|
|
427
|
-
),
|
|
428
|
-
var
|
|
429
|
-
const t =
|
|
430
|
-
|
|
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
|
-
(
|
|
436
|
-
...
|
|
435
|
+
(D) => D.streaming ? {
|
|
436
|
+
...D,
|
|
437
437
|
streaming: !1,
|
|
438
438
|
stopped: !0,
|
|
439
439
|
// 停止回合也结算耗时(与 onComplete 一致),避免「已停止生成」缺耗时显示
|
|
440
|
-
durationMs:
|
|
441
|
-
} :
|
|
440
|
+
durationMs: D.startedAtMs != null ? Date.now() - D.startedAtMs : void 0
|
|
441
|
+
} : D
|
|
442
442
|
);
|
|
443
|
-
o && t && o.sid === t ? ye.current === t &&
|
|
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,
|
|
445
|
+
G.current = null, fe.current = null, Ce(null), _ && U((N) => N ? N + `
|
|
446
446
|
` + _ : _);
|
|
447
447
|
}, []);
|
|
448
|
-
|
|
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") || (
|
|
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
|
-
}, [
|
|
456
|
-
const
|
|
455
|
+
}, [j, H, Ue]);
|
|
456
|
+
const le = async (t, o) => {
|
|
457
457
|
const a = o ?? B;
|
|
458
|
-
if (!a || !t ||
|
|
459
|
-
|
|
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
|
-
},
|
|
465
|
-
id:
|
|
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
|
-
|
|
472
|
-
const E = [...
|
|
471
|
+
T((b) => {
|
|
472
|
+
const E = [...b, _, N];
|
|
473
473
|
return te.current = { sid: a, messages: E }, E;
|
|
474
|
-
}),
|
|
475
|
-
const
|
|
476
|
-
|
|
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: (
|
|
481
|
-
onReasoning: (
|
|
482
|
-
onEvent: (
|
|
483
|
-
onFinal: (
|
|
484
|
-
|
|
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: (
|
|
487
|
-
|
|
488
|
-
const E = te.current, ne = (
|
|
489
|
-
(de) => de.id ===
|
|
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 ?
|
|
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 &&
|
|
498
|
-
const
|
|
499
|
-
G.current = null, fe.current = null,
|
|
500
|
-
` +
|
|
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
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
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
|
-
(
|
|
510
|
-
|
|
509
|
+
(He) => He.id === h ? {
|
|
510
|
+
...He,
|
|
511
511
|
streaming: !1,
|
|
512
|
-
durationMs: (
|
|
513
|
-
totalMs: (
|
|
514
|
-
stopped:
|
|
515
|
-
usage:
|
|
516
|
-
} :
|
|
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 &&
|
|
519
|
-
const
|
|
520
|
-
G.current = null, fe.current = null,
|
|
521
|
-
` +
|
|
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:
|
|
527
|
+
signal: D.signal
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
|
-
},
|
|
530
|
+
}, Qe = async (t, o) => {
|
|
531
531
|
if (B)
|
|
532
532
|
try {
|
|
533
|
-
const { session: a, previousId: _ } = await
|
|
533
|
+
const { session: a, previousId: _ } = await $n(
|
|
534
534
|
B,
|
|
535
535
|
t
|
|
536
536
|
);
|
|
537
|
-
|
|
538
|
-
(
|
|
539
|
-
),
|
|
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
|
|
541
|
+
await le(o);
|
|
542
542
|
}
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
const a =
|
|
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
|
-
},
|
|
549
|
-
|
|
550
|
-
},
|
|
548
|
+
}, ct = () => {
|
|
549
|
+
pe(null), ae.current && (ae.current.style.height = "auto");
|
|
550
|
+
}, pt = () => {
|
|
551
551
|
const t = G.current;
|
|
552
|
-
G.current = null,
|
|
552
|
+
G.current = null, Ce(null), t && U((o) => o ? o + `
|
|
553
553
|
` + t : t);
|
|
554
|
-
},
|
|
555
|
-
const o = (t ??
|
|
556
|
-
if (!(!o ||
|
|
557
|
-
|
|
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(), _ = (
|
|
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
|
|
562
|
-
|
|
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
|
-
|
|
565
|
+
ue(!1);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
},
|
|
569
|
-
const t =
|
|
568
|
+
}, Xe = () => {
|
|
569
|
+
const t = J.trim();
|
|
570
570
|
if (t) {
|
|
571
|
-
if (
|
|
571
|
+
if (j) {
|
|
572
572
|
G.current = G.current ? G.current + `
|
|
573
|
-
` + t : t, fe.current = B,
|
|
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 (
|
|
577
|
-
const o =
|
|
578
|
-
|
|
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
|
-
|
|
581
|
+
le(t);
|
|
582
582
|
}
|
|
583
583
|
}, ht = (t) => {
|
|
584
|
-
t
|
|
585
|
-
},
|
|
586
|
-
|
|
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
|
-
},
|
|
590
|
-
|
|
591
|
-
(
|
|
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
|
|
596
|
-
|
|
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
|
|
599
|
-
|
|
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((
|
|
602
|
-
if (
|
|
601
|
+
return t.blocks.forEach((h, N) => {
|
|
602
|
+
if (h.type === "thinking")
|
|
603
603
|
_.push(
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
|
-
|
|
605
|
+
es,
|
|
606
606
|
{
|
|
607
|
-
text:
|
|
607
|
+
text: h.text,
|
|
608
608
|
streaming: !!t.streaming,
|
|
609
609
|
startedAtMs: t.thinkingStartMs,
|
|
610
|
-
durationMs: t.thinkingMs ??
|
|
610
|
+
durationMs: t.thinkingMs ?? h.durationMs
|
|
611
611
|
},
|
|
612
612
|
N
|
|
613
613
|
)
|
|
614
614
|
);
|
|
615
|
-
else if (
|
|
616
|
-
const
|
|
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
|
-
|
|
619
|
+
ts,
|
|
620
620
|
{
|
|
621
|
-
call:
|
|
622
|
-
result:
|
|
623
|
-
running: !!t.streaming &&
|
|
624
|
-
durationMs:
|
|
625
|
-
startedAtMs:
|
|
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 (
|
|
631
|
-
if (
|
|
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:
|
|
635
|
+
/* @__PURE__ */ e("pre", { className: c.toolPre, children: h.content || "(空)" })
|
|
636
636
|
] }) }, N)
|
|
637
637
|
);
|
|
638
|
-
} else
|
|
638
|
+
} else h.type === "text" && h.text && _.push(/* @__PURE__ */ e(Da, { text: h.text }, N));
|
|
639
639
|
}), _;
|
|
640
640
|
};
|
|
641
|
-
if (!
|
|
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 =
|
|
643
|
+
const g = $.find((t) => t.id === B);
|
|
644
644
|
return /* @__PURE__ */ i("div", { className: c.container, children: [
|
|
645
|
-
|
|
645
|
+
Be ? /* @__PURE__ */ e(
|
|
646
646
|
"button",
|
|
647
647
|
{
|
|
648
648
|
type: "button",
|
|
649
649
|
className: c.sessionExpandBtn,
|
|
650
|
-
onClick: () =>
|
|
650
|
+
onClick: () => Y(!1),
|
|
651
651
|
title: "展开会话列表",
|
|
652
|
-
children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
664
|
+
me(!0), Te("");
|
|
665
665
|
},
|
|
666
666
|
title: "新建会话",
|
|
667
|
-
children: /* @__PURE__ */ e(
|
|
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: () =>
|
|
675
|
+
onClick: () => Y(!0),
|
|
676
676
|
title: "收起会话列表",
|
|
677
|
-
children: /* @__PURE__ */ e(
|
|
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:
|
|
690
|
-
onChange: (t) =>
|
|
689
|
+
value: W,
|
|
690
|
+
onChange: (t) => q(t.target.value)
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
|
-
|
|
693
|
+
W && /* @__PURE__ */ e(
|
|
694
694
|
"button",
|
|
695
695
|
{
|
|
696
696
|
type: "button",
|
|
697
697
|
className: c.sessionSearchClear,
|
|
698
|
-
onClick: () =>
|
|
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
|
-
|
|
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:
|
|
712
|
+
value: Ae,
|
|
713
713
|
autoFocus: !0,
|
|
714
|
-
onChange: (t) =>
|
|
714
|
+
onChange: (t) => Te(t.target.value),
|
|
715
715
|
onKeyDown: (t) => {
|
|
716
|
-
t.key === "Enter" &&
|
|
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
|
|
725
|
+
onClick: () => void at(),
|
|
726
726
|
title: "确认创建",
|
|
727
|
-
children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
736
|
+
me(!1), Te("");
|
|
737
737
|
},
|
|
738
738
|
title: "取消",
|
|
739
739
|
children: "✕"
|
|
740
740
|
}
|
|
741
741
|
)
|
|
742
742
|
] }),
|
|
743
|
-
|
|
743
|
+
$.length === 0 && !be ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
|
|
744
744
|
/* @__PURE__ */ e("span", { children: "暂无会话" }),
|
|
745
745
|
/* @__PURE__ */ e("span", { children: "点击「+」开始聊天" })
|
|
746
|
-
] }) :
|
|
746
|
+
] }) : ge.length === 0 ? /* @__PURE__ */ i("div", { className: c.sessionEmpty, children: [
|
|
747
747
|
/* @__PURE__ */ e("span", { children: "无匹配会话" }),
|
|
748
748
|
/* @__PURE__ */ e("span", { children: "换个关键词试试" })
|
|
749
|
-
] }) :
|
|
749
|
+
] }) : ge.map((t) => /* @__PURE__ */ i(
|
|
750
750
|
"div",
|
|
751
751
|
{
|
|
752
752
|
className: `${c.sessionItem} ${B === t.id ? c.sessionItemActive : ""}`,
|
|
753
|
-
onClick: () =>
|
|
753
|
+
onClick: () => M(t.id),
|
|
754
754
|
children: [
|
|
755
|
-
|
|
755
|
+
O === t.id ? /* @__PURE__ */ e(
|
|
756
756
|
"input",
|
|
757
757
|
{
|
|
758
758
|
className: c.sessionRenameInput,
|
|
759
759
|
type: "text",
|
|
760
|
-
value:
|
|
760
|
+
value: C,
|
|
761
761
|
autoFocus: !0,
|
|
762
762
|
onFocus: (o) => o.currentTarget.select(),
|
|
763
763
|
onClick: (o) => o.stopPropagation(),
|
|
764
|
-
onChange: (o) =>
|
|
764
|
+
onChange: (o) => se(o.target.value),
|
|
765
765
|
onKeyDown: (o) => {
|
|
766
|
-
o.key === "Enter" &&
|
|
766
|
+
o.key === "Enter" && Le(), o.key === "Escape" && (K.current = !0, L(null));
|
|
767
767
|
},
|
|
768
|
-
onBlur: () => void
|
|
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: () =>
|
|
775
|
+
onDoubleClick: () => tt(t),
|
|
776
776
|
children: [
|
|
777
|
-
t.id ===
|
|
778
|
-
|
|
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
|
-
|
|
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(),
|
|
795
|
+
o.stopPropagation(), tt(t);
|
|
796
796
|
},
|
|
797
797
|
title: "重命名会话",
|
|
798
|
-
children: /* @__PURE__ */ e(
|
|
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(),
|
|
807
|
+
o.stopPropagation(), lt(t.id);
|
|
808
808
|
},
|
|
809
809
|
title: "删除会话",
|
|
810
|
-
children: /* @__PURE__ */ e(
|
|
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:
|
|
826
|
-
children:
|
|
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
|
-
|
|
835
|
-
/* @__PURE__ */ e(
|
|
834
|
+
j && /* @__PURE__ */ i("span", { className: c.streamingIndicator, children: [
|
|
835
|
+
/* @__PURE__ */ e(Tt, {}),
|
|
836
836
|
" 工作中…"
|
|
837
837
|
] })
|
|
838
838
|
] }),
|
|
839
|
-
B ? /* @__PURE__ */ i(
|
|
839
|
+
B ? /* @__PURE__ */ i(xe, { children: [
|
|
840
840
|
/* @__PURE__ */ e(
|
|
841
841
|
"div",
|
|
842
842
|
{
|
|
843
843
|
className: c.threadScroll,
|
|
844
|
-
ref:
|
|
844
|
+
ref: he,
|
|
845
845
|
onScroll: Ne,
|
|
846
|
-
children: /* @__PURE__ */ e("div", { className: c.threadInner, 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:
|
|
852
|
-
children:
|
|
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:
|
|
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
|
|
866
|
+
onClick: () => void le(t),
|
|
867
867
|
children: t
|
|
868
868
|
},
|
|
869
869
|
t
|
|
870
870
|
)) })
|
|
871
|
-
] }) :
|
|
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:
|
|
874
|
-
!
|
|
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
|
-
|
|
876
|
+
kt,
|
|
877
877
|
{
|
|
878
878
|
inline: !0,
|
|
879
879
|
label: "复制",
|
|
880
|
-
getText: () =>
|
|
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: () =>
|
|
891
|
-
children: /* @__PURE__ */ e(
|
|
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
|
|
901
|
+
onClick: () => void Qe(
|
|
902
902
|
o,
|
|
903
|
-
|
|
903
|
+
Je(t.blocks)
|
|
904
904
|
),
|
|
905
|
-
children: /* @__PURE__ */ e(
|
|
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(
|
|
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,
|
|
920
|
-
const a = ((N = t.usage) == null ? void 0 : N.inputTokens) ?? 0, _ = ((
|
|
921
|
-
return
|
|
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
|
-
|
|
925
|
+
kt,
|
|
926
926
|
{
|
|
927
|
-
getText: () =>
|
|
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
|
-
!
|
|
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 &&
|
|
940
|
+
for (; a >= 0 && F[a].role !== "user"; )
|
|
941
941
|
a--;
|
|
942
|
-
a >= 0 &&
|
|
942
|
+
a >= 0 && Qe(
|
|
943
943
|
a,
|
|
944
|
-
|
|
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} ${
|
|
961
|
-
onClick:
|
|
960
|
+
className: `${c.scrollTopBtn} ${l ? c.scrollTopBtnVisible : ""}`,
|
|
961
|
+
onClick: Q,
|
|
962
962
|
title: "回到最新消息",
|
|
963
963
|
"aria-label": "回到最新消息",
|
|
964
|
-
children: /* @__PURE__ */ e(
|
|
964
|
+
children: /* @__PURE__ */ e(cn, {})
|
|
965
965
|
}
|
|
966
966
|
),
|
|
967
967
|
/* @__PURE__ */ i("div", { className: c.composerWrap, children: [
|
|
968
|
-
|
|
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:
|
|
975
|
+
onClick: ct,
|
|
976
976
|
title: "取消编辑",
|
|
977
977
|
children: "取消"
|
|
978
978
|
}
|
|
979
979
|
)
|
|
980
980
|
] }),
|
|
981
|
-
|
|
981
|
+
Re != null && /* @__PURE__ */ i("div", { className: c.pendingBar, children: [
|
|
982
982
|
/* @__PURE__ */ i("span", { children: [
|
|
983
983
|
"已排队:「",
|
|
984
|
-
|
|
985
|
-
|
|
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:
|
|
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:
|
|
1003
|
+
ref: ae,
|
|
1004
1004
|
className: c.composerInput,
|
|
1005
|
-
placeholder:
|
|
1006
|
-
value:
|
|
1007
|
-
onChange:
|
|
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
|
-
|
|
1012
|
+
j ? /* @__PURE__ */ e(
|
|
1013
1013
|
"button",
|
|
1014
1014
|
{
|
|
1015
1015
|
type: "button",
|
|
1016
1016
|
className: c.stopBtn,
|
|
1017
|
-
onClick:
|
|
1017
|
+
onClick: Ue,
|
|
1018
1018
|
title: "停止生成(Esc)",
|
|
1019
1019
|
"aria-label": "停止生成",
|
|
1020
|
-
children: /* @__PURE__ */ e(
|
|
1020
|
+
children: /* @__PURE__ */ e(on, {})
|
|
1021
1021
|
}
|
|
1022
1022
|
) : /* @__PURE__ */ e(
|
|
1023
1023
|
"button",
|
|
1024
1024
|
{
|
|
1025
1025
|
type: "button",
|
|
1026
|
-
className: `${c.sendBtn} ${
|
|
1027
|
-
disabled: !
|
|
1028
|
-
onClick:
|
|
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(
|
|
1031
|
+
children: /* @__PURE__ */ e(It, {})
|
|
1032
1032
|
}
|
|
1033
1033
|
)
|
|
1034
1034
|
] }),
|
|
1035
|
-
/* @__PURE__ */ e("div", { className: c.composerHint, children:
|
|
1035
|
+
/* @__PURE__ */ e("div", { className: c.composerHint, children: j ? "Agent 正在工作中,可按 Esc 或点击停止按钮中断" : "Enter 发送 · Shift+Enter 换行 · 思考与工具调用自动展示" })
|
|
1036
1036
|
] })
|
|
1037
|
-
] }) :
|
|
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:
|
|
1045
|
-
children:
|
|
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:
|
|
1060
|
+
value: ce,
|
|
1061
1061
|
autoFocus: !0,
|
|
1062
|
-
onChange: (t) =>
|
|
1062
|
+
onChange: (t) => $e(t.target.value),
|
|
1063
1063
|
onKeyDown: (t) => {
|
|
1064
|
-
t.key === "Enter" && !t.shiftKey && !t.nativeEvent.isComposing && (t.preventDefault(),
|
|
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} ${
|
|
1074
|
-
disabled: !
|
|
1075
|
-
onClick: () => void
|
|
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(
|
|
1078
|
+
children: /* @__PURE__ */ e(It, {})
|
|
1079
1079
|
}
|
|
1080
1080
|
)
|
|
1081
1081
|
] }),
|
|
1082
|
-
/* @__PURE__ */ e("div", { className: c.landingChips, children:
|
|
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
|
|
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
|
|
1098
|
-
sidebarInner:
|
|
1099
|
-
header:
|
|
1100
|
-
headerActions:
|
|
1101
|
-
tabBar:
|
|
1102
|
-
tab:
|
|
1103
|
-
tabActive:
|
|
1104
|
-
btnSm:
|
|
1105
|
-
agentSection:
|
|
1106
|
-
agentItem:
|
|
1107
|
-
agentItemActive:
|
|
1108
|
-
agentAvatar:
|
|
1109
|
-
agentName:
|
|
1110
|
-
emptyState:
|
|
1111
|
-
createInputRow:
|
|
1112
|
-
createInput:
|
|
1113
|
-
createConfirmBtn:
|
|
1114
|
-
contextMenu:
|
|
1115
|
-
contextMenuItem:
|
|
1116
|
-
contextMenuItemDanger:
|
|
1117
|
-
contextMenuDivider:
|
|
1118
|
-
renameOverlay:
|
|
1119
|
-
renameDialog:
|
|
1120
|
-
renameTitle:
|
|
1121
|
-
renameInput:
|
|
1122
|
-
renameActions:
|
|
1123
|
-
renameBtn:
|
|
1124
|
-
renameBtnPrimary:
|
|
1125
|
-
agentDetailBtn:
|
|
1126
|
-
agentItemShared:
|
|
1127
|
-
agentInfo:
|
|
1128
|
-
agentOwner:
|
|
1129
|
-
sharedBadge:
|
|
1130
|
-
createLocalDialog:
|
|
1131
|
-
createLocalLabel:
|
|
1132
|
-
agentTypeCards:
|
|
1133
|
-
agentTypeCard:
|
|
1134
|
-
agentTypeIcon:
|
|
1135
|
-
agentTypeBody:
|
|
1136
|
-
agentTypeTitle:
|
|
1137
|
-
agentTypeDesc:
|
|
1138
|
-
agentTypeBadge:
|
|
1139
|
-
},
|
|
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
|
|
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
|
|
1152
|
+
return Dt[Math.abs(d) % Dt.length];
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function xt(s) {
|
|
1155
1155
|
return s ? s.charAt(0).toUpperCase() : "?";
|
|
1156
1156
|
}
|
|
1157
|
-
const
|
|
1158
|
-
function
|
|
1157
|
+
const rt = "-1";
|
|
1158
|
+
function Nl({
|
|
1159
1159
|
selectedAgentId: s,
|
|
1160
1160
|
selectedLocalAgentId: d,
|
|
1161
1161
|
onSelectAgent: u,
|
|
1162
|
-
onShowDetail:
|
|
1163
|
-
onChatWithAgent:
|
|
1162
|
+
onShowDetail: f,
|
|
1163
|
+
onChatWithAgent: I
|
|
1164
1164
|
}) {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
), [
|
|
1168
|
-
|
|
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
|
|
1171
|
-
|
|
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
|
-
|
|
1174
|
+
O(!1);
|
|
1175
1175
|
}
|
|
1176
|
-
}, [
|
|
1177
|
-
|
|
1176
|
+
}, [A, s, u]), ue = z(async () => {
|
|
1177
|
+
Re(!0);
|
|
1178
1178
|
try {
|
|
1179
|
-
const l = await
|
|
1180
|
-
|
|
1179
|
+
const l = await wn(A);
|
|
1180
|
+
w(l);
|
|
1181
1181
|
} catch {
|
|
1182
1182
|
} finally {
|
|
1183
|
-
|
|
1183
|
+
Re(!1);
|
|
1184
1184
|
}
|
|
1185
|
-
}, [
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
}, [
|
|
1189
|
-
|
|
1190
|
-
}, [
|
|
1191
|
-
const
|
|
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
|
|
1194
|
-
|
|
1193
|
+
const l = await Ut();
|
|
1194
|
+
ve(l);
|
|
1195
1195
|
} catch {
|
|
1196
|
-
|
|
1196
|
+
ve([]);
|
|
1197
1197
|
}
|
|
1198
1198
|
}, []);
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1199
|
+
R(() => {
|
|
1200
|
+
x === "local" && bt().then((l) => {
|
|
1201
|
+
ye(l), l && be();
|
|
1202
1202
|
});
|
|
1203
|
-
}, [
|
|
1204
|
-
if (!
|
|
1205
|
-
const l = (
|
|
1206
|
-
|
|
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
|
-
}, [
|
|
1210
|
-
const
|
|
1211
|
-
const l =
|
|
1209
|
+
}, [M]);
|
|
1210
|
+
const me = async () => {
|
|
1211
|
+
const l = se.trim();
|
|
1212
1212
|
if (l) {
|
|
1213
|
-
|
|
1213
|
+
B(!0);
|
|
1214
1214
|
try {
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1215
|
+
const v = await In(l, A);
|
|
1216
|
+
W((H) => [...H, v]), K(""), C(!1), u(v);
|
|
1217
1217
|
} catch {
|
|
1218
1218
|
} finally {
|
|
1219
|
-
|
|
1219
|
+
B(!1);
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
|
-
},
|
|
1222
|
+
}, Ae = async (l) => {
|
|
1223
1223
|
if (l === "jar") {
|
|
1224
|
-
|
|
1225
|
-
id:
|
|
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 (!
|
|
1236
|
-
if (!await
|
|
1237
|
-
|
|
1235
|
+
if (!fe) {
|
|
1236
|
+
if (!await bt()) {
|
|
1237
|
+
ot.error(
|
|
1238
1238
|
"本地 Agent 未启动,请通过菜单栏「重启 Agent」启动后再试"
|
|
1239
1239
|
);
|
|
1240
1240
|
return;
|
|
1241
1241
|
}
|
|
1242
|
-
|
|
1242
|
+
ye(!0);
|
|
1243
1243
|
}
|
|
1244
|
-
|
|
1244
|
+
ce(!0);
|
|
1245
1245
|
try {
|
|
1246
|
-
const
|
|
1247
|
-
await
|
|
1248
|
-
} catch (
|
|
1249
|
-
|
|
1250
|
-
|
|
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
|
-
|
|
1253
|
+
ce(!1);
|
|
1254
1254
|
}
|
|
1255
|
-
},
|
|
1255
|
+
}, Te = async (l) => {
|
|
1256
1256
|
if (window.confirm("确定删除此 Agent?"))
|
|
1257
1257
|
try {
|
|
1258
|
-
await
|
|
1259
|
-
} catch (
|
|
1260
|
-
|
|
1258
|
+
await Hn(l), await be();
|
|
1259
|
+
} catch (v) {
|
|
1260
|
+
ot.error(v.message || "删除失败");
|
|
1261
1261
|
}
|
|
1262
|
-
},
|
|
1262
|
+
}, Be = async (l) => {
|
|
1263
1263
|
if (window.confirm(
|
|
1264
1264
|
`确定删除 Agent「${l.displayName}」吗?所有会话记录将一并删除。`
|
|
1265
1265
|
))
|
|
1266
1266
|
try {
|
|
1267
|
-
await
|
|
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
|
-
},
|
|
1271
|
-
if (!
|
|
1272
|
-
const l =
|
|
1273
|
-
if (!l || l ===
|
|
1274
|
-
|
|
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
|
-
|
|
1277
|
+
j(!0);
|
|
1278
1278
|
try {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1279
|
+
const v = await An(
|
|
1280
|
+
T.agent.id,
|
|
1281
1281
|
l,
|
|
1282
|
-
|
|
1282
|
+
A
|
|
1283
1283
|
);
|
|
1284
|
-
|
|
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
|
-
|
|
1287
|
+
j(!1);
|
|
1288
1288
|
}
|
|
1289
|
-
},
|
|
1290
|
-
const
|
|
1289
|
+
}, je = async (l) => {
|
|
1290
|
+
const v = l.shared === 1;
|
|
1291
1291
|
if (window.confirm(
|
|
1292
|
-
|
|
1292
|
+
v ? `确定取消共享 Agent「${l.displayName}」吗?取消后其他用户将无法与此 Agent 聊天。` : `确定共享 Agent「${l.displayName}」吗?共享后其他用户可以与此 Agent 发起聊天。`
|
|
1293
1293
|
)) {
|
|
1294
|
-
|
|
1294
|
+
G(l.id);
|
|
1295
1295
|
try {
|
|
1296
|
-
const
|
|
1296
|
+
const H = await Bn(
|
|
1297
1297
|
l.id,
|
|
1298
|
-
!
|
|
1299
|
-
|
|
1298
|
+
!v,
|
|
1299
|
+
A
|
|
1300
1300
|
);
|
|
1301
|
-
|
|
1301
|
+
W((pe) => pe.map((he) => he.id === H.id ? H : he));
|
|
1302
1302
|
} catch {
|
|
1303
1303
|
} finally {
|
|
1304
|
-
|
|
1304
|
+
G(null);
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
},
|
|
1308
|
-
l.preventDefault(), l.stopPropagation(),
|
|
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
|
-
|
|
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
|
-
|
|
1319
|
+
C((l) => !l), K("");
|
|
1320
1320
|
},
|
|
1321
1321
|
title: "新建个人 Agent",
|
|
1322
1322
|
children: "+ 新建"
|
|
1323
1323
|
}
|
|
1324
1324
|
) }),
|
|
1325
|
-
|
|
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: () =>
|
|
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} ${
|
|
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} ${
|
|
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} ${
|
|
1360
|
+
className: `${r.tab} ${x === "shared" ? r.tabActive : ""}`,
|
|
1361
1361
|
onClick: () => $("shared"),
|
|
1362
1362
|
children: "共享"
|
|
1363
1363
|
}
|
|
1364
1364
|
)
|
|
1365
1365
|
] }),
|
|
1366
|
-
|
|
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} ${
|
|
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:
|
|
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:
|
|
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: (
|
|
1409
|
-
|
|
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
|
-
] }) }) :
|
|
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
|
-
] }) :
|
|
1424
|
+
] }) : _e.map((l) => /* @__PURE__ */ i(
|
|
1425
1425
|
"div",
|
|
1426
1426
|
{
|
|
1427
1427
|
className: `${r.agentItem} ${r.agentItemShared}`,
|
|
1428
|
-
onClick: () =>
|
|
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:
|
|
1436
|
+
backgroundColor: Mt(
|
|
1437
1437
|
l.agentCode || l.displayName
|
|
1438
1438
|
)
|
|
1439
1439
|
},
|
|
1440
|
-
children:
|
|
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: (
|
|
1456
|
-
|
|
1455
|
+
onClick: (v) => {
|
|
1456
|
+
v.stopPropagation(), I(l);
|
|
1457
1457
|
},
|
|
1458
1458
|
title: "开始聊天",
|
|
1459
|
-
children: /* @__PURE__ */ e(
|
|
1459
|
+
children: /* @__PURE__ */ e(Pt, { style: { fontSize: 12 } })
|
|
1460
1460
|
}
|
|
1461
1461
|
)
|
|
1462
1462
|
]
|
|
1463
1463
|
},
|
|
1464
1464
|
l.id
|
|
1465
|
-
)) }) : /* @__PURE__ */ i(
|
|
1466
|
-
|
|
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:
|
|
1473
|
+
value: se,
|
|
1474
1474
|
autoFocus: !0,
|
|
1475
|
-
onChange: (l) =>
|
|
1475
|
+
onChange: (l) => K(l.target.value),
|
|
1476
1476
|
onKeyDown: (l) => {
|
|
1477
|
-
l.key === "Enter" &&
|
|
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: !
|
|
1487
|
-
onClick:
|
|
1488
|
-
children:
|
|
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:
|
|
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
|
-
] }) :
|
|
1495
|
+
] }) : S.map((l) => /* @__PURE__ */ i(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className: `${r.agentItem} ${
|
|
1498
|
+
className: `${r.agentItem} ${st(s, l.id) ? r.agentItemActive : ""}`,
|
|
1499
1499
|
onClick: () => u(l),
|
|
1500
|
-
onContextMenu: (
|
|
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:
|
|
1507
|
+
backgroundColor: Mt(
|
|
1508
1508
|
l.agentCode || l.displayName
|
|
1509
1509
|
)
|
|
1510
1510
|
},
|
|
1511
|
-
children:
|
|
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: (
|
|
1524
|
-
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1527
|
-
x:
|
|
1528
|
-
y:
|
|
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(
|
|
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
|
-
|
|
1541
|
+
M && /* @__PURE__ */ i(
|
|
1542
1542
|
"div",
|
|
1543
1543
|
{
|
|
1544
|
-
ref:
|
|
1544
|
+
ref: $e,
|
|
1545
1545
|
className: r.contextMenu,
|
|
1546
|
-
style: { top:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1575
|
-
agent:
|
|
1576
|
-
value:
|
|
1577
|
-
}),
|
|
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
|
-
|
|
1587
|
+
Ce === null && je(M.agent), F(null);
|
|
1588
1588
|
},
|
|
1589
|
-
children:
|
|
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
|
-
|
|
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
|
-
|
|
1606
|
+
Ee && /* @__PURE__ */ e(
|
|
1607
1607
|
"div",
|
|
1608
1608
|
{
|
|
1609
1609
|
className: r.renameOverlay,
|
|
1610
|
-
onClick: () => !
|
|
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:
|
|
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: () =>
|
|
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: () =>
|
|
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: () =>
|
|
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: () =>
|
|
1694
|
-
disabled:
|
|
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
|
-
|
|
1703
|
+
T && /* @__PURE__ */ e(
|
|
1704
1704
|
"div",
|
|
1705
1705
|
{
|
|
1706
1706
|
className: r.renameOverlay,
|
|
1707
|
-
onClick: () => !
|
|
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:
|
|
1720
|
+
value: T.value,
|
|
1721
1721
|
autoFocus: !0,
|
|
1722
|
-
onChange: (l) =>
|
|
1722
|
+
onChange: (l) => J({ ...T, value: l.target.value }),
|
|
1723
1723
|
onKeyDown: (l) => {
|
|
1724
|
-
l.key === "Enter" &&
|
|
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: () =>
|
|
1735
|
-
disabled:
|
|
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: !
|
|
1745
|
-
onClick:
|
|
1746
|
-
children:
|
|
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
|
|
1758
|
-
shell:
|
|
1759
|
-
inset:
|
|
1760
|
-
main:
|
|
1761
|
-
pane:
|
|
1762
|
-
skipLink:
|
|
1763
|
-
personalMainArea:
|
|
1764
|
-
personalSidebar:
|
|
1765
|
-
personalChatArea:
|
|
1766
|
-
},
|
|
1767
|
-
sidebar:
|
|
1768
|
-
collapsed:
|
|
1769
|
-
sideHeader:
|
|
1770
|
-
sideHeaderIcon:
|
|
1771
|
-
sideHeaderTitle:
|
|
1772
|
-
sideContent:
|
|
1773
|
-
groupLabel:
|
|
1774
|
-
navList:
|
|
1775
|
-
navItem:
|
|
1776
|
-
navItemActive:
|
|
1777
|
-
navIcon:
|
|
1778
|
-
navLabel:
|
|
1779
|
-
sideFooter:
|
|
1780
|
-
footHint:
|
|
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
|
|
1782
|
+
function Ul({
|
|
1783
1783
|
items: s,
|
|
1784
1784
|
activeTab: d,
|
|
1785
1785
|
collapsed: u,
|
|
1786
|
-
footerItems:
|
|
1787
|
-
onSelect:
|
|
1788
|
-
onSwitchMode:
|
|
1786
|
+
footerItems: f,
|
|
1787
|
+
onSelect: I,
|
|
1788
|
+
onSwitchMode: A
|
|
1789
1789
|
}) {
|
|
1790
1790
|
return /* @__PURE__ */ i(
|
|
1791
1791
|
"aside",
|
|
1792
1792
|
{
|
|
1793
|
-
className: `${
|
|
1793
|
+
className: `${X.sidebar} ${u ? X.collapsed : ""}`,
|
|
1794
1794
|
"aria-label": "个人工作台导航",
|
|
1795
1795
|
children: [
|
|
1796
|
-
/* @__PURE__ */ i("div", { className:
|
|
1797
|
-
/* @__PURE__ */ e("span", { className:
|
|
1798
|
-
!u && /* @__PURE__ */ e("span", { className:
|
|
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:
|
|
1801
|
-
!u && /* @__PURE__ */ e("p", { className:
|
|
1802
|
-
/* @__PURE__ */ e("nav", { className:
|
|
1803
|
-
const
|
|
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: `${
|
|
1808
|
-
onClick: () =>
|
|
1809
|
-
"aria-current":
|
|
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:
|
|
1812
|
-
!u && /* @__PURE__ */ e("span", { className:
|
|
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
|
-
|
|
1815
|
+
y.key
|
|
1816
1816
|
);
|
|
1817
|
-
return u ? /* @__PURE__ */ e(
|
|
1817
|
+
return u ? /* @__PURE__ */ e(Ct, { placement: "right", title: y.label, children: $ }, y.key) : $;
|
|
1818
1818
|
}) })
|
|
1819
1819
|
] }),
|
|
1820
|
-
/* @__PURE__ */ i("div", { className:
|
|
1821
|
-
|
|
1822
|
-
const
|
|
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:
|
|
1827
|
-
onClick: () =>
|
|
1826
|
+
className: X.navItem,
|
|
1827
|
+
onClick: () => A == null ? void 0 : A(y.mode),
|
|
1828
1828
|
children: [
|
|
1829
|
-
/* @__PURE__ */ e("span", { className:
|
|
1830
|
-
!u && /* @__PURE__ */ e("span", { className:
|
|
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
|
-
|
|
1833
|
+
y.mode
|
|
1834
1834
|
);
|
|
1835
|
-
return u ? /* @__PURE__ */ e(
|
|
1835
|
+
return u ? /* @__PURE__ */ e(Ct, { placement: "right", title: y.label, children: x }, y.mode) : x;
|
|
1836
1836
|
}) }),
|
|
1837
|
-
!u && /* @__PURE__ */ e("p", { className:
|
|
1837
|
+
!u && /* @__PURE__ */ e("p", { className: X.footHint, children: "⌘ / Ctrl + B 切换导航" })
|
|
1838
1838
|
] })
|
|
1839
1839
|
]
|
|
1840
1840
|
}
|
|
1841
1841
|
);
|
|
1842
1842
|
}
|
|
1843
|
-
const
|
|
1844
|
-
topbar:
|
|
1845
|
-
topbarLeft:
|
|
1846
|
-
collapseBtn:
|
|
1847
|
-
crumbs:
|
|
1848
|
-
crumbsRoot:
|
|
1849
|
-
crumbsSep:
|
|
1850
|
-
crumbsCurrent:
|
|
1851
|
-
topbarRight:
|
|
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
|
|
1853
|
+
function Zl({
|
|
1854
1854
|
label: s,
|
|
1855
1855
|
collapsed: d,
|
|
1856
1856
|
onToggleCollapse: u
|
|
1857
1857
|
}) {
|
|
1858
|
-
return /* @__PURE__ */ i("header", { className:
|
|
1859
|
-
/* @__PURE__ */ i("div", { className:
|
|
1858
|
+
return /* @__PURE__ */ i("header", { className: Fe.topbar, children: [
|
|
1859
|
+
/* @__PURE__ */ i("div", { className: Fe.topbarLeft, children: [
|
|
1860
1860
|
/* @__PURE__ */ e(
|
|
1861
|
-
|
|
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:
|
|
1869
|
+
className: Fe.collapseBtn,
|
|
1870
1870
|
onClick: u,
|
|
1871
1871
|
"aria-label": "展开或收起个人菜单",
|
|
1872
1872
|
"aria-expanded": !d,
|
|
1873
|
-
children: d ? /* @__PURE__ */ e(
|
|
1873
|
+
children: d ? /* @__PURE__ */ e(un, {}) : /* @__PURE__ */ e(mn, {})
|
|
1874
1874
|
}
|
|
1875
1875
|
)
|
|
1876
1876
|
}
|
|
1877
1877
|
),
|
|
1878
|
-
/* @__PURE__ */ i("div", { className:
|
|
1879
|
-
/* @__PURE__ */ e("span", { className:
|
|
1880
|
-
/* @__PURE__ */ e(
|
|
1881
|
-
/* @__PURE__ */ e("span", { className:
|
|
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:
|
|
1884
|
+
/* @__PURE__ */ e("div", { className: Fe.topbarRight })
|
|
1885
1885
|
] });
|
|
1886
1886
|
}
|
|
1887
|
-
const
|
|
1888
|
-
{ key: "workbench", label: "场景工作台", icon: /* @__PURE__ */ e(
|
|
1889
|
-
{ key: "projects", label: "工作单管理", icon: /* @__PURE__ */ e(
|
|
1890
|
-
{ key: "personal", label: "个人统计", icon: /* @__PURE__ */ e(
|
|
1891
|
-
{ key: "business-stats", label: "业务指标", icon: /* @__PURE__ */ e(
|
|
1892
|
-
{ key: "tools", label: "常用工具", icon: /* @__PURE__ */ e(
|
|
1893
|
-
{ key: "websites", label: "常用网站", icon: /* @__PURE__ */ e(
|
|
1894
|
-
{ key: "smart-partner", label: "智能伙伴", icon: /* @__PURE__ */ e(
|
|
1895
|
-
{ key: "todo", label: "工作待办", icon: /* @__PURE__ */ e(
|
|
1896
|
-
{ key: "notes", label: "个人笔记", icon: /* @__PURE__ */ e(
|
|
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(
|
|
1900
|
+
icon: /* @__PURE__ */ e(Nn, {}),
|
|
1901
1901
|
// 学员侧学习入口与培训管理(TRAINING)解耦:按需单独分配,不随培训入口发放
|
|
1902
1902
|
permission: "TRAINING_CENTER"
|
|
1903
1903
|
},
|
|
1904
|
-
{ key: "webide", label: "WebIDE", icon: /* @__PURE__ */ e(
|
|
1905
|
-
],
|
|
1906
|
-
function
|
|
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(
|
|
1908
|
+
return localStorage.getItem(tn) === "1";
|
|
1909
1909
|
} catch {
|
|
1910
1910
|
return !1;
|
|
1911
1911
|
}
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
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
|
|
1917
|
+
function ni() {
|
|
1918
1918
|
try {
|
|
1919
1919
|
const s = new URLSearchParams(window.location.search).get("tab");
|
|
1920
|
-
return s &&
|
|
1920
|
+
return s && en.some((d) => d.key === s) ? s : null;
|
|
1921
1921
|
} catch {
|
|
1922
1922
|
return null;
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
|
-
function
|
|
1925
|
+
function si({
|
|
1926
1926
|
onOpenProject: s,
|
|
1927
1927
|
openTodoId: d,
|
|
1928
1928
|
selectedPersonalAgent: u,
|
|
1929
|
-
personalView:
|
|
1930
|
-
newSessionTrigger:
|
|
1931
|
-
onSelectPersonalAgent:
|
|
1932
|
-
onShowPersonalAgentDetail:
|
|
1933
|
-
onChatWithPersonalAgent:
|
|
1929
|
+
personalView: f,
|
|
1930
|
+
newSessionTrigger: I,
|
|
1931
|
+
onSelectPersonalAgent: A,
|
|
1932
|
+
onShowPersonalAgentDetail: y,
|
|
1933
|
+
onChatWithPersonalAgent: x,
|
|
1934
1934
|
onSwitchMode: $
|
|
1935
1935
|
}) {
|
|
1936
|
-
var
|
|
1937
|
-
const [
|
|
1936
|
+
var _e;
|
|
1937
|
+
const [S, W] = m(
|
|
1938
1938
|
// 惰性初始化:命中深链时直接以目标 Tab 首屏渲染,不先渲染场景工作台再切
|
|
1939
|
-
() =>
|
|
1939
|
+
() => ni() ?? "workbench"
|
|
1940
1940
|
);
|
|
1941
|
-
|
|
1941
|
+
R(() => {
|
|
1942
1942
|
try {
|
|
1943
|
-
const
|
|
1944
|
-
if (!
|
|
1945
|
-
|
|
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 [
|
|
1950
|
-
|
|
1949
|
+
const [q, O] = m(ei);
|
|
1950
|
+
R(() => {
|
|
1951
1951
|
try {
|
|
1952
|
-
localStorage.setItem(
|
|
1952
|
+
localStorage.setItem(tn, q ? "1" : "0");
|
|
1953
1953
|
} catch {
|
|
1954
1954
|
}
|
|
1955
|
-
}, [
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1955
|
+
}, [q]);
|
|
1956
|
+
const L = z(() => {
|
|
1957
|
+
O((w) => !w), window.setTimeout(() => window.dispatchEvent(new Event("resize")), 300);
|
|
1958
1958
|
}, []);
|
|
1959
|
-
|
|
1960
|
-
function
|
|
1961
|
-
!(
|
|
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",
|
|
1964
|
-
}, [
|
|
1965
|
-
const
|
|
1966
|
-
(
|
|
1967
|
-
),
|
|
1968
|
-
{ mode: "admin", label: "运营工作台", icon: /* @__PURE__ */ e(
|
|
1969
|
-
{ mode: "collaboration", label: "协作工作台", icon: /* @__PURE__ */ e(
|
|
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
|
-
(
|
|
1972
|
-
) : [], [
|
|
1973
|
-
|
|
1974
|
-
}, []),
|
|
1975
|
-
|
|
1976
|
-
}, []),
|
|
1977
|
-
|
|
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
|
|
1980
|
-
d != null && d.id && (
|
|
1981
|
-
}, [d == null ? void 0 : d.id, d == null ? void 0 : d.ts]), /* @__PURE__ */ i("div", { className:
|
|
1982
|
-
/* @__PURE__ */ e("a", { className:
|
|
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
|
-
|
|
1984
|
+
Ul,
|
|
1985
1985
|
{
|
|
1986
|
-
items:
|
|
1987
|
-
activeTab:
|
|
1988
|
-
collapsed:
|
|
1989
|
-
footerItems:
|
|
1990
|
-
onSelect:
|
|
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:
|
|
1994
|
+
/* @__PURE__ */ i("div", { className: Pe.inset, children: [
|
|
1995
1995
|
/* @__PURE__ */ e(
|
|
1996
|
-
|
|
1996
|
+
Zl,
|
|
1997
1997
|
{
|
|
1998
|
-
label:
|
|
1999
|
-
collapsed:
|
|
2000
|
-
onToggleCollapse:
|
|
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": `${
|
|
2009
|
-
className:
|
|
2010
|
-
children: /* @__PURE__ */ i("div", { className:
|
|
2011
|
-
(
|
|
2012
|
-
|
|
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:
|
|
2015
|
-
onActiveTabChange:
|
|
2014
|
+
activeTab: S,
|
|
2015
|
+
onActiveTabChange: J,
|
|
2016
2016
|
onOpenProject: s,
|
|
2017
2017
|
hideTabs: !0
|
|
2018
2018
|
}
|
|
2019
2019
|
),
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
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:
|
|
2028
|
-
openTodoId:
|
|
2027
|
+
onOpenNote: U,
|
|
2028
|
+
openTodoId: F
|
|
2029
2029
|
}
|
|
2030
2030
|
),
|
|
2031
|
-
|
|
2032
|
-
|
|
2031
|
+
S === "notes" && /* @__PURE__ */ e(
|
|
2032
|
+
$t,
|
|
2033
2033
|
{
|
|
2034
2034
|
onOpenProject: s,
|
|
2035
|
-
onOpenTodo:
|
|
2036
|
-
openNoteId:
|
|
2035
|
+
onOpenTodo: j,
|
|
2036
|
+
openNoteId: B
|
|
2037
2037
|
}
|
|
2038
2038
|
),
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
/* @__PURE__ */ e("div", { className:
|
|
2043
|
-
|
|
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:
|
|
2048
|
-
onShowDetail:
|
|
2049
|
-
onChatWithAgent:
|
|
2047
|
+
onSelectAgent: A,
|
|
2048
|
+
onShowDetail: y,
|
|
2049
|
+
onChatWithAgent: x
|
|
2050
2050
|
}
|
|
2051
2051
|
) }),
|
|
2052
|
-
/* @__PURE__ */ e("div", { className:
|
|
2053
|
-
|
|
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: () =>
|
|
2056
|
+
onBack: () => A(u)
|
|
2057
2057
|
}
|
|
2058
2058
|
) : u != null && u.isLocal ? /* @__PURE__ */ e(
|
|
2059
|
-
|
|
2059
|
+
Zt,
|
|
2060
2060
|
{
|
|
2061
2061
|
agent: u,
|
|
2062
|
-
newSessionTrigger:
|
|
2062
|
+
newSessionTrigger: I
|
|
2063
2063
|
}
|
|
2064
2064
|
) : /* @__PURE__ */ e(
|
|
2065
|
-
|
|
2065
|
+
Yt,
|
|
2066
2066
|
{
|
|
2067
2067
|
agent: u,
|
|
2068
|
-
newSessionTrigger:
|
|
2068
|
+
newSessionTrigger: I
|
|
2069
2069
|
}
|
|
2070
2070
|
) })
|
|
2071
2071
|
] })
|
|
@@ -2075,49 +2075,49 @@ function Zl({
|
|
|
2075
2075
|
] })
|
|
2076
2076
|
] });
|
|
2077
2077
|
}
|
|
2078
|
-
const
|
|
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
|
-
],
|
|
2082
|
+
], ii = [
|
|
2083
2083
|
{
|
|
2084
2084
|
key: "video",
|
|
2085
2085
|
label: "视频生成",
|
|
2086
|
-
icon: /* @__PURE__ */ e(
|
|
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(
|
|
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(
|
|
2099
|
+
icon: /* @__PURE__ */ e(Yn, {}),
|
|
2100
2100
|
action: "webide"
|
|
2101
2101
|
},
|
|
2102
2102
|
{
|
|
2103
2103
|
key: "design",
|
|
2104
2104
|
label: "设计视觉",
|
|
2105
|
-
icon: /* @__PURE__ */ e(
|
|
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(
|
|
2112
|
+
icon: /* @__PURE__ */ e(dt, {}),
|
|
2113
2113
|
action: "ask"
|
|
2114
2114
|
}
|
|
2115
2115
|
];
|
|
2116
|
-
function
|
|
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
|
|
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
|
|
2141
|
+
function ki({
|
|
2142
2142
|
onSwitchMode: s,
|
|
2143
2143
|
onOpenProject: d,
|
|
2144
2144
|
openAgentRequest: u
|
|
2145
2145
|
}) {
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
), [B,
|
|
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
|
-
), [
|
|
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,
|
|
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 =
|
|
2155
|
-
g && !
|
|
2154
|
+
const g = Pn(n);
|
|
2155
|
+
g && !qt(I, g) || (qe(n), L("personalTab"));
|
|
2156
2156
|
},
|
|
2157
|
-
[
|
|
2158
|
-
), [
|
|
2157
|
+
[I]
|
|
2158
|
+
), [H, pe] = m(!1), [he, ae] = m(
|
|
2159
2159
|
null
|
|
2160
|
-
), [
|
|
2160
|
+
), [We, Oe] = m(
|
|
2161
2161
|
null
|
|
2162
|
-
), [
|
|
2162
|
+
), [Ke, Ze] = m(
|
|
2163
2163
|
null
|
|
2164
|
-
), te =
|
|
2164
|
+
), te = z(
|
|
2165
2165
|
(n, g) => {
|
|
2166
2166
|
d == null || d(n, g);
|
|
2167
2167
|
},
|
|
2168
2168
|
[d]
|
|
2169
|
-
),
|
|
2170
|
-
|
|
2171
|
-
}, []), [
|
|
2172
|
-
() =>
|
|
2173
|
-
[
|
|
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
|
-
|
|
2176
|
-
const
|
|
2177
|
-
() =>
|
|
2178
|
-
[
|
|
2175
|
+
Z && ve && ee.length > 0;
|
|
2176
|
+
const Q = Me(
|
|
2177
|
+
() => ee.find((n) => n.id === ce) ?? null,
|
|
2178
|
+
[ee, ce]
|
|
2179
2179
|
);
|
|
2180
|
-
|
|
2180
|
+
R(() => {
|
|
2181
2181
|
let n = !0;
|
|
2182
|
-
return
|
|
2183
|
-
n &&
|
|
2182
|
+
return S(!0), Wt(f).then((g) => {
|
|
2183
|
+
n && x(g);
|
|
2184
2184
|
}).catch(() => {
|
|
2185
2185
|
}).finally(() => {
|
|
2186
|
-
n &&
|
|
2186
|
+
n && S(!1);
|
|
2187
2187
|
}), () => {
|
|
2188
2188
|
n = !1;
|
|
2189
2189
|
};
|
|
2190
|
-
}, [
|
|
2191
|
-
if (!
|
|
2190
|
+
}, [f]), R(() => {
|
|
2191
|
+
if (!Z) return;
|
|
2192
2192
|
let n = !0;
|
|
2193
2193
|
const g = async () => {
|
|
2194
|
-
const t = await
|
|
2194
|
+
const t = await bt();
|
|
2195
2195
|
if (n) {
|
|
2196
|
-
if (
|
|
2197
|
-
|
|
2196
|
+
if (Ee(t), !t) {
|
|
2197
|
+
Se([]);
|
|
2198
2198
|
return;
|
|
2199
2199
|
}
|
|
2200
2200
|
try {
|
|
2201
|
-
const o = await
|
|
2202
|
-
n &&
|
|
2201
|
+
const o = await Ut();
|
|
2202
|
+
n && Se(o);
|
|
2203
2203
|
} catch {
|
|
2204
2204
|
}
|
|
2205
2205
|
}
|
|
2206
2206
|
};
|
|
2207
2207
|
g();
|
|
2208
|
-
const
|
|
2208
|
+
const k = window.setInterval(() => void g(), 3e4);
|
|
2209
2209
|
return () => {
|
|
2210
|
-
n = !1, window.clearInterval(
|
|
2210
|
+
n = !1, window.clearInterval(k);
|
|
2211
2211
|
};
|
|
2212
|
-
}, []),
|
|
2213
|
-
if (!
|
|
2212
|
+
}, []), R(() => {
|
|
2213
|
+
if (!Z || ee.length === 0 || ce && ee.some((g) => g.id === ce))
|
|
2214
2214
|
return;
|
|
2215
|
-
const n =
|
|
2216
|
-
|
|
2217
|
-
}, [
|
|
2218
|
-
const
|
|
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
|
|
2220
|
+
for (const g of y) n.set(g.id, g);
|
|
2221
2221
|
return n;
|
|
2222
|
-
}, [
|
|
2223
|
-
|
|
2222
|
+
}, [y]), tt = z(async () => {
|
|
2223
|
+
U(!0);
|
|
2224
2224
|
const [n, g] = await Promise.allSettled([
|
|
2225
|
-
|
|
2226
|
-
|
|
2225
|
+
Ln(f),
|
|
2226
|
+
ss(f)
|
|
2227
2227
|
]);
|
|
2228
|
-
if (n.status === "fulfilled" &&
|
|
2229
|
-
const
|
|
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
|
-
|
|
2232
|
-
|
|
2231
|
+
k.has(o.id) || (k.add(o.id), t.push(o));
|
|
2232
|
+
T(t);
|
|
2233
2233
|
}
|
|
2234
|
-
|
|
2235
|
-
}, [
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
}, [
|
|
2239
|
-
const
|
|
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
|
|
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 = [],
|
|
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
|
|
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 _,
|
|
2264
|
-
return ((_ = a.sessions[0]) == null ? void 0 : _.updateTime) || ((
|
|
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
|
-
}, [
|
|
2267
|
+
}, [F, B]), lt = Me(
|
|
2268
2268
|
() => {
|
|
2269
2269
|
var n;
|
|
2270
|
-
return
|
|
2271
|
-
(g) => g.sessions.some((
|
|
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
|
-
[
|
|
2274
|
+
[Le, C == null ? void 0 : C.sessionId]
|
|
2275
2275
|
);
|
|
2276
|
-
|
|
2276
|
+
R(() => {
|
|
2277
2277
|
var g;
|
|
2278
|
-
const n =
|
|
2279
|
-
n && (
|
|
2280
|
-
(
|
|
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
|
-
}, [
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
if (!
|
|
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
|
|
2288
|
-
n &&
|
|
2287
|
+
return Kt(nt).then((g) => {
|
|
2288
|
+
n && _e([...g].sort((k, t) => t.updatedAt - k.updatedAt));
|
|
2289
2289
|
}).catch(() => {
|
|
2290
|
-
n &&
|
|
2290
|
+
n && _e([]);
|
|
2291
2291
|
}), () => {
|
|
2292
2292
|
n = !1;
|
|
2293
2293
|
};
|
|
2294
2294
|
}, [
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2295
|
+
K,
|
|
2296
|
+
ve,
|
|
2297
|
+
nt,
|
|
2298
|
+
w,
|
|
2299
2299
|
G
|
|
2300
2300
|
]);
|
|
2301
|
-
const
|
|
2302
|
-
|
|
2303
|
-
},
|
|
2304
|
-
|
|
2305
|
-
(t) => t && t.agent.id === n.id && t.sessionId === g && !
|
|
2306
|
-
),
|
|
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
|
-
|
|
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 (
|
|
2313
|
-
|
|
2312
|
+
if (q(g.id), n.view === "detail") {
|
|
2313
|
+
ae(g), L("agentDetail");
|
|
2314
2314
|
return;
|
|
2315
2315
|
}
|
|
2316
|
-
|
|
2316
|
+
le(g, n.sessionId ?? null), n.newSession > 0 && fe((k) => k + 1);
|
|
2317
2317
|
}, [u == null ? void 0 : u.ts]);
|
|
2318
|
-
const
|
|
2319
|
-
|
|
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
|
-
|
|
2324
|
-
|
|
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
|
-
|
|
2328
|
+
le(re);
|
|
2329
2329
|
return;
|
|
2330
2330
|
}
|
|
2331
|
-
|
|
2332
|
-
},
|
|
2333
|
-
|
|
2334
|
-
},
|
|
2335
|
-
const n =
|
|
2336
|
-
if (!(!n ||
|
|
2337
|
-
if (
|
|
2338
|
-
|
|
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
|
-
|
|
2342
|
+
Ae(!0);
|
|
2343
2343
|
try {
|
|
2344
|
-
const g = n.length > 20 ? `${n.slice(0, 20)}…` : n,
|
|
2344
|
+
const g = n.length > 20 ? `${n.slice(0, 20)}…` : n, k = await Dn(
|
|
2345
2345
|
Ne.id,
|
|
2346
2346
|
g,
|
|
2347
|
-
|
|
2348
|
-
|
|
2347
|
+
f,
|
|
2348
|
+
Y
|
|
2349
2349
|
);
|
|
2350
|
-
|
|
2350
|
+
je(null), se({
|
|
2351
2351
|
agent: Ne,
|
|
2352
|
-
sessionId:
|
|
2352
|
+
sessionId: k.id,
|
|
2353
2353
|
draft: n,
|
|
2354
2354
|
ts: Date.now()
|
|
2355
|
-
}),
|
|
2355
|
+
}), ue(""), L("chat");
|
|
2356
2356
|
} catch {
|
|
2357
2357
|
} finally {
|
|
2358
|
-
|
|
2358
|
+
Ae(!1);
|
|
2359
2359
|
}
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
|
-
},
|
|
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(
|
|
2366
|
+
icon: /* @__PURE__ */ e(Qn, {})
|
|
2367
2367
|
},
|
|
2368
2368
|
{
|
|
2369
2369
|
mode: "collaboration",
|
|
2370
2370
|
label: "协作工作台",
|
|
2371
|
-
icon: /* @__PURE__ */ e(
|
|
2371
|
+
icon: /* @__PURE__ */ e(Xn, {})
|
|
2372
2372
|
}
|
|
2373
2373
|
].filter(
|
|
2374
|
-
(g) =>
|
|
2375
|
-
) : [], [
|
|
2376
|
-
let
|
|
2377
|
-
return
|
|
2378
|
-
|
|
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:
|
|
2381
|
-
onBack: () =>
|
|
2380
|
+
agent: he,
|
|
2381
|
+
onBack: () => L("extensions")
|
|
2382
2382
|
}
|
|
2383
|
-
) }) :
|
|
2384
|
-
|
|
2383
|
+
) }) : O === "schedule" ? ie = /* @__PURE__ */ e(cs, { localOnline: ve }) : O === "extensions" ? ie = /* @__PURE__ */ e(
|
|
2384
|
+
os,
|
|
2385
2385
|
{
|
|
2386
|
-
agents:
|
|
2387
|
-
loading:
|
|
2386
|
+
agents: y,
|
|
2387
|
+
loading: $,
|
|
2388
2388
|
skillsAgent: re,
|
|
2389
|
-
token:
|
|
2390
|
-
onChat: (n) =>
|
|
2389
|
+
token: f,
|
|
2390
|
+
onChat: (n) => le(n),
|
|
2391
2391
|
onConfig: (n) => {
|
|
2392
|
-
|
|
2392
|
+
ae(n), L("agentDetail");
|
|
2393
2393
|
},
|
|
2394
|
-
onCreated: (n) =>
|
|
2394
|
+
onCreated: (n) => x((g) => [...g, n])
|
|
2395
2395
|
}
|
|
2396
|
-
) :
|
|
2397
|
-
|
|
2396
|
+
) : O === "history" ? ie = /* @__PURE__ */ e(
|
|
2397
|
+
rs,
|
|
2398
2398
|
{
|
|
2399
|
-
agents:
|
|
2400
|
-
token:
|
|
2401
|
-
onOpenSession: (n, g) =>
|
|
2399
|
+
agents: y,
|
|
2400
|
+
token: f,
|
|
2401
|
+
onOpenSession: (n, g) => le(n, g)
|
|
2402
2402
|
}
|
|
2403
|
-
) :
|
|
2404
|
-
|
|
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) =>
|
|
2410
|
+
onSelectPersonalAgent: (n) => q((n == null ? void 0 : n.id) ?? null),
|
|
2411
2411
|
onShowPersonalAgentDetail: (n) => {
|
|
2412
|
-
|
|
2412
|
+
ae(n), L("agentDetail");
|
|
2413
2413
|
},
|
|
2414
|
-
onChatWithPersonalAgent: (n) =>
|
|
2414
|
+
onChatWithPersonalAgent: (n) => le(n),
|
|
2415
2415
|
onSwitchMode: s
|
|
2416
2416
|
}
|
|
2417
|
-
) :
|
|
2418
|
-
|
|
2419
|
-
|
|
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
|
-
|
|
2429
|
-
|
|
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
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
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
|
-
|
|
2446
|
+
qe("notes"), Oe({ id: n, ts: Date.now() });
|
|
2447
2447
|
},
|
|
2448
|
-
openTodoId:
|
|
2448
|
+
openTodoId: Ke
|
|
2449
2449
|
}
|
|
2450
2450
|
),
|
|
2451
|
-
|
|
2452
|
-
|
|
2451
|
+
oe === "notes" && /* @__PURE__ */ e(
|
|
2452
|
+
$t,
|
|
2453
2453
|
{
|
|
2454
2454
|
onOpenProject: te,
|
|
2455
|
-
onOpenTodo:
|
|
2456
|
-
openNoteId:
|
|
2455
|
+
onOpenTodo: ze,
|
|
2456
|
+
openNoteId: We
|
|
2457
2457
|
}
|
|
2458
2458
|
),
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
] }) :
|
|
2462
|
-
|
|
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:
|
|
2465
|
-
initialSessionId:
|
|
2466
|
-
autoSendDraft:
|
|
2464
|
+
agent: C.agent,
|
|
2465
|
+
initialSessionId: C.sessionId,
|
|
2466
|
+
autoSendDraft: C.draft,
|
|
2467
2467
|
chromeless: !0,
|
|
2468
|
-
agents:
|
|
2469
|
-
onSwitchAgent: (n) =>
|
|
2468
|
+
agents: y,
|
|
2469
|
+
onSwitchAgent: (n) => le(n)
|
|
2470
2470
|
},
|
|
2471
|
-
|
|
2472
|
-
) }) :
|
|
2473
|
-
|
|
2471
|
+
gt
|
|
2472
|
+
) }) : Z && Q && O !== "landing" ? ie = /* @__PURE__ */ e("div", { className: p.chatHost, children: /* @__PURE__ */ e(
|
|
2473
|
+
Zt,
|
|
2474
2474
|
{
|
|
2475
|
-
agent:
|
|
2475
|
+
agent: oi(Q),
|
|
2476
2476
|
newSessionTrigger: G,
|
|
2477
2477
|
autoSendDraft: ye,
|
|
2478
|
-
onAutoSendConsumed: () =>
|
|
2479
|
-
openSessionId:
|
|
2480
|
-
onOpenSessionConsumed:
|
|
2478
|
+
onAutoSendConsumed: () => Ie(null),
|
|
2479
|
+
openSessionId: w,
|
|
2480
|
+
onOpenSessionConsumed: mt
|
|
2481
2481
|
},
|
|
2482
|
-
|
|
2483
|
-
) }) :
|
|
2484
|
-
/* @__PURE__ */ e("div", { className:
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
|
|
2487
|
-
|
|
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:
|
|
2495
|
-
className:
|
|
2496
|
-
placeholder:
|
|
2491
|
+
ref: be,
|
|
2492
|
+
className: p.landingInput,
|
|
2493
|
+
placeholder: `给智能伙伴发送消息,${ns(A.sendKey)}`,
|
|
2497
2494
|
rows: 3,
|
|
2498
|
-
value:
|
|
2495
|
+
value: ke,
|
|
2499
2496
|
autoFocus: !0,
|
|
2500
|
-
onChange: (n) =>
|
|
2497
|
+
onChange: (n) => ue(n.target.value),
|
|
2501
2498
|
onKeyDown: (n) => {
|
|
2502
|
-
n
|
|
2499
|
+
zt(n, A.sendKey) && !n.nativeEvent.isComposing && (n.preventDefault(), Ve());
|
|
2503
2500
|
}
|
|
2504
2501
|
}
|
|
2505
2502
|
),
|
|
2506
|
-
/* @__PURE__ */ i("div", { className:
|
|
2507
|
-
|
|
2508
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
2507
|
+
Q.name,
|
|
2511
2508
|
"(本机)"
|
|
2512
2509
|
] })
|
|
2513
|
-
] }) : Ne ? /* @__PURE__ */ i("div", { className:
|
|
2510
|
+
] }) : Ne ? /* @__PURE__ */ i("div", { className: p.agentChipWrap, children: [
|
|
2514
2511
|
/* @__PURE__ */ i(
|
|
2515
2512
|
"button",
|
|
2516
2513
|
{
|
|
2517
2514
|
type: "button",
|
|
2518
|
-
className:
|
|
2519
|
-
onClick: () =>
|
|
2515
|
+
className: p.agentChip,
|
|
2516
|
+
onClick: () => Be((n) => !n),
|
|
2520
2517
|
children: [
|
|
2521
|
-
/* @__PURE__ */ e(
|
|
2518
|
+
/* @__PURE__ */ e(dt, {}),
|
|
2522
2519
|
/* @__PURE__ */ e("span", { children: Ne.displayName }),
|
|
2523
|
-
|
|
2520
|
+
y.length > 1 && /* @__PURE__ */ e(ft, { className: p.chipCaret })
|
|
2524
2521
|
]
|
|
2525
2522
|
}
|
|
2526
2523
|
),
|
|
2527
|
-
|
|
2524
|
+
Te && y.length > 1 && /* @__PURE__ */ i(xe, { children: [
|
|
2528
2525
|
/* @__PURE__ */ e(
|
|
2529
2526
|
"div",
|
|
2530
2527
|
{
|
|
2531
|
-
className:
|
|
2532
|
-
onClick: () =>
|
|
2528
|
+
className: p.agentMenuMask,
|
|
2529
|
+
onClick: () => Be(!1)
|
|
2533
2530
|
}
|
|
2534
2531
|
),
|
|
2535
|
-
/* @__PURE__ */ e("div", { className:
|
|
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: `${
|
|
2537
|
+
className: `${p.agentMenuItem} ${n.id === Ne.id ? p.agentMenuItemActive : ""}`,
|
|
2541
2538
|
onClick: () => {
|
|
2542
|
-
|
|
2539
|
+
q(n.id), Be(!1);
|
|
2543
2540
|
},
|
|
2544
2541
|
children: [
|
|
2545
2542
|
/* @__PURE__ */ e(
|
|
2546
2543
|
"span",
|
|
2547
2544
|
{
|
|
2548
|
-
className:
|
|
2549
|
-
style: { background:
|
|
2550
|
-
children:
|
|
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:
|
|
2560
|
-
!(
|
|
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:
|
|
2562
|
+
className: p.agentChip,
|
|
2566
2563
|
title: "本次新建任务归入的项目空间(可选)",
|
|
2567
|
-
onClick: () =>
|
|
2564
|
+
onClick: () => l((n) => !n),
|
|
2568
2565
|
children: [
|
|
2569
|
-
/* @__PURE__ */ e(
|
|
2570
|
-
/* @__PURE__ */ e("span", { children:
|
|
2571
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
2572
|
+
Ge && /* @__PURE__ */ i(xe, { children: [
|
|
2576
2573
|
/* @__PURE__ */ e(
|
|
2577
2574
|
"div",
|
|
2578
2575
|
{
|
|
2579
|
-
className:
|
|
2580
|
-
onClick: () =>
|
|
2576
|
+
className: p.agentMenuMask,
|
|
2577
|
+
onClick: () => l(!1)
|
|
2581
2578
|
}
|
|
2582
2579
|
),
|
|
2583
2580
|
/* @__PURE__ */ e(
|
|
2584
2581
|
ProjectSpaceMenu,
|
|
2585
2582
|
{
|
|
2586
|
-
token:
|
|
2587
|
-
currentId: (
|
|
2583
|
+
token: f,
|
|
2584
|
+
currentId: (Y == null ? void 0 : Y.id) ?? null,
|
|
2588
2585
|
onPick: (n) => {
|
|
2589
|
-
|
|
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:
|
|
2600
|
-
disabled: !
|
|
2601
|
-
onClick: () => void
|
|
2596
|
+
className: p.landingSend,
|
|
2597
|
+
disabled: !ke.trim() || me || !Ne && !(Z && Q),
|
|
2598
|
+
onClick: () => void Ve(),
|
|
2602
2599
|
"aria-label": "发送",
|
|
2603
|
-
children:
|
|
2600
|
+
children: me ? /* @__PURE__ */ e(Kn, {}) : /* @__PURE__ */ e(Un, {})
|
|
2604
2601
|
}
|
|
2605
2602
|
)
|
|
2606
2603
|
] })
|
|
2607
2604
|
] }),
|
|
2608
|
-
/* @__PURE__ */ i("div", { className:
|
|
2609
|
-
/* @__PURE__ */ i("span", { className:
|
|
2610
|
-
/* @__PURE__ */ e(
|
|
2611
|
-
/* @__PURE__ */ e("span", { children:
|
|
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:
|
|
2614
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
2613
|
+
Q.name,
|
|
2617
2614
|
"(本机)"
|
|
2618
2615
|
] })
|
|
2619
|
-
] }) : /* @__PURE__ */ i(
|
|
2620
|
-
/* @__PURE__ */ e(
|
|
2616
|
+
] }) : /* @__PURE__ */ i(xe, { children: [
|
|
2617
|
+
/* @__PURE__ */ e(Vn, {}),
|
|
2621
2618
|
/* @__PURE__ */ e("span", { children: "云端" })
|
|
2622
2619
|
] }) })
|
|
2623
2620
|
] }),
|
|
2624
|
-
/* @__PURE__ */ e("div", { className:
|
|
2621
|
+
/* @__PURE__ */ e("div", { className: p.chipRow, children: ii.map((n) => /* @__PURE__ */ i(
|
|
2625
2622
|
"button",
|
|
2626
2623
|
{
|
|
2627
2624
|
type: "button",
|
|
2628
|
-
className:
|
|
2625
|
+
className: p.capChip,
|
|
2629
2626
|
onClick: () => {
|
|
2630
2627
|
var g;
|
|
2631
2628
|
if (n.action === "tools") {
|
|
2632
|
-
|
|
2629
|
+
v("tools");
|
|
2633
2630
|
return;
|
|
2634
2631
|
}
|
|
2635
2632
|
if (n.action === "webide") {
|
|
2636
|
-
|
|
2633
|
+
v("webide");
|
|
2637
2634
|
return;
|
|
2638
2635
|
}
|
|
2639
2636
|
if (n.action === "ask") {
|
|
2640
|
-
|
|
2637
|
+
ct();
|
|
2641
2638
|
return;
|
|
2642
2639
|
}
|
|
2643
|
-
|
|
2640
|
+
ue(n.prompt ?? ""), (g = be.current) == null || g.focus();
|
|
2644
2641
|
},
|
|
2645
2642
|
children: [
|
|
2646
|
-
/* @__PURE__ */ e("span", { className:
|
|
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:
|
|
2649
|
+
/* @__PURE__ */ e("div", { className: p.chipRow, children: li.map((n) => /* @__PURE__ */ e(
|
|
2653
2650
|
"button",
|
|
2654
2651
|
{
|
|
2655
2652
|
type: "button",
|
|
2656
|
-
className:
|
|
2653
|
+
className: p.suggestChip,
|
|
2657
2654
|
onClick: () => {
|
|
2658
2655
|
var g;
|
|
2659
|
-
|
|
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:
|
|
2666
|
-
/* @__PURE__ */ i("aside", { className:
|
|
2667
|
-
/* @__PURE__ */ i("div", { className:
|
|
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
|
-
|
|
2666
|
+
Gn,
|
|
2670
2667
|
{
|
|
2671
|
-
currentUser:
|
|
2672
|
-
token:
|
|
2673
|
-
isDesktop:
|
|
2674
|
-
activeNav:
|
|
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(
|
|
2681
|
-
|
|
2677
|
+
].includes(O),
|
|
2678
|
+
activePersonalTab: O === "personalTab" ? oe : null,
|
|
2679
|
+
onDesktopNewTask: Z && Q ? it : void 0,
|
|
2682
2680
|
onPickSpace: (n) => {
|
|
2683
|
-
|
|
2681
|
+
je(n), Qe();
|
|
2684
2682
|
},
|
|
2685
|
-
currentSpaceId: (
|
|
2686
|
-
onOpenSchedule: () =>
|
|
2687
|
-
onOpenExtensions: () =>
|
|
2688
|
-
onOpenHistory: () =>
|
|
2689
|
-
onOpenSearch: () =>
|
|
2690
|
-
onOpenPersonalTab:
|
|
2691
|
-
onOpenWorkbenchShell: () =>
|
|
2692
|
-
onCloudNav:
|
|
2693
|
-
cloudNavActive:
|
|
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:
|
|
2697
|
-
|
|
2694
|
+
/* @__PURE__ */ i("div", { className: p.sideTasks, children: [
|
|
2695
|
+
Z && /* @__PURE__ */ i(
|
|
2698
2696
|
"div",
|
|
2699
2697
|
{
|
|
2700
|
-
className:
|
|
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":
|
|
2710
|
-
className: `${
|
|
2711
|
-
onClick: () =>
|
|
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":
|
|
2721
|
-
className: `${
|
|
2722
|
-
onClick: () =>
|
|
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
|
-
|
|
2730
|
-
/* @__PURE__ */ e("div", { className:
|
|
2731
|
-
|
|
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: `${
|
|
2733
|
+
className: `${p.recentItem} ${w === n.id ? p.recentItemActive : ""}`,
|
|
2736
2734
|
title: n.title,
|
|
2737
|
-
onClick: () =>
|
|
2738
|
-
children: /* @__PURE__ */ e("span", { className:
|
|
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
|
-
|
|
2743
|
-
] }) : /* @__PURE__ */ i(
|
|
2744
|
-
/* @__PURE__ */ e("div", { className:
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
const g =
|
|
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:
|
|
2751
|
+
className: p.projFolder,
|
|
2754
2752
|
"aria-expanded": g,
|
|
2755
|
-
onClick: () =>
|
|
2756
|
-
const t = new Set(
|
|
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
|
-
|
|
2759
|
+
ft,
|
|
2762
2760
|
{
|
|
2763
|
-
className: `${
|
|
2761
|
+
className: `${p.projCaret} ${g ? p.projCaretOpen : ""}`
|
|
2764
2762
|
}
|
|
2765
2763
|
),
|
|
2766
|
-
/* @__PURE__ */ e(
|
|
2767
|
-
/* @__PURE__ */ e("span", { className:
|
|
2768
|
-
/* @__PURE__ */ e("span", { className:
|
|
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:
|
|
2773
|
-
const t =
|
|
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: `${
|
|
2776
|
+
className: `${p.recentItem} ${(C == null ? void 0 : C.sessionId) === k.id ? p.recentItemActive : ""}`,
|
|
2779
2777
|
disabled: !t,
|
|
2780
|
-
title: t ?
|
|
2781
|
-
onClick: () => t &&
|
|
2782
|
-
children: /* @__PURE__ */ e("span", { className:
|
|
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
|
-
|
|
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
|
-
|
|
2791
|
+
zn,
|
|
2794
2792
|
{
|
|
2795
|
-
displayName:
|
|
2793
|
+
displayName: Xe,
|
|
2796
2794
|
subtitle: "Z-Team · 个人(专享)",
|
|
2797
|
-
onOpenSettings: () =>
|
|
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:
|
|
2801
|
+
className: p.agentMenuItem,
|
|
2804
2802
|
onClick: () => s == null ? void 0 : s(n.mode),
|
|
2805
2803
|
children: [
|
|
2806
|
-
/* @__PURE__ */ e("span", { className:
|
|
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:
|
|
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
|
-
|
|
2815
|
+
qn,
|
|
2818
2816
|
{
|
|
2819
|
-
open:
|
|
2820
|
-
onClose: () =>
|
|
2821
|
-
token:
|
|
2817
|
+
open: H,
|
|
2818
|
+
onClose: () => pe(!1),
|
|
2819
|
+
token: f
|
|
2822
2820
|
}
|
|
2823
2821
|
)
|
|
2824
2822
|
] });
|
|
2825
2823
|
}
|
|
2826
2824
|
export {
|
|
2827
|
-
|
|
2825
|
+
ki as default
|
|
2828
2826
|
};
|