claude-code-workflow 7.2.6 → 7.2.7

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 (206) hide show
  1. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
  2. package/ccw/dist/core/routes/codexlens/config-handlers.js +4 -0
  3. package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
  4. package/ccw/dist/mcp-server/index.js +85 -8
  5. package/ccw/dist/mcp-server/index.js.map +1 -1
  6. package/ccw/dist/tools/smart-search.d.ts +72 -1
  7. package/ccw/dist/tools/smart-search.d.ts.map +1 -1
  8. package/ccw/dist/tools/smart-search.js +726 -117
  9. package/ccw/dist/tools/smart-search.js.map +1 -1
  10. package/ccw/frontend/dist/assets/{AlertDialog-BMFUcfv_.js → AlertDialog-CSZq4WHZ.js} +2 -2
  11. package/ccw/frontend/dist/assets/{AlertDialog-BMFUcfv_.js.map → AlertDialog-CSZq4WHZ.js.map} +1 -1
  12. package/ccw/frontend/dist/assets/{AnalysisPage-Bxa333tD.js → AnalysisPage-DVDvLHqI.js} +2 -2
  13. package/ccw/frontend/dist/assets/{AnalysisPage-Bxa333tD.js.map → AnalysisPage-DVDvLHqI.js.map} +1 -1
  14. package/ccw/frontend/dist/assets/{ApiSettingsPage-BFVU-wcR.js → ApiSettingsPage-D69j8mI6.js} +2 -2
  15. package/ccw/frontend/dist/assets/{ApiSettingsPage-BFVU-wcR.js.map → ApiSettingsPage-D69j8mI6.js.map} +1 -1
  16. package/ccw/frontend/dist/assets/{CliModeToggle-MDoFAJPL.js → CliModeToggle-fF9xHeGR.js} +2 -2
  17. package/ccw/frontend/dist/assets/{CliModeToggle-MDoFAJPL.js.map → CliModeToggle-fF9xHeGR.js.map} +1 -1
  18. package/ccw/frontend/dist/assets/{CliSessionSharePage-DkRmLiNN.js → CliSessionSharePage-Ce8tOQNx.js} +2 -2
  19. package/ccw/frontend/dist/assets/{CliSessionSharePage-DkRmLiNN.js.map → CliSessionSharePage-Ce8tOQNx.js.map} +1 -1
  20. package/ccw/frontend/dist/assets/{CliViewerPage-DN8jWddy.js → CliViewerPage-Bsp1zmfD.js} +2 -2
  21. package/ccw/frontend/dist/assets/{CliViewerPage-DN8jWddy.js.map → CliViewerPage-Bsp1zmfD.js.map} +1 -1
  22. package/ccw/frontend/dist/assets/{CodexLensManagerPage-Du_VAJtC.js → CodexLensManagerPage-DUMzbrr9.js} +9 -9
  23. package/ccw/frontend/dist/assets/CodexLensManagerPage-DUMzbrr9.js.map +1 -0
  24. package/ccw/frontend/dist/assets/{Collapsible-CF5bSyzt.js → Collapsible-I5pixbHb.js} +2 -2
  25. package/ccw/frontend/dist/assets/{Collapsible-CF5bSyzt.js.map → Collapsible-I5pixbHb.js.map} +1 -1
  26. package/ccw/frontend/dist/assets/{CommandsManagerPage-Bm_P9I76.js → CommandsManagerPage-BH2xukdx.js} +2 -2
  27. package/ccw/frontend/dist/assets/{CommandsManagerPage-Bm_P9I76.js.map → CommandsManagerPage-BH2xukdx.js.map} +1 -1
  28. package/ccw/frontend/dist/assets/{DeepWikiPage-2YIlfWhz.js → DeepWikiPage-D41ccWzY.js} +2 -2
  29. package/ccw/frontend/dist/assets/{DeepWikiPage-2YIlfWhz.js.map → DeepWikiPage-D41ccWzY.js.map} +1 -1
  30. package/ccw/frontend/dist/assets/{EndpointsPage-CMVNz5PY.js → EndpointsPage-5a8jfEWN.js} +2 -2
  31. package/ccw/frontend/dist/assets/{EndpointsPage-CMVNz5PY.js.map → EndpointsPage-5a8jfEWN.js.map} +1 -1
  32. package/ccw/frontend/dist/assets/{ExplorerPage-C-KFz8YU.js → ExplorerPage-YCqIOu1v.js} +2 -2
  33. package/ccw/frontend/dist/assets/{ExplorerPage-C-KFz8YU.js.map → ExplorerPage-YCqIOu1v.js.map} +1 -1
  34. package/ccw/frontend/dist/assets/{FixSessionPage-CdKND69l.js → FixSessionPage-wK1s4kbo.js} +2 -2
  35. package/ccw/frontend/dist/assets/{FixSessionPage-CdKND69l.js.map → FixSessionPage-wK1s4kbo.js.map} +1 -1
  36. package/ccw/frontend/dist/assets/{FloatingFileBrowser-Bf4iqOSd.js → FloatingFileBrowser-B1U6uk_5.js} +2 -2
  37. package/ccw/frontend/dist/assets/{FloatingFileBrowser-Bf4iqOSd.js.map → FloatingFileBrowser-B1U6uk_5.js.map} +1 -1
  38. package/ccw/frontend/dist/assets/{FloatingPanel-CJbvABPb.js → FloatingPanel-D51p5jNy.js} +2 -2
  39. package/ccw/frontend/dist/assets/{FloatingPanel-CJbvABPb.js.map → FloatingPanel-D51p5jNy.js.map} +1 -1
  40. package/ccw/frontend/dist/assets/{GraphExplorerPage-DPoozRTR.js → GraphExplorerPage-DpIWrpWH.js} +2 -2
  41. package/ccw/frontend/dist/assets/{GraphExplorerPage-DPoozRTR.js.map → GraphExplorerPage-DpIWrpWH.js.map} +1 -1
  42. package/ccw/frontend/dist/assets/{HistoryPage-DOMa9gJX.js → HistoryPage-C09lyJGN.js} +2 -2
  43. package/ccw/frontend/dist/assets/{HistoryPage-DOMa9gJX.js.map → HistoryPage-C09lyJGN.js.map} +1 -1
  44. package/ccw/frontend/dist/assets/{HookManagerPage-Cfn2UEyy.js → HookManagerPage-CFBe8F_G.js} +2 -2
  45. package/ccw/frontend/dist/assets/{HookManagerPage-Cfn2UEyy.js.map → HookManagerPage-CFBe8F_G.js.map} +1 -1
  46. package/ccw/frontend/dist/assets/{InstallationsPage-qngOxLvm.js → InstallationsPage-qt7NxnsB.js} +2 -2
  47. package/ccw/frontend/dist/assets/{InstallationsPage-qngOxLvm.js.map → InstallationsPage-qt7NxnsB.js.map} +1 -1
  48. package/ccw/frontend/dist/assets/{IssueHubPage-Cvf7tH8p.js → IssueHubPage-CHol1-Ap.js} +2 -2
  49. package/ccw/frontend/dist/assets/{IssueHubPage-Cvf7tH8p.js.map → IssueHubPage-CHol1-Ap.js.map} +1 -1
  50. package/ccw/frontend/dist/assets/{LiteTasksPage-D20smVCY.js → LiteTasksPage-jH00SLnZ.js} +2 -2
  51. package/ccw/frontend/dist/assets/{LiteTasksPage-D20smVCY.js.map → LiteTasksPage-jH00SLnZ.js.map} +1 -1
  52. package/ccw/frontend/dist/assets/{McpManagerPage-Bld27yu4.js → McpManagerPage-BS-HgeQJ.js} +11 -11
  53. package/ccw/frontend/dist/assets/McpManagerPage-BS-HgeQJ.js.map +1 -0
  54. package/ccw/frontend/dist/assets/{MemoryPage-DmknNdBh.js → MemoryPage-1UahrmRX.js} +2 -2
  55. package/ccw/frontend/dist/assets/{MemoryPage-DmknNdBh.js.map → MemoryPage-1UahrmRX.js.map} +1 -1
  56. package/ccw/frontend/dist/assets/{NotFoundPage-DdwPN1xU.js → NotFoundPage-5FVm_IkS.js} +2 -2
  57. package/ccw/frontend/dist/assets/{NotFoundPage-DdwPN1xU.js.map → NotFoundPage-5FVm_IkS.js.map} +1 -1
  58. package/ccw/frontend/dist/assets/{OrchestratorPage-CgDdmvBg.js → OrchestratorPage-ThBG24Gg.js} +2 -2
  59. package/ccw/frontend/dist/assets/{OrchestratorPage-CgDdmvBg.js.map → OrchestratorPage-ThBG24Gg.js.map} +1 -1
  60. package/ccw/frontend/dist/assets/{ProjectOverviewPage-9Ze9quxh.js → ProjectOverviewPage-CrmW0IxI.js} +2 -2
  61. package/ccw/frontend/dist/assets/{ProjectOverviewPage-9Ze9quxh.js.map → ProjectOverviewPage-CrmW0IxI.js.map} +1 -1
  62. package/ccw/frontend/dist/assets/{PromptHistoryPage-YRkBppOx.js → PromptHistoryPage-1cCGwS3s.js} +2 -2
  63. package/ccw/frontend/dist/assets/{PromptHistoryPage-YRkBppOx.js.map → PromptHistoryPage-1cCGwS3s.js.map} +1 -1
  64. package/ccw/frontend/dist/assets/{ReviewSessionPage-DSaeHw83.js → ReviewSessionPage-DxiEc9HK.js} +2 -2
  65. package/ccw/frontend/dist/assets/{ReviewSessionPage-DSaeHw83.js.map → ReviewSessionPage-DxiEc9HK.js.map} +1 -1
  66. package/ccw/frontend/dist/assets/{RulesManagerPage-BpGwS_jB.js → RulesManagerPage-BpplliZF.js} +2 -2
  67. package/ccw/frontend/dist/assets/{RulesManagerPage-BpGwS_jB.js.map → RulesManagerPage-BpplliZF.js.map} +1 -1
  68. package/ccw/frontend/dist/assets/{SessionDetailPage-B_YHME7k.js → SessionDetailPage-crDIiysh.js} +2 -2
  69. package/ccw/frontend/dist/assets/{SessionDetailPage-B_YHME7k.js.map → SessionDetailPage-crDIiysh.js.map} +1 -1
  70. package/ccw/frontend/dist/assets/{SessionsPage-bW6kEEib.js → SessionsPage-DThweYY8.js} +2 -2
  71. package/ccw/frontend/dist/assets/{SessionsPage-bW6kEEib.js.map → SessionsPage-DThweYY8.js.map} +1 -1
  72. package/ccw/frontend/dist/assets/{SettingsPage-CSwUd2Bw.js → SettingsPage-OCdOz5-z.js} +4 -4
  73. package/ccw/frontend/dist/assets/{SettingsPage-CSwUd2Bw.js.map → SettingsPage-OCdOz5-z.js.map} +1 -1
  74. package/ccw/frontend/dist/assets/{SkillsManagerPage-CyqKvFUi.js → SkillsManagerPage-BJd3bK1G.js} +2 -2
  75. package/ccw/frontend/dist/assets/{SkillsManagerPage-CyqKvFUi.js.map → SkillsManagerPage-BJd3bK1G.js.map} +1 -1
  76. package/ccw/frontend/dist/assets/{SpecsSettingsPage-DHqQNW_y.js → SpecsSettingsPage-BAWL2cpO.js} +2 -2
  77. package/ccw/frontend/dist/assets/{SpecsSettingsPage-DHqQNW_y.js.map → SpecsSettingsPage-BAWL2cpO.js.map} +1 -1
  78. package/ccw/frontend/dist/assets/{Switch-s_-xzEWF.js → Switch-w0I3JCcC.js} +2 -2
  79. package/ccw/frontend/dist/assets/{Switch-s_-xzEWF.js.map → Switch-w0I3JCcC.js.map} +1 -1
  80. package/ccw/frontend/dist/assets/{TabsNavigation-CU50UxOb.js → TabsNavigation-jhUge9YV.js} +2 -2
  81. package/ccw/frontend/dist/assets/{TabsNavigation-CU50UxOb.js.map → TabsNavigation-jhUge9YV.js.map} +1 -1
  82. package/ccw/frontend/dist/assets/{TaskDrawer-128XISsA.js → TaskDrawer-APWpZulm.js} +2 -2
  83. package/ccw/frontend/dist/assets/{TaskDrawer-128XISsA.js.map → TaskDrawer-APWpZulm.js.map} +1 -1
  84. package/ccw/frontend/dist/assets/{TeamPage-Bg_KII8B.js → TeamPage-8OnLsAfJ.js} +2 -2
  85. package/ccw/frontend/dist/assets/{TeamPage-Bg_KII8B.js.map → TeamPage-8OnLsAfJ.js.map} +1 -1
  86. package/ccw/frontend/dist/assets/{TerminalDashboardPage-CQ9K2zwB.js → TerminalDashboardPage-Be1hcN4p.js} +2 -2
  87. package/ccw/frontend/dist/assets/{TerminalDashboardPage-CQ9K2zwB.js.map → TerminalDashboardPage-Be1hcN4p.js.map} +1 -1
  88. package/ccw/frontend/dist/assets/{archive--nR2vYUk.js → archive-Bo1tC9yo.js} +2 -2
  89. package/ccw/frontend/dist/assets/{archive--nR2vYUk.js.map → archive-Bo1tC9yo.js.map} +1 -1
  90. package/ccw/frontend/dist/assets/{archive-restore-CZ7graO0.js → archive-restore-DYx41yLJ.js} +2 -2
  91. package/ccw/frontend/dist/assets/{archive-restore-CZ7graO0.js.map → archive-restore-DYx41yLJ.js.map} +1 -1
  92. package/ccw/frontend/dist/assets/{arrow-right-ChKhpVhq.js → arrow-right-C6pOqWF1.js} +2 -2
  93. package/ccw/frontend/dist/assets/{arrow-right-ChKhpVhq.js.map → arrow-right-C6pOqWF1.js.map} +1 -1
  94. package/ccw/frontend/dist/assets/{bookmark-plus-X-JcgObI.js → bookmark-plus-4Qpa6hMJ.js} +2 -2
  95. package/ccw/frontend/dist/assets/{bookmark-plus-X-JcgObI.js.map → bookmark-plus-4Qpa6hMJ.js.map} +1 -1
  96. package/ccw/frontend/dist/assets/{bot-C3uo7Fkg.js → bot-HXJTmx8r.js} +2 -2
  97. package/ccw/frontend/dist/assets/{bot-C3uo7Fkg.js.map → bot-HXJTmx8r.js.map} +1 -1
  98. package/ccw/frontend/dist/assets/{braces-5wZupwrA.js → braces-Dj2IdY7I.js} +2 -2
  99. package/ccw/frontend/dist/assets/{braces-5wZupwrA.js.map → braces-Dj2IdY7I.js.map} +1 -1
  100. package/ccw/frontend/dist/assets/{circle-stop-DZ5hLKjQ.js → circle-stop-M29TJKHc.js} +2 -2
  101. package/ccw/frontend/dist/assets/{circle-stop-DZ5hLKjQ.js.map → circle-stop-M29TJKHc.js.map} +1 -1
  102. package/ccw/frontend/dist/assets/{cpu-Dc8IS79i.js → cpu-DX15mzMT.js} +2 -2
  103. package/ccw/frontend/dist/assets/{cpu-Dc8IS79i.js.map → cpu-DX15mzMT.js.map} +1 -1
  104. package/ccw/frontend/dist/assets/{ellipsis-vertical-B4pqbrsR.js → ellipsis-vertical-Fs6bysWx.js} +2 -2
  105. package/ccw/frontend/dist/assets/{ellipsis-vertical-B4pqbrsR.js.map → ellipsis-vertical-Fs6bysWx.js.map} +1 -1
  106. package/ccw/frontend/dist/assets/{eye-BwniwXnu.js → eye-D6BRlJ1r.js} +2 -2
  107. package/ccw/frontend/dist/assets/{eye-BwniwXnu.js.map → eye-D6BRlJ1r.js.map} +1 -1
  108. package/ccw/frontend/dist/assets/{eye-off-BWntEdln.js → eye-off-DjbIj5iN.js} +2 -2
  109. package/ccw/frontend/dist/assets/{eye-off-BWntEdln.js.map → eye-off-DjbIj5iN.js.map} +1 -1
  110. package/ccw/frontend/dist/assets/{file-json-BDcmkaVn.js → file-json-kg4Lid-H.js} +2 -2
  111. package/ccw/frontend/dist/assets/{file-json-BDcmkaVn.js.map → file-json-kg4Lid-H.js.map} +1 -1
  112. package/ccw/frontend/dist/assets/{file-text-DsqI3R_g.js → file-text-BMy5pXNV.js} +2 -2
  113. package/ccw/frontend/dist/assets/{file-text-DsqI3R_g.js.map → file-text-BMy5pXNV.js.map} +1 -1
  114. package/ccw/frontend/dist/assets/{filter-CQMcD8RT.js → filter-BTN-lUUb.js} +2 -2
  115. package/ccw/frontend/dist/assets/{filter-CQMcD8RT.js.map → filter-BTN-lUUb.js.map} +1 -1
  116. package/ccw/frontend/dist/assets/{folder-jX77-MUi.js → folder-ChYtty7V.js} +2 -2
  117. package/ccw/frontend/dist/assets/{folder-jX77-MUi.js.map → folder-ChYtty7V.js.map} +1 -1
  118. package/ccw/frontend/dist/assets/{gauge-yQjRXM3o.js → gauge-C0VJbjRb.js} +2 -2
  119. package/ccw/frontend/dist/assets/{gauge-yQjRXM3o.js.map → gauge-C0VJbjRb.js.map} +1 -1
  120. package/ccw/frontend/dist/assets/{globe-BecpCHYI.js → globe-DbNfDXnv.js} +2 -2
  121. package/ccw/frontend/dist/assets/{globe-BecpCHYI.js.map → globe-DbNfDXnv.js.map} +1 -1
  122. package/ccw/frontend/dist/assets/{grid-3x3-BrvzDFqU.js → grid-3x3-xWcpBNxo.js} +2 -2
  123. package/ccw/frontend/dist/assets/{grid-3x3-BrvzDFqU.js.map → grid-3x3-xWcpBNxo.js.map} +1 -1
  124. package/ccw/frontend/dist/assets/{hard-drive-B0cynodE.js → hard-drive-BTACzgUO.js} +2 -2
  125. package/ccw/frontend/dist/assets/{hard-drive-B0cynodE.js.map → hard-drive-BTACzgUO.js.map} +1 -1
  126. package/ccw/frontend/dist/assets/{hash-xOrTLxBg.js → hash-B0dYlmyB.js} +2 -2
  127. package/ccw/frontend/dist/assets/{hash-xOrTLxBg.js.map → hash-B0dYlmyB.js.map} +1 -1
  128. package/ccw/frontend/dist/assets/{history-BzXwj8RL.js → history-CRRLu6ck.js} +2 -2
  129. package/ccw/frontend/dist/assets/{history-BzXwj8RL.js.map → history-CRRLu6ck.js.map} +1 -1
  130. package/ccw/frontend/dist/assets/{index-BNZGm_Ur.js → index-BJIIo0B3.js} +2 -2
  131. package/ccw/frontend/dist/assets/{index-BNZGm_Ur.js.map → index-BJIIo0B3.js.map} +1 -1
  132. package/ccw/frontend/dist/assets/{index-osmL8__2.js → index-BP-D3Wv6.js} +2 -2
  133. package/ccw/frontend/dist/assets/{index-osmL8__2.js.map → index-BP-D3Wv6.js.map} +1 -1
  134. package/ccw/frontend/dist/assets/{index-DflI9CwB.js → index-B_QzEioU.js} +2 -2
  135. package/ccw/frontend/dist/assets/{index-DflI9CwB.js.map → index-B_QzEioU.js.map} +1 -1
  136. package/ccw/frontend/dist/assets/{index-B9aFbBPN.js → index-BpoRYgiq.js} +2 -2
  137. package/ccw/frontend/dist/assets/{index-B9aFbBPN.js.map → index-BpoRYgiq.js.map} +1 -1
  138. package/ccw/frontend/dist/assets/{index-Dy0tUf1F.js → index-CeESlrZb.js} +8 -8
  139. package/ccw/frontend/dist/assets/{index-Dy0tUf1F.js.map → index-CeESlrZb.js.map} +1 -1
  140. package/ccw/frontend/dist/assets/{index-D3uMibtZ.js → index-DzTbMyaS.js} +4 -4
  141. package/ccw/frontend/dist/assets/{index-D3uMibtZ.js.map → index-DzTbMyaS.js.map} +1 -1
  142. package/ccw/frontend/dist/assets/{layout-grid-CWFZqQWu.js → layout-grid-ZN26YcTM.js} +2 -2
  143. package/ccw/frontend/dist/assets/{layout-grid-CWFZqQWu.js.map → layout-grid-ZN26YcTM.js.map} +1 -1
  144. package/ccw/frontend/dist/assets/{lightbulb-BRLgsWe3.js → lightbulb-BHrwx9j6.js} +2 -2
  145. package/ccw/frontend/dist/assets/{lightbulb-BRLgsWe3.js.map → lightbulb-BHrwx9j6.js.map} +1 -1
  146. package/ccw/frontend/dist/assets/{link-2-BpKdq14u.js → link-2-zZRu2j4G.js} +2 -2
  147. package/ccw/frontend/dist/assets/{link-2-BpKdq14u.js.map → link-2-zZRu2j4G.js.map} +1 -1
  148. package/ccw/frontend/dist/assets/{link-BxUCReDi.js → link-8lz-HgnZ.js} +2 -2
  149. package/ccw/frontend/dist/assets/{link-BxUCReDi.js.map → link-8lz-HgnZ.js.map} +1 -1
  150. package/ccw/frontend/dist/assets/{list-Ce9EsAg8.js → list-DlablIjt.js} +2 -2
  151. package/ccw/frontend/dist/assets/{list-Ce9EsAg8.js.map → list-DlablIjt.js.map} +1 -1
  152. package/ccw/frontend/dist/assets/{map-pin-CxzQV1hS.js → map-pin-JAsCUplr.js} +2 -2
  153. package/ccw/frontend/dist/assets/{map-pin-CxzQV1hS.js.map → map-pin-JAsCUplr.js.map} +1 -1
  154. package/ccw/frontend/dist/assets/{messages-square-Dyodk79r.js → messages-square-D0iSFb2Y.js} +2 -2
  155. package/ccw/frontend/dist/assets/{messages-square-Dyodk79r.js.map → messages-square-D0iSFb2Y.js.map} +1 -1
  156. package/ccw/frontend/dist/assets/{minimize-2-s0009UK9.js → minimize-2-BJmkU9CE.js} +2 -2
  157. package/ccw/frontend/dist/assets/{minimize-2-s0009UK9.js.map → minimize-2-BJmkU9CE.js.map} +1 -1
  158. package/ccw/frontend/dist/assets/{package-C69biuJL.js → package-DYrbBCxk.js} +2 -2
  159. package/ccw/frontend/dist/assets/{package-C69biuJL.js.map → package-DYrbBCxk.js.map} +1 -1
  160. package/ccw/frontend/dist/assets/{plug-DERl-wQd.js → plug-VG7-23M-.js} +2 -2
  161. package/ccw/frontend/dist/assets/{plug-DERl-wQd.js.map → plug-VG7-23M-.js.map} +1 -1
  162. package/ccw/frontend/dist/assets/{power-CdvaDgTh.js → power-zPFYNx7u.js} +2 -2
  163. package/ccw/frontend/dist/assets/{power-CdvaDgTh.js.map → power-zPFYNx7u.js.map} +1 -1
  164. package/ccw/frontend/dist/assets/{save-C_Uot2e4.js → save-D4XQY9i9.js} +2 -2
  165. package/ccw/frontend/dist/assets/{save-C_Uot2e4.js.map → save-D4XQY9i9.js.map} +1 -1
  166. package/ccw/frontend/dist/assets/{send-R1XtAXeP.js → send-ClSnDjj-.js} +2 -2
  167. package/ccw/frontend/dist/assets/{send-R1XtAXeP.js.map → send-ClSnDjj-.js.map} +1 -1
  168. package/ccw/frontend/dist/assets/{square-check-big-Cyqi4INj.js → square-check-big-Bffh_MFc.js} +2 -2
  169. package/ccw/frontend/dist/assets/{square-check-big-Cyqi4INj.js.map → square-check-big-Bffh_MFc.js.map} +1 -1
  170. package/ccw/frontend/dist/assets/{square-pen-BmLNjUUw.js → square-pen-DsOvAvME.js} +2 -2
  171. package/ccw/frontend/dist/assets/{square-pen-BmLNjUUw.js.map → square-pen-DsOvAvME.js.map} +1 -1
  172. package/ccw/frontend/dist/assets/{star-CakKtIYu.js → star-TLJjvoy2.js} +2 -2
  173. package/ccw/frontend/dist/assets/{star-CakKtIYu.js.map → star-TLJjvoy2.js.map} +1 -1
  174. package/ccw/frontend/dist/assets/{style-DdNmehyz.js → style-BXKXgpOY.js} +2 -2
  175. package/ccw/frontend/dist/assets/{style-DdNmehyz.js.map → style-BXKXgpOY.js.map} +1 -1
  176. package/ccw/frontend/dist/assets/{target-CUvfwM3S.js → target-FDuAB6SF.js} +2 -2
  177. package/ccw/frontend/dist/assets/{target-CUvfwM3S.js.map → target-FDuAB6SF.js.map} +1 -1
  178. package/ccw/frontend/dist/assets/{test-tube-BVwrOGiZ.js → test-tube-B9vj-Im8.js} +2 -2
  179. package/ccw/frontend/dist/assets/{test-tube-BVwrOGiZ.js.map → test-tube-B9vj-Im8.js.map} +1 -1
  180. package/ccw/frontend/dist/assets/{upload-CY1NwcDw.js → upload-CHgTrVN5.js} +2 -2
  181. package/ccw/frontend/dist/assets/{upload-CY1NwcDw.js.map → upload-CHgTrVN5.js.map} +1 -1
  182. package/ccw/frontend/dist/assets/{useApiSettings-9JuzUfPE.js → useApiSettings-XsHrqf-L.js} +2 -2
  183. package/ccw/frontend/dist/assets/{useApiSettings-9JuzUfPE.js.map → useApiSettings-XsHrqf-L.js.map} +1 -1
  184. package/ccw/frontend/dist/assets/{useCli-Bb7Zo-OI.js → useCli-DOlWtux5.js} +2 -2
  185. package/ccw/frontend/dist/assets/{useCli-Bb7Zo-OI.js.map → useCli-DOlWtux5.js.map} +1 -1
  186. package/ccw/frontend/dist/assets/{useCommands-BUu-hUYI.js → useCommands-DazCajiX.js} +2 -2
  187. package/ccw/frontend/dist/assets/{useCommands-BUu-hUYI.js.map → useCommands-DazCajiX.js.map} +1 -1
  188. package/ccw/frontend/dist/assets/{useDebounce-CptXgLBn.js → useDebounce-Cah-bua6.js} +2 -2
  189. package/ccw/frontend/dist/assets/{useDebounce-CptXgLBn.js.map → useDebounce-Cah-bua6.js.map} +1 -1
  190. package/ccw/frontend/dist/assets/{useFileExplorer-B7dN8VT1.js → useFileExplorer-B9SCPhhl.js} +2 -2
  191. package/ccw/frontend/dist/assets/{useFileExplorer-B7dN8VT1.js.map → useFileExplorer-B9SCPhhl.js.map} +1 -1
  192. package/ccw/frontend/dist/assets/{useLocale-D6USNXOr.js → useLocale-CmG6pxZe.js} +2 -2
  193. package/ccw/frontend/dist/assets/{useLocale-D6USNXOr.js.map → useLocale-CmG6pxZe.js.map} +1 -1
  194. package/ccw/frontend/dist/assets/{useSkills-r8yfiQ-u.js → useSkills-DvEJ0JOv.js} +3 -3
  195. package/ccw/frontend/dist/assets/{useSkills-r8yfiQ-u.js.map → useSkills-DvEJ0JOv.js.map} +1 -1
  196. package/ccw/frontend/dist/assets/{useSystemSettings-BVWDQLMy.js → useSystemSettings-BDpwSa04.js} +2 -2
  197. package/ccw/frontend/dist/assets/{useSystemSettings-BVWDQLMy.js.map → useSystemSettings-BDpwSa04.js.map} +1 -1
  198. package/ccw/frontend/dist/assets/{wand-sparkles-Zdaej5bR.js → wand-sparkles-T2KGCRiy.js} +2 -2
  199. package/ccw/frontend/dist/assets/{wand-sparkles-Zdaej5bR.js.map → wand-sparkles-T2KGCRiy.js.map} +1 -1
  200. package/ccw/frontend/dist/index.html +1 -1
  201. package/codex-lens/src/codexlens/cli/commands.py +12 -1
  202. package/codex-lens/src/codexlens/config.py +12 -0
  203. package/codex-lens/src/codexlens/env_config.py +1 -0
  204. package/package.json +1 -1
  205. package/ccw/frontend/dist/assets/CodexLensManagerPage-Du_VAJtC.js.map +0 -1
  206. package/ccw/frontend/dist/assets/McpManagerPage-Bld27yu4.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{eQ as Ne,eR as be,eS as ye,ab as X,aF as Y,aH as Z,eT as we,eU as Te,eV as _e,eW as Ce,eX as Se,eY as Me,u as T,j as e,e as k,J as ke,B as p,cA as U,aV as ee,a1 as se,bu as Fe,R as de,eZ as Ae,e_ as Le,ad as Ee,N as H,k as Pe,c as j,C as L,a as E,r as h,cy as me,ap as te,X as xe,aq as W,ar as I,as as J,at as G,au as $,e$ as $e,f0 as De,ao as Re,D as qe,d as Ve,f as ze,g as B,h as re,T as Be,l as Oe,b as Ke,I as Qe,x as Ue,y as We,z as Ie,A as Je,E as Ge,G as He,o as ne,s as Xe,aw as Ye}from"./index-D3uMibtZ.js";import{T as ue}from"./TabsNavigation-CU50UxOb.js";import{S as Ze}from"./Switch-s_-xzEWF.js";import{F as es}from"./filter-CQMcD8RT.js";import{F as ae}from"./file-text-DsqI3R_g.js";import{P as Q}from"./package-C69biuJL.js";import{F as ss}from"./folder-jX77-MUi.js";import{F as ts}from"./file-json-BDcmkaVn.js";import{E as as}from"./ellipsis-vertical-B4pqbrsR.js";import{E as rs}from"./eye-BwniwXnu.js";import{A as ns}from"./archive-restore-CZ7graO0.js";import{A as is}from"./archive--nR2vYUk.js";import{M as ls,a as cs}from"./minimize-2-s0009UK9.js";const V=Ne()(be(ye(s=>({selectedTeam:null,autoRefresh:!0,messageFilter:{},timelineExpanded:!0,viewMode:"list",locationFilter:"active",searchQuery:"",detailTab:"pipeline",setSelectedTeam:t=>s({selectedTeam:t}),toggleAutoRefresh:()=>s(t=>({autoRefresh:!t.autoRefresh})),setMessageFilter:t=>s(a=>({messageFilter:{...a.messageFilter,...t}})),clearMessageFilter:()=>s({messageFilter:{}}),setTimelineExpanded:t=>s({timelineExpanded:t}),setViewMode:t=>s({viewMode:t}),setLocationFilter:t=>s({locationFilter:t}),setSearchQuery:t=>s({searchQuery:t}),setDetailTab:t=>s({detailTab:t}),selectTeamAndShowDetail:t=>s({selectedTeam:t,viewMode:"detail",detailTab:"pipeline"}),backToList:()=>s({viewMode:"list",detailTab:"pipeline"})}),{name:"ccw-team-store"}),{name:"TeamStore"})),S={all:["teams"],lists:()=>[...S.all,"list"],listByLocation:s=>[...S.lists(),s],messages:(s,t)=>[...S.all,"messages",s,t],status:s=>[...S.all,"status",s]};function he(s){var n;const t=V(i=>i.autoRefresh),a=s||"active",r=X({queryKey:S.listByLocation(a),queryFn:async()=>({teams:(await Ce(a)).teams??[]}),staleTime:1e4,refetchInterval:t?1e4:!1});return{teams:((n=r.data)==null?void 0:n.teams)??[],isLoading:r.isLoading,isFetching:r.isFetching,error:r.error,refetch:r.refetch}}function os(s,t,a){var i,l;const r=V(c=>c.autoRefresh),n=X({queryKey:S.messages(s??"",t),queryFn:async()=>{if(!s)return{total:0,showing:0,messages:[]};const c=await Se(s,{...t,last:50});return{total:c.total,showing:c.showing,messages:c.messages}},enabled:!!s,staleTime:5e3,refetchInterval:r?5e3:!1});return{messages:((i=n.data)==null?void 0:i.messages)??[],total:((l=n.data)==null?void 0:l.total)??0,isLoading:n.isLoading,error:n.error,refetch:n.refetch}}function ds(s){var r,n;const t=V(i=>i.autoRefresh),a=X({queryKey:S.status(s??""),queryFn:async()=>{if(!s)return{members:[],total_messages:0};const i=await Me(s);return{members:i.members,total_messages:i.total_messages}},enabled:!!s,staleTime:5e3,refetchInterval:t?5e3:!1});return{members:((r=a.data)==null?void 0:r.members)??[],totalMessages:((n=a.data)==null?void 0:n.total_messages)??0,isLoading:a.isLoading,error:a.error,refetch:a.refetch}}function ms(){const s=Y(),t=Z({mutationFn:we,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{archiveTeam:t.mutateAsync,isArchiving:t.isPending,error:t.error}}function xs(){const s=Y(),t=Z({mutationFn:Te,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{unarchiveTeam:t.mutateAsync,isUnarchiving:t.isPending,error:t.error}}function us(){const s=Y(),t=Z({mutationFn:_e,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{deleteTeam:t.mutateAsync,isDeleting:t.isPending,error:t.error}}function hs({selectedTeam:s,onBack:t,members:a,totalMessages:r,autoRefresh:n,onToggleAutoRefresh:i,skillType:l,pipelineMode:c}){const{formatMessage:x}=T();return e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs(k,{variant:"ghost",size:"sm",onClick:t,className:"gap-1",children:[e.jsx(ke,{className:"h-4 w-4"}),x({id:"team.detail.backToList"})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(p,{variant:"secondary",className:"gap-1",children:[e.jsx(U,{className:"w-3 h-3"}),x({id:"team.members"}),": ",a.length]}),e.jsxs(p,{variant:"secondary",className:"gap-1",children:[e.jsx(ee,{className:"w-3 h-3"}),x({id:"team.messages"}),": ",r]})]}),(l||c)&&e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx(p,{variant:"outline",className:"gap-1",children:l}),c&&e.jsxs(p,{variant:"default",className:"gap-1",children:[e.jsx(se,{className:"w-3 h-3"}),c]})]})]})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ze,{id:"auto-refresh",checked:n,onCheckedChange:i}),e.jsx(Fe,{htmlFor:"auto-refresh",className:"text-sm text-muted-foreground cursor-pointer",children:x({id:"team.autoRefresh"})}),n&&e.jsx(de,{className:"w-3.5 h-3.5 text-primary animate-spin",style:{animationDuration:"3s"}})]})})]})}const fe={completed:{icon:Pe,color:"text-green-500",bg:"bg-green-500/10 border-green-500/30"},in_progress:{icon:H,color:"text-blue-500",bg:"bg-blue-500/10 border-blue-500/30",animate:!0},pending:{icon:Ee,color:"text-muted-foreground",bg:"bg-muted border-border"},blocked:{icon:Le,color:"text-red-500",bg:"bg-red-500/10 border-red-500/30"},skipped:{icon:Ae,color:"text-yellow-500",bg:"bg-yellow-500/10 border-yellow-500/30"}},fs=["completed","in_progress","pending","blocked","skipped"];function ie({stage:s}){const{formatMessage:t}=T(),a=fe[s.status],r=a.icon,n=s.status==="in_progress"?"inProgress":s.status;return e.jsxs("div",{className:j("flex flex-col items-center gap-1.5 px-4 py-3 rounded-lg border-2 min-w-[90px] transition-all",a.bg),children:[e.jsx(r,{className:j("w-5 h-5",a.color,a.animate&&"animate-spin"),style:a.animate?{animationDuration:"2s"}:void 0}),e.jsx("span",{className:"text-xs font-medium",children:s.label}),e.jsx("span",{className:j("text-[10px]",a.color),children:t({id:`team.pipeline.${n}`})}),s.role&&e.jsx("span",{className:"text-[10px] text-muted-foreground truncate max-w-[80px]",children:s.role})]})}function ps(){return e.jsxs("div",{className:"flex items-center px-1",children:[e.jsx("div",{className:"w-6 h-0.5 bg-border"}),e.jsx("div",{className:"w-0 h-0 border-t-[4px] border-t-transparent border-b-[4px] border-b-transparent border-l-[6px] border-l-border"})]})}function gs({stages:s,phaseInfo:t}){const{formatMessage:a}=T();return s.length===0?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:a({id:"team.pipeline.title"})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:a({id:"team.pipeline.noStages"})})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"space-y-3 flex-1",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:a({id:"team.pipeline.title"})}),t&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(p,{variant:"secondary",children:[a({id:"team.coordinates.phase"}),": ",t.currentPhase,t.totalPhases!=null&&`/${t.totalPhases}`]}),t.currentStep&&e.jsxs(p,{variant:"secondary",children:[a({id:"team.coordinates.step"}),": ",t.currentStep]}),t.gapIteration>0&&e.jsxs(p,{variant:"outline",children:[a({id:"team.coordinates.gap"}),": ",t.gapIteration]})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-0",children:s.map((r,n)=>e.jsxs("div",{className:"flex items-center",children:[n>0&&e.jsx(ps,{}),e.jsx(ie,{stage:r})]},r.id))}),e.jsx("div",{className:"flex sm:hidden flex-col items-center gap-2",children:s.map(r=>e.jsx(ie,{stage:r},r.id))})]}),e.jsx("div",{className:"flex flex-wrap gap-3 text-[10px] text-muted-foreground mt-auto pt-3 border-t border-border",children:fs.map(r=>{const n=fe[r],i=n.icon,l=r==="in_progress"?"inProgress":r;return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(i,{className:j("w-3 h-3",n.color)}),a({id:`team.pipeline.${l}`})]},r)})})]})}function js(s){if(!s)return"";const t=Date.now(),a=new Date(s).getTime(),r=t-a;if(r<0)return"now";const n=Math.floor(r/1e3);if(n<60)return`${n}s`;const i=Math.floor(n/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function vs(s){return s.lastSeen&&Date.now()-new Date(s.lastSeen).getTime()<120*1e3?"active":"idle"}function Ns({members:s}){const{formatMessage:t}=T();return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:t({id:"team.membersPanel.title"})}),e.jsxs("div",{className:"space-y-2",children:[s.map(a=>{const r=vs(a),n=r==="active";return e.jsx(L,{className:"overflow-hidden",children:e.jsx(E,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"pt-0.5",children:e.jsx("div",{className:j("w-2.5 h-2.5 rounded-full",n?"bg-green-500 shadow-[0_0_6px_rgba(34,197,94,0.5)]":"bg-muted-foreground/40")})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:a.member}),e.jsx(p,{variant:n?"success":"secondary",className:"text-[10px] px-1.5 py-0",children:t({id:`team.membersPanel.${r}`})})]}),a.lastAction&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:a.lastAction}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:[a.messageCount," ",t({id:"team.messages"}).toLowerCase()]}),a.lastSeen&&e.jsxs("span",{children:[js(a.lastSeen)," ",t({id:"team.membersPanel.ago"})]})]})]})]})})},a.member)}),s.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:t({id:"team.empty.noMessages"})})]})]})}function bs(s){if(!s)return"";const t=Date.now(),a=new Date(s).getTime(),r=t-a;if(r<0)return"now";const n=Math.floor(r/1e3);if(n<60)return`${n}s`;const i=Math.floor(n/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function ys(s){return s.lastSeen&&Date.now()-new Date(s.lastSeen).getTime()<120*1e3?"active":"idle"}function ws(s,t){const a=s.member.toLowerCase();return t.find(r=>r.role&&r.role.toLowerCase()===a||r.id.toLowerCase()===a)}const Ts={completed:"success",in_progress:"info",pending:"secondary",blocked:"destructive",skipped:"warning"};function le({members:s,stages:t,roleState:a}){const{formatMessage:r}=T();return t.length===0?e.jsx(Ns,{members:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:r({id:"team.membersPanel.title"})}),e.jsxs("div",{className:"space-y-2",children:[s.map(n=>{const i=ys(n),l=i==="active",c=ws(n,t);return e.jsx(L,{className:"overflow-hidden",children:e.jsx(E,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"pt-0.5",children:e.jsx("div",{className:j("w-2.5 h-2.5 rounded-full",l?"bg-green-500 shadow-[0_0_6px_rgba(34,197,94,0.5)]":"bg-muted-foreground/40")})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:n.member}),e.jsx(p,{variant:l?"success":"secondary",className:"text-[10px] px-1.5 py-0",children:r({id:`team.membersPanel.${i}`})}),c&&e.jsx(p,{variant:Ts[c.status]??"secondary",className:"text-[10px] px-1.5 py-0",children:c.label})]}),n.lastAction&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.lastAction}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:[n.messageCount," ",r({id:"team.messages"}).toLowerCase()]}),n.lastSeen&&e.jsxs("span",{children:[bs(n.lastSeen)," ",r({id:"team.membersPanel.ago"})]})]})]})]})})},n.member)}),s.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:r({id:"team.empty.noMessages"})})]})]})}function _s({phaseInfo:s}){const{formatMessage:t}=T();return e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(p,{variant:"secondary",children:[t({id:"team.coordinates.phase"}),": ",s.currentPhase,s.totalPhases!=null&&`/${s.totalPhases}`]}),s.currentStep&&e.jsxs(p,{variant:"secondary",children:[t({id:"team.coordinates.step"}),": ",s.currentStep]}),s.gapIteration>0&&e.jsxs(p,{variant:"outline",children:[t({id:"team.coordinates.gap"}),": ",s.gapIteration]})]})}const ce={plan_ready:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30",plan_approved:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30",plan_revision:"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30",task_unblocked:"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 border-cyan-500/30",impl_complete:"bg-primary/15 text-primary border-primary/30",impl_progress:"bg-primary/15 text-primary border-primary/30",test_result:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30",review_result:"bg-purple-500/15 text-purple-600 dark:text-purple-400 border-purple-500/30",fix_required:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",error:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",shutdown:"bg-muted text-muted-foreground border-border",message:"bg-muted text-muted-foreground border-border"};function Cs({type:s}){const{formatMessage:t}=T(),a=ce[s]||ce.message,r=`team.messageType.${s}`;let n;try{n=t({id:r})}catch{n=s}return e.jsx("span",{className:j("text-[10px] px-1.5 py-0.5 rounded border font-medium",a),children:n})}function Ss({msg:s}){var n,i;const[t,a]=h.useState(!1),r=s.ts?s.ts.substring(11,19):"";return e.jsxs("div",{className:"flex gap-3 py-2.5 border-b border-border last:border-b-0 animate-in fade-in slide-in-from-top-1 duration-300",children:[e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground w-16 shrink-0 pt-0.5",children:r}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs font-medium",children:s.from}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"→"}),e.jsx("span",{className:"text-xs font-medium",children:s.to}),e.jsx(Cs,{type:s.type}),s.id&&e.jsx("span",{className:"text-[10px] text-muted-foreground",children:s.id})]}),e.jsx("p",{className:"text-xs text-foreground/80",children:s.summary}),(s.ref||((n=s.data)==null?void 0:n.ref))&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(ae,{className:"w-3 h-3"}),e.jsx("span",{className:"font-mono truncate",children:s.ref||((i=s.data)==null?void 0:i.ref)})]}),s.data&&Object.keys(s.data).length>0&&e.jsxs("div",{children:[e.jsx("button",{onClick:()=>a(!t),className:"text-[10px] text-primary hover:underline flex items-center gap-0.5",children:t?e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-3 h-3"})," collapse"]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3"})," data"]})}),t&&e.jsx("pre",{className:"text-[10px] bg-muted p-2 rounded mt-1 overflow-x-auto max-h-40",children:JSON.stringify(s.data,null,2)})]})]})]})}function Ms({messages:s,total:t,filter:a,onFilterChange:r,onClearFilter:n,expanded:i,onExpandedChange:l}){const{formatMessage:c}=T(),x=!!(a.from||a.to||a.type),{senders:g,receivers:v,types:C}=h.useMemo(()=>{const d=new Set,m=new Set,_=new Set;for(const y of s)d.add(y.from),m.add(y.to),_.add(y.type);return{senders:Array.from(d).sort(),receivers:Array.from(m).sort(),types:Array.from(_).sort()}},[s]),N=[...s].reverse();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[i?e.jsx(me,{className:"w-4 h-4"}):e.jsx(te,{className:"w-4 h-4"}),c({id:"team.timeline.title"}),e.jsxs("span",{className:"text-xs font-normal",children:["(",c({id:"team.timeline.showing"},{showing:s.length,total:t}),")"]})]}),x&&e.jsxs(k,{variant:"ghost",size:"sm",onClick:n,className:"h-6 text-xs gap-1",children:[e.jsx(xe,{className:"w-3 h-3"}),c({id:"team.timeline.clearFilters"})]})]}),i&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(W,{value:a.from??"__all__",onValueChange:d=>r({from:d==="__all__"?void 0:d}),children:[e.jsxs(I,{className:"w-[130px] h-7 text-xs",children:[e.jsx(es,{className:"w-3 h-3 mr-1"}),e.jsx(J,{placeholder:c({id:"team.timeline.filterFrom"})})]}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),g.map(d=>e.jsx($,{value:d,children:d},d))]})]}),e.jsxs(W,{value:a.to??"__all__",onValueChange:d=>r({to:d==="__all__"?void 0:d}),children:[e.jsx(I,{className:"w-[130px] h-7 text-xs",children:e.jsx(J,{placeholder:c({id:"team.timeline.filterTo"})})}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),v.map(d=>e.jsx($,{value:d,children:d},d))]})]}),e.jsxs(W,{value:a.type??"__all__",onValueChange:d=>r({type:d==="__all__"?void 0:d}),children:[e.jsx(I,{className:"w-[150px] h-7 text-xs",children:e.jsx(J,{placeholder:c({id:"team.timeline.filterType"})})}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),C.map(d=>e.jsx($,{value:d,children:d},d))]})]})]}),e.jsx(L,{children:e.jsx(E,{className:"p-3",children:N.length>0?e.jsx("div",{className:"divide-y-0",children:N.map(d=>e.jsx(Ss,{msg:d},d.id))}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:c({id:"team.empty.noMessages"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:c({id:"team.empty.noMessagesHint"})})]})})})]})]})}function pe(s){return s.endsWith(".json")?"json":s.endsWith(".md")?"markdown":s.endsWith(".txt")||s.endsWith(".log")||s.endsWith(".tsv")||s.endsWith(".csv")?"text":"unknown"}function ge(s){return s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`:""}function ks(s){if(!s)return"";try{return new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function je({contentType:s}){return s==="json"?e.jsx(ts,{className:"w-4 h-4 text-blue-500"}):e.jsx(ae,{className:"w-4 h-4 text-gray-500"})}function ve({node:s,depth:t,expanded:a,selectedPath:r,onToggle:n,onSelect:i}){if(s.type==="directory"){const x=a.has(s.path);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 py-1.5 px-2 cursor-pointer hover:bg-accent/50 rounded transition-colors",style:{paddingLeft:t*16+8},onClick:()=>n(s.path),children:[x?e.jsx(te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Re,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ss,{className:j("w-4 h-4",x?"text-amber-500":"text-amber-400")}),e.jsx("span",{className:"text-sm truncate",children:s.name})]}),x&&s.children&&e.jsx("div",{children:s.children.map(g=>e.jsx(ve,{node:g,depth:t+1,expanded:a,selectedPath:r,onToggle:n,onSelect:i},g.path))})]},s.path)}const l=r===s.path,c=s.contentType||pe(s.path);return e.jsxs("div",{className:j("flex items-center gap-1 py-1.5 px-2 cursor-pointer hover:bg-accent/50 rounded transition-colors",l&&"bg-accent"),style:{paddingLeft:t*16+28},onClick:()=>i(s),children:[e.jsx(je,{contentType:c}),e.jsx("span",{className:"text-sm truncate flex-1",children:s.name}),s.size!==void 0&&e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:ge(s.size)})]},s.path)}function Fs({teamName:s}){const{formatMessage:t}=T(),[a,r]=h.useState([]),[n,i]=h.useState(new Set),[l,c]=h.useState(null),[x,g]=h.useState(""),[v,C]=h.useState(!1),[N,d]=h.useState(!0),[m,_]=h.useState(null);h.useEffect(()=>{s&&(d(!0),_(null),$e(s).then(f=>{r(f.tree||[]);const b=(f.tree||[]).filter(w=>w.type==="directory").map(w=>w.path);i(new Set(b))}).catch(f=>{console.error("Failed to load artifacts:",f),_(t({id:"team.artifacts.loadError",defaultMessage:"Failed to load artifacts"}))}).finally(()=>{d(!1)}))},[s,t]);const y=h.useCallback(f=>{i(b=>{const w=new Set(b);return w.has(f)?w.delete(f):w.add(f),w})},[]),F=h.useCallback(async f=>{if(f.type!=="directory"){c(f),C(!0),g("");try{const b=await De(s,f.path);g(b.content)}catch(b){console.error("Failed to load file content:",b),g(t({id:"team.artifacts.contentError",defaultMessage:"Failed to load file content"}))}finally{C(!1)}}},[s,t]),A=l?l.contentType||pe(l.path):"text",M=A==="json"?"json":A==="markdown"?"markdown":"text";return N?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(H,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:t({id:"team.artifacts.loading",defaultMessage:"Loading artifacts..."})})]}):m?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Q,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:m})]}):a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Q,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:t({id:"team.artifacts.noArtifacts",defaultMessage:"No artifacts yet"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"team.artifacts.emptyHint",defaultMessage:"Artifacts will appear here when the team generates them"})})]}):e.jsxs("div",{className:"flex h-[600px] border rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"w-72 shrink-0 border-r bg-muted/30 flex flex-col",children:[e.jsx("div",{className:"p-3 border-b bg-background shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:t({id:"team.artifacts.title",defaultMessage:"Artifacts"})})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:a.map(f=>e.jsx(ve,{node:f,depth:0,expanded:n,selectedPath:l==null?void 0:l.path,onToggle:y,onSelect:F},f.path))})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-3 border-b bg-muted/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{contentType:A}),e.jsx("span",{className:"text-sm font-medium truncate",children:l.name}),l.size!==void 0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:ge(l.size)}),l.modifiedAt&&e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:ks(l.modifiedAt)})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:v?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(H,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsx(Ls,{content:x,contentType:M})})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-center p-8",children:e.jsxs("div",{children:[e.jsx(ae,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:t({id:"team.artifacts.selectFile",defaultMessage:"Select a file to preview"})})]})})})]})}function q({data:s,depth:t=0}){if(s===null)return e.jsx("span",{className:"text-red-500 font-mono text-sm",children:"null"});if(s===void 0)return e.jsx("span",{className:"text-muted-foreground font-mono text-sm",children:"undefined"});if(typeof s=="boolean")return e.jsx("span",{className:j("font-mono text-sm",s?"text-orange-500":"text-red-500"),children:s?"true":"false"});if(typeof s=="number")return e.jsx("span",{className:"text-blue-500 font-mono text-sm",children:s});if(typeof s=="string")return s.length>200?e.jsxs("span",{className:"text-green-600 dark:text-green-400 font-mono text-sm break-all",children:['"',s.slice(0,200),'..."']}):e.jsxs("span",{className:"text-green-600 dark:text-green-400 font-mono text-sm",children:['"',s,'"']});if(Array.isArray(s))return s.length===0?e.jsx("span",{className:"text-muted-foreground text-sm",children:"[]"}):e.jsx("div",{className:"space-y-2",children:s.map((a,r)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(p,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:r}),e.jsx("div",{className:"flex-1 min-w-0",children:typeof a=="object"&&a!==null?e.jsx("div",{className:"bg-muted/30 rounded-lg p-2 border",children:e.jsx(q,{data:a,depth:t+1})}):e.jsx(q,{data:a,depth:t+1})})]},r))});if(typeof s=="object"){const a=Object.entries(s);return a.length===0?e.jsx("span",{className:"text-muted-foreground text-sm",children:"{}"}):e.jsx("div",{className:j("space-y-2",t>0&&"pl-2 border-l-2 border-border"),children:a.map(([r,n])=>{const i=typeof n=="object"&&n!==null,l=Array.isArray(n),c=l?n.length:i?Object.keys(n).length:0;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("span",{className:"text-purple-600 dark:text-purple-400 font-medium text-sm shrink-0",children:r}),i&&e.jsx(p,{variant:"secondary",className:"text-[10px] h-4 px-1",children:l?`${c} items`:`${c} fields`})]}),e.jsx("div",{className:"ml-3",children:i?e.jsx("div",{className:"bg-muted/20 rounded-md p-2 border",children:e.jsx(q,{data:n,depth:t+1})}):e.jsx(q,{data:n,depth:t+1})})]},r)})})}return e.jsx("span",{className:"text-sm",children:String(s)})}function As({data:s}){const t=h.useMemo(()=>{const a={type:"",fields:0,items:0,depth:0},r=(n,i)=>{a.depth=Math.max(a.depth,i),Array.isArray(n)?(a.type="Array",a.items=n.length,n.forEach(l=>r(l,i+1))):typeof n=="object"&&n!==null&&(a.type="Object",a.fields=Object.keys(n).length,Object.values(n).forEach(l=>r(l,i+1)))};return r(s,0),a},[s]);return e.jsxs("div",{className:"flex items-center gap-4 p-3 bg-muted/50 rounded-lg mb-4 text-sm",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(p,{variant:"outline",children:t.type})}),t.type==="Object"&&e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.fields})," fields"]}),t.type==="Array"&&e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.items})," items"]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.depth})," levels deep"]})]})}function Ls({content:s,contentType:t}){if(!s)return e.jsx("div",{className:"text-muted-foreground text-sm",children:"No content"});if(t==="json")try{const a=JSON.parse(s);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(As,{data:a}),e.jsx("div",{className:"bg-card rounded-lg",children:e.jsx(q,{data:a})})]})}catch{return e.jsx("pre",{className:"text-xs bg-muted/50 p-4 rounded-lg overflow-auto font-mono whitespace-pre-wrap break-words border",children:s})}return t==="markdown"?e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-sm leading-relaxed bg-transparent p-0",children:s})}):e.jsx("pre",{className:"text-xs bg-muted/50 p-4 rounded-lg overflow-auto font-mono whitespace-pre-wrap break-words border",children:s})}const Es={active:{variant:"info"},completed:{variant:"success"},archived:{variant:"secondary"}},oe={active:"team.status.active",completed:"team.status.completed",archived:"team.status.archived"};function Ps(s){if(!s)return"";try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function $s({team:s,onClick:t,onArchive:a,onUnarchive:r,onDelete:n,showActions:i=!0,actionsDisabled:l=!1,className:c}){const{formatMessage:x}=T(),{variant:g}=Es[s.status]||{variant:"default"},v=oe[s.status]?x({id:oe[s.status]}):s.status,C=s.status==="archived",N=m=>{m.target.closest("[data-radix-popper-content-wrapper]")||t==null||t(s.name)},d=(m,_)=>{switch(m.stopPropagation(),_){case"view":t==null||t(s.name);break;case"archive":a==null||a(s.name);break;case"unarchive":r==null||r(s.name);break;case"delete":n==null||n(s.name);break}};return e.jsx(L,{className:j("group cursor-pointer transition-all duration-200 hover:shadow-md hover:border-primary/30",c),onClick:N,children:e.jsxs(E,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("h3",{className:"font-bold text-card-foreground text-sm tracking-wide truncate",children:s.name})})}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(p,{variant:g,children:v}),s.pipeline_mode&&e.jsxs(p,{variant:"default",className:"gap-1",children:[e.jsx(se,{className:"h-3 w-3"}),s.pipeline_mode]}),i&&e.jsxs(qe,{children:[e.jsx(Ve,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:m=>m.stopPropagation(),disabled:l,children:e.jsx(as,{className:"h-4 w-4"})})}),e.jsxs(ze,{align:"end",children:[e.jsxs(B,{onClick:m=>d(m,"view"),children:[e.jsx(rs,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.viewDetails"})]}),e.jsx(re,{}),C?e.jsxs(B,{onClick:m=>d(m,"unarchive"),children:[e.jsx(ns,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.unarchive"})]}):e.jsxs(B,{onClick:m=>d(m,"archive"),children:[e.jsx(is,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.archive"})]}),e.jsx(re,{}),e.jsxs(B,{onClick:m=>d(m,"delete"),className:"text-destructive focus:text-destructive",children:[e.jsx(Be,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.delete"})]})]})]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s.messageCount," ",x({id:"team.card.messages"})]}),s.lastActivity&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),Ps(s.lastActivity)]})]}),s.members&&s.members.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 flex-wrap",children:[e.jsx(U,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.members.map(m=>e.jsx(p,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-normal",children:m},m))]})]})})}function Ds({className:s}){return e.jsx(L,{className:j("animate-pulse",s),children:e.jsxs(E,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-5 w-32 rounded bg-muted"})}),e.jsx("div",{className:"h-5 w-16 rounded-full bg-muted"})]}),e.jsxs("div",{className:"mt-3 flex gap-4",children:[e.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),e.jsx("div",{className:"h-4 w-20 rounded bg-muted"}),e.jsx("div",{className:"h-4 w-20 rounded bg-muted"})]})]})})}function Rs(){const{formatMessage:s}=T(),{locationFilter:t,setLocationFilter:a,searchQuery:r,setSearchQuery:n,selectTeamAndShowDetail:i}=V(),[l,c]=h.useState(!1),[x,g]=h.useState(null),{teams:v,isLoading:C,isFetching:N,refetch:d}=he(t),{archiveTeam:m,isArchiving:_}=ms(),{unarchiveTeam:y,isUnarchiving:F}=xs(),{deleteTeam:A,isDeleting:M}=us(),f=_||F||M,b=h.useMemo(()=>{if(!r)return v;const u=r.toLowerCase();return v.filter(P=>P.name.toLowerCase().includes(u))},[v,r]),w=async u=>{try{await m(u)}catch(P){console.error("Failed to archive team:",P)}},o=async u=>{try{await y(u)}catch(P){console.error("Failed to unarchive team:",P)}},D=u=>{g(u),c(!0)},R=async()=>{if(x)try{await A(x),c(!1),g(null)}catch(u){console.error("Failed to delete team:",u)}},z=()=>n("");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-5 h-5"}),e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:s({id:"team.title"})})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s({id:"team.description"})})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(k,{variant:"outline",size:"sm",onClick:()=>d(),disabled:N,children:[e.jsx(de,{className:j("h-4 w-4 mr-2",N&&"animate-spin")}),s({id:"common.actions.refresh"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[e.jsx(ue,{value:t,onValueChange:u=>a(u),tabs:[{value:"active",label:s({id:"team.filters.active"})},{value:"archived",label:s({id:"team.filters.archived"})},{value:"all",label:s({id:"team.filters.all"})}]}),e.jsxs("div",{className:"flex-1 max-w-sm relative",children:[e.jsx(Ke,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Qe,{placeholder:s({id:"team.searchPlaceholder"}),value:r,onChange:u=>n(u.target.value),className:"pl-9 pr-9"}),r&&e.jsx("button",{onClick:z,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:e.jsx(xe,{className:"h-4 w-4"})})]})]}),C?e.jsx("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((u,P)=>e.jsx(Ds,{},P))}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4 border border-dashed border-border rounded-lg",children:[e.jsx(U,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:s(r?{id:"team.emptyState.noMatching"}:{id:"team.emptyState.noTeams"})}),e.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-sm mb-4",children:s(r?{id:"team.emptyState.noMatchingDescription"}:{id:"team.emptyState.noTeamsDescription"})}),r&&e.jsx(k,{variant:"outline",onClick:z,children:s({id:"common.actions.clearFilters"})})]}):e.jsx("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:b.map(u=>e.jsx($s,{team:u,onClick:i,onArchive:w,onUnarchive:o,onDelete:D,actionsDisabled:f},u.name))}),e.jsx(Ue,{open:l,onOpenChange:c,children:e.jsxs(We,{children:[e.jsxs(Ie,{children:[e.jsx(Je,{children:s({id:"team.dialog.deleteTeam"})}),e.jsx(Ge,{children:s({id:"team.dialog.deleteConfirm"})})]}),e.jsxs(He,{children:[e.jsx(k,{variant:"outline",onClick:()=>{c(!1),g(null)},children:s({id:"team.dialog.cancel"})}),e.jsx(k,{variant:"destructive",onClick:R,disabled:M,children:s(M?{id:"team.dialog.deleting"}:{id:"team.actions.delete"})})]})]})})]})}const qs=["plan","impl","test","review"];function O(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}function K(s,t){const a=s.toLowerCase(),r=t.filter(l=>{const c=l.from.toLowerCase();return c===a||c.startsWith(a)});if(r.length===0)return"pending";const n=r[r.length-1];return["shutdown","impl_complete","review_result","test_result"].includes(n.type)?"completed":n.type==="error"?"blocked":"in_progress"}function Vs(s,t){if(s.pipeline_stages&&s.pipeline_stages.length>0)return s.pipeline_stages.map(a=>{var l;const r=a.toUpperCase(),n=a.toLowerCase(),i=(l=s.roles)==null?void 0:l.find(c=>c.toLowerCase().startsWith(n));return{id:r,label:O(a),role:i,status:K(a,t)}});if(s.roles&&s.roles.length>0){const a=s.roles.filter(r=>r.toLowerCase()!=="coordinator");if(a.length>0)return a.map(r=>({id:r.toUpperCase(),label:O(r),role:r,status:K(r,t)}))}if(t.length>0){const a=new Map;for(const r of t){const n=r.from;if(n.toLowerCase()==="coordinator")continue;const i=n.toLowerCase();a.has(i)||a.set(i,n)}if(a.size>0)return Array.from(a.entries()).map(([,r])=>({id:r.toUpperCase(),label:O(r),role:r,status:K(r,t)}))}return qs.map(a=>({id:a.toUpperCase(),label:O(a),role:void 0,status:K(a,t)}))}function zs(s){if(!s||Object.keys(s).length===0)return null;const t=s.coordinator;return!t||typeof t.current_phase!="number"?null:{currentPhase:t.current_phase,totalPhases:typeof t.total_phases=="number"?t.total_phases:null,currentStep:typeof t.current_step=="string"?t.current_step:null,gapIteration:typeof t.gap_iteration=="number"?t.gap_iteration:0}}function et(){const{formatMessage:s}=T(),{selectedTeam:t,viewMode:a,autoRefresh:r,toggleAutoRefresh:n,messageFilter:i,setMessageFilter:l,clearMessageFilter:c,timelineExpanded:x,setTimelineExpanded:g,detailTab:v,setDetailTab:C,backToList:N,locationFilter:d}=V(),m=ne(Xe),_=ne(u=>u.toggleImmersiveMode),{teams:y,error:F,isLoading:A}=he(d),{messages:M,total:f}=os(a==="detail"?t:null,i),{members:b,totalMessages:w}=ds(a==="detail"?t:null),o=h.useMemo(()=>y.find(u=>u.name===t),[y,t]);h.useEffect(()=>{a==="detail"&&t&&!A&&y.length>0&&!o&&N()},[a,t,A,y.length,o,N]);const D=h.useMemo(()=>Vs({pipeline_stages:o==null?void 0:o.pipeline_stages,role_state:o==null?void 0:o.role_state,roles:o==null?void 0:o.roles},M),[o==null?void 0:o.pipeline_stages,o==null?void 0:o.role_state,o==null?void 0:o.roles,M]),R=h.useMemo(()=>zs(o==null?void 0:o.role_state),[o==null?void 0:o.role_state]);if(F&&a==="detail")return e.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"mb-4",children:e.jsx(Ye,{className:"w-16 h-16 mx-auto text-destructive"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:s({id:"team.error.loadFailed"})}),e.jsx("p",{className:"text-muted-foreground mb-6",children:F instanceof Error?F.message:String(F)}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(k,{onClick:N,variant:"default",children:s({id:"team.detail.backToList"})}),e.jsx(k,{onClick:()=>window.location.reload(),variant:"outline",children:s({id:"common.actions.retry"})})]})]})});if(a==="list"||!t||a==="detail"&&y.length>0&&!o)return e.jsx("div",{className:"space-y-6",children:e.jsx(Rs,{})});const z=[{value:"pipeline",label:s({id:"team.tabs.pipeline"}),icon:e.jsx(se,{className:"h-4 w-4"})},{value:"artifacts",label:s({id:"team.tabs.artifacts"}),icon:e.jsx(Q,{className:"h-4 w-4"})},{value:"messages",label:s({id:"team.tabs.messages"}),icon:e.jsx(ee,{className:"h-4 w-4"})}];return e.jsxs("div",{className:j("space-y-6",m&&"h-screen overflow-hidden"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(hs,{selectedTeam:t,onBack:N,members:b,totalMessages:w,autoRefresh:r,onToggleAutoRefresh:n,skillType:o!=null&&o.team_name?`team-${o.team_name}`:void 0,pipelineMode:o==null?void 0:o.pipeline_mode}),e.jsx("button",{onClick:_,className:j("p-2 rounded-md transition-colors",m?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:m?"Exit Fullscreen":"Fullscreen",children:m?e.jsx(ls,{className:"w-4 h-4"}):e.jsx(cs,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx(L,{className:"lg:col-span-2 flex flex-col",children:e.jsx(E,{className:"p-4 flex-1",children:e.jsx(gs,{stages:D,phaseInfo:R})})}),e.jsx(L,{children:e.jsx(E,{className:"p-4",children:e.jsx(le,{members:b,stages:D,roleState:o==null?void 0:o.role_state})})})]}),R&&e.jsx(_s,{phaseInfo:R}),e.jsx(ue,{value:v,onValueChange:u=>C(u),tabs:z}),v==="pipeline"&&e.jsx(L,{children:e.jsx(E,{className:"p-6",children:e.jsx(le,{members:b,stages:D,roleState:o==null?void 0:o.role_state})})}),v==="artifacts"&&e.jsx(Fs,{teamName:t}),v==="messages"&&e.jsx(Ms,{messages:M,total:f,filter:i,onFilterChange:l,onClearFilter:c,expanded:x,onExpandedChange:g})]})}export{et as TeamPage,et as default};
2
- //# sourceMappingURL=TeamPage-Bg_KII8B.js.map
1
+ import{eQ as Ne,eR as be,eS as ye,ab as X,aF as Y,aH as Z,eT as we,eU as Te,eV as _e,eW as Ce,eX as Se,eY as Me,u as T,j as e,e as k,J as ke,B as p,cA as U,aV as ee,a1 as se,bu as Fe,R as de,eZ as Ae,e_ as Le,ad as Ee,N as H,k as Pe,c as j,C as L,a as E,r as h,cy as me,ap as te,X as xe,aq as W,ar as I,as as J,at as G,au as $,e$ as $e,f0 as De,ao as Re,D as qe,d as Ve,f as ze,g as B,h as re,T as Be,l as Oe,b as Ke,I as Qe,x as Ue,y as We,z as Ie,A as Je,E as Ge,G as He,o as ne,s as Xe,aw as Ye}from"./index-DzTbMyaS.js";import{T as ue}from"./TabsNavigation-jhUge9YV.js";import{S as Ze}from"./Switch-w0I3JCcC.js";import{F as es}from"./filter-BTN-lUUb.js";import{F as ae}from"./file-text-BMy5pXNV.js";import{P as Q}from"./package-DYrbBCxk.js";import{F as ss}from"./folder-ChYtty7V.js";import{F as ts}from"./file-json-kg4Lid-H.js";import{E as as}from"./ellipsis-vertical-Fs6bysWx.js";import{E as rs}from"./eye-D6BRlJ1r.js";import{A as ns}from"./archive-restore-DYx41yLJ.js";import{A as is}from"./archive-Bo1tC9yo.js";import{M as ls,a as cs}from"./minimize-2-BJmkU9CE.js";const V=Ne()(be(ye(s=>({selectedTeam:null,autoRefresh:!0,messageFilter:{},timelineExpanded:!0,viewMode:"list",locationFilter:"active",searchQuery:"",detailTab:"pipeline",setSelectedTeam:t=>s({selectedTeam:t}),toggleAutoRefresh:()=>s(t=>({autoRefresh:!t.autoRefresh})),setMessageFilter:t=>s(a=>({messageFilter:{...a.messageFilter,...t}})),clearMessageFilter:()=>s({messageFilter:{}}),setTimelineExpanded:t=>s({timelineExpanded:t}),setViewMode:t=>s({viewMode:t}),setLocationFilter:t=>s({locationFilter:t}),setSearchQuery:t=>s({searchQuery:t}),setDetailTab:t=>s({detailTab:t}),selectTeamAndShowDetail:t=>s({selectedTeam:t,viewMode:"detail",detailTab:"pipeline"}),backToList:()=>s({viewMode:"list",detailTab:"pipeline"})}),{name:"ccw-team-store"}),{name:"TeamStore"})),S={all:["teams"],lists:()=>[...S.all,"list"],listByLocation:s=>[...S.lists(),s],messages:(s,t)=>[...S.all,"messages",s,t],status:s=>[...S.all,"status",s]};function he(s){var n;const t=V(i=>i.autoRefresh),a=s||"active",r=X({queryKey:S.listByLocation(a),queryFn:async()=>({teams:(await Ce(a)).teams??[]}),staleTime:1e4,refetchInterval:t?1e4:!1});return{teams:((n=r.data)==null?void 0:n.teams)??[],isLoading:r.isLoading,isFetching:r.isFetching,error:r.error,refetch:r.refetch}}function os(s,t,a){var i,l;const r=V(c=>c.autoRefresh),n=X({queryKey:S.messages(s??"",t),queryFn:async()=>{if(!s)return{total:0,showing:0,messages:[]};const c=await Se(s,{...t,last:50});return{total:c.total,showing:c.showing,messages:c.messages}},enabled:!!s,staleTime:5e3,refetchInterval:r?5e3:!1});return{messages:((i=n.data)==null?void 0:i.messages)??[],total:((l=n.data)==null?void 0:l.total)??0,isLoading:n.isLoading,error:n.error,refetch:n.refetch}}function ds(s){var r,n;const t=V(i=>i.autoRefresh),a=X({queryKey:S.status(s??""),queryFn:async()=>{if(!s)return{members:[],total_messages:0};const i=await Me(s);return{members:i.members,total_messages:i.total_messages}},enabled:!!s,staleTime:5e3,refetchInterval:t?5e3:!1});return{members:((r=a.data)==null?void 0:r.members)??[],totalMessages:((n=a.data)==null?void 0:n.total_messages)??0,isLoading:a.isLoading,error:a.error,refetch:a.refetch}}function ms(){const s=Y(),t=Z({mutationFn:we,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{archiveTeam:t.mutateAsync,isArchiving:t.isPending,error:t.error}}function xs(){const s=Y(),t=Z({mutationFn:Te,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{unarchiveTeam:t.mutateAsync,isUnarchiving:t.isPending,error:t.error}}function us(){const s=Y(),t=Z({mutationFn:_e,onSuccess:()=>{s.invalidateQueries({queryKey:S.all})}});return{deleteTeam:t.mutateAsync,isDeleting:t.isPending,error:t.error}}function hs({selectedTeam:s,onBack:t,members:a,totalMessages:r,autoRefresh:n,onToggleAutoRefresh:i,skillType:l,pipelineMode:c}){const{formatMessage:x}=T();return e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs(k,{variant:"ghost",size:"sm",onClick:t,className:"gap-1",children:[e.jsx(ke,{className:"h-4 w-4"}),x({id:"team.detail.backToList"})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(p,{variant:"secondary",className:"gap-1",children:[e.jsx(U,{className:"w-3 h-3"}),x({id:"team.members"}),": ",a.length]}),e.jsxs(p,{variant:"secondary",className:"gap-1",children:[e.jsx(ee,{className:"w-3 h-3"}),x({id:"team.messages"}),": ",r]})]}),(l||c)&&e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx(p,{variant:"outline",className:"gap-1",children:l}),c&&e.jsxs(p,{variant:"default",className:"gap-1",children:[e.jsx(se,{className:"w-3 h-3"}),c]})]})]})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ze,{id:"auto-refresh",checked:n,onCheckedChange:i}),e.jsx(Fe,{htmlFor:"auto-refresh",className:"text-sm text-muted-foreground cursor-pointer",children:x({id:"team.autoRefresh"})}),n&&e.jsx(de,{className:"w-3.5 h-3.5 text-primary animate-spin",style:{animationDuration:"3s"}})]})})]})}const fe={completed:{icon:Pe,color:"text-green-500",bg:"bg-green-500/10 border-green-500/30"},in_progress:{icon:H,color:"text-blue-500",bg:"bg-blue-500/10 border-blue-500/30",animate:!0},pending:{icon:Ee,color:"text-muted-foreground",bg:"bg-muted border-border"},blocked:{icon:Le,color:"text-red-500",bg:"bg-red-500/10 border-red-500/30"},skipped:{icon:Ae,color:"text-yellow-500",bg:"bg-yellow-500/10 border-yellow-500/30"}},fs=["completed","in_progress","pending","blocked","skipped"];function ie({stage:s}){const{formatMessage:t}=T(),a=fe[s.status],r=a.icon,n=s.status==="in_progress"?"inProgress":s.status;return e.jsxs("div",{className:j("flex flex-col items-center gap-1.5 px-4 py-3 rounded-lg border-2 min-w-[90px] transition-all",a.bg),children:[e.jsx(r,{className:j("w-5 h-5",a.color,a.animate&&"animate-spin"),style:a.animate?{animationDuration:"2s"}:void 0}),e.jsx("span",{className:"text-xs font-medium",children:s.label}),e.jsx("span",{className:j("text-[10px]",a.color),children:t({id:`team.pipeline.${n}`})}),s.role&&e.jsx("span",{className:"text-[10px] text-muted-foreground truncate max-w-[80px]",children:s.role})]})}function ps(){return e.jsxs("div",{className:"flex items-center px-1",children:[e.jsx("div",{className:"w-6 h-0.5 bg-border"}),e.jsx("div",{className:"w-0 h-0 border-t-[4px] border-t-transparent border-b-[4px] border-b-transparent border-l-[6px] border-l-border"})]})}function gs({stages:s,phaseInfo:t}){const{formatMessage:a}=T();return s.length===0?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:a({id:"team.pipeline.title"})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:a({id:"team.pipeline.noStages"})})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"space-y-3 flex-1",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:a({id:"team.pipeline.title"})}),t&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(p,{variant:"secondary",children:[a({id:"team.coordinates.phase"}),": ",t.currentPhase,t.totalPhases!=null&&`/${t.totalPhases}`]}),t.currentStep&&e.jsxs(p,{variant:"secondary",children:[a({id:"team.coordinates.step"}),": ",t.currentStep]}),t.gapIteration>0&&e.jsxs(p,{variant:"outline",children:[a({id:"team.coordinates.gap"}),": ",t.gapIteration]})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-0",children:s.map((r,n)=>e.jsxs("div",{className:"flex items-center",children:[n>0&&e.jsx(ps,{}),e.jsx(ie,{stage:r})]},r.id))}),e.jsx("div",{className:"flex sm:hidden flex-col items-center gap-2",children:s.map(r=>e.jsx(ie,{stage:r},r.id))})]}),e.jsx("div",{className:"flex flex-wrap gap-3 text-[10px] text-muted-foreground mt-auto pt-3 border-t border-border",children:fs.map(r=>{const n=fe[r],i=n.icon,l=r==="in_progress"?"inProgress":r;return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(i,{className:j("w-3 h-3",n.color)}),a({id:`team.pipeline.${l}`})]},r)})})]})}function js(s){if(!s)return"";const t=Date.now(),a=new Date(s).getTime(),r=t-a;if(r<0)return"now";const n=Math.floor(r/1e3);if(n<60)return`${n}s`;const i=Math.floor(n/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function vs(s){return s.lastSeen&&Date.now()-new Date(s.lastSeen).getTime()<120*1e3?"active":"idle"}function Ns({members:s}){const{formatMessage:t}=T();return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:t({id:"team.membersPanel.title"})}),e.jsxs("div",{className:"space-y-2",children:[s.map(a=>{const r=vs(a),n=r==="active";return e.jsx(L,{className:"overflow-hidden",children:e.jsx(E,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"pt-0.5",children:e.jsx("div",{className:j("w-2.5 h-2.5 rounded-full",n?"bg-green-500 shadow-[0_0_6px_rgba(34,197,94,0.5)]":"bg-muted-foreground/40")})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:a.member}),e.jsx(p,{variant:n?"success":"secondary",className:"text-[10px] px-1.5 py-0",children:t({id:`team.membersPanel.${r}`})})]}),a.lastAction&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:a.lastAction}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:[a.messageCount," ",t({id:"team.messages"}).toLowerCase()]}),a.lastSeen&&e.jsxs("span",{children:[js(a.lastSeen)," ",t({id:"team.membersPanel.ago"})]})]})]})]})})},a.member)}),s.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:t({id:"team.empty.noMessages"})})]})]})}function bs(s){if(!s)return"";const t=Date.now(),a=new Date(s).getTime(),r=t-a;if(r<0)return"now";const n=Math.floor(r/1e3);if(n<60)return`${n}s`;const i=Math.floor(n/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function ys(s){return s.lastSeen&&Date.now()-new Date(s.lastSeen).getTime()<120*1e3?"active":"idle"}function ws(s,t){const a=s.member.toLowerCase();return t.find(r=>r.role&&r.role.toLowerCase()===a||r.id.toLowerCase()===a)}const Ts={completed:"success",in_progress:"info",pending:"secondary",blocked:"destructive",skipped:"warning"};function le({members:s,stages:t,roleState:a}){const{formatMessage:r}=T();return t.length===0?e.jsx(Ns,{members:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:r({id:"team.membersPanel.title"})}),e.jsxs("div",{className:"space-y-2",children:[s.map(n=>{const i=ys(n),l=i==="active",c=ws(n,t);return e.jsx(L,{className:"overflow-hidden",children:e.jsx(E,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"pt-0.5",children:e.jsx("div",{className:j("w-2.5 h-2.5 rounded-full",l?"bg-green-500 shadow-[0_0_6px_rgba(34,197,94,0.5)]":"bg-muted-foreground/40")})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:n.member}),e.jsx(p,{variant:l?"success":"secondary",className:"text-[10px] px-1.5 py-0",children:r({id:`team.membersPanel.${i}`})}),c&&e.jsx(p,{variant:Ts[c.status]??"secondary",className:"text-[10px] px-1.5 py-0",children:c.label})]}),n.lastAction&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.lastAction}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:[n.messageCount," ",r({id:"team.messages"}).toLowerCase()]}),n.lastSeen&&e.jsxs("span",{children:[bs(n.lastSeen)," ",r({id:"team.membersPanel.ago"})]})]})]})]})})},n.member)}),s.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:r({id:"team.empty.noMessages"})})]})]})}function _s({phaseInfo:s}){const{formatMessage:t}=T();return e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(p,{variant:"secondary",children:[t({id:"team.coordinates.phase"}),": ",s.currentPhase,s.totalPhases!=null&&`/${s.totalPhases}`]}),s.currentStep&&e.jsxs(p,{variant:"secondary",children:[t({id:"team.coordinates.step"}),": ",s.currentStep]}),s.gapIteration>0&&e.jsxs(p,{variant:"outline",children:[t({id:"team.coordinates.gap"}),": ",s.gapIteration]})]})}const ce={plan_ready:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30",plan_approved:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30",plan_revision:"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30",task_unblocked:"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 border-cyan-500/30",impl_complete:"bg-primary/15 text-primary border-primary/30",impl_progress:"bg-primary/15 text-primary border-primary/30",test_result:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30",review_result:"bg-purple-500/15 text-purple-600 dark:text-purple-400 border-purple-500/30",fix_required:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",error:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",shutdown:"bg-muted text-muted-foreground border-border",message:"bg-muted text-muted-foreground border-border"};function Cs({type:s}){const{formatMessage:t}=T(),a=ce[s]||ce.message,r=`team.messageType.${s}`;let n;try{n=t({id:r})}catch{n=s}return e.jsx("span",{className:j("text-[10px] px-1.5 py-0.5 rounded border font-medium",a),children:n})}function Ss({msg:s}){var n,i;const[t,a]=h.useState(!1),r=s.ts?s.ts.substring(11,19):"";return e.jsxs("div",{className:"flex gap-3 py-2.5 border-b border-border last:border-b-0 animate-in fade-in slide-in-from-top-1 duration-300",children:[e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground w-16 shrink-0 pt-0.5",children:r}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs font-medium",children:s.from}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"→"}),e.jsx("span",{className:"text-xs font-medium",children:s.to}),e.jsx(Cs,{type:s.type}),s.id&&e.jsx("span",{className:"text-[10px] text-muted-foreground",children:s.id})]}),e.jsx("p",{className:"text-xs text-foreground/80",children:s.summary}),(s.ref||((n=s.data)==null?void 0:n.ref))&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(ae,{className:"w-3 h-3"}),e.jsx("span",{className:"font-mono truncate",children:s.ref||((i=s.data)==null?void 0:i.ref)})]}),s.data&&Object.keys(s.data).length>0&&e.jsxs("div",{children:[e.jsx("button",{onClick:()=>a(!t),className:"text-[10px] text-primary hover:underline flex items-center gap-0.5",children:t?e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-3 h-3"})," collapse"]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3"})," data"]})}),t&&e.jsx("pre",{className:"text-[10px] bg-muted p-2 rounded mt-1 overflow-x-auto max-h-40",children:JSON.stringify(s.data,null,2)})]})]})]})}function Ms({messages:s,total:t,filter:a,onFilterChange:r,onClearFilter:n,expanded:i,onExpandedChange:l}){const{formatMessage:c}=T(),x=!!(a.from||a.to||a.type),{senders:g,receivers:v,types:C}=h.useMemo(()=>{const d=new Set,m=new Set,_=new Set;for(const y of s)d.add(y.from),m.add(y.to),_.add(y.type);return{senders:Array.from(d).sort(),receivers:Array.from(m).sort(),types:Array.from(_).sort()}},[s]),N=[...s].reverse();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[i?e.jsx(me,{className:"w-4 h-4"}):e.jsx(te,{className:"w-4 h-4"}),c({id:"team.timeline.title"}),e.jsxs("span",{className:"text-xs font-normal",children:["(",c({id:"team.timeline.showing"},{showing:s.length,total:t}),")"]})]}),x&&e.jsxs(k,{variant:"ghost",size:"sm",onClick:n,className:"h-6 text-xs gap-1",children:[e.jsx(xe,{className:"w-3 h-3"}),c({id:"team.timeline.clearFilters"})]})]}),i&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(W,{value:a.from??"__all__",onValueChange:d=>r({from:d==="__all__"?void 0:d}),children:[e.jsxs(I,{className:"w-[130px] h-7 text-xs",children:[e.jsx(es,{className:"w-3 h-3 mr-1"}),e.jsx(J,{placeholder:c({id:"team.timeline.filterFrom"})})]}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),g.map(d=>e.jsx($,{value:d,children:d},d))]})]}),e.jsxs(W,{value:a.to??"__all__",onValueChange:d=>r({to:d==="__all__"?void 0:d}),children:[e.jsx(I,{className:"w-[130px] h-7 text-xs",children:e.jsx(J,{placeholder:c({id:"team.timeline.filterTo"})})}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),v.map(d=>e.jsx($,{value:d,children:d},d))]})]}),e.jsxs(W,{value:a.type??"__all__",onValueChange:d=>r({type:d==="__all__"?void 0:d}),children:[e.jsx(I,{className:"w-[150px] h-7 text-xs",children:e.jsx(J,{placeholder:c({id:"team.timeline.filterType"})})}),e.jsxs(G,{children:[e.jsx($,{value:"__all__",children:c({id:"team.filterAll"})}),C.map(d=>e.jsx($,{value:d,children:d},d))]})]})]}),e.jsx(L,{children:e.jsx(E,{className:"p-3",children:N.length>0?e.jsx("div",{className:"divide-y-0",children:N.map(d=>e.jsx(Ss,{msg:d},d.id))}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:c({id:"team.empty.noMessages"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:c({id:"team.empty.noMessagesHint"})})]})})})]})]})}function pe(s){return s.endsWith(".json")?"json":s.endsWith(".md")?"markdown":s.endsWith(".txt")||s.endsWith(".log")||s.endsWith(".tsv")||s.endsWith(".csv")?"text":"unknown"}function ge(s){return s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`:""}function ks(s){if(!s)return"";try{return new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function je({contentType:s}){return s==="json"?e.jsx(ts,{className:"w-4 h-4 text-blue-500"}):e.jsx(ae,{className:"w-4 h-4 text-gray-500"})}function ve({node:s,depth:t,expanded:a,selectedPath:r,onToggle:n,onSelect:i}){if(s.type==="directory"){const x=a.has(s.path);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 py-1.5 px-2 cursor-pointer hover:bg-accent/50 rounded transition-colors",style:{paddingLeft:t*16+8},onClick:()=>n(s.path),children:[x?e.jsx(te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Re,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ss,{className:j("w-4 h-4",x?"text-amber-500":"text-amber-400")}),e.jsx("span",{className:"text-sm truncate",children:s.name})]}),x&&s.children&&e.jsx("div",{children:s.children.map(g=>e.jsx(ve,{node:g,depth:t+1,expanded:a,selectedPath:r,onToggle:n,onSelect:i},g.path))})]},s.path)}const l=r===s.path,c=s.contentType||pe(s.path);return e.jsxs("div",{className:j("flex items-center gap-1 py-1.5 px-2 cursor-pointer hover:bg-accent/50 rounded transition-colors",l&&"bg-accent"),style:{paddingLeft:t*16+28},onClick:()=>i(s),children:[e.jsx(je,{contentType:c}),e.jsx("span",{className:"text-sm truncate flex-1",children:s.name}),s.size!==void 0&&e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:ge(s.size)})]},s.path)}function Fs({teamName:s}){const{formatMessage:t}=T(),[a,r]=h.useState([]),[n,i]=h.useState(new Set),[l,c]=h.useState(null),[x,g]=h.useState(""),[v,C]=h.useState(!1),[N,d]=h.useState(!0),[m,_]=h.useState(null);h.useEffect(()=>{s&&(d(!0),_(null),$e(s).then(f=>{r(f.tree||[]);const b=(f.tree||[]).filter(w=>w.type==="directory").map(w=>w.path);i(new Set(b))}).catch(f=>{console.error("Failed to load artifacts:",f),_(t({id:"team.artifacts.loadError",defaultMessage:"Failed to load artifacts"}))}).finally(()=>{d(!1)}))},[s,t]);const y=h.useCallback(f=>{i(b=>{const w=new Set(b);return w.has(f)?w.delete(f):w.add(f),w})},[]),F=h.useCallback(async f=>{if(f.type!=="directory"){c(f),C(!0),g("");try{const b=await De(s,f.path);g(b.content)}catch(b){console.error("Failed to load file content:",b),g(t({id:"team.artifacts.contentError",defaultMessage:"Failed to load file content"}))}finally{C(!1)}}},[s,t]),A=l?l.contentType||pe(l.path):"text",M=A==="json"?"json":A==="markdown"?"markdown":"text";return N?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(H,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:t({id:"team.artifacts.loading",defaultMessage:"Loading artifacts..."})})]}):m?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Q,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:m})]}):a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Q,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:t({id:"team.artifacts.noArtifacts",defaultMessage:"No artifacts yet"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"team.artifacts.emptyHint",defaultMessage:"Artifacts will appear here when the team generates them"})})]}):e.jsxs("div",{className:"flex h-[600px] border rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"w-72 shrink-0 border-r bg-muted/30 flex flex-col",children:[e.jsx("div",{className:"p-3 border-b bg-background shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:t({id:"team.artifacts.title",defaultMessage:"Artifacts"})})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:a.map(f=>e.jsx(ve,{node:f,depth:0,expanded:n,selectedPath:l==null?void 0:l.path,onToggle:y,onSelect:F},f.path))})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-3 border-b bg-muted/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{contentType:A}),e.jsx("span",{className:"text-sm font-medium truncate",children:l.name}),l.size!==void 0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:ge(l.size)}),l.modifiedAt&&e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:ks(l.modifiedAt)})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:v?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(H,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsx(Ls,{content:x,contentType:M})})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-center p-8",children:e.jsxs("div",{children:[e.jsx(ae,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:t({id:"team.artifacts.selectFile",defaultMessage:"Select a file to preview"})})]})})})]})}function q({data:s,depth:t=0}){if(s===null)return e.jsx("span",{className:"text-red-500 font-mono text-sm",children:"null"});if(s===void 0)return e.jsx("span",{className:"text-muted-foreground font-mono text-sm",children:"undefined"});if(typeof s=="boolean")return e.jsx("span",{className:j("font-mono text-sm",s?"text-orange-500":"text-red-500"),children:s?"true":"false"});if(typeof s=="number")return e.jsx("span",{className:"text-blue-500 font-mono text-sm",children:s});if(typeof s=="string")return s.length>200?e.jsxs("span",{className:"text-green-600 dark:text-green-400 font-mono text-sm break-all",children:['"',s.slice(0,200),'..."']}):e.jsxs("span",{className:"text-green-600 dark:text-green-400 font-mono text-sm",children:['"',s,'"']});if(Array.isArray(s))return s.length===0?e.jsx("span",{className:"text-muted-foreground text-sm",children:"[]"}):e.jsx("div",{className:"space-y-2",children:s.map((a,r)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(p,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:r}),e.jsx("div",{className:"flex-1 min-w-0",children:typeof a=="object"&&a!==null?e.jsx("div",{className:"bg-muted/30 rounded-lg p-2 border",children:e.jsx(q,{data:a,depth:t+1})}):e.jsx(q,{data:a,depth:t+1})})]},r))});if(typeof s=="object"){const a=Object.entries(s);return a.length===0?e.jsx("span",{className:"text-muted-foreground text-sm",children:"{}"}):e.jsx("div",{className:j("space-y-2",t>0&&"pl-2 border-l-2 border-border"),children:a.map(([r,n])=>{const i=typeof n=="object"&&n!==null,l=Array.isArray(n),c=l?n.length:i?Object.keys(n).length:0;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("span",{className:"text-purple-600 dark:text-purple-400 font-medium text-sm shrink-0",children:r}),i&&e.jsx(p,{variant:"secondary",className:"text-[10px] h-4 px-1",children:l?`${c} items`:`${c} fields`})]}),e.jsx("div",{className:"ml-3",children:i?e.jsx("div",{className:"bg-muted/20 rounded-md p-2 border",children:e.jsx(q,{data:n,depth:t+1})}):e.jsx(q,{data:n,depth:t+1})})]},r)})})}return e.jsx("span",{className:"text-sm",children:String(s)})}function As({data:s}){const t=h.useMemo(()=>{const a={type:"",fields:0,items:0,depth:0},r=(n,i)=>{a.depth=Math.max(a.depth,i),Array.isArray(n)?(a.type="Array",a.items=n.length,n.forEach(l=>r(l,i+1))):typeof n=="object"&&n!==null&&(a.type="Object",a.fields=Object.keys(n).length,Object.values(n).forEach(l=>r(l,i+1)))};return r(s,0),a},[s]);return e.jsxs("div",{className:"flex items-center gap-4 p-3 bg-muted/50 rounded-lg mb-4 text-sm",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(p,{variant:"outline",children:t.type})}),t.type==="Object"&&e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.fields})," fields"]}),t.type==="Array"&&e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.items})," items"]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.depth})," levels deep"]})]})}function Ls({content:s,contentType:t}){if(!s)return e.jsx("div",{className:"text-muted-foreground text-sm",children:"No content"});if(t==="json")try{const a=JSON.parse(s);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(As,{data:a}),e.jsx("div",{className:"bg-card rounded-lg",children:e.jsx(q,{data:a})})]})}catch{return e.jsx("pre",{className:"text-xs bg-muted/50 p-4 rounded-lg overflow-auto font-mono whitespace-pre-wrap break-words border",children:s})}return t==="markdown"?e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-sm leading-relaxed bg-transparent p-0",children:s})}):e.jsx("pre",{className:"text-xs bg-muted/50 p-4 rounded-lg overflow-auto font-mono whitespace-pre-wrap break-words border",children:s})}const Es={active:{variant:"info"},completed:{variant:"success"},archived:{variant:"secondary"}},oe={active:"team.status.active",completed:"team.status.completed",archived:"team.status.archived"};function Ps(s){if(!s)return"";try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function $s({team:s,onClick:t,onArchive:a,onUnarchive:r,onDelete:n,showActions:i=!0,actionsDisabled:l=!1,className:c}){const{formatMessage:x}=T(),{variant:g}=Es[s.status]||{variant:"default"},v=oe[s.status]?x({id:oe[s.status]}):s.status,C=s.status==="archived",N=m=>{m.target.closest("[data-radix-popper-content-wrapper]")||t==null||t(s.name)},d=(m,_)=>{switch(m.stopPropagation(),_){case"view":t==null||t(s.name);break;case"archive":a==null||a(s.name);break;case"unarchive":r==null||r(s.name);break;case"delete":n==null||n(s.name);break}};return e.jsx(L,{className:j("group cursor-pointer transition-all duration-200 hover:shadow-md hover:border-primary/30",c),onClick:N,children:e.jsxs(E,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("h3",{className:"font-bold text-card-foreground text-sm tracking-wide truncate",children:s.name})})}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(p,{variant:g,children:v}),s.pipeline_mode&&e.jsxs(p,{variant:"default",className:"gap-1",children:[e.jsx(se,{className:"h-3 w-3"}),s.pipeline_mode]}),i&&e.jsxs(qe,{children:[e.jsx(Ve,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:m=>m.stopPropagation(),disabled:l,children:e.jsx(as,{className:"h-4 w-4"})})}),e.jsxs(ze,{align:"end",children:[e.jsxs(B,{onClick:m=>d(m,"view"),children:[e.jsx(rs,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.viewDetails"})]}),e.jsx(re,{}),C?e.jsxs(B,{onClick:m=>d(m,"unarchive"),children:[e.jsx(ns,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.unarchive"})]}):e.jsxs(B,{onClick:m=>d(m,"archive"),children:[e.jsx(is,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.archive"})]}),e.jsx(re,{}),e.jsxs(B,{onClick:m=>d(m,"delete"),className:"text-destructive focus:text-destructive",children:[e.jsx(Be,{className:"mr-2 h-4 w-4"}),x({id:"team.actions.delete"})]})]})]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s.messageCount," ",x({id:"team.card.messages"})]}),s.lastActivity&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),Ps(s.lastActivity)]})]}),s.members&&s.members.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 flex-wrap",children:[e.jsx(U,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.members.map(m=>e.jsx(p,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-normal",children:m},m))]})]})})}function Ds({className:s}){return e.jsx(L,{className:j("animate-pulse",s),children:e.jsxs(E,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-5 w-32 rounded bg-muted"})}),e.jsx("div",{className:"h-5 w-16 rounded-full bg-muted"})]}),e.jsxs("div",{className:"mt-3 flex gap-4",children:[e.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),e.jsx("div",{className:"h-4 w-20 rounded bg-muted"}),e.jsx("div",{className:"h-4 w-20 rounded bg-muted"})]})]})})}function Rs(){const{formatMessage:s}=T(),{locationFilter:t,setLocationFilter:a,searchQuery:r,setSearchQuery:n,selectTeamAndShowDetail:i}=V(),[l,c]=h.useState(!1),[x,g]=h.useState(null),{teams:v,isLoading:C,isFetching:N,refetch:d}=he(t),{archiveTeam:m,isArchiving:_}=ms(),{unarchiveTeam:y,isUnarchiving:F}=xs(),{deleteTeam:A,isDeleting:M}=us(),f=_||F||M,b=h.useMemo(()=>{if(!r)return v;const u=r.toLowerCase();return v.filter(P=>P.name.toLowerCase().includes(u))},[v,r]),w=async u=>{try{await m(u)}catch(P){console.error("Failed to archive team:",P)}},o=async u=>{try{await y(u)}catch(P){console.error("Failed to unarchive team:",P)}},D=u=>{g(u),c(!0)},R=async()=>{if(x)try{await A(x),c(!1),g(null)}catch(u){console.error("Failed to delete team:",u)}},z=()=>n("");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-5 h-5"}),e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:s({id:"team.title"})})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s({id:"team.description"})})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(k,{variant:"outline",size:"sm",onClick:()=>d(),disabled:N,children:[e.jsx(de,{className:j("h-4 w-4 mr-2",N&&"animate-spin")}),s({id:"common.actions.refresh"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[e.jsx(ue,{value:t,onValueChange:u=>a(u),tabs:[{value:"active",label:s({id:"team.filters.active"})},{value:"archived",label:s({id:"team.filters.archived"})},{value:"all",label:s({id:"team.filters.all"})}]}),e.jsxs("div",{className:"flex-1 max-w-sm relative",children:[e.jsx(Ke,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Qe,{placeholder:s({id:"team.searchPlaceholder"}),value:r,onChange:u=>n(u.target.value),className:"pl-9 pr-9"}),r&&e.jsx("button",{onClick:z,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:e.jsx(xe,{className:"h-4 w-4"})})]})]}),C?e.jsx("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((u,P)=>e.jsx(Ds,{},P))}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4 border border-dashed border-border rounded-lg",children:[e.jsx(U,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:s(r?{id:"team.emptyState.noMatching"}:{id:"team.emptyState.noTeams"})}),e.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-sm mb-4",children:s(r?{id:"team.emptyState.noMatchingDescription"}:{id:"team.emptyState.noTeamsDescription"})}),r&&e.jsx(k,{variant:"outline",onClick:z,children:s({id:"common.actions.clearFilters"})})]}):e.jsx("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:b.map(u=>e.jsx($s,{team:u,onClick:i,onArchive:w,onUnarchive:o,onDelete:D,actionsDisabled:f},u.name))}),e.jsx(Ue,{open:l,onOpenChange:c,children:e.jsxs(We,{children:[e.jsxs(Ie,{children:[e.jsx(Je,{children:s({id:"team.dialog.deleteTeam"})}),e.jsx(Ge,{children:s({id:"team.dialog.deleteConfirm"})})]}),e.jsxs(He,{children:[e.jsx(k,{variant:"outline",onClick:()=>{c(!1),g(null)},children:s({id:"team.dialog.cancel"})}),e.jsx(k,{variant:"destructive",onClick:R,disabled:M,children:s(M?{id:"team.dialog.deleting"}:{id:"team.actions.delete"})})]})]})})]})}const qs=["plan","impl","test","review"];function O(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}function K(s,t){const a=s.toLowerCase(),r=t.filter(l=>{const c=l.from.toLowerCase();return c===a||c.startsWith(a)});if(r.length===0)return"pending";const n=r[r.length-1];return["shutdown","impl_complete","review_result","test_result"].includes(n.type)?"completed":n.type==="error"?"blocked":"in_progress"}function Vs(s,t){if(s.pipeline_stages&&s.pipeline_stages.length>0)return s.pipeline_stages.map(a=>{var l;const r=a.toUpperCase(),n=a.toLowerCase(),i=(l=s.roles)==null?void 0:l.find(c=>c.toLowerCase().startsWith(n));return{id:r,label:O(a),role:i,status:K(a,t)}});if(s.roles&&s.roles.length>0){const a=s.roles.filter(r=>r.toLowerCase()!=="coordinator");if(a.length>0)return a.map(r=>({id:r.toUpperCase(),label:O(r),role:r,status:K(r,t)}))}if(t.length>0){const a=new Map;for(const r of t){const n=r.from;if(n.toLowerCase()==="coordinator")continue;const i=n.toLowerCase();a.has(i)||a.set(i,n)}if(a.size>0)return Array.from(a.entries()).map(([,r])=>({id:r.toUpperCase(),label:O(r),role:r,status:K(r,t)}))}return qs.map(a=>({id:a.toUpperCase(),label:O(a),role:void 0,status:K(a,t)}))}function zs(s){if(!s||Object.keys(s).length===0)return null;const t=s.coordinator;return!t||typeof t.current_phase!="number"?null:{currentPhase:t.current_phase,totalPhases:typeof t.total_phases=="number"?t.total_phases:null,currentStep:typeof t.current_step=="string"?t.current_step:null,gapIteration:typeof t.gap_iteration=="number"?t.gap_iteration:0}}function et(){const{formatMessage:s}=T(),{selectedTeam:t,viewMode:a,autoRefresh:r,toggleAutoRefresh:n,messageFilter:i,setMessageFilter:l,clearMessageFilter:c,timelineExpanded:x,setTimelineExpanded:g,detailTab:v,setDetailTab:C,backToList:N,locationFilter:d}=V(),m=ne(Xe),_=ne(u=>u.toggleImmersiveMode),{teams:y,error:F,isLoading:A}=he(d),{messages:M,total:f}=os(a==="detail"?t:null,i),{members:b,totalMessages:w}=ds(a==="detail"?t:null),o=h.useMemo(()=>y.find(u=>u.name===t),[y,t]);h.useEffect(()=>{a==="detail"&&t&&!A&&y.length>0&&!o&&N()},[a,t,A,y.length,o,N]);const D=h.useMemo(()=>Vs({pipeline_stages:o==null?void 0:o.pipeline_stages,role_state:o==null?void 0:o.role_state,roles:o==null?void 0:o.roles},M),[o==null?void 0:o.pipeline_stages,o==null?void 0:o.role_state,o==null?void 0:o.roles,M]),R=h.useMemo(()=>zs(o==null?void 0:o.role_state),[o==null?void 0:o.role_state]);if(F&&a==="detail")return e.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"mb-4",children:e.jsx(Ye,{className:"w-16 h-16 mx-auto text-destructive"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:s({id:"team.error.loadFailed"})}),e.jsx("p",{className:"text-muted-foreground mb-6",children:F instanceof Error?F.message:String(F)}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(k,{onClick:N,variant:"default",children:s({id:"team.detail.backToList"})}),e.jsx(k,{onClick:()=>window.location.reload(),variant:"outline",children:s({id:"common.actions.retry"})})]})]})});if(a==="list"||!t||a==="detail"&&y.length>0&&!o)return e.jsx("div",{className:"space-y-6",children:e.jsx(Rs,{})});const z=[{value:"pipeline",label:s({id:"team.tabs.pipeline"}),icon:e.jsx(se,{className:"h-4 w-4"})},{value:"artifacts",label:s({id:"team.tabs.artifacts"}),icon:e.jsx(Q,{className:"h-4 w-4"})},{value:"messages",label:s({id:"team.tabs.messages"}),icon:e.jsx(ee,{className:"h-4 w-4"})}];return e.jsxs("div",{className:j("space-y-6",m&&"h-screen overflow-hidden"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(hs,{selectedTeam:t,onBack:N,members:b,totalMessages:w,autoRefresh:r,onToggleAutoRefresh:n,skillType:o!=null&&o.team_name?`team-${o.team_name}`:void 0,pipelineMode:o==null?void 0:o.pipeline_mode}),e.jsx("button",{onClick:_,className:j("p-2 rounded-md transition-colors",m?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:m?"Exit Fullscreen":"Fullscreen",children:m?e.jsx(ls,{className:"w-4 h-4"}):e.jsx(cs,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx(L,{className:"lg:col-span-2 flex flex-col",children:e.jsx(E,{className:"p-4 flex-1",children:e.jsx(gs,{stages:D,phaseInfo:R})})}),e.jsx(L,{children:e.jsx(E,{className:"p-4",children:e.jsx(le,{members:b,stages:D,roleState:o==null?void 0:o.role_state})})})]}),R&&e.jsx(_s,{phaseInfo:R}),e.jsx(ue,{value:v,onValueChange:u=>C(u),tabs:z}),v==="pipeline"&&e.jsx(L,{children:e.jsx(E,{className:"p-6",children:e.jsx(le,{members:b,stages:D,roleState:o==null?void 0:o.role_state})})}),v==="artifacts"&&e.jsx(Fs,{teamName:t}),v==="messages"&&e.jsx(Ms,{messages:M,total:f,filter:i,onFilterChange:l,onClearFilter:c,expanded:x,onExpandedChange:g})]})}export{et as TeamPage,et as default};
2
+ //# sourceMappingURL=TeamPage-8OnLsAfJ.js.map