vskill 0.5.111 → 0.5.112
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/eval-server/api-routes.js +17 -2
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-ui/assets/{CommandPalette-3uEyvGv4.js → CommandPalette-BmPDARqF.js} +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-BwCHOfIG.js → CreateSkillPage-C9oCWsMA.js} +1 -1
- package/dist/eval-ui/assets/{UpdateDropdown-ChlvOAxP.js → UpdateDropdown-DRPVz-9R.js} +1 -1
- package/dist/eval-ui/assets/{index-Cz3c_CKh.js → index-TyJIV4hi.js} +28 -28
- package/dist/eval-ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,u as H,a as O,R as G,r as c,g as E,b as R,w as _,c as $,t as j,L as S,P as q,E as K,d as U,S as Y}from"./index-
|
|
1
|
+
import{j as e,u as H,a as O,R as G,r as c,g as E,b as R,w as _,c as $,t as j,L as S,P as q,E as K,d as U,S as Y}from"./index-TyJIV4hi.js";/* empty css */const V=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function Q({supported:l,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:l?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:l?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${l?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function I({agent:l,checked:a,onToggle:x}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:l.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:x,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:l.displayName}),l.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:V.map(n=>e.jsx(Q,{supported:l.featureSupport[n.key],label:n.label},n.key))})]})]})}function Z({agents:l,selectedIds:a,onChange:x}){const n=new Set(a),g=l.filter(o=>o.isUniversal),v=l.filter(o=>!o.isUniversal),m=o=>{const y=n.has(o)?a.filter(b=>b!==o):[...a,o];x(y)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[g.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:g.map(o=>e.jsx(I,{agent:o,checked:n.has(o.id),onToggle:()=>m(o.id)},o.id))})]}),v.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:v.map(o=>e.jsx(I,{agent:o,checked:n.has(o.id),onToggle:()=>m(o.id)},o.id))})]})]})}const p={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function J(l){return l?/API usage limits|usage limit/i.test(l)&&/regain access|reset/i.test(l):!1}function X(l){const a=l.match(/regain access on ([^"\\]+?)(?:\s*UTC)?["\\]/i)??l.match(/regain access on ([^"\\]+)/i);return a?`Resets ${a[1].trim()} UTC`:"Quota resets at the start of your next billing period"}function k(l){switch(l){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 L({size:l=14,color:a="currentColor"}){return e.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:a,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 l=H(),{config:a}=O(),x=G.useMemo(()=>{if(typeof window>"u")return{};const r=window.location.hash,s=r.indexOf("?");if(s===-1)return{};const u=new URLSearchParams(r.slice(s+1)),d={};for(const i of["mode","skillName","description","pluginName"]){const f=u.get(i);f&&(d[i]=f)}return d},[]),[n,g]=c.useState("claude-cli"),[v,m]=c.useState("sonnet"),[o,y]=c.useState(!1),[b,C]=c.useState(null),w=c.useRef(!1),[P,T]=c.useState([]),[F,z]=c.useState(()=>E("activeAgent",null));c.useEffect(()=>{function r(){z(E("activeAgent",null))}return window.addEventListener("studio:agent-changed",r),window.addEventListener("storage",r),()=>{window.removeEventListener("studio:agent-changed",r),window.removeEventListener("storage",r)}},[]);const B=F!=="claude-code";c.useEffect(()=>{fetch("/api/agents/installed").then(r=>r.json()).then(r=>{r.agents&&T(r.agents)}).catch(()=>{})},[]),c.useEffect(()=>{var d;if(!a)return;const r=a.providers.filter(i=>i.available),s=R().skillGenModel;if(r.length===0){w.current=!0;return}if(s&&typeof s=="object"&&typeof s.provider=="string"&&typeof s.model=="string"){const i=r.find(N=>N.id===s.provider),f=i==null?void 0:i.models.some(N=>N.id===s.model);if(i&&f){g(s.provider),m(s.model),y(!0),w.current=!0;return}C({provider:s.provider,model:s.model})}if(r.find(i=>i.id==="claude-cli"))g("claude-cli"),m("sonnet");else{const i=r[0];g(i.id),m(((d=i.models[0])==null?void 0:d.id)??"")}y(!1),w.current=!0},[a]),c.useEffect(()=>{const r=s=>{if(s.key!==null&&!s.key.includes("vskill.studio.prefs"))return;const d=R().skillGenModel;d&&typeof d=="object"&&typeof d.provider=="string"&&typeof d.model=="string"&&(g(d.provider),m(d.model),y(!0))};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},[]);const A=c.useCallback((r,s)=>{_("skillGenModel",{provider:r,model:s}),y(!0)},[]),D=c.useCallback(()=>({provider:n,model:v}),[n,v]),W=x.mode==="standalone"?3:void 0,t=$({onCreated:(r,s)=>l(`/skills/${r}/${s}`),resolveAiConfigOverride:D,forceLayout:W});c.useEffect(()=>{x.skillName&&!t.name&&t.setName(j(x.skillName)),x.description&&!t.description&&t.setDescription(x.description),x.description&&!t.aiPrompt&&t.setAiPrompt(x.description),x.pluginName&&!t.plugin&&t.setPlugin(j(x.pluginName))},[]);const h=a==null?void 0:a.providers.find(r=>r.id===n&&r.available),M=c.useMemo(()=>{const r=["---"];return t.description?r.push(`description: "${t.description.replace(/"/g,'\\"')}"`):r.push('description: ""'),t.allowedTools.trim()&&r.push(`allowed-tools: ${t.allowedTools.trim()}`),t.model&&r.push(`model: ${t.model}`),t.targetAgents.length>0&&r.push(`target-agents: ${t.targetAgents.join(", ")}`),r.push("---"),r.push(""),t.body.trim()?r.push(t.body.trim()):(r.push(`# /${t.name||"skill-name"}`),r.push(""),r.push("You are a helpful assistant.")),r.join(`
|
|
2
2
|
`)},[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(S,{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(L,{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.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(L,{size:13,color:"var(--purple)"})}),"Describe Your Skill"]}),e.jsx("textarea",{ref:t.promptRef,value:t.aiPrompt,onChange:r=>t.setAiPrompt(r.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
3
3
|
|
|
4
4
|
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:{...p,minHeight:"140px"},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.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"}),!o&&n==="claude-cli"&&v==="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:()=>C(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:h?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:n,onChange:r=>{var i;const s=r.target.value;g(s);const u=a==null?void 0:a.providers.find(f=>f.id===s),d=((i=u==null?void 0:u.models[0])==null?void 0:i.id)??v;u!=null&&u.models[0]&&m(d),A(s,d)},disabled:t.generating||!h,title:h?k(n)||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:p,children:a==null?void 0:a.providers.filter(r=>r.available).map(r=>e.jsx("option",{value:r.id,title:k(r.id),children:r.label},r.id))}),k(n)&&e.jsxs("div",{className:"mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:[k(n),n==="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:v,onChange:r=>{const s=r.target.value;m(s),A(n,s)},disabled:t.generating||!h,className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:h==null?void 0:h.models.map(r=>e.jsx("option",{value:r.id,children:r.label},r.id))})]})]})]}),B&&P.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(Z,{agents:P,selectedIds:t.targetAgents,onChange:t.setTargetAgents})]}),t.generating&&t.aiProgress.length>0&&e.jsx("div",{children:e.jsx(q,{entries:t.aiProgress,isRunning:!0})}),t.aiError&&e.jsx("div",{children:J(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:[X(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(K,{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(L,{size:14})," Generate Skill"]}),e.jsx(S,{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:M})]})})})]}),!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(r=>e.jsx("button",{onClick:()=>{t.setSelectedLayout(r.layout);const s=r.existingPlugins[0];t.setPlugin(s||""),t.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150 whitespace-nowrap",style:{background:t.selectedLayout===r.layout?"var(--accent)":"var(--surface-3)",color:t.selectedLayout===r.layout?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${t.selectedLayout===r.layout?"var(--accent)":"var(--border-subtle)"}`},children:r.label},r.layout)),!t.creatableLayouts.find(r=>r.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:r=>{t.setPlugin(r.target.value),t.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:[t.availablePlugins.map(r=>e.jsx("option",{value:r,children:r},r)),e.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),t.plugin==="__new__"&&e.jsx("input",{type:"text",value:t.newPlugin,onChange:r=>t.setNewPlugin(j(r.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:p})]})]}),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:r=>t.setName(j(r.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p})]}),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:r=>t.setDescription(r.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:{...p,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:r=>t.setModel(r.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,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:r=>t.setAllowedTools(r.target.value),placeholder:"Read, Write, Edit, Bash, Glob, Grep",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p})]})]})]}),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(r=>e.jsxs("button",{onClick:()=>t.setBodyViewMode(r),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:t.bodyViewMode===r?"var(--surface-4)":"transparent",color:t.bodyViewMode===r?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:t.bodyViewMode===r?600:400,border:"none",cursor:"pointer"},children:[r==="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:r==="write"?"Write":"Preview"})]},r))})]}),t.bodyViewMode==="write"?e.jsx("textarea",{value:t.body,onChange:r=>t.setBody(r.target.value),placeholder:`# /my-skill
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as t}from"./index-
|
|
1
|
+
import{r as u,j as t}from"./index-TyJIV4hi.js";/* empty css */function v(s,r){const[x,m]=s.split("."),[f,o]=r.split("."),n=Number(x),i=Number(m),l=Number(f),d=Number(o);return!Number.isFinite(n)||!Number.isFinite(l)?(console.warn(`[semverBump] unparseable version: installed=${s} latest=${r}`),"patch"):l>n?"major":!Number.isFinite(i)||!Number.isFinite(d)?(console.warn(`[semverBump] unparseable minor: installed=${s} latest=${r}`),"patch"):d>i?"minor":"patch"}const g={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}};function j({updates:s,isRefreshing:r,onRefresh:x,onSelectSkill:m,onViewAll:f,onClose:o,anchorRef:n,diffSummariesById:i}){const l=u.useRef(null),d=u.useRef(null);u.useEffect(()=>{var e;(e=d.current)==null||e.focus()},[]),u.useEffect(()=>{function e(a){l.current&&(l.current.contains(a.target)||n!=null&&n.current&&n.current.contains(a.target)||o())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o,n]),u.useEffect(()=>{function e(a){var p;a.key==="Escape"&&(a.preventDefault(),o(),(p=n==null?void 0:n.current)==null||p.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o,n]);const c=s.filter(e=>e.updateAvailable);return t.jsxs("div",{ref:l,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:320,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:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[t.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:c.length===0?"No updates available":`${c.length} updates available`}),t.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:x,disabled:r,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:r?"not-allowed":"pointer",padding:"2px 6px"},children:r?"Refreshing…":"Refresh"})]}),c.length>0?t.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:c.map((e,a)=>{const p=e.latest?v(e.installed,e.latest):"patch",y=g[p],b=i==null?void 0:i.get(e.name);return t.jsx("li",{style:{margin:0},children:t.jsxs("button",{ref:a===0?d:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>m(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:[t.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":p,style:{width:8,height:8,borderRadius:"50%",background:y.text,flexShrink:0,marginTop:4}}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[t.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),b&&t.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b})]})]})},e.name)})}):t.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),t.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:t.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:f,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{j as default};
|