(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87486,e=>{"use strict";var t=e.i(32217),a=e.i(94237),r=e.i(56285),i=e.i(75157);let s=(0,a.cva)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",asChild:n=!1,...l}){let d=n?r.Slot.Root:"span";return(0,t.jsx)(d,{"data-slot":"badge","data-variant":a,className:(0,i.cn)(s({variant:a}),e),...l})}])},14717,e=>{"use strict";var t=e.i(32217),a=e.i(96586),r=e.i(92275),i=e.i(87486),s=e.i(19455),n=e.i(75157),l=e.i(80932),d=e.i(53502);let o=(0,d.createServerReference)("70e36018e956ae214965aea4cb56ab1e2342da1971",d.callServer,void 0,d.findSourceMapURL,"setSkillEnabledAction"),c={all:"All",enabled:"Enabled",disabled:"Disabled"};function u({skill:e,agentSlug:d}){let[c,b]=(0,a.useTransition)(),[x,m]=(0,a.useState)(null),g=x??!e.disabled;return(0,t.jsxs)("li",{className:(0,n.cn)("flex items-start gap-3 px-4 py-3 transition-opacity",!g&&"opacity-70"),children:[(0,t.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-md border bg-background text-base",children:e.emoji??"·"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-sm",children:e.name}),e.bundled&&(0,t.jsx)(i.Badge,{variant:"outline",className:"h-4 px-1 text-[9px] uppercase tracking-wide",children:"bundled"}),e.always&&(0,t.jsx)(i.Badge,{variant:"secondary",className:"h-4 px-1 text-[9px] uppercase tracking-wide",children:"always-on"}),g&&!e.eligible&&(0,t.jsx)(i.Badge,{variant:"outline",className:"h-4 px-1 text-[9px] uppercase tracking-wide text-amber-600 dark:text-amber-400",title:"Enabled in config, but a requirement is missing (binary, allowlist, agent filter).",children:"needs setup"})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description}),(0,t.jsx)("p",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground/70",children:e.source})]}),(0,t.jsx)("div",{className:"shrink-0 self-center",children:(0,t.jsx)(s.Button,{type:"button",variant:g?"outline":"default",size:"sm",onClick:function(){let t=!g;m(t),b(async()=>{let a=await o(e.skillKey,t,d);a.ok?l.toast.success(`${t?"Enabled":"Disabled"} ${e.name}`):(m(!t),l.toast.error(a.error??`Could not ${t?"enable":"disable"} ${e.name}`))})},disabled:c||e.always,title:e.always?"Always-on skill; cannot be disabled.":void 0,className:"h-7 w-20 text-xs",children:c?(0,t.jsx)(r.Loader2,{className:"size-3.5 animate-spin"}):g?"Enabled":"Enable"})})]})}e.s(["SkillsList",0,function({skills:e,agentSlug:r}){let[i,s]=(0,a.useState)("all"),l=(0,a.useMemo)(()=>{let t=0,a=0;for(let r of e)r.disabled?a++:t++;return{all:e.length,enabled:t,disabled:a}},[e]),d=(0,a.useMemo)(()=>"all"===i?e:"enabled"===i?e.filter(e=>!e.disabled):e.filter(e=>e.disabled),[e,i]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"inline-flex items-center gap-1 rounded-lg border bg-muted/40 p-1",role:"tablist","aria-label":"Filter skills",children:Object.keys(c).map(e=>{let a=i===e;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>s(e),className:(0,n.cn)("rounded-md px-3 py-1 text-xs font-medium transition-colors",a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[c[e],(0,t.jsx)("span",{className:"ml-1.5 text-[10px] tabular-nums text-muted-foreground",children:l[e]})]},e)})}),0===d.length?(0,t.jsx)("div",{className:"rounded-lg border bg-card py-10 text-center text-sm text-muted-foreground",children:"No skills match this filter."}):(0,t.jsx)("ul",{className:"divide-y rounded-lg border bg-card",children:d.map(e=>(0,t.jsx)(u,{skill:e,agentSlug:r},e.skillKey))})]})}],14717)}]);