vskill 0.5.159 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents.json +1 -1
- package/dist/agents/agents-registry.d.ts +4 -14
- package/dist/agents/agents-registry.js.map +1 -1
- package/dist/eval-server/api-routes.js +32 -54
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-DOJWF3-Z.js → CreateSkillPage-DN-DGWb_.js} +5 -5
- package/dist/eval-ui/assets/{FindSkillsPalette-CEckFgA2.js → FindSkillsPalette-_QIpTcPE.js} +2 -2
- package/dist/eval-ui/assets/{SearchPaletteCore-CybKVEgq.js → SearchPaletteCore-CThylxw2.js} +1 -1
- package/dist/eval-ui/assets/{SkillDetailPanel-CYmWPegc.js → SkillDetailPanel-CYt2aARB.js} +1 -1
- package/dist/eval-ui/assets/{UpdateDropdown-B53G4Agp.js → UpdateDropdown-CO0ZyyC_.js} +1 -1
- package/dist/eval-ui/assets/index-vzRnBcdU.js +122 -0
- package/dist/eval-ui/index.html +1 -1
- package/dist/utils/skill-builder-detection.d.ts +1 -7
- package/dist/utils/skill-builder-detection.js +8 -11
- package/dist/utils/skill-builder-detection.js.map +1 -1
- package/dist/utils/skill-creator-detection.js +41 -9
- package/dist/utils/skill-creator-detection.js.map +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-DAH5iFYQ.js +0 -122
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as e,R as y,u as J,a as Z,r as v,g as B,b as D,w as X,c as ee,d as te,t as P,L as R,P as se,E as re,e as ae,S as le}from"./index-DAH5iFYQ.js";/* empty css */const ne=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function oe({supported:r,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function $({agent:r,checked:a,onToggle:m}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.installed?"1px solid var(--color-primary, #6366f1)":"1px solid var(--border-subtle, #333)",background:a?"var(--surface-2, #1e1e1e)":"transparent"},children:[e.jsx("input",{type:"checkbox",checked:a,onChange:m,style:{accentColor:"var(--color-primary, #6366f1)"}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary, #fff)"},children:r.displayName}),r.installed&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"var(--color-primary-bg, #312e81)",color:"var(--color-primary, #6366f1)"},children:"installed"})]}),e.jsx("div",{style:{marginTop:3},children:ne.map(u=>e.jsx(oe,{supported:r.featureSupport[u.key],label:u.label},u.key))})]})]})}function ie({agents:r,selectedIds:a,onChange:m}){const u=new Set(a),n=r.filter(o=>o.isUniversal),l=r.filter(o=>!o.isUniversal),x=o=>{const i=u.has(o)?a.filter(k=>k!==o):[...a,o];m(i)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[n.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Universal Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:n.map(o=>e.jsx($,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]}),l.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Other Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:l.map(o=>e.jsx($,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]})]})}const de="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",ce="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",ue="Generate raw — no engine assistance, you provide the full SKILL.md body.";function xe(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:de,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:ce,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:ue,detected:!0,installable:!1}]}function pe(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function me(r){const{detection:a,selected:m,onSelect:u,onInstallClick:n}=r,l=y.useMemo(()=>pe(),[]),x=y.useMemo(()=>xe(a),[a]),o=l?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:x.map(i=>{const k=m===i.engine,p=!i.detected&&i.installable,b=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",o,k?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),h=i.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${i.engine}`,"aria-selected":k?"true":"false",title:i.tooltip,style:h,className:b,onClick:()=>u(i.engine),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),u(i.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:i.label}),e.jsx("span",{className:"text-xs text-gray-500",children:i.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${i.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:d=>{d.stopPropagation(),n(i.engine)},children:"Install"})]},i.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",F=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,ge=`(?:-${F}(?:\\.${F})*)`,he=`(?:\\+${z}(?:\\.${z})*)`,fe=new RegExp(`^${A}\\.${A}\\.${A}${ge}?${he}?$`);function V(r){return typeof r!="string"?!1:fe.test(r.trim())}const ve="Skill version (semver). Auto-bumps on update unless versioningMode=author.",ye="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function be(r){const{value:a,onChange:m,mode:u,onValidityChange:n,versionsHref:l,disabled:x}=r,[o,i]=y.useState(!1),[k,p]=y.useState(()=>V(a)),b=V(a);y.useEffect(()=>{b!==k?(p(b),n==null||n(b)):n&&n(b)},[b]);const h=o&&!b,d=["w-full rounded-md border px-3 py-2 text-sm font-mono",h?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",x?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:ve,value:a,onChange:g=>m(g.currentTarget.value),onBlur:()=>i(!0),"aria-invalid":h?"true":"false","aria-describedby":h?"version-input-helper":void 0,disabled:x,className:d,placeholder:"1.0.0"}),h&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:ye}),u==="update"&&l&&e.jsx("a",{"data-testid":"version-input-versions-link",href:l,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function je(r={}){const a=r.fetchImpl??globalThis.fetch,m=r.eventSourceCtor??globalThis.EventSource,[u,n]=y.useState(E),l=y.useRef(null),x=y.useRef(null);y.useEffect(()=>()=>{var p;(p=x.current)==null||p.close()},[]);const o=y.useCallback(()=>{var p;(p=x.current)==null||p.close(),x.current=null,l.current=null,n(E)},[]),i=y.useCallback(async p=>{if(!m){n({...E,status:"failure",error:"EventSource not available"});return}l.current=p,n({...E,status:"spawning"});let b;try{const d=await a("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!d.ok){const C=await d.json().catch(()=>({}));n({...E,status:"failure",error:C.remediation??C.error??`HTTP ${d.status}`});return}b=(await d.json()).jobId}catch(d){n({...E,status:"failure",error:d.message});return}const h=new m(`/api/studio/install-engine/${b}/stream`);x.current=h,n(d=>({...d,status:"streaming"})),h.addEventListener("progress",d=>{try{const g=JSON.parse(d.data);n(C=>({...C,liveTail:g.line.length>60?g.line.slice(0,60)+"…":g.line,progress:[...C.progress,g].slice(-200)}))}catch{}}),h.addEventListener("done",d=>{try{const g=JSON.parse(d.data);h.close(),x.current=null,n(C=>({...C,status:g.success?"success":"failure",exitCode:g.exitCode,stderr:g.stderr,error:g.success?null:g.stderr||`exit ${g.exitCode}`}))}catch{h.close(),x.current=null,n(g=>({...g,status:"failure",error:"malformed done event"}))}}),h.addEventListener("error",()=>{h.close(),x.current=null,n(d=>({...d,status:d.status==="streaming"?"failure":d.status,error:d.error??"stream error"}))})},[m,a]),k=y.useCallback(async()=>{const p=l.current;p&&await i(p)},[i]);return{state:u,install:i,retry:k,reset:o}}const ke={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},we={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},Ne="This runs the command in your terminal as your user. Inspect before approving.";function Ce(r){const{engine:a,onClose:m,onSuccess:u,hookOpts:n}=r,{state:l,install:x,retry:o}=je(n),i=ke[a],k=we[a],p=y.useRef(!1);return y.useEffect(()=>{l.status==="success"&&!p.current&&(p.current=!0,u())},[l.status,u]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",k]}),l.status==="idle"&&e.jsx(Se,{command:i,onCancel:m,onRun:()=>x(a)}),(l.status==="spawning"||l.status==="streaming")&&e.jsx(Le,{command:i,liveTail:l.liveTail}),l.status==="success"&&e.jsx(Ee,{label:k,onClose:m}),l.status==="failure"&&e.jsx(Pe,{error:l.error??"Install failed",stderr:l.stderr,progress:l.progress,onRetry:()=>o(),onClose:m})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:Ne}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Le(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Ee(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Pe(r){const[a,m]=y.useState(!1),u=r.progress.filter(l=>l.stream==="stderr").map(l=>l.line),n=u.length>0?u.join(`
|
|
2
|
-
`):r.stderr;return e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-testid":"install-failure",className:"mt-3 text-sm font-medium text-red-700",children:"✗ Install failed"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700",children:r.error}),
|
|
3
|
-
`)},[t.name,t.description,t.model,t.allowedTools,t.body]);return e.jsxs("div",{className:"px-4 py-6 sm:px-6 sm:py-7 lg:px-10 lg:py-8 max-w-6xl mx-auto w-full overflow-x-hidden",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:[e.jsx(R,{to:"/",className:"hover:underline",style:{color:"var(--text-tertiary)"},children:"Skills"}),e.jsx("span",{children:"/"}),e.jsx("span",{style:{color:"var(--text-secondary)"},children:"New Skill"})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-[22px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),t.standaloneLocked&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider px-2 py-0.5 rounded whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. Plugin selection is disabled.",children:"Standalone"})]}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--text-tertiary)"},children:"Define your skill's metadata, content, and placement"})]}),e.jsxs("div",{className:"inline-flex rounded-lg p-1 self-start sm:self-auto sm:flex-shrink-0 max-w-full",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},role:"tablist","aria-label":"Creation mode",children:[e.jsx("button",{onClick:()=>t.setMode("ai"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="ai"?"var(--purple-muted)":"transparent",color:t.mode==="ai"?"var(--purple)":"var(--text-tertiary)",boxShadow:t.mode==="ai"?"0 1px 3px rgba(0,0,0,0.08)":"none"},children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{size:14}),"AI-Assisted"]})}),e.jsx("button",{onClick:()=>t.setMode("manual"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:t.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:t.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:"Manual"})]})]})]}),t.engineDetection&&e.jsx("div",{className:"mb-4",children:e.jsx(
|
|
1
|
+
import{j as e,R as j,u as J,a as Z,r as b,g as D,b as B,w as X,c as ee,t as P,L as R,P as te,E as se,d as re,S as ae}from"./index-vzRnBcdU.js";/* empty css */const le=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function ne({supported:r,label:l}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:l})}function F({agent:r,checked:l,onToggle:g}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.installed?"1px solid var(--color-primary, #6366f1)":"1px solid var(--border-subtle, #333)",background:l?"var(--surface-2, #1e1e1e)":"transparent"},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:g,style:{accentColor:"var(--color-primary, #6366f1)"}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary, #fff)"},children:r.displayName}),r.installed&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"var(--color-primary-bg, #312e81)",color:"var(--color-primary, #6366f1)"},children:"installed"})]}),e.jsx("div",{style:{marginTop:3},children:le.map(x=>e.jsx(ne,{supported:r.featureSupport[x.key],label:x.label},x.key))})]})]})}function oe({agents:r,selectedIds:l,onChange:g}){const x=new Set(l),i=r.filter(n=>n.isUniversal),a=r.filter(n=>!n.isUniversal),c=n=>{const o=x.has(n)?l.filter(h=>h!==n):[...l,n];g(o)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[i.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Universal Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:i.map(n=>e.jsx(F,{agent:n,checked:x.has(n.id),onToggle:()=>c(n.id)},n.id))})]}),a.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Other Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:a.map(n=>e.jsx(F,{agent:n,checked:x.has(n.id),onToggle:()=>c(n.id)},n.id))})]})]})}const ie="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",de="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",ce="Generate raw — no engine assistance, you provide the full SKILL.md body.";function ue(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:ie,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:de,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:ce,detected:!0,installable:!1}]}function xe(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function pe(r){const{detection:l,selected:g,onSelect:x,onInstallClick:i}=r,a=j.useMemo(()=>xe(),[]),c=j.useMemo(()=>ue(l),[l]),n=a?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:c.map(o=>{const h=g===o.engine,p=!o.detected&&o.installable,y=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",n,h?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),f=o.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${o.engine}`,"aria-selected":h?"true":"false",title:o.tooltip,style:f,className:y,onClick:()=>x(o.engine),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),x(o.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:o.label}),e.jsx("span",{className:"text-xs text-gray-500",children:o.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${o.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:u=>{u.stopPropagation(),i(o.engine)},children:"Install"})]},o.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",$=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,me=`(?:-${$}(?:\\.${$})*)`,ge=`(?:\\+${z}(?:\\.${z})*)`,he=new RegExp(`^${A}\\.${A}\\.${A}${me}?${ge}?$`);function V(r){return typeof r!="string"?!1:he.test(r.trim())}const fe="Skill version (semver). Auto-bumps on update unless versioningMode=author.",ve="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function ye(r){const{value:l,onChange:g,mode:x,onValidityChange:i,versionsHref:a,disabled:c}=r,[n,o]=j.useState(!1),[h,p]=j.useState(()=>V(l)),y=V(l);j.useEffect(()=>{y!==h?(p(y),i==null||i(y)):i&&i(y)},[y]);const f=n&&!y,u=["w-full rounded-md border px-3 py-2 text-sm font-mono",f?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",c?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:fe,value:l,onChange:m=>g(m.currentTarget.value),onBlur:()=>o(!0),"aria-invalid":f?"true":"false","aria-describedby":f?"version-input-helper":void 0,disabled:c,className:u,placeholder:"1.0.0"}),f&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:ve}),x==="update"&&a&&e.jsx("a",{"data-testid":"version-input-versions-link",href:a,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function be(r={}){const l=r.fetchImpl??globalThis.fetch,g=r.eventSourceCtor??globalThis.EventSource,[x,i]=j.useState(E),a=j.useRef(null),c=j.useRef(null);j.useEffect(()=>()=>{var p;(p=c.current)==null||p.close()},[]);const n=j.useCallback(()=>{var p;(p=c.current)==null||p.close(),c.current=null,a.current=null,i(E)},[]),o=j.useCallback(async p=>{if(!g){i({...E,status:"failure",error:"EventSource not available"});return}a.current=p,i({...E,status:"spawning"});let y;try{const u=await l("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!u.ok){const w=await u.json().catch(()=>({}));i({...E,status:"failure",error:w.remediation??w.error??`HTTP ${u.status}`});return}y=(await u.json()).jobId}catch(u){i({...E,status:"failure",error:u.message});return}const f=new g(`/api/studio/install-engine/${y}/stream`);c.current=f,i(u=>({...u,status:"streaming"})),f.addEventListener("progress",u=>{try{const m=JSON.parse(u.data);i(w=>({...w,liveTail:m.line.length>60?m.line.slice(0,60)+"…":m.line,progress:[...w.progress,m].slice(-200)}))}catch{}}),f.addEventListener("done",u=>{try{const m=JSON.parse(u.data);f.close(),c.current=null,i(w=>({...w,status:m.success?"success":"failure",exitCode:m.exitCode,stderr:m.stderr,error:m.success?null:m.stderr||`exit ${m.exitCode}`}))}catch{f.close(),c.current=null,i(m=>({...m,status:"failure",error:"malformed done event"}))}}),f.addEventListener("error",()=>{f.close(),c.current=null,i(u=>({...u,status:u.status==="streaming"?"failure":u.status,error:u.error??"stream error"}))})},[g,l]),h=j.useCallback(async()=>{const p=a.current;p&&await o(p)},[o]);return{state:x,install:o,retry:h,reset:n}}const je={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},ke={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},we="This runs the command in your terminal as your user. Inspect before approving.";function Ne(r){const{engine:l,onClose:g,onSuccess:x,hookOpts:i}=r,{state:a,install:c,retry:n}=be(i),o=je[l],h=ke[l],p=j.useRef(!1);return j.useEffect(()=>{a.status==="success"&&!p.current&&(p.current=!0,x())},[a.status,x]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",h]}),a.status==="idle"&&e.jsx(Se,{command:o,onCancel:g,onRun:()=>c(l)}),(a.status==="spawning"||a.status==="streaming")&&e.jsx(Ce,{command:o,liveTail:a.liveTail}),a.status==="success"&&e.jsx(Le,{label:h,onClose:g}),a.status==="failure"&&e.jsx(Ee,{error:a.error??"Install failed",stderr:a.stderr,progress:a.progress,onRetry:()=>n(),onClose:g})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:we}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Ce(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Le(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Ee(r){const[l,g]=j.useState(!1),x=r.progress.filter(a=>a.stream==="stderr").map(a=>a.line),i=x.length>0?x.join(`
|
|
2
|
+
`):r.stderr;return e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-testid":"install-failure",className:"mt-3 text-sm font-medium text-red-700",children:"✗ Install failed"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700",children:r.error}),i&&e.jsxs("details",{className:"mt-3 text-xs",open:l,onToggle:a=>g(a.currentTarget.open),children:[e.jsx("summary",{className:"cursor-pointer text-gray-600",children:"stderr"}),e.jsx("pre",{"data-testid":"install-stderr",className:"mt-2 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-red-300",children:i})]}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onClose,children:"Close"}),e.jsx("button",{type:"button","data-testid":"install-retry",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRetry,children:"Retry"})]})]})}const S={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Pe(r){return r?/API usage limits|usage limit/i.test(r)&&/regain access|reset/i.test(r):!1}function Ie(r){const l=r.match(/regain access on ([^"\\]+?)(?:\s*UTC)?["\\]/i)??r.match(/regain access on ([^"\\]+)/i);return l?`Resets ${l[1].trim()} UTC`:"Quota resets at the start of your next billing period"}function I(r){switch(r){case"claude-cli":return"Uses your logged-in Claude Code session — your existing CLI session handles quota. No API key needed. Overflow runs at standard API rates if extra usage is enabled in your account settings.";case"anthropic":return"Direct Anthropic API — pay-per-token. Full Opus / Sonnet / Haiku catalog. Requires ANTHROPIC_API_KEY.";case"openrouter":return"One API key → 300+ models from Anthropic, OpenAI (GPT-5 / o4-mini), Google (Gemini), Meta (Llama) and more. Same prices as direct.";case"ollama":return"Local models on your machine (Llama, Qwen, Mistral, etc.). Zero cost, zero data leaves your laptop.";case"lm-studio":return"Local models via LM Studio's OpenAI-compatible server. Works offline. Pick any model you've loaded in LM Studio.";default:return""}}function M({size:r=14,color:l="currentColor"}){return e.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function Re(){const{config:r}=J(),{refreshSkills:l,revealSkill:g}=Z(),[x,i]=b.useState(null),a=j.useMemo(()=>{if(typeof window>"u")return{};const s=window.location.hash,d=s.indexOf("?");if(d===-1)return{};const N=new URLSearchParams(s.slice(d+1)),k={};for(const v of["mode","skillName","description","pluginName"]){const L=N.get(v);L&&(k[v]=L)}return k},[]),[c,n]=b.useState("claude-cli"),[o,h]=b.useState("sonnet"),[p,y]=b.useState(!1),[f,u]=b.useState(null),m=b.useRef(!1),[w,W]=b.useState([]),[U,K]=b.useState(()=>D("activeAgent",null));b.useEffect(()=>{function s(){K(D("activeAgent",null))}return window.addEventListener("studio:agent-changed",s),window.addEventListener("storage",s),()=>{window.removeEventListener("studio:agent-changed",s),window.removeEventListener("storage",s)}},[]);const Y=U!=="claude-code";b.useEffect(()=>{fetch("/api/agents/installed").then(s=>s.json()).then(s=>{s.agents&&W(s.agents)}).catch(()=>{})},[]),b.useEffect(()=>{var k;if(!r)return;const s=r.providers.filter(v=>v.available),d=B().skillGenModel;if(s.length===0){m.current=!0;return}if(d&&typeof d=="object"&&typeof d.provider=="string"&&typeof d.model=="string"){const v=s.find(T=>T.id===d.provider),L=v==null?void 0:v.models.some(T=>T.id===d.model);if(v&&L){n(d.provider),h(d.model),y(!0),m.current=!0;return}u({provider:d.provider,model:d.model})}if(s.find(v=>v.id==="claude-cli"))n("claude-cli"),h("sonnet");else{const v=s[0];n(v.id),h(((k=v.models[0])==null?void 0:k.id)??"")}y(!1),m.current=!0},[r]),b.useEffect(()=>{const s=d=>{if(d.key!==null&&!d.key.includes("vskill.studio.prefs"))return;const k=B().skillGenModel;k&&typeof k=="object"&&typeof k.provider=="string"&&typeof k.model=="string"&&(n(k.provider),h(k.model),y(!0))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]);const O=b.useCallback((s,d)=>{X("skillGenModel",{provider:s,model:d}),y(!0)},[]),q=b.useCallback(()=>({provider:c,model:o}),[c,o]),Q=a.mode==="standalone"?3:void 0,t=ee({onCreated:(s,d)=>{l(),setTimeout(()=>g(s,d),500)},resolveAiConfigOverride:q,forceLayout:Q});b.useEffect(()=>{a.skillName&&!t.name&&t.setName(P(a.skillName)),a.description&&!t.description&&t.setDescription(a.description),a.description&&!t.aiPrompt&&t.setAiPrompt(a.description),a.pluginName&&!t.plugin&&t.setPlugin(P(a.pluginName))},[]);const C=r==null?void 0:r.providers.find(s=>s.id===c&&s.available),_=b.useMemo(()=>{const s=["---"];return t.description?s.push(`description: "${t.description.replace(/"/g,'\\"')}"`):s.push('description: ""'),t.allowedTools.trim()&&s.push(`allowed-tools: ${t.allowedTools.trim()}`),t.model&&s.push(`model: ${t.model}`),t.targetAgents.length>0&&s.push(`target-agents: ${t.targetAgents.join(", ")}`),s.push("---"),s.push(""),t.body.trim()?s.push(t.body.trim()):(s.push(`# /${t.name||"skill-name"}`),s.push(""),s.push("You are a helpful assistant.")),s.join(`
|
|
3
|
+
`)},[t.name,t.description,t.model,t.allowedTools,t.body]);return e.jsxs("div",{className:"px-4 py-6 sm:px-6 sm:py-7 lg:px-10 lg:py-8 max-w-6xl mx-auto w-full overflow-x-hidden",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:[e.jsx(R,{to:"/",className:"hover:underline",style:{color:"var(--text-tertiary)"},children:"Skills"}),e.jsx("span",{children:"/"}),e.jsx("span",{style:{color:"var(--text-secondary)"},children:"New Skill"})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-[22px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),t.standaloneLocked&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider px-2 py-0.5 rounded whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. Plugin selection is disabled.",children:"Standalone"})]}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--text-tertiary)"},children:"Define your skill's metadata, content, and placement"})]}),e.jsxs("div",{className:"inline-flex rounded-lg p-1 self-start sm:self-auto sm:flex-shrink-0 max-w-full",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},role:"tablist","aria-label":"Creation mode",children:[e.jsx("button",{onClick:()=>t.setMode("ai"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="ai"?"var(--purple-muted)":"transparent",color:t.mode==="ai"?"var(--purple)":"var(--text-tertiary)",boxShadow:t.mode==="ai"?"0 1px 3px rgba(0,0,0,0.08)":"none"},children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{size:14}),"AI-Assisted"]})}),e.jsx("button",{onClick:()=>t.setMode("manual"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:t.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:t.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:"Manual"})]})]})]}),t.engineDetection&&e.jsx("div",{className:"mb-4",children:e.jsx(pe,{detection:t.engineDetection,selected:t.engine,onSelect:s=>t.setEngine(s),onInstallClick:s=>i(s)})}),t.layoutLoading&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!t.layoutLoading&&t.layout&&t.mode==="ai"&&e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 animate-fade-in",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"var(--purple-muted)"},children:e.jsx(M,{size:13,color:"var(--purple)"})}),"Describe Your Skill"]}),e.jsx("textarea",{ref:t.promptRef,value:t.aiPrompt,onChange:s=>t.setAiPrompt(s.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
4
4
|
|
|
5
|
-
Include any specific behaviors, constraints, or output formats you want.`,rows:6,disabled:t.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...N,minHeight:"140px"},onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),t.handleGenerate())}}),e.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("span",{children:"Source Model"}),!k&&l==="claude-cli"&&o==="sonnet"&&e.jsx("span",{className:"text-[10px] font-normal uppercase tracking-wider px-1.5 py-0.5 rounded",style:{color:"var(--text-tertiary)",background:"var(--surface-2)"},children:"Default"})]}),b&&e.jsxs("div",{role:"status",className:"mb-3 px-3 py-2 rounded-lg text-[12px] flex items-center justify-between gap-3",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:[e.jsxs("span",{children:["Previous selection ",e.jsxs("code",{children:[b.provider,"/",b.model]})," unavailable — reverted to default."]}),e.jsx("button",{onClick:()=>h(null),className:"text-[11px]",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},"aria-label":"Dismiss notice",children:"✕"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",title:S?void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),e.jsx("select",{value:l,onChange:s=>{var f;const c=s.target.value;x(c);const w=a==null?void 0:a.providers.find(L=>L.id===c),j=((f=w==null?void 0:w.models[0])==null?void 0:f.id)??o;w!=null&&w.models[0]&&i(j),O(c,j)},disabled:t.generating||!S,title:S?I(l)||void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N,children:a==null?void 0:a.providers.filter(s=>s.available).map(s=>e.jsx("option",{value:s.id,title:I(s.id),children:s.label},s.id))}),I(l)&&e.jsxs("div",{className:"mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:[I(l),l==="claude-cli"&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{color:"var(--color-accent, #2f6f8f)",textDecoration:"underline"},children:"Enable extra usage →"})]})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsx("select",{value:o,onChange:s=>{const c=s.target.value;i(c),O(l,c)},disabled:t.generating||!S,className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N,children:S==null?void 0:S.models.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))})]})]})]}),K&&g.length>0&&e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Target Agents",e.jsx("span",{className:"text-[11px] font-normal ml-2",style:{color:"var(--text-tertiary)"},children:"(optional — leave empty for Claude Code default)"})]}),e.jsx(ie,{agents:g,selectedIds:t.targetAgents,onChange:t.setTargetAgents})]}),t.generating&&t.aiProgress.length>0&&e.jsx("div",{children:e.jsx(se,{entries:t.aiProgress,isRunning:!0})}),t.aiError&&e.jsx("div",{children:Ie(t.aiError)?e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--yellow-muted)",color:"var(--text-primary)",border:"1px solid var(--yellow)"},children:[e.jsx("div",{style:{fontWeight:600,marginBottom:4},children:"Your Claude Code session quota is exhausted"}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",lineHeight:1.5,marginBottom:8},children:[Ae(t.aiError),". Switch to another provider (Anthropic API, OpenRouter, or a local model) or enable extra usage to continue past your monthly quota."]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",padding:"4px 10px",fontSize:12,fontWeight:500,color:"var(--color-paper, #fff)",background:"var(--color-accent, #2f6f8f)",borderRadius:4,textDecoration:"none"},children:"Enable extra usage →"}),e.jsx("button",{onClick:t.clearAiError,style:{padding:"4px 10px",fontSize:12,color:"var(--text-primary)",background:"transparent",border:"1px solid var(--border-default)",borderRadius:4,cursor:"pointer"},children:"Dismiss"})]})]}):t.aiClassifiedError?e.jsx(re,{error:t.aiClassifiedError,onRetry:t.handleGenerate,onDismiss:t.clearAiError}):e.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid var(--red-muted)"},children:t.aiError})}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.generating?e.jsx("button",{onClick:t.handleCancelGenerate,className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:"Cancel Generation"}):e.jsxs("button",{onClick:t.handleGenerate,disabled:!t.aiPrompt.trim(),className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:t.aiPrompt.trim()?"var(--color-action, #2F5B8E)":"var(--surface-3)",color:t.aiPrompt.trim()?"var(--color-action-ink, #FFFFFF)":"var(--text-tertiary)",cursor:t.aiPrompt.trim()?"pointer":"not-allowed"},children:[e.jsx(M,{size:14})," Generate Skill"]}),e.jsx(R,{to:"/",className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)"},children:"Cancel"})]})]}),e.jsx("div",{className:"w-full lg:w-[340px] lg:flex-shrink-0 min-w-0",children:e.jsx("div",{className:"lg:sticky lg:top-8",children:e.jsxs("div",{className:"glass-card p-4",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"SKILL.md Preview"}),e.jsx("pre",{className:"text-[11px] font-mono leading-relaxed overflow-auto max-h-[500px] p-3 rounded-lg",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:_})]})})})]}),!t.layoutLoading&&t.layout&&t.mode==="manual"&&e.jsx("div",{className:"animate-fade-in",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 mb-3",children:[e.jsx("h3",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Location"}),t.standaloneLocked&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-medium px-2 py-1 rounded-md whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. To change, go back and pick a different destination.",children:[e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Standalone skill"]})]}),t.standaloneLocked?e.jsxs("p",{className:"text-[12px] mb-3",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:["Lives at ",e.jsxs("code",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:["<project>/skills/","<name>","/SKILL.md"]})," — works with every agent. No plugin selected."]}):e.jsxs(e.Fragment,{children:[t.creatableLayouts.length>1&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[t.creatableLayouts.map(s=>e.jsx("button",{onClick:()=>{t.setSelectedLayout(s.layout);const c=s.existingPlugins[0];t.setPlugin(c||""),t.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150 whitespace-nowrap",style:{background:t.selectedLayout===s.layout?"var(--accent)":"var(--surface-3)",color:t.selectedLayout===s.layout?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${t.selectedLayout===s.layout?"var(--accent)":"var(--border-subtle)"}`},children:s.label},s.layout)),!t.creatableLayouts.find(s=>s.layout===3)&&e.jsx("button",{onClick:()=>{t.setSelectedLayout(3),t.setPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150 whitespace-nowrap",style:{background:t.selectedLayout===3?"var(--accent)":"var(--surface-3)",color:t.selectedLayout===3?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${t.selectedLayout===3?"var(--accent)":"var(--border-subtle)"}`},children:"Root skills/"})]})]}),t.selectedLayout!==3&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),e.jsxs("select",{value:t.plugin,onChange:s=>{t.setPlugin(s.target.value),t.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N,children:[t.availablePlugins.map(s=>e.jsx("option",{value:s,children:s},s)),e.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),t.plugin==="__new__"&&e.jsx("input",{type:"text",value:t.newPlugin,onChange:s=>t.setNewPlugin(P(s.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:N})]})]}),e.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono overflow-x-auto",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)",wordBreak:"break-all",overflowWrap:"anywhere",lineHeight:1.55},children:t.pathPreview})]}),!t.standaloneLocked&&t.showPluginRecommendation&&t.pluginLayoutInfo&&t.selectedLayout===3&&e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",style:{background:"var(--accent-muted)",color:"var(--text-secondary)",border:"1px solid var(--accent-muted)"},children:[e.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),e.jsxs("span",{children:["Plugins detected (",e.jsx("strong",{children:t.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("button",{onClick:t.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"var(--accent)",color:"var(--color-paper)",border:"none",cursor:"pointer"},children:"Use plugin"}),e.jsx("button",{onClick:()=>t.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Name ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("input",{type:"text",value:t.name,onChange:s=>t.setName(P(s.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N})]}),e.jsx("div",{className:"mb-4",children:e.jsx(be,{value:t.version,onChange:t.setVersion,onValidityChange:t.setVersionValid,mode:"create"})}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Description ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("textarea",{value:t.description,onChange:s=>t.setDescription(s.target.value),placeholder:"Brief description — used for auto-activation keywords",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...N,minHeight:"72px"}}),e.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"This text is used by Claude to decide when to activate the skill"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsxs("select",{value:t.model,onChange:s=>t.setModel(s.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N,children:[e.jsx("option",{value:"",children:"Any (default)"}),e.jsx("option",{value:"opus",children:"Opus"}),e.jsx("option",{value:"sonnet",children:"Sonnet"}),e.jsx("option",{value:"haiku",children:"Haiku"})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),e.jsx("input",{type:"text",value:t.allowedTools,onChange:s=>t.setAllowedTools(s.target.value),placeholder:"Read, Write, Edit, Bash, Glob, Grep",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:N})]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),e.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),e.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(s=>e.jsxs("button",{onClick:()=>t.setBodyViewMode(s),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:t.bodyViewMode===s?"var(--surface-4)":"transparent",color:t.bodyViewMode===s?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:t.bodyViewMode===s?600:400,border:"none",cursor:"pointer"},children:[s==="write"?e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}):e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),e.jsx("span",{children:s==="write"?"Write":"Preview"})]},s))})]}),t.bodyViewMode==="write"?e.jsx("textarea",{value:t.body,onChange:s=>t.setBody(s.target.value),placeholder:`# /my-skill
|
|
5
|
+
Include any specific behaviors, constraints, or output formats you want.`,rows:6,disabled:t.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...S,minHeight:"140px"},onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),t.handleGenerate())}}),e.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("span",{children:"Source Model"}),!p&&c==="claude-cli"&&o==="sonnet"&&e.jsx("span",{className:"text-[10px] font-normal uppercase tracking-wider px-1.5 py-0.5 rounded",style:{color:"var(--text-tertiary)",background:"var(--surface-2)"},children:"Default"})]}),f&&e.jsxs("div",{role:"status",className:"mb-3 px-3 py-2 rounded-lg text-[12px] flex items-center justify-between gap-3",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:[e.jsxs("span",{children:["Previous selection ",e.jsxs("code",{children:[f.provider,"/",f.model]})," unavailable — reverted to default."]}),e.jsx("button",{onClick:()=>u(null),className:"text-[11px]",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},"aria-label":"Dismiss notice",children:"✕"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",title:C?void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),e.jsx("select",{value:c,onChange:s=>{var v;const d=s.target.value;n(d);const N=r==null?void 0:r.providers.find(L=>L.id===d),k=((v=N==null?void 0:N.models[0])==null?void 0:v.id)??o;N!=null&&N.models[0]&&h(k),O(d,k)},disabled:t.generating||!C,title:C?I(c)||void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S,children:r==null?void 0:r.providers.filter(s=>s.available).map(s=>e.jsx("option",{value:s.id,title:I(s.id),children:s.label},s.id))}),I(c)&&e.jsxs("div",{className:"mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:[I(c),c==="claude-cli"&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{color:"var(--color-accent, #2f6f8f)",textDecoration:"underline"},children:"Enable extra usage →"})]})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsx("select",{value:o,onChange:s=>{const d=s.target.value;h(d),O(c,d)},disabled:t.generating||!C,className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S,children:C==null?void 0:C.models.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))})]})]})]}),Y&&w.length>0&&e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Target Agents",e.jsx("span",{className:"text-[11px] font-normal ml-2",style:{color:"var(--text-tertiary)"},children:"(optional — leave empty for Claude Code default)"})]}),e.jsx(oe,{agents:w,selectedIds:t.targetAgents,onChange:t.setTargetAgents})]}),t.generating&&t.aiProgress.length>0&&e.jsx("div",{children:e.jsx(te,{entries:t.aiProgress,isRunning:!0})}),t.aiError&&e.jsx("div",{children:Pe(t.aiError)?e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--yellow-muted)",color:"var(--text-primary)",border:"1px solid var(--yellow)"},children:[e.jsx("div",{style:{fontWeight:600,marginBottom:4},children:"Your Claude Code session quota is exhausted"}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",lineHeight:1.5,marginBottom:8},children:[Ie(t.aiError),". Switch to another provider (Anthropic API, OpenRouter, or a local model) or enable extra usage to continue past your monthly quota."]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",padding:"4px 10px",fontSize:12,fontWeight:500,color:"var(--color-paper, #fff)",background:"var(--color-accent, #2f6f8f)",borderRadius:4,textDecoration:"none"},children:"Enable extra usage →"}),e.jsx("button",{onClick:t.clearAiError,style:{padding:"4px 10px",fontSize:12,color:"var(--text-primary)",background:"transparent",border:"1px solid var(--border-default)",borderRadius:4,cursor:"pointer"},children:"Dismiss"})]})]}):t.aiClassifiedError?e.jsx(se,{error:t.aiClassifiedError,onRetry:t.handleGenerate,onDismiss:t.clearAiError}):e.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid var(--red-muted)"},children:t.aiError})}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.generating?e.jsx("button",{onClick:t.handleCancelGenerate,className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:"Cancel Generation"}):e.jsxs("button",{onClick:t.handleGenerate,disabled:!t.aiPrompt.trim(),className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:t.aiPrompt.trim()?"var(--color-action, #2F5B8E)":"var(--surface-3)",color:t.aiPrompt.trim()?"var(--color-action-ink, #FFFFFF)":"var(--text-tertiary)",cursor:t.aiPrompt.trim()?"pointer":"not-allowed"},children:[e.jsx(M,{size:14})," Generate Skill"]}),e.jsx(R,{to:"/",className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)"},children:"Cancel"})]})]}),e.jsx("div",{className:"w-full lg:w-[340px] lg:flex-shrink-0 min-w-0",children:e.jsx("div",{className:"lg:sticky lg:top-8",children:e.jsxs("div",{className:"glass-card p-4",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"SKILL.md Preview"}),e.jsx("pre",{className:"text-[11px] font-mono leading-relaxed overflow-auto max-h-[500px] p-3 rounded-lg",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:_})]})})})]}),!t.layoutLoading&&t.layout&&t.mode==="manual"&&e.jsx("div",{className:"animate-fade-in",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 mb-3",children:[e.jsx("h3",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Location"}),t.standaloneLocked&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-medium px-2 py-1 rounded-md whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. To change, go back and pick a different destination.",children:[e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Standalone skill"]})]}),t.standaloneLocked?e.jsxs("p",{className:"text-[12px] mb-3",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:["Lives at ",e.jsxs("code",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:["<project>/skills/","<name>","/SKILL.md"]})," — works with every agent. No plugin selected."]}):e.jsxs(e.Fragment,{children:[t.creatableLayouts.length>1&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[t.creatableLayouts.map(s=>e.jsx("button",{onClick:()=>{t.setSelectedLayout(s.layout);const d=s.existingPlugins[0];t.setPlugin(d||""),t.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150 whitespace-nowrap",style:{background:t.selectedLayout===s.layout?"var(--accent)":"var(--surface-3)",color:t.selectedLayout===s.layout?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${t.selectedLayout===s.layout?"var(--accent)":"var(--border-subtle)"}`},children:s.label},s.layout)),!t.creatableLayouts.find(s=>s.layout===3)&&e.jsx("button",{onClick:()=>{t.setSelectedLayout(3),t.setPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150 whitespace-nowrap",style:{background:t.selectedLayout===3?"var(--accent)":"var(--surface-3)",color:t.selectedLayout===3?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${t.selectedLayout===3?"var(--accent)":"var(--border-subtle)"}`},children:"Root skills/"})]})]}),t.selectedLayout!==3&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),e.jsxs("select",{value:t.plugin,onChange:s=>{t.setPlugin(s.target.value),t.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S,children:[t.availablePlugins.map(s=>e.jsx("option",{value:s,children:s},s)),e.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),t.plugin==="__new__"&&e.jsx("input",{type:"text",value:t.newPlugin,onChange:s=>t.setNewPlugin(P(s.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:S})]})]}),e.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono overflow-x-auto",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)",wordBreak:"break-all",overflowWrap:"anywhere",lineHeight:1.55},children:t.pathPreview})]}),!t.standaloneLocked&&t.showPluginRecommendation&&t.pluginLayoutInfo&&t.selectedLayout===3&&e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",style:{background:"var(--accent-muted)",color:"var(--text-secondary)",border:"1px solid var(--accent-muted)"},children:[e.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),e.jsxs("span",{children:["Plugins detected (",e.jsx("strong",{children:t.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("button",{onClick:t.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"var(--accent)",color:"var(--color-paper)",border:"none",cursor:"pointer"},children:"Use plugin"}),e.jsx("button",{onClick:()=>t.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Name ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("input",{type:"text",value:t.name,onChange:s=>t.setName(P(s.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S})]}),e.jsx("div",{className:"mb-4",children:e.jsx(ye,{value:t.version,onChange:t.setVersion,onValidityChange:t.setVersionValid,mode:"create"})}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Description ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("textarea",{value:t.description,onChange:s=>t.setDescription(s.target.value),placeholder:"Brief description — used for auto-activation keywords",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...S,minHeight:"72px"}}),e.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"This text is used by Claude to decide when to activate the skill"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsxs("select",{value:t.model,onChange:s=>t.setModel(s.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S,children:[e.jsx("option",{value:"",children:"Any (default)"}),e.jsx("option",{value:"opus",children:"Opus"}),e.jsx("option",{value:"sonnet",children:"Sonnet"}),e.jsx("option",{value:"haiku",children:"Haiku"})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),e.jsx("input",{type:"text",value:t.allowedTools,onChange:s=>t.setAllowedTools(s.target.value),placeholder:"Read, Write, Edit, Bash, Glob, Grep",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:S})]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),e.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),e.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(s=>e.jsxs("button",{onClick:()=>t.setBodyViewMode(s),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:t.bodyViewMode===s?"var(--surface-4)":"transparent",color:t.bodyViewMode===s?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:t.bodyViewMode===s?600:400,border:"none",cursor:"pointer"},children:[s==="write"?e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}):e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),e.jsx("span",{children:s==="write"?"Write":"Preview"})]},s))})]}),t.bodyViewMode==="write"?e.jsx("textarea",{value:t.body,onChange:s=>t.setBody(s.target.value),placeholder:`# /my-skill
|
|
6
6
|
|
|
7
7
|
You are an expert at...
|
|
8
8
|
|
|
@@ -10,4 +10,4 @@ You are an expert at...
|
|
|
10
10
|
|
|
11
11
|
1. First, understand the request
|
|
12
12
|
2. Then, implement the solution
|
|
13
|
-
3. Finally, verify the result`,rows:12,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...
|
|
13
|
+
3. Finally, verify the result`,rows:12,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...S,minHeight:"200px"}}):t.body.trim()?e.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"200px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:re(t.body)}}):e.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"200px",maxHeight:"400px",overflowY:"auto"},children:e.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),e.jsx(ae,{skillName:t.name||"{skill}",hasEvals:!1,isDraft:t.draftSaved}),t.error&&e.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid var(--red-muted)"},children:t.error}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:t.handleCreate,disabled:t.creating||!t.name||!t.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:t.creating||!t.name||!t.description?"var(--surface-3)":"var(--color-action, #2F5B8E)",color:t.creating||!t.name||!t.description?"var(--text-tertiary)":"var(--color-action-ink, #FFFFFF)",cursor:t.creating||!t.name||!t.description?"not-allowed":"pointer",opacity:t.creating?.7:1},children:t.creating?"Creating...":"Create Skill"}),e.jsx(R,{to:"/",className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)"},children:"Cancel"})]})]}),e.jsx("div",{className:"w-full lg:w-[340px] lg:flex-shrink-0 min-w-0",children:e.jsx("div",{className:"lg:sticky lg:top-8",children:e.jsxs("div",{className:"glass-card p-4",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"SKILL.md Preview"}),e.jsx("pre",{className:"text-[11px] font-mono leading-relaxed overflow-auto max-h-[500px] p-3 rounded-lg",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:_})]})})})]})}),x&&e.jsx(Ne,{engine:x,onClose:()=>i(null),onSuccess:()=>{t.refreshEngineDetection()}})]})}export{Re as CreateSkillPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-
|
|
2
|
-
import{r as t,j as d,_ as l}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-CThylxw2.js","assets/index-vzRnBcdU.js","assets/index-CycZyHaL.css","assets/fonts-i7Lkz2zN.css","assets/skill-url-C4ekwoGs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as d,_ as l}from"./index-vzRnBcdU.js";/* empty css */const f=t.lazy(()=>l(()=>import("./SearchPaletteCore-CThylxw2.js"),__vite__mapDeps([0,1,2,3,4])));function w(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function y({onSelect:i,onNavigate:u}={}){const[n,o]=t.useState(!1),s=t.useRef(null),a=w();t.useEffect(()=>{function e(){s.current=document.activeElement??null,o(!0)}return window.addEventListener("openFindSkills",e),()=>window.removeEventListener("openFindSkills",e)},[]),t.useEffect(()=>{if(!n)return;function e(r){r.key==="Escape"&&o(!1)}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),t.useEffect(()=>{if(n)return;const e=s.current;if(e&&typeof e.focus=="function")try{e.focus()}catch{}s.current=null},[n]);const c=t.useCallback((e,r)=>{try{typeof window<"u"&&window.sessionStorage&&window.sessionStorage.setItem("find-skills:last-query",r??"")}catch{}if(o(!1),i)try{i(e,r)}catch{}},[i]);return n?d.jsx("div",{"data-testid":"find-skills-palette-shell","data-reduced-motion":a?"true":"false",children:d.jsx(t.Suspense,{fallback:null,children:d.jsx(f,{initialOpen:!0,onSelect:c,onNavigate:u})})}):null}export{y as FindSkillsPalette,y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as t,k as xe}from"./index-DAH5iFYQ.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(i){return i?i.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(i,p){if(!i)return"";const d=be(i);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(i){return i?i<1e3?String(i):`${(i/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:i,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"}}[i];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":i,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(i)}):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(i){var d,u;const p=(d=i.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=i.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 Be({onSelect:i,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=a.useState(W),[o,F]=a.useState(""),[I,h]=a.useState([]),[U,v]=a.useState(0),[j,B]=a.useState(!1),[_,w]=a.useState(1),[H,x]=a.useState(!1),[M,V]=a.useState(!1),[$,k]=a.useState(null),[A,R]=a.useState(!1),Z=a.useRef(null),N=a.useRef(null),z=a.useRef(!1),ee=a.useRef(null),te=a.useRef(null),q=a.useRef(new Map),S=a.useRef(null),[,ue]=a.useState(!1),re=a.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=a.useRef(o);a.useEffect(()=>{K.current=o},[o]),a.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),a.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]),a.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]),a.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=a.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]);a.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:ye(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})):[]],ae=a.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=a.useCallback((e,n)=>{if(n&&(ae(n.name),i))try{i(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[i,p,ae]);a.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 ie="";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 a,j as t,h as xe}from"./index-vzRnBcdU.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(i){return i?i.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(i,p){if(!i)return"";const d=be(i);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(i){return i?i<1e3?String(i):`${(i/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:i,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"}}[i];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":i,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(i)}):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(i){var d,u;const p=(d=i.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=i.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 Be({onSelect:i,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=a.useState(W),[o,F]=a.useState(""),[I,h]=a.useState([]),[U,v]=a.useState(0),[j,B]=a.useState(!1),[_,w]=a.useState(1),[H,x]=a.useState(!1),[M,V]=a.useState(!1),[$,k]=a.useState(null),[A,R]=a.useState(!1),Z=a.useRef(null),N=a.useRef(null),z=a.useRef(!1),ee=a.useRef(null),te=a.useRef(null),q=a.useRef(new Map),S=a.useRef(null),[,ue]=a.useState(!1),re=a.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=a.useRef(o);a.useEffect(()=>{K.current=o},[o]),a.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),a.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]),a.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]),a.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=a.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]);a.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:ye(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})):[]],ae=a.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=a.useCallback((e,n)=>{if(n&&(ae(n.name),i))try{i(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[i,p,ae]);a.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 ie="";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 e,r as d,T as X}from"./index-DAH5iFYQ.js";import{s as B}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 Y({tier:r}){const s=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: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:[r," ",s.label]})}const Q=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function ee(r){var g,x;const a=r.trim().match(Q);if(!a)return null;const l=(g=a[1])==null?void 0:g.toLowerCase();let n=(x=a[2])==null?void 0:x.toLowerCase();if(!l||!n)return null;n=n.replace(/\.git$/,"");const u=`https://github.com/${l}/${n}`;return{owner:l,name:n,url:u}}function te({repoUrl:r,mono:s="var(--font-geist-mono)",fontSize:a="0.75rem",showPlaceholder:l=!0}){if(!r)return l?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a},children:"--"}):null;const n=ee(r);return n?e.jsxs("a",{"data-testid":"repo-link",href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:u=>u.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:a,fontFamily:s},children:[n.owner,"/",n.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a,fontFamily:s},children:r})}const re="var(--font-geist-mono)",ne={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},oe={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function se({skillName:r,repoUrl:s}){const[a,l]=d.useState(null),[n,u]=d.useState(!1);if(d.useEffect(()=>{s&&(u(!0),fetch(B(r,"repo-health")).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.json()}).then(b=>{l(b.status),u(!1)}).catch(()=>{l(null),u(!1)}))},[r,s]),!s)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=ne[a]??"var(--status-neutral-text)",x=oe[a]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:re,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 ae({children:r,compact:s}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code, #161B22)",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:r})}const ie="/api/v1/studio/telemetry/install-copy",le=/^[a-zA-Z0-9._@/-]+$/,ce=/^[a-zA-Z0-9._-]+$/,de="https://verified-skill.com";function ue(r){return`${r.owner}/${r.repo}/${r.slug}`}function me(r,s){return r!=null&&r.ownerSlug&&(r!=null&&r.repoSlug)?`${r.ownerSlug}/${r.repoSlug}`:r!=null&&r.publisher?r.publisher:`${s.owner}/${s.repo}`}function pe(r){return r==="global"?" --global":` --scope ${r}`}function fe(r,s,a,l){const n=a?`${r}/${s}@${a}`:`${r}/${s}`;if(!le.test(`${r}/${s}`))return{ok:!1,reason:"Invalid skill identifier"};if(a&&!ce.test(a))return{ok:!1,reason:"Invalid version identifier"};const u=pe(l),g=`npx vskill@latest install ${n}${u}`,x=[{label:"npm",comment:"# npm",command:g},{label:"bun",comment:"# bun",command:`bunx vskill@latest install ${n}${u}`},{label:"pnpm",comment:"# pnpm",command:`pnpx vskill@latest install ${n}${u}`},{label:"yarn",comment:"# yarn",command:`yarn dlx vskill@latest install ${n}${u}`},{label:"alternative",comment:"# alternative (publisher + --skill flag)",command:a?`npx vskill@latest install ${r}@${a} --skill ${s}${u}`:`npx vskill@latest install ${r} --skill ${s}${u}`}];return{ok:!0,command:g,variants:x}}function F(r,s,a){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:r,kind:s,durationMs:a,severity:s==="error"?"error":"info"}}))}async function P(r){var s;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.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 l=document.execCommand("copy");return document.body.removeChild(a),l}catch{return!1}}function U(r,s){try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}catch{}}function xe({selectedSkill:r,onClose:s,telemetryInstallCopyUrl:a=ie,onToast:l}){const[n,u]=d.useState(null),[g,x]=d.useState([]),[b,T]=d.useState(!0),[I,D]=d.useState(null),[h,L]=d.useState(null),[k,W]=d.useState("project"),[H,K]=d.useState(0),z=d.useRef(null),N=d.useRef(null),O=d.useRef(null),v=ue(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 o;return(o=N.current)==null?void 0:o.focus()},50);return()=>clearTimeout(t)},[]),d.useEffect(()=>{let t=!1;T(!0),D(null);const o=B(v),c=B(v,"versions");return Promise.all([fetch(o).then(async i=>{if(!i.ok)throw new Error(`metadata ${i.status}`);return i.json()}),fetch(c).then(async i=>{if(!i.ok)throw new Error(`versions ${i.status}`);const m=await i.json();return Array.isArray(m)?m:(m==null?void 0:m.versions)??[]})]).then(([i,m])=>{if(t)return;u(i),x(m);const f=m.find(y=>y.isLatest)??m[0]??null;L(f?f.version:null),T(!1)}).catch(i=>{t||(D(i instanceof Error?i.message:String(i)),T(!1))}),()=>{t=!0}},[v,H]),d.useEffect(()=>{function t(o){if(o.key==="Escape")o.stopPropagation(),R();else if(o.key==="Tab"){const c=z.current;if(!c)return;const i=c.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(i.length===0)return;const m=i[0],f=i[i.length-1],y=document.activeElement;o.shiftKey&&y===m?(o.preventDefault(),f.focus()):!o.shiftKey&&y===f&&(o.preventDefault(),m.focus())}}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[]);const R=d.useCallback(()=>{s();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}}))},[s]),j=me(n,r),E=(n==null?void 0:n.skillSlug)??r.slug,_=(n==null?void 0:n.displayName)??r.displayName??E,q=(n==null?void 0:n.isBlocked)===!0,S=d.useMemo(()=>g.length===0?[]:[...g].sort((o,c)=>{const i=o.publishedAt?Date.parse(o.publishedAt):0;return(c.publishedAt?Date.parse(c.publishedAt):0)-i}).slice(0,5),[g]),A=d.useMemo(()=>!h||S.length===0?!0:S[0].version===h,[h,S]),p=d.useMemo(()=>h?fe(j,E,A?null:h,k):null,[j,E,h,A,k]),C=d.useCallback(async()=>{if(!p||!p.ok)return;const t=await P(p.command);U(a,{skillName:v,version:h??"",q:"",ts:Date.now()});const o=t?`Run ${p.command} in your terminal`:"Copy failed — please copy the command manually.";if(l)try{l(o,t?"success":"error")}catch{}else F(o,t?"success":"error",3500)},[p,a,v,h,j,E,A,l]),G=d.useCallback(async()=>{if(!p||!p.ok)return;const t=`${j}/${E}`;if(l)try{l(`Installing ${t}…`,"info")}catch{}else F(`Installing ${t}…`,"info",5e3);let o=null;try{const f=await fetch("/api/studio/install-skill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skill:t,scope:k})});if(f.status===404)return C();if(!f.ok){const $=(await f.json().catch(()=>({}))).error||`Install failed (HTTP ${f.status})`;if(l)try{l($,"error")}catch{}else F($,"error",6e3);return}const y=await f.json();o=(y==null?void 0:y.jobId)??null}catch{return C()}if(!o||typeof EventSource>"u")return;const c=new EventSource(`/api/studio/install-skill/${o}/stream`),m=setTimeout(()=>{try{c.close()}catch{}},2e5);c.addEventListener("done",f=>{var V;clearTimeout(m);try{c.close()}catch{}let y={};try{y=JSON.parse(f.data)}catch{}const w=y.success===!0,$=w?`Installed ${t} (${k})`:`Install failed: ${((V=y.stderr)==null?void 0:V.trim().split(/\r?\n/).slice(-1)[0])||"see terminal"}`;if(l)try{l($,w?"success":"error")}catch{}else F($,w?"success":"error",w?4e3:8e3)}),c.onerror=()=>{clearTimeout(m);try{c.close()}catch{}}},[p,j,E,k,l,C]),Z=(n==null?void 0:n.trustTier)??"T1",J=(n==null?void 0:n.certTier)==="CERTIFIED"||(n==null?void 0:n.certTier)==="VERIFIED"?n.certTier:"VERIFIED";return e.jsxs("div",{ref:z,"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&&R()},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:N,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, #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:[b&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-secondary, #5A5651)"},children:"Loading…"}),I&&!b&&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: ",I]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>K(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"})]}),!b&&!I&&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(Y,{tier:Z}),e.jsx(X,{tier:J,isTainted:n==null?void 0:n.isTainted}),e.jsx(te,{repoUrl:(n==null?void 0:n.repoUrl)??null}),e.jsx(se,{skillName:v,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"}),S.length===0?e.jsx("div",{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:S.map(t=>{const o=t.version===h,c=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":o?"true":"false","aria-pressed":o,onClick:()=>L(t.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:o?"1px solid var(--color-action, #2F5B8E)":"1px solid var(--color-rule, #E8E1D6)",background:o?"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:o?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",t.version]}),c&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",c]}),i&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",i]}),o&&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:`${de}/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 →"})})]}),q?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."})]}):p&&!p.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:[p.reason," — refusing to render the install panel for safety."]})]}):p&&p.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 o=k===t,c=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":o,"data-testid":`skill-detail-install-scope-${t}`,title:c,onClick:()=>W(t),style:{padding:"0.25rem 0.6rem",borderRadius:4,border:`1px solid ${o?"var(--text-primary, #191919)":"var(--color-rule, #E8E1D6)"}`,background:o?"var(--text-primary, #191919)":"transparent",color:o?"var(--bg-surface, #FFFFFF)":"var(--text-secondary, #5A5651)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",fontWeight:o?600:400},children:i},t)})]}),e.jsx("button",{type:"button",onClick:G,"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(ae,{compact:!0,children:p.variants.map((t,o)=>e.jsxs("div",{"data-testid":`skill-detail-install-variant-${t.label}`,style:{display:"flex",gap:"0.75rem",alignItems:"flex-start",marginTop:o===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 c=await P(t.command),i=c?`Run ${t.command} in your terminal`:"Copy failed — please copy the command manually.";if(l)try{l(i,c?"success":"error")}catch{}else F(i,c?"success":"error",3500);c&&U(a,{skillName:v,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{xe as SkillDetailPanel,xe as default};
|
|
1
|
+
import{j as e,r as d,T as X}from"./index-vzRnBcdU.js";import{s as B}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 Y({tier:r}){const s=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: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:[r," ",s.label]})}const Q=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function ee(r){var g,x;const a=r.trim().match(Q);if(!a)return null;const l=(g=a[1])==null?void 0:g.toLowerCase();let n=(x=a[2])==null?void 0:x.toLowerCase();if(!l||!n)return null;n=n.replace(/\.git$/,"");const u=`https://github.com/${l}/${n}`;return{owner:l,name:n,url:u}}function te({repoUrl:r,mono:s="var(--font-geist-mono)",fontSize:a="0.75rem",showPlaceholder:l=!0}){if(!r)return l?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a},children:"--"}):null;const n=ee(r);return n?e.jsxs("a",{"data-testid":"repo-link",href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:u=>u.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:a,fontFamily:s},children:[n.owner,"/",n.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:a,fontFamily:s},children:r})}const re="var(--font-geist-mono)",ne={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},oe={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function se({skillName:r,repoUrl:s}){const[a,l]=d.useState(null),[n,u]=d.useState(!1);if(d.useEffect(()=>{s&&(u(!0),fetch(B(r,"repo-health")).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.json()}).then(b=>{l(b.status),u(!1)}).catch(()=>{l(null),u(!1)}))},[r,s]),!s)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=ne[a]??"var(--status-neutral-text)",x=oe[a]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:re,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 ae({children:r,compact:s}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code, #161B22)",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:r})}const ie="/api/v1/studio/telemetry/install-copy",le=/^[a-zA-Z0-9._@/-]+$/,ce=/^[a-zA-Z0-9._-]+$/,de="https://verified-skill.com";function ue(r){return`${r.owner}/${r.repo}/${r.slug}`}function me(r,s){return r!=null&&r.ownerSlug&&(r!=null&&r.repoSlug)?`${r.ownerSlug}/${r.repoSlug}`:r!=null&&r.publisher?r.publisher:`${s.owner}/${s.repo}`}function pe(r){return r==="global"?" --global":` --scope ${r}`}function fe(r,s,a,l){const n=a?`${r}/${s}@${a}`:`${r}/${s}`;if(!le.test(`${r}/${s}`))return{ok:!1,reason:"Invalid skill identifier"};if(a&&!ce.test(a))return{ok:!1,reason:"Invalid version identifier"};const u=pe(l),g=`npx vskill@latest install ${n}${u}`,x=[{label:"npm",comment:"# npm",command:g},{label:"bun",comment:"# bun",command:`bunx vskill@latest install ${n}${u}`},{label:"pnpm",comment:"# pnpm",command:`pnpx vskill@latest install ${n}${u}`},{label:"yarn",comment:"# yarn",command:`yarn dlx vskill@latest install ${n}${u}`},{label:"alternative",comment:"# alternative (publisher + --skill flag)",command:a?`npx vskill@latest install ${r}@${a} --skill ${s}${u}`:`npx vskill@latest install ${r} --skill ${s}${u}`}];return{ok:!0,command:g,variants:x}}function F(r,s,a){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:r,kind:s,durationMs:a,severity:s==="error"?"error":"info"}}))}async function P(r){var s;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.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 l=document.execCommand("copy");return document.body.removeChild(a),l}catch{return!1}}function U(r,s){try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}catch{}}function xe({selectedSkill:r,onClose:s,telemetryInstallCopyUrl:a=ie,onToast:l}){const[n,u]=d.useState(null),[g,x]=d.useState([]),[b,T]=d.useState(!0),[I,D]=d.useState(null),[h,L]=d.useState(null),[k,W]=d.useState("project"),[H,K]=d.useState(0),z=d.useRef(null),N=d.useRef(null),O=d.useRef(null),v=ue(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 o;return(o=N.current)==null?void 0:o.focus()},50);return()=>clearTimeout(t)},[]),d.useEffect(()=>{let t=!1;T(!0),D(null);const o=B(v),c=B(v,"versions");return Promise.all([fetch(o).then(async i=>{if(!i.ok)throw new Error(`metadata ${i.status}`);return i.json()}),fetch(c).then(async i=>{if(!i.ok)throw new Error(`versions ${i.status}`);const m=await i.json();return Array.isArray(m)?m:(m==null?void 0:m.versions)??[]})]).then(([i,m])=>{if(t)return;u(i),x(m);const f=m.find(y=>y.isLatest)??m[0]??null;L(f?f.version:null),T(!1)}).catch(i=>{t||(D(i instanceof Error?i.message:String(i)),T(!1))}),()=>{t=!0}},[v,H]),d.useEffect(()=>{function t(o){if(o.key==="Escape")o.stopPropagation(),R();else if(o.key==="Tab"){const c=z.current;if(!c)return;const i=c.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(i.length===0)return;const m=i[0],f=i[i.length-1],y=document.activeElement;o.shiftKey&&y===m?(o.preventDefault(),f.focus()):!o.shiftKey&&y===f&&(o.preventDefault(),m.focus())}}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[]);const R=d.useCallback(()=>{s();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}}))},[s]),j=me(n,r),E=(n==null?void 0:n.skillSlug)??r.slug,_=(n==null?void 0:n.displayName)??r.displayName??E,q=(n==null?void 0:n.isBlocked)===!0,S=d.useMemo(()=>g.length===0?[]:[...g].sort((o,c)=>{const i=o.publishedAt?Date.parse(o.publishedAt):0;return(c.publishedAt?Date.parse(c.publishedAt):0)-i}).slice(0,5),[g]),A=d.useMemo(()=>!h||S.length===0?!0:S[0].version===h,[h,S]),p=d.useMemo(()=>h?fe(j,E,A?null:h,k):null,[j,E,h,A,k]),C=d.useCallback(async()=>{if(!p||!p.ok)return;const t=await P(p.command);U(a,{skillName:v,version:h??"",q:"",ts:Date.now()});const o=t?`Run ${p.command} in your terminal`:"Copy failed — please copy the command manually.";if(l)try{l(o,t?"success":"error")}catch{}else F(o,t?"success":"error",3500)},[p,a,v,h,j,E,A,l]),G=d.useCallback(async()=>{if(!p||!p.ok)return;const t=`${j}/${E}`;if(l)try{l(`Installing ${t}…`,"info")}catch{}else F(`Installing ${t}…`,"info",5e3);let o=null;try{const f=await fetch("/api/studio/install-skill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skill:t,scope:k})});if(f.status===404)return C();if(!f.ok){const $=(await f.json().catch(()=>({}))).error||`Install failed (HTTP ${f.status})`;if(l)try{l($,"error")}catch{}else F($,"error",6e3);return}const y=await f.json();o=(y==null?void 0:y.jobId)??null}catch{return C()}if(!o||typeof EventSource>"u")return;const c=new EventSource(`/api/studio/install-skill/${o}/stream`),m=setTimeout(()=>{try{c.close()}catch{}},2e5);c.addEventListener("done",f=>{var V;clearTimeout(m);try{c.close()}catch{}let y={};try{y=JSON.parse(f.data)}catch{}const w=y.success===!0,$=w?`Installed ${t} (${k})`:`Install failed: ${((V=y.stderr)==null?void 0:V.trim().split(/\r?\n/).slice(-1)[0])||"see terminal"}`;if(l)try{l($,w?"success":"error")}catch{}else F($,w?"success":"error",w?4e3:8e3)}),c.onerror=()=>{clearTimeout(m);try{c.close()}catch{}}},[p,j,E,k,l,C]),Z=(n==null?void 0:n.trustTier)??"T1",J=(n==null?void 0:n.certTier)==="CERTIFIED"||(n==null?void 0:n.certTier)==="VERIFIED"?n.certTier:"VERIFIED";return e.jsxs("div",{ref:z,"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&&R()},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:N,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, #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:[b&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-secondary, #5A5651)"},children:"Loading…"}),I&&!b&&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: ",I]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>K(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"})]}),!b&&!I&&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(Y,{tier:Z}),e.jsx(X,{tier:J,isTainted:n==null?void 0:n.isTainted}),e.jsx(te,{repoUrl:(n==null?void 0:n.repoUrl)??null}),e.jsx(se,{skillName:v,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"}),S.length===0?e.jsx("div",{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:S.map(t=>{const o=t.version===h,c=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":o?"true":"false","aria-pressed":o,onClick:()=>L(t.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:o?"1px solid var(--color-action, #2F5B8E)":"1px solid var(--color-rule, #E8E1D6)",background:o?"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:o?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",t.version]}),c&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",c]}),i&&e.jsxs("span",{style:{color:"var(--text-secondary, #5A5651)"},children:["· ",i]}),o&&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:`${de}/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 →"})})]}),q?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."})]}):p&&!p.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:[p.reason," — refusing to render the install panel for safety."]})]}):p&&p.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 o=k===t,c=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":o,"data-testid":`skill-detail-install-scope-${t}`,title:c,onClick:()=>W(t),style:{padding:"0.25rem 0.6rem",borderRadius:4,border:`1px solid ${o?"var(--text-primary, #191919)":"var(--color-rule, #E8E1D6)"}`,background:o?"var(--text-primary, #191919)":"transparent",color:o?"var(--bg-surface, #FFFFFF)":"var(--text-secondary, #5A5651)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",fontWeight:o?600:400},children:i},t)})]}),e.jsx("button",{type:"button",onClick:G,"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(ae,{compact:!0,children:p.variants.map((t,o)=>e.jsxs("div",{"data-testid":`skill-detail-install-variant-${t.label}`,style:{display:"flex",gap:"0.75rem",alignItems:"flex-start",marginTop:o===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 c=await P(t.command),i=c?`Run ${t.command} in your terminal`:"Copy failed — please copy the command manually.";if(l)try{l(i,c?"success":"error")}catch{}else F(i,c?"success":"error",3500);c&&U(a,{skillName:v,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{xe as SkillDetailPanel,xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,
|
|
1
|
+
import{r as v,e as N,a as E,j as a,f as L}from"./index-vzRnBcdU.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};
|