agent-tower 0.5.3-beta.4 → 0.5.3-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/prompts/team-room-system-shared-protocol.d.ts +2 -0
  2. package/dist/prompts/team-room-system-shared-protocol.d.ts.map +1 -0
  3. package/dist/prompts/team-room-system-shared-protocol.js +112 -0
  4. package/dist/prompts/team-room-system-shared-protocol.js.map +1 -0
  5. package/dist/routes/__tests__/filesystem.test.js +5 -2
  6. package/dist/routes/__tests__/filesystem.test.js.map +1 -1
  7. package/dist/routes/__tests__/git.test.d.ts +2 -0
  8. package/dist/routes/__tests__/git.test.d.ts.map +1 -0
  9. package/dist/routes/__tests__/git.test.js +47 -0
  10. package/dist/routes/__tests__/git.test.js.map +1 -0
  11. package/dist/routes/__tests__/workspaces.test.d.ts +2 -0
  12. package/dist/routes/__tests__/workspaces.test.d.ts.map +1 -0
  13. package/dist/routes/__tests__/workspaces.test.js +85 -0
  14. package/dist/routes/__tests__/workspaces.test.js.map +1 -0
  15. package/dist/routes/filesystem.d.ts.map +1 -1
  16. package/dist/routes/filesystem.js +4 -3
  17. package/dist/routes/filesystem.js.map +1 -1
  18. package/dist/routes/git.d.ts.map +1 -1
  19. package/dist/routes/git.js +32 -0
  20. package/dist/routes/git.js.map +1 -1
  21. package/dist/services/__tests__/project.service.test.js +56 -0
  22. package/dist/services/__tests__/project.service.test.js.map +1 -1
  23. package/dist/services/__tests__/task.service.test.js +49 -0
  24. package/dist/services/__tests__/task.service.test.js.map +1 -1
  25. package/dist/services/__tests__/team-reconciler.service.test.js +15 -9
  26. package/dist/services/__tests__/team-reconciler.service.test.js.map +1 -1
  27. package/dist/services/__tests__/team-run.service.test.js +27 -3
  28. package/dist/services/__tests__/team-run.service.test.js.map +1 -1
  29. package/dist/services/__tests__/team-scheduler.service.test.js +12 -5
  30. package/dist/services/__tests__/team-scheduler.service.test.js.map +1 -1
  31. package/dist/services/__tests__/workspace.service.test.js +49 -1
  32. package/dist/services/__tests__/workspace.service.test.js.map +1 -1
  33. package/dist/services/project-guards.d.ts +4 -0
  34. package/dist/services/project-guards.d.ts.map +1 -1
  35. package/dist/services/project-guards.js +10 -0
  36. package/dist/services/project-guards.js.map +1 -1
  37. package/dist/services/project.service.d.ts +6 -1
  38. package/dist/services/project.service.d.ts.map +1 -1
  39. package/dist/services/project.service.js +31 -29
  40. package/dist/services/project.service.js.map +1 -1
  41. package/dist/services/task.service.d.ts +152 -3
  42. package/dist/services/task.service.d.ts.map +1 -1
  43. package/dist/services/task.service.js +54 -9
  44. package/dist/services/task.service.js.map +1 -1
  45. package/dist/services/team-run.service.d.ts.map +1 -1
  46. package/dist/services/team-run.service.js +11 -2
  47. package/dist/services/team-run.service.js.map +1 -1
  48. package/dist/services/team-scheduler.service.d.ts.map +1 -1
  49. package/dist/services/team-scheduler.service.js +2 -1
  50. package/dist/services/team-scheduler.service.js.map +1 -1
  51. package/dist/services/workspace.service.d.ts.map +1 -1
  52. package/dist/services/workspace.service.js +9 -1
  53. package/dist/services/workspace.service.js.map +1 -1
  54. package/dist/web/assets/{AgentDemoPage-DC61uZJ_.js → AgentDemoPage-BqUFGORQ.js} +1 -1
  55. package/dist/web/assets/{AgentLogo-CGrwilQJ.js → AgentLogo-O_lfAIQi.js} +1 -1
  56. package/dist/web/assets/{ConversationPage-DvD_lYUj.js → ConversationPage-t8BHC8qL.js} +1 -1
  57. package/dist/web/assets/CreateTaskInput-D5aroK_o.js +2 -0
  58. package/dist/web/assets/{DemoPage-BDUjXkK3.js → DemoPage-DohwggTK.js} +1 -1
  59. package/dist/web/assets/{GeneralSettingsPage-DuYC1Vhv.js → GeneralSettingsPage-BqSO35vU.js} +1 -1
  60. package/dist/web/assets/{Icons-BqZeUyTx.js → Icons-B5Qr68Dp.js} +1 -1
  61. package/dist/web/assets/{LoadingPreviewPage-DPA8HxNr.js → LoadingPreviewPage-DBVTXpq2.js} +1 -1
  62. package/dist/web/assets/{McpSettingsPage-BO_Fd_mA.js → McpSettingsPage-B4hjk8Q6.js} +1 -1
  63. package/dist/web/assets/{MemberAvatar-BesdHRgJ.js → MemberAvatar-DmWOKCwf.js} +1 -1
  64. package/dist/web/assets/{NotificationSettingsPage-F5HPtn9-.js → NotificationSettingsPage-DiUyq7V-.js} +1 -1
  65. package/dist/web/assets/{ProfileSettingsPage-DweTPF_t.js → ProfileSettingsPage-BcUtq3sY.js} +1 -1
  66. package/dist/web/assets/{ProjectKanbanPage-taUI2xm6.js → ProjectKanbanPage-klp2fAN1.js} +35 -35
  67. package/dist/web/assets/ProjectSettingsPage-D2gQsbTJ.js +2 -0
  68. package/dist/web/assets/{ProviderSettingsPage-Cio0LIzm.js → ProviderSettingsPage-CX8WeQ3x.js} +1 -1
  69. package/dist/web/assets/{SettingsMasterDetail-BnqVBe7H.js → SettingsMasterDetail-BtiI8TDc.js} +1 -1
  70. package/dist/web/assets/TeamSettingsPage-CZgtzFUH.js +1 -0
  71. package/dist/web/assets/{arc-CYddG-Kz.js → arc-BP5t0cJz.js} +1 -1
  72. package/dist/web/assets/{architectureDiagram-3BPJPVTR-B3RXX4-J.js → architectureDiagram-3BPJPVTR-B4nGdxyB.js} +1 -1
  73. package/dist/web/assets/{arrow-left-CufhOEz9.js → arrow-left-CH7x-bnE.js} +1 -1
  74. package/dist/web/assets/{blockDiagram-GPEHLZMM-a7Dr_zcs.js → blockDiagram-GPEHLZMM-C0obS1hu.js} +1 -1
  75. package/dist/web/assets/{c4Diagram-AAUBKEIU-BLwSao_g.js → c4Diagram-AAUBKEIU-DLOq2msX.js} +1 -1
  76. package/dist/web/assets/channel-ByQ8jatA.js +1 -0
  77. package/dist/web/assets/check-EXzHBr5H.js +1 -0
  78. package/dist/web/assets/{chevron-down-BQyZkT4A.js → chevron-down-CBY3fFTT.js} +1 -1
  79. package/dist/web/assets/{chevron-right-94xg9kiO.js → chevron-right-DZo7j27r.js} +1 -1
  80. package/dist/web/assets/{chevron-up-BZM-aGAU.js → chevron-up-721LBv_e.js} +1 -1
  81. package/dist/web/assets/{chunk-2J33WTMH-CV8jFvSt.js → chunk-2J33WTMH-C07Su0AF.js} +1 -1
  82. package/dist/web/assets/{chunk-4BX2VUAB-DXquqZ4n.js → chunk-4BX2VUAB-DAdn-ED3.js} +1 -1
  83. package/dist/web/assets/{chunk-55IACEB6-BowEEH_6.js → chunk-55IACEB6-BL4-BcAX.js} +1 -1
  84. package/dist/web/assets/{chunk-727SXJPM-Cbn9G9U_.js → chunk-727SXJPM-BmmMDMNV.js} +1 -1
  85. package/dist/web/assets/{chunk-AQP2D5EJ-C-0K23VQ.js → chunk-AQP2D5EJ-CeLsYTvJ.js} +1 -1
  86. package/dist/web/assets/{chunk-FMBD7UC4-BJv0I_Lt.js → chunk-FMBD7UC4-Bs7S01MB.js} +1 -1
  87. package/dist/web/assets/{chunk-ND2GUHAM-DJBjsrJO.js → chunk-ND2GUHAM-uqytV5JO.js} +1 -1
  88. package/dist/web/assets/{chunk-QZHKN3VN-CBw_GG0t.js → chunk-QZHKN3VN-DGM3LKCe.js} +1 -1
  89. package/dist/web/assets/{circle-alert-lbce0dXY.js → circle-alert-Dkp6R_Ml.js} +1 -1
  90. package/dist/web/assets/classDiagram-4FO5ZUOK-BTR6CDm1.js +1 -0
  91. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BTR6CDm1.js +1 -0
  92. package/dist/web/assets/{code-block-OCS4YCEC-CRG-xCnX.js → code-block-OCS4YCEC-C_fs5i5h.js} +1 -1
  93. package/dist/web/assets/{confirm-dialog-Cnw_rxtM.js → confirm-dialog-IGqDL03n.js} +1 -1
  94. package/dist/web/assets/{cose-bilkent-S5V4N54A-DCNqQrFt.js → cose-bilkent-S5V4N54A-2VABc7UM.js} +1 -1
  95. package/dist/web/assets/{dagre-BM42HDAG-oecZRFap.js → dagre-BM42HDAG-D0-HOAOA.js} +1 -1
  96. package/dist/web/assets/{diagram-2AECGRRQ-BXx6WNMi.js → diagram-2AECGRRQ-Cyt7AAOQ.js} +1 -1
  97. package/dist/web/assets/{diagram-5GNKFQAL-Bu66xpEW.js → diagram-5GNKFQAL-BBv9SoKB.js} +1 -1
  98. package/dist/web/assets/{diagram-KO2AKTUF-ZGMyoO90.js → diagram-KO2AKTUF-DV5NTHkX.js} +1 -1
  99. package/dist/web/assets/{diagram-LMA3HP47-riQUwPgu.js → diagram-LMA3HP47-eNPojcJF.js} +1 -1
  100. package/dist/web/assets/{diagram-OG6HWLK6-H_PHYJoy.js → diagram-OG6HWLK6-DYNkChUG.js} +1 -1
  101. package/dist/web/assets/{erDiagram-TEJ5UH35-ePGpWuWD.js → erDiagram-TEJ5UH35-ZXZ2vyVY.js} +1 -1
  102. package/dist/web/assets/{flowDiagram-I6XJVG4X-BZUDzSVZ.js → flowDiagram-I6XJVG4X-E8oqHUJx.js} +1 -1
  103. package/dist/web/assets/{folder-Ca5RFac7.js → folder-BxT7ExMF.js} +1 -1
  104. package/dist/web/assets/folder-picker-57gIIPSi.js +1 -0
  105. package/dist/web/assets/{ganttDiagram-6RSMTGT7-D2UOmWEL.js → ganttDiagram-6RSMTGT7-CEAjt7Nr.js} +1 -1
  106. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-DEzWWRW3.js → gitGraphDiagram-PVQCEYII-3dNQBESX.js} +1 -1
  107. package/dist/web/assets/{index-M-QRACZK.js → index-B2TV-FU2.js} +3 -3
  108. package/dist/web/assets/index-D1vY2KQU.css +1 -0
  109. package/dist/web/assets/{index-JK3A62-g.js → index-DhYpUXuu.js} +4 -4
  110. package/dist/web/assets/{infoDiagram-5YYISTIA-BNClnI_5.js → infoDiagram-5YYISTIA-DkDDpqvX.js} +1 -1
  111. package/dist/web/assets/{input-7UYarzFy.js → input-CupQF5Np.js} +1 -1
  112. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-B1aSs8GW.js → ishikawaDiagram-YF4QCWOH-BSm79ZFA.js} +1 -1
  113. package/dist/web/assets/{journeyDiagram-JHISSGLW-DlXxUTcw.js → journeyDiagram-JHISSGLW-BCP6kLky.js} +1 -1
  114. package/dist/web/assets/{kanban-definition-UN3LZRKU-Ctkuw8kN.js → kanban-definition-UN3LZRKU-jzLQwKw3.js} +1 -1
  115. package/dist/web/assets/{layers-C89p38EX.js → layers-CCP9NEZU.js} +1 -1
  116. package/dist/web/assets/{linear--QsFiowO.js → linear-DWq5jvYH.js} +1 -1
  117. package/dist/web/assets/{loader-circle-DolxjVmY.js → loader-circle-RvIxJahM.js} +1 -1
  118. package/dist/web/assets/{mermaid-NOHMQCX5-CW_FGpKP.js → mermaid-NOHMQCX5-v8DEF9xx.js} +3 -3
  119. package/dist/web/assets/{message-square-KV4Azzxs.js → message-square-tSoG7yGO.js} +1 -1
  120. package/dist/web/assets/{mindmap-definition-RKZ34NQL-Dm6rZMiM.js → mindmap-definition-RKZ34NQL-C5FxGBPQ.js} +1 -1
  121. package/dist/web/assets/{modal-PZSR91HW.js → modal-Dc2shjmi.js} +1 -1
  122. package/dist/web/assets/{pencil-9lMJOuw2.js → pencil-BOmVWDhP.js} +1 -1
  123. package/dist/web/assets/{pieDiagram-4H26LBE5-DbQPjRBP.js → pieDiagram-4H26LBE5-CmWVRs82.js} +1 -1
  124. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-DeRrMc4Y.js → quadrantDiagram-W4KKPZXB-B4s3NNDO.js} +1 -1
  125. package/dist/web/assets/{requirementDiagram-4Y6WPE33-aajAoXSH.js → requirementDiagram-4Y6WPE33-C2KmzOV2.js} +1 -1
  126. package/dist/web/assets/{rotate-ccw-D7tnDKF_.js → rotate-ccw-BJfFrvl2.js} +1 -1
  127. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-DWsta0ns.js → sankeyDiagram-5OEKKPKP-CJbPnzq8.js} +1 -1
  128. package/dist/web/assets/{select-CTiftuHJ.js → select-C_UWYFsQ.js} +1 -1
  129. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-BGBP9NTB.js → sequenceDiagram-3UESZ5HK-BFea2ow4.js} +1 -1
  130. package/dist/web/assets/{stateDiagram-AJRCARHV-Dl0Q7uMb.js → stateDiagram-AJRCARHV-osdtBRSX.js} +1 -1
  131. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-ChsboHHf.js +1 -0
  132. package/dist/web/assets/{switch-BhqMnTiu.js → switch-C6O0UllM.js} +1 -1
  133. package/dist/web/assets/{terminal-BR0PXV2W.js → terminal-BKrr_mRJ.js} +1 -1
  134. package/dist/web/assets/{textarea-eWIZ3eZW.js → textarea-Cj61Z7ha.js} +1 -1
  135. package/dist/web/assets/{timeline-definition-PNZ67QCA-DuDIvs1s.js → timeline-definition-PNZ67QCA-BlXV0jf2.js} +1 -1
  136. package/dist/web/assets/{trash-2-C7F85sIB.js → trash-2-D2zJVeEr.js} +1 -1
  137. package/dist/web/assets/{upload-CQTsuurY.js → upload-Q5mYpwnh.js} +1 -1
  138. package/dist/web/assets/{use-profiles-Btexu_oH.js → use-profiles-BSYIQUHp.js} +1 -1
  139. package/dist/web/assets/{use-providers-BEPU5ALg.js → use-providers-Ct5qGj1d.js} +1 -1
  140. package/dist/web/assets/{useNormalizedLogs-CvCCSYxy.js → useNormalizedLogs-DqPhzW9t.js} +1 -1
  141. package/dist/web/assets/{vennDiagram-CIIHVFJN-BDyKeyr8.js → vennDiagram-CIIHVFJN-CCuhn7zI.js} +1 -1
  142. package/dist/web/assets/{wardley-L42UT6IY-DAOA5Zsv.js → wardley-L42UT6IY-Xu-SY-Xt.js} +1 -1
  143. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CCmLvkBT.js → wardleyDiagram-YWT4CUSO-BDVBG-Eu.js} +1 -1
  144. package/dist/web/assets/{xychartDiagram-2RQKCTM6-EsyeKzfj.js → xychartDiagram-2RQKCTM6-DC5IWyMr.js} +1 -1
  145. package/dist/web/index.html +2 -2
  146. package/node_modules/@agent-tower/shared/dist/types.d.ts +4 -0
  147. package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
  148. package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
  149. package/node_modules/@prisma/client/.prisma/client/edge.js +2 -2
  150. package/node_modules/@prisma/client/.prisma/client/index.js +2 -2
  151. package/package.json +1 -1
  152. package/dist/web/assets/CreateTaskInput-CstzayW9.js +0 -2
  153. package/dist/web/assets/ProjectSettingsPage-BfTQwRb7.js +0 -2
  154. package/dist/web/assets/TeamSettingsPage-CHoLj7rL.js +0 -1
  155. package/dist/web/assets/channel-BTbcDemz.js +0 -1
  156. package/dist/web/assets/check-C5Ba8Rby.js +0 -1
  157. package/dist/web/assets/classDiagram-4FO5ZUOK-D4Noh8IG.js +0 -1
  158. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-D4Noh8IG.js +0 -1
  159. package/dist/web/assets/folder-picker-CZIjxGNQ.js +0 -1
  160. package/dist/web/assets/index-17XUvLGe.css +0 -1
  161. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BEhmiwth.js +0 -1
