agent-tower 0.7.2 → 0.7.4-beta.0
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/executors/__tests__/providers.test.js +53 -0
- package/dist/executors/__tests__/providers.test.js.map +1 -1
- package/dist/executors/providers.d.ts +2 -0
- package/dist/executors/providers.d.ts.map +1 -1
- package/dist/executors/providers.js +3 -2
- package/dist/executors/providers.js.map +1 -1
- package/dist/git/base-branch.d.ts +3 -0
- package/dist/git/base-branch.d.ts.map +1 -0
- package/dist/git/base-branch.js +17 -0
- package/dist/git/base-branch.js.map +1 -0
- package/dist/git/worktree.manager.d.ts +2 -0
- package/dist/git/worktree.manager.d.ts.map +1 -1
- package/dist/git/worktree.manager.js +29 -8
- package/dist/git/worktree.manager.js.map +1 -1
- package/dist/git/worktree.manager.test.js +38 -0
- package/dist/git/worktree.manager.test.js.map +1 -1
- package/dist/mcp/http-client.d.ts +4 -6
- package/dist/mcp/http-client.d.ts.map +1 -1
- package/dist/mcp/http-client.js +6 -0
- package/dist/mcp/http-client.js.map +1 -1
- package/dist/mcp/tools/__tests__/providers.test.d.ts +2 -0
- package/dist/mcp/tools/__tests__/providers.test.d.ts.map +1 -0
- package/dist/mcp/tools/__tests__/providers.test.js +22 -0
- package/dist/mcp/tools/__tests__/providers.test.js.map +1 -0
- package/dist/mcp/tools/__tests__/tasks.test.d.ts +2 -0
- package/dist/mcp/tools/__tests__/tasks.test.d.ts.map +1 -0
- package/dist/mcp/tools/__tests__/tasks.test.js +49 -0
- package/dist/mcp/tools/__tests__/tasks.test.js.map +1 -0
- package/dist/mcp/tools/providers.d.ts.map +1 -1
- package/dist/mcp/tools/providers.js +3 -2
- package/dist/mcp/tools/providers.js.map +1 -1
- package/dist/mcp/tools/tasks.d.ts.map +1 -1
- package/dist/mcp/tools/tasks.js +31 -2
- package/dist/mcp/tools/tasks.js.map +1 -1
- package/dist/mcp/types.d.ts +27 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +13 -0
- package/dist/mcp/types.js.map +1 -1
- package/dist/output/__tests__/text-block-lifecycle.test.js +37 -0
- package/dist/output/__tests__/text-block-lifecycle.test.js.map +1 -1
- package/dist/output/text-block-tracker.d.ts.map +1 -1
- package/dist/output/text-block-tracker.js +24 -1
- package/dist/output/text-block-tracker.js.map +1 -1
- package/dist/prompts/task-handoff.d.ts +6 -0
- package/dist/prompts/task-handoff.d.ts.map +1 -0
- package/dist/prompts/task-handoff.js +17 -0
- package/dist/prompts/task-handoff.js.map +1 -0
- package/dist/prompts/task-handoff.test.d.ts +2 -0
- package/dist/prompts/task-handoff.test.d.ts.map +1 -0
- package/dist/prompts/task-handoff.test.js +27 -0
- package/dist/prompts/task-handoff.test.js.map +1 -0
- package/dist/prompts/workspace-background-service-policy.d.ts +6 -0
- package/dist/prompts/workspace-background-service-policy.d.ts.map +1 -1
- package/dist/prompts/workspace-background-service-policy.js +2 -1
- package/dist/prompts/workspace-background-service-policy.js.map +1 -1
- package/dist/routes/__tests__/providers.test.js +67 -0
- package/dist/routes/__tests__/providers.test.js.map +1 -1
- package/dist/routes/__tests__/task-handoff.test.d.ts +2 -0
- package/dist/routes/__tests__/task-handoff.test.d.ts.map +1 -0
- package/dist/routes/__tests__/task-handoff.test.js +185 -0
- package/dist/routes/__tests__/task-handoff.test.js.map +1 -0
- package/dist/routes/__tests__/tasks.test.js +46 -0
- package/dist/routes/__tests__/tasks.test.js.map +1 -1
- package/dist/routes/providers.d.ts.map +1 -1
- package/dist/routes/providers.js +8 -0
- package/dist/routes/providers.js.map +1 -1
- package/dist/routes/tasks.d.ts.map +1 -1
- package/dist/routes/tasks.js +60 -2
- package/dist/routes/tasks.js.map +1 -1
- package/dist/runtime/acp/history-reconciler.js +1 -1
- package/dist/runtime/acp/history-reconciler.js.map +1 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js +171 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
- package/dist/services/__tests__/task.service.test.js +142 -76
- package/dist/services/__tests__/task.service.test.js.map +1 -1
- package/dist/services/__tests__/translation-protection.test.js +48 -18
- package/dist/services/__tests__/translation-protection.test.js.map +1 -1
- package/dist/services/__tests__/translation-session-blocks.test.js +66 -2
- package/dist/services/__tests__/translation-session-blocks.test.js.map +1 -1
- package/dist/services/__tests__/workspace-background-service.service.test.js +74 -26
- package/dist/services/__tests__/workspace-background-service.service.test.js.map +1 -1
- package/dist/services/__tests__/workspace.service.test.js +70 -0
- package/dist/services/__tests__/workspace.service.test.js.map +1 -1
- package/dist/services/message-delivery.service.d.ts +4 -1
- package/dist/services/message-delivery.service.d.ts.map +1 -1
- package/dist/services/project.service.d.ts +3 -0
- package/dist/services/project.service.d.ts.map +1 -1
- package/dist/services/provider-config.service.d.ts.map +1 -1
- package/dist/services/provider-config.service.js +1 -0
- package/dist/services/provider-config.service.js.map +1 -1
- package/dist/services/session-manager.d.ts +15 -5
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +19 -3
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/task-cleanup.service.d.ts +2 -0
- package/dist/services/task-cleanup.service.d.ts.map +1 -1
- package/dist/services/task-cleanup.service.js +2 -2
- package/dist/services/task-cleanup.service.js.map +1 -1
- package/dist/services/task-handoff.service.d.ts +18 -0
- package/dist/services/task-handoff.service.d.ts.map +1 -0
- package/dist/services/task-handoff.service.js +87 -0
- package/dist/services/task-handoff.service.js.map +1 -0
- package/dist/services/task.service.d.ts +45 -18
- package/dist/services/task.service.d.ts.map +1 -1
- package/dist/services/task.service.js +215 -160
- package/dist/services/task.service.js.map +1 -1
- package/dist/services/team-run.service.d.ts +3 -0
- package/dist/services/team-run.service.d.ts.map +1 -1
- package/dist/services/team-task-input.service.d.ts +3 -0
- package/dist/services/team-task-input.service.d.ts.map +1 -1
- package/dist/services/translation-protection.d.ts +3 -1
- package/dist/services/translation-protection.d.ts.map +1 -1
- package/dist/services/translation-protection.js +21 -67
- package/dist/services/translation-protection.js.map +1 -1
- package/dist/services/translation-settings.service.d.ts +4 -4
- package/dist/services/translation.service.d.ts.map +1 -1
- package/dist/services/translation.service.js +44 -20
- package/dist/services/translation.service.js.map +1 -1
- package/dist/services/workspace-background-service.service.d.ts +1 -3
- package/dist/services/workspace-background-service.service.d.ts.map +1 -1
- package/dist/services/workspace-background-service.service.js +17 -65
- package/dist/services/workspace-background-service.service.js.map +1 -1
- package/dist/services/workspace.service.d.ts +21 -6
- package/dist/services/workspace.service.d.ts.map +1 -1
- package/dist/services/workspace.service.js +56 -11
- package/dist/services/workspace.service.js.map +1 -1
- package/dist/web/assets/AgentDemoPage-JXetlNBf.js +1 -0
- package/dist/web/assets/{AgentEnvironmentSettingsPage-GHjKIWpb.js → AgentEnvironmentSettingsPage-CdYyUCwJ.js} +1 -1
- package/dist/web/assets/AttachmentPreview-DMS-PM-1.js +2 -0
- package/dist/web/assets/BranchSelect-BAq4L2ZS.js +1 -0
- package/dist/web/assets/BrandLogo--kWXXJtZ.js +1 -0
- package/dist/web/assets/ConversationPage-CvC4RyB5.js +1 -0
- package/dist/web/assets/CreateTaskInput-DjVxCAfc.js +1 -0
- package/dist/web/assets/{DemoPage-DK-ikg1_.js → DemoPage-cDVTGOp8.js} +3 -3
- package/dist/web/assets/DesignSystemPage-BI54IkKi.js +12 -0
- package/dist/web/assets/{ExecutionPermissionSelector-B8befbxJ.js → ExecutionPermissionSelector-f1UYIm1z.js} +1 -1
- package/dist/web/assets/GeneralSettingsPage-C0yto6C_.js +1 -0
- package/dist/web/assets/{LoadingPreviewPage-BDlf89rJ.js → LoadingPreviewPage-BiJSaHUi.js} +1 -1
- package/dist/web/assets/McpSettingsPage-BbHwZtyj.js +1 -0
- package/dist/web/assets/{MemberAvatar-YVr_erAr.js → MemberAvatar-BLezO3vS.js} +1 -1
- package/dist/web/assets/MobileTaskDetail-M_Kke9rL.js +3 -0
- package/dist/web/assets/NotificationSettingsPage-CiKoL2Kv.js +1 -0
- package/dist/web/assets/{ProfileSettingsPage-CHe4LlRp.js → ProfileSettingsPage-DCB48cPS.js} +2 -2
- package/dist/web/assets/ProjectKanbanPage-soDqevjQ.js +12 -0
- package/dist/web/assets/ProjectSettingsPage-COvIVq1h.js +2 -0
- package/dist/web/assets/ProviderSettingsPage-CPuJcZDg.js +67 -0
- package/dist/web/assets/{SettingsMasterDetail-DjWR9Sqk.js → SettingsMasterDetail-Cv7YaRJB.js} +1 -1
- package/dist/web/assets/TaskDetail-CqhPxvg3.js +1 -0
- package/dist/web/assets/TaskHandoffPanel-CxH3Mgyd.js +70 -0
- package/dist/web/assets/TeamSettingsPage-D-XDefNd.js +1 -0
- package/dist/web/assets/{TranslationSettingsPage-Cod9c4Ug.js → TranslationSettingsPage-BPHI-SZW.js} +1 -1
- package/dist/web/assets/{arc-DEy33vTc.js → arc-CC81aLuf.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-Ky1D1LBk.js → architectureDiagram-3BPJPVTR-DL08XGaN.js} +1 -1
- package/dist/web/assets/{at-sign-C48_y345.js → at-sign-DYPIlD6D.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-BNgB7kNT.js → blockDiagram-GPEHLZMM-B4IW5WxI.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-4GMrPMgQ.js → c4Diagram-AAUBKEIU-Cj4d_FqK.js} +1 -1
- package/dist/web/assets/channel-CUa8oyzC.js +1 -0
- package/dist/web/assets/check-DaZqOL8l.js +1 -0
- package/dist/web/assets/{chevron-down-3y5Aiolp.js → chevron-down-DNhYsNAt.js} +1 -1
- package/dist/web/assets/{chevron-up-DqaYcjpq.js → chevron-up-CjrLieBR.js} +1 -1
- package/dist/web/assets/chip-Cf92J-pQ.js +1 -0
- package/dist/web/assets/{chunk-2J33WTMH-C439hRe_.js → chunk-2J33WTMH-DeCj8QSD.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-D8GK3M3t.js → chunk-4BX2VUAB-k-6rzQmQ.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-Dl4UhJ8X.js → chunk-55IACEB6-qMTCQ5bX.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-BSEeayBq.js → chunk-727SXJPM-CMnu18d1.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-B6chbZfT.js → chunk-AQP2D5EJ-C0mFbUMn.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-DaLkiLdQ.js → chunk-FMBD7UC4-u6-_M137.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-DeQwZAAT.js → chunk-ND2GUHAM-DHrIE_8H.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-CLRr4YRM.js → chunk-QZHKN3VN-aTyC0wZq.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-BAx111NO.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BAx111NO.js +1 -0
- package/dist/web/assets/{code-block-OCS4YCEC-CnoxUpOx.js → code-block-OCS4YCEC-CBIOQOMH.js} +1 -1
- package/dist/web/assets/confirm-dialog-DWeBZLJW.js +1 -0
- package/dist/web/assets/content-JM9E1MeD.js +2 -0
- package/dist/web/assets/{copy-HRMhTkIG.js → copy-D0gl9kF8.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-C1UiYzfk.js → cose-bilkent-S5V4N54A-xLyliSgU.js} +1 -1
- package/dist/web/assets/cssMode-DO5UnQ64.js +1 -0
- package/dist/web/assets/{dagre-BM42HDAG-CTJpBgye.js → dagre-BM42HDAG-CbNpoO2d.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-Dj1_TEYp.js → diagram-2AECGRRQ-CG3hKxAX.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-V-KUpwqh.js → diagram-5GNKFQAL-mQu9M28s.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-CXG1ZIeX.js → diagram-KO2AKTUF-BSeEp_Uw.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-BZSJUwk9.js → diagram-LMA3HP47-D6yRdao-.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-CCr4gq4u.js → diagram-OG6HWLK6-BUBUW9wD.js} +1 -1
- package/dist/web/assets/dialog-D1lkhqVL.js +5 -0
- package/dist/web/assets/{erDiagram-TEJ5UH35-Djtyzh6z.js → erDiagram-TEJ5UH35-BQSZgRqq.js} +1 -1
- package/dist/web/assets/file-BijjwxRR.js +1 -0
- package/dist/web/assets/{flowDiagram-I6XJVG4X-BmSVSiXJ.js → flowDiagram-I6XJVG4X-D-eqyr5Y.js} +1 -1
- package/dist/web/assets/folder-picker-Czxm0_S9.js +1 -0
- package/dist/web/assets/{freemarker2-DdptX5f1.js → freemarker2-B4RvEa_U.js} +2 -2
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-r5vQX-b5.js → ganttDiagram-6RSMTGT7-BWGkCt_x.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Zj9aloh9.js → gitGraphDiagram-PVQCEYII-DGVc49pR.js} +1 -1
- package/dist/web/assets/{globe-B9I-jHBB.js → globe-Ce01-45x.js} +1 -1
- package/dist/web/assets/handlebars-oyT7drqS.js +1 -0
- package/dist/web/assets/html-CxxWf2Qk.js +1 -0
- package/dist/web/assets/htmlMode-RfAHh5Jj.js +1 -0
- package/dist/web/assets/index-BMZFF1UJ.js +1 -0
- package/dist/web/assets/index-BN53vGxp.css +1 -0
- package/dist/web/assets/index-Cc3qXMhU.js +122 -0
- package/dist/web/assets/{index-Bhvt-E6d.js → index-DWrSDMX2.js} +2 -2
- package/dist/web/assets/{index-DkRy6eNX.js → index-Dh-tgeaL.js} +4 -4
- package/dist/web/assets/{index-B1oVmCie.js → index-Disv1kQS.js} +1 -1
- package/dist/web/assets/{index-DcOU2m2F.js → index-DyJfPc4O.js} +1 -1
- package/dist/web/assets/{index-Dk3bRQAK.js → index-Pt4TsHjm.js} +1 -1
- package/dist/web/assets/{index-CThFsQNP.js → index-T38iVLEb.js} +1 -1
- package/dist/web/assets/{index-BtUQYU5l.js → index-hpHE1jXY.js} +1 -1
- package/dist/web/assets/{infoDiagram-5YYISTIA-BHtVaxZx.js → infoDiagram-5YYISTIA-DLPs3dV_.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BYmwjkbC.js → ishikawaDiagram-YF4QCWOH-d_OrnwDY.js} +1 -1
- package/dist/web/assets/javascript-BNXtViSL.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW-c8BBqqRS.js → journeyDiagram-JHISSGLW-EtU1st_0.js} +1 -1
- package/dist/web/assets/jsonMode-Bqh5vIxx.js +7 -0
- package/dist/web/assets/{kanban-definition-UN3LZRKU-D4Vr-oFT.js → kanban-definition-UN3LZRKU-ZWzUnsFK.js} +1 -1
- package/dist/web/assets/{kbd-C88ut3t9.js → kbd-IjDGsZ2B.js} +1 -1
- package/dist/web/assets/{key-round-Cjbj2qNa.js → key-round-CbnAuUxp.js} +1 -1
- package/dist/web/assets/{layers-eaHAVcc3.js → layers-Pdy9vZ6K.js} +1 -1
- package/dist/web/assets/{linear-opi90s0L.js → linear-D7n23wcA.js} +1 -1
- package/dist/web/assets/{link-BSGb85gq.js → link-Bl1ZbjFh.js} +1 -1
- package/dist/web/assets/liquid-Ds47iVLN.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DWu2Ubf0.js → lspLanguageFeatures-Dcch3bsp.js} +1 -1
- package/dist/web/assets/mdx-CM7ky-2B.js +1 -0
- package/dist/web/assets/{menu--sjyisSg.js → menu-DubntFHq.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-BSNbBj78.js → mermaid-NOHMQCX5-nBsnjgeU.js} +54 -54
- package/dist/web/assets/{message-square-BLEJN6p7.js → message-square-BE-pW0m_.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-BN3ZjBh-.js → mindmap-definition-RKZ34NQL-ClHORNTt.js} +1 -1
- package/dist/web/assets/modal-CHLtZWvx.js +1 -0
- package/dist/web/assets/{monaco-BkuNyOkP.js → monaco-BbAmalE2.js} +3 -3
- package/dist/web/assets/nav-row-DH7rNq1V.js +1 -0
- package/dist/web/assets/{paperclip-CTNoXpUW.js → paperclip-YP3Bk1lI.js} +1 -1
- package/dist/web/assets/{pencil-Cp70ZwtG.js → pencil-BFDuhbtW.js} +1 -1
- package/dist/web/assets/{people-DT78SebR.js → people-DEeNaaLt.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-CfmFHpPI.js → pieDiagram-4H26LBE5-BUOaKIyP.js} +1 -1
- package/dist/web/assets/popover-CUmBEXxL.js +1 -0
- package/dist/web/assets/provider-selection-DSu7SCI7.js +1 -0
- package/dist/web/assets/python-BODTtU6m.js +1 -0
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CeaumJAa.js → quadrantDiagram-W4KKPZXB-Caezg-U2.js} +1 -1
- package/dist/web/assets/razor-CHm8DY1p.js +1 -0
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-BWWCDXCE.js → requirementDiagram-4Y6WPE33-BtdP3Ka6.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-DAJut743.js → sankeyDiagram-5OEKKPKP-Bv74oA-n.js} +1 -1
- package/dist/web/assets/{search-DniD_AGC.js → search-ClmOQd4H.js} +1 -1
- package/dist/web/assets/{select-BPdJrr5M.js → select-BB7QG08o.js} +1 -1
- package/dist/web/assets/{select-B5RYunTs.js → select-CYtYPr-c.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-CynjRGW4.js → sequenceDiagram-3UESZ5HK-DuNPl-dg.js} +1 -1
- package/dist/web/assets/{server-xswxWpKD.js → server-bEB_DY55.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-amAtpx9w.js → stateDiagram-AJRCARHV-B72HAgBJ.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Bu3l_CgB.js +1 -0
- package/dist/web/assets/{textarea-BVyPl9rM.js → textarea-BqYPvoO-.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-DZ9W7WlP.js → timeline-definition-PNZ67QCA-DTmHUgmQ.js} +1 -1
- package/dist/web/assets/{toggles-QcIz43DP.js → toggles-a5fkwT_D.js} +1 -1
- package/dist/web/assets/tooltip-DuyJMci9.js +1 -0
- package/dist/web/assets/{track-Ckye0-tt.js → track-DCjyrv3n.js} +1 -1
- package/dist/web/assets/{trash-2-CvUJsbtT.js → trash-2-CIyBqaVy.js} +1 -1
- package/dist/web/assets/tsMode-C1UXAkMh.js +11 -0
- package/dist/web/assets/typescript-Biht2wHb.js +1 -0
- package/dist/web/assets/{upload-CsXAmAun.js → upload-D05XS5-G.js} +1 -1
- package/dist/web/assets/use-profiles-CrWTyz1G.js +1 -0
- package/dist/web/assets/{use-providers-Td1-gyrN.js → use-providers-Dv1Nk6s7.js} +1 -1
- package/dist/web/assets/{use-translation-settings-NYM0lmBx.js → use-translation-settings-CcUnipVO.js} +1 -1
- package/dist/web/assets/useNormalizedLogs-D9W1cT4R.js +1 -0
- package/dist/web/assets/useTokenUsage-CZ5mDshD.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-CB2Ubvy9.js → vennDiagram-CIIHVFJN-ByoNydXe.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-BXOkk77I.js → wardley-L42UT6IY-BqdMkOLl.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-VA6ywdQQ.js → wardleyDiagram-YWT4CUSO-AO22HrEF.js} +1 -1
- package/dist/web/assets/xml-NLGqNFDv.js +1 -0
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-FNcvDj5G.js → xychartDiagram-2RQKCTM6-vzPgjgqW.js} +1 -1
- package/dist/web/assets/yaml-AWlGS_Ig.js +1 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@agent-tower/shared/dist/index.d.ts +1 -0
- package/node_modules/@agent-tower/shared/dist/index.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/index.js +1 -0
- package/node_modules/@agent-tower/shared/dist/index.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/task-handoff.d.ts +12 -0
- package/node_modules/@agent-tower/shared/dist/task-handoff.d.ts.map +1 -0
- package/node_modules/@agent-tower/shared/dist/task-handoff.js +2 -0
- package/node_modules/@agent-tower/shared/dist/task-handoff.js.map +1 -0
- package/node_modules/@agent-tower/shared/dist/translation.d.ts +12 -0
- package/node_modules/@agent-tower/shared/dist/translation.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/translation.js +19 -0
- package/node_modules/@agent-tower/shared/dist/translation.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts +28 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20261023000000_add_task_base_branch/migration.sql +2 -0
- package/prisma/migrations/20261023010000_add_subtasks/migration.sql +2 -0
- package/prisma/migrations/20261026000000_add_task_handoff/migration.sql +1 -0
- package/prisma/schema.prisma +6 -0
- package/dist/web/assets/AgentDemoPage-BfXkNCdN.js +0 -1
- package/dist/web/assets/AttachmentPreview-CLN1lnLe.js +0 -2
- package/dist/web/assets/BranchSelect-Cofp8vYf.js +0 -1
- package/dist/web/assets/BrandLogo-BUimEX-9.js +0 -1
- package/dist/web/assets/ConversationPage-R7vNaOQv.js +0 -1
- package/dist/web/assets/CreateTaskInput-CasITF8y.js +0 -1
- package/dist/web/assets/DesignSystemPage-BhjNs2vP.js +0 -12
- package/dist/web/assets/EditableTaskTitle-BJ9Rxggf.js +0 -70
- package/dist/web/assets/GeneralSettingsPage-RMN2al8I.js +0 -1
- package/dist/web/assets/McpSettingsPage-CPNxFF67.js +0 -1
- package/dist/web/assets/MobileTaskDetail-QNUHMq7u.js +0 -3
- package/dist/web/assets/NotificationSettingsPage-BEyuyu3Z.js +0 -1
- package/dist/web/assets/ProjectKanbanPage-Bt_01giW.js +0 -12
- package/dist/web/assets/ProjectSettingsPage-cus6Ns97.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-DqA_B1Ey.js +0 -67
- package/dist/web/assets/TaskDetail-rEXNe2h3.js +0 -1
- package/dist/web/assets/TeamSettingsPage-DwWROtW6.js +0 -1
- package/dist/web/assets/channel-DTP-syjA.js +0 -1
- package/dist/web/assets/check-BmiJ7qMY.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-CUKgurLa.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CUKgurLa.js +0 -1
- package/dist/web/assets/confirm-dialog-ltNBFYCs.js +0 -1
- package/dist/web/assets/content-DPQMfMae.js +0 -2
- package/dist/web/assets/cssMode-DkuSsGeg.js +0 -1
- package/dist/web/assets/dialog-CuFEdqLg.js +0 -5
- package/dist/web/assets/handlebars-B34f-LAf.js +0 -1
- package/dist/web/assets/hooks-BLxb16IA.js +0 -1
- package/dist/web/assets/html-CnvOQ63o.js +0 -1
- package/dist/web/assets/htmlMode-RdxZ8Svp.js +0 -1
- package/dist/web/assets/icon-button-CYiKa-7C.js +0 -1
- package/dist/web/assets/index-0XPZayUU.css +0 -1
- package/dist/web/assets/index-BJObbxud.js +0 -122
- package/dist/web/assets/index-DZLnTISJ.js +0 -1
- package/dist/web/assets/javascript-BhombDEO.js +0 -1
- package/dist/web/assets/jsonMode-BJGOUeaV.js +0 -7
- package/dist/web/assets/liquid-Czy1WpPz.js +0 -1
- package/dist/web/assets/mdx-DhXfoSnM.js +0 -1
- package/dist/web/assets/modal-CSGOqphK.js +0 -1
- package/dist/web/assets/popover-BiVxGGgp.js +0 -1
- package/dist/web/assets/python-DIcQDjcf.js +0 -1
- package/dist/web/assets/razor-DYK6Rxer.js +0 -1
- package/dist/web/assets/search-field-CQLDXLeA.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-V-lSceg1.js +0 -1
- package/dist/web/assets/tooltip-CPqGK_WZ.js +0 -1
- package/dist/web/assets/tsMode-c5x0d47n.js +0 -11
- package/dist/web/assets/typescript-i7eYblLt.js +0 -1
- package/dist/web/assets/use-profiles-DuXaBRju.js +0 -1
- package/dist/web/assets/use-projects-Ddz0knyr.js +0 -1
- package/dist/web/assets/use-workspaces-CdJZLmGh.js +0 -1
- package/dist/web/assets/useNormalizedLogs--RbVywYa.js +0 -1
- package/dist/web/assets/useTokenUsage-DDXf7E4p.js +0 -1
- package/dist/web/assets/xml-D2EGActB.js +0 -1
- package/dist/web/assets/yaml-jeiIZSL4.js +0 -1
- /package/dist/web/assets/{EditableTaskTitle-DcpNTP1B.css → TaskHandoffPanel-DcpNTP1B.css} +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import{c as dt,o as ct,s as mt,v as ut,u as $,r as j,j as e,n as U,a5 as ze,ab as Pe,aZ as W,a_ as P,a$ as pe,I as se,b0 as xt,b1 as pt,a0 as ae,B as A,Q as ft,i as _e,aR as gt,k as ht,b2 as vt,G as bt,b3 as yt,b4 as jt,t as M,as as Nt,m as xe,b5 as wt,az as ye}from"./index-BJObbxud.js";import{c as Pt,b as Ct,r as Fe,d as Oe,u as kt,e as Et,E as St,f as It,s as At,i as De,h as Re,a as Je,j as je,k as Tt,l as _t,m as Ot,p as Dt,n as Rt,o as Ut,q as Ue,w as Lt,t as Kt}from"./ExecutionPermissionSelector-B8befbxJ.js";import{a as Mt,b as Bt,u as zt,c as Ft,d as Jt,e as $t,f as qt,g as Gt,h as Wt}from"./use-providers-Td1-gyrN.js";import{C as Xt}from"./confirm-dialog-ltNBFYCs.js";import{M as Ce}from"./modal-CSGOqphK.js";import{S as Le}from"./select-BPdJrr5M.js";import{T as Ke}from"./textarea-BVyPl9rM.js";import{S as $e}from"./toggles-QcIz43DP.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import{C as qe}from"./chevron-down-3y5Aiolp.js";import{S as Vt}from"./SettingsMasterDetail-DjWR9Sqk.js";import{K as Yt}from"./key-round-Cjbj2qNa.js";import{T as Ge,P as Ne}from"./trash-2-CvUJsbtT.js";import{U as Ht}from"./upload-CsXAmAun.js";import{P as Zt}from"./pencil-Cp70ZwtG.js";import"./check-BmiJ7qMY.js";import"./dialog-CuFEdqLg.js";import"./index-Bhvt-E6d.js";import"./select-B5RYunTs.js";import"./menu-styles-DWynpVVz.js";import"./index-DZLnTISJ.js";import"./index-B1oVmCie.js";import"./index-CThFsQNP.js";import"./index-Dk3bRQAK.js";import"./index-BtUQYU5l.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";const Qt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],es=dt("flask-conical",Qt);function ts(){return ct({queryKey:mt.system.cursorAgentModels,queryFn:()=>ut.get("/system/cursor-agent-models"),staleTime:1e3*60*10})}function ss({value:t,onChange:i}){const{t:a}=$(),{data:u,isLoading:m,isError:C}=ts(),s=u?.models??[],[E,r]=j.useState(!1),[v,b]=j.useState(""),x=j.useMemo(()=>{const f=v.trim().toLowerCase();return f?s.filter(k=>k.id.toLowerCase().includes(f)||k.label.toLowerCase().includes(f)):s},[s,v]);return e.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-w-0",children:[e.jsx("input",{type:"text",value:t,onChange:f=>{const k=f.target.value;i(k===""?void 0:k)},placeholder:a("留空为 auto;或直接输入模型 ID(与 cursor-agent --model 一致)"),className:"w-full px-3 py-1.5 text-sm border border-border rounded focus:outline-none focus:ring-1 focus:ring-ring/60 font-mono"}),e.jsxs("button",{type:"button",onClick:()=>r(f=>!f),disabled:m,className:"flex items-center gap-1 text-xs text-foreground/70 hover:text-foreground disabled:opacity-50 w-fit",children:[e.jsx(qe,{size:14,className:U("transition-transform",E&&"rotate-180")}),m?a("正在加载 cursor-agent 模型列表…"):E?a("收起列表"):a("从本机 cursor-agent 选择({count} 个)",{count:s.length})]}),E&&!m&&e.jsxs("div",{className:"rounded-lg border border-border bg-background shadow-raised overflow-hidden",children:[e.jsx("input",{type:"text",value:v,onChange:f=>b(f.target.value),placeholder:a("筛选模型…"),className:"w-full px-3 py-2 text-sm border-b border-border/60 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-ring/60"}),e.jsxs("div",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",children:[e.jsx("button",{type:"button",onClick:()=>{i(void 0),r(!1),b("")},className:U("w-full px-3 py-2 text-left text-sm hover:bg-accent",t?"text-foreground/80":"bg-muted/50 font-medium"),children:a("默认 (auto)")}),x.map(f=>e.jsxs("button",{type:"button",onClick:()=>{i(f.id),r(!1),b("")},className:U("w-full px-3 py-2 text-left text-sm hover:bg-accent border-t border-border/60",t===f.id?"bg-foreground/[0.06]":""),children:[e.jsx("div",{className:"font-mono text-xs text-foreground break-all",children:f.id}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 break-words",children:f.label})]},f.id)),x.length===0&&e.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground text-center",children:a("无匹配项")})]})]}),(C||u?.error)&&e.jsxs("p",{className:"text-xs text-warning-ink",children:[a("无法从本机加载模型列表({error})。仍可手动输入;或在安装 cursor-agent 的机器上运行",{error:u?.error??a("请求失败")}),e.jsx("code",{className:"mx-0.5 bg-muted px-1 rounded text-[11px]",children:"cursor-agent --list-models"}),a("查看 ID。")]})]})}function ns(t){if(!t)return null;try{const i=new URL(t);return i.protocol!=="http:"&&i.protocol!=="https:"?null:`${i.origin}${i.pathname}`}catch{return null}}function rs(t,i){if(!t)return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:new Intl.DateTimeFormat(i,{dateStyle:"medium",timeStyle:"medium"}).format(a)}function is({result:t}){const{locale:i,t:a}=$(),u=ns(t.target?.endpoint),m=rs(t.testedAt,i);return e.jsx("div",{"data-provider-test-result":!0,className:U("rounded-lg border px-4 py-3 text-sm",t.ok?"border-success/30 bg-success/10 text-success-ink":"border-warning/30 bg-warning/10 text-foreground"),children:e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t.ok?e.jsx(ze,{size:16,className:"shrink-0"}):e.jsx(Pe,{size:16,className:"shrink-0 text-warning"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium",children:t.ok?t.stage==="connection"?a("连接测试通过"):a("本机可用性检查通过"):a("配置检查未通过")}),e.jsx("div",{className:"mt-0.5 break-words text-xs opacity-80",children:t.summary}),(u||m)&&e.jsxs("dl",{className:"mt-2 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs opacity-80",children:[u&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"font-medium",children:a("测试对象")}),e.jsx("dd",{className:"min-w-0",children:e.jsx("code",{className:"break-all",children:u})})]}),m&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"font-medium",children:a("测试时间")}),e.jsx("dd",{className:"min-w-0 break-words",children:e.jsx("time",{dateTime:t.testedAt,children:m})})]})]}),!t.ok&&e.jsx("div",{className:"mt-1 text-xs opacity-80",children:a("测试失败不会阻止保存。")})]})]})})}function as({options:t,value:i,onChange:a,label:u,efficiencyLabel:m,intelligenceLabel:C,followCliLabel:s,currentLabel:E,disabled:r=!1,error:v}){const b=t.findIndex(g=>g.value===i),x=i==="",f=j.useRef(b>=0?i:void 0),k=j.useRef(null),S=j.useRef(null),[B,J]=j.useState(!1);j.useEffect(()=>{b>=0&&(f.current=i)},[b,i]);const q=g=>{if(r||x||t.length===0)return;const w=t[Math.max(0,Math.min(t.length-1,g))];w&&w.value!==i&&a(w.value)},X=g=>{const w=S.current?.getBoundingClientRect();if(!w||w.width<=0)return;const G=Math.max(0,Math.min(1,(g-w.left)/w.width));q(Math.round(G*(t.length-1)))},L=b>=0?t[b]:void 0,K=b<0||t.length<2?0:b/(t.length-1)*100,R=j.useId(),V=`${R}-label`,T=`${R}-current`,O=`${R}-error`;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex min-h-8 items-center justify-between gap-3",children:[e.jsx("label",{id:V,className:"text-xs font-medium text-foreground",children:u}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e.jsx($e,{checked:x,disabled:r,onCheckedChange:g=>{a(g?"":f.current??t.find(w=>w.value==="medium")?.value??t[0]?.value??"")},"aria-label":s})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground","aria-hidden":"true",children:[e.jsx("span",{children:m}),e.jsx("span",{children:C})]}),e.jsxs("div",{id:R,ref:S,role:"slider",tabIndex:x||r?-1:0,"aria-labelledby":V,"aria-disabled":x||r,"aria-valuemin":0,"aria-valuemax":Math.max(0,t.length-1),"aria-valuenow":b>=0?b:void 0,"aria-valuetext":L?`${L.label}, ${L.value}`:s,"aria-describedby":v?`${T} ${O}`:T,onKeyDown:g=>{if(x||r||b<0)return;let w=b;if(g.key==="ArrowLeft"||g.key==="ArrowDown")w-=1;else if(g.key==="ArrowRight"||g.key==="ArrowUp")w+=1;else if(g.key==="Home")w=0;else if(g.key==="End")w=t.length-1;else return;g.preventDefault(),q(w)},onPointerDown:g=>{x||r||(k.current=g.pointerId,J(!0),g.currentTarget.setPointerCapture?.(g.pointerId),X(g.clientX))},onPointerMove:g=>{k.current===g.pointerId&&X(g.clientX)},onPointerUp:g=>{k.current===g.pointerId&&(k.current=null,J(!1),g.currentTarget.releasePointerCapture?.(g.pointerId))},onPointerCancel:()=>{k.current=null,J(!1)},className:U("relative mx-2.5 flex h-11 touch-pan-y items-center outline-none select-none",x||r?"cursor-not-allowed opacity-55":"cursor-pointer","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2"),children:[e.jsx("div",{className:"absolute inset-x-0 h-1 rounded-full bg-border"}),!x&&e.jsx("div",{className:"absolute left-0 h-1 rounded-full bg-primary transition-[width] duration-150 motion-reduce:transition-none",style:{width:`${K}%`}}),t.map((g,w)=>e.jsx("span",{"aria-hidden":"true",className:U("absolute size-3 -translate-x-1/2 rounded-full border-2 transition-colors motion-reduce:transition-none",!x&&w<=b?"border-primary bg-primary":"border-border bg-background"),style:{left:`${t.length<2?0:w/(t.length-1)*100}%`}},g.value)),!x&&L&&e.jsx("span",{"aria-hidden":"true",className:U("absolute size-5 -translate-x-1/2 rounded-full border-[5px] border-primary bg-background shadow-raised transition-[left,transform] duration-150 motion-reduce:transition-none",B&&"scale-110"),style:{left:`${K}%`}})]}),e.jsx("div",{id:T,className:"min-h-5 text-center text-xs text-muted-foreground",children:x?s:`${E}: ${L?.label??i} (${L?.value??i})`}),v&&e.jsx("p",{id:O,role:"alert",className:"text-xs text-destructive-ink",children:v})]})}const F={key:"appendPrompt",label:"追加 Prompt",type:"textarea",rows:3,placeholder:"追加到每次 prompt 末尾的文本"},We={[P.CLAUDE_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},F],[P.GEMINI_CLI]:[{key:"yolo",label:"自动批准操作(YOLO)",type:"switch"},F],[P.CURSOR_AGENT]:[{key:"force",label:"强制执行",type:"switch"},F],[P.CODEX]:[{key:"dangerouslyBypassApprovalsAndSandbox",label:"跳过所有确认和沙盒",type:"switch"},{key:"fastMode",label:"Fast 模式",type:"switch"},{key:"disableResponsesWebsocket",label:"禁用 WebSocket",type:"switch"},{key:"profile",label:"Profile",type:"input",placeholder:"~/.codex/config.toml 中的 profile 名称"},F],[P.QWEN_CODE]:[F],[P.KIRO_CLI]:[{key:"trustAllTools",label:"信任所有工具",type:"switch"},F],[P.OPENCODE]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},F],[P.PI_CODING_AGENT]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},{key:"supportsImages",label:"模型支持图片输入",type:"switch"},F],[P.GROK_BUILD]:[{key:"alwaysApprove",label:"始终批准操作",type:"switch"},F],[P.MINION_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},F]};function Me(){return{}}function Xe(t,i){return{...i}}const os=JSON.stringify({env:{ANTHROPIC_API_KEY:"",ANTHROPIC_BASE_URL:""}},null,2),ls=`# Codex config.toml 配置片段 — 通过 -c 参数注入,不会修改 ~/.codex/config.toml
|
|
2
|
-
# 参考: https://developers.openai.com/codex/config-sample
|
|
3
|
-
|
|
4
|
-
# ─── 模型与推理 ─────────────────────────────────────────────
|
|
5
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh | max | ultra
|
|
6
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
7
|
-
# model_verbosity = "medium" # low | medium | high
|
|
8
|
-
# service_tier = "fast"
|
|
9
|
-
# features.fast_mode = true
|
|
10
|
-
|
|
11
|
-
# ─── 自定义 Model Provider ──────────────────────────────────
|
|
12
|
-
# model_provider = "azure"
|
|
13
|
-
#
|
|
14
|
-
# [model_providers.azure]
|
|
15
|
-
# name = "Azure OpenAI"
|
|
16
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
17
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
18
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
19
|
-
# wire_api = "responses"
|
|
20
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
21
|
-
|
|
22
|
-
# ─── OpenAI 数据驻留 ────────────────────────────────────────
|
|
23
|
-
# [model_providers.openai-us]
|
|
24
|
-
# name = "OpenAI US"
|
|
25
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
26
|
-
# wire_api = "responses"
|
|
27
|
-
# requires_openai_auth = true
|
|
28
|
-
|
|
29
|
-
# ─── 本地 OSS (Ollama) ──────────────────────────────────────
|
|
30
|
-
# [model_providers.ollama]
|
|
31
|
-
# name = "Ollama"
|
|
32
|
-
# base_url = "http://localhost:11434/v1"
|
|
33
|
-
# wire_api = "responses"
|
|
34
|
-
`,ds=`# Codex config.toml snippet — injected through -c; ~/.codex/config.toml is not modified.
|
|
35
|
-
# Reference: https://developers.openai.com/codex/config-sample
|
|
36
|
-
|
|
37
|
-
# ─── Model and reasoning ────────────────────────────────────
|
|
38
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh | max | ultra
|
|
39
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
40
|
-
# model_verbosity = "medium" # low | medium | high
|
|
41
|
-
# service_tier = "fast"
|
|
42
|
-
# features.fast_mode = true
|
|
43
|
-
|
|
44
|
-
# ─── Custom Model Provider ──────────────────────────────────
|
|
45
|
-
# model_provider = "azure"
|
|
46
|
-
#
|
|
47
|
-
# [model_providers.azure]
|
|
48
|
-
# name = "Azure OpenAI"
|
|
49
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
50
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
51
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
52
|
-
# wire_api = "responses"
|
|
53
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
54
|
-
|
|
55
|
-
# ─── OpenAI data residency ──────────────────────────────────
|
|
56
|
-
# [model_providers.openai-us]
|
|
57
|
-
# name = "OpenAI US"
|
|
58
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
59
|
-
# wire_api = "responses"
|
|
60
|
-
# requires_openai_auth = true
|
|
61
|
-
|
|
62
|
-
# ─── Local OSS (Ollama) ─────────────────────────────────────
|
|
63
|
-
# [model_providers.ollama]
|
|
64
|
-
# name = "Ollama"
|
|
65
|
-
# base_url = "http://localhost:11434/v1"
|
|
66
|
-
# wire_api = "responses"
|
|
67
|
-
`;function cs(t,i){return t===P.CLAUDE_CODE?os:t===P.CODEX?i==="zh-CN"?ls:ds:""}function ms(t){return t===P.CLAUDE_CODE||t===P.CODEX}const we="::ACP";function Be(t,i){return i===W.ACP?`${t}${we}`:String(t)}function oe(t,i){const a=jt(t);return i===W.ACP?`${a} (ACP)`:a}function us(t){return t.endsWith(we)?{agentType:t.slice(0,-we.length),runtimeType:W.ACP}:{agentType:t,runtimeType:W.CLI}}function xs(t,i){if(!t.trim())return t;try{const a=JSON.parse(t);if(!a.env||typeof a.env!="object"||Array.isArray(a.env))return t;const u=a.env;return i in u?(delete u[i],JSON.stringify(a,null,2)):t}catch{return t}}const Ve=Object.values(We).flat().reduce((t,i)=>(t[i.key]||(t[i.key]=i.label),t),{});Ve.permissionMode="权限策略";const Ye=Object.values(We).flat().reduce((t,i)=>(i.options&&(t[i.key]=Object.fromEntries(i.options.map(a=>[a.value,a.label]))),t),{});Ye.permissionMode={ASK:"每次询问",AUTO_APPROVE:"无限制",UNRESTRICTED:"无限制"};function ps(t,i){if(typeof i=="boolean")return i?ye("是"):ye("否");if(typeof i=="string"&&i){const a=Ye[t]?.[i];return a?ye(a):i}return String(i)}function H(t,i){return t instanceof Error?t.message:i}function fs(t){return t==="apiBaseUrl"?"API 地址":t==="apiKey"?"API Key":t==="reasoningEffort"?"思考强度":t==="model"?"模型":t==="executionPermission"?"执行权限":t==="fastMode"?"Fast 模式":t==="disableResponsesWebsocket"?"禁用 WebSocket":t}function gs(t){return{minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最高",ultra:"Ultra"}[t]??t}function hs(t){return`agent-tower-provider-backup-${t.replace(/[:.]/g,"-")}.json`}function vs(t,i){const a=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),u=URL.createObjectURL(a),m=document.createElement("a");m.href=u,m.download=t,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(u)}function bs(t){switch(t){case"CREATE":return{label:"新增",className:"bg-success/10 text-success-ink"};case"OVERWRITE":return{label:"覆盖",className:"bg-warning/10 text-warning-ink"};case"SKIP":return{label:"跳过",className:"bg-muted text-muted-foreground"}}}function ys({issue:t}){const{t:i}=$(),a=!t;return e.jsx("span",{className:U("inline-block h-2 w-2 rounded-full shrink-0",a?"bg-success":"bg-border"),title:t?`${i("不可用")}: ${i(t)}`:i("可用"),children:e.jsx("span",{className:"sr-only",children:i(a?"可用":"不可用")})})}function js({issue:t}){const{t:i}=$();return t?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[e.jsx(wt,{size:11,"aria-hidden":"true"}),i("不可用")]}):e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/10 px-2 py-0.5 text-xs font-medium text-success-ink",children:[e.jsx(ze,{size:11,"aria-hidden":"true"}),i("可用")]})}function Ns({title:t,status:i,defaultOpen:a=!1,children:u}){const[m,C]=j.useState(a);return e.jsxs("div",{className:"rounded-lg border border-border",children:[e.jsxs("button",{type:"button",onClick:()=>C(s=>!s),"aria-expanded":m,className:"w-full flex items-center justify-between rounded-lg px-4 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t}),i]}),e.jsx(qe,{size:14,"aria-hidden":"true",className:U("text-muted-foreground transition-transform motion-reduce:transition-none",m&&"rotate-180")})]}),m&&e.jsx("div",{className:"px-4 pb-4 space-y-3",children:u})]})}function ws({isOpen:t,onClose:i,providerId:a,initialData:u,onSave:m}){const{locale:C,t:s}=$(),E=Mt(),[r,v]=j.useState(u??{name:"",agentType:P.CLAUDE_CODE,runtimeType:W.CLI,executionPermission:"ASK",config:Me(),settings:"",env:[],simplified:{apiKey:{configured:!1,envKey:"ANTHROPIC_API_KEY"}},diagnostics:[],isDefault:!1}),[b,x]=j.useState(()=>JSON.stringify(r.config,null,2)),[f,k]=j.useState(""),[S,B]=j.useState(()=>r.diagnostics?.find(n=>n.field==="settings")?.message??""),[J,q]=j.useState(!1),[X,L]=j.useState(!1),[K,R]=j.useState(null),[V,T]=j.useState(()=>new Set),[O,g]=j.useState(()=>r.diagnostics?.filter(n=>n.code==="CONFLICT")??[]),[w,G]=j.useState({}),Z=j.useRef(Pt()),{data:fe}=Bt(r.agentType,r.simplified.model,{providerId:a,runtimeType:r.runtimeType,config:r.config,settings:r.settings}),y=fe?.[r.agentType]??pe[r.agentType],z=y.apiBaseUrl?Ct(r.simplified.apiBaseUrl):null,le=Fe(r),Q=r.executionPermission??le.mode,ne=y.executionPermissionOptions?.[r.runtimeType],de=ne?.find(n=>n.mode===Q),Y=le.diagnostics[0]?.message??(ne?de?.selectable?null:de?.reasons[0]?.message??s("This Agent has no available execution permission mode."):s("Loading permission support…")),c=y.disableResponsesWebsocket,p=c?Oe(r.config,c):null,I=y.fastMode,D=I?Oe(r.config,I):null,ke=I?r.config[I.path]:void 0,He=ke===!0?"fast":ke===!1?"standard":"inherit",ge=r.simplified.reasoningEffort??"",ce=ge&&!y.reasoningEffort?.options?.includes(ge)?s("请选择当前 Agent 支持的思考强度档位"):null,he=n=>{Z.current.invalidate(),n&&v(n),L(!0),R(null)},_=n=>{he(n)},Ee=()=>{X&&!window.confirm(s("存在未保存的修改,确定放弃吗?"))||i()},Ze=n=>r.env.find(o=>je(o.key,n)),re=(n,o,l="")=>{if(o.action!=="keep"){const d=n===y.apiBaseUrl?.path?"apiBaseUrl":n===y.apiKey?.path?"apiKey":null;d&&G(h=>{const N={...h};return delete N[d],N})}_(d=>{const h=d.env.findIndex(lt=>je(lt.key,n)),N=[...d.env],te=h>=0?N[h]:null,ie={key:te?.key??n,value:l,write:o,configured:te?.configured??!1,sensitive:je(n,d.simplified.apiKey?.envKey)||!!te?.sensitive||/key|token|secret|password|auth/i.test(n)};h>=0?N[h]=ie:N.push(ie);const ot=d.agentType===P.CLAUDE_CODE&&o.action!=="keep"&&(n===y.apiBaseUrl?.path||n===y.apiKey?.path);return{...d,env:N,settings:ot?xs(d.settings,n):d.settings}})},me=(n,o)=>{G(l=>{if(!(n in l))return l;const d={...l};return delete d[n],d}),T(l=>new Set(l).add(n)),n==="apiBaseUrl"&&y.apiBaseUrl?.kind==="env"&&re(y.apiBaseUrl.path,o?{action:"replace",value:o}:{action:"clear"},o),_(l=>{const d=Ut(l,n,o,y);return d.config!==l.config&&x(JSON.stringify(d.config,null,2)),d})},Qe=n=>{c&&_(o=>{const l=Ue(o,c,n);return x(JSON.stringify(l.config,null,2)),l})},et=n=>{I&&_(o=>{const l=Ue(o,I,n==="inherit"?void 0:n==="fast");return x(JSON.stringify(l.config,null,2)),l})},tt=n=>{if(X&&!window.confirm(s("切换 Agent 类型会清空当前类型的配置,是否继续?")))return;const{agentType:o,runtimeType:l}=us(n),d=pe[o],h=Me(),N={...r,agentType:o,runtimeType:l,executionPermission:Q,executionPermissionReviewRequired:void 0,config:h,settings:"",env:[],simplified:{apiKey:d.apiKey?{configured:!1,envKey:d.apiKey.path}:void 0}};he(()=>N),x(JSON.stringify(h,null,2)),k(""),B(""),q(!1),T(new Set),g([]),G({})},Se=(n=!1)=>{let o=!f&&!Y&&!D?.error&&!p?.error&&!ce;const l=r.settings.trim();if(l&&(J||n))try{if(r.agentType===P.CODEX)Dt(l);else if(r.agentType===P.CLAUDE_CODE){const d=JSON.parse(l);if(!d||typeof d!="object"||Array.isArray(d))throw new Error(s("JSON 顶层必须是对象"))}B("")}catch(d){B(s("{format} 语法错误: {message}",{format:r.agentType===P.CODEX?"TOML":"JSON",message:d instanceof Error?d.message:String(d)})),o=!1}return o},Ie=()=>{const n=Rt(r.env),o=Object.fromEntries([...V].map(l=>[l,r.simplified[l]]));return{providerId:a,name:r.name,agentType:r.agentType,runtimeType:r.runtimeType,executionPermission:Q,env:n,config:r.config,settings:r.settings,simplified:V.size>0?o:void 0,conflictResolutions:w,isDefault:r.isDefault}},st=()=>{if(z||!Se(!1))return;const o={...Ie()};delete o.providerId,a&&delete o.runtimeType,m(o)},nt=()=>{if(z||O.length>0||!Se(!0))return;const n=Z.current.begin();R(null),E.mutate(Ie(),{onSuccess:o=>{Z.current.isCurrent(n)&&R(o)},onError:o=>{Z.current.isCurrent(n)&&R({ok:!1,stage:"connection",errorKind:"unknown",summary:H(o,s("测试配置失败"))})}})};if(!t)return null;const rt=ms(r.agentType),ue=r.agentType===P.CODEX,ve=ue&&kt(r.settings),ee=r.simplified.apiKey?.envKey??y.apiKey?.path,be=ee?Ze(ee):void 0,Ae=Et(be,!!r.simplified.apiKey?.configured,w.apiKey),it=Ae==="advanced",Te=Ae!=="unconfigured",at=!r.name.trim()||!!z||!!f||!!Y||!!D?.error||!!p?.error||!!ce||!!S&&J||O.length>0;return e.jsx(e.Fragment,{children:e.jsx(Ce,{isOpen:t,onClose:Ee,title:s(u?"编辑 Provider":"新建 Provider"),className:"max-w-3xl",action:e.jsxs("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(A,{variant:"outline",onClick:nt,disabled:E.isPending||!!z||!!f||!!Y||!!D?.error||!!p?.error||!!ce||!!S&&J||O.length>0,children:[E.isPending?e.jsx(ft,{className:"animate-spin motion-reduce:[animation-duration:2.4s]"}):e.jsx(es,{}),E.isPending?s("测试中..."):s("测试配置")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(A,{variant:"outline",onClick:Ee,children:s("取消")}),e.jsx(A,{onClick:st,disabled:at,children:s("保存 Provider")})]})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-name",className:"mb-1 block text-xs font-medium text-foreground",children:s("名称")}),e.jsx(se,{id:"provider-name",value:r.name,onChange:n=>_(o=>({...o,name:n.target.value})),placeholder:s("例如: Claude Code (官方)")})]}),!u&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("Agent 类型")}),e.jsx(Le,{value:Be(r.agentType,r.runtimeType),onChange:tt,options:xt.flatMap(n=>pt[n].map(o=>({value:Be(n,o),label:oe(n,o),icon:e.jsx(ae,{agentType:n,className:"size-4"})}))),placeholder:s("选择 Agent 类型")})]}),u&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("Agent 类型")}),e.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 text-sm text-muted-foreground",children:[e.jsx(ae,{agentType:r.agentType,className:"size-4"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(r.agentType,r.runtimeType)})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"isDefault",checked:r.isDefault,onChange:n=>_(o=>({...o,isDefault:n.target.checked})),className:"h-4 w-4 rounded border-border accent-primary"}),e.jsx("label",{htmlFor:"isDefault",className:"text-sm text-foreground",children:s("设为该类型的默认 Provider")})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/20 p-4",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:s("基本配置")}),e.jsx(St,{value:Q,agentType:r.agentType,options:ne,error:Y,onChange:n=>_(o=>{const l=Lt(o.agentType,o.config);return x(JSON.stringify(l,null,2)),{...o,executionPermission:n,executionPermissionReviewRequired:void 0,config:l}})}),y.apiBaseUrl&&!ve&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-api-url",className:"mb-1 block text-xs font-medium text-foreground",children:s("API 地址")}),e.jsx(se,{id:"provider-api-url",type:"url",value:r.simplified.apiBaseUrl??"",onChange:n=>me("apiBaseUrl",n.target.value),placeholder:y.apiBaseUrl.placeholder,"aria-invalid":!!z,"aria-describedby":z?"provider-api-url-error":void 0}),z&&e.jsx("p",{id:"provider-api-url-error",role:"alert",className:"mt-1 text-xs text-destructive-ink",children:s("请输入以 http:// 或 https:// 开头的完整 API 地址")})]}),y.apiKey&&!ve&&(r.agentType!==P.CODEX||!!r.simplified.apiKey)&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:"provider-api-key",className:"text-xs font-medium text-foreground",children:"API Key"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Yt,{size:12}),s(it?"由高级配置管理":Te?"已配置":"未配置")]})]}),be?.write.action==="replace"||!Te?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(se,{id:"provider-api-key",type:"password",autoComplete:"new-password",value:be?.value??"",onChange:n=>re(ee,{action:"replace",value:n.target.value},n.target.value),placeholder:s("输入 API Key")}),r.simplified.apiKey?.configured&&e.jsx(A,{variant:"outline",size:"sm",onClick:()=>re(ee,{action:"keep"}),children:s("取消替换")})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx(A,{variant:"outline",size:"sm",onClick:()=>re(ee,{action:"replace",value:""}),children:s("替换")}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>{window.confirm(s("确定清除此 API Key?"))&&re(ee,{action:"clear"})},children:s("清除")})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"provider-model",className:"mb-1 block text-xs font-medium text-foreground",children:s("模型")}),r.agentType===P.CURSOR_AGENT?e.jsx(ss,{value:r.simplified.model??"",onChange:n=>me("model",n??"")}):e.jsx(se,{id:"provider-model",value:r.simplified.model??"",onChange:n=>me("model",n.target.value),placeholder:y.model.placeholder})]}),y.reasoningEffort&&e.jsx(as,{options:(y.reasoningEffort.options??[]).map(n=>({value:n,label:s(gs(n))})),value:ge,onChange:n=>me("reasoningEffort",n),label:s("思考强度"),efficiencyLabel:s("更高效"),intelligenceLabel:s("更智能"),followCliLabel:s("跟随 CLI"),currentLabel:s("当前"),error:ce}),I&&D&&e.jsxs("section",{className:"border-t border-border pt-3","data-fast-mode-control":!0,children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_180px] sm:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:s("Fast 模式")}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:s("支持的模型速度约提升至 1.5 倍,并增加用量消耗。ChatGPT 登录消耗更多额度;API Key 按 Priority 处理计费。")})]}),e.jsx(Le,{value:He,disabled:!!D.error,onChange:et,options:[{value:"inherit",label:s("跟随 Codex")},{value:"standard",label:s("标准速度")},{value:"fast",label:"Fast"}]})]}),D.error&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive-ink",children:s("Fast 模式字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]}),c&&p&&e.jsxs("section",{className:"border-t border-border pt-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-medium text-foreground",children:s("禁用 WebSocket")}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:s(ve?"当前原生 Provider 已使用非 WebSocket 传输;此开关不会添加额外运行时覆盖。":"仅禁用 Codex Responses API 的 WebSocket 传输;新启动和后续继续的请求将使用 HTTP。")})]}),e.jsx($e,{checked:p.enabled,disabled:!!p.error,onCheckedChange:Qe,"aria-label":s("禁用 WebSocket")})]}),p.error&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive-ink",children:s("禁用 WebSocket 字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]})]}),K&&e.jsx(is,{result:K}),O.length>0&&e.jsxs("div",{className:"space-y-3 rounded-lg border border-warning/30 bg-warning/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Pe,{size:16,className:"text-warning"}),s("需要解决配置冲突")]}),O.map(n=>e.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-warning/20 bg-background/70 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:s(fs(n.field))})," · ",s("简化字段与高级配置值不同")]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["simple","advanced"].map(o=>e.jsx(A,{variant:"outline",size:"sm",onClick:()=>{const l=n.field,d=It(r,l,o,y);_(()=>d),x(JSON.stringify(d.config,null,2)),G(h=>({...h,[l]:o})),o==="advanced"&&(l==="apiBaseUrl"||l==="model"||l==="reasoningEffort")&&T(h=>{const N=new Set(h);return N.delete(l),N}),g(h=>h.filter(N=>N.field!==l))},children:s(o==="simple"?"采用简化值":"保留高级值")},o))})]},n.field))]}),e.jsxs(Ns,{title:s("高级配置"),defaultOpen:!!f||!!S||!!Y||!!D?.error||O.length>0,children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:s("运行配置 (JSON)")}),e.jsx(Ke,{value:b,onChange:n=>{const o=n.target.value;x(o);try{const l=JSON.parse(o);if(!l||typeof l!="object"||Array.isArray(l))throw new Error(s("JSON 顶层必须是对象"));const d=l;k(""),T(h=>{const N=new Set(h).add("model");return y.reasoningEffort?.kind==="config"&&N.add("reasoningEffort"),N}),_(h=>({...h,config:d,simplified:At(h.simplified,d,y)}))}catch(l){he(),k(l instanceof Error?l.message:s("JSON 语法错误"))}},rows:7,className:"font-mono","aria-invalid":!!f}),f&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive-ink",children:f})]}),e.jsxs("div",{className:"border-t border-border pt-3",children:[e.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:s("环境变量")}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[s("注入到 Agent 进程的环境变量。Codex 的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"env_key"})," ",s("指定的是变量名,实际值需在此处设置。")]}),e.jsxs("div",{className:"space-y-2",children:[r.env.map((n,o)=>n.write.action!=="clear"&&e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(se,{value:n.key,disabled:n.configured,onChange:l=>{const d=l.target.value;_(h=>{const N=[...h.env],te=N[o];if(!te)return h;const ie={...te,key:d};return N[o]={...ie,sensitive:De(ie,h.simplified)},{...h,env:N}})},placeholder:s("变量名,如 AZURE_OPENAI_API_KEY"),className:"flex-1 py-1.5 font-mono"}),e.jsx(se,{value:n.value,type:De(n,r.simplified)?"password":"text",onChange:l=>{const d=[...r.env];d[o]={...d[o],value:l.target.value,write:{action:"replace",value:l.target.value}},_(h=>({...h,env:d,simplified:n.key===y.apiBaseUrl?.path?{...h.simplified,apiBaseUrl:l.target.value}:h.simplified})),n.key===y.apiBaseUrl?.path&&T(h=>new Set(h).add("apiBaseUrl"))},placeholder:n.configured&&n.write.action==="keep"?s("已配置,输入新值以替换"):s("值"),className:"flex-1 py-1.5 font-mono"}),e.jsx("button",{type:"button",onClick:()=>{const l=[...r.env];n.configured?l[o]={...n,value:"",write:{action:"clear"}}:l.splice(o,1),_(d=>({...d,env:l,simplified:n.key===y.apiBaseUrl?.path?{...d.simplified,apiBaseUrl:""}:d.simplified})),n.key===y.apiBaseUrl?.path&&T(d=>new Set(d).add("apiBaseUrl"))},"aria-label":s("删除"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:e.jsx(Ge,{size:14})})]},o)),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>_(n=>({...n,env:[...n.env,{key:"",value:"",write:{action:"replace",value:""},configured:!1,sensitive:!1}]})),children:[e.jsx(Ne,{size:12,className:"mr-1"}),s("添加变量")]})]})]}),rt&&e.jsxs("div",{className:"border-t border-border pt-3",children:[e.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:s(ue?"Agent 原生配置 (config.toml)":"Agent 原生配置 (settings.json)")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:ue?e.jsxs(e.Fragment,{children:[s("直接填写 Codex")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"config.toml"})," ",s("格式的配置片段,由当前 Runtime 注入。不会修改你的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"~/.codex/config.toml"})," ",s("文件。")]}):e.jsxs(e.Fragment,{children:[s("对应 Claude Code 的")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"~/.claude/settings.json"}),",",s("由当前 Runtime 注入。在")," ",e.jsx("code",{className:"rounded bg-muted px-1",children:"env"})," ",s("中设置 ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL 等。")]})}),e.jsx(Ke,{value:r.settings,onChange:n=>{const o=n.target.value;q(!0),B("");let l;if(ue)try{l=Re(r.simplified,o,P.CODEX),T(d=>new Set(d).add("reasoningEffort"))}catch{}_(d=>{const h=l===void 0?d.simplified:Re(d.simplified,o,P.CODEX,new Set(d.env.flatMap(N=>N.write.action==="clear"?[]:N.write.action==="replace"?N.value?[N.key]:[]:N.configured?[N.key]:[])));return{...d,settings:o,env:Kt(d.env,h),simplified:h}})},rows:10,className:"font-mono",placeholder:cs(r.agentType,C),"aria-invalid":!!S}),S&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive-ink",children:S})]})]})]})})})}function Ps({isOpen:t,onClose:i,onConfirm:a,acknowledged:u,onAcknowledgedChange:m,isLoading:C}){const{t:s}=$();return e.jsx(Ce,{isOpen:t,onClose:i,title:s("导出 Provider 备份"),className:"max-w-xl",action:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"outline",onClick:i,disabled:C,children:s("取消")}),e.jsx(A,{onClick:a,disabled:!u||C,children:s(C?"导出中...":"导出备份")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-warning/30 bg-warning/10 px-4 py-3 text-sm text-foreground",children:[e.jsx(Pe,{size:15,className:"mt-0.5 shrink-0 text-warning","aria-hidden":"true"}),e.jsx("span",{children:s("导出的备份文件将包含完整的 Provider 配置,包括环境变量、CLI settings 等敏感信息。任何拿到文件的人都可能直接使用这些 Provider。")})]}),e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:s("这个功能用于备份和迁移,不用于分享配置。")}),e.jsx("p",{children:s("导出内容只包含用户层配置:自定义 Provider,以及对内置 Provider 的覆盖。")})]}),e.jsxs("label",{className:"flex items-start gap-3 rounded-lg border border-border px-4 py-3 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:E=>m(E.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsx("span",{children:s("我已知晓该备份文件包含敏感信息,只会保存在安全位置。")})]})]})})}function Cs({isOpen:t,onClose:i,preview:a,backup:u,onConfirm:m,isLoading:C}){const{t:s}=$();if(!a||!u)return null;const E=a.summary.create+a.summary.overwrite,r=[...a.items].sort((v,b)=>{const x={CREATE:0,OVERWRITE:1,SKIP:2};return x[v.action]-x[b.action]});return e.jsx(Ce,{isOpen:t,onClose:i,title:s("导入 Provider 备份"),className:"max-w-3xl",action:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"outline",onClick:i,disabled:C,children:s("取消")}),e.jsx(A,{onClick:m,disabled:E===0||C,children:C?s("导入中..."):s("确认导入 {count} 项",{count:E})})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx("div",{children:s("导出时间:{value}",{value:new Date(u.exportedAt).toLocaleString()})}),e.jsx("div",{children:s("模式:完整备份(含敏感信息)")}),e.jsx("div",{children:s("文件内 Provider 数量:{count}",{count:u.providers.length})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-success/25 bg-success/10 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-success-ink",children:s("新增")}),e.jsx("div",{className:"text-[15px] font-semibold text-foreground",children:a.summary.create})]}),e.jsxs("div",{className:"rounded-lg border border-warning/25 bg-warning/10 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-warning-ink",children:s("覆盖")}),e.jsx("div",{className:"text-[15px] font-semibold text-foreground",children:a.summary.overwrite})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s("跳过")}),e.jsx("div",{className:"text-[15px] font-semibold text-foreground",children:a.summary.skip})]})]}),e.jsx("div",{className:"max-h-[420px] overflow-y-auto space-y-3 pr-1",children:r.map(v=>{const b=bs(v.action);return e.jsxs("div",{className:"rounded-lg border border-border px-4 py-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"truncate text-sm font-medium text-foreground",children:v.incoming.name}),e.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${b.className}`,children:s(b.label)})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ae,{agentType:v.incoming.agentType,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(v.incoming.agentType,v.incoming.runtimeType)})," · ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:v.incoming.id})]})]})}),v.action==="OVERWRITE"&&v.existing&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("将覆盖当前已有的 Provider:{name}",{name:v.existing.name})}),v.action==="SKIP"&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("当前同 ID Provider 配置一致,本次不会重复写入。")}),v.action==="CREATE"&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:s("当前不存在同 ID Provider,将直接新增。")})]},v.incoming.id)})})]})})}function ks({item:t,onEdit:i,onDelete:a}){const{t:u}=$(),m=t.provider,C=Je(t),s=Tt(m),E=Xe(m.agentType,m.config),r=pe[m.agentType],v=Object.entries(E).filter(([x])=>x!=="cmd"&&x!==r.executionPermission.path),b=Object.keys(m.redactedEnv||{});return e.jsxs("div",{className:"min-w-0 space-y-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx("h3",{className:"min-w-0 truncate text-base font-semibold text-foreground",children:m.name}),e.jsx(js,{issue:C})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[e.jsx(ae,{agentType:m.agentType,className:"size-3.5"}),e.jsx("span",{className:"truncate",children:oe(m.agentType,m.runtimeType)})]}),m.isDefault&&e.jsx("span",{className:"rounded-full bg-primary/[0.06] px-2 py-0.5 text-xs font-medium text-primary",children:u("默认")}),m.builtIn&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:u("内置")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:shrink-0",children:[e.jsxs(A,{size:"sm",variant:"outline",onClick:i,children:[e.jsx(Zt,{size:13}),u("编辑")]}),e.jsxs(A,{size:"sm",variant:m.builtIn?"outline":"destructive",onClick:a,disabled:m.deletable===!1,children:[m.builtIn?e.jsx(Nt,{size:13}):e.jsx(Ge,{size:13}),m.builtIn?u("恢复默认"):u("删除")]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{children:u("Execution permission")}),e.jsx("p",{className:"text-sm",children:u(_t[Fe(m).mode])}),s&&!m.diagnostics?.some(x=>x.field==="executionPermission")?e.jsx("p",{role:"alert",className:"text-xs text-destructive-ink",children:u(s)}):null,m.diagnostics?.filter(x=>x.field==="executionPermission").map((x,f)=>e.jsx("p",{role:"alert",className:"text-xs text-destructive-ink",children:u(x.message)},`${x.code}-${f}`)),C&&!s?e.jsx("p",{role:"alert",className:"text-xs text-destructive-ink",children:u(C)}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:u("Changes apply when a new runtime starts. Running sessions keep their launch mode.")})]}),v.length>0&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("运行配置")}),e.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:v.map(([x,f])=>e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 bg-background px-4 py-2.5 sm:flex-row sm:items-center sm:gap-4",children:[e.jsx("span",{className:"min-w-0 break-words text-[13px] text-muted-foreground sm:w-32 sm:shrink-0",children:u(Ve[x]??x)}),e.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:ps(x,f)})]},x))})]}),b.length>0&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("环境变量")}),e.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:b.map(x=>e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 bg-background px-4 py-2.5 sm:gap-4",children:[e.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:x}),e.jsx("span",{className:"text-[13px] text-muted-foreground","aria-label":"hidden",children:"•••••"})]},x))})]}),m.settings?.trim()&&e.jsxs("div",{children:[e.jsx(xe,{className:"mb-3",children:u("Agent 原生配置")}),e.jsx("div",{className:"rounded-lg border border-border bg-muted/40 p-4",children:e.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:m.settings})})]}),v.length===0&&b.length===0&&!m.settings?.trim()&&e.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:u('该 Provider 未配置额外参数。点击"编辑"添加运行配置、环境变量或 Agent 原生配置。')})]})}function rn(){const{t}=$(),{data:i,isLoading:a}=zt(),u=Ft(),m=Jt(),C=$t(),s=qt(),E=Gt(),r=Wt(),v=j.useRef(null),[b,x]=j.useState(null),[f,k]=j.useState(null),[S,B]=j.useState(null),[J,q]=j.useState(!1),[X,L]=j.useState(!1),[K,R]=j.useState(null),[V,T]=j.useState(!1),O=i??[],g=b??O[0]?.provider.id??null,w=c=>{u.mutate(c,{onSuccess:()=>k(null),onError:p=>M.error(H(p,t("创建 Provider 失败")))})},G=(c,p)=>{m.mutate({id:c,data:p},{onSuccess:()=>k(null),onError:I=>M.error(H(I,t("更新 Provider 失败")))})},Z=c=>{if(!(c.deletable??!c.builtIn)){M.error(t("系统内置 Provider 不可删除"));return}B({id:c.id,name:c.name,builtIn:c.builtIn})},fe=()=>{S&&C.mutate(S.id,{onSuccess:()=>{M.success(S.builtIn?t("已恢复默认 Provider 配置"):t("Provider 已删除")),g===S.id&&x(null),B(null),T(!1)},onError:c=>M.error(H(c,t("删除 Provider 失败")))})},y=()=>{q(!1),L(!1)},z=()=>R(null),le=()=>{s.mutate(void 0,{onSuccess:c=>{vs(hs(c.exportedAt),c),M.success(t("Provider 备份已导出")),y()},onError:c=>M.error(H(c,t("导出 Provider 备份失败")))})},Q=()=>{v.current&&(v.current.value="",v.current.click())},ne=async c=>{const p=c.target.files?.[0];if(c.target.value="",!p)return;let I;try{I=JSON.parse(await p.text())}catch{M.error(t("备份文件不是有效的 JSON"));return}E.mutate(I,{onSuccess:D=>R({backup:I,preview:D}),onError:D=>M.error(H(D,t("导入预览失败")))})},de=()=>{K&&r.mutate(K.backup,{onSuccess:c=>{const p=c.summary.create+c.summary.overwrite;M.success(p===0?t("导入完成,当前配置无需变更"):t("导入完成:新增 {create},覆盖 {overwrite},跳过 {skip}",{create:c.summary.create,overwrite:c.summary.overwrite,skip:c.summary.skip})),z()},onError:c=>M.error(H(c,t("导入 Provider 备份失败")))})},Y=c=>{const p=c.provider,I=pe[p.agentType],D=Ot(p,I);k({id:p.id,data:{name:p.name,agentType:p.agentType,runtimeType:p.runtimeType===W.ACP?W.ACP:W.CLI,executionPermission:p.executionPermission,executionPermissionReviewRequired:p.executionPermissionReviewRequired,config:Xe(p.agentType,p.config),settings:p.settings??"",env:D,simplified:p.simplified??{},diagnostics:p.diagnostics,isDefault:p.isDefault}})};return a?e.jsx(_e,{className:"max-w-5xl",children:e.jsx(gt,{})}):e.jsxs(_e,{className:"max-w-5xl",children:[e.jsx("input",{ref:v,type:"file",accept:".json,application/json",className:"hidden",onChange:ne}),e.jsx(ht,{title:t("Agent 配置"),actions:e.jsxs(e.Fragment,{children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:Q,disabled:E.isPending||r.isPending,children:[e.jsx(Ht,{size:13}),t("导入")]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>q(!0),disabled:s.isPending,children:[e.jsx(vt,{size:13}),t("导出")]}),e.jsxs(A,{size:"sm",onClick:()=>k({}),children:[e.jsx(Ne,{size:13,className:"mr-1"}),t("新建")]})]})}),O.length===0?e.jsx(bt,{icon:yt,message:t("暂无 Agent 配置"),action:e.jsxs(A,{size:"sm",onClick:()=>k({}),children:[e.jsx(Ne,{size:13,className:"mr-1"}),t("新建配置")]})}):e.jsx(Vt,{items:O,selectedId:g,onSelectItem:c=>{x(c),T(!0)},getItemId:c=>c.provider.id,mobileShowDetail:V,onMobileBack:()=>T(!1),renderListItem:c=>{const p=c.provider,I=Je(c);return e.jsxs(e.Fragment,{children:[e.jsx(ys,{issue:I}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-medium",children:p.name}),e.jsxs("div",{className:U("flex min-w-0 items-center gap-1.5 text-[11px]","text-muted-foreground"),children:[e.jsx(ae,{agentType:p.agentType,className:"size-3.5",fallbackClassName:"text-muted-foreground"}),e.jsx("span",{className:"min-w-0 truncate",children:oe(p.agentType,p.runtimeType)})]}),I?e.jsx("div",{className:U("mt-0.5 break-words text-xs leading-snug text-destructive-ink"),children:t(I)}):null]}),p.isDefault&&e.jsx("span",{className:U("shrink-0 rounded px-1.5 py-0.5 text-xs font-medium","bg-primary/[0.06] text-primary"),children:t("默认")})]})},renderDetail:c=>c?e.jsx("div",{className:"min-w-0 p-5",children:e.jsx(ks,{item:c,onEdit:()=>Y(c),onDelete:()=>Z(c.provider)})}):e.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:t("选择一个 Provider 查看详情")})}),f&&e.jsx(ws,{isOpen:!0,onClose:()=>k(null),providerId:f.id,initialData:f.data,onSave:c=>{f.id?G(f.id,c):w(c)}}),e.jsx(Xt,{isOpen:S!==null,onClose:()=>{C.isPending||B(null)},onConfirm:fe,title:S?.builtIn?t("恢复默认 Provider"):t("删除 Provider"),description:S?.builtIn?t('确定删除 "{name}" 的自定义覆盖,并恢复系统默认配置?',{name:S?.name}):t('确定删除 "{name}"?此操作不可撤销。',{name:S?.name}),confirmText:S?.builtIn?t("恢复默认"):t("删除"),cancelText:t("取消"),variant:"danger",isLoading:C.isPending}),e.jsx(Ps,{isOpen:J,onClose:y,onConfirm:le,acknowledged:X,onAcknowledgedChange:L,isLoading:s.isPending}),e.jsx(Cs,{isOpen:!!K,onClose:z,preview:K?.preview??null,backup:K?.backup??null,onConfirm:de,isLoading:r.isPending})]})}export{ws as ProviderFormModal,rn as ProviderSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as Se,r as n,af as Bt,j as e,B as ne,ag as zt,N as Xs,ah as Ft,ai as Ut,aj as _t,ak as Kt,al as qt,am as Vt,an as L,ao as Gt,ap as Ht,q as Qt,v as $t,s as Ne,aq as us,ar as Xt,ac as Ys,ad as B,as as Yt,w as Jt,at as Js,au as Zt,Q as en,av as sn,aw as A,a2 as tn,ax as nn}from"./index-BJObbxud.js";import{r as rn,a as Zs,Q as on,s as an}from"./mermaid-NOHMQCX5-BSNbBj78.js";import{u as ln,r as cn,c as dn,g as _e,a as un,b as mn,d as pn,e as fn,f as xn,h as gn,W as hn,E as bn,i as vn,C as jn,S as yn,T as et,R as kn,j as Cn,k as wn,l as Nn,m as In,n as Sn}from"./EditableTaskTitle-BJ9Rxggf.js";import{t as Rn,D as Tn}from"./ProjectKanbanPage-Bt_01giW.js";import{u as An,a as En,R as Wn,P as Pn,T as Dn}from"./useTokenUsage-DDXf7E4p.js";import{u as Mn,a as On,L as st,T as tt}from"./useNormalizedLogs--RbVywYa.js";import{g as Ln}from"./ExecutionPermissionSelector-B8befbxJ.js";import{u as Bn,A as zn}from"./AttachmentPreview-CLN1lnLe.js";import{T as Fn,u as Un,a as _n,b as Kn,c as qn,d as Vn,e as Gn,S as nt}from"./CreateTaskInput-CasITF8y.js";import{u as Hn,a as Qn,b as $n,c as Xn,d as Yn,e as Jn}from"./use-workspaces-CdJZLmGh.js";import{u as Zn}from"./use-providers-Td1-gyrN.js";import{M as er}from"./modal-CSGOqphK.js";import{C as sr}from"./confirm-dialog-ltNBFYCs.js";import{C as tr,P as ms}from"./content-DPQMfMae.js";import{P as rt,T as nr}from"./trash-2-CvUJsbtT.js";import{P as rr}from"./paperclip-CTNoXpUW.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./index-Bhvt-E6d.js";import"./index-B1oVmCie.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./index-Dk3bRQAK.js";import"./chevron-down-3y5Aiolp.js";import"./MemberAvatar-YVr_erAr.js";import"./people-DT78SebR.js";import"./chevron-up-DqaYcjpq.js";import"./at-sign-C48_y345.js";import"./check-BmiJ7qMY.js";import"./BrandLogo-BUimEX-9.js";import"./hooks-BLxb16IA.js";import"./index-BtUQYU5l.js";import"./index-DZLnTISJ.js";import"./select-BPdJrr5M.js";import"./select-B5RYunTs.js";import"./menu-styles-DWynpVVz.js";import"./index-CThFsQNP.js";import"./layers-eaHAVcc3.js";import"./message-square-BLEJN6p7.js";import"./textarea-BVyPl9rM.js";import"./menu--sjyisSg.js";import"./server-xswxWpKD.js";import"./icon-button-CYiKa-7C.js";import"./search-field-CQLDXLeA.js";import"./popover-BiVxGGgp.js";import"./search-DniD_AGC.js";import"./upload-CsXAmAun.js";import"./use-projects-Ddz0knyr.js";import"./globe-B9I-jHBB.js";import"./BranchSelect-Cofp8vYf.js";import"./pencil-Cp70ZwtG.js";import"./track-Ckye0-tt.js";import"./dialog-CuFEdqLg.js";function or({isOpen:t,onClose:c,taskId:P}){const{t:d}=Se(),[C,f]=n.useState("AUTO"),[I,o]=n.useState(null),[u,z]=n.useState([]),[Re,F]=n.useState(null),Te=Bt();n.useEffect(()=>{t&&(f("AUTO"),o(null),z([]),F(null))},[t]);const S=Te.isPending,Ke=!!I||u.length>0,re=async()=>{if(!S){if(!I&&u.length===0){F(d("请选择至少一个团队模板或成员预设。"));return}F(null);try{await Te.mutateAsync({taskId:P,mode:C,...I?{teamTemplateId:I}:{},...u.length>0?{memberPresetIds:u}:{}}),c()}catch(V){F(V instanceof Error?V.message:d("创建 TeamRun 失败"))}}},qe=S||!Ke;return e.jsxs(er,{isOpen:t,onClose:S?()=>{}:c,title:d("创建 TeamRun"),className:"max-w-5xl",action:e.jsxs(e.Fragment,{children:[e.jsx(ne,{type:"button",variant:"outline",onClick:c,disabled:S,children:d("取消")}),e.jsx(ne,{type:"button",onClick:re,disabled:qe,children:d(S?"处理中...":"创建 TeamRun")})]}),children:[e.jsx(Fn,{mode:C,setMode:f,selectedTemplateId:I,setSelectedTemplateId:o,selectedMemberPresetIds:u,setSelectedMemberPresetIds:z,disabled:S}),Re&&e.jsx("div",{role:"alert",className:"rounded-lg border border-destructive/25 bg-destructive/10 px-4 py-3 text-sm text-destructive-ink",children:Re})]})}function ar({workspaceId:t,gitStatus:c,onResolve:P}){const{t:d}=Se(),C=Hn();if(c.operation==="idle"||c.conflictedFiles.length===0)return null;const f=c.operation==="rebase"?"Rebase":"Merge";return e.jsx(zt,{tone:"warning",className:"mx-6 mt-3 items-center",title:e.jsxs("span",{className:"flex items-center gap-2",children:[f," ",d("冲突"),e.jsxs(Ft,{tone:"warning",className:"tabular-nums",children:[c.conflictedFiles.length," ",d("个文件")]})]}),action:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Xs,{variant:"ghost",onClick:()=>C.mutate(t),loading:C.isPending,children:d("中止操作")}),e.jsx(Xs,{variant:"primary",onClick:P,children:d("解决冲突")})]})})}const ir=tn(),lr=t=>t.includes("://")||t.startsWith("/api/")?t:t.startsWith("/")?`${ir}/attachments/by-path?path=${encodeURIComponent(t)}`:t,te=520,ps=48,cr=4,dr=420;function ur(){const{t}=Se();return e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-background text-muted-foreground select-none",children:[e.jsx("div",{className:"w-16 h-16 bg-muted/50 rounded-xl border border-border/60 flex items-center justify-center mb-6",children:e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-muted-foreground",children:[e.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"currentColor"}),e.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("h3",{className:"text-foreground font-medium mb-2 text-[15px]",children:"Agent Tower"}),e.jsx("p",{className:"text-sm max-w-sm text-center text-muted-foreground leading-relaxed",children:t("Select a task from the sidebar to view logs, monitor execution, or interact with an agent.")})]})}function Ie(t){const c=nn[t].icon;return e.jsx(c,{className:"size-3"})}const ot=[{status:A.Review,className:"bg-warning/10 text-warning-ink",hoverClass:"hover:bg-warning/15",icon:Ie(A.Review)},{status:A.Running,className:"bg-info/10 text-info-ink",hoverClass:"hover:bg-info/15",icon:Ie(A.Running)},{status:A.Pending,className:"bg-muted/50 text-muted-foreground",hoverClass:"hover:bg-muted",icon:Ie(A.Pending)},{status:A.Done,className:"bg-success/10 text-success-ink",hoverClass:"hover:bg-success/15",icon:Ie(A.Done)},{status:A.Cancelled,className:"bg-muted/50 text-muted-foreground",hoverClass:"hover:bg-border",icon:Ie(A.Cancelled)}];function mr({status:t,onChangeStatus:c}){const{t:P}=Se(),[d,C]=n.useState(!1),f=n.useRef(null);n.useEffect(()=>{if(!d)return;const o=u=>{f.current&&!f.current.contains(u.target)&&C(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[d]);const I=ot.find(o=>o.status===t);return e.jsxs("div",{className:"relative",ref:f,children:[e.jsxs("button",{onClick:()=>c&&C(o=>!o),className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium transition-colors ${I.className} ${c?"cursor-pointer hover:opacity-80":""}`,children:[I.icon,e.jsx("span",{children:P(t)}),c&&e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",className:`ml-0.5 transition-transform ${d?"rotate-180":""}`,children:e.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})]}),d&&e.jsx("div",{className:"absolute right-0 top-full mt-2 w-40 bg-background rounded-lg border border-border shadow-popover z-50 py-1 animate-in fade-in zoom-in-95 duration-100",children:ot.filter(o=>o.status!==t).map(o=>e.jsxs("button",{onClick:()=>{c?.(o.status),C(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-xs font-medium transition-colors ${o.hoverClass}`,children:[e.jsx("span",{className:o.className.split(" ").find(u=>u.startsWith("text-")),children:o.icon}),e.jsx("span",{className:"text-foreground/80",children:P(o.status)})]},o.status))})]})}function fo({task:t,onDeleteTask:c,isDeleting:P,onTaskStatusChange:d,onTaskPriorityChange:C,autoStartState:f,onAutoStartRecovered:I}){const{t:o}=Se(),[u,z]=n.useState(""),[Re,F]=n.useState(!1),[Te,S]=n.useState(!1),[Ke,re]=n.useState(!1),[qe,V]=n.useState(!1),[at,fs]=n.useState(!1),Ae=n.useRef(null),[Ve,oe]=n.useState(!1),[R,Ge]=n.useState(null),[ae,G]=n.useState(void 0),[H,Ee]=n.useState(!1),He=n.useRef(null),Qe=n.useRef(null),ie=n.useRef(null),xs=n.useRef(null),{scrollRef:U,contentRef:gs,isAtBottom:hs,scrollToBottom:We,stopScroll:bs}=An({resize:"smooth",initial:"instant"}),[E,vs]=n.useState(!1),[$e,le]=n.useState(te),[Pe,js]=n.useState(!1),ys=n.useRef(0),ks=n.useRef(te),Cs=n.useRef(null),Xe=n.useCallback((s,r,i)=>{Ae.current?.openFile(s,r,i)},[]),{data:a,isLoading:it}=Qn(t?.id??""),ce=ln(t?.id),ws=ce?.status==="completed"&&f?.status!=="failed"?null:f,Ye=!!(ws||ce&&ce.status!=="completed"),{data:de}=Ut(t?.id??""),{data:lt}=_t(de?.id??""),Ns=Kt(de?.id??""),m=de??null,ue=!!m,Q=t?.isGitRepo!==!1&&t?.worktreeReady!==!1,De=de===null&&Q,ct=!!(t?.id&&de===null),{data:$,isLoading:Is}=qt(t?.id??"",ct);n.useEffect(()=>{Ee(!1),Ge(null),G(void 0)},[t?.id]);const _=n.useMemo(()=>cn(a,m,ae),[ae,m,a]);n.useEffect(()=>{ae&&!a?.some(s=>s.id===ae)&&G(void 0)},[ae,a]);const g=n.useMemo(()=>a?.find(s=>s.id===_),[_,a]),k=g?.status===Vt.ACTIVE?g.id:void 0,me=Q&&dn(g,m);n.useEffect(()=>{if(!H||!a)return;a.some(r=>r.status==="ACTIVE"&&r.sessions&&r.sessions.length>0)&&Ee(!1)},[a,H]);const h=n.useMemo(()=>{if(H||!a)return null;const s=l=>{const ds=l.createdAt,we=l.endedAt??l.startedAt??ds;if(!we)return 0;const se=Date.parse(we);return Number.isNaN(se)?0:se},r=(l,ds)=>{const we=l.filter(se=>ds.includes(se.status));return we.length===0?null:we.sort((se,Lt)=>s(Lt)-s(se))[0]??null},i=a.filter(l=>l.status==="ACTIVE"&&Array.isArray(l.sessions)).flatMap(l=>l.sessions??[]),p=r(i,[L.RUNNING])??r(i,[L.PENDING])??r(i,[L.COMPLETED,L.FAILED,L.CANCELLED]);if(p)return p;const N=a.filter(l=>(l.status==="MERGED"||l.status==="ABANDONED"||l.status==="HIBERNATED")&&Array.isArray(l.sessions)).flatMap(l=>l.sessions??[]);return r(N,[L.COMPLETED,L.FAILED,L.CANCELLED])},[a,H]),X=h?.id??"",b=ue?R??"":X,dt=n.useMemo(()=>{if(!R||!a)return null;for(const s of a){const r=s.sessions?.find(i=>i.id===R);if(r)return r}return null},[R,a]),Je=n.useMemo(()=>{if(!R||!m?.invocations)return null;const s=m.invocations.filter(r=>r.sessionId===R);return s.length===0?null:s.sort((r,i)=>{const p=Date.parse(r.updatedAt??r.createdAt??""),N=Date.parse(i.updatedAt??i.createdAt??"");return(Number.isNaN(N)?0:N)-(Number.isNaN(p)?0:p)})[0]??null},[R,m?.invocations]),ut=n.useMemo(()=>!Je?.memberId||!m?.members?null:m.members.find(s=>s.id===Je.memberId)??null,[Je?.memberId,m?.members]),v=R?dt:h??null,D=v?.id,Y=n.useMemo(()=>{if(v?.workspaceId)return v.workspaceId;if(!(!v||!a))return a.find(s=>s.sessions?.some(r=>r.id===v.id))?.id},[v,a]),Me=n.useCallback((s,r)=>{const p=(r&&a?.some(N=>N.id===r)?r:void 0)??Y??_??void 0;p&&G(p),Ae.current?.openPreview(s,p)},[Y,_,a]),Ze=n.useCallback((s,r)=>{Me({kind:"web",url:s},r)},[Me]),es=n.useCallback((s,r,i)=>{Me({kind:"visualization",sessionId:s,file:r},i)},[Me]),Ss=n.useCallback(s=>{Ze(s,Y)},[Y,Ze]),Rs=n.useCallback(s=>{D&&es(D,s,Y)},[D,Y,es]),{isActive:pe,isCancelling:fe}=Un(D??"",v?.status),x=!!t?.projectArchivedAt,Ts=!!t?.projectRepoDeletedAt,ss=o(Ts?"项目已删除,本地仓库文件也已清理。恢复项目并重新绑定仓库后才能继续操作。":"项目已删除。恢复项目后才能继续创建会话或修改任务。"),{data:J}=Zn(),[Oe,As]=n.useState(null),Le=h?Ln(J,Oe??h.providerId):void 0;n.useEffect(()=>{As(h?.providerId??null)},[h?.providerId]);const mt=n.useMemo(()=>!h||!a?!1:!a.some(r=>r.status==="ACTIVE"&&r.sessions?.some(i=>i.id===h.id)),[h,a]),w=n.useMemo(()=>{if(!(!a||H)){if(g)return _e(g);for(const s of a)if(s.status==="ACTIVE"&&_e(s))return _e(s);return _e(a[0])}},[H,g,a]),K=_n({agentType:h?.agentType,workingDir:w,input:u,setInput:z,textareaRef:ie,minHeight:60,maxHeight:300}),q=un({agentType:h?.agentType,workingDir:w,input:u,setInput:z,textareaRef:ie,minHeight:60,maxHeight:300}),ts=Gt(s=>s.setVisibleContext),xe=!!(me&&k&&w&&!x),{data:T,isLoading:pt}=$n(k??"",{enabled:xe}),{data:ft}=mn(w,{enabled:xe});n.useEffect(()=>{if(!(E||!xe||!k||!w))return ts({workspaceId:k,workingDir:w,tab:"changes"}),()=>{ts(null)}},[E,k,ts,xe,w]);const xt=g?.sessions??[],ge=pn(g),Es=g?.commitMessage,he=n.useMemo(()=>fn(g,a,t?.mainBranch??""),[g,t?.mainBranch,a]),be=xn((a??[]).map(s=>s.id),!ue),{pendingConflictDetails:ve}=be,Ws=!!ve,j=n.useMemo(()=>ve||(T?.conflictOp&&T.conflictedFiles.length>0?Ht({conflictOp:T.conflictOp,conflictedFiles:T.conflictedFiles,resolutionContextToken:T.resolutionContextToken,sourceWorkspaceId:k,sourceWorktreePath:g?.worktreePath,sourceBranch:ge,targetBranch:he}):ve),[T,ve,k,g?.worktreePath,ge,he]),Ps=j?.targetWorkspaceId??k,gt=j?.targetWorktreePath??g?.worktreePath,ht=j?.sourceBranch??ge,bt=j?.targetBranch??he,y=Qt(),Be=n.useCallback(async()=>t?.id?y.fetchQuery({queryKey:Ne.tasks.body(t.id),queryFn:()=>$t.get(`/tasks/${t.id}/body`)}):null,[y,t?.id]),Ds=n.useCallback(()=>t?.id?y.invalidateQueries({queryKey:Ne.workspaces.list(t.id)}):Promise.resolve(),[t?.id,y]);n.useEffect(()=>{if(!Ve)return;const s=r=>{Qe.current&&!Qe.current.contains(r.target)&&oe(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[Ve]);const M=Kn(),Ms=Xn(),Os=Yn(t?.id??""),Ls=qn(),ns=Jn(),je=n.useMemo(()=>!a||a.some(r=>r.status==="ACTIVE")?null:a.find(r=>r.status==="HIBERNATED")??null,[a]),rs=n.useRef(null);n.useEffect(()=>{je&&rs.current!==je.id&&(ns.isPending||(rs.current=je.id,ns.mutate(je.id,{onSettled:()=>{rs.current=null}})))},[je,ns]);const vt=n.useCallback(async()=>{if(!t?.id)return;const s=h?.providerId??J?.find(r=>r.availability.type!=="NOT_FOUND")?.provider.id;if(s){V(!1),fs(!0);try{const i=(await Be())?.prompt??t.title;Ee(!0),await Rn(t.id,{providerId:s,prompt:i,retryTask:!0,workspaceKind:Q?us.WORKTREE:us.MAIN_DIRECTORY},{createWorkspace:p=>Os.mutateAsync({clientSubmissionId:p,workspaceKind:Q?void 0:us.MAIN_DIRECTORY}),startSession:p=>Ls.mutateAsync(p)}),await y.invalidateQueries({queryKey:Ne.workspaces.list(t.id)})}catch(r){console.error("[retry] failed:",r),Ee(!1)}finally{fs(!1)}}},[t?.id,t?.title,Q,h?.providerId,J,Be,Os,Ls,y]),os=n.useCallback(async()=>{t?.id&&(await Be(),F(!0))},[Be,t?.id]),jt=n.useCallback(()=>{g?.id&&Ms.mutate({workspaceId:g.id})},[Ms,g?.id]),yt=n.useCallback(()=>{!t?.id||!c||(c(t.id),re(!1))},[t?.id,c]),Bs=n.useCallback(s=>{Ge(s),requestAnimationFrame(()=>{We()})},[We]),kt=n.useCallback(()=>{Ge(null)},[]),ye=n.useCallback(s=>{const r=s??j;r&&be.openDialog(r)},[j,be]),Ct=n.useCallback(s=>Ns.mutateAsync(s),[Ns]),Z=n.useCallback(()=>{y.invalidateQueries({queryKey:Xt.all})},[y]),{isConnected:zs,isLoadingSnapshot:Fs,isOutputActive:Us,lastExitAt:_s,logs:ke,entries:wt,attach:ze}=Mn({sessionId:b,sessionStatus:v?.status,sessionStartedAt:v?.startedAt??v?.createdAt,sessionEndedAt:v?.endedAt??(pe?null:v?.updatedAt),onExit:n.useCallback(()=>{y.invalidateQueries({queryKey:["workspaces"]})},[y])});n.useEffect(()=>{if(!t?.id)return;const s=Ys.connect(),r=rn(t.id),i=l=>{l.taskId===t.id&&(y.invalidateQueries({queryKey:["tasks"]}),Z())},p=l=>{l.taskId===t.id&&(y.invalidateQueries({queryKey:Ne.workspaces.list(t.id)}),Z())},N=l=>{l.taskId===t.id&&(y.invalidateQueries({queryKey:Ne.workspaces.list(t.id)}),Z())};return s.on(B.TASK_UPDATED,i),s.on(B.WORKSPACE_COMMIT_MESSAGE_UPDATED,p),s.on(B.WORKSPACE_HIBERNATED,N),()=>{s.off(B.TASK_UPDATED,i),s.off(B.WORKSPACE_COMMIT_MESSAGE_UPDATED,p),s.off(B.WORKSPACE_HIBERNATED,N),r()}},[t?.id,y,Z]),n.useEffect(()=>{if(!b)return;const s=Ys.connect(),r=i=>{i.sessionId===b&&(y.invalidateQueries({queryKey:["workspaces"]}),Z())};return s.on(B.SESSION_COMPLETED,r),()=>{s.off(B.SESSION_COMPLETED,r)}},[b,y,Z]);const{todos:Fe}=On(wt),{files:Nt,addFiles:ee,removeFile:It,clear:Ks,getDoneAttachments:qs,hasFiles:Ce,isUploading:Ue}=Bn(),St=n.useMemo(()=>gn(v),[v?.tokenUsage]),Vs=En(ke,St);n.useEffect(()=>{b&&zs&&ze()},[b,zs,ze]);const Gs=n.useRef(t?.id);n.useEffect(()=>{if(Gs.current!==t?.id&&U.current){const s=U.current;requestAnimationFrame(()=>{s.scrollTop=s.scrollHeight})}Gs.current=t?.id},[t?.id,U]);const O=Vn(),as=n.useRef(!1),Hs=n.useCallback(async()=>{if(!u.trim()&&!Ce||!b||as.current||O.isPending||fe||Ue||Le)return;as.current=!0;const s=qs().map(i=>i.id),r=u.trim()||(s.length?" ":"");z(""),Ks(),ie.current&&(ie.current.style.height="60px"),M.mutate({id:b,message:r,attachmentIds:s,providerId:Oe??void 0},{onSuccess:()=>{ze()},onSettled:()=>{as.current=!1}})},[u,b,M,ze,Ce,Ue,qs,Ks,Oe,Le,O.isPending,fe]),Rt=n.useCallback(()=>{!b||O.isPending||O.mutate(b)},[b,O]),Tt=n.useCallback(s=>{const r=s.target.files;r&&r.length>0&&ee(Array.from(r)),s.target.value=""},[ee]),At=n.useCallback(s=>{const r=s.clipboardData.items,i=[];for(const p of r)if(p.kind==="file"){const N=p.getAsFile();N&&i.push(N)}i.length>0&&(s.preventDefault(),ee(i))},[ee]),[Qs,is]=n.useState(!1),Et=n.useCallback(s=>{s.preventDefault(),is(!0)},[]),Wt=n.useCallback(s=>{s.preventDefault(),is(!1)},[]),Pt=n.useCallback(s=>{s.preventDefault(),is(!1);const r=s.dataTransfer.files;r.length>0&&ee(Array.from(r))},[ee]),W=n.useCallback(s=>{const r=Cs.current?.getBoundingClientRect().width??(typeof window<"u"?window.innerWidth:void 0),i=r?Math.max(te,r-ps-cr-dr):te;return Math.max(te,Math.min(Math.round(s),i))},[]),ls=n.useCallback(s=>{const r=s.clientX-ys.current;le(W(ks.current-r))},[W]),cs=n.useCallback(()=>{js(!1),document.body.style.cursor="",document.body.style.userSelect=""},[]);n.useEffect(()=>{if(Pe)return document.addEventListener("mousemove",ls),document.addEventListener("mouseup",cs),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ls),document.removeEventListener("mouseup",cs),document.body.style.cursor="",document.body.style.userSelect=""}},[cs,ls,Pe]);const Dt=n.useCallback(s=>{s.preventDefault(),ys.current=s.clientX,ks.current=$e,js(!0)},[$e]);n.useEffect(()=>{!E||Pe||le(s=>W(s))},[W,E,Pe]),n.useEffect(()=>{if(!E)return;const s=()=>{le(r=>W(r))};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[W,E]);const Mt=n.useCallback(()=>{le(s=>W(s)),vs(!0),requestAnimationFrame(()=>{Ae.current?.setTab("review")})},[W]),Ot=n.useCallback(s=>{z(s.target.value);const r=s.target;r.style.height="auto";const i=r.scrollHeight;r.style.height=`${Math.max(60,Math.min(i,300))}px`},[]),$s=xe&&k?e.jsx(hn,{projectId:t?.projectId??"",workspaceId:k,branchName:ge,targetBranch:he,commitMessage:Es,changes:ft,gitStatus:T,isGitStatusLoading:pt,canRunGitOperations:me,onOpenChanges:Mt,onRefreshCommitMessage:Ds,onConflict:ye,className:"mb-1.5"}):null;return t?e.jsxs("div",{className:"flex-1 flex flex-col h-full bg-background relative overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-3 flex items-center justify-between border-b border-border/60 bg-background z-20 flex-shrink-0",children:[e.jsxs("div",{className:"flex flex-col min-w-0 flex-1 mr-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${t.projectColor.replace("text-","bg-")}`}),e.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.projectName}),t.projectArchivedAt&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground shrink-0",children:t.projectRepoDeletedAt?o("源码已删除"):o("已删除")}),e.jsx("span",{className:"text-muted-foreground text-xs",children:"/"}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate",children:t.branch})]}),e.jsx(bn,{taskId:t.id,title:t.title,readOnly:x})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx(mr,{status:t.status,onChangeStatus:!x&&d?s=>d(t.id,s):void 0}),e.jsx(Gn,{value:t.priority,onChange:!x&&C?s=>C(t.id,s):void 0}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:jt,disabled:!w||x,className:"w-8 h-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:o("Open in IDE"),children:e.jsx(tr,{size:16})}),(c||De)&&!x&&e.jsxs("div",{className:"relative",ref:Qe,children:[e.jsx("button",{onClick:()=>oe(s=>!s),className:"w-8 h-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:o("More actions"),children:e.jsx(vn,{size:16})}),Ve&&e.jsxs("div",{className:"absolute right-0 top-full mt-2 w-44 bg-background rounded-lg border border-border shadow-popover z-50 py-1",children:[De&&e.jsxs("button",{onClick:()=>{S(!0),oe(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground/80 hover:bg-muted/50 transition-colors",children:[e.jsx(rt,{size:15}),e.jsx("span",{children:o("创建 TeamRun")})]}),e.jsxs("button",{onClick:()=>{V(!0),oe(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground/80 hover:bg-muted/50 transition-colors",children:[e.jsx(Yt,{size:15}),e.jsx("span",{children:o("重新开始")})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"my-1 border-t border-border/60"}),e.jsxs("button",{onClick:()=>{re(!0),oe(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-destructive-ink hover:bg-destructive/10 transition-colors",children:[e.jsx(nr,{size:15}),e.jsx("span",{children:o("删除任务")})]})]})]})]})]})]})]}),!ue&&e.jsx(jn,{recovery:be,onRecover:s=>{G(s.sourceWorkspaceId),ye(s)}}),me&&k&&T&&e.jsx(ar,{workspaceId:k,gitStatus:T,onResolve:()=>ye()}),e.jsxs("div",{ref:Cs,className:"flex-1 flex overflow-hidden",children:[e.jsx("div",{className:"flex min-w-0 flex-1 flex-col bg-background relative",children:ue&&m?R?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-20 flex shrink-0 items-center justify-between gap-3 overflow-visible border-b border-border px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground",children:o("Invocation details")}),e.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:R})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(yn,{session:v,providers:J,usage:Vs,providerIdFallback:ut?.providerId,agentTypeFallback:v?.agentType,tokenTooltipSide:"bottom"}),e.jsxs(ne,{type:"button",size:"sm",variant:"ghost",className:"h-7 gap-1 rounded-lg border border-border/70 bg-background/60 px-2 text-xs font-medium text-muted-foreground hover:border-muted-foreground/40 hover:bg-muted hover:text-foreground",onClick:kt,children:[e.jsx(Jt,{size:13}),e.jsx("span",{children:o("Team room")})]})]})]}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:U,className:"h-full overflow-y-auto scrollbar-app-thin px-6 pt-6 pb-4",children:e.jsxs("div",{ref:gs,className:"w-full max-w-4xl mx-auto",children:[!m&&t&&e.jsx(et,{taskId:t.id}),Fs?e.jsxs("div",{className:"flex items-center justify-center py-12 gap-3 text-muted-foreground",children:[e.jsxs("svg",{className:"animate-spin motion-reduce:[animation-duration:2.4s] h-5 w-5",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...")})]}):ke.length===0&&!b?e.jsx("div",{className:"text-muted-foreground text-center py-8",children:o(pe?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx(st,{children:e.jsx(Zs,{logs:ke,sessionId:D,downloadSessionId:D,isOutputActive:Us,lastExitAt:_s,onUserToggleDetails:bs,workingDir:w,scrollElementRef:U,onOpenWorkspaceFile:Xe,onOpenPreviewUrl:Ss,onOpenVisualization:Rs})})]})}),!hs&&e.jsxs("button",{onClick:()=>We(),className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1.5 px-3 py-1.5 bg-background/90 backdrop-blur-sm border border-border rounded-full shadow-raised text-xs text-muted-foreground hover:bg-background hover:text-foreground transition-all","aria-label":o("Scroll to bottom"),children:[e.jsx(Js,{size:14}),e.jsx("span",{children:o("回到底部")})]})]}),Fe.length>0&&e.jsx("div",{className:"px-6 pt-2 pb-1 bg-background flex-shrink-0 border-t border-border/60",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx(tt,{todos:Fe})})})]}):e.jsx(kn,{teamRun:m,messages:lt??m.messages??[],readOnly:x,readOnlyMessage:ss,onSendMessage:Ct,onViewInvocationSession:Bs,changeSummaryBar:$s,centered:!0,workingDir:w,onOpenWorkspaceFile:Xe,onOpenPreviewUrl:Ze,onOpenVisualization:es}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:U,className:"h-full overflow-y-auto scrollbar-app-thin px-6 pt-6 pb-4",children:e.jsxs("div",{ref:gs,className:"w-full min-w-0 max-w-4xl mx-auto",children:[!m&&t&&e.jsx(et,{taskId:t.id}),(Is||$?.body)&&e.jsx("div",{className:"mb-4 pb-4 border-b border-border/60 min-w-0",children:Is?e.jsx("p",{className:"text-sm text-muted-foreground italic",children:o("Loading...")}):$?.body?e.jsx("div",{className:"text-sm text-muted-foreground leading-relaxed prose prose-sm max-w-none break-words overflow-hidden",children:e.jsx(on,{urlTransform:lr,components:an,children:$.body})}):null}),!x&&e.jsx(Cn,{state:ws,setupProgress:ce,sessionStarted:!!h?.startedAt,onRetry:X&&f?.status==="failed"?os:void 0},t.id),it?(!Ye||x)&&e.jsxs("div",{className:"flex items-center justify-center py-12 gap-3 text-muted-foreground",children:[e.jsxs("svg",{className:"animate-spin motion-reduce:[animation-duration:2.4s] h-5 w-5",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...")})]}):X?Fs?e.jsxs("div",{className:"flex items-center justify-center py-12 gap-3 text-muted-foreground",children:[e.jsxs("svg",{className:"animate-spin motion-reduce:[animation-duration:2.4s] h-5 w-5",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...")})]}):ke.length===0&&!b?e.jsx("div",{className:"text-muted-foreground text-center py-8",children:o(pe?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx(st,{children:e.jsx(Zs,{logs:ke,sessionId:D,downloadSessionId:D,isOutputActive:Us,lastExitAt:_s,onUserToggleDetails:bs,workingDir:w,scrollElementRef:U,onOpenWorkspaceFile:Xe,onOpenPreviewUrl:Ss,onOpenVisualization:Rs})}):!Ye||f?.status==="failed"||ce?.status==="failed"||x?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(!Ye||x)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-14 h-14 bg-muted/50 rounded-xl border border-border/60 flex items-center justify-center mb-5",children:e.jsx(ms,{size:24,className:"text-muted-foreground/70 ml-0.5"})}),e.jsx("h3",{className:"text-base font-medium text-foreground mb-1.5",children:o(x?"项目为只读历史":"尚未启动 Agent")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-xs",children:x?ss:o("选择一个 Agent 来执行此任务,Agent 将自动创建工作空间并开始工作。")})]}),!x&&(!f||f.status==="failed")&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.jsxs(ne,{onClick:os,disabled:!!(f&&f.status!=="failed"),children:[e.jsx(ms,{size:16,className:"mr-1.5"}),f?.status==="failed"?o("重试启动 Agent"):o("启动 Agent")]}),De&&e.jsxs(ne,{variant:"outline",onClick:()=>S(!0),children:[e.jsx(rt,{size:16,className:"mr-1.5"}),o("创建 TeamRun")]})]})]}):null]})}),!hs&&e.jsxs("button",{onClick:()=>We(),className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1.5 px-3 py-1.5 bg-background/90 backdrop-blur-sm border border-border rounded-full shadow-raised text-xs text-muted-foreground hover:bg-background hover:text-foreground transition-all","aria-label":o("Scroll to bottom"),children:[e.jsx(Js,{size:14}),e.jsx("span",{children:o("回到底部")})]})]}),Fe.length>0&&e.jsx("div",{className:"px-6 pt-2 pb-1 bg-background flex-shrink-0 border-t border-border/60",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx(tt,{todos:Fe})})}),x?e.jsx("div",{className:"p-6 pt-3 bg-background flex-shrink-0 w-full z-10 pb-6 border-t border-border/60",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx("div",{className:"bg-muted/50 rounded-xl border border-border px-4 py-3 text-sm text-muted-foreground",children:ss})})}):mt?e.jsx("div",{className:"p-6 pt-3 bg-background flex-shrink-0 w-full z-10 pb-6 border-t border-border/60",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-xl border border-border px-4 py-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:o("代码已合并,以上为历史沟通记录")}),e.jsxs(ne,{size:"sm",onClick:os,children:[e.jsx(ms,{size:14,className:"mr-1.5"}),o("启动新 Agent")]})]})})}):e.jsxs("div",{className:"p-6 pt-2 bg-background flex-shrink-0 w-full z-10 pb-6 border-t border-transparent",onDragOver:Et,onDragLeave:Wt,onDrop:Pt,children:[e.jsxs("div",{className:"max-w-4xl mx-auto",children:[$s,b?e.jsx(Wn,{sessionId:b}):null,e.jsxs("div",{ref:He,className:`relative bg-background rounded-xl border hover:border-ring/40 focus-within:border-ring/60 transition-colors duration-200 ${Qs?"border-foreground/40 bg-foreground/[0.02]":"border-border"}`,children:[e.jsx(zn,{files:Nt,onRemove:It}),e.jsx("textarea",{ref:ie,value:u,onChange:Ot,onPaste:At,onKeyDown:s=>{q.handleKeyDown(s)||K.handleKeyDown(s)||s.key==="Enter"&&!s.shiftKey&&!s.repeat&&!s.nativeEvent.isComposing&&s.nativeEvent.keyCode!==229&&(s.preventDefault(),Hs())},rows:1,placeholder:o(Qs?"Drop files here...":X&&!pe?"Continue conversation...":"Message Agent..."),className:"w-full px-4 pt-4 pb-2 bg-transparent border-none focus:outline-none resize-none text-sm text-foreground placeholder-muted-foreground/70 leading-relaxed",style:{minHeight:"60px",maxHeight:"300px"}}),e.jsx("input",{ref:xs,type:"file",multiple:!0,className:"hidden",onChange:Tt}),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",{onClick:()=>xs.current?.click(),className:"p-2 text-muted-foreground hover:text-muted-foreground hover:bg-muted rounded-lg transition-colors",title:o("Upload file"),children:e.jsx(rr,{size:18})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[h&&J&&e.jsx(Pn,{providers:J,currentProviderId:Oe,agentType:h.agentType,runtimeType:h.runtimeType,onSelect:As}),e.jsx(Dn,{usage:Vs}),pe&&!M.isPending&&!u.trim()&&!Ce?e.jsx("button",{onClick:Rt,disabled:O.isPending||fe,"aria-label":o("Stop"),title:o("Stop"),className:"p-2 rounded-lg transition-all duration-200 bg-destructive-ink text-white hover:bg-destructive-ink/90 disabled:opacity-50",children:e.jsx(Zt,{size:14})}):e.jsx("button",{onClick:Hs,"aria-label":o(M.isPending?"发送中...":"Send"),"aria-busy":M.isPending,disabled:!u.trim()&&!Ce||Ue||M.isPending||O.isPending||fe||!!Le,className:`p-2 rounded-lg transition-all duration-200 ${(u.trim()||Ce)&&!Ue&&!M.isPending&&!O.isPending&&!fe&&!Le?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-transparent text-muted-foreground cursor-not-allowed"}`,children:M.isPending?e.jsx(en,{size:18,className:"animate-spin"}):e.jsx(sn,{size:18})})]})]})]})]}),e.jsx(nt,{open:K.query!==null,anchorRef:He,commands:K.filteredCommands,selectedIndex:K.selectedIndex,query:K.query??"",hasCatalog:K.allCommands.length>0,onSelect:K.applyCommand}),e.jsx(nt,{open:q.query!==null,anchorRef:He,commands:q.filteredSkills,selectedIndex:q.selectedIndex,query:q.query??"",hasCatalog:q.allSkills.length>0,title:"Skills",queryPrefix:"$",emptyCatalogMessage:"No skills catalog for this agent yet.",onSelect:q.applySkill})]})]})}),E&&e.jsx("div",{className:"w-1 cursor-col-resize hover:bg-border active:bg-ring/40 transition-colors z-50 -ml-[2px] flex-shrink-0 h-full",onMouseDown:Dt,role:"separator","aria-orientation":"vertical","aria-label":o("调整工作区宽度")}),e.jsx("div",{className:"flex h-full flex-shrink-0 bg-background",style:{width:E?ps+$e:ps},children:e.jsx(wn,{sessionId:X||void 0,workspaceId:_,workingDir:w,projectId:t.projectId,readOnly:x,repoDeleted:Ts,teamRun:m,teamStatus:m?e.jsx(Nn,{teamRun:m,workspaces:a,selectedWorkspaceId:_,onSelectWorkspace:G,onViewInvocationSession:Bs}):void 0,workspaces:a,selectedWorkspaceId:_,onSelectWorkspace:G,variant:"rail",expanded:E,onExpandedChange:s=>{s&&le(r=>W(r)),vs(s)},minContentWidth:te,tabRef:Ae,gitAvailable:Q,gitProps:me&&k?{branchName:ge,targetBranch:he,commitMessage:Es,canRunGitOperations:!0,onRefreshCommitMessage:Ds,onConflict:ye,onResolveConflicts:()=>ye()}:void 0})})]}),!x&&e.jsx(In,{isOpen:Re,onClose:()=>F(!1),taskId:t.id,projectId:t.projectId,taskTitle:$?.title??t.title,taskDescription:$?.body??"",taskPrompt:$?.prompt,projectIsGitRepo:t.isGitRepo,projectWorktreeReady:t.worktreeReady,projectGitReason:t.reason,onStarted:()=>I?.(t.id)}),De&&!x&&e.jsx(or,{isOpen:Te,onClose:()=>S(!1),taskId:t.id}),Ws&&me&&Ps&&j&&e.jsx(Sn,{open:Ws,onOpenChange:s=>{s||be.closeDialog()},workspaceId:Ps,conflictOp:j.conflictOp,conflictedFiles:j.conflictedFiles,resolutionContextToken:j.resolutionContextToken,sourceBranch:ht,targetBranch:bt,operation:T?.operation,worktreePath:gt,mergeAborted:j.mergeAborted,mergeStrategy:j.mergeStrategy,sourceWorkspaceId:j.sourceWorkspaceId,targetWorkspaceId:j.targetWorkspaceId,sourceWorktreePath:j.sourceWorktreePath,targetWorktreePath:j.targetWorktreePath,sessions:xt,currentSessionId:ue?void 0:X,teamRunId:m?.id}),e.jsx(sr,{isOpen:qe,onClose:()=>V(!1),onConfirm:vt,title:o("重新开始任务"),description:e.jsx("p",{children:o("将归档当前工作区并自动在新 Worktree 中重新启动 Agent,旧工作区内容保留供参考。")}),confirmText:o("确认重试"),variant:"default",isLoading:at}),e.jsx(Tn,{isOpen:Ke,onClose:()=>re(!1),onConfirm:yt,taskId:t.id,taskTitle:t.title,workspaces:a,isLoading:P})]}):e.jsx(ur,{})}export{fo as TaskDetail};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as Re,T as gt,U as bt,V as ft,W as ht,Y as vt,Z as jt,_ as yt,$ as Pt,r as i,j as e,a0 as Nt,i as Ee,a1 as kt,k as Tt,n as B,w as Ae,B as p,G as _e,t as c,a2 as wt}from"./index-BJObbxud.js";import{C as Fe}from"./confirm-dialog-ltNBFYCs.js";import{M as Ct}from"./modal-CSGOqphK.js";import{S as O}from"./select-BPdJrr5M.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import{M as U}from"./MemberAvatar-YVr_erAr.js";import{u as It}from"./use-providers-Td1-gyrN.js";import{T as ue,P as R}from"./trash-2-CvUJsbtT.js";import{C as St}from"./chevron-up-DqaYcjpq.js";import{C as Mt}from"./chevron-down-3y5Aiolp.js";import"./dialog-CuFEdqLg.js";import"./index-Bhvt-E6d.js";import"./select-B5RYunTs.js";import"./menu-styles-DWynpVVz.js";import"./check-BmiJ7qMY.js";import"./index-DZLnTISJ.js";import"./index-B1oVmCie.js";import"./index-CThFsQNP.js";import"./index-Dk3bRQAK.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./people-DT78SebR.js";const o="/avatars/presets",Et=[{id:"developer",label:"Developer",src:`${o}/avatar-preset-01-developer.png`},{id:"architect",label:"Architect",src:`${o}/avatar-preset-02-architect.png`},{id:"tester",label:"Tester",src:`${o}/avatar-preset-03-tester.png`},{id:"devops",label:"DevOps",src:`${o}/avatar-preset-04-devops.png`},{id:"data-scientist",label:"Data scientist",src:`${o}/avatar-preset-05-data-scientist.png`},{id:"frontend",label:"Frontend",src:`${o}/avatar-preset-06-frontend.png`},{id:"backend",label:"Backend",src:`${o}/avatar-preset-07-backend.png`},{id:"security",label:"Security",src:`${o}/avatar-preset-08-security.png`},{id:"project-manager",label:"Project manager",src:`${o}/avatar-preset-09-project-manager.png`},{id:"product-manager",label:"Product manager",src:`${o}/avatar-preset-10-product-manager.png`},{id:"scrum-master",label:"Scrum master",src:`${o}/avatar-preset-11-scrum-master.png`},{id:"tech-lead",label:"Tech lead",src:`${o}/avatar-preset-12-tech-lead.png`},{id:"coordinator",label:"Coordinator",src:`${o}/avatar-preset-13-coordinator.png`},{id:"mentor",label:"Mentor",src:`${o}/avatar-preset-14-mentor.png`},{id:"reviewer",label:"Reviewer",src:`${o}/avatar-preset-15-reviewer.png`},{id:"ui-designer",label:"UI designer",src:`${o}/avatar-preset-16-ui-designer.png`},{id:"ux-researcher",label:"UX researcher",src:`${o}/avatar-preset-17-ux-researcher.png`},{id:"documenter",label:"Documenter",src:`${o}/avatar-preset-18-documenter.png`},{id:"translator",label:"Translator",src:`${o}/avatar-preset-19-translator.png`},{id:"analyst",label:"Analyst",src:`${o}/avatar-preset-20-analyst.png`},{id:"consultant",label:"Consultant",src:`${o}/avatar-preset-21-consultant.png`},{id:"creative-director",label:"Creative director",src:`${o}/avatar-preset-22-creative-director.png`},{id:"support",label:"Support",src:`${o}/avatar-preset-23-support.png`},{id:"assistant",label:"Assistant",src:`${o}/avatar-preset-24-assistant.png`},{id:"robot",label:"Robot",src:`${o}/avatar-preset-25-robot.png`}],De=wt(),At=2*1024*1024,_t=[],Ft=[],$t=[],ze=[{key:"readRoom",label:"读房间"},{key:"postRoomMessage",label:"发房间消息"},{key:"mentionMembers",label:"提及成员"},{key:"stopMemberWork",label:"停止成员工作"},{key:"markReadyForReview",label:"标记可审查"},{key:"readFiles",label:"读文件"},{key:"writeFiles",label:"写文件"},{key:"runCommands",label:"运行命令"},{key:"readDiff",label:"读 diff"},{key:"mergeWorkspace",label:"合并工作区"}],Le={readRoom:!1,postRoomMessage:!1,mentionMembers:!1,stopMemberWork:!1,markReadyForReview:!1,readFiles:!1,writeFiles:!1,runCommands:!1,readDiff:!1,mergeWorkspace:!1},$e=[{value:"none",label:"无"},{value:"shared",label:"共享"},{value:"dedicated",label:"独占"}],Ot=[{value:"MENTION_ONLY",label:"仅提及"},{value:"USER_MESSAGES",label:"所有用户消息"}],Rt=[{value:"new_per_request",label:"每次新会话"},{value:"resume_last",label:"复用上次会话"}],Dt=[{value:"own_only",label:"仅自己队列"},{value:"team_pending",label:"全队列待处理"}];function Y(){return{name:"",aliasesText:"",providerId:"",rolePrompt:"",capabilities:{...Le},workspacePolicy:"none",triggerPolicy:"MENTION_ONLY",sessionPolicy:"new_per_request",queueManagementPolicy:"own_only",avatar:""}}function xe(r){return{name:r.name,aliasesText:r.aliases.join(", "),providerId:r.providerId,rolePrompt:r.rolePrompt,capabilities:{...Le,...r.capabilities},workspacePolicy:r.workspacePolicy,triggerPolicy:r.triggerPolicy,sessionPolicy:r.sessionPolicy,queueManagementPolicy:r.queueManagementPolicy,avatar:r.avatar??""}}function q(){return{name:"",heartbeatTimeoutMinutes:10,memberPresetIds:[]}}function pe(r){return{name:r.name,heartbeatTimeoutMinutes:r.heartbeatTimeoutMinutes??10,memberPresetIds:r.members?.map(l=>l.memberPresetId)??[]}}function zt(r,l,d,m){if(d.filter(A=>A===m).length<=1)return r;const W=d.slice(0,l+1).filter(A=>A===m).length;return`${r} #${W}`}function Lt(r){return Array.from(new Set(r.split(/[\n,]/).map(l=>l.trim()).filter(Boolean)))}function Bt(r){return r.trim()||null}function Oe(r){return ze.reduce((l,d)=>l+(r[d.key]?1:0),0)}function E(r,l){return r instanceof Error?r.message:l}function Ut(r){return["image/png","image/jpeg","image/webp"].includes(r.type)}async function Yt(r){const l=new FormData;l.append("file",r);const d=await fetch(`${De}/attachments/upload`,{method:"POST",body:l});if(!d.ok){const m=await d.json().catch(()=>({}));throw new Error(m.error||m.message||`Upload failed (${d.status})`)}return d.json()}function G({title:r,error:l,isFetching:d,onRetry:m}){const{t:T}=Re();return e.jsx("div",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive-ink",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium",children:r}),e.jsx("div",{className:"mt-1 text-xs text-destructive-ink",children:E(l,T("请稍后重试。"))})]}),e.jsx(p,{type:"button",size:"sm",variant:"outline",onClick:m,disabled:d,children:T(d?"加载中...":"重试")})]})})}function br(){const{t:r}=Re(),{data:l,error:d,isError:m,isFetching:T,isLoading:W,refetch:A}=It(),{data:Be,error:ge,isError:w,isFetching:be,isLoading:V,refetch:fe}=gt(),{data:Ue,error:Ye,isError:D,isFetching:qe,isLoading:H,refetch:Ge}=bt(),Q=ft(),X=ht(),he=vt(),J=jt(),K=yt(),ve=Pt(),[Z,je]=i.useState("presets"),[C,ee]=i.useState("edit"),[h,te]=i.useState(null),[a,j]=i.useState(Y()),[ye,_]=i.useState(!1),[y,re]=i.useState(null),[We,se]=i.useState(!1),[Pe,Ne]=i.useState(!1),ke=i.useRef(null),[I,ae]=i.useState("edit"),[v,ne]=i.useState(null),[g,b]=i.useState(q()),[Te,P]=i.useState(!1),[N,oe]=i.useState(null),[we,F]=i.useState(!1),u=Be??_t,f=Ue??Ft,z=l??$t,$=i.useMemo(()=>new Map(u.map(t=>[t.id,t])),[u]),ie=i.useMemo(()=>new Map(f.map(t=>[t.id,t])),[f]),Ve=i.useMemo(()=>{const t=z.map(({provider:s,availability:n})=>({value:s.id,label:s.name+(n.type==="NOT_FOUND"?r(" (不可用)"):""),icon:e.jsx(Nt,{agentType:s.agentType,className:"size-4"}),disabled:n.type==="NOT_FOUND"}));return a.providerId&&!t.some(s=>s.value===a.providerId)&&t.unshift({value:a.providerId,label:`${a.providerId}${r(" (不可用)")}`,disabled:!0}),t},[a.providerId,z,r]),le=h?$.get(h)??null:null,de=v?ie.get(v)??null:null,He=i.useMemo(()=>new Map(z.map(({provider:t,availability:s})=>[t.id,t.name+(s.type==="NOT_FOUND"?r(" (不可用)"):"")])),[z,r]);if(i.useEffect(()=>{if(!(V||w||ye)){if(C==="create"){j(Y());return}if(h){const t=$.get(h);t&&j(xe(t));return}if(u.length>0){const t=u[0];te(t.id),ee("edit"),j(xe(t));return}ee("create"),te(null),j(Y())}},[$,ye,C,u,w,V,h]),i.useEffect(()=>{if(!(H||D||Te)){if(I==="create"){b(q());return}if(v){const t=ie.get(v);t&&b(pe(t));return}if(f.length>0){const t=f[0];ne(t.id),ae("edit"),b(pe(t));return}ae("create"),ne(null),b(q())}},[v,ie,Te,I,f,D,H]),W||V||H)return e.jsx(Ee,{className:"max-w-6xl",children:e.jsx(kt,{cards:6})});const x=(t,s)=>{j(n=>({...n,[t]:s})),_(!0)},Qe=(t,s)=>{j(n=>({...n,capabilities:{...n.capabilities,[t]:s}})),_(!0)},Xe=t=>{x("avatar",t),se(!1)},Je=()=>{x("avatar","")},Ke=async t=>{const s=t.target.files?.[0];if(t.target.value="",!!s){if(!Ut(s)){c.error(r("仅支持 PNG、JPG、WebP 头像。"));return}if(s.size>At){c.error(r("头像图片不能超过 2MB。"));return}Ne(!0);try{const n=await Yt(s);x("avatar",`${De}${n.url}`),c.success(r("头像已上传"))}catch(n){c.error(E(n,r("头像上传失败")))}finally{Ne(!1)}}},S=(t,s)=>{ee(t),te(s?.id??null),j(s?xe(s):Y()),_(!1)},Ce=(t,s)=>{b(n=>({...n,[t]:s})),P(!0)},M=(t,s)=>{ae(t),ne(s?.id??null),b(s?pe(s):q()),P(!1)},Ze=async()=>{const t={name:a.name.trim(),aliases:Lt(a.aliasesText),providerId:a.providerId.trim(),rolePrompt:a.rolePrompt.trim(),capabilities:{...a.capabilities},workspacePolicy:a.workspacePolicy,triggerPolicy:a.triggerPolicy,sessionPolicy:a.sessionPolicy,queueManagementPolicy:a.queueManagementPolicy,avatar:Bt(a.avatar)};try{if(C==="create"||!h){const s=await Q.mutateAsync(t);S("edit",s),c.success(r("已创建"))}else{const s=await X.mutateAsync({id:h,data:t});S("edit",s),c.success(r("已保存"))}}catch(s){c.error(E(s,r("保存失败")))}},et=async()=>{if(y)try{await he.mutateAsync(y.id),c.success(r("Deleted"));const t=u.filter(s=>s.id!==y.id);h===y.id&&(t.length>0?S("edit",t[0]):S("create",null)),re(null)}catch(t){c.error(E(t,r("删除失败")))}},tt=async()=>{const t={name:g.name.trim(),heartbeatTimeoutMinutes:g.heartbeatTimeoutMinutes,memberPresetIds:g.memberPresetIds};try{if(I==="create"||!v){const s=await J.mutateAsync(t);M("edit",s),c.success(r("已创建"))}else{const s=await K.mutateAsync({id:v,data:t});M("edit",s),c.success(r("已保存"))}}catch(s){c.error(E(s,r("保存失败")))}},rt=async()=>{if(N)try{await ve.mutateAsync(N.id),c.success(r("Deleted"));const t=f.filter(s=>s.id!==N.id);v===N.id&&(t.length>0?M("edit",t[0]):M("create",null)),oe(null)}catch(t){c.error(E(t,r("删除失败")))}},st=Oe(a.capabilities),at=!!a.name.trim()&&!!a.providerId.trim()&&!!a.rolePrompt.trim()&&!m&&!w&&!Q.isPending&&!X.isPending,nt=!!g.name.trim()&&!D&&!w&&!J.isPending&&!K.isPending,ce=g.memberPresetIds.map(t=>$.get(t)).filter(t=>!!t),ot=t=>{_(!1),S("edit",t)},it=()=>{_(!1),S("create",null)},lt=t=>{P(!1),M("edit",t)},dt=()=>{P(!1),M("create",null)},ct=t=>{b(s=>({...s,memberPresetIds:[...s.memberPresetIds,t]})),P(!0)},mt=t=>{b(s=>({...s,memberPresetIds:s.memberPresetIds.filter((n,k)=>k!==t)})),P(!0)},Ie=(t,s)=>{b(n=>{const k=t+s;if(k<0||k>=n.memberPresetIds.length)return n;const me=[...n.memberPresetIds],[pt]=me.splice(t,1);return me.splice(k,0,pt),{...n,memberPresetIds:me}}),P(!0)},ut=t=>{ot(t),F(!0)},Se=()=>{it(),F(!0)},xt=t=>{lt(t),F(!0)},Me=()=>{dt(),F(!0)},L=()=>F(!1);return e.jsxs(Ee,{className:"max-w-6xl",children:[e.jsx(Tt,{title:r("团队协作设置"),actions:e.jsxs("div",{className:"inline-flex rounded-lg border border-border bg-muted/80 p-0.5",children:[e.jsx("button",{type:"button",onClick:()=>{je("presets"),L()},className:B("rounded-md px-3 py-1.5 text-[12px] font-medium transition-all",Z==="presets"?"bg-background text-foreground shadow-raised":"text-muted-foreground hover:text-foreground"),children:r("成员预设")}),e.jsx("button",{type:"button",onClick:()=>{je("templates"),L()},className:B("rounded-md px-3 py-1.5 text-[12px] font-medium transition-all",Z==="templates"?"bg-background text-foreground shadow-raised":"text-muted-foreground hover:text-foreground"),children:r("团队模板")})]})}),m&&e.jsx(G,{title:r("Provider 列表加载失败"),error:d,isFetching:T,onRetry:()=>{A()}}),Z==="presets"?we?e.jsxs("div",{className:"rounded-xl border border-border bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/60 px-5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:L,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Ae,{size:14}),r("返回")]}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:C==="create"?r("创建新预设"):le?.name??r("编辑预设")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[C==="edit"&&le&&e.jsx("button",{onClick:()=>re(le),className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:r("删除"),children:e.jsx(ue,{size:14})}),e.jsx(p,{size:"sm",onClick:Ze,disabled:!at,children:Q.isPending||X.isPending?r("保存中..."):r(C==="create"?"创建":"保存")})]})]}),e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"shrink-0",children:[e.jsx(U,{name:a.name||r("Agent"),avatar:a.avatar,className:"h-14 w-14 text-sm"}),e.jsxs("div",{className:"flex justify-center gap-1 mt-2",children:[e.jsx("button",{type:"button",onClick:()=>se(!0),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r("选择")}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"·"}),e.jsx("button",{type:"button",onClick:()=>ke.current?.click(),disabled:Pe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(Pe?"...":"上传")}),a.avatar.trim()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"·"}),e.jsx("button",{type:"button",onClick:Je,className:"text-xs text-muted-foreground hover:text-destructive-ink transition-colors",children:r("清除")})]})]}),e.jsx("input",{ref:ke,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:Ke})]}),e.jsxs("div",{className:"flex-1 min-w-0 grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("名称")}),e.jsx("input",{value:a.name,onChange:t=>x("name",t.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("别名")}),e.jsx("input",{value:a.aliasesText,onChange:t=>x("aliasesText",t.target.value),placeholder:r("alice, a, reviewer"),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("Provider")}),e.jsx(O,{value:a.providerId,onChange:t=>x("providerId",t),options:Ve,disabled:m}),m&&e.jsx("p",{className:"mt-1 text-xs text-destructive-ink",children:r("Provider 列表加载失败。")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("角色提示词")}),e.jsx("textarea",{value:a.rolePrompt,onChange:t=>x("rolePrompt",t.target.value),rows:4,className:"w-full rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm font-mono transition-colors focus:border-ring focus:bg-background focus:outline-none resize-y"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-end justify-between gap-3 mb-2",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted-foreground",children:r("可用能力")}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[st,"/10"]})]}),e.jsx("div",{className:"grid gap-1 sm:grid-cols-2 xl:grid-cols-3",children:ze.map(t=>e.jsxs("label",{className:"flex items-center gap-2 rounded px-2.5 py-1.5 text-[12px] text-foreground hover:bg-muted transition-colors cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a.capabilities[t.key],onChange:s=>Qe(t.key,s.target.checked),className:"h-3.5 w-3.5 rounded border-border"}),e.jsx("span",{children:r(t.label)})]},t.key))})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("工作区")}),e.jsx(O,{value:a.workspacePolicy,onChange:t=>x("workspacePolicy",t),options:$e.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("触发")}),e.jsx(O,{value:a.triggerPolicy,onChange:t=>x("triggerPolicy",t),options:Ot.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("会话")}),e.jsx(O,{value:a.sessionPolicy,onChange:t=>x("sessionPolicy",t),options:Rt.map(t=>({value:t.value,label:r(t.label)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("队列")}),e.jsx(O,{value:a.queueManagementPolicy,onChange:t=>x("queueManagementPolicy",t),options:Dt.map(t=>({value:t.value,label:r(t.label)}))})]})]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[e.jsx("span",{className:"text-[12px] text-muted-foreground",children:r("{count} 个成员预设",{count:u.length})}),e.jsxs(p,{size:"sm",variant:"outline",onClick:Se,children:[e.jsx(R,{size:13})," ",r("新增预设")]})]}),w?e.jsx(G,{title:r("加载失败"),error:ge,isFetching:be,onRetry:()=>{fe()}}):u.length===0?e.jsx(_e,{message:r("暂无成员预设"),action:e.jsxs(p,{size:"sm",onClick:Se,children:[e.jsx(R,{size:13,className:"mr-1"})," ",r("新增预设")]})}):e.jsx("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:u.map(t=>{const s=Oe(t.capabilities);return e.jsxs("button",{type:"button",onClick:()=>ut(t),className:"flex items-start gap-3 rounded-xl border border-border bg-background p-4 text-left transition-all hover:border-border hover:shadow-raised",children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-10 w-10 text-xs shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-foreground",children:t.name}),t.aliases.length>0&&e.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:t.aliases.join(", ")}),e.jsx("div",{className:"truncate text-xs text-muted-foreground mt-1",children:He.get(t.providerId)??t.providerId}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[e.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:r($e.find(n=>n.value===t.workspacePolicy)?.label??t.workspacePolicy)}),e.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:[s,"/10 ",r("能力")]})]})]})]},t.id)})})]}):we?e.jsxs("div",{className:"rounded-xl border border-border bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/60 px-5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:L,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Ae,{size:14}),r("返回")]}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:I==="create"?r("创建新模板"):de?.name??r("编辑模板")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[I==="edit"&&de&&e.jsx("button",{onClick:()=>oe(de),className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:r("删除"),children:e.jsx(ue,{size:14})}),e.jsx(p,{size:"sm",onClick:tt,disabled:!nt,children:J.isPending||K.isPending?r("保存中..."):r(I==="create"?"创建":"保存")})]})]}),e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("模板名称")}),e.jsx("input",{value:g.name,onChange:t=>Ce("name",t.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-1",children:r("成员心跳检测时间(分钟)")}),e.jsx("input",{type:"number",min:1,max:120,step:1,value:g.heartbeatTimeoutMinutes,onChange:t=>Ce("heartbeatTimeoutMinutes",Math.min(120,Math.max(1,Number(t.target.value)||1))),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm transition-colors focus:border-ring focus:outline-none"})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-2",children:r("可用预设")}),e.jsx("div",{className:"max-h-[400px] space-y-1 overflow-y-auto scrollbar-app-thin",children:w?e.jsx(G,{title:r("加载失败"),error:ge,isFetching:be,onRetry:()=>{fe()}}):u.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border p-3 text-center text-[12px] text-muted-foreground",children:r("先创建成员预设")}):u.map(t=>{const s=g.memberPresetIds.filter(n=>n===t.id).length;return e.jsxs("button",{type:"button",onClick:()=>ct(t.id),className:B("flex w-full items-center gap-2.5 rounded-lg border px-3 py-2 text-left transition-all",s>0?"border-foreground bg-muted":"border-border bg-background hover:border-border"),children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-7 w-7 text-[10px] shrink-0"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("div",{className:"truncate text-[12px] font-medium text-foreground",children:t.name})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s>0&&e.jsxs("span",{className:"rounded-full bg-primary px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground",children:["x",s]}),e.jsx(R,{size:13,className:"text-muted-foreground"})]})]},t.id)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-muted-foreground mb-2",children:r("已选成员")}),e.jsx("div",{className:"max-h-[400px] space-y-1 overflow-y-auto scrollbar-app-thin",children:ce.length===0?e.jsx("div",{className:"rounded-lg border border-dashed border-border p-3 text-center text-[12px] text-muted-foreground",children:r("尚未选择")}):ce.map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(U,{name:t.name,avatar:t.avatar,className:"h-7 w-7 text-[10px] shrink-0"}),e.jsx("span",{className:"truncate text-[12px] font-medium text-foreground",children:zt(t.name,s,g.memberPresetIds,t.id)})]}),e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>Ie(s,-1),disabled:s===0,children:e.jsx(St,{size:13})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>Ie(s,1),disabled:s===ce.length-1,children:e.jsx(Mt,{size:13})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>mt(s),children:e.jsx(ue,{size:13})})]})]},`${t.id}-${s}`))})]})]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[e.jsx("span",{className:"text-[12px] text-muted-foreground",children:r("{count} 个团队模板",{count:f.length})}),e.jsxs(p,{size:"sm",variant:"outline",onClick:Me,children:[e.jsx(R,{size:13})," ",r("新增模板")]})]}),D?e.jsx(G,{title:r("加载失败"),error:Ye,isFetching:qe,onRetry:()=>{Ge()}}):f.length===0?e.jsx(_e,{message:r("暂无团队模板"),action:e.jsxs(p,{size:"sm",onClick:Me,children:[e.jsx(R,{size:13,className:"mr-1"})," ",r("新增模板")]})}):e.jsx("div",{className:"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:f.map(t=>{const s=t.members?.length??0,n=(t.members??[]).slice(0,3).map(k=>$.get(k.memberPresetId)?.name).filter(Boolean);return e.jsxs("button",{type:"button",onClick:()=>xt(t),className:"flex flex-col rounded-xl border border-border bg-background p-4 text-left transition-all hover:border-border hover:shadow-raised",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-foreground",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:r("{count} 个成员",{count:s})}),n.length>0&&e.jsxs("div",{className:"truncate text-xs text-muted-foreground mt-1.5",children:[n.join(", "),s>3?` +${s-3}`:""]})]},t.id)})})]}),e.jsx(Fe,{isOpen:!!y,onClose:()=>re(null),onConfirm:et,title:r("删除"),description:y?r('确定删除 "{name}"?此操作不可撤销。',{name:y.name}):"",variant:"danger",confirmText:r("删除"),cancelText:r("取消"),isLoading:he.isPending}),e.jsx(Ct,{isOpen:We,onClose:()=>se(!1),title:r("选择预设头像"),className:"max-w-2xl",children:e.jsx("div",{className:"grid grid-cols-4 gap-2 sm:grid-cols-5",children:Et.map(t=>{const s=a.avatar===t.src;return e.jsxs("button",{type:"button",onClick:()=>Xe(t.src),className:B("group rounded-xl border bg-background p-2 text-center transition-all hover:border-foreground/20 hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring/60",s?"border-foreground ring-2 ring-foreground":"border-border"),"aria-pressed":s,"aria-label":r("选择 {name} 头像",{name:t.label}),children:[e.jsx("img",{src:t.src,alt:t.label,loading:"lazy",className:"mx-auto h-14 w-14 rounded-full object-cover sm:h-16 sm:w-16"}),e.jsx("span",{className:"mt-1 block truncate text-xs font-medium text-muted-foreground",children:t.label})]},t.id)})})}),e.jsx(Fe,{isOpen:!!N,onClose:()=>oe(null),onConfirm:rt,title:r("删除"),description:N?r('确定删除 "{name}"?此操作不可撤销。',{name:N.name}):"",variant:"danger",confirmText:r("删除"),cancelText:r("取消"),isLoading:ve.isPending})]})}export{br as TeamSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,M as n}from"./index-DkRy6eNX.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-BJObbxud.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-BSEeayBq.js";import{_ as i}from"./index-DkRy6eNX.js";import"./chunk-FMBD7UC4-DaLkiLdQ.js";import"./chunk-ND2GUHAM-DeQwZAAT.js";import"./chunk-55IACEB6-Dl4UhJ8X.js";import"./chunk-2J33WTMH-C439hRe_.js";import"./index-BJObbxud.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-BSEeayBq.js";import{_ as i}from"./index-DkRy6eNX.js";import"./chunk-FMBD7UC4-DaLkiLdQ.js";import"./chunk-ND2GUHAM-DeQwZAAT.js";import"./chunk-55IACEB6-Dl4UhJ8X.js";import"./chunk-2J33WTMH-C439hRe_.js";import"./index-BJObbxud.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as c,K as u,j as g}from"./index-BJObbxud.js";import{C as p}from"./dialog-CuFEdqLg.js";const x=({isOpen:o,onClose:n,onConfirm:e,title:r,description:s,confirmText:t="确认",cancelText:l="取消",variant:i="default",isLoading:f=!1})=>{const{t:a}=c();return u(o),g.jsx(p,{open:o,onOpenChange:m=>{m||n()},title:r,description:s,confirmLabel:a(t),cancelLabel:a(l),tone:i==="danger"?"danger":"neutral",loading:f,onConfirm:e})};export{x as C};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as f,u as _,r as h,j as e,b as I,n as x,bf as T,bg as F,a6 as z,aD as S,aE as L,aF as M,aH as A,bh as v,ba as B,bi as H}from"./index-BJObbxud.js";import{C as O}from"./check-BmiJ7qMY.js";import{C as D}from"./copy-HRMhTkIG.js";import{F as $}from"./tooltip-CPqGK_WZ.js";import{F as G}from"./search-field-CQLDXLeA.js";const P=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],me=f("code-xml",P);const R=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],V=f("file-code",R);const X=[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],q=f("file-image",X);const K=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],xe=f("folder-open",K);const W=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Y=f("git-commit-horizontal",W);const J=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ue=f("history",J);const Q=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],pe=f("play",Q);function fe(s=document.documentElement){const t=getComputedStyle(s),n=c=>t.getPropertyValue(c).trim(),a=n("--terminal"),r=n("--terminal-foreground"),o=n("--terminal-red"),i=n("--terminal-green"),u=n("--terminal-yellow"),m=n("--terminal-blue"),l=n("--terminal-magenta"),d=n("--terminal-cyan");return{background:a,foreground:r,cursor:r,selectionBackground:n("--terminal-selection"),black:a,red:o,green:i,yellow:u,blue:m,magenta:l,cyan:d,white:r,brightBlack:n("--terminal-bright-black"),brightRed:o,brightGreen:i,brightYellow:u,brightBlue:m,brightMagenta:l,brightCyan:d,brightWhite:n("--terminal-bright-white")}}async function U(s){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(s);return}const t=document.createElement("textarea");t.value=s,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}function b({value:s,display:t="icon",variant:n="ghost",size:a="sm",label:r,copiedLabel:o,onCopied:i,className:u}){const{t:m}=_(),[l,d]=h.useState(!1),c=h.useRef(null);h.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const p=r??m("Copy"),g=o??m("Copied"),y=l?g:p,C=async()=>{try{await U(s),d(!0),i?.(),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(!1),1600)}catch{d(!1)}},E=l?e.jsx(O,{className:"text-success"}):e.jsx(D,{});return e.jsxs("button",{type:"button","data-slot":"copy-button",onClick:C,"aria-label":t==="icon"?y:void 0,title:t==="icon"?p:void 0,className:I({variant:n,size:a,iconOnly:t==="icon",className:x(t==="text"&&"tabular-nums",u)}),children:[E,t==="text"&&e.jsx("span",{children:y}),e.jsx("span",{className:"sr-only","aria-live":"polite",children:l?g:""})]})}function he({label:s,description:t,error:n,required:a=!1,counter:r,htmlFor:o,className:i,children:u}){const m=h.useId(),l=o??`${m}-control`,d=`${m}-message`,c=!!(n||t),p=h.useMemo(()=>({id:l,describedBy:c?d:void 0,invalid:!!n,required:a}),[l,c,d,n,a]);return e.jsxs("div",{"data-slot":"field",className:x("flex min-w-0 flex-col gap-1.5",i),children:[(s||r)&&e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s&&e.jsxs("label",{htmlFor:l,className:"text-[13px] font-medium text-foreground",children:[s,a&&e.jsx("span",{"aria-hidden":"true",className:"ml-0.5 text-destructive-ink",children:"*"})]}),T(r)&&e.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:r})]}),e.jsx(F.Provider,{value:p,children:u}),n?e.jsxs("p",{id:d,className:"flex items-start gap-1 text-xs leading-relaxed text-destructive-ink",children:[e.jsx(z,{"aria-hidden":"true",className:"mt-[3px] size-3 shrink-0"}),e.jsx("span",{children:n})]}):t?e.jsx("p",{id:d,className:"text-xs leading-relaxed text-muted-foreground",children:t}):null]})}const j=22,N=18;function ge({invalid:s,autoResize:t=!1,minRows:n=3,maxRows:a=10,className:r,style:o,id:i,disabled:u,required:m,"aria-describedby":l,...d}){const c=S(),p=s??c?.invalid??!1,g=t?{fieldSizing:"content",minHeight:n*j+N,maxHeight:a*j+N}:{};return e.jsx("textarea",{"data-slot":"textarea",id:i??c?.id,disabled:u,required:m??c?.required,"aria-invalid":p||void 0,"aria-describedby":l??c?.describedBy,rows:t?void 0:n,style:{...g,...o},className:x(A,"block w-full resize-none px-3 py-2 text-sm leading-[22px] outline-none placeholder:text-muted-foreground/70 focus:border-ring",p&&M,u&&L,r),...d})}const Z={A:"success",M:"warning",D:"danger",R:"info"};function ee(s){return Z[s]??"warning"}const te=new Set(["ts","tsx","js","jsx","mjs","json","css","html","py","go","rs","java","sh","yml","yaml","toml","prisma","sql"]),se=new Set(["png","jpg","jpeg","gif","svg","webp"]),ne=new Set(["md","mdx","txt","log"]);function k({name:s,className:t}){const n=s.split(".").pop()?.toLowerCase()??"",a=te.has(n)?V:se.has(n)?q:ne.has(n)?$:G;return e.jsx(a,{"aria-hidden":"true",className:x("size-3.5 shrink-0 text-muted-foreground",t)})}function w(s){const t=s.lastIndexOf("/");return t===-1?{dir:"",name:s}:{dir:s.slice(0,t),name:s.slice(t+1)}}function ae({status:s,size:t="sm",className:n}){const a=ee(s);return e.jsx("span",{className:x("flex shrink-0 items-center justify-center rounded-[3px] font-mono font-semibold",t==="sm"?"size-4 text-[10px]":"size-5 text-[11px]",H[a],B[a],n),children:s})}function be({path:s,status:t,additions:n,deletions:a,active:r=!1,className:o,type:i,...u}){const{dir:m,name:l}=w(s);return e.jsxs("button",{type:i??"button",title:s,"aria-current":r||void 0,className:x("flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",r?"bg-background shadow-raised ring-1 ring-border/80":"hover:bg-accent",o),...u,children:[t&&e.jsx(ae,{status:t}),e.jsx(k,{name:l}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-foreground/90",children:l}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left font-mono text-[11px] text-muted-foreground [direction:rtl]",children:e.jsx("span",{dir:"ltr",children:m})}),(n!==void 0||a!==void 0)&&e.jsx(v,{additions:n,deletions:a})]})}function ye({path:s,className:t}){const{name:n}=w(s);return e.jsxs("span",{title:s,className:x("inline-flex h-6 max-w-full items-center gap-1 rounded-md bg-foreground/[0.05] px-1.5 align-middle font-mono text-[11px] text-foreground/85",t),children:[e.jsx(k,{name:n,className:"size-3"}),e.jsx("span",{className:"truncate",children:n})]})}function je({message:s,hash:t,author:n,time:a,additions:r,deletions:o,className:i}){return e.jsxs("div",{className:x("flex items-center gap-2.5 py-2",i),children:[e.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-foreground/[0.05] text-muted-foreground",children:e.jsx(Y,{"aria-hidden":"true",className:"size-3.5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] text-foreground/90",children:s}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[n,n&&a&&e.jsx("span",{"aria-hidden":"true",children:"·"}),a,(r!==void 0||o!==void 0)&&e.jsx(v,{additions:r,deletions:o,className:"ml-1"})]})]}),e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx("code",{className:"font-mono text-[11px] text-muted-foreground",children:t.slice(0,7)}),e.jsx(b,{value:t,size:"xs"})]})]})}function Ne({code:s,title:t,lineNumbers:n=!1,className:a}){const r=s.replace(/\n$/,"").split(`
|
|
2
|
-
`);return e.jsxs("div",{className:x("overflow-hidden rounded-lg border border-border/60 bg-foreground/[0.025]",a),children:[e.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border/50 pl-3 pr-1",children:[e.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:t}),e.jsx(b,{value:s,size:"xs"})]}),e.jsx("pre",{className:"overflow-x-auto py-2.5 font-mono text-xs leading-5 text-foreground/90 scrollbar-app-thin",children:r.map((o,i)=>e.jsxs("div",{className:"flex px-3",children:[n&&e.jsx("span",{"aria-hidden":"true",className:"mr-4 w-5 shrink-0 select-none text-right text-muted-foreground/50",children:i+1}),e.jsx("code",{className:"whitespace-pre",children:o||" "})]},i))})]})}const re={command:"text-terminal-foreground",output:"text-terminal-foreground",success:"text-terminal-green",error:"text-terminal-red",warning:"text-terminal-yellow",info:"text-terminal-blue",muted:"text-terminal-bright-black"};function ve({title:s,status:t,lines:n,className:a}){return e.jsxs("div",{className:x("overflow-hidden rounded-lg bg-terminal",a),children:[(s||t)&&e.jsxs("div",{className:"flex h-8 items-center justify-between gap-3 border-b border-terminal-border px-3 text-[11px] text-terminal-muted-foreground",children:[e.jsx("span",{className:"truncate font-mono",children:s}),t]}),e.jsx("pre",{className:"overflow-x-auto p-3 font-mono text-xs leading-5 scrollbar-app-thin",children:n.map((r,o)=>e.jsxs("div",{className:x("whitespace-pre",re[r.kind??"output"]),children:[r.kind==="command"&&e.jsx("span",{className:"text-terminal-bright-black",children:"$ "}),r.text]},o))})]})}function ke({text:s,className:t}){return e.jsxs("div",{className:x("relative rounded-lg border border-border/70 bg-foreground/[0.02] py-2.5 pl-3 pr-[72px] text-[13px] leading-relaxed text-foreground/90",t),children:[e.jsx("p",{className:"whitespace-pre-wrap break-words",children:s}),e.jsx(b,{value:s,display:"text",size:"xs",variant:"ghost",className:"absolute right-1.5 top-2"})]})}export{me as C,ae as F,Y as G,ue as H,pe as P,ve as T,xe as a,Ne as b,je as c,b as d,Z as e,he as f,ye as g,k as h,be as i,ke as j,ge as k,ee as l,fe as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as g,l as o}from"./monaco-BkuNyOkP.js";import{C as l,H as h,D as c,a as u,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-DWu2Ubf0.js";import{h as Ee,i as Le,j as be,t as He,k as ye}from"./lspLanguageFeatures-DWu2Ubf0.js";import"./EditableTaskTitle-BJ9Rxggf.js";import"./index-BJObbxud.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./index-Bhvt-E6d.js";import"./index-B1oVmCie.js";import"./index-Dk3bRQAK.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./chevron-down-3y5Aiolp.js";import"./use-providers-Td1-gyrN.js";import"./MemberAvatar-YVr_erAr.js";import"./people-DT78SebR.js";import"./chevron-up-DqaYcjpq.js";import"./at-sign-C48_y345.js";import"./paperclip-CTNoXpUW.js";import"./check-BmiJ7qMY.js";import"./useTokenUsage-DDXf7E4p.js";import"./CreateTaskInput-CasITF8y.js";import"./use-projects-Ddz0knyr.js";import"./BrandLogo-BUimEX-9.js";import"./hooks-BLxb16IA.js";import"./index-BtUQYU5l.js";import"./index-DZLnTISJ.js";import"./trash-2-CvUJsbtT.js";import"./ExecutionPermissionSelector-B8befbxJ.js";import"./menu--sjyisSg.js";import"./menu-styles-DWynpVVz.js";import"./confirm-dialog-ltNBFYCs.js";import"./dialog-CuFEdqLg.js";import"./modal-CSGOqphK.js";import"./select-BPdJrr5M.js";import"./select-B5RYunTs.js";import"./index-CThFsQNP.js";import"./layers-eaHAVcc3.js";import"./message-square-BLEJN6p7.js";import"./textarea-BVyPl9rM.js";import"./content-DPQMfMae.js";import"./search-field-CQLDXLeA.js";import"./popover-BiVxGGgp.js";import"./search-DniD_AGC.js";import"./server-xswxWpKD.js";import"./icon-button-CYiKa-7C.js";import"./use-workspaces-CdJZLmGh.js";import"./upload-CsXAmAun.js";import"./globe-B9I-jHBB.js";import"./ProjectKanbanPage-Bt_01giW.js";import"./BranchSelect-Cofp8vYf.js";import"./pencil-Cp70ZwtG.js";const C=120*1e3;class A{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=g({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-DBVD8oXr.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function We(s){const n=[],e=[],a=new A(s);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function d(){const{languageId:t,modeConfiguration:i}=s;m(e),i.completionItems&&e.push(o.registerCompletionItemProvider(t,new l(r,["/","-",":"]))),i.hovers&&e.push(o.registerHoverProvider(t,new h(r))),i.documentHighlights&&e.push(o.registerDocumentHighlightProvider(t,new c(r))),i.definitions&&e.push(o.registerDefinitionProvider(t,new u(r))),i.references&&e.push(o.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(o.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(o.registerRenameProvider(t,new w(r))),i.colors&&e.push(o.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(o.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,s.onDidChange)),i.selectionRanges&&e.push(o.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(o.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(o.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return d(),n.push(p(e)),p(n)}function p(s){return{dispose:()=>m(s)}}function m(s){for(;s.length;)s.pop().dispose()}export{l as CompletionAdapter,u as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,c as DocumentHighlightAdapter,Ee as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,h as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,A as WorkerManager,Le as fromPosition,be as fromRange,We as setupMode,He as toRange,ye as toTextEdit};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as i,x as H,j as t,y as h,D as C,P as p,C as g,E as V,z as b,F as q,aa as K,u as U,X,n as Y,N as y,ab as Z}from"./index-BJObbxud.js";import{P as J,R as Q,h as ee,u as te,F as oe,D as ne}from"./index-Bhvt-E6d.js";var m="Dialog",[_]=V(m),[ae,d]=_(m),E=e=>{const{__scopeDialog:o,children:r,open:s,defaultOpen:a,onOpenChange:n,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[v,D]=H({prop:s,defaultProp:a??!1,onChange:n,caller:m});return t.jsx(ae,{scope:o,triggerRef:c,contentRef:u,contentId:h(),titleId:h(),descriptionId:h(),open:v,onOpenChange:D,onOpenToggle:i.useCallback(()=>D(B=>!B),[D]),modal:l,children:r})};E.displayName=m;var I="DialogTrigger",P=i.forwardRef((e,o)=>{const{__scopeDialog:r,...s}=e,a=d(I,r),n=b(o,a.triggerRef);return t.jsx(p.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":R(a.open),...s,ref:n,onClick:g(e.onClick,a.onOpenToggle)})});P.displayName=I;var j="DialogPortal",[re,O]=_(j,{forceMount:void 0}),w=e=>{const{__scopeDialog:o,forceMount:r,children:s,container:a}=e,n=d(j,o);return t.jsx(re,{scope:o,forceMount:r,children:i.Children.map(s,l=>t.jsx(C,{present:r||n.open,children:t.jsx(J,{asChild:!0,container:a,children:l})}))})};w.displayName=j;var x="DialogOverlay",A=i.forwardRef((e,o)=>{const r=O(x,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=d(x,e.__scopeDialog);return n.modal?t.jsx(C,{present:s||n.open,children:t.jsx(ie,{...a,ref:o})}):null});A.displayName=x;var se=q("DialogOverlay.RemoveScroll"),ie=i.forwardRef((e,o)=>{const{__scopeDialog:r,...s}=e,a=d(x,r);return t.jsx(Q,{as:se,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(p.div,{"data-state":R(a.open),...s,ref:o,style:{pointerEvents:"auto",...s.style}})})}),f="DialogContent",T=i.forwardRef((e,o)=>{const r=O(f,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=d(f,e.__scopeDialog);return t.jsx(C,{present:s||n.open,children:n.modal?t.jsx(le,{...a,ref:o}):t.jsx(ce,{...a,ref:o})})});T.displayName=f;var le=i.forwardRef((e,o)=>{const r=d(f,e.__scopeDialog),s=i.useRef(null),a=b(o,r.contentRef,s);return i.useEffect(()=>{const n=s.current;if(n)return ee(n)},[]),t.jsx(M,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,n=>{n.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,n=>{const l=n.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&n.preventDefault()}),onFocusOutside:g(e.onFocusOutside,n=>n.preventDefault())})}),ce=i.forwardRef((e,o)=>{const r=d(f,e.__scopeDialog),s=i.useRef(!1),a=i.useRef(!1);return t.jsx(M,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(s.current||r.triggerRef.current?.focus(),n.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(s.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=n.target;r.triggerRef.current?.contains(l)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),M=i.forwardRef((e,o)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:n,...l}=e,c=d(f,r),u=i.useRef(null),v=b(o,u);return te(),t.jsxs(t.Fragment,{children:[t.jsx(oe,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:n,children:t.jsx(ne,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":R(c.open),...l,ref:v,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(de,{titleId:c.titleId}),t.jsx(fe,{contentRef:u,descriptionId:c.descriptionId})]})]})}),N="DialogTitle",F=i.forwardRef((e,o)=>{const{__scopeDialog:r,...s}=e,a=d(N,r);return t.jsx(p.h2,{id:a.titleId,...s,ref:o})});F.displayName=N;var S="DialogDescription",k=i.forwardRef((e,o)=>{const{__scopeDialog:r,...s}=e,a=d(S,r);return t.jsx(p.p,{id:a.descriptionId,...s,ref:o})});k.displayName=S;var W="DialogClose",z=i.forwardRef((e,o)=>{const{__scopeDialog:r,...s}=e,a=d(W,r);return t.jsx(p.button,{type:"button",...s,ref:o,onClick:g(e.onClick,()=>a.onOpenChange(!1))})});z.displayName=W;function R(e){return e?"open":"closed"}var $="DialogTitleWarning",[ye,G]=K($,{contentName:f,titleName:N,docsSlug:"dialog"}),de=({titleId:e})=>{const o=G($),r=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ue="DialogDescriptionWarning",fe=({contentRef:e,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ue).contentName}}.`;return i.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");o&&a&&(document.getElementById(o)||console.warn(s))},[s,e,o]),null},ge=E,pe=P,xe=w,me=A,ve=T,De=F,he=k,L=z;const Ce=ge,_e=pe,Ee=L,be={sm:"max-w-sm",md:"max-w-md",lg:"max-w-xl",xl:"max-w-3xl"};function je({title:e,description:o,footer:r,size:s="md",hideClose:a=!1,className:n,children:l,...c}){const{t:u}=U();return t.jsxs(xe,{children:[t.jsx(me,{className:"fixed inset-0 z-[60] bg-black/20 duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0"}),t.jsxs(ve,{className:Y("fixed left-1/2 top-1/2 z-[60] flex max-h-[calc(100vh-2rem)] w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-background shadow-overlay outline-none","duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",be[s],n),...o?{}:{"aria-describedby":void 0},...c,children:[t.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-4 px-5 pb-3 pt-5",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(De,{className:"text-[15px] font-semibold leading-6 text-foreground",children:e}),o&&t.jsx(he,{asChild:!0,children:t.jsx("div",{className:"mt-1 text-[13px] leading-relaxed text-muted-foreground",children:o})})]}),!a&&t.jsx(L,{"aria-label":u("Close"),className:"-mr-1.5 -mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:t.jsx(X,{className:"size-4","aria-hidden":"true"})})]}),l&&t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-foreground/90",children:l}),r&&t.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border/60 bg-foreground/[0.015] px-5 py-3",children:r})]})]})}function Ie({open:e,onOpenChange:o,title:r,description:s,confirmLabel:a,cancelLabel:n,tone:l="neutral",loading:c=!1,onConfirm:u}){return t.jsx(Ce,{open:e,onOpenChange:o,children:t.jsx(je,{size:"sm",hideClose:!0,title:t.jsxs("span",{className:"flex items-center gap-2",children:[l==="danger"&&t.jsx("span",{className:"flex size-6 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:t.jsx(Z,{className:"size-3.5","aria-hidden":"true"})}),r]}),description:s,footer:t.jsxs(t.Fragment,{children:[t.jsx(y,{variant:"ghost",size:"md",onClick:()=>o(!1),disabled:c,children:n}),t.jsx(y,{variant:"primary",tone:l,size:"md",loading:c,onClick:u,children:a})]})})})}export{Ie as C,Ce as D,je as a,Ee as b,_e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-BkuNyOkP.js";import"./EditableTaskTitle-BJ9Rxggf.js";import"./index-BJObbxud.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./index-Bhvt-E6d.js";import"./index-B1oVmCie.js";import"./index-Dk3bRQAK.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./chevron-down-3y5Aiolp.js";import"./use-providers-Td1-gyrN.js";import"./MemberAvatar-YVr_erAr.js";import"./people-DT78SebR.js";import"./chevron-up-DqaYcjpq.js";import"./at-sign-C48_y345.js";import"./paperclip-CTNoXpUW.js";import"./check-BmiJ7qMY.js";import"./useTokenUsage-DDXf7E4p.js";import"./CreateTaskInput-CasITF8y.js";import"./use-projects-Ddz0knyr.js";import"./BrandLogo-BUimEX-9.js";import"./hooks-BLxb16IA.js";import"./index-BtUQYU5l.js";import"./index-DZLnTISJ.js";import"./trash-2-CvUJsbtT.js";import"./ExecutionPermissionSelector-B8befbxJ.js";import"./menu--sjyisSg.js";import"./menu-styles-DWynpVVz.js";import"./confirm-dialog-ltNBFYCs.js";import"./dialog-CuFEdqLg.js";import"./modal-CSGOqphK.js";import"./select-BPdJrr5M.js";import"./select-B5RYunTs.js";import"./index-CThFsQNP.js";import"./layers-eaHAVcc3.js";import"./message-square-BLEJN6p7.js";import"./textarea-BVyPl9rM.js";import"./content-DPQMfMae.js";import"./search-field-CQLDXLeA.js";import"./popover-BiVxGGgp.js";import"./search-DniD_AGC.js";import"./server-xswxWpKD.js";import"./icon-button-CYiKa-7C.js";import"./use-workspaces-CdJZLmGh.js";import"./upload-CsXAmAun.js";import"./globe-B9I-jHBB.js";import"./ProjectKanbanPage-Bt_01giW.js";import"./BranchSelect-Cofp8vYf.js";import"./pencil-Cp70ZwtG.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],et={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},mt={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{et as conf,mt as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f,r as n}from"./index-BJObbxud.js";const l=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],h=f("folder",l);function v(e=480){const[t,o]=n.useState(null),[d,u]=n.useState(0);return n.useEffect(()=>{if(!t||typeof ResizeObserver>"u")return;const c=new ResizeObserver(i=>{const r=Math.floor(i[0]?.contentRect.width??0);u(a=>a===r?a:r)});return c.observe(t),()=>c.disconnect()},[t]),[o,d||(typeof ResizeObserver<"u"?0:e)]}function m({value:e,defaultValue:t,onChange:o}){const[d,u]=n.useState(t),s=e!==void 0,c=s?e:d,i=n.useCallback(r=>{s||u(r),o?.(r)},[s,o]);return[c,i]}function p(e){if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia("(prefers-reduced-motion: reduce)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function w(){return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function M(){return n.useSyncExternalStore(p,w,()=>!1)}function y(e){return`${e}-${n.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`}export{h as F,y as a,v as b,M as c,m as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-BkuNyOkP.js";import"./EditableTaskTitle-BJ9Rxggf.js";import"./index-BJObbxud.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./index-Bhvt-E6d.js";import"./index-B1oVmCie.js";import"./index-Dk3bRQAK.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./chevron-down-3y5Aiolp.js";import"./use-providers-Td1-gyrN.js";import"./MemberAvatar-YVr_erAr.js";import"./people-DT78SebR.js";import"./chevron-up-DqaYcjpq.js";import"./at-sign-C48_y345.js";import"./paperclip-CTNoXpUW.js";import"./check-BmiJ7qMY.js";import"./useTokenUsage-DDXf7E4p.js";import"./CreateTaskInput-CasITF8y.js";import"./use-projects-Ddz0knyr.js";import"./BrandLogo-BUimEX-9.js";import"./hooks-BLxb16IA.js";import"./index-BtUQYU5l.js";import"./index-DZLnTISJ.js";import"./trash-2-CvUJsbtT.js";import"./ExecutionPermissionSelector-B8befbxJ.js";import"./menu--sjyisSg.js";import"./menu-styles-DWynpVVz.js";import"./confirm-dialog-ltNBFYCs.js";import"./dialog-CuFEdqLg.js";import"./modal-CSGOqphK.js";import"./select-BPdJrr5M.js";import"./select-B5RYunTs.js";import"./index-CThFsQNP.js";import"./layers-eaHAVcc3.js";import"./message-square-BLEJN6p7.js";import"./textarea-BVyPl9rM.js";import"./content-DPQMfMae.js";import"./search-field-CQLDXLeA.js";import"./popover-BiVxGGgp.js";import"./search-DniD_AGC.js";import"./server-xswxWpKD.js";import"./icon-button-CYiKa-7C.js";import"./use-workspaces-CdJZLmGh.js";import"./upload-CsXAmAun.js";import"./globe-B9I-jHBB.js";import"./ProjectKanbanPage-Bt_01giW.js";import"./BranchSelect-Cofp8vYf.js";import"./pencil-Cp70ZwtG.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],et={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},it={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{et as conf,it as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,l as t}from"./monaco-BkuNyOkP.js";import{H as p,D as g,h as d,F as l,b as c,S as u,c as h,f as w,g as _,C as R}from"./lspLanguageFeatures-DWu2Ubf0.js";import{a as Fe,e as Le,d as Ee,R as He,i as be,j as ye,t as Te,k as Ue}from"./lspLanguageFeatures-DWu2Ubf0.js";import"./EditableTaskTitle-BJ9Rxggf.js";import"./index-BJObbxud.js";import"./mermaid-NOHMQCX5-BSNbBj78.js";import"./AttachmentPreview-CLN1lnLe.js";import"./tooltip-CPqGK_WZ.js";import"./kbd-C88ut3t9.js";import"./index-Bhvt-E6d.js";import"./index-B1oVmCie.js";import"./index-Dk3bRQAK.js";import"./use-translation-settings-NYM0lmBx.js";import"./copy-HRMhTkIG.js";import"./index-DcOU2m2F.js";import"./chevron-down-3y5Aiolp.js";import"./use-providers-Td1-gyrN.js";import"./MemberAvatar-YVr_erAr.js";import"./people-DT78SebR.js";import"./chevron-up-DqaYcjpq.js";import"./at-sign-C48_y345.js";import"./paperclip-CTNoXpUW.js";import"./check-BmiJ7qMY.js";import"./useTokenUsage-DDXf7E4p.js";import"./CreateTaskInput-CasITF8y.js";import"./use-projects-Ddz0knyr.js";import"./BrandLogo-BUimEX-9.js";import"./hooks-BLxb16IA.js";import"./index-BtUQYU5l.js";import"./index-DZLnTISJ.js";import"./trash-2-CvUJsbtT.js";import"./ExecutionPermissionSelector-B8befbxJ.js";import"./menu--sjyisSg.js";import"./menu-styles-DWynpVVz.js";import"./confirm-dialog-ltNBFYCs.js";import"./dialog-CuFEdqLg.js";import"./modal-CSGOqphK.js";import"./select-BPdJrr5M.js";import"./select-B5RYunTs.js";import"./index-CThFsQNP.js";import"./layers-eaHAVcc3.js";import"./message-square-BLEJN6p7.js";import"./textarea-BVyPl9rM.js";import"./content-DPQMfMae.js";import"./search-field-CQLDXLeA.js";import"./popover-BiVxGGgp.js";import"./search-DniD_AGC.js";import"./server-xswxWpKD.js";import"./icon-button-CYiKa-7C.js";import"./use-workspaces-CdJZLmGh.js";import"./upload-CsXAmAun.js";import"./globe-B9I-jHBB.js";import"./ProjectKanbanPage-Bt_01giW.js";import"./BranchSelect-Cofp8vYf.js";import"./pencil-Cp70ZwtG.js";const I=120*1e3;class f{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-CwpTb9lJ.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(r=>e)}}class v extends R{constructor(o){super(o,[".",":","<",'"',"=","/"])}}function Se(i){const o=new f(i),e=(...n)=>o.getLanguageServiceWorker(...n);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new p(e)),t.registerDocumentHighlightProvider(r,new g(e)),t.registerLinkProvider(r,new d(e)),t.registerFoldingRangeProvider(r,new l(e)),t.registerDocumentSymbolProvider(r,new c(e)),t.registerSelectionRangeProvider(r,new u(e)),t.registerRenameProvider(r,new h(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function Ce(i){const o=[],e=[],r=new f(i);o.push(r);const n=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(n))),a.hovers&&e.push(t.registerHoverProvider(s,new p(n))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new g(n))),a.links&&e.push(t.registerLinkProvider(s,new d(n))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new c(n))),a.rename&&e.push(t.registerRenameProvider(s,new h(n))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new l(n))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new u(n))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(n))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(n)))}return P(),o.push(m(e)),m(o)}function m(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,Fe as DefinitionAdapter,Le as DiagnosticsAdapter,Ee as DocumentColorAdapter,w as DocumentFormattingEditProvider,g as DocumentHighlightAdapter,d as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,c as DocumentSymbolAdapter,l as FoldingRangeAdapter,p as HoverAdapter,He as ReferenceAdapter,h as RenameAdapter,u as SelectionRangeAdapter,f as WorkerManager,be as fromPosition,ye as fromRange,Ce as setupMode,Se as setupMode1,Te as toRange,Ue as toTextEdit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,S as c,b as l}from"./index-BJObbxud.js";function d({label:s,variant:n="ghost",tone:o="neutral",size:a="md",loading:t=!1,showTitle:r=!0,className:u,disabled:i,children:b,type:m,...x}){return e.jsx("button",{type:m??"button","data-slot":"icon-button","aria-label":s,title:r?s:void 0,className:l({variant:n,tone:o,size:a,iconOnly:!0,loading:t,className:u}),disabled:i||t,"aria-busy":t||void 0,...x,children:t?e.jsx(c,{size:a==="xs"?"xs":"sm"}):b})}export{d as I};
|