@av-pi-studio/web-client 0.0.112 → 0.0.113
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/dist/web/assets/{BinaryFallbackViewer-D5r7plgZ.js → BinaryFallbackViewer-BH2FpXPq.js} +1 -1
- package/dist/web/assets/{ChatPanel-Da3UDslj.js → ChatPanel-IwIp9TyM.js} +3 -3
- package/dist/web/assets/{CodeView-5RNJ09Tq.js → CodeView-nWhbxYNo.js} +1 -1
- package/dist/web/assets/FilePanel-DuSXRbB3.js +1 -0
- package/dist/web/assets/{HtmlViewer-BlKWR-Co.js → HtmlViewer-Bp9FVmsO.js} +1 -1
- package/dist/web/assets/{ImageViewer-WUyWuvmO.js → ImageViewer-CGkHIlbr.js} +1 -1
- package/dist/web/assets/{MarkdownFileViewer-x8oYHLfO.js → MarkdownFileViewer-Jd18lpAb.js} +1 -1
- package/dist/web/assets/{ModelProvidersPanel-8rYw0JNb.js → ModelProvidersPanel-BGnWcyq9.js} +1 -1
- package/dist/web/assets/{MoleculeViewerPanel-so-MAWGY.js → MoleculeViewerPanel-gr1xhI3B.js} +1 -1
- package/dist/web/assets/PdfViewer-Chvwi-vw.js +1 -0
- package/dist/web/assets/PdfViewer-DoOGVn5M.css +1 -0
- package/dist/web/assets/{SettingsDialog-DOPPV_tl.js → SettingsDialog-TBdq-cJW.js} +1 -1
- package/dist/web/assets/{SkillsPanel-CFFz1ek7.js → SkillsPanel-BPOQfm8q.js} +1 -1
- package/dist/web/assets/{TerminalPanel-DK6Y6-qM.js → TerminalPanel-BHWw9ZUE.js} +1 -1
- package/dist/web/assets/{TextViewer-DiGdbUYg.js → TextViewer-d0xfOD_a.js} +1 -1
- package/dist/web/assets/{VideoViewer-WavuJAEr.js → VideoViewer-DhoCw-I5.js} +1 -1
- package/dist/web/assets/ViewersPanel-DKQeezkV.js +1 -0
- package/dist/web/assets/{href-resolution-B3tyV0vA.js → href-resolution-CKrMBdbX.js} +1 -1
- package/dist/web/assets/index-BbSAfLF_.js +19 -0
- package/dist/web/assets/{markdown-f4n98WCB.js → markdown-BWyDQ88Y.js} +4 -4
- package/dist/web/assets/pdf.worker.min-ypFJvUNP.js +53 -0
- package/dist/web/assets/{use-file-download-DCt9_GXp.js → use-file-download-IryqzIsu.js} +1 -1
- package/dist/web/assets/{use-file-watch-bihMWgMU.js → use-file-watch-CKy-EMBA.js} +1 -1
- package/dist/web/assets/{use-provider-auth-list-CF2agvn7.js → use-provider-auth-list-CkrX1tsv.js} +1 -1
- package/dist/web/assets/{vendor-icons-CWFUB81y.js → vendor-icons-FMicTc5d.js} +78 -63
- package/dist/web/assets/vendor-pdfjs-BrYGnqfM.js +55 -0
- package/dist/web/index.html +2 -2
- package/dist/web/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/dist/web/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/web/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/dist/web/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/LICENSE +36 -0
- package/dist/web/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/Roman.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/V.bcmap +0 -0
- package/dist/web/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/web/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
- package/dist/web/pdfjs/iccs/LICENSE +116 -0
- package/dist/web/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/web/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/web/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/web/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/web/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/web/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/web/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/web/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/dist/web/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/web/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/web/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/web/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/web/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/dist/web/pdfjs/wasm/jbig2.wasm +0 -0
- package/dist/web/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
- package/dist/web/pdfjs/wasm/openjpeg.wasm +0 -0
- package/dist/web/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/dist/web/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/package.json +4 -3
- package/dist/web/assets/FilePanel-ckHGSH_-.js +0 -1
- package/dist/web/assets/ViewersPanel-CcGCSDlE.js +0 -1
- package/dist/web/assets/index-BR7IITFz.js +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as t}from"./vendor-react-DQUAl2K8.js";import{u as T,r as j,p as Z,I as D,D as Y,C as Q,B as A,S as M,E as $,q as ee}from"./index-BR7IITFz.js";import{S as z}from"./StatusBadge-BMKAPA9O.js";import{S as te}from"./Switch-1I6AMAC7.js";import"./vendor-DaF96HbP.js";import{a as B,u as se}from"./vendor-query-i7fr__Xm.js";import{T as G,C as ne,a as re}from"./vendor-icons-CWFUB81y.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";const ae=/^npm:\S+$/,le=/^git:\S+$/,oe=/^ssh:\/\/\S+$/,ie=/^git@[^\s:/]+:\S+$/,ce=/^https?:\/\/(?:[^\s/]*\.)?(?:github|gitlab)\.com\/\S+$/i,ue=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/\S+\.git$/,de=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,H="[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?",pe=new RegExp(`^${H}/${H}(?:@${H})?$`);function ge(e){const s=e.trim();return s.length===0?null:ae.test(s)?{kind:"pi_npm",normalized:s}:le.test(s)?{kind:"pi_git",normalized:s}:s==="~"||s.startsWith("~/")||s.startsWith("/")?{kind:"local_path",normalized:s}:ie.test(s)||oe.test(s)||ce.test(s)||ue.test(s)?{kind:"skills_repo",normalized:s}:de.test(s)?null:pe.test(s)?{kind:"skills_repo",normalized:s}:null}const U={agent_dir:"Pi skills",agents_dir:"Agent Skills",settings_path:"Skill paths"},q=new Set(["agent_dir","agents_dir"]);function _e(e,s){return q.has(e.origin)&&s.some(r=>r!==e&&r.name===e.name&&q.has(r.origin))?`Pi applies this setting to every '${e.name}' skill folder.`:null}function he(e,s,a){var o;const r=!!e.shadowedBy,l=[];if(r){const u=e.shadowedBy?a.get(e.shadowedBy):void 0;l.push({label:`shadowed by ${(u==null?void 0:u.originLabel)??e.shadowedBy}`,variant:"warning"})}return e.symlinkTarget&&l.push({label:`→ ${e.symlinkTarget}`,variant:"muted"}),e.disableModelInvocation&&l.push({label:"manual only",variant:"muted"}),(o=e.provenance)!=null&&o.source&&l.push({label:e.provenance.source,variant:"muted"}),{skill:e,muted:r,toggleDisabled:r,badges:l,warnings:e.warnings??[],sharedPatternTooltip:_e(e,s)}}function me(e){const s=[{label:e.kind,variant:"muted"}];return e.curated&&s.push({label:"curated",variant:"success"}),e.pinned&&s.push({label:"pinned",variant:"muted"}),s}function fe(e,s){const a=new Map(e.map(c=>[c.path,c])),r=c=>he(c,e,a),l=[],o=e.filter(c=>c.origin==="agent_dir").map(r);o.length>0&&l.push({id:"agent_dir",label:U.agent_dir,rows:o});const u=e.filter(c=>c.origin==="agents_dir").map(r);u.length>0&&l.push({id:"agents_dir",label:U.agents_dir,rows:u});const g=e.filter(c=>c.origin==="package"),d=new Set;for(const c of s){d.add(c.source);const v=g.filter(w=>w.packageSource===c.source).map(r);v.length>0&&l.push({id:`package:${c.source}`,label:c.source,rows:v,packageInfo:c})}const n=Array.from(new Set(g.filter(c=>c.packageSource&&!d.has(c.packageSource)).map(c=>c.packageSource)));for(const c of n){const v=g.filter(w=>w.packageSource===c).map(r);v.length>0&&l.push({id:`package:${c}`,label:c,rows:v})}const i=e.filter(c=>c.origin==="settings_path").map(r);i.length>0&&l.push({id:"settings_path",label:U.settings_path,rows:i});const f=new Set(["agent_dir","agents_dir","package","settings_path"]),k=Array.from(new Set(e.filter(c=>!f.has(c.origin)).map(c=>c.origin)));for(const c of k){const v=e.filter(w=>w.origin===c).map(r);v.length>0&&l.push({id:c,label:c,rows:v})}return l}function ke(e,s){const a=s.trim().toLowerCase();return a?e.map(r=>({...r,rows:r.rows.filter(l=>l.skill.name.toLowerCase().includes(a)||(l.skill.description??"").toLowerCase().includes(a))})).filter(r=>r.rows.length>0):e}function Se(e,s){if(e.origin!=="package"||!e.packageSource)return!1;const a=s.find(r=>r.source===e.packageSource);return!!(a!=null&&a.curated)}function we(e){return e.symlinkTarget?`Removes the link only; ${e.symlinkTarget} is kept.`:e.origin==="agents_dir"&&e.provenance?`Removes '${e.name}' for every agent on this machine.`:e.origin==="settings_path"?`Removes the Pi settings entry that provides ${e.path} (other skills from the same folder stop loading too); files are kept.`:`Deletes ${e.path}.`}function ve(e){const s=e.skillCount;return`Remove ${e.source}? This removes ${s} skill${s===1?"":"s"}.`}const Re="Updates every Agent Skills skill and every unpinned Pi package; may take several minutes",xe={"agent-skills":"Agent Skills","pi-packages":"Pi packages"};function be(e){return xe[e]??e}const je={settings_unreadable:"Can't read settings.json — skills can't be loaded or changed until this is fixed.",invalid_source:"That source isn't recognized.",not_found:"That skill could not be found.",not_removable:"That skill can't be removed from here.",spawn_failed:"Could not run the skills command.",timeout:"Timed out."};function X(e){return{...e,ok:!0,error:void 0,message:void 0}}function J(e){return e.results.length>0}function L(e,s){return e?s||(je[e]??e):null}const Ee={pi_npm:"npm package",pi_git:"git package",skills_repo:"Agent Skills repo",local_path:"Folder on daemon host"};function ye(e){return e?Ee[e.kind]:"Unrecognized"}function K(e){return e==="pi_npm"||e==="pi_git"}function Ne(e){return e!==null}const Ae="Installs the package's skills only; its extensions stay disabled. Pi packages run with full system access — review the source before installing.";function Ce(e){return e.installResult?"results":e.installPending?"running":e.previewPending?"previewing":e.previewResult?"pick":"source"}function ze(e){return e.map(s=>({skill:s,checked:s.valid,replace:!1}))}function W(e){return e.filter(s=>s.skill.valid&&s.checked&&(!s.skill.exists||s.replace)).map(s=>s.skill.name)}function Te(e){return e.some(s=>s.skill.valid&&s.checked&&s.skill.exists&&s.replace)}function Le(e,s,a){return{...e,skills:e.skills.map(r=>r.path===s?{...r,enabled:a}:r)}}function Pe(){const e=T(a=>a.client),s=B();return h.useEffect(()=>{if(e)return e.onSkillsChanged(()=>{s.invalidateQueries({queryKey:j.skillsList()})})},[e,s]),se({queryKey:j.skillsList(),queryFn:()=>{if(!e)throw new Error("not connected");return e.listSkills()},enabled:!!e})}function De(){const e=T(d=>d.client),s=B(),[a,r]=h.useState({}),[l,o]=h.useState({});function u(d){r(n=>{if(!(d in n))return n;const i={...n};return delete i[d],i})}async function g(d,n){if(!e)return;const i=d.path;u(i),o(k=>({...k,[i]:!0}));const f=s.getQueryData(j.skillsList());f&&s.setQueryData(j.skillsList(),Le(f,i,n));try{const k=await e.setSkillEnabled(i,n);if(!k.ok){f&&s.setQueryData(j.skillsList(),f),r(c=>({...c,[i]:L(k.error,k.message)??"Failed to update skill."}));return}s.setQueryData(j.skillsList(),k)}catch(k){f&&s.setQueryData(j.skillsList(),f),r(c=>({...c,[i]:k instanceof Error?k.message:"Failed to update skill."}))}finally{o(k=>{const c={...k};return delete c[i],c})}}return{rowErrors:a,pending:l,toggle:g,clearRowError:u}}function Be(e){return e.path??`package:${e.packageSource}`}function Ie(){const e=T(d=>d.client),s=B(),[a,r]=h.useState({}),[l,o]=h.useState({});function u(d){o(n=>{if(!(d in n))return n;const i={...n};return delete i[d],i})}async function g(d){if(!e)return;const n=Be(d);u(n),r(i=>({...i,[n]:!0}));try{const i=await e.removeSkill(d);if(!i.ok){o(f=>({...f,[n]:L(i.error,i.message)??"Failed to remove."}));return}s.setQueryData(j.skillsList(),i)}catch(i){o(f=>({...f,[n]:i instanceof Error?i.message:"Failed to remove."}))}finally{r(i=>{const f={...i};return delete f[n],f})}}return{pending:a,errors:l,clearError:u,removeSkill:d=>g({path:d.path}),removePackage:d=>g({packageSource:d.source})}}function $e(){const e=T(n=>n.client),s=B(),[a,r]=h.useState(!1),[l,o]=h.useState(null),[u,g]=h.useState(null);async function d(){if(e){r(!0),g(null);try{const n=await e.updateAllSkills();if(!n.ok&&!J(n)){g(L(n.error,n.message)??"Failed to update skills.");return}o(n),s.setQueryData(j.skillsList(),X(n))}catch(n){g(n instanceof Error?n.message:"Failed to update skills.")}finally{r(!1)}}}return{pending:a,result:l,error:u,updateAll:d,clearResult:()=>o(null)}}function Me(){const e=T(d=>d.client),[s,a]=h.useState(!1),[r,l]=h.useState(null),[o,u]=h.useState(null);async function g(d){if(e){a(!0),u(null);try{const n=await e.previewSkillSource(d);if(!n.ok){u(L(n.error,n.message)??"Failed to preview.");return}l(n)}catch(n){u(n instanceof Error?n.message:"Failed to preview.")}finally{a(!1)}}}return{pending:s,result:r,error:o,preview:g,reset:()=>{l(null),u(null)}}}function Fe(){const e=T(n=>n.client),s=B(),[a,r]=h.useState(!1),[l,o]=h.useState(null),[u,g]=h.useState(null);async function d(n){if(e){r(!0),g(null);try{const i=await e.installSkills(n);if(!i.ok&&!J(i)){g(L(i.error,i.message)??"Failed to install.");return}o(i),s.setQueryData(j.skillsList(),X(i))}catch(i){g(i instanceof Error?i.message:"Failed to install.")}finally{r(!1)}}}return{pending:a,result:l,error:u,install:d,reset:()=>{o(null),g(null)}}}const Oe="_sourceStep_1n0el_6",He="_sourceLabel_1n0el_13",Ue="_notice_1n0el_18",Ge="_error_1n0el_30",Qe="_statusStep_1n0el_35",qe="_pickStep_1n0el_45",Ke="_pickRows_1n0el_52",We="_pickRow_1n0el_52",Ze="_pickRowMain_1n0el_73",Xe="_pickRowTop_1n0el_80",Je="_pickRowName_1n0el_87",Ve="_pickRowDescription_1n0el_95",Ye="_backButton_1n0el_103",et="_results_1n0el_107",tt="_resultRow_1n0el_116",st="_resultHeader_1n0el_125",nt="_resultTarget_1n0el_132",rt="_resultError_1n0el_140",at="_resultToggle_1n0el_148",lt="_resultStderr_1n0el_159",m={sourceStep:Oe,sourceLabel:He,notice:Ue,error:Ge,statusStep:Qe,pickStep:qe,pickRows:Ke,pickRow:We,pickRowMain:Ze,pickRowTop:Xe,pickRowName:Je,pickRowDescription:Ve,backButton:Ye,results:et,resultRow:tt,resultHeader:st,resultTarget:nt,resultError:rt,resultToggle:at,resultStderr:lt};function ot({open:e,onOpenChange:s}){var I;const a=Me(),r=Fe(),[l,o]=h.useState(""),[u,g]=h.useState([]),d=h.useRef(!1),n=ge(l),i=Ce({previewPending:a.pending,previewResult:a.result,installPending:r.pending,installResult:r.result});h.useEffect(()=>{e&&!d.current&&!r.pending&&!r.result&&(o(""),g([]),a.reset()),d.current=e},[e]),h.useEffect(()=>{a.result&&g(ze(a.result.skills))},[a.result]);async function f(){if(n){if(K(n.kind)){await r.install({source:n.normalized});return}await a.preview(n.normalized)}}function k(R,N){g(P=>P.map((_,b)=>b===R?{..._,...N}:_))}async function c(){var N;const R=W(u);R.length!==0&&await r.install({source:((N=a.result)==null?void 0:N.source)??(n==null?void 0:n.normalized)??l,skills:R,replace:Te(u)})}function v(){a.reset(),g([])}function w(){r.reset(),s(!1)}const F=((I=a.result)==null?void 0:I.source)??(n==null?void 0:n.normalized)??l,O=W(u).length;let y,E;return i==="source"?(y=t.jsxs("div",{className:m.sourceStep,children:[t.jsx(Z,{autoFocus:!0,placeholder:"npm:<name>, git:<url>, owner/repo, or a daemon-host path",value:l,onChange:R=>o(R.target.value),"aria-label":"Install source"}),t.jsx("div",{className:m.sourceLabel,children:ye(n)}),n&&K(n.kind)&&t.jsxs("div",{className:m.notice,children:[t.jsx(D,{icon:G,size:"xs"}),t.jsx("span",{children:Ae})]}),a.error&&t.jsx("div",{className:m.error,children:a.error})]}),E=t.jsx(A,{size:"sm",disabled:!Ne(n),loading:r.pending,onClick:()=>void f(),children:"Next"})):i==="previewing"?(y=t.jsxs("div",{className:m.statusStep,children:[t.jsx(M,{size:"sm"})," Looking up the source…"]}),E=null):i==="pick"?(y=t.jsxs("div",{className:m.pickStep,children:[u.length===0?t.jsx("div",{className:m.statusStep,children:"No installable skills found."}):t.jsx("div",{className:m.pickRows,children:u.map((R,N)=>t.jsx(it,{row:R,onChange:P=>k(N,P)},R.skill.relPath))}),r.error&&t.jsx("div",{className:m.error,children:r.error})]}),E=t.jsxs(t.Fragment,{children:[t.jsx(A,{size:"sm",variant:"ghost",className:m.backButton,onClick:v,children:"‹ Back"}),t.jsxs(A,{size:"sm",disabled:O===0,loading:r.pending,onClick:()=>void c(),children:["Install from ",F]})]})):i==="running"?(y=t.jsxs("div",{className:m.statusStep,children:[t.jsx(M,{size:"sm"})," Installing… this may take several minutes"]}),E=null):(y=r.result?t.jsx(ct,{result:r.result}):null,E=t.jsx(A,{size:"sm",onClick:w,children:"Done"})),t.jsx(Y,{open:e,onOpenChange:R=>{if(!R&&i==="results"){w();return}s(R)},title:"Install skill…",width:480,footer:E,children:y})}function it({row:e,onChange:s}){const{skill:a,checked:r,replace:l}=e,o=!a.valid;return t.jsxs("div",{className:m.pickRow,"data-disabled":o||void 0,children:[t.jsx(Q,{checked:r&&a.valid,disabled:o,onChange:u=>s({checked:u.target.checked}),"aria-label":a.name}),t.jsxs("div",{className:m.pickRowMain,children:[t.jsxs("div",{className:m.pickRowTop,children:[t.jsx("span",{className:m.pickRowName,children:a.name}),!a.valid&&t.jsx(z,{label:"Invalid",variant:"error"}),a.exists&&t.jsx(z,{label:"Already installed",variant:"warning"}),a.warnings&&a.warnings.length>0&&t.jsx(D,{icon:G,size:"xs",color:"var(--pi-color-statusWarning)","aria-label":a.warnings.join("; ")})]}),a.description&&t.jsx("span",{className:m.pickRowDescription,children:a.description}),a.exists&&a.valid&&t.jsx(Q,{label:"Already installed — replace",checked:l,onChange:u=>s({replace:u.target.checked})})]})]})}function ct({result:e}){const[s,a]=h.useState(()=>new Set);function r(l){a(o=>{const u=new Set(o);return u.has(l)?u.delete(l):u.add(l),u})}return t.jsx("div",{className:m.results,children:e.results.map((l,o)=>{const u=s.has(o);return t.jsxs("div",{className:m.resultRow,children:[t.jsxs("div",{className:m.resultHeader,children:[t.jsx(z,{label:l.ok?"Installed":"Failed",variant:l.ok?"success":"error"}),t.jsx("span",{className:m.resultTarget,children:l.target}),l.error&&t.jsx("span",{className:m.resultError,children:l.error}),l.stderr&&t.jsx("button",{type:"button",className:m.resultToggle,onClick:()=>r(o),children:u?"Hide details":"Show details"})]}),u&&l.stderr&&t.jsx("pre",{className:m.resultStderr,children:l.stderr})]},`${l.target}-${o}`)})})}const ut="_panel_1tczp_1",dt="_toolbar_1tczp_7",pt="_search_1tczp_14",gt="_groups_1tczp_19",_t="_group_1tczp_19",ht="_groupHeader_1tczp_30",mt="_chevronExpanded_1tczp_47",ft="_groupLabel_1tczp_51",kt="_groupBadges_1tczp_62",St="_groupCount_1tczp_68",wt="_rows_1tczp_74",vt="_row_1tczp_74",Rt="_rowMain_1tczp_91",xt="_rowTop_1tczp_98",bt="_name_1tczp_105",jt="_nameMuted_1tczp_113 _name_1tczp_105",Et="_badge_1tczp_118",yt="_description_1tczp_122",Nt="_descriptionMuted_1tczp_130 _description_1tczp_122",At="_rowError_1tczp_135",Ct="_footnote_1tczp_147",zt="_errorState_1tczp_153",Tt="_removePackageBtn_1tczp_157",Lt="_rowActions_1tczp_161",Pt="_updateAllResults_1tczp_168",Dt="_updateAllResultRow_1tczp_178",Bt="_updateAllResultHeader_1tczp_184",It="_updateAllResultLabel_1tczp_191",$t="_updateAllResultError_1tczp_196",Mt="_updateAllResultToggle_1tczp_204",Ft="_updateAllResultStderr_1tczp_215",p={panel:ut,toolbar:dt,search:pt,groups:gt,group:_t,groupHeader:ht,chevronExpanded:mt,groupLabel:ft,groupBadges:kt,groupCount:St,rows:wt,row:vt,rowMain:Rt,rowTop:xt,name:bt,nameMuted:jt,badge:Et,description:yt,descriptionMuted:Nt,rowError:At,footnote:Ct,errorState:zt,removePackageBtn:Tt,rowActions:Lt,updateAllResults:Pt,updateAllResultRow:Dt,updateAllResultHeader:Bt,updateAllResultLabel:It,updateAllResultError:$t,updateAllResultToggle:Mt,updateAllResultStderr:Ft};function Vt(){const{data:e,isLoading:s,isError:a,error:r}=Pe(),{rowErrors:l,pending:o,toggle:u,clearRowError:g}=De(),d=Ie(),n=$e(),[i,f]=h.useState(""),[k,c]=h.useState(()=>new Set),[v,w]=h.useState(!1),[F,O]=h.useState(()=>new Set);function y(_){c(b=>{const x=new Set(b);return x.has(_)?x.delete(_):x.add(_),x})}if(s)return t.jsxs($,{children:[t.jsx(M,{size:"sm"})," Loading skills…"]});if(a)return t.jsx($,{className:p.errorState,children:r instanceof Error?r.message:"Failed to load skills."});if(!e)return null;if(!e.ok)return t.jsx($,{className:p.errorState,children:L(e.error,e.message)??"Could not load skills."});const E=ke(fe(e.skills,e.packages),i);function I(_,b){if(b&&_.packageSource&&Se(_,e.packages)&&!F.has(_.packageSource)){if(!window.confirm("Pi-Studio will stop managing this package's updates."))return;O(x=>new Set(x).add(_.packageSource))}u(_,b)}function R(_){window.confirm(we(_))&&d.removeSkill(_)}function N(_){window.confirm(ve(_))&&d.removePackage(_)}function P(){window.confirm(Re)&&n.updateAll()}return t.jsxs("div",{className:p.panel,children:[t.jsxs("div",{className:p.toolbar,children:[t.jsx(Z,{className:p.search,placeholder:"Search skills…",value:i,onChange:_=>f(_.target.value),"aria-label":"Search skills"}),t.jsx(A,{size:"sm",variant:"outline",loading:n.pending,onClick:P,children:"Update all"}),t.jsx(A,{size:"sm",onClick:()=>w(!0),children:"Install skill…"})]}),n.error&&t.jsx("button",{type:"button",className:p.rowError,onClick:()=>n.updateAll().catch(()=>{}),children:n.error}),n.result&&t.jsx(Ot,{result:n.result,onDismiss:n.clearResult}),E.length===0?t.jsx($,{children:i?"No skills match your search.":"No skills found."}):t.jsx("div",{className:p.groups,children:E.map(_=>{const b=k.has(_.id),x=_.packageInfo,C=x?`package:${x.source}`:void 0;return t.jsxs("div",{className:p.group,children:[t.jsxs("button",{type:"button",className:p.groupHeader,onClick:()=>y(_.id),"aria-expanded":!b,children:[t.jsx(D,{icon:ne,size:"xs",className:b?void 0:p.chevronExpanded}),t.jsx("span",{className:p.groupLabel,children:_.label}),x&&t.jsx("span",{className:p.groupBadges,children:me(x).map(S=>t.jsx(z,{label:S.label,variant:S.variant},S.label))}),t.jsx("span",{className:p.groupCount,children:_.rows.length}),x&&t.jsx(A,{size:"xs",variant:"ghost",className:p.removePackageBtn,loading:C?!!d.pending[C]:!1,onClick:S=>{S.stopPropagation(),N(x)},children:"Remove package"})]}),C&&d.errors[C]&&t.jsx("button",{type:"button",className:p.rowError,onClick:()=>d.clearError(C),children:d.errors[C]}),!b&&t.jsx("div",{className:p.rows,children:_.rows.map(S=>t.jsx(Ht,{row:S,error:l[S.skill.path],pending:!!o[S.skill.path],removeError:d.errors[S.skill.path],removePending:!!d.pending[S.skill.path],onToggle:V=>I(S.skill,V),onDismissError:()=>g(S.skill.path),onRemove:()=>R(S.skill),onDismissRemoveError:()=>d.clearError(S.skill.path)},S.skill.path))})]},_.id)})}),t.jsx("p",{className:p.footnote,children:"Changes apply to newly started agent sessions."}),t.jsx(ot,{open:v,onOpenChange:w})]})}function Ot({result:e,onDismiss:s}){const[a,r]=h.useState(()=>new Set);function l(o){r(u=>{const g=new Set(u);return g.has(o)?g.delete(o):g.add(o),g})}return t.jsxs("div",{className:p.updateAllResults,children:[e.results.map(o=>{const u=a.has(o.target);return t.jsxs("div",{className:p.updateAllResultRow,children:[t.jsxs("div",{className:p.updateAllResultHeader,children:[t.jsx(z,{label:o.ok?"Succeeded":"Failed",variant:o.ok?"success":"error"}),t.jsx("span",{className:p.updateAllResultLabel,children:be(o.target)}),o.error&&t.jsx("span",{className:p.updateAllResultError,children:o.error}),o.stderr&&t.jsx("button",{type:"button",className:p.updateAllResultToggle,onClick:()=>l(o.target),children:u?"Hide details":"Show details"})]}),u&&o.stderr&&t.jsx("pre",{className:p.updateAllResultStderr,children:o.stderr})]},o.target)}),t.jsx("button",{type:"button",className:p.rowError,onClick:s,children:"Dismiss"})]})}function Ht({row:e,error:s,pending:a,removeError:r,removePending:l,onToggle:o,onDismissError:u,onRemove:g,onDismissRemoveError:d}){const{skill:n,muted:i,toggleDisabled:f,badges:k,warnings:c,sharedPatternTooltip:v}=e;return t.jsxs("div",{className:p.row,title:v??void 0,children:[t.jsxs("div",{className:p.rowMain,children:[t.jsxs("div",{className:p.rowTop,children:[t.jsx("span",{className:i?p.nameMuted:p.name,children:n.name}),c.length>0&&t.jsx(D,{icon:G,size:"xs",color:"var(--pi-color-statusWarning)","aria-label":c.join("; ")}),k.map(w=>t.jsx(z,{label:w.label,variant:w.variant,className:p.badge},w.label))]}),n.description&&t.jsx("span",{className:i?p.descriptionMuted:p.description,children:n.description}),s&&t.jsx("button",{type:"button",className:p.rowError,onClick:u,children:s}),r&&t.jsx("button",{type:"button",className:p.rowError,onClick:d,children:r})]}),t.jsxs("div",{className:p.rowActions,children:[t.jsx(te,{checked:n.enabled,disabled:f||a,onCheckedChange:o,"aria-label":n.name}),n.removable&&t.jsx(ee,{"aria-label":`Remove ${n.name}`,disabled:l,onClick:g,children:l?t.jsx(M,{size:"xs"}):t.jsx(D,{icon:re,size:"xs"})})]})]})}export{Vt as SkillsPanel};
|
|
1
|
+
import{r as h,j as t}from"./vendor-react-DQUAl2K8.js";import{u as T,r as j,q as Z,I as D,D as Y,C as Q,B as A,S as M,E as $,s as ee}from"./index-BbSAfLF_.js";import{S as z}from"./StatusBadge-BMKAPA9O.js";import{S as te}from"./Switch-1I6AMAC7.js";import"./vendor-DaF96HbP.js";import{a as B,u as se}from"./vendor-query-i7fr__Xm.js";import{T as G,C as ne,b as re}from"./vendor-icons-FMicTc5d.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";const ae=/^npm:\S+$/,le=/^git:\S+$/,oe=/^ssh:\/\/\S+$/,ie=/^git@[^\s:/]+:\S+$/,ce=/^https?:\/\/(?:[^\s/]*\.)?(?:github|gitlab)\.com\/\S+$/i,ue=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/\S+\.git$/,de=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,H="[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?",pe=new RegExp(`^${H}/${H}(?:@${H})?$`);function ge(e){const s=e.trim();return s.length===0?null:ae.test(s)?{kind:"pi_npm",normalized:s}:le.test(s)?{kind:"pi_git",normalized:s}:s==="~"||s.startsWith("~/")||s.startsWith("/")?{kind:"local_path",normalized:s}:ie.test(s)||oe.test(s)||ce.test(s)||ue.test(s)?{kind:"skills_repo",normalized:s}:de.test(s)?null:pe.test(s)?{kind:"skills_repo",normalized:s}:null}const U={agent_dir:"Pi skills",agents_dir:"Agent Skills",settings_path:"Skill paths"},q=new Set(["agent_dir","agents_dir"]);function _e(e,s){return q.has(e.origin)&&s.some(r=>r!==e&&r.name===e.name&&q.has(r.origin))?`Pi applies this setting to every '${e.name}' skill folder.`:null}function he(e,s,a){var o;const r=!!e.shadowedBy,l=[];if(r){const u=e.shadowedBy?a.get(e.shadowedBy):void 0;l.push({label:`shadowed by ${(u==null?void 0:u.originLabel)??e.shadowedBy}`,variant:"warning"})}return e.symlinkTarget&&l.push({label:`→ ${e.symlinkTarget}`,variant:"muted"}),e.disableModelInvocation&&l.push({label:"manual only",variant:"muted"}),(o=e.provenance)!=null&&o.source&&l.push({label:e.provenance.source,variant:"muted"}),{skill:e,muted:r,toggleDisabled:r,badges:l,warnings:e.warnings??[],sharedPatternTooltip:_e(e,s)}}function me(e){const s=[{label:e.kind,variant:"muted"}];return e.curated&&s.push({label:"curated",variant:"success"}),e.pinned&&s.push({label:"pinned",variant:"muted"}),s}function fe(e,s){const a=new Map(e.map(c=>[c.path,c])),r=c=>he(c,e,a),l=[],o=e.filter(c=>c.origin==="agent_dir").map(r);o.length>0&&l.push({id:"agent_dir",label:U.agent_dir,rows:o});const u=e.filter(c=>c.origin==="agents_dir").map(r);u.length>0&&l.push({id:"agents_dir",label:U.agents_dir,rows:u});const g=e.filter(c=>c.origin==="package"),d=new Set;for(const c of s){d.add(c.source);const v=g.filter(w=>w.packageSource===c.source).map(r);v.length>0&&l.push({id:`package:${c.source}`,label:c.source,rows:v,packageInfo:c})}const n=Array.from(new Set(g.filter(c=>c.packageSource&&!d.has(c.packageSource)).map(c=>c.packageSource)));for(const c of n){const v=g.filter(w=>w.packageSource===c).map(r);v.length>0&&l.push({id:`package:${c}`,label:c,rows:v})}const i=e.filter(c=>c.origin==="settings_path").map(r);i.length>0&&l.push({id:"settings_path",label:U.settings_path,rows:i});const f=new Set(["agent_dir","agents_dir","package","settings_path"]),k=Array.from(new Set(e.filter(c=>!f.has(c.origin)).map(c=>c.origin)));for(const c of k){const v=e.filter(w=>w.origin===c).map(r);v.length>0&&l.push({id:c,label:c,rows:v})}return l}function ke(e,s){const a=s.trim().toLowerCase();return a?e.map(r=>({...r,rows:r.rows.filter(l=>l.skill.name.toLowerCase().includes(a)||(l.skill.description??"").toLowerCase().includes(a))})).filter(r=>r.rows.length>0):e}function Se(e,s){if(e.origin!=="package"||!e.packageSource)return!1;const a=s.find(r=>r.source===e.packageSource);return!!(a!=null&&a.curated)}function we(e){return e.symlinkTarget?`Removes the link only; ${e.symlinkTarget} is kept.`:e.origin==="agents_dir"&&e.provenance?`Removes '${e.name}' for every agent on this machine.`:e.origin==="settings_path"?`Removes the Pi settings entry that provides ${e.path} (other skills from the same folder stop loading too); files are kept.`:`Deletes ${e.path}.`}function ve(e){const s=e.skillCount;return`Remove ${e.source}? This removes ${s} skill${s===1?"":"s"}.`}const Re="Updates every Agent Skills skill and every unpinned Pi package; may take several minutes",xe={"agent-skills":"Agent Skills","pi-packages":"Pi packages"};function be(e){return xe[e]??e}const je={settings_unreadable:"Can't read settings.json — skills can't be loaded or changed until this is fixed.",invalid_source:"That source isn't recognized.",not_found:"That skill could not be found.",not_removable:"That skill can't be removed from here.",spawn_failed:"Could not run the skills command.",timeout:"Timed out."};function X(e){return{...e,ok:!0,error:void 0,message:void 0}}function J(e){return e.results.length>0}function L(e,s){return e?s||(je[e]??e):null}const Ee={pi_npm:"npm package",pi_git:"git package",skills_repo:"Agent Skills repo",local_path:"Folder on daemon host"};function ye(e){return e?Ee[e.kind]:"Unrecognized"}function K(e){return e==="pi_npm"||e==="pi_git"}function Ne(e){return e!==null}const Ae="Installs the package's skills only; its extensions stay disabled. Pi packages run with full system access — review the source before installing.";function Ce(e){return e.installResult?"results":e.installPending?"running":e.previewPending?"previewing":e.previewResult?"pick":"source"}function ze(e){return e.map(s=>({skill:s,checked:s.valid,replace:!1}))}function W(e){return e.filter(s=>s.skill.valid&&s.checked&&(!s.skill.exists||s.replace)).map(s=>s.skill.name)}function Te(e){return e.some(s=>s.skill.valid&&s.checked&&s.skill.exists&&s.replace)}function Le(e,s,a){return{...e,skills:e.skills.map(r=>r.path===s?{...r,enabled:a}:r)}}function Pe(){const e=T(a=>a.client),s=B();return h.useEffect(()=>{if(e)return e.onSkillsChanged(()=>{s.invalidateQueries({queryKey:j.skillsList()})})},[e,s]),se({queryKey:j.skillsList(),queryFn:()=>{if(!e)throw new Error("not connected");return e.listSkills()},enabled:!!e})}function De(){const e=T(d=>d.client),s=B(),[a,r]=h.useState({}),[l,o]=h.useState({});function u(d){r(n=>{if(!(d in n))return n;const i={...n};return delete i[d],i})}async function g(d,n){if(!e)return;const i=d.path;u(i),o(k=>({...k,[i]:!0}));const f=s.getQueryData(j.skillsList());f&&s.setQueryData(j.skillsList(),Le(f,i,n));try{const k=await e.setSkillEnabled(i,n);if(!k.ok){f&&s.setQueryData(j.skillsList(),f),r(c=>({...c,[i]:L(k.error,k.message)??"Failed to update skill."}));return}s.setQueryData(j.skillsList(),k)}catch(k){f&&s.setQueryData(j.skillsList(),f),r(c=>({...c,[i]:k instanceof Error?k.message:"Failed to update skill."}))}finally{o(k=>{const c={...k};return delete c[i],c})}}return{rowErrors:a,pending:l,toggle:g,clearRowError:u}}function Be(e){return e.path??`package:${e.packageSource}`}function Ie(){const e=T(d=>d.client),s=B(),[a,r]=h.useState({}),[l,o]=h.useState({});function u(d){o(n=>{if(!(d in n))return n;const i={...n};return delete i[d],i})}async function g(d){if(!e)return;const n=Be(d);u(n),r(i=>({...i,[n]:!0}));try{const i=await e.removeSkill(d);if(!i.ok){o(f=>({...f,[n]:L(i.error,i.message)??"Failed to remove."}));return}s.setQueryData(j.skillsList(),i)}catch(i){o(f=>({...f,[n]:i instanceof Error?i.message:"Failed to remove."}))}finally{r(i=>{const f={...i};return delete f[n],f})}}return{pending:a,errors:l,clearError:u,removeSkill:d=>g({path:d.path}),removePackage:d=>g({packageSource:d.source})}}function $e(){const e=T(n=>n.client),s=B(),[a,r]=h.useState(!1),[l,o]=h.useState(null),[u,g]=h.useState(null);async function d(){if(e){r(!0),g(null);try{const n=await e.updateAllSkills();if(!n.ok&&!J(n)){g(L(n.error,n.message)??"Failed to update skills.");return}o(n),s.setQueryData(j.skillsList(),X(n))}catch(n){g(n instanceof Error?n.message:"Failed to update skills.")}finally{r(!1)}}}return{pending:a,result:l,error:u,updateAll:d,clearResult:()=>o(null)}}function Me(){const e=T(d=>d.client),[s,a]=h.useState(!1),[r,l]=h.useState(null),[o,u]=h.useState(null);async function g(d){if(e){a(!0),u(null);try{const n=await e.previewSkillSource(d);if(!n.ok){u(L(n.error,n.message)??"Failed to preview.");return}l(n)}catch(n){u(n instanceof Error?n.message:"Failed to preview.")}finally{a(!1)}}}return{pending:s,result:r,error:o,preview:g,reset:()=>{l(null),u(null)}}}function Fe(){const e=T(n=>n.client),s=B(),[a,r]=h.useState(!1),[l,o]=h.useState(null),[u,g]=h.useState(null);async function d(n){if(e){r(!0),g(null);try{const i=await e.installSkills(n);if(!i.ok&&!J(i)){g(L(i.error,i.message)??"Failed to install.");return}o(i),s.setQueryData(j.skillsList(),X(i))}catch(i){g(i instanceof Error?i.message:"Failed to install.")}finally{r(!1)}}}return{pending:a,result:l,error:u,install:d,reset:()=>{o(null),g(null)}}}const Oe="_sourceStep_1n0el_6",He="_sourceLabel_1n0el_13",Ue="_notice_1n0el_18",Ge="_error_1n0el_30",Qe="_statusStep_1n0el_35",qe="_pickStep_1n0el_45",Ke="_pickRows_1n0el_52",We="_pickRow_1n0el_52",Ze="_pickRowMain_1n0el_73",Xe="_pickRowTop_1n0el_80",Je="_pickRowName_1n0el_87",Ve="_pickRowDescription_1n0el_95",Ye="_backButton_1n0el_103",et="_results_1n0el_107",tt="_resultRow_1n0el_116",st="_resultHeader_1n0el_125",nt="_resultTarget_1n0el_132",rt="_resultError_1n0el_140",at="_resultToggle_1n0el_148",lt="_resultStderr_1n0el_159",m={sourceStep:Oe,sourceLabel:He,notice:Ue,error:Ge,statusStep:Qe,pickStep:qe,pickRows:Ke,pickRow:We,pickRowMain:Ze,pickRowTop:Xe,pickRowName:Je,pickRowDescription:Ve,backButton:Ye,results:et,resultRow:tt,resultHeader:st,resultTarget:nt,resultError:rt,resultToggle:at,resultStderr:lt};function ot({open:e,onOpenChange:s}){var I;const a=Me(),r=Fe(),[l,o]=h.useState(""),[u,g]=h.useState([]),d=h.useRef(!1),n=ge(l),i=Ce({previewPending:a.pending,previewResult:a.result,installPending:r.pending,installResult:r.result});h.useEffect(()=>{e&&!d.current&&!r.pending&&!r.result&&(o(""),g([]),a.reset()),d.current=e},[e]),h.useEffect(()=>{a.result&&g(ze(a.result.skills))},[a.result]);async function f(){if(n){if(K(n.kind)){await r.install({source:n.normalized});return}await a.preview(n.normalized)}}function k(R,N){g(P=>P.map((_,b)=>b===R?{..._,...N}:_))}async function c(){var N;const R=W(u);R.length!==0&&await r.install({source:((N=a.result)==null?void 0:N.source)??(n==null?void 0:n.normalized)??l,skills:R,replace:Te(u)})}function v(){a.reset(),g([])}function w(){r.reset(),s(!1)}const F=((I=a.result)==null?void 0:I.source)??(n==null?void 0:n.normalized)??l,O=W(u).length;let y,E;return i==="source"?(y=t.jsxs("div",{className:m.sourceStep,children:[t.jsx(Z,{autoFocus:!0,placeholder:"npm:<name>, git:<url>, owner/repo, or a daemon-host path",value:l,onChange:R=>o(R.target.value),"aria-label":"Install source"}),t.jsx("div",{className:m.sourceLabel,children:ye(n)}),n&&K(n.kind)&&t.jsxs("div",{className:m.notice,children:[t.jsx(D,{icon:G,size:"xs"}),t.jsx("span",{children:Ae})]}),a.error&&t.jsx("div",{className:m.error,children:a.error})]}),E=t.jsx(A,{size:"sm",disabled:!Ne(n),loading:r.pending,onClick:()=>void f(),children:"Next"})):i==="previewing"?(y=t.jsxs("div",{className:m.statusStep,children:[t.jsx(M,{size:"sm"})," Looking up the source…"]}),E=null):i==="pick"?(y=t.jsxs("div",{className:m.pickStep,children:[u.length===0?t.jsx("div",{className:m.statusStep,children:"No installable skills found."}):t.jsx("div",{className:m.pickRows,children:u.map((R,N)=>t.jsx(it,{row:R,onChange:P=>k(N,P)},R.skill.relPath))}),r.error&&t.jsx("div",{className:m.error,children:r.error})]}),E=t.jsxs(t.Fragment,{children:[t.jsx(A,{size:"sm",variant:"ghost",className:m.backButton,onClick:v,children:"‹ Back"}),t.jsxs(A,{size:"sm",disabled:O===0,loading:r.pending,onClick:()=>void c(),children:["Install from ",F]})]})):i==="running"?(y=t.jsxs("div",{className:m.statusStep,children:[t.jsx(M,{size:"sm"})," Installing… this may take several minutes"]}),E=null):(y=r.result?t.jsx(ct,{result:r.result}):null,E=t.jsx(A,{size:"sm",onClick:w,children:"Done"})),t.jsx(Y,{open:e,onOpenChange:R=>{if(!R&&i==="results"){w();return}s(R)},title:"Install skill…",width:480,footer:E,children:y})}function it({row:e,onChange:s}){const{skill:a,checked:r,replace:l}=e,o=!a.valid;return t.jsxs("div",{className:m.pickRow,"data-disabled":o||void 0,children:[t.jsx(Q,{checked:r&&a.valid,disabled:o,onChange:u=>s({checked:u.target.checked}),"aria-label":a.name}),t.jsxs("div",{className:m.pickRowMain,children:[t.jsxs("div",{className:m.pickRowTop,children:[t.jsx("span",{className:m.pickRowName,children:a.name}),!a.valid&&t.jsx(z,{label:"Invalid",variant:"error"}),a.exists&&t.jsx(z,{label:"Already installed",variant:"warning"}),a.warnings&&a.warnings.length>0&&t.jsx(D,{icon:G,size:"xs",color:"var(--pi-color-statusWarning)","aria-label":a.warnings.join("; ")})]}),a.description&&t.jsx("span",{className:m.pickRowDescription,children:a.description}),a.exists&&a.valid&&t.jsx(Q,{label:"Already installed — replace",checked:l,onChange:u=>s({replace:u.target.checked})})]})]})}function ct({result:e}){const[s,a]=h.useState(()=>new Set);function r(l){a(o=>{const u=new Set(o);return u.has(l)?u.delete(l):u.add(l),u})}return t.jsx("div",{className:m.results,children:e.results.map((l,o)=>{const u=s.has(o);return t.jsxs("div",{className:m.resultRow,children:[t.jsxs("div",{className:m.resultHeader,children:[t.jsx(z,{label:l.ok?"Installed":"Failed",variant:l.ok?"success":"error"}),t.jsx("span",{className:m.resultTarget,children:l.target}),l.error&&t.jsx("span",{className:m.resultError,children:l.error}),l.stderr&&t.jsx("button",{type:"button",className:m.resultToggle,onClick:()=>r(o),children:u?"Hide details":"Show details"})]}),u&&l.stderr&&t.jsx("pre",{className:m.resultStderr,children:l.stderr})]},`${l.target}-${o}`)})})}const ut="_panel_1tczp_1",dt="_toolbar_1tczp_7",pt="_search_1tczp_14",gt="_groups_1tczp_19",_t="_group_1tczp_19",ht="_groupHeader_1tczp_30",mt="_chevronExpanded_1tczp_47",ft="_groupLabel_1tczp_51",kt="_groupBadges_1tczp_62",St="_groupCount_1tczp_68",wt="_rows_1tczp_74",vt="_row_1tczp_74",Rt="_rowMain_1tczp_91",xt="_rowTop_1tczp_98",bt="_name_1tczp_105",jt="_nameMuted_1tczp_113 _name_1tczp_105",Et="_badge_1tczp_118",yt="_description_1tczp_122",Nt="_descriptionMuted_1tczp_130 _description_1tczp_122",At="_rowError_1tczp_135",Ct="_footnote_1tczp_147",zt="_errorState_1tczp_153",Tt="_removePackageBtn_1tczp_157",Lt="_rowActions_1tczp_161",Pt="_updateAllResults_1tczp_168",Dt="_updateAllResultRow_1tczp_178",Bt="_updateAllResultHeader_1tczp_184",It="_updateAllResultLabel_1tczp_191",$t="_updateAllResultError_1tczp_196",Mt="_updateAllResultToggle_1tczp_204",Ft="_updateAllResultStderr_1tczp_215",p={panel:ut,toolbar:dt,search:pt,groups:gt,group:_t,groupHeader:ht,chevronExpanded:mt,groupLabel:ft,groupBadges:kt,groupCount:St,rows:wt,row:vt,rowMain:Rt,rowTop:xt,name:bt,nameMuted:jt,badge:Et,description:yt,descriptionMuted:Nt,rowError:At,footnote:Ct,errorState:zt,removePackageBtn:Tt,rowActions:Lt,updateAllResults:Pt,updateAllResultRow:Dt,updateAllResultHeader:Bt,updateAllResultLabel:It,updateAllResultError:$t,updateAllResultToggle:Mt,updateAllResultStderr:Ft};function Vt(){const{data:e,isLoading:s,isError:a,error:r}=Pe(),{rowErrors:l,pending:o,toggle:u,clearRowError:g}=De(),d=Ie(),n=$e(),[i,f]=h.useState(""),[k,c]=h.useState(()=>new Set),[v,w]=h.useState(!1),[F,O]=h.useState(()=>new Set);function y(_){c(b=>{const x=new Set(b);return x.has(_)?x.delete(_):x.add(_),x})}if(s)return t.jsxs($,{children:[t.jsx(M,{size:"sm"})," Loading skills…"]});if(a)return t.jsx($,{className:p.errorState,children:r instanceof Error?r.message:"Failed to load skills."});if(!e)return null;if(!e.ok)return t.jsx($,{className:p.errorState,children:L(e.error,e.message)??"Could not load skills."});const E=ke(fe(e.skills,e.packages),i);function I(_,b){if(b&&_.packageSource&&Se(_,e.packages)&&!F.has(_.packageSource)){if(!window.confirm("Pi-Studio will stop managing this package's updates."))return;O(x=>new Set(x).add(_.packageSource))}u(_,b)}function R(_){window.confirm(we(_))&&d.removeSkill(_)}function N(_){window.confirm(ve(_))&&d.removePackage(_)}function P(){window.confirm(Re)&&n.updateAll()}return t.jsxs("div",{className:p.panel,children:[t.jsxs("div",{className:p.toolbar,children:[t.jsx(Z,{className:p.search,placeholder:"Search skills…",value:i,onChange:_=>f(_.target.value),"aria-label":"Search skills"}),t.jsx(A,{size:"sm",variant:"outline",loading:n.pending,onClick:P,children:"Update all"}),t.jsx(A,{size:"sm",onClick:()=>w(!0),children:"Install skill…"})]}),n.error&&t.jsx("button",{type:"button",className:p.rowError,onClick:()=>n.updateAll().catch(()=>{}),children:n.error}),n.result&&t.jsx(Ot,{result:n.result,onDismiss:n.clearResult}),E.length===0?t.jsx($,{children:i?"No skills match your search.":"No skills found."}):t.jsx("div",{className:p.groups,children:E.map(_=>{const b=k.has(_.id),x=_.packageInfo,C=x?`package:${x.source}`:void 0;return t.jsxs("div",{className:p.group,children:[t.jsxs("button",{type:"button",className:p.groupHeader,onClick:()=>y(_.id),"aria-expanded":!b,children:[t.jsx(D,{icon:ne,size:"xs",className:b?void 0:p.chevronExpanded}),t.jsx("span",{className:p.groupLabel,children:_.label}),x&&t.jsx("span",{className:p.groupBadges,children:me(x).map(S=>t.jsx(z,{label:S.label,variant:S.variant},S.label))}),t.jsx("span",{className:p.groupCount,children:_.rows.length}),x&&t.jsx(A,{size:"xs",variant:"ghost",className:p.removePackageBtn,loading:C?!!d.pending[C]:!1,onClick:S=>{S.stopPropagation(),N(x)},children:"Remove package"})]}),C&&d.errors[C]&&t.jsx("button",{type:"button",className:p.rowError,onClick:()=>d.clearError(C),children:d.errors[C]}),!b&&t.jsx("div",{className:p.rows,children:_.rows.map(S=>t.jsx(Ht,{row:S,error:l[S.skill.path],pending:!!o[S.skill.path],removeError:d.errors[S.skill.path],removePending:!!d.pending[S.skill.path],onToggle:V=>I(S.skill,V),onDismissError:()=>g(S.skill.path),onRemove:()=>R(S.skill),onDismissRemoveError:()=>d.clearError(S.skill.path)},S.skill.path))})]},_.id)})}),t.jsx("p",{className:p.footnote,children:"Changes apply to newly started agent sessions."}),t.jsx(ot,{open:v,onOpenChange:w})]})}function Ot({result:e,onDismiss:s}){const[a,r]=h.useState(()=>new Set);function l(o){r(u=>{const g=new Set(u);return g.has(o)?g.delete(o):g.add(o),g})}return t.jsxs("div",{className:p.updateAllResults,children:[e.results.map(o=>{const u=a.has(o.target);return t.jsxs("div",{className:p.updateAllResultRow,children:[t.jsxs("div",{className:p.updateAllResultHeader,children:[t.jsx(z,{label:o.ok?"Succeeded":"Failed",variant:o.ok?"success":"error"}),t.jsx("span",{className:p.updateAllResultLabel,children:be(o.target)}),o.error&&t.jsx("span",{className:p.updateAllResultError,children:o.error}),o.stderr&&t.jsx("button",{type:"button",className:p.updateAllResultToggle,onClick:()=>l(o.target),children:u?"Hide details":"Show details"})]}),u&&o.stderr&&t.jsx("pre",{className:p.updateAllResultStderr,children:o.stderr})]},o.target)}),t.jsx("button",{type:"button",className:p.rowError,onClick:s,children:"Dismiss"})]})}function Ht({row:e,error:s,pending:a,removeError:r,removePending:l,onToggle:o,onDismissError:u,onRemove:g,onDismissRemoveError:d}){const{skill:n,muted:i,toggleDisabled:f,badges:k,warnings:c,sharedPatternTooltip:v}=e;return t.jsxs("div",{className:p.row,title:v??void 0,children:[t.jsxs("div",{className:p.rowMain,children:[t.jsxs("div",{className:p.rowTop,children:[t.jsx("span",{className:i?p.nameMuted:p.name,children:n.name}),c.length>0&&t.jsx(D,{icon:G,size:"xs",color:"var(--pi-color-statusWarning)","aria-label":c.join("; ")}),k.map(w=>t.jsx(z,{label:w.label,variant:w.variant,className:p.badge},w.label))]}),n.description&&t.jsx("span",{className:i?p.descriptionMuted:p.description,children:n.description}),s&&t.jsx("button",{type:"button",className:p.rowError,onClick:u,children:s}),r&&t.jsx("button",{type:"button",className:p.rowError,onClick:d,children:r})]}),t.jsxs("div",{className:p.rowActions,children:[t.jsx(te,{checked:n.enabled,disabled:f||a,onCheckedChange:o,"aria-label":n.name}),n.removable&&t.jsx(ee,{"aria-label":`Remove ${n.name}`,disabled:l,onClick:g,children:l?t.jsx(M,{size:"xs"}):t.jsx(D,{icon:re,size:"xs"})})]})]})}export{Vt as SkillsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ce=Object.defineProperty;var ie=(n,e,t)=>e in n?ce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var U=(n,e,t)=>ie(n,typeof e!="symbol"?e+"":e,t);import{r as s,j as b}from"./vendor-react-DQUAl2K8.js";import{x as ue,a as le}from"./vendor-terminal-BhzX2_ts.js";import{f as X,g as ae,T as J,u as fe,h as de,
|
|
1
|
+
var ce=Object.defineProperty;var ie=(n,e,t)=>e in n?ce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var U=(n,e,t)=>ie(n,typeof e!="symbol"?e+"":e,t);import{r as s,j as b}from"./vendor-react-DQUAl2K8.js";import{x as ue,a as le}from"./vendor-terminal-BhzX2_ts.js";import{f as X,g as ae,T as J,u as fe,h as de,j as me,k as pe,l as Q,S as he,m as Re,o as we}from"./index-BbSAfLF_.js";import"./vendor-DaF96HbP.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-icons-FMicTc5d.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";class Se{constructor(e){U(this,"subscribers",new Map);U(this,"detach",null);this.daemon=e}start(){this.detach||(this.detach=this.daemon.onTerminalFrame(e=>this.dispatch(e)))}stop(){var e;(e=this.detach)==null||e.call(this),this.detach=null}subscribeSlot(e,t){return this.subscribers.set(e,t),()=>{this.subscribers.get(e)===t&&this.subscribers.delete(e)}}hasSlot(e){return this.subscribers.has(e)}sendInput(e,t){this.daemon.sendBinary(X({opcode:"Input",slot:e,data:t}))}sendResize(e,t,d){this.daemon.sendBinary(X({opcode:"Resize",slot:e,rows:t,cols:d}))}dispatch(e){var d,R,p;const t=this.subscribers.get(e.slot);if(t)switch(e.opcode){case"Output":(d=t.onOutput)==null||d.call(t,e.data);return;case"Snapshot":(R=t.onSnapshot)==null||R.call(t,e.data);return;case"Restore":(p=t.onRestore)==null||p.call(t,e.data);return;default:return}}}const ye=3e3,Z=`${ae.sm}px ${J}`,ee="M";function te(){if(typeof document>"u"||!document.fonts)return!0;try{return document.fonts.check(Z,ee)}catch{return!0}}const Te=(async()=>{if(typeof document>"u"||!document.fonts||te())return;let n;try{await Promise.race([document.fonts.load(Z,ee),new Promise(e=>{n=window.setTimeout(e,ye)})])}catch{}finally{window.clearTimeout(n)}})(),_e=2,ve=1;function y(n){if(n==null)return!1;const{cols:e,rows:t}=n;return typeof e=="number"&&Number.isInteger(e)&&e>=_e&&typeof t=="number"&&Number.isInteger(t)&&t>=ve}function ge(n,e){return n===null||e===null?n===e:n.cols===e.cols&&n.rows===e.rows}function xe(n,e){return y(n)?!ge(n,e):!1}function be(n,e){if(e===null)return;const t=n.find(R=>R.slot===e);if(!t)return;const d={cols:t.cols,rows:t.rows};return y(d)?d:void 0}const Fe="_wrap_1fx2h_1",Ee="_terminal_1fx2h_12",Ae="_statusOverlay_1fx2h_19",ze="_exitedBanner_1fx2h_30",z={wrap:Fe,terminal:Ee,statusOverlay:Ae,exitedBanner:ze},Oe=64*1024,$=new TextEncoder,K=new WeakMap;function Ne(n){let e=K.get(n);return e||(e=new Se(n),e.start(),K.set(n,e)),e}function Y(n){const e=Q.getState(),t=e.tabs.find(d=>d.id===n);return!t||t.workspaceCwd!==e.activeWorkspaceCwd?!1:Re(we.getState().layouts[t.workspaceCwd],n)}function Le({tab:n}){const e=n.data,t=fe(r=>r.client),d=de(n.id),{settings:R,resolvedTheme:p}=me(),B=R.monoFont&&R.monoFont.trim()!==""?p.fontFamily.mono:J,W=s.useRef(null),w=s.useRef(null),T=s.useRef(null),_=s.useRef(e.slot),O=s.useRef(null),N=s.useRef([]),I=s.useRef(0),F=s.useRef(null),ne=s.useRef(null),E=s.useRef(null),v=s.useRef(null),A=s.useRef(null),k=s.useRef(!1),H=s.useRef(null),V=s.useRef(t);V.current=t;const D=s.useRef(e.exited??!1);D.current=e.exited??!1;const[g,re]=s.useState(e.slot),[j,M]=s.useState({isAttaching:!0,error:null}),[q,se]=s.useState(te);s.useEffect(()=>{if(q)return;let r=!1;return Te.then(()=>{r||se(!0)}),()=>{r=!0}},[q]);const C=()=>{var o,c;const r=(o=T.current)==null?void 0:o.proposeDimensions();(c=E.current)==null||c.call(E,y(r)?r:null)},oe=()=>{var r;A.current=null,k.current=!0,(r=T.current)==null||r.fit(),C(),requestAnimationFrame(()=>{k.current=!1})},P=()=>{v.current!==null&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{v.current=null,A.current===null&&(A.current=requestAnimationFrame(oe))},60)};s.useEffect(()=>{const r=W.current;if(!r||!q)return;const o=new ue.Terminal({cursorBlink:!0,fontFamily:B,fontSize:p.fontSize.code,scrollback:5e3,theme:p.colors.terminal,allowProposedApi:!0}),c=new le.FitAddon;o.loadAddon(c),o.open(r);const f=u=>{if(!Y(n.id))return;const l=_.current,S=O.current;l===null||!S||xe(u,F.current)&&(F.current=u,S.sendResize(l,u.rows,u.cols))},a=o.onData(u=>{if(D.current)return;const l=_.current,S=O.current;if(l===null||!S){const G=$.encode(u);I.current+G.length<=Oe&&(N.current.push(G),I.current+=G.length);return}S.sendInput(l,$.encode(u))}),m=o.onResize(({cols:u,rows:l})=>{f({cols:u,rows:l})}),h=()=>{c.fit(),C()};r.addEventListener("focusin",h),c.fit(),w.current=o,T.current=c,E.current=f;const i=new ResizeObserver(u=>{if(k.current)return;const l=u[0];l&&(l.contentRect.width===0||l.contentRect.height===0)||P()});return i.observe(r),()=>{i.disconnect(),v.current!==null&&window.clearTimeout(v.current),A.current!==null&&cancelAnimationFrame(A.current),r.removeEventListener("focusin",h),a.dispose(),m.dispose(),o.dispose(),w.current=null,T.current=null,E.current=null}},[q]),s.useEffect(()=>{const r=w.current;if(!r)return;r.options.theme=p.colors.terminal;const o=p.fontSize.code,c=B,f=H.current,a=f!==null&&(f.size!==o||f.family!==c);r.options.fontSize=o,r.options.fontFamily=c,H.current={size:o,family:c},a&&P()},[p,B]),s.useEffect(()=>{if(!e.exited)return;const r=w.current;r&&(r.options.cursorBlink=!1,r.blur())},[e.exited]),s.useEffect(()=>{if(t)return t.connection.onSessionMessage(r=>{const o=r;if(!pe(o))return;const c=be(o.terminals,_.current);c!==void 0&&(F.current=c)})},[t]);const x=s.useRef(!1),L=s.useRef(!1);return s.useEffect(()=>{var f;if(x.current=!0,!t||_.current!==null||L.current)return()=>{x.current=!1};L.current=!0;const r=e.cwd||"~",o=(f=T.current)==null?void 0:f.proposeDimensions(),c=y(o)?o:null;return t.connection.request("create_terminal_request",{workspaceId:"",cwd:r,...c?{cols:c.cols,rows:c.rows}:{}}).then(a=>{const m=a.terminal.slot;if(!x.current){t.connection.request("kill_terminal_request",{slot:m}).catch(()=>{});return}_.current=m,re(m),Q.getState().updateData(n.id,{slot:m});const h={cols:a.terminal.cols,rows:a.terminal.rows};F.current=y(h)?h:null}).catch(a=>{x.current&&M({isAttaching:!1,error:a instanceof Error?a.message:String(a)})}).finally(()=>{L.current=!1}),()=>{x.current=!1}},[t,n.id]),s.useEffect(()=>()=>{const r=_.current;r!==null&&setTimeout(()=>{var o;x.current||D.current||(o=V.current)==null||o.connection.request("kill_terminal_request",{slot:r}).catch(()=>{})},0)},[]),s.useEffect(()=>{var h;if(!t||g===null)return;M({isAttaching:!0,error:null});const r=Ne(t.connection);O.current=r;const o=i=>{var u,l;(u=w.current)==null||u.reset(),(l=w.current)==null||l.write(i)},c=r.subscribeSlot(g,{onOutput:i=>{var u;return(u=w.current)==null?void 0:u.write(i)},onSnapshot:o,onRestore:o});let f=!1;const a=(h=T.current)==null?void 0:h.proposeDimensions(),m=y(a)&&Y(n.id)?a:null;return t.connection.request("subscribe_terminal_request",{slot:g,restoreMode:"reflowable",...m?{cols:m.cols,rows:m.rows}:{}}).then(i=>{if(f)return;M({isAttaching:!1,error:null}),ne.current=(i==null?void 0:i.restoreMode)??"basic";const u=N.current;N.current=[],I.current=0;for(const S of u)r.sendInput(g,S);const l={cols:i==null?void 0:i.cols,rows:i==null?void 0:i.rows};F.current=y(l)?l:m,C()}).catch(i=>{f||(N.current=[],I.current=0,M({isAttaching:!1,error:i instanceof Error?i.message:String(i)}))}),()=>{f=!0,c(),O.current=null,t.connection.request("unsubscribe_terminal_request",{slot:g}).catch(()=>{})}},[t,g]),s.useEffect(()=>{d&&P()},[d]),b.jsxs("div",{className:z.wrap,children:[b.jsx("div",{ref:W,className:z.terminal}),j.error?b.jsxs("div",{className:z.statusOverlay,children:["Terminal error: ",j.error]}):j.isAttaching?b.jsxs("div",{className:z.statusOverlay,children:[b.jsx(he,{size:"sm"})," Starting terminal…"]}):null,e.exited?b.jsx("div",{className:z.exitedBanner,children:"Terminal exited"}):null]})}export{Le as TerminalPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-DQUAl2K8.js";import{E as r,S as t,B as a,P as c}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-DQUAl2K8.js";import{E as r,S as t,B as a,P as c}from"./index-BbSAfLF_.js";import{u as m,C as d}from"./CodeView-nWhbxYNo.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-DaF96HbP.js";import"./vendor-icons-FMicTc5d.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";import"./use-file-download-IryqzIsu.js";const x="_note_1g5yz_1",j="_body_1g5yz_9",g="_tooLarge_1g5yz_13",i={note:x,body:j,tooLarge:g};function n(o){return`${(o/(1024*1024)).toFixed(1)} MB`}function b({path:o}){const s=m(o);switch(s.kind){case"loading":return e.jsxs(r,{children:[e.jsx(t,{size:"sm"})," Loading..."]});case"inline":return e.jsx(d,{path:o,content:s.content});case"streaming":return e.jsxs(r,{children:[e.jsx(t,{size:"sm"})," Streaming ",n(s.size)," file..."]});case"stream-error":return e.jsxs(r,{children:["Error: ",s.message]});case"streamed":return e.jsxs(c,{children:[e.jsxs("div",{className:i.note,children:[n(s.size)," file streamed"]}),e.jsx("div",{className:i.body,children:e.jsx(d,{path:o,content:s.content})})]});case"too-large":{const l=o.split("/").pop()||o;return e.jsx(r,{children:e.jsxs("div",{className:i.tooLarge,children:[e.jsxs("div",{children:[n(s.size)," — too large to display (display ceiling is"," ",n(s.maxDisplayBytes),")."]}),s.downloading?e.jsx(t,{size:"sm"}):s.downloadUrl?e.jsx("a",{href:s.downloadUrl,download:s.downloadName||l,children:e.jsx(a,{size:"sm",children:"Save file"})}):e.jsx(a,{size:"sm",onClick:()=>s.requestDownload(),children:"Download"})]})})}case"error":return e.jsxs(r,{children:["Error: ",s.message]})}}export{b as TextViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./vendor-react-DQUAl2K8.js";import{E as e,S as t}from"./index-
|
|
1
|
+
import{j as o}from"./vendor-react-DQUAl2K8.js";import{E as e,S as t}from"./index-BbSAfLF_.js";import{u as n}from"./use-file-download-IryqzIsu.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-DaF96HbP.js";import"./vendor-icons-FMicTc5d.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";const a="_wrap_gy3e6_1",d="_video_gy3e6_10",s={wrap:a,video:d};function v({path:i,workspaceCwd:m}){const r=n(i);return r.isLoading?o.jsxs(e,{children:[o.jsx(t,{size:"sm"})," Loading video..."]}):r.isError?o.jsxs(e,{children:["Error: ",r.error instanceof Error?r.error.message:"unknown error"]}):r.data?o.jsx("div",{className:s.wrap,children:o.jsx("video",{className:s.video,src:r.data.objectUrl,controls:!0})}):null}export{v as VideoViewer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-react-DQUAl2K8.js";import{S as d}from"./Switch-1I6AMAC7.js";import{b as a}from"./index-BbSAfLF_.js";import"./vendor-DaF96HbP.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-icons-FMicTc5d.js";import"./vendor-overlays-3MkedLFU.js";import"./vendor-dnd-CayJj8TC.js";const p="_list_x2x5z_1",m="_row_x2x5z_7",x="_rowMain_x2x5z_17",w="_name_x2x5z_24",_="_description_x2x5z_29",f="_note_x2x5z_34",n={list:p,row:m,rowMain:x,name:w,description:_,note:f},b=[{id:"molviewer",name:"Molecule Viewer",description:"Open molecular structure files (.cif, .pdb, .xyz, and similar) in the 3D viewer instead of as plain text."},{id:"pdfviewer",name:"PDF Viewer",description:"Render PDF files in place instead of offering only a download."}];function h({id:o,name:i,description:r}){const t=a(s=>s.capable),c=a(s=>s.isViewerEnabled(o)),l=a(s=>s.setEnabled);return e.jsxs("div",{className:n.row,children:[e.jsxs("div",{className:n.rowMain,children:[e.jsx("span",{className:n.name,children:i}),e.jsx("span",{className:n.description,children:r})]}),e.jsx(d,{checked:c,disabled:!t,onCheckedChange:s=>void l(o,s),"aria-label":i})]})}function M(){const o=a(i=>i.capable);return e.jsxs("div",{className:n.list,children:[b.map(i=>e.jsx(h,{...i},i.id)),!o&&e.jsx("p",{className:n.note,children:"Requires a newer daemon."})]})}export{M as ViewersPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as l,a as o,c as i}from"./index-
|
|
1
|
+
import{n as l,a as o,c as i}from"./index-BbSAfLF_.js";const u=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function d(n){try{return decodeURIComponent(n)}catch{return n}}function p(n,a,r){const s=n.trim();if(!s)return null;const e=s.split(/[?#]/,1)[0];if(!e||u.exec(e))return null;let t;if(e.startsWith("/")?t=e:e==="~"||e.startsWith("~/")?t=r?l(e,r):null:t=o(e,a??""),!t)return null;const c=i(t);return d(c)}export{u as S,d as p,p as r};
|