agent-tower 0.5.4 → 0.6.0-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.
Files changed (383) hide show
  1. package/README.md +1 -1
  2. package/dist/core/event-bus.d.ts +4 -1
  3. package/dist/core/event-bus.d.ts.map +1 -1
  4. package/dist/core/event-bus.js.map +1 -1
  5. package/dist/executors/__tests__/codex.executor.test.js +27 -21
  6. package/dist/executors/__tests__/codex.executor.test.js.map +1 -1
  7. package/dist/executors/__tests__/providers-availability.test.js +23 -0
  8. package/dist/executors/__tests__/providers-availability.test.js.map +1 -1
  9. package/dist/executors/__tests__/providers.test.js +34 -1
  10. package/dist/executors/__tests__/providers.test.js.map +1 -1
  11. package/dist/executors/codex.executor.d.ts.map +1 -1
  12. package/dist/executors/codex.executor.js +4 -0
  13. package/dist/executors/codex.executor.js.map +1 -1
  14. package/dist/executors/default-providers.json +106 -0
  15. package/dist/executors/index.d.ts +1 -1
  16. package/dist/executors/index.d.ts.map +1 -1
  17. package/dist/executors/index.js +32 -13
  18. package/dist/executors/index.js.map +1 -1
  19. package/dist/executors/providers.d.ts +12 -3
  20. package/dist/executors/providers.d.ts.map +1 -1
  21. package/dist/executors/providers.js +45 -18
  22. package/dist/executors/providers.js.map +1 -1
  23. package/dist/output/types.d.ts +32 -2
  24. package/dist/output/types.d.ts.map +1 -1
  25. package/dist/output/types.js +10 -0
  26. package/dist/output/types.js.map +1 -1
  27. package/dist/routes/__tests__/providers.test.js +181 -1
  28. package/dist/routes/__tests__/providers.test.js.map +1 -1
  29. package/dist/routes/__tests__/sessions-runtime.test.d.ts +2 -0
  30. package/dist/routes/__tests__/sessions-runtime.test.d.ts.map +1 -0
  31. package/dist/routes/__tests__/sessions-runtime.test.js +107 -0
  32. package/dist/routes/__tests__/sessions-runtime.test.js.map +1 -0
  33. package/dist/routes/providers.d.ts.map +1 -1
  34. package/dist/routes/providers.js +3 -1
  35. package/dist/routes/providers.js.map +1 -1
  36. package/dist/routes/sessions.d.ts.map +1 -1
  37. package/dist/routes/sessions.js +50 -3
  38. package/dist/routes/sessions.js.map +1 -1
  39. package/dist/routes/system.d.ts.map +1 -1
  40. package/dist/routes/system.js +8 -0
  41. package/dist/routes/system.js.map +1 -1
  42. package/dist/runtime/__tests__/acp-agent-definitions.test.d.ts +2 -0
  43. package/dist/runtime/__tests__/acp-agent-definitions.test.d.ts.map +1 -0
  44. package/dist/runtime/__tests__/acp-agent-definitions.test.js +360 -0
  45. package/dist/runtime/__tests__/acp-agent-definitions.test.js.map +1 -0
  46. package/dist/runtime/__tests__/acp-driver-cleanup.test.d.ts +2 -0
  47. package/dist/runtime/__tests__/acp-driver-cleanup.test.d.ts.map +1 -0
  48. package/dist/runtime/__tests__/acp-driver-cleanup.test.js +39 -0
  49. package/dist/runtime/__tests__/acp-driver-cleanup.test.js.map +1 -0
  50. package/dist/runtime/__tests__/acp-driver.test.d.ts +2 -0
  51. package/dist/runtime/__tests__/acp-driver.test.d.ts.map +1 -0
  52. package/dist/runtime/__tests__/acp-driver.test.js +122 -0
  53. package/dist/runtime/__tests__/acp-driver.test.js.map +1 -0
  54. package/dist/runtime/__tests__/acp-process-manager.test.d.ts +2 -0
  55. package/dist/runtime/__tests__/acp-process-manager.test.d.ts.map +1 -0
  56. package/dist/runtime/__tests__/acp-process-manager.test.js +51 -0
  57. package/dist/runtime/__tests__/acp-process-manager.test.js.map +1 -0
  58. package/dist/runtime/__tests__/acp-projector.test.d.ts +2 -0
  59. package/dist/runtime/__tests__/acp-projector.test.d.ts.map +1 -0
  60. package/dist/runtime/__tests__/acp-projector.test.js +195 -0
  61. package/dist/runtime/__tests__/acp-projector.test.js.map +1 -0
  62. package/dist/runtime/__tests__/runtime-coordinator.test.d.ts +2 -0
  63. package/dist/runtime/__tests__/runtime-coordinator.test.d.ts.map +1 -0
  64. package/dist/runtime/__tests__/runtime-coordinator.test.js +134 -0
  65. package/dist/runtime/__tests__/runtime-coordinator.test.js.map +1 -0
  66. package/dist/runtime/acp/acp-driver.d.ts +7 -0
  67. package/dist/runtime/acp/acp-driver.d.ts.map +1 -0
  68. package/dist/runtime/acp/acp-driver.js +406 -0
  69. package/dist/runtime/acp/acp-driver.js.map +1 -0
  70. package/dist/runtime/acp/agents/claude-code.d.ts +3 -0
  71. package/dist/runtime/acp/agents/claude-code.d.ts.map +1 -0
  72. package/dist/runtime/acp/agents/claude-code.js +147 -0
  73. package/dist/runtime/acp/agents/claude-code.js.map +1 -0
  74. package/dist/runtime/acp/agents/codex.d.ts +3 -0
  75. package/dist/runtime/acp/agents/codex.d.ts.map +1 -0
  76. package/dist/runtime/acp/agents/codex.js +68 -0
  77. package/dist/runtime/acp/agents/codex.js.map +1 -0
  78. package/dist/runtime/acp/agents/cursor-agent.d.ts +2 -0
  79. package/dist/runtime/acp/agents/cursor-agent.d.ts.map +1 -0
  80. package/dist/runtime/acp/agents/cursor-agent.js +12 -0
  81. package/dist/runtime/acp/agents/cursor-agent.js.map +1 -0
  82. package/dist/runtime/acp/agents/executable-resolution.d.ts +6 -0
  83. package/dist/runtime/acp/agents/executable-resolution.d.ts.map +1 -0
  84. package/dist/runtime/acp/agents/executable-resolution.js +72 -0
  85. package/dist/runtime/acp/agents/executable-resolution.js.map +1 -0
  86. package/dist/runtime/acp/agents/gemini-cli.d.ts +2 -0
  87. package/dist/runtime/acp/agents/gemini-cli.d.ts.map +1 -0
  88. package/dist/runtime/acp/agents/gemini-cli.js +13 -0
  89. package/dist/runtime/acp/agents/gemini-cli.js.map +1 -0
  90. package/dist/runtime/acp/agents/grok-build.d.ts +2 -0
  91. package/dist/runtime/acp/agents/grok-build.d.ts.map +1 -0
  92. package/dist/runtime/acp/agents/grok-build.js +26 -0
  93. package/dist/runtime/acp/agents/grok-build.js.map +1 -0
  94. package/dist/runtime/acp/agents/kiro-cli.d.ts +2 -0
  95. package/dist/runtime/acp/agents/kiro-cli.d.ts.map +1 -0
  96. package/dist/runtime/acp/agents/kiro-cli.js +18 -0
  97. package/dist/runtime/acp/agents/kiro-cli.js.map +1 -0
  98. package/dist/runtime/acp/agents/managed-directory.d.ts +6 -0
  99. package/dist/runtime/acp/agents/managed-directory.d.ts.map +1 -0
  100. package/dist/runtime/acp/agents/managed-directory.js +31 -0
  101. package/dist/runtime/acp/agents/managed-directory.js.map +1 -0
  102. package/dist/runtime/acp/agents/minion-acp-sitecustomize.d.ts +2 -0
  103. package/dist/runtime/acp/agents/minion-acp-sitecustomize.d.ts.map +1 -0
  104. package/dist/runtime/acp/agents/minion-acp-sitecustomize.js +118 -0
  105. package/dist/runtime/acp/agents/minion-acp-sitecustomize.js.map +1 -0
  106. package/dist/runtime/acp/agents/minion-code.d.ts +2 -0
  107. package/dist/runtime/acp/agents/minion-code.d.ts.map +1 -0
  108. package/dist/runtime/acp/agents/minion-code.js +53 -0
  109. package/dist/runtime/acp/agents/minion-code.js.map +1 -0
  110. package/dist/runtime/acp/agents/native-agent.d.ts +23 -0
  111. package/dist/runtime/acp/agents/native-agent.d.ts.map +1 -0
  112. package/dist/runtime/acp/agents/native-agent.js +158 -0
  113. package/dist/runtime/acp/agents/native-agent.js.map +1 -0
  114. package/dist/runtime/acp/agents/opencode.d.ts +2 -0
  115. package/dist/runtime/acp/agents/opencode.d.ts.map +1 -0
  116. package/dist/runtime/acp/agents/opencode.js +35 -0
  117. package/dist/runtime/acp/agents/opencode.js.map +1 -0
  118. package/dist/runtime/acp/agents/pi-coding-agent.d.ts +3 -0
  119. package/dist/runtime/acp/agents/pi-coding-agent.d.ts.map +1 -0
  120. package/dist/runtime/acp/agents/pi-coding-agent.js +178 -0
  121. package/dist/runtime/acp/agents/pi-coding-agent.js.map +1 -0
  122. package/dist/runtime/acp/agents/qwen-code.d.ts +3 -0
  123. package/dist/runtime/acp/agents/qwen-code.d.ts.map +1 -0
  124. package/dist/runtime/acp/agents/qwen-code.js +67 -0
  125. package/dist/runtime/acp/agents/qwen-code.js.map +1 -0
  126. package/dist/runtime/acp/agents/registry.d.ts +5 -0
  127. package/dist/runtime/acp/agents/registry.d.ts.map +1 -0
  128. package/dist/runtime/acp/agents/registry.js +34 -0
  129. package/dist/runtime/acp/agents/registry.js.map +1 -0
  130. package/dist/runtime/acp/agents/types.d.ts +35 -0
  131. package/dist/runtime/acp/agents/types.d.ts.map +1 -0
  132. package/dist/runtime/acp/agents/types.js +2 -0
  133. package/dist/runtime/acp/agents/types.js.map +1 -0
  134. package/dist/runtime/acp/codex-provider-config.d.ts +9 -0
  135. package/dist/runtime/acp/codex-provider-config.d.ts.map +1 -0
  136. package/dist/runtime/acp/codex-provider-config.js +107 -0
  137. package/dist/runtime/acp/codex-provider-config.js.map +1 -0
  138. package/dist/runtime/acp/process-manager.d.ts +33 -0
  139. package/dist/runtime/acp/process-manager.d.ts.map +1 -0
  140. package/dist/runtime/acp/process-manager.js +204 -0
  141. package/dist/runtime/acp/process-manager.js.map +1 -0
  142. package/dist/runtime/acp/projector.d.ts +23 -0
  143. package/dist/runtime/acp/projector.d.ts.map +1 -0
  144. package/dist/runtime/acp/projector.js +354 -0
  145. package/dist/runtime/acp/projector.js.map +1 -0
  146. package/dist/runtime/cli-driver.d.ts +7 -0
  147. package/dist/runtime/cli-driver.d.ts.map +1 -0
  148. package/dist/runtime/cli-driver.js +282 -0
  149. package/dist/runtime/cli-driver.js.map +1 -0
  150. package/dist/runtime/cli-parser.d.ts +5 -0
  151. package/dist/runtime/cli-parser.d.ts.map +1 -0
  152. package/dist/runtime/cli-parser.js +15 -0
  153. package/dist/runtime/cli-parser.js.map +1 -0
  154. package/dist/runtime/contracts.d.ts +109 -0
  155. package/dist/runtime/contracts.d.ts.map +1 -0
  156. package/dist/runtime/contracts.js +2 -0
  157. package/dist/runtime/contracts.js.map +1 -0
  158. package/dist/runtime/errors.d.ts +9 -0
  159. package/dist/runtime/errors.d.ts.map +1 -0
  160. package/dist/runtime/errors.js +29 -0
  161. package/dist/runtime/errors.js.map +1 -0
  162. package/dist/runtime/index.d.ts +9 -0
  163. package/dist/runtime/index.d.ts.map +1 -0
  164. package/dist/runtime/index.js +9 -0
  165. package/dist/runtime/index.js.map +1 -0
  166. package/dist/runtime/runtime-coordinator.d.ts +32 -0
  167. package/dist/runtime/runtime-coordinator.d.ts.map +1 -0
  168. package/dist/runtime/runtime-coordinator.js +327 -0
  169. package/dist/runtime/runtime-coordinator.js.map +1 -0
  170. package/dist/runtime/runtime-registry.d.ts +8 -0
  171. package/dist/runtime/runtime-registry.d.ts.map +1 -0
  172. package/dist/runtime/runtime-registry.js +17 -0
  173. package/dist/runtime/runtime-registry.js.map +1 -0
  174. package/dist/runtime/runtime-state-view.d.ts +5 -0
  175. package/dist/runtime/runtime-state-view.d.ts.map +1 -0
  176. package/dist/runtime/runtime-state-view.js +15 -0
  177. package/dist/runtime/runtime-state-view.js.map +1 -0
  178. package/dist/services/__tests__/provider-config.service.test.js +31 -2
  179. package/dist/services/__tests__/provider-config.service.test.js.map +1 -1
  180. package/dist/services/__tests__/session-manager.lifecycle.test.js +105 -2
  181. package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
  182. package/dist/services/__tests__/session-manager.team-run.test.js +16 -14
  183. package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
  184. package/dist/services/conversation.service.d.ts.map +1 -1
  185. package/dist/services/conversation.service.js +3 -0
  186. package/dist/services/conversation.service.js.map +1 -1
  187. package/dist/services/provider-config.service.d.ts.map +1 -1
  188. package/dist/services/provider-config.service.js +34 -5
  189. package/dist/services/provider-config.service.js.map +1 -1
  190. package/dist/services/provider-effective-connection.service.d.ts +7 -1
  191. package/dist/services/provider-effective-connection.service.d.ts.map +1 -1
  192. package/dist/services/provider-effective-connection.service.js +56 -1
  193. package/dist/services/provider-effective-connection.service.js.map +1 -1
  194. package/dist/services/session-manager.d.ts +32 -24
  195. package/dist/services/session-manager.d.ts.map +1 -1
  196. package/dist/services/session-manager.js +265 -448
  197. package/dist/services/session-manager.js.map +1 -1
  198. package/dist/services/team-reconciler.service.d.ts +3 -0
  199. package/dist/services/team-reconciler.service.d.ts.map +1 -1
  200. package/dist/services/team-reconciler.service.js +14 -3
  201. package/dist/services/team-reconciler.service.js.map +1 -1
  202. package/dist/services/team-run.service.d.ts.map +1 -1
  203. package/dist/services/team-run.service.js +5 -1
  204. package/dist/services/team-run.service.js.map +1 -1
  205. package/dist/services/workspace.service.d.ts +2 -0
  206. package/dist/services/workspace.service.d.ts.map +1 -1
  207. package/dist/socket/__tests__/socket-gateway.test.js +42 -0
  208. package/dist/socket/__tests__/socket-gateway.test.js.map +1 -1
  209. package/dist/socket/events.d.ts +1 -1
  210. package/dist/socket/events.d.ts.map +1 -1
  211. package/dist/socket/events.js.map +1 -1
  212. package/dist/socket/index.js +1 -1
  213. package/dist/socket/index.js.map +1 -1
  214. package/dist/socket/socket-gateway.d.ts.map +1 -1
  215. package/dist/socket/socket-gateway.js +13 -1
  216. package/dist/socket/socket-gateway.js.map +1 -1
  217. package/dist/types/index.d.ts +7 -1
  218. package/dist/types/index.d.ts.map +1 -1
  219. package/dist/types/index.js +6 -0
  220. package/dist/types/index.js.map +1 -1
  221. package/dist/utils/process-launch.d.ts.map +1 -1
  222. package/dist/utils/process-launch.js +3 -1
  223. package/dist/utils/process-launch.js.map +1 -1
  224. package/dist/utils/process-launch.test.js +17 -2
  225. package/dist/utils/process-launch.test.js.map +1 -1
  226. package/dist/web/assets/{AgentDemoPage-C3SHOCDR.js → AgentDemoPage-BpUO2gR6.js} +1 -1
  227. package/dist/web/assets/{AgentEnvironmentSettingsPage-D-BWLcC0.js → AgentEnvironmentSettingsPage-CSBMaAvL.js} +1 -1
  228. package/dist/web/assets/AgentLogo-C190Z6bw.js +1 -0
  229. package/dist/web/assets/ConversationPage-Cer_WtdC.js +3 -0
  230. package/dist/web/assets/CreateTaskInput-ByeWDjc8.js +1 -0
  231. package/dist/web/assets/{DemoPage-Cd1ggnZY.js → DemoPage-Dpb9aAKX.js} +1 -1
  232. package/dist/web/assets/{GeneralSettingsPage-B9D9wA_9.js → GeneralSettingsPage-TqbAsCZM.js} +1 -1
  233. package/dist/web/assets/{Icons-CM6Yg2lw.js → Icons-CyNNz4Z5.js} +1 -1
  234. package/dist/web/assets/{LoadingPreviewPage-BJ_Se_T_.js → LoadingPreviewPage-DmH1TGln.js} +1 -1
  235. package/dist/web/assets/{McpSettingsPage-B5GtqNme.js → McpSettingsPage-z1_NcsMR.js} +1 -1
  236. package/dist/web/assets/{MemberAvatar-yC8O30hv.js → MemberAvatar-BPoYS6Il.js} +1 -1
  237. package/dist/web/assets/{NotificationSettingsPage-BaJpYHLD.js → NotificationSettingsPage-CNsRJ6nN.js} +1 -1
  238. package/dist/web/assets/{ProfileSettingsPage-DYXew66J.js → ProfileSettingsPage-g1RKcEbo.js} +1 -1
  239. package/dist/web/assets/{ProjectKanbanPage-DbgIwiUC.js → ProjectKanbanPage-j2v5fLfg.js} +37 -36
  240. package/dist/web/assets/{ProjectSettingsPage-B2K8Kw_S.js → ProjectSettingsPage-Cp89NvwE.js} +1 -1
  241. package/dist/web/assets/ProviderSettingsPage-B-bBs2qN.js +93 -0
  242. package/dist/web/assets/{SettingsMasterDetail-ByKe_zcK.js → SettingsMasterDetail-BYB-1oyf.js} +1 -1
  243. package/dist/web/assets/{TeamSettingsPage-4sHo9Wpb.js → TeamSettingsPage-Y2zCVbVD.js} +1 -1
  244. package/dist/web/assets/agent-tower-lockup-DPAcheCt.png +0 -0
  245. package/dist/web/assets/{arc-g6Y4qqcK.js → arc-BmDnqN7Q.js} +1 -1
  246. package/dist/web/assets/{architectureDiagram-3BPJPVTR-ILRcqNPe.js → architectureDiagram-3BPJPVTR-BIG4K9gT.js} +1 -1
  247. package/dist/web/assets/{arrow-left-D0MkHwKU.js → arrow-left-CB4qTjQs.js} +1 -1
  248. package/dist/web/assets/{blockDiagram-GPEHLZMM-ZTMQ6CTT.js → blockDiagram-GPEHLZMM-CowveYw0.js} +1 -1
  249. package/dist/web/assets/{c4Diagram-AAUBKEIU-CAW8PcM8.js → c4Diagram-AAUBKEIU-CLjbYgNG.js} +1 -1
  250. package/dist/web/assets/channel-BsOpjSZw.js +1 -0
  251. package/dist/web/assets/check-BVOtZt28.js +1 -0
  252. package/dist/web/assets/{chevron-down-CmGXPki1.js → chevron-down-BXYCSpWd.js} +1 -1
  253. package/dist/web/assets/{chevron-right-jrkLz9qG.js → chevron-right-CkcSaX8x.js} +1 -1
  254. package/dist/web/assets/{chevron-up-UwBybVMK.js → chevron-up-Y8L6pbzc.js} +1 -1
  255. package/dist/web/assets/{chunk-2J33WTMH-BvuLBX1d.js → chunk-2J33WTMH-DRf_miP4.js} +1 -1
  256. package/dist/web/assets/{chunk-4BX2VUAB-DJO5Yx2A.js → chunk-4BX2VUAB-C6Ne_vwR.js} +1 -1
  257. package/dist/web/assets/{chunk-55IACEB6-Dc117Qwf.js → chunk-55IACEB6-DejCglMr.js} +1 -1
  258. package/dist/web/assets/{chunk-727SXJPM-DsZmTw67.js → chunk-727SXJPM-B0MC9Ojc.js} +1 -1
  259. package/dist/web/assets/{chunk-AQP2D5EJ-DgmF7gD6.js → chunk-AQP2D5EJ-D9f4hbMX.js} +1 -1
  260. package/dist/web/assets/{chunk-FMBD7UC4-vgh3Erl0.js → chunk-FMBD7UC4-k90hkOQq.js} +1 -1
  261. package/dist/web/assets/{chunk-ND2GUHAM-Ogtl4wwd.js → chunk-ND2GUHAM-CX2-qxPx.js} +1 -1
  262. package/dist/web/assets/{chunk-QZHKN3VN-Cif7bPpF.js → chunk-QZHKN3VN-CpFs7UD0.js} +1 -1
  263. package/dist/web/assets/{circle-alert-B6ZM3dSn.js → circle-alert-ClX4sQ2K.js} +1 -1
  264. package/dist/web/assets/classDiagram-4FO5ZUOK-KkLqUSdB.js +1 -0
  265. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-KkLqUSdB.js +1 -0
  266. package/dist/web/assets/{code-block-OCS4YCEC-BQnKZly0.js → code-block-OCS4YCEC-_lkU1VUC.js} +1 -1
  267. package/dist/web/assets/{confirm-dialog-BZeaAl5j.js → confirm-dialog-BJwzwwOk.js} +1 -1
  268. package/dist/web/assets/{copy-DqNqPI8d.js → copy-jQAntc98.js} +1 -1
  269. package/dist/web/assets/{cose-bilkent-S5V4N54A-rxJB-TPw.js → cose-bilkent-S5V4N54A-CLWAfEVg.js} +1 -1
  270. package/dist/web/assets/cssMode-q0rL0Hjc.js +1 -0
  271. package/dist/web/assets/{dagre-BM42HDAG-BkB6VpXn.js → dagre-BM42HDAG-DKviWU-X.js} +1 -1
  272. package/dist/web/assets/{diagram-2AECGRRQ-BH2e-eqy.js → diagram-2AECGRRQ-L6emXRJ1.js} +1 -1
  273. package/dist/web/assets/{diagram-5GNKFQAL-B0I47Yhs.js → diagram-5GNKFQAL-CXGUerks.js} +1 -1
  274. package/dist/web/assets/{diagram-KO2AKTUF-BVXUYRvI.js → diagram-KO2AKTUF-C8FHXqeH.js} +1 -1
  275. package/dist/web/assets/{diagram-LMA3HP47-C1fEOLke.js → diagram-LMA3HP47-Cng_aa5j.js} +1 -1
  276. package/dist/web/assets/{diagram-OG6HWLK6-CVE8cOcO.js → diagram-OG6HWLK6-BEC6IDf4.js} +1 -1
  277. package/dist/web/assets/{erDiagram-TEJ5UH35-qCfnXmfp.js → erDiagram-TEJ5UH35-BWMCTdYK.js} +1 -1
  278. package/dist/web/assets/{flowDiagram-I6XJVG4X-KMhbF5QC.js → flowDiagram-I6XJVG4X-aAEYIyx2.js} +1 -1
  279. package/dist/web/assets/{folder-picker-C3BgqamQ.js → folder-picker-CioQjSzV.js} +1 -1
  280. package/dist/web/assets/{freemarker2-tYgVOcFl.js → freemarker2-DZgAIr6s.js} +2 -2
  281. package/dist/web/assets/{ganttDiagram-6RSMTGT7-CaX3qYV1.js → ganttDiagram-6RSMTGT7-DVqWnwcH.js} +1 -1
  282. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-CBAlZX7C.js → gitGraphDiagram-PVQCEYII-BVWrTXBv.js} +1 -1
  283. package/dist/web/assets/handlebars-9RRQrLUb.js +1 -0
  284. package/dist/web/assets/html-BVI4F9TT.js +1 -0
  285. package/dist/web/assets/htmlMode-t0djrjSv.js +1 -0
  286. package/dist/web/assets/index-CjAJoGg5.css +1 -0
  287. package/dist/web/assets/{index-BuQDZjol.js → index-Da9mzleR.js} +4 -4
  288. package/dist/web/assets/{index-DHKgc87I.js → index-RYlllU6n.js} +18 -18
  289. package/dist/web/assets/{infoDiagram-5YYISTIA-Bp_GeFtA.js → infoDiagram-5YYISTIA-DYG1ew4x.js} +1 -1
  290. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BfBNEV_D.js → ishikawaDiagram-YF4QCWOH-COBW1j3-.js} +1 -1
  291. package/dist/web/assets/javascript-DaUCpDvL.js +1 -0
  292. package/dist/web/assets/{journeyDiagram-JHISSGLW-DJkUQG4Z.js → journeyDiagram-JHISSGLW-BI_FlncW.js} +1 -1
  293. package/dist/web/assets/{jsonMode-D4_2geMa.js → jsonMode-A5wuW-PC.js} +2 -2
  294. package/dist/web/assets/{kanban-definition-UN3LZRKU-Bk7sA26p.js → kanban-definition-UN3LZRKU-BKrHEd7r.js} +1 -1
  295. package/dist/web/assets/{layers-BFkjcml2.js → layers-BZMh9pqm.js} +1 -1
  296. package/dist/web/assets/{linear-CmC68WUf.js → linear-DyoMQJGq.js} +1 -1
  297. package/dist/web/assets/liquid-HXqG_RIQ.js +1 -0
  298. package/dist/web/assets/{lspLanguageFeatures-vY541IS0.js → lspLanguageFeatures-s3xWnrXc.js} +1 -1
  299. package/dist/web/assets/mdx-k_7JTYp2.js +1 -0
  300. package/dist/web/assets/{mermaid-NOHMQCX5-C6wHDXti.js → mermaid-NOHMQCX5-orMHhlAj.js} +59 -61
  301. package/dist/web/assets/{message-square-Wwixl9YA.js → message-square-CStQg7sr.js} +1 -1
  302. package/dist/web/assets/{mindmap-definition-RKZ34NQL-Ck1je2Hf.js → mindmap-definition-RKZ34NQL-CKOIIjUJ.js} +1 -1
  303. package/dist/web/assets/{modal-kFSArLJi.js → modal-ZYdX5Krr.js} +1 -1
  304. package/dist/web/assets/{monaco-D3FVQqPj.js → monaco-DX9iObLO.js} +3 -3
  305. package/dist/web/assets/{pencil-5Kegi5_H.js → pencil-DoB4p30x.js} +1 -1
  306. package/dist/web/assets/{pieDiagram-4H26LBE5-6Ao8YaoY.js → pieDiagram-4H26LBE5-BW18kL8l.js} +1 -1
  307. package/dist/web/assets/python-abx8p9WS.js +1 -0
  308. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-md1eBgjS.js → quadrantDiagram-W4KKPZXB-Df_F1INR.js} +1 -1
  309. package/dist/web/assets/razor-DGdDlX86.js +1 -0
  310. package/dist/web/assets/{requirementDiagram-4Y6WPE33-DJOb4wf-.js → requirementDiagram-4Y6WPE33-De6R8t8O.js} +1 -1
  311. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-B7srXhHb.js → sankeyDiagram-5OEKKPKP-ChlLeN5m.js} +1 -1
  312. package/dist/web/assets/{select-C2v0aFwN.js → select-B9kjO67b.js} +1 -1
  313. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-L0qwgf37.js → sequenceDiagram-3UESZ5HK-CPVnbcvz.js} +1 -1
  314. package/dist/web/assets/{stateDiagram-AJRCARHV-DGbH9dJ5.js → stateDiagram-AJRCARHV-BFS1G-aJ.js} +1 -1
  315. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DSxC8AfE.js +1 -0
  316. package/dist/web/assets/{switch-DjnF5A3R.js → switch-C2r5pofB.js} +1 -1
  317. package/dist/web/assets/{textarea-CbZnd5PO.js → textarea-BB3UoYxg.js} +1 -1
  318. package/dist/web/assets/{timeline-definition-PNZ67QCA-Dku_Yjmk.js → timeline-definition-PNZ67QCA-C1Rgs32y.js} +1 -1
  319. package/dist/web/assets/{trash-2-DA--Uikt.js → trash-2-BNiAEW-6.js} +1 -1
  320. package/dist/web/assets/{tsMode-CRNPFR24.js → tsMode-DHruHjGh.js} +2 -2
  321. package/dist/web/assets/typescript-SLYiKRhJ.js +1 -0
  322. package/dist/web/assets/{upload-hWnFHuhE.js → upload-BLLmywZY.js} +1 -1
  323. package/dist/web/assets/{use-profiles-roHXR8He.js → use-profiles-OJaV4lOv.js} +1 -1
  324. package/dist/web/assets/{use-projects-DiJMGduU.js → use-projects-D_Sq7ahS.js} +1 -1
  325. package/dist/web/assets/{use-providers-efX4HCcr.js → use-providers-SSHcslI-.js} +1 -1
  326. package/dist/web/assets/{useNormalizedLogs-xEobyuGF.js → useNormalizedLogs-DeA-fso_.js} +1 -1
  327. package/dist/web/assets/{vennDiagram-CIIHVFJN-_ufI1hxk.js → vennDiagram-CIIHVFJN-DLGPZTKg.js} +1 -1
  328. package/dist/web/assets/{wardley-L42UT6IY-Dve662aX.js → wardley-L42UT6IY-BVMPWfq9.js} +1 -1
  329. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-Dn2x3M_Q.js → wardleyDiagram-YWT4CUSO-_KXuEg6G.js} +1 -1
  330. package/dist/web/assets/xml-BmreQojr.js +1 -0
  331. package/dist/web/assets/{xychartDiagram-2RQKCTM6-BMe6JPre.js → xychartDiagram-2RQKCTM6-a-Do3v5G.js} +1 -1
  332. package/dist/web/assets/yaml-CJoLHuqv.js +1 -0
  333. package/dist/web/index.html +2 -2
  334. package/node_modules/@agent-tower/shared/dist/agent-runtime-support.d.ts +9 -0
  335. package/node_modules/@agent-tower/shared/dist/agent-runtime-support.d.ts.map +1 -0
  336. package/node_modules/@agent-tower/shared/dist/agent-runtime-support.js +21 -0
  337. package/node_modules/@agent-tower/shared/dist/agent-runtime-support.js.map +1 -0
  338. package/node_modules/@agent-tower/shared/dist/index.d.ts +1 -0
  339. package/node_modules/@agent-tower/shared/dist/index.d.ts.map +1 -1
  340. package/node_modules/@agent-tower/shared/dist/index.js +1 -0
  341. package/node_modules/@agent-tower/shared/dist/index.js.map +1 -1
  342. package/node_modules/@agent-tower/shared/dist/log-adapter.d.ts +38 -3
  343. package/node_modules/@agent-tower/shared/dist/log-adapter.d.ts.map +1 -1
  344. package/node_modules/@agent-tower/shared/dist/log-adapter.js +21 -2
  345. package/node_modules/@agent-tower/shared/dist/log-adapter.js.map +1 -1
  346. package/node_modules/@agent-tower/shared/dist/provider-capabilities.d.ts.map +1 -1
  347. package/node_modules/@agent-tower/shared/dist/provider-capabilities.js +58 -0
  348. package/node_modules/@agent-tower/shared/dist/provider-capabilities.js.map +1 -1
  349. package/node_modules/@agent-tower/shared/dist/socket/events.d.ts +17 -0
  350. package/node_modules/@agent-tower/shared/dist/socket/events.d.ts.map +1 -1
  351. package/node_modules/@agent-tower/shared/dist/socket/events.js +3 -0
  352. package/node_modules/@agent-tower/shared/dist/socket/events.js.map +1 -1
  353. package/node_modules/@agent-tower/shared/dist/types.d.ts +63 -2
  354. package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
  355. package/node_modules/@agent-tower/shared/dist/types.js +12 -0
  356. package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
  357. package/package.json +9 -3
  358. package/prisma/migrations/20260723000000_add_agent_runtime/migration.sql +2 -0
  359. package/prisma/schema.prisma +2 -0
  360. package/scripts/patch-claude-agent-acp.mjs +77 -0
  361. package/scripts/postinstall.js +5 -0
  362. package/dist/web/assets/AgentLogo-DOc8QQHe.js +0 -1
  363. package/dist/web/assets/ConversationPage-sknzMK-I.js +0 -3
  364. package/dist/web/assets/CreateTaskInput-Cn0k5D8K.js +0 -1
  365. package/dist/web/assets/ProviderSettingsPage-n2AFrtkZ.js +0 -93
  366. package/dist/web/assets/channel-DpisCjBV.js +0 -1
  367. package/dist/web/assets/check-VMcYyBr4.js +0 -1
  368. package/dist/web/assets/classDiagram-4FO5ZUOK-ByrAXg7x.js +0 -1
  369. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-ByrAXg7x.js +0 -1
  370. package/dist/web/assets/cssMode-BvIKUSIl.js +0 -1
  371. package/dist/web/assets/handlebars-O23dzm6n.js +0 -1
  372. package/dist/web/assets/html-QaPgl834.js +0 -1
  373. package/dist/web/assets/htmlMode-CWyii3pY.js +0 -1
  374. package/dist/web/assets/index-BeEbDvc9.css +0 -1
  375. package/dist/web/assets/javascript-C_IpQDkn.js +0 -1
  376. package/dist/web/assets/liquid-C6FS7ekL.js +0 -1
  377. package/dist/web/assets/mdx-LQJToB8m.js +0 -1
  378. package/dist/web/assets/python-HMxhKAEt.js +0 -1
  379. package/dist/web/assets/razor-CfDc2DcT.js +0 -1
  380. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Bq1LxgY_.js +0 -1
  381. package/dist/web/assets/typescript-CNopspEc.js +0 -1
  382. package/dist/web/assets/xml-dqhfYLW3.js +0 -1
  383. package/dist/web/assets/yaml-BOxNX83z.js +0 -1
