constellai 0.3.1 → 0.3.2

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 (237) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/react-loadable-manifest.json +2 -2
  5. package/.next/server/app/(app)/activity/page.js +1 -1
  6. package/.next/server/app/(app)/activity/page.js.nft.json +1 -1
  7. package/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/(app)/agents/[handle]/page.js +2 -2
  9. package/.next/server/app/(app)/agents/[handle]/page.js.nft.json +1 -1
  10. package/.next/server/app/(app)/agents/[handle]/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/(app)/code/page.js +2 -2
  12. package/.next/server/app/(app)/code/page.js.nft.json +1 -1
  13. package/.next/server/app/(app)/code/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/(app)/config/page.js +2 -2
  15. package/.next/server/app/(app)/config/page.js.nft.json +1 -1
  16. package/.next/server/app/(app)/config/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/(app)/costs/page.js +2 -2
  18. package/.next/server/app/(app)/costs/page.js.nft.json +1 -1
  19. package/.next/server/app/(app)/costs/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/(app)/cron/page.js +2 -2
  21. package/.next/server/app/(app)/cron/page.js.nft.json +1 -1
  22. package/.next/server/app/(app)/cron/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/(app)/dashboard/page.js +2 -2
  24. package/.next/server/app/(app)/dashboard/page.js.nft.json +1 -1
  25. package/.next/server/app/(app)/dashboard/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/(app)/design/page.js +13 -13
  27. package/.next/server/app/(app)/design/page.js.nft.json +1 -1
  28. package/.next/server/app/(app)/design/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/(app)/docs/[id]/page.js +2 -2
  30. package/.next/server/app/(app)/docs/[id]/page.js.nft.json +1 -1
  31. package/.next/server/app/(app)/docs/[id]/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/(app)/docs/page.js +2 -2
  33. package/.next/server/app/(app)/docs/page.js.nft.json +1 -1
  34. package/.next/server/app/(app)/docs/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/(app)/github/page.js +2 -2
  36. package/.next/server/app/(app)/github/page.js.nft.json +1 -1
  37. package/.next/server/app/(app)/github/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/(app)/goals/page.js +2 -2
  39. package/.next/server/app/(app)/goals/page.js.nft.json +1 -1
  40. package/.next/server/app/(app)/goals/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/(app)/inbox/page.js +2 -2
  42. package/.next/server/app/(app)/inbox/page.js.nft.json +1 -1
  43. package/.next/server/app/(app)/inbox/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/(app)/knowledge/page.js +3 -3
  45. package/.next/server/app/(app)/knowledge/page.js.nft.json +1 -1
  46. package/.next/server/app/(app)/knowledge/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/(app)/models/page.js +2 -2
  48. package/.next/server/app/(app)/models/page.js.nft.json +1 -1
  49. package/.next/server/app/(app)/models/page_client-reference-manifest.js +1 -1
  50. package/.next/server/app/(app)/notifications/page.js +2 -2
  51. package/.next/server/app/(app)/notifications/page.js.nft.json +1 -1
  52. package/.next/server/app/(app)/notifications/page_client-reference-manifest.js +1 -1
  53. package/.next/server/app/(app)/org/page.js +3 -3
  54. package/.next/server/app/(app)/org/page.js.nft.json +1 -1
  55. package/.next/server/app/(app)/org/page_client-reference-manifest.js +1 -1
  56. package/.next/server/app/(app)/organizations/page.js +2 -2
  57. package/.next/server/app/(app)/organizations/page.js.nft.json +1 -1
  58. package/.next/server/app/(app)/organizations/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/(app)/page.js +3 -3
  60. package/.next/server/app/(app)/page.js.nft.json +1 -1
  61. package/.next/server/app/(app)/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/(app)/planner/page.js +2 -2
  63. package/.next/server/app/(app)/planner/page.js.nft.json +1 -1
  64. package/.next/server/app/(app)/planner/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/(app)/plugins/page.js +2 -2
  66. package/.next/server/app/(app)/plugins/page.js.nft.json +1 -1
  67. package/.next/server/app/(app)/plugins/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/(app)/pm/page.js +2 -2
  69. package/.next/server/app/(app)/pm/page.js.nft.json +1 -1
  70. package/.next/server/app/(app)/pm/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/(app)/prepare-deploy/page.js +2 -2
  72. package/.next/server/app/(app)/prepare-deploy/page.js.nft.json +1 -1
  73. package/.next/server/app/(app)/prepare-deploy/page_client-reference-manifest.js +1 -1
  74. package/.next/server/app/(app)/profile/page.js +2 -2
  75. package/.next/server/app/(app)/profile/page.js.nft.json +1 -1
  76. package/.next/server/app/(app)/profile/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/(app)/pulse/page.js +2 -2
  78. package/.next/server/app/(app)/pulse/page.js.nft.json +1 -1
  79. package/.next/server/app/(app)/pulse/page_client-reference-manifest.js +1 -1
  80. package/.next/server/app/(app)/reports/[id]/page.js +2 -2
  81. package/.next/server/app/(app)/reports/[id]/page.js.nft.json +1 -1
  82. package/.next/server/app/(app)/reports/[id]/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/(app)/reports/page.js +3 -3
  84. package/.next/server/app/(app)/reports/page.js.nft.json +1 -1
  85. package/.next/server/app/(app)/reports/page_client-reference-manifest.js +1 -1
  86. package/.next/server/app/(app)/routines/page.js +2 -2
  87. package/.next/server/app/(app)/routines/page.js.nft.json +1 -1
  88. package/.next/server/app/(app)/routines/page_client-reference-manifest.js +1 -1
  89. package/.next/server/app/(app)/search/page.js +2 -2
  90. package/.next/server/app/(app)/search/page.js.nft.json +1 -1
  91. package/.next/server/app/(app)/search/page_client-reference-manifest.js +1 -1
  92. package/.next/server/app/(app)/security/page.js +2 -2
  93. package/.next/server/app/(app)/security/page.js.nft.json +1 -1
  94. package/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -1
  95. package/.next/server/app/(app)/skills/page.js +2 -2
  96. package/.next/server/app/(app)/skills/page.js.nft.json +1 -1
  97. package/.next/server/app/(app)/skills/page_client-reference-manifest.js +1 -1
  98. package/.next/server/app/(app)/tasks/page.js +2 -2
  99. package/.next/server/app/(app)/tasks/page.js.nft.json +1 -1
  100. package/.next/server/app/(app)/tasks/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/(app)/test-dev/page.js +2 -2
  102. package/.next/server/app/(app)/test-dev/page.js.nft.json +1 -1
  103. package/.next/server/app/(app)/test-dev/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/(app)/update/page.js +2 -2
  105. package/.next/server/app/(app)/update/page.js.nft.json +1 -1
  106. package/.next/server/app/(app)/update/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/(auth)/login/page.js +2 -2
  108. package/.next/server/app/(auth)/login/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/(auth)/onboarding/page.js +1 -1
  110. package/.next/server/app/(auth)/onboarding/page_client-reference-manifest.js +1 -1
  111. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/_global-error.html +1 -1
  113. package/.next/server/app/_global-error.rsc +1 -1
  114. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  115. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  116. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  117. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  118. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  119. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  120. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/cron/tick/route.js +2 -2
  122. package/.next/server/app/api/sync/file/route.js +2 -2
  123. package/.next/server/app/api/telegram/poll/route.js +2 -2
  124. package/.next/server/app/api/v1/[[...path]]/route.js +1 -1
  125. package/.next/server/chunks/104.js +1 -0
  126. package/.next/server/chunks/1082.js +1 -0
  127. package/.next/server/chunks/1249.js +3 -3
  128. package/.next/server/chunks/2359.js +1 -0
  129. package/.next/server/chunks/259.js +1 -1
  130. package/.next/server/chunks/2867.js +1 -1
  131. package/.next/server/chunks/2960.js +1 -1
  132. package/.next/server/chunks/{6606.js → 3078.js} +13 -13
  133. package/.next/server/chunks/3234.js +1 -1
  134. package/.next/server/chunks/4979.js +2 -2
  135. package/.next/server/chunks/6431.js +1 -1
  136. package/.next/server/chunks/7589.js +1 -1
  137. package/.next/server/chunks/7970.js +21 -0
  138. package/.next/server/chunks/7989.js +1 -1
  139. package/.next/server/chunks/{5097.js → 8071.js} +2 -2
  140. package/.next/server/chunks/{8544.js → 8102.js} +2 -2
  141. package/.next/server/chunks/8561.js +1 -1
  142. package/.next/server/chunks/8823.js +1 -1
  143. package/.next/server/chunks/9783.js +1 -1
  144. package/.next/server/middleware-build-manifest.js +1 -1
  145. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  146. package/.next/server/pages/500.html +1 -1
  147. package/.next/server/server-reference-manifest.js +1 -1
  148. package/.next/server/server-reference-manifest.json +1 -1
  149. package/.next/static/chunks/1068-50497be19315ccfb.js +1 -0
  150. package/.next/static/chunks/4991-0306ad0e6cd8cb8a.js +1 -0
  151. package/.next/static/chunks/6061-f3ad54a48323cba0.js +1 -0
  152. package/.next/static/chunks/6121-37930472292e5a6c.js +4 -0
  153. package/.next/static/chunks/{7509.721cd47a931c5518.js → 7509.8d3cbebb5fbe6247.js} +1 -1
  154. package/.next/static/chunks/{8370-4306eb227fde422e.js → 8370-4a29b1affcb7dc68.js} +2 -2
  155. package/.next/static/chunks/app/(app)/activity/{page-b4f7b6850a427aa9.js → page-02fbf7cf46282feb.js} +1 -1
  156. package/.next/static/chunks/app/(app)/agents/[handle]/page-e3eda42a3f20e3e5.js +1 -0
  157. package/.next/static/chunks/app/(app)/code/page-8f8ae22136752631.js +1 -0
  158. package/.next/static/chunks/app/(app)/config/page-84216e49b0b08248.js +1 -0
  159. package/.next/static/chunks/app/(app)/costs/page-aadb60fb329974f3.js +1 -0
  160. package/.next/static/chunks/app/(app)/cron/{page-23924d673b353117.js → page-0219c7a0530ad628.js} +1 -1
  161. package/.next/static/chunks/app/(app)/dashboard/{page-325f833279658e69.js → page-1e7ecb2bdefcdc19.js} +1 -1
  162. package/.next/static/chunks/app/(app)/design/{page-410e5f6f08882c19.js → page-f889489d70e0e839.js} +3 -3
  163. package/.next/static/chunks/app/(app)/docs/[id]/page-f2e1f3d72634fb4b.js +1 -0
  164. package/.next/static/chunks/app/(app)/docs/page-ab10f655b932f175.js +1 -0
  165. package/.next/static/chunks/app/(app)/github/{page-9617cd18258e00da.js → page-0e47c2c1c9c927e4.js} +1 -1
  166. package/.next/static/chunks/app/(app)/goals/page-9a68e61bbc392281.js +1 -0
  167. package/.next/static/chunks/app/(app)/inbox/{page-57759eb7889a5aa6.js → page-6ee42cdd99664d11.js} +2 -2
  168. package/.next/static/chunks/app/(app)/knowledge/page-c02936180f61550f.js +1 -0
  169. package/.next/static/chunks/app/(app)/{layout-f5678dc87a3ce366.js → layout-7d2d377b224620c8.js} +1 -1
  170. package/.next/static/chunks/app/(app)/models/page-8635495017d696c1.js +1 -0
  171. package/.next/static/chunks/app/(app)/notifications/page-72f15bd4b6289bf1.js +12 -0
  172. package/.next/static/chunks/app/(app)/org/page-30bb71b216cc152e.js +12 -0
  173. package/.next/static/chunks/app/(app)/organizations/page-50c64b60a6850870.js +1 -0
  174. package/.next/static/chunks/app/(app)/page-638517264806ba7e.js +1 -0
  175. package/.next/static/chunks/app/(app)/planner/{page-7c5448444950f6e0.js → page-5177b5fd72d529f4.js} +1 -1
  176. package/.next/static/chunks/app/(app)/plugins/page-66921b5b398f2c05.js +1 -0
  177. package/.next/static/chunks/app/(app)/pm/page-a1f93d19d3c28627.js +1 -0
  178. package/.next/static/chunks/app/(app)/prepare-deploy/page-de7dc9413e3dbf82.js +1 -0
  179. package/.next/static/chunks/app/(app)/profile/page-e73d191fce633cd7.js +1 -0
  180. package/.next/static/chunks/app/(app)/pulse/{page-dd0db1606004d1cd.js → page-a0895a89c74c1d4c.js} +1 -1
  181. package/.next/static/chunks/app/(app)/reports/[id]/{page-23924d673b353117.js → page-0219c7a0530ad628.js} +1 -1
  182. package/.next/static/chunks/app/(app)/reports/page-fd0b0d0fa742819e.js +1 -0
  183. package/.next/static/chunks/app/(app)/routines/page-eaba9756a33d98a6.js +1 -0
  184. package/.next/static/chunks/app/(app)/search/{page-71d3db75f945ae4d.js → page-d975712d07eed70d.js} +1 -1
  185. package/.next/static/chunks/app/(app)/security/page-4b126307f9963c2a.js +1 -0
  186. package/.next/static/chunks/app/(app)/skills/page-f1fc99f1d15e26a4.js +1 -0
  187. package/.next/static/chunks/app/(app)/tasks/page-a4b78a8d76fd9432.js +1 -0
  188. package/.next/static/chunks/app/(app)/test-dev/page-55cef74633b3cf4c.js +1 -0
  189. package/.next/static/chunks/app/(app)/update/{page-711cca7457171762.js → page-92764fc98b253709.js} +1 -1
  190. package/.next/static/chunks/app/(auth)/login/page-3df648bab2319a0b.js +1 -0
  191. package/.next/static/chunks/app/(auth)/onboarding/{page-fccc9edc6c250f2f.js → page-ee09eb3fd38f3365.js} +1 -1
  192. package/.next/static/chunks/{main-722e16032e7764d1.js → main-2e2f6e1d0f3b78b1.js} +1 -1
  193. package/.next/static/chunks/webpack-94c9726ec79ee4b4.js +1 -0
  194. package/.next/trace-build +1 -1
  195. package/CHANGELOG.md +19 -3
  196. package/README.md +1 -1
  197. package/README.pt-BR.md +1 -1
  198. package/docs/UPDATE.md +1 -1
  199. package/docs/en/TROUBLESHOOTING.md +1 -0
  200. package/docs/pt/TROUBLESHOOTING.md +1 -0
  201. package/package.json +1 -1
  202. package/scripts/vps-install.sh +8 -0
  203. package/.next/server/chunks/2873.js +0 -1
  204. package/.next/server/chunks/3076.js +0 -1
  205. package/.next/server/chunks/467.js +0 -21
  206. package/.next/server/chunks/896.js +0 -1
  207. package/.next/static/chunks/2458-a02b9ba3fbf5a4aa.js +0 -1
  208. package/.next/static/chunks/3448-3ebb2581741d6552.js +0 -1
  209. package/.next/static/chunks/8959-2456e03da35f9879.js +0 -1
  210. package/.next/static/chunks/9512-a0f7aae0722248da.js +0 -4
  211. package/.next/static/chunks/app/(app)/agents/[handle]/page-8f3582f06b659fbd.js +0 -1
  212. package/.next/static/chunks/app/(app)/code/page-629706b6872eb74c.js +0 -1
  213. package/.next/static/chunks/app/(app)/config/page-502173fb21b78d88.js +0 -1
  214. package/.next/static/chunks/app/(app)/costs/page-60c884ab3d917cba.js +0 -1
  215. package/.next/static/chunks/app/(app)/docs/[id]/page-d8ef563c662c9c34.js +0 -1
  216. package/.next/static/chunks/app/(app)/docs/page-8cd228461c719430.js +0 -1
  217. package/.next/static/chunks/app/(app)/goals/page-e2a13b8a62db3a6c.js +0 -1
  218. package/.next/static/chunks/app/(app)/knowledge/page-1e7da0e09c954bb7.js +0 -1
  219. package/.next/static/chunks/app/(app)/models/page-6e3a57c08eca441a.js +0 -1
  220. package/.next/static/chunks/app/(app)/notifications/page-cbb438455126086b.js +0 -12
  221. package/.next/static/chunks/app/(app)/org/page-e8831367a1382eb3.js +0 -12
  222. package/.next/static/chunks/app/(app)/organizations/page-e41ed5fba9cbb700.js +0 -1
  223. package/.next/static/chunks/app/(app)/page-2c4c2724bd2b99b7.js +0 -1
  224. package/.next/static/chunks/app/(app)/plugins/page-2ffa3fd55dbbb32d.js +0 -1
  225. package/.next/static/chunks/app/(app)/pm/page-ed5ceba076b889f8.js +0 -1
  226. package/.next/static/chunks/app/(app)/prepare-deploy/page-a6ed9a2756c5ed5e.js +0 -1
  227. package/.next/static/chunks/app/(app)/profile/page-43de355af3d9dc28.js +0 -1
  228. package/.next/static/chunks/app/(app)/reports/page-a700f5a3c51fd8b2.js +0 -1
  229. package/.next/static/chunks/app/(app)/routines/page-1a24a2e021239bb1.js +0 -1
  230. package/.next/static/chunks/app/(app)/security/page-bc83e0eeeaa06803.js +0 -1
  231. package/.next/static/chunks/app/(app)/skills/page-7b9d25eefde42c62.js +0 -1
  232. package/.next/static/chunks/app/(app)/tasks/page-49e04347c03ad380.js +0 -1
  233. package/.next/static/chunks/app/(app)/test-dev/page-5a5787dff721c528.js +0 -1
  234. package/.next/static/chunks/app/(auth)/login/page-c4942e3f5c363aee.js +0 -1
  235. package/.next/static/chunks/webpack-222e3894b78c67db.js +0 -1
  236. /package/.next/static/{Ri83ondUvcbIqZUDGJAn8 → N4KMSOY3i-qyXrbfm97sO}/_buildManifest.js +0 -0
  237. /package/.next/static/{Ri83ondUvcbIqZUDGJAn8 → N4KMSOY3i-qyXrbfm97sO}/_ssgManifest.js +0 -0
