@cline/cli-windows-arm64 3.0.53 → 3.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/bin/cline.exe +0 -0
  2. package/cline-hub/webview/assets/{Chat-5-m425Jp.js → Chat-Ddr1_y0K.js} +1 -1
  3. package/cline-hub/webview/assets/{extensions-view-Cd8F5xpl.js → extensions-view-BPiQgdTf.js} +1 -1
  4. package/cline-hub/webview/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  5. package/cline-hub/webview/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  6. package/cline-hub/webview/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  7. package/cline-hub/webview/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  8. package/cline-hub/webview/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  9. package/cline-hub/webview/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  10. package/cline-hub/webview/assets/{index-CfNkVILD.js → index-D_uZQMMw.js} +2 -2
  11. package/cline-hub/webview/assets/index-Dwkfosyp.css +1 -0
  12. package/cline-hub/webview/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  13. package/cline-hub/webview/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  14. package/cline-hub/webview/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  15. package/cline-hub/webview/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  16. package/cline-hub/webview/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  17. package/cline-hub/webview/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  18. package/cline-hub/webview/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  19. package/cline-hub/webview/assets/{settings-view-DS30eWav.js → settings-view-CBVLcC-5.js} +1 -1
  20. package/cline-hub/webview/index.html +2 -2
  21. package/package.json +1 -1
  22. package/cline-hub/webview/assets/index-BzdZ8J4d.css +0 -1
  23. package/cline-hub/webview/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
  24. package/cline-hub/webview/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,r as n}from"./bundle-mjs-CSP5ngA5.js";import{F as r,L as i,R as a,c as o,w as s}from"./vscode-tfEHsPTc.js";import{i as c,o as l,r as u,t as d}from"./switch-1OAUgxzd.js";import{a as f,i as p,n as m,r as h,t as g}from"./desktop-client-Cc9yU7GV.js";import{C as _,E as v,S as y,T as b,d as x,f as ee,i as te,k as S,l as C,o as ne,s as re,u as ie}from"./index-CfNkVILD.js";import{n as ae,t as w}from"./badge-DJicQweE.js";var T=i(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),E=i(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),oe=i(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),D=e(t(),1),O=`/api/marketplace/catalog`,k={version:1,counts:{total:0,plugins:0,skills:0,mcps:0},tags:[],entries:[]};function A(e){return e===`mcp`||e===`skill`||e===`plugin`}function j(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function M(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function N(e){if(!Array.isArray(e))return;let t=e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.name!=`string`)return null;let n={name:t.name};return typeof t.required==`boolean`&&(n.required=t.required),typeof t.description==`string`&&(n.description=t.description),typeof t.url==`string`&&(n.url=t.url),n}).filter(e=>e!==null);return t.length>0?t:void 0}async function se(){let e=await fetch(O,{headers:{Accept:`application/json`}});if(!e.ok)throw Error(`Failed to fetch marketplace: ${e.status}`);let t=await e.json(),n=typeof t?.baseUrl==`string`?t.baseUrl:void 0,r=typeof t?.counts==`object`&&t.counts!==null?t.counts:{},i=Array.isArray(t?.tags)?t.tags.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||typeof t.label!=`string`?null:{id:t.id,label:t.label,count:M(t.count)}}).filter(e=>e!==null):[],a=Array.isArray(t?.entries)?t.entries.map(e=>{if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.install==`object`&&t.install!==null?t.install:{};return typeof t.id!=`string`||!A(t.type)||typeof t.name!=`string`||typeof t.tagline!=`string`||typeof t.description!=`string`||typeof n.command!=`string`?null:{id:t.id,type:t.type,name:t.name,featured:typeof t.featured==`boolean`?t.featured:void 0,tagline:t.tagline,description:t.description,tags:j(t.tags),install:{args:j(n.args),command:n.command,env:N(n.env),notes:typeof n.notes==`string`?n.notes:void 0}}}).filter(e=>e!==null&&e.install.args.length>0):[];return{version:M(t?.version)||k.version,generatedAt:typeof t?.generatedAt==`string`?t.generatedAt:void 0,baseUrl:n,counts:{total:M(r.total)||a.length,plugins:M(r.plugins),skills:M(r.skills),mcps:M(r.mcps)},tags:i,entries:a}}var P=n(),F=3e5,ce={fontFamily:`ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace`},I={mcp:{title:`MCP Servers`,description:`Install Model Context Protocol servers into this CLI environment.`,emptyInstalled:`No MCP servers installed.`,emptyCatalog:`No MCP servers match the current filters.`,icon:_},skill:{title:`Skills`,description:`Install skills globally for Cline.`,emptyInstalled:`No skills installed.`,emptyCatalog:`No skills match the current filters.`,icon:m},plugin:{title:`Plugins`,description:`Install plugins into this CLI environment.`,emptyInstalled:`No plugins installed.`,emptyCatalog:`No plugins match the current filters.`,icon:E}},le={mcp:`cline mcp install`,plugin:`cline plugin install`,skill:`cline skill add`};function L(e){return`${e.type}:${e.id}`}function R(e,t){return Number(!!t.featured)-Number(!!e.featured)}function z(e){return e.trim().toLowerCase()}function B(e){return new Set([e.id,e.name,...e.install.args].map(z).filter(Boolean))}function V(e,t){let n=B(e);return t.matchValues.map(z).filter(Boolean).some(e=>n.has(e))}function H(e,t){return[e.name,e.tagline,e.description,e.type,...e.tags.map(e=>t.get(e)??e)].join(` `).toLowerCase()}function U(e){if(e?.status===`installed`||e?.status===`uninstalled`||e?.status===`failed`)return e.message}function W({actionState:e,entry:t}){let n=t.install.env?.filter(e=>e.required!==!1)??[],r=t.install.env?.filter(e=>e.required===!1)??[];return n.length>0||r.length>0||t.install.notes||e?.status===`failed`?(0,P.jsxs)(`div`,{className:`grid gap-3 border-t pt-3`,"data-marketplace-entry-details":!0,children:[n.length>0||r.length>0?(0,P.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 p-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-amber-800 dark:text-amber-200`,children:`Environment setup needed`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-800/80 dark:text-amber-100/80`,children:`Add these values to your Cline/plugin environment after install.`}),(0,P.jsx)(`div`,{className:`mt-3 grid gap-2`,children:[...n,...r].map(e=>(0,P.jsxs)(`div`,{className:`rounded-md border border-amber-500/20 bg-background/60 p-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`font-mono text-xs font-semibold`,children:(0,P.jsx)(`span`,{style:ce,children:e.name})}),(0,P.jsx)(w,{variant:`outline`,children:e.required===!1?`Optional`:`Required`})]}),e.description?(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null,e.url?(0,P.jsxs)(`a`,{className:`mt-1 inline-flex items-center gap-1 text-xs text-primary hover:underline`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[`Get value`,(0,P.jsx)(f,{className:`size-3`})]}):null]},e.name))})]}):null,t.install.notes?(0,P.jsx)(`p`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-5 text-muted-foreground`,children:t.install.notes}):null,e?.status===`failed`?(0,P.jsx)(`div`,{className:`max-h-44 overflow-auto rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:e.message}):null]}):null}function G({actionState:e,entry:t,expanded:n,installed:i,installedStatusReady:o,onInstall:c,onToggleExpanded:l,onUninstall:u,matchedLocalItems:d=[],showFeatured:f=!0,showTags:p=!0,sourceLabel:m,tagLabels:g}){let _=I[t.type].icon,v=e?.status===`installing`||e?.status===`uninstalling`,y=!!t.install.env?.length,b=y||!!t.install.notes||e?.status===`failed`,x=U(e),ee=e=>{if(e.stopPropagation(),i){u(t);return}c(t)},te=o?e?.status===`installing`?`Installing...`:e?.status===`uninstalling`?`Uninstalling...`:i?`Uninstall`:`Install`:`Checking...`,S=x?(0,P.jsx)(`output`,{className:a(`text-xs`,e?.status===`failed`?`text-destructive`:`text-muted-foreground`),children:x}):y?(0,P.jsx)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,children:`Requires setup after install`}):null,C=(0,P.jsxs)(s,{disabled:!o||v,onClick:ee,size:`sm`,type:`button`,variant:i?`destructive`:`default`,children:[v||!o?(0,P.jsx)(ae,{}):null,i&&!v?(0,P.jsx)(r,{className:`size-4`}):null,te]}),ne=(0,P.jsxs)(P.Fragment,{children:[i?null:(0,P.jsx)(`div`,{className:`absolute top-4 right-4`,"data-marketplace-entry-interactive":!0,children:C}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,P.jsxs)(`div`,{className:a(`flex min-w-0 flex-1 items-center gap-2`,!i&&`pr-24`),children:[(0,P.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:t.name}),f&&t.featured?(0,P.jsxs)(w,{className:`border border-violet-500/20 bg-violet-500/10 text-violet-700 dark:text-violet-300`,children:[(0,P.jsx)(h,{className:`fill-current`}),`Featured`]}):null]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:[m?(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:m}):null,d.map(e=>e.renderMatchedBadges?(0,P.jsx)(`span`,{className:`contents`,children:e.renderMatchedBadges()},`${e.key}:badges`):null),d.map(e=>e.renderMatchedControls?(0,P.jsx)(`span`,{className:`contents`,"data-marketplace-entry-interactive":!0,children:e.renderMatchedControls()},`${e.key}:controls`):null)]})]}),d.some(e=>e.renderMatchedMeta)?(0,P.jsx)(`div`,{className:`mt-1 grid gap-1`,children:d.map(e=>e.renderMatchedMeta?(0,P.jsx)(`div`,{children:e.renderMatchedMeta()},`${e.key}:meta`):null)}):null]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-stretch sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-2`,children:[p&&t.tags.length>0?(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.tags.slice(0,5).map(e=>(0,P.jsx)(w,{variant:`outline`,className:`max-w-full text-muted-foreground`,children:(0,P.jsx)(`span`,{className:`truncate`,children:g.get(e)??e})},e))}):null,(0,P.jsx)(`p`,{className:`line-clamp-2 text-xs leading-5 text-muted-foreground`,children:t.description}),S]}),i?(0,P.jsx)(`div`,{className:`flex shrink-0 flex-col items-start gap-1 sm:items-end sm:justify-end`,children:C}):null]}),d.some(e=>e.renderMatchedDetails)?(0,P.jsx)(`div`,{className:`grid gap-2`,"data-marketplace-entry-details":!0,children:d.map(e=>e.renderMatchedDetails?(0,P.jsx)(`div`,{children:e.renderMatchedDetails()},e.key):null)}):null,n&&b?(0,P.jsx)(W,{actionState:e,entry:t}):null]});return b?(0,P.jsx)(`div`,{"aria-expanded":n,"aria-label":`${n?`Collapse`:`Expand`} ${t.name}`,className:`relative grid cursor-pointer gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,onClick:e=>{e.target instanceof HTMLElement&&e.target.closest(`[data-marketplace-entry-details], [data-marketplace-entry-interactive]`)||l(t)},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l(t))},role:`button`,tabIndex:0,children:ne}):(0,P.jsx)(`div`,{className:`relative grid gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20`,children:ne})}function ue({active:e,count:t,onClick:n,tag:r}){return(0,P.jsxs)(s,{"aria-pressed":e,onClick:n,size:`sm`,type:`button`,variant:e?`default`:`outline`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:r.label}),(0,P.jsx)(`span`,{className:`rounded bg-background/30 px-1.5 py-0.5 text-xs`,children:t})]})}function K({actionStates:e,emptyMessage:t,entries:n,expandedEntryKey:r,headerContent:i,installedEntryKeys:a,installedStatusReady:o,localOnlyInstalledItems:s=[],matchedLocalItemsByEntryKey:c,onInstall:l,onToggleExpanded:u,onUninstall:d,showFeaturedBadges:f=!0,showEntryTags:p=!0,sourceLabel:m,tagLabels:h,title:g}){let _=n.length+s.length;return(0,P.jsxs)(`section`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:g}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:_})]}),i,_>0?(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[s.map(e=>e.render()),n.map(t=>{let n=L(t);return(0,P.jsx)(G,{actionState:e.get(n),entry:t,expanded:r===n,installed:a.has(n),installedStatusReady:o,onInstall:l,onToggleExpanded:u,onUninstall:d,matchedLocalItems:c?.get(n)??[],showFeatured:f,showTags:p,sourceLabel:m,tagLabels:h},n)})]}):(0,P.jsx)(`div`,{className:`rounded-lg border border-dashed bg-card p-6 text-center text-sm text-muted-foreground`,children:t})]})}function de({chrome:e=`page`,installedItems:t,onInstalledItemsChanged:n,primitive:r}){let[i,a]=(0,D.useState)(null),[c,l]=(0,D.useState)(null),[d,f]=(0,D.useState)(``),[p,m]=(0,D.useState)(null),[h,_]=(0,D.useState)(null),[v,y]=(0,D.useState)(()=>new Set),[b,x]=(0,D.useState)(()=>new Map),[ee,S]=(0,D.useState)(`loading`);(0,D.useEffect)(()=>{let e=!1;return(async()=>{try{e||S(`loading`);let t=await se();e||(a(t),l(null));try{let n=await g.invoke(`list_marketplace_installed_entries`,{entries:t.entries});e||(y(new Set(n.installedKeys)),S(`ready`))}catch{e||S(`ready`)}}catch(t){e||(l(t instanceof Error?t.message:String(t)),S(`ready`))}})(),()=>{e=!0}},[]);let C=I[r],ie=C.icon,w=(0,D.useMemo)(()=>new Map(i?.tags.map(e=>[e.id,e.label])??[]),[i?.tags]),T=(0,D.useMemo)(()=>(i?.entries.filter(e=>e.type===r)??[]).sort(R),[i?.entries,r]),E=(0,D.useMemo)(()=>{let e=d.trim().toLowerCase();return T.filter(t=>e.length===0||H(t,w).includes(e))},[T,d,w]),oe=(0,D.useMemo)(()=>E.filter(e=>v.has(L(e))),[E,v]),O=(0,D.useMemo)(()=>E.filter(e=>!v.has(L(e))),[E,v]),k=(0,D.useMemo)(()=>{let e=new Map;for(let t of O)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return e},[O]),A=(0,D.useMemo)(()=>(i?.tags??[]).filter(e=>(k.get(e.id)??0)>0),[i?.tags,k]),j=(0,D.useMemo)(()=>O.filter(e=>!p||e.tags.includes(p)),[O,p]),M=(0,D.useMemo)(()=>{let e=new Map;for(let n of t??[])for(let t of oe){let r=L(t);if(!V(t,n))continue;let i=e.get(r)??[];i.push(n),e.set(r,i)}return e},[oe,t]),N=(0,D.useMemo)(()=>{let e=new Set,n=T.filter(e=>v.has(L(e)));for(let r of t??[])n.some(e=>V(e,r))&&e.add(r.key);return e},[v,t,T]),ce=(0,D.useMemo)(()=>{let e=d.trim().toLowerCase();return(t??[]).filter(t=>N.has(t.key)?!1:e.length===0||t.matchValues.map(z).some(t=>t.includes(e)))},[t,N,d]),B=ee===`ready`,U=A.length>0?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,P.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:A.map(e=>(0,P.jsx)(ue,{active:p===e.id,count:k.get(e.id)??0,onClick:()=>m(t=>t===e.id?null:e.id),tag:e},e.id))}),(0,P.jsxs)(`div`,{className:`flex min-h-8 shrink-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`font-medium text-foreground`,children:j.length}),(0,P.jsx)(`span`,{children:j.length===1?`result`:`results`}),p?(0,P.jsx)(s,{onClick:()=>m(null),size:`sm`,type:`button`,variant:`ghost`,children:`Clear filters`}):null]})]}):null,W=(e,t)=>{let n=L(e);x(e=>{let r=new Map(e);return r.set(n,t),r})},G=e=>{y(t=>new Set(t).add(L(e)))},de=e=>{y(t=>{let n=new Set(t);return n.delete(L(e)),n})},fe=e=>{let t=L(e);_(e=>e===t?null:t)},pe=async e=>{let t=L(e),r=b.get(t);if(r?.status!==`installing`&&r?.status!==`uninstalling`){_(t),W(e,{status:`installing`});try{let t=await g.invoke(`install_marketplace_entry`,{entry:e},{timeoutMs:F});W(e,{status:`installed`,message:t.message}),G(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},me=async e=>{let t=L(e),r=b.get(t);if(r?.status!==`installing`&&r?.status!==`uninstalling`){_(t),W(e,{status:`uninstalling`});try{let t=await g.invoke(`uninstall_marketplace_entry`,{entry:e},{timeoutMs:F});W(e,{status:`uninstalled`,message:t.message}),de(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},q=(0,P.jsxs)(`div`,{className:`grid gap-6`,children:[e===`page`?(0,P.jsx)(re,{description:C.description,icon:ie,title:C.title,meta:(0,P.jsx)(te,{children:le[r]}),actions:i?.generatedAt?(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Updated`,` `,new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}).format(new Date(i.generatedAt))]}):null}):null,!i&&!c?(0,P.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,P.jsx)(ae,{className:`mr-2`}),`Loading marketplace...`]}):null,i&&!B?(0,P.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,P.jsx)(ae,{className:`mr-2`}),`Checking installed status...`]}):null,c?(0,P.jsx)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:c}):null,i&&B?(0,P.jsxs)(`div`,{className:`grid gap-6`,children:[(0,P.jsx)(`div`,{className:`grid gap-3`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-center`,children:(0,P.jsxs)(`div`,{className:`relative block flex-1`,children:[(0,P.jsx)(u,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,P.jsx)(o,{"aria-label":`Search ${C.title}`,className:`h-10 pl-8`,onChange:e=>f(e.target.value),placeholder:`Search ${C.title.toLowerCase()}`,value:d})]})})}),(0,P.jsx)(K,{actionStates:b,emptyMessage:C.emptyInstalled,entries:oe,expandedEntryKey:h,installedEntryKeys:v,installedStatusReady:B,localOnlyInstalledItems:ce,matchedLocalItemsByEntryKey:M,onInstall:pe,onToggleExpanded:fe,onUninstall:me,showFeaturedBadges:!1,showEntryTags:!1,sourceLabel:`Marketplace`,tagLabels:w,title:`Installed`}),(0,P.jsx)(K,{actionStates:b,emptyMessage:C.emptyCatalog,entries:j,expandedEntryKey:h,headerContent:U,installedEntryKeys:v,installedStatusReady:B,onInstall:pe,onToggleExpanded:fe,onUninstall:me,tagLabels:w,title:`Marketplace`})]}):null]});return e===`embedded`?q:(0,P.jsx)(ne,{children:q})}var fe={Rules:`Review project and global rule files that shape Cline behavior.`,Hooks:`Inspect hook configuration and recent execution status.`,MCP:`Manage installed MCP servers and add new servers from the marketplace.`,Skills:`Manage installed skills and add new skills from the marketplace.`,Agents:`Review configured agents discovered from local settings.`,Plugins:`Manage installed plugins and add new plugins from the marketplace.`,Tools:`Inspect built-in tools and tools contributed by plugins.`},pe={Rules:`cline config rules`,Hooks:`cline config hooks`,MCP:`cline mcp install`,Skills:`cline skill`,Agents:`cline config agents`,Plugins:`cline plugin`,Tools:`cline config tools`},me={settingsPath:``,hasSettingsFile:!1,servers:[]};function q(e){return Array.isArray(e)?e:[]}function he(e){return{workspaceRoot:typeof e?.workspaceRoot==`string`?e.workspaceRoot:``,rules:q(e?.rules),workflows:q(e?.workflows),skills:q(e?.skills),agents:q(e?.agents),plugins:q(e?.plugins),tools:q(e?.tools),hooks:q(e?.hooks),mcp:e?.mcp&&typeof e.mcp==`object`?{settingsPath:typeof e.mcp.settingsPath==`string`?e.mcp.settingsPath:``,hasSettingsFile:!!e.mcp.hasSettingsFile,servers:q(e.mcp.servers)}:{...me},warnings:q(e?.warnings)}}var ge=6e4,_e=3e4,J=null,Y=null;function ve(e,t){return!!(e&&t-e.fetchedAt<ge&&Array.isArray(e.tools)&&e.tools.length>0)}function ye(e,t=150){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t).trimEnd()}...`}function X(e){return e.replaceAll(`\\`,`/`)}function be(e,t){let n=X(t),r=X(e);return n&&r.startsWith(`${n}/`)?`Project`:`Global`}function Z({scope:e}){return(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e})}function xe(...e){let t=new Set;for(let n of e){let e=n?.trim().replaceAll(`\\`,`/`);if(!e)continue;t.add(e);let r=e.split(`/`).filter(Boolean);for(let e of r)t.add(e.replace(/\.[^.]+$/,``));for(let e=0;e<r.length-1;e+=1)t.add(`${r[e]}/${r[e+1]}`)}return[...t]}async function Se(){return he(await g.invoke(`list_user_instruction_configs`))}function Ce(e,t){return(e instanceof Error?e.message:String(e)).includes(`unsupported desktop command: ${t}`)}function we({catalogPrimitive:e,section:t=`Rules`,showTabs:n=!1}){let[i,o]=(0,D.useState)(t),[u,f]=(0,D.useState)(()=>!ve(J,Date.now())),[h,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(()=>J?.workspaceRoot??``),[A,j]=(0,D.useState)(()=>J?.rules??[]),[M,N]=(0,D.useState)(()=>J?.workflows??[]),[se,F]=(0,D.useState)(()=>J?.skills??[]),[ce,I]=(0,D.useState)(()=>J?.agents??[]),[le,L]=(0,D.useState)(()=>J?.plugins??[]),[R,z]=(0,D.useState)(()=>J?.tools??[]),[B,V]=(0,D.useState)(()=>J?.hooks??[]),[H,U]=(0,D.useState)(()=>J?.mcp??me),[W,G]=(0,D.useState)(()=>J?.warnings??[]),[ue,K]=(0,D.useState)(()=>Y?.hookExecutionByEvent??{}),[q,ge]=(0,D.useState)(()=>Y?.hookExecutionSessionId??null),[we,Te]=(0,D.useState)(!1),[Ee,De]=(0,D.useState)(()=>new Set),[Oe,ke]=(0,D.useState)(()=>new Set),[Ae,je]=(0,D.useState)(()=>new Set),[Me,Ne]=(0,D.useState)(()=>new Map);(0,D.useEffect)(()=>{o(t)},[t]);let Q=(0,D.useCallback)(async(e=!1)=>{if(!e&&ve(J,Date.now())){k(J.workspaceRoot),j(J.rules),N(J.workflows),F(J.skills),I(J.agents),L(J.plugins),z(J.tools),V(J.hooks),U(J.mcp),G(J.warnings),E(null),f(!1);return}f(!0),E(null);try{let e=await Se();k(e.workspaceRoot),j(e.rules),N(e.workflows),F(e.skills),I(e.agents),L(e.plugins),z(e.tools),V(e.hooks),U(e.mcp),G(e.warnings),J={...e,fetchedAt:Date.now()}}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{f(!1)}},[]),Pe=(0,D.useCallback)(async(e=!1)=>{if(!e&&Y&&Date.now()-Y.fetchedAt<_e){K(Y.hookExecutionByEvent),ge(Y.hookExecutionSessionId);return}Te(!0);try{let e=(await g.invoke(`list_cli_sessions`,{limit:300})??[]).filter(e=>typeof e.sessionId==`string`&&e.sessionId.trim().length>0).sort((e,t)=>(t.startedAt??``).localeCompare(e.startedAt??``))[0];if(!e?.sessionId){K({}),ge(null),Y={hookExecutionByEvent:{},hookExecutionSessionId:null,fetchedAt:Date.now()};return}let t=await g.invoke(`read_session_hooks`,{sessionId:e.sessionId,limit:5e3}),n={};for(let e of t??[]){let t=e.hookEventName?.trim();if(!t)continue;let r=n[t]??{count:0,lastTs:null};r.count+=1,e.ts&&(!r.lastTs||e.ts>r.lastTs)&&(r.lastTs=e.ts),n[t]=r}K(n),ge(e.sessionId),Y={hookExecutionByEvent:n,hookExecutionSessionId:e.sessionId,fetchedAt:Date.now()}}catch{}finally{Te(!1)}},[]),Fe=(0,D.useCallback)(e=>{let t=he(e);k(t.workspaceRoot),j(t.rules),N(t.workflows),F(t.skills),I(t.agents),L(t.plugins),z(t.tools),V(t.hooks),U(t.mcp),G(t.warnings),J={...t,fetchedAt:Date.now()}},[]),Ie=(0,D.useCallback)(async e=>{De(t=>new Set(t).add(e.id)),E(null);try{let t=[e.name,...e.headlessToolNames??[]].filter(Boolean);if(t.length===0)throw Error(`tool name is required`);let n;try{n=await g.invoke(`set_tool_disabled`,{names:t,disabled:e.enabled})}catch(e){if(!Ce(e,`set_tool_disabled`))throw e;for(let e of t)n=await g.invoke(`toggle_disabled_plugin_tool`,{name:e})}if(!n)throw Error(`tool toggle did not return an updated extension list`);Fe(n)}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{De(t=>{let n=new Set(t);return n.delete(e.id),n})}},[Fe]),Le=(0,D.useCallback)(async e=>{ke(t=>new Set(t).add(e.path)),E(null);try{let t=await g.invoke(`set_plugin_disabled`,{path:e.path,disabled:e.enabled});Fe(t)}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{ke(t=>{let n=new Set(t);return n.delete(e.path),n})}},[Fe]),Re=(0,D.useCallback)(async e=>{if(!Ae.has(e.key)){je(t=>new Set(t).add(e.key)),Ne(t=>{let n=new Map(t);return n.delete(e.key),n}),E(null);try{let t=await g.invoke(`uninstall_local_primitive`,{type:e.type,id:e.id,name:e.name,path:e.path});Ne(n=>{let r=new Map(n);return r.set(e.key,{status:`success`,message:t.message??`Uninstalled ${e.name??e.id??e.path}.`}),r}),await Q(!0)}catch(t){let n=t instanceof Error?t.message:String(t);Ne(t=>{let r=new Map(t);return r.set(e.key,{status:`failed`,message:n}),r}),E(n)}finally{je(t=>{let n=new Set(t);return n.delete(e.key),n})}}},[Ae,Q]),ze=(0,D.useCallback)(e=>{if(!e)return`never`;let t=Number(e),n=Number.isFinite(t)?new Date(t):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()},[]);(0,D.useEffect)(()=>{let e=window.setTimeout(()=>{Q(!1)},0);return()=>window.clearTimeout(e)},[Q]),(0,D.useEffect)(()=>{if(i!==`Hooks`)return;let e=window.setTimeout(()=>{Pe(!1)},0);return()=>window.clearTimeout(e)},[i,Pe]);let Be=[`Rules`,`Hooks`,`Skills`,`Agents`,`Plugins`,`Tools`],Ve=(0,D.useMemo)(()=>{let e=M.map(e=>({id:e.id,type:`workflow`,name:e.name,instructions:e.instructions,path:e.path,scope:be(e.path,O)})),t=se.map(e=>({id:X(e.path).toLowerCase(),type:`skill`,name:e.name,description:e.description,instructions:e.instructions,path:e.path,scope:be(e.path,O)}));return[...e,...t].sort((e,t)=>e.name.localeCompare(t.name))},[se,M,O]),{projectRules:He,globalRules:Ue}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of A){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/`)?t.push(r):n.push(r)}return{projectRules:t,globalRules:n}},[A,O]),{projectHooks:We,globalHooks:Ge}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of B){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/hooks`)?t.push(r):n.push(r)}return{projectHooks:t,globalHooks:n}},[B,O]),{projectPlugins:Ke,globalPlugins:qe}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of le){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.cline/plugins`)?t.push(r):n.push(r)}return{projectPlugins:t,globalPlugins:n}},[le,O]),Je=(0,D.useMemo)(()=>R.filter(e=>e.source===`builtin`),[R]),Ye=(0,D.useMemo)(()=>R.filter(e=>e.source!==`builtin`),[R]),$=(0,D.useMemo)(()=>{let e=new Map;for(let t of Ye){let n=t.path??``,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())t.sort((e,t)=>e.name.localeCompare(t.name));return e},[Ye]),Xe=(0,D.useMemo)(()=>[...qe.map(e=>({plugin:e,scope:`Global`})),...Ke.map(e=>({plugin:e,scope:`Project`}))],[qe,Ke]),Ze=(0,D.useMemo)(()=>[...Ue.map(e=>({rule:e,scope:`Global`})),...He.map(e=>({rule:e,scope:`Project`}))],[Ue,He]),Qe=(0,D.useMemo)(()=>[...Ge.map(e=>({hook:e,scope:`Global`})),...We.map(e=>({hook:e,scope:`Project`}))],[Ge,We]),$e=e=>{let t=Me.get(e);return t?(0,P.jsx)(`output`,{className:a(`text-xs`,t.status===`failed`?`text-destructive`:`text-muted-foreground`),children:t.message}):null},et=e=>{let t=Ae.has(e.key);return(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`min-h-5 text-xs text-muted-foreground`,children:$e(e.key)}),(0,P.jsxs)(s,{disabled:t,onClick:()=>{Re(e)},type:`button`,variant:`destructive`,children:[t?(0,P.jsx)(ae,{}):(0,P.jsx)(r,{className:`size-4`}),t?`Uninstalling...`:`Uninstall`]})]})},tt=e=>{let t=Ae.has(e.key);return(0,P.jsxs)(C,{children:[(0,P.jsx)(ee,{render:(0,P.jsx)(s,{"aria-label":`More actions for ${e.name??`plugin`}`,className:`m-0 size-auto shrink-0 p-0 text-muted-foreground`,onClick:e=>e.stopPropagation(),size:`icon`,type:`button`,variant:`ghost`}),children:(0,P.jsx)(T,{className:`size-4`})}),(0,P.jsxs)(ie,{align:`end`,children:[(0,P.jsxs)(x,{onClick:()=>void navigator.clipboard.writeText(e.path??``),children:[(0,P.jsx)(l,{className:`size-4`}),`Copy path`]}),(0,P.jsxs)(x,{className:`text-destructive focus:text-destructive`,disabled:t,onClick:()=>void Re(e),children:[t?(0,P.jsx)(ae,{}):(0,P.jsx)(r,{className:`size-4`}),t?`Uninstalling...`:`Uninstall`]})]})]})},nt=e=>{let t=`${e.type}:${e.path}`;return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,P.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,P.jsx)(m,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:e.scope}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,P.jsx)(`div`,{className:`mt-3`,children:et({key:t,type:e.type,id:e.id,name:e.name,path:e.path})})]},t)},rt=e=>(0,P.jsxs)(`div`,{className:`grid gap-1`,children:[(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:e.path})]}),it=({plugin:e,scope:t})=>{let n=e.path,r=[{label:`Tools`,items:e.contributions?.tools??($.get(e.path)??[]).map(e=>e.name)},{label:`Skills`,items:e.contributions?.skills??[]},{label:`Rules`,items:e.contributions?.rules??[]},{label:`Hooks`,items:e.contributions?.hooks??[]},{label:`Commands`,items:e.contributions?.commands??[]},{label:`MCP servers`,items:e.contributions?.mcpServers??[]},{label:`Providers`,items:e.contributions?.providers??[]},{label:`Capabilities`,items:e.contributions?.capabilities??[]}].filter(e=>e.items.length>0);return(0,P.jsxs)(`details`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:t}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},onClick:e=>e.stopPropagation(),disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`}),tt({key:n,type:`plugin`,id:e.name,name:e.name,path:e.path})]}),(0,P.jsxs)(`div`,{className:`mt-3`,children:[e.contributions?.inspectionStatus===`disabled`?(0,P.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:`Enable this plugin to inspect its dynamic contributions.`}):null,r.length>0?(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-2 text-xs font-medium text-foreground`,children:[(0,P.jsx)(`span`,{className:`mr-1`,children:`Contributions`}),r.map(e=>(0,P.jsxs)(w,{variant:`outline`,children:[e.label,` `,e.items.length]},e.label))]}),(0,P.jsx)(`div`,{className:`grid max-h-56 gap-3 overflow-y-auto pt-2 sm:grid-cols-2`,children:r.map(e=>(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.label}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.items.map(e=>(0,P.jsx)(w,{variant:`secondary`,children:e},e))})]},e.label))})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin contributions found.`})]}),$e(n)?(0,P.jsx)(`div`,{className:`mt-3`,children:$e(n)}):null]},e.path)},at=e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`}),tt({key:e.path,type:`plugin`,id:e.name,name:e.name,path:e.path})]}),ot=e=>{let t=[{label:`Tools`,items:e.contributions?.tools??($.get(e.path)??[]).map(e=>e.name)},{label:`Skills`,items:e.contributions?.skills??[]},{label:`Rules`,items:e.contributions?.rules??[]},{label:`Hooks`,items:e.contributions?.hooks??[]},{label:`Commands`,items:e.contributions?.commands??[]},{label:`MCP servers`,items:e.contributions?.mcpServers??[]},{label:`Providers`,items:e.contributions?.providers??[]},{label:`Capabilities`,items:e.contributions?.capabilities??[]}].filter(e=>e.items.length>0);return t.length===0?null:(0,P.jsx)(`div`,{className:`grid max-h-56 gap-3 overflow-y-auto sm:grid-cols-2`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.label}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.items.map(e=>(0,P.jsx)(w,{variant:`secondary`,children:e},e))})]},e.label))})},st=e=>{let t=e.name;return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:`Global`}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.disabled?`Disabled`:`Enabled`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.url??([e.command,...e.args??[]].filter(Boolean).join(` `)||`No launch command configured.`)}),H.settingsPath?(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:H.settingsPath}):null,(0,P.jsx)(`div`,{className:`mt-3`,children:et({key:t,type:`mcp`,id:e.name,name:e.name})})]},e.name)},ct=e=>(0,P.jsxs)(`div`,{className:`grid gap-1`,children:[(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.disabled?`Disabled`:`Enabled`,` locally`,e.transportType?` via ${e.transportType}`:``]}),H.settingsPath?(0,P.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:H.settingsPath}):null]}),lt=e===`skill`?Ve.map(e=>({key:`${e.type}:${e.path}`,matchValues:xe(e.id,e.name,e.path),render:()=>nt(e),renderMatchedBadges:()=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Z,{scope:e.scope}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),renderMatchedDetails:()=>rt(e)})):e===`plugin`?Xe.map(e=>({key:e.plugin.path,matchValues:xe(e.plugin.name,e.plugin.path),render:()=>it(e),renderMatchedBadges:()=>(0,P.jsx)(Z,{scope:e.scope}),renderMatchedControls:()=>at(e.plugin),renderMatchedDetails:Object.values(e.plugin.contributions??{}).some(e=>e.length>0)||($.get(e.plugin.path)??[]).length>0?()=>ot(e.plugin):void 0})):e===`mcp`?H.servers.map(e=>({key:e.name,matchValues:xe(e.name),render:()=>st(e),renderMatchedBadges:()=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Z,{scope:`Global`}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType})]}),renderMatchedDetails:()=>ct(e)})):null;return(0,P.jsxs)(ne,{children:[(0,P.jsx)(re,{description:fe[i],title:i,meta:(0,P.jsx)(te,{children:pe[i]}),actions:(0,P.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>{Q(!0),i===`Hooks`&&Pe(!0)},disabled:u,children:(0,P.jsx)(p,{className:a(`h-4 w-4`,u&&`animate-spin`)})})}),n?(0,P.jsx)(`div`,{className:`mb-6 flex items-center gap-0 border-b border-border`,children:Be.map(e=>(0,P.jsxs)(s,{variant:`ghost`,onClick:()=>o(e),className:a(`relative px-4 py-2.5 text-sm font-medium transition-colors`,i===e?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e,i===e&&(0,P.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 bg-foreground`})]},e))}):null,h&&(0,P.jsxs)(`div`,{className:`mb-4 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive`,children:[`Failed to load configuration lists: `,h]}),W.length>0&&(0,P.jsxs)(`div`,{className:`mb-4 rounded-lg border border-yellow-500/40 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-700 dark:text-yellow-300`,children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium`,children:[(0,P.jsx)(oe,{className:`h-4 w-4`}),`Partial results`]}),(0,P.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:W.map(e=>(0,P.jsx)(`li`,{children:e},e))})]}),e?(0,P.jsx)(de,{chrome:`embedded`,installedItems:lt??void 0,onInstalledItemsChanged:()=>Q(!0),primitive:e}):null,i===`Rules`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Enabled rules discovered from configured workspace/global directories.`}),(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Ze.length})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ze.map(({rule:e,scope:t})=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(b,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`flex-1 text-sm font-medium text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:t})]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),Ze.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No rules found.`})]})]})]}),i===`Hooks`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Hook config files from workspace and global hook directories.`}),we&&q&&(0,P.jsxs)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:[`Execution status is based on hook events in session`,` `,(0,P.jsx)(`span`,{className:`font-mono`,children:q}),`.`]}),(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Qe.length})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Qe.map(({hook:e,scope:t})=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(v,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`flex-1 text-sm font-mono text-foreground`,children:e.fileName}),(0,P.jsx)(Z,{scope:t}),e.hookEventName&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.hookEventName}),(()=>{let t=ue[e.hookEventName],n=(t?.count??0)>0;return(0,P.jsx)(`span`,{className:a(`rounded border px-2 py-0.5 text-xs`,n?`border-emerald-400/50 text-emerald-600 dark:text-emerald-400`:`border-border text-muted-foreground`),children:n?`${t?.count??0} executed`:`never executed`})})()]})]}),e.hookEventName?(0,P.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Last run:`,` `,ze(ue[e.hookEventName]?.lastTs??null)]}):null,(0,P.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),Qe.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No hooks found.`})]})]})]}),i===`Skills`&&!e&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:[`Skills can be invoked in chat with`,` `,(0,P.jsx)(`code`,{className:`rounded bg-secondary px-1.5 py-0.5 text-xs font-mono text-foreground`,children:`/SKILL`}),`.`]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ve.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,P.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,P.jsx)(m,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.type})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},`${e.type}:${e.path}`)),Ve.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No enabled skills or workflows found.`})]})]}),i===`Agents`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Configured agents discovered from Documents and settings directories.`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[ce.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(S,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name})]}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),ce.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No configured agents found.`})]})]}),i===`Plugins`&&!e&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Plugins discovered from workspace and global plugin directories.`}),(0,P.jsxs)(`div`,{className:`mb-6`,children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Global Plugins`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[qe.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,P.jsxs)(`div`,{className:`mt-3 ml-7 flex max-h-56 flex-col gap-2 overflow-y-auto`,children:[($.get(e.path)??[]).map(e=>(0,P.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:e.name}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`})]})},e.id)),($.get(e.path)?.length??0)===0&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),qe.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No global plugins found.`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Project Plugins`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ke.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,P.jsxs)(`div`,{className:`mt-3 ml-7 flex max-h-56 flex-col gap-2 overflow-y-auto`,children:[($.get(e.path)??[]).map(e=>(0,P.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:e.name}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`})]})},e.id)),($.get(e.path)?.length??0)===0&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),Ke.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No project plugins found.`})]})]})]}),i===`Tools`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Builtin tool groups and plugin-contributed tools available to the runtime.`}),(0,P.jsxs)(`div`,{className:`mb-6`,children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Builtin Tools`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Je.map(e=>(()=>{let t=Ee.has(e.id);return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(y,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Ie(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),!!e.headlessToolNames?.length&&(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.headlessToolNames.join(`, `)})]},e.id)})()),Je.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No builtin tools found.`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Plugin Tools`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ye.map(e=>(()=>{let t=Ee.has(e.id);return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(y,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),e.pluginName&&(0,P.jsxs)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:[`plugin: `,e.pluginName]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Ie(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),e.path&&(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.id)})()),Ye.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No plugin tools found.`})]})]})]})]})}export{we as CustomizationSectionView};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,r as n}from"./bundle-mjs-CSP5ngA5.js";import{F as r,L as i,R as a,c as o,w as s}from"./vscode-tfEHsPTc.js";import{i as c,o as l,r as u,t as d}from"./switch-1OAUgxzd.js";import{a as f,i as p,n as m,r as h,t as g}from"./desktop-client-Cc9yU7GV.js";import{C as _,E as v,S as y,T as b,d as x,f as ee,i as te,k as S,l as C,o as ne,s as re,u as ie}from"./index-D_uZQMMw.js";import{n as ae,t as w}from"./badge-DJicQweE.js";var T=i(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),E=i(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),oe=i(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),D=e(t(),1),O=`/api/marketplace/catalog`,k={version:1,counts:{total:0,plugins:0,skills:0,mcps:0},tags:[],entries:[]};function A(e){return e===`mcp`||e===`skill`||e===`plugin`}function j(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function M(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function N(e){if(!Array.isArray(e))return;let t=e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.name!=`string`)return null;let n={name:t.name};return typeof t.required==`boolean`&&(n.required=t.required),typeof t.description==`string`&&(n.description=t.description),typeof t.url==`string`&&(n.url=t.url),n}).filter(e=>e!==null);return t.length>0?t:void 0}async function se(){let e=await fetch(O,{headers:{Accept:`application/json`}});if(!e.ok)throw Error(`Failed to fetch marketplace: ${e.status}`);let t=await e.json(),n=typeof t?.baseUrl==`string`?t.baseUrl:void 0,r=typeof t?.counts==`object`&&t.counts!==null?t.counts:{},i=Array.isArray(t?.tags)?t.tags.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||typeof t.label!=`string`?null:{id:t.id,label:t.label,count:M(t.count)}}).filter(e=>e!==null):[],a=Array.isArray(t?.entries)?t.entries.map(e=>{if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.install==`object`&&t.install!==null?t.install:{};return typeof t.id!=`string`||!A(t.type)||typeof t.name!=`string`||typeof t.tagline!=`string`||typeof t.description!=`string`||typeof n.command!=`string`?null:{id:t.id,type:t.type,name:t.name,featured:typeof t.featured==`boolean`?t.featured:void 0,tagline:t.tagline,description:t.description,tags:j(t.tags),install:{args:j(n.args),command:n.command,env:N(n.env),notes:typeof n.notes==`string`?n.notes:void 0}}}).filter(e=>e!==null&&e.install.args.length>0):[];return{version:M(t?.version)||k.version,generatedAt:typeof t?.generatedAt==`string`?t.generatedAt:void 0,baseUrl:n,counts:{total:M(r.total)||a.length,plugins:M(r.plugins),skills:M(r.skills),mcps:M(r.mcps)},tags:i,entries:a}}var P=n(),F=3e5,ce={fontFamily:`ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace`},I={mcp:{title:`MCP Servers`,description:`Install Model Context Protocol servers into this CLI environment.`,emptyInstalled:`No MCP servers installed.`,emptyCatalog:`No MCP servers match the current filters.`,icon:_},skill:{title:`Skills`,description:`Install skills globally for Cline.`,emptyInstalled:`No skills installed.`,emptyCatalog:`No skills match the current filters.`,icon:m},plugin:{title:`Plugins`,description:`Install plugins into this CLI environment.`,emptyInstalled:`No plugins installed.`,emptyCatalog:`No plugins match the current filters.`,icon:E}},le={mcp:`cline mcp install`,plugin:`cline plugin install`,skill:`cline skill add`};function L(e){return`${e.type}:${e.id}`}function R(e,t){return Number(!!t.featured)-Number(!!e.featured)}function z(e){return e.trim().toLowerCase()}function B(e){return new Set([e.id,e.name,...e.install.args].map(z).filter(Boolean))}function V(e,t){let n=B(e);return t.matchValues.map(z).filter(Boolean).some(e=>n.has(e))}function H(e,t){return[e.name,e.tagline,e.description,e.type,...e.tags.map(e=>t.get(e)??e)].join(` `).toLowerCase()}function U(e){if(e?.status===`installed`||e?.status===`uninstalled`||e?.status===`failed`)return e.message}function W({actionState:e,entry:t}){let n=t.install.env?.filter(e=>e.required!==!1)??[],r=t.install.env?.filter(e=>e.required===!1)??[];return n.length>0||r.length>0||t.install.notes||e?.status===`failed`?(0,P.jsxs)(`div`,{className:`grid gap-3 border-t pt-3`,"data-marketplace-entry-details":!0,children:[n.length>0||r.length>0?(0,P.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 p-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-amber-800 dark:text-amber-200`,children:`Environment setup needed`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-800/80 dark:text-amber-100/80`,children:`Add these values to your Cline/plugin environment after install.`}),(0,P.jsx)(`div`,{className:`mt-3 grid gap-2`,children:[...n,...r].map(e=>(0,P.jsxs)(`div`,{className:`rounded-md border border-amber-500/20 bg-background/60 p-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`font-mono text-xs font-semibold`,children:(0,P.jsx)(`span`,{style:ce,children:e.name})}),(0,P.jsx)(w,{variant:`outline`,children:e.required===!1?`Optional`:`Required`})]}),e.description?(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null,e.url?(0,P.jsxs)(`a`,{className:`mt-1 inline-flex items-center gap-1 text-xs text-primary hover:underline`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[`Get value`,(0,P.jsx)(f,{className:`size-3`})]}):null]},e.name))})]}):null,t.install.notes?(0,P.jsx)(`p`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-5 text-muted-foreground`,children:t.install.notes}):null,e?.status===`failed`?(0,P.jsx)(`div`,{className:`max-h-44 overflow-auto rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:e.message}):null]}):null}function G({actionState:e,entry:t,expanded:n,installed:i,installedStatusReady:o,onInstall:c,onToggleExpanded:l,onUninstall:u,matchedLocalItems:d=[],showFeatured:f=!0,showTags:p=!0,sourceLabel:m,tagLabels:g}){let _=I[t.type].icon,v=e?.status===`installing`||e?.status===`uninstalling`,y=!!t.install.env?.length,b=y||!!t.install.notes||e?.status===`failed`,x=U(e),ee=e=>{if(e.stopPropagation(),i){u(t);return}c(t)},te=o?e?.status===`installing`?`Installing...`:e?.status===`uninstalling`?`Uninstalling...`:i?`Uninstall`:`Install`:`Checking...`,S=x?(0,P.jsx)(`output`,{className:a(`text-xs`,e?.status===`failed`?`text-destructive`:`text-muted-foreground`),children:x}):y?(0,P.jsx)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,children:`Requires setup after install`}):null,C=(0,P.jsxs)(s,{disabled:!o||v,onClick:ee,size:`sm`,type:`button`,variant:i?`destructive`:`default`,children:[v||!o?(0,P.jsx)(ae,{}):null,i&&!v?(0,P.jsx)(r,{className:`size-4`}):null,te]}),ne=(0,P.jsxs)(P.Fragment,{children:[i?null:(0,P.jsx)(`div`,{className:`absolute top-4 right-4`,"data-marketplace-entry-interactive":!0,children:C}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,P.jsxs)(`div`,{className:a(`flex min-w-0 flex-1 items-center gap-2`,!i&&`pr-24`),children:[(0,P.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:t.name}),f&&t.featured?(0,P.jsxs)(w,{className:`border border-violet-500/20 bg-violet-500/10 text-violet-700 dark:text-violet-300`,children:[(0,P.jsx)(h,{className:`fill-current`}),`Featured`]}):null]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:[m?(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:m}):null,d.map(e=>e.renderMatchedBadges?(0,P.jsx)(`span`,{className:`contents`,children:e.renderMatchedBadges()},`${e.key}:badges`):null),d.map(e=>e.renderMatchedControls?(0,P.jsx)(`span`,{className:`contents`,"data-marketplace-entry-interactive":!0,children:e.renderMatchedControls()},`${e.key}:controls`):null)]})]}),d.some(e=>e.renderMatchedMeta)?(0,P.jsx)(`div`,{className:`mt-1 grid gap-1`,children:d.map(e=>e.renderMatchedMeta?(0,P.jsx)(`div`,{children:e.renderMatchedMeta()},`${e.key}:meta`):null)}):null]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-stretch sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-2`,children:[p&&t.tags.length>0?(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.tags.slice(0,5).map(e=>(0,P.jsx)(w,{variant:`outline`,className:`max-w-full text-muted-foreground`,children:(0,P.jsx)(`span`,{className:`truncate`,children:g.get(e)??e})},e))}):null,(0,P.jsx)(`p`,{className:`line-clamp-2 text-xs leading-5 text-muted-foreground`,children:t.description}),S]}),i?(0,P.jsx)(`div`,{className:`flex shrink-0 flex-col items-start gap-1 sm:items-end sm:justify-end`,children:C}):null]}),d.some(e=>e.renderMatchedDetails)?(0,P.jsx)(`div`,{className:`grid gap-2`,"data-marketplace-entry-details":!0,children:d.map(e=>e.renderMatchedDetails?(0,P.jsx)(`div`,{children:e.renderMatchedDetails()},e.key):null)}):null,n&&b?(0,P.jsx)(W,{actionState:e,entry:t}):null]});return b?(0,P.jsx)(`div`,{"aria-expanded":n,"aria-label":`${n?`Collapse`:`Expand`} ${t.name}`,className:`relative grid cursor-pointer gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,onClick:e=>{e.target instanceof HTMLElement&&e.target.closest(`[data-marketplace-entry-details], [data-marketplace-entry-interactive]`)||l(t)},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l(t))},role:`button`,tabIndex:0,children:ne}):(0,P.jsx)(`div`,{className:`relative grid gap-2 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/20`,children:ne})}function ue({active:e,count:t,onClick:n,tag:r}){return(0,P.jsxs)(s,{"aria-pressed":e,onClick:n,size:`sm`,type:`button`,variant:e?`default`:`outline`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:r.label}),(0,P.jsx)(`span`,{className:`rounded bg-background/30 px-1.5 py-0.5 text-xs`,children:t})]})}function K({actionStates:e,emptyMessage:t,entries:n,expandedEntryKey:r,headerContent:i,installedEntryKeys:a,installedStatusReady:o,localOnlyInstalledItems:s=[],matchedLocalItemsByEntryKey:c,onInstall:l,onToggleExpanded:u,onUninstall:d,showFeaturedBadges:f=!0,showEntryTags:p=!0,sourceLabel:m,tagLabels:h,title:g}){let _=n.length+s.length;return(0,P.jsxs)(`section`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:g}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:_})]}),i,_>0?(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[s.map(e=>e.render()),n.map(t=>{let n=L(t);return(0,P.jsx)(G,{actionState:e.get(n),entry:t,expanded:r===n,installed:a.has(n),installedStatusReady:o,onInstall:l,onToggleExpanded:u,onUninstall:d,matchedLocalItems:c?.get(n)??[],showFeatured:f,showTags:p,sourceLabel:m,tagLabels:h},n)})]}):(0,P.jsx)(`div`,{className:`rounded-lg border border-dashed bg-card p-6 text-center text-sm text-muted-foreground`,children:t})]})}function de({chrome:e=`page`,installedItems:t,onInstalledItemsChanged:n,primitive:r}){let[i,a]=(0,D.useState)(null),[c,l]=(0,D.useState)(null),[d,f]=(0,D.useState)(``),[p,m]=(0,D.useState)(null),[h,_]=(0,D.useState)(null),[v,y]=(0,D.useState)(()=>new Set),[b,x]=(0,D.useState)(()=>new Map),[ee,S]=(0,D.useState)(`loading`);(0,D.useEffect)(()=>{let e=!1;return(async()=>{try{e||S(`loading`);let t=await se();e||(a(t),l(null));try{let n=await g.invoke(`list_marketplace_installed_entries`,{entries:t.entries});e||(y(new Set(n.installedKeys)),S(`ready`))}catch{e||S(`ready`)}}catch(t){e||(l(t instanceof Error?t.message:String(t)),S(`ready`))}})(),()=>{e=!0}},[]);let C=I[r],ie=C.icon,w=(0,D.useMemo)(()=>new Map(i?.tags.map(e=>[e.id,e.label])??[]),[i?.tags]),T=(0,D.useMemo)(()=>(i?.entries.filter(e=>e.type===r)??[]).sort(R),[i?.entries,r]),E=(0,D.useMemo)(()=>{let e=d.trim().toLowerCase();return T.filter(t=>e.length===0||H(t,w).includes(e))},[T,d,w]),oe=(0,D.useMemo)(()=>E.filter(e=>v.has(L(e))),[E,v]),O=(0,D.useMemo)(()=>E.filter(e=>!v.has(L(e))),[E,v]),k=(0,D.useMemo)(()=>{let e=new Map;for(let t of O)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return e},[O]),A=(0,D.useMemo)(()=>(i?.tags??[]).filter(e=>(k.get(e.id)??0)>0),[i?.tags,k]),j=(0,D.useMemo)(()=>O.filter(e=>!p||e.tags.includes(p)),[O,p]),M=(0,D.useMemo)(()=>{let e=new Map;for(let n of t??[])for(let t of oe){let r=L(t);if(!V(t,n))continue;let i=e.get(r)??[];i.push(n),e.set(r,i)}return e},[oe,t]),N=(0,D.useMemo)(()=>{let e=new Set,n=T.filter(e=>v.has(L(e)));for(let r of t??[])n.some(e=>V(e,r))&&e.add(r.key);return e},[v,t,T]),ce=(0,D.useMemo)(()=>{let e=d.trim().toLowerCase();return(t??[]).filter(t=>N.has(t.key)?!1:e.length===0||t.matchValues.map(z).some(t=>t.includes(e)))},[t,N,d]),B=ee===`ready`,U=A.length>0?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,P.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:A.map(e=>(0,P.jsx)(ue,{active:p===e.id,count:k.get(e.id)??0,onClick:()=>m(t=>t===e.id?null:e.id),tag:e},e.id))}),(0,P.jsxs)(`div`,{className:`flex min-h-8 shrink-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`font-medium text-foreground`,children:j.length}),(0,P.jsx)(`span`,{children:j.length===1?`result`:`results`}),p?(0,P.jsx)(s,{onClick:()=>m(null),size:`sm`,type:`button`,variant:`ghost`,children:`Clear filters`}):null]})]}):null,W=(e,t)=>{let n=L(e);x(e=>{let r=new Map(e);return r.set(n,t),r})},G=e=>{y(t=>new Set(t).add(L(e)))},de=e=>{y(t=>{let n=new Set(t);return n.delete(L(e)),n})},fe=e=>{let t=L(e);_(e=>e===t?null:t)},pe=async e=>{let t=L(e),r=b.get(t);if(r?.status!==`installing`&&r?.status!==`uninstalling`){_(t),W(e,{status:`installing`});try{let t=await g.invoke(`install_marketplace_entry`,{entry:e},{timeoutMs:F});W(e,{status:`installed`,message:t.message}),G(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},me=async e=>{let t=L(e),r=b.get(t);if(r?.status!==`installing`&&r?.status!==`uninstalling`){_(t),W(e,{status:`uninstalling`});try{let t=await g.invoke(`uninstall_marketplace_entry`,{entry:e},{timeoutMs:F});W(e,{status:`uninstalled`,message:t.message}),de(e),await n?.()}catch(t){W(e,{status:`failed`,message:t instanceof Error?t.message:String(t)})}}},q=(0,P.jsxs)(`div`,{className:`grid gap-6`,children:[e===`page`?(0,P.jsx)(re,{description:C.description,icon:ie,title:C.title,meta:(0,P.jsx)(te,{children:le[r]}),actions:i?.generatedAt?(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Updated`,` `,new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}).format(new Date(i.generatedAt))]}):null}):null,!i&&!c?(0,P.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,P.jsx)(ae,{className:`mr-2`}),`Loading marketplace...`]}):null,i&&!B?(0,P.jsxs)(`div`,{className:`flex min-h-80 items-center justify-center rounded-lg border bg-card text-sm text-muted-foreground`,children:[(0,P.jsx)(ae,{className:`mr-2`}),`Checking installed status...`]}):null,c?(0,P.jsx)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:c}):null,i&&B?(0,P.jsxs)(`div`,{className:`grid gap-6`,children:[(0,P.jsx)(`div`,{className:`grid gap-3`,children:(0,P.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-center`,children:(0,P.jsxs)(`div`,{className:`relative block flex-1`,children:[(0,P.jsx)(u,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,P.jsx)(o,{"aria-label":`Search ${C.title}`,className:`h-10 pl-8`,onChange:e=>f(e.target.value),placeholder:`Search ${C.title.toLowerCase()}`,value:d})]})})}),(0,P.jsx)(K,{actionStates:b,emptyMessage:C.emptyInstalled,entries:oe,expandedEntryKey:h,installedEntryKeys:v,installedStatusReady:B,localOnlyInstalledItems:ce,matchedLocalItemsByEntryKey:M,onInstall:pe,onToggleExpanded:fe,onUninstall:me,showFeaturedBadges:!1,showEntryTags:!1,sourceLabel:`Marketplace`,tagLabels:w,title:`Installed`}),(0,P.jsx)(K,{actionStates:b,emptyMessage:C.emptyCatalog,entries:j,expandedEntryKey:h,headerContent:U,installedEntryKeys:v,installedStatusReady:B,onInstall:pe,onToggleExpanded:fe,onUninstall:me,tagLabels:w,title:`Marketplace`})]}):null]});return e===`embedded`?q:(0,P.jsx)(ne,{children:q})}var fe={Rules:`Review project and global rule files that shape Cline behavior.`,Hooks:`Inspect hook configuration and recent execution status.`,MCP:`Manage installed MCP servers and add new servers from the marketplace.`,Skills:`Manage installed skills and add new skills from the marketplace.`,Agents:`Review configured agents discovered from local settings.`,Plugins:`Manage installed plugins and add new plugins from the marketplace.`,Tools:`Inspect built-in tools and tools contributed by plugins.`},pe={Rules:`cline config rules`,Hooks:`cline config hooks`,MCP:`cline mcp install`,Skills:`cline skill`,Agents:`cline config agents`,Plugins:`cline plugin`,Tools:`cline config tools`},me={settingsPath:``,hasSettingsFile:!1,servers:[]};function q(e){return Array.isArray(e)?e:[]}function he(e){return{workspaceRoot:typeof e?.workspaceRoot==`string`?e.workspaceRoot:``,rules:q(e?.rules),workflows:q(e?.workflows),skills:q(e?.skills),agents:q(e?.agents),plugins:q(e?.plugins),tools:q(e?.tools),hooks:q(e?.hooks),mcp:e?.mcp&&typeof e.mcp==`object`?{settingsPath:typeof e.mcp.settingsPath==`string`?e.mcp.settingsPath:``,hasSettingsFile:!!e.mcp.hasSettingsFile,servers:q(e.mcp.servers)}:{...me},warnings:q(e?.warnings)}}var ge=6e4,_e=3e4,J=null,Y=null;function ve(e,t){return!!(e&&t-e.fetchedAt<ge&&Array.isArray(e.tools)&&e.tools.length>0)}function ye(e,t=150){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t).trimEnd()}...`}function X(e){return e.replaceAll(`\\`,`/`)}function be(e,t){let n=X(t),r=X(e);return n&&r.startsWith(`${n}/`)?`Project`:`Global`}function Z({scope:e}){return(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e})}function xe(...e){let t=new Set;for(let n of e){let e=n?.trim().replaceAll(`\\`,`/`);if(!e)continue;t.add(e);let r=e.split(`/`).filter(Boolean);for(let e of r)t.add(e.replace(/\.[^.]+$/,``));for(let e=0;e<r.length-1;e+=1)t.add(`${r[e]}/${r[e+1]}`)}return[...t]}async function Se(){return he(await g.invoke(`list_user_instruction_configs`))}function Ce(e,t){return(e instanceof Error?e.message:String(e)).includes(`unsupported desktop command: ${t}`)}function we({catalogPrimitive:e,section:t=`Rules`,showTabs:n=!1}){let[i,o]=(0,D.useState)(t),[u,f]=(0,D.useState)(()=>!ve(J,Date.now())),[h,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(()=>J?.workspaceRoot??``),[A,j]=(0,D.useState)(()=>J?.rules??[]),[M,N]=(0,D.useState)(()=>J?.workflows??[]),[se,F]=(0,D.useState)(()=>J?.skills??[]),[ce,I]=(0,D.useState)(()=>J?.agents??[]),[le,L]=(0,D.useState)(()=>J?.plugins??[]),[R,z]=(0,D.useState)(()=>J?.tools??[]),[B,V]=(0,D.useState)(()=>J?.hooks??[]),[H,U]=(0,D.useState)(()=>J?.mcp??me),[W,G]=(0,D.useState)(()=>J?.warnings??[]),[ue,K]=(0,D.useState)(()=>Y?.hookExecutionByEvent??{}),[q,ge]=(0,D.useState)(()=>Y?.hookExecutionSessionId??null),[we,Te]=(0,D.useState)(!1),[Ee,De]=(0,D.useState)(()=>new Set),[Oe,ke]=(0,D.useState)(()=>new Set),[Ae,je]=(0,D.useState)(()=>new Set),[Me,Ne]=(0,D.useState)(()=>new Map);(0,D.useEffect)(()=>{o(t)},[t]);let Q=(0,D.useCallback)(async(e=!1)=>{if(!e&&ve(J,Date.now())){k(J.workspaceRoot),j(J.rules),N(J.workflows),F(J.skills),I(J.agents),L(J.plugins),z(J.tools),V(J.hooks),U(J.mcp),G(J.warnings),E(null),f(!1);return}f(!0),E(null);try{let e=await Se();k(e.workspaceRoot),j(e.rules),N(e.workflows),F(e.skills),I(e.agents),L(e.plugins),z(e.tools),V(e.hooks),U(e.mcp),G(e.warnings),J={...e,fetchedAt:Date.now()}}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{f(!1)}},[]),Pe=(0,D.useCallback)(async(e=!1)=>{if(!e&&Y&&Date.now()-Y.fetchedAt<_e){K(Y.hookExecutionByEvent),ge(Y.hookExecutionSessionId);return}Te(!0);try{let e=(await g.invoke(`list_cli_sessions`,{limit:300})??[]).filter(e=>typeof e.sessionId==`string`&&e.sessionId.trim().length>0).sort((e,t)=>(t.startedAt??``).localeCompare(e.startedAt??``))[0];if(!e?.sessionId){K({}),ge(null),Y={hookExecutionByEvent:{},hookExecutionSessionId:null,fetchedAt:Date.now()};return}let t=await g.invoke(`read_session_hooks`,{sessionId:e.sessionId,limit:5e3}),n={};for(let e of t??[]){let t=e.hookEventName?.trim();if(!t)continue;let r=n[t]??{count:0,lastTs:null};r.count+=1,e.ts&&(!r.lastTs||e.ts>r.lastTs)&&(r.lastTs=e.ts),n[t]=r}K(n),ge(e.sessionId),Y={hookExecutionByEvent:n,hookExecutionSessionId:e.sessionId,fetchedAt:Date.now()}}catch{}finally{Te(!1)}},[]),Fe=(0,D.useCallback)(e=>{let t=he(e);k(t.workspaceRoot),j(t.rules),N(t.workflows),F(t.skills),I(t.agents),L(t.plugins),z(t.tools),V(t.hooks),U(t.mcp),G(t.warnings),J={...t,fetchedAt:Date.now()}},[]),Ie=(0,D.useCallback)(async e=>{De(t=>new Set(t).add(e.id)),E(null);try{let t=[e.name,...e.headlessToolNames??[]].filter(Boolean);if(t.length===0)throw Error(`tool name is required`);let n;try{n=await g.invoke(`set_tool_disabled`,{names:t,disabled:e.enabled})}catch(e){if(!Ce(e,`set_tool_disabled`))throw e;for(let e of t)n=await g.invoke(`toggle_disabled_plugin_tool`,{name:e})}if(!n)throw Error(`tool toggle did not return an updated extension list`);Fe(n)}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{De(t=>{let n=new Set(t);return n.delete(e.id),n})}},[Fe]),Le=(0,D.useCallback)(async e=>{ke(t=>new Set(t).add(e.path)),E(null);try{let t=await g.invoke(`set_plugin_disabled`,{path:e.path,disabled:e.enabled});Fe(t)}catch(e){let t=e instanceof Error?e.message:String(e);E(t)}finally{ke(t=>{let n=new Set(t);return n.delete(e.path),n})}},[Fe]),Re=(0,D.useCallback)(async e=>{if(!Ae.has(e.key)){je(t=>new Set(t).add(e.key)),Ne(t=>{let n=new Map(t);return n.delete(e.key),n}),E(null);try{let t=await g.invoke(`uninstall_local_primitive`,{type:e.type,id:e.id,name:e.name,path:e.path});Ne(n=>{let r=new Map(n);return r.set(e.key,{status:`success`,message:t.message??`Uninstalled ${e.name??e.id??e.path}.`}),r}),await Q(!0)}catch(t){let n=t instanceof Error?t.message:String(t);Ne(t=>{let r=new Map(t);return r.set(e.key,{status:`failed`,message:n}),r}),E(n)}finally{je(t=>{let n=new Set(t);return n.delete(e.key),n})}}},[Ae,Q]),ze=(0,D.useCallback)(e=>{if(!e)return`never`;let t=Number(e),n=Number.isFinite(t)?new Date(t):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()},[]);(0,D.useEffect)(()=>{let e=window.setTimeout(()=>{Q(!1)},0);return()=>window.clearTimeout(e)},[Q]),(0,D.useEffect)(()=>{if(i!==`Hooks`)return;let e=window.setTimeout(()=>{Pe(!1)},0);return()=>window.clearTimeout(e)},[i,Pe]);let Be=[`Rules`,`Hooks`,`Skills`,`Agents`,`Plugins`,`Tools`],Ve=(0,D.useMemo)(()=>{let e=M.map(e=>({id:e.id,type:`workflow`,name:e.name,instructions:e.instructions,path:e.path,scope:be(e.path,O)})),t=se.map(e=>({id:X(e.path).toLowerCase(),type:`skill`,name:e.name,description:e.description,instructions:e.instructions,path:e.path,scope:be(e.path,O)}));return[...e,...t].sort((e,t)=>e.name.localeCompare(t.name))},[se,M,O]),{projectRules:He,globalRules:Ue}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of A){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/`)?t.push(r):n.push(r)}return{projectRules:t,globalRules:n}},[A,O]),{projectHooks:We,globalHooks:Ge}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of B){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.clinerules/hooks`)?t.push(r):n.push(r)}return{projectHooks:t,globalHooks:n}},[B,O]),{projectPlugins:Ke,globalPlugins:qe}=(0,D.useMemo)(()=>{let e=X(O),t=[],n=[];for(let r of le){let i=X(r.path);e&&i.startsWith(`${e}/`)&&i.includes(`/.cline/plugins`)?t.push(r):n.push(r)}return{projectPlugins:t,globalPlugins:n}},[le,O]),Je=(0,D.useMemo)(()=>R.filter(e=>e.source===`builtin`),[R]),Ye=(0,D.useMemo)(()=>R.filter(e=>e.source!==`builtin`),[R]),$=(0,D.useMemo)(()=>{let e=new Map;for(let t of Ye){let n=t.path??``,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())t.sort((e,t)=>e.name.localeCompare(t.name));return e},[Ye]),Xe=(0,D.useMemo)(()=>[...qe.map(e=>({plugin:e,scope:`Global`})),...Ke.map(e=>({plugin:e,scope:`Project`}))],[qe,Ke]),Ze=(0,D.useMemo)(()=>[...Ue.map(e=>({rule:e,scope:`Global`})),...He.map(e=>({rule:e,scope:`Project`}))],[Ue,He]),Qe=(0,D.useMemo)(()=>[...Ge.map(e=>({hook:e,scope:`Global`})),...We.map(e=>({hook:e,scope:`Project`}))],[Ge,We]),$e=e=>{let t=Me.get(e);return t?(0,P.jsx)(`output`,{className:a(`text-xs`,t.status===`failed`?`text-destructive`:`text-muted-foreground`),children:t.message}):null},et=e=>{let t=Ae.has(e.key);return(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`min-h-5 text-xs text-muted-foreground`,children:$e(e.key)}),(0,P.jsxs)(s,{disabled:t,onClick:()=>{Re(e)},type:`button`,variant:`destructive`,children:[t?(0,P.jsx)(ae,{}):(0,P.jsx)(r,{className:`size-4`}),t?`Uninstalling...`:`Uninstall`]})]})},tt=e=>{let t=Ae.has(e.key);return(0,P.jsxs)(C,{children:[(0,P.jsx)(ee,{render:(0,P.jsx)(s,{"aria-label":`More actions for ${e.name??`plugin`}`,className:`m-0 size-auto shrink-0 p-0 text-muted-foreground`,onClick:e=>e.stopPropagation(),size:`icon`,type:`button`,variant:`ghost`}),children:(0,P.jsx)(T,{className:`size-4`})}),(0,P.jsxs)(ie,{align:`end`,children:[(0,P.jsxs)(x,{onClick:()=>void navigator.clipboard.writeText(e.path??``),children:[(0,P.jsx)(l,{className:`size-4`}),`Copy path`]}),(0,P.jsxs)(x,{className:`text-destructive focus:text-destructive`,disabled:t,onClick:()=>void Re(e),children:[t?(0,P.jsx)(ae,{}):(0,P.jsx)(r,{className:`size-4`}),t?`Uninstalling...`:`Uninstall`]})]})]})},nt=e=>{let t=`${e.type}:${e.path}`;return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,P.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,P.jsx)(m,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:e.scope}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path}),(0,P.jsx)(`div`,{className:`mt-3`,children:et({key:t,type:e.type,id:e.id,name:e.name,path:e.path})})]},t)},rt=e=>(0,P.jsxs)(`div`,{className:`grid gap-1`,children:[(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:e.path})]}),it=({plugin:e,scope:t})=>{let n=e.path,r=[{label:`Tools`,items:e.contributions?.tools??($.get(e.path)??[]).map(e=>e.name)},{label:`Skills`,items:e.contributions?.skills??[]},{label:`Rules`,items:e.contributions?.rules??[]},{label:`Hooks`,items:e.contributions?.hooks??[]},{label:`Commands`,items:e.contributions?.commands??[]},{label:`MCP servers`,items:e.contributions?.mcpServers??[]},{label:`Providers`,items:e.contributions?.providers??[]},{label:`Capabilities`,items:e.contributions?.capabilities??[]}].filter(e=>e.items.length>0);return(0,P.jsxs)(`details`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:t}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},onClick:e=>e.stopPropagation(),disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`}),tt({key:n,type:`plugin`,id:e.name,name:e.name,path:e.path})]}),(0,P.jsxs)(`div`,{className:`mt-3`,children:[e.contributions?.inspectionStatus===`disabled`?(0,P.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:`Enable this plugin to inspect its dynamic contributions.`}):null,r.length>0?(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-2 text-xs font-medium text-foreground`,children:[(0,P.jsx)(`span`,{className:`mr-1`,children:`Contributions`}),r.map(e=>(0,P.jsxs)(w,{variant:`outline`,children:[e.label,` `,e.items.length]},e.label))]}),(0,P.jsx)(`div`,{className:`grid max-h-56 gap-3 overflow-y-auto pt-2 sm:grid-cols-2`,children:r.map(e=>(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.label}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.items.map(e=>(0,P.jsx)(w,{variant:`secondary`,children:e},e))})]},e.label))})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin contributions found.`})]}),$e(n)?(0,P.jsx)(`div`,{className:`mt-3`,children:$e(n)}):null]},e.path)},at=e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`}),tt({key:e.path,type:`plugin`,id:e.name,name:e.name,path:e.path})]}),ot=e=>{let t=[{label:`Tools`,items:e.contributions?.tools??($.get(e.path)??[]).map(e=>e.name)},{label:`Skills`,items:e.contributions?.skills??[]},{label:`Rules`,items:e.contributions?.rules??[]},{label:`Hooks`,items:e.contributions?.hooks??[]},{label:`Commands`,items:e.contributions?.commands??[]},{label:`MCP servers`,items:e.contributions?.mcpServers??[]},{label:`Providers`,items:e.contributions?.providers??[]},{label:`Capabilities`,items:e.contributions?.capabilities??[]}].filter(e=>e.items.length>0);return t.length===0?null:(0,P.jsx)(`div`,{className:`grid max-h-56 gap-3 overflow-y-auto sm:grid-cols-2`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.label}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.items.map(e=>(0,P.jsx)(w,{variant:`secondary`,children:e},e))})]},e.label))})},st=e=>{let t=e.name;return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(_,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:`Global`}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.disabled?`Disabled`:`Enabled`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.url??([e.command,...e.args??[]].filter(Boolean).join(` `)||`No launch command configured.`)}),H.settingsPath?(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:H.settingsPath}):null,(0,P.jsx)(`div`,{className:`mt-3`,children:et({key:t,type:`mcp`,id:e.name,name:e.name})})]},e.name)},ct=e=>(0,P.jsxs)(`div`,{className:`grid gap-1`,children:[(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.disabled?`Disabled`:`Enabled`,` locally`,e.transportType?` via ${e.transportType}`:``]}),H.settingsPath?(0,P.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground`,children:H.settingsPath}):null]}),lt=e===`skill`?Ve.map(e=>({key:`${e.type}:${e.path}`,matchValues:xe(e.id,e.name,e.path),render:()=>nt(e),renderMatchedBadges:()=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Z,{scope:e.scope}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.type})]}),renderMatchedDetails:()=>rt(e)})):e===`plugin`?Xe.map(e=>({key:e.plugin.path,matchValues:xe(e.plugin.name,e.plugin.path),render:()=>it(e),renderMatchedBadges:()=>(0,P.jsx)(Z,{scope:e.scope}),renderMatchedControls:()=>at(e.plugin),renderMatchedDetails:Object.values(e.plugin.contributions??{}).some(e=>e.length>0)||($.get(e.plugin.path)??[]).length>0?()=>ot(e.plugin):void 0})):e===`mcp`?H.servers.map(e=>({key:e.name,matchValues:xe(e.name),render:()=>st(e),renderMatchedBadges:()=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Z,{scope:`Global`}),(0,P.jsx)(w,{variant:`outline`,className:`shrink-0 text-muted-foreground`,children:e.transportType})]}),renderMatchedDetails:()=>ct(e)})):null;return(0,P.jsxs)(ne,{children:[(0,P.jsx)(re,{description:fe[i],title:i,meta:(0,P.jsx)(te,{children:pe[i]}),actions:(0,P.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>{Q(!0),i===`Hooks`&&Pe(!0)},disabled:u,children:(0,P.jsx)(p,{className:a(`h-4 w-4`,u&&`animate-spin`)})})}),n?(0,P.jsx)(`div`,{className:`mb-6 flex items-center gap-0 border-b border-border`,children:Be.map(e=>(0,P.jsxs)(s,{variant:`ghost`,onClick:()=>o(e),className:a(`relative px-4 py-2.5 text-sm font-medium transition-colors`,i===e?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e,i===e&&(0,P.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 bg-foreground`})]},e))}):null,h&&(0,P.jsxs)(`div`,{className:`mb-4 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive`,children:[`Failed to load configuration lists: `,h]}),W.length>0&&(0,P.jsxs)(`div`,{className:`mb-4 rounded-lg border border-yellow-500/40 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-700 dark:text-yellow-300`,children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium`,children:[(0,P.jsx)(oe,{className:`h-4 w-4`}),`Partial results`]}),(0,P.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:W.map(e=>(0,P.jsx)(`li`,{children:e},e))})]}),e?(0,P.jsx)(de,{chrome:`embedded`,installedItems:lt??void 0,onInstalledItemsChanged:()=>Q(!0),primitive:e}):null,i===`Rules`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Enabled rules discovered from configured workspace/global directories.`}),(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Ze.length})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ze.map(({rule:e,scope:t})=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(b,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`flex-1 text-sm font-medium text-foreground`,children:e.name}),(0,P.jsx)(Z,{scope:t})]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),Ze.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No rules found.`})]})]})]}),i===`Hooks`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Hook config files from workspace and global hook directories.`}),we&&q&&(0,P.jsxs)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:[`Execution status is based on hook events in session`,` `,(0,P.jsx)(`span`,{className:`font-mono`,children:q}),`.`]}),(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:`Installed`}),(0,P.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Qe.length})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Qe.map(({hook:e,scope:t})=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(v,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`flex-1 text-sm font-mono text-foreground`,children:e.fileName}),(0,P.jsx)(Z,{scope:t}),e.hookEventName&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.hookEventName}),(()=>{let t=ue[e.hookEventName],n=(t?.count??0)>0;return(0,P.jsx)(`span`,{className:a(`rounded border px-2 py-0.5 text-xs`,n?`border-emerald-400/50 text-emerald-600 dark:text-emerald-400`:`border-border text-muted-foreground`),children:n?`${t?.count??0} executed`:`never executed`})})()]})]}),e.hookEventName?(0,P.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Last run:`,` `,ze(ue[e.hookEventName]?.lastTs??null)]}):null,(0,P.jsx)(`p`,{className:`mt-1 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),Qe.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No hooks found.`})]})]})]}),i===`Skills`&&!e&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:[`Skills can be invoked in chat with`,` `,(0,P.jsx)(`code`,{className:`rounded bg-secondary px-1.5 py-0.5 text-xs font-mono text-foreground`,children:`/SKILL`}),`.`]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ve.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.type===`workflow`?(0,P.jsx)(c,{className:`h-4 w-4 shrink-0 text-primary`}):(0,P.jsx)(m,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:e.type})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||ye(e.instructions)}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},`${e.type}:${e.path}`)),Ve.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No enabled skills or workflows found.`})]})]}),i===`Agents`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Configured agents discovered from Documents and settings directories.`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[ce.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(S,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.name})]}),(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.path)),ce.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No configured agents found.`})]})]}),i===`Plugins`&&!e&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Plugins discovered from workspace and global plugin directories.`}),(0,P.jsxs)(`div`,{className:`mb-6`,children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Global Plugins`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[qe.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,P.jsxs)(`div`,{className:`mt-3 ml-7 flex max-h-56 flex-col gap-2 overflow-y-auto`,children:[($.get(e.path)??[]).map(e=>(0,P.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:e.name}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`})]})},e.id)),($.get(e.path)?.length??0)===0&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),qe.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No global plugins found.`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Project Plugins`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ke.map(e=>(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Le(e)},disabled:Oe.has(e.path),"aria-label":`Toggle ${e.name}`})]}),(0,P.jsxs)(`div`,{className:`mt-3 ml-7 flex max-h-56 flex-col gap-2 overflow-y-auto`,children:[($.get(e.path)??[]).map(e=>(0,P.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border border-border/70 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:e.name}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`})]})},e.id)),($.get(e.path)?.length??0)===0&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No plugin tools found.`})]})]},e.path)),Ke.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No project plugins found.`})]})]})]}),i===`Tools`&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`mb-6 text-sm leading-relaxed text-muted-foreground`,children:`Builtin tool groups and plugin-contributed tools available to the runtime.`}),(0,P.jsxs)(`div`,{className:`mb-6`,children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Builtin Tools`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Je.map(e=>(()=>{let t=Ee.has(e.id);return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(y,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Ie(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),!!e.headlessToolNames?.length&&(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.headlessToolNames.join(`, `)})]},e.id)})()),Je.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No builtin tools found.`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Plugin Tools`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Ye.map(e=>(()=>{let t=Ee.has(e.id);return(0,P.jsxs)(`div`,{className:`rounded-lg border border-border px-5 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(y,{className:`h-4 w-4 shrink-0 text-primary`}),(0,P.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold text-foreground`,children:e.name}),e.pluginName&&(0,P.jsxs)(`span`,{className:`rounded border border-border px-2 py-0.5 text-xs text-muted-foreground`,children:[`plugin: `,e.pluginName]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.enabled?`Enabled`:`Disabled`}),(0,P.jsx)(d,{checked:e.enabled,onCheckedChange:()=>{Ie(e)},disabled:t,"aria-label":`Toggle ${e.name}`})]}),(0,P.jsx)(`p`,{className:`mt-2 ml-7 text-xs text-muted-foreground`,children:e.description?.trim()||`No description available.`}),e.path&&(0,P.jsx)(`p`,{className:`mt-1 ml-7 text-xs font-mono text-muted-foreground`,children:e.path})]},e.id)})()),Ye.length===0&&(0,P.jsx)(`p`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm text-muted-foreground`,children:`No plugin tools found.`})]})]})]})]})}export{we as CustomizationSectionView};