claude-code-workflow 7.2.18 → 7.2.20

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 (200) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +33 -8
  2. package/.codex/skills/analyze-with-file/SKILL.md +55 -8
  3. package/ccw/dist/core/routes/agent-definitions-routes.d.ts.map +1 -1
  4. package/ccw/dist/core/routes/agent-definitions-routes.js +152 -6
  5. package/ccw/dist/core/routes/agent-definitions-routes.js.map +1 -1
  6. package/ccw/frontend/dist/assets/{AlertDialog-5DA_OF9w.js → AlertDialog-Cukb0xv2.js} +2 -2
  7. package/ccw/frontend/dist/assets/{AlertDialog-5DA_OF9w.js.map → AlertDialog-Cukb0xv2.js.map} +1 -1
  8. package/ccw/frontend/dist/assets/{AnalysisPage-MoK5luZM.js → AnalysisPage-Ddmv0J4x.js} +2 -2
  9. package/ccw/frontend/dist/assets/{AnalysisPage-MoK5luZM.js.map → AnalysisPage-Ddmv0J4x.js.map} +1 -1
  10. package/ccw/frontend/dist/assets/{ApiSettingsPage-OreSF7CY.js → ApiSettingsPage-DMkrTZDX.js} +2 -2
  11. package/ccw/frontend/dist/assets/{ApiSettingsPage-OreSF7CY.js.map → ApiSettingsPage-DMkrTZDX.js.map} +1 -1
  12. package/ccw/frontend/dist/assets/{CliModeToggle-B_Vu8NDb.js → CliModeToggle-DXenjpbe.js} +2 -2
  13. package/ccw/frontend/dist/assets/{CliModeToggle-B_Vu8NDb.js.map → CliModeToggle-DXenjpbe.js.map} +1 -1
  14. package/ccw/frontend/dist/assets/{CliSessionSharePage-Bb3DrLGF.js → CliSessionSharePage-B-ZIMqmX.js} +2 -2
  15. package/ccw/frontend/dist/assets/{CliSessionSharePage-Bb3DrLGF.js.map → CliSessionSharePage-B-ZIMqmX.js.map} +1 -1
  16. package/ccw/frontend/dist/assets/{CliViewerPage-BS4zrFVp.js → CliViewerPage-9YxGyLxh.js} +2 -2
  17. package/ccw/frontend/dist/assets/{CliViewerPage-BS4zrFVp.js.map → CliViewerPage-9YxGyLxh.js.map} +1 -1
  18. package/ccw/frontend/dist/assets/{CodexLensPage-BWSIk06e.js → CodexLensPage-B_uv5wdn.js} +2 -2
  19. package/ccw/frontend/dist/assets/{CodexLensPage-BWSIk06e.js.map → CodexLensPage-B_uv5wdn.js.map} +1 -1
  20. package/ccw/frontend/dist/assets/{Collapsible-Cw1zJkjU.js → Collapsible-C2qk3yV0.js} +2 -2
  21. package/ccw/frontend/dist/assets/{Collapsible-Cw1zJkjU.js.map → Collapsible-C2qk3yV0.js.map} +1 -1
  22. package/ccw/frontend/dist/assets/{CommandsManagerPage-a240GHzx.js → CommandsManagerPage-DBtaWxLB.js} +2 -2
  23. package/ccw/frontend/dist/assets/{CommandsManagerPage-a240GHzx.js.map → CommandsManagerPage-DBtaWxLB.js.map} +1 -1
  24. package/ccw/frontend/dist/assets/{DeepWikiPage-CZ4pN-5G.js → DeepWikiPage-d9K4_TgG.js} +2 -2
  25. package/ccw/frontend/dist/assets/{DeepWikiPage-CZ4pN-5G.js.map → DeepWikiPage-d9K4_TgG.js.map} +1 -1
  26. package/ccw/frontend/dist/assets/{EndpointsPage-Ct66AIze.js → EndpointsPage-DhW6hYrI.js} +2 -2
  27. package/ccw/frontend/dist/assets/{EndpointsPage-Ct66AIze.js.map → EndpointsPage-DhW6hYrI.js.map} +1 -1
  28. package/ccw/frontend/dist/assets/{ExplorerPage-DAZkXx2Q.js → ExplorerPage-DYYpCvtB.js} +2 -2
  29. package/ccw/frontend/dist/assets/{ExplorerPage-DAZkXx2Q.js.map → ExplorerPage-DYYpCvtB.js.map} +1 -1
  30. package/ccw/frontend/dist/assets/{FixSessionPage-cDE32BH8.js → FixSessionPage-CSmiT5SE.js} +2 -2
  31. package/ccw/frontend/dist/assets/{FixSessionPage-cDE32BH8.js.map → FixSessionPage-CSmiT5SE.js.map} +1 -1
  32. package/ccw/frontend/dist/assets/{FloatingFileBrowser-tgDOT5P0.js → FloatingFileBrowser-DvMsXLdP.js} +2 -2
  33. package/ccw/frontend/dist/assets/{FloatingFileBrowser-tgDOT5P0.js.map → FloatingFileBrowser-DvMsXLdP.js.map} +1 -1
  34. package/ccw/frontend/dist/assets/{FloatingPanel-Diyvdyo1.js → FloatingPanel-sqezhSI8.js} +2 -2
  35. package/ccw/frontend/dist/assets/{FloatingPanel-Diyvdyo1.js.map → FloatingPanel-sqezhSI8.js.map} +1 -1
  36. package/ccw/frontend/dist/assets/{GraphExplorerPage-CPwRsfd2.js → GraphExplorerPage-DS8ghMFM.js} +2 -2
  37. package/ccw/frontend/dist/assets/{GraphExplorerPage-CPwRsfd2.js.map → GraphExplorerPage-DS8ghMFM.js.map} +1 -1
  38. package/ccw/frontend/dist/assets/{HistoryPage-D2F7j-xY.js → HistoryPage-B-x1RyHu.js} +2 -2
  39. package/ccw/frontend/dist/assets/{HistoryPage-D2F7j-xY.js.map → HistoryPage-B-x1RyHu.js.map} +1 -1
  40. package/ccw/frontend/dist/assets/{HookManagerPage-Cq_CqegO.js → HookManagerPage-BbxpDb68.js} +2 -2
  41. package/ccw/frontend/dist/assets/{HookManagerPage-Cq_CqegO.js.map → HookManagerPage-BbxpDb68.js.map} +1 -1
  42. package/ccw/frontend/dist/assets/{InstallationsPage-DeBLZFZg.js → InstallationsPage-3bShz_Ai.js} +2 -2
  43. package/ccw/frontend/dist/assets/{InstallationsPage-DeBLZFZg.js.map → InstallationsPage-3bShz_Ai.js.map} +1 -1
  44. package/ccw/frontend/dist/assets/{IssueHubPage-DqytkqBW.js → IssueHubPage-BQY_Hh3e.js} +2 -2
  45. package/ccw/frontend/dist/assets/{IssueHubPage-DqytkqBW.js.map → IssueHubPage-BQY_Hh3e.js.map} +1 -1
  46. package/ccw/frontend/dist/assets/{LiteTasksPage-BOknokuo.js → LiteTasksPage-vD_8fQcR.js} +17 -22
  47. package/ccw/frontend/dist/assets/LiteTasksPage-vD_8fQcR.js.map +1 -0
  48. package/ccw/frontend/dist/assets/{McpManagerPage-DPF421ki.js → McpManagerPage-CI5ZzB8A.js} +2 -2
  49. package/ccw/frontend/dist/assets/{McpManagerPage-DPF421ki.js.map → McpManagerPage-CI5ZzB8A.js.map} +1 -1
  50. package/ccw/frontend/dist/assets/{MemoryPage-CK-QH9cl.js → MemoryPage-CNuj2eNg.js} +2 -2
  51. package/ccw/frontend/dist/assets/{MemoryPage-CK-QH9cl.js.map → MemoryPage-CNuj2eNg.js.map} +1 -1
  52. package/ccw/frontend/dist/assets/{NotFoundPage-Bk_u5rzz.js → NotFoundPage-BrnAXkb1.js} +2 -2
  53. package/ccw/frontend/dist/assets/{NotFoundPage-Bk_u5rzz.js.map → NotFoundPage-BrnAXkb1.js.map} +1 -1
  54. package/ccw/frontend/dist/assets/{OrchestratorPage-B9ND5ptW.js → OrchestratorPage-CH81PGt4.js} +2 -2
  55. package/ccw/frontend/dist/assets/{OrchestratorPage-B9ND5ptW.js.map → OrchestratorPage-CH81PGt4.js.map} +1 -1
  56. package/ccw/frontend/dist/assets/{ProjectOverviewPage-0DUpa-rl.js → ProjectOverviewPage-dwiEXl2O.js} +2 -2
  57. package/ccw/frontend/dist/assets/{ProjectOverviewPage-0DUpa-rl.js.map → ProjectOverviewPage-dwiEXl2O.js.map} +1 -1
  58. package/ccw/frontend/dist/assets/{PromptHistoryPage-B--0N_wr.js → PromptHistoryPage-CabgLjJU.js} +2 -2
  59. package/ccw/frontend/dist/assets/{PromptHistoryPage-B--0N_wr.js.map → PromptHistoryPage-CabgLjJU.js.map} +1 -1
  60. package/ccw/frontend/dist/assets/{ReviewSessionPage-DJtY0kQl.js → ReviewSessionPage-DAMrNFn8.js} +2 -2
  61. package/ccw/frontend/dist/assets/{ReviewSessionPage-DJtY0kQl.js.map → ReviewSessionPage-DAMrNFn8.js.map} +1 -1
  62. package/ccw/frontend/dist/assets/{RulesManagerPage-yW19Un_V.js → RulesManagerPage-4jzmxPn0.js} +2 -2
  63. package/ccw/frontend/dist/assets/{RulesManagerPage-yW19Un_V.js.map → RulesManagerPage-4jzmxPn0.js.map} +1 -1
  64. package/ccw/frontend/dist/assets/{SessionDetailPage-tr8g0Hc1.js → SessionDetailPage-C5Btktmp.js} +2 -2
  65. package/ccw/frontend/dist/assets/{SessionDetailPage-tr8g0Hc1.js.map → SessionDetailPage-C5Btktmp.js.map} +1 -1
  66. package/ccw/frontend/dist/assets/{SessionsPage-CxDytLfb.js → SessionsPage-CQIB4E8m.js} +2 -2
  67. package/ccw/frontend/dist/assets/{SessionsPage-CxDytLfb.js.map → SessionsPage-CQIB4E8m.js.map} +1 -1
  68. package/ccw/frontend/dist/assets/SettingsPage-Yi9UAfm7.js +150 -0
  69. package/ccw/frontend/dist/assets/SettingsPage-Yi9UAfm7.js.map +1 -0
  70. package/ccw/frontend/dist/assets/{SkillsManagerPage-C0MOJy-C.js → SkillsManagerPage-BqfvYSkT.js} +2 -2
  71. package/ccw/frontend/dist/assets/{SkillsManagerPage-C0MOJy-C.js.map → SkillsManagerPage-BqfvYSkT.js.map} +1 -1
  72. package/ccw/frontend/dist/assets/{SpecsSettingsPage-D9Y6-U-n.js → SpecsSettingsPage-BdVPM5R6.js} +4 -4
  73. package/ccw/frontend/dist/assets/{SpecsSettingsPage-D9Y6-U-n.js.map → SpecsSettingsPage-BdVPM5R6.js.map} +1 -1
  74. package/ccw/frontend/dist/assets/{Switch-BEfkMCxZ.js → Switch-BG929kV0.js} +2 -2
  75. package/ccw/frontend/dist/assets/{Switch-BEfkMCxZ.js.map → Switch-BG929kV0.js.map} +1 -1
  76. package/ccw/frontend/dist/assets/{TabsNavigation-Dit0DM3m.js → TabsNavigation-Bol1y09b.js} +2 -2
  77. package/ccw/frontend/dist/assets/{TabsNavigation-Dit0DM3m.js.map → TabsNavigation-Bol1y09b.js.map} +1 -1
  78. package/ccw/frontend/dist/assets/{TaskDrawer-XN-D_bDk.js → TaskDrawer-Dwutrn8_.js} +2 -2
  79. package/ccw/frontend/dist/assets/{TaskDrawer-XN-D_bDk.js.map → TaskDrawer-Dwutrn8_.js.map} +1 -1
  80. package/ccw/frontend/dist/assets/{TeamPage-BOwkjrDi.js → TeamPage-CpCSwpxD.js} +2 -2
  81. package/ccw/frontend/dist/assets/{TeamPage-BOwkjrDi.js.map → TeamPage-CpCSwpxD.js.map} +1 -1
  82. package/ccw/frontend/dist/assets/{TerminalDashboardPage-X8RymrSN.js → TerminalDashboardPage-DODKjOeK.js} +2 -2
  83. package/ccw/frontend/dist/assets/{TerminalDashboardPage-X8RymrSN.js.map → TerminalDashboardPage-DODKjOeK.js.map} +1 -1
  84. package/ccw/frontend/dist/assets/{archive-BMXBzq8R.js → archive-CQw634kD.js} +2 -2
  85. package/ccw/frontend/dist/assets/{archive-BMXBzq8R.js.map → archive-CQw634kD.js.map} +1 -1
  86. package/ccw/frontend/dist/assets/{archive-restore-DHvAhQBT.js → archive-restore-B-_EG6wE.js} +2 -2
  87. package/ccw/frontend/dist/assets/{archive-restore-DHvAhQBT.js.map → archive-restore-B-_EG6wE.js.map} +1 -1
  88. package/ccw/frontend/dist/assets/{arrow-right-CBObFEN0.js → arrow-right-CcQtxBrU.js} +2 -2
  89. package/ccw/frontend/dist/assets/{arrow-right-CBObFEN0.js.map → arrow-right-CcQtxBrU.js.map} +1 -1
  90. package/ccw/frontend/dist/assets/{bookmark-plus-D-2SQ5pV.js → bookmark-plus-Cl-BbcpR.js} +2 -2
  91. package/ccw/frontend/dist/assets/{bookmark-plus-D-2SQ5pV.js.map → bookmark-plus-Cl-BbcpR.js.map} +1 -1
  92. package/ccw/frontend/dist/assets/{bot-DS7saQkk.js → bot-CLSNSkW_.js} +2 -2
  93. package/ccw/frontend/dist/assets/{bot-DS7saQkk.js.map → bot-CLSNSkW_.js.map} +1 -1
  94. package/ccw/frontend/dist/assets/{braces-D0pAnktp.js → braces-DWwkaDS6.js} +2 -2
  95. package/ccw/frontend/dist/assets/{braces-D0pAnktp.js.map → braces-DWwkaDS6.js.map} +1 -1
  96. package/ccw/frontend/dist/assets/{circle-stop-FWSboNE6.js → circle-stop-DiS7e6ma.js} +2 -2
  97. package/ccw/frontend/dist/assets/{circle-stop-FWSboNE6.js.map → circle-stop-DiS7e6ma.js.map} +1 -1
  98. package/ccw/frontend/dist/assets/{cpu-BNM2uIpY.js → cpu-CuvHUVXO.js} +2 -2
  99. package/ccw/frontend/dist/assets/{cpu-BNM2uIpY.js.map → cpu-CuvHUVXO.js.map} +1 -1
  100. package/ccw/frontend/dist/assets/{ellipsis-vertical-GwdnnWQj.js → ellipsis-vertical-BoVlINSw.js} +2 -2
  101. package/ccw/frontend/dist/assets/{ellipsis-vertical-GwdnnWQj.js.map → ellipsis-vertical-BoVlINSw.js.map} +1 -1
  102. package/ccw/frontend/dist/assets/{eye-kV2pWXQ5.js → eye-BEMOdcAN.js} +2 -2
  103. package/ccw/frontend/dist/assets/{eye-kV2pWXQ5.js.map → eye-BEMOdcAN.js.map} +1 -1
  104. package/ccw/frontend/dist/assets/{eye-off-6o-KYsBM.js → eye-off-C5HS4Ytm.js} +2 -2
  105. package/ccw/frontend/dist/assets/{eye-off-6o-KYsBM.js.map → eye-off-C5HS4Ytm.js.map} +1 -1
  106. package/ccw/frontend/dist/assets/{file-json-Q4_Blhd8.js → file-json-DQ9XLq0B.js} +2 -2
  107. package/ccw/frontend/dist/assets/{file-json-Q4_Blhd8.js.map → file-json-DQ9XLq0B.js.map} +1 -1
  108. package/ccw/frontend/dist/assets/{file-text-DSroEAMu.js → file-text-TGs_qCbw.js} +2 -2
  109. package/ccw/frontend/dist/assets/{file-text-DSroEAMu.js.map → file-text-TGs_qCbw.js.map} +1 -1
  110. package/ccw/frontend/dist/assets/{filter-A5I9Xz7E.js → filter-CIuCqnDB.js} +2 -2
  111. package/ccw/frontend/dist/assets/{filter-A5I9Xz7E.js.map → filter-CIuCqnDB.js.map} +1 -1
  112. package/ccw/frontend/dist/assets/{folder-DNNgXVVH.js → folder-BkivHBwn.js} +2 -2
  113. package/ccw/frontend/dist/assets/{folder-DNNgXVVH.js.map → folder-BkivHBwn.js.map} +1 -1
  114. package/ccw/frontend/dist/assets/{gauge-PfGM68A8.js → gauge-CtM68fVY.js} +2 -2
  115. package/ccw/frontend/dist/assets/{gauge-PfGM68A8.js.map → gauge-CtM68fVY.js.map} +1 -1
  116. package/ccw/frontend/dist/assets/{globe-C3X8YQrU.js → globe-DpnrINqP.js} +2 -2
  117. package/ccw/frontend/dist/assets/{globe-C3X8YQrU.js.map → globe-DpnrINqP.js.map} +1 -1
  118. package/ccw/frontend/dist/assets/{grid-3x3-DpyJO-oF.js → grid-3x3-SjX0a5JH.js} +2 -2
  119. package/ccw/frontend/dist/assets/{grid-3x3-DpyJO-oF.js.map → grid-3x3-SjX0a5JH.js.map} +1 -1
  120. package/ccw/frontend/dist/assets/{hard-drive-C2PQHoNg.js → hard-drive-ByAmnoEg.js} +2 -2
  121. package/ccw/frontend/dist/assets/{hard-drive-C2PQHoNg.js.map → hard-drive-ByAmnoEg.js.map} +1 -1
  122. package/ccw/frontend/dist/assets/{hash-DX8VaW1j.js → hash-DbLc3VOZ.js} +2 -2
  123. package/ccw/frontend/dist/assets/{hash-DX8VaW1j.js.map → hash-DbLc3VOZ.js.map} +1 -1
  124. package/ccw/frontend/dist/assets/{history-BXaQEkhy.js → history-Botz5Z5d.js} +2 -2
  125. package/ccw/frontend/dist/assets/{history-BXaQEkhy.js.map → history-Botz5Z5d.js.map} +1 -1
  126. package/ccw/frontend/dist/assets/{index-BiN-BRcE.js → index-BGvyf4-9.js} +2 -2
  127. package/ccw/frontend/dist/assets/{index-BiN-BRcE.js.map → index-BGvyf4-9.js.map} +1 -1
  128. package/ccw/frontend/dist/assets/index-BoqylFO4.css +39 -0
  129. package/ccw/frontend/dist/assets/{index-B8K8MdMl.js → index-DP_mTJI8.js} +3 -3
  130. package/ccw/frontend/dist/assets/{index-B8K8MdMl.js.map → index-DP_mTJI8.js.map} +1 -1
  131. package/ccw/frontend/dist/assets/{index-Dpe_7YH0.js → index-MkgdhX7a.js} +2 -2
  132. package/ccw/frontend/dist/assets/{index-Dpe_7YH0.js.map → index-MkgdhX7a.js.map} +1 -1
  133. package/ccw/frontend/dist/assets/{index-4zmlzlPo.js → index-ni-tG9rm.js} +2 -2
  134. package/ccw/frontend/dist/assets/{index-4zmlzlPo.js.map → index-ni-tG9rm.js.map} +1 -1
  135. package/ccw/frontend/dist/assets/{layout-grid-CUqTukRt.js → layout-grid-11E4bGJz.js} +2 -2
  136. package/ccw/frontend/dist/assets/{layout-grid-CUqTukRt.js.map → layout-grid-11E4bGJz.js.map} +1 -1
  137. package/ccw/frontend/dist/assets/{lightbulb-h90ex0mh.js → lightbulb-8KrKY82b.js} +2 -2
  138. package/ccw/frontend/dist/assets/{lightbulb-h90ex0mh.js.map → lightbulb-8KrKY82b.js.map} +1 -1
  139. package/ccw/frontend/dist/assets/{link-2-1-DjXqTg.js → link-2-BUn6RILb.js} +2 -2
  140. package/ccw/frontend/dist/assets/{link-2-1-DjXqTg.js.map → link-2-BUn6RILb.js.map} +1 -1
  141. package/ccw/frontend/dist/assets/{link-DbyJpuls.js → link-CmP254Ai.js} +2 -2
  142. package/ccw/frontend/dist/assets/{link-DbyJpuls.js.map → link-CmP254Ai.js.map} +1 -1
  143. package/ccw/frontend/dist/assets/{list-CU0leArg.js → list-BAwzl4a2.js} +2 -2
  144. package/ccw/frontend/dist/assets/{list-CU0leArg.js.map → list-BAwzl4a2.js.map} +1 -1
  145. package/ccw/frontend/dist/assets/{map-pin-DheJ6EJB.js → map-pin-gi342rqk.js} +2 -2
  146. package/ccw/frontend/dist/assets/{map-pin-DheJ6EJB.js.map → map-pin-gi342rqk.js.map} +1 -1
  147. package/ccw/frontend/dist/assets/{messages-square-Bmo5DCr1.js → messages-square-C1Lh8q8b.js} +2 -2
  148. package/ccw/frontend/dist/assets/{messages-square-Bmo5DCr1.js.map → messages-square-C1Lh8q8b.js.map} +1 -1
  149. package/ccw/frontend/dist/assets/{minimize-2-h1gktUQ6.js → minimize-2-OgWNLKdq.js} +2 -2
  150. package/ccw/frontend/dist/assets/{minimize-2-h1gktUQ6.js.map → minimize-2-OgWNLKdq.js.map} +1 -1
  151. package/ccw/frontend/dist/assets/{package-CmuCX6Z_.js → package-Djsvs5qp.js} +2 -2
  152. package/ccw/frontend/dist/assets/{package-CmuCX6Z_.js.map → package-Djsvs5qp.js.map} +1 -1
  153. package/ccw/frontend/dist/assets/{plug-Jz5HaKIu.js → plug-DvSZP2cp.js} +2 -2
  154. package/ccw/frontend/dist/assets/{plug-Jz5HaKIu.js.map → plug-DvSZP2cp.js.map} +1 -1
  155. package/ccw/frontend/dist/assets/{power-CpN5I4BU.js → power-BY7vTLmU.js} +2 -2
  156. package/ccw/frontend/dist/assets/{power-CpN5I4BU.js.map → power-BY7vTLmU.js.map} +1 -1
  157. package/ccw/frontend/dist/assets/{save-B3iyK-h8.js → save-DXfqv84T.js} +2 -2
  158. package/ccw/frontend/dist/assets/{save-B3iyK-h8.js.map → save-DXfqv84T.js.map} +1 -1
  159. package/ccw/frontend/dist/assets/{send-CYO-YU9A.js → send-E2o2LZSX.js} +2 -2
  160. package/ccw/frontend/dist/assets/{send-CYO-YU9A.js.map → send-E2o2LZSX.js.map} +1 -1
  161. package/ccw/frontend/dist/assets/settings-2-ChD1LFHH.js +7 -0
  162. package/ccw/frontend/dist/assets/settings-2-ChD1LFHH.js.map +1 -0
  163. package/ccw/frontend/dist/assets/{square-check-big-1h37S4wz.js → square-check-big-CBymuqmD.js} +2 -2
  164. package/ccw/frontend/dist/assets/{square-check-big-1h37S4wz.js.map → square-check-big-CBymuqmD.js.map} +1 -1
  165. package/ccw/frontend/dist/assets/{square-pen-BS0-oO7y.js → square-pen-BfaiJgOX.js} +2 -2
  166. package/ccw/frontend/dist/assets/{square-pen-BS0-oO7y.js.map → square-pen-BfaiJgOX.js.map} +1 -1
  167. package/ccw/frontend/dist/assets/{star-Dal-o3Lo.js → star-DHMWqZ09.js} +2 -2
  168. package/ccw/frontend/dist/assets/{star-Dal-o3Lo.js.map → star-DHMWqZ09.js.map} +1 -1
  169. package/ccw/frontend/dist/assets/{style-wEWj0pe8.js → style-wvcOEAiM.js} +2 -2
  170. package/ccw/frontend/dist/assets/{style-wEWj0pe8.js.map → style-wvcOEAiM.js.map} +1 -1
  171. package/ccw/frontend/dist/assets/{target-BB9AJiC7.js → target-B8AMmf_N.js} +2 -2
  172. package/ccw/frontend/dist/assets/{target-BB9AJiC7.js.map → target-B8AMmf_N.js.map} +1 -1
  173. package/ccw/frontend/dist/assets/{test-tube-DDnQZrAm.js → test-tube-BpDeTJi1.js} +2 -2
  174. package/ccw/frontend/dist/assets/{test-tube-DDnQZrAm.js.map → test-tube-BpDeTJi1.js.map} +1 -1
  175. package/ccw/frontend/dist/assets/{upload-DshzYJC_.js → upload-pflkdIDG.js} +2 -2
  176. package/ccw/frontend/dist/assets/{upload-DshzYJC_.js.map → upload-pflkdIDG.js.map} +1 -1
  177. package/ccw/frontend/dist/assets/{useApiSettings-DkV-yWup.js → useApiSettings-BPx4DyKT.js} +2 -2
  178. package/ccw/frontend/dist/assets/{useApiSettings-DkV-yWup.js.map → useApiSettings-BPx4DyKT.js.map} +1 -1
  179. package/ccw/frontend/dist/assets/{useCli-CnwgIkqD.js → useCli-D1jfH3XA.js} +2 -2
  180. package/ccw/frontend/dist/assets/{useCli-CnwgIkqD.js.map → useCli-D1jfH3XA.js.map} +1 -1
  181. package/ccw/frontend/dist/assets/{useCommands-S0sc5bfK.js → useCommands-DhR71vpa.js} +2 -2
  182. package/ccw/frontend/dist/assets/{useCommands-S0sc5bfK.js.map → useCommands-DhR71vpa.js.map} +1 -1
  183. package/ccw/frontend/dist/assets/{useDebounce-HxG5rpQo.js → useDebounce-a6Yyer3m.js} +2 -2
  184. package/ccw/frontend/dist/assets/{useDebounce-HxG5rpQo.js.map → useDebounce-a6Yyer3m.js.map} +1 -1
  185. package/ccw/frontend/dist/assets/{useFileExplorer-CTg0zndf.js → useFileExplorer-B8W2JTj2.js} +2 -2
  186. package/ccw/frontend/dist/assets/{useFileExplorer-CTg0zndf.js.map → useFileExplorer-B8W2JTj2.js.map} +1 -1
  187. package/ccw/frontend/dist/assets/{useLocale-C2BlVToA.js → useLocale-aMHdQIL_.js} +2 -2
  188. package/ccw/frontend/dist/assets/{useLocale-C2BlVToA.js.map → useLocale-aMHdQIL_.js.map} +1 -1
  189. package/ccw/frontend/dist/assets/{useSkills-8IWJgwQU.js → useSkills-BHpc2LtN.js} +3 -3
  190. package/ccw/frontend/dist/assets/{useSkills-8IWJgwQU.js.map → useSkills-BHpc2LtN.js.map} +1 -1
  191. package/ccw/frontend/dist/assets/{useSystemSettings-BAtCCf8T.js → useSystemSettings-BFD0SvEF.js} +2 -2
  192. package/ccw/frontend/dist/assets/{useSystemSettings-BAtCCf8T.js.map → useSystemSettings-BFD0SvEF.js.map} +1 -1
  193. package/ccw/frontend/dist/assets/{wand-sparkles-CI1Tfudg.js → wand-sparkles-dYtI2IKM.js} +2 -2
  194. package/ccw/frontend/dist/assets/{wand-sparkles-CI1Tfudg.js.map → wand-sparkles-dYtI2IKM.js.map} +1 -1
  195. package/ccw/frontend/dist/index.html +2 -2
  196. package/package.json +1 -1
  197. package/ccw/frontend/dist/assets/LiteTasksPage-BOknokuo.js.map +0 -1
  198. package/ccw/frontend/dist/assets/SettingsPage-DJltvfrs.js +0 -144
  199. package/ccw/frontend/dist/assets/SettingsPage-DJltvfrs.js.map +0 -1
  200. package/ccw/frontend/dist/assets/index-D6YeIKg_.css +0 -39
