adam-agent-server 1.6.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App-ZRCRM7WR.js +13 -0
- package/dist/{adam-automator-skills-UFW5TXCC.js → adam-automator-skills-EZGBICHT.js} +1 -1
- package/dist/adam-tools-V5LPU47X.js +1 -0
- package/dist/{approval-handler-HQO62WK2.js → approval-handler-PB7PSLUS.js} +1 -1
- package/dist/audit-manager-BSBBDUER.js +1 -0
- package/dist/bree-engine-7S33CWS7.js +1 -0
- package/dist/channels-SITUUC4J.js +1 -0
- package/dist/{channels-J4STJ4X2.js → channels-ULFUCUUZ.js} +1 -1
- package/dist/{chunk-7446ZS6D.js → chunk-2L2347UQ.js} +1 -1
- package/dist/{chunk-FXQAUQTI.js → chunk-2YTDCR6A.js} +1 -1
- package/dist/chunk-4PQHGLZH.js +99 -0
- package/dist/{chunk-NCFVJCNQ.js → chunk-5EPG2US5.js} +2 -2
- package/dist/{chunk-2H7UOW4P.js → chunk-5QZXYKMS.js} +1 -1
- package/dist/chunk-5XOTPEAK.js +6 -0
- package/dist/{chunk-MDBVKBC7.js → chunk-6KF7OO2B.js} +1 -1
- package/dist/{chunk-TSPQ44HT.js → chunk-A5OCDYTW.js} +1 -1
- package/dist/{chunk-DWRYIN5N.js → chunk-AQ3ASS4B.js} +1 -1
- package/dist/{chunk-GMMWA5EG.js → chunk-B6LOT5CG.js} +1 -1
- package/dist/{chunk-MJSSCKMB.js → chunk-BCH2HAIM.js} +2 -2
- package/dist/{chunk-4C5ITATX.js → chunk-BQ3ZAYHC.js} +1 -1
- package/dist/{chunk-YHVYX3F4.js → chunk-DVN3BFPP.js} +1 -1
- package/dist/{chunk-P5ZXNBNV.js → chunk-EQZFOBAJ.js} +1 -1
- package/dist/{chunk-G5ESQEXN.js → chunk-FPZEZYUB.js} +1 -1
- package/dist/{chunk-YXYIA24D.js → chunk-GSFLLRS7.js} +1 -1
- package/dist/{chunk-7ZGSJCX5.js → chunk-HQRUJQN7.js} +1 -1
- package/dist/{chunk-52PR7XTN.js → chunk-IKPYPZ64.js} +1 -1
- package/dist/{chunk-FZCNYKNT.js → chunk-JJH2RCVC.js} +1 -1
- package/dist/chunk-K4C43YDD.js +7 -0
- package/dist/{chunk-V32YF3J5.js → chunk-M4YI4WVX.js} +1 -1
- package/dist/{chunk-WAG3MNMC.js → chunk-NASJH4NT.js} +1 -1
- package/dist/{chunk-TNL2LZB7.js → chunk-NUITL62I.js} +1 -1
- package/dist/{chunk-3LY6PD6A.js → chunk-NWMOV23A.js} +1 -1
- package/dist/chunk-PHT24MOV.js +1 -0
- package/dist/{chunk-ZL5JXLAX.js → chunk-QGYDGZSC.js} +1 -1
- package/dist/{chunk-VVSZZK5T.js → chunk-RI3V72RP.js} +2 -2
- package/dist/{chunk-RLJYEEQC.js → chunk-RZ7LCZVK.js} +1 -1
- package/dist/{chunk-5OQZPUBV.js → chunk-TAF2DBBC.js} +8 -8
- package/dist/{chunk-HWLSHTVX.js → chunk-ULTK7RD6.js} +3 -3
- package/dist/{chunk-DBP7GPWG.js → chunk-WMB7P64J.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{config-KFPS7IEH.js → config-HBQPBIWL.js} +1 -1
- package/dist/{db-PZ2V7UCK.js → db-QEWTZGU3.js} +1 -1
- package/dist/{delivery-log-ACNJ66RD.js → delivery-log-AC476GX7.js} +1 -1
- package/dist/engine-6K4RG644.js +1 -0
- package/dist/{evolution-audit-OQDGPKYI.js → evolution-audit-XMBDUN3T.js} +1 -1
- package/dist/index.js +13 -10
- package/dist/{learner-QCD6BH2J.js → learner-VCS3Q7BR.js} +1 -1
- package/dist/{memories-QGMRSBJJ.js → memories-VMOGFVPU.js} +1 -1
- package/dist/{memory-extractor-3MRK43A2.js → memory-extractor-4WJNHYWR.js} +2 -2
- package/dist/memory-service-ZS6MBUIC.js +1 -0
- package/dist/outbound-gateway-H7RFG6D2.js +1 -0
- package/dist/role-presets-XAEOYEAW.js +1 -0
- package/dist/role-workspace-NKGAH6J6.js +1 -0
- package/dist/{roles-KYXNMO5H.js → roles-ZYCFQMAY.js} +1 -1
- package/dist/{session-manager-LZ77OT7A.js → session-manager-COLCNIB7.js} +1 -1
- package/dist/task-templates-4KCZOUN5.js +1 -0
- package/dist/workflow-executor-Z7JFMR56.js +1 -0
- package/package.json +25 -25
- package/web/dist/assets/{ChannelDetail-DHT8fW0C.js → ChannelDetail-DnL0_h8q.js} +1 -1
- package/web/dist/assets/{Channels-YHGNXcRu.js → Channels-dod8Q4oq.js} +1 -1
- package/web/dist/assets/{Dashboard-DsHC5W4C.js → Dashboard-Dl0vA6Ky.js} +1 -1
- package/web/dist/assets/{EnvVarEditor-Dxy1Kz1Z.js → EnvVarEditor-C-gErAzC.js} +1 -1
- package/web/dist/assets/{EventDefDetail-CwprP2ch.js → EventDefDetail-BhJZGNlX.js} +1 -1
- package/web/dist/assets/{Events-B19a8cEG.js → Events-DnNZ9-BN.js} +1 -1
- package/web/dist/assets/{Evolution-DT6iZvil.js → Evolution-BBWmrrnr.js} +1 -1
- package/web/dist/assets/{GoalDetail-BALsnPQl.js → GoalDetail-uqWQCOj3.js} +1 -1
- package/web/dist/assets/{Goals-BJIsKgfH.js → Goals-CylKmR9j.js} +1 -1
- package/web/dist/assets/{Logs-Cv15aV3l.js → Logs-6rf0KT0z.js} +1 -1
- package/web/dist/assets/{Memories-CKAXhAso.js → Memories-CrBTujU7.js} +1 -1
- package/web/dist/assets/{Plugins-NO0S2spH.js → Plugins-VKUSUcSE.js} +1 -1
- package/web/dist/assets/{RoleDetail-1FNyCD4u.js → RoleDetail-DJc4CWFN.js} +1 -1
- package/web/dist/assets/{Roles-grfjw2zy.js → Roles-6pmjn04G.js} +1 -1
- package/web/dist/assets/{Settings-9LRLfa_4.js → Settings-DW1jmrNj.js} +1 -1
- package/web/dist/assets/{Strategies-BMyd_7_5.js → Strategies-Bmke6qZo.js} +1 -1
- package/web/dist/assets/{Switch-CULsD-kC.js → Switch-CfTpXW9_.js} +1 -1
- package/web/dist/assets/{TaskDetail-C2yXy8gE.js → TaskDetail-CwJ_UKgt.js} +1 -1
- package/web/dist/assets/Work-DVdWNBEm.js +1 -0
- package/web/dist/assets/{index-qYKJGoIB.js → index-DYsO5Awn.js} +2 -2
- package/web/dist/index.html +1 -1
- package/dist/App-WJMHK5EO.js +0 -13
- package/dist/adam-tools-IAZSLWYB.js +0 -1
- package/dist/audit-manager-LC5EQXCI.js +0 -1
- package/dist/bree-engine-M5CZ6A62.js +0 -1
- package/dist/channels-5TFYQN5Z.js +0 -1
- package/dist/chunk-FIN36WAP.js +0 -99
- package/dist/chunk-GGIHDFRW.js +0 -6
- package/dist/chunk-I7ZZKPHE.js +0 -7
- package/dist/chunk-YDVTWPNA.js +0 -1
- package/dist/engine-5DHYHDAP.js +0 -1
- package/dist/memory-service-M5ADGITG.js +0 -1
- package/dist/outbound-gateway-QRL36F7K.js +0 -1
- package/dist/role-presets-DLO3XS54.js +0 -1
- package/dist/role-workspace-URSOBCDH.js +0 -1
- package/dist/task-templates-YPNWJOVV.js +0 -1
- package/dist/workflow-executor-3WMS2WV3.js +0 -1
- package/web/dist/assets/Work-dftf35Me.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,G as n,M as r,R as i,S as a,ct as o,et as s,g as c,n as ee,nt as te,s as l,u as ne,x as re,y as ie}from"./vendor-icons-Dk0hMuJz.js";import{t as u}from"./vendor-react-C6faO6LO.js";import{n as d}from"./dist-Bdqp1ixJ.js";import{t as f}from"./Button-DuQctNms.js";import{i as p,t as m}from"./index-qYKJGoIB.js";import{t as h}from"./Card-rKfViPS2.js";import{t as ae}from"./PageHeader-CHSgtxPw.js";import{t as oe}from"./SectionHeader-C2WpiwJ5.js";import{a as se}from"./format-CHfBBLog.js";import{t as ce}from"./EmptyState-CIdIlMbn.js";import{t as g}from"./ui-B_uMx2Fy.js";import{t as le}from"./useIsMobileLayout-C6KIQjuh.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-DuOLbyJQ.js";var C=e(o(),1),w=u();function T({manifest:e}){if(!e)return null;let t=[];return e.skills.length>0&&t.push({label:`Skill(${e.skills.length})`,variant:`info`}),e.agents.length>0&&t.push({label:`Agent(${e.agents.length})`,variant:`success`}),e.mcpServers.length>0&&t.push({label:`MCP(${e.mcpServers.length})`,variant:`warning`}),e.hooks.length>0&&t.push({label:`Hook(${e.hooks.length})`,variant:`default`}),e.lspServers.length>0&&t.push({label:`LSP(${e.lspServers.length})`,variant:`default`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,w.jsx)(m,{variant:e.variant,children:e.label},e.label))})}function E({label:e,value:t}){return(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:e}),(0,w.jsx)(`p`,{className:`mt-1 text-sm font-medium text-[var(--app-text)]`,children:t})]})}function D({plugin:e,roles:t,operatingId:n,onInstallToRole:r}){return e.manifest?(0,w.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[e.manifest.description?(0,w.jsx)(`p`,{className:`text-[var(--app-text-muted)]`,children:e.manifest.description}):null,(0,w.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-4`,children:[(0,w.jsx)(E,{label:`Version`,value:e.version?`v${e.version}`:`—`}),(0,w.jsx)(E,{label:`Scope`,value:e.scope}),(0,w.jsx)(E,{label:`Capability Count`,value:e.manifest.skills.length+e.manifest.agents.length+e.manifest.mcpServers.length+e.manifest.hooks.length+e.manifest.lspServers.length}),(0,w.jsx)(E,{label:`Activation`,value:e.globalEnabled?`User On`:`User Off`})]}),(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install Path`}),(0,w.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-[var(--app-text-muted)]`,title:e.installPath,children:e.installPath})]}),(0,w.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e.manifest.skills.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Skills`}),e.manifest.skills.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.agents.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Agents`}),e.manifest.agents.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.mcpServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.hooks.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.lspServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`LSP Servers`}),e.manifest.lspServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]})]}),t.length>0&&e.scope===`user`?(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`p`,{className:`mb-2 text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install to Role`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[10px]`,disabled:n===e.id,onClick:()=>void r(e.id,t.id,t.workspacePath),children:t.name},t.id))})]}):null]}):(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading manifest...`})}function O(){let[e,o]=(0,C.useState)([]),[u,E]=(0,C.useState)([]),[O,ue]=(0,C.useState)([]),[de,fe]=(0,C.useState)(new Set),[pe,k]=(0,C.useState)(!0),[A,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,me]=(0,C.useState)(!1),[F,he]=(0,C.useState)(``),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(``),[H,ge]=(0,C.useState)([]),[U,_e]=(0,C.useState)(!1),[W,ve]=(0,C.useState)(new Set),[G,K]=(0,C.useState)(`all`),[q,ye]=(0,C.useState)([]),be=le(),J=(0,C.useCallback)(async()=>{k(!0);try{o((await d(`/plugins`)).plugins)}catch(e){p.error(e instanceof Error?e.message:`Failed to load plugins`)}finally{k(!1)}},[]),Y=(0,C.useCallback)(async()=>{j(!0),N(null);try{let[e,t]=await Promise.all([d(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),d(`/plugins/marketplaces`)]);ue(e.available),fe(new Set(e.installed.map(e=>e.id))),E(t.sources)}catch(e){N(e instanceof Error?e.message:`Failed to load marketplace`)}finally{j(!1)}},[]),xe=(0,C.useCallback)(async()=>{try{ge((await d(`/plugins/stats?limit=20`)).stats)}catch{}},[]),X=(0,C.useCallback)(async()=>{try{ye((await d(`/roles`)).roles)}catch{}},[]);(0,C.useEffect)(()=>{J(),Y(),X()},[J,Y,X]);let Se=async(e,t)=>{L(e);try{await d(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),p.success(`${e} ${t?`enabled`:`disabled`} globally`),o(n=>n.map(n=>n.id===e?{...n,globalEnabled:t}:n))}catch(e){p.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{L(null)}},Ce=async e=>{L(e);try{await d(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),p.success(`Plugin uninstalled`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Uninstall failed`)}finally{L(null)}},we=async(e,t,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:`project`,cwd:n})});let r=q.find(e=>e.id===t)?.name??t;p.success(`Installed ${e.split(`@`)[0]} for ${r}`),await J()}catch(e){p.error(e instanceof Error?e.message:`Install to role failed`)}finally{L(null)}},Te=async()=>{if(B.trim())try{await d(`/plugins/install/${encodeURIComponent(B.trim())}`,{method:`POST`,body:JSON.stringify({})}),p.success(`Source added`),V(``),z(!1),await Y()}catch(e){p.error(e instanceof Error?e.message:`Failed to add source`)}},Z=async(e,t=`user`,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:t,cwd:n})});let r=t===`project`&&n?`${e.split(`@`)[0]} for ${n.split(`/`).pop()}`:e.split(`@`)[0];p.success(`Installed ${r}`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Install failed`)}finally{L(null)}},Ee=e=>{ve(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=G===`all`?e:e.filter(e=>e.scope===G),$=F?O.filter(e=>e.name.toLowerCase().includes(F.toLowerCase())||e.description.toLowerCase().includes(F.toLowerCase())):O;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(ae,{eyebrow:`Capabilities`,title:`Plugins`,compact:!0,description:`Installed capabilities, scope, and activation.`,metrics:[{label:`Total`,value:e.length},{label:`Project Scope`,value:e.filter(e=>e.scope===`project`).length},{label:`Catalog`,value:O.length}],actions:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>void J(),children:(0,w.jsx)(ie,{size:14})})}),(0,w.jsx)(oe,{title:`Installed Plugins`,compact:!0,description:`Filter by scope, inspect manifests, and keep every activation path reachable from one place.`}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(i,{size:14,className:`text-[var(--app-text-muted)] flex-shrink-0`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`all`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`all`),children:`All`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`user`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`user`),children:`User`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`project`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`project`),children:`Project`}),(0,w.jsx)(`span`,{className:`h-4 w-px bg-[var(--app-panel-muted)] mx-1`}),u.map(e=>(0,w.jsx)(m,{variant:`muted`,className:`text-xs`,children:e.name},e.name)),(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[A&&(0,w.jsx)(r,{size:12,className:`animate-spin text-[var(--app-text-subtle)]`}),A?null:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>z(!R),children:R?(0,w.jsx)(ee,{size:12}):(0,w.jsx)(a,{size:12})})]})]}),R&&(0,w.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:B,onChange:e=>V(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&Te()}}),(0,w.jsx)(f,{size:`sm`,onClick:()=>void Te(),disabled:!B.trim(),children:`Add`})]})]}),pe?(0,w.jsx)(h,{children:(0,w.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-text-subtle)]`,children:`Loading...`})}):Q.length===0?(0,w.jsx)(h,{children:(0,w.jsx)(ce,{icon:(0,w.jsx)(re,{size:32}),title:`No plugins`,description:G===`all`?`No plugins installed. Browse the marketplace or install from a URL.`:`No ${G}-scope plugins installed.`,className:`py-8`})}):be?(0,w.jsx)(`div`,{className:`space-y-3`,children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(h,{children:[(0,w.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:14}):(0,w.jsx)(t,{size:14})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})]}),e.scope===`project`&&e.projectPath?(0,w.jsx)(`p`,{className:`truncate text-[11px] text-[var(--app-text-subtle)]`,title:e.projectPath,children:e.projectPath}):null,(0,w.jsx)(T,{manifest:e.manifest})]})}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]}),i?(0,w.jsx)(`div`,{className:`mt-4 rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})}):null]},c)})}):(0,w.jsx)(h,{padding:!1,children:(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{className:`w-8`}),(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Version`}),(0,w.jsx)(v,{children:`Scope`}),(0,w.jsx)(v,{children:`Type`}),(0,w.jsx)(v,{children:`Activation`}),(0,w.jsx)(v,{children:`Actions`})]})}),(0,w.jsx)(y,{children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(C.Fragment,{children:[(0,w.jsxs)(b,{className:`group`,children:[(0,w.jsx)(x,{children:(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:g.xs}):(0,w.jsx)(t,{size:g.xs})})}),(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`}),(0,w.jsxs)(x,{children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),e.scope===`project`&&e.projectPath&&(0,w.jsx)(`div`,{className:`text-[10px] text-[var(--app-text-subtle)] truncate max-w-[120px]`,title:e.projectPath,children:e.projectPath.split(`/`).pop()})]}),(0,w.jsx)(x,{children:(0,w.jsx)(T,{manifest:e.manifest})}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})}),(0,w.jsx)(x,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]})})]}),i&&(0,w.jsx)(b,{className:`bg-[var(--app-panel)]/50`,children:(0,w.jsx)(x,{colSpan:7,className:`px-6 py-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})})},`${e.id}-detail`)]},c)})})]})}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>me(!P),children:[(0,w.jsx)(ne,{size:g.sm,className:`text-[var(--app-text-muted)]`}),`Marketplace (`,O.length,`)`,P?(0,w.jsx)(s,{size:g.xs,className:`ml-auto`}):(0,w.jsx)(t,{size:g.xs,className:`ml-auto`})]}),P&&(0,w.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(c,{size:g.sm,className:`absolute left-2.5 top-2 text-[var(--app-text-subtle)]`}),(0,w.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] pl-8 pr-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,value:F,onChange:e=>he(e.target.value),placeholder:`Search available plugins...`})]}),A?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`Loading marketplace...`}):M?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-danger)] text-center py-2`,children:M}):$.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:F?`No plugins match your search`:`No marketplace plugins available`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Description`}),(0,w.jsx)(v,{children:`Source`}),(0,w.jsx)(v,{children:`Action`})]})}),(0,w.jsx)(y,{children:$.map(e=>{let t=de.has(e.pluginId),i=I===e.pluginId;return(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.name}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)] max-w-[300px] truncate`,title:e.description,children:e.description}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:`muted`,className:`text-[10px]`,children:e.marketplaceName})}),(0,w.jsx)(x,{children:t?(0,w.jsx)(m,{variant:`success`,className:`text-[10px]`,children:`Installed`}):(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:i,onClick:()=>void Z(e.pluginId),children:i?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(n,{size:g.xs}),` Install`]})}),q.length>0&&(0,w.jsxs)(`div`,{className:`relative group/install`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1 text-xs text-[var(--app-text-subtle)]`,children:(0,w.jsx)(s,{size:g.xs})}),(0,w.jsx)(`div`,{className:`absolute right-0 top-full mt-1 z-10 hidden group-hover/install:block bg-[var(--app-panel-elevated)] border border-[var(--app-border)] rounded shadow-lg py-1 min-w-[140px]`,children:q.map(t=>(0,w.jsx)(`button`,{className:`block w-full text-left px-3 py-1 text-xs text-[var(--app-text)] hover:bg-[var(--app-panel-muted)]`,disabled:i,onClick:()=>void Z(e.pluginId,`project`,t.workspacePath),children:t.name},t.id))})]})]})})]},e.pluginId)})})]})]})]}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>{!U&&H.length===0&&xe(),_e(!U)},children:[(0,w.jsx)(te,{size:14,className:`text-[var(--app-text-muted)]`}),`Usage Stats`,U?(0,w.jsx)(s,{size:12,className:`ml-auto`}):(0,w.jsx)(t,{size:12,className:`ml-auto`})]}),U&&(0,w.jsx)(`div`,{className:`mt-3`,children:H.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`No usage data yet`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Plugin`}),(0,w.jsx)(v,{children:`Usage Count`}),(0,w.jsx)(v,{children:`Last Used`})]})}),(0,w.jsx)(y,{children:H.map(e=>(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.pluginName}),(0,w.jsx)(x,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.usageCount}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.lastUsed?se(e.lastUsed):`—`})]},e.pluginPath))})]})})]})]})}export{O as Plugins};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,G as n,M as r,R as i,S as a,ct as o,et as s,g as c,n as ee,nt as te,s as l,u as ne,x as re,y as ie}from"./vendor-icons-Dk0hMuJz.js";import{t as u}from"./vendor-react-C6faO6LO.js";import{n as d}from"./dist-Bdqp1ixJ.js";import{t as f}from"./Button-DuQctNms.js";import{i as p,t as m}from"./index-DYsO5Awn.js";import{t as h}from"./Card-rKfViPS2.js";import{t as ae}from"./PageHeader-CHSgtxPw.js";import{t as oe}from"./SectionHeader-C2WpiwJ5.js";import{a as se}from"./format-CHfBBLog.js";import{t as ce}from"./EmptyState-CIdIlMbn.js";import{t as g}from"./ui-B_uMx2Fy.js";import{t as le}from"./useIsMobileLayout-C6KIQjuh.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-DuOLbyJQ.js";var C=e(o(),1),w=u();function T({manifest:e}){if(!e)return null;let t=[];return e.skills.length>0&&t.push({label:`Skill(${e.skills.length})`,variant:`info`}),e.agents.length>0&&t.push({label:`Agent(${e.agents.length})`,variant:`success`}),e.mcpServers.length>0&&t.push({label:`MCP(${e.mcpServers.length})`,variant:`warning`}),e.hooks.length>0&&t.push({label:`Hook(${e.hooks.length})`,variant:`default`}),e.lspServers.length>0&&t.push({label:`LSP(${e.lspServers.length})`,variant:`default`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,w.jsx)(m,{variant:e.variant,children:e.label},e.label))})}function E({label:e,value:t}){return(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:e}),(0,w.jsx)(`p`,{className:`mt-1 text-sm font-medium text-[var(--app-text)]`,children:t})]})}function D({plugin:e,roles:t,operatingId:n,onInstallToRole:r}){return e.manifest?(0,w.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[e.manifest.description?(0,w.jsx)(`p`,{className:`text-[var(--app-text-muted)]`,children:e.manifest.description}):null,(0,w.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-4`,children:[(0,w.jsx)(E,{label:`Version`,value:e.version?`v${e.version}`:`—`}),(0,w.jsx)(E,{label:`Scope`,value:e.scope}),(0,w.jsx)(E,{label:`Capability Count`,value:e.manifest.skills.length+e.manifest.agents.length+e.manifest.mcpServers.length+e.manifest.hooks.length+e.manifest.lspServers.length}),(0,w.jsx)(E,{label:`Activation`,value:e.globalEnabled?`User On`:`User Off`})]}),(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install Path`}),(0,w.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-[var(--app-text-muted)]`,title:e.installPath,children:e.installPath})]}),(0,w.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e.manifest.skills.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Skills`}),e.manifest.skills.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.agents.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Agents`}),e.manifest.agents.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.mcpServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.hooks.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.lspServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`LSP Servers`}),e.manifest.lspServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]})]}),t.length>0&&e.scope===`user`?(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`p`,{className:`mb-2 text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install to Role`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[10px]`,disabled:n===e.id,onClick:()=>void r(e.id,t.id,t.workspacePath),children:t.name},t.id))})]}):null]}):(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading manifest...`})}function O(){let[e,o]=(0,C.useState)([]),[u,E]=(0,C.useState)([]),[O,ue]=(0,C.useState)([]),[de,fe]=(0,C.useState)(new Set),[pe,k]=(0,C.useState)(!0),[A,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,me]=(0,C.useState)(!1),[F,he]=(0,C.useState)(``),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(``),[H,ge]=(0,C.useState)([]),[U,_e]=(0,C.useState)(!1),[W,ve]=(0,C.useState)(new Set),[G,K]=(0,C.useState)(`all`),[q,ye]=(0,C.useState)([]),be=le(),J=(0,C.useCallback)(async()=>{k(!0);try{o((await d(`/plugins`)).plugins)}catch(e){p.error(e instanceof Error?e.message:`Failed to load plugins`)}finally{k(!1)}},[]),Y=(0,C.useCallback)(async()=>{j(!0),N(null);try{let[e,t]=await Promise.all([d(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),d(`/plugins/marketplaces`)]);ue(e.available),fe(new Set(e.installed.map(e=>e.id))),E(t.sources)}catch(e){N(e instanceof Error?e.message:`Failed to load marketplace`)}finally{j(!1)}},[]),xe=(0,C.useCallback)(async()=>{try{ge((await d(`/plugins/stats?limit=20`)).stats)}catch{}},[]),X=(0,C.useCallback)(async()=>{try{ye((await d(`/roles`)).roles)}catch{}},[]);(0,C.useEffect)(()=>{J(),Y(),X()},[J,Y,X]);let Se=async(e,t)=>{L(e);try{await d(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),p.success(`${e} ${t?`enabled`:`disabled`} globally`),o(n=>n.map(n=>n.id===e?{...n,globalEnabled:t}:n))}catch(e){p.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{L(null)}},Ce=async e=>{L(e);try{await d(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),p.success(`Plugin uninstalled`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Uninstall failed`)}finally{L(null)}},we=async(e,t,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:`project`,cwd:n})});let r=q.find(e=>e.id===t)?.name??t;p.success(`Installed ${e.split(`@`)[0]} for ${r}`),await J()}catch(e){p.error(e instanceof Error?e.message:`Install to role failed`)}finally{L(null)}},Te=async()=>{if(B.trim())try{await d(`/plugins/install/${encodeURIComponent(B.trim())}`,{method:`POST`,body:JSON.stringify({})}),p.success(`Source added`),V(``),z(!1),await Y()}catch(e){p.error(e instanceof Error?e.message:`Failed to add source`)}},Z=async(e,t=`user`,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:t,cwd:n})});let r=t===`project`&&n?`${e.split(`@`)[0]} for ${n.split(`/`).pop()}`:e.split(`@`)[0];p.success(`Installed ${r}`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Install failed`)}finally{L(null)}},Ee=e=>{ve(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=G===`all`?e:e.filter(e=>e.scope===G),$=F?O.filter(e=>e.name.toLowerCase().includes(F.toLowerCase())||e.description.toLowerCase().includes(F.toLowerCase())):O;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(ae,{eyebrow:`Capabilities`,title:`Plugins`,compact:!0,description:`Installed capabilities, scope, and activation.`,metrics:[{label:`Total`,value:e.length},{label:`Project Scope`,value:e.filter(e=>e.scope===`project`).length},{label:`Catalog`,value:O.length}],actions:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>void J(),children:(0,w.jsx)(ie,{size:14})})}),(0,w.jsx)(oe,{title:`Installed Plugins`,compact:!0,description:`Filter by scope, inspect manifests, and keep every activation path reachable from one place.`}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(i,{size:14,className:`text-[var(--app-text-muted)] flex-shrink-0`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`all`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`all`),children:`All`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`user`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`user`),children:`User`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`project`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`project`),children:`Project`}),(0,w.jsx)(`span`,{className:`h-4 w-px bg-[var(--app-panel-muted)] mx-1`}),u.map(e=>(0,w.jsx)(m,{variant:`muted`,className:`text-xs`,children:e.name},e.name)),(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[A&&(0,w.jsx)(r,{size:12,className:`animate-spin text-[var(--app-text-subtle)]`}),A?null:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>z(!R),children:R?(0,w.jsx)(ee,{size:12}):(0,w.jsx)(a,{size:12})})]})]}),R&&(0,w.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:B,onChange:e=>V(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&Te()}}),(0,w.jsx)(f,{size:`sm`,onClick:()=>void Te(),disabled:!B.trim(),children:`Add`})]})]}),pe?(0,w.jsx)(h,{children:(0,w.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-text-subtle)]`,children:`Loading...`})}):Q.length===0?(0,w.jsx)(h,{children:(0,w.jsx)(ce,{icon:(0,w.jsx)(re,{size:32}),title:`No plugins`,description:G===`all`?`No plugins installed. Browse the marketplace or install from a URL.`:`No ${G}-scope plugins installed.`,className:`py-8`})}):be?(0,w.jsx)(`div`,{className:`space-y-3`,children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(h,{children:[(0,w.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:14}):(0,w.jsx)(t,{size:14})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})]}),e.scope===`project`&&e.projectPath?(0,w.jsx)(`p`,{className:`truncate text-[11px] text-[var(--app-text-subtle)]`,title:e.projectPath,children:e.projectPath}):null,(0,w.jsx)(T,{manifest:e.manifest})]})}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]}),i?(0,w.jsx)(`div`,{className:`mt-4 rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})}):null]},c)})}):(0,w.jsx)(h,{padding:!1,children:(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{className:`w-8`}),(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Version`}),(0,w.jsx)(v,{children:`Scope`}),(0,w.jsx)(v,{children:`Type`}),(0,w.jsx)(v,{children:`Activation`}),(0,w.jsx)(v,{children:`Actions`})]})}),(0,w.jsx)(y,{children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(C.Fragment,{children:[(0,w.jsxs)(b,{className:`group`,children:[(0,w.jsx)(x,{children:(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:g.xs}):(0,w.jsx)(t,{size:g.xs})})}),(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`}),(0,w.jsxs)(x,{children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),e.scope===`project`&&e.projectPath&&(0,w.jsx)(`div`,{className:`text-[10px] text-[var(--app-text-subtle)] truncate max-w-[120px]`,title:e.projectPath,children:e.projectPath.split(`/`).pop()})]}),(0,w.jsx)(x,{children:(0,w.jsx)(T,{manifest:e.manifest})}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})}),(0,w.jsx)(x,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]})})]}),i&&(0,w.jsx)(b,{className:`bg-[var(--app-panel)]/50`,children:(0,w.jsx)(x,{colSpan:7,className:`px-6 py-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})})},`${e.id}-detail`)]},c)})})]})}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>me(!P),children:[(0,w.jsx)(ne,{size:g.sm,className:`text-[var(--app-text-muted)]`}),`Marketplace (`,O.length,`)`,P?(0,w.jsx)(s,{size:g.xs,className:`ml-auto`}):(0,w.jsx)(t,{size:g.xs,className:`ml-auto`})]}),P&&(0,w.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(c,{size:g.sm,className:`absolute left-2.5 top-2 text-[var(--app-text-subtle)]`}),(0,w.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] pl-8 pr-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,value:F,onChange:e=>he(e.target.value),placeholder:`Search available plugins...`})]}),A?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`Loading marketplace...`}):M?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-danger)] text-center py-2`,children:M}):$.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:F?`No plugins match your search`:`No marketplace plugins available`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Description`}),(0,w.jsx)(v,{children:`Source`}),(0,w.jsx)(v,{children:`Action`})]})}),(0,w.jsx)(y,{children:$.map(e=>{let t=de.has(e.pluginId),i=I===e.pluginId;return(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.name}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)] max-w-[300px] truncate`,title:e.description,children:e.description}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:`muted`,className:`text-[10px]`,children:e.marketplaceName})}),(0,w.jsx)(x,{children:t?(0,w.jsx)(m,{variant:`success`,className:`text-[10px]`,children:`Installed`}):(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:i,onClick:()=>void Z(e.pluginId),children:i?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(n,{size:g.xs}),` Install`]})}),q.length>0&&(0,w.jsxs)(`div`,{className:`relative group/install`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1 text-xs text-[var(--app-text-subtle)]`,children:(0,w.jsx)(s,{size:g.xs})}),(0,w.jsx)(`div`,{className:`absolute right-0 top-full mt-1 z-10 hidden group-hover/install:block bg-[var(--app-panel-elevated)] border border-[var(--app-border)] rounded shadow-lg py-1 min-w-[140px]`,children:q.map(t=>(0,w.jsx)(`button`,{className:`block w-full text-left px-3 py-1 text-xs text-[var(--app-text)] hover:bg-[var(--app-panel-muted)]`,disabled:i,onClick:()=>void Z(e.pluginId,`project`,t.workspacePath),children:t.name},t.id))})]})]})})]},e.pluginId)})})]})]})]}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>{!U&&H.length===0&&xe(),_e(!U)},children:[(0,w.jsx)(te,{size:14,className:`text-[var(--app-text-muted)]`}),`Usage Stats`,U?(0,w.jsx)(s,{size:12,className:`ml-auto`}):(0,w.jsx)(t,{size:12,className:`ml-auto`})]}),U&&(0,w.jsx)(`div`,{className:`mt-3`,children:H.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`No usage data yet`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Plugin`}),(0,w.jsx)(v,{children:`Usage Count`}),(0,w.jsx)(v,{children:`Last Used`})]})}),(0,w.jsx)(y,{children:H.map(e=>(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.pluginName}),(0,w.jsx)(x,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.usageCount}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.lastUsed?se(e.lastUsed):`—`})]},e.pluginPath))})]})})]})]})}export{O as Plugins};
|