@@ -1 +1 @@
1
- import{h as P,i as q,k as E,l as k,q as v,m as h,u as R,r as o,j as e,S as g,T as B,d as L,e as j,U as W,B as z,f as M,Q as A}from"./index-M-QRACZK.js";import{S as Q}from"./select-CTiftuHJ.js";import{I as d}from"./input-7UYarzFy.js";import{S as K,C as O}from"./switch-BhqMnTiu.js";import{M as _}from"./message-square-KV4Azzxs.js";import{L as D}from"./loader-circle-DolxjVmY.js";import{C as H}from"./circle-alert-lbce0dXY.js";import"./chevron-down-BQyZkT4A.js";import"./check-C5Ba8Rby.js";const G=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],J=P("link",G);function V(){return q({queryKey:v.notifications.settings,queryFn:()=>h.get("/notifications/settings")})}function X(){const t=E();return k({mutationFn:i=>h.put("/notifications/settings",i),onSuccess:()=>{t.invalidateQueries({queryKey:v.notifications.settings})}})}function Y(){return k({mutationFn:t=>h.post("/notifications/test",t)})}function le(){const{t}=R(),{data:i,isLoading:T}=V(),l=X(),n=Y(),y=[{value:"none",label:t("关闭")},{value:"feishu",label:t("飞书 Webhook")}],[a,p]=o.useState({webhookUrl:"",baseUrl:"",titleTemplate:"",bodyTemplate:""}),[m,x]=o.useState(!1),[f,r]=o.useState("idle"),u=o.useRef(void 0);if(o.useEffect(()=>{i&&!m&&p({webhookUrl:i.feishuWebhookUrl??"",baseUrl:i.thirdPartyBaseUrl??"",titleTemplate:i.taskInReviewTitleTemplate??"",bodyTemplate:i.taskInReviewBodyTemplate??""})},[i,m]),o.useEffect(()=>(n.isSuccess?(r("success"),u.current=setTimeout(()=>r("idle"),3e3)):n.isError&&(r("error"),u.current=setTimeout(()=>r("idle"),5e3)),()=>clearTimeout(u.current)),[n.isSuccess,n.isError]),T)return e.jsx(g,{children:e.jsx(B,{rows:3})});const N=i?.osNotificationEnabled??!0,b=i?.thirdPartyChannel??"none",c=(s,I)=>{p(F=>({...F,[s]:I})),x(!0)},S=s=>{l.mutate({osNotificationEnabled:s})},C=s=>{l.mutate({thirdPartyChannel:s})},U=()=>{l.mutate({feishuWebhookUrl:a.webhookUrl.trim()||null,thirdPartyBaseUrl:a.baseUrl.trim()||null,taskInReviewTitleTemplate:a.titleTemplate.trim()||"Agent Tower",taskInReviewBodyTemplate:a.bodyTemplate.trim()||t('✅ "{taskTitle}" 已完成,等待审查')},{onSuccess:()=>x(!1)})},w=()=>{a.webhookUrl.trim()&&n.mutate({channel:"feishu",webhookUrl:a.webhookUrl.trim(),baseUrl:a.baseUrl.trim()||void 0})};return e.jsxs(g,{children:[e.jsx(L,{title:t("通知设置"),className:"mb-1"}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsx(j,{icon:W,label:t("桌面通知"),description:t("任务完成时弹出系统通知"),align:"center",controlWidth:"auto",children:e.jsx(K,{checked:N,onCheckedChange:S,"aria-label":t("桌面通知")})}),e.jsxs("div",{className:"py-5",children:[e.jsx(j,{icon:_,label:t("第三方通知"),description:t("推送到外部渠道(飞书群机器人等)"),align:"center",className:"py-0",children:e.jsx(Q,{value:b,onChange:s=>C(s),options:y})}),b==="feishu"&&e.jsxs("div",{className:"mt-4 space-y-4 sm:pl-11",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-webhook-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Webhook URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"feishu-webhook-url",value:a.webhookUrl,onChange:s=>c("webhookUrl",s.target.value),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"min-w-0 flex-1 font-mono"}),e.jsxs(z,{size:"sm",variant:"outline",onClick:w,disabled:!a.webhookUrl.trim()||n.isPending,className:"h-auto shrink-0",children:[n.isPending&&e.jsx(D,{size:12,className:"mr-1 animate-spin motion-reduce:animate-none"}),t("测试")]})]}),f==="success"&&e.jsxs("div",{role:"status",className:"mt-2 flex items-center gap-1.5 text-xs text-success",children:[e.jsx(O,{size:12,"aria-hidden":"true"}),t("测试消息发送成功")]}),f==="error"&&e.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-xs text-destructive",children:[e.jsx(H,{size:12,"aria-hidden":"true"}),t("发送失败,请检查 Webhook 地址")]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-base-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(J,{size:11,"aria-hidden":"true"}),t("跳转地址")]})}),e.jsx(d,{id:"feishu-base-url",value:a.baseUrl,onChange:s=>c("baseUrl",s.target.value),placeholder:"http://localhost:5173",className:"font-mono"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t('通知卡片中的"查看任务"按钮跳转地址前缀')})]})]})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(M,{children:t("通知模板")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("支持变量: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}",{taskTitle:"{taskTitle}",taskId:"{taskId}",projectId:"{projectId}",projectName:"{projectName}",status:"{status}"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-title-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("标题")}),e.jsx(d,{id:"notification-title-template",value:a.titleTemplate,onChange:s=>c("titleTemplate",s.target.value),placeholder:"Agent Tower"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-body-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("内容")}),e.jsx(d,{id:"notification-body-template",value:a.bodyTemplate,onChange:s=>c("bodyTemplate",s.target.value),placeholder:t('✅ "{taskTitle}" 已完成,等待审查')})]})]})]})]}),m&&e.jsx(A,{saving:l.isPending,onSave:U})]})}export{le as NotificationSettingsPage};
1
+ import{h as P,i as q,k as E,l as k,q as v,m as h,u as R,r as o,j as e,S as g,T as B,d as L,e as j,U as W,B as z,f as M,Q as A}from"./index-B2TV-FU2.js";import{S as Q}from"./select-C_UWYFsQ.js";import{I as d}from"./input-CupQF5Np.js";import{S as K,C as O}from"./switch-C6O0UllM.js";import{M as _}from"./message-square-tSoG7yGO.js";import{L as D}from"./loader-circle-RvIxJahM.js";import{C as H}from"./circle-alert-Dkp6R_Ml.js";import"./chevron-down-CBY3fFTT.js";import"./check-EXzHBr5H.js";const G=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],J=P("link",G);function V(){return q({queryKey:v.notifications.settings,queryFn:()=>h.get("/notifications/settings")})}function X(){const t=E();return k({mutationFn:i=>h.put("/notifications/settings",i),onSuccess:()=>{t.invalidateQueries({queryKey:v.notifications.settings})}})}function Y(){return k({mutationFn:t=>h.post("/notifications/test",t)})}function le(){const{t}=R(),{data:i,isLoading:T}=V(),l=X(),n=Y(),y=[{value:"none",label:t("关闭")},{value:"feishu",label:t("飞书 Webhook")}],[a,p]=o.useState({webhookUrl:"",baseUrl:"",titleTemplate:"",bodyTemplate:""}),[m,x]=o.useState(!1),[f,r]=o.useState("idle"),u=o.useRef(void 0);if(o.useEffect(()=>{i&&!m&&p({webhookUrl:i.feishuWebhookUrl??"",baseUrl:i.thirdPartyBaseUrl??"",titleTemplate:i.taskInReviewTitleTemplate??"",bodyTemplate:i.taskInReviewBodyTemplate??""})},[i,m]),o.useEffect(()=>(n.isSuccess?(r("success"),u.current=setTimeout(()=>r("idle"),3e3)):n.isError&&(r("error"),u.current=setTimeout(()=>r("idle"),5e3)),()=>clearTimeout(u.current)),[n.isSuccess,n.isError]),T)return e.jsx(g,{children:e.jsx(B,{rows:3})});const N=i?.osNotificationEnabled??!0,b=i?.thirdPartyChannel??"none",c=(s,I)=>{p(F=>({...F,[s]:I})),x(!0)},S=s=>{l.mutate({osNotificationEnabled:s})},C=s=>{l.mutate({thirdPartyChannel:s})},U=()=>{l.mutate({feishuWebhookUrl:a.webhookUrl.trim()||null,thirdPartyBaseUrl:a.baseUrl.trim()||null,taskInReviewTitleTemplate:a.titleTemplate.trim()||"Agent Tower",taskInReviewBodyTemplate:a.bodyTemplate.trim()||t('✅ "{taskTitle}" 已完成,等待审查')},{onSuccess:()=>x(!1)})},w=()=>{a.webhookUrl.trim()&&n.mutate({channel:"feishu",webhookUrl:a.webhookUrl.trim(),baseUrl:a.baseUrl.trim()||void 0})};return e.jsxs(g,{children:[e.jsx(L,{title:t("通知设置"),className:"mb-1"}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsx(j,{icon:W,label:t("桌面通知"),description:t("任务完成时弹出系统通知"),align:"center",controlWidth:"auto",children:e.jsx(K,{checked:N,onCheckedChange:S,"aria-label":t("桌面通知")})}),e.jsxs("div",{className:"py-5",children:[e.jsx(j,{icon:_,label:t("第三方通知"),description:t("推送到外部渠道(飞书群机器人等)"),align:"center",className:"py-0",children:e.jsx(Q,{value:b,onChange:s=>C(s),options:y})}),b==="feishu"&&e.jsxs("div",{className:"mt-4 space-y-4 sm:pl-11",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-webhook-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Webhook URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"feishu-webhook-url",value:a.webhookUrl,onChange:s=>c("webhookUrl",s.target.value),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"min-w-0 flex-1 font-mono"}),e.jsxs(z,{size:"sm",variant:"outline",onClick:w,disabled:!a.webhookUrl.trim()||n.isPending,className:"h-auto shrink-0",children:[n.isPending&&e.jsx(D,{size:12,className:"mr-1 animate-spin motion-reduce:animate-none"}),t("测试")]})]}),f==="success"&&e.jsxs("div",{role:"status",className:"mt-2 flex items-center gap-1.5 text-xs text-success",children:[e.jsx(O,{size:12,"aria-hidden":"true"}),t("测试消息发送成功")]}),f==="error"&&e.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-xs text-destructive",children:[e.jsx(H,{size:12,"aria-hidden":"true"}),t("发送失败,请检查 Webhook 地址")]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"feishu-base-url",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(J,{size:11,"aria-hidden":"true"}),t("跳转地址")]})}),e.jsx(d,{id:"feishu-base-url",value:a.baseUrl,onChange:s=>c("baseUrl",s.target.value),placeholder:"http://localhost:5173",className:"font-mono"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t('通知卡片中的"查看任务"按钮跳转地址前缀')})]})]})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(M,{children:t("通知模板")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("支持变量: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}",{taskTitle:"{taskTitle}",taskId:"{taskId}",projectId:"{projectId}",projectName:"{projectName}",status:"{status}"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-title-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("标题")}),e.jsx(d,{id:"notification-title-template",value:a.titleTemplate,onChange:s=>c("titleTemplate",s.target.value),placeholder:"Agent Tower"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"notification-body-template",className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:t("内容")}),e.jsx(d,{id:"notification-body-template",value:a.bodyTemplate,onChange:s=>c("bodyTemplate",s.target.value),placeholder:t('✅ "{taskTitle}" 已完成,等待审查')})]})]})]})]}),m&&e.jsx(A,{saving:l.isPending,onSave:U})]})}export{le as NotificationSettingsPage};
@@ -1,3 +1,3 @@
1
- import{u as T,r as g,j as e,S,d as J,n as M,o as w,B as E,p,g as P}from"./index-M-QRACZK.js";import{u as U,a as _,b as z,c as B}from"./use-profiles-Btexu_oH.js";import{M as F}from"./modal-PZSR91HW.js";import{C as G}from"./confirm-dialog-Cnw_rxtM.js";import{I as $}from"./input-7UYarzFy.js";import{T as R}from"./textarea-eWIZ3eZW.js";import{L as H}from"./layers-C89p38EX.js";import{C as q}from"./chevron-down-BQyZkT4A.js";import{P as K,T as Q}from"./trash-2-C7F85sIB.js";import{P as W}from"./pencil-9lMJOuw2.js";function X(t){const a=Object.entries(t);return a.length===0?"(empty)":a.map(([m,c])=>`${m}: ${JSON.stringify(c)}`).join(", ")}const y={CLAUDE_CODE:"Claude Code",GEMINI_CLI:"Gemini CLI",CURSOR_AGENT:"Cursor Agent"};function Y({agentType:t,variants:a,isBuiltIn:m,onEdit:c,onNew:h,onDelete:j}){const{t:n}=T(),[r,b]=g.useState(!0),u=Object.entries(a);return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-muted/40 px-4 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>b(i=>!i),"aria-expanded":r,className:"flex items-center gap-3 rounded-md transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:y[t]??t}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[u.length," ",n("个变体")]}),e.jsx(q,{size:14,"aria-hidden":"true",className:P("text-muted-foreground transition-transform motion-reduce:transition-none",r&&"rotate-180")})]}),e.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx(K,{size:12,"aria-hidden":"true"}),n("新增")]})]}),r&&e.jsxs("div",{className:"divide-y divide-border/60",children:[u.map(([i,x])=>{const f=m(i);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-muted/40",children:[e.jsx("span",{className:P("inline-flex shrink-0 items-center rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide",i==="DEFAULT"?"bg-primary/[0.06] text-primary":"bg-muted text-muted-foreground"),children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:X(x)}),f&&e.jsx("span",{className:"shrink-0 text-[10px] font-medium text-muted-foreground/70",children:n("内置")}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{onClick:()=>c(i,x),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("编辑"),"aria-label":n("编辑"),children:e.jsx(W,{size:12})}),!f&&e.jsx("button",{onClick:()=>j(i),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("删除"),"aria-label":n("删除"),children:e.jsx(Q,{size:12})})]})]},i)}),u.length===0&&e.jsx("div",{className:"px-4 py-4 text-center text-xs text-muted-foreground",children:n("暂无变体")})]})]})}function Z(){return e.jsxs("div",{role:"status","aria-label":"Loading",children:[e.jsx(p,{className:"h-7 w-36"}),e.jsx(p,{className:"mt-2 h-3.5 w-72 max-w-full"}),e.jsx("div",{className:"mt-5 space-y-3",children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 bg-muted/40 px-4 py-3",children:[e.jsx(p,{className:"h-4 w-28"}),e.jsx(p,{className:"h-3 w-14"})]}),e.jsx("div",{className:"divide-y divide-border/60",children:Array.from({length:2}).map((m,c)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx(p,{className:"h-5 w-16 rounded"}),e.jsx(p,{className:"h-3.5 flex-1"})]},c))})]},a))})]})}function ce(){const{t}=T(),{data:a,isLoading:m}=U(),{data:c}=_(),h=z(),j=B(),[n,r]=g.useState(null),[b,u]=g.useState(""),[i,x]=g.useState(""),[f,v]=g.useState(""),[o,N]=g.useState(null),k=(s,l,d)=>{r({agentType:s,variant:l,config:d,isNew:!1}),x(l),u(JSON.stringify(d,null,2)),v("")},O=s=>{r({agentType:s,variant:"",config:{},isNew:!0}),x(""),u(`{
1
+ import{u as T,r as g,j as e,S,d as J,n as M,o as w,B as E,p,g as P}from"./index-B2TV-FU2.js";import{u as U,a as _,b as z,c as B}from"./use-profiles-BSYIQUHp.js";import{M as F}from"./modal-Dc2shjmi.js";import{C as G}from"./confirm-dialog-IGqDL03n.js";import{I as $}from"./input-CupQF5Np.js";import{T as R}from"./textarea-Cj61Z7ha.js";import{L as H}from"./layers-CCP9NEZU.js";import{C as q}from"./chevron-down-CBY3fFTT.js";import{P as K,T as Q}from"./trash-2-D2zJVeEr.js";import{P as W}from"./pencil-BOmVWDhP.js";function X(t){const a=Object.entries(t);return a.length===0?"(empty)":a.map(([m,c])=>`${m}: ${JSON.stringify(c)}`).join(", ")}const y={CLAUDE_CODE:"Claude Code",GEMINI_CLI:"Gemini CLI",CURSOR_AGENT:"Cursor Agent"};function Y({agentType:t,variants:a,isBuiltIn:m,onEdit:c,onNew:h,onDelete:j}){const{t:n}=T(),[r,b]=g.useState(!0),u=Object.entries(a);return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-muted/40 px-4 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>b(i=>!i),"aria-expanded":r,className:"flex items-center gap-3 rounded-md transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:y[t]??t}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[u.length," ",n("个变体")]}),e.jsx(q,{size:14,"aria-hidden":"true",className:P("text-muted-foreground transition-transform motion-reduce:transition-none",r&&"rotate-180")})]}),e.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsx(K,{size:12,"aria-hidden":"true"}),n("新增")]})]}),r&&e.jsxs("div",{className:"divide-y divide-border/60",children:[u.map(([i,x])=>{const f=m(i);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-muted/40",children:[e.jsx("span",{className:P("inline-flex shrink-0 items-center rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide",i==="DEFAULT"?"bg-primary/[0.06] text-primary":"bg-muted text-muted-foreground"),children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:X(x)}),f&&e.jsx("span",{className:"shrink-0 text-[10px] font-medium text-muted-foreground/70",children:n("内置")}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{onClick:()=>c(i,x),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("编辑"),"aria-label":n("编辑"),children:e.jsx(W,{size:12})}),!f&&e.jsx("button",{onClick:()=>j(i),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",title:n("删除"),"aria-label":n("删除"),children:e.jsx(Q,{size:12})})]})]},i)}),u.length===0&&e.jsx("div",{className:"px-4 py-4 text-center text-xs text-muted-foreground",children:n("暂无变体")})]})]})}function Z(){return e.jsxs("div",{role:"status","aria-label":"Loading",children:[e.jsx(p,{className:"h-7 w-36"}),e.jsx(p,{className:"mt-2 h-3.5 w-72 max-w-full"}),e.jsx("div",{className:"mt-5 space-y-3",children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 bg-muted/40 px-4 py-3",children:[e.jsx(p,{className:"h-4 w-28"}),e.jsx(p,{className:"h-3 w-14"})]}),e.jsx("div",{className:"divide-y divide-border/60",children:Array.from({length:2}).map((m,c)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsx(p,{className:"h-5 w-16 rounded"}),e.jsx(p,{className:"h-3.5 flex-1"})]},c))})]},a))})]})}function ce(){const{t}=T(),{data:a,isLoading:m}=U(),{data:c}=_(),h=z(),j=B(),[n,r]=g.useState(null),[b,u]=g.useState(""),[i,x]=g.useState(""),[f,v]=g.useState(""),[o,N]=g.useState(null),k=(s,l,d)=>{r({agentType:s,variant:l,config:d,isNew:!1}),x(l),u(JSON.stringify(d,null,2)),v("")},O=s=>{r({agentType:s,variant:"",config:{},isNew:!0}),x(""),u(`{
2
2
 
3
3
  }`),v("")},D=()=>{if(!(!n||!i.trim()))try{const s=JSON.parse(b);v(""),h.mutate({agentType:n.agentType,variant:i.trim().toUpperCase(),config:s},{onSuccess:()=>r(null)})}catch{v(t("JSON 格式错误"))}},L=(s,l)=>{N({agentType:s,variant:l})},A=()=>{o&&j.mutate({agentType:o.agentType,variant:o.variant},{onSettled:()=>N(null)})},I=(s,l)=>!!c?.executors[s]?.[l];if(m)return e.jsx(S,{children:e.jsx(Z,{})});const C=a?.executors??{};return e.jsxs(S,{children:[e.jsx(J,{title:t("Profile 配置"),description:t("管理 Agent 执行器的配置变体。每个变体定义一组运行参数。"),className:"mb-4"}),e.jsx("div",{className:"space-y-3",children:Object.entries(C).map(([s,l])=>e.jsx(Y,{agentType:s,variants:l,isBuiltIn:d=>I(s,d),onEdit:(d,V)=>k(s,d,V),onNew:()=>O(s),onDelete:d=>L(s,d)},s))}),Object.keys(C).length===0&&e.jsx(M,{icon:H,message:t("暂无 Profile 配置")}),e.jsx(F,{isOpen:!!n,onClose:()=>r(null),title:n?.isNew?t("新增 Variant — {agentType}",{agentType:y[n.agentType]??n.agentType}):t("编辑 {variant}",{variant:n?.variant??""}),action:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"outline",onClick:()=>r(null),children:t("取消")}),e.jsx(E,{onClick:D,disabled:h.isPending,children:h.isPending?t("保存中..."):t("保存")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(w,{label:t("Variant 名称"),htmlFor:"profile-variant-name",children:e.jsx($,{id:"profile-variant-name",value:i,onChange:s=>x(s.target.value),disabled:!n?.isNew,placeholder:t("例如: CUSTOM"),className:"font-mono"})}),e.jsxs(w,{label:t("配置 (JSON)"),htmlFor:"profile-variant-json",children:[e.jsx(R,{id:"profile-variant-json",value:b,onChange:s=>{u(s.target.value),v("")},rows:6,className:"resize-none font-mono","aria-invalid":!!f}),f&&e.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:f})]})]})}),e.jsx(G,{isOpen:o!==null,onClose:()=>{j.isPending||N(null)},onConfirm:A,title:t("删除 Profile Variant"),description:o?t('确定删除 "{name}"?此操作不可撤销。',{name:`${y[o.agentType]??o.agentType} / ${o.variant}`}):"",confirmText:t("删除"),cancelText:t("取消"),variant:"danger",isLoading:j.isPending})]})}export{ce as ProfileSettingsPage};