tower-studio 0.2.7 → 0.2.9

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 (247) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +47 -47
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/api/adapters/test/route.js +3 -2
  24. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +1 -1
  29. package/.next/standalone/.next/server/app/index.html +1 -1
  30. package/.next/standalone/.next/server/app/index.rsc +14 -14
  31. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  32. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  33. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  34. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  35. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  36. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  37. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +75 -75
  38. package/.next/standalone/.next/server/app/missions/page.js +5 -5
  39. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  42. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +47 -47
  43. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  46. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  47. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  48. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  49. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  50. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  51. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  52. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  53. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  54. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +47 -47
  55. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  58. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +60 -60
  59. package/.next/standalone/.next/server/app/settings/page.js +3 -3
  60. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/settings.html +1 -1
  63. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  64. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  65. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  66. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  67. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  68. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  69. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +98 -98
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +88 -88
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +81 -81
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +76 -76
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +47 -47
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +84 -84
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +90 -90
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +5 -5
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  101. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +67 -67
  102. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  105. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  106. package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_90467._.js +3 -0
  110. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +2 -2
  111. package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
  112. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/src_lib_0ba0ntr._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/src_lib_ai_0q-~me1._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.ukame._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j8ix6._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02px.0y._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ca_ueb._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dsdplu._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n.cuy2._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nbj.ml._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pm2~fu._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rjue04._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +3 -0
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tc6uh2._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v2eslh._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vwc25l._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wlmzzq._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u4gc4b._.js → [root-of-the-server]__0z7q-_5._.js} +2 -2
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zbmoit._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~a-emb._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zujp5l._.js → [root-of-the-server]__10o9il8._.js} +2 -2
  145. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +3 -0
  146. package/.next/standalone/.next/server/chunks/ssr/{_0ysygps._.js → _0-fpxu8._.js} +2 -2
  147. package/.next/standalone/.next/server/chunks/ssr/{_0pd0.8f._.js → _03zmko4._.js} +2 -2
  148. package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/{_0ysyq9g._.js → _0568hf5._.js} +2 -2
  150. package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/_07k_7zo._.js +7 -0
  152. package/.next/standalone/.next/server/chunks/ssr/{_0c-jnbs._.js → _0999z~z._.js} +2 -2
  153. package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  155. package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/_0gkxdta._.js +7 -0
  157. package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/{_0f6u19w._.js → _0jxhs~u._.js} +2 -2
  160. package/.next/standalone/.next/server/chunks/ssr/{_0b0.-sj._.js → _0r8ftmo._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +1 -1
  163. package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/{_0bw-tx8._.js → _0zcog8w._.js} +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
  166. package/.next/standalone/.next/server/chunks/ssr/{_0fob8fc._.js → _11uabrg._.js} +2 -2
  167. package/.next/standalone/.next/server/chunks/ssr/_13b~3az._.js +7 -0
  168. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +3 -0
  169. package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  178. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  179. package/.next/standalone/.next/server/pages/404.html +1 -1
  180. package/.next/standalone/.next/server/pages/500.html +1 -1
  181. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/server-reference-manifest.json +317 -317
  183. package/.next/standalone/.next/static/chunks/{0v~pz9e87t99b.js → 0-9-c__gfaxpa.js} +1 -1
  184. package/.next/standalone/.next/static/chunks/{05-ui_o~3irq_.js → 04djo-eed_8rf.js} +2 -2
  185. package/.next/standalone/.next/static/chunks/{0r1mkt5qs~s6m.js → 05fy_a4boi~ym.js} +1 -1
  186. package/.next/standalone/.next/static/chunks/05mg~bkdmeovq.js +1 -0
  187. package/.next/standalone/.next/static/chunks/08o3st.fn2~6x.js +1 -0
  188. package/.next/standalone/.next/static/chunks/{08~e63d2q~cam.js → 0d5wyd0-zzb94.js} +1 -1
  189. package/.next/standalone/.next/static/chunks/{00j0mdc41wa44.js → 0e6c~o_iuvycp.js} +1 -1
  190. package/.next/standalone/.next/static/chunks/{0i55dediewjp5.js → 0h3jzfwt-f9o7.js} +1 -1
  191. package/.next/standalone/.next/static/chunks/0igfu0uxcf238.js +1 -0
  192. package/.next/standalone/.next/static/chunks/{0l3mmc866npw4.js → 0jd4uhx~x74ox.js} +2 -2
  193. package/.next/standalone/.next/static/chunks/{0bw4ahlj4~l~g.js → 0obdotk~5x07o.js} +1 -1
  194. package/.next/standalone/.next/static/chunks/0o~dk86gtjq-..js +1 -0
  195. package/.next/standalone/.next/static/chunks/{0ft77ybyq903..js → 0p_vnqgdse218.js} +1 -1
  196. package/.next/standalone/.next/static/chunks/{0~27mkhc9s5k2.js → 0sbpshsch~ak2.js} +2 -2
  197. package/.next/standalone/.next/static/chunks/{00.52653v5c~c.js → 0t.7i1ltlf~rt.js} +1 -1
  198. package/.next/standalone/.next/static/chunks/0v--ko.s9zeij.js +1 -0
  199. package/.next/standalone/.next/static/chunks/{02edbrlq~2uyx.js → 0v-8_9de2o32z.js} +1 -1
  200. package/.next/standalone/.next/static/chunks/{05hls.3r4bz.0.js → 0x~sbju1g3fjh.js} +1 -1
  201. package/.next/standalone/.next/static/chunks/{0fxm-wv..y_a_.js → 0y1m4k4hrzl33.js} +2 -2
  202. package/.next/standalone/.next/static/chunks/0ztm6whl93nyg.js +1 -0
  203. package/.next/standalone/.next/static/chunks/136efy8zbqp13.js +1 -0
  204. package/.next/standalone/package.json +1 -2
  205. package/dist/mcp-server.cjs +34 -28
  206. package/package.json +1 -2
  207. package/scripts/post-tool-hook.js +24 -39
  208. package/scripts/session-start-hook.js +21 -19
  209. package/scripts/stop-hook.js +21 -19
  210. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wbndoc._.js +0 -4
  211. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04pq37d._.js +0 -3
  212. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07_b6c.._.js +0 -3
  213. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09kc.q_._.js +0 -3
  214. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jo1r7k._.js +0 -3
  215. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o8k4pc._.js +0 -3
  216. package/.next/standalone/.next/server/chunks/ssr/_02v3fjp._.js +0 -7
  217. package/.next/standalone/.next/server/chunks/ssr/_07~0_w6._.js +0 -7
  218. package/.next/standalone/.next/server/chunks/ssr/_08w-r6e._.js +0 -7
  219. package/.next/standalone/.next/server/chunks/ssr/src_095o8x6._.js +0 -3
  220. package/.next/standalone/.next/static/chunks/0nno5if2x1mvs.js +0 -1
  221. package/.next/standalone/.next/static/chunks/0q-u-hhre1uyw.js +0 -1
  222. package/.next/standalone/.next/static/chunks/0qazzw-pr_sv7.js +0 -1
  223. package/.next/standalone/.next/static/chunks/0w3jww1m3k77x.js +0 -1
  224. package/.next/standalone/.next/static/chunks/0z01g02xstbqe.js +0 -1
  225. package/.next/standalone/.next/static/chunks/117qu902jput3.js +0 -1
  226. package/.next/standalone/.next/static/chunks/142w-q8.7m3kl.js +0 -1
  227. package/src/mcp/db.ts +0 -11
  228. package/src/mcp/index.ts +0 -15
  229. package/src/mcp/server.ts +0 -52
  230. package/src/mcp/tools/__tests__/label-tools.test.ts +0 -140
  231. package/src/mcp/tools/__tests__/project-tools.test.ts +0 -182
  232. package/src/mcp/tools/__tests__/report-tools.test.ts +0 -212
  233. package/src/mcp/tools/__tests__/task-tools.test.ts +0 -418
  234. package/src/mcp/tools/__tests__/terminal-tools.test.ts +0 -318
  235. package/src/mcp/tools/__tests__/workspace-tools.test.ts +0 -146
  236. package/src/mcp/tools/knowledge-tools.ts +0 -100
  237. package/src/mcp/tools/label-tools.ts +0 -70
  238. package/src/mcp/tools/note-asset-tools.ts +0 -271
  239. package/src/mcp/tools/project-tools.ts +0 -79
  240. package/src/mcp/tools/report-tools.ts +0 -220
  241. package/src/mcp/tools/search-tools.ts +0 -32
  242. package/src/mcp/tools/task-tools.ts +0 -272
  243. package/src/mcp/tools/terminal-tools.ts +0 -154
  244. package/src/mcp/tools/workspace-tools.ts +0 -73
  245. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_buildManifest.js +0 -0
  246. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_clientMiddlewareManifest.js +0 -0
  247. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,884409,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("403d34b6c07f1211d62ffcf8957d4e12c5cd30d6cb",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:i,action:n,className:a}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",a),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),r=e.i(294237),i=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:a,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(n({variant:r}),e)},o),render:a,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},518367,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4058f3de9d1ab1ca574c84bd2aeae117c8e2226979",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},616301,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7cf4abf6033d5139b977e1c919386013198cf63ea1",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},166682,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6071e854989dd692a873037beb067e80dfd68a8635",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s])},6675,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("404a1bf2ffa6202561fb32a0a53d40df2f58404943",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function s(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function r(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let c=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let s=null,i=null,n=null,a=1,o=null;if(r(e)||t(e))n=e,s=h(e),i=m(e);else{if(!c.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(n=t,c.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);s=h(t),i=m(t),o=e.getFn}return{path:s,id:i,weight:a,src:n,getFn:o}}function h(e){return t(e)?e:e.split(".")}function m(e){return t(e)?e.join("."):e}let f=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,o){let c=[],u=!1,d=(e,o,h,m)=>{if(a(e))if(o[h]){var f,x;let g=e[o[h]];if(!a(g))return;if(h===o.length-1&&(r(g)||i(g)||!0===(f=g)||!1===f||n(x=f)&&null!==x&&"[object Boolean]"==l(f)||"bigint"==typeof g))c.push(void 0!==m?{v:s(g),i:m}:s(g));else if(t(g)){u=!0;for(let e=0,t=g.length;e<t;e+=1)d(g[e],o,h+1,e)}else o.length&&d(g,o,h+1,m)}else c.push(void 0!==m?{v:e,i:m}:e)};return d(e,r(o)?o.split("."):o,0),u?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),x=/[^ ]+/g;class g{constructor({getFn:e=f.getFn,fieldNormWeight:t=f.fieldNormWeight}={}){this.norm=function(e=1,t=3){let s=new Map,r=Math.pow(10,t);return{get(t){let i=t.match(x).length;if(s.has(i))return s.get(i);let n=parseFloat(Math.round(1/Math.pow(i,.5*e)*r)/r);return s.set(i,n),n},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!a(e)||o(e))return;let s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(e,i){let n={i:i,$:{}};this.keys.forEach((i,l)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(c)){if(t(c)){let e=[];for(let t=0,i=c.length;t<i;t+=1){let i=c[t];if(a(i)){if(r(i)){if(!o(i)){let s={v:i,i:t,n:this.norm.get(i)};e.push(s)}}else if(a(i.v)){let t=r(i.v)?i.v:s(i.v);if(!o(t)){let s={v:t,i:i.i,n:this.norm.get(t)};e.push(s)}}}}n.$[l]=e}else if(r(c)&&!o(c)){let e={v:c,n:this.norm.get(c)};n.$[l]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function p(e,t,{getFn:s=f.getFn,fieldNormWeight:r=f.fieldNormWeight}={}){let i=new g({getFn:s,fieldNormWeight:r});return i.setKeys(e.map(d)),i.setSources(t),i.create(),i}function v(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let s=1,r=e.length;s<r;s+=1){let r=t[t.length-1],i=e[s];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}let y={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},b=RegExp("["+Object.keys(y).join("")+"]","g"),C=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(b,e=>y[e]):e=>e;class k{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c},e=o?e:e.toLowerCase(),e=l?C(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let s=0,r=e.length;s<r;s+=1){let i=e.charAt(s);t[i]=(t[i]||0)|1<<r-s-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)u(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:s,startIndex:m})=>{let{isMatch:x,score:g,indices:p}=function(e,t,s,{location:r=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:a=f.findAllMatches,minMatchCharLength:o=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:c=f.ignoreLocation}={}){let u;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,m=Math.max(0,Math.min(r,h)),x=n,g=m,p=(e,t)=>{let s=e/d;if(c)return s;let r=Math.abs(m-t);return i?s+r/i:r?1:s},v=o>1||l,y=v?Array(h):[];for(;(u=e.indexOf(t,g))>-1;)if(x=Math.min(p(0,u),x),g=u+d,v){let e=0;for(;e<d;)y[u+e]=1,e+=1}g=-1;let b=[],C=1,k=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let r=0,i=k;for(;r<i;)p(t,m+i)<=x?r=i:k=i,i=Math.floor((k-r)/2+r);k=i;let n=Math.max(1,m-i+1),o=a?h:Math.min(m+i,h)+d,l=Array(o+2);l[o+1]=(1<<t)-1;for(let r=o;r>=n;r-=1){let i=r-1,a=s[e[i]];if(v&&(y[i]=+!!a),l[r]=(l[r+1]<<1|1)&a,t&&(l[r]|=(b[r+1]|b[r])<<1|1|b[r+1]),l[r]&j&&(C=p(t,i))<=x){if(x=C,(g=i)<=m)break;n=Math.max(1,2*m-g)}}if(p(t+1,m)>x)break;b=l}let w={isMatch:g>=0,score:Math.max(.001,C)};if(v){let e=function(e=[],t=f.minMatchCharLength){let s=[],r=-1,i=-1,n=0;for(let a=e.length;n<a;n+=1){let a=e[n];a&&-1===r?r=n:a||-1===r||((i=n-1)-r+1>=t&&s.push([r,i]),r=-1)}return e[n-1]&&n-r>=t&&s.push([r,n-1]),s}(y,o);e.length?l&&(w.indices=e):w.isMatch=!1}return w}(e,t,s,{location:i+m,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});x&&(h=!0),d+=g,x&&p&&u.push(...p)});let m={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(m.indices=v(u)),m}}class j{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function w(e,t){let s=e.match(t);return s?s[1]:null}class A extends j{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){super(e),this._bitapSearch=new k(e,{location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends j{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,s=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,s))>-1;)s=t+i,r.push([t,s-1]);let n=!!r.length;return{isMatch:n,score:+!n,indices:r}}}let N=[class extends j{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},S,class extends j{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},A],E=N.length,I=new Set([A.type,S.type]),M=[];function D(...e){M.push(...e)}function B(e,t){for(let s=0,r=M.length;s<r;s+=1){let r=M[s];if(r.condition(e,t))return new r(e,t)}return new k(e,t)}let _="$and",F="$path",R=e=>!!(e[_]||e.$or),T=e=>({[_]:Object.keys(e).map(t=>({[t]:e[t]}))});function L(e,s,{auto:i=!0}={}){let a=e=>{if(r(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,s)),t}let o=Object.keys(e),l=!!e[F];if(!l&&o.length>1&&!R(e))return a(T(e));if(!t(e)&&n(e)&&!R(e)){let t=l?e[F]:o[0],n=l?e.$val:e[t];if(!r(n))throw Error(`Invalid value for key ${t}`);let a={keyId:m(t),pattern:n};return i&&(a.searcher=B(n,s)),a}let c={children:[],operator:o[0]};return o.forEach(s=>{let r=e[s];t(r)&&r.forEach(e=>{c.children.push(a(e))})}),c};return R(e)||(e=T(e)),a(e)}function $(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:r,score:i})=>{let n=e?e.weight:null;s*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:r))}),s}class O{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let s=e-1>>1;if(t[e].score<=t[s].score)break;let r=t[e];t[e]=t[s],t[s]=r,e=s}}_sinkDown(e){let t=this.heap,s=t.length,r=e;do{let i=2*(e=r)+1,n=2*e+2;if(i<s&&t[i].score>t[r].score&&(r=i),n<s&&t[n].score>t[r].score&&(r=n),r!==e){let s=t[e];t[e]=t[r],t[r]=s}}while(r!==e)}}function P(e,t){let s=e.matches;t.matches=[],a(s)&&s.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:s,value:r}=e,i={indices:s,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function z(e,t){t.score=e.score}let W=/\b\w+\b/g;function H({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=C(s)),s.match(W)||[])}}function V(e,t){for(let[s,r]of e.terms){let i=r.filter(e=>e.docIdx!==t),n=r.length-i.length;n>0&&(e.fieldCount-=n,e.df.set(s,(e.df.get(s)||0)-n),0===i.length?(e.terms.delete(s),e.df.delete(s)):e.terms.set(s,i))}}class U{constructor(e,t,s){this.options={...f,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new u(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=B(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw Error("Incorrect 'index' type");if(this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,s){let r=new Map,i=new Map,n=0;function a(e,t,a,o){let l=s.tokenize(e);if(!l.length)return;n++;let c=new Map;for(let e of l)c.set(e,(c.get(e)||0)+1);for(let[e,s]of c){let n={docIdx:t,keyIdx:a,subIdx:o,tf:s},l=r.get(e);l||(l=[],r.set(e,l)),l.push(n),i.set(e,(i.get(e)||0)+1)}}for(let s of e){let{i:e,v:r,$:i}=s;if(void 0!==r){a(r,e,-1,-1);continue}if(i)for(let s=0;s<t;s++){let t=i[s];if(t)if(Array.isArray(t))for(let r of t)a(r.v,e,s,r.i??-1);else a(t.v,e,s,-1)}}return{terms:r,fieldCount:n,df:i}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(a(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,s,r){let{i:i,v:n,$:a}=t;function o(t,s,n){let a=r.tokenize(t);if(!a.length)return;e.fieldCount++;let o=new Map;for(let e of a)o.set(e,(o.get(e)||0)+1);for(let[t,r]of o){let a={docIdx:i,keyIdx:s,subIdx:n,tf:r},o=e.terms.get(t);o||(o=[],e.terms.set(t,o)),o.push(a),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==n)return o(n,-1,-1);if(a)for(let e=0;e<s;e++){let t=a[e];if(t)if(Array.isArray(t))for(let s of t)o(s.v,e,s.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],s=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(let e of s)V(this._invertedIndex,e);for(let e=s.length-1;e>=0;e-=1)this._docs.splice(s[e],1);this._myIndex.removeAll(s)}return t}removeAt(e){this._invertedIndex&&V(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let s,{limit:n=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:l,sortFn:c,ignoreFieldNorm:u}=this.options;if(r(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}if(i(n)&&n>0&&r(e)){let t=new O(n);r(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:u}),s=t.extractSorted(c)}else!function(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(s=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:u}),l&&s.sort(c),i(n)&&n>-1&&(s=s.slice(0,n));return function(e,t,{includeMatches:s=f.includeMatches,includeScore:r=f.includeScore}={}){let i=[];return s&&i.push(P),r&&i.push(z),e.map(e=>{let{idx:s}=e,r={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:l,score:c,indices:u}=r.searchIn(e);if(l){let r={item:e,idx:i,matches:[{score:c,value:e,norm:o,indices:u}]};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=L(e,this.options),s=(e,t,r)=>{if(!("children"in e)){let s,{keyId:i,searcher:n}=e;return(null===i?(s=[],this._myIndex.keys.forEach((e,r)=>{s.push(...this._findMatches({key:e,value:t[r],searcher:n}))})):s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n}),s&&s.length)?[{idx:r,item:t,matches:s}]:[]}let{children:i,operator:n}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=s(i[e],t,r);if(o.length)a.push(...o);else if(n===_)return[]}return a},r=this._myIndex.records,i=new Map,n=[];return r.forEach(({$:e,i:r})=>{if(a(e)){let a=s(t,e,r);a.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),n.push(i.get(r))),a.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),n}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach(({$:e,i:n})=>{if(!a(e))return;let l=[],c=!1,u=!1;if(i.forEach((t,s)=>{let i=this._findMatches({key:t,value:e[s],searcher:r});i.length?(l.push(...i),i[0].hasInverse&&(u=!0)):c=!0}),(!u||!c)&&l.length){let r={idx:n,item:e,matches:l};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!a(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:n})=>{if(!a(t))return;let{isMatch:o,score:l,indices:c,hasInverse:u}=r.searchIn(t);o&&i.push({score:l,key:e,value:t,idx:s,norm:n,indices:c,hasInverse:u})});else{let{v:t,n:n}=s,{isMatch:a,score:o,indices:l,hasInverse:c}=r.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:n,indices:l,hasInverse:c})}return i}}U.version="7.3.0",U.createIndex=p,U.parseIndex=function(e,{getFn:t=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){let{keys:r,records:i}=e,n=new g({getFn:t,fieldNormWeight:s});return n.setKeys(r),n.setIndexRecords(i),n},U.config=f,U.match=function(e,t,s){return B(e,{...f,...s}).searchIn(t)},U.parseQuery=L,D(class{constructor(e,{isCaseSensitive:t=f.isCaseSensitive,ignoreDiacritics:s=f.ignoreDiacritics,includeMatches:r=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:a=f.findAllMatches,location:o=f.location,threshold:l=f.threshold,distance:c=f.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let s=(function(e){let t=[],s=e.length,r=0;for(;r<s;){for(;r<s&&" "===e[r];)r++;if(r>=s)break;let i=r;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){let t=i+1;if(t>=s||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(r,i)),r=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=s.length;e<i;e+=1){let i=s[e],n=!1,a=-1;for(;!n&&++a<E;){let e=N[a],s=e.isMultiMatch(i);s&&(r.push(new e(s,t)),n=!0)}if(!n)for(a=-1;++a<E;){let e=N[a],s=e.isSingleMatch(i);if(s){r.push(new e(s,t));break}}}return r})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?C(e):e;let n=0,a=[],o=0,l=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];a.length=0,n=0,l=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:u,score:d}=r.search(e);if(c){n+=1,o+=d;let e=r.constructor.type;e.startsWith("inverse")&&(l=!0),s&&(I.has(e)?a.push(...u):a.push(u))}else{o=0,n=0,a.length=0,l=!1;break}}if(n){let e={isMatch:!0,score:o/n};return l&&(e.hasInverse=!0),s&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),D(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=H({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const s=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],s)){this.termSearchers.push(new k(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const s=r.get(e)||0,n=Math.log(1+(i-s+.5)/(s+.5));this.idfWeights.push(n)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],s=0,r=0,i=0;for(let n=0;n<this.termSearchers.length;n++){let a=this.termSearchers[n].searchIn(e),o=this.idfWeights[n];r+=o,a.isMatch&&(i++,s+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let n={isMatch:!0,score:Math.max(.001,r>0?1-s/r:0)};return this.options.includeMatches&&t.length&&(n.indices=v(t)),n}}),U.use=function(...e){e.forEach(e=>D(e))},e.s(["default",0,U])},449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),i=e.i(514798);let n=(0,i.createServerReference)("00391348d42b76090831034915f5a29394f6851710",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(518367);let o=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var l=e.i(918385),c=e.i(519455),u=e.i(912505),d=e.i(572989);let h=(0,d.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var m=e.i(884409);function f({cols:e,rows:s,active:r}){let i=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:i.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let x="custom";function g({value:e,customValue:i,onChange:n}){let{t:a}=(0,r.useI18n)(),[l,u]=(0,s.useState)(!1),d=(0,s.useRef)(null),h=e===x,p=h?null:o.find(t=>t.id===e)??o[2],[v,y]=(0,s.useState)(i?.cols??2),[b,C]=(0,s.useState)(i?.rows??2),[k,j]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,m.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{j({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{i&&(y(i.cols),C(i.rows))},[i?.cols,i?.rows]),(0,s.useEffect)(()=>{if(l)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){d.current&&!d.current.contains(e.target)&&u(!1)}},[l]);let w=(e,t,s)=>Math.max(t,Math.min(s,e)),A=h?v:p?.cols??2,S=h?b:p?.rows??2,N=h?`${v}\xd7${b}`:p?.label??"";return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>u(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:A,rows:S,active:!1}),(0,t.jsx)("span",{children:N}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),l&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:a("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{n(s.id),u(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{h||n(x,{cols:v,rows:b})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${h?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:v,rows:b,active:h}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${h?"text-primary":"text-foreground"}`,children:a("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${h?"text-primary/60":"text-muted-foreground"}`,children:[v,"×",b]})]}),h&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:k.minCols,max:k.maxCols,value:v,onChange:e=>{let t;y(t=w(Number(e.target.value),k.minCols,k.maxCols)),n(x,{cols:t,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:k.minRows,max:k.maxRows,value:b,onChange:e=>{let t;C(t=w(Number(e.target.value),k.minRows,k.maxRows)),n(x,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var p=e.i(720247),v=e.i(775712),y=e.i(19578),b=e.i(538059),C=e.i(67013);let k=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),j=(0,d.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var w=e.i(657153);let A=(0,d.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var S=e.i(746798),N=e.i(487486),E=e.i(6675),I=e.i(360112);let M=(0,y.default)(()=>e.A(243288).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[346069]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function D({execution:e,isRemoving:i,removeReason:n,onStop:a,onSessionEnd:o}){let{t:l}=(0,r.useI18n)(),u=(0,b.useRouter)(),{attributes:d,listeners:h,setNodeRef:m,transform:f,transition:x}=(0,v.useSortable)({id:e.executionId}),g={transform:C.CSS.Transform.toString(f),transition:x,opacity:+!i},[p,y]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(i)return;let t=setInterval(()=>{y(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,i]);let B=Math.floor(p/60),_=`${B}m ${p%60}s`;async function F(){if(e.projectLocalPath)try{await (0,E.openInTerminal)(e.projectLocalPath)}catch{I.toast.error(l("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:m,style:g,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...d,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...h,"aria-label":l("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName," ›"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),i?(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===n?l("missions.statusStopped"):l("missions.statusCompleted")}):(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:l("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:_}),e.projectLocalPath&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:F}),children:(0,t.jsx)(A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openInTerminal")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>u.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openFullView")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>a(e.taskId),disabled:i}),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(M,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>o?.(e.taskId,t),useCanvasRenderer:!0})})]})}var B=e.i(169751);let _=(0,i.createServerReference)("4066f5b7ea4a9151707d2b708464e41ca8b46f2824",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),F=(0,i.createServerReference)("40c09cce85fa62a5188f302cb8ed640c144a62a304",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var R=e.i(616301),T=e.i(166682),L=e.i(793479),$=e.i(776639),O=e.i(368490);let P=(0,d.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var z=e.i(922541),W=e.i(738690),H=e.i(759684);let V={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},U={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function K({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:V[e]??e})}function q({task:e,isRunning:s,launchingId:r,onLaunchNew:i,onResume:n,t:a}){let o=e.executions?.[0]?.sessionId,l=r===e.id;return(0,t.jsxs)("div",{className:"group/task grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(K,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:a("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[o&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id,o),disabled:l,title:a("missions.continueSession"),children:[(0,t.jsx)(z.RotateCcw,{className:"h-3 w-3 mr-1"}),a("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id),disabled:l,title:a("missions.launchNew"),children:[(0,t.jsx)(P,{className:"h-3 w-3 mr-1"}),l?"...":a("missions.launchNewLabel")]})]})]})}function G({open:e,onOpenChange:i,onLaunchNew:n,onResume:a,runningTaskIds:o,launchingId:u}){let{t:d}=(0,r.useI18n)(),[h,m]=(0,s.useState)([]),[f,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[v,y]=(0,s.useState)([]),[b,C]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(x(""),p(""),y([]),C(""),_(100).then(m).catch(()=>I.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{g?F(g).then(e=>{y(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>I.toast.error(d("missions.error.launchFailed"))):y([])},[g,d]);let k=(0,s.useMemo)(()=>{let e=[];for(let t of h)for(let s of t.projects)for(let r of s.tasks)("TODO"===r.status||"IN_PROGRESS"===r.status||"IN_REVIEW"===r.status)&&e.push({task:r,workspaceName:t.name,projectName:s.alias??s.name});return e},[h]),j=(0,s.useMemo)(()=>new B.default(k,{keys:["task.title"],threshold:.4,distance:200}),[k]),A=(0,s.useMemo)(()=>{let e=b.trim();return e?j.search(e,{limit:30}).map(e=>e.item):[]},[j,b]),S=b.trim().length>0,N=h.find(e=>e.id===f),E=N?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)($.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(W.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(L.Input,{value:b,onChange:e=>C(e.target.value),placeholder:d("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),b&&(0,t.jsx)(c.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>C(""),"aria-label":d("missions.fullPicker.clearSearch"),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})})]}),!S&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Select,{value:f,onValueChange:e=>{x(e??""),p("")},children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:h.find(e=>e.id===f)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(l.SelectContent,{children:h.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(l.Select,{value:g,onValueChange:e=>p(e??""),disabled:!f,children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:E.find(e=>e.id===g)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(l.SelectContent,{children:E.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(H.ScrollArea,{className:"max-h-[60vh] -mx-2",children:S?0===A.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPicker.noSearchResults")}):A.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"px-3 pt-2 pb-0.5 text-[11px] text-muted-foreground",children:[e.workspaceName," · ",e.projectName]}),(0,t.jsx)(q,{task:e.task,isRunning:o.has(e.task.id),launchingId:u,onLaunchNew:n,onResume:a,t:d})]},e.task.id)):0===v.length&&g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===v.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):v.map(e=>(0,t.jsx)(q,{task:e,isRunning:o.has(e.id),launchingId:u,onLaunchNew:n,onResume:a,t:d},e.id))})]})})}function J({open:e,onOpenChange:i,onLaunched:n,runningTaskIds:a=new Set,anchorRef:o}){let{t:l}=(0,r.useI18n)(),u=(0,s.useRef)(null),[d,h]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),[p,v]=(0,s.useState)(!1),[y,b]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(f(!0),_(5).then(h).catch(()=>I.toast.error(l("missions.error.launchFailed"))).finally(()=>f(!1)))},[e,l]);let C=(0,s.useMemo)(()=>d.filter(e=>e.projects.some(e=>e._count.tasks>0)),[d]),k=(0,s.useCallback)(e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(u.current&&!u.current.contains(t)){if(o?.current&&o.current.contains(t))return;i(!1)}}},[e,i,o]);let j=(0,s.useCallback)(async e=>{try{g(e),await (0,R.startPtyExecution)(e,""),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),w=(0,s.useCallback)(async(e,t)=>{try{g(e),await (0,T.resumePtyExecution)(e,t),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),A=(0,s.useCallback)(()=>{i(!1),v(!0)},[i]);return e||p?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:u,className:"absolute right-0 z-50 mt-1 grid max-h-[480px] w-[28rem] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:l("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{children:m?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===C.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:l("missions.noAvailableTasks")}):C.map(e=>{let s=y.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>k(e.id),className:"flex h-auto w-full justify-start gap-1.5 rounded-none border-b border-border/50 px-3 py-1.5 hover:bg-accent",children:[(0,t.jsx)(O.ChevronRight,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"":"rotate-90"}`}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})]}),!s&&(0,t.jsx)("div",{className:"ml-[19px] mt-0.5 border-l border-border/50",children:r.map(e=>(0,t.jsxs)("div",{className:"py-0.5",children:[(0,t.jsx)("div",{className:"pl-3 pt-1.5 pb-1",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),(0,t.jsx)("div",{className:"pl-3",children:e.tasks.map(e=>(0,t.jsx)(q,{task:e,isRunning:a.has(e.id),launchingId:x,onLaunchNew:j,onResume:w,t:l},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:A,children:l("missions.showMoreTasks")})})]}),(0,t.jsx)(G,{open:p,onOpenChange:v,onLaunchNew:j,onResume:w,runningTaskIds:a,launchingId:x})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:i}=(0,r.useI18n)(),[d,m]=(0,s.useState)(e),[f,x]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[y,b]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[C,k]=(0,s.useState)(!1),[j,w]=(0,s.useState)(""),A=(0,s.useRef)(null),[S,N]=(0,s.useState)(new Map),E=(0,s.useRef)(S);(0,s.useEffect)(()=>{E.current=S},[S]);let M=(0,s.useRef)(new Map),B=o.find(e=>e.id===f)??o[2],_="custom"===f?y.cols:B.cols,F="custom"===f?y.rows:B.rows,R=(0,s.useRef)(null),[T,L]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(F-1))/F;L(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[F]);let $=(0,s.useCallback)((e,t)=>{e&&(x(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(b(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),O=(0,p.useSensors)((0,p.useSensor)(p.PointerSensor,{activationConstraint:{distance:8}})),P=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&m(e=>{let r=e.findIndex(e=>e.executionId===t.id),i=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,i)})},[]),z=(0,s.useCallback)((e,t)=>{if(E.current.has(e))return;N(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{m(t=>t.filter(t=>t.executionId!==e)),N(t=>{let s=new Map(t);return s.delete(e),s}),M.current.delete(e)},500);M.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await n();m(t=>{let s=E.current,{merged:r,goneIds:i}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),i=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||i.push(e.executionId)});let n=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),a=new Set(e.map(e=>e.executionId));return{merged:[...n,...t.filter(e=>!a.has(e.executionId))],goneIds:i}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return i.forEach(e=>z(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[z]),(0,s.useEffect)(()=>{let e=M.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let W=(0,s.useCallback)(async e=>{try{await (0,a.stopPtyExecution)(e),m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"stopped"),t})}catch{I.toast.error(i("missions.error.stopFailed"))}},[z,i]),H=(0,s.useCallback)((e,t)=>{m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"completed"),t})},[z]),V=(0,s.useCallback)(e=>{n().then(e=>{m(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(d.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),K=j?d.filter(e=>e.workspaceId===j):d,q=new Set(d.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:i("missions.pageTitle")}),(0,t.jsxs)(l.Select,{value:j,onValueChange:e=>w(e??""),children:[(0,t.jsx)(l.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j?U.find(e=>e.id===j)?.name??i("missions.filterAll"):i("missions.filterAll")})}),(0,t.jsxs)(l.SelectContent,{children:[(0,t.jsx)(l.SelectItem,{value:"",children:i("missions.filterAll")}),U.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(g,{value:f,customValue:y,onChange:$}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:A,onClick:()=>k(e=>!e),children:i("missions.launchTask")}),(0,t.jsx)(J,{open:C,onOpenChange:k,onLaunched:V,runningTaskIds:q,anchorRef:A})]})]}),(0,t.jsx)("div",{ref:R,className:"flex-1 overflow-auto min-h-0 p-4",children:0===K.length&&0===S.size?(0,t.jsx)(u.EmptyState,{icon:h,title:i("missions.emptyTitle"),description:i("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>k(!0),children:i("missions.launchTask")})}):(0,t.jsx)(p.DndContext,{id:"missions-dnd",sensors:O,collisionDetection:p.closestCenter,onDragEnd:P,children:(0,t.jsx)(v.SortableContext,{items:K.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${_}, 1fr)`,gridAutoRows:T},children:K.map(e=>(0,t.jsx)(D,{execution:e,isRemoving:S.has(e.executionId),removeReason:S.get(e.executionId),onStop:W,onSessionEnd:H},e.executionId))})})})})]})}],449636)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},236967,e=>{"use strict";var t=e.i(289721),r=e.i(210702),a=e.i(538059),s=e.i(259846),l=e.i(645378),n=e.i(453889),i=e.i(487278),c=e.i(533499);let o=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,c.useI18n)(),n=(0,a.usePathname)(),i=o.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(r.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(a=>{let s=a.icon,n=i===a.key;return(0,t.jsxs)(r.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},837193,479829,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40e9cc01cea6de9dd24cbfd5c7da77ecbf8520c226",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],837193);let a=(0,t.createServerReference)("40827fb3292a08be968ac71a0bed005e91166832e7",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],479829)},497732,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(232545),s=e.i(400355),l=e.i(236967),n=e.i(533499),i=e.i(685149),c=e.i(837193),o=e.i(514798);let d=(0,o.createServerReference)("60a67a78b43038d492558510c47c3591fae79eb00c",o.callServer,void 0,o.findSourceMapURL,"updateNote");var m=e.i(479829);let x=(0,o.createServerReference)("6007ede367b01ec606684e12359d3506ef02fec117",o.callServer,void 0,o.findSourceMapURL,"getProjectNotes");var u=e.i(975157);function h({active:e,onSelect:r}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>r("all"),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>r(a),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var g=e.i(519455),p=e.i(918385),f=e.i(645378),j=e.i(912505),v=e.i(464249),b=e.i(998626);e.i(254826);var N=e.i(309735);function S({note:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)(),l=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e),className:"text-muted-foreground","aria-label":s("notes.edit"),children:(0,t.jsx)(v.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":s("notes.delete"),children:(0,t.jsx)(b.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsx)("span",{className:"mb-3 inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),(0,t.jsx)("div",{className:"max-h-24 overflow-hidden text-sm leading-relaxed text-muted-foreground",children:(0,t.jsx)(N.Streamdown,{children:l})})]})}function y({notes:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(j.EmptyState,{icon:f.FileText,title:s("notes.empty"),description:s("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(S,{note:e,onEdit:r,onDelete:a},e.id))})}var w=e.i(624687);function C({value:e,onChange:r}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(w.Textarea,{value:e,onChange:e=>r(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border text-sm leading-relaxed",children:(0,t.jsx)(N.Streamdown,{children:e})})})]})}e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:o,initialProjectId:u,initialNotes:f}){let j,v,{t:b}=(0,n.useI18n)(),[N,S]=(0,r.useTransition)(),[w,E]=(0,r.useState)(o),[T,k]=(0,r.useState)(u),[I,R]=(0,r.useState)(f),[O,P]=(0,r.useState)("all"),[A,_]=(0,r.useState)(null),[L,$]=(0,r.useState)(!1),[D,B]=(0,r.useState)(""),[M,z]=(0,r.useState)(""),[G,U]=(0,r.useState)(i.NOTE_CATEGORIES_PRESET[3]),[V,H]=(0,r.useState)(o),[F,W]=(0,r.useState)(u),K=e.find(e=>e.id===w),Y=K?.projects??[],q=e.find(e=>e.id===V),J=q?.projects??[],Q=(0,r.useCallback)(e=>{e?S(async()=>{R(await x(e))}):R([])},[S]),X=async()=>{F&&D.trim()&&(await (0,c.createNote)({title:D.trim(),content:M,category:G,projectId:F}),$(!1),F===T&&Q(T))},Z=async()=>{A&&D.trim()&&(await d(A.id,{title:D.trim(),content:M,category:G}),_(null),Q(T))},ee=async e=>{let t=I.find(t=>t.id===e);!t||confirm(b("notes.deleteConfirm",{title:t.title}))&&(await (0,m.deleteNote)(e),Q(T))},et="all"===O?I.map(e=>({...e,updatedAt:new Date(e.updatedAt)})):I.filter(e=>e.category===O).map(e=>({...e,updatedAt:new Date(e.updatedAt)})),er=L||null!==A;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:w}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(p.Select,{value:w,onValueChange:t=>t&&(t=>{if(t===w)return;E(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;k(a?.id??null),P("all"),Q(a?.id??null)})(t),children:[(0,t.jsx)(p.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===w)?.name??w})}),(0,t.jsx)(p.SelectContent,{children:e.map(e=>(0,t.jsx)(p.SelectItem,{value:e.id,children:e.name},e.id))})]}),Y.length>0&&(0,t.jsxs)(p.Select,{value:T??"",onValueChange:e=>e&&void(e!==T&&(k(e),P("all"),Q(e))),children:[(0,t.jsx)(p.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(j=Y.find(e=>e.id===T))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,t.jsx)(p.SelectContent,{children:Y.map(e=>(0,t.jsxs)(p.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!er&&(0,t.jsxs)(g.Button,{onClick:()=>{B(""),z(""),U(i.NOTE_CATEGORIES_PRESET[3]),H(w),W(T),_(null),$(!0)},className:"ml-auto bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:b("notes.newNote")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:er?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.workspace")}),(0,t.jsxs)(p.Select,{value:V,onValueChange:t=>t&&(t=>{if(t===V)return;H(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;W(a?.id??null)})(t),children:[(0,t.jsx)(p.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===V)?.name??V})}),(0,t.jsx)(p.SelectContent,{children:e.map(e=>(0,t.jsx)(p.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!A&&J.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.project")}),(0,t.jsxs)(p.Select,{value:F??"",onValueChange:e=>e&&W(e),children:[(0,t.jsx)(p.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(v=J.find(e=>e.id===F))?v.alias?`${v.name} (${v.alias})`:v.name:""})}),(0,t.jsx)(p.SelectContent,{children:J.map(e=>(0,t.jsxs)(p.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.categoryLabel")}),(0,t.jsxs)(p.Select,{value:G,onValueChange:e=>e&&U(e),children:[(0,t.jsx)(p.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:G})}),(0,t.jsx)(p.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(p.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:b("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(C,{value:M,onChange:z}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(g.Button,{variant:"outline",onClick:()=>{$(!1),_(null)},children:b("notes.cancel")}),(0,t.jsx)(g.Button,{onClick:A?Z:X,disabled:!D.trim()||!A&&!F,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:b("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(h,{active:O,onSelect:P}),(0,t.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===Y.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:b("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:b("notes.noProjectHint")})]}):(0,t.jsx)(y,{notes:et,onEdit:e=>{B(e.title),z(e.content),U(e.category),_(e),$(!1)},onDelete:ee})]})]})})]})}],497732)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69466,e=>{"use strict";e.s([],386333),e.i(386333),e.i(888405),e.i(884904),e.i(86085),e.i(398479),e.i(492539),e.i(900041),e.i(313713),e.i(985022),e.i(262444),e.i(72235);var i=e.i(514798);let r=(0,i.createServerReference)("60b26d4c1dc0a896aa5545f4a9d4ac0adfac97eec4",i.callServer,void 0,i.findSourceMapURL,"revealInFinder");e.s(["revealInFinder",0,r],69466)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),i=e.i(821957),n=e.i(533499),r=e.i(519455),l=e.i(793479),o=e.i(624687),c=e.i(110204),d=e.i(487486),m=e.i(699375),u=e.i(776639),x=e.i(975157),g=e.i(386343),h=e.i(572989);let p=(0,h.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var f=e.i(645378);let b=(0,h.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var j=e.i(125177),v=e.i(256753),N=e.i(245697),y=e.i(657153),w=e.i(232545);let k=(0,h.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var C=e.i(998626);let S=(0,h.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),T=(0,h.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var M=e.i(400355),B=e.i(301348),R=e.i(181209),D=e.i(453889),P=e.i(756927),L=e.i(464202),F=e.i(884409),I=e.i(514798);let U=(0,I.createServerReference)("000068ce2fe44507bf690991ced2f8810ee21aa06b",I.callServer,void 0,I.findSourceMapURL,"getAvailableTerminalApps");var H=e.i(645703);let E=(0,I.createServerReference)("404f138ed1e5c25a6fa282d6c3eaf2dcb4bcc5c354",I.callServer,void 0,I.findSourceMapURL,"createPrompt"),V=(0,I.createServerReference)("60e44bc2e8146759509e5b05eb222b4c2b5f8398cb",I.callServer,void 0,I.findSourceMapURL,"updatePrompt"),z=(0,I.createServerReference)("40abf66222b384e46e8fd8c65f22ff76b9d167cc3c",I.callServer,void 0,I.findSourceMapURL,"deletePrompt"),$=(0,I.createServerReference)("60d204cb3730cc9142ddd5617ed776fd5f172096f8",I.callServer,void 0,I.findSourceMapURL,"setDefaultPrompt"),K=(0,I.createServerReference)("0076c25e4a4d757e2a225c2d9cb2e20ddb81096f22",I.callServer,void 0,I.findSourceMapURL,"getAvailableProviders");var O=e.i(746798),A=e.i(224277);let q=(0,h.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var G=e.i(631675);let X=(0,h.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Z=e.i(922541),_=e.i(759686),J=e.i(487278),Q=e.i(360112);let W=(0,I.createServerReference)("4006cc27345501b4c4944bbfa6f622a3e529157cf9",I.callServer,void 0,I.findSourceMapURL,"createBackup"),Y=(0,I.createServerReference)("0074d86f3afad4f4b03166322fe4fd5ee99816fdcf",I.callServer,void 0,I.findSourceMapURL,"listBackupFiles"),ee=(0,I.createServerReference)("409e171a09d5dea91472ce38a5bbda29a530508f20",I.callServer,void 0,I.findSourceMapURL,"deleteBackupFile"),et=(0,I.createServerReference)("4052254dfe0561e8c4a9ed70c3c4f2fce5c66cddf0",I.callServer,void 0,I.findSourceMapURL,"restoreBackup"),es=(0,I.createServerReference)("40a5657e1efc7f94cdf9c5ad793ba42c94df125dac",I.callServer,void 0,I.findSourceMapURL,"resetSystem"),ea=(0,I.createServerReference)("003f48744a37adcffec8c75ebcddeddbe64bd2def2",I.callServer,void 0,I.findSourceMapURL,"getBackupDir"),ei=(0,I.createServerReference)("4017d0868da2b9e0bc44dc4ba250fb2f28f2681d3e",I.callServer,void 0,I.findSourceMapURL,"setBackupDir");function en(){let{t:e,locale:i}=(0,n.useI18n)(),o=(0,a.useRouter)(),[c,d]=(0,s.useState)([]),[m,x]=(0,s.useState)(""),[g,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(!0),[b,j]=(0,s.useState)(null),[v,N]=(0,s.useState)(!1),[y,w]=(0,s.useState)(""),k=(0,s.useRef)(null),[S,T]=(0,s.useState)(!1),[B,R]=(0,s.useState)(""),D=(0,s.useCallback)(async()=>{f(!0);try{let[e,t]=await Promise.all([Y(),ea()]);d(e),x(t)}finally{f(!1)}},[]);(0,s.useEffect)(()=>{D()},[D]);let P=async()=>{let t=y.trim()||void 0;N(!1),w(""),j("create");try{await W(t),Q.toast.success(e("settings.backup.createSuccess")),await D()}catch{Q.toast.error(e("settings.backup.createError"))}finally{j(null)}},L=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){j("restore");try{await et(t),Q.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await D()}catch{Q.toast.error(e("settings.backup.restoreError"))}finally{j(null)}}},F=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await ee(t),Q.toast.success(e("settings.backup.deleteSuccess")),d(e=>e.filter(e=>e.filename!==t))}catch{Q.toast.error(e("settings.backup.deleteError"))}},I=async t=>{h(!1);try{await ei(t),x(t),Q.toast.success(e("settings.backup.dirSaved")),await D()}catch{Q.toast.error(e("settings.backup.dirError"))}},U=async t=>{let s=t.target.files?.[0];if(s){t.target.value="",j("import");try{let t=new FormData;t.append("file",s);let a=await fetch("/api/internal/backup/import",{method:"POST",body:t});if(!a.ok){let t=await a.json();Q.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}Q.toast.success(e("settings.backup.importSuccess")),await D()}catch{Q.toast.error(e("settings.backup.importError"))}finally{j(null)}}},H=async()=>{if("RESET"===B){T(!1),R(""),j("reset");try{await es("RESET"),Q.toast.success(e("settings.backup.resetSuccess")),o.push("/")}catch{Q.toast.error(e("settings.backup.resetError"))}finally{j(null)}}},E=null!==b;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===b||"reset"===b)&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(M.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===b?e("settings.backup.restoring"):e("settings.backup.resetting")})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.backup.sectionTitle")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.backup.dir"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:m}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>h(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(A.FolderBrowserDialog,{open:g,onOpenChange:h,onSelect:I})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{onClick:()=>{w(""),N(!0)},disabled:E,className:"gap-2",children:"create"===b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsxs)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",disabled:E,onClick:()=>k.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(X,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.importHint")})]}),(0,t.jsx)("input",{ref:k,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:U})]}),(0,t.jsx)(u.Dialog,{open:v,onOpenChange:N,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(u.DialogHeader,{children:(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.create")})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.createLabel")}),(0,t.jsx)(l.Input,{value:y,onChange:e=>w(e.target.value),onKeyDown:e=>"Enter"===e.key&&P(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>N(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{onClick:P,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),p?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(M.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===c.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(J.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.backup.empty")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e("settings.backup.emptyDesc")})]}):(0,t.jsx)("div",{className:"space-y-3",children:c.map(s=>{var a,n;return(0,t.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.label?(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s.label}):(0,t.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:s.filename}),s.autoBackup&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:e("settings.backup.autoLabel")})]}),s.label&&(0,t.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:s.filename}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(a=s.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`," · ",(n=s.createdAt,new Date(n).toLocaleString("zh"===i?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),s.preview.length>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[s.preview.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" ",e.workspace,"(",e.projects.join(", "),")"]},s)),s.stats.workspaces>s.preview.length&&(0,t.jsxs)("span",{children:[" ",e("settings.backup.workspaces",{count:String(s.stats.workspaces)})]})]}),(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e("settings.backup.projects",{count:String(s.stats.projects)})," · ",e("settings.backup.tasks",{count:String(s.stats.tasks)})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(s.filename),disabled:E,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(G.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>F(s.filename),disabled:E,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.delete")})]})]})]})},s.filename)})}),(0,t.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,t.jsx)(_.AlertTriangle,{className:"h-4 w-4"}),e("settings.backup.dangerZone")]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:e("settings.backup.resetDesc")}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:()=>{R(""),T(!0)},disabled:E,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(Z.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(u.Dialog,{open:S,onOpenChange:T,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:e("settings.backup.resetConfirmDesc")})]}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.resetConfirmInput")}),(0,t.jsx)(l.Input,{value:B,onChange:e=>R(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>T(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{disabled:"RESET"!==B,onClick:H,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var er=e.i(887911);let el=(0,h.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eo=e.i(475958),ec=e.i(194358),ed=e.i(991838);function em({extension:e}){let{t:a}=(0,n.useI18n)(),{status:i,loading:l,isInstalling:o,install:c,uninstall:d,refresh:m}=(0,ed.useExtension)(e.id),[u,x]=(0,s.useState)(!1),g=e.icon,h=i.installed,p=async()=>{let t=await c();t.success?Q.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},f=async()=>{let t=await d();t.success?Q.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{x(!0);try{await m()}finally{x(!1)}};return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,t.jsx)(g,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]})]}),(0,t.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("common.loading")})]}):h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-foreground",children:[a("settings.extensions.installed"),i.version?` v${i.version}`:""]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(el,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("settings.extensions.notInstalledShort")})]})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(r.Button,{variant:"outline",onClick:f,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:b,disabled:u,children:[(0,t.jsx)(ec.RefreshCw,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:()=>{window.open(e.homepageUrl,"_blank","noopener,noreferrer")},children:[(0,t.jsx)(eo.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eu(){let{t:e}=(0,n.useI18n)(),s=(0,er.listExtensionMetadata)();return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("header",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:e("settings.extensions.title")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.extensions.desc")})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsx)(em,{extension:e},e.id))})]})}function ex({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,x.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function eg({label:e,description:s,children:a,className:i}){return(0,t.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",i),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let eh=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:g.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:N.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:v.HardDrive,accent:"cyan"}],ep={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},ef="ai-manager:default-cli-adapter",eb={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function ej(){let e=(0,a.useRouter)(),{t:g}=(0,n.useI18n)(),{theme:h,setTheme:p}=(0,i.useTheme)(),{locale:f,setLocale:b}=(0,n.useI18n)(),[j,v]=(0,s.useState)("general"),N=(0,s.useRef)(null),[I,q]=(0,s.useState)({left:0,width:0}),[G,X]=(0,s.useState)(!1),[Z,_]=(0,s.useState)("Terminal"),[J,Q]=(0,s.useState)([]),[W,Y]=(0,s.useState)(180),[ee,et]=(0,s.useState)([]),[es,ea]=(0,s.useState)("claude"),[ei,er]=(0,s.useState)(null),[el,eo]=(0,s.useState)({}),[ec,ed]=(0,s.useState)([]),[em,ej]=(0,s.useState)(!1),[ev,eN]=(0,s.useState)(null),[ey,ew]=(0,s.useState)(null),[ek,eC]=(0,s.useState)(""),[eS,eT]=(0,s.useState)(""),[eM,eB]=(0,s.useState)(""),[eR,eD]=(0,s.useState)([]),[eP,eL]=(0,s.useState)(null),[eF,eI]=(0,s.useState)({...eb}),[eU,eH]=(0,s.useState)(!1),[eE,eV]=(0,s.useState)({...eb}),[ez,e$]=(0,s.useState)(!1),[eK,eO]=(0,s.useState)(!1),[eA,eq]=(0,s.useState)(0),[eG,eX]=(0,s.useState)(null),[eZ,e_]=(0,s.useState)(null),[eJ,eQ]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5}),[eW,eY]=(0,s.useState)({timeoutSec:30}),[e0,e1]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[e2,e5]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[e3,e4]=(0,s.useState)(null),[e8,e6]=(0,s.useState)(!1),[e7,e9]=(0,s.useState)(""),[te,tt]=(0,s.useState)(!0);(0,s.useEffect)(()=>X(!0),[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("terminal.app","Terminal").then(_),(0,P.getConfigValue)("terminal.idleTimeoutSec",180).then(Y),U().then(Q)},[]),(0,s.useEffect)(()=>{K().then(et);let e=localStorage.getItem(ef);e&&ea(e)},[]),(0,s.useEffect)(()=>{(0,H.getPrompts)().then(ed)},[]);let ts=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();e4(t)}}catch{}};async function ta(){await (0,L.setConfigValue)("terminal.app",Z)}async function ti(){let e=Math.max(180,W);Y(e),await (0,L.setConfigValue)("terminal.idleTimeoutSec",e)}async function tn(e){if(!ei){er(e),eo(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})}),s=await t.json();eo(t=>({...t,[e]:s}))}catch{eo(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{er(null)}}}(0,s.useEffect)(()=>{(0,P.getConfigValue)("git.pathMappingRules",[]).then(e=>{let t=new Set,s=!1,a=e.map(e=>{if(!e.id||t.has(e.id)){s=!0;let a={...e,id:crypto.randomUUID()};return t.add(a.id),a}return t.add(e.id),e});eD(a),s&&(0,L.setConfigValue)("git.pathMappingRules",a)}),(0,P.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{e9(e.join(", "))}),ts(),(0,F.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{let t=e["system.maxUploadBytes"]??0x3200000,s=e["system.maxReadableFileBytes"]??5242880;eQ({maxUploadMb:Math.round(t/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(s/1024/1024)}),eY({timeoutSec:e["git.timeoutSec"]??30}),e1({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80,codeTimeoutSec:e["search.codeTimeoutSec"]??30}),e5({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("notification.enabled",!0).then(tt)},[]);let tr=(0,s.useCallback)(()=>{eN(null),eC(""),eT(""),eB(""),ej(!0)},[]),tl=(0,s.useCallback)(e=>{eN(e),eC(e.name),eT(e.description??""),eB(e.content),ej(!0)},[]),to=(0,s.useCallback)(async()=>{ek.trim()&&eM.trim()&&(ev?await V(ev.id,{name:ek.trim(),description:eS.trim()||void 0,content:eM.trim()}):await E({name:ek.trim(),description:eS.trim()||void 0,content:eM.trim()}),ej(!1),ed(await (0,H.getPrompts)()),e.refresh())},[ek,eS,eM,ev,e]),tc=(0,s.useCallback)(async()=>{ey&&(await z(ey),ew(null),ed(await (0,H.getPrompts)()),e.refresh())},[ey,e]),td=(0,s.useCallback)(async t=>{await $(t),ed(await (0,H.getPrompts)()),e.refresh()},[e]),tm=async()=>{await (0,L.setConfigValue)("system.maxUploadBytes",1024*eJ.maxUploadMb*1024),await (0,L.setConfigValue)("system.maxConcurrentExecutions",eJ.maxConcurrent),await (0,L.setConfigValue)("system.maxReadableFileBytes",1024*eJ.maxReadableMb*1024)},tu=async()=>{await (0,L.setConfigValue)("git.timeoutSec",eW.timeoutSec)},tx=async()=>{await (0,L.setConfigValue)("search.resultLimit",e0.resultLimit),await (0,L.setConfigValue)("search.allModeCap",e0.allModeCap),await (0,L.setConfigValue)("search.debounceMs",e0.debounceMs),await (0,L.setConfigValue)("search.snippetLength",e0.snippetLength),await (0,L.setConfigValue)("search.codeTimeoutSec",e0.codeTimeoutSec)},tg=async()=>{let e=Math.min(e2.minCols,e2.maxCols),t=Math.max(e2.minCols,e2.maxCols),s=Math.min(e2.minRows,e2.maxRows),a=Math.max(e2.minRows,e2.maxRows);e5({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,L.setConfigValue)("missions.grid.minCols",e),await (0,L.setConfigValue)("missions.grid.maxCols",t),await (0,L.setConfigValue)("missions.grid.minRows",s),await (0,L.setConfigValue)("missions.grid.maxRows",a)},th=async()=>{let e=e7.split(",").map(e=>e.trim()).filter(Boolean);await (0,L.setConfigValue)("hooks.autoUploadTypes",e)},tp=async()=>{if(e3){e6(!0);try{let e=e3.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await ts()}finally{e6(!1)}}},tf=async()=>{if(!eE.host.trim()||!eE.localPathTemplate.trim())return;let e=eE.localPathTemplate.trim().replace(/\/+$/,""),t=ez?`${e}/{path}`:e,s=[...eR,{id:crypto.randomUUID(),host:eE.host.trim(),ownerMatch:eE.ownerMatch.trim()||"*",localPathTemplate:t,priority:eE.priority}];await (0,L.setConfigValue)("git.pathMappingRules",s),eD(s),eV({...eb}),e$(!1),eH(!1)},tb=async e=>{if(!eF.host.trim()||!eF.localPathTemplate.trim())return;let t=eF.localPathTemplate.trim().replace(/\/+$/,""),s=eK?`${t}/{path}`:t,a=eR.map(t=>t.id===e?{...t,host:eF.host.trim(),ownerMatch:eF.ownerMatch.trim()||"*",localPathTemplate:s,priority:eF.priority}:t);await (0,L.setConfigValue)("git.pathMappingRules",a),eD(a),eL(null),eO(!1)},tj=async e=>{let t=eR.filter(t=>t.id!==e);await (0,L.setConfigValue)("git.pathMappingRules",t),eD(t),eX(null)};async function tv(){let e=!te;tt(e),await (0,L.setConfigValue)("notification.enabled",e)}let tN=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=N.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();q({left:a.left-s.left,width:a.width})},[j]);let ty=eh.find(e=>e.id===j),tw=ty?ep[ty.accent]:ep.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:g("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g("settings.configDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:tN,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(y.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:N,className:"relative flex gap-1 overflow-x-auto",children:[eh.map(e=>{let s=e.icon,a=j===e.id,i=ep[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>v(e.id),className:(0,x.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${i.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,x.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?i.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,x.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tw.indicator),style:{left:I.left,width:I.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[ty&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tw.bg,tw.text,tw.ring),children:(0,t.jsx)(ty.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:g(ty.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g(ty.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:g("settings.themeLight")},{value:"dark",label:g("settings.themeDark")},{value:"system",label:g("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(eg,{label:g("settings.theme"),description:g("settings.themeDesc"),children:G?(0,t.jsx)(ex,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(eg,{label:g("settings.language"),description:g("settings.languageDesc"),children:(0,t.jsx)(ex,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminal.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[J.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:J.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{_(e.value),(0,L.setConfigValue)("terminal.app",e.value)},className:(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",Z===e.value?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.value))}),(0,t.jsx)("input",{type:"text",value:Z,onChange:e=>_(e.target.value),onBlur:ta,placeholder:g("settings.terminal.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsx)(eg,{label:g("settings.terminal.idleTimeout"),description:g("settings.terminal.idleTimeoutDesc"),children:(0,t.jsx)("input",{type:"number",value:W,onChange:e=>Y(Number(e.target.value)),onBlur:ti,min:180,className:"h-9 w-28 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm text-right focus:outline-none focus:ring-2 focus:ring-blue-500/30"})})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ee.map(e=>{let s=es===e.name,a=ei===e.name,i=el[e.name];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.displayName}),(0,t.jsx)(d.Badge,{variant:"outline",children:g("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(k,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]}),i&&(0,t.jsx)(d.Badge,{variant:i.ok?"secondary":"destructive",className:(0,x.cn)("shrink-0",i.ok&&"bg-green-600 text-white hover:bg-green-700"),children:i.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.XCircle,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.cli.available&&e.cli.version?`${e.name} \xb7 ${e.cli.version}`:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;ea(t=e.name),localStorage.setItem(ef,t)},children:[(0,t.jsx)(k,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),g("settings.prompts.setDefault")]}),(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>tn(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),g("settings.aiTools.testing")]}):g("settings.aiTools.testConnection")})]})]}),i&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:i.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,x.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,x.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})});case"prompts":return G?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(r.Button,{onClick:tr,variant:"default",children:[(0,t.jsx)(w.Plus,{className:"h-4 w-4 mr-2"}),g("settings.prompts.newPrompt")]})}),0===ec.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:g("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:g("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ec.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(k,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>td(e.id),title:g("settings.prompts.setDefault"),children:(0,t.jsx)(k,{className:(0,x.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tl(e),title:g("settings.prompts.editPrompt"),children:(0,t.jsx)(S,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ew(e.id),className:"text-destructive",title:g("settings.prompts.delete"),children:(0,t.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(u.Dialog,{open:em,onOpenChange:ej,children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")}),(0,t.jsx)(u.DialogDescription,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:g("settings.prompts.promptName")}),(0,t.jsx)(l.Input,{id:"prompt-name",value:ek,onChange:e=>eC(e.target.value),placeholder:g("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:g("settings.prompts.promptDescription")}),(0,t.jsx)(l.Input,{id:"prompt-description",value:eS,onChange:e=>eT(e.target.value),placeholder:g("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:g("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eM,onChange:e=>eB(e.target.value),placeholder:g("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ej(!1),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{onClick:to,disabled:!ek.trim()||!eM.trim(),children:g("settings.prompts.save")})]})]})}),(0,t.jsx)(u.Dialog,{open:!!ey,onOpenChange:e=>!e&&ew(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ew(null),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:tc,children:g("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,i;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.git.desc")})]}),(0,t.jsxs)(r.Button,{onClick:()=>{eV({...eb}),eH(!0)},children:[(0,t.jsx)(w.Plus,{className:"mr-2 h-4 w-4"}),g("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eR.length||eU?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eR.map(e=>eP===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:eF.host,onChange:e=>eI(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:eF.ownerMatch,onChange:e=>eI(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:eF.localPathTemplate,onChange:e=>eI(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eK?"default":"outline",size:"sm",type:"button",onClick:()=>eO(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(O.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e_("edit"),children:(0,t.jsx)(D.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(O.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eK?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:eF.priority,onChange:e=>eI(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>{eL(null),eO(!1)},children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{size:"sm",onClick:()=>tb(e.id),children:g("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[g("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t,s,a;return t=e.localPathTemplate,a=(s=/\/\{path\}\/?$/.test(t))?t.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):t,void(eL(e.id),eI({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),eO(s))},title:g("settings.config.git.edit"),children:(0,t.jsx)(S,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eX(e.id),className:"text-destructive",title:g("settings.config.git.delete"),children:(0,t.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:g("settings.config.git.noRules")})}),eU&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:eE.host,onChange:e=>eV(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:eE.ownerMatch,onChange:e=>eV(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:eE.localPathTemplate,onChange:e=>eV(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:ez?"default":"outline",size:"sm",type:"button",onClick:()=>e$(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(O.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e_("add"),children:(0,t.jsx)(D.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(O.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ez?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:eE.priority,onChange:e=>eV(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),eE.localPathTemplate&&(s=eE.localPathTemplate.trim().replace(/\/+$/,""),a=ez?`${s}/{path}`:s,i=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:g("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:i.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eq(s),className:(0,x.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eA===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:i[eA].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],i=s.match(/^git@[^:]+:(.+)$/);if(i)a=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let n=a[0],r=a[a.length-1],l=a.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",n).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(a,i[eA].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>eH(!1),children:g("settings.config.git.cancel")}),(0,t.jsxs)(r.Button,{size:"sm",onClick:tf,disabled:!eE.host.trim()||!eE.localPathTemplate.trim(),children:[(0,t.jsx)(T,{className:"h-3.5 w-3.5 mr-1.5"}),g("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:500,value:eJ.maxUploadMb,onChange:e=>eQ(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:eJ.maxConcurrent,onChange:e=>eQ(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:50,value:eJ.maxReadableMb,onChange:e=>eQ(t=>({...t,maxReadableMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tm,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,value:eW.timeoutSec,onChange:e=>eY(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(r.Button,{onClick:tu,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:5,max:100,value:e0.resultLimit,onChange:e=>e1(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:20,value:e0.allModeCap,onChange:e=>e1(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:50,max:1e3,value:e0.debounceMs,onChange:e=>e1(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:20,max:500,value:e0.snippetLength,onChange:e=>e1(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,step:5,value:e0.codeTimeoutSec,onChange:e=>e1(t=>({...t,codeTimeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tx,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e2.minCols,onChange:e=>e5(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e2.maxCols,onChange:e=>e5(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e2.minRows,onChange:e=>e5(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e2.maxRows,onChange:e=>e5(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(r.Button,{onClick:tg,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(l.Input,{value:e7,onChange:e=>e9(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(r.Button,{onClick:th,className:"rounded-lg",children:g("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:e3?.installed?g("settings.config.hooks.installed"):g("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.installHint")})]}),(0,t.jsx)(r.Button,{variant:e3?.installed?"destructive":"default",onClick:tp,disabled:e8||!e3,className:"rounded-lg",children:e3?.installed?g("settings.config.hooks.uninstall"):g("settings.config.hooks.install")})]})]}),(0,t.jsx)(u.Dialog,{open:!!eG,onOpenChange:e=>!e&&eX(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.config.git.deleteConfirm")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>eX(null),children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:()=>eG&&tj(eG),children:g("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:te,onCheckedChange:tv})]})});case"backup":return(0,t.jsx)(en,{});case"extensions":return(0,t.jsx)(eu,{})}}()]})}),(0,t.jsx)(A.FolderBrowserDialog,{open:null!==eZ,onOpenChange:e=>{e||e_(null)},onSelect:e=>{"add"===eZ?eV(t=>({...t,localPathTemplate:e})):"edit"===eZ&&eI(t=>({...t,localPathTemplate:e})),e_(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(ej,{})}],113399)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:r,action:l,className:i}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",i),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),a=e.i(538059),r=e.i(259846),l=e.i(645378),i=e.i(453889),n=e.i(487278),o=e.i(533499);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),i=(0,a.usePathname)(),n=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(a=>{let r=a.icon,i=n===a.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),a=e.i(294237),r=e.i(975157);let l=(0,a.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",render:i,...n}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(l({variant:a}),e)},n),render:i,state:{slot:"badge",variant:a}},(0,s.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},110204,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}])},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},12659,e=>{"use strict";let t=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],12659)},980376,727402,e=>{"use strict";var t=e.i(289721),s=e.i(225061),a=e.i(975157),r=e.i(519455),l=e.i(670123);function i({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function n({className:e,...r}){return(0,t.jsx)(s.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,a.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(s.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,a.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,c&&(0,t.jsxs)(s.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(l.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,a.cn)("flex flex-col gap-0.5 p-4",e),...s})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,a.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("40b36c864d4d23ff0d7f5c0345462b73016d89624e",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],727402)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(980376),r=e.i(759684),l=e.i(487486),i=e.i(519455),n=e.i(533499),o=e.i(436092),d=e.i(727402),c=e.i(814112),u=e.i(744798),x=e.i(685149),m=e.i(606393),h=e.i(875840),p=e.i(245697),f=e.i(12659);function g({added:e,removed:s}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:a("diff.filesChanged",{count:String(e+s)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),s>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",s]})]})}var b=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:v,taskId:j}){let{t:y}=(0,n.useI18n)(),[k,w]=(0,s.useState)(null),[N,C]=(0,s.useTransition)(),[S,T]=(0,s.useState)(!1),[D,I]=(0,s.useState)([]);(0,s.useEffect)(()=>{j&&e?C(async()=>{let e=await (0,d.getTaskOverview)(j);e&&(w(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{I(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>I([])))}):w(null)},[j,e]);let P=k?x.BOARD_COLUMNS.find(e=>e.id===k.status):null,O=k?x.PRIORITY_CONFIG[k.priority]:null,E=k?.executions?.[0]??null,$=(()=>{let e=E?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),R=async e=>{if(k?.project)try{await (0,o.createTask)({...e,projectId:k.project.id}),b.toast.success(y("taskDrawer.duplicateSuccess")),T(!1),v(!1)}catch{b.toast.error(y("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(a.Sheet,{open:e,onOpenChange:v,children:[(0,t.jsxs)(a.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(a.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(a.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:k?.title??""}),(0,t.jsx)(a.SheetDescription,{className:"sr-only",children:y("taskDrawer.title")}),k&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[P&&(0,t.jsxs)(l.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${P.color}`}),P.label]}),O&&(0,t.jsx)(l.Badge,{variant:"secondary",className:`text-xs ${O.color}`,children:O.label})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:N&&!k?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:y("assets.loading")}):k?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:y("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:k.description||y("taskDrawer.noDescription")})]}),k.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.labels.map(e=>(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(m.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(k.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(p.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:k._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.fileChanges")}),$?(0,t.jsx)(g,{added:$.added,removed:$.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(f.PlayCircle,{className:"h-3.5 w-3.5"}),y("taskDrawer.lastExecution")]}),E?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:E.status}),E.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:E.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("taskDrawer.noExecution")})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(i.Button,{variant:"default",className:"w-full",onClick:()=>{k&&T(!0)},disabled:!k,children:[(0,t.jsx)(h.Copy,{className:"h-4 w-4"}),y("taskDrawer.duplicate")]})})]}):null})]}),k?.project&&(0,t.jsx)(u.CreateTaskDialog,{open:S,onOpenChange:T,onSubmit:R,labels:D,projectType:k.project.type,projectLocalPath:k.project.localPath,prefillFromTask:{title:k.title,description:k.description,priority:k.priority,subPath:k.subPath,labelIds:k.labels.map(e=>e.label.id),baseBranch:k.baseBranch}})]})}],605005)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},720722,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40eb9f91cf4e1a06bca572463ec6f297e5d8f9a617",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,s])},854989,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4001ee3cc32025ec9051ad43275df76081f5bb30fb",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s])},734525,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(400355),r=e.i(236967),l=e.i(533499),i=e.i(720722),n=e.i(514798);let o=(0,n.createServerReference)("402259e92e45ddef6a50cfee1d5396053bd7d2fd47",n.callServer,void 0,n.findSourceMapURL,"getProjectAssets");var d=e.i(453889),c=e.i(912505),u=e.i(645378),x=e.i(867533),m=e.i(998626),h=e.i(519455);function p(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}function f({asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){var n;let{t:o}=(0,l.useI18n)(),c=p(e.path),g=e.mimeType?.startsWith("image/");return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:()=>s(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:g?(0,t.jsx)("img",{src:c,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(u.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(h.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),i?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(n=e.size)?"-":n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:n<0x40000000?`${(n/1048576).toFixed(1)} MB`:`${(n/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(x.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(d.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]})}function g({assets:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){let{t:n}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(c.EmptyState,{icon:d.FolderOpen,title:n("assets.empty"),description:n("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(f,{asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i},e.id))})}var b=e.i(631675),v=e.i(657153),j=e.i(854989),y=e.i(624687),k=e.i(918385);function w({allWorkspaces:e,initialWsId:a,initialProjectId:r,onUploaded:i}){let n,{t:o}=(0,l.useI18n)(),d=(0,s.useRef)(null),[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[g,N]=(0,s.useState)(a),[C,S]=(0,s.useState)(r),[T,D]=(0,s.useState)(""),I=e.find(e=>e.id===g),P=I?.projects??[],O=()=>{u(!1),f(null),d.current&&(d.current.value="")},E=async()=>{if(p&&C){m(!0);try{let e=new FormData;e.append("file",p),e.append("projectId",C),e.append("description",T.trim()),await (0,j.uploadAsset)(e),i(C),O()}finally{m(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.Button,{onClick:()=>{N(a),S(r),f(null),D(""),u(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(b.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o("assets.upload")})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:O}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:O,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(v.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:o("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.workspace")}),(0,t.jsxs)(k.Select,{value:g,onValueChange:t=>{var s;let a;return N(s=t??""),a=e.find(e=>e.id===s),void S(a?.projects[0]?.id??null)},children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:I?.name??g})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.project")}),P.length>0?(0,t.jsxs)(k.Select,{value:C??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(n=P.find(e=>e.id===C))?n.alias?`${n.name} (${n.alias})`:n.name:C})}),(0,t.jsx)(k.SelectContent,{children:P.map(e=>{let s=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(k.SelectItem,{value:e.id,children:s},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.file")}),(0,t.jsx)("input",{type:"file",ref:d,onChange:e=>{f(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{d.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:p?p.name:o("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:o("assets.description")}),(0,t.jsx)(y.Textarea,{value:T,onChange:e=>D(e.target.value),placeholder:o("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:O,children:o("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:E,disabled:!p||!C||!T.trim()||x,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:o(x?"assets.uploading":"assets.upload")})]})]})]})]})}var N=e.i(585012),C=e.i(19671),S=e.i(368490),T=e.i(902539);let D=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var I=e.i(922541);function P({imageUrl:e,filename:a,open:r,onOpenChange:i,assets:n,currentIndex:o,onIndexChange:d}){let{t:c}=(0,l.useI18n)(),[u,x]=(0,s.useState)(1),[m,h]=(0,s.useState)({x:0,y:0}),[p,f]=(0,s.useState)(!1),g=(0,s.useRef)(null),[b,j]=(0,s.useState)(!1),y=!!n&&n.length>1&&"number"==typeof o&&!!d,k=y&&o>0,w=y&&o<n.length-1,E=y?n.length:0,$=E>0?Math.ceil(E/10):0,R=y?Math.floor(o/10):0,L=10*R,M=Math.min(L+10,E),A=$>1,B=y&&R>0,z=y&&R<$-1;(0,s.useEffect)(()=>{j(!0)},[]),(0,s.useEffect)(()=>{x(1),h({x:0,y:0})},[e]),(0,s.useEffect)(()=>{if(!r)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[r]);let F=(0,s.useCallback)(()=>i(!1),[i]),_=(0,s.useCallback)(()=>{y&&k&&d(o-1)},[y,k,d,o]),U=(0,s.useCallback)(()=>{y&&w&&d(o+1)},[y,w,d,o]),W=(0,s.useCallback)(()=>{y&&B&&d((R-1)*10)},[y,B,d,R]),G=(0,s.useCallback)(()=>{y&&z&&d(Math.min((R+1)*10,E-1))},[y,z,d,R,E]),V=(0,s.useCallback)(()=>{x(e=>Math.min(8,1.25*e))},[]),H=(0,s.useCallback)(()=>{x(e=>{let t=Math.max(.1,e/1.25);return t<=1&&h({x:0,y:0}),t})},[]),X=(0,s.useCallback)(()=>{x(1),h({x:0,y:0})},[]);(0,s.useEffect)(()=>{if(!r)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),F();break;case"ArrowLeft":y&&(e.preventDefault(),_());break;case"ArrowRight":y&&(e.preventDefault(),U());break;case"+":case"=":e.preventDefault(),V();break;case"-":case"_":e.preventDefault(),H();break;case"0":e.preventDefault(),X()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,y,F,_,U,V,H,X]);let Y=(0,s.useRef)(!1),q=()=>{p&&f(!1),g.current=null},J=p?"cursor-grabbing":"cursor-grab";if(!r||!b)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":c("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[a,y?` \xb7 ${o+1} / ${n.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${J}`,onClick:e=>{e.target===e.currentTarget&&F()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;x(e=>{let s=Math.min(8,Math.max(.1,e*t));return s<=1&&h({x:0,y:0}),s})},children:e&&(0,t.jsx)("img",{src:e,alt:a,onClick:e=>{e.stopPropagation(),Y.current&&(Y.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),Y.current=!1,e.target.setPointerCapture?.(e.pointerId),g.current={x:e.clientX,y:e.clientY,panX:m.x,panY:m.y},f(!0))},onPointerMove:e=>{if(!g.current)return;let t=e.clientX-g.current.x,s=e.clientY-g.current.y;Math.abs(t)+Math.abs(s)>5&&(Y.current=!0),p&&h({x:g.current.panX+t,y:g.current.panY+s})},onPointerUp:q,onPointerLeave:q,onPointerCancel:q,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${m.x}px, ${m.y}px, 0) scale(${u})`,transformOrigin:"center center",transition:p?"none":"transform 120ms ease-out",willChange:p?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[y&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[A&&(0,t.jsx)(O,{onClick:W,title:`${c("assets.lightbox.prev")} (-10)`,"aria-label":`${c("assets.lightbox.prev")} (-10)`,disabled:!B,children:(0,t.jsx)(T.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(O,{onClick:_,title:c("assets.lightbox.prev"),"aria-label":c("assets.lightbox.prev"),disabled:!k,children:(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:n.slice(L,M).map((e,s)=>{let a=L+s,r=a===o;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||d(a)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+a)})}),(0,t.jsx)(O,{onClick:U,title:c("assets.lightbox.next"),"aria-label":c("assets.lightbox.next"),disabled:!w,children:(0,t.jsx)(S.ChevronRight,{className:"h-4 w-4"})}),A&&(0,t.jsx)(O,{onClick:G,title:`${c("assets.lightbox.next")} (+10)`,"aria-label":`${c("assets.lightbox.next")} (+10)`,disabled:!z,children:(0,t.jsx)(D,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*u),"%"]}),(0,t.jsx)(O,{onClick:X,title:c("assets.lightbox.reset"),"aria-label":c("assets.lightbox.reset"),disabled:1===u&&0===m.x&&0===m.y,children:(0,t.jsx)(I.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(O,{onClick:F,title:c("assets.lightbox.close"),"aria-label":c("assets.lightbox.close"),children:(0,t.jsx)(v.X,{className:"h-4 w-4"})})]})]})]});return(0,N.createPortal)(K,document.body)}function O({children:e,onClick:s,title:a,disabled:r,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||s()},title:a,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.i(254826);var E=e.i(309735),$=e.i(776639);function R({url:e,filename:r,open:i,onOpenChange:n}){let{t:o}=(0,l.useI18n)(),[d,c]=(0,s.useState)(null),[u,x]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!i||!e){c(null),h(null);return}let t=!1;return x(!0),h(null),c(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(c(e),x(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?h(o("assets.fileTooLarge")):h(o("assets.previewError")),x(!1))}),()=>{t=!0}},[i,e,o]);let p=r.split(".").pop()?.toLowerCase();return(0,t.jsx)($.Dialog,{open:i,onOpenChange:n,children:(0,t.jsxs)($.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:r}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(u)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.loadingPreview")})]});if(m)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:m});if(null===d)return null;if("md"===p)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(E.Streamdown,{children:d})});if("json"===p){let e;try{e=JSON.stringify(JSON.parse(d),null,2)}catch{e=d}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:d})})()})]})})}var L=e.i(605005),M=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:n,initialProjectId:d,initialAssets:c}){let u,{t:x}=(0,l.useI18n)(),[m,h]=(0,s.useTransition)(),[f,b]=(0,s.useState)(n),[v,j]=(0,s.useState)(d),[y,N]=(0,s.useState)(c),[C,S]=(0,s.useState)(null),T=e.find(e=>e.id===f),D=T?.projects??[],I=(0,s.useCallback)(e=>{e?h(async()=>{N(await o(e))}):N([])},[h]),[O,E]=(0,s.useState)(null),$=O?O.mimeType?.startsWith("image/")?"image":/\.(txt|md|json)$/i.test(O.filename)?"text":null:null,A=y.filter(e=>e.mimeType?.startsWith("image/")).map(e=>({id:e.id,url:p(e.path),filename:e.filename})),B=O?A.findIndex(e=>e.id===O.id):-1,z=async e=>{try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));M.toast.error(e.error||"Failed to reveal file")}}catch{M.toast.error("Failed to reveal file")}},F=async e=>{let t=y.find(t=>t.id===e);confirm(x("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,i.deleteAsset)(e),I(v))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(r.SubPageNav,{workspaceId:f}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(k.Select,{value:f,onValueChange:t=>t&&(t=>{if(t===f)return;b(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;j(a?.id??null),I(a?.id??null)})(t),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===f)?.name??f})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]}),D.length>0&&(0,t.jsxs)(k.Select,{value:v??"",onValueChange:e=>e&&void(e!==v&&(j(e),I(e))),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(u=D.find(e=>e.id===v))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,t.jsx)(k.SelectContent,{children:D.map(e=>(0,t.jsxs)(k.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(w,{allWorkspaces:e,initialWsId:f,initialProjectId:v,onUploaded:e=>{e===v&&I(v)}})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${m?"opacity-40 pointer-events-none":""} transition-opacity`,children:[m&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===D.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:x("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:x("assets.noProjectHint")})]}):(0,t.jsx)(g,{assets:y.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=e.mimeType?.startsWith("image/"),s=/\.(txt|md|json)$/i.test(e.filename);(t||s)&&E(e)},onReveal:z,onDelete:F,onTaskClick:S})]})}),(0,t.jsx)(P,{imageUrl:"image"===$&&B>=0?A[B].url:null,filename:"image"===$&&B>=0?A[B].filename:"",open:"image"===$,onOpenChange:e=>{e||E(null)},assets:A.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=A[e];if(!t)return;let s=y.find(e=>e.id===t.id);s&&E({...s,taskId:s.task?.id??null,taskTitle:s.task?.title??null})}}),(0,t.jsx)(R,{url:"text"===$&&O?p(O.path):null,filename:O?.filename??"",open:"text"===$,onOpenChange:e=>{e||E(null)}}),(0,t.jsx)(L.TaskOverviewDrawer,{open:!!C,onOpenChange:e=>{e||S(null)},taskId:C})]})}],734525)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
package/src/mcp/db.ts DELETED
@@ -1,11 +0,0 @@
1
- import { PrismaClient, Prisma } from "@prisma/client";
2
-
3
- // Separate PrismaClient for the MCP stdio process (not shared with Next.js app)
4
- export const db = new PrismaClient();
5
-
6
- export async function initDb(): Promise<PrismaClient> {
7
- await db.$connect();
8
- await db.$queryRaw(Prisma.sql`PRAGMA journal_mode=WAL`);
9
- await db.$queryRaw(Prisma.sql`PRAGMA busy_timeout=5000`);
10
- return db;
11
- }
package/src/mcp/index.ts DELETED
@@ -1,15 +0,0 @@
1
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
- import { createServer } from "./server";
3
- import { initDb } from "./db";
4
-
5
- async function main() {
6
- await initDb();
7
- const server = createServer();
8
- const transport = new StdioServerTransport();
9
- await server.connect(transport);
10
- }
11
-
12
- main().catch((error) => {
13
- console.error("MCP Server failed to start:", error);
14
- process.exit(1);
15
- });
package/src/mcp/server.ts DELETED
@@ -1,52 +0,0 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { workspaceTools } from "./tools/workspace-tools";
3
- import { projectTools } from "./tools/project-tools";
4
- import { taskTools } from "./tools/task-tools";
5
- import { labelTools } from "./tools/label-tools";
6
- import { searchTools } from "./tools/search-tools";
7
- import { knowledgeTools } from "./tools/knowledge-tools";
8
- import { noteAssetTools } from "./tools/note-asset-tools";
9
- import { terminalTools } from "./tools/terminal-tools";
10
- import { reportTools } from "./tools/report-tools";
11
-
12
- export function createServer(): McpServer {
13
- const server = new McpServer({ name: "tower", version: "0.1.0" });
14
-
15
- const allTools = {
16
- ...workspaceTools,
17
- ...projectTools,
18
- ...taskTools,
19
- ...labelTools,
20
- ...searchTools,
21
- ...knowledgeTools,
22
- ...noteAssetTools,
23
- ...terminalTools,
24
- ...reportTools,
25
- };
26
-
27
- for (const [name, tool] of Object.entries(allTools)) {
28
- server.tool(
29
- name,
30
- tool.description,
31
- tool.schema.shape,
32
- async (args: Record<string, unknown>) => {
33
- try {
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- const result = await (tool.handler as (args: any) => Promise<unknown>)(args);
36
- return {
37
- content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
38
- };
39
- } catch (error) {
40
- const errorMessage =
41
- error instanceof Error ? error.message : String(error);
42
- return {
43
- isError: true,
44
- content: [{ type: "text" as const, text: errorMessage }],
45
- };
46
- }
47
- }
48
- );
49
- }
50
-
51
- return server;
52
- }