agentstudio 0.3.2 → 0.3.3
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/index.d.ts.map +1 -1
- package/index.js +24 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/{AgentsPage-ChTeSZQM.js → AgentsPage-gSnkPp2k.js} +1 -1
- package/public/assets/{Button-Bd_ElvlE.js → Button-BoiVlafj.js} +1 -1
- package/public/assets/{ChatPage-4A05aP3x.js → ChatPage-BMrfVkpt.js} +4 -4
- package/public/assets/{CommandForm-C8RL-p7h.js → CommandForm-Se4iemMp.js} +1 -1
- package/public/assets/{CommandsPage-BMqBL5Ss.js → CommandsPage-B6u4IO7L.js} +1 -1
- package/public/assets/{DashboardPage-C13k8VA6.js → DashboardPage-DbCVzPKz.js} +1 -1
- package/public/assets/{FileBrowser-BbQchc_7.js → FileBrowser-DcoBWzKK.js} +1 -1
- package/public/assets/{FileExplorer-DFQ7ynXa.js → FileExplorer-B41BB0LM.js} +1 -1
- package/public/assets/{GeneralSettingsPage-D1tdeoEo.js → GeneralSettingsPage-BbEbWJUQ.js} +1 -1
- package/public/assets/{LandingPage-B4lDvIdq.js → LandingPage-DFPm2d4Y.js} +1 -1
- package/public/assets/{LoginPage-BZckHH8M.js → LoginPage-D5kZJqhk.js} +1 -1
- package/public/assets/{McpAdminSettingsPage-KVRY0MqF.js → McpAdminSettingsPage-D32iUEjH.js} +1 -1
- package/public/assets/{McpPage-DztfuUC4.js → McpPage-QT4qs391.js} +1 -1
- package/public/assets/{MemorySettingsPage-Cn-HSyWt.js → MemorySettingsPage-DYSuz-hU.js} +1 -1
- package/public/assets/{PluginsPage-BGWVTQOf.js → PluginsPage-BotzuK9f.js} +1 -1
- package/public/assets/{ProjectSelector-GmS-1-C-.js → ProjectSelector-DujNObqr.js} +1 -1
- package/public/assets/{ProjectsPage-v58WHxJc.js → ProjectsPage-CRWe6HPl.js} +1 -1
- package/public/assets/{ScheduledTasksPage-DKG8bjzx.js → ScheduledTasksPage-Beeurg-w.js} +1 -1
- package/public/assets/SettingsLayout-BfkBUyI_.js +1 -0
- package/public/assets/{SkillsPage-CZAxG8SU.js → SkillsPage-B59bAr6W.js} +1 -1
- package/public/assets/{SubagentForm-CSRBsxUE.js → SubagentForm-C0R084ja.js} +1 -1
- package/public/assets/{SubagentsPage-DW0COnVY.js → SubagentsPage-BKFNmqxg.js} +1 -1
- package/public/assets/{SystemInfoPage-ogvHiOrs.js → SystemInfoPage-D89s7PjE.js} +1 -1
- package/public/assets/{TelemetrySettingsPage-r9NhMxSu.js → TelemetrySettingsPage-Ck2btMol.js} +1 -1
- package/public/assets/{ToastTestPage-DJBKYs9_.js → ToastTestPage-B79DFhqI.js} +1 -1
- package/public/assets/{ToolsList-Ci2lqPin.js → ToolsList-Kfxwp80g.js} +1 -1
- package/public/assets/{UnifiedToolSelector-CKjY_qjS.js → UnifiedToolSelector-CkafUbz3.js} +1 -1
- package/public/assets/{VersionSettingsPage-DTIgBhQ_.js → VersionSettingsPage-CaB4PH6h.js} +1 -1
- package/public/assets/{WebSocketTunnelPage-C3mRJxS2.js → WebSocketTunnelPage-Cbru_-hL.js} +1 -1
- package/public/assets/{_basePickBy-BTSO2Pkt.js → _basePickBy-5fAM04Ra.js} +1 -1
- package/public/assets/{_baseUniq-D89fR3NG.js → _baseUniq-COj5YnAO.js} +1 -1
- package/public/assets/{agents-DG431Wop.js → agents-3mB536QF.js} +1 -1
- package/public/assets/{arc-XgUOTLxV.js → arc-C2gTU2ZR.js} +1 -1
- package/public/assets/{architectureDiagram-VXUJARFQ-DrSsIdf2.js → architectureDiagram-VXUJARFQ-DD1BwT1T.js} +1 -1
- package/public/assets/{blockDiagram-VD42YOAC-DnsJI7gJ.js → blockDiagram-VD42YOAC-DFKUIZc6.js} +1 -1
- package/public/assets/{c4Diagram-YG6GDRKO-Dcw9Cs9G.js → c4Diagram-YG6GDRKO-B0VVIIvh.js} +1 -1
- package/public/assets/channel-DcVTcy-S.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-CuAIZ2Cr.js → chunk-4BX2VUAB-DM8J7YO9.js} +1 -1
- package/public/assets/{chunk-55IACEB6-CO5u6wMx.js → chunk-55IACEB6-BjhdmGlM.js} +1 -1
- package/public/assets/{chunk-B4BG7PRW-C4JF4UyZ.js → chunk-B4BG7PRW-1RJ6n2xv.js} +1 -1
- package/public/assets/{chunk-DI55MBZ5-bfTEspLo.js → chunk-DI55MBZ5-1-EHSO67.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-BN14QGw5.js → chunk-FMBD7UC4-DV3SMJK_.js} +1 -1
- package/public/assets/{chunk-QN33PNHL-xWN6BqD9.js → chunk-QN33PNHL-IlsCTdDq.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-5-grYB4H.js → chunk-QZHKN3VN-DJXs-Fqo.js} +1 -1
- package/public/assets/{chunk-TZMSLE5B-C2vW6017.js → chunk-TZMSLE5B-BxHO9wa1.js} +1 -1
- package/public/assets/classDiagram-2ON5EDUG-BXVT6Q7h.js +1 -0
- package/public/assets/classDiagram-v2-WZHVMYZB-BXVT6Q7h.js +1 -0
- package/public/assets/clone-Bp6orjIq.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-D4tCdQ5W.js → cose-bilkent-S5V4N54A-BVJXoW_K.js} +1 -1
- package/public/assets/{dagre-6UL2VRFP-BGaPpMOL.js → dagre-6UL2VRFP-DHDnVshA.js} +1 -1
- package/public/assets/{data-structures-C0h9Oap1.js → data-structures-ChC1tqVg.js} +1 -1
- package/public/assets/{diagram-PSM6KHXK-B5MJHcOR.js → diagram-PSM6KHXK-40qGxDeg.js} +1 -1
- package/public/assets/{diagram-QEK2KX5R-W49QXse-.js → diagram-QEK2KX5R-BfMGeeRo.js} +1 -1
- package/public/assets/{diagram-S2PKOQOG-J_VMf6C2.js → diagram-S2PKOQOG-D7AX72a5.js} +1 -1
- package/public/assets/{erDiagram-Q2GNP2WA-CgK8jP0L.js → erDiagram-Q2GNP2WA-BHsgeBpL.js} +1 -1
- package/public/assets/{flowDiagram-NV44I4VS-CXavqXYu.js → flowDiagram-NV44I4VS-BYqChOSE.js} +1 -1
- package/public/assets/{ganttDiagram-LVOFAZNH-DdA4uXow.js → ganttDiagram-LVOFAZNH-CZFFSLKX.js} +1 -1
- package/public/assets/{gitGraphDiagram-NY62KEGX-BHeHA2_6.js → gitGraphDiagram-NY62KEGX-C5Bgrf0J.js} +1 -1
- package/public/assets/{graph-CkRZhtax.js → graph-BP5lFRBg.js} +1 -1
- package/public/assets/{index-UPEozv-J.js → index-BEPv9Bqe.js} +5 -5
- package/public/assets/infoDiagram-F6ZHWCRC-C6OApgqf.js +2 -0
- package/public/assets/{journeyDiagram-XKPGCS4Q-CAfRMHa8.js → journeyDiagram-XKPGCS4Q--abC1RHz.js} +1 -1
- package/public/assets/{kanban-definition-3W4ZIXB7-DW5IlHJE.js → kanban-definition-3W4ZIXB7-BJeChfWu.js} +1 -1
- package/public/assets/{layout-nYP7m9RV.js → layout-DjAix4WK.js} +1 -1
- package/public/assets/{linear--koZbfLt.js → linear-Cw0z8VNY.js} +1 -1
- package/public/assets/{mindmap-definition-VGOIOE7T-BIt3RkSU.js → mindmap-definition-VGOIOE7T-U_T9xIUk.js} +1 -1
- package/public/assets/{monaco-editor-DHKm5-VF.js → monaco-editor-BWfQfpij.js} +1 -1
- package/public/assets/{pieDiagram-ADFJNKIX-Dgv5DD0S.js → pieDiagram-ADFJNKIX-B0mT9OgH.js} +1 -1
- package/public/assets/{quadrantDiagram-AYHSOK5B-BDAI4LQZ.js → quadrantDiagram-AYHSOK5B-BWdlgO0u.js} +1 -1
- package/public/assets/{requirementDiagram-UZGBJVZJ-BtlBBsGB.js → requirementDiagram-UZGBJVZJ-B-8LxsGB.js} +1 -1
- package/public/assets/{sankeyDiagram-TZEHDZUN-C5CTA-m2.js → sankeyDiagram-TZEHDZUN-OXuxkgGA.js} +1 -1
- package/public/assets/{sequenceDiagram-WL72ISMW-Zxi4nOIv.js → sequenceDiagram-WL72ISMW-Bt5twlzi.js} +1 -1
- package/public/assets/{stateDiagram-FKZM4ZOC-XoPlf0Vy.js → stateDiagram-FKZM4ZOC-Dmph7TeW.js} +1 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-DyE8O3Kx.js +1 -0
- package/public/assets/{syntax-highlighting-CnREyncB.js → syntax-highlighting-DGbNjS3S.js} +1 -1
- package/public/assets/{table-BWrnBcPF.js → table-DjMdAdjH.js} +1 -1
- package/public/assets/{timeline-definition-IT6M3QCI-UHDY1Jjf.js → timeline-definition-IT6M3QCI-CcV8nyIH.js} +1 -1
- package/public/assets/{tools-C0JOzoE_.js → tools-BAI9XHGS.js} +1 -1
- package/public/assets/{treemap-KMMF4GRG-CBW5iWMJ.js → treemap-KMMF4GRG-DBuwkj4f.js} +1 -1
- package/public/assets/{ui-components-CRCmgMKc.js → ui-components-DaGtjl0g.js} +1 -1
- package/public/assets/{useAgents-Bp5Ry-Dk.js → useAgents-D5EDAc_E.js} +1 -1
- package/public/assets/{useClaudeVersions-DYM2HCGW.js → useClaudeVersions-Cy71v4HE.js} +1 -1
- package/public/assets/{useCommands-B0s3JzZs.js → useCommands-BgoCfyuu.js} +1 -1
- package/public/assets/{useProjects-DuCnMeYt.js → useProjects-XgfgISgV.js} +1 -1
- package/public/assets/{useSessions-EknKfdIv.js → useSessions-CQgq4d84.js} +1 -1
- package/public/assets/{xychartDiagram-PRI3JC2R-C2ylYAJK.js → xychartDiagram-PRI3JC2R-Bo9K-U2S.js} +1 -1
- package/public/index.html +7 -7
- package/routes/mcp.js +37 -7
- package/routes/mcp.js.map +1 -1
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.d.ts +8 -0
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.d.ts.map +1 -0
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.js +86 -0
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.js.map +1 -0
- package/utils/__tests__/claudeUtils.test.js +83 -0
- package/utils/__tests__/claudeUtils.test.js.map +1 -1
- package/utils/claudeUtils.d.ts.map +1 -1
- package/utils/claudeUtils.js +36 -6
- package/utils/claudeUtils.js.map +1 -1
- package/public/assets/SettingsLayout-_m4X7JF9.js +0 -1
- package/public/assets/channel-CUQXq8tY.js +0 -1
- package/public/assets/classDiagram-2ON5EDUG-Ivmc_BXS.js +0 -1
- package/public/assets/classDiagram-v2-WZHVMYZB-Ivmc_BXS.js +0 -1
- package/public/assets/clone-DTBJjony.js +0 -1
- package/public/assets/infoDiagram-F6ZHWCRC-Cefi13nY.js +0 -2
- package/public/assets/stateDiagram-v2-4FDKWEC3-r4Duovdx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./data-structures-C0h9Oap1.js";import{r as d}from"./monaco-editor-DHKm5-VF.js";import{u as B}from"./useProjects-DuCnMeYt.js";import{u as O,a as Q}from"./useAgents-Bp5Ry-Dk.js";import{u as _,c as W,a as X}from"./useSessions-EknKfdIv.js";import{u as G}from"./agents-DG431Wop.js";import{u as J,s as x,a as P}from"./index-UPEozv-J.js";import{u as Y}from"./tools-C0JOzoE_.js";import{p as Z,h as ee,e as ae,o as se,q as re,S as te,f as le,r as de,s as oe,t as ne,u as h,L as b,v as ie,k as ce,w as ue,x as ge,y as me,j as xe,X as he}from"./ui-components-CRCmgMKc.js";import"./syntax-highlighting-CnREyncB.js";const Ve=()=>{const{t:s}=Y("pages"),A=J(),I=G(),{data:$,isLoading:F}=B(),{data:D}=O(!0),{data:M,refetch:p}=_(),T=Q(),[i,f]=d.useState(""),[t,u]=d.useState(null),[j,g]=d.useState(!1),[y,k]=d.useState(!1),[w,v]=d.useState(!1),[N,C]=d.useState(null),o=$?.projects||[],n=D?.agents||[],c=M?.sessions||[];d.useEffect(()=>{o.length>0&&!t&&u(o[0])},[o,t]);const m=a=>{if(!a)return n[0];if(a.defaultAgent){const r=n.find(l=>l.id===a.defaultAgent);if(r)return r}return n[0]},q=async()=>{const a=n.find(r=>r.id==="claude-code")||n[0];if(a){k(!0);try{const r="default-workspace",l=await T.mutateAsync({agentId:a.id,projectName:r});await I.invalidateQueries({queryKey:["projects"]}),u(l.project),x(s("dashboard.projectCreated.title",{defaultValue:"项目创建成功"}),s("dashboard.projectCreated.message",{defaultValue:"已经为您创建项目:{{name}},你现在可以开始与 Agent 工作了。",name:r}))}catch(r){console.error("Failed to create default project:",r)}finally{k(!1)}}},V=()=>{const a=m(t);if(!i.trim()||!t||!a)return;const r=encodeURIComponent(i),l=`/chat/${a.id}?project=${encodeURIComponent(t.path)}&message=${r}`;window.open(l,"_blank")},E=async a=>{C(a);try{await X(a),await p(),x(s("dashboard.sessions.closed",{defaultValue:"会话已关闭"}),s("dashboard.sessions.closedMessage",{defaultValue:"会话已成功关闭"}))}catch(r){console.error("Failed to close session:",r),P(s("dashboard.sessions.closeFailed",{defaultValue:"关闭失败"}),r instanceof Error?r.message:s("dashboard.sessions.closeError",{defaultValue:"无法关闭会话"}))}finally{C(null)}},L=async()=>{if(c.length!==0){v(!0);try{const a=await W();await p(),x(s("dashboard.sessions.allCleared",{defaultValue:"全部清除"}),s("dashboard.sessions.allClearedMessage",{defaultValue:"已清除 {{count}} 个会话",count:a.clearedCount}))}catch(a){console.error("Failed to clear all sessions:",a),P(s("dashboard.sessions.clearFailed",{defaultValue:"清除失败"}),a instanceof Error?a.message:s("dashboard.sessions.clearError",{defaultValue:"无法清除会话"}))}finally{v(!1)}}},R=[{icon:Z,label:s("dashboard.templates.organizeFiles",{defaultValue:"整理文件"}),prompt:"帮我整理一下当前目录下的文件。请先分析目录结构,然后提出整理方案让我确认,最后再执行。"},{icon:ee,label:s("dashboard.templates.analyzeFiles",{defaultValue:"文件分析"}),prompt:"帮我分析一下当前项目的文件结构和代码情况,给出概要报告。"},{icon:ae,label:s("dashboard.templates.writeDoc",{defaultValue:"写一份文档"}),prompt:"帮我为这个项目写一份 README 文档,包含项目介绍、安装步骤和使用说明。"},{icon:se,label:s("dashboard.templates.codeReview",{defaultValue:"代码审查"}),prompt:"帮我审查一下这个项目的代码质量,包括代码风格、潜在问题和改进建议。"},{icon:re,label:s("dashboard.templates.checkWeather",{defaultValue:"查深圳天气"}),prompt:"查一下深圳现在的天气情况。"},{icon:te,label:s("dashboard.templates.quickTask",{defaultValue:"自由提问"}),prompt:""}],z=[{icon:le,label:s("dashboard.quickLinks.projects",{defaultValue:"项目管理"}),path:"/projects",color:"text-blue-500 bg-blue-50 dark:bg-blue-900/30"},{icon:de,label:s("dashboard.quickLinks.modelSettings",{defaultValue:"模型供应商"}),path:"/settings/suppliers",color:"text-purple-500 bg-purple-50 dark:bg-purple-900/30"},{icon:oe,label:s("dashboard.quickLinks.scheduledTasks",{defaultValue:"定时任务"}),path:"/scheduled-tasks",color:"text-green-500 bg-green-50 dark:bg-green-900/30"},{icon:ne,label:s("dashboard.quickLinks.customAgents",{defaultValue:"自定义 Agent"}),path:"/agents",color:"text-orange-500 bg-orange-50 dark:bg-orange-900/30"}],U=a=>{if(a){const r=m(t);if(t&&r){const l=encodeURIComponent(a),S=`/chat/${r.id}?project=${encodeURIComponent(t.path)}&message=${l}`;window.open(S,"_blank")}else f(a)}},H=!F&&o.length===0,K=a=>{const r=Math.floor(a/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60);return l<60?`${l}m`:`${Math.floor(l/60)}h`};return e.jsx("div",{className:"h-full flex flex-col bg-gray-50 dark:bg-gray-900 overflow-auto",children:e.jsxs("div",{className:"flex-1 flex flex-col items-center px-6 py-8",children:[e.jsx("div",{className:"text-center mb-8",children:e.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white",children:s("dashboard.welcome.title",{defaultValue:"让我们开始工作吧"})})}),e.jsxs("div",{className:"w-full max-w-2xl",children:[H&&e.jsxs("div",{className:"mb-6 p-6 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-2xl text-center",children:[e.jsx(h,{className:"w-12 h-12 text-amber-500 mx-auto mb-3"}),e.jsx("h3",{className:"text-lg font-medium text-amber-800 dark:text-amber-200 mb-2",children:s("dashboard.noProjectsHint.title",{defaultValue:"还没有项目"})}),e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-300 mb-4",children:s("dashboard.noProjectsHint.description",{defaultValue:"创建一个项目来开始与 AI 协作"})}),e.jsx("button",{onClick:q,disabled:y||n.length===0,className:"inline-flex items-center gap-2 px-5 py-2.5 bg-amber-600 hover:bg-amber-700 disabled:bg-amber-400 text-white rounded-xl font-medium transition-colors",children:y?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:s("dashboard.noProjectsHint.creating",{defaultValue:"创建中..."})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4"}),e.jsx("span",{children:s("dashboard.noProjectsHint.createButton",{defaultValue:"一键创建默认项目"})})]})})]}),e.jsx("div",{className:"mb-6 grid grid-cols-2 md:grid-cols-3 gap-3",children:R.map((a,r)=>e.jsxs("button",{onClick:()=>U(a.prompt),className:"flex items-center gap-3 px-4 py-3.5 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-600/50 hover:border-gray-300 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700 hover:shadow-md text-left transition-all group",children:[e.jsx("div",{className:"flex-shrink-0 p-2 bg-gray-100 dark:bg-gray-700 rounded-lg",children:e.jsx(a.icon,{className:"w-5 h-5 text-gray-500 dark:text-gray-300"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 group-hover:text-gray-900 dark:group-hover:text-white transition-colors",children:a.label})]},r))}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-700",children:[e.jsx("textarea",{value:i,onChange:a=>f(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),V())},placeholder:s("dashboard.inputPlaceholder",{defaultValue:"描述你想要完成的任务..."}),className:"w-full px-5 py-4 text-base bg-transparent border-none outline-none resize-none text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500",rows:3}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>g(!j),className:"flex items-center gap-2 px-3 py-1.5 bg-gray-50 dark:bg-gray-700/50 rounded-lg border border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500 transition-colors",children:[e.jsx(h,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-[150px] truncate",children:t?.name||s("dashboard.selectProject",{defaultValue:"选择项目"})}),e.jsx(ce,{className:"w-3.5 h-3.5 text-gray-400"})]}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),e.jsxs("div",{className:"absolute left-0 top-full mt-2 w-72 bg-white dark:bg-gray-800 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700 z-20 max-h-64 overflow-y-auto",children:[o.map(a=>e.jsxs("button",{onClick:()=>{u(a),g(!1)},className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 flex items-center gap-3 first:rounded-t-xl last:rounded-b-xl ${t?.id===a.id?"bg-blue-50 dark:bg-blue-900/20":""}`,children:[e.jsx(h,{className:`w-4 h-4 flex-shrink-0 ${t?.id===a.id?"text-blue-500":"text-gray-400"}`}),e.jsx("span",{className:`text-sm truncate ${t?.id===a.id?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-300"}`,children:a.name})]},a.id)),o.length===0&&e.jsx("div",{className:"px-4 py-6 text-center text-gray-500 text-sm",children:s("dashboard.noProjects",{defaultValue:"暂无项目"})})]})]})]}),e.jsxs("button",{onClick:V,disabled:!i.trim()||!t||!m(t),className:"flex items-center gap-2 px-5 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 dark:disabled:bg-gray-600 text-white rounded-xl font-medium transition-colors disabled:cursor-not-allowed",children:[e.jsx("span",{children:s("dashboard.startChat",{defaultValue:"开始对话"})}),e.jsx(ue,{className:"w-4 h-4"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-3 text-sm text-gray-400 dark:text-gray-500",children:[e.jsx(ge,{className:"w-4 h-4 animate-bounce"}),e.jsx("span",{children:s("dashboard.welcome.subtitle",{defaultValue:"选择一个项目,开始与 AI 协作完成任务"})})]})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-4 text-center",children:s("dashboard.quickLinks.title",{defaultValue:"快捷入口"})}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:z.map((a,r)=>e.jsxs("button",{onClick:()=>A(a.path),className:"flex flex-col items-center gap-2 p-4 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 hover:shadow-md transition-all group",children:[e.jsx("div",{className:`p-2.5 rounded-lg ${a.color}`,children:e.jsx(a.icon,{className:"w-5 h-5"})}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white transition-colors",children:a.label})]},r))})]}),c.length>0&&e.jsxs("div",{className:"mt-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:[s("dashboard.sessions.title",{defaultValue:"活跃会话"})," (",c.length,")"]}),e.jsxs("button",{onClick:L,disabled:w,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",children:[w?e.jsx(b,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(me,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:s("dashboard.sessions.clearAll",{defaultValue:"清除全部"})})]})]}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 divide-y divide-gray-100 dark:divide-gray-700 max-h-64 overflow-y-auto",children:c.map(a=>{const r=a.projectPath?a.projectPath.split("/").pop()||a.projectPath:"-",l=a.sessionTitle||`${s("dashboard.sessions.session",{defaultValue:"会话"})} ${a.sessionId.slice(0,8)}`;return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.status==="confirmed"?"bg-green-500":"bg-amber-500"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 truncate font-medium",children:l}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400 mt-0.5",children:[e.jsx("span",{className:"truncate max-w-[120px]",title:r,children:r}),e.jsx("span",{children:"•"}),e.jsx("span",{children:a.agentId}),a.modelId&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",children:a.modelId.replace("claude-","").replace(/-\d{8}$/,"")})]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:K(a.idleTimeMs)}),a.heartbeatTimedOut&&e.jsx("span",{className:"text-amber-500 flex items-center gap-1",children:e.jsx(xe,{className:"w-3 h-3"})})]})]})]}),e.jsx("button",{onClick:()=>E(a.sessionId),disabled:N===a.sessionId,className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",title:s("dashboard.sessions.close",{defaultValue:"关闭会话"}),children:N===a.sessionId?e.jsx(b,{className:"w-4 h-4 animate-spin"}):e.jsx(he,{className:"w-4 h-4"})})]},a.sessionId)})})]})]})]})})};export{Ve as DashboardPage};
|
|
1
|
+
import{j as e}from"./data-structures-ChC1tqVg.js";import{r as d}from"./monaco-editor-BWfQfpij.js";import{u as B}from"./useProjects-XgfgISgV.js";import{u as O,a as Q}from"./useAgents-D5EDAc_E.js";import{u as _,c as W,a as X}from"./useSessions-CQgq4d84.js";import{u as G}from"./agents-3mB536QF.js";import{u as J,s as x,a as P}from"./index-BEPv9Bqe.js";import{u as Y}from"./tools-BAI9XHGS.js";import{p as Z,h as ee,e as ae,o as se,q as re,S as te,f as le,r as de,s as oe,t as ne,u as h,L as b,v as ie,k as ce,w as ue,x as ge,y as me,j as xe,X as he}from"./ui-components-DaGtjl0g.js";import"./syntax-highlighting-DGbNjS3S.js";const Ve=()=>{const{t:s}=Y("pages"),A=J(),I=G(),{data:$,isLoading:F}=B(),{data:D}=O(!0),{data:M,refetch:p}=_(),T=Q(),[i,f]=d.useState(""),[t,u]=d.useState(null),[j,g]=d.useState(!1),[y,k]=d.useState(!1),[w,v]=d.useState(!1),[N,C]=d.useState(null),o=$?.projects||[],n=D?.agents||[],c=M?.sessions||[];d.useEffect(()=>{o.length>0&&!t&&u(o[0])},[o,t]);const m=a=>{if(!a)return n[0];if(a.defaultAgent){const r=n.find(l=>l.id===a.defaultAgent);if(r)return r}return n[0]},q=async()=>{const a=n.find(r=>r.id==="claude-code")||n[0];if(a){k(!0);try{const r="default-workspace",l=await T.mutateAsync({agentId:a.id,projectName:r});await I.invalidateQueries({queryKey:["projects"]}),u(l.project),x(s("dashboard.projectCreated.title",{defaultValue:"项目创建成功"}),s("dashboard.projectCreated.message",{defaultValue:"已经为您创建项目:{{name}},你现在可以开始与 Agent 工作了。",name:r}))}catch(r){console.error("Failed to create default project:",r)}finally{k(!1)}}},V=()=>{const a=m(t);if(!i.trim()||!t||!a)return;const r=encodeURIComponent(i),l=`/chat/${a.id}?project=${encodeURIComponent(t.path)}&message=${r}`;window.open(l,"_blank")},E=async a=>{C(a);try{await X(a),await p(),x(s("dashboard.sessions.closed",{defaultValue:"会话已关闭"}),s("dashboard.sessions.closedMessage",{defaultValue:"会话已成功关闭"}))}catch(r){console.error("Failed to close session:",r),P(s("dashboard.sessions.closeFailed",{defaultValue:"关闭失败"}),r instanceof Error?r.message:s("dashboard.sessions.closeError",{defaultValue:"无法关闭会话"}))}finally{C(null)}},L=async()=>{if(c.length!==0){v(!0);try{const a=await W();await p(),x(s("dashboard.sessions.allCleared",{defaultValue:"全部清除"}),s("dashboard.sessions.allClearedMessage",{defaultValue:"已清除 {{count}} 个会话",count:a.clearedCount}))}catch(a){console.error("Failed to clear all sessions:",a),P(s("dashboard.sessions.clearFailed",{defaultValue:"清除失败"}),a instanceof Error?a.message:s("dashboard.sessions.clearError",{defaultValue:"无法清除会话"}))}finally{v(!1)}}},R=[{icon:Z,label:s("dashboard.templates.organizeFiles",{defaultValue:"整理文件"}),prompt:"帮我整理一下当前目录下的文件。请先分析目录结构,然后提出整理方案让我确认,最后再执行。"},{icon:ee,label:s("dashboard.templates.analyzeFiles",{defaultValue:"文件分析"}),prompt:"帮我分析一下当前项目的文件结构和代码情况,给出概要报告。"},{icon:ae,label:s("dashboard.templates.writeDoc",{defaultValue:"写一份文档"}),prompt:"帮我为这个项目写一份 README 文档,包含项目介绍、安装步骤和使用说明。"},{icon:se,label:s("dashboard.templates.codeReview",{defaultValue:"代码审查"}),prompt:"帮我审查一下这个项目的代码质量,包括代码风格、潜在问题和改进建议。"},{icon:re,label:s("dashboard.templates.checkWeather",{defaultValue:"查深圳天气"}),prompt:"查一下深圳现在的天气情况。"},{icon:te,label:s("dashboard.templates.quickTask",{defaultValue:"自由提问"}),prompt:""}],z=[{icon:le,label:s("dashboard.quickLinks.projects",{defaultValue:"项目管理"}),path:"/projects",color:"text-blue-500 bg-blue-50 dark:bg-blue-900/30"},{icon:de,label:s("dashboard.quickLinks.modelSettings",{defaultValue:"模型供应商"}),path:"/settings/suppliers",color:"text-purple-500 bg-purple-50 dark:bg-purple-900/30"},{icon:oe,label:s("dashboard.quickLinks.scheduledTasks",{defaultValue:"定时任务"}),path:"/scheduled-tasks",color:"text-green-500 bg-green-50 dark:bg-green-900/30"},{icon:ne,label:s("dashboard.quickLinks.customAgents",{defaultValue:"自定义 Agent"}),path:"/agents",color:"text-orange-500 bg-orange-50 dark:bg-orange-900/30"}],U=a=>{if(a){const r=m(t);if(t&&r){const l=encodeURIComponent(a),S=`/chat/${r.id}?project=${encodeURIComponent(t.path)}&message=${l}`;window.open(S,"_blank")}else f(a)}},H=!F&&o.length===0,K=a=>{const r=Math.floor(a/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60);return l<60?`${l}m`:`${Math.floor(l/60)}h`};return e.jsx("div",{className:"h-full flex flex-col bg-gray-50 dark:bg-gray-900 overflow-auto",children:e.jsxs("div",{className:"flex-1 flex flex-col items-center px-6 py-8",children:[e.jsx("div",{className:"text-center mb-8",children:e.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white",children:s("dashboard.welcome.title",{defaultValue:"让我们开始工作吧"})})}),e.jsxs("div",{className:"w-full max-w-2xl",children:[H&&e.jsxs("div",{className:"mb-6 p-6 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-2xl text-center",children:[e.jsx(h,{className:"w-12 h-12 text-amber-500 mx-auto mb-3"}),e.jsx("h3",{className:"text-lg font-medium text-amber-800 dark:text-amber-200 mb-2",children:s("dashboard.noProjectsHint.title",{defaultValue:"还没有项目"})}),e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-300 mb-4",children:s("dashboard.noProjectsHint.description",{defaultValue:"创建一个项目来开始与 AI 协作"})}),e.jsx("button",{onClick:q,disabled:y||n.length===0,className:"inline-flex items-center gap-2 px-5 py-2.5 bg-amber-600 hover:bg-amber-700 disabled:bg-amber-400 text-white rounded-xl font-medium transition-colors",children:y?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{children:s("dashboard.noProjectsHint.creating",{defaultValue:"创建中..."})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4"}),e.jsx("span",{children:s("dashboard.noProjectsHint.createButton",{defaultValue:"一键创建默认项目"})})]})})]}),e.jsx("div",{className:"mb-6 grid grid-cols-2 md:grid-cols-3 gap-3",children:R.map((a,r)=>e.jsxs("button",{onClick:()=>U(a.prompt),className:"flex items-center gap-3 px-4 py-3.5 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-600/50 hover:border-gray-300 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700 hover:shadow-md text-left transition-all group",children:[e.jsx("div",{className:"flex-shrink-0 p-2 bg-gray-100 dark:bg-gray-700 rounded-lg",children:e.jsx(a.icon,{className:"w-5 h-5 text-gray-500 dark:text-gray-300"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 group-hover:text-gray-900 dark:group-hover:text-white transition-colors",children:a.label})]},r))}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-700",children:[e.jsx("textarea",{value:i,onChange:a=>f(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),V())},placeholder:s("dashboard.inputPlaceholder",{defaultValue:"描述你想要完成的任务..."}),className:"w-full px-5 py-4 text-base bg-transparent border-none outline-none resize-none text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500",rows:3}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>g(!j),className:"flex items-center gap-2 px-3 py-1.5 bg-gray-50 dark:bg-gray-700/50 rounded-lg border border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500 transition-colors",children:[e.jsx(h,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-[150px] truncate",children:t?.name||s("dashboard.selectProject",{defaultValue:"选择项目"})}),e.jsx(ce,{className:"w-3.5 h-3.5 text-gray-400"})]}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),e.jsxs("div",{className:"absolute left-0 top-full mt-2 w-72 bg-white dark:bg-gray-800 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700 z-20 max-h-64 overflow-y-auto",children:[o.map(a=>e.jsxs("button",{onClick:()=>{u(a),g(!1)},className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 flex items-center gap-3 first:rounded-t-xl last:rounded-b-xl ${t?.id===a.id?"bg-blue-50 dark:bg-blue-900/20":""}`,children:[e.jsx(h,{className:`w-4 h-4 flex-shrink-0 ${t?.id===a.id?"text-blue-500":"text-gray-400"}`}),e.jsx("span",{className:`text-sm truncate ${t?.id===a.id?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-300"}`,children:a.name})]},a.id)),o.length===0&&e.jsx("div",{className:"px-4 py-6 text-center text-gray-500 text-sm",children:s("dashboard.noProjects",{defaultValue:"暂无项目"})})]})]})]}),e.jsxs("button",{onClick:V,disabled:!i.trim()||!t||!m(t),className:"flex items-center gap-2 px-5 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 dark:disabled:bg-gray-600 text-white rounded-xl font-medium transition-colors disabled:cursor-not-allowed",children:[e.jsx("span",{children:s("dashboard.startChat",{defaultValue:"开始对话"})}),e.jsx(ue,{className:"w-4 h-4"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-3 text-sm text-gray-400 dark:text-gray-500",children:[e.jsx(ge,{className:"w-4 h-4 animate-bounce"}),e.jsx("span",{children:s("dashboard.welcome.subtitle",{defaultValue:"选择一个项目,开始与 AI 协作完成任务"})})]})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-4 text-center",children:s("dashboard.quickLinks.title",{defaultValue:"快捷入口"})}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:z.map((a,r)=>e.jsxs("button",{onClick:()=>A(a.path),className:"flex flex-col items-center gap-2 p-4 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 hover:shadow-md transition-all group",children:[e.jsx("div",{className:`p-2.5 rounded-lg ${a.color}`,children:e.jsx(a.icon,{className:"w-5 h-5"})}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white transition-colors",children:a.label})]},r))})]}),c.length>0&&e.jsxs("div",{className:"mt-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:[s("dashboard.sessions.title",{defaultValue:"活跃会话"})," (",c.length,")"]}),e.jsxs("button",{onClick:L,disabled:w,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",children:[w?e.jsx(b,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(me,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:s("dashboard.sessions.clearAll",{defaultValue:"清除全部"})})]})]}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 divide-y divide-gray-100 dark:divide-gray-700 max-h-64 overflow-y-auto",children:c.map(a=>{const r=a.projectPath?a.projectPath.split("/").pop()||a.projectPath:"-",l=a.sessionTitle||`${s("dashboard.sessions.session",{defaultValue:"会话"})} ${a.sessionId.slice(0,8)}`;return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.status==="confirmed"?"bg-green-500":"bg-amber-500"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 truncate font-medium",children:l}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400 mt-0.5",children:[e.jsx("span",{className:"truncate max-w-[120px]",title:r,children:r}),e.jsx("span",{children:"•"}),e.jsx("span",{children:a.agentId}),a.modelId&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",children:a.modelId.replace("claude-","").replace(/-\d{8}$/,"")})]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:K(a.idleTimeMs)}),a.heartbeatTimedOut&&e.jsx("span",{className:"text-amber-500 flex items-center gap-1",children:e.jsx(xe,{className:"w-3 h-3"})})]})]})]}),e.jsx("button",{onClick:()=>E(a.sessionId),disabled:N===a.sessionId,className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",title:s("dashboard.sessions.close",{defaultValue:"关闭会话"}),children:N===a.sessionId?e.jsx(b,{className:"w-4 h-4 animate-spin"}):e.jsx(he,{className:"w-4 h-4"})})]},a.sessionId)})})]})]})]})})};export{Ve as DashboardPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./data-structures-
|
|
1
|
+
import{j as e}from"./data-structures-ChC1tqVg.js";import{r as o}from"./monaco-editor-BWfQfpij.js";import{a as K,A as W}from"./agents-3mB536QF.js";import{a as de}from"./index-BEPv9Bqe.js";import{u as ee}from"./tools-BAI9XHGS.js";import{X as T,aq as te,ar as X,g as Y,as as _,l as q,at as ae,au as Z,Y as ce,I as xe,H as ge,k as he,av as ye,x as me,ag as be,a8 as ue,E as pe,u as re,e as fe,aw as we}from"./ui-components-DaGtjl0g.js";const ve=({filePath:F,onClose:h})=>{const{t}=ee("components"),[p,A]=o.useState([]),[N,U]=o.useState(!0),[M,s]=o.useState(null),[d,V]=o.useState(""),[i,b]=o.useState(1),[P,$]=o.useState(!1),[v]=o.useState(50),[O,H]=o.useState(""),z=c=>{const n=c.split(`
|
|
2
2
|
`).filter(x=>x.trim()),g=[];for(const x of n){const u=[];let S="",D=!1;for(let L=0;L<x.length;L++){const R=x[L];R==='"'?D&&x[L+1]==='"'?(S+='"',L++):D=!D:R===","&&!D?(u.push(S.trim()),S=""):S+=R}u.push(S.trim()),g.push(u)}return g};o.useEffect(()=>{(async()=>{try{U(!0),s(null);const n=F.split(/[/\\]/).pop()||"unknown.csv";H(n);const g=await K(`${W}/files/read?path=${encodeURIComponent(F)}`);if(!g.ok)throw new Error(t("csvPreview.errors.loadFailed"));const x=await g.json(),u=z(x.content);A(u)}catch(n){console.error("Failed to load CSV:",n),s(n instanceof Error?n.message:t("csvPreview.errors.unknownError"))}finally{U(!1)}})()},[F,t]);const j=o.useMemo(()=>{if(!d)return p;const c=d.toLowerCase();return p.filter(n=>n.some(g=>g.toLowerCase().includes(c)))},[p,d]),y=Math.ceil(j.length/v),f=(i-1)*v,C=f+v,m=j.slice(f,C);o.useEffect(()=>{b(1)},[d]),o.useEffect(()=>{const c=n=>{n.key==="Escape"?h():n.key==="ArrowLeft"&&i>1?b(i-1):n.key==="ArrowRight"&&i<y?b(i+1):n.ctrlKey&&n.key==="f"&&(n.preventDefault(),document.getElementById("csv-search")?.focus())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[h,i,y]);const k=()=>{const c=p.map(x=>x.map(u=>u.includes(",")||u.includes('"')||u.includes(`
|
|
3
3
|
`)?`"${u.replace(/"/g,'""')}"`:u).join(",")).join(`
|
|
4
4
|
`),n=new Blob([c],{type:"text/csv;charset=utf-8;"}),g=document.createElement("a");g.href=URL.createObjectURL(n),g.download=O,g.click(),URL.revokeObjectURL(g.href)};if(N)return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 flex items-center space-x-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:t("csvPreview.loading")})]})});if(M)return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:t("csvPreview.errors.title")}),e.jsx("button",{onClick:h,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(T,{className:"w-5 h-5"})})]}),e.jsx("p",{className:"text-red-600 dark:text-red-400",children:M}),e.jsx("button",{onClick:h,className:"mt-4 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:t("csvPreview.actions.close")})]})});const I=P?"fixed inset-4 bg-white dark:bg-gray-900 flex flex-col z-50":"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50";return e.jsx("div",{className:I,children:P?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:O}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t("csvPreview.info.rowCount",{count:j.length}),d&&` (${t("csvPreview.info.filtered")})`]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>$(!1),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors",title:t("csvPreview.actions.minimize"),children:e.jsx(te,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsx("button",{onClick:k,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors",title:t("csvPreview.actions.download"),children:e.jsx(X,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors",title:t("csvPreview.actions.close"),children:e.jsx(T,{className:"w-5 h-5 text-gray-600 dark:text-gray-400"})})]})]}),e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"relative",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{id:"csv-search",type:"text",value:d,onChange:c=>V(c.target.value),placeholder:t("csvPreview.search.placeholder"),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:bg-gray-800 dark:text-white dark:placeholder-gray-400"})]})}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:m.length>0?e.jsx("div",{className:"min-w-full",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 sticky top-0",children:e.jsx("tr",{children:m[0]?.map((c,n)=>e.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700",children:c||t("csvPreview.table.untitled")},n))})}),e.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:m.slice(1).map((c,n)=>e.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-800",children:c.map((g,x)=>e.jsx("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-white whitespace-nowrap border-b border-gray-100 dark:border-gray-800",children:g||"-"},x))},n))})]})}):e.jsx("div",{className:"text-center py-12 text-gray-500 dark:text-gray-400",children:e.jsx("p",{children:t("csvPreview.empty.noData")})})}),y>1&&e.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-gray-200 dark:border-gray-700",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("csvPreview.pagination.showing",{start:f+1,end:Math.min(C,j.length),total:j.length})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>b(Math.max(1,i-1)),disabled:i===1,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:t("csvPreview.pagination.previous"),children:e.jsx(_,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 px-3",children:[i," / ",y]}),e.jsx("button",{onClick:()=>b(Math.min(y,i+1)),disabled:i===y,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:t("csvPreview.pagination.next"),children:e.jsx(q,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})})]})]})]}):e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg w-full max-w-6xl max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:O}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t("csvPreview.info.rowCount",{count:j.length}),d&&` (${t("csvPreview.info.filtered")})`]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>$(!0),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:t("csvPreview.actions.maximize"),children:e.jsx(ae,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsx("button",{onClick:k,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:t("csvPreview.actions.download"),children:e.jsx(X,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:t("csvPreview.actions.close"),children:e.jsx(T,{className:"w-5 h-5 text-gray-600 dark:text-gray-400"})})]})]}),e.jsx("div",{className:"p-4 border-b border-gray-100 dark:border-gray-700",children:e.jsxs("div",{className:"relative",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{id:"csv-search",type:"text",value:d,onChange:c=>V(c.target.value),placeholder:t("csvPreview.search.placeholder"),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:bg-gray-700 dark:text-white dark:placeholder-gray-400"})]})}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:m.length>0?e.jsx("div",{className:"min-w-full",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 sticky top-0",children:e.jsx("tr",{children:m[0]?.map((c,n)=>e.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700",children:c||t("csvPreview.table.untitled")},n))})}),e.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:m.slice(1).map((c,n)=>e.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-800",children:c.map((g,x)=>e.jsx("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-white whitespace-nowrap border-b border-gray-100 dark:border-gray-800",children:g||"-"},x))},n))})]})}):e.jsx("div",{className:"text-center py-12 text-gray-500 dark:text-gray-400",children:e.jsx("p",{children:t("csvPreview.empty.noData")})})}),y>1&&e.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-gray-200 dark:border-gray-700",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("csvPreview.pagination.showing",{start:f+1,end:Math.min(C,j.length),total:j.length})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>b(Math.max(1,i-1)),disabled:i===1,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:t("csvPreview.pagination.previous"),children:e.jsx(_,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),e.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 px-3",children:[i," / ",y]}),e.jsx("button",{onClick:()=>b(Math.min(y,i+1)),disabled:i===y,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:t("csvPreview.pagination.next"),children:e.jsx(q,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})})]})]}),e.jsx("div",{className:"px-4 py-2 text-xs text-gray-500 dark:text-gray-400 text-center border-t border-gray-100 dark:border-gray-700",children:t("csvPreview.instructions")})]})})},je=({filePath:F,onClose:h})=>{const{t}=ee("components"),[p,A]=o.useState([]),[N,U]=o.useState(!0),[M,s]=o.useState(null),[d,V]=o.useState(""),[i,b]=o.useState(1),[P,$]=o.useState(!1),[v]=o.useState(20),[O,H]=o.useState(""),[z,j]=o.useState(new Set),[y,f]=o.useState(null),C=a=>{const l=a.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Se}from"./syntax-highlighting-CnREyncB.js";import{j as e,T as He}from"./data-structures-C0h9Oap1.js";import{r as n,W as Fe}from"./monaco-editor-DHKm5-VF.js";import{b as ue,a as I,A}from"./agents-DG431Wop.js";import{aD as u,E as Te,a8 as Me,U as De,aE as Ae,L as R,aF as Re,X as ie,aG as Ie,k as Oe,l as $e}from"./ui-components-CRCmgMKc.js";import{u as fe}from"./tools-C0JOzoE_.js";function Be(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L192 480l157.1-52.2L384 32H0zm313.1 80l-4.8 47.3L193 208.6l-.3.1h111.5l-12.8 146.6-98.2 28.7-98.8-29.2-6.4-73.9h48.9l3.2 38.3 52.6 13.3 54.7-15.4 3.7-61.6-166.3-.5v-.1l-.2.1-3.6-46.3L193.1 162l6.5-2.7H76.7L70.9 112h242.2z"},child:[]}]})(r)}function le(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z"},child:[]}]})(r)}function Ve(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M277.74 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.84 0 242.84 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.19 12.19 0 0 1-2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.33 17.33 0 0 0-8.2 6.3 70.45 70.45 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6.7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.84 509.4 401 461.3 348 437.4zM124.44 396c-78.7 22 47.9 67.4 148.1 24.5a185.89 185.89 0 0 1-28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.64 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.37 60.37 0 0 1-21.1-12.8z"},child:[]}]})(r)}function _e(r){return u({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM243.8 381.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"},child:[]}]})(r)}function Pe(r){return u({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"},child:[]}]})(r)}function Ue(r){return u({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"},child:[]}]})(r)}function qe(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.2 177.2c-5.4-1.8-10.8-3.5-16.2-5.1.9-3.7 1.7-7.4 2.5-11.1 12.3-59.6 4.2-107.5-23.1-123.3-26.3-15.1-69.2.6-112.6 38.4-4.3 3.7-8.5 7.6-12.5 11.5-2.7-2.6-5.5-5.2-8.3-7.7-45.5-40.4-91.1-57.4-118.4-41.5-26.2 15.2-34 60.3-23 116.7 1.1 5.6 2.3 11.1 3.7 16.7-6.4 1.8-12.7 3.8-18.6 5.9C38.3 196.2 0 225.4 0 255.6c0 31.2 40.8 62.5 96.3 81.5 4.5 1.5 9 3 13.6 4.3-1.5 6-2.8 11.9-4 18-10.5 55.5-2.3 99.5 23.9 114.6 27 15.6 72.4-.4 116.6-39.1 3.5-3.1 7-6.3 10.5-9.7 4.4 4.3 9 8.4 13.6 12.4 42.8 36.8 85.1 51.7 111.2 36.6 27-15.6 35.8-62.9 24.4-120.5-.9-4.4-1.9-8.9-3-13.5 3.2-.9 6.3-1.9 9.4-2.9 57.7-19.1 99.5-50 99.5-81.7 0-30.3-39.4-59.7-93.8-78.4zM282.9 92.3c37.2-32.4 71.9-45.1 87.7-36 16.9 9.7 23.4 48.9 12.8 100.4-.7 3.4-1.4 6.7-2.3 10-22.2-5-44.7-8.6-67.3-10.6-13-18.6-27.2-36.4-42.6-53.1 3.9-3.7 7.7-7.2 11.7-10.7zM167.2 307.5c5.1 8.7 10.3 17.4 15.8 25.9-15.6-1.7-31.1-4.2-46.4-7.5 4.4-14.4 9.9-29.3 16.3-44.5 4.6 8.8 9.3 17.5 14.3 26.1zm-30.3-120.3c14.4-3.2 29.7-5.8 45.6-7.8-5.3 8.3-10.5 16.8-15.4 25.4-4.9 8.5-9.7 17.2-14.2 26-6.3-14.9-11.6-29.5-16-43.6zm27.4 68.9c6.6-13.8 13.8-27.3 21.4-40.6s15.8-26.2 24.4-38.9c15-1.1 30.3-1.7 45.9-1.7s31 .6 45.9 1.7c8.5 12.6 16.6 25.5 24.3 38.7s14.9 26.7 21.7 40.4c-6.7 13.8-13.9 27.4-21.6 40.8-7.6 13.3-15.7 26.2-24.2 39-14.9 1.1-30.4 1.6-46.1 1.6s-30.9-.5-45.6-1.4c-8.7-12.7-16.9-25.7-24.6-39s-14.8-26.8-21.5-40.6zm180.6 51.2c5.1-8.8 9.9-17.7 14.6-26.7 6.4 14.5 12 29.2 16.9 44.3-15.5 3.5-31.2 6.2-47 8 5.4-8.4 10.5-17 15.5-25.6zm14.4-76.5c-4.7-8.8-9.5-17.6-14.5-26.2-4.9-8.5-10-16.9-15.3-25.2 16.1 2 31.5 4.7 45.9 8-4.6 14.8-10 29.2-16.1 43.4zM256.2 118.3c10.5 11.4 20.4 23.4 29.6 35.8-19.8-.9-39.7-.9-59.5 0 9.8-12.9 19.9-24.9 29.9-35.8zM140.2 57c16.8-9.8 54.1 4.2 93.4 39 2.5 2.2 5 4.6 7.6 7-15.5 16.7-29.8 34.5-42.9 53.1-22.6 2-45 5.5-67.2 10.4-1.3-5.1-2.4-10.3-3.5-15.5-9.4-48.4-3.2-84.9 12.6-94zm-24.5 263.6c-4.2-1.2-8.3-2.5-12.4-3.9-21.3-6.7-45.5-17.3-63-31.2-10.1-7-16.9-17.8-18.8-29.9 0-18.3 31.6-41.7 77.2-57.6 5.7-2 11.5-3.8 17.3-5.5 6.8 21.7 15 43 24.5 63.6-9.6 20.9-17.9 42.5-24.8 64.5zm116.6 98c-16.5 15.1-35.6 27.1-56.4 35.3-11.1 5.3-23.9 5.8-35.3 1.3-15.9-9.2-22.5-44.5-13.5-92 1.1-5.6 2.3-11.2 3.7-16.7 22.4 4.8 45 8.1 67.9 9.8 13.2 18.7 27.7 36.6 43.2 53.4-3.2 3.1-6.4 6.1-9.6 8.9zm24.5-24.3c-10.2-11-20.4-23.2-30.3-36.3 9.6.4 19.5.6 29.5.6 10.3 0 20.4-.2 30.4-.7-9.2 12.7-19.1 24.8-29.6 36.4zm130.7 30c-.9 12.2-6.9 23.6-16.5 31.3-15.9 9.2-49.8-2.8-86.4-34.2-4.2-3.6-8.4-7.5-12.7-11.5 15.3-16.9 29.4-34.8 42.2-53.6 22.9-1.9 45.7-5.4 68.2-10.5 1 4.1 1.9 8.2 2.7 12.2 4.9 21.6 5.7 44.1 2.5 66.3zm18.2-107.5c-2.8.9-5.6 1.8-8.5 2.6-7-21.8-15.6-43.1-25.5-63.8 9.6-20.4 17.7-41.4 24.5-62.9 5.2 1.5 10.2 3.1 15 4.7 46.6 16 79.3 39.8 79.3 58 0 19.6-34.9 44.9-84.8 61.4zm-149.7-15c25.3 0 45.8-20.5 45.8-45.8s-20.5-45.8-45.8-45.8c-25.3 0-45.8 20.5-45.8 45.8s20.5 45.8 45.8 45.8z"},child:[]}]})(r)}function We(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"},child:[]}]})(r)}function oe(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(r)}function W(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(r)}function Ge(r){return u({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(r)}function Je(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"},child:[]}]})(r)}function w(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(r)}function Ke(r){return u({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.708 5.578L2.061 8.224l2.647 2.646-.708.708-3-3V7.87l3-3 .708.708zm7-.708L11 5.578l2.647 2.646L11 10.87l.708.708 3-3V7.87l-3-3zM4.908 13l.894.448 5-10L9.908 3l-5 10z"},child:[]}]})(r)}function de(r){return u({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"},child:[]}]})(r)}function he(r){return u({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},child:[]}]})(r)}const Xe=r=>{const l=r.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff"].includes(l)},Qe=(r,l)=>{const d=r?Xe(r.split("/").pop()||""):!1;return ue({queryKey:["file-content",r,l],queryFn:async()=>{if(!r)throw new Error("File path is required");const h=new URLSearchParams;h.append("path",r),l&&h.append("projectPath",l);const a=await I(`${A}/files/read?${h.toString()}`);if(!a.ok)throw a.status===403?new Error("访问被拒绝:文件在项目目录之外"):a.status===404?new Error("文件不存在"):new Error(`读取文件失败 (${a.status})`);return a.json()},enabled:!!r&&!d,staleTime:6e4,retry:!1})},Ye=(r,l)=>ue({queryKey:["file-tree-lazy",r,l],queryFn:async()=>{if(!r)throw new Error("Project path is required");const d=new URLSearchParams;d.append("path",r),l&&d.append("showHiddenFiles","true");const h=await I(`${A}/files/browse?${d.toString()}`);if(!h.ok)throw new Error("Failed to browse directory");const a=await h.json(),x=[];for(const f of a.items)f.isDirectory?x.push({...f,children:[]}):x.push(f);return x},enabled:!!r,staleTime:3e4});class Ze{events=new Map;on(l,d){this.events.has(l)||this.events.set(l,[]),this.events.get(l).push(d)}off(l,d){const h=this.events.get(l);if(h){const a=h.indexOf(d);a>-1&&h.splice(a,1)}}emit(l,...d){const h=this.events.get(l);h&&h.forEach(a=>{try{a(...d)}catch(x){console.error(`Error in event handler for ${l}:`,x)}})}clear(){this.events.clear()}}const xe=new Ze,me={AI_RESPONSE_COMPLETE:"ai_response_complete",REFRESH_AGENT_CONTENT:"refresh_agent_content"},et=n.lazy(()=>Se(()=>import("./monaco-editor-DHKm5-VF.js").then(r=>r.i),[])),tt=new Map([["js",e.jsx(_e,{color:"#f7df1e"},"js")],["jsx",e.jsx(qe,{color:"#61dafb"},"jsx")],["ts",e.jsx(he,{color:"#3178c6"},"ts")],["tsx",e.jsx(he,{color:"#3178c6"},"tsx")],["css",e.jsx(Be,{color:"#1572b6"},"css")],["html",e.jsx(le,{color:"#e34f26"},"html")],["htm",e.jsx(le,{color:"#e34f26"},"htm")],["json",e.jsx(de,{color:"#f9d71c"},"json")],["jsonl",e.jsx(de,{color:"#e6a23c"},"jsonl")],["md",e.jsx(Pe,{color:"#083fa1"},"md")],["csv",e.jsx(W,{color:"#00a86b"},"csv")],["pdf",e.jsx(We,{color:"#d63031"},"pdf")],["ppt",e.jsx(oe,{color:"#d63031"},"ppt")],["pptx",e.jsx(oe,{color:"#d63031"},"pptx")],["ico",e.jsx(w,{color:"#a9a9a9"},"ico")],["png",e.jsx(w,{color:"#a9a9a9"},"png")],["jpg",e.jsx(w,{color:"#a9a9a9"},"jpg")],["jpeg",e.jsx(w,{color:"#a9a9a9"},"jpeg")],["gif",e.jsx(w,{color:"#a9a9a9"},"gif")],["svg",e.jsx(w,{color:"#a9a9a9"},"svg")],["webp",e.jsx(w,{color:"#a9a9a9"},"webp")],["py",e.jsx(Ue,{color:"#3776ab"},"py")],["java",e.jsx(Ve,{color:"#007396"},"java")]]),q=({node:r})=>{const l=r.data.isHidden;if(r.data.isDirectory){const x=l?"#9ca3af":"#87b3d6";return r.isOpen?e.jsx(Ge,{color:x}):e.jsx(Je,{color:x})}const d=r.data.name.split(".").pop()?.toLowerCase()||"",h=l?"#9ca3af":"#6d8a9f",a=l?{opacity:.6}:{};return e.jsx("span",{style:a,children:tt.get(d)||e.jsx(W,{color:h})})},rt=(r="")=>{const l=r.toLowerCase();if(l==="dockerfile"||l.startsWith("dockerfile."))return"dockerfile";switch(r.split(".").pop()?.toLowerCase()||""){case"js":case"jsx":return"javascript";case"ts":case"tsx":return"typescript";case"css":case"scss":case"sass":case"less":return"css";case"json":case"jsonl":return"json";case"html":case"htm":return"html";case"md":case"markdown":return"markdown";case"csv":return"csv";case"py":return"python";case"java":return"java";case"xml":return"xml";case"yaml":case"yml":return"yaml";case"sh":case"bash":return"shell";case"conf":case"config":case"ini":return"ini";case"nginx":return"nginx";case"sql":return"sql";case"go":return"go";case"rs":return"rust";case"c":case"cpp":case"cc":case"cxx":return"cpp";case"h":case"hpp":return"cpp";case"cs":return"csharp";case"php":return"php";case"rb":return"ruby";case"swift":return"swift";case"kt":return"kotlin";case"dockerfile":return"dockerfile";default:return"plaintext"}},st=({imageUrl:r,fileName:l})=>{const{t:d}=fe("components"),[h,a]=n.useState(!0),[x,f]=n.useState(!1),[g,E]=n.useState(null);return n.useEffect(()=>{let C=null;return(async()=>{try{a(!0),f(!1);const p=await I(r);if(!p.ok)throw new Error(`Failed to load image: ${p.status}`);const z=await p.blob(),j=URL.createObjectURL(z);C=j,E(j),a(!1)}catch(p){console.error("Failed to load image:",p),a(!1),f(!0)}})(),()=>{C&&URL.revokeObjectURL(C)}},[r]),e.jsx("div",{className:"flex items-center justify-center h-full p-4",children:x?e.jsxs("div",{className:"text-center text-gray-500",children:[e.jsx(w,{className:"w-12 h-12 mx-auto mb-4 text-gray-300"}),e.jsx("p",{children:d("fileExplorer.imageLoadFailed")}),e.jsx("p",{className:"text-sm mt-2",children:l})]}):e.jsxs("div",{className:"relative max-w-full max-h-full",children:[h&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(R,{className:"w-8 h-8 animate-spin text-gray-400"})}),g&&e.jsx("img",{src:g,alt:l,className:"max-w-full max-h-full object-contain bg-white dark:bg-gray-900 rounded shadow-lg",onLoad:()=>a(!1),onError:()=>{a(!1),f(!0)},style:{display:x?"none":"block"}})]})})},at=r=>{const l=r.toLowerCase();if(l==="dockerfile"||l.startsWith("dockerfile."))return"text";const d=r.split(".").pop()?.toLowerCase()||"",h=["js","jsx","ts","tsx","css","scss","sass","less","html","htm","json","jsonl","md","markdown","txt","py","java","xml","yaml","yml","sh","bash","bat","cmd","php","rb","go","rs","cpp","c","h","hpp","cc","cxx","cs","swift","kt","scala","clj","sql","dockerfile","gitignore","env","csv","tsv","conf","config","ini","toml","nginx","apache","properties","cfg"],a=["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff"];return h.includes(d)?"text":a.includes(d)?"image":"binary"},ct=({node:r,style:l,dragHandle:d,isLoading:h=!1,onDirectoryToggle:a,onFileSelect:x})=>{const f=n.useCallback(g=>{g.preventDefault(),g.stopPropagation(),r.data.isDirectory?a?.(r):x?.(r)},[r,a,x]);return e.jsxs("div",{style:l,ref:d,className:`flex items-center cursor-pointer px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 ${r.isSelected?"bg-blue-100 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"}`,onClick:f,children:[r.data.isDirectory&&e.jsx("span",{className:"mr-1 flex items-center",children:h?e.jsx(R,{className:"w-3 h-3 animate-spin text-gray-400"}):e.jsx($e,{className:`w-3 h-3 transition-transform text-gray-400 ${r.isOpen?"rotate-90":""}`})}),e.jsx("span",{className:"mr-2 flex items-center",children:e.jsx(q,{node:r})}),e.jsx("span",{className:`text-sm truncate flex-1 ${r.data.isHidden?"text-gray-400 dark:text-gray-500 italic":"text-gray-700 dark:text-gray-300"}`,children:r.data.name}),!r.data.isDirectory&&r.data.size&&e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500 ml-2",children:[(r.data.size/1024).toFixed(1),"KB"]})]})},D=5,ut=({projectPath:r,onFileSelect:l,className:d="",height:h="100vh"})=>{const{t:a}=fe("components"),[x,f]=n.useState([]),[g,E]=n.useState(null),[C,O]=n.useState(600),[p,z]=n.useState(!1),j=n.useRef(null),$=n.useRef(null),B=n.useRef(null),[G,ge]=n.useState(0),[J,pe]=n.useState(""),[ye,ve]=n.useState(document.documentElement.classList.contains("dark")),[F,T]=n.useState(new Set),[L,K]=n.useState([]),[V,M]=n.useState(new Set),[y,je]=n.useState(!1),[X,Q]=n.useState(!1),{data:S,isLoading:_,error:Y,refetch:H}=Ye(r,y),v=n.useMemo(()=>x.find(t=>t.isActive)||null,[x]),{data:Z,isLoading:be,error:ee}=Qe(v?v.path:void 0,r);n.useEffect(()=>{const t=new MutationObserver(s=>{s.forEach(o=>{o.attributeName==="class"&&ve(document.documentElement.classList.contains("dark"))})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),n.useEffect(()=>{if(S){const t=m=>m.filter(c=>y||!c.isHidden).map(c=>({id:c.path,name:c.name,path:c.path,isDirectory:c.isDirectory,size:c.size,modified:c.modified,isHidden:c.isHidden,children:c.children?t(c.children):void 0})),s=(m,c=new Set)=>(m.forEach(i=>{i.isDirectory&&i.children&&i.children.length>0&&(c.add(i.path),s(i.children,c))}),c),o=s(S);T(o),K(t(S))}},[S,y]);const te=n.useCallback(async t=>{if(!(F.has(t)||V.has(t))){M(s=>new Set(s).add(t));try{const s=new URLSearchParams;s.append("path",t),y&&s.append("showHiddenFiles","true");const o=await I(`${A}/files/browse?${s.toString()}`);if(!o.ok)throw new Error("Failed to browse directory");const m=await o.json(),c=[];for(const i of m.items)i.isDirectory?c.push({...i,children:[]}):c.push(i);K(i=>{const k=Le=>Le.map(N=>N.path===t?{...N,children:c.map(b=>({id:b.path,name:b.name,path:b.path,isDirectory:b.isDirectory,size:b.size,modified:b.modified,isHidden:b.isHidden,children:b.isDirectory?[]:void 0}))}:N.children?{...N,children:k(N.children)}:N);return k(i)}),T(i=>new Set(i).add(t)),B.current&&c.length>0&&c.forEach(i=>{i.isDirectory&&B.current?.close(i.path)})}catch(s){throw console.error("Failed to load directory children:",s),s}finally{M(s=>{const o=new Set(s);return o.delete(t),o})}}},[F,V,y]),P=n.useCallback(()=>{T(new Set),M(new Set),H()},[H]),we=n.useCallback(()=>{je(t=>!t)},[]);n.useEffect(()=>{T(new Set),M(new Set),H()},[y,H]),n.useEffect(()=>{const t=()=>{if(j.current){const m=j.current.getBoundingClientRect(),c=m.height>0?m.height:600;O(c)}};let s=null;j.current&&(s=new ResizeObserver(m=>{for(const c of m){const{height:i}=c.contentRect;i>0&&O(i)}}),s.observe(j.current));const o=setTimeout(t,100);return window.addEventListener("resize",t),()=>{clearTimeout(o),window.removeEventListener("resize",t),s&&s.disconnect()}},[S]),n.useEffect(()=>{const t=s=>{$.current&&!$.current.contains(s.target)&&z(!1)};if(p)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[p]),n.useEffect(()=>{const t=s=>{console.log("🔄 Received AI_RESPONSE_COMPLETE event in FileExplorer:",s),s.projectPath===r&&(console.log("🔄 Auto-refreshing file tree after AI response completion"),P())};return xe.on(me.AI_RESPONSE_COMPLETE,t),()=>{xe.off(me.AI_RESPONSE_COMPLETE,t)}},[r,P]);const re=L,ke=n.useMemo(()=>{const t={},s=o=>{o.forEach(m=>{m.isDirectory&&(t[m.id]=!1,m.children&&s(m.children))})};return L&&L.length>0&&s(L),t},[L]),se=n.useCallback((t,s=!1)=>({id:`tab-${t.path}`,name:t.name,path:t.path,isPinned:s,isActive:!1}),[]),U=n.useCallback((t,s=!1)=>{f(o=>{const m=o.findIndex(c=>c.path===t.path);if(m!==-1)return o.map((c,i)=>({...c,isActive:i===m,isPinned:s||c.isPinned}));{const c=se(t,s);return!s&&g?(E(c.id),o.map(i=>i.id===g?{...c,isActive:!0}:{...i,isActive:!1})):(s||E(c.id),[...o.map(i=>({...i,isActive:!1})),{...c,isActive:!0}])}}),l?.(t.path)},[se,g,l]),ae=n.useCallback(t=>{f(s=>{const o=s.findIndex(i=>i.id===t);if(o===-1)return s;const m=s[o],c=s.filter(i=>i.id!==t);if(m.isActive&&c.length>0){const i=Math.min(o,c.length-1);c[i]={...c[i],isActive:!0}}return g===t&&E(null),c})},[g]),ce=n.useCallback(t=>{f(s=>s.map(o=>({...o,isActive:o.id===t})))},[]),[ne,Ne]=n.useState({}),Ee=n.useCallback(t=>{const s=Date.now(),o=ne[t.data.path]||0;if(s-o<300)return;Ne(k=>({...k,[t.data.path]:s}));const m=t.isOpen,c=t.data.children&&t.data.children.length>0,i=F.has(t.data.path);m?t.close():!c&&!i?(t.open(),te(t.data.path).catch(k=>{console.error("Failed to load directory children:",k),t.close()})):t.open()},[ne,F,te]),Ce=n.useCallback(t=>{t.select();const s=Date.now(),o=s-G<300&&J===t.data.path;ge(s),pe(t.data.path),o?U(t.data,!0):setTimeout(()=>{Date.now()-s>=300&&U(t.data,!1)},300)},[U,G,J]),ze=()=>{if(!v)return e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(W,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),e.jsx("p",{children:a("fileExplorer.selectFile")})]})});if(be)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[e.jsx(R,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:a("fileExplorer.loading")})]})});if(ee)return e.jsx("div",{className:"flex items-center justify-center h-full text-red-500 dark:text-red-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:a("fileExplorer.loadFailed")}),e.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:ee.message}),e.jsx("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:v.path})]})});switch(at(v.name)){case"image":const s=new URLSearchParams;s.append("path",v.path),r&&s.append("projectPath",r),s.append("binary","true");const o=`${A}/files/read?${s.toString()}`;return e.jsx(st,{imageUrl:o,fileName:v.name});case"text":return Z?e.jsx(Fe.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"})}),children:e.jsx(et,{height:"100%",theme:ye?"vs-dark":"vs-light",language:rt(v.name),value:Z.content,options:{readOnly:!0,minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1}})}):e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsx("p",{children:a("fileExplorer.cannotReadFile")})});default:return e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ke,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),e.jsx("p",{children:a("fileExplorer.previewNotSupported")}),e.jsxs("p",{className:"text-sm mt-2",children:[a("fileExplorer.fileLabel"),": ",v.name]})]})})}};return Y?e.jsx("div",{className:`flex items-center justify-center h-full text-red-500 dark:text-red-400 ${d}`,style:{height:h},children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:a("fileExplorer.loadFailed")}),e.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:Y.message}),e.jsxs("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:[a("fileExplorer.projectPath"),": ",r]}),e.jsx("button",{onClick:()=>H(),className:"mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors",children:a("fileExplorer.retry")})]})}):e.jsxs("div",{className:`flex h-full bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${d}`,children:[!X&&e.jsxs("div",{className:"w-80 border-r border-gray-200 dark:border-gray-700 flex flex-col h-full",children:[e.jsx("div",{className:"h-12 px-3 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:a("fileExplorer.title")}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx("button",{onClick:we,className:`p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors ${y?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,title:y?"隐藏文件和文件夹":"显示隐藏文件和文件夹",children:y?e.jsx(Te,{className:"w-4 h-4"}):e.jsx(Me,{className:"w-4 h-4"})}),e.jsx("button",{onClick:P,className:"p-1.5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("common:actions.refresh"),disabled:_,children:e.jsx(De,{className:`w-4 h-4 ${_?"animate-spin":""}`})}),e.jsx("button",{onClick:()=>Q(!0),className:"p-1.5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("fileExplorer.collapsePanel"),children:e.jsx(Ae,{className:"w-4 h-4"})})]})]})}),e.jsx("div",{ref:j,className:"flex-1 min-h-0 pl-2",children:_?e.jsx("div",{className:"flex items-center justify-center h-32",children:e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[e.jsx(R,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{className:"text-sm",children:a("fileExplorer.loading")})]})}):re.length===0?e.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400",children:e.jsx("p",{className:"text-sm",children:a("fileExplorer.emptyDirectory")})}):e.jsx(He,{data:re,width:320,height:C,indent:20,rowHeight:36,initialOpenState:ke,ref:B,children:t=>e.jsx(ct,{...t,isLoading:V.has(t.node.data.path),onDirectoryToggle:Ee,onFileSelect:Ce})})})]}),e.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"h-12 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center flex-shrink-0",children:[X&&e.jsx("button",{onClick:()=>Q(!1),className:"p-1.5 mx-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("fileExplorer.expandPanel"),children:e.jsx(Re,{className:"w-4 h-4"})}),x.length>0?e.jsxs("div",{className:"flex items-center h-full w-full",children:[e.jsx("div",{className:"flex items-center h-full flex-1",children:x.slice(0,Math.min(D,x.length)).map(t=>e.jsxs("div",{className:`group relative flex items-center h-full px-3 border-r border-gray-200 dark:border-gray-700 cursor-pointer transition-colors ${t.isActive?"bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-white":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"} ${t.isPinned?"":"italic"}`,onClick:()=>ce(t.id),title:`${t.path} ${t.isPinned?"(固定)":"(临时)"}`,style:{minWidth:"120px",maxWidth:"180px"},children:[e.jsx(q,{node:{data:{name:t.name,isDirectory:!1},isOpen:!1}}),e.jsx("span",{className:"ml-2 text-sm truncate flex-1",children:t.name}),!t.isPinned&&e.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),e.jsx("button",{className:"ml-2 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:s=>{s.stopPropagation(),ae(t.id)},title:a("common:actions.close"),children:e.jsx(ie,{className:"w-3 h-3"})})]},t.id))}),x.length>D&&e.jsxs("div",{className:"relative",ref:$,children:[e.jsxs("button",{className:"flex items-center h-full px-3 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white transition-colors border-l border-gray-200 dark:border-gray-700",onClick:()=>z(!p),title:`${x.length-D} more tabs`,children:[e.jsx(Ie,{className:"w-4 h-4"}),e.jsx(Oe,{className:"w-3 h-3 ml-1"})]}),p&&e.jsx("div",{className:"absolute top-full right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 min-w-48 max-h-64 overflow-y-auto",children:x.slice(D).map(t=>e.jsxs("div",{className:`flex items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 ${t.isActive?"bg-blue-50 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"} ${t.isPinned?"":"italic"}`,onClick:()=>{ce(t.id),z(!1)},title:`${t.path} ${t.isPinned?"(固定)":"(临时)"}`,children:[e.jsx(q,{node:{data:{name:t.name,isDirectory:!1},isOpen:!1}}),e.jsx("span",{className:"ml-2 truncate flex-1",children:t.name}),!t.isPinned&&e.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),e.jsx("button",{className:"ml-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:s=>{s.stopPropagation(),ae(t.id)},title:a("common:actions.close"),children:e.jsx(ie,{className:"w-3 h-3"})})]},t.id))})]})]}):e.jsx("div",{className:"flex items-center justify-center w-full h-full text-gray-500 dark:text-gray-400",children:e.jsx("span",{className:"text-sm",children:a("fileExplorer.noFiles")})})]}),e.jsx("div",{className:"flex-1 bg-gray-50 dark:bg-gray-900 min-h-0",children:ze()})]})]})};export{me as E,ut as F,xe as e};
|
|
1
|
+
import{c as Se}from"./syntax-highlighting-DGbNjS3S.js";import{j as e,T as He}from"./data-structures-ChC1tqVg.js";import{r as n,W as Fe}from"./monaco-editor-BWfQfpij.js";import{b as ue,a as I,A}from"./agents-3mB536QF.js";import{aD as u,E as Te,a8 as Me,U as De,aE as Ae,L as R,aF as Re,X as ie,aG as Ie,k as Oe,l as $e}from"./ui-components-DaGtjl0g.js";import{u as fe}from"./tools-BAI9XHGS.js";function Be(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L192 480l157.1-52.2L384 32H0zm313.1 80l-4.8 47.3L193 208.6l-.3.1h111.5l-12.8 146.6-98.2 28.7-98.8-29.2-6.4-73.9h48.9l3.2 38.3 52.6 13.3 54.7-15.4 3.7-61.6-166.3-.5v-.1l-.2.1-3.6-46.3L193.1 162l6.5-2.7H76.7L70.9 112h242.2z"},child:[]}]})(r)}function le(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z"},child:[]}]})(r)}function Ve(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M277.74 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.84 0 242.84 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.19 12.19 0 0 1-2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.33 17.33 0 0 0-8.2 6.3 70.45 70.45 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6.7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.84 509.4 401 461.3 348 437.4zM124.44 396c-78.7 22 47.9 67.4 148.1 24.5a185.89 185.89 0 0 1-28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.64 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.37 60.37 0 0 1-21.1-12.8z"},child:[]}]})(r)}function _e(r){return u({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM243.8 381.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"},child:[]}]})(r)}function Pe(r){return u({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"},child:[]}]})(r)}function Ue(r){return u({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"},child:[]}]})(r)}function qe(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.2 177.2c-5.4-1.8-10.8-3.5-16.2-5.1.9-3.7 1.7-7.4 2.5-11.1 12.3-59.6 4.2-107.5-23.1-123.3-26.3-15.1-69.2.6-112.6 38.4-4.3 3.7-8.5 7.6-12.5 11.5-2.7-2.6-5.5-5.2-8.3-7.7-45.5-40.4-91.1-57.4-118.4-41.5-26.2 15.2-34 60.3-23 116.7 1.1 5.6 2.3 11.1 3.7 16.7-6.4 1.8-12.7 3.8-18.6 5.9C38.3 196.2 0 225.4 0 255.6c0 31.2 40.8 62.5 96.3 81.5 4.5 1.5 9 3 13.6 4.3-1.5 6-2.8 11.9-4 18-10.5 55.5-2.3 99.5 23.9 114.6 27 15.6 72.4-.4 116.6-39.1 3.5-3.1 7-6.3 10.5-9.7 4.4 4.3 9 8.4 13.6 12.4 42.8 36.8 85.1 51.7 111.2 36.6 27-15.6 35.8-62.9 24.4-120.5-.9-4.4-1.9-8.9-3-13.5 3.2-.9 6.3-1.9 9.4-2.9 57.7-19.1 99.5-50 99.5-81.7 0-30.3-39.4-59.7-93.8-78.4zM282.9 92.3c37.2-32.4 71.9-45.1 87.7-36 16.9 9.7 23.4 48.9 12.8 100.4-.7 3.4-1.4 6.7-2.3 10-22.2-5-44.7-8.6-67.3-10.6-13-18.6-27.2-36.4-42.6-53.1 3.9-3.7 7.7-7.2 11.7-10.7zM167.2 307.5c5.1 8.7 10.3 17.4 15.8 25.9-15.6-1.7-31.1-4.2-46.4-7.5 4.4-14.4 9.9-29.3 16.3-44.5 4.6 8.8 9.3 17.5 14.3 26.1zm-30.3-120.3c14.4-3.2 29.7-5.8 45.6-7.8-5.3 8.3-10.5 16.8-15.4 25.4-4.9 8.5-9.7 17.2-14.2 26-6.3-14.9-11.6-29.5-16-43.6zm27.4 68.9c6.6-13.8 13.8-27.3 21.4-40.6s15.8-26.2 24.4-38.9c15-1.1 30.3-1.7 45.9-1.7s31 .6 45.9 1.7c8.5 12.6 16.6 25.5 24.3 38.7s14.9 26.7 21.7 40.4c-6.7 13.8-13.9 27.4-21.6 40.8-7.6 13.3-15.7 26.2-24.2 39-14.9 1.1-30.4 1.6-46.1 1.6s-30.9-.5-45.6-1.4c-8.7-12.7-16.9-25.7-24.6-39s-14.8-26.8-21.5-40.6zm180.6 51.2c5.1-8.8 9.9-17.7 14.6-26.7 6.4 14.5 12 29.2 16.9 44.3-15.5 3.5-31.2 6.2-47 8 5.4-8.4 10.5-17 15.5-25.6zm14.4-76.5c-4.7-8.8-9.5-17.6-14.5-26.2-4.9-8.5-10-16.9-15.3-25.2 16.1 2 31.5 4.7 45.9 8-4.6 14.8-10 29.2-16.1 43.4zM256.2 118.3c10.5 11.4 20.4 23.4 29.6 35.8-19.8-.9-39.7-.9-59.5 0 9.8-12.9 19.9-24.9 29.9-35.8zM140.2 57c16.8-9.8 54.1 4.2 93.4 39 2.5 2.2 5 4.6 7.6 7-15.5 16.7-29.8 34.5-42.9 53.1-22.6 2-45 5.5-67.2 10.4-1.3-5.1-2.4-10.3-3.5-15.5-9.4-48.4-3.2-84.9 12.6-94zm-24.5 263.6c-4.2-1.2-8.3-2.5-12.4-3.9-21.3-6.7-45.5-17.3-63-31.2-10.1-7-16.9-17.8-18.8-29.9 0-18.3 31.6-41.7 77.2-57.6 5.7-2 11.5-3.8 17.3-5.5 6.8 21.7 15 43 24.5 63.6-9.6 20.9-17.9 42.5-24.8 64.5zm116.6 98c-16.5 15.1-35.6 27.1-56.4 35.3-11.1 5.3-23.9 5.8-35.3 1.3-15.9-9.2-22.5-44.5-13.5-92 1.1-5.6 2.3-11.2 3.7-16.7 22.4 4.8 45 8.1 67.9 9.8 13.2 18.7 27.7 36.6 43.2 53.4-3.2 3.1-6.4 6.1-9.6 8.9zm24.5-24.3c-10.2-11-20.4-23.2-30.3-36.3 9.6.4 19.5.6 29.5.6 10.3 0 20.4-.2 30.4-.7-9.2 12.7-19.1 24.8-29.6 36.4zm130.7 30c-.9 12.2-6.9 23.6-16.5 31.3-15.9 9.2-49.8-2.8-86.4-34.2-4.2-3.6-8.4-7.5-12.7-11.5 15.3-16.9 29.4-34.8 42.2-53.6 22.9-1.9 45.7-5.4 68.2-10.5 1 4.1 1.9 8.2 2.7 12.2 4.9 21.6 5.7 44.1 2.5 66.3zm18.2-107.5c-2.8.9-5.6 1.8-8.5 2.6-7-21.8-15.6-43.1-25.5-63.8 9.6-20.4 17.7-41.4 24.5-62.9 5.2 1.5 10.2 3.1 15 4.7 46.6 16 79.3 39.8 79.3 58 0 19.6-34.9 44.9-84.8 61.4zm-149.7-15c25.3 0 45.8-20.5 45.8-45.8s-20.5-45.8-45.8-45.8c-25.3 0-45.8 20.5-45.8 45.8s20.5 45.8 45.8 45.8z"},child:[]}]})(r)}function We(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"},child:[]}]})(r)}function oe(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(r)}function W(r){return u({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(r)}function Ge(r){return u({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(r)}function Je(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"},child:[]}]})(r)}function w(r){return u({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(r)}function Ke(r){return u({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.708 5.578L2.061 8.224l2.647 2.646-.708.708-3-3V7.87l3-3 .708.708zm7-.708L11 5.578l2.647 2.646L11 10.87l.708.708 3-3V7.87l-3-3zM4.908 13l.894.448 5-10L9.908 3l-5 10z"},child:[]}]})(r)}function de(r){return u({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"},child:[]}]})(r)}function he(r){return u({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},child:[]}]})(r)}const Xe=r=>{const l=r.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff"].includes(l)},Qe=(r,l)=>{const d=r?Xe(r.split("/").pop()||""):!1;return ue({queryKey:["file-content",r,l],queryFn:async()=>{if(!r)throw new Error("File path is required");const h=new URLSearchParams;h.append("path",r),l&&h.append("projectPath",l);const a=await I(`${A}/files/read?${h.toString()}`);if(!a.ok)throw a.status===403?new Error("访问被拒绝:文件在项目目录之外"):a.status===404?new Error("文件不存在"):new Error(`读取文件失败 (${a.status})`);return a.json()},enabled:!!r&&!d,staleTime:6e4,retry:!1})},Ye=(r,l)=>ue({queryKey:["file-tree-lazy",r,l],queryFn:async()=>{if(!r)throw new Error("Project path is required");const d=new URLSearchParams;d.append("path",r),l&&d.append("showHiddenFiles","true");const h=await I(`${A}/files/browse?${d.toString()}`);if(!h.ok)throw new Error("Failed to browse directory");const a=await h.json(),x=[];for(const f of a.items)f.isDirectory?x.push({...f,children:[]}):x.push(f);return x},enabled:!!r,staleTime:3e4});class Ze{events=new Map;on(l,d){this.events.has(l)||this.events.set(l,[]),this.events.get(l).push(d)}off(l,d){const h=this.events.get(l);if(h){const a=h.indexOf(d);a>-1&&h.splice(a,1)}}emit(l,...d){const h=this.events.get(l);h&&h.forEach(a=>{try{a(...d)}catch(x){console.error(`Error in event handler for ${l}:`,x)}})}clear(){this.events.clear()}}const xe=new Ze,me={AI_RESPONSE_COMPLETE:"ai_response_complete",REFRESH_AGENT_CONTENT:"refresh_agent_content"},et=n.lazy(()=>Se(()=>import("./monaco-editor-BWfQfpij.js").then(r=>r.i),[])),tt=new Map([["js",e.jsx(_e,{color:"#f7df1e"},"js")],["jsx",e.jsx(qe,{color:"#61dafb"},"jsx")],["ts",e.jsx(he,{color:"#3178c6"},"ts")],["tsx",e.jsx(he,{color:"#3178c6"},"tsx")],["css",e.jsx(Be,{color:"#1572b6"},"css")],["html",e.jsx(le,{color:"#e34f26"},"html")],["htm",e.jsx(le,{color:"#e34f26"},"htm")],["json",e.jsx(de,{color:"#f9d71c"},"json")],["jsonl",e.jsx(de,{color:"#e6a23c"},"jsonl")],["md",e.jsx(Pe,{color:"#083fa1"},"md")],["csv",e.jsx(W,{color:"#00a86b"},"csv")],["pdf",e.jsx(We,{color:"#d63031"},"pdf")],["ppt",e.jsx(oe,{color:"#d63031"},"ppt")],["pptx",e.jsx(oe,{color:"#d63031"},"pptx")],["ico",e.jsx(w,{color:"#a9a9a9"},"ico")],["png",e.jsx(w,{color:"#a9a9a9"},"png")],["jpg",e.jsx(w,{color:"#a9a9a9"},"jpg")],["jpeg",e.jsx(w,{color:"#a9a9a9"},"jpeg")],["gif",e.jsx(w,{color:"#a9a9a9"},"gif")],["svg",e.jsx(w,{color:"#a9a9a9"},"svg")],["webp",e.jsx(w,{color:"#a9a9a9"},"webp")],["py",e.jsx(Ue,{color:"#3776ab"},"py")],["java",e.jsx(Ve,{color:"#007396"},"java")]]),q=({node:r})=>{const l=r.data.isHidden;if(r.data.isDirectory){const x=l?"#9ca3af":"#87b3d6";return r.isOpen?e.jsx(Ge,{color:x}):e.jsx(Je,{color:x})}const d=r.data.name.split(".").pop()?.toLowerCase()||"",h=l?"#9ca3af":"#6d8a9f",a=l?{opacity:.6}:{};return e.jsx("span",{style:a,children:tt.get(d)||e.jsx(W,{color:h})})},rt=(r="")=>{const l=r.toLowerCase();if(l==="dockerfile"||l.startsWith("dockerfile."))return"dockerfile";switch(r.split(".").pop()?.toLowerCase()||""){case"js":case"jsx":return"javascript";case"ts":case"tsx":return"typescript";case"css":case"scss":case"sass":case"less":return"css";case"json":case"jsonl":return"json";case"html":case"htm":return"html";case"md":case"markdown":return"markdown";case"csv":return"csv";case"py":return"python";case"java":return"java";case"xml":return"xml";case"yaml":case"yml":return"yaml";case"sh":case"bash":return"shell";case"conf":case"config":case"ini":return"ini";case"nginx":return"nginx";case"sql":return"sql";case"go":return"go";case"rs":return"rust";case"c":case"cpp":case"cc":case"cxx":return"cpp";case"h":case"hpp":return"cpp";case"cs":return"csharp";case"php":return"php";case"rb":return"ruby";case"swift":return"swift";case"kt":return"kotlin";case"dockerfile":return"dockerfile";default:return"plaintext"}},st=({imageUrl:r,fileName:l})=>{const{t:d}=fe("components"),[h,a]=n.useState(!0),[x,f]=n.useState(!1),[g,E]=n.useState(null);return n.useEffect(()=>{let C=null;return(async()=>{try{a(!0),f(!1);const p=await I(r);if(!p.ok)throw new Error(`Failed to load image: ${p.status}`);const z=await p.blob(),j=URL.createObjectURL(z);C=j,E(j),a(!1)}catch(p){console.error("Failed to load image:",p),a(!1),f(!0)}})(),()=>{C&&URL.revokeObjectURL(C)}},[r]),e.jsx("div",{className:"flex items-center justify-center h-full p-4",children:x?e.jsxs("div",{className:"text-center text-gray-500",children:[e.jsx(w,{className:"w-12 h-12 mx-auto mb-4 text-gray-300"}),e.jsx("p",{children:d("fileExplorer.imageLoadFailed")}),e.jsx("p",{className:"text-sm mt-2",children:l})]}):e.jsxs("div",{className:"relative max-w-full max-h-full",children:[h&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(R,{className:"w-8 h-8 animate-spin text-gray-400"})}),g&&e.jsx("img",{src:g,alt:l,className:"max-w-full max-h-full object-contain bg-white dark:bg-gray-900 rounded shadow-lg",onLoad:()=>a(!1),onError:()=>{a(!1),f(!0)},style:{display:x?"none":"block"}})]})})},at=r=>{const l=r.toLowerCase();if(l==="dockerfile"||l.startsWith("dockerfile."))return"text";const d=r.split(".").pop()?.toLowerCase()||"",h=["js","jsx","ts","tsx","css","scss","sass","less","html","htm","json","jsonl","md","markdown","txt","py","java","xml","yaml","yml","sh","bash","bat","cmd","php","rb","go","rs","cpp","c","h","hpp","cc","cxx","cs","swift","kt","scala","clj","sql","dockerfile","gitignore","env","csv","tsv","conf","config","ini","toml","nginx","apache","properties","cfg"],a=["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff"];return h.includes(d)?"text":a.includes(d)?"image":"binary"},ct=({node:r,style:l,dragHandle:d,isLoading:h=!1,onDirectoryToggle:a,onFileSelect:x})=>{const f=n.useCallback(g=>{g.preventDefault(),g.stopPropagation(),r.data.isDirectory?a?.(r):x?.(r)},[r,a,x]);return e.jsxs("div",{style:l,ref:d,className:`flex items-center cursor-pointer px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 ${r.isSelected?"bg-blue-100 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"}`,onClick:f,children:[r.data.isDirectory&&e.jsx("span",{className:"mr-1 flex items-center",children:h?e.jsx(R,{className:"w-3 h-3 animate-spin text-gray-400"}):e.jsx($e,{className:`w-3 h-3 transition-transform text-gray-400 ${r.isOpen?"rotate-90":""}`})}),e.jsx("span",{className:"mr-2 flex items-center",children:e.jsx(q,{node:r})}),e.jsx("span",{className:`text-sm truncate flex-1 ${r.data.isHidden?"text-gray-400 dark:text-gray-500 italic":"text-gray-700 dark:text-gray-300"}`,children:r.data.name}),!r.data.isDirectory&&r.data.size&&e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500 ml-2",children:[(r.data.size/1024).toFixed(1),"KB"]})]})},D=5,ut=({projectPath:r,onFileSelect:l,className:d="",height:h="100vh"})=>{const{t:a}=fe("components"),[x,f]=n.useState([]),[g,E]=n.useState(null),[C,O]=n.useState(600),[p,z]=n.useState(!1),j=n.useRef(null),$=n.useRef(null),B=n.useRef(null),[G,ge]=n.useState(0),[J,pe]=n.useState(""),[ye,ve]=n.useState(document.documentElement.classList.contains("dark")),[F,T]=n.useState(new Set),[L,K]=n.useState([]),[V,M]=n.useState(new Set),[y,je]=n.useState(!1),[X,Q]=n.useState(!1),{data:S,isLoading:_,error:Y,refetch:H}=Ye(r,y),v=n.useMemo(()=>x.find(t=>t.isActive)||null,[x]),{data:Z,isLoading:be,error:ee}=Qe(v?v.path:void 0,r);n.useEffect(()=>{const t=new MutationObserver(s=>{s.forEach(o=>{o.attributeName==="class"&&ve(document.documentElement.classList.contains("dark"))})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),n.useEffect(()=>{if(S){const t=m=>m.filter(c=>y||!c.isHidden).map(c=>({id:c.path,name:c.name,path:c.path,isDirectory:c.isDirectory,size:c.size,modified:c.modified,isHidden:c.isHidden,children:c.children?t(c.children):void 0})),s=(m,c=new Set)=>(m.forEach(i=>{i.isDirectory&&i.children&&i.children.length>0&&(c.add(i.path),s(i.children,c))}),c),o=s(S);T(o),K(t(S))}},[S,y]);const te=n.useCallback(async t=>{if(!(F.has(t)||V.has(t))){M(s=>new Set(s).add(t));try{const s=new URLSearchParams;s.append("path",t),y&&s.append("showHiddenFiles","true");const o=await I(`${A}/files/browse?${s.toString()}`);if(!o.ok)throw new Error("Failed to browse directory");const m=await o.json(),c=[];for(const i of m.items)i.isDirectory?c.push({...i,children:[]}):c.push(i);K(i=>{const k=Le=>Le.map(N=>N.path===t?{...N,children:c.map(b=>({id:b.path,name:b.name,path:b.path,isDirectory:b.isDirectory,size:b.size,modified:b.modified,isHidden:b.isHidden,children:b.isDirectory?[]:void 0}))}:N.children?{...N,children:k(N.children)}:N);return k(i)}),T(i=>new Set(i).add(t)),B.current&&c.length>0&&c.forEach(i=>{i.isDirectory&&B.current?.close(i.path)})}catch(s){throw console.error("Failed to load directory children:",s),s}finally{M(s=>{const o=new Set(s);return o.delete(t),o})}}},[F,V,y]),P=n.useCallback(()=>{T(new Set),M(new Set),H()},[H]),we=n.useCallback(()=>{je(t=>!t)},[]);n.useEffect(()=>{T(new Set),M(new Set),H()},[y,H]),n.useEffect(()=>{const t=()=>{if(j.current){const m=j.current.getBoundingClientRect(),c=m.height>0?m.height:600;O(c)}};let s=null;j.current&&(s=new ResizeObserver(m=>{for(const c of m){const{height:i}=c.contentRect;i>0&&O(i)}}),s.observe(j.current));const o=setTimeout(t,100);return window.addEventListener("resize",t),()=>{clearTimeout(o),window.removeEventListener("resize",t),s&&s.disconnect()}},[S]),n.useEffect(()=>{const t=s=>{$.current&&!$.current.contains(s.target)&&z(!1)};if(p)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[p]),n.useEffect(()=>{const t=s=>{console.log("🔄 Received AI_RESPONSE_COMPLETE event in FileExplorer:",s),s.projectPath===r&&(console.log("🔄 Auto-refreshing file tree after AI response completion"),P())};return xe.on(me.AI_RESPONSE_COMPLETE,t),()=>{xe.off(me.AI_RESPONSE_COMPLETE,t)}},[r,P]);const re=L,ke=n.useMemo(()=>{const t={},s=o=>{o.forEach(m=>{m.isDirectory&&(t[m.id]=!1,m.children&&s(m.children))})};return L&&L.length>0&&s(L),t},[L]),se=n.useCallback((t,s=!1)=>({id:`tab-${t.path}`,name:t.name,path:t.path,isPinned:s,isActive:!1}),[]),U=n.useCallback((t,s=!1)=>{f(o=>{const m=o.findIndex(c=>c.path===t.path);if(m!==-1)return o.map((c,i)=>({...c,isActive:i===m,isPinned:s||c.isPinned}));{const c=se(t,s);return!s&&g?(E(c.id),o.map(i=>i.id===g?{...c,isActive:!0}:{...i,isActive:!1})):(s||E(c.id),[...o.map(i=>({...i,isActive:!1})),{...c,isActive:!0}])}}),l?.(t.path)},[se,g,l]),ae=n.useCallback(t=>{f(s=>{const o=s.findIndex(i=>i.id===t);if(o===-1)return s;const m=s[o],c=s.filter(i=>i.id!==t);if(m.isActive&&c.length>0){const i=Math.min(o,c.length-1);c[i]={...c[i],isActive:!0}}return g===t&&E(null),c})},[g]),ce=n.useCallback(t=>{f(s=>s.map(o=>({...o,isActive:o.id===t})))},[]),[ne,Ne]=n.useState({}),Ee=n.useCallback(t=>{const s=Date.now(),o=ne[t.data.path]||0;if(s-o<300)return;Ne(k=>({...k,[t.data.path]:s}));const m=t.isOpen,c=t.data.children&&t.data.children.length>0,i=F.has(t.data.path);m?t.close():!c&&!i?(t.open(),te(t.data.path).catch(k=>{console.error("Failed to load directory children:",k),t.close()})):t.open()},[ne,F,te]),Ce=n.useCallback(t=>{t.select();const s=Date.now(),o=s-G<300&&J===t.data.path;ge(s),pe(t.data.path),o?U(t.data,!0):setTimeout(()=>{Date.now()-s>=300&&U(t.data,!1)},300)},[U,G,J]),ze=()=>{if(!v)return e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(W,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),e.jsx("p",{children:a("fileExplorer.selectFile")})]})});if(be)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[e.jsx(R,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:a("fileExplorer.loading")})]})});if(ee)return e.jsx("div",{className:"flex items-center justify-center h-full text-red-500 dark:text-red-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:a("fileExplorer.loadFailed")}),e.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:ee.message}),e.jsx("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:v.path})]})});switch(at(v.name)){case"image":const s=new URLSearchParams;s.append("path",v.path),r&&s.append("projectPath",r),s.append("binary","true");const o=`${A}/files/read?${s.toString()}`;return e.jsx(st,{imageUrl:o,fileName:v.name});case"text":return Z?e.jsx(Fe.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"})}),children:e.jsx(et,{height:"100%",theme:ye?"vs-dark":"vs-light",language:rt(v.name),value:Z.content,options:{readOnly:!0,minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1}})}):e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsx("p",{children:a("fileExplorer.cannotReadFile")})});default:return e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ke,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),e.jsx("p",{children:a("fileExplorer.previewNotSupported")}),e.jsxs("p",{className:"text-sm mt-2",children:[a("fileExplorer.fileLabel"),": ",v.name]})]})})}};return Y?e.jsx("div",{className:`flex items-center justify-center h-full text-red-500 dark:text-red-400 ${d}`,style:{height:h},children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:a("fileExplorer.loadFailed")}),e.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:Y.message}),e.jsxs("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:[a("fileExplorer.projectPath"),": ",r]}),e.jsx("button",{onClick:()=>H(),className:"mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors",children:a("fileExplorer.retry")})]})}):e.jsxs("div",{className:`flex h-full bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${d}`,children:[!X&&e.jsxs("div",{className:"w-80 border-r border-gray-200 dark:border-gray-700 flex flex-col h-full",children:[e.jsx("div",{className:"h-12 px-3 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:a("fileExplorer.title")}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx("button",{onClick:we,className:`p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors ${y?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,title:y?"隐藏文件和文件夹":"显示隐藏文件和文件夹",children:y?e.jsx(Te,{className:"w-4 h-4"}):e.jsx(Me,{className:"w-4 h-4"})}),e.jsx("button",{onClick:P,className:"p-1.5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("common:actions.refresh"),disabled:_,children:e.jsx(De,{className:`w-4 h-4 ${_?"animate-spin":""}`})}),e.jsx("button",{onClick:()=>Q(!0),className:"p-1.5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("fileExplorer.collapsePanel"),children:e.jsx(Ae,{className:"w-4 h-4"})})]})]})}),e.jsx("div",{ref:j,className:"flex-1 min-h-0 pl-2",children:_?e.jsx("div",{className:"flex items-center justify-center h-32",children:e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[e.jsx(R,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{className:"text-sm",children:a("fileExplorer.loading")})]})}):re.length===0?e.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400",children:e.jsx("p",{className:"text-sm",children:a("fileExplorer.emptyDirectory")})}):e.jsx(He,{data:re,width:320,height:C,indent:20,rowHeight:36,initialOpenState:ke,ref:B,children:t=>e.jsx(ct,{...t,isLoading:V.has(t.node.data.path),onDirectoryToggle:Ee,onFileSelect:Ce})})})]}),e.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"h-12 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center flex-shrink-0",children:[X&&e.jsx("button",{onClick:()=>Q(!1),className:"p-1.5 mx-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:a("fileExplorer.expandPanel"),children:e.jsx(Re,{className:"w-4 h-4"})}),x.length>0?e.jsxs("div",{className:"flex items-center h-full w-full",children:[e.jsx("div",{className:"flex items-center h-full flex-1",children:x.slice(0,Math.min(D,x.length)).map(t=>e.jsxs("div",{className:`group relative flex items-center h-full px-3 border-r border-gray-200 dark:border-gray-700 cursor-pointer transition-colors ${t.isActive?"bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-white":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"} ${t.isPinned?"":"italic"}`,onClick:()=>ce(t.id),title:`${t.path} ${t.isPinned?"(固定)":"(临时)"}`,style:{minWidth:"120px",maxWidth:"180px"},children:[e.jsx(q,{node:{data:{name:t.name,isDirectory:!1},isOpen:!1}}),e.jsx("span",{className:"ml-2 text-sm truncate flex-1",children:t.name}),!t.isPinned&&e.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),e.jsx("button",{className:"ml-2 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:s=>{s.stopPropagation(),ae(t.id)},title:a("common:actions.close"),children:e.jsx(ie,{className:"w-3 h-3"})})]},t.id))}),x.length>D&&e.jsxs("div",{className:"relative",ref:$,children:[e.jsxs("button",{className:"flex items-center h-full px-3 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white transition-colors border-l border-gray-200 dark:border-gray-700",onClick:()=>z(!p),title:`${x.length-D} more tabs`,children:[e.jsx(Ie,{className:"w-4 h-4"}),e.jsx(Oe,{className:"w-3 h-3 ml-1"})]}),p&&e.jsx("div",{className:"absolute top-full right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 min-w-48 max-h-64 overflow-y-auto",children:x.slice(D).map(t=>e.jsxs("div",{className:`flex items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 ${t.isActive?"bg-blue-50 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"} ${t.isPinned?"":"italic"}`,onClick:()=>{ce(t.id),z(!1)},title:`${t.path} ${t.isPinned?"(固定)":"(临时)"}`,children:[e.jsx(q,{node:{data:{name:t.name,isDirectory:!1},isOpen:!1}}),e.jsx("span",{className:"ml-2 truncate flex-1",children:t.name}),!t.isPinned&&e.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),e.jsx("button",{className:"ml-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:s=>{s.stopPropagation(),ae(t.id)},title:a("common:actions.close"),children:e.jsx(ie,{className:"w-3 h-3"})})]},t.id))})]})]}):e.jsx("div",{className:"flex items-center justify-center w-full h-full text-gray-500 dark:text-gray-400",children:e.jsx("span",{className:"text-sm",children:a("fileExplorer.noFiles")})})]}),e.jsx("div",{className:"flex-1 bg-gray-50 dark:bg-gray-900 min-h-0",children:ze()})]})]})};export{me as E,ut as F,xe as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./data-structures-C0h9Oap1.js";import{r as i}from"./monaco-editor-DHKm5-VF.js";import{b as T,d as A,e as D,i as U,f as V}from"./index-UPEozv-J.js";import{u as L}from"./tools-C0JOzoE_.js";import{r as h,K as G,M,N as b,O as R,Q as W,G as _,R as F,U as O,V as c,Y as P,_ as K,$ as H,e as Q,a0 as u,a1 as y,a2 as z,j as p}from"./ui-components-CRCmgMKc.js";import"./syntax-highlighting-CnREyncB.js";import"./agents-DG431Wop.js";const te=()=>{const{t:s,i18n:d}=L("pages"),{isMobile:a}=T(),[n,k]=i.useState(()=>localStorage.getItem("theme")||"auto"),[j,g]=i.useState(d.language),{currentVersion:x,latestVersion:o,hasUpdate:N,forceCheck:f,isChecking:m,dismissUpdate:v,showUpdateNotification:w}=A(),{systemInfo:r,refetch:C}=D(),[l,$]=i.useState(U());i.useEffect(()=>{g(d.language)},[d.language]),i.useEffect(()=>{(()=>{n==="dark"?document.documentElement.classList.add("dark"):n==="light"?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")})(),localStorage.setItem("theme",n),window.dispatchEvent(new Event("themechange"))},[n]);const S=t=>{g(t),d.changeLanguage(t)},E=()=>{f(),C()},I=()=>{const t=!l;V(t),$(t)};return e.jsxs("div",{className:`${a?"space-y-4":"space-y-6"}`,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:`${a?"text-xl":"text-2xl"} font-bold text-gray-900 dark:text-white mb-2 flex items-center gap-2`,children:[e.jsx(h,{className:"w-6 h-6"}),s("settings.general.title")]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:s("settings.general.description")})]}),w&&o&&e.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/30 dark:to-indigo-900/30 border border-blue-200 dark:border-blue-800 rounded-xl p-4",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-800 rounded-full",children:e.jsx(G,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-blue-900 dark:text-blue-100",children:s("settings.systemInfo.updateAvailable")}),e.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 mt-1",children:s("version.newVersionAvailable",{version:o})}),e.jsxs("div",{className:"mt-3 flex space-x-2",children:[e.jsxs("a",{href:"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700",children:[e.jsx(M,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.viewReleases")]}),e.jsx("button",{onClick:v,className:"px-3 py-1.5 text-blue-700 dark:text-blue-300 text-sm bg-blue-100 dark:bg-blue-800 hover:bg-blue-200 dark:hover:bg-blue-700 rounded-lg",children:s("version.dismiss")})]})]})]})})}),e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${a?"p-4":"p-6"}`,children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2`,children:[e.jsx(b,{className:"w-5 h-5"}),s("settings.general.interfaceSettings")]}),e.jsxs("div",{className:`${a?"space-y-4":"space-y-6"}`,children:[e.jsxs("div",{children:[e.jsx("label",{className:"block font-medium text-gray-900 dark:text-white mb-2",children:s("settings.general.theme.label")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.theme.description")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-3 gap-3"}`,children:[{value:"auto",label:s("settings.general.theme.auto"),icon:b},{value:"light",label:s("settings.general.theme.light"),icon:R},{value:"dark",label:s("settings.general.theme.dark"),icon:W}].map(t=>e.jsxs("button",{onClick:()=>k(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center ${a?"flex-row space-x-3":"flex-col space-y-2"} transition-all ${n===t.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(t.icon,{className:`${a?"w-5 h-5":"w-6 h-6"}`}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.value))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block font-medium text-gray-900 dark:text-white mb-2 flex items-center space-x-2",children:[e.jsx(_,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:s("settings.general.language.label")})]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.language.description")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-3"}`,children:[{value:"zh-CN",label:"中文简体",flag:"🇨🇳"},{value:"en-US",label:"English",flag:"🇺🇸"}].map(t=>e.jsxs("button",{onClick:()=>S(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center space-x-3 transition-all ${j===t.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx("span",{className:`${a?"text-xl":"text-2xl"}`,children:t.flag}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.value))})]})]})]}),e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${a?"p-4":"p-6"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white flex items-center gap-2`,children:[e.jsx(F,{className:"w-5 h-5"}),s("settings.systemInfo.title")]}),e.jsxs("button",{onClick:E,disabled:m,className:"inline-flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 disabled:opacity-50",children:[e.jsx(O,{className:`w-3 h-3 mr-1 ${m?"animate-spin":""}`}),s("settings.systemInfo.checkUpdate")]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(c,{className:"w-4 h-4"}),s("settings.systemInfo.currentVersion")]}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"font-mono text-gray-900 dark:text-white",children:["v",x||r?.app.version||"-"]}),!N&&x&&e.jsxs("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",children:[e.jsx(P,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.upToDate")]})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(K,{className:"w-4 h-4"}),"Node.js"]}),e.jsx("p",{className:"font-mono text-gray-900 dark:text-white",children:r?.runtime.nodeVersion||"-"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:s("settings.systemInfo.platform")}),e.jsxs("p",{className:"text-gray-900 dark:text-white capitalize",children:[r?.runtime.platform||"-"," (",r?.runtime.arch||"-",")"]})]})]}),r?.sdk&&e.jsxs("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-3 flex items-center gap-2",children:[e.jsx(h,{className:"w-4 h-4"}),"Agent SDK Configuration"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-blue-700 dark:text-blue-300 mb-1",children:"SDK Engine"}),e.jsxs("div",{className:"font-mono text-sm text-blue-900 dark:text-blue-100 font-medium",children:[r.sdk.engine==="claude-code"&&"🤖 Claude Code (Default)",r.sdk.engine==="claude-internal"&&"🔒 Claude Internal",r.sdk.engine==="code-buddy"&&"🤝 Code Buddy (Coming Soon)",!["claude-code","claude-internal","code-buddy"].includes(r.sdk.engine)&&r.sdk.engine]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-blue-700 dark:text-blue-300 mb-1",children:"SDK Directory"}),e.jsx("div",{className:"font-mono text-xs text-blue-900 dark:text-blue-100 break-all",children:r.sdk.directory})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[e.jsxs("a",{href:r?.links.github||"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(H,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"GitHub"})]}),e.jsxs("a",{href:r?.links.releases||"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(c,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"Releases"})]}),e.jsxs("a",{href:r?.links.changelog||"https://github.com/okguitar/agentstudio/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(Q,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"Changelog"})]}),e.jsxs("a",{href:r?.links.npm||"https://www.npmjs.com/package/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(c,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"npm"})]})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsxs("div",{className:`${a?"p-4":"p-6"}`,children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2`,children:[e.jsx(u,{className:"w-5 h-5"}),s("settings.telemetry.title","Telemetry & Analytics")]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${l?"bg-blue-100 dark:bg-blue-900/30":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(u,{className:`w-5 h-5 ${l?"text-blue-600 dark:text-blue-400":"text-gray-500"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:s("settings.telemetry.enableTelemetry","Enable Anonymous Telemetry")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s("settings.telemetry.enableDescription","Help improve AgentStudio by sharing anonymous usage data")})]})]}),e.jsx("button",{onClick:I,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${l?"bg-blue-600":"bg-gray-300 dark:bg-gray-600"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${l?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsx("div",{className:`px-4 py-2 border-t ${l?"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800":"bg-gray-50 dark:bg-gray-700/50 border-gray-200 dark:border-gray-700"}`,children:e.jsx("div",{className:"flex items-center gap-2 text-sm",children:l?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsx("span",{className:"text-green-700 dark:text-green-400",children:s("settings.telemetry.statusEnabled","Telemetry is enabled. Thank you for helping improve AgentStudio!")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s("settings.telemetry.statusDisabled","Telemetry is disabled. No data is being collected.")})]})})}),e.jsxs("details",{className:"border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("summary",{className:"px-4 py-3 cursor-pointer text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 flex items-center gap-2",children:[e.jsx(p,{className:"w-4 h-4"}),s("settings.telemetry.privacyDetails","Privacy & Data Collection Details")]}),e.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center gap-2 text-sm",children:[e.jsx(y,{className:"w-4 h-4 text-green-500"}),s("settings.telemetry.whatWeCollect","What We Collect")]}),e.jsxs("ul",{className:"space-y-1 text-xs text-gray-600 dark:text-gray-300",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.installId","Anonymous Installation ID")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.version","App Version & OS")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.features","Feature Usage")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.errors","Error Reports")]})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center gap-2 text-sm",children:[e.jsx(p,{className:"w-4 h-4 text-red-500"}),s("settings.telemetry.whatWeNeverCollect","What We Never Collect")]}),e.jsxs("ul",{className:"space-y-1 text-xs text-gray-600 dark:text-gray-300",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.files","File contents, code, or project data")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.keys","API keys, passwords, or credentials")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.pii","Personal identifying information")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.conversations","Chat conversations or AI responses")]})]})]})]})]})]})]})};export{te as GeneralSettingsPage};
|
|
1
|
+
import{j as e}from"./data-structures-ChC1tqVg.js";import{r as i}from"./monaco-editor-BWfQfpij.js";import{b as T,d as A,e as D,i as U,f as V}from"./index-BEPv9Bqe.js";import{u as L}from"./tools-BAI9XHGS.js";import{r as h,K as G,M,N as b,O as R,Q as W,G as _,R as F,U as O,V as c,Y as P,_ as K,$ as H,e as Q,a0 as u,a1 as y,a2 as z,j as p}from"./ui-components-DaGtjl0g.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-3mB536QF.js";const te=()=>{const{t:s,i18n:d}=L("pages"),{isMobile:a}=T(),[n,k]=i.useState(()=>localStorage.getItem("theme")||"auto"),[j,g]=i.useState(d.language),{currentVersion:x,latestVersion:o,hasUpdate:N,forceCheck:f,isChecking:m,dismissUpdate:v,showUpdateNotification:w}=A(),{systemInfo:r,refetch:C}=D(),[l,$]=i.useState(U());i.useEffect(()=>{g(d.language)},[d.language]),i.useEffect(()=>{(()=>{n==="dark"?document.documentElement.classList.add("dark"):n==="light"?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")})(),localStorage.setItem("theme",n),window.dispatchEvent(new Event("themechange"))},[n]);const S=t=>{g(t),d.changeLanguage(t)},E=()=>{f(),C()},I=()=>{const t=!l;V(t),$(t)};return e.jsxs("div",{className:`${a?"space-y-4":"space-y-6"}`,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:`${a?"text-xl":"text-2xl"} font-bold text-gray-900 dark:text-white mb-2 flex items-center gap-2`,children:[e.jsx(h,{className:"w-6 h-6"}),s("settings.general.title")]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:s("settings.general.description")})]}),w&&o&&e.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/30 dark:to-indigo-900/30 border border-blue-200 dark:border-blue-800 rounded-xl p-4",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-800 rounded-full",children:e.jsx(G,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-blue-900 dark:text-blue-100",children:s("settings.systemInfo.updateAvailable")}),e.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 mt-1",children:s("version.newVersionAvailable",{version:o})}),e.jsxs("div",{className:"mt-3 flex space-x-2",children:[e.jsxs("a",{href:"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700",children:[e.jsx(M,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.viewReleases")]}),e.jsx("button",{onClick:v,className:"px-3 py-1.5 text-blue-700 dark:text-blue-300 text-sm bg-blue-100 dark:bg-blue-800 hover:bg-blue-200 dark:hover:bg-blue-700 rounded-lg",children:s("version.dismiss")})]})]})]})})}),e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${a?"p-4":"p-6"}`,children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2`,children:[e.jsx(b,{className:"w-5 h-5"}),s("settings.general.interfaceSettings")]}),e.jsxs("div",{className:`${a?"space-y-4":"space-y-6"}`,children:[e.jsxs("div",{children:[e.jsx("label",{className:"block font-medium text-gray-900 dark:text-white mb-2",children:s("settings.general.theme.label")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.theme.description")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-3 gap-3"}`,children:[{value:"auto",label:s("settings.general.theme.auto"),icon:b},{value:"light",label:s("settings.general.theme.light"),icon:R},{value:"dark",label:s("settings.general.theme.dark"),icon:W}].map(t=>e.jsxs("button",{onClick:()=>k(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center ${a?"flex-row space-x-3":"flex-col space-y-2"} transition-all ${n===t.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(t.icon,{className:`${a?"w-5 h-5":"w-6 h-6"}`}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.value))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block font-medium text-gray-900 dark:text-white mb-2 flex items-center space-x-2",children:[e.jsx(_,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:s("settings.general.language.label")})]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.language.description")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-3"}`,children:[{value:"zh-CN",label:"中文简体",flag:"🇨🇳"},{value:"en-US",label:"English",flag:"🇺🇸"}].map(t=>e.jsxs("button",{onClick:()=>S(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center space-x-3 transition-all ${j===t.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx("span",{className:`${a?"text-xl":"text-2xl"}`,children:t.flag}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.value))})]})]})]}),e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${a?"p-4":"p-6"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white flex items-center gap-2`,children:[e.jsx(F,{className:"w-5 h-5"}),s("settings.systemInfo.title")]}),e.jsxs("button",{onClick:E,disabled:m,className:"inline-flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 disabled:opacity-50",children:[e.jsx(O,{className:`w-3 h-3 mr-1 ${m?"animate-spin":""}`}),s("settings.systemInfo.checkUpdate")]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(c,{className:"w-4 h-4"}),s("settings.systemInfo.currentVersion")]}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"font-mono text-gray-900 dark:text-white",children:["v",x||r?.app.version||"-"]}),!N&&x&&e.jsxs("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",children:[e.jsx(P,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.upToDate")]})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(K,{className:"w-4 h-4"}),"Node.js"]}),e.jsx("p",{className:"font-mono text-gray-900 dark:text-white",children:r?.runtime.nodeVersion||"-"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:s("settings.systemInfo.platform")}),e.jsxs("p",{className:"text-gray-900 dark:text-white capitalize",children:[r?.runtime.platform||"-"," (",r?.runtime.arch||"-",")"]})]})]}),r?.sdk&&e.jsxs("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-3 flex items-center gap-2",children:[e.jsx(h,{className:"w-4 h-4"}),"Agent SDK Configuration"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-blue-700 dark:text-blue-300 mb-1",children:"SDK Engine"}),e.jsxs("div",{className:"font-mono text-sm text-blue-900 dark:text-blue-100 font-medium",children:[r.sdk.engine==="claude-code"&&"🤖 Claude Code (Default)",r.sdk.engine==="claude-internal"&&"🔒 Claude Internal",r.sdk.engine==="code-buddy"&&"🤝 Code Buddy (Coming Soon)",!["claude-code","claude-internal","code-buddy"].includes(r.sdk.engine)&&r.sdk.engine]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-blue-700 dark:text-blue-300 mb-1",children:"SDK Directory"}),e.jsx("div",{className:"font-mono text-xs text-blue-900 dark:text-blue-100 break-all",children:r.sdk.directory})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[e.jsxs("a",{href:r?.links.github||"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(H,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"GitHub"})]}),e.jsxs("a",{href:r?.links.releases||"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(c,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"Releases"})]}),e.jsxs("a",{href:r?.links.changelog||"https://github.com/okguitar/agentstudio/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(Q,{className:"w-4 h-4 text-gray-700 dark:text-gray-300"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"Changelog"})]}),e.jsxs("a",{href:r?.links.npm||"https://www.npmjs.com/package/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-sm",children:[e.jsx(c,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-gray-900 dark:text-white",children:"npm"})]})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsxs("div",{className:`${a?"p-4":"p-6"}`,children:[e.jsxs("h2",{className:`${a?"text-base":"text-lg"} font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2`,children:[e.jsx(u,{className:"w-5 h-5"}),s("settings.telemetry.title","Telemetry & Analytics")]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${l?"bg-blue-100 dark:bg-blue-900/30":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(u,{className:`w-5 h-5 ${l?"text-blue-600 dark:text-blue-400":"text-gray-500"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:s("settings.telemetry.enableTelemetry","Enable Anonymous Telemetry")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s("settings.telemetry.enableDescription","Help improve AgentStudio by sharing anonymous usage data")})]})]}),e.jsx("button",{onClick:I,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${l?"bg-blue-600":"bg-gray-300 dark:bg-gray-600"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${l?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsx("div",{className:`px-4 py-2 border-t ${l?"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800":"bg-gray-50 dark:bg-gray-700/50 border-gray-200 dark:border-gray-700"}`,children:e.jsx("div",{className:"flex items-center gap-2 text-sm",children:l?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsx("span",{className:"text-green-700 dark:text-green-400",children:s("settings.telemetry.statusEnabled","Telemetry is enabled. Thank you for helping improve AgentStudio!")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s("settings.telemetry.statusDisabled","Telemetry is disabled. No data is being collected.")})]})})}),e.jsxs("details",{className:"border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("summary",{className:"px-4 py-3 cursor-pointer text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 flex items-center gap-2",children:[e.jsx(p,{className:"w-4 h-4"}),s("settings.telemetry.privacyDetails","Privacy & Data Collection Details")]}),e.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center gap-2 text-sm",children:[e.jsx(y,{className:"w-4 h-4 text-green-500"}),s("settings.telemetry.whatWeCollect","What We Collect")]}),e.jsxs("ul",{className:"space-y-1 text-xs text-gray-600 dark:text-gray-300",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.installId","Anonymous Installation ID")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.version","App Version & OS")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.features","Feature Usage")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"✓"}),s("settings.telemetry.collect.errors","Error Reports")]})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2 flex items-center gap-2 text-sm",children:[e.jsx(p,{className:"w-4 h-4 text-red-500"}),s("settings.telemetry.whatWeNeverCollect","What We Never Collect")]}),e.jsxs("ul",{className:"space-y-1 text-xs text-gray-600 dark:text-gray-300",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.files","File contents, code, or project data")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.keys","API keys, passwords, or credentials")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.pii","Personal identifying information")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-red-500",children:"✗"}),s("settings.telemetry.neverCollect.conversations","Chat conversations or AI responses")]})]})]})]})]})]})]})};export{te as GeneralSettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./data-structures-C0h9Oap1.js";import{r as d}from"./monaco-editor-DHKm5-VF.js";import{u}from"./tools-C0JOzoE_.js";import{ah as N,e as k,$ as f,G as g,ai as w,Z as o,Y as t,I as h,N as v,a2 as i,aj as C,f as A,o as p,m as S,ak as F,t as E,X as s}from"./ui-components-CRCmgMKc.js";import{L as y}from"./index-UPEozv-J.js";import"./syntax-highlighting-CnREyncB.js";import"./agents-DG431Wop.js";const G=()=>{const{t:a,i18n:r}=u("pages"),[x,c]=d.useState(!1),[j,n]=d.useState(!1),b=()=>{const l=r.language==="zh-CN"?"en-US":"zh-CN";r.changeLanguage(l)},m=()=>{navigator.clipboard.writeText("npm install -g agentstudio && agentstudio start"),c(!0),setTimeout(()=>c(!1),2e3)};return d.useEffect(()=>{document.title=a("landing.pageTitle");const l=document.querySelector('meta[name="description"]');l&&l.setAttribute("content",a("landing.metaDescription"))},[a]),e.jsxs("div",{className:"min-h-screen bg-white dark:bg-gray-950",children:[e.jsx("nav",{className:"bg-white/90 dark:bg-gray-950/90 backdrop-blur-sm border-b border-gray-100 dark:border-gray-800 sticky top-0 z-50",children:e.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("img",{src:"/cc-studio.png",alt:"AgentStudio",className:"w-8 h-8"}),e.jsx("span",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"AgentStudio"})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("button",{onClick:()=>n(!0),className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 transition-colors",children:[e.jsx(N,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:a("landing.nav.wechat")||"微信群"})]}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio/blob/main/docs/USER_MANUAL.md",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",children:[e.jsx(k,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:a("landing.nav.docs")})]}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",children:[e.jsx(f,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"GitHub"})]}),e.jsxs("button",{onClick:b,className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",title:r.language==="zh-CN"?"Switch to English":"切换到中文",children:[e.jsx(g,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:r.language==="zh-CN"?"EN":"中文"})]}),e.jsxs(y,{to:"/dashboard",className:"inline-flex items-center px-4 py-2 bg-gray-900 dark:bg-white hover:bg-gray-800 dark:hover:bg-gray-100 text-white dark:text-gray-900 font-medium rounded-lg transition-colors duration-200",children:[a("landing.nav.enterWorkspace"),e.jsx(w,{className:"ml-2 w-4 h-4"})]})]})]})})}),e.jsx("section",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-gray-100 dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400 mb-6",children:[e.jsx(o,{className:"w-4 h-4 mr-2 text-amber-500"}),a("landing.hero.badge")]}),e.jsx("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold text-gray-900 dark:text-white mb-6 leading-tight",children:a("landing.hero.title")}),e.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-400 mb-4 max-w-2xl mx-auto",children:a("landing.hero.subtitle")}),e.jsx("p",{className:"text-lg text-gray-500 dark:text-gray-500 mb-8 max-w-2xl mx-auto",children:a("landing.hero.description")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:a("landing.hero.installHint")}),e.jsx("div",{className:"bg-gray-900 dark:bg-gray-800 rounded-xl p-4 max-w-xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("code",{className:"text-green-400 text-sm sm:text-base font-mono flex-1",children:"npm install -g agentstudio && agentstudio start"}),e.jsx("button",{onClick:m,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-gray-200 rounded-lg transition-colors flex items-center gap-1.5 text-sm flex-shrink-0 min-w-[72px] justify-center",title:a("landing.hero.copyCommand"),children:x?e.jsx(t,{className:"w-4 h-4 text-green-400"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-4 h-4"}),e.jsx("span",{children:a("landing.hero.copy")})]})})]})})]})}),e.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-3",children:a("landing.preview.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:a("landing.preview.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"group",children:[e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-lg hover:shadow-xl transition-shadow",children:e.jsx("img",{src:"/screenshot-chat.png",alt:a("landing.preview.chatAlt"),className:"w-full h-auto"})}),e.jsx("p",{className:"text-center mt-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.preview.chatCaption")})]}),e.jsxs("div",{className:"group",children:[e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-lg hover:shadow-xl transition-shadow",children:e.jsx("img",{src:"/screenshot-mcp.png",alt:a("landing.preview.mcpAlt"),className:"w-full h-auto"})}),e.jsx("p",{className:"text-center mt-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.preview.mcpCaption")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.features.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 max-w-2xl mx-auto",children:a("landing.features.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(v,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.localWorkspace.title")}),e.jsxs("ul",{className:"space-y-2 text-gray-600 dark:text-gray-400",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point1")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point2")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point3")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(g,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.webExperience.title")}),e.jsxs("ul",{className:"space-y-2 text-gray-600 dark:text-gray-400",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx(o,{className:"w-5 h-5 mr-2 mt-0.5 text-amber-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point1")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(C,{className:"w-5 h-5 mr-2 mt-0.5 text-purple-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point2")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(A,{className:"w-5 h-5 mr-2 mt-0.5 text-blue-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point3")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(p,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.sdkFeatures.title")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:"MCP"}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.skills")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.commands")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.plugins")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.memory")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.subagent")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.multiModel")})]}),e.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-500",children:a("landing.features.sdkFeatures.anthropicCompat")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 text-sm mb-4",children:[e.jsx(S,{className:"w-4 h-4 mr-2"}),a("landing.scheduler.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.scheduler.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 mb-8",children:a("landing.scheduler.description")})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-2xl p-6 border border-gray-100 dark:border-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4",children:a("landing.scheduler.scenariosTitle")}),e.jsxs("ul",{className:"space-y-4",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📊"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario1.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario1.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"🔍"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario2.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario2.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📝"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario3.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario3.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📈"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario4.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario4.desc")})]})]})]})]})]})})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[e.jsxs("div",{className:"order-2 lg:order-1 bg-white dark:bg-gray-800 rounded-2xl p-6 border border-gray-100 dark:border-gray-700",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4",children:a("landing.a2a.scenariosTitle")}),e.jsxs("ul",{className:"space-y-4",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"🤵"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario1.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario1.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"💻"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario2.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario2.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📱"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario3.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario3.desc")})]})]})]})]}),e.jsxs("div",{className:"order-1 lg:order-2",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 text-sm mb-4",children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),a("landing.a2a.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.a2a.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400",children:a("landing.a2a.description")})]})]})})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 text-sm mb-4",children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),a("landing.customAgent.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.customAgent.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 max-w-2xl mx-auto",children:a("landing.customAgent.description")})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"📊"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example1")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"🤵"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example2")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"📝"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example3")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"🔍"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example4")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.comparison.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400",children:a("landing.comparison.subtitle")})]}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-100 dark:border-gray-700 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-700",children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400",children:a("landing.comparison.dimension")}),e.jsx("th",{className:"px-6 py-4 text-center text-sm font-semibold text-gray-900 dark:text-white",children:"AgentStudio"}),e.jsx("th",{className:"px-6 py-4 text-center text-sm font-medium text-gray-500 dark:text-gray-400",children:"Claude Code"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:[e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.interface")}),e.jsxs("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:["Web ",a("landing.comparison.webInterface")]}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.cli")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.targetUsers")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:a("landing.comparison.everyone")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.developers")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.toolDisplay")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:a("landing.comparison.visual")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.textOnly")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.fileBrowser")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.agentCustom")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.scheduler")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.a2a")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.mobileAccess")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-amber-600 dark:text-amber-400",children:a("landing.comparison.beta")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]})]})]})})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-6",children:a("landing.cta.title")}),e.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-400 mb-8",children:a("landing.cta.subtitle")}),e.jsx("div",{className:"bg-gray-900 dark:bg-gray-800 rounded-xl p-4 max-w-xl mx-auto mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("code",{className:"text-green-400 text-sm sm:text-base font-mono flex-1",children:"npm install -g agentstudio && agentstudio start"}),e.jsx("button",{onClick:m,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-gray-200 rounded-lg transition-colors flex items-center gap-1.5 text-sm flex-shrink-0 min-w-[72px] justify-center",title:a("landing.hero.copyCommand"),children:x?e.jsx(t,{className:"w-4 h-4 text-green-400"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-4 h-4"}),e.jsx("span",{children:a("landing.hero.copy")})]})})]})}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-8 py-4 bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 font-semibold rounded-xl border border-gray-200 dark:border-gray-700 transition-all duration-200",children:[e.jsx(p,{className:"mr-2 w-5 h-5"}),"GitHub"]})]})}),e.jsx("footer",{className:"bg-gray-900 text-gray-300 py-12 px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[e.jsxs("div",{className:"col-span-1 md:col-span-2",children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[e.jsx("img",{src:"/cc-studio.png",alt:"AgentStudio",className:"w-8 h-8"}),e.jsx("span",{className:"text-xl font-semibold text-white",children:"AgentStudio"})]}),e.jsx("p",{className:"text-gray-400 mb-4 max-w-md",children:a("landing.footer.description")}),e.jsx("div",{className:"text-sm text-gray-500",children:a("landing.footer.copyright")})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-4",children:a("landing.footer.product")}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:e.jsx(y,{to:"/dashboard",className:"hover:text-white transition-colors",children:a("landing.footer.workspace")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.sourceCode")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.releases")})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-4",children:a("landing.footer.support")}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/blob/main/docs/USER_MANUAL.md",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.documentation")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/issues",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.issues")})}),e.jsx("li",{children:e.jsx("button",{onClick:()=>n(!0),className:"hover:text-white transition-colors text-left w-full",children:a("landing.footer.wechat")||"微信群"})})]})]})]})})}),j&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 relative",children:[e.jsx("button",{onClick:()=>n(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:e.jsx(s,{className:"w-5 h-5"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:a("landing.wechat.title")||"加入微信群"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/wechat-qr-code.png",alt:"WeChat QR Code",className:"w-64 h-64 object-contain border border-gray-200 dark:border-gray-700 rounded-lg"})}),e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 text-center",children:[a("landing.wechat.fallback")||"二维码失效?请添加微信号:",e.jsx("span",{className:"font-mono font-semibold ml-1",children:a("landing.wechat.wechatId")||"your-wechat-id"})]})}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 text-center",children:a("landing.wechat.tip")||"扫码或添加微信号,即可加入交流群"})]})]})})]})};export{G as default};
|
|
1
|
+
import{j as e}from"./data-structures-ChC1tqVg.js";import{r as d}from"./monaco-editor-BWfQfpij.js";import{u}from"./tools-BAI9XHGS.js";import{ah as N,e as k,$ as f,G as g,ai as w,Z as o,Y as t,I as h,N as v,a2 as i,aj as C,f as A,o as p,m as S,ak as F,t as E,X as s}from"./ui-components-DaGtjl0g.js";import{L as y}from"./index-BEPv9Bqe.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-3mB536QF.js";const G=()=>{const{t:a,i18n:r}=u("pages"),[x,c]=d.useState(!1),[j,n]=d.useState(!1),b=()=>{const l=r.language==="zh-CN"?"en-US":"zh-CN";r.changeLanguage(l)},m=()=>{navigator.clipboard.writeText("npm install -g agentstudio && agentstudio start"),c(!0),setTimeout(()=>c(!1),2e3)};return d.useEffect(()=>{document.title=a("landing.pageTitle");const l=document.querySelector('meta[name="description"]');l&&l.setAttribute("content",a("landing.metaDescription"))},[a]),e.jsxs("div",{className:"min-h-screen bg-white dark:bg-gray-950",children:[e.jsx("nav",{className:"bg-white/90 dark:bg-gray-950/90 backdrop-blur-sm border-b border-gray-100 dark:border-gray-800 sticky top-0 z-50",children:e.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-16",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("img",{src:"/cc-studio.png",alt:"AgentStudio",className:"w-8 h-8"}),e.jsx("span",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"AgentStudio"})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("button",{onClick:()=>n(!0),className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 transition-colors",children:[e.jsx(N,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:a("landing.nav.wechat")||"微信群"})]}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio/blob/main/docs/USER_MANUAL.md",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",children:[e.jsx(k,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:a("landing.nav.docs")})]}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",children:[e.jsx(f,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"GitHub"})]}),e.jsxs("button",{onClick:b,className:"inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",title:r.language==="zh-CN"?"Switch to English":"切换到中文",children:[e.jsx(g,{className:"w-5 h-5 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:r.language==="zh-CN"?"EN":"中文"})]}),e.jsxs(y,{to:"/dashboard",className:"inline-flex items-center px-4 py-2 bg-gray-900 dark:bg-white hover:bg-gray-800 dark:hover:bg-gray-100 text-white dark:text-gray-900 font-medium rounded-lg transition-colors duration-200",children:[a("landing.nav.enterWorkspace"),e.jsx(w,{className:"ml-2 w-4 h-4"})]})]})]})})}),e.jsx("section",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-gray-100 dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400 mb-6",children:[e.jsx(o,{className:"w-4 h-4 mr-2 text-amber-500"}),a("landing.hero.badge")]}),e.jsx("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold text-gray-900 dark:text-white mb-6 leading-tight",children:a("landing.hero.title")}),e.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-400 mb-4 max-w-2xl mx-auto",children:a("landing.hero.subtitle")}),e.jsx("p",{className:"text-lg text-gray-500 dark:text-gray-500 mb-8 max-w-2xl mx-auto",children:a("landing.hero.description")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:a("landing.hero.installHint")}),e.jsx("div",{className:"bg-gray-900 dark:bg-gray-800 rounded-xl p-4 max-w-xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("code",{className:"text-green-400 text-sm sm:text-base font-mono flex-1",children:"npm install -g agentstudio && agentstudio start"}),e.jsx("button",{onClick:m,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-gray-200 rounded-lg transition-colors flex items-center gap-1.5 text-sm flex-shrink-0 min-w-[72px] justify-center",title:a("landing.hero.copyCommand"),children:x?e.jsx(t,{className:"w-4 h-4 text-green-400"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-4 h-4"}),e.jsx("span",{children:a("landing.hero.copy")})]})})]})})]})}),e.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-3",children:a("landing.preview.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:a("landing.preview.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"group",children:[e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-lg hover:shadow-xl transition-shadow",children:e.jsx("img",{src:"/screenshot-chat.png",alt:a("landing.preview.chatAlt"),className:"w-full h-auto"})}),e.jsx("p",{className:"text-center mt-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.preview.chatCaption")})]}),e.jsxs("div",{className:"group",children:[e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-lg hover:shadow-xl transition-shadow",children:e.jsx("img",{src:"/screenshot-mcp.png",alt:a("landing.preview.mcpAlt"),className:"w-full h-auto"})}),e.jsx("p",{className:"text-center mt-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.preview.mcpCaption")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-16",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.features.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 max-w-2xl mx-auto",children:a("landing.features.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(v,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.localWorkspace.title")}),e.jsxs("ul",{className:"space-y-2 text-gray-600 dark:text-gray-400",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point1")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point2")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(i,{className:"w-5 h-5 mr-2 mt-0.5 text-green-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.localWorkspace.point3")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(g,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.webExperience.title")}),e.jsxs("ul",{className:"space-y-2 text-gray-600 dark:text-gray-400",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx(o,{className:"w-5 h-5 mr-2 mt-0.5 text-amber-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point1")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(C,{className:"w-5 h-5 mr-2 mt-0.5 text-purple-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point2")})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx(A,{className:"w-5 h-5 mr-2 mt-0.5 text-blue-500 flex-shrink-0"}),e.jsx("span",{children:a("landing.features.webExperience.point3")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl border border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-xl flex items-center justify-center mb-6",children:e.jsx(p,{className:"w-6 h-6 text-gray-700 dark:text-gray-300"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:a("landing.features.sdkFeatures.title")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:"MCP"}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.skills")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.commands")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.plugins")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.memory")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.subagent")}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-sm",children:a("landing.features.sdkFeatures.multiModel")})]}),e.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-500",children:a("landing.features.sdkFeatures.anthropicCompat")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 text-sm mb-4",children:[e.jsx(S,{className:"w-4 h-4 mr-2"}),a("landing.scheduler.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.scheduler.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 mb-8",children:a("landing.scheduler.description")})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-2xl p-6 border border-gray-100 dark:border-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4",children:a("landing.scheduler.scenariosTitle")}),e.jsxs("ul",{className:"space-y-4",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📊"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario1.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario1.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"🔍"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario2.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario2.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📝"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario3.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario3.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📈"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.scheduler.scenario4.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.scheduler.scenario4.desc")})]})]})]})]})]})})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[e.jsxs("div",{className:"order-2 lg:order-1 bg-white dark:bg-gray-800 rounded-2xl p-6 border border-gray-100 dark:border-gray-700",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4",children:a("landing.a2a.scenariosTitle")}),e.jsxs("ul",{className:"space-y-4",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"🤵"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario1.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario1.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"💻"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario2.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario2.desc")})]})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-2xl mr-3",children:"📱"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.a2a.scenario3.title")}),e.jsx("p",{className:"text-gray-500 dark:text-gray-500 text-sm",children:a("landing.a2a.scenario3.desc")})]})]})]})]}),e.jsxs("div",{className:"order-1 lg:order-2",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 text-sm mb-4",children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),a("landing.a2a.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.a2a.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400",children:a("landing.a2a.description")})]})]})})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsxs("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 text-sm mb-4",children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),a("landing.customAgent.badge")]}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.customAgent.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400 max-w-2xl mx-auto",children:a("landing.customAgent.description")})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"📊"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example1")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"🤵"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example2")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"📝"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example3")})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-xl border border-gray-100 dark:border-gray-700 text-center",children:[e.jsx("span",{className:"text-4xl mb-3 block",children:"🔍"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a("landing.customAgent.example4")})]})]})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:a("landing.comparison.title")}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-400",children:a("landing.comparison.subtitle")})]}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl border border-gray-100 dark:border-gray-700 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-700",children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400",children:a("landing.comparison.dimension")}),e.jsx("th",{className:"px-6 py-4 text-center text-sm font-semibold text-gray-900 dark:text-white",children:"AgentStudio"}),e.jsx("th",{className:"px-6 py-4 text-center text-sm font-medium text-gray-500 dark:text-gray-400",children:"Claude Code"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:[e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.interface")}),e.jsxs("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:["Web ",a("landing.comparison.webInterface")]}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.cli")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.targetUsers")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:a("landing.comparison.everyone")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.developers")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.toolDisplay")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-900 dark:text-white",children:a("landing.comparison.visual")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-gray-500 dark:text-gray-500",children:a("landing.comparison.textOnly")})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.fileBrowser")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.agentCustom")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.scheduler")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.a2a")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(t,{className:"w-5 h-5 text-green-500 mx-auto"})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 dark:text-gray-400",children:a("landing.comparison.mobileAccess")}),e.jsx("td",{className:"px-6 py-4 text-center text-sm text-amber-600 dark:text-amber-400",children:a("landing.comparison.beta")}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx(s,{className:"w-5 h-5 text-gray-300 dark:text-gray-600 mx-auto"})})]})]})]})})]})}),e.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-6",children:a("landing.cta.title")}),e.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-400 mb-8",children:a("landing.cta.subtitle")}),e.jsx("div",{className:"bg-gray-900 dark:bg-gray-800 rounded-xl p-4 max-w-xl mx-auto mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("code",{className:"text-green-400 text-sm sm:text-base font-mono flex-1",children:"npm install -g agentstudio && agentstudio start"}),e.jsx("button",{onClick:m,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-gray-200 rounded-lg transition-colors flex items-center gap-1.5 text-sm flex-shrink-0 min-w-[72px] justify-center",title:a("landing.hero.copyCommand"),children:x?e.jsx(t,{className:"w-4 h-4 text-green-400"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-4 h-4"}),e.jsx("span",{children:a("landing.hero.copy")})]})})]})}),e.jsxs("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-8 py-4 bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 font-semibold rounded-xl border border-gray-200 dark:border-gray-700 transition-all duration-200",children:[e.jsx(p,{className:"mr-2 w-5 h-5"}),"GitHub"]})]})}),e.jsx("footer",{className:"bg-gray-900 text-gray-300 py-12 px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[e.jsxs("div",{className:"col-span-1 md:col-span-2",children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[e.jsx("img",{src:"/cc-studio.png",alt:"AgentStudio",className:"w-8 h-8"}),e.jsx("span",{className:"text-xl font-semibold text-white",children:"AgentStudio"})]}),e.jsx("p",{className:"text-gray-400 mb-4 max-w-md",children:a("landing.footer.description")}),e.jsx("div",{className:"text-sm text-gray-500",children:a("landing.footer.copyright")})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-4",children:a("landing.footer.product")}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:e.jsx(y,{to:"/dashboard",className:"hover:text-white transition-colors",children:a("landing.footer.workspace")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.sourceCode")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/releases",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.releases")})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-4",children:a("landing.footer.support")}),e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/blob/main/docs/USER_MANUAL.md",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.documentation")})}),e.jsx("li",{children:e.jsx("a",{href:"https://github.com/okguitar/agentstudio/issues",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:a("landing.footer.issues")})}),e.jsx("li",{children:e.jsx("button",{onClick:()=>n(!0),className:"hover:text-white transition-colors text-left w-full",children:a("landing.footer.wechat")||"微信群"})})]})]})]})})}),j&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 relative",children:[e.jsx("button",{onClick:()=>n(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:e.jsx(s,{className:"w-5 h-5"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:a("landing.wechat.title")||"加入微信群"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/wechat-qr-code.png",alt:"WeChat QR Code",className:"w-64 h-64 object-contain border border-gray-200 dark:border-gray-700 rounded-lg"})}),e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 text-center",children:[a("landing.wechat.fallback")||"二维码失效?请添加微信号:",e.jsx("span",{className:"font-mono font-semibold ml-1",children:a("landing.wechat.wechatId")||"your-wechat-id"})]})}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 text-center",children:a("landing.wechat.tip")||"扫码或添加微信号,即可加入交流群"})]})]})})]})};export{G as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./data-structures-
|
|
1
|
+
import{j as e}from"./data-structures-ChC1tqVg.js";import{r as d}from"./monaco-editor-BWfQfpij.js";import{j as ae,k as ne,l as le,r as ie}from"./index-BEPv9Bqe.js";import{j as M,H as $,k as I,C as J,I as de,_ as P,ao as U,r as F,ap as oe,n as ce,y as xe,v as ue}from"./ui-components-DaGtjl0g.js";import{u as ge}from"./tools-BAI9XHGS.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-3mB536QF.js";const B=({error:s,title:m="Error occurred",showDetails:f=!0})=>{const[h,p]=d.useState(!1),[u,g]=d.useState(!1),a=(()=>{if(s instanceof Error){const r=s,n={stack:s.stack||"",name:s.name};return r.requestUrl&&(n.requestUrl=r.requestUrl),r.requestMethod&&(n.requestMethod=r.requestMethod),r.requestBody&&(n.requestBody=r.requestBody),r.statusCode&&(n.statusCode=r.statusCode),r.statusText&&(n.statusText=r.statusText),r.url&&(n.apiBaseUrl=r.url),r.timestamp&&(n.timestamp=new Date(r.timestamp).toISOString()),r.isNetworkError&&(n.isNetworkError=!0),r.isTimeout&&(n.isTimeout=!0),r.isAbortError&&(n.isAbortError=!0),r.originalError&&(n.originalError=r.originalError),r.type&&(n.errorType=r.type),{message:s.message,details:JSON.stringify(n,null,2),raw:s}}else if(typeof s=="object"&&s!==null){const r=s,n={};return Object.keys(r).forEach(b=>{b!=="message"&&(n[b]=r[b])}),{message:r.message||JSON.stringify(s),details:Object.keys(n).length>0?JSON.stringify(n,null,2):r.stack||JSON.stringify(s,null,2),raw:s}}else return{message:String(s),details:"",raw:String(s)}})(),c=f&&(a.details||a.raw),w=async()=>{const r=a.details?`${m}: ${a.message}
|
|
2
2
|
|
|
3
3
|
Details:
|
|
4
4
|
${a.details}`:`${m}: ${a.message}`;try{await navigator.clipboard.writeText(r),g(!0),setTimeout(()=>g(!1),2e3)}catch(n){console.error("Failed to copy error details:",n)}};return e.jsx("div",{className:"p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(M,{className:"w-4 h-4 text-red-600 dark:text-red-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 font-medium",children:a.message}),typeof a.raw=="object"&&a.raw&&"requestUrl"in a.raw&&e.jsxs("div",{className:"mt-1 text-xs text-red-500 dark:text-red-400",children:["requestUrl"in a.raw&&a.raw.requestUrl&&e.jsxs("span",{children:["Request: ",("requestMethod"in a.raw?a.raw.requestMethod:"POST")||"POST"," ",a.raw.requestUrl]}),"statusCode"in a.raw&&a.raw.statusCode&&e.jsxs("span",{className:"ml-2",children:["Status: ",a.raw.statusCode]}),"isNetworkError"in a.raw&&a.raw.isNetworkError&&e.jsx("span",{className:"ml-2",children:"• Network Error"}),"isTimeout"in a.raw&&a.raw.isTimeout&&e.jsx("span",{className:"ml-2",children:"• Request Timeout"})]}),c&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),p(!h)},className:"flex items-center space-x-1 mt-2 text-xs text-red-500 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors",type:"button",children:h?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-3 h-3"}),e.jsx("span",{children:"Hide Details"})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"w-3 h-3"}),e.jsx("span",{children:"Show Details"})]})}),e.jsx("div",{className:`overflow-hidden transition-all duration-200 ease-in-out ${h&&c?"max-h-96 opacity-100 mt-3":"max-h-0 opacity-0"}`,children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"p-2 bg-red-100 dark:bg-red-900/40 rounded border border-red-200 dark:border-red-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:"Technical Details:"}),e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),w()},className:"flex items-center space-x-1 px-2 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700 transition-colors",title:"Copy error details",type:"button",children:u?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"w-3 h-3"}),e.jsx("span",{children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-3 h-3"}),e.jsx("span",{children:"Copy"})]})})]}),e.jsx("pre",{className:"text-xs text-red-800 dark:text-red-200 whitespace-pre-wrap break-words overflow-x-auto font-mono max-h-40 overflow-y-auto",children:typeof a.details=="string"?a.details:JSON.stringify(a.details)})]}),e.jsxs("div",{className:"text-xs text-red-500 dark:text-red-400",children:["Time: ",new Date().toLocaleString()]}),e.jsxs("div",{className:"text-xs text-red-500 dark:text-red-400",children:["Browser: ",navigator.userAgent.split(" ")[0]," | URL: ",window.location.href]})]})})]})]})})};function je(){const{t:s}=ge("pages"),[m,f]=d.useState(""),{login:h,loginWithoutPassword:p,isLoading:u,error:g,checkPasswordRequired:q}=ae(),{services:a,currentService:c,switchService:w,addService:r,updateService:n,removeService:b}=ne(),H=le(),[y,G]=d.useState(!1),[W,j]=d.useState(!1),[X,N]=d.useState(null),[o,x]=d.useState({name:"",url:""}),[E,T]=d.useState(null),[A,O]=d.useState({}),[_,k]=d.useState(!0),[R,v]=d.useState(!0),[z,D]=d.useState(!1),S=H.state?.from?.pathname||"/";d.useEffect(()=>{let t=!0;return(async()=>{if(!c){k(!1);return}k(!0),D(!1);try{const i=await q();if(!t)return;i.success?(v(i.passwordRequired),!i.passwordRequired&&!z&&(D(!0),await p()&&t&&(window.location.href=S))):v(!0)}catch(i){console.error("Failed to check password requirement:",i),t&&v(!0)}finally{t&&k(!1)}})(),()=>{t=!1}},[c?.id]);const K=async(t,l)=>{l&&T(l);try{const i=`${t}/api/health`,L=(await fetch(i,{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(5e3)})).ok?"success":"error";return l&&O(re=>({...re,[l]:L})),L==="success"}catch{return l&&O(C=>({...C,[l]:"error"})),!1}finally{T(null)}},Q=t=>{w(t),window.location.reload()},V=()=>{o.name.trim()&&o.url.trim()&&(r({name:o.name.trim(),url:o.url.trim()}),x({name:"",url:""}),j(!1))},Y=t=>{o.name.trim()&&o.url.trim()&&(n(t,{name:o.name.trim(),url:o.url.trim()}),x({name:"",url:""}),N(null))},Z=t=>{b(t)},ee=(t,l,i)=>{N(t),x({name:l,url:i})},te=async t=>{t.preventDefault(),await h(m)&&(window.location.href=S)},se=()=>{ie(),window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800",children:e.jsx("div",{className:"max-w-md w-full mx-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:s("login.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:s("login.subtitle")}),c&&e.jsx("div",{className:"mt-4 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800",children:e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm text-blue-700 dark:text-blue-300",children:[e.jsx(P,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:c.name}),e.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"•"}),e.jsx("span",{className:"text-xs truncate max-w-40",children:c.url})]})})]}),_?e.jsx("div",{className:"space-y-6 text-center",children:e.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s("login.checkingConnection","正在检查连接...")})]})}):!R&&u?e.jsx("div",{className:"space-y-6 text-center",children:e.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[e.jsx(U,{className:"w-6 h-6 text-green-500"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s("login.autoLoggingIn","正在自动登录...")})]})}):R?e.jsxs("form",{onSubmit:te,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s("login.passwordLabel")}),e.jsx("input",{id:"password",type:"password",value:m,onChange:t=>f(t.target.value),placeholder:s("login.passwordPlaceholder"),required:!0,autoFocus:!0,className:`w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600
|