claude-code-workflow 7.2.15 → 7.2.16

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 (526) hide show
  1. package/.ccw/workflows/cli-templates/schemas/team-tasks-schema.json +255 -0
  2. package/.codex/agents/team-supervisor.toml +39 -0
  3. package/.codex/agents/team-worker.toml +46 -0
  4. package/.codex/skills/team-arch-opt/SKILL.md +151 -698
  5. package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -0
  6. package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -0
  7. package/.codex/skills/team-arch-opt/roles/coordinator/commands/dispatch.md +287 -0
  8. package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +204 -0
  9. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +162 -0
  10. package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -0
  11. package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -0
  12. package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -0
  13. package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -0
  14. package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -0
  15. package/.codex/skills/team-arch-opt/specs/team-config.json +263 -0
  16. package/.codex/skills/team-brainstorm/SKILL.md +167 -724
  17. package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -0
  18. package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -0
  19. package/.codex/skills/team-brainstorm/roles/coordinator/commands/dispatch.md +162 -0
  20. package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +171 -0
  21. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +140 -0
  22. package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -0
  23. package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -0
  24. package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -0
  25. package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -0
  26. package/.codex/skills/team-brainstorm/specs/team-config.json +86 -0
  27. package/.codex/skills/team-coordinate/SKILL.md +267 -667
  28. package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  29. package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +126 -0
  30. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +327 -0
  31. package/.codex/skills/team-coordinate/roles/coordinator/role.md +361 -0
  32. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  33. package/.codex/skills/team-coordinate/specs/pipelines.md +97 -0
  34. package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -0
  35. package/.codex/skills/team-coordinate/specs/role-spec-template.md +192 -0
  36. package/.codex/skills/team-designer/SKILL.md +153 -691
  37. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -0
  38. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -0
  39. package/.codex/skills/team-designer/phases/03-content-generation.md +330 -0
  40. package/.codex/skills/team-designer/phases/04-validation.md +320 -0
  41. package/.codex/skills/team-executor/SKILL.md +191 -515
  42. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +280 -0
  43. package/.codex/skills/team-executor/roles/executor/role.md +170 -0
  44. package/.codex/skills/team-executor/specs/session-schema.md +264 -0
  45. package/.codex/skills/team-frontend/SKILL.md +129 -750
  46. package/.codex/skills/team-frontend/roles/analyst/role.md +92 -0
  47. package/.codex/skills/team-frontend/roles/architect/role.md +86 -0
  48. package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -0
  49. package/.codex/skills/team-frontend/roles/coordinator/commands/dispatch.md +151 -0
  50. package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +188 -0
  51. package/.codex/skills/team-frontend/roles/coordinator/role.md +157 -0
  52. package/.codex/skills/team-frontend/roles/developer/role.md +93 -0
  53. package/.codex/skills/team-frontend/roles/qa/role.md +79 -0
  54. package/.codex/skills/team-frontend/specs/pipelines.md +76 -0
  55. package/.codex/skills/team-frontend/specs/team-config.json +84 -0
  56. package/.codex/skills/team-frontend-debug/SKILL.md +191 -821
  57. package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -0
  58. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -0
  59. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -0
  60. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +143 -0
  61. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +131 -0
  62. package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -0
  63. package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -0
  64. package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -0
  65. package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -0
  66. package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -0
  67. package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -0
  68. package/.codex/skills/team-issue/SKILL.md +166 -751
  69. package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -0
  70. package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -0
  71. package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +194 -0
  72. package/.codex/skills/team-issue/roles/coordinator/role.md +175 -0
  73. package/.codex/skills/team-issue/roles/explorer/role.md +94 -0
  74. package/.codex/skills/team-issue/roles/implementer/role.md +87 -0
  75. package/.codex/skills/team-issue/roles/integrator/role.md +84 -0
  76. package/.codex/skills/team-issue/roles/planner/role.md +81 -0
  77. package/.codex/skills/team-issue/roles/reviewer/role.md +86 -0
  78. package/.codex/skills/team-issue/specs/pipelines.md +124 -0
  79. package/.codex/skills/team-issue/specs/team-config.json +70 -0
  80. package/.codex/skills/team-iterdev/SKILL.md +134 -825
  81. package/.codex/skills/team-iterdev/roles/architect/role.md +65 -0
  82. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -0
  83. package/.codex/skills/team-iterdev/roles/coordinator/commands/dispatch.md +187 -0
  84. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +186 -0
  85. package/.codex/skills/team-iterdev/roles/coordinator/role.md +161 -0
  86. package/.codex/skills/team-iterdev/roles/developer/role.md +74 -0
  87. package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -0
  88. package/.codex/skills/team-iterdev/roles/tester/role.md +88 -0
  89. package/.codex/skills/team-iterdev/specs/pipelines.md +94 -0
  90. package/.codex/skills/team-iterdev/specs/team-config.json +172 -0
  91. package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +512 -0
  92. package/.codex/skills/team-lifecycle-v4/SKILL.md +166 -723
  93. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +104 -0
  94. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  95. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +61 -0
  96. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +177 -0
  97. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +152 -0
  98. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  99. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +63 -0
  100. package/.codex/skills/team-lifecycle-v4/roles/executor/role.md +89 -0
  101. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +108 -0
  102. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +57 -0
  103. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  104. package/.codex/skills/team-lifecycle-v4/roles/reviewer/role.md +98 -0
  105. package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +210 -0
  106. package/.codex/skills/team-lifecycle-v4/roles/tester/role.md +126 -0
  107. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +125 -0
  108. package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +82 -160
  109. package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +136 -0
  110. package/.codex/skills/team-lifecycle-v4/specs/pipelines.md +125 -0
  111. package/.codex/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  112. package/.codex/skills/team-perf-opt/SKILL.md +169 -697
  113. package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -0
  114. package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -0
  115. package/.codex/skills/team-perf-opt/roles/coordinator/commands/dispatch.md +262 -0
  116. package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +320 -0
  117. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +147 -0
  118. package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -0
  119. package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -0
  120. package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -0
  121. package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -0
  122. package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -0
  123. package/.codex/skills/team-perf-opt/specs/team-config.json +246 -0
  124. package/.codex/skills/team-planex/SKILL.md +103 -477
  125. package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -0
  126. package/.codex/skills/team-planex/roles/coordinator/commands/dispatch.md +80 -0
  127. package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +164 -0
  128. package/.codex/skills/team-planex/roles/coordinator/role.md +140 -0
  129. package/.codex/skills/team-planex/roles/executor/role.md +91 -0
  130. package/.codex/skills/team-planex/roles/planner/role.md +112 -0
  131. package/.codex/skills/team-planex/specs/pipelines.md +93 -0
  132. package/.codex/skills/team-quality-assurance/SKILL.md +148 -813
  133. package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -0
  134. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  135. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -0
  136. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +209 -0
  137. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  138. package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -0
  139. package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -0
  140. package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -0
  141. package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -0
  142. package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -0
  143. package/.codex/skills/team-quality-assurance/specs/team-config.json +131 -0
  144. package/.codex/skills/team-review/SKILL.md +148 -533
  145. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  146. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -0
  147. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +185 -0
  148. package/.codex/skills/team-review/roles/coordinator/role.md +142 -0
  149. package/.codex/skills/team-review/roles/fixer/role.md +76 -0
  150. package/.codex/skills/team-review/roles/reviewer/role.md +68 -0
  151. package/.codex/skills/team-review/roles/scanner/role.md +71 -0
  152. package/.codex/skills/team-review/specs/dimensions.md +82 -0
  153. package/.codex/skills/team-review/specs/finding-schema.json +82 -0
  154. package/.codex/skills/team-review/specs/pipelines.md +102 -0
  155. package/.codex/skills/team-review/specs/team-config.json +27 -0
  156. package/.codex/skills/team-roadmap-dev/SKILL.md +162 -683
  157. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -0
  158. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md +241 -0
  159. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +468 -0
  160. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/pause.md +90 -0
  161. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/resume.md +137 -0
  162. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +243 -0
  163. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +303 -0
  164. package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -0
  165. package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -0
  166. package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -0
  167. package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -0
  168. package/.codex/skills/team-roadmap-dev/specs/team-config.json +95 -0
  169. package/.codex/skills/team-tech-debt/SKILL.md +129 -708
  170. package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -0
  171. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  172. package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +163 -0
  173. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +231 -0
  174. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +141 -0
  175. package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -0
  176. package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -0
  177. package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -0
  178. package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -0
  179. package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -0
  180. package/.codex/skills/team-tech-debt/specs/team-config.json +129 -0
  181. package/.codex/skills/team-testing/SKILL.md +144 -769
  182. package/.codex/skills/team-testing/roles/analyst/role.md +95 -0
  183. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  184. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -0
  185. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +242 -0
  186. package/.codex/skills/team-testing/roles/coordinator/role.md +151 -0
  187. package/.codex/skills/team-testing/roles/executor/role.md +96 -0
  188. package/.codex/skills/team-testing/roles/generator/role.md +95 -0
  189. package/.codex/skills/team-testing/roles/strategist/role.md +83 -0
  190. package/.codex/skills/team-testing/specs/pipelines.md +101 -0
  191. package/.codex/skills/team-testing/specs/team-config.json +93 -0
  192. package/.codex/skills/team-uidesign/SKILL.md +133 -767
  193. package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -0
  194. package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -0
  195. package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +194 -0
  196. package/.codex/skills/team-uidesign/roles/coordinator/role.md +179 -0
  197. package/.codex/skills/team-uidesign/roles/designer/role.md +69 -0
  198. package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -0
  199. package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -0
  200. package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -0
  201. package/.codex/skills/team-uidesign/specs/pipelines.md +76 -0
  202. package/.codex/skills/team-uidesign/specs/team-config.json +107 -0
  203. package/.codex/skills/team-ultra-analyze/SKILL.md +166 -786
  204. package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -0
  205. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -0
  206. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md +225 -0
  207. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +327 -0
  208. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +223 -0
  209. package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -0
  210. package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -0
  211. package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -0
  212. package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -0
  213. package/.codex/skills/team-ultra-analyze/specs/team-config.json +129 -0
  214. package/.codex/skills/team-ux-improve/SKILL.md +142 -638
  215. package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -0
  216. package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -0
  217. package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +160 -0
  218. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +138 -0
  219. package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -0
  220. package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -0
  221. package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -0
  222. package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -0
  223. package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -0
  224. package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -0
  225. package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -0
  226. package/.codex/skills/team-ux-improve/specs/team-config.json +181 -0
  227. package/.codex/skills/team-ux-improve/wisdom/anti-patterns/common-ux-pitfalls.md +17 -0
  228. package/.codex/skills/team-ux-improve/wisdom/contributions/.gitkeep +0 -0
  229. package/.codex/skills/team-ux-improve/wisdom/patterns/state-management.md +14 -0
  230. package/.codex/skills/team-ux-improve/wisdom/patterns/ui-feedback.md +16 -0
  231. package/.codex/skills/team-ux-improve/wisdom/principles/general-ux.md +16 -0
  232. package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -1
  233. package/ccw/dist/core/routes/cli-settings-routes.js +135 -133
  234. package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -1
  235. package/ccw/frontend/dist/assets/{AlertDialog-BW9jiZ-p.js → AlertDialog-CnpjWAGm.js} +2 -2
  236. package/ccw/frontend/dist/assets/{AlertDialog-BW9jiZ-p.js.map → AlertDialog-CnpjWAGm.js.map} +1 -1
  237. package/ccw/frontend/dist/assets/{AnalysisPage-ds-w_nVO.js → AnalysisPage-BT2rDDUD.js} +2 -2
  238. package/ccw/frontend/dist/assets/{AnalysisPage-ds-w_nVO.js.map → AnalysisPage-BT2rDDUD.js.map} +1 -1
  239. package/ccw/frontend/dist/assets/{ApiSettingsPage-DlCbXxTz.js → ApiSettingsPage-DGpjiNVu.js} +2 -2
  240. package/ccw/frontend/dist/assets/{ApiSettingsPage-DlCbXxTz.js.map → ApiSettingsPage-DGpjiNVu.js.map} +1 -1
  241. package/ccw/frontend/dist/assets/{CliModeToggle-Dq3nL4fF.js → CliModeToggle-BqUadHn3.js} +2 -2
  242. package/ccw/frontend/dist/assets/{CliModeToggle-Dq3nL4fF.js.map → CliModeToggle-BqUadHn3.js.map} +1 -1
  243. package/ccw/frontend/dist/assets/{CliSessionSharePage-BNDkEE4u.js → CliSessionSharePage-C3AdsDkm.js} +2 -2
  244. package/ccw/frontend/dist/assets/{CliSessionSharePage-BNDkEE4u.js.map → CliSessionSharePage-C3AdsDkm.js.map} +1 -1
  245. package/ccw/frontend/dist/assets/{CliViewerPage-ChM-uNx_.js → CliViewerPage-BZXpgY0N.js} +2 -2
  246. package/ccw/frontend/dist/assets/{CliViewerPage-ChM-uNx_.js.map → CliViewerPage-BZXpgY0N.js.map} +1 -1
  247. package/ccw/frontend/dist/assets/{CodexLensPage-DOcsYNQk.js → CodexLensPage-CePoJz-u.js} +2 -2
  248. package/ccw/frontend/dist/assets/{CodexLensPage-DOcsYNQk.js.map → CodexLensPage-CePoJz-u.js.map} +1 -1
  249. package/ccw/frontend/dist/assets/{Collapsible-CRNbykXN.js → Collapsible-DXVzWwmb.js} +2 -2
  250. package/ccw/frontend/dist/assets/{Collapsible-CRNbykXN.js.map → Collapsible-DXVzWwmb.js.map} +1 -1
  251. package/ccw/frontend/dist/assets/{CommandsManagerPage-C2JWcemF.js → CommandsManagerPage-B6wJYF0z.js} +2 -2
  252. package/ccw/frontend/dist/assets/{CommandsManagerPage-C2JWcemF.js.map → CommandsManagerPage-B6wJYF0z.js.map} +1 -1
  253. package/ccw/frontend/dist/assets/{DeepWikiPage-CvleOtJy.js → DeepWikiPage-D55fcvSk.js} +2 -2
  254. package/ccw/frontend/dist/assets/{DeepWikiPage-CvleOtJy.js.map → DeepWikiPage-D55fcvSk.js.map} +1 -1
  255. package/ccw/frontend/dist/assets/{EndpointsPage-CMOWQG64.js → EndpointsPage-DcGziJ5t.js} +2 -2
  256. package/ccw/frontend/dist/assets/{EndpointsPage-CMOWQG64.js.map → EndpointsPage-DcGziJ5t.js.map} +1 -1
  257. package/ccw/frontend/dist/assets/{ExplorerPage-DaFPRlNo.js → ExplorerPage-C4eKzn7F.js} +2 -2
  258. package/ccw/frontend/dist/assets/{ExplorerPage-DaFPRlNo.js.map → ExplorerPage-C4eKzn7F.js.map} +1 -1
  259. package/ccw/frontend/dist/assets/{FixSessionPage-CC4p04Az.js → FixSessionPage-BUHh954A.js} +2 -2
  260. package/ccw/frontend/dist/assets/{FixSessionPage-CC4p04Az.js.map → FixSessionPage-BUHh954A.js.map} +1 -1
  261. package/ccw/frontend/dist/assets/{FloatingFileBrowser-DROn1xZ5.js → FloatingFileBrowser-C3GF_u1C.js} +2 -2
  262. package/ccw/frontend/dist/assets/{FloatingFileBrowser-DROn1xZ5.js.map → FloatingFileBrowser-C3GF_u1C.js.map} +1 -1
  263. package/ccw/frontend/dist/assets/{FloatingPanel-CmL_yhDv.js → FloatingPanel-Cn-q9PyJ.js} +2 -2
  264. package/ccw/frontend/dist/assets/{FloatingPanel-CmL_yhDv.js.map → FloatingPanel-Cn-q9PyJ.js.map} +1 -1
  265. package/ccw/frontend/dist/assets/{GraphExplorerPage-DCV5ybKE.js → GraphExplorerPage-DIpqgvoU.js} +2 -2
  266. package/ccw/frontend/dist/assets/{GraphExplorerPage-DCV5ybKE.js.map → GraphExplorerPage-DIpqgvoU.js.map} +1 -1
  267. package/ccw/frontend/dist/assets/{HistoryPage-D0fYQZgc.js → HistoryPage-DzSvEAFe.js} +2 -2
  268. package/ccw/frontend/dist/assets/{HistoryPage-D0fYQZgc.js.map → HistoryPage-DzSvEAFe.js.map} +1 -1
  269. package/ccw/frontend/dist/assets/{HookManagerPage-D2FuJfsM.js → HookManagerPage-C6LDhWrH.js} +2 -2
  270. package/ccw/frontend/dist/assets/{HookManagerPage-D2FuJfsM.js.map → HookManagerPage-C6LDhWrH.js.map} +1 -1
  271. package/ccw/frontend/dist/assets/{InstallationsPage-tjklillZ.js → InstallationsPage-D9ct9xFV.js} +2 -2
  272. package/ccw/frontend/dist/assets/{InstallationsPage-tjklillZ.js.map → InstallationsPage-D9ct9xFV.js.map} +1 -1
  273. package/ccw/frontend/dist/assets/{IssueHubPage-E4JVrhO1.js → IssueHubPage-CXgDC8pS.js} +2 -2
  274. package/ccw/frontend/dist/assets/{IssueHubPage-E4JVrhO1.js.map → IssueHubPage-CXgDC8pS.js.map} +1 -1
  275. package/ccw/frontend/dist/assets/{LiteTasksPage-aJuRoyLt.js → LiteTasksPage-DMkauCwG.js} +2 -2
  276. package/ccw/frontend/dist/assets/{LiteTasksPage-aJuRoyLt.js.map → LiteTasksPage-DMkauCwG.js.map} +1 -1
  277. package/ccw/frontend/dist/assets/{McpManagerPage-BJeuWJv1.js → McpManagerPage-DhLDydgc.js} +2 -2
  278. package/ccw/frontend/dist/assets/{McpManagerPage-BJeuWJv1.js.map → McpManagerPage-DhLDydgc.js.map} +1 -1
  279. package/ccw/frontend/dist/assets/{MemoryPage-BI4FAXhs.js → MemoryPage-Be3nhq40.js} +2 -2
  280. package/ccw/frontend/dist/assets/{MemoryPage-BI4FAXhs.js.map → MemoryPage-Be3nhq40.js.map} +1 -1
  281. package/ccw/frontend/dist/assets/{NotFoundPage-DD2svchp.js → NotFoundPage-0yGnCePd.js} +2 -2
  282. package/ccw/frontend/dist/assets/{NotFoundPage-DD2svchp.js.map → NotFoundPage-0yGnCePd.js.map} +1 -1
  283. package/ccw/frontend/dist/assets/{OrchestratorPage-FC__7yYa.js → OrchestratorPage-_SmXZcGl.js} +2 -2
  284. package/ccw/frontend/dist/assets/{OrchestratorPage-FC__7yYa.js.map → OrchestratorPage-_SmXZcGl.js.map} +1 -1
  285. package/ccw/frontend/dist/assets/{ProjectOverviewPage-DBB_-FzV.js → ProjectOverviewPage-BeXTMsdo.js} +2 -2
  286. package/ccw/frontend/dist/assets/{ProjectOverviewPage-DBB_-FzV.js.map → ProjectOverviewPage-BeXTMsdo.js.map} +1 -1
  287. package/ccw/frontend/dist/assets/{PromptHistoryPage-BwOAvCH8.js → PromptHistoryPage-DS6ycuAv.js} +2 -2
  288. package/ccw/frontend/dist/assets/{PromptHistoryPage-BwOAvCH8.js.map → PromptHistoryPage-DS6ycuAv.js.map} +1 -1
  289. package/ccw/frontend/dist/assets/{ReviewSessionPage-Dd1-g_gp.js → ReviewSessionPage-BoqyjhPo.js} +2 -2
  290. package/ccw/frontend/dist/assets/{ReviewSessionPage-Dd1-g_gp.js.map → ReviewSessionPage-BoqyjhPo.js.map} +1 -1
  291. package/ccw/frontend/dist/assets/{RulesManagerPage-B3RGdsKD.js → RulesManagerPage-DMAwkKlc.js} +2 -2
  292. package/ccw/frontend/dist/assets/{RulesManagerPage-B3RGdsKD.js.map → RulesManagerPage-DMAwkKlc.js.map} +1 -1
  293. package/ccw/frontend/dist/assets/{SessionDetailPage-DM-W5R8K.js → SessionDetailPage-BgJRHIF4.js} +2 -2
  294. package/ccw/frontend/dist/assets/{SessionDetailPage-DM-W5R8K.js.map → SessionDetailPage-BgJRHIF4.js.map} +1 -1
  295. package/ccw/frontend/dist/assets/{SessionsPage-BVz1KCc7.js → SessionsPage-DBPdWlji.js} +2 -2
  296. package/ccw/frontend/dist/assets/{SessionsPage-BVz1KCc7.js.map → SessionsPage-DBPdWlji.js.map} +1 -1
  297. package/ccw/frontend/dist/assets/{SettingsPage-ComW7EZS.js → SettingsPage-BY3QiJhm.js} +4 -4
  298. package/ccw/frontend/dist/assets/{SettingsPage-ComW7EZS.js.map → SettingsPage-BY3QiJhm.js.map} +1 -1
  299. package/ccw/frontend/dist/assets/{SkillsManagerPage-CKom9XwV.js → SkillsManagerPage-DS101Adm.js} +2 -2
  300. package/ccw/frontend/dist/assets/{SkillsManagerPage-CKom9XwV.js.map → SkillsManagerPage-DS101Adm.js.map} +1 -1
  301. package/ccw/frontend/dist/assets/{SpecsSettingsPage-DQz7WP2s.js → SpecsSettingsPage-BcsLu1qq.js} +2 -2
  302. package/ccw/frontend/dist/assets/{SpecsSettingsPage-DQz7WP2s.js.map → SpecsSettingsPage-BcsLu1qq.js.map} +1 -1
  303. package/ccw/frontend/dist/assets/{Switch-BPMdND9H.js → Switch-BL9AmNPC.js} +2 -2
  304. package/ccw/frontend/dist/assets/{Switch-BPMdND9H.js.map → Switch-BL9AmNPC.js.map} +1 -1
  305. package/ccw/frontend/dist/assets/{TabsNavigation-qqt70VYL.js → TabsNavigation-BUcjsLeE.js} +2 -2
  306. package/ccw/frontend/dist/assets/{TabsNavigation-qqt70VYL.js.map → TabsNavigation-BUcjsLeE.js.map} +1 -1
  307. package/ccw/frontend/dist/assets/{TaskDrawer-BqK_qiHX.js → TaskDrawer-BNvfS6dq.js} +2 -2
  308. package/ccw/frontend/dist/assets/{TaskDrawer-BqK_qiHX.js.map → TaskDrawer-BNvfS6dq.js.map} +1 -1
  309. package/ccw/frontend/dist/assets/{TeamPage-u5_i0Rgh.js → TeamPage-CT-zNCrF.js} +2 -2
  310. package/ccw/frontend/dist/assets/{TeamPage-u5_i0Rgh.js.map → TeamPage-CT-zNCrF.js.map} +1 -1
  311. package/ccw/frontend/dist/assets/{TerminalDashboardPage-rUtC9e40.js → TerminalDashboardPage-DfZFGs8g.js} +2 -2
  312. package/ccw/frontend/dist/assets/{TerminalDashboardPage-rUtC9e40.js.map → TerminalDashboardPage-DfZFGs8g.js.map} +1 -1
  313. package/ccw/frontend/dist/assets/{archive-C3u8YNQF.js → archive-Cev1SaQq.js} +2 -2
  314. package/ccw/frontend/dist/assets/{archive-C3u8YNQF.js.map → archive-Cev1SaQq.js.map} +1 -1
  315. package/ccw/frontend/dist/assets/{archive-restore-DfQ998g5.js → archive-restore-BIVluaHZ.js} +2 -2
  316. package/ccw/frontend/dist/assets/{archive-restore-DfQ998g5.js.map → archive-restore-BIVluaHZ.js.map} +1 -1
  317. package/ccw/frontend/dist/assets/{arrow-right-BshJM9Po.js → arrow-right-DrivbS5j.js} +2 -2
  318. package/ccw/frontend/dist/assets/{arrow-right-BshJM9Po.js.map → arrow-right-DrivbS5j.js.map} +1 -1
  319. package/ccw/frontend/dist/assets/{bookmark-plus-D03qJyOZ.js → bookmark-plus-DKyzL0Xg.js} +2 -2
  320. package/ccw/frontend/dist/assets/{bookmark-plus-D03qJyOZ.js.map → bookmark-plus-DKyzL0Xg.js.map} +1 -1
  321. package/ccw/frontend/dist/assets/{bot-CyzWuwq0.js → bot-GBUkPAe3.js} +2 -2
  322. package/ccw/frontend/dist/assets/{bot-CyzWuwq0.js.map → bot-GBUkPAe3.js.map} +1 -1
  323. package/ccw/frontend/dist/assets/{braces-BPgtyjsG.js → braces-BWhm2c4g.js} +2 -2
  324. package/ccw/frontend/dist/assets/{braces-BPgtyjsG.js.map → braces-BWhm2c4g.js.map} +1 -1
  325. package/ccw/frontend/dist/assets/{circle-stop-Dix1AOmw.js → circle-stop-CBcZSKNp.js} +2 -2
  326. package/ccw/frontend/dist/assets/{circle-stop-Dix1AOmw.js.map → circle-stop-CBcZSKNp.js.map} +1 -1
  327. package/ccw/frontend/dist/assets/{cpu-CCQ4Q0Zh.js → cpu-CzNmuTZD.js} +2 -2
  328. package/ccw/frontend/dist/assets/{cpu-CCQ4Q0Zh.js.map → cpu-CzNmuTZD.js.map} +1 -1
  329. package/ccw/frontend/dist/assets/{ellipsis-vertical-BpTysg-Y.js → ellipsis-vertical-BoIyQKaI.js} +2 -2
  330. package/ccw/frontend/dist/assets/{ellipsis-vertical-BpTysg-Y.js.map → ellipsis-vertical-BoIyQKaI.js.map} +1 -1
  331. package/ccw/frontend/dist/assets/{eye-DGY1rAZs.js → eye-BqxyhxQq.js} +2 -2
  332. package/ccw/frontend/dist/assets/{eye-DGY1rAZs.js.map → eye-BqxyhxQq.js.map} +1 -1
  333. package/ccw/frontend/dist/assets/{eye-off-D8t3JfWG.js → eye-off-D9dTZP1A.js} +2 -2
  334. package/ccw/frontend/dist/assets/{eye-off-D8t3JfWG.js.map → eye-off-D9dTZP1A.js.map} +1 -1
  335. package/ccw/frontend/dist/assets/{file-json-BAdJb0n8.js → file-json-CLYEUI6e.js} +2 -2
  336. package/ccw/frontend/dist/assets/{file-json-BAdJb0n8.js.map → file-json-CLYEUI6e.js.map} +1 -1
  337. package/ccw/frontend/dist/assets/{file-text-DrJFiOUB.js → file-text-D5j9C5XC.js} +2 -2
  338. package/ccw/frontend/dist/assets/{file-text-DrJFiOUB.js.map → file-text-D5j9C5XC.js.map} +1 -1
  339. package/ccw/frontend/dist/assets/{filter-CKqzYbz7.js → filter-CEUK5jsA.js} +2 -2
  340. package/ccw/frontend/dist/assets/{filter-CKqzYbz7.js.map → filter-CEUK5jsA.js.map} +1 -1
  341. package/ccw/frontend/dist/assets/{folder-CV8511y9.js → folder-BEOY8txM.js} +2 -2
  342. package/ccw/frontend/dist/assets/{folder-CV8511y9.js.map → folder-BEOY8txM.js.map} +1 -1
  343. package/ccw/frontend/dist/assets/{gauge-XKvmu_uU.js → gauge-CbumHmVn.js} +2 -2
  344. package/ccw/frontend/dist/assets/{gauge-XKvmu_uU.js.map → gauge-CbumHmVn.js.map} +1 -1
  345. package/ccw/frontend/dist/assets/{globe-C56cDUzX.js → globe-D8_IB9gV.js} +2 -2
  346. package/ccw/frontend/dist/assets/{globe-C56cDUzX.js.map → globe-D8_IB9gV.js.map} +1 -1
  347. package/ccw/frontend/dist/assets/{grid-3x3-Bya-suFW.js → grid-3x3-BpzWmYF5.js} +2 -2
  348. package/ccw/frontend/dist/assets/{grid-3x3-Bya-suFW.js.map → grid-3x3-BpzWmYF5.js.map} +1 -1
  349. package/ccw/frontend/dist/assets/{hard-drive-CmuTZpsB.js → hard-drive-QIHpGln7.js} +2 -2
  350. package/ccw/frontend/dist/assets/{hard-drive-CmuTZpsB.js.map → hard-drive-QIHpGln7.js.map} +1 -1
  351. package/ccw/frontend/dist/assets/{hash-CRPT_tJQ.js → hash-CP0YRHVs.js} +2 -2
  352. package/ccw/frontend/dist/assets/{hash-CRPT_tJQ.js.map → hash-CP0YRHVs.js.map} +1 -1
  353. package/ccw/frontend/dist/assets/{history-C1pJZQCL.js → history-hOjgVKax.js} +2 -2
  354. package/ccw/frontend/dist/assets/{history-C1pJZQCL.js.map → history-hOjgVKax.js.map} +1 -1
  355. package/ccw/frontend/dist/assets/{index-Dmt9OiEf.js → index-B_ysvdnP.js} +2 -2
  356. package/ccw/frontend/dist/assets/{index-Dmt9OiEf.js.map → index-B_ysvdnP.js.map} +1 -1
  357. package/ccw/frontend/dist/assets/{index-dWT2M6Ef.js → index-C5Oqx2xI.js} +3 -3
  358. package/ccw/frontend/dist/assets/{index-dWT2M6Ef.js.map → index-C5Oqx2xI.js.map} +1 -1
  359. package/ccw/frontend/dist/assets/{index-CI8-rBff.js → index-CJi0bWL-.js} +2 -2
  360. package/ccw/frontend/dist/assets/{index-CI8-rBff.js.map → index-CJi0bWL-.js.map} +1 -1
  361. package/ccw/frontend/dist/assets/{index-anSMmEF8.js → index-CdQpo1x0.js} +2 -2
  362. package/ccw/frontend/dist/assets/{index-anSMmEF8.js.map → index-CdQpo1x0.js.map} +1 -1
  363. package/ccw/frontend/dist/assets/{layout-grid-TSO0BFQE.js → layout-grid-C38fQyLs.js} +2 -2
  364. package/ccw/frontend/dist/assets/{layout-grid-TSO0BFQE.js.map → layout-grid-C38fQyLs.js.map} +1 -1
  365. package/ccw/frontend/dist/assets/{lightbulb-Caj6fIQD.js → lightbulb-CClbCUzu.js} +2 -2
  366. package/ccw/frontend/dist/assets/{lightbulb-Caj6fIQD.js.map → lightbulb-CClbCUzu.js.map} +1 -1
  367. package/ccw/frontend/dist/assets/{link-2-DE9lMxa-.js → link-2-CB-LKbI0.js} +2 -2
  368. package/ccw/frontend/dist/assets/{link-2-DE9lMxa-.js.map → link-2-CB-LKbI0.js.map} +1 -1
  369. package/ccw/frontend/dist/assets/{link-BZtPgLW0.js → link-BK6SBzHS.js} +2 -2
  370. package/ccw/frontend/dist/assets/{link-BZtPgLW0.js.map → link-BK6SBzHS.js.map} +1 -1
  371. package/ccw/frontend/dist/assets/{list-DubWyY-U.js → list-BME_WOA_.js} +2 -2
  372. package/ccw/frontend/dist/assets/{list-DubWyY-U.js.map → list-BME_WOA_.js.map} +1 -1
  373. package/ccw/frontend/dist/assets/{map-pin-DwN_48AF.js → map-pin-ADsnCyjJ.js} +2 -2
  374. package/ccw/frontend/dist/assets/{map-pin-DwN_48AF.js.map → map-pin-ADsnCyjJ.js.map} +1 -1
  375. package/ccw/frontend/dist/assets/{messages-square-bjxvaiM9.js → messages-square-CLflB1Cq.js} +2 -2
  376. package/ccw/frontend/dist/assets/{messages-square-bjxvaiM9.js.map → messages-square-CLflB1Cq.js.map} +1 -1
  377. package/ccw/frontend/dist/assets/{minimize-2-CGfBKD_V.js → minimize-2-B3ZNzfGr.js} +2 -2
  378. package/ccw/frontend/dist/assets/{minimize-2-CGfBKD_V.js.map → minimize-2-B3ZNzfGr.js.map} +1 -1
  379. package/ccw/frontend/dist/assets/{package-nzWY6ilt.js → package-CByPhtMG.js} +2 -2
  380. package/ccw/frontend/dist/assets/{package-nzWY6ilt.js.map → package-CByPhtMG.js.map} +1 -1
  381. package/ccw/frontend/dist/assets/{plug-CiLce49C.js → plug-BggRzPX9.js} +2 -2
  382. package/ccw/frontend/dist/assets/{plug-CiLce49C.js.map → plug-BggRzPX9.js.map} +1 -1
  383. package/ccw/frontend/dist/assets/{power-CFLmB-U9.js → power-CWuxQSJK.js} +2 -2
  384. package/ccw/frontend/dist/assets/{power-CFLmB-U9.js.map → power-CWuxQSJK.js.map} +1 -1
  385. package/ccw/frontend/dist/assets/{save-DuO6OF0C.js → save-BdJ6EX4Q.js} +2 -2
  386. package/ccw/frontend/dist/assets/{save-DuO6OF0C.js.map → save-BdJ6EX4Q.js.map} +1 -1
  387. package/ccw/frontend/dist/assets/{send-CZk9p0mM.js → send-Ce9wuY7Q.js} +2 -2
  388. package/ccw/frontend/dist/assets/{send-CZk9p0mM.js.map → send-Ce9wuY7Q.js.map} +1 -1
  389. package/ccw/frontend/dist/assets/{square-check-big-BY_1YQQg.js → square-check-big-D6jItkfw.js} +2 -2
  390. package/ccw/frontend/dist/assets/{square-check-big-BY_1YQQg.js.map → square-check-big-D6jItkfw.js.map} +1 -1
  391. package/ccw/frontend/dist/assets/{square-pen-CnZgm6g-.js → square-pen-Byxq21zp.js} +2 -2
  392. package/ccw/frontend/dist/assets/{square-pen-CnZgm6g-.js.map → square-pen-Byxq21zp.js.map} +1 -1
  393. package/ccw/frontend/dist/assets/{star-Cn1F0qy7.js → star-Codj9dvK.js} +2 -2
  394. package/ccw/frontend/dist/assets/{star-Cn1F0qy7.js.map → star-Codj9dvK.js.map} +1 -1
  395. package/ccw/frontend/dist/assets/{style-Dxs1iXCV.js → style-4bYpUGcc.js} +2 -2
  396. package/ccw/frontend/dist/assets/{style-Dxs1iXCV.js.map → style-4bYpUGcc.js.map} +1 -1
  397. package/ccw/frontend/dist/assets/{target-Bz1fLRKH.js → target-DKBoDNCn.js} +2 -2
  398. package/ccw/frontend/dist/assets/{target-Bz1fLRKH.js.map → target-DKBoDNCn.js.map} +1 -1
  399. package/ccw/frontend/dist/assets/{test-tube-C6qCYlDr.js → test-tube-DTqZcBtA.js} +2 -2
  400. package/ccw/frontend/dist/assets/{test-tube-C6qCYlDr.js.map → test-tube-DTqZcBtA.js.map} +1 -1
  401. package/ccw/frontend/dist/assets/{upload-C71kd4Qs.js → upload-DlUl-e6b.js} +2 -2
  402. package/ccw/frontend/dist/assets/{upload-C71kd4Qs.js.map → upload-DlUl-e6b.js.map} +1 -1
  403. package/ccw/frontend/dist/assets/{useApiSettings-CqP2BAJ7.js → useApiSettings-D4zhKKT-.js} +2 -2
  404. package/ccw/frontend/dist/assets/{useApiSettings-CqP2BAJ7.js.map → useApiSettings-D4zhKKT-.js.map} +1 -1
  405. package/ccw/frontend/dist/assets/{useCli-PCoPoVeM.js → useCli-D-qDwsAH.js} +2 -2
  406. package/ccw/frontend/dist/assets/{useCli-PCoPoVeM.js.map → useCli-D-qDwsAH.js.map} +1 -1
  407. package/ccw/frontend/dist/assets/{useCommands-3OfPQPw4.js → useCommands-B0sidbbW.js} +2 -2
  408. package/ccw/frontend/dist/assets/{useCommands-3OfPQPw4.js.map → useCommands-B0sidbbW.js.map} +1 -1
  409. package/ccw/frontend/dist/assets/{useDebounce-bXiFhQx9.js → useDebounce-eTtbKevt.js} +2 -2
  410. package/ccw/frontend/dist/assets/{useDebounce-bXiFhQx9.js.map → useDebounce-eTtbKevt.js.map} +1 -1
  411. package/ccw/frontend/dist/assets/{useFileExplorer-DEyUm46_.js → useFileExplorer-MGSK0h33.js} +2 -2
  412. package/ccw/frontend/dist/assets/{useFileExplorer-DEyUm46_.js.map → useFileExplorer-MGSK0h33.js.map} +1 -1
  413. package/ccw/frontend/dist/assets/{useLocale-sXTrdxcJ.js → useLocale-DDNxU7pJ.js} +2 -2
  414. package/ccw/frontend/dist/assets/{useLocale-sXTrdxcJ.js.map → useLocale-DDNxU7pJ.js.map} +1 -1
  415. package/ccw/frontend/dist/assets/{useSkills-D0W0kXYm.js → useSkills-CZCRBtMY.js} +3 -3
  416. package/ccw/frontend/dist/assets/{useSkills-D0W0kXYm.js.map → useSkills-CZCRBtMY.js.map} +1 -1
  417. package/ccw/frontend/dist/assets/{useSystemSettings-DZ-8lZsG.js → useSystemSettings-DfQEFXSD.js} +2 -2
  418. package/ccw/frontend/dist/assets/{useSystemSettings-DZ-8lZsG.js.map → useSystemSettings-DfQEFXSD.js.map} +1 -1
  419. package/ccw/frontend/dist/assets/{wand-sparkles-83GmAYuw.js → wand-sparkles-DCLvfgl1.js} +2 -2
  420. package/ccw/frontend/dist/assets/{wand-sparkles-83GmAYuw.js.map → wand-sparkles-DCLvfgl1.js.map} +1 -1
  421. package/ccw/frontend/dist/index.html +1 -1
  422. package/package.json +1 -1
  423. package/.codex/skills/team-arch-opt/agents/completion-handler.md +0 -138
  424. package/.codex/skills/team-arch-opt/agents/fix-cycle-handler.md +0 -146
  425. package/.codex/skills/team-arch-opt/agents/plan-reviewer.md +0 -150
  426. package/.codex/skills/team-arch-opt/instructions/agent-instruction.md +0 -114
  427. package/.codex/skills/team-arch-opt/schemas/tasks-schema.md +0 -174
  428. package/.codex/skills/team-brainstorm/agents/gc-controller.md +0 -122
  429. package/.codex/skills/team-brainstorm/agents/topic-clarifier.md +0 -126
  430. package/.codex/skills/team-brainstorm/instructions/agent-instruction.md +0 -105
  431. package/.codex/skills/team-brainstorm/schemas/tasks-schema.md +0 -171
  432. package/.codex/skills/team-coordinate/agents/completion-handler.md +0 -127
  433. package/.codex/skills/team-coordinate/agents/plan-reviewer.md +0 -145
  434. package/.codex/skills/team-coordinate/instructions/agent-instruction.md +0 -184
  435. package/.codex/skills/team-coordinate/schemas/tasks-schema.md +0 -165
  436. package/.codex/skills/team-designer/agents/requirement-clarifier.md +0 -247
  437. package/.codex/skills/team-designer/agents/validation-reporter.md +0 -186
  438. package/.codex/skills/team-designer/instructions/agent-instruction.md +0 -163
  439. package/.codex/skills/team-designer/schemas/tasks-schema.md +0 -180
  440. package/.codex/skills/team-executor/instructions/agent-instruction.md +0 -62
  441. package/.codex/skills/team-executor/schemas/tasks-schema.md +0 -141
  442. package/.codex/skills/team-frontend/agents/completion-handler.md +0 -131
  443. package/.codex/skills/team-frontend/agents/qa-gate-reviewer.md +0 -153
  444. package/.codex/skills/team-frontend/instructions/agent-instruction.md +0 -197
  445. package/.codex/skills/team-frontend/schemas/tasks-schema.md +0 -188
  446. package/.codex/skills/team-frontend-debug/agents/completion-handler.md +0 -142
  447. package/.codex/skills/team-frontend-debug/agents/conditional-skip-gate.md +0 -130
  448. package/.codex/skills/team-frontend-debug/agents/iteration-handler.md +0 -120
  449. package/.codex/skills/team-frontend-debug/instructions/agent-instruction.md +0 -272
  450. package/.codex/skills/team-frontend-debug/schemas/tasks-schema.md +0 -198
  451. package/.codex/skills/team-issue/agents/reviewer.md +0 -204
  452. package/.codex/skills/team-issue/instructions/agent-instruction.md +0 -198
  453. package/.codex/skills/team-issue/schemas/tasks-schema.md +0 -198
  454. package/.codex/skills/team-iterdev/agents/gc-controller.md +0 -193
  455. package/.codex/skills/team-iterdev/agents/task-analyzer.md +0 -206
  456. package/.codex/skills/team-iterdev/instructions/agent-instruction.md +0 -118
  457. package/.codex/skills/team-iterdev/schemas/tasks-schema.md +0 -174
  458. package/.codex/skills/team-lifecycle/SKILL.md +0 -906
  459. package/.codex/skills/team-lifecycle/agents/analyst.md +0 -424
  460. package/.codex/skills/team-lifecycle/agents/architect.md +0 -274
  461. package/.codex/skills/team-lifecycle/agents/discuss-agent.md +0 -422
  462. package/.codex/skills/team-lifecycle/agents/executor.md +0 -423
  463. package/.codex/skills/team-lifecycle/agents/explore-agent.md +0 -471
  464. package/.codex/skills/team-lifecycle/agents/fe-developer.md +0 -239
  465. package/.codex/skills/team-lifecycle/agents/fe-qa.md +0 -357
  466. package/.codex/skills/team-lifecycle/agents/planner.md +0 -437
  467. package/.codex/skills/team-lifecycle/agents/reviewer.md +0 -483
  468. package/.codex/skills/team-lifecycle/agents/tester.md +0 -423
  469. package/.codex/skills/team-lifecycle/agents/writer.md +0 -502
  470. package/.codex/skills/team-lifecycle/phases/01-requirement-clarification.md +0 -209
  471. package/.codex/skills/team-lifecycle/phases/02-team-initialization.md +0 -263
  472. package/.codex/skills/team-lifecycle/phases/03-task-chain-creation.md +0 -251
  473. package/.codex/skills/team-lifecycle/phases/04-pipeline-coordination.md +0 -831
  474. package/.codex/skills/team-lifecycle/phases/05-completion-report.md +0 -309
  475. package/.codex/skills/team-lifecycle/specs/document-standards.md +0 -192
  476. package/.codex/skills/team-lifecycle/specs/quality-gates.md +0 -207
  477. package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +0 -165
  478. package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +0 -163
  479. package/.codex/skills/team-lifecycle-v4/agents/supervisor.md +0 -182
  480. package/.codex/skills/team-perf-opt/agents/completion-handler.md +0 -141
  481. package/.codex/skills/team-perf-opt/agents/fix-cycle-handler.md +0 -156
  482. package/.codex/skills/team-perf-opt/agents/plan-reviewer.md +0 -150
  483. package/.codex/skills/team-perf-opt/instructions/agent-instruction.md +0 -122
  484. package/.codex/skills/team-perf-opt/schemas/tasks-schema.md +0 -174
  485. package/.codex/skills/team-planex/instructions/agent-instruction.md +0 -301
  486. package/.codex/skills/team-planex/schemas/tasks-schema.md +0 -198
  487. package/.codex/skills/team-planex-v2/SKILL.md +0 -652
  488. package/.codex/skills/team-planex-v2/instructions/agent-instruction.md +0 -193
  489. package/.codex/skills/team-planex-v2/schemas/tasks-schema.md +0 -206
  490. package/.codex/skills/team-quality-assurance/agents/executor.md +0 -192
  491. package/.codex/skills/team-quality-assurance/agents/gc-loop-handler.md +0 -163
  492. package/.codex/skills/team-quality-assurance/instructions/agent-instruction.md +0 -185
  493. package/.codex/skills/team-quality-assurance/schemas/tasks-schema.md +0 -190
  494. package/.codex/skills/team-review/agents/fixer.md +0 -360
  495. package/.codex/skills/team-review/instructions/agent-instruction.md +0 -102
  496. package/.codex/skills/team-review/schemas/tasks-schema.md +0 -143
  497. package/.codex/skills/team-roadmap-dev/agents/roadmap-discusser.md +0 -176
  498. package/.codex/skills/team-roadmap-dev/agents/roadmap-planner.md +0 -194
  499. package/.codex/skills/team-roadmap-dev/agents/roadmap-verifier.md +0 -221
  500. package/.codex/skills/team-roadmap-dev/instructions/executor-instruction.md +0 -55
  501. package/.codex/skills/team-roadmap-dev/schemas/tasks-schema.md +0 -144
  502. package/.codex/skills/team-tech-debt/agents/gc-loop-manager.md +0 -130
  503. package/.codex/skills/team-tech-debt/agents/plan-approver.md +0 -151
  504. package/.codex/skills/team-tech-debt/instructions/agent-instruction.md +0 -390
  505. package/.codex/skills/team-tech-debt/schemas/tasks-schema.md +0 -196
  506. package/.codex/skills/team-testing/agents/executor.md +0 -195
  507. package/.codex/skills/team-testing/agents/gc-loop-handler.md +0 -155
  508. package/.codex/skills/team-testing/instructions/agent-instruction.md +0 -142
  509. package/.codex/skills/team-testing/schemas/tasks-schema.md +0 -172
  510. package/.codex/skills/team-uidesign/agents/completion-handler.md +0 -177
  511. package/.codex/skills/team-uidesign/agents/gc-loop-handler.md +0 -162
  512. package/.codex/skills/team-uidesign/instructions/agent-instruction.md +0 -509
  513. package/.codex/skills/team-uidesign/schemas/tasks-schema.md +0 -187
  514. package/.codex/skills/team-ultra-analyze/agents/discussion-feedback.md +0 -155
  515. package/.codex/skills/team-ultra-analyze/agents/topic-analyzer.md +0 -153
  516. package/.codex/skills/team-ultra-analyze/instructions/agent-instruction.md +0 -169
  517. package/.codex/skills/team-ultra-analyze/schemas/tasks-schema.md +0 -180
  518. package/.codex/skills/team-ux-improve/agents/ux-designer.md +0 -136
  519. package/.codex/skills/team-ux-improve/agents/ux-explorer.md +0 -158
  520. package/.codex/skills/team-ux-improve/agents/ux-tester.md +0 -174
  521. package/.codex/skills/team-ux-improve/instructions/ux-worker-instruction.md +0 -55
  522. package/.codex/skills/team-ux-improve/schemas/tasks-schema.md +0 -87
  523. /package/.codex/skills/{team-lifecycle/templates/architecture-doc.md → team-lifecycle-v4/templates/architecture.md} +0 -0
  524. /package/.codex/skills/{team-lifecycle/templates/epics-template.md → team-lifecycle-v4/templates/epics.md} +0 -0
  525. /package/.codex/skills/{team-lifecycle → team-lifecycle-v4}/templates/product-brief.md +0 -0
  526. /package/.codex/skills/{team-lifecycle/templates/requirements-prd.md → team-lifecycle-v4/templates/requirements.md} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-dWT2M6Ef.js","assets/index-D6YeIKg_.css"])))=>i.map(i=>d[i]);
