pisper 0.5.8-linux-x64.0 → 0.5.8

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 (288) hide show
  1. package/README.en.md +226 -0
  2. package/README.md +88 -88
  3. package/bin/pisper.mjs +48 -0
  4. package/lib/install.mjs +392 -0
  5. package/lib/npm-platform.mjs +41 -0
  6. package/lib/npm-update.mjs +165 -0
  7. package/lib/platform.mjs +43 -0
  8. package/lib/postinstall.mjs +3 -0
  9. package/package.json +36 -14
  10. package/updater.pubkey +1 -0
  11. package/web/.vite/manifest.json +2238 -0
  12. package/web/assets/AnimatedContent-BiVNqD3m.js +1 -0
  13. package/web/assets/AnimatedList-D6P3Wwa6.js +1 -0
  14. package/web/assets/AppOverlays-BhvGqK_L.js +1 -0
  15. package/web/assets/AppSelect-BdgnJD0G.js +1 -0
  16. package/web/assets/AssetsPage-CCVmkunw.js +1 -0
  17. package/web/assets/ChannelsPage-DlEkEhRq.js +1 -0
  18. package/web/assets/ChatHistoryPage-CTEgH57r.js +1 -0
  19. package/web/assets/ChatPage-BHP9b3V3.js +9 -0
  20. package/web/assets/ClickSpark-BxLJ1PyT.js +1 -0
  21. package/web/assets/ConfigPage-DTv4L3id.js +1 -0
  22. package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  23. package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  24. package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  25. package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  26. package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  27. package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  28. package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  29. package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  30. package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  31. package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  32. package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  33. package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  34. package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  35. package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  36. package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  37. package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  38. package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  39. package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  40. package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  41. package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  42. package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  43. package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  44. package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  45. package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  46. package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  47. package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  48. package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  49. package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  50. package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  51. package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  52. package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  53. package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  54. package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  55. package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  56. package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  57. package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  58. package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  59. package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  60. package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  61. package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  62. package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  63. package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  64. package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  65. package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  66. package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  67. package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  68. package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  69. package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  70. package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  71. package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  72. package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  73. package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  74. package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  75. package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  76. package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  77. package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  78. package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  79. package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  80. package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  81. package/web/assets/MarkdownMessage-IW5pioQm.js +1 -0
  82. package/web/assets/MemoryPage-C_1kPEft.js +1 -0
  83. package/web/assets/PageHeader-BnRvpWVD.js +1 -0
  84. package/web/assets/PluginsPage-C0Kl8POL.js +1 -0
  85. package/web/assets/PreviewPages-CwM9KZES.js +1 -0
  86. package/web/assets/SchedulesPage-Du_r8JQH.js +1 -0
  87. package/web/assets/ShinyText-K2BPzduJ.js +1 -0
  88. package/web/assets/SkillsPage-NLtGnzrg.js +1 -0
  89. package/web/assets/StarOrbit-BlI6MhVr.js +1 -0
  90. package/web/assets/TerminalPanel-4th7oGd1.js +18 -0
  91. package/web/assets/TerminalPanel-BrP-ENHg.css +1 -0
  92. package/web/assets/Threads-CS40baGh.js +1 -0
  93. package/web/assets/WelcomeEffects-C8XNVDhq.js +1 -0
  94. package/web/assets/WorkflowsPage-C1Vx_ocG.js +1 -0
  95. package/web/assets/WorkspacePicker-zV4rtq8i.js +1 -0
  96. package/web/assets/alert-B7D8joCd.js +1 -0
  97. package/web/assets/alert-dialog-DRWYJVbj.js +1 -0
  98. package/web/assets/andromeeda-vGVdxbeo.js +1 -0
  99. package/web/assets/angular-html-17rlCfBS.js +1 -0
  100. package/web/assets/angular-ts-it3MaXWH.js +1 -0
  101. package/web/assets/astro-BEVDzCov.js +1 -0
  102. package/web/assets/aurora-x-CDeNXAV0.js +1 -0
  103. package/web/assets/ayu-dark-DluEY0Gj.js +1 -0
  104. package/web/assets/ayu-light-C3h-C4tm.js +1 -0
  105. package/web/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  106. package/web/assets/blade-B3yUZIOx.js +1 -0
  107. package/web/assets/brand-CFOXmGdd.js +1 -0
  108. package/web/assets/button-CDkfouZn.js +1 -0
  109. package/web/assets/c-aGSZMVdM.js +1 -0
  110. package/web/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
  111. package/web/assets/catppuccin-latte-CtsyrtPq.js +1 -0
  112. package/web/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
  113. package/web/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
  114. package/web/assets/chevron-down-Cb6bnqQ4.js +1 -0
  115. package/web/assets/circle-dot-D28dfrea.js +1 -0
  116. package/web/assets/coffee-ouOQ86EC.js +1 -0
  117. package/web/assets/copy-BqjQWrFh.js +1 -0
  118. package/web/assets/cpp-Bm3vm43L.js +1 -0
  119. package/web/assets/css-CWcS1xXm.js +1 -0
  120. package/web/assets/csv-Dx-8-gkx.js +1 -0
  121. package/web/assets/dark-plus-Cs2F2srj.js +1 -0
  122. package/web/assets/dist-BpOm72-6.js +1 -0
  123. package/web/assets/dist-zSVagiYy.js +1 -0
  124. package/web/assets/dracula-BHWKrbxM.js +1 -0
  125. package/web/assets/dracula-soft-5eyTD99u.js +1 -0
  126. package/web/assets/es2015-TIiGfbEW.js +41 -0
  127. package/web/assets/everforest-dark-sB-x3p7T.js +1 -0
  128. package/web/assets/everforest-light-Df2xbC6M.js +1 -0
  129. package/web/assets/field-u9evjKvg.js +1 -0
  130. package/web/assets/file-D4w8IUw4.js +1 -0
  131. package/web/assets/file-code-corner-Dqjb0Cug.js +1 -0
  132. package/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  133. package/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  134. package/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  135. package/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  136. package/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  137. package/web/assets/github-dark-C-LZuMrd.js +1 -0
  138. package/web/assets/github-dark-default-DXG-b-1a.js +1 -0
  139. package/web/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  140. package/web/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  141. package/web/assets/github-light-EUqPIrTm.js +1 -0
  142. package/web/assets/github-light-default-BXViO-2h.js +1 -0
  143. package/web/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  144. package/web/assets/glsl-TOBAB6bO.js +1 -0
  145. package/web/assets/graphql-BEmIBNve.js +1 -0
  146. package/web/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  147. package/web/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  148. package/web/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  149. package/web/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  150. package/web/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  151. package/web/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  152. package/web/assets/haml-CDWtFtU9.js +1 -0
  153. package/web/assets/handlebars-BNtjo3pL.js +1 -0
  154. package/web/assets/horizon-CE9ld1lL.js +1 -0
  155. package/web/assets/horizon-bright-DSNQnXHK.js +1 -0
  156. package/web/assets/houston-CsvMBhTu.js +1 -0
  157. package/web/assets/html-BVyvp26C.js +1 -0
  158. package/web/assets/html-derivative-BseLpURQ.js +1 -0
  159. package/web/assets/http-CkCfSMV9.js +1 -0
  160. package/web/assets/hurl-syYMt6Rn.js +1 -0
  161. package/web/assets/image-DfmT5l79.js +1 -0
  162. package/web/assets/imba-DsUTQ-LC.js +1 -0
  163. package/web/assets/index-BWR8EHvN.js +41 -0
  164. package/web/assets/index-CgW2-ubX.css +2 -0
  165. package/web/assets/java-duG_UTKe.js +1 -0
  166. package/web/assets/javascript-DWVbOe4X.js +1 -0
  167. package/web/assets/jinja-Boj4niAz.js +1 -0
  168. package/web/assets/jison-CHwnC1Pv.js +1 -0
  169. package/web/assets/json-qhed-kSA.js +1 -0
  170. package/web/assets/json5-BR5RXkoi.js +1 -0
  171. package/web/assets/jsonc-CYpm1nAK.js +1 -0
  172. package/web/assets/jsonl-CmCQp5Yx.js +1 -0
  173. package/web/assets/jsx-fcCEM_-L.js +1 -0
  174. package/web/assets/julia-VoF7UKfw.js +1 -0
  175. package/web/assets/kanagawa-dragon-Bozd7klA.js +1 -0
  176. package/web/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
  177. package/web/assets/kanagawa-wave-BML5mF2J.js +1 -0
  178. package/web/assets/laserwave-C_8bwKvT.js +1 -0
  179. package/web/assets/less-DVTAwKKz.js +1 -0
  180. package/web/assets/light-plus-DVQuIRkW.js +1 -0
  181. package/web/assets/link-2-CDKitOSW.js +1 -0
  182. package/web/assets/loader-circle-XRCZj0q4.js +1 -0
  183. package/web/assets/markdown-BYOwaDjH.js +1 -0
  184. package/web/assets/marko-Cupn1xhw.js +1 -0
  185. package/web/assets/material-theme-Bm3Qr25_.js +1 -0
  186. package/web/assets/material-theme-darker-2IIEA8gg.js +1 -0
  187. package/web/assets/material-theme-lighter-uhdI0v04.js +1 -0
  188. package/web/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  189. package/web/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  190. package/web/assets/mdc-4FfK5iWR.js +1 -0
  191. package/web/assets/mdx-DQZ5AkYe.js +1 -0
  192. package/web/assets/message-circle-BW-CPcmG.js +1 -0
  193. package/web/assets/min-dark-BSWPekZh.js +1 -0
  194. package/web/assets/min-light-DDpmG2fV.js +1 -0
  195. package/web/assets/monokai-B_bV9PQ9.js +1 -0
  196. package/web/assets/network-KzJTl7t7.js +1 -0
  197. package/web/assets/night-owl-DhmEMT88.js +1 -0
  198. package/web/assets/night-owl-light-eJ-hLW7d.js +1 -0
  199. package/web/assets/nord-Cb4Vim4T.js +1 -0
  200. package/web/assets/one-dark-pro-CLwyXe_n.js +1 -0
  201. package/web/assets/one-light-D7Lr4KcI.js +1 -0
  202. package/web/assets/panel-top-DByYVkbw.js +1 -0
  203. package/web/assets/paperclip-CI8irkCX.js +1 -0
  204. package/web/assets/pencil-C67WdsWU.js +1 -0
  205. package/web/assets/php-CUREQQ7f.js +1 -0
  206. package/web/assets/pick-system-directory-BnIFt85A.js +1 -0
  207. package/web/assets/plastic-DQwYfKfQ.js +1 -0
  208. package/web/assets/play-CRwfAjca.js +1 -0
  209. package/web/assets/poimandres-DRFjx7u4.js +1 -0
  210. package/web/assets/postcss-BXeXVLqQ.js +1 -0
  211. package/web/assets/progress-CAkHRAfi.js +6 -0
  212. package/web/assets/pug-CQyGKZpv.js +1 -0
  213. package/web/assets/python-gzcpVVnB.js +1 -0
  214. package/web/assets/r-C5FwQflr.js +1 -0
  215. package/web/assets/react-bits-BFnYwuxx.css +1 -0
  216. package/web/assets/red-DX1BQOs8.js +1 -0
  217. package/web/assets/regexp--aR2_iz7.js +1 -0
  218. package/web/assets/rolldown-runtime-B0Z9INg1.js +1 -0
  219. package/web/assets/rose-pine-aMsaMD1D.js +1 -0
  220. package/web/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
  221. package/web/assets/rose-pine-moon-DO-qXg-I.js +1 -0
  222. package/web/assets/sass-DXrisJhu.js +1 -0
  223. package/web/assets/save-DAkFWHyI.js +1 -0
  224. package/web/assets/scss-Davl4E3T.js +1 -0
  225. package/web/assets/search-CAq4c_43.js +1 -0
  226. package/web/assets/shellscript-CLZ0U2zV.js +1 -0
  227. package/web/assets/shield-check-C62jDUnP.js +1 -0
  228. package/web/assets/slack-dark-DnToyrRv.js +1 -0
  229. package/web/assets/slack-ochin-B2OO5cIa.js +1 -0
  230. package/web/assets/smithy-Dgaz7aur.js +1 -0
  231. package/web/assets/snazzy-light-4G7pJPwS.js +1 -0
  232. package/web/assets/solarized-dark-UdsmMDCL.js +1 -0
  233. package/web/assets/solarized-light-C1IUL_tW.js +1 -0
  234. package/web/assets/sql-b92rrcVl.js +1 -0
  235. package/web/assets/square-D2anbrZz.js +1 -0
  236. package/web/assets/square-terminal-Pww63y-M.js +1 -0
  237. package/web/assets/stylus-B6D30XZt.js +1 -0
  238. package/web/assets/sun-BcZVxVDx.js +1 -0
  239. package/web/assets/svelte-BfstjgUc.js +1 -0
  240. package/web/assets/synthwave-84-nFMaYfgc.js +1 -0
  241. package/web/assets/tag-CqZUIGvX.js +1 -0
  242. package/web/assets/tokyo-night-oM2G3aXe.js +1 -0
  243. package/web/assets/trash-2-CsljwZ9-.js +1 -0
  244. package/web/assets/ts-tags-Cckpt1jI.js +1 -0
  245. package/web/assets/tsx-JMDX3aQ7.js +1 -0
  246. package/web/assets/typescript-BAz-bF8J.js +1 -0
  247. package/web/assets/use-i18n-CvBZ-cLZ.js +1 -0
  248. package/web/assets/usePagePrimaryAction-Bw0OFTDZ.js +1 -0
  249. package/web/assets/utils-C8uzG5AZ.js +1 -0
  250. package/web/assets/vendor-dockview-D5adAaCg.css +1 -0
  251. package/web/assets/vendor-dockview-yY5mBM3U.js +1 -0
  252. package/web/assets/vendor-markdown-CWK5AVhB.js +130 -0
  253. package/web/assets/vendor-markdown-plugins-DCl4I7Pz.js +263 -0
  254. package/web/assets/vendor-motion-XxgxfZSY.js +9 -0
  255. package/web/assets/vendor-react-CHuvPdJE.js +9 -0
  256. package/web/assets/vendor-router-Bw2aAdMs.js +4 -0
  257. package/web/assets/vendor-shiki-runtime-CxE5QolQ.js +153 -0
  258. package/web/assets/vendor-state-DE1O_s6m.js +1 -0
  259. package/web/assets/vendor-ui-DvrYggeS.js +1 -0
  260. package/web/assets/vendor-xyflow-CnjXtcyK.js +7 -0
  261. package/web/assets/vendor-xyflow-DLioOiRN.css +1 -0
  262. package/web/assets/vesper-DdrHHSXu.js +1 -0
  263. package/web/assets/vitesse-black-fwtXNY1n.js +1 -0
  264. package/web/assets/vitesse-dark-BZCL-v6S.js +1 -0
  265. package/web/assets/vitesse-light-VbXTXTou.js +1 -0
  266. package/web/assets/vue-3H7P6ncC.js +1 -0
  267. package/web/assets/vue-html-DZGW9MGR.js +1 -0
  268. package/web/assets/vue-vine-BECt67gq.js +1 -0
  269. package/web/assets/wasm-BnjxR4X6.js +1 -0
  270. package/web/assets/wasm-ByWQv1Qj.js +1 -0
  271. package/web/assets/wgsl-BsKzXJz4.js +1 -0
  272. package/web/assets/wit-DdvCle-K.js +1 -0
  273. package/web/assets/wrench-BIgib2eu.js +1 -0
  274. package/web/assets/xml-CNfvW5JP.js +1 -0
  275. package/web/assets/yaml-rwi0_p6S.js +1 -0
  276. package/web/assets/zap-evw8kNGN.js +1 -0
  277. package/web/favicon.svg +25 -0
  278. package/web/icons.svg +24 -0
  279. package/web/index.html +69 -0
  280. package/web/memory-galaxy-background.webp +0 -0
  281. package/web/notification-sw.js +13 -0
  282. package/web/tauri-pet.css +117 -0
  283. package/web/tauri-pet.html +16 -0
  284. package/web/tauri-pet.js +117 -0
  285. package/components/runtime/Pisper_Runtime_Node_0.5.8_linux_x86_64.tar.gz +0 -0
  286. package/components/runtime/Pisper_Runtime_Node_0.5.8_linux_x86_64.tar.gz.sig +0 -1
  287. package/components/tui/Pisper_TUI_Component_0.5.6_linux_x86_64.tar.gz +0 -0
  288. package/components/tui/Pisper_TUI_Component_0.5.6_linux_x86_64.tar.gz.sig +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./vendor-react-CHuvPdJE.js";import{n as t,t as n}from"./button-CDkfouZn.js";import{t as r}from"./use-i18n-CvBZ-cLZ.js";import{t as i}from"./utils-C8uzG5AZ.js";import{t as a}from"./link-2-CDKitOSW.js";import{n as o,r as s,t as c}from"./sun-BcZVxVDx.js";import{t as l}from"./play-CRwfAjca.js";import{t as u}from"./save-DAkFWHyI.js";import{t as d}from"./search-CAq4c_43.js";import{t as f}from"./square-terminal-Pww63y-M.js";import{t as p}from"./square-D2anbrZz.js";import{M as m,bt as h,vt as g}from"./index-BWR8EHvN.js";var _=t(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),v=t(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),y=e(),b={system:s,scheduled:_,light:c,dark:o};function x({meta:e,page:t,query:o,setQuery:s,configSection:c,onMenu:_,onPrimary:x,theme:S,onCycleTheme:C,searchInputRef:w,workflowActions:T,desktopPlatform:E,terminalOpen:D,onToggleTerminal:O}){let{t:k}=r(),A={chatHistory:[k(`navigation:pageHeader.newChat`),h],assets:[k(`navigation:pageHeader.addLink`),a],channels:[k(`navigation:pageHeader.connectChannel`),h],schedules:[k(`navigation:pageHeader.newTask`),h],config:[k(`navigation:pageHeader.addProvider`),h],plugins:[k(`navigation:pageHeader.savePolicy`),u],memory:[k(`navigation:pageHeader.addMemory`),h],mcp:[k(`navigation:pageHeader.addService`),h],skills:[k(`navigation:pageHeader.installSkill`),h],workflows:[k(`navigation:pageHeader.newWorkflow`),h],workflowCreate:[k(`navigation:pageHeader.publish`),g]},j=t===`config`&&c!==`models`?null:A[t],M=b[S],N=k(S===`light`?`navigation:pageHeader.light`:S===`dark`?`navigation:pageHeader.dark`:S===`scheduled`?`navigation:pageHeader.scheduled`:`navigation:pageHeader.system`),P=!!E;return(0,y.jsxs)(`header`,{className:i(`relative z-[2] flex min-h-14 flex-none items-center gap-3.5 px-6 pt-[9px] pb-[7px] in-data-[density=compact]:min-h-[50px] in-data-[density=compact]:pt-1.5 in-data-[density=compact]:pb-[5px] max-[650px]:min-h-[126px] max-[650px]:flex-wrap max-[650px]:content-center max-[650px]:gap-2.5 max-[650px]:px-4 max-[650px]:py-2.5`,t===`chat`&&`min-h-[52px] px-5 pt-2 pb-1.5 in-data-[density=compact]:min-h-[46px] max-[650px]:min-h-[126px] max-[650px]:px-4 max-[650px]:pt-3.5 max-[650px]:pb-2.5`,P&&`[-webkit-app-region:drag]`,E===`darwin`&&`pl-[74px]`),children:[(0,y.jsx)(m,{className:i(`hidden size-[34px] place-items-center rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--solid)] max-[900px]:grid`,P&&`[-webkit-app-region:no-drag]`),onClick:_,children:(0,y.jsx)(v,{size:19})}),(0,y.jsxs)(`div`,{className:`mr-auto flex min-w-[170px] items-baseline gap-2.5 max-[650px]:block max-[650px]:min-w-0 max-[650px]:flex-1`,children:[(0,y.jsx)(`h1`,{className:`text-base leading-[1.15] font-bold tracking-[0] max-[650px]:text-[21px]`,children:e[0]}),(0,y.jsx)(`p`,{className:`mt-0 min-w-0 overflow-hidden text-[12px] text-ellipsis whitespace-nowrap text-[var(--text-muted)] max-[650px]:mt-[3px] max-[650px]:whitespace-normal`,children:e[1]})]}),(0,y.jsxs)(`div`,{className:i(`flex min-w-0 items-center justify-end gap-2 max-[650px]:grid max-[650px]:w-full max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:justify-stretch`,t===`workflowCreate`&&`max-[650px]:grid-cols-[repeat(3,auto)] max-[650px]:justify-end`,P&&`[-webkit-app-region:no-drag]`,E&&E!==`darwin`&&`pr-[138px]`),children:[t===`workflowCreate`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(n,{variant:`outline`,size:`lg`,className:`bg-surface-subtle max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!T||T.busy||T.running,onClick:()=>T?.save(),children:[(0,y.jsx)(u,{size:15}),k(`navigation:pageHeader.saveDraft`)]}),(0,y.jsxs)(n,{size:`lg`,className:`max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!T||T.busy,onClick:()=>T?.run(),children:[T?.running?(0,y.jsx)(p,{size:15}):(0,y.jsx)(l,{size:15}),T?.running?k(`navigation:pageHeader.stop`):k(`navigation:pageHeader.testRun`)]})]}):t===`chat`?null:(0,y.jsxs)(`label`,{className:`flex h-[34px] w-[min(250px,24vw)] items-center gap-[7px] rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--search-bg)] px-2.5 text-[var(--text-muted)] focus-within:border-[var(--focus)] focus-within:shadow-[0_0_0_3px_var(--focus-ring)] in-data-[density=compact]:h-[30px] max-[900px]:w-[190px] max-[650px]:col-start-1 max-[650px]:row-start-1 max-[650px]:w-full max-[650px]:min-w-0`,title:k(`navigation:pageHeader.search`),children:[(0,y.jsx)(d,{size:15}),(0,y.jsx)(`input`,{className:`w-full min-w-0 border-0 bg-transparent text-[13px] text-[var(--text)] outline-none`,ref:w,value:o,onChange:e=>s(e.target.value),placeholder:t===`mcp`?k(`navigation:pageHeader.searchServicesOrTools`):t===`memory`?k(`navigation:pageHeader.searchMemoriesOrFiles`):k(`navigation:pageHeader.searchPage`,{page:e[0]})})]}),j&&(0,y.jsxs)(n,{size:`lg`,className:`max-[650px]:col-start-2 max-[650px]:row-start-1`,title:k(`navigation:pageHeader.primaryActionShortcut`,{action:j[0]}),onClick:x,children:[(()=>{let e=j[1];return(0,y.jsx)(e,{size:15})})(),j[0]]}),P&&(0,y.jsx)(n,{variant:`ghost`,size:`icon`,className:D?`bg-surface-hover text-brand`:void 0,title:k(`navigation:pageHeader.toggleTerminal`),"aria-label":k(`navigation:pageHeader.toggleTerminal`),"aria-pressed":D,onClick:O,children:(0,y.jsx)(f,{size:16})}),(0,y.jsx)(n,{variant:`outline`,size:`icon`,className:`bg-[var(--solid)] max-[650px]:absolute max-[650px]:top-3.5 max-[650px]:right-4`,title:k(`navigation:pageHeader.themeThemeClickToSwitch`,{theme:N}),"aria-label":k(`navigation:pageHeader.themeThemeClickToSwitchThemes`,{theme:N}),onClick:C,children:(0,y.jsx)(M,{size:16})})]})]})}export{x as PageHeader};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{n as r,t as i}from"./button-CDkfouZn.js";import{t as a}from"./use-i18n-CvBZ-cLZ.js";import{_ as o,a as s,d as c,f as l,g as u,h as d,i as f,l as p,m as ee,n as te,o as ne,p as m,r as re,s as ie,t as ae,u as oe,v as h}from"./alert-dialog-DRWYJVbj.js";import{t as g}from"./AppSelect-BdgnJD0G.js";import{t as se}from"./chevron-down-Cb6bnqQ4.js";import{t as _}from"./file-code-corner-Dqjb0Cug.js";import{t as v}from"./image-DfmT5l79.js";import{t as ce}from"./loader-circle-XRCZj0q4.js";import{t as y}from"./search-CAq4c_43.js";import{t as le}from"./trash-2-CsljwZ9-.js";import{A as b,D as x,Dt as S,E as C,O as w,R as T,_t as E,c as ue,i as D,j as O,k,l as A,mt as j,r as de,s as fe,wt as M,xt as pe,yt as me}from"./index-BWR8EHvN.js";import{t as he}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{n as N,t as P}from"./pick-system-directory-BnIFt85A.js";var F=r(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 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.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),I=e(t(),1),L=n();function R(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function ge({open:e,onOpenChange:t,onInstalled:n}){let{t:r}=a(),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(null),[u,d]=(0,I.useState)(!1),[f,p]=(0,I.useState)(``);return(0,I.useEffect)(()=>{e||(s(``),l(null),d(!1),p(``))},[e]),(0,L.jsx)(C,{open:e,onOpenChange:e=>!u&&t(e),children:(0,L.jsxs)(x,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,L.jsxs)(b,{children:[(0,L.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,L.jsx)(F,{size:17}),r(`plugins:pluginsPage.installLocalPlugin`)]}),(0,L.jsx)(w,{children:r(`plugins:pluginsPage.installLocalPluginDescription`)})]}),(0,L.jsxs)(`div`,{className:`grid gap-3`,children:[(0,L.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-semibold text-[var(--text-soft)]`,children:[r(`plugins:pluginsPage.pluginDirectory`),(0,L.jsxs)(`span`,{className:`flex min-w-0 gap-2`,children:[(0,L.jsx)(`input`,{className:`h-10 min-w-0 flex-1 rounded-md border border-[var(--stroke)] bg-[var(--solid)] px-3 text-[13px] text-[var(--text)] outline-none focus:border-[var(--star-border)]`,value:o,disabled:u,placeholder:r(`plugins:pluginsPage.pluginDirectoryPlaceholder`),onChange:e=>{s(e.target.value),l(null)}}),P()&&(0,L.jsx)(i,{type:`button`,variant:`ghost`,size:`icon`,className:`size-10 shrink-0`,title:r(`plugins:pluginsPage.chooseDirectory`),onClick:async()=>{p(``);try{let e=await N(o);e&&(s(e),l(null))}catch(e){p(e instanceof Error?e.message:String(e))}},children:(0,L.jsx)(M,{size:16})})]})]}),c&&(0,L.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-[var(--stroke)] bg-[var(--surface-muted)] p-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,L.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-md bg-[var(--success-soft)] text-[var(--success)]`,children:(0,L.jsx)(S,{size:17})}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`strong`,{className:`block truncate text-[13px] text-[var(--text)]`,children:c.plugin.name}),(0,L.jsxs)(`small`,{className:`block truncate text-[12px] text-[var(--text-muted)]`,children:[c.plugin.id,` · v`,c.plugin.version,` · `,c.fileCount,` `,r(`plugins:pluginsPage.files`),` · `,R(c.byteCount)]})]})]}),(0,L.jsx)(`div`,{className:`grid gap-1.5`,children:c.plugin.capabilities.map(e=>(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-[var(--stroke-soft)] pt-2 text-xs`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{className:`block text-[var(--text)]`,children:e.label}),(0,L.jsx)(`small`,{className:`text-[var(--text-muted)]`,children:e.description})]}),(0,L.jsx)(`code`,{className:`shrink-0 text-[11px] text-[var(--text-soft)]`,children:e.name})]},e.name))}),(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-[var(--warning-soft)] p-2.5 text-xs leading-5 text-[var(--warning-strong)]`,children:[(0,L.jsx)(j,{className:`mt-0.5 shrink-0`,size:15}),(0,L.jsx)(`span`,{children:r(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),f&&(0,L.jsxs)(D,{className:`m-0`,children:[(0,L.jsx)(j,{size:14}),(0,L.jsx)(`span`,{children:f})]})]}),(0,L.jsxs)(k,{children:[(0,L.jsx)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:u,onClick:()=>t(!1),children:r(`common:ui.cancel`)}),(0,L.jsxs)(i,{type:`button`,size:`lg`,disabled:u||!c&&!o.trim(),onClick:c?async()=>{if(!(!c||u)){d(!0),p(``);try{await T(`/api/plugins/install`,{method:`POST`,body:JSON.stringify({inspectionId:c.inspectionId})}),await n(),t(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}}:async()=>{if(!(!o.trim()||u)){d(!0),p(``);try{l(await T(`/api/plugins/inspect`,{method:`POST`,body:JSON.stringify({path:o.trim()})}))}catch(e){l(null),p(e instanceof Error?e.message:String(e))}finally{d(!1)}}},children:[u?(0,L.jsx)(ce,{className:`animate-spin`,size:15}):c?(0,L.jsx)(F,{size:15}):(0,L.jsx)(S,{size:15}),r(u?`plugins:pluginsPage.processing`:c?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var z=[`all`,`builtin`,`local`],_e={read:o,ls:M,grep:y,find:y,edit:_,write:_,bash:E,web_search:h,browser_automation:h,generate_visual:v};function B(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function ve(e,t){return t(e===`read-only`?`plugins:pluginsPage.readOnly`:e===`workspace`?`plugins:pluginsPage.workspace`:`plugins:pluginsPage.full`)}function ye(e){return e.flatMap(e=>e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function V(e){return e.flatMap(e=>e.capabilities.map(t=>({...t,pluginId:e.id,pluginName:e.name,pluginDescription:e.description,pluginVersion:e.version,pluginSource:e.source,pluginBuiltIn:e.builtIn,pluginPermissions:e.permissions||[],pluginSystemAccess:!!e.systemAccess})))}function be(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function H(e,t){return m({id:e.name,name:e.label},t)}function U(e,t){return e.pluginBuiltIn?c(e.pluginName,t):e.pluginName}function xe({value:e,testing:t,onChange:n,onTest:r}){let{t:o}=a();return(0,L.jsxs)(`div`,{className:`plugin-tool-config [&_label]:grid [&_label]:gap-[5px] [&_label]:text-[var(--text-muted)] [&_label]:text-[11px] [&_label]:font-[600] [&_select]:w-full [&_select]:h-[34px] [&_select]:[border:1px_solid_var(--stroke)] [&_select]:rounded-[var(--r-xs)] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text)] [&_select]:text-[12px] [&_input]:w-full [&_input]:h-[34px] [&_input]:[border:1px_solid_var(--stroke)] [&_input]:rounded-[var(--r-xs)] [&_input]:bg-[var(--solid)] [&_input]:p-[0_8px] [&_input]:text-[var(--text)] [&_input]:text-[12px] grid gap-[9px] [border-top:1px_solid_var(--stroke)] [padding-top:10px]`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:[(0,L.jsxs)(`label`,{children:[o(`plugins:pluginsPage.defaultLanguage`),(0,L.jsxs)(g,{value:e.language,onChange:t=>n({...e,language:t.target.value}),children:[(0,L.jsx)(`option`,{value:`auto`,children:o(`plugins:pluginsPage.auto`)}),(0,L.jsx)(`option`,{value:`zh-CN`,children:o(`plugins:pluginsPage.simplifiedChinese`)}),(0,L.jsx)(`option`,{value:`en-US`,children:o(`plugins:pluginsPage.english`)})]})]}),(0,L.jsxs)(`label`,{children:[o(`plugins:pluginsPage.safeSearch`),(0,L.jsxs)(g,{value:e.safeSearch,onChange:t=>n({...e,safeSearch:Number(t.target.value)}),children:[(0,L.jsx)(`option`,{value:0,children:o(`plugins:pluginsPage.off`)}),(0,L.jsx)(`option`,{value:1,children:o(`plugins:pluginsPage.moderate`)}),(0,L.jsx)(`option`,{value:2,children:o(`plugins:pluginsPage.strict`)})]})]}),(0,L.jsxs)(`label`,{children:[o(`plugins:pluginsPage.resultCount`),(0,L.jsx)(`input`,{type:`number`,min:`1`,max:`12`,value:e.maxResults,onChange:t=>n({...e,maxResults:Number(t.target.value)})})]})]}),(0,L.jsxs)(i,{type:`button`,variant:`outline`,size:`lg`,className:`justify-self-end bg-surface-subtle`,disabled:t,onClick:r,children:[t?(0,L.jsx)(me,{className:`animate-spin`,size:14}):(0,L.jsx)(h,{size:14}),o(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function W({query:e=``,notify:t,registerPrimaryAction:n,onStatusChange:r}){let{t:o}=a(),[c,m]=(0,I.useState)(null),[h,g]=(0,I.useState)([]),[_,v]=(0,I.useState)(``),[y,b]=(0,I.useState)(`all`),[x,S]=(0,I.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[C,w]=(0,I.useState)(!1),[E,O]=(0,I.useState)(!1),[k,M]=(0,I.useState)(!1),[N,P]=(0,I.useState)(null),[R,W]=(0,I.useState)(!1),[G,K]=(0,I.useState)(``),q=(0,I.useCallback)(e=>{m(e),g(e.plugins),S(e.webSearch);let t=V(e.plugins);r({enabled:t.filter(e=>e.enabled).length,total:t.length})},[r]),J=(0,I.useCallback)(async()=>{K(``);try{q(await T(`/api/plugins`))}catch(e){K(e instanceof Error?e.message:String(e))}},[q]);(0,I.useEffect)(()=>{J()},[J]);let Y=(0,I.useMemo)(()=>V(h),[h]),X=(0,I.useMemo)(()=>ye(h),[h]),Z=c?!be(X,c.enabledTools)||JSON.stringify(x)!==JSON.stringify(c.webSearch):!1,Se=(0,I.useCallback)(async()=>{if(!C){if(!c||!Z){c&&t(o(`plugins:pluginsPage.noPluginPolicyChanges`));return}w(!0),K(``);try{let e=await T(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:X,webSearch:x})});q(e),t(o(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){K(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[q,c,Z,X,t,C,o,x]);he(n,Se);let Ce=async()=>{O(!0),K(``);try{let e=await T(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(x)});t(o(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:e.count}))}catch(e){let n=e instanceof Error?e.message:String(e);K(n),t(n,`error`)}finally{O(!1)}},we=(e,t,n)=>{g(r=>r.map(r=>r.id===e?{...r,enabled:n||r.capabilities.some(e=>e.name!==t&&e.enabled),capabilities:r.capabilities.map(e=>e.name===t?{...e,enabled:n}:e)}:r))},Te=e=>{let t=new Set(c?.presets?.[e]||[]);g(e=>e.map(e=>e.builtIn?{...e,enabled:e.capabilities.some(e=>t.has(e.name)),capabilities:e.capabilities.map(e=>({...e,enabled:t.has(e.name)}))}:e))},Q=()=>!Z||(K(o(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),Ee=async()=>{if(!(!N||R)){W(!0),K(``);try{q(await T(`/api/plugins/${encodeURIComponent(N.pluginId)}`,{method:`DELETE`})),t(o(`plugins:pluginsPage.pluginUninstalled`,{name:N.pluginName})),v(``),P(null)}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}};if(!c)return(0,L.jsxs)(de,{children:[(0,L.jsx)(me,{className:`animate-spin`,size:24}),(0,L.jsx)(`h2`,{children:o(`plugins:pluginsPage.loadingToolPlugins`)}),G&&(0,L.jsxs)(D,{children:[(0,L.jsx)(j,{size:13}),G]})]});let De=e.trim().toLowerCase(),$=Y.filter(e=>y!==`all`&&e.pluginSource!==y?!1:[H(e,o),e.name,e.description,U(e,o),e.pluginId].join(` `).toLowerCase().includes(De));return(0,L.jsxs)(`div`,{className:`plugins-page flex min-h-[100%] flex-col gap-[12px] max-[900px]:h-auto h-full min-h-0 overflow-y-auto [scrollbar-gutter:stable]`,children:[(0,L.jsxs)(`div`,{className:`plugin-toolbar max-[650px]:items-stretch max-[650px]:flex-col flex items-center justify-between gap-[12px]`,children:[(0,L.jsx)(ue,{options:z.map(e=>B(e,o)),value:B(y,o),onChange:e=>b(z.find(t=>B(t,o)===e)||`all`)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,L.jsxs)(`div`,{className:`plugin-presets [&_>_span]:p-[0_6px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] [&_button]:h-[27px] [&_button]:border-0 [&_button]:rounded-[var(--r-xs)] [&_button]:bg-transparent [&_button]:p-[0_9px] [&_button]:text-[var(--text-muted)] [&_button]:text-[12px] [&_button]:font-[600] [&_button:hover]:bg-[var(--accent-soft)] [&_button:hover]:text-[var(--star-strong)] [&_button.active]:bg-[var(--accent-soft)] [&_button.active]:text-[var(--star-strong)] max-[650px]:min-w-0 max-[650px]:overflow-x-auto flex items-center gap-[4px] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--solid)] [padding:3px]`,children:[(0,L.jsx)(`span`,{children:o(`plugins:pluginsPage.presets`)}),[`read-only`,`workspace`,`full`].map(e=>(0,L.jsx)(`button`,{type:`button`,className:c.preset===e&&!Z?`active`:``,onClick:()=>Te(e),children:ve(e,o)},e))]}),(0,L.jsxs)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>Q()&&M(!0),children:[(0,L.jsx)(F,{size:15}),o(`plugins:pluginsPage.installPlugin`)]})]})]}),(0,L.jsxs)(`div`,{className:`plugin-catalog-heading [&_>_span]:flex [&_>_span]:items-center [&_>_span]:gap-[7px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[12px] [&_small]:[font-variant-numeric:tabular-nums] max-[650px]:items-start flex items-center justify-between gap-[12px] [padding:2px]`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:o(`plugins:pluginsPage.toolCatalog`)}),(0,L.jsx)(`small`,{children:$.length})]}),(0,L.jsxs)(`span`,{className:`plugin-catalog-summary text-[var(--text-muted)] text-[12px] [font-variant-numeric:tabular-nums] [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-green)] max-[650px]:flex-wrap max-[650px]:justify-end`,children:[(0,L.jsx)(`i`,{}),Y.filter(e=>e.enabled).length,`/`,Y.length,` `,o(`plugins:pluginsPage.enabled2`),Z&&(0,L.jsx)(A,{tone:`amber`,children:o(`plugins:pluginsPage.unsaved`)})]})]}),$.length?(0,L.jsx)(`div`,{className:`plugin-tool-grid max-[650px]:grid-cols-[minmax(0,1fr)] grid grid-cols-[repeat(auto-fill,minmax(310px,1fr))] [align-items:start] gap-[10px] [padding-bottom:4px]`,children:$.map(e=>{let t=_===e.name,n=_e[e.name]||pe;return(0,L.jsxs)(`article`,{className:`plugin-tool-card [&[data-open]]:border-[var(--stroke-hover)] [&[data-open]]:shadow-[var(--sh-1)] min-w-0 overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--solid)]`,"data-open":t||void 0,children:[(0,L.jsxs)(`div`,{className:`plugin-tool-card-head hover:bg-[var(--surface-hover)] [.plugin-tool-card[data-open]_>_&]:bg-[var(--surface-hover)] max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:[padding-inline:8px] grid min-h-[56px] grid-cols-[minmax(0,1fr)_auto] items-center gap-[10px] [padding:7px_10px]`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`grid min-w-0 h-full grid-cols-[32px_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent p-0 text-inherit text-left`,"aria-expanded":t,onClick:()=>v(t=>t===e.name?``:e.name),children:[(0,L.jsx)(`span`,{className:`grid w-[32px] h-[32px] place-items-center rounded-[var(--r-xs)] bg-[var(--surface-muted)] text-[var(--text-soft)]`,children:(0,L.jsx)(n,{size:15})}),(0,L.jsxs)(`span`,{className:`plugin-tool-title [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] flex min-w-0 flex-col gap-[2px]`,children:[(0,L.jsx)(`strong`,{title:H(e,o),children:H(e,o)}),(0,L.jsx)(`small`,{children:U(e,o)})]})]}),(0,L.jsxs)(`span`,{className:`plugin-tool-trailing [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-muted)] [&_>_i[data-enabled]]:bg-[var(--status-green)] max-[650px]:gap-[5px] inline-flex items-center gap-[7px]`,children:[(0,L.jsx)(`i`,{"data-enabled":e.enabled||void 0}),!e.pluginBuiltIn&&(0,L.jsx)(A,{tone:`amber`,children:o(`plugins:pluginsPage.local`)}),(0,L.jsx)(fe,{value:e.enabled,onChange:t=>we(e.pluginId,e.name,t)}),(0,L.jsx)(`button`,{type:`button`,className:`plugin-tool-chevron hover:bg-[var(--surface-muted)] hover:text-[var(--text)] [&_svg]:[transition:transform_var(--d1)_var(--ease-out)] [&[aria-expanded='true']_svg]:[transform:rotate(180deg)] grid w-[24px] h-[24px] place-items-center border-0 rounded-[var(--r-xs)] bg-transparent text-[var(--text-muted)]`,"aria-label":o(`plugins:pluginsPage.toggleToolDetails`,{name:H(e,o)}),"aria-expanded":t,onClick:()=>v(t=>t===e.name?``:e.name),children:(0,L.jsx)(se,{size:14})})]})]}),t&&(0,L.jsxs)(`div`,{className:`plugin-tool-details [&_>_p]:m-0 [&_>_p]:text-[var(--text-soft)] [&_>_p]:text-[12px] [&_>_p]:leading-[1.55] [&_>_code]:[overflow-wrap:anywhere] [&_>_code]:text-[var(--text)] [&_>_code]:text-[11px] [&_dl]:grid [&_dl]:grid-cols-[78px_minmax(0,1fr)] [&_dl]:gap-[6px_10px] [&_dl]:m-0 [&_dl_div]:[display:contents] [&_dt]:text-[var(--text-muted)] [&_dt]:text-[11px] [&_dd]:min-w-0 [&_dd]:m-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-[var(--text-soft)] [&_dd]:text-[12px] max-[650px]:[&_dl]:grid-cols-[68px_minmax(0,1fr)] grid gap-[9px] [border-top:1px_solid_var(--stroke)] bg-[var(--surface-subtle)] [padding:11px_13px_13px]`,children:[(0,L.jsx)(`p`,{children:l({id:e.name,description:e.description},o)}),(0,L.jsx)(`code`,{children:e.name}),(0,L.jsxs)(`dl`,{children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:o(`plugins:pluginsPage.source`)}),(0,L.jsxs)(`dd`,{children:[U(e,o),!e.pluginBuiltIn&&` · v${e.pluginVersion}`]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:o(`plugins:pluginsPage.riskLevel`)}),(0,L.jsx)(`dd`,{className:oe(e.risk)?`text-[var(--danger)]`:``,children:ee(e.risk,o)})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:o(`plugins:pluginsPage.pathScope`)}),(0,L.jsx)(`dd`,{children:d({id:e.name,scope:e.scope},o)})]}),!e.pluginBuiltIn&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:o(`plugins:pluginsPage.executionMode`)}),(0,L.jsx)(`dd`,{children:o(`plugins:pluginsPage.fullAccessOnly`)})]})]}),!e.pluginBuiltIn&&(0,L.jsxs)(`div`,{className:`plugin-tool-warning [&_svg]:flex-none [&_svg]:mt-[1px] flex items-start gap-[7px] rounded-[var(--r-xs)] bg-[var(--warning-soft)] [padding:8px] text-[var(--warning-strong)] text-[11px] leading-[1.5]`,children:[(0,L.jsx)(u,{size:14}),(0,L.jsx)(`span`,{children:o(`plugins:pluginsPage.localPluginSecurityWarning`)})]}),e.name===`web_search`&&(0,L.jsx)(xe,{value:x,testing:E,onChange:S,onTest:Ce}),!e.pluginBuiltIn&&(0,L.jsxs)(i,{type:`button`,variant:`destructive`,size:`lg`,className:`[justify-self:end]`,onClick:()=>Q()&&P(e),children:[(0,L.jsx)(le,{size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]},e.name)})}):(0,L.jsx)(`div`,{className:`plugin-empty [&.compact]:min-h-[90px] grid min-h-[180px] place-items-center text-[var(--text-muted)] text-[12px]`,children:o(`plugins:pluginsPage.noMatchingTools`)}),(0,L.jsx)(ge,{open:k,onOpenChange:M,onInstalled:J}),(0,L.jsx)(ae,{open:!!N,onOpenChange:e=>!e&&!R&&P(null),children:(0,L.jsxs)(f,{className:`z-[220]`,children:[(0,L.jsxs)(ie,{children:[(0,L.jsx)(p,{children:o(`plugins:pluginsPage.uninstallPlugin`)}),(0,L.jsx)(s,{children:o(`plugins:pluginsPage.uninstallPluginDescription`,{name:N?.pluginName||``})})]}),(0,L.jsxs)(ne,{children:[(0,L.jsx)(re,{disabled:R,children:o(`common:ui.cancel`)}),(0,L.jsxs)(te,{variant:`destructive`,disabled:R,onClick:Ee,children:[R&&(0,L.jsx)(ce,{className:`animate-spin`,size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),G&&(0,L.jsxs)(D,{className:`fixed z-[21] [right:24px] [bottom:24px] max-w-[360px] shadow-[0_12px_28px_-18px_var(--floating-shadow)]`,children:[(0,L.jsx)(j,{size:13}),G]})]})}export{W as PluginsPage};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./button-CDkfouZn.js";import{t as i}from"./use-i18n-CvBZ-cLZ.js";import{t as a}from"./utils-C8uzG5AZ.js";import{t as o}from"./circle-dot-D28dfrea.js";import{t as s}from"./trash-2-CsljwZ9-.js";import{t as c}from"./wrench-BIgib2eu.js";import{I as l,R as u,_ as d,_t as f,g as p,m,p as h,yt as g}from"./index-BWR8EHvN.js";import{t as _}from"./usePagePrimaryAction-Bw0OFTDZ.js";var v=e(t(),1),y=n(),b={green:`border-[var(--success-border)] bg-[var(--success-soft)] text-[var(--success-strong)]`,amber:`border-[var(--warning-border)] bg-[var(--warning-soft)] text-[var(--warning-strong)]`,gray:`border-[var(--stroke)] bg-[var(--surface-muted)] text-[var(--text-muted)]`,red:`border-[var(--danger-border)] bg-[var(--danger-soft)] text-[var(--danger)]`};function x({className:e,children:t}){return(0,y.jsx)(m,{size:`sm`,className:a(`workflow-card [&_h2]:text-[16px] [&_h2]:tracking-[-.02em] [.detail-stack_>_&]:[flex:0_0_auto] [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--panel)] text-[var(--text)] shadow-[0_1px_2px_var(--sh-edge),0_14px_32px_-24px_var(--shadow)] gap-0 p-3.5 py-3.5`,e),children:t})}function S({children:e}){return(0,y.jsx)(p,{className:`workflow-section-title [.selection-list_&]:mb-[8px] [.node-library_&]:mb-[8px] text-[var(--text-soft)] text-[13px] font-[700] leading-[1.4]`,children:e})}function C({value:e,label:t,note:n,tone:r}){return(0,y.jsxs)(m,{size:`sm`,className:a(`workflow-card [&_h2]:text-[16px] [&_h2]:tracking-[-.02em] [.detail-stack_>_&]:[flex:0_0_auto] [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--panel)] text-[var(--text)] shadow-[0_1px_2px_var(--sh-edge),0_14px_32px_-24px_var(--shadow)] metric [transition:transform_var(--d2)_var(--ease-out),_box-shadow_var(--d2)_var(--ease-out),_border-color_var(--d2)_var(--ease-out)] hover:[transform:translateY(-2px)] hover:shadow-[var(--sh-2)] hover:border-[var(--star-border)] [&_small]:[grid-column:1/-1] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_strong]:mt-[5px] [&_strong]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_strong]:text-[23px] [&_span]:[align-self:end] [&_span]:text-[var(--text-muted)] [&_span]:text-[13px] [&.blue_strong]:text-[var(--star-strong)] [&.green_strong]:text-[var(--success)] [&.amber_strong]:text-[var(--amber)] grid grid-cols-[1fr_auto] [padding:12px] gap-0 p-3 py-3`,r),children:[(0,y.jsx)(`small`,{children:t}),(0,y.jsx)(`strong`,{children:e}),(0,y.jsx)(`span`,{children:n})]})}function w({children:e,tone:t}){return(0,y.jsx)(d,{variant:`outline`,className:b[t],children:e})}function T(e,t){return e===`online`?[t(`workflows:previewPages.online`),`green`]:e===`connecting`?[t(`workflows:previewPages.connecting`),`amber`]:e===`unauthorized`?[t(`workflows:previewPages.unauthorized`),`gray`]:e===`disabled`?[t(`workflows:previewPages.disabled`),`gray`]:[t(`workflows:previewPages.offline`),`red`]}function E(e,t){return e===`high`||e===`高风险`?t(`workflows:previewPages.highRisk`):e===`medium`||e===`中风险`?t(`workflows:previewPages.mediumRisk`):e===`low`||e===`低风险`?t(`workflows:previewPages.lowRisk`):String(e||``)}function D(e,t){return e?e.auth===`headers`?t(`workflows:previewPages.countRequestHeaders`,{count:e.authCount}):e.auth===`environment`?t(`workflows:previewPages.configuredEnvironmentVariables`):e.auth===`local`?t(`workflows:previewPages.localProcess`):t(`workflows:previewPages.none`):`—`}function O({notify:e,query:t=``,registerPrimaryAction:n,requestText:a,requestConfirm:d}){let{t:p,language:m}=i(),[b,O]=(0,v.useState)(null),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(!1),[,N]=(0,v.useState)(``),P=(0,v.useCallback)(async(e=!0)=>{N(``);try{let t=await u(`/api/mcp?refresh=${e?`1`:`0`}`);return O(t),A(e=>t.services.some(t=>t.id===e)?e:t.services[0]?.id||``),t}catch(e){return N(e instanceof Error?e.message:String(e)),null}},[]);(0,v.useEffect)(()=>{P(!0);let e=window.setInterval(()=>{P(!1)},1e4);return()=>window.clearInterval(e)},[P]);let F=(0,v.useCallback)(async()=>{let t=await a?.({title:p(`workflows:previewPages.addMCPService`),message:p(`workflows:previewPages.enterAStreamableHTTPURLAStdioCommandOrJSONContainingHeadersEnv`),inputLabel:p(`workflows:previewPages.serverConfiguration`),placeholder:`https://server.example.com/mcp`,maxLength:12e3,confirmLabel:p(`workflows:previewPages.continue`)});if(t?.trim()&&await d?.({title:p(`workflows:previewPages.connectMCPServer`),message:p(`workflows:previewPages.mcpServersCanExposeToolsThatPerformExternalActionsConnectOnlyToServersYouTrust`),confirmLabel:p(`workflows:previewPages.connect`),tone:`danger`})!==!1){M(!0),N(``);try{let n=await u(`/api/mcp`,{method:`POST`,body:JSON.stringify({spec:t})});O(n),A(n.services.at(-1)?.id||n.services[0]?.id||``),e(p(`workflows:previewPages.mcpServerAdded`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);N(n),e(n,`error`)}finally{M(!1)}}},[e,d,a,p]);_(n,F);let I=b?.services||[],L=I.filter(e=>`${e.name} ${e.endpoint}`.toLowerCase().includes(t.toLowerCase())),R=I.find(e=>e.id===k)||L[0]||I[0]||null,z=(b?.tools||[]).filter(e=>`${e.name} ${e.serviceName} ${e.description}`.toLowerCase().includes(t.toLowerCase())),B=(b?.calls||[]).filter(e=>!R||e.serviceId===R.id),V=b?.metrics||{totalServices:0,onlineServices:0,availableTools:0,restrictedTools:0,errorRate:0},H=async(e,t)=>{M(!0),N(``);try{O(await u(`/api/mcp/${encodeURIComponent(e.serviceId)}/tools/${encodeURIComponent(e.name)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}))}catch(e){N(e instanceof Error?e.message:String(e))}finally{M(!1)}},U=async t=>{if(R){M(!0),N(``);try{O(await u(`/api/mcp/${encodeURIComponent(R.id)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})})),e(p(t?`workflows:previewPages.mcpServerEnabled`:`workflows:previewPages.mcpServerDisabled`),`success`)}catch(e){N(e instanceof Error?e.message:String(e))}finally{M(!1)}}},W=async()=>{if(R){M(!0),N(``);try{O(await u(`/api/mcp/${encodeURIComponent(R.id)}/test`,{method:`POST`,body:`{}`})),e(p(`workflows:previewPages.mcpConnectionTestPassed`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);N(n),e(n,`error`)}finally{M(!1)}}},G=async()=>{if(R&&await d?.({title:p(`workflows:previewPages.deleteMCPServer`),message:p(`workflows:previewPages.afterDeletionToolsFromThisServerWillBeRemovedFromSubsequentAgentRuns`),confirmLabel:p(`workflows:previewPages.delete`),tone:`danger`})!==!1){M(!0),N(``);try{await u(`/api/mcp/${encodeURIComponent(R.id)}`,{method:`DELETE`});let t=await P(!1);A(t?.services[0]?.id||``),e(p(`workflows:previewPages.mcpServerDeleted`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);N(n),e(n,`error`)}finally{M(!1)}}};return(0,y.jsx)(`div`,{className:`preview-page flex min-h-[100%] flex-col`,children:(0,y.jsxs)(`div`,{className:`mcp-layout [.preview-page_>_&]:min-h-0 [.preview-page_>_&]:flex-1 max-[1150px]:grid-cols-[220px_minmax(340px,1fr)] max-[650px]:grid-cols-[1fr] grid min-h-[100%] grid-cols-[230px_minmax(320px,1fr)_300px] gap-[12px]`,children:[(0,y.jsxs)(x,{className:`selection-list [.config-layout_>_&]:max-h-[calc(100dvh_-_280px)] [.config-layout_>_&]:overflow-y-auto max-[900px]:max-h-[300px] min-h-0 overflow-auto`,children:[(0,y.jsx)(S,{children:p(`workflows:previewPages.services`)}),L.length?L.map(e=>{let[t,n]=T(e.status,p),r=e.transport===`stdio`?e.workingDirectory||e.command:e.endpoint;return(0,y.jsxs)(`button`,{className:`service-row grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] border-0 [border-top:1px_solid_var(--stroke-soft)] bg-transparent p-[10px_8px] text-left hover:rounded-[var(--r-sm)] hover:bg-[var(--accent-soft)] [&.active]:rounded-[var(--r-sm)] [&.active]:bg-[var(--accent-soft)] [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap ${R?.id===e.id?`active`:``}`,onClick:()=>A(e.id),children:[(0,y.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,y.jsx)(f,{size:15})}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:e.name}),(0,y.jsx)(`small`,{title:r,children:r})]}),(0,y.jsx)(w,{tone:n,children:t})]},e.id)}):(0,y.jsx)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:p(`workflows:previewPages.noServerConfigured`)})]}),(0,y.jsxs)(`div`,{className:`mcp-center max-[650px]:min-w-0 flex min-w-0 flex-col gap-[12px]`,children:[(0,y.jsxs)(`div`,{className:`metric-grid max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(3,minmax(0,1fr))] gap-[9px]`,children:[(0,y.jsx)(C,{value:String(V.onlineServices),label:p(`workflows:previewPages.onlineServices`),note:p(`workflows:previewPages.countServicesTotal`,{count:V.totalServices}),tone:`blue`}),(0,y.jsx)(C,{value:String(V.availableTools),label:p(`workflows:previewPages.availableTools`),note:p(`workflows:previewPages.countRestrictedTools`,{count:V.restrictedTools}),tone:`green`}),(0,y.jsx)(C,{value:`${V.errorRate}%`,label:p(`workflows:previewPages.errorRate`),note:`24h`,tone:`amber`})]}),(0,y.jsxs)(x,{className:`mcp-tools-panel [.mcp-center_>_&]:flex-1 [.mcp-center_>_&]:min-h-0 [.mcp-center_>_&]:overflow-y-auto`,children:[(0,y.jsxs)(S,{children:[p(`workflows:previewPages.toolCapabilities`),` · `,z.length]}),z.length?z.map(e=>(0,y.jsxs)(`div`,{className:`tool-row [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap grid min-h-[48px] grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-[8px] [border-top:1px_solid_var(--stroke-soft)] [padding:6px_2px]`,children:[(0,y.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,y.jsx)(c,{size:15})}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:e.name}),(0,y.jsxs)(`small`,{children:[e.serviceName,` · `,e.description]})]}),(0,y.jsx)(w,{tone:e.risk===`high`||e.risk===`高风险`?`red`:e.risk===`medium`||e.risk===`中风险`?`amber`:`green`,children:E(e.risk,p)}),(0,y.jsx)(h,{checked:!!e.enabled,disabled:j||!e.serviceEnabled,"aria-label":p(`workflows:previewPages.toggleToolName`,{name:e.name}),onCheckedChange:t=>void H(e,t)})]},e.piName)):(0,y.jsx)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:p(`workflows:previewPages.noToolsAvailable`)})]})]}),(0,y.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,y.jsxs)(x,{children:[(0,y.jsx)(S,{children:p(`workflows:previewPages.currentService`)}),(0,y.jsx)(`h2`,{children:R?.name||p(`workflows:previewPages.noServerConfigured`)}),(0,y.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:R?.error||p(R?`workflows:previewPages.thisServerExposesToolsThroughAStandardMCPTransportEnabledToolsAreRegisteredInNewAgentRuntimes`:`workflows:previewPages.useTheButtonInTheUpperRightToAddAStreamableHTTPOrStdioMCPServer`)}),[[p(`workflows:previewPages.transport`),R?.transport===`stdio`?`stdio`:R?.transport===`sse`?`HTTP + SSE`:`Streamable HTTP`],...R?.transport===`stdio`?[[p(`workflows:previewPages.executable`),R.command||`—`],[p(`workflows:previewPages.workingDirectory`),R.workingDirectory||`—`]]:[[p(`workflows:previewPages.serverAddress`),R?.endpoint||`—`]],[p(`workflows:previewPages.latency`),R?.latencyMs==null?`—`:`${R.latencyMs} ms`],[p(`workflows:previewPages.lastPing`),R?.lastPingAt?l(R.lastPingAt,m):`—`],[p(`workflows:previewPages.authentication`),D(R,p)]].map(e=>(0,y.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,y.jsx)(`span`,{children:e[0]}),(0,y.jsx)(`strong`,{title:e[1],children:e[1]})]},e[0])),(0,y.jsxs)(`div`,{className:`toggle-line [&_>_span]:flex [&_>_span]:items-center [&_>_span]:gap-[7px] [&_>_span]:text-[12px] flex min-h-[34px] items-center justify-between [border-top:1px_solid_var(--stroke-soft)]`,children:[(0,y.jsx)(`span`,{children:p(`workflows:previewPages.serverEnabled`)}),(0,y.jsx)(h,{checked:!!R?.enabled,disabled:!R||j,"aria-label":p(`workflows:previewPages.toggleMCPServer`),onCheckedChange:e=>void U(e)})]}),(0,y.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[(0,y.jsxs)(r,{size:`sm`,variant:`secondary`,disabled:!R?.enabled||j,onClick:W,children:[(0,y.jsx)(g,{className:j?`animate-spin`:``,"data-icon":`inline-start`}),p(`workflows:previewPages.testConnection`)]}),(0,y.jsxs)(r,{size:`sm`,variant:`destructive`,disabled:!R||j,onClick:G,children:[(0,y.jsx)(s,{"data-icon":`inline-start`}),p(`workflows:previewPages.delete`)]})]})]}),(0,y.jsxs)(x,{className:`mcp-calls-panel [.mcp-layout_&]:flex-1 [.mcp-layout_&]:min-h-0 [.mcp-layout_&]:overflow-y-auto`,children:[(0,y.jsx)(S,{children:p(`workflows:previewPages.recentCalls`)}),B.length?B.slice(0,8).map(e=>(0,y.jsxs)(`div`,{className:`activity-row [&_span]:flex [&_span]:min-w-0 [&_span]:flex-col [&_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_span]:text-[var(--text)] [&.failed]:text-[var(--danger)] [&.running]:text-[var(--star-strong)] grid grid-cols-[auto_minmax(0,1fr)] items-center gap-[9px] [border-top:1px_solid_var(--stroke-soft)] [padding:9px_2px] text-[var(--success)]`,children:[(0,y.jsx)(o,{size:14}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:e.toolName}),(0,y.jsxs)(`small`,{children:[l(e.timestamp,m),` ·`,` `,e.status===`ok`?`OK`:e.error||`Error`,` ·`,` `,e.durationMs,` ms`]})]})]},e.id)):(0,y.jsx)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:p(`workflows:previewPages.noRecentCalls`)})]})]})]})})}export{O as McpPage};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./button-CDkfouZn.js";import{t as i}from"./use-i18n-CvBZ-cLZ.js";import{t as a}from"./AppSelect-BdgnJD0G.js";import{t as o}from"./WorkspacePicker-zV4rtq8i.js";import{t as s}from"./message-circle-BW-CPcmG.js";import{t as c}from"./play-CRwfAjca.js";import{t as l}from"./trash-2-CsljwZ9-.js";import{At as u,Dt as d,I as f,R as p,bt as m,ft as h,i as g,jt as _,l as v,mt as y,n as b,o as x,r as S,s as C,t as w,wt as T,yt as E}from"./index-BWR8EHvN.js";import{t as D}from"./field-u9evjKvg.js";import{t as O}from"./StarOrbit-BlI6MhVr.js";import{t as k}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{n as A,t as j}from"./pick-system-directory-BnIFt85A.js";var M=e(t(),1),N=n(),P={browser:{name:`通知`,Icon:_},feishu:{name:`飞书`,Icon:u},weixin:{name:`微信`,Icon:s}},F={interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},ee={minutes:`分钟`,hours:`小时`,days:`天`},te=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],I=[`full-access`,`read-only`];function L(e,t){return t(e===`full-access`?`schedules:schedulesPage.fullAccessHelp`:`schedules:schedulesPage.readOnlyHelp`)}function ne(e,t){return t(e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function re(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function ie(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:`schedules:schedulesPage.browserNotification`)}function R({value:e,onChange:t}){let{t:n}=i();return(0,N.jsxs)(D,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,N.jsx)(a,{value:e,onChange:e=>t(e.target.value),children:I.map(e=>(0,N.jsx)(`option`,{value:e,children:n(e===`full-access`?`schedules:schedulesPage.fullAccess`:`schedules:schedulesPage.readOnly`)},e))}),(0,N.jsx)(`small`,{children:L(e,n)})]})}function z(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function B(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function V({targetType:e,prompt:t,workflowId:n,workflowInputs:r,workflows:o,onChange:s}){let{t:c}=i(),l=o.find(e=>e.id===n);return(0,N.jsxs)(`div`,{className:`grid gap-[10px]`,children:[(0,N.jsxs)(D,{variant:`control`,children:[c(`schedules:schedulesPage.executionTarget`),(0,N.jsxs)(a,{value:e,onChange:e=>{let t=e.target.value,i=o[0];s(t===`workflow`?{targetType:t,workflowId:n||i?.id||``,workflowInputs:n?r:z(i)}:{targetType:t})},children:[(0,N.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,N.jsx)(`option`,{value:`workflow`,children:c(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,N.jsxs)(D,{variant:`control`,children:[`Prompt`,(0,N.jsx)(`textarea`,{value:t,onChange:e=>s({prompt:e.target.value}),placeholder:c(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(D,{variant:`control`,children:[c(`schedules:schedulesPage.workflow`),(0,N.jsxs)(a,{value:n,onChange:e=>{let t=o.find(t=>t.id===e.target.value);s({workflowId:e.target.value,workflowInputs:z(t)})},children:[(0,N.jsx)(`option`,{value:``,children:c(`schedules:schedulesPage.selectPublishedWorkflow`)}),o.map(e=>(0,N.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,N.jsx)(`small`,{children:l?.description||(o.length?c(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):c(`schedules:schedulesPage.noPublishedWorkflows`))})]}),l?.inputs.length?(0,N.jsxs)(`div`,{className:`grid gap-[8px]`,children:[(0,N.jsxs)(`div`,{className:`schedule-workflow-inputs-heading [&_strong]:text-[12px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] [&_small]:text-right max-[650px]:items-start max-[650px]:flex-col max-[650px]:gap-[2px] max-[650px]:[&_small]:text-left flex [align-items:baseline] justify-between gap-[12px]`,children:[(0,N.jsx)(`strong`,{children:c(`schedules:schedulesPage.workflowInputs`)}),(0,N.jsx)(`small`,{children:c(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,N.jsx)(`div`,{className:`schedule-workflow-inputs [&_input[type='checkbox']]:w-[16px] [&_input[type='checkbox']]:h-[16px] [&_input[type='checkbox']]:[justify-self:end] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px]`,children:l.inputs.map(e=>(0,N.jsxs)(D,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,N.jsx)(`input`,{type:`checkbox`,checked:!!r[e.name],onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.checked}})}):(0,N.jsx)(`input`,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(r[e.name]??``),onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.value}})}),e.description&&(0,N.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function H({value:e,onChange:t}){let{t:n}=i(),[a,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(!1),u=async()=>{if(s(``),!j()){l(!0);return}try{let n=await A(e);n&&t(n)}catch(e){s(e instanceof Error?e.message:String(e))}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(D,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,N.jsxs)(`span`,{className:`schedule-workspace-input [&_input]:min-w-0 [&_input]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] grid grid-cols-[minmax(0,1fr)_auto] gap-[6px]`,children:[(0,N.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,N.jsxs)(r,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>void u(),children:[(0,N.jsx)(T,{size:13}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,N.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),a&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{size:13}),a]}),(0,N.jsx)(o,{open:c,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:l,onSelect:e=>t(e)})]})}function U(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function W(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function G({notify:e,registerPrimaryAction:t,openNotificationSettings:n,requestConfirm:o}){let{t:s,language:u}=i(),[m,h]=(0,M.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1}},workflows:[],defaultCwd:``}),[_,T]=(0,M.useState)(``),[A,j]=(0,M.useState)(null),[I,L]=(0,M.useState)(!0),[z,G]=(0,M.useState)(!1),[J,Y]=(0,M.useState)(``),[ae,oe]=(0,M.useState)(!1);k(t,()=>oe(!0));let X=(0,M.useCallback)(async()=>{try{let e=await p(`/api/schedules`);h(e),T(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id||``)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{L(!1)}},[]);(0,M.useEffect)(()=>{X()},[X]),(0,M.useEffect)(()=>{let e=window.setInterval(X,m.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[m.tasks,X]);let Z=m.tasks.find(e=>e.id===_),Q=m.workflows||[];(0,M.useEffect)(()=>{j(e=>Z?e?.id===Z.id?e:U(Z):null)},[Z]);let se=(0,M.useMemo)(()=>m.runs.filter(e=>e.taskId===_).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[m.runs,_]),$=e=>j(t=>t&&{...t,...e}),ce=e=>{A&&$({notifications:A.notifications.includes(e)?A.notifications.filter(t=>t!==e):[...A.notifications,e]})};return I?(0,N.jsxs)(S,{children:[(0,N.jsx)(E,{className:`animate-spin`,size:23}),(0,N.jsx)(`h2`,{children:s(`schedules:schedulesPage.loadingScheduledTasks`)})]}):(0,N.jsxs)(N.Fragment,{children:[J&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{size:13}),J]}),(0,N.jsxs)(`div`,{className:`split-list-detail grid min-h-[100%] grid-cols-[330px_minmax(0,1fr)] gap-[12px] max-[900px]:grid-cols-[1fr] schedule-layout !grid-cols-[310px_minmax(0,1fr)] max-[900px]:[.split-list-detail&]:grid-cols-[280px_minmax(420px,1fr)] max-[900px]:[.split-list-detail&]:overflow-x-auto max-[650px]:[.split-list-detail&]:grid-cols-[1fr] max-[650px]:[.split-list-detail&]:[overflow-x:visible]`,children:[(0,N.jsxs)(w,{className:`selection-list [.config-layout_>_&]:max-h-[calc(100dvh_-_280px)] [.config-layout_>_&]:overflow-y-auto max-[900px]:max-h-[300px] min-h-0 overflow-auto`,children:[(0,N.jsx)(x,{title:s(`schedules:schedulesPage.taskQueue`)}),m.tasks.length?m.tasks.map(e=>(0,N.jsx)(`div`,{className:`schedule-list-item hover:bg-[var(--accent-soft)] [&.active]:bg-[var(--accent-soft)] [&_>_button]:grid [&_>_button]:min-w-0 [&_>_button]:min-h-[68px] [&_>_button]:grid-cols-[minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[8px] [&_>_button]:border-0 [&_>_button]:bg-transparent [&_>_button]:p-[6px_2px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[5px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_em]:flex [&_em]:items-center [&_em]:gap-[4px] [&_em]:text-[var(--text-muted)] [&_em]:text-[13px] [&_em]:[font-style:normal] grid grid-cols-[minmax(0,1fr)_auto] items-center gap-[5px] [border-top:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] [padding:3px_5px] ${_===e.id?`active`:``}`,children:(0,N.jsxs)(`button`,{onClick:()=>T(e.id),children:[(0,N.jsxs)(`span`,{children:[(0,N.jsxs)(`div`,{className:`schedule-item-head [.schedule-list-item_&]:flex [.schedule-list-item_&]:min-w-0 [.schedule-list-item_&]:items-center [.schedule-list-item_&]:gap-[6px] [.schedule-list-item_&_strong]:flex-1 [.schedule-list-item_&_strong]:min-w-0`,children:[(0,N.jsx)(`strong`,{children:e.name}),(0,N.jsx)(v,{tone:e.enabled?`green`:`gray`,children:e.enabled?s(`schedules:schedulesPage.enabled`):s(`schedules:schedulesPage.pause`)})]}),(0,N.jsx)(`small`,{children:e.targetType===`workflow`?Q.find(t=>t.id===e.workflowId)?.name||s(`schedules:schedulesPage.workflowUnavailable`):e.prompt})]}),(0,N.jsx)(`em`,{children:W(e,u)})]})},e.id)):(0,N.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center`,children:[(0,N.jsx)(O,{size:38}),(0,N.jsx)(`strong`,{children:s(`schedules:schedulesPage.theTimelineIsStillUnlit`)}),(0,N.jsx)(`span`,{children:s(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})]})]}),Z&&A?(0,N.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,N.jsxs)(w,{children:[(0,N.jsxs)(b,{children:[(0,N.jsx)(`h2`,{children:A.name}),(0,N.jsxs)(`div`,{className:`flex items-center gap-[6px] gap-[5px]`,children:[(0,N.jsx)(C,{value:A.enabled,onChange:e=>$({enabled:e})}),(0,N.jsxs)(r,{size:`lg`,disabled:z||Z.lastStatus===`running`,onClick:async()=>{if(Z){G(!0),Y(``);try{await p(`/api/schedules/${encodeURIComponent(Z.id)}/run`,{method:`POST`,body:`{}`}),await X(),e(s(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){Y(e instanceof Error?e.message:String(e))}finally{G(!1)}}},children:[Z.lastStatus===`running`?(0,N.jsx)(E,{className:`animate-spin`,size:14}):(0,N.jsx)(c,{size:14}),Z.lastStatus===`running`?s(`schedules:schedulesPage.running`):s(`schedules:schedulesPage.runNow`)]}),(0,N.jsx)(r,{variant:`destructive`,size:`icon`,title:s(`schedules:schedulesPage.deleteTask`),onClick:async()=>{if(Z&&await o({title:s(`schedules:schedulesPage.deleteScheduledTask`),message:s(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:Z.name}),confirmLabel:s(`schedules:schedulesPage.delete`)}))try{await p(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`DELETE`}),await X(),e(s(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){Y(e instanceof Error?e.message:String(e))}},children:(0,N.jsx)(l,{size:14})})]})]}),(0,N.jsx)(V,{targetType:A.targetType,prompt:A.prompt,workflowId:A.workflowId,workflowInputs:A.workflowInputs,workflows:Q,onChange:$}),A.targetType===`prompt`&&(0,N.jsx)(H,{value:A.cwd,onChange:e=>$({cwd:e})}),(0,N.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.frequency`),(0,N.jsx)(a,{value:A.frequency,onChange:e=>$({frequency:e.target.value}),children:Object.keys(F).map(e=>(0,N.jsx)(`option`,{value:e,children:ne(e,s)},e))})]}),A.frequency===`interval`?(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.runInterval`),(0,N.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,N.jsx)(`input`,{type:`number`,min:`1`,value:A.intervalValue,onChange:e=>$({intervalValue:Number(e.target.value)})}),(0,N.jsx)(a,{value:A.intervalUnit,onChange:e=>$({intervalUnit:e.target.value}),children:Object.keys(ee).map(e=>(0,N.jsx)(`option`,{value:e,children:re(e,s)},e))})]})]}):(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.time`),(0,N.jsx)(`input`,{type:`time`,value:A.time,onChange:e=>$({time:e.target.value})})]}),(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.timeZone`),(0,N.jsx)(a,{value:A.timezone,onChange:e=>$({timezone:e.target.value}),children:te.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))})]}),A.targetType===`prompt`&&(0,N.jsx)(R,{value:A.executionMode,onChange:e=>$({executionMode:e})})]}),(0,N.jsxs)(`div`,{className:`schedule-notification-section [&_>_div:first-child]:flex [&_>_div:first-child]:items-center [&_>_div:first-child]:justify-between [&_>_div:first-child]:gap-[8px] [&_>_div:first-child_strong]:text-[13px] [&_>_p]:mt-[4px] [&_>_p]:text-[var(--text-muted)] [&_>_p]:text-[13px] [margin-top:13px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:12px]`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:s(`schedules:schedulesPage.notificationChannels`)}),(0,N.jsx)(`button`,{type:`button`,className:`text-button hover:text-[var(--text)] border-0 bg-transparent text-[var(--text-soft)] text-[12px] font-[600] [text-decoration:underline] [text-underline-offset:2px]`,onClick:n,children:s(`schedules:schedulesPage.editTemplates`)})]}),(0,N.jsx)(`p`,{children:s(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,N.jsx)(`div`,{className:`schedule-notification-targets [&_>_button]:grid [&_>_button]:min-h-[52px] [&_>_button]:grid-cols-[auto_minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[7px] [&_>_button]:[border:1px_solid_var(--stroke)] [&_>_button]:rounded-[var(--r-sm)] [&_>_button]:bg-[var(--surface-subtle)] [&_>_button]:p-[7px_8px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_button_>_svg:last-child]:text-[var(--control-muted)] [&_>_button.selected]:border-[var(--focus)] [&_>_button.selected]:bg-[var(--accent-soft)] [&_>_button.selected]:text-[var(--star-strong)] [&_>_button.selected_>_svg:last-child]:text-[var(--success)] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(3,minmax(0,1fr))] gap-[7px] [margin-top:9px]`,children:Object.entries(P).map(([e,t])=>{let n=t.Icon,r=A.notifications.includes(e);return(0,N.jsxs)(`button`,{type:`button`,className:r?`selected`:``,onClick:()=>ce(e),children:[(0,N.jsx)(n,{size:15}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`strong`,{children:ie(e,s)}),(0,N.jsx)(`small`,{children:m.notificationTargets[e].enabled?s(`schedules:schedulesPage.configured`):s(`schedules:schedulesPage.notConfigured`)})]}),(0,N.jsx)(d,{size:15})]},e)})}),(0,N.jsx)(`div`,{className:`flex items-center gap-[6px] [margin-top:9px]`,children:(0,N.jsx)(`button`,{type:`button`,className:`schedule-notification-chip [&.selected]:border-[var(--control-selected-border)] [&.selected]:bg-[var(--control-selected-bg)] [&.selected]:text-[var(--control-selected-text)] [&.selected]:shadow-[var(--sh-1)] dark:bg-[var(--surface-subtle)] inline-flex h-[32px] items-center gap-[4px] [border:1px_solid_var(--stroke)] rounded-[var(--r-pill)] bg-[var(--surface-subtle)] text-[var(--text-muted)] [padding:0_10px] text-[13px] font-[600] ${A.notifyOn===`failure`?`selected`:``}`,onClick:()=>$({notifyOn:A.notifyOn===`failure`?`always`:`failure`}),children:A.notifyOn===`failure`?s(`schedules:schedulesPage.failuresOnly`):s(`schedules:schedulesPage.completionAndFailure`)})})]}),(0,N.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,N.jsx)(`span`,{children:Z.lastRunAt?s(`schedules:schedulesPage.lastRunTime`,{time:f(Z.lastRunAt,u)}):s(`schedules:schedulesPage.nextRunTime`,{time:W(Z,u)})}),(0,N.jsxs)(r,{size:`lg`,disabled:z||!B(A.targetType,A.prompt,A.workflowId,A.workflowInputs,Q),onClick:async()=>{if(!(!Z||!A)){G(!0),Y(``);try{let t=await p(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`PATCH`,body:JSON.stringify(A)});h(t.state),j(U(t.task)),e(s(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){Y(e instanceof Error?e.message:String(e))}finally{G(!1)}}},children:[z?(0,N.jsx)(E,{className:`animate-spin`,size:14}):null,s(z?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,N.jsxs)(w,{children:[(0,N.jsx)(x,{title:s(`schedules:schedulesPage.recentRuns`)}),se.length?se.map(e=>(0,N.jsxs)(`div`,{className:`schedule-run-row [&_>_svg]:text-[var(--text-muted)] [&.completed_>_svg]:text-[var(--success)] [&.failed_>_svg]:text-[var(--danger)] [&.running_>_svg]:text-[var(--star-strong)] [&_>_span]:flex [&_>_span]:min-w-0 [&_>_span]:flex-col [&_>_span]:gap-[4px] [&_strong]:[display:-webkit-box] [&_strong]:overflow-hidden [&_strong]:text-[12px] [&_strong]:leading-[1.4] [&_strong]:[-webkit-box-orient:vertical] [&_strong]:[-webkit-line-clamp:2] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_a]:text-[var(--text-soft)] [&_a]:text-[13px] [&_a]:[text-decoration:underline] [&_a]:[text-underline-offset:2px] [&_>_em]:text-[var(--text-muted)] [&_>_em]:text-[12px] [&_>_em]:[font-style:normal] [&_>_em]:whitespace-nowrap grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] [border-top:1px_solid_var(--stroke-soft)] [padding:10px_2px] ${e.status}`,children:[e.status===`running`?(0,N.jsx)(E,{className:`animate-spin`,size:15}):e.status===`completed`?(0,N.jsx)(d,{size:15}):(0,N.jsx)(y,{size:15}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`strong`,{children:e.status===`running`?s(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||s(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?s(`schedules:schedulesPage.taskInterrupted`):e.error||s(`schedules:schedulesPage.taskFailed`)}),(0,N.jsxs)(`small`,{children:[f(e.startedAt,u),` ·`,` `,e.trigger===`manual`?s(`schedules:schedulesPage.manualRun`):s(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${s(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,N.jsx)(`em`,{children:new Intl.DateTimeFormat(u,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id)):(0,N.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:[(0,N.jsx)(O,{size:32}),(0,N.jsx)(`strong`,{children:s(`schedules:schedulesPage.noRunHistory`)})]})]})]}):(0,N.jsx)(K,{notificationTargets:m.notificationTargets,workflows:Q,defaultCwd:m.defaultCwd,onCreated:t=>{h(t.state),T(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))}})]}),ae&&(0,N.jsx)(q,{notificationTargets:m.notificationTargets,workflows:Q,defaultCwd:m.defaultCwd,onClose:()=>oe(!1),onCreated:t=>{oe(!1),h(t.state),T(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))}})]})}function K({notificationTargets:e,workflows:t,defaultCwd:n,onCreated:o}){let{t:s}=i(),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(`prompt`),[f,h]=(0,M.useState)(``),[_,v]=(0,M.useState)(``),[x,S]=(0,M.useState)({}),[C,T]=(0,M.useState)(n||``),[O,k]=(0,M.useState)(`daily`),[A,j]=(0,M.useState)(`09:00`),[P,I]=(0,M.useState)(`Asia/Hong_Kong`),[L,ie]=(0,M.useState)(1),[z,U]=(0,M.useState)(`hours`),[W,G]=(0,M.useState)(`full-access`),[K,q]=(0,M.useState)(!1),[J,Y]=(0,M.useState)(``);return(0,N.jsxs)(w,{children:[(0,N.jsx)(b,{children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{children:s(`schedules:schedulesPage.newScheduledTask`)}),(0,N.jsx)(`p`,{children:s(`schedules:schedulesPage.youCanContinueEditingTheRunTimeAndNotificationChannelsAfterCreation`)})]})}),(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.taskName`),(0,N.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:s(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,N.jsx)(V,{targetType:u,prompt:f,workflowId:_,workflowInputs:x,workflows:t,onChange:e=>{e.targetType&&d(e.targetType),e.prompt!==void 0&&h(e.prompt),e.workflowId!==void 0&&v(e.workflowId),e.workflowInputs!==void 0&&S(e.workflowInputs)}}),u===`prompt`&&(0,N.jsx)(H,{value:C,onChange:T}),(0,N.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.frequency`),(0,N.jsx)(a,{value:O,onChange:e=>k(e.target.value),children:Object.keys(F).map(e=>(0,N.jsx)(`option`,{value:e,children:ne(e,s)},e))})]}),O===`interval`?(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.runInterval`),(0,N.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,N.jsx)(`input`,{type:`number`,min:`1`,value:L,onChange:e=>ie(Number(e.target.value))}),(0,N.jsx)(a,{value:z,onChange:e=>U(e.target.value),children:Object.keys(ee).map(e=>(0,N.jsx)(`option`,{value:e,children:re(e,s)},e))})]})]}):(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.time`),(0,N.jsx)(`input`,{type:`time`,value:A,onChange:e=>j(e.target.value)})]}),(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.timeZone`),(0,N.jsx)(a,{value:P,onChange:e=>I(e.target.value),children:te.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))})]}),u===`prompt`&&(0,N.jsx)(R,{value:W,onChange:G})]}),J&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{size:13}),J]}),(0,N.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,N.jsx)(`span`,{children:s(`schedules:schedulesPage.enabledAutomaticallyAfterCreation`)}),(0,N.jsxs)(r,{size:`lg`,disabled:K||!c.trim()||!B(u,f,_,x,t),onClick:async()=>{q(!0),Y(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await p(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:f,workflowId:_,workflowInputs:x,cwd:C,enabled:!0,frequency:O,time:A,timezone:P,intervalValue:L,intervalUnit:z,executionMode:W,notifications:t,notifyOn:`always`})}))}catch(e){Y(e instanceof Error?e.message:String(e))}finally{q(!1)}},children:[K?(0,N.jsx)(E,{className:`animate-spin`,size:14}):(0,N.jsx)(m,{size:14}),s(K?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})}function q({notificationTargets:e,workflows:t,defaultCwd:n,onClose:a,onCreated:o}){let{t:s}=i(),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(`prompt`),[f,_]=(0,M.useState)(``),[v,x]=(0,M.useState)(``),[S,C]=(0,M.useState)({}),[w,T]=(0,M.useState)(n||``),[O,k]=(0,M.useState)(`full-access`),[A,j]=(0,M.useState)(!1),[P,F]=(0,M.useState)(``);return(0,N.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>e.target===e.currentTarget&&a(),children:(0,N.jsxs)(`form`,{className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async t=>{t.preventDefault(),j(!0),F(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await p(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:f,workflowId:v,workflowInputs:S,cwd:w,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:O,notifications:t,notifyOn:`always`})}))}catch(e){F(e instanceof Error?e.message:String(e))}finally{j(!1)}},children:[(0,N.jsxs)(b,{children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{children:s(`schedules:schedulesPage.newScheduledTask`)}),(0,N.jsx)(`p`,{children:s(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,N.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s(`schedules:schedulesPage.closeDialog`),onClick:a,children:(0,N.jsx)(h,{size:17})})]}),(0,N.jsxs)(D,{variant:`control`,children:[s(`schedules:schedulesPage.taskName`),(0,N.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:s(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,N.jsx)(V,{targetType:u,prompt:f,workflowId:v,workflowInputs:S,workflows:t,onChange:e=>{e.targetType&&d(e.targetType),e.prompt!==void 0&&_(e.prompt),e.workflowId!==void 0&&x(e.workflowId),e.workflowInputs!==void 0&&C(e.workflowInputs)}}),u===`prompt`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(H,{value:w,onChange:T}),(0,N.jsx)(R,{value:O,onChange:k})]}),P&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{size:13}),P]}),(0,N.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,N.jsx)(r,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:a,children:s(`schedules:schedulesPage.cancel`)}),(0,N.jsxs)(r,{size:`lg`,disabled:A||!c.trim()||!B(u,f,v,S,t),children:[A?(0,N.jsx)(E,{className:`animate-spin`,size:14}):(0,N.jsx)(m,{size:14}),s(A?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})}export{G as SchedulesPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./vendor-react-CHuvPdJE.js";import{t}from"./utils-C8uzG5AZ.js";/* empty css */var n=e();function r({className:e,children:r,...i}){return(0,n.jsx)(`span`,{className:t(`rb-shiny-text`,e),...i,children:r})}export{r as ShinyText};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{n as r,t as i}from"./button-CDkfouZn.js";import{t as a}from"./use-i18n-CvBZ-cLZ.js";import{t as o}from"./file-code-corner-Dqjb0Cug.js";import{t as s}from"./image-DfmT5l79.js";import{t as c}from"./save-DAkFWHyI.js";import{t as l}from"./trash-2-CsljwZ9-.js";import{t as u}from"./wrench-BIgib2eu.js";import{R as d,c as f,ht as p,l as m,n as h,o as g,r as _,s as v,t as y,yt as b}from"./index-BWR8EHvN.js";import{t as x}from"./usePagePrimaryAction-Bw0OFTDZ.js";var S=r(`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`}]]),C=e(t(),1),w=n(),T=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`];function E(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function D(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function O(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?s:/doc|pdf|文档|说明/.test(t)?o:/install|package|market|安装|包/.test(t)?S:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?u:p}function k(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function A({notify:e,query:t=``,activeSessionId:n=``,registerPrimaryAction:r,requestText:o,requestConfirm:s}){let{t:u}=a(),[p,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(`all`),[F,I]=(0,C.useState)(!1),[L,R]=(0,C.useState)(!0),[,z]=(0,C.useState)(``),B=(0,C.useCallback)(async()=>{z(``);try{let e=await d(E(`/api/skills`,n));return A(e),M(t=>e.skills.some(e=>e.id===t)?t:e.skills[0]?.id||``),e}catch(e){return z(e instanceof Error?e.message:String(e)),null}finally{R(!1)}},[n]);(0,C.useEffect)(()=>{B()},[B]);let V=(0,C.useCallback)(async()=>{let t=await o?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:u(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:u(`skills:skillsPage.continue`)});if(t?.trim()&&await s?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:u(`skills:skillsPage.import`),tone:`danger`})!==!1){I(!0),z(``);try{let r=await d(E(`/api/skills/install`,n),{method:`POST`,body:JSON.stringify({source:t})});A(r),M(r.installed?.[0]?.id||r.skills[0]?.id||``),e(u(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},[n,e,s,o,u]);if(x(r,V),L&&!p)return(0,w.jsx)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:(0,w.jsxs)(_,{children:[(0,w.jsx)(b,{className:`animate-spin`,size:23}),(0,w.jsx)(`h2`,{children:u(`skills:skillsPage.loadingSkills`)}),(0,w.jsx)(`p`,{children:u(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)})]})});let H=p?.skills||[],U=H.filter(e=>k(e,N)&&`${e.name} ${e.description}`.toLowerCase().includes(t.toLowerCase())),W=H.filter(e=>e.sourceInfo?.scope!==`project`),G=H.filter(e=>e.sourceInfo?.scope===`project`),K=U.filter(e=>e.sourceInfo?.scope!==`project`),q=U.filter(e=>e.sourceInfo?.scope===`project`),J=H.find(e=>e.id===j)||U[0]||H[0]||null,Y=(p?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?u(`skills:skillsPage.projectScopedConfiguration`):u(`skills:skillsPage.userScopedConfiguration`),status:e.installed?u(`skills:skillsPage.locallyReady`):u(`skills:skillsPage.notMaterialized`),tone:e.installed?`green`:`gray`})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(t.toLowerCase())),X=async(e,t)=>{if(e){I(!0),z(``);try{let r=await d(E(`/api/skills/${encodeURIComponent(e.id)}`,n),{method:`PATCH`,body:JSON.stringify(t)});A(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===r.id?r:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}}},Z=async()=>{I(!0),z(``);try{A(await d(E(`/api/skills/reload`,n),{method:`POST`,body:`{}`})),e(u(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}},Q=async()=>{if(J?.removable&&await s?.({title:u(`skills:skillsPage.uninstallSkill`),message:u(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:u(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){I(!0),z(``);try{await d(E(`/api/skills/${encodeURIComponent(J.id)}`,n),{method:`DELETE`});let t=await B();M(t?.skills[0]?.id||``),e(u(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},$=(e,t,n,r,i=``)=>(0,w.jsxs)(`section`,{className:`skill-scope [.skill-scope_+_&]:[border-top:1px_solid_var(--stroke)] [.skill-scope_+_&]:pt-[14px]`,children:[(0,w.jsxs)(`div`,{className:`skill-scope-head [&_>_div]:min-w-0 [&_small]:block [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_small]:text-[11px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_span]:min-w-[24px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[12px] [&_>_span]:font-[600] [&_>_span]:text-right flex min-w-0 items-start justify-between gap-[10px]`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(g,{title:e}),i&&(0,w.jsx)(`small`,{title:i,children:i})]}),(0,w.jsx)(`span`,{children:t.length})]}),t.length?t.map(e=>{let t=O(e);return(0,w.jsxs)(`div`,{className:`skill-row grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] border-0 [border-top:1px_solid_var(--stroke-soft)] bg-transparent p-[10px_8px] text-left hover:rounded-[var(--r-sm)] hover:bg-[var(--accent-soft)] [&.selected]:rounded-[var(--r-sm)] [&.selected]:bg-[var(--accent-soft)] [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] grid-cols-[minmax(0,1fr)_auto] [padding-block:4px] ${J?.id===e.id?`selected`:``}`,children:[(0,w.jsxs)(`button`,{className:`skill-row-main [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:min-w-0 [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent [padding:6px_4px] text-left`,onClick:()=>M(e.id),children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(t,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`small`,{className:`line-clamp-2`,title:e.description,children:e.description})]})]}),(0,w.jsx)(v,{value:e.enabled,disabled:F,ariaLabel:u(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void X(e,{enabled:t})})]},e.id)}):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:n.length?u(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})]});return(0,w.jsxs)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:[(0,w.jsx)(f,{options:T.map(e=>D(e,u)),value:D(N,u),onChange:e=>P(T.find(t=>D(t,u)===e)||`all`)}),(0,w.jsxs)(`div`,{className:`skills-layout max-[1150px]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:grid-cols-[1fr] grid min-h-0 flex-1 grid-cols-[minmax(240px,.85fr)_minmax(290px,1.05fr)_minmax(280px,1fr)] gap-[12px]`,children:[(0,w.jsxs)(y,{className:`flex flex-col gap-[16px]`,children:[N!==`project`&&$(u(`skills:skillsPage.globalSkills`),K,W,u(`skills:skillsPage.noGlobalSkills`),p?.locations?.global||`~/.pisper/agent/skills`),N!==`global`&&$(u(`skills:skillsPage.projectSkills`),q,G,u(`skills:skillsPage.noProjectSkills`),p?.locations?.project||(p?.cwd?`${p.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``))]}),(0,w.jsxs)(y,{children:[(0,w.jsxs)(h,{children:[(0,w.jsx)(g,{title:u(`skills:skillsPage.configuredSkillPackages`)}),(0,w.jsx)(`span`,{className:`text-[var(--text-muted)] text-[12px] font-[600]`,children:u(`skills:skillsPage.countSkillPackages`,{count:Y.length})})]}),Y.length?Y.map(e=>(0,w.jsxs)(`div`,{className:`market-row [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap grid min-h-[48px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[8px] [border-top:1px_solid_var(--stroke-soft)] [padding:6px_2px]`,children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(S,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{title:e.source,children:e.source}),(0,w.jsx)(`small`,{children:e.description})]}),(0,w.jsx)(m,{tone:e.tone,children:e.status})]},e.source)):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:u(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})]}),(0,w.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,w.jsxs)(y,{children:[(0,w.jsx)(g,{title:u(`skills:skillsPage.selectedSkill`)}),(0,w.jsx)(`h2`,{children:J?.name||u(`skills:skillsPage.noSkillAvailable`)}),(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:J?.description||u(`skills:skillsPage.addGlobalOrProjectSkill`)}),[[u(`skills:skillsPage.triggerMode`),J?.modelInvocationEnabled?u(`skills:skillsPage.automaticManual`):u(`skills:skillsPage.manualOnly`)],[u(`skills:skillsPage.permissions`),J?.allowedTools?.length?J.allowedTools.join(`, `):u(`skills:skillsPage.usesChatToolPermissions`)],[u(`skills:skillsPage.scope`),J?.sourceInfo?.scope===`project`?u(`skills:skillsPage.project`):u(`skills:skillsPage.global`)],[u(`skills:skillsPage.version`),J?.version||`latest`],[u(`skills:skillsPage.source`),J?.source||`—`]].map(e=>(0,w.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,w.jsx)(`span`,{children:e[0]}),(0,w.jsx)(`strong`,{children:e[1]})]},e[0])),(0,w.jsxs)(i,{variant:J?.removable?`destructive`:`default`,size:`lg`,className:`w-full`,disabled:F,onClick:J?.removable?Q:Z,children:[J?.removable?(0,w.jsx)(l,{size:14}):(0,w.jsx)(c,{size:14}),J?.removable?u(`skills:skillsPage.uninstallSkill`):u(`skills:skillsPage.saveSettings`)]})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(g,{title:u(`skills:skillsPage.triggerConditions`)}),[[u(`skills:skillsPage.allowAutomaticModelInvocation`),!!J?.modelInvocationEnabled,!1,e=>void X(J,{modelInvocationEnabled:e})],[u(`skills:skillsPage.supportManualSkillCommand`),!!J?.command,!0],[u(`skills:skillsPage.projectScopedSkill`),J?.sourceInfo?.scope===`project`,!0],[u(`skills:skillsPage.declaresRequiredTools`),!!J?.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,w.jsxs)(`label`,{className:`check-row [&_input]:[accent-color:var(--star-strong)] flex items-center gap-[7px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_2px] text-[12px]`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!J||F||n,onChange:e=>r?.(e.target.checked)}),(0,w.jsx)(`span`,{children:e})]},e))]})]})]})]})}export{A as SkillsPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./vendor-react-CHuvPdJE.js";var t=e();function n({size:e=54,className:n=``}){return(0,t.jsxs)(`svg`,{className:`star-orbit ${n}`,width:e,height:e,viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`,children:[(0,t.jsx)(`circle`,{cx:`32`,cy:`32`,r:`23`,stroke:`var(--stroke)`,strokeWidth:`1.4`,strokeDasharray:`2.5 4.5`,strokeLinecap:`round`}),(0,t.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`28`,ry:`10.5`,stroke:`var(--stroke)`,strokeWidth:`1`,transform:`rotate(-18 32 32)`,opacity:`.65`}),(0,t.jsx)(`circle`,{cx:`32`,cy:`32`,r:`3.2`,fill:`var(--control-muted)`}),(0,t.jsx)(`circle`,{cx:`53`,cy:`27`,r:`1.7`,fill:`var(--star)`,opacity:`.8`}),(0,t.jsx)(`circle`,{cx:`12`,cy:`45`,r:`1.3`,fill:`var(--text-muted)`,opacity:`.7`}),(0,t.jsx)(`path`,{d:`M45 4 Q45.8 7.7 49.5 8.5 Q45.8 9.3 45 13 Q44.2 9.3 40.5 8.5 Q44.2 7.7 45 4 Z`,fill:`var(--star)`})]})}export{n as t};