maestro-flow 0.4.3 → 0.4.5

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 (263) hide show
  1. package/.claude/commands/maestro-collab.md +1 -1
  2. package/.claude/commands/maestro-composer.md +1 -1
  3. package/.claude/commands/maestro-impeccable.md +1 -1
  4. package/.claude/commands/maestro-learn.md +1 -1
  5. package/.claude/commands/maestro-overlay.md +1 -1
  6. package/.claude/commands/maestro-quick.md +1 -1
  7. package/.claude/commands/maestro-ralph.md +1 -1
  8. package/.claude/commands/maestro-tools-execute.md +1 -1
  9. package/.claude/commands/maestro-tools-register.md +1 -1
  10. package/.claude/commands/maestro.md +1 -1
  11. package/.claude/commands/manage-issue-discover.md +1 -1
  12. package/.claude/commands/manage-issue.md +1 -1
  13. package/.claude/commands/manage-knowhow-capture.md +3 -1
  14. package/.claude/commands/manage-knowhow.md +1 -1
  15. package/.claude/commands/manage-learn.md +1 -1
  16. package/.claude/commands/manage-status.md +1 -0
  17. package/.claude/commands/manage-wiki.md +1 -1
  18. package/.claude/commands/quality-auto-test.md +1 -2
  19. package/.claude/commands/quality-refactor.md +1 -1
  20. package/.claude/commands/quality-test.md +5 -0
  21. package/.claude/commands/security-audit.md +1 -0
  22. package/.claude/commands/spec-add.md +6 -3
  23. package/.claude/commands/spec-setup.md +0 -3
  24. package/dashboard/dist/assets/{ArtifactsPage-iJZtYsmR.js → ArtifactsPage-CVh0Z2I2.js} +3 -3
  25. package/dashboard/dist/assets/{ChatInput-DNnDLdQF.js → ChatInput-CBI3qHQQ.js} +2 -2
  26. package/dashboard/dist/assets/ChatPage-BjJ9CYox.js +22 -0
  27. package/dashboard/dist/assets/CollabPage-CprGGO9y.js +1 -0
  28. package/dashboard/dist/assets/{ExecutionPanel-BKV3GZ7Q.js → ExecutionPanel-CClxD7cH.js} +1 -1
  29. package/dashboard/dist/assets/KanbanPage-copqjdPg.js +16 -0
  30. package/dashboard/dist/assets/MaestroCoordinatePage-CioZjQ9N.js +4 -0
  31. package/dashboard/dist/assets/{MarkdownRenderer-cYFfe1uX.js → MarkdownRenderer-CtUhoxCT.js} +1 -1
  32. package/dashboard/dist/assets/McpPage-BcPPcJpr.js +21 -0
  33. package/dashboard/dist/assets/{MeetingRoomPage-wnvT7wlB.js → MeetingRoomPage-BgmAKxU-.js} +1 -1
  34. package/dashboard/dist/assets/{OutputPanel-DDL90Idy.js → OutputPanel-DgT3gMyp.js} +1 -1
  35. package/dashboard/dist/assets/{ProblemsPanel-zFN9IIs0.js → ProblemsPanel-BmG7rxoG.js} +1 -1
  36. package/dashboard/dist/assets/{RequirementBoardPage-DOPJoT0I.js → RequirementBoardPage-k8YoeQ0r.js} +1 -1
  37. package/dashboard/dist/assets/{RequirementPage-CEVquRgM.js → RequirementPage-Da2354px.js} +1 -1
  38. package/dashboard/dist/assets/{RoomsPage-D5USEWDh.js → RoomsPage-BtqDiYaU.js} +1 -1
  39. package/dashboard/dist/assets/SpecsPage-ByPVH_M3.js +36 -0
  40. package/dashboard/dist/assets/{TeamsPage-DlcEmr_Q.js → TeamsPage-sFDLN30L.js} +1 -1
  41. package/dashboard/dist/assets/{TreeBrowser-Y48Wz-QY.js → TreeBrowser-oEx8YJXV.js} +1 -1
  42. package/dashboard/dist/assets/WorkflowPage-JrX7CVHh.js +6 -0
  43. package/dashboard/dist/assets/{arrow-left-NCUOENvg.js → arrow-left-DYvgSdIH.js} +1 -1
  44. package/dashboard/dist/assets/{check-o7nfGNHf.js → check-jcgYBWVR.js} +1 -1
  45. package/dashboard/dist/assets/{chevron-right-BXySK2fn.js → chevron-right-DvZ5sMOg.js} +1 -1
  46. package/dashboard/dist/assets/{circle-cooAwnAR.js → circle-DYT-zoRZ.js} +1 -1
  47. package/dashboard/dist/assets/{circle-alert-DcSBokh4.js → circle-alert-Bfbv3gt4.js} +1 -1
  48. package/dashboard/dist/assets/{circle-check-Cd-jce4j.js → circle-check-D82WnpbI.js} +1 -1
  49. package/dashboard/dist/assets/{circle-check-big-BN7Mdp4i.js → circle-check-big-CPVD1GKF.js} +1 -1
  50. package/dashboard/dist/assets/{code-BQa9oL1n.js → code-B3bKFGI4.js} +1 -1
  51. package/dashboard/dist/assets/{columns-3-BzgxelGx.js → columns-3-BeMAQCix.js} +1 -1
  52. package/dashboard/dist/assets/{download-swRJnate.js → download-BCtpoWYB.js} +1 -1
  53. package/dashboard/dist/assets/en-2h6fD0j8.js +1 -0
  54. package/dashboard/dist/assets/{folder-DbGbLNFN.js → folder-CTj6SNNu.js} +1 -1
  55. package/dashboard/dist/assets/index-6-yE5Yl9.css +1 -0
  56. package/dashboard/dist/assets/{index-DIoMBMbv.js → index-BxR_3IbJ.js} +1 -1
  57. package/dashboard/dist/assets/{index-DLBN_7fb.js → index-CWBJLu42.js} +1 -1
  58. package/dashboard/dist/assets/index-DpcPd-UG.js +236 -0
  59. package/dashboard/dist/assets/{list-BTRAIvDq.js → list-BMv8pIQn.js} +1 -1
  60. package/dashboard/dist/assets/{loader-NHtB6Mdn.js → loader-DdM4VOgF.js} +1 -1
  61. package/dashboard/dist/assets/{minus-BjMxRTET.js → minus-D15s2E__.js} +1 -1
  62. package/dashboard/dist/assets/{pen-line-C4_O16H0.js → pen-line-DO6o4xWz.js} +1 -1
  63. package/dashboard/dist/assets/{pencil-DTmKhyDY.js → pencil-qGxg9jOe.js} +1 -1
  64. package/dashboard/dist/assets/{proxy-Dtx5p6IO.js → proxy-DOffTzwA.js} +1 -1
  65. package/dashboard/dist/assets/refresh-cw-C9UNdLCy.js +6 -0
  66. package/dashboard/dist/assets/{rows-2-GR1dZtRu.js → rows-2-CifAA5SL.js} +1 -1
  67. package/dashboard/dist/assets/{search-DVtgy2W7.js → search-pe7pU1YN.js} +1 -1
  68. package/dashboard/dist/assets/{shallow-BOmvDNsv.js → shallow-r7YynQYA.js} +1 -1
  69. package/dashboard/dist/assets/table-Bh772iIw.js +6 -0
  70. package/dashboard/dist/assets/{team-types-BPeOvVdA.js → team-types-C_HqX2p2.js} +1 -1
  71. package/dashboard/dist/assets/{terminal-CzogW4cl.js → terminal-EpmtGBlw.js} +1 -1
  72. package/dashboard/dist/assets/{trash-2-52LATVfW.js → trash-2-Xen46iNQ.js} +1 -1
  73. package/dashboard/dist/assets/{users-DLFE2voE.js → users-BLueDPxF.js} +1 -1
  74. package/dashboard/dist/assets/{zap-DhiYlgyZ.js → zap-DsQCPF61.js} +1 -1
  75. package/dashboard/dist/assets/zh-CN-r3AvxxOL.js +1 -0
  76. package/dashboard/dist/index.html +2 -2
  77. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +70 -1
  78. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  79. package/dashboard/dist-server/src/types/index.d.ts +48 -6
  80. package/dist/src/commands/coordinate.d.ts.map +1 -1
  81. package/dist/src/commands/coordinate.js +2 -0
  82. package/dist/src/commands/coordinate.js.map +1 -1
  83. package/dist/src/commands/hooks.d.ts.map +1 -1
  84. package/dist/src/commands/hooks.js +201 -6
  85. package/dist/src/commands/hooks.js.map +1 -1
  86. package/dist/src/commands/spec.d.ts.map +1 -1
  87. package/dist/src/commands/spec.js +466 -0
  88. package/dist/src/commands/spec.js.map +1 -1
  89. package/dist/src/config/index.d.ts +5 -1
  90. package/dist/src/config/index.d.ts.map +1 -1
  91. package/dist/src/config/index.js +42 -0
  92. package/dist/src/config/index.js.map +1 -1
  93. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  94. package/dist/src/hooks/keyword-spec-injector.js +106 -10
  95. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  96. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts +13 -0
  97. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts.map +1 -0
  98. package/dist/src/hooks/plugins/spec-analytics-plugin.js +92 -0
  99. package/dist/src/hooks/plugins/spec-analytics-plugin.js.map +1 -0
  100. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  101. package/dist/src/hooks/plugins/spec-injection-plugin.js +57 -4
  102. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  103. package/dist/src/hooks/spec-analytics.d.ts +128 -0
  104. package/dist/src/hooks/spec-analytics.d.ts.map +1 -0
  105. package/dist/src/hooks/spec-analytics.js +311 -0
  106. package/dist/src/hooks/spec-analytics.js.map +1 -0
  107. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  108. package/dist/src/hooks/spec-injector.js +140 -6
  109. package/dist/src/hooks/spec-injector.js.map +1 -1
  110. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -1
  111. package/dist/src/tools/spec-keyword-index.js +23 -6
  112. package/dist/src/tools/spec-keyword-index.js.map +1 -1
  113. package/dist/src/tools/spec-loader.d.ts +20 -0
  114. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  115. package/dist/src/tools/spec-loader.js +58 -7
  116. package/dist/src/tools/spec-loader.js.map +1 -1
  117. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  118. package/dist/src/tools/store-knowhow.js +26 -1
  119. package/dist/src/tools/store-knowhow.js.map +1 -1
  120. package/dist/src/tui/config-ui/ConfigHub.d.ts +1 -1
  121. package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -1
  122. package/dist/src/tui/config-ui/ConfigHub.js +16 -10
  123. package/dist/src/tui/config-ui/ConfigHub.js.map +1 -1
  124. package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -1
  125. package/dist/src/tui/config-ui/ConfigSourcesView.js +3 -2
  126. package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -1
  127. package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -1
  128. package/dist/src/tui/config-ui/HooksPanel.js +15 -19
  129. package/dist/src/tui/config-ui/HooksPanel.js.map +1 -1
  130. package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -1
  131. package/dist/src/tui/config-ui/SkillConfigDashboard.js +5 -9
  132. package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -1
  133. package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -1
  134. package/dist/src/tui/config-ui/SkillParamEditor.js +1 -3
  135. package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -1
  136. package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -1
  137. package/dist/src/tui/config-ui/SkillsList.js +7 -9
  138. package/dist/src/tui/config-ui/SkillsList.js.map +1 -1
  139. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts +6 -0
  140. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts.map +1 -0
  141. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js +164 -0
  142. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js.map +1 -0
  143. package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -1
  144. package/dist/src/tui/config-ui/SpecPanel.js +918 -20
  145. package/dist/src/tui/config-ui/SpecPanel.js.map +1 -1
  146. package/dist/src/tui/config-ui/index.d.ts +3 -1
  147. package/dist/src/tui/config-ui/index.d.ts.map +1 -1
  148. package/dist/src/tui/config-ui/index.js +4 -0
  149. package/dist/src/tui/config-ui/index.js.map +1 -1
  150. package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -1
  151. package/dist/src/tui/install-ui/BackupConfig.js +3 -2
  152. package/dist/src/tui/install-ui/BackupConfig.js.map +1 -1
  153. package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -1
  154. package/dist/src/tui/install-ui/BlueprintPreview.js +7 -6
  155. package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -1
  156. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
  157. package/dist/src/tui/install-ui/ComponentGrid.js +3 -2
  158. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
  159. package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
  160. package/dist/src/tui/install-ui/ConfigPanel.js +4 -3
  161. package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
  162. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
  163. package/dist/src/tui/install-ui/CyberItem.js +7 -6
  164. package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
  165. package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -1
  166. package/dist/src/tui/install-ui/CyberdeckBlueprint.js +2 -1
  167. package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -1
  168. package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
  169. package/dist/src/tui/install-ui/ExecutionView.js +3 -2
  170. package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
  171. package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -1
  172. package/dist/src/tui/install-ui/GradientHeader.js +2 -1
  173. package/dist/src/tui/install-ui/GradientHeader.js.map +1 -1
  174. package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
  175. package/dist/src/tui/install-ui/HooksConfig.js +8 -8
  176. package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
  177. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  178. package/dist/src/tui/install-ui/InstallConfirm.js +4 -3
  179. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  180. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  181. package/dist/src/tui/install-ui/InstallExecution.js +3 -2
  182. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  183. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  184. package/dist/src/tui/install-ui/InstallFlow.js +3 -2
  185. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  186. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  187. package/dist/src/tui/install-ui/InstallHub.js +9 -8
  188. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  189. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  190. package/dist/src/tui/install-ui/InstallResult.js +3 -2
  191. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  192. package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -1
  193. package/dist/src/tui/install-ui/McpConfig.js +4 -3
  194. package/dist/src/tui/install-ui/McpConfig.js.map +1 -1
  195. package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -1
  196. package/dist/src/tui/install-ui/ResultDashboard.js +3 -2
  197. package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -1
  198. package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -1
  199. package/dist/src/tui/install-ui/ReviewPanel.js +2 -1
  200. package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -1
  201. package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -1
  202. package/dist/src/tui/install-ui/StatuslineConfig.js +3 -2
  203. package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -1
  204. package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -1
  205. package/dist/src/tui/install-ui/StepSelector.js +11 -10
  206. package/dist/src/tui/install-ui/StepSelector.js.map +1 -1
  207. package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -1
  208. package/dist/src/tui/overlay-ui/OverlayList.js +8 -12
  209. package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -1
  210. package/dist/src/tui/shared/components.d.ts +56 -0
  211. package/dist/src/tui/shared/components.d.ts.map +1 -0
  212. package/dist/src/tui/shared/components.js +55 -0
  213. package/dist/src/tui/shared/components.js.map +1 -0
  214. package/dist/src/tui/shared/helpers.d.ts +24 -0
  215. package/dist/src/tui/shared/helpers.d.ts.map +1 -0
  216. package/dist/src/tui/shared/helpers.js +49 -0
  217. package/dist/src/tui/shared/helpers.js.map +1 -0
  218. package/dist/src/tui/shared/index.d.ts +4 -0
  219. package/dist/src/tui/shared/index.d.ts.map +1 -0
  220. package/dist/src/tui/shared/index.js +7 -0
  221. package/dist/src/tui/shared/index.js.map +1 -0
  222. package/dist/src/tui/shared/tokens.d.ts +79 -0
  223. package/dist/src/tui/shared/tokens.d.ts.map +1 -0
  224. package/dist/src/tui/shared/tokens.js +81 -0
  225. package/dist/src/tui/shared/tokens.js.map +1 -0
  226. package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -1
  227. package/dist/src/tui/tools-ui/CommandReference.js +2 -4
  228. package/dist/src/tui/tools-ui/CommandReference.js.map +1 -1
  229. package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -1
  230. package/dist/src/tui/tools-ui/ConfigSources.js +3 -2
  231. package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -1
  232. package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -1
  233. package/dist/src/tui/tools-ui/RegisterSettings.js +2 -1
  234. package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -1
  235. package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -1
  236. package/dist/src/tui/tools-ui/RoleMappings.js +3 -5
  237. package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -1
  238. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
  239. package/dist/src/tui/tools-ui/ToolsDashboard.js +3 -5
  240. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
  241. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
  242. package/dist/src/tui/tools-ui/ToolsOverview.js +3 -5
  243. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
  244. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
  245. package/dist/src/tui/uninstall-ui/UninstallFlow.js +8 -7
  246. package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
  247. package/dist/src/types/index.d.ts +48 -6
  248. package/dist/src/types/index.d.ts.map +1 -1
  249. package/package.json +1 -1
  250. package/workflows/knowhow.md +15 -1
  251. package/workflows/specs-add.md +12 -4
  252. package/dashboard/dist/assets/ChatPage-BjBibfE4.js +0 -22
  253. package/dashboard/dist/assets/CollabPage-8lUMUol_.js +0 -1
  254. package/dashboard/dist/assets/KanbanPage-diY3QmGd.js +0 -21
  255. package/dashboard/dist/assets/McpPage-COjuIf7U.js +0 -21
  256. package/dashboard/dist/assets/SpecsPage-BOwBin_o.js +0 -36
  257. package/dashboard/dist/assets/SupervisorPage-5iRyMU5T.js +0 -6
  258. package/dashboard/dist/assets/WorkflowPage-CmQaRVgL.js +0 -6
  259. package/dashboard/dist/assets/en-C_BD3UCD.js +0 -1
  260. package/dashboard/dist/assets/index-BEUaOz_b.css +0 -1
  261. package/dashboard/dist/assets/index-uIqUCT8y.js +0 -236
  262. package/dashboard/dist/assets/table-DCzuJAFh.js +0 -6
  263. package/dashboard/dist/assets/zh-CN-DvQKfow3.js +0 -1