@@ -1 +1 @@
1
- import{k as x,m,q as o,p as u,u as p,r as g,t as n,j as e,S as a,a3 as f,B as i,a5 as h}from"./index-DHKgc87I.js";import{C as j}from"./copy-DqNqPI8d.js";import{C as b}from"./check-VMcYyBr4.js";const y=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],N=x("server",y);function C(){return m({queryKey:o.system.mcpConfig,queryFn:()=>u.get("/system/mcp-config")})}function v({mode:s,label:t}){const r=s==="desktop-packaged";return e.jsx("span",{className:`inline-flex items-center rounded-md px-2 py-1 text-[11px] font-medium ${r?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"}`,children:t})}function z(){const{t:s}=p(),{data:t,isLoading:r,isError:l,refetch:d}=C(),c=g.useCallback(async()=>{if(t?.configJson)try{await navigator.clipboard.writeText(t.configJson),n.success(s("MCP 配置已复制"))}catch{n.error(s("复制 MCP 配置失败"))}},[t?.configJson,s]);return r?e.jsx(a,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(f,{className:"h-5 w-5 animate-spin text-neutral-500"})})}):l||!t?e.jsxs(a,{children:[e.jsx("h2",{className:"mb-1 text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("div",{className:"mt-5 rounded-lg border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700",children:s("MCP 配置加载失败")}),e.jsx(i,{className:"mt-4",size:"sm",variant:"outline",onClick:()=>{d()},children:s("重试")})]}):e.jsxs(a,{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-neutral-500",children:s("复制下面的 JSON 到支持 MCP 的客户端配置中。桌面打包版使用 App 内置 runtime,不需要全局安装 agent-tower。")})]}),e.jsxs(i,{size:"sm",onClick:c,children:[e.jsx(j,{size:14}),s("复制配置")]})]}),e.jsxs("div",{className:"space-y-3 border-b border-neutral-100 pb-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(v,{mode:t.runtimeMode,label:t.runtimeMode==="desktop-packaged"?s("桌面打包 runtime"):s("工作区 runtime")}),e.jsx("span",{className:"text-[12px] text-neutral-400",children:t.serverName})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(h,{size:12}),"Command"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.command})]}),e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(N,{size:12}),"Entry"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.args[0]??""})]})]})]}),e.jsxs("div",{className:"pt-5",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("label",{className:"text-[12px] font-medium text-neutral-600",children:"mcpServers JSON"}),t.runtimeMode==="desktop-packaged"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-emerald-600",children:[e.jsx(b,{size:12}),s("无需全局 CLI")]})]}),e.jsx("textarea",{readOnly:!0,value:t.configJson,rows:14,className:"w-full resize-y rounded-lg border border-neutral-200 bg-neutral-950 px-3 py-3 font-mono text-[12px] leading-relaxed text-neutral-100 outline-none"}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-neutral-400",children:s("当前版本只生成通用 MCP 配置,不会自动修改 Claude、Codex 或其他第三方客户端配置文件。")})]})]})}export{z as McpSettingsPage};
1
+ import{k as x,m,q as o,p as u,u as p,r as g,t as n,j as e,S as a,a3 as f,B as i,a5 as h}from"./index-RYlllU6n.js";import{C as j}from"./copy-jQAntc98.js";import{C as b}from"./check-BVOtZt28.js";const y=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],N=x("server",y);function C(){return m({queryKey:o.system.mcpConfig,queryFn:()=>u.get("/system/mcp-config")})}function v({mode:s,label:t}){const r=s==="desktop-packaged";return e.jsx("span",{className:`inline-flex items-center rounded-md px-2 py-1 text-[11px] font-medium ${r?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"}`,children:t})}function z(){const{t:s}=p(),{data:t,isLoading:r,isError:l,refetch:d}=C(),c=g.useCallback(async()=>{if(t?.configJson)try{await navigator.clipboard.writeText(t.configJson),n.success(s("MCP 配置已复制"))}catch{n.error(s("复制 MCP 配置失败"))}},[t?.configJson,s]);return r?e.jsx(a,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(f,{className:"h-5 w-5 animate-spin text-neutral-500"})})}):l||!t?e.jsxs(a,{children:[e.jsx("h2",{className:"mb-1 text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("div",{className:"mt-5 rounded-lg border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700",children:s("MCP 配置加载失败")}),e.jsx(i,{className:"mt-4",size:"sm",variant:"outline",onClick:()=>{d()},children:s("重试")})]}):e.jsxs(a,{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-neutral-900",children:s("MCP 配置")}),e.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-neutral-500",children:s("复制下面的 JSON 到支持 MCP 的客户端配置中。桌面打包版使用 App 内置 runtime,不需要全局安装 agent-tower。")})]}),e.jsxs(i,{size:"sm",onClick:c,children:[e.jsx(j,{size:14}),s("复制配置")]})]}),e.jsxs("div",{className:"space-y-3 border-b border-neutral-100 pb-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(v,{mode:t.runtimeMode,label:t.runtimeMode==="desktop-packaged"?s("桌面打包 runtime"):s("工作区 runtime")}),e.jsx("span",{className:"text-[12px] text-neutral-400",children:t.serverName})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(h,{size:12}),"Command"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.command})]}),e.jsxs("div",{className:"rounded-lg border border-neutral-100 bg-neutral-50/70 p-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[11px] font-medium uppercase text-neutral-400",children:[e.jsx(N,{size:12}),"Entry"]}),e.jsx("div",{className:"break-all font-mono text-[12px] leading-relaxed text-neutral-800",children:t.args[0]??""})]})]})]}),e.jsxs("div",{className:"pt-5",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("label",{className:"text-[12px] font-medium text-neutral-600",children:"mcpServers JSON"}),t.runtimeMode==="desktop-packaged"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-emerald-600",children:[e.jsx(b,{size:12}),s("无需全局 CLI")]})]}),e.jsx("textarea",{readOnly:!0,value:t.configJson,rows:14,className:"w-full resize-y rounded-lg border border-neutral-200 bg-neutral-950 px-3 py-3 font-mono text-[12px] leading-relaxed text-neutral-100 outline-none"}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-neutral-400",children:s("当前版本只生成通用 MCP 配置,不会自动修改 Claude、Codex 或其他第三方客户端配置文件。")})]})]})}export{z as McpSettingsPage};
@@ -1 +1 @@
1
- import{r as i,j as n,l as o}from"./index-DHKgc87I.js";function d(r){const t=r.trim();if(!t)return"?";const e=t.split(/\s+/).filter(Boolean);return e.length>=2?`${e[0][0]??""}${e[1][0]??""}`.toUpperCase():Array.from(t).slice(0,2).join("").toUpperCase()}function a(r){const t=r.trim();return/^#([0-9a-f]{3,8})$/i.test(t)||/^rgba?\(/i.test(t)||/^hsla?\(/i.test(t)}function l(r){const t=r.trim();return t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:image/")||t.startsWith("blob:")}function h(r,t){const e=r?.trim()??"";return!e||a(e)||l(e)?d(t):e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}function p(r){const t=r?.trim()??"";if(!(!t||!a(t)))return{backgroundColor:t,color:"#ffffff"}}function g({name:r,avatar:t,className:e}){const[u,c]=i.useState(null),s=t?.trim()??"",f=!!s&&l(s)&&u!==s,m=i.useMemo(()=>h(s,r),[r,s]);return f?n.jsx("img",{src:s,alt:r,loading:"lazy",onError:()=>c(s),className:o("h-7 w-7 shrink-0 rounded-full border border-neutral-200 bg-white object-cover",e)}):n.jsx("div",{className:o("flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-neutral-200 bg-neutral-100 text-[10px] font-semibold text-neutral-600",e),style:p(s),"aria-label":r,children:m})}export{g as M};
1
+ import{r as i,j as n,l as o}from"./index-RYlllU6n.js";function d(r){const t=r.trim();if(!t)return"?";const e=t.split(/\s+/).filter(Boolean);return e.length>=2?`${e[0][0]??""}${e[1][0]??""}`.toUpperCase():Array.from(t).slice(0,2).join("").toUpperCase()}function a(r){const t=r.trim();return/^#([0-9a-f]{3,8})$/i.test(t)||/^rgba?\(/i.test(t)||/^hsla?\(/i.test(t)}function l(r){const t=r.trim();return t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:image/")||t.startsWith("blob:")}function h(r,t){const e=r?.trim()??"";return!e||a(e)||l(e)?d(t):e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}function p(r){const t=r?.trim()??"";if(!(!t||!a(t)))return{backgroundColor:t,color:"#ffffff"}}function g({name:r,avatar:t,className:e}){const[u,c]=i.useState(null),s=t?.trim()??"",f=!!s&&l(s)&&u!==s,m=i.useMemo(()=>h(s,r),[r,s]);return f?n.jsx("img",{src:s,alt:r,loading:"lazy",onError:()=>c(s),className:o("h-7 w-7 shrink-0 rounded-full border border-neutral-200 bg-white object-cover",e)}):n.jsx("div",{className:o("flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-neutral-200 bg-neutral-100 text-[10px] font-semibold text-neutral-600",e),style:p(s),"aria-label":r,children:m})}export{g as M};
@@ -1 +1 @@
1
- import{k as P,m as q,o as E,n as k,q as v,p as h,u as R,r as o,j as e,S as g,a1 as B,g as W,h as j,a2 as z,I as d,B as L,a3 as M,a4 as A,i as K,$ as Q}from"./index-DHKgc87I.js";import{S as O}from"./select-C2v0aFwN.js";import{S as _}from"./switch-DjnF5A3R.js";import{M as D}from"./message-square-Wwixl9YA.js";import{C as H}from"./circle-alert-B6ZM3dSn.js";import"./chevron-down-CmGXPki1.js";import"./check-VMcYyBr4.js";const $=[["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"}]],G=P("link",$);function J(){return q({queryKey:v.notifications.settings,queryFn:()=>h.get("/notifications/settings")})}function V(){const t=E();return k({mutationFn:i=>h.put("/notifications/settings",i),onSuccess:()=>{t.invalidateQueries({queryKey:v.notifications.settings})}})}function X(){return k({mutationFn:t=>h.post("/notifications/test",t)})}function ne(){const{t}=R(),{data:i,isLoading:y}=J(),l=V(),n=X(),N=[{value:"none",label:t("关闭")},{value:"feishu",label:t("飞书 Webhook")}],[a,x]=o.useState({webhookUrl:"",baseUrl:"",titleTemplate:"",bodyTemplate:""}),[m,p]=o.useState(!1),[f,r]=o.useState("idle"),u=o.useRef(void 0);if(o.useEffect(()=>{i&&!m&&x({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]),y)return e.jsx(g,{children:e.jsx(B,{rows:3})});const T=i?.osNotificationEnabled??!0,b=i?.thirdPartyChannel??"none",c=(s,I)=>{x(F=>({...F,[s]:I})),p(!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:()=>p(!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(W,{title:t("通知设置"),className:"mb-1"}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsx(j,{icon:z,label:t("桌面通知"),description:t("任务完成时弹出系统通知"),align:"center",controlWidth:"auto",children:e.jsx(_,{checked:T,onCheckedChange:S,"aria-label":t("桌面通知")})}),e.jsxs("div",{className:"py-5",children:[e.jsx(j,{icon:D,label:t("第三方通知"),description:t("推送到外部渠道(飞书群机器人等)"),align:"center",className:"py-0",children:e.jsx(O,{value:b,onChange:s=>C(s),options:N})}),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(L,{size:"sm",variant:"outline",onClick:w,disabled:!a.webhookUrl.trim()||n.isPending,className:"h-auto shrink-0",children:[n.isPending&&e.jsx(M,{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(A,{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(G,{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(K,{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(Q,{saving:l.isPending,onSave:U})]})}export{ne as NotificationSettingsPage};
1
+ import{k as P,m as q,o as E,n as k,q as v,p as h,u as R,r as o,j as e,S as g,a1 as B,g as W,h as j,a2 as z,I as d,B as L,a3 as M,a4 as A,i as K,$ as Q}from"./index-RYlllU6n.js";import{S as O}from"./select-B9kjO67b.js";import{S as _}from"./switch-C2r5pofB.js";import{M as D}from"./message-square-CStQg7sr.js";import{C as H}from"./circle-alert-ClX4sQ2K.js";import"./chevron-down-BXYCSpWd.js";import"./check-BVOtZt28.js";const $=[["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"}]],G=P("link",$);function J(){return q({queryKey:v.notifications.settings,queryFn:()=>h.get("/notifications/settings")})}function V(){const t=E();return k({mutationFn:i=>h.put("/notifications/settings",i),onSuccess:()=>{t.invalidateQueries({queryKey:v.notifications.settings})}})}function X(){return k({mutationFn:t=>h.post("/notifications/test",t)})}function ne(){const{t}=R(),{data:i,isLoading:y}=J(),l=V(),n=X(),N=[{value:"none",label:t("关闭")},{value:"feishu",label:t("飞书 Webhook")}],[a,x]=o.useState({webhookUrl:"",baseUrl:"",titleTemplate:"",bodyTemplate:""}),[m,p]=o.useState(!1),[f,r]=o.useState("idle"),u=o.useRef(void 0);if(o.useEffect(()=>{i&&!m&&x({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]),y)return e.jsx(g,{children:e.jsx(B,{rows:3})});const T=i?.osNotificationEnabled??!0,b=i?.thirdPartyChannel??"none",c=(s,I)=>{x(F=>({...F,[s]:I})),p(!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:()=>p(!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(W,{title:t("通知设置"),className:"mb-1"}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsx(j,{icon:z,label:t("桌面通知"),description:t("任务完成时弹出系统通知"),align:"center",controlWidth:"auto",children:e.jsx(_,{checked:T,onCheckedChange:S,"aria-label":t("桌面通知")})}),e.jsxs("div",{className:"py-5",children:[e.jsx(j,{icon:D,label:t("第三方通知"),description:t("推送到外部渠道(飞书群机器人等)"),align:"center",className:"py-0",children:e.jsx(O,{value:b,onChange:s=>C(s),options:N})}),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(L,{size:"sm",variant:"outline",onClick:w,disabled:!a.webhookUrl.trim()||n.isPending,className:"h-auto shrink-0",children:[n.isPending&&e.jsx(M,{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(A,{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(G,{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(K,{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(Q,{saving:l.isPending,onSave:U})]})}export{ne as NotificationSettingsPage};
@@ -1,3 +1,3 @@
1
- import{u as T,r as g,j as e,S,g as J,s as M,v as w,I as U,B as E,w as p,l as P}from"./index-DHKgc87I.js";import{u as _,a as z,b as B,c as F}from"./use-profiles-roHXR8He.js";import{M as G}from"./modal-kFSArLJi.js";import{C as $}from"./confirm-dialog-BZeaAl5j.js";import{T as R}from"./textarea-CbZnd5PO.js";import{L as H}from"./layers-BFkjcml2.js";import{C as q}from"./chevron-down-CmGXPki1.js";import{P as K,T as Q}from"./trash-2-DA--Uikt.js";import{P as W}from"./pencil-5Kegi5_H.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 de(){const{t}=T(),{data:a,isLoading:m}=_(),{data:c}=z(),h=B(),j=F(),[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,g as J,s as M,v as w,I as U,B as E,w as p,l as P}from"./index-RYlllU6n.js";import{u as _,a as z,b as B,c as F}from"./use-profiles-OJaV4lOv.js";import{M as G}from"./modal-ZYdX5Krr.js";import{C as $}from"./confirm-dialog-BJwzwwOk.js";import{T as R}from"./textarea-BB3UoYxg.js";import{L as H}from"./layers-BZMh9pqm.js";import{C as q}from"./chevron-down-BXYCSpWd.js";import{P as K,T as Q}from"./trash-2-BNiAEW-6.js";import{P as W}from"./pencil-DoB4p30x.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 de(){const{t}=T(),{data:a,isLoading:m}=_(),{data:c}=z(),h=B(),j=F(),[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(G,{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(U,{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($,{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{de as ProfileSettingsPage};