constellai 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -3
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/(app)/activity/page.js +2 -2
  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 +5 -5
  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 +3 -3
  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 +6 -6
  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 +3 -3
  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 +2 -2
  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 +3 -3
  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.js.nft.json +1 -1
  109. package/.next/server/app/(auth)/login/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/(auth)/onboarding/page.js +2 -2
  111. package/.next/server/app/(auth)/onboarding/page.js.nft.json +1 -1
  112. package/.next/server/app/(auth)/onboarding/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/_global-error/page.js +1 -1
  114. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  115. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/_global-error.html +1 -1
  117. package/.next/server/app/_global-error.rsc +3 -3
  118. package/.next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  119. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  120. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  121. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  122. package/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  123. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  124. package/.next/server/app/_not-found/page.js +1 -1
  125. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  126. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/cron/tick/route.js +16 -16
  128. package/.next/server/app/api/locks/acquire/route.js +1 -1
  129. package/.next/server/app/api/sync/file/route.js +2 -2
  130. package/.next/server/app/api/telegram/poll/route.js +10 -10
  131. package/.next/server/app/api/upload/route.js +1 -1
  132. package/.next/server/app/api/v1/[[...path]]/route.js +1 -1
  133. package/.next/server/app-paths-manifest.json +3 -3
  134. package/.next/server/chunks/1249.js +14 -14
  135. package/.next/server/chunks/158.js +21 -0
  136. package/.next/server/chunks/1765.js +1 -0
  137. package/.next/server/chunks/1845.js +1 -1
  138. package/.next/server/chunks/2495.js +1 -0
  139. package/.next/server/chunks/2517.js +1 -1
  140. package/.next/server/chunks/259.js +9 -9
  141. package/.next/server/chunks/260.js +1 -1
  142. package/.next/server/chunks/2867.js +2 -2
  143. package/.next/server/chunks/2960.js +1 -1
  144. package/.next/server/chunks/3131.js +1 -1
  145. package/.next/server/chunks/3234.js +4 -4
  146. package/.next/server/chunks/4467.js +12 -0
  147. package/.next/server/chunks/4619.js +1 -1
  148. package/.next/server/chunks/4979.js +12 -12
  149. package/.next/server/chunks/535.js +1 -0
  150. package/.next/server/chunks/6431.js +1 -1
  151. package/.next/server/chunks/7225.js +4 -0
  152. package/.next/server/chunks/7336.js +1 -1
  153. package/.next/server/chunks/7589.js +3 -3
  154. package/.next/server/chunks/7989.js +1 -1
  155. package/.next/server/chunks/850.js +1 -1
  156. package/.next/server/chunks/8561.js +3 -3
  157. package/.next/server/chunks/8623.js +1 -1
  158. package/.next/server/chunks/8719.js +417 -0
  159. package/.next/server/chunks/8762.js +15 -417
  160. package/.next/server/chunks/8823.js +1 -1
  161. package/.next/server/chunks/9783.js +3 -3
  162. package/.next/server/chunks/9969.js +1 -1
  163. package/.next/server/instrumentation.js +1 -1
  164. package/.next/server/middleware-build-manifest.js +1 -1
  165. package/.next/server/pages/500.html +1 -1
  166. package/.next/server/server-reference-manifest.js +1 -1
  167. package/.next/server/server-reference-manifest.json +1 -1
  168. package/.next/static/chunks/2831-d7f6495bf43f4f9d.js +4 -0
  169. package/.next/static/chunks/{3219-b4941c7ff967e904.js → 3219-486bddbf87074d04.js} +1 -1
  170. package/.next/static/chunks/3775-82dcdf23109aa5bf.js +1 -0
  171. package/.next/static/chunks/6836-341614c5418e2aa4.js +1 -0
  172. package/.next/static/chunks/8306-7418693cd7fd5861.js +1 -0
  173. package/.next/static/chunks/{8370-2733742abf5f3ddf.js → 8370-8b3e7106703024ce.js} +2 -2
  174. package/.next/static/chunks/9690-ea874aec65263b9d.js +1 -0
  175. package/.next/static/chunks/app/(app)/activity/{page-29e80a32c02f376b.js → page-cf8d67941440bdce.js} +1 -1
  176. package/.next/static/chunks/app/(app)/agents/[handle]/page-7baa24f1ae8bc400.js +1 -0
  177. package/.next/static/chunks/app/(app)/code/page-b342d74807e8b914.js +1 -0
  178. package/.next/static/chunks/app/(app)/config/page-1e68ba8d20215d67.js +1 -0
  179. package/.next/static/chunks/app/(app)/costs/page-a58d759eec6048df.js +1 -0
  180. package/.next/static/chunks/app/(app)/cron/page-cc7f4e3d8ab5618f.js +1 -0
  181. package/.next/static/chunks/app/(app)/dashboard/page-7757c33acf751c4c.js +1 -0
  182. package/.next/static/chunks/app/(app)/design/{page-238be90d78d22780.js → page-f48c0487d240248e.js} +3 -3
  183. package/.next/static/chunks/app/(app)/docs/[id]/page-95c52cf457d869ef.js +1 -0
  184. package/.next/static/chunks/app/(app)/docs/page-fbc50cd357d5e2ca.js +1 -0
  185. package/.next/static/chunks/app/(app)/github/page-dac138256ed91e65.js +1 -0
  186. package/.next/static/chunks/app/(app)/goals/page-f87d40f6832d63b3.js +1 -0
  187. package/.next/static/chunks/app/(app)/inbox/page-49c1293e0d98874f.js +12 -0
  188. package/.next/static/chunks/app/(app)/knowledge/page-18fca436883ed5cc.js +1 -0
  189. package/.next/static/chunks/app/(app)/layout-c9778f98c0103f74.js +1 -0
  190. package/.next/static/chunks/app/(app)/models/page-030c085cd7767495.js +1 -0
  191. package/.next/static/chunks/app/(app)/notifications/page-12af3fee8b36a00e.js +12 -0
  192. package/.next/static/chunks/app/(app)/org/page-576001ff4a820744.js +12 -0
  193. package/.next/static/chunks/app/(app)/organizations/page-b973e1eee6e56baf.js +1 -0
  194. package/.next/static/chunks/app/(app)/page-cef52fc5f4fd4418.js +1 -0
  195. package/.next/static/chunks/app/(app)/planner/page-da2db56914346192.js +1 -0
  196. package/.next/static/chunks/app/(app)/plugins/{page-d10239fcbabdf4fa.js → page-3b78b76ecb21d616.js} +1 -1
  197. package/.next/static/chunks/app/(app)/pm/{page-61ad11558f241cf1.js → page-78303379c1ea5dc5.js} +1 -1
  198. package/.next/static/chunks/app/(app)/prepare-deploy/page-98b1bd3bf712bb60.js +1 -0
  199. package/.next/static/chunks/app/(app)/profile/page-de24af53de0ef2b2.js +1 -0
  200. package/.next/static/chunks/app/(app)/pulse/page-db7fd63369c01fa2.js +1 -0
  201. package/.next/static/chunks/app/(app)/reports/[id]/page-cc7f4e3d8ab5618f.js +1 -0
  202. package/.next/static/chunks/app/(app)/reports/page-97ab95e6f8b77b62.js +1 -0
  203. package/.next/static/chunks/app/(app)/routines/page-cf6a3331775ca11b.js +1 -0
  204. package/.next/static/chunks/app/(app)/search/page-3960825f66b05606.js +1 -0
  205. package/.next/static/chunks/app/(app)/security/page-53b0770355cf7aa4.js +1 -0
  206. package/.next/static/chunks/app/(app)/skills/{page-72691864856c9906.js → page-809a73b94861f8b8.js} +1 -1
  207. package/.next/static/chunks/app/(app)/tasks/page-b2497927d127f7aa.js +1 -0
  208. package/.next/static/chunks/app/(app)/test-dev/page-93ec5d89e2afb612.js +1 -0
  209. package/.next/static/chunks/app/(app)/update/page-a23322af4e59a93c.js +1 -0
  210. package/.next/static/chunks/app/(auth)/login/page-446681bfb762cb05.js +1 -0
  211. package/.next/static/chunks/app/(auth)/onboarding/page-2b8cb3e0b024c995.js +1 -0
  212. package/.next/trace-build +1 -1
  213. package/CHANGELOG.md +37 -0
  214. package/README.md +7 -1
  215. package/README.pt-BR.md +7 -1
  216. package/bin/constella-update.mjs +19 -7
  217. package/bin/constella.mjs +1 -1
  218. package/bin/worker.mjs +1 -0
  219. package/docs/UPDATE.md +11 -2
  220. package/docs/roadmap.md +36 -0
  221. package/package.json +1 -1
  222. package/scripts/i18n-parity.mjs +1 -1
  223. package/scripts/install.sh +4 -2
  224. package/scripts/publish-public.mjs +12 -3
  225. package/scripts/vps-clean.sh +1 -1
  226. package/scripts/vps-install.sh +19 -5
  227. package/scripts/vps-update.sh +26 -17
  228. package/.next/server/chunks/212.js +0 -1
  229. package/.next/server/chunks/6381.js +0 -15
  230. package/.next/server/chunks/6853.js +0 -12
  231. package/.next/server/chunks/6954.js +0 -1
  232. package/.next/server/chunks/9215.js +0 -4
  233. package/.next/server/chunks/9229.js +0 -1
  234. package/.next/server/chunks/9310.js +0 -21
  235. package/.next/static/chunks/2692-7fee6e06b3c93940.js +0 -1
  236. package/.next/static/chunks/2997-ec8b18227849683e.js +0 -1
  237. package/.next/static/chunks/6602-f26d109fd94cee1d.js +0 -4
  238. package/.next/static/chunks/9112-c37628abc8a164cd.js +0 -1
  239. package/.next/static/chunks/9690-53d5222618cbeddb.js +0 -1
  240. package/.next/static/chunks/app/(app)/agents/[handle]/page-83277413debb3b25.js +0 -1
  241. package/.next/static/chunks/app/(app)/code/page-1f954f7688bc24e4.js +0 -1
  242. package/.next/static/chunks/app/(app)/config/page-eee4f8736608afa5.js +0 -1
  243. package/.next/static/chunks/app/(app)/costs/page-0beac688917eaa30.js +0 -1
  244. package/.next/static/chunks/app/(app)/cron/page-a4dd65c78173b872.js +0 -1
  245. package/.next/static/chunks/app/(app)/dashboard/page-519a934ccfcce6fa.js +0 -1
  246. package/.next/static/chunks/app/(app)/docs/[id]/page-e29afa1ba1a086e1.js +0 -1
  247. package/.next/static/chunks/app/(app)/docs/page-b4462f9ca2118f8b.js +0 -1
  248. package/.next/static/chunks/app/(app)/github/page-cf8501e45fe38663.js +0 -1
  249. package/.next/static/chunks/app/(app)/goals/page-75c36155c162df5b.js +0 -1
  250. package/.next/static/chunks/app/(app)/inbox/page-f40bdb457609ddad.js +0 -12
  251. package/.next/static/chunks/app/(app)/knowledge/page-dc5dd15e4f0ad22e.js +0 -1
  252. package/.next/static/chunks/app/(app)/layout-408976a4d35f06a8.js +0 -1
  253. package/.next/static/chunks/app/(app)/models/page-a54e0b8ffed0085c.js +0 -1
  254. package/.next/static/chunks/app/(app)/notifications/page-1f84d74bc53c2c6c.js +0 -12
  255. package/.next/static/chunks/app/(app)/org/page-d17c62b7a668b399.js +0 -12
  256. package/.next/static/chunks/app/(app)/organizations/page-b55445f226cf8c61.js +0 -1
  257. package/.next/static/chunks/app/(app)/page-c7dd52ecc2da529d.js +0 -1
  258. package/.next/static/chunks/app/(app)/planner/page-920e439e6f88c238.js +0 -1
  259. package/.next/static/chunks/app/(app)/prepare-deploy/page-8d25f86b26ab0d2e.js +0 -1
  260. package/.next/static/chunks/app/(app)/profile/page-236673e1a8c1e6c6.js +0 -1
  261. package/.next/static/chunks/app/(app)/pulse/page-f2c6049a967b93a3.js +0 -1
  262. package/.next/static/chunks/app/(app)/reports/[id]/page-a4dd65c78173b872.js +0 -1
  263. package/.next/static/chunks/app/(app)/reports/page-5c07fa3a8b5ba553.js +0 -1
  264. package/.next/static/chunks/app/(app)/routines/page-0193e84e6a60a06a.js +0 -1
  265. package/.next/static/chunks/app/(app)/search/page-07e037c487f14c35.js +0 -1
  266. package/.next/static/chunks/app/(app)/security/page-71e5d992b5ddf79a.js +0 -1
  267. package/.next/static/chunks/app/(app)/tasks/page-5c9ca8f83d4c904f.js +0 -1
  268. package/.next/static/chunks/app/(app)/test-dev/page-5aee630d9bc73a0b.js +0 -1
  269. package/.next/static/chunks/app/(app)/update/page-2c9bcdb65bd2f597.js +0 -1
  270. package/.next/static/chunks/app/(auth)/login/page-50033813b56469ee.js +0 -1
  271. package/.next/static/chunks/app/(auth)/onboarding/page-075fd9673f7ab241.js +0 -1
  272. /package/.next/static/{vaEtsAmUuKf_DngRqwRUn → fb-rRThu8P8AXEQQBbLgT}/_buildManifest.js +0 -0
  273. /package/.next/static/{vaEtsAmUuKf_DngRqwRUn → fb-rRThu8P8AXEQQBbLgT}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8191],{991:(e,s,t)=>{"use strict";t.d(s,{GitHubFlow:()=>S});var i=t(5076),n=t(8488),a=t(9860),l=t(8576),r=t(4552),o=t(1716),c=t(2799),d=t(7814);let h=(0,d.createServerReference)("00c37514c91ee94516861af2579fdbe76ec16d1e5f",d.callServer,void 0,d.findSourceMapURL,"listRepos"),m=(0,d.createServerReference)("40cd79142ef6c2334dff255b28896cc214e01a4f0c",d.callServer,void 0,d.findSourceMapURL,"setRepo"),g=(0,d.createServerReference)("40209f9ed45a46a6e7220eaf8fb08780f318b2cbef",d.callServer,void 0,d.findSourceMapURL,"createRepo"),u=(0,d.createServerReference)("000f546fc1aed0c4147eaf4be05ace7977d21e79b3",d.callServer,void 0,d.findSourceMapURL,"refreshGitStatus"),x=(0,d.createServerReference)("40b69a06d95098b2baf3b14ab1ea7dd2dcbcde8b50",d.callServer,void 0,d.findSourceMapURL,"connectGitHub"),b=(0,d.createServerReference)("00dd653517a1aad57012531eed7a90ea692b1880ce",d.callServer,void 0,d.findSourceMapURL,"disconnectGitHub"),f=(0,d.createServerReference)("00504b535ff5724449c37dd527872680f41e97324a",d.callServer,void 0,d.findSourceMapURL,"draftCommitMessage"),p=(0,d.createServerReference)("400d08dfb5c5a3ddc5d1b505646db2a2248dba2ef7",d.callServer,void 0,d.findSourceMapURL,"commitPush"),v=(0,d.createServerReference)("00850918207edb0200efd7343d4395b9c04a0de227",d.callServer,void 0,d.findSourceMapURL,"scanWorkspace");var j=t(4055),y=t(5629);function N({current:e}){let[s,t]=(0,n.useState)(!1),[r,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(""),[u,x]=(0,n.useState)(""),[b,f]=(0,n.useState)(!0),[p,v]=(0,n.useState)(""),[j,k]=(0,n.useTransition)(),S=(0,a.useRouter)(),w=(0,y.k)(),z=(r??[]).filter(e=>!c.trim()||e.full.toLowerCase().includes(c.trim().toLowerCase()));return(0,i.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,i.jsx)("div",{className:"detail-label",style:{margin:0,flex:1},children:w("github.repo.label")}),(0,i.jsxs)("button",{className:"link-btn",onClick:function(){t("pick"),v(""),o(null),k(async()=>{let e=await h();e.ok?o(e.repos.map(e=>({full:e.full,private:e.private}))):v(e.error??w("github.repo.listError"))})},disabled:j,children:[(0,i.jsx)(l.I,{name:"git",size:12})," ",e?w("github.repo.change"):w("common.select")]}),(0,i.jsxs)("button",{className:"link-btn",onClick:()=>{t("new"),v("")},disabled:j,children:[(0,i.jsx)(l.I,{name:"add",size:12})," ",w("github.repo.new")]})]}),(0,i.jsx)("div",{style:{fontFamily:"var(--mono-font)",fontSize:12.5,color:e?"var(--accent)":"var(--text-faint)",marginTop:4},children:e||w("github.repo.noOrigin")}),"pick"===s&&(0,i.jsxs)("div",{style:{marginTop:10},children:[(0,i.jsxs)("div",{className:"dm-search",style:{marginBottom:8},children:[(0,i.jsx)(l.I,{name:"search",size:13}),(0,i.jsx)("input",{placeholder:w("github.repo.filterPlaceholder"),value:c,onChange:e=>d(e.target.value),autoFocus:!0})]}),null===r&&(0,i.jsxs)("div",{className:"muted",style:{fontSize:12},children:[(0,i.jsx)("span",{className:"spin",children:(0,i.jsx)(l.I,{name:"refresh",size:12})})," ",w("github.repo.loading")]}),p&&(0,i.jsxs)("div",{className:"form-hint",style:{color:"var(--sx-number)"},children:[(0,i.jsx)(l.I,{name:"close",size:12})," ",p]}),(0,i.jsxs)("div",{className:"scroll",style:{maxHeight:220,overflowY:"auto"},children:[z.map(e=>(0,i.jsxs)("button",{className:"lrow",style:{width:"100%",cursor:"pointer"},disabled:j,onClick:()=>{var s;return s=e.full,void k(async()=>{let e=await m(s);e.ok?(t(!1),S.refresh()):v(e.error??"")})},children:[(0,i.jsx)(l.I,{name:"git",size:14,style:{color:"var(--text-faint)"}}),(0,i.jsx)("span",{className:"lr-main",children:(0,i.jsx)("span",{className:"lr-title",style:{fontFamily:"var(--mono-font)",fontSize:12.5},children:e.full})}),(0,i.jsx)("span",{className:"pill",style:{fontSize:10},children:e.private?w("github.repo.private"):w("github.repo.public")})]},e.full)),null!==r&&0===z.length&&(0,i.jsx)("div",{className:"muted",style:{fontSize:12,padding:8},children:w("github.repo.noRepos")})]})]}),"new"===s&&(0,i.jsxs)("div",{style:{marginTop:10},children:[(0,i.jsx)("input",{className:"form-input mono",placeholder:"new-repo-name",value:u,onChange:e=>x(e.target.value),autoFocus:!0}),(0,i.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8,fontSize:12.5,color:"var(--text-dim)"},children:[(0,i.jsx)("input",{type:"checkbox",checked:b,onChange:e=>f(e.target.checked)})," ",w("github.repo.privateRepo")]}),p&&(0,i.jsxs)("div",{className:"form-hint",style:{color:"var(--sx-number)"},children:[(0,i.jsx)(l.I,{name:"close",size:12})," ",p]}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,marginTop:10},children:[(0,i.jsx)("button",{className:"btn-accent",onClick:function(){v(""),u.trim()&&k(async()=>{let e=await g({name:u,private:b});e.ok?(t(!1),x(""),S.refresh()):v(e.error??"")})},disabled:j||!u.trim(),children:j?w("github.repo.creating"):w("github.repo.createSetOrigin")}),(0,i.jsx)("button",{className:"btn-ghost",onClick:()=>t(!1),children:w("common.cancel")})]})]})]})}function k(){let[e,s]=(0,n.useTransition)(),t=(0,a.useRouter)(),r=(0,y.k)();return(0,i.jsxs)("button",{className:"link-btn",disabled:e,onClick:()=>s(async()=>{await u(),t.refresh()}),children:[e?(0,i.jsx)("span",{className:"spin",children:(0,i.jsx)(l.I,{name:"refresh",size:12})}):(0,i.jsx)(l.I,{name:"refresh",size:12})," ",r("github.refreshChanges")]})}function S({linked:e,repo:s,changes:t,deploys:a,assistant:d,oauthAvailable:h}){let m,g,u,w,z,[I,R]=(0,n.useState)(h?"oauth":"token"),[C,T]=(0,n.useState)(""),[M,F]=(0,n.useState)(""),[U,L]=(0,n.useState)(""),[P,$]=(0,n.useState)(!1),[H,O]=(0,n.useState)(!1),[_,B]=(0,n.useState)("idle"),[W,E]=(0,n.useState)(null),[G,J]=(0,n.useTransition)(),Y=(0,y.k)();function A(e,t=!1){O(e),B("committing"),J(async()=>{B("pushing");let i=await p({repo:s.full,branch:s.branch,message:U||"chore: sync workspace to remote",delegated:e,force:t});E(i),B("done"),i.blocked||setTimeout(()=>{B("idle"),L(""),O(!1),E(null)},3800)})}let[D,K]=(0,n.useState)(null),[q,Q]=(0,n.useState)(!0);return e?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{className:"link-btn",style:{marginBottom:10},onClick:function(){J(async()=>{await b()})},disabled:G,children:[(0,i.jsx)(l.I,{name:"settings",size:12})," ",Y("github.disconnect")]}),(0,i.jsx)(N,{current:s.full}),(0,i.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,i.jsx)("div",{className:"detail-label",children:Y("github.flow.title")}),(0,i.jsxs)("div",{className:"gh-flow",children:[(0,i.jsxs)("div",{className:"gf-node",children:[(0,i.jsx)("div",{className:"gf-t",children:Y("github.flow.workspace")}),(0,i.jsxs)("div",{className:"gf-s",children:[t.length," ",Y(1===t.length?"github.flow.change.one":"github.flow.change.other")]})]}),(0,i.jsx)("span",{className:"gf-arrow",children:(0,i.jsx)(l.I,{name:"chevronRight",size:18})}),(0,i.jsxs)("div",{className:"gf-node",children:[(0,i.jsx)("div",{className:"gf-t",children:Y("github.flow.commit")}),(0,i.jsx)("div",{className:"gf-s",children:s.branch})]}),(0,i.jsx)("span",{className:"gf-arrow",children:(0,i.jsx)(l.I,{name:"chevronRight",size:18})}),(0,i.jsxs)("div",{className:"gf-node",children:[(0,i.jsx)("div",{className:"gf-t",children:"origin"}),(0,i.jsx)("div",{className:"gf-s",children:"github.com"})]})]})]}),(0,i.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,i.jsxs)("button",{onClick:()=>Q(e=>!e),style:{flex:1,display:"flex",alignItems:"center",gap:7,background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:[(0,i.jsx)(l.I,{name:"chevronDown",size:13,style:{color:"var(--text-dim)",transform:q?"none":"rotate(-90deg)",transition:"transform .15s"}}),(0,i.jsx)("span",{className:"detail-label",style:{margin:0},children:Y("github.changes.title")}),t.length>0&&(0,i.jsx)("span",{className:"pill",style:{fontSize:10},children:t.length})]}),(0,i.jsx)(k,{})]}),q&&(0===t.length?(0,i.jsx)("div",{className:"muted",style:{fontSize:12.5,marginTop:6},children:Y("github.changes.clean")}):(0,i.jsx)("div",{className:"scroll",style:{maxHeight:340,marginTop:6,overflowY:"auto"},children:t.map(e=>(0,i.jsxs)("div",{className:"gh-stat",children:[(0,i.jsx)(o.R,{name:e.name}),(0,i.jsx)("span",{className:"gs-file",children:e.path}),(0,i.jsx)("span",{className:"gstat "+e.st,style:{fontFamily:"var(--mono-font)",fontWeight:700},children:e.st})]},e.path))}))]}),(0,i.jsxs)("div",{className:"card",children:[(0,i.jsx)("div",{className:"detail-label",children:Y("github.commit.message")}),(0,i.jsx)("textarea",{className:"persona-ta mono",rows:3,placeholder:Y("github.commit.placeholder"),value:U,onChange:e=>L(e.target.value)}),(0,i.jsxs)("button",{className:"assist-btn",onClick:function(){$(!0),J(async()=>{let e=await f();e.ok&&L(e.message),$(!1)})},disabled:P||0===t.length,style:{marginTop:8},children:[P?(0,i.jsx)("span",{className:"spin",children:(0,i.jsx)(l.I,{name:"refresh",size:13})}):(0,i.jsx)(l.I,{name:"skill",size:13}),P?Y("github.commit.drafting"):Y("github.commit.generate")]}),"idle"===_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:{display:"flex",gap:8,marginTop:14},children:[(0,i.jsxs)("button",{className:"btn-accent",onClick:()=>A(!1),disabled:!U.trim()||0===t.length,children:[(0,i.jsx)(l.I,{name:"arrowUp",size:14})," ",Y("github.commit.commitPush")]}),(0,i.jsxs)("button",{className:"btn-ghost",onClick:function(){K(null),J(async()=>{let e=await v();K({findings:e.findings,scanned:e.scanned})})},disabled:0===t.length,children:[(0,i.jsx)(l.I,{name:"shield",size:13})," ",Y("github.commit.securityScan")]})]}),D&&(0,i.jsx)("div",{className:"card",style:{marginTop:10,borderColor:D.findings.length?"color-mix(in srgb, var(--sx-keyword) 45%, var(--border))":void 0},children:0===D.findings.length?(0,i.jsxs)("div",{style:{fontSize:12.5,color:"var(--sx-string)"},children:[(0,i.jsx)(l.I,{name:"check",size:13})," ",Y("github.scan.clean",{n:D.scanned})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:{fontSize:12.5,color:"var(--sx-keyword)",fontWeight:700,marginBottom:6},children:[(0,i.jsx)(l.I,{name:"shield",size:13})," ",Y("github.scan.risks",{n:D.findings.length})]}),D.findings.slice(0,30).map((e,s)=>(0,i.jsxs)("div",{style:{fontSize:11.5,fontFamily:"var(--mono-font)",color:"var(--text-dim)",display:"flex",gap:8},children:[(0,i.jsx)("span",{style:{color:"var(--sx-keyword)"},children:e.kind}),(0,i.jsxs)("span",{style:{flex:1},children:[e.file,e.line?":"+e.line:""]}),(0,i.jsx)("span",{style:{color:"var(--text-faint)"},children:e.preview})]},s))]})})]}):(0,i.jsxs)("div",{style:{marginTop:14},children:[(m=W?W.pushed?`${Y("github.progress.pushed",{branch:s.branch})}${W.prUrl?H?` \xb7 ${Y("github.progress.agentOpenedPr",{name:d?.name??Y("github.progress.agent")})}`:` \xb7 ${Y("github.progress.prOpened")}`:""}`:W.committed?`${Y("github.progress.committedLocal")}${W.sha?` (${W.sha})`:""}${Y("github.progress.notPushedSuffix")}`:W.nothing?Y("github.progress.nothing"):Y("github.progress.failed"):Y("github.progress.finishing"),g="done"===_&&null!=W&&!W.ok,u=[["committing",Y("github.progress.committing",{n:t.length})],["pushing",Y("github.progress.pushing",{branch:s.branch})],["done",m]],z=(w=["committing","pushing","done"]).indexOf(_),u.map(([e,s])=>{let t=w.indexOf(e),n=t<z||"done"===_&&"done"===e?"done":t===z?"on":"",a="done"===e&&g;return(0,i.jsxs)("div",{className:"gh-progress-step "+(a?"":n),children:[(0,i.jsx)("span",{className:"gp-ico",children:a?(0,i.jsx)(l.I,{name:"close",size:13}):"done"===n?(0,i.jsx)(l.I,{name:"check",size:14}):"on"===n?(0,i.jsx)("span",{className:"spin",children:(0,i.jsx)(l.I,{name:"refresh",size:13})}):(0,i.jsx)(l.I,{name:"dot",size:8})}),s]},e)})),W?.error&&(0,i.jsxs)("div",{className:"form-hint",style:{marginTop:8,color:"var(--sx-number)"},children:[(0,i.jsx)(l.I,{name:"shield",size:12})," ",W.error]}),W?.blocked&&W.secrets&&W.secrets.length>0&&(0,i.jsxs)("div",{className:"card",style:{marginTop:10,borderColor:"color-mix(in srgb, var(--sx-keyword) 45%, var(--border))"},children:[W.secrets.slice(0,30).map((e,s)=>(0,i.jsxs)("div",{style:{fontSize:11.5,fontFamily:"var(--mono-font)",color:"var(--text-dim)",display:"flex",gap:8},children:[(0,i.jsx)("span",{style:{color:"var(--sx-keyword)"},children:e.kind}),(0,i.jsxs)("span",{style:{flex:1},children:[e.file,e.line?":"+e.line:""]}),(0,i.jsx)("span",{style:{color:"var(--text-faint)"},children:e.preview})]},s)),(0,i.jsxs)("div",{style:{display:"flex",gap:8,marginTop:10},children:[(0,i.jsx)("button",{className:"btn-ghost",onClick:()=>{B("idle"),E(null)},children:Y("github.blocked.fixRetry")}),(0,i.jsx)("button",{className:"btn-accent",style:{background:"var(--sx-keyword)"},onClick:()=>{confirm(Y("github.blocked.confirm"))&&A(H,!0)},children:Y("github.blocked.commitAnyway")})]})]}),W?.blocked&&(!W.secrets||0===W.secrets.length)&&(0,i.jsx)("button",{className:"btn-ghost",style:{marginTop:8},onClick:()=>{B("idle"),E(null)},children:Y("github.blocked.ok")}),W?.prUrl&&(0,i.jsxs)("a",{className:"link-btn",href:W.prUrl,target:"_blank",rel:"noreferrer",style:{marginTop:8,display:"inline-flex"},children:[(0,i.jsx)(l.I,{name:"git",size:12})," ",Y("github.viewPr")]})]}),"idle"===_&&d&&(0,i.jsxs)("div",{className:"agent-do",children:[(0,i.jsx)(r.e,{name:d.name,color:d.color,size:30,health:d.health}),(0,i.jsxs)("div",{style:{flex:1},children:[(0,i.jsx)("div",{className:"sr-title",children:Y("github.delegate.title")}),(0,i.jsx)("div",{className:"sr-sub",children:Y("github.delegate.sub",{name:d.name})})]}),(0,i.jsxs)("button",{className:"btn-ghost",onClick:()=>{L(U||"chore: sync workspace to remote"),A(!0)},disabled:0===t.length,children:[(0,i.jsx)(l.I,{name:"bot",size:13})," ",Y("github.delegate.button")]})]})]}),a.length>0&&(0,i.jsxs)("div",{className:"card",style:{marginTop:16},children:[(0,i.jsx)("div",{className:"detail-label",children:Y("github.recentPushes")}),(0,i.jsx)("div",{className:"scroll",style:{maxHeight:260,overflowY:"auto"},children:a.map(e=>(0,i.jsxs)("div",{className:"gh-stat",children:[(0,i.jsx)(l.I,{name:"git",size:13,style:{color:"var(--text-faint)"}}),(0,i.jsx)("span",{className:"gs-file",style:{fontFamily:"var(--ui-font)"},children:e.text}),(0,i.jsx)("span",{style:{fontSize:11,color:"var(--text-faint)"},children:(0,c.f)(e.at)})]},e.id))})]})]}):(0,i.jsxs)("div",{className:"card",children:[(0,i.jsxs)("div",{className:"gh-auth-tabs",children:[(0,i.jsx)("button",{className:"seg-opt"+("oauth"===I?" on":""),onClick:()=>R("oauth"),style:{flex:"none",padding:"7px 14px"},children:Y("github.auth.githubLogin")}),(0,i.jsx)("button",{className:"seg-opt"+("token"===I?" on":""),onClick:()=>R("token"),style:{flex:"none",padding:"7px 14px"},children:Y("github.auth.personalToken")})]}),"oauth"===I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{className:"oauth-btn",disabled:!h||G,onClick:()=>h&&j.Jv.social({provider:"github",callbackURL:"/github"}),children:[(0,i.jsx)(l.I,{name:"git",size:15}),Y("github.auth.signInWithGithub")]}),(0,i.jsx)("div",{className:"form-hint",style:{marginTop:8},children:h?(0,i.jsx)(i.Fragment,{children:Y("github.auth.authorizeHint")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.I,{name:"shield",size:12})," ",Y("github.auth.oauthNotConfigured")]})})]}):(0,i.jsxs)("div",{className:"form-field",children:[(0,i.jsx)("label",{className:"form-label",children:Y("github.auth.patLabel")}),(0,i.jsx)("input",{className:"form-input mono",type:"password",placeholder:"ghp_…",value:C,onChange:e=>{T(e.target.value),F("")}}),(0,i.jsxs)("div",{className:"form-hint",children:[(0,i.jsx)(l.I,{name:"shield",size:12})," ",Y("github.auth.patHint")]}),M&&(0,i.jsxs)("div",{className:"form-hint",style:{color:"var(--sx-number)"},children:[(0,i.jsx)(l.I,{name:"close",size:12})," ",M]}),(0,i.jsxs)("button",{className:"btn-accent",style:{marginTop:10},onClick:function(){C.length<7||(F(""),J(async()=>{let e=await x(C);e.ok||F(e.error??Y("github.connectError"))}))},disabled:C.length<7||G,children:[G?(0,i.jsx)("span",{className:"spin",children:(0,i.jsx)(l.I,{name:"refresh",size:13})}):(0,i.jsx)(l.I,{name:"git",size:13}),G?Y("github.auth.verifying"):Y("common.connect")]})]})]})}},1716:(e,s,t)=>{"use strict";t.d(s,{R:()=>n});var i=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,i.jsx)("span",{style:{fontSize:9,fontWeight:700,fontFamily:"var(--mono-font, monospace)",color:s.c,lineHeight:1,letterSpacing:"-.5px"},children:s.t})}},2799:(e,s,t)=>{"use strict";function i(e){if(!e)return"";let s=Math.max(0,Math.floor((Date.now()-("number"==typeof e?e*(e<1e12?1e3:1):e.getTime()))/1e3));if(s<60)return"now";let t=Math.floor(s/60);if(t<60)return t+"m";let i=Math.floor(t/60);if(i<24)return i+"h";let n=Math.floor(i/24);return n<7?n+"d":Math.floor(n/7)+"w"}t.d(s,{f:()=>i})},4055:(e,s,t)=>{"use strict";t.d(s,{Jv:()=>l,yK:()=>a});var i=t(5138),n=t(8618);let a=(0,i.M)({baseURL:window.location.origin,plugins:[(0,n.N)()]}),{signIn:l,signUp:r,signOut:o,useSession:c,twoFactor:d}=a},4552:(e,s,t)=>{"use strict";t.d(s,{e:()=>n});var i=t(5076);function n({name:e,color:s,size:t=24,health:a,image:l}){let r=Math.max(6,Math.round(.3*t)),o=Math.round(.28*t),c=l?/^(data:|https?:|\/)/.test(l)?l:`/api/upload?path=${encodeURIComponent(l)}`:null;return(0,i.jsxs)("span",{style:{position:"relative",width:t,height:t,flex:`0 0 ${t}px`,display:"inline-block"},children:[c?(0,i.jsx)("img",{src:c,alt:e,width:t,height:t,style:{width:t,height:t,borderRadius:o,objectFit:"cover",display:"block"}}):(0,i.jsx)("span",{style:{width:t,height:t,borderRadius:o,background:s,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*t),fontWeight:700},children:(e[0]||"?").toUpperCase()}),a&&(0,i.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:r,height:r,borderRadius:"50%",background:"alive"===a?"var(--sx-string)":"stale"===a?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},9206:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,3283,23)),Promise.resolve().then(t.bind(t,991)),Promise.resolve().then(t.bind(t,181)),Promise.resolve().then(t.bind(t,6588)),Promise.resolve().then(t.bind(t,4414)),Promise.resolve().then(t.bind(t,6824)),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,7555,3219,6836,8370,6646,6834,7358],()=>e(e.s=9206)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[296],{582:(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),r=a(891),c=a(7814);let d=(0,c.createServerReference)("400d017e95321daa4da5dba5cd79e5ad5a55fdc259",c.callServer,void 0,c.findSourceMapURL,"cancelGoal"),h=(0,c.createServerReference)("40703b75a198d096bd9b472884d686fc22f044c9ea",c.callServer,void 0,c.findSourceMapURL,"archiveGoal"),g=(0,c.createServerReference)("40c42cb700be9de73dbfe074727793983960b844b3",c.callServer,void 0,c.findSourceMapURL,"reopenGoal"),u=(0,c.createServerReference)("40d477b065506bd9bd973786e35c0dd38b41a38936",c.callServer,void 0,c.findSourceMapURL,"restoreGoal");var m=a(5695),p=a(5629);function v({id:e,status:s,progress:a}){let o=(0,p.k)(),[r,c]=(0,t.useTransition)(),m=(0,i.useRouter)(),x=s=>c(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:r,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:r,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:r,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:r,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"),[c,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:c,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"===c||e.assignee?.handle===c),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"!==c?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)(r.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)})]})}},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)),r=Math.round(.28*a),c=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:[c?(0,l.jsx)("img",{src:c,alt:e,width:a,height:a,style:{width:a,height:a,borderRadius:r,objectFit:"cover",display:"block"}}):(0,l.jsx)("span",{style:{width:a,height:a,borderRadius:r,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)"}})]})}},4899:(e,s,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,582)),Promise.resolve().then(a.bind(a,7986)),Promise.resolve().then(a.bind(a,181)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,6824)),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})},7986:(e,s,a)=>{"use strict";a.d(s,{NewGoalButton:()=>r});var l=a(5076),t=a(8488),i=a(7814);let n=(0,i.createServerReference)("4086c38af96bc06a743b91806defde8c7c57c33420",i.callServer,void 0,i.findSourceMapURL,"createGoal");var o=a(5629);function r({agents:e}){let s=(0,o.k)(),[a,i]=(0,t.useState)(!1),[c,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:c,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:!c.trim()||p,onClick:function(){v(async()=>{await n({title:c,description:h,ownerId:u}),i(!1),d(""),g("")})},children:s(p?"goals.creating":"goals.create")})]})]})})]})}}},e=>{e.O(0,[9219,3219,6836,8370,6646,6834,7358],()=>e(e.s=4899)),_N_E=e.O()}]);
