agent-tower 0.7.2-beta.4 → 0.7.2-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime/__tests__/cli-driver-lifecycle.test.js +12 -8
- package/dist/runtime/__tests__/cli-driver-lifecycle.test.js.map +1 -1
- package/dist/runtime/cli-driver.js +15 -9
- package/dist/runtime/cli-driver.js.map +1 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js +69 -0
- package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
- package/dist/services/__tests__/session-manager.team-run.test.js +3 -1
- package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
- package/dist/services/__tests__/terminal-manager.test.js +70 -0
- package/dist/services/__tests__/terminal-manager.test.js.map +1 -1
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +2 -2
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/terminal-manager.d.ts.map +1 -1
- package/dist/services/terminal-manager.js +9 -4
- package/dist/services/terminal-manager.js.map +1 -1
- package/dist/web/assets/AgentDemoPage-CaR_Yk9_.js +1 -0
- package/dist/web/assets/{AgentEnvironmentSettingsPage-DQjnDr-h.js → AgentEnvironmentSettingsPage-SnxiaHvN.js} +1 -1
- package/dist/web/assets/BranchSelect-D-kqavDG.js +1 -0
- package/dist/web/assets/BrandLogo-CC1alVsd.js +1 -0
- package/dist/web/assets/ConversationPage-RWKLxe1j.js +3 -0
- package/dist/web/assets/CreateTaskInput-SHJ1YpRe.js +1 -0
- package/dist/web/assets/{DemoPage-BkkueMuL.js → DemoPage-BHbnnZFF.js} +1 -1
- package/dist/web/assets/DesignSystemPage-ChCrzeKT.js +12 -0
- package/dist/web/assets/EditableTaskTitle-CGVeZUSt.js +70 -0
- package/dist/web/assets/{ExecutionPermissionSelector-BX5Xx8ta.js → ExecutionPermissionSelector-DcC4IBOF.js} +10 -10
- package/dist/web/assets/GeneralSettingsPage-C_tkwpmF.js +1 -0
- package/dist/web/assets/{LoadingPreviewPage-BxjpxLLP.js → LoadingPreviewPage-dE_jyl19.js} +1 -1
- package/dist/web/assets/McpSettingsPage-CIuQ4bvy.js +1 -0
- package/dist/web/assets/MemberAvatar-BG0VDZKf.js +1 -0
- package/dist/web/assets/MobileTaskDetail-DxE6ZDAS.js +5 -0
- package/dist/web/assets/NotificationSettingsPage-B-Ot2OMg.js +1 -0
- package/dist/web/assets/ProfileSettingsPage-Dn1lrjJr.js +3 -0
- package/dist/web/assets/ProjectKanbanPage-jcW8sA7x.js +12 -0
- package/dist/web/assets/ProjectSettingsPage-BFPty2eA.js +2 -0
- package/dist/web/assets/ProviderSettingsPage-DLq-GBxp.js +67 -0
- package/dist/web/assets/SettingsMasterDetail-UfyoKAum.js +1 -0
- package/dist/web/assets/TaskDetail-a1jalILy.js +3 -0
- package/dist/web/assets/TeamSettingsPage-BxGc4W7K.js +1 -0
- package/dist/web/assets/arc-dhk0OSs5.js +1 -0
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-DWO_DRgk.js → architectureDiagram-3BPJPVTR-BCNj6ZWE.js} +1 -1
- package/dist/web/assets/{at-sign-BFf8Sz8T.js → at-sign-C4VhWike.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-CJPYhE52.js → blockDiagram-GPEHLZMM-D1kmB9gz.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-Cx5IvcjB.js → c4Diagram-AAUBKEIU-DbWKTkSe.js} +1 -1
- package/dist/web/assets/channel-K0AG6Tl1.js +1 -0
- package/dist/web/assets/check-DYlb0A_N.js +1 -0
- package/dist/web/assets/{chevron-up-BwJT7iif.js → chevron-up-DOkDFvIc.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-D9cBNYgd.js → chunk-2J33WTMH-B3TA0-LD.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-BY8TNt6E.js → chunk-4BX2VUAB-CvPTiBSV.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-pT-HP-28.js → chunk-55IACEB6-xGe9Fu9Z.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-hy95xDLb.js → chunk-727SXJPM-H8pz3amK.js} +2 -2
- package/dist/web/assets/{chunk-AQP2D5EJ-DlUN-icr.js → chunk-AQP2D5EJ-BmYYNxcL.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-Dg2iMKZR.js → chunk-FMBD7UC4-BmOEsLTE.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-DMzFIsJ-.js → chunk-ND2GUHAM-C5MfA0xc.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-C6CgmKuM.js → chunk-QZHKN3VN-BcrGYZ7V.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-BTJ44hwx.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BTJ44hwx.js +1 -0
- package/dist/web/assets/code-block-OCS4YCEC-DLPrDBDy.js +2 -0
- package/dist/web/assets/confirm-dialog-BRkrtULz.js +1 -0
- package/dist/web/assets/content-DPCGELMz.js +2 -0
- package/dist/web/assets/{copy-r0aUdsl8.js → copy-CdzVE3kf.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-D-fvmvw-.js → cose-bilkent-S5V4N54A-CLQ-m71G.js} +1 -1
- package/dist/web/assets/cssMode-ChMyv9Nj.js +1 -0
- package/dist/web/assets/{dagre-BM42HDAG-H0bYI1f3.js → dagre-BM42HDAG-CmDqxOfn.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-DI568fLp.js → diagram-2AECGRRQ-D-fSbEll.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-BLcaBzw2.js → diagram-5GNKFQAL-HPywThAf.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-aL1cvl23.js → diagram-KO2AKTUF-DAzLhllz.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-DbOutAfH.js → diagram-LMA3HP47-DXYB9h8L.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-D_cWftAX.js → diagram-OG6HWLK6-vv4kz4Zo.js} +1 -1
- package/dist/web/assets/dialog-B_vC5R4B.js +5 -0
- package/dist/web/assets/{erDiagram-TEJ5UH35-DRe5V8Dx.js → erDiagram-TEJ5UH35-Cu6aVKAa.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-B5-vg_Nh.js → flowDiagram-I6XJVG4X-BKDe8WSQ.js} +1 -1
- package/dist/web/assets/{freemarker2-CXlYb2yX.js → freemarker2-DI2giuAo.js} +2 -2
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-B3iBFICN.js → ganttDiagram-6RSMTGT7-DMVLzmAE.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-CZ9zsKVw.js → gitGraphDiagram-PVQCEYII-vogzYdKn.js} +1 -1
- package/dist/web/assets/{globe-JXfw4MCF.js → globe-Rnn-nKw-.js} +1 -1
- package/dist/web/assets/handlebars-B9tmKQPV.js +1 -0
- package/dist/web/assets/hooks-DK4m7-FN.js +1 -0
- package/dist/web/assets/html-B_E2U0g5.js +1 -0
- package/dist/web/assets/htmlMode-DRHM_Cwq.js +1 -0
- package/dist/web/assets/icon-button-CuSuXgr_.js +1 -0
- package/dist/web/assets/index-B6Lvy5Sr.js +1 -0
- package/dist/web/assets/{index-CWEbo6pZ.js → index-B88xAivn.js} +5 -5
- package/dist/web/assets/index-BCV57B4O.js +41 -0
- package/dist/web/assets/index-CMjLMilU.js +1 -0
- package/dist/web/assets/index-CTG-4w90.js +1 -0
- package/dist/web/assets/index-Cz73HpYH.js +122 -0
- package/dist/web/assets/index-CzvAGoau.css +1 -0
- package/dist/web/assets/index-DENY_U7o.js +1 -0
- package/dist/web/assets/index-ZO2tqdha.js +1 -0
- package/dist/web/assets/{infoDiagram-5YYISTIA-DQU_sN8x.js → infoDiagram-5YYISTIA-CEfSHkNq.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BVGrNzJa.js → ishikawaDiagram-YF4QCWOH-BXKZuWtD.js} +1 -1
- package/dist/web/assets/javascript-ClWqjgn3.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW-DU4Md1Tq.js → journeyDiagram-JHISSGLW-wsOUYlu7.js} +1 -1
- package/dist/web/assets/{jsonMode-BMSvHUHa.js → jsonMode-DVAoDfae.js} +2 -2
- package/dist/web/assets/{kanban-definition-UN3LZRKU-DDPgCucq.js → kanban-definition-UN3LZRKU-DNsuvOrU.js} +1 -1
- package/dist/web/assets/kbd-B3m64lRd.js +1 -0
- package/dist/web/assets/{key-round-BHVp7u3Z.js → key-round-DpYSyeDH.js} +1 -1
- package/dist/web/assets/{layers-2tjjhM75.js → layers-CxqMQVmH.js} +1 -1
- package/dist/web/assets/{linear-D8yLBTVY.js → linear-BmmCZdOQ.js} +1 -1
- package/dist/web/assets/{link-CnunXc7X.js → link-DbSpzB1w.js} +1 -1
- package/dist/web/assets/liquid-CZf3xdoq.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-BiYvrSP0.js → lspLanguageFeatures-WhdC7zdf.js} +1 -1
- package/dist/web/assets/mdx-xzVEPP01.js +1 -0
- package/dist/web/assets/menu-0A0v_lRV.js +1 -0
- package/dist/web/assets/menu-styles-DWynpVVz.js +1 -0
- package/dist/web/assets/{mermaid-NOHMQCX5-9-DTTfp6.js → mermaid-NOHMQCX5-DmKVQY9m.js} +61 -62
- package/dist/web/assets/{message-square-QM0c6Dcv.js → message-square-CfNb-MTd.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-CCAuuWFZ.js → mindmap-definition-RKZ34NQL-0RzXjZ9G.js} +1 -1
- package/dist/web/assets/modal-Kpqn-nDO.js +1 -0
- package/dist/web/assets/{monaco-CrBn9oMJ.js → monaco-I1fXAMIt.js} +3 -3
- package/dist/web/assets/{paperclip-CC7nHUQ7.js → paperclip-BBrzKZQC.js} +1 -1
- package/dist/web/assets/{pencil-DIY0Hu5t.js → pencil-pzVKblxj.js} +1 -1
- package/dist/web/assets/people-C6b3eeLq.js +1 -0
- package/dist/web/assets/{pieDiagram-4H26LBE5-CXy_N5QX.js → pieDiagram-4H26LBE5-Bcvzb8TW.js} +2 -2
- package/dist/web/assets/popover-BYz89aiY.js +1 -0
- package/dist/web/assets/python-DL05HvW4.js +1 -0
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-Dt44QsS8.js → quadrantDiagram-W4KKPZXB-DwNhxMxj.js} +1 -1
- package/dist/web/assets/razor-BCZ3_uDf.js +1 -0
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-BL8D7Np0.js → requirementDiagram-4Y6WPE33-D2wSGYn2.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-I5nefO3A.js → sankeyDiagram-5OEKKPKP-l3LLF--T.js} +1 -1
- package/dist/web/assets/search-field-B5czD2Pl.js +1 -0
- package/dist/web/assets/select-DGwKE4l0.js +1 -0
- package/dist/web/assets/select-yem-xN9Z.js +1 -0
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-lbPrhX8g.js → sequenceDiagram-3UESZ5HK-BAGsbTS_.js} +1 -1
- package/dist/web/assets/{server-BNBdQGor.js → server-BIPZ9Ka-.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-Bw3qtv2M.js → stateDiagram-AJRCARHV-C0BHmXYX.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Be3UCkeQ.js +1 -0
- package/dist/web/assets/{textarea-CD82lB0Z.js → textarea-Bnfq7adW.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-Cfg_kgoa.js → timeline-definition-PNZ67QCA-Dt-DcRrG.js} +1 -1
- package/dist/web/assets/toggles-DxNDJZsN.js +1 -0
- package/dist/web/assets/tooltip-CHOgkFbE.js +1 -0
- package/dist/web/assets/track-B_K578io.js +1 -0
- package/dist/web/assets/{trash-2-BF_3L-qk.js → trash-2-ALAYDudv.js} +1 -1
- package/dist/web/assets/tsMode-kXxq-Lw7.js +11 -0
- package/dist/web/assets/typescript-E3_QcT_u.js +1 -0
- package/dist/web/assets/{upload-B2AMXrU-.js → upload-D7hKT2VA.js} +1 -1
- package/dist/web/assets/use-attachments-CK7y5KsN.js +2 -0
- package/dist/web/assets/use-profiles-Ncqxdw7S.js +1 -0
- package/dist/web/assets/{use-projects-BYUZwQ-q.js → use-projects-Dwy9AfAG.js} +1 -1
- package/dist/web/assets/{use-providers-DdV9gbj1.js → use-providers-BRyZjuBG.js} +1 -1
- package/dist/web/assets/use-workspaces-BBbahdwU.js +1 -0
- package/dist/web/assets/useNormalizedLogs-CRHRedwp.js +1 -0
- package/dist/web/assets/useTokenUsage-YwiF0xnT.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-CdEP03CK.js → vennDiagram-CIIHVFJN-Cr55FtiY.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-q_Enplrs.js → wardley-L42UT6IY-CtwMk9MJ.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DlL6fsid.js → wardleyDiagram-YWT4CUSO-BeyHmTu3.js} +1 -1
- package/dist/web/assets/xml-DxKND8qX.js +1 -0
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-B2OGqVKA.js → xychartDiagram-2RQKCTM6-9g34Lq8E.js} +1 -1
- package/dist/web/assets/yaml-BqpCqTY6.js +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/AgentDemoPage-Svq9Baa7.js +0 -1
- package/dist/web/assets/AgentLogo-I2etsqym.js +0 -1
- package/dist/web/assets/BranchSelect-Eb5UGWWX.js +0 -1
- package/dist/web/assets/BrandLogo-BjC1hcgv.js +0 -1
- package/dist/web/assets/ConversationPage-jEYUuSPT.js +0 -3
- package/dist/web/assets/CreateTaskInput-B_cRDkVq.js +0 -1
- package/dist/web/assets/DesignSystemPage-oM16R2Ta.js +0 -16
- package/dist/web/assets/GeneralSettingsPage-B0jFlgDl.js +0 -1
- package/dist/web/assets/McpSettingsPage-BErvd619.js +0 -1
- package/dist/web/assets/MemberAvatar-TVtoxQe8.js +0 -1
- package/dist/web/assets/NotificationSettingsPage-BETMBdj1.js +0 -1
- package/dist/web/assets/ProfileSettingsPage-C03ZAft-.js +0 -3
- package/dist/web/assets/ProjectKanbanPage-DsPxwoVf.js +0 -86
- package/dist/web/assets/ProjectSettingsPage-BwNM6VWs.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-CeNQPd74.js +0 -67
- package/dist/web/assets/SettingsMasterDetail-B_SI2h_k.js +0 -1
- package/dist/web/assets/TeamSettingsPage-BfgtMl_n.js +0 -1
- package/dist/web/assets/agent-meta-DOylIs2N.js +0 -1
- package/dist/web/assets/arc-BlZww3MO.js +0 -1
- package/dist/web/assets/channel-D9sA6Wxp.js +0 -1
- package/dist/web/assets/check-Cm7Vstpm.js +0 -1
- package/dist/web/assets/chevron-down-C6Ta4vyM.js +0 -1
- package/dist/web/assets/circle-alert-Dm2Pl-rU.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-2e2YVo9r.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-2e2YVo9r.js +0 -1
- package/dist/web/assets/code-block-OCS4YCEC-DizntuP_.js +0 -2
- package/dist/web/assets/confirm-dialog-DRpyE_qU.js +0 -1
- package/dist/web/assets/cssMode-DVorIr82.js +0 -1
- package/dist/web/assets/handlebars-BL0prPVZ.js +0 -1
- package/dist/web/assets/html-DJWeRkWe.js +0 -1
- package/dist/web/assets/htmlMode-D_fekqg9.js +0 -1
- package/dist/web/assets/index-CWbMMO6g.js +0 -122
- package/dist/web/assets/index-uXglTJ2_.css +0 -1
- package/dist/web/assets/javascript-CDfuzdfe.js +0 -1
- package/dist/web/assets/liquid-DHrNpv6c.js +0 -1
- package/dist/web/assets/mdx-CIEpgUOV.js +0 -1
- package/dist/web/assets/modal-BRoNvfhw.js +0 -1
- package/dist/web/assets/play-CIZVXiwM.js +0 -1
- package/dist/web/assets/python-BIs0pClJ.js +0 -1
- package/dist/web/assets/razor-JCx8NEwU.js +0 -1
- package/dist/web/assets/select-BmjoUfrV.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Xbc4HxDQ.js +0 -1
- package/dist/web/assets/switch-CEUHI4gI.js +0 -1
- package/dist/web/assets/task-kalEmHDc.js +0 -42
- package/dist/web/assets/task-priority-wLXAgVZZ.js +0 -1
- package/dist/web/assets/tsMode-DAHSkTAr.js +0 -11
- package/dist/web/assets/typescript-CptiLWGr.js +0 -1
- package/dist/web/assets/use-profiles-CQ-jIuiI.js +0 -1
- package/dist/web/assets/useNormalizedLogs-DdFsf-Z1.js +0 -1
- package/dist/web/assets/xml-DbPqkgZW.js +0 -1
- package/dist/web/assets/yaml-Deyq6Z5-.js +0 -1
- /package/dist/web/assets/{ProjectKanbanPage-DcpNTP1B.css → EditableTaskTitle-DcpNTP1B.css} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as I,r as a,p as ue,j as e,X as se,B as R,a9 as me,t as O,S as $,aa as xe,h as Q,v as H,l as U,T as he,Y as pe,ab as fe}from"./index-CWbMMO6g.js";import{u as re,a as ge,b as je,c as be}from"./use-projects-BYUZwQ-q.js";import{F as X,a as ve}from"./task-kalEmHDc.js";import{F as Y}from"./task-priority-wLXAgVZZ.js";import{P as ne,T as Ne}from"./trash-2-BF_3L-qk.js";import{M as V}from"./modal-BRoNvfhw.js";import{u as ye,B as Pe,F as ke}from"./BranchSelect-Eb5UGWWX.js";import{S as we}from"./SettingsMasterDetail-B_SI2h_k.js";import"./check-Cm7Vstpm.js";import"./copy-r0aUdsl8.js";import"./agent-meta-DOylIs2N.js";import"./AgentLogo-I2etsqym.js";import"./circle-alert-Dm2Pl-rU.js";import"./chevron-down-C6Ta4vyM.js";function Se({value:t,onChange:x,repoPath:o,placeholder:v,disabled:i,disabledMessage:l}){const{t:u}=I(),[d,b]=a.useState(""),[m,n]=a.useState([]),[h,f]=a.useState(!1),[g,y]=a.useState(-1),P=a.useRef(null),A=a.useRef(null),D=a.useRef(void 0),q=a.useCallback(async s=>{if(i||!o||!s){n([]),f(!1);return}try{const c=await ue.get("/filesystem/complete",{params:{basePath:o,prefix:s}});n(c.results),f(c.results.length>0),y(-1)}catch{n([]),f(!1)}},[i,o]);a.useEffect(()=>{if(clearTimeout(D.current),!d){n([]),f(!1);return}return D.current=setTimeout(()=>q(d),200),()=>clearTimeout(D.current)},[d,q]),a.useEffect(()=>{const s=c=>{A.current&&!A.current.contains(c.target)&&P.current&&!P.current.contains(c.target)&&f(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const w=s=>{if(i)return;const c=s.trim();!c||t.includes(c)||(x([...t,c]),b(""),f(!1),P.current?.focus())},S=s=>{i||x(t.filter((c,z)=>z!==s))},F=s=>{i||(s.type==="directory"?(b(s.path),P.current?.focus()):w(s.path))},M=(s,c)=>{i||(c.stopPropagation(),w(s.path.replace(/\/$/,"")))},E=s=>{s.nativeEvent.isComposing||s.nativeEvent.keyCode===229||i||(h&&m.length>0?s.key==="ArrowDown"?(s.preventDefault(),y(c=>Math.min(c+1,m.length-1))):s.key==="ArrowUp"?(s.preventDefault(),y(c=>Math.max(c-1,-1))):s.key==="Enter"?(s.preventDefault(),g>=0?F(m[g]):w(d)):s.key==="Escape"&&f(!1):s.key==="Enter"&&(s.preventDefault(),w(d)))};return e.jsxs("div",{children:[t.length>0&&e.jsx("div",{className:"border border-neutral-200 rounded-lg mb-2 divide-y divide-neutral-100",children:t.map((s,c)=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 group",children:[s.includes(".")&&!s.endsWith("/")?e.jsx(X,{size:14,className:"text-neutral-400 shrink-0"}):e.jsx(Y,{size:14,className:"text-amber-500 shrink-0"}),e.jsx("span",{className:"text-sm font-mono text-neutral-700 truncate flex-1",children:s}),e.jsx("button",{onClick:()=>S(c),disabled:i,className:"p-0.5 text-neutral-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity shrink-0 disabled:cursor-not-allowed disabled:hover:text-neutral-300",children:e.jsx(se,{size:14})})]},s))}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:P,type:"text",value:d,onChange:s=>b(s.target.value),onKeyDown:E,onFocus:()=>{d&&m.length>0&&f(!0)},placeholder:v??u("输入文件路径..."),disabled:i,className:"flex-1 px-3 py-2 border border-neutral-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-1 focus:ring-neutral-300 disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400"}),e.jsxs("button",{onClick:()=>w(d),disabled:i||!d.trim(),className:"flex items-center gap-1 px-3 py-2 text-sm bg-neutral-900 text-white rounded-lg hover:bg-neutral-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(ne,{size:14}),e.jsx("span",{children:u("添加")})]})]}),h&&e.jsx("div",{ref:A,className:"absolute z-50 left-0 right-0 mt-1 bg-white border border-neutral-200 rounded-lg shadow-lg max-h-[200px] overflow-y-auto",children:m.map((s,c)=>e.jsxs("button",{onClick:()=>F(s),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-neutral-50 transition-colors ${c===g?"bg-neutral-100":""}`,children:[s.type==="directory"?e.jsx(Y,{size:14,className:"text-amber-500 shrink-0"}):e.jsx(X,{size:14,className:"text-neutral-400 shrink-0"}),e.jsx("span",{className:"font-mono text-neutral-700 truncate flex-1",children:s.path}),s.type==="directory"&&e.jsx("span",{onClick:z=>M(s,z),className:"p-0.5 text-neutral-300 hover:text-emerald-600 shrink-0",title:u("添加此目录"),children:e.jsx(ve,{size:14})})]},s.path))})]}),i&&l&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:l})]})}function Ce({value:t,onChange:x}){const{t:o}=I(),[v,i]=a.useState(""),[l,u]=a.useState(""),d=()=>{const n=v.trim(),h=l.trim();!n||!h||(x([...t,{name:n,command:h}]),i(""),u(""))},b=n=>{x(t.filter((h,f)=>f!==n))},m=n=>{n.key==="Enter"&&!n.nativeEvent.isComposing&&n.nativeEvent.keyCode!==229&&(n.preventDefault(),d())};return e.jsxs("div",{children:[t.length>0&&e.jsx("div",{className:"border border-neutral-200 rounded-lg mb-2 divide-y divide-neutral-100",children:t.map((n,h)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 group",children:[e.jsx("span",{className:"text-sm font-medium text-neutral-700 w-28 shrink-0 truncate",children:n.name}),e.jsx("span",{className:"text-sm font-mono text-neutral-500 flex-1 truncate",children:n.command}),e.jsx("button",{onClick:()=>b(h),className:"p-0.5 text-neutral-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:e.jsx(se,{size:14})})]},h))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:v,onChange:n=>i(n.target.value),onKeyDown:m,placeholder:o("名称"),className:"w-28 shrink-0 px-3 py-2 border border-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-neutral-300"}),e.jsx("input",{type:"text",value:l,onChange:n=>u(n.target.value),onKeyDown:m,placeholder:o("命令"),className:"flex-1 px-3 py-2 border border-neutral-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-1 focus:ring-neutral-300"}),e.jsxs("button",{onClick:d,disabled:!v.trim()||!l.trim(),className:"flex items-center gap-1 px-3 py-2 text-sm bg-neutral-900 text-white rounded-lg hover:bg-neutral-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors shrink-0",children:[e.jsx(ne,{size:14}),e.jsx("span",{children:o("添加")})]})]})]})}function Re({projectId:t}){const{t:x}=I(),o=ye(t);return e.jsxs("div",{className:"py-5 first:pt-0 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:x("Default base branch")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:x("New task and TeamRun main workspaces start from this branch. Existing workspaces keep their base branch.")})]}),e.jsx(R,{variant:"ghost",size:"sm",onClick:()=>{o.refetch()},disabled:o.isFetching,"aria-label":x("Refresh"),children:e.jsx(me,{size:13,className:o.isFetching?"animate-spin":""})})]}),o.isPending?e.jsx("p",{className:"text-xs text-muted-foreground",children:x("Loading...")}):o.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:x("Could not load branches. Refresh to try again.")}):o.data&&e.jsx(De,{projectId:t,mainBranch:o.data.mainBranch,branches:o.data.branches,isRefreshing:o.isFetching,onRefresh:()=>{o.refetch()}},`${t}:${o.data.mainBranch}`)]})}function De({projectId:t,mainBranch:x,branches:o,isRefreshing:v,onRefresh:i}){const{t:l}=I(),u=a.useId(),[d,b]=a.useState(x),m=re(),n=async()=>{try{await m.mutateAsync({id:t,mainBranch:d}),O.success(l("Default base branch saved"))}catch{}};return e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{htmlFor:u,className:"block text-xs font-medium",children:l("Default base branch")}),e.jsx(Pe,{id:u,label:l("Default base branch"),value:d,branches:o,disabled:m.isPending,isRefreshing:v,onOpen:i,onChange:h=>{b(h),m.reset()}}),m.isError&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:l("Could not save the default base branch. Refresh and choose an existing local branch.")}),e.jsx(R,{size:"sm",onClick:()=>{n()},disabled:d===x||!o.includes(d)||m.isPending||v,children:m.isPending?l("Saving"):l("Save default base branch")})]})}function Z(t){return t?t.split(",").map(x=>x.trim()).filter(Boolean):[]}function ee(t){if(!t)return[];try{return JSON.parse(t)}catch{return[]}}function te(t){return typeof t.color!="string"||t.color.trim()===""?"bg-muted-foreground":t.color.startsWith("bg-")?t.color:t.color.startsWith("text-")?t.color.replace("text-","bg-"):"bg-muted-foreground"}function $e(){const{t}=I(),{data:x,isLoading:o}=ge({limit:100,includeArchived:!0}),v=re(),i=je(),l=be(),[u,d]=a.useState(""),[b,m]=a.useState(null),[n,h]=a.useState({copyFiles:[],setupScript:"",quickCommands:[]}),[f,g]=a.useState(!1),[y,P]=a.useState(null),[A,D]=a.useState(!1),[q,w]=a.useState(!1),[S,F]=a.useState(!1),[M,E]=a.useState(!1),[s,c]=a.useState(""),[z,_]=a.useState(!1),C=x?.data??[],N=a.useMemo(()=>C.filter(r=>!r.archivedAt),[C]),B=a.useMemo(()=>C.filter(r=>r.archivedAt),[C]),j=N.find(r=>r.id===u),L=a.useMemo(()=>C.find(r=>r.id===y)??null,[y,C]);if(a.useEffect(()=>{!u&&N.length>0&&d(N[0].id)},[N,u]),a.useEffect(()=>{if(b){N.some(r=>r.id===b)&&(d(b),m(null));return}u&&!N.some(r=>r.id===u)&&(d(N[0]?.id??""),g(!1))},[N,b,u]),a.useEffect(()=>{j&&!f&&h({copyFiles:Z(j.copyFiles),setupScript:j.setupScript??"",quickCommands:ee(j.quickCommands)})},[j,f]),o)return e.jsx($,{className:"max-w-5xl",children:e.jsx(xe,{})});if(C.length===0)return e.jsxs($,{className:"max-w-5xl",children:[e.jsx(Q,{title:t("项目配置")}),e.jsx(H,{message:t("暂无项目,请先创建项目")})]});const ae=()=>{u&&v.mutate({id:u,copyFiles:n.copyFiles.length>0?n.copyFiles.join(", "):null,setupScript:n.setupScript.trim()||null,quickCommands:n.quickCommands.length>0?JSON.stringify(n.quickCommands):null},{onSuccess:()=>g(!1)})},ie=r=>{m(null),d(r),g(!1),_(!0)},oe=()=>{j&&(P(j.id),F(!1),E(!1),D(!0))},G=()=>{i.isPending||(D(!1),P(null),F(!1),E(!1))},le=async()=>{if(y)try{await i.mutateAsync({id:y,deleteRepo:S}),O.success(t(S?"项目已删除,并清理了本地文件":"项目已删除")),g(!1),G()}catch{}},ce=r=>{const p=B.find(k=>k.id===r);P(r),c(p?.repoDeletedAt?p.repoPath:""),w(!0)},W=()=>{l.isPending||(w(!1),P(null),c(""))},de=async()=>{if(!(!y||L?.repoDeletedAt&&!s.trim()))try{const p=await l.mutateAsync({id:y,repoPath:s.trim()||void 0});O.success(t("项目已恢复"));for(const k of p.warnings)O.warning(k);g(!1),m(p.project.id),d(p.project.id),W()}catch{}},J=L?.name??t("this project"),K=!!L?.repoDeletedAt,T=j?.isGitRepo!==!1&&j?.worktreeReady!==!1;return e.jsxs(e.Fragment,{children:[e.jsxs($,{className:"max-w-5xl",children:[e.jsx(Q,{title:t("项目配置")}),N.length===0&&B.length===0?e.jsx(H,{message:t("暂无项目,请先创建项目")}):e.jsx(we,{items:N,selectedId:u,onSelectItem:ie,getItemId:r=>r.id,mobileShowDetail:z,onMobileBack:()=>_(!1),renderListItem:(r,p)=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:U("h-2 w-2 rounded-full shrink-0",p?"bg-primary-foreground/60":te(r))}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-medium",children:r.name}),e.jsx("div",{className:U("truncate text-[11px] font-mono",p?"text-primary-foreground/70":"text-muted-foreground"),children:r.repoPath.split("/").pop()})]})]}),renderListFooter:B.length>0?()=>e.jsxs("div",{className:"pt-3 mt-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 mb-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:t("已删除")}),e.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:B.length})]}),B.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-muted-foreground",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("div",{className:"truncate text-[12px]",children:r.name})}),e.jsx("button",{onClick:()=>ce(r.id),disabled:l.isPending,className:"shrink-0 text-[11px] hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60","aria-label":t("恢复项目"),children:e.jsx(fe,{size:12})})]},r.id))]}):void 0,renderDetail:r=>r?e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:U("h-2.5 w-2.5 rounded-full shrink-0",te(r))}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:r.name}),r.isGitRepo===!1&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:t("Local project")})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground font-mono mb-5",children:r.repoPath}),r.isGitRepo===!1&&e.jsx("div",{className:"mb-5 rounded-lg border border-info/25 bg-info/8 px-3 py-2 text-xs leading-relaxed text-info/90",children:t("Local projects only support local Solo tasks. Initialize Git to use worktrees and TeamRun.")}),e.jsxs("div",{className:"divide-y divide-border/60",children:[T&&e.jsx(Re,{projectId:r.id},r.id),e.jsxs("div",{className:"py-5 first:pt-0",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("自动复制文件")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("创建 worktree 时自动从主仓库复制的文件或目录,适用于 .env、node_modules 等不在 git 管理中的文件。支持 glob。")})]}),e.jsx(Se,{value:n.copyFiles,onChange:p=>{h(k=>({...k,copyFiles:p})),g(!0)},repoPath:r.repoPath,disabled:!T,disabledMessage:t("This setting applies only to Git worktree projects.")})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("Setup 脚本")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("创建 worktree 后自动执行的命令,每行一条。在 worktree 目录下执行,单条超时 5 分钟。")})]}),e.jsx("textarea",{value:n.setupScript,onChange:p=>{h(k=>({...k,setupScript:p.target.value})),g(!0)},placeholder:`pnpm install
|
|
2
|
-
pnpm run setup`,rows:4,disabled:!T,className:"w-full rounded-lg border border-input bg-muted/50 px-3 py-2 text-sm font-mono transition-colors focus:border-ring focus:bg-background focus:outline-none resize-none disabled:cursor-not-allowed disabled:opacity-50"}),!T&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t("This setting applies only to Git worktree projects.")})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("常用命令")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("在终端中可快速执行的命令,不会自动运行。")})]}),e.jsx(Ce,{value:n.quickCommands,onChange:p=>{h(k=>({...k,quickCommands:p})),g(!0)}})]})]}),e.jsx("div",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/10 p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(he,{size:15,className:"text-destructive mt-0.5 shrink-0","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[13px] font-medium text-foreground",children:t("删除项目")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("项目将从默认列表隐藏,历史记录保留。可选同时删除本地文件。")})]})]}),e.jsxs(R,{size:"sm",variant:"destructive",className:"shrink-0",onClick:oe,disabled:i.isPending||l.isPending,children:[e.jsx(Ne,{size:13}),t("删除项目")]})]})}),f&&e.jsx(pe,{saving:v.isPending,onSave:ae,onCancel:()=>{j&&h({copyFiles:Z(j.copyFiles),setupScript:j.setupScript??"",quickCommands:ee(j.quickCommands)}),g(!1)},className:"-mx-5"})]}):e.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:N.length>0?t("选择一个项目查看配置"):t("当前没有可配置的项目")})})]}),e.jsx(V,{isOpen:A,onClose:G,title:t("Delete Project"),action:e.jsxs(e.Fragment,{children:[e.jsx(R,{variant:"outline",onClick:G,disabled:i.isPending,children:t("Cancel")}),e.jsx(R,{variant:"destructive",onClick:le,disabled:i.isPending||S&&!M,children:i.isPending?t("Deleting..."):t("Delete Project")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t("项目「{title}」将从默认项目列表隐藏,但历史任务、workspace 和会话记录仍会保留。",{title:J})}),e.jsxs("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-muted px-3 py-3",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:r=>{F(r.target.checked),r.target.checked||E(!1)},className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t("同时删除本地项目文件")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("勾选后会删除项目路径指向的本地目录,并禁用代码/Git 相关能力。")})]})]}),S&&e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-3",children:[e.jsx("p",{className:"text-sm font-medium text-destructive",children:t("勾选后会连项目文件一起删除,请谨慎选择。")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("恢复该项目时需要重新绑定一个有效的项目路径。")}),e.jsxs("label",{className:"mt-3 flex items-start gap-2 text-xs text-foreground",children:[e.jsx("input",{type:"checkbox",checked:M,onChange:r=>E(r.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsx("span",{children:t("我已确认这会删除本地项目文件")})]})]}),i.isError&&e.jsx("p",{className:"text-xs text-destructive",children:i.error instanceof Error?i.error.message:t("Failed to delete project")})]})}),e.jsx(V,{isOpen:q,onClose:W,title:t("Restore Project"),action:e.jsxs(e.Fragment,{children:[e.jsx(R,{variant:"outline",onClick:W,disabled:l.isPending,children:t("Cancel")}),e.jsx(R,{onClick:de,disabled:l.isPending||K&&!s.trim(),children:l.isPending?t("Restoring..."):t("Restore Project")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:K?t("项目「{title}」的本地项目文件已删除。恢复前需要重新绑定一个有效的项目路径。",{title:J}):t("恢复后,项目会重新出现在默认项目列表中。")}),K&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:t("Project Path")}),e.jsx(ke,{value:s,onChange:c,validationMode:"directory"}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t("Agent Tower 会尽量校验项目 identity;如果 remote URL 或目录名不同,会给出警告但允许继续。")})]}),l.isError&&e.jsx("p",{className:"text-xs text-destructive",children:l.error instanceof Error?l.error.message:t("Failed to restore project")})]})})]})}export{$e as ProjectSettingsPage};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import{c as dt,m as ct,q as mt,p as ut,u as $,r as j,j as e,l as U,W as ze,T as Pe,I as se,B as A,V as xt,S as _e,aa as pt,h as ft,ae as gt,v as ht,C as vt,t as M,ab as bt,k as xe,af as yt,a7 as ye}from"./index-CWbMMO6g.js";import{c as jt,b as Nt,r as Fe,d as Oe,u as wt,e as Pt,E as Ct,f as Et,s as St,i as De,h as Re,a as Je,j as je,k as kt,l as It,m as At,p as Tt,n as _t,o as Ot,q as Ue,w as Dt,t as Rt}from"./ExecutionPermissionSelector-BX5Xx8ta.js";import{a as Ut,b as Lt,u as Kt,c as Mt,d as Bt,e as zt,f as Ft,g as Jt,h as $t}from"./use-providers-DdV9gbj1.js";import{C as qt}from"./confirm-dialog-DRpyE_qU.js";import{M as Ce}from"./modal-BRoNvfhw.js";import{S as Le}from"./select-BmjoUfrV.js";import{T as Ke}from"./textarea-CD82lB0Z.js";import{S as $e}from"./switch-CEUHI4gI.js";import{R as G,A as P,P as pe,U as Wt,a as Gt,b as Xt}from"./agent-meta-DOylIs2N.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import{A as ae}from"./AgentLogo-I2etsqym.js";import{C as qe}from"./chevron-down-C6Ta4vyM.js";import{S as Vt}from"./SettingsMasterDetail-B_SI2h_k.js";import{K as Yt}from"./key-round-BHVp7u3Z.js";import{T as We,P as Ne}from"./trash-2-BF_3L-qk.js";import{U as Ht}from"./upload-B2AMXrU-.js";import{P as Zt}from"./pencil-DIY0Hu5t.js";import"./check-Cm7Vstpm.js";const Qt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],es=dt("flask-conical",Qt);function ts(){return ct({queryKey:mt.system.cursorAgentModels,queryFn:()=>ut.get("/system/cursor-agent-models"),staleTime:1e3*60*10})}function ss({value:t,onChange:i}){const{t:a}=$(),{data:u,isLoading:m,isError:C}=ts(),s=u?.models??[],[k,r]=j.useState(!1),[v,b]=j.useState(""),x=j.useMemo(()=>{const f=v.trim().toLowerCase();return f?s.filter(E=>E.id.toLowerCase().includes(f)||E.label.toLowerCase().includes(f)):s},[s,v]);return e.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-w-0",children:[e.jsx("input",{type:"text",value:t,onChange:f=>{const E=f.target.value;i(E===""?void 0:E)},placeholder:a("留空为 auto;或直接输入模型 ID(与 cursor-agent --model 一致)"),className:"w-full px-3 py-1.5 text-sm border border-neutral-200 rounded focus:outline-none focus:ring-1 focus:ring-neutral-900 font-mono"}),e.jsxs("button",{type:"button",onClick:()=>r(f=>!f),disabled:m,className:"flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-900 disabled:opacity-50 w-fit",children:[e.jsx(qe,{size:14,className:U("transition-transform",k&&"rotate-180")}),m?a("正在加载 cursor-agent 模型列表…"):k?a("收起列表"):a("从本机 cursor-agent 选择({count} 个)",{count:s.length})]}),k&&!m&&e.jsxs("div",{className:"rounded-lg border border-neutral-200 bg-white shadow-sm overflow-hidden",children:[e.jsx("input",{type:"text",value:v,onChange:f=>b(f.target.value),placeholder:a("筛选模型…"),className:"w-full px-3 py-2 text-sm border-b border-neutral-100 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-neutral-300"}),e.jsxs("div",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",children:[e.jsx("button",{type:"button",onClick:()=>{i(void 0),r(!1),b("")},className:U("w-full px-3 py-2 text-left text-sm hover:bg-neutral-50",t?"text-neutral-700":"bg-neutral-50 font-medium"),children:a("默认 (auto)")}),x.map(f=>e.jsxs("button",{type:"button",onClick:()=>{i(f.id),r(!1),b("")},className:U("w-full px-3 py-2 text-left text-sm hover:bg-neutral-50 border-t border-neutral-100",t===f.id?"bg-blue-50/80":""),children:[e.jsx("div",{className:"font-mono text-xs text-neutral-900 break-all",children:f.id}),e.jsx("div",{className:"text-xs text-neutral-500 mt-0.5 break-words",children:f.label})]},f.id)),x.length===0&&e.jsx("div",{className:"px-3 py-4 text-xs text-neutral-400 text-center",children:a("无匹配项")})]})]}),(C||u?.error)&&e.jsxs("p",{className:"text-xs text-amber-700",children:[a("无法从本机加载模型列表({error})。仍可手动输入;或在安装 cursor-agent 的机器上运行",{error:u?.error??a("请求失败")}),e.jsx("code",{className:"mx-0.5 bg-neutral-100 px-1 rounded text-[11px]",children:"cursor-agent --list-models"}),a("查看 ID。")]})]})}function ns(t){if(!t)return null;try{const i=new URL(t);return i.protocol!=="http:"&&i.protocol!=="https:"?null:`${i.origin}${i.pathname}`}catch{return null}}function rs(t,i){if(!t)return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:new Intl.DateTimeFormat(i,{dateStyle:"medium",timeStyle:"medium"}).format(a)}function is({result:t}){const{locale:i,t:a}=$(),u=ns(t.target?.endpoint),m=rs(t.testedAt,i);return e.jsx("div",{"data-provider-test-result":!0,className:U("rounded-lg border px-4 py-3 text-sm",t.ok?"border-success/30 bg-success/10 text-success":"border-warning/30 bg-warning/10 text-foreground"),children:e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t.ok?e.jsx(ze,{size:16,className:"shrink-0"}):e.jsx(Pe,{size:16,className:"shrink-0 text-warning"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium",children:t.ok?t.stage==="connection"?a("连接测试通过"):a("本机可用性检查通过"):a("配置检查未通过")}),e.jsx("div",{className:"mt-0.5 break-words text-xs opacity-80",children:t.summary}),(u||m)&&e.jsxs("dl",{className:"mt-2 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs opacity-80",children:[u&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"font-medium",children:a("测试对象")}),e.jsx("dd",{className:"min-w-0",children:e.jsx("code",{className:"break-all",children:u})})]}),m&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"font-medium",children:a("测试时间")}),e.jsx("dd",{className:"min-w-0 break-words",children:e.jsx("time",{dateTime:t.testedAt,children:m})})]})]}),!t.ok&&e.jsx("div",{className:"mt-1 text-xs opacity-80",children:a("测试失败不会阻止保存。")})]})]})})}function as({options:t,value:i,onChange:a,label:u,efficiencyLabel:m,intelligenceLabel:C,followCliLabel:s,currentLabel:k,disabled:r=!1,error:v}){const b=t.findIndex(g=>g.value===i),x=i==="",f=j.useRef(b>=0?i:void 0),E=j.useRef(null),I=j.useRef(null),[B,J]=j.useState(!1);j.useEffect(()=>{b>=0&&(f.current=i)},[b,i]);const q=g=>{if(r||x||t.length===0)return;const w=t[Math.max(0,Math.min(t.length-1,g))];w&&w.value!==i&&a(w.value)},X=g=>{const w=I.current?.getBoundingClientRect();if(!w||w.width<=0)return;const W=Math.max(0,Math.min(1,(g-w.left)/w.width));q(Math.round(W*(t.length-1)))},L=b>=0?t[b]:void 0,K=b<0||t.length<2?0:b/(t.length-1)*100,R=j.useId(),V=`${R}-label`,_=`${R}-current`,D=`${R}-error`;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex min-h-8 items-center justify-between gap-3",children:[e.jsx("label",{id:V,className:"text-xs font-medium text-foreground",children:u}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e.jsx($e,{checked:x,disabled:r,onCheckedChange:g=>{a(g?"":f.current??t.find(w=>w.value==="medium")?.value??t[0]?.value??"")},"aria-label":s})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground","aria-hidden":"true",children:[e.jsx("span",{children:m}),e.jsx("span",{children:C})]}),e.jsxs("div",{id:R,ref:I,role:"slider",tabIndex:x||r?-1:0,"aria-labelledby":V,"aria-disabled":x||r,"aria-valuemin":0,"aria-valuemax":Math.max(0,t.length-1),"aria-valuenow":b>=0?b:void 0,"aria-valuetext":L?`${L.label}, ${L.value}`:s,"aria-describedby":v?`${_} ${D}`:_,onKeyDown:g=>{if(x||r||b<0)return;let w=b;if(g.key==="ArrowLeft"||g.key==="ArrowDown")w-=1;else if(g.key==="ArrowRight"||g.key==="ArrowUp")w+=1;else if(g.key==="Home")w=0;else if(g.key==="End")w=t.length-1;else return;g.preventDefault(),q(w)},onPointerDown:g=>{x||r||(E.current=g.pointerId,J(!0),g.currentTarget.setPointerCapture?.(g.pointerId),X(g.clientX))},onPointerMove:g=>{E.current===g.pointerId&&X(g.clientX)},onPointerUp:g=>{E.current===g.pointerId&&(E.current=null,J(!1),g.currentTarget.releasePointerCapture?.(g.pointerId))},onPointerCancel:()=>{E.current=null,J(!1)},className:U("relative mx-2.5 flex h-11 touch-pan-y items-center outline-none select-none",x||r?"cursor-not-allowed opacity-55":"cursor-pointer","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2"),children:[e.jsx("div",{className:"absolute inset-x-0 h-1 rounded-full bg-border"}),!x&&e.jsx("div",{className:"absolute left-0 h-1 rounded-full bg-primary transition-[width] duration-150 motion-reduce:transition-none",style:{width:`${K}%`}}),t.map((g,w)=>e.jsx("span",{"aria-hidden":"true",className:U("absolute size-3 -translate-x-1/2 rounded-full border-2 transition-colors motion-reduce:transition-none",!x&&w<=b?"border-primary bg-primary":"border-border bg-background"),style:{left:`${t.length<2?0:w/(t.length-1)*100}%`}},g.value)),!x&&L&&e.jsx("span",{"aria-hidden":"true",className:U("absolute size-5 -translate-x-1/2 rounded-full border-[5px] border-primary bg-background shadow-sm transition-[left,transform] duration-150 motion-reduce:transition-none",B&&"scale-110"),style:{left:`${K}%`}})]}),e.jsx("div",{id:_,className:"min-h-5 text-center text-xs text-muted-foreground",children:x?s:`${k}: ${L?.label??i} (${L?.value??i})`}),v&&e.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive",children:v})]})}const F={key:"appendPrompt",label:"追加 Prompt",type:"textarea",rows:3,placeholder:"追加到每次 prompt 末尾的文本"},Ge={[P.CLAUDE_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},F],[P.GEMINI_CLI]:[{key:"yolo",label:"自动批准操作(YOLO)",type:"switch"},F],[P.CURSOR_AGENT]:[{key:"force",label:"强制执行",type:"switch"},F],[P.CODEX]:[{key:"dangerouslyBypassApprovalsAndSandbox",label:"跳过所有确认和沙盒",type:"switch"},{key:"fastMode",label:"Fast 模式",type:"switch"},{key:"disableResponsesWebsocket",label:"禁用 WebSocket",type:"switch"},{key:"profile",label:"Profile",type:"input",placeholder:"~/.codex/config.toml 中的 profile 名称"},F],[P.QWEN_CODE]:[F],[P.KIRO_CLI]:[{key:"trustAllTools",label:"信任所有工具",type:"switch"},F],[P.OPENCODE]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},F],[P.PI_CODING_AGENT]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},{key:"supportsImages",label:"模型支持图片输入",type:"switch"},F],[P.GROK_BUILD]:[{key:"alwaysApprove",label:"始终批准操作",type:"switch"},F],[P.MINION_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},F]};function Me(){return{}}function Xe(t,i){return{...i}}const os=JSON.stringify({env:{ANTHROPIC_API_KEY:"",ANTHROPIC_BASE_URL:""}},null,2),ls=`# Codex config.toml 配置片段 — 通过 -c 参数注入,不会修改 ~/.codex/config.toml
|
|
2
|
-
# 参考: https://developers.openai.com/codex/config-sample
|
|
3
|
-
|
|
4
|
-
# ─── 模型与推理 ─────────────────────────────────────────────
|
|
5
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh | max | ultra
|
|
6
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
7
|
-
# model_verbosity = "medium" # low | medium | high
|
|
8
|
-
# service_tier = "fast"
|
|
9
|
-
# features.fast_mode = true
|
|
10
|
-
|
|
11
|
-
# ─── 自定义 Model Provider ──────────────────────────────────
|
|
12
|
-
# model_provider = "azure"
|
|
13
|
-
#
|
|
14
|
-
# [model_providers.azure]
|
|
15
|
-
# name = "Azure OpenAI"
|
|
16
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
17
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
18
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
19
|
-
# wire_api = "responses"
|
|
20
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
21
|
-
|
|
22
|
-
# ─── OpenAI 数据驻留 ────────────────────────────────────────
|
|
23
|
-
# [model_providers.openai-us]
|
|
24
|
-
# name = "OpenAI US"
|
|
25
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
26
|
-
# wire_api = "responses"
|
|
27
|
-
# requires_openai_auth = true
|
|
28
|
-
|
|
29
|
-
# ─── 本地 OSS (Ollama) ──────────────────────────────────────
|
|
30
|
-
# [model_providers.ollama]
|
|
31
|
-
# name = "Ollama"
|
|
32
|
-
# base_url = "http://localhost:11434/v1"
|
|
33
|
-
# wire_api = "responses"
|
|
34
|
-
`,ds=`# Codex config.toml snippet — injected through -c; ~/.codex/config.toml is not modified.
|
|
35
|
-
# Reference: https://developers.openai.com/codex/config-sample
|
|
36
|
-
|
|
37
|
-
# ─── Model and reasoning ────────────────────────────────────
|
|
38
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh | max | ultra
|
|
39
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
40
|
-
# model_verbosity = "medium" # low | medium | high
|
|
41
|
-
# service_tier = "fast"
|
|
42
|
-
# features.fast_mode = true
|
|
43
|
-
|
|
44
|
-
# ─── Custom Model Provider ──────────────────────────────────
|
|
45
|
-
# model_provider = "azure"
|
|
46
|
-
#
|
|
47
|
-
# [model_providers.azure]
|
|
48
|
-
# name = "Azure OpenAI"
|
|
49
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
50
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
51
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
52
|
-
# wire_api = "responses"
|
|
53
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
54
|
-
|
|
55
|
-
# ─── OpenAI data residency ──────────────────────────────────
|
|
56
|
-
# [model_providers.openai-us]
|
|
57
|
-
# name = "OpenAI US"
|
|
58
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
59
|
-
# wire_api = "responses"
|
|
60
|
-
# requires_openai_auth = true
|
|
61
|
-
|
|
62
|
-
# ─── Local OSS (Ollama) ─────────────────────────────────────
|
|
63
|
-
# [model_providers.ollama]
|
|
64
|
-
# name = "Ollama"
|
|
65
|
-
# base_url = "http://localhost:11434/v1"
|
|
66
|
-
# wire_api = "responses"
|
|
67
|
-
`;function cs(t,i){return t===P.CLAUDE_CODE?os:t===P.CODEX?i==="zh-CN"?ls:ds:""}function ms(t){return t===P.CLAUDE_CODE||t===P.CODEX}const we="::ACP";function Be(t,i){return i===G.ACP?`${t}${we}`:String(t)}function oe(t,i){const a=Xt(t);return i===G.ACP?`${a} (ACP)`:a}function us(t){return t.endsWith(we)?{agentType:t.slice(0,-we.length),runtimeType:G.ACP}:{agentType:t,runtimeType:G.CLI}}function xs(t,i){if(!t.trim())return t;try{const a=JSON.parse(t);if(!a.env||typeof a.env!="object"||Array.isArray(a.env))return t;const u=a.env;return i in u?(delete u[i],JSON.stringify(a,null,2)):t}catch{return t}}const Ve=Object.values(Ge).flat().reduce((t,i)=>(t[i.key]||(t[i.key]=i.label),t),{});Ve.permissionMode="权限策略";const Ye=Object.values(Ge).flat().reduce((t,i)=>(i.options&&(t[i.key]=Object.fromEntries(i.options.map(a=>[a.value,a.label]))),t),{});Ye.permissionMode={ASK:"每次询问",AUTO_APPROVE:"无限制",UNRESTRICTED:"无限制"};function ps(t,i){if(typeof i=="boolean")return i?ye("是"):ye("否");if(typeof i=="string"&&i){const a=Ye[t]?.[i];return a?ye(a):i}return String(i)}function H(t,i){return t instanceof Error?t.message:i}function fs(t){return t==="apiBaseUrl"?"API 地址":t==="apiKey"?"API Key":t==="reasoningEffort"?"思考强度":t==="model"?"模型":t==="executionPermission"?"执行权限":t==="fastMode"?"Fast 模式":t==="disableResponsesWebsocket"?"禁用 WebSocket":t}function gs(t){return{minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最高",ultra:"Ultra"}[t]??t}function hs(t){return`agent-tower-provider-backup-${t.replace(/[:.]/g,"-")}.json`}function vs(t,i){const a=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),u=URL.createObjectURL(a),m=document.createElement("a");m.href=u,m.download=t,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(u)}function bs(t){switch(t){case"CREATE":return{label:"新增",className:"bg-success/10 text-success"};case"OVERWRITE":return{label:"覆盖",className:"bg-warning/10 text-warning"};case"SKIP":return{label:"跳过",className:"bg-muted text-muted-foreground"}}}function ys({issue:t}){const{t:i}=$(),a=!t;return e.jsx("span",{className:U("inline-block h-2 w-2 rounded-full shrink-0",a?"bg-success":"bg-border"),title:t?`${i("不可用")}: ${i(t)}`:i("可用"),children:e.jsx("span",{className:"sr-only",children:i(a?"可用":"不可用")})})}function js({issue:t}){const{t:i}=$();return t?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:[e.jsx(yt,{size:11,"aria-hidden":"true"}),i("不可用")]}):e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",children:[e.jsx(ze,{size:11,"aria-hidden":"true"}),i("可用")]})}function Ns({title:t,status:i,defaultOpen:a=!1,children:u}){const[m,C]=j.useState(a);return e.jsxs("div",{className:"rounded-lg border border-border",children:[e.jsxs("button",{type:"button",onClick:()=>C(s=>!s),"aria-expanded":m,className:"w-full flex items-center justify-between rounded-lg px-4 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t}),i]}),e.jsx(qe,{size:14,"aria-hidden":"true",className:U("text-muted-foreground transition-transform motion-reduce:transition-none",m&&"rotate-180")})]}),m&&e.jsx("div",{className:"px-4 pb-4 space-y-3",children:u})]})}function ws({isOpen:t,onClose:i,providerId:a,initialData:u,onSave:m}){const{locale:C,t:s}=$(),k=Ut(),[r,v]=j.useState(u??{name:"",agentType:P.CLAUDE_CODE,runtimeType:G.CLI,executionPermission:"ASK",config:Me(),settings:"",env:[],simplified:{apiKey:{configured:!1,envKey:"ANTHROPIC_API_KEY"}},diagnostics:[],isDefault:!1}),[b,x]=j.useState(()=>JSON.stringify(r.config,null,2)),[f,E]=j.useState(""),[I,B]=j.useState(()=>r.diagnostics?.find(n=>n.field==="settings")?.message??""),[J,q]=j.useState(!1),[X,L]=j.useState(!1),[K,R]=j.useState(null),[V,_]=j.useState(()=>new Set),[D,g]=j.useState(()=>r.diagnostics?.filter(n=>n.code==="CONFLICT")??[]),[w,W]=j.useState({}),Z=j.useRef(jt()),{data:fe}=Lt(r.agentType,r.simplified.model,{providerId:a,runtimeType:r.runtimeType,config:r.config,settings:r.settings}),y=fe?.[r.agentType]??pe[r.agentType],z=y.apiBaseUrl?Nt(r.simplified.apiBaseUrl):null,le=Fe(r),Q=r.executionPermission??le.mode,ne=y.executionPermissionOptions?.[r.runtimeType],de=ne?.find(n=>n.mode===Q),Y=le.diagnostics[0]?.message??(ne?de?.selectable?null:de?.reasons[0]?.message??s("This Agent has no available execution permission mode."):s("Loading permission support…")),c=y.disableResponsesWebsocket,p=c?Oe(r.config,c):null,S=y.fastMode,T=S?Oe(r.config,S):null,Ee=S?r.config[S.path]:void 0,He=Ee===!0?"fast":Ee===!1?"standard":"inherit",ge=r.simplified.reasoningEffort??"",ce=ge&&!y.reasoningEffort?.options?.includes(ge)?s("请选择当前 Agent 支持的思考强度档位"):null,he=n=>{Z.current.invalidate(),n&&v(n),L(!0),R(null)},O=n=>{he(n)},Se=()=>{X&&!window.confirm(s("存在未保存的修改,确定放弃吗?"))||i()},Ze=n=>r.env.find(o=>je(o.key,n)),re=(n,o,l="")=>{if(o.action!=="keep"){const d=n===y.apiBaseUrl?.path?"apiBaseUrl":n===y.apiKey?.path?"apiKey":null;d&&W(h=>{const N={...h};return delete N[d],N})}O(d=>{const h=d.env.findIndex(lt=>je(lt.key,n)),N=[...d.env],te=h>=0?N[h]:null,ie={key:te?.key??n,value:l,write:o,configured:te?.configured??!1,sensitive:je(n,d.simplified.apiKey?.envKey)||!!te?.sensitive||/key|token|secret|password|auth/i.test(n)};h>=0?N[h]=ie:N.push(ie);const ot=d.agentType===P.CLAUDE_CODE&&o.action!=="keep"&&(n===y.apiBaseUrl?.path||n===y.apiKey?.path);return{...d,env:N,settings:ot?xs(d.settings,n):d.settings}})},me=(n,o)=>{W(l=>{if(!(n in l))return l;const d={...l};return delete d[n],d}),_(l=>new Set(l).add(n)),n==="apiBaseUrl"&&y.apiBaseUrl?.kind==="env"&&re(y.apiBaseUrl.path,o?{action:"replace",value:o}:{action:"clear"},o),O(l=>{const d=Ot(l,n,o,y);return d.config!==l.config&&x(JSON.stringify(d.config,null,2)),d})},Qe=n=>{c&&O(o=>{const l=Ue(o,c,n);return x(JSON.stringify(l.config,null,2)),l})},et=n=>{S&&O(o=>{const l=Ue(o,S,n==="inherit"?void 0:n==="fast");return x(JSON.stringify(l.config,null,2)),l})},tt=n=>{if(X&&!window.confirm(s("切换 Agent 类型会清空当前类型的配置,是否继续?")))return;const{agentType:o,runtimeType:l}=us(n),d=pe[o],h=Me(),N={...r,agentType:o,runtimeType:l,executionPermission:Q,executionPermissionReviewRequired:void 0,config:h,settings:"",env:[],simplified:{apiKey:d.apiKey?{configured:!1,envKey:d.apiKey.path}:void 0}};he(()=>N),x(JSON.stringify(h,null,2)),E(""),B(""),q(!1),_(new Set),g([]),W({})},ke=(n=!1)=>{let o=!f&&!Y&&!T?.error&&!p?.error&&!ce;const l=r.settings.trim();if(l&&(J||n))try{if(r.agentType===P.CODEX)Tt(l);else if(r.agentType===P.CLAUDE_CODE){const d=JSON.parse(l);if(!d||typeof d!="object"||Array.isArray(d))throw new Error(s("JSON 顶层必须是对象"))}B("")}catch(d){B(s("{format} 语法错误: {message}",{format:r.agentType===P.CODEX?"TOML":"JSON",message:d instanceof Error?d.message:String(d)})),o=!1}return o},Ie=()=>{const n=_t(r.env),o=Object.fromEntries([...V].map(l=>[l,r.simplified[l]]));return{providerId:a,name:r.name,agentType:r.agentType,runtimeType:r.runtimeType,executionPermission:Q,env:n,config:r.config,settings:r.settings,simplified:V.size>0?o:void 0,conflictResolutions:w,isDefault:r.isDefault}},st=()=>{if(z||!ke(!1))return;const o={...Ie()};delete o.providerId,a&&delete o.runtimeType,m(o)},nt=()=>{if(z||D.length>0||!ke(!0))return;const n=Z.current.begin();R(null),k.mutate(Ie(),{onSuccess:o=>{Z.current.isCurrent(n)&&R(o)},onError:o=>{Z.current.isCurrent(n)&&R({ok:!1,stage:"connection",errorKind:"unknown",summary:H(o,s("测试配置失败"))})}})};if(!t)return null;const rt=ms(r.agentType),ue=r.agentType===P.CODEX,ve=ue&&wt(r.settings),ee=r.simplified.apiKey?.envKey??y.apiKey?.path,be=ee?Ze(ee):void 0,Ae=Pt(be,!!r.simplified.apiKey?.configured,w.apiKey),it=Ae==="advanced",Te=Ae!=="unconfigured",at=!r.name.trim()||!!z||!!f||!!Y||!!T?.error||!!p?.error||!!ce||!!I&&J||D.length>0;return e.jsx(e.Fragment,{children:e.jsx(Ce,{isOpen:t,onClose:Se,title:s(u?"编辑 Provider":"新建 Provider"),className:"max-w-3xl",action:e.jsxs("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(A,{variant:"outline",onClick:nt,disabled:k.isPending||!!z||!!f||!!Y||!!T?.error||!!p?.error||!!ce||!!I&&J||D.length>0,children:[k.isPending?e.jsx(xt,{className:"animate-spin"}):e.jsx(es,{}),k.isPending?s("测试中..."):s("测试配置")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(A,{variant:"outline",onClick:Se,children:s("取消")}),e.jsx(A,{onClick:st,disabled:at,children:s("保存 Provider")})]})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-name",className:"mb-1 block text-xs font-medium text-foreground",children:s("名称")}),e.jsx(se,{id:"provider-name",value:r.name,onChange:n=>O(o=>({...o,name:n.target.value})),placeholder:s("例如: Claude Code (官方)")})]}),!u&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("Agent 类型")}),e.jsx(Le,{value:Be(r.agentType,r.runtimeType),onChange:tt,options:Wt.flatMap(n=>Gt[n].map(o=>({value:Be(n,o),label:oe(n,o),icon:e.jsx(ae,{agentType:n,className:"size-4"})}))),placeholder:s("选择 Agent 类型")})]}),u&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("Agent 类型")}),e.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-lg border border-neutral-200 bg-muted/30 px-3 text-sm text-muted-foreground",children:[e.jsx(ae,{agentType:r.agentType,className:"size-4"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(r.agentType,r.runtimeType)})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"isDefault",checked:r.isDefault,onChange:n=>O(o=>({...o,isDefault:n.target.checked})),className:"h-4 w-4 rounded border-border accent-primary"}),e.jsx("label",{htmlFor:"isDefault",className:"text-sm text-foreground",children:s("设为该类型的默认 Provider")})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/20 p-4",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:s("基本配置")}),e.jsx(Ct,{value:Q,agentType:r.agentType,options:ne,error:Y,onChange:n=>O(o=>{const l=Dt(o.agentType,o.config);return x(JSON.stringify(l,null,2)),{...o,executionPermission:n,executionPermissionReviewRequired:void 0,config:l}})}),y.apiBaseUrl&&!ve&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-api-url",className:"mb-1 block text-xs font-medium text-foreground",children:s("API 地址")}),e.jsx(se,{id:"provider-api-url",type:"url",value:r.simplified.apiBaseUrl??"",onChange:n=>me("apiBaseUrl",n.target.value),placeholder:y.apiBaseUrl.placeholder,"aria-invalid":!!z,"aria-describedby":z?"provider-api-url-error":void 0}),z&&e.jsx("p",{id:"provider-api-url-error",role:"alert",className:"mt-1 text-xs text-destructive",children:s("请输入以 http:// 或 https:// 开头的完整 API 地址")})]}),y.apiKey&&!ve&&(r.agentType!==P.CODEX||!!r.simplified.apiKey)&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:"provider-api-key",className:"text-xs font-medium text-foreground",children:"API Key"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Yt,{size:12}),s(it?"由高级配置管理":Te?"已配置":"未配置")]})]}),be?.write.action==="replace"||!Te?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(se,{id:"provider-api-key",type:"password",autoComplete:"new-password",value:be?.value??"",onChange:n=>re(ee,{action:"replace",value:n.target.value},n.target.value),placeholder:s("输入 API Key")}),r.simplified.apiKey?.configured&&e.jsx(A,{variant:"outline",size:"sm",onClick:()=>re(ee,{action:"keep"}),children:s("取消替换")})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx(A,{variant:"outline",size:"sm",onClick:()=>re(ee,{action:"replace",value:""}),children:s("替换")}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>{window.confirm(s("确定清除此 API Key?"))&&re(ee,{action:"clear"})},children:s("清除")})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-model",className:"mb-1 block text-xs font-medium text-foreground",children:s("模型")}),r.agentType===P.CURSOR_AGENT?e.jsx(ss,{value:r.simplified.model??"",onChange:n=>me("model",n??"")}):e.jsx(se,{id:"provider-model",value:r.simplified.model??"",onChange:n=>me("model",n.target.value),placeholder:y.model.placeholder})]}),y.reasoningEffort&&e.jsx(as,{options:(y.reasoningEffort.options??[]).map(n=>({value:n,label:s(gs(n))})),value:ge,onChange:n=>me("reasoningEffort",n),label:s("思考强度"),efficiencyLabel:s("更高效"),intelligenceLabel:s("更智能"),followCliLabel:s("跟随 CLI"),currentLabel:s("当前"),error:ce}),S&&T&&e.jsxs("section",{className:"border-t border-border pt-3","data-fast-mode-control":!0,children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_180px] sm:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:s("Fast 模式")}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:s("支持的模型速度约提升至 1.5 倍,并增加用量消耗。ChatGPT 登录消耗更多额度;API Key 按 Priority 处理计费。")})]}),e.jsx(Le,{value:He,disabled:!!T.error,onChange:et,options:[{value:"inherit",label:s("跟随 Codex")},{value:"standard",label:s("标准速度")},{value:"fast",label:"Fast"}]})]}),T.error&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:s("Fast 模式字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]}),c&&p&&e.jsxs("section",{className:"border-t border-border pt-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:s("禁用 WebSocket")}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:s(ve?"当前原生 Provider 已使用非 WebSocket 传输;此开关不会添加额外运行时覆盖。":"仅禁用 Codex Responses API 的 WebSocket 传输;新启动和后续继续的请求将使用 HTTP。")})]}),e.jsx($e,{checked:p.enabled,disabled:!!p.error,onCheckedChange:Qe,"aria-label":s("禁用 WebSocket")})]}),p.error&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:s("禁用 WebSocket 字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]})]}),K&&e.jsx(is,{result:K}),D.length>0&&e.jsxs("div",{className:"space-y-3 rounded-lg border border-warning/30 bg-warning/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Pe,{size:16,className:"text-warning"}),s("需要解决配置冲突")]}),D.map(n=>e.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-warning/20 bg-background/70 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:s(fs(n.field))})," · ",s("简化字段与高级配置值不同")]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["simple","advanced"].map(o=>e.jsx(A,{variant:"outline",size:"sm",onClick:()=>{const l=n.field,d=Et(r,l,o,y);O(()=>d),x(JSON.stringify(d.config,null,2)),W(h=>({...h,[l]:o})),o==="advanced"&&(l==="apiBaseUrl"||l==="model"||l==="reasoningEffort")&&_(h=>{const N=new Set(h);return N.delete(l),N}),g(h=>h.filter(N=>N.field!==l))},children:s(o==="simple"?"采用简化值":"保留高级值")},o))})]},n.field))]}),e.jsxs(Ns,{title:s("高级配置"),defaultOpen:!!f||!!I||!!Y||!!T?.error||D.length>0,children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("运行配置 (JSON)")}),e.jsx(Ke,{value:b,onChange:n=>{const o=n.target.value;x(o);try{const l=JSON.parse(o);if(!l||typeof l!="object"||Array.isArray(l))throw new Error(s("JSON 顶层必须是对象"));const d=l;E(""),_(h=>{const N=new Set(h).add("model");return y.reasoningEffort?.kind==="config"&&N.add("reasoningEffort"),N}),O(h=>({...h,config:d,simplified:St(h.simplified,d,y)}))}catch(l){he(),E(l instanceof Error?l.message:s("JSON 语法错误"))}},rows:7,className:"font-mono","aria-invalid":!!f}),f&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:f})]}),e.jsxs("div",{className:"border-t border-border pt-3",children:[e.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:s("环境变量")}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[s("注入到 Agent 进程的环境变量。Codex 的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"env_key"})," ",s("指定的是变量名,实际值需在此处设置。")]}),e.jsxs("div",{className:"space-y-2",children:[r.env.map((n,o)=>n.write.action!=="clear"&&e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(se,{value:n.key,disabled:n.configured,onChange:l=>{const d=l.target.value;O(h=>{const N=[...h.env],te=N[o];if(!te)return h;const ie={...te,key:d};return N[o]={...ie,sensitive:De(ie,h.simplified)},{...h,env:N}})},placeholder:s("变量名,如 AZURE_OPENAI_API_KEY"),className:"flex-1 py-1.5 font-mono"}),e.jsx(se,{value:n.value,type:De(n,r.simplified)?"password":"text",onChange:l=>{const d=[...r.env];d[o]={...d[o],value:l.target.value,write:{action:"replace",value:l.target.value}},O(h=>({...h,env:d,simplified:n.key===y.apiBaseUrl?.path?{...h.simplified,apiBaseUrl:l.target.value}:h.simplified})),n.key===y.apiBaseUrl?.path&&_(h=>new Set(h).add("apiBaseUrl"))},placeholder:n.configured&&n.write.action==="keep"?s("已配置,输入新值以替换"):s("值"),className:"flex-1 py-1.5 font-mono"}),e.jsx("button",{type:"button",onClick:()=>{const l=[...r.env];n.configured?l[o]={...n,value:"",write:{action:"clear"}}:l.splice(o,1),O(d=>({...d,env:l,simplified:n.key===y.apiBaseUrl?.path?{...d.simplified,apiBaseUrl:""}:d.simplified})),n.key===y.apiBaseUrl?.path&&_(d=>new Set(d).add("apiBaseUrl"))},"aria-label":s("删除"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:e.jsx(We,{size:14})})]},o)),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>O(n=>({...n,env:[...n.env,{key:"",value:"",write:{action:"replace",value:""},configured:!1,sensitive:!1}]})),children:[e.jsx(Ne,{size:12,className:"mr-1"}),s("添加变量")]})]})]}),rt&&e.jsxs("div",{className:"border-t border-border pt-3",children:[e.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:s(ue?"Agent 原生配置 (config.toml)":"Agent 原生配置 (settings.json)")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:ue?e.jsxs(e.Fragment,{children:[s("直接填写 Codex")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"config.toml"})," ",s("格式的配置片段,由当前 Runtime 注入。不会修改你的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"~/.codex/config.toml"})," ",s("文件。")]}):e.jsxs(e.Fragment,{children:[s("对应 Claude Code 的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"~/.claude/settings.json"}),",",s("由当前 Runtime 注入。在")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"env"})," ",s("中设置 ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL 等。")]})}),e.jsx(Ke,{value:r.settings,onChange:n=>{const o=n.target.value;q(!0),B("");let l;if(ue)try{l=Re(r.simplified,o,P.CODEX),_(d=>new Set(d).add("reasoningEffort"))}catch{}O(d=>{const h=l===void 0?d.simplified:Re(d.simplified,o,P.CODEX,new Set(d.env.flatMap(N=>N.write.action==="clear"?[]:N.write.action==="replace"?N.value?[N.key]:[]:N.configured?[N.key]:[])));return{...d,settings:o,env:Rt(d.env,h),simplified:h}})},rows:10,className:"font-mono",placeholder:cs(r.agentType,C),"aria-invalid":!!I}),I&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:I})]})]})]})})})}function Ps({isOpen:t,onClose:i,onConfirm:a,acknowledged:u,onAcknowledgedChange:m,isLoading:C}){const{t:s}=$();return e.jsx(Ce,{isOpen:t,onClose:i,title:s("导出 Provider 备份"),className:"max-w-xl",action:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"outline",onClick:i,disabled:C,children:s("取消")}),e.jsx(A,{onClick:a,disabled:!u||C,children:s(C?"导出中...":"导出备份")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-warning/30 bg-warning/10 px-4 py-3 text-sm text-foreground",children:[e.jsx(Pe,{size:15,className:"mt-0.5 shrink-0 text-warning","aria-hidden":"true"}),e.jsx("span",{children:s("导出的备份文件将包含完整的 Provider 配置,包括环境变量、CLI settings 等敏感信息。任何拿到文件的人都可能直接使用这些 Provider。")})]}),e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:s("这个功能用于备份和迁移,不用于分享配置。")}),e.jsx("p",{children:s("导出内容只包含用户层配置:自定义 Provider,以及对内置 Provider 的覆盖。")})]}),e.jsxs("label",{className:"flex items-start gap-3 rounded-lg border border-border px-4 py-3 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:k=>m(k.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsx("span",{children:s("我已知晓该备份文件包含敏感信息,只会保存在安全位置。")})]})]})})}function Cs({isOpen:t,onClose:i,preview:a,backup:u,onConfirm:m,isLoading:C}){const{t:s}=$();if(!a||!u)return null;const k=a.summary.create+a.summary.overwrite,r=[...a.items].sort((v,b)=>{const x={CREATE:0,OVERWRITE:1,SKIP:2};return x[v.action]-x[b.action]});return e.jsx(Ce,{isOpen:t,onClose:i,title:s("导入 Provider 备份"),className:"max-w-3xl",action:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"outline",onClick:i,disabled:C,children:s("取消")}),e.jsx(A,{onClick:m,disabled:k===0||C,children:C?s("导入中..."):s("确认导入 {count} 项",{count:k})})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx("div",{children:s("导出时间:{value}",{value:new Date(u.exportedAt).toLocaleString()})}),e.jsx("div",{children:s("模式:完整备份(含敏感信息)")}),e.jsx("div",{children:s("文件内 Provider 数量:{count}",{count:u.providers.length})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-success/25 bg-success/10 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-success",children:s("新增")}),e.jsx("div",{className:"text-lg font-semibold text-foreground",children:a.summary.create})]}),e.jsxs("div",{className:"rounded-lg border border-warning/25 bg-warning/10 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-warning",children:s("覆盖")}),e.jsx("div",{className:"text-lg font-semibold text-foreground",children:a.summary.overwrite})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s("跳过")}),e.jsx("div",{className:"text-lg font-semibold text-foreground",children:a.summary.skip})]})]}),e.jsx("div",{className:"max-h-[420px] overflow-y-auto space-y-3 pr-1",children:r.map(v=>{const b=bs(v.action);return e.jsxs("div",{className:"rounded-lg border border-border px-4 py-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"truncate text-sm font-medium text-foreground",children:v.incoming.name}),e.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium ${b.className}`,children:s(b.label)})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ae,{agentType:v.incoming.agentType,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(v.incoming.agentType,v.incoming.runtimeType)})," · ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:v.incoming.id})]})]})}),v.action==="OVERWRITE"&&v.existing&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("将覆盖当前已有的 Provider:{name}",{name:v.existing.name})}),v.action==="SKIP"&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("当前同 ID Provider 配置一致,本次不会重复写入。")}),v.action==="CREATE"&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("当前不存在同 ID Provider,将直接新增。")})]},v.incoming.id)})})]})})}function Es({item:t,onEdit:i,onDelete:a}){const{t:u}=$(),m=t.provider,C=Je(t),s=kt(m),k=Xe(m.agentType,m.config),r=pe[m.agentType],v=Object.entries(k).filter(([x])=>x!=="cmd"&&x!==r.executionPermission.path),b=Object.keys(m.redactedEnv||{});return e.jsxs("div",{className:"min-w-0 space-y-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx("h3",{className:"min-w-0 truncate text-base font-semibold text-foreground",children:m.name}),e.jsx(js,{issue:C})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[e.jsx(ae,{agentType:m.agentType,className:"size-3.5"}),e.jsx("span",{className:"truncate",children:oe(m.agentType,m.runtimeType)})]}),m.isDefault&&e.jsx("span",{className:"rounded-full bg-primary/[0.06] px-2 py-0.5 text-[11px] font-medium text-primary",children:u("默认")}),m.builtIn&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:u("内置")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:shrink-0",children:[e.jsxs(A,{size:"sm",variant:"outline",onClick:i,children:[e.jsx(Zt,{size:13}),u("编辑")]}),e.jsxs(A,{size:"sm",variant:m.builtIn?"outline":"destructive",onClick:a,disabled:m.deletable===!1,children:[m.builtIn?e.jsx(bt,{size:13}):e.jsx(We,{size:13}),m.builtIn?u("恢复默认"):u("删除")]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{children:u("Execution permission")}),e.jsx("p",{className:"text-sm",children:u(It[Fe(m).mode])}),s&&!m.diagnostics?.some(x=>x.field==="executionPermission")?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:u(s)}):null,m.diagnostics?.filter(x=>x.field==="executionPermission").map((x,f)=>e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:u(x.message)},`${x.code}-${f}`)),C&&!s?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:u(C)}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:u("Changes apply when a new runtime starts. Running sessions keep their launch mode.")})]}),v.length>0&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("运行配置")}),e.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:v.map(([x,f])=>e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 bg-background px-4 py-2.5 sm:flex-row sm:items-center sm:gap-4",children:[e.jsx("span",{className:"min-w-0 break-words text-[13px] text-muted-foreground sm:w-32 sm:shrink-0",children:u(Ve[x]??x)}),e.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:ps(x,f)})]},x))})]}),b.length>0&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("环境变量")}),e.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:b.map(x=>e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 bg-background px-4 py-2.5 sm:gap-4",children:[e.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:x}),e.jsx("span",{className:"text-[13px] text-muted-foreground","aria-label":"hidden",children:"•••••"})]},x))})]}),m.settings?.trim()&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("Agent 原生配置")}),e.jsx("div",{className:"rounded-lg border border-border bg-muted/40 p-4",children:e.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:m.settings})})]}),v.length===0&&b.length===0&&!m.settings?.trim()&&e.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:u('该 Provider 未配置额外参数。点击"编辑"添加运行配置、环境变量或 Agent 原生配置。')})]})}function qs(){const{t}=$(),{data:i,isLoading:a}=Kt(),u=Mt(),m=Bt(),C=zt(),s=Ft(),k=Jt(),r=$t(),v=j.useRef(null),[b,x]=j.useState(null),[f,E]=j.useState(null),[I,B]=j.useState(null),[J,q]=j.useState(!1),[X,L]=j.useState(!1),[K,R]=j.useState(null),[V,_]=j.useState(!1),D=i??[],g=b??D[0]?.provider.id??null,w=c=>{u.mutate(c,{onSuccess:()=>E(null),onError:p=>M.error(H(p,t("创建 Provider 失败")))})},W=(c,p)=>{m.mutate({id:c,data:p},{onSuccess:()=>E(null),onError:S=>M.error(H(S,t("更新 Provider 失败")))})},Z=c=>{if(!(c.deletable??!c.builtIn)){M.error(t("系统内置 Provider 不可删除"));return}B({id:c.id,name:c.name,builtIn:c.builtIn})},fe=()=>{I&&C.mutate(I.id,{onSuccess:()=>{M.success(I.builtIn?t("已恢复默认 Provider 配置"):t("Provider 已删除")),g===I.id&&x(null),B(null),_(!1)},onError:c=>M.error(H(c,t("删除 Provider 失败")))})},y=()=>{q(!1),L(!1)},z=()=>R(null),le=()=>{s.mutate(void 0,{onSuccess:c=>{vs(hs(c.exportedAt),c),M.success(t("Provider 备份已导出")),y()},onError:c=>M.error(H(c,t("导出 Provider 备份失败")))})},Q=()=>{v.current&&(v.current.value="",v.current.click())},ne=async c=>{const p=c.target.files?.[0];if(c.target.value="",!p)return;let S;try{S=JSON.parse(await p.text())}catch{M.error(t("备份文件不是有效的 JSON"));return}k.mutate(S,{onSuccess:T=>R({backup:S,preview:T}),onError:T=>M.error(H(T,t("导入预览失败")))})},de=()=>{K&&r.mutate(K.backup,{onSuccess:c=>{const p=c.summary.create+c.summary.overwrite;M.success(p===0?t("导入完成,当前配置无需变更"):t("导入完成:新增 {create},覆盖 {overwrite},跳过 {skip}",{create:c.summary.create,overwrite:c.summary.overwrite,skip:c.summary.skip})),z()},onError:c=>M.error(H(c,t("导入 Provider 备份失败")))})},Y=c=>{const p=c.provider,S=pe[p.agentType],T=At(p,S);E({id:p.id,data:{name:p.name,agentType:p.agentType,runtimeType:p.runtimeType===G.ACP?G.ACP:G.CLI,executionPermission:p.executionPermission,executionPermissionReviewRequired:p.executionPermissionReviewRequired,config:Xe(p.agentType,p.config),settings:p.settings??"",env:T,simplified:p.simplified??{},diagnostics:p.diagnostics,isDefault:p.isDefault}})};return a?e.jsx(_e,{className:"max-w-5xl",children:e.jsx(pt,{})}):e.jsxs(_e,{className:"max-w-5xl",children:[e.jsx("input",{ref:v,type:"file",accept:".json,application/json",className:"hidden",onChange:ne}),e.jsx(ft,{title:t("Agent 配置"),actions:e.jsxs(e.Fragment,{children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:Q,disabled:k.isPending||r.isPending,children:[e.jsx(Ht,{size:13}),t("导入")]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>q(!0),disabled:s.isPending,children:[e.jsx(gt,{size:13}),t("导出")]}),e.jsxs(A,{size:"sm",onClick:()=>E({}),children:[e.jsx(Ne,{size:13,className:"mr-1"}),t("新建")]})]})}),D.length===0?e.jsx(ht,{icon:vt,message:t("暂无 Agent 配置"),action:e.jsxs(A,{size:"sm",onClick:()=>E({}),children:[e.jsx(Ne,{size:13,className:"mr-1"}),t("新建配置")]})}):e.jsx(Vt,{items:D,selectedId:g,onSelectItem:c=>{x(c),_(!0)},getItemId:c=>c.provider.id,mobileShowDetail:V,onMobileBack:()=>_(!1),renderListItem:(c,p)=>{const S=c.provider,T=Je(c);return e.jsxs(e.Fragment,{children:[e.jsx(ys,{issue:T}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-medium",children:S.name}),e.jsxs("div",{className:U("flex min-w-0 items-center gap-1.5 text-[11px]",p?"text-primary-foreground/60":"text-muted-foreground"),children:[e.jsx(ae,{agentType:S.agentType,className:"size-3.5",fallbackClassName:p?"text-primary-foreground/70":"text-muted-foreground"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(S.agentType,S.runtimeType)})]}),T?e.jsx("div",{className:U("mt-0.5 break-words text-[11px] leading-snug",p?"text-primary-foreground/80":"text-destructive"),children:t(T)}):null]}),S.isDefault&&e.jsx("span",{className:U("shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",p?"bg-white/20 text-primary-foreground":"bg-primary/[0.06] text-primary"),children:t("默认")})]})},renderDetail:c=>c?e.jsx("div",{className:"min-w-0 p-5",children:e.jsx(Es,{item:c,onEdit:()=>Y(c),onDelete:()=>Z(c.provider)})}):e.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:t("选择一个 Provider 查看详情")})}),f&&e.jsx(ws,{isOpen:!0,onClose:()=>E(null),providerId:f.id,initialData:f.data,onSave:c=>{f.id?W(f.id,c):w(c)}}),e.jsx(qt,{isOpen:I!==null,onClose:()=>{C.isPending||B(null)},onConfirm:fe,title:I?.builtIn?t("恢复默认 Provider"):t("删除 Provider"),description:I?.builtIn?t('确定删除 "{name}" 的自定义覆盖,并恢复系统默认配置?',{name:I?.name}):t('确定删除 "{name}"?此操作不可撤销。',{name:I?.name}),confirmText:I?.builtIn?t("恢复默认"):t("删除"),cancelText:t("取消"),variant:"danger",isLoading:C.isPending}),e.jsx(Ps,{isOpen:J,onClose:y,onConfirm:le,acknowledged:X,onAcknowledgedChange:L,isLoading:s.isPending}),e.jsx(Cs,{isOpen:!!K,onClose:z,preview:K?.preview??null,backup:K?.backup??null,onConfirm:de,isLoading:r.isPending})]})}export{ws as ProviderFormModal,qs as ProviderSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as v,j as r,l as s,s as h}from"./index-CWbMMO6g.js";function w({items:o,selectedId:l,onSelectItem:c,getItemId:t,renderListItem:d,renderDetail:u,renderListFooter:g,mobileShowDetail:a,onMobileBack:x,listClassName:m,detailClassName:f}){const{t:p}=v(),b=o.find(e=>t(e)===l)??null;return r.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-5 lg:grid-cols-[240px_minmax(0,1fr)] lg:h-[calc(100vh-16rem)] lg:max-h-[640px]",children:[r.jsxs("div",{className:s("min-w-0 space-y-1 lg:overflow-y-auto lg:pr-1 scrollbar-app-thin",a&&"hidden lg:block",m),children:[o.map(e=>{const i=t(e),n=i===l;return r.jsx("button",{onClick:()=>c(i),"aria-current":n?"true":void 0,className:s("flex min-w-0 w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",n?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted/50"),children:d(e,n)},i)}),g?.()]}),r.jsxs("div",{className:s("min-w-0 rounded-xl border border-border bg-card lg:overflow-y-auto scrollbar-app-thin",!a&&"hidden lg:block",f),children:[r.jsxs("button",{onClick:x,className:"mb-4 flex items-center gap-1.5 px-5 pt-3 text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 lg:hidden",children:[r.jsx(h,{size:14}),p("返回列表")]}),u(b)]})]})}export{w as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as Re,E as gt,F as bt,G as ft,H as ht,J as vt,K as jt,M as yt,N as Pt,r as l,j as e,S as Ee,O as Nt,h as Tt,l as B,s as Ae,B as p,v as _e,t as c,P as kt}from"./index-CWbMMO6g.js";import{C as Fe}from"./confirm-dialog-DRpyE_qU.js";import{M as wt}from"./modal-BRoNvfhw.js";import{S as $}from"./select-BmjoUfrV.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import"./agent-meta-DOylIs2N.js";import{A as Ct}from"./AgentLogo-I2etsqym.js";import{M as U}from"./MemberAvatar-TVtoxQe8.js";import{u as It}from"./use-providers-DdV9gbj1.js";import{T as ue,P as R}from"./trash-2-BF_3L-qk.js";import{C as St}from"./chevron-up-BwJT7iif.js";import{C as Mt}from"./chevron-down-C6Ta4vyM.js";import"./check-Cm7Vstpm.js";const o="/avatars/presets",Et=[{id:"developer",label:"Developer",src:`${o}/avatar-preset-01-developer.png`},{id:"architect",label:"Architect",src:`${o}/avatar-preset-02-architect.png`},{id:"tester",label:"Tester",src:`${o}/avatar-preset-03-tester.png`},{id:"devops",label:"DevOps",src:`${o}/avatar-preset-04-devops.png`},{id:"data-scientist",label:"Data scientist",src:`${o}/avatar-preset-05-data-scientist.png`},{id:"frontend",label:"Frontend",src:`${o}/avatar-preset-06-frontend.png`},{id:"backend",label:"Backend",src:`${o}/avatar-preset-07-backend.png`},{id:"security",label:"Security",src:`${o}/avatar-preset-08-security.png`},{id:"project-manager",label:"Project manager",src:`${o}/avatar-preset-09-project-manager.png`},{id:"product-manager",label:"Product manager",src:`${o}/avatar-preset-10-product-manager.png`},{id:"scrum-master",label:"Scrum master",src:`${o}/avatar-preset-11-scrum-master.png`},{id:"tech-lead",label:"Tech lead",src:`${o}/avatar-preset-12-tech-lead.png`},{id:"coordinator",label:"Coordinator",src:`${o}/avatar-preset-13-coordinator.png`},{id:"mentor",label:"Mentor",src:`${o}/avatar-preset-14-mentor.png`},{id:"reviewer",label:"Reviewer",src:`${o}/avatar-preset-15-reviewer.png`},{id:"ui-designer",label:"UI designer",src:`${o}/avatar-preset-16-ui-designer.png`},{id:"ux-researcher",label:"UX researcher",src:`${o}/avatar-preset-17-ux-researcher.png`},{id:"documenter",label:"Documenter",src:`${o}/avatar-preset-18-documenter.png`},{id:"translator",label:"Translator",src:`${o}/avatar-preset-19-translator.png`},{id:"analyst",label:"Analyst",src:`${o}/avatar-preset-20-analyst.png`},{id:"consultant",label:"Consultant",src:`${o}/avatar-preset-21-consultant.png`},{id:"creative-director",label:"Creative director",src:`${o}/avatar-preset-22-creative-director.png`},{id:"support",label:"Support",src:`${o}/avatar-preset-23-support.png`},{id:"assistant",label:"Assistant",src:`${o}/avatar-preset-24-assistant.png`},{id:"robot",label:"Robot",src:`${o}/avatar-preset-25-robot.png`}],De=kt(),At=2*1024*1024,_t=[],Ft=[],Ot=[],ze=[{key:"readRoom",label:"读房间"},{key:"postRoomMessage",label:"发房间消息"},{key:"mentionMembers",label:"提及成员"},{key:"stopMemberWork",label:"停止成员工作"},{key:"markReadyForReview",label:"标记可审查"},{key:"readFiles",label:"读文件"},{key:"writeFiles",label:"写文件"},{key:"runCommands",label:"运行命令"},{key:"readDiff",label:"读 diff"},{key:"mergeWorkspace",label:"合并工作区"}],Le={readRoom:!1,postRoomMessage:!1,mentionMembers:!1,stopMemberWork:!1,markReadyForReview:!1,readFiles:!1,writeFiles:!1,runCommands:!1,readDiff:!1,mergeWorkspace:!1},Oe=[{value:"none",label:"无"},{value:"shared",label:"共享"},{value:"dedicated",label:"独占"}],$t=[{value:"MENTION_ONLY",label:"仅提及"},{value:"USER_MESSAGES",label:"所有用户消息"}],Rt=[{value:"new_per_request",label:"每次新会话"},{value:"resume_last",label:"复用上次会话"}],Dt=[{value:"own_only",label:"仅自己队列"},{value:"team_pending",label:"全队列待处理"}];function Y(){return{name:"",aliasesText:"",providerId:"",rolePrompt:"",capabilities:{...Le},workspacePolicy:"none",triggerPolicy:"MENTION_ONLY",sessionPolicy:"new_per_request",queueManagementPolicy:"own_only",avatar:""}}function xe(r){return{name:r.name,aliasesText:r.aliases.join(", "),providerId:r.providerId,rolePrompt:r.rolePrompt,capabilities:{...Le,...r.capabilities},workspacePolicy:r.workspacePolicy,triggerPolicy:r.triggerPolicy,sessionPolicy:r.sessionPolicy,queueManagementPolicy:r.queueManagementPolicy,avatar:r.avatar??""}}function q(){return{name:"",heartbeatTimeoutMinutes:10,memberPresetIds:[]}}function pe(r){return{name:r.name,heartbeatTimeoutMinutes:r.heartbeatTimeoutMinutes??10,memberPresetIds:r.members?.map(i=>i.memberPresetId)??[]}}function zt(r,i,d,m){if(d.filter(A=>A===m).length<=1)return r;const W=d.slice(0,i+1).filter(A=>A===m).length;return`${r} #${W}`}function Lt(r){return Array.from(new Set(r.split(/[\n,]/).map(i=>i.trim()).filter(Boolean)))}function Bt(r){return r.trim()||null}function $e(r){return ze.reduce((i,d)=>i+(r[d.key]?1:0),0)}function E(r,i){return r instanceof Error?r.message:i}function Ut(r){return["image/png","image/jpeg","image/webp"].includes(r.type)}async function Yt(r){const i=new FormData;i.append("file",r);const d=await fetch(`${De}/attachments/upload`,{method:"POST",body:i});if(!d.ok){const m=await d.json().catch(()=>({}));throw new Error(m.error||m.message||`Upload failed (${d.status})`)}return d.json()}function G({title:r,error:i,isFetching:d,onRetry:m}){const{t:k}=Re();return e.jsx("div",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium",children:r}),e.jsx("div",{className:"mt-1 text-xs text-destructive/90",children:E(i,k("请稍后重试。"))})]}),e.jsx(p,{type:"button",size:"sm",variant:"outline",onClick:m,disabled:d,children:k(d?"加载中...":"重试")})]})})}function sr(){const{t:r}=Re(),{data:i,error:d,isError:m,isFetching:k,isLoading:W,refetch:A}=It(),{data:Be,error:ge,isError:w,isFetching:be,isLoading:V,refetch:fe}=gt(),{data:Ue,error:Ye,isError:D,isFetching:qe,isLoading:H,refetch:Ge}=bt(),J=ft(),K=ht(),he=vt(),Q=jt(),X=yt(),ve=Pt(),[Z,je]=l.useState("presets"),[C,ee]=l.useState("edit"),[h,te]=l.useState(null),[a,j]=l.useState(Y()),[ye,_]=l.useState(!1),[y,re]=l.useState(null),[We,se]=l.useState(!1),[Pe,Ne]=l.useState(!1),Te=l.useRef(null),[I,ae]=l.useState("edit"),[v,ne]=l.useState(null),[g,b]=l.useState(q()),[ke,P]=l.useState(!1),[N,oe]=l.useState(null),[we,F]=l.useState(!1),u=Be??_t,f=Ue??Ft,z=i??Ot,O=l.useMemo(()=>new Map(u.map(t=>[t.id,t])),[u]),le=l.useMemo(()=>new Map(f.map(t=>[t.id,t])),[f]),Ve=l.useMemo(()=>{const t=z.map(({provider:s,availability:n})=>({value:s.id,label:s.name+(n.type==="NOT_FOUND"?r(" (不可用)"):""),icon:e.jsx(Ct,{agentType:s.agentType,className:"size-4"}),disabled:n.type==="NOT_FOUND"}));return a.providerId&&!t.some(s=>s.value===a.providerId)&&t.unshift({value:a.providerId,label:`${a.providerId}${r(" (不可用)")}`,disabled:!0}),t},[a.providerId,z,r]),ie=h?O.get(h)??null:null,de=v?le.get(v)??null:null,He=l.useMemo(()=>new Map(z.map(({provider:t,availability:s})=>[t.id,t.name+(s.type==="NOT_FOUND"?r(" (不可用)"):"")])),[z,r]);if(l.useEffect(()=>{if(!(V||w||ye)){if(C==="create"){j(Y());return}if(h){const t=O.get(h);t&&j(xe(t));return}if(u.length>0){const t=u[0];te(t.id),ee("edit"),j(xe(t));return}ee("create"),te(null),j(Y())}},[O,ye,C,u,w,V,h]),l.useEffect(()=>{if(!(H||D||ke)){if(I==="create"){b(q());return}if(v){const t=le.get(v);t&&b(pe(t));return}if(f.length>0){const t=f[0];ne(t.id),ae("edit"),b(pe(t));return}ae("create"),ne(null),b(q())}},[v,le,ke,I,f,D,H]),W||V||H)return e.jsx(Ee,{className:"max-w-6xl",children:e.jsx(Nt,{cards:6})});const x=(t,s)=>{j(n=>({...n,[t]:s})),_(!0)},Je=(t,s)=>{j(n=>({...n,capabilities:{...n.capabilities,[t]:s}})),_(!0)},Ke=t=>{x("avatar",t),se(!1)},Qe=()=>{x("avatar","")},Xe=async t=>{const s=t.target.files?.[0];if(t.target.value="",!!s){if(!Ut(s)){c.error(r("仅支持 PNG、JPG、WebP 头像。"));return}if(s.size>At){c.error(r("头像图片不能超过 2MB。"));return}Ne(!0);try{const n=await Yt(s);x("avatar",`${De}${n.url}`),c.success(r("头像已上传"))}catch(n){c.error(E(n,r("头像上传失败")))}finally{Ne(!1)}}},S=(t,s)=>{ee(t),te(s?.id??null),j(s?xe(s):Y()),_(!1)},Ce=(t,s)=>{b(n=>({...n,[t]:s})),P(!0)},M=(t,s)=>{ae(t),ne(s?.id??null),b(s?pe(s):q()),P(!1)},Ze=async()=>{const t={name:a.name.trim(),aliases:Lt(a.aliasesText),providerId:a.providerId.trim(),rolePrompt:a.rolePrompt.trim(),capabilities:{...a.capabilities},workspacePolicy:a.workspacePolicy,triggerPolicy:a.triggerPolicy,sessionPolicy:a.sessionPolicy,queueManagementPolicy:a.queueManagementPolicy,avatar:Bt(a.avatar)};try{if(C==="create"||!h){const s=await J.mutateAsync(t);S("edit",s),c.success(r("已创建"))}else{const s=await K.mutateAsync({id:h,data:t});S("edit",s),c.success(r("已保存"))}}catch(s){c.error(E(s,r("保存失败")))}},et=async()=>{if(y)try{await he.mutateAsync(y.id),c.success(r("Deleted"));const t=u.filter(s=>s.id!==y.id);h===y.id&&(t.length>0?S("edit",t[0]):S("create",null)),re(null)}catch(t){c.error(E(t,r("删除失败")))}},tt=async()=>{const t={name:g.name.trim(),heartbeatTimeoutMinutes:g.heartbeatTimeoutMinutes,memberPresetIds:g.memberPresetIds};try{if(I==="create"||!v){const s=await Q.mutateAsync(t);M("edit",s),c.success(r("已创建"))}else{const s=await X.mutateAsync({id:v,data:t});M("edit",s),c.success(r("已保存"))}}catch(s){c.error(E(s,r("保存失败")))}},rt=async()=>{if(N)try{await ve.mutateAsync(N.id),c.success(r("Deleted"));const t=f.filter(s=>s.id!==N.id);v===N.id&&(t.length>0?M("edit",t[0]):M("create",null)),oe(null)}catch(t){c.error(E(t,r("删除失败")))}},st=$e(a.capabilities),at=!!a.name.trim()&&!!a.providerId.trim()&&!!a.rolePrompt.trim()&&!m&&!w&&!J.isPending&&!K.isPending,nt=!!g.name.trim()&&!D&&!w&&!Q.isPending&&!X.isPending,ce=g.memberPresetIds.map(t=>O.get(t)).filter(t=>!!t),ot=t=>{_(!1),S("edit",t)},lt=()=>{_(!1),S("create",null)},it=t=>{P(!1),M("edit",t)},dt=()=>{P(!1),M("create",null)},ct=t=>{b(s=>({...s,memberPresetIds:[...s.memberPresetIds,t]})),P(!0)},mt=t=>{b(s=>({...s,memberPresetIds:s.memberPresetIds.filter((n,T)=>T!==t)})),P(!0)},Ie=(t,s)=>{b(n=>{const T=t+s;if(T<0||T>=n.memberPresetIds.length)return n;const me=[...n.memberPresetIds],[pt]=me.splice(t,1);return me.splice(T,0,pt),{...n,memberPresetIds:me}}),P(!0)},ut=t=>{ot(t),F(!0)},Se=()=>{lt(),F(!0)},xt=t=>{it(t),F(!0)},Me=()=>{dt(),F(!0)},L=()=>F(!1);return e.jsxs(Ee,{className:"max-w-6xl",children:[e.jsx(Tt,{title:r("团队协作设置"),actions:e.jsxs("div",{className:"inline-flex rounded-lg border border-border bg-muted/80 p-0.5",children:[e.jsx("button",{type:"button",onClick:()=>{je("presets"),L()},className:B("rounded-md px-3 py-1.5 text-[12px] font-medium transition-all",Z==="presets"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r("成员预设")}),e.jsx("button",{type:"button",onClick:()=>{je("templates"),L()},className:B("rounded-md px-3 py-1.5 text-[12px] font-medium transition-all",Z==="templates"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r("团队模板")})]})}),m&&e.jsx(G,{title:r("Provider 列表加载失败"),error:d,isFetching:k,onRetry:()=>{A()}}),Z==="presets"?we?e.jsxs("div",{className:"rounded-xl border border-border bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/60 px-5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:L,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Ae,{size:14}),r("返回")]}),e.jsx("span",{className:"text-neutral-200",children:"|"}),e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:C==="create"?r("创建新预设"):ie?.name??r("编辑预设")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[C==="edit"&&ie&&e.jsx("button",{onClick:()=>re(ie),className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:r("删除"),children:e.jsx(ue,{size:14})}),e.jsx(p,{size:"sm",onClick:Ze,disabled:!at,children:J.isPending||K.isPending?r("保存中..."):r(C==="create"?"创建":"保存")})]})]}),e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"shrink-0",children:[e.jsx(U,{name:a.name||r("Agent"),avatar:a.avatar,className:"h-14 w-14 text-sm"}),e.jsxs("div",{className:"flex justify-center gap-1 mt-2",children:[e.jsx("button",{type:"button",onClick:()=>se(!0),className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:r("选择")}),e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"·"}),e.jsx("button",{type:"button",onClick:()=>Te.current?.click(),disabled:Pe,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:r(Pe?"...":"上传")}),a.avatar.trim()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"·"}),e.jsx("button",{type:"button",onClick:Qe,className:"text-[10px] text-muted-foreground hover:text-destructive transition-colors",children:r("清除")})]})]}),e.jsx("input",{ref:Te,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:Xe})]}),e.jsxs("div",{className:"flex-1 min-w-0 grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("名称")}),e.jsx("input",{value:a.name,onChange:t=>x("name",t.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("别名")}),e.jsx("input",{value:a.aliasesText,onChange:t=>x("aliasesText",t.target.value),placeholder:r("alice, a, reviewer"),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("Provider")}),e.jsx($,{value:a.providerId,onChange:t=>x("providerId",t),options:Ve,disabled:m}),m&&e.jsx("p",{className:"mt-1 text-[11px] text-destructive",children:r("Provider 列表加载失败。")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("角色提示词")}),e.jsx("textarea",{value:a.rolePrompt,onChange:t=>x("rolePrompt",t.target.value),rows:4,className:"w-full rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm font-mono transition-colors focus:border-ring focus:bg-background focus:outline-none resize-y"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-end justify-between gap-3 mb-2",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted-foreground",children:r("可用能力")}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[st,"/10"]})]}),e.jsx("div",{className:"grid gap-1 sm:grid-cols-2 xl:grid-cols-3",children:ze.map(t=>e.jsxs("label",{className:"flex items-center gap-2 rounded px-2.5 py-1.5 text-[12px] text-foreground hover:bg-muted transition-colors cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a.capabilities[t.key],onChange:s=>Je(t.key,s.target.checked),className:"h-3.5 w-3.5 rounded border-border"}),e.jsx("span",{children:r(t.label)})]},t.key))})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("工作区")}),e.jsx($,{value:a.workspacePolicy,onChange:t=>x("workspacePolicy",t),options:Oe.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("触发")}),e.jsx($,{value:a.triggerPolicy,onChange:t=>x("triggerPolicy",t),options:$t.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("会话")}),e.jsx($,{value:a.sessionPolicy,onChange:t=>x("sessionPolicy",t),options:Rt.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("队列")}),e.jsx($,{value:a.queueManagementPolicy,onChange:t=>x("queueManagementPolicy",t),options:Dt.map(t=>({value:t.value,label:r(t.label)}))})]})]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[e.jsx("span",{className:"text-[12px] text-muted-foreground",children:r("{count} 个成员预设",{count:u.length})}),e.jsxs(p,{size:"sm",variant:"outline",onClick:Se,children:[e.jsx(R,{size:13})," ",r("新增预设")]})]}),w?e.jsx(G,{title:r("加载失败"),error:ge,isFetching:be,onRetry:()=>{fe()}}):u.length===0?e.jsx(_e,{message:r("暂无成员预设"),action:e.jsxs(p,{size:"sm",onClick:Se,children:[e.jsx(R,{size:13,className:"mr-1"})," ",r("新增预设")]})}):e.jsx("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:u.map(t=>{const s=$e(t.capabilities);return e.jsxs("button",{type:"button",onClick:()=>ut(t),className:"flex items-start gap-3 rounded-xl border border-border bg-background p-4 text-left transition-all hover:border-border hover:shadow-sm",children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-10 w-10 text-xs shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-foreground",children:t.name}),t.aliases.length>0&&e.jsx("div",{className:"truncate text-[11px] text-muted-foreground mt-0.5",children:t.aliases.join(", ")}),e.jsx("div",{className:"truncate text-[11px] text-muted-foreground mt-1",children:He.get(t.providerId)??t.providerId}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[e.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:r(Oe.find(n=>n.value===t.workspacePolicy)?.label??t.workspacePolicy)}),e.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:[s,"/10 ",r("能力")]})]})]})]},t.id)})})]}):we?e.jsxs("div",{className:"rounded-xl border border-border bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/60 px-5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:L,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Ae,{size:14}),r("返回")]}),e.jsx("span",{className:"text-neutral-200",children:"|"}),e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:I==="create"?r("创建新模板"):de?.name??r("编辑模板")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[I==="edit"&&de&&e.jsx("button",{onClick:()=>oe(de),className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:r("删除"),children:e.jsx(ue,{size:14})}),e.jsx(p,{size:"sm",onClick:tt,disabled:!nt,children:Q.isPending||X.isPending?r("保存中..."):r(I==="create"?"创建":"保存")})]})]}),e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("模板名称")}),e.jsx("input",{value:g.name,onChange:t=>Ce("name",t.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("成员心跳检测时间(分钟)")}),e.jsx("input",{type:"number",min:1,max:120,step:1,value:g.heartbeatTimeoutMinutes,onChange:t=>Ce("heartbeatTimeoutMinutes",Math.min(120,Math.max(1,Number(t.target.value)||1))),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-2",children:r("可用预设")}),e.jsx("div",{className:"max-h-[400px] space-y-1 overflow-y-auto scrollbar-app-thin",children:w?e.jsx(G,{title:r("加载失败"),error:ge,isFetching:be,onRetry:()=>{fe()}}):u.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border p-3 text-center text-[12px] text-muted-foreground",children:r("先创建成员预设")}):u.map(t=>{const s=g.memberPresetIds.filter(n=>n===t.id).length;return e.jsxs("button",{type:"button",onClick:()=>ct(t.id),className:B("flex w-full items-center gap-2.5 rounded-lg border px-3 py-2 text-left transition-all",s>0?"border-neutral-900 bg-muted":"border-border bg-background hover:border-border"),children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-7 w-7 text-[10px] shrink-0"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("div",{className:"truncate text-[12px] font-medium text-foreground",children:t.name})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s>0&&e.jsxs("span",{className:"rounded-full bg-neutral-900 px-1.5 py-0.5 text-[10px] font-medium text-white",children:["x",s]}),e.jsx(R,{size:13,className:"text-muted-foreground"})]})]},t.id)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-2",children:r("已选成员")}),e.jsx("div",{className:"max-h-[400px] space-y-1 overflow-y-auto scrollbar-app-thin",children:ce.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border p-3 text-center text-[12px] text-muted-foreground",children:r("尚未选择")}):ce.map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-7 w-7 text-[10px] shrink-0"}),e.jsx("span",{className:"truncate text-[12px] font-medium text-foreground",children:zt(t.name,s,g.memberPresetIds,t.id)})]}),e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>Ie(s,-1),disabled:s===0,children:e.jsx(St,{size:13})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>Ie(s,1),disabled:s===ce.length-1,children:e.jsx(Mt,{size:13})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>mt(s),children:e.jsx(ue,{size:13})})]})]},`${t.id}-${s}`))})]})]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[e.jsx("span",{className:"text-[12px] text-muted-foreground",children:r("{count} 个团队模板",{count:f.length})}),e.jsxs(p,{size:"sm",variant:"outline",onClick:Me,children:[e.jsx(R,{size:13})," ",r("新增模板")]})]}),D?e.jsx(G,{title:r("加载失败"),error:Ye,isFetching:qe,onRetry:()=>{Ge()}}):f.length===0?e.jsx(_e,{message:r("暂无团队模板"),action:e.jsxs(p,{size:"sm",onClick:Me,children:[e.jsx(R,{size:13,className:"mr-1"})," ",r("新增模板")]})}):e.jsx("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:f.map(t=>{const s=t.members?.length??0,n=(t.members??[]).slice(0,3).map(T=>O.get(T.memberPresetId)?.name).filter(Boolean);return e.jsxs("button",{type:"button",onClick:()=>xt(t),className:"flex flex-col rounded-xl border border-border bg-background p-4 text-left transition-all hover:border-border hover:shadow-sm",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-foreground",children:t.name}),e.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:r("{count} 个成员",{count:s})}),n.length>0&&e.jsxs("div",{className:"truncate text-[11px] text-muted-foreground mt-1.5",children:[n.join(", "),s>3?` +${s-3}`:""]})]},t.id)})})]}),e.jsx(Fe,{isOpen:!!y,onClose:()=>re(null),onConfirm:et,title:r("删除"),description:y?r('确定删除 "{name}"?此操作不可撤销。',{name:y.name}):"",variant:"danger",confirmText:r("删除"),cancelText:r("取消"),isLoading:he.isPending}),e.jsx(wt,{isOpen:We,onClose:()=>se(!1),title:r("选择预设头像"),className:"max-w-2xl",children:e.jsx("div",{className:"grid grid-cols-4 gap-2 sm:grid-cols-5",children:Et.map(t=>{const s=a.avatar===t.src;return e.jsxs("button",{type:"button",onClick:()=>Ke(t.src),className:B("group rounded-xl border bg-background p-2 text-center transition-all hover:border-neutral-400 hover:bg-muted focus:outline-none focus:ring-2 focus:ring-neutral-900/15",s?"border-neutral-900 ring-2 ring-neutral-900/10":"border-border"),"aria-pressed":s,"aria-label":r("选择 {name} 头像",{name:t.label}),children:[e.jsx("img",{src:t.src,alt:t.label,loading:"lazy",className:"mx-auto h-14 w-14 rounded-full object-cover sm:h-16 sm:w-16"}),e.jsx("span",{className:"mt-1 block truncate text-[10px] font-medium text-muted-foreground",children:t.label})]},t.id)})})}),e.jsx(Fe,{isOpen:!!N,onClose:()=>oe(null),onConfirm:rt,title:r("删除"),description:N?r('确定删除 "{name}"?此操作不可撤销。',{name:N.name}):"",variant:"danger",confirmText:r("删除"),cancelText:r("取消"),isLoading:ve.isPending})]})}export{sr as TeamSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O}from"./index-CWbMMO6g.js";const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],S=O("chevron-right",N);const h=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],K=O("file-text",h);var d;(function(e){e.TODO="TODO",e.IN_PROGRESS="IN_PROGRESS",e.IN_REVIEW="IN_REVIEW",e.DONE="DONE",e.CANCELLED="CANCELLED"})(d||(d={}));var c;(function(e){e[e.LOW=-1]="LOW",e[e.NORMAL=0]="NORMAL",e[e.HIGH=1]="HIGH",e[e.URGENT=2]="URGENT"})(c||(c={}));var p;(function(e){e.ACTIVE="ACTIVE",e.MERGED="MERGED",e.ABANDONED="ABANDONED",e.HIBERNATED="HIBERNATED"})(p||(p={}));var l;(function(e){e.WORKTREE="WORKTREE",e.MAIN_DIRECTORY="MAIN_DIRECTORY"})(l||(l={}));var o;(function(e){e.CLAUDE_CODE="CLAUDE_CODE",e.GEMINI_CLI="GEMINI_CLI",e.CURSOR_AGENT="CURSOR_AGENT",e.CODEX="CODEX",e.QWEN_CODE="QWEN_CODE",e.KIRO_CLI="KIRO_CLI",e.OPENCODE="OPENCODE",e.PI_CODING_AGENT="PI_CODING_AGENT",e.GROK_BUILD="GROK_BUILD",e.MINION_CODE="MINION_CODE",e.DEEPSEEK_HERMES="DEEPSEEK_HERMES"})(o||(o={}));var t;(function(e){e.CLI="CLI",e.ACP="ACP"})(t||(t={}));var r;(function(e){e.PENDING="PENDING",e.RUNNING="RUNNING",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.CANCELLED="CANCELLED"})(r||(r={}));var m;(function(e){e.CHAT="CHAT",e.COMMIT_MSG="COMMIT_MSG"})(m||(m={}));var _;(function(e){e.WORKSPACE="WORKSPACE",e.CONVERSATION="CONVERSATION"})(_||(_={}));var I;(function(e){e.REBASE="REBASE",e.MERGE="MERGE"})(I||(I={}));const A=["oss","ollama","lmstudio","amazon-bedrock"];function T(e){return A.includes(e)}const f={[o.CLAUDE_CODE]:{agentType:o.CLAUDE_CODE,apiBaseUrl:{kind:"env",path:"ANTHROPIC_BASE_URL",placeholder:"https://api.anthropic.com"},apiKey:{kind:"env",path:"ANTHROPIC_API_KEY"},model:{kind:"config",path:"model",placeholder:"claude-sonnet-4-20250514"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"},settingsFormat:"json"},[o.CODEX]:{agentType:o.CODEX,apiBaseUrl:{kind:"settings",path:"openai_base_url",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gpt-5.3-codex"},reasoningEffort:{kind:"settings",path:"model_reasoning_effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"dangerouslyBypassApprovalsAndSandbox",riskKind:"bypass-approvals-and-sandbox"},fastMode:{kind:"config",path:"fastMode"},disableResponsesWebsocket:{kind:"config",path:"disableResponsesWebsocket"},settingsFormat:"toml"},[o.GEMINI_CLI]:{agentType:o.GEMINI_CLI,apiKey:{kind:"env",path:"GEMINI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gemini-2.5-pro"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[o.CURSOR_AGENT]:{agentType:o.CURSOR_AGENT,model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"force",riskKind:"force-execution"}},[o.QWEN_CODE]:{agentType:o.QWEN_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://dashscope.aliyuncs.com/compatible-mode/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"qwen3-coder-plus"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[o.KIRO_CLI]:{agentType:o.KIRO_CLI,model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"trustAllTools",riskKind:"auto-approve"}},[o.OPENCODE]:{agentType:o.OPENCODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[o.PI_CODING_AGENT]:{agentType:o.PI_CODING_AGENT,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[o.GROK_BUILD]:{agentType:o.GROK_BUILD,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.x.ai/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"alwaysApprove",riskKind:"auto-approve"}},[o.MINION_CODE]:{agentType:o.MINION_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"}},[o.DEEPSEEK_HERMES]:{agentType:o.DEEPSEEK_HERMES,apiBaseUrl:{kind:"env",path:"DEEPSEEK_BASE_URL",placeholder:"https://api.deepseek.com"},apiKey:{kind:"env",path:"DEEPSEEK_API_KEY"},model:{kind:"config",path:"model",placeholder:"deepseek-v4-pro"},reasoningEffort:{kind:"config",path:"effort",options:["off","low","high","max"]},executionPermission:{kind:"config",riskKind:"auto-approve"}}};function G(e){return f[e]}var n;(function(e){e.Action="Action",e.Assistant="Assistant",e.Info="Info",e.Tool="Tool",e.User="User",e.Cursor="Cursor",e.Error="Error",e.Warning="Warning"})(n||(n={}));function D(e){const a=e.metadata?.toolName||"Tool",i=e.metadata?.action,s=e.metadata?.status,u={file_read:"Read File",file_edit:"Edit File",command_run:"Run Command",search:"Search",web_fetch:"Fetch URL",tool:"Tool",task_create:"Create Task",plan_presentation:"Present Plan",todo_management:"Manage Todo",other:"Action"},E=e.metadata?.toolKind?a:i?u[i]:a;return s==="success"?`${E} ✓`:s==="failed"?`${E} ✗`:s==="pending_approval"?`${E} (待审批)`:E}function C(e){switch(e.entryType){case"user_message":case"user_feedback":return{id:e.id,timestamp:e.timestamp,type:n.User,content:e.content};case"assistant_message":return{id:e.id,timestamp:e.timestamp,type:n.Assistant,content:e.content};case"next_action":return{id:e.id,timestamp:e.timestamp,type:n.Action,content:e.content};case"thinking":return{id:e.id,timestamp:e.timestamp,type:n.Info,title:"Thinking",content:e.content};case"tool_use":return{id:e.id,timestamp:e.timestamp,type:n.Tool,title:D(e),content:e.content,isCollapsed:e.metadata?.status==="success",tool:{action:e.metadata?.action,name:e.metadata?.toolName,id:e.metadata?.toolId,kind:e.metadata?.toolKind,status:e.metadata?.status,content:e.metadata?.toolContent,locations:e.metadata?.toolLocations,inputSummary:e.metadata?.toolInputSummary,outputSummary:e.metadata?.toolOutputSummary}};case"error_message":return{id:e.id,timestamp:e.timestamp,type:n.Error,content:e.content};case"warning_message":return{id:e.id,timestamp:e.timestamp,type:n.Warning,content:e.content};case"system_message":return{id:e.id,timestamp:e.timestamp,type:n.Info,content:e.content};case"loading":return{id:e.id,timestamp:e.timestamp,type:n.Cursor,content:"",cursorActivity:{processingStartedAt:e.timestamp}};case"token_usage_info":if(e.metadata?.tokenUsage){const{totalTokens:a=0,modelContextWindow:i}=e.metadata.tokenUsage;return{id:e.id,timestamp:e.timestamp,type:n.Info,content:e.content,tokenUsage:{totalTokens:a,modelContextWindow:i}}}return null;default:return null}}const g=new WeakMap;function R(e){if(typeof e!="object"||e===null)return C(e);const a=g.get(e);if(a!==void 0)return a;const i=C(e);return g.set(e,i),i}function M(e){const a=[];for(const i of e){const s=R(i);s!==null&&a.push(s)}return a}function U(e){return{id:`cursor-${Date.now()}`,timestamp:e?.processingStartedAt??Date.now(),type:n.Cursor,content:"",cursorActivity:e}}const b={[o.CLAUDE_CODE]:[t.CLI,t.ACP],[o.GEMINI_CLI]:[t.CLI,t.ACP],[o.CURSOR_AGENT]:[t.CLI,t.ACP],[o.CODEX]:[t.CLI,t.ACP],[o.QWEN_CODE]:[t.ACP],[o.KIRO_CLI]:[t.ACP],[o.OPENCODE]:[t.ACP],[o.PI_CODING_AGENT]:[t.ACP],[o.GROK_BUILD]:[t.ACP],[o.MINION_CODE]:[t.ACP],[o.DEEPSEEK_HERMES]:[t.ACP]},P=Object.freeze(Object.values(o).filter(e=>e!==o.MINION_CODE));new Set(P);const k={[o.CLAUDE_CODE]:{agentType:o.CLAUDE_CODE,label:"Claude Code",logoSrc:"/agent-icons/claude-code.svg"},[o.GEMINI_CLI]:{agentType:o.GEMINI_CLI,label:"Gemini CLI",logoSrc:"/agent-icons/gemini-cli.svg"},[o.CURSOR_AGENT]:{agentType:o.CURSOR_AGENT,label:"Cursor Agent",logoSrc:"/agent-icons/cursor-agent.svg"},[o.CODEX]:{agentType:o.CODEX,label:"Codex",logoSrc:"/agent-icons/codex.svg"},[o.QWEN_CODE]:{agentType:o.QWEN_CODE,label:"Qwen Code",logoSrc:"/agent-icons/qwen-code.svg"},[o.KIRO_CLI]:{agentType:o.KIRO_CLI,label:"Kiro CLI",logoSrc:"/agent-icons/kiro-cli.svg"},[o.OPENCODE]:{agentType:o.OPENCODE,label:"OpenCode",logoSrc:"/agent-icons/opencode.svg"},[o.PI_CODING_AGENT]:{agentType:o.PI_CODING_AGENT,label:"Pi Coding Agent",logoSrc:"/agent-icons/pi-coding-agent.svg"},[o.GROK_BUILD]:{agentType:o.GROK_BUILD,label:"Grok Build",logoSrc:"/agent-icons/grok-build.svg"},[o.MINION_CODE]:{agentType:o.MINION_CODE,label:"Minion Code"},[o.DEEPSEEK_HERMES]:{agentType:o.DEEPSEEK_HERMES,label:"DeepSeek Harness",logoSrc:"/agent-icons/deepseek-hermes.svg"}};function v(e){return e?k[e]??null:null}function B(e,a){return v(e)?.label??a??(e?String(e):"")}export{o as A,S as C,K as F,n as L,f as P,t as R,r as S,c as T,P as U,l as W,b as a,B as b,U as c,G as d,p as e,I as f,v as g,d as h,T as i,k as j,M as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as ln,V as an,W as z,X as q,Y as X,$ as un,a0 as y,a1 as tn,a2 as F,a3 as _,a4 as rn,a5 as o,a6 as on,a7 as sn,a8 as fn}from"./index-CWEbo6pZ.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,Y,a){var O=I-l,i=D-h,n=Y-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function M(l,h,I,D,v,A,Y){var a=l-I,O=h-D,i=(Y?A:-A)/F(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,$=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*F(on(0,T*T*R-P*P)),V=(P*g-m*S)/R,W=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=V-$,e=W-t,r=w-$,j=p-t;return x*x+e*e>r*r+j*j&&(V=w,W=p),{cx:V,cy:W,x01:-n,y01:-d,x11:V*(v/T-1),y11:W*(v/T-1)}}function hn(){var l=cn,h=yn,I=X(0),D=null,v=gn,A=dn,Y=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,$=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if($>tn-y)a.moveTo(s*z(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=$,S=$,V=Y.apply(this,arguments)/2,W=V>y&&(D?+D.apply(this,arguments):F(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(W>y){var j=sn(W/u*q(V)),G=sn(W/s*q(V));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(S-=G*2)>y?(G*=t?1:-1,m+=G,g-=G):(S=0,m=g=(f+c)/2)}var B=s*z(m),C=s*q(m),H=u*z(T),J=u*q(T);if(w>y){var K=s*z(g),L=s*q(g),N=u*z(R),Q=u*q(R),E;if($<an)if(E=pn(B,C,N,Q,K,L,H,J)){var U=B-E[0],Z=C-E[1],k=K-E[0],b=L-E[1],nn=1/q(fn((U*k+Z*b)/(F(U*U+Z*Z)*F(k*k+b*b)))/2),en=F(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=M(N,Q,B,C,s,x,t),r=M(K,L,H,J,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(H,J):p>y?(e=M(H,J,K,L,u,-p,t),r=M(B,C,N,Q,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:X(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:X(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:X(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:X(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:X(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:X(+n),i):A},i.padAngle=function(n){return arguments.length?(Y=typeof n=="function"?n:X(+n),i):Y},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,S as n}from"./index-CWEbo6pZ.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-CWbMMO6g.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o}from"./index-CWbMMO6g.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-CWbMMO6g.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-hy95xDLb.js";import{_ as i}from"./index-CWEbo6pZ.js";import"./chunk-FMBD7UC4-Dg2iMKZR.js";import"./chunk-ND2GUHAM-DMzFIsJ-.js";import"./chunk-55IACEB6-pT-HP-28.js";import"./chunk-2J33WTMH-D9cBNYgd.js";import"./index-CWbMMO6g.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-hy95xDLb.js";import{_ as i}from"./index-CWEbo6pZ.js";import"./chunk-FMBD7UC4-Dg2iMKZR.js";import"./chunk-ND2GUHAM-DMzFIsJ-.js";import"./chunk-55IACEB6-pT-HP-28.js";import"./chunk-2J33WTMH-D9cBNYgd.js";import"./index-CWbMMO6g.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{L as h,Z as x,I as p,g as u}from"./mermaid-NOHMQCX5-9-DTTfp6.js";import{r as i,j as a}from"./index-CWbMMO6g.js";import"./agent-meta-DOylIs2N.js";import"./chevron-down-C6Ta4vyM.js";var v=u("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),k=r=>{let e={};for(let l of r.split(";")){let n=l.indexOf(":");if(n>0){let c=l.slice(0,n).trim(),o=l.slice(n+1).trim();c&&o&&(e[c]=o)}}return e},j=i.memo(({children:r,result:e,language:l,className:n,...c})=>{let o=i.useMemo(()=>{let s={};return e.bg&&(s["--sdm-bg"]=e.bg),e.fg&&(s["--sdm-fg"]=e.fg),e.rootStyle&&Object.assign(s,k(e.rootStyle)),s},[e.bg,e.fg,e.rootStyle]);return a.jsx("pre",{className:u(n,"p-4 text-sm","bg-[var(--sdm-bg,transparent)]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,transparent))]"),"data-language":l,"data-streamdown":"code-block-body",style:o,...c,children:a.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((s,d)=>a.jsx("span",{className:v,children:s.map((t,b)=>a.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",t.bgColor&&"bg-[var(--sdm-tbg)]",t.bgColor&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:{...t.color?{"--sdm-c":t.color}:{},...t.bgColor?{"--sdm-tbg":t.bgColor}:{},...t.htmlStyle},...t.htmlAttrs,children:t.content},b))},d))})})},(r,e)=>r.result===e.result&&r.language===e.language&&r.className===e.className),y=({className:r,language:e,style:l,...n})=>a.jsx("div",{className:u("my-4 w-full overflow-hidden rounded-xl border border-border",r),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...l},...n}),N=({language:r,children:e})=>a.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":r,"data-streamdown":"code-block-header",children:[a.jsx("span",{className:"ml-1 font-mono lowercase",children:r}),a.jsx("div",{className:"flex items-center gap-2",children:e})]}),w=/\n+$/,M=({code:r,language:e,className:l,children:n,...c})=>{let{shikiTheme:o}=i.useContext(h),s=x(),d=i.useMemo(()=>r.replace(w,""),[r]),t=i.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:d.split(`
|
|
2
|
-
`).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[d]),[b,m]=i.useState(t);return i.useEffect(()=>{if(!s){m(t);return}let g=s.highlight({code:d,language:e,themes:o},f=>{m(f)});if(g){m(g);return}m(t)},[d,e,o,s,t]),a.jsx(p.Provider,{value:{code:r},children:a.jsxs(y,{language:e,children:[a.jsx(N,{language:e,children:n}),a.jsx(j,{className:l,language:e,result:b,...c})]})})};export{M as CodeBlock};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as m,j as e,T as u,l as h}from"./index-CWbMMO6g.js";import{M as b}from"./modal-BRoNvfhw.js";const g=({isOpen:l,onClose:a,onConfirm:n,title:i,description:d,confirmText:c="确认",cancelText:o="取消",variant:x="default",isLoading:t=!1})=>{const{t:s}=m(),r=x==="danger";return e.jsx(b,{isOpen:l,onClose:a,title:i,className:"max-w-sm",action:e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:a,disabled:t,className:"px-4 py-2 text-sm font-medium text-neutral-600 hover:text-neutral-900 transition-colors disabled:opacity-50",children:s(o)}),e.jsx("button",{onClick:n,disabled:t,className:h("px-4 py-2 text-sm font-medium rounded-lg transition-colors disabled:opacity-50",r?"bg-red-500 text-white hover:bg-red-600":"bg-neutral-900 text-white hover:bg-black"),children:s(t?"处理中...":c)})]}),children:e.jsxs("div",{className:"flex gap-4",children:[r&&e.jsx("div",{className:"shrink-0 w-10 h-10 rounded-full bg-red-50 flex items-center justify-center",children:e.jsx(u,{size:20,className:"text-red-500"})}),e.jsx("div",{className:"text-sm text-neutral-600 leading-relaxed pt-1",children:d})]})})};export{g as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as g,l as o}from"./monaco-CrBn9oMJ.js";import{C as l,H as h,D as c,a as u,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-BiYvrSP0.js";import{h as le,i as he,j as ce,t as ue,k as fe}from"./lspLanguageFeatures-BiYvrSP0.js";import"./ProjectKanbanPage-DsPxwoVf.js";import"./index-CWbMMO6g.js";import"./agent-meta-DOylIs2N.js";import"./confirm-dialog-DRpyE_qU.js";import"./modal-BRoNvfhw.js";import"./BranchSelect-Eb5UGWWX.js";import"./task-priority-wLXAgVZZ.js";import"./circle-alert-Dm2Pl-rU.js";import"./check-Cm7Vstpm.js";import"./task-kalEmHDc.js";import"./copy-r0aUdsl8.js";import"./AgentLogo-I2etsqym.js";import"./chevron-down-C6Ta4vyM.js";import"./CreateTaskInput-B_cRDkVq.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import"./BrandLogo-BjC1hcgv.js";import"./ExecutionPermissionSelector-BX5Xx8ta.js";import"./use-projects-BYUZwQ-q.js";import"./MemberAvatar-TVtoxQe8.js";import"./use-providers-DdV9gbj1.js";import"./trash-2-BF_3L-qk.js";import"./paperclip-CC7nHUQ7.js";import"./message-square-QM0c6Dcv.js";import"./layers-2tjjhM75.js";import"./useNormalizedLogs-DdFsf-Z1.js";import"./chevron-up-BwJT7iif.js";import"./at-sign-BFf8Sz8T.js";import"./select-BmjoUfrV.js";import"./textarea-CD82lB0Z.js";import"./play-CIZVXiwM.js";import"./server-BNBdQGor.js";import"./upload-B2AMXrU-.js";import"./globe-JXfw4MCF.js";import"./pencil-DIY0Hu5t.js";const C=120*1e3;class A{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=g({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-DBVD8oXr.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function me(s){const n=[],e=[],a=new A(s);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function d(){const{languageId:t,modeConfiguration:i}=s;m(e),i.completionItems&&e.push(o.registerCompletionItemProvider(t,new l(r,["/","-",":"]))),i.hovers&&e.push(o.registerHoverProvider(t,new h(r))),i.documentHighlights&&e.push(o.registerDocumentHighlightProvider(t,new c(r))),i.definitions&&e.push(o.registerDefinitionProvider(t,new u(r))),i.references&&e.push(o.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(o.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(o.registerRenameProvider(t,new w(r))),i.colors&&e.push(o.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(o.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,s.onDidChange)),i.selectionRanges&&e.push(o.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(o.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(o.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return d(),n.push(p(e)),p(n)}function p(s){return{dispose:()=>m(s)}}function m(s){for(;s.length;)s.pop().dispose()}export{l as CompletionAdapter,u as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,c as DocumentHighlightAdapter,le as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,h as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,A as WorkerManager,he as fromPosition,ce as fromRange,me as setupMode,ue as toRange,fe as toTextEdit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-CrBn9oMJ.js";import"./ProjectKanbanPage-DsPxwoVf.js";import"./index-CWbMMO6g.js";import"./agent-meta-DOylIs2N.js";import"./confirm-dialog-DRpyE_qU.js";import"./modal-BRoNvfhw.js";import"./BranchSelect-Eb5UGWWX.js";import"./task-priority-wLXAgVZZ.js";import"./circle-alert-Dm2Pl-rU.js";import"./check-Cm7Vstpm.js";import"./task-kalEmHDc.js";import"./copy-r0aUdsl8.js";import"./AgentLogo-I2etsqym.js";import"./chevron-down-C6Ta4vyM.js";import"./CreateTaskInput-B_cRDkVq.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import"./BrandLogo-BjC1hcgv.js";import"./ExecutionPermissionSelector-BX5Xx8ta.js";import"./use-projects-BYUZwQ-q.js";import"./MemberAvatar-TVtoxQe8.js";import"./use-providers-DdV9gbj1.js";import"./trash-2-BF_3L-qk.js";import"./paperclip-CC7nHUQ7.js";import"./message-square-QM0c6Dcv.js";import"./layers-2tjjhM75.js";import"./useNormalizedLogs-DdFsf-Z1.js";import"./chevron-up-BwJT7iif.js";import"./at-sign-BFf8Sz8T.js";import"./select-BmjoUfrV.js";import"./textarea-CD82lB0Z.js";import"./play-CIZVXiwM.js";import"./server-BNBdQGor.js";import"./upload-B2AMXrU-.js";import"./globe-JXfw4MCF.js";import"./pencil-DIY0Hu5t.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],M={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},O={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{M as conf,O as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-CrBn9oMJ.js";import"./ProjectKanbanPage-DsPxwoVf.js";import"./index-CWbMMO6g.js";import"./agent-meta-DOylIs2N.js";import"./confirm-dialog-DRpyE_qU.js";import"./modal-BRoNvfhw.js";import"./BranchSelect-Eb5UGWWX.js";import"./task-priority-wLXAgVZZ.js";import"./circle-alert-Dm2Pl-rU.js";import"./check-Cm7Vstpm.js";import"./task-kalEmHDc.js";import"./copy-r0aUdsl8.js";import"./AgentLogo-I2etsqym.js";import"./chevron-down-C6Ta4vyM.js";import"./CreateTaskInput-B_cRDkVq.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import"./BrandLogo-BjC1hcgv.js";import"./ExecutionPermissionSelector-BX5Xx8ta.js";import"./use-projects-BYUZwQ-q.js";import"./MemberAvatar-TVtoxQe8.js";import"./use-providers-DdV9gbj1.js";import"./trash-2-BF_3L-qk.js";import"./paperclip-CC7nHUQ7.js";import"./message-square-QM0c6Dcv.js";import"./layers-2tjjhM75.js";import"./useNormalizedLogs-DdFsf-Z1.js";import"./chevron-up-BwJT7iif.js";import"./at-sign-BFf8Sz8T.js";import"./select-BmjoUfrV.js";import"./textarea-CD82lB0Z.js";import"./play-CIZVXiwM.js";import"./server-BNBdQGor.js";import"./upload-B2AMXrU-.js";import"./globe-JXfw4MCF.js";import"./pencil-DIY0Hu5t.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],O={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},Y={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{O as conf,Y as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,l as t}from"./monaco-CrBn9oMJ.js";import{H as g,D as d,h as p,F as l,b as c,S as u,c as h,f as w,g as _,C as R}from"./lspLanguageFeatures-BiYvrSP0.js";import{a as pe,e as le,d as ce,R as ue,i as he,j as we,t as _e,k as fe}from"./lspLanguageFeatures-BiYvrSP0.js";import"./ProjectKanbanPage-DsPxwoVf.js";import"./index-CWbMMO6g.js";import"./agent-meta-DOylIs2N.js";import"./confirm-dialog-DRpyE_qU.js";import"./modal-BRoNvfhw.js";import"./BranchSelect-Eb5UGWWX.js";import"./task-priority-wLXAgVZZ.js";import"./circle-alert-Dm2Pl-rU.js";import"./check-Cm7Vstpm.js";import"./task-kalEmHDc.js";import"./copy-r0aUdsl8.js";import"./AgentLogo-I2etsqym.js";import"./chevron-down-C6Ta4vyM.js";import"./CreateTaskInput-B_cRDkVq.js";import"./mermaid-NOHMQCX5-9-DTTfp6.js";import"./BrandLogo-BjC1hcgv.js";import"./ExecutionPermissionSelector-BX5Xx8ta.js";import"./use-projects-BYUZwQ-q.js";import"./MemberAvatar-TVtoxQe8.js";import"./use-providers-DdV9gbj1.js";import"./trash-2-BF_3L-qk.js";import"./paperclip-CC7nHUQ7.js";import"./message-square-QM0c6Dcv.js";import"./layers-2tjjhM75.js";import"./useNormalizedLogs-DdFsf-Z1.js";import"./chevron-up-BwJT7iif.js";import"./at-sign-BFf8Sz8T.js";import"./select-BmjoUfrV.js";import"./textarea-CD82lB0Z.js";import"./play-CIZVXiwM.js";import"./server-BNBdQGor.js";import"./upload-B2AMXrU-.js";import"./globe-JXfw4MCF.js";import"./pencil-DIY0Hu5t.js";const I=120*1e3;class f{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-CwpTb9lJ.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(r=>e)}}class v extends R{constructor(o){super(o,[".",":","<",'"',"=","/"])}}function ae(i){const o=new f(i),e=(...n)=>o.getLanguageServiceWorker(...n);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new g(e)),t.registerDocumentHighlightProvider(r,new d(e)),t.registerLinkProvider(r,new p(e)),t.registerFoldingRangeProvider(r,new l(e)),t.registerDocumentSymbolProvider(r,new c(e)),t.registerSelectionRangeProvider(r,new u(e)),t.registerRenameProvider(r,new h(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function me(i){const o=[],e=[],r=new f(i);o.push(r);const n=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(n))),a.hovers&&e.push(t.registerHoverProvider(s,new g(n))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new d(n))),a.links&&e.push(t.registerLinkProvider(s,new p(n))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new c(n))),a.rename&&e.push(t.registerRenameProvider(s,new h(n))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new l(n))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new u(n))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(n))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(n)))}return P(),o.push(m(e)),m(o)}function m(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,pe as DefinitionAdapter,le as DiagnosticsAdapter,ce as DocumentColorAdapter,w as DocumentFormattingEditProvider,d as DocumentHighlightAdapter,p as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,c as DocumentSymbolAdapter,l as FoldingRangeAdapter,g as HoverAdapter,ue as ReferenceAdapter,h as RenameAdapter,u as SelectionRangeAdapter,f as WorkerManager,he as fromPosition,we as fromRange,me as setupMode,ae as setupMode1,_e as toRange,fe as toTextEdit};
|