pisper 0.5.21-linux-x64.0 → 0.5.21
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.
- package/README.en.md +53 -0
- package/README.md +46 -46
- package/bin/pisper.mjs +48 -0
- package/lib/install.mjs +392 -0
- package/lib/npm-platform.mjs +41 -0
- package/lib/npm-update.mjs +165 -0
- package/lib/platform.mjs +43 -0
- package/lib/postinstall.mjs +3 -0
- package/package.json +36 -14
- package/updater.pubkey +1 -0
- package/web/.vite/manifest.json +2249 -0
- package/web/assets/AnimatedContent-BiVNqD3m.js +1 -0
- package/web/assets/AnimatedList-CJTx-B8I.js +1 -0
- package/web/assets/AppOverlays-C_v-1VL6.js +1 -0
- package/web/assets/AppSelect-g6etLk2g.js +1 -0
- package/web/assets/AssetsPage-Dt5ST6Ej.js +1 -0
- package/web/assets/ChannelsPage-C9dO2yLN.js +1 -0
- package/web/assets/ChatHistoryPage-ZvSTAtXB.js +1 -0
- package/web/assets/ChatPage-BD3WkozH.js +9 -0
- package/web/assets/ClickSpark-BhxL8WOQ.js +1 -0
- package/web/assets/ConfigPage-ifZdPO01.js +1 -0
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/MarkdownMessage-CMr3WuAI.js +1 -0
- package/web/assets/MemoryPage-D5Hjoc5p.js +1 -0
- package/web/assets/PageHeader-BKfO_vPe.js +1 -0
- package/web/assets/PluginsPage-DhkVJf05.js +1 -0
- package/web/assets/PreviewPages-mRjRmA0i.js +1 -0
- package/web/assets/SchedulesPage-DNe-Y6o5.js +1 -0
- package/web/assets/ShinyText-fuaKxKqJ.js +1 -0
- package/web/assets/SkillsPage-PguSYt8I.js +1 -0
- package/web/assets/StarOrbit-BlI6MhVr.js +1 -0
- package/web/assets/TerminalPanel-BrP-ENHg.css +1 -0
- package/web/assets/TerminalPanel-DrnfpA8m.js +18 -0
- package/web/assets/Threads-DskDSsK6.js +1 -0
- package/web/assets/WelcomeEffects-Bf8Z6qHU.js +1 -0
- package/web/assets/WorkflowsPage-C6sGl2oG.js +1 -0
- package/web/assets/WorkspacePicker-Cu2Z5jid.js +1 -0
- package/web/assets/alert-B7D8joCd.js +1 -0
- package/web/assets/alert-dialog-D5F_JQyX.js +1 -0
- package/web/assets/andromeeda-vGVdxbeo.js +1 -0
- package/web/assets/angular-html-17rlCfBS.js +1 -0
- package/web/assets/angular-ts-it3MaXWH.js +1 -0
- package/web/assets/astro-BEVDzCov.js +1 -0
- package/web/assets/aurora-x-CDeNXAV0.js +1 -0
- package/web/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/web/assets/ayu-light-C3h-C4tm.js +1 -0
- package/web/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/web/assets/blade-B3yUZIOx.js +1 -0
- package/web/assets/brand-CFOXmGdd.js +1 -0
- package/web/assets/button-DzlQCSNK.js +1 -0
- package/web/assets/c-aGSZMVdM.js +1 -0
- package/web/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
- package/web/assets/catppuccin-latte-CtsyrtPq.js +1 -0
- package/web/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
- package/web/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
- package/web/assets/chevron-down-DXmj1gMQ.js +1 -0
- package/web/assets/circle-dot-CbGG7s_7.js +1 -0
- package/web/assets/coffee-ouOQ86EC.js +1 -0
- package/web/assets/copy-DO0sQBgx.js +1 -0
- package/web/assets/cpp-Bm3vm43L.js +1 -0
- package/web/assets/css-CWcS1xXm.js +1 -0
- package/web/assets/csv-Dx-8-gkx.js +1 -0
- package/web/assets/dark-plus-Cs2F2srj.js +1 -0
- package/web/assets/dist-BaCXUSxG.js +1 -0
- package/web/assets/dist-Bv5OI2pf.js +1 -0
- package/web/assets/dracula-BHWKrbxM.js +1 -0
- package/web/assets/dracula-soft-5eyTD99u.js +1 -0
- package/web/assets/earth-D-KiHvdO.js +1 -0
- package/web/assets/es2015-CfKlxLgF.js +41 -0
- package/web/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/web/assets/everforest-light-Df2xbC6M.js +1 -0
- package/web/assets/field-CCo2X7MX.js +1 -0
- package/web/assets/file-B6GksU4A.js +1 -0
- package/web/assets/file-code-corner-3gopYCm4.js +1 -0
- package/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/web/assets/github-dark-C-LZuMrd.js +1 -0
- package/web/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/web/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/web/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/web/assets/github-light-EUqPIrTm.js +1 -0
- package/web/assets/github-light-default-BXViO-2h.js +1 -0
- package/web/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/web/assets/glsl-TOBAB6bO.js +1 -0
- package/web/assets/graphql-BEmIBNve.js +1 -0
- package/web/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/web/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/web/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/web/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/web/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/web/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/web/assets/haml-CDWtFtU9.js +1 -0
- package/web/assets/handlebars-BNtjo3pL.js +1 -0
- package/web/assets/horizon-CE9ld1lL.js +1 -0
- package/web/assets/horizon-bright-DSNQnXHK.js +1 -0
- package/web/assets/houston-CsvMBhTu.js +1 -0
- package/web/assets/html-BVyvp26C.js +1 -0
- package/web/assets/html-derivative-BseLpURQ.js +1 -0
- package/web/assets/http-CkCfSMV9.js +1 -0
- package/web/assets/hurl-syYMt6Rn.js +1 -0
- package/web/assets/image-Bu_a9jz0.js +1 -0
- package/web/assets/imba-DsUTQ-LC.js +1 -0
- package/web/assets/index-BIQcwjFR.js +41 -0
- package/web/assets/index-Btu6aNk7.css +2 -0
- package/web/assets/java-duG_UTKe.js +1 -0
- package/web/assets/javascript-DWVbOe4X.js +1 -0
- package/web/assets/jinja-Boj4niAz.js +1 -0
- package/web/assets/jison-CHwnC1Pv.js +1 -0
- package/web/assets/json-qhed-kSA.js +1 -0
- package/web/assets/json5-BR5RXkoi.js +1 -0
- package/web/assets/jsonc-CYpm1nAK.js +1 -0
- package/web/assets/jsonl-CmCQp5Yx.js +1 -0
- package/web/assets/jsx-fcCEM_-L.js +1 -0
- package/web/assets/julia-VoF7UKfw.js +1 -0
- package/web/assets/kanagawa-dragon-Bozd7klA.js +1 -0
- package/web/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
- package/web/assets/kanagawa-wave-BML5mF2J.js +1 -0
- package/web/assets/laserwave-C_8bwKvT.js +1 -0
- package/web/assets/less-DVTAwKKz.js +1 -0
- package/web/assets/light-plus-DVQuIRkW.js +1 -0
- package/web/assets/link-2-SOWAopyR.js +1 -0
- package/web/assets/loader-circle-i0WYlBWu.js +1 -0
- package/web/assets/markdown-BYOwaDjH.js +1 -0
- package/web/assets/marko-Cupn1xhw.js +1 -0
- package/web/assets/material-theme-Bm3Qr25_.js +1 -0
- package/web/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/web/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/web/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/web/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/web/assets/mdc-4FfK5iWR.js +1 -0
- package/web/assets/mdx-DQZ5AkYe.js +1 -0
- package/web/assets/message-circle-C3tSGsW0.js +1 -0
- package/web/assets/min-dark-BSWPekZh.js +1 -0
- package/web/assets/min-light-DDpmG2fV.js +1 -0
- package/web/assets/monokai-B_bV9PQ9.js +1 -0
- package/web/assets/network-zt1ahOiz.js +1 -0
- package/web/assets/night-owl-DhmEMT88.js +1 -0
- package/web/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/web/assets/nord-Cb4Vim4T.js +1 -0
- package/web/assets/one-dark-pro-CLwyXe_n.js +1 -0
- package/web/assets/one-light-D7Lr4KcI.js +1 -0
- package/web/assets/panel-top-DYcS-wiY.js +1 -0
- package/web/assets/paperclip-t0nP1kBQ.js +1 -0
- package/web/assets/pencil-BOb7CieI.js +1 -0
- package/web/assets/php-CUREQQ7f.js +1 -0
- package/web/assets/pick-system-directory-BnIFt85A.js +1 -0
- package/web/assets/plastic-DQwYfKfQ.js +1 -0
- package/web/assets/play-V5zloi0R.js +1 -0
- package/web/assets/poimandres-DRFjx7u4.js +1 -0
- package/web/assets/postcss-BXeXVLqQ.js +1 -0
- package/web/assets/progress-DWkHIRCG.js +6 -0
- package/web/assets/pug-CQyGKZpv.js +1 -0
- package/web/assets/python-gzcpVVnB.js +1 -0
- package/web/assets/r-C5FwQflr.js +1 -0
- package/web/assets/react-bits-DQli9s7O.css +1 -0
- package/web/assets/red-DX1BQOs8.js +1 -0
- package/web/assets/regexp--aR2_iz7.js +1 -0
- package/web/assets/rolldown-runtime-B0Z9INg1.js +1 -0
- package/web/assets/rose-pine-aMsaMD1D.js +1 -0
- package/web/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
- package/web/assets/rose-pine-moon-DO-qXg-I.js +1 -0
- package/web/assets/sass-DXrisJhu.js +1 -0
- package/web/assets/save-CTsP04bb.js +1 -0
- package/web/assets/scss-Davl4E3T.js +1 -0
- package/web/assets/search-Chj7BjSz.js +1 -0
- package/web/assets/shellscript-CLZ0U2zV.js +1 -0
- package/web/assets/shield-check-By9gGYwr.js +1 -0
- package/web/assets/slack-dark-DnToyrRv.js +1 -0
- package/web/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/web/assets/smithy-Dgaz7aur.js +1 -0
- package/web/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/web/assets/solarized-dark-UdsmMDCL.js +1 -0
- package/web/assets/solarized-light-C1IUL_tW.js +1 -0
- package/web/assets/sql-b92rrcVl.js +1 -0
- package/web/assets/square-DQQwOv3-.js +1 -0
- package/web/assets/square-terminal-ByK0g_OZ.js +1 -0
- package/web/assets/stylus-B6D30XZt.js +1 -0
- package/web/assets/sun-CiCuEpCg.js +1 -0
- package/web/assets/svelte-BfstjgUc.js +1 -0
- package/web/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/web/assets/tag-B0fT5ThM.js +1 -0
- package/web/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/web/assets/trash-2-2GzVxk5J.js +1 -0
- package/web/assets/ts-tags-Cckpt1jI.js +1 -0
- package/web/assets/tsx-JMDX3aQ7.js +1 -0
- package/web/assets/typescript-BAz-bF8J.js +1 -0
- package/web/assets/use-i18n-DmLwOjO5.js +1 -0
- package/web/assets/usePagePrimaryAction-Bw0OFTDZ.js +1 -0
- package/web/assets/utils-C8uzG5AZ.js +1 -0
- package/web/assets/vendor-dockview-D5adAaCg.css +1 -0
- package/web/assets/vendor-dockview-yY5mBM3U.js +1 -0
- package/web/assets/vendor-markdown-CWK5AVhB.js +130 -0
- package/web/assets/vendor-markdown-plugins-DCl4I7Pz.js +263 -0
- package/web/assets/vendor-motion-XxgxfZSY.js +9 -0
- package/web/assets/vendor-react-CHuvPdJE.js +9 -0
- package/web/assets/vendor-router-Bw2aAdMs.js +4 -0
- package/web/assets/vendor-shiki-runtime-CxE5QolQ.js +153 -0
- package/web/assets/vendor-state-DE1O_s6m.js +1 -0
- package/web/assets/vendor-ui-DvrYggeS.js +1 -0
- package/web/assets/vendor-xyflow-CnjXtcyK.js +7 -0
- package/web/assets/vendor-xyflow-DLioOiRN.css +1 -0
- package/web/assets/vesper-DdrHHSXu.js +1 -0
- package/web/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/web/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/web/assets/vitesse-light-VbXTXTou.js +1 -0
- package/web/assets/vue-3H7P6ncC.js +1 -0
- package/web/assets/vue-html-DZGW9MGR.js +1 -0
- package/web/assets/vue-vine-BECt67gq.js +1 -0
- package/web/assets/wasm-BnjxR4X6.js +1 -0
- package/web/assets/wasm-ByWQv1Qj.js +1 -0
- package/web/assets/wgsl-BsKzXJz4.js +1 -0
- package/web/assets/wit-DdvCle-K.js +1 -0
- package/web/assets/wrench-DkHcVlxK.js +1 -0
- package/web/assets/xml-CNfvW5JP.js +1 -0
- package/web/assets/yaml-rwi0_p6S.js +1 -0
- package/web/assets/zap-CRNpJWAy.js +1 -0
- package/web/favicon.svg +25 -0
- package/web/icons.svg +24 -0
- package/web/index.html +72 -0
- package/web/memory-galaxy-background.webp +0 -0
- package/web/mobile-startup.html +316 -0
- package/web/notification-sw.js +13 -0
- package/web/tauri-pet.css +117 -0
- package/web/tauri-pet.html +16 -0
- package/web/tauri-pet.js +117 -0
- package/components/runtime/Pisper_Runtime_Node_0.5.20_linux_x86_64.tar.gz +0 -0
- package/components/runtime/Pisper_Runtime_Node_0.5.20_linux_x86_64.tar.gz.sig +0 -1
- package/components/tui/Pisper_TUI_Component_0.5.12_linux_x86_64.tar.gz +0 -0
- package/components/tui/Pisper_TUI_Component_0.5.12_linux_x86_64.tar.gz.sig +0 -1
|
@@ -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-DzlQCSNK.js";import{t as a}from"./use-i18n-DmLwOjO5.js";import{n as o,t as s}from"./AppSelect-g6etLk2g.js";import{t as c}from"./file-code-corner-3gopYCm4.js";import{t as l}from"./loader-circle-i0WYlBWu.js";import{t as u}from"./pencil-BOb7CieI.js";import{t as d}from"./trash-2-2GzVxk5J.js";import{Dt as f,G as p,Rt as m,bt as h,i as g,kt as _,n as v,o as y,t as b}from"./index-BIQcwjFR.js";import{t as x}from"./field-CCo2X7MX.js";import{t as ee}from"./StarOrbit-BlI6MhVr.js";import{t as te}from"./usePagePrimaryAction-Bw0OFTDZ.js";var ne=r(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),re=r(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),S=e(t(),1),C=n(),w={width:600,height:420,cx:300,cy:206},T=24,ie=Math.PI*(3-Math.sqrt(5)),ae=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`];function E(e,t){return t(e===`file`?`memory:memoryPage.fileType`:e===`risk`?`memory:memoryPage.riskType`:e===`preference`?`memory:memoryPage.preferenceType`:e===`decision`?`memory:memoryPage.decisionType`:e===`fact`?`memory:memoryPage.factType`:e===`task`?`memory:memoryPage.taskType`:`memory:memoryPage.conceptType`)}var D={concept:`var(--g-concept)`,file:`var(--g-file)`,risk:`var(--g-risk)`,preference:`var(--g-preference)`,decision:`var(--g-decision)`,fact:`var(--g-fact)`,task:`var(--g-task)`},oe={concept:`var(--g-concept-glow)`,file:`var(--g-file-glow)`,risk:`var(--g-risk-glow)`,preference:`var(--g-preference-glow)`,decision:`var(--g-decision-glow)`,fact:`var(--g-fact-glow)`,task:`var(--g-task-glow)`};function O(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function se(e,t){let n=e.slice(0,T);if(!n.length)return[];if(n.length===1)return[{node:n[0],x:w.cx,y:w.cy,twinkle:0}];let r=O(t||`galaxy`)%628/100,i=172/Math.sqrt(n.length);return n.map((e,t)=>{let n=O(e.id),a=t*ie+r,o=i*Math.sqrt(t+.55)+n%11-5;return{node:e,x:w.cx+Math.cos(a)*o*1.38,y:w.cy+Math.sin(a)*o*.74,twinkle:n%50/10}})}function k(e,t=`zh-CN`){if(!e)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n)}function A(e,t=e=>e){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function ce(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=Math.min(24,a*.16)*(n%2==0?1:-1),s=(e.x+t.x)/2-i/a*o,c=(e.y+t.y)/2+r/a*o;return`M ${e.x.toFixed(1)} ${e.y.toFixed(1)} Q ${s.toFixed(1)} ${c.toFixed(1)} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}function j(e){return e instanceof Error?e.message:String(e)}function M({notify:e,query:t=``,registerPrimaryAction:n,requestConfirm:r}){let{t:s,language:x}=a(),[T,ie]=(0,S.useState)({spaces:[],nodes:[],links:[],candidates:[],selectedSpaceId:``}),[M,N]=(0,S.useState)(``),[P,F]=(0,S.useState)(``),[de,fe]=(0,S.useState)(!0),[pe,I]=(0,S.useState)(``),[me,he]=(0,S.useState)(1),[L,R]=(0,S.useState)(null),[z,B]=(0,S.useState)(null),[ge,_e]=(0,S.useState)(``),[V,H]=(0,S.useState)(``),[U,W]=(0,S.useState)(null),[G,ve]=(0,S.useState)(!1),K=(0,S.useRef)(null),q=(0,S.useRef)(0);te(n,()=>R({spaceId:M||T.selectedSpaceId}));let ye=e=>{let t=K.current;if(!t)return;let n=t.getBoundingClientRect(),r=((e.clientX-n.left)/n.width-.5)*2,i=((e.clientY-n.top)/n.height-.5)*2;cancelAnimationFrame(q.current),q.current=requestAnimationFrame(()=>{t.style.setProperty(`--px`,r.toFixed(3)),t.style.setProperty(`--py`,i.toFixed(3))})},be=()=>{cancelAnimationFrame(q.current),K.current?.style.setProperty(`--px`,`0`),K.current?.style.setProperty(`--py`,`0`)},J=(0,S.useCallback)(async(e=``)=>{fe(!0),I(``);try{let n=new URLSearchParams;e&&n.set(`spaceId`,e),t.trim()&&n.set(`query`,t.trim());let r=await p(`/api/memory?${n}`);ie(r),N(r.selectedSpaceId||``),F(e=>r.nodes.some(t=>t.id===e)?e:r.nodes[0]?.id||``)}catch(e){I(j(e))}finally{fe(!1)}},[t]);(0,S.useEffect)(()=>{J(M)},[J,M]),(0,S.useEffect)(()=>{let e=!0;return p(`/api/settings/memory`).then(t=>e&&W(t.autoApproveConfidence)).catch(()=>e&&W(60)),()=>{e=!1}},[]);let xe=async()=>{let t=U;if(t===null||G)return;let n=Math.min(100,Math.max(0,Math.round(t)));n!==t&&W(n),ve(!0);try{await p(`/api/settings/memory`,{method:`PATCH`,body:{autoApproveConfidence:n}}),e(s(`memory:memoryPage.autoApproveSaved`))}catch(e){I(j(e))}finally{ve(!1)}},Y=T.nodes.find(e=>e.id===P)||null,X=(0,S.useMemo)(()=>se(T.nodes,M),[T.nodes,M]),Z=(0,S.useMemo)(()=>new Map(X.map(e=>[e.node.id,e])),[X]),Se=(0,S.useMemo)(()=>{let e=new Set(X.map(e=>e.node.id));return T.links.filter(t=>e.has(t.sourceId)&&e.has(t.targetId))},[X,T.links]),Ce=new Set(T.links.flatMap(e=>e.sourceId===P?[e.targetId]:e.targetId===P?[e.sourceId]:[])),Q=ge||P,we=new Set(T.links.flatMap(e=>e.sourceId===Q?[e.targetId]:e.targetId===Q?[e.sourceId]:[])),Te=T.nodes.filter(e=>e.type===`file`&&(Ce.has(e.id)||e.id===P)),$=T.spaces.find(e=>e.id===M),Ee=async t=>{if(await r({title:s(`memory:memoryPage.deleteMemory`),message:s(`memory:memoryPage.deleteMemoryName`,{name:t.title}),confirmLabel:s(`memory:memoryPage.delete`)}))try{await p(`/api/memory/nodes/${encodeURIComponent(t.id)}`,{method:`DELETE`}),e(s(`memory:memoryPage.memoryDeleted`)),await J(M)}catch(e){I(j(e))}},De=async(t,n)=>{if(!V){H(t.id),I(``);try{await p(`/api/memory/candidates/${encodeURIComponent(t.id)}/${n}`,{method:`POST`,body:`{}`}),e(s(n===`accept`?`memory:memoryPage.memoryCandidateConfirmed`:`memory:memoryPage.memoryCandidateIgnored`)),await J(M)}catch(e){I(j(e))}finally{H(``)}}};return(0,C.jsxs)(`div`,{className:`memory-layout max-[1150px]:grid-cols-[220px_minmax(340px,1fr)] max-[650px]:grid-cols-[1fr] grid min-h-[100%] grid-cols-[230px_minmax(360px,1fr)_290px] gap-[12px]`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[12px]`,children:[(0,C.jsxs)(b,{className:`wiki-panel [&_>_button]:grid [&_>_button]:w-full [&_>_button]:grid-cols-[minmax(0,1fr)_auto_auto] [&_>_button]:items-center [&_>_button]:gap-[6px] [&_>_button]:border-0 [&_>_button]:[border-top:1px_solid_var(--stroke-soft)] [&_>_button]:bg-transparent [&_>_button]:p-[9px_5px] [&_>_button]:text-left [&_>_button]:text-[12px] [&_>_button.active]:rounded-[var(--r-xs)] [&_>_button.active]:bg-[var(--accent-soft)] [&_>_button_small]:text-[var(--text-muted)] [&_>_button_small]:text-[13px]`,children:[(0,C.jsxs)(v,{children:[(0,C.jsx)(y,{title:s(`memory:memoryPage.memorySpaces`)}),(0,C.jsx)(i,{variant:`ghost`,size:`icon`,title:s(`memory:memoryPage.newMemorySpace`),onClick:()=>B({}),children:(0,C.jsx)(_,{size:13})})]}),T.spaces.map(e=>(0,C.jsxs)(`button`,{className:e.id===M?`active`:``,onClick:()=>{N(e.id),F(``)},children:[(0,C.jsx)(`span`,{children:A(e,s)}),(0,C.jsx)(`small`,{children:s(`memory:memoryPage.countMemories`,{count:e.nodeCount})}),(0,C.jsx)(m,{size:13})]},e.id)),$&&(0,C.jsxs)(`div`,{className:`memory-space-actions [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] [&_button.danger]:text-[var(--danger)] flex gap-[6px] [margin-top:10px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:9px]`,children:[(0,C.jsxs)(`button`,{onClick:()=>B($),children:[(0,C.jsx)(u,{size:12}),s(`memory:memoryPage.rename`)]}),$.kind!==`global`&&(0,C.jsxs)(`button`,{className:`danger`,onClick:async()=>{if($&&await r({title:s(`memory:memoryPage.deleteMemorySpace`),message:s(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:A($,s)}),confirmLabel:s(`memory:memoryPage.delete`)}))try{await p(`/api/memory/spaces/${encodeURIComponent($.id)}`,{method:`DELETE`}),N(``),F(``),e(s(`memory:memoryPage.memorySpaceDeleted`))}catch(e){I(j(e))}},children:[(0,C.jsx)(d,{size:12}),s(`memory:memoryPage.delete`)]})]})]}),(0,C.jsxs)(b,{className:`memory-legend-panel`,children:[(0,C.jsx)(y,{title:s(`memory:memoryPage.memoryMapTypes`)}),(0,C.jsx)(`div`,{className:`galaxy-legend [&_span]:flex [&_span]:items-center [&_span]:gap-[7px] [&_span]:text-[var(--text-soft)] [&_span]:text-[12px] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px_10px] [margin-top:11px]`,children:ae.map(e=>(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${e}`}),E(e,s)]},e))})]}),(0,C.jsxs)(b,{className:`min-h-0`,children:[(0,C.jsxs)(v,{children:[(0,C.jsx)(y,{title:`${s(`memory:memoryPage.memoryDrafts`)} · ${T.candidates?.length||0}`}),!!T.candidates?.length&&(0,C.jsxs)(i,{variant:`outline`,className:`bg-surface-subtle`,disabled:!!V,onClick:async()=>{if(!(V||!T.candidates?.length)){H(`__all__`),I(``);try{let t=await p(`/api/memory/candidates/reject-all`,{method:`POST`,body:`{}`});e(s(`memory:memoryPage.ignoredCountMemoryDrafts`,{count:t.rejected||0})),await J(M)}catch(e){I(j(e))}finally{H(``)}}},children:[(0,C.jsx)(h,{size:12}),s(`memory:memoryPage.ignoreAll`)]})]}),U!==null&&(0,C.jsxs)(`div`,{className:`memory-auto-approve-row [&_label]:flex [&_label]:min-w-0 [&_label]:flex-col [&_label]:gap-[2px] [&_label_span]:text-[12px] [&_label_span]:font-[600] [&_label_small]:text-[var(--text-muted)] [&_label_small]:text-[10px] [&_label_small]:leading-[1.4] flex items-center justify-between gap-[10px] [border-bottom:1px_solid_var(--stroke-soft)] [padding:8px_0_10px]`,children:[(0,C.jsxs)(`label`,{children:[(0,C.jsx)(`span`,{children:s(`memory:memoryPage.autoApproveThreshold`)}),(0,C.jsx)(`small`,{children:s(`memory:memoryPage.autoApproveThresholdHint`)})]}),(0,C.jsxs)(`span`,{className:`memory-auto-approve-input [&_input]:w-[64px] [&_input]:[border:1px_solid_var(--stroke-soft)] [&_input]:rounded-[6px] [&_input]:bg-[var(--surface-muted)] [&_input]:p-[4px_6px] [&_input]:text-[var(--text)] [&_input]:text-[12px] [&_input]:text-right [&_em]:text-[var(--text-muted)] [&_em]:text-[11px] [&_em]:[font-style:normal] flex flex-none items-center gap-[5px]`,children:[(0,C.jsx)(`input`,{type:`number`,min:0,max:100,step:5,value:U,disabled:G,"aria-label":s(`memory:memoryPage.autoApproveThreshold`),onChange:e=>W(e.target.value?Number(e.target.value):0),onBlur:()=>void xe(),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),xe())}}),(0,C.jsx)(`em`,{children:`%`}),G&&(0,C.jsx)(l,{className:`animate-spin`,size:12})]})]}),(0,C.jsxs)(`div`,{className:`flex max-h-[300px] flex-col gap-[8px] overflow-auto`,children:[(T.candidates||[]).map(e=>(0,C.jsxs)(`div`,{className:`memory-candidate [&_>_strong]:text-[12px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[11px] [&_>_span]:leading-[1.45] [&_>_small]:text-[var(--text-muted)] [&_>_small]:text-[11px] [&_>_small]:leading-[1.45] [&_>_div]:flex [&_>_div]:gap-[6px] [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:[border:1px_solid_var(--stroke-soft)] [&_button]:rounded-[6px] [&_button]:bg-transparent [&_button]:p-[4px_7px] [&_button]:text-[var(--text)] [&_button]:text-[11px] [&_button.danger]:text-[var(--danger)] flex flex-col gap-[5px] [border:1px_solid_var(--stroke-soft)] rounded-[8px] bg-[var(--surface-muted)] [padding:8px]`,children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsxs)(`small`,{children:[A(T.spaces.find(t=>t.id===e.spaceId),s),` · `,e.sourceType===`agent`?s(`memory:memoryPage.agentProposed`):s(`memory:memoryPage.conversationExtracted`),` · `,s(`memory:memoryPage.confidencePercent`,{value:Math.round((e.confidence||0)*100)})]}),(0,C.jsx)(`span`,{children:e.content}),e.topicKey&&(0,C.jsxs)(`small`,{children:[s(`memory:memoryPage.topic`),`:`,e.topicKey]}),e.evidence&&(0,C.jsxs)(`small`,{children:[s(`memory:memoryPage.evidence`),`:`,e.evidence]}),(0,C.jsxs)(`small`,{children:[s(`memory:memoryPage.created`),`:`,k(e.createdAt,x),e.expiresAt?` · ${s(`memory:memoryPage.expires`)}:${k(e.expiresAt,x)}`:``]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`button`,{disabled:!!V,title:s(`memory:memoryPage.confirm`),onClick:()=>De(e,`accept`),children:[(0,C.jsx)(o,{size:12}),s(`memory:memoryPage.confirm`)]}),(0,C.jsxs)(`button`,{disabled:!!V,className:`danger`,title:s(`memory:memoryPage.ignore`),onClick:()=>De(e,`reject`),children:[(0,C.jsx)(h,{size:12}),s(`memory:memoryPage.ignore`)]})]})]},e.id)),!T.candidates?.length&&(0,C.jsx)(`small`,{children:s(`memory:memoryPage.thereAreNoPendingMemoryCandidates`)})]})]})]}),(0,C.jsxs)(b,{className:`graph-panel before:[content:''] before:absolute before:z-[0] before:inset-0 before:pointer-events-none before:bg-[url('/memory-galaxy-background.webp')] before:[background-position:center_48%] before:[background-size:cover] before:bg-no-repeat before:[filter:saturate(.62)_contrast(1.08)] before:[mix-blend-mode:screen] before:opacity-[.42] after:[content:''] after:absolute after:z-[0] after:inset-0 after:pointer-events-none after:[background-image:radial-gradient(var(--galaxy-dot)_.9px,transparent_1.2px),_radial-gradient(var(--galaxy-dot-dim)_.8px,transparent_1.2px),_radial-gradient(var(--galaxy-dot)_1.2px,transparent_1.6px)] after:[background-position:0_0,_37px_53px,_71px_19px] after:[background-size:96px_96px,_152px_152px,_236px_236px] after:[animation:galaxy-field-twinkle_6.4s_ease-in-out_infinite] after:opacity-[.7] before:inset-[-8%] before:[animation:galaxy-background-drift_34s_ease-in-out_infinite_alternate] before:[will-change:transform] after:[animation:galaxy-field-drift_15s_ease-in-out_infinite_alternate] after:[will-change:background-position,opacity] max-[650px]:min-h-[430px] relative min-h-[500px] overflow-hidden [border-color:var(--galaxy-border)] bg-[var(--galaxy-bg)]! [background-image:radial-gradient(ellipse_46%_40%_at_50%_48%,_var(--galaxy-core),_transparent_72%),_radial-gradient(ellipse_62%_48%_at_16%_6%,_var(--galaxy-nebula-a),_transparent_70%),_radial-gradient(ellipse_56%_52%_at_88%_98%,_var(--galaxy-nebula-b),_transparent_72%)] p-0 backdrop-blur-none! galaxy-panel`,onPointerMove:ye,onPointerLeave:be,children:[(0,C.jsxs)(`div`,{className:`graph-toolbar [&_button]:grid [&_button]:w-[32px] [&_button]:h-[32px] [&_button]:place-items-center [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[12px] [.galaxy-panel_&]:border-[var(--galaxy-toolbar-border)] [.galaxy-panel_&]:bg-[var(--galaxy-toolbar-bg)] [.galaxy-panel_&]:text-[var(--galaxy-toolbar-text)] [.galaxy-panel_&]:[backdrop-filter:blur(9px)] [.galaxy-panel_&_button:hover]:bg-[var(--galaxy-toolbar-hover)] dark:bg-[var(--solid)] dark:text-[var(--text)] absolute z-[4] [top:10px] [left:10px] flex gap-[3px] [padding:3px] [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--solid)]`,children:[(0,C.jsx)(`button`,{title:s(`memory:memoryPage.addMemory`),onClick:()=>R({spaceId:M}),children:(0,C.jsx)(_,{size:14})}),(0,C.jsx)(`button`,{title:s(`memory:memoryPage.zoomIn`),onClick:()=>he(e=>Math.min(1.6,Number((e+.15).toFixed(2)))),children:(0,C.jsx)(re,{size:13})}),(0,C.jsx)(`button`,{title:s(`memory:memoryPage.zoomOut`),onClick:()=>he(e=>Math.max(.7,Number((e-.15).toFixed(2)))),children:(0,C.jsx)(ne,{size:13})}),(0,C.jsx)(`button`,{title:s(`memory:memoryPage.refresh`),onClick:()=>J(M),children:(0,C.jsx)(f,{className:de?`animate-spin`:``,size:13})})]}),(0,C.jsxs)(`div`,{className:`galaxy-stage [&_>_svg]:absolute [&_>_svg]:inset-0 [&_>_svg]:w-full [&_>_svg]:h-full [&_>_svg]:overflow-visible [&_>_svg]:z-[1] [&_>_svg]:[transform:translate3d(calc(var(--px,0)_*_9px),calc(var(--py,0)_*_6px),0)] [&_>_svg]:[transition:transform_.9s_var(--ease-out)] absolute z-[1] inset-0 [transform-origin:50%_50%] [transition:transform_var(--d2)_var(--ease-out)] ${Q?`has-focus`:``}`,ref:K,style:{transform:`scale(${me})`},children:[(0,C.jsx)(`i`,{className:`galaxy-spiral absolute z-[0] block pointer-events-none [left:9%] [top:13%] w-[82%] h-[74%] rounded-[50%] bg-[conic-gradient(from_-18deg,transparent_0deg,var(--galaxy-nebula-a)_28deg,transparent_68deg,var(--galaxy-nebula-b)_118deg,transparent_170deg,var(--galaxy-nebula-a)_224deg,transparent_278deg,var(--galaxy-nebula-b)_322deg,transparent_360deg)] [filter:blur(13px)] [mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [-webkit-mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [mix-blend-mode:screen] opacity-[.38] [animation:galaxy-spiral-turn_42s_linear_infinite] [will-change:transform]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-core absolute z-[0] block pointer-events-none before:[content:''] before:absolute before:left-[50%] before:top-[50%] before:w-[46px] before:h-[46px] before:rounded-[50%] before:bg-[radial-gradient(circle,rgba(255,255,255,.82),rgba(191,219,254,.3)_55%,transparent_76%)] before:[filter:blur(6px)] before:[transform:translate(-50%,-50%)] [left:50%] [top:49%] w-[34%] h-[40%] rounded-[50%] bg-[radial-gradient(ellipse,rgba(219,232,255,.3)_0%,rgba(126,156,255,.15)_36%,transparent_70%)] [filter:blur(9px)] [mix-blend-mode:screen] [transform:translate(-50%,-50%)] [animation:galaxy-core-breathe_7.5s_ease-in-out_infinite] [will-change:transform,opacity]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [left:8%] [top:20%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-a),transparent_70%)] [animation:galaxy-aurora-drift_18s_ease-in-out_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [right:5%] [bottom:14%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-b),transparent_70%)] [animation:galaxy-aurora-drift_23s_ease-in-out_-9s_infinite_alternate-reverse]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] galaxy-aurora-three left-[30%] top-[60%] !w-[40%] !h-[27%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-c),transparent_70%)] [animation:galaxy-aurora-drift_27s_ease-in-out_-14s_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{viewBox:`0 0 600 420`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,C.jsxs)(`g`,{className:`galaxy-orbits [&_ellipse]:[fill:none] [&_ellipse]:[stroke:var(--galaxy-line)] [&_ellipse]:[stroke-width:.72] [&_ellipse]:[stroke-dasharray:3_7] [&_ellipse]:opacity-[.52] [transform-box:fill-box] [transform-origin:center] [animation:galaxy-orbit-drift_90s_linear_infinite]`,children:[(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`205`,ry:`122`,transform:`rotate(-8 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`154`,ry:`88`,transform:`rotate(18 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`95`,ry:`54`,transform:`rotate(-24 300 206)`})]}),(0,C.jsx)(`defs`,{children:Se.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);return!n||!r?null:(0,C.jsxs)(`linearGradient`,{id:`lg-${t}`,gradientUnits:`userSpaceOnUse`,x1:n.x,y1:n.y,x2:r.x,y2:r.y,children:[(0,C.jsx)(`stop`,{offset:`0`,stopColor:D[n.node.type]||`var(--galaxy-line-active)`}),(0,C.jsx)(`stop`,{offset:`1`,stopColor:D[r.node.type]||`var(--galaxy-line-active)`})]},e.id)})}),Se.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);if(!n||!r)return null;let i=e.sourceId===Q||e.targetId===Q,a=ce(n,r,O(e.id));return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{className:`link-path [.galaxy-stage_>_svg_&]:[fill:none] [.galaxy-stage_>_svg_&]:[stroke-width:1.05] [.galaxy-stage_>_svg_&]:[stroke-dasharray:3_5] [.galaxy-stage_>_svg_&]:opacity-[.5] [.galaxy-stage_>_svg_&]:[animation:galaxy-link-flow_30s_linear_infinite] [.galaxy-stage_>_svg_&]:[transition:opacity_var(--d2)_var(--ease-out)] [.galaxy-stage_>_svg_&.active]:[stroke-width:1.55] [.galaxy-stage_>_svg_&.active]:[stroke-dasharray:none] [.galaxy-stage_>_svg_&.active]:opacity-100 [.galaxy-stage_>_svg_&.active]:[filter:drop-shadow(0_0_3.5px_var(--galaxy-line-active))] [.galaxy-stage.has-focus_&]:opacity-[.14] [.galaxy-stage.has-focus_&.active]:opacity-100 ${i?`active`:``}`,d:a,stroke:`url(#lg-${t})`}),i&&(0,C.jsx)(`circle`,{className:`link-pulse [.galaxy-stage_>_svg_&]:[fill:var(--g-star-core)] [.galaxy-stage_>_svg_&]:[filter:drop-shadow(0_0_4px_var(--galaxy-line-active))] [.galaxy-stage_>_svg_&]:pointer-events-none`,r:`2.1`,children:(0,C.jsx)(`animateMotion`,{dur:`2.8s`,repeatCount:`indefinite`,path:a})})]},e.id)})]}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-two [.galaxy-meteor&]:top-[63%] [.galaxy-meteor&]:left-[89%] [.galaxy-meteor&]:[animation:galaxy-meteor-b_17s_linear_4.5s_infinite]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-three [.galaxy-meteor&]:top-[7%] [.galaxy-meteor&]:left-[36%] [.galaxy-meteor&]:[animation:galaxy-meteor-c_23s_linear_11s_infinite]`,"aria-hidden":`true`}),X.map(({node:e,x:t,y:n,twinkle:r},i)=>(0,C.jsxs)(`button`,{className:`galaxy-star focus-visible:rounded-[50%] focus-visible:[outline-color:var(--galaxy-line-active)] before:[content:''] before:absolute before:w-[calc(var(--star-size)_+_26px)] before:h-[calc(var(--star-size)_+_26px)] before:rounded-[50%] before:bg-[radial-gradient(circle,var(--g-star-glow),transparent_68%)] before:[filter:blur(3px)] before:opacity-[.76] before:pointer-events-none [&.active::after]:[content:''] [&.active::after]:absolute [&.active::after]:w-[calc(var(--star-size)_+_31px)] [&.active::after]:h-[calc(var(--star-size)_+_31px)] [&.active::after]:[border:1px_solid_var(--g-star-glow)] [&.active::after]:rounded-[50%] [&.active::after]:pointer-events-none [&.active::after]:[animation:galaxy-star-selection-pulse_2.3s_var(--ease-out)_infinite] [&:hover::before]:opacity-100 [&.active::before]:opacity-100 absolute z-[2] grid w-[52px] h-[52px] min-w-0 min-h-[52px] place-items-center [transform:translate(-50%,-50%)_translate3d(calc(var(--px,0)_*_(9px_+_var(--depth,0)_*_7px)),calc(var(--py,0)_*_(6px_+_var(--depth,0)_*_5px)),0)] border-0 rounded-[50%] bg-transparent p-0 cursor-pointer [transition:transform_.9s_var(--ease-out),opacity_.45s_var(--ease-out),filter_.45s_var(--ease-out)] [animation:galaxy-star-enter_.72s_var(--ease-out)_var(--enter-delay,0ms)_backwards] ${P===e.id?`active`:``} ${Q&&e.id!==Q&&!we.has(e.id)?`dimmed [.galaxy-stage.has-focus_.galaxy-star&]:opacity-[.32] [.galaxy-stage.has-focus_.galaxy-star&]:[filter:saturate(.4)_brightness(.82)]`:``}`,onClick:()=>F(e.id),onMouseEnter:()=>_e(e.id),onMouseLeave:()=>_e(``),style:{left:`${t/w.width*100}%`,top:`${n/w.height*100}%`,"--star-size":`${12+Math.round((e.importance||.5)*9)}px`,"--twinkle-delay":`${r}s`,"--enter-delay":`${i*55}ms`,"--depth":O(e.id)%100/100,"--g-star-color":D[e.type],"--g-star-glow":oe[e.type]},title:e.content,children:[P===e.id&&(0,C.jsx)(`i`,{className:`orbit-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:[border:1px_solid_var(--galaxy-line-active)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)_rotate(-22deg)_scaleY(.44)] [.galaxy-star_&]:[animation:galaxy-selected-orbit_6s_linear_infinite] [.galaxy-star_&]:opacity-[.8] [.galaxy-star_&::before]:[content:''] [.galaxy-star_&::before]:absolute [.galaxy-star_&::before]:top-[-2.2px] [.galaxy-star_&::before]:left-[50%] [.galaxy-star_&::before]:w-[4.4px] [.galaxy-star_&::before]:h-[4.4px] [.galaxy-star_&::before]:ml-[-2.2px] [.galaxy-star_&::before]:rounded-[50%] [.galaxy-star_&::before]:bg-[var(--g-star-color)] [.galaxy-star_&::before]:shadow-[0_0_6px_1px_var(--g-star-glow)]`,"aria-hidden":`true`}),P===e.id&&(0,C.jsx)(`i`,{className:`dash-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:[border:1px_dashed_var(--g-star-glow)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:opacity-[.9] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)] [.galaxy-star_&]:[animation:galaxy-dash-spin_16s_linear_infinite]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{className:`star-core [.galaxy-star_&]:relative [.galaxy-star_&]:block [.galaxy-star_&]:w-[var(--star-size)] [.galaxy-star_&]:h-[var(--star-size)] [.galaxy-star_&]:[transition:transform_var(--d2)_var(--ease-spring)] [.galaxy-star_&]:[animation:galaxy-star-twinkle_3.8s_ease-in-out_var(--twinkle-delay)_infinite] [.galaxy-star_&]:overflow-visible [.galaxy-star_&]:rounded-[0] [.galaxy-star_&]:bg-transparent [.galaxy-star_&]:shadow-[none] [.galaxy-star_&]:[filter:drop-shadow(0_0_3px_var(--g-star-glow))_drop-shadow(0_0_8px_var(--g-star-glow))] [.galaxy-star_&]:origin-[center] [.galaxy-star:hover_&]:[transform:scale(1.28)] [.galaxy-star.active_&]:[transform:scale(1.32)] [.galaxy-star.active_&]:[animation:galaxy-star-twinkle_2.1s_ease-in-out_var(--twinkle-delay)_infinite]`,viewBox:`0 0 32 32`,"aria-hidden":`true`,children:[(0,C.jsx)(`path`,{className:`star-ray [.galaxy-star_.star-core_&]:[fill:var(--g-star-glow)] [.galaxy-star_.star-core_&]:opacity-[.58] [.galaxy-star_.star-core_&]:[transform-box:fill-box] [.galaxy-star_.star-core_&]:origin-[center] [.galaxy-star_.star-core_&]:[transform:scale(1.45)] [.galaxy-star.active_.star-core_&]:opacity-[.88] [.galaxy-star.active_.star-core_&]:[transform:scale(1.82)]`,d:`M16 0 L19.7 12.3 L32 16 L19.7 19.7 L16 32 L12.3 19.7 L0 16 L12.3 12.3 Z`}),(0,C.jsx)(`path`,{className:`star-shape [.galaxy-star_.star-core_&]:[fill:var(--g-star-color)]`,d:`M16 2 L18.8 13.2 L30 16 L18.8 18.8 L16 30 L13.2 18.8 L2 16 L13.2 13.2 Z`}),(0,C.jsx)(`circle`,{className:`star-heart [.galaxy-star_.star-core_&]:[fill:var(--g-star-core)]`,cx:`16`,cy:`16`,r:`3.2`})]}),(0,C.jsx)(`span`,{className:`star-label [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:opacity-[.3] [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:[transition:opacity_.45s_var(--ease-out)] [.galaxy-star_&]:absolute [.galaxy-star_&]:top-[calc(50%_+_17px)] [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:max-w-[120px] [.galaxy-star_&]:overflow-hidden [.galaxy-star_&]:text-[var(--galaxy-label)] [.galaxy-star_&]:text-[11px] [.galaxy-star_&]:leading-[1.35] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:text-ellipsis [.galaxy-star_&]:[text-shadow:0_1px_7px_var(--galaxy-bg)] [.galaxy-star_&]:[transform:translateX(-50%)] [.galaxy-star_&]:[transition:color_var(--d1)_var(--ease-out)] [.galaxy-star_&]:whitespace-nowrap [.galaxy-star:hover_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:font-[700]`,children:e.title})]},e.id))]}),!!X.length&&(0,C.jsxs)(`span`,{className:`absolute z-[3] [right:12px] [bottom:9px] [border:1px_solid_var(--galaxy-toolbar-border)] rounded-[var(--r-pill)] bg-[rgba(12,11,20,.52)] [padding:3px_10px] text-[var(--galaxy-label)] text-[11px] tracking-[.5px] pointer-events-none [backdrop-filter:blur(6px)]`,children:[`✦`,` `,s(`memory:memoryPage.visibleTotalMemories`,{visible:X.length,total:T.nodes.length})]}),!de&&!X.length&&(0,C.jsxs)(`div`,{className:`memory-empty [.galaxy-panel_&]:text-[var(--galaxy-label)] [.galaxy-panel_&]:[--stroke:var(--galaxy-toolbar-border)] [.galaxy-panel_&]:[--control-muted:var(--galaxy-label)] [.galaxy-panel_&]:[--star:var(--g-decision)] [.galaxy-panel_&]:[--text-muted:var(--galaxy-label)] absolute z-[3] inset-0 grid [align-content:center] justify-items-center gap-[8px] text-[var(--text-muted)] text-[12px] pointer-events-none`,children:[(0,C.jsx)(ee,{size:44}),(0,C.jsx)(`span`,{children:s(`memory:memoryPage.thisMemorySpaceIsStillUnlitClickInTheTopLeftToPlantTheFirstStar`)})]})]}),(0,C.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,C.jsxs)(b,{children:[(0,C.jsx)(y,{title:s(`memory:memoryPage.selectedMemory`)}),Y?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`h2`,{children:Y.title}),(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:Y.content}),(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.memoryType`)}),(0,C.jsxs)(`strong`,{className:`inline-flex items-center gap-[6px]`,children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${Y.type}`}),E(Y.type,s)]})]}),(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.source`)}),(0,C.jsx)(`strong`,{children:Y.sourceType===`conversation_confirmed`?s(`memory:memoryPage.userConfirmedConversationCandidate`):Y.sourceType===`user_confirmed`?s(`memory:memoryPage.explicitUserRequest`):Y.sourceType===`agent`?s(`memory:memoryPage.createdByAgent`):s(`memory:memoryPage.addedManually`)})]}),(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.authority`)}),(0,C.jsxs)(`strong`,{children:[Y.authority??0,`/100`]})]}),Y.evidence&&(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.evidence`)}),(0,C.jsx)(`strong`,{children:Y.evidence})]}),(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.created`)}),(0,C.jsx)(`strong`,{children:k(Y.createdAt,x)})]}),(0,C.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,C.jsx)(`span`,{children:s(`memory:memoryPage.relatedMemories`)}),(0,C.jsx)(`strong`,{children:s(`memory:memoryPage.count`,{count:Ce.size})})]}),(0,C.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[(0,C.jsxs)(i,{size:`lg`,onClick:()=>R(Y),children:[(0,C.jsx)(u,{size:14}),s(`memory:memoryPage.edit`)]}),(0,C.jsxs)(i,{variant:`destructive`,size:`lg`,onClick:()=>Ee(Y),children:[(0,C.jsx)(d,{size:14}),s(`memory:memoryPage.delete`)]})]})]}):(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:s(`memory:memoryPage.selectAMemoryInTheMapToViewItsDetails`)}),pe&&(0,C.jsx)(g,{children:pe})]}),(0,C.jsxs)(b,{children:[(0,C.jsx)(y,{title:s(`memory:memoryPage.relatedFiles`)}),Te.map(e=>(0,C.jsxs)(`div`,{className:`file-row [&_span]:flex [&_span]:min-w-0 [&_span]:flex-col [&_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] grid grid-cols-[auto_minmax(0,1fr)_auto_auto_auto] items-center gap-[6px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_0]`,children:[(0,C.jsx)(c,{size:15}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsx)(`small`,{children:e.sourcePath||e.cwd||s(`memory:memoryPage.localMemory`)})]}),(0,C.jsx)(`button`,{onClick:()=>F(e.id),children:s(`memory:memoryPage.view`)}),(0,C.jsx)(`button`,{onClick:()=>R(e),children:(0,C.jsx)(u,{size:13})}),(0,C.jsx)(`button`,{className:`danger`,onClick:()=>Ee(e),children:(0,C.jsx)(d,{size:13})})]},e.id)),!Te.length&&(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:s(`memory:memoryPage.thisMemoryHasNoRelatedFiles`)})]})]}),L&&(0,C.jsx)(le,{spaces:T.spaces,node:L.id?L:null,initialSpaceId:L.spaceId||M,onClose:()=>R(null),onSaved:async t=>{R(null),e(t),await J(M)}}),z&&(0,C.jsx)(ue,{space:z.id?z:null,onClose:()=>B(null),onSaved:async(t,n)=>{B(null),N(t.id),e(n)}})]})}function le({spaces:e,node:t,initialSpaceId:n,onClose:r,onSaved:o}){let{t:c}=a(),[l,d]=(0,S.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:t?.importance??.5}),[m,_]=(0,S.useState)(!1),[y,b]=(0,S.useState)(``);return(0,C.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&&r(),children:(0,C.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 e=>{e.preventDefault(),_(!0),b(``);try{await p(t?`/api/memory/nodes/${encodeURIComponent(t.id)}`:`/api/memory/nodes`,{method:t?`PATCH`:`POST`,body:JSON.stringify(l)}),await o(c(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){b(j(e))}finally{_(!1)}},children:[(0,C.jsxs)(v,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:c(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`)}),(0,C.jsx)(`p`,{children:c(`memory:memoryPage.lightUpIdeasWorthKeepingAsMemoriesYouCanReturnToLater`)})]}),(0,C.jsx)(i,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":c(`memory:memoryPage.closeDialog`),onClick:r,children:(0,C.jsx)(h,{size:17})})]}),(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.memorySpace`),(0,C.jsx)(s,{value:l.spaceId,onChange:e=>d({...l,spaceId:e.target.value}),children:e.map(e=>(0,C.jsx)(`option`,{value:e.id,children:A(e,c)},e.id))})]}),(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.memoryTitle`),(0,C.jsx)(`input`,{value:l.title,onChange:e=>d({...l,title:e.target.value}),placeholder:c(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.memoryContent`),(0,C.jsx)(`textarea`,{value:l.content,onChange:e=>d({...l,content:e.target.value}),placeholder:c(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,C.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.memoryType`),(0,C.jsx)(s,{value:l.type,onChange:e=>d({...l,type:e.target.value}),children:ae.map(e=>(0,C.jsx)(`option`,{value:e,children:E(e,c)},e))})]}),(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.importance`),(0,C.jsxs)(s,{value:l.importance,onChange:e=>d({...l,importance:Number(e.target.value)}),children:[(0,C.jsx)(`option`,{value:`0.3`,children:c(`memory:memoryPage.normal`)}),(0,C.jsx)(`option`,{value:`0.5`,children:c(`memory:memoryPage.common`)}),(0,C.jsx)(`option`,{value:`0.8`,children:c(`memory:memoryPage.important`)}),(0,C.jsx)(`option`,{value:`1`,children:c(`memory:memoryPage.strict`)})]})]})]}),(0,C.jsxs)(x,{variant:`control`,children:[c(`memory:memoryPage.relatedFilePath`),(0,C.jsx)(`input`,{value:l.sourcePath,onChange:e=>d({...l,sourcePath:e.target.value}),placeholder:c(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),y&&(0,C.jsx)(g,{children:y}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:r,children:c(`memory:memoryPage.cancel`)}),(0,C.jsxs)(i,{size:`lg`,disabled:m||!l.spaceId||!l.title.trim()||!l.content.trim(),children:[m?(0,C.jsx)(f,{className:`animate-spin`,size:14}):(0,C.jsx)(u,{size:14}),c(m?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}function ue({space:e,onClose:t,onSaved:n}){let{t:r}=a(),[o,s]=(0,S.useState)(e?.name||``),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``);return(0,C.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&&t(),children:(0,C.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(),l(!0),d(``);try{await n(await p(e?`/api/memory/spaces/${encodeURIComponent(e.id)}`:`/api/memory/spaces`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:o,kind:`custom`})}),r(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){d(j(e))}finally{l(!1)}},children:[(0,C.jsxs)(v,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:r(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`)}),(0,C.jsx)(`p`,{children:r(`memory:memoryPage.giveEachThemeOrProjectItsOwnMemorySpaceSoDurableMemoriesHaveSomewhereToBelong`)})]}),(0,C.jsx)(i,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":r(`memory:memoryPage.closeDialog`),onClick:t,children:(0,C.jsx)(h,{size:17})})]}),(0,C.jsxs)(x,{variant:`control`,children:[r(`memory:memoryPage.memorySpaceName`),(0,C.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:r(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),u&&(0,C.jsx)(g,{children:u}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:t,children:r(`memory:memoryPage.cancel`)}),(0,C.jsxs)(i,{size:`lg`,disabled:c||!o.trim(),children:[c?(0,C.jsx)(f,{className:`animate-spin`,size:14}):(0,C.jsx)(_,{size:14}),r(c?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}export{M as MemoryPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./vendor-react-CHuvPdJE.js";import{n as t,t as n}from"./button-DzlQCSNK.js";import{t as r}from"./use-i18n-DmLwOjO5.js";import{t as i}from"./utils-C8uzG5AZ.js";import{t as a}from"./link-2-SOWAopyR.js";import{n as o,r as s,t as c}from"./sun-CiCuEpCg.js";import{t as l}from"./play-V5zloi0R.js";import{t as u}from"./save-CTsP04bb.js";import{t as d}from"./search-Chj7BjSz.js";import{t as f}from"./square-terminal-ByK0g_OZ.js";import{t as p}from"./square-DQQwOv3-.js";import{Et as m,R as h,kt as g}from"./index-BIQcwjFR.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`),g],assets:[k(`navigation:pageHeader.addLink`),a],channels:[k(`navigation:pageHeader.connectChannel`),g],schedules:[k(`navigation:pageHeader.newTask`),g],config:[k(`navigation:pageHeader.addProvider`),g],plugins:[k(`navigation:pageHeader.savePolicy`),u],memory:[k(`navigation:pageHeader.addMemory`),g],mcp:[k(`navigation:pageHeader.addService`),g],skills:[k(`navigation:pageHeader.installSkill`),g],workflows:[k(`navigation:pageHeader.newWorkflow`),g],workflowCreate:[k(`navigation:pageHeader.publish`),m]},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-0 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)(h,{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:i(`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`,t===`chat`&&`max-[650px]:hidden`),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-DzlQCSNK.js";import{t as a}from"./use-i18n-DmLwOjO5.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}from"./alert-dialog-D5F_JQyX.js";import{t as h}from"./AppSelect-g6etLk2g.js";import{t as se}from"./chevron-down-DXmj1gMQ.js";import{t as g}from"./earth-D-KiHvdO.js";import{t as _}from"./file-code-corner-3gopYCm4.js";import{t as v}from"./image-Bu_a9jz0.js";import{t as ce}from"./loader-circle-i0WYlBWu.js";import{t as y}from"./search-Chj7BjSz.js";import{t as le}from"./trash-2-2GzVxk5J.js";import{A as b,At as ue,Dt as x,F as S,G as C,I as de,Lt as w,M as fe,N as T,P as E,Pt as D,St as O,Tt as k,c as pe,i as A,j,l as M,r as me,s as he,yt as ge}from"./index-BIQcwjFR.js";import{t as _e}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 ve({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)(b,{open:e,onOpenChange:e=>!u&&t(e),children:(0,L.jsxs)(j,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,L.jsxs)(E,{children:[(0,L.jsxs)(S,{className:`flex items-center gap-2`,children:[(0,L.jsx)(F,{size:17}),r(`plugins:pluginsPage.installLocalPlugin`)]}),(0,L.jsx)(fe,{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)(D,{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)(w,{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)(O,{className:`mt-0.5 shrink-0`,size:15}),(0,L.jsx)(`span`,{children:r(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),f&&(0,L.jsxs)(A,{className:`m-0`,children:[(0,L.jsx)(O,{size:14}),(0,L.jsx)(`span`,{children:f})]})]}),(0,L.jsxs)(T,{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 C(`/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 C(`/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)(w,{size:15}),r(u?`plugins:pluginsPage.processing`:c?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var z=[`all`,`builtin`,`local`],ye={read:o,ls:D,grep:y,find:y,edit:_,write:_,bash:k,web_search:g,browser_automation:g,generate_visual:v};function B(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function be(e,t){return t(e===`read-only`?`plugins:pluginsPage.readOnly`:e===`workspace`?`plugins:pluginsPage.workspace`:`plugins:pluginsPage.full`)}function xe(e){return e.flatMap(e=>e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function Se(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 Ce(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function V(e,t){return m({id:e.name,name:e.label},t)}function H(e,t){return e.pluginBuiltIn?c(e.pluginName,t):e.pluginName}function we({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)(h,{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)(h,{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)(x,{className:`animate-spin`,size:14}):(0,L.jsx)(g,{size:14}),o(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function U({query:e=``,notify:t,registerPrimaryAction:n,onStatusChange:r}){let{t:o}=a(),c=de(e=>e.capabilities),m=ge(c,`plugins`),h=m?z:z.slice(0,2),[g,_]=(0,I.useState)(null),[v,y]=(0,I.useState)([]),[b,S]=(0,I.useState)(``),[w,fe]=(0,I.useState)(`all`),[T,E]=(0,I.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[D,k]=(0,I.useState)(!1),[j,N]=(0,I.useState)(!1),[P,R]=(0,I.useState)(!1),[U,W]=(0,I.useState)(null),[G,Te]=(0,I.useState)(!1),[K,q]=(0,I.useState)(``),J=(0,I.useCallback)(e=>{_(e),y(e.plugins),E(e.webSearch);let t=Se(e.plugins);r({enabled:t.filter(e=>e.enabled).length,total:t.length})},[r]),Y=(0,I.useCallback)(async()=>{q(``);try{J(await C(`/api/plugins`))}catch(e){q(e instanceof Error?e.message:String(e))}},[J]);(0,I.useEffect)(()=>{Y()},[Y]);let X=(0,I.useMemo)(()=>Se(v),[v]),Z=(0,I.useMemo)(()=>xe(v),[v]),Q=g?!Ce(Z,g.enabledTools)||JSON.stringify(T)!==JSON.stringify(g.webSearch):!1,Ee=(0,I.useCallback)(async()=>{if(!D){if(!g||!Q){g&&t(o(`plugins:pluginsPage.noPluginPolicyChanges`));return}k(!0),q(``);try{let e=await C(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:Z,webSearch:T})});J(e),t(o(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){q(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[J,g,Q,Z,t,D,o,T]);_e(n,Ee);let De=async()=>{N(!0),q(``);try{let e=await C(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(T)});t(o(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:e.count}))}catch(e){let n=e instanceof Error?e.message:String(e);q(n),t(n,`error`)}finally{N(!1)}},Oe=(e,t,n)=>{y(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))},ke=e=>{let t=new Set(g?.presets?.[e]||[]);y(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))},Ae=()=>!Q||(q(o(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),je=async()=>{if(!(!U||G)){Te(!0),q(``);try{J(await C(`/api/plugins/${encodeURIComponent(U.pluginId)}`,{method:`DELETE`})),t(o(`plugins:pluginsPage.pluginUninstalled`,{name:U.pluginName})),S(``),W(null)}catch(e){q(e instanceof Error?e.message:String(e))}finally{Te(!1)}}};if(!g)return(0,L.jsxs)(me,{children:[(0,L.jsx)(x,{className:`animate-spin`,size:24}),(0,L.jsx)(`h2`,{children:o(`plugins:pluginsPage.loadingToolPlugins`)}),K&&(0,L.jsxs)(A,{children:[(0,L.jsx)(O,{size:13}),K]})]});let Me=e.trim().toLowerCase(),$=X.filter(e=>w!==`all`&&e.pluginSource!==w?!1:[V(e,o),e.name,e.description,H(e,o),e.pluginId].join(` `).toLowerCase().includes(Me));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)(pe,{options:h.map(e=>B(e,o)),value:B(w,o),onChange:e=>fe(h.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:g.preset===e&&!Q?`active`:``,onClick:()=>ke(e),children:be(e,o)},e))]}),m&&(0,L.jsxs)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>Ae()&&R(!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`,{}),X.filter(e=>e.enabled).length,`/`,X.length,` `,o(`plugins:pluginsPage.enabled2`),Q&&(0,L.jsx)(M,{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=b===e.name,n=ye[e.name]||ue;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:()=>S(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:V(e,o),children:V(e,o)}),(0,L.jsx)(`small`,{children:H(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)(M,{tone:`amber`,children:o(`plugins:pluginsPage.local`)}),(0,L.jsx)(he,{value:e.enabled,onChange:t=>Oe(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:V(e,o)}),"aria-expanded":t,onClick:()=>S(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:[H(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)(we,{value:T,testing:j,onChange:E,onTest:De}),!e.pluginBuiltIn&&(0,L.jsxs)(i,{type:`button`,variant:`destructive`,size:`lg`,className:`[justify-self:end]`,onClick:()=>Ae()&&W(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`)}),m&&(0,L.jsx)(ve,{open:P,onOpenChange:R,onInstalled:Y}),(0,L.jsx)(ae,{open:!!U,onOpenChange:e=>!e&&!G&&W(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:U?.pluginName||``})})]}),(0,L.jsxs)(ne,{children:[(0,L.jsx)(re,{disabled:G,children:o(`common:ui.cancel`)}),(0,L.jsxs)(te,{variant:`destructive`,disabled:G,onClick:je,children:[G&&(0,L.jsx)(ce,{className:`animate-spin`,size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),K&&(0,L.jsxs)(A,{className:`fixed z-[21] [right:24px] [bottom:24px] max-w-[360px] shadow-[0_12px_28px_-18px_var(--floating-shadow)]`,children:[(0,L.jsx)(O,{size:13}),K]})]})}export{U 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-DzlQCSNK.js";import{t as i}from"./use-i18n-DmLwOjO5.js";import{t as a}from"./utils-C8uzG5AZ.js";import{t as o}from"./circle-dot-CbGG7s_7.js";import{t as s}from"./trash-2-2GzVxk5J.js";import{t as c}from"./wrench-DkHcVlxK.js";import{Dt as l,G as u,Tt as d,U as f,_ as p,g as m,m as h,p as g}from"./index-BIQcwjFR.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)(h,{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)(m,{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)(h,{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)(p,{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:p}){let{t:m,language:h}=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:m(`workflows:previewPages.addMCPService`),message:m(`workflows:previewPages.enterAStreamableHTTPURLAStdioCommandOrJSONContainingHeadersEnv`),inputLabel:m(`workflows:previewPages.serverConfiguration`),placeholder:`https://server.example.com/mcp`,maxLength:12e3,confirmLabel:m(`workflows:previewPages.continue`)});if(t?.trim()&&await p?.({title:m(`workflows:previewPages.connectMCPServer`),message:m(`workflows:previewPages.mcpServersCanExposeToolsThatPerformExternalActionsConnectOnlyToServersYouTrust`),confirmLabel:m(`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(m(`workflows:previewPages.mcpServerAdded`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);N(n),e(n,`error`)}finally{M(!1)}}},[e,p,a,m]);_(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(m(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(m(`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 p?.({title:m(`workflows:previewPages.deleteMCPServer`),message:m(`workflows:previewPages.afterDeletionToolsFromThisServerWillBeRemovedFromSubsequentAgentRuns`),confirmLabel:m(`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(m(`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:m(`workflows:previewPages.services`)}),L.length?L.map(e=>{let[t,n]=T(e.status,m),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)(d,{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:m(`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:m(`workflows:previewPages.onlineServices`),note:m(`workflows:previewPages.countServicesTotal`,{count:V.totalServices}),tone:`blue`}),(0,y.jsx)(C,{value:String(V.availableTools),label:m(`workflows:previewPages.availableTools`),note:m(`workflows:previewPages.countRestrictedTools`,{count:V.restrictedTools}),tone:`green`}),(0,y.jsx)(C,{value:`${V.errorRate}%`,label:m(`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:[m(`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,m)}),(0,y.jsx)(g,{checked:!!e.enabled,disabled:j||!e.serviceEnabled,"aria-label":m(`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:m(`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:m(`workflows:previewPages.currentService`)}),(0,y.jsx)(`h2`,{children:R?.name||m(`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||m(R?`workflows:previewPages.thisServerExposesToolsThroughAStandardMCPTransportEnabledToolsAreRegisteredInNewAgentRuntimes`:`workflows:previewPages.useTheButtonInTheUpperRightToAddAStreamableHTTPOrStdioMCPServer`)}),[[m(`workflows:previewPages.transport`),R?.transport===`stdio`?`stdio`:R?.transport===`sse`?`HTTP + SSE`:`Streamable HTTP`],...R?.transport===`stdio`?[[m(`workflows:previewPages.executable`),R.command||`—`],[m(`workflows:previewPages.workingDirectory`),R.workingDirectory||`—`]]:[[m(`workflows:previewPages.serverAddress`),R?.endpoint||`—`]],[m(`workflows:previewPages.latency`),R?.latencyMs==null?`—`:`${R.latencyMs} ms`],[m(`workflows:previewPages.lastPing`),R?.lastPingAt?f(R.lastPingAt,h):`—`],[m(`workflows:previewPages.authentication`),D(R,m)]].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:m(`workflows:previewPages.serverEnabled`)}),(0,y.jsx)(g,{checked:!!R?.enabled,disabled:!R||j,"aria-label":m(`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)(l,{className:j?`animate-spin`:``,"data-icon":`inline-start`}),m(`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`}),m(`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:m(`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:[f(e.timestamp,h),` ·`,` `,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:m(`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-DzlQCSNK.js";import{t as i}from"./use-i18n-DmLwOjO5.js";import{t as a}from"./AppSelect-g6etLk2g.js";import{t as o}from"./WorkspacePicker-Cu2Z5jid.js";import{t as s}from"./message-circle-C3tSGsW0.js";import{t as c}from"./play-V5zloi0R.js";import{t as l}from"./trash-2-2GzVxk5J.js";import{Bt as u,Dt as d,G as f,Lt as p,Pt as m,St as h,U as g,Vt as _,bt as v,i as y,kt as b,l as x,n as S,o as C,r as w,s as T,t as E}from"./index-BIQcwjFR.js";import{t as D}from"./field-CCo2X7MX.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 ae(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 B({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 V({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)(m,{size:13}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,N.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),a&&(0,N.jsxs)(y,{children:[(0,N.jsx)(h,{size:13}),a]}),(0,N.jsx)(o,{open:c,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:l,onSelect:e=>t(e)})]})}function H(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 U(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 W({notify:e,registerPrimaryAction:t,openNotificationSettings:n,requestConfirm:o}){let{t:s,language:u}=i(),[m,_]=(0,M.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1}},workflows:[],defaultCwd:``}),[v,b]=(0,M.useState)(``),[A,j]=(0,M.useState)(null),[I,L]=(0,M.useState)(!0),[z,W]=(0,M.useState)(!1),[q,J]=(0,M.useState)(``),[oe,Y]=(0,M.useState)(!1);k(t,()=>Y(!0));let X=(0,M.useCallback)(async()=>{try{let e=await f(`/api/schedules`);_(e),b(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id||``)}catch(e){J(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===v),Q=m.workflows||[];(0,M.useEffect)(()=>{j(e=>Z?e?.id===Z.id?e:H(Z):null)},[Z]);let se=(0,M.useMemo)(()=>m.runs.filter(e=>e.taskId===v).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[m.runs,v]),$=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)(w,{children:[(0,N.jsx)(d,{className:`animate-spin`,size:23}),(0,N.jsx)(`h2`,{children:s(`schedules:schedulesPage.loadingScheduledTasks`)})]}):(0,N.jsxs)(N.Fragment,{children:[q&&(0,N.jsxs)(y,{children:[(0,N.jsx)(h,{size:13}),q]}),(0,N.jsxs)(`div`,{className:`split-list-detail grid min-h-[100%] min-w-0 grid-cols-[minmax(0,310px)_minmax(0,1fr)] gap-[12px] overflow-x-hidden max-[900px]:grid-cols-1 max-[650px]:gap-[8px]`,children:[(0,N.jsxs)(E,{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)(C,{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] ${v===e.id?`active`:``}`,children:(0,N.jsxs)(`button`,{onClick:()=>b(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)(x,{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:U(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)(E,{children:[(0,N.jsxs)(S,{className:`max-[650px]:flex-wrap max-[650px]:items-start`,children:[(0,N.jsx)(`h2`,{className:`min-w-0 break-words`,children:A.name}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-[5px] max-[650px]:w-full`,children:[(0,N.jsx)(T,{value:A.enabled,onChange:e=>$({enabled:e})}),(0,N.jsxs)(r,{size:`lg`,disabled:z||Z.lastStatus===`running`,onClick:async()=>{if(Z){W(!0),J(``);try{await f(`/api/schedules/${encodeURIComponent(Z.id)}/run`,{method:`POST`,body:`{}`}),await X(),e(s(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{W(!1)}}},children:[Z.lastStatus===`running`?(0,N.jsx)(d,{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 f(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`DELETE`}),await X(),e(s(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){J(e instanceof Error?e.message:String(e))}},children:(0,N.jsx)(l,{size:14})})]})]}),(0,N.jsx)(B,{targetType:A.targetType,prompt:A.prompt,workflowId:A.workflowId,workflowInputs:A.workflowInputs,workflows:Q,onChange:$}),A.targetType===`prompt`&&(0,N.jsx)(V,{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)(p,{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:g(Z.lastRunAt,u)}):s(`schedules:schedulesPage.nextRunTime`,{time:U(Z,u)})}),(0,N.jsxs)(r,{size:`lg`,disabled:z||!ae(A.targetType,A.prompt,A.workflowId,A.workflowInputs,Q),onClick:async()=>{if(!(!Z||!A)){W(!0),J(``);try{let t=await f(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`PATCH`,body:JSON.stringify(A)});_(t.state),j(H(t.task)),e(s(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{W(!1)}}},children:[z?(0,N.jsx)(d,{className:`animate-spin`,size:14}):null,s(z?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,N.jsxs)(E,{children:[(0,N.jsx)(C,{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)(d,{className:`animate-spin`,size:15}):e.status===`completed`?(0,N.jsx)(p,{size:15}):(0,N.jsx)(h,{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:[g(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)(G,{notificationTargets:m.notificationTargets,workflows:Q,defaultCwd:m.defaultCwd,onCreated:t=>{_(t.state),b(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))}})]}),oe&&(0,N.jsx)(K,{notificationTargets:m.notificationTargets,workflows:Q,defaultCwd:m.defaultCwd,onClose:()=>Y(!1),onCreated:t=>{Y(!1),_(t.state),b(t.task.id),e(s(`schedules:schedulesPage.scheduledTaskCreated`))}})]})}function G({notificationTargets:e,workflows:t,defaultCwd:n,onCreated:o}){let{t:s}=i(),[c,l]=(0,M.useState)(``),[u,p]=(0,M.useState)(`prompt`),[m,g]=(0,M.useState)(``),[_,v]=(0,M.useState)(``),[x,C]=(0,M.useState)({}),[w,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,H]=(0,M.useState)(`hours`),[U,W]=(0,M.useState)(`full-access`),[G,K]=(0,M.useState)(!1),[q,J]=(0,M.useState)(``);return(0,N.jsxs)(E,{children:[(0,N.jsx)(S,{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)(B,{targetType:u,prompt:m,workflowId:_,workflowInputs:x,workflows:t,onChange:e=>{e.targetType&&p(e.targetType),e.prompt!==void 0&&g(e.prompt),e.workflowId!==void 0&&v(e.workflowId),e.workflowInputs!==void 0&&C(e.workflowInputs)}}),u===`prompt`&&(0,N.jsx)(V,{value:w,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=>H(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:U,onChange:W})]}),q&&(0,N.jsxs)(y,{children:[(0,N.jsx)(h,{size:13}),q]}),(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:G||!c.trim()||!ae(u,m,_,x,t),onClick:async()=>{K(!0),J(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await f(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:m,workflowId:_,workflowInputs:x,cwd:w,enabled:!0,frequency:O,time:A,timezone:P,intervalValue:L,intervalUnit:z,executionMode:U,notifications:t,notifyOn:`always`})}))}catch(e){J(e instanceof Error?e.message:String(e))}finally{K(!1)}},children:[G?(0,N.jsx)(d,{className:`animate-spin`,size:14}):(0,N.jsx)(b,{size:14}),s(G?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})}function K({notificationTargets:e,workflows:t,defaultCwd:n,onClose:a,onCreated:o}){let{t:s}=i(),[c,l]=(0,M.useState)(``),[u,p]=(0,M.useState)(`prompt`),[m,g]=(0,M.useState)(``),[_,x]=(0,M.useState)(``),[C,w]=(0,M.useState)({}),[T,E]=(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 f(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:m,workflowId:_,workflowInputs:C,cwd:T,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)(S,{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)(v,{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)(B,{targetType:u,prompt:m,workflowId:_,workflowInputs:C,workflows:t,onChange:e=>{e.targetType&&p(e.targetType),e.prompt!==void 0&&g(e.prompt),e.workflowId!==void 0&&x(e.workflowId),e.workflowInputs!==void 0&&w(e.workflowInputs)}}),u===`prompt`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(V,{value:T,onChange:E}),(0,N.jsx)(R,{value:O,onChange:k})]}),P&&(0,N.jsxs)(y,{children:[(0,N.jsx)(h,{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()||!ae(u,m,_,C,t),children:[A?(0,N.jsx)(d,{className:`animate-spin`,size:14}):(0,N.jsx)(b,{size:14}),s(A?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})}export{W 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-DzlQCSNK.js";import{t as a}from"./use-i18n-DmLwOjO5.js";import{t as o}from"./file-code-corner-3gopYCm4.js";import{t as s}from"./image-Bu_a9jz0.js";import{t as c}from"./save-CTsP04bb.js";import{t as l}from"./trash-2-2GzVxk5J.js";import{t as u}from"./wrench-DkHcVlxK.js";import{Ct as d,Dt as f,G as p,c as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./index-BIQcwjFR.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:d}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(),[d,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 p(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 p(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&&!d)return(0,w.jsx)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:(0,w.jsxs)(v,{children:[(0,w.jsx)(f,{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=d?.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=(d?.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 p(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 p(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 p(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)(_,{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)(y,{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)(m,{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)(b,{className:`flex flex-col gap-[16px]`,children:[N!==`project`&&$(u(`skills:skillsPage.globalSkills`),K,W,u(`skills:skillsPage.noGlobalSkills`),d?.locations?.global||`~/.pisper/agent/skills`),N!==`global`&&$(u(`skills:skillsPage.projectSkills`),q,G,u(`skills:skillsPage.noProjectSkills`),d?.locations?.project||(d?.cwd?`${d.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``))]}),(0,w.jsxs)(b,{children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(_,{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)(h,{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)(b,{children:[(0,w.jsx)(_,{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)(b,{children:[(0,w.jsx)(_,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}
|