@@ -1,36 +0,0 @@
1
- import{d as S,o as se,a7 as F,r as p,j as e,a4 as H,a8 as ie,F as U,a9 as le,X as ce,R as de,P as xe,O as pe,f as be,T as ue,h as O,i as A,V as me}from"./index-uIqUCT8y.js";import{u as ge}from"./shallow-BOmvDNsv.js";import{C as fe}from"./columns-3-BzgxelGx.js";import{L as ye}from"./list-BTRAIvDq.js";import{S as he}from"./search-DVtgy2W7.js";import{C as Y}from"./circle-cooAwnAR.js";import{m as z}from"./proxy-Dtx5p6IO.js";import{C as ve}from"./circle-alert-DcSBokh4.js";import{T as J}from"./trash-2-52LATVfW.js";import{P as X}from"./pen-line-C4_O16H0.js";import{C as we}from"./check-o7nfGNHf.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const je=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Q=S("arrow-down",je);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ke=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],Ne=S("compass",ke);/**
12
- * @license lucide-react v0.577.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Ce=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ee=S("eye-off",Ce);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Be=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ae=S("eye",Be);/**
22
- * @license lucide-react v0.577.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Se=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],De=S("settings",Se);/**
27
- * @license lucide-react v0.577.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const Te=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],R=S("shield",Te);/**
32
- * @license lucide-react v0.577.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const Fe=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Z=S("tag",Fe),f=se((r,c)=>({entries:[],files:[],loading:!1,error:null,activeView:"kanban",typeFilter:"all",categoryFilter:"all",keywordFilter:"all",search:"",selectedEntry:null,hiddenColumns:new Set,setActiveView:o=>r({activeView:o}),setTypeFilter:o=>r({typeFilter:o}),setCategoryFilter:o=>r({categoryFilter:o}),setKeywordFilter:o=>r({keywordFilter:o}),setSearch:o=>r({search:o}),setSelectedEntry:o=>r({selectedEntry:o}),toggleColumn:o=>r(n=>{const s=new Set(n.hiddenColumns);return s.has(o)?s.delete(o):s.add(o),{hiddenColumns:s}}),fetchEntries:async()=>{r({loading:!0,error:null});try{const o=await fetch(F.SPECS);if(!o.ok)throw new Error(`Failed: ${o.status}`);const n=await o.json();r({entries:n.entries??[],loading:!1})}catch(o){r({loading:!1,error:String(o)})}},fetchFiles:async()=>{try{const o=await fetch(F.SPECS_FILES);if(!o.ok)return;const n=await o.json();r({files:n.files??[]})}catch{}},addEntry:async(o,n,s)=>{r({error:null});try{const d=await fetch(F.SPECS,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:o,content:n,file:s})});if(!d.ok){const g=await d.json().catch(()=>({error:`HTTP ${d.status}`}));throw new Error(g.error)}return c().fetchEntries(),null}catch(d){return r({error:String(d)}),null}},deleteEntry:async o=>{r({error:null});const n=c().entries;r(s=>({entries:s.entries.filter(d=>d.id!==o)}));try{(await fetch(`${F.SPECS}/${o}`,{method:"DELETE"})).ok||r({entries:n})}catch{r({entries:n})}},filteredEntries:()=>{const{entries:o,typeFilter:n,categoryFilter:s,keywordFilter:d,search:g}=c();let y=o;if(n!=="all"&&(y=y.filter(u=>u.type===n)),s!=="all"&&(y=y.filter(u=>u.category===s)),d!=="all"&&(y=y.filter(u=>u.keywords.includes(d))),g){const u=g.toLowerCase();y=y.filter(h=>h.title.toLowerCase().includes(u)||h.content.toLowerCase().includes(u)||h.id.toLowerCase().includes(u)||h.keywords.some(v=>v.toLowerCase().includes(u)))}return y},entriesByType:()=>{const o=c().filteredEntries(),n={bug:[],pattern:[],decision:[],rule:[],debug:[],test:[],review:[],validation:[],general:[],learning:[],coding:[],arch:[],quality:[]};for(const s of o)(n[s.type]??n.general).push(s);return n},typeCounts:()=>{const{entries:o}=c(),n={all:o.length,bug:0,pattern:0,decision:0,rule:0,debug:0,test:0,review:0,validation:0,general:0};for(const s of o)n[s.type]=(n[s.type]??0)+1;return n},allCategories:()=>{const{entries:o}=c(),n=new Set;for(const s of o)s.category&&n.add(s.category);return Array.from(n).sort()},allKeywords:()=>{const{entries:o}=c(),n=new Set;for(const s of o)for(const d of s.keywords)n.add(d);return Array.from(n).sort()}})),_e={general:{label:"General",icon:e.jsx(Y,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"},planning:{label:"Planning",icon:e.jsx(Ne,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-planning)",color:"#9178B5"},execution:{label:"Execution",icon:e.jsx(De,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-exploring)",color:"#5B8DB8"},debug:{label:"Debug",icon:e.jsx(ve,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-blocked)",color:"#C46555"},test:{label:"Test",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-completed)",color:"#5A9E78"},review:{label:"Review",icon:e.jsx(le,{size:14,strokeWidth:1.8}),tintBg:"rgba(219,176,108,0.12)",color:"#C4A055"},validation:{label:"Validation",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"rgba(90,158,120,0.10)",color:"#3D8B5F"}},Le=["general","planning","execution","debug","test","review","validation"],ze={label:"",icon:e.jsx(Y,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"};function I(r){return _e[r]??{...ze,label:r.charAt(0).toUpperCase()+r.slice(1)}}const Me={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},We={bg:"var(--color-tint-pending)",text:"#A09D97"};function qe(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function $e({onAddEntry:r}){const c=f(a=>a.entries),o=f(a=>a.typeFilter),n=f(a=>a.keywordFilter),s=f(a=>a.search),d=f(a=>a.selectedEntry),g=f(a=>a.setSelectedEntry),y=f(a=>a.setKeywordFilter),u=f(a=>a.hiddenColumns),h=f(a=>a.toggleColumn),v=p.useMemo(()=>{const a=new Set;for(const x of c)x.category&&a.add(x.category);const i=[];for(const x of Le)a.has(x)&&(i.push(x),a.delete(x));for(const x of Array.from(a).sort())i.push(x);return i},[c]),N=p.useMemo(()=>{const a=new Set;for(const i of c)for(const x of i.keywords)a.add(x);return Array.from(a).sort()},[c]),w=p.useMemo(()=>{let a=c;if(o!=="all"&&(a=a.filter(i=>i.type===o)),n!=="all"&&(a=a.filter(i=>i.keywords.includes(n))),s){const i=s.toLowerCase();a=a.filter(x=>x.title.toLowerCase().includes(i)||x.content.toLowerCase().includes(i)||x.id.toLowerCase().includes(i)||x.keywords.some(C=>C.toLowerCase().includes(i)))}return a},[c,o,n,s]),m=p.useMemo(()=>{const a={};for(const i of v)a[i]=[];for(const i of w){const x=i.category||"general";a[x]||(a[x]=[]),a[x].push(i)}return a},[w,v]),k=p.useMemo(()=>{const a={};for(const i of c){const x=i.category||"general";a[x]=(a[x]??0)+1}return a},[c]),B=p.useMemo(()=>v.filter(a=>!u.has(a)),[v,u]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-[6px] px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[v.map(a=>{const i=I(a),x=!u.has(a),C=k[a]??0;return e.jsxs("button",{type:"button",onClick:()=>h(a),className:["text-[11px] font-medium px-[10px] py-[4px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",x?"bg-bg-card text-text-primary border-border hover:shadow-sm":"bg-bg-secondary text-text-quaternary border-border-divider opacity-60"].join(" "),style:x?{borderColor:i.color,boxShadow:`0 0 0 1px ${i.color}22`}:void 0,children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0 transition-opacity",style:{background:i.color,opacity:x?1:.35}}),i.label,e.jsx("span",{className:"text-[10px] font-mono opacity-60",children:C})]},a)}),N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx(Z,{size:11,strokeWidth:2,className:"text-text-quaternary shrink-0"}),N.map(a=>{const i=n===a;return e.jsx("button",{type:"button",onClick:()=>y(i?"all":a),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",i?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:a},a)})]})]}),e.jsxs("div",{className:"flex gap-3 flex-1 overflow-x-auto p-3",children:[B.map((a,i)=>{const x=I(a),C=m[a]??[];return e.jsxs("div",{className:"flex flex-col min-w-[260px] flex-1 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[14px] py-3 border-b border-black/[0.04]",children:[e.jsx("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center shrink-0",style:{background:x.tintBg,color:x.color},children:x.icon}),e.jsx("span",{className:"text-[13px] font-bold text-text-primary",children:x.label}),e.jsx("span",{className:"text-[10px] text-text-tertiary bg-bg-card px-[6px] rounded-full font-mono",children:C.length}),e.jsx("button",{type:"button",onClick:r,className:"ml-auto w-6 h-6 rounded-[6px] border border-dashed border-border bg-transparent cursor-pointer flex items-center justify-center text-text-quaternary hover:border-text-tertiary hover:text-text-primary hover:bg-bg-card transition-all",children:e.jsx(H,{size:12,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2 flex flex-col gap-2",children:[C.map((E,D)=>e.jsx(Ve,{entry:E,selected:d===E.id,onClick:()=>g(E.id),index:i*100+D},E.id)),C.length===0&&e.jsx("div",{className:"flex items-center justify-center py-8 text-[11px] text-text-quaternary",children:"No entries"})]})]},a)}),B.length===0&&e.jsx("div",{className:"flex items-center justify-center flex-1 text-[13px] text-text-tertiary",children:"All columns hidden — click a category tag above to show it."})]})]})}function Ve({entry:r,selected:c,onClick:o,index:n}){const s=Me[r.type]??We;return e.jsxs(z.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,delay:Math.min(n*.03,.3)},onClick:o,className:["bg-bg-card rounded-[10px] px-[14px] py-3 border cursor-pointer","transition-all duration-[180ms]","hover:-translate-y-[2px] hover:shadow-[0_4px_16px_rgba(0,0,0,0.06)] hover:border-border",c?"border-[#9178B5] shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[6px] mb-2",children:[e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em]",style:{background:s.bg,color:s.text},children:r.type}),e.jsx("span",{className:"text-[10px] font-mono text-text-quaternary ml-auto",children:r.id})]}),e.jsx("div",{className:"text-[13px] text-text-primary font-medium leading-[1.5] mb-2 line-clamp-3",children:r.content||r.title}),r.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[r.keywords.slice(0,4).map(d=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono",children:d},d)),r.keywords.length>4&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-4]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] text-text-quaternary font-mono flex items-center gap-[3px]",children:[e.jsx(ie,{size:10,strokeWidth:2}),qe(r.timestamp)]}),r.file&&e.jsxs("span",{className:"text-[10px] text-text-tertiary flex items-center gap-[3px] ml-auto",children:[e.jsx(U,{size:10,strokeWidth:2}),r.file.split("/").pop()]})]})]})}const Pe={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},Oe={bg:"var(--color-tint-pending)",text:"#A09D97"},Re={coding:"#5B8DB8",arch:"#9178B5",quality:"#5A9E78",debug:"#B85B4A",test:"#3D8B5F",review:"#C4A055",learning:"#C46555",bug:"#C46555",pattern:"#5B8DB8",decision:"#9178B5",rule:"#5A9E78",validation:"#4A7DA8",general:"#A09D97"},ee={coding:"#5B8DB8",arch:"#9178B5",quality:"#5A9E78",learning:"#A09D97",debug:"#C46555",test:"#5A9E78",review:"#C4A055"},Ie=[{value:"all",label:"All"},{value:"bug",label:"Bug"},{value:"pattern",label:"Pattern"},{value:"decision",label:"Decision"},{value:"rule",label:"Rule"},{value:"debug",label:"Debug"},{value:"test",label:"Test"},{value:"review",label:"Review"},{value:"validation",label:"Validation"},{value:"general",label:"General"}],K=[{key:"id",label:"ID",width:60},{key:"type",label:"Type",width:80},{key:"category",label:"Category",width:100},{key:"content",label:"Content",alwaysVisible:!0},{key:"keywords",label:"Keywords",width:180},{key:"file",label:"File",width:140},{key:"added",label:"Added",width:90},{key:"actions",label:"",width:80,alwaysVisible:!0}];function Ke(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function Ge(){const r=f(t=>t.entries),c=f(t=>t.typeFilter),o=f(t=>t.setTypeFilter),n=f(t=>t.categoryFilter),s=f(t=>t.setCategoryFilter),d=f(t=>t.keywordFilter),g=f(t=>t.setKeywordFilter),y=f(t=>t.search),u=f(t=>t.selectedEntry),h=f(t=>t.setSelectedEntry),v=f(t=>t.deleteEntry),N=f(t=>t.addEntry),[w,m]=p.useState("timestamp"),[k,B]=p.useState("desc"),[a,i]=p.useState(!1),[x,C]=p.useState("bug"),[E,D]=p.useState(""),[L,te]=p.useState(new Set),re=p.useCallback(t=>{te(l=>{const b=new Set(l);return b.has(t)?b.delete(t):b.add(t),b})},[]),T=p.useMemo(()=>K.filter(t=>t.alwaysVisible||!L.has(t.key)),[L]),M=p.useMemo(()=>{const t=new Set;for(const l of r)l.category&&t.add(l.category);return Array.from(t).sort()},[r]),W=p.useMemo(()=>{const t=new Set;for(const l of r)for(const b of l.keywords)t.add(b);return Array.from(t).sort()},[r]),oe=p.useMemo(()=>{const t={all:r.length,bug:0,pattern:0,decision:0,rule:0,general:0};for(const l of r)t[l.type]=(t[l.type]??0)+1;return t},[r]),ae=p.useMemo(()=>{const t={};for(const l of r){const b=l.category||"general";t[b]=(t[b]??0)+1}return t},[r]),q=p.useMemo(()=>{let t=r;if(c!=="all"&&(t=t.filter(l=>l.type===c)),n!=="all"&&(t=t.filter(l=>l.category===n)),d!=="all"&&(t=t.filter(l=>l.keywords.includes(d))),y){const l=y.toLowerCase();t=t.filter(b=>b.title.toLowerCase().includes(l)||b.content.toLowerCase().includes(l)||b.id.toLowerCase().includes(l)||b.keywords.some(j=>j.toLowerCase().includes(l)))}return t},[r,c,n,d,y]),$=p.useMemo(()=>{const t=[...q];return t.sort((l,b)=>{let j=0;return w==="timestamp"?j=new Date(l.timestamp).getTime()-new Date(b.timestamp).getTime():w==="id"?j=l.id.localeCompare(b.id):w==="type"?j=l.type.localeCompare(b.type):w==="category"&&(j=(l.category||"").localeCompare(b.category||"")),k==="desc"?-j:j}),t},[q,w,k]),V=p.useCallback(t=>{m(l=>l===t?(B(b=>b==="desc"?"asc":"desc"),l):(B("desc"),t))},[]),P=p.useCallback(async()=>{E.trim()&&(await N(x,E.trim(),"learnings.md"),D(""),i(!1))},[x,E,N]),ne=p.useCallback((t,l)=>{t.stopPropagation(),v(l)},[v]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Type"}),Ie.map(t=>{const l=c===t.value;return e.jsxs("button",{type:"button",onClick:()=>o(t.value),className:["text-[11px] font-medium px-3 py-1 rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:[t.value!=="all"&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"#fff":Re[t.value]}}),t.label,e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:oe[t.value]??0})]},t.value)}),M.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Category"}),e.jsx("button",{type:"button",onClick:()=>s("all"),className:["text-[11px] font-medium px-2 py-[3px] rounded-full border cursor-pointer transition-all",n==="all"?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"All"}),M.map(t=>{const l=n===t,b=ee[t]??"#A09D97";return e.jsxs("button",{type:"button",onClick:()=>s(l?"all":t),className:["text-[11px] font-medium px-[10px] py-[3px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"border-transparent text-white":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),style:l?{background:b}:void 0,children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"#fff":b}}),t.charAt(0).toUpperCase()+t.slice(1),e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:ae[t]??0})]},t)})]}),W.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:e.jsx(Z,{size:10,strokeWidth:2,className:"inline-block mr-[2px] align-middle"})}),W.map(t=>{const l=d===t;return e.jsx("button",{type:"button",onClick:()=>g(l?"all":t),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:t},t)})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-1",children:K.filter(t=>!t.alwaysVisible).map(t=>{const l=L.has(t.key);return e.jsxs("button",{type:"button",onClick:()=>re(t.key),className:["text-[10px] font-medium px-[6px] py-[3px] rounded-[4px] border cursor-pointer transition-all","flex items-center gap-[3px]",l?"bg-bg-secondary text-text-quaternary border-border-divider opacity-50":"bg-bg-card text-text-tertiary border-border hover:text-text-primary"].join(" "),title:`${l?"Show":"Hide"} ${t.label} column`,children:[l?e.jsx(Ee,{size:9,strokeWidth:2}):e.jsx(Ae,{size:9,strokeWidth:2}),t.label]},t.key)})}),e.jsx("div",{className:"w-px h-[18px] bg-border-divider"}),e.jsxs("button",{type:"button",onClick:()=>V("timestamp"),className:"text-[11px] font-medium px-[10px] py-1 rounded-[6px] border border-border bg-bg-card text-text-tertiary cursor-pointer font-sans transition-all hover:border-text-tertiary hover:text-text-primary flex items-center gap-1",children:[e.jsx(Q,{size:12,strokeWidth:2,className:k==="asc"?"rotate-180 transition-transform":"transition-transform"}),k==="desc"?"Newest":"Oldest"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:T.map(t=>{const b={id:"id",type:"type",category:"category",added:"timestamp"}[t.key];return e.jsx(He,{width:t.width,active:b?w===b:!1,onClick:b?()=>V(b):void 0,children:t.label},t.key)})})}),e.jsxs("tbody",{children:[a&&e.jsx("tr",{children:T.map(t=>{const l="var(--color-tint-planning)",b="rgba(145,120,181,0.3)";return t.key==="id"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("span",{className:"font-mono text-[11px] font-semibold",style:{color:"#9178B5"},children:"NEW"})},t.key):t.key==="type"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("select",{value:x,onChange:j=>C(j.target.value),className:"px-2 py-1 rounded-[6px] border border-border bg-bg-card text-[11px] text-text-primary font-sans outline-none cursor-pointer",children:[e.jsx("option",{value:"bug",children:"bug"}),e.jsx("option",{value:"pattern",children:"pattern"}),e.jsx("option",{value:"decision",children:"decision"}),e.jsx("option",{value:"rule",children:"rule"}),e.jsx("option",{value:"debug",children:"debug"}),e.jsx("option",{value:"test",children:"test"}),e.jsx("option",{value:"review",children:"review"}),e.jsx("option",{value:"validation",children:"validation"}),e.jsx("option",{value:"general",children:"general"})]})},t.key):t.key==="content"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("input",{type:"text",value:E,onChange:j=>D(j.target.value),placeholder:"Describe the entry...",autoFocus:!0,onKeyDown:j=>{j.key==="Enter"&&P(),j.key==="Escape"&&i(!1)},className:"w-full px-[10px] py-[6px] rounded-[6px] border border-border bg-bg-card text-[13px] text-text-primary font-sans outline-none focus:border-[#9178B5] transition-colors"})},t.key):t.key==="actions"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>void P(),className:"px-3 py-[5px] rounded-[6px] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] transition-all",children:"Save"}),e.jsx("button",{type:"button",onClick:()=>i(!1),className:"px-3 py-[5px] rounded-[6px] border-none bg-bg-secondary text-text-secondary text-[11px] font-semibold cursor-pointer font-sans hover:bg-bg-tertiary transition-all",children:"Cancel"})]})},t.key):e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top font-mono text-[11px] text-text-tertiary",style:{background:l,borderBottomColor:b},children:"—"},t.key)})}),$.map((t,l)=>e.jsx(Ue,{entry:t,selected:u===t.id,onClick:()=>h(t.id),onDelete:ne,index:l,visibleColumns:T},t.id)),$.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:T.length,className:"text-center py-12 text-[13px] text-text-tertiary",children:"No entries found"})})]})]})})]})}function He({children:r,width:c,active:o,onClick:n}){return e.jsxs("th",{style:{width:c?`${c}px`:void 0},onClick:n,className:["sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.06em] px-3 py-2","bg-bg-secondary border-b border-border select-none whitespace-nowrap",n?"cursor-pointer":"",o?"text-text-primary":"text-text-tertiary hover:text-text-primary"].join(" "),children:[r,o&&e.jsx(Q,{size:10,strokeWidth:2,className:"inline-block align-middle ml-[3px]"})]})}function Ue({entry:r,selected:c,onClick:o,onDelete:n,index:s,visibleColumns:d}){const g=Pe[r.type]??Oe,y=ee[r.category]??"#A09D97",u={id:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.id}),type:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:g.bg,color:g.text},children:r.type}),category:e.jsx("span",{className:"text-[10px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:`${y}15`,color:y},children:r.category||"general"}),content:e.jsx("span",{className:"text-[13px] text-text-primary font-medium leading-[1.5] max-w-[500px] block",children:r.content||r.title}),keywords:e.jsxs("div",{className:"flex flex-wrap gap-[3px]",children:[r.keywords.slice(0,3).map(h=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono whitespace-nowrap",children:h},h)),r.keywords.length>3&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-3]})]}),file:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.file?r.file.split("/").pop():""}),added:e.jsx("span",{className:"font-mono text-[11px] text-text-quaternary whitespace-nowrap",children:Ke(r.timestamp)}),actions:e.jsxs("div",{className:"flex gap-[2px] whitespace-nowrap",children:[e.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),o()},className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-bg-hover hover:text-text-primary",children:e.jsx(X,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",onClick:h=>n(h,r.id),className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-[rgba(196,101,85,0.08)] hover:text-[#C46555]",children:e.jsx(J,{size:14,strokeWidth:1.8})})]})};return e.jsx(z.tr,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15,delay:Math.min(s*.02,.3)},onClick:o,className:["cursor-pointer transition-colors group",c?"[&>td]:bg-tint-planning":"hover:[&>td]:bg-bg-hover"].join(" "),children:d.map(h=>e.jsx("td",{className:"px-3 py-[10px] border-b border-border-divider align-top",children:u[h.key]},h.key))})}const Ye={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},Je={bg:"var(--color-tint-pending)",text:"#A09D97"};function Xe(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);if(d<24)return`${d}h ago`;const g=Math.floor(d/24);return g<7?`${g}d ago`:c.toLocaleDateString()}function Qe({entry:r,onClose:c}){const o=f(g=>g.deleteEntry),n=p.useMemo(()=>Ye[r.type]??Je,[r.type]),s=p.useMemo(()=>r.file?r.file.split("/").pop():"",[r.file]);function d(){o(r.id),c()}return e.jsxs(z.aside,{initial:{width:0,opacity:0},animate:{width:380,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:400,damping:30},className:"shrink-0 border-l border-border bg-bg-primary overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-divider shrink-0 min-h-[48px]",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"Entry Detail"}),e.jsx("button",{type:"button",onClick:c,"aria-label":"Close detail panel",className:"w-7 h-7 rounded-[8px] border-none bg-transparent cursor-pointer text-text-tertiary flex items-center justify-center hover:bg-bg-hover hover:text-text-primary transition-colors",children:e.jsx(ce,{size:14,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",style:{width:380},children:[e.jsx("span",{className:"inline-flex items-center gap-[5px] text-[10px] font-bold px-[10px] py-[3px] rounded-[6px] mb-3 uppercase tracking-[0.04em]",style:{background:n.bg,color:n.text},children:r.type}),e.jsx("div",{className:"text-[16px] font-bold text-text-primary leading-[1.5] mb-4",children:r.title||r.content}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-4",children:[e.jsx(_,{label:"ID",value:r.id,mono:!0}),e.jsx(_,{label:"Added",value:Xe(r.timestamp),mono:!0}),e.jsx(_,{label:"File",value:s||"--",mono:!0}),e.jsx(_,{label:"Type",value:r.type})]}),r.content&&r.title&&r.content!==r.title&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-[6px]",children:"Description"}),e.jsx("div",{className:"text-[13px] text-text-secondary leading-[1.6] whitespace-pre-wrap",children:r.content})]}),e.jsxs("div",{className:"flex gap-2 pt-3 border-t border-border-divider",children:[e.jsxs("button",{type:"button",className:"flex-1 py-2 rounded-[8px] border border-text-primary bg-text-primary text-[12px] font-semibold text-white cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:bg-[#1A1816] transition-all",children:[e.jsx(X,{size:13,strokeWidth:2}),"Edit"]}),e.jsxs("button",{type:"button",onClick:d,className:"flex-1 py-2 rounded-[8px] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:border-[#C46555] hover:text-[#C46555] hover:bg-[rgba(196,101,85,0.08)] transition-all",children:[e.jsx(J,{size:13,strokeWidth:2}),"Delete"]})]})]})]})}function _({label:r,value:c,mono:o}){return e.jsxs("div",{className:"px-3 py-2 bg-bg-secondary rounded-[8px]",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.04em] text-text-quaternary mb-[2px]",children:r}),e.jsx("div",{className:["text-[13px] font-semibold text-text-primary",o?"font-mono text-[12px]":""].join(" "),children:c})]})}const Ze=[{value:"bug",label:"Bug",activeBg:"var(--color-tint-blocked)",activeText:"#C46555",activeBorder:"#C46555"},{value:"pattern",label:"Pattern",activeBg:"var(--color-tint-exploring)",activeText:"#5B8DB8",activeBorder:"#5B8DB8"},{value:"decision",label:"Decision",activeBg:"var(--color-tint-planning)",activeText:"#9178B5",activeBorder:"#9178B5"},{value:"rule",label:"Rule",activeBg:"var(--color-tint-completed)",activeText:"#5A9E78",activeBorder:"#5A9E78"},{value:"debug",label:"Debug",activeBg:"rgba(196,101,85,0.10)",activeText:"#B85B4A",activeBorder:"#B85B4A"},{value:"test",label:"Test",activeBg:"rgba(90,158,120,0.10)",activeText:"#3D8B5F",activeBorder:"#3D8B5F"},{value:"review",label:"Review",activeBg:"rgba(219,176,108,0.12)",activeText:"#C4A055",activeBorder:"#C4A055"},{value:"validation",label:"Validation",activeBg:"rgba(91,141,184,0.10)",activeText:"#4A7DA8",activeBorder:"#4A7DA8"}];function et({open:r,onOpenChange:c}){const o=f(m=>m.addEntry),n=f(m=>m.files),[s,d]=p.useState("bug"),[g,y]=p.useState(""),[u,h]=p.useState(""),[v,N]=p.useState(!1);p.useEffect(()=>{r||(d("bug"),y(""),h(""))},[r]),p.useEffect(()=>{n.length>0&&!u&&h(n[0].path)},[n,u]);const w=p.useCallback(async()=>{g.trim()&&(N(!0),await o(s,g.trim(),u),N(!1),c(!1))},[s,g,u,o,c]);return e.jsx(de,{open:r,onOpenChange:c,children:e.jsxs(xe,{children:[e.jsx(pe,{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(be,{className:A("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[480px] max-w-[95vw] max-h-[80vh]","rounded-[16px] border border-border bg-bg-card shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-divider shrink-0",children:[e.jsx(ue,{className:"text-[16px] font-bold text-text-primary",children:"New Spec Entry"}),e.jsx(O,{className:A("w-7 h-7 flex items-center justify-center rounded-[8px]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors border-none bg-transparent cursor-pointer"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Type"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Ze.map(m=>{const k=s===m.value;return e.jsx("button",{type:"button",onClick:()=>d(m.value),className:A("py-[10px] rounded-[10px] border-[1.5px] bg-bg-card cursor-pointer","text-center text-[11px] font-semibold font-sans transition-all"),style:k?{borderColor:m.activeBorder,color:m.activeText,background:m.activeBg,fontWeight:700}:{borderColor:"var(--color-border, #E8E5DE)",color:"var(--color-text-tertiary, #A09D97)"},children:m.label},m.value)})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Content"}),e.jsx("textarea",{value:g,onChange:m=>y(m.target.value),placeholder:"Describe the bug, pattern, decision, or rule...",rows:5,className:A("w-full min-h-[120px] px-[14px] py-[10px] rounded-[8px]","border border-border bg-bg-primary text-[13px] text-text-primary","font-sans leading-[1.6] resize-y outline-none","focus:border-[#9178B5] transition-colors","placeholder:text-text-quaternary")}),e.jsx("div",{className:"text-[11px] text-text-quaternary mt-1",children:"Supports markdown. Will be timestamped automatically."})]}),n.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Target File"}),e.jsx("select",{value:u,onChange:m=>h(m.target.value),className:A("w-full px-3 py-2 rounded-[8px] border border-border","bg-bg-primary text-[12px] text-text-primary font-sans","outline-none cursor-pointer","focus:border-[#9178B5] transition-colors"),children:n.map(m=>e.jsxs("option",{value:m.path,children:[m.name," (",m.category,")"]},m.path))})]}),u&&e.jsxs("div",{className:"bg-bg-primary rounded-[10px] px-4 py-[14px] border border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-2",children:"Will write to"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-[10px] py-[6px] rounded-[6px] bg-bg-card border border-border-divider text-[11px] font-mono text-text-secondary",children:[e.jsx(U,{size:12,strokeWidth:1.8,className:"text-text-tertiary"}),e.jsx("span",{className:"text-text-primary font-semibold",children:u})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-4 border-t border-border-divider shrink-0",children:[e.jsx(O,{className:A("px-4 py-2 rounded-[8px] border border-border bg-bg-card","text-[12px] font-semibold text-text-secondary cursor-pointer font-sans","hover:border-text-tertiary hover:text-text-primary transition-all"),children:"Cancel"}),e.jsxs("button",{type:"button",disabled:!g.trim()||v,onClick:()=>void w(),className:A("flex items-center gap-[6px] px-[14px] py-2 rounded-[8px] border-none","bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans","hover:bg-[#1A1816] hover:-translate-y-px hover:shadow-md transition-all","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none"),children:[e.jsx(we,{size:14,strokeWidth:2}),v?"Adding...":"Add Entry"]})]})]})]})})}const tt=[{label:"Kanban",icon:e.jsx(fe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(ye,{size:14,strokeWidth:1.8}),shortcut:"2"}],G=["kanban","table"];function bt(){const{activeView:r,setActiveView:c,fetchEntries:o,fetchFiles:n,entries:s,search:d,setSearch:g,selectedEntry:y,setSelectedEntry:u,loading:h,error:v}=f(ge(i=>({activeView:i.activeView,setActiveView:i.setActiveView,fetchEntries:i.fetchEntries,fetchFiles:i.fetchFiles,entries:i.entries,search:i.search,setSearch:i.setSearch,selectedEntry:i.selectedEntry,setSelectedEntry:i.setSelectedEntry,loading:i.loading,error:i.error}))),[N,w]=p.useState(!1),{register:m,unregister:k}=p.useContext(me),B=p.useCallback(i=>c(G[i]),[c]);p.useEffect(()=>{m({items:tt.map(i=>({label:i.label,icon:i.icon,shortcut:i.shortcut})),activeIndex:G.indexOf(r),onSwitch:B})},[r,m,B]),p.useEffect(()=>()=>k(),[k]),p.useEffect(()=>{function i(x){x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||(x.key==="1"?c("kanban"):x.key==="2"&&c("table"))}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[c]),p.useEffect(()=>{o(),n()},[o,n]);const a=y?s.find(i=>i.id===y)??null:null;return h&&s.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading specs..."}):v&&s.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load specs"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:v}),e.jsx("button",{type:"button",onClick:()=>void o(),className:"px-3 py-1 rounded-[var(--radius-md)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[16px] font-bold text-text-primary",children:"Specs"}),e.jsxs("span",{className:"text-[11px] text-text-tertiary font-mono tabular-nums",children:[s.length," entries"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[5px] rounded-[8px] bg-bg-card w-[240px] focus-within:border-[#9178B5] transition-colors",style:{border:"var(--style-btn-secondary-border)"},children:[e.jsx(he,{size:13,strokeWidth:2,className:"text-text-quaternary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search specs...",value:d,onChange:i=>g(i.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary font-sans w-full placeholder:text-text-quaternary"})]}),e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[8px] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] hover:[transform:var(--style-card-hover-transform)] hover:[box-shadow:var(--style-card-hover-shadow)] transition-all",children:[e.jsx(H,{size:14,strokeWidth:2}),"New Entry"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[r==="kanban"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx($e,{onAddEntry:()=>w(!0)})}),r==="table"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx(Ge,{})})]}),a&&e.jsx(Qe,{entry:a,onClose:()=>u(null)})]}),e.jsx(et,{open:N,onOpenChange:w})]})}export{bt as SpecsPage};
@@ -1,6 +0,0 @@
1
- import{o as _e,u as T,b as R,j as e,a3 as Be,w as Me,r as g,s as X,ag as _}from"./index-uIqUCT8y.js";const m=_e((r,o)=>({activeTab:"commander",learningStats:null,learningPatterns:[],knowledgeEntries:[],scheduledTasks:[],extensions:[],promptModes:[],promptBindings:{},error:null,onLearningUpdate:t=>r({learningStats:t,learningPatterns:t.topPatterns}),onScheduleUpdate:t=>r({scheduledTasks:t}),onScheduleTriggered:t=>r(n=>{const s=new Date().toISOString();return{scheduledTasks:n.scheduledTasks.map(a=>{if(a.id!==t.taskId)return a;const v=a.lastRun?new Date(a.lastRun).getTime():0,p=v>0?Date.now()-v:0;return{...a,lastRun:s,history:[...a.history,{timestamp:s,status:"success",duration:p}]}})}}),onExtensionLoaded:t=>r({extensions:t.extensions}),onExtensionError:t=>r(n=>({extensions:n.extensions.map(x=>x.name!==t.name?x:{...x,status:"disabled"})})),fetchLearningStats:async()=>{try{const t=await fetch("/api/supervisor/learning/stats");if(!t.ok){r({error:`Failed to fetch learning stats: ${t.status}`});return}const n=await t.json();if(n&&typeof n=="object"&&"topPatterns"in n){const s=n;r({learningStats:s,learningPatterns:s.topPatterns,error:null})}}catch(t){r({error:`Failed to fetch learning stats: ${t instanceof Error?t.message:String(t)}`})}},fetchSchedules:async()=>{try{const t=await fetch("/api/supervisor/schedules");if(!t.ok){r({error:`Failed to fetch schedules: ${t.status}`});return}const n=await t.json(),s=n&&typeof n=="object"&&"tasks"in n?n.tasks:Array.isArray(n)?n:[];r({scheduledTasks:s,error:null})}catch(t){r({error:`Failed to fetch schedules: ${t instanceof Error?t.message:String(t)}`})}},fetchExtensions:async()=>{try{const t=await fetch("/api/supervisor/extensions");if(!t.ok){r({error:`Failed to fetch extensions: ${t.status}`});return}const n=await t.json(),s=n&&typeof n=="object"&&"extensions"in n?n.extensions:Array.isArray(n)?n:[];r({extensions:s,error:null})}catch(t){r({error:`Failed to fetch extensions: ${t instanceof Error?t.message:String(t)}`})}},fetchPromptModes:async()=>{try{const t=await fetch("/api/supervisor/prompts");if(!t.ok){r({error:`Failed to fetch prompt modes: ${t.status}`});return}const n=await t.json();if(n&&typeof n=="object"){const s=n,x=Array.isArray(s.builders)?s.builders:[],a=s.bindings&&typeof s.bindings=="object"?s.bindings:{};r({promptModes:x,promptBindings:a,error:null})}}catch(t){r({error:`Failed to fetch prompt modes: ${t instanceof Error?t.message:String(t)}`})}},createSchedule:async t=>{try{const n=await fetch("/api/supervisor/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){r({error:`Failed to create schedule: ${n.status}`});return}const s=await n.json();if(s&&typeof s=="object"&&"task"in s){const x=s.task;r(a=>({scheduledTasks:[...a.scheduledTasks,x],error:null}))}}catch(n){r({error:`Failed to create schedule: ${n instanceof Error?n.message:String(n)}`})}},updateSchedule:async(t,n)=>{try{const s=await fetch(`/api/supervisor/schedules/${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok){r({error:`Failed to update schedule: ${s.status}`});return}const x=await s.json();if(x&&typeof x=="object"&&"task"in x){const a=x.task;r(v=>({scheduledTasks:v.scheduledTasks.map(p=>p.id===t?a:p),error:null}))}}catch(s){r({error:`Failed to update schedule: ${s instanceof Error?s.message:String(s)}`})}},deleteSchedule:async t=>{try{const n=await fetch(`/api/supervisor/schedules/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){r({error:`Failed to delete schedule: ${n.status}`});return}r(s=>({scheduledTasks:s.scheduledTasks.filter(x=>x.id!==t),error:null}))}catch(n){r({error:`Failed to delete schedule: ${n instanceof Error?n.message:String(n)}`})}},toggleSchedule:async(t,n)=>{await o().updateSchedule(t,{enabled:n})},runSchedule:async t=>{try{const n=await fetch(`/api/supervisor/schedules/${encodeURIComponent(t)}/run`,{method:"POST"});n.ok||r({error:`Failed to run schedule: ${n.status}`})}catch(n){r({error:`Failed to run schedule: ${n instanceof Error?n.message:String(n)}`})}},setActiveTab:t=>r({activeTab:t}),clearError:()=>r({error:null})}));function $e(r){const o=Date.now()-new Date(r).getTime(),t=Math.floor(o/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function Ae(){var y;const{t:r}=T(),o=R(i=>i.slots),t=R(i=>i.queue),n=R(i=>i.supervisorStatus),s=Object.values(o),x=(n==null?void 0:n.stats.totalDispatched)??0,a=(n==null?void 0:n.stats.totalCompleted)??0,v=(n==null?void 0:n.stats.totalFailed)??0,p=x>0?Math.round(a/x*100):0;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflowY:"auto",padding:24,gap:20},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12},children:[e.jsx(Z,{label:r("supervisor.overview.dispatched"),value:String(x),sub:`${s.length} ${r("supervisor.overview.active")}`}),e.jsx(Z,{label:r("supervisor.overview.success_rate"),value:x?`${p}%`:"-",valueColor:"var(--color-accent-green)",sub:`${a} ${r("supervisor.overview.completed")}`}),e.jsx(Z,{label:r("supervisor.overview.queued"),value:String(t.length),sub:`${((y=n==null?void 0:n.retrying)==null?void 0:y.length)??0} retrying`}),e.jsx(Z,{label:"Failed",value:String(v),valueColor:v>0?"var(--color-accent-red)":void 0,sub:x>0?`${Math.round(v/x*100)}% fail rate`:"-"})]}),e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r("supervisor.overview.active_executions")}),e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)"},children:r("supervisor.overview.running_count",{count:s.length})})]}),e.jsx("div",{children:s.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:16},children:"No active executions"}):s.map(i=>{const d=Be[i.executor]??"var(--color-text-tertiary)",k=Me[i.executor]??i.executor;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:d,flexShrink:0}}),e.jsx("span",{style:{fontSize:12,fontWeight:500,color:"var(--color-text-primary)"},children:i.issueId}),e.jsx("span",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:k}),e.jsxs("span",{style:{fontSize:11,color:"var(--color-text-tertiary)"},children:["Turn ",i.turnNumber,"/",i.maxTurns]}),e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",marginLeft:"auto"},children:$e(i.startedAt)})]},i.processId)})})]}),t.length>0&&e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:["Queue (",t.length,")"]})}),e.jsx("div",{children:t.map((i,d)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--color-text-tertiary)",minWidth:20},children:["#",d+1]}),e.jsx("span",{style:{fontSize:12,fontWeight:500,color:"var(--color-text-primary)"},children:i})]},i))})]})]})}function Z({label:r,value:o,sub:t,valueColor:n}){return e.jsxs("div",{style:{flex:1,background:"var(--color-bg-primary)",borderRadius:10,padding:14,border:"1px solid var(--color-border-divider)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:r}),e.jsx("div",{style:{fontSize:22,fontWeight:700,color:n??"var(--color-text-primary)",marginTop:2},children:o}),e.jsx("div",{style:{fontSize:10,color:"var(--color-text-secondary)"},children:t})]})}const De={optimize:"var(--color-accent-green)",alert:"var(--color-accent-orange)",automate:"var(--color-accent-purple)"};function Ee(){const{t:r}=T(),o=R(i=>i.commanderState),t=R(i=>i.commanderConfig),n=R(i=>i.fetchCommanderConfig),s=R(i=>i.recentDecisions),x=m(i=>i.setActiveTab),a=m(i=>i.learningStats);g.useEffect(()=>{n()},[n]);const v=()=>X({action:"commander:stop"}),p=s.length>0?s[s.length-1]:null,y=(a==null?void 0:a.suggestions)??[];return e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px 40px"},children:[e.jsxs("div",{style:re,children:[e.jsxs("div",{style:K,children:[e.jsx("div",{style:Q,children:r("supervisor.commander.metrics")}),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsx("button",{type:"button",onClick:()=>x("executions"),style:Pe,children:r("supervisor.commander.view_executions")??"View Executions"}),e.jsx("button",{type:"button",onClick:v,style:Ne,children:r("supervisor.commander.stop")})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},children:[e.jsx(ge,{label:r("supervisor.commander.ticks"),value:String((o==null?void 0:o.tickCount)??0),sub:o!=null&&o.sessionId?`Session ${o.sessionId.slice(0,8)}`:void 0}),e.jsx(ge,{label:r("supervisor.commander.workers"),value:String((o==null?void 0:o.activeWorkers)??0),sub:t?`Max: ${t.maxConcurrentWorkers}`:void 0}),e.jsx(ge,{label:r("supervisor.commander.last_tick"),value:o!=null&&o.lastTickAt?we(o.lastTickAt):"--:--:--",valueStyle:{fontSize:16},sub:o!=null&&o.lastTickAt?Fe(o.lastTickAt):void 0})]})]}),t&&e.jsxs("div",{style:re,children:[e.jsx("div",{style:K,children:e.jsx("div",{style:Q,children:r("supervisor.commander.config")})}),e.jsxs("div",{style:He,children:[e.jsx(ee,{label:r("supervisor.commander.profile"),desc:r("supervisor.commander.profile_desc")??"Environment-specific behavior preset",children:e.jsx("select",{value:t.profile,onChange:i=>X({action:"commander:config",config:{profile:i.target.value}}),style:fe,children:["development","staging","production"].map(i=>e.jsx("option",{value:i,children:i},i))})}),e.jsx(ee,{label:r("supervisor.commander.decision_model"),desc:r("supervisor.commander.decision_model_desc")??"AI model for orchestration decisions",children:e.jsx("select",{value:t.decisionModel,onChange:i=>X({action:"commander:config",config:{decisionModel:i.target.value}}),style:fe,children:["haiku","sonnet","opus"].map(i=>e.jsx("option",{value:i,children:i},i))})}),e.jsx(ee,{label:r("supervisor.commander.auto_approve"),desc:r("supervisor.commander.auto_approve_desc")??"Confidence threshold for auto-approval",children:e.jsx("select",{value:t.autoApproveThreshold,onChange:i=>X({action:"commander:config",config:{autoApproveThreshold:i.target.value}}),style:fe,children:["low","medium","high"].map(i=>e.jsx("option",{value:i,children:i},i))})}),e.jsx(ee,{label:r("supervisor.commander.max_workers")??"Max Workers",desc:r("supervisor.commander.max_workers_desc")??"Maximum parallel agent executions",isLast:!0,children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",padding:"4px 10px"},children:t.maxConcurrentWorkers})})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[e.jsxs("div",{style:re,children:[e.jsxs("div",{style:K,children:[e.jsx("div",{style:Q,children:r("supervisor.commander.decision_history")}),e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r("supervisor.commander.decisions_count",{count:s.length})})]}),e.jsx("div",{style:ye,children:e.jsx("div",{style:{padding:"14px 16px"},children:s.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:16},children:r("supervisor.commander.no_decisions")}):s.slice().reverse().map((i,d,k)=>{const j=we(i.timestamp),f=i.actions.length>0?"var(--color-accent-green)":"var(--color-accent-gray)",I=d===k.length-1;return e.jsxs("div",{style:{display:"flex",gap:12,padding:"10px 0",position:"relative"},children:[!I&&e.jsx("div",{style:{position:"absolute",left:11,top:30,bottom:-10,width:1,background:"var(--color-border-divider)"}}),e.jsx("div",{style:qe,children:e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:f}})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,fontFamily:"'SF Mono', Consolas, monospace",color:"var(--color-text-placeholder)"},children:j}),e.jsxs("div",{style:{fontSize:12,color:"var(--color-text-primary)"},children:[i.trigger," - ",i.actions.length," action",i.actions.length!==1?"s":""]}),i.deferred.length>0&&e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:[i.deferred.length," deferred"]})]})]},i.id)})})})]}),e.jsxs("div",{style:re,children:[e.jsx("div",{style:K,children:e.jsx("div",{style:Q,children:r("supervisor.commander.latest_assessment")})}),e.jsx("div",{style:ye,children:e.jsx("div",{style:{padding:"14px 16px"},children:p!=null&&p.assessment?e.jsxs(e.Fragment,{children:[p.assessment.observations.length>0&&e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("div",{style:Ce,children:r("supervisor.commander.observations")}),e.jsx("div",{style:{fontSize:11,color:"var(--color-text-secondary)",paddingLeft:8,lineHeight:1.8},children:p.assessment.observations.map((i,d)=>e.jsxs("div",{children:["- ",i]},d))})]}),p.assessment.risks.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:Ce,children:r("supervisor.commander.risks")}),e.jsx("div",{style:{fontSize:11,color:"var(--color-accent-red)",paddingLeft:8,lineHeight:1.8},children:p.assessment.risks.map((i,d)=>e.jsxs("div",{children:["- ",i]},d))})]})]}):e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:8},children:r("supervisor.commander.no_decisions")})})}),e.jsxs("div",{style:{marginTop:16},children:[e.jsxs("div",{style:K,children:[e.jsx("div",{style:Q,children:r("supervisor.commander.suggestions")??"Suggestions"}),y.length>0&&e.jsxs("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:100,background:"var(--color-tint-verifying)",color:"var(--color-accent-orange)"},children:[y.length," new"]})]}),e.jsx("div",{style:ye,children:e.jsx("div",{style:{padding:"14px 16px"},children:y.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:8},children:r("supervisor.commander.no_suggestions")??"No suggestions"}):y.map((i,d)=>e.jsxs("div",{style:{display:"flex",gap:10,padding:"10px 0",borderBottom:d<y.length-1?"1px solid var(--color-border-divider)":"none"},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",marginTop:5,flexShrink:0,background:De[i.type]??"var(--color-accent-gray)"}}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:i.title}),e.jsxs("div",{style:{fontSize:11,color:"var(--color-text-secondary)",marginTop:1},children:[i.description," (",Math.round(i.confidence*100),"%)"]})]})]},d))})})]})]})]})]})}function ge({label:r,value:o,sub:t,valueStyle:n}){return e.jsxs("div",{style:Oe,children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:r}),e.jsx("div",{style:{fontSize:20,fontWeight:800,color:"var(--color-text-primary)",marginTop:2,...n},children:o}),t&&e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:t})]})}function ee({label:r,desc:o,children:t,isLast:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:n?"none":"1px solid var(--color-border-divider)"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:500,color:"var(--color-text-primary)"},children:r}),e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)",marginTop:2},children:o})]}),t]})}function we(r){const o=new Date(r);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function Fe(r){const o=Math.floor((Date.now()-new Date(r).getTime())/1e3);return o<60?`${o}s ago`:o<3600?`${Math.floor(o/60)} min ago`:`${Math.floor(o/3600)}h ago`}const re={marginBottom:24},K={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},Q={fontSize:13,fontWeight:700,color:"var(--color-text-primary)"},ye={background:"var(--color-bg-card)",borderRadius:12,border:"1px solid var(--color-border-divider)",overflow:"hidden"},Oe={background:"var(--color-bg-card)",borderRadius:10,padding:"14px 16px",border:"1px solid var(--color-border-divider)"},He={background:"var(--color-bg-card)",borderRadius:12,border:"1px solid var(--color-border-divider)",overflow:"hidden"},fe={fontSize:12,fontWeight:600,color:"var(--color-text-primary)",padding:"4px 10px",borderRadius:6,border:"1px solid var(--color-border)",background:"var(--color-bg-primary)",minWidth:100,textAlign:"center",cursor:"pointer"},qe={width:22,height:22,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"2px solid var(--color-bg-primary)"},Ce={fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:"var(--color-text-tertiary)",marginBottom:6},Ie={fontSize:11,fontWeight:600,padding:"5px 12px",borderRadius:8,border:"1px solid var(--color-border)",background:"none",cursor:"pointer",color:"var(--color-text-secondary)",transition:"all 150ms"},Pe={...Ie},Ne={...Ie,color:"var(--color-accent-red)",borderColor:"var(--color-accent-red)"},Ye=["claude","gemini","codex","qwen","opencode"],oe={running:{bg:"var(--color-tint-running)",color:"var(--color-accent-blue)"},awaiting_clarification:{bg:"var(--color-tint-verifying)",color:"var(--color-accent-orange)"},completed:{bg:"var(--color-tint-completed)",color:"var(--color-accent-green)"},failed:{bg:"var(--color-tint-failed)",color:"var(--color-accent-red)"},paused:{bg:"var(--color-tint-pending)",color:"var(--color-accent-gray)"},idle:{bg:"var(--color-tint-pending)",color:"var(--color-accent-gray)"}},P={completed:{bg:"var(--color-tint-completed)",dot:"var(--color-accent-green)"},running:{bg:"var(--color-tint-running)",dot:"var(--color-accent-blue)"},pending:{bg:"transparent",dot:"var(--color-accent-gray)"},failed:{bg:"var(--color-tint-failed)",dot:"var(--color-accent-red)"},skipped:{bg:"var(--color-tint-pending)",dot:"var(--color-accent-gray)"}};function Ke(){const{t:r}=T(),o=_(l=>l.session),t=_(l=>l.selectedStepIndex),n=_(l=>l.clarificationQuestion),s=_(l=>l.start),x=_(l=>l.stop),a=_(l=>l.resume),v=_(l=>l.selectStep),p=_(l=>l.sendClarification),[y,i]=g.useState(""),[d,k]=g.useState("claude"),[j,f]=g.useState(!0),[I,$]=g.useState(""),[L,B]=g.useState(""),C=g.useRef(null),b=o!=null&&o.status!=="idle",u=b&&o.status==="running",E=(o==null?void 0:o.status)==="awaiting_clarification",w=(o==null?void 0:o.steps)??[],h=t!=null?w[t]??null:null,z=w.filter(l=>l.status==="completed"),F=w.length,he=F>0?Math.round(z.length/F*100):0,O=(o==null?void 0:o.avgQuality)??(z.length>0?z.reduce((l,S)=>l+(S.qualityScore??0),0)/z.length:null),H=g.useCallback(()=>{var q;if(!o||!w.length)return"--";const l=(q=w[0])==null?void 0:q.startedAt;if(!l)return"--";const S=Date.now()-new Date(l).getTime();if(S<0)return"--";const W=Math.floor(S/1e3),M=Math.floor(W/60),J=Math.floor(M/60);return J>0?`${J}h ${M%60}m`:M>0?`${M}m ${W%60}s`:`${W}s`},[o,w]);g.useEffect(()=>(u?(B(H()),C.current=setInterval(()=>B(H()),1e3)):(B(H()),C.current&&clearInterval(C.current)),()=>{C.current&&clearInterval(C.current)}),[u,H]),g.useEffect(()=>{if(!b||t!=null)return;const l=w.findIndex(S=>S.status==="running");l>=0?v(l):w.length>0&&v(0)},[b,w,t,v]);const G=()=>{y.trim()&&(s(y.trim(),d,j),i(""))},c=()=>{!I.trim()||!o||(p(o.sessionId,I.trim()),$(""))},Y=l=>{if(l.durationMs!=null){const S=Math.floor(l.durationMs/1e3),W=Math.floor(S/60);return W>0?`${W}m ${S%60}s`:`${S}s`}if(l.status==="running"&&l.startedAt){const S=Math.floor((Date.now()-new Date(l.startedAt).getTime())/1e3),W=Math.floor(S/60);return W>0?`${W}m ${S%60}s...`:`${S}s...`}return""},A=l=>l>=70?"var(--color-accent-green)":l>=40?"var(--color-accent-orange)":"var(--color-accent-red)",ke=l=>l>=70?"var(--color-tint-completed)":l>=40?"var(--color-tint-verifying)":"var(--color-tint-failed)",Le=l=>{switch(l){case"running":return"Running";case"awaiting_clarification":return"Needs Clarification";case"completed":return"Completed";case"failed":return"Failed";case"paused":return"Paused";default:return l}};return e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px 40px"},children:[e.jsxs("div",{style:V,children:[e.jsxs("div",{style:te,children:[e.jsx("div",{style:ne,children:r("supervisor.coordinator.title")}),b&&e.jsxs("div",{style:{display:"flex",gap:6},children:[u&&e.jsx("button",{type:"button",onClick:x,style:Ve,children:r("supervisor.coordinator.stop")}),(o.status==="paused"||o.status==="failed")&&e.jsx("button",{type:"button",onClick:()=>a(),style:Ue,children:r("supervisor.coordinator.resume")})]})]}),e.jsx("div",{style:Ge,children:e.jsxs("div",{style:Je,children:[e.jsx("input",{style:Xe,placeholder:r("supervisor.coordinator.describe_intent"),value:y,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&G()}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexShrink:0},children:[e.jsx("select",{style:Ze,value:d,onChange:l=>k(l.target.value),children:Ye.map(l=>e.jsx("option",{value:l,children:l},l))}),e.jsx("button",{type:"button",style:j?er:rr,onClick:()=>f(!j),children:r(j?"supervisor.coordinator.auto":"supervisor.coordinator.manual")}),e.jsx("button",{type:"button",style:Qe,onClick:G,children:r("supervisor.coordinator.start")})]})]})})]}),b&&e.jsxs("div",{style:V,children:[e.jsxs("div",{style:te,children:[e.jsx("div",{style:ne,children:"Session"}),e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:100,background:(oe[o.status]??oe.idle).bg,color:(oe[o.status]??oe.idle).color},children:Le(o.status)})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12},children:[e.jsxs("div",{style:ie,children:[e.jsx("div",{style:se,children:r("supervisor.coordinator.chain")}),e.jsx("div",{style:{...le,fontSize:16},children:o.chainName??"--"}),e.jsx("div",{style:ae,children:o.intent||"--"})]}),e.jsxs("div",{style:ie,children:[e.jsx("div",{style:se,children:r("supervisor.coordinator.progress")}),e.jsxs("div",{style:le,children:[z.length,e.jsxs("span",{style:{fontSize:13,fontWeight:500,color:"var(--color-text-tertiary)"},children:[" / ",F]})]}),e.jsx("div",{style:ae,children:e.jsx("div",{style:{height:3,background:"rgba(0,0,0,0.06)",borderRadius:100,overflow:"hidden",marginTop:4},children:e.jsx("div",{style:{height:"100%",borderRadius:100,background:"linear-gradient(90deg, var(--color-accent-blue), var(--color-accent-green))",width:`${he}%`,transition:"width 0.6s"}})})})]}),e.jsxs("div",{style:ie,children:[e.jsx("div",{style:se,children:r("supervisor.coordinator.avg_quality")}),e.jsx("div",{style:{...le,color:O!=null?A(O):"var(--color-text-primary)"},children:O!=null?O.toFixed(1):"--"}),e.jsx("div",{style:ae,children:z.length>0?r("supervisor.coordinator.from_steps",{count:z.length}):"--"})]}),e.jsxs("div",{style:ie,children:[e.jsx("div",{style:se,children:r("supervisor.coordinator.elapsed")}),e.jsx("div",{style:{...le,fontSize:16},children:L}),e.jsxs("div",{style:ae,children:[r("supervisor.coordinator.tool_label"),": ",o.tool??d]})]})]})]}),E&&n&&e.jsx("div",{style:V,children:e.jsxs("div",{style:or,children:[e.jsxs("div",{style:tr,children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),e.jsx("span",{style:nr,children:r("supervisor.coordinator.clarification_needed")})]}),e.jsxs("div",{style:{padding:"14px 16px"},children:[e.jsx("div",{style:ir,children:n}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{style:sr,placeholder:r("supervisor.coordinator.type_response"),value:I,onChange:l=>$(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}}),e.jsxs("button",{type:"button",style:lr,onClick:c,children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),r("supervisor.coordinator.send")]})]})]})]})}),b&&w.length>0&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[e.jsxs("div",{style:V,children:[e.jsxs("div",{style:te,children:[e.jsx("div",{style:ne,children:r("supervisor.coordinator.chain_steps")}),e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r("supervisor.coordinator.steps_count",{count:F})})]}),e.jsx("div",{style:D,children:e.jsx("div",{style:{padding:"14px 16px"},children:w.map((l,S)=>{const W=P[l.status]??P.pending,M=t===S,J=S===w.length-1,q=Y(l);return e.jsxs("div",{onClick:()=>v(S),style:{display:"flex",gap:12,padding:"10px 8px",position:"relative",cursor:"pointer",background:M?"var(--color-bg-hover)":"transparent",borderRadius:M?8:0,margin:M?"0 -8px":"0"},children:[!J&&e.jsx("div",{style:{position:"absolute",left:M?19:11,top:30,bottom:-10,width:1,background:l.status==="completed"?"var(--color-accent-green)":"var(--color-border-divider)",opacity:l.status==="completed"?.4:1}}),e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:W.bg,border:"2px solid var(--color-bg-primary)"},children:e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:W.dot,animation:l.status==="running"?"pulse 2s infinite":void 0}})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:l.cmd}),l.args&&e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:l.args}),(q||l.qualityScore!=null||l.status==="running")&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:3},children:[q&&e.jsx("span",{style:{fontSize:10,fontFamily:"'SF Mono', Consolas, monospace",color:"var(--color-text-placeholder)"},children:q}),l.qualityScore!=null&&e.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 7px",borderRadius:100,background:ke(l.qualityScore),color:A(l.qualityScore)},children:l.qualityScore}),l.status==="running"&&l.qualityScore==null&&e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:100,background:"var(--color-tint-running)",color:"var(--color-accent-blue)"},children:"running"})]})]})]},l.index)})})})]}),e.jsx("div",{style:V,children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:te,children:[e.jsxs("div",{style:ne,children:["Step ",(t??0)+1,": ",h.cmd]}),e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:100,background:(P[h.status]??P.pending).bg||"var(--color-tint-pending)",color:(P[h.status]??P.pending).dot},children:h.status})]}),h.status==="completed"&&h.qualityScore!=null&&e.jsx("div",{style:{marginBottom:16},children:e.jsxs("div",{style:D,children:[e.jsxs("div",{style:je,children:[e.jsx("span",{style:me,children:r("supervisor.coordinator.quality_score")}),e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:100,background:ke(h.qualityScore),color:A(h.qualityScore)},children:h.qualityScore})]}),e.jsx("div",{style:{padding:"14px 16px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsxs("div",{style:{width:48,height:48,position:"relative",flexShrink:0},children:[e.jsxs("svg",{viewBox:"0 0 36 36",width:"48",height:"48",style:{transform:"rotate(-90deg)"},children:[e.jsx("circle",{cx:"18",cy:"18",r:"15.9",fill:"none",stroke:"var(--color-bg-secondary)",strokeWidth:"5"}),e.jsx("circle",{cx:"18",cy:"18",r:"15.9",fill:"none",stroke:A(h.qualityScore),strokeWidth:"5",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:100-h.qualityScore})]}),e.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:800,color:"var(--color-text-primary)"},children:h.qualityScore})]}),h.summary&&e.jsx("div",{style:{flex:1,fontSize:11,color:"var(--color-text-secondary)",lineHeight:1.6},children:h.summary})]})})]})}),h.status==="completed"&&h.summary&&e.jsx("div",{style:{marginBottom:16},children:e.jsxs("div",{style:D,children:[e.jsx("div",{style:je,children:e.jsx("span",{style:me,children:r("supervisor.coordinator.summary")})}),e.jsx("div",{style:{padding:"14px 16px"},children:e.jsx("div",{style:{fontSize:12,color:"var(--color-text-primary)",lineHeight:1.7},children:h.summary})})]})}),(h.status==="running"||h.status==="completed")&&h.analysis&&e.jsx("div",{style:{marginBottom:16},children:e.jsxs("div",{style:D,children:[e.jsx("div",{style:je,children:e.jsx("span",{style:me,children:r("supervisor.coordinator.analysis")})}),e.jsx("pre",{style:ar,children:h.analysis})]})}),(h.status==="pending"||h.status==="skipped")&&e.jsx("div",{style:D,children:e.jsx("div",{style:{padding:"14px 16px"},children:e.jsxs("div",{style:{textAlign:"center",padding:"48px 20px",color:"var(--color-text-tertiary)"},children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.2,margin:"0 auto 10px",display:"block"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--color-text-secondary)"},children:r("supervisor.coordinator.waiting_execute")}),e.jsx("div",{style:{fontSize:11,marginTop:4,maxWidth:300,marginLeft:"auto",marginRight:"auto",lineHeight:1.6},children:r("supervisor.coordinator.pending_desc")})]})})})]}):e.jsx("div",{style:D,children:e.jsx("div",{style:{padding:"14px 16px"},children:e.jsx("div",{style:{textAlign:"center",padding:"48px 20px",color:"var(--color-text-tertiary)",fontSize:11},children:"Select a step to view details"})})})})]}),!b&&e.jsx("div",{style:D,children:e.jsx("div",{style:{padding:"14px 16px"},children:e.jsxs("div",{style:{textAlign:"center",padding:"48px 20px",color:"var(--color-text-tertiary)"},children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.2,margin:"0 auto 10px",display:"block"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 5.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--color-text-secondary)"},children:r("supervisor.coordinator.no_session")}),e.jsx("div",{style:{fontSize:11,marginTop:4,maxWidth:300,marginLeft:"auto",marginRight:"auto",lineHeight:1.6},children:r("supervisor.coordinator.no_session_desc")})]})})})]})}const V={marginBottom:24},te={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},ne={fontSize:13,fontWeight:700,color:"var(--color-text-primary)"},D={background:"var(--color-bg-card)",borderRadius:12,border:"1px solid var(--color-border-divider)",overflow:"hidden"},je={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},me={fontSize:12,fontWeight:700,color:"var(--color-text-primary)"},ie={background:"var(--color-bg-card)",borderRadius:10,padding:"14px 16px",border:"1px solid var(--color-border-divider)"},se={fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},le={fontSize:20,fontWeight:800,color:"var(--color-text-primary)",marginTop:2},ae={fontSize:10,color:"var(--color-text-tertiary)"},Se={fontSize:11,fontWeight:600,padding:"5px 12px",borderRadius:8,border:"1px solid var(--color-border)",background:"none",cursor:"pointer",color:"var(--color-text-secondary)",transition:"all 150ms"},Qe={...Se,background:"var(--color-text-primary)",color:"#fff",borderColor:"var(--color-text-primary)"},Ve={...Se,color:"var(--color-accent-red)",borderColor:"var(--color-accent-red)"},Ue={...Se,color:"var(--color-accent-green)",borderColor:"var(--color-accent-green)"},Ge={background:"var(--color-bg-card)",borderRadius:12,border:"1px solid var(--color-border-divider)",overflow:"hidden"},Je={display:"flex",alignItems:"center",gap:10,padding:"10px 16px"},Xe={flex:1,border:"none",background:"transparent",fontSize:13,color:"var(--color-text-primary)",outline:"none",fontFamily:"inherit",lineHeight:1.5},Ze={padding:"4px 8px",borderRadius:6,fontSize:11,fontWeight:600,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-primary)",color:"var(--color-text-secondary)",cursor:"pointer",outline:"none"},er={fontSize:9,fontWeight:700,padding:"3px 8px",borderRadius:100,border:"none",cursor:"pointer",transition:"all 150ms",background:"var(--color-tint-completed)",color:"var(--color-accent-green)"},rr={fontSize:9,fontWeight:700,padding:"3px 8px",borderRadius:100,border:"none",cursor:"pointer",transition:"all 150ms",background:"var(--color-tint-pending)",color:"var(--color-accent-gray)"},or={background:"var(--color-bg-card)",borderRadius:12,border:"2px solid var(--color-accent-orange)",overflow:"hidden"},tr={display:"flex",alignItems:"center",gap:8,padding:"10px 16px",background:"var(--color-tint-verifying)",color:"var(--color-accent-orange)"},nr={fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:".04em"},ir={fontSize:12,color:"var(--color-text-primary)",lineHeight:1.6,marginBottom:10},sr={flex:1,padding:"7px 12px",fontSize:12,borderRadius:8,border:"1px solid var(--color-border)",background:"var(--color-bg-primary)",color:"var(--color-text-primary)",outline:"none"},lr={padding:"7px 14px",border:"none",borderRadius:8,background:"var(--color-accent-orange)",color:"#fff",fontSize:11,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:4},ar={margin:0,padding:"14px 16px",fontSize:11,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"'SF Mono', Consolas, monospace",background:"#2C2723",color:"#D9D0C4",borderRadius:"0 0 12px 12px",maxHeight:220,overflowY:"auto"};function dr(){const{t:r}=T(),o=m(d=>d.promptModes),t=m(d=>d.promptBindings),[n,s]=g.useState(null),[x,a]=g.useState(""),[v,p]=g.useState(""),y=v?o.filter(d=>d.toLowerCase().includes(v.toLowerCase())):o,i=d=>{s(d),a(t[d]??"")};return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{style:{width:320,background:"var(--color-bg-primary)",borderRight:"1px solid var(--color-border)",flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--color-text-primary)"},children:r("supervisor.prompts.title")}),e.jsx("span",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r("supervisor.prompts.builders_count",{count:o.length})})]}),e.jsx("input",{value:v,onChange:d=>p(d.target.value),placeholder:r("supervisor.prompts.filter"),style:{margin:"10px 12px 6px",padding:"8px 12px",borderRadius:8,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-card)",fontSize:12,color:"var(--color-text-primary)",outline:"none"}}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:y.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:16},children:r(v?"supervisor.prompts.no_matches":"supervisor.prompts.no_modes")}):y.map(d=>{const k=d===n,j=!!t[d];return e.jsxs("button",{type:"button",onClick:()=>i(d),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",background:k?"var(--color-tint-exploring)":"none",borderLeft:`3px solid ${k?"var(--color-accent-blue)":"transparent"}`,transition:"all 120ms"},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-planning)",color:"var(--color-accent-purple)",flexShrink:0},children:e.jsxs("svg",{style:{width:14,height:14,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 7 4 4 20 4 20 7"}),e.jsx("line",{x1:"9",y1:"20",x2:"15",y2:"20"}),e.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"20"})]})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d}),e.jsx("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r(j?"supervisor.prompts.bound":"supervisor.prompts.unbound")})]}),j&&e.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"2px 8px",borderRadius:100,background:"rgba(90,158,120,0.12)",color:"var(--color-accent-green)"},children:"active"})]},d)})})]}),e.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid var(--color-border-divider)",flexShrink:0},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-planning)",color:"var(--color-accent-purple)"},children:e.jsxs("svg",{style:{width:18,height:18,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 7 4 4 20 4 20 7"}),e.jsx("line",{x1:"9",y1:"20",x2:"15",y2:"20"}),e.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"20"})]})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--color-text-primary)"},children:n}),e.jsx("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:r("supervisor.prompts.prompt_builder")})]})]})}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:20},children:[e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r("supervisor.prompts.binding")})}),e.jsxs("div",{style:{padding:"14px 16px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 0",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:120,flexShrink:0},children:r("supervisor.prompts.mode")}),e.jsx("span",{style:{fontSize:12,color:"var(--color-text-primary)",fontWeight:500},children:n})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 0"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:120,flexShrink:0},children:r("supervisor.prompts.status")}),e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:t[n]?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:t[n]?"var(--color-accent-green)":"var(--color-accent-gray)"},children:t[n]?r("supervisor.prompts.bound"):r("supervisor.prompts.unbound")})]})]})]}),e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r("supervisor.prompts.template")})}),e.jsx("div",{style:{padding:"14px 16px"},children:e.jsx("textarea",{value:x,onChange:d=>a(d.target.value),placeholder:r("supervisor.prompts.edit_placeholder"),style:{width:"100%",minHeight:160,resize:"vertical",borderRadius:8,padding:12,fontSize:12,fontFamily:"'SF Mono', Consolas, monospace",lineHeight:1.6,background:"var(--color-bg-secondary)",color:"var(--color-text-primary)",border:"1px solid var(--color-border-divider)",outline:"none"}})})]}),x&&e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r("supervisor.prompts.preview")})}),e.jsx("div",{style:{padding:0},children:e.jsx("pre",{style:{margin:0,padding:16,fontSize:11,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"'SF Mono', Consolas, monospace",maxHeight:200,overflowY:"auto",background:"var(--color-text-primary)",color:"#d4d0ca",borderRadius:"0 0 12px 12px"},children:x})})]})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:13},children:r("supervisor.prompts.select_detail")})})]})}const pe={strategy:{bg:"var(--color-tint-exploring)",fg:"var(--color-accent-blue)"},builder:{bg:"var(--color-tint-completed)",fg:"var(--color-accent-green)"},adapter:{bg:"var(--color-tint-verifying)",fg:"var(--color-accent-orange)"},task:{bg:"var(--color-tint-planning)",fg:"var(--color-accent-purple)"},tool:{bg:"var(--color-tint-pending)",fg:"var(--color-accent-gray)"}},xe={strategy:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),e.jsx("path",{d:"M2 17l10 5 10-5"}),e.jsx("path",{d:"M2 12l10 5 10-5"})]}),builder:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"9",y1:"21",x2:"9",y2:"9"})]}),adapter:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}),task:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),tool:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09"})]})};function cr(){const{t:r}=T(),o=m(p=>p.extensions),[t,n]=g.useState(null),[s,x]=g.useState(""),a=s?o.filter(p=>p.name.toLowerCase().includes(s.toLowerCase())||p.type.toLowerCase().includes(s.toLowerCase())):o,v=o.find(p=>p.name===t)??null;return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{style:{width:320,background:"var(--color-bg-primary)",borderRight:"1px solid var(--color-border)",flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--color-text-primary)"},children:r("supervisor.extensions.title")}),e.jsx("span",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r("supervisor.extensions.loaded_count",{count:o.length})})]}),e.jsx("input",{value:s,onChange:p=>x(p.target.value),placeholder:r("supervisor.extensions.filter"),style:{margin:"10px 12px 6px",padding:"8px 12px",borderRadius:8,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-card)",fontSize:12,color:"var(--color-text-primary)",outline:"none"}}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:a.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:16},children:r(s?"supervisor.extensions.no_matches":"supervisor.extensions.no_extensions")}):a.map(p=>{const y=p.name===t,i=pe[p.type]??pe.tool;return e.jsxs("button",{type:"button",onClick:()=>n(p.name),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",background:y?"var(--color-tint-exploring)":"none",borderLeft:`3px solid ${y?"var(--color-accent-blue)":"transparent"}`,transition:"all 120ms"},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:i.bg,color:i.fg,flexShrink:0},children:e.jsx("span",{style:{width:14,height:14,strokeWidth:1.8,display:"flex"},children:xe[p.type]??xe.tool})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p.name}),e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)",display:"flex",gap:8},children:[e.jsxs("span",{children:["v",p.version]}),e.jsx("span",{children:p.type})]})]}),e.jsx("div",{style:{flexShrink:0},children:e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",display:"inline-block",background:p.status==="enabled"?"var(--color-accent-green)":"var(--color-text-tertiary)"}})})]},p.name)})})]}),e.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:v?e.jsx(pr,{ext:v}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:13},children:r("supervisor.extensions.select_detail")})})]})}function pr({ext:r}){const{t:o}=T(),t=pe[r.type]??pe.tool;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid var(--color-border-divider)",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:t.bg,color:t.fg},children:e.jsx("span",{style:{width:18,height:18,strokeWidth:1.8,display:"flex"},children:xe[r.type]??xe.tool})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--color-text-primary)"},children:r.name}),e.jsxs("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:["v",r.version]})]})]}),e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:r.status==="enabled"?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:r.status==="enabled"?"var(--color-accent-green)":"var(--color-accent-gray)"},children:r.status})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:20},children:[e.jsx(ze,{title:o("supervisor.extensions.about"),children:e.jsx("div",{style:{fontSize:12,color:"var(--color-text-primary)",lineHeight:1.6},children:r.description||o("supervisor.extensions.no_description")})}),e.jsxs(ze,{title:o("supervisor.extensions.details"),children:[e.jsx(de,{label:o("supervisor.extensions.name"),value:r.name}),e.jsx(de,{label:o("supervisor.extensions.version"),value:r.version}),e.jsx(de,{label:o("supervisor.extensions.type"),value:r.type}),e.jsx(de,{label:o("supervisor.extensions.status"),value:r.status})]})]})]})}function ze({title:r,children:o}){return e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r})}),e.jsx("div",{style:{padding:"14px 16px"},children:o})]})}function de({label:r,value:o}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 0",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:120,flexShrink:0},children:r}),e.jsx("span",{style:{fontSize:12,color:"var(--color-text-primary)",fontWeight:500},children:o})]})}const xr={optimize:"var(--color-accent-blue)",alert:"var(--color-accent-red)",automate:"var(--color-accent-green)"};function ur(){const{t:r}=T(),o=m(i=>i.learningStats),t=m(i=>i.learningPatterns),n=m(i=>i.knowledgeEntries),[s,x]=g.useState(""),[a,v]=g.useState(null),p=s?n.filter(i=>i.topic.toLowerCase().includes(s.toLowerCase())||i.content.toLowerCase().includes(s.toLowerCase())||i.tags.some(d=>d.toLowerCase().includes(s.toLowerCase()))):n,y=t.reduce((i,d)=>Math.max(i,d.frequency),1);return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{style:{width:320,background:"var(--color-bg-primary)",borderRight:"1px solid var(--color-border)",flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--color-text-primary)"},children:r("supervisor.learning.title")}),o&&e.jsx("span",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:r("supervisor.learning.cmds_patterns",{cmds:o.totalCommands,patterns:o.uniquePatterns})})]}),e.jsx("input",{value:s,onChange:i=>x(i.target.value),placeholder:r("supervisor.learning.search"),style:{margin:"10px 12px 6px",padding:"8px 12px",borderRadius:8,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-card)",fontSize:12,color:"var(--color-text-primary)",outline:"none"}}),e.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:"var(--color-text-tertiary)",padding:"10px 16px 4px"},children:r("supervisor.learning.command_patterns")}),t.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:12},children:r("supervisor.learning.no_patterns")}):t.map(i=>{const d=(a==null?void 0:a.type)==="pattern"&&a.data.command===i.command;return e.jsxs("button",{type:"button",onClick:()=>v({type:"pattern",data:i}),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",background:d?"var(--color-tint-exploring)":"none",borderLeft:`3px solid ${d?"var(--color-accent-blue)":"transparent"}`,transition:"all 120ms"},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-exploring)",color:"var(--color-accent-blue)",flexShrink:0},children:e.jsxs("svg",{style:{width:14,height:14,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 17 10 11 4 5"}),e.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.command}),e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)",display:"flex",gap:8},children:[e.jsxs("span",{children:["x",i.frequency]}),e.jsxs("span",{children:[Math.round(i.successRate*100),"% ",r("supervisor.learning.success_label")]})]})]})]},i.command)}),e.jsxs("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".06em",color:"var(--color-text-tertiary)",padding:"10px 16px 4px"},children:[r("supervisor.learning.knowledge_base")," (",p.length,")"]}),p.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:12},children:r(s?"supervisor.learning.no_matches":"supervisor.learning.empty")}):p.map(i=>{const d=(a==null?void 0:a.type)==="knowledge"&&a.data.id===i.id;return e.jsxs("button",{type:"button",onClick:()=>v({type:"knowledge",data:i}),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",background:d?"var(--color-tint-exploring)":"none",borderLeft:`3px solid ${d?"var(--color-accent-blue)":"transparent"}`,transition:"all 120ms"},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-completed)",color:"var(--color-accent-green)",flexShrink:0},children:e.jsxs("svg",{style:{width:14,height:14,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),e.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.topic}),e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)",display:"flex",gap:8},children:[e.jsx("span",{children:i.source}),e.jsx("span",{children:r("supervisor.learning.used_count",{count:i.usageCount})})]})]})]},i.id)})]})]}),e.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:a?a.type==="pattern"?e.jsx(vr,{pattern:a.data,maxFrequency:y,suggestions:(o==null?void 0:o.suggestions)??[]}):e.jsx(hr,{entry:a.data}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:13},children:r("supervisor.learning.select_detail")})})]})}function vr({pattern:r,maxFrequency:o,suggestions:t}){const{t:n}=T(),s=Math.round(r.frequency/o*100),x=r.successRate>=.9?"var(--color-accent-green)":r.successRate>=.7?"var(--color-accent-blue)":"var(--color-accent-yellow)";return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid var(--color-border-divider)",flexShrink:0},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-exploring)",color:"var(--color-accent-blue)"},children:e.jsxs("svg",{style:{width:18,height:18,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 17 10 11 4 5"}),e.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--color-text-primary)"},children:r.command}),e.jsx("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:n("supervisor.learning.command_pattern")})]})]})}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:20},children:[e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(N,{label:n("supervisor.learning.frequency"),value:String(r.frequency)}),e.jsx(N,{label:n("supervisor.learning.success_rate"),value:`${Math.round(r.successRate*100)}%`,valueColor:x}),e.jsx(N,{label:n("supervisor.learning.avg_duration"),value:`${Math.round(r.avgDuration/1e3)}s`})]}),e.jsxs(U,{title:n("supervisor.learning.usage"),children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 0"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:80},children:n("supervisor.learning.relative")}),e.jsx("div",{style:{flex:1,height:6,background:"rgba(0,0,0,0.04)",borderRadius:100,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${s}%`,borderRadius:100,background:x}})}),e.jsxs("span",{style:{fontSize:11,color:"var(--color-text-tertiary)"},children:[s,"%"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 0",borderTop:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:120},children:n("supervisor.learning.last_used")}),e.jsx("span",{style:{fontSize:12,color:"var(--color-text-primary)",fontWeight:500},children:r.lastUsed?new Date(r.lastUsed).toLocaleString():"-"})]})]}),r.contexts&&r.contexts.length>0&&e.jsx(U,{title:n("supervisor.learning.contexts"),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:r.contexts.map(a=>e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:"rgba(145,120,181,0.12)",color:"var(--color-accent-purple)"},children:a},a))})}),t.length>0&&e.jsx(U,{title:n("supervisor.learning.suggestions"),children:e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map((a,v)=>e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:xr[a.type]??"var(--color-bg-tertiary)",color:"#fff",flexShrink:0},children:a.type}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:a.title}),e.jsx("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:a.description})]})]},v))})})]})]})}function hr({entry:r}){const{t:o}=T();return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid var(--color-border-divider)",flexShrink:0},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-tint-completed)",color:"var(--color-accent-green)"},children:e.jsxs("svg",{style:{width:18,height:18,strokeWidth:1.8},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),e.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--color-text-primary)"},children:r.topic}),e.jsxs("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:[o("supervisor.learning.knowledge_entry")," - ",r.source]})]})]})}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:20},children:[e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(N,{label:o("supervisor.learning.usage_count"),value:String(r.usageCount)}),e.jsx(N,{label:o("supervisor.learning.source"),value:r.source}),e.jsx(N,{label:o("supervisor.learning.last_accessed"),value:r.lastAccessed?new Date(r.lastAccessed).toLocaleDateString():"-"})]}),e.jsx(U,{title:o("supervisor.learning.content"),children:e.jsx("div",{style:{fontSize:12,color:"var(--color-text-primary)",lineHeight:1.6,whiteSpace:"pre-wrap"},children:r.content})}),r.tags.length>0&&e.jsx(U,{title:o("supervisor.learning.tags"),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:r.tags.map(t=>e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:t},t))})})]})]})}function N({label:r,value:o,valueColor:t}){return e.jsxs("div",{style:{flex:1,background:"var(--color-bg-primary)",borderRadius:10,padding:14,border:"1px solid var(--color-border-divider)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:r}),e.jsx("div",{style:{fontSize:22,fontWeight:700,color:t??"var(--color-text-primary)",marginTop:2},children:o})]})}function U({title:r,children:o}){return e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r})}),e.jsx("div",{style:{padding:"14px 16px"},children:o})]})}const gr=["auto-dispatch","cleanup","report","health-check","learning-analysis","custom"],ue={"auto-dispatch":{bg:"var(--color-tint-verifying)",fg:"var(--color-accent-orange)"},cleanup:{bg:"var(--color-tint-exploring)",fg:"var(--color-accent-blue)"},report:{bg:"var(--color-tint-planning)",fg:"var(--color-accent-purple)"},"health-check":{bg:"var(--color-tint-completed)",fg:"var(--color-accent-green)"},"learning-analysis":{bg:"var(--color-tint-executing)",fg:"var(--color-accent-yellow)"},custom:{bg:"var(--color-tint-pending)",fg:"var(--color-accent-gray)"}},ve={"auto-dispatch":e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"13 17 18 12 13 7"}),e.jsx("polyline",{points:"6 17 11 12 6 7"})]}),cleanup:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),report:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]}),"health-check":e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),"learning-analysis":e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),e.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),custom:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09"})]})};function yr(){const{t:r}=T(),o=m(u=>u.scheduledTasks),t=m(u=>u.createSchedule),n=m(u=>u.deleteSchedule),s=m(u=>u.toggleSchedule),x=m(u=>u.runSchedule),[a,v]=g.useState(null),[p,y]=g.useState(""),[i,d]=g.useState(!1),[k,j]=g.useState(""),[f,I]=g.useState(""),[$,L]=g.useState("custom"),B=p?o.filter(u=>u.name.toLowerCase().includes(p.toLowerCase())):o,C=o.find(u=>u.id===a)??null,b=async()=>{!k.trim()||!f.trim()||(await t({name:k.trim(),cronExpression:f.trim(),taskType:$,config:{},enabled:!0}),j(""),I(""),L("custom"),d(!1))};return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{style:{width:320,background:"var(--color-bg-primary)",borderRight:"1px solid var(--color-border)",flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"var(--color-text-primary)"},children:r("supervisor.schedule.title")}),e.jsx("button",{type:"button",onClick:()=>d(!i),style:{fontSize:12,fontWeight:600,padding:"7px 16px",borderRadius:8,border:"none",cursor:"pointer",background:"var(--color-text-primary)",color:"#fff"},children:r(i?"supervisor.schedule.cancel":"supervisor.schedule.new")})]}),i&&e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)",display:"flex",flexDirection:"column",gap:8},children:[e.jsx("input",{value:k,onChange:u=>j(u.target.value),placeholder:r("supervisor.schedule.task_name"),style:{...be}}),e.jsx("input",{value:f,onChange:u=>I(u.target.value),placeholder:"*/5 * * * *",style:{...be,fontFamily:"'SF Mono', Consolas, monospace"}}),e.jsx("select",{value:$,onChange:u=>L(u.target.value),style:{...be},children:gr.map(u=>e.jsx("option",{value:u,children:u},u))}),e.jsx("button",{type:"button",onClick:b,disabled:!k.trim()||!f.trim(),style:{fontSize:12,fontWeight:600,padding:"7px 16px",borderRadius:8,border:"none",cursor:"pointer",background:"var(--color-accent-green)",color:"#fff",opacity:!k.trim()||!f.trim()?.4:1},children:r("supervisor.schedule.create")})]}),e.jsx("input",{value:p,onChange:u=>y(u.target.value),placeholder:r("supervisor.schedule.filter"),style:{margin:"10px 12px 6px",padding:"8px 12px",borderRadius:8,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-card)",fontSize:12,color:"var(--color-text-primary)",outline:"none"}}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:B.map(u=>{const E=u.id===a,w=ue[u.taskType]??ue.custom;return e.jsxs("button",{type:"button",onClick:()=>v(u.id),style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",cursor:"pointer",border:"none",background:E?"var(--color-tint-exploring)":"none",borderLeft:`3px solid ${E?"var(--color-accent-blue)":"transparent"}`,width:"100%",textAlign:"left",transition:"all 120ms"},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:w.bg,color:w.fg,flexShrink:0},children:e.jsx("span",{style:{width:14,height:14,strokeWidth:1.8,display:"flex"},children:ve[u.taskType]??ve.custom})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u.name}),e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)",display:"flex",gap:8},children:[e.jsx("span",{style:{fontFamily:"'SF Mono', Consolas, monospace"},children:u.cronExpression}),u.lastRun&&e.jsx("span",{children:mr(u.lastRun)})]})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2,flexShrink:0},children:e.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"2px 8px",borderRadius:100,background:u.enabled?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:u.enabled?"var(--color-accent-green)":"var(--color-accent-gray)"},children:u.enabled?r("supervisor.schedule.active"):r("supervisor.schedule.paused")})})]},u.id)})})]}),e.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:C?e.jsx(fr,{task:C,onToggle:s,onRun:x,onDelete:n}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:13},children:r("supervisor.schedule.select_detail")})})]})}function fr({task:r,onToggle:o,onRun:t,onDelete:n}){const{t:s}=T(),x=ue[r.taskType]??ue.custom;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid var(--color-border-divider)",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:x.bg,color:x.fg},children:e.jsx("span",{style:{width:18,height:18,strokeWidth:1.8,display:"flex"},children:ve[r.taskType]??ve.custom})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--color-text-primary)"},children:r.name}),e.jsx("div",{style:{fontSize:11,color:"var(--color-text-secondary)"},children:r.taskType})]})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{type:"button",onClick:()=>t(r.id),style:{...Re},children:s("supervisor.schedule.run_now")}),e.jsx(jr,{on:r.enabled,onToggle:()=>o(r.id,!r.enabled)}),e.jsx("button",{type:"button",onClick:()=>n(r.id),style:{...Re,color:"var(--color-accent-red)"},children:s("supervisor.schedule.delete")})]})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:20},children:[e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{flex:1,background:"var(--color-bg-primary)",borderRadius:10,padding:14,border:"1px solid var(--color-border-divider)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:s("supervisor.schedule.total_runs")}),e.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--color-text-primary)",marginTop:2},children:r.history.length})]}),e.jsxs("div",{style:{flex:1,background:"var(--color-bg-primary)",borderRadius:10,padding:14,border:"1px solid var(--color-border-divider)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:s("supervisor.schedule.success_rate")}),e.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--color-accent-green)",marginTop:2},children:r.history.length>0?`${Math.round(r.history.filter(a=>a.status==="success").length/r.history.length*100)}%`:"-"})]}),e.jsxs("div",{style:{flex:1,background:"var(--color-bg-primary)",borderRadius:10,padding:14,border:"1px solid var(--color-border-divider)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)"},children:s("supervisor.schedule.next_run")}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--color-text-primary)",marginTop:6},children:r.nextRun?new Date(r.nextRun).toLocaleString():"-"})]})]}),e.jsxs(We,{title:s("supervisor.schedule.configuration"),children:[e.jsx(ce,{label:s("supervisor.schedule.schedule_label"),value:r.cronExpression,mono:!0}),e.jsx(ce,{label:s("supervisor.schedule.type"),value:r.taskType}),e.jsx(ce,{label:s("supervisor.schedule.last_run"),value:r.lastRun?new Date(r.lastRun).toLocaleString():s("supervisor.schedule.never")}),Object.entries(r.config).map(([a,v])=>e.jsx(ce,{label:a,value:String(v)},a))]}),e.jsx(We,{title:s("supervisor.schedule.run_history"),children:r.history.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",textAlign:"center",padding:"8px 0"},children:s("supervisor.schedule.no_runs")}):e.jsx("div",{style:{display:"flex",flexDirection:"column"},children:r.history.slice(-10).reverse().map((a,v)=>{const p=a.status==="success"?"var(--color-accent-green)":a.status==="failed"?"var(--color-accent-red)":"var(--color-accent-gray)";return e.jsxs("div",{style:{display:"flex",gap:12,padding:"8px 0",position:"relative"},children:[v<Math.min(r.history.length,10)-1&&e.jsx("div",{style:{position:"absolute",left:11,top:24,bottom:-8,width:1,background:"var(--color-border-divider)"}}),e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"2px solid var(--color-bg-card)"},children:e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:p}})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:10,color:"var(--color-text-placeholder)",fontFamily:"'SF Mono', Consolas, monospace"},children:new Date(a.timestamp).toLocaleString()}),e.jsx("div",{style:{fontSize:12,color:"var(--color-text-primary)"},children:a.status}),a.duration!=null&&e.jsxs("div",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:[Math.round(a.duration/1e3),"s"]})]})]},v)})})})]})]})}function We({title:r,children:o}){return e.jsxs("div",{style:{borderRadius:12,background:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-primary)"},children:r})}),e.jsx("div",{style:{padding:"14px 16px"},children:o})]})}function ce({label:r,value:o,mono:t}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 0",borderBottom:"1px solid var(--color-border-divider)"},children:[e.jsx("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",width:120,flexShrink:0},children:r}),e.jsx("span",{style:{fontSize:12,color:"var(--color-text-primary)",fontWeight:500,fontFamily:t?"'SF Mono', Consolas, monospace":void 0},children:o})]})}function jr({on:r,onToggle:o}){return e.jsx("button",{type:"button",onClick:o,style:{width:36,height:20,borderRadius:100,background:r?"var(--color-accent-green)":"var(--color-border)",border:"none",cursor:"pointer",position:"relative",transition:"background 200ms"},children:e.jsx("span",{style:{position:"absolute",top:2,left:r?18:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 200ms",boxShadow:"0 1px 3px rgba(0,0,0,0.15)"}})})}function mr(r){const o=Date.now()-new Date(r).getTime(),t=Math.floor(o/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:new Date(r).toLocaleDateString()}const be={padding:"8px 12px",borderRadius:8,border:"1px solid var(--color-border-divider)",background:"var(--color-bg-card)",fontSize:12,color:"var(--color-text-primary)",outline:"none"},Re={fontSize:11,fontWeight:600,padding:"5px 12px",borderRadius:8,border:"1px solid var(--color-border)",background:"none",color:"var(--color-text-secondary)",cursor:"pointer"},Te=[{id:"commander",labelKey:"supervisor.tabs.commander",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),e.jsx("path",{d:"M2 17l10 5 10-5"}),e.jsx("path",{d:"M2 12l10 5 10-5"})]})},{id:"executions",labelKey:"supervisor.tabs.executions",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})},{id:"schedule",labelKey:"supervisor.tabs.schedules",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]})},{id:"learning",labelKey:"supervisor.tabs.learning",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),e.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]})},{id:"extensions",labelKey:"supervisor.tabs.extensions",icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"})})},{id:"prompts",labelKey:"supervisor.tabs.prompts",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 7 4 4 20 4 20 7"}),e.jsx("line",{x1:"9",y1:"20",x2:"15",y2:"20"}),e.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"20"})]})},{id:"coordinator",labelKey:"supervisor.tabs.coordinator",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}];function Sr(){const{t:r}=T(),o=m(c=>c.activeTab),t=m(c=>c.setActiveTab),n=m(c=>c.fetchLearningStats),s=m(c=>c.fetchSchedules),x=m(c=>c.fetchExtensions),a=m(c=>c.fetchPromptModes),v=m(c=>c.scheduledTasks),p=m(c=>c.extensions),y=R(c=>c.slots),i=R(c=>c.queue),d=R(c=>c.supervisorStatus),k=R(c=>c.toggleSupervisor),j=R(c=>c.commanderState),f=_(c=>c.session),I=_(c=>c.start),$=_(c=>c.stop),[L,B]=g.useState(!1);g.useEffect(()=>{n(),s(),x(),a()},[n,s,x,a]);const C=g.useMemo(()=>Object.values(y),[y]),b=(d==null?void 0:d.enabled)??!1,u=(d==null?void 0:d.stats.totalDispatched)??0,E=(d==null?void 0:d.stats.totalCompleted)??0,w=u>0?`${Math.round(E/u*100)}%`:"-",h=f!=null&&f.status!=="idle"&&f.status!=="completed"&&f.status!=="failed",z=(f==null?void 0:f.steps)??[],F=z.filter(c=>c.status==="completed"||c.status==="skipped").length,he=g.useCallback(async()=>{await k(!b)},[k,b]),O=g.useCallback(()=>{h?$():I("continue",void 0,!0)},[h,$,I]),H=g.useCallback(c=>{t(c),B(!1)},[t]),G={schedule:v.length,extensions:p.length};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",background:"var(--color-bg-primary)"},children:[e.jsx("nav",{style:{flexShrink:0,display:"flex",alignItems:"center",padding:"0 24px",background:"var(--color-bg-secondary)",borderBottom:"1px solid var(--color-border)"},children:Te.map(c=>{const Y=o===c.id,A=G[c.id]??0;return e.jsxs("button",{type:"button",onClick:()=>t(c.id),style:{display:"flex",alignItems:"center",gap:6,padding:"10px 16px",fontSize:12,fontWeight:Y?600:500,color:Y?"var(--color-text-primary)":"var(--color-text-tertiary)",background:"none",border:"none",borderBottom:`2px solid ${Y?"var(--color-text-primary)":"transparent"}`,cursor:"pointer",transition:"color 120ms, border-color 120ms"},children:[e.jsx("span",{style:{width:14,height:14,display:"flex"},children:c.icon}),r(c.labelKey),A>0&&e.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"1px 6px",borderRadius:100,background:"var(--color-bg-card)",color:"var(--color-text-tertiary)"},children:A})]},c.id)})}),e.jsxs("main",{style:{flex:1,minHeight:0,overflow:"hidden"},children:[o==="commander"&&e.jsx(Ee,{}),o==="executions"&&e.jsx(Ae,{}),o==="coordinator"&&e.jsx(Ke,{}),o==="prompts"&&e.jsx(dr,{}),o==="extensions"&&e.jsx(cr,{}),o==="learning"&&e.jsx(ur,{}),o==="schedule"&&e.jsx(yr,{})]}),L&&e.jsx("div",{onClick:()=>B(!1),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.25)",zIndex:90,transition:"opacity 200ms"}}),e.jsxs("div",{style:{position:"fixed",left:0,right:0,bottom:36,maxHeight:L?"60vh":0,overflow:"hidden",background:"var(--color-bg-card)",borderTop:L?"1px solid var(--color-border)":"none",borderRadius:"12px 12px 0 0",zIndex:91,transition:"max-height 300ms cubic-bezier(0.4,0,0.2,1)",boxShadow:L?"0 -4px 24px rgba(0,0,0,0.08)":"none"},children:[e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0 4px",cursor:"pointer"},onClick:()=>B(!1),children:e.jsx("div",{style:{width:32,height:4,borderRadius:2,background:"var(--color-border)"}})}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr 1fr",gap:16,padding:"8px 24px 24px",overflowY:"auto",maxHeight:"calc(60vh - 40px)"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("div",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",color:"var(--color-text-tertiary)",padding:"4px 8px",marginBottom:4},children:"Navigate"}),Te.map(c=>e.jsxs("button",{type:"button",onClick:()=>H(c.id),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",fontSize:12,fontWeight:o===c.id?600:400,color:o===c.id?"var(--color-text-primary)":"var(--color-text-secondary)",background:o===c.id?"var(--color-bg-active)":"none",border:"none",borderRadius:6,cursor:"pointer",textAlign:"left",transition:"background 120ms"},children:[e.jsx("span",{style:{width:14,height:14,display:"flex"},children:c.icon}),r(c.labelKey)]},c.id))]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{borderRadius:10,border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--color-border-divider)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--color-accent-blue)"},children:"Issue Executions"}),e.jsxs("span",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:[C.length," running"]})]}),e.jsx("div",{style:{padding:"8px 14px"},children:C.length===0?e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",padding:"4px 0"},children:"No active slots"}):C.slice(0,5).map(c=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"5px 0",fontSize:11},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--color-accent-blue)",flexShrink:0}}),e.jsx("span",{style:{fontWeight:500,color:"var(--color-text-primary)"},children:c.issueId}),e.jsx("span",{style:{color:"var(--color-text-tertiary)",marginLeft:"auto"},children:c.executor})]},c.processId))})]}),e.jsxs("div",{style:{borderRadius:10,border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--color-border-divider)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--color-accent-purple)"},children:"Workflow Sessions"}),e.jsx("span",{style:{fontSize:10,color:"var(--color-text-tertiary)"},children:f?f.status:"idle"})]}),e.jsx("div",{style:{padding:"8px 14px"},children:f?e.jsxs("div",{style:{fontSize:11},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 0"},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--color-text-primary)"},children:f.chainName??"Session"}),e.jsxs("span",{style:{color:"var(--color-text-tertiary)"},children:["Step ",f.currentStep+1,"/",z.length]})]}),f.intent&&e.jsx("div",{style:{color:"var(--color-text-secondary)",padding:"2px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.intent})]}):e.jsx("div",{style:{fontSize:11,color:"var(--color-text-tertiary)",padding:"4px 0"},children:"No active session"})})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{borderRadius:10,border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--color-text-primary)"},children:"Commander"})}),e.jsxs("div",{style:{padding:"8px 14px",fontSize:11},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 0"},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--color-text-secondary)"},children:"Status:"}),e.jsx("span",{style:{fontWeight:600,color:(j==null?void 0:j.status)==="dispatching"?"var(--color-accent-green)":(j==null?void 0:j.status)==="thinking"?"var(--color-accent-blue)":"var(--color-text-tertiary)"},children:(j==null?void 0:j.status)??"idle"})]}),(d==null?void 0:d.isCommanderActive)!==void 0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 0"},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--color-text-secondary)"},children:"Active:"}),e.jsx("span",{style:{color:d.isCommanderActive?"var(--color-accent-green)":"var(--color-text-tertiary)"},children:d.isCommanderActive?"Yes":"No"})]})]})]}),e.jsxs("div",{style:{borderRadius:10,border:"1px solid var(--color-border-divider)",overflow:"hidden"},children:[e.jsx("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--color-border-divider)"},children:e.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--color-text-primary)"},children:"Suggestions"})}),e.jsx("div",{style:{padding:"8px 14px",fontSize:11,color:"var(--color-text-tertiary)"},children:"No suggestions"})]})]})]})]}),e.jsxs("footer",{style:{flexShrink:0,display:"flex",alignItems:"center",height:36,padding:"0 16px",background:"var(--color-bg-secondary)",borderTop:"1px solid var(--color-border)",gap:12,fontSize:11,zIndex:92},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontWeight:600,color:"var(--color-text-primary)"},children:"Supervisor"}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:10,fontWeight:600,padding:"2px 8px",borderRadius:100,background:b?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:b?"var(--color-accent-green)":"var(--color-accent-gray)"},children:[b&&e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--color-accent-green)",animation:"pulse 2s ease-in-out infinite"}}),b?"Active":"Inactive"]})]}),e.jsx("div",{style:{width:1,height:16,background:"var(--color-border-divider)"}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--color-accent-blue)"},children:"Issues"}),e.jsxs("span",{style:{color:"var(--color-text-secondary)"},children:[C.length," running"]}),e.jsxs("span",{style:{color:"var(--color-text-tertiary)"},children:[i.length," queued"]}),e.jsxs("span",{style:{color:"var(--color-text-secondary)"},children:[w," success"]})]}),e.jsx("div",{style:{width:1,height:16,background:"var(--color-border-divider)"}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--color-accent-purple)"},children:"Workflow"}),e.jsx("span",{style:{color:"var(--color-text-secondary)"},children:h?"1 running":"0 running"}),e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:z.length>0?`${F}/${z.length} steps`:"-"})]}),e.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8},children:[e.jsxs("button",{type:"button",onClick:()=>B(c=>!c),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",fontSize:10,fontWeight:600,borderRadius:6,border:"1px solid var(--color-border)",background:L?"var(--color-bg-active)":"none",color:"var(--color-text-secondary)",cursor:"pointer",transition:"background 120ms"},children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{width:12,height:12},children:e.jsx("polyline",{points:L?"6 15 12 9 18 15":"6 9 12 15 18 9"})}),"Overview"]}),e.jsx("button",{type:"button",onClick:he,style:{padding:"3px 10px",fontSize:10,fontWeight:600,borderRadius:6,border:"1px solid",borderColor:b?"var(--color-accent-blue)":"var(--color-border)",background:b?"rgba(91,141,184,0.12)":"none",color:b?"var(--color-accent-blue)":"var(--color-text-tertiary)",cursor:"pointer",transition:"all 120ms"},children:"Issues"}),e.jsx("button",{type:"button",onClick:O,style:{padding:"3px 10px",fontSize:10,fontWeight:600,borderRadius:6,border:"1px solid",borderColor:h?"var(--color-accent-purple)":"var(--color-border)",background:h?"rgba(145,120,181,0.12)":"none",color:h?"var(--color-accent-purple)":"var(--color-text-tertiary)",cursor:"pointer",transition:"all 120ms"},children:"Workflow"})]})]}),e.jsx("style",{children:`
2
- @keyframes pulse {
3
- 0%, 100% { opacity: 1; }
4
- 50% { opacity: 0.4; }
5
- }
6
- `})]})}export{Sr as SupervisorPage};
@@ -1,6 +0,0 @@
1
- import{d as H,j as e,S as h,a as j,r as v,c as X,L as W,V as J,p as Y}from"./index-uIqUCT8y.js";import{u as Z}from"./shallow-BOmvDNsv.js";import{c as E,S as T,P as $,b as ee,D as te,K as se}from"./table-DCzuJAFh.js";import{C as A}from"./check-o7nfGNHf.js";import{L as F}from"./list-BTRAIvDq.js";import{C as O}from"./circle-check-Cd-jce4j.js";import{C as ae}from"./circle-alert-DcSBokh4.js";import{C as re}from"./columns-3-BzgxelGx.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ne=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ie=H("play",ne),B=[{status:"pending",label:"Pending"},{status:"exploring",label:"Exploring"},{status:"planning",label:"Planning"},{status:"executing",label:"Executing"},{status:"verifying",label:"Verifying"},{status:"completed",label:"Complete"}];function oe(t,s){return s==="completed"?t.filter(a=>a.status==="completed").length:s==="verifying"?t.filter(a=>a.status==="verifying"||a.status==="testing").length:s==="pending"?t.filter(a=>a.status==="pending"||a.status==="not_started").length:t.filter(a=>a.status===s).length}function le({phases:t,hiddenCols:s,onToggleCol:a}){return e.jsx("div",{className:"flex items-center px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border-divider bg-bg-primary shrink-0 gap-0 overflow-x-auto",children:B.map((n,i)=>{const x=oe(t,n.status),r=h[n.status],l=s==null?void 0:s.has(n.status);return e.jsxs("div",{className:"contents",children:[e.jsxs("button",{type:"button",onClick:()=>a==null?void 0:a(n.status),className:`flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] cursor-pointer transition-all rounded-full border ${l?"opacity-40 border-border bg-bg-secondary":"opacity-100 border-transparent bg-transparent hover:bg-bg-secondary"}`,title:l?`Show ${n.label} column`:`Hide ${n.label} column`,children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0",style:{backgroundColor:r}}),e.jsx("span",{className:"text-text-tertiary",children:n.label}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-bg-secondary text-text-tertiary font-mono",children:x})]}),i<B.length-1&&e.jsx("div",{className:"relative w-5 h-px bg-border shrink-0",children:e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[4px] border-l-border"})})]},n.status)})})}const _={feat:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},feature:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},fix:{bg:"rgba(208,84,84,0.12)",text:"var(--color-status-blocked)"},refac:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},refactor:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},docs:{bg:"rgba(160,157,151,0.12)",text:"var(--color-status-pending)"},test:{bg:"rgba(91,141,184,0.12)",text:"var(--color-status-testing)"}},I={in_progress:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},running:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},pending:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},queued:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},completed:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},done:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},failed:{bg:"rgba(208,84,84,0.1)",text:"var(--color-status-blocked)"}},ce={in_progress:"Running",running:"Running",pending:"Queued",queued:"Queued",completed:"Done",done:"Done",failed:"Failed"};function R(t){return{feature:"feat",refactor:"refac"}[t]??t}function de({task:t}){const s=_[t.type]??_[R(t.type)]??_.feat,a=I[t.status]??I.pending,n=ce[t.status]??t.status;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-default)] bg-bg-card text-[length:var(--font-size-xs)] cursor-pointer transition-colors duration-[var(--duration-fast)] hover:bg-bg-hover",children:[e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary min-w-[60px] shrink-0",children:t.id}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] uppercase px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:s.bg,color:s.text},children:R(t.type)}),e.jsx("span",{className:"flex-1 text-text-primary whitespace-nowrap overflow-hidden text-ellipsis",children:t.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:a.bg,color:a.text},children:n})]})}const xe={not_started:"var(--color-tint-pending)",pending:"var(--color-tint-pending)",exploring:"var(--color-tint-exploring)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",testing:"var(--color-tint-testing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function pe({phase:t,onSelectTask:s,recommendedAdvance:a}){const n=j(g=>g.setSelectedPhase),[i,x]=v.useState(!1),{tasks:r,loading:l}=E(i?t.phase:null),{tasks_completed:p,tasks_total:o,current_wave:c}=t.execution,m=h[t.status],y=t.verification.gaps.length>0,b=t.plan.task_count>0,d=X(g=>g.issues),f=v.useMemo(()=>d.filter(g=>g.phase_id===t.phase),[d,t.phase]),u=f.filter(g=>{var k;return((k=g.execution)==null?void 0:k.status)==="running"}).length;return b?e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>n(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(t.phase))},className:"rounded-[10px] px-[var(--spacing-3-5)] py-[var(--spacing-3)] cursor-pointer transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)] hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.06)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",style:{backgroundColor:xe[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),x(!i)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":i?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${i?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),e.jsx(T,{status:t.status,cardVariant:!0})]}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]}),e.jsx("div",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary mb-[var(--spacing-0-5)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[12px] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2 mb-[var(--spacing-2)]",children:t.goal}),o>0&&e.jsx($,{completed:p,total:o,color:m}),t.status==="executing"&&c>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] mt-[var(--spacing-1-5)]",style:{color:m},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse motion-reduce:animate-none",style:{backgroundColor:m}}),"Wave ",c," active"]}),y&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(196, 101, 85, 0.1)",color:"var(--color-status-blocked)"},children:[t.verification.gaps.length," Gap",t.verification.gaps.length>1?"s":""]}),a&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"var(--color-accent-blue)"},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"var(--color-accent-blue)"}}),"Advance recommended"]}),u>0&&e.jsxs(W,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"rgba(184, 149, 64, 0.1)",color:"#B89540"},title:`${u} issue(s) running — view in Kanban`,children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"#B89540"}}),u," running"]}),f.length>0&&u===0&&e.jsxs(W,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:[f.length," issue",f.length>1?"s":""]})]}),i&&e.jsx("div",{className:"mt-[var(--spacing-1)] flex flex-col gap-[var(--spacing-1)]",children:l?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"Loading tasks..."}):r.length===0?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"No tasks"}):r.map(g=>e.jsx("div",{onClick:()=>s==null?void 0:s({type:"task",task:g,phaseId:t.phase}),children:e.jsx(de,{task:{id:g.id,title:g.title,type:g.type,status:g.meta.status}})},g.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(t.phase))},className:"rounded-[8px] px-[var(--spacing-3)] py-[var(--spacing-2)] cursor-pointer transition-all duration-[var(--duration-normal)] hover:shadow-[0_2px_8px_rgba(0,0,0,0.04)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)] opacity-60 hover:opacity-80",style:{border:"1px dashed var(--color-border)",backgroundColor:"transparent"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(T,{status:t.status,cardVariant:!0}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary",children:t.title})]}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]})})}const P=4;function ge({color:t,phases:s,label:a,onSelectTask:n}){const[i,x]=v.useState(!1),r=[...s].sort((c,m)=>(m.plan.task_count||0)-(c.plan.task_count||0)),l=r.length>P,p=i||!l?r:r.slice(0,P),o=r.length-P;return e.jsxs("div",{className:"flex flex-col w-[280px] shrink-0 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:t}}),e.jsx("span",{className:"text-[12px] font-[var(--font-weight-semibold)] text-text-primary",children:a}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card px-[var(--spacing-1-5)] rounded-full",children:s.length})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-2)] pb-[var(--spacing-2)] flex flex-col gap-[var(--spacing-2)]",children:[p.map(c=>e.jsx(pe,{phase:c,onSelectTask:n},c.phase)),l&&e.jsx("button",{type:"button",onClick:()=>x(!i),className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-tertiary hover:text-text-secondary py-[var(--spacing-1-5)] cursor-pointer transition-colors text-center",children:i?"Show less":`+${o} more`})]})]})}function ue(){var p;const t=j(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.filter(o=>o.status==="completed").length,n=s.length,i=s.reduce((o,c)=>o+c.execution.tasks_completed,0),x=s.reduce((o,c)=>o+c.execution.tasks_total,0),r=x>0?Math.round(i/x*100):0,l=((p=t==null?void 0:t.project)==null?void 0:p.current_milestone)??"";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-5)] px-[var(--spacing-5)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary text-[12px] shrink-0",children:[l&&e.jsx("span",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:l}),e.jsxs("span",{className:"text-text-secondary",children:["Phases: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[a,"/",n]})," complete"]}),e.jsxs("span",{className:"text-text-secondary",children:["Tasks: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[i,"/",x]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] w-36",children:[e.jsx("div",{className:"flex-1 h-1 rounded-full bg-border overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${r}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary font-mono tabular-nums",children:[r,"%"]})]})]})}const z=[{status:"pending",label:"Pending",match:["not_started","pending"]},{status:"exploring",label:"Exploring",match:["exploring"]},{status:"planning",label:"Planning",match:["planning"]},{status:"executing",label:"Executing",match:["executing"]},{status:"verifying",label:"Verifying",match:["verifying","testing"]},{status:"completed",label:"Complete",match:["completed"]}];function me(t){const s=new Map;for(const a of z)s.set(a.status,[]);for(const a of t){const n=z.find(i=>i.match.includes(a.status));n&&s.get(n.status).push(a)}return s}function he({onSelectTask:t}){const s=j(r=>{var l;return((l=r.board)==null?void 0:l.phases)??[]}),a=v.useMemo(()=>me(s),[s]),[n,i]=v.useState(()=>new Set(["completed"])),x=v.useCallback(r=>{i(l=>{const p=new Set(l);return p.has(r)?p.delete(r):p.add(r),p})},[]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(le,{phases:s,hiddenCols:n,onToggleCol:x}),e.jsxs("div",{className:"flex gap-[var(--spacing-2-5)] flex-1 overflow-x-auto px-[var(--spacing-3)] py-[var(--spacing-3)]",children:[z.map(r=>n.has(r.status)?null:e.jsx(ge,{status:r.status,color:h[r.status],label:r.label,phases:a.get(r.status)??[],onSelectTask:t},r.status)),n.size===z.length&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"All columns hidden — click a category tag above to show it."})]}),e.jsx(ue,{})]})}const ve=6,fe=Array.from({length:ve},(t,s)=>`Week ${s+1}`),V={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},be={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function ye({phaseId:t,onSelectTask:s}){const{tasks:a,loading:n}=E(t);return n?e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("div",{className:"pl-[var(--spacing-6)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading..."}),e.jsx("div",{})]}):a.length===0?null:e.jsx(e.Fragment,{children:a.map(i=>e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider bg-[rgba(0,0,0,0.02)] cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>s==null?void 0:s({type:"task",task:i,phaseId:t}),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] pl-[var(--spacing-6)] text-[length:var(--font-size-xs)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:V[i.meta.status]??"var(--color-status-pending)"}}),e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary shrink-0",children:i.id}),e.jsx("span",{className:"text-text-secondary truncate",children:i.title}),e.jsx("span",{className:"ml-auto pr-[var(--spacing-3)] text-[length:10px] font-[var(--font-weight-medium)] shrink-0",style:{color:V[i.meta.status]??"var(--color-text-tertiary)"},children:be[i.meta.status]??i.meta.status})]}),e.jsx("div",{})]},i.id))})}function je({onSelectPhase:t,onSelectTask:s}){const a=j(d=>d.board),[n,i]=v.useState(new Set);if(!a||a.phases.length===0)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases to display"});const x=a.phases,r=x.length,l=x.reduce((d,f)=>d+f.execution.tasks_total,0),p=x.reduce((d,f)=>d+f.execution.tasks_completed,0),o=l>0?Math.round(p/l*100):0,c=x.find(d=>d.status==="executing"),m=c?x.indexOf(c):-1,y=m>=0&&c?(()=>{const d=m/r*100,f=1/r*100,u=c.execution.tasks_total>0?c.execution.tasks_completed/c.execution.tasks_total:0;return d+f*u})():-1;function b(d){i(f=>{const u=new Set(f);return u.has(d)?u.delete(d):u.add(d),u})}return e.jsxs("div",{className:"p-[var(--spacing-4)] h-full overflow-auto",children:[e.jsxs("div",{className:"grid border-b border-border pb-[var(--spacing-2)] mb-[var(--spacing-1)]",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("span",{className:"text-[length:11px] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-[0.04em]",children:"Phase"}),e.jsx("div",{className:"flex justify-between",children:fe.map(d=>e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:d},d))})]}),x.map((d,f)=>{const u=h[d.status],g=f/r*100,k=1/r*100,N=d.execution.tasks_total>0?d.execution.tasks_completed/d.execution.tasks_total:0,K=d.status==="pending"?.5:d.status==="completed"?1:.85,L=d.plan.task_count>0,S=n.has(d.phase);return e.jsxs("div",{children:[e.jsxs("div",{className:"grid items-center py-[var(--spacing-1-5)] border-b border-border-divider cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>t(d.phase),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)]",children:[L&&e.jsx("button",{type:"button",onClick:Q=>{Q.stopPropagation(),b(d.phase)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors shrink-0","aria-label":S?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${S?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),!L&&e.jsx("span",{className:"w-4 shrink-0"}),e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u}}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary truncate",children:d.title}),e.jsxs("span",{className:"ml-auto pr-[var(--spacing-3)] font-mono text-[length:10px] text-text-tertiary",children:[d.execution.tasks_completed,"/",d.execution.tasks_total]})]}),e.jsxs("div",{className:"relative h-7 bg-bg-secondary rounded-[var(--radius-default)] overflow-visible",children:[e.jsxs("div",{className:"absolute top-1 h-5 rounded-[var(--radius-default)] flex items-center px-[var(--spacing-2)] text-[length:10px] font-[var(--font-weight-semibold)] text-white transition-[width] duration-300 ease-[var(--ease-out)]",style:{left:`${g}%`,width:`${k}%`,backgroundColor:u,opacity:K},children:[N>0&&N<1&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-[var(--radius-default)] opacity-30 bg-white",style:{width:`${N*100}%`}}),e.jsxs("span",{className:"relative z-[1] whitespace-nowrap",children:["P-",String(d.phase).padStart(2,"0"),N>0&&N<1?` (${Math.round(N*100)}%)`:""]})]}),y>=0&&(c==null?void 0:c.phase)===d.phase&&e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[var(--color-status-blocked)] z-[5] rounded-sm",style:{left:`${y}%`},children:e.jsx("span",{className:"absolute -top-[18px] -left-3 text-[length:9px] font-[var(--font-weight-semibold)] text-[var(--color-status-blocked)]",children:"Today"})})]})]}),S&&e.jsx(ye,{phaseId:d.phase,onSelectTask:s})]},d.phase)}),e.jsxs("div",{className:"mt-[var(--spacing-5)] pt-[var(--spacing-3)] border-t border-border flex items-center gap-[var(--spacing-5)]",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:"Overall:"})," ",p,"/",l," tasks complete (",o,"%)"]}),e.jsx("div",{className:"w-[200px]",children:e.jsx($,{completed:p,total:l})})]})]})}const Ne={not_started:"Pending",pending:"Pending",exploring:"Explore",planning:"Plan",executing:"Execute",verifying:"Verify",testing:"Test",completed:"Done",blocked:"Blocked"};function q(t){return t==="completed"}function G(t){return t==="executing"}function we(t){return q(t)||G(t)?1:t==="verifying"||t==="testing"||t==="planning"?.7:t==="exploring"?.5:.4}function ke({phases:t}){return e.jsx("div",{className:"flex items-center gap-0 px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border bg-bg-primary overflow-x-auto shrink-0",children:t.map((s,a)=>{const n=h[s.status],i=q(s.status),x=G(s.status),r=we(s.status);return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1 shrink-0 cursor-pointer group",children:[e.jsxs("div",{className:"relative w-[42px] h-[42px] rounded-[12px] flex items-center justify-center text-[length:var(--font-size-sm)] font-bold text-white transition-transform duration-200 group-hover:scale-110",style:{backgroundColor:n,opacity:r},children:[i?e.jsx(A,{size:18,strokeWidth:2.5}):s.phase,x&&e.jsx("span",{className:"absolute -inset-1 rounded-[14px] border-2 animate-pulse opacity-30",style:{borderColor:n}})]}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] max-w-[80px] text-center truncate text-text-tertiary",style:x?{color:n,fontWeight:700}:void 0,children:s.title}),e.jsx("span",{className:"text-[8px] font-[var(--font-weight-semibold)] uppercase tracking-wide px-[5px] py-px rounded-full",style:{backgroundColor:`color-mix(in srgb, ${n} 12%, transparent)`,color:n},children:Ne[s.status]})]}),a<t.length-1&&e.jsxs("div",{className:"relative w-10 h-0.5 shrink-0 mb-[22px]",children:[e.jsx("div",{className:"absolute inset-0 bg-border"}),i&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-sm",style:{width:"100%",backgroundColor:"var(--color-status-completed)"}}),!i&&e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[5px] border-l-border"})]})]},s.phase)})})}const Ce={not_started:"/maestro-analyze {N}",pending:"/maestro-analyze {N}",exploring:"/maestro-plan {N}",planning:"/maestro-execute {N}",executing:"/maestro-execute {N}",verifying:"/quality-review {N}",testing:"/quality-test {N}",completed:"/maestro-milestone-audit",blocked:"/quality-debug"};function ze(t){const s=t.filter(a=>a.status!=="completed"&&a.status!=="blocked");return s.length===0?null:s.reduce((a,n)=>n.phase<a.phase?n:a,s[0])}function Se({phase:t}){const[s,a]=v.useState(!1),n=v.useRef(null);if(v.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),!t)return e.jsx("div",{className:"text-[length:var(--font-size-sm)] text-text-tertiary italic text-center py-[var(--spacing-6)]",children:"All phases complete"});const x=(Ce[t.status]??"").replace("{N}",String(t.phase)),r=h[t.status];function l(){navigator.clipboard.writeText(x).then(()=>{a(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>a(!1),2e3)})}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white shrink-0",style:{backgroundColor:r},children:t.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"inline-block text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full mt-px",style:{backgroundColor:`${r}1a`,color:r},children:t.status.replace(/_/g," ").replace(/\b\w/g,p=>p.toUpperCase())})]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"flex-1 font-mono bg-bg-primary border border-border-divider rounded px-[var(--spacing-1-5)] py-[var(--spacing-0-5)] text-[length:var(--font-size-xs)] text-text-primary truncate",children:x}),e.jsx("button",{type:"button",onClick:l,className:"shrink-0 cursor-pointer text-text-tertiary hover:text-text-primary transition-colors text-[length:var(--font-size-xs)]",children:s?"Copied!":"Copy"})]})]})}function _e(){const t=j(a=>{var n;return((n=a.board)==null?void 0:n.phases)??[]}),s=t.find(a=>a.status==="executing")??null;return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-b-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(ie,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Active Execution"}),s&&s.execution.current_wave>0&&e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full",style:{backgroundColor:"rgba(184, 149, 64, 0.12)",color:h.executing},children:["Wave ",s.execution.current_wave]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:s?e.jsx(Pe,{phase:s}):e.jsx(Se,{phase:ze(t)})})]})}function Pe({phase:t}){const{tasks_completed:s,tasks_total:a,current_wave:n}=t.execution,i=a>0?Math.round(s/a*100):0,x=h[t.status];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-3)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white",style:{backgroundColor:x},children:t.phase}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-base)] font-bold text-text-primary",children:t.title}),t.goal&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t.goal})]})]}),e.jsxs("div",{className:"mb-[var(--spacing-3-5)]",children:[e.jsx("div",{className:"h-1.5 bg-border rounded-full overflow-hidden mb-1",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${i}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("div",{className:"flex justify-between text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[s," of ",a," tasks complete"]}),e.jsxs("span",{children:[i,"%"]})]})]}),n>0&&e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:["Wave ",n]}),t.plan.task_ids.length>0&&e.jsx("div",{className:"flex flex-col gap-1",children:t.plan.task_ids.map(r=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] bg-bg-primary border border-border-divider text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0 bg-text-quaternary"}),e.jsx("span",{className:"flex-1 text-text-primary font-[var(--font-weight-medium)] truncate",children:r}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-quaternary",children:r})]},r))})]})}const Te={not_started:"Not Started",pending:"Pending",exploring:"Exploring",planning:"Planning",executing:"Executing",verifying:"Verifying",testing:"Testing",completed:"Completed",blocked:"Blocked"};function Ee(){const t=j(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(F,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Phase Queue"}),e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-border-subtle text-text-secondary",children:[t.length," phases"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:t.map(s=>{const a=h[s.status],{tasks_completed:n,tasks_total:i,current_wave:x}=s.execution,r=i>0?Math.round(n/i*100):0,l=s.status==="executing",p=s.status==="completed";let o=Te[s.status];return l&&x>0&&(o+=` -- Wave ${x}`),s.verification.gaps.length>0&&(o+=` -- ${s.verification.gaps.length} gap(s)`),e.jsxs("div",{className:["flex items-center gap-[var(--spacing-2-5)] px-[var(--spacing-2-5)] py-[var(--spacing-2)] rounded-[var(--radius-md)] cursor-pointer transition-all duration-150 mb-0.5",l?"bg-[var(--color-tint-executing)]":"hover:bg-bg-primary"].join(" "),children:[e.jsx("div",{className:"w-6 h-6 rounded-[7px] flex items-center justify-center text-[length:var(--font-size-xs)] font-bold text-white shrink-0",style:{backgroundColor:a},children:p?e.jsx(A,{size:12,strokeWidth:2.5}):s.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate",children:s.title}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",style:l?{color:a}:void 0,children:o})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] font-mono text-text-tertiary",style:p?{color:a}:void 0,children:[n,"/",i]}),e.jsx("div",{className:"w-10 h-[3px] bg-border rounded-full overflow-hidden mt-0.5",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,backgroundColor:a}})})]})]},s.phase)})})]})}function $e(){const t=j(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.reduce((o,c)=>o+c.execution.tasks_completed,0),n=s.reduce((o,c)=>o+c.execution.tasks_total,0),i=s.filter(o=>o.status==="completed").length,x=s.length,r=s.reduce((o,c)=>o+c.execution.commits.length,0),l=s.filter(o=>o.status==="verifying"||o.status==="testing"),p=s.flatMap(o=>o.verification.gaps.map(c=>({phase:o.phase,text:typeof c=="string"?c:c.description??c.id??JSON.stringify(c)})));return e.jsxs("div",{className:"flex flex-col overflow-hidden border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(O,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Quality"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-[var(--spacing-2)] mb-[var(--spacing-3-5)]",children:[e.jsx(C,{label:"Tasks",value:a,sub:`/${n}`,detail:`${n>0?Math.round(a/n*100):0}% complete`}),e.jsx(C,{label:"Phases",value:i,sub:`/${x}`,detail:`${x>0?Math.round(i/x*100):0}% complete`}),e.jsx(C,{label:"Gaps",value:p.length,color:p.length>0?h.blocked:void 0,detail:"active"}),e.jsx(C,{label:"Commits",value:r,detail:"this milestone"})]}),l.length>0&&e.jsx("div",{className:"mb-[var(--spacing-3-5)]",children:l.map(o=>e.jsxs("div",{className:"mb-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:[e.jsx(O,{size:12,strokeWidth:2,style:{color:h[o.status]}}),"Verification (P-",String(o.phase).padStart(2,"0"),")"]}),o.verification.must_haves.map((c,m)=>{const b=o.verification.gaps.map(d=>typeof d=="string"?d:d.description??d.id??"").includes(c);return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] py-1 border-b border-border-divider text-[length:var(--font-size-sm)]",children:[b?e.jsx(ae,{size:12,strokeWidth:2.5,style:{color:h.blocked}}):e.jsx(A,{size:12,strokeWidth:2.5,style:{color:h.completed}}),e.jsx("span",{className:"flex-1 text-text-secondary",children:c}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)]",style:{color:b?h.blocked:h.completed},children:b?"Gap":"Verified"})]},m)})]},o.phase))}),s.some(o=>o.validation.test_coverage!==null)&&e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:"Test Coverage"}),s.filter(o=>o.validation.test_coverage!==null).map(o=>{const c=o.validation.test_coverage,m=typeof c=="number"?c:typeof c=="object"&&c!==null?c.statements??0:0,y=m>=80?h.completed:m>=60?h.executing:h.verifying;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)] mb-1",children:[e.jsxs("span",{className:"w-[70px] text-text-tertiary font-[var(--font-weight-medium)]",children:["P-",String(o.phase).padStart(2,"0")]}),e.jsx("div",{className:"flex-1 h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${m}%`,backgroundColor:y}})}),e.jsxs("span",{className:"w-9 text-right font-mono font-[var(--font-weight-semibold)] text-text-secondary",children:[m.toFixed(1),"%"]})]},o.phase)})]})]})]})}function C({label:t,value:s,sub:a,detail:n,color:i}){return e.jsxs("div",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] rounded-[10px] bg-bg-primary border border-border-divider",children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wide text-text-tertiary mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary",style:i?{color:i}:void 0,children:[s,a&&e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-tertiary",children:a})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary mt-0.5",children:n})]})}function Ae(t){const s=[];for(const a of t){const n=h[a.status],i=`P-${String(a.phase).padStart(2,"0")} ${a.title}`;a.status==="executing"&&a.execution.current_wave>0&&s.push({color:n,time:"",text:`Wave ${a.execution.current_wave} active -- ${i}`}),a.status==="verifying"&&a.verification.gaps.length>0&&s.push({color:h.blocked,time:"",text:`${a.verification.gaps.length} gap(s) -- ${i}`}),a.status==="completed"&&s.push({color:n,time:"",text:`Completed -- ${i}`})}return s.slice(0,6)}function Le(){const t=j(a=>{var n;return((n=a.board)==null?void 0:n.phases)??[]}),s=Ae(t);return s.length===0?null:e.jsxs("div",{className:"col-span-full flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary overflow-x-auto shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-quaternary whitespace-nowrap",children:"Activity"}),s.map((a,n)=>e.jsxs("span",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap shrink-0",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0",style:{backgroundColor:a.color}}),a.text,n<s.length-1&&e.jsx("span",{className:"inline-block w-px h-3.5 bg-border-divider ml-[var(--spacing-4)]"})]},n))]})}function We(){const t=j(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(ke,{phases:t}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_1fr_320px] grid-rows-[1fr_auto] overflow-hidden",children:[e.jsx(_e,{}),e.jsx(Ee,{}),e.jsx($e,{}),e.jsx(Le,{})]})]})}const w="text-left px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-wide",D={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},Oe={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function Be({phaseId:t,onSelectTask:s}){const{tasks:a,loading:n}=E(t);return n?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading tasks..."})}):a.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"No tasks"})}):e.jsx(e.Fragment,{children:a.map(i=>e.jsxs("tr",{className:"bg-[rgba(0,0,0,0.03)] border-t border-border-divider cursor-pointer hover:bg-bg-hover transition-colors",onClick:()=>s==null?void 0:s({type:"task",task:i,phaseId:t}),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] pl-[var(--spacing-6)]",children:e.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:D[i.meta.status]??"var(--color-status-pending)"}})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:i.id}),e.jsx("td",{colSpan:2,className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-primary",children:i.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-center hidden sm:table-cell",children:e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums",children:["W",i.meta.wave]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-right hidden sm:table-cell",children:e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)]",style:{color:D[i.meta.status]??"var(--color-text-tertiary)"},children:Oe[i.meta.status]??i.meta.status})})]},i.id))})}function Ie({onSelectTask:t}){const s=j(r=>{var l;return((l=r.board)==null?void 0:l.phases)??[]}),[a,n]=v.useState(new Set),i=v.useMemo(()=>[...s].sort((r,l)=>r.phase-l.phase),[s]);function x(r){n(l=>{const p=new Set(l);return p.has(r)?p.delete(r):p.add(r),p})}return i.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases available"}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary",children:"All Phases"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card rounded-full px-[var(--spacing-1-5)] tabular-nums",children:i.length}),e.jsx("div",{className:"ml-auto flex items-center gap-[var(--spacing-3)]",children:["executing","verifying","planning","completed"].map(r=>{const l=i.filter(p=>p.status===r||r==="verifying"&&p.status==="testing").length;return l===0?null:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:h[r]}}),e.jsx("span",{className:"text-[length:10px] text-text-secondary tabular-nums",children:l})]},r)})})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:"sticky top-0 z-10",children:e.jsxs("tr",{className:"bg-bg-secondary border-b border-border-divider",children:[e.jsx("th",{className:`${w} w-[60px]`,children:"#"}),e.jsx("th",{className:`${w} w-[120px]`,children:"Status"}),e.jsx("th",{className:w,children:"Title"}),e.jsx("th",{className:`${w} hidden lg:table-cell`,children:"Goal"}),e.jsx("th",{className:`${w} w-[60px] text-center hidden sm:table-cell`,children:"Wave"}),e.jsx("th",{className:`${w} text-right w-[130px] hidden sm:table-cell`,children:"Progress"})]})}),e.jsx("tbody",{children:i.map((r,l)=>{const{tasks_completed:p,tasks_total:o,current_wave:c}=r.execution,m=a.has(r.phase),y=r.plan.task_count>0;return e.jsxs(v.Fragment,{children:[e.jsxs("tr",{className:["border-t border-border-divider transition-colors",l%2===0?"bg-bg-primary":"bg-[rgba(0,0,0,0.015)]"].join(" "),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[y&&e.jsx("button",{type:"button",onClick:()=>x(r.phase),className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":m?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${m?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),"P-",String(r.phase).padStart(2,"0")]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(T,{status:r.status,cardVariant:!0})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:r.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary hidden lg:table-cell max-w-[320px]",children:e.jsx("span",{className:"line-clamp-1",children:r.goal})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-center hidden sm:table-cell",children:r.status==="executing"&&c>0?e.jsxs("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] tabular-nums",style:{color:h.executing},children:["W",c]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"—"})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] hidden sm:table-cell",children:o>0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] justify-end",children:[e.jsx("div",{className:"w-[56px]",children:e.jsx($,{completed:p,total:o,color:h[r.status]})}),e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums w-[32px] text-right shrink-0",children:[p,"/",o]})]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary block text-right",children:"—"})})]}),m&&e.jsx(Be,{phaseId:r.phase,onSelectTask:t})]},r.phase)})})]})})]})}const M=[{id:"init",label:"Initialize Project",command:"/maestro-init",description:"Set up project configuration and workspace",done:t=>!!(t!=null&&t.project_name&&t.project_name!=="")},{id:"roadmap",label:"Create Roadmap",command:"/maestro-roadmap",description:"Define phases and milestones for your project",done:t=>!1},{id:"plan",label:"Plan Phase 1",command:"/maestro-plan 1",description:"Create execution plan for the first phase",done:t=>!1}];function Re({project:t}){var x;const[s,a]=v.useState(null),n=((x=M.find(r=>!r.done(t)))==null?void 0:x.id)??null;function i(r){navigator.clipboard.writeText(r.command).catch(()=>{}),a(r.id),setTimeout(()=>a(l=>l===r.id?null:l),2e3)}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] px-[var(--spacing-6)] py-[var(--spacing-6)] h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-1)]",children:[e.jsx("h2",{className:"text-[length:var(--font-size-lg)] font-bold text-text-primary",children:"Project Setup"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:"Run these commands to initialize your project"})]}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-3)]",children:M.map(r=>{const l=r.done(t),p=r.id===n,o=l?"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)] opacity-60":p?"rounded-[var(--radius-lg)] border border-border-focus bg-bg-secondary p-[var(--spacing-4)]":"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)]";return e.jsx("div",{className:o,children:e.jsxs("div",{className:"flex items-start gap-[var(--spacing-3)]",children:[e.jsx("div",{className:"flex-shrink-0 mt-[var(--spacing-0-5)]",children:l?e.jsx("span",{className:"text-[#5A9E78] text-[length:var(--font-size-base)] font-bold leading-none",children:"✓"}):e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-base)] leading-none",children:"○"})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:r.label}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:r.description}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"font-mono text-[length:var(--font-size-sm)] bg-bg-primary border border-border-divider rounded px-[var(--spacing-2)] py-[var(--spacing-0-5)] text-text-primary",children:r.command}),e.jsx("button",{type:"button",onClick:()=>i(r),className:"cursor-pointer text-text-tertiary hover:text-text-primary text-[length:var(--font-size-sm)] transition-colors",children:s===r.id?"Copied!":"Copy"})]})]})]})},r.id)})})]})}const U=["board","timeline","center","table"];function Qe(){const[t,s]=v.useState("board"),[a,n]=v.useState(null),{register:i,unregister:x}=v.useContext(J),{phases:r,board:l,selectedPhase:p,setSelectedPhase:o}=j(Z(u=>{var g;return{phases:((g=u.board)==null?void 0:g.phases)??[],board:u.board,selectedPhase:u.selectedPhase,setSelectedPhase:u.setSelectedPhase}})),c=v.useCallback(u=>{s(U[u]),o(null),n(null)},[o]),m=v.useCallback(u=>{n(u),o(null)},[o]),y=v.useMemo(()=>({items:[{label:"Board",icon:e.jsx(re,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Timeline",icon:e.jsx(F,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Center",icon:e.jsx(Y,{size:14,strokeWidth:2}),shortcut:"3"},{label:"Table",icon:e.jsx(ee,{size:14,strokeWidth:2}),shortcut:"4"}],activeIndex:U.indexOf(t),onSwitch:c}),[t,c]);v.useEffect(()=>{i(y)},[y,i]),v.useEffect(()=>()=>x(),[x]);const b=a??(p!==null?{type:"phase",phaseId:p}:null),d=b!==null,f=(b==null?void 0:b.type)==="task"?"Task Detail":"Phase Detail";return e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:r.length===0?e.jsx(Re,{project:l==null?void 0:l.project}):e.jsxs(e.Fragment,{children:[t==="board"&&e.jsx(he,{onSelectTask:m}),t==="timeline"&&e.jsx(je,{onSelectPhase:u=>{n(null),o(p===u?null:u)},onSelectTask:m}),t==="center"&&e.jsx(We,{}),t==="table"&&e.jsx(Ie,{onSelectTask:m})]})}),e.jsx(te,{open:d,onClose:()=>{o(null),n(null)},title:f,children:b!==null&&e.jsx(se,{selectedItem:b})})]})})}export{Qe as WorkflowPage};