ai-agent-router 0.1.21 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +14 -0
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/fallback-build-manifest.json +2 -2
  5. package/.next/routes-manifest.json +84 -0
  6. package/.next/server/app/_global-error/page.js +1 -1
  7. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/server/app/_global-error.html +2 -2
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page.js +1 -1
  16. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +1 -1
  19. package/.next/server/app/_not-found.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  23. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/.next/server/app/api/config/route.js.nft.json +1 -1
  27. package/.next/server/app/api/gateway/[...path]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/gateway/models/route.js.nft.json +1 -1
  29. package/.next/server/app/api/gateway/route.js.nft.json +1 -1
  30. package/.next/server/app/api/ide/claude/apply/route.js.nft.json +1 -1
  31. package/.next/server/app/api/ide/claude/available-models/route.js.nft.json +1 -1
  32. package/.next/server/app/api/ide/claude/save/route.js.nft.json +1 -1
  33. package/.next/server/app/api/ide/claude/status/route.js.nft.json +1 -1
  34. package/.next/server/app/api/ide/claude/test/route.js +1 -1
  35. package/.next/server/app/api/ide/claude/test/route.js.nft.json +1 -1
  36. package/.next/server/app/api/ide/openclaw/apply/route/app-paths-manifest.json +3 -0
  37. package/.next/server/app/api/ide/openclaw/apply/route/build-manifest.json +11 -0
  38. package/.next/server/app/api/ide/openclaw/apply/route/server-reference-manifest.json +4 -0
  39. package/.next/server/app/api/ide/openclaw/apply/route.js +7 -0
  40. package/.next/server/app/api/ide/openclaw/apply/route.js.map +5 -0
  41. package/.next/server/app/api/ide/openclaw/apply/route.js.nft.json +1 -0
  42. package/.next/server/app/api/ide/openclaw/apply/route_client-reference-manifest.js +2 -0
  43. package/.next/server/app/api/ide/openclaw/available-models/route/app-paths-manifest.json +3 -0
  44. package/.next/server/app/api/ide/openclaw/available-models/route/build-manifest.json +11 -0
  45. package/.next/server/app/api/ide/openclaw/available-models/route/server-reference-manifest.json +4 -0
  46. package/.next/server/app/api/ide/openclaw/available-models/route.js +7 -0
  47. package/.next/server/app/api/ide/openclaw/available-models/route.js.map +5 -0
  48. package/.next/server/app/api/ide/openclaw/available-models/route.js.nft.json +1 -0
  49. package/.next/server/app/api/ide/openclaw/available-models/route_client-reference-manifest.js +2 -0
  50. package/.next/server/app/api/ide/openclaw/preview/route/app-paths-manifest.json +3 -0
  51. package/.next/server/app/api/ide/openclaw/preview/route/build-manifest.json +11 -0
  52. package/.next/server/app/api/ide/openclaw/preview/route/server-reference-manifest.json +4 -0
  53. package/.next/server/app/api/ide/openclaw/preview/route.js +7 -0
  54. package/.next/server/app/api/ide/openclaw/preview/route.js.map +5 -0
  55. package/.next/server/app/api/ide/openclaw/preview/route.js.nft.json +1 -0
  56. package/.next/server/app/api/ide/openclaw/preview/route_client-reference-manifest.js +2 -0
  57. package/.next/server/app/api/ide/openclaw/restore/route/app-paths-manifest.json +3 -0
  58. package/.next/server/app/api/ide/openclaw/restore/route/build-manifest.json +11 -0
  59. package/.next/server/app/api/ide/openclaw/restore/route/server-reference-manifest.json +4 -0
  60. package/.next/server/app/api/ide/openclaw/restore/route.js +6 -0
  61. package/.next/server/app/api/ide/openclaw/restore/route.js.map +5 -0
  62. package/.next/server/app/api/ide/openclaw/restore/route.js.nft.json +1 -0
  63. package/.next/server/app/api/ide/openclaw/restore/route_client-reference-manifest.js +2 -0
  64. package/.next/server/app/api/ide/openclaw/save/route/app-paths-manifest.json +3 -0
  65. package/.next/server/app/api/ide/openclaw/save/route/build-manifest.json +11 -0
  66. package/.next/server/app/api/ide/openclaw/save/route/server-reference-manifest.json +4 -0
  67. package/.next/server/app/api/ide/openclaw/save/route.js +7 -0
  68. package/.next/server/app/api/ide/openclaw/save/route.js.map +5 -0
  69. package/.next/server/app/api/ide/openclaw/save/route.js.nft.json +1 -0
  70. package/.next/server/app/api/ide/openclaw/save/route_client-reference-manifest.js +2 -0
  71. package/.next/server/app/api/ide/openclaw/status/route/app-paths-manifest.json +3 -0
  72. package/.next/server/app/api/ide/openclaw/status/route/build-manifest.json +11 -0
  73. package/.next/server/app/api/ide/openclaw/status/route/server-reference-manifest.json +4 -0
  74. package/.next/server/app/api/ide/openclaw/status/route.js +7 -0
  75. package/.next/server/app/api/ide/openclaw/status/route.js.map +5 -0
  76. package/.next/server/app/api/ide/openclaw/status/route.js.nft.json +1 -0
  77. package/.next/server/app/api/ide/openclaw/status/route_client-reference-manifest.js +2 -0
  78. package/.next/server/app/api/ide/openclaw/test/route/app-paths-manifest.json +3 -0
  79. package/.next/server/app/api/ide/openclaw/test/route/build-manifest.json +11 -0
  80. package/.next/server/app/api/ide/openclaw/test/route/server-reference-manifest.json +4 -0
  81. package/.next/server/app/api/ide/openclaw/test/route.js +6 -0
  82. package/.next/server/app/api/ide/openclaw/test/route.js.map +5 -0
  83. package/.next/server/app/api/ide/openclaw/test/route.js.nft.json +1 -0
  84. package/.next/server/app/api/ide/openclaw/test/route_client-reference-manifest.js +2 -0
  85. package/.next/server/app/api/ide/opencode/apply/route/app-paths-manifest.json +3 -0
  86. package/.next/server/app/api/ide/opencode/apply/route/build-manifest.json +11 -0
  87. package/.next/server/app/api/ide/opencode/apply/route/server-reference-manifest.json +4 -0
  88. package/.next/server/app/api/ide/opencode/apply/route.js +7 -0
  89. package/.next/server/app/api/ide/opencode/apply/route.js.map +5 -0
  90. package/.next/server/app/api/ide/opencode/apply/route.js.nft.json +1 -0
  91. package/.next/server/app/api/ide/opencode/apply/route_client-reference-manifest.js +2 -0
  92. package/.next/server/app/api/ide/opencode/available-models/route/app-paths-manifest.json +3 -0
  93. package/.next/server/app/api/ide/opencode/available-models/route/build-manifest.json +11 -0
  94. package/.next/server/app/api/ide/opencode/available-models/route/server-reference-manifest.json +4 -0
  95. package/.next/server/app/api/ide/opencode/available-models/route.js +7 -0
  96. package/.next/server/app/api/ide/opencode/available-models/route.js.map +5 -0
  97. package/.next/server/app/api/ide/opencode/available-models/route.js.nft.json +1 -0
  98. package/.next/server/app/api/ide/opencode/available-models/route_client-reference-manifest.js +2 -0
  99. package/.next/server/app/api/ide/opencode/preview/route/app-paths-manifest.json +3 -0
  100. package/.next/server/app/api/ide/opencode/preview/route/build-manifest.json +11 -0
  101. package/.next/server/app/api/ide/opencode/preview/route/server-reference-manifest.json +4 -0
  102. package/.next/server/app/api/ide/opencode/preview/route.js +7 -0
  103. package/.next/server/app/api/ide/opencode/preview/route.js.map +5 -0
  104. package/.next/server/app/api/ide/opencode/preview/route.js.nft.json +1 -0
  105. package/.next/server/app/api/ide/opencode/preview/route_client-reference-manifest.js +2 -0
  106. package/.next/server/app/api/ide/opencode/restore/route/app-paths-manifest.json +3 -0
  107. package/.next/server/app/api/ide/opencode/restore/route/build-manifest.json +11 -0
  108. package/.next/server/app/api/ide/opencode/restore/route/server-reference-manifest.json +4 -0
  109. package/.next/server/app/api/ide/opencode/restore/route.js +6 -0
  110. package/.next/server/app/api/ide/opencode/restore/route.js.map +5 -0
  111. package/.next/server/app/api/ide/opencode/restore/route.js.nft.json +1 -0
  112. package/.next/server/app/api/ide/opencode/restore/route_client-reference-manifest.js +2 -0
  113. package/.next/server/app/api/ide/opencode/save/route/app-paths-manifest.json +3 -0
  114. package/.next/server/app/api/ide/opencode/save/route/build-manifest.json +11 -0
  115. package/.next/server/app/api/ide/opencode/save/route/server-reference-manifest.json +4 -0
  116. package/.next/server/app/api/ide/opencode/save/route.js +7 -0
  117. package/.next/server/app/api/ide/opencode/save/route.js.map +5 -0
  118. package/.next/server/app/api/ide/opencode/save/route.js.nft.json +1 -0
  119. package/.next/server/app/api/ide/opencode/save/route_client-reference-manifest.js +2 -0
  120. package/.next/server/app/api/ide/opencode/status/route/app-paths-manifest.json +3 -0
  121. package/.next/server/app/api/ide/opencode/status/route/build-manifest.json +11 -0
  122. package/.next/server/app/api/ide/opencode/status/route/server-reference-manifest.json +4 -0
  123. package/.next/server/app/api/ide/opencode/status/route.js +7 -0
  124. package/.next/server/app/api/ide/opencode/status/route.js.map +5 -0
  125. package/.next/server/app/api/ide/opencode/status/route.js.nft.json +1 -0
  126. package/.next/server/app/api/ide/opencode/status/route_client-reference-manifest.js +2 -0
  127. package/.next/server/app/api/ide/opencode/test/route/app-paths-manifest.json +3 -0
  128. package/.next/server/app/api/ide/opencode/test/route/build-manifest.json +11 -0
  129. package/.next/server/app/api/ide/opencode/test/route/server-reference-manifest.json +4 -0
  130. package/.next/server/app/api/ide/opencode/test/route.js +6 -0
  131. package/.next/server/app/api/ide/opencode/test/route.js.map +5 -0
  132. package/.next/server/app/api/ide/opencode/test/route.js.nft.json +1 -0
  133. package/.next/server/app/api/ide/opencode/test/route_client-reference-manifest.js +2 -0
  134. package/.next/server/app/api/logs/route.js.nft.json +1 -1
  135. package/.next/server/app/api/models/route.js.nft.json +1 -1
  136. package/.next/server/app/api/providers/route.js.nft.json +1 -1
  137. package/.next/server/app/api/providers/test/route.js.nft.json +1 -1
  138. package/.next/server/app/api/service/force-stop/route.js.nft.json +1 -1
  139. package/.next/server/app/api/service/start/route.js.nft.json +1 -1
  140. package/.next/server/app/api/service/status/route.js.nft.json +1 -1
  141. package/.next/server/app/api/service/stop/route.js.nft.json +1 -1
  142. package/.next/server/app/ide/page.js +1 -1
  143. package/.next/server/app/ide/page.js.nft.json +1 -1
  144. package/.next/server/app/ide/page_client-reference-manifest.js +1 -1
  145. package/.next/server/app/ide.html +1 -1
  146. package/.next/server/app/ide.rsc +3 -3
  147. package/.next/server/app/ide.segments/_full.segment.rsc +3 -3
  148. package/.next/server/app/ide.segments/_head.segment.rsc +1 -1
  149. package/.next/server/app/ide.segments/_index.segment.rsc +2 -2
  150. package/.next/server/app/ide.segments/_tree.segment.rsc +2 -2
  151. package/.next/server/app/ide.segments/ide/__PAGE__.segment.rsc +2 -2
  152. package/.next/server/app/ide.segments/ide.segment.rsc +1 -1
  153. package/.next/server/app/index.html +1 -1
  154. package/.next/server/app/index.rsc +2 -2
  155. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  156. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  157. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  158. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  159. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  160. package/.next/server/app/logs/page.js +1 -1
  161. package/.next/server/app/logs/page.js.nft.json +1 -1
  162. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  163. package/.next/server/app/logs.html +1 -1
  164. package/.next/server/app/logs.rsc +3 -3
  165. package/.next/server/app/logs.segments/_full.segment.rsc +3 -3
  166. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  167. package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
  168. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  169. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +2 -2
  170. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  171. package/.next/server/app/models/page.js +1 -1
  172. package/.next/server/app/models/page.js.nft.json +1 -1
  173. package/.next/server/app/models/page_client-reference-manifest.js +1 -1
  174. package/.next/server/app/models.html +1 -1
  175. package/.next/server/app/models.rsc +2 -2
  176. package/.next/server/app/models.segments/_full.segment.rsc +2 -2
  177. package/.next/server/app/models.segments/_head.segment.rsc +1 -1
  178. package/.next/server/app/models.segments/_index.segment.rsc +2 -2
  179. package/.next/server/app/models.segments/_tree.segment.rsc +2 -2
  180. package/.next/server/app/models.segments/models/__PAGE__.segment.rsc +1 -1
  181. package/.next/server/app/models.segments/models.segment.rsc +1 -1
  182. package/.next/server/app/page.js +1 -1
  183. package/.next/server/app/page.js.nft.json +1 -1
  184. package/.next/server/app/page_client-reference-manifest.js +1 -1
  185. package/.next/server/app/providers/page.js +1 -1
  186. package/.next/server/app/providers/page.js.nft.json +1 -1
  187. package/.next/server/app/providers/page_client-reference-manifest.js +1 -1
  188. package/.next/server/app/providers.html +1 -1
  189. package/.next/server/app/providers.rsc +2 -2
  190. package/.next/server/app/providers.segments/_full.segment.rsc +2 -2
  191. package/.next/server/app/providers.segments/_head.segment.rsc +1 -1
  192. package/.next/server/app/providers.segments/_index.segment.rsc +2 -2
  193. package/.next/server/app/providers.segments/_tree.segment.rsc +2 -2
  194. package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +1 -1
  195. package/.next/server/app/providers.segments/providers.segment.rsc +1 -1
  196. package/.next/server/app-paths-manifest.json +14 -0
  197. package/.next/server/chunks/[root-of-the-server]__001d5756._.js +3 -0
  198. package/.next/server/chunks/[root-of-the-server]__001d5756._.js.map +1 -0
  199. package/.next/server/chunks/[root-of-the-server]__05f8578b._.js +3 -0
  200. package/.next/server/chunks/[root-of-the-server]__05f8578b._.js.map +1 -0
  201. package/.next/server/chunks/[root-of-the-server]__1480f018._.js +1 -1
  202. package/.next/server/chunks/[root-of-the-server]__1480f018._.js.map +1 -1
  203. package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js +1 -1
  204. package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js.map +1 -1
  205. package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js +1 -1
  206. package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js.map +1 -1
  207. package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js +1 -1
  208. package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js.map +1 -1
  209. package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js +1 -1
  210. package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js.map +1 -1
  211. package/.next/server/chunks/[root-of-the-server]__43810962._.js +3 -0
  212. package/.next/server/chunks/[root-of-the-server]__43810962._.js.map +1 -0
  213. package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js +3 -0
  214. package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js.map +1 -0
  215. package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js +1 -1
  216. package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js.map +1 -1
  217. package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js +1 -1
  218. package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js.map +1 -1
  219. package/.next/server/chunks/[root-of-the-server]__760eaa16._.js +3 -0
  220. package/.next/server/chunks/[root-of-the-server]__760eaa16._.js.map +1 -0
  221. package/.next/server/chunks/[root-of-the-server]__772134c6._.js +1 -1
  222. package/.next/server/chunks/[root-of-the-server]__772134c6._.js.map +1 -1
  223. package/.next/server/chunks/[root-of-the-server]__7b77f523._.js +1 -1
  224. package/.next/server/chunks/[root-of-the-server]__7b77f523._.js.map +1 -1
  225. package/.next/server/chunks/[root-of-the-server]__7c298a19._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__7c298a19._.js.map +1 -0
  227. package/.next/server/chunks/[root-of-the-server]__85540228._.js +3 -0
  228. package/.next/server/chunks/[root-of-the-server]__85540228._.js.map +1 -0
  229. package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js +3 -0
  230. package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js.map +1 -0
  231. package/.next/server/chunks/[root-of-the-server]__97622908._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__97622908._.js.map +1 -0
  233. package/.next/server/chunks/[root-of-the-server]__a02e6618._.js +3 -0
  234. package/.next/server/chunks/[root-of-the-server]__a02e6618._.js.map +1 -0
  235. package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js.map +1 -0
  237. package/.next/server/chunks/[root-of-the-server]__af5b556a._.js +3 -0
  238. package/.next/server/chunks/[root-of-the-server]__af5b556a._.js.map +1 -0
  239. package/.next/server/chunks/[root-of-the-server]__c1b4b601._.js +18 -18
  240. package/.next/server/chunks/[root-of-the-server]__c1b4b601._.js.map +1 -1
  241. package/.next/server/chunks/[root-of-the-server]__cafe113e._.js +3 -0
  242. package/.next/server/chunks/[root-of-the-server]__cafe113e._.js.map +1 -0
  243. package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js +1 -1
  244. package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js.map +1 -1
  245. package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js.map +1 -0
  247. package/.next/server/chunks/[root-of-the-server]__f8949f88._.js +1 -1
  248. package/.next/server/chunks/[root-of-the-server]__f8949f88._.js.map +1 -1
  249. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js +3 -0
  250. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js.map +1 -0
  251. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js +3 -0
  252. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js.map +1 -0
  253. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js +3 -0
  254. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js.map +1 -0
  255. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js +3 -0
  256. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js.map +1 -0
  257. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js +3 -0
  258. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js.map +1 -0
  259. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js +3 -0
  260. package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js.map +1 -0
  261. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js +3 -0
  262. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js.map +1 -0
  263. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js +3 -0
  264. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js.map +1 -0
  265. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js +3 -0
  266. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js.map +1 -0
  267. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js +3 -0
  268. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js.map +1 -0
  269. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js +3 -0
  270. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js.map +1 -0
  271. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js +3 -0
  272. package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js.map +1 -0
  273. package/.next/server/chunks/ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js +3 -0
  274. package/.next/server/chunks/ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js.map +1 -0
  275. package/.next/server/chunks/ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js +3 -0
  276. package/.next/server/chunks/ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js.map +1 -0
  277. package/.next/server/chunks/ssr/{[root-of-the-server]__bec95712._.js → [root-of-the-server]__81937253._.js} +2 -2
  278. package/.next/server/chunks/ssr/{[root-of-the-server]__bec95712._.js.map → [root-of-the-server]__81937253._.js.map} +1 -1
  279. package/.next/server/chunks/ssr/{[root-of-the-server]__71c85955._.js → [root-of-the-server]__976ad963._.js} +2 -2
  280. package/.next/server/chunks/ssr/{[root-of-the-server]__71c85955._.js.map → [root-of-the-server]__976ad963._.js.map} +1 -1
  281. package/.next/server/chunks/ssr/src_app_ide_page_tsx_8962793b._.js +1 -1
  282. package/.next/server/chunks/ssr/src_app_ide_page_tsx_8962793b._.js.map +1 -1
  283. package/.next/server/chunks/ssr/src_app_logs_page_tsx_7b7b7b83._.js +1 -1
  284. package/.next/server/chunks/ssr/src_app_logs_page_tsx_7b7b7b83._.js.map +1 -1
  285. package/.next/server/pages/404.html +1 -1
  286. package/.next/server/pages/500.html +2 -2
  287. package/.next/static/chunks/0f120c117962200b.css +1 -0
  288. package/.next/static/chunks/64f547b3bcd3aef4.js +1 -0
  289. package/.next/static/chunks/{81c904164fe81379.js → 7c8b7cbb3339f139.js} +1 -1
  290. package/.next/static/chunks/8ed839b2e4948968.js +1 -0
  291. package/.next/types/routes.d.ts +15 -1
  292. package/.next/types/validator.ts +126 -0
  293. package/README.md +100 -111
  294. package/dist/.next/dev/types/validator.js +56 -0
  295. package/dist/.next/types/validator.js +56 -0
  296. package/dist/src/app/api/gateway/[...path]/route.js +1 -1
  297. package/dist/src/app/api/gateway/route.js +1 -1
  298. package/dist/src/app/api/ide/claude/apply/route.js +42 -31
  299. package/dist/src/app/api/ide/claude/status/route.js +6 -1
  300. package/dist/src/app/api/ide/openclaw/apply/route.js +92 -0
  301. package/dist/src/app/api/ide/openclaw/available-models/route.js +46 -0
  302. package/dist/src/app/api/ide/openclaw/build-config.js +101 -0
  303. package/dist/src/app/api/ide/openclaw/preview/route.js +49 -0
  304. package/dist/src/app/api/ide/openclaw/restore/route.js +24 -0
  305. package/dist/src/app/api/ide/openclaw/save/route.js +54 -0
  306. package/dist/src/app/api/ide/openclaw/status/route.js +139 -0
  307. package/dist/src/app/api/ide/openclaw/test/route.js +158 -0
  308. package/dist/src/app/api/ide/opencode/apply/route.js +89 -0
  309. package/dist/src/app/api/ide/opencode/available-models/route.js +46 -0
  310. package/dist/src/app/api/ide/opencode/build-config.js +54 -0
  311. package/dist/src/app/api/ide/opencode/preview/route.js +36 -0
  312. package/dist/src/app/api/ide/opencode/restore/route.js +40 -0
  313. package/dist/src/app/api/ide/opencode/save/route.js +123 -0
  314. package/dist/src/app/api/ide/opencode/status/route.js +106 -0
  315. package/dist/src/app/api/ide/opencode/test/route.js +136 -0
  316. package/dist/src/app/api/logs/route.js +2 -2
  317. package/dist/src/app/api/models/route.js +5 -5
  318. package/dist/src/app/api/providers/route.js +4 -4
  319. package/dist/src/app/api/providers/test/route.js +1 -1
  320. package/dist/src/app/api/service/start/route.js +1 -1
  321. package/dist/src/app/api/service/status/route.js +1 -1
  322. package/dist/src/app/api/service/stop/route.js +1 -1
  323. package/dist/src/app/ide/page.js +591 -81
  324. package/dist/src/app/logs/page.js +15 -1
  325. package/dist/src/cli/index.js +218 -20
  326. package/dist/src/db/database.js +56 -5
  327. package/dist/src/db/queries.js +6 -6
  328. package/dist/src/server/logger.js +22 -4
  329. package/package.json +2 -1
  330. package/src/app/api/gateway/[...path]/route.ts +1 -1
  331. package/src/app/api/gateway/route.ts +1 -1
  332. package/src/app/api/ide/claude/apply/route.ts +46 -31
  333. package/src/app/api/ide/claude/status/route.ts +12 -2
  334. package/src/app/api/ide/openclaw/apply/route.ts +103 -0
  335. package/src/app/api/ide/openclaw/available-models/route.ts +59 -0
  336. package/src/app/api/ide/openclaw/build-config.ts +152 -0
  337. package/src/app/api/ide/openclaw/preview/route.ts +57 -0
  338. package/src/app/api/ide/openclaw/restore/route.ts +27 -0
  339. package/src/app/api/ide/openclaw/save/route.ts +67 -0
  340. package/src/app/api/ide/openclaw/status/route.ts +178 -0
  341. package/src/app/api/ide/openclaw/test/route.ts +194 -0
  342. package/src/app/api/ide/opencode/apply/route.ts +92 -0
  343. package/src/app/api/ide/opencode/available-models/route.ts +59 -0
  344. package/src/app/api/ide/opencode/build-config.ts +69 -0
  345. package/src/app/api/ide/opencode/preview/route.ts +40 -0
  346. package/src/app/api/ide/opencode/restore/route.ts +52 -0
  347. package/src/app/api/ide/opencode/save/route.ts +131 -0
  348. package/src/app/api/ide/opencode/status/route.ts +128 -0
  349. package/src/app/api/ide/opencode/test/route.ts +145 -0
  350. package/src/app/api/logs/route.ts +2 -2
  351. package/src/app/api/models/route.ts +5 -5
  352. package/src/app/api/providers/route.ts +4 -4
  353. package/src/app/api/providers/test/route.ts +1 -1
  354. package/src/app/api/service/start/route.ts +1 -1
  355. package/src/app/api/service/status/route.ts +1 -1
  356. package/src/app/api/service/stop/route.ts +1 -1
  357. package/src/app/globals.css +17 -0
  358. package/src/app/ide/page.tsx +1535 -132
  359. package/src/app/logs/page.tsx +17 -5
  360. package/src/cli/index.ts +228 -25
  361. package/src/db/database.ts +60 -8
  362. package/src/db/queries.ts +6 -6
  363. package/src/server/logger.ts +19 -4
  364. package/.next/static/chunks/6418ca50028376b7.css +0 -1
  365. package/.next/static/chunks/9ec3b97741b6575e.js +0 -1
  366. /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_buildManifest.js +0 -0
  367. /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_clientMiddlewareManifest.json +0 -0
  368. /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[53119,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(81844),e=a.i(21215);function f(){let[a,f]=(0,c.useState)("claude"),[g,h]=(0,c.useState)("GLM-4.5-air"),[i,j]=(0,c.useState)("MiniMax-M2.1"),[k,l]=(0,c.useState)("GLM-4.7"),[m,n]=(0,c.useState)("GLM-4.7"),[o,p]=(0,c.useState)("GLM-4.7"),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(null),[E,F]=(0,c.useState)({}),[G,H]=(0,c.useState)(!0),[I,J]=(0,c.useState)(null),{showToast:K}=(0,e.useToast)(),L=(0,c.useRef)(null),M=async()=>{try{let a=await fetch("/api/ide/claude/status"),b=await a.json();D(b);let c=!1===b.matchCurrentGateway&&b.tempMapping?b.tempMapping:b.modelMapping;c&&(h(c.haiku||"GLM-4.5-air"),j(c.sonnet||"MiniMax-M2.1"),l(c.opus||"GLM-4.7"),n(c.default||"GLM-4.7"),p(c.reasoning||"GLM-4.7")),r(b.applied&&"aar"===b.routerProvider)}catch(a){console.error("Failed to load status:",a)}finally{H(!1)}},N=async()=>{try{let a=await fetch("/api/ide/claude/available-models"),b=await a.json();F(b.models||{})}catch(a){console.error("Failed to load models:",a)}};(0,c.useEffect)(()=>{M(),N()},[]);let O=async()=>{v(!0);try{let a=await fetch("/api/ide/claude/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({haiku:g,sonnet:i,opus:k,default:m,reasoning:o})}),b=await a.json();b.success?(K("配置应用成功","success"),await M()):K("应用失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to apply config:",a),K("应用失败: 网络错误","error")}finally{v(!1)}},P=async()=>{x(!0);try{let a=await fetch("/api/ide/claude/restore",{method:"POST"}),b=await a.json();b.success?(K("配置已还原","success"),await M()):K("还原失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to restore config:",a),K("还原失败: 网络错误","error")}finally{x(!1)}},Q=async()=>{L.current&&(L.current.abort(),L.current=null),L.current=new AbortController,z(!0),J(null);try{let a=await fetch("/api/ide/claude/test",{signal:L.current.signal}),b=await a.json();J(b),b.success?K("配置测试通过","success"):K("配置验证失败: "+(b.error||b.suggestion||"请检查配置"),"error")}catch(a){console.error("Failed to test config:",a),"AbortError"===a.name?K("测试已取消","info"):(K("测试失败: 网络错误","error"),J({error:"Network error"}))}finally{L.current?.signal.aborted===!1&&(L.current=null),z(!1)}},R=async()=>{B(!0);try{let a=await fetch("/api/ide/claude/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({haiku:g,sonnet:i,opus:k,default:m,reasoning:o})}),b=await a.json();if(b.success){let a="temp"===b.saveType;K(a?"配置已保存(临时)":"配置已更新到 Claude Code","success"),await M()}else K("保存失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to save config:",a),K("保存失败: 网络错误","error")}finally{B(!1)}};return G?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-slate-50/80",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 border-2 border-slate-200 border-t-slate-900 rounded-full animate-spin"}),(0,b.jsx)("div",{className:"text-xs font-medium text-slate-500",children:"加载中..."})]})}):(0,b.jsxs)("div",{className:"min-h-screen bg-slate-50/80",children:[(0,b.jsx)(d.default,{}),(0,b.jsxs)("main",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,b.jsxs)("div",{className:"mb-10",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold text-slate-900 tracking-tight",children:"IDE 配置"}),(0,b.jsx)("span",{className:"px-2.5 py-0.5 text-xs font-medium text-slate-600 bg-slate-100/80 rounded-full border border-slate-200/50",children:"v1.0"})]}),(0,b.jsx)("p",{className:"text-sm text-slate-500",children:"配置 Claude Code 和 Cursor 的模型代理设置"})]}),(0,b.jsxs)("div",{className:"bg-white/60 backdrop-blur-md rounded-xl border border-slate-200/50 shadow-sm",children:[(0,b.jsx)("div",{className:"border-b border-slate-200/50 bg-white/40",children:(0,b.jsxs)("nav",{className:"flex gap-1 px-5","aria-label":"Tabs",children:[(0,b.jsxs)("button",{onClick:()=>f("claude"),className:`relative px-4 py-3.5 text-sm font-medium transition-all duration-200 ${"claude"===a?"text-slate-900":"text-slate-400 hover:text-slate-600"}`,children:["Claude Code","claude"===a&&(0,b.jsx)("span",{className:"absolute bottom-0 left-4 right-4 h-[2px] bg-slate-900 rounded-full"})]}),(0,b.jsx)("button",{onClick:()=>f("cursor"),disabled:!0,className:"relative px-4 py-3.5 text-sm font-medium text-slate-300 disabled:cursor-not-allowed",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["Cursor",(0,b.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-medium text-slate-400 bg-slate-100/60 rounded-full border border-slate-200/50",children:"即将推出"})]})})]})}),(0,b.jsx)("div",{className:"p-5 sm:p-6",children:"claude"===a&&(0,b.jsxs)("div",{className:"space-y-6",children:[C&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-3 px-4 bg-white/60 rounded-lg border border-slate-200/50",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${C.applied?"bg-emerald-100 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:C.applied?(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-slate-700",children:C.applied?"已配置":"未配置"}),C.applied&&void 0!==C.matchCurrentGateway&&(0,b.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full border ${C.matchCurrentGateway?"bg-emerald-50/80 text-emerald-700 border-emerald-200/60":"bg-amber-50/80 text-amber-700 border-amber-200/60"}`,children:C.matchCurrentGateway?"匹配当前网关":"不匹配"})]})]}),C.lastUpdated&&(0,b.jsx)("div",{className:"text-[11px] text-slate-400 font-mono",children:new Date(C.lastUpdated).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-[11px] font-medium text-slate-400 mb-5",children:"模型映射"}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[{key:"haiku",label:"Haiku",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),description:"快速响应",value:g,onChange:h},{key:"sonnet",label:"Sonnet",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),description:"平衡性能",value:i,onChange:j},{key:"opus",label:"Opus",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.663 17h4.673M12 3v1m6.364 5.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),description:"深度思考",value:k,onChange:l},{key:"default",label:"默认",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),description:"主要模型",value:m,onChange:n},{key:"reasoning",label:"推理",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 14.9a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 1.414l-5-5A2 2 0 009 10.172V5L8 4z"})}),description:"复杂推理",value:o,onChange:p}].map(a=>(0,b.jsx)("div",{className:"group relative bg-gradient-to-br from-white/50 to-transparent hover:from-slate-50/60 rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:(0,b.jsxs)("label",{htmlFor:a.key,className:"cursor-pointer",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5 relative group/tip",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-slate-100/80 text-slate-600 flex items-center justify-center",children:a.icon}),(0,b.jsx)("div",{className:"flex items-center gap-2.5",children:(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:a.label})}),(0,b.jsx)("div",{className:"absolute left-9 top-0 mt-8 w-28 rounded-lg bg-slate-900/95 backdrop-blur-md px-3 py-2 text-[10px] text-slate-200 shadow-xl opacity-0 invisible group-hover/tip:opacity-100 group-hover/tip:visible transition-all duration-200 z-10",children:a.description})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("select",{id:a.key,value:a.value,onChange:b=>a.onChange(b.target.value),className:"w-full appearance-none rounded-lg border border-slate-200/80 bg-white/90 backdrop-blur-sm px-3 py-2 pr-7 text-[11px] font-medium text-slate-700 shadow-sm transition-all duration-200 hover:border-slate-300/80 hover:bg-white focus:border-slate-400/80 focus:ring-2 focus:ring-slate-200/50 focus:outline-none cursor-pointer",children:Object.entries(E).map(([a,c])=>(0,b.jsx)("optgroup",{label:a,children:c.map(a=>(0,b.jsx)("option",{value:a.model_id,children:a.name},a.id))},a))}),(0,b.jsx)("div",{className:"absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none",children:(0,b.jsx)("svg",{className:"w-3 h-3 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2.5 group-hover:text-slate-600 transition-colors",children:a.description})]})},a.key))})]}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3 pt-1",children:[(0,b.jsx)("button",{onClick:q?P:O,disabled:u||w,className:`w-full px-4 py-2.5 text-xs font-medium rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${q?"bg-white border-slate-200/80 text-slate-700 hover:border-slate-300 hover:bg-slate-50":"bg-slate-900 border-slate-900 text-white hover:bg-slate-800"}`,children:u?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),q?"还原中":"应用中"]}):(0,b.jsxs)(b.Fragment,{children:[q?(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}):(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),q?"还原配置":"应用配置"]})}),y?(0,b.jsxs)("button",{onClick:()=>{L.current&&(L.current.abort(),L.current=null)},className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-amber-200/80 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"取消测试"]}):(0,b.jsxs)("button",{onClick:Q,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:bg-slate-50 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"测试配置"]}),q?(0,b.jsx)("button",{onClick:R,disabled:A,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-emerald-200/80 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:A?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"保存中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"}),(0,b.jsx)("polyline",{points:"17 21 17 13 7 13 7 21"})]}),"保存配置"]})}):(0,b.jsx)("button",{onClick:R,disabled:A,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-indigo-200/80 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:A?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"保存中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"}),(0,b.jsx)("polyline",{points:"17 21 17 13 7 13 7 21"})]}),"保存配置"]})})]}),I&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 ${I.success?"bg-emerald-50/60 border-emerald-200/60":"bg-rose-50/60 border-rose-200/60"}`,children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 ${I.success?"bg-emerald-500":"bg-rose-500"}`,children:I.success?(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})})}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-xs font-medium mb-1",children:I.success?"配置验证成功":"配置验证失败"}),(0,b.jsx)("p",{className:`text-[11px] ${I.success?"text-emerald-700/80":"text-rose-700/80"}`,children:I.success?"Claude Code 可以正常工作":"请检查配置"}),I.checks&&(0,b.jsx)("div",{className:"mt-3 pt-3 border-t border-white/40",children:(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Object.entries(I.checks).map(([a,c])=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[c?(0,b.jsx)("svg",{className:"w-3 h-3 text-emerald-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-rose-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})}),(0,b.jsx)("span",{className:"text-[10px] text-slate-600",children:{hasBaseUrl:"网关",hasApiKey:"API Key",hasHaikuModel:"Haiku",hasSonnetModel:"Sonnet",hasOpusModel:"Opus",hasDefaultModel:"默认模型",hasReasoningModel:"推理模型",isFromAar:"来源"}[a]||a})]},a))})}),I.claudeTest&&(0,b.jsx)("div",{className:"mt-3 pt-3 border-t border-white/40",children:I.claudeTest.success?(0,b.jsxs)("p",{className:"text-[10px] text-emerald-700",children:[I.claudeTest.message,I.claudeTest.output&&(0,b.jsxs)("span",{className:"text-[10px] text-slate-500 ml-1.5",children:["输出: ",I.claudeTest.output]})]}):(0,b.jsx)("p",{className:"text-[10px] text-rose-700 font-mono bg-rose-100/50 px-2 py-1 rounded inline-block",children:I.claudeTest.error})}),I.configSummary&&(0,b.jsxs)("details",{className:"mt-3 group",children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[10px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),"配置详情"]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5 text-[10px]",children:[(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"网关"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:I.configSummary.baseUrl})]}),(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"API Key"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:I.configSummary.apiKey})]}),I.configSummary.routerProvider&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"来源"}),(0,b.jsx)("span",{className:"text-slate-700",children:"aar"===I.configSummary.routerProvider?"当前工具":I.configSummary.routerProvider})]}),"not set"!==I.configSummary.haikuModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Haiku"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:I.configSummary.haikuModel})]}),"not set"!==I.configSummary.sonnetModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Sonnet"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:I.configSummary.sonnetModel})]}),"not set"!==I.configSummary.opusModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Opus"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:I.configSummary.opusModel})]})]})]})]})]})}),(0,b.jsxs)("details",{className:"group",children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[11px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1.5 py-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,b.jsx)("span",{children:"配置预览"})]}),(0,b.jsx)("div",{className:"mt-3",children:(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-lg bg-slate-950 border border-slate-800",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"settings.json"})]}),(0,b.jsx)("pre",{className:"p-3.5 text-[10px] text-slate-300 font-mono overflow-x-auto bg-slate-950",children:JSON.stringify({router_provider:"aar",env:{ANTHROPIC_AUTH_TOKEN:C?.apiKey&&"your-gateway-api-key"!==C.apiKey?"****"+C.apiKey.slice(-8):"your-gateway-api-key",ANTHROPIC_BASE_URL:C?.gatewayAddress||"http://localhost:3000",ANTHROPIC_DEFAULT_HAIKU_MODEL:g,ANTHROPIC_DEFAULT_SONNET_MODEL:i,ANTHROPIC_DEFAULT_OPUS_MODEL:k,ANTHROPIC_MODEL:m,ANTHROPIC_REASONING_MODEL:o,API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:1,hasCompletedOnboarding:!0}},null,2)})]})})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-slate-200/50 bg-slate-50/60 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2.5",children:[(0,b.jsx)("svg",{className:"w-4 h-4 text-slate-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,b.jsx)("h3",{className:"text-xs font-semibold text-slate-700",children:"使用说明"})]}),(0,b.jsxs)("ul",{className:"space-y-1.5 text-[10px] text-slate-600",children:[(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"1."}),(0,b.jsx)("span",{children:"为每个模型类别选择对应的路由模型"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"2."}),(0,b.jsx)("span",{children:"下方配置预览会实时更新"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"3."}),(0,b.jsx)("span",{children:'点击"保存配置"可临时保存当前选择'})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"4."}),(0,b.jsx)("span",{children:'点击"应用配置"将设置写入 Claude Code'})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"5."}),(0,b.jsx)("span",{children:"配置文件位于 ~/.claude/settings.json"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"6."}),(0,b.jsx)("span",{children:"临时配置保存在 ~/.aar/settings.tmp.json"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"7."}),(0,b.jsx)("span",{children:'点击"还原配置"可恢复到应用前的状态'})]})]})]})]})})]})]})]})}a.s(["default",()=>f])}];
