vskill 1.0.13 → 1.0.14

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 (31) hide show
  1. package/README.md +2 -2
  2. package/agents.json +1 -1
  3. package/dist/commands/check.d.ts +55 -0
  4. package/dist/commands/check.js +279 -0
  5. package/dist/commands/check.js.map +1 -0
  6. package/dist/core/agent-prompts.d.ts +35 -0
  7. package/dist/core/agent-prompts.js +201 -0
  8. package/dist/core/agent-prompts.js.map +1 -0
  9. package/dist/core/skill-generator.d.ts +25 -3
  10. package/dist/core/skill-generator.js +131 -0
  11. package/dist/core/skill-generator.js.map +1 -1
  12. package/dist/eval-server/api-routes.d.ts +14 -0
  13. package/dist/eval-server/api-routes.js +38 -0
  14. package/dist/eval-server/api-routes.js.map +1 -1
  15. package/dist/eval-server/skill-create-routes.d.ts +8 -0
  16. package/dist/eval-server/skill-create-routes.js +96 -0
  17. package/dist/eval-server/skill-create-routes.js.map +1 -1
  18. package/dist/eval-server/utils/resolve-editor.d.ts +13 -0
  19. package/dist/eval-server/utils/resolve-editor.js +92 -0
  20. package/dist/eval-server/utils/resolve-editor.js.map +1 -0
  21. package/dist/eval-ui/assets/{CreateSkillPage-T0YWZWw-.js → CreateSkillPage-CKvqAya0.js} +1 -1
  22. package/dist/eval-ui/assets/{FindSkillsPalette-KcFM32hZ.js → FindSkillsPalette-B8pTa5NP.js} +2 -2
  23. package/dist/eval-ui/assets/{SearchPaletteCore-EhBtr4Xx.js → SearchPaletteCore-CkVRvaZk.js} +1 -1
  24. package/dist/eval-ui/assets/SkillDetailPanel-d4_LquVH.js +1 -0
  25. package/dist/eval-ui/assets/{UpdateDropdown-pjFhHTi6.js → UpdateDropdown-DA7OktXO.js} +1 -1
  26. package/dist/eval-ui/assets/{index-C3S9iHnq.js → index-DCbohW6l.js} +37 -37
  27. package/dist/eval-ui/index.html +1 -1
  28. package/dist/index.js +8 -0
  29. package/dist/index.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/eval-ui/assets/SkillDetailPanel-cyzLsLcK.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e,r as d,T as te}from"./index-DCbohW6l.js";import{s as D}from"./skill-url-C4ekwoGs.js";/* empty css */const M={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 re({tier:r}){const o=M[r]??M.T1;return e.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:o.cssVar,backgroundColor:`color-mix(in srgb, ${o.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${o.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[r," ",o.label]})}const ne=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function se(r){var g,x;const a=r.trim().match(ne);if(!a)return null;const c=(g=a[1])==null?void 0:g.toLowerCase();let n=(x=a[2])==null?void 0:x.toLowerCase();if(!c||!n)return null;n=n.replace(/\.git$/,"");const m=`https://github.com/${c}/${n}`;return{owner:c,name:n,url:m}}function oe({repoUrl:r,mono:o="var(--font-geist-mono)",fontSize:a="0.75rem",showPlaceholder:c=!0}){if(!r)return c?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a},children:"--"}):null;const n=se(r);return n?e.jsxs("a",{"data-testid":"repo-link",href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:a,fontFamily:o},children:[n.owner,"/",n.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a,fontFamily:o},children:r})}const ae="var(--font-geist-mono)",ie={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},le={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function ce({skillName:r,repoUrl:o}){const[a,c]=d.useState(null),[n,m]=d.useState(!1);if(d.useEffect(()=>{o&&(m(!0),fetch(D(r,"repo-health")).then(k=>{if(!k.ok)throw new Error("fetch failed");return k.json()}).then(k=>{c(k.status),m(!1)}).catch(()=>{c(null),m(!1)}))},[r,o]),!o)return null;if(n)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(!a||a==="UNKNOWN")return null;const g=ie[a]??"var(--status-neutral-text)",x=le[a]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:ae,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:g,whiteSpace:"nowrap"},children:a})}function de({children:r,compact:o}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code, #161B22)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:o?"0.8rem":"0.875rem",lineHeight:1.6,padding:o?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:r})}const ue="/api/v1/studio/telemetry/install-copy",me=/^[a-zA-Z0-9._@/-]+$/,pe=/^[a-zA-Z0-9._-]+$/,fe="https://verified-skill.com";function ye(r){return`${r.owner}/${r.repo}/${r.slug}`}function ge(r,o){return r!=null&&r.ownerSlug&&(r!=null&&r.repoSlug)?`${r.ownerSlug}/${r.repoSlug}`:r!=null&&r.publisher?r.publisher:`${o.owner}/${o.repo}`}function he(r){return r==="global"?" --global":` --scope ${r}`}function xe(r,o,a,c){const n=a?`${r}/${o}@${a}`:`${r}/${o}`;if(!me.test(`${r}/${o}`))return{ok:!1,reason:"Invalid skill identifier"};if(a&&!pe.test(a))return{ok:!1,reason:"Invalid version identifier"};const m=he(c),g=`npx vskill@latest install ${n}${m}`,x=[{label:"npm",comment:"# npm",command:g},{label:"bun",comment:"# bun",command:`bunx vskill@latest install ${n}${m}`},{label:"pnpm",comment:"# pnpm",command:`pnpx vskill@latest install ${n}${m}`},{label:"yarn",comment:"# yarn",command:`yarn dlx vskill@latest install ${n}${m}`},{label:"alternative",comment:"# alternative (publisher + --skill flag)",command:a?`npx vskill@latest install ${r}@${a} --skill ${o}${m}`:`npx vskill@latest install ${r} --skill ${o}${m}`}];return{ok:!0,command:g,variants:x}}function F(r,o,a){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:r,kind:o,durationMs:a,severity:o==="error"?"error":"info"}}))}async function P(r){var o;if(typeof navigator<"u"&&((o=navigator.clipboard)!=null&&o.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 c=document.execCommand("copy");return document.body.removeChild(a),c}catch{return!1}}function W(r,o){try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0}).catch(()=>{})}catch{}}function Ee({selectedSkill:r,onClose:o,telemetryInstallCopyUrl:a=ue,onToast:c}){const[n,m]=d.useState(null),[g,x]=d.useState([]),[k,H]=d.useState(!1),[K,q]=d.useState(null),[T,I]=d.useState(!0),[A,L]=d.useState(null),[h,z]=d.useState(null),[E,G]=d.useState("project"),[Z,J]=d.useState(0),N=d.useRef(null),V=d.useRef(null),O=d.useRef(null),b=ye(r);d.useEffect(()=>(O.current=document.activeElement??null,()=>{const t=O.current;if(t&&typeof t.focus=="function")try{t.focus()}catch{}}),[]),d.useEffect(()=>{const t=setTimeout(()=>{var s;return(s=V.current)==null?void 0:s.focus()},50);return()=>clearTimeout(t)},[]),d.useEffect(()=>{let t=!1;I(!0),L(null);const s=D(b),u=D(b,"versions");return Promise.all([fetch(s).then(async i=>{if(!i.ok)throw new Error(`metadata ${i.status}`);return i.json()}),fetch(u).then(async i=>{if(!i.ok)throw new Error(`versions ${i.status}`);const l=await i.json(),p=Array.isArray(l)?l:(l==null?void 0:l.versions)??[],y=!Array.isArray(l)&&(l==null?void 0:l.unversioned)===!0,v=!Array.isArray(l)&&typeof(l==null?void 0:l.currentVersion)=="string"?l.currentVersion:null;return{list:p,unversioned:y,currentVersion:v}})]).then(([i,l])=>{if(t)return;m(i),x(l.list),H(l.unversioned),q(l.currentVersion);const p=l.list.find(y=>y.isLatest)??l.list[0]??null;z(p?p.version:null),I(!1)}).catch(i=>{t||(L(i instanceof Error?i.message:String(i)),I(!1))}),()=>{t=!0}},[b,Z]),d.useEffect(()=>{function t(s){if(s.key==="Escape")s.stopPropagation(),C();else if(s.key==="Tab"){const u=N.current;if(!u)return;const i=u.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(i.length===0)return;const l=i[0],p=i[i.length-1],y=document.activeElement;s.shiftKey&&y===l?(s.preventDefault(),p.focus()):!s.shiftKey&&y===p&&(s.preventDefault(),l.focus())}}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[]);const C=d.useCallback(()=>{o();let t="";try{typeof window<"u"&&window.sessionStorage&&(t=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:t}}))},[o]),j=ge(n,r),S=(n==null?void 0:n.skillSlug)??r.slug,_=(n==null?void 0:n.displayName)??r.displayName??S,X=(n==null?void 0:n.isBlocked)===!0,w=d.useMemo(()=>g.length===0?[]:[...g].sort((s,u)=>{const i=s.publishedAt?Date.parse(s.publishedAt):0;return(u.publishedAt?Date.parse(u.publishedAt):0)-i}).slice(0,5),[g]),R=d.useMemo(()=>!h||w.length===0?!0:w[0].version===h,[h,w]),f=d.useMemo(()=>h?xe(j,S,R?null:h,E):null,[j,S,h,R,E]),B=d.useCallback(async()=>{if(!f||!f.ok)return;const t=await P(f.command);W(a,{skillName:b,version:h??"",q:"",ts:Date.now()});const s=t?`Run ${f.command} in your terminal`:"Copy failed — please copy the command manually.";if(c)try{c(s,t?"success":"error")}catch{}else F(s,t?"success":"error",3500)},[f,a,b,h,j,S,R,c]),Y=d.useCallback(async()=>{if(!f||!f.ok)return;const t=`${j}/${S}`;if(c)try{c(`Installing ${t}…`,"info")}catch{}else F(`Installing ${t}…`,"info",5e3);let s=null;try{const p=await fetch("/api/studio/install-skill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skill:t,scope:E})});if(p.status===404)return B();if(!p.ok){const $=(await p.json().catch(()=>({}))).error||`Install failed (HTTP ${p.status})`;if(c)try{c($,"error")}catch{}else F($,"error",6e3);return}const y=await p.json();s=(y==null?void 0:y.jobId)??null}catch{return B()}if(!s||typeof EventSource>"u")return;const u=new EventSource(`/api/studio/install-skill/${s}/stream`),l=setTimeout(()=>{try{u.close()}catch{}},2e5);u.addEventListener("done",p=>{var U;clearTimeout(l);try{u.close()}catch{}let y={};try{y=JSON.parse(p.data)}catch{}const v=y.success===!0,$=v?`Installed ${t} (${E})`:`Install failed: ${((U=y.stderr)==null?void 0:U.trim().split(/\r?\n/).slice(-1)[0])||"see terminal"}`;if(c)try{c($,v?"success":"error")}catch{}else F($,v?"success":"error",v?4e3:8e3)}),u.onerror=()=>{clearTimeout(l);try{u.close()}catch{}}},[f,j,S,E,c,B]),Q=(n==null?void 0:n.trustTier)??"T1",ee=(n==null?void 0:n.certTier)==="CERTIFIED"||(n==null?void 0:n.certTier)==="VERIFIED"?n.certTier:"VERIFIED";return e.jsxs("div",{ref:N,"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:t=>{t.target===t.currentTarget&&C()},children:[e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),e.jsxs("div",{onClick:t=>t.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:[e.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--color-rule, #E8E1D6)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[e.jsx("button",{ref:V,type:"button",onClick:C,"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"}),e.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"})]}),e.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[T&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-secondary, #5A5651)"},children:"Loading…"}),A&&!T&&e.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:[e.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",A]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>J(t=>t+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&&!A&&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==null?void 0:n.description)&&e.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary, #5A5651)",fontSize:"0.875rem",lineHeight:1.5},children:n.description}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[e.jsx(re,{tier:Q}),e.jsx(te,{tier:ee,isTainted:n==null?void 0:n.isTainted}),e.jsx(oe,{repoUrl:(n==null?void 0:n.repoUrl)??null}),e.jsx(ce,{skillName:b,repoUrl:n==null?void 0:n.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-secondary, #5A5651)"},children:"Versions"}),w.length===0?k?e.jsxs("div",{"data-testid":"skill-detail-unversioned",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:["Discovered — no published version yet (currentVersion: ",K??"unknown",")."]}):e.jsx("div",{"data-testid":"skill-detail-no-versions",style:{color:"var(--text-secondary, #5A5651)",fontSize:"0.8125rem"},children:"No versions found."}):e.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:w.map(t=>{const s=t.version===h,u=t.publishedAt?t.publishedAt.slice(0,10):"",i=t.authorEmail??t.author??"";return e.jsx("li",{children:e.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":t.version,"data-selected":s?"true":"false","aria-pressed":s,onClick:()=>z(t.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:s?"1px solid var(--color-action, #2F5B8E)":"1px solid var(--color-rule, #E8E1D6)",background:s?"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:[e.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:s?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",t.version]}),u&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",u]}),i&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",i]}),s&&e.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--color-action, #2F5B8E)"},children:"Selected"})]})},t.version)})}),e.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:e.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${fe}/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 →"})})]}),X?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(--red, #b54444)"},children:"This skill is blocked"}),e.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:(n==null?void 0:n.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(--red, #b54444)"},children:"Install command unavailable"}),e.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:[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-secondary, #5A5651)"},children:"Install"}),e.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:[e.jsx("span",{children:"Scope:"}),["project","user","global"].map(t=>{const s=E===t,u=t==="project"?"Per-repo .claude/ — only this project":t==="user"?"~/.claude/ — every project on this account":"System agent dirs — every agent on this machine",i=t==="global"?"Global":t==="user"?"User":"Project";return e.jsx("button",{type:"button",role:"radio","aria-checked":s,"data-testid":`skill-detail-install-scope-${t}`,title:u,onClick:()=>G(t),style:{padding:"0.25rem 0.6rem",borderRadius:4,border:`1px solid ${s?"var(--text-primary, #191919)":"var(--color-rule, #E8E1D6)"}`,background:s?"var(--text-primary, #191919)":"transparent",color:s?"var(--bg-surface, #FFFFFF)":"var(--text-secondary, #5A5651)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",fontWeight:s?600:400},children:i},t)})]}),e.jsx("button",{type:"button",onClick:Y,"data-testid":"skill-detail-install-primary","aria-label":"Install skill",style:{display:"inline-flex",alignItems:"center",marginBottom:"0.75rem",padding:"0.5rem 1rem",borderRadius:6,border:"1px solid var(--text-primary, #191919)",background:"var(--text-primary, #191919)",color:"var(--bg-surface, #FFFFFF)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",fontWeight:600},children:"Install"}),e.jsx("div",{"data-testid":"skill-detail-install-command",style:{display:"block"},children:e.jsx(de,{compact:!0,children:f.variants.map((t,s)=>e.jsxs("div",{"data-testid":`skill-detail-install-variant-${t.label}`,style:{display:"flex",gap:"0.75rem",alignItems:"flex-start",marginTop:s===0?0:"0.75rem"},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{color:"#8B949E",marginBottom:"0.125rem"},children:t.comment}),e.jsxs("div",{children:[e.jsx("span",{style:{color:"#8B949E",marginRight:"0.5rem"},children:"$"}),e.jsx("span",{"data-testid":`skill-detail-install-variant-cmd-${t.label}`,children:t.command})]})]}),e.jsx("button",{type:"button",onClick:async()=>{const u=await P(t.command),i=u?`Run ${t.command} in your terminal`:"Copy failed — please copy the command manually.";if(c)try{c(i,u?"success":"error")}catch{}else F(i,u?"success":"error",3500);u&&W(a,{skillName:b,version:h??"",q:"",ts:Date.now()})},"data-testid":`skill-detail-copy-${t.label}`,"aria-label":`Copy ${t.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"})]},t.label))})})]}):null]})]})]})]})}export{Ee as SkillDetailPanel,Ee as default};
@@ -1 +1 @@
1
- import{r as v,e as N,a as E,j as a,f as L}from"./index-C3S9iHnq.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 O({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{O as default};
1
+ import{r as v,e as N,a as E,j as a,f as L}from"./index-DCbohW6l.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 O({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{O as default};