vskill 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +58 -7
  2. package/agents.json +1 -1
  3. package/dist/bin.js +0 -0
  4. package/dist/commands/add-lockfile.d.ts +6 -0
  5. package/dist/commands/add-lockfile.js +10 -0
  6. package/dist/commands/add-lockfile.js.map +1 -1
  7. package/dist/commands/add.js +16 -1
  8. package/dist/commands/add.js.map +1 -1
  9. package/dist/discovery/github-tree.d.ts +23 -3
  10. package/dist/discovery/github-tree.js +172 -24
  11. package/dist/discovery/github-tree.js.map +1 -1
  12. package/dist/eval-ui/assets/{CreateSkillPage-Cv93Croj.js → CreateSkillPage-gG-MYioa.js} +5 -5
  13. package/dist/eval-ui/assets/{FindSkillsPalette-BY9DAhHh.js → FindSkillsPalette-DgVp_buC.js} +2 -2
  14. package/dist/eval-ui/assets/{SearchPaletteCore-DMVcq7UB.js → SearchPaletteCore-D2gKxOTT.js} +1 -1
  15. package/dist/eval-ui/assets/{SkillDetailPanel-B_lbhK6q.js → SkillDetailPanel-Ioc5XaDA.js} +1 -1
  16. package/dist/eval-ui/assets/{UpdateDropdown-4AbjZLpq.js → UpdateDropdown-B9rCyfnR.js} +1 -1
  17. package/dist/eval-ui/assets/{main-tpOyw9SC.js → main-sUAgJ9SV.js} +34 -34
  18. package/dist/eval-ui/index.html +1 -1
  19. package/dist/lib/github-fetch.d.ts +1 -0
  20. package/dist/lib/github-fetch.js +11 -1
  21. package/dist/lib/github-fetch.js.map +1 -1
  22. package/dist/lockfile/types.d.ts +8 -0
  23. package/dist/sidecar/eval-ui-manifest.json +1 -0
  24. package/dist/sidecar/sea-config.json +57 -0
  25. package/dist/sidecar/sea-prep.blob +0 -0
  26. package/dist/sidecar/server.cjs +141627 -0
  27. package/dist/sidecar/vskill-version.txt +1 -0
  28. package/dist/updater/source-fetcher.js +2 -2
  29. package/dist/updater/source-fetcher.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{r as i,j as t}from"./globals-hm1COkXX.js";import{a as xe}from"./skill-url-C4ekwoGs.js";import{h as ye}from"./main-tpOyw9SC.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */function me(a){return a?a.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Me(a,p){if(!a)return"";const d=be(a);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(a){return a?a<1e3?String(a):`${(a/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:a,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[a];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":a,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:ye(a)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(a){var d,u;const p=(d=a.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=a.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function $e({onSelect:a,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=i.useState(W),[o,F]=i.useState(""),[I,h]=i.useState([]),[U,v]=i.useState(0),[j,B]=i.useState(!1),[_,w]=i.useState(1),[H,x]=i.useState(!1),[M,V]=i.useState(!1),[$,k]=i.useState(null),[A,R]=i.useState(!1),Z=i.useRef(null),N=i.useRef(null),z=i.useRef(!1),ee=i.useRef(null),te=i.useRef(null),q=i.useRef(new Map),S=i.useRef(null),[,ue]=i.useState(!1),re=i.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=i.useRef(o);i.useEffect(()=>{K.current=o},[o]),i.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),i.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),i.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),i.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=i.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);i.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:xe(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ie=i.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=i.useCallback((e,n)=>{if(n&&(ie(n.name),a))try{a(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[a,p,ie]);i.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ae="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
1
+ import{r as i,j as t}from"./globals-hm1COkXX.js";import{a as xe}from"./skill-url-C4ekwoGs.js";import{h as ye}from"./main-sUAgJ9SV.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */function me(a){return a?a.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Me(a,p){if(!a)return"";const d=be(a);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(a){return a?a<1e3?String(a):`${(a/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:a,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[a];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":a,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:ye(a)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(a){var d,u;const p=(d=a.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=a.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function $e({onSelect:a,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=i.useState(W),[o,F]=i.useState(""),[I,h]=i.useState([]),[U,v]=i.useState(0),[j,B]=i.useState(!1),[_,w]=i.useState(1),[H,x]=i.useState(!1),[M,V]=i.useState(!1),[$,k]=i.useState(null),[A,R]=i.useState(!1),Z=i.useRef(null),N=i.useRef(null),z=i.useRef(!1),ee=i.useRef(null),te=i.useRef(null),q=i.useRef(new Map),S=i.useRef(null),[,ue]=i.useState(!1),re=i.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=i.useRef(o);i.useEffect(()=>{K.current=o},[o]),i.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),i.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),i.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),i.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=i.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);i.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:xe(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ie=i.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=i.useCallback((e,n)=>{if(n&&(ie(n.name),a))try{a(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[a,p,ie]);i.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ae="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
2
2
  @keyframes fsp-pulse {
3
3
  0%, 100% { opacity: 1; }
4
4
  50% { opacity: 0.45; }
@@ -1 +1 @@
1
- import{j as t,r as c}from"./globals-hm1COkXX.js";import{g as pe,a as G,T as me,I as ge}from"./main-tpOyw9SC.js";import{s as N}from"./skill-url-C4ekwoGs.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */const X={T0:{label:"BLOCKED",cssVar:"var(--trust-t0)"},T1:{label:"UNSCANNED",cssVar:"var(--trust-t1)"},T2:{label:"BASIC",cssVar:"var(--trust-t2)"},T3:{label:"VERIFIED",cssVar:"var(--trust-t3)"},T4:{label:"CERTIFIED",cssVar:"var(--trust-t4)"}};function he({tier:r}){const i=X[r]??X.T1;return t.jsxs("span",{"data-testid":"trust-badge","data-tier":r,style:{display:"inline-flex",alignItems:"center",gap:"0.3rem",padding:"0.15rem 0.5rem",borderRadius:"4px",fontFamily:"var(--font-geist-mono)",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.03em",textTransform:"uppercase",whiteSpace:"nowrap",color:i.cssVar,backgroundColor:`color-mix(in srgb, ${i.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${i.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[r," ",i.label]})}const ye=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function xe(r){var v,x;const a=r.trim().match(ye);if(!a)return null;const p=(v=a[1])==null?void 0:v.toLowerCase();let u=(x=a[2])==null?void 0:x.toLowerCase();if(!p||!u)return null;u=u.replace(/\.git$/,"");const s=`https://github.com/${p}/${u}`;return{owner:p,name:u,url:s}}function ve({repoUrl:r,mono:i="var(--font-geist-mono)",fontSize:a="0.75rem",showPlaceholder:p=!0}){if(!r)return p?t.jsx("span",{style:{color:"var(--text-faint)",fontSize:a},children:"--"}):null;const u=xe(r);return u?t.jsxs("a",{"data-testid":"repo-link",href:u.url,target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:a,fontFamily:i},children:[u.owner,"/",u.name]}):t.jsx("span",{style:{color:"var(--text-faint)",fontSize:a,fontFamily:i},children:r})}const be="var(--font-geist-mono)",ke={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},Ee={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function je({skillName:r,repoUrl:i}){const[a,p]=c.useState(null),[u,s]=c.useState(!1);if(c.useEffect(()=>{i&&(s(!0),fetch(N(r,"repo-health")).then(w=>{if(!w.ok)throw new Error("fetch failed");return w.json()}).then(w=>{p(w.status),s(!1)}).catch(()=>{p(null),s(!1)}))},[r,i]),!i)return null;if(u)return t.jsx("span",{"data-testid":"repo-health-loading",style:{display:"inline-block",width:56,height:20,borderRadius:"4px",backgroundColor:"color-mix(in srgb, var(--text-faint) 20%, transparent)",animation:"pulse 1.5s ease-in-out infinite"}});if(!a||a==="UNKNOWN")return null;const v=ke[a]??"var(--status-neutral-text)",x=Ee[a]??"var(--status-neutral-bg)";return t.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:be,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:v,whiteSpace:"nowrap"},children:a})}function we({children:r,compact:i}){return t.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code, #161B22)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:i?"0.8rem":"0.875rem",lineHeight:1.6,padding:i?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:r})}const Se="/api/v1/studio/telemetry/install-copy",$e=/^[a-zA-Z0-9._@/-]+$/,Fe=/^[a-zA-Z0-9._-]+$/,Ie="https://verified-skill.com";function Te(r){return`${r.owner}/${r.repo}/${r.slug}`}function Ae(r,i){return r!=null&&r.ownerSlug&&(r!=null&&r.repoSlug)?`${r.ownerSlug}/${r.repoSlug}`:r!=null&&r.publisher?r.publisher:`${i.owner}/${i.repo}`}function Ce(r){return r==="user"?" --global":` --scope ${r}`}function Re(r){return r==="user"?"User":"Project"}function De(r,i,a,p){const u=a?`${r}/${i}@${a}`:`${r}/${i}`;if(!$e.test(`${r}/${i}`))return{ok:!1,reason:"Invalid skill identifier"};if(a&&!Fe.test(a))return{ok:!1,reason:"Invalid version identifier"};const s=Ce(p),v=`npx vskill@latest install ${u}${s}`,x=[{label:"npm",comment:"# npm",command:v},{label:"bun",comment:"# bun",command:`bunx vskill@latest install ${u}${s}`},{label:"pnpm",comment:"# pnpm",command:`pnpx vskill@latest install ${u}${s}`},{label:"yarn",comment:"# yarn",command:`yarn dlx vskill@latest install ${u}${s}`},{label:"alternative",comment:"# alternative (publisher + --skill flag)",command:a?`npx vskill@latest install ${r}@${a} --skill ${i}${s}`:`npx vskill@latest install ${r} --skill ${i}${s}`}];return{ok:!0,command:v,variants:x}}function I(r,i,a){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:r,kind:i,durationMs:a,severity:i==="error"?"error":"info"}}))}async function Y(r){var i;if(typeof navigator<"u"&&((i=navigator.clipboard)!=null&&i.writeText))try{return await navigator.clipboard.writeText(r),!0}catch{}if(typeof document>"u")return!1;try{const a=document.createElement("textarea");a.value=r,a.setAttribute("readonly",""),a.style.position="fixed",a.style.left="-9999px",document.body.appendChild(a),a.select();const p=document.execCommand("copy");return document.body.removeChild(a),p}catch{return!1}}function Z(r,i){try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})}catch{}}function Oe({selectedSkill:r,onClose:i,activeAgentId:a,telemetryInstallCopyUrl:p=Se,onToast:u}){const[s,v]=c.useState(null),[x,w]=c.useState([]),[J,Q]=c.useState(!1),[ee,te]=c.useState(null),[T,A]=c.useState(!0),[C,V]=c.useState(null),[y,O]=c.useState(null),[k,re]=c.useState("project"),[b,R]=c.useState(null),[_,ne]=c.useState(0),[D,M]=c.useState(!1),U=c.useRef(null),P=c.useRef(null),W=c.useRef(null),K=c.useRef(!1),g=Te(r),se=a===void 0?pe("activeAgent",null):a;c.useEffect(()=>{K.current=D},[D]),c.useEffect(()=>(W.current=document.activeElement??null,()=>{const e=W.current;if(e&&typeof e.focus=="function")try{e.focus()}catch{}}),[]),c.useEffect(()=>{const e=setTimeout(()=>{var n;return(n=P.current)==null?void 0:n.focus()},50);return()=>clearTimeout(e)},[]),c.useEffect(()=>{let e=!1;A(!0),V(null);const n=N(g),d=N(g,"versions");return Promise.all([fetch(n).then(async o=>{if(!o.ok)throw new Error(`metadata ${o.status}`);return o.json()}),fetch(d).then(async o=>{if(!o.ok)throw new Error(`versions ${o.status}`);const l=await o.json(),f=Array.isArray(l)?l:(l==null?void 0:l.versions)??[],h=!Array.isArray(l)&&(l==null?void 0:l.unversioned)===!0,j=!Array.isArray(l)&&typeof(l==null?void 0:l.currentVersion)=="string"?l.currentVersion:null;return{list:f,unversioned:h,currentVersion:j}})]).then(([o,l])=>{if(e)return;v(o),w(l.list),Q(l.unversioned),te(l.currentVersion);const f=l.list.find(h=>h.isLatest)??l.list[0]??null;O(f?f.version:null),A(!1)}).catch(o=>{e||(V(o instanceof Error?o.message:String(o)),A(!1))}),()=>{e=!0}},[g,_]),c.useEffect(()=>{let e=!1;return G.getSkillInstallState(g).then(n=>{e||R(n)},()=>{if(!e){try{const n="vskill:installState:warned";typeof sessionStorage<"u"&&!sessionStorage.getItem(n)&&(sessionStorage.setItem(n,"1"),console.warn("[SkillDetailPanel] install-state fetch failed; falling back to optimistic not-installed UX"))}catch{}R(null)}}),()=>{e=!0}},[g,_]),c.useEffect(()=>{if(typeof window>"u")return;let e=null;const n=d=>{const o=d.detail;!(o!=null&&o.skill)||o.skill!==g||(e&&clearTimeout(e),e=setTimeout(()=>{G.getSkillInstallState(g).then(l=>R(l),()=>{})},50))};return window.addEventListener("studio:skill-installed",n),()=>{e&&clearTimeout(e),window.removeEventListener("studio:skill-installed",n)}},[g]),c.useEffect(()=>{function e(n){if(!(K.current||typeof document<"u"&&document.querySelector("[data-testid='settings-modal'], [data-testid='install-targets-modal'], [data-testid='clipboard-export-dialog']"))){if(n.key==="Escape")n.stopPropagation(),L();else if(n.key==="Tab"){const o=U.current;if(!o)return;const l=o.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;const f=l[0],h=l[l.length-1],j=document.activeElement;n.shiftKey&&j===f?(n.preventDefault(),h.focus()):!n.shiftKey&&j===h&&(n.preventDefault(),f.focus())}}}return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[]);const L=c.useCallback(()=>{i();let e="";try{typeof window<"u"&&window.sessionStorage&&(e=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:e}}))},[i]),S=Ae(s,r),E=(s==null?void 0:s.skillSlug)??r.slug,$=(s==null?void 0:s.displayName)??r.displayName??E,oe=(s==null?void 0:s.isBlocked)===!0,F=c.useMemo(()=>x.length===0?[]:[...x].sort((n,d)=>{const o=n.publishedAt?Date.parse(n.publishedAt):0;return(d.publishedAt?Date.parse(d.publishedAt):0)-o}).slice(0,5),[x]),B=c.useMemo(()=>!y||F.length===0?!0:F[0].version===y,[y,F]),m=c.useMemo(()=>y?De(S,E,B?null:y,k):null,[S,E,y,B,k]);c.useCallback(async()=>{if(!m||!m.ok)return;const e=await Y(m.command);Z(p,{skillName:g,version:y??"",q:"",ts:Date.now()});const n=e?`Run ${m.command} in your terminal`:"Copy failed — please copy the command manually.";if(u)try{u(n,e?"success":"error")}catch{}else I(n,e?"success":"error",3500)},[m,p,g,y,S,E,B,u]);const le=c.useCallback(()=>{!m||!m.ok||M(!0)},[m]),ie=c.useCallback(e=>{const n=e.filter(f=>f.status==="error");if(n.length>0){const f=n[0],h=`Install finished with ${n.length} error${n.length===1?"":"s"}: ${f.detail??f.agentId}`;if(u)try{u(h,"error")}catch{}else I(h,"error",0);return}const d=e.filter(f=>f.status==="installed").length,o=e.filter(f=>f.status==="exported").length;if(d===0&&o===0){const f="Install finished without writing any selected target. Check the selected tool and try again.";if(u)try{u(f,"error")}catch{}else I(f,"error",0);return}if(typeof window<"u")try{window.dispatchEvent(new CustomEvent("studio:skill-installed",{detail:{skill:`${S}/${E}`,scope:k}}))}catch{}const l=o>0?`Installed ${$}; ${o} target${o===1?"":"s"} need paste.`:`Installed ${$} to ${d} target${d===1?"":"s"}.`;if(u)try{u(l,"success")}catch{}else I(l,"success",5e3)},[S,E,k,$,u]),ae=(s==null?void 0:s.trustTier)??"T1",de=(s==null?void 0:s.certTier)==="CERTIFIED"||(s==null?void 0:s.certTier)==="VERIFIED"?s.certTier:"VERIFIED";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:U,"data-testid":"skill-detail-panel",role:"dialog","aria-modal":"true","aria-label":`Skill detail — ${$}`,style:{position:"fixed",inset:0,zIndex:9998,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(10vh, 80px)"},onClick:e=>{e.target===e.currentTarget&&L()},children:[t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{onClick:e=>e.stopPropagation(),style:{position:"relative",width:"100%",maxWidth:720,margin:"0 1rem",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:"8px",border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 20px 60px rgba(0,0,0,0.15)",overflow:"hidden",maxHeight:"80vh",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--color-rule, #E8E1D6)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[t.jsx("button",{ref:P,type:"button",onClick:L,"data-testid":"skill-detail-back",style:{background:"transparent",border:"none",padding:"4px 8px",borderRadius:4,cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary, #5A5651)"},children:"← Back to results"}),t.jsx("kbd",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11,color:"var(--text-secondary, #5A5651)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:4,padding:"1px 5px"},children:"Esc"})]}),t.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[T&&t.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-secondary, #5A5651)"},children:"Loading…"}),C&&!T&&t.jsxs("div",{"data-testid":"skill-detail-error",style:{padding:"1.5rem",textAlign:"center",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",color:"var(--red, #b54444)"},children:[t.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",C]}),t.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>ne(e=>e+1),style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",padding:"0.4rem 1rem",borderRadius:4,border:"1px solid var(--color-rule, #E8E1D6)",background:"transparent",color:"var(--text-primary, #191919)",cursor:"pointer"},children:"Retry"})]}),!T&&!C&&t.jsxs(t.Fragment,{children:[t.jsxs("section",{"data-testid":"skill-detail-hero",style:{marginBottom:"1.25rem"},children:[t.jsx("h2",{style:{margin:"0 0 0.5rem",fontSize:"1.25rem",fontWeight:600},children:$}),(s==null?void 0:s.description)&&t.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary, #5A5651)",fontSize:"0.875rem",lineHeight:1.5},children:s.description}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[t.jsx(he,{tier:ae}),t.jsx(me,{tier:de,isTainted:s==null?void 0:s.isTainted}),t.jsx(ve,{repoUrl:(s==null?void 0:s.repoUrl)??null}),t.jsx(je,{skillName:g,repoUrl:s==null?void 0:s.repoUrl})]})]}),t.jsxs("section",{"data-testid":"skill-detail-versions",style:{marginBottom:"1.25rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-secondary, #5A5651)"},children:"Versions"}),F.length===0?J?t.jsxs("div",{"data-testid":"skill-detail-unversioned",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:["Discovered — no published version yet (currentVersion: ",ee??"unknown",")."]}):t.jsx("div",{"data-testid":"skill-detail-no-versions",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:"No versions found."}):t.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:F.map(e=>{const n=e.version===y,d=e.publishedAt?e.publishedAt.slice(0,10):"",o=e.authorEmail??e.author??"";return t.jsx("li",{children:t.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":e.version,"data-selected":n?"true":"false","aria-pressed":n,onClick:()=>O(e.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:n?"1px solid var(--color-action, #2F5B8E)":"1px solid var(--color-rule, #E8E1D6)",background:n?"color-mix(in srgb, var(--color-action, #2F5B8E) 8%, transparent)":"transparent",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",color:"var(--text-primary, #191919)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[t.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:n?"●":"○"}),t.jsxs("span",{style:{fontWeight:600},children:["v",e.version]}),d&&t.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",d]}),o&&t.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",o]}),n&&t.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--color-action, #2F5B8E)"},children:"Selected"})]})},e.version)})}),t.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:t.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${Ie}/skills/${r.owner}/${r.repo}/${r.slug}/versions`,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--color-action, #2F5B8E)",textDecoration:"none"},children:"see all versions →"})})]}),oe?t.jsxs("section",{"data-testid":"skill-detail-blocked",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--red, #b54444)"},children:"This skill is blocked"}),t.jsx("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--red, #b54444)",background:"var(--red-muted, color-mix(in srgb, #b54444 18%, transparent))",color:"var(--red, #b54444)",fontSize:"0.875rem"},children:(s==null?void 0:s.blockReason)??"This skill has been blocked by platform moderators and cannot be installed."})]}):m&&!m.ok?t.jsxs("section",{"data-testid":"skill-detail-install-error",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--red, #b54444)"},children:"Install command unavailable"}),t.jsxs("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--red, #b54444)",background:"var(--red-muted, color-mix(in srgb, #b54444 18%, transparent))",color:"var(--red, #b54444)",fontSize:"0.875rem"},children:[m.reason," — refusing to render the install panel for safety."]})]}):m&&m.ok?t.jsxs("section",{"data-testid":"skill-detail-install",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-secondary, #5A5651)"},children:"Install"}),t.jsxs("div",{role:"radiogroup","aria-label":"Install scope","data-testid":"skill-detail-install-scope",style:{display:"flex",gap:"0.5rem",alignItems:"center",marginBottom:"0.75rem",fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--text-secondary, #5A5651)"},children:[t.jsx("span",{children:"Scope:"}),["project","user"].map(e=>{var H;const n=k===e,d=(H=b==null?void 0:b.scopes)==null?void 0:H[e],o=(d==null?void 0:d.installed)===!0,l=(b==null?void 0:b.detectedAgentTools)??[],f=l.map(z=>`./${z.localDir}`).join(", "),h=l.map(z=>z.globalDir).join(", "),j=(d==null?void 0:d.installedAgentTools)??[],ce=d!=null&&d.version?`Installed v${d.version} · ${j.join(", ")}`:`Installed · ${j.join(", ")}`,ue=e==="project"?f?`Will install to: ${f}`:"Install with --scope project":h?`Will install to: ${h}`:"Install with --global",fe=o?ce:ue,q=Re(e);return t.jsx("button",{type:"button",role:"radio","aria-checked":n,"aria-disabled":o,disabled:o,"data-testid":`skill-detail-install-scope-${e}`,"data-installed":o?"true":"false",title:fe,onClick:()=>{o||re(e)},style:{padding:"0.25rem 0.6rem",borderRadius:4,border:`1px solid ${n?"var(--text-primary, #191919)":"var(--color-rule, #E8E1D6)"}`,background:n?"var(--text-primary, #191919)":"transparent",color:n?"var(--bg-surface, #FFFFFF)":"var(--text-secondary, #5A5651)",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",fontWeight:n?600:400},children:o?`Installed ✓ ${q}`:q},e)})]}),(()=>{var l;const e=(l=b==null?void 0:b.scopes)==null?void 0:l[k],n=(e==null?void 0:e.installed)===!0,d=e!=null&&e.version?` (v${e.version})`:"",o=`Already installed at ${k} — re-run via CLI to force`;return t.jsx("button",{type:"button",onClick:le,disabled:n,"aria-disabled":n,"data-testid":"skill-detail-install-primary","data-installed":n?"true":"false","aria-label":n?"Already installed at the selected scope":"Install skill",title:n?o:void 0,style:{display:"inline-flex",alignItems:"center",marginBottom:"0.75rem",padding:"0.5rem 1rem",borderRadius:6,border:"1px solid var(--text-primary, #191919)",background:n?"var(--bg-surface, #FFFFFF)":"var(--text-primary, #191919)",color:n?"var(--text-secondary, #5A5651)":"var(--bg-surface, #FFFFFF)",cursor:n?"not-allowed":"pointer",opacity:n?.7:1,fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",fontWeight:600},children:n?`✓ Installed${d}`:"Install"})})(),t.jsx("div",{"data-testid":"skill-detail-install-command",style:{display:"block"},children:t.jsx(we,{compact:!0,children:m.variants.map((e,n)=>t.jsxs("div",{"data-testid":`skill-detail-install-variant-${e.label}`,style:{display:"flex",gap:"0.75rem",alignItems:"flex-start",marginTop:n===0?0:"0.75rem"},children:[t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{color:"#8B949E",marginBottom:"0.125rem"},children:e.comment}),t.jsxs("div",{children:[t.jsx("span",{style:{color:"#8B949E",marginRight:"0.5rem"},children:"$"}),t.jsx("span",{"data-testid":`skill-detail-install-variant-cmd-${e.label}`,children:e.command})]})]}),t.jsx("button",{type:"button",onClick:async()=>{const d=await Y(e.command),o=d?`Run ${e.command} in your terminal`:"Copy failed — please copy the command manually.";if(u)try{u(o,d?"success":"error")}catch{}else I(o,d?"success":"error",3500);d&&Z(p,{skillName:g,version:y??"",q:"",ts:Date.now()})},"data-testid":`skill-detail-copy-${e.label}`,"aria-label":`Copy ${e.label} install command`,style:{flexShrink:0,padding:"0.25rem 0.6rem",borderRadius:4,border:"1px solid color-mix(in srgb, #E6EDF3 25%, transparent)",background:"color-mix(in srgb, #E6EDF3 8%, transparent)",color:"#E6EDF3",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.7rem",alignSelf:"flex-end"},children:"Copy"})]},e.label))})})]}):null]})]})]})]}),D&&t.jsx(ge,{skill:`${S}/${E}`,skillDisplayName:$,scope:k,targetVersion:y,activeAgentId:se,onClose:()=>M(!1),onSuccess:ie})]})}export{Oe as SkillDetailPanel,Oe as default};
1
+ import{j as t,r as c}from"./globals-hm1COkXX.js";import{g as pe,a as G,T as me,I as ge}from"./main-sUAgJ9SV.js";import{s as N}from"./skill-url-C4ekwoGs.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */const X={T0:{label:"BLOCKED",cssVar:"var(--trust-t0)"},T1:{label:"UNSCANNED",cssVar:"var(--trust-t1)"},T2:{label:"BASIC",cssVar:"var(--trust-t2)"},T3:{label:"VERIFIED",cssVar:"var(--trust-t3)"},T4:{label:"CERTIFIED",cssVar:"var(--trust-t4)"}};function he({tier:r}){const i=X[r]??X.T1;return t.jsxs("span",{"data-testid":"trust-badge","data-tier":r,style:{display:"inline-flex",alignItems:"center",gap:"0.3rem",padding:"0.15rem 0.5rem",borderRadius:"4px",fontFamily:"var(--font-geist-mono)",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.03em",textTransform:"uppercase",whiteSpace:"nowrap",color:i.cssVar,backgroundColor:`color-mix(in srgb, ${i.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${i.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[r," ",i.label]})}const ye=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function xe(r){var v,x;const a=r.trim().match(ye);if(!a)return null;const p=(v=a[1])==null?void 0:v.toLowerCase();let u=(x=a[2])==null?void 0:x.toLowerCase();if(!p||!u)return null;u=u.replace(/\.git$/,"");const s=`https://github.com/${p}/${u}`;return{owner:p,name:u,url:s}}function ve({repoUrl:r,mono:i="var(--font-geist-mono)",fontSize:a="0.75rem",showPlaceholder:p=!0}){if(!r)return p?t.jsx("span",{style:{color:"var(--text-faint)",fontSize:a},children:"--"}):null;const u=xe(r);return u?t.jsxs("a",{"data-testid":"repo-link",href:u.url,target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:a,fontFamily:i},children:[u.owner,"/",u.name]}):t.jsx("span",{style:{color:"var(--text-faint)",fontSize:a,fontFamily:i},children:r})}const be="var(--font-geist-mono)",ke={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},Ee={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function je({skillName:r,repoUrl:i}){const[a,p]=c.useState(null),[u,s]=c.useState(!1);if(c.useEffect(()=>{i&&(s(!0),fetch(N(r,"repo-health")).then(w=>{if(!w.ok)throw new Error("fetch failed");return w.json()}).then(w=>{p(w.status),s(!1)}).catch(()=>{p(null),s(!1)}))},[r,i]),!i)return null;if(u)return t.jsx("span",{"data-testid":"repo-health-loading",style:{display:"inline-block",width:56,height:20,borderRadius:"4px",backgroundColor:"color-mix(in srgb, var(--text-faint) 20%, transparent)",animation:"pulse 1.5s ease-in-out infinite"}});if(!a||a==="UNKNOWN")return null;const v=ke[a]??"var(--status-neutral-text)",x=Ee[a]??"var(--status-neutral-bg)";return t.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:be,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:v,whiteSpace:"nowrap"},children:a})}function we({children:r,compact:i}){return t.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code, #161B22)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:i?"0.8rem":"0.875rem",lineHeight:1.6,padding:i?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:r})}const Se="/api/v1/studio/telemetry/install-copy",$e=/^[a-zA-Z0-9._@/-]+$/,Fe=/^[a-zA-Z0-9._-]+$/,Ie="https://verified-skill.com";function Te(r){return`${r.owner}/${r.repo}/${r.slug}`}function Ae(r,i){return r!=null&&r.ownerSlug&&(r!=null&&r.repoSlug)?`${r.ownerSlug}/${r.repoSlug}`:r!=null&&r.publisher?r.publisher:`${i.owner}/${i.repo}`}function Ce(r){return r==="user"?" --global":` --scope ${r}`}function Re(r){return r==="user"?"User":"Project"}function De(r,i,a,p){const u=a?`${r}/${i}@${a}`:`${r}/${i}`;if(!$e.test(`${r}/${i}`))return{ok:!1,reason:"Invalid skill identifier"};if(a&&!Fe.test(a))return{ok:!1,reason:"Invalid version identifier"};const s=Ce(p),v=`npx vskill@latest install ${u}${s}`,x=[{label:"npm",comment:"# npm",command:v},{label:"bun",comment:"# bun",command:`bunx vskill@latest install ${u}${s}`},{label:"pnpm",comment:"# pnpm",command:`pnpx vskill@latest install ${u}${s}`},{label:"yarn",comment:"# yarn",command:`yarn dlx vskill@latest install ${u}${s}`},{label:"alternative",comment:"# alternative (publisher + --skill flag)",command:a?`npx vskill@latest install ${r}@${a} --skill ${i}${s}`:`npx vskill@latest install ${r} --skill ${i}${s}`}];return{ok:!0,command:v,variants:x}}function I(r,i,a){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:r,kind:i,durationMs:a,severity:i==="error"?"error":"info"}}))}async function Y(r){var i;if(typeof navigator<"u"&&((i=navigator.clipboard)!=null&&i.writeText))try{return await navigator.clipboard.writeText(r),!0}catch{}if(typeof document>"u")return!1;try{const a=document.createElement("textarea");a.value=r,a.setAttribute("readonly",""),a.style.position="fixed",a.style.left="-9999px",document.body.appendChild(a),a.select();const p=document.execCommand("copy");return document.body.removeChild(a),p}catch{return!1}}function Z(r,i){try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})}catch{}}function Oe({selectedSkill:r,onClose:i,activeAgentId:a,telemetryInstallCopyUrl:p=Se,onToast:u}){const[s,v]=c.useState(null),[x,w]=c.useState([]),[J,Q]=c.useState(!1),[ee,te]=c.useState(null),[T,A]=c.useState(!0),[C,V]=c.useState(null),[y,O]=c.useState(null),[k,re]=c.useState("project"),[b,R]=c.useState(null),[_,ne]=c.useState(0),[D,M]=c.useState(!1),U=c.useRef(null),P=c.useRef(null),W=c.useRef(null),K=c.useRef(!1),g=Te(r),se=a===void 0?pe("activeAgent",null):a;c.useEffect(()=>{K.current=D},[D]),c.useEffect(()=>(W.current=document.activeElement??null,()=>{const e=W.current;if(e&&typeof e.focus=="function")try{e.focus()}catch{}}),[]),c.useEffect(()=>{const e=setTimeout(()=>{var n;return(n=P.current)==null?void 0:n.focus()},50);return()=>clearTimeout(e)},[]),c.useEffect(()=>{let e=!1;A(!0),V(null);const n=N(g),d=N(g,"versions");return Promise.all([fetch(n).then(async o=>{if(!o.ok)throw new Error(`metadata ${o.status}`);return o.json()}),fetch(d).then(async o=>{if(!o.ok)throw new Error(`versions ${o.status}`);const l=await o.json(),f=Array.isArray(l)?l:(l==null?void 0:l.versions)??[],h=!Array.isArray(l)&&(l==null?void 0:l.unversioned)===!0,j=!Array.isArray(l)&&typeof(l==null?void 0:l.currentVersion)=="string"?l.currentVersion:null;return{list:f,unversioned:h,currentVersion:j}})]).then(([o,l])=>{if(e)return;v(o),w(l.list),Q(l.unversioned),te(l.currentVersion);const f=l.list.find(h=>h.isLatest)??l.list[0]??null;O(f?f.version:null),A(!1)}).catch(o=>{e||(V(o instanceof Error?o.message:String(o)),A(!1))}),()=>{e=!0}},[g,_]),c.useEffect(()=>{let e=!1;return G.getSkillInstallState(g).then(n=>{e||R(n)},()=>{if(!e){try{const n="vskill:installState:warned";typeof sessionStorage<"u"&&!sessionStorage.getItem(n)&&(sessionStorage.setItem(n,"1"),console.warn("[SkillDetailPanel] install-state fetch failed; falling back to optimistic not-installed UX"))}catch{}R(null)}}),()=>{e=!0}},[g,_]),c.useEffect(()=>{if(typeof window>"u")return;let e=null;const n=d=>{const o=d.detail;!(o!=null&&o.skill)||o.skill!==g||(e&&clearTimeout(e),e=setTimeout(()=>{G.getSkillInstallState(g).then(l=>R(l),()=>{})},50))};return window.addEventListener("studio:skill-installed",n),()=>{e&&clearTimeout(e),window.removeEventListener("studio:skill-installed",n)}},[g]),c.useEffect(()=>{function e(n){if(!(K.current||typeof document<"u"&&document.querySelector("[data-testid='settings-modal'], [data-testid='install-targets-modal'], [data-testid='clipboard-export-dialog']"))){if(n.key==="Escape")n.stopPropagation(),L();else if(n.key==="Tab"){const o=U.current;if(!o)return;const l=o.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;const f=l[0],h=l[l.length-1],j=document.activeElement;n.shiftKey&&j===f?(n.preventDefault(),h.focus()):!n.shiftKey&&j===h&&(n.preventDefault(),f.focus())}}}return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[]);const L=c.useCallback(()=>{i();let e="";try{typeof window<"u"&&window.sessionStorage&&(e=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:e}}))},[i]),S=Ae(s,r),E=(s==null?void 0:s.skillSlug)??r.slug,$=(s==null?void 0:s.displayName)??r.displayName??E,oe=(s==null?void 0:s.isBlocked)===!0,F=c.useMemo(()=>x.length===0?[]:[...x].sort((n,d)=>{const o=n.publishedAt?Date.parse(n.publishedAt):0;return(d.publishedAt?Date.parse(d.publishedAt):0)-o}).slice(0,5),[x]),B=c.useMemo(()=>!y||F.length===0?!0:F[0].version===y,[y,F]),m=c.useMemo(()=>y?De(S,E,B?null:y,k):null,[S,E,y,B,k]);c.useCallback(async()=>{if(!m||!m.ok)return;const e=await Y(m.command);Z(p,{skillName:g,version:y??"",q:"",ts:Date.now()});const n=e?`Run ${m.command} in your terminal`:"Copy failed — please copy the command manually.";if(u)try{u(n,e?"success":"error")}catch{}else I(n,e?"success":"error",3500)},[m,p,g,y,S,E,B,u]);const le=c.useCallback(()=>{!m||!m.ok||M(!0)},[m]),ie=c.useCallback(e=>{const n=e.filter(f=>f.status==="error");if(n.length>0){const f=n[0],h=`Install finished with ${n.length} error${n.length===1?"":"s"}: ${f.detail??f.agentId}`;if(u)try{u(h,"error")}catch{}else I(h,"error",0);return}const d=e.filter(f=>f.status==="installed").length,o=e.filter(f=>f.status==="exported").length;if(d===0&&o===0){const f="Install finished without writing any selected target. Check the selected tool and try again.";if(u)try{u(f,"error")}catch{}else I(f,"error",0);return}if(typeof window<"u")try{window.dispatchEvent(new CustomEvent("studio:skill-installed",{detail:{skill:`${S}/${E}`,scope:k}}))}catch{}const l=o>0?`Installed ${$}; ${o} target${o===1?"":"s"} need paste.`:`Installed ${$} to ${d} target${d===1?"":"s"}.`;if(u)try{u(l,"success")}catch{}else I(l,"success",5e3)},[S,E,k,$,u]),ae=(s==null?void 0:s.trustTier)??"T1",de=(s==null?void 0:s.certTier)==="CERTIFIED"||(s==null?void 0:s.certTier)==="VERIFIED"?s.certTier:"VERIFIED";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:U,"data-testid":"skill-detail-panel",role:"dialog","aria-modal":"true","aria-label":`Skill detail — ${$}`,style:{position:"fixed",inset:0,zIndex:9998,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(10vh, 80px)"},onClick:e=>{e.target===e.currentTarget&&L()},children:[t.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{onClick:e=>e.stopPropagation(),style:{position:"relative",width:"100%",maxWidth:720,margin:"0 1rem",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:"8px",border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 20px 60px rgba(0,0,0,0.15)",overflow:"hidden",maxHeight:"80vh",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--color-rule, #E8E1D6)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[t.jsx("button",{ref:P,type:"button",onClick:L,"data-testid":"skill-detail-back",style:{background:"transparent",border:"none",padding:"4px 8px",borderRadius:4,cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary, #5A5651)"},children:"← Back to results"}),t.jsx("kbd",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11,color:"var(--text-secondary, #5A5651)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:4,padding:"1px 5px"},children:"Esc"})]}),t.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[T&&t.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-secondary, #5A5651)"},children:"Loading…"}),C&&!T&&t.jsxs("div",{"data-testid":"skill-detail-error",style:{padding:"1.5rem",textAlign:"center",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",color:"var(--red, #b54444)"},children:[t.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",C]}),t.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>ne(e=>e+1),style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",padding:"0.4rem 1rem",borderRadius:4,border:"1px solid var(--color-rule, #E8E1D6)",background:"transparent",color:"var(--text-primary, #191919)",cursor:"pointer"},children:"Retry"})]}),!T&&!C&&t.jsxs(t.Fragment,{children:[t.jsxs("section",{"data-testid":"skill-detail-hero",style:{marginBottom:"1.25rem"},children:[t.jsx("h2",{style:{margin:"0 0 0.5rem",fontSize:"1.25rem",fontWeight:600},children:$}),(s==null?void 0:s.description)&&t.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary, #5A5651)",fontSize:"0.875rem",lineHeight:1.5},children:s.description}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[t.jsx(he,{tier:ae}),t.jsx(me,{tier:de,isTainted:s==null?void 0:s.isTainted}),t.jsx(ve,{repoUrl:(s==null?void 0:s.repoUrl)??null}),t.jsx(je,{skillName:g,repoUrl:s==null?void 0:s.repoUrl})]})]}),t.jsxs("section",{"data-testid":"skill-detail-versions",style:{marginBottom:"1.25rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-secondary, #5A5651)"},children:"Versions"}),F.length===0?J?t.jsxs("div",{"data-testid":"skill-detail-unversioned",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:["Discovered — no published version yet (currentVersion: ",ee??"unknown",")."]}):t.jsx("div",{"data-testid":"skill-detail-no-versions",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:"No versions found."}):t.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:F.map(e=>{const n=e.version===y,d=e.publishedAt?e.publishedAt.slice(0,10):"",o=e.authorEmail??e.author??"";return t.jsx("li",{children:t.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":e.version,"data-selected":n?"true":"false","aria-pressed":n,onClick:()=>O(e.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:n?"1px solid var(--color-action, #2F5B8E)":"1px solid var(--color-rule, #E8E1D6)",background:n?"color-mix(in srgb, var(--color-action, #2F5B8E) 8%, transparent)":"transparent",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",color:"var(--text-primary, #191919)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[t.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:n?"●":"○"}),t.jsxs("span",{style:{fontWeight:600},children:["v",e.version]}),d&&t.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",d]}),o&&t.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",o]}),n&&t.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--color-action, #2F5B8E)"},children:"Selected"})]})},e.version)})}),t.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:t.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${Ie}/skills/${r.owner}/${r.repo}/${r.slug}/versions`,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--color-action, #2F5B8E)",textDecoration:"none"},children:"see all versions →"})})]}),oe?t.jsxs("section",{"data-testid":"skill-detail-blocked",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--red, #b54444)"},children:"This skill is blocked"}),t.jsx("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--red, #b54444)",background:"var(--red-muted, color-mix(in srgb, #b54444 18%, transparent))",color:"var(--red, #b54444)",fontSize:"0.875rem"},children:(s==null?void 0:s.blockReason)??"This skill has been blocked by platform moderators and cannot be installed."})]}):m&&!m.ok?t.jsxs("section",{"data-testid":"skill-detail-install-error",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--red, #b54444)"},children:"Install command unavailable"}),t.jsxs("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--red, #b54444)",background:"var(--red-muted, color-mix(in srgb, #b54444 18%, transparent))",color:"var(--red, #b54444)",fontSize:"0.875rem"},children:[m.reason," — refusing to render the install panel for safety."]})]}):m&&m.ok?t.jsxs("section",{"data-testid":"skill-detail-install",style:{marginBottom:"0.5rem"},children:[t.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-secondary, #5A5651)"},children:"Install"}),t.jsxs("div",{role:"radiogroup","aria-label":"Install scope","data-testid":"skill-detail-install-scope",style:{display:"flex",gap:"0.5rem",alignItems:"center",marginBottom:"0.75rem",fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--text-secondary, #5A5651)"},children:[t.jsx("span",{children:"Scope:"}),["project","user"].map(e=>{var H;const n=k===e,d=(H=b==null?void 0:b.scopes)==null?void 0:H[e],o=(d==null?void 0:d.installed)===!0,l=(b==null?void 0:b.detectedAgentTools)??[],f=l.map(z=>`./${z.localDir}`).join(", "),h=l.map(z=>z.globalDir).join(", "),j=(d==null?void 0:d.installedAgentTools)??[],ce=d!=null&&d.version?`Installed v${d.version} · ${j.join(", ")}`:`Installed · ${j.join(", ")}`,ue=e==="project"?f?`Will install to: ${f}`:"Install with --scope project":h?`Will install to: ${h}`:"Install with --global",fe=o?ce:ue,q=Re(e);return t.jsx("button",{type:"button",role:"radio","aria-checked":n,"aria-disabled":o,disabled:o,"data-testid":`skill-detail-install-scope-${e}`,"data-installed":o?"true":"false",title:fe,onClick:()=>{o||re(e)},style:{padding:"0.25rem 0.6rem",borderRadius:4,border:`1px solid ${n?"var(--text-primary, #191919)":"var(--color-rule, #E8E1D6)"}`,background:n?"var(--text-primary, #191919)":"transparent",color:n?"var(--bg-surface, #FFFFFF)":"var(--text-secondary, #5A5651)",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",fontWeight:n?600:400},children:o?`Installed ✓ ${q}`:q},e)})]}),(()=>{var l;const e=(l=b==null?void 0:b.scopes)==null?void 0:l[k],n=(e==null?void 0:e.installed)===!0,d=e!=null&&e.version?` (v${e.version})`:"",o=`Already installed at ${k} — re-run via CLI to force`;return t.jsx("button",{type:"button",onClick:le,disabled:n,"aria-disabled":n,"data-testid":"skill-detail-install-primary","data-installed":n?"true":"false","aria-label":n?"Already installed at the selected scope":"Install skill",title:n?o:void 0,style:{display:"inline-flex",alignItems:"center",marginBottom:"0.75rem",padding:"0.5rem 1rem",borderRadius:6,border:"1px solid var(--text-primary, #191919)",background:n?"var(--bg-surface, #FFFFFF)":"var(--text-primary, #191919)",color:n?"var(--text-secondary, #5A5651)":"var(--bg-surface, #FFFFFF)",cursor:n?"not-allowed":"pointer",opacity:n?.7:1,fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",fontWeight:600},children:n?`✓ Installed${d}`:"Install"})})(),t.jsx("div",{"data-testid":"skill-detail-install-command",style:{display:"block"},children:t.jsx(we,{compact:!0,children:m.variants.map((e,n)=>t.jsxs("div",{"data-testid":`skill-detail-install-variant-${e.label}`,style:{display:"flex",gap:"0.75rem",alignItems:"flex-start",marginTop:n===0?0:"0.75rem"},children:[t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{color:"#8B949E",marginBottom:"0.125rem"},children:e.comment}),t.jsxs("div",{children:[t.jsx("span",{style:{color:"#8B949E",marginRight:"0.5rem"},children:"$"}),t.jsx("span",{"data-testid":`skill-detail-install-variant-cmd-${e.label}`,children:e.command})]})]}),t.jsx("button",{type:"button",onClick:async()=>{const d=await Y(e.command),o=d?`Run ${e.command} in your terminal`:"Copy failed — please copy the command manually.";if(u)try{u(o,d?"success":"error")}catch{}else I(o,d?"success":"error",3500);d&&Z(p,{skillName:g,version:y??"",q:"",ts:Date.now()})},"data-testid":`skill-detail-copy-${e.label}`,"aria-label":`Copy ${e.label} install command`,style:{flexShrink:0,padding:"0.25rem 0.6rem",borderRadius:4,border:"1px solid color-mix(in srgb, #E6EDF3 25%, transparent)",background:"color-mix(in srgb, #E6EDF3 8%, transparent)",color:"#E6EDF3",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.7rem",alignSelf:"flex-end"},children:"Copy"})]},e.label))})})]}):null]})]})]})]}),D&&t.jsx(ge,{skill:`${S}/${E}`,skillDisplayName:$,scope:k,targetVersion:y,activeAgentId:se,onClose:()=>M(!1),onSuccess:ie})]})}export{Oe as SkillDetailPanel,Oe as default};
@@ -1 +1 @@
1
- import{r as v,j as a}from"./globals-hm1COkXX.js";import{f as N,b as E,a as L}from"./main-tpOyw9SC.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */function M(l,d){const[c,u]=l.split("."),[w,f]=d.split("."),r=Number(c),m=Number(u),p=Number(w),y=Number(f);return!Number.isFinite(r)||!Number.isFinite(p)?(console.warn(`[semverBump] unparseable version: installed=${l} latest=${d}`),"patch"):p>r?"major":!Number.isFinite(m)||!Number.isFinite(y)?(console.warn(`[semverBump] unparseable minor: installed=${l} latest=${d}`),"patch"):y>m?"minor":"patch"}const F={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}},z=["project","personal","plugin"];function D(l,d={}){if(l.length===0)return"No tracked install — click to view details";const c=l.filter(n=>!n.readonly),u=l.filter(n=>n.readonly);if(c.length===0)return"Plugin-bundled — Update via plugin to refresh";const f=z.filter(n=>c.some(x=>x.scope===n)).join(" + "),m=Array.from(new Set(c.map(n=>n.agentLabel))).sort((n,x)=>n.localeCompare(x)).join(", "),p=c.length;let i=`Updates ${p} ${p===1?"location":"locations"}: ${f} (${m})`;if(d.pinned)return i+=" — pinned (skipped)",i;if(u.length>0){const n=Array.from(new Set(u.map(x=>x.pluginSlug??"?")));n.length===1&&n[0]!=="?"?i+=` — ${u.length} from plugin ${n[0]} (handled separately)`:i+=` — ${u.length} plugin-bundled (handled separately)`}return i}function P({updates:l,isRefreshing:d,onRefresh:c,onSelectSkill:u,onViewAll:w,onClose:f,anchorRef:r,diffSummariesById:m}){const p=v.useRef(null),y=v.useRef(null);v.useEffect(()=>{var e;(e=y.current)==null||e.focus()},[]),v.useEffect(()=>{function e(s){p.current&&(p.current.contains(s.target)||r!=null&&r.current&&r.current.contains(s.target)||f())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f,r]),v.useEffect(()=>{function e(s){var g;s.key==="Escape"&&(s.preventDefault(),f(),(g=r==null?void 0:r.current)==null||g.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f,r]);const i=l.filter(e=>e.updateAvailable),{toast:n}=N(),{onSkillUpdated:x}=E(),[j,k]=v.useState(()=>new Set);async function $(e){const s=e.installLocations??[],g=s.filter(t=>!t.readonly);if(s.length>0&&g.length===0){const t=s[0].pluginSlug??"the plugin";n({severity:"info",message:`This skill came from plugin ${t}. Update the plugin to refresh it.`});return}if(!j.has(e.name)){k(t=>{const o=new Set(t);return o.add(e.name),o});try{const t=e.name.split("/"),o=e.localPlugin??(t.length>=2?t[t.length-2]:t[0]),b=e.localSkill??t[t.length-1],h=await L.postSkillUpdate(o,b);if(h.ok){const S=g.length||1,U=S===1?"location":"locations";x(o,b),n({severity:"success",message:`Updated ${b} in ${S} ${U}.`,durationMs:4e3})}else n({severity:"error",message:`Couldn't update ${b} — HTTP ${h.status}`,durationMs:0})}catch(t){const o=t instanceof Error?t.message:"Network error";n({severity:"error",message:`Update failed: ${o}`,durationMs:0})}finally{k(t=>{const o=new Set(t);return o.delete(e.name),o})}}}return a.jsxs("div",{ref:p,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:440,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[a.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:i.length===0?"No updates available":`${i.length} updates available`}),a.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:c,disabled:d,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:d?"not-allowed":"pointer",padding:"2px 6px"},children:d?"Refreshing…":"Refresh"})]}),i.length>0?a.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:i.map((e,s)=>{const g=e.latest?M(e.installed,e.latest):"patch",t=F[g],o=m==null?void 0:m.get(e.name),b=D(e.installLocations??[],{pinned:e.pinned??!1}),h=j.has(e.name);return a.jsxs("li",{style:{margin:0,display:"flex",alignItems:"stretch",gap:4},children:[a.jsxs("button",{ref:s===0?y:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>u(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[a.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":g,style:{width:8,height:8,borderRadius:"50%",background:t.text,flexShrink:0,marginTop:4}}),a.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[a.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),o&&a.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]})]}),a.jsx("button",{type:"button","data-testid":"update-dropdown-row-update","data-skill-name":e.name,title:b,onClick:()=>{$(e)},disabled:h,style:{flexShrink:0,padding:"0 10px",background:"var(--color-ink)",color:"var(--color-paper)",border:"none",borderRadius:4,cursor:h?"not-allowed":"pointer",fontFamily:"var(--font-sans)",fontSize:11,fontWeight:500},children:h?"Updating…":"Update"})]},e.name)})}):a.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:a.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:w,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{P as default};
1
+ import{r as v,j as a}from"./globals-hm1COkXX.js";import{f as N,b as E,a as L}from"./main-sUAgJ9SV.js";import"./useDesktopBridge-9oZFQsrw.js";/* empty css */function M(l,d){const[c,u]=l.split("."),[w,f]=d.split("."),r=Number(c),m=Number(u),p=Number(w),y=Number(f);return!Number.isFinite(r)||!Number.isFinite(p)?(console.warn(`[semverBump] unparseable version: installed=${l} latest=${d}`),"patch"):p>r?"major":!Number.isFinite(m)||!Number.isFinite(y)?(console.warn(`[semverBump] unparseable minor: installed=${l} latest=${d}`),"patch"):y>m?"minor":"patch"}const F={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}},z=["project","personal","plugin"];function D(l,d={}){if(l.length===0)return"No tracked install — click to view details";const c=l.filter(n=>!n.readonly),u=l.filter(n=>n.readonly);if(c.length===0)return"Plugin-bundled — Update via plugin to refresh";const f=z.filter(n=>c.some(x=>x.scope===n)).join(" + "),m=Array.from(new Set(c.map(n=>n.agentLabel))).sort((n,x)=>n.localeCompare(x)).join(", "),p=c.length;let i=`Updates ${p} ${p===1?"location":"locations"}: ${f} (${m})`;if(d.pinned)return i+=" — pinned (skipped)",i;if(u.length>0){const n=Array.from(new Set(u.map(x=>x.pluginSlug??"?")));n.length===1&&n[0]!=="?"?i+=` — ${u.length} from plugin ${n[0]} (handled separately)`:i+=` — ${u.length} plugin-bundled (handled separately)`}return i}function P({updates:l,isRefreshing:d,onRefresh:c,onSelectSkill:u,onViewAll:w,onClose:f,anchorRef:r,diffSummariesById:m}){const p=v.useRef(null),y=v.useRef(null);v.useEffect(()=>{var e;(e=y.current)==null||e.focus()},[]),v.useEffect(()=>{function e(s){p.current&&(p.current.contains(s.target)||r!=null&&r.current&&r.current.contains(s.target)||f())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f,r]),v.useEffect(()=>{function e(s){var g;s.key==="Escape"&&(s.preventDefault(),f(),(g=r==null?void 0:r.current)==null||g.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f,r]);const i=l.filter(e=>e.updateAvailable),{toast:n}=N(),{onSkillUpdated:x}=E(),[j,k]=v.useState(()=>new Set);async function $(e){const s=e.installLocations??[],g=s.filter(t=>!t.readonly);if(s.length>0&&g.length===0){const t=s[0].pluginSlug??"the plugin";n({severity:"info",message:`This skill came from plugin ${t}. Update the plugin to refresh it.`});return}if(!j.has(e.name)){k(t=>{const o=new Set(t);return o.add(e.name),o});try{const t=e.name.split("/"),o=e.localPlugin??(t.length>=2?t[t.length-2]:t[0]),b=e.localSkill??t[t.length-1],h=await L.postSkillUpdate(o,b);if(h.ok){const S=g.length||1,U=S===1?"location":"locations";x(o,b),n({severity:"success",message:`Updated ${b} in ${S} ${U}.`,durationMs:4e3})}else n({severity:"error",message:`Couldn't update ${b} — HTTP ${h.status}`,durationMs:0})}catch(t){const o=t instanceof Error?t.message:"Network error";n({severity:"error",message:`Update failed: ${o}`,durationMs:0})}finally{k(t=>{const o=new Set(t);return o.delete(e.name),o})}}}return a.jsxs("div",{ref:p,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:440,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[a.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:i.length===0?"No updates available":`${i.length} updates available`}),a.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:c,disabled:d,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:d?"not-allowed":"pointer",padding:"2px 6px"},children:d?"Refreshing…":"Refresh"})]}),i.length>0?a.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:i.map((e,s)=>{const g=e.latest?M(e.installed,e.latest):"patch",t=F[g],o=m==null?void 0:m.get(e.name),b=D(e.installLocations??[],{pinned:e.pinned??!1}),h=j.has(e.name);return a.jsxs("li",{style:{margin:0,display:"flex",alignItems:"stretch",gap:4},children:[a.jsxs("button",{ref:s===0?y:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>u(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[a.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":g,style:{width:8,height:8,borderRadius:"50%",background:t.text,flexShrink:0,marginTop:4}}),a.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[a.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),o&&a.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]})]}),a.jsx("button",{type:"button","data-testid":"update-dropdown-row-update","data-skill-name":e.name,title:b,onClick:()=>{$(e)},disabled:h,style:{flexShrink:0,padding:"0 10px",background:"var(--color-ink)",color:"var(--color-paper)",border:"none",borderRadius:4,cursor:h?"not-allowed":"pointer",fontFamily:"var(--font-sans)",fontSize:11,fontWeight:500},children:h?"Updating…":"Update"})]},e.name)})}):a.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:a.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:w,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{P as default};