@wrongstack/webui 1.0.9 → 1.0.11

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 (340) hide show
  1. package/dist/assets/AgentRosterView-BzVZjThP.js +12 -0
  2. package/dist/assets/AgentRosterView-Cv9-DYty.css +1 -0
  3. package/dist/assets/{AnalyticsDashboard-fPe6DYsh.js → AnalyticsDashboard-BT_KhdxY.js} +1 -1
  4. package/dist/assets/AudienceMemoryPanel-CdGaL5ob.js +3 -0
  5. package/dist/assets/ChangesView-BbNRQjPu.js +1 -0
  6. package/dist/assets/{ChimeraReviewsView-BQe81cSZ.js → ChimeraReviewsView-DdLrY1rA.js} +1 -1
  7. package/dist/assets/ChronicleDashboard-CXAqB0-c.js +1 -0
  8. package/dist/assets/CodeEditor-BRVibv3L.js +2 -0
  9. package/dist/assets/CodeMap-BVSuBKUK.js +1 -0
  10. package/dist/assets/{CronJobsPanel-C30TtTM7.js → CronJobsPanel-DO8KnHyT.js} +1 -1
  11. package/dist/assets/DeadCodeScanPanel-ByhAW_bl.js +2 -0
  12. package/dist/assets/{DebugDashboard-jJxP9Qek.js → DebugDashboard-nitOcTHq.js} +1 -1
  13. package/dist/assets/DesignGalleryView-DhavCall.js +1 -0
  14. package/dist/assets/GoalView-CCdMVcp4.js +1 -0
  15. package/dist/assets/KanbanView-PzDm4bt2.js +3 -0
  16. package/dist/assets/MailboxDetailView-DAljvmny.js +1 -0
  17. package/dist/assets/MemoryDrawer-IMvyNAhc.js +1 -0
  18. package/dist/assets/MemoryManager-BtC4dOvO.js +1 -0
  19. package/dist/assets/{ProcessMonitor-Bvgcuk_7.js → ProcessMonitor-C39U4XNb.js} +1 -1
  20. package/dist/assets/{PromptJournalView-BUgpBI3V.js → PromptJournalView-CdC4ldrv.js} +1 -1
  21. package/dist/assets/ProviderTestView-CSNA3lH_.js +1 -0
  22. package/dist/assets/QueuePanel-D7TXqgFW.js +1 -0
  23. package/dist/assets/{RefreshDebugView-CCk1X8Hz.js → RefreshDebugView-Dbq_bHwj.js} +1 -1
  24. package/dist/assets/RepositoryHistoryView-yhAMRjpk.js +2 -0
  25. package/dist/assets/{RequirementIntakeView-ByVm-u0p.js → RequirementIntakeView-Dhp5_d6J.js} +1 -1
  26. package/dist/assets/SageTabs-BlLy8Phu.js +2 -0
  27. package/dist/assets/SddFlowGraph-BZkvlaQ1.js +1 -0
  28. package/dist/assets/SddHub-KdxihXZy.js +2 -0
  29. package/dist/assets/SessionInspectView-kKzWEPpe.js +1 -0
  30. package/dist/assets/SessionList-DjDxENAu.js +1 -0
  31. package/dist/assets/SessionsDashboard-CGCCMceU.js +1 -0
  32. package/dist/assets/SetupScreen-D70VCq7r.js +1 -0
  33. package/dist/assets/SkillDetailView-Dp2kWAQb.js +3 -0
  34. package/dist/assets/TechStackView-DYdZrkkA.js +2 -0
  35. package/dist/assets/TerminalPanel-B9Ka6hvR.js +1 -0
  36. package/dist/assets/{activity-pDZp_UqI.js → activity-B-GYDVn2.js} +2 -2
  37. package/dist/assets/{activity-BGw29FDK.js → activity-BWPWyp3o.js} +5 -5
  38. package/dist/assets/{activity-D8n7MaKo.js → activity-BazcMhZZ.js} +2 -2
  39. package/dist/assets/{activity-CbWiifO9.js → activity-Bk7N_ZW5.js} +5 -5
  40. package/dist/assets/{activity-S9f20P0d.js → activity-Cmq0z33p.js} +2 -2
  41. package/dist/assets/{activity-DYH5K2cA.js → activity-DBsMiPsa.js} +2 -2
  42. package/dist/assets/{activity-DdvIZYux.js → activity-VTOCX_jm.js} +2 -2
  43. package/dist/assets/atkinson-hyperlegible-next-latin-ext-wght-normal-C6vrW8VD.woff2 +0 -0
  44. package/dist/assets/atkinson-hyperlegible-next-latin-wght-normal-BcXVPD7q.woff2 +0 -0
  45. package/dist/assets/button-9ewV4TF3.js +1 -0
  46. package/dist/assets/cascadia-code-arabic-wght-normal-BxRhwSzF.woff2 +0 -0
  47. package/dist/assets/cascadia-code-braille-wght-normal-Cj7wfYns.woff2 +0 -0
  48. package/dist/assets/cascadia-code-cyrillic-ext-wght-normal-Bq2rGQtZ.woff2 +0 -0
  49. package/dist/assets/cascadia-code-cyrillic-wght-normal-DC72kP-V.woff2 +0 -0
  50. package/dist/assets/cascadia-code-greek-wght-normal-DmKacV-0.woff2 +0 -0
  51. package/dist/assets/cascadia-code-hebrew-wght-normal-CYieC9BD.woff2 +0 -0
  52. package/dist/assets/cascadia-code-latin-ext-wght-normal-CeKCfnVW.woff2 +0 -0
  53. package/dist/assets/cascadia-code-latin-wght-normal-CCwG33-X.woff2 +0 -0
  54. package/dist/assets/cascadia-code-symbols2-wght-normal-o0G5EPJ1.woff2 +0 -0
  55. package/dist/assets/cascadia-code-vietnamese-wght-normal-DXbdGs8p.woff2 +0 -0
  56. package/dist/assets/{chat-store-DpI9nO_z.js → chat-store-DNRce6sE.js} +1 -1
  57. package/dist/assets/{codemap-activity-store-5hcdmofR.js → codemap-activity-store-Ha7XbGgq.js} +1 -1
  58. package/dist/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
  59. package/dist/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
  60. package/dist/assets/commit-mono-latin-600-normal-BuQDXT0M.woff +0 -0
  61. package/dist/assets/commit-mono-latin-600-normal-SwgSWHaV.woff2 +0 -0
  62. package/dist/assets/commit-mono-latin-700-normal-1-GU0IUE.woff +0 -0
  63. package/dist/assets/commit-mono-latin-700-normal-DU8mrtj2.woff2 +0 -0
  64. package/dist/assets/config-store-BAUadwHd.js +22 -0
  65. package/dist/assets/dialog-C7EIBM_2.js +1 -0
  66. package/dist/assets/dm-sans-latin-ext-wght-normal-BOFOeGcA.woff2 +0 -0
  67. package/dist/assets/dm-sans-latin-wght-normal-Xz1IZZA0.woff2 +0 -0
  68. package/dist/assets/{empty-state-Dl66htl_.js → empty-state-5YP1rmE6.js} +1 -1
  69. package/dist/assets/figtree-latin-ext-wght-normal-DCwSJGxG.woff2 +0 -0
  70. package/dist/assets/figtree-latin-wght-normal-D_ZTVpCC.woff2 +0 -0
  71. package/dist/assets/fira-code-cyrillic-ext-wght-normal-DhYMMuQd.woff2 +0 -0
  72. package/dist/assets/fira-code-cyrillic-wght-normal-Y3u8pIsh.woff2 +0 -0
  73. package/dist/assets/fira-code-greek-ext-wght-normal-wWus70Ix.woff2 +0 -0
  74. package/dist/assets/fira-code-greek-wght-normal-B2SviObF.woff2 +0 -0
  75. package/dist/assets/fira-code-latin-ext-wght-normal-Dvfvaomy.woff2 +0 -0
  76. package/dist/assets/fira-code-latin-wght-normal-CHoedHDv.woff2 +0 -0
  77. package/dist/assets/fira-code-symbols2-wght-normal-CE6EOz_n.woff2 +0 -0
  78. package/dist/assets/fonts-DRGbd-AM.js +2 -0
  79. package/dist/assets/fraunces-latin-ext-wght-normal-Ca2vKHc0.woff2 +0 -0
  80. package/dist/assets/fraunces-latin-wght-normal-ukD16Tqj.woff2 +0 -0
  81. package/dist/assets/fraunces-vietnamese-wght-normal-CnvboYUG.woff2 +0 -0
  82. package/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  83. package/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  84. package/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  85. package/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  86. package/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  87. package/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  88. package/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  89. package/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  90. package/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  91. package/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  92. package/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  93. package/dist/assets/{i18n-B_njdXiH.js → i18n-CbyUyl6G.js} +2 -2
  94. package/dist/assets/ibm-plex-serif-cyrillic-400-normal-C7IY3oUc.woff +0 -0
  95. package/dist/assets/ibm-plex-serif-cyrillic-400-normal-CPQ8oqB-.woff2 +0 -0
  96. package/dist/assets/ibm-plex-serif-cyrillic-600-normal-6oiym5iu.woff2 +0 -0
  97. package/dist/assets/ibm-plex-serif-cyrillic-600-normal-C8YEAlRA.woff +0 -0
  98. package/dist/assets/ibm-plex-serif-cyrillic-700-normal-BSMLrh7C.woff2 +0 -0
  99. package/dist/assets/ibm-plex-serif-cyrillic-700-normal-CHVzwaSb.woff +0 -0
  100. package/dist/assets/ibm-plex-serif-cyrillic-ext-400-normal-BcBv-TKp.woff +0 -0
  101. package/dist/assets/ibm-plex-serif-cyrillic-ext-400-normal-CxUI4jC_.woff2 +0 -0
  102. package/dist/assets/ibm-plex-serif-cyrillic-ext-600-normal-CDMeBxaJ.woff +0 -0
  103. package/dist/assets/ibm-plex-serif-cyrillic-ext-600-normal-DXSZftVr.woff2 +0 -0
  104. package/dist/assets/ibm-plex-serif-cyrillic-ext-700-normal-CFcTJr1V.woff2 +0 -0
  105. package/dist/assets/ibm-plex-serif-cyrillic-ext-700-normal-Dq7XTXEq.woff +0 -0
  106. package/dist/assets/ibm-plex-serif-latin-400-normal-BB-zNvJB.woff +0 -0
  107. package/dist/assets/ibm-plex-serif-latin-400-normal-BIGslYFI.woff2 +0 -0
  108. package/dist/assets/ibm-plex-serif-latin-600-normal-D3rpGdkS.woff +0 -0
  109. package/dist/assets/ibm-plex-serif-latin-600-normal-DAxitmSu.woff2 +0 -0
  110. package/dist/assets/ibm-plex-serif-latin-700-normal-BBiG0u0D.woff +0 -0
  111. package/dist/assets/ibm-plex-serif-latin-700-normal-bnJnpGuO.woff2 +0 -0
  112. package/dist/assets/ibm-plex-serif-latin-ext-400-normal-CNMooFZX.woff2 +0 -0
  113. package/dist/assets/ibm-plex-serif-latin-ext-400-normal-DwktX9jl.woff +0 -0
  114. package/dist/assets/ibm-plex-serif-latin-ext-600-normal-CU6LeQOd.woff2 +0 -0
  115. package/dist/assets/ibm-plex-serif-latin-ext-600-normal-D1-_Ic5L.woff +0 -0
  116. package/dist/assets/ibm-plex-serif-latin-ext-700-normal-5BnP_gGI.woff +0 -0
  117. package/dist/assets/ibm-plex-serif-latin-ext-700-normal-BoBbeF2z.woff2 +0 -0
  118. package/dist/assets/ibm-plex-serif-vietnamese-400-normal-BY9Vij9A.woff +0 -0
  119. package/dist/assets/ibm-plex-serif-vietnamese-400-normal-DGubAMUE.woff2 +0 -0
  120. package/dist/assets/ibm-plex-serif-vietnamese-600-normal-BBruYZNA.woff2 +0 -0
  121. package/dist/assets/ibm-plex-serif-vietnamese-600-normal-DZRaS25B.woff +0 -0
  122. package/dist/assets/ibm-plex-serif-vietnamese-700-normal-B3aSYR1A.woff +0 -0
  123. package/dist/assets/ibm-plex-serif-vietnamese-700-normal-hPmb8oh_.woff2 +0 -0
  124. package/dist/assets/{index-CfREDCPe.js → index-BhXxZMAb.js} +83 -76
  125. package/dist/assets/index-BssEH_2N.css +1 -0
  126. package/dist/assets/{input-DAvKojvP.js → input-ag1CrUiS.js} +1 -1
  127. package/dist/assets/intel-one-mono-latin-400-normal-CqVdU6iH.woff2 +0 -0
  128. package/dist/assets/intel-one-mono-latin-400-normal-Dz-D6UFM.woff +0 -0
  129. package/dist/assets/intel-one-mono-latin-600-normal-DJb_B24X.woff2 +0 -0
  130. package/dist/assets/intel-one-mono-latin-600-normal-UTD3q2hA.woff +0 -0
  131. package/dist/assets/intel-one-mono-latin-700-normal-BFFlk8Op.woff2 +0 -0
  132. package/dist/assets/intel-one-mono-latin-700-normal-BzzNQkyM.woff +0 -0
  133. package/dist/assets/intel-one-mono-latin-ext-400-normal-BW7QmGmG.woff +0 -0
  134. package/dist/assets/intel-one-mono-latin-ext-400-normal-DpSum8DV.woff2 +0 -0
  135. package/dist/assets/intel-one-mono-latin-ext-600-normal-VDQcLlxR.woff +0 -0
  136. package/dist/assets/intel-one-mono-latin-ext-600-normal-wurdkzs-.woff2 +0 -0
  137. package/dist/assets/intel-one-mono-latin-ext-700-normal-Cszyb8TI.woff +0 -0
  138. package/dist/assets/intel-one-mono-latin-ext-700-normal-DHqel5Cm.woff2 +0 -0
  139. package/dist/assets/intel-one-mono-symbols2-400-normal-CD7uMPNv.woff2 +0 -0
  140. package/dist/assets/intel-one-mono-symbols2-400-normal-DrJQZ3Wk.woff +0 -0
  141. package/dist/assets/intel-one-mono-symbols2-600-normal-DhzUCacJ.woff2 +0 -0
  142. package/dist/assets/intel-one-mono-symbols2-600-normal-DoqMVv6l.woff +0 -0
  143. package/dist/assets/intel-one-mono-symbols2-700-normal-CYi7u3jm.woff +0 -0
  144. package/dist/assets/intel-one-mono-symbols2-700-normal-CkmMEo1z.woff2 +0 -0
  145. package/dist/assets/intel-one-mono-vietnamese-400-normal-Bn-nXHDK.woff2 +0 -0
  146. package/dist/assets/intel-one-mono-vietnamese-400-normal-nd8xkrKu.woff +0 -0
  147. package/dist/assets/intel-one-mono-vietnamese-600-normal-B9HWtSu2.woff2 +0 -0
  148. package/dist/assets/intel-one-mono-vietnamese-600-normal-Dm9ZhbyQ.woff +0 -0
  149. package/dist/assets/intel-one-mono-vietnamese-700-normal-Da_Xc8bO.woff +0 -0
  150. package/dist/assets/intel-one-mono-vietnamese-700-normal-xgkGRJps.woff2 +0 -0
  151. package/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  152. package/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  153. package/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  154. package/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  155. package/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  156. package/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  157. package/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  158. package/dist/assets/iosevka-latin-400-normal-7stTb90X.woff2 +0 -0
  159. package/dist/assets/iosevka-latin-400-normal-BVqCxfc4.woff +0 -0
  160. package/dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  161. package/dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  162. package/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  163. package/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  164. package/dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  165. package/dist/assets/lexend-latin-ext-wght-normal-B6JQhE1e.woff2 +0 -0
  166. package/dist/assets/lexend-latin-wght-normal-ci0D1wrL.woff2 +0 -0
  167. package/dist/assets/lexend-vietnamese-wght-normal-RvljkFvg.woff2 +0 -0
  168. package/dist/assets/literata-cyrillic-ext-wght-normal-CGKlZYBf.woff2 +0 -0
  169. package/dist/assets/literata-cyrillic-wght-normal-DLqwHbi6.woff2 +0 -0
  170. package/dist/assets/literata-greek-ext-wght-normal-e3e57Shi.woff2 +0 -0
  171. package/dist/assets/literata-greek-wght-normal-CO1l-giJ.woff2 +0 -0
  172. package/dist/assets/literata-latin-ext-wght-normal-BnEbWgdZ.woff2 +0 -0
  173. package/dist/assets/literata-latin-wght-normal-DLxlUchJ.woff2 +0 -0
  174. package/dist/assets/literata-vietnamese-wght-normal-LcSrhZ7T.woff2 +0 -0
  175. package/dist/assets/{mailbox-store-5Dizermg.js → mailbox-store-C49LeBj8.js} +1 -1
  176. package/dist/assets/martian-mono-cyrillic-wght-normal-B84CD5C_.woff2 +0 -0
  177. package/dist/assets/martian-mono-latin-ext-wght-normal-DlL6xMw5.woff2 +0 -0
  178. package/dist/assets/martian-mono-latin-wght-normal-5W32yIyr.woff2 +0 -0
  179. package/dist/assets/noto-sans-mono-cyrillic-ext-wght-normal-CFdLnqWt.woff2 +0 -0
  180. package/dist/assets/noto-sans-mono-cyrillic-wght-normal-Bt8FJ3Mn.woff2 +0 -0
  181. package/dist/assets/noto-sans-mono-greek-ext-wght-normal-D70fr4An.woff2 +0 -0
  182. package/dist/assets/noto-sans-mono-greek-wght-normal-CxbW-kt-.woff2 +0 -0
  183. package/dist/assets/noto-sans-mono-latin-ext-wght-normal-Co5HW6fV.woff2 +0 -0
  184. package/dist/assets/noto-sans-mono-latin-wght-normal-BOJxtwUa.woff2 +0 -0
  185. package/dist/assets/noto-sans-mono-vietnamese-wght-normal-R4O-K-Ty.woff2 +0 -0
  186. package/dist/assets/nunito-sans-cyrillic-ext-wght-normal-7w74d1lj.woff2 +0 -0
  187. package/dist/assets/nunito-sans-cyrillic-wght-normal-B9hoeQUC.woff2 +0 -0
  188. package/dist/assets/nunito-sans-latin-ext-wght-normal-DMEAsnHD.woff2 +0 -0
  189. package/dist/assets/nunito-sans-latin-wght-normal-BWQ3gi2K.woff2 +0 -0
  190. package/dist/assets/nunito-sans-vietnamese-wght-normal-BhFYcaJr.woff2 +0 -0
  191. package/dist/assets/onest-cyrillic-ext-wght-normal-DOFToQv1.woff2 +0 -0
  192. package/dist/assets/onest-cyrillic-wght-normal-DayYxulF.woff2 +0 -0
  193. package/dist/assets/onest-latin-ext-wght-normal-QAhDxQuo.woff2 +0 -0
  194. package/dist/assets/onest-latin-wght-normal-Dun_Rd-l.woff2 +0 -0
  195. package/dist/assets/onest-math-wght-normal-Bl4ZGkZl.woff2 +0 -0
  196. package/dist/assets/onest-symbols-wght-normal-DxQzqQfC.woff2 +0 -0
  197. package/dist/assets/onest-vietnamese-wght-normal-BBxOatbv.woff2 +0 -0
  198. package/dist/assets/outfit-latin-ext-wght-normal-DdQaqQDo.woff2 +0 -0
  199. package/dist/assets/outfit-latin-wght-normal-Bc-8i84L.woff2 +0 -0
  200. package/dist/assets/plus-jakarta-sans-latin-ext-wght-normal-DmpS2jIq.woff2 +0 -0
  201. package/dist/assets/plus-jakarta-sans-latin-wght-normal-eXO_dkmS.woff2 +0 -0
  202. package/dist/assets/plus-jakarta-sans-vietnamese-wght-normal-qRpaaN48.woff2 +0 -0
  203. package/dist/assets/red-hat-mono-latin-ext-wght-normal-BQQ6IFDA.woff2 +0 -0
  204. package/dist/assets/red-hat-mono-latin-wght-normal-Dwfc5A3M.woff2 +0 -0
  205. package/dist/assets/roboto-mono-cyrillic-ext-wght-normal-BUDPrIko.woff2 +0 -0
  206. package/dist/assets/roboto-mono-cyrillic-wght-normal-HUlVHixE.woff2 +0 -0
  207. package/dist/assets/roboto-mono-greek-wght-normal-BJJTbwTT.woff2 +0 -0
  208. package/dist/assets/roboto-mono-latin-ext-wght-normal-QAYlOegK.woff2 +0 -0
  209. package/dist/assets/roboto-mono-latin-wght-normal-CZtBPCCa.woff2 +0 -0
  210. package/dist/assets/roboto-mono-vietnamese-wght-normal-DlC-zuDL.woff2 +0 -0
  211. package/dist/assets/{roster-ws-CSbZSs3G.js → roster-ws-z8DKquaN.js} +1 -1
  212. package/dist/assets/settings-B5Jy-ObI.js +1 -0
  213. package/dist/assets/settings-BXTJJ4n-.js +1 -0
  214. package/dist/assets/settings-BcXAVecM.js +1 -0
  215. package/dist/assets/settings-ByPfZHGm.js +1 -0
  216. package/dist/assets/settings-CCe4iHcn.js +1 -0
  217. package/dist/assets/settings-D2GLiaDO.js +1 -0
  218. package/dist/assets/settings-gB9nKL3f.js +1 -0
  219. package/dist/assets/{shared-BirfDJmq.js → shared-BFJvAYzX.js} +1 -1
  220. package/dist/assets/source-code-pro-cyrillic-ext-wght-normal-BODHZjil.woff2 +0 -0
  221. package/dist/assets/source-code-pro-cyrillic-wght-normal-aqTvhEeI.woff2 +0 -0
  222. package/dist/assets/source-code-pro-greek-wght-normal-BvT6WsG1.woff2 +0 -0
  223. package/dist/assets/source-code-pro-latin-ext-wght-normal-0UZNSh4u.woff2 +0 -0
  224. package/dist/assets/source-code-pro-latin-wght-normal-BP8Zz55n.woff2 +0 -0
  225. package/dist/assets/source-code-pro-vietnamese-wght-normal-B6x53GZG.woff2 +0 -0
  226. package/dist/assets/source-sans-3-cyrillic-ext-wght-normal-DzyfIafT.woff2 +0 -0
  227. package/dist/assets/source-sans-3-cyrillic-wght-normal-BMDVbyM7.woff2 +0 -0
  228. package/dist/assets/source-sans-3-greek-ext-wght-normal-BWSLJLk6.woff2 +0 -0
  229. package/dist/assets/source-sans-3-greek-wght-normal-C9H9m1vD.woff2 +0 -0
  230. package/dist/assets/source-sans-3-latin-ext-wght-normal-C8iNium2.woff2 +0 -0
  231. package/dist/assets/source-sans-3-latin-wght-normal-BqRLTx4X.woff2 +0 -0
  232. package/dist/assets/source-sans-3-vietnamese-wght-normal-C1uRvKPU.woff2 +0 -0
  233. package/dist/assets/source-serif-4-cyrillic-ext-wght-normal-cHuGMAiY.woff2 +0 -0
  234. package/dist/assets/source-serif-4-cyrillic-wght-normal-DwHjdM4S.woff2 +0 -0
  235. package/dist/assets/source-serif-4-greek-wght-normal-ece1310W.woff2 +0 -0
  236. package/dist/assets/source-serif-4-latin-ext-wght-normal-CxNHBx-q.woff2 +0 -0
  237. package/dist/assets/source-serif-4-latin-wght-normal-D9elroTD.woff2 +0 -0
  238. package/dist/assets/source-serif-4-vietnamese-wght-normal-D-yuW59g.woff2 +0 -0
  239. package/dist/assets/space-mono-latin-400-normal-Rg4St2Dn.woff2 +0 -0
  240. package/dist/assets/space-mono-latin-400-normal-_3DlpgIW.woff +0 -0
  241. package/dist/assets/space-mono-latin-700-normal-D7A851RN.woff +0 -0
  242. package/dist/assets/space-mono-latin-700-normal-mWgeinG7.woff2 +0 -0
  243. package/dist/assets/space-mono-latin-ext-400-normal-D4cJI_B-.woff +0 -0
  244. package/dist/assets/space-mono-latin-ext-400-normal-DTLbW2xa.woff2 +0 -0
  245. package/dist/assets/space-mono-latin-ext-700-normal-B2s3bDs2.woff2 +0 -0
  246. package/dist/assets/space-mono-latin-ext-700-normal-B_E7P90g.woff +0 -0
  247. package/dist/assets/space-mono-vietnamese-400-normal-B0PMp_xB.woff +0 -0
  248. package/dist/assets/space-mono-vietnamese-400-normal-BNOj0Qhp.woff2 +0 -0
  249. package/dist/assets/space-mono-vietnamese-700-normal-D-KrLuLr.woff +0 -0
  250. package/dist/assets/space-mono-vietnamese-700-normal-DWQgDHuA.woff2 +0 -0
  251. package/dist/assets/{stores-COxKgvNx.js → stores-BIVCS5nu.js} +2 -2
  252. package/dist/assets/ubuntu-mono-cyrillic-400-normal-Di_0TARV.woff +0 -0
  253. package/dist/assets/ubuntu-mono-cyrillic-400-normal-OGyu3tt3.woff2 +0 -0
  254. package/dist/assets/ubuntu-mono-cyrillic-700-normal-BFVeNRUG.woff2 +0 -0
  255. package/dist/assets/ubuntu-mono-cyrillic-700-normal-Fcmsc1TE.woff +0 -0
  256. package/dist/assets/ubuntu-mono-cyrillic-ext-400-normal-C5u8faa9.woff2 +0 -0
  257. package/dist/assets/ubuntu-mono-cyrillic-ext-400-normal-CL-A5l1V.woff +0 -0
  258. package/dist/assets/ubuntu-mono-cyrillic-ext-700-normal-Bs-2rkWJ.woff2 +0 -0
  259. package/dist/assets/ubuntu-mono-cyrillic-ext-700-normal-CqMWGnc6.woff +0 -0
  260. package/dist/assets/ubuntu-mono-greek-400-normal-CCUzT4Jh.woff2 +0 -0
  261. package/dist/assets/ubuntu-mono-greek-400-normal-DR50Gfyl.woff +0 -0
  262. package/dist/assets/ubuntu-mono-greek-700-normal-BZ2dYCtm.woff2 +0 -0
  263. package/dist/assets/ubuntu-mono-greek-700-normal-CzNTt3J6.woff +0 -0
  264. package/dist/assets/ubuntu-mono-greek-ext-400-normal-BNZd3ZNJ.woff +0 -0
  265. package/dist/assets/ubuntu-mono-greek-ext-400-normal-CUE8Ia0W.woff2 +0 -0
  266. package/dist/assets/ubuntu-mono-greek-ext-700-normal-BT9L2HK2.woff2 +0 -0
  267. package/dist/assets/ubuntu-mono-greek-ext-700-normal-C7ZC70Zm.woff +0 -0
  268. package/dist/assets/ubuntu-mono-latin-400-normal-DpWeehTz.woff +0 -0
  269. package/dist/assets/ubuntu-mono-latin-400-normal-l4cqI2xd.woff2 +0 -0
  270. package/dist/assets/ubuntu-mono-latin-700-normal-g9eDMPsO.woff +0 -0
  271. package/dist/assets/ubuntu-mono-latin-700-normal-nUYOZNIl.woff2 +0 -0
  272. package/dist/assets/ubuntu-mono-latin-ext-400-normal-C-izf5FM.woff +0 -0
  273. package/dist/assets/ubuntu-mono-latin-ext-400-normal-Cadvr_Yo.woff2 +0 -0
  274. package/dist/assets/ubuntu-mono-latin-ext-700-normal-DDYBRrrS.woff +0 -0
  275. package/dist/assets/ubuntu-mono-latin-ext-700-normal-DW9JNpKV.woff2 +0 -0
  276. package/dist/assets/ui-store-DC3mkswy.js +1 -0
  277. package/dist/assets/utils-CKsqCaP8.js +1 -0
  278. package/dist/assets/{vector-memory-panel-fEdfCaDJ.js → vector-memory-panel-DZFEwwGM.js} +1 -1
  279. package/dist/assets/{vendor-BO-lHyIr.js → vendor-V3ydTHqN.js} +14 -14
  280. package/dist/assets/vendor-jL-bRT8f.css +1 -0
  281. package/dist/assets/victor-mono-cyrillic-ext-wght-normal-BdiBydkn.woff2 +0 -0
  282. package/dist/assets/victor-mono-cyrillic-wght-normal-hErKNM3V.woff2 +0 -0
  283. package/dist/assets/victor-mono-greek-wght-normal-Dt1CKMit.woff2 +0 -0
  284. package/dist/assets/victor-mono-latin-ext-wght-normal-9ZPGfAHN.woff2 +0 -0
  285. package/dist/assets/victor-mono-latin-wght-normal-DLAw12qW.woff2 +0 -0
  286. package/dist/assets/victor-mono-vietnamese-wght-normal-C28_QU0a.woff2 +0 -0
  287. package/dist/assets/{view-navigation-CVnKqjL2.js → view-navigation-DHtNFXIl.js} +1 -1
  288. package/dist/components/MessageBubble/ToolCallOverview.d.ts +14 -0
  289. package/dist/components/SettingsPanel/FontSettingsTab.d.ts +2 -0
  290. package/dist/components/ThemeProvider.d.ts +1 -1
  291. package/dist/hooks/use-font-settings.d.ts +13 -0
  292. package/dist/index.html +17 -16
  293. package/dist/index.js +13650 -10550
  294. package/dist/lib/font-scale-css.d.ts +45 -0
  295. package/dist/lib/fonts.d.ts +502 -0
  296. package/dist/stores/config-store.d.ts +8 -1
  297. package/dist/stores/types.d.ts +6 -0
  298. package/dist/stores/ui-store-types.d.ts +1 -1
  299. package/package.json +39 -9
  300. package/dist/assets/AgentRosterView-Ce7myLNH.css +0 -1
  301. package/dist/assets/AgentRosterView-CtUX-VHJ.js +0 -12
  302. package/dist/assets/AudienceMemoryPanel-i53Y5nRR.js +0 -3
  303. package/dist/assets/ChangesView-CFOQZBoO.js +0 -1
  304. package/dist/assets/ChronicleDashboard-Dc2rEfEh.js +0 -1
  305. package/dist/assets/CodeEditor-DhA63AyO.js +0 -2
  306. package/dist/assets/CodeMap-6sHlGgjj.js +0 -1
  307. package/dist/assets/DeadCodeScanPanel-j3n15R1p.js +0 -2
  308. package/dist/assets/DesignGalleryView-tw6AdJGD.js +0 -1
  309. package/dist/assets/GoalView-DsGdbElx.js +0 -1
  310. package/dist/assets/KanbanView-B8USJasA.js +0 -3
  311. package/dist/assets/MailboxDetailView-jsHPTvQO.js +0 -1
  312. package/dist/assets/MemoryDrawer-BdcWptmP.js +0 -1
  313. package/dist/assets/MemoryManager-Cawc6tAj.js +0 -1
  314. package/dist/assets/ProviderTestView-CztiodHF.js +0 -1
  315. package/dist/assets/QueuePanel-BQQfIbGH.js +0 -1
  316. package/dist/assets/RepositoryHistoryView-BFiEVjF-.js +0 -2
  317. package/dist/assets/SageTabs-BnjtZSVk.js +0 -2
  318. package/dist/assets/SddFlowGraph-CZQxxeJv.js +0 -1
  319. package/dist/assets/SddHub-CimqjJhd.js +0 -2
  320. package/dist/assets/SessionInspectView-DnzU3hjG.js +0 -1
  321. package/dist/assets/SessionList-DBcHNwcc.js +0 -1
  322. package/dist/assets/SessionsDashboard-DofL975M.js +0 -1
  323. package/dist/assets/SetupScreen-DQAqt8Dn.js +0 -1
  324. package/dist/assets/SkillDetailView-BcG2XIwr.js +0 -3
  325. package/dist/assets/TechStackView-Ce3WNG85.js +0 -2
  326. package/dist/assets/TerminalPanel-B3SOIzJY.js +0 -1
  327. package/dist/assets/button-h7DHXgna.js +0 -1
  328. package/dist/assets/config-store-D7yrCV2X.js +0 -22
  329. package/dist/assets/dialog-CTmNJKRN.js +0 -1
  330. package/dist/assets/index-coebX2ug.css +0 -1
  331. package/dist/assets/settings-AxDNIcz1.js +0 -1
  332. package/dist/assets/settings-BcejxgTD.js +0 -1
  333. package/dist/assets/settings-CAfe70nd.js +0 -1
  334. package/dist/assets/settings-CxqeEzzD.js +0 -1
  335. package/dist/assets/settings-D90wMI-3.js +0 -1
  336. package/dist/assets/settings-DKSmPD2M.js +0 -1
  337. package/dist/assets/settings-DWXLaAFN.js +0 -1
  338. package/dist/assets/ui-store-BROszDxo.js +0 -1
  339. package/dist/assets/utils-DQbrPaAM.js +0 -1
  340. package/dist/assets/vendor-BShi5_Dg.css +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./config-store-BAUadwHd.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Dn as i,Ha as a,Ii as o,Mn as s,Mr as c,Mt as l,Na as u,Pa as d,Qt as f,Va as p,Vi as m,Vn as h,Ya as g,Yi as ee,Yt as _,Zn as v,ci as y,ei as b,fa as x,fn as S,ja as C,ln as w,mi as T,n as E,nr as D,po as te,qn as O,rn as k,so as A,tr as ne,ur as re,wa as ie,xo as j,yn as ae,zr as oe}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{a as M,h as N,n as se,r as P,t as ce,u as le}from"./xyflow-BqDBClm9.js";import{t as F}from"./utils-CKsqCaP8.js";import{n as ue}from"./ui-store-DC3mkswy.js";import"./stores-BIVCS5nu.js";import{S as I}from"./fonts-DRGbd-AM.js";import{a as de,i as fe,n as L,o as pe,r as R,t as me}from"./dialog-C7EIBM_2.js";import{t as z}from"./button-9ewV4TF3.js";import{t as B}from"./input-ag1CrUiS.js";import{L as he,y as V}from"./index-BhXxZMAb.js";import{t as ge}from"./roster-ws-z8DKquaN.js";import{_ as _e,a as ve,b as ye,c as H,d as be,f as xe,g as Se,h as Ce,i as we,l as Te,m as Ee,n as De,o as Oe,p as ke,r as Ae,s as U,t as je,u as Me,v as Ne,y as W}from"./shared-BFJvAYzX.js";import{t as Pe}from"./MemoryDrawer-IMvyNAhc.js";var G=r();function Fe({busyAction:e,deletingId:t,memory:n,onCancel:r,onConfirm:i,onOpenChange:a}){let{t:o}=j();return(0,G.jsx)(me,{open:!!t,onOpenChange:a,children:(0,G.jsxs)(L,{className:`max-w-md`,children:[(0,G.jsxs)(de,{children:[(0,G.jsx)(`span`,{className:`mb-2 flex size-10 items-center justify-center border border-destructive/35 bg-destructive/10 text-destructive`,children:(0,G.jsx)(f,{className:`size-4`})}),(0,G.jsx)(pe,{children:o(`activity:memoryManager.deleteTitle`)}),(0,G.jsx)(R,{className:`leading-6`,children:o(`activity:deleteMemoryDialog.sageWillMarkTheRecordDeleted`)})]}),(0,G.jsx)(`div`,{className:`border border-border/70 bg-background/45 p-3 text-xs text-muted-foreground`,children:Se(n?.text??``,180)}),(0,G.jsxs)(fe,{children:[(0,G.jsx)(z,{variant:`outline`,onClick:r,disabled:e===`delete`,children:o(`common:action.cancel`)}),(0,G.jsxs)(z,{variant:`destructive`,onClick:i,disabled:e===`delete`,children:[e===`delete`?(0,G.jsx)(c,{className:`size-4 animate-spin`}):(0,G.jsx)(f,{className:`size-4`}),o(e===`delete`?`activity:memoryManager.deletingLabel`:`activity:memoryManager.actionDeleteMemory`)]})]})]})})}var K=e(n(),1),Ie=212,Le=188;function Re(e){return e.length>14?`${e.slice(0,11)}…`:e}function ze(e,t=58){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function q(e){return e.type===`symbol`?[e.path,e.symbol?`#${e.symbol}`:``].filter(Boolean).join(``):e.path??e.command??e.symbol??e.role??e.type}function J(e){return e===`active`?`border-success/45 bg-success/10 text-success`:e===`stale`?`border-warning/45 bg-warning/10 text-warning`:e===`contradicted`?`border-destructive/45 bg-destructive/10 text-destructive`:e===`superseded`?`border-warning/35 bg-warning/5 text-warning`:`border-border bg-muted/55 text-muted-foreground`}function Be({data:e}){let{entry:t,center:n}=e;return(0,G.jsxs)(`div`,{className:n?`border border-primary/70 bg-card px-3 py-2.5 text-card-foreground shadow-[0_0_0_1px_hsl(var(--primary)/0.2),0_0_24px_hsl(var(--primary)/0.12)]`:`border border-border/80 bg-card/95 px-3 py-2.5 text-card-foreground shadow-lg`,style:{width:Ie},title:t.text,children:[(0,G.jsx)(M,{type:`target`,position:N.Top,className:`!border-background !bg-muted-foreground`}),(0,G.jsx)(M,{type:`source`,position:N.Bottom,className:`!border-background !bg-primary`}),(0,G.jsx)(M,{type:`source`,position:N.Right,className:`!border-background !bg-primary`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`border px-1.5 py-0.5 text-[9px] font-bold uppercase ${J(t.status)}`,children:t.status}),(0,G.jsx)(`span`,{className:`ml-auto truncate font-mono text-[9px] text-muted-foreground`,children:Re(t.id)})]}),(0,G.jsx)(`p`,{className:`mt-2 line-clamp-2 text-[11px] leading-4 text-foreground/90`,children:ze(t.text)}),(0,G.jsx)(`p`,{className:`mt-1 font-mono text-[9px] uppercase text-muted-foreground`,children:t.kind})]})}function Y({data:e}){return(0,G.jsxs)(`div`,{className:`border border-info/40 bg-info/8 px-2.5 py-2 text-card-foreground shadow-lg`,style:{width:Le},title:e.label,children:[(0,G.jsx)(M,{type:`target`,position:N.Left,className:`!border-background !bg-info`}),(0,G.jsx)(`p`,{className:`font-mono text-[9px] font-bold uppercase text-info`,children:e.anchor.type}),(0,G.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-foreground/85`,children:e.label})]})}var Ve={memoryNode:Be,anchorNode:Y};function X(e,t){return{id:e,revision:0,scope:`project`,kind:`fact`,status:`deleted`,text:t(`activity:memoryManager.memoryUnavailable`),importance:0,confidence:0,freshness:0,tags:[],anchors:[],createdAt:``,updatedAt:``}}function He({nodes:e,edges:t,className:n}){return(0,G.jsx)(`div`,{className:F(`w-full`,n),children:(0,G.jsxs)(le,{nodes:e,edges:t,nodeTypes:Ve,fitView:!0,fitViewOptions:{padding:.24,maxZoom:1.05},minZoom:.4,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnScroll:!1,proOptions:{hideAttribution:!0},children:[(0,G.jsx)(ce,{variant:se.Dots,gap:18,size:1,color:`hsl(var(--muted-foreground) / 0.18)`}),(0,G.jsx)(P,{showInteractive:!1,className:`!border-border !bg-card !shadow-lg`})]})})}function Ue({centerMemory:e,allMemories:t,graphEdges:n,loading:r=!1,error:i=null}){let{t:a}=j(),[o,s]=(0,K.useState)(!1),c=`mem:${e.id}`,l=(0,K.useMemo)(()=>n.filter(e=>e.from===c&&e.to.startsWith(`mem:`)||e.to===c&&e.from.startsWith(`mem:`)).slice(0,24),[c,n]),{nodes:u,edges:d}=(0,K.useMemo)(()=>{let n=[],r=[],i=new Map(t.map(e=>[e.id,e]));n.push({id:e.id,type:`memoryNode`,position:{x:320-Ie/2,y:120},data:{entry:e,center:!0}});let o=[...e.supersededBy?[{id:e.supersededBy,relation:`superseded by`}]:[],...(e.supersedes??[]).map(e=>({id:e,relation:`supersedes`})),...(e.contradicts??[]).map(e=>({id:e,relation:`contradicts`}))];for(let e of l){let t=(e.from===c?e.to:e.from).slice(4);o.some(n=>n.id===t&&n.relation===e.relation)||o.push({id:t,relation:e.relation,weight:e.weight,evidence:e.evidence})}let s=320-(o.length-1)*220/2;return o.forEach((t,o)=>{let c=i.get(t.id)??X(t.id,a),l=t.relation===`superseded by`,u=l?0:280+Math.floor(o/3)*130,d=l?320-Ie/2:s+o*220-Ie/2;n.push({id:`memory:${t.id}:${o}`,type:`memoryNode`,position:{x:d,y:u},data:{entry:c,center:!1}});let f=t.relation===`contradicts`,p=l?`memory:${t.id}:${o}`:e.id,m=l?e.id:`memory:${t.id}:${o}`;r.push({id:`relation:${t.relation}:${t.id}:${o}`,source:p,target:m,type:`smoothstep`,animated:!f,label:t.weight===void 0?t.relation:`${t.relation} ${t.weight.toFixed(2)}`,data:{evidence:t.evidence??[]},style:{stroke:f?`hsl(var(--destructive))`:`hsl(var(--primary))`,strokeWidth:1.7,...f?{strokeDasharray:`5 4`}:{}},labelStyle:{fill:f?`hsl(var(--destructive))`:`hsl(var(--muted-foreground))`,fontSize:I(9),fontWeight:700},labelBgStyle:{fill:`hsl(var(--card))`,fillOpacity:.9}})}),e.anchors.forEach((t,i)=>{let a=`anchor:${i}`;n.push({id:a,type:`anchorNode`,position:{x:540,y:120+(i-(e.anchors.length-1)/2)*66},data:{anchor:t,label:q(t)}}),r.push({id:`anchor-edge:${i}`,source:e.id,target:a,type:`smoothstep`,style:{stroke:`hsl(var(--info))`,strokeWidth:1.3}})}),{nodes:n,edges:r}},[t,e,c,l]);return u.length<=1&&!r&&!i?null:(0,G.jsxs)(`section`,{className:`overflow-hidden border border-border/75 bg-background/35`,"aria-label":a(`activity:memoryManager.graphAria`),children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/55 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-[10px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:a(`activity:memoryManager.graphHeading`)}),u.length>1&&(0,G.jsxs)(z,{variant:`ghost`,size:`sm`,onClick:()=>s(!0),className:`h-6 gap-1 px-2 text-[9px] font-bold uppercase tracking-[0.12em]`,"aria-label":a(`activity:memoryManager.graphFullscreenAria`),children:[(0,G.jsx)(m,{className:`size-3`}),a(`activity:memoryManager.graphOpenFullscreen`)]})]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:r?a(`activity:memoryManager.loadingGraph`):a(`activity:memoryManager.graphStats`,{nodes:u.length,edges:d.length})})]}),i&&(0,G.jsx)(`p`,{className:`border-b border-destructive/25 bg-destructive/5 px-3 py-2 text-[10px] text-destructive`,children:i}),u.length>1&&(0,G.jsx)(He,{nodes:u,edges:d,className:`h-[320px]`}),l.some(e=>e.evidence?.length)&&(0,G.jsx)(`div`,{className:`grid gap-1 border-t border-border/70 bg-card/35 px-3 py-2`,children:l.filter(e=>e.evidence?.length).slice(0,12).map(e=>{let t=(e.from===c?e.to:e.from).slice(4);return(0,G.jsxs)(`p`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`text-info`,children:e.relation}),` `,Re(t),` · why:`,` `,e.evidence?.join(`, `)]},e.id)})}),o&&(0,G.jsx)(me,{open:o,onOpenChange:s,children:(0,G.jsxs)(L,{className:`flex max-h-[90dvh] max-w-[90vw] flex-col p-0`,showCloseButton:!1,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/55 px-4 py-3`,children:[(0,G.jsx)(`p`,{className:`text-[10px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:a(`activity:memoryManager.graphHeadingFull`,{id:e.id})}),(0,G.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),className:`h-7 gap-1 px-2 text-[10px]`,children:a(`common:action.close`)})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 px-4 pb-4`,children:(0,G.jsx)(He,{nodes:u,edges:d,className:`h-[65vh]`})})]})})]})}function We({memory:e,allMemories:t,relatedMemories:n,graphEdges:r,graphLoading:i,graphError:o,onClose:s,onOpenMemory:c,onEdit:l,onDelete:u,onTagSelect:d,onNotice:p}){let{t:m}=j();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 bg-card/65 px-4 py-3 backdrop-blur-xl`,children:[(0,G.jsx)(z,{variant:`ghost`,size:`icon`,className:`md:hidden`,onClick:s,"aria-label":m(`activity:memoryManager.backToList`),children:(0,G.jsx)(A,{className:`size-4`})}),(0,G.jsx)(`span`,{className:F(`text-[10px] font-bold uppercase tracking-[0.14em]`,Ce(e.kind)),children:Ae[e.kind]??e.kind}),(0,G.jsx)(Te,{status:e.status}),(0,G.jsx)(`span`,{className:`border border-border/70 px-2 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:e.scope}),e.audience&&(0,G.jsxs)(`span`,{className:`flex items-center gap-1 border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-[9px] text-primary`,title:ke(e.audience),children:[(0,G.jsx)(a,{className:`size-3`}),ke(e.audience)]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,G.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":m(`activity:memoryManager.copyId`),title:m(`activity:memoryManager.copyId`),onClick:()=>{navigator.clipboard?.writeText(e.id),p(m(`activity:memoryManager.copiedNotice`))},children:(0,G.jsx)(x,{className:`size-4`})}),(0,G.jsxs)(z,{variant:`outline`,size:`sm`,onClick:()=>l(e.id),disabled:e.status===`deleted`,children:[(0,G.jsx)(v,{className:`size-3.5`}),` `,m(`common:action.edit`)]}),(0,G.jsxs)(z,{variant:`destructive`,size:`sm`,onClick:u,disabled:e.status===`deleted`,children:[(0,G.jsx)(f,{className:`size-3.5`}),` `,m(`common:action.delete`)]})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 md:p-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[(0,G.jsx)(Z,{memory:e}),(0,G.jsx)(Ge,{memory:e}),e.tags.length>0&&(0,G.jsx)(Q,{tags:e.tags,onTagSelect:d}),e.anchors.length>0&&(0,G.jsx)(Ke,{anchors:e.anchors}),n.length>0&&(0,G.jsx)(qe,{relatedMemories:n,allMemories:t,onOpenMemory:c}),(0,G.jsx)(Ue,{centerMemory:e,allMemories:t,graphEdges:r,loading:i,error:o}),(0,G.jsx)($,{memory:e}),e.status===`deleted`&&(0,G.jsx)(Je,{contextPolicy:e.contextPolicy})]})})]})}function Z({memory:e}){let{t}=j();return(0,G.jsxs)(`div`,{className:`relative overflow-hidden border border-border/75 bg-card/55 p-5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.04)]`,children:[(0,G.jsx)(`div`,{className:`pointer-events-none absolute -right-10 -top-10 size-36 bg-[radial-gradient(circle,hsl(var(--info)/0.13),transparent_68%)]`}),(0,G.jsx)(`p`,{className:`relative whitespace-pre-wrap text-sm leading-7 text-foreground md:text-[15px]`,children:e.text}),e.summary&&(0,G.jsx)(`p`,{className:`relative mt-4 border-l-2 border-info/50 pl-3 text-xs italic leading-5 text-muted-foreground`,children:e.summary}),(0,G.jsxs)(`div`,{className:`relative mt-5 flex flex-wrap items-center gap-2 border-t border-border/60 pt-3`,children:[(0,G.jsx)(`code`,{className:`min-w-0 break-all font-mono text-[10px] text-muted-foreground`,children:e.id}),(0,G.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-muted-foreground`,children:t(`activity:memoryManager.revisionSuffix`,{n:e.revision})})]})]})}function Ge({memory:e}){let{t}=j(),n=[[t(`activity:memoryManager.editorImportance`),e.importance,ae],[t(`activity:memoryManager.editorConfidence`),e.confidence,ie],[t(`activity:memoryManager.editorFreshness`),e.freshness,h]];return(0,G.jsx)(`div`,{className:`grid gap-px bg-border/60 sm:grid-cols-3`,children:n.map(([e,t,n])=>(0,G.jsxs)(`div`,{className:`bg-card/60 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(n,{className:`size-3.5 text-info`}),(0,G.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.13em] text-muted-foreground`,children:e}),(0,G.jsxs)(`span`,{className:`ml-auto font-mono text-xs font-bold tabular-nums`,children:[Math.round(t*100),`%`]})]}),(0,G.jsx)(`div`,{className:`mt-2 h-1 bg-muted`,children:(0,G.jsx)(`div`,{className:`h-full bg-info shadow-[0_0_8px_hsl(var(--info)/0.45)]`,style:{width:`${Math.round(t*100)}%`}})})]},e))})}function Q({tags:e,onTagSelect:t}){let{t:n}=j();return(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`h3`,{className:`mb-2 flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(k,{className:`size-3.5 text-info`}),` `,n(`activity:memoryManager.tagsLabel`)]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(e),className:`border border-info/25 bg-info/5 px-2 py-1 font-mono text-[10px] text-info hover:border-info/55 hover:bg-info/10`,children:[`#`,e]},e))})]})}function Ke({anchors:e}){let{t}=j();return(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/65 px-3 py-2.5`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(o,{className:`size-3.5 text-info`}),` `,t(`activity:memoryManager.editorAnchors`)]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.length})]}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:e.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center border border-info/25 bg-info/5 text-info`,children:e.type===`command`?(0,G.jsx)(w,{className:`size-3.5`}):(0,G.jsx)(o,{className:`size-3.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-[9px] font-bold uppercase text-muted-foreground`,children:e.type}),(0,G.jsxs)(`p`,{className:`mt-0.5 break-all font-mono text-[10px] leading-4 text-foreground/85`,children:[e.path??e.command??e.role??`—`,e.symbol?`#${e.symbol}`:``]})]}),(e.lineStart||e.lineEnd)&&(0,G.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[9px] text-muted-foreground`,children:[`L`,e.lineStart??`?`,`–`,e.lineEnd??`?`]})]},`${e.type}:${e.path??e.command??e.symbol??e.role}:${t}`))})]})}function qe({relatedMemories:e,allMemories:t,onOpenMemory:n}){let{t:r}=j();return(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/65 px-3 py-2.5`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(y,{className:`size-3.5 text-info`}),` `,r(`activity:memoryManager.memoryRelationships`)]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.length})]}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:e.map(e=>{let i=t.find(t=>t.id===e.id);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,disabled:!i,onClick:()=>i&&n(i.id),className:`group flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left hover:bg-info/5 disabled:cursor-not-allowed disabled:opacity-55`,children:[(0,G.jsx)(`span`,{className:F(`w-24 shrink-0 text-[9px] font-bold uppercase`,e.relation===`Contradicts`?`text-destructive`:`text-info`),children:e.relation}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:i?Se(i.text,95):r(`activity:memoryManager.referencedUnavailable`)}),(0,G.jsx)(`code`,{className:`hidden max-w-32 truncate font-mono text-[9px] text-muted-foreground sm:block`,children:e.id}),i&&(0,G.jsx)(C,{className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-info`})]})},`${e.relation}:${e.id}`)})})]})}function $({memory:e}){let{t}=j(),n=[[t(`activity:memoryManager.metaCreated`),Ee(e.createdAt),g],[t(`activity:memoryManager.metaUpdated`),Ee(e.updatedAt),h],[t(`activity:memoryManager.metaLastAccessed`),Ee(e.lastAccessedAt),re],[t(`activity:memoryManager.metaLastVerified`),Ee(e.lastVerifiedAt),ae]];return(0,G.jsx)(`section`,{className:`grid gap-px bg-border/60 sm:grid-cols-2 lg:grid-cols-4`,children:n.map(([e,t,n])=>(0,G.jsxs)(`div`,{className:`bg-card/50 p-3`,children:[(0,G.jsx)(n,{className:`size-3.5 text-muted-foreground`}),(0,G.jsx)(`p`,{className:`mt-2 text-[9px] font-bold uppercase tracking-[0.12em] text-muted-foreground`,children:e}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] leading-4 text-foreground/85`,children:t})]},e))})}function Je({contextPolicy:e}){let{t}=j();return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 border border-border bg-muted/50 p-4 text-xs text-muted-foreground`,children:[(0,G.jsx)(te,{className:`mt-0.5 size-4 shrink-0`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-bold text-foreground`,children:t(`activity:memoryManager.deletedMemory`)}),(0,G.jsx)(`p`,{className:`mt-1 leading-5`,children:t(e===`never`?`activity:memoryManager.deletedNeverPolicy`:`activity:memoryManager.deletedEligiblePolicy`)})]})]})}function Ye({currentFilePath:e,knownFilePaths:t,drawerActive:n,onFilePathChange:r,onToggleDrawer:i}){let{t:a}=j();return(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/60 bg-card/30 px-3 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:a(`activity:memoryManager.fileDrawerLabel`)}),(0,G.jsx)(`input`,{type:`text`,list:`memory-drawer-file-list`,value:e??``,onChange:e=>{r(e.target.value.trim()||null)},placeholder:a(`activity:memoryManager.selectFilePlaceholder`),className:`min-w-0 max-w-[260px] flex-1 truncate rounded-sm border border-border/60 bg-background px-1.5 py-0.5 text-[10px] font-mono`,"aria-label":a(`activity:memoryManager.fileForDrawerAria`),"data-testid":`memory-drawer-file-select`}),(0,G.jsx)(`datalist`,{id:`memory-drawer-file-list`,children:[...t].sort().map(e=>(0,G.jsx)(`option`,{value:e},e))}),(0,G.jsxs)(z,{type:`button`,size:`sm`,variant:n?`default`:`outline`,onClick:i,disabled:!e,className:`h-7 shrink-0 gap-1 px-2 text-[11px]`,"aria-pressed":n,title:a(n?`activity:memoryManager.hideFileDrawer`:`activity:memoryManager.showFileDrawer`),children:[n?(0,G.jsx)(D,{className:`size-3`}):(0,G.jsx)(ne,{className:`size-3`}),a(n?`activity:memoryManager.hideDrawer`:`activity:memoryManager.showDrawer`)]})]})}function Xe({mode:e,draft:t,busy:n,error:r,onChange:i,onCancel:a,onSubmit:o}){let{t:u}=j(),d=(0,K.useRef)(null),[p,m]=(0,K.useState)([]);(0,K.useEffect)(()=>{d.current?.focus();let e=new AbortController;return ge(`agent-roster.list`,{},e.signal).then(e=>{let t=e.roles;Array.isArray(t)&&m(t.filter(e=>typeof e==`string`))}).catch(()=>void 0),()=>e.abort()},[]);let h=(e,n)=>{i({...t,[e]:n})},g=()=>{h(`anchors`,[...t.anchors,{type:`file`,path:``}])};return(0,G.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),o()},"aria-busy":n,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 bg-card/70 px-4 py-3 backdrop-blur-xl`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`flex size-8 items-center justify-center border border-info/35 bg-info/10 text-info`,children:e===`create`?(0,G.jsx)(S,{className:`size-4`}):(0,G.jsx)(v,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-bold`,children:u(e===`create`?`activity:memoryManager.captureMemory`:`activity:memoryManager.editMemory`)}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:u(e===`create`?`activity:memoryManager.editorCreateHint`:`activity:memoryManager.editorEditHint`)})]})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,G.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,onClick:a,disabled:n,children:[(0,G.jsx)(l,{className:`size-3.5`}),` `,u(`common:action.cancel`)]}),(0,G.jsxs)(z,{type:`submit`,size:`sm`,disabled:n||!t.text.trim(),children:[n?(0,G.jsx)(c,{className:`size-3.5 animate-spin`}):e===`create`?(0,G.jsx)(O,{className:`size-3.5`}):(0,G.jsx)(s,{className:`size-3.5`}),u(n?`common:action.saving`:e===`create`?`activity:memoryManager.createMemory`:`activity:memoryManager.saveChanges`)]})]})]}),(0,G.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto overscroll-contain p-4 md:p-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5`,children:[r&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-sm text-destructive`,children:[(0,G.jsx)(_,{className:`mt-0.5 size-4 shrink-0`}),(0,G.jsx)(`span`,{children:r})]}),(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/45 p-4`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:u(`activity:memoryManager.editorKnowledge`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:u(`activity:memEditor.writeTheDurableFactOrDecision`)})]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground tabular-nums`,children:u(`activity:memoryManager.editorCharCount`,{count:t.text.length})})]}),(0,G.jsx)(`label`,{htmlFor:`memory-text`,className:`sr-only`,children:u(`activity:memoryManager.editorContentLabel`)}),(0,G.jsx)(`textarea`,{ref:d,id:`memory-text`,value:t.text,onChange:e=>h(`text`,e.target.value),rows:7,required:!0,placeholder:u(`activity:memoryManager.editorContentPlaceholder`),className:`min-h-36 w-full resize-y border border-input bg-background/75 px-3 py-3 text-sm leading-6 text-foreground shadow-inner placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-kind`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorKind`)}),(0,G.jsx)(`select`,{id:`memory-kind`,value:t.kind,onChange:e=>h(`kind`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:we.map(e=>(0,G.jsx)(`option`,{value:e,children:Ae[e]},e))})]}),e===`create`?(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-scope`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorScope`)}),(0,G.jsx)(`select`,{id:`memory-scope`,value:t.scope,onChange:e=>h(`scope`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:ve.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))})]}):(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-status`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorLifecycleStatus`)}),(0,G.jsx)(`select`,{id:`memory-status`,value:t.status,onChange:e=>h(`status`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:De.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))})]}),(0,G.jsxs)(`div`,{className:F(`min-w-0`,e===`create`?`sm:col-span-2 lg:col-span-1`:``),children:[(0,G.jsx)(`label`,{htmlFor:`memory-tags`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.tagsLabel`)}),(0,G.jsx)(B,{id:`memory-tags`,value:t.tags,onChange:e=>h(`tags`,e.target.value),placeholder:u(`activity:memEditor.architectureWebuiWorkflow`),className:`h-10 bg-background`})]})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,G.jsx)(H,{id:`memory-importance`,label:u(`activity:memoryManager.editorImportance`),value:t.importance,onChange:e=>h(`importance`,e)}),(0,G.jsx)(H,{id:`memory-confidence`,label:u(`activity:memoryManager.editorConfidence`),value:t.confidence,onChange:e=>h(`confidence`,e)}),(0,G.jsx)(H,{id:`memory-freshness`,label:u(`activity:memoryManager.editorFreshness`),value:t.freshness,onChange:e=>h(`freshness`,e)})]}),(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/45 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:u(`activity:memoryManager.editorAnchors`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:u(`activity:memEditor.bindKnowledgeToFilesSymbolsPackages`)})]}),(0,G.jsxs)(z,{type:`button`,variant:`outline`,size:`sm`,onClick:g,children:[(0,G.jsx)(O,{className:`size-3.5`}),` `,u(`activity:memoryManager.addAnchor`)]})]}),t.anchors.length===0?(0,G.jsxs)(`button`,{type:`button`,onClick:g,className:`mt-4 flex w-full items-center justify-center gap-2 border border-dashed border-border px-4 py-7 text-xs text-muted-foreground transition-colors hover:border-info/50 hover:bg-info/5 hover:text-info`,children:[(0,G.jsx)(oe,{className:`size-4`}),` `,u(`activity:memoryManager.noAnchors`)]}):(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,children:t.anchors.map((e,n)=>(0,G.jsxs)(`div`,{className:`grid gap-2 border border-border/65 bg-background/40 p-2 sm:grid-cols-[9rem_minmax(0,1fr)_auto]`,children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-type-${n}`,children:[`Anchor `,n+1,` type`]}),(0,G.jsx)(`select`,{id:`anchor-type-${n}`,value:e.type,onChange:e=>{let r=e.target.value,i=r===`command`?{type:r,command:``}:r===`agent`?{type:r,role:``}:{type:r,path:``},a=t.anchors.map((e,t)=>t===n?i:e);h(`anchors`,a)},className:`h-10 border border-input bg-background px-2 text-xs`,children:je.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsxs)(`div`,{className:F(`grid min-w-0 gap-2`,e.type===`symbol`&&`sm:grid-cols-[minmax(0,1fr)_11rem]`),children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-value-${n}`,children:[`Anchor `,n+1,` value`]}),(0,G.jsx)(B,{id:`anchor-value-${n}`,list:e.type===`agent`?`memory-agent-role-options`:void 0,value:Me(e),onChange:e=>{let r=t.anchors.map((t,r)=>r===n?ye(t,e.target.value):t);h(`anchors`,r)},placeholder:e.type===`command`?`pnpm test --filter webui`:e.type===`agent`?`reviewer`:`packages/webui/src/App.tsx`,className:`h-10 min-w-0 bg-background font-mono text-xs`}),e.type===`symbol`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-symbol-${n}`,children:[`Anchor `,n+1,` symbol`]}),(0,G.jsx)(B,{id:`anchor-symbol-${n}`,value:e.symbol??``,onChange:e=>{let r=t.anchors.map((t,r)=>r===n?{...t,symbol:e.target.value}:t);h(`anchors`,r)},placeholder:u(`activity:memoryManager.editorSymbolPlaceholder`),className:`h-10 bg-background font-mono text-xs`})]})]}),(0,G.jsx)(z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove anchor ${n+1}`,onClick:()=>h(`anchors`,t.anchors.filter((e,t)=>t!==n)),children:(0,G.jsx)(f,{className:`size-4 text-destructive`})})]},`${e.type}:${n}`))}),(0,G.jsx)(`datalist`,{id:`memory-agent-role-options`,children:p.map(e=>(0,G.jsx)(`option`,{value:e},e))})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 border border-border/75 bg-card/45 p-4 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:u(`activity:memoryManager.editorRelationships`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:u(`activity:memoryManager.editorRelationshipsHint`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-supersedes`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorSupersedes`)}),(0,G.jsx)(B,{id:`memory-supersedes`,value:t.supersedes,onChange:e=>h(`supersedes`,e.target.value),placeholder:u(`activity:memEditor.memIdMemId`),className:`h-10 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-contradicts`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorContradicts`)}),(0,G.jsx)(B,{id:`memory-contradicts`,value:t.contradicts,onChange:e=>h(`contradicts`,e.target.value),placeholder:u(`activity:memEditor.memIdMemId`),className:`h-10 bg-background font-mono text-xs`})]})]}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memEditor.audienceOptional`)}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground/70`,children:u(`activity:memEditor.targetThisMemoryToSpecificAgent`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-roles`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memEditor.roles`)}),(0,G.jsx)(B,{id:`memory-audience-roles`,value:t.audienceRoles,onChange:e=>h(`audienceRoles`,e.target.value),placeholder:u(`activity:memEditor.reviewerRefactorPlanner`),className:`h-9 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-task-types`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memoryManager.editorTaskTypes`)}),(0,G.jsx)(B,{id:`memory-audience-task-types`,value:t.audienceTaskTypes,onChange:e=>h(`audienceTaskTypes`,e.target.value),placeholder:u(`activity:memEditor.reviewRefactorBugfix`),className:`h-9 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-modes`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:u(`activity:memEditor.modes`)}),(0,G.jsx)(B,{id:`memory-audience-modes`,value:t.audienceModes,onChange:e=>h(`audienceModes`,e.target.value),placeholder:u(`activity:memEditor.teachCodeReview`),className:`h-9 bg-background font-mono text-xs`})]})]})]})})]})}function Ze({searchQuery:e,statusFilter:t,kindFilter:n,audienceOnly:r,tagFilter:o,hasFilters:s,allTags:c,stats:d,onSearchChange:f,onStatusFilterChange:p,onKindFilterChange:m,onToggleAudienceOnly:h,onTagFilterChange:g,onClearFilters:ee}){let{t:_}=j(),[v,y]=(0,K.useState)(!!o),b=v||!!o,x=c.length>0;return(0,G.jsxs)(`div`,{className:`shrink-0 space-y-2 overflow-hidden border-b border-border/70 bg-card/45 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(i,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(B,{"aria-label":_(`activity:memoryManager.searchAria`),value:e,onChange:e=>f(e.target.value),placeholder:_(`activity:memoryManager.searchPlaceholder`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,G.jsx)(`button`,{type:`button`,"aria-label":_(`activity:memoryManager.clearSearchAria`),onClick:()=>f(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(l,{className:`size-3.5`})})]}),(0,G.jsx)(z,{variant:r?`default`:`ghost`,size:`icon`,onClick:h,"aria-label":_(`activity:memoryManager.audienceFilterAria`),title:_(`activity:memoryManager.audienceFilterTitle`),className:`shrink-0`,children:(0,G.jsx)(a,{className:`size-4`})}),s&&(0,G.jsx)(z,{variant:`ghost`,size:`icon`,onClick:ee,"aria-label":_(`activity:memoryManager.clearFiltersAria`),title:_(`activity:memoryManager.clearFiltersTitle`),children:(0,G.jsx)(T,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,G.jsx)(`label`,{className:`sr-only`,htmlFor:`memory-status-filter`,children:_(`activity:memoryManager.filterByStatus`)}),(0,G.jsxs)(`select`,{id:`memory-status-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,G.jsx)(`option`,{value:`all`,children:_(`activity:memoryManager.allStatuses`)}),Oe.map(e=>(0,G.jsxs)(`option`,{value:e,children:[e,` · `,d?.byStatus[e]??0]},e))]}),(0,G.jsx)(`label`,{className:`sr-only`,htmlFor:`memory-kind-filter`,children:_(`activity:memoryManager.filterByKind`)}),(0,G.jsxs)(`select`,{id:`memory-kind-filter`,value:n,onChange:e=>m(e.target.value),className:`h-9 min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,G.jsx)(`option`,{value:`all`,children:_(`activity:memoryManager.allKinds`)}),we.map(e=>(0,G.jsxs)(`option`,{value:e,children:[Ae[e],` · `,d?.byKind[e]??0]},e))]})]}),x&&(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{o||y(e=>!e)},"aria-expanded":b,"aria-controls":`memory-tags-panel`,disabled:!!o,className:F(`flex items-center gap-1.5 px-1 py-0.5 text-[10px] uppercase tracking-wide transition-colors`,b?`text-foreground`:`text-muted-foreground hover:text-foreground`,!!o&&`cursor-default`),title:o?`Active filter: ${o} (click the chip to clear)`:b?`Hide tag filters`:`Show tag filters (${c.length})`,children:[(0,G.jsx)(u,{className:F(`size-3 transition-transform`,!b&&`-rotate-90`)}),(0,G.jsx)(k,{className:`size-3`}),(0,G.jsx)(`span`,{className:`font-semibold`,children:_(`activity:memoryManager.tagsLabel`)}),(0,G.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:c.length})]}),o&&(0,G.jsx)(`span`,{role:`status`,"aria-label":`Active tag filter: ${o}`,className:`border border-info/55 bg-info/10 px-1 font-mono text-[9px] uppercase text-info`,children:o})]}),x&&b&&(0,G.jsxs)(`fieldset`,{id:`memory-tags-panel`,className:`min-w-0 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`sr-only`,children:_(`activity:memoryManager.popularTags`)}),(0,G.jsx)(`div`,{className:`no-scrollbar flex gap-1.5 overflow-x-auto pb-0.5`,children:c.slice(0,18).map(([e,t])=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":o===e,onClick:()=>g(o===e?null:e),className:F(`flex shrink-0 items-center gap-1 border px-2 py-1 text-[10px] transition-colors`,o===e?`border-info/55 bg-info/10 text-info`:`border-border/70 bg-background/45 text-muted-foreground hover:border-info/35 hover:text-foreground`),children:[(0,G.jsx)(k,{className:`size-2.5`}),` `,e,(0,G.jsx)(`span`,{className:`font-mono opacity-60`,children:t})]},e))})]})]})}var Qe=100;function $e({memoryListRef:e,memories:t,filteredMemories:n,selectedId:r,onSelectMemory:i,onOpenCreate:a,onClearFilters:o}){let{t:s}=j(),c=n.length>Qe,l=E({count:n.length,getScrollElement:()=>e.current,estimateSize:()=>100,overscan:8,enabled:c});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border/60 px-3 py-2 text-[10px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:s(`activity:memoryManager.memoryCountSummary`,{shown:n.length,total:t.length})}),(0,G.jsx)(`span`,{className:`font-mono uppercase`,children:s(`activity:memoryManager.updatedSortLabel`)})]}),(0,G.jsx)(`section`,{ref:e,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,"aria-label":s(`activity:memoryManager.listAria`),children:n.length===0?(0,G.jsx)(et,{hasMemories:t.length>0,onOpenCreate:a,onClearFilters:o}):c?(0,G.jsx)(`div`,{style:{height:`${l.getTotalSize()}px`,width:`100%`,position:`relative`},children:l.getVirtualItems().map(e=>{let t=n[e.index];return t?(0,G.jsx)(`div`,{"data-index":e.index,ref:l.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,G.jsx)(tt,{memory:t,isSelected:r===t.id,onClick:()=>i(t.id)})},t.id):null})}):n.map(e=>(0,G.jsx)(tt,{memory:e,isSelected:r===e.id,onClick:()=>i(e.id)},e.id))})]})}function et({hasMemories:e,onOpenCreate:t,onClearFilters:n}){let{t:r}=j();return(0,G.jsxs)(`div`,{className:`flex min-h-64 flex-col items-center justify-center px-6 text-center`,children:[(0,G.jsx)(`span`,{className:`flex size-12 items-center justify-center border border-dashed border-border text-muted-foreground`,children:(0,G.jsx)(ee,{className:`size-5`})}),(0,G.jsx)(`h2`,{className:`mt-4 text-sm font-bold`,children:r(e?`activity:memoryManager.noMatching`:`activity:memoryManager.buildGraph`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-xs text-xs leading-5 text-muted-foreground`,children:r(e?`activity:memoryManager.emptyFiltered`:`activity:memoryManager.emptyCapture`)}),(0,G.jsxs)(z,{className:`mt-4`,variant:`outline`,size:`sm`,onClick:e?n:t,children:[e?(0,G.jsx)(T,{className:`size-3.5`}):(0,G.jsx)(O,{className:`size-3.5`}),r(e?`activity:memoryManager.clearFilters`:`activity:memoryManager.createFirst`)]})]})}function tt({memory:e,isSelected:t,onClick:n}){return(0,G.jsxs)(`button`,{type:`button`,"aria-current":t?`true`:void 0,onClick:n,className:F(`group relative block w-full border-b border-border/55 px-3 py-3 text-left transition-[background-color,border-color] hover:bg-info/5`,t&&`bg-info/8`),children:[t&&(0,G.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 bg-info shadow-[0_0_10px_hsl(var(--info)/0.7)]`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:F(`truncate text-[10px] font-bold uppercase tracking-[0.1em]`,Ce(e.kind)),children:Ae[e.kind]??e.kind}),(0,G.jsx)(Te,{status:e.status}),(0,G.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[9px] text-muted-foreground`,children:[`r`,e.revision]})]}),(0,G.jsx)(`p`,{className:F(`mt-2 line-clamp-2 text-xs leading-5 text-foreground/90`,e.status===`deleted`&&`line-through opacity-60`),children:Se(e.text)}),(0,G.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`border border-border/60 bg-background/50 px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:e.scope}),e.audience&&(0,G.jsxs)(`span`,{className:`flex items-center gap-0.5 border border-primary/30 bg-primary/10 px-1.5 py-0.5 font-mono text-[9px] text-primary`,children:[(0,G.jsx)(a,{className:`size-2.5`}),(e.audience.roles??e.audience.taskTypes??e.audience.modes??[]).slice(0,1)[0]??`scoped`]}),e.tags.slice(0,2).map(e=>(0,G.jsxs)(`span`,{className:`max-w-24 truncate border border-border/60 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`#`,e]},e)),e.tags.length>2&&(0,G.jsxs)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:[`+`,e.tags.length-2]}),(0,G.jsx)(`span`,{className:`ml-auto shrink-0 text-[9px] text-muted-foreground`,children:Ne(e.updatedAt)}),(0,G.jsx)(C,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-info`})]})]})}function nt({onCapture:e}){let{t}=j();return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center p-8 text-center`,children:[(0,G.jsxs)(`div`,{className:`relative flex size-20 items-center justify-center border border-info/25 bg-info/5 text-info`,children:[(0,G.jsx)(a,{className:`size-8`}),(0,G.jsx)(`span`,{className:`absolute inset-2 border border-info/10`})]}),(0,G.jsx)(`h2`,{className:`mt-5 text-lg font-bold`,children:t(`activity:memoryManager.emptyTitle`)}),(0,G.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-muted-foreground`,children:t(`activity:memoryManager.emptyBody`)}),(0,G.jsxs)(`div`,{className:`mt-6 grid w-full max-w-lg gap-2 sm:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(d,{className:`mx-auto size-4 text-success`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyVerifiedAnchors`)})]}),(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(a,{className:`mx-auto size-4 text-info`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyTypedRelations`)})]}),(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(O,{className:`mx-auto size-4 text-warning`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyAgentRecall`)})]})]}),(0,G.jsxs)(z,{onClick:e,children:[(0,G.jsx)(O,{className:`size-4`}),` `,t(`activity:memoryManager.captureButton`)]})]})}function rt({wsConnected:e,refreshing:t,onRefresh:n,onCreate:r}){let{t:i}=j(),o=ue(e=>e.setCurrentView);return(0,G.jsxs)(`header`,{className:`relative shrink-0 overflow-hidden border-b border-border/70 bg-card/72 px-4 py-3 backdrop-blur-xl sm:px-5`,children:[(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-0 w-1/2 bg-[radial-gradient(circle_at_right,hsl(var(--info)/0.11),transparent_68%)]`}),(0,G.jsxs)(`div`,{className:`relative flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(z,{variant:`ghost`,size:`icon`,onClick:()=>o(`chat`),"aria-label":i(`activity:memoryManager.backToChat`),title:i(`activity:memoryManager.backToChat`),children:(0,G.jsx)(A,{className:`size-4`})}),(0,G.jsx)(`span`,{className:`flex size-10 items-center justify-center border border-info/40 bg-info/10 text-info shadow-[0_0_20px_hsl(var(--info)/0.12)]`,children:(0,G.jsx)(a,{className:`size-5`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:i(`activity:memoryManager.sageHeading`)}),(0,G.jsx)(`span`,{className:`border border-success/35 bg-success/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-success`,children:i(`activity:memoryManager.projectKnowledge`)})]}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-2xl text-[10px] text-muted-foreground sm:text-xs`,children:i(`activity:memoryManager.sageSubtitle`)})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:F(`hidden items-center gap-1.5 border px-2 py-1 font-mono text-[9px] uppercase sm:flex`,e?`border-success/30 text-success`:`border-warning/30 text-warning`),children:[(0,G.jsx)(`span`,{className:`size-1.5 bg-current`}),` `,i(e?`activity:memoryManager.liveStore`:`activity:memoryManager.reconnecting`)]}),(0,G.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,disabled:t,"aria-label":i(`activity:memoryManager.refreshAria`),children:[(0,G.jsx)(h,{className:F(`size-3.5`,t&&`animate-spin`)}),(0,G.jsx)(`span`,{className:`hidden sm:inline`,children:i(`common:action.refresh`)})]}),(0,G.jsxs)(z,{size:`sm`,onClick:r,children:[(0,G.jsx)(O,{className:`size-3.5`}),` `,i(`activity:memoryManager.newMemory`)]})]})]})]})}function it({stats:e,memories:t,filteredCount:n,allTagsCount:r}){let{t:i}=j(),o=t.filter(e=>e.audience).length,s=new Set;if(o>0){for(let e of t)if(e.audience){for(let t of e.audience.roles??[])s.add(t);for(let t of e.audience.taskTypes??[])s.add(t);for(let t of e.audience.modes??[])s.add(t)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-px border-b border-border/70 bg-border/60 sm:grid-cols-4`,children:[(0,G.jsx)(U,{label:i(`activity:memoryManager.tabMemories`),value:e?.total??t.length,hint:`${n} visible`}),(0,G.jsx)(U,{label:i(`activity:memoryManager.tabActive`),value:e?.byStatus.active??t.filter(e=>e.status===`active`).length,hint:`retrievable`,tone:`success`}),(0,G.jsx)(U,{label:i(`activity:memoryManager.tabNeedsReview`),value:(e?.byStatus.stale??0)+(e?.byStatus.contradicted??0),hint:i(`activity:memoryManager.staleConflicts`),tone:`warning`}),(0,G.jsx)(`div`,{className:`hidden sm:block`,children:(0,G.jsx)(U,{label:i(`activity:memoryManager.tabGraphEdges`),value:e?.edges??0,hint:`${r} tags`,tone:`info`})})]}),o>0&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/70 bg-primary/5 px-4 py-1.5`,children:[(0,G.jsx)(a,{className:`size-3.5 text-primary`}),(0,G.jsxs)(`span`,{className:`text-[11px] font-medium text-primary`,children:[o,` audience-scoped memory`,o===1?``:`ies`]}),s.size>0&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`(`,[...s].sort().join(`, `),`)`]})]})]})}function at({query:e,channel:t,hits:n,loading:r,error:i,onOpenMemory:a,onClear:o}){let{t:s}=j();return e?(0,G.jsxs)(`section`,{"aria-label":s(`activity:memoryManager.searchBreakdownAria`),className:`border-b border-border/60 bg-card/35`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-border/55 px-3 py-2 text-[10px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(S,{className:`size-3 text-info`}),(0,G.jsx)(`span`,{className:`font-mono uppercase tracking-[0.1em]`,children:s(`activity:memoryManager.searchBreakdownTitle`,{query:e})}),t===`breakdown`&&(0,G.jsx)(`span`,{className:`border border-info/40 bg-info/8 px-1.5 py-0.5 font-mono text-[9px] uppercase text-info`,children:s(`activity:memoryManager.searchBreakdownDual`)}),t===`lexical`&&(0,G.jsx)(`span`,{className:`border border-border/60 px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:s(`activity:memoryManager.searchBreakdownLexicalOnly`)})]}),(0,G.jsx)(`button`,{type:`button`,onClick:o,className:`font-mono text-[10px] uppercase text-muted-foreground hover:text-foreground`,children:s(`common:action.close`)})]}),r&&(0,G.jsx)(`p`,{className:`px-3 py-3 text-[10px] text-muted-foreground`,children:s(`activity:memoryManager.searchBreakdownLoading`)}),i&&(0,G.jsx)(`p`,{className:`border-t border-border/55 px-3 py-2 text-[10px] text-destructive`,role:`alert`,children:i}),!r&&!i&&n.length===0&&(0,G.jsx)(`p`,{className:`px-3 py-3 text-[10px] text-muted-foreground`,children:s(`activity:memoryManager.searchBreakdownEmpty`)}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:n.map(e=>(0,G.jsx)(ot,{hit:e,onOpenMemory:a},e.memory.id))})]}):null}function ot({hit:e,onOpenMemory:t}){let{t:n}=j(),r=st(e.lexicalScore),i=st(e.vectorScore),a=st(e.finalScore),{accent:o,label:s}=ct(e.source);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(e.memory.id),className:`group flex w-full min-w-0 items-start gap-3 px-3 py-2.5 text-left hover:bg-info/5`,children:[(0,G.jsx)(`span`,{className:F(`flex size-7 shrink-0 items-center justify-center border font-mono text-[9px] uppercase`,o),title:n(`activity:memoryManager.searchBreakdownSourceLabel`,{source:s}),children:e.source===`vector`?(0,G.jsx)(S,{className:`size-3.5`}):e.source===`both`?(0,G.jsx)(p,{className:`size-3.5`}):(0,G.jsx)(b,{className:`size-3.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`line-clamp-2 text-[11px] leading-5 text-foreground/90`,children:e.memory.text}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[9px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`L`}),(0,G.jsx)(`span`,{className:`tabular-nums text-foreground/80`,children:r})]}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`V`}),(0,G.jsx)(`span`,{className:F(`tabular-nums`,e.vectorScore===null?`text-muted-foreground/50`:`text-foreground/80`),children:i})]}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`RRF`}),(0,G.jsx)(`span`,{className:`tabular-nums font-bold text-foreground`,children:a})]}),(0,G.jsx)(`span`,{className:`ml-auto uppercase text-[9px]`,children:s})]})]})]})})}function st(e){return e===null?`—`:`${Math.round(e*100)}%`}function ct(e){switch(e){case`vector`:return{accent:`border-accent/40 bg-accent/10 text-accent`,label:`vector`};case`both`:return{accent:`border-info/40 bg-info/10 text-info`,label:`both`};default:return{accent:`border-border/60 bg-background text-muted-foreground`,label:`lexical`}}}function lt({listCandidates:e,resolveCandidate:t,onOpenMemory:n,client:r,active:i}){let{t:a}=j(),[o,s]=(0,K.useState)([]),[u,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(null),[g,ee]=(0,K.useState)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(()=>new Set),S=(0,K.useRef)(0),C=(0,K.useCallback)(()=>{let t=++S.current;f(!0),m(null);let n=r.on(`memory.sage.listCandidates`,e=>{if(t===S.current){if(n(),e.payload.error)m(String(e.payload.error)),s([]);else{let t=(Array.isArray(e.payload.candidates)?e.payload.candidates:[]).filter(e=>e.status===`pending`);s(t),x(e=>{let n=new Set;for(let r of e)t.some(e=>e.id===r)&&n.add(r);return n})}f(!1)}}),i=setTimeout(()=>{t===S.current&&(n(),f(!1),m(a(`activity:memoryManager.reviewLoadTimeout`)))},15e3);return e({includeResolved:!1},{echoToChat:!1}),()=>{clearTimeout(i),n()}},[r,e,a]);(0,K.useEffect)(()=>{if(i)return C()},[i,C]);let w=(0,K.useCallback)((e,n)=>new Promise(i=>{let a=r.on(`memory.sage.candidateResolve`,e=>{a();let t=e.payload.error;i(!t)});t({candidateId:e,action:n,reason:n===`reject`?`Rejected via Memory Review tab`:void 0},{echoToChat:!1}),setTimeout(()=>{a(),i(!1)},15e3)}),[r,t]),T=(0,K.useCallback)(async(e,t)=>{ee(e),await w(e,t),ee(null),C()},[C,w]),E=(0,K.useCallback)(async e=>{let t=[...b];if(t.length!==0){y(!0);for(let n of t)await w(n,e);y(!1),x(new Set),C()}},[C,w,b]),D=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},te=()=>{x(new Set(o.map(e=>e.id)))},O=()=>x(new Set);if(u&&o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 p-6 text-sm text-muted-foreground`,children:[(0,G.jsx)(c,{className:`size-4 animate-spin`}),a(`activity:memoryManager.reviewLoading`)]});if(p&&o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,G.jsx)(_,{className:`size-5 text-warning`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p}),(0,G.jsxs)(z,{size:`sm`,variant:`outline`,onClick:()=>C(),children:[(0,G.jsx)(h,{className:`size-3.5`}),` `,a(`common:action.retry`)]})]});if(o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,G.jsx)(d,{className:`size-6 text-success`}),(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:a(`activity:memoryManager.reviewEmptyTitle`)}),(0,G.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:a(`activity:memoryManager.reviewEmptyHint`)}),(0,G.jsxs)(z,{size:`sm`,variant:`ghost`,onClick:()=>C(),children:[(0,G.jsx)(h,{className:`size-3.5`}),` `,a(`common:action.refresh`)]})]});let k=b.size,A=k===o.length&&o.length>0;return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:a(`activity:memoryManager.reviewPendingCount`,{count:o.length})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,G.jsx)(z,{size:`sm`,variant:`ghost`,className:`h-7 text-[11px]`,onClick:A?O:te,children:a(A?`activity:memoryManager.reviewClearSelection`:`activity:memoryManager.reviewSelectAll`)}),(0,G.jsxs)(z,{size:`sm`,className:`h-7`,disabled:k===0||v,onClick:()=>void E(`accept`),children:[v?(0,G.jsx)(c,{className:`size-3 animate-spin`}):(0,G.jsx)(d,{className:`size-3`}),a(`activity:memoryManager.reviewBulkAccept`),k>0?` (${k})`:``]}),(0,G.jsxs)(z,{size:`sm`,variant:`outline`,className:`h-7`,disabled:k===0||v,onClick:()=>void E(`reject`),children:[(0,G.jsx)(l,{className:`size-3`}),a(`activity:memoryManager.reviewBulkKeep`),k>0?` (${k})`:``]}),(0,G.jsx)(z,{size:`sm`,variant:`ghost`,className:`h-7`,onClick:()=>C(),disabled:u,children:(0,G.jsx)(h,{className:F(`size-3.5`,u&&`animate-spin`)})})]})]}),(0,G.jsx)(`ul`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-3`,children:o.map(e=>{let t=e.targetMemoryId??e.memoryId,r=e.reviewReason??e.reason??``,i=g===e.id||v,o=b.has(e.id);return(0,G.jsx)(`li`,{className:F(`rounded-md border bg-card/60 p-3 text-sm shadow-sm`,o?`border-primary/50 ring-1 ring-primary/20`:`border-border/70`),children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-3.5 accent-primary`,checked:o,disabled:v,onChange:()=>D(e.id),"aria-label":a(`activity:memoryManager.reviewSelectOne`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-mono text-warning`,children:e.suggestedAction??`review`}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`span`,{children:Ne(e.createdAt)}),e.tags?.includes(`triage`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`span`,{className:`text-info`,children:`triage`})]})]}),(0,G.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-snug text-foreground`,children:Se(e.text,220)}),r?(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:r}):null,t?(0,G.jsxs)(`button`,{type:`button`,className:`mt-1 font-mono text-[10px] text-primary hover:underline`,onClick:()=>n?.(t),children:[t.slice(0,16),`…`]}):null,(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[(0,G.jsxs)(z,{size:`sm`,className:`h-7`,disabled:i,onClick:()=>void T(e.id,`accept`),children:[g===e.id?(0,G.jsx)(c,{className:`size-3 animate-spin`}):(0,G.jsx)(d,{className:`size-3`}),a(`activity:memoryManager.actionAcceptDeletion`)]}),(0,G.jsxs)(z,{size:`sm`,variant:`outline`,className:`h-7`,disabled:i,onClick:()=>void T(e.id,`reject`),children:[(0,G.jsx)(l,{className:`size-3`}),a(`activity:memoryManager.actionKeep`)]})]})]})]})},e.id)})})]})}function ut(e,t){let n=t.searchQuery.trim().toLowerCase();return e.filter(e=>{if(t.statusFilter!==`all`&&e.status!==t.statusFilter||t.kindFilter!==`all`&&e.kind!==t.kindFilter||t.tagFilter&&!e.tags.includes(t.tagFilter)||t.audienceOnly&&!e.audience)return!1;if(!n)return!0;let r=e.anchors.map(e=>[e.path,e.symbol,e.command,e.role].filter(Boolean).join(` `)).join(` `),i=e.audience?[e.audience.roles?.join(` `)??``,e.audience.taskTypes?.join(` `)??``,e.audience.modes?.join(` `)??``].join(` `):``;return[e.id,e.text,e.summary??``,e.kind,e.scope,e.tags.join(` `),r,i].join(` `).toLowerCase().includes(n)})}function dt(e){let t=new Map;for(let n of e)for(let e of n.tags)t.set(e,(t.get(e)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}function ft(e){if(!e)return[];let t=[];e.supersededBy&&t.push({relation:`Superseded by`,id:e.supersededBy});for(let n of e.supersedes??[])t.push({relation:`Supersedes`,id:n});for(let n of e.contradicts??[])t.push({relation:`Contradicts`,id:n});return t}var pt=100;function mt(){let{t:e}=j(),{client:n,listSageMemoriesPage:r,listMemoryCandidates:i,rememberSage:a,updateSage:o,deleteSage:s,getSageGraph:c,recoverSage:l,resolveMemoryCandidate:u,searchSageBreakdown:d}=he(),f=t(e=>e.wsConnected),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(null),[ee,_]=(0,K.useState)(!0),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),[te,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[ne,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(!1),[oe,M]=(0,K.useState)(!1),[N,se]=(0,K.useState)(!1),[P,ce]=(0,K.useState)(xe),[le,F]=(0,K.useState)(xe),[ue,I]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),[L,pe]=(0,K.useState)({hits:[],channel:void 0,loading:!1,error:null}),[R,me]=(0,K.useState)(``),[z,B]=(0,K.useState)(`all`),[V,ge]=(0,K.useState)(`all`),[ve,ye]=(0,K.useState)(!1),[H,Se]=(0,K.useState)(null),[Ce,we]=(0,K.useState)(`active`),Te=Ce===`deleted`,Ee=Ce===`review`,[De,Oe]=(0,K.useState)(null),[ke,Ae]=(0,K.useState)(!1),[U,je]=(0,K.useState)(!1),[Me,Ne]=(0,K.useState)({}),[Pe,G]=(0,K.useState)(!1),[Fe,Ie]=(0,K.useState)(null),Le=(0,K.useRef)(!1),Re=(0,K.useRef)([]),ze=(0,K.useRef)(0),q=(0,K.useRef)(null),J=(0,K.useRef)(!0),Be=(0,K.useRef)(0),Y=(0,K.useRef)(0),Ve=(0,K.useRef)(null),X=(0,K.useRef)(null),He=(0,K.useMemo)(()=>{let e=new Set;for(let t of p)for(let n of t.anchors??[])n.type===`file`&&n.path&&e.add(n.path);return e},[p]),Ue=(0,K.useMemo)(()=>JSON.stringify(P)!==JSON.stringify(le),[le,P]),We=(0,K.useCallback)(e=>p.find(t=>t.id===e)??L.hits.find(t=>t.memory.id===e)?.memory??k.find(t=>t.id===e)??null,[k,p,L.hits]),Z=(0,K.useMemo)(()=>E===null?null:We(E),[We,E]),Ge=(0,K.useCallback)(e=>{let t=e!==null,i=++Be.current;Ve.current?.(),x(null),t?je(!0):(y(!0),Le.current||_(!0));let a=()=>{},o=null,s=!1,c=()=>{s||(s=!0,o!==null&&clearTimeout(o),a(),Ve.current===c&&(Ve.current=null))};a=n.on(`memory.sage.listPage`,e=>{if(i!==Be.current||!J.current){c();return}if(c(),e.payload.error)x(e.payload.error);else{let n=e.payload.memories??[];m(e=>t?[...e,...n]:n),Oe(e.payload.nextCursor??null),Ae(!!e.payload.nextCursor);let r=e.payload.statusCounts??{};Ne(r);let i=Object.values(r).reduce((e,t)=>e+t,0);e.payload.stats?g(e.payload.stats):g(e=>({total:i,byStatus:r,byKind:e?.byKind??{},edges:e?.edges??0})),Le.current=!0,t||D(e=>e&&(n.some(t=>t.id===e)||Re.current.some(t=>t.memory.id===e))?e:null)}_(!1),y(!1),je(!1)}),o=setTimeout(()=>{i===Be.current&&J.current&&(c(),x(`The memory store did not respond. Check the WebSocket connection and try again.`),_(!1),y(!1),je(!1))},2e4),Ve.current=c,r({limit:pt,...Te?{statuses:[`deleted`]}:{},...e?{cursor:e}:{},...R.trim()?{query:R.trim()}:{},...V===`all`?{}:{kind:V}},{echoToChat:!1})},[n,V,r,R,Te]),Q=(0,K.useCallback)(()=>{Oe(null),Ae(!1),Ge(null)},[Ge]),Ke=(0,K.useCallback)(()=>{!U&&De&&Ge(De)},[Ge,U,De]);(0,K.useEffect)(()=>(J.current=!0,Q(),()=>{J.current=!1,Be.current+=1,Y.current+=1,Ve.current?.(),X.current?.(),q.current?.()}),[Q]),(0,K.useEffect)(()=>{let e=R.trim();if(q.current?.(),e.length===0){pe({hits:[],channel:void 0,loading:!1,error:null});return}let t=++ze.current;pe(e=>({...e,loading:!0,error:null}));let r=()=>{},i=()=>{q.current===i&&(q.current=null),r()};q.current=i,r=n.on(`memory.sage.searchBreakdown`,e=>{if(t!==ze.current||!J.current){i();return}if(i(),e.payload.error){pe({hits:[],channel:void 0,loading:!1,error:e.payload.error});return}pe({hits:e.payload.hits??[],channel:e.payload.source,loading:!1,error:null})}),d({query:e,limit:20})},[R,n,d]),(0,K.useEffect)(()=>{Re.current=L.hits},[L.hits]),(0,K.useEffect)(()=>{if(O([]),A([]),re(null),!E){ae(!1);return}let e=E;ae(!0);let t=null,r=n.on(`memory.sage.graph`,n=>{n.payload.query===e&&(t!==null&&clearTimeout(t),O(n.payload.edges??[]),A(n.payload.memories??[]),re(n.payload.error??null),ae(!1))});return t=setTimeout(()=>{re(`Relationship graph did not respond in time.`),ae(!1)},15e3),c(e,{maxDepth:1,limit:120},{echoToChat:!1}),()=>{t!==null&&clearTimeout(t),r()}},[n,c,E]);let qe=(0,K.useRef)(f);(0,K.useEffect)(()=>{f&&!qe.current&&Le.current&&Q(),qe.current=f},[Q,f]),(0,K.useEffect)(()=>{if(!w)return;let e=setTimeout(()=>T(null),4e3);return()=>clearTimeout(e)},[w]);let $=(0,K.useCallback)(()=>!Ue||!oe&&!N||window.confirm(`Discard the unsaved memory changes?`),[N,Ue,oe]),Je=(0,K.useCallback)(()=>{if(!$())return;let e=xe();ce(e),F(e),se(!0),M(!1),D(null),C(null)},[$]),Ye=(0,K.useCallback)(e=>{$()&&(D(e),se(!1),M(!1),C(null))},[$]),Xe=(0,K.useCallback)(e=>{let t=e===void 0?Z:We(e);if(!t||t.status===`deleted`)return;e!==void 0&&D(e);let n=be(t);ce(n),F(n),M(!0),se(!1),C(null)},[We,Z]),Ze=(0,K.useCallback)(()=>{$()&&(M(!1),se(!1),C(null))},[$]),Qe=(0,K.useCallback)((t,r,i)=>{if(!P.text.trim()){C(`Memory content is required.`);return}let a=++Y.current;X.current?.(),I(i),C(null),T(null);let o=()=>{},s=null,c=!1,l=()=>{c||(c=!0,s!==null&&clearTimeout(s),o(),X.current===l&&(X.current=null))},u=t=>{if(a!==Y.current||!J.current){l();return}if(l(),I(null),t.payload.error||!t.payload.memory){C(t.payload.error??`The server returned no memory record.`);return}let n=t.payload.memory;m(e=>{let t=e.filter(e=>e.id!==n.id);return[n,...t]}),D(n.id),se(!1),M(!1),T(e(i===`create`?`activity:memoryManager.memoryCaptured`:`activity:memoryManager.memoryUpdated`)),Q()};o=t===`memory.sage.remember`?n.on(`memory.sage.remember`,u):n.on(`memory.sage.update`,u),s=setTimeout(()=>{a===Y.current&&J.current&&(l(),I(null),C(e(`activity:memoryManager.mutationTimeout`,{verb:e(i===`create`?`activity:memoryManager.createAction`:`common:action.save`)})))},2e4),X.current=l,r()},[n,P.text,Q,e]),$e=(0,K.useCallback)(()=>{Qe(`memory.sage.remember`,()=>a({text:P.text.trim(),kind:P.kind,scope:P.scope,tags:W(P.tags),importance:P.importance,confidence:P.confidence,freshness:P.freshness,anchors:_e(P.anchors),...W(P.audienceRoles).length||W(P.audienceTaskTypes).length||W(P.audienceModes).length?{audience:{roles:W(P.audienceRoles),taskTypes:W(P.audienceTaskTypes),modes:W(P.audienceModes)}}:{},supersedes:W(P.supersedes),contradicts:W(P.contradicts)},{echoToChat:!1}),`create`)},[P,a,Qe]),et=(0,K.useCallback)(()=>{Z&&Qe(`memory.sage.update`,()=>o(Z.id,{text:P.text.trim(),kind:P.kind,status:P.status,tags:W(P.tags),importance:P.importance,confidence:P.confidence,freshness:P.freshness,anchors:_e(P.anchors),...W(P.audienceRoles).length||W(P.audienceTaskTypes).length||W(P.audienceModes).length?{audience:{roles:W(P.audienceRoles),taskTypes:W(P.audienceTaskTypes),modes:W(P.audienceModes)}}:{},supersedes:W(P.supersedes),contradicts:W(P.contradicts)},{echoToChat:!1}),`update`)},[P,Qe,Z,o]),tt=(0,K.useCallback)(()=>{if(!de)return;let e=++Y.current;X.current?.(),I(`delete`),C(null);let t=()=>{},r=null,i=!1,a=()=>{i||(i=!0,r!==null&&clearTimeout(r),t(),X.current===a&&(X.current=null))};t=n.on(`memory.sage.delete`,t=>{if(e!==Y.current||!J.current){a();return}if(a(),I(null),!t.payload.success){C(t.payload.message||`Delete failed.`);return}fe(null),D(null),M(!1),T(`Memory deleted and relationship edges cleaned up.`),Q()}),r=setTimeout(()=>{e===Y.current&&J.current&&(a(),I(null),C(`Delete timed out. The memory may still exist; refresh to confirm.`))},2e4),X.current=a,s(de,`Deleted from the WebUI Memory Manager.`)},[n,s,de,Q]),nt=(0,K.useCallback)((e,t,r)=>{let i=++Y.current;X.current?.(),C(null);let a=()=>{},o=null,s=!1,c=()=>{s||(s=!0,o!==null&&clearTimeout(o),a(),X.current===c&&(X.current=null))};a=n.on(e,e=>{if(i!==Y.current||!J.current){c();return}c(),r(e.payload)}),o=setTimeout(()=>{i===Y.current&&J.current&&(c(),C(`The memory store did not respond. Check the WebSocket connection and try again.`))},2e4),X.current=c,t()},[n]),rt=(0,K.useMemo)(()=>ut(p,{searchQuery:R,statusFilter:z,kindFilter:V,tagFilter:H,audienceOnly:ve}),[ve,V,p,R,z,H]),it=(0,K.useMemo)(()=>dt(p),[p]),at=(0,K.useMemo)(()=>ft(Z),[Z]),ot=(0,K.useCallback)(()=>{me(``),B(`all`),ge(`all`),ye(!1),Se(null)},[]);return{client:n,wsConnected:f,memories:p,stats:h,initialLoading:ee,refreshing:v,loadError:b,mutationError:S,setMutationError:C,notice:w,setNotice:T,selectedId:E,setSelectedId:D,selectedMemory:Z,graphEdges:te,graphMemories:k,graphError:ne,graphLoading:ie,editing:oe,creating:N,draft:P,setDraft:ce,busyAction:ue,deletingId:de,setDeletingId:fe,searchQuery:R,setSearchQuery:me,searchBreakdown:L,clearSearchBreakdown:()=>{ze.current+=1,q.current?.(),pe({hits:[],channel:void 0,loading:!1,error:null})},statusFilter:z,setStatusFilter:B,kindFilter:V,setKindFilter:ge,audienceOnly:ve,setAudienceOnly:ye,tagFilter:H,setTagFilter:Se,libraryView:Ce,setLibraryView:we,showDeleted:Te,showReview:Ee,hasMore:ke,loadingMore:U,statusCounts:Me,drawerOpen:Pe,setDrawerOpen:G,currentFilePath:Fe,setCurrentFilePath:Ie,knownFilePaths:He,filteredMemories:rt,allTags:it,relatedMemories:at,hasFilters:!!(R||z!==`all`||V!==`all`||H||ve),detailOpen:N||!!Z,drawerActive:Pe&&!!Fe,loadMemories:Q,loadMore:Ke,openCreate:Je,openMemory:Ye,openEdit:Xe,cancelEditor:Ze,submitCreate:$e,submitUpdate:et,confirmDelete:tt,sendWithAck:nt,clearFilters:ot,resolveMemoryCandidate:u,updateSage:o,recoverSage:l,listMemoryCandidates:i}}function ht(){let{t:e}=j(),t=ue(e=>e.setCurrentView),n=V(`memory`),r=mt();return r.initialLoading&&r.memories.length===0?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-busy":`true`,children:[(0,G.jsxs)(`div`,{className:`border-b border-border/70 bg-card/70 px-5 py-4`,children:[(0,G.jsx)(`div`,{className:`h-3 w-28 animate-pulse bg-muted`}),(0,G.jsx)(`div`,{className:`mt-3 h-7 w-56 animate-pulse bg-muted`})]}),(0,G.jsxs)(`div`,{className:`grid flex-1 gap-px bg-border/60 md:grid-cols-[minmax(300px,0.82fr)_minmax(0,1.35fr)]`,children:[(0,G.jsx)(`div`,{className:`space-y-px bg-background p-4`,children:Array.from({length:7},(e,t)=>(0,G.jsx)(`div`,{className:`h-24 animate-pulse border border-border/60 bg-card/45`},t))}),(0,G.jsx)(`div`,{className:`hidden bg-background p-6 md:block`,children:(0,G.jsx)(`div`,{className:`h-full animate-pulse border border-border/60 bg-card/35`})})]}),(0,G.jsx)(`span`,{className:`sr-only`,role:`status`,children:e(`activity:memoryManager.loadingSageContent`)})]}):r.loadError&&r.memories.length===0?(0,G.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background p-6`,children:(0,G.jsxs)(`div`,{className:`max-w-md border border-destructive/35 bg-card p-6 shadow-2xl`,children:[(0,G.jsx)(`span`,{className:`flex size-11 items-center justify-center border border-destructive/35 bg-destructive/10 text-destructive`,children:(0,G.jsx)(_,{className:`size-5`})}),(0,G.jsx)(`h2`,{className:`mt-4 text-lg font-bold`,children:e(`activity:memoryManager.storeUnavailable`)}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-muted-foreground`,children:r.loadError}),(0,G.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,G.jsxs)(z,{onClick:r.loadMemories,children:[(0,G.jsx)(h,{className:`size-4`}),` `,e(`common:action.retry`)]}),(0,G.jsxs)(z,{variant:`outline`,onClick:()=>t(`chat`),children:[(0,G.jsx)(A,{className:`size-4`}),` `,e(`activity:memoryManager.backToChat`)]})]})]})}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-background`,children:[(0,G.jsx)(rt,{wsConnected:r.wsConnected,refreshing:r.refreshing,onRefresh:r.loadMemories,onCreate:r.openCreate}),(0,G.jsx)(it,{stats:r.stats,memories:r.memories,filteredCount:r.filteredMemories.length,allTagsCount:r.allTags.length}),(r.notice||r.loadError||r.mutationError)&&(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[r.notice&&(0,G.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-success`,children:[(0,G.jsx)(d,{className:`size-3.5`}),` `,r.notice]}),r.loadError&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-warning`,children:[(0,G.jsx)(_,{className:`size-3.5`}),` `,r.loadError,` Existing content remains available.`]}),r.mutationError&&!r.editing&&!r.creating&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,G.jsx)(_,{className:`size-3.5`}),` `,r.mutationError]})]}),(0,G.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(320px,0.82fr)_minmax(0,1.35fr)]`,children:[(0,G.jsxs)(`section`,{className:F(`min-h-0 border-r border-border/70 bg-card/25`,r.detailOpen?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:memoryManager.libraryAria`),children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-border/60 px-3 pt-1`,role:`tablist`,"aria-label":e(`activity:memoryManager.viewAria`),children:[(0,G.jsx)(z,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.libraryView===`active`,onClick:()=>r.setLibraryView(`active`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.libraryView===`active`?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:e(`activity:memoryManager.tabActive`)}),(0,G.jsx)(z,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.showReview,onClick:()=>r.setLibraryView(`review`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.showReview?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:e(`activity:memoryManager.tabReview`)}),(0,G.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.showDeleted,onClick:()=>r.setLibraryView(`deleted`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.showDeleted?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:[e(`activity:memoryManager.tabDeleted`),typeof r.statusCounts.deleted==`number`?` (${r.statusCounts.deleted})`:``]})]}),r.showReview?(0,G.jsx)(lt,{active:r.showReview,client:r.client,listCandidates:r.listMemoryCandidates,resolveCandidate:r.resolveMemoryCandidate,onOpenMemory:r.openMemory}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ze,{searchQuery:r.searchQuery,statusFilter:r.statusFilter,kindFilter:r.kindFilter,audienceOnly:r.audienceOnly,tagFilter:r.tagFilter,hasFilters:r.hasFilters,allTags:r.allTags,stats:r.stats,onSearchChange:r.setSearchQuery,onStatusFilterChange:r.setStatusFilter,onKindFilterChange:r.setKindFilter,onToggleAudienceOnly:()=>r.setAudienceOnly(e=>!e),onTagFilterChange:r.setTagFilter,onClearFilters:r.clearFilters}),(0,G.jsx)($e,{memoryListRef:n,memories:r.memories,filteredMemories:r.filteredMemories,selectedId:r.selectedId,onSelectMemory:r.openMemory,onOpenCreate:r.openCreate,onClearFilters:r.clearFilters}),r.searchQuery.trim().length>0&&(0,G.jsx)(at,{query:r.searchQuery.trim(),channel:r.searchBreakdown.channel,hits:r.searchBreakdown.hits,loading:r.searchBreakdown.loading,error:r.searchBreakdown.error,onOpenMemory:r.openMemory,onClear:r.clearSearchBreakdown}),r.hasMore?(0,G.jsx)(`div`,{className:`shrink-0 border-t border-border/60 p-2`,children:(0,G.jsx)(z,{type:`button`,variant:`outline`,size:`sm`,onClick:r.loadMore,disabled:r.loadingMore,className:`h-7 w-full text-[11px]`,children:r.loadingMore?e(`common:action.loading`):`Load more (${r.memories.length} loaded)`})}):null]})]}),(0,G.jsxs)(`section`,{className:F(`min-h-0 bg-background`,r.detailOpen?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:memoryManager.detailAria`),children:[r.memories.some(e=>(e.anchors??[]).some(e=>e.type===`file`&&e.path))&&(0,G.jsx)(Ye,{currentFilePath:r.currentFilePath,knownFilePaths:r.knownFilePaths,drawerActive:r.drawerActive,onFilePathChange:e=>{e&&r.knownFilePaths.has(e)?(r.setCurrentFilePath(e),r.setDrawerOpen(!0)):e?r.setCurrentFilePath(e):r.setCurrentFilePath(null)},onToggleDrawer:()=>{r.currentFilePath&&r.setDrawerOpen(e=>!e)}}),r.creating?(0,G.jsx)(Xe,{mode:`create`,draft:r.draft,busy:r.busyAction===`create`,error:r.mutationError,onChange:r.setDraft,onCancel:r.cancelEditor,onSubmit:r.submitCreate}):r.selectedMemory?r.editing?(0,G.jsx)(Xe,{mode:`edit`,draft:r.draft,busy:r.busyAction===`update`,error:r.mutationError,onChange:r.setDraft,onCancel:r.cancelEditor,onSubmit:r.submitUpdate}):r.drawerActive?(0,G.jsx)(Pe,{filePath:r.currentFilePath,open:r.drawerActive,onClose:()=>r.setDrawerOpen(!1),onShowMemory:e=>r.setSelectedId(e),onAcceptDeletion:(e,t)=>{r.sendWithAck(`memory.sage.candidateResolve`,()=>r.resolveMemoryCandidate({candidateId:e,action:`accept`}),n=>{if(n.error){r.setMutationError(n.error);return}r.setNotice(`Accepted hygiene review for ${t.slice(0,12)}… (candidate ${e.slice(0,12)}…).`),r.loadMemories()})},onKeep:(e,t)=>{r.sendWithAck(`memory.sage.candidateResolve`,()=>r.resolveMemoryCandidate({candidateId:e,action:`reject`}),n=>{if(n.error){r.setMutationError(n.error);return}r.setNotice(`Kept ${t.slice(0,12)}… (candidate ${e.slice(0,12)}… rejected).`),r.loadMemories()})},onUpdate:e=>{r.openEdit(e)},onMarkPermanent:e=>{r.sendWithAck(`memory.sage.update`,()=>r.updateSage(e,{persistence:`permanent`}),t=>{if(t.error||!t.memory){r.setMutationError(t.error??`The server returned no memory record.`);return}r.setNotice(`Memory ${e.slice(0,12)}… promoted to permanent.`),r.loadMemories()})},onRecover:e=>{r.sendWithAck(`memory.sage.recover`,()=>r.recoverSage({id:e,reason:`recovered via file drawer`}),t=>{if(t.error){r.setMutationError(t.error);return}r.setNotice(`Recovered ${e.slice(0,12)}…`),r.loadMemories()})}}):(0,G.jsx)(We,{memory:r.selectedMemory,allMemories:[...r.memories,...r.graphMemories],relatedMemories:r.relatedMemories,graphEdges:r.graphEdges,graphLoading:r.graphLoading,graphError:r.graphError,onClose:()=>r.setSelectedId(null),onOpenMemory:r.openMemory,onEdit:r.openEdit,onDelete:()=>r.setDeletingId(r.selectedMemory.id),onTagSelect:e=>{r.setTagFilter(e),r.setSelectedId(null)},onNotice:r.setNotice}):(0,G.jsx)(nt,{onCapture:r.openCreate})]})]}),(0,G.jsx)(Fe,{busyAction:r.busyAction,deletingId:r.deletingId,memory:r.selectedMemory,onCancel:()=>r.setDeletingId(null),onConfirm:r.confirmDelete,onOpenChange:e=>{!e&&r.busyAction!==`delete`&&r.setDeletingId(null)}})]})}export{ht as MemoryManager};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{U as t,mt as n,t as r}from"./config-store-D7yrCV2X.js";import{i,t as a}from"./react-core-wiHys0m2.js";import{La as o,_t as s,jt as c,wt as l}from"./vendor-BO-lHyIr.js";import"./i18n-B_njdXiH.js";import{t as u}from"./utils-DQbrPaAM.js";import"./stores-COxKgvNx.js";import{n as d,o as f,r as p,t as m}from"./dialog-CTmNJKRN.js";import{I as h}from"./index-CfREDCPe.js";var g=e(i(),1),_=a();function v({open:e,onClose:i,className:a}){let{t:v}=o(),[y,b]=(0,g.useState)([]),x=n(),S=h(),C=r(e=>e.wsConnected),w=(0,g.useRef)(null),T=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!e||!C||!S.client?.isConnected)return;b([]);let n=()=>{let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.list`,payload:e})};return n(),w.current=S.client.on?.(`process.list`,e=>{let n=e?.payload;n?.processes&&t(n.sessionId,x)&&b(n.processes)})??null,T.current=setInterval(n,3e3),()=>{w.current?.(),T.current&&clearInterval(T.current)}},[e,C,S.client,x]);let E=y.filter(e=>e.status===`running`),D=(0,g.useCallback)(e=>{if(e.background&&!window.confirm(v(`activity:process.confirmKillBackground`,{pid:e.pid,defaultValue:`Terminate detached background process ${e.pid}?`})))return;let t=S.client.withSession?.({pid:e.pid})??{pid:e.pid};S.client.send?.({type:`process.kill`,payload:t})},[v,S.client]),O=(0,g.useCallback)(()=>{if(!window.confirm(v(`activity:process.confirmKillAll`,{count:E.length,defaultValue:`Terminate all ${E.length} running processes?`})))return;let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.killAll`,payload:e})},[E.length,v,S.client,x]);return(0,_.jsx)(m,{open:e,onOpenChange:e=>{e||i()},children:(0,_.jsxs)(d,{className:u(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,a),showCloseButton:!1,children:[(0,_.jsx)(f,{className:`sr-only`,children:v(`activity:process.heading`)}),(0,_.jsx)(p,{className:`sr-only`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})}),(0,_.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,_.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-warning/10 text-warning`,children:(0,_.jsx)(s,{className:`h-4 w-4`})}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:process.heading`)}),(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})})]})]}),(0,_.jsx)(`div`,{className:`flex items-center gap-1`,children:E.length>0&&(0,_.jsxs)(`button`,{type:`button`,onClick:O,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,_.jsx)(l,{className:`h-3 w-3 fill-current`}),v(`activity:process.killAll`)]})})]}),(0,_.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:y.length===0?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,_.jsx)(s,{className:`h-10 w-10 opacity-15`}),(0,_.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:process.emptyTitle`)}),(0,_.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:process.emptyBody`)})]}):(0,_.jsx)(`div`,{className:`divide-y`,children:y.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,r=e.protected===!0,i=e.background===!0;return(0,_.jsxs)(`div`,{className:u(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,_.jsx)(`span`,{className:u(`led shrink-0`,e.status===`running`?r?`text-info`:`text-success led-pulse`:`text-muted-foreground`)}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:v(`activity:process.pidLabel`,{pid:e.pid})}),(0,_.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),r&&(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-info/10 text-info font-medium shrink-0`,title:v(`activity:process.protectedTitle`),children:[(0,_.jsx)(c,{className:`h-2.5 w-2.5`}),v(`activity:process.protected`)]}),i&&(0,_.jsx)(`span`,{className:`inline-flex items-center px-1 py-0.5 rounded text-[9px] bg-success/10 text-success font-medium shrink-0`,title:v(`activity:process.backgroundTitle`),children:v(`activity:process.background`)})]}),(0,_.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!r&&(0,_.jsx)(`button`,{type:`button`,onClick:()=>D(e),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:process.killTitle`,{pid:e.pid}),children:(0,_.jsx)(l,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{v as ProcessMonitor};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{U as t,mt as n,t as r}from"./config-store-BAUadwHd.js";import{i,t as a}from"./react-core-wiHys0m2.js";import{cn as o,hn as s,tn as c,xo as l}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{t as u}from"./utils-CKsqCaP8.js";import"./stores-BIVCS5nu.js";import{n as d,o as f,r as p,t as m}from"./dialog-C7EIBM_2.js";import{L as h}from"./index-BhXxZMAb.js";var g=e(i(),1),_=a();function v({open:e,onClose:i,className:a}){let{t:v}=l(),[y,b]=(0,g.useState)([]),x=n(),S=h(),C=r(e=>e.wsConnected),w=(0,g.useRef)(null),T=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!e||!C||!S.client?.isConnected)return;b([]);let n=()=>{let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.list`,payload:e})};return n(),w.current=S.client.on?.(`process.list`,e=>{let n=e?.payload;n?.processes&&t(n.sessionId,x)&&b(n.processes)})??null,T.current=setInterval(n,3e3),()=>{w.current?.(),T.current&&clearInterval(T.current)}},[e,C,S.client,x]);let E=y.filter(e=>e.status===`running`),D=(0,g.useCallback)(e=>{if(e.background&&!window.confirm(v(`activity:process.confirmKillBackground`,{pid:e.pid,defaultValue:`Terminate detached background process ${e.pid}?`})))return;let t=S.client.withSession?.({pid:e.pid})??{pid:e.pid};S.client.send?.({type:`process.kill`,payload:t})},[v,S.client]),O=(0,g.useCallback)(()=>{if(!window.confirm(v(`activity:process.confirmKillAll`,{count:E.length,defaultValue:`Terminate all ${E.length} running processes?`})))return;let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.killAll`,payload:e})},[E.length,v,S.client,x]);return(0,_.jsx)(m,{open:e,onOpenChange:e=>{e||i()},children:(0,_.jsxs)(d,{className:u(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,a),showCloseButton:!1,children:[(0,_.jsx)(f,{className:`sr-only`,children:v(`activity:process.heading`)}),(0,_.jsx)(p,{className:`sr-only`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})}),(0,_.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,_.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-warning/10 text-warning`,children:(0,_.jsx)(c,{className:`h-4 w-4`})}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:process.heading`)}),(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})})]})]}),(0,_.jsx)(`div`,{className:`flex items-center gap-1`,children:E.length>0&&(0,_.jsxs)(`button`,{type:`button`,onClick:O,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,_.jsx)(o,{className:`h-3 w-3 fill-current`}),v(`activity:process.killAll`)]})})]}),(0,_.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:y.length===0?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-10 w-10 opacity-15`}),(0,_.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:process.emptyTitle`)}),(0,_.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:process.emptyBody`)})]}):(0,_.jsx)(`div`,{className:`divide-y`,children:y.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,r=e.protected===!0,i=e.background===!0;return(0,_.jsxs)(`div`,{className:u(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,_.jsx)(`span`,{className:u(`led shrink-0`,e.status===`running`?r?`text-info`:`text-success led-pulse`:`text-muted-foreground`)}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:v(`activity:process.pidLabel`,{pid:e.pid})}),(0,_.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),r&&(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-info/10 text-info font-medium shrink-0`,title:v(`activity:process.protectedTitle`),children:[(0,_.jsx)(s,{className:`h-2.5 w-2.5`}),v(`activity:process.protected`)]}),i&&(0,_.jsx)(`span`,{className:`inline-flex items-center px-1 py-0.5 rounded text-[9px] bg-success/10 text-success font-medium shrink-0`,title:v(`activity:process.backgroundTitle`),children:v(`activity:process.background`)})]}),(0,_.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!r&&(0,_.jsx)(`button`,{type:`button`,onClick:()=>D(e),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:process.killTitle`,{pid:e.pid}),children:(0,_.jsx)(o,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{v as ProcessMonitor};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t}from"./config-store-D7yrCV2X.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Gt as i,La as a,Vr as o,Yi as s,dt as c,qi as l,rn as u}from"./vendor-BO-lHyIr.js";import"./i18n-B_njdXiH.js";import{t as d}from"./utils-DQbrPaAM.js";var f=e(n(),1),p=r(),m=200,h=new Set([`raw_user`,`refined_user`]),g=[`raw_user`,`refined_user`];function _(e,t){return e(`activity:promptJournal.cat.${t}`,t)}function v(){let{t:e}=a(),n=t(),[r,s]=(0,f.useState)([]),[l,v]=(0,f.useState)(!0),[b,x]=(0,f.useState)(null),[S,C]=(0,f.useState)(!0),[w,T]=(0,f.useState)({category:``,session:``,limit:m}),[E,D]=(0,f.useState)(new Set),O=(0,f.useCallback)(()=>{if(!n.isConnected){C(!1);return}C(!0),x(null),n.send({type:`prompts.journal`,payload:{filter:{...w.category?{category:w.category}:{},limit:w.limit}}})},[n,w.category,w.limit]);(0,f.useEffect)(()=>{let e=e=>{let t=e.payload;v(t.enabled);let n=(t.entries??[]).filter(e=>h.has(e.category));s(n),x(t.error??null),C(!1)};return n.on(`prompts.journal`,e),O(),()=>n.off(`prompts.journal`,e)},[n,O]);let k=(0,f.useMemo)(()=>{let e=w.session.trim().toLowerCase(),t=r.filter(t=>!e||t.sessionId.toLowerCase().includes(e)),n=new Map;for(let e of[...t].reverse()){let t=e.timestamp.slice(0,10),r=n.get(t)??[];r.push(e),n.set(t,r)}return[...n.entries()]},[r,w.session]),A=(0,f.useMemo)(()=>{let e=0;for(let t of r)e+=t.metadata.tokenEstimate??0;return{count:r.length,tokens:e}},[r]),j=e=>{D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M=(0,f.useMemo)(()=>g.filter(e=>r.some(t=>t.category===e)),[r]);return(0,p.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto`,children:[(0,p.jsxs)(`div`,{className:`border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(i,{className:`h-5 w-5 text-primary`}),(0,p.jsx)(`h1`,{className:`text-base font-semibold`,children:e(`activity:promptJournal.title`)})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:O,disabled:S,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,children:[(0,p.jsx)(u,{className:d(`h-3.5 w-3.5`,S&&`animate-spin`)}),e(`activity:promptJournal.refresh`)]})]}),(0,p.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.subtitle`)}),l&&A.count>0&&(0,p.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statEntries`,{count:A.count})}),(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statTokens`,{count:A.tokens.toLocaleString()})})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 px-4 py-2 sm:px-6`,children:[(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterCategory`)}),(0,p.jsxs)(`select`,{value:w.category,onChange:e=>T(t=>({...t,category:e.target.value})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:``,children:e(`activity:promptJournal.filterAll`)}),M.map(t=>(0,p.jsx)(`option`,{value:t,children:_(e,t)},t))]})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterSession`)}),(0,p.jsx)(`input`,{type:`text`,value:w.session,onChange:e=>T(t=>({...t,session:e.target.value})),placeholder:`sess_…`,className:`w-40 rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterLimit`)}),(0,p.jsxs)(`select`,{value:w.limit,onChange:e=>T(t=>({...t,limit:Number(e.target.value)})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:50,children:`50`}),(0,p.jsx)(`option`,{value:200,children:`200`}),(0,p.jsx)(`option`,{value:1e3,children:`1000`})]})]})]}),(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 px-4 py-3 sm:px-6`,children:[S&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.loading`)}),!S&&b&&(0,p.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-10 text-sm text-destructive`,children:[(0,p.jsx)(c,{className:`h-4 w-4`}),b]}),!S&&!b&&!l&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.disabled`)}),!S&&!b&&l&&k.length===0&&(0,p.jsxs)(`div`,{className:`py-10 text-center`,children:[(0,p.jsx)(o,{className:`mx-auto h-8 w-8 text-muted-foreground/50`}),(0,p.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:e(`activity:promptJournal.emptyTitle`)}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.emptyHint`)})]}),!S&&!b&&l&&k.length>0&&(0,p.jsx)(`div`,{className:`space-y-5`,children:k.map(([e,t])=>(0,p.jsxs)(`section`,{children:[(0,p.jsxs)(`h2`,{className:`sticky top-0 z-10 border-b border-border/60 bg-background/90 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground backdrop-blur`,children:[e,(0,p.jsx)(`span`,{className:`ml-2 font-normal normal-case text-muted-foreground/60`,children:t.length})]}),(0,p.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.map(e=>(0,p.jsx)(y,{entry:e,expanded:E.has(e.id),onToggle:()=>j(e.id)},e.id))})]},e))})]})]})}function y({entry:e,expanded:t,onToggle:n}){let{t:r}=a(),i=e.timestamp.slice(11,19),o=e.metadata,c=e.content.trim().slice(0,240),u=e.rawContent!==void 0&&e.rawContent!==e.content;return(0,p.jsxs)(`li`,{className:`rounded-lg border border-border/70 bg-card/60`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left hover:bg-accent/40`,children:[t?(0,p.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}):(0,p.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,p.jsx)(`span`,{className:`tabular text-muted-foreground`,children:i}),(0,p.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 font-medium text-primary`,children:_(r,e.category)}),(0,p.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.role}),(0,p.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.sessionId})]}),!t&&c&&(0,p.jsx)(`div`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap break-words text-xs text-foreground/80`,children:c})]}),(0,p.jsxs)(`span`,{className:`shrink-0 text-[11px] tabular text-muted-foreground`,children:[`~`,o.tokenEstimate,` `,r(`activity:promptJournal.tokens`)]})]}),t&&(0,p.jsxs)(`div`,{className:`border-t border-border/60 px-3 py-2 pl-9`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.refinedBody`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 text-xs text-foreground`,children:e.content}),u&&(0,p.jsxs)(`div`,{className:`mt-2`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.rawInput`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/30 p-2 text-xs text-muted-foreground`,children:e.rawContent})]})]})]})}export{v as PromptJournalView};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t}from"./config-store-BAUadwHd.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Na as i,Ti as a,Vn as o,Yt as s,ja as c,kn as l,xo as u}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{t as d}from"./utils-CKsqCaP8.js";var f=e(n(),1),p=r(),m=200,h=new Set([`raw_user`,`refined_user`]),g=[`raw_user`,`refined_user`];function _(e,t){return e(`activity:promptJournal.cat.${t}`,t)}function v(){let{t:e}=u(),n=t(),[r,i]=(0,f.useState)([]),[c,v]=(0,f.useState)(!0),[b,x]=(0,f.useState)(null),[S,C]=(0,f.useState)(!0),[w,T]=(0,f.useState)({category:``,session:``,limit:m}),[E,D]=(0,f.useState)(new Set),O=(0,f.useCallback)(()=>{if(!n.isConnected){C(!1);return}C(!0),x(null),n.send({type:`prompts.journal`,payload:{filter:{...w.category?{category:w.category}:{},limit:w.limit}}})},[n,w.category,w.limit]);(0,f.useEffect)(()=>{let e=e=>{let t=e.payload;v(t.enabled);let n=(t.entries??[]).filter(e=>h.has(e.category));i(n),x(t.error??null),C(!1)};return n.on(`prompts.journal`,e),O(),()=>n.off(`prompts.journal`,e)},[n,O]);let k=(0,f.useMemo)(()=>{let e=w.session.trim().toLowerCase(),t=r.filter(t=>!e||t.sessionId.toLowerCase().includes(e)),n=new Map;for(let e of[...t].reverse()){let t=e.timestamp.slice(0,10),r=n.get(t)??[];r.push(e),n.set(t,r)}return[...n.entries()]},[r,w.session]),A=(0,f.useMemo)(()=>{let e=0;for(let t of r)e+=t.metadata.tokenEstimate??0;return{count:r.length,tokens:e}},[r]),j=e=>{D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M=(0,f.useMemo)(()=>g.filter(e=>r.some(t=>t.category===e)),[r]);return(0,p.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto`,children:[(0,p.jsxs)(`div`,{className:`border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(l,{className:`h-5 w-5 text-primary`}),(0,p.jsx)(`h1`,{className:`text-base font-semibold`,children:e(`activity:promptJournal.title`)})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:O,disabled:S,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,children:[(0,p.jsx)(o,{className:d(`h-3.5 w-3.5`,S&&`animate-spin`)}),e(`activity:promptJournal.refresh`)]})]}),(0,p.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.subtitle`)}),c&&A.count>0&&(0,p.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statEntries`,{count:A.count})}),(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statTokens`,{count:A.tokens.toLocaleString()})})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 px-4 py-2 sm:px-6`,children:[(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterCategory`)}),(0,p.jsxs)(`select`,{value:w.category,onChange:e=>T(t=>({...t,category:e.target.value})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:``,children:e(`activity:promptJournal.filterAll`)}),M.map(t=>(0,p.jsx)(`option`,{value:t,children:_(e,t)},t))]})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterSession`)}),(0,p.jsx)(`input`,{type:`text`,value:w.session,onChange:e=>T(t=>({...t,session:e.target.value})),placeholder:`sess_…`,className:`w-40 rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterLimit`)}),(0,p.jsxs)(`select`,{value:w.limit,onChange:e=>T(t=>({...t,limit:Number(e.target.value)})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:50,children:`50`}),(0,p.jsx)(`option`,{value:200,children:`200`}),(0,p.jsx)(`option`,{value:1e3,children:`1000`})]})]})]}),(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 px-4 py-3 sm:px-6`,children:[S&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.loading`)}),!S&&b&&(0,p.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-10 text-sm text-destructive`,children:[(0,p.jsx)(s,{className:`h-4 w-4`}),b]}),!S&&!b&&!c&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.disabled`)}),!S&&!b&&c&&k.length===0&&(0,p.jsxs)(`div`,{className:`py-10 text-center`,children:[(0,p.jsx)(a,{className:`mx-auto h-8 w-8 text-muted-foreground/50`}),(0,p.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:e(`activity:promptJournal.emptyTitle`)}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.emptyHint`)})]}),!S&&!b&&c&&k.length>0&&(0,p.jsx)(`div`,{className:`space-y-5`,children:k.map(([e,t])=>(0,p.jsxs)(`section`,{children:[(0,p.jsxs)(`h2`,{className:`sticky top-0 z-10 border-b border-border/60 bg-background/90 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground backdrop-blur`,children:[e,(0,p.jsx)(`span`,{className:`ml-2 font-normal normal-case text-muted-foreground/60`,children:t.length})]}),(0,p.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.map(e=>(0,p.jsx)(y,{entry:e,expanded:E.has(e.id),onToggle:()=>j(e.id)},e.id))})]},e))})]})]})}function y({entry:e,expanded:t,onToggle:n}){let{t:r}=u(),a=e.timestamp.slice(11,19),o=e.metadata,s=e.content.trim().slice(0,240),l=e.rawContent!==void 0&&e.rawContent!==e.content;return(0,p.jsxs)(`li`,{className:`rounded-lg border border-border/70 bg-card/60`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left hover:bg-accent/40`,children:[t?(0,p.jsx)(i,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}):(0,p.jsx)(c,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,p.jsx)(`span`,{className:`tabular text-muted-foreground`,children:a}),(0,p.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 font-medium text-primary`,children:_(r,e.category)}),(0,p.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.role}),(0,p.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.sessionId})]}),!t&&s&&(0,p.jsx)(`div`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap break-words text-xs text-foreground/80`,children:s})]}),(0,p.jsxs)(`span`,{className:`shrink-0 text-[11px] tabular text-muted-foreground`,children:[`~`,o.tokenEstimate,` `,r(`activity:promptJournal.tokens`)]})]}),t&&(0,p.jsxs)(`div`,{className:`border-t border-border/60 px-3 py-2 pl-9`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.refinedBody`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 text-xs text-foreground`,children:e.content}),l&&(0,p.jsxs)(`div`,{className:`mt-2`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.rawInput`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/30 p-2 text-xs text-muted-foreground`,children:e.rawContent})]})]})]})}export{v as PromptJournalView};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./config-store-BAUadwHd.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{$a as i,Cn as a,Dn as o,In as s,Jn as c,Mr as l,Si as ee,Ta as te,ga as ne,ja as re,qr as u,sn as d,so as f,va as ie}from"./vendor-V3ydTHqN.js";import{n as ae}from"./i18n-CbyUyl6G.js";import{t as p}from"./utils-CKsqCaP8.js";import{o as m,r as h}from"./view-navigation-DHtNFXIl.js";import"./stores-BIVCS5nu.js";import{a as oe,i as se,n as g,o as _,r as ce,t as le}from"./dialog-C7EIBM_2.js";import{t as v}from"./button-9ewV4TF3.js";import{t as ue}from"./input-ag1CrUiS.js";import{C as y,L as b,w as x}from"./index-BhXxZMAb.js";var S=e(n(),1),C=r();function w(e){return e?Intl.NumberFormat(void 0,{notation:`compact`,maximumFractionDigits:1}).format(e):`—`}function de(e){return{authentication:`Authentication failed`,quota_exhausted:`Plan / credits exhausted`,rate_limited:`Rate limited`,model_unavailable:`Model unavailable`,context_limit:`Context limit exceeded`,token_limit:`Output-token limit rejected`,timeout:`Timed out`,network:`Network error`,overloaded:`Provider overloaded`,server_error:`Provider server error`,invalid_request:`Invalid request`,cancelled:`Cancelled`,unknown:`Unknown failure`}[e]??e}function T(e,t,n,r){let i=e.trim().toLowerCase(),a=t.trim().toLowerCase(),o=n.trim().toLowerCase();return i===`${a}/${o}`||i===`${a} ${o}`||a===r.trim().toLowerCase()&&i===o}function E(){let e=b(),n=e.client,r=t(e=>e.provider),E=ae(),[D,O]=(0,S.useState)(`provider`),[k,fe]=(0,S.useState)([]),[A,pe]=(0,S.useState)(``),[j,M]=(0,S.useState)([]),[N,P]=(0,S.useState)(new Set),[F,I]=(0,S.useState)(``),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(!1),[V,me]=(0,S.useState)(``),[H,U]=(0,S.useState)(``),[W,G]=(0,S.useState)(``),[K,q]=(0,S.useState)([]),[J,Y]=(0,S.useState)(``),[X,Z]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(!n)return;let e=n.on(`providers.saved`,e=>{e.type===`providers.saved`&&fe(e.payload.providers)}),t=n.on(`provider.models`,e=>{if(e.type!==`provider.models`||e.payload.provider!==A)return;let t=e.payload.models;M(t),P(new Set(t.filter(e=>!y(A,e.id,E.disabledModels)).map(e=>e.id))),R(!1)}),r=n.on(`provider.test.started`,e=>{e.type===`provider.test.started`&&e.payload.requestId===V&&B(!0)}),i=n.on(`provider.test.result`,e=>{e.type!==`provider.test.result`||e.payload.requestId!==V&&e.payload.requestId!==H||q(t=>{let n=t.findIndex(t=>t.modelId===e.payload.modelId);return n<0?[...t,e.payload]:t.map((t,r)=>r===n?e.payload:t)})}),a=n.on(`provider.test.complete`,e=>{e.type===`provider.test.complete`&&(e.payload.requestId===V&&(B(!1),Y(e.payload.error??``)),e.payload.requestId===H&&(U(``),G(``)))});return n.send({type:`providers.saved`}),()=>{e(),t(),r(),i(),a()}},[n,E.disabledModels,A,V,H]);let he=(0,S.useMemo)(()=>{let e=F.trim().toLowerCase();return e?j.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)):j},[j,F]),Q=K.length,ge=K.filter(e=>e.status===`passed`).length,_e=K.filter(e=>e.status===`failed`).length,$=K.filter(e=>e.status===`failed`&&!y(A,e.modelId,E.disabledModels)),ve=()=>{A&&(R(!0),M([]),P(new Set),O(`models`),n?.send({type:`provider.models`,payload:{providerId:A,includeDisabled:!0}}))},ye=()=>{if(!n||N.size===0)return;let e=crypto.randomUUID();me(e),q([]),Y(``),B(!0),O(`results`),n.send({type:`provider.test.run`,payload:{requestId:e,providerId:A,modelIds:[...N],timeoutMs:45e3,maxTokens:32}})},be=()=>{V&&n?.send({type:`provider.test.cancel`,payload:{requestId:V}})},xe=e=>{if(!n||z||W)return;let t=crypto.randomUUID();U(t),G(e),n.send({type:`provider.test.run`,payload:{requestId:t,providerId:A,modelIds:[e],timeoutMs:45e3,maxTokens:32}})},Se=t=>{let n=`${A}/${t}`,r=x(A,t,E.favoriteModels)?E.favoriteModels.filter(e=>!x(A,t,[e])):[...E.favoriteModels,n];E.set({favoriteModels:r}),e.updatePrefs({favoriteModels:r})},Ce=t=>{let n=E.disabledModels.filter(e=>!T(e,A,t,r));E.set({disabledModels:n}),e.updatePrefs({disabledModels:n})};return(0,C.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,C.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,C.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,C.jsx)(ee,{className:`h-5 w-5`})}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`h1`,{className:`text-base font-semibold`,children:`Provider Test`}),(0,C.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:`Test every selected model with the saved account and its real provider adapter.`})]}),(0,C.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>h(`settings`),children:[(0,C.jsx)(a,{className:`mr-1.5 h-4 w-4`}),` Settings`]}),(0,C.jsx)(v,{variant:`ghost`,size:`icon`,onClick:()=>m(`chat`),"aria-label":`Close`,children:(0,C.jsx)(f,{className:`h-4 w-4`})})]}),(0,C.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,C.jsxs)(`div`,{className:`mx-auto max-w-7xl space-y-5 p-4 sm:p-6`,children:[(0,C.jsx)(`div`,{className:`grid grid-cols-3 gap-2 text-xs`,children:[`provider`,`models`,`results`].map((e,t)=>(0,C.jsxs)(`div`,{className:p(`rounded-lg border px-3 py-2`,D===e?`border-primary/50 bg-primary/10 text-primary`:`text-muted-foreground`),children:[t+1,`.`,` `,e===`provider`?`Account`:e===`models`?`Models`:`Results`]},e))}),D===`provider`&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Choose a provider or subscription`}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Only saved accounts are shown. Credentials remain on the server.`})]}),k.length===0?(0,C.jsx)(`div`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:`No saved provider accounts. Add one in Settings first.`}):(0,C.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:k.map(e=>{let t=e.apiKeys.find(e=>e.isActive);return(0,C.jsxs)(`button`,{type:`button`,onClick:()=>pe(e.id),className:p(`rounded-xl border p-4 text-left transition-colors hover:bg-accent/50`,A===e.id&&`border-primary bg-primary/5 ring-1 ring-primary/30`),children:[(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`font-medium`,children:e.id}),(0,C.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.type&&e.type!==e.id?`${e.type} · ${e.family??`auto`}`:e.family??e.type??`auto-detect`})]}),(0,C.jsx)(u,{className:`h-4 w-4 text-muted-foreground`})]}),(0,C.jsx)(`div`,{className:`mt-3 text-xs text-muted-foreground`,children:t?`${t.label} · ${t.maskedKey}`:`${e.apiKeys.length} saved credential(s)`})]},e.id)})}),(0,C.jsx)(`div`,{className:`flex justify-end`,children:(0,C.jsxs)(v,{disabled:!A,onClick:ve,children:[`Next `,(0,C.jsx)(re,{className:`ml-1.5 h-4 w-4`})]})})]}),D===`models`&&(0,C.jsxs)(`section`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Choose models`}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A})]}),(0,C.jsxs)(`div`,{className:`flex gap-2`,children:[(0,C.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>P(new Set(j.filter(e=>!y(A,e.id,E.disabledModels)).map(e=>e.id))),children:`Select all`}),(0,C.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>P(new Set(j.map(e=>e.id))),children:`With disabled models`}),(0,C.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>P(new Set),children:`Clear`})]})]}),(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(o,{className:`absolute left-3 top-2.5 h-4 w-4 text-muted-foreground`}),(0,C.jsx)(ue,{value:F,onChange:e=>I(e.target.value),className:`pl-9`,placeholder:`Filter models…`})]}),L?(0,C.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,C.jsx)(l,{className:`h-6 w-6 animate-spin`})}):(0,C.jsx)(`div`,{className:`overflow-hidden rounded-xl border`,children:he.map(e=>(0,C.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 border-b p-3 last:border-b-0 hover:bg-accent/40`,children:[(0,C.jsx)(`input`,{type:`checkbox`,className:`mt-1 h-4 w-4 accent-primary`,checked:N.has(e.id),onChange:()=>P(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:e.id}),y(A,e.id,E.disabledModels)&&(0,C.jsx)(`span`,{className:`rounded bg-destructive/10 px-1.5 py-0.5 text-[10px] font-medium text-destructive`,children:`Disabled`})]}),e.description&&(0,C.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-muted-foreground`,children:e.description})]}),(0,C.jsxs)(`div`,{className:`shrink-0 text-right text-xs text-muted-foreground`,children:[(0,C.jsxs)(`div`,{children:[`ctx `,w(e.contextWindow)]}),(0,C.jsxs)(`div`,{children:[`out `,w(e.maxOutput)]})]})]},e.id))}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(v,{variant:`ghost`,onClick:()=>O(`provider`),children:[(0,C.jsx)(f,{className:`mr-1.5 h-4 w-4`}),` Back`]}),(0,C.jsxs)(v,{disabled:N.size===0||L,onClick:ye,children:[(0,C.jsx)(c,{className:`mr-1.5 h-4 w-4`}),` Test `,N.size,` model(s)`]})]})]}),D===`results`&&(0,C.jsxs)(`section`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Test results`}),(0,C.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[A,` · `,Q,`/`,N.size,` completed`]})]}),(0,C.jsx)(`div`,{className:`flex gap-2`,children:z?(0,C.jsxs)(v,{variant:`destructive`,size:`sm`,onClick:be,children:[(0,C.jsx)(ie,{className:`mr-1.5 h-4 w-4`}),` Stop`]}):(0,C.jsxs)(C.Fragment,{children:[$.length>1&&(0,C.jsxs)(v,{variant:`destructive`,size:`sm`,onClick:()=>Z($),children:[(0,C.jsx)(i,{className:`mr-1.5 h-4 w-4`}),` Disable all failed (`,$.length,`)`]}),(0,C.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>O(`models`),children:[(0,C.jsx)(s,{className:`mr-1.5 h-4 w-4`}),` Test again`]})]})})]}),(0,C.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,C.jsxs)(`div`,{className:`rounded-xl border p-4`,children:[(0,C.jsx)(`div`,{className:`text-2xl font-semibold`,children:Q}),(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Completed`})]}),(0,C.jsxs)(`div`,{className:`rounded-xl border border-success/30 bg-success/5 p-4`,children:[(0,C.jsx)(`div`,{className:`text-2xl font-semibold text-success`,children:ge}),(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Working`})]}),(0,C.jsxs)(`div`,{className:`rounded-xl border border-destructive/30 bg-destructive/5 p-4`,children:[(0,C.jsx)(`div`,{className:`text-2xl font-semibold text-destructive`,children:_e}),(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Failed`})]})]}),J&&(0,C.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:J}),(0,C.jsx)(`div`,{className:`overflow-x-auto rounded-xl border`,children:(0,C.jsxs)(`table`,{className:`w-full min-w-[900px] text-left text-sm`,children:[(0,C.jsx)(`thead`,{className:`bg-muted/50 text-xs text-muted-foreground`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{className:`p-3`,children:`Model`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Status`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Family / wire`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Catalog limits / cost`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Latency`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Usage`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Detail`}),(0,C.jsx)(`th`,{className:`p-3`,children:`Actions`})]})}),(0,C.jsxs)(`tbody`,{children:[K.map(e=>(0,C.jsxs)(`tr`,{className:`border-t align-top`,children:[(0,C.jsx)(`td`,{className:`p-3 font-mono text-xs`,children:e.modelId}),(0,C.jsx)(`td`,{className:`p-3`,children:e.status===`passed`?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-success`,children:[(0,C.jsx)(te,{className:`h-4 w-4`}),` Working`]}):e.status===`cancelled`?(0,C.jsx)(`span`,{className:`text-muted-foreground`,children:`Cancelled`}):(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-destructive`,children:[(0,C.jsx)(ne,{className:`h-4 w-4`}),` Failed`]})}),(0,C.jsxs)(`td`,{className:`p-3 text-xs`,children:[(0,C.jsx)(`div`,{children:e.family??`—`}),(0,C.jsx)(`div`,{className:`text-muted-foreground`,children:e.wire??`—`})]}),(0,C.jsxs)(`td`,{className:`p-3 text-xs`,children:[(0,C.jsxs)(`div`,{children:[`ctx `,w(e.maxContext)]}),(0,C.jsxs)(`div`,{children:[`out `,w(e.maxOutput)]}),(e.inputCost!==void 0||e.outputCost!==void 0)&&(0,C.jsxs)(`div`,{className:`text-muted-foreground`,children:[`$`,e.inputCost??`—`,` / $`,e.outputCost??`—`]})]}),(0,C.jsxs)(`td`,{className:`p-3 tabular-nums`,children:[e.latencyMs,` ms`]}),(0,C.jsx)(`td`,{className:`p-3 text-xs tabular-nums`,children:e.usage?`in ${e.usage.input} / out ${e.usage.output}`:`—`}),(0,C.jsxs)(`td`,{className:`max-w-sm p-3 text-xs`,children:[(0,C.jsx)(`div`,{className:e.status===`failed`?`font-medium text-destructive`:``,children:e.status===`passed`?e.stopReason:de(e.diagnosis)}),e.error&&(0,C.jsxs)(`div`,{className:`mt-1 break-words text-muted-foreground`,children:[e.httpStatus?`HTTP ${e.httpStatus} · `:``,e.error]})]}),(0,C.jsx)(`td`,{className:`p-3`,children:(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.status===`failed`&&(0,C.jsxs)(v,{variant:`outline`,size:`sm`,disabled:z||!!W,onClick:()=>xe(e.modelId),children:[W===e.modelId?(0,C.jsx)(l,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):(0,C.jsx)(s,{className:`mr-1.5 h-3.5 w-3.5`}),`Retry`]}),e.status===`passed`?(0,C.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>Se(e.modelId),children:[(0,C.jsx)(d,{className:p(`mr-1.5 h-3.5 w-3.5`,x(A,e.modelId,E.favoriteModels)&&`fill-current text-warning`)}),x(A,e.modelId,E.favoriteModels)?`Unfavorite`:`Favorite`]}):e.status===`failed`?y(A,e.modelId,E.disabledModels)?(0,C.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>Ce(e.modelId),children:`Enable`}):(0,C.jsxs)(v,{variant:`destructive`,size:`sm`,onClick:()=>Z([e]),children:[(0,C.jsx)(i,{className:`mr-1.5 h-3.5 w-3.5`}),` Disable`]}):null]})})]},e.modelId)),z&&Q<N.size&&(0,C.jsx)(`tr`,{className:`border-t`,children:(0,C.jsxs)(`td`,{colSpan:8,className:`p-4 text-center text-sm text-muted-foreground`,children:[(0,C.jsx)(l,{className:`mr-2 inline h-4 w-4 animate-spin`}),`Testing next model…`]})})]})]})})]})]})}),(0,C.jsx)(le,{open:X.length>0,onOpenChange:e=>!e&&Z([]),children:(0,C.jsxs)(g,{children:[(0,C.jsxs)(oe,{children:[(0,C.jsx)(_,{children:X.length>1?`Disable ${X.length} failed models?`:`Disable this model?`}),(0,C.jsxs)(ce,{children:[X.length>0?`${X.map(e=>`${A}/${e.modelId}`).join(`, `)} will be hidden from model pickers and removed from favorites, the explicit fallback chain, and every fallback profile.`:``,X.some(e=>A===r&&e.modelId===t.getState().model)?` It is currently active and will remain active until you switch models.`:``]})]}),(0,C.jsxs)(se,{children:[(0,C.jsx)(v,{variant:`outline`,onClick:()=>Z([]),children:`Cancel`}),(0,C.jsx)(v,{variant:`destructive`,onClick:()=>{if(X.length===0)return;let t=new Set(X.map(e=>e.modelId)),n=[...E.disabledModels];for(let e of t)y(A,e,n)||n.push(`${A}/${e}`);let i=e=>![...t].some(t=>T(e,A,t,r)),a={disabledModels:n,favoriteModels:E.favoriteModels.filter(i),fallbackModels:E.fallbackModels.filter(i),fallbackProfiles:Object.fromEntries(Object.entries(E.fallbackProfiles).map(([e,t])=>[e,t.filter(i)]))};E.set(a),e.updatePrefs(a),P(e=>{let n=new Set(e);for(let e of t)n.delete(e);return n}),Z([])},children:`Disable model`})]})]})})]})}export{E as ProviderTestView};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Nt as t,mt as n}from"./config-store-BAUadwHd.js";import{i as r,t as i}from"./react-core-wiHys0m2.js";import{Ir as a,Mt as o,Pa as s,Qt as c,do as l,io as u,xo as d}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{t as f}from"./utils-CKsqCaP8.js";import"./stores-BIVCS5nu.js";import{t as p}from"./chat-store-DNRce6sE.js";import{n as m,o as h,r as g,t as _}from"./dialog-C7EIBM_2.js";var v=e(r(),1),y=i(),b={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-primary/10 text-primary border-primary/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-warning/10 text-warning border-warning/35`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-info/10 text-info border-info/30`}},x=`__no_session__`,S=new Map,C=new Set;t(e=>{S.delete(e),C.add(e)});function w({open:e,onClose:t,className:r}){let{t:i}=d(),w=p(e=>e.queue),T=p(e=>e.removeQueued),E=p(e=>e.clearQueue),[D,O]=(0,v.useState)(`oldest`),k=n(),A=(0,v.useRef)(k??x);(0,v.useLayoutEffect)(()=>{C.has(A.current)||S.set(A.current,D);let e=k??x;C.delete(e),O(S.get(e)??`oldest`),A.current=e},[k]);let j=(0,v.useCallback)(e=>{T(e)},[T]),M=(0,v.useMemo)(()=>{let e=w.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>D===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[w,D]),N=w.length>0&&w.every(e=>e.alreadyDispatched);return(0,y.jsx)(_,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(m,{className:f(`max-w-lg gap-0 overflow-hidden border-border/80 bg-card p-0 pt-[10dvh] flex flex-col max-h-[70dvh]`,r),showCloseButton:!1,children:[(0,y.jsx)(h,{className:`sr-only`,children:i(`activity:queue.heading`)}),(0,y.jsx)(g,{className:`sr-only`,children:i(`activity:queue.subtitle`,{count:w.length})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/95 px-4 py-3 shrink-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,y.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-md border border-primary/20 bg-primary/10 text-primary`,children:(0,y.jsx)(a,{className:`h-4 w-4`})}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold`,children:i(`activity:queue.heading`)}),(0,y.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:i(`activity:queue.subtitle`,{count:w.length})})]})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>e===`newest`?`oldest`:`newest`),className:f(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:i(D===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[D===`newest`?(0,y.jsx)(l,{className:`h-3 w-3`}):(0,y.jsx)(u,{className:`h-3 w-3`}),i(D===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),w.length>0&&!N&&(0,y.jsxs)(`button`,{type:`button`,onClick:()=>E(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:i(`activity:queue.clearDispatchedTitle`),"data-testid":`queue-clear-all`,children:[(0,y.jsx)(c,{className:`h-3 w-3`}),i(`activity:queue.clear`)]})]})]}),(0,y.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:w.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,y.jsx)(a,{className:`h-10 w-10 opacity-15`}),(0,y.jsx)(`p`,{className:`text-sm font-medium`,children:i(`activity:queue.emptyTitle`)}),(0,y.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:i(`activity:queue.emptyBody`)})]}):(0,y.jsx)(`ul`,{className:`divide-y divide-border/60`,"data-testid":`queue-list`,children:M.map(({item:e,sourceIdx:t},n)=>{let r=b[e.mode],a=e.alreadyDispatched===!0;return(0,y.jsxs)(`li`,{className:f(`flex items-start justify-between gap-3 px-4 py-3 text-xs transition-colors`,a?`bg-muted/30 text-muted-foreground hover:bg-muted/40`:`hover:bg-muted/35`),"data-testid":`queue-item`,"data-dispatched":a?`true`:void 0,children:[(0,y.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,y.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,y.jsx)(`span`,{className:f(`shrink-0 inline-flex items-center justify-center rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,r.tone,a&&`opacity-60`),title:i(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,y.jsx)(`p`,{className:`text-sm leading-relaxed min-w-0 break-words flex-1`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text}),a&&(0,y.jsxs)(`span`,{className:`shrink-0 mt-0.5 inline-flex items-center gap-1 text-[10px] font-semibold uppercase text-success`,title:i(`activity:queue.dispatchedTitle`),"data-testid":`queue-dispatched-${t}`,children:[(0,y.jsx)(s,{className:`h-3 w-3`}),i(`activity:queue.dispatchedLabel`)]})]}),!a&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>j(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:i(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,y.jsx)(o,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),w.length>0&&(0,y.jsx)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-2.5 shrink-0`,children:(0,y.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:i(`activity:queue.footer`)})})]})})}export{w as QueuePanel};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{tt as t}from"./config-store-D7yrCV2X.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{$t as i,La as a,Vi as o,Vt as s,Zt as c,di as l,dt as u,ja as d}from"./vendor-BO-lHyIr.js";import"./i18n-B_njdXiH.js";import{n as f}from"./ui-store-BROszDxo.js";import{t as p}from"./chat-store-DpI9nO_z.js";var m=e(n(),1),h=r();function g(){let e=t(e=>e.session),{t:n}=a(),r=t.getState().session?.id,g=t(e=>e.projectName),x=t(e=>e.cwd),S=t(e=>e.mode),C=t(e=>e.contextMode),w=t(e=>e.lastVisitedAt),T=p(e=>e.messages),E=p(e=>e.queue.length),D=p(e=>e.boundSessionId),O=f(e=>e.currentView),k=f(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0&&D!==r;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 sm:space-y-6`,children:[(0,h.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-2 text-xl font-bold sm:text-2xl`,children:[(0,h.jsx)(c,{className:`h-6 w-6 shrink-0 text-primary sm:h-7 sm:w-7`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`inline-flex h-9 w-full items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 sm:w-auto`,children:n(`activity:refresh.recordProbe`)})]})}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(d,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(l,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(i,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border/70 bg-card/65 p-3 text-xs font-mono`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(s,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(o,{className:`w-4 h-4 text-success shrink-0`}):(0,h.jsx)(u,{className:`w-4 h-4 text-warning shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${r?`border-warning/40 bg-warning/10 text-warning`:n?`border-success/40 bg-success/10 text-success`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium`,children:[n&&!r?(0,h.jsx)(o,{className:`h-4 w-4 shrink-0`}):(0,h.jsx)(u,{className:`h-4 w-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-card/75 p-3 shadow-sm`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{tt as t}from"./config-store-BAUadwHd.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Fn as i,Ln as a,Ta as o,Tn as s,Yi as c,Yt as l,ho as u,xo as d}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{n as f}from"./ui-store-DC3mkswy.js";import{t as p}from"./chat-store-DNRce6sE.js";var m=e(n(),1),h=r();function g(){let e=t(e=>e.session),{t:n}=d(),r=t.getState().session?.id,g=t(e=>e.projectName),x=t(e=>e.cwd),S=t(e=>e.mode),C=t(e=>e.contextMode),w=t(e=>e.lastVisitedAt),T=p(e=>e.messages),E=p(e=>e.queue.length),D=p(e=>e.boundSessionId),O=f(e=>e.currentView),k=f(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0&&D!==r;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 sm:space-y-6`,children:[(0,h.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-2 text-xl font-bold sm:text-2xl`,children:[(0,h.jsx)(i,{className:`h-6 w-6 shrink-0 text-primary sm:h-7 sm:w-7`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`inline-flex h-9 w-full items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 sm:w-auto`,children:n(`activity:refresh.recordProbe`)})]})}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(u,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(a,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border/70 bg-card/65 p-3 text-xs font-mono`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(s,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(o,{className:`w-4 h-4 text-success shrink-0`}):(0,h.jsx)(l,{className:`w-4 h-4 text-warning shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${r?`border-warning/40 bg-warning/10 text-warning`:n?`border-success/40 bg-success/10 text-success`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium`,children:[n&&!r?(0,h.jsx)(o,{className:`h-4 w-4 shrink-0`}):(0,h.jsx)(l,{className:`h-4 w-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-card/75 p-3 shadow-sm`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{nt as t,t as n}from"./config-store-BAUadwHd.js";import{i as r,t as i}from"./react-core-wiHys0m2.js";import{Dn as a,Ii as o,Mr as s,Pa as c,Ua as l,Vn as u,ai as d,ci as f,co as p,da as m,ea as h,ii as g,ja as _,pi as ee,rn as v,si as te,wa as y}from"./vendor-V3ydTHqN.js";import{t as b}from"./utils-CKsqCaP8.js";import{o as x}from"./view-navigation-DHtNFXIl.js";import"./stores-BIVCS5nu.js";import{a as S,n as ne,o as re,r as ie,t as ae}from"./dialog-C7EIBM_2.js";import{F as oe,L as C}from"./index-BhXxZMAb.js";var w=e(r(),1),T=i(),E=[`#9b87f5`,`#37c9a2`,`#f2b95f`,`#67a7ff`,`#e879b8`,`#f07178`],D=48,O=15,k=`flex h-[44%] min-h-[230px] max-h-[460px] shrink-0 flex-col overflow-hidden border-t border-border/70 bg-card/35 shadow-[0_-16px_40px_-34px_hsl(var(--primary)/0.8)] sm:h-[36%] sm:max-h-[390px] sm:flex-row`;function A(e){let t=[],n=[],r=new Map(e.map((e,t)=>[e.hash,t]));for(let r of e){let e=t.indexOf(r.hash);e<0&&(e=t.indexOf(void 0),e<0&&(e=t.length)),n.push(e),t[e]=r.parents[0];for(let e of r.parents.slice(1)){if(t.includes(e))continue;let n=t.indexOf(void 0);n<0&&(n=t.length),t[n]=e}}let i=new Map(e.map((e,t)=>[e.hash,n[t]??0])),a=e.flatMap((e,t)=>e.parents.flatMap(e=>{let a=r.get(e);return a===void 0?[]:[{fromRow:t,fromLane:n[t]??0,toRow:a,toLane:i.get(e)??0}]}));return{lanes:n,laneCount:Math.max(1,...n.map(e=>e+1)),edges:a}}function j(e){return e.slice(0,7)}function M(e){let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t))return e;let n=Math.max(0,Math.round(t/6e4));if(n<60)return`${n}m`;let r=Math.round(n/60);if(r<48)return`${r}h`;let i=Math.round(r/24);return i<60?`${i}d`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(new Date(e))}function N(e){return e.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}function P(e){return e.startsWith(`tag: `)?`border-amber-400/35 bg-amber-400/10 text-amber-500`:e.includes(`/`)?`border-emerald-400/30 bg-emerald-400/10 text-emerald-500`:`border-violet-400/35 bg-violet-400/12 text-violet-400`}function se({commits:e,layout:t}){let n=22+t.laneCount*O;return(0,T.jsxs)(`svg`,{"aria-label":`Commit topology`,className:`pointer-events-none absolute inset-y-0 left-0`,width:n,height:e.length*D,viewBox:`0 0 ${n} ${e.length*D}`,children:[t.edges.map((e,t)=>{let n=14+e.fromLane*O,r=14+e.toLane*O,i=e.fromRow*D+D/2,a=e.toRow*D+D/2,o=Math.min(18,Math.max(8,(a-i)*.35));return(0,T.jsx)(`path`,{d:`M ${n} ${i} C ${n} ${i+o}, ${r} ${a-o}, ${r} ${a}`,fill:`none`,stroke:E[e.fromLane%E.length],strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.9`},`${e.fromRow}-${e.toRow}-${t}`)}),e.map((e,n)=>{let r=t.lanes[n]??0,i=e.parents.length>1;return(0,T.jsxs)(`g`,{children:[(0,T.jsx)(`circle`,{cx:14+r*O,cy:n*D+D/2,r:i?5:4,fill:`hsl(var(--background))`,stroke:E[r%E.length],strokeWidth:i?2.5:2}),!i&&(0,T.jsx)(`circle`,{cx:14+r*O,cy:n*D+D/2,r:`1.5`,fill:E[r%E.length]})]},e.hash)})]})}function ce({refs:e,activeRef:t,onSelect:n}){let r=[{kind:`local`,label:`Local branches`,icon:f},{kind:`remote`,label:`Remotes`,icon:d},{kind:`tag`,label:`Tags`,icon:v}];return(0,T.jsxs)(`aside`,{className:`hidden min-h-0 w-[218px] shrink-0 flex-col border-r border-border/70 bg-card/35 xl:flex`,children:[(0,T.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[(0,T.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.18em] text-muted-foreground`,children:`Repository`}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>n(``),className:b(`mt-2 flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-xs transition-colors`,t===``?`bg-primary/12 text-primary`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:[(0,T.jsx)(l,{className:`h-3.5 w-3.5`}),` All branches`]})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-3`,children:r.map(({kind:r,label:i,icon:a})=>{let o=e.filter(e=>e.kind===r);return o.length===0?null:(0,T.jsxs)(`section`,{className:`mb-5`,children:[(0,T.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 px-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/75`,children:[(0,T.jsx)(a,{className:`h-3 w-3`}),` `,i,(0,T.jsx)(`span`,{className:`ml-auto font-mono`,children:o.length})]}),o.map(e=>(0,T.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),title:e.name,className:b(`group flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[11px] transition-colors`,t===e.name?`bg-primary/12 text-primary`:`text-muted-foreground hover:bg-muted/55 hover:text-foreground`),children:[(0,T.jsx)(`span`,{className:b(`h-1.5 w-1.5 shrink-0 rounded-full`,e.current?`bg-primary shadow-[0_0_8px_hsl(var(--primary))]`:`bg-muted-foreground/45`)}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.shortName}),e.current&&(0,T.jsx)(c,{className:`h-3 w-3`})]},e.name))]},r)})})]})}function le({commit:e,detail:t,loading:n,onOpenFile:r}){let[i,a]=(0,w.useState)(!1);if(!e)return(0,T.jsx)(`section`,{className:`flex h-[34%] min-h-[210px] shrink-0 items-center justify-center border-t border-border/70 bg-card/30 p-6 text-center text-xs text-muted-foreground`,children:`Select a commit to inspect its files and metadata.`});let l=t?.files??[],u=l.reduce((e,t)=>e+t.added,0),d=l.reduce((e,t)=>e+t.deleted,0),f=t?.body?.split(/\r?\n/).slice(1).join(`
2
+ `).trim();return(0,T.jsxs)(`section`,{className:k,children:[(0,T.jsxs)(`div`,{className:`w-full max-w-none shrink-0 overflow-y-auto border-b border-border/70 px-5 py-4 sm:w-[34%] sm:min-w-[250px] sm:max-w-[440px] sm:border-b-0 sm:border-r`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.17em] text-muted-foreground`,children:[(0,T.jsx)(y,{className:`h-3.5 w-3.5 text-primary`}),` Commit details`]}),(0,T.jsx)(`h2`,{className:`mt-3 text-sm font-semibold leading-5 text-foreground`,children:e.subject}),(0,T.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center rounded-full border border-primary/25 bg-primary/10 text-[10px] font-bold text-primary`,children:N(e.author)}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.author}),(0,T.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.email})]})]}),(0,T.jsxs)(`button`,{type:`button`,onClick:async()=>{await navigator.clipboard?.writeText(e.hash),a(!0),window.setTimeout(()=>a(!1),1200)},className:`mt-4 flex w-full items-center justify-between rounded-lg border border-border/70 bg-background/55 px-3 py-2 font-mono text-[11px] text-muted-foreground hover:border-primary/35 hover:text-foreground`,children:[(0,T.jsx)(`span`,{children:j(e.hash)}),i?(0,T.jsx)(c,{className:`h-3.5 w-3.5 text-success`}):(0,T.jsx)(h,{className:`h-3.5 w-3.5`})]}),(0,T.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 overflow-hidden rounded-lg border border-border/70`,children:[(0,T.jsxs)(`div`,{className:`border-r border-border/70 p-3`,children:[(0,T.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:l.length}),(0,T.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Files`})]}),(0,T.jsxs)(`div`,{className:`p-3`,children:[(0,T.jsxs)(`div`,{className:`font-mono text-xs`,children:[(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,u]}),` `,(0,T.jsxs)(`span`,{className:`text-destructive`,children:[`-`,d]})]}),(0,T.jsx)(`div`,{className:`mt-1 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Lines`})]})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.authoredAt))]}),e.parents.length>1&&(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 text-[11px] text-violet-400`,children:[(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),`Merge of `,e.parents.length,` parents`]}),f&&(0,T.jsx)(`p`,{className:`mt-4 whitespace-pre-wrap rounded-lg border border-border/60 bg-background/45 px-3 py-2.5 text-[11px] leading-5 text-muted-foreground`,children:f}),e.refs.length>0&&(0,T.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,children:e.refs.map(e=>(0,T.jsx)(`span`,{className:b(`rounded-md border px-1.5 py-0.5 text-[9px]`,P(e)),children:e.replace(/^tag: /,``)},e))})]}),(0,T.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-4 sm:p-5`,children:[(0,T.jsx)(`div`,{className:`mt-5 text-[10px] font-bold uppercase tracking-[0.15em] text-muted-foreground`,children:`Changed files`}),n?(0,T.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,T.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}),`Loading changes…`]}):t?.error?(0,T.jsx)(`div`,{className:`py-5 text-xs text-destructive`,children:t.error}):(0,T.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[l.map(e=>(0,T.jsxs)(`button`,{type:`button`,onClick:()=>r(e),className:`group w-full rounded-lg border border-transparent px-2 py-2 text-left transition-colors hover:border-primary/30 hover:bg-primary/[0.055]`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px]`,title:e.path,children:e.path}),(0,T.jsx)(_,{className:`h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-all group-hover:translate-x-0.5 group-hover:opacity-100`})]}),(0,T.jsxs)(`div`,{className:`mt-1 pl-5 font-mono text-[10px]`,children:[(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e.added]}),(0,T.jsxs)(`span`,{className:`ml-2 text-destructive`,children:[`-`,e.deleted]})]})]},e.path)),l.length===0&&(0,T.jsx)(`div`,{className:`py-5 text-xs text-muted-foreground`,children:`No file changes reported.`})]})]})]})}function F(){let{client:e}=C(),r=n(e=>e.wsConnected),i=t(e=>e.files),[c,l]=(0,w.useState)(null),[m,h]=(0,w.useState)(null),[v,y]=(0,w.useState)(null),[E,k]=(0,w.useState)(``),[F,ue]=(0,w.useState)(``),[I,L]=(0,w.useState)(!0),[R,z]=(0,w.useState)(!1),[B,V]=(0,w.useState)(null),[H,U]=(0,w.useState)(!1),[de,W]=(0,w.useState)(!1),G=(0,w.useRef)(null),K=(0,w.useRef)(null);G.current=v;let q=(0,w.useCallback)((t,n=0)=>{e&&r&&(L(!0),e.getGitHistory({...t?{ref:t}:{},limit:160,skip:n}),e.getGitChanges())},[e,r]);(0,w.useEffect)(()=>{if(!e)return;let t=e.on(`git.history`,e=>{l(t=>e.payload.skip>0&&t?{...e.payload,commits:[...t.commits,...e.payload.commits],refs:t.refs}:e.payload),L(!1);let t=e.payload.commits[0]?.hash??null;y(n=>e.payload.skip>0||n&&e.payload.commits.some(e=>e.hash===n)?n:t)}),n=e.on(`git.commit_detail`,e=>{e.payload.hash===G.current&&(h(e.payload),z(!1))}),r=e.on(`git.commit_file_diff`,e=>{`${e.payload.hash}:${e.payload.path}`===K.current&&(V(e.payload),W(!1))});return q(``),()=>{t(),n(),r()}},[e,q]),(0,w.useEffect)(()=>{v&&e&&(h(null),z(!0),e.getGitCommitDetail(v))},[e,v]);let J=(0,w.useMemo)(()=>{let e=F.trim().toLowerCase();return e?(c?.commits??[]).filter(t=>`${t.subject} ${t.author} ${t.email} ${t.hash} ${t.refs.join(` `)}`.toLowerCase().includes(e)):c?.commits??[]},[c?.commits,F]),Y=(0,w.useMemo)(()=>A(J),[J]),X=22+Y.laneCount*O,fe=c?.commits.find(e=>e.hash===v)??null,Z=(0,w.useMemo)(()=>{let e=c?.commits??[];return{commits:e.length,contributors:new Set(e.map(e=>e.email||e.author)).size,merges:e.filter(e=>e.parents.length>1).length,branches:(c?.refs??[]).filter(e=>e.kind!==`tag`).length}},[c]),Q=e=>{k(e),y(null),h(null),q(e)},$=e=>{if(J.length===0)return;let t=Math.max(0,J.findIndex(e=>e.hash===v));y(J[Math.max(0,Math.min(J.length-1,t+e))]?.hash??null)};return(0,T.jsxs)(`div`,{className:`relative flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[radial-gradient(circle_at_48%_-20%,hsl(var(--primary)/0.10),transparent_42%),hsl(var(--background))]`,"data-testid":`repository-history-view`,children:[(0,T.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,T.jsx)(ce,{refs:c?.refs??[],activeRef:E,onSelect:Q}),(0,T.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,T.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/30 px-4 py-3 backdrop-blur-xl sm:px-5`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsx)(`div`,{children:(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-xl border border-primary/25 bg-primary/10 text-primary shadow-[0_0_22px_hsl(var(--primary)/0.12)]`,children:(0,T.jsx)(d,{className:`h-4 w-4`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-base font-semibold tracking-tight`,children:`Repository history`}),(0,T.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every branch. One clear picture.`})]})]})}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`span`,{className:`hidden rounded-full border border-border/70 bg-background/55 px-2.5 py-1 font-mono text-[10px] text-muted-foreground sm:inline-flex`,children:[(0,T.jsx)(f,{className:`mr-1.5 h-3 w-3 text-primary`}),c?.currentBranch||`—`]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>q(E),className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-border/70 bg-background/55 px-2.5 text-xs text-muted-foreground transition-colors hover:border-primary/35 hover:text-foreground`,children:[(0,T.jsx)(u,{className:b(`h-3.5 w-3.5`,I&&`animate-spin`)}),`Refresh`]})]})]}),(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,T.jsxs)(`label`,{className:`relative min-w-[220px] flex-1`,children:[(0,T.jsx)(a,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(`input`,{value:F,onChange:e=>ue(e.target.value),placeholder:`Search commits, authors, hashes…`,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 pl-9 pr-3 text-xs outline-none transition focus:border-primary/50 focus:ring-2 focus:ring-primary/10`})]}),(0,T.jsxs)(`label`,{className:`relative xl:hidden`,children:[(0,T.jsx)(ee,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,T.jsxs)(`select`,{value:E,onChange:e=>Q(e.target.value),className:`h-9 max-w-[190px] appearance-none rounded-lg border border-border/70 bg-background/60 pl-8 pr-7 text-xs outline-none`,children:[(0,T.jsx)(`option`,{value:``,children:`All branches`}),c?.refs.map(e=>(0,T.jsx)(`option`,{value:e.name,children:e.shortName},e.name))]})]})]})]}),(0,T.jsx)(`div`,{className:`grid h-10 shrink-0 grid-cols-4 divide-x divide-border/60 border-b border-border/70 bg-card/20`,children:[[`Commits`,Z.commits],[`Branches`,Z.branches],[`Contributors`,Z.contributors],[`Merges`,Z.merges]].map(([e,t])=>(0,T.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs font-semibold tabular-nums text-foreground`,children:t}),(0,T.jsx)(`span`,{className:`hidden text-[9px] font-semibold uppercase tracking-wider text-muted-foreground sm:inline`,children:e})]},e))}),i.length>0&&(0,T.jsxs)(`button`,{type:`button`,onClick:()=>x(`changes`),className:`group flex h-10 shrink-0 items-center gap-3 border-b border-border/70 bg-primary/[0.055] px-4 text-left text-xs hover:bg-primary/[0.09]`,children:[(0,T.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full border border-primary bg-background`}),(0,T.jsx)(`span`,{className:`font-medium`,children:`Working changes`}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:i.length}),(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:`Your next chapter starts here`}),(0,T.jsx)(_,{className:`ml-auto h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:translate-x-0.5`})]}),(0,T.jsxs)(`div`,{className:`grid h-7 shrink-0 grid-cols-[minmax(0,1fr)_120px_82px_48px] items-center border-b border-border/70 bg-muted/20 px-3 text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_160px_92px_58px]`,children:[(0,T.jsx)(`span`,{style:{paddingLeft:X+10},children:`Graph / commit message`}),(0,T.jsx)(`span`,{children:`Author`}),(0,T.jsx)(`span`,{children:`Commit`}),(0,T.jsx)(`span`,{children:`When`})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:I&&!c?(0,T.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(s,{className:`h-4 w-4 animate-spin text-primary`}),`Mapping repository history…`]}):c?.error?(0,T.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-sm text-destructive`,children:c.error}):J.length===0?(0,T.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,T.jsx)(te,{className:`h-7 w-7 opacity-45`}),`No commits match this view.`]}):(0,T.jsxs)(`div`,{className:`relative min-w-[700px]`,style:{height:J.length*D},children:[(0,T.jsx)(se,{commits:J,layout:Y}),J.map((e,t)=>{let n=e.hash===v;return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>y(e.hash),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`j`)&&(e.preventDefault(),$(1)),(e.key===`ArrowUp`||e.key===`k`)&&(e.preventDefault(),$(-1))},className:b(`absolute left-0 grid w-full grid-cols-[minmax(0,1fr)_120px_82px_48px] items-center border-b border-border/45 pr-3 text-left transition-colors sm:grid-cols-[minmax(0,1fr)_160px_92px_58px]`,n?`bg-primary/[0.075] shadow-[inset_2px_0_hsl(var(--primary))]`:`hover:bg-muted/35`),style:{top:t*D,height:D},children:[(0,T.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,style:{paddingLeft:X+10},children:(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.refs.slice(0,2).map(e=>(0,T.jsx)(`span`,{className:b(`hidden max-w-[170px] shrink-0 truncate rounded-md border px-1.5 py-0.5 text-[9px] font-medium md:inline`,P(e)),children:e.replace(/^tag: /,``)},e)),(0,T.jsx)(`span`,{className:b(`truncate text-xs`,n?`font-semibold text-foreground`:`text-foreground/90`),children:e.subject}),e.parents.length>1&&(0,T.jsx)(g,{className:`h-3.5 w-3.5 shrink-0 text-violet-400`})]})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-bold text-muted-foreground`,children:N(e.author)}),(0,T.jsx)(`span`,{className:`truncate text-[10px] text-muted-foreground`,children:e.author})]}),(0,T.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:j(e.hash)}),(0,T.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:M(e.authoredAt)})]},e.hash)})]})}),(0,T.jsxs)(`footer`,{className:`flex h-7 shrink-0 items-center border-t border-border/70 bg-card/25 px-4 text-[9px] text-muted-foreground`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,T.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-violet-400`}),`Commit`]}),(0,T.jsxs)(`span`,{className:`ml-4 flex items-center gap-1.5`,children:[(0,T.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full border border-emerald-400`}),`Merge`]}),(0,T.jsxs)(`span`,{className:`ml-auto font-mono`,children:[J.length,` commits · topological order`]}),c?.hasMore&&!F&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>q(E,c.commits.length),disabled:I,className:`ml-3 rounded border border-border/70 px-1.5 py-0.5 font-sans text-[9px] font-semibold uppercase tracking-wider hover:border-primary/40 hover:text-primary disabled:opacity-50`,children:`Load more`}),(0,T.jsx)(p,{className:`ml-2 h-3 w-3`})]})]})]}),(0,T.jsx)(le,{commit:fe,detail:m,loading:R,onOpenFile:t=>{e&&v&&(K.current=`${v}:${t.path}`,V(null),W(!0),U(!0),e.getGitCommitFileDiff(v,t.path,t.previousPath))}}),(0,T.jsx)(ae,{open:H,onOpenChange:U,children:(0,T.jsxs)(ne,{className:`h-[min(86dvh,860px)] max-w-[min(94vw,1180px)] grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden p-0 sm:p-0`,children:[(0,T.jsx)(S,{className:`border-b border-border/70 bg-card/80 px-5 py-4 pr-12`,children:(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,T.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/25 bg-primary/10 text-primary`,children:(0,T.jsx)(o,{className:`h-4 w-4`})}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(re,{className:`truncate font-mono text-sm`,children:B?.path??`Commit file diff`}),(0,T.jsxs)(ie,{className:`mt-1 flex items-center gap-2 text-[11px]`,children:[(0,T.jsx)(`span`,{className:`font-mono`,children:B?j(B.hash):`—`}),B?.previousPath&&B.previousPath!==B.path&&(0,T.jsxs)(`span`,{className:`truncate`,children:[`renamed from `,B.previousPath]})]})]})]})}),(0,T.jsx)(`div`,{className:`min-h-0 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,children:(0,T.jsx)(`div`,{className:`flex h-full min-h-0 overflow-hidden rounded-lg border border-border/70 bg-background/70`,children:de||!B?(0,T.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,T.jsx)(s,{className:`h-4 w-4 animate-spin text-primary`}),` Loading revision diff…`]}):B.error?(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-destructive`,children:B.error}):B.binary?(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Binary files cannot be displayed as text.`}):B.tooLarge?(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`This revision is too large for the inline diff viewer.`}):(0,T.jsx)(oe,{oldText:B.oldText??``,newText:B.newText??``,caption:B.path,fill:!0})})})]})})]})}export{F as RepositoryHistoryView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{La as r}from"./vendor-BO-lHyIr.js";import"./i18n-B_njdXiH.js";import{t as i}from"./utils-DQbrPaAM.js";import{t as a}from"./button-h7DHXgna.js";import{t as o}from"./input-DAvKojvP.js";import{g as s}from"./index-CfREDCPe.js";var c=e(t(),1),l=n(),u=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],d=[`unspecified`,`low`,`medium`,`high`,`critical`],f={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-warning/15 text-warning`,submitted:`bg-success/15 text-success`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function p(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function m(){let{t:e}=r(),[t,n]=(0,c.useState)(null),[m,h]=(0,c.useState)([]),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(``),[w,T]=(0,c.useState)(`unspecified`),[E,D]=(0,c.useState)(`unspecified`),[O,k]=(0,c.useState)(!1),[A,j]=(0,c.useState)(null),[M,N]=(0,c.useState)(null),P=(0,c.useCallback)(async()=>{_(!0),y(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let t=await e.json();n(t.projectId),h(t.intakes)}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}},[]);(0,c.useEffect)(()=>{P()},[P]);let F=(0,c.useCallback)(async()=>{let e=b.trim();if(!e){j(`Describe the request first — it is preserved verbatim.`);return}if(!t){j(`No project identity available yet.`);return}k(!0),j(null),N(null);try{let n=await fetch(`/api/projects/${encodeURIComponent(t)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:t,requestedBy:`webui`,originalRequest:e,...S.trim()?{title:S.trim()}:{},...w===`unspecified`?{}:{requestType:w},...E===`unspecified`?{}:{priority:E}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.record)throw Error(r?.error?.message??`Create failed (HTTP ${n.status})`);let i=await fetch(`/api/requirement-intakes/${r.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${i.status})`)}N(`Intake recorded and submitted (${r.record.id}).`),x(``),C(``),T(`unspecified`),D(`unspecified`),await P()}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}},[b,S,w,E,t,P]);return(0,l.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,l.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,l.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e(`activity:reqIntake.requirementsIntake`)}),(0,l.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.collectAndPreserveSoftwareDevelopmentRequests`)})]}),(0,l.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[v?(0,l.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[v,(0,l.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void P(),children:e(`activity:reqIntake.retry`)})]}):null,(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.fileANewIntake`),className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,l.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.fileANewRequest`)}),(0,l.jsxs)(`div`,{className:`space-y-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[e(`activity:reqIntake.requestText`),` `,(0,l.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,l.jsx)(`textarea`,{id:`intake-request`,value:b,onChange:e=>x(e.target.value),placeholder:e(`activity:reqIntake.describeTheFeatureBugFixRefactorOrChange`),rows:4,className:i(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),/\[VIBE\]/i.test(b)?(0,l.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary`,children:[(0,l.jsx)(`span`,{children:`🌊`}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:`VIBE Protocol Detected:`}),` Three-Stage Verification (Spec-Synthesizer → Coder → Auditor) is active.`]})]}):null,(0,l.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.storedVerbatimAsTheRecordApos`)})]}),(0,l.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.titleOptional`)}),(0,l.jsx)(o,{id:`intake-title`,value:S,onChange:e=>C(e.target.value),placeholder:e(`activity:reqIntake.shortDisplayTitle`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.type`)}),(0,l.jsx)(`select`,{id:`intake-type`,value:w,onChange:e=>T(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:u.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.priority`)}),(0,l.jsx)(`select`,{id:`intake-priority`,value:E,onChange:e=>D(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:d.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]})]}),A?(0,l.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:A}):null,M?(0,l.jsx)(`div`,{role:`status`,className:`rounded-md border border-success/30 bg-success/10 px-3 py-2 text-xs text-success`,children:M}):null,(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,l.jsx)(a,{variant:`secondary`,size:`sm`,disabled:O,onClick:()=>{x(``),j(null),N(null)},children:e(`activity:reqIntake.clear`)}),(0,l.jsx)(a,{size:`sm`,disabled:O||!b.trim(),onClick:()=>void F(),children:O?`Filing…`:`File + submit`})]})]})]}),(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.intakeRecords`),className:`space-y-2`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.records`)}),(0,l.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[m.length,` total`]})]}),g?(0,l.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.loading`)}):m.length===0?(0,l.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.noIntakeRecordsYetFileThe`)}):(0,l.jsx)(`ul`,{className:`space-y-2`,children:m.map(e=>(0,l.jsxs)(`li`,{className:`rounded-md border border-border/70 bg-card/60 p-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:e.title,children:e.title}),(0,l.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[e.isVibeMode?(0,l.jsx)(s,{variant:`outline`,className:`border-primary/40 bg-primary/10 text-[10px] text-primary`,children:`🌊 VIBE`}):null,(0,l.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:e.requestType}),(0,l.jsx)(s,{className:i(`text-[10px]`,f[e.status]??`bg-muted text-muted-foreground`),children:e.status})]})]}),(0,l.jsxs)(`div`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:[e.priority,` · updated `,p(e.updatedAt)]})]},e.id))})]})]})]})}export{m as RequirementIntakeView};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{xo as r}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{t as i}from"./utils-CKsqCaP8.js";import{t as a}from"./button-9ewV4TF3.js";import{t as o}from"./input-ag1CrUiS.js";import{_ as s}from"./index-BhXxZMAb.js";var c=e(t(),1),l=n(),u=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],d=[`unspecified`,`low`,`medium`,`high`,`critical`],f={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-warning/15 text-warning`,submitted:`bg-success/15 text-success`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function p(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function m(){let{t:e}=r(),[t,n]=(0,c.useState)(null),[m,h]=(0,c.useState)([]),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(``),[w,T]=(0,c.useState)(`unspecified`),[E,D]=(0,c.useState)(`unspecified`),[O,k]=(0,c.useState)(!1),[A,j]=(0,c.useState)(null),[M,N]=(0,c.useState)(null),P=(0,c.useCallback)(async()=>{_(!0),y(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let t=await e.json();n(t.projectId),h(t.intakes)}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}},[]);(0,c.useEffect)(()=>{P()},[P]);let F=(0,c.useCallback)(async()=>{let e=b.trim();if(!e){j(`Describe the request first — it is preserved verbatim.`);return}if(!t){j(`No project identity available yet.`);return}k(!0),j(null),N(null);try{let n=await fetch(`/api/projects/${encodeURIComponent(t)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:t,requestedBy:`webui`,originalRequest:e,...S.trim()?{title:S.trim()}:{},...w===`unspecified`?{}:{requestType:w},...E===`unspecified`?{}:{priority:E}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.record)throw Error(r?.error?.message??`Create failed (HTTP ${n.status})`);let i=await fetch(`/api/requirement-intakes/${r.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${i.status})`)}N(`Intake recorded and submitted (${r.record.id}).`),x(``),C(``),T(`unspecified`),D(`unspecified`),await P()}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}},[b,S,w,E,t,P]);return(0,l.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,l.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,l.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e(`activity:reqIntake.requirementsIntake`)}),(0,l.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.collectAndPreserveSoftwareDevelopmentRequests`)})]}),(0,l.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[v?(0,l.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[v,(0,l.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void P(),children:e(`activity:reqIntake.retry`)})]}):null,(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.fileANewIntake`),className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,l.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.fileANewRequest`)}),(0,l.jsxs)(`div`,{className:`space-y-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[e(`activity:reqIntake.requestText`),` `,(0,l.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,l.jsx)(`textarea`,{id:`intake-request`,value:b,onChange:e=>x(e.target.value),placeholder:e(`activity:reqIntake.describeTheFeatureBugFixRefactorOrChange`),rows:4,className:i(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),/\[VIBE\]/i.test(b)?(0,l.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary`,children:[(0,l.jsx)(`span`,{children:`🌊`}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:`VIBE Protocol Detected:`}),` Three-Stage Verification (Spec-Synthesizer → Coder → Auditor) is active.`]})]}):null,(0,l.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.storedVerbatimAsTheRecordApos`)})]}),(0,l.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.titleOptional`)}),(0,l.jsx)(o,{id:`intake-title`,value:S,onChange:e=>C(e.target.value),placeholder:e(`activity:reqIntake.shortDisplayTitle`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.type`)}),(0,l.jsx)(`select`,{id:`intake-type`,value:w,onChange:e=>T(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:u.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.priority`)}),(0,l.jsx)(`select`,{id:`intake-priority`,value:E,onChange:e=>D(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:d.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]})]}),A?(0,l.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:A}):null,M?(0,l.jsx)(`div`,{role:`status`,className:`rounded-md border border-success/30 bg-success/10 px-3 py-2 text-xs text-success`,children:M}):null,(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,l.jsx)(a,{variant:`secondary`,size:`sm`,disabled:O,onClick:()=>{x(``),j(null),N(null)},children:e(`activity:reqIntake.clear`)}),(0,l.jsx)(a,{size:`sm`,disabled:O||!b.trim(),onClick:()=>void F(),children:O?`Filing…`:`File + submit`})]})]})]}),(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.intakeRecords`),className:`space-y-2`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.records`)}),(0,l.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[m.length,` total`]})]}),g?(0,l.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.loading`)}):m.length===0?(0,l.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.noIntakeRecordsYetFileThe`)}):(0,l.jsx)(`ul`,{className:`space-y-2`,children:m.map(e=>(0,l.jsxs)(`li`,{className:`rounded-md border border-border/70 bg-card/60 p-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:e.title,children:e.title}),(0,l.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[e.isVibeMode?(0,l.jsx)(s,{variant:`outline`,className:`border-primary/40 bg-primary/10 text-[10px] text-primary`,children:`🌊 VIBE`}):null,(0,l.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:e.requestType}),(0,l.jsx)(s,{className:i(`text-[10px]`,f[e.status]??`bg-muted text-muted-foreground`),children:e.status})]})]}),(0,l.jsxs)(`div`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:[e.priority,` · updated `,p(e.updatedAt)]})]},e.id))})]})]})]})}export{m as RequirementIntakeView};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryManager-BtC4dOvO.js","assets/rolldown-runtime-hePW80VL.js","assets/config-store-BAUadwHd.js","assets/react-core-wiHys0m2.js","assets/vendor-V3ydTHqN.js","assets/xyflow-BqDBClm9.js","assets/xyflow-DLioOiRN.css","assets/markdown-CXRzjX3p.js","assets/vendor-jL-bRT8f.css","assets/i18n-CbyUyl6G.js","assets/chat-BITJe8-v.js","assets/commandPalette-BovBiPec.js","assets/common-CmkkiJUR.js","assets/setup-qooXjj4V.js","assets/toasts-DZ6HdKgG.js","assets/vite-preload-BZ1Pz5am.js","assets/utils-CKsqCaP8.js","assets/ui-store-DC3mkswy.js","assets/fonts-DRGbd-AM.js","assets/stores-BIVCS5nu.js","assets/chat-store-DNRce6sE.js","assets/codemap-activity-store-Ha7XbGgq.js","assets/mailbox-store-C49LeBj8.js","assets/dialog-C7EIBM_2.js","assets/button-9ewV4TF3.js","assets/input-ag1CrUiS.js","assets/index-BhXxZMAb.js","assets/view-navigation-DHtNFXIl.js","assets/index-BssEH_2N.css","assets/roster-ws-z8DKquaN.js","assets/shared-BFJvAYzX.js","assets/MemoryDrawer-IMvyNAhc.js","assets/AudienceMemoryPanel-CdGaL5ob.js","assets/vector-memory-panel-DZFEwwGM.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Lr as r,Vt as i,ur as a,xo as o}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{t as s}from"./vite-preload-BZ1Pz5am.js";import{t as c}from"./utils-CKsqCaP8.js";import{A as l,O as u,j as d,k as f}from"./index-BhXxZMAb.js";var p=e(t(),1),m=n(),h=(0,p.lazy)(()=>s(()=>import(`./MemoryManager-BtC4dOvO.js`).then(e=>({default:e.MemoryManager})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),g=(0,p.lazy)(()=>s(()=>import(`./AudienceMemoryPanel-CdGaL5ob.js`).then(e=>({default:e.AudienceMemoryPanel})),__vite__mapDeps([32,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,23,24,25,26,2,17,18,27,19,20,21,22,28,30]))),_=(0,p.lazy)(()=>s(()=>import(`./vector-memory-panel-DZFEwwGM.js`).then(e=>({default:e.VectorMemoryPanel})),__vite__mapDeps([33,1,3,4,5,6,7,8,23,16,24])));function v({label:e}){return(0,m.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background text-xs text-muted-foreground`,"aria-busy":`true`,children:(0,m.jsxs)(`span`,{className:`font-mono uppercase tracking-wide`,children:[e,`…`]})})}var y=[{value:`all`,label:`activity:memoryManager.tabAllMemories`,hint:`activity:memoryManager.tabAllMemoriesHint`,Icon:r},{value:`audience`,label:`activity:memoryManager.tabAudience`,hint:`activity:memoryManager.tabAudienceHint`,Icon:i},{value:`vector`,label:`activity:memoryManager.tabVectorMemory`,hint:`activity:memoryManager.tabVectorMemoryHint`,Icon:a}];function b({defaultValue:e=`all`}={}){let{t}=o();return(0,m.jsxs)(u,{defaultValue:e,className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,children:[(0,m.jsx)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-border/70 bg-card/55 px-4 py-2 sm:px-5`,role:`presentation`,children:(0,m.jsx)(l,{"aria-label":t(`activity:memoryManager.lensesAria`),className:`h-9 bg-muted/40 p-1 shadow-none`,children:y.map(({value:e,label:n,hint:r,Icon:i})=>(0,m.jsxs)(d,{value:e,className:c(`h-7 gap-2 px-3 text-[11px] font-semibold uppercase tracking-wide`,`data-[state=active]:bg-background data-[state=active]:text-foreground`,`data-[state=active]:shadow-[0_0_0_1px_hsl(var(--border)/0.7)]`),children:[(0,m.jsx)(i,{className:`size-3.5`}),(0,m.jsx)(`span`,{children:t(n)}),(0,m.jsx)(`span`,{className:`hidden font-mono text-[9px] font-normal normal-case text-muted-foreground sm:inline`,children:t(r)})]},e))})}),(0,m.jsx)(f,{value:`all`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingSage`)}),children:(0,m.jsx)(h,{})})}),(0,m.jsx)(f,{value:`audience`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingAudience`)}),children:(0,m.jsx)(g,{})})}),(0,m.jsx)(f,{value:`vector`,className:`mt-0 flex-1 overflow-y-auto px-4 pb-6 pt-4 ring-offset-0 focus-visible:ring-0 sm:px-5`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingVectorMemory`)}),children:(0,m.jsx)(_,{})})})]})}export{b as SageTabs};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{$a as r,In as i,Jn as a,Mr as o,Mt as s,Pa as c,Va as l,Wr as u,Yt as d,bn as f,ci as p,dn as m,ii as h,wa as g,xo as _}from"./vendor-V3ydTHqN.js";import"./i18n-CbyUyl6G.js";import{a as v,c as y,h as b,n as x,o as S,p as C,r as w,t as T,u as E}from"./xyflow-BqDBClm9.js";import{t as D}from"./utils-CKsqCaP8.js";var O=e(t(),1),k=n();function A({pct:e}){let{t}=_(),n=(0,O.useId)(),r=2*Math.PI*26,i=r-Math.max(0,Math.min(100,e))/100*r;return(0,k.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,role:`img`,"aria-label":t(`activity:progressring.progress`),children:[(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(var(--muted))`,strokeWidth:`6`}),(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#${n})`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:r,strokeDashoffset:i,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,k.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--primary))`}),(0,k.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--info))`})]})})]}),(0,k.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}var j={pending:{label:`Pending`,icon:g,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`},queued:{label:`Ready`,icon:g,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--primary))`},in_progress:{label:`Running`,icon:o,spin:!0,text:`text-warning`,ring:`border-warning/45 bg-warning/10`,dot:`bg-warning`,hex:`hsl(var(--warning))`},blocked:{label:`Blocked`,icon:g,text:`text-destructive`,ring:`border-destructive/30 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},review:{label:`Review`,icon:g,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--info))`},failed:{label:`Failed`,icon:s,text:`text-destructive`,ring:`border-destructive/45 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},completed:{label:`Done`,icon:c,text:`text-success`,ring:`border-success/35 bg-success/10`,dot:`bg-success`,hex:`hsl(var(--success))`},cancelled:{label:`Cancelled`,icon:r,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`}};function M(e){return j[e]??j.pending}var N={critical:{text:`text-destructive`,chip:`bg-destructive/10 text-destructive`},high:{text:`text-warning`,chip:`bg-warning/12 text-warning`},medium:{text:`text-primary`,chip:`bg-primary/10 text-primary`},low:{text:`text-muted-foreground`,chip:`bg-muted text-muted-foreground`}};function P(e){return N[e]??N.medium}var F={running:`border-primary/35 bg-primary/10 text-primary`,paused:`border-warning/35 bg-warning/10 text-warning`,stopped:`border-border/70 bg-muted text-muted-foreground`,completed:`border-success/35 bg-success/10 text-success`,failed:`border-destructive/35 bg-destructive/10 text-destructive`,deadlocked:`border-destructive/35 bg-destructive/10 text-destructive`,idle:`border-border bg-muted text-muted-foreground`},I=[`bg-warning`,`bg-primary`,`bg-success`,`bg-destructive`,`bg-secondary`,`bg-muted-foreground`,`bg-accent`],L={started:{icon:a,color:`text-warning`},completed:{icon:c,color:`text-success`},failed:{icon:s,color:`text-destructive`},retrying:{icon:i,color:`text-warning`},wave:{icon:u,color:`text-primary`},deadlock:{icon:d,color:`text-destructive`},verification_failed:{icon:f,color:`text-destructive`},conflict:{icon:h,color:`text-warning`},split:{icon:m,color:`text-primary`},supervisor:{icon:l,color:`text-primary`}};function R(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function z(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function B(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var V=300,H=128,U=240,W={pending:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`},queued:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},in_progress:{ring:`border-warning/45`,chip:`bg-warning/12 text-warning`,dot:`bg-warning`},blocked:{ring:`border-destructive/30`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},review:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},failed:{ring:`border-destructive/45`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},completed:{ring:`border-success/35`,chip:`bg-success/12 text-success`,dot:`bg-success`},cancelled:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`}};function G({data:e}){let t=e.task,{t:n}=_(),r=W[t.displayStatus],a=t.displayStatus===`in_progress`,l=t.displayStatus===`completed`?c:t.displayStatus===`failed`?s:a?o:g;return(0,k.jsxs)(`div`,{className:D(`sdd-node-enter group relative rounded-lg border bg-card/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,r.ring,a&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`hover:brightness-125`),style:{width:U,animationDelay:`${Math.min(e.index*45,600)}ms`},children:[e.onTaskClick&&(0,k.jsx)(`button`,{type:`button`,"aria-label":n(`activity:sdd.openTask`,{title:t.title,defaultValue:`Open task: ${t.title}`}),className:`absolute inset-0 z-10 cursor-pointer rounded-lg`,onClick:()=>e.onTaskClick?.(t.id)}),(0,k.jsx)(v,{type:`target`,position:b.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsx)(v,{type:`source`,position:b.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,k.jsx)(l,{className:D(`h-3.5 w-3.5`,a&&`animate-spin`,r.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,k.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t.shortId}),(0,k.jsx)(`span`,{className:D(`font-mono text-[10px] font-bold uppercase`,P(t.priority).text),children:t.priority[0]}),(0,k.jsx)(`span`,{className:D(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,r.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,k.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,k.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`span`,{className:D(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,a?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:R(t.agentName)}),(0,k.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-muted-foreground`,children:t.agentName})]}),t.retries?(0,k.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,k.jsx)(i,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,k.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-muted-foreground`,title:t.worktreeBranch,children:[(0,k.jsx)(p,{className:`h-2.5 w-2.5`}),(0,k.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function K({data:e}){return(0,k.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase text-muted-foreground`,children:e.label})}var q={task:G,colLabel:K};function J(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*V,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*V,y:o*H},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:M(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function Y({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=C(),{nodes:i,edges:a}=(0,O.useMemo)(()=>J(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,k.jsxs)(E,{nodes:i,edges:a,nodeTypes:q,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,k.jsx)(T,{variant:x.Dots,gap:22,size:1,color:`hsl(var(--border))`}),(0,k.jsx)(w,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,k.jsx)(S,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`hsl(var(--background) / 0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?M(t).hex:`hsl(var(--muted-foreground))`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-border/70 bg-card`})]})}function X({tasks:e,columns:t,onTaskClick:n}){return(0,k.jsx)(y,{children:(0,k.jsx)(Y,{tasks:e,columns:t,onTaskClick:n})})}export{R as a,P as c,F as i,M as l,I as n,B as o,L as r,z as s,X as t,A as u};