2
- import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,cr as Oe,cs as ks,ct as J,cu as Cs,cv as Ss,cw as Ts,cx as Ms,aq as Es,ar as Fs,as as ze,c as I,at as Ls,au as Us,C as V,B as _,bq as W,e as b,X as G,cy as Te,ap as Me,cz as Ds,cA as Ps,cB as Ee,aV as qe,cC as Is,I as H,_ as A,R as Y,a7 as ke,cD as Rs,bu as $e,U as Hs,l as As,cE as ge,cF as Os,cG as zs,cH as $s,S as Vs,cI as Bs,cJ as Ve,aw as Fe,cK as _s,aP as qs,an as Ws,cL as Gs,i as Ks,F as Js,N as Xs,aU as Qs,bX as Ys}from"./index-dWT2M6Ef.js";import{A as Zs,a as et,b as st,c as tt,d as at,e as nt,f as rt,g as it}from"./AlertDialog-BW9jiZ-p.js";import{u as lt,a as ot,b as ct,c as dt,d as mt,e as ut,f as xt,g as ht,h as gt,i as ft,j as pt,k as bt,l as jt}from"./useSystemSettings-DZ-8lZsG.js";import{u as Nt}from"./useLocale-sXTrdxcJ.js";import{T as vt}from"./test-tube-C6qCYlDr.js";import{L as wt}from"./link-BZtPgLW0.js";import{S as yt}from"./send-CZk9p0mM.js";import{E as ee}from"./eye-off-D8t3JfWG.js";import{E as se}from"./eye-DGY1rAZs.js";import{S as We}from"./save-DuO6OF0C.js";import{u as kt}from"./useDebounce-bXiFhQx9.js";import{C as Ge}from"./cpu-CCQ4Q0Zh.js";import{U as Ct}from"./upload-C71kd4Qs.js";import{P as St}from"./package-nzWY6ilt.js";import{F as Tt}from"./folder-CV8511y9.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C5Oqx2xI.js","assets/index-D6YeIKg_.css"])))=>i.map(i=>d[i]);
2
+ import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,cr as Oe,cs as ks,ct as J,cu as Cs,cv as Ss,cw as Ts,cx as Ms,aq as Es,ar as Fs,as as ze,c as I,at as Ls,au as Us,C as V,B as _,bq as W,e as b,X as G,cy as Te,ap as Me,cz as Ds,cA as Ps,cB as Ee,aV as qe,cC as Is,I as H,_ as A,R as Y,a7 as ke,cD as Rs,bu as $e,U as Hs,l as As,cE as ge,cF as Os,cG as zs,cH as $s,S as Vs,cI as Bs,cJ as Ve,aw as Fe,cK as _s,aP as qs,an as Ws,cL as Gs,i as Ks,F as Js,N as Xs,aU as Qs,bX as Ys}from"./index-C5Oqx2xI.js";import{A as Zs,a as et,b as st,c as tt,d as at,e as nt,f as rt,g as it}from"./AlertDialog-CnpjWAGm.js";import{u as lt,a as ot,b as ct,c as dt,d as mt,e as ut,f as xt,g as ht,h as gt,i as ft,j as pt,k as bt,l as jt}from"./useSystemSettings-DfQEFXSD.js";import{u as Nt}from"./useLocale-DDNxU7pJ.js";import{T as vt}from"./test-tube-DTqZcBtA.js";import{L as wt}from"./link-BK6SBzHS.js";import{S as yt}from"./send-Ce9wuY7Q.js";import{E as ee}from"./eye-off-D9dTZP1A.js";import{E as se}from"./eye-BqxyhxQq.js";import{S as We}from"./save-BdJ6EX4Q.js";import{u as kt}from"./useDebounce-eTtbKevt.js";import{C as Ge}from"./cpu-CzNmuTZD.js";import{U as Ct}from"./upload-DlUl-e6b.js";import{P as St}from"./package-CByPhtMG.js";import{F as Tt}from"./folder-BEOY8txM.js";/**
3
3
  * @license lucide-react v0.460.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -140,5 +140,5 @@ import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,
140
140
  border-2 border-border bg-bg text-text\r
141
141
  hover:bg-surface transition-all duration-200\r
142
142
  focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
143
- `,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(Zs,{open:le!==null,onOpenChange:Ae,children:e.jsxs(et,{children:[e.jsxs(st,{children:[e.jsx(tt,{children:"Delete Theme Slot?"}),e.jsx(at,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(nt,{children:[e.jsx(rt,{onClick:Ae,children:"Cancel"}),e.jsx(it,{onClick:xs,children:"Delete"})]})]})})]})]})}const Ot=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function zt({compact:s=!1,className:t}){const{locale:a,setLocale:i}=Nt();return e.jsxs(Es,{value:a,onValueChange:i,children:[e.jsx(Fs,{className:I(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4"}),e.jsx(ze,{})]}):e.jsx(ze,{})}),e.jsx(Ls,{children:Ot.map(c=>e.jsx(Us,{value:c.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:c.flag}),e.jsx("span",{children:c.label})]})},c.value))})]})}const Ce={discord:{id:"discord",name:"Discord",icon:"message-circle",description:"Send notifications to Discord channels via webhook",requiredFields:["webhookUrl"]},telegram:{id:"telegram",name:"Telegram",icon:"send",description:"Send notifications to Telegram chats via bot",requiredFields:["botToken","chatId"]},feishu:{id:"feishu",name:"Feishu",icon:"message-square",description:"Send notifications to Feishu (Lark) via webhook with rich card support",requiredFields:["webhookUrl"]},dingtalk:{id:"dingtalk",name:"DingTalk",icon:"bell",description:"Send notifications to DingTalk via webhook",requiredFields:["webhookUrl"]},wecom:{id:"wecom",name:"WeCom",icon:"users",description:"Send notifications to WeCom (WeChat Work) via webhook",requiredFields:["webhookUrl"]},email:{id:"email",name:"Email",icon:"mail",description:"Send notifications via SMTP email",requiredFields:["host","username","password","from","to"]},webhook:{id:"webhook",name:"Custom Webhook",icon:"link",description:"Send notifications to a custom HTTP endpoint",requiredFields:["url"]}},$t={"ask-user-question":{id:"ask-user-question",name:"Ask User Question",description:"Notification when Claude asks a question via AskUserQuestion",icon:"help-circle"},"session-start":{id:"session-start",name:"Session Start",description:"Notification when a CLI session starts",icon:"play"},"session-end":{id:"session-end",name:"Session End",description:"Notification when a CLI session ends",icon:"square"},"task-completed":{id:"task-completed",name:"Task Completed",description:"Notification when a task completes successfully",icon:"check-circle"},"task-failed":{id:"task-failed",name:"Task Failed",description:"Notification when a task fails",icon:"alert-circle"}};function Be(){return{enabled:!1,platforms:{},events:[{event:"ask-user-question",platforms:["discord","telegram"],enabled:!0},{event:"session-start",platforms:[],enabled:!1},{event:"session-end",platforms:[],enabled:!1},{event:"task-completed",platforms:[],enabled:!1},{event:"task-failed",platforms:["discord","telegram"],enabled:!0}],timeout:1e4}}function Vt({config:s,expandedPlatform:t,testing:a,onToggleExpand:i,onUpdateConfig:c,onTest:o,onSave:u,saving:p}){const{formatMessage:M}=O(),g=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],F=x=>{switch(x){case"discord":return e.jsx(Is,{className:"w-4 h-4"});case"telegram":return e.jsx(yt,{className:"w-4 h-4"});case"feishu":return e.jsx(qe,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Ee,{className:"w-4 h-4"});case"wecom":return e.jsx(Ps,{className:"w-4 h-4"});case"email":return e.jsx(Ds,{className:"w-4 h-4"});case"webhook":return e.jsx(wt,{className:"w-4 h-4"})}},y=x=>{switch(x){case"discord":return s.platforms.discord||{enabled:!1,webhookUrl:""};case"telegram":return s.platforms.telegram||{enabled:!1,botToken:"",chatId:""};case"feishu":return s.platforms.feishu||{enabled:!1,webhookUrl:""};case"dingtalk":return s.platforms.dingtalk||{enabled:!1,webhookUrl:""};case"wecom":return s.platforms.wecom||{enabled:!1,webhookUrl:""};case"email":return s.platforms.email||{enabled:!1,host:"",port:587,username:"",password:"",from:"",to:[]};case"webhook":return s.platforms.webhook||{enabled:!1,url:"",method:"POST"}}},L=x=>{var w;const j=y(x);switch(x){case"discord":return!!j.webhookUrl;case"telegram":return!!j.botToken&&!!j.chatId;case"feishu":return!!j.webhookUrl;case"dingtalk":return!!j.webhookUrl;case"wecom":return!!j.webhookUrl;case"email":const m=j;return!!(m.host&&m.username&&m.password&&m.from&&((w=m.to)==null?void 0:w.length)>0);case"webhook":return!!j.url}};return e.jsx("div",{className:"grid gap-3",children:g.map(x=>{const j=Ce[x],w=y(x),m=L(x),D=t===x;return e.jsxs(V,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>i(D?null:x),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",w.enabled&&m?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:F(x)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:j.name}),m&&e.jsxs(_,{variant:"outline",className:"text-xs text-green-600 border-green-500/30",children:[e.jsx(W,{className:"w-3 h-3 mr-1"}),M({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:j.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:w.enabled?"default":"outline",size:"sm",className:"h-7",onClick:k=>{k.stopPropagation(),c(x,{enabled:!w.enabled})},children:w.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),D?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]})}),D&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[x==="discord"&&e.jsx(Bt,{config:w,onUpdate:k=>c("discord",k)}),x==="telegram"&&e.jsx(_t,{config:w,onUpdate:k=>c("telegram",k)}),x==="feishu"&&e.jsx(Wt,{config:w,onUpdate:k=>c("feishu",k)}),x==="dingtalk"&&e.jsx(Gt,{config:w,onUpdate:k=>c("dingtalk",k)}),x==="wecom"&&e.jsx(Kt,{config:w,onUpdate:k=>c("wecom",k)}),x==="email"&&e.jsx(Jt,{config:w,onUpdate:k=>c("email",k)}),x==="webhook"&&e.jsx(qt,{config:w,onUpdate:k=>c("webhook",k)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>o(x,w),disabled:a===x||!m,children:[e.jsx(vt,{className:I("w-3.5 h-3.5 mr-1",a===x&&"animate-pulse")}),M({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(b,{variant:"default",size:"sm",onClick:u,disabled:p,children:M({id:"settings.remoteNotifications.save"})})]})]})]},x)})})}function Bt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://discord.com/api/webhooks/...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.discord.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.username"})}),e.jsx(H,{value:s.username||"",onChange:o=>t({username:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function _t({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.botToken"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.botToken||"",onChange:o=>t({botToken:o.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.botTokenHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.chatId"})}),e.jsx(H,{value:s.chatId||"",onChange:o=>t({chatId:o.target.value}),placeholder:"-1001234567890",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.chatIdHint"})})]})]})}function qt({config:s,onUpdate:t}){const{formatMessage:a}=O();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.url"})}),e.jsx(H,{value:s.url||"",onChange:i=>t({url:i.target.value}),placeholder:"https://your-server.com/webhook",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.method"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(b,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(b,{variant:s.method==="PUT"?"default":"outline",size:"sm",onClick:()=>t({method:"PUT"}),children:"PUT"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.headers"})}),e.jsx(H,{value:s.headers?JSON.stringify(s.headers):"",onChange:i=>{try{const c=i.target.value?JSON.parse(i.target.value):void 0;t({headers:c})}catch{}},placeholder:'{"Authorization": "Bearer token"}',className:"mt-1 font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.webhook.headersHint"})})]})]})}function Wt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.feishu.webhookUrlHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"feishu-useCard",checked:s.useCard||!1,onChange:o=>t({useCard:o.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"feishu-useCard",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.useCard"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:a({id:"settings.remoteNotifications.feishu.useCardHint"})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.title"})}),e.jsx(H,{value:s.title||"",onChange:o=>t({title:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Gt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.keywords"})}),e.jsx(H,{value:((o=s.keywords)==null?void 0:o.join(", "))||"",onChange:u=>t({keywords:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"keyword1, keyword2",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.keywordsHint"})})]})]})}function Kt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.mentionedList"})}),e.jsx(H,{value:((o=s.mentionedList)==null?void 0:o.join(", "))||"",onChange:u=>t({mentionedList:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"userid1, userid2, @all",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.mentionedListHint"})})]})]})}function Jt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.host"})}),e.jsx(H,{value:s.host||"",onChange:u=>t({host:u.target.value}),placeholder:"smtp.gmail.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.hostHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.port"})}),e.jsx(H,{type:"number",value:s.port||587,onChange:u=>t({port:parseInt(u.target.value,10)||587}),placeholder:"587",className:"mt-1"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"email-secure",checked:s.secure||!1,onChange:u=>t({secure:u.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"email-secure",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.secure"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.username"})}),e.jsx(H,{value:s.username||"",onChange:u=>t({username:u.target.value}),placeholder:"your-email@gmail.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.password"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.password||"",onChange:u=>t({password:u.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.from"})}),e.jsx(H,{value:s.from||"",onChange:u=>t({from:u.target.value}),placeholder:"noreply@example.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.to"})}),e.jsx(H,{value:((o=s.to)==null?void 0:o.join(", "))||"",onChange:u=>t({to:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"user1@example.com, user2@example.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.toHint"})})]})]})}function Xt({className:s}){const{formatMessage:t}=O(),[a,i]=d.useState(null),[c,o]=d.useState(!0),[u,p]=d.useState(!1),[M,g]=d.useState(null),[F,y]=d.useState(null),[L,x]=d.useState(null),j=d.useCallback(async()=>{o(!0);try{const f=await fetch("/api/notifications/remote/config");if(f.ok){const N=await f.json();i(N)}else i(Be())}catch(f){console.error("Failed to load remote notification config:",f),i(Be())}finally{o(!1)}},[]);d.useEffect(()=>{j()},[j]);const w=d.useCallback(async f=>{p(!0);try{const N=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(N.ok){const r=await N.json();i(r.config),A.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${N.status}`)}catch{A.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),m=d.useCallback(async(f,N)=>{g(f);try{const h=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:f,config:N})})).json();h.success?A.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${h.responseTime}ms`}):A.error(t({id:"settings.remoteNotifications.testFailed"}),{description:h.error})}catch{A.error(t({id:"settings.remoteNotifications.testError"}))}finally{g(null)}},[t]),D=()=>{a&&w({...a,enabled:!a.enabled})},k=(f,N)=>{if(!a)return;const r={...a,platforms:{...a.platforms,[f]:{...a.platforms[f],...N}}};i(r)},S=(f,N)=>{if(!a)return;const r=[...a.events];r[f]={...r[f],...N},i({...a,events:r})},P=(f,N)=>{if(!a)return;const r=a.events[f],h=r.platforms.includes(N)?r.platforms.filter(l=>l!==N):[...r.platforms,N];S(f,{platforms:h})},B=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],R=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const f=await fetch("/api/notifications/remote/reset",{method:"POST"});if(f.ok){const N=await f.json();i(N.config),A.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{A.error(t({id:"settings.remoteNotifications.resetError"}))}};return c?e.jsx(V,{className:I("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Y,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):a?e.jsxs(V,{className:I("p-6",s),children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[a.enabled?e.jsx(Ee,{className:"w-5 h-5 text-primary"}):e.jsx(Mt,{className:"w-5 h-5 text-muted-foreground"}),t({id:"settings.remoteNotifications.title"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(),disabled:c,children:e.jsx(Y,{className:I("w-3.5 h-3.5",c&&"animate-spin")})}),e.jsx(b,{variant:a.enabled?"default":"outline",size:"sm",onClick:D,children:a.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.disabled"})]})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:t({id:"settings.remoteNotifications.description"})}),a.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.platforms"})}),e.jsx(Vt,{config:a,expandedPlatform:F,testing:M,onToggleExpand:y,onUpdateConfig:k,onTest:m,onSave:()=>w(a),saving:u})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.events"})}),e.jsx("div",{className:"grid gap-3",children:a.events.map((f,N)=>{const r=$t[f.event],h=L===N;return e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>x(h?null:N),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",f.enabled?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.jsx("span",{className:"text-sm",children:r.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1 flex-wrap max-w-xs",children:[f.platforms.slice(0,3).map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:Ce[l].name},l)),f.platforms.length>3&&e.jsxs(_,{variant:"secondary",className:"text-xs",children:["+",f.platforms.length-3]}),f.platforms.length===0&&e.jsx(_,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(b,{variant:f.enabled?"default":"outline",size:"sm",className:"h-7",onClick:l=>{l.stopPropagation(),S(N,{enabled:!f.enabled})},children:f.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),h?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]}),h&&e.jsxs("div",{className:"border-t border-border p-4 space-y-3 bg-muted/20",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.selectPlatforms"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:B.map(l=>{const E=f.platforms.includes(l),z=Ce[l],q=a.platforms[l],$=q==null?void 0:q.enabled;return e.jsxs(b,{variant:E?"default":"outline",size:"sm",className:I("h-8",!$&&!E&&"opacity-50"),onClick:()=>P(N,l),children:[E&&e.jsx(W,{className:"w-3 h-3 mr-1"}),z.name,!$&&!E&&e.jsx(ke,{className:"w-3 h-3 ml-1 opacity-50"})]},l)})})]})]},f.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:R,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>w(a),disabled:u,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),t(u?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function Qt({value:s,label:t,description:a,selected:i,onClick:c}){const o={modal:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-3 border border-current rounded-sm"})}),drawer:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-end p-0.5",children:e.jsx("div",{className:"w-2 h-6 border border-current rounded-sm"})}),sheet:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-center p-0.5",children:e.jsx("div",{className:"w-6 h-2 border border-current rounded-sm"})}),fullscreen:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-4 border border-current rounded-sm"})})};return e.jsxs("button",{type:"button",onClick:c,className:I("flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all","hover:bg-accent/50",i?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground"),children:[o[s],e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:I("text-sm font-medium",i&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]})]})}function Yt({value:s,onChange:t,disabled:a}){const i=[10,20,30,45,60,90,120];return e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(c=>e.jsxs(b,{type:"button",variant:s===c?"default":"outline",size:"sm",disabled:a,onClick:()=>t(c),children:[c,"s"]},c))})}function Zt(){const{formatMessage:s}=O(),{preferences:t,updatePreference:a,resetPreferences:i}=Rs(),c=[{value:"modal",label:s({id:"settings.a2ui.styleModal",defaultMessage:"Modal"}),description:s({id:"settings.a2ui.styleModalDesc",defaultMessage:"Centered"})},{value:"drawer",label:s({id:"settings.a2ui.styleDrawer",defaultMessage:"Drawer"}),description:s({id:"settings.a2ui.styleDrawerDesc",defaultMessage:"Side panel"})},{value:"sheet",label:s({id:"settings.a2ui.styleSheet",defaultMessage:"Sheet"}),description:s({id:"settings.a2ui.styleSheetDesc",defaultMessage:"Bottom"})},{value:"fullscreen",label:s({id:"settings.a2ui.styleFullscreen",defaultMessage:"Fullscreen"}),description:s({id:"settings.a2ui.styleFullscreenDesc",defaultMessage:"Full screen"})}];return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(qe,{className:"w-5 h-5"}),s({id:"settings.sections.a2ui",defaultMessage:"A2UI Preferences"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs($e,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Et,{className:"w-4 h-4"}),s({id:"settings.a2ui.dialogStyle",defaultMessage:"Dialog Style"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.dialogStyleDesc",defaultMessage:"Choose how A2UI dialogs are displayed"})}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:c.map(o=>e.jsx(Qt,{value:o.value,label:o.label,description:o.description,selected:t.dialogStyle===o.value,onClick:()=>a("dialogStyle",o.value)},o.value))})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.smartMode",defaultMessage:"Smart Mode"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.smartModeDesc",defaultMessage:"Auto-select style based on question type"})})]})]}),e.jsx(b,{variant:t.smartModeEnabled?"default":"outline",size:"sm",onClick:()=>a("smartModeEnabled",!t.smartModeEnabled),children:t.smartModeEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"space-y-3 py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(As,{className:"w-4 h-4 text-muted-foreground"}),e.jsx($e,{className:"text-sm font-medium",children:s({id:"settings.a2ui.autoSelectionDuration",defaultMessage:"Auto-Selection Duration"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.autoSelectionDurationDesc",defaultMessage:"Countdown before auto-selecting default option"})}),e.jsx(Yt,{value:t.autoSelectionDuration,onChange:o=>a("autoSelectionDuration",o)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.pauseOnInteraction",defaultMessage:"Pause on Interaction"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.pauseOnInteractionDesc",defaultMessage:"Pause countdown when you interact with the dialog"})})]}),e.jsx(b,{variant:t.pauseOnInteraction?"default":"outline",size:"sm",onClick:()=>a("pauseOnInteraction",!t.pauseOnInteraction),children:t.pauseOnInteraction?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Lt,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.soundNotification",defaultMessage:"Sound Notification"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.soundNotificationDesc",defaultMessage:"Play sound before auto-submit (3 seconds before)"})})]})]}),e.jsx(b,{variant:t.autoSelectionSoundEnabled?"default":"outline",size:"sm",onClick:()=>a("autoSelectionSoundEnabled",!t.autoSelectionSoundEnabled),children:t.autoSelectionSoundEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.showToolbarButton",defaultMessage:"Show Toolbar Button"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.showToolbarButtonDesc",defaultMessage:"Show A2UI quick action button in the toolbar"})})]}),e.jsx(b,{variant:t.showA2UIButtonInToolbar?"default":"outline",size:"sm",onClick:()=>a("showA2UIButtonInToolbar",!t.showA2UIButtonInToolbar),children:t.showA2UIButtonInToolbar?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:e.jsx(b,{variant:"outline",size:"sm",onClick:i,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}function ea(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function _e({value:s,onChange:t,placeholder:a}){const[i,c]=d.useState(!1),[o,u]=d.useState(null),p=kt(s,500);d.useEffect(()=>{if(p){c(!0),u(null);const g=setTimeout(()=>{p.trim().length>0?u(null):u("Path cannot be empty."),c(!1)},1e3);return()=>clearTimeout(g)}else u(null),c(!1)},[p]);const M=async()=>{const{selectFile:g}=await Ys(async()=>{const{selectFile:L}=await import("./index-dWT2M6Ef.js").then(x=>x.gc);return{selectFile:L}},__vite__mapDeps([0,1])),F=s?s.replace(/[/\\][^/\\]*$/,""):void 0,y=await g(F);y.path&&!y.cancelled&&!y.error&&t(y.path)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(H,{value:s,onChange:g=>t(g.target.value),placeholder:a,className:I("flex-1",o&&"border-destructive")}),i&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Xs,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:M,title:"Browse",children:e.jsx(Qs,{className:"w-4 h-4"})})]}),o&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:o})]})}const sa=new Set(["gemini","qwen","opencode"]),ta=new Set(["claude"]);function Qe(s){return sa.has(s)?"envFile":ta.has(s)?"settingsFile":"none"}function aa({toolId:s,config:t,isDefault:a,isExpanded:i,toolAvailable:c,isSaving:o,onToggleExpand:u,onToggleEnabled:p,onSetDefault:M,onUpdateModel:g,onUpdateTags:F,onUpdateAvailableModels:y,onUpdateEnvFile:L,onUpdateSettingsFile:x,onUpdateEffort:j,onSaveToBackend:w}){const{formatMessage:m}=O(),[D,k]=d.useState(""),[S,P]=d.useState(""),B=()=>{const l=D.trim();l&&!t.tags.includes(l)&&(F([...t.tags,l]),k(""))},R=l=>{F(t.tags.filter(E=>E!==l))},f=()=>{const l=S.trim(),E=t.availableModels||[];l&&!E.includes(l)&&(y([...E,l]),P(""))},N=l=>{const E=t.availableModels||[];y(E.filter(z=>z!==l))},r=["分析","Debug","implementation","refactoring","testing"],h=Qe(s);return e.jsxs(V,{className:I("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:u,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(Ge,{className:I("w-5 h-5",t.enabled?"text-primary":"text-muted-foreground")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground capitalize",children:s}),a&&e.jsx(_,{variant:"default",className:"text-xs",children:m({id:"settings.cliTools.default"})}),e.jsx(_,{variant:"outline",className:"text-xs",children:t.type}),c!==void 0&&e.jsx("span",{className:I("inline-block w-2 h-2 rounded-full",c?"bg-green-500":"bg-red-400"),title:c?"Available":"Unavailable"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.primaryModel})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:l=>{l.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.disabled"})]})}),i?e.jsx(Te,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Me,{className:"w-5 h-5 text-muted-foreground"})]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.tags.map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:l},l))})]}),i&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.primaryModel"})}),e.jsx(H,{value:t.primaryModel,onChange:l=>g("primaryModel",l.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.secondaryModel"})}),e.jsx(H,{value:t.secondaryModel,onChange:l=>g("secondaryModel",l.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.tagsDescription"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[t.tags.map(l=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[l,e.jsx("button",{type:"button",onClick:()=>R(l),className:"hover:text-destructive transition-colors","aria-label":m({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:D,onChange:l=>k(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),B())},placeholder:t.tags.length===0?m({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:B,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),r.map(l=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(l)||F([...t.tags,l])},disabled:t.tags.includes(l),className:"text-xs px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l},l))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.availableModels"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[(t.availableModels||[]).map(l=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[l,e.jsx("button",{type:"button",onClick:()=>N(l),className:"hover:text-destructive transition-colors",children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:S,onChange:l=>P(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),f())},placeholder:(t.availableModels||[]).length===0?m({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:f,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.availableModelsHint"})})]}),h==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.envFile"})}),e.jsx(_e,{value:t.envFile||"",onChange:l=>L(l||void 0),placeholder:m({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.envFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(_e,{value:t.settingsFile||"",onChange:l=>x(l||void 0),placeholder:m({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.settingsFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(l=>{const E=t.effort||"high",z=`settings.cliTools.effort${l.charAt(0).toUpperCase()+l.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>j(l==="high"&&!t.effort?void 0:l),className:I("px-3 py-1.5 rounded-md text-sm border transition-colors",E===l?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:m({id:z})},l)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!a&&t.enabled&&e.jsx(b,{variant:"outline",size:"sm",onClick:M,children:m({id:"settings.cliTools.setDefault"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:w,disabled:o,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),m(o?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function na(){const{formatMessage:s}=O(),{data:t,isLoading:a}=lt(),{toggle:i,isPending:c}=ot(),{data:o,isLoading:u}=ct(),{toggle:p,isPending:M}=dt(),{data:g,isLoading:F}=mt(),{toggle:y,isPending:L}=ut(),{refresh:x,isPending:j}=xt(),{exportSettings:w,isPending:m}=ht(),{importSettings:D,isPending:k}=gt(),S=d.useRef(null),P=d.useCallback(async()=>{try{const R=await w(),f=new Blob([JSON.stringify(R,null,2)],{type:"application/json"}),N=URL.createObjectURL(f),r=document.createElement("a"),h=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);r.href=N,r.download=`ccw-settings-${h}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(N),A.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{A.error(s({id:"settings.responseLanguage.exportError"}))}},[w,s]),B=d.useCallback(async R=>{var N;const f=(N=R.target.files)==null?void 0:N[0];if(f){if(R.target.value="",!f.name.endsWith(".json")&&f.type!=="application/json"){A.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const r=await f.text(),h=JSON.parse(r);if(!h.version||!h.settings){A.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const l=await D(h);l.success?A.success(s({id:"settings.responseLanguage.importSuccess"},{imported:l.imported,skipped:l.skipped})):A.error(s({id:"settings.responseLanguage.importError"}))}catch(r){r instanceof SyntaxError?A.error(s({id:"settings.responseLanguage.importInvalidJson"})):A.error(s({id:"settings.responseLanguage.importError"}))}}},[D,s]);return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ft,{className:"w-5 h-5"}),s({id:"settings.sections.responseLanguage"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseClaude"})}),e.jsx(_,{variant:"default",className:"text-xs",children:"Claude"})]}),e.jsx(b,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,onClick:()=>i(!(t!=null&&t.claudeEnabled),"claude"),children:t!=null&&t.claudeEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseClaudeDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseCodex"})}),e.jsx(_,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsx(b,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,onClick:()=>i(!(t!=null&&t.codexEnabled),"codex"),children:t!=null&&t.codexEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseCodexDesc"})}),(t==null?void 0:t.codexNeedsMigration)&&e.jsxs("p",{className:"text-xs text-yellow-500",children:[e.jsx(Fe,{className:"w-3 h-3 inline mr-1"}),s({id:"settings.responseLanguage.migrationWarning"})]})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_s,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(b,{variant:o!=null&&o.enabled?"default":"outline",size:"sm",className:"h-7",disabled:u||M,onClick:()=>p(!(o!=null&&o.enabled)),children:o!=null&&o.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.windowsPlatformDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.cliEnhancement"})}),e.jsx(_,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[(g==null?void 0:g.enabled)&&e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:F||j,onClick:()=>x(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",j&&"animate-spin")})}),e.jsx(b,{variant:g!=null&&g.enabled?"default":"outline",size:"sm",className:"h-7",disabled:F||L,onClick:()=>y(!(g!=null&&g.enabled)),children:g!=null&&g.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.cliEnhancementDesc"})}),(g==null?void 0:g.enabled)&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:s({id:"settings.responseLanguage.cliEnhancementHint"})})]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.exportImportHint"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:S,type:"file",accept:".json,application/json",onChange:B,className:"hidden"}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:k,onClick:()=>{var R;return(R=S.current)==null?void 0:R.click()},children:k?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.importing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:m,onClick:P,children:m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.exporting"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ws,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function ra(){const{formatMessage:s}=O(),[t,a]=d.useState(null),[i,c]=d.useState(!1),[o,u]=d.useState(null),[p,M]=d.useState(null),[g,F]=d.useState(()=>{try{const x=localStorage.getItem("ccw.autoUpdate");return x===null?!0:JSON.parse(x)}catch{return!0}}),y=async(x=!1)=>{x||c(!0),u(null);try{const j=await fetch("/api/version-check");if(!j.ok)throw new Error(`HTTP ${j.status}`);const w=await j.json();if(!w.currentVersion)throw new Error("Invalid response");a(w),M(new Date)}catch(j){x||u(j instanceof Error?j.message:"Unknown error")}finally{c(!1)}};d.useEffect(()=>{if(y(!0),!g)return;const x=setInterval(()=>y(!0),3600*1e3);return()=>clearInterval(x)},[g]);const L=x=>{F(x),localStorage.setItem("ccw.autoUpdate",JSON.stringify(x))};return e.jsxs(V,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ke,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(b,{variant:"outline",size:"sm",disabled:i,onClick:()=>y(),children:[e.jsx(Y,{className:I("w-3.5 h-3.5 mr-1.5",i&&"animate-spin")}),s(i?{id:"settings.versionCheck.checking"}:{id:"settings.versionCheck.checkNow"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.currentVersion"})}),e.jsx(_,{variant:"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.currentVersion)??"..."})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.latestVersion"})}),e.jsx(_,{variant:t!=null&&t.hasUpdate?"default":"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.latestVersion)??"..."})]}),t&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx("span",{className:"text-sm font-medium",children:t.hasUpdate?s({id:"settings.versionCheck.updateAvailable"}):s({id:"settings.versionCheck.upToDate"})}),e.jsx("span",{className:I("inline-block w-2.5 h-2.5 rounded-full",t.hasUpdate?"bg-orange-500":"bg-green-500")})]}),o&&e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[e.jsx(Fe,{className:"w-4 h-4 text-destructive flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-destructive",children:[s({id:"settings.versionCheck.checkFailed"}),": ",o]})]})]}),(t==null?void 0:t.hasUpdate)&&e.jsxs("div",{className:"rounded-lg border border-orange-500/30 bg-orange-500/5 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s({id:"settings.versionCheck.updateCommand"})}),e.jsx("code",{className:"text-xs font-mono bg-muted px-3 py-1.5 rounded block",children:t.updateCommand})]}),e.jsx(b,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:"https://github.com/dyw0830/ccw/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5",children:s({id:"settings.versionCheck.viewRelease"})})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:x=>L(x.target.checked),className:"rounded border-input"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.versionCheck.autoCheck"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.versionCheck.autoCheckDesc"})})]})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s({id:"settings.versionCheck.lastChecked"}),":"," ",p?p.toLocaleTimeString():s({id:"settings.versionCheck.never"})]})]})]})]})}function ia(){const{formatMessage:s}=O(),{installations:t,isLoading:a,refetch:i}=ft(),{upgrade:c,isPending:o}=pt(),{data:u}=bt();return e.jsxs(V,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(St,{className:"w-5 h-5"}),s({id:"settings.systemStatus.title"}),!a&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[t.length," ",s({id:"settings.systemStatus.installations"})]})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>i(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",a&&"animate-spin")})})})]}),a?e.jsx("div",{className:"text-sm text-muted-foreground py-4 text-center",children:s({id:"settings.systemStatus.checking"})}):t.length===0?e.jsxs("div",{className:"text-center py-6 space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.systemStatus.noInstallations"})}),e.jsx("div",{className:"bg-muted/50 rounded-md p-3 inline-block",children:e.jsx("code",{className:"text-xs font-mono",children:"ccw install"})})]}):e.jsxs("div",{className:"space-y-3",children:[t.map(p=>{const M=p.installation_mode==="Global",g=new Date(p.installation_date).toLocaleDateString(),F=p.application_version!=="unknown"?p.application_version:p.installer_version;return e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:I("inline-flex items-center justify-center w-8 h-8 rounded-lg",M?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:M?e.jsx(Gs,{className:"w-4 h-4"}):e.jsx(Tt,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(M?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs(_,{variant:"secondary",className:"text-xs font-mono",children:["v",F]})]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"h-7",disabled:o,onClick:()=>c(p.installation_path),children:[e.jsx(Ke,{className:I("w-3.5 h-3.5 mr-1",o&&"animate-spin")}),s(o?{id:"settings.systemStatus.upgrading"}:{id:"settings.systemStatus.upgrade"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1 font-mono truncate",title:p.installation_path,children:p.installation_path}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ks,{className:"w-3 h-3"}),g]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Js,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),u&&!u.installed&&u.missingFiles.length>0&&e.jsxs("div",{className:"rounded-lg border border-yellow-500/50 bg-yellow-500/5 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-600 dark:text-yellow-500",children:[e.jsx(Fe,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",u.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[u.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),u.missingFiles.length>4&&e.jsxs("li",{children:["+",u.missingFiles.length-4," more..."]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-2",children:[e.jsxs("p",{className:"text-xs font-medium mb-1",children:[s({id:"settings.systemStatus.runToFix"}),":"]}),e.jsx("code",{className:"text-xs font-mono bg-background px-2 py-1 rounded block",children:"ccw install"})]})]})]})]})}function la({cliTools:s,defaultCliTool:t,expandedTools:a,savingTools:i,onToggleExpand:c,onToggleEnabled:o,onSetDefault:u,onUpdateModel:p,onUpdateTags:M,onUpdateAvailableModels:g,onUpdateEnvFile:F,onUpdateSettingsFile:y,onUpdateEffort:L,onSaveToBackend:x,formatMessage:j}){const{data:w}=jt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[j({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([m,D])=>{const k=w==null?void 0:w[m];return e.jsx(aa,{toolId:m,config:D,isDefault:m===t,isExpanded:a.has(m),toolAvailable:k==null?void 0:k.available,isSaving:i.has(m),onToggleExpand:()=>c(m),onToggleEnabled:()=>o(m),onSetDefault:()=>u(m),onUpdateModel:(S,P)=>p(m,S,P),onUpdateTags:S=>M(m,S),onUpdateAvailableModels:S=>g(m,S),onUpdateEnvFile:S=>F(m,S),onUpdateSettingsFile:S=>y(m,S),onUpdateEffort:S=>L(m,S),onSaveToBackend:()=>x(m)},m)})})]})}function ya(){const{formatMessage:s}=O(),{theme:t,setTheme:a}=Se(),i=ge(Os),c=ge(zs),o=ge($s),{updateCliTool:u,setDefaultCliTool:p,setUserPreferences:M,resetUserPreferences:g}=ge(),[F,y]=d.useState(new Set),[L,x]=d.useState(new Set),j=r=>{y(h=>{const l=new Set(h);return l.has(r)?l.delete(r):l.add(r),l})},w=r=>{u(r,{enabled:!i[r].enabled})},m=r=>{p(r)},D=(r,h,l)=>{u(r,{[h]:l})},k=(r,h)=>{u(r,{tags:h})},S=(r,h)=>{u(r,{availableModels:h})},P=(r,h)=>{u(r,{envFile:h})},B=(r,h)=>{u(r,{settingsFile:h})},R=(r,h)=>{u(r,{effort:h})},f=d.useCallback(async r=>{const h=i[r];if(h){x(l=>new Set(l).add(r));try{const l={enabled:h.enabled,primaryModel:h.primaryModel,secondaryModel:h.secondaryModel,tags:h.tags,availableModels:h.availableModels},E=Qe(r);E==="envFile"?l.envFile=h.envFile||null:E==="settingsFile"&&(l.settingsFile=h.settingsFile||null,l.effort=h.effort||null);const z=ea(),q={"Content-Type":"application/json"};z&&(q["X-CSRF-Token"]=z);const $=await fetch(`/api/cli/config/${r}`,{method:"PUT",headers:q,body:JSON.stringify(l),credentials:"same-origin"});if(!$.ok)throw new Error(`HTTP ${$.status}`);A.success(s({id:"settings.cliTools.configSaved"}),{description:r})}catch{A.error(s({id:"settings.cliTools.configSaveError"}),{description:r})}finally{x(l=>{const E=new Set(l);return E.delete(r),E})}}},[i,s]),N=(r,h)=>{M({[r]:h})};return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(Vs,{className:"w-6 h-6 text-primary"}),s({id:"settings.title"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"settings.description"})})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Bs,{className:"w-5 h-5"}),s({id:"settings.sections.appearance"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground mb-1",children:s({id:"settings.appearance.theme"})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.appearance.description"})}),e.jsx(At,{})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.appearance.systemFollow"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.appearance.systemFollowDesc"})})]}),e.jsx(b,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>a("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Je,{className:"w-5 h-5"}),s({id:"settings.sections.language"})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.language.displayLanguage"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.language.chooseLanguage"})})]}),e.jsx(zt,{})]})})]}),e.jsx(na,{}),e.jsx(Zt,{}),e.jsx(ia,{}),e.jsx(ra,{}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ge,{className:"w-5 h-5"}),s({id:"settings.sections.cliTools"})]}),e.jsx(la,{cliTools:i,defaultCliTool:c,expandedTools:F,savingTools:L,onToggleExpand:j,onToggleEnabled:w,onSetDefault:m,onUpdateModel:D,onUpdateTags:k,onUpdateAvailableModels:S,onUpdateEnvFile:P,onUpdateSettingsFile:B,onUpdateEffort:R,onSaveToBackend:f,formatMessage:s})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Y,{className:"w-5 h-5"}),s({id:"settings.dataRefresh.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.autoRefresh"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.autoRefreshDesc"})})]}),e.jsx(b,{variant:o.autoRefresh?"default":"outline",size:"sm",onClick:()=>N("autoRefresh",!o.autoRefresh),children:o.autoRefresh?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),o.autoRefresh&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.refreshInterval"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.refreshIntervalDesc"})})]}),e.jsx("div",{className:"flex gap-2",children:[15e3,3e4,6e4,12e4].map(r=>e.jsxs(b,{variant:o.refreshInterval===r?"default":"outline",size:"sm",onClick:()=>N("refreshInterval",r),children:[r/1e3,"s"]},r))})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ee,{className:"w-5 h-5"}),s({id:"settings.notifications.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.enableNotifications"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.enableNotificationsDesc"})})]}),e.jsx(b,{variant:o.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>N("notificationsEnabled",!o.notificationsEnabled),children:o.notificationsEnabled?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.soundEffects"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.soundEffectsDesc"})})]}),e.jsx(b,{variant:o.soundEnabled?"default":"outline",size:"sm",onClick:()=>N("soundEnabled",!o.soundEnabled),children:o.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(Xt,{}),e.jsxs(V,{className:"p-6 border-destructive/50",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ve,{className:"w-5 h-5"}),s({id:"common.actions.reset"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.reset.description"})}),e.jsxs(b,{variant:"destructive",onClick:()=>{confirm(s({id:"settings.reset.confirm"}))&&g()},children:[e.jsx(Ve,{className:"w-4 h-4 mr-2"}),s({id:"common.actions.resetToDefaults"})]})]})]})}export{ya as SettingsPage,ya as default};
144
- //# sourceMappingURL=SettingsPage-ComW7EZS.js.map
143
+ `,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(Zs,{open:le!==null,onOpenChange:Ae,children:e.jsxs(et,{children:[e.jsxs(st,{children:[e.jsx(tt,{children:"Delete Theme Slot?"}),e.jsx(at,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(nt,{children:[e.jsx(rt,{onClick:Ae,children:"Cancel"}),e.jsx(it,{onClick:xs,children:"Delete"})]})]})})]})]})}const Ot=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function zt({compact:s=!1,className:t}){const{locale:a,setLocale:i}=Nt();return e.jsxs(Es,{value:a,onValueChange:i,children:[e.jsx(Fs,{className:I(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4"}),e.jsx(ze,{})]}):e.jsx(ze,{})}),e.jsx(Ls,{children:Ot.map(c=>e.jsx(Us,{value:c.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:c.flag}),e.jsx("span",{children:c.label})]})},c.value))})]})}const Ce={discord:{id:"discord",name:"Discord",icon:"message-circle",description:"Send notifications to Discord channels via webhook",requiredFields:["webhookUrl"]},telegram:{id:"telegram",name:"Telegram",icon:"send",description:"Send notifications to Telegram chats via bot",requiredFields:["botToken","chatId"]},feishu:{id:"feishu",name:"Feishu",icon:"message-square",description:"Send notifications to Feishu (Lark) via webhook with rich card support",requiredFields:["webhookUrl"]},dingtalk:{id:"dingtalk",name:"DingTalk",icon:"bell",description:"Send notifications to DingTalk via webhook",requiredFields:["webhookUrl"]},wecom:{id:"wecom",name:"WeCom",icon:"users",description:"Send notifications to WeCom (WeChat Work) via webhook",requiredFields:["webhookUrl"]},email:{id:"email",name:"Email",icon:"mail",description:"Send notifications via SMTP email",requiredFields:["host","username","password","from","to"]},webhook:{id:"webhook",name:"Custom Webhook",icon:"link",description:"Send notifications to a custom HTTP endpoint",requiredFields:["url"]}},$t={"ask-user-question":{id:"ask-user-question",name:"Ask User Question",description:"Notification when Claude asks a question via AskUserQuestion",icon:"help-circle"},"session-start":{id:"session-start",name:"Session Start",description:"Notification when a CLI session starts",icon:"play"},"session-end":{id:"session-end",name:"Session End",description:"Notification when a CLI session ends",icon:"square"},"task-completed":{id:"task-completed",name:"Task Completed",description:"Notification when a task completes successfully",icon:"check-circle"},"task-failed":{id:"task-failed",name:"Task Failed",description:"Notification when a task fails",icon:"alert-circle"}};function Be(){return{enabled:!1,platforms:{},events:[{event:"ask-user-question",platforms:["discord","telegram"],enabled:!0},{event:"session-start",platforms:[],enabled:!1},{event:"session-end",platforms:[],enabled:!1},{event:"task-completed",platforms:[],enabled:!1},{event:"task-failed",platforms:["discord","telegram"],enabled:!0}],timeout:1e4}}function Vt({config:s,expandedPlatform:t,testing:a,onToggleExpand:i,onUpdateConfig:c,onTest:o,onSave:u,saving:p}){const{formatMessage:M}=O(),g=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],F=x=>{switch(x){case"discord":return e.jsx(Is,{className:"w-4 h-4"});case"telegram":return e.jsx(yt,{className:"w-4 h-4"});case"feishu":return e.jsx(qe,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Ee,{className:"w-4 h-4"});case"wecom":return e.jsx(Ps,{className:"w-4 h-4"});case"email":return e.jsx(Ds,{className:"w-4 h-4"});case"webhook":return e.jsx(wt,{className:"w-4 h-4"})}},y=x=>{switch(x){case"discord":return s.platforms.discord||{enabled:!1,webhookUrl:""};case"telegram":return s.platforms.telegram||{enabled:!1,botToken:"",chatId:""};case"feishu":return s.platforms.feishu||{enabled:!1,webhookUrl:""};case"dingtalk":return s.platforms.dingtalk||{enabled:!1,webhookUrl:""};case"wecom":return s.platforms.wecom||{enabled:!1,webhookUrl:""};case"email":return s.platforms.email||{enabled:!1,host:"",port:587,username:"",password:"",from:"",to:[]};case"webhook":return s.platforms.webhook||{enabled:!1,url:"",method:"POST"}}},L=x=>{var w;const j=y(x);switch(x){case"discord":return!!j.webhookUrl;case"telegram":return!!j.botToken&&!!j.chatId;case"feishu":return!!j.webhookUrl;case"dingtalk":return!!j.webhookUrl;case"wecom":return!!j.webhookUrl;case"email":const m=j;return!!(m.host&&m.username&&m.password&&m.from&&((w=m.to)==null?void 0:w.length)>0);case"webhook":return!!j.url}};return e.jsx("div",{className:"grid gap-3",children:g.map(x=>{const j=Ce[x],w=y(x),m=L(x),D=t===x;return e.jsxs(V,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>i(D?null:x),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",w.enabled&&m?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:F(x)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:j.name}),m&&e.jsxs(_,{variant:"outline",className:"text-xs text-green-600 border-green-500/30",children:[e.jsx(W,{className:"w-3 h-3 mr-1"}),M({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:j.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:w.enabled?"default":"outline",size:"sm",className:"h-7",onClick:k=>{k.stopPropagation(),c(x,{enabled:!w.enabled})},children:w.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),D?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]})}),D&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[x==="discord"&&e.jsx(Bt,{config:w,onUpdate:k=>c("discord",k)}),x==="telegram"&&e.jsx(_t,{config:w,onUpdate:k=>c("telegram",k)}),x==="feishu"&&e.jsx(Wt,{config:w,onUpdate:k=>c("feishu",k)}),x==="dingtalk"&&e.jsx(Gt,{config:w,onUpdate:k=>c("dingtalk",k)}),x==="wecom"&&e.jsx(Kt,{config:w,onUpdate:k=>c("wecom",k)}),x==="email"&&e.jsx(Jt,{config:w,onUpdate:k=>c("email",k)}),x==="webhook"&&e.jsx(qt,{config:w,onUpdate:k=>c("webhook",k)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>o(x,w),disabled:a===x||!m,children:[e.jsx(vt,{className:I("w-3.5 h-3.5 mr-1",a===x&&"animate-pulse")}),M({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(b,{variant:"default",size:"sm",onClick:u,disabled:p,children:M({id:"settings.remoteNotifications.save"})})]})]})]},x)})})}function Bt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://discord.com/api/webhooks/...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.discord.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.username"})}),e.jsx(H,{value:s.username||"",onChange:o=>t({username:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function _t({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.botToken"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.botToken||"",onChange:o=>t({botToken:o.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.botTokenHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.chatId"})}),e.jsx(H,{value:s.chatId||"",onChange:o=>t({chatId:o.target.value}),placeholder:"-1001234567890",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.chatIdHint"})})]})]})}function qt({config:s,onUpdate:t}){const{formatMessage:a}=O();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.url"})}),e.jsx(H,{value:s.url||"",onChange:i=>t({url:i.target.value}),placeholder:"https://your-server.com/webhook",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.method"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(b,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(b,{variant:s.method==="PUT"?"default":"outline",size:"sm",onClick:()=>t({method:"PUT"}),children:"PUT"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.headers"})}),e.jsx(H,{value:s.headers?JSON.stringify(s.headers):"",onChange:i=>{try{const c=i.target.value?JSON.parse(i.target.value):void 0;t({headers:c})}catch{}},placeholder:'{"Authorization": "Bearer token"}',className:"mt-1 font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.webhook.headersHint"})})]})]})}function Wt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.feishu.webhookUrlHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"feishu-useCard",checked:s.useCard||!1,onChange:o=>t({useCard:o.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"feishu-useCard",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.useCard"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:a({id:"settings.remoteNotifications.feishu.useCardHint"})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.title"})}),e.jsx(H,{value:s.title||"",onChange:o=>t({title:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Gt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.keywords"})}),e.jsx(H,{value:((o=s.keywords)==null?void 0:o.join(", "))||"",onChange:u=>t({keywords:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"keyword1, keyword2",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.keywordsHint"})})]})]})}function Kt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.mentionedList"})}),e.jsx(H,{value:((o=s.mentionedList)==null?void 0:o.join(", "))||"",onChange:u=>t({mentionedList:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"userid1, userid2, @all",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.mentionedListHint"})})]})]})}function Jt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.host"})}),e.jsx(H,{value:s.host||"",onChange:u=>t({host:u.target.value}),placeholder:"smtp.gmail.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.hostHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.port"})}),e.jsx(H,{type:"number",value:s.port||587,onChange:u=>t({port:parseInt(u.target.value,10)||587}),placeholder:"587",className:"mt-1"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"email-secure",checked:s.secure||!1,onChange:u=>t({secure:u.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"email-secure",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.secure"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.username"})}),e.jsx(H,{value:s.username||"",onChange:u=>t({username:u.target.value}),placeholder:"your-email@gmail.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.password"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(H,{type:i?"text":"password",value:s.password||"",onChange:u=>t({password:u.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.from"})}),e.jsx(H,{value:s.from||"",onChange:u=>t({from:u.target.value}),placeholder:"noreply@example.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.to"})}),e.jsx(H,{value:((o=s.to)==null?void 0:o.join(", "))||"",onChange:u=>t({to:u.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"user1@example.com, user2@example.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.toHint"})})]})]})}function Xt({className:s}){const{formatMessage:t}=O(),[a,i]=d.useState(null),[c,o]=d.useState(!0),[u,p]=d.useState(!1),[M,g]=d.useState(null),[F,y]=d.useState(null),[L,x]=d.useState(null),j=d.useCallback(async()=>{o(!0);try{const f=await fetch("/api/notifications/remote/config");if(f.ok){const N=await f.json();i(N)}else i(Be())}catch(f){console.error("Failed to load remote notification config:",f),i(Be())}finally{o(!1)}},[]);d.useEffect(()=>{j()},[j]);const w=d.useCallback(async f=>{p(!0);try{const N=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(N.ok){const r=await N.json();i(r.config),A.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${N.status}`)}catch{A.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),m=d.useCallback(async(f,N)=>{g(f);try{const h=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:f,config:N})})).json();h.success?A.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${h.responseTime}ms`}):A.error(t({id:"settings.remoteNotifications.testFailed"}),{description:h.error})}catch{A.error(t({id:"settings.remoteNotifications.testError"}))}finally{g(null)}},[t]),D=()=>{a&&w({...a,enabled:!a.enabled})},k=(f,N)=>{if(!a)return;const r={...a,platforms:{...a.platforms,[f]:{...a.platforms[f],...N}}};i(r)},S=(f,N)=>{if(!a)return;const r=[...a.events];r[f]={...r[f],...N},i({...a,events:r})},P=(f,N)=>{if(!a)return;const r=a.events[f],h=r.platforms.includes(N)?r.platforms.filter(l=>l!==N):[...r.platforms,N];S(f,{platforms:h})},B=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],R=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const f=await fetch("/api/notifications/remote/reset",{method:"POST"});if(f.ok){const N=await f.json();i(N.config),A.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{A.error(t({id:"settings.remoteNotifications.resetError"}))}};return c?e.jsx(V,{className:I("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Y,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):a?e.jsxs(V,{className:I("p-6",s),children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[a.enabled?e.jsx(Ee,{className:"w-5 h-5 text-primary"}):e.jsx(Mt,{className:"w-5 h-5 text-muted-foreground"}),t({id:"settings.remoteNotifications.title"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(),disabled:c,children:e.jsx(Y,{className:I("w-3.5 h-3.5",c&&"animate-spin")})}),e.jsx(b,{variant:a.enabled?"default":"outline",size:"sm",onClick:D,children:a.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.disabled"})]})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:t({id:"settings.remoteNotifications.description"})}),a.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.platforms"})}),e.jsx(Vt,{config:a,expandedPlatform:F,testing:M,onToggleExpand:y,onUpdateConfig:k,onTest:m,onSave:()=>w(a),saving:u})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.events"})}),e.jsx("div",{className:"grid gap-3",children:a.events.map((f,N)=>{const r=$t[f.event],h=L===N;return e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>x(h?null:N),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",f.enabled?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.jsx("span",{className:"text-sm",children:r.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1 flex-wrap max-w-xs",children:[f.platforms.slice(0,3).map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:Ce[l].name},l)),f.platforms.length>3&&e.jsxs(_,{variant:"secondary",className:"text-xs",children:["+",f.platforms.length-3]}),f.platforms.length===0&&e.jsx(_,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(b,{variant:f.enabled?"default":"outline",size:"sm",className:"h-7",onClick:l=>{l.stopPropagation(),S(N,{enabled:!f.enabled})},children:f.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),h?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]}),h&&e.jsxs("div",{className:"border-t border-border p-4 space-y-3 bg-muted/20",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.selectPlatforms"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:B.map(l=>{const E=f.platforms.includes(l),z=Ce[l],q=a.platforms[l],$=q==null?void 0:q.enabled;return e.jsxs(b,{variant:E?"default":"outline",size:"sm",className:I("h-8",!$&&!E&&"opacity-50"),onClick:()=>P(N,l),children:[E&&e.jsx(W,{className:"w-3 h-3 mr-1"}),z.name,!$&&!E&&e.jsx(ke,{className:"w-3 h-3 ml-1 opacity-50"})]},l)})})]})]},f.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:R,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>w(a),disabled:u,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),t(u?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function Qt({value:s,label:t,description:a,selected:i,onClick:c}){const o={modal:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-3 border border-current rounded-sm"})}),drawer:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-end p-0.5",children:e.jsx("div",{className:"w-2 h-6 border border-current rounded-sm"})}),sheet:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-center p-0.5",children:e.jsx("div",{className:"w-6 h-2 border border-current rounded-sm"})}),fullscreen:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-4 border border-current rounded-sm"})})};return e.jsxs("button",{type:"button",onClick:c,className:I("flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all","hover:bg-accent/50",i?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground"),children:[o[s],e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:I("text-sm font-medium",i&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]})]})}function Yt({value:s,onChange:t,disabled:a}){const i=[10,20,30,45,60,90,120];return e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(c=>e.jsxs(b,{type:"button",variant:s===c?"default":"outline",size:"sm",disabled:a,onClick:()=>t(c),children:[c,"s"]},c))})}function Zt(){const{formatMessage:s}=O(),{preferences:t,updatePreference:a,resetPreferences:i}=Rs(),c=[{value:"modal",label:s({id:"settings.a2ui.styleModal",defaultMessage:"Modal"}),description:s({id:"settings.a2ui.styleModalDesc",defaultMessage:"Centered"})},{value:"drawer",label:s({id:"settings.a2ui.styleDrawer",defaultMessage:"Drawer"}),description:s({id:"settings.a2ui.styleDrawerDesc",defaultMessage:"Side panel"})},{value:"sheet",label:s({id:"settings.a2ui.styleSheet",defaultMessage:"Sheet"}),description:s({id:"settings.a2ui.styleSheetDesc",defaultMessage:"Bottom"})},{value:"fullscreen",label:s({id:"settings.a2ui.styleFullscreen",defaultMessage:"Fullscreen"}),description:s({id:"settings.a2ui.styleFullscreenDesc",defaultMessage:"Full screen"})}];return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(qe,{className:"w-5 h-5"}),s({id:"settings.sections.a2ui",defaultMessage:"A2UI Preferences"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs($e,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Et,{className:"w-4 h-4"}),s({id:"settings.a2ui.dialogStyle",defaultMessage:"Dialog Style"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.dialogStyleDesc",defaultMessage:"Choose how A2UI dialogs are displayed"})}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:c.map(o=>e.jsx(Qt,{value:o.value,label:o.label,description:o.description,selected:t.dialogStyle===o.value,onClick:()=>a("dialogStyle",o.value)},o.value))})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.smartMode",defaultMessage:"Smart Mode"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.smartModeDesc",defaultMessage:"Auto-select style based on question type"})})]})]}),e.jsx(b,{variant:t.smartModeEnabled?"default":"outline",size:"sm",onClick:()=>a("smartModeEnabled",!t.smartModeEnabled),children:t.smartModeEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"space-y-3 py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(As,{className:"w-4 h-4 text-muted-foreground"}),e.jsx($e,{className:"text-sm font-medium",children:s({id:"settings.a2ui.autoSelectionDuration",defaultMessage:"Auto-Selection Duration"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.autoSelectionDurationDesc",defaultMessage:"Countdown before auto-selecting default option"})}),e.jsx(Yt,{value:t.autoSelectionDuration,onChange:o=>a("autoSelectionDuration",o)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.pauseOnInteraction",defaultMessage:"Pause on Interaction"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.pauseOnInteractionDesc",defaultMessage:"Pause countdown when you interact with the dialog"})})]}),e.jsx(b,{variant:t.pauseOnInteraction?"default":"outline",size:"sm",onClick:()=>a("pauseOnInteraction",!t.pauseOnInteraction),children:t.pauseOnInteraction?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Lt,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.soundNotification",defaultMessage:"Sound Notification"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.soundNotificationDesc",defaultMessage:"Play sound before auto-submit (3 seconds before)"})})]})]}),e.jsx(b,{variant:t.autoSelectionSoundEnabled?"default":"outline",size:"sm",onClick:()=>a("autoSelectionSoundEnabled",!t.autoSelectionSoundEnabled),children:t.autoSelectionSoundEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.showToolbarButton",defaultMessage:"Show Toolbar Button"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.showToolbarButtonDesc",defaultMessage:"Show A2UI quick action button in the toolbar"})})]}),e.jsx(b,{variant:t.showA2UIButtonInToolbar?"default":"outline",size:"sm",onClick:()=>a("showA2UIButtonInToolbar",!t.showA2UIButtonInToolbar),children:t.showA2UIButtonInToolbar?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:e.jsx(b,{variant:"outline",size:"sm",onClick:i,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}function ea(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function _e({value:s,onChange:t,placeholder:a}){const[i,c]=d.useState(!1),[o,u]=d.useState(null),p=kt(s,500);d.useEffect(()=>{if(p){c(!0),u(null);const g=setTimeout(()=>{p.trim().length>0?u(null):u("Path cannot be empty."),c(!1)},1e3);return()=>clearTimeout(g)}else u(null),c(!1)},[p]);const M=async()=>{const{selectFile:g}=await Ys(async()=>{const{selectFile:L}=await import("./index-C5Oqx2xI.js").then(x=>x.gc);return{selectFile:L}},__vite__mapDeps([0,1])),F=s?s.replace(/[/\\][^/\\]*$/,""):void 0,y=await g(F);y.path&&!y.cancelled&&!y.error&&t(y.path)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(H,{value:s,onChange:g=>t(g.target.value),placeholder:a,className:I("flex-1",o&&"border-destructive")}),i&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Xs,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:M,title:"Browse",children:e.jsx(Qs,{className:"w-4 h-4"})})]}),o&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:o})]})}const sa=new Set(["gemini","qwen","opencode"]),ta=new Set(["claude"]);function Qe(s){return sa.has(s)?"envFile":ta.has(s)?"settingsFile":"none"}function aa({toolId:s,config:t,isDefault:a,isExpanded:i,toolAvailable:c,isSaving:o,onToggleExpand:u,onToggleEnabled:p,onSetDefault:M,onUpdateModel:g,onUpdateTags:F,onUpdateAvailableModels:y,onUpdateEnvFile:L,onUpdateSettingsFile:x,onUpdateEffort:j,onSaveToBackend:w}){const{formatMessage:m}=O(),[D,k]=d.useState(""),[S,P]=d.useState(""),B=()=>{const l=D.trim();l&&!t.tags.includes(l)&&(F([...t.tags,l]),k(""))},R=l=>{F(t.tags.filter(E=>E!==l))},f=()=>{const l=S.trim(),E=t.availableModels||[];l&&!E.includes(l)&&(y([...E,l]),P(""))},N=l=>{const E=t.availableModels||[];y(E.filter(z=>z!==l))},r=["分析","Debug","implementation","refactoring","testing"],h=Qe(s);return e.jsxs(V,{className:I("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:u,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(Ge,{className:I("w-5 h-5",t.enabled?"text-primary":"text-muted-foreground")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground capitalize",children:s}),a&&e.jsx(_,{variant:"default",className:"text-xs",children:m({id:"settings.cliTools.default"})}),e.jsx(_,{variant:"outline",className:"text-xs",children:t.type}),c!==void 0&&e.jsx("span",{className:I("inline-block w-2 h-2 rounded-full",c?"bg-green-500":"bg-red-400"),title:c?"Available":"Unavailable"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.primaryModel})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:l=>{l.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.disabled"})]})}),i?e.jsx(Te,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Me,{className:"w-5 h-5 text-muted-foreground"})]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.tags.map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:l},l))})]}),i&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.primaryModel"})}),e.jsx(H,{value:t.primaryModel,onChange:l=>g("primaryModel",l.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.secondaryModel"})}),e.jsx(H,{value:t.secondaryModel,onChange:l=>g("secondaryModel",l.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.tagsDescription"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[t.tags.map(l=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[l,e.jsx("button",{type:"button",onClick:()=>R(l),className:"hover:text-destructive transition-colors","aria-label":m({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:D,onChange:l=>k(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),B())},placeholder:t.tags.length===0?m({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:B,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),r.map(l=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(l)||F([...t.tags,l])},disabled:t.tags.includes(l),className:"text-xs px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l},l))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.availableModels"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[(t.availableModels||[]).map(l=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[l,e.jsx("button",{type:"button",onClick:()=>N(l),className:"hover:text-destructive transition-colors",children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:S,onChange:l=>P(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),f())},placeholder:(t.availableModels||[]).length===0?m({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:f,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.availableModelsHint"})})]}),h==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.envFile"})}),e.jsx(_e,{value:t.envFile||"",onChange:l=>L(l||void 0),placeholder:m({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.envFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(_e,{value:t.settingsFile||"",onChange:l=>x(l||void 0),placeholder:m({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.settingsFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(l=>{const E=t.effort||"high",z=`settings.cliTools.effort${l.charAt(0).toUpperCase()+l.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>j(l==="high"&&!t.effort?void 0:l),className:I("px-3 py-1.5 rounded-md text-sm border transition-colors",E===l?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:m({id:z})},l)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!a&&t.enabled&&e.jsx(b,{variant:"outline",size:"sm",onClick:M,children:m({id:"settings.cliTools.setDefault"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:w,disabled:o,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),m(o?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function na(){const{formatMessage:s}=O(),{data:t,isLoading:a}=lt(),{toggle:i,isPending:c}=ot(),{data:o,isLoading:u}=ct(),{toggle:p,isPending:M}=dt(),{data:g,isLoading:F}=mt(),{toggle:y,isPending:L}=ut(),{refresh:x,isPending:j}=xt(),{exportSettings:w,isPending:m}=ht(),{importSettings:D,isPending:k}=gt(),S=d.useRef(null),P=d.useCallback(async()=>{try{const R=await w(),f=new Blob([JSON.stringify(R,null,2)],{type:"application/json"}),N=URL.createObjectURL(f),r=document.createElement("a"),h=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);r.href=N,r.download=`ccw-settings-${h}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(N),A.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{A.error(s({id:"settings.responseLanguage.exportError"}))}},[w,s]),B=d.useCallback(async R=>{var N;const f=(N=R.target.files)==null?void 0:N[0];if(f){if(R.target.value="",!f.name.endsWith(".json")&&f.type!=="application/json"){A.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const r=await f.text(),h=JSON.parse(r);if(!h.version||!h.endpoints){A.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const l=await D(h);l.success?A.success(s({id:"settings.responseLanguage.importSuccess"},{imported:l.imported,skipped:l.skipped})):A.error(s({id:"settings.responseLanguage.importError"}))}catch(r){r instanceof SyntaxError?A.error(s({id:"settings.responseLanguage.importInvalidJson"})):A.error(s({id:"settings.responseLanguage.importError"}))}}},[D,s]);return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ft,{className:"w-5 h-5"}),s({id:"settings.sections.responseLanguage"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseClaude"})}),e.jsx(_,{variant:"default",className:"text-xs",children:"Claude"})]}),e.jsx(b,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,onClick:()=>i(!(t!=null&&t.claudeEnabled),"claude"),children:t!=null&&t.claudeEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseClaudeDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseCodex"})}),e.jsx(_,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsx(b,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,onClick:()=>i(!(t!=null&&t.codexEnabled),"codex"),children:t!=null&&t.codexEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseCodexDesc"})}),(t==null?void 0:t.codexNeedsMigration)&&e.jsxs("p",{className:"text-xs text-yellow-500",children:[e.jsx(Fe,{className:"w-3 h-3 inline mr-1"}),s({id:"settings.responseLanguage.migrationWarning"})]})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_s,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(b,{variant:o!=null&&o.enabled?"default":"outline",size:"sm",className:"h-7",disabled:u||M,onClick:()=>p(!(o!=null&&o.enabled)),children:o!=null&&o.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.windowsPlatformDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.cliEnhancement"})}),e.jsx(_,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[(g==null?void 0:g.enabled)&&e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:F||j,onClick:()=>x(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",j&&"animate-spin")})}),e.jsx(b,{variant:g!=null&&g.enabled?"default":"outline",size:"sm",className:"h-7",disabled:F||L,onClick:()=>y(!(g!=null&&g.enabled)),children:g!=null&&g.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.cliEnhancementDesc"})}),(g==null?void 0:g.enabled)&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:s({id:"settings.responseLanguage.cliEnhancementHint"})})]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.exportImportHint"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:S,type:"file",accept:".json,application/json",onChange:B,className:"hidden"}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:k,onClick:()=>{var R;return(R=S.current)==null?void 0:R.click()},children:k?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.importing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:m,onClick:P,children:m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.exporting"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ws,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function ra(){const{formatMessage:s}=O(),[t,a]=d.useState(null),[i,c]=d.useState(!1),[o,u]=d.useState(null),[p,M]=d.useState(null),[g,F]=d.useState(()=>{try{const x=localStorage.getItem("ccw.autoUpdate");return x===null?!0:JSON.parse(x)}catch{return!0}}),y=async(x=!1)=>{x||c(!0),u(null);try{const j=await fetch("/api/version-check");if(!j.ok)throw new Error(`HTTP ${j.status}`);const w=await j.json();if(!w.currentVersion)throw new Error("Invalid response");a(w),M(new Date)}catch(j){x||u(j instanceof Error?j.message:"Unknown error")}finally{c(!1)}};d.useEffect(()=>{if(y(!0),!g)return;const x=setInterval(()=>y(!0),3600*1e3);return()=>clearInterval(x)},[g]);const L=x=>{F(x),localStorage.setItem("ccw.autoUpdate",JSON.stringify(x))};return e.jsxs(V,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ke,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(b,{variant:"outline",size:"sm",disabled:i,onClick:()=>y(),children:[e.jsx(Y,{className:I("w-3.5 h-3.5 mr-1.5",i&&"animate-spin")}),s(i?{id:"settings.versionCheck.checking"}:{id:"settings.versionCheck.checkNow"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.currentVersion"})}),e.jsx(_,{variant:"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.currentVersion)??"..."})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.latestVersion"})}),e.jsx(_,{variant:t!=null&&t.hasUpdate?"default":"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.latestVersion)??"..."})]}),t&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx("span",{className:"text-sm font-medium",children:t.hasUpdate?s({id:"settings.versionCheck.updateAvailable"}):s({id:"settings.versionCheck.upToDate"})}),e.jsx("span",{className:I("inline-block w-2.5 h-2.5 rounded-full",t.hasUpdate?"bg-orange-500":"bg-green-500")})]}),o&&e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[e.jsx(Fe,{className:"w-4 h-4 text-destructive flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-destructive",children:[s({id:"settings.versionCheck.checkFailed"}),": ",o]})]})]}),(t==null?void 0:t.hasUpdate)&&e.jsxs("div",{className:"rounded-lg border border-orange-500/30 bg-orange-500/5 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s({id:"settings.versionCheck.updateCommand"})}),e.jsx("code",{className:"text-xs font-mono bg-muted px-3 py-1.5 rounded block",children:t.updateCommand})]}),e.jsx(b,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:"https://github.com/dyw0830/ccw/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5",children:s({id:"settings.versionCheck.viewRelease"})})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:x=>L(x.target.checked),className:"rounded border-input"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.versionCheck.autoCheck"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.versionCheck.autoCheckDesc"})})]})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s({id:"settings.versionCheck.lastChecked"}),":"," ",p?p.toLocaleTimeString():s({id:"settings.versionCheck.never"})]})]})]})]})}function ia(){const{formatMessage:s}=O(),{installations:t,isLoading:a,refetch:i}=ft(),{upgrade:c,isPending:o}=pt(),{data:u}=bt();return e.jsxs(V,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(St,{className:"w-5 h-5"}),s({id:"settings.systemStatus.title"}),!a&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[t.length," ",s({id:"settings.systemStatus.installations"})]})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>i(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",a&&"animate-spin")})})})]}),a?e.jsx("div",{className:"text-sm text-muted-foreground py-4 text-center",children:s({id:"settings.systemStatus.checking"})}):t.length===0?e.jsxs("div",{className:"text-center py-6 space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.systemStatus.noInstallations"})}),e.jsx("div",{className:"bg-muted/50 rounded-md p-3 inline-block",children:e.jsx("code",{className:"text-xs font-mono",children:"ccw install"})})]}):e.jsxs("div",{className:"space-y-3",children:[t.map(p=>{const M=p.installation_mode==="Global",g=new Date(p.installation_date).toLocaleDateString(),F=p.application_version!=="unknown"?p.application_version:p.installer_version;return e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:I("inline-flex items-center justify-center w-8 h-8 rounded-lg",M?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:M?e.jsx(Gs,{className:"w-4 h-4"}):e.jsx(Tt,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(M?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs(_,{variant:"secondary",className:"text-xs font-mono",children:["v",F]})]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"h-7",disabled:o,onClick:()=>c(p.installation_path),children:[e.jsx(Ke,{className:I("w-3.5 h-3.5 mr-1",o&&"animate-spin")}),s(o?{id:"settings.systemStatus.upgrading"}:{id:"settings.systemStatus.upgrade"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1 font-mono truncate",title:p.installation_path,children:p.installation_path}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ks,{className:"w-3 h-3"}),g]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Js,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),u&&!u.installed&&u.missingFiles.length>0&&e.jsxs("div",{className:"rounded-lg border border-yellow-500/50 bg-yellow-500/5 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-600 dark:text-yellow-500",children:[e.jsx(Fe,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",u.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[u.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),u.missingFiles.length>4&&e.jsxs("li",{children:["+",u.missingFiles.length-4," more..."]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-2",children:[e.jsxs("p",{className:"text-xs font-medium mb-1",children:[s({id:"settings.systemStatus.runToFix"}),":"]}),e.jsx("code",{className:"text-xs font-mono bg-background px-2 py-1 rounded block",children:"ccw install"})]})]})]})]})}function la({cliTools:s,defaultCliTool:t,expandedTools:a,savingTools:i,onToggleExpand:c,onToggleEnabled:o,onSetDefault:u,onUpdateModel:p,onUpdateTags:M,onUpdateAvailableModels:g,onUpdateEnvFile:F,onUpdateSettingsFile:y,onUpdateEffort:L,onSaveToBackend:x,formatMessage:j}){const{data:w}=jt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[j({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([m,D])=>{const k=w==null?void 0:w[m];return e.jsx(aa,{toolId:m,config:D,isDefault:m===t,isExpanded:a.has(m),toolAvailable:k==null?void 0:k.available,isSaving:i.has(m),onToggleExpand:()=>c(m),onToggleEnabled:()=>o(m),onSetDefault:()=>u(m),onUpdateModel:(S,P)=>p(m,S,P),onUpdateTags:S=>M(m,S),onUpdateAvailableModels:S=>g(m,S),onUpdateEnvFile:S=>F(m,S),onUpdateSettingsFile:S=>y(m,S),onUpdateEffort:S=>L(m,S),onSaveToBackend:()=>x(m)},m)})})]})}function ya(){const{formatMessage:s}=O(),{theme:t,setTheme:a}=Se(),i=ge(Os),c=ge(zs),o=ge($s),{updateCliTool:u,setDefaultCliTool:p,setUserPreferences:M,resetUserPreferences:g}=ge(),[F,y]=d.useState(new Set),[L,x]=d.useState(new Set),j=r=>{y(h=>{const l=new Set(h);return l.has(r)?l.delete(r):l.add(r),l})},w=r=>{u(r,{enabled:!i[r].enabled})},m=r=>{p(r)},D=(r,h,l)=>{u(r,{[h]:l})},k=(r,h)=>{u(r,{tags:h})},S=(r,h)=>{u(r,{availableModels:h})},P=(r,h)=>{u(r,{envFile:h})},B=(r,h)=>{u(r,{settingsFile:h})},R=(r,h)=>{u(r,{effort:h})},f=d.useCallback(async r=>{const h=i[r];if(h){x(l=>new Set(l).add(r));try{const l={enabled:h.enabled,primaryModel:h.primaryModel,secondaryModel:h.secondaryModel,tags:h.tags,availableModels:h.availableModels},E=Qe(r);E==="envFile"?l.envFile=h.envFile||null:E==="settingsFile"&&(l.settingsFile=h.settingsFile||null,l.effort=h.effort||null);const z=ea(),q={"Content-Type":"application/json"};z&&(q["X-CSRF-Token"]=z);const $=await fetch(`/api/cli/config/${r}`,{method:"PUT",headers:q,body:JSON.stringify(l),credentials:"same-origin"});if(!$.ok)throw new Error(`HTTP ${$.status}`);A.success(s({id:"settings.cliTools.configSaved"}),{description:r})}catch{A.error(s({id:"settings.cliTools.configSaveError"}),{description:r})}finally{x(l=>{const E=new Set(l);return E.delete(r),E})}}},[i,s]),N=(r,h)=>{M({[r]:h})};return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(Vs,{className:"w-6 h-6 text-primary"}),s({id:"settings.title"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"settings.description"})})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Bs,{className:"w-5 h-5"}),s({id:"settings.sections.appearance"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground mb-1",children:s({id:"settings.appearance.theme"})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.appearance.description"})}),e.jsx(At,{})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.appearance.systemFollow"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.appearance.systemFollowDesc"})})]}),e.jsx(b,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>a("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Je,{className:"w-5 h-5"}),s({id:"settings.sections.language"})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.language.displayLanguage"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.language.chooseLanguage"})})]}),e.jsx(zt,{})]})})]}),e.jsx(na,{}),e.jsx(Zt,{}),e.jsx(ia,{}),e.jsx(ra,{}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ge,{className:"w-5 h-5"}),s({id:"settings.sections.cliTools"})]}),e.jsx(la,{cliTools:i,defaultCliTool:c,expandedTools:F,savingTools:L,onToggleExpand:j,onToggleEnabled:w,onSetDefault:m,onUpdateModel:D,onUpdateTags:k,onUpdateAvailableModels:S,onUpdateEnvFile:P,onUpdateSettingsFile:B,onUpdateEffort:R,onSaveToBackend:f,formatMessage:s})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Y,{className:"w-5 h-5"}),s({id:"settings.dataRefresh.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.autoRefresh"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.autoRefreshDesc"})})]}),e.jsx(b,{variant:o.autoRefresh?"default":"outline",size:"sm",onClick:()=>N("autoRefresh",!o.autoRefresh),children:o.autoRefresh?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),o.autoRefresh&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.refreshInterval"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.refreshIntervalDesc"})})]}),e.jsx("div",{className:"flex gap-2",children:[15e3,3e4,6e4,12e4].map(r=>e.jsxs(b,{variant:o.refreshInterval===r?"default":"outline",size:"sm",onClick:()=>N("refreshInterval",r),children:[r/1e3,"s"]},r))})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ee,{className:"w-5 h-5"}),s({id:"settings.notifications.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.enableNotifications"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.enableNotificationsDesc"})})]}),e.jsx(b,{variant:o.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>N("notificationsEnabled",!o.notificationsEnabled),children:o.notificationsEnabled?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.soundEffects"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.soundEffectsDesc"})})]}),e.jsx(b,{variant:o.soundEnabled?"default":"outline",size:"sm",onClick:()=>N("soundEnabled",!o.soundEnabled),children:o.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(Xt,{}),e.jsxs(V,{className:"p-6 border-destructive/50",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ve,{className:"w-5 h-5"}),s({id:"common.actions.reset"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.reset.description"})}),e.jsxs(b,{variant:"destructive",onClick:()=>{confirm(s({id:"settings.reset.confirm"}))&&g()},children:[e.jsx(Ve,{className:"w-4 h-4 mr-2"}),s({id:"common.actions.resetToDefaults"})]})]})]})}export{ya as SettingsPage,ya as default};
144
+ //# sourceMappingURL=SettingsPage-BY3QiJhm.js.map