vskill 0.5.149 → 0.5.150

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.
@@ -46,7 +46,7 @@
46
46
  }
47
47
  })();
48
48
  </script>
49
- <script type="module" crossorigin src="/assets/index-BaSdAiau.js"></script>
49
+ <script type="module" crossorigin src="/assets/index-B--Oo8D0.js"></script>
50
50
  <link rel="stylesheet" crossorigin href="/assets/index-CycZyHaL.css">
51
51
  <link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
52
52
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vskill",
3
- "version": "0.5.149",
3
+ "version": "0.5.150",
4
4
  "type": "module",
5
5
  "description": "Secure multi-platform AI skill installer — scan before you install",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{j as e,r as l,T as M}from"./index-BaSdAiau.js";import{s as C}from"./skill-url-C4ekwoGs.js";/* empty css */const z={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 P({tier:t}){const s=z[t]??z.T1;return e.jsxs("span",{"data-testid":"trust-badge","data-tier":t,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:s.cssVar,backgroundColor:`color-mix(in srgb, ${s.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${s.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[t," ",s.label]})}const W=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function H(t){var g,x;const o=t.trim().match(W);if(!o)return null;const d=(g=o[1])==null?void 0:g.toLowerCase();let r=(x=o[2])==null?void 0:x.toLowerCase();if(!d||!r)return null;r=r.replace(/\.git$/,"");const m=`https://github.com/${d}/${r}`;return{owner:d,name:r,url:m}}function K({repoUrl:t,mono:s="var(--font-geist-mono)",fontSize:o="0.75rem",showPlaceholder:d=!0}){if(!t)return d?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o},children:"--"}):null;const r=H(t);return r?e.jsxs("a",{"data-testid":"repo-link",href:r.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:o,fontFamily:s},children:[r.owner,"/",r.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o,fontFamily:s},children:t})}const q="var(--font-geist-mono)",G={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},Z={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function X({skillName:t,repoUrl:s}){const[o,d]=l.useState(null),[r,m]=l.useState(!1);if(l.useEffect(()=>{s&&(m(!0),fetch(C(t,"repo-health")).then(h=>{if(!h.ok)throw new Error("fetch failed");return h.json()}).then(h=>{d(h.status),m(!1)}).catch(()=>{d(null),m(!1)}))},[t,s]),!s)return null;if(r)return e.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(!o||o==="UNKNOWN")return null;const g=G[o]??"var(--status-neutral-text)",x=Z[o]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:q,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:g,whiteSpace:"nowrap"},children:o})}function Y({children:t,compact:s}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:s?"0.8rem":"0.875rem",lineHeight:1.6,padding:s?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:t})}const J="/api/v1/studio/telemetry/install-copy",Q=/^[a-zA-Z0-9._@/-]+$/,ee=/^[a-zA-Z0-9._-]+$/,te="https://verified-skill.com";function re(t){return`${t.owner}/${t.repo}/${t.slug}`}function ne(t,s){return t!=null&&t.ownerSlug&&(t!=null&&t.repoSlug)?`${t.ownerSlug}/${t.repoSlug}`:t!=null&&t.publisher?t.publisher:`${s.owner}/${s.repo}`}function se(t,s,o){const d=o?`${t}/${s}@${o}`:`${t}/${s}`;return Q.test(`${t}/${s}`)?o&&!ee.test(o)?{ok:!1,reason:"Invalid version identifier"}:{ok:!0,command:`vskill install ${d}`}:{ok:!1,reason:"Invalid skill identifier"}}function oe(t,s,o){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:t,kind:s,durationMs:o,severity:s==="error"?"error":"info"}}))}async function ie(t){var s;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.writeText))try{return await navigator.clipboard.writeText(t),!0}catch{}if(typeof document>"u")return!1;try{const o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.position="fixed",o.style.left="-9999px",document.body.appendChild(o),o.select();const d=document.execCommand("copy");return document.body.removeChild(o),d}catch{return!1}}function ae(t,s){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}catch{}}function ue({selectedSkill:t,onClose:s,telemetryInstallCopyUrl:o=J,onToast:d}){const[r,m]=l.useState(null),[g,x]=l.useState([]),[h,E]=l.useState(!0),[T,$]=l.useState(null),[u,I]=l.useState(null),[D,B]=l.useState(0),F=l.useRef(null),A=l.useRef(null),L=l.useRef(null),y=re(t);l.useEffect(()=>(L.current=document.activeElement??null,()=>{const n=L.current;if(n&&typeof n.focus=="function")try{n.focus()}catch{}}),[]),l.useEffect(()=>{const n=setTimeout(()=>{var i;return(i=A.current)==null?void 0:i.focus()},50);return()=>clearTimeout(n)},[]),l.useEffect(()=>{let n=!1;E(!0),$(null);const i=C(y),p=C(y,"versions");return Promise.all([fetch(i).then(async a=>{if(!a.ok)throw new Error(`metadata ${a.status}`);return a.json()}),fetch(p).then(async a=>{if(!a.ok)throw new Error(`versions ${a.status}`);const c=await a.json();return Array.isArray(c)?c:(c==null?void 0:c.versions)??[]})]).then(([a,c])=>{if(n)return;m(a),x(c);const k=c.find(w=>w.isLatest)??c[0]??null;I(k?k.version:null),E(!1)}).catch(a=>{n||($(a instanceof Error?a.message:String(a)),E(!1))}),()=>{n=!0}},[y,D]),l.useEffect(()=>{function n(i){if(i.key==="Escape")i.stopPropagation(),R();else if(i.key==="Tab"){const p=F.current;if(!p)return;const a=p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(a.length===0)return;const c=a[0],k=a[a.length-1],w=document.activeElement;i.shiftKey&&w===c?(i.preventDefault(),k.focus()):!i.shiftKey&&w===k&&(i.preventDefault(),c.focus())}}return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[]);const R=l.useCallback(()=>{s();let n="";try{typeof window<"u"&&window.sessionStorage&&(n=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:n}}))},[s]),S=ne(r,t),b=(r==null?void 0:r.skillSlug)??t.slug,N=(r==null?void 0:r.displayName)??t.displayName??b,_=(r==null?void 0:r.isBlocked)===!0,v=l.useMemo(()=>g.length===0?[]:[...g].sort((i,p)=>{const a=i.publishedAt?Date.parse(i.publishedAt):0;return(p.publishedAt?Date.parse(p.publishedAt):0)-a}).slice(0,5),[g]),j=l.useMemo(()=>!u||v.length===0?!0:v[0].version===u,[u,v]),f=l.useMemo(()=>u?se(S,b,j?null:u):null,[S,b,u,j]),V=l.useCallback(async()=>{if(!f||!f.ok)return;const n=await ie(f.command);ae(o,{skillName:y,version:u??"",q:"",ts:Date.now()});const i=n?`Run vskill install ${S}/${b}${j?"":`@${u}`} in your terminal`:"Copy failed — please copy the command manually.";if(d)try{d(i,n?"success":"error")}catch{}else oe(i,n?"success":"error",3500)},[f,o,y,u,S,b,j,d]),O=(r==null?void 0:r.trustTier)??"T1",U=(r==null?void 0:r.certTier)==="CERTIFIED"||(r==null?void 0:r.certTier)==="VERIFIED"?r.certTier:"VERIFIED";return e.jsxs("div",{ref:F,"data-testid":"skill-detail-panel",role:"dialog","aria-modal":"true","aria-label":`Skill detail — ${N}`,style:{position:"fixed",inset:0,zIndex:9998,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(10vh, 80px)"},onClick:n=>{n.target===n.currentTarget&&R()},children:[e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"relative",width:"100%",maxWidth:720,margin:"0 1rem",background:"var(--bg)",borderRadius:"8px",border:"1px solid var(--border)",boxShadow:"0 20px 60px rgba(0,0,0,0.15)",overflow:"hidden",maxHeight:"80vh",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[e.jsx("button",{ref:A,type:"button",onClick:R,"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)"},children:"← Back to results"}),e.jsx("kbd",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11,color:"var(--text-faint)",border:"1px solid var(--border)",borderRadius:4,padding:"1px 5px"},children:"Esc"})]}),e.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[h&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-faint)"},children:"Loading…"}),T&&!h&&e.jsxs("div",{"data-testid":"skill-detail-error",style:{padding:"1.5rem",textAlign:"center",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",color:"var(--status-danger-text)"},children:[e.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",T]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>B(n=>n+1),style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",padding:"0.4rem 1rem",borderRadius:4,border:"1px solid var(--border)",background:"transparent",color:"var(--text)",cursor:"pointer"},children:"Retry"})]}),!h&&!T&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{"data-testid":"skill-detail-hero",style:{marginBottom:"1.25rem"},children:[e.jsx("h2",{style:{margin:"0 0 0.5rem",fontSize:"1.25rem",fontWeight:600},children:N}),(r==null?void 0:r.description)&&e.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary)",fontSize:"0.875rem",lineHeight:1.5},children:r.description}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[e.jsx(P,{tier:O}),e.jsx(M,{tier:U,isTainted:r==null?void 0:r.isTainted}),e.jsx(K,{repoUrl:(r==null?void 0:r.repoUrl)??null}),e.jsx(X,{skillName:y,repoUrl:r==null?void 0:r.repoUrl})]})]}),e.jsxs("section",{"data-testid":"skill-detail-versions",style:{marginBottom:"1.25rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Versions"}),v.length===0?e.jsx("div",{style:{color:"var(--text-faint)",fontSize:"0.8125rem"},children:"No versions found."}):e.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:v.map(n=>{const i=n.version===u,p=n.publishedAt?n.publishedAt.slice(0,10):"",a=n.authorEmail??n.author??"";return e.jsx("li",{children:e.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":n.version,"data-selected":i?"true":"false","aria-pressed":i,onClick:()=>I(n.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:i?"1px solid var(--link-accent, #0d9488)":"1px solid var(--border)",background:i?"color-mix(in srgb, var(--link-accent, #0d9488) 8%, transparent)":"transparent",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",color:"var(--text)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:i?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",n.version]}),p&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",p]}),a&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",a]}),i&&e.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--link-accent, #0d9488)"},children:"Selected"})]})},n.version)})}),e.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:e.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${te}/skills/${t.owner}/${t.repo}/${t.slug}/versions`,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--link-accent, #0d9488)",textDecoration:"none"},children:"see all versions →"})})]}),_?e.jsxs("section",{"data-testid":"skill-detail-blocked",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"This skill is blocked"}),e.jsx("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:(r==null?void 0:r.blockReason)??"This skill has been blocked by platform moderators and cannot be installed."})]}):f&&!f.ok?e.jsxs("section",{"data-testid":"skill-detail-install-error",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"Install command unavailable"}),e.jsxs("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:[f.reason," — refusing to render the install panel for safety."]})]}):f&&f.ok?e.jsxs("section",{"data-testid":"skill-detail-install",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Install"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Y,{compact:!0,children:e.jsx("span",{"data-testid":"skill-detail-install-command",children:f.command})})}),e.jsx("button",{type:"button",onClick:V,"data-testid":"skill-detail-copy","aria-label":"Copy install command",style:{flexShrink:0,padding:"0 1rem",borderRadius:6,border:"1px solid var(--border)",background:"var(--bg)",color:"var(--text)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem"},children:"Copy"})]})]}):null]})]})]})]})}export{ue as SkillDetailPanel,ue as default};