1
+ module.exports=[53119,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(81844),e=a.i(21215);function f(){let[a,f]=(0,c.useState)("claude"),[g,h]=(0,c.useState)("GLM-4.5-air"),[i,j]=(0,c.useState)("MiniMax-M2.1"),[k,l]=(0,c.useState)("GLM-4.7"),[m,n]=(0,c.useState)("GLM-4.7"),[o,p]=(0,c.useState)("GLM-4.7"),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)("preview"),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)({}),[I,J]=(0,c.useState)(!0),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)("GLM-4.7"),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(!1),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(!1),[W,X]=(0,c.useState)(!1),[Y,Z]=(0,c.useState)(null),[$,_]=(0,c.useState)({}),[aa,ab]=(0,c.useState)(null),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(!1),[ag,ah]=(0,c.useState)("current"),[ai,aj]=(0,c.useState)("GLM-4.7"),[ak,al]=(0,c.useState)([]),[am,an]=(0,c.useState)(""),[ao,ap]=(0,c.useState)([]),[aq,ar]=(0,c.useState)(null),[as,at]=(0,c.useState)(!1),[au,av]=(0,c.useState)(!1),[aw,ax]=(0,c.useState)(!1),[ay,az]=(0,c.useState)(!1),[aA,aB]=(0,c.useState)(null),[aC,aD]=(0,c.useState)({}),[aE,aF]=(0,c.useState)(null),[aG,aH]=(0,c.useState)(""),[aI,aJ]=(0,c.useState)(!1),[aK,aL]=(0,c.useState)(null),[aM,aN]=(0,c.useState)(""),[aO,aP]=(0,c.useState)("preview"),aQ=(0,c.useRef)(null),{showToast:aR}=(0,e.useToast)(),aS=(0,c.useMemo)(()=>Object.entries(aC).flatMap(([a,b])=>b.map(b=>({...b,provider:a}))),[aC]),aT=(0,c.useMemo)(()=>{let a=aM.trim().toLowerCase();return a?aS.filter(b=>b.name.toLowerCase().includes(a)||b.model_id.toLowerCase().includes(a)):aS},[aS,aM]),aU=(0,c.useRef)(null),aV=(0,c.useRef)(null),aW=(0,c.useRef)(null),aX=async()=>{try{let a=await fetch("/api/ide/claude/status"),b=await a.json();F(b);let c=!1===b.matchCurrentGateway&&b.tempMapping?b.tempMapping:b.modelMapping;c&&(h(c.haiku||"GLM-4.5-air"),j(c.sonnet||"MiniMax-M2.1"),l(c.opus||"GLM-4.7"),n(c.default||"GLM-4.7"),p(c.reasoning||"GLM-4.7")),r(b.applied&&"aar"===b.routerProvider)}catch(a){console.error("Failed to load status:",a)}finally{J(!1)}},aY=async()=>{try{let a=await fetch("/api/ide/claude/available-models"),b=await a.json();H(b.models||{})}catch(a){console.error("Failed to load models:",a)}},aZ=async()=>{try{let a=await fetch("/api/ide/opencode/status"),b=await a.json();P(b);let c=!1===b.matchCurrentGateway&&b.tempDefaultModel?b.tempDefaultModel:b.defaultModel;c?N(c):b.defaultModel&&N(b.defaultModel)}catch(a){console.error("Failed to load OpenCode status:",a)}},a$=async()=>{try{let a=await fetch("/api/ide/opencode/available-models"),b=await a.json();_(b.models||{})}catch(a){console.error("Failed to load OpenCode models:",a)}},a_=async()=>{try{let a=await fetch("/api/ide/openclaw/status"),b=await a.json();ar(b),!1===b.matchCurrentGateway&&b.tempDefaultModel?(aj(b.tempDefaultModel||"GLM-4.7"),al(b.tempDefaultFallbacks||[]),an(b.tempImageModel||""),ap(b.tempImageFallbacks||[])):(aj(b.defaultModel||"GLM-4.7"),al(b.defaultFallbacks||[]),an(b.imageModel||""),ap(b.imageFallbacks||[]))}catch(a){console.error("Failed to load OpenClaw status:",a)}},a0=async()=>{try{let a=await fetch("/api/ide/openclaw/available-models"),b=await a.json();aD(b.models||{})}catch(a){console.error("Failed to load OpenClaw models:",a)}};(0,c.useEffect)(()=>{aX(),aY(),aZ(),a$(),a_(),a0()},[]),(0,c.useEffect)(()=>{if("opencode"!==a||!M){ab(null),ad("");return}let b=!1;return af(!0),ab(null),ad(""),fetch(`/api/ide/opencode/preview?default_model=${encodeURIComponent(M)}`).then(a=>a.json()).then(a=>{!b&&a.config&&(ab(a.config),ad(JSON.stringify(a.config,null,2)))}).catch(()=>{b||ab(null),b||ad("")}).finally(()=>{b||af(!1)}),()=>{b=!0}},[a,M]),(0,c.useEffect)(()=>{if("openclaw"!==a||!ai){aF(null),aH("");return}let b=!1;aJ(!0),aF(null),aH("");let c=new URLSearchParams({default_model:ai,default_fallbacks:ak.join(",")});return am&&(c.set("image_model",am),ao.length>0&&c.set("image_fallbacks",ao.join(","))),fetch(`/api/ide/openclaw/preview?${c.toString()}`).then(a=>a.json()).then(a=>{!b&&a.config&&(aF(a.config),aH(JSON.stringify(a.config,null,2)))}).catch(()=>{b||aF(null),b||aH("")}).finally(()=>{b||aJ(!1)}),()=>{b=!0}},[a,ai,ak,am,ao]),(0,c.useEffect)(()=>{if(null==aK)return;let a=a=>{aQ.current&&!aQ.current.contains(a.target)&&aL(null)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[aK]);let a1=async()=>{x(!0);try{let a=await fetch("/api/ide/claude/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({haiku:g,sonnet:i,opus:k,default:m,reasoning:o})}),b=await a.json();b.success?(aR("配置应用成功","success"),await aX()):aR("应用失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to apply config:",a),aR("应用失败: 网络错误","error")}finally{x(!1)}},a2=async()=>{z(!0);try{let a=await fetch("/api/ide/claude/restore",{method:"POST"}),b=await a.json();b.success?(aR("配置已还原","success"),v("current"),await aX()):aR("还原失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to restore config:",a),aR("还原失败: 网络错误","error")}finally{z(!1)}},a3=async()=>{aU.current&&(aU.current.abort(),aU.current=null),aU.current=new AbortController,B(!0),L(null);try{let a=await fetch("/api/ide/claude/test",{signal:aU.current.signal}),b=await a.json();L(b),b.success?aR("配置测试通过","success"):aR("配置验证失败: "+(b.error||b.suggestion||"请检查配置"),"error")}catch(a){console.error("Failed to test config:",a),"AbortError"===a.name?aR("测试已取消","info"):(aR("测试失败: 网络错误","error"),L({error:"Network error"}))}finally{aU.current?.signal.aborted===!1&&(aU.current=null),B(!1)}},a4=O?.applied&&O?.routerProvider==="aar",a5=async()=>{R(!0);try{let a=await fetch("/api/ide/opencode/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_model:M,...ac.trim()?{config:ac}:{}})}),b=await a.json();b.success?(aR(b.message||"OpenCode 配置应用成功","success"),await aZ()):aR("应用失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to apply OpenCode config:",a),aR("应用失败: 网络错误","error")}finally{R(!1)}},a6=async()=>{T(!0);try{let a=await fetch("/api/ide/opencode/restore",{method:"POST"}),b=await a.json();b.success?(aR("OpenCode 配置已还原","success"),ah("current"),await aZ()):aR("还原失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to restore OpenCode config:",a),aR("还原失败: 网络错误","error")}finally{T(!1)}},a7=async()=>{aV.current&&(aV.current.abort(),aV.current=null),aV.current=new AbortController,V(!0),Z(null);try{let a=await fetch("/api/ide/opencode/test",{signal:aV.current.signal}),b=await a.json();Z(b),b.success?aR("OpenCode 配置测试通过","success"):aR("配置验证失败: "+(b.error||b.suggestion||"请检查配置"),"error")}catch(a){"AbortError"===a.name?aR("测试已取消","info"):(aR("测试失败: 网络错误","error"),Z({error:"Network error"}))}finally{aV.current?.signal.aborted===!1&&(aV.current=null),V(!1)}},a8=aq?.applied&&aq?.routerProvider==="aar",a9=async()=>{at(!0);try{let a=await fetch("/api/ide/openclaw/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_model:ai,default_fallbacks:ak,image_model:am||void 0,image_fallbacks:ao,...aG.trim()?{config:aG}:{}})}),b=await a.json();b.success?(aR(b.message||"OpenClaw 配置应用成功","success"),await a_()):aR("应用失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to apply OpenClaw config:",a),aR("应用失败: 网络错误","error")}finally{at(!1)}},ba=async()=>{av(!0);try{let a=await fetch("/api/ide/openclaw/restore",{method:"POST"}),b=await a.json();b.success?(aR("OpenClaw 配置已还原","success"),aP("current"),await a_()):aR("还原失败: "+(b.error||"未知错误"),"error")}catch(a){console.error("Failed to restore OpenClaw config:",a),aR("还原失败: 网络错误","error")}finally{av(!1)}},bb=async()=>{aW.current&&(aW.current.abort(),aW.current=null),aW.current=new AbortController,ax(!0),aB(null);try{let a=await fetch("/api/ide/openclaw/test",{signal:aW.current.signal}),b=await a.json();aB(b),b.success?aR("OpenClaw 配置测试通过","success"):aR("配置验证失败: "+(b.error||b.suggestion||"请检查配置"),"error")}catch(a){"AbortError"===a.name?aR("测试已取消","info"):(aR("测试失败: 网络错误","error"),aB({error:"Network error"}))}finally{aW.current?.signal.aborted===!1&&(aW.current=null),ax(!1)}};return I?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-slate-50/80",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 border-2 border-slate-200 border-t-slate-900 rounded-full animate-spin"}),(0,b.jsx)("div",{className:"text-xs font-medium text-slate-500",children:"加载中..."})]})}):(0,b.jsxs)("div",{className:"min-h-screen bg-slate-50/80",children:[(0,b.jsx)(d.default,{}),(0,b.jsxs)("main",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,b.jsxs)("div",{className:"mb-10",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold text-slate-900 tracking-tight",children:"IDE 配置"}),(0,b.jsx)("span",{className:"px-2.5 py-0.5 text-xs font-medium text-slate-600 bg-slate-100/80 rounded-full border border-slate-200/50",children:"v1.0"})]}),(0,b.jsx)("p",{className:"text-sm text-slate-500",children:"配置 Claude Code、OpenCode 和 OpenClaw 的模型代理设置"})]}),(0,b.jsxs)("div",{className:"bg-white/60 backdrop-blur-md rounded-xl border border-slate-200/50 shadow-sm",children:[(0,b.jsx)("div",{className:"border-b border-slate-200/50 bg-white/40",children:(0,b.jsxs)("nav",{className:"flex gap-1 px-5","aria-label":"Tabs",children:[(0,b.jsxs)("button",{onClick:()=>f("claude"),className:`relative px-4 py-3.5 text-sm font-medium transition-all duration-200 ${"claude"===a?"text-slate-900":"text-slate-400 hover:text-slate-600"}`,children:["Claude Code","claude"===a&&(0,b.jsx)("span",{className:"absolute bottom-0 left-4 right-4 h-[2px] bg-slate-900 rounded-full"})]}),(0,b.jsxs)("button",{onClick:()=>f("opencode"),className:`relative px-4 py-3.5 text-sm font-medium transition-all duration-200 ${"opencode"===a?"text-slate-900":"text-slate-400 hover:text-slate-600"}`,children:["OpenCode","opencode"===a&&(0,b.jsx)("span",{className:"absolute bottom-0 left-4 right-4 h-[2px] bg-slate-900 rounded-full"})]}),(0,b.jsxs)("button",{onClick:()=>f("openclaw"),className:`relative px-4 py-3.5 text-sm font-medium transition-all duration-200 ${"openclaw"===a?"text-slate-900":"text-slate-400 hover:text-slate-600"}`,children:["OpenClaw","openclaw"===a&&(0,b.jsx)("span",{className:"absolute bottom-0 left-4 right-4 h-[2px] bg-slate-900 rounded-full"})]}),(0,b.jsx)("button",{onClick:()=>f("cursor"),disabled:!0,className:"relative px-4 py-3.5 text-sm font-medium text-slate-300 disabled:cursor-not-allowed",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["Cursor",(0,b.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-medium text-slate-400 bg-slate-100/60 rounded-full border border-slate-200/50",children:"即将推出"})]})})]})}),(0,b.jsxs)("div",{className:"p-5 sm:p-6",children:["claude"===a&&(0,b.jsxs)("div",{className:"space-y-6",children:[E&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-3 px-4 bg-white/60 rounded-lg border border-slate-200/50",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${E.applied?"bg-emerald-100 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:E.applied?(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-slate-700",children:E.applied?"已配置":"未配置"}),E.applied&&"aar"===E.routerProvider&&void 0!==E.matchCurrentGateway&&(0,b.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full border ${E.matchCurrentGateway?"bg-emerald-50/80 text-emerald-700 border-emerald-200/60":"bg-amber-50/80 text-amber-700 border-amber-200/60"}`,children:E.matchCurrentGateway?"匹配配置":"不匹配"})]})]}),E.lastUpdated&&(0,b.jsx)("div",{className:"text-[11px] text-slate-400 font-mono",children:new Date(E.lastUpdated).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-[11px] font-medium text-slate-400 mb-5",children:"模型映射"}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[{key:"haiku",label:"Haiku",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),description:"快速响应",value:g,onChange:h},{key:"sonnet",label:"Sonnet",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),description:"平衡性能",value:i,onChange:j},{key:"opus",label:"Opus",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.663 17h4.673M12 3v1m6.364 5.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),description:"深度思考",value:k,onChange:l},{key:"default",label:"默认",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),description:"主要模型",value:m,onChange:n},{key:"reasoning",label:"推理",icon:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 14.9a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 1.414l-5-5A2 2 0 009 10.172V5L8 4z"})}),description:"复杂推理",value:o,onChange:p}].map(a=>(0,b.jsx)("div",{className:"group relative bg-gradient-to-br from-white/50 to-transparent hover:from-slate-50/60 rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:(0,b.jsxs)("label",{htmlFor:a.key,className:"cursor-pointer",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5 relative group/tip",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-slate-100/80 text-slate-600 flex items-center justify-center",children:a.icon}),(0,b.jsx)("div",{className:"flex items-center gap-2.5",children:(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:a.label})}),(0,b.jsx)("div",{className:"absolute left-9 top-0 mt-8 w-28 rounded-lg bg-slate-900/95 backdrop-blur-md px-3 py-2 text-[10px] text-slate-200 shadow-xl opacity-0 invisible group-hover/tip:opacity-100 group-hover/tip:visible transition-all duration-200 z-10",children:a.description})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("select",{id:a.key,value:a.value,onChange:b=>a.onChange(b.target.value),className:"w-full appearance-none rounded-lg border border-slate-200/80 bg-white/90 backdrop-blur-sm px-3 py-2 pr-7 text-[11px] font-medium text-slate-700 shadow-sm transition-all duration-200 hover:border-slate-300/80 hover:bg-white focus:border-slate-400/80 focus:ring-2 focus:ring-slate-200/50 focus:outline-none cursor-pointer",children:Object.entries(G).map(([a,c])=>(0,b.jsx)("optgroup",{label:a,children:c.map(a=>(0,b.jsx)("option",{value:a.model_id,children:a.name},a.id))},a))}),(0,b.jsx)("div",{className:"absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none",children:(0,b.jsx)("svg",{className:"w-3 h-3 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2.5 group-hover:text-slate-600 transition-colors",children:a.description})]})},a.key))})]}),(0,b.jsxs)("div",{className:`grid gap-3 pt-1 ${E?.backupExists?"grid-cols-3":"grid-cols-2"}`,children:[(0,b.jsx)("button",{onClick:a1,disabled:w,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-900 bg-slate-900 text-white hover:bg-slate-800 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:w?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"应用中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),q?"更新配置":"应用配置"]})}),E?.backupExists&&(0,b.jsx)("button",{onClick:a2,disabled:y,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:y?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"还原中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"还原配置"]})}),A?(0,b.jsxs)("button",{onClick:()=>{aU.current&&(aU.current.abort(),aU.current=null)},className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-amber-200/80 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"取消测试"]}):(0,b.jsxs)("button",{onClick:a3,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:bg-slate-50 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"测试配置"]})]}),K&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 ${K.success?"bg-emerald-50/60 border-emerald-200/60":"bg-rose-50/60 border-rose-200/60"}`,children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 ${K.success?"bg-emerald-500":"bg-rose-500"}`,children:K.success?(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})})}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-xs font-medium mb-1",children:K.success?"配置验证成功":"配置验证失败"}),(0,b.jsx)("p",{className:`text-[11px] ${K.success?"text-emerald-700/80":"text-rose-700/80"}`,children:K.success?"Claude Code 可以正常工作":"请检查配置"}),K.checks&&(0,b.jsx)("div",{className:"mt-3 pt-3 border-t border-white/40",children:(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Object.entries(K.checks).map(([a,c])=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[c?(0,b.jsx)("svg",{className:"w-3 h-3 text-emerald-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-rose-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})}),(0,b.jsx)("span",{className:"text-[10px] text-slate-600",children:{hasBaseUrl:"网关",hasApiKey:"API Key",hasHaikuModel:"Haiku",hasSonnetModel:"Sonnet",hasOpusModel:"Opus",hasDefaultModel:"默认模型",hasReasoningModel:"推理模型",isFromAar:"来源"}[a]||a})]},a))})}),K.claudeTest&&(0,b.jsx)("div",{className:"mt-3 pt-3 border-t border-white/40",children:K.claudeTest.success?(0,b.jsxs)("p",{className:"text-[10px] text-emerald-700",children:[K.claudeTest.message,K.claudeTest.output&&(0,b.jsxs)("span",{className:"text-[10px] text-slate-500 ml-1.5",children:["输出: ",K.claudeTest.output]})]}):(0,b.jsx)("p",{className:"text-[10px] text-rose-700 font-mono bg-rose-100/50 px-2 py-1 rounded inline-block",children:K.claudeTest.error})}),K.configSummary&&(0,b.jsxs)("details",{className:"mt-3 group",children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[10px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),"配置详情"]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5 text-[10px]",children:[(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"网关"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:K.configSummary.baseUrl})]}),(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"API Key"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:K.configSummary.apiKey})]}),K.configSummary.routerProvider&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"来源"}),(0,b.jsx)("span",{className:"text-slate-700",children:"aar"===K.configSummary.routerProvider?"当前工具":K.configSummary.routerProvider})]}),"not set"!==K.configSummary.haikuModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Haiku"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:K.configSummary.haikuModel})]}),"not set"!==K.configSummary.sonnetModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1 border-b border-slate-200/40",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Sonnet"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:K.configSummary.sonnetModel})]}),"not set"!==K.configSummary.opusModel&&(0,b.jsxs)("div",{className:"flex justify-between py-1",children:[(0,b.jsx)("span",{className:"text-slate-500",children:"Opus"}),(0,b.jsx)("span",{className:"font-mono text-slate-700",children:K.configSummary.opusModel})]})]})]})]})]})}),(0,b.jsxs)("details",{className:"group",open:!0,children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[11px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1.5 py-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,b.jsx)("span",{children:"配置"})]}),(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsxs)("div",{className:"flex border border-slate-200 rounded-t-lg overflow-hidden bg-slate-100/90",children:[(0,b.jsx)("button",{type:"button",onClick:()=>v("preview"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"preview"===u?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"预览"}),(0,b.jsx)("button",{type:"button",onClick:()=>v("current"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"current"===u?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"生效中"})]}),(0,b.jsx)("div",{className:"relative overflow-hidden rounded-b-lg bg-slate-950 border border-slate-200 border-t-0",children:"preview"===u?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"settings.json(仅当前网关相关,应用时会合并进现有配置)"})]}),(0,b.jsx)("pre",{className:"w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono overflow-auto bg-slate-950 max-h-96 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",children:JSON.stringify({router_provider:"aar",env:{ANTHROPIC_AUTH_TOKEN:E?.currentGatewayApiKey??"your-gateway-api-key",ANTHROPIC_BASE_URL:E?.currentGatewayAddress??"http://localhost:1357",ANTHROPIC_DEFAULT_HAIKU_MODEL:g,ANTHROPIC_DEFAULT_SONNET_MODEL:i,ANTHROPIC_DEFAULT_OPUS_MODEL:k,ANTHROPIC_MODEL:m,ANTHROPIC_REASONING_MODEL:o,API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:1,hasCompletedOnboarding:!0}},null,2)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"settings.json(当前磁盘内容,还原后即更新)"})]}),E?.config!=null?(0,b.jsx)("pre",{className:"w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono overflow-auto bg-slate-950 max-h-96 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",children:JSON.stringify(E.config,null,2)}):(0,b.jsx)("div",{className:"p-3.5 text-[10px] text-slate-500 font-mono",children:"暂无配置文件"})]})})]})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-slate-200/50 bg-slate-50/60 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2.5",children:[(0,b.jsx)("svg",{className:"w-4 h-4 text-slate-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,b.jsx)("h3",{className:"text-xs font-semibold text-slate-700",children:"使用说明"})]}),(0,b.jsxs)("ul",{className:"space-y-1.5 text-[10px] text-slate-600",children:[(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"1."}),(0,b.jsx)("span",{children:"「生效中」为当前磁盘上的 settings.json;「预览」为应用后将写入的内容"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"2."}),(0,b.jsx)("span",{children:"为每个模型类别选择路由模型后,在「预览」中查看,点击「应用配置」或「更新配置」写入"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"3."}),(0,b.jsx)("span",{children:"配置文件位于 ~/.claude/settings.json"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"4."}),(0,b.jsx)("span",{children:"若已应用过 AAR,会显示「更新配置」;有备份时「还原配置」可恢复,还原后请在「生效中」查看"})]})]})]})]}),"opencode"===a&&(0,b.jsxs)("div",{className:"space-y-6",children:[O&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-3 px-4 bg-white/60 rounded-lg border border-slate-200/50",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${O.applied?"bg-emerald-100 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:O.applied?(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-slate-700",children:O.applied?"已配置":"未配置"}),O.applied&&void 0!==O.matchCurrentGateway&&(0,b.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full border ${O.matchCurrentGateway?"bg-emerald-50/80 text-emerald-700 border-emerald-200/60":"bg-amber-50/80 text-amber-700 border-amber-200/60"}`,children:O.matchCurrentGateway?"匹配当前网关":"不匹配"})]})]}),O.lastUpdated&&(0,b.jsx)("div",{className:"text-[11px] text-slate-400 font-mono",children:new Date(O.lastUpdated).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-[11px] font-medium text-slate-400 mb-5",children:"默认模型"}),(0,b.jsx)("div",{className:"group relative bg-gradient-to-br from-white/50 to-transparent hover:from-slate-50/60 rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:(0,b.jsxs)("label",{htmlFor:"opencode-default-model",className:"cursor-pointer",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-slate-100/80 text-slate-600 flex items-center justify-center",children:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})})}),(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:"OpenCode 使用的默认模型"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("select",{id:"opencode-default-model",value:M,onChange:a=>N(a.target.value),className:"w-full appearance-none rounded-lg border border-slate-200/80 bg-white/90 backdrop-blur-sm px-3 py-2 pr-7 text-[11px] font-medium text-slate-700 shadow-sm transition-all duration-200 hover:border-slate-300/80 hover:bg-white focus:border-slate-400/80 focus:ring-2 focus:ring-slate-200/50 focus:outline-none cursor-pointer",children:Object.entries($).map(([a,c])=>(0,b.jsx)("optgroup",{label:a,children:c.map(a=>(0,b.jsx)("option",{value:a.model_id,children:a.name},a.id))},a))}),(0,b.jsx)("div",{className:"absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none",children:(0,b.jsx)("svg",{className:"w-3 h-3 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]})})]}),(0,b.jsxs)("div",{className:`grid gap-3 pt-1 ${a4?"grid-cols-3":"grid-cols-2"}`,children:[(0,b.jsx)("button",{onClick:a5,disabled:Q,className:`w-full px-4 py-2.5 text-xs font-medium rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${a4?"bg-white border-slate-200/80 text-slate-700 hover:border-slate-300 hover:bg-slate-50":"bg-slate-900 border-slate-900 text-white hover:bg-slate-800"}`,children:Q?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"应用中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a4?"更新配置":"应用配置"]})}),a4&&(0,b.jsx)("button",{onClick:a6,disabled:S,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"还原中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"还原配置"]})}),U?(0,b.jsxs)("button",{onClick:()=>{aV.current&&(aV.current.abort(),aV.current=null)},className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-amber-200/80 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"取消测试"]}):(0,b.jsxs)("button",{onClick:a7,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:bg-slate-50 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"测试配置"]})]}),Y&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 ${Y.success?"bg-emerald-50/60 border-emerald-200/60":"bg-rose-50/60 border-rose-200/60"}`,children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 ${Y.success?"bg-emerald-500":"bg-rose-500"}`,children:Y.success?(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})})}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-xs font-medium mb-1",children:Y.success?"配置验证成功":"配置验证失败"}),(0,b.jsx)("p",{className:`text-[11px] ${Y.success?"text-emerald-700/80":"text-rose-700/80"}`,children:Y.success?Y.opencodeTest?.message||"OpenCode 可以正常工作":Y.opencodeTest?.error||Y.error||Y.suggestion||"请检查配置"}),Y.checks&&(0,b.jsx)("div",{className:"mt-3 pt-3 border-t border-white/40",children:(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Object.entries(Y.checks).map(([a,c])=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[c?(0,b.jsx)("svg",{className:"w-3 h-3 text-emerald-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-rose-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})}),(0,b.jsx)("span",{className:"text-[10px] text-slate-600",children:{hasBaseUrl:"网关",hasApiKey:"API Key",hasDefaultModel:"默认模型",hasModels:"模型列表"}[a]||a})]},a))})})]})]})}),(0,b.jsxs)("details",{className:"group",open:!0,children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[11px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1.5 py-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,b.jsx)("span",{children:"配置"})]}),(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsxs)("div",{className:"flex border border-slate-200 rounded-t-lg overflow-hidden bg-slate-100/90",children:[(0,b.jsx)("button",{type:"button",onClick:()=>ah("preview"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"preview"===ag?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"预览"}),(0,b.jsx)("button",{type:"button",onClick:()=>ah("current"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"current"===ag?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"生效中"})]}),(0,b.jsx)("div",{className:"relative overflow-hidden rounded-b-lg bg-slate-950 border border-slate-200 border-t-0",children:"current"===ag?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"opencode.json(当前磁盘内容,还原后即更新)"})]}),O?.config!=null?(0,b.jsx)("pre",{className:"w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono overflow-auto max-h-96 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",children:JSON.stringify(O.config,null,2)}):(0,b.jsx)("div",{className:"p-3.5 text-[10px] text-slate-500 font-mono",children:"暂无配置文件"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"opencode.json(应用后将写入的合并结果)"})]}),ae?(0,b.jsx)("div",{className:"p-3.5 text-[10px] text-slate-400 font-mono",children:"加载中..."}):(0,b.jsx)("textarea",{className:"opencode-preview-textarea w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono bg-slate-950 border-0 focus:ring-0 focus:ring-offset-0 focus:outline-none resize-y max-h-96 overflow-y-auto placeholder:text-slate-500 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",placeholder:"暂无预览",spellCheck:!1,value:ac,onChange:a=>ad(a.target.value)})]})})]})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-slate-200/50 bg-slate-50/60 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2.5",children:[(0,b.jsx)("svg",{className:"w-4 h-4 text-slate-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,b.jsx)("h3",{className:"text-xs font-semibold text-slate-700",children:"使用说明"})]}),(0,b.jsxs)("ul",{className:"space-y-1.5 text-[10px] text-slate-600",children:[(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"1."}),(0,b.jsx)("span",{children:"「生效中」为当前磁盘上的 opencode.json;「预览」为点击应用后将写入的合并结果(含 AAR 网关)"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"2."}),(0,b.jsx)("span",{children:"选择默认模型后,在「预览」中查看合并结果,点击「应用配置」写入"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"3."}),(0,b.jsx)("span",{children:"配置文件位于 ~/.config/opencode/opencode.json(或 Windows %APPDATA%/opencode)"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"4."}),(0,b.jsx)("span",{children:"「还原配置」恢复为应用前的备份;还原后请在「生效中」查看当前内容"})]})]})]})]}),"openclaw"===a&&(0,b.jsxs)("div",{className:"space-y-6",children:[aq&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-3 px-4 bg-white/60 rounded-lg border border-slate-200/50",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${aq.applied?"bg-emerald-100 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:aq.applied?(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-slate-700",children:aq.applied?"已配置":"未配置"}),aq.applied&&void 0!==aq.matchCurrentGateway&&(0,b.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 text-[10px] font-medium rounded-full border ${aq.matchCurrentGateway?"bg-emerald-50/80 text-emerald-700 border-emerald-200/60":"bg-amber-50/80 text-amber-700 border-amber-200/60"}`,children:aq.matchCurrentGateway?"匹配当前网关":"不匹配"})]})]}),aq.lastUpdated&&(0,b.jsx)("div",{className:"text-[11px] text-slate-400 font-mono",children:new Date(aq.lastUpdated).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",ref:aQ,children:[(0,b.jsxs)("div",{className:"bg-gradient-to-br from-white/50 to-transparent rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-indigo-100/80 text-indigo-600 flex items-center justify-center",children:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})})}),(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:"默认模型"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{aN(""),aL("default"===aK?null:"default")},className:"w-full text-left appearance-none rounded-lg border border-slate-200/80 bg-white/90 px-3 py-2 pr-8 text-[11px] font-medium text-slate-700 shadow-sm focus:border-indigo-400 focus:ring-2 focus:ring-indigo-200/50 focus:outline-none cursor-pointer flex items-center justify-between",children:[(0,b.jsx)("span",{className:"truncate",children:aS.find(a=>a.model_id===ai)?.name||ai||"选择模型"}),(0,b.jsx)("svg",{className:"w-3 h-3 text-slate-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),"default"===aK&&(0,b.jsxs)("div",{className:"absolute z-20 mt-1 w-full rounded-lg border border-slate-200 bg-white shadow-lg py-1 max-h-56 overflow-hidden flex flex-col",children:[(0,b.jsx)("input",{type:"text",placeholder:"搜索模型...",value:aM,onChange:a=>aN(a.target.value),onKeyDown:a=>a.stopPropagation(),className:"mx-2 mb-1 px-2 py-1.5 text-[11px] border border-slate-200 rounded-md focus:ring-2 focus:ring-indigo-200 focus:border-indigo-400 focus:outline-none"}),(0,b.jsx)("ul",{className:"overflow-y-auto overscroll-contain max-h-44",children:aT.map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>{aj(a.model_id),aL(null),aN("")},className:`w-full text-left px-3 py-2 text-[11px] hover:bg-indigo-50 ${a.model_id===ai?"bg-indigo-100 text-indigo-700 font-medium":"text-slate-700"}`,children:[a.name,(0,b.jsxs)("span",{className:"text-slate-400 ml-1",children:["(",a.provider,")"]})]})},a.id))})]})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2",children:"主要使用的模型"})]}),(0,b.jsxs)("div",{className:"bg-gradient-to-br from-white/50 to-transparent rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-amber-100/80 text-amber-600 flex items-center justify-center",children:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:"默认 Fallback"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"min-h-[38px] rounded-lg border border-slate-200/80 bg-white/90 px-3 py-2 flex flex-wrap gap-1.5 items-center",children:0===ak.length?(0,b.jsx)("span",{className:"text-[11px] text-slate-400",children:"从下方搜索并添加备用模型"}):ak.map(a=>{let c=aS.find(b=>b.model_id===a);return(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-amber-100 text-amber-800 text-[10px] font-medium",children:[c?.name||a,(0,b.jsx)("button",{type:"button",onClick:()=>al(b=>b.filter(b=>b!==a)),className:"hover:bg-amber-200 rounded p-0.5","aria-label":"移除",children:(0,b.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},a)})}),(0,b.jsx)("button",{type:"button",onClick:()=>{aN(""),aL("defaultFallbacks"===aK?null:"defaultFallbacks")},className:"mt-1.5 w-full text-left px-3 py-1.5 text-[11px] text-slate-500 border border-dashed border-slate-200 rounded-md hover:border-amber-300 hover:text-amber-700 hover:bg-amber-50/50",children:"+ 搜索并添加 Fallback 模型"}),"defaultFallbacks"===aK&&(0,b.jsxs)("div",{className:"absolute z-20 mt-1 w-full rounded-lg border border-slate-200 bg-white shadow-lg py-1 max-h-56 overflow-hidden flex flex-col",children:[(0,b.jsx)("input",{type:"text",placeholder:"搜索模型...",value:aM,onChange:a=>aN(a.target.value),onKeyDown:a=>a.stopPropagation(),className:"mx-2 mb-1 px-2 py-1.5 text-[11px] border border-slate-200 rounded-md focus:ring-2 focus:ring-amber-200 focus:border-amber-400 focus:outline-none"}),(0,b.jsxs)("ul",{className:"overflow-y-auto overscroll-contain max-h-44",children:[aT.filter(a=>!ak.includes(a.model_id)).map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>{al(b=>b.includes(a.model_id)?b:[...b,a.model_id]),aN("")},className:"w-full text-left px-3 py-2 text-[11px] text-slate-700 hover:bg-amber-50",children:[a.name,(0,b.jsxs)("span",{className:"text-slate-400 ml-1",children:["(",a.provider,")"]})]})},a.id)),0===aT.filter(a=>!ak.includes(a.model_id)).length&&(0,b.jsx)("li",{className:"px-3 py-2 text-[11px] text-slate-400",children:"无更多可选或已全部添加"})]})]})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2",children:"默认模型的备用模型,可多选,不可重复"})]}),(0,b.jsxs)("div",{className:"bg-gradient-to-br from-white/50 to-transparent rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-rose-100/80 text-rose-600 flex items-center justify-center",children:(0,b.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:"视觉模型"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{aN(""),aL("image"===aK?null:"image")},className:"w-full text-left appearance-none rounded-lg border border-slate-200/80 bg-white/90 px-3 py-2 pr-8 text-[11px] font-medium text-slate-700 shadow-sm focus:border-rose-400 focus:ring-2 focus:ring-rose-200/50 focus:outline-none cursor-pointer flex items-center justify-between",children:[(0,b.jsx)("span",{className:"truncate",children:am?aS.find(a=>a.model_id===am)?.name||am:"未设置"}),(0,b.jsx)("svg",{className:"w-3 h-3 text-slate-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),"image"===aK&&(0,b.jsxs)("div",{className:"absolute z-20 mt-1 w-full rounded-lg border border-slate-200 bg-white shadow-lg py-1 max-h-56 overflow-hidden flex flex-col",children:[(0,b.jsx)("input",{type:"text",placeholder:"搜索模型...",value:aM,onChange:a=>aN(a.target.value),onKeyDown:a=>a.stopPropagation(),className:"mx-2 mb-1 px-2 py-1.5 text-[11px] border border-slate-200 rounded-md focus:ring-2 focus:ring-rose-200 focus:border-rose-400 focus:outline-none"}),(0,b.jsxs)("ul",{className:"overflow-y-auto overscroll-contain max-h-44",children:[(0,b.jsx)("li",{children:(0,b.jsx)("button",{type:"button",onClick:()=>{an(""),aL(null),aN("")},className:`w-full text-left px-3 py-2 text-[11px] hover:bg-rose-50 ${!am?"bg-rose-100 text-rose-700 font-medium":"text-slate-500"}`,children:"未设置"})}),aT.map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>{an(a.model_id),aL(null),aN("")},className:`w-full text-left px-3 py-2 text-[11px] hover:bg-rose-50 ${a.model_id===am?"bg-rose-100 text-rose-700 font-medium":"text-slate-700"}`,children:[a.name,(0,b.jsxs)("span",{className:"text-slate-400 ml-1",children:["(",a.provider,")"]})]})},a.id))]})]})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2",children:"用于图像理解(可选)"})]}),(0,b.jsxs)("div",{className:"bg-gradient-to-br from-white/50 to-transparent rounded-xl border border-slate-200/50 p-4 transition-all duration-300 hover:border-slate-300/60 hover:shadow-sm",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 mb-2.5",children:[(0,b.jsx)("div",{className:"w-7 h-7 rounded-lg bg-emerald-100/80 text-emerald-600 flex items-center justify-center",children:(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,b.jsx)("span",{className:"text-[11px] font-medium text-slate-700",children:"视觉 Fallback"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"min-h-[38px] rounded-lg border border-slate-200/80 bg-white/90 px-3 py-2 flex flex-wrap gap-1.5 items-center",children:0===ao.length?(0,b.jsx)("span",{className:"text-[11px] text-slate-400",children:"从下方搜索并添加备用模型"}):ao.map(a=>{let c=aS.find(b=>b.model_id===a);return(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-emerald-100 text-emerald-800 text-[10px] font-medium",children:[c?.name||a,(0,b.jsx)("button",{type:"button",onClick:()=>ap(b=>b.filter(b=>b!==a)),className:"hover:bg-emerald-200 rounded p-0.5","aria-label":"移除",children:(0,b.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},a)})}),(0,b.jsx)("button",{type:"button",onClick:()=>{aN(""),aL("imageFallbacks"===aK?null:"imageFallbacks")},className:"mt-1.5 w-full text-left px-3 py-1.5 text-[11px] text-slate-500 border border-dashed border-slate-200 rounded-md hover:border-emerald-300 hover:text-emerald-700 hover:bg-emerald-50/50",children:"+ 搜索并添加 Fallback 模型"}),"imageFallbacks"===aK&&(0,b.jsxs)("div",{className:"absolute z-20 mt-1 w-full rounded-lg border border-slate-200 bg-white shadow-lg py-1 max-h-56 overflow-hidden flex flex-col",children:[(0,b.jsx)("input",{type:"text",placeholder:"搜索模型...",value:aM,onChange:a=>aN(a.target.value),onKeyDown:a=>a.stopPropagation(),className:"mx-2 mb-1 px-2 py-1.5 text-[11px] border border-slate-200 rounded-md focus:ring-2 focus:ring-emerald-200 focus:border-emerald-400 focus:outline-none"}),(0,b.jsxs)("ul",{className:"overflow-y-auto overscroll-contain max-h-44",children:[aT.filter(a=>!ao.includes(a.model_id)).map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>{ap(b=>b.includes(a.model_id)?b:[...b,a.model_id]),aN("")},className:"w-full text-left px-3 py-2 text-[11px] text-slate-700 hover:bg-emerald-50",children:[a.name,(0,b.jsxs)("span",{className:"text-slate-400 ml-1",children:["(",a.provider,")"]})]})},a.id)),0===aT.filter(a=>!ao.includes(a.model_id)).length&&(0,b.jsx)("li",{className:"px-3 py-2 text-[11px] text-slate-400",children:"无更多可选或已全部添加"})]})]})]}),(0,b.jsx)("p",{className:"text-[10px] text-slate-500 mt-2",children:"视觉模型的备用模型,可多选,不可重复"})]})]}),(0,b.jsxs)("div",{className:`grid gap-3 pt-1 ${a8?"grid-cols-3":"grid-cols-2"}`,children:[(0,b.jsx)("button",{onClick:a9,disabled:as,className:`w-full px-4 py-2.5 text-xs font-medium rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${a8?"bg-white border-slate-200/80 text-slate-700 hover:border-slate-300 hover:bg-slate-50":"bg-slate-900 border-slate-900 text-white hover:bg-slate-800"}`,children:as?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"应用中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a8?"更新配置":"应用配置"]})}),a8&&(0,b.jsx)("button",{onClick:ba,disabled:au,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:au?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"还原中"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"还原配置"]})}),aw?(0,b.jsxs)("button",{onClick:()=>{aW.current&&(aW.current.abort(),aW.current=null)},className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-amber-200/80 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsxs)("svg",{className:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"取消测试"]}):(0,b.jsxs)("button",{onClick:bb,className:"w-full px-4 py-2.5 text-xs font-medium rounded-lg border border-slate-200/80 bg-white text-slate-700 hover:bg-slate-50 transition-all duration-200 flex items-center justify-center gap-2",children:[(0,b.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"测试配置"]})]}),aA&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 ${aA.success?"bg-emerald-50/60 border-emerald-200/60":"bg-rose-50/60 border-rose-200/60"}`,children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 ${aA.success?"bg-emerald-500":"bg-rose-500"}`,children:aA.success?(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}):(0,b.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})})}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-xs font-medium mb-1",children:aA.success?"配置验证成功":"配置验证失败"}),(0,b.jsx)("p",{className:`text-[11px] ${aA.success?"text-emerald-700/80":"text-rose-700/80"}`,children:aA.success?aA.openclawTest?.message||"OpenClaw 可以正常工作":aA.openclawTest?.error||aA.error||aA.suggestion||"请检查配置"}),aA.openclawTest?.stdout&&(0,b.jsx)("div",{className:"mt-2 text-[10px] text-slate-500 font-mono bg-white/50 p-2 rounded",children:aA.openclawTest.stdout})]})]})}),(0,b.jsxs)("details",{className:"group",open:!0,children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-[11px] text-slate-500 hover:text-slate-700 list-none flex items-center gap-1.5 py-1",children:[(0,b.jsx)("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,b.jsx)("span",{children:"配置"})]}),(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsxs)("div",{className:"flex border border-slate-200 rounded-t-lg overflow-hidden bg-slate-100/90",children:[(0,b.jsx)("button",{type:"button",onClick:()=>aP("preview"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"preview"===aO?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"预览"}),(0,b.jsx)("button",{type:"button",onClick:()=>aP("current"),className:`flex-1 px-4 py-2.5 text-[11px] transition-all ${"current"===aO?"bg-white text-slate-800 font-semibold shadow-sm":"text-slate-500 font-medium hover:bg-slate-200/80 hover:text-slate-600"}`,children:"生效中"})]}),(0,b.jsx)("div",{className:"relative overflow-hidden rounded-b-lg bg-slate-950 border border-slate-200 border-t-0",children:"preview"===aO?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"openclaw.json(应用后将写入的合并结果)"})]}),aI?(0,b.jsx)("div",{className:"p-3.5 text-[10px] text-slate-400 font-mono",children:"加载中..."}):(0,b.jsx)("textarea",{className:"openclaw-preview-textarea w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono bg-slate-950 border-0 focus:ring-0 focus:ring-offset-0 focus:outline-none resize-y max-h-96 overflow-y-auto placeholder:text-slate-500 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",placeholder:"暂无预览",spellCheck:!1,value:aG,onChange:a=>aH(a.target.value)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-slate-900 border-b border-slate-800",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"}),(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-slate-600"})]}),(0,b.jsx)("span",{className:"text-[10px] font-medium text-slate-400 ml-2",children:"openclaw.json(当前磁盘内容,还原后即更新)"})]}),aq?.config!=null?(0,b.jsx)("pre",{className:"w-full min-h-[12rem] p-3.5 text-[10px] text-slate-300 font-mono overflow-auto max-h-96 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-900 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full",children:JSON.stringify(aq.config,null,2)}):(0,b.jsx)("div",{className:"p-3.5 text-[10px] text-slate-500 font-mono",children:"暂无配置文件"})]})})]})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-slate-200/50 bg-slate-50/60 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2.5",children:[(0,b.jsx)("svg",{className:"w-4 h-4 text-slate-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,b.jsx)("h3",{className:"text-xs font-semibold text-slate-700",children:"使用说明"})]}),(0,b.jsxs)("ul",{className:"space-y-1.5 text-[10px] text-slate-600",children:[(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"1."}),(0,b.jsx)("span",{children:"「生效中」为当前磁盘上的 openclaw.json;「预览」为应用后将写入的合并结果(含 AAR 网关)"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"2."}),(0,b.jsx)("span",{children:"选择默认模型等后,在「预览」中查看合并结果,点击「应用配置」写入"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"3."}),(0,b.jsx)("span",{children:"配置文件位于 ~/.openclaw/openclaw.json"})]}),(0,b.jsxs)("li",{className:"flex gap-2",children:[(0,b.jsx)("span",{className:"text-slate-400",children:"4."}),(0,b.jsx)("span",{children:"「还原配置」恢复为应用前的备份;还原后请在「生效中」查看当前内容"})]})]})]})]}),"cursor"===a&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)("div",{className:"w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mb-4",children:(0,b.jsx)("svg",{className:"w-8 h-8 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),(0,b.jsx)("h3",{className:"text-sm font-medium text-slate-900 mb-1",children:"Cursor 支持即将推出"}),(0,b.jsx)("p",{className:"text-xs text-slate-500 max-w-xs",children:"我们将很快添加对 Cursor 编辑器的支持,敬请期待。"})]})]})]})]})]})}a.s(["default",()=>f])}];
2
2
 
3
3
  //# sourceMappingURL=src_app_ide_page_tsx_8962793b._.js.map