@@ -0,0 +1,12 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[576],{1281:(e,t,a)=>{"use strict";a.d(t,{P:()=>r});var n=a(7814);let r=(0,n.createServerReference)("00d707af504f1a0491ca9dcf763ef015da594b49f3",n.callServer,void 0,n.findSourceMapURL,"approvePlan")},1346:(e,t,a)=>{"use strict";a.d(t,{b:()=>r});var n=a(7814);let r=(0,n.createServerReference)("60075bc55b6118caa430a2acc1eba87814559b821c",n.callServer,void 0,n.findSourceMapURL,"resolveInbox")},1352:(e,t,a)=>{"use strict";a.d(t,{e:()=>r});var n=a(7814);let r=(0,n.createServerReference)("001e9ef8a66d3ec2113043b24ab8849578169f7b7f",n.callServer,void 0,n.findSourceMapURL,"pollUpdateResult")},1709:(e,t,a)=>{"use strict";a.d(t,{B:()=>r});var n=a(7814);let r=(0,n.createServerReference)("40ced2f71e662e1884c830a2cb80626a57aa8be42c",n.callServer,void 0,n.findSourceMapURL,"approveSpec")},1870:(e,t,a)=>{"use strict";a.d(t,{l:()=>r});var n=a(7814);let r=(0,n.createServerReference)("40c4dec4c26a6ed0bdf72098c743c4c2cb18ed1cd1",n.callServer,void 0,n.findSourceMapURL,"getUpdateState")},2282:(e,t,a)=>{"use strict";a.d(t,{P:()=>r});var n=a(7814);let r=(0,n.createServerReference)("00a23e99d4e912da3ad1b266a22b1a141df6bc8b94",n.callServer,void 0,n.findSourceMapURL,"runUpdate")},2393:(e,t,a)=>{"use strict";a.d(t,{H4:()=>l,Uy:()=>o,st:()=>s});let n=/Failed to find Server Action|older or newer deployment|ChunkLoadError|Loading chunk [\w-]+ failed|error loading dynamically imported module/i,r=/invariant expected layout router to be mounted/i;function i(e){return e?e instanceof Error?`${e.name} ${e.message}`:"string"==typeof e?e:String(e?.message??e):""}function s(e){return n.test(i(e))}function l(e){let t=i(e);return n.test(t)||r.test(t)}function o(){try{let e="cn-skew-reload-at",t=Number(window.sessionStorage.getItem(e)||0);if(Date.now()-t<2e4)return;window.sessionStorage.setItem(e,String(Date.now()))}catch{}try{let e=new URL(window.location.href);e.searchParams.set("_r",String(Date.now())),window.location.replace(e.toString())}catch{window.location.reload()}}},2444:(e,t,a)=>{"use strict";a.d(t,{UpdateHeaderBadge:()=>p});var n=a(5076),r=a(8488),i=a(9860),s=a(8576),l=a(5629),o=a(1870),d=a(2282),c=a(1352),u=a(2393);function p(){let e=(0,l.k)(),t=(0,i.useRouter)(),[a,p]=(0,r.useState)(null),[h,b]=(0,r.useState)(!1),[f,v]=(0,r.useState)("available"),[m,y]=(0,r.useState)(!1),[x,g]=(0,r.useState)(""),w=(0,r.useRef)(null);async function j(){if(!m){y(!0),g("");try{let t=await (0,o.l)(!0);p(t.info.updateAvailable&&t.info.latest?t.info.latest:null),b(t.busy),t.info.updateAvailable||g(e("chrome.update.upToDate"))}catch{}finally{y(!1)}}}async function S(){if("updating"!==f&&!h){if("done"===f)return void t.refresh();v("updating"),g("");try{let a=await (0,d.P)();if(a.blocked){v("available"),b(!0),g(e("chrome.update.busy"));return}a.started?w.current=setInterval(async()=>{let t=await (0,c.e)().catch(e=>((0,u.st)(e)&&(w.current&&clearInterval(w.current),(0,u.Uy)()),null));t&&("done"===t.status?(w.current&&clearInterval(w.current),window.location.reload()):"error"===t.status&&(w.current&&clearInterval(w.current),v("error"),g(e("chrome.update.failed"))))},3e3):(v("available"),g(a.message||""),t.push("/update"))}catch{v("error"),g(e("chrome.update.failed"))}}}(0,r.useEffect)(()=>{let e=!1,t=async t=>{try{let a=await (0,o.l)(t);if(e)return;p(a.info.updateAvailable&&a.info.latest?a.info.latest:null),b(a.busy)}catch{}};t(!1);let a=setInterval(()=>t(!1),12e3),n=setInterval(()=>t(!0),18e4);return()=>{e=!0,clearInterval(a),clearInterval(n),w.current&&clearInterval(w.current)}},[]);let k=(0,n.jsx)("button",{type:"button",className:"top-btn",onClick:j,disabled:m,title:x||e("chrome.update.check"),children:(0,n.jsx)("span",{className:m?"sync-spin":"",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:17})})});if(!a)return k;let I="updating"===f?e("chrome.update.updating"):"done"===f?e("chrome.update.restart"):"error"===f?e("chrome.update.failed"):h?`v${a}`:`${e("chrome.update.update")} v${a}`,N="updating"===f||h;return(0,n.jsxs)(n.Fragment,{children:[k,(0,n.jsxs)("button",{type:"button",onClick:S,disabled:N,title:h?e("chrome.update.busy"):x||`${e("chrome.update.available")} — v${a}`,style:{display:"inline-flex",alignItems:"center",gap:6,width:"auto",padding:"0 11px",height:30,background:"error"===f?"var(--sx-keyword)":h?"var(--bg-active)":"var(--accent)",color:h?"var(--text-dim)":"var(--accent-fg)",borderRadius:999,fontSize:12,fontWeight:600,border:"none",opacity:"updating"===f?.75:1,cursor:N?"default":"pointer"},children:["updating"===f?(0,n.jsx)("span",{className:"sync-spin",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:14})}):(0,n.jsx)(s.I,{name:"updating"===f?"sync":"done"===f?"refresh":"error"===f?"bell":"arrowUp",size:14}),(0,n.jsx)("span",{children:I})]})]})}},3820:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,5315)),Promise.resolve().then(a.bind(a,181)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,6824)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444))},4414:(e,t,a)=>{"use strict";a.d(t,{ChatToggle:()=>s});var n=a(5076),r=a(8576),i=a(5629);function s(){let e=(0,i.k)();return(0,n.jsx)("button",{className:"top-btn",title:`${e("chrome.chat.agentRoom")} (⌘J)`,type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("constella:toggle-chat")),children:(0,n.jsx)(r.I,{name:"chat",size:17})})}},4552:(e,t,a)=>{"use strict";a.d(t,{e:()=>r});var n=a(5076);function r({name:e,color:t,size:a=24,health:i,image:s}){let l=Math.max(6,Math.round(.3*a)),o=Math.round(.28*a),d=s?/^(data:|https?:|\/)/.test(s)?s:`/api/upload?path=${encodeURIComponent(s)}`:null;return(0,n.jsxs)("span",{style:{position:"relative",width:a,height:a,flex:`0 0 ${a}px`,display:"inline-block"},children:[d?(0,n.jsx)("img",{src:d,alt:e,width:a,height:a,style:{width:a,height:a,borderRadius:o,objectFit:"cover",display:"block"}}):(0,n.jsx)("span",{style:{width:a,height:a,borderRadius:o,background:t,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*a),fontWeight:700},children:(e[0]||"?").toUpperCase()}),i&&(0,n.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:l,height:l,borderRadius:"50%",background:"alive"===i?"var(--sx-string)":"stale"===i?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4942:(e,t,a)=>{"use strict";a.d(t,{SidebarToggle:()=>l});var n=a(5076),r=a(8488),i=a(8576);let s=`
2
+ body.side-collapsed .side{width:58px!important;flex:0 0 58px!important;}
3
+ body.side-collapsed .side .nav-item{justify-content:center;padding-left:0;padding-right:0;position:relative;}
4
+ body.side-collapsed .side .nav-item>span:not(.nv-badge),
5
+ body.side-collapsed .side .nav-group-label,
6
+ body.side-collapsed .side .nav-search input,
7
+ body.side-collapsed .side .side-foot .pf{display:none!important;}
8
+ body.side-collapsed .side .nav-search{justify-content:center;}
9
+ body.side-collapsed .side .side-brand-wrap{overflow:hidden;}
10
+ body.side-collapsed .side .side-foot{justify-content:center;flex-wrap:wrap;gap:6px;}
11
+ body.side-collapsed .side .nv-badge{position:absolute;top:2px;right:6px;}
12
+ `;function l(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!document.getElementById("side-rail-style")){let e=document.createElement("style");e.id="side-rail-style",e.textContent=s,document.head.appendChild(e)}let e=!1;try{e="1"===localStorage.getItem("bx.sideCollapsed")}catch{}t(e),document.body.classList.toggle("side-collapsed",e)},[]),(0,n.jsx)("button",{className:"top-btn"+(e?" on":""),onClick:function(){t(e=>{let t=!e;document.body.classList.toggle("side-collapsed",t);try{localStorage.setItem("bx.sideCollapsed",t?"1":"0")}catch{}return t})},title:e?"Expand sidebar":"Collapse sidebar","aria-label":"Toggle sidebar",children:(0,n.jsx)(i.I,{name:"sidebarIcon",size:17})})}},5315:(e,t,a)=>{"use strict";a.d(t,{InboxList:()=>y});var n=a(5076),r=a(8488),i=a(9860),s=a(8576),l=a(4552),o=a(1346),d=a(1281),c=a(1709),u=a(8941),p=a(5695),h=a(5629);let b={approval:"check",budget:"coins",question:"chat",review:"doc",block:"close",validation:"pulse"},f={color:"var(--text-faint)"},v={background:"var(--accent)22",color:"var(--accent)"};function m(e,t){return"plan"===e.refType?{labelKey:"inbox.action.approvePlan",run:()=>(0,d.P)()}:"spec"===e.refType&&e.refId?{labelKey:"inbox.action.approveSpec",run:()=>(0,c.B)(e.refId)}:"issue"===e.refType&&e.refId?{labelKey:"inbox.action.approveIssue",run:()=>(0,u.t)(e.refId)}:"task"===e.refType?{labelKey:"inbox.action.openTasks",run:async()=>{t.push("/tasks")}}:"validation"===e.refType?{labelKey:"inbox.action.openTestDev",run:async()=>{window.location.href="/test-dev"}}:"question"===e.refType?{labelKey:"inbox.action.openChat",run:async()=>{e.channel?.startsWith("dm:")?window.dispatchEvent(new CustomEvent("constella:open-dm",{detail:{handle:e.channel.slice(3)}})):window.dispatchEvent(new Event("constella:toggle-chat"))}}:null}function y({items:e}){let t,a=(0,h.k)(),[d,c]=(0,r.useState)(null),[u,x]=(0,r.useTransition)(),g=(0,i.useRouter)();function w(e,t){x(async()=>{await (0,o.b)(e,t),g.refresh()}),c(null)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"view-body scroll",children:[0===e.length&&(0,n.jsxs)("div",{style:{color:"var(--text-faint)",textAlign:"center",padding:40},children:[a("inbox.empty")," \uD83C\uDF89"]}),e.map(e=>(0,n.jsxs)("div",{className:"lrow",style:{cursor:"pointer",opacity:e.resolved?.5:1},onClick:()=>c(e),children:[(0,n.jsx)("div",{className:"vh-icon",style:{width:34,height:34,flex:"0 0 34px"},children:(0,n.jsx)(s.I,{name:b[e.kind],size:15})}),(0,n.jsxs)("div",{className:"lr-main",children:[(0,n.jsx)("div",{className:"lr-title",style:{textDecoration:e.resolved?"line-through":"none"},children:e.title}),(0,n.jsxs)("div",{className:"lr-sub",children:[a(`inbox.kind.${e.kind}`),e.fromName?` \xb7 ${a("inbox.from",{name:e.fromName})}`:"",e.createdAt?` \xb7 ${(0,p.F)(e.createdAt)}`:""]})]}),e.fromName&&(0,n.jsx)(l.e,{name:e.fromName,color:e.fromColor??"#e0a44e",size:22,health:e.fromHealth}),(0,n.jsx)(s.I,{name:"chevronRight",size:14,style:f})]},e.id))]}),d&&(t=m(d,g),(0,n.jsx)("div",{className:"detail-overlay",onMouseDown:()=>c(null),children:(0,n.jsxs)("div",{className:"detail-panel",onMouseDown:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"detail-head",children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,n.jsx)("span",{className:"pill",style:v,children:a(`inbox.kind.${d.kind}`)}),(0,n.jsx)("button",{className:"dock-tool",onClick:()=>c(null),children:(0,n.jsx)(s.I,{name:"close",size:15})})]}),(0,n.jsx)("div",{className:"view-title",style:{fontSize:16,marginTop:8},children:d.title}),d.createdAt&&(0,n.jsx)("div",{style:{fontSize:11,color:"var(--text-faint)",marginTop:2},children:(0,p.F)(d.createdAt)})]}),(0,n.jsxs)("div",{className:"detail-body",children:[d.fromName&&(0,n.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,n.jsx)(l.e,{name:d.fromName,color:d.fromColor??"#e0a44e",size:24,health:d.fromHealth}),(0,n.jsx)("span",{style:{fontSize:12.5},children:d.fromName})]}),d.detail?(0,n.jsx)("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6,whiteSpace:"pre-wrap"},children:d.detail}):(0,n.jsx)("div",{style:{fontSize:13,color:"var(--text-faint)",lineHeight:1.6},children:a("inbox.noDetail")}),(0,n.jsx)("div",{style:{display:"flex",gap:8},children:d.resolved?(0,n.jsx)("button",{className:"btn-ghost",disabled:u,onClick:()=>w(d.id,!1),children:a("inbox.action.reopen")}):(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)("button",{className:"btn-accent",disabled:u,onClick:()=>{let e;return e=m(d,g),void(x(async()=>{try{e&&await e.run()}finally{await (0,o.b)(d.id,!0),g.refresh()}}),c(null))},children:a(t.labelKey)}),(0,n.jsx)("button",{className:"btn-ghost",disabled:u,onClick:()=>w(d.id,!0),children:a("common.dismiss")})]})})]})]})}))]})}},5695:(e,t,a)=>{"use strict";function n(e){if(null==e)return"";let t=e instanceof Date?e:new Date(e);if(isNaN(t.getTime()))return"";let a=t.toLocaleDateString([],{day:"2-digit",month:"short"}),n=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return`${a}, ${n}`}a.d(t,{F:()=>n})},6588:(e,t,a)=>{"use strict";a.d(t,{BackButton:()=>l});var n=a(5076),r=a(9860),i=a(8576),s=a(5629);function l(){let e=(0,s.k)(),t=(0,r.useRouter)();return(0,n.jsx)("button",{className:"top-btn",title:e("common.back"),style:{marginRight:2},onClick:()=>{window.history.length>1?t.back():t.push("/")},children:(0,n.jsx)(i.I,{name:"chevronLeft",size:18})})}},8941:(e,t,a)=>{"use strict";a.d(t,{t:()=>r});var n=a(7814);let r=(0,n.createServerReference)("4023169ed85000187a7267198eab5e95902c9af1b9",n.callServer,void 0,n.findSourceMapURL,"approveIssue")}},e=>{e.O(0,[9219,3219,6836,6646,6834,7358],()=>e(e.s=3820)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4644],{349:(e,s,l)=>{"use strict";l.d(s,{f:()=>n});var a=l(7814);let n=(0,a.createServerReference)("0009ce734653f91e0152ed870ffea99c48e8be1273",a.callServer,void 0,a.findSourceMapURL,"reindexKbAction")},2825:(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)("408cb072e3f25c139043774855c69d936ddfb60fd8",o.callServer,void 0,o.findSourceMapURL,"saveBlockAction"),b=(0,o.createServerReference)("40f10406b426a9c38439a687284a721ddbf811f921",o.callServer,void 0,o.findSourceMapURL,"mergeProposalAction"),h=(0,o.createServerReference)("4065b972fc53cae281adf85572f2891eab399b9ff9",o.callServer,void 0,o.findSourceMapURL,"rejectProposalAction"),u=(0,o.createServerReference)("402e9c60aa3c6a6a0e19a64a54ffb83bac076adb9c",o.callServer,void 0,o.findSourceMapURL,"deleteBlockAction");function v({blocks:e,proposals:s}){let l=(0,d.k)(),o=(0,t.useRouter)(),[f,g]=(0,n.useTransition)(),[x,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:f,onClick:()=>g(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:f,onClick:()=>g(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")]})]}),x&&(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:x.slug,onChange:e=>k({...x,slug:e.target.value})}),(0,a.jsx)("input",{className:"form-input",style:{width:200},placeholder:l("block.titlePlaceholder"),value:x.title,onChange:e=>k({...x,title:e.target.value})}),(0,a.jsx)("input",{className:"form-input",style:{width:160},placeholder:l("block.kindPlaceholder"),value:x.kind,onChange:e=>k({...x,kind:e.target.value})})]}),(0,a.jsx)("textarea",{className:"persona-ta mono",style:{minHeight:200,width:"100%"},placeholder:l("block.bodyPlaceholder"),value:x.body,onChange:e=>k({...x,body:e.target.value})}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,a.jsxs)("button",{className:"btn-accent",disabled:f||!x.slug.trim()||!x.body.trim(),onClick:()=>{x&&g(async()=>{await m(x),k(null),o.refresh()})},children:[(0,a.jsx)(c.I,{name:"check",size:13})," ",f?l("block.saving"):l("block.save")]}),(0,a.jsx)("button",{className:"btn-ghost",onClick:()=>k(null),children:l("block.cancel")})]})]}),0===e.length&&!x&&(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:f,title:l("block.delete"),onClick:()=>g(async()=>{await u(e.slug),o.refresh()}),children:(0,a.jsx)(c.I,{name:"trash",size:12})})]})]},e.slug))]})]})}},4646:(e,s,l)=>{"use strict";l.d(s,{O:()=>n});var a=l(7814);let n=(0,a.createServerReference)("0018beb06b15d253498af2e1d83c7efb58ba1235f1",a.callServer,void 0,a.findSourceMapURL,"curateKbAction")},7423:(e,s,l)=>{Promise.resolve().then(l.t.bind(l,3283,23)),Promise.resolve().then(l.bind(l,2825)),Promise.resolve().then(l.bind(l,8445)),Promise.resolve().then(l.bind(l,181)),Promise.resolve().then(l.bind(l,6588)),Promise.resolve().then(l.bind(l,4414)),Promise.resolve().then(l.bind(l,6824)),Promise.resolve().then(l.bind(l,4942)),Promise.resolve().then(l.bind(l,2444)),Promise.resolve().then(l.bind(l,5787))},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(349),d=l(4646);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,6836,8370,6646,6834,7358],()=>e(e.s=7423)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4944],{972:(e,t,r)=>{"use strict";r.d(t,{E:()=>i,e:()=>s});let i=["Cockpit","Hierarchy","Execution","Product","Knowledge","Operations","Inbox","System"],s=[{id:"home",title:"Home",href:"/",group:"Cockpit",tile:"Welcome — canonical knowledge & quick navigation",icon:"grid"},{id:"dashboard",title:"Dashboard",href:"/dashboard",group:"Cockpit",tile:"Cockpit hub — status at a glance",icon:"pulse"},{id:"organizations",title:"Organizations",href:"/organizations",group:"Hierarchy",tile:"Manage organizations & workspaces",icon:"grid"},{id:"org",title:"Org Chart",href:"/org",group:"Hierarchy",tile:"Hierarchy & delegation",icon:"agents"},{id:"agents",title:"Agent Studio",href:"/agents/ada",group:"Hierarchy",tile:"Configure each agent",icon:"bot"},{id:"code",title:"Code",href:"/code",group:"Execution",tile:"Code editor & repo files",icon:"terminal"},{id:"tasks",title:"Tasks",href:"/tasks",group:"Execution",tile:"Team kanban board",icon:"files"},{id:"cron",title:"Cron",href:"/cron",group:"Execution",tile:"Scheduled tasks & history",icon:"calendar"},{id:"routines",title:"Routines",href:"/routines",group:"Execution",tile:"Recurring automations",icon:"repeat"},{id:"goals",title:"Goals",href:"/goals",group:"Execution",tile:"Objective tree",icon:"target"},{id:"design",title:"Design",href:"/design",group:"Execution",tile:"Prototype the UI with the frontend agent before the plan",icon:"grid"},{id:"planner",title:"CEO Planner",href:"/planner",group:"Execution",tile:"Specs → issues → approval → 24/7",icon:"command"},{id:"test-dev",title:"Test Dev",href:"/test-dev",group:"Execution",tile:"Boot, navigate + validate the project",icon:"play"},{id:"pm",title:"Product Manager",href:"/pm",group:"Product",tile:"Sprints & backlog (PO)",icon:"goto"},{id:"reports",title:"Reports",href:"/reports",group:"Knowledge",tile:"Plans, reviews, audits",icon:"doc"},{id:"docs",title:"Docs",href:"/docs",group:"Knowledge",tile:"Architecture, API & PO docs",icon:"doc"},{id:"skills",title:"Skills",href:"/skills",group:"Knowledge",tile:"Agent procedure library",icon:"skill"},{id:"activity",title:"Activity",href:"/activity",group:"Knowledge",tile:"Agent action timeline",icon:"pulse"},{id:"knowledge",title:"Knowledge",href:"/knowledge",group:"Knowledge",tile:"KB index, coverage, gaps & agent recall",icon:"branch"},{id:"costs",title:"Costs",href:"/costs",group:"Operations",tile:"Spend by agent/provider",icon:"coins"},{id:"security",title:"Security",href:"/security",group:"Operations",tile:"Findings & security score",icon:"shield"},{id:"pulse",title:"Pulse",href:"/pulse",group:"Operations",tile:"Agent health & validation",icon:"pulse"},{id:"github",title:"Commit GitHub",href:"/github",group:"Operations",tile:"Push workspace to remote",icon:"git"},{id:"prepare-deploy",title:"Prepare Deploy",href:"/prepare-deploy",group:"Operations",tile:"Prod-prep + export clean source to a deploy repo",icon:"goto"},{id:"models",title:"Models",href:"/models",group:"Operations",tile:"Providers & local models",icon:"cpu"},{id:"update",title:"Update",href:"/update",group:"Operations",tile:"Detect & apply new versions",icon:"goto"},{id:"plugins",title:"Plugins",href:"/plugins",group:"Operations",tile:"Extensions & integrations",icon:"ext"},{id:"inbox",title:"Inbox",href:"/inbox",group:"Inbox",tile:"Approvals & escalations",icon:"inbox"},{id:"notifications",title:"Notifications",href:"/notifications",group:"Inbox",tile:"Passive alert feed",icon:"bell"},{id:"config",title:"Config",href:"/config",group:"System",tile:"Platform settings",icon:"settings"},{id:"profile",title:"Profile",href:"/profile",group:"System",tile:"Account & preferences",icon:"account"}]},2093:(e,t,r)=>{"use strict";r.d(t,{RunnerHeartbeat:()=>l});var i=r(8488),s=r(9860),n=r(7814);let a=(0,n.createServerReference)("006719bab2c5093e448a5b60a38be68998349f13c8",n.callServer,void 0,n.findSourceMapURL,"tick"),c=(0,n.createServerReference)("0083d8bd1fd660d07c4a32afdfbaf0d4ce78f74b81",n.callServer,void 0,n.findSourceMapURL,"autoTick");function l({intervalMs:e=8e3,approved:t=!1,auto247:r=!1}){let n=(0,s.useRouter)(),o=(0,i.useRef)(!1),d=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{let t=!1;async function r(){if(!t&&!o.current&&!document.hidden){o.current=!0;try{let e=await a();!e.paused&&(e.advanced||(e.changed??0)>0)&&n.refresh()}catch{}finally{o.current=!1}}}r();let i=setInterval(r,e),s=()=>{document.hidden||r()};return document.addEventListener("visibilitychange",s),()=>{t=!0,clearInterval(i),document.removeEventListener("visibilitychange",s)}},[e,n]),(0,i.useEffect)(()=>{let e=!1;async function i(){if(!e&&!d.current&&!document.hidden&&t&&r){d.current=!0;try{let t=await c();t.ran&&n.refresh(),e||t.paused||!t.ran||!(t.remaining>0)||document.hidden||setTimeout(i,1200)}catch{}finally{d.current=!1}}}i();let s=()=>{document.hidden||i()};return document.addEventListener("visibilitychange",s),()=>{e=!0,document.removeEventListener("visibilitychange",s)}},[t,r,n]),null}},3999:(e,t,r)=>{"use strict";r.d(t,{Sidebar:()=>j});var i=r(5076),s=r(3283),n=r.n(s),a=r(9860),c=r(972),l=r(8576),o=r(8488),d=r(6816),h=r(5629),x=r(5126);function p({orgs:e,currentId:t,workspaceSlug:r}){let s=(0,h.k)(),n=(0,a.useRouter)(),[c,u]=(0,o.useState)(!1),[g,j]=(0,o.useTransition)(),v=(0,o.useRef)(null),m=e.find(e=>e.id===t)||e[0];return(0,o.useEffect)(()=>{if(c)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){v.current&&!v.current.contains(e.target)&&u(!1)}function t(e){"Escape"===e.key&&u(!1)}},[c]),(0,i.jsxs)("div",{className:"org-switch",ref:v,children:[(0,i.jsxs)("button",{className:"org-switch-btn"+(c?" open":""),disabled:g,onClick:()=>u(e=>!e),title:m?.name,children:[(0,i.jsx)(d.J,{size:34,rx:10}),(0,i.jsxs)("div",{className:"os-meta",children:[(0,i.jsx)("div",{className:"os-name",children:m?.name??"Constella"}),(0,i.jsx)("div",{className:"os-sub mono",children:r})]}),(0,i.jsx)(l.I,{name:"chevronDown",size:14})]}),c&&(0,i.jsxs)("div",{className:"org-pop",children:[(0,i.jsx)("div",{className:"org-pop-h",children:s("mod.organizations")}),e.map((e,r)=>(0,i.jsxs)("button",{className:"org-pop-item"+(e.id===t?" on":""),onClick:()=>{var r;return r=e.id,void(u(!1),r!==t&&j(async()=>{await (0,x.T)(r),window.location.href="/"}))},children:[(0,i.jsx)("span",{className:"op-badge",children:r+1}),(0,i.jsx)("span",{className:"op-name",children:e.name}),e.id===t&&(0,i.jsx)(l.I,{name:"check",size:14})]},e.id)),(0,i.jsx)("div",{className:"org-pop-sep"}),(0,i.jsxs)("button",{className:"org-pop-create",onClick:()=>{u(!1),n.push("/onboarding")},children:[(0,i.jsx)("span",{className:"opc-ic",children:(0,i.jsx)(l.I,{name:"add",size:13})})," ",s("orgs.createOrganization")]})]})]})}var u=r(7814);let g=(0,u.createServerReference)("00feed4d6ebbd8cdf6c7a8f96aad93c3301737f1ff",u.callServer,void 0,u.findSourceMapURL,"signOutAction");function j({orgs:e,currentOrgId:t,workspaceSlug:r,userName:s,userEmail:o,userImage:d,inboxCount:x,notifCount:u}){let v=(0,a.usePathname)(),m=(0,h.k)();return(0,i.jsxs)("aside",{className:"side",children:[(0,i.jsx)("div",{className:"side-brand-wrap",children:(0,i.jsx)(p,{orgs:e,currentId:t,workspaceSlug:r})}),(0,i.jsxs)(n(),{href:"/search",className:"nav-search",children:[(0,i.jsx)(l.I,{name:"search",size:13}),(0,i.jsx)("input",{placeholder:m("nav.search"),readOnly:!0,style:{pointerEvents:"none"}})]}),(0,i.jsx)("div",{className:"side-nav scroll",children:c.E.map(e=>{let t=c.e.filter(t=>t.group===e);return t.length?(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"nav-group-label",children:m(`group.${e}`)}),t.map(e=>{let t=e=>"/"+(e.split("/")[1]??""),r="home"===e.id?"/"===v:t(v)===t(e.href),s="inbox"===e.id?x:"notifications"===e.id?u:0;return(0,i.jsxs)(n(),{href:e.href,className:"nav-item"+(r?" active":""),children:[(0,i.jsx)(l.I,{name:e.icon,size:17}),(0,i.jsx)("span",{children:m(`mod.${e.id}`)}),s?(0,i.jsx)("span",{className:"nv-badge",children:s}):null]},e.id)})]},e):null})}),(0,i.jsxs)("div",{className:"side-foot",children:[(0,i.jsx)("div",{className:"top-avatar",style:{margin:0,overflow:"hidden",padding:d?0:void 0},children:d?(0,i.jsx)("img",{src:/^(data:|https?:|\/)/.test(d)?d:`/api/upload?path=${encodeURIComponent(d)}`,alt:s,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):(s?.[0]||"O").toUpperCase()}),(0,i.jsxs)(n(),{href:"/profile",className:"pf",children:[(0,i.jsx)("div",{className:"pn",children:s||m("nav.operator")}),(0,i.jsx)("div",{className:"pe",children:o||""})]}),(0,i.jsx)("form",{action:g,children:(0,i.jsx)("button",{className:"foot-signout",title:m("nav.signout"),type:"submit",children:(0,i.jsx)(l.I,{name:"close",size:15})})})]})]})}},4419:(e,t,r)=>{Promise.resolve().then(r.bind(r,6257)),Promise.resolve().then(r.bind(r,2093)),Promise.resolve().then(r.bind(r,5750)),Promise.resolve().then(r.bind(r,3999)),Promise.resolve().then(r.bind(r,6217))},5126:(e,t,r)=>{"use strict";r.d(t,{T:()=>s});var i=r(7814);let s=(0,i.createServerReference)("40f7fd7992a8b9392597609349e63fb2460027c08a",i.callServer,void 0,i.findSourceMapURL,"setActiveOrg")},5629:(e,t,r)=>{"use strict";r.d(t,{LangProvider:()=>c,k:()=>l});var i=r(5076),s=r(8488),n=r(3219);let a=(0,s.createContext)("en");function c({lang:e,children:t}){return(0,i.jsx)(a.Provider,{value:e,children:t})}function l(){let e=(0,s.useContext)(a);return(t,r)=>(0,n.t)(e,t,r)}},5750:(e,t,r)=>{"use strict";r.d(t,{SearchHotkey:()=>n});var i=r(8488),s=r(9860);function n(){let e=(0,s.useRouter)();return(0,i.useEffect)(()=>{function t(t){(t.ctrlKey||t.metaKey)&&("p"===t.key||"k"===t.key||"P"===t.key||"K"===t.key)&&(t.preventDefault(),e.push("/search"))}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),null}},6217:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>d});var i=r(5076),s=r(8488),n=r(9860),a=r(8576),c=r(5629),l=r(7814);let o=(0,l.createServerReference)("40a067d42212349997f6b7b49b9b48eb75e87fe55a",l.callServer,void 0,l.findSourceMapURL,"recentNotifications");function d(){let e=(0,c.k)(),[t,r]=(0,s.useState)([]),l=(0,s.useRef)(0),d=(0,s.useRef)(new Set),h=(0,n.useRouter)();(0,s.useEffect)(()=>{l.current=Date.now();let e=!0,t=setInterval(async()=>{try{let t=await o(l.current);if(!e||!t.length)return;l.current=Math.max(l.current,...t.map(e=>e.at));let i=t.filter(e=>!d.current.has(e.id));if(!i.length)return;i.forEach(e=>d.current.add(e.id)),r(e=>[...i,...e].slice(0,4))}catch{}},8e3);return()=>{e=!1,clearInterval(t)}},[]);let x=(0,s.useRef)(new Set);function p(e){r(t=>t.filter(t=>t.id!==e))}return((0,s.useEffect)(()=>{for(let e of t)x.current.has(e.id)||(x.current.add(e.id),setTimeout(()=>r(t=>t.filter(t=>t.id!==e.id)),7e3))},[t]),t.length)?(0,i.jsx)("div",{className:"toaster",children:t.map(t=>{var r;return(0,i.jsxs)("div",{className:"toast toast-"+t.kind,role:"status",onClick:()=>{var e,r;(p((e=t).id),e.channel&&("room"===(r=e.channel)||"telegram"===r||r.startsWith("dm:")))?window.dispatchEvent(new CustomEvent("constella:open-chat",{detail:{channel:e.channel}})):h.push("/notifications")},children:[(0,i.jsx)("span",{className:"toast-ic",children:(0,i.jsx)(a.I,{name:"approval"===(r=t.kind)||"needs-approval"===r?"inbox":"security"===r||"block"===r||"blocked"===r?"shield":"deploy"===r?"goto":"error"===r||"warn"===r||"warning"===r?"warn":r.startsWith("dm")||"mention"===r||"message"===r?"chat":"bell",size:15})}),(0,i.jsxs)("div",{className:"toast-body",children:[(0,i.jsx)("div",{className:"toast-title",children:t.text}),t.detail&&(0,i.jsx)("div",{className:"toast-detail",children:t.detail})]}),(0,i.jsx)("button",{className:"toast-x",title:e("common.dismiss"),onClick:e=>{e.stopPropagation(),p(t.id)},children:(0,i.jsx)(a.I,{name:"close",size:12})})]},t.id)})}):null}},6257:(e,t,r)=>{"use strict";r.d(t,{ChatDockGate:()=>a});var i=r(5076),s=r(9860),n=r(8306);function a(e){return"/"===(0,s.usePathname)()?null:(0,i.jsx)(n.uG,{...e})}},6816:(e,t,r)=>{"use strict";r.d(t,{J:()=>s});var i=r(5076);function s({size:e=34,rx:t=9}){return(0,i.jsxs)("svg",{width:e,height:e,viewBox:"0 0 100 100",style:{display:"block",flex:`0 0 ${e}px`},"aria-label":"Constella",children:[(0,i.jsx)("rect",{x:"1",y:"1",width:"98",height:"98",rx:t,fill:"var(--cs-bg)",stroke:"var(--cs-border)",strokeWidth:"1.5"}),(0,i.jsx)("path",{d:"M66.06 27.06 L42.75 22.95 L24.62 38.17 L24.62 61.83 L42.75 77.05 L66.06 72.94",fill:"none",stroke:"var(--cs-line)",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M48 50 L42.75 22.95 M48 50 L24.62 50 M48 50 L42.75 77.05",fill:"none",stroke:"var(--cs-line)",strokeWidth:"1.2",strokeLinecap:"round",opacity:"0.55"}),[[66.06,27.06],[42.75,22.95],[24.62,38.17],[24.62,61.83],[42.75,77.05],[66.06,72.94]].map((e,t)=>(0,i.jsx)("circle",{cx:e[0],cy:e[1],r:"3.1",fill:"var(--cs-node)"},t)),(0,i.jsx)("circle",{cx:"48",cy:"50",r:"8.5",fill:"var(--cs-glow)",opacity:"0.4"}),(0,i.jsx)("circle",{cx:"48",cy:"50",r:"4.3",fill:"var(--cs-core)"})]})}},8576:(e,t,r)=>{"use strict";r.d(t,{I:()=>n});var i=r(5076);let s={files:(0,i.jsx)("path",{d:"M3 3.5h5l1.5 2H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z"}),search:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"7",cy:"7",r:"4.2"}),(0,i.jsx)("path",{d:"M10.2 10.2 14 14"})]}),git:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"4",cy:"4",r:"1.8"}),(0,i.jsx)("circle",{cx:"4",cy:"12",r:"1.8"}),(0,i.jsx)("circle",{cx:"12",cy:"9.5",r:"1.8"}),(0,i.jsx)("path",{d:"M4 5.8v4.4M5.8 4H9a2 2 0 0 1 2 2v1.6"})]}),debug:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8.5",r:"3.5"}),(0,i.jsx)("path",{d:"M8 5V3M4.5 8.5H2m12 0h-2.5M4.8 11.8 3.4 13M11.2 11.8l1.4 1.2M5.2 5 3.8 3.6M10.8 5l1.4-1.4"})]}),ext:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2.5",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("rect",{x:"9",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("rect",{x:"2.5",y:"9",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("path",{d:"M9 11.2h4.5M11.2 9v4.5"})]}),settings:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"2.2"}),(0,i.jsx)("path",{d:"M8 1.5v2M8 12.5v2M14.5 8h-2M3.5 8h-2M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4M12.6 12.6l-1.4-1.4M4.8 4.8 3.4 3.4"})]}),account:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"5.5",r:"2.8"}),(0,i.jsx)("path",{d:"M2.8 14c0-2.8 2.3-4.5 5.2-4.5s5.2 1.7 5.2 4.5"})]}),chevronRight:(0,i.jsx)("path",{d:"M6 4l4 4-4 4"}),chevronDown:(0,i.jsx)("path",{d:"M4 6l4 4 4-4"}),chevronUp:(0,i.jsx)("path",{d:"M4 10l4-4 4 4"}),close:(0,i.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"}),add:(0,i.jsx)("path",{d:"M8 3v10M3 8h10"}),newFile:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M9 2H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V6L9 2z"}),(0,i.jsx)("path",{d:"M9 2v4h4M8 8v4M6 10h4"})]}),newFolder:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M2 5.5a1 1 0 0 1 1-1h3l1.2 1.5H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5.5z"}),(0,i.jsx)("path",{d:"M8 8v3M6.5 9.5h3"})]}),refresh:(0,i.jsx)("path",{d:"M13 8a5 5 0 1 1-1.5-3.5M13 2.5V5h-2.5"}),collapse:(0,i.jsx)("path",{d:"M3 5h6M3 8h6M3 11h6M12 6l-1.5 1.5L12 9"}),more:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"3.5",cy:"8",r:"1"}),(0,i.jsx)("circle",{cx:"8",cy:"8",r:"1"}),(0,i.jsx)("circle",{cx:"12.5",cy:"8",r:"1"})]}),split:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1"}),(0,i.jsx)("path",{d:"M8 3v10"})]}),terminal:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M4.5 6.5 6.5 8l-2 1.5M8 10h3.5"})]}),panelBottom:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M2 10h12"})]}),sidebarIcon:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M6 3v10"})]}),bell:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M8 2a3.5 3.5 0 0 0-3.5 3.5c0 3-1.3 4-1.3 4h9.6s-1.3-1-1.3-4A3.5 3.5 0 0 0 8 2z"}),(0,i.jsx)("path",{d:"M6.7 12a1.4 1.4 0 0 0 2.6 0"})]}),check:(0,i.jsx)("path",{d:"M3 8.5 6.5 12 13 4"}),error:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,i.jsx)("path",{d:"M8 5v4M8 11h.01"})]}),warn:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M8 2.5 14.5 13.5h-13z"}),(0,i.jsx)("path",{d:"M8 7v3M8 12h.01"})]}),branch:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"4",cy:"4",r:"1.6"}),(0,i.jsx)("circle",{cx:"4",cy:"12",r:"1.6"}),(0,i.jsx)("circle",{cx:"12",cy:"9",r:"1.6"}),(0,i.jsx)("path",{d:"M4 5.6v4.8M5.6 4H9a1.8 1.8 0 0 1 1.8 1.8v1.6"})]}),sync:(0,i.jsx)("path",{d:"M3 6a5 5 0 0 1 8.5-2M13 10a5 5 0 0 1-8.5 2M11.5 2.5V4h-1.5M4.5 13.5V12h1.5"}),command:(0,i.jsx)("path",{d:"M5.5 3.5A1.5 1.5 0 1 1 4 5h8a1.5 1.5 0 1 1-1.5 1.5v3A1.5 1.5 0 1 1 12 11H4a1.5 1.5 0 1 1 1.5-1.5v-3z"}),goto:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M3 8h8M7.5 4.5 11 8l-3.5 3.5"}),(0,i.jsx)("path",{d:"M13 3v10"})]}),sun:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,i.jsx)("path",{d:"M8 1.5v1.5M8 13v1.5M14.5 8H13M3 8H1.5M12.6 3.4l-1 1M4.4 11.6l-1 1M12.6 12.6l-1-1M4.4 4.4l-1-1"})]}),moon:(0,i.jsx)("path",{d:"M13 9.2A5.5 5.5 0 0 1 6.8 3 5.5 5.5 0 1 0 13 9.2z"}),play:(0,i.jsx)("path",{d:"M5 3.5v9l7-4.5z"}),trash:(0,i.jsx)("path",{d:"M3.5 4.5h9M6 4.5V3h4v1.5M5 4.5l.5 8.5h5l.5-8.5"}),dot:(0,i.jsx)("circle",{cx:"8",cy:"8",r:"3"}),fileTs:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M9 2H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V6L9 2z"}),(0,i.jsx)("path",{d:"M9 2v4h4"})]}),arrowUp:(0,i.jsx)("path",{d:"M8 13V3M4 7l4-4 4 4"}),arrowDown:(0,i.jsx)("path",{d:"M8 3v10M4 9l4 4 4-4"}),agents:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"5.5",cy:"6",r:"2.2"}),(0,i.jsx)("circle",{cx:"11",cy:"6.5",r:"1.8"}),(0,i.jsx)("path",{d:"M2 13c0-2 1.6-3.2 3.5-3.2S9 11 9 13M9.5 12.5c.2-1.6 1.3-2.5 2.8-2.5 1.3 0 2.4.8 2.4 2.3"})]}),bot:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"3",y:"5.5",width:"10",height:"7",rx:"2"}),(0,i.jsx)("path",{d:"M8 3v2.5M5.8 9h.01M10.2 9h.01M6 12h4"}),(0,i.jsx)("circle",{cx:"8",cy:"3",r:"1"})]}),send:(0,i.jsx)("path",{d:"M14 2 7 9M14 2l-4.5 12-2.5-5L2 6.5z"}),at:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,i.jsx)("path",{d:"M11 8v1.2a1.8 1.8 0 0 0 3.5.6A6.5 6.5 0 1 0 11 13.2"})]}),chevronLeft:(0,i.jsx)("path",{d:"M10 4 6 8l4 4"}),dockRight:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M10 3v10"}),(0,i.jsx)("rect",{x:"10.5",y:"3.5",width:"3",height:"9",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.25"})]}),dockLeft:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M6 3v10"}),(0,i.jsx)("rect",{x:"2.5",y:"3.5",width:"3",height:"9",rx:"1",fill:"currentColor",stroke:"none",opacity:"0.25"})]}),chat:(0,i.jsx)("path",{d:"M3 4.5h10a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H7l-3 2.5V11.5H3a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1z"}),grid:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2.5",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("rect",{x:"9",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("rect",{x:"2.5",y:"9",width:"4.5",height:"4.5",rx:"1"}),(0,i.jsx)("rect",{x:"9",y:"9",width:"4.5",height:"4.5",rx:"1"})]}),inbox:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M2 9h3l1 2h4l1-2h3"}),(0,i.jsx)("path",{d:"M2.5 9 4 3.5h8L13.5 9v3.5a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1z"})]}),calendar:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2.5",y:"3.5",width:"11",height:"10",rx:"1.5"}),(0,i.jsx)("path",{d:"M2.5 6.5h11M5.5 2v3M10.5 2v3"})]}),repeat:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M3 6a4 4 0 0 1 7-2.5L12 5M13 10a4 4 0 0 1-7 2.5L4 11"}),(0,i.jsx)("path",{d:"M12 2v3H9M4 14v-3h3"})]}),doc:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M9 2H4.5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V5.5L9 2z"}),(0,i.jsx)("path",{d:"M9 2v3.5h3.5M6 8.5h4M6 11h4"})]}),skill:(0,i.jsx)("path",{d:"M8 2.5l1.4 3.1 3.4.4-2.5 2.3.7 3.3L8 9.9 5 11.6l.7-3.3L3.2 6l3.4-.4z"}),pulse:(0,i.jsx)("path",{d:"M2 8h3l1.5-4 2.5 8 1.5-4H14"}),coins:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("ellipse",{cx:"6",cy:"4.5",rx:"3.5",ry:"1.8"}),(0,i.jsx)("path",{d:"M2.5 4.5v3c0 1 1.6 1.8 3.5 1.8s3.5-.8 3.5-1.8v-3"}),(0,i.jsx)("ellipse",{cx:"10",cy:"9.5",rx:"3.5",ry:"1.8"}),(0,i.jsx)("path",{d:"M6.5 9.5c.4.9 1.8 1.5 3.5 1.5s3.5-.8 3.5-1.8v-1.2"})]}),cpu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"}),(0,i.jsx)("rect",{x:"6.3",y:"6.3",width:"3.4",height:"3.4",rx:".5"}),(0,i.jsx)("path",{d:"M6 2v2M10 2v2M6 12v2M10 12v2M2 6h2M2 10h2M12 6h2M12 10h2"})]}),shield:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:"M8 2 3 4v4c0 3 2.2 5 5 6 2.8-1 5-3 5-6V4z"}),(0,i.jsx)("path",{d:"M5.8 8 7.3 9.5 10.4 6.3"})]}),target:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,i.jsx)("circle",{cx:"8",cy:"8",r:"2.4"})]}),selectParent:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{x:"2",y:"2.5",width:"12",height:"11",rx:"1.5"}),(0,i.jsx)("path",{d:"M8 11V6.5M5.5 9 8 6.5l2.5 2.5"})]})};function n({name:e,size:t=16,className:r="",strokeWidth:a=1.4,style:c}){let l=s[e];return l?(0,i.jsx)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:c,children:"play"===e||"dot"===e?(0,i.jsx)("g",{fill:"currentColor",stroke:"none",children:l}):l}):null}}},e=>{e.O(0,[9219,9690,3219,2831,8306,6646,6834,7358],()=>e(e.s=4419)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9274],{390:(e,a,s)=>{"use strict";s.d(a,{k:()=>n});var l=s(7814);let n=(0,l.createServerReference)("605ca43c0bef77a42f5e1fee476bad0478ca45b90e",l.callServer,void 0,l.findSourceMapURL,"saveAgentModel")},2267:(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)("40c4cc3f2d97110b2d69610739ee46dbe5a2a37d85",m.callServer,void 0,m.findSourceMapURL,"testProvider"),h=(0,m.createServerReference)("4005f3f9461c2e6b2fecdac81c822e2481fbdbaec1",m.callServer,void 0,m.findSourceMapURL,"syncProvider"),u=(0,m.createServerReference)("403c1d8c05fcc53bd28044c5b835d4b402564a964f",m.callServer,void 0,m.findSourceMapURL,"revokeProviderToken"),x=(0,m.createServerReference)("4004673068530656edd28ca2b130a1096f274e2cde",m.callServer,void 0,m.findSourceMapURL,"removeProvider");var v=s(7566);let g=(0,m.createServerReference)("408898da73d5e0af066104c62997b817201c0a99cf",m.callServer,void 0,m.findSourceMapURL,"refreshProviderModels");var f=s(6245);let j=(0,m.createServerReference)("60f96bab69a09e9fcf636f80db1eff87d3be983a60",m.callServer,void 0,m.findSourceMapURL,"connectProvider");var b=s(8088);let k=(0,m.createServerReference)("0024bf7b34a52fe14a9a978ce3e57cfede2898f61a",m.callServer,void 0,m.findSourceMapURL,"downloadLlamaServer"),B=(0,m.createServerReference)("40c0f496f5293823123e86e702c43f6dbd13fa0241",m.callServer,void 0,m.findSourceMapURL,"startLlamaServer"),y=(0,m.createServerReference)("00a82d9997685786a827f84d1adec8c0464ab77242",m.callServer,void 0,m.findSourceMapURL,"stopLlamaServer"),N=(0,m.createServerReference)("4054d8c9d713d027d9beb3076074624ea681f897ba",m.callServer,void 0,m.findSourceMapURL,"removeGguf"),w=(0,m.createServerReference)("40caf95c1217c0ac6c4afc1ff748b52c6e39b5c8cd",m.callServer,void 0,m.findSourceMapURL,"removeModel"),S=(0,m.createServerReference)("4070a1e8f5dfdb123c1dd3ba53e819cd324592eeef",m.callServer,void 0,m.findSourceMapURL,"downloadGguf");var C=s(5509);let I=(0,m.createServerReference)("0078876825bee310a72cf001e5fe01a3304ba0a060",m.callServer,void 0,m.findSourceMapURL,"embedStatus"),M=(0,m.createServerReference)("00554e833ae48f796f0eac7ddef3970ff24f235ad7",m.callServer,void 0,m.findSourceMapURL,"startEmbeddings"),z=(0,m.createServerReference)("0018c198f4a47e6adc1238b5daa532fab3632f90ad",m.callServer,void 0,m.findSourceMapURL,"reindexRag");var _=s(390);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")]})}},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(7566),c=s(6245);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,2267)),Promise.resolve().then(s.bind(s,181)),Promise.resolve().then(s.bind(s,6588)),Promise.resolve().then(s.bind(s,4414)),Promise.resolve().then(s.bind(s,6824)),Promise.resolve().then(s.bind(s,4942)),Promise.resolve().then(s.bind(s,2444)),Promise.resolve().then(s.bind(s,5787))},5509:(e,a,s)=>{"use strict";s.d(a,{j:()=>n});var l=s(7814);let n=(0,l.createServerReference)("40a51f05a62e5ad01e4585ad064bcc9493ef1588fc",l.callServer,void 0,l.findSourceMapURL,"pullModel")},6245:(e,a,s)=>{"use strict";s.d(a,{E:()=>n});var l=s(7814);let n=(0,l.createServerReference)("409ff004d8d4df25bdce5af6d94dd7d215787a3304",l.callServer,void 0,l.findSourceMapURL,"listProviderModels")},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.replace(/[-_.\s]\d+(?:x\d+)?[bm]\b/i,""),s=a.match(/(\d+(?:[.\-]\d+){0,2})(?!.*\d)/),l=s?s[1].replace(/-/g,"."):"";return{label:(s?a.slice(0,s.index).replace(/[-_.\s]+$/,""):a).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}}},7566:(e,a,s)=>{"use strict";s.d(a,{A:()=>n});var l=s(7814);let n=(0,l.createServerReference)("403a1916644d7877e6f55e5ed65de73f9157ca3977",l.callServer,void 0,l.findSourceMapURL,"listCatalogModels")}},e=>{e.O(0,[9219,3219,6836,8370,4263,6646,6834,7358],()=>e(e.s=4813)),_N_E=e.O()}]);
@@ -0,0 +1,12 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1308],{1352:(e,t,a)=>{"use strict";a.d(t,{e:()=>i});var n=a(7814);let i=(0,n.createServerReference)("001e9ef8a66d3ec2113043b24ab8849578169f7b7f",n.callServer,void 0,n.findSourceMapURL,"pollUpdateResult")},1870:(e,t,a)=>{"use strict";a.d(t,{l:()=>i});var n=a(7814);let i=(0,n.createServerReference)("40c4dec4c26a6ed0bdf72098c743c4c2cb18ed1cd1",n.callServer,void 0,n.findSourceMapURL,"getUpdateState")},1959:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,3789)),Promise.resolve().then(a.bind(a,181)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,6824)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444))},2282:(e,t,a)=>{"use strict";a.d(t,{P:()=>i});var n=a(7814);let i=(0,n.createServerReference)("00a23e99d4e912da3ad1b266a22b1a141df6bc8b94",n.callServer,void 0,n.findSourceMapURL,"runUpdate")},2393:(e,t,a)=>{"use strict";a.d(t,{H4:()=>l,Uy:()=>o,st:()=>s});let n=/Failed to find Server Action|older or newer deployment|ChunkLoadError|Loading chunk [\w-]+ failed|error loading dynamically imported module/i,i=/invariant expected layout router to be mounted/i;function r(e){return e?e instanceof Error?`${e.name} ${e.message}`:"string"==typeof e?e:String(e?.message??e):""}function s(e){return n.test(r(e))}function l(e){let t=r(e);return n.test(t)||i.test(t)}function o(){try{let e="cn-skew-reload-at",t=Number(window.sessionStorage.getItem(e)||0);if(Date.now()-t<2e4)return;window.sessionStorage.setItem(e,String(Date.now()))}catch{}try{let e=new URL(window.location.href);e.searchParams.set("_r",String(Date.now())),window.location.replace(e.toString())}catch{window.location.reload()}}},2444:(e,t,a)=>{"use strict";a.d(t,{UpdateHeaderBadge:()=>h});var n=a(5076),i=a(8488),r=a(9860),s=a(8576),l=a(5629),o=a(1870),d=a(2282),c=a(1352),u=a(2393);function h(){let e=(0,l.k)(),t=(0,r.useRouter)(),[a,h]=(0,i.useState)(null),[p,f]=(0,i.useState)(!1),[v,m]=(0,i.useState)("available"),[b,g]=(0,i.useState)(!1),[x,y]=(0,i.useState)(""),j=(0,i.useRef)(null);async function w(){if(!b){g(!0),y("");try{let t=await (0,o.l)(!0);h(t.info.updateAvailable&&t.info.latest?t.info.latest:null),f(t.busy),t.info.updateAvailable||y(e("chrome.update.upToDate"))}catch{}finally{g(!1)}}}async function S(){if("updating"!==v&&!p){if("done"===v)return void t.refresh();m("updating"),y("");try{let a=await (0,d.P)();if(a.blocked){m("available"),f(!0),y(e("chrome.update.busy"));return}a.started?j.current=setInterval(async()=>{let t=await (0,c.e)().catch(e=>((0,u.st)(e)&&(j.current&&clearInterval(j.current),(0,u.Uy)()),null));t&&("done"===t.status?(j.current&&clearInterval(j.current),window.location.reload()):"error"===t.status&&(j.current&&clearInterval(j.current),m("error"),y(e("chrome.update.failed"))))},3e3):(m("available"),y(a.message||""),t.push("/update"))}catch{m("error"),y(e("chrome.update.failed"))}}}(0,i.useEffect)(()=>{let e=!1,t=async t=>{try{let a=await (0,o.l)(t);if(e)return;h(a.info.updateAvailable&&a.info.latest?a.info.latest:null),f(a.busy)}catch{}};t(!1);let a=setInterval(()=>t(!1),12e3),n=setInterval(()=>t(!0),18e4);return()=>{e=!0,clearInterval(a),clearInterval(n),j.current&&clearInterval(j.current)}},[]);let k=(0,n.jsx)("button",{type:"button",className:"top-btn",onClick:w,disabled:b,title:x||e("chrome.update.check"),children:(0,n.jsx)("span",{className:b?"sync-spin":"",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:17})})});if(!a)return k;let N="updating"===v?e("chrome.update.updating"):"done"===v?e("chrome.update.restart"):"error"===v?e("chrome.update.failed"):p?`v${a}`:`${e("chrome.update.update")} v${a}`,I="updating"===v||p;return(0,n.jsxs)(n.Fragment,{children:[k,(0,n.jsxs)("button",{type:"button",onClick:S,disabled:I,title:p?e("chrome.update.busy"):x||`${e("chrome.update.available")} — v${a}`,style:{display:"inline-flex",alignItems:"center",gap:6,width:"auto",padding:"0 11px",height:30,background:"error"===v?"var(--sx-keyword)":p?"var(--bg-active)":"var(--accent)",color:p?"var(--text-dim)":"var(--accent-fg)",borderRadius:999,fontSize:12,fontWeight:600,border:"none",opacity:"updating"===v?.75:1,cursor:I?"default":"pointer"},children:["updating"===v?(0,n.jsx)("span",{className:"sync-spin",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:14})}):(0,n.jsx)(s.I,{name:"updating"===v?"sync":"done"===v?"refresh":"error"===v?"bell":"arrowUp",size:14}),(0,n.jsx)("span",{children:N})]})]})}},2799:(e,t,a)=>{"use strict";function n(e){if(!e)return"";let t=Math.max(0,Math.floor((Date.now()-("number"==typeof e?e*(e<1e12?1e3:1):e.getTime()))/1e3));if(t<60)return"now";let a=Math.floor(t/60);if(a<60)return a+"m";let n=Math.floor(a/60);if(n<24)return n+"h";let i=Math.floor(n/24);return i<7?i+"d":Math.floor(i/7)+"w"}a.d(t,{f:()=>n})},3789:(e,t,a)=>{"use strict";a.d(t,{NotifFeed:()=>f});var n=a(5076),i=a(8488),r=a(8576),s=a(4552),l=a(2799),o=a(7814);let d=(0,o.createServerReference)("4070e00a7b3d353453097d6fe45f06b0b031465075",o.callServer,void 0,o.findSourceMapURL,"markRead"),c=(0,o.createServerReference)("0067f097631aacdd50fd2e300814477a9672d7fd52",o.callServer,void 0,o.findSourceMapURL,"markAllRead"),u=(0,o.createServerReference)("00c40fd47348c57d9fb32d1195f243c0c8b512a761",o.callServer,void 0,o.findSourceMapURL,"clearAll");var h=a(5629);let p={done:"check",deploy:"play",routine:"repeat",test:"debug",security:"shield",budget:"coins"};function f({items:e}){let t=(0,h.k)(),[a,o]=(0,i.useState)(null),[,v]=(0,i.useTransition)(),m=e.filter(e=>!e.read).length;return(0,n.jsxs)("div",{className:"view",style:{position:"relative"},children:[(0,n.jsxs)("div",{className:"view-head",children:[(0,n.jsx)("div",{className:"vh-icon",children:(0,n.jsx)(r.I,{name:"bell",size:20})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"view-title",children:t("notif.title")}),(0,n.jsx)("div",{className:"view-sub",children:t("notif.sub",{n:m})})]}),(0,n.jsxs)("div",{className:"vh-right",children:[(0,n.jsxs)("button",{className:"btn-ghost",onClick:function(){o(null),v(()=>{c()})},disabled:!m,children:[(0,n.jsx)(r.I,{name:"check",size:13})," ",t("notif.readAll")]}),(0,n.jsxs)("button",{className:"btn-ghost",onClick:function(){o(null),v(()=>{u()})},disabled:!e.length,children:[(0,n.jsx)(r.I,{name:"trash",size:13})," ",t("notif.clearAll")]})]})]}),(0,n.jsxs)("div",{className:"view-body scroll",children:[0===e.length&&(0,n.jsxs)("div",{style:{color:"var(--text-faint)",textAlign:"center",padding:40},children:[t("notif.empty")," \uD83D\uDD15"]}),e.map(e=>(0,n.jsxs)("div",{className:"lrow notif-row"+(e.read?" read":""),style:{cursor:"pointer"},onClick:()=>{e.read||v(()=>{d(e.id)}),o(e)},children:[!e.read&&(0,n.jsx)("span",{className:"notif-unread"}),(0,n.jsx)("div",{className:"vh-icon",style:{width:32,height:32,flex:"0 0 32px"},children:(0,n.jsx)(r.I,{name:p[e.kind]||"dot",size:14})}),(0,n.jsxs)("div",{className:"lr-main",children:[(0,n.jsx)("div",{className:"lr-title",style:{fontWeight:e.read?400:600},children:e.text}),(0,n.jsxs)("div",{className:"lr-sub",children:[t(`notif.kind.${e.kind}`),e.agentName?" \xb7 "+e.agentName:""]})]}),(0,n.jsx)("span",{style:{fontSize:11,color:"var(--text-faint)",fontFamily:"var(--mono-font)"},children:(0,l.f)(e.createdAt)}),(0,n.jsx)(r.I,{name:"chevronRight",size:14,style:{color:"var(--text-faint)"}})]},e.id))]}),a&&(0,n.jsx)("div",{className:"detail-overlay",onMouseDown:()=>o(null),children:(0,n.jsxs)("div",{className:"detail-panel",onMouseDown:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"detail-head",children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)("span",{className:"pill",style:{background:"var(--accent)22",color:"var(--accent)"},children:t(`notif.kind.${a.kind}`)}),(0,n.jsx)("button",{className:"dock-tool",onClick:()=>o(null),children:(0,n.jsx)(r.I,{name:"close",size:15})})]}),(0,n.jsx)("div",{className:"view-title",style:{fontSize:16,marginTop:8},children:a.text}),(0,n.jsx)("div",{style:{fontSize:11.5,color:"var(--text-faint)",marginTop:4},children:(0,l.f)(a.createdAt)})]}),(0,n.jsxs)("div",{className:"detail-body",children:[a.agentName&&(0,n.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,n.jsx)(s.e,{name:a.agentName,color:a.agentColor||"#e0a44e",size:24,health:a.agentHealth}),(0,n.jsx)("span",{style:{fontSize:12.5},children:a.agentName})]}),(0,n.jsx)("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6},children:a.detail||t("notif.noDetail")})]})]})})]})}},4414:(e,t,a)=>{"use strict";a.d(t,{ChatToggle:()=>s});var n=a(5076),i=a(8576),r=a(5629);function s(){let e=(0,r.k)();return(0,n.jsx)("button",{className:"top-btn",title:`${e("chrome.chat.agentRoom")} (⌘J)`,type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("constella:toggle-chat")),children:(0,n.jsx)(i.I,{name:"chat",size:17})})}},4552:(e,t,a)=>{"use strict";a.d(t,{e:()=>i});var n=a(5076);function i({name:e,color:t,size:a=24,health:r,image:s}){let l=Math.max(6,Math.round(.3*a)),o=Math.round(.28*a),d=s?/^(data:|https?:|\/)/.test(s)?s:`/api/upload?path=${encodeURIComponent(s)}`:null;return(0,n.jsxs)("span",{style:{position:"relative",width:a,height:a,flex:`0 0 ${a}px`,display:"inline-block"},children:[d?(0,n.jsx)("img",{src:d,alt:e,width:a,height:a,style:{width:a,height:a,borderRadius:o,objectFit:"cover",display:"block"}}):(0,n.jsx)("span",{style:{width:a,height:a,borderRadius:o,background:t,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*a),fontWeight:700},children:(e[0]||"?").toUpperCase()}),r&&(0,n.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:l,height:l,borderRadius:"50%",background:"alive"===r?"var(--sx-string)":"stale"===r?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4942:(e,t,a)=>{"use strict";a.d(t,{SidebarToggle:()=>l});var n=a(5076),i=a(8488),r=a(8576);let s=`
2
+ body.side-collapsed .side{width:58px!important;flex:0 0 58px!important;}
3
+ body.side-collapsed .side .nav-item{justify-content:center;padding-left:0;padding-right:0;position:relative;}
4
+ body.side-collapsed .side .nav-item>span:not(.nv-badge),
5
+ body.side-collapsed .side .nav-group-label,
6
+ body.side-collapsed .side .nav-search input,
7
+ body.side-collapsed .side .side-foot .pf{display:none!important;}
8
+ body.side-collapsed .side .nav-search{justify-content:center;}
9
+ body.side-collapsed .side .side-brand-wrap{overflow:hidden;}
10
+ body.side-collapsed .side .side-foot{justify-content:center;flex-wrap:wrap;gap:6px;}
11
+ body.side-collapsed .side .nv-badge{position:absolute;top:2px;right:6px;}
12
+ `;function l(){let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(!document.getElementById("side-rail-style")){let e=document.createElement("style");e.id="side-rail-style",e.textContent=s,document.head.appendChild(e)}let e=!1;try{e="1"===localStorage.getItem("bx.sideCollapsed")}catch{}t(e),document.body.classList.toggle("side-collapsed",e)},[]),(0,n.jsx)("button",{className:"top-btn"+(e?" on":""),onClick:function(){t(e=>{let t=!e;document.body.classList.toggle("side-collapsed",t);try{localStorage.setItem("bx.sideCollapsed",t?"1":"0")}catch{}return t})},title:e?"Expand sidebar":"Collapse sidebar","aria-label":"Toggle sidebar",children:(0,n.jsx)(r.I,{name:"sidebarIcon",size:17})})}},6588:(e,t,a)=>{"use strict";a.d(t,{BackButton:()=>l});var n=a(5076),i=a(9860),r=a(8576),s=a(5629);function l(){let e=(0,s.k)(),t=(0,i.useRouter)();return(0,n.jsx)("button",{className:"top-btn",title:e("common.back"),style:{marginRight:2},onClick:()=>{window.history.length>1?t.back():t.push("/")},children:(0,n.jsx)(r.I,{name:"chevronLeft",size:18})})}}},e=>{e.O(0,[9219,3219,6836,6646,6834,7358],()=>e(e.s=1959)),_N_E=e.O()}]);
@@ -0,0 +1,12 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8902],{891:(e,t,a)=>{"use strict";a.d(t,{m:()=>r});var n=a(5076);let l={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 r({status:e,label:t=!1,size:a=8}){let s=l[e]??l.idle;return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},title:s.label,children:[s.pulse?(0,n.jsx)("span",{className:"dotpulse"}):(0,n.jsx)("span",{style:{width:a,height:a,borderRadius:"50%",background:s.c,display:"inline-block",flex:`0 0 ${a}px`}}),t&&(0,n.jsx)("span",{style:{fontSize:11,color:s.c,fontWeight:600},children:s.label})]})}},958:(e,t,a)=>{"use strict";a.d(t,{OrgCanvas:()=>h});var n=a(5076),l=a(8488),r=a(7814);let s=(0,r.createServerReference)("600d260de15729632d71707ed51e55a2e12884844f",r.callServer,void 0,r.findSourceMapURL,"setReportsToByHandle"),i=(0,r.createServerReference)("70e54c006a264f594d594ab5d1fea8206ac2cf27c8",r.callServer,void 0,r.findSourceMapURL,"saveOrgLayout");var o=a(4552),d=a(8576),c=a(891),u=a(5629);function h({agents:e}){let t=(0,u.k)(),a=(0,l.useMemo)(()=>Object.fromEntries(e.map(e=>[e.handle,e.reportsTo])),[e]),r=(0,l.useMemo)(()=>{let t=e.find(e=>null===a[e.handle])??e[0],n=[];t&&function t(l,r){(n[r]??=[]).push(l),e.filter(e=>a[e.handle]===l).forEach(e=>t(e.handle,r+1))}(t.handle,0);let l={};n.forEach((e,t)=>{let a=184*e.length+(e.length-1)*36;e.forEach((e,n)=>{l[e]={x:40+220*n+Math.max(0,(760-a)/2),y:30+96*t}})});let r=n.length;return e.forEach(e=>{l[e.handle]||(l[e.handle]={x:40,y:30+96*r},r+=1)}),e.forEach(e=>{"number"==typeof e.orgX&&"number"==typeof e.orgY&&(l[e.handle]={x:e.orgX,y:e.orgY})}),l},[e,a]),[p,f]=(0,l.useState)(a),[y,x]=(0,l.useState)(r),[m,g]=(0,l.useState)(null),[v,b]=(0,l.useState)(null),[w,j]=(0,l.useState)(null),S=(0,l.useRef)(null);function k(e){let t=S.current.getBoundingClientRect();return{x:e.clientX-t.left+S.current.scrollLeft,y:e.clientY-t.top+S.current.scrollTop}}async function I(){if(v&&w){let e=v.from;f(t=>({...t,[w]:e})),await s(w,e)}if(m){let e=y[m.handle];e&&i(m.handle,e.x,e.y)}g(null),b(null),j(null)}async function N(e){f(t=>({...t,[e]:null})),await s(e,null)}return(0,n.jsxs)("div",{className:"view",style:{padding:0},children:[(0,n.jsxs)("div",{className:"view-head",style:{padding:"18px 24px 14px"},children:[(0,n.jsx)("div",{className:"vh-icon",children:(0,n.jsx)(d.I,{name:"agents",size:20})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"view-title",children:t("org.title")}),(0,n.jsx)("div",{className:"view-sub",children:t("org.canvas.sub")})]}),(0,n.jsx)("div",{className:"vh-right",children:(0,n.jsxs)("button",{className:"btn-ghost",onClick:function(){f(a),x(r)},children:[(0,n.jsx)(d.I,{name:"refresh",size:13})," ",t("org.resetLayout")]})})]}),(0,n.jsxs)("div",{className:"orgcanvas-wrap",children:[(0,n.jsx)("div",{className:"orgcanvas-bar",children:(0,n.jsxs)("span",{className:"orgcanvas-hint",children:[(0,n.jsx)(d.I,{name:"bot",size:13,style:{color:"var(--accent)"}})," ",t("org.hint.pre")," ",(0,n.jsx)("b",{style:{color:"var(--accent)",margin:"0 3px"},children:"●"})," ",t("org.hint.post")]})}),(0,n.jsxs)("div",{className:"orgcanvas",ref:S,onMouseMove:function(e){if(m){let t=k(e);x(e=>({...e,[m.handle]:{x:t.x-m.dx,y:t.y-m.dy}}))}else if(v){let t=k(e);b(e=>e&&{...e,x:t.x,y:t.y});let a=document.elementFromPoint(e.clientX,e.clientY),n=a&&a.closest("[data-h]");j(n&&n.dataset.h!==v.from?n.dataset.h:null)}},onMouseUp:I,onMouseLeave:I,children:[(0,n.jsxs)("svg",{className:"org-svg",children:[e.map(e=>{let t=p[e.handle],a=t?function(e,t){let a=y[e],n=y[t];if(!a||!n)return null;let{a:l,b:r}=function(e,t){let a=e.x+92,n=e.y+29,l=t.x+92,r=t.y+29,s=l-a,i=r-n;function o(e,t,a,n){return n?t>0?{x:e.x+184,y:e.y+29,nx:1,ny:0}:{x:e.x,y:e.y+29,nx:-1,ny:0}:a>0?{x:e.x+92,y:e.y+58,nx:0,ny:1}:{x:e.x+92,y:e.y,nx:0,ny:-1}}let d=Math.abs(s)>Math.abs(i)+30;return{a:o(e,s,i,d),b:o(t,-s,-i,d)}}(a,n),s=.5*Math.hypot(r.x-l.x,r.y-l.y),i=l.x+l.nx*s,o=l.y+l.ny*s,d=r.x+r.nx*s,c=r.y+r.ny*s;return`M ${l.x} ${l.y} C ${i} ${o}, ${d} ${c}, ${r.x} ${r.y}`}(t,e.handle):null;return a?(0,n.jsx)("path",{d:a},e.handle):null}),v&&(0,n.jsx)("path",{className:"temp",d:`M ${y[v.from].x+92} ${y[v.from].y+58} L ${v.x} ${v.y}`})]}),e.map(e=>{let a=y[e.handle]??{x:0,y:0},l=null===p[e.handle],r=p[e.handle];return(0,n.jsxs)("div",{"data-h":e.handle,className:"org-card"+(l?" ceo":"")+(m&&m.handle===e.handle?" dragging":"")+(w===e.handle?" linktarget":"")+(v&&v.from===e.handle?" linking":""),style:{left:a.x,top:a.y},onMouseDown:t=>(function(e,t){if(e.target.closest(".oc-link"))return;let a=k(e);g({handle:t,dx:a.x-y[t].x,dy:a.y-y[t].y})})(t,e.handle),children:[(0,n.jsx)(o.e,{name:e.name,color:e.color,size:32,health:e.health}),(0,n.jsxs)("div",{style:{minWidth:0},children:[(0,n.jsxs)("div",{className:"oc-name",style:{display:"flex",alignItems:"center",gap:6},children:[e.name," ","idle"!==e.status&&(0,n.jsx)(c.m,{status:e.status})]}),(0,n.jsx)("div",{className:"oc-role",children:e.role})]}),(0,n.jsx)("div",{className:"oc-link",title:t("org.dragOntoSubordinate"),onMouseDown:t=>{var a;let n;return a=e.handle,t.stopPropagation(),void b({from:a,x:(n=k(t)).x,y:n.y})},children:(0,n.jsx)(d.I,{name:"add",size:11})}),r&&(0,n.jsx)("div",{className:"oc-unlink",title:t("org.unlinkFrom",{handle:"@"+r}),onMouseDown:t=>{t.stopPropagation(),N(e.handle)},children:(0,n.jsx)(d.I,{name:"close",size:11})})]},e.handle)})]})]})]})}},1352:(e,t,a)=>{"use strict";a.d(t,{e:()=>l});var n=a(7814);let l=(0,n.createServerReference)("001e9ef8a66d3ec2113043b24ab8849578169f7b7f",n.callServer,void 0,n.findSourceMapURL,"pollUpdateResult")},1870:(e,t,a)=>{"use strict";a.d(t,{l:()=>l});var n=a(7814);let l=(0,n.createServerReference)("40c4dec4c26a6ed0bdf72098c743c4c2cb18ed1cd1",n.callServer,void 0,n.findSourceMapURL,"getUpdateState")},2282:(e,t,a)=>{"use strict";a.d(t,{P:()=>l});var n=a(7814);let l=(0,n.createServerReference)("00a23e99d4e912da3ad1b266a22b1a141df6bc8b94",n.callServer,void 0,n.findSourceMapURL,"runUpdate")},2393:(e,t,a)=>{"use strict";a.d(t,{H4:()=>i,Uy:()=>o,st:()=>s});let n=/Failed to find Server Action|older or newer deployment|ChunkLoadError|Loading chunk [\w-]+ failed|error loading dynamically imported module/i,l=/invariant expected layout router to be mounted/i;function r(e){return e?e instanceof Error?`${e.name} ${e.message}`:"string"==typeof e?e:String(e?.message??e):""}function s(e){return n.test(r(e))}function i(e){let t=r(e);return n.test(t)||l.test(t)}function o(){try{let e="cn-skew-reload-at",t=Number(window.sessionStorage.getItem(e)||0);if(Date.now()-t<2e4)return;window.sessionStorage.setItem(e,String(Date.now()))}catch{}try{let e=new URL(window.location.href);e.searchParams.set("_r",String(Date.now())),window.location.replace(e.toString())}catch{window.location.reload()}}},2444:(e,t,a)=>{"use strict";a.d(t,{UpdateHeaderBadge:()=>h});var n=a(5076),l=a(8488),r=a(9860),s=a(8576),i=a(5629),o=a(1870),d=a(2282),c=a(1352),u=a(2393);function h(){let e=(0,i.k)(),t=(0,r.useRouter)(),[a,h]=(0,l.useState)(null),[p,f]=(0,l.useState)(!1),[y,x]=(0,l.useState)("available"),[m,g]=(0,l.useState)(!1),[v,b]=(0,l.useState)(""),w=(0,l.useRef)(null);async function j(){if(!m){g(!0),b("");try{let t=await (0,o.l)(!0);h(t.info.updateAvailable&&t.info.latest?t.info.latest:null),f(t.busy),t.info.updateAvailable||b(e("chrome.update.upToDate"))}catch{}finally{g(!1)}}}async function S(){if("updating"!==y&&!p){if("done"===y)return void t.refresh();x("updating"),b("");try{let a=await (0,d.P)();if(a.blocked){x("available"),f(!0),b(e("chrome.update.busy"));return}a.started?w.current=setInterval(async()=>{let t=await (0,c.e)().catch(e=>((0,u.st)(e)&&(w.current&&clearInterval(w.current),(0,u.Uy)()),null));t&&("done"===t.status?(w.current&&clearInterval(w.current),window.location.reload()):"error"===t.status&&(w.current&&clearInterval(w.current),x("error"),b(e("chrome.update.failed"))))},3e3):(x("available"),b(a.message||""),t.push("/update"))}catch{x("error"),b(e("chrome.update.failed"))}}}(0,l.useEffect)(()=>{let e=!1,t=async t=>{try{let a=await (0,o.l)(t);if(e)return;h(a.info.updateAvailable&&a.info.latest?a.info.latest:null),f(a.busy)}catch{}};t(!1);let a=setInterval(()=>t(!1),12e3),n=setInterval(()=>t(!0),18e4);return()=>{e=!0,clearInterval(a),clearInterval(n),w.current&&clearInterval(w.current)}},[]);let k=(0,n.jsx)("button",{type:"button",className:"top-btn",onClick:j,disabled:m,title:v||e("chrome.update.check"),children:(0,n.jsx)("span",{className:m?"sync-spin":"",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:17})})});if(!a)return k;let I="updating"===y?e("chrome.update.updating"):"done"===y?e("chrome.update.restart"):"error"===y?e("chrome.update.failed"):p?`v${a}`:`${e("chrome.update.update")} v${a}`,N="updating"===y||p;return(0,n.jsxs)(n.Fragment,{children:[k,(0,n.jsxs)("button",{type:"button",onClick:S,disabled:N,title:p?e("chrome.update.busy"):v||`${e("chrome.update.available")} — v${a}`,style:{display:"inline-flex",alignItems:"center",gap:6,width:"auto",padding:"0 11px",height:30,background:"error"===y?"var(--sx-keyword)":p?"var(--bg-active)":"var(--accent)",color:p?"var(--text-dim)":"var(--accent-fg)",borderRadius:999,fontSize:12,fontWeight:600,border:"none",opacity:"updating"===y?.75:1,cursor:N?"default":"pointer"},children:["updating"===y?(0,n.jsx)("span",{className:"sync-spin",style:{display:"inline-flex"},children:(0,n.jsx)(s.I,{name:"sync",size:14})}):(0,n.jsx)(s.I,{name:"updating"===y?"sync":"done"===y?"refresh":"error"===y?"bell":"arrowUp",size:14}),(0,n.jsx)("span",{children:I})]})]})}},4414:(e,t,a)=>{"use strict";a.d(t,{ChatToggle:()=>s});var n=a(5076),l=a(8576),r=a(5629);function s(){let e=(0,r.k)();return(0,n.jsx)("button",{className:"top-btn",title:`${e("chrome.chat.agentRoom")} (⌘J)`,type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("constella:toggle-chat")),children:(0,n.jsx)(l.I,{name:"chat",size:17})})}},4552:(e,t,a)=>{"use strict";a.d(t,{e:()=>l});var n=a(5076);function l({name:e,color:t,size:a=24,health:r,image:s}){let i=Math.max(6,Math.round(.3*a)),o=Math.round(.28*a),d=s?/^(data:|https?:|\/)/.test(s)?s:`/api/upload?path=${encodeURIComponent(s)}`:null;return(0,n.jsxs)("span",{style:{position:"relative",width:a,height:a,flex:`0 0 ${a}px`,display:"inline-block"},children:[d?(0,n.jsx)("img",{src:d,alt:e,width:a,height:a,style:{width:a,height:a,borderRadius:o,objectFit:"cover",display:"block"}}):(0,n.jsx)("span",{style:{width:a,height:a,borderRadius:o,background:t,color:"#fff",display:"grid",placeItems:"center",fontSize:Math.round(.42*a),fontWeight:700},children:(e[0]||"?").toUpperCase()}),r&&(0,n.jsx)("span",{style:{position:"absolute",right:-1,bottom:-1,width:i,height:i,borderRadius:"50%",background:"alive"===r?"var(--sx-string)":"stale"===r?"var(--sx-number)":"var(--text-faint)",border:"1.5px solid var(--bg-elevated)"}})]})}},4942:(e,t,a)=>{"use strict";a.d(t,{SidebarToggle:()=>i});var n=a(5076),l=a(8488),r=a(8576);let s=`
2
+ body.side-collapsed .side{width:58px!important;flex:0 0 58px!important;}
3
+ body.side-collapsed .side .nav-item{justify-content:center;padding-left:0;padding-right:0;position:relative;}
4
+ body.side-collapsed .side .nav-item>span:not(.nv-badge),
5
+ body.side-collapsed .side .nav-group-label,
6
+ body.side-collapsed .side .nav-search input,
7
+ body.side-collapsed .side .side-foot .pf{display:none!important;}
8
+ body.side-collapsed .side .nav-search{justify-content:center;}
9
+ body.side-collapsed .side .side-brand-wrap{overflow:hidden;}
10
+ body.side-collapsed .side .side-foot{justify-content:center;flex-wrap:wrap;gap:6px;}
11
+ body.side-collapsed .side .nv-badge{position:absolute;top:2px;right:6px;}
12
+ `;function i(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!document.getElementById("side-rail-style")){let e=document.createElement("style");e.id="side-rail-style",e.textContent=s,document.head.appendChild(e)}let e=!1;try{e="1"===localStorage.getItem("bx.sideCollapsed")}catch{}t(e),document.body.classList.toggle("side-collapsed",e)},[]),(0,n.jsx)("button",{className:"top-btn"+(e?" on":""),onClick:function(){t(e=>{let t=!e;document.body.classList.toggle("side-collapsed",t);try{localStorage.setItem("bx.sideCollapsed",t?"1":"0")}catch{}return t})},title:e?"Expand sidebar":"Collapse sidebar","aria-label":"Toggle sidebar",children:(0,n.jsx)(r.I,{name:"sidebarIcon",size:17})})}},6588:(e,t,a)=>{"use strict";a.d(t,{BackButton:()=>i});var n=a(5076),l=a(9860),r=a(8576),s=a(5629);function i(){let e=(0,s.k)(),t=(0,l.useRouter)();return(0,n.jsx)("button",{className:"top-btn",title:e("common.back"),style:{marginRight:2},onClick:()=>{window.history.length>1?t.back():t.push("/")},children:(0,n.jsx)(r.I,{name:"chevronLeft",size:18})})}},9706:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,958)),Promise.resolve().then(a.bind(a,181)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,6824)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444))}},e=>{e.O(0,[9219,3219,6836,6646,6834,7358],()=>e(e.s=9706)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2792],{4774:(e,s,a)=>{Promise.resolve().then(a.t.bind(a,3283,23)),Promise.resolve().then(a.bind(a,5890)),Promise.resolve().then(a.bind(a,181)),Promise.resolve().then(a.bind(a,6588)),Promise.resolve().then(a.bind(a,4414)),Promise.resolve().then(a.bind(a,6824)),Promise.resolve().then(a.bind(a,4942)),Promise.resolve().then(a.bind(a,2444)),Promise.resolve().then(a.bind(a,5787))},5126:(e,s,a)=>{"use strict";a.d(s,{T:()=>n});var r=a(7814);let n=(0,r.createServerReference)("40f7fd7992a8b9392597609349e63fb2460027c08a",r.callServer,void 0,r.findSourceMapURL,"setActiveOrg")},5890:(e,s,a)=>{"use strict";a.d(s,{OrgActions:()=>u,WorkspaceMetaForm:()=>h});var r=a(5076),n=a(8488),t=a(9860),c=a(8576),i=a(7814);let l=(0,i.createServerReference)("606af24aba1c9b79ec8a417abc29b49313f2de6b86",i.callServer,void 0,i.findSourceMapURL,"renameOrg");var o=a(5126);let d=(0,i.createServerReference)("6095694ef9c93f4af4573c8b78ab38c64e22c7215f",i.callServer,void 0,i.findSourceMapURL,"archiveOrg"),m=(0,i.createServerReference)("40f7b5622fafa7f742d8cc68158fcbfd9b1ce99871",i.callServer,void 0,i.findSourceMapURL,"deleteOrg"),b=(0,i.createServerReference)("60736041a12fa374b1b47fa833b667d9d2d0997de2",i.callServer,void 0,i.findSourceMapURL,"editWorkspaceMeta");var v=a(5629);function u({orgId:e,name:s,archived:a,active:i}){let b=(0,v.k)(),[h,f]=(0,n.useTransition)(),[g,x]=(0,n.useState)(!1),[j,p]=(0,n.useState)(s),[S,k]=(0,n.useState)(!1),N=(0,t.useRouter)();return(0,r.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{className:"form-input mono",value:j,onChange:e=>p(e.target.value),style:{width:180,height:28},autoFocus:!0}),(0,r.jsxs)("button",{className:"sc2-btn",disabled:h,onClick:()=>f(async()=>{await l(e,j),x(!1)}),children:[(0,r.jsx)(c.I,{name:"check",size:11})," ",b("common.save")]}),(0,r.jsx)("button",{className:"sc2-btn",onClick:()=>{p(s),x(!1)},children:b("common.cancel")})]}):(0,r.jsxs)(r.Fragment,{children:[!i&&(0,r.jsxs)("button",{className:"btn-accent",disabled:h,onClick:()=>f(async()=>{await (0,o.T)(e),N.push("/")}),children:[(0,r.jsx)(c.I,{name:"goto",size:12})," ",b("org.open")]}),i&&(0,r.jsx)("span",{className:"pill",style:{background:"var(--sx-string)22",color:"var(--sx-string)"},children:b("org.active")}),(0,r.jsxs)("button",{className:"sc2-btn",onClick:()=>x(!0),children:[(0,r.jsx)(c.I,{name:"command",size:11})," ",b("org.rename")]}),(0,r.jsxs)("button",{className:"sc2-btn",disabled:h,onClick:()=>f(()=>d(e,!a)),children:[(0,r.jsx)(c.I,{name:a?"refresh":"inbox",size:11})," ",b(a?"org.restore":"org.archive")]}),S?(0,r.jsxs)("button",{className:"sc2-btn danger",disabled:h,onClick:()=>f(async()=>{await m(e),N.refresh()}),children:[(0,r.jsx)(c.I,{name:"trash",size:11})," ",b("org.confirmDelete")]}):(0,r.jsxs)("button",{className:"sc2-btn danger",onClick:()=>k(!0),children:[(0,r.jsx)(c.I,{name:"trash",size:11})," ",b("common.delete")]})]})})}function h({mission:e,objective:s}){let a=(0,v.k)(),[t,i]=(0,n.useState)(e),[l,o]=(0,n.useState)(s),[d,m]=(0,n.useState)(!1),[u,f]=(0,n.useTransition)();return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"form-label",children:a("org.mission")}),(0,r.jsx)("textarea",{className:"persona-ta",value:t,onChange:e=>{i(e.target.value),m(!1)}}),(0,r.jsx)("label",{className:"form-label",style:{marginTop:10},children:a("org.objective")}),(0,r.jsx)("textarea",{className:"persona-ta",value:l,onChange:e=>{o(e.target.value),m(!1)}}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:10},children:[(0,r.jsxs)("button",{className:"btn-accent",disabled:u,onClick:()=>f(async()=>{await b(t,l),m(!0)}),children:[(0,r.jsx)(c.I,{name:"check",size:13})," ",a(u?"common.saving":"common.save")]}),d&&(0,r.jsx)("span",{className:"muted",style:{fontSize:12},children:a("org.savedNote")})]})]})}}},e=>{e.O(0,[9219,3219,6836,8370,6646,6834,7358],()=>e(e.s=4774)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9415],{640:(e,t,s)=>{"use strict";s.d(t,{HomeSeedBlocks:()=>m});var a=s(5076),n=s(8488),r=s(9860),c=s(3283),i=s.n(c),l=s(5629),o=s(8576),d=s(1801);function m(){let e=(0,l.k)(),t=(0,r.useRouter)(),[s,c]=(0,n.useTransition)();return(0,a.jsxs)("div",{className:"home-empty",children:[(0,a.jsx)("div",{children:e("home.canonical.empty")}),(0,a.jsxs)("div",{className:"hse-actions",children:[(0,a.jsxs)("button",{className:"hse-create",disabled:s,onClick:()=>c(async()=>{await (0,d.V)(),t.refresh()}),children:[(0,a.jsx)(o.I,{name:"add",size:13})," ",e(s?"home.creating":"home.createBlocks")]}),(0,a.jsxs)(i(),{href:"/knowledge",className:"hse-link",children:[e("home.openKnowledge")," →"]})]})]})}},878:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,3283,23)),Promise.resolve().then(s.bind(s,4329)),Promise.resolve().then(s.bind(s,8036)),Promise.resolve().then(s.bind(s,8126)),Promise.resolve().then(s.bind(s,640)),Promise.resolve().then(s.bind(s,8679)),Promise.resolve().then(s.bind(s,5183)),Promise.resolve().then(s.bind(s,181)),Promise.resolve().then(s.bind(s,6588)),Promise.resolve().then(s.bind(s,4414)),Promise.resolve().then(s.bind(s,6824)),Promise.resolve().then(s.bind(s,4942)),Promise.resolve().then(s.bind(s,2444)),Promise.resolve().then(s.bind(s,5787))},1281:(e,t,s)=>{"use strict";s.d(t,{P:()=>n});var a=s(7814);let n=(0,a.createServerReference)("00d707af504f1a0491ca9dcf763ef015da594b49f3",a.callServer,void 0,a.findSourceMapURL,"approvePlan")},1346:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var a=s(7814);let n=(0,a.createServerReference)("60075bc55b6118caa430a2acc1eba87814559b821c",a.callServer,void 0,a.findSourceMapURL,"resolveInbox")},1709:(e,t,s)=>{"use strict";s.d(t,{B:()=>n});var a=s(7814);let n=(0,a.createServerReference)("40ced2f71e662e1884c830a2cb80626a57aa8be42c",a.callServer,void 0,a.findSourceMapURL,"approveSpec")},2799:(e,t,s)=>{"use strict";function a(e){if(!e)return"";let t=Math.max(0,Math.floor((Date.now()-("number"==typeof e?e*(e<1e12?1e3:1):e.getTime()))/1e3));if(t<60)return"now";let s=Math.floor(t/60);if(s<60)return s+"m";let a=Math.floor(s/60);if(a<24)return a+"h";let n=Math.floor(a/24);return n<7?n+"d":Math.floor(n/7)+"w"}s.d(t,{f:()=>a})},3371:(e,t,s)=>{"use strict";s.d(t,{J:()=>n});var a=s(7814);let n=(0,a.createServerReference)("40e8f30a047d0f241003dcbb3194b872639e110c96",a.callServer,void 0,a.findSourceMapURL,"rejectSpec")},4329:(e,t,s)=>{"use strict";s.d(t,{HomeActivity:()=>i});var a=s(5076),n=s(5629),r=s(4552),c=s(2799);function i({rows:e}){let t=(0,n.k)();if(0===e.length)return(0,a.jsx)("div",{className:"home-empty",children:t("home.recentEmpty")});let s=[],l="";for(let a of e){let e=a.at?new Date(a.at):null,n=e?e.toDateString():"—";n!==l&&(s.push({label:e?function(e){let s=new Date;s.setHours(0,0,0,0);let a=new Date(e);a.setHours(0,0,0,0);let n=Math.round((s.getTime()-a.getTime())/864e5);return n<=0?t("home.activity.today"):1===n?t("home.activity.yesterday"):a.toLocaleDateString()}(e):"—",rows:[]}),l=n),s[s.length-1].rows.push(a)}return(0,a.jsx)("div",{className:"timeline",children:s.map((e,s)=>(0,a.jsxs)("div",{className:"tl-day",children:[(0,a.jsx)("div",{className:"tl-day-label",children:e.label}),e.rows.map(e=>(0,a.jsxs)("div",{className:"tl-row",title:e.target,children:[e.agentName?(0,a.jsx)(r.e,{name:e.agentName,color:e.agentColor??"var(--accent)",size:20,health:e.agentHealth}):(0,a.jsx)("span",{className:"tl-sys"}),(0,a.jsxs)("span",{className:"tl-text",children:[(0,a.jsx)("b",{children:e.agentName??t("home.activity.system")})," ",e.action," ",(0,a.jsx)("span",{className:"tl-target",children:e.target})]}),(0,a.jsx)("span",{className:"tl-time",children:e.at?(0,c.f)(new Date(e.at)):""})]},e.id))]},s))})}},4541:(e,t,s)=>{"use strict";s.d(t,{d:()=>n});var a=s(7814);let n=(0,a.createServerReference)("40beac2559eab1128341c145e31826c3b57f094595",a.callServer,void 0,a.findSourceMapURL,"rejectIssue")},5183:(e,t,s)=>{"use strict";s.d(t,{WelcomeChat:()=>w});var a=s(5076),n=s(8488),r=s(9860),c=s(616),i=s(8551),l=s(2140),o=s(9289),d=s(4305),m=s(3653),h=s(9768),u=s(4772),f=s(1139),p=s(5629),v=s(8576),x=s(4552),b=s(8163),j=s(8306),g=s(3286);function w({agents:e,operator:t}){let s=(0,p.k)(),N=(0,r.useRouter)(),[y,k]=(0,n.useState)("room"),[S,C]=(0,n.useState)([]),[I,R]=(0,n.useState)([]),[z,T]=(0,n.useState)([]),[M,E]=(0,n.useState)(!0),[P,L]=(0,n.useState)(!1),[H,W]=(0,n.useState)(!1),[D,A]=(0,n.useState)(null),[q,O]=(0,n.useState)(!1),[U,_]=(0,n.useState)({}),[B,V]=(0,n.useState)(null),[$,F]=(0,n.useTransition)(),G=(0,n.useRef)(0),J=(0,n.useRef)(0),K=(0,n.useRef)(null),Q=Object.fromEntries(e.map(e=>[e.handle,e])),Z=y.startsWith("dm:"),X="people"===y,Y="telegram"===y,ee=Z?y.slice(3):null,et=ee?Q[ee]:null,es=Z?y:Y?"telegram":"room";async function ea(){try{let e=await (0,u.p)(es);if(e.used>=e.max&&!q){O(!0);try{await (0,f.L)(es),e=await (0,u.p)(es)}finally{O(!1)}}A(e)}catch{}}async function en(){if(!q){O(!0);try{await (0,f.L)(es),await ea()}finally{O(!1)}}}(0,n.useEffect)(()=>{if(X)return;let e=!1;function t(){if(e||document.hidden||K.current)return;let t=new EventSource(`/api/stream?channel=${encodeURIComponent(es)}&evCursor=${J.current}&msgCursor=${G.current}`);K.current=t,t.addEventListener("msg",e=>{let t=JSON.parse(e.data),s=t.createdAt?new Date(t.createdAt).getTime():0;if(s>G.current&&(G.current=s),"cleared"===t.kind){C([t]),R([]),T([]);return}C(e=>e.some(e=>e.id===t.id)?e:[...e,t].slice(-200)),R(e=>e.filter(e=>e.runId!==t.id||"text"!==e.kind)),t.fromHandle&&T(e=>e.filter(e=>e!==t.fromHandle))}),t.addEventListener("ev",e=>{let t=JSON.parse(e.data);t.seq>J.current&&(J.current=t.seq),R(e=>e.some(e=>e.id===t.id)?e:[...e,t].slice(-250))})}function s(){K.current&&(K.current.close(),K.current=null)}C([]),R([]),G.current=0,J.current=0,E(!0),(async()=>{try{let[t,s]=await Promise.all([(0,c.V)(es),(0,m.k)(es,0)]);if(e)return;C(t.slice(-200)),R(s),G.current=t.reduce((e,t)=>Math.max(e,t.createdAt?new Date(t.createdAt).getTime():0),0),J.current=s.reduce((e,t)=>Math.max(e,t.seq),0)}catch{}!e&&(E(!1),document.hidden||t())})();let a=()=>{document.hidden?s():t()};return document.addEventListener("visibilitychange",a),()=>{e=!0,document.removeEventListener("visibilitychange",a),s()}},[y]),(0,n.useEffect)(()=>{(0,i.b)().then(e=>_(e)).catch(()=>{})},[y]),(0,n.useEffect)(()=>{Y&&(0,h.G)().then(V).catch(()=>V({connected:!1}))},[y]),(0,n.useEffect)(()=>{X?A(null):ea()},[y,S.length]),(0,n.useEffect)(()=>{function e(){k("room"),setTimeout(()=>document.querySelector(".welcome-chat .composer-input")?.focus(),60)}return window.addEventListener("constella:focus-cmdbar",e),()=>window.removeEventListener("constella:focus-cmdbar",e)},[]);let er={};for(let e of I)(er[e.runId]??=[]).push(e);let ec=new Set(S.map(e=>e.id)),ei=Object.entries(er).filter(([e])=>!ec.has(e));function el(e,t){let s=e.trim();if(!s&&!t?.length)return;let a="room"!==es||!s||s.startsWith("/")||s.startsWith("@")?s:"/kb "+s;F(async()=>{try{let{responders:e}=await (0,l._)(es,a,t);if(e.length){for(let t of(T(e),e))await (0,o.n)(es,t),T(e=>e.filter(e=>e!==t));T([])}Z&&(0,i.b)().then(e=>_(e)).catch(()=>{})}catch{}})}let eo=Z&&et?`${s("home.chat.message")} ${et.name}…`:Y?"Telegram \xb7 @ada (CEO)…":s("home.cmd.placeholder");return(0,a.jsxs)("section",{className:"welcome-chat"+(P?" full":""),children:[(0,a.jsxs)("div",{className:"wc-head",children:[(0,a.jsxs)("div",{className:"wc-head-titles",children:[(0,a.jsxs)("span",{className:"wc-head-title",children:[(0,a.jsx)(v.I,{name:"chat",size:15})," ",s("home.chat.title")]}),(0,a.jsx)("span",{className:"wc-head-sub",children:s("home.chat.sub")})]}),(0,a.jsxs)("div",{className:"wc-head-actions",children:[(0,a.jsx)("button",{className:"wc-head-btn",title:s("home.openKnowledge"),onClick:()=>N.push("/knowledge"),children:(0,a.jsx)(v.I,{name:"branch",size:14})}),(0,a.jsx)("button",{className:"wc-head-btn",title:s("home.chat.fullscreen"),onClick:()=>L(e=>!e),children:(0,a.jsx)(v.I,{name:P?"close":"goto",size:14})}),(0,a.jsx)("button",{className:"wc-head-btn",title:s("home.chat.clear"),onClick:()=>W(!0),children:(0,a.jsx)(v.I,{name:"trash",size:14})})]})]}),(0,a.jsxs)("div",{className:"dock-tabs",children:[(0,a.jsxs)("button",{className:"dock-tab"+(Z||X||Y?"":" on"),onClick:()=>k("room"),children:[(0,a.jsx)(v.I,{name:"agents",size:14})," ",s("home.chat.tab.room")]}),(0,a.jsxs)("button",{className:"dock-tab"+(X||Z?" on":""),onClick:()=>k("people"),children:[(0,a.jsx)(v.I,{name:"chat",size:14})," ",s("home.chat.tab.direct")]}),(0,a.jsxs)("button",{className:"dock-tab"+(Y?" on":""),onClick:()=>k("telegram"),children:[(0,a.jsx)(v.I,{name:"send",size:14})," Telegram"]})]}),!X&&!(Y&&B&&!B.connected)&&(0,a.jsxs)("div",{className:"ctx-bar",children:[D?(0,a.jsx)(b.m,{stat:D,onCompact:en,compacting:q}):(0,a.jsx)("span",{}),Y?(0,a.jsxs)("span",{className:"ctx-hint",children:[(0,a.jsx)(v.I,{name:"bot",size:12})," ",s("home.chat.tgHint")," \xb7 @ada (CEO)"]}):(0,a.jsxs)("span",{className:"ctx-hint",children:[(0,a.jsx)(v.I,{name:"bot",size:12})," ",s("home.chat.dmAda")]})]}),Z&&et?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"chat-header dm",children:[(0,a.jsx)("button",{className:"dm-back-btn",onClick:()=>k("people"),children:(0,a.jsx)(v.I,{name:"chevronLeft",size:14})}),(0,a.jsx)(x.e,{name:et.name,color:et.color,image:et.image,size:30,health:et.health}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"chat-title",children:[et.name," ",(0,a.jsxs)("span",{className:"agent-handle",children:["@",et.handle]})]}),(0,a.jsxs)("div",{className:"chat-sub",children:[et.role," \xb7 ",et.adapter]})]}),(0,a.jsx)("span",{style:{marginLeft:"auto"},children:(0,a.jsx)(g.qs,{status:et.status})})]}),(0,a.jsx)(g.H8,{msgs:S,typing:z,agents:e,byRun:er,liveRuns:ei,loading:M,operator:t,markdownAgent:!0,avatarSize:40}),(0,a.jsx)(g.V4,{onSend:el,agents:e,requireMention:!1,placeholder:eo})]}):X?(0,a.jsx)(j.QE,{agents:e,previews:U,onOpenDM:e=>k("dm:"+e)}):Y?B&&!B.connected?(0,a.jsx)(j.CZ,{onConnected:()=>(0,h.G)().then(V).catch(()=>{})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.H8,{msgs:S,typing:z,agents:e,byRun:er,liveRuns:ei,loading:M||!B,operator:t,markdownAgent:!0,avatarSize:40}),(0,a.jsx)(g.V4,{onSend:el,agents:e,requireMention:!1,placeholder:eo})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.H8,{msgs:S,typing:z,agents:e,byRun:er,liveRuns:ei,loading:M,operator:t,markdownAgent:!0,avatarSize:40,emptyHint:s("home.chat.intro")}),(0,a.jsx)(g.V4,{onSend:el,agents:e,requireMention:!1,placeholder:eo})]}),H&&(0,a.jsx)("div",{className:"modal-overlay",onMouseDown:()=>W(!1),children:(0,a.jsxs)("div",{className:"modal",style:{width:440,maxWidth:"92vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"modal-head",children:(0,a.jsxs)("div",{className:"modal-title",children:[(0,a.jsx)(v.I,{name:"trash",size:15,style:{color:"var(--sx-keyword)"}})," ",s("home.chat.clear")]})}),(0,a.jsx)("div",{className:"modal-body",children:(0,a.jsx)("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6},children:s("home.chat.clearConsequences")})}),(0,a.jsxs)("div",{className:"modal-foot",children:[(0,a.jsx)("button",{className:"btn-ghost",onClick:()=>W(!1),children:s("block.cancel")}),(0,a.jsx)("button",{className:"btn-accent",style:{background:"var(--sx-keyword)",borderColor:"var(--sx-keyword)",color:"#fff"},disabled:$,onClick:function(){W(!1),F(async()=>{await (0,d.H)(es).catch(()=>{}),C([]),R([]),T([]),await ea()})},children:s("home.chat.clear")})]})]})})]})}},5949:(e,t,s)=>{"use strict";s.d(t,{G:()=>n});var a=s(7814);let n=(0,a.createServerReference)("402d4d51b2fedd60f6206531e45066dc999aaa3915",a.callServer,void 0,a.findSourceMapURL,"startNewWork")},7181:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var a=s(7814);let n=(0,a.createServerReference)("402fdcfeddf17de5709d551eccb08d8356339ea521",a.callServer,void 0,a.findSourceMapURL,"setRunMode")},8036:(e,t,s)=>{"use strict";s.d(t,{HomeHeroActions:()=>o});var a=s(5076),n=s(8488),r=s(9860),c=s(5629),i=s(8576),l=s(5949);function o({adaHandle:e,continueHref:t}){let s=(0,c.k)(),d=(0,r.useRouter)(),[m,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)(""),[p,v]=(0,n.useState)(""),[x,b]=(0,n.useState)(""),[j,g]=(0,n.useTransition)();return(0,a.jsxs)("div",{className:"home-actions",children:[(0,a.jsxs)("button",{className:"ha-primary",onClick:()=>window.dispatchEvent(new CustomEvent("constella:focus-cmdbar")),children:[(0,a.jsx)(i.I,{name:"branch",size:15})," ",s("home.act.askKb")]}),e&&(0,a.jsxs)("button",{className:"ha-ghost",onClick:()=>h(!0),children:[(0,a.jsx)(i.I,{name:"command",size:15})," ",s("home.act.newWork")]}),t&&(0,a.jsxs)("button",{className:"ha-ghost",onClick:()=>d.push(t),children:[(0,a.jsx)(i.I,{name:"goto",size:15})," ",s("home.act.continue")]}),(0,a.jsxs)("button",{className:"ha-ghost",onClick:()=>d.push("/inbox"),children:[(0,a.jsx)(i.I,{name:"inbox",size:15})," ",s("home.act.pending")]}),m&&(0,a.jsx)("div",{className:"modal-overlay",onMouseDown:()=>!j&&h(!1),children:(0,a.jsxs)("div",{className:"modal",style:{padding:"20px 22px",width:480,maxWidth:"94vw"},onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{style:{fontSize:15,fontWeight:800,marginBottom:4},children:s("planner.newWork.title")}),(0,a.jsx)("div",{style:{fontSize:12,color:"var(--text-dim)",marginBottom:12},children:s("planner.newWork.desc")}),(0,a.jsx)("label",{className:"form-label",children:s("planner.newWork.titleLabel")}),(0,a.jsx)("input",{className:"form-input",autoFocus:!0,value:u,onChange:e=>f(e.target.value),placeholder:s("planner.newWork.titlePh")}),(0,a.jsx)("label",{className:"form-label",children:s("planner.newWork.briefLabel")}),(0,a.jsx)("textarea",{className:"form-input",rows:5,value:p,onChange:e=>v(e.target.value),placeholder:s("planner.newWork.briefPh")}),x&&(0,a.jsx)("div",{style:{color:"#e8688f",fontSize:12,marginTop:8},children:x}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[(0,a.jsx)("button",{className:"btn-ghost",disabled:j,onClick:()=>h(!1),children:s("common.cancel")}),(0,a.jsx)("button",{className:"btn-accent",disabled:j||!p.trim(),onClick:function(){b(""),g(async()=>{let e=await (0,l.G)({title:u.trim()||void 0,brief:p});e.ok?(h(!1),f(""),v(""),d.push("/planner")):b(e.error??s("planner.newWork.failed"))})},children:j?s("planner.newWork.planning"):s("planner.newWork.create")})]})]})})]})}},8126:(e,t,s)=>{"use strict";s.d(t,{HomeInbox:()=>v});var a=s(5076),n=s(8488),r=s(9860),c=s(5629),i=s(8576),l=s(1346),o=s(1281),d=s(1709),m=s(8941),h=s(3371),u=s(4541),f=s(2799);let p={approval:"check",budget:"coins",question:"chat",review:"doc",block:"close",validation:"pulse"};function v({items:e}){let t=(0,c.k)(),s=(0,r.useRouter)(),[x,b]=(0,n.useTransition)(),[j,g]=(0,n.useState)(null);function w(e,t){g(e),b(async()=>{try{await t()}catch{}finally{await (0,l.b)(e,!0),g(null),s.refresh()}})}return 0===e.length?(0,a.jsx)("div",{className:"home-empty",children:t("home.decisions.empty")}):(0,a.jsx)("div",{className:"decide-list",children:e.map(e=>{let n=x&&j===e.id;return(0,a.jsxs)("div",{className:"decide-row",children:[(0,a.jsx)("div",{className:"dr-ico",children:(0,a.jsx)(i.I,{name:p[e.kind]??"bell",size:15})}),(0,a.jsxs)("div",{className:"dr-main",children:[(0,a.jsx)("div",{className:"dr-title",children:e.title}),e.detail?(0,a.jsx)("div",{className:"dr-reason",children:e.detail}):null,(0,a.jsxs)("div",{className:"dr-sub",children:[e.refType?(0,a.jsx)("span",{className:"dr-ref",children:e.refType}):null,(0,a.jsxs)("span",{children:[t("home.decisions.kind."+e.kind),e.fromName?" \xb7 "+e.fromName:"",e.createdAt?" \xb7 "+(0,f.f)(new Date(e.createdAt)):""]})]})]}),(0,a.jsxs)("div",{className:"dr-actions",children:[("plan"===e.refType||("spec"===e.refType||"issue"===e.refType)&&!!e.refId)&&(0,a.jsx)("button",{className:"dr-approve",disabled:n,onClick:()=>"plan"===e.refType?w(e.id,()=>(0,o.P)()):"spec"===e.refType&&e.refId?w(e.id,()=>(0,d.B)(e.refId)):"issue"===e.refType&&e.refId?w(e.id,()=>(0,m.t)(e.refId)):void s.push("/inbox"),children:t("home.decisions.approve")}),("spec"===e.refType||"issue"===e.refType)&&!!e.refId&&(0,a.jsx)("button",{className:"dr-reject",disabled:n,onClick:()=>"spec"===e.refType&&e.refId?w(e.id,()=>(0,h.J)(e.refId)):"issue"===e.refType&&e.refId?w(e.id,()=>(0,u.d)(e.refId)):w(e.id,async()=>{}),children:t("home.decisions.reject")}),(0,a.jsx)("button",{className:"dr-ghost",onClick:()=>s.push("/inbox"),title:t("home.decisions.details"),children:(0,a.jsx)(i.I,{name:"goto",size:13})}),(0,a.jsx)("button",{className:"dr-ghost",onClick:()=>window.dispatchEvent(new CustomEvent("constella:focus-cmdbar")),title:t("home.decisions.askKb"),children:(0,a.jsx)(i.I,{name:"branch",size:13})})]})]},e.id)})})}},8679:(e,t,s)=>{"use strict";s.d(t,{HomeStatusChip:()=>o});var a=s(5076),n=s(8488),r=s(9860),c=s(5629),i=s(7181),l=s(8576);function o({running:e,activeAgents:t}){let s=(0,c.k)(),d=(0,r.useRouter)(),[m,h]=(0,n.useTransition)();return e?(0,a.jsxs)("span",{className:"home-status-chip running",children:[(0,a.jsx)("span",{className:"hsc-dot"})," ",s("home.statusRunning",{n:t})]}):(0,a.jsxs)("button",{className:"home-status-chip idle",onClick:function(){h(async()=>{await (0,i.D)("start"),d.refresh()})},disabled:m,title:s("home.startHint"),children:[(0,a.jsx)("span",{className:"hsc-dot off"})," ",(0,a.jsx)(l.I,{name:"play",size:12})," ",s(m?"home.starting":"home.startAgents")]})}},8941:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var a=s(7814);let n=(0,a.createServerReference)("4023169ed85000187a7267198eab5e95902c9af1b9",a.callServer,void 0,a.findSourceMapURL,"approveIssue")}},e=>{e.O(0,[9219,9690,3219,6836,8370,2831,8306,6646,6834,7358],()=>e(e.s=878)),_N_E=e.O()}]);