@@ -1,10 +1,10 @@
1
- import{O as Ms,u as re,j as e,C as $,a as A,D as Ss,d as Cs,e as f,f as ks,g as qe,h as Ps,T as Es,B as S,ae as Me,ak as cs,c as D,r as i,x as Se,y as Ce,z as ke,A as Pe,E as os,bu as K,I as le,aq as $e,ar as Ae,as as ze,at as _e,au as Ee,X as Ds,G as ds,bO as Is,N as ne,fS as ns,fT as Re,_ as U,ai as J,aj as X,fU as ie,k as is,an as Ls,cP as Ts,S as Ge,R as Be,bp as Fs,aw as Os,m as Ks,av as qs,ap as Rs,ao as Hs,aF as $s,ab as He,aH as As,a9 as zs,aa as _s,a6 as ls,a2 as Gs,a3 as Bs,a4 as ye,aS as Vs,a5 as Ne,b as Ws}from"./index-B8K8MdMl.js";import{S as De}from"./Switch-BEfkMCxZ.js";import{F as Ie}from"./file-text-DSroEAMu.js";import{E as Qs}from"./ellipsis-vertical-GwdnnWQj.js";import{E as me}from"./eye-kV2pWXQ5.js";import{S as Us}from"./square-pen-BS0-oO7y.js";import{G as Ve}from"./globe-C3X8YQrU.js";import{F as We}from"./folder-DNNgXVVH.js";import{S as Js}from"./save-B3iyK-h8.js";import{m as Xs,n as Ys,o as Zs,p as et,q as st}from"./useSystemSettings-BAtCCf8T.js";import{P as tt}from"./plug-Jz5HaKIu.js";import{F as ms}from"./filter-A5I9Xz7E.js";import{H as at}from"./history-BXaQEkhy.js";import{G as nt}from"./gauge-PfGM68A8.js";/**
1
+ import{O as Ms,u as re,j as e,C as $,a as A,D as Ss,d as Cs,e as f,f as ks,g as qe,h as Ps,T as Es,B as S,ae as Me,ak as cs,c as D,r as i,x as Se,y as Ce,z as ke,A as Pe,E as os,bu as K,I as le,aq as $e,ar as Ae,as as ze,at as _e,au as Ee,X as Ds,G as ds,bO as Is,N as ne,fS as ns,fT as Re,_ as U,ai as J,aj as X,fU as ie,k as is,an as Ls,cQ as Ts,S as Ge,R as Be,bp as Fs,aw as Os,m as Ks,av as qs,ap as Rs,ao as Hs,aF as $s,ab as He,aH as As,a9 as zs,aa as _s,a6 as ls,a2 as Gs,a3 as Bs,a4 as ye,aS as Vs,a5 as Ne,b as Qs}from"./index-DP_mTJI8.js";import{S as De}from"./Switch-BG929kV0.js";import{F as Ie}from"./file-text-TGs_qCbw.js";import{E as Ws}from"./ellipsis-vertical-BoVlINSw.js";import{E as me}from"./eye-BEMOdcAN.js";import{S as Us}from"./square-pen-BfaiJgOX.js";import{G as Ve}from"./globe-DpnrINqP.js";import{F as Qe}from"./folder-BkivHBwn.js";import{S as Js}from"./save-DXfqv84T.js";import{m as Xs,n as Ys,o as Zs,p as et,q as st}from"./useSystemSettings-BFD0SvEF.js";import{P as tt}from"./plug-DvSZP2cp.js";import{F as ms}from"./filter-CIuCqnDB.js";import{H as at}from"./history-Botz5Z5d.js";import{G as nt}from"./gauge-CtM68fVY.js";/**
2
2
  * @license lucide-react v0.460.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const it=Ms("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),lt={required:{variant:"default",labelKey:"specs.readMode.required"},optional:{variant:"secondary",labelKey:"specs.readMode.optional"}},rt={critical:{variant:"destructive",labelKey:"specs.priority.critical"},high:{variant:"warning",labelKey:"specs.priority.high"},medium:{variant:"info",labelKey:"specs.priority.medium"},low:{variant:"secondary",labelKey:"specs.priority.low"}},rs={general:{variant:"secondary",labelKey:"specs.category.general"},exploration:{variant:"outline",labelKey:"specs.category.exploration"},planning:{variant:"outline",labelKey:"specs.category.planning"},execution:{variant:"outline",labelKey:"specs.category.execution"}};function ct({spec:s,onView:t,onEdit:r,onDelete:v,onToggle:d,className:x,showActions:m=!0,actionsDisabled:u=!1}){const{formatMessage:h}=re(),j=lt[s.readMode],C=rt[s.priority],k=l=>{d==null||d(s.id,l)},P=(l,b)=>{switch(l.stopPropagation(),b){case"edit":r==null||r(s);break;case"delete":v==null||v(s.id);break}};return e.jsx($,{className:D("group transition-all duration-200 hover:shadow-md hover:border-primary/30 hover-glow",!s.enabled&&"opacity-60",x),children:e.jsxs(A,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("h3",{className:"font-medium text-card-foreground truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:s.file})]}),e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:m&&e.jsxs(Ss,{children:[e.jsx(Cs,{asChild:!0,children:e.jsxs(f,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:l=>l.stopPropagation(),disabled:u,children:[e.jsx(Qs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h({id:"common.aria.actions"})})]})}),e.jsxs(ks,{align:"end",children:[e.jsxs(qe,{onClick:l=>{l.stopPropagation(),t==null||t(s)},children:[e.jsx(me,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.view",defaultMessage:"View Content"})]}),e.jsxs(qe,{onClick:l=>P(l,"edit"),children:[e.jsx(Us,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.edit"})]}),e.jsx(Ps,{}),e.jsxs(qe,{onClick:l=>P(l,"delete"),className:"text-destructive focus:text-destructive",children:[e.jsx(Es,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.delete"})]})]})]})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[s.category&&e.jsxs(S,{variant:rs[s.category].variant,className:"text-xs gap-1",children:[e.jsx(Me,{className:"h-3 w-3"}),h({id:rs[s.category].labelKey,defaultMessage:s.category})]}),s.dimension==="personal"&&e.jsx(S,{variant:"outline",className:"text-xs gap-1",children:s.scope==="global"?e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:"h-3 w-3"}),h({id:"specs.scope.global",defaultMessage:"Global"})]}):e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"h-3 w-3"}),h({id:"specs.scope.project",defaultMessage:"Project"})]})}),e.jsx(S,{variant:j.variant,className:"text-xs",children:h({id:j.labelKey})}),e.jsx(S,{variant:C.variant,className:"text-xs",children:h({id:C.labelKey})})]}),s.description&&e.jsx("p",{className:"mt-3 text-sm text-muted-foreground line-clamp-2",children:s.description}),s.keywords.length>0&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[e.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.keywords.slice(0,4).map(l=>e.jsx(S,{variant:"outline",className:"text-xs px-1.5 py-0",children:l},l)),s.keywords.length>4&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",s.keywords.length-4]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:h({id:s.enabled?"specs.status.enabled":"specs.status.disabled"})}),e.jsx(De,{checked:s.enabled,onCheckedChange:k,disabled:u,className:"data-[state=checked]:bg-primary"})]})]})})}const ot=[{value:"required",labelKey:"specs.readMode.required"},{value:"optional",labelKey:"specs.readMode.optional"}],dt=[{value:"critical",labelKey:"specs.priority.critical"},{value:"high",labelKey:"specs.priority.high"},{value:"medium",labelKey:"specs.priority.medium"},{value:"low",labelKey:"specs.priority.low"}];function mt({open:s,onOpenChange:t,spec:r,onSave:v,isLoading:d=!1}){const{formatMessage:x}=re(),[m,u]=i.useState({title:"",readMode:"optional",priority:"medium",keywords:[]}),[h,j]=i.useState(""),[C,k]=i.useState({});i.useEffect(()=>{r&&(u({title:r.title,readMode:r.readMode,priority:r.priority,keywords:[...r.keywords]}),k({}),j(""))},[r]);const P=()=>{const c={};return m.title.trim()||(c.title=x({id:"specs.validation.titleRequired"})),k(c),Object.keys(c).length===0},l=async()=>{!r||!P()||await v(r.id,m)},b=c=>{(c.key==="Enter"||c.key===",")&&(c.preventDefault(),F())},F=()=>{const c=h.trim().toLowerCase();c&&!m.keywords.includes(c)&&u(y=>({...y,keywords:[...y.keywords,c]})),j("")},O=c=>{u(y=>({...y,keywords:y.keywords.filter(q=>q!==c)}))};return r?e.jsx(Se,{open:s,onOpenChange:t,children:e.jsxs(Ce,{className:"sm:max-w-[500px]",children:[e.jsxs(ke,{children:[e.jsx(Pe,{children:x({id:"specs.dialog.editTitle"},{title:r.title})}),e.jsx(os,{children:x({id:"specs.dialog.editDescription"})})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"title",children:x({id:"specs.form.title"})}),e.jsx(le,{id:"title",value:m.title,onChange:c=>u(y=>({...y,title:c.target.value})),placeholder:x({id:"specs.form.titlePlaceholder"}),error:!!C.title,disabled:d}),C.title&&e.jsx("p",{className:"text-sm text-destructive",children:C.title})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:x({id:"specs.form.readMode"})}),e.jsxs($e,{value:m.readMode,onValueChange:c=>u(y=>({...y,readMode:c})),disabled:d,children:[e.jsx(Ae,{children:e.jsx(ze,{})}),e.jsx(_e,{children:ot.map(c=>e.jsx(Ee,{value:c.value,children:x({id:c.labelKey})},c.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:x({id:"specs.form.priority"})}),e.jsxs($e,{value:m.priority,onValueChange:c=>u(y=>({...y,priority:c})),disabled:d,children:[e.jsx(Ae,{children:e.jsx(ze,{})}),e.jsx(_e,{children:dt.map(c=>e.jsx(Ee,{value:c.value,children:x({id:c.labelKey})},c.value))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"keywords",children:x({id:"specs.form.keywords"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"relative flex-1",children:e.jsx(le,{id:"keywords",value:h,onChange:c=>j(c.target.value),onKeyDown:b,onBlur:F,placeholder:x({id:"specs.form.keywordsPlaceholder"}),disabled:d})}),e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:F,disabled:d||!h.trim(),children:x({id:"specs.form.addKeyword"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:x({id:"specs.form.keywordsHint"})}),m.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[e.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground mt-0.5"}),m.keywords.map(c=>e.jsxs(S,{variant:"secondary",className:"text-xs pl-2 pr-1 gap-1",children:[c,e.jsx("button",{type:"button",onClick:()=>O(c),className:"ml-0.5 hover:text-destructive transition-colors",disabled:d,children:e.jsx(Ds,{className:"h-3 w-3"})})]},c))]})]}),e.jsx("div",{className:"pt-2 border-t border-border",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:x({id:"specs.form.fileInfo"},{file:r.file})})})]}),e.jsxs(ds,{children:[e.jsx(f,{variant:"outline",onClick:()=>t(!1),disabled:d,children:x({id:"common.cancel"})}),e.jsx(f,{onClick:l,disabled:d,children:x(d?{id:"specs.form.saving"}:{id:"common.save"})})]})]})}):null}function ut(s){const t=/^---\n([\s\S]*?)\n---\n([\s\S]*)$/,r=s.match(t);if(!r)return{frontmatter:{},body:s};const v=r[1].split(`
6
+ */const it=Ms("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),lt={required:{variant:"default",labelKey:"specs.readMode.required"},optional:{variant:"secondary",labelKey:"specs.readMode.optional"}},rt={critical:{variant:"destructive",labelKey:"specs.priority.critical"},high:{variant:"warning",labelKey:"specs.priority.high"},medium:{variant:"info",labelKey:"specs.priority.medium"},low:{variant:"secondary",labelKey:"specs.priority.low"}},rs={general:{variant:"secondary",labelKey:"specs.category.general"},exploration:{variant:"outline",labelKey:"specs.category.exploration"},planning:{variant:"outline",labelKey:"specs.category.planning"},execution:{variant:"outline",labelKey:"specs.category.execution"}};function ct({spec:s,onView:t,onEdit:r,onDelete:v,onToggle:d,className:x,showActions:m=!0,actionsDisabled:u=!1}){const{formatMessage:h}=re(),j=lt[s.readMode],C=rt[s.priority],k=l=>{d==null||d(s.id,l)},P=(l,b)=>{switch(l.stopPropagation(),b){case"edit":r==null||r(s);break;case"delete":v==null||v(s.id);break}};return e.jsx($,{className:D("group transition-all duration-200 hover:shadow-md hover:border-primary/30 hover-glow",!s.enabled&&"opacity-60",x),children:e.jsxs(A,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("h3",{className:"font-medium text-card-foreground truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:s.file})]}),e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:m&&e.jsxs(Ss,{children:[e.jsx(Cs,{asChild:!0,children:e.jsxs(f,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:l=>l.stopPropagation(),disabled:u,children:[e.jsx(Ws,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h({id:"common.aria.actions"})})]})}),e.jsxs(ks,{align:"end",children:[e.jsxs(qe,{onClick:l=>{l.stopPropagation(),t==null||t(s)},children:[e.jsx(me,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.view",defaultMessage:"View Content"})]}),e.jsxs(qe,{onClick:l=>P(l,"edit"),children:[e.jsx(Us,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.edit"})]}),e.jsx(Ps,{}),e.jsxs(qe,{onClick:l=>P(l,"delete"),className:"text-destructive focus:text-destructive",children:[e.jsx(Es,{className:"mr-2 h-4 w-4"}),h({id:"specs.actions.delete"})]})]})]})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[s.category&&e.jsxs(S,{variant:rs[s.category].variant,className:"text-xs gap-1",children:[e.jsx(Me,{className:"h-3 w-3"}),h({id:rs[s.category].labelKey,defaultMessage:s.category})]}),s.dimension==="personal"&&e.jsx(S,{variant:"outline",className:"text-xs gap-1",children:s.scope==="global"?e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:"h-3 w-3"}),h({id:"specs.scope.global",defaultMessage:"Global"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Qe,{className:"h-3 w-3"}),h({id:"specs.scope.project",defaultMessage:"Project"})]})}),e.jsx(S,{variant:j.variant,className:"text-xs",children:h({id:j.labelKey})}),e.jsx(S,{variant:C.variant,className:"text-xs",children:h({id:C.labelKey})})]}),s.description&&e.jsx("p",{className:"mt-3 text-sm text-muted-foreground line-clamp-2",children:s.description}),s.keywords.length>0&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[e.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.keywords.slice(0,4).map(l=>e.jsx(S,{variant:"outline",className:"text-xs px-1.5 py-0",children:l},l)),s.keywords.length>4&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",s.keywords.length-4]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:h({id:s.enabled?"specs.status.enabled":"specs.status.disabled"})}),e.jsx(De,{checked:s.enabled,onCheckedChange:k,disabled:u,className:"data-[state=checked]:bg-primary"})]})]})})}const ot=[{value:"required",labelKey:"specs.readMode.required"},{value:"optional",labelKey:"specs.readMode.optional"}],dt=[{value:"critical",labelKey:"specs.priority.critical"},{value:"high",labelKey:"specs.priority.high"},{value:"medium",labelKey:"specs.priority.medium"},{value:"low",labelKey:"specs.priority.low"}];function mt({open:s,onOpenChange:t,spec:r,onSave:v,isLoading:d=!1}){const{formatMessage:x}=re(),[m,u]=i.useState({title:"",readMode:"optional",priority:"medium",keywords:[]}),[h,j]=i.useState(""),[C,k]=i.useState({});i.useEffect(()=>{r&&(u({title:r.title,readMode:r.readMode,priority:r.priority,keywords:[...r.keywords]}),k({}),j(""))},[r]);const P=()=>{const c={};return m.title.trim()||(c.title=x({id:"specs.validation.titleRequired"})),k(c),Object.keys(c).length===0},l=async()=>{!r||!P()||await v(r.id,m)},b=c=>{(c.key==="Enter"||c.key===",")&&(c.preventDefault(),F())},F=()=>{const c=h.trim().toLowerCase();c&&!m.keywords.includes(c)&&u(y=>({...y,keywords:[...y.keywords,c]})),j("")},O=c=>{u(y=>({...y,keywords:y.keywords.filter(q=>q!==c)}))};return r?e.jsx(Se,{open:s,onOpenChange:t,children:e.jsxs(Ce,{className:"sm:max-w-[500px]",children:[e.jsxs(ke,{children:[e.jsx(Pe,{children:x({id:"specs.dialog.editTitle"},{title:r.title})}),e.jsx(os,{children:x({id:"specs.dialog.editDescription"})})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"title",children:x({id:"specs.form.title"})}),e.jsx(le,{id:"title",value:m.title,onChange:c=>u(y=>({...y,title:c.target.value})),placeholder:x({id:"specs.form.titlePlaceholder"}),error:!!C.title,disabled:d}),C.title&&e.jsx("p",{className:"text-sm text-destructive",children:C.title})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:x({id:"specs.form.readMode"})}),e.jsxs($e,{value:m.readMode,onValueChange:c=>u(y=>({...y,readMode:c})),disabled:d,children:[e.jsx(Ae,{children:e.jsx(ze,{})}),e.jsx(_e,{children:ot.map(c=>e.jsx(Ee,{value:c.value,children:x({id:c.labelKey})},c.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:x({id:"specs.form.priority"})}),e.jsxs($e,{value:m.priority,onValueChange:c=>u(y=>({...y,priority:c})),disabled:d,children:[e.jsx(Ae,{children:e.jsx(ze,{})}),e.jsx(_e,{children:dt.map(c=>e.jsx(Ee,{value:c.value,children:x({id:c.labelKey})},c.value))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"keywords",children:x({id:"specs.form.keywords"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"relative flex-1",children:e.jsx(le,{id:"keywords",value:h,onChange:c=>j(c.target.value),onKeyDown:b,onBlur:F,placeholder:x({id:"specs.form.keywordsPlaceholder"}),disabled:d})}),e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:F,disabled:d||!h.trim(),children:x({id:"specs.form.addKeyword"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:x({id:"specs.form.keywordsHint"})}),m.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[e.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground mt-0.5"}),m.keywords.map(c=>e.jsxs(S,{variant:"secondary",className:"text-xs pl-2 pr-1 gap-1",children:[c,e.jsx("button",{type:"button",onClick:()=>O(c),className:"ml-0.5 hover:text-destructive transition-colors",disabled:d,children:e.jsx(Ds,{className:"h-3 w-3"})})]},c))]})]}),e.jsx("div",{className:"pt-2 border-t border-border",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:x({id:"specs.form.fileInfo"},{file:r.file})})})]}),e.jsxs(ds,{children:[e.jsx(f,{variant:"outline",onClick:()=>t(!1),disabled:d,children:x({id:"common.cancel"})}),e.jsx(f,{onClick:l,disabled:d,children:x(d?{id:"specs.form.saving"}:{id:"common.save"})})]})]})}):null}function ut(s){const t=/^---\n([\s\S]*?)\n---\n([\s\S]*)$/,r=s.match(t);if(!r)return{frontmatter:{},body:s};const v=r[1].split(`
7
7
  `),d={};for(const x of v){const m=x.indexOf(":");if(m>0){const u=x.slice(0,m).trim(),h=x.slice(m+1).trim();h.startsWith("[")&&h.endsWith("]")?d[u]=h.slice(1,-1).split(",").map(j=>j.trim().replace(/^['"]|['"]$/g,"")).filter(Boolean):d[u]=h.replace(/^['"]|['"]$/g,"")}}return{frontmatter:d,body:r[2]}}function xt({open:s,onOpenChange:t,spec:r,content:v,onSave:d,readOnly:x=!1,isLoading:m=!1}){const{formatMessage:u}=re(),[h,j]=i.useState("view"),[C,k]=i.useState(v||""),[P,l]=i.useState(""),{body:b}=i.useMemo(()=>ut(C),[C]);i.useEffect(()=>{r&&s&&((async()=>{try{const y=await fetch(`/api/specs/detail?file=${encodeURIComponent(r.file)}`);if(y.ok){const q=await y.json();k(q.content||""),l(q.content||"")}}catch(y){console.error("Failed to fetch spec content:",y)}})(),j("view"))},[r,s]);const F=async()=>{!r||!d||(await d(r.id,P),k(P),j("view"))},O=()=>{l(C),j("view")};return r?e.jsx(Se,{open:s,onOpenChange:t,children:e.jsxs(Ce,{className:D("sm:max-w-[800px] max-h-[80vh]",h==="edit"&&"flex flex-col"),children:[e.jsxs(ke,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Pe,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),r.title]}),!x&&e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>h==="view"?j("edit"):O(),disabled:m,children:h==="view"?e.jsxs(e.Fragment,{children:[e.jsx(it,{className:"h-4 w-4 mr-1"}),u({id:"specs.content.edit",defaultMessage:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"h-4 w-4 mr-1"}),u({id:"specs.content.view",defaultMessage:"View"})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:r.readMode==="required"?"default":"secondary",children:u({id:`specs.readMode.${r.readMode}`})}),e.jsx(S,{variant:"outline",children:u({id:`specs.priority.${r.priority}`})})]})]}),e.jsx(os,{children:r.file})]}),e.jsx("div",{className:"flex-1 overflow-auto py-4",children:h==="view"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg",children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:u({id:"specs.content.metadata",defaultMessage:"Metadata"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-muted-foreground",children:[u({id:"specs.form.readMode",defaultMessage:"Read Mode"}),":"]})," ",e.jsx(S,{variant:"secondary",className:"text-xs",children:u({id:`specs.readMode.${r.readMode}`})})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-muted-foreground",children:[u({id:"specs.form.priority",defaultMessage:"Priority"}),":"]})," ",e.jsx(S,{variant:"outline",className:"text-xs",children:u({id:`specs.priority.${r.priority}`})})]})]}),r.keywords.length>0&&e.jsxs("div",{className:"mt-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[u({id:"specs.form.keywords",defaultMessage:"Keywords"}),":"]})," ",r.keywords.map(c=>e.jsx(S,{variant:"outline",className:"text-xs mr-1",children:c},c))]})]}),e.jsxs("div",{className:"border rounded-lg",children:[e.jsx("div",{className:"bg-muted/30 px-3 py-2 border-b text-sm font-medium",children:u({id:"specs.content.markdownContent",defaultMessage:"Markdown Content"})}),e.jsx("pre",{className:"p-4 text-sm overflow-auto max-h-[400px] whitespace-pre-wrap break-words",children:b||u({id:"specs.content.noContent",defaultMessage:"No content available"})})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:u({id:"specs.content.editHint",defaultMessage:"Edit the full markdown content including frontmatter. Changes to frontmatter will be reflected in the spec metadata."})}),e.jsx(Is,{value:P,onChange:c=>l(c.target.value),className:"font-mono text-sm min-h-[400px] resize-none",placeholder:u({id:"specs.content.placeholder",defaultMessage:`# Spec Title
8
8
 
9
- Content here...`}),disabled:m})]})}),e.jsx(ds,{children:h==="edit"?e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"outline",onClick:O,disabled:m,children:u({id:"specs.common.cancel",defaultMessage:"Cancel"})}),e.jsx(f,{onClick:F,disabled:m,children:m?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),u({id:"specs.common.saving",defaultMessage:"Saving..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"h-4 w-4 mr-2"}),u({id:"specs.common.save",defaultMessage:"Save"})]})})]}):e.jsx(f,{variant:"outline",onClick:()=>t(!1),children:u({id:"specs.common.close",defaultMessage:"Close"})})})]})}):null}const ht=["general","exploration","planning","execution"],we={general:{color:"text-gray-600",bgColor:"bg-gray-100 dark:bg-gray-800"},exploration:{color:"text-blue-600",bgColor:"bg-blue-100 dark:bg-blue-900/30"},planning:{color:"text-purple-600",bgColor:"bg-purple-100 dark:bg-purple-900/30"},execution:{color:"text-green-600",bgColor:"bg-green-100 dark:bg-green-900/30"}},be=[{id:"spec-injection-session",name:"Spec Context Injection (Session)",event:"SessionStart",command:"ccw spec load --stdin",scope:"global",description:"Automatically inject spec context when Claude session starts"},{id:"spec-injection-prompt",name:"Spec Context Injection (Prompt)",event:"UserPromptSubmit",command:"ccw spec load --stdin",scope:"project",description:"Inject spec context when user submits a prompt, matching keywords"}];async function gt(){const s=await fetch("/api/specs/stats");if(!s.ok)throw new Error("Failed to fetch spec stats");return s.json()}async function us(){const s=await fetch("/api/system/settings");if(!s.ok)throw new Error("Failed to fetch system settings");return s.json()}async function pt(s){const t=await us(),r=await fetch("/api/system/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({injectionControl:{...t.injectionControl,...s}})});if(!r.ok)throw new Error("Failed to update settings");return r.json()}function E(s){return s.toLocaleString()}function ft(s,t){return t<=0?0:Math.min(100,s/t*100)}function jt({className:s}){var Ye,Ze,es,ss,ts;const{formatMessage:t}=re(),r=Xs(),[v,d]=i.useState(null),[x,m]=i.useState(!0),[u,h]=i.useState(null),[j,C]=i.useState({maxLength:8e3,warnThreshold:6e3,truncateOnExceed:!0}),[k,P]=i.useState(!0),[l,b]=i.useState(j),[F,O]=i.useState(!1),[c,y]=i.useState(!1),[q,B]=i.useState([]),R=Ys(),[I,Y]=i.useState("required"),[z,Z]=i.useState("all"),[n,w]=i.useState(null),[_,se]=i.useState(!1),[ue,Te]=i.useState({specs:!0,personal:!0}),[Fe,xe]=i.useState(!1),[V,Oe]=i.useState(null),[ce,he]=i.useState(ns[0]),[g,M]=i.useState(null),[L,N]=i.useState(!1),[G,oe]=i.useState(!1),de=i.useCallback(async()=>{m(!0),h(null);try{const a=await gt();d(a)}catch(a){h(a instanceof Error?a:new Error("Unknown error"))}finally{m(!1)}},[]),ge=i.useCallback(async()=>{P(!0);try{const a=await us();C(a.injectionControl),b(a.injectionControl)}catch(a){console.error("Failed to load settings:",a)}finally{P(!1)}},[]),H=i.useCallback(async()=>{se(!0);try{const a=await Re(I,!1);w(a)}catch(a){console.error("Failed to load injection preview:",a)}finally{se(!1)}},[I]),xs=i.useCallback(async a=>{try{const p=(await Re(I,!0)).files.find(T=>T.file===a.file);p&&(Oe(p),xe(!0))}catch(o){console.error("Failed to load file preview:",o)}},[I]),hs=i.useCallback(async a=>{N(!0);try{const o=await Re(a.mode,!0,void 0,a.category);M(o),he(a),oe(!0)}catch(o){console.error("Failed to load command preview:",o)}finally{N(!1)}},[]);i.useEffect(()=>{de(),ge()},[de,ge]),i.useEffect(()=>{H()},[H]),i.useEffect(()=>{const a=l.maxLength!==j.maxLength||l.warnThreshold!==j.warnThreshold||l.truncateOnExceed!==j.truncateOnExceed;O(a)},[l,j]);const te=(a,o)=>{b(p=>({...p,[a]:o}))},gs=async()=>{y(!0);try{const a=await pt(l);C(a.injectionControl),b(a.injectionControl),O(!1),U.success(t({id:"specs.injection.saveSuccess"},{default:"Settings saved successfully"}))}catch(a){U.error(t({id:"specs.injection.saveError"},{default:"Failed to save settings"})),console.error("Failed to save settings:",a)}finally{y(!1)}},ps=()=>{b(j),O(!1)},pe=l.maxLength<1e3||l.maxLength>5e4?t({id:"specs.injection.maxLengthError",defaultMessage:"Must be between 1000 and 50000"}):null,fe=l.warnThreshold<0||l.warnThreshold>=l.maxLength?t({id:"specs.injection.warnThresholdError",defaultMessage:"Must be less than max length"}):null,fs=a=>{Te(o=>({...o,[a]:!o[a]}))},je=i.useMemo(()=>{var p;const a=new Set,o=(p=R.data)==null?void 0:p.recommendedHooks;return o&&o.forEach(T=>{T.installed&&a.add(T.id)}),a},[(Ye=R.data)==null?void 0:Ye.recommendedHooks]),Qe=je.size,Ue=Qe===be.length,js=i.useCallback(async a=>{B(o=>[...o,a]);try{await r.installHooks([a],"global"),U.success(t({id:"specs.hooks.installSuccess",defaultMessage:"Hook installed successfully"}))}catch(o){U.error(t({id:"specs.hooks.installError",defaultMessage:"Failed to install hook"})),console.error("Failed to install hook:",o)}finally{B(o=>o.filter(p=>p!==a))}},[r,t]),vs=i.useCallback(async()=>{const a=be.filter(o=>!je.has(o.id));if(a.length!==0){B(a.map(o=>o.id));try{await r.installHooks(a.map(o=>o.id),"global"),U.success(t({id:"specs.hooks.installAllSuccess",defaultMessage:"All hooks installed successfully"}))}catch(o){U.error(t({id:"specs.hooks.installError",defaultMessage:"Failed to install hooks"})),console.error("Failed to install hooks:",o)}finally{B([])}}},[je,r,t]),ys=i.useMemo(()=>{if(!n)return{};const a={};for(const o of n.files)z!=="all"&&o.category!==z||(a[o.dimension]||(a[o.dimension]=[]),a[o.dimension].push(o));return a},[n,z]),Ns=i.useMemo(()=>{if(!n)return{general:0,exploration:0,planning:0,execution:0};const a={general:0,exploration:0,planning:0,execution:0};for(const o of n.files){const p=o.category||"general";a[p]!==void 0&&a[p]++}return a},[n]),ae=((Ze=v==null?void 0:v.injectionLength)==null?void 0:Ze.withKeywords)||0,W=((es=v==null?void 0:v.injectionLength)==null?void 0:es.maxLength)||j.maxLength,Je=j.warnThreshold,Ke=ft(ae,W),Q=ae>W,ve=ae>Je,Xe=Math.max(0,W-ae),ws=Math.ceil(ae/80),bs=Math.ceil(W/80);return e.jsxs("div",{className:D("space-y-6",s),children:[e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"h-5 w-5"}),t({id:"specs.recommendedHooks",defaultMessage:"Recommended Hooks"})]}),e.jsx(ie,{children:t({id:"specs.recommendedHooksDesc",defaultMessage:"One-click install spec injection hooks for automatic context loading"})})]}),e.jsxs(A,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(f,{onClick:vs,disabled:Ue||q.length>0,children:Ue?e.jsxs(e.Fragment,{children:[e.jsx(is,{className:"h-4 w-4 mr-2"}),t({id:"specs.allHooksInstalled",defaultMessage:"All Hooks Installed"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2"}),t({id:"specs.installAllHooks",defaultMessage:"Install All Hooks"})]})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[Qe," / ",be.length," ",t({id:"specs.hooksInstalled",defaultMessage:"installed"})]})]}),e.jsx(f,{variant:"ghost",size:"sm",asChild:!0,children:e.jsxs(Ts,{to:"/hooks",children:[e.jsx(Ge,{className:"h-4 w-4 mr-1"}),t({id:"specs.manageHooks",defaultMessage:"Manage Hooks"})]})})]}),e.jsx("div",{className:"grid gap-3",children:be.map(a=>{const o=je.has(a.id),p=q.includes(a.id);return e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.name}),o&&e.jsx(is,{className:"h-4 w-4 text-green-500"})]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:a.description}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[t({id:"specs.hookEvent",defaultMessage:"Event"}),":"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:a.event})]}),e.jsxs("span",{children:[t({id:"specs.hookScope",defaultMessage:"Scope"}),":"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:a.scope})]})]})]}),e.jsx(f,{variant:o?"outline":"default",size:"sm",disabled:o||p,onClick:()=>js(a.id),children:t(p?{id:"specs.installing",defaultMessage:"Installing..."}:o?{id:"specs.installed",defaultMessage:"Installed"}:{id:"specs.install",defaultMessage:"Install"})})]},a.id)})})]})]}),e.jsxs($,{children:[e.jsx(J,{children:e.jsxs(X,{className:"flex items-center gap-2",children:[t({id:"specs.injection.statusTitle",defaultMessage:"Current Injection Status"}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{de(),H()},disabled:x,children:e.jsx(Be,{className:D("h-4 w-4",x&&"animate-spin")})})]})}),e.jsx(A,{className:"space-y-4",children:x?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):u?e.jsx("div",{className:"text-sm text-destructive",children:t({id:"specs.injection.loadError",defaultMessage:"Failed to load stats"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t({id:"specs.injection.currentLength",defaultMessage:"Current Length"})}),e.jsxs("span",{className:D("font-medium",Q&&"text-destructive",!Q&&ve&&"text-yellow-600 dark:text-yellow-400"),children:[E(ae)," / ",E(W)," ",t({id:"specs.injection.characters",defaultMessage:"characters"}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:["(~",E(ws)," / ",E(bs)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[e.jsxs("span",{children:[Ke,"%"]}),e.jsxs("span",{children:[t({id:"specs.injection.maxLimit",defaultMessage:"Max"}),": ",E(W)]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Fs,{value:Ke,className:D("h-3",Q&&"bg-destructive/20",!Q&&ve&&"bg-yellow-100 dark:bg-yellow-900/30"),indicatorClassName:D(!Q&&!ve&&"bg-sky-500 dark:bg-sky-400",Q&&"bg-destructive",!Q&&ve&&"bg-yellow-500")}),e.jsx("div",{className:"absolute top-0 h-3 flex flex-col items-center",style:{left:`${Math.min(100,Je/W*100)}%`,transform:"translateX(-50%)"},children:e.jsx(Os,{className:"h-3 w-3 text-yellow-500 -mt-4"})})]})]}),Q&&e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-destructive/10 border border-destructive/20",children:[e.jsx(Ks,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-destructive",children:t({id:"specs.injection.overLimit",defaultMessage:"Over Limit"})}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t({id:"specs.injection.overLimitDescription",defaultMessage:"Current injection content exceeds maximum length of {max} characters. Excess content will be truncated."},{max:E(W)})})]})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(qs,{className:"h-4 w-4 text-muted-foreground"}),t({id:"specs.injection.statsInfo",defaultMessage:"Statistics"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.requiredLength",defaultMessage:"Required specs length:"})}),e.jsxs("div",{className:"text-right",children:[E(((ss=v==null?void 0:v.injectionLength)==null?void 0:ss.requiredOnly)||0)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.matchedLength",defaultMessage:"Keyword-matched length:"})}),e.jsxs("div",{className:"text-right",children:[E(((ts=v==null?void 0:v.injectionLength)==null?void 0:ts.withKeywords)||0)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.remaining",defaultMessage:"Remaining space:"})}),e.jsxs("div",{className:D("text-right",Xe===0&&"text-destructive"),children:[E(Xe)," (",Math.round(100-Ke),"%)"]})]})]})]})})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),t({id:"specs.injection.filesList",defaultMessage:"Injection Files"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:I==="required"?"default":"outline",size:"sm",onClick:()=>Y("required"),children:t({id:"specs.readMode.required",defaultMessage:"Required"})}),e.jsx(f,{variant:I==="all"?"default":"outline",size:"sm",onClick:()=>Y("all"),children:t({id:"specs.scope.all",defaultMessage:"All"})})]})]}),e.jsx(ie,{children:n&&e.jsxs("span",{children:[n.stats.count," ",t({id:"specs.injection.files",defaultMessage:"files"})," • ",E(n.stats.totalLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})})]}),e.jsxs(A,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(ms,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t({id:"specs.filterByCategory",defaultMessage:"Category:"})}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(f,{variant:z==="all"?"default":"outline",size:"sm",onClick:()=>Z("all"),children:t({id:"specs.category.all",defaultMessage:"All"})}),ht.map(a=>e.jsxs(f,{variant:z===a?"default":"outline",size:"sm",onClick:()=>Z(a),className:"gap-1",children:[e.jsx(Me,{className:"h-3 w-3"}),t({id:`specs.category.${a}`,defaultMessage:a})," (",Ns[a],")"]},a))]})]}),_?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"h-[300px] overflow-auto",children:e.jsx("div",{className:"space-y-2",children:Object.entries(ys).map(([a,o])=>e.jsxs("div",{className:"border rounded-lg",children:[e.jsxs("button",{className:"w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors",onClick:()=>fs(a),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[ue[a]?e.jsx(Rs,{className:"h-4 w-4"}):e.jsx(Hs,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium capitalize",children:t({id:`specs.dimension.${a}`,defaultMessage:a})}),e.jsx(S,{variant:"secondary",className:"text-xs",children:o.length})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[E(o.reduce((p,T)=>p+T.contentLength,0))," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})]}),ue[a]&&e.jsx("div",{className:"border-t",children:o.map(p=>{const T=p.category||"general",as=we[T]||we.general;return e.jsxs("div",{className:"flex items-center justify-between p-3 border-b last:border-b-0 hover:bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.scope==="global"?e.jsx(Ve,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):e.jsx(We,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium truncate",children:p.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.file})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{variant:"outline",className:D("text-xs gap-1",as.bgColor,as.color),children:[e.jsx(Me,{className:"h-3 w-3"}),t({id:`specs.category.${T}`,defaultMessage:T})]}),e.jsx(S,{variant:"outline",className:"text-xs",children:t({id:`specs.priority.${p.priority}`,defaultMessage:p.priority})}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:E(p.contentLength)}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>xs(p),children:e.jsx(me,{className:"h-3.5 w-3.5"})})]})]},p.file)})})]},a))})})]})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5"}),t({id:"specs.injection.commandPreview",defaultMessage:"Command Injection Preview"})]}),e.jsx(ie,{children:t({id:"specs.injection.commandPreviewDesc",defaultMessage:"Preview the content that would be injected by different CLI commands"})})]}),e.jsxs(A,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",children:ns.map(a=>e.jsxs(f,{variant:"outline",className:"h-auto flex-col items-start py-3 px-4",onClick:()=>hs(a),disabled:L,children:[e.jsx("div",{className:"font-medium text-sm",children:t({id:`specs.commandPreview.${a.labelKey}.label`,defaultMessage:a.labelKey})}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:t({id:`specs.commandPreview.${a.descriptionKey}.description`,defaultMessage:a.descriptionKey})}),e.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded mt-2 w-full text-center",children:a.command.replace("ccw spec load","").trim()||"default"})]},a.command))}),L&&e.jsxs("div",{className:"flex items-center justify-center py-4 mt-4 border rounded-lg",children:[e.jsx(ne,{className:"h-5 w-5 animate-spin text-muted-foreground mr-2"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.loadingPreview",defaultMessage:"Loading preview..."})})]})]})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsx(X,{children:t({id:"specs.injection.settingsTitle",defaultMessage:"Injection Control Settings"})}),e.jsx(ie,{children:t({id:"specs.injection.settingsDescription",defaultMessage:"Configure how spec content is injected into AI context."})})]}),e.jsx(A,{className:"space-y-6",children:k?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(ne,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"maxLength",children:t({id:"specs.injection.maxLength",defaultMessage:"Max Injection Length"})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(le,{id:"maxLength",type:"number",min:1e3,max:5e4,step:500,value:l.maxLength,onChange:a=>te("maxLength",Number(a.target.value)),className:D(pe&&"border-destructive")})}),e.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["(~",Math.ceil(l.maxLength/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]}),pe&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:pe}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.maxLengthHelp",defaultMessage:"Recommended: 4000-10000 characters (50-125 lines). Too large may consume too much context."})}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t({id:"specs.injection.quickPresets",defaultMessage:"Quick presets:"})}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",4e3),children:"4000 (50 lines)"}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",8e3),children:"8000 (100 lines)"}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",12e3),children:"12000 (150 lines)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"warnThreshold",children:t({id:"specs.injection.warnThresholdLabel",defaultMessage:"Warning Threshold"})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(le,{id:"warnThreshold",type:"number",min:500,max:l.maxLength-1,step:500,value:l.warnThreshold,onChange:a=>te("warnThreshold",Number(a.target.value)),className:D(fe&&"border-destructive")})}),e.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["(~",Math.ceil(l.warnThreshold/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]}),fe&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:fe}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.warnThresholdHelp",defaultMessage:"A warning will be displayed when injection length exceeds this value."})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{htmlFor:"truncate",children:t({id:"specs.injection.truncateOnExceed",defaultMessage:"Truncate on Exceed"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.truncateHelp",defaultMessage:"Automatically truncate content when it exceeds the maximum length."})})]}),e.jsx(De,{id:"truncate",checked:l.truncateOnExceed,onCheckedChange:a=>te("truncateOnExceed",a)})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[e.jsx(f,{variant:"outline",onClick:ps,disabled:!F||c,children:t({id:"common.actions.reset",defaultMessage:"Reset"})}),e.jsx(f,{onClick:gs,disabled:!F||c||!!pe||!!fe,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),t({id:"common.actions.saving",defaultMessage:"Saving..."})]}):t({id:"common.actions.save",defaultMessage:"Save"})})]})]})})]}),e.jsx(Se,{open:Fe,onOpenChange:xe,children:e.jsxs(Ce,{className:"max-w-3xl max-h-[80vh]",children:[e.jsx(ke,{children:e.jsxs(Pe,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),V==null?void 0:V.title]})}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("pre",{className:"text-sm whitespace-pre-wrap p-4 bg-muted rounded-lg",children:(V==null?void 0:V.content)||t({id:"specs.content.noContent",defaultMessage:"No content available"})})})]})}),e.jsx(Se,{open:G,onOpenChange:oe,children:e.jsxs(Ce,{className:"max-w-4xl max-h-[85vh]",children:[e.jsxs(ke,{children:[e.jsxs(Pe,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5"}),t({id:"specs.injection.previewTitle",defaultMessage:"Injection Preview"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("code",{className:"bg-muted px-2 py-1 rounded text-xs",children:ce.command}),e.jsx("span",{children:"•"}),e.jsx("span",{children:t({id:`specs.commandPreview.${ce.descriptionKey}.description`,defaultMessage:ce.descriptionKey})})]})]}),e.jsxs("div",{className:"space-y-4",children:[g&&e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs(S,{variant:"secondary",children:[g.stats.count," ",t({id:"specs.injection.files",defaultMessage:"files"})]}),e.jsxs(S,{variant:"secondary",children:[E(g.stats.totalLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsxs(S,{variant:"secondary",children:["~",Math.ceil(g.stats.totalLength/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"})]})]}),e.jsx("div",{className:"flex-1 overflow-auto max-h-[60vh] border rounded-lg",children:g!=null&&g.files.length?e.jsx("div",{className:"space-y-4 p-4",children:g.files.map((a,o)=>{var p,T;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",className:"text-xs",children:o+1}),e.jsx("span",{className:"font-medium",children:a.title}),a.category&&e.jsx(S,{variant:"outline",className:D("text-xs",(p=we[a.category])==null?void 0:p.bgColor,(T=we[a.category])==null?void 0:T.color),children:a.category})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[E(a.contentLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})]}),e.jsx("pre",{className:"text-xs whitespace-pre-wrap p-3 bg-muted rounded border-l-2 border-primary/30",children:a.content||t({id:"specs.content.noContent",defaultMessage:"No content available"})})]},a.file)})}):e.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:t({id:"specs.injection.noFiles",defaultMessage:"No files match this command"})})})]})]})})]})}const Le="/api";async function vt(){const s=await fetch(`${Le}/system/settings`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch settings: ${s.statusText}`);return await s.json()}async function yt(s){const t=await fetch(`${Le}/system/settings`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(s)});if(!t.ok)throw new Error(`Failed to update settings: ${t.statusText}`);return t.json()}async function Nt(){const s=await fetch(`${Le}/specs/stats`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch spec stats: ${s.statusText}`);return s.json()}async function wt(){const s=await fetch(`${Le}/project-tech/stats`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch project-tech stats: ${s.statusText}`);return s.json()}const ee={all:["system-settings"],settings:()=>[...ee.all,"settings"],stats:()=>[...ee.all,"stats"],projectTech:()=>[...ee.all,"project-tech"]};function bt(){const{formatMessage:s}=re(),t=$s(),[r,v]=i.useState({defaultReadMode:"optional",autoEnable:!0}),[d,x]=i.useState({enabled:!0,maxEntriesPerCategory:10,categories:["feature","enhancement","bugfix","refactor","docs"]}),{data:m,isLoading:u,error:h}=He({queryKey:ee.settings(),queryFn:vt,staleTime:6e4}),{data:j,isLoading:C,error:k,refetch:P}=He({queryKey:ee.stats(),queryFn:Nt,staleTime:3e4}),{data:l}=He({queryKey:ee.projectTech(),queryFn:wt,staleTime:6e4}),b=As({mutationFn:yt,onSuccess:n=>{t.setQueryData(ee.settings(),n.settings),U.success(s({id:"specs.injection.saveSuccess",defaultMessage:"Settings saved successfully"}))},onError:n=>{U.error(s({id:"specs.injection.saveError",defaultMessage:"Failed to save settings: {error}"},{error:n.message}))}});i.useEffect(()=>{m!=null&&m.personalSpecDefaults&&v(m.personalSpecDefaults),m!=null&&m.devProgressInjection&&x(m.devProgressInjection)},[m]);const F=n=>{const w={...r,defaultReadMode:n};v(w),b.mutate({personalSpecDefaults:w})},O=n=>{const w={...r,autoEnable:n};v(w),b.mutate({personalSpecDefaults:w})},c=n=>{const w={...d,enabled:n};x(w),b.mutate({devProgressInjection:w})},y=n=>{const w=parseInt(n,10);if(!isNaN(w)&&w>=1&&w<=50){const _={...d,maxEntriesPerCategory:w};x(_),b.mutate({devProgressInjection:_})}},q=n=>{const w=d.categories.includes(n)?d.categories.filter(se=>se!==n):[...d.categories,n],_={...d,categories:w};x(_),b.mutate({devProgressInjection:_})},B=(j==null?void 0:j.dimensions)||{},R=Object.entries(B).filter(([n])=>n==="specs"||n==="personal"),I=R.reduce((n,[,w])=>n+w.count,0),Y=R.reduce((n,[,w])=>n+w.requiredCount,0),z=u||C,Z=h||k;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(X,{children:s({id:"specs.settings.personalSpecDefaults",defaultMessage:"Personal Spec Defaults"})})]}),e.jsx(ie,{children:s({id:"specs.settings.personalSpecDefaultsDesc",defaultMessage:"These settings will be applied when creating new personal specs"})})]}),e.jsxs(A,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"default-read-mode",children:s({id:"specs.settings.defaultReadMode",defaultMessage:"Default Read Mode"})}),e.jsxs($e,{value:r.defaultReadMode,onValueChange:n=>F(n),children:[e.jsx(Ae,{id:"default-read-mode",className:"w-full",children:e.jsx(ze,{placeholder:s({id:"specs.settings.selectReadMode",defaultMessage:"Select read mode"})})}),e.jsxs(_e,{children:[e.jsx(Ee,{value:"required",children:s({id:"specs.readMode.required",defaultMessage:"Required"})}),e.jsx(Ee,{value:"optional",children:s({id:"specs.readMode.optional",defaultMessage:"Optional"})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.defaultReadModeHelp",defaultMessage:"The default read mode for newly created personal specs"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{htmlFor:"auto-enable",children:s({id:"specs.settings.autoEnable",defaultMessage:"Auto Enable New Specs"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.autoEnableDescription",defaultMessage:"Automatically enable newly created personal specs"})})]}),e.jsx(De,{id:"auto-enable",checked:r.autoEnable,onCheckedChange:O,disabled:b.isPending})]})]})]}),e.jsxs($,{children:[e.jsx(J,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(X,{children:s({id:"specs.settings.specStatistics",defaultMessage:"Spec Statistics"})}),e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>P(),disabled:C,children:e.jsx(Be,{className:D("h-4 w-4",C&&"animate-spin")})})]})}),e.jsx(A,{children:z?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[1,2,3,4].map(n=>e.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted animate-pulse",children:[e.jsx("div",{className:"h-8 w-12 mx-auto bg-muted-foreground/20 rounded mb-2"}),e.jsx("div",{className:"h-4 w-16 mx-auto bg-muted-foreground/20 rounded"})]},n))}):Z?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s({id:"specs.injection.loadError",defaultMessage:"Failed to load statistics"})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-4",children:R.filter(([n])=>n[0]==="specs"||n[1]==="personal").map(([n,w])=>e.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[e.jsx("div",{className:"text-2xl font-bold text-foreground",children:w.count}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s({id:`specs.dimension.${n}`,defaultMessage:n})}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[w.requiredCount," ",s({id:"specs.required",defaultMessage:"required"})]})]},n))}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:s({id:"specs.settings.totalSpecs",defaultMessage:"Total: {count} spec files"},{count:I})}),e.jsxs("span",{children:[Y," ",s({id:"specs.readMode.required",defaultMessage:"required"})," | ",I-Y," ",s({id:"specs.readMode.optional",defaultMessage:"optional"})]})]})})]})})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(X,{children:s({id:"specs.settings.devProgressInjection",defaultMessage:"Development Progress Injection"})})]}),e.jsx(ie,{children:s({id:"specs.settings.devProgressInjectionDesc",defaultMessage:"Control how development progress from project-tech.json is injected into AI context"})})]}),e.jsxs(A,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{children:s({id:"specs.settings.enableDevProgress",defaultMessage:"Enable Injection"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.enableDevProgressDesc",defaultMessage:"Include development history in AI context"})})]}),e.jsx(De,{checked:d.enabled,onCheckedChange:c,disabled:b.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:s({id:"specs.settings.maxEntries",defaultMessage:"Max Entries per Category"})}),e.jsx(le,{type:"number",min:1,max:50,value:d.maxEntriesPerCategory,onChange:n=>y(n.target.value),disabled:b.isPending||!d.enabled,className:"w-24"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.maxEntriesDesc",defaultMessage:"Maximum number of entries to include per category (1-50)"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:s({id:"specs.settings.includeCategories",defaultMessage:"Include Categories"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["feature","enhancement","bugfix","refactor","docs"].map(n=>e.jsxs(S,{variant:d.categories.includes(n)?"default":"outline",className:D("cursor-pointer transition-colors",!d.enabled&&"opacity-50 cursor-not-allowed"),onClick:()=>d.enabled&&q(n),children:[s({id:`specs.devCategory.${n}`,defaultMessage:n})," (",(l==null?void 0:l.categories[n])||0,")"]},n))}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.categoriesDesc",defaultMessage:"Click to toggle category inclusion"})})]}),l&&e.jsx("div",{className:"text-sm text-muted-foreground pt-4 border-t border-border",children:l.last_updated?s({id:"specs.settings.devProgressStats",defaultMessage:"{total} entries from {sessions} sessions, last updated: {date}"},{total:l.total_features,sessions:l.total_sessions,date:new Date(l.last_updated).toLocaleDateString()}):s({id:"specs.settings.devProgressStatsNoDate",defaultMessage:"{total} entries from {sessions} sessions"},{total:l.total_features,sessions:l.total_sessions})})]})]})]})}const Mt=["general","exploration","planning","execution"];function St(s,t){return{id:s.file,title:s.title,dimension:t,scope:s.scope||"project",category:s.category||"general",keywords:s.keywords,readMode:s.readMode,priority:s.priority,file:s.file,enabled:!0}}function At(){const{formatMessage:s}=re(),t=zs(_s),[r,v]=i.useState("project-specs"),[d,x]=i.useState(""),[m,u]=i.useState("all"),[h,j]=i.useState("all"),[C,k]=i.useState(!1),[P,l]=i.useState(!1),[b,F]=i.useState(null),[O,c]=i.useState(null),{data:y,isLoading:q,refetch:B}=Zs({projectPath:t}),{data:R}=et({projectPath:t}),I=st(),{projectSpecs:Y,personalSpecs:z,globalPersonalSpecs:Z,projectPersonalSpecs:n,categoryCounts:w}=i.useMemo(()=>{if(!(y!=null&&y.specs))return{projectSpecs:[],personalSpecs:[],globalPersonalSpecs:[],projectPersonalSpecs:[],categoryCounts:{general:0,exploration:0,planning:0,execution:0}};const g=[],M=[],L=[],N=[],G={general:0,exploration:0,planning:0,execution:0};for(const[oe,de]of Object.entries(y.specs))for(const ge of de){const H=St(ge,oe);H.category&&G[H.category]++,oe==="personal"?(M.push(H),H.scope==="global"?L.push(H):N.push(H)):g.push(H)}return{projectSpecs:g,personalSpecs:M,globalPersonalSpecs:L,projectPersonalSpecs:N,categoryCounts:G}},[y]),_=q,se=g=>{c(g),l(!0)},ue=g=>{F(g),k(!0)},Te=async(g,M)=>{console.log("Saving spec:",g,M),k(!1)},Fe=async(g,M)=>{console.log("Saving spec content:",g,M.length)},xe=async(g,M)=>{console.log("Toggling spec:",g,M)},V=async g=>{console.log("Deleting spec:",g)},Oe=async()=>{console.log("Rebuilding index..."),I.mutate(void 0,{onSuccess:()=>{B()}})},ce=g=>{let M=g;if(h!=="all"&&(M=M.filter(L=>L.category===h)),d.trim()){const L=d.toLowerCase();M=M.filter(N=>N.title.toLowerCase().includes(L)||N.keywords.some(G=>G.toLowerCase().includes(L)))}return M},he=g=>{let M=g==="project"?Y:z;g==="personal"&&(m==="global"?M=Z:m==="project"&&(M=n));const L=ce(M);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Ws,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(le,{placeholder:s({id:"specs.searchPlaceholder",defaultMessage:"Search specs..."}),value:d,onChange:N=>x(N.target.value),className:"pl-9"})]}),e.jsxs(f,{variant:"outline",onClick:Oe,disabled:I.isPending,children:[e.jsx(Be,{className:`h-4 w-4 mr-2 ${I.isPending?"animate-spin":""}`}),s({id:"specs.rebuildIndex",defaultMessage:"Rebuild Index"})]})]}),g==="personal"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"specs.filterByScope",defaultMessage:"Filter by scope:"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(f,{variant:m==="all"?"default":"outline",size:"sm",onClick:()=>u("all"),children:[s({id:"specs.scope.all",defaultMessage:"All"})," (",z.length,")"]}),e.jsxs(f,{variant:m==="global"?"default":"outline",size:"sm",onClick:()=>u("global"),children:[e.jsx(Ve,{className:"h-3 w-3 mr-1"}),s({id:"specs.scope.global",defaultMessage:"Global"})," (",Z.length,")"]}),e.jsxs(f,{variant:m==="project"?"default":"outline",size:"sm",onClick:()=>u("project"),children:[e.jsx(We,{className:"h-3 w-3 mr-1"}),s({id:"specs.scope.project",defaultMessage:"Project"})," (",n.length,")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"specs.filterByCategory",defaultMessage:"Workflow stage:"})}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(f,{variant:h==="all"?"default":"outline",size:"sm",onClick:()=>j("all"),children:s({id:"specs.category.all",defaultMessage:"All"})}),Mt.map(N=>e.jsxs(f,{variant:h===N?"default":"outline",size:"sm",onClick:()=>j(N),children:[s({id:`specs.category.${N}`,defaultMessage:N})," (",w[N],")"]},N))]})]}),(R==null?void 0:R.dimensions)&&e.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(R.dimensions).filter(([N])=>N==="specs"||N==="personal").map(([N,G])=>e.jsx($,{children:e.jsxs(A,{className:"pt-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s({id:`specs.dimension.${N}`,defaultMessage:N})}),e.jsx("div",{className:"text-2xl font-bold",children:G.count}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[G.requiredCount," ",s({id:"specs.required",defaultMessage:"required"})]})]})},N))}),L.length===0?e.jsx($,{children:e.jsx(A,{className:"py-8 text-center text-muted-foreground",children:s(_?{id:"specs.loading",defaultMessage:"Loading specs..."}:{id:"specs.noSpecs",defaultMessage:"No specs found. Create specs in .ccw/ directory."})})}):e.jsx("div",{className:"grid gap-4",children:L.map(N=>e.jsx(ct,{spec:N,onView:se,onEdit:ue,onToggle:xe,onDelete:V},N.id))})]})};return e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(ls,{className:"h-6 w-6"}),s({id:"specs.pageTitle",defaultMessage:"Spec Settings"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"specs.pageDescription",defaultMessage:"Manage specification injection and system settings"})})]}),e.jsxs(Gs,{value:r,onValueChange:g=>v(g),children:[e.jsxs(Bs,{className:"grid grid-cols-4 mb-6",children:[e.jsxs(ye,{value:"project-specs",className:"flex items-center gap-2",children:[e.jsx(ls,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabProjectSpecs",defaultMessage:"Project Specs"})})]}),e.jsxs(ye,{value:"personal-specs",className:"flex items-center gap-2",children:[e.jsx(Vs,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabPersonalSpecs",defaultMessage:"Personal"})})]}),e.jsxs(ye,{value:"injection",className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabInjection",defaultMessage:"Injection"})})]}),e.jsxs(ye,{value:"settings",className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabSettings",defaultMessage:"Settings"})})]})]}),e.jsx(Ne,{value:"project-specs",children:he("project")}),e.jsx(Ne,{value:"personal-specs",children:he("personal")}),e.jsx(Ne,{value:"injection",children:e.jsx(jt,{})}),e.jsx(Ne,{value:"settings",children:e.jsx(bt,{})})]}),e.jsx(mt,{open:C,onOpenChange:k,spec:b,onSave:Te}),e.jsx(xt,{open:P,onOpenChange:l,spec:O,onSave:Fe})]})}export{At as SpecsSettingsPage,At as default};
10
- //# sourceMappingURL=SpecsSettingsPage-D9Y6-U-n.js.map
9
+ Content here...`}),disabled:m})]})}),e.jsx(ds,{children:h==="edit"?e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"outline",onClick:O,disabled:m,children:u({id:"specs.common.cancel",defaultMessage:"Cancel"})}),e.jsx(f,{onClick:F,disabled:m,children:m?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),u({id:"specs.common.saving",defaultMessage:"Saving..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"h-4 w-4 mr-2"}),u({id:"specs.common.save",defaultMessage:"Save"})]})})]}):e.jsx(f,{variant:"outline",onClick:()=>t(!1),children:u({id:"specs.common.close",defaultMessage:"Close"})})})]})}):null}const ht=["general","exploration","planning","execution"],we={general:{color:"text-gray-600",bgColor:"bg-gray-100 dark:bg-gray-800"},exploration:{color:"text-blue-600",bgColor:"bg-blue-100 dark:bg-blue-900/30"},planning:{color:"text-purple-600",bgColor:"bg-purple-100 dark:bg-purple-900/30"},execution:{color:"text-green-600",bgColor:"bg-green-100 dark:bg-green-900/30"}},be=[{id:"spec-injection-session",name:"Spec Context Injection (Session)",event:"SessionStart",command:"ccw spec load --stdin",scope:"global",description:"Automatically inject spec context when Claude session starts"},{id:"spec-injection-prompt",name:"Spec Context Injection (Prompt)",event:"UserPromptSubmit",command:"ccw spec load --stdin",scope:"project",description:"Inject spec context when user submits a prompt, matching keywords"}];async function gt(){const s=await fetch("/api/specs/stats");if(!s.ok)throw new Error("Failed to fetch spec stats");return s.json()}async function us(){const s=await fetch("/api/system/settings");if(!s.ok)throw new Error("Failed to fetch system settings");return s.json()}async function pt(s){const t=await us(),r=await fetch("/api/system/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({injectionControl:{...t.injectionControl,...s}})});if(!r.ok)throw new Error("Failed to update settings");return r.json()}function E(s){return s.toLocaleString()}function ft(s,t){return t<=0?0:Math.min(100,s/t*100)}function jt({className:s}){var Ye,Ze,es,ss,ts;const{formatMessage:t}=re(),r=Xs(),[v,d]=i.useState(null),[x,m]=i.useState(!0),[u,h]=i.useState(null),[j,C]=i.useState({maxLength:8e3,warnThreshold:6e3,truncateOnExceed:!0}),[k,P]=i.useState(!0),[l,b]=i.useState(j),[F,O]=i.useState(!1),[c,y]=i.useState(!1),[q,B]=i.useState([]),R=Ys(),[I,Y]=i.useState("required"),[z,Z]=i.useState("all"),[n,w]=i.useState(null),[_,se]=i.useState(!1),[ue,Te]=i.useState({specs:!0,personal:!0}),[Fe,xe]=i.useState(!1),[V,Oe]=i.useState(null),[ce,he]=i.useState(ns[0]),[g,M]=i.useState(null),[L,N]=i.useState(!1),[G,oe]=i.useState(!1),de=i.useCallback(async()=>{m(!0),h(null);try{const a=await gt();d(a)}catch(a){h(a instanceof Error?a:new Error("Unknown error"))}finally{m(!1)}},[]),ge=i.useCallback(async()=>{P(!0);try{const a=await us();C(a.injectionControl),b(a.injectionControl)}catch(a){console.error("Failed to load settings:",a)}finally{P(!1)}},[]),H=i.useCallback(async()=>{se(!0);try{const a=await Re(I,!1);w(a)}catch(a){console.error("Failed to load injection preview:",a)}finally{se(!1)}},[I]),xs=i.useCallback(async a=>{try{const p=(await Re(I,!0)).files.find(T=>T.file===a.file);p&&(Oe(p),xe(!0))}catch(o){console.error("Failed to load file preview:",o)}},[I]),hs=i.useCallback(async a=>{N(!0);try{const o=await Re(a.mode,!0,void 0,a.category);M(o),he(a),oe(!0)}catch(o){console.error("Failed to load command preview:",o)}finally{N(!1)}},[]);i.useEffect(()=>{de(),ge()},[de,ge]),i.useEffect(()=>{H()},[H]),i.useEffect(()=>{const a=l.maxLength!==j.maxLength||l.warnThreshold!==j.warnThreshold||l.truncateOnExceed!==j.truncateOnExceed;O(a)},[l,j]);const te=(a,o)=>{b(p=>({...p,[a]:o}))},gs=async()=>{y(!0);try{const a=await pt(l);C(a.injectionControl),b(a.injectionControl),O(!1),U.success(t({id:"specs.injection.saveSuccess"},{default:"Settings saved successfully"}))}catch(a){U.error(t({id:"specs.injection.saveError"},{default:"Failed to save settings"})),console.error("Failed to save settings:",a)}finally{y(!1)}},ps=()=>{b(j),O(!1)},pe=l.maxLength<1e3||l.maxLength>5e4?t({id:"specs.injection.maxLengthError",defaultMessage:"Must be between 1000 and 50000"}):null,fe=l.warnThreshold<0||l.warnThreshold>=l.maxLength?t({id:"specs.injection.warnThresholdError",defaultMessage:"Must be less than max length"}):null,fs=a=>{Te(o=>({...o,[a]:!o[a]}))},je=i.useMemo(()=>{var p;const a=new Set,o=(p=R.data)==null?void 0:p.recommendedHooks;return o&&o.forEach(T=>{T.installed&&a.add(T.id)}),a},[(Ye=R.data)==null?void 0:Ye.recommendedHooks]),We=je.size,Ue=We===be.length,js=i.useCallback(async a=>{B(o=>[...o,a]);try{await r.installHooks([a],"global"),U.success(t({id:"specs.hooks.installSuccess",defaultMessage:"Hook installed successfully"}))}catch(o){U.error(t({id:"specs.hooks.installError",defaultMessage:"Failed to install hook"})),console.error("Failed to install hook:",o)}finally{B(o=>o.filter(p=>p!==a))}},[r,t]),vs=i.useCallback(async()=>{const a=be.filter(o=>!je.has(o.id));if(a.length!==0){B(a.map(o=>o.id));try{await r.installHooks(a.map(o=>o.id),"global"),U.success(t({id:"specs.hooks.installAllSuccess",defaultMessage:"All hooks installed successfully"}))}catch(o){U.error(t({id:"specs.hooks.installError",defaultMessage:"Failed to install hooks"})),console.error("Failed to install hooks:",o)}finally{B([])}}},[je,r,t]),ys=i.useMemo(()=>{if(!n)return{};const a={};for(const o of n.files)z!=="all"&&o.category!==z||(a[o.dimension]||(a[o.dimension]=[]),a[o.dimension].push(o));return a},[n,z]),Ns=i.useMemo(()=>{if(!n)return{general:0,exploration:0,planning:0,execution:0};const a={general:0,exploration:0,planning:0,execution:0};for(const o of n.files){const p=o.category||"general";a[p]!==void 0&&a[p]++}return a},[n]),ae=((Ze=v==null?void 0:v.injectionLength)==null?void 0:Ze.withKeywords)||0,Q=((es=v==null?void 0:v.injectionLength)==null?void 0:es.maxLength)||j.maxLength,Je=j.warnThreshold,Ke=ft(ae,Q),W=ae>Q,ve=ae>Je,Xe=Math.max(0,Q-ae),ws=Math.ceil(ae/80),bs=Math.ceil(Q/80);return e.jsxs("div",{className:D("space-y-6",s),children:[e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"h-5 w-5"}),t({id:"specs.recommendedHooks",defaultMessage:"Recommended Hooks"})]}),e.jsx(ie,{children:t({id:"specs.recommendedHooksDesc",defaultMessage:"One-click install spec injection hooks for automatic context loading"})})]}),e.jsxs(A,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(f,{onClick:vs,disabled:Ue||q.length>0,children:Ue?e.jsxs(e.Fragment,{children:[e.jsx(is,{className:"h-4 w-4 mr-2"}),t({id:"specs.allHooksInstalled",defaultMessage:"All Hooks Installed"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2"}),t({id:"specs.installAllHooks",defaultMessage:"Install All Hooks"})]})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[We," / ",be.length," ",t({id:"specs.hooksInstalled",defaultMessage:"installed"})]})]}),e.jsx(f,{variant:"ghost",size:"sm",asChild:!0,children:e.jsxs(Ts,{to:"/hooks",children:[e.jsx(Ge,{className:"h-4 w-4 mr-1"}),t({id:"specs.manageHooks",defaultMessage:"Manage Hooks"})]})})]}),e.jsx("div",{className:"grid gap-3",children:be.map(a=>{const o=je.has(a.id),p=q.includes(a.id);return e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.name}),o&&e.jsx(is,{className:"h-4 w-4 text-green-500"})]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:a.description}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[t({id:"specs.hookEvent",defaultMessage:"Event"}),":"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:a.event})]}),e.jsxs("span",{children:[t({id:"specs.hookScope",defaultMessage:"Scope"}),":"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:a.scope})]})]})]}),e.jsx(f,{variant:o?"outline":"default",size:"sm",disabled:o||p,onClick:()=>js(a.id),children:t(p?{id:"specs.installing",defaultMessage:"Installing..."}:o?{id:"specs.installed",defaultMessage:"Installed"}:{id:"specs.install",defaultMessage:"Install"})})]},a.id)})})]})]}),e.jsxs($,{children:[e.jsx(J,{children:e.jsxs(X,{className:"flex items-center gap-2",children:[t({id:"specs.injection.statusTitle",defaultMessage:"Current Injection Status"}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{de(),H()},disabled:x,children:e.jsx(Be,{className:D("h-4 w-4",x&&"animate-spin")})})]})}),e.jsx(A,{className:"space-y-4",children:x?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):u?e.jsx("div",{className:"text-sm text-destructive",children:t({id:"specs.injection.loadError",defaultMessage:"Failed to load stats"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t({id:"specs.injection.currentLength",defaultMessage:"Current Length"})}),e.jsxs("span",{className:D("font-medium",W&&"text-destructive",!W&&ve&&"text-yellow-600 dark:text-yellow-400"),children:[E(ae)," / ",E(Q)," ",t({id:"specs.injection.characters",defaultMessage:"characters"}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:["(~",E(ws)," / ",E(bs)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[e.jsxs("span",{children:[Ke,"%"]}),e.jsxs("span",{children:[t({id:"specs.injection.maxLimit",defaultMessage:"Max"}),": ",E(Q)]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Fs,{value:Ke,className:D("h-3",W&&"bg-destructive/20",!W&&ve&&"bg-yellow-100 dark:bg-yellow-900/30"),indicatorClassName:D(!W&&!ve&&"bg-sky-500 dark:bg-sky-400",W&&"bg-destructive",!W&&ve&&"bg-yellow-500")}),e.jsx("div",{className:"absolute top-0 h-3 flex flex-col items-center",style:{left:`${Math.min(100,Je/Q*100)}%`,transform:"translateX(-50%)"},children:e.jsx(Os,{className:"h-3 w-3 text-yellow-500 -mt-4"})})]})]}),W&&e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-destructive/10 border border-destructive/20",children:[e.jsx(Ks,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-destructive",children:t({id:"specs.injection.overLimit",defaultMessage:"Over Limit"})}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t({id:"specs.injection.overLimitDescription",defaultMessage:"Current injection content exceeds maximum length of {max} characters. Excess content will be truncated."},{max:E(Q)})})]})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(qs,{className:"h-4 w-4 text-muted-foreground"}),t({id:"specs.injection.statsInfo",defaultMessage:"Statistics"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.requiredLength",defaultMessage:"Required specs length:"})}),e.jsxs("div",{className:"text-right",children:[E(((ss=v==null?void 0:v.injectionLength)==null?void 0:ss.requiredOnly)||0)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.matchedLength",defaultMessage:"Keyword-matched length:"})}),e.jsxs("div",{className:"text-right",children:[E(((ts=v==null?void 0:v.injectionLength)==null?void 0:ts.withKeywords)||0)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsx("div",{className:"text-muted-foreground",children:t({id:"specs.injection.remaining",defaultMessage:"Remaining space:"})}),e.jsxs("div",{className:D("text-right",Xe===0&&"text-destructive"),children:[E(Xe)," (",Math.round(100-Ke),"%)"]})]})]})]})})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),t({id:"specs.injection.filesList",defaultMessage:"Injection Files"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:I==="required"?"default":"outline",size:"sm",onClick:()=>Y("required"),children:t({id:"specs.readMode.required",defaultMessage:"Required"})}),e.jsx(f,{variant:I==="all"?"default":"outline",size:"sm",onClick:()=>Y("all"),children:t({id:"specs.scope.all",defaultMessage:"All"})})]})]}),e.jsx(ie,{children:n&&e.jsxs("span",{children:[n.stats.count," ",t({id:"specs.injection.files",defaultMessage:"files"})," • ",E(n.stats.totalLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})})]}),e.jsxs(A,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(ms,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t({id:"specs.filterByCategory",defaultMessage:"Category:"})}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(f,{variant:z==="all"?"default":"outline",size:"sm",onClick:()=>Z("all"),children:t({id:"specs.category.all",defaultMessage:"All"})}),ht.map(a=>e.jsxs(f,{variant:z===a?"default":"outline",size:"sm",onClick:()=>Z(a),className:"gap-1",children:[e.jsx(Me,{className:"h-3 w-3"}),t({id:`specs.category.${a}`,defaultMessage:a})," (",Ns[a],")"]},a))]})]}),_?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"h-[300px] overflow-auto",children:e.jsx("div",{className:"space-y-2",children:Object.entries(ys).map(([a,o])=>e.jsxs("div",{className:"border rounded-lg",children:[e.jsxs("button",{className:"w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors",onClick:()=>fs(a),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[ue[a]?e.jsx(Rs,{className:"h-4 w-4"}):e.jsx(Hs,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium capitalize",children:t({id:`specs.dimension.${a}`,defaultMessage:a})}),e.jsx(S,{variant:"secondary",className:"text-xs",children:o.length})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[E(o.reduce((p,T)=>p+T.contentLength,0))," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})]}),ue[a]&&e.jsx("div",{className:"border-t",children:o.map(p=>{const T=p.category||"general",as=we[T]||we.general;return e.jsxs("div",{className:"flex items-center justify-between p-3 border-b last:border-b-0 hover:bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.scope==="global"?e.jsx(Ve,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):e.jsx(Qe,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium truncate",children:p.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.file})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{variant:"outline",className:D("text-xs gap-1",as.bgColor,as.color),children:[e.jsx(Me,{className:"h-3 w-3"}),t({id:`specs.category.${T}`,defaultMessage:T})]}),e.jsx(S,{variant:"outline",className:"text-xs",children:t({id:`specs.priority.${p.priority}`,defaultMessage:p.priority})}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:E(p.contentLength)}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>xs(p),children:e.jsx(me,{className:"h-3.5 w-3.5"})})]})]},p.file)})})]},a))})})]})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5"}),t({id:"specs.injection.commandPreview",defaultMessage:"Command Injection Preview"})]}),e.jsx(ie,{children:t({id:"specs.injection.commandPreviewDesc",defaultMessage:"Preview the content that would be injected by different CLI commands"})})]}),e.jsxs(A,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",children:ns.map(a=>e.jsxs(f,{variant:"outline",className:"h-auto flex-col items-start py-3 px-4",onClick:()=>hs(a),disabled:L,children:[e.jsx("div",{className:"font-medium text-sm",children:t({id:`specs.commandPreview.${a.labelKey}.label`,defaultMessage:a.labelKey})}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:t({id:`specs.commandPreview.${a.descriptionKey}.description`,defaultMessage:a.descriptionKey})}),e.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded mt-2 w-full text-center",children:a.command.replace("ccw spec load","").trim()||"default"})]},a.command))}),L&&e.jsxs("div",{className:"flex items-center justify-center py-4 mt-4 border rounded-lg",children:[e.jsx(ne,{className:"h-5 w-5 animate-spin text-muted-foreground mr-2"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.loadingPreview",defaultMessage:"Loading preview..."})})]})]})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsx(X,{children:t({id:"specs.injection.settingsTitle",defaultMessage:"Injection Control Settings"})}),e.jsx(ie,{children:t({id:"specs.injection.settingsDescription",defaultMessage:"Configure how spec content is injected into AI context."})})]}),e.jsx(A,{className:"space-y-6",children:k?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(ne,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"maxLength",children:t({id:"specs.injection.maxLength",defaultMessage:"Max Injection Length"})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(le,{id:"maxLength",type:"number",min:1e3,max:5e4,step:500,value:l.maxLength,onChange:a=>te("maxLength",Number(a.target.value)),className:D(pe&&"border-destructive")})}),e.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["(~",Math.ceil(l.maxLength/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]}),pe&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:pe}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.maxLengthHelp",defaultMessage:"Recommended: 4000-10000 characters (50-125 lines). Too large may consume too much context."})}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t({id:"specs.injection.quickPresets",defaultMessage:"Quick presets:"})}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",4e3),children:"4000 (50 lines)"}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",8e3),children:"8000 (100 lines)"}),e.jsx(f,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>te("maxLength",12e3),children:"12000 (150 lines)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"warnThreshold",children:t({id:"specs.injection.warnThresholdLabel",defaultMessage:"Warning Threshold"})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(le,{id:"warnThreshold",type:"number",min:500,max:l.maxLength-1,step:500,value:l.warnThreshold,onChange:a=>te("warnThreshold",Number(a.target.value)),className:D(fe&&"border-destructive")})}),e.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["(~",Math.ceil(l.warnThreshold/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"}),")"]})]}),fe&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:fe}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.warnThresholdHelp",defaultMessage:"A warning will be displayed when injection length exceeds this value."})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{htmlFor:"truncate",children:t({id:"specs.injection.truncateOnExceed",defaultMessage:"Truncate on Exceed"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"specs.injection.truncateHelp",defaultMessage:"Automatically truncate content when it exceeds the maximum length."})})]}),e.jsx(De,{id:"truncate",checked:l.truncateOnExceed,onCheckedChange:a=>te("truncateOnExceed",a)})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[e.jsx(f,{variant:"outline",onClick:ps,disabled:!F||c,children:t({id:"common.actions.reset",defaultMessage:"Reset"})}),e.jsx(f,{onClick:gs,disabled:!F||c||!!pe||!!fe,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),t({id:"common.actions.saving",defaultMessage:"Saving..."})]}):t({id:"common.actions.save",defaultMessage:"Save"})})]})]})})]}),e.jsx(Se,{open:Fe,onOpenChange:xe,children:e.jsxs(Ce,{className:"max-w-3xl max-h-[80vh]",children:[e.jsx(ke,{children:e.jsxs(Pe,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),V==null?void 0:V.title]})}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("pre",{className:"text-sm whitespace-pre-wrap p-4 bg-muted rounded-lg",children:(V==null?void 0:V.content)||t({id:"specs.content.noContent",defaultMessage:"No content available"})})})]})}),e.jsx(Se,{open:G,onOpenChange:oe,children:e.jsxs(Ce,{className:"max-w-4xl max-h-[85vh]",children:[e.jsxs(ke,{children:[e.jsxs(Pe,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5"}),t({id:"specs.injection.previewTitle",defaultMessage:"Injection Preview"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("code",{className:"bg-muted px-2 py-1 rounded text-xs",children:ce.command}),e.jsx("span",{children:"•"}),e.jsx("span",{children:t({id:`specs.commandPreview.${ce.descriptionKey}.description`,defaultMessage:ce.descriptionKey})})]})]}),e.jsxs("div",{className:"space-y-4",children:[g&&e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs(S,{variant:"secondary",children:[g.stats.count," ",t({id:"specs.injection.files",defaultMessage:"files"})]}),e.jsxs(S,{variant:"secondary",children:[E(g.stats.totalLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]}),e.jsxs(S,{variant:"secondary",children:["~",Math.ceil(g.stats.totalLength/80)," ",t({id:"specs.injection.lines",defaultMessage:"lines"})]})]}),e.jsx("div",{className:"flex-1 overflow-auto max-h-[60vh] border rounded-lg",children:g!=null&&g.files.length?e.jsx("div",{className:"space-y-4 p-4",children:g.files.map((a,o)=>{var p,T;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",className:"text-xs",children:o+1}),e.jsx("span",{className:"font-medium",children:a.title}),a.category&&e.jsx(S,{variant:"outline",className:D("text-xs",(p=we[a.category])==null?void 0:p.bgColor,(T=we[a.category])==null?void 0:T.color),children:a.category})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[E(a.contentLength)," ",t({id:"specs.injection.characters",defaultMessage:"characters"})]})]}),e.jsx("pre",{className:"text-xs whitespace-pre-wrap p-3 bg-muted rounded border-l-2 border-primary/30",children:a.content||t({id:"specs.content.noContent",defaultMessage:"No content available"})})]},a.file)})}):e.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:t({id:"specs.injection.noFiles",defaultMessage:"No files match this command"})})})]})]})})]})}const Le="/api";async function vt(){const s=await fetch(`${Le}/system/settings`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch settings: ${s.statusText}`);return await s.json()}async function yt(s){const t=await fetch(`${Le}/system/settings`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(s)});if(!t.ok)throw new Error(`Failed to update settings: ${t.statusText}`);return t.json()}async function Nt(){const s=await fetch(`${Le}/specs/stats`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch spec stats: ${s.statusText}`);return s.json()}async function wt(){const s=await fetch(`${Le}/project-tech/stats`,{credentials:"same-origin"});if(!s.ok)throw new Error(`Failed to fetch project-tech stats: ${s.statusText}`);return s.json()}const ee={all:["system-settings"],settings:()=>[...ee.all,"settings"],stats:()=>[...ee.all,"stats"],projectTech:()=>[...ee.all,"project-tech"]};function bt(){const{formatMessage:s}=re(),t=$s(),[r,v]=i.useState({defaultReadMode:"optional",autoEnable:!0}),[d,x]=i.useState({enabled:!0,maxEntriesPerCategory:10,categories:["feature","enhancement","bugfix","refactor","docs"]}),{data:m,isLoading:u,error:h}=He({queryKey:ee.settings(),queryFn:vt,staleTime:6e4}),{data:j,isLoading:C,error:k,refetch:P}=He({queryKey:ee.stats(),queryFn:Nt,staleTime:3e4}),{data:l}=He({queryKey:ee.projectTech(),queryFn:wt,staleTime:6e4}),b=As({mutationFn:yt,onSuccess:n=>{t.setQueryData(ee.settings(),n.settings),U.success(s({id:"specs.injection.saveSuccess",defaultMessage:"Settings saved successfully"}))},onError:n=>{U.error(s({id:"specs.injection.saveError",defaultMessage:"Failed to save settings: {error}"},{error:n.message}))}});i.useEffect(()=>{m!=null&&m.personalSpecDefaults&&v(m.personalSpecDefaults),m!=null&&m.devProgressInjection&&x(m.devProgressInjection)},[m]);const F=n=>{const w={...r,defaultReadMode:n};v(w),b.mutate({personalSpecDefaults:w})},O=n=>{const w={...r,autoEnable:n};v(w),b.mutate({personalSpecDefaults:w})},c=n=>{const w={...d,enabled:n};x(w),b.mutate({devProgressInjection:w})},y=n=>{const w=parseInt(n,10);if(!isNaN(w)&&w>=1&&w<=50){const _={...d,maxEntriesPerCategory:w};x(_),b.mutate({devProgressInjection:_})}},q=n=>{const w=d.categories.includes(n)?d.categories.filter(se=>se!==n):[...d.categories,n],_={...d,categories:w};x(_),b.mutate({devProgressInjection:_})},B=(j==null?void 0:j.dimensions)||{},R=Object.entries(B).filter(([n])=>n==="specs"||n==="personal"),I=R.reduce((n,[,w])=>n+w.count,0),Y=R.reduce((n,[,w])=>n+w.requiredCount,0),z=u||C,Z=h||k;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(X,{children:s({id:"specs.settings.personalSpecDefaults",defaultMessage:"Personal Spec Defaults"})})]}),e.jsx(ie,{children:s({id:"specs.settings.personalSpecDefaultsDesc",defaultMessage:"These settings will be applied when creating new personal specs"})})]}),e.jsxs(A,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"default-read-mode",children:s({id:"specs.settings.defaultReadMode",defaultMessage:"Default Read Mode"})}),e.jsxs($e,{value:r.defaultReadMode,onValueChange:n=>F(n),children:[e.jsx(Ae,{id:"default-read-mode",className:"w-full",children:e.jsx(ze,{placeholder:s({id:"specs.settings.selectReadMode",defaultMessage:"Select read mode"})})}),e.jsxs(_e,{children:[e.jsx(Ee,{value:"required",children:s({id:"specs.readMode.required",defaultMessage:"Required"})}),e.jsx(Ee,{value:"optional",children:s({id:"specs.readMode.optional",defaultMessage:"Optional"})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.defaultReadModeHelp",defaultMessage:"The default read mode for newly created personal specs"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{htmlFor:"auto-enable",children:s({id:"specs.settings.autoEnable",defaultMessage:"Auto Enable New Specs"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.autoEnableDescription",defaultMessage:"Automatically enable newly created personal specs"})})]}),e.jsx(De,{id:"auto-enable",checked:r.autoEnable,onCheckedChange:O,disabled:b.isPending})]})]})]}),e.jsxs($,{children:[e.jsx(J,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(X,{children:s({id:"specs.settings.specStatistics",defaultMessage:"Spec Statistics"})}),e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>P(),disabled:C,children:e.jsx(Be,{className:D("h-4 w-4",C&&"animate-spin")})})]})}),e.jsx(A,{children:z?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[1,2,3,4].map(n=>e.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted animate-pulse",children:[e.jsx("div",{className:"h-8 w-12 mx-auto bg-muted-foreground/20 rounded mb-2"}),e.jsx("div",{className:"h-4 w-16 mx-auto bg-muted-foreground/20 rounded"})]},n))}):Z?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s({id:"specs.injection.loadError",defaultMessage:"Failed to load statistics"})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-4",children:R.filter(([n])=>n[0]==="specs"||n[1]==="personal").map(([n,w])=>e.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[e.jsx("div",{className:"text-2xl font-bold text-foreground",children:w.count}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s({id:`specs.dimension.${n}`,defaultMessage:n})}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[w.requiredCount," ",s({id:"specs.required",defaultMessage:"required"})]})]},n))}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:s({id:"specs.settings.totalSpecs",defaultMessage:"Total: {count} spec files"},{count:I})}),e.jsxs("span",{children:[Y," ",s({id:"specs.readMode.required",defaultMessage:"required"})," | ",I-Y," ",s({id:"specs.readMode.optional",defaultMessage:"optional"})]})]})})]})})]}),e.jsxs($,{children:[e.jsxs(J,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(X,{children:s({id:"specs.settings.devProgressInjection",defaultMessage:"Development Progress Injection"})})]}),e.jsx(ie,{children:s({id:"specs.settings.devProgressInjectionDesc",defaultMessage:"Control how development progress from project-tech.json is injected into AI context"})})]}),e.jsxs(A,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(K,{children:s({id:"specs.settings.enableDevProgress",defaultMessage:"Enable Injection"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.enableDevProgressDesc",defaultMessage:"Include development history in AI context"})})]}),e.jsx(De,{checked:d.enabled,onCheckedChange:c,disabled:b.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:s({id:"specs.settings.maxEntries",defaultMessage:"Max Entries per Category"})}),e.jsx(le,{type:"number",min:1,max:50,value:d.maxEntriesPerCategory,onChange:n=>y(n.target.value),disabled:b.isPending||!d.enabled,className:"w-24"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.maxEntriesDesc",defaultMessage:"Maximum number of entries to include per category (1-50)"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:s({id:"specs.settings.includeCategories",defaultMessage:"Include Categories"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["feature","enhancement","bugfix","refactor","docs"].map(n=>e.jsxs(S,{variant:d.categories.includes(n)?"default":"outline",className:D("cursor-pointer transition-colors",!d.enabled&&"opacity-50 cursor-not-allowed"),onClick:()=>d.enabled&&q(n),children:[s({id:`specs.devCategory.${n}`,defaultMessage:n})," (",(l==null?void 0:l.categories[n])||0,")"]},n))}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"specs.settings.categoriesDesc",defaultMessage:"Click to toggle category inclusion"})})]}),l&&e.jsx("div",{className:"text-sm text-muted-foreground pt-4 border-t border-border",children:l.last_updated?s({id:"specs.settings.devProgressStats",defaultMessage:"{total} entries from {sessions} sessions, last updated: {date}"},{total:l.total_features,sessions:l.total_sessions,date:new Date(l.last_updated).toLocaleDateString()}):s({id:"specs.settings.devProgressStatsNoDate",defaultMessage:"{total} entries from {sessions} sessions"},{total:l.total_features,sessions:l.total_sessions})})]})]})]})}const Mt=["general","exploration","planning","execution"];function St(s,t){return{id:s.file,title:s.title,dimension:t,scope:s.scope||"project",category:s.category||"general",keywords:s.keywords,readMode:s.readMode,priority:s.priority,file:s.file,enabled:!0}}function At(){const{formatMessage:s}=re(),t=zs(_s),[r,v]=i.useState("project-specs"),[d,x]=i.useState(""),[m,u]=i.useState("all"),[h,j]=i.useState("all"),[C,k]=i.useState(!1),[P,l]=i.useState(!1),[b,F]=i.useState(null),[O,c]=i.useState(null),{data:y,isLoading:q,refetch:B}=Zs({projectPath:t}),{data:R}=et({projectPath:t}),I=st(),{projectSpecs:Y,personalSpecs:z,globalPersonalSpecs:Z,projectPersonalSpecs:n,categoryCounts:w}=i.useMemo(()=>{if(!(y!=null&&y.specs))return{projectSpecs:[],personalSpecs:[],globalPersonalSpecs:[],projectPersonalSpecs:[],categoryCounts:{general:0,exploration:0,planning:0,execution:0}};const g=[],M=[],L=[],N=[],G={general:0,exploration:0,planning:0,execution:0};for(const[oe,de]of Object.entries(y.specs))for(const ge of de){const H=St(ge,oe);H.category&&G[H.category]++,oe==="personal"?(M.push(H),H.scope==="global"?L.push(H):N.push(H)):g.push(H)}return{projectSpecs:g,personalSpecs:M,globalPersonalSpecs:L,projectPersonalSpecs:N,categoryCounts:G}},[y]),_=q,se=g=>{c(g),l(!0)},ue=g=>{F(g),k(!0)},Te=async(g,M)=>{console.log("Saving spec:",g,M),k(!1)},Fe=async(g,M)=>{console.log("Saving spec content:",g,M.length)},xe=async(g,M)=>{console.log("Toggling spec:",g,M)},V=async g=>{console.log("Deleting spec:",g)},Oe=async()=>{console.log("Rebuilding index..."),I.mutate(void 0,{onSuccess:()=>{B()}})},ce=g=>{let M=g;if(h!=="all"&&(M=M.filter(L=>L.category===h)),d.trim()){const L=d.toLowerCase();M=M.filter(N=>N.title.toLowerCase().includes(L)||N.keywords.some(G=>G.toLowerCase().includes(L)))}return M},he=g=>{let M=g==="project"?Y:z;g==="personal"&&(m==="global"?M=Z:m==="project"&&(M=n));const L=ce(M);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Qs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(le,{placeholder:s({id:"specs.searchPlaceholder",defaultMessage:"Search specs..."}),value:d,onChange:N=>x(N.target.value),className:"pl-9"})]}),e.jsxs(f,{variant:"outline",onClick:Oe,disabled:I.isPending,children:[e.jsx(Be,{className:`h-4 w-4 mr-2 ${I.isPending?"animate-spin":""}`}),s({id:"specs.rebuildIndex",defaultMessage:"Rebuild Index"})]})]}),g==="personal"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"specs.filterByScope",defaultMessage:"Filter by scope:"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(f,{variant:m==="all"?"default":"outline",size:"sm",onClick:()=>u("all"),children:[s({id:"specs.scope.all",defaultMessage:"All"})," (",z.length,")"]}),e.jsxs(f,{variant:m==="global"?"default":"outline",size:"sm",onClick:()=>u("global"),children:[e.jsx(Ve,{className:"h-3 w-3 mr-1"}),s({id:"specs.scope.global",defaultMessage:"Global"})," (",Z.length,")"]}),e.jsxs(f,{variant:m==="project"?"default":"outline",size:"sm",onClick:()=>u("project"),children:[e.jsx(Qe,{className:"h-3 w-3 mr-1"}),s({id:"specs.scope.project",defaultMessage:"Project"})," (",n.length,")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"specs.filterByCategory",defaultMessage:"Workflow stage:"})}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(f,{variant:h==="all"?"default":"outline",size:"sm",onClick:()=>j("all"),children:s({id:"specs.category.all",defaultMessage:"All"})}),Mt.map(N=>e.jsxs(f,{variant:h===N?"default":"outline",size:"sm",onClick:()=>j(N),children:[s({id:`specs.category.${N}`,defaultMessage:N})," (",w[N],")"]},N))]})]}),(R==null?void 0:R.dimensions)&&e.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(R.dimensions).filter(([N])=>N==="specs"||N==="personal").map(([N,G])=>e.jsx($,{children:e.jsxs(A,{className:"pt-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s({id:`specs.dimension.${N}`,defaultMessage:N})}),e.jsx("div",{className:"text-2xl font-bold",children:G.count}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[G.requiredCount," ",s({id:"specs.required",defaultMessage:"required"})]})]})},N))}),L.length===0?e.jsx($,{children:e.jsx(A,{className:"py-8 text-center text-muted-foreground",children:s(_?{id:"specs.loading",defaultMessage:"Loading specs..."}:{id:"specs.noSpecs",defaultMessage:"No specs found. Create specs in .ccw/ directory."})})}):e.jsx("div",{className:"grid gap-4",children:L.map(N=>e.jsx(ct,{spec:N,onView:se,onEdit:ue,onToggle:xe,onDelete:V},N.id))})]})};return e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(ls,{className:"h-6 w-6"}),s({id:"specs.pageTitle",defaultMessage:"Spec Settings"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"specs.pageDescription",defaultMessage:"Manage specification injection and system settings"})})]}),e.jsxs(Gs,{value:r,onValueChange:g=>v(g),children:[e.jsxs(Bs,{className:"grid grid-cols-4 mb-6",children:[e.jsxs(ye,{value:"project-specs",className:"flex items-center gap-2",children:[e.jsx(ls,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabProjectSpecs",defaultMessage:"Project Specs"})})]}),e.jsxs(ye,{value:"personal-specs",className:"flex items-center gap-2",children:[e.jsx(Vs,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabPersonalSpecs",defaultMessage:"Personal"})})]}),e.jsxs(ye,{value:"injection",className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabInjection",defaultMessage:"Injection"})})]}),e.jsxs(ye,{value:"settings",className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s({id:"specs.tabSettings",defaultMessage:"Settings"})})]})]}),e.jsx(Ne,{value:"project-specs",children:he("project")}),e.jsx(Ne,{value:"personal-specs",children:he("personal")}),e.jsx(Ne,{value:"injection",children:e.jsx(jt,{})}),e.jsx(Ne,{value:"settings",children:e.jsx(bt,{})})]}),e.jsx(mt,{open:C,onOpenChange:k,spec:b,onSave:Te}),e.jsx(xt,{open:P,onOpenChange:l,spec:O,onSave:Fe})]})}export{At as SpecsSettingsPage,At as default};
10
+ //# sourceMappingURL=SpecsSettingsPage-BdVPM5R6.js.map