@@ -1,4 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9512],{937:(e,s,t)=>{t.d(s,{k:()=>n});var a=t(7814);let n=(0,a.createServerReference)("60a4a8cc2b73562649a744c18fed7b988ed8b899be",a.callServer,void 0,a.findSourceMapURL,"getEvents")},1922:(e,s,t)=>{t.d(s,{V:()=>n});var a=t(7814);let n=(0,a.createServerReference)("00dee30faa755fba7dae6a97fa8040aa3550d076f1",a.callServer,void 0,a.findSourceMapURL,"seedDefaultBlocksAction")},2034:(e,s,t)=>{t.d(s,{V4:()=>w,H8:()=>M,qs:()=>b});var a=t(5076),n=t(8488),l=t(9860),c=t(4302),r=t(5393),i=t(4552),d=t(8576),o=t(5629),m=t(7814);let h=(0,m.createServerReference)("403f6bb414736b04bf5b1510a415769aee8fd28f1b",m.callServer,void 0,m.findSourceMapURL,"pullKbForComposer"),u=(0,m.createServerReference)("402f1084f1b383af82c0211c878bdd0cd40c487414",m.callServer,void 0,m.findSourceMapURL,"sendMessageToKb"),p=(0,m.createServerReference)("408cccec4657b0fe091207622d18cb760a571a8fb8",m.callServer,void 0,m.findSourceMapURL,"taskRef");var x=t(1922),g=t(7560);let j={read:"Read",create:"Create",edit:"Edit",run:"Run",search:"Search"},f=[{cmd:"/help",descKey:"help"},{cmd:"/kb",descKey:"kb",arg:"<question>"},{cmd:"/search",descKey:"search",arg:"<query>"},{cmd:"/graph",descKey:"graph",arg:"<key>"},{cmd:"/status",descKey:"status"},{cmd:"/agents",descKey:"agents"},{cmd:"/agent",descKey:"agent",arg:"<handle>"},{cmd:"/new-goal",descKey:"newGoal",arg:"<brief>"},{cmd:"/new-issue",descKey:"newIssue",arg:"<title>"},{cmd:"/new-spec",descKey:"newSpec",arg:"<title>"},{cmd:"/generate-plan",descKey:"generatePlan",arg:"<brief>"},{cmd:"/approve",descKey:"approve"},{cmd:"/reject",descKey:"reject",arg:"<reason>"},{cmd:"/run-247",descKey:"run247"},{cmd:"/pause",descKey:"pause"},{cmd:"/cancel",descKey:"cancel"},{cmd:"/archive",descKey:"archive"},{cmd:"/assign",descKey:"assign",arg:"<issue> <@agent>"},{cmd:"/review",descKey:"review"},{cmd:"/close-sprint",descKey:"closeSprint"},{cmd:"/test-dev",descKey:"testDev"},{cmd:"/github",descKey:"github"},{cmd:"/prepare-deploy",descKey:"prepareDeploy"},{cmd:"/export-source",descKey:"exportSource",arg:"<repo>"},{cmd:"/models",descKey:"models"},{cmd:"/skills",descKey:"skills"},{cmd:"/locks",descKey:"locks"},{cmd:"/telegram",descKey:"telegram"},{cmd:"/reindex",descKey:"reindex"},{cmd:"/curate",descKey:"curate"},{cmd:"/clear",descKey:"clear"}],v={idle:{c:"#6b7390",bg:"rgba(120,130,160,.16)"},working:{c:"#b3d97a",bg:"rgba(179,217,122,.15)"},review:{c:"#e0a44e",bg:"rgba(224,164,78,.16)"},blocked:{c:"#e8688f",bg:"rgba(232,104,143,.16)"}};function b({status:e}){let s=(0,o.k)(),t=v[e]??v.idle;return(0,a.jsx)("span",{className:"status-pill",style:{color:t.c,background:t.bg},children:e in v?s("chat.status."+e):e})}function k(e,s,t){let n=t?Object.fromEntries(t.map(e=>[e.key.toLowerCase(),e])):{},l=t&&t.length>0;return e.split(l?/(@[a-z0-9-]+|#[a-z0-9_-]+)/gi:/(@[a-z0-9-]+)/gi).map((e,t)=>{if(/^@[a-z0-9-]+$/i.test(e)&&s.has(e.slice(1).toLowerCase()))return(0,a.jsx)("span",{className:"mention",children:e},t);if(l&&/^#[a-z0-9_-]+$/i.test(e)){let s=n[e.slice(1).toLowerCase()];if(s){let n="goal"===s.kind?"/goals":"spec"===s.kind?"/planner":"/pm";return(0,a.jsx)("a",{className:"ref-chip",href:n,title:s.title,children:e},t)}}return(0,a.jsx)("span",{children:e},t)})}function N({step:e}){let s,t,n=(0,o.k)(),l=e.kind in j?n("chat.verb."+e.kind):e.kind,c="run"===e.kind,r="edit"===e.kind&&!!e.detail,i="create"===e.kind&&!!e.detail,d=r?e.detail.split("\n"):[],m=r?d.filter(e=>e.startsWith("+")).length:0,h=r?d.filter(e=>e.startsWith("-")).length:0,u=i?e.detail.slice(0,4e3).split("\n"):[];return(0,a.jsxs)("div",{className:"work-step",children:[(0,a.jsxs)("div",{className:"wstep-head",children:[(0,a.jsx)("span",{className:"wstep-verb "+e.kind,children:l}),(0,a.jsx)("span",{className:"wstep-file",children:e.target}),r&&(0,a.jsxs)("span",{className:"wstep-badge",children:[(0,a.jsxs)("span",{className:"plus",children:["+",m]})," ",(0,a.jsxs)("span",{className:"minus",children:["−",h]})]}),i&&(0,a.jsx)("span",{className:"wstep-badge",children:(0,a.jsxs)("span",{className:"plus",children:["+",u.length]})})]}),i&&(0,a.jsx)("div",{className:"wstep-code scroll",children:u.map((e,s)=>(0,a.jsxs)("div",{className:"wcode-line",children:[(0,a.jsx)("span",{className:"wcode-gutter",children:s+1}),(0,a.jsx)("span",{className:"wcode-text",children:e||"​"})]},s))}),r&&(0,a.jsx)("div",{className:"wstep-code scroll",children:d.map((e,s)=>{let t=e.startsWith("+")?"add":e.startsWith("-")?"del":"ctx";return(0,a.jsxs)("div",{className:"wdiff-line "+t,children:[(0,a.jsx)("span",{className:"wdiff-sign",children:"add"===t?"+":"del"===t?"−":" "}),(0,a.jsx)("span",{className:"wdiff-text",children:e.slice(1)||"​"})]},s)})}),c&&e.detail&&(t=(s=e.detail.split("\n")).slice(0,14),(0,a.jsxs)("div",{className:"wstep-term",children:[t.map((e,s)=>(0,a.jsx)("div",{className:/✓|passed|ok\b/i.test(e)?"ok":"",children:e||"​"},s)),s.length>t.length&&(0,a.jsxs)("div",{className:"wstep-more",children:["… +",s.length-t.length," lines"]})]}))]})}function y({steps:e,live:s}){let t=(0,o.k)(),l=e.filter(e=>["read","create","edit","run","search"].includes(e.kind)),c=l.filter(e=>"create"===e.kind||"edit"===e.kind).length,r=[...e].reverse().find(e=>"thinking"===e.kind),i=!s,[m,h]=(0,n.useState)(s);return 0!==l.length||r?(0,a.jsxs)("div",{className:"work-block"+(m?"":" collapsed"),children:[(0,a.jsxs)("button",{type:"button",className:"work-head",onClick:()=>h(e=>!e),children:[i?(0,a.jsx)("span",{className:"done-check",children:(0,a.jsx)(d.I,{name:"check",size:15})}):(0,a.jsx)("span",{className:"spin",children:(0,a.jsx)(d.I,{name:"refresh",size:14})}),(0,a.jsx)("span",{className:"wlabel",children:t(i?"chat.work.done":"chat.work.working")}),(0,a.jsx)("span",{className:"wmeta",children:i?t(1===l.length?"chat.work.actions.one":"chat.work.actions.other",{n:l.length}):t("chat.work.workingEllipsis")}),i&&c>0&&(0,a.jsxs)("span",{className:"wmeta wfiles",title:"files changed",children:["✎ ",c]}),(0,a.jsx)("span",{className:"work-toggle"+(m?" open":""),children:(0,a.jsx)(d.I,{name:"chevronRight",size:13})})]}),m&&(0,a.jsxs)(a.Fragment,{children:[r?.detail&&(0,a.jsxs)("div",{className:"work-thinking",children:[(0,a.jsx)("span",{className:"ti",children:(0,a.jsx)(d.I,{name:"bot",size:13})}),(0,a.jsx)("span",{children:r.detail})]}),(0,a.jsx)("div",{className:"work-steps",children:l.map(e=>(0,a.jsx)(N,{step:e},e.id))})]})]}):null}function w({onSend:e,placeholder:s,agents:t,defaultText:l="",requireMention:c=!1,enableAttachments:r=!0,refs:m}){let[u,p]=(0,n.useState)(l),x=(0,o.k)(),g=!c||u.trim().startsWith("/")||(u.match(/@([a-z0-9-]+)/gi)||[]).some(e=>t.some(s=>s.handle.toLowerCase()===e.slice(1).toLowerCase())),[j,v]=(0,n.useState)(!1),[b,k]=(0,n.useState)(null),[N,y]=(0,n.useState)(null),[S,z]=(0,n.useState)(null),[D,I]=(0,n.useState)([]),[K,R]=(0,n.useState)(""),[C,M]=(0,n.useState)(!1),[A,L]=(0,n.useState)(!1),[E,$]=(0,n.useState)(""),[P,T]=(0,n.useState)(null),[F,W]=(0,n.useState)(""),[U,q]=(0,n.useTransition)(),H=(0,n.useRef)(null),B=(0,n.useRef)(null),_=(0,n.useRef)(null),V=void 0!==m;async function O(e){if(!e||!e.length)return;R("");let s=10-D.length,t=Array.from(e).slice(0,Math.max(0,s));if(!t.length)return void R(x("chat.composer.maxAttachments"));let a=new FormData;for(let e of t)a.append("files",e);M(!0);try{let e=await fetch("/api/upload",{method:"POST",body:a}),s=await e.json();if(!e.ok||!s.ok)return void R(s.error??x("chat.composer.uploadFailed"));I(e=>[...e,...s.attachments].slice(0,10))}catch{R(x("chat.composer.uploadFailed"))}finally{M(!1),B.current&&(B.current.value="")}}function G(e){e.style.height="auto",e.style.height=Math.min(e.scrollHeight,260)+"px"}function J(e){if(!b||!H.current)return;let s=u.slice(0,b.start),t=u.slice(H.current.selectionStart),a="@"+e.handle+" ";p(s+a+t),_.current=(s+a).length,k(null),requestAnimationFrame(()=>H.current?.focus())}function Q(e){if(!N||!H.current)return;let s=u.slice(0,N.start),t=u.slice(H.current.selectionStart),a="#"+e.key+" ";p(s+a+t),_.current=(s+a).length,y(null),requestAnimationFrame(()=>H.current?.focus())}function X(e){let s=e.cmd+(e.arg?" ":"");p(s),_.current=s.length,z(null),requestAnimationFrame(()=>H.current?.focus())}function Y(){let e=E.trim();if(!e){T(null),W(x("chat.kbPull.empty"));return}W(""),T(null),q(async()=>{let s=await h(e);s.ok&&s.text?T({text:s.text,sources:s.sources??[]}):W(x("chat.kbPull.noResult"))})}function Z(){let s=u.trim();!s&&0===D.length||g&&(e(s,D.length?D:void 0),p(""),I([]),R(""),H.current&&(H.current.style.height="auto"),k(null),z(null),y(null),L(!1))}return(0,n.useEffect)(()=>{null!=_.current&&H.current&&(H.current.setSelectionRange(_.current,_.current),_.current=null)}),(0,a.jsxs)("div",{className:"chat-composer",children:[b&&(0,a.jsxs)("div",{className:"mention-pop",children:[(0,a.jsxs)("div",{className:"mention-head",children:[(0,a.jsx)(d.I,{name:"at",size:12})," ",x("chat.composer.mentionAgent")]}),(0,a.jsxs)("div",{className:"mention-list scroll",children:[0===b.items.length&&(0,a.jsx)("div",{className:"mention-empty",children:x("chat.noAgentMatch",{q:b.query})}),b.items.map((e,s)=>(0,a.jsxs)("div",{className:"mention-item"+(s===b.index?" active":""),onMouseEnter:()=>k(e=>e&&{...e,index:s}),onMouseDown:s=>{s.preventDefault(),J(e)},children:[(0,a.jsx)(i.e,{name:e.name,color:e.color,size:24}),(0,a.jsx)("div",{className:"mi-text",children:(0,a.jsxs)("div",{className:"mi-name",children:[e.name," ",(0,a.jsxs)("span",{className:"mi-handle",children:["@",e.handle]})]})}),(0,a.jsx)("span",{className:"mi-role",children:e.role})]},e.handle))]})]}),N&&(0,a.jsxs)("div",{className:"mention-pop",children:[(0,a.jsxs)("div",{className:"mention-head",children:[(0,a.jsx)(d.I,{name:"branch",size:12})," ",x("chat.composer.referenceItem")]}),(0,a.jsxs)("div",{className:"mention-list scroll",children:[0===N.items.length&&(0,a.jsx)("div",{className:"mention-empty",children:x("chat.noRefMatch",{q:N.query})}),N.items.map((e,s)=>(0,a.jsxs)("div",{className:"mention-item"+(s===N.index?" active":""),onMouseEnter:()=>y(e=>e&&{...e,index:s}),onMouseDown:s=>{s.preventDefault(),Q(e)},children:[(0,a.jsx)("span",{className:"mi-ref-kind",children:x("chat.composer.refKind."+e.kind)}),(0,a.jsx)("div",{className:"mi-text",children:(0,a.jsxs)("div",{className:"mi-name",children:[(0,a.jsxs)("span",{className:"mi-handle",children:["#",e.key]})," ",e.title]})})]},e.id))]})]}),S&&(0,a.jsxs)("div",{className:"mention-pop",children:[(0,a.jsxs)("div",{className:"mention-head",children:[(0,a.jsx)(d.I,{name:"command",size:12})," ",x("chat.commands")]}),(0,a.jsx)("div",{className:"mention-list scroll",children:S.items.map((e,s)=>(0,a.jsxs)("div",{className:"mention-item"+(s===S.index?" active":""),onMouseEnter:()=>z(e=>e&&{...e,index:s}),onMouseDown:s=>{s.preventDefault(),X(e)},children:[(0,a.jsx)("div",{className:"mi-text",children:(0,a.jsxs)("div",{className:"mi-name",children:[e.cmd,e.arg&&(0,a.jsxs)("span",{className:"mi-handle",children:[" ",e.arg]})]})}),(0,a.jsx)("span",{className:"mi-role",children:x("chat.slash."+e.descKey)})]},e.cmd))})]}),A&&(0,a.jsxs)("div",{className:"mention-pop kb-pull-pop",children:[(0,a.jsxs)("div",{className:"mention-head",children:[(0,a.jsx)(d.I,{name:"branch",size:12})," ",x("chat.kbPull.title")]}),(0,a.jsxs)("div",{className:"kb-pull-body",children:[(0,a.jsxs)("div",{className:"kb-pull-row",children:[(0,a.jsx)("input",{className:"kb-pull-input",value:E,placeholder:x("chat.kbPull.placeholder"),onChange:e=>{$(e.target.value),W("")},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Y()),"Escape"===e.key&&(e.preventDefault(),L(!1))}}),(0,a.jsxs)("button",{type:"button",className:"att-btn",disabled:U,onMouseDown:e=>e.preventDefault(),onClick:Y,children:[U?(0,a.jsx)("span",{className:"spin",children:(0,a.jsx)(d.I,{name:"refresh",size:13})}):(0,a.jsx)(d.I,{name:"search",size:13}),x("chat.kbPull.search")]})]}),(0,a.jsx)("div",{className:"kb-pull-preview",children:U?(0,a.jsx)("div",{className:"kb-pull-muted",children:x("chat.kbPull.searching")}):P?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"kb-pull-text",children:P.text}),P.sources.length>0&&(0,a.jsx)("div",{className:"kb-pull-sources",children:P.sources.map(e=>(0,a.jsx)("span",{children:e},e))})]}):(0,a.jsx)("div",{className:F?"kb-pull-error":"kb-pull-muted",children:F||x("chat.kbPull.empty")})}),P&&(0,a.jsx)("div",{className:"kb-pull-actions",children:(0,a.jsxs)("button",{type:"button",className:"send-btn",onMouseDown:e=>e.preventDefault(),onClick:function(){if(!P)return;let e=P.sources.length?`
2
- Sources: ${P.sources.join(", ")}`:"",s=`KB: ${P.text}${e}`;p(e=>e.trim()?`${e.trimEnd()}
3
-
4
- ${s}`:s),L(!1),T(null),W(""),requestAnimationFrame(()=>{H.current&&(G(H.current),H.current.focus())})},children:[(0,a.jsx)(d.I,{name:"add",size:13})," ",x("chat.kbPull.insert")]})})]})]}),(0,a.jsxs)("div",{className:"composer-box"+(j?" focus":""),children:[D.length>0&&(0,a.jsx)("div",{className:"att-row",children:D.map((e,s)=>(0,a.jsxs)("span",{className:"att-chip",children:[(0,a.jsx)(d.I,{name:/^image\//.test(e.type)||"application/pdf"===e.type?"doc":"files",size:11}),(0,a.jsx)("span",{className:"att-name",children:e.name}),(0,a.jsx)("button",{className:"att-x",onClick:()=>I(e=>e.filter((e,t)=>t!==s)),children:(0,a.jsx)(d.I,{name:"close",size:10})})]},e.path))}),K&&(0,a.jsx)("div",{style:{fontSize:10.5,color:"#e8688f",padding:"2px 8px"},children:K}),(0,a.jsx)("textarea",{ref:H,className:"composer-input",value:u,rows:1,placeholder:s,onChange:e=>{p(e.target.value),function(e,s){let a=e.match(/^\/([a-z-]*)$/i);if(a){let e=a[1].toLowerCase(),s=f.filter(s=>s.cmd.slice(1).startsWith(e));k(null),y(null),z(s.length?{items:s,index:0}:null);return}z(null);let n=e.slice(0,s).match(/#([a-z0-9_-]*)$/i);if(n&&m&&m.length>0){let e=n[1].toLowerCase(),t=m.filter(s=>s.key.toLowerCase().includes(e)||s.title.toLowerCase().includes(e));k(null),y({query:e,start:s-n[0].length,items:t,index:0});return}y(null);let l=e.slice(0,s).match(/@([a-z0-9-]*)$/i);if(!l)return k(null);let c=l[1].toLowerCase(),r=t.filter(e=>e.handle.includes(c)||e.name.toLowerCase().includes(c)||e.role.toLowerCase().includes(c));k({query:c,start:s-l[0].length,items:r,index:0})}(e.target.value,e.target.selectionStart),G(e.target)},onKeyDown:function(e){if(S&&S.items.length){if("ArrowDown"===e.key){e.preventDefault(),z(e=>e&&{...e,index:(e.index+1)%e.items.length});return}if("ArrowUp"===e.key){e.preventDefault(),z(e=>e&&{...e,index:(e.index-1+e.items.length)%e.items.length});return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault(),X(S.items[S.index]);return}if("Escape"===e.key){e.preventDefault(),z(null);return}}if(N&&N.items.length){if("ArrowDown"===e.key){e.preventDefault(),y(e=>e&&{...e,index:(e.index+1)%e.items.length});return}if("ArrowUp"===e.key){e.preventDefault(),y(e=>e&&{...e,index:(e.index-1+e.items.length)%e.items.length});return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault(),Q(N.items[N.index]);return}if("Escape"===e.key){e.preventDefault(),y(null);return}}if(b&&b.items.length){if("ArrowDown"===e.key){e.preventDefault(),k(e=>e&&{...e,index:(e.index+1)%e.items.length});return}if("ArrowUp"===e.key){e.preventDefault(),k(e=>e&&{...e,index:(e.index-1+e.items.length)%e.items.length});return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault(),J(b.items[b.index]);return}if("Escape"===e.key){e.preventDefault(),k(null);return}}if("Escape"===e.key&&A){e.preventDefault(),L(!1);return}"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Z())},onFocus:()=>v(!0),onBlur:()=>v(!1)}),r&&(0,a.jsx)("input",{ref:B,type:"file",multiple:!0,hidden:!0,accept:".png,.jpg,.jpeg,.gif,.webp,.bmp,.pdf,.txt,.md,.csv,.json,.log,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx",onChange:e=>O(e.target.files)}),(0,a.jsxs)("div",{className:"composer-foot",children:[(0,a.jsxs)("span",{className:"composer-actions",children:[r&&(0,a.jsxs)("button",{type:"button",className:"att-btn",title:x("chat.composer.attachTitle"),disabled:C||D.length>=10,onClick:()=>B.current?.click(),children:[C?(0,a.jsx)("span",{className:"spin",children:(0,a.jsx)(d.I,{name:"refresh",size:13})}):(0,a.jsx)(d.I,{name:"add",size:14})," ",D.length>0?`${D.length}/10`:x("chat.composer.attach")]}),V&&(0,a.jsxs)("button",{type:"button",className:"att-btn kb-pull-btn",title:x("chat.kbPull.open"),disabled:U,onMouseDown:e=>e.preventDefault(),onClick:function(){$(u.replace(/@[a-z0-9-]+/gi,"").trim().slice(0,180)),T(null),W(""),k(null),z(null),y(null),L(e=>!e)},children:[(0,a.jsx)(d.I,{name:"branch",size:13})," ",x("chat.kbPull.open")]})]}),c&&u.trim()&&!g?(0,a.jsxs)("span",{className:"composer-hint",style:{color:"#f0a35e"},children:[(0,a.jsx)(d.I,{name:"at",size:11})," ",x("chat.composer.mentionToSend")]}):(0,a.jsxs)("span",{className:"composer-hint",children:[(0,a.jsx)("kbd",{children:"↵"})," ",x("chat.composer.send")," \xb7 ",(0,a.jsx)("kbd",{children:"⇧↵"})," ",x("chat.composer.newline")]}),(0,a.jsxs)("button",{className:"send-btn",disabled:!u.trim()&&0===D.length||!g,onMouseDown:e=>e.preventDefault(),onClick:Z,children:[(0,a.jsx)(d.I,{name:"send",size:13})," ",x("home.cmd.run")]})]})]})]})}function S({atts:e}){return(0,a.jsx)("div",{className:"msg-atts",children:e.map(e=>{let s=`/api/upload?path=${encodeURIComponent(e.path)}`;return/^image\//.test(e.type)?(0,a.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"msg-att-img",title:e.name,children:(0,a.jsx)("img",{src:s,alt:e.name,loading:"lazy"})},e.path):(0,a.jsxs)("a",{href:s,target:"_blank",rel:"noreferrer",className:"msg-att-doc",title:e.name,children:[(0,a.jsx)(d.I,{name:"doc",size:13})," ",(0,a.jsx)("span",{className:"mad-name",children:e.name})]},e.path)})})}function z({id:e}){let s=(0,o.k)(),[t,l]=(0,n.useTransition)(),[c,r]=(0,n.useState)(!1);return(0,a.jsx)("button",{type:"button",className:"cmsg-kb",disabled:t||c,title:s(c?"chat.kbSave.saved":"chat.kbSave.send"),onClick:()=>l(async()=>{(await u(e)).ok&&r(!0)}),style:{background:"none",border:"none",cursor:c?"default":"pointer",padding:0,marginLeft:2,display:"inline-flex",alignItems:"center",color:c?"var(--accent)":"var(--text-faint)",opacity:t?.5:1},children:(0,a.jsx)(d.I,{name:c?"check":"branch",size:11,className:t?"sync-spin":""})})}function D({taskId:e}){let[s,t]=(0,n.useState)(null);return((0,n.useEffect)(()=>{let s=!0;return p(e).then(e=>{s&&t(e)}).catch(()=>{}),()=>{s=!1}},[e]),s)?(0,a.jsxs)("div",{style:{marginTop:5,fontSize:10.5,color:"var(--text-faint)",display:"flex",alignItems:"center",gap:5,flexWrap:"wrap"},children:[(0,a.jsx)(d.I,{name:"branch",size:10}),(0,a.jsx)("span",{style:{color:"var(--accent)",fontWeight:600},children:s.taskKey}),s.issueKey&&(0,a.jsxs)("span",{children:["\xb7 ",s.issueKey]}),s.goalTitle&&(0,a.jsxs)("span",{children:["\xb7 ",s.goalTitle.slice(0,40)]}),s.col&&(0,a.jsx)("span",{style:{padding:"0 5px",borderRadius:5,border:"1px solid var(--border)",textTransform:"capitalize"},children:s.col})]}):null}function I({blocks:e}){let s=(0,l.useRouter)(),t=(0,o.k)();return(0,a.jsxs)("div",{style:{marginTop:5,fontSize:10.5,color:"var(--text-faint)",display:"flex",alignItems:"center",gap:5,flexWrap:"wrap"},children:[(0,a.jsx)(d.I,{name:"doc",size:10}),(0,a.jsx)("span",{children:t("chat.touchedBlocks")}),e.map(e=>(0,a.jsx)("button",{type:"button",title:t("chat.touchedBlocks"),onClick:()=>s.push("/knowledge"),style:{color:"var(--accent)",fontWeight:600,background:"rgba(120,100,255,.10)",border:"1px solid rgba(120,100,255,.25)",borderRadius:4,padding:"0 5px",cursor:"pointer"},children:e},e))]})}function K({sources:e}){let[s,t]=(0,n.useState)(!1),l=(0,o.k)();return(0,a.jsxs)("div",{className:"msg-sources",children:[(0,a.jsxs)("button",{type:"button",className:"msg-sources-toggle",onClick:()=>t(e=>!e),children:[(0,a.jsx)(d.I,{name:"pulse",size:10})," ",l("chat.sources",{n:e.length})," ",(0,a.jsx)(d.I,{name:s?"chevronDown":"chevronRight",size:11})]}),s&&(0,a.jsx)("div",{className:"msg-sources-list",children:e.map((e,s)=>(0,a.jsx)("span",{children:e},s))})]})}function R({text:e,markdown:s,known:t,refs:l}){let i=(0,o.k)(),[d,m]=(0,n.useState)(!1),h=e.length>900;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"cmsg-bubble"+(h&&!d?" clamped":"")+(h&&d?" expanded":""),children:s?(0,a.jsx)("div",{className:"md cmsg-md",children:(0,a.jsx)(c.oz,{remarkPlugins:[r.A],children:e})}):k(e,t,l)}),h&&(0,a.jsx)("button",{type:"button",className:"cmsg-more",onClick:()=>m(e=>!e),children:i(d?"chat.showLess":"chat.showMore")})]})}function C({m:e}){let s=(0,o.k)(),t=(0,l.useRouter)(),[i,m]=(0,n.useTransition)(),[h,u]=(0,n.useState)(!1),[p,j]=(0,n.useState)(null);return(0,a.jsxs)("div",{className:"kb-card",children:[(0,a.jsxs)("div",{className:"kb-card-head",children:[(0,a.jsx)(d.I,{name:"branch",size:14})," ",s("kbcard.title")]}),(0,a.jsx)("div",{className:"kb-card-body cmsg-md",children:(0,a.jsx)(c.oz,{remarkPlugins:[r.A],children:e.text})}),p&&(0,a.jsxs)("div",{className:"kb-card-note",children:[(0,a.jsx)(d.I,{name:"check",size:12})," ",p]}),(0,a.jsxs)("div",{className:"kb-card-actions",children:[(0,a.jsx)("button",{className:"kbc-btn primary",disabled:i,onClick:()=>m(async()=>{j(s("kbcard.created",{n:(await (0,x.V)()).seeded})),t.refresh()}),children:s("home.createBlocks")}),(0,a.jsx)("button",{className:"kbc-btn",onClick:()=>t.push("/knowledge"),children:s("home.openKnowledge")}),(0,a.jsx)("button",{className:"kbc-btn",disabled:i,onClick:()=>m(async()=>{j(s("kb.reindexResult",{n:(await (0,g.f)()).chunks})),t.refresh()}),children:s("kb.reindex")})]}),e.sources&&e.sources.length>0&&(0,a.jsxs)("div",{className:"kb-card-sources",children:[(0,a.jsxs)("button",{type:"button",className:"msg-sources-toggle",onClick:()=>u(e=>!e),children:[(0,a.jsx)(d.I,{name:"pulse",size:10})," ",s("chat.sources",{n:e.sources.length})," ",(0,a.jsx)(d.I,{name:h?"chevronDown":"chevronRight",size:11})]}),h&&(0,a.jsx)("div",{className:"msg-sources-list",children:e.sources.map((e,s)=>(0,a.jsx)("span",{children:e},s))})]})]})}function M({msgs:e,typing:s,agents:t,byRun:l,liveRuns:c,loading:r,highlightId:d,operator:m,markdownAgent:h=!1,emptyHint:u,avatarSize:p=30,refs:x}){let g=(0,o.k)(),j=(0,n.useRef)(null),f=(0,n.useRef)(!0),v=Object.fromEntries(t.map(e=>[e.handle,e])),b=new Set(t.map(e=>e.handle));return(0,n.useEffect)(()=>{let e=j.current;e&&f.current&&(e.scrollTop=e.scrollHeight)},[e,s,l,c]),(0,n.useEffect)(()=>{d&&document.getElementById("m-"+d)?.scrollIntoView({block:"center",behavior:"smooth"})},[d,e]),(0,a.jsxs)("div",{className:"chat-stream scroll",ref:j,onScroll:()=>{let e=j.current;e&&(f.current=e.scrollHeight-e.scrollTop-e.clientHeight<120)},children:[[...e].sort((e,s)=>{let t=e.createdAt?new Date(e.createdAt).getTime():0,a=s.createdAt?new Date(s.createdAt).getTime():0;return t!==a?t-a:("operator"!==e.fromKind)-("operator"!==s.fromKind)}).map(e=>{let s="operator"===e.fromKind,t=e.fromHandle?v[e.fromHandle]:null,n=l[e.id],c=!s&&"kb-card"===e.kind;return(0,a.jsxs)("div",{className:"cmsg"+(s?" operator":"")+(d===e.id?" highlight":""),id:"m-"+e.id,children:[s?m?.image?(0,a.jsx)(i.e,{name:m.name||g("chat.you"),color:"#9a5cff",image:m.image,size:p}):(0,a.jsx)("div",{className:"avatar",style:{background:"linear-gradient(150deg,#e0a44e,#9a5cff)",color:"#1a1206",width:p,height:p,borderRadius:Math.round(.3*p),display:"grid",placeItems:"center",fontWeight:700,fontSize:Math.round(.4*p)},children:"OP"}):t?(0,a.jsx)(i.e,{name:t.name,color:t.color,image:t.image,size:p}):(0,a.jsx)(i.e,{name:"?",color:"#6b7390",size:p}),(0,a.jsxs)("div",{className:"cmsg-body",children:[(0,a.jsxs)("div",{className:"cmsg-head",children:[(0,a.jsx)("span",{className:"cmsg-name",children:s?g("chat.you"):t?.name??e.fromHandle}),!s&&t&&(0,a.jsx)("span",{className:"cmsg-role",children:t.role}),(0,a.jsx)("span",{className:"cmsg-when",children:function(e){if(!e)return"";let s="string"==typeof e?new Date(e):e,t=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),a=s.toLocaleDateString([],{day:"2-digit",month:"short"});return`${a}, ${t}`}(e.createdAt)}),!s&&e.text&&(0,a.jsx)(z,{id:e.id})]}),n&&n.length>0&&(0,a.jsx)(y,{steps:n,live:!1}),c?(0,a.jsx)(C,{m:e}):e.text&&(0,a.jsx)(R,{text:e.text,markdown:h&&!s,known:b,refs:x}),e.attachments&&e.attachments.length>0&&(0,a.jsx)(S,{atts:e.attachments}),!s&&!c&&e.sources&&e.sources.length>0&&(0,a.jsx)(K,{sources:e.sources}),!s&&e.taskId&&(0,a.jsx)(D,{taskId:e.taskId}),!s&&e.blocks&&e.blocks.length>0&&(0,a.jsx)(I,{blocks:e.blocks})]})]},e.id)}),c.map(([e,s])=>{let n=s.find(e=>e.agentId)?.agentId,l=t.find(e=>e.id===n);if(!l)return null;let c=s.reduce((e,s)=>Math.max(e,s.seq||0),0),r=s.some(e=>"done"===e.kind)||c>0&&Date.now()-c>12e4,d=s.filter(e=>"text"===e.kind).map(e=>e.detail).join("");return(0,a.jsxs)("div",{className:"cmsg",children:[(0,a.jsx)(i.e,{name:l.name,color:l.color,image:l.image,size:p}),(0,a.jsxs)("div",{className:"cmsg-body",children:[(0,a.jsxs)("div",{className:"cmsg-head",children:[(0,a.jsx)("span",{className:"cmsg-name",children:l.name}),(0,a.jsx)("span",{className:"cmsg-role",children:l.role})]}),(0,a.jsx)(y,{steps:s,live:!r}),d&&(0,a.jsxs)("div",{className:"cmsg-bubble",children:[k(d,b,x),!r&&(0,a.jsx)("span",{className:"live-caret"})]})]})]},"live-"+e)}),s.filter(e=>{let s=v[e];return s&&!c.some(([,e])=>e.some(e=>e.agentId===s.id))}).map(e=>{let s=v[e];return s?(0,a.jsxs)("div",{className:"cmsg",children:[(0,a.jsx)(i.e,{name:s.name,color:s.color,image:s.image,size:p}),(0,a.jsxs)("div",{className:"cmsg-body",children:[(0,a.jsxs)("div",{className:"cmsg-head",children:[(0,a.jsx)("span",{className:"cmsg-name",children:s.name}),(0,a.jsx)("span",{className:"cmsg-role",children:s.role})]}),(0,a.jsxs)("div",{className:"typing-bubble",children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]})]},"typing-"+e):null}),r&&0===e.length&&0===c.length&&(0,a.jsx)("div",{className:"chat-skel","aria-label":g("home.chat.loading"),children:[0,1,2].map(e=>(0,a.jsxs)("div",{className:"skel-row",style:{animationDelay:`${.12*e}s`},children:[(0,a.jsx)("div",{className:"skel-avatar"}),(0,a.jsxs)("div",{className:"skel-lines",children:[(0,a.jsx)("div",{className:"skel-line",style:{width:"38%"}}),(0,a.jsx)("div",{className:"skel-line",style:{width:1===e?"82%":"64%"}}),2!==e&&(0,a.jsx)("div",{className:"skel-line",style:{width:"48%"}})]})]},e))}),!r&&0===e.length&&0===s.length&&0===c.length&&(0,a.jsx)("div",{className:"mention-empty",style:{textAlign:"center",padding:22},children:u??g("chat.stream.emptyHint")})]})}},3211:(e,s,t)=>{t.d(s,{L:()=>n});var a=t(7814);let n=(0,a.createServerReference)("407c69e29d4c19f3ea5127c665f9a2366d571c913f",a.callServer,void 0,a.findSourceMapURL,"compactConversation")},4552:(e,s,t)=>{t.d(s,{e:()=>n});var a=t(5076);function n({name:e,color:s,size:t=24,health:l,image:c}){let r=Math.max(6,Math.round(.3*t)),i=Math.round(.28*t),d=c?/^(data:|https?:|\/)/.test(c)?c:`/api/upload?path=${encodeURIComponent(c)}`:null;return(0,a.jsxs)("span",{style:{position:"relative",width:t,height:t,flex:`0 0 ${t}px`,display:"inline-block"},children:[d?(0,a.jsx)("img",{src:d,alt:e,width:t,height:t,style:{width:t,height:t,borderRadius:i,objectFit:"cover",display:"block"}}):(0,a.jsx)("span",{style:{width:t,height:t,borderRadius:i,background:s,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*t),fontWeight:700},children:(e[0]||"?").toUpperCase()}),l&&(0,a.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:r,height:r,borderRadius:"50%",background:"alive"===l?"var(--sx-string)":"stale"===l?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4787:(e,s,t)=>{t.d(s,{V:()=>n});var a=t(7814);let n=(0,a.createServerReference)("4006f1c507a19f83fe440e6cd692806ecf86451d0d",a.callServer,void 0,a.findSourceMapURL,"getMessages")},5069:(e,s,t)=>{t.d(s,{p:()=>n});var a=t(7814);let n=(0,a.createServerReference)("40ecad3cc2b783797f172a587ea27ee003accbbdb7",a.callServer,void 0,a.findSourceMapURL,"conversationContext")},7560:(e,s,t)=>{t.d(s,{f:()=>n});var a=t(7814);let n=(0,a.createServerReference)("009b097b9b4451e4de3ce2766a174e678d26daa2ac",a.callServer,void 0,a.findSourceMapURL,"reindexKbAction")},8163:(e,s,t)=>{t.d(s,{m:()=>i});var a=t(5076),n=t(4552),l=t(8576),c=t(5629);let r=e=>(e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e))+" tks";function i({stat:e,onCompact:s,compacting:t}){let d=(0,c.k)(),o=2*Math.PI*15,m=Math.min(1,e.used/e.max)*o,h=Math.min(1,e.reserve/e.max)*o,u=e.usedPct>=85?"#e8688f":e.usedPct>=65?"#e0a44e":"#b3d97a",p=e.remainingPct<=35,x=e.used>0&&e.usedPct<1?"<1%":`${e.usedPct}%`;return(0,a.jsxs)("div",{className:"ctx-donut-wrap",children:[(0,a.jsxs)("div",{className:"ctx-donut",tabIndex:0,children:[(0,a.jsxs)("svg",{width:38,height:38,viewBox:"0 0 38 38",children:[(0,a.jsx)("circle",{cx:19,cy:19,r:15,fill:"none",stroke:"var(--border)",strokeWidth:4}),(0,a.jsx)("circle",{cx:19,cy:19,r:15,fill:"none",stroke:u,strokeWidth:4,strokeLinecap:"round",strokeDasharray:`${m} ${o}`,transform:"rotate(-90 19 19)"}),(0,a.jsx)("circle",{cx:19,cy:19,r:15,fill:"none",stroke:"var(--text-faint)",strokeWidth:4,strokeDasharray:`${h} ${o}`,strokeDashoffset:-m,transform:"rotate(-90 19 19)"}),(0,a.jsx)("text",{x:19,y:20,textAnchor:"middle",dominantBaseline:"middle",fontSize:10,fontWeight:700,fill:"var(--text)",children:x})]}),(0,a.jsxs)("div",{className:"ctx-pop",children:[(0,a.jsxs)("div",{className:"ctx-pop-title",children:[(0,a.jsx)(l.I,{name:"pulse",size:12})," ",d("chrome.ctx.title")]}),(0,a.jsxs)("div",{className:"ctx-rows",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:d("chrome.ctx.max")}),(0,a.jsx)("b",{children:r(e.max)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:d("chrome.ctx.used")}),(0,a.jsxs)("b",{style:{color:u},children:[r(e.used)," \xb7 ",x]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:d("chrome.ctx.reserve")}),(0,a.jsxs)("b",{children:[r(e.reserve)," \xb7 ",e.reservePct,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:d("chrome.ctx.remaining")}),(0,a.jsxs)("b",{children:[r(e.remaining)," \xb7 ",e.remainingPct,"%"]})]})]}),e.perAgent.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"ctx-pop-sub",children:d("chrome.ctx.byAgent")}),(0,a.jsx)("div",{className:"ctx-agents",children:e.perAgent.slice(0,8).map(e=>(0,a.jsxs)("div",{className:"ctx-agent",children:[(0,a.jsx)(n.e,{name:e.name,color:e.color,size:18}),(0,a.jsx)("span",{className:"ctx-agent-name",children:e.name}),(0,a.jsx)("span",{className:"ctx-agent-bar",children:(0,a.jsx)("span",{style:{width:`${e.pct}%`,background:e.color}})}),(0,a.jsxs)("span",{className:"ctx-agent-tok",children:[r(e.tokens)," \xb7 ",e.pct,"%",e.usd>0?` \xb7 $${e.usd.toFixed(2)}`:""]})]},e.handle))})]}),(0,a.jsx)("div",{className:"ctx-pop-note",children:d("chrome.ctx.explain")})]})]}),p&&(0,a.jsxs)("button",{className:"ctx-compact",onClick:s,disabled:t,title:d("chrome.ctx.compactHint"),children:[t?(0,a.jsx)("span",{className:"spin",children:(0,a.jsx)(l.I,{name:"refresh",size:12})}):(0,a.jsx)(l.I,{name:"collapse",size:12}),d(t?"chrome.ctx.compacting":"chrome.ctx.compact")]})]})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7789],{937:(e,a,l)=>{"use strict";l.d(a,{k:()=>t});var s=l(7814);let t=(0,s.createServerReference)("60a4a8cc2b73562649a744c18fed7b988ed8b899be",s.callServer,void 0,s.findSourceMapURL,"getEvents")},2035:(e,a,l)=>{"use strict";l.d(a,{AgentStudioDetail:()=>I});var s=l(5076),t=l(8488),n=l(8670),i=l(7814);let r=(0,i.createServerReference)("60b037a50cb5bb9c42d45dd65b143e502d8a8c4f54",i.callServer,void 0,i.findSourceMapURL,"saveAgentPersona"),o=(0,i.createServerReference)("60a7e9af9bb1416443628aa2358659204d51494431",i.callServer,void 0,i.findSourceMapURL,"saveAgentRag"),d=(0,i.createServerReference)("60f0823482277bd78a0d1486afab42a61e7b6a0659",i.callServer,void 0,i.findSourceMapURL,"saveAgentImage");var c=l(8006);let m=(0,i.createServerReference)("703adc021a4b8dca7d68fefbe3c1b03d46f02ebfad",i.callServer,void 0,i.findSourceMapURL,"toggleAgentSkill"),u=(0,i.createServerReference)("60bcb7594e98a8cf422bd9725f26216afe88bf034e",i.callServer,void 0,i.findSourceMapURL,"setAllAgentSkills");var p=l(6e3),g=l(937),h=l(8576),v=l(3728),x=l(4403),f=l(5629);let b=["read","create","edit","run","search"];function j({agentId:e}){let a=(0,f.k)(),[l,n]=(0,t.useState)([]),i=(0,t.useRef)(0);if((0,t.useEffect)(()=>{let a=!0;async function l(){let l=await (0,g.k)("room",i.current);if(!a)return;l.length&&(i.current=Math.max(i.current,...l.map(e=>e.seq)));let s=l.filter(a=>a.agentId===e);s.length&&n(e=>{let a=new Set(e.map(e=>e.id));return[...e,...s.filter(e=>!a.has(e.id))]})}l();let s=setInterval(l,1500);return()=>{a=!1,clearInterval(s)}},[e]),0===l.length)return null;let r=[...new Set(l.map(e=>e.runId))],o=r[r.length-1],d=l.filter(e=>e.runId===o&&b.includes(e.kind));return 0===d.length?null:(0,s.jsxs)("div",{className:"card",style:{marginBottom:14,borderColor:"var(--accent)"},children:[(0,s.jsxs)("div",{className:"set-desc",style:{marginBottom:8,display:"flex",alignItems:"center",gap:6},children:[(0,s.jsx)("span",{className:"spin",children:(0,s.jsx)(h.I,{name:"refresh",size:12})})," ",a("agent.wf.liveRun",{n:d.length})]}),d.map(e=>(0,s.jsxs)("div",{className:"live-step",children:[(0,s.jsx)("span",{className:"ls-ico",style:{color:"var(--accent)",fontFamily:"var(--mono-font)",fontSize:11},children:b.includes(e.kind)?a(`agent.wf.${e.kind}`):e.kind})," ",e.target]},e.id))]})}let k=["model","skills","persona","rag","workflow"],y=e=>"$"+e.toFixed(2);function N({value:e,onChange:a}){let l=(0,f.k)(),t=l(e<=.3?"agent.temp.precise":e<=.6?"agent.temp.balanced":e<=.85?"agent.temp.creative":"agent.temp.exploratory");return(0,s.jsxs)("div",{className:"temp-wrap",children:[(0,s.jsxs)("div",{className:"temp-head",children:[(0,s.jsx)("label",{className:"form-label",style:{margin:0},children:l("agent.temp.label")}),(0,s.jsxs)("span",{className:"temp-val",children:[e.toFixed(2)," \xb7 ",t]})]}),(0,s.jsx)("input",{type:"range",className:"temp-range",min:0,max:1,step:.05,value:e,onChange:e=>a(+e.target.value)}),(0,s.jsxs)("div",{className:"temp-scale",children:[(0,s.jsx)("span",{children:l("agent.temp.scaleFocused")}),(0,s.jsx)("span",{children:"0.5"}),(0,s.jsx)("span",{children:l("agent.temp.scaleCreative")})]}),(0,s.jsxs)("div",{className:"temp-desc",children:[(0,s.jsx)("span",{className:"ti",children:(0,s.jsx)(h.I,{name:"bot",size:12})})," ",l("agent.temp.desc")]})]})}function S({spent:e,cap:a}){let l,t,n=(0,f.k)(),{pct:i,level:r,color:o}=(t=(l=a>0?Math.min(100,e/a*100):0)>=90?"crit":l>=70?"warn":"ok",{pct:l,level:t,color:"crit"===t?"var(--sx-keyword)":"warn"===t?"var(--sx-number)":"var(--sx-string)"}),d=n("crit"===r?"agent.budget.noteCrit":"warn"===r?"agent.budget.noteWarn":"agent.budget.noteOk");return(0,s.jsxs)("div",{className:"budget",children:[(0,s.jsxs)("div",{className:"budget-top",children:[(0,s.jsx)("span",{className:"budget-spent",children:y(e)}),(0,s.jsx)("span",{className:"budget-cap",children:n("agent.budget.dailyCap",{cap:y(a)})}),(0,s.jsxs)("span",{className:"budget-pct",style:{background:o+"22",color:o},children:[Math.round(i),"%"]})]}),(0,s.jsx)("div",{className:"budget-track",children:(0,s.jsx)("div",{className:"budget-fill",style:{width:i+"%",background:o}})}),(0,s.jsxs)("div",{className:"budget-note "+r,children:["ok"===r?(0,s.jsx)(h.I,{name:"check",size:12}):(0,s.jsx)(h.I,{name:"warn",size:12})," ",d]})]})}let C={repo:{color:"var(--accent)"},reports:{color:"var(--sx-property)"},skills:{color:"var(--sx-string)"},room:{color:"#c4a0ff"},external:{color:"#6cc7e0"}};function w({docs:e}){let a=(0,f.k)(),[l,n]=(0,t.useState)(null),i=e.reduce((e,a)=>e+a.chunks,0),r=120*i,o=e.map((a,l)=>{let s=l/Math.max(1,e.length)*Math.PI*2,t=26+l%3*9,n=C[a.source]??C.repo;return{x:50+Math.cos(s)*t,y:50+Math.sin(s)*t,sz:Math.min(18,6+.7*a.chunks),color:n.color,name:a.path.split("/").pop()??a.path,chunks:a.chunks,source:a.source}}),d=[...new Set(e.map(e=>e.source))].map(e=>({key:e,...C[e]??C.repo}));return(0,s.jsxs)("div",{className:"ragm",children:[(0,s.jsxs)("div",{className:"ragm-stats",children:[(0,s.jsxs)("div",{className:"ragm-stat",children:[(0,s.jsx)("div",{className:"rs-n",children:e.length}),(0,s.jsx)("div",{className:"rs-l",children:a("agent.rag.statDocuments")})]}),(0,s.jsxs)("div",{className:"ragm-stat",children:[(0,s.jsx)("div",{className:"rs-n",children:i}),(0,s.jsx)("div",{className:"rs-l",children:a("agent.rag.statChunks")})]}),(0,s.jsxs)("div",{className:"ragm-stat",children:[(0,s.jsx)("div",{className:"rs-n",children:i}),(0,s.jsx)("div",{className:"rs-l",children:a("agent.rag.statVectors")})]}),(0,s.jsxs)("div",{className:"ragm-stat",children:[(0,s.jsxs)("div",{className:"rs-n",children:[(r/1e3).toFixed(1),"k"]}),(0,s.jsx)("div",{className:"rs-l",children:a("agent.rag.statTokens")})]})]}),(0,s.jsxs)("div",{className:"ragm-canvas",children:[(0,s.jsx)("svg",{className:"ragm-svg",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:o.map((e,a)=>(0,s.jsx)("line",{x1:"50",y1:"50",x2:e.x,y2:e.y,stroke:e.color,strokeOpacity:"0.28",strokeWidth:"0.4",vectorEffect:"non-scaling-stroke"},a))}),(0,s.jsx)("div",{className:"ragm-core",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"rc-t",children:"RAG"}),(0,s.jsx)("div",{className:"rc-s",children:a("agent.rag.coreDocs",{n:e.length})})]})}),o.map((e,a)=>(0,s.jsx)("div",{className:"ragm-node",style:{left:e.x+"%",top:e.y+"%",width:e.sz,height:e.sz,background:e.color,boxShadow:"0 0 8px "+e.color+"66"},onMouseEnter:()=>n({x:e.x,y:e.y,name:e.name,chunks:e.chunks}),onMouseLeave:()=>n(null)},a)),l&&(0,s.jsxs)("div",{className:"ragm-tip",style:{left:l.x+"%",top:l.y+"%"},children:[(0,s.jsx)("div",{className:"tt-t",children:l.name}),(0,s.jsx)("div",{className:"tt-s",children:a("agent.rag.tipChunks",{n:l.chunks,tok:120*l.chunks})})]}),0===o.length&&(0,s.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",color:"var(--text-faint)",fontSize:12.5},children:a("agent.rag.nothingIndexed")}),(0,s.jsx)("div",{className:"ragm-legend",children:d.map(e=>(0,s.jsxs)("div",{className:"lg",children:[(0,s.jsx)("span",{className:"dot",style:{background:e.color}})," ",a(`agent.rag.src.${e.key}`)]},e.key))})]}),(0,s.jsx)("div",{className:"ragm-docs",children:e.slice().sort((e,a)=>a.chunks-e.chunks).slice(0,24).map((e,l)=>{let t=C[e.source]??C.repo;return(0,s.jsxs)("div",{className:"ragm-doc",children:[(0,s.jsx)("span",{className:"src-chip",style:{background:t.color+"22",color:t.color},children:a(`agent.rag.src.${e.source}`)}),(0,s.jsx)("span",{className:"rd-t",children:e.path}),(0,s.jsx)("div",{className:"rd-bar",children:(0,s.jsx)("i",{style:{width:Math.min(100,4*e.chunks)+"%",background:t.color}})}),(0,s.jsx)("span",{className:"rd-chunks",children:a("agent.rag.chunksAbbr",{n:e.chunks})})]},l)})})]})}function I(e){let a,l,i,g,b=(0,f.k)(),[y,C]=(0,t.useState)("model"),[I,M]=(0,t.useState)(e.image??null),[z,_]=(0,t.useState)(e.adapter),[R,P]=(0,t.useState)(e.model),[L,A]=(0,t.useState)(e.temperature),[T,E]=(0,t.useState)(e.dailyCapUsd),[U,D]=(0,t.useState)(e.tierFloor),[G,W]=(0,t.useState)(e.persona.identity),[F,O]=(0,t.useState)(e.persona.ritual),[$,B]=(0,t.useState)(e.persona.tone),[q,H]=(0,t.useState)(e.persona.systemPrompt),[K,V]=(0,t.useState)(new Set(e.enabledIds)),[Y,J]=(0,t.useState)(""),[Q,X]=(0,t.useTransition)(),[Z,ee]=(0,t.useState)(e.rag),[ea,el]=(0,t.useState)(!1),[es,et]=(0,t.useState)(""),[en,ei]=(0,t.useState)(""),[er,eo]=(0,t.useState)(!1),[ed,ec]=(0,t.useState)(!1),[em,eu]=(0,t.useState)(""),[ep,eg]=(0,t.useState)(""),[eh,ev]=(0,t.useState)("all");function ex(e){J(e),setTimeout(()=>J(""),1500)}function ef(a){ee(a),X(async()=>{await o(e.agentId,a),ex(b("agent.flash.ragSaved"))})}function eb(){em.trim()&&(ef({...Z,external:!0,sources:[...Z.sources??[],em.trim()]}),eu(""),ec(!1))}function ej(){X(async()=>{eo(!1),ei(b("agent.model.pulling"));let e=await (0,p.j)(es.trim());e.ok?(_("local_ollama"),P(es.trim()),el(!1),et(""),ei(""),ex(b("agent.flash.modelPulled"))):(eo(!0),ei(e.error??b("agent.model.pullFailed")))})}function ek(a){V(a?new Set(e.skills.map(e=>e.id)):new Set),X(()=>u(e.agentId,a))}return(0,t.useEffect)(()=>{C("model"),_(e.adapter),P(e.model),A(e.temperature),E(e.dailyCapUsd),D(e.tierFloor),W(e.persona.identity),O(e.persona.ritual),B(e.persona.tone),H(e.persona.systemPrompt),V(new Set(e.enabledIds)),ee(e.rag),J(""),el(!1),ec(!1),et(""),ei(""),eo(!1),eu(""),eg(""),ev("all")},[e.agentId]),(0,s.jsxs)("div",{className:"as-detail",children:[(0,s.jsx)("div",{className:"as-head",children:(0,s.jsxs)("div",{className:"as-hero",children:[(0,s.jsx)(c.n,{name:e.name,color:e.color,image:I,size:48,onChange:a=>{M(a),X(()=>d(e.agentId,a))}}),(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsxs)("div",{className:"ah-name",children:[e.name," ",(0,s.jsxs)("span",{className:"agent-handle",children:["@",e.handle]})]}),(0,s.jsxs)("div",{className:"ah-sub",children:[e.role," \xb7 ",b("agent.reportsTo",{who:e.reportsTo?"@"+e.reportsTo:"—"})]})]}),(0,s.jsx)("span",{className:"pill",style:{background:"var(--bg-active)",color:"var(--text-dim)"},children:b(`agent.status.${e.status}`)})]})}),(0,s.jsxs)("div",{className:"as-tabs",children:[k.map(e=>(0,s.jsx)("button",{className:"as-tab"+(y===e?" on":""),onClick:()=>C(e),children:b(`agent.tab.${e}`)},e)),Y&&(0,s.jsxs)("span",{className:"oauth-ok",style:{marginLeft:"auto",padding:"4px 10px",fontSize:11.5},children:[(0,s.jsx)(h.I,{name:"check",size:12})," ",Y]})]}),(0,s.jsxs)("div",{className:"as-body scroll",children:["model"===y&&(0,s.jsxs)("div",{style:{maxWidth:1080},children:[(0,s.jsxs)("div",{className:"set-grid",children:[(0,s.jsxs)("div",{className:"form-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.model.provider")}),(0,s.jsx)(v.m,{glyph:!0,mono:!0,value:z,options:e.providerOpts,onChange:_})]}),(0,s.jsxs)("div",{className:"form-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.model.model")}),(0,s.jsx)(x.Y,{adapter:z,value:R,onChange:P,providers:e.providers}),(0,s.jsx)("div",{className:"form-hint",style:{justifyContent:"space-between"},children:(0,s.jsxs)("span",{children:[(0,s.jsx)(h.I,{name:"cpu",size:12})," ",b("agent.model.runnerHint")]})})]})]}),(0,s.jsx)("div",{className:"persona-field",style:{marginTop:14},children:(0,s.jsx)(N,{value:L,onChange:A})}),(0,s.jsxs)("div",{className:"set-grid",style:{marginTop:4},children:[(0,s.jsxs)("div",{className:"form-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.model.dailyCap")}),(0,s.jsx)("input",{className:"form-input mono",value:"$"+T,onChange:e=>E(Math.max(0,parseFloat(e.target.value.replace(/[^0-9.]/g,""))||0))})]}),(0,s.jsxs)("div",{className:"form-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.model.tierFloor")}),(0,s.jsx)(v.m,{value:U,options:["light","heavy","critical"].map(e=>({value:e,label:b(`agent.tier.${e}`)})),onChange:D})]})]}),(0,s.jsxs)("div",{className:"card",style:{marginTop:14},children:[(0,s.jsx)("div",{className:"detail-label",children:b("agent.model.budgetToday")}),(0,s.jsx)(S,{spent:e.spentToday,cap:T}),(0,s.jsx)("div",{className:"modal-hint",children:b("agent.model.budgetHint")})]}),(0,s.jsxs)("div",{className:"onb-foot",style:{gap:8},children:[(0,s.jsxs)("button",{className:"btn-ghost",onClick:()=>el(!0),children:[(0,s.jsx)(h.I,{name:"add",size:13})," ",b("agent.model.uploadPull")]}),(0,s.jsxs)("button",{className:"btn-accent",disabled:Q,onClick:function(){X(async()=>{await (0,n.k)(e.agentId,{adapter:z,model:R,temperature:L,dailyCapUsd:T,tierFloor:U}),ex(b("agent.flash.modelSaved"))})},children:[(0,s.jsx)(h.I,{name:"check",size:13})," ",b("agent.model.saveModel")]})]})]}),"skills"===y&&(a=[...new Set(e.skills.map(e=>e.category))].sort(),l=e=>e.charAt(0).toUpperCase()+e.slice(1),i=ep.trim().toLowerCase(),g=e.skills.filter(e=>("all"===eh||e.category===eh)&&(!i||e.name.toLowerCase().includes(i))),(0,s.jsxs)("div",{style:{maxWidth:1080},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:10,gap:10},children:[(0,s.jsxs)("div",{className:"set-desc",style:{margin:0},children:[b("agent.skills.desc")," ",(0,s.jsxs)("span",{style:{color:"var(--text-faint)"},children:["\xb7 ",b("agent.skills.onCount",{on:K.size,total:e.skills.length})]})]}),(0,s.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:6},children:[(0,s.jsxs)("button",{className:"btn-ghost",onClick:()=>ek(!0),disabled:0===e.skills.length||K.size===e.skills.length,children:[(0,s.jsx)(h.I,{name:"check",size:12})," ",b("common.enableAll")]}),(0,s.jsxs)("button",{className:"btn-ghost",onClick:()=>ek(!1),disabled:0===K.size,children:[(0,s.jsx)(h.I,{name:"close",size:12})," ",b("common.disableAll")]})]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[(0,s.jsxs)("div",{className:"cs-bar",style:{flex:1,minWidth:220,margin:0},children:[(0,s.jsx)(h.I,{name:"search",size:13}),(0,s.jsx)("input",{value:ep,onChange:e=>eg(e.target.value),placeholder:b("agent.skills.search")}),ep&&(0,s.jsx)("button",{className:"ss-clear",onClick:()=>eg(""),children:(0,s.jsx)(h.I,{name:"close",size:12})})]}),(0,s.jsx)(v.m,{value:eh,options:[{value:"all",label:b("agent.skills.allCategories")},...a.map(e=>({value:e,label:l(e)}))],onChange:ev}),(0,s.jsx)("span",{style:{fontSize:11,color:"var(--text-faint)",whiteSpace:"nowrap"},children:b("agent.skills.shownCount",{shown:g.length,total:e.skills.length})})]}),g.map(a=>(0,s.jsxs)("div",{className:"skill-pick",children:[(0,s.jsx)(h.I,{name:"skill",size:15,style:{color:"var(--accent)"}}),(0,s.jsx)("div",{className:"sp-main",children:(0,s.jsxs)("div",{className:"sr-title mono",style:{fontSize:12.5},children:[a.name," ",a.provisional&&(0,s.jsx)("span",{className:"pill",style:{background:"var(--sx-number)22",color:"var(--sx-number)"},children:b("agent.skills.provisional")})]})}),(0,s.jsx)("span",{className:"pill",style:{background:"var(--bg-active)",color:"var(--text-faint)",fontSize:10},children:l(a.category)}),(0,s.jsx)("div",{className:"toggle"+(K.has(a.id)?" on":""),onClick:()=>{var l;let s;return l=a.id,s=!K.has(l),void(V(e=>{let a=new Set(e);return s?a.add(l):a.delete(l),a}),X(()=>m(e.agentId,l,s)))}})]},a.id)),0===e.skills.length&&(0,s.jsx)("div",{className:"muted",style:{fontSize:12.5,padding:"8px 0"},children:b("agent.skills.empty")}),e.skills.length>0&&0===g.length&&(0,s.jsx)("div",{className:"muted",style:{fontSize:12.5,padding:"8px 0"},children:b("agent.skills.noMatch")})]})),"persona"===y&&(0,s.jsxs)("div",{style:{maxWidth:1080},children:[(0,s.jsxs)("div",{className:"persona-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.persona.identity")}),(0,s.jsx)("textarea",{className:"persona-ta",value:G,onChange:e=>W(e.target.value)})]}),(0,s.jsxs)("div",{className:"persona-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.persona.ritual")}),(0,s.jsx)("textarea",{className:"persona-ta",value:F,onChange:e=>O(e.target.value)})]}),(0,s.jsx)("div",{className:"set-grid",style:{marginBottom:16},children:(0,s.jsxs)("div",{className:"form-field",children:[(0,s.jsx)("label",{className:"form-label",children:b("agent.persona.tone")}),(0,s.jsx)(v.m,{value:$,options:["Executive","Friendly","Direct","Rigorous","Precise","Calm","Clear","Warm","Measured"].map(e=>({value:e,label:b(`agent.tone.${e}`)})),onChange:B})]})}),(0,s.jsxs)("div",{className:"persona-field",children:[(0,s.jsxs)("label",{className:"form-label",children:[b("agent.persona.systemPrompt")," ",(0,s.jsx)("span",{style:{color:"var(--text-faint)",fontWeight:400},children:"\xb7 .md"})]}),(0,s.jsx)("textarea",{className:"persona-ta mono",rows:6,value:q,onChange:e=>H(e.target.value)}),(0,s.jsxs)("div",{className:"modal-hint",children:[b("agent.persona.storedAsPrefix")," ",(0,s.jsxs)("b",{children:[".claude/agents/",e.handle,"/SYSTEM.md"]})," ",b("agent.persona.storedAsSuffix")]})]}),(0,s.jsx)("div",{className:"onb-foot",children:(0,s.jsxs)("button",{className:"btn-accent",disabled:Q,onClick:function(){X(async()=>{await r(e.agentId,{identity:G,ritual:F,tone:$,systemPrompt:q}),ex(b("agent.flash.personaSaved"))})},children:[(0,s.jsx)(h.I,{name:"check",size:13})," ",b("agent.persona.save")]})})]}),"rag"===y&&(0,s.jsxs)("div",{style:{maxWidth:1080},children:[(0,s.jsx)(w,{docs:e.ragDocs}),(0,s.jsxs)("div",{className:"set-desc",style:{marginTop:16,display:"flex",alignItems:"center"},children:[(0,s.jsx)("span",{children:b("agent.rag.sourcesDesc")}),(0,s.jsxs)("button",{className:"btn-ghost",style:{marginLeft:"auto",padding:"5px 11px"},onClick:()=>ec(!0),children:[(0,s.jsx)(h.I,{name:"add",size:12})," ",b("agent.rag.addSource")]})]}),[{k:"repo",name:b("agent.rag.row.repo"),desc:b("agent.rag.row.repoDesc",{n:e.fileCount})},{k:"room",name:b("agent.rag.row.room"),desc:b("agent.rag.row.roomDesc")},{k:"reports",name:b("agent.rag.row.reports"),desc:b("agent.rag.row.reportsDesc")},{k:"skills",name:b("agent.rag.row.skills"),desc:b("agent.rag.row.skillsDesc",{n:e.skills.length})},{k:"external",name:b("agent.rag.row.external"),desc:Z.sources?.length?b(1===Z.sources.length?"agent.rag.sourcesConnected.one":"agent.rag.sourcesConnected.other",{n:Z.sources.length}):b("agent.rag.row.externalOff")}].map(e=>(0,s.jsxs)("div",{className:"skill-pick",children:[(0,s.jsx)(h.I,{name:"doc",size:15,style:{color:"var(--accent)"}}),(0,s.jsxs)("div",{className:"sp-main",children:[(0,s.jsx)("div",{className:"sr-title",children:e.name}),(0,s.jsx)("div",{className:"sr-sub",children:e.desc})]}),(0,s.jsx)("div",{className:"toggle"+(Z[e.k]?" on":""),onClick:()=>{var a;return a=e.k,void ef({...Z,[a]:!Z[a]})}})]},e.k)),(Z.sources??[]).map((e,a)=>(0,s.jsxs)("div",{className:"skill-pick",style:{paddingLeft:28},children:[(0,s.jsx)(h.I,{name:"goto",size:13,style:{color:"var(--text-faint)"}}),(0,s.jsx)("div",{className:"sp-main",children:(0,s.jsx)("div",{className:"sr-title mono",style:{fontSize:12},children:e})}),(0,s.jsx)("button",{className:"iact danger",title:b("agent.rag.removeSource"),onClick:()=>ef({...Z,sources:(Z.sources??[]).filter((e,l)=>l!==a)}),children:(0,s.jsx)(h.I,{name:"trash",size:13})})]},"src-"+a)),(0,s.jsx)("div",{className:"modal-hint",style:{marginTop:10},children:b("agent.rag.toggleHint")})]}),"workflow"===y&&(0,s.jsxs)("div",{style:{maxWidth:1080},children:[(0,s.jsx)(j,{agentId:e.agentId}),(0,s.jsx)("div",{className:"set-desc",children:b("agent.workflow.intro",{name:e.name})}),[b("agent.workflow.step1",{path:`.claude/agents/${e.handle}/SYSTEM.md`}),b("agent.workflow.step2",{cli:z.startsWith("cli_codex")?"Codex":"Claude Code"}),b("agent.workflow.step3"),b("agent.workflow.step4"),b("agent.workflow.step5")].map((e,a)=>(0,s.jsxs)("div",{className:"skill-pick",children:[(0,s.jsx)("span",{style:{width:22,height:22,borderRadius:"50%",background:"var(--bg-active)",color:"var(--accent)",display:"grid",placeItems:"center",fontSize:11,fontWeight:800,flex:"0 0 22px"},children:a+1}),(0,s.jsx)("div",{className:"sp-main",children:(0,s.jsx)("div",{className:"sr-title",style:{fontWeight:500,fontSize:13},children:e})})]},a))]})]}),ea&&(0,s.jsx)("div",{className:"modal-overlay",onMouseDown:()=>el(!1),children:(0,s.jsxs)("div",{className:"modal",style:{padding:"20px 22px",width:460,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:4},children:b("agent.pullModal.title")}),(0,s.jsxs)("div",{className:"set-desc",style:{marginBottom:12},children:[b("agent.pullModal.descPrefix")," ",(0,s.jsx)("span",{className:"mono",children:"qwen2.5-coder:7b"}),b("agent.pullModal.descSuffix",{name:e.name})]}),(0,s.jsx)("input",{className:"form-input mono",autoFocus:!0,placeholder:b("agent.pullModal.placeholder"),value:es,onChange:e=>et(e.target.value),onKeyDown:e=>{"Enter"===e.key&&es.trim()&&ej()}}),en&&(0,s.jsx)("div",{style:{fontSize:11.5,color:er?"var(--sx-keyword)":"var(--sx-string)",marginTop:8},children:en}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,s.jsx)("button",{className:"btn-ghost",onClick:()=>el(!1),children:b("common.cancel")}),(0,s.jsxs)("button",{className:"btn-accent",disabled:!es.trim()||Q,onClick:ej,children:[(0,s.jsx)(h.I,{name:"add",size:13})," ",b("agent.pullModal.pullAssign")]})]})]})}),ed&&(0,s.jsx)("div",{className:"modal-overlay",onMouseDown:()=>ec(!1),children:(0,s.jsxs)("div",{className:"modal",style:{padding:"20px 22px",width:460,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:4},children:b("agent.addSrcModal.title")}),(0,s.jsx)("div",{className:"set-desc",style:{marginBottom:12},children:b("agent.addSrcModal.desc")}),(0,s.jsx)("input",{className:"form-input mono",autoFocus:!0,placeholder:b("agent.addSrcModal.placeholder"),value:em,onChange:e=>eu(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eb()}}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,s.jsx)("button",{className:"btn-ghost",onClick:()=>ec(!1),children:b("common.cancel")}),(0,s.jsxs)("button",{className:"btn-accent",disabled:!em.trim(),onClick:eb,children:[(0,s.jsx)(h.I,{name:"check",size:13})," ",b("agent.rag.addSource")]})]})]})})]})}},3198:(e,a,l)=>{"use strict";l.d(a,{A:()=>t});var s=l(7814);let t=(0,s.createServerReference)("40383cad7813d19d1b7fb6247022228ce67cf6dec0",s.callServer,void 0,s.findSourceMapURL,"listCatalogModels")},3728:(e,a,l)=>{"use strict";l.d(a,{m:()=>o});var s=l(5076),t=l(8488),n=l(8576),i=l(9265),r=l(5629);function o({value:e,options:a,onChange:l,placeholder:d,mono:c,glyph:m,disabled:u,searchable:p}){let g=(0,r.k)(),[h,v]=(0,t.useState)(!1),[x,f]=(0,t.useState)(""),b=(0,t.useRef)(null),j=(0,t.useRef)(null),k=(0,t.useMemo)(()=>(a||[]).map(e=>"string"==typeof e?{value:e,label:e}:e),[a]),y=k.find(a=>a.value===e),N=(p??k.length>8)&&!u,S=x.trim().toLowerCase(),C=N&&S?k.filter(e=>(e.label+" "+e.value+" "+(e.sub||"")).toLowerCase().includes(S)):k;return(0,t.useEffect)(()=>{if(!h)return void f("");function e(e){b.current&&!b.current.contains(e.target)&&v(!1)}function a(e){"Escape"===e.key&&v(!1)}return document.addEventListener("mousedown",e),document.addEventListener("keydown",a),N&&requestAnimationFrame(()=>j.current?.focus()),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",a)}},[h,N]),(0,s.jsxs)("div",{className:"dd"+(h?" open":"")+(u?" disabled":""),ref:b,children:[(0,s.jsxs)("button",{type:"button",className:"dd-btn"+(c?" mono":""),onClick:()=>!u&&v(e=>!e),children:[m&&y&&(0,s.jsx)(i.W,{id:y.glyphId||y.value,size:20}),(0,s.jsx)("span",{className:"dd-val",children:y?y.label:(0,s.jsx)("span",{className:"dd-ph",children:d||g("common.selectEllipsis")})}),(0,s.jsx)(n.I,{name:"chevronDown",size:14})]}),h&&(0,s.jsxs)("div",{className:"dd-menu scroll",children:[N&&(0,s.jsxs)("div",{style:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:6,padding:"6px 8px",margin:"-4px -4px 4px",background:"var(--bg-elev, var(--bg-active))",borderBottom:"1px solid var(--border)"},children:[(0,s.jsx)(n.I,{name:"search",size:13}),(0,s.jsx)("input",{ref:j,value:x,placeholder:g("common.searchEllipsis"),onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"===e.key&&C[0]?(l(C[0].value),v(!1)):"Escape"===e.key&&x&&(e.stopPropagation(),f(""))},className:c?"mono":void 0,style:{flex:1,minWidth:0,background:"transparent",border:"none",outline:"none",color:"var(--text)",fontSize:12.5,fontFamily:c?"var(--mono-font)":"inherit"}}),x&&(0,s.jsx)("button",{type:"button",title:g("common.clear"),onClick:()=>{f(""),j.current?.focus()},style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",display:"flex",padding:0},children:(0,s.jsx)(n.I,{name:"close",size:12})})]}),0===k.length&&(0,s.jsx)("div",{className:"dd-empty",children:g("common.noOptions")}),k.length>0&&0===C.length&&(0,s.jsx)("div",{className:"dd-empty",children:g("dropdown.noMatch",{q:x})}),C.map(a=>(0,s.jsxs)("button",{type:"button",className:"dd-opt"+(a.value===e?" on":""),onClick:()=>{l(a.value),v(!1)},children:[m&&(0,s.jsx)(i.W,{id:a.glyphId||a.value,size:22}),(0,s.jsxs)("span",{className:"dd-opt-main",children:[(0,s.jsx)("span",{className:"dd-opt-label"+(c?" mono":""),children:a.label}),a.sub&&(0,s.jsx)("span",{className:"dd-opt-sub",children:a.sub})]}),a.tag&&(0,s.jsx)("span",{className:"dd-opt-tag",children:a.tag}),a.value===e&&(0,s.jsx)(n.I,{name:"check",size:13})]},a.value))]})]})}},4403:(e,a,l)=>{"use strict";l.d(a,{Y:()=>m});var s=l(5076),t=l(8488),n=l(3728),i=l(5629);let r={cli_claude_code:[{value:"opus",label:"Claude Opus \xb7 most capable"},{value:"sonnet",label:"Claude Sonnet \xb7 balanced"},{value:"haiku",label:"Claude Haiku \xb7 fast"}],cli_codex:[{value:"gpt-5-codex",label:"GPT-5 Codex"},{value:"o4-mini",label:"o4-mini"}],cli_gemini:[{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro"},{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash"}],cli_openclaw:[{value:"(default)",label:"Configured default"},{value:"openai/gpt-5.4",label:"OpenAI \xb7 GPT-5.4"},{value:"anthropic/claude-sonnet-4",label:"Anthropic \xb7 Claude Sonnet 4"}],cli_hermes:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4.6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.5",label:"OpenAI \xb7 GPT-5.5"}],cli_aider:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4-6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.2",label:"OpenAI \xb7 GPT-5.2"},{value:"deepseek/deepseek-chat",label:"DeepSeek \xb7 Chat"}],cli_opencode:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4-6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.2",label:"OpenAI \xb7 GPT-5.2"}],cli_copilot:[{value:"(default)",label:"Configured default"},{value:"claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{value:"gpt-5",label:"GPT-5"}],cli_cursor:[{value:"(default)",label:"Configured default"},{value:"claude-4.5-sonnet",label:"Claude Sonnet 4.5"},{value:"gpt-5",label:"GPT-5"}],cli_cline:[{value:"(default)",label:"Configured default"}],cli_kilo:[{value:"(default)",label:"Configured default"}]};var o=l(6517),d=l(3198),c=l(9572);function m({adapter:e,value:a,onChange:l,providers:u}){let p=(0,i.k)(),g=function(e){let a=r[e]??null;if(!a)return null;let l=(0,o.L2)(e);return l?a.map(e=>{let a=l.find(a=>a.id===e.value);return a?{value:e.value,label:`${a.label} ${a.version}${a.note?" \xb7 "+a.note:""}`}:e}):a}(e),h=e.startsWith("local_"),[v,x]=(0,t.useState)(null),[f,b]=(0,t.useState)(""),j=u.find(a=>a.adapter===e);(0,t.useEffect)(()=>{if(g||h||!j){x(null),b(g||h?"":p("modelpicker.connectProvider"));return}let e=!0;return b(p("modelpicker.loading")),(0,d.A)(j.id).then(async({models:s})=>{if(!e)return;if(s.length){if(x(s.map(e=>{let a;return{value:e.id,label:e.name+(a=[],e.context&&a.push(e.context>=1e6?`${(e.context/1e6).toFixed(e.context%1e6?1:0)}M ctx`:`${Math.round(e.context/1e3)}K ctx`),(e.inputCost||e.outputCost)&&a.push(`$${e.inputCost}/${e.outputCost}`),a.length?" \xb7 "+a.join(" \xb7 "):"")+(e.isDefault?" \xb7 "+p("modelpicker.recommended"):"")}})),b(""),!a){let e=s.find(e=>e.isDefault)??s[0];e&&l(e.id)}return}let t=await (0,c.E)(j.id);e&&(x(t.models.map(e=>({value:e,label:e}))),b(t.error?t.error:t.models.length?p("modelpicker.syncProvider"):p("modelpicker.noModels")))}).catch(()=>{e&&(x([]),b(p("modelpicker.loadError")))}),()=>{e=!1}},[e,j?.id,!!g,h]);let k=h?[{value:a||"local",label:p("modelpicker.localGguf")}]:null,y=g??k??v??(a?[{value:a,label:a}]:[]),N=a&&!y.some(e=>e.value===a)?[{value:a,label:a},...y]:y;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.m,{mono:!0,value:a,options:N,placeholder:p("modelpicker.placeholder"),onChange:l}),f&&(0,s.jsx)("div",{className:"form-hint",style:{marginTop:4},children:f})]})}},4552:(e,a,l)=>{"use strict";l.d(a,{e:()=>t});var s=l(5076);function t({name:e,color:a,size:l=24,health:n,image:i}){let r=Math.max(6,Math.round(.3*l)),o=Math.round(.28*l),d=i?/^(data:|https?:|\/)/.test(i)?i:`/api/upload?path=${encodeURIComponent(i)}`:null;return(0,s.jsxs)("span",{style:{position:"relative",width:l,height:l,flex:`0 0 ${l}px`,display:"inline-block"},children:[d?(0,s.jsx)("img",{src:d,alt:e,width:l,height:l,style:{width:l,height:l,borderRadius:o,objectFit:"cover",display:"block"}}):(0,s.jsx)("span",{style:{width:l,height:l,borderRadius:o,background:a,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*l),fontWeight:700},children:(e[0]||"?").toUpperCase()}),n&&(0,s.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:r,height:r,borderRadius:"50%",background:"alive"===n?"var(--sx-string)":"stale"===n?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},5715:(e,a,l)=>{Promise.resolve().then(l.t.bind(l,3283,23)),Promise.resolve().then(l.bind(l,2035)),Promise.resolve().then(l.bind(l,6719)),Promise.resolve().then(l.bind(l,6588)),Promise.resolve().then(l.bind(l,4414)),Promise.resolve().then(l.bind(l,4226)),Promise.resolve().then(l.bind(l,4942)),Promise.resolve().then(l.bind(l,2444)),Promise.resolve().then(l.bind(l,5787))},6e3:(e,a,l)=>{"use strict";l.d(a,{j:()=>t});var s=l(7814);let t=(0,s.createServerReference)("40fcc0e1aa167e9f1f5273fbcfc48ea65c17d142a9",s.callServer,void 0,s.findSourceMapURL,"pullModel")},6517:(e,a,l)=>{"use strict";l.d(a,{L2:()=>t,Ov:()=>n});let s={cli_claude_code:[{id:"opus",label:"Claude Opus",version:"4.8",note:"most capable"},{id:"sonnet",label:"Claude Sonnet",version:"4.6",note:"balanced"},{id:"haiku",label:"Claude Haiku",version:"4.5",note:"fast"}],cli_codex:[{id:"gpt-5-codex",label:"GPT-5 Codex",version:"5"},{id:"o4-mini",label:"o4-mini",version:"o4"}],cli_gemini:[{id:"gemini-2.5-pro",label:"Gemini Pro",version:"2.5"},{id:"gemini-2.5-flash",label:"Gemini Flash",version:"2.5"}],cli_openclaw:[{id:"(default)",label:"OpenClaw",version:"default",note:"configured provider"},{id:"openai/gpt-5.4",label:"GPT",version:"5.4"},{id:"anthropic/claude-sonnet-4",label:"Claude Sonnet",version:"4"}],cli_hermes:[{id:"(default)",label:"Hermes",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4.6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.5",label:"GPT",version:"5.5"}],cli_aider:[{id:"(default)",label:"Aider",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.2",label:"GPT",version:"5.2"},{id:"deepseek/deepseek-chat",label:"DeepSeek Chat",version:""}],cli_opencode:[{id:"(default)",label:"OpenCode",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.2",label:"GPT",version:"5.2"}],cli_copilot:[{id:"(default)",label:"Copilot",version:"default",note:"configured provider"},{id:"claude-sonnet-4.5",label:"Claude Sonnet",version:"4.5"},{id:"gpt-5",label:"GPT",version:"5"}],cli_cursor:[{id:"(default)",label:"Cursor",version:"default",note:"configured provider"},{id:"claude-4.5-sonnet",label:"Claude Sonnet",version:"4.5"},{id:"gpt-5",label:"GPT",version:"5"}],cli_cline:[{id:"(default)",label:"Cline",version:"default",note:"configured provider"}],cli_kilo:[{id:"(default)",label:"Kilo Code",version:"default",note:"configured provider"}]};function t(e){return s[e]??null}function n(e){if(!e)return{label:"",version:""};let a=e.match(/(\d+(?:[.\-]\d+){0,2})(?!.*\d)/),l=a?a[1].replace(/-/g,"."):"";return{label:(a?e.slice(0,a.index).replace(/[-_.\s]+$/,""):e).split(/[-_.\s]+/).filter(Boolean).map(e=>/^(gpt|llm|api|ai)$/i.test(e)?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||e,version:l}}},8006:(e,a,l)=>{"use strict";l.d(a,{n:()=>o});var s=l(5076),t=l(8488),n=l(4552),i=l(8576),r=l(5629);function o({name:e,color:a,image:l,size:d=64,onChange:c}){let m=(0,r.k)(),u=(0,t.useRef)(null),[p,g]=(0,t.useState)(!1),[h,v]=(0,t.useState)(""),[,x]=(0,t.useTransition)();async function f(e){if(e){v(""),g(!0);try{let a=await function(e,a=160){return new Promise((l,s)=>{let t=URL.createObjectURL(e),n=new Image;n.onload=()=>{URL.revokeObjectURL(t);let e=Math.min(1,a/Math.max(n.width,n.height)),i=Math.max(1,Math.round(n.width*e)),r=Math.max(1,Math.round(n.height*e)),o=document.createElement("canvas");o.width=i,o.height=r;let d=o.getContext("2d");if(!d)return void s(Error("canvas unavailable"));d.drawImage(n,0,0,i,r);let c=o.toDataURL("image/webp",.85);c.startsWith("data:image/webp")||(c=o.toDataURL("image/jpeg",.85)),c.length>6e5&&(c=o.toDataURL("image/jpeg",.6)),l(c)},n.onerror=()=>{URL.revokeObjectURL(t),s(Error("invalid image"))},n.src=t})}(e);x(()=>c(a))}catch{v(m("chrome.avatar.processError"))}finally{g(!1),u.current&&(u.current.value="")}}}return(0,s.jsxs)("div",{className:"avatar-upload",children:[(0,s.jsx)(n.e,{name:e,color:a,image:l,size:d}),(0,s.jsxs)("div",{className:"avatar-upload-actions",children:[(0,s.jsxs)("button",{className:"btn-ghost",disabled:p,onClick:()=>u.current?.click(),children:[p?(0,s.jsx)("span",{className:"sync-spin",children:(0,s.jsx)(i.I,{name:"refresh",size:12})}):(0,s.jsx)(i.I,{name:"add",size:12})," ",l?m("chrome.avatar.change"):m("chrome.avatar.upload")]}),h&&(0,s.jsx)("span",{style:{fontSize:11,color:"#e8688f"},children:h}),(0,s.jsx)("input",{ref:u,type:"file",accept:".png,.jpg,.jpeg,.gif,.webp",hidden:!0,onChange:e=>f(e.target.files?.[0])})]})]})}},8670:(e,a,l)=>{"use strict";l.d(a,{k:()=>t});var s=l(7814);let t=(0,s.createServerReference)("6032fb7d29011580ccf74fba3b59c2dd3e048a4582",s.callServer,void 0,s.findSourceMapURL,"saveAgentModel")},9265:(e,a,l)=>{"use strict";l.d(a,{W:()=>r});var s=l(5076),t=l(8488);let n={anthropic:"anthropic",claude_code:"claude",openai:"openai",codex_cli:"openai",google:"google",google_gemini:"gemini",gemini_cli:"gemini",vertex_ai:"vertexai",mistral:"mistral",deepseek:"deepseek",cohere:"cohere",perplexity:"perplexity",xai_grok:"grok",groq:"groq",ai21:"ai21",nvidia_nim:"nvidia",huggingface:"huggingface",replicate:"replicate",azure_openai:"azure",aws_bedrock:"bedrock",cloudflare:"cloudflare",dashscope:"qwen",zhipu:"zhipu",moonshot:"moonshot",minimax:"minimax",together:"together",openrouter:"openrouter",fireworks:"fireworks",cerebras:"cerebras",ollama:"ollama",ollama_cli:"ollama",lmstudio:"lmstudio",vllm:"vllm",localai:"localai",elevenlabs:"elevenlabs",stability:"stability",jina:"jina",voyage:"voyage"},i={anthropic:["#d97757","An"],openai:["#10a37f","AI"],google_gemini:["#4285f4","G"],google:["#4285f4","G"],mistral:["#fa520f","Mi"],xai_grok:["#1a1a1a","X"],deepseek:["#4d6bfe","DS"],cohere:["#39594d","Co"],ai21:["#e8488a","A2"],perplexity:["#20808d","Px"],groq:["#f55036","Gq"],nvidia_nim:["#76b900","NV"],together:["#0f6fff","To"],fireworks:["#5019c5","Fw"],cerebras:["#f25733","Cb"],huggingface:["#ff9d00","HF"],replicate:["#1a1a1a","Rp"],openrouter:["#6566f1","OR"],litellm:["#00b8a3","LL"],portkey:["#3b5bdb","Pk"],azure_openai:["#0078d4","Az"],aws_bedrock:["#ff9900","Br"],vertex_ai:["#4285f4","Vx"],cloudflare:["#f38020","Cf"],dashscope:["#ff6a00","Qw"],zhipu:["#3859ff","GL"],moonshot:["#16162a","Ki"],minimax:["#e1342c","MM"],ollama:["#0c0c0c","Ol"],llamacpp:["#7a4ddb","Lc"],lmstudio:["#4a5cff","LM"],vllm:["#1668dc","vL"],localai:["#2e7d32","La"],gpt4all:["#5b6cff","G4"],jan:["#1a1a1a","Jn"],claude_code:["#d97757","CC"],codex_cli:["#10a37f","Cx"],gemini_cli:["#4285f4","Gc"],aider:["#14b8a6","Ad"],ollama_cli:["#0c0c0c","Oc"],openclaw:["#e8590c","OC"],hermes_cli:["#6d28d9","Hm"],opencode:["#1a1a1a","Oc"],copilot_cli:["#1f2328","Co"],cursor_cli:["#1a1a1a","Cu"],cline_cli:["#2563eb","Cl"],kilo_code:["#7c3aed","Ki"],voyage:["#5b21b6","Vo"],jina:["#ec4899","Ji"],stability:["#a855f7","St"],elevenlabs:["#1a1a1a","El"]};function r({id:e,size:a=34,radius:l}){let o,d=i[e],c=d?d[0]:"#5b6378",m=d?d[1]:(e||"?").slice(0,2).replace(/[^a-z0-9]/gi,"").toUpperCase(),u=(o=n[e])?`https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg/icons/${o}.svg`:null,[p,g]=(0,t.useState)(!1),h=null!=l?l:Math.round(.28*a),v=u&&!p,x=Math.round(.66*a);return(0,s.jsx)("span",{className:"prov-glyph",style:{width:a,height:a,flex:"0 0 "+a+"px",borderRadius:h,background:v?"#fff":"linear-gradient(150deg, "+c+", color-mix(in srgb, "+c+" 70%, #000))",color:"#fff",display:"grid",placeItems:"center",overflow:"hidden",fontSize:Math.round(.4*a),fontWeight:800,letterSpacing:"-.5px",boxShadow:v?"inset 0 0 0 1px rgba(0,0,0,.08)":"inset 0 1px 0 rgba(255,255,255,.18)"},children:v?(0,s.jsx)("img",{src:u,alt:"",width:x,height:x,loading:"lazy",onError:()=>g(!0),style:{width:x,height:x,objectFit:"contain",display:"block"}}):m})}},9572:(e,a,l)=>{"use strict";l.d(a,{E:()=>t});var s=l(7814);let t=(0,s.createServerReference)("409fd412f863bec5e83a51573dc91e19aa36f535b0",s.callServer,void 0,s.findSourceMapURL,"listProviderModels")}},e=>{e.O(0,[9219,3219,3448,8370,6646,6834,7358],()=>e(e.s=5715)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5125],{1618:(e,s,t)=>{"use strict";t.d(s,{CodeEditor:()=>v});var a=t(5076),n=t(8488),l=t(5629),i=t(8576),c=t(1716),o=t(7814);let r=(0,o.createServerReference)("60f875e834eee1c306cba8b6d88ce613f922eaa791",o.callServer,void 0,o.findSourceMapURL,"saveFileContent"),d=(0,o.createServerReference)("40fdc3a5b143e5077c8ad385ed7a829b0296c24d97",o.callServer,void 0,o.findSourceMapURL,"createFolder"),h=(0,o.createServerReference)("4009947deef1051f12ba98b50485ca18009408005b",o.callServer,void 0,o.findSourceMapURL,"createFile"),m=(0,o.createServerReference)("403aa68de6ac22a1339ee072a16cfc712ba42f2f1c",o.callServer,void 0,o.findSourceMapURL,"deleteFile"),p=(0,o.createServerReference)("400fd53521a37005a7d8ebc4f910b5491724a8ae6c",o.callServer,void 0,o.findSourceMapURL,"fileDiff"),x=(0,o.createServerReference)("60aee3b7a66fdfae1ac4c7978d4b33d1ae83ea85f9",o.callServer,void 0,o.findSourceMapURL,"grepWorkspace");function u(e,s){let t;if(!s)return e||"​";let n=[],l=0,i=0;for(s.lastIndex=0;t=s.exec(e);){if(0===t[0].length){s.lastIndex++;continue}t.index>l&&n.push(e.slice(l,t.index)),n.push((0,a.jsx)("mark",{children:t[0]},i++)),l=t.index+t[0].length}return l<e.length&&n.push(e.slice(l)),n.length?n:e||"​"}function j({path:e,onClose:s}){let t=(0,l.k)(),[c,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let s=!0;return p(e).then(e=>{s&&o(e.diff||t("codeedit.noDiff"))}),()=>{s=!1}},[e,t]),(0,a.jsx)("div",{className:"detail-overlay",onMouseDown:s,children:(0,a.jsxs)("div",{className:"detail-panel",style:{width:720,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"detail-head",children:(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,a.jsx)("span",{className:"view-title",style:{fontSize:14,fontFamily:"var(--mono-font)"},children:e}),(0,a.jsx)("button",{className:"dock-tool",onClick:s,children:(0,a.jsx)(i.I,{name:"close",size:15})})]})}),(0,a.jsx)("div",{className:"detail-body",children:null===c?(0,a.jsxs)("div",{className:"muted",children:[(0,a.jsx)("span",{className:"spin",children:(0,a.jsx)(i.I,{name:"refresh",size:13})})," ",t("codeedit.loadingDiff")]}):(0,a.jsx)("pre",{className:"scroll",style:{maxHeight:"60vh",overflow:"auto",fontFamily:"var(--mono-font)",fontSize:12,lineHeight:1.5,margin:0},children:c.split("\n").map((e,s)=>(0,a.jsx)("div",{style:{color:e.startsWith("+")&&!e.startsWith("+++")?"var(--sx-string)":e.startsWith("-")&&!e.startsWith("---")?"#e8688f":e.startsWith("@@")?"var(--accent)":"var(--text-dim)",whiteSpace:"pre-wrap"},children:e||"​"},s))})})]})})}let f=new Set(["import","from","export","const","let","var","function","return","if","else","for","while","async","await","type","interface","class","extends","implements","new","try","catch","finally","throw","switch","case","break","continue","default","of","in","typeof","instanceof","void","null","undefined","true","false","this","super","public","private","protected","readonly","static","enum","as","yield","do","then","def","lambda","with","pass","elif","None","True","False"]);function g({node:e,depth:s,expanded:t,selected:n,onToggle:o,onOpen:r,onDelete:d,gitStatus:h}){let m=(0,l.k)(),p=8+14*s;if("dir"===e.type){let l=t.has(e.path);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row dir",style:{paddingLeft:p},onClick:()=>o(e.path),children:[(0,a.jsx)("span",{className:"chev",children:(0,a.jsx)(i.I,{name:l?"chevronDown":"chevronRight",size:12})}),(0,a.jsx)("span",{className:"name",children:e.name}),(0,a.jsx)("button",{className:"row-del",title:m("codeedit.deleteFolderNamed",{name:e.name}),onClick:s=>{s.stopPropagation(),d(e.path,"dir")},children:(0,a.jsx)(i.I,{name:"close",size:12})})]}),l&&e.children.map(e=>(0,a.jsx)(g,{node:e,depth:s+1,expanded:t,selected:n,onToggle:o,onOpen:r,onDelete:d,gitStatus:h},e.path))]})}let x=h[e.path];return(0,a.jsxs)("div",{className:"row file"+(n===e.path?" selected":""),style:{paddingLeft:p},onClick:()=>r(e.path),children:[(0,a.jsx)("span",{className:"chev"}),(0,a.jsx)("span",{className:"fi",children:(0,a.jsx)(c.R,{name:e.name})}),(0,a.jsx)("span",{className:"name",style:x?{color:"U"===x?"var(--sx-number)":"var(--sx-type)"}:void 0,children:e.name}),x&&(0,a.jsx)("span",{className:"git-badge gstat "+x,children:x}),(0,a.jsx)("button",{className:"row-del",title:m("codeedit.deleteNamed",{name:e.name}),onClick:s=>{s.stopPropagation(),d(e.path,"file")},children:(0,a.jsx)(i.I,{name:"close",size:12})})]})}function v({files:e,repo:s,branch:t="workspace"}){let o,p=(0,l.k)(),N=(0,n.useMemo)(()=>(function(e){let s=[];for(let t of[...e].sort((e,s)=>e.path.localeCompare(s.path))){let e=t.path.split("/"),a=s,n="";e.forEach((s,l)=>{if(n=n?n+"/"+s:s,l===e.length-1)a.push({type:"file",name:s,path:t.path});else{let e=a.find(e=>"dir"===e.type&&e.path===n);e||(e={type:"dir",name:s,path:n,children:[]},a.push(e)),a=e.children}})}let t=e=>e.sort((e,s)=>e.type===s.type?e.name.localeCompare(s.name):"dir"===e.type?-1:1).map(e=>"dir"===e.type?{...e,children:t(e.children)}:e);return t(s)})(e),[e]),b=(0,n.useMemo)(()=>Object.fromEntries(e.filter(e=>e.gitStatus).map(e=>[e.path,e.gitStatus])),[e]),[y,w]=(0,n.useState)(()=>e[0]?[e[0].path]:[]),[S,k]=(0,n.useState)(e[0]?.path??null),[C,z]=(0,n.useState)("workspace"),[I,F]=(0,n.useState)(""),[R,P]=(0,n.useState)(!1),[M,W]=(0,n.useState)(!1),[D,E]=(0,n.useState)(!1),[T,L]=(0,n.useState)([]),[U,_]=(0,n.useState)(!1),[A,H]=(0,n.useState)(!1),[$,O]=(0,n.useState)(null),B=(0,n.useRef)(null),Z=(0,n.useMemo)(()=>"search"===C?function(e,s){if(!e||e.trim().length<1)return null;try{let t=s.regex?e:e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return s.wholeWord&&(t=`\\b(?:${t})\\b`),new RegExp(t,s.caseSensitive?"g":"gi")}catch{return null}}(I,{caseSensitive:R,wholeWord:M,regex:D}):null,[C,I,R,M,D]);(0,n.useEffect)(()=>{if("search"!==C||I.trim().length<2){L([]),H(!1);return}_(!0);let e=setTimeout(async()=>{try{let e=await x(I,{caseSensitive:R,wholeWord:M,regex:D});L(e.files),H(e.truncated)}finally{_(!1)}},250);return()=>clearTimeout(e)},[C,I,R,M,D]),(0,n.useEffect)(()=>{if(null==$)return;let e=B.current?.querySelector(`[data-line="${$}"]`);e?.scrollIntoView({block:"center",behavior:"smooth"})},[$,S]);let[J,q]=(0,n.useState)(!0),[K,V]=(0,n.useState)(()=>{let e=new Set;return N.forEach(s=>"dir"===s.type&&e.add(s.path)),e}),[X,Y]=(0,n.useState)(""),[G,Q]=(0,n.useState)(!1),[ee,es]=(0,n.useState)(!1),[et,ea]=(0,n.useState)("file"),[en,el]=(0,n.useState)(""),[ei,ec]=(0,n.useState)(null),[eo,er]=(0,n.useState)(null),[,ed]=(0,n.useTransition)(),eh=e.find(e=>e.path===S)??null;function em(e){V(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})}function ep(e){w(s=>s.includes(e)?s:[...s,e]),k(e),Q(!1)}function ex(e){w(s=>{let t=s.filter(s=>s!==e);return S===e&&k(t[t.length-1]??null),t})}let eu=Object.entries(b).map(([e,s])=>({path:e,st:s,name:e.split("/").pop()??e,dir:e.split("/").slice(0,-1).join("/")})),ej=eu.filter(e=>"A"===e.st),ef=eu.filter(e=>"A"!==e.st),eg=eh?eh.content.split("\n"):[];return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12},children:[(0,a.jsx)(i.I,{name:"git",size:15,style:{color:"var(--accent)"}}),(0,a.jsx)("span",{className:"mono",style:{fontWeight:700,fontSize:13},children:s}),(0,a.jsxs)("span",{className:"mono",style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,color:"var(--text-dim)"},children:[(0,a.jsx)(i.I,{name:"branch",size:11})," ",t]}),(0,a.jsxs)("div",{className:"seg",style:{marginLeft:"auto",width:380},children:[(0,a.jsxs)("button",{className:"seg-opt"+("workspace"===C?" on":""),onClick:()=>z("workspace"),children:[(0,a.jsx)(i.I,{name:"grid",size:12})," ",p("codeedit.workspace")]}),(0,a.jsxs)("button",{className:"seg-opt"+("search"===C?" on":""),onClick:()=>z("search"),children:[(0,a.jsx)(i.I,{name:"search",size:12})," ",p("common.search")]}),(0,a.jsxs)("button",{className:"seg-opt"+("git"===C?" on":""),onClick:()=>z("git"),children:[(0,a.jsx)(i.I,{name:"git",size:12})," ",p("codeedit.sourceControl"),eu.length>0?` \xb7 ${eu.length}`:""]})]})]}),(0,a.jsxs)("div",{className:"code-mod",children:[(0,a.jsx)("div",{className:"code-tree",children:"workspace"===C?(0,a.jsxs)(a.Fragment,{children:[y.length>0&&(0,a.jsxs)("div",{className:"open-editors",children:[(0,a.jsxs)("div",{className:"oe-head",children:[(0,a.jsxs)("span",{className:"tree-section-label",style:{padding:0,cursor:"pointer"},onClick:()=>q(e=>!e),children:[(0,a.jsx)(i.I,{name:J?"chevronDown":"chevronRight",size:12})," ",p("codeedit.openEditors")]}),(0,a.jsx)("span",{className:"oe-count",children:y.length}),(0,a.jsx)("button",{className:"side-act",title:p("codeedit.closeAll"),onClick:()=>{w([]),k(null)},children:(0,a.jsx)(i.I,{name:"close",size:13})})]}),J&&y.map(e=>(0,a.jsxs)("div",{className:"oe-row"+(e===S?" active":""),onClick:()=>ep(e),title:e,children:[(0,a.jsx)(c.R,{name:e.split("/").pop()??e}),(0,a.jsx)("span",{className:"oe-name",children:e.split("/").pop()}),(0,a.jsx)("button",{className:"oe-close",onClick:s=>{s.stopPropagation(),ex(e)},children:(0,a.jsx)(i.I,{name:"close",size:12})})]},e))]}),(0,a.jsxs)("div",{className:"tree-section-label",children:[(0,a.jsx)(i.I,{name:"chevronDown",size:12}),(0,a.jsx)("span",{style:{flex:1},children:s}),(0,a.jsx)("button",{className:"side-act",title:p("codeedit.newFile"),onClick:()=>{ea("file"),es(!0),el("")},children:(0,a.jsx)(i.I,{name:"newFile",size:14})}),(0,a.jsx)("button",{className:"side-act",title:p("codeedit.newFolder"),onClick:()=>{ea("folder"),es(!0),el("")},children:(0,a.jsx)(i.I,{name:"newFolder",size:14})})]}),0===e.length&&(0,a.jsx)("div",{className:"muted",style:{padding:12,fontSize:12},children:p("codeedit.noFilesYet")}),N.map(e=>(0,a.jsx)(g,{node:e,depth:0,expanded:K,selected:S,onToggle:em,onOpen:ep,onDelete:(e,s)=>ec({path:e,type:s}),gitStatus:b},e.path))]}):"search"===C?(0,a.jsxs)("div",{className:"code-search",children:[(0,a.jsxs)("div",{className:"cs-bar",children:[(0,a.jsx)(i.I,{name:"search",size:13}),(0,a.jsx)("input",{autoFocus:!0,placeholder:p("codeedit.searchFilesCode"),value:I,onChange:e=>F(e.target.value)}),I&&(0,a.jsx)("button",{className:"ss-clear",onClick:()=>F(""),children:(0,a.jsx)(i.I,{name:"close",size:12})})]}),(0,a.jsxs)("div",{className:"cs-toggles",children:[(0,a.jsx)("button",{className:"cs-tog"+(R?" on":""),title:p("codeedit.matchCase"),onClick:()=>P(e=>!e),children:"Aa"}),(0,a.jsx)("button",{className:"cs-tog"+(M?" on":""),title:p("codeedit.wholeWord"),onClick:()=>W(e=>!e),children:"ab"}),(0,a.jsx)("button",{className:"cs-tog"+(D?" on":""),title:p("codeedit.regex"),onClick:()=>E(e=>!e),children:".*"}),(0,a.jsx)("span",{className:"cs-count",children:U?"…":T.length?p("codeedit.matchesInFiles",{matches:T.reduce((e,s)=>e+s.matches.length,0),files:T.length}):""})]}),(0,a.jsxs)("div",{className:"cs-results scroll",children:[!U&&I.trim().length>=2&&0===T.length&&(0,a.jsx)("div",{className:"muted",style:{fontSize:12,padding:10},children:p("codeedit.noMatches")}),T.map(e=>(0,a.jsxs)("div",{className:"cs-file",children:[(0,a.jsxs)("div",{className:"cs-file-head",onClick:()=>ep(e.path),title:e.path,children:[(0,a.jsx)(c.R,{name:e.path.split("/").pop()??e.path}),(0,a.jsx)("span",{className:"cs-file-name"+(e.nameMatch?" name-hit":""),children:e.path}),(0,a.jsx)("span",{className:"cs-file-n",children:e.matches.length||(e.nameMatch?p("codeedit.nameMatch"):"")})]}),e.matches.slice(0,50).map((s,t)=>(0,a.jsxs)("div",{className:"cs-hit",onClick:()=>{ep(e.path),O(s.line)},children:[(0,a.jsx)("span",{className:"cs-ln",children:s.line}),(0,a.jsx)("span",{className:"cs-line",children:u(s.text,Z)})]},t))]},e.path)),A&&(0,a.jsx)("div",{className:"muted",style:{fontSize:11,padding:8},children:p("codeedit.truncatedHint")})]})]}):(0,a.jsxs)("div",{className:"git-panel",children:[(0,a.jsxs)("div",{className:"gh-repo",children:[(0,a.jsx)(i.I,{name:"git",size:14,style:{color:"var(--accent)"}}),(0,a.jsxs)("div",{className:"gh-repo-main",children:[(0,a.jsx)("div",{className:"gh-repo-name",children:s}),(0,a.jsxs)("div",{className:"gh-repo-branch",children:[(0,a.jsx)(i.I,{name:"branch",size:11})," ",t]})]})]}),0===eu.length?(0,a.jsx)("div",{className:"muted",style:{fontSize:12,padding:"10px 2px"},children:p("codeedit.noChanges")}):(0,a.jsxs)(a.Fragment,{children:[ej.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"git-group-label",children:p("codeedit.stagedChanges",{n:ej.length})}),ej.map(e=>(0,a.jsxs)("div",{className:"git-row",title:e.path,onClick:()=>ep(e.path),children:[(0,a.jsx)(c.R,{name:e.name}),(0,a.jsx)("span",{className:"gname",children:e.name}),(0,a.jsx)("span",{className:"gpath",children:e.dir}),(0,a.jsx)("button",{className:"iact",title:p("codeedit.viewDiff"),onClick:s=>{s.stopPropagation(),er(e.path)},children:(0,a.jsx)(i.I,{name:"git",size:12})}),(0,a.jsx)("span",{className:"gstat "+e.st,children:e.st})]},e.path))]}),(0,a.jsx)("div",{className:"git-group-label",children:p("codeedit.changes",{n:ef.length})}),ef.map(e=>(0,a.jsxs)("div",{className:"git-row",title:e.path,onClick:()=>ep(e.path),children:[(0,a.jsx)(c.R,{name:e.name}),(0,a.jsx)("span",{className:"gname",children:e.name}),(0,a.jsx)("span",{className:"gpath",children:e.dir}),(0,a.jsx)("button",{className:"iact",title:p("codeedit.viewDiff"),onClick:s=>{s.stopPropagation(),er(e.path)},children:(0,a.jsx)(i.I,{name:"git",size:12})}),(0,a.jsx)("span",{className:"gstat "+e.st,children:e.st})]},e.path)),(0,a.jsxs)("a",{href:"/github",className:"btn-ghost",style:{display:"inline-flex",gap:6,margin:"12px 8px"},children:[(0,a.jsx)(i.I,{name:"arrowUp",size:13})," ",p("codeedit.commitPush")]})]})]})}),(0,a.jsxs)("div",{className:"editor-wrap",children:[(0,a.jsx)("div",{className:"tabbar",children:y.map(e=>(0,a.jsxs)("div",{className:"tab"+(e===S?" active":""),onClick:()=>ep(e),title:e,children:[(0,a.jsx)(c.R,{name:e.split("/").pop()??e}),(0,a.jsx)("span",{className:"tname",children:e.split("/").pop()}),(0,a.jsx)("span",{className:"tclose",onClick:s=>{s.stopPropagation(),ex(e)},children:(0,a.jsx)(i.I,{name:"close",size:12})})]},e))}),eh?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"breadcrumb",children:eh.path.split("/").map((e,s,t)=>(0,a.jsxs)("span",{className:"crumb",children:[s>0&&(0,a.jsx)(i.I,{name:"chevronRight",size:11}),s===t.length-1?(0,a.jsx)(c.R,{name:e}):null," ",e]},s))}),(0,a.jsxs)("div",{className:"editor-toolbar",children:[(0,a.jsxs)("span",{className:"et-lang",children:[(0,a.jsx)(c.R,{name:eh.path.split("/").pop()??""})," ",eh.lang.toUpperCase()]}),(0,a.jsx)("span",{className:"et-spacer"}),(0,a.jsxs)("span",{className:"et-diag ok",children:[(0,a.jsx)(i.I,{name:"check",size:12})," ",p("codeedit.noProblems")]}),G?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"et-edit",onClick:()=>Q(!1),children:p("common.cancel")}),(0,a.jsxs)("button",{className:"et-edit on",onClick:()=>ed(async()=>{await r(eh.path,X),Q(!1)}),children:[(0,a.jsx)(i.I,{name:"check",size:12})," ",p("common.save")]})]}):(0,a.jsxs)("button",{className:"et-edit",onClick:()=>{Q(!0),Y(eh.content)},children:[(0,a.jsx)(i.I,{name:"command",size:12})," ",p("common.edit")]})]}),G?(0,a.jsx)("textarea",{className:"code-area",value:X,onChange:e=>Y(e.target.value),spellCheck:!1}):(0,a.jsxs)("div",{className:"editor-body",children:[(0,a.jsx)("div",{className:"editor-scroll",children:(0,a.jsx)("div",{className:"code",ref:B,children:eg.map((e,s)=>(0,a.jsxs)("div",{className:"code-line"+($===s+1?" search-hit":""),"data-line":s+1,children:[(0,a.jsx)("span",{className:"gutter",children:s+1}),(0,a.jsx)("span",{className:"line-content",children:Z?u(e,Z):""===e?"​":(function(e,s){let t=[],a="py"===s||"yaml"===s,n=0,l=/[A-Za-z0-9_$]/;for(;n<e.length;){let s=e[n];if("/"===s&&"/"===e[n+1]||"#"===s&&a){t.push({t:e.slice(n),c:"comment"});break}if('"'===s||"'"===s||"`"===s){let a=n+1;for(;a<e.length&&e[a]!==s;)"\\"===e[a]&&a++,a++;let l=Math.min(a+1,e.length);t.push({t:e.slice(n,l),c:"string"}),n=l;continue}if(s>="0"&&s<="9"&&!l.test(e[n-1]??" ")){let s=n;for(;s<e.length&&/[0-9.xXa-fA-F_]/.test(e[s]);)s++;t.push({t:e.slice(n,s),c:"number"}),n=s;continue}if(/[A-Za-z_$]/.test(s)){let s=n;for(;s<e.length&&l.test(e[s]);)s++;let a=e.slice(n,s);t.push({t:a,c:f.has(a)?"keyword":/^[A-Z]/.test(a)?"type":"plain"}),n=s;continue}t.push({t:s,c:/[{}()[\].,;]/.test(s)?"punct":/\s/.test(s)?"plain":"operator"}),n++}return t})(e,eh.lang).map((e,s)=>(0,a.jsx)("span",{className:"tok-"+e.c,children:e.t},s))})]},s))})}),(0,a.jsx)("div",{className:"minimap",children:(0,a.jsx)("div",{className:"minimap-inner",children:eg.map((e,s)=>(0,a.jsx)("div",{className:"mini-line",children:e||"\xa0"},s))})})]})]}):(0,a.jsx)("div",{className:"welcome",children:(0,a.jsxs)("div",{className:"welcome-inner",children:[(0,a.jsx)("div",{className:"welcome-logo",children:"⌘"}),(0,a.jsx)("div",{className:"welcome-sub",children:p("codeedit.welcomeSub")})]})})]})]}),ee&&(0,a.jsx)("div",{className:"modal-overlay",onMouseDown:()=>es(!1),children:(0,a.jsx)("div",{className:"modal",style:{padding:"20px 22px",width:440,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:(o=()=>ed(async()=>{let e=en.trim();"folder"===et?await d(e):(await h(e),ep(e.replace(/^\/+/,""))),es(!1)}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:10},children:"folder"===et?p("codeedit.newFolder"):p("codeedit.newFile")}),(0,a.jsx)("input",{className:"form-input mono",autoFocus:!0,placeholder:"folder"===et?p("codeedit.folderPathHint"):p("codeedit.filePathHint"),value:en,onChange:e=>el(e.target.value),onKeyDown:e=>{"Enter"===e.key&&en.trim()&&o()}}),(0,a.jsx)("div",{className:"muted",style:{fontSize:11.5,marginTop:8},children:"folder"===et?p("codeedit.folderCreateHint"):p("codeedit.fileCreateHint")}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,a.jsx)("button",{className:"btn-ghost",onClick:()=>es(!1),children:p("common.cancel")}),(0,a.jsx)("button",{className:"btn-accent",disabled:!en.trim(),onClick:o,children:p("common.create")})]})]}))})}),ei&&(0,a.jsx)("div",{className:"modal-overlay",onMouseDown:()=>ec(null),children:(0,a.jsxs)("div",{className:"modal",style:{padding:"20px 22px",width:440,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:10},children:"dir"===ei.type?p("codeedit.deleteFolder"):p("codeedit.deleteFile")}),(0,a.jsxs)("div",{style:{fontSize:13},children:[p("codeedit.deleteConfirmPrefix")," ",(0,a.jsx)("b",{className:"mono",style:{color:"var(--sx-keyword)"},children:ei.path}),p("codeedit.deleteConfirmSuffix")]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,a.jsx)("button",{className:"btn-ghost",onClick:()=>ec(null),children:p("common.cancel")}),(0,a.jsx)("button",{className:"btn-accent",onClick:()=>ed(async()=>{await m(ei.path),eh&&(eh.path===ei.path||eh.path.startsWith(ei.path+"/"))&&ex(eh.path),ec(null)}),children:p("common.delete")})]})]})}),eo&&(0,a.jsx)(j,{path:eo,onClose:()=>er(null)})]})}},1716:(e,s,t)=>{"use strict";t.d(s,{R:()=>n});var a=t(5076);function n({name:e}){let s={ts:{t:"TS",c:"#3178c6"},tsx:{t:"TS",c:"#3178c6"},js:{t:"JS",c:"#f0c000"},jsx:{t:"JS",c:"#f0c000"},json:{t:"{}",c:"#cbab35"},md:{t:"M↓",c:"#7d8590"},css:{t:"#",c:"#42a5f5"}}[e.split(".").pop()??""]||{t:"\xb7",c:"#7d8590"};return(0,a.jsx)("span",{style:{fontSize:9,fontWeight:700,fontFamily:"var(--mono-font, monospace)",color:s.c,lineHeight:1,letterSpacing:"-.5px"},children:s.t})}},7214:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,3283,23)),Promise.resolve().then(t.bind(t,1618)),Promise.resolve().then(t.bind(t,6719)),Promise.resolve().then(t.bind(t,6588)),Promise.resolve().then(t.bind(t,4414)),Promise.resolve().then(t.bind(t,4226)),Promise.resolve().then(t.bind(t,4942)),Promise.resolve().then(t.bind(t,2444)),Promise.resolve().then(t.bind(t,5787))}},e=>{e.O(0,[9219,3219,3448,8370,6646,6834,7358],()=>e(e.s=7214)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9530],{796:(e,s,a)=>{"use strict";a.d(s,{StackEditor:()=>m});var n=a(5076),i=a(8488),r=a(3730),c=a(7814);let l=(0,c.createServerReference)("40017b3238c697f9b9c19c60555f03ac19c02c3c81",c.callServer,void 0,c.findSourceMapURL,"setWorkspaceStack");var t=a(9562),o=a(973),d=a(8576);function m({stack:e}){let[s,a]=(0,i.useState)(()=>(0,t.T1)(e).stack),[c,v]=(0,i.useTransition)(),[f,p]=(0,i.useState)(!1),[g,h]=(0,i.useState)("");return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:"12px 16px"},children:r.z.map(e=>{let i=e.opts.includes("None")?e.opts:[...e.opts,"None"],r=(0,o.jX)(s[e.key]).filter(e=>"None"!==e);return(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,n.jsxs)("span",{style:{fontSize:11.5,color:"var(--text-dim)",fontWeight:600},children:[e.label,r.length>1&&(0,n.jsxs)("span",{style:{color:"var(--text-faint)",fontWeight:400},children:[" \xb7 ",r.length]})]}),(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5},children:i.map(i=>{let c=(0,t.YL)(s,e.key,i),l="None"===i?0===r.length:(0,o.Hn)(s[e.key],i);return(0,n.jsx)("button",{type:"button",disabled:!!c&&!l,onClick:()=>{var n;let r;(!c||l)&&(n=e.key,a((r=(0,t.T1)({...s,[n]:(0,o.P_)(s[n],i)})).stack),h(r.removed.map(e=>`${e.opt} was unselected automatically — ${e.reason}.`).join(" ")),p(!1))},title:c||i,style:{fontSize:12,padding:"4px 9px",borderRadius:999,cursor:c&&!l?"not-allowed":"pointer",border:"1px solid "+(l?"var(--accent)":"var(--border)"),background:l?"var(--accent)":"transparent",color:l?"#1a1206":c?"var(--text-faint)":"var(--text-dim)",opacity:c&&!l?.5:1},children:i},i)})})]},e.key)})}),g&&(0,n.jsxs)("div",{style:{fontSize:12,color:"var(--sx-number)",marginTop:10,display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)(d.I,{name:"warn",size:12})," ",g]}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:12},children:[(0,n.jsx)("button",{className:"btn-accent",disabled:c,onClick:function(){v(async()=>{await l(s),p(!0)})},children:c?"Saving…":"Save stack & reload skills"}),f&&(0,n.jsxs)("span",{style:{fontSize:12,color:"var(--sx-string)",display:"inline-flex",alignItems:"center",gap:5},children:[(0,n.jsx)(d.I,{name:"check",size:12})," Saved — agents re-linked to the new stack."]})]})]})}},4625:(e,s,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,4909)),Promise.resolve().then(a.bind(a,6465)),Promise.resolve().then(a.bind(a,796)),Promise.resolve().then(a.bind(a,6719)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,4226)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444)),Promise.resolve().then(a.bind(a,5787))},4909:(e,s,a)=>{"use strict";a.d(s,{AgentRuntimeSettings:()=>d,EditorSettings:()=>o});var n=a(5076),i=a(8488);a(8576);var r=a(5629),c=a(7814);let l=(0,c.createServerReference)("40a6060fb874f60b44df771fb597739925f977288c",c.callServer,void 0,c.findSourceMapURL,"setEditorSettings"),t=(0,c.createServerReference)("40abd24438718e3716663abfdcd665eb2c860b3eab",c.callServer,void 0,c.findSourceMapURL,"setAgentRuntime");function o({editor:e}){let s=(0,r.k)(),[a,c]=(0,i.useState)({tabSize:e?.tabSize??2,formatOnSave:e?.formatOnSave??!0,wordWrap:e?.wordWrap??!0,minimap:e?.minimap??!0}),[,t]=(0,i.useTransition)();function d(e){c(s=>({...s,...e})),t(()=>l(e))}let m=(e,s)=>(0,n.jsxs)("div",{className:"set-row",children:[(0,n.jsx)("div",{className:"sr-main",children:(0,n.jsx)("div",{className:"sr-title",children:s})}),(0,n.jsx)("div",{className:"toggle"+(a[e]?" on":""),onClick:()=>d({[e]:!a[e]})})]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"set-row",style:{paddingTop:0},children:[(0,n.jsx)("div",{className:"sr-main",children:(0,n.jsx)("div",{className:"sr-title",children:s("config.editor.tabSize")})}),(0,n.jsx)("div",{style:{display:"flex",gap:6},children:[2,4,8].map(e=>(0,n.jsx)("button",{className:"chip-sm",style:a.tabSize===e?{background:"var(--accent)",color:"var(--accent-fg)"}:void 0,onClick:()=>d({tabSize:e}),children:e},e))})]}),m("formatOnSave",s("config.editor.formatOnSave")),m("wordWrap",s("config.editor.wordWrap")),m("minimap",s("config.editor.minimap"))]})}function d({agents:e}){let s=(0,r.k)(),[a,c]=(0,i.useState)(e?.maxConcurrent??1),[l,o]=(0,i.useState)(!!e?.fileLocks),[m,v]=(0,i.useState)(e?.webResearch??!0),[,f]=(0,i.useTransition)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"set-row",style:{paddingTop:0},children:[(0,n.jsxs)("div",{className:"sr-main",children:[(0,n.jsx)("div",{className:"sr-title",children:s("config.agents.parallel")}),(0,n.jsx)("div",{className:"sr-sub",children:s("config.agents.parallelDesc")})]}),(0,n.jsx)("div",{style:{display:"flex",gap:6},children:[1,2,3,4,5].map(e=>(0,n.jsx)("button",{className:"chip-sm",style:a===e?{background:"var(--accent)",color:"var(--accent-fg)"}:void 0,onClick:()=>{c(e),f(()=>t({maxConcurrent:e}))},children:e},e))})]}),(0,n.jsxs)("div",{className:"set-row",children:[(0,n.jsxs)("div",{className:"sr-main",children:[(0,n.jsx)("div",{className:"sr-title",children:s("config.agents.fileLock")}),(0,n.jsx)("div",{className:"sr-sub",children:s("config.agents.fileLockDesc")})]}),(0,n.jsx)("div",{className:"toggle"+(l?" on":""),onClick:()=>{let e=!l;o(e),f(()=>t({fileLocks:e}))}})]}),a>1&&!l&&(0,n.jsxs)("div",{className:"sr-sub",style:{color:"#e8a14e",paddingBottom:6},children:["⚠ ",s("config.agents.lockWarn",{n:a})]}),(0,n.jsxs)("div",{className:"set-row",children:[(0,n.jsxs)("div",{className:"sr-main",children:[(0,n.jsx)("div",{className:"sr-title",children:s("config.agents.webResearch")}),(0,n.jsx)("div",{className:"sr-sub",children:s("config.agents.webResearchDesc")})]}),(0,n.jsx)("div",{className:"toggle"+(m?" on":""),onClick:()=>{let e=!m;v(e),f(()=>t({webResearch:e}))}})]})]})}},6465:(e,s,a)=>{"use strict";a.d(s,{ProjectSource:()=>o});var n=a(5076),i=a(8488),r=a(8576),c=a(7814);let l=(0,c.createServerReference)("000a998328f6e7c6c65913ce880c76e67b11f6e0cb",c.callServer,void 0,c.findSourceMapURL,"reanalyzeProject");var t=a(5629);function o({source:e}){let s=(0,t.k)(),[a,c]=(0,i.useTransition)(),[d,m]=(0,i.useState)(!1),v=e??{},f=v.type??"new",p="local"===f?s("config.source.local",{name:v.localPath??"—",n:v.fileCount??0}):"github"===f?s("config.source.github",{repo:v.repo??"—",n:v.fileCount??0}):s("mock"===f?"config.source.mock":"config.source.new");return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"kv",children:[(0,n.jsx)("span",{className:"k",children:s("config.source.active")}),(0,n.jsx)("span",{className:"v",children:p})]}),(0,n.jsxs)("div",{className:"kv",children:[(0,n.jsx)("span",{className:"k",children:s("config.source.dir")}),(0,n.jsx)("span",{className:"v lr-mono",style:{fontFamily:"var(--mono-font)",fontSize:11.5},children:"~/.constella/organizations/<org>/workspace"})]}),("local"===f||"github"===f||"mock"===f)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"kv",children:[(0,n.jsx)("span",{className:"k",children:s("config.source.analysis")}),(0,n.jsx)("span",{className:"v",children:s(v.analyzed?"config.source.analyzed":"config.source.notAnalyzed")})]}),(0,n.jsxs)("button",{className:"btn-ghost",disabled:a||d,style:{marginTop:8},onClick:()=>c(async()=>{m((await l()).ok)}),children:[(0,n.jsx)("span",{className:a?"sync-spin":"",style:{display:"inline-flex"},children:(0,n.jsx)(r.I,{name:"refresh",size:13})})," ",s(d?"config.source.reanalyzeQueued":"config.source.reanalyze")]})]})]})}}},e=>{e.O(0,[9219,3219,3448,8370,9562,6646,6834,7358],()=>e(e.s=4625)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9598],{2124:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3283,23)),Promise.resolve().then(n.bind(n,2161)),Promise.resolve().then(n.bind(n,6719)),Promise.resolve().then(n.bind(n,6588)),Promise.resolve().then(n.bind(n,4414)),Promise.resolve().then(n.bind(n,4226)),Promise.resolve().then(n.bind(n,4942)),Promise.resolve().then(n.bind(n,2444)),Promise.resolve().then(n.bind(n,5787))},2161:(e,s,n)=>{"use strict";n.d(s,{CapEditor:()=>d});var t=n(5076),a=n(8488),i=n(7814);let r=(0,i.createServerReference)("405be8ebe54ddf4f0356d95bf2cfde390f2a68aaae",i.callServer,void 0,i.findSourceMapURL,"setMonthlyCap");var o=n(8576),l=n(5629);function d({cap:e}){let s=(0,l.k)(),[n,i]=(0,a.useState)(e),[c,h]=(0,a.useState)(!1),[m,v]=(0,a.useTransition)();function p(){n!==e&&v(async()=>{await r(n),h(!0),setTimeout(()=>h(!1),1400)})}return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&(0,t.jsxs)("span",{className:"oauth-ok",style:{padding:"3px 8px",fontSize:11},children:[(0,t.jsx)(o.I,{name:"check",size:11})," ",s("common.saved")]}),(0,t.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)"},children:s("skills.cap.label")}),(0,t.jsx)("input",{className:"form-input mono",style:{width:120},value:"$"+n,disabled:m,onChange:e=>i(Math.max(0,parseFloat(e.target.value.replace(/[^0-9.]/g,""))||0)),onBlur:p,onKeyDown:e=>{"Enter"===e.key&&p()}})]})}}},e=>{e.O(0,[9219,3219,3448,8370,6646,6834,7358],()=>e(e.s=2124)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1387],{26:(e,s,n)=>{"use strict";n.d(s,{DocEditor:()=>m});var t=n(5076),a=n(8488),i=n(4302),o=n(5393),r=n(8576),c=n(7814);let l=(0,c.createServerReference)("6011658c6cff92a897c85caccbf454462c36ead7a6",c.callServer,void 0,c.findSourceMapURL,"saveDoc");var d=n(5629);function m({docId:e,path:s,initial:n}){let c=(0,d.k)(),[h,v]=(0,a.useState)(!1),[b,u]=(0,a.useState)(n),[x,j]=(0,a.useTransition)();return(0,t.jsxs)("div",{className:"card",style:{maxWidth:880},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",marginBottom:12},children:[h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:"btn-accent",disabled:x,onClick:()=>j(async()=>{await l(e,b),v(!1)}),children:[(0,t.jsx)(r.I,{name:"check",size:13})," ",c(x?"common.saving":"docsedit.saveMd")]}),(0,t.jsx)("button",{className:"btn-ghost",onClick:()=>{u(n),v(!1)},children:c("common.cancel")})]}):(0,t.jsxs)("button",{className:"btn-ghost",onClick:()=>v(!0),children:[(0,t.jsx)(r.I,{name:"command",size:13})," ",c("common.edit")]}),(0,t.jsx)("span",{className:"mono",style:{marginLeft:"auto",fontSize:11,color:"var(--text-faint)"},children:s})]}),h?(0,t.jsx)("textarea",{className:"persona-ta mono",style:{minHeight:460,width:"100%"},value:b,onChange:e=>u(e.target.value)}):(0,t.jsx)("div",{className:"md",children:b.trim()?(0,t.jsx)(i.oz,{remarkPlugins:[o.A],children:b}):(0,t.jsx)("div",{className:"muted",children:c("docsedit.emptyFile")})})]})}},404:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3283,23)),Promise.resolve().then(n.bind(n,26)),Promise.resolve().then(n.bind(n,6719)),Promise.resolve().then(n.bind(n,6588)),Promise.resolve().then(n.bind(n,4414)),Promise.resolve().then(n.bind(n,4226)),Promise.resolve().then(n.bind(n,4942)),Promise.resolve().then(n.bind(n,2444)),Promise.resolve().then(n.bind(n,5787))}},e=>{e.O(0,[9219,9690,3219,3448,8370,6646,6834,7358],()=>e(e.s=404)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1059],{3438:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3283,23)),Promise.resolve().then(n.bind(n,4995)),Promise.resolve().then(n.bind(n,6719)),Promise.resolve().then(n.bind(n,6588)),Promise.resolve().then(n.bind(n,4414)),Promise.resolve().then(n.bind(n,4226)),Promise.resolve().then(n.bind(n,4942)),Promise.resolve().then(n.bind(n,2444)),Promise.resolve().then(n.bind(n,5787))},4995:(e,s,n)=>{"use strict";n.d(s,{GenerateDocsButton:()=>b});var r=n(5076),i=n(8488),o=n(9860),t=n(8576),a=n(7814);let c=(0,a.createServerReference)("00ba48e24a016968efa35b8cbcba0c48fa72861b57",a.callServer,void 0,a.findSourceMapURL,"generateDocs");var l=n(5629);function b(){let e=(0,l.k)(),[s,n]=(0,i.useTransition)(),a=(0,o.useRouter)();return(0,r.jsxs)("button",{className:"btn-accent",disabled:s,onClick:()=>n(async()=>{await c(),a.refresh()}),children:[(0,r.jsx)(t.I,{name:"doc",size:14,className:s?"sync-spin":""})," ",e(s?"docs.writing":"docs.generate")]})}}},e=>{e.O(0,[9219,3219,3448,8370,6646,6834,7358],()=>e(e.s=3438)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[296],{891:(e,s,a)=>{"use strict";a.d(s,{m:()=>i});var l=a(5076);let t={working:{c:"var(--sx-string)",pulse:!0,label:"working"},review:{c:"#e0a44e",label:"review"},blocked:{c:"#e8688f",label:"blocked"},idle:{c:"var(--text-faint)",label:"idle"}};function i({status:e,label:s=!1,size:a=8}){let n=t[e]??t.idle;return(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},title:n.label,children:[n.pulse?(0,l.jsx)("span",{className:"dotpulse"}):(0,l.jsx)("span",{style:{width:a,height:a,borderRadius:"50%",background:n.c,display:"inline-block",flex:`0 0 ${a}px`}}),s&&(0,l.jsx)("span",{style:{fontSize:11,color:n.c,fontWeight:600},children:n.label})]})}},4552:(e,s,a)=>{"use strict";a.d(s,{e:()=>t});var l=a(5076);function t({name:e,color:s,size:a=24,health:i,image:n}){let o=Math.max(6,Math.round(.3*a)),c=Math.round(.28*a),r=n?/^(data:|https?:|\/)/.test(n)?n:`/api/upload?path=${encodeURIComponent(n)}`:null;return(0,l.jsxs)("span",{style:{position:"relative",width:a,height:a,flex:`0 0 ${a}px`,display:"inline-block"},children:[r?(0,l.jsx)("img",{src:r,alt:e,width:a,height:a,style:{width:a,height:a,borderRadius:c,objectFit:"cover",display:"block"}}):(0,l.jsx)("span",{style:{width:a,height:a,borderRadius:c,background:s,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*a),fontWeight:700},children:(e[0]||"?").toUpperCase()}),i&&(0,l.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:o,height:o,borderRadius:"50%",background:"alive"===i?"var(--sx-string)":"stale"===i?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4587:(e,s,a)=>{"use strict";a.d(s,{GoalTree:()=>b});var l=a(5076),t=a(8488),i=a(9860),n=a(8576),o=a(4552),c=a(891),r=a(7814);let d=(0,r.createServerReference)("40416f973e58cde3e1cb02bc022782b3543c92d5ae",r.callServer,void 0,r.findSourceMapURL,"cancelGoal"),h=(0,r.createServerReference)("40fab0dc45d1a062252d33f3a9a0397a05010faa8e",r.callServer,void 0,r.findSourceMapURL,"archiveGoal"),g=(0,r.createServerReference)("40d6cdfbeb0338dca33ae564a27d213bf6c390506e",r.callServer,void 0,r.findSourceMapURL,"reopenGoal"),u=(0,r.createServerReference)("40bf0c12cb8b6d24e9c9d7b375d61271cc4ce24bbc",r.callServer,void 0,r.findSourceMapURL,"restoreGoal");var m=a(5695),p=a(5629);function v({id:e,status:s,progress:a}){let o=(0,p.k)(),[c,r]=(0,t.useTransition)(),m=(0,i.useRouter)(),x=s=>r(async()=>{await s(e),m.refresh()});return(0,l.jsxs)("div",{className:"goal-actions",children:["active"===s&&a<100&&(0,l.jsxs)("button",{className:"goal-act danger",disabled:c,onClick:()=>{confirm(o("goals.cancelConfirm"))&&x(d)},children:[(0,l.jsx)(n.I,{name:"close",size:12})," ",o("common.cancel")]}),("active"===s||"cancelled"===s||"done"===s)&&(0,l.jsxs)("button",{className:"goal-act",disabled:c,onClick:()=>x(h),children:[(0,l.jsx)(n.I,{name:"collapse",size:12})," ",o("goals.archive")]}),"cancelled"===s&&(0,l.jsxs)("button",{className:"goal-act accent",disabled:c,onClick:()=>x(g),children:[(0,l.jsx)(n.I,{name:"refresh",size:12})," ",o("goals.reopen")]}),"archived"===s&&(0,l.jsxs)("button",{className:"goal-act accent",disabled:c,onClick:()=>x(u),children:[(0,l.jsx)(n.I,{name:"refresh",size:12})," ",o("goals.restore")]})]})}let x={active:"active",done:"done",cancelled:"cancelled",archived:"archived"};function b({goals:e}){let s=(0,p.k)(),[a,i]=(0,t.useState)("active"),[r,d]=(0,t.useState)("all"),[h,g]=(0,t.useState)(new Set),u=(0,t.useMemo)(()=>{let s=new Map;for(let a of e)for(let e of a.issues)e.assignee&&s.set(e.assignee.handle,e.assignee.name);return[...s.entries()]},[e]),j=e.filter(e=>"all"===a||e.status===a);return 0===e.length?(0,l.jsx)("div",{className:"muted",style:{padding:30,textAlign:"center"},children:s("goals.empty")}):(0,l.jsxs)("div",{className:"goal-tree",children:[(0,l.jsxs)("div",{className:"goal-filters",children:[(0,l.jsx)("div",{className:"seg",children:["active","done","cancelled","archived","all"].map(e=>(0,l.jsx)("button",{className:"seg-opt"+(a===e?" on":""),onClick:()=>i(e),children:s(`goals.status.${e}`)},e))}),u.length>0&&(0,l.jsxs)("select",{className:"goal-agent-sel",value:r,onChange:e=>d(e.target.value),children:[(0,l.jsx)("option",{value:"all",children:s("goals.allAgents")}),u.map(([e,s])=>(0,l.jsx)("option",{value:e,children:s},e))]})]}),0===j.length&&(0,l.jsx)("div",{className:"muted",style:{padding:24,textAlign:"center"},children:s("goals.emptyFiltered",{status:s(`goals.status.${a}`).toLowerCase()})}),j.map(e=>{let a,t=h.has(e.id),i=e.issues.filter(e=>"all"===r||e.assignee?.handle===r),d=e.issues.filter(e=>e.progress>=100).length;return(0,l.jsx)("div",{className:"goal-node",children:(0,l.jsxs)("div",{className:"goal-card status-"+(x[e.status]??"active"),children:[(0,l.jsxs)("div",{className:"goal-head",children:[(0,l.jsx)("button",{className:"side-act",title:t?s("goals.expand"):s("goals.collapse"),style:{flex:"0 0 auto"},onClick:()=>g(s=>{let a=new Set(s);return a.has(e.id)?a.delete(e.id):a.add(e.id),a}),children:(0,l.jsx)(n.I,{name:t?"chevronRight":"chevronDown",size:13})}),(0,l.jsx)(n.I,{name:"target",size:15,style:{color:"var(--accent)",flex:"0 0 auto"}}),(0,l.jsx)("span",{className:"goal-title",children:e.title}),(0,l.jsx)("span",{className:"goal-status-badge "+(x[e.status]??"active"),children:s(`goals.status.${e.status}`)}),(0,l.jsxs)("span",{className:"chip-sm",children:[e.progress,"%"]})]}),e.description&&(0,l.jsx)("div",{className:"goal-desc",children:e.description}),(0,l.jsx)("div",{className:"pbar",children:(0,l.jsx)("span",{style:{width:e.progress+"%"}})}),(0,l.jsxs)("div",{className:"goal-bottom",children:[(0,l.jsxs)("div",{className:"goal-meta",children:[s("goals.meta.complete",{done:d,total:e.issues.length})," \xb7 ",s(1!==e.issues.length?"goals.meta.childIssues.other":"goals.meta.childIssues.one",{n:e.issues.length}),(a="done"===e.status?[s("goals.stamp.done"),e.doneAt]:"cancelled"===e.status?[s("goals.stamp.cancelled"),e.cancelledAt]:"archived"===e.status?[s("goals.stamp.archived"),e.archivedAt]:[s("goals.stamp.created"),e.createdAt])[1]?(0,l.jsxs)("span",{style:{color:"var(--text-faint)"},children:[" \xb7 ",a[0]," ",(0,m.F)(a[1])]}):null]}),(0,l.jsx)(v,{id:e.id,status:e.status,progress:e.progress})]}),!t&&(0,l.jsxs)("div",{className:"goal-issues",children:[0===i.length&&(0,l.jsx)("div",{className:"goal-issue-empty",children:"all"!==r?s("goals.noIssuesForAgent"):s("goals.noIssuesYet")}),i.map(e=>(0,l.jsxs)("div",{className:"goal-issue",children:[(0,l.jsx)("span",{className:"gi-key",children:e.key}),(0,l.jsxs)("div",{className:"gi-main",children:[(0,l.jsxs)("div",{className:"gi-title-row",children:[(0,l.jsx)("span",{className:"gi-title",children:e.title}),e.assignee&&(0,l.jsx)(o.e,{name:e.assignee.name,color:e.assignee.color,size:18}),(0,l.jsxs)("span",{className:"gi-col col-"+e.col,children:[(0,l.jsx)(c.m,{status:"doing"===e.col?"working":"blocked"===e.col?"blocked":"review"===e.col?"review":"idle"})," ",s(`goals.col.${e.col}`)]})]}),(0,l.jsxs)("div",{className:"gi-prog",children:[(0,l.jsx)("span",{className:"gi-bar",children:(0,l.jsx)("span",{style:{width:e.progress+"%"}})}),(0,l.jsxs)("span",{className:"gi-pct",children:[e.progress,"%",e.steps.total>0?` \xb7 ${s("goals.todos",{done:e.steps.done,total:e.steps.total})}`:""]}),e.updatedAt&&(0,l.jsx)("span",{style:{fontSize:10,color:"var(--text-faint)",marginLeft:"auto"},children:(0,m.F)(e.updatedAt)})]})]})]},e.id))]})]})},e.id)})]})}},4899:(e,s,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,4587)),Promise.resolve().then(a.bind(a,8202)),Promise.resolve().then(a.bind(a,6719)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,4226)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444)),Promise.resolve().then(a.bind(a,5787))},5695:(e,s,a)=>{"use strict";function l(e){if(null==e)return"";let s=e instanceof Date?e:new Date(e);if(isNaN(s.getTime()))return"";let a=s.toLocaleDateString([],{day:"2-digit",month:"short"}),l=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return`${a}, ${l}`}a.d(s,{F:()=>l})},8202:(e,s,a)=>{"use strict";a.d(s,{NewGoalButton:()=>c});var l=a(5076),t=a(8488),i=a(7814);let n=(0,i.createServerReference)("406c6cc27f436556892074db0d79cdeee50e3541d4",i.callServer,void 0,i.findSourceMapURL,"createGoal");var o=a(5629);function c({agents:e}){let s=(0,o.k)(),[a,i]=(0,t.useState)(!1),[r,d]=(0,t.useState)(""),[h,g]=(0,t.useState)(""),[u,m]=(0,t.useState)(e[0]?.id??""),[p,v]=(0,t.useTransition)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{className:"btn-accent",onClick:()=>i(!0),children:["+ ",s("goals.new")]}),a&&(0,l.jsx)("div",{className:"modal-overlay",onMouseDown:()=>i(!1),children:(0,l.jsxs)("div",{className:"modal",style:{padding:"20px 22px",width:440,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:10},children:s("goals.new")}),(0,l.jsx)("label",{className:"form-label",children:s("goals.objective")}),(0,l.jsx)("input",{className:"form-input",autoFocus:!0,value:r,onChange:e=>d(e.target.value),placeholder:s("goals.objectivePlaceholder")}),(0,l.jsx)("label",{className:"form-label",children:s("common.description")}),(0,l.jsx)("textarea",{className:"form-input",rows:3,value:h,onChange:e=>g(e.target.value),placeholder:s("goals.descPlaceholder")}),(0,l.jsx)("label",{className:"form-label",children:s("goals.owner")}),(0,l.jsx)("select",{className:"form-input",value:u,onChange:e=>m(e.target.value),children:e.map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," \xb7 ",e.role]},e.id))}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,l.jsx)("button",{className:"btn-ghost",onClick:()=>i(!1),children:s("common.cancel")}),(0,l.jsx)("button",{className:"btn-accent",disabled:!r.trim()||p,onClick:function(){v(async()=>{await n({title:r,description:h,ownerId:u}),i(!1),d(""),g("")})},children:s(p?"goals.creating":"goals.create")})]})]})})]})}}},e=>{e.O(0,[9219,3219,3448,8370,6646,6834,7358],()=>e(e.s=4899)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4644],{3972:(e,s,l)=>{"use strict";l.d(s,{O:()=>n});var a=l(7814);let n=(0,a.createServerReference)("0092c786e152a47eb2b4a5075d1399e183dba47d39",a.callServer,void 0,a.findSourceMapURL,"curateKbAction")},7117:(e,s,l)=>{"use strict";l.d(s,{BlocksPanel:()=>v});var a=l(5076),n=l(8488),t=l(9860),i=l(4302),r=l(5393),c=l(8576),d=l(5629),o=l(7814);let m=(0,o.createServerReference)("404325ce371cd28e6aa5bcdacecb6fe57c2f9bd83f",o.callServer,void 0,o.findSourceMapURL,"saveBlockAction"),b=(0,o.createServerReference)("4037bcbdee832e434b2e49b3723a1f23c5143c7aac",o.callServer,void 0,o.findSourceMapURL,"mergeProposalAction"),h=(0,o.createServerReference)("40ea005bdb459e4bc2dc072416a1d632ef5be53fbc",o.callServer,void 0,o.findSourceMapURL,"rejectProposalAction"),u=(0,o.createServerReference)("40f6c60ba949df563cb0e0cd429a40f31be8b7e319",o.callServer,void 0,o.findSourceMapURL,"deleteBlockAction");function v({blocks:e,proposals:s}){let l=(0,d.k)(),o=(0,t.useRouter)(),[g,x]=(0,n.useTransition)(),[f,k]=(0,n.useState)(null);return(0,a.jsxs)(a.Fragment,{children:[s.length>0&&(0,a.jsxs)("div",{className:"card",style:{marginTop:12,borderColor:"#e8a14e"},children:[(0,a.jsxs)("div",{className:"lr-title",style:{marginBottom:8},children:[(0,a.jsx)(c.I,{name:"inbox",size:14,style:{color:"#e8a14e"}})," ",l("block.proposals")," (",s.length,")"]}),s.map(e=>(0,a.jsxs)("div",{className:"lrow",style:{alignItems:"flex-start"},children:[(0,a.jsxs)("div",{className:"lr-main",children:[(0,a.jsxs)("div",{className:"lr-title",children:[e.slug," ",(0,a.jsxs)("span",{className:"muted",style:{fontWeight:400},children:["\xb7 @",e.byAgentHandle]})]}),(0,a.jsx)("div",{className:"md",style:{fontSize:12,maxHeight:120,overflow:"hidden"},children:(0,a.jsx)(i.oz,{remarkPlugins:[r.A],children:e.body.slice(0,600)})})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,flex:"0 0 auto"},children:[(0,a.jsxs)("button",{className:"btn-accent",disabled:g,onClick:()=>x(async()=>{await b(e.id),o.refresh()}),children:[(0,a.jsx)(c.I,{name:"check",size:12})," ",l("block.merge")]}),(0,a.jsx)("button",{className:"btn-ghost",disabled:g,onClick:()=>x(async()=>{await h(e.id),o.refresh()}),children:l("block.reject")})]})]},e.id))]}),(0,a.jsxs)("div",{className:"card",style:{marginTop:12},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10},children:[(0,a.jsxs)("div",{className:"lr-title",children:[(0,a.jsx)(c.I,{name:"grid",size:14,style:{color:"var(--accent)"}})," ",l("block.title")]}),(0,a.jsxs)("button",{className:"btn-ghost",onClick:()=>k({slug:"",title:"",kind:"note",body:""}),children:[(0,a.jsx)(c.I,{name:"add",size:13})," ",l("block.new")]})]}),f&&(0,a.jsxs)("div",{className:"card",style:{marginBottom:12,background:"var(--bg-panel)"},children:[(0,a.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:8,flexWrap:"wrap"},children:[(0,a.jsx)("input",{className:"form-input",style:{width:200},placeholder:l("block.slugPlaceholder"),value:f.slug,onChange:e=>k({...f,slug:e.target.value})}),(0,a.jsx)("input",{className:"form-input",style:{width:200},placeholder:l("block.titlePlaceholder"),value:f.title,onChange:e=>k({...f,title:e.target.value})}),(0,a.jsx)("input",{className:"form-input",style:{width:160},placeholder:l("block.kindPlaceholder"),value:f.kind,onChange:e=>k({...f,kind:e.target.value})})]}),(0,a.jsx)("textarea",{className:"persona-ta mono",style:{minHeight:200,width:"100%"},placeholder:l("block.bodyPlaceholder"),value:f.body,onChange:e=>k({...f,body:e.target.value})}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,a.jsxs)("button",{className:"btn-accent",disabled:g||!f.slug.trim()||!f.body.trim(),onClick:()=>{f&&x(async()=>{await m(f),k(null),o.refresh()})},children:[(0,a.jsx)(c.I,{name:"check",size:13})," ",g?l("block.saving"):l("block.save")]}),(0,a.jsx)("button",{className:"btn-ghost",onClick:()=>k(null),children:l("block.cancel")})]})]}),0===e.length&&!f&&(0,a.jsx)("div",{className:"muted",children:l("block.empty")}),e.map(e=>(0,a.jsxs)("div",{className:"lrow",style:{alignItems:"flex-start"},children:[(0,a.jsxs)("div",{className:"lr-main",children:[(0,a.jsxs)("div",{className:"lr-title",children:[e.title||e.slug," ",(0,a.jsxs)("span",{className:"muted",style:{fontWeight:400},children:["\xb7 ",e.slug," \xb7 ",e.kind," \xb7 v",e.version," \xb7 ",e.updatedBy]})]}),(0,a.jsx)("div",{className:"md",style:{fontSize:12.5,maxHeight:100,overflow:"hidden"},children:(0,a.jsx)(i.oz,{remarkPlugins:[r.A],children:e.body.slice(0,400)||`_(${l("block.bodyEmpty")})_`})})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,flex:"0 0 auto"},children:[(0,a.jsxs)("button",{className:"btn-ghost",onClick:()=>k({slug:e.slug,title:e.title,kind:e.kind,body:e.body}),children:[(0,a.jsx)(c.I,{name:"command",size:12})," ",l("block.edit")]}),(0,a.jsx)("button",{className:"btn-ghost",disabled:g,title:l("block.delete"),onClick:()=>x(async()=>{await u(e.slug),o.refresh()}),children:(0,a.jsx)(c.I,{name:"trash",size:12})})]})]},e.slug))]})]})}},7423:(e,s,l)=>{Promise.resolve().then(l.t.bind(l,3283,23)),Promise.resolve().then(l.bind(l,7117)),Promise.resolve().then(l.bind(l,8445)),Promise.resolve().then(l.bind(l,6719)),Promise.resolve().then(l.bind(l,6588)),Promise.resolve().then(l.bind(l,4414)),Promise.resolve().then(l.bind(l,4226)),Promise.resolve().then(l.bind(l,4942)),Promise.resolve().then(l.bind(l,2444)),Promise.resolve().then(l.bind(l,5787))},7560:(e,s,l)=>{"use strict";l.d(s,{f:()=>n});var a=l(7814);let n=(0,a.createServerReference)("009b097b9b4451e4de3ce2766a174e678d26daa2ac",a.callServer,void 0,a.findSourceMapURL,"reindexKbAction")},8445:(e,s,l)=>{"use strict";l.d(s,{KbActions:()=>o});var a=l(5076),n=l(8488),t=l(9860),i=l(8576),r=l(5629),c=l(7560),d=l(3972);function o(){let[e,s]=(0,n.useTransition)(),[l,o]=(0,n.useState)(null),m=(0,t.useRouter)(),b=(0,r.k)();return(0,a.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[l&&(0,a.jsx)("span",{className:"kb-actions-msg",children:l}),(0,a.jsxs)("button",{className:"btn-accent",disabled:e,onClick:function(){s(async()=>{o(null),o(b("kb.reindexResult",{n:(await (0,c.f)()).chunks})),m.refresh()})},children:[(0,a.jsx)(i.I,{name:"sync",size:14,className:e?"sync-spin":""})," ",b("kb.reindex")]}),(0,a.jsxs)("button",{className:"btn-accent",disabled:e,onClick:function(){s(async()=>{o(null);let e=await (0,d.O)();o(e.merged+e.retired+e.summarized+e.gaps>0?b("kb.curateResult",{m:e.merged,r:e.retired,s:e.summarized,g:e.gaps}):b("kb.curateNone")),m.refresh()})},children:[(0,a.jsx)(i.I,{name:"skill",size:14,className:e?"sync-spin":""})," ",e?b("kb.curating"):b("kb.curate")]})]})}}},e=>{e.O(0,[9219,9690,3219,3448,8370,6646,6834,7358],()=>e(e.s=7423)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9274],{2064:(e,a,s)=>{"use strict";s.d(a,{ModelsScreen:()=>ea,OpenCatalogButton:()=>es});var l=s(5076),n=s(8488),t=s(8576),i=s(4552),r=s(9265);let d=[[/qwen/i,"qwen"],[/(^|[-_ ])(meta-?)?llama/i,"meta"],[/codestral|mixtral|mistral|ministral/i,"mistral"],[/gemma/i,"gemma"],[/phi-?\d/i,"microsoft"],[/deepseek/i,"deepseek"],[/(^|[-_ ])yi-?\d/i,"yi"],[/granite/i,"ibm"],[/smollm/i,"huggingface"],[/aya|command-?r|^c4ai/i,"cohere"],[/falcon/i,"tii"],[/exaone/i,"lg"]];var o=s(3728),c=s(4403),m=s(7814);let p=(0,m.createServerReference)("40c75d7e64d35d6b22bf5e60e70e9b9aed9b24ce58",m.callServer,void 0,m.findSourceMapURL,"testProvider"),h=(0,m.createServerReference)("403ad109e8d6615a62dffde13e96a5423f427ee81c",m.callServer,void 0,m.findSourceMapURL,"syncProvider"),u=(0,m.createServerReference)("40f63c0dc2f9fd454ee734df281916c9c940b514d1",m.callServer,void 0,m.findSourceMapURL,"revokeProviderToken"),x=(0,m.createServerReference)("4052eed2e606ab0578a532cb12936db0e97531636d",m.callServer,void 0,m.findSourceMapURL,"removeProvider");var v=s(3198);let g=(0,m.createServerReference)("40509ca9e2fe321fd3edb90fb87ad7e46c332852e4",m.callServer,void 0,m.findSourceMapURL,"refreshProviderModels");var f=s(9572);let j=(0,m.createServerReference)("60c81d6c7ac6177409b0c685957871669e51003475",m.callServer,void 0,m.findSourceMapURL,"connectProvider");var b=s(8088);let k=(0,m.createServerReference)("00f11fde1abbcb8874ea13874ce5cd569b0e099e97",m.callServer,void 0,m.findSourceMapURL,"downloadLlamaServer"),B=(0,m.createServerReference)("405ad95da49982821a9bc6955eea37f320993596da",m.callServer,void 0,m.findSourceMapURL,"startLlamaServer"),y=(0,m.createServerReference)("00c4f07a1b33f457c1e069803f5268328f26bf2c66",m.callServer,void 0,m.findSourceMapURL,"stopLlamaServer"),N=(0,m.createServerReference)("4035db26c028b512c5850839e8dd26e72cb50c20db",m.callServer,void 0,m.findSourceMapURL,"removeGguf"),w=(0,m.createServerReference)("400193d67a212d1277899fbaf69193bfc45ae25497",m.callServer,void 0,m.findSourceMapURL,"removeModel"),S=(0,m.createServerReference)("4010145133cbbe698a61bc17c3503a1f5cbe19f1d8",m.callServer,void 0,m.findSourceMapURL,"downloadGguf");var C=s(6e3);let I=(0,m.createServerReference)("00facfad17c4ab63ee00b1875339e6f32bbe8fac82",m.callServer,void 0,m.findSourceMapURL,"embedStatus"),M=(0,m.createServerReference)("001603591cd8a9fe0b752862b36f93023d65a6cb39",m.callServer,void 0,m.findSourceMapURL,"startEmbeddings"),z=(0,m.createServerReference)("00c2bc1709b8a20517d7689236a84e8000dfacdc8a",m.callServer,void 0,m.findSourceMapURL,"reindexRag");var _=s(8670);let Q=[{name:"nomic-embed-text",label:"Nomic Embed Text",size:"274 MB",kind:"embed",note:"Powers semantic workspace RAG — pull this to enable embeddings."},{name:"mxbai-embed-large",label:"mxbai Embed Large",size:"670 MB",kind:"embed",note:"Higher-quality embeddings (set CONSTELLA_EMBED_MODEL)."},{name:"llama3.2:3b",label:"Llama 3.2 3B",size:"2.0 GB",kind:"chat"},{name:"qwen2.5:7b",label:"Qwen 2.5 7B",size:"4.7 GB",kind:"chat"},{name:"qwen2.5-coder:7b",label:"Qwen 2.5 Coder 7B",size:"4.7 GB",kind:"code"},{name:"gemma2:2b",label:"Gemma 2 2B",size:"1.6 GB",kind:"chat"},{name:"phi3.5",label:"Phi 3.5",size:"2.2 GB",kind:"chat"}],R=[{repo:"Qwen2.5-0.5B-Instruct",paramsB:.5,kind:"chat"},{repo:"Qwen2.5-1.5B-Instruct",paramsB:1.5,kind:"chat"},{repo:"Qwen2.5-3B-Instruct",paramsB:3,kind:"chat"},{repo:"Qwen2.5-7B-Instruct",paramsB:7,kind:"chat"},{repo:"Qwen2.5-14B-Instruct",paramsB:14,kind:"chat"},{repo:"Qwen2.5-32B-Instruct",paramsB:32,kind:"chat"},{repo:"Qwen2.5-72B-Instruct",paramsB:72,kind:"chat"},{repo:"Qwen2.5-Coder-1.5B-Instruct",paramsB:1.5,kind:"code"},{repo:"Qwen2.5-Coder-3B-Instruct",paramsB:3,kind:"code"},{repo:"Qwen2.5-Coder-7B-Instruct",paramsB:7,kind:"code"},{repo:"Qwen2.5-Coder-14B-Instruct",paramsB:14,kind:"code"},{repo:"Qwen2.5-Coder-32B-Instruct",paramsB:32,kind:"code"},{repo:"Qwen3-0.6B",paramsB:.6,kind:"chat"},{repo:"Qwen3-1.7B",paramsB:1.7,kind:"chat"},{repo:"Qwen3-4B",paramsB:4,kind:"chat"},{repo:"Qwen3-8B",paramsB:8,kind:"chat"},{repo:"Qwen3-14B",paramsB:14,kind:"chat"},{repo:"Qwen3-32B",paramsB:32,kind:"chat"},{repo:"Llama-3.2-1B-Instruct",paramsB:1,kind:"chat"},{repo:"Llama-3.2-3B-Instruct",paramsB:3,kind:"chat"},{repo:"Meta-Llama-3.1-8B-Instruct",paramsB:8,kind:"chat"},{repo:"Meta-Llama-3.1-70B-Instruct",paramsB:70,kind:"chat"},{repo:"Llama-3.3-70B-Instruct",paramsB:70,kind:"chat"},{repo:"gemma-2-2b-it",paramsB:2,kind:"chat"},{repo:"gemma-2-9b-it",paramsB:9,kind:"chat"},{repo:"gemma-2-27b-it",paramsB:27,kind:"chat"},{repo:"gemma-3-1b-it",paramsB:1,kind:"chat"},{repo:"gemma-3-4b-it",paramsB:4,kind:"chat"},{repo:"gemma-3-12b-it",paramsB:12,kind:"chat"},{repo:"gemma-3-27b-it",paramsB:27,kind:"chat"},{repo:"Mistral-7B-Instruct-v0.3",paramsB:7,kind:"chat"},{repo:"Mistral-Nemo-Instruct-2407",paramsB:12,kind:"chat"},{repo:"Mistral-Small-Instruct-2409",paramsB:22,kind:"chat"},{repo:"Mistral-Small-24B-Instruct-2501",paramsB:24,kind:"chat"},{repo:"Codestral-22B-v0.1",paramsB:22,kind:"code"},{repo:"Phi-3.1-mini-4k-instruct",paramsB:3.8,kind:"chat"},{repo:"DeepSeek-R1-Distill-Qwen-1.5B",paramsB:1.5,kind:"reasoning"},{repo:"DeepSeek-R1-Distill-Qwen-7B",paramsB:7,kind:"reasoning"},{repo:"DeepSeek-R1-Distill-Qwen-14B",paramsB:14,kind:"reasoning"},{repo:"DeepSeek-R1-Distill-Qwen-32B",paramsB:32,kind:"reasoning"},{repo:"DeepSeek-R1-Distill-Llama-8B",paramsB:8,kind:"reasoning"},{repo:"DeepSeek-Coder-V2-Lite-Instruct",paramsB:16,kind:"code"},{repo:"Yi-1.5-9B-Chat",paramsB:9,kind:"chat"},{repo:"Yi-1.5-34B-Chat",paramsB:34,kind:"chat"},{repo:"granite-3.0-8b-instruct",paramsB:8,kind:"chat"},{repo:"granite-3.1-8b-instruct",paramsB:8,kind:"chat"},{repo:"SmolLM2-360M-Instruct",paramsB:.36,kind:"chat"},{repo:"SmolLM2-1.7B-Instruct",paramsB:1.7,kind:"chat"},{repo:"aya-expanse-8b",paramsB:8,kind:"chat"},{repo:"aya-expanse-32b",paramsB:32,kind:"chat"},{repo:"Falcon3-7B-Instruct",paramsB:7,kind:"chat"},{repo:"Falcon3-10B-Instruct",paramsB:10,kind:"chat"},{repo:"EXAONE-3.5-2.4B-Instruct",paramsB:2.4,kind:"chat"},{repo:"EXAONE-3.5-7.8B-Instruct",paramsB:7.8,kind:"chat"},{repo:"Qwen3.5-0.8B",paramsB:.8,kind:"chat"},{repo:"Qwen3.5-2B",paramsB:2,kind:"chat"},{repo:"Qwen3.5-9B",paramsB:9,kind:"chat"},{repo:"Qwen3.5-27B",paramsB:27,kind:"chat"},{repo:"Qwen3.5-35B-A3B",paramsB:35,kind:"chat"},{repo:"Qwen3.6-27B",paramsB:27,kind:"chat"},{repo:"Qwen3.6-35B-A3B",paramsB:35,kind:"chat"},{repo:"Qwen3-30B-A3B",paramsB:30,kind:"chat"},{repo:"Qwen3-30B-A3B-Instruct-2507",paramsB:30,kind:"chat"},{repo:"Qwen3-Next-80B-A3B-Instruct",paramsB:80,kind:"chat"},{repo:"Qwen3-4B-Thinking-2507",paramsB:4,kind:"reasoning"},{repo:"QwQ-32B",paramsB:32,kind:"reasoning"},{repo:"Qwen2.5-7B-Instruct-1M",paramsB:7,kind:"chat"},{repo:"Qwen2.5-Coder-0.5B-Instruct",paramsB:.5,kind:"code"},{repo:"Qwen2.5-Coder-3B",paramsB:3,kind:"code"},{repo:"Qwen2.5-Coder-32B",paramsB:32,kind:"code"},{repo:"Qwen2.5-Math-7B-Instruct",paramsB:7,kind:"chat"},{repo:"Qwen2-500M-Instruct",paramsB:.5,kind:"chat"},{repo:"Qwen1.5-32B-Chat",paramsB:32,kind:"chat"},{repo:"gemma-4-E2B-it",paramsB:2,kind:"chat"},{repo:"gemma-4-E4B-it",paramsB:4,kind:"chat"},{repo:"gemma-4-12B-it",paramsB:12,kind:"chat"},{repo:"gemma-4-26B-A4B-it",paramsB:26,kind:"chat"},{repo:"gemma-4-31B-it",paramsB:31,kind:"chat"},{repo:"gemma-3-270m-it",paramsB:.27,kind:"chat"},{repo:"gemma-1.1-2b-it",paramsB:2,kind:"chat"},{repo:"codegemma-2b",paramsB:2,kind:"code"},{repo:"codegemma-7b",paramsB:7,kind:"code"},{repo:"codegemma-7b-it",paramsB:7,kind:"code"},{repo:"codegemma-1.1-7b-it",paramsB:7,kind:"code"},{repo:"Ministral-3-3B-Instruct-2512",paramsB:3,kind:"chat"},{repo:"Ministral-3-8B-Instruct-2512",paramsB:8,kind:"chat"},{repo:"Ministral-3-14B-Instruct-2512",paramsB:14,kind:"chat"},{repo:"Ministral-3-3B-Reasoning-2512",paramsB:3,kind:"reasoning"},{repo:"Ministral-3-8B-Reasoning-2512",paramsB:8,kind:"reasoning"},{repo:"Ministral-3-14B-Reasoning-2512",paramsB:14,kind:"reasoning"},{repo:"Mistral-Small-3.1-24B-Instruct-2503",paramsB:24,kind:"chat"},{repo:"Mistral-Small-3.2-24B-Instruct-2506",paramsB:24,kind:"chat"},{repo:"Devstral-Small-2-24B-Instruct-2512",paramsB:24,kind:"code"},{repo:"mathstral-7B-v0.1",paramsB:7,kind:"chat"},{repo:"dolphin-2.8-mistral-7b-v02",paramsB:7,kind:"chat"},{repo:"WizardLM-2-7B",paramsB:7,kind:"chat"},{repo:"DeepSeek-R1-0528-Qwen3-8B",paramsB:8,kind:"reasoning"},{repo:"DeepSeek-R1-Distill-Llama-70B",paramsB:70,kind:"reasoning"},{repo:"deepseek-coder-1.3B-kexer",paramsB:1.3,kind:"code"},{repo:"deepseek-coder-6.7B-kexer",paramsB:6.7,kind:"code"},{repo:"granite-3.2-8b-instruct",paramsB:8,kind:"chat"},{repo:"granite-4.1-3b",paramsB:3,kind:"chat"},{repo:"granite-4.1-8b",paramsB:8,kind:"chat"},{repo:"granite-4.1-30b",paramsB:30,kind:"chat"},{repo:"Olmo-3-32B-Think",paramsB:32,kind:"reasoning"},{repo:"Seed-OSS-36B-Instruct",paramsB:36,kind:"chat"},{repo:"ERNIE-4.5-21B-A3B-PT",paramsB:21,kind:"chat"},{repo:"LFM2-24B-A2B",paramsB:24,kind:"chat"},{repo:"LFM2.5-1.2B-Instruct",paramsB:1.2,kind:"chat"},{repo:"LFM2.5-1.2B-Thinking",paramsB:1.2,kind:"reasoning"},{repo:"NVIDIA-Nemotron-3-Nano-4B",paramsB:4,kind:"chat"},{repo:"Hermes-4-70B",paramsB:70,kind:"chat"},{repo:"Llama-3.1-Tulu-3-8B",paramsB:8,kind:"chat"},{repo:"Meta-Llama-3-70B-Instruct",paramsB:70,kind:"chat"},{repo:"Llama3-ChatQA-1.5-70B",paramsB:70,kind:"chat"},{repo:"Llama-3-Groq-8B-Tool-Use",paramsB:8,kind:"chat"},{repo:"aya-23-8B",paramsB:8,kind:"chat"},{repo:"aya-23-35B",paramsB:35,kind:"chat"},{repo:"SmolLM2-135M-Instruct",paramsB:.135,kind:"chat"},{repo:"Yi-Coder-1.5B",paramsB:1.5,kind:"code"},{repo:"Yi-Coder-9B-Chat",paramsB:9,kind:"code"},{repo:"OpenCoder-1.5B-Instruct",paramsB:1.5,kind:"code"},{repo:"stable-code-instruct-3b",paramsB:3,kind:"code"},{repo:"internlm2-math-plus-7b",paramsB:7,kind:"chat"},{repo:"internlm2-math-plus-20b",paramsB:20,kind:"chat"}],L={Q3_K_L:.55,Q4_K_M:.67,Q6_K:.9,Q8_0:1.13},T=[{id:"nomic-embed-q8",name:"nomic-embed-text-v1.5 (Q8_0)",url:"https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q8_0.gguf",params:"137M",quant:"Q8_0",sizeBytes:146e6,kind:"embed",paramsB:.137},...function(){let e=[];for(let l of R){var a,s;let n=l.vendor??"lmstudio-community";for(let t of(a=l.paramsB)<=9?["Q3_K_L","Q4_K_M","Q6_K","Q8_0"]:a<=34?["Q3_K_L","Q4_K_M","Q6_K"]:["Q3_K_L","Q4_K_M"]){let a=`${l.repo}-${t}.gguf`;e.push({id:`${l.repo}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:`${l.repo} (${t})`,url:`https://huggingface.co/${n}/${l.repo}-GGUF/resolve/main/${a}`,params:(s=l.paramsB)<1?`${Math.round(1e3*s)}M`:`${s}B`,quant:t,sizeBytes:Math.round(1e9*l.paramsB*L[t]),kind:l.kind,paramsB:l.paramsB})}}return e}()];var $=s(6517),A=s(5629);let P={available:"var(--sx-string)",experimental:"#f0a35e",requires_setup:"#6cc7e0",planned:"var(--text-dim)",unsupported:"var(--sx-keyword)"},G={ready:"var(--sx-string)",needs_login:"#f0a35e",needs_key:"#f0a35e",unknown:"var(--text-dim)"},U={cli_claude_code:"sign in to Claude Code",cli_codex:"codex login",cli_openclaw:"openclaw infer model auth login",cli_hermes:"hermes model",cli_aider:"set OPENAI_API_KEY / ANTHROPIC_API_KEY env",cli_opencode:"opencode auth login",cli_copilot:"copilot → /login",cli_cursor:"cursor-agent login",cli_cline:"configure cline providers",cli_kilo:"configure kilocode providers"},F=e=>e>=1e9?(e/1e9).toFixed(1)+" GB":(e/1e6).toFixed(0)+" MB";function E({rows:e,kind:a,onViewModels:s}){let i=(0,A.k)(),[d,o]=(0,n.useState)({}),[c,m]=(0,n.useState)({}),[v,g]=(0,n.useState)({}),[,f]=(0,n.useTransition)(),j=(e,a,s,l)=>f(async()=>{var n;o(s=>({...s,[e]:a}));let t=await s().catch(()=>null);o(a=>{let s={...a};return delete s[e],s}),l&&(n=l(t),m(a=>({...a,[e]:n})),setTimeout(()=>m(a=>{let s={...a};return delete s[e],s}),2200))});return(0,l.jsx)("div",{className:"tbl-wrap",children:(0,l.jsxs)("table",{className:"tbl",style:{marginBottom:20},children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:i("models.col.provider")}),(0,l.jsx)("th",{children:i("models.col.adapter")}),(0,l.jsx)("th",{children:i("models.col.models")}),(0,l.jsx)("th",{children:"cli"===a?i("models.col.auth"):i("models.col.keyAuth")}),(0,l.jsx)("th",{children:i("models.col.lastSync")}),(0,l.jsx)("th",{children:i("common.status")}),(0,l.jsx)("th",{style:{textAlign:"right"},children:i("common.actions")})]})}),(0,l.jsxs)("tbody",{children:[e.map(e=>{let a="connected"===e.status,o=d[e.id],m="none"!==e.auth&&"local"!==e.auth&&"cli"!==e.auth,f=!!v[e.id],b=e.authState??("cli"===e.kind?"unknown":"none"===e.auth?"needs_key":"ready");return(0,l.jsxs)(n.Fragment,{children:[(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,l.jsx)("button",{className:"iact",title:f?i("models.title.hideStatus"):i("models.title.showStatus"),style:{padding:"0 4px",fontSize:11,color:"var(--text-dim)",lineHeight:1},onClick:()=>g(a=>({...a,[e.id]:!a[e.id]})),children:f?"▾":"▸"}),(0,l.jsx)(r.W,{id:e.catalogId,size:26})," ",e.displayName,"cli"===e.kind&&e.cliVersion&&(0,l.jsxs)("span",{className:"chip-sm",style:{fontSize:9.5,color:"var(--text-dim)"},children:["v",e.cliVersion.replace(/^v/,"")]})]})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"chip-sm",children:e.adapter})}),(0,l.jsx)("td",{children:e.modelCount>0?(0,l.jsx)("button",{className:"link-btn",onClick:a=>s(e,a),children:i("models.modelCount",{n:e.modelCount})}):(0,l.jsx)("span",{style:{color:"var(--text-faint)"},children:i("common.unsynced")})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"pill",style:{background:(G[b]??"var(--text-dim)")+"22",color:G[b]??"var(--text-dim)"},children:i(`models.auth.${b}`)})}),(0,l.jsx)("td",{style:{color:"var(--text-dim)",fontSize:12},children:e.lastSync??i("common.never")}),(0,l.jsx)("td",{children:(0,l.jsxs)("span",{className:"gstat-cell",children:[(0,l.jsx)("span",{className:"status-dot",style:{background:a?"var(--sx-string)":"error"===e.status?"var(--sx-keyword)":"var(--text-dim)"}}),a?i("models.status.connected"):"error"===e.status?i("models.status.error"):i("models.status.needsSync")]})}),(0,l.jsx)("td",{children:(0,l.jsxs)("div",{className:"row-actions",children:[c[e.id]&&(0,l.jsx)("span",{style:{fontSize:10.5,color:"var(--sx-string)",alignSelf:"center"},children:c[e.id]}),(0,l.jsx)("button",{className:"iact",title:i("models.title.testConnection"),disabled:!!o,onClick:()=>j(e.id,"testing",()=>p(e.id),e=>e?.ok?i("models.flash.connectionOk"):i("models.flash.unreachable")),children:"testing"===o?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:15})}):(0,l.jsx)(t.I,{name:"play",size:15})}),(0,l.jsx)("button",{className:"iact",title:i("models.title.syncRefresh"),disabled:!!o,onClick:()=>j(e.id,"syncing",()=>h(e.id),e=>i("models.flash.synced",{n:e?.count??0})),children:"syncing"===o?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:15})}):(0,l.jsx)(t.I,{name:"refresh",size:15})}),e.modelCount>0&&(0,l.jsx)("button",{className:"iact",title:i("models.title.viewModels"),onClick:a=>s(e,a),children:(0,l.jsx)(t.I,{name:"files",size:15})}),m&&(0,l.jsx)("button",{className:"iact",title:i("models.title.revokeToken"),disabled:!!o,onClick:()=>j(e.id,"revoke",()=>u(e.id),()=>i("models.flash.tokenRevoked")),children:(0,l.jsx)(t.I,{name:"shield",size:15})}),(0,l.jsx)("button",{className:"iact danger",title:i("models.title.removeProvider"),disabled:!!o,onClick:()=>j(e.id,"remove",()=>x(e.id)),children:(0,l.jsx)(t.I,{name:"trash",size:15})})]})})]}),f&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:7,style:{padding:0,background:"var(--bg-active)"},children:(0,l.jsx)(O,{row:e})})})]},e.id)}),0===e.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:7,style:{textAlign:"center",color:"var(--text-faint)",padding:20},children:"cli"===a?i("models.empty.cli"):i("models.empty.cloud")})})]})]})})}function D({k:e,children:a}){return(0,l.jsxs)("div",{style:{minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:".4px",color:"var(--text-faint)",marginBottom:3},children:e}),(0,l.jsx)("div",{style:{fontSize:12.5,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})}function O({row:e}){let a=(0,A.k)(),s=(0,b.kH)(e.catalogId),i=function(e){let a=(0,b.kH)(e);if(!a)return{key:"none",tone:"var(--text-dim)"};if("cli"===a.category)return{key:"cli",tone:"#a78bfa"};if("local_runtime"===a.category)return{key:"local",tone:"#6cc7e0"};let s=a.connectionTypes.includes("local"),l=a.connectionTypes.includes("api_key")||a.connectionTypes.includes("openai_compatible");return s&&l?{key:"hybrid",tone:"#f0a35e"}:{key:"api",tone:"var(--sx-string)"}}(e.catalogId),r=s?.category==="cli",[d,o]=(0,n.useState)(null),[c,m]=(0,n.useState)(!1),[,p]=(0,n.useTransition)();(0,n.useEffect)(()=>{let a=!0;return(0,v.A)(e.id).then(e=>a&&o(e.models)).catch(()=>a&&o([])),()=>{a=!1}},[e.id]);let h=d?.find(e=>e.isDefault)??(e.defaultModel?d?.find(a=>a.id===e.defaultModel):void 0)??d?.[0],u=d?.reduce((e,a)=>Math.max(e,a.context),0)??0,x={vision:!!d?.some(e=>e.caps?.vision),reasoning:!!d?.some(e=>e.caps?.reasoning),tools:!!d?.some(e=>e.caps?.tools)},f=[x.vision&&a("models.cap.vision"),x.reasoning&&a("models.cap.reasoning"),x.tools&&a("models.cap.tools")].filter(Boolean).join(" \xb7 ")||"—",j=e.authState??(r?"unknown":"none"===e.auth?"needs_key":"ready"),k="ready"===j&&"connected"===e.status;return(0,l.jsxs)("div",{style:{padding:"14px 18px 16px 40px",borderTop:"1px solid var(--border)"},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"12px 18px"},children:[(0,l.jsx)(D,{k:a("models.pd.connection"),children:(0,l.jsx)("span",{className:"pill",style:{background:i.tone+"22",color:i.tone},children:"none"===i.key?"—":a(`models.connType.${i.key}`)})}),(0,l.jsx)(D,{k:a("models.pd.install"),children:r?e.cliVersion?(0,l.jsxs)("span",{style:{color:"var(--sx-string)"},children:[a("models.install.installed")," \xb7 v",e.cliVersion.replace(/^v/,"")]}):(0,l.jsx)("span",{style:{color:"#f0a35e"},children:a("models.install.notDetected")}):a("local"===i.key?"models.install.localRuntime":"models.install.cloudApi")}),(0,l.jsxs)(D,{k:a("models.pd.auth"),children:[(0,l.jsx)("span",{className:"pill",style:{background:(G[j]??"var(--text-dim)")+"22",color:G[j]??"var(--text-dim)"},children:a(`models.auth.${j}`)}),"ready"!==j&&(r?U[e.adapter]:!e.auth||"none"===e.auth)?(0,l.jsx)("span",{style:{fontSize:10.5,color:"var(--text-faint)",marginLeft:6},children:r?U[e.adapter]:a("models.hint.addApiKey")}):null]}),(0,l.jsx)(D,{k:a("models.pd.models"),children:null==d?"…":d.length||e.modelCount}),(0,l.jsx)(D,{k:a("models.pd.defaultModel"),children:h?h.name:e.defaultModel??"—"}),(0,l.jsx)(D,{k:a("models.pd.maxContext"),children:u?a("models.pd.tokens",{ctx:W(u)}):"—"}),(0,l.jsx)(D,{k:a("models.pd.capabilities"),children:f}),(0,l.jsx)(D,{k:a("models.pd.costDefault"),children:h&&(h.inputCost||h.outputCost)?`$${h.inputCost} / $${h.outputCost} ${a("models.pd.per1M")}`:"—"}),(0,l.jsx)(D,{k:a("models.pd.state"),children:(0,l.jsx)("span",{className:"pill",style:{background:(k?"var(--sx-string)":"#f0a35e")+"22",color:k?"var(--sx-string)":"#f0a35e"},children:a(k?"models.state.ready":"models.state.needsConfig")})})]}),(0,l.jsxs)("div",{style:{marginTop:12,display:"flex",alignItems:"center",gap:10},children:[(0,l.jsxs)("button",{className:"btn-ghost",disabled:c,onClick:function(){m(!0),p(async()=>{await g(e.id).catch(()=>{}),o((await (0,v.A)(e.id).catch(()=>({models:[]}))).models),m(!1)})},children:[c?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:13})}):(0,l.jsx)(t.I,{name:"refresh",size:13})," ",a(c?"models.btn.refreshing":"models.btn.refreshModels")]}),s?.notes&&(0,l.jsx)("span",{style:{fontSize:11,color:"var(--text-faint)"},children:s.notes})]})]})}let W=e=>e?e>=1e6?`${(e/1e6).toFixed(e%1e6?1:0)}M`:`${Math.round(e/1e3)}K`:"";function K({row:e,pos:a,onClose:s}){let i=(0,A.k)(),r=(0,$.L2)(e.adapter),[d,o]=(0,n.useState)(r?r.map(e=>({id:e.id,label:e.label,version:e.version,note:e.note})):null),[c,m]=(0,n.useState)(""),p=e=>{let a=(0,$.Ov)(e.id);return{id:e.id,label:e.name||a.label,version:a.version,context:e.context,inputCost:e.inputCost,outputCost:e.outputCost,caps:e.caps,isDefault:e.isDefault}};return(0,n.useEffect)(()=>{if(r)return;let a=!0;return(0,v.A)(e.id).then(async({models:s})=>{if(!a)return;if(s.length)return void o(s.map(p));let l=await (0,f.E)(e.id);a&&(o(l.models.map(e=>{let a=(0,$.Ov)(e);return{id:e,label:a.label,version:a.version}})),l.error&&m(l.error))}).catch(()=>{a&&(o([]),m(i("models.pop.loadFailed")))}),()=>{a=!1}},[e.id]),(0,l.jsxs)("div",{className:"models-pop",style:{left:Math.min(a.x,window.innerWidth-380),top:a.y},onMouseLeave:s,children:[(0,l.jsxs)("div",{className:"mp-head",children:[(0,l.jsx)(t.I,{name:"cpu",size:13,style:{color:"var(--accent)"}})," ",e.displayName," \xb7 ",e.kind," \xb7 ",i("models.modelCount",{n:d?.length??e.modelCount})]}),null===d&&(0,l.jsxs)("div",{className:"mp-row",children:[(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:11})})," ",i("common.loading")]}),d&&0===d.length&&(0,l.jsx)("div",{className:"mp-row",style:{color:"var(--text-faint)"},children:c||i("models.pop.noModels")}),d?.map(e=>(0,l.jsxs)("div",{className:"mp-row",children:[(0,l.jsx)(t.I,{name:"dot",size:7}),(0,l.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,l.jsxs)("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.label,e.isDefault?(0,l.jsxs)("span",{style:{color:"var(--accent)"},children:[" \xb7 ",i("models.pop.recommended")]}):null,e.note?(0,l.jsxs)("span",{style:{color:"var(--text-faint)"},children:[" \xb7 ",e.note]}):null]}),e.context||e.inputCost||e.outputCost?(0,l.jsxs)("span",{style:{fontSize:9.5,color:"var(--text-faint)",fontFamily:"var(--mono-font)"},children:[e.context?`${W(e.context)} ${i("models.pop.ctx")}`:"",e.inputCost||e.outputCost?` $${e.inputCost}/${e.outputCost}`:"",e.caps?.vision?` ${i("models.cap.vision")}`:"",e.caps?.reasoning?` ${i("models.cap.reasoning")}`:"",e.caps?.tools?` ${i("models.cap.tools")}`:""]}):null]}),e.version&&(0,l.jsxs)("span",{className:"chip-sm",style:{fontSize:10},children:["v",e.version]})]},e.id))]})}function q({hw:e,ollamaUp:a,ollamaInstalled:s,installed:i,locals:d,llamaUp:c,llamaInstalled:m,llamaModel:p}){let h,u,x=(0,A.k)(),[v,g]=(0,n.useState)(c?"running":m?"stopped":"not-installed"),[f,j]=(0,n.useState)(p),[b,I]=(0,n.useState)([{c:c?"lg-ok":m?"lg-dim":"lg-warn",t:c?x("models.log.serving",{model:p??x("models.log.aModel")}):m?x("models.log.stopped"):x("models.log.notInstalled")}]),[M,z]=(0,n.useState)(d[0]?.id??""),[_,R]=(0,n.useState)(m),[L,$]=(0,n.useState)(""),[P,G]=(0,n.useState)(""),[U,E]=(0,n.useState)(!1),[D,O]=(0,n.useState)("all"),[,W]=(0,n.useTransition)(),K=Y(e.vram),X=Y(e.ram),Z="Metal"===e.backend?"Metal":"GPU",ee=T.map(e=>({g:e,fit:function(e,a,s,l="GPU"){return a>0?1.2*e<=a?{key:"fitsUnit",unit:l,tone:"ok"}:e<=a?{key:"tightUnit",unit:l,tone:"tight"}:e<=2*a?{key:"partialOffload",tone:"tight"}:{key:"cpuOnly",tone:"no"}:s>0?1.1*e<=s?{key:"runsOnCpu",tone:"tight"}:{key:"tooBig",tone:"no"}:{key:"",tone:"tight"}}(e.sizeBytes,K,X,Z)})).filter(({g:e})=>"all"===D||e.kind===D).filter(({g:e})=>!P.trim()||e.name.toLowerCase().includes(P.toLowerCase())).filter(({fit:e})=>!U||"no"!==e.tone),[ea,es]=(0,n.useState)(null);function el(e){W(async()=>{g("booting"),I(e=>[...e,{c:"lg-dim",t:"$ llama-server"}]);let a=await B(e||M||void 0);g(a.up?"running":a.installed?"stopped":"not-installed"),I(e=>[...e,...a.log.map(e=>({c:a.up?"lg-ok":"lg-warn",t:e}))])})}let en="running"===v?x("models.srv.running"):"booting"===v?x("models.srv.working"):"not-installed"===v?x("models.srv.notInstalled"):x("models.srv.stopped");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"lr-grid",children:[(0,l.jsxs)("div",{className:"hw-card",children:[(0,l.jsxs)("div",{className:"hw-head",children:[(0,l.jsx)("span",{className:"hw-ic",children:(0,l.jsx)(t.I,{name:"cpu",size:19})}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{className:"hw-t",children:x("models.hw.detected")}),(0,l.jsx)("div",{className:"hw-s",children:x("models.hw.autoProbed")})]}),(0,l.jsx)("span",{className:"hw-badge",children:e.backend})]}),(0,l.jsxs)("div",{className:"hw-rows",children:[(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:"CPU"}),(0,l.jsx)("div",{className:"hi-v",children:e.cpu})]}),(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:x("models.hw.cores")}),(0,l.jsx)("div",{className:"hi-v",children:e.cores})]}),(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:x("models.hw.memory")}),(0,l.jsx)("div",{className:"hi-v",children:e.ram})]}),(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:"GPU"}),(0,l.jsx)("div",{className:"hi-v",children:e.gpu})]}),(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:"VRAM"}),(0,l.jsx)("div",{className:"hi-v",children:e.vram})]}),(0,l.jsxs)("div",{className:"hw-item",children:[(0,l.jsx)("div",{className:"hi-k",children:x("models.hw.diskFree")}),(0,l.jsx)("div",{className:"hi-v",children:e.diskFree})]})]}),(0,l.jsxs)("div",{className:"hw-badges",children:[e.accel.map(e=>(0,l.jsx)("span",{className:"hw-badge",style:{background:"var(--bg-active)",color:"var(--text-dim)"},children:e},e)),(0,l.jsx)("span",{className:"hw-badge",children:x("models.hw.recommended",{quant:e.recommendedQuant})}),(0,l.jsx)("span",{className:"hw-badge",children:x("models.hw.max",{params:e.maxParams})})]})]}),(0,l.jsxs)("div",{className:"hw-card",children:[(0,l.jsxs)("div",{className:"hw-head",children:[(0,l.jsx)("span",{className:"hw-ic",children:(0,l.jsx)(t.I,{name:"terminal",size:19})}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{className:"hw-t",children:x("models.llama.title")}),(0,l.jsx)("div",{className:"hw-s",children:x("models.llama.sub")})]}),(0,l.jsx)(r.W,{id:"llamacpp",size:22})]}),(0,l.jsxs)("div",{className:"srv-status",children:[(0,l.jsx)("span",{className:"srv-dot "+("running"===v?"run":"booting"===v?"boot":"stop")}),(0,l.jsxs)("div",{className:"srv-meta",children:[(0,l.jsx)("div",{className:"sm-t",children:en}),(0,l.jsxs)("div",{className:"sm-s",children:["127.0.0.1:8082 \xb7 ",f||x("models.srv.noModel")]})]}),(0,l.jsxs)("button",{className:"running"===v?"btn-ghost":"btn-accent",onClick:()=>"running"===v?void W(async()=>{g("booting");let e=await y();g("stopped"),j(null),I(a=>[...a,...e.log.map(e=>({c:"lg-warn",t:e}))])}):el(),disabled:"booting"===v||"running"!==v&&0===d.length,children:["booting"===v?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:13})}):(0,l.jsx)(t.I,{name:"running"===v?"close":"goto",size:13}),"running"===v?x("models.srv.stopBtn"):"booting"===v?x("models.srv.working"):x("models.srv.startBtn")]})]}),"running"!==v&&d.length>0&&(0,l.jsx)("div",{style:{marginBottom:8},children:(0,l.jsx)(o.m,{value:M,options:d.map(e=>({value:e.id,label:e.name})),onChange:z,mono:!0})}),(0,l.jsxs)("div",{className:"srv-stats",children:[(0,l.jsxs)("div",{className:"srv-stat",children:[(0,l.jsx)("div",{className:"ss-v",children:d.length}),(0,l.jsx)("div",{className:"ss-k",children:x("models.srv.ggufModels")})]}),(0,l.jsxs)("div",{className:"srv-stat",children:[(0,l.jsx)("div",{className:"ss-v",children:"running"===v?x("common.on"):x("common.off")}),(0,l.jsx)("div",{className:"ss-k",children:x("models.srv.serverLabel")})]}),(0,l.jsxs)("div",{className:"srv-stat",children:[(0,l.jsx)("div",{className:"ss-v",children:e.backend}),(0,l.jsx)("div",{className:"ss-k",children:x("models.srv.backendLabel")})]})]}),!_&&(0,l.jsxs)("div",{style:{marginTop:8,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,l.jsxs)("button",{className:"btn-accent",disabled:"install"===L,onClick:function(){W(async()=>{$("install"),es(null),I(e=>[...e,{c:"lg-dim",t:x("models.log.installing")}]);let e=setInterval(()=>{fetch("/api/models/progress?id=llama-server").then(e=>e.json()).then(e=>{e&&es({received:e.received,total:e.total})}).catch(()=>{})},600);try{let e=await k();$(""),R(e.installed),e.installed&&"not-installed"===v&&g("stopped"),I(a=>[...a,...e.log.map(a=>({c:e.ok?"lg-ok":"lg-warn",t:a})),...e.error?[{c:"lg-warn",t:e.error}]:[]])}finally{clearInterval(e),es(null)}})},children:["install"===L?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:13})}):(0,l.jsx)(t.I,{name:"goto",size:13})," ","install"===L?null!==(h=ea&&ea.total>0?Math.round(ea.received/ea.total*100):null)?x("models.install.installingPct",{pct:h}):x("models.install.installingEllipsis"):x("models.install.installLlama")]}),(0,l.jsx)("a",{className:"link-btn",style:{fontSize:11},href:"https://github.com/ggml-org/llama.cpp/releases",target:"_blank",rel:"noreferrer",children:x("models.install.manualInstall")}),"install"===L&&(u=ea&&ea.total>0?Math.min(100,Math.round(ea.received/ea.total*100)):null,(0,l.jsxs)("div",{style:{flex:"1 1 180px",minWidth:150},children:[(0,l.jsx)("div",{style:{height:4,background:"var(--bg-active)",borderRadius:3,overflow:"hidden"},children:(0,l.jsx)("div",{className:null===u?"sync-spin":"",style:{height:"100%",width:(u??12)+"%",background:"var(--accent)",transition:"width .3s"}})}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--text-faint)",marginTop:3,fontFamily:"var(--mono-font)"},children:null!==u&&ea?`${u}% \xb7 ${F(ea.received)} / ${F(ea.total)}`:ea&&ea.received>0?x("models.dl.downloaded",{size:F(ea.received)}):x("models.dl.startingDownload")})]}))]}),(0,l.jsx)("div",{className:"srv-log scroll",children:b.map((e,a)=>(0,l.jsx)("div",{className:e.c,children:e.t},a))})]}),(0,l.jsx)(V,{})]}),(0,l.jsxs)("div",{className:"view-section-title",children:[x("models.installed.title")," ",(0,l.jsxs)("span",{style:{fontWeight:400,color:"var(--text-faint)"},children:["\xb7 llama.cpp GGUF",s?" + Ollama":""," \xb7 ",x("models.installed.boundTo")," 127.0.0.1"]})]}),(0,l.jsx)("div",{className:"tbl-wrap",children:(0,l.jsxs)("table",{className:"tbl",style:{marginBottom:24},children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:x("common.name")}),(0,l.jsx)("th",{children:x("models.col.source")}),(0,l.jsx)("th",{children:x("models.col.params")}),(0,l.jsx)("th",{children:x("models.col.size")}),(0,l.jsx)("th",{children:x("models.col.bind")}),(0,l.jsx)("th",{children:x("common.status")}),(0,l.jsx)("th",{style:{textAlign:"right"},children:x("common.actions")})]})}),(0,l.jsxs)("tbody",{children:[d.map(e=>{let a="running"===v&&f&&e.name.includes(f);return(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(H,{name:e.name,size:24})," ",e.name]})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"chip-sm",children:e.quant||"gguf"})}),(0,l.jsx)("td",{style:{color:"var(--text-dim)",fontSize:12},children:e.params||"—"}),(0,l.jsx)("td",{style:{fontFamily:"var(--mono-font)",fontSize:12,color:"var(--text-dim)"},children:e.sizeBytes?F(e.sizeBytes):"—"}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"lr-mono",children:e.bind})}),(0,l.jsx)("td",{children:a?(0,l.jsx)("span",{className:"pill",style:{background:"var(--sx-string)22",color:"var(--sx-string)"},children:x("models.pill.serving")}):(0,l.jsxs)("span",{className:"pill",style:{background:"var(--sx-string)22",color:"var(--sx-string)"},children:["✓ ",x("models.pill.verified")]})}),(0,l.jsx)("td",{children:(0,l.jsxs)("div",{className:"row-actions",children:[(0,l.jsx)("button",{className:"iact accent",title:x("models.title.serveModel"),disabled:L===e.id,onClick:()=>{$(e.id),z(e.id),j(e.name),el(e.id),setTimeout(()=>$(""),500)},children:L===e.id?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:14})}):(0,l.jsx)(t.I,{name:"goto",size:14})}),(0,l.jsx)("button",{className:"iact danger",title:x("common.uninstall"),onClick:()=>W(()=>N(e.id)),children:(0,l.jsx)(t.I,{name:"trash",size:14})})]})})]},"g-"+e.id)}),i.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(r.W,{id:"ollama",size:24})," ",e.name]})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"chip-sm",children:"ollama"})}),(0,l.jsx)("td",{style:{color:"var(--text-faint)",fontSize:12},children:"—"}),(0,l.jsx)("td",{style:{fontFamily:"var(--mono-font)",fontSize:12,color:"var(--text-dim)"},children:e.size?F(e.size):"—"}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"lr-mono",children:"127.0.0.1:11434"})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"pill",style:{background:"var(--text-dim)22",color:"var(--text-dim)"},children:x("models.pill.legacy")})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"row-actions",children:(0,l.jsx)("button",{className:"iact danger",title:x("common.remove"),onClick:()=>W(()=>w(e.name)),children:(0,l.jsx)(t.I,{name:"trash",size:14})})})})]},"o-"+e.name)),0===i.length&&0===d.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:7,style:{textAlign:"center",color:"var(--text-faint)",padding:18},children:x("models.empty.local")})})]})]})}),(0,l.jsxs)("div",{className:"view-section-title",style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,l.jsxs)("span",{children:[x("models.available.title")," ",(0,l.jsxs)("span",{style:{fontWeight:400,color:"var(--text-faint)"},children:["\xb7 ",ee.length,"/",T.length," GGUF (HuggingFace) \xb7 ",x("models.available.fitChecked",{target:"—"!==e.gpu&&K?`${e.vram} VRAM`:"CPU"})]})]}),(0,l.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,l.jsxs)("div",{className:"cs-bar",style:{margin:0,padding:"5px 9px",width:200},children:[(0,l.jsx)(t.I,{name:"search",size:12}),(0,l.jsx)("input",{placeholder:x("models.filterModels"),value:P,onChange:e=>G(e.target.value),style:{fontWeight:400}})]}),(0,l.jsx)("div",{className:"seg",style:{width:280},children:["all","chat","code","reasoning","embed"].map(e=>(0,l.jsx)("button",{className:"seg-opt"+(D===e?" on":""),onClick:()=>O(e),style:{fontSize:11},children:x(`models.kind.${e}`)},e))}),(0,l.jsx)("button",{className:"cs-tog"+(U?" on":""),onClick:()=>E(e=>!e),title:x("models.title.hideTooBig"),style:{fontFamily:"inherit",fontWeight:600},children:x("models.fitsOnly")})]})]}),(0,l.jsxs)("div",{className:"cards-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(330px, 1fr))",gap:12},children:[ee.map(({g:e,fit:a})=>{let s=d.find(a=>a.name===e.name);return(0,l.jsx)(J,{glyph:"llamacpp",brandFromName:!0,name:e.name,repo:e.url.replace("https://huggingface.co/",""),tags:[e.params,e.quant,F(e.sizeBytes)],fit:a,action:()=>S(e.id),progressId:e.id,installed:!!s,onUninstall:s?()=>N(s.id):void 0},e.id)}),0===ee.length&&(0,l.jsx)("div",{className:"muted",style:{fontSize:12,padding:14},children:x("models.empty.noMatch")}),s&&Q.filter(e=>!i.some(a=>a.name===e.name)).map(e=>(0,l.jsx)(J,{glyph:"ollama",name:e.label,repo:e.name,tags:[e.kind,e.size,x("models.pill.legacy")],note:e.note,action:()=>(0,C.j)(e.name)},e.name))]}),a&&(0,l.jsxs)("div",{className:"muted",style:{fontSize:11.5,marginTop:10},children:[(0,l.jsx)(t.I,{name:"terminal",size:12})," ",x("models.ollamaRunning")]})]})}function H({name:e,size:a=36}){let s=function(e){for(let[a,s]of d)if(a.test(e))return`https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg/icons/${s}.svg`;return null}(e),[t,i]=(0,n.useState)(!1);if(!s||t)return(0,l.jsx)(r.W,{id:"llamacpp",size:a});let o=Math.round(.28*a),c=Math.round(.66*a);return(0,l.jsx)("span",{style:{width:a,height:a,flex:`0 0 ${a}px`,borderRadius:o,background:"#fff",display:"grid",placeItems:"center",overflow:"hidden",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.08)"},children:(0,l.jsx)("img",{src:s,alt:"",width:c,height:c,loading:"lazy",onError:()=>i(!0),style:{width:c,height:c,objectFit:"contain",display:"block"}})})}function V(){let e=(0,A.k)(),[a,s]=(0,n.useState)(null),[i,d]=(0,n.useState)(""),[o,c]=(0,n.useState)(""),[,m]=(0,n.useTransition)();(0,n.useEffect)(()=>{I().then(s).catch(()=>{})},[]);let p=a?.up?"run":(a?.installed,"stop"),h=a?a.up?e("models.embed.live"):a.installed?e("models.embed.installedStopped"):e("models.embed.noModel"):e("models.embed.checking");return(0,l.jsxs)("div",{className:"hw-card",children:[(0,l.jsxs)("div",{className:"hw-head",children:[(0,l.jsx)("span",{className:"hw-ic",children:(0,l.jsx)(t.I,{name:"pulse",size:19})}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{className:"hw-t",children:e("models.embed.title")}),(0,l.jsx)("div",{className:"hw-s",children:e("models.embed.sub")})]}),(0,l.jsx)(r.W,{id:"llamacpp",size:22})]}),(0,l.jsxs)("div",{className:"srv-status",children:[(0,l.jsx)("span",{className:"srv-dot "+p}),(0,l.jsxs)("div",{className:"srv-meta",children:[(0,l.jsx)("div",{className:"sm-t",children:h}),(0,l.jsxs)("div",{className:"sm-s",children:["127.0.0.1:8083 \xb7 ",a?.model??"nomic-embed-text"]})]}),a&&!a.up&&a.installed&&(0,l.jsxs)("button",{className:"btn-accent",disabled:"start"===i,onClick:function(){d("start"),c(e("models.embed.starting")),m(async()=>{let a=await M();d(""),c(a.up?"":a.reason??e("models.embed.startFailed")),s(e=>e?{...e,up:a.up,model:a.model??e.model}:e)})},children:["start"===i?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:13})}):(0,l.jsx)(t.I,{name:"goto",size:13})," ",e("common.start")]}),a?.up&&(0,l.jsxs)("button",{className:"btn-ghost",disabled:"reindex"===i,onClick:function(){d("reindex"),c(e("models.embed.indexing")),m(async()=>{let a=await z();d(""),c(a.ok?e(a.embedded?"models.embed.indexedSemantic":"models.embed.indexedKeyword",{n:a.chunks}):e("models.embed.indexFailed")),I().then(s).catch(()=>{})})},children:["reindex"===i?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:13})}):(0,l.jsx)(t.I,{name:"refresh",size:13})," ",e("models.embed.reindex")]})]}),a&&!a.installed&&(0,l.jsxs)("div",{className:"form-hint",style:{marginTop:8},children:[(0,l.jsx)(t.I,{name:"add",size:12})," ",e("models.embed.downloadHintBefore")," ",(0,l.jsx)("b",{style:{color:"var(--text)"},children:"nomic-embed-text-v1.5"})," ",e("models.embed.downloadHintAfter")]}),o&&(0,l.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",marginTop:8},children:o})]})}function Y(e){let a=/([\d.]+)\s*(TB|GB|MB|KB|B)?/i.exec(e||"");if(!a)return 0;let s=parseFloat(a[1]),l=(a[2]||"B").toUpperCase();return s*("TB"===l?1e12:"GB"===l?1e9:"MB"===l?1e6:"KB"===l?1e3:1)}let X={ok:"var(--sx-string)",tight:"var(--sx-number)",no:"#e8688f"};function J({glyph:e,name:a,repo:s,tags:i,note:d,action:o,installed:c,onUninstall:m,fit:p,brandFromName:h,progressId:u}){let x=(0,A.k)(),[v,g]=(0,n.useState)("idle"),[f,j]=(0,n.useState)(!1),[b,k]=(0,n.useState)(""),[B,y]=(0,n.useState)(null),[,N]=(0,n.useTransition)(),w=B&&B.total>0?Math.min(100,Math.round(B.received/B.total*100)):null;async function S(){let e;g("working"),k(""),y(null),u&&(e=setInterval(()=>{fetch(`/api/models/progress?id=${encodeURIComponent(u)}`).then(e=>e.json()).then(e=>{e&&y({received:e.received,total:e.total})}).catch(()=>{})},600));try{let e=await o();g(e.ok?"done":"error"),k(e.ok?"":e.error??x("models.dl.failed"))}finally{e&&clearInterval(e),y(null)}}return(0,l.jsxs)("div",{className:"dl-card",children:[h?(0,l.jsx)(H,{name:a,size:36}):(0,l.jsx)(r.W,{id:e,size:36}),(0,l.jsxs)("div",{className:"dl-main",children:[(0,l.jsx)("div",{className:"dl-name",children:a}),(0,l.jsx)("div",{className:"dl-repo",title:s,children:s.length>46?s.slice(0,46)+"…":s}),(0,l.jsxs)("div",{className:"dl-tags",children:[i.map(e=>(0,l.jsx)("span",{className:"dl-tag",children:e},e)),p&&p.key&&(0,l.jsx)("span",{className:"dl-tag",style:{color:X[p.tone],borderColor:X[p.tone]},children:x(`models.fit.${p.key}`,{unit:p.unit??""})})]}),d&&(0,l.jsx)("div",{style:{fontSize:11,color:"var(--text-faint)",marginTop:4},children:d}),b&&(0,l.jsx)("div",{style:{fontSize:11,color:"error"===v?"var(--sx-keyword)":"var(--sx-string)",marginTop:4},children:b}),"working"===v&&u&&(0,l.jsxs)("div",{style:{marginTop:6},children:[(0,l.jsx)("div",{style:{height:4,background:"var(--bg-active)",borderRadius:3,overflow:"hidden"},children:(0,l.jsx)("div",{className:null===w?"sync-spin":"",style:{height:"100%",width:(w??12)+"%",background:"var(--accent)",transition:"width .3s"}})}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--text-faint)",marginTop:3,fontFamily:"var(--mono-font)"},children:null!==w&&B?`${w}% \xb7 ${F(B.received)} / ${F(B.total)}`:B&&B.received>0?x("models.dl.downloaded",{size:F(B.received)}):x("models.dl.starting")})]})]}),(0,l.jsx)("div",{className:"dl-right",children:c&&!f||"done"===v?m?(0,l.jsxs)("button",{className:"act-btn",disabled:"working"===v,onClick:()=>N(async()=>{g("working"),k(x("models.dl.removing"));let e=await m();e.ok?(j(!0),g("idle"),k("")):(g("error"),k(e.error??x("models.dl.failed")))}),children:["working"===v?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:11})}):(0,l.jsx)(t.I,{name:"trash",size:11})," ","working"===v?x("models.dl.removingBtn"):x("common.uninstall")]}):(0,l.jsxs)("span",{className:"act-btn",style:{color:"var(--sx-string)"},children:[(0,l.jsx)(t.I,{name:"check",size:11})," ",x("models.dl.installed")]}):(0,l.jsxs)("button",{className:"act-btn accent",disabled:"working"===v,onClick:S,children:["working"===v?(0,l.jsx)("span",{className:"sync-spin",children:(0,l.jsx)(t.I,{name:"refresh",size:11})}):(0,l.jsx)(t.I,{name:"add",size:11})," ","working"===v?null!==w?w+"%":x("models.dl.pulling"):x("common.download")]})})]})}function Z({agents:e,providers:a}){let s=(0,A.k)(),[r,d]=(0,n.useState)(e),[m,p]=(0,n.useState)(!1),[,h]=(0,n.useTransition)(),u=(0,n.useMemo)(()=>{let e=new Set,s=[];for(let l of a)e.has(l.adapter)||(e.add(l.adapter),s.push({value:l.adapter,label:l.displayName,glyphId:l.catalogId}));return s},[a]);function x(e,a){d(s=>s.map(s=>s.id===e?{...s,...a}:s)),p(!1)}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:16},children:[(0,l.jsx)("div",{className:"view-sub",style:{fontSize:13},children:s("models.perAgent.intro")}),(0,l.jsx)("div",{style:{marginLeft:"auto"},children:m?(0,l.jsxs)("span",{className:"oauth-ok",style:{padding:"6px 11px"},children:[(0,l.jsx)(t.I,{name:"check",size:13})," ",s("common.saved")]}):(0,l.jsxs)("button",{className:"btn-accent",onClick:function(){h(async()=>{for(let e of r)await (0,_.k)(e.id,{adapter:e.adapter,model:e.model});p(!0),setTimeout(()=>p(!1),1600)})},children:[(0,l.jsx)(t.I,{name:"check",size:13})," ",s("models.perAgent.saveAssignments")]})})]}),(0,l.jsx)("div",{className:"pa-grid",children:r.map(e=>{let n;return(0,l.jsxs)("div",{className:"pa-card",children:[(0,l.jsxs)("div",{className:"pa-head",children:[(0,l.jsx)(i.e,{name:e.name,color:e.color,size:36}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{className:"pa-n",children:e.name}),(0,l.jsxs)("div",{className:"pa-r",children:[e.role," \xb7 @",e.handle]})]})]}),(0,l.jsxs)("div",{className:"pa-field",children:[(0,l.jsx)("div",{className:"pa-flabel",children:s("models.field.provider")}),(0,l.jsx)(o.m,{glyph:!0,searchable:!0,value:e.adapter,options:(n=e.adapter,u.some(e=>e.value===n)?u:[{value:n,label:n.replace(/^http_|^local_|^cli_|^sdk_/,"")+" \xb7 "+s("models.notConnected"),glyphId:n},...u]),onChange:a=>x(e.id,{adapter:a})})]}),(0,l.jsxs)("div",{className:"pa-field",children:[(0,l.jsx)("div",{className:"pa-flabel",children:s("models.field.model")}),(0,l.jsx)(c.Y,{adapter:e.adapter,value:e.model,onChange:a=>x(e.id,{model:a}),providers:a})]})]},e.id)})})]})}function ee({connectedIds:e,onClose:a}){let s=(0,A.k)(),[i,d]=(0,n.useState)(""),[o,c]=(0,n.useState)("all"),[m,p]=(0,n.useState)("all"),[h,u]=(0,n.useState)("all"),[x,v]=(0,n.useState)(null),[g,f]=(0,n.useState)(""),[,k]=(0,n.useTransition)(),B=(0,n.useMemo)(()=>Array.from(new Set(b.WQ.map(e=>e.category))),[]),y=(0,n.useMemo)(()=>Array.from(new Set(b.WQ.flatMap(e=>e.connectionTypes))),[]),N=(0,n.useMemo)(()=>Array.from(new Set(b.WQ.map(e=>e.status))),[]),w=i.trim().toLowerCase(),S=b.WQ.filter(e=>("all"===o||e.category===o)&&("all"===m||!!e.connectionTypes.includes(m))&&("all"===h||e.status===h)&&(!w||!!(e.displayName.toLowerCase().includes(w)||e.id.includes(w)||(e.notes??"").toLowerCase().includes(w)||e.defaultAdapter.includes(w))));function C(e,s){k(async()=>{await j(e,s),v(null),f(""),a()})}return(0,l.jsx)("div",{className:"cat-overlay",onMouseDown:a,children:(0,l.jsxs)("div",{className:"cat-modal",onMouseDown:e=>e.stopPropagation(),children:[(0,l.jsxs)("div",{className:"cat-head",children:[(0,l.jsxs)("div",{className:"cat-head-row",children:[(0,l.jsx)("div",{className:"cat-ico",style:{width:40,height:40,flexBasis:40},children:(0,l.jsx)(t.I,{name:"cpu",size:20})}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{className:"cat-title",children:s("models.catalog.title")}),(0,l.jsx)("div",{className:"cat-sub",children:s("models.catalog.sub",{n:b.WQ.length})})]}),(0,l.jsx)("button",{className:"dock-tool",onClick:a,children:(0,l.jsx)(t.I,{name:"close",size:16})})]}),(0,l.jsxs)("div",{className:"cat-search",children:[(0,l.jsx)(t.I,{name:"search",size:15}),(0,l.jsx)("input",{placeholder:s("models.catalog.searchPlaceholder"),value:i,autoFocus:!0,onChange:e=>d(e.target.value)})]})]}),(0,l.jsx)("div",{className:"cat-filters",children:(0,l.jsxs)("div",{className:"cat-fgroup",children:[(0,l.jsx)("span",{className:"fg-label",children:s("models.filter.category")}),(0,l.jsx)("button",{className:"cat-chip"+("all"===o?" on":""),onClick:()=>c("all"),children:s("common.all")}),B.map(e=>(0,l.jsx)("button",{className:"cat-chip"+(o===e?" on":""),onClick:()=>c(e),children:s(`models.cat.${e}`)},e))]})}),(0,l.jsxs)("div",{className:"cat-filters",style:{paddingTop:8,paddingBottom:8},children:[(0,l.jsxs)("div",{className:"cat-fgroup",children:[(0,l.jsx)("span",{className:"fg-label",children:s("models.filter.connection")}),(0,l.jsx)("button",{className:"cat-chip"+("all"===m?" on":""),onClick:()=>p("all"),children:s("common.all")}),y.map(e=>(0,l.jsx)("button",{className:"cat-chip"+(m===e?" on":""),onClick:()=>p(e),children:s(`models.conn.${e}`)},e))]}),(0,l.jsxs)("div",{className:"cat-fgroup",children:[(0,l.jsx)("span",{className:"fg-label",children:s("common.status")}),(0,l.jsx)("button",{className:"cat-chip"+("all"===h?" on":""),onClick:()=>u("all"),children:s("common.all")}),N.map(e=>(0,l.jsx)("button",{className:"cat-chip"+(h===e?" on":""),onClick:()=>u(e),children:s(`models.catStatus.${e}`)},e))]}),(0,l.jsx)("span",{className:"cat-count",children:s("models.catalog.shown",{n:S.length})})]}),(0,l.jsxs)("div",{className:"cat-grid",children:[0===S.length&&(0,l.jsx)("div",{className:"cat-empty",children:s("models.catalog.noMatch")}),S.map(a=>{let n=e.includes(a.id),i="available"===a.status||"experimental"===a.status||"requires_setup"===a.status;return(0,l.jsxs)("div",{className:"cat-card",children:[(0,l.jsxs)("div",{className:"cat-card-top",children:[(0,l.jsx)(r.W,{id:a.id,size:34}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{className:"cat-name",children:a.displayName}),(0,l.jsxs)("div",{className:"cat-meta",children:[s(`models.cat.${a.category}`)," \xb7 ",(0,l.jsx)("span",{style:{fontFamily:"var(--mono-font)"},children:a.defaultAdapter})]})]}),(0,l.jsx)("span",{className:"cat-stat",style:{background:P[a.status]+"22",color:P[a.status]},children:s(`models.catStatus.${a.status}`)})]}),a.notes&&(0,l.jsx)("div",{className:"cat-notes",children:a.notes}),(0,l.jsxs)("div",{className:"cat-caps",children:[a.supportsModelSync&&(0,l.jsx)("span",{className:"cap-tag sync",children:s("models.cap.sync")}),a.supportsVision&&(0,l.jsx)("span",{className:"cap-tag",children:s("models.cap.vision")}),a.supportsTools&&(0,l.jsx)("span",{className:"cap-tag",children:s("models.cap.tools")})]}),x===a.id?(0,l.jsxs)("div",{className:"cat-card-foot",style:{gap:6},children:[(0,l.jsx)("input",{className:"form-input mono",style:{flex:1,height:30},placeholder:s("models.apiKeyPlaceholder"),value:g,autoFocus:!0,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"===e.key&&C(a.id,g)}}),(0,l.jsx)("button",{className:"act-btn accent",onClick:()=>C(a.id,g),children:s("common.save")})]}):(0,l.jsxs)("div",{className:"cat-card-foot",children:[(0,l.jsx)("div",{className:"cat-conn",children:a.connectionTypes.map(e=>(0,l.jsx)("span",{className:"conn-tag",children:s(`models.conn.${e}`)},e))}),n?(0,l.jsxs)("span",{className:"act-btn",style:{color:"var(--sx-string)",borderColor:"color-mix(in srgb, var(--sx-string) 40%, var(--border))"},children:[(0,l.jsx)(t.I,{name:"check",size:11})," ",s("common.connected")]}):i?(0,l.jsxs)("button",{className:"act-btn accent",onClick:()=>!a.supportsApiKey||a.connectionTypes.includes("local")||a.connectionTypes.includes("cli")?C(a.id):v(a.id),children:[(0,l.jsx)(t.I,{name:"add",size:11})," ",s("common.connect")]}):(0,l.jsx)("button",{className:"act-btn",disabled:!0,children:"planned"===a.status?s("models.catStatus.planned"):s("models.catStatus.unsupported")})]})]},a.id)})]})]})})}function ea({providers:e,locals:a,agents:s,hardware:i,ollamaUp:r,ollamaInstalled:d,installed:o,llamaUp:c,llamaInstalled:m,llamaModel:p}){let h=(0,A.k)(),[u,x]=(0,n.useState)("connected"),[v,g]=(0,n.useState)(!1),[f,j]=(0,n.useState)(null),k=e.filter(e=>"cloud"===e.kind),B=e.filter(e=>"cli"===e.kind),y=e.map(e=>e.catalogId),N=(0,n.useMemo)(()=>b.WQ.reduce((e,a)=>(e[a.status]=(e[a.status]??0)+1,e),{}),[]);(0,n.useEffect)(()=>{let e=()=>g(!0);return window.addEventListener("constella:models-catalog",e),()=>window.removeEventListener("constella:models-catalog",e)},[]);let w=[{id:"connected",label:h("models.tab.connected"),icon:"grid",badge:k.length+B.length},{id:"local",label:h("models.tab.local"),icon:"cpu"},{id:"agents",label:h("models.tab.perAgent"),icon:"agents"}];return(0,l.jsxs)("div",{style:{position:"relative"},children:[(0,l.jsxs)("div",{className:"dash-grid",style:{marginBottom:20},children:[(0,l.jsxs)("div",{className:"dash-card",style:{gridColumn:"span 3"},children:[(0,l.jsx)("h3",{children:h("models.kpi.catalog")}),(0,l.jsx)("div",{className:"kpi",children:b.WQ.length}),(0,l.jsx)("div",{className:"kpi-sub",children:h("models.kpi.providers")})]}),(0,l.jsxs)("div",{className:"dash-card",style:{gridColumn:"span 3"},children:[(0,l.jsx)("h3",{children:h("models.kpi.available")}),(0,l.jsx)("div",{className:"kpi",style:{color:"var(--sx-string)"},children:N.available??0}),(0,l.jsx)("div",{className:"kpi-sub",children:h("models.kpi.adaptersReady")})]}),(0,l.jsxs)("div",{className:"dash-card",style:{gridColumn:"span 3"},children:[(0,l.jsx)("h3",{children:h("models.kpi.planned")}),(0,l.jsx)("div",{className:"kpi",style:{color:"#f0a35e"},children:(N.planned??0)+(N.experimental??0)}),(0,l.jsx)("div",{className:"kpi-sub",children:h("models.kpi.plannedExperimental")})]}),(0,l.jsxs)("div",{className:"dash-card",style:{gridColumn:"span 3"},children:[(0,l.jsx)("h3",{children:h("models.kpi.connected")}),(0,l.jsx)("div",{className:"kpi",style:{color:"var(--accent)"},children:e.length}),(0,l.jsx)("div",{className:"kpi-sub",children:h("models.kpi.inWorkspace")})]})]}),(0,l.jsx)("div",{className:"seg-nav",children:w.map(e=>(0,l.jsxs)("button",{className:"seg-nav-btn"+(u===e.id?" on":""),onClick:()=>x(e.id),children:[(0,l.jsx)(t.I,{name:e.icon,size:14})," ",e.label,null!=e.badge&&(0,l.jsx)("span",{className:"sn-badge",children:e.badge})]},e.id))}),"connected"===u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"view-section-title",children:["☁ ",h("models.section.cloud")]}),(0,l.jsx)(E,{rows:k,kind:"cloud",onViewModels:(e,a)=>{let s=a.currentTarget.getBoundingClientRect();j({row:e,pos:{x:s.left,y:s.bottom+6}})}}),(0,l.jsxs)("div",{className:"view-section-title",children:["⌘ ",h("models.section.cli")]}),(0,l.jsx)(E,{rows:B,kind:"cli",onViewModels:(e,a)=>{let s=a.currentTarget.getBoundingClientRect();j({row:e,pos:{x:s.left,y:s.bottom+6}})}})]}),"local"===u&&(0,l.jsx)(q,{hw:i,ollamaUp:r,ollamaInstalled:d,installed:o,locals:a,llamaUp:c,llamaInstalled:m,llamaModel:p}),"agents"===u&&(0,l.jsx)(Z,{agents:s,providers:e.map(e=>({id:e.id,adapter:e.adapter,catalogId:e.catalogId,displayName:e.displayName,kind:e.kind}))}),v&&(0,l.jsx)(ee,{connectedIds:y,onClose:()=>g(!1)}),f&&(0,l.jsx)(K,{row:f.row,pos:f.pos,onClose:()=>j(null)})]})}function es(){let e=(0,A.k)();return(0,l.jsxs)("button",{className:"btn-accent",onClick:()=>window.dispatchEvent(new CustomEvent("constella:models-catalog")),children:[(0,l.jsx)(t.I,{name:"grid",size:14})," ",e("models.catalog.title")]})}},3198:(e,a,s)=>{"use strict";s.d(a,{A:()=>n});var l=s(7814);let n=(0,l.createServerReference)("40383cad7813d19d1b7fb6247022228ce67cf6dec0",l.callServer,void 0,l.findSourceMapURL,"listCatalogModels")},4403:(e,a,s)=>{"use strict";s.d(a,{Y:()=>m});var l=s(5076),n=s(8488),t=s(3728),i=s(5629);let r={cli_claude_code:[{value:"opus",label:"Claude Opus \xb7 most capable"},{value:"sonnet",label:"Claude Sonnet \xb7 balanced"},{value:"haiku",label:"Claude Haiku \xb7 fast"}],cli_codex:[{value:"gpt-5-codex",label:"GPT-5 Codex"},{value:"o4-mini",label:"o4-mini"}],cli_gemini:[{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro"},{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash"}],cli_openclaw:[{value:"(default)",label:"Configured default"},{value:"openai/gpt-5.4",label:"OpenAI \xb7 GPT-5.4"},{value:"anthropic/claude-sonnet-4",label:"Anthropic \xb7 Claude Sonnet 4"}],cli_hermes:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4.6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.5",label:"OpenAI \xb7 GPT-5.5"}],cli_aider:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4-6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.2",label:"OpenAI \xb7 GPT-5.2"},{value:"deepseek/deepseek-chat",label:"DeepSeek \xb7 Chat"}],cli_opencode:[{value:"(default)",label:"Configured default"},{value:"anthropic/claude-sonnet-4-6",label:"Anthropic \xb7 Claude Sonnet 4.6"},{value:"openai/gpt-5.2",label:"OpenAI \xb7 GPT-5.2"}],cli_copilot:[{value:"(default)",label:"Configured default"},{value:"claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{value:"gpt-5",label:"GPT-5"}],cli_cursor:[{value:"(default)",label:"Configured default"},{value:"claude-4.5-sonnet",label:"Claude Sonnet 4.5"},{value:"gpt-5",label:"GPT-5"}],cli_cline:[{value:"(default)",label:"Configured default"}],cli_kilo:[{value:"(default)",label:"Configured default"}]};var d=s(6517),o=s(3198),c=s(9572);function m({adapter:e,value:a,onChange:s,providers:p}){let h=(0,i.k)(),u=function(e){let a=r[e]??null;if(!a)return null;let s=(0,d.L2)(e);return s?a.map(e=>{let a=s.find(a=>a.id===e.value);return a?{value:e.value,label:`${a.label} ${a.version}${a.note?" \xb7 "+a.note:""}`}:e}):a}(e),x=e.startsWith("local_"),[v,g]=(0,n.useState)(null),[f,j]=(0,n.useState)(""),b=p.find(a=>a.adapter===e);(0,n.useEffect)(()=>{if(u||x||!b){g(null),j(u||x?"":h("modelpicker.connectProvider"));return}let e=!0;return j(h("modelpicker.loading")),(0,o.A)(b.id).then(async({models:l})=>{if(!e)return;if(l.length){if(g(l.map(e=>{let a;return{value:e.id,label:e.name+(a=[],e.context&&a.push(e.context>=1e6?`${(e.context/1e6).toFixed(e.context%1e6?1:0)}M ctx`:`${Math.round(e.context/1e3)}K ctx`),(e.inputCost||e.outputCost)&&a.push(`$${e.inputCost}/${e.outputCost}`),a.length?" \xb7 "+a.join(" \xb7 "):"")+(e.isDefault?" \xb7 "+h("modelpicker.recommended"):"")}})),j(""),!a){let e=l.find(e=>e.isDefault)??l[0];e&&s(e.id)}return}let n=await (0,c.E)(b.id);e&&(g(n.models.map(e=>({value:e,label:e}))),j(n.error?n.error:n.models.length?h("modelpicker.syncProvider"):h("modelpicker.noModels")))}).catch(()=>{e&&(g([]),j(h("modelpicker.loadError")))}),()=>{e=!1}},[e,b?.id,!!u,x]);let k=x?[{value:a||"local",label:h("modelpicker.localGguf")}]:null,B=u??k??v??(a?[{value:a,label:a}]:[]),y=a&&!B.some(e=>e.value===a)?[{value:a,label:a},...B]:B;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.m,{mono:!0,value:a,options:y,placeholder:h("modelpicker.placeholder"),onChange:s}),f&&(0,l.jsx)("div",{className:"form-hint",style:{marginTop:4},children:f})]})}},4552:(e,a,s)=>{"use strict";s.d(a,{e:()=>n});var l=s(5076);function n({name:e,color:a,size:s=24,health:t,image:i}){let r=Math.max(6,Math.round(.3*s)),d=Math.round(.28*s),o=i?/^(data:|https?:|\/)/.test(i)?i:`/api/upload?path=${encodeURIComponent(i)}`:null;return(0,l.jsxs)("span",{style:{position:"relative",width:s,height:s,flex:`0 0 ${s}px`,display:"inline-block"},children:[o?(0,l.jsx)("img",{src:o,alt:e,width:s,height:s,style:{width:s,height:s,borderRadius:d,objectFit:"cover",display:"block"}}):(0,l.jsx)("span",{style:{width:s,height:s,borderRadius:d,background:a,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*s),fontWeight:700},children:(e[0]||"?").toUpperCase()}),t&&(0,l.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:r,height:r,borderRadius:"50%",background:"alive"===t?"var(--sx-string)":"stale"===t?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4813:(e,a,s)=>{Promise.resolve().then(s.t.bind(s,3283,23)),Promise.resolve().then(s.bind(s,2064)),Promise.resolve().then(s.bind(s,6719)),Promise.resolve().then(s.bind(s,6588)),Promise.resolve().then(s.bind(s,4414)),Promise.resolve().then(s.bind(s,4226)),Promise.resolve().then(s.bind(s,4942)),Promise.resolve().then(s.bind(s,2444)),Promise.resolve().then(s.bind(s,5787))},6e3:(e,a,s)=>{"use strict";s.d(a,{j:()=>n});var l=s(7814);let n=(0,l.createServerReference)("40fcc0e1aa167e9f1f5273fbcfc48ea65c17d142a9",l.callServer,void 0,l.findSourceMapURL,"pullModel")},6517:(e,a,s)=>{"use strict";s.d(a,{L2:()=>n,Ov:()=>t});let l={cli_claude_code:[{id:"opus",label:"Claude Opus",version:"4.8",note:"most capable"},{id:"sonnet",label:"Claude Sonnet",version:"4.6",note:"balanced"},{id:"haiku",label:"Claude Haiku",version:"4.5",note:"fast"}],cli_codex:[{id:"gpt-5-codex",label:"GPT-5 Codex",version:"5"},{id:"o4-mini",label:"o4-mini",version:"o4"}],cli_gemini:[{id:"gemini-2.5-pro",label:"Gemini Pro",version:"2.5"},{id:"gemini-2.5-flash",label:"Gemini Flash",version:"2.5"}],cli_openclaw:[{id:"(default)",label:"OpenClaw",version:"default",note:"configured provider"},{id:"openai/gpt-5.4",label:"GPT",version:"5.4"},{id:"anthropic/claude-sonnet-4",label:"Claude Sonnet",version:"4"}],cli_hermes:[{id:"(default)",label:"Hermes",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4.6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.5",label:"GPT",version:"5.5"}],cli_aider:[{id:"(default)",label:"Aider",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.2",label:"GPT",version:"5.2"},{id:"deepseek/deepseek-chat",label:"DeepSeek Chat",version:""}],cli_opencode:[{id:"(default)",label:"OpenCode",version:"default",note:"configured provider"},{id:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet",version:"4.6"},{id:"openai/gpt-5.2",label:"GPT",version:"5.2"}],cli_copilot:[{id:"(default)",label:"Copilot",version:"default",note:"configured provider"},{id:"claude-sonnet-4.5",label:"Claude Sonnet",version:"4.5"},{id:"gpt-5",label:"GPT",version:"5"}],cli_cursor:[{id:"(default)",label:"Cursor",version:"default",note:"configured provider"},{id:"claude-4.5-sonnet",label:"Claude Sonnet",version:"4.5"},{id:"gpt-5",label:"GPT",version:"5"}],cli_cline:[{id:"(default)",label:"Cline",version:"default",note:"configured provider"}],cli_kilo:[{id:"(default)",label:"Kilo Code",version:"default",note:"configured provider"}]};function n(e){return l[e]??null}function t(e){if(!e)return{label:"",version:""};let a=e.match(/(\d+(?:[.\-]\d+){0,2})(?!.*\d)/),s=a?a[1].replace(/-/g,"."):"";return{label:(a?e.slice(0,a.index).replace(/[-_.\s]+$/,""):e).split(/[-_.\s]+/).filter(Boolean).map(e=>/^(gpt|llm|api|ai)$/i.test(e)?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||e,version:s}}},8670:(e,a,s)=>{"use strict";s.d(a,{k:()=>n});var l=s(7814);let n=(0,l.createServerReference)("6032fb7d29011580ccf74fba3b59c2dd3e048a4582",l.callServer,void 0,l.findSourceMapURL,"saveAgentModel")},9572:(e,a,s)=>{"use strict";s.d(a,{E:()=>n});var l=s(7814);let n=(0,l.createServerReference)("409fd412f863bec5e83a51573dc91e19aa36f535b0",l.callServer,void 0,l.findSourceMapURL,"listProviderModels")}},e=>{e.O(0,[9219,3219,3448,8370,4263,6646,6834,7358],()=>e(e.s=4813)),_N_E=e.O()}]);