agent-tower 0.5.3-beta.0 → 0.5.3-beta.1
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/web/agent-icons/claude-code.svg +1 -0
- package/dist/web/agent-icons/codex.svg +1 -0
- package/dist/web/agent-icons/cursor-agent.svg +1 -0
- package/dist/web/agent-icons/gemini-cli.svg +1 -0
- package/dist/web/assets/AgentDemoPage-Cc1sKLmE.js +1 -0
- package/dist/web/assets/AgentLogo-DQId6FqS.js +1 -0
- package/dist/web/assets/{ConversationPage-Cyiw8Hra.js → ConversationPage-BXDIbwTR.js} +2 -2
- package/dist/web/assets/CreateTaskInput-CDynnXvO.js +2 -0
- package/dist/web/assets/{DemoPage-SywVXjL0.js → DemoPage-BeL28u5_.js} +2 -2
- package/dist/web/assets/{GeneralSettingsPage-CTymytF6.js → GeneralSettingsPage-CFc1CWWl.js} +1 -1
- package/dist/web/assets/{Icons-DmLVnVdg.js → Icons-EVcY239B.js} +1 -1
- package/dist/web/assets/LoadingPreviewPage-CRwEvHz_.js +1 -0
- package/dist/web/assets/{McpSettingsPage-DyolUN8C.js → McpSettingsPage-BujDKp8T.js} +1 -1
- package/dist/web/assets/{MemberAvatar-u6jTOiDY.js → MemberAvatar-Bvlu6rk3.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPage-BBop2Bu4.js → NotificationSettingsPage-Dsn-5Uft.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-Bw-eI0cF.js → ProfileSettingsPage-CuhQBP_t.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-BFf2FZVz.js → ProjectKanbanPage-DiEo6BK_.js} +34 -34
- package/dist/web/assets/{ProjectSettingsPage-BJ4sOhMl.js → ProjectSettingsPage-Cj46vZYF.js} +1 -1
- package/dist/web/assets/ProviderSettingsPage-G7pPagR6.js +54 -0
- package/dist/web/assets/{SettingsMasterDetail-CdimTj5n.js → SettingsMasterDetail-_vE8P7ke.js} +1 -1
- package/dist/web/assets/{TeamSettingsPage-CqQTc5AI.js → TeamSettingsPage-CC_QgVbE.js} +1 -1
- package/dist/web/assets/arc-DWusz5nt.js +1 -0
- package/dist/web/assets/architectureDiagram-3BPJPVTR-BzUiKOFe.js +36 -0
- package/dist/web/assets/{arrow-left-B6KMicbE.js → arrow-left-C_pxdzZL.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-6_0hov2h.js → blockDiagram-GPEHLZMM-BGx2sLYW.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-Br6Tzu3R.js → c4Diagram-AAUBKEIU-BCihVD7R.js} +1 -1
- package/dist/web/assets/channel-BBvaRDfe.js +1 -0
- package/dist/web/assets/check-C7Na6M49.js +1 -0
- package/dist/web/assets/{chevron-down-Cur5jANy.js → chevron-down-DuZqUX3d.js} +1 -1
- package/dist/web/assets/{chevron-right-R3KVa8oQ.js → chevron-right-BTjA7BSq.js} +1 -1
- package/dist/web/assets/{chevron-up-DcLdFanO.js → chevron-up-BeZXjQ4W.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-D8zyttB-.js → chunk-2J33WTMH-BVhYZ0vK.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-Cqi9xJ8M.js → chunk-4BX2VUAB-amtolJb4.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-Dxjaitf1.js → chunk-55IACEB6-Bi5q9Evi.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-CAn8Y9XB.js → chunk-727SXJPM-Bb_qV3PR.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-B4sECH9U.js → chunk-AQP2D5EJ-BhFBU2pH.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-Ckd3e1dg.js → chunk-FMBD7UC4-CbBz10YF.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-h5WBT7BK.js → chunk-ND2GUHAM-B930BNNl.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-Cdzk46MK.js → chunk-QZHKN3VN-YlRfC0oD.js} +1 -1
- package/dist/web/assets/{circle-alert-OKyZ9U2p.js → circle-alert-DCm2E91k.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-XuAtffBc.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-XuAtffBc.js +1 -0
- package/dist/web/assets/code-block-OCS4YCEC-ImXQka3_.js +2 -0
- package/dist/web/assets/{confirm-dialog-BAnxa2C9.js → confirm-dialog-Cc27tq8j.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-CbFey2pd.js → cose-bilkent-S5V4N54A-Di3PzbLp.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-Bd2eIyf3.js → dagre-BM42HDAG-DD7qiU9m.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-CXONvVnW.js → diagram-2AECGRRQ-Bgr-CjRi.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-B2E90mVs.js → diagram-5GNKFQAL-CvRORhH2.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-ByaC99pb.js → diagram-KO2AKTUF-CkVyLyvM.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-DwVBF2fn.js → diagram-LMA3HP47-B-CPQQuU.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-FWRddceo.js → diagram-OG6HWLK6-DXow9CgH.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-ye6i3SGj.js → erDiagram-TEJ5UH35-BPLJJwjL.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-B6l7qTcg.js → flowDiagram-I6XJVG4X-ggyugmK6.js} +1 -1
- package/dist/web/assets/{folder-B0m3OL2U.js → folder-B35uD7uF.js} +1 -1
- package/dist/web/assets/{folder-picker-D5XrSfLA.js → folder-picker-DFxfUtH5.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-BCCqDrep.js → ganttDiagram-6RSMTGT7-317n6mcW.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Ca4ANaSw.js → gitGraphDiagram-PVQCEYII-DTUyiJew.js} +1 -1
- package/dist/web/assets/{index-C9hQg1KT.js → index-BwKL3rKp.js} +5 -5
- package/dist/web/assets/index-DgO-2xBV.css +1 -0
- package/dist/web/assets/{index-DbO4YyUv.js → index-OY1TIdAK.js} +116 -9
- package/dist/web/assets/{infoDiagram-5YYISTIA-D1V1Tezr.js → infoDiagram-5YYISTIA-1GXYdkvW.js} +1 -1
- package/dist/web/assets/{input-Dqnd4oTj.js → input-6lLP89Y3.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-DnGiJn9p.js → ishikawaDiagram-YF4QCWOH-DSGxwLxL.js} +1 -1
- package/dist/web/assets/{journeyDiagram-JHISSGLW-QFxbLfhN.js → journeyDiagram-JHISSGLW-Bk9wMzSo.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-BA2nBc7B.js → kanban-definition-UN3LZRKU-BW3QAONh.js} +4 -4
- package/dist/web/assets/{layers-CfFYGUtI.js → layers-CDcLPjE5.js} +1 -1
- package/dist/web/assets/{linear-DpASQZmA.js → linear-DTyT0tZy.js} +1 -1
- package/dist/web/assets/{loader-circle-B5Lfi46Y.js → loader-circle-DDrZegLO.js} +1 -1
- package/dist/web/assets/mermaid-NOHMQCX5-CeIvIbfU.js +122 -0
- package/dist/web/assets/{message-square-CEefL0sf.js → message-square-CunpcgQi.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-C7QuD-ms.js → mindmap-definition-RKZ34NQL-CMuh1LCP.js} +2 -2
- package/dist/web/assets/{modal-CAB_bs-c.js → modal-D8uSzIAd.js} +1 -1
- package/dist/web/assets/{pencil-B__GQn9r.js → pencil-BTaYfjKo.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-Bf5diCKb.js → pieDiagram-4H26LBE5-8PB3-bCK.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-BMbcPnH3.js → quadrantDiagram-W4KKPZXB-Dpf14KEr.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-CUPvJXMk.js → requirementDiagram-4Y6WPE33-ClTLx63o.js} +1 -1
- package/dist/web/assets/{rotate-ccw-5d-eMwsw.js → rotate-ccw-bVmcWqcA.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-C77g6vmK.js → sankeyDiagram-5OEKKPKP-ChlGi0jn.js} +1 -1
- package/dist/web/assets/select-tNVeGe-v.js +1 -0
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-xGOV8CdQ.js → sequenceDiagram-3UESZ5HK-6tJ810tk.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-Bc0piegy.js → stateDiagram-AJRCARHV-Cc5dwA5r.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-EVHRu9u3.js +1 -0
- package/dist/web/assets/{switch-bLlDOWNp.js → switch-7jE2n-KP.js} +1 -1
- package/dist/web/assets/{terminal-Bh2qSv0U.js → terminal-D5iU4zAj.js} +1 -1
- package/dist/web/assets/{textarea-BcVRpxhF.js → textarea-DVa2Yvj4.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-CcACRt_V.js → timeline-definition-PNZ67QCA-q32Hcn4m.js} +3 -3
- package/dist/web/assets/{trash-2-8Pu6lwnW.js → trash-2-z7TLHqpU.js} +1 -1
- package/dist/web/assets/{upload-DNwyW_bv.js → upload-DeI535ZH.js} +1 -1
- package/dist/web/assets/{use-profiles-BIqkQu69.js → use-profiles-BS_Mkp5d.js} +1 -1
- package/dist/web/assets/{use-providers-BOyY0DcV.js → use-providers-CWfLQ--R.js} +1 -1
- package/dist/web/assets/useNormalizedLogs-DW37m6Ji.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-BC9RHBQ5.js → vennDiagram-CIIHVFJN-VxBXMI4P.js} +5 -5
- package/dist/web/assets/{wardley-L42UT6IY-BgPj73Dc.js → wardley-L42UT6IY-BvNOQGfh.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-PbfDUndy.js → wardleyDiagram-YWT4CUSO-DMTZkLB4.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-D87KYJUM.js → xychartDiagram-2RQKCTM6-BaJ2kymJ.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/AgentDemoPage-CUgqAjq9.js +0 -1
- package/dist/web/assets/CreateTaskInput-BILlpv9b.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-BlLaN0i2.js +0 -54
- package/dist/web/assets/arc-Ddp5hhH6.js +0 -1
- package/dist/web/assets/architectureDiagram-3BPJPVTR-CpK7WDLU.js +0 -36
- package/dist/web/assets/channel-Bg_GO2e9.js +0 -1
- package/dist/web/assets/check-D9lM__p8.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-BeJctdRx.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BeJctdRx.js +0 -1
- package/dist/web/assets/code-block-OCS4YCEC-VMJOsrkF.js +0 -2
- package/dist/web/assets/index-C4twOgZR.css +0 -1
- package/dist/web/assets/log-adapter-CjgRCCYG.js +0 -1
- package/dist/web/assets/mermaid-NOHMQCX5-7FmPQynq.js +0 -122
- package/dist/web/assets/select-BJfNuuIV.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CiRT9t6d.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1781751160561" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4796" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M201.007978 681.02243l201.419038-113.041297 3.288474-9.81404-3.288474-5.446535h-9.81404l-33.604094-2.209444-115.045211-3.031562-99.733253-4.110592-96.753073-5.138241-24.303879-5.138241-22.659642-30.058708 2.466356-15.055046 20.552963-13.66772 29.23659 2.466356 64.793215 4.367504 97.009986 6.83386 70.496663 4.110593 104.409052 10.944453h16.6479l2.466356-6.83386-5.75483-4.110593-4.367504-4.110593L297.915199 419.948417l-108.776557-71.935371-57.137237-41.516985-30.829445-21.066787-15.414722-19.679462-6.83386-42.90431 27.900647-30.829445 37.714687 2.466356 9.557128 2.466355 37.971599 29.23659 81.184204 62.840684 106.05329 78.152642 15.414722 12.845602 6.268653-4.367504 0.822119-3.031562-7.090772-11.766572-57.651061-104.254905-61.65889-106.053289-27.33544-43.983341-7.399067-26.513322a133.59426 133.59426 0 0 1-4.367505-31.137739l31.959858-43.161222 17.470018-5.75483 42.339104 5.75483 17.778313 15.414722 26.513322 60.374329 42.647399 95.108836 66.38607 129.278138 19.42255 38.279893 10.276482 35.505244 3.802298 10.944453h6.576948v-6.268654l5.446535-72.706107 10.276482-89.354007 9.81404-115.04521 3.288474-32.525064 16.134076-38.793718 31.959857-21.066787 24.869086 11.766572 20.552963 29.236589-2.723268 18.857344-12.023483 78.97476-23.790055 123.78022-15.414722 82.828441h9.043303l10.276482-10.276481 41.82528-55.749913 70.496663-88.018064 31.137739-34.991419 36.327362-38.536806 23.224848-18.292137h43.983341l32.525064 48.093933-14.489839 49.738171-45.370666 57.394149-37.714687 48.65914-53.848763 72.397812-33.604095 57.959356 3.031562 4.624417 7.912891-0.822119 121.622159-25.948116 65.872246-11.766571 78.409554-13.410808 35.505244 16.6479 3.802298 16.956194-13.924632 34.426213-83.907472 20.552963-98.39731 19.679462-146.491244 34.683126-1.901149 1.387325 2.209443 2.466355 66.129159 6.268654 28.157559 1.644237h68.903808l128.712931 9.557128 33.604095 22.145817 20.244668 27.335441-3.288474 20.552963-51.947614 26.513322-69.982839-16.6479-163.139144-38.793717-56.006824-13.924633h-7.655979v4.624417l46.757991 45.627578 85.551709 77.073611 107.13232 99.476341 5.446535 24.612173-13.667721 19.42255-14.489839-2.209443-94.029805-70.804958-36.327363-31.959857-82.211852-69.160721h-5.446535v7.399067l18.857344 27.592353 100.041547 150.293542 5.138241 46.244167-7.399067 15.055045-25.948115 9.043304-28.414472-5.138241-58.47318-82.211852-60.374329-92.488334-48.659139-82.828441-6.011742 3.288475-28.979678 310.195594-13.410808 15.877164-31.137739 11.766571-25.948116-19.679462-13.667721-31.959857 13.667721-62.840685 16.6479-82.211852 13.410808-65.30704 12.023484-81.184204 7.399066-27.078529-0.565206-1.901149-6.011742 0.822119-61.196447 83.907471-92.899393 125.732752-73.528225 78.717848-17.470019 7.090772-30.829444-15.825781 2.723267-28.15756 16.956195-25.125997 101.942696-129.535049 61.658889-80.362086 39.615837-46.244167-0.256912-6.83386h-2.466356l-270.579758 175.727834-48.093934 6.268654-20.552963-19.42255 2.466356-31.959858 9.81404-10.276481 81.184204-56.006825-0.256912 0.256913 0.822118 0.822118z" fill="#D97757" p-id="4797"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1781751620817" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6364" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M197.579397 0.066598a5154.167428 5154.167428 0 0 1 31.715055-0.017589c8.368873 0.011193 16.734549-0.006396 25.101823-0.019187 16.360396-0.020786 32.72239-0.015989 49.084385-0.003198 13.303215 0.011193 26.606429 0.012792 39.911243 0.007995l5.749803-0.003198 11.565163-0.004797c36.104157-0.012792 72.208314 0.003198 108.310872 0.028781 30.941167 0.020786 61.883932 0.015989 92.826698-0.004797a96092.365342 96092.365342 0 0 1 119.457111-0.015989l5.725819 0.001599c13.280829 0.004797 26.558461-0.003198 39.83929-0.014391 16.195704-0.012792 32.38981-0.009594 48.585515 0.01599 8.255348 0.012792 16.509098 0.017588 24.764446 0.001599 7.571-0.01439 15.142-0.006396 22.711401 0.019187 2.724601 0.004797 5.447602 0.003198 8.172203-0.009594 52.157556-0.207863 99.252854 18.523767 136.834436 54.827793 34.922537 34.749851 56.28443 81.731625 56.709749 131.132601 0.006396 3.853455-0.009594 7.70691-0.025583 11.560365a5154.16423 5154.16423 0 0 1 0.017589 31.715056c-0.011193 8.368873 0.006396 16.734549 0.019187 25.101823 0.020786 16.360396 0.015989 32.72239 0.003198 49.084385-0.011193 13.303215-0.012792 26.606429-0.007995 39.911243l0.003198 5.749803 0.004797 11.565162c0.012792 36.104157-0.003198 72.208314-0.028781 108.310872-0.020786 30.941167-0.015989 61.883932 0.004797 92.826698a96092.365342 96092.365342 0 0 1 0.01439 125.18293c-0.004797 13.280829 0.003198 26.558461 0.014391 39.839291 0.012792 16.195704 0.009594 32.38981-0.01599 48.585514-0.012792 8.255348-0.017588 16.509098-0.001599 24.764446 0.01439 7.571 0.006396 15.142-0.019187 22.711402-0.004797 2.724601-0.003198 5.447602 0.009594 8.172203 0.207863 52.488537-18.851551 99.439931-55.24032 137.246963-39.150146 38.718431-88.044256 56.505084-142.282038 56.271639a5154.167428 5154.167428 0 0 1-31.715056 0.017588c-8.367274-0.011193-16.73295 0.006396-25.100224 0.019187-16.360396 0.020786-32.72239 0.015989-49.084385 0.003198-13.303215-0.011193-26.606429-0.012792-39.911243-0.007994l-5.749803 0.003197-11.565162 0.004797c-36.104157 0.012792-72.208314-0.003198-108.310872-0.028781-30.941167-0.020786-61.883932-0.015989-92.826698 0.004797a96092.402117 96092.402117 0 0 1-119.457112 0.01599l-5.725819-0.001599c-13.280829-0.004797-26.558461 0.003198-39.83929 0.01439-16.195704 0.012792-32.38981 0.009594-48.585514-0.015989-8.255348-0.012792-16.509098-0.017588-24.764446-0.001599-7.571 0.01439-15.142 0.006396-22.711402-0.019188a1306.147031 1306.147031 0 0 0-8.172203 0.009594c-52.488537 0.207863-99.439931-18.851551-137.245364-55.24032C17.629434 930.236321-0.15722 881.34221 0.076226 827.104428a5154.167428 5154.167428 0 0 1-0.017588-31.715055c0.011193-8.367274-0.006396-16.73295-0.019187-25.100224-0.020786-16.360396-0.015989-32.72239-0.003198-49.084385 0.011193-13.303215 0.012792-26.606429 0.007994-39.911243l-0.003198-5.749803-0.004796-11.565163c-0.012792-36.104157 0.003198-72.208314 0.028781-108.310872 0.020786-30.941167 0.015989-61.883932-0.004797-92.826698a96092.365342 96092.365342 0 0 1-0.01599-119.457111l0.001599-5.725819c0.004797-13.280829-0.003198-26.558461-0.01439-39.839291-0.012792-16.195704-0.009594-32.38981 0.015989-48.585514 0.012792-8.255348 0.017588-16.509098 0.001599-24.764446-0.01439-7.571-0.006396-15.142 0.019188-22.711401 0.004797-2.724601 0.003198-5.447602-0.009594-8.172203-0.207863-52.488537 18.851551-99.439931 55.24032-137.245365C94.449103 17.619806 143.343214-0.166848 197.580996 0.066598z" fill="#FEFEFF" p-id="6365"></path><path d="M590.695786 176.559643l3.348189 3.735133c2.83173 2.996421 2.83173 2.996421 6.664398 2.991625l3.87744-0.629984 3.816679-0.569224L613.081003 181.356475c27.397907-3.741529 59.694978-5.031877 86.342979 3.197888l3.181899 0.962565c52.976215 16.349203 96.112528 49.93982 122.335211 99.171308 20.466484 40.064742 25.795765 86.563634 17.48925 130.808015-0.732316 4.288368-1.243978 7.770868-0.700337 12.097611 2.583894 3.607218 2.583894 3.607218 6.195908 6.99538 35.848326 38.09804 49.418564 88.092225 48.336079 139.439116L896.094103 579.493549l-1.878759-2.361641c-3.901424-3.25545-6.181518-3.031598-11.224588-3.025202l-5.244536-0.028781-5.783381 0.041573-6.125555-0.012792c-5.621887-0.009594-11.245374 0.009594-16.867261 0.031979-6.059998 0.022385-12.118397 0.015989-18.176796 0.011193-10.501865-0.001599-21.00213 0.012792-31.503995 0.039973-15.181974 0.038375-30.365547 0.051166-45.54912 0.057562-24.631733 0.009594-49.263467 0.041573-73.8952 0.087942-23.931396 0.043171-47.862792 0.076749-71.792588 0.097536l-4.469049 0.004796-22.193344 0.017589c-61.38826 0.049567-122.776519 0.134311-184.166378 0.24144a574362720.755522 574362720.755522 0 0 1 7.073729-14.288164c3.282632-6.379787 6.996979-12.38702 10.914392-18.391054 9.333037-14.364914 9.333037-14.364914 10.792872-31.278544-1.587751-4.771249-1.587751-4.771249-4.197228-9.49453l-1.442247-2.774168c-7.866805-14.841399-16.574654-29.244687-25.114615-43.703938a4673.409716 4673.409716 0 0 1-8.826171-15.030075l-2.676632-4.576178a581.895721 581.895721 0 0 1-7.211238-12.962639l-2.353646-4.297962a600.771255 600.771255 0 0 1-5.533945-10.492271c-7.126494-13.997156-7.126494-13.997156-19.168142-23.565238-8.947691-2.662242-16.453134-2.49915-24.809216 1.678892-7.380726 6.502906-11.820994 11.664297-12.591684 21.686478 0.865029 12.983426 9.011649 24.372704 15.290702 35.477371l2.958046 5.260526c8.842161 15.663256 17.880992 31.206591 26.98378 46.716349l2.455978 4.243598a150.44145 150.44145 0 0 0 4.445065 7.067332c2.961244 4.525012 4.357123 7.046547 3.597624 12.49255-3.575239 7.05614-7.523032 13.814877-11.6595 20.556025l-2.622268 4.320347a981.684503 981.684503 0 0 1-13.667774 21.862362c-4.349128 6.749143-8.250551 13.653383-11.998477 20.754295a211.853693 211.853693 0 0 1-6.032816 10.305194c-8.410446 13.077764-8.410446 13.077764-10.081342 28.174993 2.395218 9.910255 7.155275 14.803024 15.121214 20.611988 7.775665 2.591888 13.97637 2.222532 21.785613-0.199868 7.515037-4.174843 11.633917-9.443364 15.789573-16.889646 3.033197-4.676911 5.335676-6.111164 10.393136-8.493591 4.536204-0.431715 8.709448-0.607599 13.237658-0.543641l3.973376-0.003197c4.317149 0.003198 8.634298 0.039974 12.951447 0.078348a5353.381468 5353.381468 0 0 1 32.650438 0.139108c8.047486 0.047968 16.09657 0.070354 24.144056 0.095937 15.786375 0.051166 31.569552 0.132712 47.354327 0.233445l1.258369 3.329002 1.690084 4.365117 1.658105 4.329941c3.389761 7.51024 8.711047 12.017664 16.179715 15.15799 3.442527 0.487678 3.442527 0.487678 7.1169 0.43811l4.293165 0.047969 4.672114 0.003197 4.948732 0.041573c5.407629 0.038375 10.813659 0.051166 16.219689 0.063958l11.28055 0.041572c7.887591 0.027182 15.775182 0.039974 23.661175 0.044771 10.094134 0.007995 20.186669 0.068755 30.280803 0.140707 7.770868 0.047968 15.538538 0.059161 23.307807 0.06076 3.720743 0.006396 7.441486 0.027182 11.16063 0.06076 5.212558 0.043171 10.425115 0.035177 15.637673 0.015989l4.632141 0.070354c10.169284-0.110327 17.431688-2.057841 25.068245-9.024441 3.464912-4.835207 3.464912-4.835207 5.596304-10.094134l2.348849-5.177381L721.809199 619.46715c21.000531-0.036776 42.001063-0.063958 63.003194-0.083145 9.750361-0.007995 19.500722-0.019187 29.251082-0.036775 9.40339-0.017588 18.80678-0.027182 28.210171-0.031979 3.594426-0.003198 7.188853-0.007995 10.783278-0.01599 5.019085-0.012792 10.038171-0.01439 15.057257-0.01439l4.541001-0.01599 4.131671 0.006396 3.600822-0.004797C883.30255 619.46715 883.30255 619.46715 886.500439 621.066094c-0.909799 8.981269-4.226009 16.158929-8.095454 24.18403l-1.957108 4.082104C856.195652 690.690515 822.130148 724.751222 779.371186 742.585844c-2.462374 0.754702-4.937539 1.463034-7.427095 2.123397-13.562244 3.229867-13.562244 3.229867-23.027993 12.679627-2.13459 5.430014-3.581635 11.050302-5.129412 16.670591-13.957183 43.414529-52.050426 81.077657-91.830556 101.638479-46.254254 22.832921-100.896569 27.293975-150.100875 12.092814-26.005226-9.28187-50.168469-23.162304-70.585386-41.866752-4.050125-3.540062-4.050125-3.540062-9.225907-4.846399l-3.434532 0.743509-3.460115 0.655567-7.006573 1.670896c-46.932206 7.99472-98.921873-1.608538-138.703601-27.704904-45.437194-32.306665-77.318539-74.62272-88.72061-129.904612-1.555773-10.313189-1.603741-20.530442-1.488616-30.944364 0.038375-3.661582 0.031979-7.321565 0.022385-10.984746 0.023984-11.64511 0.444506-22.8649 3.029999-34.278163 0.749905-4.014949 0.975356-7.575797 0.682749-11.649907-2.738991-3.880637-2.738991-3.880637-6.494911-7.49425C151.46585 564.583395 135.255755 529.333074 130.199894 493.150569l-0.53085-3.492094c-6.613233-52.285471 6.215096-104.257549 37.851803-146.471271 21.186009-27.249205 53.024183-56.204483 87.670103-64.421457 6.215096-1.485419 11.72026-3.050785 17.314966-6.26946 3.799091-6.642014 5.42042-13.421537 7.129691-20.789471C287.811008 221.518752 313.758673 190.914963 338.062623 171.762811h3.197888v-3.197888c73.503459-57.031137 179.639767-52.63564 249.435275 7.99472z" fill="#859FFF" p-id="6366"></path><path d="M201.156235 601.670903l3.626405-0.007995c3.955788-0.006396 7.909976-0.001599 11.865764 0.003198a10109.987442 10109.987442 0 0 1 25.49996 0.003198c7.387122 0.009594 14.774243 0.004797 22.159766-0.004797 5.668257-0.006396 11.336513-0.003198 17.006369 0 2.724601 0 5.447602 0 8.172203-0.003198 3.802289-0.004797 7.602979 0.001599 11.403669 0.011193l3.431334-0.011193c7.791654 0.035177 7.791654 0.035177 11.355701 1.816401l-1.598944 3.896626c-2.487957 8.861348-2.828532 16.53628 0.199868 25.284103 4.556991 6.683586 9.561686 11.382883 17.388516 13.990761 8.759016 0.673155 14.686301-0.519657 22.385217-4.796833 4.216416-4.40669 7.425496-8.573538 10.393137-13.891626 3.033197-4.676911 5.335676-6.111164 10.393136-8.493591 4.536204-0.431715 8.709448-0.607599 13.237658-0.543641l3.973376-0.003197c4.317149 0.003198 8.634298 0.039974 12.951447 0.078348a5353.383067 5353.383067 0 0 1 32.650438 0.139108c8.047486 0.047968 16.09657 0.070354 24.144056 0.095937 15.786375 0.051166 31.569552 0.132712 47.354327 0.233445l1.258369 3.329002 1.690084 4.365117 1.658105 4.329941c3.389761 7.51024 8.711047 12.017664 16.179715 15.15799 3.442527 0.487678 3.442527 0.487678 7.1169 0.43811l4.293165 0.047969 4.672114 0.003197 4.948732 0.041573c5.407629 0.038375 10.813659 0.051166 16.219689 0.063958l11.28055 0.041572c7.887591 0.027182 15.775182 0.039974 23.661175 0.044771 10.094134 0.007995 20.186669 0.068755 30.280803 0.140707 7.770868 0.047968 15.538538 0.059161 23.307807 0.06076 3.720743 0.006396 7.441486 0.027182 11.16063 0.06076 5.212558 0.043171 10.425115 0.035177 15.637673 0.015989l4.632141 0.070354c10.169284-0.110327 17.431688-2.057841 25.068245-9.024441 3.464912-4.835207 3.464912-4.835207 5.596304-10.094134l2.348849-5.177381L721.809199 619.46715c21.000531-0.036776 42.001063-0.063958 63.003194-0.083145 9.750361-0.007995 19.500722-0.019187 29.251082-0.036775 9.40339-0.017588 18.80678-0.027182 28.210171-0.031979 3.594426-0.003198 7.188853-0.007995 10.783278-0.01599 5.019085-0.012792 10.038171-0.01439 15.057257-0.01439l4.541001-0.01599 4.131671 0.006396 3.600822-0.004797C883.30255 619.46715 883.30255 619.46715 886.500439 621.066094c-0.909799 8.981269-4.226009 16.158929-8.095454 24.18403l-1.957108 4.082104C856.195652 690.690515 822.130148 724.751222 779.371186 742.585844c-2.462374 0.754702-4.937539 1.463034-7.427095 2.123397-13.562244 3.229867-13.562244 3.229867-23.027993 12.679627-2.13459 5.430014-3.581635 11.050302-5.129412 16.670591-13.957183 43.414529-52.050426 81.077657-91.832155 101.638479-46.252655 22.832921-100.89497 27.293975-150.100875 12.091215-26.003627-9.280271-50.16687-23.160705-70.583787-41.865153-4.050125-3.540062-4.050125-3.540062-9.225907-4.846399l-3.434532 0.74191-3.460115 0.655567-7.006573 1.672495c-46.932206 7.99472-98.921873-1.608538-138.703601-27.704904-45.437194-32.306665-77.318539-74.62272-88.72061-129.904612-1.555773-10.313189-1.603741-20.530442-1.488616-30.944364 0.038375-3.661582 0.031979-7.321565 0.022385-10.984746 0.059161-30.626175 0.059161-30.626175 5.311692-41.131237 5.641075-1.880358 10.724118-1.822796 16.592243-1.806807z" fill="#4D5EFF" p-id="6367"></path><path d="M590.695786 176.559643l3.348189 3.735133c2.83173 2.996421 2.83173 2.996421 6.664398 2.991625l3.87744-0.629984 3.816679-0.569224L613.081003 181.356475c27.397907-3.741529 59.694978-5.031877 86.342979 3.197888l3.181899 0.962565c52.976215 16.349203 96.112528 49.93982 122.335211 99.171308 8.75262 17.134285 14.679906 34.399683 18.088854 53.364758l0.601203 3.269841c1.894749 11.923326 1.296744 22.628256 1.296744 35.104817l-697.139615 1.598944c17.378923-43.446508 55.413006-77.291357 97.482823-96.264428 3.284231-1.283952 6.491713-2.18096 9.921448-2.994822 6.213497-1.487018 11.72026-3.053983 17.313367-6.271059 3.799091-6.642014 5.42042-13.421537 7.129691-20.789471C287.811008 221.518752 313.758673 190.914963 338.062623 171.762811h3.197888v-3.197888c73.503459-57.031137 179.639767-52.63564 249.435275 7.99472z" fill="#A2A4FF" p-id="6368"></path><path d="M201.156235 601.670903l3.626405-0.007995c3.955788-0.006396 7.909976-0.001599 11.865764 0.003198a10109.987442 10109.987442 0 0 1 25.49996 0.003198c7.387122 0.009594 14.774243 0.004797 22.159766-0.004797 5.668257-0.006396 11.336513-0.003198 17.006369 0 2.724601 0 5.447602 0 8.172203-0.003198 3.802289-0.004797 7.602979 0.001599 11.403669 0.011193l3.431334-0.011193c7.791654 0.035177 7.791654 0.035177 11.355701 1.816401l-1.598944 3.896626c-2.487957 8.861348-2.828532 16.53628 0.199868 25.284103 4.556991 6.683586 9.561686 11.382883 17.388516 13.990761 8.759016 0.673155 14.686301-0.519657 22.385217-4.796833 4.216416-4.40669 7.425496-8.573538 10.393137-13.891626 3.033197-4.676911 5.335676-6.111164 10.393136-8.493591 4.536204-0.431715 8.709448-0.607599 13.237658-0.543641l3.973376-0.003197c4.317149 0.003198 8.634298 0.039974 12.951447 0.078348a5353.383067 5353.383067 0 0 1 32.650438 0.139108c8.047486 0.047968 16.09657 0.070354 24.144056 0.095937 15.786375 0.051166 31.569552 0.132712 47.354327 0.233445l1.258369 3.329002 1.690084 4.365117 1.658105 4.329941c3.389761 7.51024 8.711047 12.017664 16.179715 15.15799 3.442527 0.487678 3.442527 0.487678 7.1169 0.43811l4.293165 0.047969 4.672114 0.003197 4.948732 0.041573c5.407629 0.038375 10.813659 0.051166 16.219689 0.063958l11.28055 0.041572c7.887591 0.027182 15.775182 0.039974 23.661175 0.044771 10.094134 0.007995 20.186669 0.068755 30.280803 0.140707 7.770868 0.047968 15.538538 0.059161 23.307807 0.06076 3.720743 0.006396 7.441486 0.027182 11.16063 0.06076 5.212558 0.043171 10.425115 0.035177 15.637673 0.015989l4.632141 0.070354c10.169284-0.110327 17.431688-2.057841 25.068245-9.024441 3.464912-4.835207 3.464912-4.835207 5.596304-10.094134l2.348849-5.177381L721.809199 619.46715c21.000531-0.036776 42.001063-0.063958 63.003194-0.083145 9.750361-0.007995 19.500722-0.019187 29.251082-0.036775 9.40339-0.017588 18.80678-0.027182 28.210171-0.031979 3.594426-0.003198 7.188853-0.007995 10.783278-0.01599 5.019085-0.012792 10.038171-0.01439 15.057257-0.01439l4.541001-0.01599 4.131671 0.006396 3.600822-0.004797C883.30255 619.46715 883.30255 619.46715 886.500439 621.066094c-0.909799 8.981269-4.226009 16.158929-8.095454 24.18403l-1.957108 4.082104C865.039411 672.628843 849.320192 692.745158 830.537396 710.606962l-1.598944-4.796832H186.162936c-7.201644-28.803378-7.201644-28.803378-7.131291-39.704979a564.232185 564.232185 0 0 1 0.079948-10.7513c0.055963-3.6344 0.063958-7.265602 0.062358-10.900002 0.148702-30.491863 0.148702-30.491863 5.390041-40.976139 5.641075-1.880358 10.724118-1.822796 16.592243-1.806807z" fill="#5E75FF" p-id="6369"></path><path d="M236.552059 300.273144c2.558311-0.007995 5.116621-0.019187 7.674932-0.035177 7.020963-0.03038 14.041927-0.009594 21.06289 0.017588 7.574198 0.020786 15.149995-0.003198 22.724193-0.022385 14.833404-0.028781 29.668407-0.015989 44.501812 0.012792 12.051241 0.022385 24.102483 0.028781 36.152125 0.023984l5.196568-0.003198 10.447501-0.004797c30.797262-0.012792 61.594523 0.012792 92.391785 0.06076 29.903452 0.046369 59.806904 0.057562 89.710356 0.031979a58008.002362 58008.002362 0 0 1 108.05664 0.004797l5.170985 0.004796c12.043247 0.007995 24.088092 0.003198 36.132938-0.007994 14.667114-0.011193 29.332629 0 43.999743 0.038374 7.487855 0.020786 14.974111 0.03038 22.461967 0.012792 6.846679-0.015989 13.693357-0.003198 20.540035 0.033578 2.48316 0.009594 4.967919 0.006396 7.45108-0.007995 3.364178-0.017588 6.72356 0.003198 10.086139 0.035177l5.673053 0.004797c4.550595 0.804269 4.550595 0.804269 7.478262 3.757518C845.063803 325.594022 844.927893 353.147026 844.927893 376.427652l-697.139615 1.598944c10.404329-26.011622 28.584323-48.782185 50.134892-66.533662 2.417603-2.040253 4.712088-4.22441 6.990583-6.418161 9.203522-6.438948 20.879012-4.89117 31.638306-4.801629z" fill="#92A1FF" p-id="6370"></path><path d="M346.057343 381.224484c13.666175 4.868785 19.313645 16.748939 25.589501 28.9217 2.542321 4.883175 5.273318 9.66082 7.988324 14.449658l3.591229 6.395776c7.815639 13.866043 15.743203 27.669727 23.648383 41.484604l3.122737 5.468389c2.254511 3.942996 4.525012 7.879596 6.80031 11.812999l1.774827 3.081165a6431.672573 6431.672573 0 0 0 4.924748 8.517575c3.95259 7.228826 4.887972 12.369431 4.106089 20.575212-4.840004 13.009009-13.223267 24.959517-20.466485 36.754927a534.979504 534.979504 0 0 0-5.236541 9.016446L398.822497 573.097772l3.16591-0.001599a600095.8805 600095.8805 0 0 1 207.837145-0.086343h4.477044c23.950583-0.007995 47.901166-0.020786 71.85175-0.035176 24.556583-0.015989 49.113166-0.023984 73.669749-0.027182 15.164386-0.001599 30.33037-0.009594 45.496354-0.022386 10.383543-0.007995 20.770283-0.011193 31.153826-0.009593 6.000837 0.001599 12.001674 0 18.002512-0.007995 6.490114-0.009594 12.980228-0.006396 19.470342-0.001599l5.810562-0.015989 5.22535 0.011192 4.545798-0.001599C892.896215 573.097772 892.896215 573.097772 894.495159 574.696716c1.843583 16.446739-2.531128 29.943426-6.395776 46.369378H721.809199l-9.593664 19.187329c-9.582472 8.272937-17.230221 9.16195-29.599653 9.029237l-4.951929 0.043172c-5.372452 0.033578-10.743305 0.011193-16.115758-0.01599-3.749524 0.004797-7.500647 0.012792-11.251769 0.023985-7.850815 0.011193-15.698433-0.006396-23.547649-0.043172-10.044567-0.046369-20.085935-0.019187-30.128904 0.028781-7.742087 0.028781-15.484174 0.019187-23.226261 0-3.703154-0.006396-7.40471 0-11.107865 0.017589-5.180579 0.020786-10.361158-0.009594-15.541736-0.054365l-4.60336 0.047969c-10.127712-0.159894-17.385319-2.15058-24.996293-9.077206-3.348189-4.977513-3.348189-4.977513-5.596304-10.094134l-2.348849-5.177381L507.550694 621.066094c-17.401308-0.073551-34.802617-0.131113-52.205524-0.16629-8.079464-0.015989-16.158929-0.038375-24.239992-0.07515-7.794852-0.035177-15.591304-0.054364-23.387755-0.062359-2.975635-0.004797-5.95127-0.015989-8.928504-0.033578-4.16365-0.023984-8.330499-0.027182-12.494149-0.025583l-3.736732-0.035177c-8.367274 0.019187-8.367274 0.019187-15.714422 3.596026l-1.299942 3.397756c-3.525672 8.536762-9.611253 15.648866-17.887387 19.786933-9.950229 1.658105-16.988781 1.670897-25.583105-3.997361-6.965-6.883454-11.336513-12.545315-11.742645-22.609069 0.111926-8.666277 3.317809-14.486433 7.745285-21.761629l1.985888-3.434531c5.212558-8.942894 10.712925-17.7163 16.141341-26.528081l1.709271-2.774168 3.544859-5.753001c3.688764-5.988046 7.342351-11.995278 10.959163-18.026496 1.240781-2.05944 2.494353-4.110885 3.757518-6.155934a710.247758 710.247758 0 0 0 5.484378-9.080404c1.076089-1.768432 2.148981-3.536864 3.25545-5.35966 2.387223-4.635339 2.387223-4.635339 0.967362-8.890129L363.645728 509.14001l-2.310474-4.438669-2.686226-4.828811-3.001218-5.40603L352.453119 488.753473l-3.26984-5.864927a1779.727082 1779.727082 0 0 0-27.236414-46.980175c-1.595746-2.667039-3.183498-5.340473-4.771249-8.015506l-2.654247-4.427477c-3.773508-7.142483-4.197228-13.395953-3.640796-21.454631 5.583513-16.091773 18.966675-23.040784 35.17677-20.786273z" fill="#6C89FF" p-id="6371"></path><path d="M424.405602 501.145289a259759.752659 259759.752659 0 0 1 195.798696-0.175884l4.154057-0.001599c22.222125-0.015989 44.444249-0.039974 66.666374-0.068754 22.78975-0.03038 45.577901-0.047968 68.367651-0.054364 14.070708-0.004797 28.141416-0.019187 42.212123-0.044771 9.638435-0.015989 19.278469-0.022385 28.916904-0.017588 5.567523 0.001599 11.135047 0 16.702569-0.017588 6.02642-0.015989 12.05284-0.012792 18.08086-0.004797l5.367655-0.027182 4.873582 0.019187 4.218014-0.003198C883.30255 501.145289 883.30255 501.145289 888.099383 504.343177c8.386462 23.964974 8.480799 50.094918 7.99472 75.150372l-1.878759-2.361641c-3.901424-3.25545-6.181518-3.031598-11.224588-3.025202l-5.244536-0.028781-5.783381 0.041573-6.125555-0.012792c-5.621887-0.009594-11.245374 0.009594-16.867261 0.031979-6.059998 0.022385-12.118397 0.015989-18.176796 0.011193-10.501865-0.001599-21.00213 0.012792-31.503995 0.039973-15.181974 0.038375-30.365547 0.051166-45.54912 0.057562-24.631733 0.009594-49.263467 0.041573-73.8952 0.087942-23.931396 0.043171-47.862792 0.076749-71.792588 0.097536l-4.469049 0.004796-22.193344 0.017589c-61.38826 0.049567-122.776519 0.134311-184.166378 0.24144a574363124.917417 574363124.917417 0 0 1 7.073729-14.288164c3.282632-6.379787 6.996979-12.38702 10.914392-18.391054 9.285068-14.299357 12.238318-23.552446 9.193928-40.872209z" fill="#7596FF" p-id="6372"></path><path d="M334.864734 456.374855a117.303334 117.303334 0 0 1 7.395117 11.892946c1.376691 2.455978 2.754981 4.913555 4.134869 7.369533l2.171366 3.906221c2.360041 4.139666 4.833608 8.186594 7.347148 12.231922l2.494353 4.083703a514.580175 514.580175 0 0 0 4.873581 7.809243c5.327682 8.864546 5.327682 8.864546 4.604959 14.977309a429.727411 429.727411 0 0 1-11.736249 20.375344l-2.620669 4.320347a1136.550231 1136.550231 0 0 1-16.240475 25.846931c-3.434532 5.538742-6.499708 11.253368-9.531306 17.019161L325.27107 590.686157l-0.949773 3.181899c-1.768432 4.449861-3.261846 6.606837-7.044947 9.609654-9.841501 1.995482-19.636632 1.682089-29.644423 1.530189-2.951651-0.003198-5.903302-0.003198-8.856552 0.003198-6.179919-0.003198-12.359838-0.049567-18.539756-0.127915a1537.19285 1537.19285 0 0 0-23.781095-0.086343c-6.091977 0.011193-12.185553-0.019187-18.279129-0.063958-2.92287-0.015989-5.847338-0.022385-8.770208-0.019188a747.341661 747.341661 0 0 1-12.241516-0.124717l-3.669576 0.025583c-3.368975-0.089541-3.368975-0.089541-8.930103-1.136849-2.951651-3.797492-2.951651-3.797492-4.796832-7.994721a376.295497 376.295497 0 0 0-5.863328-6.629222c-24.475037-27.036545-44.057305-68.210954-43.859036-105.034636l0.015989-5.153396c0.011193-1.749245 0.025583-3.49849 0.039974-5.302099l0.020786-5.415624c0.019187-4.3907 0.04477-8.781401 0.078349-13.172101 25.503158-0.283013 51.009514-0.548438 76.51427-0.791477 11.84178-0.111926 23.68356-0.231847 35.526938-0.366158 10.321184-0.115124 20.642368-0.220654 30.96675-0.311794 5.465191-0.047968 10.928783-0.103931 16.393974-0.171087 6.10317-0.073551 12.20474-0.127916 18.307909-0.175884l5.484379-0.079947 5.047866-0.027183 4.373112-0.043171c4.625745 0.418923 7.921169 1.442248 12.049642 3.565645z" fill="#7B9CFF" p-id="6373"></path><path d="M267.709084 806.543607h457.298003c-13.239257 33.10134-51.094258 59.746144-82.825302 73.711321-48.268924 19.729371-103.485259 22.944847-152.219476 3.037994-21.421054-9.04043-41.529374-21.644906-58.69244-37.368922-4.050125-3.540062-4.050125-3.540062-9.225907-4.846399l-3.434532 0.743509-3.460115 0.655567-7.006573 1.670896c-48.345673 8.234562-99.052986-2.591888-140.208207-28.547547L264.511195 812.939383v-3.197888h3.197889v-3.197888z" fill="#434FFF" p-id="6374"></path><path d="M187.76188 705.81013h641.176572c-2.818938 11.275754-13.378365 16.513894-22.840916 22.522726-16.259662 9.734371-33.625794 18.510975-52.309455 22.247708l-1.598944-4.796832a367372.433273 367372.433273 0 0 0-232.775877-0.175884l-4.939138-0.001599c-26.420952-0.015989-52.840305-0.039974-79.261257-0.068755-27.092508-0.03038-54.183418-0.047968-81.274327-0.054364a39021.398569 39021.398569 0 0 1-50.189255-0.04477c-11.456434-0.015989-22.914467-0.022385-34.372501-0.017588-6.619628 0.001599-13.239257 0-19.858885-0.017589-6.050404-0.015989-12.104007-0.015989-18.154411-0.006396-2.196949 0.001599-4.393898-0.003198-6.592446-0.012791a1170.084885 1170.084885 0 0 0-8.912515 0.006396l-5.015887-0.003198c-4.182838 0.011193-4.182838 0.011193-7.091317 3.594426a2144.359881 2144.359881 0 0 1-6.195908-13.49189l-1.766834-3.794294-1.718865-3.794295-1.573361-3.424938c-2.171366-6.040811-3.341793-12.399811-4.734473-18.666073z" fill="#556AFF" p-id="6375"></path><path d="M201.156235 601.670903l3.626405-0.007995c3.955788-0.006396 7.909976-0.001599 11.865764 0.003198a10109.987442 10109.987442 0 0 1 25.49996 0.003198c7.387122 0.009594 14.774243 0.004797 22.159766-0.004797 5.668257-0.006396 11.336513-0.003198 17.006369 0 2.724601 0 5.447602 0 8.172203-0.003198 3.802289-0.004797 7.602979 0.001599 11.403669 0.011193l3.431334-0.011193c7.791654 0.035177 7.791654 0.035177 11.355701 1.816401l-1.598944 3.896626c-2.487957 8.861348-2.828532 16.53628 0.199868 25.284103 4.556991 6.683586 9.561686 11.382883 17.388516 13.990761 8.759016 0.673155 14.686301-0.519657 22.385217-4.796833 4.216416-4.40669 7.425496-8.573538 10.393137-13.891626 3.033197-4.676911 5.335676-6.111164 10.393136-8.493591 4.536204-0.431715 8.709448-0.607599 13.237658-0.543641l3.973376-0.003197c4.317149 0.003198 8.634298 0.039974 12.951447 0.078348a5353.383067 5353.383067 0 0 1 32.650438 0.139108c8.047486 0.047968 16.09657 0.070354 24.144056 0.095937 15.786375 0.051166 31.569552 0.132712 47.354327 0.233445l1.258369 3.329002 1.690084 4.365117 1.658105 4.329941c3.389761 7.51024 8.711047 12.017664 16.179715 15.15799 3.442527 0.487678 3.442527 0.487678 7.1169 0.43811l4.293165 0.047969 4.672114 0.003197 4.948732 0.041573c5.407629 0.038375 10.813659 0.051166 16.219689 0.063958l11.28055 0.041572c7.887591 0.027182 15.775182 0.039974 23.661175 0.044771 10.094134 0.007995 20.186669 0.068755 30.280803 0.140707 7.770868 0.047968 15.538538 0.059161 23.307807 0.06076 3.720743 0.006396 7.441486 0.027182 11.16063 0.06076 5.212558 0.043171 10.425115 0.035177 15.637673 0.015989l4.632141 0.070354c10.169284-0.110327 17.431688-2.057841 25.068245-9.024441 3.464912-4.835207 3.464912-4.835207 5.596304-10.094134l2.348849-5.177381L721.809199 619.46715c21.000531-0.036776 42.001063-0.063958 63.003194-0.083145 9.750361-0.007995 19.500722-0.019187 29.251082-0.036775 9.40339-0.017588 18.80678-0.027182 28.210171-0.031979 3.594426-0.003198 7.188853-0.007995 10.783278-0.01599 5.019085-0.012792 10.038171-0.01439 15.057257-0.01439l4.541001-0.01599 4.131671 0.006396 3.600822-0.004797C883.30255 619.46715 883.30255 619.46715 886.500439 621.066094c-1.598944 9.593664-1.598944 9.593664-11.192609 30.379938H179.76716c0-38.374658 0-38.374658 4.796832-47.968322 5.641075-1.880358 10.724118-1.822796 16.592243-1.806807z" fill="#6580FF" p-id="6376"></path><path d="M346.057343 381.224484c13.666175 4.868785 19.313645 16.748939 25.589501 28.9217 2.542321 4.883175 5.273318 9.66082 7.988324 14.449658l3.591229 6.395776c7.815639 13.866043 15.743203 27.669727 23.648383 41.484604l3.122737 5.468389c2.254511 3.942996 4.525012 7.879596 6.80031 11.812999l1.774827 3.081165a6431.672573 6431.672573 0 0 0 4.924748 8.517575c3.95259 7.228826 4.887972 12.369431 4.106089 20.575212-4.288368 11.526788-11.475622 21.985481-17.837821 32.453768-5.19337 8.55595-10.279611 17.174258-15.372248 25.790968a5415.44768 5415.44768 0 0 1-5.009492 8.442424c-5.135808 8.645491-10.249231 17.300575-15.269915 26.01482l-2.561509 4.395498a708.353009 708.353009 0 0 0-4.598563 8.005913c-4.974315 8.480799-11.106266 17.500443-20.899798 20.640769-9.26748 1.661303-16.080581 0.986548-23.980963-4.224411-6.965-6.883454-11.336513-12.545315-11.742645-22.609069 0.111926-8.666277 3.317809-14.486433 7.745285-21.761629l1.985888-3.434531c5.212558-8.942894 10.712925-17.7163 16.141341-26.528081l1.709271-2.774168 3.544859-5.753001c3.688764-5.988046 7.342351-11.995278 10.959163-18.026496 1.240781-2.05944 2.494353-4.110885 3.757518-6.155934a710.247758 710.247758 0 0 0 5.484378-9.080404c1.076089-1.768432 2.148981-3.536864 3.25545-5.35966 2.387223-4.635339 2.387223-4.635339 0.967362-8.890129L363.645728 509.14001l-2.310474-4.438669-2.686226-4.828811-3.001218-5.40603L352.453119 488.753473l-3.26984-5.864927a1779.727082 1779.727082 0 0 0-27.236414-46.980175c-1.595746-2.667039-3.183498-5.340473-4.76965-8.015506l-2.654247-4.427477c-3.773508-7.142483-4.198827-13.395953-3.642395-21.454631 5.583513-16.091773 18.966675-23.040784 35.17677-20.786273zM536.883323 593.660193l4.299561-0.028781 4.704093-0.004797 4.964721-0.023984c5.430014-0.023984 10.860028-0.035177 16.291641-0.043171l11.309332-0.027182c7.909976-0.015989 15.821552-0.027182 23.731528-0.031979 10.135706-0.009594 20.269814-0.047968 30.40552-0.092739 7.788457-0.03038 15.578512-0.038375 23.368568-0.041573 3.736732-0.004797 7.473465-0.015989 11.208598-0.038374 5.228547-0.027182 10.457094-0.023984 15.685641-0.012792l4.675312-0.04477c9.537701 0.059161 16.833683 1.064897 24.120072 7.866805 7.279992 9.520113 8.365675 15.984644 6.963401 27.923959-3.146722 8.535163-7.796451 13.367172-15.773583 17.805841-6.491713 2.627065-13.127331 2.281693-20.039566 2.233725l-4.95193 0.043171c-5.380447 0.035177-10.760894 0.023984-16.14134 0.009594-3.752722 0.009594-7.507042 0.019187-11.259764 0.031979-7.85881 0.015989-15.71762 0.007995-23.576431-0.01599-10.055759-0.027182-20.10992 0.011193-30.167277 0.067156-7.748483 0.035177-15.496966 0.031979-23.245449 0.019187-3.707951 0-7.414304 0.009594-11.120656 0.031979-5.190172 0.028781-10.377147 0.006396-15.565721-0.03038l-4.609756 0.057562c-10.20606-0.143905-17.163066-2.404812-25.01548-9.061216-6.528489-7.46547-7.403111-14.874977-7.014567-24.646124 1.194411-7.983528 5.311692-12.191949 11.112661-17.426891 5.313291-3.677571 9.334635-4.496231 15.640871-4.520215z" fill="#FDFEFF" p-id="6377"></path><path d="M150.986166 544.316779h199.868009c-2.662242 6.654805-5.394837 11.79541-9.193928 17.788253a366.41882 366.41882 0 0 0-13.958782 24.216008L325.27107 590.686157l-0.943377 3.170706c-1.77163 4.453059-3.268242 6.613233-7.051343 9.620847-9.841501 1.995482-19.636632 1.682089-29.644423 1.530189-2.951651-0.003198-5.903302-0.003198-8.856552 0.003198-6.179919-0.003198-12.359838-0.049567-18.539756-0.127915a1537.19285 1537.19285 0 0 0-23.781095-0.086343c-6.091977 0.011193-12.185553-0.019187-18.279129-0.063958-2.92287-0.015989-5.847338-0.022385-8.770208-0.019188a747.341661 747.341661 0 0 1-12.241516-0.124717l-3.669576 0.025583c-3.368975-0.089541-3.368975-0.089541-8.930103-1.136849-2.943656-3.783102-2.943656-3.783102-4.796832-7.994721a375.053118 375.053118 0 0 0-6.028019-6.958604C163.995175 577.622784 154.961141 565.942498 149.387222 552.311499l1.598944-7.99472z" fill="#708EFF" p-id="6378"></path><path d="M398.822497 840.121432h14.390497l-1.598944 3.197888c-3.303418 0.661963-3.303418 0.661963-7.295982 0.99934l-4.002157 0.36296L397.223553 844.918264l1.598944-4.796832z" fill="#5C68FF" p-id="6379"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Cursor</title><path d="M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Google Gemini</title><path d="M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as H,u as Q,r as n,m as b,j as e,B as y,M as X,N as Y}from"./index-OY1TIdAK.js";import{u as Z,a as ee,T as te,P as se,S as ne}from"./useNormalizedLogs-DW37m6Ji.js";import{b as re}from"./mermaid-NOHMQCX5-CeIvIbfU.js";import{I as L,a as ae,b as le,A as ie,G as oe}from"./Icons-EVcY239B.js";import{d as ce}from"./use-profiles-BS_Mkp5d.js";import{C as de}from"./chevron-up-BeZXjQ4W.js";import{C as xe}from"./chevron-down-DuZqUX3d.js";import"./check-C7Na6M49.js";import"./chevron-right-BTjA7BSq.js";const me=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ue=H("hash",me);const pe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],he=H("send",pe),ge=!0;function ke(){const{t:s}=Q(),[w,U]=n.useState([]),[i,S]=n.useState(""),[x,A]=n.useState("DEFAULT"),[o,k]=n.useState(""),[a,D]=n.useState(null),[l,c]=n.useState("idle"),[g,E]=n.useState(!1),[m,j]=n.useState(""),C=n.useRef(null),$=n.useRef(null),u=n.useRef(null),{data:p}=ce(i),F=p?Object.keys(p):["DEFAULT"],M=t=>{S(t),A("DEFAULT")},V=n.useCallback(t=>{c(t===0?"stopped":"error")},[]),_=n.useCallback(t=>{console.error("Agent error:",t),c("error")},[]),{isConnected:h,isAttached:f,logs:v,entries:B,agentSessionId:I,attach:z,clearLogs:P}=Z({sessionId:a||"",onExit:V,onError:_}),{todos:R}=ee(B);n.useEffect(()=>{b.get("/demo/agents").then(t=>{U(t.agents);const r=t.agents.find(N=>N.available);r&&S(r.type)})},[]),n.useEffect(()=>{C.current?.scrollToBottom("smooth")},[v]),n.useEffect(()=>{console.log(`[AgentDemoPage:useEffect] t=${Date.now()} sessionId=${a} isConnected=${h} isAttached=${f}`),a&&h&&!f&&(console.log(`[AgentDemoPage:useEffect] t=${Date.now()} calling attach()`),z())},[a,h,f,z]);const G=t=>{if(j(t.target.value),u.current){u.current.style.height="auto";const N=Math.min(u.current.scrollHeight,210);u.current.style.height=`${N}px`}},O=async()=>{if(!i||!o.trim())return;const t=Date.now();console.log(`[AgentDemoPage:handleStart] t=${t} starting...`),c("starting"),P();try{const r=await b.post("/demo/start",{agentType:i,prompt:o.trim(),variant:x});ge&&console.log(`[AgentDemoPage:handleStart] t=${Date.now()} apiTime=${Date.now()-t}ms sessionId=${r.sessionId}`),D(r.sessionId),c("running")}catch(r){console.error("Start failed:",r),c("error")}},T=async()=>{if(!a||!m.trim())return;const t=m.trim();j("");try{await b.post(`/demo/${a}/message`,{message:t})}catch(r){console.error("Send failed:",r)}},K=async()=>{if(a)try{await b.post(`/demo/${a}/stop`),c("stopped")}catch(t){console.error("Stop failed:",t)}},q=()=>{D(null),c("idle"),k(""),j(""),P()},J=l==="running",d=a!==null,W=w.find(t=>t.type===i);return e.jsxs("div",{className:"flex flex-col h-full bg-white",children:[e.jsxs("div",{className:"px-8 py-5 border-b border-neutral-100 bg-white transition-all duration-300",children:[e.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-base font-medium text-blue-600",children:"Agent Demo"}),e.jsx("span",{className:"text-neutral-300 text-sm",children:"/"}),e.jsx("span",{className:"text-xl font-bold text-neutral-900 tracking-tight",children:d?o.slice(0,50)+(o.length>50?"...":""):s("新会话")})]}),e.jsxs("div",{className:"flex items-center",children:[l==="running"&&e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-0.5 bg-blue-50 text-blue-700 rounded-full text-xs font-medium border border-blue-100",children:[e.jsx(L,{className:"w-3.5 h-3.5 animate-pulse"}),e.jsx("span",{children:"Running"})]}),l==="stopped"&&e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-0.5 bg-emerald-50 text-emerald-700 rounded-full text-xs font-medium border border-emerald-100",children:[e.jsx(ae,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Done"})]}),l==="idle"&&e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-0.5 bg-neutral-100 text-neutral-600 rounded-full text-xs font-medium border border-neutral-200",children:[e.jsx(le,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Idle"})]}),l==="starting"&&e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-0.5 bg-amber-50 text-amber-700 rounded-full text-xs font-medium border border-amber-100",children:[e.jsx(L,{className:"w-3.5 h-3.5 animate-spin"}),e.jsx("span",{children:"Starting..."})]}),l==="error"&&e.jsx("div",{className:"flex items-center gap-1.5 px-2.5 py-0.5 bg-red-50 text-red-700 rounded-full text-xs font-medium border border-red-100",children:e.jsx("span",{children:"Error"})})]})]}),d&&e.jsxs("div",{className:"mt-1.5 flex items-start gap-2 group max-w-4xl",children:[e.jsx("div",{className:`text-sm text-neutral-600 leading-relaxed cursor-pointer transition-all ${g?"":"truncate"}`,onClick:()=>E(!g),children:o}),e.jsx("button",{onClick:()=>E(!g),className:"mt-0.5 text-neutral-400 opacity-0 group-hover:opacity-100 hover:text-neutral-600 transition-opacity",children:g?e.jsx(de,{size:14}):e.jsx(xe,{size:14})})]}),e.jsxs("div",{className:"flex items-center gap-6 mt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-neutral-400 font-medium",children:"Agent"}),e.jsx("div",{className:"flex items-center gap-1.5 text-neutral-900 font-medium bg-neutral-50 px-2 py-1 rounded border border-neutral-100",children:W?.name||i||s("未选择")})]}),x!=="DEFAULT"&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-neutral-400 font-medium",children:"Variant"}),e.jsx("div",{className:"flex items-center gap-1.5 text-neutral-700 font-medium bg-blue-50 px-2 py-1 rounded border border-blue-100",children:x})]}),I&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-neutral-400 font-medium",children:"Session"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-neutral-700 font-mono bg-neutral-50 px-2 py-1 rounded border border-neutral-100",children:[I.slice(0,8),"..."]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-neutral-400 font-medium",children:s("连接")}),e.jsx("div",{className:`flex items-center gap-1.5 font-medium px-2 py-1 rounded border ${h?"text-emerald-700 bg-emerald-50 border-emerald-100":"text-neutral-500 bg-neutral-50 border-neutral-100"}`,children:s(h?f?"已连接":"连接中...":"未连接")})]}),d&&e.jsx(y,{variant:"outline",size:"sm",onClick:q,className:"ml-auto",children:s("新会话")}),e.jsxs(X,{to:"/settings/profiles",className:`flex items-center gap-1.5 text-xs text-neutral-500 hover:text-neutral-900 transition-colors ${d?"":"ml-auto"}`,children:[e.jsx(Y,{size:14}),e.jsx("span",{children:s("Profiles 设置")})]})]})]}),e.jsx("div",{ref:$,className:"flex-1 overflow-y-auto px-8 py-6",children:d?e.jsx("div",{className:"min-h-[200px]",children:v.length===0?e.jsx("div",{className:"text-neutral-400 text-center py-8",children:s("等待 Agent 响应...")}):e.jsx(re,{ref:C,logs:v,scrollElementRef:$})}):e.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-3 text-neutral-900",children:s("选择 Agent")}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:w.map(t=>e.jsxs(y,{variant:i===t.type?"default":"outline",disabled:!t.available,onClick:()=>M(t.type),children:[t.name,t.available&&t.version&&` (${t.version})`,!t.available&&s(" (不可用)")]},t.type))})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-3 text-neutral-900",children:s("配置变体 (Profile Variant)")}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:F.map(t=>e.jsx("button",{onClick:()=>A(t),className:`px-3 py-1.5 rounded-full text-sm font-medium border transition-colors ${x===t?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-400"}`,children:t},t))}),p&&p[x]&&e.jsx("p",{className:"mt-2 text-xs text-neutral-500 font-mono",children:Object.entries(p[x]).map(([t,r])=>`${t}: ${JSON.stringify(r)}`).join(", ")})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-3 text-neutral-900",children:s("输入任务")}),e.jsxs("div",{className:"relative border border-neutral-200 rounded-xl shadow-sm bg-white focus-within:ring-1 focus-within:ring-neutral-300 focus-within:border-neutral-300 transition-all duration-200",children:[e.jsx("textarea",{value:o,onChange:t=>k(t.target.value),rows:4,placeholder:s("描述你想让 Agent 完成的任务..."),className:"w-full px-4 py-3 bg-transparent border-none focus:outline-none focus:ring-0 resize-none text-neutral-900 placeholder-neutral-400 leading-relaxed text-sm"}),e.jsx("div",{className:"flex items-center justify-end px-3 pb-3 pt-1",children:e.jsx(y,{onClick:O,disabled:l==="starting"||!i||!o.trim(),children:s(l==="starting"?"启动中...":"开始")})})]})]})]})}),d&&R.length>0&&e.jsx("div",{className:"px-8 py-2 bg-white border-t border-neutral-100",children:e.jsx(te,{todos:R})}),d&&e.jsx("div",{className:"px-8 py-6 border-t border-neutral-100 bg-white",children:e.jsxs("div",{className:"relative border border-neutral-200 rounded-xl shadow-sm bg-white focus-within:ring-1 focus-within:ring-neutral-300 focus-within:border-neutral-300 transition-all duration-200",children:[e.jsx("textarea",{ref:u,value:m,onChange:G,rows:3,placeholder:s("发送消息给 Agent..."),className:"w-full px-4 py-3 bg-transparent border-none focus:outline-none focus:ring-0 resize-none text-neutral-900 placeholder-neutral-400 leading-relaxed text-sm scrollbar-thin scrollbar-thumb-neutral-200 scrollbar-track-transparent",style:{minHeight:"80px",maxHeight:"210px"},onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&!t.repeat&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229&&(t.preventDefault(),T())}}),e.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1 border-t border-transparent",children:[e.jsxs("div",{className:"flex items-center gap-1 text-neutral-400",children:[e.jsx("button",{className:"p-2 hover:bg-neutral-100 hover:text-neutral-600 rounded-lg transition-colors",title:"Attach File",children:e.jsx(se,{size:18})}),e.jsx("button",{className:"p-2 hover:bg-neutral-100 hover:text-neutral-600 rounded-lg transition-colors",title:"Mention",children:e.jsx(ie,{size:18})}),e.jsx("button",{className:"p-2 hover:bg-neutral-100 hover:text-neutral-600 rounded-lg transition-colors",title:"Reference Issue",children:e.jsx(ue,{size:18})}),e.jsx("div",{className:"w-px h-4 bg-neutral-200 mx-1"}),e.jsx("button",{className:"p-2 hover:bg-neutral-100 hover:text-neutral-600 rounded-lg transition-colors",title:"Search Web",children:e.jsx(oe,{size:18})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[J&&e.jsxs("button",{onClick:K,className:"flex items-center gap-2 px-3 py-2 text-xs font-semibold text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",children:[e.jsx(ne,{size:12,fill:"currentColor"}),e.jsx("span",{children:s("停止")})]}),e.jsxs("button",{onClick:T,disabled:!m.trim(),className:`flex items-center gap-2 px-3 py-2 text-xs font-semibold rounded-lg transition-all ${m.trim()?"bg-neutral-900 text-white hover:bg-black shadow-sm":"bg-neutral-100 text-neutral-400 cursor-not-allowed"}`,children:[e.jsx("span",{children:s("发送")}),e.jsx(he,{size:14})]})]})]})]})})]})}export{ke as AgentDemoPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,j as s,C as g,g as o}from"./index-OY1TIdAK.js";import{g as u}from"./mermaid-NOHMQCX5-CeIvIbfU.js";function d({agentType:n,className:t,fallbackClassName:i}){const e=u(n),[c,r]=a.useState(!1);return a.useEffect(()=>{r(!1)},[e?.logoSrc]),!e||c?s.jsx(g,{"aria-hidden":"true",className:o("shrink-0 text-muted-foreground",t,i)}):s.jsx("img",{src:e.logoSrc,alt:"","aria-hidden":"true",className:o("shrink-0 object-contain",t),draggable:!1,onError:()=>r(!0)})}export{d as A};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{h as Ee,u as le,r,j as e,g as k,i as ve,k as J,l as ce,q as x,m as U
|
|
1
|
+
import{h as Ee,u as le,r,j as e,g as k,i as ve,k as J,l as ce,q as x,m as Q,U as Ae,V as Le,I as Te,J as he,N as Pe,W as Me,Y as oe}from"./index-OY1TIdAK.js";import{b as Re,S as w}from"./mermaid-NOHMQCX5-CeIvIbfU.js";import{u as qe,a as ze,T as Oe,P as Fe,S as Ke}from"./useNormalizedLogs-DW37m6Ji.js";import{u as Ue,a as Qe,b as Be,A as _e,c as $e,P as Ge,T as Ve,d as He,B as We,e as Je,S as Ye,f as ye,C as Xe}from"./CreateTaskInput-CDynnXvO.js";import{u as Ze}from"./use-providers-CWfLQ--R.js";import{M as me}from"./message-square-CunpcgQi.js";import{A as et}from"./arrow-left-C_pxdzZL.js";import{T as tt}from"./trash-2-z7TLHqpU.js";import"./chevron-right-BTjA7BSq.js";import"./chevron-down-DuZqUX3d.js";import"./check-C7Na6M49.js";import"./AgentLogo-DQId6FqS.js";import"./loader-circle-DDrZegLO.js";import"./MemberAvatar-Bvlu6rk3.js";import"./folder-B35uD7uF.js";const st=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],nt=Ee("layout-list",st);function rt(t){return t===w.RUNNING||t===w.PENDING}function at({sessionId:t,sessionStatus:n,agentType:a,providerId:m,providers:h,initialTokenUsage:f,onProviderChange:S,onSend:y,onStop:N,onExit:I,isSending:p=!1,isStopping:g=!1,canStop:B,className:R}){const{t:o}=le(),[u,q]=r.useState(""),[A,C]=r.useState(m??""),[Y,_]=r.useState(!1),[X,z]=r.useState(null),$=r.useRef(null),Z=r.useRef(null),G=r.useRef(null),L=r.useRef(!1),{scrollRef:ee,contentRef:i,isAtBottom:O,scrollToBottom:V}=Ue({initial:"instant",resize:"smooth"}),{isConnected:F,isLoadingSnapshot:te,logs:D,entries:de,attach:j}=qe({sessionId:t,sessionStatus:n,onExit:I}),{todos:H}=ze(de),ue=Qe(D,f),{files:se,addFiles:E,removeFile:ne,clear:re,buildMarkdownLinks:W,getDoneAttachments:ae,hasFiles:T,isUploading:P}=Be(),K=rt(n),s=B??K;r.useEffect(()=>{C(m??"")},[m]),r.useEffect(()=>{t&&F&&j()},[t,F,j]);const l=r.useCallback(c=>{C(c),S?.(c)},[S]),d=r.useCallback(()=>{$.current&&($.current.style.height="60px")},[]),b=r.useCallback(c=>{q(c.target.value);const v=c.target;v.style.height="auto",v.style.height=`${Math.max(60,Math.min(v.scrollHeight,300))}px`},[]),fe=r.useCallback(async()=>{if(!u.trim()&&!T||L.current||p||P)return;L.current=!0;const c=W(),v=ae().map(M=>M.id),U=[u.trim(),c].filter(Boolean).join(`
|
|
2
2
|
|
|
3
|
-
`);q(""),re(),d(),z(null);try{await y({message:Q,providerId:A||void 0,attachmentIds:v}),await j(),requestAnimationFrame(()=>H("smooth"))}catch(M){z(M instanceof Error?M.message:o("Send failed. Please try again.")),q(Q)}finally{T.current=!1}},[u,L,p,P,W,ae,re,d,y,A,j,H,o]),we=r.useCallback(async()=>{!s||g||await N()},[s,g,N]),Ce=r.useCallback(c=>{const v=c.target.files;v&&v.length>0&&E(Array.from(v)),c.target.value=""},[E]),ke=r.useCallback(c=>{const v=c.clipboardData.items,Q=[];for(const M of v)if(M.kind==="file"){const xe=M.getAsFile();xe&&Q.push(xe)}Q.length>0&&(c.preventDefault(),E(Q))},[E]),Se=r.useCallback(c=>{c.preventDefault(),_(!0)},[]),Ie=r.useCallback(c=>{c.preventDefault(),_(!1)},[]),De=r.useCallback(c=>{c.preventDefault(),_(!1);const v=c.dataTransfer.files;v.length>0&&E(Array.from(v))},[E]);return e.jsxs("div",{className:k("relative flex min-h-0 flex-1 flex-col bg-background",R),children:[e.jsxs("div",{className:"relative min-h-0 flex-1",children:[e.jsx("div",{ref:ee,className:"h-full overflow-y-auto scrollbar-app-thin px-6 pb-4 pt-6",children:e.jsx("div",{ref:i,className:"mx-auto w-full min-w-0 max-w-4xl",children:te?e.jsxs("div",{className:"flex items-center justify-center gap-3 py-12 text-muted-foreground/70",children:[e.jsxs("svg",{className:"h-5 w-5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.jsx("span",{className:"text-sm",children:o("Loading logs...")})]}):D.length===0?e.jsx("div",{className:"py-8 text-center text-muted-foreground/70",children:o(K?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx(ze,{logs:D})})}),!O&&e.jsxs("button",{type:"button",onClick:()=>H(),className:"absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-background/90 px-3 py-1.5 text-xs text-muted-foreground shadow-md backdrop-blur-sm transition-all hover:bg-background hover:text-foreground","aria-label":o("Scroll to bottom"),children:[e.jsx(_e,{size:14}),e.jsx("span",{children:o("Back to bottom")})]})]}),V.length>0&&e.jsx("div",{className:"shrink-0 border-t border-border/60 bg-background px-6 pb-1 pt-2",children:e.jsx("div",{className:"mx-auto max-w-4xl",children:e.jsx(Oe,{todos:V})})}),e.jsx("div",{className:"z-10 w-full shrink-0 border-t border-transparent bg-background p-6 pb-6 pt-2",onDragOver:Se,onDragLeave:Ie,onDrop:De,children:e.jsxs("div",{className:"mx-auto max-w-4xl",children:[X?e.jsx("div",{className:"mb-2 text-sm text-destructive",children:X}):null,e.jsxs("div",{ref:G,className:k("relative rounded-xl border bg-background transition-colors duration-200 hover:border-ring/40 focus-within:border-ring/60",Y?"border-info bg-info/5":"border-border"),children:[e.jsx($e,{files:se,onRemove:ne}),e.jsx("textarea",{ref:$,value:u,onChange:b,onPaste:ke,onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&!c.repeat&&!c.nativeEvent.isComposing&&c.nativeEvent.keyCode!==229&&(c.preventDefault(),fe())},rows:1,placeholder:o(Y?"Drop files here...":t&&!K?"Continue conversation...":"Message Agent..."),className:"w-full resize-none border-none bg-transparent px-4 pb-2 pt-4 text-sm leading-relaxed text-foreground placeholder-muted-foreground/70 focus:outline-none",style:{minHeight:"60px",maxHeight:"300px"}}),e.jsx("input",{ref:Z,type:"file",multiple:!0,className:"hidden",onChange:Ce}),e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2 pt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("button",{type:"button",onClick:()=>Z.current?.click(),disabled:P,className:"rounded-lg p-2 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",title:o("Upload file"),children:e.jsx(Fe,{size:18})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{providers:h,currentProviderId:A,agentType:a,onSelect:l}),e.jsx(He,{usage:ue}),s&&K&&!u.trim()&&!L?e.jsx("button",{type:"button",onClick:we,disabled:g,className:"rounded-lg bg-destructive p-2 text-white transition-all duration-200 hover:bg-destructive/90 disabled:opacity-50",title:o("Stop"),children:e.jsx(Ke,{size:14})}):e.jsx("button",{type:"button",onClick:fe,disabled:!u.trim()&&!L||P||p,className:k("rounded-lg p-2 transition-all duration-200",(u.trim()||L)&&!P&&!p?"bg-primary text-primary-foreground hover:bg-primary/90":"cursor-not-allowed bg-transparent text-muted-foreground/50"),title:o("Send"),children:e.jsx(Ve,{size:18})})]})]})]})]})})]})}function ot(t=50){return ve({queryKey:x.conversations.list({limit:t}),queryFn:()=>U.get("/conversations",{params:{limit:String(t)}})})}function it(t){return ve({queryKey:x.conversations.detail(t??""),queryFn:()=>U.get(`/conversations/${t}`),enabled:!!t})}function lt(){const t=J();return ce({mutationFn:n=>U.post("/conversations",n),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function ct(){const t=J();return ce({mutationFn:({id:n,...a})=>U.post(`/conversations/${n}/message`,a),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function dt(){const t=J();return ce({mutationFn:n=>U.post(`/conversations/${n}/stop`),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function ut(){const t=J();return ce({mutationFn:n=>U.delete(`/conversations/${n}`),onSuccess:(n,a)=>{t.removeQueries({queryKey:x.conversations.detail(a)}),t.invalidateQueries({queryKey:x.conversations.all})}})}const mt=3e4,Ne="agent-tower:conversation-read-times";function ft(){try{const t=window.localStorage.getItem(Ne);if(!t)return{};const n=JSON.parse(t);return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).map(([a,m])=>[a,typeof m=="number"?m:Number(m)]).filter(a=>Number.isFinite(a[1])))}catch{return{}}}function pe(t){try{window.localStorage.setItem(Ne,JSON.stringify(t))}catch{}}function ge(t){const n=t.lastActiveAt??t.updatedAt??t.createdAt;if(!n)return 0;const a=new Date(n).getTime();return Number.isFinite(a)?a:0}function xt(t=mt){const[,n]=r.useState(0);r.useEffect(()=>{const a=setInterval(()=>n(m=>m+1),t);return()=>clearInterval(a)},[t])}function ie(t){return t===w.RUNNING||t===w.PENDING}function je(t){if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const a=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));return a<60?oe("{count}s ago",{count:a}):a<3600?oe("{count}m ago",{count:Math.floor(a/60)}):a<86400?oe("{count}h ago",{count:Math.floor(a/3600)}):oe("{count}d ago",{count:Math.floor(a/86400)})}function ht(t,n){switch(t){case w.RUNNING:return n("Running");case w.PENDING:return n("Starting");case w.COMPLETED:return n("Completed");case w.FAILED:return n("Failed");case w.CANCELLED:return n("Stopped");default:return t}}function be({className:t,pulseClassName:n}){return e.jsxs("span",{className:"relative inline-flex h-2 w-2",children:[e.jsx("span",{className:k("absolute inline-flex h-full w-full animate-ping rounded-full",n)}),e.jsx("span",{className:k("relative inline-flex h-2 w-2 rounded-full",t)})]})}function pt({status:t,unread:n}){return ie(t)?e.jsx(be,{className:"bg-success",pulseClassName:"bg-success/70"}):n?e.jsx(be,{className:"bg-warning",pulseClassName:"bg-warning/70"}):null}function gt({conversation:t,selected:n,onSelect:a,onDelete:m,disabled:h,unread:f}){const{t:S}=le(),y=je(t.lastActiveAt??t.createdAt),N=ie(t.status)||f;return e.jsxs("div",{className:k("group ml-4 mr-2 flex items-center rounded-md transition-colors",n?"bg-accent":"hover:bg-accent/50"),children:[e.jsxs("button",{type:"button",onClick:a,title:t.title,className:"flex min-w-0 flex-1 animate-task-enter items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",children:[e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(me,{size:14,className:"text-muted-foreground"})}),e.jsx("span",{className:k("min-w-0 flex-1 truncate",n?"font-medium text-foreground":"text-foreground/90"),children:t.title}),N?e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(pt,{status:t.status,unread:f})}):e.jsx("span",{className:"flex w-14 shrink-0 items-center justify-end text-[11px] tabular-nums text-muted-foreground/50",children:e.jsx("span",{className:"truncate group-hover:hidden",children:y})})]}),e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),m()},disabled:h,className:"mr-1 hidden shrink-0 rounded-md p-1.5 text-muted-foreground hover:bg-background hover:text-destructive disabled:opacity-50 group-hover:flex",title:S("Delete"),children:e.jsx(tt,{size:14})})]})}function bt({isOpen:t,conversations:n,onClose:a,onSelectConversation:m}){const{t:h}=le(),[f,S]=r.useState(""),[y,N]=r.useState(0),I=r.useRef(null);r.useEffect(()=>{t&&(S(""),N(0))},[t]);const p=r.useMemo(()=>{const o=f.trim().toLowerCase();return o?n.filter(u=>u.title.toLowerCase().includes(o)).slice(0,50):n.slice(0,12)},[n,f]);r.useEffect(()=>{N(0)},[f]),r.useEffect(()=>{I.current?.children[y]?.scrollIntoView({block:"nearest"})},[y]);const g=r.useCallback(o=>{m(o),a()},[a,m]),B=r.useCallback(o=>{if(o.key==="Escape"){o.preventDefault(),a();return}if(o.key==="ArrowDown"){o.preventDefault(),N(u=>Math.min(u+1,p.length-1));return}if(o.key==="ArrowUp"){o.preventDefault(),N(u=>Math.max(u-1,0));return}if(o.key==="Enter"&&!o.nativeEvent.isComposing){o.preventDefault();const u=p[y];u&&g(u)}},[y,g,a,p]);if(!t)return null;const R=f.trim().length>0;return e.jsxs("div",{className:"fixed inset-0 z-90",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20",onClick:a}),e.jsxs("div",{className:"absolute left-1/2 top-[18vh] w-[min(560px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-border bg-popover shadow-lg animate-in fade-in zoom-in-95 duration-100",children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(ye,{size:15,className:"shrink-0 text-muted-foreground/70"}),e.jsx("input",{value:f,onChange:o=>S(o.target.value),onKeyDown:B,placeholder:h("Search conversations..."),"aria-label":h("Search conversations..."),autoFocus:!0,className:"flex-1 border-none bg-transparent py-3 text-sm text-foreground placeholder-muted-foreground/60 focus:outline-none"})]}),p.length>0?e.jsxs(e.Fragment,{children:[R?null:e.jsx("div",{className:"px-4 pb-1 pt-2.5 text-[11px] font-medium text-muted-foreground/70",children:h("Recent conversations")}),e.jsx("div",{ref:I,className:"max-h-[46vh] overflow-y-auto pb-1.5 pt-0.5 scrollbar-app-thin",children:p.map((o,u)=>e.jsxs("button",{type:"button",onClick:()=>g(o),onMouseEnter:()=>N(u),className:k("flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors",u===y&&"bg-accent"),children:[e.jsx(me,{size:14,className:"shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground/90",title:o.title,children:o.title}),e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground/60",children:je(o.lastActiveAt??o.createdAt)})]},o.id))})]}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground/70",children:h("No matching conversations")})]})]})}function Pt(){const{t}=le();xt();const n=Ae(),{conversationId:a}=Te(),m=J(),[h,f]=r.useState(""),[S,y]=r.useState("idle"),[N,I]=r.useState(null),[p,g]=r.useState(!1),[B,R]=r.useState(!1),[o,u]=r.useState(ft),[q,A]=r.useState(()=>new Set),{data:C=[],isLoading:Y}=ot(),{data:_,isLoading:X}=it(a),{data:z=[],isLoading:$}=Ze(),Z=lt(),G=ct(),T=dt(),ee=ut(),i=_??C.find(s=>s.id===a)??null,O=r.useMemo(()=>z.filter(({availability:s})=>s.type!=="NOT_FOUND"),[z]),H=O.map(({provider:s})=>({id:s.id,name:s.name,available:!0})),F=!!a,te=F||p,D=r.useCallback(s=>{m.invalidateQueries({queryKey:x.conversations.all}),s&&m.invalidateQueries({queryKey:x.conversations.detail(s)})},[m]),de=r.useCallback(()=>{D(a)},[a,D]),j=r.useCallback(s=>{if(A(d=>{if(!d.has(s.id))return d;const b=new Set(d);return b.delete(s.id),b}),s.status!==w.COMPLETED)return;const l=Math.max(Date.now(),ge(s));u(d=>{if(d[s.id]&&d[s.id]>=l)return d;const b={...d,[s.id]:l};return pe(b),b})},[]),V=r.useCallback(s=>{A(l=>{if(l.has(s))return l;const d=new Set(l);return d.add(s),d})},[]),ue=r.useCallback(s=>{A(l=>{if(!l.has(s))return l;const d=new Set(l);return d.delete(s),d}),u(l=>{if(!(s in l))return l;const d={...l};return delete d[s],pe(d),d})},[]),se=r.useMemo(()=>{const s=new Map;for(const l of C)s.set(l.sessionId,l);return i&&s.set(i.sessionId,i),s},[i,C]),E=r.useCallback(s=>s.status!==w.COMPLETED?!1:q.has(s.id)?!0:ge(s)>(o[s.id]??0),[o,q]);r.useEffect(()=>{!h&&O.length>0&&f(O[0].provider.id)},[O,h]),r.useEffect(()=>{i?.providerId&&f(i.providerId)},[i?.providerId]),r.useEffect(()=>{a&&g(!1)},[a]),r.useEffect(()=>{i&&j(i)},[i,j]),r.useEffect(()=>{const s=Le.connect(),l=d=>{const b=se.get(d.sessionId);if(b){if(D(b.id),d.status!==w.COMPLETED){j(b);return}if(b.id===a){j(b);return}V(b.id)}};return s.on(he.SESSION_COMPLETED,l),()=>{s.off(he.SESSION_COMPLETED,l)}},[a,se,D,j,V]);const ne=()=>{I(null),g(!0),n("/conversations")},re=()=>{g(!1),n("/conversations")},W=r.useCallback(s=>{j(s),g(!1),n(`/conversations/${s.id}`)},[j,n]),ae=async s=>{if(!(!s.providerId||!s.title.trim()||S!=="idle")){y("starting-session"),I(null);try{const l=await Z.mutateAsync({prompt:s.title.trim(),providerId:s.providerId,attachmentIds:s.attachmentIds});f(s.providerId),g(!1),n(`/conversations/${l.id}`)}catch(l){I(l instanceof Error?l.message:t("Failed to start. Please try again."))}finally{y("idle")}}},L=async s=>{!i||!s.message.trim()||G.isPending||await G.mutateAsync({id:i.id,message:s.message,providerId:s.providerId||h||void 0,attachmentIds:s.attachmentIds})},P=async()=>{!i||!ie(i.status)||T.isPending||await T.mutateAsync(i.id)},K=async s=>{window.confirm(t("Delete this conversation?"))&&(await ee.mutateAsync(s),ue(s),a===s&&(g(!1),n("/conversations")))};return e.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground",children:[e.jsxs("header",{className:"flex h-12 shrink-0 items-center justify-between bg-sidebar px-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(We,{}),e.jsx(Je,{}),e.jsx("span",{className:"mx-1.5 select-none text-muted-foreground/40",children:"/"}),e.jsx("span",{className:"truncate text-sm font-medium text-foreground/90",children:t("Conversation")})]}),e.jsx("button",{type:"button",onClick:()=>Me.getState().openSettings(),className:"rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground",title:t("Settings"),children:e.jsx(Pe,{size:16})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("aside",{className:k("h-full w-full shrink-0 flex-col bg-sidebar md:flex md:w-[320px]",te?"hidden md:flex":"flex"),children:[e.jsxs("div",{className:"shrink-0 px-2 pb-1 pt-2",children:[e.jsxs("button",{type:"button",onClick:ne,className:k("flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm transition-colors",p?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50"),title:t("New Conversation"),children:[e.jsx(Ye,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("New Conversation")})]}),e.jsxs("button",{type:"button",onClick:()=>n("/"),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Tasks"),children:[e.jsx(nt,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Tasks")})]}),e.jsxs("button",{type:"button",onClick:()=>R(!0),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Search"),children:[e.jsx(ye,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Search")})]})]}),e.jsx("div",{className:"relative min-h-0 flex-1 overflow-y-auto scrollbar-app-thin pb-4 pt-3",children:Y?e.jsx("div",{className:"px-4 py-4 text-sm text-muted-foreground",children:t("Loading...")}):C.length===0?e.jsxs("div",{className:"flex h-full select-none flex-col items-center justify-center px-6 text-center",children:[e.jsx(me,{size:36,className:"mb-3 text-muted-foreground/40",strokeWidth:1.5}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:t("No conversations")}),e.jsx("button",{type:"button",onClick:ne,className:"rounded-md bg-brand px-3.5 py-1.5 text-xs font-medium text-brand-foreground transition-colors hover:bg-brand/90",children:t("New Conversation")})]}):e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex w-full items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"flex-1 text-left",children:t("History")}),e.jsx("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/50",children:C.length})]}),e.jsx("div",{className:"mt-0.5 flex min-h-[40px] flex-col rounded-md",children:C.map(s=>e.jsx(gt,{conversation:s,selected:s.id===a,disabled:ee.isPending,unread:s.id!==a&&E(s),onSelect:()=>W(s),onDelete:()=>K(s.id)},s.id))})]})}),e.jsx("div",{className:"flex items-center justify-between border-t border-border/60 px-4 py-3 text-xs text-muted-foreground/70",children:e.jsxs("span",{children:[t("Conversations")," · ",C.length]})})]}),e.jsxs("main",{className:k("min-w-0 flex-1 flex-col bg-background md:mb-2 md:mr-2 md:overflow-hidden md:rounded-xl md:border md:border-border/50",te?"flex":"hidden md:flex"),children:[e.jsx("header",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border/60 px-4 md:px-5",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[F||p?e.jsx("button",{type:"button",className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground md:hidden",onClick:re,title:t("Back"),children:e.jsx(et,{size:17})}):null,e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold",children:i?.title??t("New Conversation")}),i?e.jsxs("div",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[ht(i.status,t),i.directoryName?` · ${i.directoryName}`:""]}):null]})]})}),!i&&F?e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-4 text-sm text-muted-foreground",children:t(X?"Loading...":"Conversation not found")}):i?e.jsx(at,{sessionId:i.sessionId,sessionStatus:i.status,agentType:i.agentType,providerId:h||i.providerId,providers:z,initialTokenUsage:i.tokenUsage,onProviderChange:f,onSend:L,onStop:P,onExit:de,isSending:G.isPending,isStopping:T.isPending,canStop:ie(i.status)}):e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-4 pb-[10vh] md:px-8",children:e.jsxs("div",{className:"w-full max-w-2xl animate-[fadeInUp_0.5s_cubic-bezier(0.16,1,0.3,1)]",children:[e.jsx("h1",{className:"mb-8 max-w-full break-words text-center text-3xl leading-tight tracking-tight text-foreground",children:t("New Conversation")}),e.jsx(Xe,{variant:"conversation",projects:[],providers:H,isProvidersLoading:$,defaultProviderId:h,createStep:S,placeholder:"Ask a question...",submitLabel:"Start",pendingLabel:"Starting...",submitTitle:"Start",onSubmit:async({title:s,providerId:l,attachmentIds:d})=>{await ae({title:s,providerId:l,attachmentIds:d})}}),N?e.jsx("div",{className:"mt-3 rounded-lg border border-destructive/15 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:N}):null]})})]})]}),e.jsx(bt,{isOpen:B,conversations:C,onClose:()=>R(!1),onSelectConversation:W})]})}export{Pt as ConversationPage};
|
|
3
|
+
`);q(""),re(),d(),z(null);try{await y({message:U,providerId:A||void 0,attachmentIds:v}),await j(),requestAnimationFrame(()=>V("smooth"))}catch(M){z(M instanceof Error?M.message:o("Send failed. Please try again.")),q(U)}finally{L.current=!1}},[u,T,p,P,W,ae,re,d,y,A,j,V,o]),we=r.useCallback(async()=>{!s||g||await N()},[s,g,N]),Ce=r.useCallback(c=>{const v=c.target.files;v&&v.length>0&&E(Array.from(v)),c.target.value=""},[E]),ke=r.useCallback(c=>{const v=c.clipboardData.items,U=[];for(const M of v)if(M.kind==="file"){const xe=M.getAsFile();xe&&U.push(xe)}U.length>0&&(c.preventDefault(),E(U))},[E]),Se=r.useCallback(c=>{c.preventDefault(),_(!0)},[]),Ie=r.useCallback(c=>{c.preventDefault(),_(!1)},[]),De=r.useCallback(c=>{c.preventDefault(),_(!1);const v=c.dataTransfer.files;v.length>0&&E(Array.from(v))},[E]);return e.jsxs("div",{className:k("relative flex min-h-0 flex-1 flex-col bg-background",R),children:[e.jsxs("div",{className:"relative min-h-0 flex-1",children:[e.jsx("div",{ref:ee,className:"h-full overflow-y-auto scrollbar-app-thin px-6 pb-4 pt-6",children:e.jsx("div",{ref:i,className:"mx-auto w-full min-w-0 max-w-4xl",children:te?e.jsxs("div",{className:"flex items-center justify-center gap-3 py-12 text-muted-foreground/70",children:[e.jsxs("svg",{className:"h-5 w-5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.jsx("span",{className:"text-sm",children:o("Loading logs...")})]}):D.length===0?e.jsx("div",{className:"py-8 text-center text-muted-foreground/70",children:o(K?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx(Re,{logs:D})})}),!O&&e.jsxs("button",{type:"button",onClick:()=>V(),className:"absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-background/90 px-3 py-1.5 text-xs text-muted-foreground shadow-md backdrop-blur-sm transition-all hover:bg-background hover:text-foreground","aria-label":o("Scroll to bottom"),children:[e.jsx(_e,{size:14}),e.jsx("span",{children:o("Back to bottom")})]})]}),H.length>0&&e.jsx("div",{className:"shrink-0 border-t border-border/60 bg-background px-6 pb-1 pt-2",children:e.jsx("div",{className:"mx-auto max-w-4xl",children:e.jsx(Oe,{todos:H})})}),e.jsx("div",{className:"z-10 w-full shrink-0 border-t border-transparent bg-background p-6 pb-6 pt-2",onDragOver:Se,onDragLeave:Ie,onDrop:De,children:e.jsxs("div",{className:"mx-auto max-w-4xl",children:[X?e.jsx("div",{className:"mb-2 text-sm text-destructive",children:X}):null,e.jsxs("div",{ref:G,className:k("relative rounded-xl border bg-background transition-colors duration-200 hover:border-ring/40 focus-within:border-ring/60",Y?"border-info bg-info/5":"border-border"),children:[e.jsx($e,{files:se,onRemove:ne}),e.jsx("textarea",{ref:$,value:u,onChange:b,onPaste:ke,onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&!c.repeat&&!c.nativeEvent.isComposing&&c.nativeEvent.keyCode!==229&&(c.preventDefault(),fe())},rows:1,placeholder:o(Y?"Drop files here...":t&&!K?"Continue conversation...":"Message Agent..."),className:"w-full resize-none border-none bg-transparent px-4 pb-2 pt-4 text-sm leading-relaxed text-foreground placeholder-muted-foreground/70 focus:outline-none",style:{minHeight:"60px",maxHeight:"300px"}}),e.jsx("input",{ref:Z,type:"file",multiple:!0,className:"hidden",onChange:Ce}),e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2 pt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("button",{type:"button",onClick:()=>Z.current?.click(),disabled:P,className:"rounded-lg p-2 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",title:o("Upload file"),children:e.jsx(Fe,{size:18})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{providers:h,currentProviderId:A,agentType:a,onSelect:l}),e.jsx(Ve,{usage:ue}),s&&K&&!u.trim()&&!T?e.jsx("button",{type:"button",onClick:we,disabled:g,className:"rounded-lg bg-destructive p-2 text-white transition-all duration-200 hover:bg-destructive/90 disabled:opacity-50",title:o("Stop"),children:e.jsx(Ke,{size:14})}):e.jsx("button",{type:"button",onClick:fe,disabled:!u.trim()&&!T||P||p,className:k("rounded-lg p-2 transition-all duration-200",(u.trim()||T)&&!P&&!p?"bg-primary text-primary-foreground hover:bg-primary/90":"cursor-not-allowed bg-transparent text-muted-foreground/50"),title:o("Send"),children:e.jsx(He,{size:18})})]})]})]})]})})]})}function ot(t=50){return ve({queryKey:x.conversations.list({limit:t}),queryFn:()=>Q.get("/conversations",{params:{limit:String(t)}})})}function it(t){return ve({queryKey:x.conversations.detail(t??""),queryFn:()=>Q.get(`/conversations/${t}`),enabled:!!t})}function lt(){const t=J();return ce({mutationFn:n=>Q.post("/conversations",n),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function ct(){const t=J();return ce({mutationFn:({id:n,...a})=>Q.post(`/conversations/${n}/message`,a),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function dt(){const t=J();return ce({mutationFn:n=>Q.post(`/conversations/${n}/stop`),onSuccess:n=>{t.setQueryData(x.conversations.detail(n.id),n),t.invalidateQueries({queryKey:x.conversations.all}),t.invalidateQueries({queryKey:x.sessions.detail(n.sessionId)})}})}function ut(){const t=J();return ce({mutationFn:n=>Q.delete(`/conversations/${n}`),onSuccess:(n,a)=>{t.removeQueries({queryKey:x.conversations.detail(a)}),t.invalidateQueries({queryKey:x.conversations.all})}})}const mt=3e4,Ne="agent-tower:conversation-read-times";function ft(){try{const t=window.localStorage.getItem(Ne);if(!t)return{};const n=JSON.parse(t);return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).map(([a,m])=>[a,typeof m=="number"?m:Number(m)]).filter(a=>Number.isFinite(a[1])))}catch{return{}}}function pe(t){try{window.localStorage.setItem(Ne,JSON.stringify(t))}catch{}}function ge(t){const n=t.lastActiveAt??t.updatedAt??t.createdAt;if(!n)return 0;const a=new Date(n).getTime();return Number.isFinite(a)?a:0}function xt(t=mt){const[,n]=r.useState(0);r.useEffect(()=>{const a=setInterval(()=>n(m=>m+1),t);return()=>clearInterval(a)},[t])}function ie(t){return t===w.RUNNING||t===w.PENDING}function je(t){if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const a=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));return a<60?oe("{count}s ago",{count:a}):a<3600?oe("{count}m ago",{count:Math.floor(a/60)}):a<86400?oe("{count}h ago",{count:Math.floor(a/3600)}):oe("{count}d ago",{count:Math.floor(a/86400)})}function ht(t,n){switch(t){case w.RUNNING:return n("Running");case w.PENDING:return n("Starting");case w.COMPLETED:return n("Completed");case w.FAILED:return n("Failed");case w.CANCELLED:return n("Stopped");default:return t}}function be({className:t,pulseClassName:n}){return e.jsxs("span",{className:"relative inline-flex h-2 w-2",children:[e.jsx("span",{className:k("absolute inline-flex h-full w-full animate-ping rounded-full",n)}),e.jsx("span",{className:k("relative inline-flex h-2 w-2 rounded-full",t)})]})}function pt({status:t,unread:n}){return ie(t)?e.jsx(be,{className:"bg-success",pulseClassName:"bg-success/70"}):n?e.jsx(be,{className:"bg-warning",pulseClassName:"bg-warning/70"}):null}function gt({conversation:t,selected:n,onSelect:a,onDelete:m,disabled:h,unread:f}){const{t:S}=le(),y=je(t.lastActiveAt??t.createdAt),N=ie(t.status)||f;return e.jsxs("div",{className:k("group ml-4 mr-2 flex items-center rounded-md transition-colors",n?"bg-accent":"hover:bg-accent/50"),children:[e.jsxs("button",{type:"button",onClick:a,title:t.title,className:"flex min-w-0 flex-1 animate-task-enter items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",children:[e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(me,{size:14,className:"text-muted-foreground"})}),e.jsx("span",{className:k("min-w-0 flex-1 truncate",n?"font-medium text-foreground":"text-foreground/90"),children:t.title}),N?e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(pt,{status:t.status,unread:f})}):e.jsx("span",{className:"flex w-14 shrink-0 items-center justify-end text-[11px] tabular-nums text-muted-foreground/50",children:e.jsx("span",{className:"truncate group-hover:hidden",children:y})})]}),e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),m()},disabled:h,className:"mr-1 hidden shrink-0 rounded-md p-1.5 text-muted-foreground hover:bg-background hover:text-destructive disabled:opacity-50 group-hover:flex",title:S("Delete"),children:e.jsx(tt,{size:14})})]})}function bt({isOpen:t,conversations:n,onClose:a,onSelectConversation:m}){const{t:h}=le(),[f,S]=r.useState(""),[y,N]=r.useState(0),I=r.useRef(null);r.useEffect(()=>{t&&(S(""),N(0))},[t]);const p=r.useMemo(()=>{const o=f.trim().toLowerCase();return o?n.filter(u=>u.title.toLowerCase().includes(o)).slice(0,50):n.slice(0,12)},[n,f]);r.useEffect(()=>{N(0)},[f]),r.useEffect(()=>{I.current?.children[y]?.scrollIntoView({block:"nearest"})},[y]);const g=r.useCallback(o=>{m(o),a()},[a,m]),B=r.useCallback(o=>{if(o.key==="Escape"){o.preventDefault(),a();return}if(o.key==="ArrowDown"){o.preventDefault(),N(u=>Math.min(u+1,p.length-1));return}if(o.key==="ArrowUp"){o.preventDefault(),N(u=>Math.max(u-1,0));return}if(o.key==="Enter"&&!o.nativeEvent.isComposing){o.preventDefault();const u=p[y];u&&g(u)}},[y,g,a,p]);if(!t)return null;const R=f.trim().length>0;return e.jsxs("div",{className:"fixed inset-0 z-90",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20",onClick:a}),e.jsxs("div",{className:"absolute left-1/2 top-[18vh] w-[min(560px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-border bg-popover shadow-lg animate-in fade-in zoom-in-95 duration-100",children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(ye,{size:15,className:"shrink-0 text-muted-foreground/70"}),e.jsx("input",{value:f,onChange:o=>S(o.target.value),onKeyDown:B,placeholder:h("Search conversations..."),"aria-label":h("Search conversations..."),autoFocus:!0,className:"flex-1 border-none bg-transparent py-3 text-sm text-foreground placeholder-muted-foreground/60 focus:outline-none"})]}),p.length>0?e.jsxs(e.Fragment,{children:[R?null:e.jsx("div",{className:"px-4 pb-1 pt-2.5 text-[11px] font-medium text-muted-foreground/70",children:h("Recent conversations")}),e.jsx("div",{ref:I,className:"max-h-[46vh] overflow-y-auto pb-1.5 pt-0.5 scrollbar-app-thin",children:p.map((o,u)=>e.jsxs("button",{type:"button",onClick:()=>g(o),onMouseEnter:()=>N(u),className:k("flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors",u===y&&"bg-accent"),children:[e.jsx(me,{size:14,className:"shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground/90",title:o.title,children:o.title}),e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground/60",children:je(o.lastActiveAt??o.createdAt)})]},o.id))})]}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground/70",children:h("No matching conversations")})]})]})}function Mt(){const{t}=le();xt();const n=Ae(),{conversationId:a}=Le(),m=J(),[h,f]=r.useState(""),[S,y]=r.useState("idle"),[N,I]=r.useState(null),[p,g]=r.useState(!1),[B,R]=r.useState(!1),[o,u]=r.useState(ft),[q,A]=r.useState(()=>new Set),{data:C=[],isLoading:Y}=ot(),{data:_,isLoading:X}=it(a),{data:z=[],isLoading:$}=Ze(),Z=lt(),G=ct(),L=dt(),ee=ut(),i=_??C.find(s=>s.id===a)??null,O=r.useMemo(()=>z.filter(({availability:s})=>s.type!=="NOT_FOUND"),[z]),V=O.map(({provider:s})=>({id:s.id,name:s.name,available:!0})),F=!!a,te=F||p,D=r.useCallback(s=>{m.invalidateQueries({queryKey:x.conversations.all}),s&&m.invalidateQueries({queryKey:x.conversations.detail(s)})},[m]),de=r.useCallback(()=>{D(a)},[a,D]),j=r.useCallback(s=>{if(A(d=>{if(!d.has(s.id))return d;const b=new Set(d);return b.delete(s.id),b}),s.status!==w.COMPLETED)return;const l=Math.max(Date.now(),ge(s));u(d=>{if(d[s.id]&&d[s.id]>=l)return d;const b={...d,[s.id]:l};return pe(b),b})},[]),H=r.useCallback(s=>{A(l=>{if(l.has(s))return l;const d=new Set(l);return d.add(s),d})},[]),ue=r.useCallback(s=>{A(l=>{if(!l.has(s))return l;const d=new Set(l);return d.delete(s),d}),u(l=>{if(!(s in l))return l;const d={...l};return delete d[s],pe(d),d})},[]),se=r.useMemo(()=>{const s=new Map;for(const l of C)s.set(l.sessionId,l);return i&&s.set(i.sessionId,i),s},[i,C]),E=r.useCallback(s=>s.status!==w.COMPLETED?!1:q.has(s.id)?!0:ge(s)>(o[s.id]??0),[o,q]);r.useEffect(()=>{!h&&O.length>0&&f(O[0].provider.id)},[O,h]),r.useEffect(()=>{i?.providerId&&f(i.providerId)},[i?.providerId]),r.useEffect(()=>{a&&g(!1)},[a]),r.useEffect(()=>{i&&j(i)},[i,j]),r.useEffect(()=>{const s=Te.connect(),l=d=>{const b=se.get(d.sessionId);if(b){if(D(b.id),d.status!==w.COMPLETED){j(b);return}if(b.id===a){j(b);return}H(b.id)}};return s.on(he.SESSION_COMPLETED,l),()=>{s.off(he.SESSION_COMPLETED,l)}},[a,se,D,j,H]);const ne=()=>{I(null),g(!0),n("/conversations")},re=()=>{g(!1),n("/conversations")},W=r.useCallback(s=>{j(s),g(!1),n(`/conversations/${s.id}`)},[j,n]),ae=async s=>{if(!(!s.providerId||!s.title.trim()||S!=="idle")){y("starting-session"),I(null);try{const l=await Z.mutateAsync({prompt:s.title.trim(),providerId:s.providerId,attachmentIds:s.attachmentIds});f(s.providerId),g(!1),n(`/conversations/${l.id}`)}catch(l){I(l instanceof Error?l.message:t("Failed to start. Please try again."))}finally{y("idle")}}},T=async s=>{!i||!s.message.trim()||G.isPending||await G.mutateAsync({id:i.id,message:s.message,providerId:s.providerId||h||void 0,attachmentIds:s.attachmentIds})},P=async()=>{!i||!ie(i.status)||L.isPending||await L.mutateAsync(i.id)},K=async s=>{window.confirm(t("Delete this conversation?"))&&(await ee.mutateAsync(s),ue(s),a===s&&(g(!1),n("/conversations")))};return e.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground",children:[e.jsxs("header",{className:"flex h-12 shrink-0 items-center justify-between bg-sidebar px-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(We,{}),e.jsx(Je,{}),e.jsx("span",{className:"mx-1.5 select-none text-muted-foreground/40",children:"/"}),e.jsx("span",{className:"truncate text-sm font-medium text-foreground/90",children:t("Conversation")})]}),e.jsx("button",{type:"button",onClick:()=>Me.getState().openSettings(),className:"rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground",title:t("Settings"),children:e.jsx(Pe,{size:16})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("aside",{className:k("h-full w-full shrink-0 flex-col bg-sidebar md:flex md:w-[320px]",te?"hidden md:flex":"flex"),children:[e.jsxs("div",{className:"shrink-0 px-2 pb-1 pt-2",children:[e.jsxs("button",{type:"button",onClick:ne,className:k("flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm transition-colors",p?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50"),title:t("New Conversation"),children:[e.jsx(Ye,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("New Conversation")})]}),e.jsxs("button",{type:"button",onClick:()=>n("/"),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Tasks"),children:[e.jsx(nt,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Tasks")})]}),e.jsxs("button",{type:"button",onClick:()=>R(!0),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Search"),children:[e.jsx(ye,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Search")})]})]}),e.jsx("div",{className:"relative min-h-0 flex-1 overflow-y-auto scrollbar-app-thin pb-4 pt-3",children:Y?e.jsx("div",{className:"px-4 py-4 text-sm text-muted-foreground",children:t("Loading...")}):C.length===0?e.jsxs("div",{className:"flex h-full select-none flex-col items-center justify-center px-6 text-center",children:[e.jsx(me,{size:36,className:"mb-3 text-muted-foreground/40",strokeWidth:1.5}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:t("No conversations")}),e.jsx("button",{type:"button",onClick:ne,className:"rounded-md bg-brand px-3.5 py-1.5 text-xs font-medium text-brand-foreground transition-colors hover:bg-brand/90",children:t("New Conversation")})]}):e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex w-full items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"flex-1 text-left",children:t("History")}),e.jsx("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/50",children:C.length})]}),e.jsx("div",{className:"mt-0.5 flex min-h-[40px] flex-col rounded-md",children:C.map(s=>e.jsx(gt,{conversation:s,selected:s.id===a,disabled:ee.isPending,unread:s.id!==a&&E(s),onSelect:()=>W(s),onDelete:()=>K(s.id)},s.id))})]})}),e.jsx("div",{className:"flex items-center justify-between border-t border-border/60 px-4 py-3 text-xs text-muted-foreground/70",children:e.jsxs("span",{children:[t("Conversations")," · ",C.length]})})]}),e.jsxs("main",{className:k("min-w-0 flex-1 flex-col bg-background md:mb-2 md:mr-2 md:overflow-hidden md:rounded-xl md:border md:border-border/50",te?"flex":"hidden md:flex"),children:[e.jsx("header",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border/60 px-4 md:px-5",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[F||p?e.jsx("button",{type:"button",className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground md:hidden",onClick:re,title:t("Back"),children:e.jsx(et,{size:17})}):null,e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold",children:i?.title??t("New Conversation")}),i?e.jsxs("div",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[ht(i.status,t),i.directoryName?` · ${i.directoryName}`:""]}):null]})]})}),!i&&F?e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-4 text-sm text-muted-foreground",children:t(X?"Loading...":"Conversation not found")}):i?e.jsx(at,{sessionId:i.sessionId,sessionStatus:i.status,agentType:i.agentType,providerId:h||i.providerId,providers:z,initialTokenUsage:i.tokenUsage,onProviderChange:f,onSend:T,onStop:P,onExit:de,isSending:G.isPending,isStopping:L.isPending,canStop:ie(i.status)}):e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-4 pb-[10vh] md:px-8",children:e.jsxs("div",{className:"w-full max-w-2xl animate-[fadeInUp_0.5s_cubic-bezier(0.16,1,0.3,1)]",children:[e.jsx("h1",{className:"mb-8 max-w-full break-words text-center text-3xl leading-tight tracking-tight text-foreground",children:t("需要我帮你做点什么?")}),e.jsx(Xe,{variant:"conversation",projects:[],providers:V,isProvidersLoading:$,defaultProviderId:h,createStep:S,placeholder:"Ask a question...",submitLabel:"Start",pendingLabel:"Starting...",submitTitle:"Start",onSubmit:async({title:s,providerId:l,attachmentIds:d})=>{await ae({title:s,providerId:l,attachmentIds:d})}}),N?e.jsx("div",{className:"mt-3 rounded-lg border border-destructive/15 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:N}):null]})})]})]}),e.jsx(bt,{isOpen:B,conversations:C,onClose:()=>R(!1),onSelectConversation:W})]})}export{Mt as ConversationPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h as P,j as e,u as oe,r,$ as ke,X as Me,i as $e,m as Be,s as Ue,v as We,M as we,g as j,a0 as qe,a1 as Ke}from"./index-OY1TIdAK.js";import{W as F}from"./mermaid-NOHMQCX5-CeIvIbfU.js";import{A as Q}from"./AgentLogo-DQId6FqS.js";import{C as ee}from"./chevron-down-DuZqUX3d.js";import{C as G}from"./check-C7Na6M49.js";import{L as te}from"./loader-circle-DDrZegLO.js";import{M as Te}from"./MemberAvatar-Bvlu6rk3.js";import{u as He}from"./use-providers-CWfLQ--R.js";import{P as Ye}from"./trash-2-z7TLHqpU.js";import{P as Ge}from"./useNormalizedLogs-DW37m6Ji.js";import{F as Ve}from"./folder-B35uD7uF.js";const Xe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Bt=P("arrow-down",Xe);const Ze=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Je=P("arrow-up",Ze);const Qe=[["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"}]],et=P("file-text",Qe);const tt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],st=P("gauge",tt);const rt=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],nt=P("git-branch",rt);const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ot=P("image",at);const it=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ut=P("search",it);const lt=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ct=P("shield",lt);const dt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Wt=P("square-pen",dt);const ut=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],mt=P("zap",ut);function ft({content:s,children:o,className:i="",side:c="top"}){const g=c==="bottom"?"top-full mt-2":"bottom-full mb-2",v=c==="bottom"?"bottom-full border-b-neutral-900":"top-full border-t-neutral-900";return e.jsxs("div",{className:`group/tooltip relative ${i}`,children:[o,e.jsxs("div",{className:`absolute ${g} left-1/2 -translate-x-1/2 px-3 py-2 bg-neutral-900 text-white text-xs rounded-lg opacity-0 group-hover/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-[100] shadow-lg`,children:[s,e.jsx("div",{className:`absolute ${v} left-1/2 -translate-x-1/2 border-4 border-transparent`})]})]})}function ae(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function xt(s){return s>=.9?"text-red-500":s>=.7?"text-amber-500":"text-neutral-400"}function qt({usage:s,tooltipSide:o="top"}){const{t:i}=oe();if(!s)return null;const c=s.modelContextWindow,g=c?s.totalTokens/c:0,v=c?Math.min(Math.round(g*100),100):null,f=c?xt(g):"text-neutral-400",k=c?e.jsx("span",{children:i("上下文: {used} / {max} tokens",{used:ae(s.totalTokens),max:ae(c)})}):e.jsx("span",{children:i("已使用: {used} tokens",{used:ae(s.totalTokens)})});return e.jsx(ft,{content:k,side:o,children:e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs rounded-lg hover:bg-neutral-100 transition-colors cursor-default select-none",children:[e.jsx(st,{size:14,className:f}),e.jsxs("span",{className:`tabular-nums ${f}`,children:[ae(s.totalTokens),v!==null&&e.jsxs("span",{className:"text-neutral-300 ml-0.5",children:["/ ",v,"%"]})]})]})})}const pt={damping:.7,stiffness:.05,mass:1.25},gt=70,ht=1e3/60,bt=350;let ie=!1;globalThis.document?.addEventListener("mousedown",()=>{ie=!0});globalThis.document?.addEventListener("mouseup",()=>{ie=!1});globalThis.document?.addEventListener("click",()=>{ie=!1});const Kt=(s={})=>{const[o,i]=r.useState(!1),[c,g]=r.useState(s.initial!==!1),[v,f]=r.useState(!1),k=r.useRef(null);k.current=s;const x=r.useCallback(()=>{if(!ie)return!1;const l=window.getSelection();if(!l||!l.rangeCount)return!1;const p=l.getRangeAt(0);return p.commonAncestorContainer.contains(m.current)||m.current?.contains(p.commonAncestorContainer)},[]),b=r.useCallback(l=>{t.isAtBottom=l,g(l)},[]),h=r.useCallback(l=>{t.escapedFromLock=l,i(l)},[]),t=r.useMemo(()=>{let l;return{escapedFromLock:o,isAtBottom:c,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return m.current?.scrollTop??0},set scrollTop(p){m.current&&(m.current.scrollTop=p,t.ignoreScrollToTop=m.current.scrollTop)},get targetScrollTop(){return!m.current||!L.current?0:m.current.scrollHeight-1-m.current.clientHeight},get calculatedTargetScrollTop(){if(!m.current||!L.current)return 0;const{targetScrollTop:p}=this;if(!s.targetScrollTop)return p;if(l?.targetScrollTop===p)return l.calculatedScrollTop;const d=Math.max(Math.min(s.targetScrollTop(p,{scrollElement:m.current,contentElement:L.current}),p),0);return l={targetScrollTop:p,calculatedScrollTop:d},requestAnimationFrame(()=>{l=void 0}),d},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=gt}}},[]),N=r.useCallback((l={})=>{typeof l=="string"&&(l={animation:l}),l.preserveScrollPosition||b(!0);const p=Date.now()+(Number(l.wait)||0),d=fe(k.current,l.animation),{ignoreEscapes:M=!1}=l;let w,E=t.calculatedTargetScrollTop;l.duration instanceof Promise?l.duration.finally(()=>{w=Date.now()}):w=p+(l.duration??0);const _=async()=>{const $=new Promise(requestAnimationFrame).then(()=>{if(!t.isAtBottom)return t.animation=void 0,!1;const{scrollTop:O}=t,q=performance.now(),U=(q-(t.lastTick??q))/ht;if(t.animation||(t.animation={behavior:d,promise:$,ignoreEscapes:M}),t.animation.behavior===d&&(t.lastTick=q),x()||p>Date.now())return _();if(O<Math.min(E,t.calculatedTargetScrollTop)){if(t.animation?.behavior===d){if(d==="instant")return t.scrollTop=t.calculatedTargetScrollTop,_();t.velocity=(d.damping*t.velocity+d.stiffness*t.scrollDifference)/d.mass,t.accumulated+=t.velocity*U,t.scrollTop+=t.accumulated,t.scrollTop!==O&&(t.accumulated=0)}return _()}return w>Date.now()?(E=t.calculatedTargetScrollTop,_()):(t.animation=void 0,t.scrollTop<t.calculatedTargetScrollTop?N({animation:fe(k.current,k.current.resize),ignoreEscapes:M,duration:Math.max(0,w-Date.now())||void 0}):t.isAtBottom)});return $.then(O=>(requestAnimationFrame(()=>{t.animation||(t.lastTick=void 0,t.velocity=0)}),O))};return l.wait!==!0&&(t.animation=void 0),t.animation?.behavior===d?t.animation.promise:_()},[b,x,t]),u=r.useCallback(()=>{h(!0),b(!1)},[h,b]),C=r.useCallback(({target:l})=>{if(l!==m.current)return;const{scrollTop:p,ignoreScrollToTop:d}=t;let{lastScrollTop:M=p}=t;t.lastScrollTop=p,t.ignoreScrollToTop=void 0,d&&d>p&&(M=d),f(t.isNearBottom),setTimeout(()=>{if(t.resizeDifference||p===d)return;if(x()){h(!0),b(!1);return}const w=p>M,E=p<M;if(t.animation?.ignoreEscapes){t.scrollTop=M;return}E&&(h(!0),b(!1)),w&&h(!1),!t.escapedFromLock&&t.isNearBottom&&b(!0)},1)},[h,b,x,t]),S=r.useCallback(({target:l,deltaY:p})=>{let d=l;for(;!["scroll","auto"].includes(getComputedStyle(d).overflow);){if(!d.parentElement)return;d=d.parentElement}d===m.current&&p<0&&m.current.scrollHeight>m.current.clientHeight&&!t.animation?.ignoreEscapes&&(h(!0),b(!1))},[h,b,t]),m=Ce(l=>{m.current?.removeEventListener("scroll",C),m.current?.removeEventListener("wheel",S),l?.addEventListener("scroll",C,{passive:!0}),l?.addEventListener("wheel",S,{passive:!0})},[]),L=Ce(l=>{if(t.resizeObserver?.disconnect(),!l)return;let p;t.resizeObserver=new ResizeObserver(([d])=>{const{height:M}=d.contentRect,w=M-(p??M);if(t.resizeDifference=w,t.scrollTop>t.targetScrollTop&&(t.scrollTop=t.targetScrollTop),f(t.isNearBottom),w>=0){const E=fe(k.current,p?k.current.resize:k.current.initial);N({animation:E,wait:!0,preserveScrollPosition:!0,duration:E==="instant"?void 0:bt})}else t.isNearBottom&&(h(!1),b(!0));p=M,requestAnimationFrame(()=>{setTimeout(()=>{t.resizeDifference===w&&(t.resizeDifference=0)},1)})}),t.resizeObserver?.observe(l)},[]);return{contentRef:L,scrollRef:m,scrollToBottom:N,stopScroll:u,isAtBottom:c||v,isNearBottom:v,escapedFromLock:o,state:t}};function Ce(s,o){const i=r.useCallback(c=>(i.current=c,s(c)),o);return i}const me=new Map;function fe(...s){const o={...pt};let i=!1;for(const g of s){if(g==="instant"){i=!0;continue}typeof g=="object"&&(i=!1,o.damping=g.damping??o.damping,o.stiffness=g.stiffness??o.stiffness,o.mass=g.mass??o.mass)}const c=JSON.stringify(o);return me.has(c)||me.set(c,Object.freeze(o)),i?"instant":me.get(c)}function Ht({providers:s,currentProviderId:o,agentType:i,onSelect:c}){const{t:g}=oe(),[v,f]=r.useState(!1),k=r.useRef(null),x=s.filter(h=>String(h.provider.agentType)===i),b=s.find(h=>h.provider.id===o);return r.useEffect(()=>{function h(t){k.current&&!k.current.contains(t.target)&&f(!1)}if(v)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[v]),x.length<=1?e.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral-400 px-2 py-1.5 select-none cursor-default",children:[e.jsx(Q,{agentType:b?.provider.agentType??i,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:b?.provider.name?ke(b.provider.name,12):i})]}):e.jsxs("div",{className:"relative",ref:k,children:[e.jsxs("button",{onClick:()=>f(!v),className:"flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg transition-colors cursor-pointer hover:bg-neutral-100 text-neutral-400 hover:text-neutral-600",title:`Provider: ${b?.provider.name??i} (click to change)`,children:[e.jsx(Q,{agentType:b?.provider.agentType??i,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:b?.provider.name?ke(b.provider.name,12):i}),e.jsx(ee,{size:12,className:`shrink-0 transition-transform ${v?"rotate-180":""}`})]}),v&&e.jsxs("div",{className:"absolute bottom-full right-0 mb-1 bg-white rounded-lg border border-neutral-200 shadow-lg py-1 min-w-[160px] z-50",children:[e.jsx("div",{className:"px-2 py-1 text-xs text-neutral-400 border-b border-neutral-100",children:g("切换渠道")}),x.map(h=>e.jsxs("button",{onClick:()=>{c(h.provider.id),f(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-neutral-50 transition-colors ${h.provider.id===o?"bg-blue-50 text-blue-600":"text-neutral-700"}`,children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Q,{agentType:h.provider.agentType,className:"size-4"}),e.jsx("span",{className:"truncate max-w-[120px]",children:h.provider.name}),h.provider.isDefault&&e.jsx("span",{className:"text-xs text-neutral-400",children:g("(默认)")})]}),h.provider.id===o&&e.jsx(G,{size:14,className:"shrink-0"})]},h.provider.id))]})]})}const vt="/api";function jt(s){return s<1024?`${s}B`:s<1024*1024?`${(s/1024).toFixed(1)}KB`:`${(s/(1024*1024)).toFixed(1)}MB`}function Nt({files:s,onRemove:o}){return s.length===0?null:e.jsx("div",{"aria-label":"Attachments",className:"flex flex-wrap gap-2 px-4 pt-3 pb-1",children:s.map(i=>e.jsx(yt,{item:i,onRemove:o},i.tempId))})}function yt({item:s,onRemove:o}){const i=s.file.type.startsWith("image/"),c=s.status==="error",g=s.status==="uploading";return e.jsxs("div",{className:`relative group flex items-center gap-2 px-3 py-2 rounded-lg border text-xs max-w-[200px] ${c?"border-red-200 bg-red-50 text-red-600":"border-neutral-200 bg-neutral-50 text-neutral-700"}`,children:[i&&s.status==="done"&&s.attachment?e.jsx("img",{src:`${vt}${s.attachment.url}`,alt:s.file.name,className:"w-8 h-8 rounded object-cover flex-shrink-0"}):e.jsx("span",{className:"flex-shrink-0",children:g?e.jsx(te,{size:16,className:"animate-spin text-neutral-400"}):i?e.jsx(ot,{size:16,className:"text-neutral-400"}):e.jsx(et,{size:16,className:"text-neutral-400"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-medium",children:s.file.name}),c?e.jsx("div",{className:"truncate text-red-500",children:s.error}):e.jsx("div",{className:"text-neutral-400",children:jt(s.file.size)})]}),e.jsx("button",{onClick:()=>o(s.tempId),className:"absolute -top-1.5 -right-1.5 hidden group-hover:flex items-center justify-center w-5 h-5 rounded-full bg-neutral-700 text-white hover:bg-neutral-900 transition-colors",children:e.jsx(Me,{size:10})})]})}const kt="/api";async function wt(s){const o=new FormData;o.append("file",s);const i=await fetch(`${kt}/attachments/upload`,{method:"POST",body:o});if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c.error||`Upload failed (${i.status})`)}return i.json()}let Tt=0;function Ct(){const[s,o]=r.useState([]),i=r.useRef(s);i.current=s;const c=r.useCallback(async t=>{const N=t.map(u=>({tempId:`tmp-${++Tt}`,file:u,progress:0,status:"uploading"}));o(u=>[...u,...N]),await Promise.allSettled(N.map(async u=>{try{const C=await wt(u.file);o(S=>S.map(m=>m.tempId===u.tempId?{...m,status:"done",progress:100,attachment:C}:m))}catch(C){o(S=>S.map(m=>m.tempId===u.tempId?{...m,status:"error",error:C instanceof Error?C.message:"Upload failed"}:m))}}))},[]),g=r.useCallback(()=>i.current.filter(t=>t.status==="done"&&t.attachment).map(t=>t.attachment),[]),v=r.useCallback(t=>{o(N=>N.filter(u=>u.tempId!==t))},[]),f=r.useCallback(()=>{o([])},[]),k=r.useCallback(t=>{t.length!==0&&o(N=>{const u=new Set(N.map(S=>S.attachment?.id??S.tempId)),C=t.filter(S=>{const m=S.attachment?.id??S.tempId;return u.has(m)?!1:(u.add(m),!0)});return C.length>0?[...N,...C]:N})},[]),x=r.useCallback(()=>{const t=g();return t.length===0?"":t.map(N=>`${N.mimeType.startsWith("image/")?"!":""}[${N.originalName}](${N.storagePath})`).join(`
|
|
2
|
+
`)},[g]),b=s.length>0,h=s.some(t=>t.status==="uploading");return{files:s,addFiles:c,removeFile:v,clear:f,restoreFiles:k,buildMarkdownLinks:x,getDoneAttachments:g,hasFiles:b,isUploading:h}}function Yt(s){const o=r.useMemo(()=>Array.from(new Set(s.filter(Boolean))),[s]);return $e({queryKey:["attachments","metadata",o],queryFn:()=>Be.get("/attachments/metadata",{params:{ids:o.join(",")}}),enabled:o.length>0,staleTime:300*1e3})}function Gt(s,o){return r.useMemo(()=>{for(let i=s.length-1;i>=0;i--){const c=s[i];if(c.tokenUsage&&typeof c.tokenUsage.totalTokens=="number"&&c.tokenUsage.totalTokens>0)return{totalTokens:c.tokenUsage.totalTokens,modelContextWindow:c.tokenUsage.modelContextWindow}}return o??null},[s,o])}function Se(s,o,i,c){if(i.filter(f=>f===c).length<=1)return s;const v=i.slice(0,o+1).filter(f=>f===c).length;return`${s} #${v}`}function St(s){return Object.values(s).filter(Boolean).length}function Mt({mode:s,setMode:o,selectedTemplateId:i,setSelectedTemplateId:c,selectedMemberPresetIds:g,setSelectedMemberPresetIds:v,disabled:f=!1,compact:k=!1}){const{t:x}=oe(),[b,h]=r.useState(!1),{data:t}=He(),{data:N,isError:u,isFetching:C,isLoading:S,refetch:m}=Ue(),{data:L,isError:l,isFetching:p,isLoading:d,refetch:M}=We(),w=r.useMemo(()=>new Map((t??[]).map(({provider:a,availability:y})=>[a.id,a.name+(y.type==="NOT_FOUND"?x(" (不可用)"):"")])),[t,x]),E=r.useMemo(()=>new Map((N??[]).map(a=>[a.id,a])),[N]),_=r.useMemo(()=>new Map((L??[]).map(a=>[a.id,a])),[L]),$=r.useMemo(()=>g.map(a=>E.get(a)).filter(a=>!!a),[E,g]);r.useEffect(()=>{N!==void 0&&v(a=>{const y=a.filter(z=>E.has(z));return y.length===a.length&&y.every((z,D)=>z===a[D])?a:y})},[N,E,v]),r.useEffect(()=>{L!==void 0&&c(a=>!a||_.has(a)?a:null)},[c,_,L]);const O=a=>{f||c(y=>y===a?null:a)},q=a=>{f||v(y=>[...y,a])},U=a=>{f||v(y=>y.filter((z,D)=>D!==a))},se=e.jsxs("section",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-medium text-muted-foreground mb-1.5",children:x("团队模板")}),l?e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2.5 text-xs text-destructive",children:[e.jsx("span",{children:x("团队模板加载失败")}),e.jsx("button",{type:"button",onClick:()=>{M()},disabled:f||p,className:"ml-2 underline hover:no-underline",children:x("重试")})]}):d?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-xs text-muted-foreground",children:[e.jsx(te,{size:12,className:"animate-spin"}),x("加载中...")]}):(L??[]).length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-background px-3 py-3 text-xs text-muted-foreground",children:[x("当前没有团队模板"),e.jsx(we,{to:"/settings/team",className:"ml-1.5 text-info hover:underline",children:x("去创建")})]}):e.jsx("div",{className:j("space-y-1.5",k&&"sm:grid sm:grid-cols-2 sm:gap-1.5 sm:space-y-0"),children:(L??[]).map(a=>{const y=a.id===i,z=a.members?.length??0,D=a.members?.map(B=>B.memberPresetId)??[],W=a.members?.slice(0,3).map((B,X)=>Se(B.memberPreset?.name??B.memberPresetId,X,D,B.memberPresetId)).join(", ");return e.jsx("button",{type:"button",onClick:()=>O(a.id),disabled:f,className:j("w-full rounded-lg px-3 py-2 text-left border transition-all disabled:cursor-not-allowed disabled:opacity-60",y?"bg-background border-foreground/20 shadow-sm":"bg-background border-border/60 hover:border-border hover:bg-accent"),children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:j("text-xs truncate",y?"font-medium text-foreground":"text-foreground"),children:a.name}),e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[z,x("人")]})]}),W&&e.jsx("div",{className:"mt-0.5 text-[10px] text-muted-foreground truncate",children:W})]}),y&&e.jsx(G,{size:13,className:"shrink-0 text-foreground"})]})},a.id)})})]}),re=$.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:$.map((a,y)=>{const z=Se(a.name,y,g,a.id);return e.jsxs("div",{className:"inline-flex items-center gap-1 pl-1 pr-0.5 py-0.5 rounded-md border border-border/60 bg-background text-[10px] text-foreground",children:[e.jsx(Te,{name:a.name,avatar:a.avatar,className:"h-3.5 w-3.5 text-[7px]"}),e.jsx("span",{className:"max-w-[80px] truncate",children:z}),e.jsx("button",{type:"button",onClick:()=>U(y),disabled:f,className:"p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30 rounded transition-colors",children:e.jsx(Me,{size:9})})]},`${a.id}-${y}`)})}),V=u?e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2.5 text-xs text-destructive",children:[e.jsx("span",{children:x("成员预设加载失败")}),e.jsx("button",{type:"button",onClick:()=>{m()},disabled:f||C,className:"ml-2 underline hover:no-underline",children:x("重试")})]}):S?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-xs text-muted-foreground",children:[e.jsx(te,{size:12,className:"animate-spin"}),x("加载中...")]}):(N??[]).length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-background px-3 py-3 text-xs text-muted-foreground",children:[x("当前没有成员预设"),e.jsx(we,{to:"/settings/team",className:"ml-1.5 text-info hover:underline",children:x("去创建")})]}):e.jsx("div",{className:"space-y-1 max-h-[180px] overflow-y-auto pr-1",children:(N??[]).map(a=>{const y=g.filter(W=>W===a.id).length,z=w.get(a.providerId)??a.providerId,D=St(a.capabilities);return e.jsxs("button",{type:"button",onClick:()=>q(a.id),disabled:f,className:j("flex items-center gap-2 w-full px-2 py-1.5 rounded-lg text-left border border-transparent transition-all",f&&"cursor-not-allowed opacity-60","bg-background hover:bg-accent hover:border-border/60"),children:[e.jsx(Te,{name:a.name,avatar:a.avatar,className:"h-6 w-6 text-[9px] shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs text-foreground truncate",children:a.name}),e.jsxs("div",{className:"text-[10px] text-muted-foreground truncate",children:[z," · ",D,"/10"]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y>0&&e.jsxs("span",{className:"text-[10px] text-foreground font-semibold",children:["×",y]}),e.jsx(Ye,{size:12,className:"text-muted-foreground"})]})]},a.id)})}),K=$.length>0&&e.jsx("span",{className:"inline-flex items-center justify-center min-w-[16px] h-4 rounded-full bg-primary text-[10px] font-semibold text-primary-foreground px-1.5",children:$.length}),H=e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground shrink-0",children:x("执行模式")}),e.jsxs("div",{className:"inline-flex items-center h-7 rounded-md border border-border/70 bg-background p-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>!f&&o("AUTO"),disabled:f,className:j("flex items-center gap-1.5 rounded h-full px-2.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",s==="AUTO"?"bg-primary text-primary-foreground font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(mt,{size:11}),x("自动模式")]}),e.jsxs("button",{type:"button",onClick:()=>!f&&o("CONFIRM"),disabled:f,className:j("flex items-center gap-1.5 rounded h-full px-2.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",s==="CONFIRM"?"bg-primary text-primary-foreground font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(ct,{size:11}),x("确认模式")]})]})]});return k?e.jsxs("div",{className:"space-y-3",children:[H,se,e.jsxs("div",{className:"border-t border-border/50 pt-2.5",children:[e.jsxs("button",{type:"button",onClick:()=>!f&&h(a=>!a),disabled:f,"aria-expanded":b,className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground hover:text-foreground transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(ee,{size:12,className:j("transition-transform",b?"":"-rotate-90")}),x("追加独立成员"),K]}),b&&e.jsxs("div",{className:"mt-2",children:[re,V]})]})]}):e.jsxs("div",{className:"space-y-3.5",children:[H,e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[se,e.jsxs("section",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:x("追加成员")}),K]}),re,V]})]})]})}function Vt({className:s="h-7 w-7"}){return e.jsx("img",{src:qe,alt:"Agent Tower",className:`block shrink-0 object-contain ${s}`})}function Xt({className:s=""}){return e.jsx("span",{className:`font-semibold text-foreground tracking-tight text-base ${s}`,children:"Agent Tower"})}const Et={idle:"","creating-task":"Creating Task...","creating-teamrun":"Creating TeamRun...","creating-workspace":"Creating Workspace...","creating-session":"Creating Session...","starting-session":"Starting Agent..."};function Zt({variant:s="task",projects:o,providers:i,isProvidersLoading:c,onSubmit:g,defaultProjectId:v="",defaultProviderId:f="",onProjectChange:k,createStep:x,placeholder:b,submitLabel:h,pendingLabel:t,submitTitle:N}){const{t:u}=oe(),[C,S]=r.useState(""),[m,L]=r.useState(v),[l,p]=r.useState(f),[d,M]=r.useState("SOLO"),[w,E]=r.useState(F.WORKTREE),[_,$]=r.useState("AUTO"),[O,q]=r.useState(null),[U,se]=r.useState([]),[re,V]=r.useState(!1),[K,H]=r.useState(!1),[a,y]=r.useState(!1),[z,D]=r.useState(!1),W=r.useRef(null),B=r.useRef(null),X=r.useRef(null),Ee=r.useRef(null),xe=r.useRef(null),{files:pe,addFiles:Y,removeFile:Ae,clear:ge,buildMarkdownLinks:he,getDoneAttachments:be,isUploading:ne}=Ct(),A=s==="conversation",T=s==="task"||s==="conversation",Ie=h??u(A?"开始":"创建");r.useEffect(()=>{L(v),k?.(v)},[v,k]),r.useEffect(()=>{p(f)},[f]),r.useEffect(()=>{if(!K)return;const n=I=>{W.current&&!W.current.contains(I.target)&&H(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[K]),r.useEffect(()=>{if(!a)return;const n=I=>{B.current&&!B.current.contains(I.target)&&y(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[a]),r.useEffect(()=>{if(!z)return;const n=I=>{X.current&&!X.current.contains(I.target)&&D(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[z]);const le=r.useMemo(()=>o.find(n=>n.id===m),[o,m]),ce=r.useMemo(()=>i.find(n=>n.id===l),[i,l]),ze=w===F.MAIN_DIRECTORY?u("本地模式"):u("工作树模式"),R=x!=="idle",ve=!!O||U.length>0,Z=!R&&!ne&&C.trim().length>0&&(A?!!l:!!m&&(d==="SOLO"?!!l:ve)),de=r.useCallback(async()=>{if(!Z)return;const n=T?he():"",I=T?be().map(J=>J.id):[];try{await g({title:C.trim(),description:"",projectId:A?"":m,providerId:l,mode:A?"SOLO":d,workspaceMode:!A&&d==="SOLO"?w:F.WORKTREE,teamRunMode:A?"AUTO":_,teamTemplateId:A?null:O,memberPresetIds:A?[]:U,attachmentLinks:n,attachmentIds:I}),S(""),T&&ge()}catch{}},[Z,T,he,be,g,C,A,m,l,d,w,_,O,U,ge]),Re=r.useCallback(n=>{n.key==="Enter"&&!n.shiftKey&&!n.nativeEvent.isComposing&&n.nativeEvent.keyCode!==229&&(n.preventDefault(),de())},[de]),Le=r.useCallback(n=>{const I=n.target.files;I&&I.length>0&&Y(Array.from(I)),n.target.value=""},[Y]),_e=r.useCallback(n=>{L(n),k?.(n),H(!1)},[k]),De=r.useCallback(n=>{if(!T)return;const I=n.clipboardData.items,J=[];for(const Ne of I)if(Ne.kind==="file"){const ye=Ne.getAsFile();ye&&J.push(ye)}J.length>0&&(n.preventDefault(),Y(J))},[Y,T]),[je,ue]=r.useState(!1),Oe=r.useCallback(n=>{T&&(n.preventDefault(),ue(!0))},[T]),Fe=r.useCallback(n=>{T&&(n.preventDefault(),ue(!1))},[T]),Pe=r.useCallback(n=>{if(!T)return;n.preventDefault(),ue(!1);const I=n.dataTransfer.files;I.length>0&&Y(Array.from(I))},[Y,T]);return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:j("relative bg-background rounded-xl border transition-colors duration-200","shadow-[0_1px_2px_rgba(0,0,0,0.05)]","hover:border-ring/40 focus-within:border-ring/60",je?"border-info bg-info/5":"border-border",R&&"opacity-80"),onDragOver:T?Oe:void 0,onDragLeave:T?Fe:void 0,onDrop:T?Pe:void 0,children:[T&&pe.length>0&&e.jsx("div",{className:"px-4 pt-3",children:e.jsx(Nt,{files:pe,onRemove:Ae})}),e.jsx("textarea",{ref:Ee,value:C,onChange:n=>S(n.target.value),onKeyDown:Re,onPaste:T?De:void 0,placeholder:u(b||"Describe your task..."),disabled:R,autoFocus:!0,rows:1,className:"w-full px-4 pt-4 pb-2 bg-transparent border-none focus:outline-none resize-none text-[15px] text-foreground placeholder:text-muted-foreground/80 leading-relaxed",style:{minHeight:"76px",maxHeight:"220px",fieldSizing:"content"}}),T&&je&&e.jsx("div",{className:"px-4 pb-2",children:e.jsx("div",{className:"flex items-center justify-center py-3 border border-dashed border-info/40 rounded-lg text-xs font-medium text-info",children:u("Drop files here")})}),e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2 pt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:T?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>xe.current?.click(),disabled:R||ne,className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:u("Attach files"),children:e.jsx(Ge,{size:18})}),e.jsx("input",{ref:xe,type:"file",multiple:!0,onChange:Le,className:"hidden"})]}):null}),e.jsxs("div",{className:"flex items-center gap-2",children:[T&&ne&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(te,{size:14,className:"animate-spin"}),u("Uploading...")]}),R&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(te,{size:14,className:"animate-spin"}),u(t??Et[x])]}),!A&&!R&&!ne&&d==="TEAM"&&!ve&&C.trim().length>0&&e.jsx("span",{className:"text-[11px] text-warning",children:u("请选择团队模板或追加成员")}),Z&&e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1 text-[11px] text-muted-foreground/80 select-none",children:[e.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded border border-border bg-muted/60 text-[10px] font-medium text-muted-foreground leading-none",children:"⏎"}),Ie]}),e.jsx("button",{type:"button",onClick:de,disabled:!Z,className:j("flex items-center justify-center size-8 rounded-lg transition-all duration-200",Z?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm":"bg-muted text-muted-foreground/40 cursor-not-allowed"),title:u(N||"Create & Start"),children:e.jsx(Je,{size:16,strokeWidth:2.5})})]})]})]}),e.jsxs("div",{className:"flex items-center flex-wrap gap-1.5 mt-2.5 px-0.5",children:[!A&&e.jsxs("div",{className:"relative",ref:W,children:[e.jsxs("button",{type:"button",onClick:()=>{R||H(n=>!n)},disabled:R,className:j("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed",le?"text-foreground/80":"text-muted-foreground"),children:[e.jsx(Ve,{size:14,className:"shrink-0",style:{color:le?.color??"var(--muted-foreground)"}}),e.jsx("span",{className:"max-w-[120px] truncate",children:le?.name??u("Project")}),e.jsx(ee,{size:12,className:j("text-muted-foreground transition-transform",K&&"rotate-180")})]}),K&&e.jsx("div",{className:"absolute top-full left-0 mt-1.5 w-56 bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 max-h-[240px] overflow-y-auto z-50",children:o.map(n=>e.jsxs("button",{type:"button",onClick:()=>_e(n.id),className:"flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",children:[e.jsx("span",{className:"size-2 rounded-full shrink-0 mr-2",style:{backgroundColor:n.color??"var(--muted-foreground)"}}),e.jsx("span",{className:j("truncate flex-1",n.id===m?"text-foreground font-medium":"text-muted-foreground"),children:n.name}),e.jsx(G,{size:14,className:j("ml-2 shrink-0 text-foreground",n.id===m?"opacity-100":"opacity-0")})]},n.id))})]}),(A||d==="SOLO")&&e.jsxs("div",{className:"relative",ref:B,children:[e.jsxs("button",{type:"button",onClick:()=>{R||y(n=>!n)},disabled:R,className:j("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed",ce?"text-foreground/80":"text-muted-foreground"),children:[e.jsx(Q,{agentType:ce?.agentType,className:"size-3.5"}),e.jsx("span",{className:"max-w-[120px] truncate",children:ce?.name??u(c?"Loading...":"Agent")}),e.jsx(ee,{size:12,className:j("text-muted-foreground transition-transform",a&&"rotate-180")})]}),a&&e.jsx("div",{className:"absolute top-full left-0 mt-1.5 w-56 bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 max-h-[240px] overflow-y-auto z-50",children:i.map(n=>e.jsxs("button",{type:"button",disabled:!n.available,onClick:()=>{p(n.id),y(!1)},className:j("flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",!n.available&&"opacity-40 cursor-not-allowed"),children:[e.jsx(G,{size:14,className:j("mr-2 shrink-0 text-foreground",n.id===l?"opacity-100":"opacity-0")}),e.jsx(Q,{agentType:n.agentType,className:"mr-2 size-3.5"}),e.jsxs("span",{className:j("min-w-0 truncate",n.id===l?"text-foreground font-medium":"text-muted-foreground"),children:[n.name,n.available?"":u(" (unavailable)")]})]},n.id))})]}),!A&&d==="SOLO"&&e.jsxs("div",{className:"relative",ref:X,children:[e.jsxs("button",{type:"button",onClick:()=>{R||D(n=>!n)},disabled:R,className:j("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-foreground/80"),children:[e.jsx(nt,{size:14,className:"text-muted-foreground"}),e.jsx("span",{className:"max-w-[96px] truncate",children:ze}),e.jsx(ee,{size:12,className:j("text-muted-foreground transition-transform",z&&"rotate-180")})]}),z&&e.jsxs("div",{className:"absolute top-full left-0 mt-1.5 w-44 bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 z-50",children:[e.jsxs("button",{type:"button",onClick:()=>{E(F.WORKTREE),D(!1)},className:"flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",children:[e.jsx(G,{size:14,className:j("mr-2 shrink-0 text-foreground",w===F.WORKTREE?"opacity-100":"opacity-0")}),e.jsx("span",{className:j("truncate",w===F.WORKTREE?"text-foreground font-medium":"text-muted-foreground"),children:u("工作树模式")})]}),e.jsxs("button",{type:"button",onClick:()=>{E(F.MAIN_DIRECTORY),D(!1)},className:"flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",children:[e.jsx(G,{size:14,className:j("mr-2 shrink-0 text-foreground",w===F.MAIN_DIRECTORY?"opacity-100":"opacity-0")}),e.jsx("span",{className:j("truncate",w===F.MAIN_DIRECTORY?"text-foreground font-medium":"text-muted-foreground"),children:u("本地模式")})]})]})]}),!A&&e.jsxs("button",{type:"button",role:"switch","aria-checked":d==="TEAM",onClick:()=>{R||(d==="TEAM"?(M("SOLO"),V(!1)):(M("TEAM"),D(!1),E(F.WORKTREE),V(!0)))},disabled:R,className:j("ml-auto flex items-center gap-2 h-7 pl-2 pr-2 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",d==="TEAM"?"text-foreground/80":"text-muted-foreground"),title:u("启用团队模式"),children:[e.jsx(Ke,{size:14,className:d==="TEAM"?"text-foreground/80":"text-muted-foreground"}),e.jsx("span",{children:u("团队模式")}),e.jsx("span",{className:j("relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors",d==="TEAM"?"bg-primary":"bg-border"),children:e.jsx("span",{className:j("inline-block size-3 rounded-full bg-background shadow-sm transition-transform",d==="TEAM"?"translate-x-3.5":"translate-x-0.5")})})]})]}),!A&&d==="SOLO"&&w===F.MAIN_DIRECTORY&&e.jsx("div",{className:"mt-2.5",children:e.jsx("div",{className:"rounded-lg border border-warning/25 bg-warning/8 px-3 py-2 text-xs leading-relaxed text-warning/90",children:u("Agent 将直接修改项目主目录;不会自动提交,也不能使用 Merge、Rebase 或冲突解决流程。")})}),!A&&d==="TEAM"&&re&&e.jsx("div",{className:"mt-2.5 rounded-xl border border-border/60 bg-muted/40 p-3 animate-[fadeInUp_0.25s_cubic-bezier(0.16,1,0.3,1)]",children:e.jsx(Mt,{mode:_,setMode:$,selectedTemplateId:O,setSelectedTemplateId:q,selectedMemberPresetIds:U,setSelectedMemberPresetIds:se,disabled:R,compact:!0})})]})}export{Bt as A,Vt as B,Zt as C,et as F,nt as G,ot as I,Ht as P,Wt as S,qt as T,mt as Z,Gt as a,Ct as b,Nt as c,Je as d,Xt as e,Ut as f,Yt as g,Mt as h,ct as i,Kt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,
|
|
1
|
+
import{r as a,I as j,J as E,K as T,j as t,g as M,u as U,m as I,B as O}from"./index-OY1TIdAK.js";function P(s){const{sessionId:c,onOutput:k,onExit:x,onError:b}=s,[p,g]=a.useState(()=>j.isConnected()),[l,d]=a.useState(!1),m=a.useRef({onOutput:k,onExit:x,onError:b});m.current={onOutput:k,onExit:x,onError:b},a.useEffect(()=>{const n=j.getSocket();g(n.connected);const u=()=>g(!0),v=()=>{g(!1),d(!1)},C=r=>{r.sessionId===c&&m.current.onOutput?.(r.data)},w=r=>{r.sessionId===c&&(d(!1),m.current.onExit?.(r.exitCode))},S=r=>{r.sessionId===c&&m.current.onError?.(r.message)};return n.on("connect",u),n.on("disconnect",v),n.on(E.SESSION_STDOUT,C),n.on(E.SESSION_EXIT,w),n.on(E.SESSION_ERROR,S),g(n.connected),()=>{n.off("connect",u),n.off("disconnect",v),n.off(E.SESSION_STDOUT,C),n.off(E.SESSION_EXIT,w),n.off(E.SESSION_ERROR,S),d(!1)}},[c]);const i=a.useCallback(()=>new Promise(n=>{if(!j.getSocket().connected){n(!1);return}d(!0),n(!0)}),[]),y=a.useCallback(()=>{d(!1)},[]),N=a.useCallback(n=>{j.getSocket().emit(T.INPUT,{sessionId:c,data:n})},[c]),h=a.useCallback((n,u)=>{j.getSocket().emit(T.RESIZE,{sessionId:c,cols:n,rows:u})},[c]);return{isConnected:p,isAttached:l,attach:i,detach:y,sendInput:N,resize:h}}function $({className:s,...c}){return t.jsx("div",{"data-slot":"card",className:M("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",s),...c})}function z(){const{t:s}=U(),[c,k]=a.useState([]),[x,b]=a.useState(""),[p,g]=a.useState(""),[l,d]=a.useState(null),[m,i]=a.useState([]),[y,N]=a.useState(!1),[h,n]=a.useState(""),u=a.useRef(null),v=a.useCallback(e=>{i(o=>{const f=o[o.length-1];return f&&f.role==="agent"?[...o.slice(0,-1),{...f,content:f.content+e}]:[...o,{role:"agent",content:e,timestamp:new Date}]})},[]),C=a.useCallback(e=>{i(o=>[...o,{role:"agent",content:`
|
|
2
2
|
[进程退出,退出码: ${e}]`,timestamp:new Date}]),d(null)},[]),w=a.useCallback(e=>{i(o=>[...o,{role:"agent",content:`
|
|
3
3
|
[错误: ${e}]`,timestamp:new Date}])},[]),{isConnected:S,isAttached:r,attach:D}=P({sessionId:l||"",onOutput:v,onExit:C,onError:w});a.useEffect(()=>{I.get("/demo/agents").then(e=>{k(e.agents);const o=e.agents.find(f=>f.available);o&&b(o.type)})},[]),a.useEffect(()=>{u.current?.scrollIntoView({behavior:"smooth"})},[m]),a.useEffect(()=>{l&&S&&!r&&D()},[l,S,r,D]);const R=async()=>{if(!(!x||!p.trim())){N(!0),i([{role:"user",content:p,timestamp:new Date}]);try{const e=await I.post("/demo/start",{agentType:x,prompt:p.trim()});d(e.sessionId),g("")}catch(e){i(o=>[...o,{role:"agent",content:s("启动失败: {message}",{message:e instanceof Error?e.message:s("未知错误")}),timestamp:new Date}])}finally{N(!1)}}},A=async()=>{if(!l||!h.trim())return;const e=h.trim();i(o=>[...o,{role:"user",content:e,timestamp:new Date}]),n("");try{await I.post(`/demo/${l}/message`,{message:e})}catch(o){i(f=>[...f,{role:"agent",content:s("发送失败: {message}",{message:o instanceof Error?o.message:s("未知错误")}),timestamp:new Date}])}},_=async()=>{if(l)try{await I.post(`/demo/${l}/stop`),i(e=>[...e,{role:"agent",content:`
|
|
4
|
-
[${s("会话已停止")}]`,timestamp:new Date}]),d(null)}catch(e){console.error("Stop failed:",e)}};return t.jsxs("div",{className:"flex flex-col h-full max-w-4xl mx-auto p-4 gap-4",children:[t.jsx("h1",{className:"text-2xl font-bold",children:s("Agent 交互演示")}),!l&&t.jsxs($,{className:"p-4",children:[t.jsx("h2",{className:"text-lg font-semibold mb-3",children:s("选择 Agent")}),t.jsx("div",{className:"flex gap-2 flex-wrap mb-4",children:c.map(e=>t.jsxs(O,{variant:x===e.type?"default":"outline",disabled:!e.available,onClick:()=>b(e.type),children:[e.name,e.available&&e.version&&` (${e.version})`,!e.available&&s(" (不可用)")]},e.type))}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:p,onChange:e=>g(e.target.value),onKeyDown:e=>e.key==="Enter"&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&R(),placeholder:s("输入你的问题或任务..."),className:"flex-1 px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),t.jsx(O,{onClick:R,disabled:y||!x||!p.trim(),children:s(y?"启动中...":"开始")})]})]}),t.jsxs($,{className:"flex-1 p-4 overflow-hidden flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-3",children:[t.jsx("h2",{className:"text-lg font-semibold",children:s("对话")}),l&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-gray-500",children:s(S?r?"已连接":"连接中...":"未连接")}),t.jsx(O,{variant:"outline",size:"sm",onClick:_,children:s("停止")})]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3",children:[m.length===0?t.jsx("div",{className:"text-gray-400 text-center py-8",children:s("选择 Agent 并输入问题开始对话")}):m.map((e,o)=>t.jsxs("div",{className:`p-3 rounded-lg ${e.role==="user"?"bg-blue-100 ml-8":"bg-gray-100 mr-8"}`,children:[t.jsx("div",{className:"text-xs text-gray-500 mb-1",children:e.role==="user"?s("你"):"Agent"}),t.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm",children:e.content})]},o)),t.jsx("div",{ref:u})]}),l&&t.jsxs("div",{className:"flex gap-2 mt-3 pt-3 border-t",children:[t.jsx("input",{type:"text",value:h,onChange:e=>n(e.target.value),onKeyDown:e=>e.key==="Enter"&&!e.repeat&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&A(),placeholder:s("发送后续消息..."),className:"flex-1 px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),t.jsx(O,{onClick:A,disabled:!h.trim(),children:s("发送")})]})]})]})}export{
|
|
4
|
+
[${s("会话已停止")}]`,timestamp:new Date}]),d(null)}catch(e){console.error("Stop failed:",e)}};return t.jsxs("div",{className:"flex flex-col h-full max-w-4xl mx-auto p-4 gap-4",children:[t.jsx("h1",{className:"text-2xl font-bold",children:s("Agent 交互演示")}),!l&&t.jsxs($,{className:"p-4",children:[t.jsx("h2",{className:"text-lg font-semibold mb-3",children:s("选择 Agent")}),t.jsx("div",{className:"flex gap-2 flex-wrap mb-4",children:c.map(e=>t.jsxs(O,{variant:x===e.type?"default":"outline",disabled:!e.available,onClick:()=>b(e.type),children:[e.name,e.available&&e.version&&` (${e.version})`,!e.available&&s(" (不可用)")]},e.type))}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:p,onChange:e=>g(e.target.value),onKeyDown:e=>e.key==="Enter"&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&R(),placeholder:s("输入你的问题或任务..."),className:"flex-1 px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),t.jsx(O,{onClick:R,disabled:y||!x||!p.trim(),children:s(y?"启动中...":"开始")})]})]}),t.jsxs($,{className:"flex-1 p-4 overflow-hidden flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-3",children:[t.jsx("h2",{className:"text-lg font-semibold",children:s("对话")}),l&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-gray-500",children:s(S?r?"已连接":"连接中...":"未连接")}),t.jsx(O,{variant:"outline",size:"sm",onClick:_,children:s("停止")})]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3",children:[m.length===0?t.jsx("div",{className:"text-gray-400 text-center py-8",children:s("选择 Agent 并输入问题开始对话")}):m.map((e,o)=>t.jsxs("div",{className:`p-3 rounded-lg ${e.role==="user"?"bg-blue-100 ml-8":"bg-gray-100 mr-8"}`,children:[t.jsx("div",{className:"text-xs text-gray-500 mb-1",children:e.role==="user"?s("你"):"Agent"}),t.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm",children:e.content})]},o)),t.jsx("div",{ref:u})]}),l&&t.jsxs("div",{className:"flex gap-2 mt-3 pt-3 border-t",children:[t.jsx("input",{type:"text",value:h,onChange:e=>n(e.target.value),onKeyDown:e=>e.key==="Enter"&&!e.repeat&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&A(),placeholder:s("发送后续消息..."),className:"flex-1 px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),t.jsx(O,{onClick:A,disabled:!h.trim(),children:s("发送")})]})]})]})}export{z as DemoPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as y,a as _,b as A,c as E,r as i,t as m,j as s,S as T,d as I,e as p,f as M,B as g}from"./index-
|
|
1
|
+
import{u as y,a as _,b as A,c as E,r as i,t as m,j as s,S as T,d as I,e as p,f as M,B as g}from"./index-OY1TIdAK.js";import{S as v}from"./select-tNVeGe-v.js";import{T as O}from"./textarea-DVa2Yvj4.js";import{u as k}from"./use-providers-CWfLQ--R.js";import"./chevron-down-DuZqUX3d.js";import"./check-C7Na6M49.js";const L=[{value:"zh-CN",label:"简体中文"},{value:"en",label:"English"}],l="__follow_task__";function F(){const{locale:x,setLocale:S,t:e}=y(),{data:r}=_(),{data:f}=k(),{data:o}=A(),a=E(),[h,u]=i.useState(l),[c,d]=i.useState(""),[j,n]=i.useState(!1);i.useEffect(()=>{!r||!o||(u(r.commitMessageProviderId||l),d(r.commitMessagePrompt||o.prompt),n(!1))},[r,o]);const P=[{value:l,label:e("跟随任务")},...(f??[]).filter(t=>t.availability.type!=="NOT_FOUND").map(t=>({value:t.provider.id,label:t.provider.name}))],b=i.useCallback(t=>{u(t);const N=t===l?null:t;a.mutate({commitMessageProviderId:N},{onError:()=>m.error(e("保存失败"))})},[a,e]),C=i.useCallback(()=>{const t=c.trim()||null;a.mutate({commitMessagePrompt:t},{onSuccess:()=>{n(!1),m.success(e("已保存"))},onError:()=>m.error(e("保存失败"))})},[c,a,e]);return s.jsxs(T,{children:[s.jsx(I,{title:e("通用设置"),className:"mb-1"}),s.jsx("div",{className:"divide-y divide-border/60",children:s.jsx(p,{label:e("显示语言"),description:e("界面语言会保存到本地数据库,重启后继续生效。"),align:"center",children:s.jsx(v,{value:x,onChange:t=>S(t),options:L})})}),s.jsx(M,{className:"mt-8 mb-1",children:e("Git Commit Message")}),s.jsxs("div",{className:"divide-y divide-border/60",children:[s.jsx(p,{label:e("Agent 渠道"),description:e('"跟随任务"表示使用当前任务所用的 Agent 渠道。选择具体渠道可使用更经济的模型。'),children:s.jsx(v,{value:h,onChange:b,options:P})}),s.jsx(p,{label:e("提示词模板"),description:e("自定义生成 commit message 的提示词。留空则使用内置默认模板。"),children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(O,{value:c,onChange:t=>{d(t.target.value),n(!0)},rows:5,className:"font-mono resize-y"}),j&&s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(g,{size:"sm",variant:"ghost",onClick:()=>{d(r?.commitMessagePrompt||o?.prompt||""),n(!1)},children:e("取消")}),s.jsx(g,{size:"sm",onClick:C,disabled:a.isPending,children:a.isPending?e("保存中..."):e("保存")})]})]})})]})]})}export{F as GeneralSettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,j as o}from"./index-
|
|
1
|
+
import{h as t,j as o}from"./index-OY1TIdAK.js";const r=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],c=t("at-sign",r);const s=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],i=t("globe",s),l=({className:e})=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1z",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 1a7 7 0 0 0 0 14V1z",fill:"currentColor"})]}),h=({className:e})=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.4"}),o.jsx("circle",{cx:"8",cy:"8",r:"3",fill:"currentColor"})]}),x=({className:e})=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"})}),d=({className:e})=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M13.5 4.5L6.5 11.5L2.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),w=({className:e})=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M5.5 5.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});export{c as A,i as G,h as I,d as a,x as b,w as c,l as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,L as c,j as e,R as g,X as f}from"./index-OY1TIdAK.js";function b(){const[i,a]=n.useState(null),u=n.useRef(null),l=n.useRef(null),d=n.useRef(null),r=i?c.find(s=>s.id===i):null,o=n.useCallback(()=>{a(null)},[]);return n.useEffect(()=>{if(!r){d.current?.focus(),d.current=null;return}l.current?.focus();const s=t=>{if(t.key==="Escape"){t.preventDefault(),o();return}t.key==="Tab"&&(t.preventDefault(),l.current?.focus())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[r,o]),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("style",{children:g}),e.jsx("header",{className:"border-b border-border px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Loading Animation Preview"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"10 个首屏加载动画候选 · 颜色遵循 Agent Tower 设计规范 · 点击卡片查看全屏效果"})]})}),e.jsxs("main",{className:"max-w-6xl mx-auto px-6 py-8",inert:r?!0:void 0,"aria-hidden":r?!0:void 0,children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:c.map((s,t)=>{const x=s.component;return e.jsxs("button",{onClick:m=>{d.current=m.currentTarget,a(s.id)},className:"group relative flex flex-col bg-card border border-border rounded-lg p-5 text-left transition-shadow hover:shadow-md focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",children:[e.jsxs("span",{className:"absolute top-3 right-3 text-[11px] font-semibold text-muted-foreground/60 tabular-nums",children:["#",t+1]}),e.jsx("div",{className:"flex items-center justify-center h-28 mb-4",children:e.jsx(x,{})}),e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:s.name}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s.description})]},s.id)})}),e.jsxs("div",{className:"mt-10 p-5 border border-border rounded-lg bg-muted/30",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground mb-2",children:"设计推荐"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1.5 leading-relaxed",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"首选:Charcoal Breathe (#10)"})," — 品牌感最强,Charcoal 色块+Tower 图标呼吸,用户对产品的第一印象即品牌本身。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"备选A:Tower Pulse (#1)"})," — 品牌图标直接出现,脉冲节奏稳定, 不浮夸,适合工作台场景。"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"备选B:Terminal Cursor (#4)"})," — 终端光标闪烁,贴合 Agent/终端协作的核心场景,开发者亲切感强。"]})]})]})]}),r&&e.jsxs("div",{ref:u,className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:s=>{s.target===s.currentTarget&&o()},role:"dialog","aria-modal":"true","aria-label":`全屏预览:${r.name}`,children:[e.jsx("button",{ref:l,onClick:o,className:"absolute top-4 right-4 p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none","aria-label":"关闭预览",children:e.jsx(f,{size:20})}),e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[e.jsx("div",{className:"scale-[2] origin-center",children:e.jsx(r.component,{})}),e.jsxs("div",{className:"text-center mt-4",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:r.name}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-sm",children:r.description})]}),e.jsx("span",{className:"text-xs text-muted-foreground/60 mt-2",children:"按 Esc 或点击关闭按钮退出"})]})]})]})}export{b as LoadingPreviewPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as x,i as m,q as o,m as u,u as p,r as g,t as n,j as e,S as a,B as i}from"./index-
|
|
1
|
+
import{h as x,i as m,q as o,m as u,u as p,r as g,t as n,j as e,S as a,B as i}from"./index-OY1TIdAK.js";import{L as f}from"./loader-circle-DDrZegLO.js";import{C as h,T as j}from"./terminal-D5iU4zAj.js";import{C as b}from"./check-C7Na6M49.js";const y=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],N=x("server",y);function C(){return m({queryKey:o.system.mcpConfig,queryFn:()=>u.get("/system/mcp-config")})}function v({mode:s,label:t}){const r=s==="desktop-packaged";return e.jsx("span",{className:`inline-flex items-center rounded-md px-2 py-1 text-[11px] font-medium ${r?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"}`,children:t})}function P(){const{t:s}=p(),{data:t,isLoading:r,isError:l,refetch:d}=C(),c=g.useCallback(async()=>{if(t?.configJson)try{await navigator.clipboard.writeText(t.configJson),n.success(s("MCP 配置已复制"))}catch{n.error(s("复制 MCP 配置失败"))}},[t?.configJson,s]);return r?e.jsx(a,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(f,{className:"h-5 w-5 animate-spin text-neutral-500"})})}):l||!t?e.jsxs(a,{children:[e.jsx("h2",{className:"mb-1 text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("div",{className:"mt-5 rounded-lg border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700",children:s("MCP 配置加载失败")}),e.jsx(i,{className:"mt-4",size:"sm",variant:"outline",onClick:()=>{d()},children:s("重试")})]}):e.jsxs(a,{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-neutral-500",children:s("复制下面的 JSON 到支持 MCP 的客户端配置中。桌面打包版使用 App 内置 runtime,不需要全局安装 agent-tower。")})]}),e.jsxs(i,{size:"sm",onClick:c,children:[e.jsx(h,{size:14}),s("复制配置")]})]}),e.jsxs("div",{className:"space-y-3 border-b border-neutral-100 pb-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(v,{mode:t.runtimeMode,label:t.runtimeMode==="desktop-packaged"?s("桌面打包 runtime"):s("工作区 runtime")}),e.jsx("span",{className:"text-[12px] text-neutral-400",children:t.serverName})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(j,{size:12}),"Command"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.command})]}),e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(N,{size:12}),"Entry"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.args[0]??""})]})]})]}),e.jsxs("div",{className:"pt-5",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("label",{className:"text-[12px] font-medium text-neutral-600",children:"mcpServers JSON"}),t.runtimeMode==="desktop-packaged"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-emerald-600",children:[e.jsx(b,{size:12}),s("无需全局 CLI")]})]}),e.jsx("textarea",{readOnly:!0,value:t.configJson,rows:14,className:"w-full resize-y rounded-lg border border-neutral-200 bg-neutral-950 px-3 py-3 font-mono text-[12px] leading-relaxed text-neutral-100 outline-none"}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-neutral-400",children:s("当前版本只生成通用 MCP 配置,不会自动修改 Claude、Codex 或其他第三方客户端配置文件。")})]})]})}export{P as McpSettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as n,g as o}from"./index-
|
|
1
|
+
import{r as i,j as n,g as o}from"./index-OY1TIdAK.js";function d(r){const t=r.trim();if(!t)return"?";const e=t.split(/\s+/).filter(Boolean);return e.length>=2?`${e[0][0]??""}${e[1][0]??""}`.toUpperCase():Array.from(t).slice(0,2).join("").toUpperCase()}function a(r){const t=r.trim();return/^#([0-9a-f]{3,8})$/i.test(t)||/^rgba?\(/i.test(t)||/^hsla?\(/i.test(t)}function l(r){const t=r.trim();return t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:image/")||t.startsWith("blob:")}function h(r,t){const e=r?.trim()??"";return!e||a(e)||l(e)?d(t):e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}function p(r){const t=r?.trim()??"";if(!(!t||!a(t)))return{backgroundColor:t,color:"#ffffff"}}function g({name:r,avatar:t,className:e}){const[u,c]=i.useState(null),s=t?.trim()??"",f=!!s&&l(s)&&u!==s,m=i.useMemo(()=>h(s,r),[r,s]);return f?n.jsx("img",{src:s,alt:r,loading:"lazy",onError:()=>c(s),className:o("h-7 w-7 shrink-0 rounded-full border border-neutral-200 bg-white object-cover",e)}):n.jsx("div",{className:o("flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-neutral-200 bg-neutral-100 text-[10px] font-semibold text-neutral-600",e),style:p(s),"aria-label":r,children:m})}export{g as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as F,i as q,k as E,l as k,q as v,m as h,u as R,r as o,j as e,S as g,
|
|
1
|
+
import{h as F,i as q,k as E,l as k,q as v,m as h,u as R,r as o,j as e,S as g,Q as B,d as L,e as j,T as W,B as z,f as M,P as A}from"./index-OY1TIdAK.js";import{S as Q}from"./select-tNVeGe-v.js";import{I as d}from"./input-6lLP89Y3.js";import{S as K,C as O}from"./switch-7jE2n-KP.js";import{M as _}from"./message-square-CunpcgQi.js";import{L as D}from"./loader-circle-DDrZegLO.js";import{C as H}from"./circle-alert-DCm2E91k.js";import"./chevron-down-DuZqUX3d.js";import"./check-C7Na6M49.js";const G=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],J=F("link",G);function V(){return q({queryKey:v.notifications.settings,queryFn:()=>h.get("/notifications/settings")})}function X(){const t=E();return k({mutationFn:i=>h.put("/notifications/settings",i),onSuccess:()=>{t.invalidateQueries({queryKey:v.notifications.settings})}})}function Y(){return k({mutationFn:t=>h.post("/notifications/test",t)})}function le(){const{t}=R(),{data:i,isLoading:T}=V(),l=X(),n=Y(),y=[{value:"none",label:t("关闭")},{value:"feishu",label:t("飞书 Webhook")}],[a,p]=o.useState({webhookUrl:"",baseUrl:"",titleTemplate:"",bodyTemplate:""}),[m,x]=o.useState(!1),[f,r]=o.useState("idle"),u=o.useRef(void 0);if(o.useEffect(()=>{i&&!m&&p({webhookUrl:i.feishuWebhookUrl??"",baseUrl:i.thirdPartyBaseUrl??"",titleTemplate:i.taskInReviewTitleTemplate??"",bodyTemplate:i.taskInReviewBodyTemplate??""})},[i,m]),o.useEffect(()=>(n.isSuccess?(r("success"),u.current=setTimeout(()=>r("idle"),3e3)):n.isError&&(r("error"),u.current=setTimeout(()=>r("idle"),5e3)),()=>clearTimeout(u.current)),[n.isSuccess,n.isError]),T)return e.jsx(g,{children:e.jsx(B,{rows:3})});const N=i?.osNotificationEnabled??!0,b=i?.thirdPartyChannel??"none",c=(s,I)=>{p(P=>({...P,[s]:I})),x(!0)},S=s=>{l.mutate({osNotificationEnabled:s})},C=s=>{l.mutate({thirdPartyChannel:s})},U=()=>{l.mutate({feishuWebhookUrl:a.webhookUrl.trim()||null,thirdPartyBaseUrl:a.baseUrl.trim()||null,taskInReviewTitleTemplate:a.titleTemplate.trim()||"Agent Tower",taskInReviewBodyTemplate:a.bodyTemplate.trim()||t('✅ "{taskTitle}" 已完成,等待审查')},{onSuccess:()=>x(!1)})},w=()=>{a.webhookUrl.trim()&&n.mutate({channel:"feishu",webhookUrl:a.webhookUrl.trim(),baseUrl:a.baseUrl.trim()||void 0})};return e.jsxs(g,{children:[e.jsx(L,{title:t("通知设置"),className:"mb-1"}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsx(j,{icon:W,label:t("桌面通知"),description:t("任务完成时弹出系统通知"),align:"center",controlWidth:"auto",children:e.jsx(K,{checked:N,onCheckedChange:S,"aria-label":t("桌面通知")})}),e.jsxs("div",{className:"py-5",children:[e.jsx(j,{icon:_,label:t("第三方通知"),description:t("推送到外部渠道(飞书群机器人等)"),align:"center",className:"py-0",children:e.jsx(Q,{value:b,onChange:s=>C(s),options:y})}),b==="feishu"&&e.jsxs("div",{className:"mt-4 space-y-4 sm:pl-11",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-webhook-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Webhook URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"feishu-webhook-url",value:a.webhookUrl,onChange:s=>c("webhookUrl",s.target.value),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"min-w-0 flex-1 font-mono"}),e.jsxs(z,{size:"sm",variant:"outline",onClick:w,disabled:!a.webhookUrl.trim()||n.isPending,className:"h-auto shrink-0",children:[n.isPending&&e.jsx(D,{size:12,className:"mr-1 animate-spin motion-reduce:animate-none"}),t("测试")]})]}),f==="success"&&e.jsxs("div",{role:"status",className:"mt-2 flex items-center gap-1.5 text-xs text-success",children:[e.jsx(O,{size:12,"aria-hidden":"true"}),t("测试消息发送成功")]}),f==="error"&&e.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-xs text-destructive",children:[e.jsx(H,{size:12,"aria-hidden":"true"}),t("发送失败,请检查 Webhook 地址")]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-base-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(J,{size:11,"aria-hidden":"true"}),t("跳转地址")]})}),e.jsx(d,{id:"feishu-base-url",value:a.baseUrl,onChange:s=>c("baseUrl",s.target.value),placeholder:"http://localhost:5173",className:"font-mono"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t('通知卡片中的"查看任务"按钮跳转地址前缀')})]})]})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(M,{children:t("通知模板")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("支持变量: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}",{taskTitle:"{taskTitle}",taskId:"{taskId}",projectId:"{projectId}",projectName:"{projectName}",status:"{status}"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-title-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("标题")}),e.jsx(d,{id:"notification-title-template",value:a.titleTemplate,onChange:s=>c("titleTemplate",s.target.value),placeholder:"Agent Tower"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-body-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("内容")}),e.jsx(d,{id:"notification-body-template",value:a.bodyTemplate,onChange:s=>c("bodyTemplate",s.target.value),placeholder:t('✅ "{taskTitle}" 已完成,等待审查')})]})]})]})]}),m&&e.jsx(A,{saving:l.isPending,onSave:U})]})}export{le as NotificationSettingsPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{u as T,r as g,j as e,S,d as J,n as M,o as w,B as E,p,g as P}from"./index-
|
|
1
|
+
import{u as T,r as g,j as e,S,d as J,n as M,o as w,B as E,p,g as P}from"./index-OY1TIdAK.js";import{u as U,a as _,b as z,c as B}from"./use-profiles-BS_Mkp5d.js";import{M as F}from"./modal-D8uSzIAd.js";import{C as G}from"./confirm-dialog-Cc27tq8j.js";import{I as $}from"./input-6lLP89Y3.js";import{T as R}from"./textarea-DVa2Yvj4.js";import{L as H}from"./layers-CDcLPjE5.js";import{C as q}from"./chevron-down-DuZqUX3d.js";import{P as K,T as Q}from"./trash-2-z7TLHqpU.js";import{P as W}from"./pencil-BTaYfjKo.js";function X(t){const a=Object.entries(t);return a.length===0?"(empty)":a.map(([m,c])=>`${m}: ${JSON.stringify(c)}`).join(", ")}const y={CLAUDE_CODE:"Claude Code",GEMINI_CLI:"Gemini CLI",CURSOR_AGENT:"Cursor Agent"};function Y({agentType:t,variants:a,isBuiltIn:m,onEdit:c,onNew:h,onDelete:j}){const{t:n}=T(),[r,b]=g.useState(!0),u=Object.entries(a);return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-muted/40 px-4 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>b(i=>!i),"aria-expanded":r,className:"flex items-center gap-3 rounded-md transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:y[t]??t}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[u.length," ",n("个变体")]}),e.jsx(q,{size:14,"aria-hidden":"true",className:P("text-muted-foreground transition-transform motion-reduce:transition-none",r&&"rotate-180")})]}),e.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx(K,{size:12,"aria-hidden":"true"}),n("新增")]})]}),r&&e.jsxs("div",{className:"divide-y divide-border/60",children:[u.map(([i,x])=>{const f=m(i);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-muted/40",children:[e.jsx("span",{className:P("inline-flex shrink-0 items-center rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide",i==="DEFAULT"?"bg-primary/[0.06] text-primary":"bg-muted text-muted-foreground"),children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:X(x)}),f&&e.jsx("span",{className:"shrink-0 text-[10px] font-medium text-muted-foreground/70",children:n("内置")}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{onClick:()=>c(i,x),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("编辑"),"aria-label":n("编辑"),children:e.jsx(W,{size:12})}),!f&&e.jsx("button",{onClick:()=>j(i),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("删除"),"aria-label":n("删除"),children:e.jsx(Q,{size:12})})]})]},i)}),u.length===0&&e.jsx("div",{className:"px-4 py-4 text-center text-xs text-muted-foreground",children:n("暂无变体")})]})]})}function Z(){return e.jsxs("div",{role:"status","aria-label":"Loading",children:[e.jsx(p,{className:"h-7 w-36"}),e.jsx(p,{className:"mt-2 h-3.5 w-72 max-w-full"}),e.jsx("div",{className:"mt-5 space-y-3",children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 bg-muted/40 px-4 py-3",children:[e.jsx(p,{className:"h-4 w-28"}),e.jsx(p,{className:"h-3 w-14"})]}),e.jsx("div",{className:"divide-y divide-border/60",children:Array.from({length:2}).map((m,c)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx(p,{className:"h-5 w-16 rounded"}),e.jsx(p,{className:"h-3.5 flex-1"})]},c))})]},a))})]})}function ce(){const{t}=T(),{data:a,isLoading:m}=U(),{data:c}=_(),h=z(),j=B(),[n,r]=g.useState(null),[b,u]=g.useState(""),[i,x]=g.useState(""),[f,v]=g.useState(""),[o,N]=g.useState(null),k=(s,l,d)=>{r({agentType:s,variant:l,config:d,isNew:!1}),x(l),u(JSON.stringify(d,null,2)),v("")},O=s=>{r({agentType:s,variant:"",config:{},isNew:!0}),x(""),u(`{
|
|
2
2
|
|
|
3
3
|
}`),v("")},D=()=>{if(!(!n||!i.trim()))try{const s=JSON.parse(b);v(""),h.mutate({agentType:n.agentType,variant:i.trim().toUpperCase(),config:s},{onSuccess:()=>r(null)})}catch{v(t("JSON 格式错误"))}},L=(s,l)=>{N({agentType:s,variant:l})},A=()=>{o&&j.mutate({agentType:o.agentType,variant:o.variant},{onSettled:()=>N(null)})},I=(s,l)=>!!c?.executors[s]?.[l];if(m)return e.jsx(S,{children:e.jsx(Z,{})});const C=a?.executors??{};return e.jsxs(S,{children:[e.jsx(J,{title:t("Profile 配置"),description:t("管理 Agent 执行器的配置变体。每个变体定义一组运行参数。"),className:"mb-4"}),e.jsx("div",{className:"space-y-3",children:Object.entries(C).map(([s,l])=>e.jsx(Y,{agentType:s,variants:l,isBuiltIn:d=>I(s,d),onEdit:(d,V)=>k(s,d,V),onNew:()=>O(s),onDelete:d=>L(s,d)},s))}),Object.keys(C).length===0&&e.jsx(M,{icon:H,message:t("暂无 Profile 配置")}),e.jsx(F,{isOpen:!!n,onClose:()=>r(null),title:n?.isNew?t("新增 Variant — {agentType}",{agentType:y[n.agentType]??n.agentType}):t("编辑 {variant}",{variant:n?.variant??""}),action:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"outline",onClick:()=>r(null),children:t("取消")}),e.jsx(E,{onClick:D,disabled:h.isPending,children:h.isPending?t("保存中..."):t("保存")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(w,{label:t("Variant 名称"),htmlFor:"profile-variant-name",children:e.jsx($,{id:"profile-variant-name",value:i,onChange:s=>x(s.target.value),disabled:!n?.isNew,placeholder:t("例如: CUSTOM"),className:"font-mono"})}),e.jsxs(w,{label:t("配置 (JSON)"),htmlFor:"profile-variant-json",children:[e.jsx(R,{id:"profile-variant-json",value:b,onChange:s=>{u(s.target.value),v("")},rows:6,className:"resize-none font-mono","aria-invalid":!!f}),f&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:f})]})]})}),e.jsx(G,{isOpen:o!==null,onClose:()=>{j.isPending||N(null)},onConfirm:A,title:t("删除 Profile Variant"),description:o?t('确定删除 "{name}"?此操作不可撤销。',{name:`${y[o.agentType]??o.agentType} / ${o.variant}`}):"",confirmText:t("删除"),cancelText:t("取消"),variant:"danger",isLoading:j.isPending})]})}export{ce as ProfileSettingsPage};
|