agentstudio 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/bin/agentstudio.js +4 -3
  2. package/bin/agentstudio.js.map +1 -1
  3. package/bin/serviceManager.d.ts.map +1 -1
  4. package/bin/serviceManager.js +41 -66
  5. package/bin/serviceManager.js.map +1 -1
  6. package/config/index.d.ts.map +1 -1
  7. package/config/index.js +7 -11
  8. package/config/index.js.map +1 -1
  9. package/config/migration.d.ts +16 -0
  10. package/config/migration.d.ts.map +1 -0
  11. package/config/migration.js +212 -0
  12. package/config/migration.js.map +1 -0
  13. package/config/paths.d.ts +119 -32
  14. package/config/paths.d.ts.map +1 -1
  15. package/config/paths.js +142 -38
  16. package/config/paths.js.map +1 -1
  17. package/index.d.ts.map +1 -1
  18. package/index.js +3 -0
  19. package/index.js.map +1 -1
  20. package/package.json +1 -1
  21. package/public/assets/{AgentsPage-D462iGRy.js → AgentsPage-BsZdkqzM.js} +1 -1
  22. package/public/assets/{Button-B_6lGF64.js → Button-CMTSYiKV.js} +1 -1
  23. package/public/assets/{ChatPage-NjuRQPaL.js → ChatPage-D8buVhfb.js} +5 -5
  24. package/public/assets/{CommandsPage-DeUS8fhJ.js → CommandsPage-qDWzq8xp.js} +1 -1
  25. package/public/assets/{CursorConfigPage-Bl1Blrbr.js → CursorConfigPage-DpUdJzRi.js} +1 -1
  26. package/public/assets/{DashboardPage-DH-2iuqf.js → DashboardPage-BhqKOzob.js} +1 -1
  27. package/public/assets/{EngineGate-DxTYx9wb.js → EngineGate-BjHJu955.js} +1 -1
  28. package/public/assets/{FileBrowser-CeGsJnUL.js → FileBrowser-DboOOM_v.js} +1 -1
  29. package/public/assets/{GeneralSettingsPage-lhNEJQD_.js → GeneralSettingsPage-DYdwai51.js} +1 -1
  30. package/public/assets/{HooksPage-9fingjdz.js → HooksPage-DDGc0GGV.js} +1 -1
  31. package/public/assets/{LandingPage-BAzi8PDo.js → LandingPage-CvY4n9Rh.js} +1 -1
  32. package/public/assets/{LoginPage-kQ_NWy8p.js → LoginPage-C-PZfjYC.js} +1 -1
  33. package/public/assets/{McpAdminSettingsPage-DQHpWHRC.js → McpAdminSettingsPage-CIILVzB8.js} +1 -1
  34. package/public/assets/{McpPage-DLHfmhSJ.js → McpPage-B4nQUJag.js} +1 -1
  35. package/public/assets/{MemorySettingsPage-CRIPja9X.js → MemorySettingsPage-eu6tsuUh.js} +1 -1
  36. package/public/assets/{PluginsPage-BhKM7gV7.js → PluginsPage-DD92Xk6X.js} +1 -1
  37. package/public/assets/{ProjectSelector-Cbct6pnn.js → ProjectSelector-CybrDbBY.js} +1 -1
  38. package/public/assets/{ProjectsPage-lQo7-7dt.js → ProjectsPage-DRl-0B4G.js} +1 -1
  39. package/public/assets/{RulesPage-BRnB7__3.js → RulesPage-DUt33RkX.js} +1 -1
  40. package/public/assets/{ScheduledTasksPage-CZiABTSb.js → ScheduledTasksPage-CTDYYRIN.js} +1 -1
  41. package/public/assets/{SettingsLayout-BfG7ftoT.js → SettingsLayout-LGC-0pQl.js} +1 -1
  42. package/public/assets/{SkillsPage-CL6MKxQ9.js → SkillsPage-Lzw8I9vR.js} +1 -1
  43. package/public/assets/{SubagentsPage-DhFP2kDE.js → SubagentsPage-bX2XWdJ0.js} +1 -1
  44. package/public/assets/{SystemInfoPage-CFHUN3j8.js → SystemInfoPage-nEIQbtwG.js} +1 -1
  45. package/public/assets/{TelemetrySettingsPage-BcZFVBXN.js → TelemetrySettingsPage-q167I4G9.js} +1 -1
  46. package/public/assets/{ToastTestPage-BtGnZdyk.js → ToastTestPage-j224d3QR.js} +1 -1
  47. package/public/assets/{VersionSettingsPage-DjOjyL3X.js → VersionSettingsPage-BwpwiLyl.js} +1 -1
  48. package/public/assets/{WebSocketTunnelPage-CfHtJR9r.js → WebSocketTunnelPage-BqEUE7mr.js} +1 -1
  49. package/public/assets/{_basePickBy-Bac3af5O.js → _basePickBy-DHabY031.js} +1 -1
  50. package/public/assets/{_baseUniq-Dvh9sZ-T.js → _baseUniq-B1lmu3qr.js} +1 -1
  51. package/public/assets/{arc-CRR5EPpK.js → arc-6sRLTBcr.js} +1 -1
  52. package/public/assets/{architectureDiagram-VXUJARFQ-Ct1p8kmV.js → architectureDiagram-VXUJARFQ-kwdTmjuB.js} +1 -1
  53. package/public/assets/{blockDiagram-VD42YOAC-CX_8YiYn.js → blockDiagram-VD42YOAC-CYO9EYkJ.js} +1 -1
  54. package/public/assets/{c4Diagram-YG6GDRKO-BIBVWIY4.js → c4Diagram-YG6GDRKO-gAp3--Ee.js} +1 -1
  55. package/public/assets/channel-D9wyZF1L.js +1 -0
  56. package/public/assets/{chunk-4BX2VUAB-CQNNXsb5.js → chunk-4BX2VUAB-DQVsL-J6.js} +1 -1
  57. package/public/assets/{chunk-55IACEB6-N_ZrGhOu.js → chunk-55IACEB6-DVsfnY5X.js} +1 -1
  58. package/public/assets/{chunk-B4BG7PRW-CI6DkhbM.js → chunk-B4BG7PRW-BNmOvuIn.js} +1 -1
  59. package/public/assets/{chunk-DI55MBZ5-Dgj-Eo9U.js → chunk-DI55MBZ5-BkucWe8Y.js} +1 -1
  60. package/public/assets/{chunk-FMBD7UC4-o4B0HzSK.js → chunk-FMBD7UC4-BsvfEdnB.js} +1 -1
  61. package/public/assets/{chunk-QN33PNHL-DXlfdPIk.js → chunk-QN33PNHL-DSecsNtM.js} +1 -1
  62. package/public/assets/{chunk-QZHKN3VN-ZCBUGD7e.js → chunk-QZHKN3VN-DhvrZSqy.js} +1 -1
  63. package/public/assets/{chunk-TZMSLE5B-N3lZ106d.js → chunk-TZMSLE5B-BqQ674GC.js} +1 -1
  64. package/public/assets/{classDiagram-2ON5EDUG-DCwNRxvC.js → classDiagram-2ON5EDUG-DwEqkkEb.js} +1 -1
  65. package/public/assets/{classDiagram-v2-WZHVMYZB-DCwNRxvC.js → classDiagram-v2-WZHVMYZB-DwEqkkEb.js} +1 -1
  66. package/public/assets/clone-3wFPaI2j.js +1 -0
  67. package/public/assets/{cose-bilkent-S5V4N54A-Crc39J9q.js → cose-bilkent-S5V4N54A-D9ZC6LmB.js} +1 -1
  68. package/public/assets/{dagre-6UL2VRFP-nC3WLCf7.js → dagre-6UL2VRFP-s7YD2ZcY.js} +1 -1
  69. package/public/assets/{diagram-PSM6KHXK-B5DQIDQ3.js → diagram-PSM6KHXK-C7jhP5tx.js} +1 -1
  70. package/public/assets/{diagram-QEK2KX5R-BccDOQuz.js → diagram-QEK2KX5R-B348GmS1.js} +1 -1
  71. package/public/assets/{diagram-S2PKOQOG-D-Cv16WE.js → diagram-S2PKOQOG-Cu-zjwc9.js} +1 -1
  72. package/public/assets/{erDiagram-Q2GNP2WA-Dr0ZgvnS.js → erDiagram-Q2GNP2WA-tM4HKBpy.js} +1 -1
  73. package/public/assets/{flowDiagram-NV44I4VS-DGbbfVi5.js → flowDiagram-NV44I4VS-DjCIshpi.js} +1 -1
  74. package/public/assets/{ganttDiagram-LVOFAZNH-C-3Wnf96.js → ganttDiagram-LVOFAZNH-Q6plkI5G.js} +1 -1
  75. package/public/assets/{gitGraphDiagram-NY62KEGX--Q8whT5z.js → gitGraphDiagram-NY62KEGX-B3Uw90Yt.js} +1 -1
  76. package/public/assets/{graph-CO1DMS2E.js → graph-Bp0jlxBT.js} +1 -1
  77. package/public/assets/{index-B5hSSnK3.js → index-f67nhEoX.js} +2 -2
  78. package/public/assets/{infoDiagram-F6ZHWCRC-DSR9cM2B.js → infoDiagram-F6ZHWCRC-HUfwv_JT.js} +1 -1
  79. package/public/assets/{journeyDiagram-XKPGCS4Q-Cc00zHNt.js → journeyDiagram-XKPGCS4Q-CgQogtHU.js} +1 -1
  80. package/public/assets/{kanban-definition-3W4ZIXB7-BF_gHshF.js → kanban-definition-3W4ZIXB7-Cv7kVxyy.js} +1 -1
  81. package/public/assets/{layout-BxoLV88o.js → layout-6bkH32V1.js} +1 -1
  82. package/public/assets/{linear-Y8e2e012.js → linear-DWoZ6Tbm.js} +1 -1
  83. package/public/assets/{mindmap-definition-VGOIOE7T-CzpuQA4p.js → mindmap-definition-VGOIOE7T-D5wd9HsH.js} +1 -1
  84. package/public/assets/{pieDiagram-ADFJNKIX-B22MhIcy.js → pieDiagram-ADFJNKIX-8vPxErLm.js} +1 -1
  85. package/public/assets/{quadrantDiagram-AYHSOK5B-CTT9bIA8.js → quadrantDiagram-AYHSOK5B-Pn0NZ9k7.js} +1 -1
  86. package/public/assets/{requirementDiagram-UZGBJVZJ-B_vjXDH9.js → requirementDiagram-UZGBJVZJ-C7u8MiN1.js} +1 -1
  87. package/public/assets/{sankeyDiagram-TZEHDZUN-CKfZ4633.js → sankeyDiagram-TZEHDZUN-C660O4mw.js} +1 -1
  88. package/public/assets/{sequenceDiagram-WL72ISMW-BmTPN6j6.js → sequenceDiagram-WL72ISMW-pXBA2_3B.js} +1 -1
  89. package/public/assets/{stateDiagram-FKZM4ZOC-y2fQE1C7.js → stateDiagram-FKZM4ZOC-CxZMM1Lf.js} +1 -1
  90. package/public/assets/{stateDiagram-v2-4FDKWEC3-C4CM6z52.js → stateDiagram-v2-4FDKWEC3-CmurzrWf.js} +1 -1
  91. package/public/assets/{table-BJUz-ck5.js → table-Clz57edU.js} +1 -1
  92. package/public/assets/{timeline-definition-IT6M3QCI-DsXlR68n.js → timeline-definition-IT6M3QCI-Crg44TaP.js} +1 -1
  93. package/public/assets/{treemap-KMMF4GRG-Cecs9uxX.js → treemap-KMMF4GRG-bFxwBWXw.js} +1 -1
  94. package/public/assets/{xychartDiagram-PRI3JC2R-C2IWhyM7.js → xychartDiagram-PRI3JC2R-DG3KmjD-.js} +1 -1
  95. package/public/index.html +1 -1
  96. package/routes/config.d.ts.map +1 -1
  97. package/routes/config.js +8 -8
  98. package/routes/config.js.map +1 -1
  99. package/services/mcpAdmin/adminApiKeyService.d.ts +1 -1
  100. package/services/mcpAdmin/adminApiKeyService.js +3 -3
  101. package/services/mcpAdmin/adminApiKeyService.js.map +1 -1
  102. package/services/speechToText/index.d.ts.map +1 -1
  103. package/services/speechToText/index.js +4 -4
  104. package/services/speechToText/index.js.map +1 -1
  105. package/services/telemetry.d.ts.map +1 -1
  106. package/services/telemetry.js +5 -7
  107. package/services/telemetry.js.map +1 -1
  108. package/services/tunnelService.js +2 -2
  109. package/services/tunnelService.js.map +1 -1
  110. package/public/assets/channel-CPs-2Y_m.js +0 -1
  111. package/public/assets/clone-C3DcKvhB.js +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{r as n}from"./monaco-editor-BWfQfpij.js";import{T as R,a as O,b as k,c as x,d as q,e as m}from"./table-BJUz-ck5.js";import{u as z,a as J}from"./useCommands-DbSH48ba.js";import{C as G}from"./CommandForm-DwGvE9A_.js";import{f as w}from"./dateFormat-CXa8VnEC.js";import{b as I}from"./index-B5hSSnK3.js";import{T as v}from"./ToolsList-CTsQr53G.js";import{u as K}from"./tools-BZTR2NP1.js";import{j as C,S as Q,v as U,E as $,o as T,m as S,J as F,y as A}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.js";import"./UnifiedToolSelector-BP6fuyzG.js";const ne=()=>{const{t}=K("pages"),{isMobile:a}=I(),[d]=n.useState({scope:"user"}),[i,M]=n.useState(""),[E,r]=n.useState(!1),[H,l]=n.useState(null),[h,o]=n.useState(null),[y,j]=n.useState({}),{data:p,isLoading:P,error:D,refetch:N}=z({...d,search:i.trim()||void 0}),B=p?.commands||[],g=p?.readOnly||!1,f=p?.engine||"claude-sdk",u=J(),L=async s=>{try{await u.mutateAsync(s.id),o(null)}catch(c){console.error("Failed to delete command:",c)}},b=B.filter(s=>!(d.scope&&d.scope!=="all"&&s.scope!==d.scope||d.namespace&&s.namespace!==d.namespace));return P?e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-blue-500 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:t("commands.loading")})]})}):D?e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(C,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}),e.jsx("p",{className:"text-red-600 text-lg mb-2",children:t("commands.error.loadFailed")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:t("commands.error.cannotLoadCommands")}),e.jsx("button",{onClick:()=>N(),className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg transition-colors",children:t("commands.error.retry")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:`${a?"mb-4":"flex items-center justify-between mb-6"}`,children:e.jsxs("div",{children:[e.jsx("h1",{className:`${a?"text-2xl":"text-3xl"} font-bold text-gray-900 dark:text-white`,children:t("commands.title")}),e.jsx("p",{className:`text-gray-600 dark:text-gray-400 ${a?"mt-1":"mt-2"}`,children:t("commands.subtitle")})]})}),e.jsxs("div",{className:`${a?"space-y-3":"flex items-center space-x-4"}`,children:[e.jsxs("div",{className:`${a?"":"flex-1"} relative`,children:[e.jsx(Q,{className:`absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 ${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("input",{type:"text",placeholder:t("commands.searchPlaceholder"),value:i,onChange:s=>M(s.target.value),className:`pl-10 pr-4 ${a?"py-2":"py-3"} w-full 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 ${a?"text-sm":""}`})]}),g?e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg text-yellow-700 dark:text-yellow-400 text-sm",children:[e.jsx($,{className:"w-4 h-4"}),e.jsxs("span",{children:["只读模式 (",f==="cursor-cli"?"Cursor":f,")"]})]}):e.jsxs("button",{onClick:()=>{l(null),r(!0)},className:`${a?"w-full py-2.5 px-4":"flex items-center space-x-2 px-6 py-3"} bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors ${a?"text-sm":""}`,children:[e.jsx(U,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:t("commands.createButton")})]})]})]}),b.length===0?e.jsxs("div",{className:"text-center py-16 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsx("div",{className:`${a?"text-4xl":"text-6xl"} mb-4`,children:"⚡"}),e.jsx("h3",{className:`${a?"text-lg":"text-xl"} font-medium text-gray-900 dark:text-white mb-2`,children:t(i?"commands.empty.noMatchingCommands":"commands.empty.noCommands")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:t(i?"commands.empty.adjustSearch":"commands.empty.createFirst")}),!i&&!g&&e.jsx("button",{onClick:()=>{l(null),r(!0)},className:`${a?"w-full py-3 px-4":"px-6 py-3"} bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:t("commands.createButton")}),g&&e.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:"配置来自 ~/.cursor/commands(只读)"})]}):e.jsx(e.Fragment,{children:a?e.jsx("div",{className:"space-y-4",children:b.map((s,c)=>e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`${a?"text-lg":"text-xl"} mr-3`,children:"⚡"}),e.jsxs("div",{children:[e.jsxs("div",{className:`${a?"text-sm":"text-base"} font-medium text-gray-900 dark:text-white`,children:[s.namespace?`/${s.namespace}:${s.name}`:`/${s.name}`,s.argumentHint&&e.jsx("code",{className:"ml-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300 px-1.5 py-0.5 rounded text-xs",children:s.argumentHint})]}),s.description&&e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:s.description})]})]})}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2",children:[t("commands.table.model"),":"]}),s.model?e.jsxs("div",{className:"flex items-center text-gray-900 dark:text-white",children:[e.jsx(T,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-sm",children:s.model})]}):e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("commands.table.inheritSettings")})]}),e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-start text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2 mt-1",children:[t("commands.table.tools"),":"]}),e.jsx("div",{className:"flex-1",children:e.jsx(v,{tools:s.allowedTools||[],id:s.id,expandedTools:y,setExpandedTools:j,isMobile:!0,emptyMessage:t("commands.table.inheritSettings")})})]})}),e.jsxs("div",{className:"flex items-center text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2",children:[t("commands.table.createdAt"),":"]}),e.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[e.jsx(S,{className:"w-4 h-4 mr-1"}),e.jsx("span",{children:w(s.createdAt||s.updatedAt)})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end space-x-2 pt-3 border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",children:[e.jsx(F,{className:"w-3 h-3 mr-1"}),t("commands.actions.edit")]}),e.jsx("button",{onClick:()=>o(s),className:"p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-lg transition-colors",title:t("commands.actions.deleteCommand"),children:e.jsx(A,{className:"w-4 h-4"})})]})]},s.id+"-"+c))}):e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsxs(R,{children:[e.jsx(O,{children:e.jsxs(k,{children:[e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.command")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.model")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.tools")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.createdAt")}),e.jsx(x,{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.actions")})]})}),e.jsx(q,{children:b.map((s,c)=>e.jsxs(k,{className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx(m,{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"text-xl mr-3",children:"⚡"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:s.namespace?`/${s.namespace}:${s.name}`:`/${s.name}`}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${s.source==="plugin"?"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300"}`,children:s.source==="plugin"?t("commands.source.plugin"):t("commands.source.local")}),s.argumentHint&&e.jsx("code",{className:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300 px-1.5 py-0.5 rounded text-xs",children:s.argumentHint})]}),s.description&&e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 truncate max-w-xs mt-1",children:s.description})]})]})}),e.jsx(m,{className:"px-6 py-4",children:s.model?e.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[e.jsx(T,{className:"w-3 h-3 inline mr-1"}),s.model]}):e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("commands.table.inheritSettings")})}),e.jsx(m,{className:"px-6 py-4",children:e.jsx(v,{tools:s.allowedTools||[],id:s.id,expandedTools:y,setExpandedTools:j,isMobile:!1,emptyMessage:t("commands.table.inheritSettings")})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(S,{className:"w-4 h-4"}),e.jsx("span",{children:w(s.createdAt||s.updatedAt)})]})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.source==="plugin"||g?e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",title:t("commands.actions.view"),children:[e.jsx($,{className:"w-3 h-3 mr-1"}),t("commands.actions.view")]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",title:t("commands.actions.editCommand"),children:[e.jsx(F,{className:"w-3 h-3 mr-1"}),t("commands.actions.edit")]}),e.jsx("button",{onClick:()=>o(s),className:"p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-lg transition-colors",title:t("commands.actions.deleteCommand"),children:e.jsx(A,{className:"w-4 h-4"})})]})})})]},s.id+"-"+c))})]})})}),E&&e.jsx(G,{command:H,onClose:()=>{r(!1),l(null)},onSuccess:()=>{r(!1),l(null),N()}}),h&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg shadow-xl ${a?"w-full max-w-sm":"max-w-md w-full mx-4"} p-6`,children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(C,{className:`${a?"h-5 w-5":"h-6 w-6"} text-red-600`})}),e.jsx("div",{className:"flex-1",children:e.jsx("h3",{className:`${a?"text-base":"text-lg"} font-medium text-gray-900 dark:text-white`,children:t("commands.delete.title")})})]}),e.jsx("p",{className:`text-gray-600 dark:text-gray-400 ${a?"mb-4 text-sm":"mb-6"}`,children:t("commands.delete.confirmMessage",{name:h.name})}),e.jsxs("div",{className:`${a?"grid grid-cols-2 gap-2":"flex justify-end space-x-3"}`,children:[e.jsx("button",{onClick:()=>o(null),className:`${a?"px-3 py-2.5 text-sm":"px-4 py-2"} text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 rounded-lg transition-colors`,children:t("commands.delete.cancel")}),e.jsx("button",{onClick:()=>L(h),disabled:u.isPending,className:`${a?"px-3 py-2.5 text-sm":"px-4 py-2"} bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors disabled:opacity-50`,children:u.isPending?t("commands.delete.deleting"):t("commands.delete.delete")})]})]})})]})};export{ne as CommandsPage};
1
+ import{j as e}from"./data-structures-ChC1tqVg.js";import{r as n}from"./monaco-editor-BWfQfpij.js";import{T as R,a as O,b as k,c as x,d as q,e as m}from"./table-Clz57edU.js";import{u as z,a as J}from"./useCommands-DbSH48ba.js";import{C as G}from"./CommandForm-DwGvE9A_.js";import{f as w}from"./dateFormat-CXa8VnEC.js";import{b as I}from"./index-f67nhEoX.js";import{T as v}from"./ToolsList-CTsQr53G.js";import{u as K}from"./tools-BZTR2NP1.js";import{j as C,S as Q,v as U,E as $,o as T,m as S,J as F,y as A}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.js";import"./UnifiedToolSelector-BP6fuyzG.js";const ne=()=>{const{t}=K("pages"),{isMobile:a}=I(),[d]=n.useState({scope:"user"}),[i,M]=n.useState(""),[E,r]=n.useState(!1),[H,l]=n.useState(null),[h,o]=n.useState(null),[y,j]=n.useState({}),{data:p,isLoading:P,error:D,refetch:N}=z({...d,search:i.trim()||void 0}),B=p?.commands||[],g=p?.readOnly||!1,f=p?.engine||"claude-sdk",u=J(),L=async s=>{try{await u.mutateAsync(s.id),o(null)}catch(c){console.error("Failed to delete command:",c)}},b=B.filter(s=>!(d.scope&&d.scope!=="all"&&s.scope!==d.scope||d.namespace&&s.namespace!==d.namespace));return P?e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-blue-500 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:t("commands.loading")})]})}):D?e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(C,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}),e.jsx("p",{className:"text-red-600 text-lg mb-2",children:t("commands.error.loadFailed")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:t("commands.error.cannotLoadCommands")}),e.jsx("button",{onClick:()=>N(),className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg transition-colors",children:t("commands.error.retry")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:`${a?"mb-4":"flex items-center justify-between mb-6"}`,children:e.jsxs("div",{children:[e.jsx("h1",{className:`${a?"text-2xl":"text-3xl"} font-bold text-gray-900 dark:text-white`,children:t("commands.title")}),e.jsx("p",{className:`text-gray-600 dark:text-gray-400 ${a?"mt-1":"mt-2"}`,children:t("commands.subtitle")})]})}),e.jsxs("div",{className:`${a?"space-y-3":"flex items-center space-x-4"}`,children:[e.jsxs("div",{className:`${a?"":"flex-1"} relative`,children:[e.jsx(Q,{className:`absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 ${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("input",{type:"text",placeholder:t("commands.searchPlaceholder"),value:i,onChange:s=>M(s.target.value),className:`pl-10 pr-4 ${a?"py-2":"py-3"} w-full 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 ${a?"text-sm":""}`})]}),g?e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg text-yellow-700 dark:text-yellow-400 text-sm",children:[e.jsx($,{className:"w-4 h-4"}),e.jsxs("span",{children:["只读模式 (",f==="cursor-cli"?"Cursor":f,")"]})]}):e.jsxs("button",{onClick:()=>{l(null),r(!0)},className:`${a?"w-full py-2.5 px-4":"flex items-center space-x-2 px-6 py-3"} bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors ${a?"text-sm":""}`,children:[e.jsx(U,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:t("commands.createButton")})]})]})]}),b.length===0?e.jsxs("div",{className:"text-center py-16 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsx("div",{className:`${a?"text-4xl":"text-6xl"} mb-4`,children:"⚡"}),e.jsx("h3",{className:`${a?"text-lg":"text-xl"} font-medium text-gray-900 dark:text-white mb-2`,children:t(i?"commands.empty.noMatchingCommands":"commands.empty.noCommands")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:t(i?"commands.empty.adjustSearch":"commands.empty.createFirst")}),!i&&!g&&e.jsx("button",{onClick:()=>{l(null),r(!0)},className:`${a?"w-full py-3 px-4":"px-6 py-3"} bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:t("commands.createButton")}),g&&e.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:"配置来自 ~/.cursor/commands(只读)"})]}):e.jsx(e.Fragment,{children:a?e.jsx("div",{className:"space-y-4",children:b.map((s,c)=>e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`${a?"text-lg":"text-xl"} mr-3`,children:"⚡"}),e.jsxs("div",{children:[e.jsxs("div",{className:`${a?"text-sm":"text-base"} font-medium text-gray-900 dark:text-white`,children:[s.namespace?`/${s.namespace}:${s.name}`:`/${s.name}`,s.argumentHint&&e.jsx("code",{className:"ml-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300 px-1.5 py-0.5 rounded text-xs",children:s.argumentHint})]}),s.description&&e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:s.description})]})]})}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("div",{className:"flex items-center text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2",children:[t("commands.table.model"),":"]}),s.model?e.jsxs("div",{className:"flex items-center text-gray-900 dark:text-white",children:[e.jsx(T,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-sm",children:s.model})]}):e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("commands.table.inheritSettings")})]}),e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-start text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2 mt-1",children:[t("commands.table.tools"),":"]}),e.jsx("div",{className:"flex-1",children:e.jsx(v,{tools:s.allowedTools||[],id:s.id,expandedTools:y,setExpandedTools:j,isMobile:!0,emptyMessage:t("commands.table.inheritSettings")})})]})}),e.jsxs("div",{className:"flex items-center text-sm",children:[e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 mr-2",children:[t("commands.table.createdAt"),":"]}),e.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[e.jsx(S,{className:"w-4 h-4 mr-1"}),e.jsx("span",{children:w(s.createdAt||s.updatedAt)})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end space-x-2 pt-3 border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",children:[e.jsx(F,{className:"w-3 h-3 mr-1"}),t("commands.actions.edit")]}),e.jsx("button",{onClick:()=>o(s),className:"p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-lg transition-colors",title:t("commands.actions.deleteCommand"),children:e.jsx(A,{className:"w-4 h-4"})})]})]},s.id+"-"+c))}):e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsxs(R,{children:[e.jsx(O,{children:e.jsxs(k,{children:[e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.command")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.model")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.tools")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.createdAt")}),e.jsx(x,{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:t("commands.table.actions")})]})}),e.jsx(q,{children:b.map((s,c)=>e.jsxs(k,{className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx(m,{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"text-xl mr-3",children:"⚡"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:s.namespace?`/${s.namespace}:${s.name}`:`/${s.name}`}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${s.source==="plugin"?"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300"}`,children:s.source==="plugin"?t("commands.source.plugin"):t("commands.source.local")}),s.argumentHint&&e.jsx("code",{className:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300 px-1.5 py-0.5 rounded text-xs",children:s.argumentHint})]}),s.description&&e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 truncate max-w-xs mt-1",children:s.description})]})]})}),e.jsx(m,{className:"px-6 py-4",children:s.model?e.jsxs("div",{className:"text-sm text-gray-900 dark:text-white",children:[e.jsx(T,{className:"w-3 h-3 inline mr-1"}),s.model]}):e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t("commands.table.inheritSettings")})}),e.jsx(m,{className:"px-6 py-4",children:e.jsx(v,{tools:s.allowedTools||[],id:s.id,expandedTools:y,setExpandedTools:j,isMobile:!1,emptyMessage:t("commands.table.inheritSettings")})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(S,{className:"w-4 h-4"}),e.jsx("span",{children:w(s.createdAt||s.updatedAt)})]})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.source==="plugin"||g?e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",title:t("commands.actions.view"),children:[e.jsx($,{className:"w-3 h-3 mr-1"}),t("commands.actions.view")]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{l(s),r(!0)},className:"inline-flex items-center px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 dark:bg-blue-900/50 rounded-md hover:bg-blue-100 dark:hover:bg-blue-900/70 transition-colors",title:t("commands.actions.editCommand"),children:[e.jsx(F,{className:"w-3 h-3 mr-1"}),t("commands.actions.edit")]}),e.jsx("button",{onClick:()=>o(s),className:"p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-lg transition-colors",title:t("commands.actions.deleteCommand"),children:e.jsx(A,{className:"w-4 h-4"})})]})})})]},s.id+"-"+c))})]})})}),E&&e.jsx(G,{command:H,onClose:()=>{r(!1),l(null)},onSuccess:()=>{r(!1),l(null),N()}}),h&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-lg shadow-xl ${a?"w-full max-w-sm":"max-w-md w-full mx-4"} p-6`,children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(C,{className:`${a?"h-5 w-5":"h-6 w-6"} text-red-600`})}),e.jsx("div",{className:"flex-1",children:e.jsx("h3",{className:`${a?"text-base":"text-lg"} font-medium text-gray-900 dark:text-white`,children:t("commands.delete.title")})})]}),e.jsx("p",{className:`text-gray-600 dark:text-gray-400 ${a?"mb-4 text-sm":"mb-6"}`,children:t("commands.delete.confirmMessage",{name:h.name})}),e.jsxs("div",{className:`${a?"grid grid-cols-2 gap-2":"flex justify-end space-x-3"}`,children:[e.jsx("button",{onClick:()=>o(null),className:`${a?"px-3 py-2.5 text-sm":"px-4 py-2"} text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 rounded-lg transition-colors`,children:t("commands.delete.cancel")}),e.jsx("button",{onClick:()=>L(h),disabled:u.isPending,className:`${a?"px-3 py-2.5 text-sm":"px-4 py-2"} bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors disabled:opacity-50`,children:u.isPending?t("commands.delete.deleting"):t("commands.delete.delete")})]})]})})]})};export{ne as CommandsPage};
@@ -1 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{b as o,A as m}from"./agents-KlPdWQ8K.js";import{e as p}from"./index-B5hSSnK3.js";import{N as g}from"./EngineGate-DxTYx9wb.js";import{V as x,j as h,$ as y,aj as b,ak as j,Z as u,Y as f,C as N,e as k,M as w}from"./ui-components-DjgDPiqV.js";import"./monaco-editor-BWfQfpij.js";import"./syntax-highlighting-DGbNjS3S.js";import"./tools-BZTR2NP1.js";async function v(){const s=await fetch(`${m}/engine/cursor-config`);if(!s.ok)throw new Error("Failed to fetch Cursor config");return s.json()}const B=()=>{const{paths:s,isCursorEngine:n}=p(),{data:t,isLoading:d,error:i,refetch:l}=o({queryKey:["cursor-config"],queryFn:v,enabled:n,staleTime:3e4});return n?e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Cursor 配置概览"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:["读取自 ",s?.userConfigDir]})]}),e.jsxs("button",{onClick:()=>l(),disabled:d,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700 disabled:opacity-50",children:[e.jsx(x,{className:`w-4 h-4 ${d?"animate-spin":""}`}),"刷新"]})]}),i&&e.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-red-700 dark:text-red-400",children:[e.jsx(h,{className:"w-5 h-5"}),e.jsxs("span",{children:["加载配置失败: ",i.message]})]})}),d&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(x,{className:"w-8 h-8 animate-spin text-gray-400"})}),t&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a,{title:"MCP 服务器",icon:y,count:t.mcp.length,emptyText:"未配置 MCP 服务器",children:t.mcp.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.name}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.url||r.command})]}),e.jsx("span",{className:"text-xs px-2 py-1 bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 rounded",children:r.url?"HTTP":"stdio"})]},r.name))}),e.jsx(a,{title:"规则",icon:b,count:t.rules.length,emptyText:"未配置规则",children:t.rules.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.name}),r.frontmatter.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.frontmatter.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r.frontmatter.alwaysApply&&e.jsx("span",{className:"text-xs px-2 py-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400 rounded",children:"始终应用"}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]})]},r.path))}),e.jsx(a,{title:"命令",icon:j,count:t.commands.length,emptyText:"未配置命令",children:t.commands.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("span",{className:"font-medium text-gray-900 dark:text-white",children:["/",r.name]}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]},r.path))}),e.jsx(a,{title:"技能",icon:u,count:t.skills.length,emptyText:"未配置技能",children:t.skills.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.frontmatter.name||r.name}),r.frontmatter.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.frontmatter.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r.isBuiltin&&e.jsx("span",{className:"text-xs px-2 py-1 bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400 rounded",children:"内置"}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]})]},r.path))}),e.jsx(a,{title:"插件",icon:f,count:t.plugins?.user?.length||0,emptyText:"未安装插件",children:t.plugins?.user?.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r}),e.jsx(N,{className:"w-4 h-4 text-green-500"})]},r))}),e.jsx(a,{title:"市场源",icon:k,count:t.marketplaces?Object.keys(t.marketplaces).length:0,emptyText:"未配置市场源",children:t.marketplaces&&Object.entries(t.marketplaces).map(([r,c])=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c.repo})]}),e.jsx("a",{href:`https://github.com/${c.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600",children:e.jsx(w,{className:"w-4 h-4"})})]},r))})]})]}):e.jsx("div",{className:"p-6",children:e.jsx(g,{feature:"Cursor 配置",description:"此页面仅在使用 Cursor CLI 引擎时可用。"})})};function a({title:s,icon:n,count:t,emptyText:d,children:i}){return 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:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(n,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:s})]}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t," 项"]})]}),e.jsx("div",{className:"px-4 py-2 max-h-64 overflow-y-auto",children:t===0?e.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500 py-4 text-center",children:d}):i})]})}export{B as CursorConfigPage,B as default};
1
+ import{j as e}from"./data-structures-ChC1tqVg.js";import{b as o,A as m}from"./agents-KlPdWQ8K.js";import{e as p}from"./index-f67nhEoX.js";import{N as g}from"./EngineGate-BjHJu955.js";import{V as x,j as h,$ as y,aj as b,ak as j,Z as u,Y as f,C as N,e as k,M as w}from"./ui-components-DjgDPiqV.js";import"./monaco-editor-BWfQfpij.js";import"./syntax-highlighting-DGbNjS3S.js";import"./tools-BZTR2NP1.js";async function v(){const s=await fetch(`${m}/engine/cursor-config`);if(!s.ok)throw new Error("Failed to fetch Cursor config");return s.json()}const B=()=>{const{paths:s,isCursorEngine:n}=p(),{data:t,isLoading:d,error:i,refetch:l}=o({queryKey:["cursor-config"],queryFn:v,enabled:n,staleTime:3e4});return n?e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Cursor 配置概览"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:["读取自 ",s?.userConfigDir]})]}),e.jsxs("button",{onClick:()=>l(),disabled:d,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700 disabled:opacity-50",children:[e.jsx(x,{className:`w-4 h-4 ${d?"animate-spin":""}`}),"刷新"]})]}),i&&e.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-red-700 dark:text-red-400",children:[e.jsx(h,{className:"w-5 h-5"}),e.jsxs("span",{children:["加载配置失败: ",i.message]})]})}),d&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(x,{className:"w-8 h-8 animate-spin text-gray-400"})}),t&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(a,{title:"MCP 服务器",icon:y,count:t.mcp.length,emptyText:"未配置 MCP 服务器",children:t.mcp.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.name}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.url||r.command})]}),e.jsx("span",{className:"text-xs px-2 py-1 bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 rounded",children:r.url?"HTTP":"stdio"})]},r.name))}),e.jsx(a,{title:"规则",icon:b,count:t.rules.length,emptyText:"未配置规则",children:t.rules.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.name}),r.frontmatter.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.frontmatter.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r.frontmatter.alwaysApply&&e.jsx("span",{className:"text-xs px-2 py-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400 rounded",children:"始终应用"}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]})]},r.path))}),e.jsx(a,{title:"命令",icon:j,count:t.commands.length,emptyText:"未配置命令",children:t.commands.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("span",{className:"font-medium text-gray-900 dark:text-white",children:["/",r.name]}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]},r.path))}),e.jsx(a,{title:"技能",icon:u,count:t.skills.length,emptyText:"未配置技能",children:t.skills.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.frontmatter.name||r.name}),r.frontmatter.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",children:r.frontmatter.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r.isBuiltin&&e.jsx("span",{className:"text-xs px-2 py-1 bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400 rounded",children:"内置"}),e.jsx("span",{className:"text-xs text-gray-400",children:r.scope})]})]},r.path))}),e.jsx(a,{title:"插件",icon:f,count:t.plugins?.user?.length||0,emptyText:"未安装插件",children:t.plugins?.user?.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r}),e.jsx(N,{className:"w-4 h-4 text-green-500"})]},r))}),e.jsx(a,{title:"市场源",icon:k,count:t.marketplaces?Object.keys(t.marketplaces).length:0,emptyText:"未配置市场源",children:t.marketplaces&&Object.entries(t.marketplaces).map(([r,c])=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c.repo})]}),e.jsx("a",{href:`https://github.com/${c.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600",children:e.jsx(w,{className:"w-4 h-4"})})]},r))})]})]}):e.jsx("div",{className:"p-6",children:e.jsx(g,{feature:"Cursor 配置",description:"此页面仅在使用 Cursor CLI 引擎时可用。"})})};function a({title:s,icon:n,count:t,emptyText:d,children:i}){return 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:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(n,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:s})]}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t," 项"]})]}),e.jsx("div",{className:"px-4 py-2 max-h-64 overflow-y-auto",children:t===0?e.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500 py-4 text-center",children:d}):i})]})}export{B as CursorConfigPage,B as default};
@@ -1 +1 @@
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-Bbh6hJMM.js";import{u as O,a as Q}from"./useAgents-8KXN6U61.js";import{u as _,c as W,a as X}from"./useSessions-DOa4-xiB.js";import{u as G}from"./agents-KlPdWQ8K.js";import{u as J,s as x,a as S}from"./index-B5hSSnK3.js";import{u as Y}from"./tools-BZTR2NP1.js";import{p as Z,F as ee,d as ae,o as se,q as re,f as te,e 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-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";const Ve=()=>{const{t:s}=Y("pages"),A=J(),I=G(),{data:F,isLoading:$}=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=F?.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),S(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),S(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),P=`/chat/${r.id}?project=${encodeURIComponent(t.path)}&message=${l}`;window.open(P,"_blank")}else f(a)}},H=!$&&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-Bbh6hJMM.js";import{u as O,a as Q}from"./useAgents-8KXN6U61.js";import{u as _,c as W,a as X}from"./useSessions-DOa4-xiB.js";import{u as G}from"./agents-KlPdWQ8K.js";import{u as J,s as x,a as S}from"./index-f67nhEoX.js";import{u as Y}from"./tools-BZTR2NP1.js";import{p as Z,F as ee,d as ae,o as se,q as re,f as te,e 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-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";const Ve=()=>{const{t:s}=Y("pages"),A=J(),I=G(),{data:F,isLoading:$}=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=F?.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),S(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),S(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),P=`/chat/${r.id}?project=${encodeURIComponent(t.path)}&message=${l}`;window.open(P,"_blank")}else f(a)}},H=!$&&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 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{e as a}from"./index-B5hSSnK3.js";function i({feature:t,description:s}){const{engineName:r}=a();return e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"text-gray-400 mb-4",children:e.jsx("svg",{className:"w-16 h-16 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})})}),e.jsxs("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:[t," 不可用"]}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 max-w-md",children:s||`当前引擎 (${r}) 不支持此功能。`})]})}export{i as N};
1
+ import{j as e}from"./data-structures-ChC1tqVg.js";import{e as a}from"./index-f67nhEoX.js";function i({feature:t,description:s}){const{engineName:r}=a();return e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"text-gray-400 mb-4",children:e.jsx("svg",{className:"w-16 h-16 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})})}),e.jsxs("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:[t," 不可用"]}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 max-w-md",children:s||`当前引擎 (${r}) 不支持此功能。`})]})}export{i as N};
@@ -1,4 +1,4 @@
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-KlPdWQ8K.js";import{a as de}from"./index-B5hSSnK3.js";import{u as ee}from"./tools-BZTR2NP1.js";import{X as A,ay as te,az as X,S as q,aA as Y,l as _,aB as ae,aC as Z,_ as ce,I as xe,H as ge,k as he,aD as ye,x as me,am as be,a9 as ue,E as pe,u as re,d as fe,aE as we}from"./ui-components-DjgDPiqV.js";const ve=({filePath:F,onClose:h})=>{const{t}=ee("components"),[p,V]=o.useState([]),[N,U]=o.useState(!0),[M,s]=o.useState(null),[d,T]=o.useState(""),[i,b]=o.useState(1),[P,$]=o.useState(!1),[v]=o.useState(50),[z,H]=o.useState(""),O=c=>{const n=c.split(`
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-KlPdWQ8K.js";import{a as de}from"./index-f67nhEoX.js";import{u as ee}from"./tools-BZTR2NP1.js";import{X as A,ay as te,az as X,S as q,aA as Y,l as _,aB as ae,aC as Z,_ as ce,I as xe,H as ge,k as he,aD as ye,x as me,am as be,a9 as ue,E as pe,u as re,d as fe,aE as we}from"./ui-components-DjgDPiqV.js";const ve=({filePath:F,onClose:h})=>{const{t}=ee("components"),[p,V]=o.useState([]),[N,U]=o.useState(!0),[M,s]=o.useState(null),[d,T]=o.useState(""),[i,b]=o.useState(1),[P,$]=o.useState(!1),[v]=o.useState(50),[z,H]=o.useState(""),O=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=O(x.content);V(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=z,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(A,{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:z}),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(A,{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(q,{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=>T(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(Y,{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(_,{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:z}),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(A,{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(q,{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=>T(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(Y,{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(_,{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,V]=o.useState([]),[N,U]=o.useState(!0),[M,s]=o.useState(null),[d,T]=o.useState(""),[i,b]=o.useState(1),[P,$]=o.useState(!1),[v]=o.useState(20),[z,H]=o.useState(""),[O,j]=o.useState(new Set),[y,f]=o.useState(null),C=a=>{const l=a.split(`
@@ -1 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{r as n}from"./monaco-editor-BWfQfpij.js";import{b as G,e as M,f as O,g as P,i as R,h as W}from"./index-B5hSSnK3.js";import{u as _}from"./tools-BZTR2NP1.js";import{r as y,K as F,M as K,N as p,O as H,Q,G as z,R as q,U as B,V as Y,Y as c,_ as J,$ as X,a0 as Z,d as ee,a1 as k,a2 as j,a3 as se,j as f}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.js";const ce=()=>{const{t:s,i18n:d}=_("pages"),{isMobile:a}=G(),{isCursorEngine:g,isLoading:o}=M(),[i,N]=n.useState(()=>localStorage.getItem("theme")||"auto"),[v,x]=n.useState(d.language),[w,m]=n.useState(()=>localStorage.getItem("agentstudio:chat-version")||"original");n.useEffect(()=>{o||localStorage.getItem("agentstudio:chat-version")||m(g?"agui":"original")},[o,g]);const{currentVersion:h,latestVersion:b,hasUpdate:C,forceCheck:$,isChecking:u,dismissUpdate:S,showUpdateNotification:E}=O(),{systemInfo:r,refetch:I}=P(),[l,V]=n.useState(R());n.useEffect(()=>{x(d.language)},[d.language]),n.useEffect(()=>{(()=>{i==="dark"?document.documentElement.classList.add("dark"):i==="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",i),window.dispatchEvent(new Event("themechange"))},[i]);const T=t=>{x(t),d.changeLanguage(t)},A=t=>{m(t),localStorage.setItem("agentstudio:chat-version",t)},D=()=>{$(),I()},U=()=>{const t=!l;W(t),V(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(y,{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")})]}),E&&b&&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(F,{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:b})}),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(K,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.viewReleases")]}),e.jsx("button",{onClick:S,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(p,{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:p},{value:"light",label:s("settings.general.theme.light"),icon:H},{value:"dark",label:s("settings.general.theme.dark"),icon:Q}].map(t=>e.jsxs("button",{onClick:()=>N(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 ${i===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(z,{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:()=>T(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center space-x-3 transition-all ${v===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",{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(q,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:s("settings.general.chatVersion.label","Chat Panel Version")})]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.chatVersion.description","Choose which chat panel implementation to use")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-3"}`,children:[{value:"original",label:s("settings.general.chatVersion.original","Original"),icon:"💬",description:s("settings.general.chatVersion.originalDesc","Classic chat interface")},{value:"agui",label:s("settings.general.chatVersion.agui","AGUI (Experimental)"),icon:"🚀",description:s("settings.general.chatVersion.aguiDesc","TDesign-based with AGUI protocol")}].map(t=>e.jsxs("button",{onClick:()=>A(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-start space-x-3 transition-all text-left ${w===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.icon}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium block",children:t.label}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:t.description})]})]},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(B,{className:"w-5 h-5"}),s("settings.systemInfo.title")]}),e.jsxs("button",{onClick:D,disabled:u,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(Y,{className:`w-3 h-3 mr-1 ${u?"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",h||r?.app.version||"-"]}),!C&&h&&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(J,{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(X,{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(y,{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(Z,{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(ee,{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(k,{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(k,{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:U,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(j,{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(se,{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(f,{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(j,{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(f,{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{ce as GeneralSettingsPage};
1
+ import{j as e}from"./data-structures-ChC1tqVg.js";import{r as n}from"./monaco-editor-BWfQfpij.js";import{b as G,e as M,f as O,g as P,i as R,h as W}from"./index-f67nhEoX.js";import{u as _}from"./tools-BZTR2NP1.js";import{r as y,K as F,M as K,N as p,O as H,Q,G as z,R as q,U as B,V as Y,Y as c,_ as J,$ as X,a0 as Z,d as ee,a1 as k,a2 as j,a3 as se,j as f}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.js";const ce=()=>{const{t:s,i18n:d}=_("pages"),{isMobile:a}=G(),{isCursorEngine:g,isLoading:o}=M(),[i,N]=n.useState(()=>localStorage.getItem("theme")||"auto"),[v,x]=n.useState(d.language),[w,m]=n.useState(()=>localStorage.getItem("agentstudio:chat-version")||"original");n.useEffect(()=>{o||localStorage.getItem("agentstudio:chat-version")||m(g?"agui":"original")},[o,g]);const{currentVersion:h,latestVersion:b,hasUpdate:C,forceCheck:$,isChecking:u,dismissUpdate:S,showUpdateNotification:E}=O(),{systemInfo:r,refetch:I}=P(),[l,V]=n.useState(R());n.useEffect(()=>{x(d.language)},[d.language]),n.useEffect(()=>{(()=>{i==="dark"?document.documentElement.classList.add("dark"):i==="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",i),window.dispatchEvent(new Event("themechange"))},[i]);const T=t=>{x(t),d.changeLanguage(t)},A=t=>{m(t),localStorage.setItem("agentstudio:chat-version",t)},D=()=>{$(),I()},U=()=>{const t=!l;W(t),V(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(y,{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")})]}),E&&b&&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(F,{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:b})}),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(K,{className:"w-3 h-3 mr-1"}),s("settings.systemInfo.viewReleases")]}),e.jsx("button",{onClick:S,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(p,{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:p},{value:"light",label:s("settings.general.theme.light"),icon:H},{value:"dark",label:s("settings.general.theme.dark"),icon:Q}].map(t=>e.jsxs("button",{onClick:()=>N(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 ${i===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(z,{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:()=>T(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-center space-x-3 transition-all ${v===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",{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(q,{className:`${a?"w-4 h-4":"w-5 h-5"}`}),e.jsx("span",{children:s("settings.general.chatVersion.label","Chat Panel Version")})]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-3",children:s("settings.general.chatVersion.description","Choose which chat panel implementation to use")}),e.jsx("div",{className:`${a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-3"}`,children:[{value:"original",label:s("settings.general.chatVersion.original","Original"),icon:"💬",description:s("settings.general.chatVersion.originalDesc","Classic chat interface")},{value:"agui",label:s("settings.general.chatVersion.agui","AGUI (Experimental)"),icon:"🚀",description:s("settings.general.chatVersion.aguiDesc","TDesign-based with AGUI protocol")}].map(t=>e.jsxs("button",{onClick:()=>A(t.value),className:`${a?"p-3":"p-4"} border-2 rounded-lg flex items-start space-x-3 transition-all text-left ${w===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.icon}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium block",children:t.label}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:t.description})]})]},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(B,{className:"w-5 h-5"}),s("settings.systemInfo.title")]}),e.jsxs("button",{onClick:D,disabled:u,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(Y,{className:`w-3 h-3 mr-1 ${u?"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",h||r?.app.version||"-"]}),!C&&h&&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(J,{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(X,{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(y,{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(Z,{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(ee,{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(k,{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(k,{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:U,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(j,{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(se,{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(f,{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(j,{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(f,{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{ce as GeneralSettingsPage};
@@ -1 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{r as h}from"./monaco-editor-BWfQfpij.js";import{u as O,b as Q,c as b,a as p,A as y}from"./agents-KlPdWQ8K.js";import{T as K,a as A,b as T,c,d as B,e as m}from"./table-BJUz-ck5.js";import{e as J}from"./index-B5hSSnK3.js";import{N as z}from"./EngineGate-DxTYx9wb.js";import{V as G,j as L,v as V,al as W,ag as X,G as Y,e as F,T as E,m as Z,C as ee,n as te,J as re,y as ae}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./tools-BZTR2NP1.js";const _={PreToolUse:"工具执行前",PostToolUse:"工具成功执行后",PostToolUseFailure:"工具执行失败后",PermissionRequest:"请求权限时",SessionStart:"会话开始时",UserPromptSubmit:"用户提交提示时",Notification:"显示通知时"};async function se(l){const a=await p(`${y}/hooks`);if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to fetch hooks")}return a.json()}async function ne(l,n){const a=await p(`${y}/hooks?scope=${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to create hook")}return a.json()}async function q(l,n){const a=await p(`${y}/hooks/${encodeURIComponent(l)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to update hook")}return a.json()}async function oe(l){const n=await p(`${y}/hooks/${encodeURIComponent(l)}`,{method:"DELETE"});if(!n.ok){const a=await n.json();throw new Error(a.error||"Failed to delete hook")}}const be=()=>{const{isCursorEngine:l,isFeatureSupported:n}=J(),a=O(),[d,i]=h.useState(!1),[u,x]=h.useState(null),[w,j]=h.useState(null),[r,o]=h.useState({event:"PreToolUse",command:"",scope:"global",toolName:"",pathPattern:"",enabled:!0,timeout:""}),C=n("hooks"),{data:$,isLoading:U,error:f,refetch:D}=Q({queryKey:["hooks"],queryFn:()=>se(),enabled:C}),P=$?.hooks||[],k=b({mutationFn:t=>ne(t,r.scope),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),i(!1),g()}}),N=b({mutationFn:({id:t,data:s})=>q(t,s),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),i(!1),x(null),g()}}),v=b({mutationFn:oe,onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),j(null)}}),S=b({mutationFn:({id:t,enabled:s})=>q(t,{enabled:s}),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]})}}),g=()=>{o({event:"PreToolUse",command:"",scope:"global",toolName:"",pathPattern:"",enabled:!0,timeout:""})},R=t=>{x(t);const[s]=t.id.split(":");o({event:t.event,command:t.command,scope:s,toolName:t.matcher?.tool_name||t.matcher?.tool_names?.join(", ")||"",pathPattern:t.matcher?.path_pattern||"",enabled:t.enabled,timeout:t.timeout?.toString()||""}),i(!0)},I=t=>{t.preventDefault();const s=r.toolName||r.pathPattern?{...r.toolName&&{tool_names:r.toolName.split(",").map(M=>M.trim()).filter(Boolean)},...r.pathPattern&&{path_pattern:r.pathPattern}}:void 0,H={event:r.event,command:r.command,matcher:s,enabled:r.enabled,timeout:r.timeout?parseInt(r.timeout,10):void 0};u?N.mutate({id:u.id,data:H}):k.mutate(H)};return l||!C?e.jsx("div",{className:"p-6",children:e.jsx(z,{feature:"Hooks",description:"Hooks 是 Claude Code 特有的功能,Cursor 不支持此功能。"})}):U?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(G,{className:"w-8 h-8 animate-spin text-blue-500"})}):f?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-red-700 dark:text-red-400",children:[e.jsx(L,{className:"w-5 h-5"}),e.jsxs("span",{children:["加载失败: ",f instanceof Error?f.message:"未知错误"]})]}),e.jsx("button",{onClick:()=>D(),className:"mt-2 text-sm text-red-600 hover:text-red-700 dark:text-red-400",children:"重试"})]})}):e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Hooks"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"管理 Claude Code 钩子 - 在特定事件触发时自动执行的命令"})]}),e.jsxs("button",{onClick:()=>{x(null),g(),i(!0)},className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(V,{className:"w-4 h-4"}),e.jsx("span",{children:"添加 Hook"})]})]})}),P.length===0?e.jsxs("div",{className:"text-center py-12 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsx(W,{className:"w-12 h-12 mx-auto text-gray-400 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"暂无 Hooks"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"创建第一个 Hook 开始自动化工作流"}),e.jsx("button",{onClick:()=>{x(null),g(),i(!0)},className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"添加 Hook"})]}):e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsxs(K,{children:[e.jsx(A,{children:e.jsxs(T,{children:[e.jsx(c,{children:"事件"}),e.jsx(c,{children:"范围"}),e.jsx(c,{children:"命令"}),e.jsx(c,{children:"匹配器"}),e.jsx(c,{children:"状态"}),e.jsx(c,{className:"text-right",children:"操作"})]})}),e.jsx(B,{children:P.map(t=>{const[s]=t.id.split(":");return e.jsxs(T,{children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-blue-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.event}),e.jsx("div",{className:"text-xs text-gray-500",children:_[t.event]})]})]})}),e.jsx(m,{children:e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs ${s==="global"?"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300":"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300"}`,children:[s==="global"?e.jsx(Y,{className:"w-3 h-3"}):e.jsx(F,{className:"w-3 h-3"}),s==="global"?"全局":"本地"]})}),e.jsx(m,{children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded max-w-xs truncate block",children:t.command})}),e.jsxs(m,{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.matcher?e.jsxs("div",{className:"space-y-1",children:[t.matcher.tool_name&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),t.matcher.tool_name]}),t.matcher.tool_names&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),t.matcher.tool_names.join(", ")]}),t.matcher.path_pattern&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3 h-3"}),t.matcher.path_pattern]})]}):"-",t.timeout&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(Z,{className:"w-3 h-3"}),t.timeout,"ms"]})]}),e.jsx(m,{children:e.jsx("button",{onClick:()=>S.mutate({id:t.id,enabled:!t.enabled}),disabled:S.isPending,className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs transition-colors ${t.enabled?"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/50 dark:text-green-300":"bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-400"}`,children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-3 h-3"}),"启用"]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3"}),"禁用"]})})}),e.jsx(m,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>R(t),className:"p-1 text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/50 rounded transition-colors",title:"编辑",children:e.jsx(re,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>j(t),className:"p-1 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded transition-colors",title:"删除",children:e.jsx(ae,{className:"w-4 h-4"})})]})})]},t.id)})})]})}),d&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:u?"编辑 Hook":"创建 Hook"})}),e.jsxs("form",{onSubmit:I,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"事件类型"}),e.jsx("select",{value:r.event,onChange:t=>o({...r,event:t.target.value}),className:"w-full px-3 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",children:Object.entries(_).map(([t,s])=>e.jsxs("option",{value:t,children:[t," - ",s]},t))})]}),!u&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"范围"}),e.jsxs("select",{value:r.scope,onChange:t=>o({...r,scope:t.target.value}),className:"w-full px-3 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",children:[e.jsx("option",{value:"global",children:"全局 (~/.claude/settings.json)"}),e.jsx("option",{value:"local",children:"本地 (.claude/settings.local.json)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"命令"}),e.jsx("input",{type:"text",value:r.command,onChange:t=>o({...r,command:t.target.value}),className:"w-full px-3 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 font-mono",placeholder:"echo 'Hook triggered!'",required:!0}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"将在事件触发时执行的 shell 命令"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"工具匹配 (可选)"}),e.jsx("input",{type:"text",value:r.toolName,onChange:t=>o({...r,toolName:t.target.value}),className:"w-full px-3 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",placeholder:"Read, Write, Shell"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"多个工具用逗号分隔"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"路径匹配 (可选)"}),e.jsx("input",{type:"text",value:r.pathPattern,onChange:t=>o({...r,pathPattern:t.target.value}),className:"w-full px-3 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",placeholder:"**/*.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"超时 (毫秒, 可选)"}),e.jsx("input",{type:"number",value:r.timeout,onChange:t=>o({...r,timeout:t.target.value}),className:"w-full px-3 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",placeholder:"5000",min:"0"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:r.enabled,onChange:t=>o({...r,enabled:t.target.checked}),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("label",{htmlFor:"enabled",className:"text-sm text-gray-700 dark:text-gray-300",children:"启用此 Hook"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:()=>{i(!1),x(null),g()},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"取消"}),e.jsx("button",{type:"submit",disabled:k.isPending||N.isPending,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:k.isPending||N.isPending?"保存中...":"保存"})]})]})]})}),w&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md p-6",children:[e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"确认删除"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"确定要删除此 Hook 吗?此操作无法撤销。"}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>j(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"取消"}),e.jsx("button",{onClick:()=>v.mutate(w.id),disabled:v.isPending,className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50",children:v.isPending?"删除中...":"删除"})]})]})})]})};export{be as HooksPage};
1
+ import{j as e}from"./data-structures-ChC1tqVg.js";import{r as h}from"./monaco-editor-BWfQfpij.js";import{u as O,b as Q,c as b,a as p,A as y}from"./agents-KlPdWQ8K.js";import{T as K,a as A,b as T,c,d as B,e as m}from"./table-Clz57edU.js";import{e as J}from"./index-f67nhEoX.js";import{N as z}from"./EngineGate-BjHJu955.js";import{V as G,j as L,v as V,al as W,ag as X,G as Y,e as F,T as E,m as Z,C as ee,n as te,J as re,y as ae}from"./ui-components-DjgDPiqV.js";import"./syntax-highlighting-DGbNjS3S.js";import"./tools-BZTR2NP1.js";const _={PreToolUse:"工具执行前",PostToolUse:"工具成功执行后",PostToolUseFailure:"工具执行失败后",PermissionRequest:"请求权限时",SessionStart:"会话开始时",UserPromptSubmit:"用户提交提示时",Notification:"显示通知时"};async function se(l){const a=await p(`${y}/hooks`);if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to fetch hooks")}return a.json()}async function ne(l,n){const a=await p(`${y}/hooks?scope=${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to create hook")}return a.json()}async function q(l,n){const a=await p(`${y}/hooks/${encodeURIComponent(l)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const d=await a.json();throw new Error(d.error||"Failed to update hook")}return a.json()}async function oe(l){const n=await p(`${y}/hooks/${encodeURIComponent(l)}`,{method:"DELETE"});if(!n.ok){const a=await n.json();throw new Error(a.error||"Failed to delete hook")}}const be=()=>{const{isCursorEngine:l,isFeatureSupported:n}=J(),a=O(),[d,i]=h.useState(!1),[u,x]=h.useState(null),[w,j]=h.useState(null),[r,o]=h.useState({event:"PreToolUse",command:"",scope:"global",toolName:"",pathPattern:"",enabled:!0,timeout:""}),C=n("hooks"),{data:$,isLoading:U,error:f,refetch:D}=Q({queryKey:["hooks"],queryFn:()=>se(),enabled:C}),P=$?.hooks||[],k=b({mutationFn:t=>ne(t,r.scope),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),i(!1),g()}}),N=b({mutationFn:({id:t,data:s})=>q(t,s),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),i(!1),x(null),g()}}),v=b({mutationFn:oe,onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]}),j(null)}}),S=b({mutationFn:({id:t,enabled:s})=>q(t,{enabled:s}),onSuccess:()=>{a.invalidateQueries({queryKey:["hooks"]})}}),g=()=>{o({event:"PreToolUse",command:"",scope:"global",toolName:"",pathPattern:"",enabled:!0,timeout:""})},R=t=>{x(t);const[s]=t.id.split(":");o({event:t.event,command:t.command,scope:s,toolName:t.matcher?.tool_name||t.matcher?.tool_names?.join(", ")||"",pathPattern:t.matcher?.path_pattern||"",enabled:t.enabled,timeout:t.timeout?.toString()||""}),i(!0)},I=t=>{t.preventDefault();const s=r.toolName||r.pathPattern?{...r.toolName&&{tool_names:r.toolName.split(",").map(M=>M.trim()).filter(Boolean)},...r.pathPattern&&{path_pattern:r.pathPattern}}:void 0,H={event:r.event,command:r.command,matcher:s,enabled:r.enabled,timeout:r.timeout?parseInt(r.timeout,10):void 0};u?N.mutate({id:u.id,data:H}):k.mutate(H)};return l||!C?e.jsx("div",{className:"p-6",children:e.jsx(z,{feature:"Hooks",description:"Hooks 是 Claude Code 特有的功能,Cursor 不支持此功能。"})}):U?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(G,{className:"w-8 h-8 animate-spin text-blue-500"})}):f?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-red-700 dark:text-red-400",children:[e.jsx(L,{className:"w-5 h-5"}),e.jsxs("span",{children:["加载失败: ",f instanceof Error?f.message:"未知错误"]})]}),e.jsx("button",{onClick:()=>D(),className:"mt-2 text-sm text-red-600 hover:text-red-700 dark:text-red-400",children:"重试"})]})}):e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Hooks"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"管理 Claude Code 钩子 - 在特定事件触发时自动执行的命令"})]}),e.jsxs("button",{onClick:()=>{x(null),g(),i(!0)},className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(V,{className:"w-4 h-4"}),e.jsx("span",{children:"添加 Hook"})]})]})}),P.length===0?e.jsxs("div",{className:"text-center py-12 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsx(W,{className:"w-12 h-12 mx-auto text-gray-400 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"暂无 Hooks"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"创建第一个 Hook 开始自动化工作流"}),e.jsx("button",{onClick:()=>{x(null),g(),i(!0)},className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"添加 Hook"})]}):e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsxs(K,{children:[e.jsx(A,{children:e.jsxs(T,{children:[e.jsx(c,{children:"事件"}),e.jsx(c,{children:"范围"}),e.jsx(c,{children:"命令"}),e.jsx(c,{children:"匹配器"}),e.jsx(c,{children:"状态"}),e.jsx(c,{className:"text-right",children:"操作"})]})}),e.jsx(B,{children:P.map(t=>{const[s]=t.id.split(":");return e.jsxs(T,{children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-blue-500"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.event}),e.jsx("div",{className:"text-xs text-gray-500",children:_[t.event]})]})]})}),e.jsx(m,{children:e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs ${s==="global"?"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300":"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300"}`,children:[s==="global"?e.jsx(Y,{className:"w-3 h-3"}):e.jsx(F,{className:"w-3 h-3"}),s==="global"?"全局":"本地"]})}),e.jsx(m,{children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded max-w-xs truncate block",children:t.command})}),e.jsxs(m,{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.matcher?e.jsxs("div",{className:"space-y-1",children:[t.matcher.tool_name&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),t.matcher.tool_name]}),t.matcher.tool_names&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),t.matcher.tool_names.join(", ")]}),t.matcher.path_pattern&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3 h-3"}),t.matcher.path_pattern]})]}):"-",t.timeout&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(Z,{className:"w-3 h-3"}),t.timeout,"ms"]})]}),e.jsx(m,{children:e.jsx("button",{onClick:()=>S.mutate({id:t.id,enabled:!t.enabled}),disabled:S.isPending,className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs transition-colors ${t.enabled?"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/50 dark:text-green-300":"bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-400"}`,children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-3 h-3"}),"启用"]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3"}),"禁用"]})})}),e.jsx(m,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>R(t),className:"p-1 text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/50 rounded transition-colors",title:"编辑",children:e.jsx(re,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>j(t),className:"p-1 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded transition-colors",title:"删除",children:e.jsx(ae,{className:"w-4 h-4"})})]})})]},t.id)})})]})}),d&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:u?"编辑 Hook":"创建 Hook"})}),e.jsxs("form",{onSubmit:I,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"事件类型"}),e.jsx("select",{value:r.event,onChange:t=>o({...r,event:t.target.value}),className:"w-full px-3 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",children:Object.entries(_).map(([t,s])=>e.jsxs("option",{value:t,children:[t," - ",s]},t))})]}),!u&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"范围"}),e.jsxs("select",{value:r.scope,onChange:t=>o({...r,scope:t.target.value}),className:"w-full px-3 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",children:[e.jsx("option",{value:"global",children:"全局 (~/.claude/settings.json)"}),e.jsx("option",{value:"local",children:"本地 (.claude/settings.local.json)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"命令"}),e.jsx("input",{type:"text",value:r.command,onChange:t=>o({...r,command:t.target.value}),className:"w-full px-3 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 font-mono",placeholder:"echo 'Hook triggered!'",required:!0}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"将在事件触发时执行的 shell 命令"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"工具匹配 (可选)"}),e.jsx("input",{type:"text",value:r.toolName,onChange:t=>o({...r,toolName:t.target.value}),className:"w-full px-3 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",placeholder:"Read, Write, Shell"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"多个工具用逗号分隔"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"路径匹配 (可选)"}),e.jsx("input",{type:"text",value:r.pathPattern,onChange:t=>o({...r,pathPattern:t.target.value}),className:"w-full px-3 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",placeholder:"**/*.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"超时 (毫秒, 可选)"}),e.jsx("input",{type:"number",value:r.timeout,onChange:t=>o({...r,timeout:t.target.value}),className:"w-full px-3 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",placeholder:"5000",min:"0"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:r.enabled,onChange:t=>o({...r,enabled:t.target.checked}),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("label",{htmlFor:"enabled",className:"text-sm text-gray-700 dark:text-gray-300",children:"启用此 Hook"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:()=>{i(!1),x(null),g()},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"取消"}),e.jsx("button",{type:"submit",disabled:k.isPending||N.isPending,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:k.isPending||N.isPending?"保存中...":"保存"})]})]})]})}),w&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md p-6",children:[e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"确认删除"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"确定要删除此 Hook 吗?此操作无法撤销。"}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>j(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"取消"}),e.jsx("button",{onClick:()=>v.mutate(w.id),disabled:v.isPending,className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50",children:v.isPending?"删除中...":"删除"})]})]})})]})};export{be as HooksPage};
@@ -1 +1 @@
1
- import{j as e}from"./data-structures-ChC1tqVg.js";import{r as d}from"./monaco-editor-BWfQfpij.js";import{u}from"./tools-BZTR2NP1.js";import{ap as N,d as k,a0 as f,G as g,aq as w,Z as o,_ as t,I as h,N as v,a3 as i,ar as C,e as A,o as p,m as S,as as F,t as E,X as s}from"./ui-components-DjgDPiqV.js";import{L as y}from"./index-B5hSSnK3.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.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-BZTR2NP1.js";import{ap as N,d as k,a0 as f,G as g,aq as w,Z as o,_ as t,I as h,N as v,a3 as i,ar as C,e as A,o as p,m as S,as as F,t as E,X as s}from"./ui-components-DjgDPiqV.js";import{L as y}from"./index-f67nhEoX.js";import"./syntax-highlighting-DGbNjS3S.js";import"./agents-KlPdWQ8K.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};