adam-agent-server 1.3.0 → 1.5.0

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 (138) hide show
  1. package/README.md +22 -9
  2. package/dist/App-JGH6G5US.js +13 -0
  3. package/dist/adam-tools-W5AOIGEQ.js +1 -0
  4. package/dist/{approval-handler-RIJO3OBO.js → approval-handler-ORD4MUVM.js} +1 -1
  5. package/dist/audit-manager-YCJT2WP5.js +1 -0
  6. package/dist/bree-engine-R5YLSDCL.js +1 -0
  7. package/dist/{channels-LUJ7GTSP.js → channels-HYSB2EEK.js} +1 -1
  8. package/dist/channels-JCMPPQED.js +1 -0
  9. package/dist/{chunk-CLHSPXZ6.js → chunk-23VZKIB6.js} +1 -1
  10. package/dist/{chunk-AZBNUSM2.js → chunk-2DLVAKH7.js} +1 -1
  11. package/dist/chunk-2YAP4YJV.js +57 -0
  12. package/dist/{chunk-YPOTHL7X.js → chunk-5S6BMWD2.js} +1 -1
  13. package/dist/chunk-5XUR3M23.js +12 -0
  14. package/dist/chunk-6775OYXA.js +47 -0
  15. package/dist/chunk-6FXNB7NE.js +1 -0
  16. package/dist/{chunk-WKS7QVIX.js → chunk-7L2WQM7N.js} +1 -1
  17. package/dist/{chunk-NDP6LWXX.js → chunk-BR2JY5X2.js} +1 -1
  18. package/dist/{chunk-IZGTTLTG.js → chunk-C6BOQJJF.js} +1 -1
  19. package/dist/{chunk-4NW2DNDZ.js → chunk-DZEVMYPB.js} +1 -1
  20. package/dist/chunk-GBTG5B5R.js +8 -0
  21. package/dist/chunk-GY52JA5I.js +10 -0
  22. package/dist/{chunk-HFN7Y3IM.js → chunk-H54ZXA26.js} +1 -1
  23. package/dist/{chunk-DBUEHITK.js → chunk-H7VDC6FY.js} +2 -2
  24. package/dist/{chunk-ZQYKT5UY.js → chunk-HDP7A4XY.js} +1 -1
  25. package/dist/{chunk-4LSIHSCO.js → chunk-HTPUEIFT.js} +1 -1
  26. package/dist/{chunk-JZNBFZ7W.js → chunk-ISZJV72D.js} +1 -1
  27. package/dist/{chunk-4MJF77RD.js → chunk-JAS3TUZX.js} +4 -3
  28. package/dist/chunk-MTWLLE26.js +49 -0
  29. package/dist/{chunk-NUTUI5KM.js → chunk-QVKI7H7W.js} +1 -1
  30. package/dist/{chunk-7IXLL673.js → chunk-QWCRZDZS.js} +1 -1
  31. package/dist/{chunk-P6KWAGAY.js → chunk-R4GIIQ7G.js} +1 -1
  32. package/dist/chunk-RAW263MQ.js +99 -0
  33. package/dist/{chunk-IKUBP3SY.js → chunk-S3BAIZ4Q.js} +2 -2
  34. package/dist/chunk-VRJ7R766.js +1 -0
  35. package/dist/{chunk-WTRM5VO7.js → chunk-XL46AGRZ.js} +2 -2
  36. package/dist/{chunk-AKPLOO2V.js → chunk-Y3AMO6WC.js} +1 -1
  37. package/dist/{chunk-TCHBOWQ5.js → chunk-YVS565QY.js} +1 -1
  38. package/dist/{chunk-TKDT7EQO.js → chunk-Z4D3L2HR.js} +1 -1
  39. package/dist/cli.js +2 -2
  40. package/dist/{config-HR4MBTIS.js → config-EMNKHR3W.js} +1 -1
  41. package/dist/{db-6KUGCGVR.js → db-YUYXVV3A.js} +1 -1
  42. package/dist/{delivery-log-7DJJTPXL.js → delivery-log-VKONLSVD.js} +1 -1
  43. package/dist/engine-BM5BMPIC.js +1 -0
  44. package/dist/{evolution-audit-I2ITWAEC.js → evolution-audit-LZSQPDHH.js} +1 -1
  45. package/dist/index.js +18 -12
  46. package/dist/{learner-CBPQZ3HL.js → learner-IJN6B7KV.js} +1 -1
  47. package/dist/{memories-HBBW44MG.js → memories-ZII5QSTJ.js} +1 -1
  48. package/dist/{memory-extractor-XO2HJ22Y.js → memory-extractor-DIYJFBCI.js} +2 -2
  49. package/dist/memory-service-QMYJPBAE.js +1 -0
  50. package/dist/outbound-gateway-6K6P2BEH.js +1 -0
  51. package/dist/role-presets-K2BDRZBS.js +1 -0
  52. package/dist/roles-L34L5MK3.js +1 -0
  53. package/dist/{session-manager-JICVE4CO.js → session-manager-GRJ3FV3L.js} +1 -1
  54. package/dist/{task-templates-NC7XIZIC.js → task-templates-23YOAF3E.js} +1 -1
  55. package/dist/workflow-executor-JTUWX5DC.js +1 -0
  56. package/package.json +2 -2
  57. package/web/dist/assets/AlertDialog-r3y6IhpW.js +51 -0
  58. package/web/dist/assets/Button-BjXgrQ95.js +1 -0
  59. package/web/dist/assets/Card-C153tGfJ.js +1 -0
  60. package/web/dist/assets/ChannelDetail-C2uAZv1u.js +1 -0
  61. package/web/dist/assets/Channels-C62Qrg-n.js +12 -0
  62. package/web/dist/assets/Chat-kH2owmB_.js +1 -0
  63. package/web/dist/assets/Dashboard-BhD8SpFb.js +1 -0
  64. package/web/dist/assets/EmptyState-CXwJFCDQ.js +1 -0
  65. package/web/dist/assets/EnvVarEditor-GSapLD96.js +1 -0
  66. package/web/dist/assets/Evolution-BO5hysLD.js +6 -0
  67. package/web/dist/assets/GoalDetail-cxa8OvEi.js +1 -0
  68. package/web/dist/assets/Goals-Dz3qqp_l.js +1 -0
  69. package/web/dist/assets/Logs-Ckp3-hYV.js +1 -0
  70. package/web/dist/assets/Memories-DEuSRoP3.js +1 -0
  71. package/web/dist/assets/NotFound-Bvn39vSk.js +1 -0
  72. package/web/dist/assets/PageHeader-BMvN0xiB.js +1 -0
  73. package/web/dist/assets/Plugins-CRym22JF.js +1 -0
  74. package/web/dist/assets/RoleDetail-BWMjP9aZ.js +33 -0
  75. package/web/dist/assets/Roles-DD7NBDku.js +1 -0
  76. package/web/dist/assets/SectionHeader-CiCj3Is0.js +1 -0
  77. package/web/dist/assets/Settings-BlU19KuR.js +1 -0
  78. package/web/dist/assets/Strategies-CJ_q94-v.js +1 -0
  79. package/web/dist/assets/Switch-CoUUy5jr.js +1 -0
  80. package/web/dist/assets/Table-CaFJieh_.js +1 -0
  81. package/web/dist/assets/TaskDetail-DVrjU-E6.js +2 -0
  82. package/web/dist/assets/Work-BMl61RRi.js +1 -0
  83. package/web/dist/assets/dist-Bdqp1ixJ.js +1 -0
  84. package/web/dist/assets/index-DcXMQByM.css +2 -0
  85. package/web/dist/assets/index-pF--tN9F.js +2 -0
  86. package/web/dist/assets/ui-B_uMx2Fy.js +1 -0
  87. package/web/dist/assets/useIsMobileLayout-Bwrm84kJ.js +1 -0
  88. package/web/dist/assets/vendor-icons-BlMaTTx3.js +1 -0
  89. package/web/dist/assets/{vendor-react-DLRtONKt.js → vendor-react-7e01TWy7.js} +2 -2
  90. package/web/dist/assets/vendor-state-Bj70wnRm.js +1 -0
  91. package/web/dist/index.html +8 -6
  92. package/dist/App-3OBJDI2C.js +0 -9
  93. package/dist/adam-tools-4LZYFB6J.js +0 -1
  94. package/dist/audit-manager-6FFPXID3.js +0 -1
  95. package/dist/bree-engine-2NOTIBAZ.js +0 -1
  96. package/dist/channels-TSZLEU3L.js +0 -1
  97. package/dist/chunk-6NUHSHS5.js +0 -4
  98. package/dist/chunk-72VLUJ2S.js +0 -1
  99. package/dist/chunk-7CJGPCSJ.js +0 -49
  100. package/dist/chunk-NLD7WK3R.js +0 -6
  101. package/dist/chunk-OTH4M5L3.js +0 -8
  102. package/dist/chunk-PVYEGQEG.js +0 -83
  103. package/dist/chunk-XTHP5JMO.js +0 -10
  104. package/dist/chunk-ZKMDHQJY.js +0 -104
  105. package/dist/engine-HJUE6I4I.js +0 -1
  106. package/dist/memory-service-HIFTKEW2.js +0 -1
  107. package/dist/outbound-gateway-GGFMU5JW.js +0 -1
  108. package/dist/role-presets-W452Y3RV.js +0 -1
  109. package/dist/roles-NYGWZMQI.js +0 -1
  110. package/dist/workflow-executor-QN4KP7B4.js +0 -1
  111. package/web/dist/assets/Card-4mOZntHG.js +0 -1
  112. package/web/dist/assets/ChannelDetail-DX4QnE8j.js +0 -1
  113. package/web/dist/assets/Channels-EXkNOQpB.js +0 -12
  114. package/web/dist/assets/Chat-Da-mCR0c.js +0 -1
  115. package/web/dist/assets/Dashboard-Bq6sEDdP.js +0 -1
  116. package/web/dist/assets/EmptyState-BlgMMAr-.js +0 -1
  117. package/web/dist/assets/EnvVarEditor-CNxXpVbD.js +0 -1
  118. package/web/dist/assets/Evolution-DPdmbooj.js +0 -6
  119. package/web/dist/assets/GoalDetail-BamCfVzS.js +0 -1
  120. package/web/dist/assets/Goals-CHPEg0RK.js +0 -1
  121. package/web/dist/assets/Logs-BHkBvH0T.js +0 -1
  122. package/web/dist/assets/Memories-BY2pJhVd.js +0 -1
  123. package/web/dist/assets/NotFound-CSjhzSGa.js +0 -1
  124. package/web/dist/assets/Plugins-C5xLM0BU.js +0 -1
  125. package/web/dist/assets/RoleDetail-Dnp-W14x.js +0 -33
  126. package/web/dist/assets/Roles-BVOVoHvc.js +0 -1
  127. package/web/dist/assets/Settings-eBHvn6s_.js +0 -1
  128. package/web/dist/assets/Strategies-BbFbLKBJ.js +0 -1
  129. package/web/dist/assets/Switch-Q-inggPs.js +0 -1
  130. package/web/dist/assets/Table-BxbnOSbq.js +0 -1
  131. package/web/dist/assets/TaskDetail-BEjZ1gco.js +0 -2
  132. package/web/dist/assets/Work-CF2iLs8i.js +0 -1
  133. package/web/dist/assets/dist-HyCSN_hp.js +0 -1
  134. package/web/dist/assets/index-CaHdOfAc.js +0 -52
  135. package/web/dist/assets/index-D0SvKqKc.css +0 -2
  136. package/web/dist/assets/vendor-icons-CkI4-NxL.js +0 -1
  137. package/web/dist/assets/vendor-state-B_-GdGNJ.js +0 -1
  138. /package/web/dist/assets/{format-DvtQjPZn.js → format-CHfBBLog.js} +0 -0
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{L as t,R as n,a as r,nt as i,o as a,v as o}from"./vendor-icons-CkI4-NxL.js";import{t as s}from"./vendor-react-DLRtONKt.js";import{n as c,r as l}from"./dist-HyCSN_hp.js";import{f as u,w as d}from"./index-CaHdOfAc.js";import{n as f,r as p,t as m}from"./Card-4mOZntHG.js";var h=e(i(),1),g=s(),_=h.forwardRef(({className:e,type:t,...n},r)=>(0,g.jsx)(`input`,{type:t,className:c(`flex h-8 w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-1 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));_.displayName=`Input`;var v=/^[A-Za-z_][A-Za-z0-9_]*$/,y=/key|token|secret|password|credential/i;function b({envVars:e,onSave:i,mode:s,roleId:c,title:b=`Environment Variables`}){let[x,S]=(0,h.useState)([]),[C,w]=(0,h.useState)(!1),[T,E]=(0,h.useState)(new Set),[D,O]=(0,h.useState)([]),[k,A]=(0,h.useState)(!1);(0,h.useEffect)(()=>{S(Object.entries(e??{}).map(([e,t])=>({key:e,value:t,isNew:!1})))},[e]);let j=(0,h.useCallback)(async()=>{try{let e=await l(s===`global`?`/config/env-diff`:`/roles/${c}/env-diff`);O(s===`global`?e.diffs.filter(e=>e.configPath?.startsWith(`defaults.env.`)):e.diffs),A(e.envFileExists)}catch{}},[s,c]);(0,h.useEffect)(()=>{j()},[j]);let M=()=>{let t=Object.fromEntries(x.filter(e=>e.key.trim()).map(e=>[e.key,e.value]));return JSON.stringify(t)!==JSON.stringify(e)},N=()=>{S(e=>[...e,{key:``,value:``,isNew:!0}])},P=e=>{S(t=>t.filter((t,n)=>n!==e))},F=(e,t,n)=>{S(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r))},I=e=>{E(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},L=()=>{let e=new Set;for(let t of x){let n=t.key.trim();if(n){if(!v.test(n))return`Invalid key format: "${n}"`;if(n.startsWith(`ANTHROPIC_`))return`ANTHROPIC_* keys are managed in the Anthropic section`;if(e.has(n))return`Duplicate key: "${n}"`;e.add(n)}}return e.size>100?`Maximum 100 environment variables`:null},R=async()=>{let e=L();if(e){d.error(e);return}w(!0);try{let e={};for(let t of x){let n=t.key.trim();n&&(e[n]=t.value)}s===`global`?await l(`/config/env`,{method:`PUT`,body:JSON.stringify(e)}):await l(`/roles/${c}`,{method:`PATCH`,body:JSON.stringify({envVars:e})}),d.success(`Environment variables saved`),i(),j()}catch(e){d.error(e instanceof Error?e.message:`Failed to save`)}finally{w(!1)}},z=async()=>{try{await l(s===`global`?`/config/sync-to-env`:`/roles/${c}/sync-to-env`,{method:`POST`}),d.success(`Synced DB to .env`),j()}catch(e){d.error(e instanceof Error?e.message:`Sync failed`)}},B=async()=>{try{await l(s===`global`?`/config/load-from-env`:`/roles/${c}/load-from-env`,{method:`POST`}),d.success(`Loaded .env to DB`),i(),j()}catch(e){d.error(e instanceof Error?e.message:`Load failed`)}};return(0,g.jsxs)(m,{children:[(0,g.jsxs)(f,{children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,g.jsx)(p,{className:`text-sm`,children:b}),(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsxs)(u,{variant:`ghost`,size:`sm`,onClick:N,children:[(0,g.jsx)(o,{size:14,className:`mr-1`}),` Add`]}),M()&&(0,g.jsx)(u,{size:`sm`,onClick:()=>void R(),disabled:C,children:C?`Saving...`:`Save`})]})]}),s===`global`&&(0,g.jsx)(`p`,{className:`text-xs text-slate-500 mt-1`,children:`ANTHROPIC_* variables are managed in the Anthropic section above.`})]}),D.length>0&&k&&(0,g.jsx)(`div`,{className:`mx-4 mb-3 rounded border border-yellow-800 bg-yellow-950/50 p-3`,children:(0,g.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(r,{size:14,className:`text-yellow-400`}),(0,g.jsxs)(`span`,{className:`text-xs text-yellow-400`,children:[`.env and DB differ on `,D.length,` key(s): `,D.map(e=>e.envKey).join(`, `)]})]}),(0,g.jsxs)(`div`,{className:`flex gap-2`,children:[(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void z(),children:`DB → .env`}),(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void B(),children:`.env → DB`})]})]})}),(0,g.jsxs)(`div`,{className:`px-4 pb-4 space-y-2`,children:[x.length===0&&(0,g.jsx)(`p`,{className:`text-xs text-slate-500 py-2`,children:`No environment variables configured.`}),x.map((e,r)=>{let i=y.test(e.key),o=T.has(e.key)||e.isNew;return(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(_,{className:`w-48 font-mono text-xs`,placeholder:`KEY_NAME`,value:e.key,onChange:e=>F(r,`key`,e.target.value)}),(0,g.jsx)(`span`,{className:`text-slate-600`,children:`=`}),(0,g.jsxs)(`div`,{className:`relative flex-1`,children:[(0,g.jsx)(_,{className:`font-mono text-xs pr-8`,type:i&&!o?`password`:`text`,placeholder:`value`,value:e.value,onChange:e=>F(r,`value`,e.target.value)}),i&&(0,g.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300`,onClick:()=>I(e.key),children:o?(0,g.jsx)(n,{size:12}):(0,g.jsx)(t,{size:12})})]}),(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-red-500 hover:text-red-300`,onClick:()=>P(r),children:(0,g.jsx)(a,{size:14})})]},r)})]})]})}export{b as t};
@@ -1,6 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{F as t,h as n,nt as r}from"./vendor-icons-CkI4-NxL.js";import{t as i}from"./vendor-react-DLRtONKt.js";import{r as a}from"./dist-HyCSN_hp.js";import{C as o,f as s,t as c}from"./index-CaHdOfAc.js";import{t as l}from"./Card-4mOZntHG.js";import{a as u}from"./format-DvtQjPZn.js";import{t as d}from"./EmptyState-BlgMMAr-.js";var f=e(r(),1),p=i();function m(){let e=o(e=>e.roles),r=o(e=>e.fetchRoles),[i,m]=(0,f.useState)([]),[h,g]=(0,f.useState)(!0),[_,v]=(0,f.useState)(`all`);(0,f.useEffect)(()=>{r()},[r]);let y=(0,f.useCallback)(async()=>{g(!0);try{let e=new URLSearchParams({limit:`50`});_!==`all`&&e.set(`roleId`,_),m(await a(`/evolution-audit?${e}`))}catch{m([])}finally{g(!1)}},[_]);(0,f.useEffect)(()=>{y()},[y]);let b=t=>t?e.find(e=>e.id===t)?.name??t.slice(0,8):`System`;return(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Evolution Audit`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsxs)(`select`,{className:`rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:_,onChange:e=>v(e.target.value),children:[(0,p.jsx)(`option`,{value:`all`,children:`All roles`}),e.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,p.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:(0,p.jsx)(n,{size:14})})]})]}),(0,p.jsx)(l,{children:h?(0,p.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,p.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-slate-700 border-t-blue-500`})}):i.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(t,{size:32}),title:`No evolution records`,description:`Evolution occurs when roles accumulate enough task experience`}):(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`p`,{className:`text-xs text-slate-500`,children:[i.length,` records`]}),i.map(e=>(0,p.jsxs)(`div`,{className:`rounded border border-slate-800 p-3`,children:[(0,p.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,p.jsx)(c,{variant:`info`,children:b(e.roleId)}),(0,p.jsx)(`span`,{className:`text-xs text-slate-500`,children:u(e.timestamp)}),e.triggerTaskId&&(0,p.jsxs)(`span`,{className:`text-[10px] text-slate-600`,children:[`triggered by task `,e.triggerTaskId.slice(0,8)]})]}),e.diff.includes(`--- Diagnostic Report ---`)?(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsxs)(`div`,{className:`rounded bg-slate-950 p-2`,children:[(0,p.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-slate-400`,children:`Diagnostic Report`}),(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-slate-400`,children:e.diff.split(`--- Rules Diff ---`)[0]?.replace(`--- Diagnostic Report ---
2
- `,``).trim()})]}),(0,p.jsxs)(`div`,{className:`rounded bg-slate-950 p-2`,children:[(0,p.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-slate-400`,children:`Rules Changes`}),(0,p.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap font-mono text-xs`,children:(e.diff.split(`--- Rules Diff ---`)[1]??``).trim().split(`
3
- `).map((e,t)=>(0,p.jsxs)(`span`,{className:e.startsWith(`+`)?`text-green-400`:e.startsWith(`-`)?`text-red-400`:`text-slate-400`,children:[e,`
4
- `]},t))})]})]}):(0,p.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded bg-slate-950 p-2 font-mono text-xs`,children:e.diff.split(`
5
- `).map((e,t)=>(0,p.jsxs)(`span`,{className:e.startsWith(`+`)?`text-green-400`:e.startsWith(`-`)?`text-red-400`:`text-slate-400`,children:[e,`
6
- `]},t))})]},e.id))]})})]})}export{m as Evolution};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,B as n,H as r,M as i,c as a,nt as o}from"./vendor-icons-CkI4-NxL.js";import{d as s,r as c,t as l}from"./vendor-react-DLRtONKt.js";import{r as u}from"./dist-HyCSN_hp.js";import{t as d}from"./index-CaHdOfAc.js";import{n as f,r as p,t as m}from"./Card-4mOZntHG.js";import{n as h}from"./format-DvtQjPZn.js";var g=e(o(),1),_=l();function v(){let{id:e}=s(),[o,l]=(0,g.useState)(null),[v,b]=(0,g.useState)([]),[x,S]=(0,g.useState)(null);if((0,g.useEffect)(()=>{e&&(async()=>{try{let t=await u(`/goals/${e}`);l(t.goal),S(null);try{b((await u(`/strategies?role=${t.goal.roleId}`)).strategies??[])}catch{}}catch(e){S(e instanceof Error?e.message:`Failed to load goal`)}})()},[e]),x)return(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-slate-400 hover:text-slate-200`,children:[(0,_.jsx)(t,{size:14}),` Back to Goals`]}),(0,_.jsx)(m,{className:`text-center text-red-400`,children:x})]});if(!o)return(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-slate-400 hover:text-slate-200`,children:[(0,_.jsx)(t,{size:14}),` Back to Goals`]}),(0,_.jsx)(m,{className:`text-center text-slate-500`,children:`Loading...`})]});let C=o.targetValue>0?Math.min(100,o.currentValue/o.targetValue*100):0,w=o.deadline>0&&o.deadline<Date.now()&&o.status!==`completed`;return(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-slate-400 hover:text-slate-200`,children:[(0,_.jsx)(t,{size:14}),` Back to Goals`]}),(0,_.jsx)(m,{children:(0,_.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,_.jsx)(d,{variant:(e=>e===`completed`?`success`:e===`executing`||e===`evaluating`?`warning`:e===`failed`?`destructive`:`secondary`)(o.status),children:o.status}),(0,_.jsx)(d,{variant:`outline`,children:o.roleId}),(0,_.jsx)(d,{variant:`outline`,children:o.metricType}),(0,_.jsx)(`span`,{className:`font-mono text-xs text-slate-500`,children:o.id})]}),(0,_.jsx)(`h2`,{className:`text-lg font-semibold text-slate-200`,children:o.name}),o.description&&(0,_.jsx)(`p`,{className:`text-sm text-slate-400 mt-1`,children:o.description})]})})}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,_.jsx)(y,{icon:a,label:`Progress`,value:`${o.currentValue} / ${o.targetValue}`}),(0,_.jsx)(y,{icon:r,label:w?`Overdue`:`Deadline`,value:h(o.deadline),mono:!0}),(0,_.jsx)(y,{icon:n,label:`Budget`,value:`$${o.budgetUsd.toFixed(2)}`}),(0,_.jsx)(y,{icon:i,label:`Created`,value:h(o.createdAt),mono:!0})]}),(0,_.jsxs)(m,{children:[(0,_.jsx)(f,{children:(0,_.jsx)(p,{children:`Progress`})}),(0,_.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,_.jsx)(`div`,{className:`flex-1 h-3 rounded-full bg-slate-700 overflow-hidden`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full transition-all ${w?`bg-red-500`:`bg-blue-500`}`,style:{width:`${C}%`}})}),(0,_.jsxs)(`span`,{className:`text-sm text-slate-300 font-mono`,children:[C.toFixed(1),`%`]})]}),(0,_.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-slate-500`,children:[(0,_.jsxs)(`span`,{children:[o.currentValue,` current`]}),(0,_.jsxs)(`span`,{children:[o.targetValue,` target`]})]})]}),(o.deliverTo??[]).length>0&&(0,_.jsxs)(m,{children:[(0,_.jsx)(f,{children:(0,_.jsx)(p,{children:`Delivery Targets`})}),(0,_.jsx)(`div`,{className:`space-y-1.5`,children:(o.deliverTo??[]).map((e,t)=>(0,_.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-slate-300`,children:e.type===`channel`?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(d,{variant:`outline`,children:`Channel`}),(0,_.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,_.jsxs)(`span`,{className:`text-xs text-slate-500`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(d,{variant:`outline`,children:`Session`}),(0,_.jsx)(`span`,{className:`text-xs text-slate-400`,children:`Chat session`})]})},t))})]}),v.length>0&&(0,_.jsxs)(m,{children:[(0,_.jsx)(f,{children:(0,_.jsxs)(p,{className:`flex items-center gap-2`,children:[(0,_.jsx)(i,{size:14}),` Strategies (`,v.length,`)`]})}),(0,_.jsx)(`div`,{className:`space-y-2`,children:v.map(e=>(0,_.jsxs)(`div`,{className:`flex items-center justify-between text-sm border-b border-slate-800 pb-2`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`span`,{className:`text-slate-200`,children:e.name}),(0,_.jsx)(`span`,{className:`text-xs text-slate-500 ml-2`,children:e.taskType})]}),(0,_.jsxs)(d,{variant:`outline`,children:[e.trialCount,` trials`]})]},e.id))})]})]})}function y({icon:e,label:t,value:n,mono:r}){return(0,_.jsxs)(m,{className:`flex flex-col gap-1`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-1.5 text-slate-500`,children:[(0,_.jsx)(e,{size:12}),(0,_.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,_.jsx)(`span`,{className:`text-sm text-slate-200 truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{v as GoalDetail};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{C as t,S as n,c as r,h as i,nt as a,o,t as s,v as c,x as l}from"./vendor-icons-CkI4-NxL.js";import{t as u}from"./vendor-react-DLRtONKt.js";import{r as d}from"./dist-HyCSN_hp.js";import{C as f,a as p,c as m,d as h,f as g,i as _,l as v,n as ee,o as y,r as b,s as te,t as x,u as ne,w as S}from"./index-CaHdOfAc.js";import{n as C,r as w,t as T}from"./Card-4mOZntHG.js";import{n as E,t as D}from"./format-DvtQjPZn.js";import{t as O}from"./EmptyState-BlgMMAr-.js";var k=e(a(),1),A=u();function j({value:e,onChange:t,label:n=`Delivery Targets`}){let[r,i]=(0,k.useState)([]),[a,o]=(0,k.useState)(!1);(0,k.useEffect)(()=>{let e=!1;return Promise.all([d(`/channels`).catch(()=>({channels:[]})),d(`/chat/sessions`).catch(()=>({sessions:[]}))]).then(([t,n])=>{if(e)return;let r=new Map(t.channels.map(e=>[e.id,e])),a=[];for(let e of n.sessions)if(e.source.type===`channel`&&e.source.channelId&&e.source.chatId){let t=r.get(e.source.channelId);a.push({id:e.id,channelId:e.source.channelId,channelName:t?.name??e.source.channelId.slice(0,8),platform:t?.platform??`unknown`,chatId:e.source.chatId})}let o=new Set;i(a.filter(e=>{let t=`${e.channelId}:${e.chatId}`;return o.has(t)?!1:(o.add(t),!0)}))}),()=>{e=!0}},[]);let s=(t,n)=>e.some(e=>e.type===`channel`&&e.channelId===t&&e.chatId===n),c=(n,r)=>{s(n,r)?t(e.filter(e=>!(e.type===`channel`&&e.channelId===n&&e.chatId===r))):t([...e,{type:`channel`,channelId:n,chatId:r}])},l=e.filter(e=>e.type===`channel`).length;return(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`label`,{className:`text-xs text-slate-400`,children:n}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!a),className:`mt-1 w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-left text-sm text-slate-200 hover:border-slate-600 focus:border-blue-500 focus:outline-none`,children:l===0?`Default (current session)`:`${l} channel${l>1?`s`:``} selected`}),a&&(0,A.jsxs)(`div`,{className:`absolute z-10 mt-1 w-full rounded-md border border-slate-700 bg-slate-800 py-1 shadow-lg`,children:[r.length===0?(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-slate-500`,children:`No active channel conversations. Start a chat on WeChat/Telegram first.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`px-3 py-1 text-xs text-slate-500`,children:`Channel conversations`}),r.map(e=>(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 px-3 py-1.5 text-xs text-slate-300 hover:bg-slate-700`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:s(e.channelId,e.chatId),onChange:()=>c(e.channelId,e.chatId),className:`rounded border-slate-600 bg-slate-700`}),(0,A.jsx)(`span`,{className:`truncate font-medium`,children:e.channelName}),(0,A.jsxs)(`span`,{className:`text-slate-500`,children:[`(`,e.platform,`)`]})]},`${e.channelId}:${e.chatId}`))]}),l>0&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>{t([]),o(!1)},className:`mt-1 w-full border-t border-slate-700 px-3 py-1 text-left text-xs text-red-400 hover:bg-slate-700`,children:`Clear all`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`w-full border-t border-slate-700 px-3 py-1 text-left text-xs text-slate-500 hover:bg-slate-700`,children:`Done`})]})]})}var M={active:`paused`,paused:`active`,completed:`active`,failed:`active`},N={active:(0,A.jsx)(t,{size:12}),paused:(0,A.jsx)(l,{size:12}),completed:(0,A.jsx)(i,{size:12}),failed:(0,A.jsx)(i,{size:12})};function P(){let e=f(e=>e.goals),t=f(e=>e.fetchGoals),a=f(e=>e.updateGoal),u=f(e=>e.deleteGoal),[P,F]=(0,k.useState)(!1),[I,L]=(0,k.useState)(``),[R,z]=(0,k.useState)(!1),[B,V]=(0,k.useState)(null),[H,U]=(0,k.useState)(null),[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)(``),[J,Y]=(0,k.useState)([]),[X,Z]=(0,k.useState)([]),[Q,re]=(0,k.useState)([]),[$,ie]=(0,k.useState)([]);(0,k.useEffect)(()=>{t();let e=setInterval(()=>void t(),1e4);return()=>clearInterval(e)},[t]);let ae=async()=>{if(I.trim()){z(!0),V(null);try{await d(`/goals`,{method:`POST`,body:JSON.stringify({input:I.trim(),deliverTo:Q.length>0?Q:void 0,reportTo:$.length>0?$:void 0})}),L(``),F(!1),t()}catch(e){V(e instanceof Error?e.message:`Failed to create goal`)}finally{z(!1)}}};return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Goals`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(g,{variant:`ghost`,size:`sm`,onClick:()=>void t(),children:(0,A.jsx)(i,{size:14})}),(0,A.jsxs)(g,{size:`sm`,onClick:()=>F(!P),children:[(0,A.jsx)(c,{size:14}),`New Goal`]})]})]}),P&&(0,A.jsxs)(T,{className:`space-y-3`,children:[(0,A.jsx)(`textarea`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-2 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Describe your goal in natural language...`,rows:3,value:I,onChange:e=>L(e.target.value)}),(0,A.jsx)(j,{value:Q,onChange:re,label:`Deliver To (results)`}),(0,A.jsx)(j,{value:$,onChange:ie,label:`Report To (status)`}),B&&(0,A.jsx)(`p`,{className:`text-xs text-red-400`,children:B}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(g,{onClick:()=>void ae(),disabled:R||!I.trim(),children:R?`Creating...`:`Create`}),(0,A.jsx)(g,{variant:`ghost`,onClick:()=>F(!1),children:`Cancel`})]})]}),e.length===0?(0,A.jsx)(O,{icon:(0,A.jsx)(r,{size:32}),title:`No goals`,description:`Create a goal to start goal-driven task orchestration`}):(0,A.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>{let t=e.targetValue>0?Math.min(100,Math.round(e.currentValue/e.targetValue*100)):0,r=new Date(e.deadline).getTime()<Date.now()&&e.status!==`completed`,i=H===e.id;return(0,A.jsxs)(T,{children:[(0,A.jsxs)(C,{children:[i?(0,A.jsx)(`input`,{className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-2 py-1 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:W,onChange:e=>G(e.target.value),autoFocus:!0}):(0,A.jsx)(w,{className:`text-slate-200 text-sm font-medium truncate max-w-[180px]`,children:e.name}),(0,A.jsx)(x,{variant:ee(e.status),children:e.status})]}),i?(0,A.jsx)(`textarea`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-2 py-1 text-xs text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none mb-3`,placeholder:`Description...`,rows:2,value:K,onChange:e=>q(e.target.value)}):e.description?(0,A.jsx)(`p`,{className:`text-xs text-slate-400 mb-3 line-clamp-2`,children:e.description}):null,i&&(0,A.jsxs)(`div`,{className:`mb-3 space-y-2`,children:[(0,A.jsx)(j,{value:J,onChange:Y,label:`Deliver To (results)`}),(0,A.jsx)(j,{value:X,onChange:Z,label:`Report To (status)`})]}),(0,A.jsxs)(`div`,{className:`mb-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,A.jsx)(`span`,{className:`text-xs text-slate-500`,children:`Progress`}),(0,A.jsxs)(`span`,{className:`font-mono text-xs text-slate-300`,children:[t,`%`]})]}),(0,A.jsx)(`div`,{className:`h-1.5 rounded-full bg-slate-800`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full transition-all ${t>=100?`bg-emerald-500`:`bg-blue-500`}`,style:{width:`${t}%`}})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-slate-500`,children:[e.currentValue,` / `,e.targetValue]}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] text-slate-500`,children:e.metricType})]})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-slate-500`,children:`Role`}),(0,A.jsx)(x,{variant:`muted`,className:`text-[10px]`,children:e.roleId})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-slate-500`,children:`Budget`}),(0,A.jsx)(`span`,{className:`font-mono text-slate-300`,children:D(e.budgetUsd)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-slate-500 ${r?`text-red-400`:``}`,children:`Deadline`}),(0,A.jsx)(`span`,{className:`text-slate-300 ${r?`text-red-400`:``}`,children:E(e.deadline)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-slate-500`,children:`Created`}),(0,A.jsx)(`span`,{className:`text-slate-400`,children:E(e.createdAt)})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 mt-3 pt-3 border-t border-slate-800`,children:i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(g,{size:`sm`,variant:`ghost`,onClick:async()=>{try{await a(e.id,{name:W,description:K,deliverTo:J,reportTo:X}),U(null),S.success(`Goal updated`)}catch(e){S.error(e instanceof Error?e.message:`Failed to update`)}},children:`Save`}),(0,A.jsx)(g,{size:`sm`,variant:`ghost`,onClick:()=>U(null),children:(0,A.jsx)(s,{size:14})})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(g,{size:`sm`,variant:`ghost`,title:`Edit`,onClick:()=>{U(e.id),G(e.name),q(e.description??``),Y(e.deliverTo??[]),Z(e.reportTo??[])},children:(0,A.jsx)(n,{size:14})}),(0,A.jsxs)(g,{size:`sm`,variant:`ghost`,title:`Change to ${M[e.status]}`,onClick:async()=>{try{await a(e.id,{status:M[e.status]}),S.success(`Status changed to ${M[e.status]}`)}catch(e){S.error(e instanceof Error?e.message:`Failed to update status`)}},children:[N[e.status]??(0,A.jsx)(l,{size:12}),(0,A.jsx)(`span`,{className:`ml-1 text-xs`,children:M[e.status]})]}),(0,A.jsx)(`div`,{className:`ml-auto`,children:(0,A.jsxs)(b,{children:[(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(g,{size:`sm`,variant:`ghost`,title:`Delete`,className:`text-red-400 hover:text-red-300`,children:(0,A.jsx)(o,{size:14})})}),(0,A.jsxs)(y,{children:[(0,A.jsxs)(v,{children:[(0,A.jsx)(ne,{children:`Delete goal`}),(0,A.jsxs)(te,{children:[`This will permanently delete "`,e.name,`". This action cannot be undone.`]})]}),(0,A.jsxs)(m,{children:[(0,A.jsx)(p,{children:`Cancel`}),(0,A.jsx)(_,{className:`bg-red-600 hover:bg-red-700`,onClick:async()=>{try{await u(e.id),S.success(`Goal deleted`)}catch(e){S.error(e instanceof Error?e.message:`Failed to delete`)}},children:`Delete`})]})]})]})})]})})]},e.id)})})]})}export{P as Goals,j as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{C as t,nt as n,o as r,s as i,x as a}from"./vendor-icons-CkI4-NxL.js";import{t as o}from"./vendor-react-DLRtONKt.js";import{C as s,f as c}from"./index-CaHdOfAc.js";import{t as l}from"./Card-4mOZntHG.js";import{t as u}from"./EmptyState-BlgMMAr-.js";var d=e(n(),1),f=o(),p={debug:`text-slate-500`,info:`text-blue-400`,warn:`text-amber-400`,error:`text-red-400`},m={adam:`text-purple-400`,manager:`text-cyan-400`,worker:`text-green-400`,scheduler:`text-orange-400`,api:`text-blue-400`,ws:`text-teal-400`,store:`text-yellow-400`,embedding:`text-pink-400`},h=[`adam`,`manager`,`worker`,`scheduler`,`api`,`ws`,`store`,`embedding`],g=[`debug`,`info`,`warn`,`error`];function _(){let e=s(e=>e.logs),n=(0,d.useRef)(null),[o,_]=(0,d.useState)(!0),[y,b]=(0,d.useState)(null),[x,S]=(0,d.useState)(null),C=(0,d.useMemo)(()=>e.filter(e=>!(y&&e.level!==y||x&&e.component!==x)),[e,y,x]);return(0,d.useEffect)(()=>{o&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[C,o]),(0,f.jsxs)(`div`,{className:`flex h-full flex-col gap-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Logs`}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>_(!o),title:o?`Pause auto-scroll`:`Resume auto-scroll`,children:o?(0,f.jsx)(t,{size:14}):(0,f.jsx)(a,{size:14})}),(0,f.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>{s.setState({logs:[]})},title:`Clear logs`,children:(0,f.jsx)(r,{size:14})})]})]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(`span`,{className:`text-xs text-slate-500`,children:`Level:`}),(0,f.jsxs)(`div`,{className:`flex gap-1`,children:[(0,f.jsx)(v,{active:y===null,onClick:()=>b(null),children:`All`}),g.map(e=>(0,f.jsx)(v,{active:y===e,onClick:()=>b(y===e?null:e),children:e},e))]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(`span`,{className:`text-xs text-slate-500`,children:`Component:`}),(0,f.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,f.jsx)(v,{active:x===null,onClick:()=>S(null),children:`All`}),h.map(e=>(0,f.jsx)(v,{active:x===e,onClick:()=>S(x===e?null:e),children:e},e))]})]})]}),(0,f.jsx)(l,{padding:!1,className:`flex-1 min-h-0`,children:C.length===0?(0,f.jsx)(u,{icon:(0,f.jsx)(i,{size:32}),title:`No log entries`,description:`Log events will appear here in real-time via WebSocket`}):(0,f.jsx)(`div`,{ref:n,className:`h-full max-h-[calc(100vh-280px)] overflow-y-auto p-3 font-mono text-xs leading-5`,children:C.map((e,t)=>{let n=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3}),r=p[e.level]??`text-slate-400`,i=m[e.component]??`text-slate-400`;return(0,f.jsxs)(`div`,{className:`flex gap-2 hover:bg-slate-800/30 px-1 rounded`,children:[(0,f.jsx)(`span`,{className:`text-slate-600 shrink-0`,children:n}),(0,f.jsx)(`span`,{className:`w-12 shrink-0 uppercase ${r}`,children:e.level.padEnd(5)}),(0,f.jsxs)(`span`,{className:`w-20 shrink-0 ${i}`,children:[`[`,e.component,`]`]}),(0,f.jsx)(`span`,{className:`text-slate-300 break-all`,children:e.msg})]},t)})})}),(0,f.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-slate-500`,children:[(0,f.jsxs)(`span`,{children:[C.length,` entries `,C.length!==e.length&&`(${e.length} total)`]}),(0,f.jsx)(`span`,{children:o?`Auto-scrolling`:`Paused`})]})]})}function v({active:e,onClick:t,children:n}){return(0,f.jsx)(`button`,{onClick:t,className:`rounded px-2 py-0.5 text-xs transition-colors ${e?`bg-slate-700 text-slate-200`:`text-slate-500 hover:text-slate-300`}`,children:n})}export{_ as Logs};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Q as t,f as n,h as r,nt as i}from"./vendor-icons-CkI4-NxL.js";import{t as a}from"./vendor-react-DLRtONKt.js";import{r as o}from"./dist-HyCSN_hp.js";import{C as s,f as c,t as l}from"./index-CaHdOfAc.js";import{t as u}from"./Card-4mOZntHG.js";import{a as d}from"./format-DvtQjPZn.js";import{t as f}from"./EmptyState-BlgMMAr-.js";var p=e(i(),1),m=a();function h(){let e=s(e=>e.roles),i=s(e=>e.fetchRoles),[a,h]=(0,p.useState)(``),[g,_]=(0,p.useState)([]),[v,y]=(0,p.useState)(!1),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(`all`),[E,D]=(0,p.useState)(new Set);(0,p.useEffect)(()=>{i()},[i]),(0,p.useEffect)(()=>{!a&&e.length>0&&h(e[0].id)},[e,a]);let O=(0,p.useCallback)(async()=>{if(a){y(!0);try{_((await o(`/memories/${a}?limit=100`)).memories)}catch{_([])}finally{y(!1)}}},[a]);(0,p.useEffect)(()=>{a&&O()},[a,O]);let k=async()=>{if(!(!b.trim()||!a)){C(!0);try{_((await o(`/memories/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agentId:a,prompt:b.trim(),topK:20})})).memories)}catch{_([])}finally{C(!1)}}},A=()=>{x(``),O()},j=g.filter(e=>w===`high`?e.importance>3:w===`medium`?e.importance===3:w===`low`?e.importance<3:!0),M=e=>e>=4?`text-red-400`:e===3?`text-yellow-400`:`text-slate-500`;return(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Memories`}),(0,m.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>void O(),children:(0,m.jsx)(r,{size:14})})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`select`,{className:`rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:a,onChange:e=>h(e.target.value),children:e.map(e=>(0,m.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`input`,{className:`w-64 rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 placeholder-slate-600 focus:border-blue-500 focus:outline-none`,value:b,onChange:e=>x(e.target.value),onKeyDown:e=>e.key===`Enter`&&void k(),placeholder:`Search memories...`}),(0,m.jsx)(c,{size:`sm`,variant:`ghost`,onClick:()=>void k(),disabled:S,children:(0,m.jsx)(n,{size:14})}),b&&(0,m.jsx)(c,{size:`sm`,variant:`ghost`,onClick:A,children:`Clear`})]}),(0,m.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`high`,`medium`,`low`].map(e=>(0,m.jsx)(`button`,{className:`rounded px-2 py-1 text-xs transition-colors ${w===e?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:bg-slate-700`}`,onClick:()=>T(e),children:e},e))})]}),(0,m.jsx)(u,{children:v||S?(0,m.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,m.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-slate-700 border-t-blue-500`})}):j.length===0?(0,m.jsx)(f,{icon:(0,m.jsx)(t,{size:32}),title:`No memories`,description:b?`No results for this query`:`This agent has no memories yet`}):(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`p`,{className:`text-xs text-slate-500`,children:[j.length,` memories`]}),j.map(e=>(0,m.jsxs)(`div`,{className:`rounded border border-slate-800 p-3`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,m.jsx)(l,{variant:e.type===`reflection`?`info`:e.type===`thought`?`warning`:`muted`,children:e.type}),(0,m.jsx)(l,{variant:`muted`,children:e.sourceType}),(0,m.jsx)(`span`,{className:`text-xs font-medium ${M(e.importance)}`,children:`*`.repeat(e.importance)}),e.score!=null&&(0,m.jsxs)(`span`,{className:`text-[10px] text-slate-600`,children:[`score: `,e.score.toFixed(3)]})]}),(0,m.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-slate-300`,children:e.content}),(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:e.keywords.map(e=>(0,m.jsx)(`span`,{className:`rounded bg-slate-800 px-1.5 py-0.5 text-[10px] text-slate-500`,children:e},e))}),e.type===`reflection`&&e.evidence&&e.evidence.length>0&&(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsxs)(`button`,{className:`text-[10px] text-blue-400 hover:text-blue-300`,onClick:()=>D(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[E.has(e.id)?`Hide`:`Show`,` evidence (`,e.evidence.length,` memories)`]}),E.has(e.id)&&(0,m.jsx)(`div`,{className:`mt-1.5 space-y-1 border-l-2 border-slate-800 pl-2`,children:e.evidence.map(e=>{let t=g.find(t=>t.id===e);return(0,m.jsx)(`div`,{className:`text-xs text-slate-500`,children:t?t.content.slice(0,120)+(t.content.length>120?`...`:``):(0,m.jsxs)(`span`,{className:`italic`,children:[`Memory `,e.slice(0,8),` (not in current view)`]})},e)})})]}),(0,m.jsxs)(`p`,{className:`mt-1.5 text-[10px] text-slate-600`,children:[d(e.createdAt),` | accessed `,e.retrievedCount,`x | last: `,d(e.lastAccessed)]})]},e.id))]})})]})}export{h as Memories};
@@ -1 +0,0 @@
1
- import"./vendor-icons-CkI4-NxL.js";import{r as e,t}from"./vendor-react-DLRtONKt.js";var n=t();function r(){return(0,n.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 text-slate-400`,children:[(0,n.jsx)(`span`,{className:`text-6xl font-bold text-slate-600`,children:`404`}),(0,n.jsx)(`p`,{className:`text-lg`,children:`Page not found`}),(0,n.jsx)(e,{to:`/`,className:`text-blue-400 hover:text-blue-300 underline`,children:`Back to Dashboard`})]})}export{r as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{J as t,O as n,P as r,Y as i,Z as a,_ as o,f as s,h as c,l as ee,nt as l,o as u,t as te,v as ne,z as re}from"./vendor-icons-CkI4-NxL.js";import{t as d}from"./vendor-react-DLRtONKt.js";import{r as f}from"./dist-HyCSN_hp.js";import{f as p,t as m,w as h}from"./index-CaHdOfAc.js";import{t as g}from"./Card-4mOZntHG.js";import{a as ie}from"./format-DvtQjPZn.js";import{t as ae}from"./EmptyState-BlgMMAr-.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-BxbnOSbq.js";var C=e(l(),1),w=d();function oe({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 T(){let[e,l]=(0,C.useState)([]),[d,T]=(0,C.useState)([]),[E,se]=(0,C.useState)([]),[ce,le]=(0,C.useState)(new Set),[D,O]=(0,C.useState)(!0),[k,A]=(0,C.useState)(!1),[j,M]=(0,C.useState)(null),[N,ue]=(0,C.useState)(!1),[P,F]=(0,C.useState)(``),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(``),[H,de]=(0,C.useState)([]),[U,fe]=(0,C.useState)(!1),[pe,me]=(0,C.useState)(new Set),[W,G]=(0,C.useState)(`all`),[K,he]=(0,C.useState)([]),q=(0,C.useCallback)(async()=>{O(!0);try{l((await f(`/plugins`)).plugins)}catch(e){h.error(e instanceof Error?e.message:`Failed to load plugins`)}finally{O(!1)}},[]),J=(0,C.useCallback)(async()=>{A(!0),M(null);try{let[e,t]=await Promise.all([f(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),f(`/plugins/marketplaces`)]);se(e.available),le(new Set(e.installed.map(e=>e.id))),T(t.sources)}catch(e){M(e instanceof Error?e.message:`Failed to load marketplace`)}finally{A(!1)}},[]),ge=(0,C.useCallback)(async()=>{try{de((await f(`/plugins/stats?limit=20`)).stats)}catch{}},[]),Y=(0,C.useCallback)(async()=>{try{he((await f(`/roles`)).roles)}catch{}},[]);(0,C.useEffect)(()=>{q(),J(),Y()},[q,J,Y]);let _e=async(e,t)=>{L(e);try{await f(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),h.success(`${e} ${t?`enabled`:`disabled`} globally`),l(n=>n.map(n=>n.id===e?{...n,globalEnabled:t}:n))}catch(e){h.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{L(null)}},ve=async e=>{L(e);try{await f(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),h.success(`Plugin uninstalled`),await Promise.all([q(),J()])}catch(e){h.error(e instanceof Error?e.message:`Uninstall failed`)}finally{L(null)}},ye=async(e,t,n)=>{L(e);try{await f(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:`project`,cwd:n})});let r=K.find(e=>e.id===t)?.name??t;h.success(`Installed ${e.split(`@`)[0]} for ${r}`),await q()}catch(e){h.error(e instanceof Error?e.message:`Install to role failed`)}finally{L(null)}},X=async()=>{if(B.trim())try{await f(`/plugins/install/${encodeURIComponent(B.trim())}`,{method:`POST`,body:JSON.stringify({})}),h.success(`Source added`),V(``),z(!1),await J()}catch(e){h.error(e instanceof Error?e.message:`Failed to add source`)}},Z=async(e,t=`user`,n)=>{L(e);try{await f(`/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];h.success(`Installed ${r}`),await Promise.all([q(),J()])}catch(e){h.error(e instanceof Error?e.message:`Install failed`)}finally{L(null)}},be=e=>{me(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=W===`all`?e:e.filter(e=>e.scope===W),$=P?E.filter(e=>e.name.toLowerCase().includes(P.toLowerCase())||e.description.toLowerCase().includes(P.toLowerCase())):E;return(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Plugins`}),(0,w.jsx)(p,{variant:`ghost`,size:`sm`,onClick:()=>void q(),children:(0,w.jsx)(c,{size:14})})]}),(0,w.jsxs)(g,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(r,{size:14,className:`text-slate-400 flex-shrink-0`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${W===`all`?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:bg-slate-700`}`,onClick:()=>G(`all`),children:`All`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${W===`user`?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:bg-slate-700`}`,onClick:()=>G(`user`),children:`User`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${W===`project`?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:bg-slate-700`}`,onClick:()=>G(`project`),children:`Project`}),(0,w.jsx)(`span`,{className:`h-4 w-px bg-slate-700 mx-1`}),d.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:[k&&(0,w.jsx)(n,{size:12,className:`animate-spin text-slate-500`}),k?null:(0,w.jsx)(p,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>z(!R),children:R?(0,w.jsx)(te,{size:12}):(0,w.jsx)(ne,{size:12})})]})]}),R&&(0,w.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:B,onChange:e=>V(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&X()}}),(0,w.jsx)(p,{size:`sm`,onClick:()=>void X(),disabled:!B.trim(),children:`Add`})]})]}),D?(0,w.jsx)(g,{children:(0,w.jsx)(`div`,{className:`py-8 text-center text-sm text-slate-500`,children:`Loading...`})}):Q.length===0?(0,w.jsx)(g,{children:(0,w.jsx)(ae,{icon:(0,w.jsx)(o,{size:32}),title:`No plugins`,description:W===`all`?`No plugins installed. Browse the marketplace or install from a URL.`:`No ${W}-scope plugins installed.`})}):(0,w.jsx)(g,{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,r)=>{let a=pe.has(e.id),o=e.id.split(`@`)[0],s=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${r}`;return(0,w.jsxs)(C.Fragment,{children:[(0,w.jsxs)(b,{className:`group`,children:[(0,w.jsx)(x,{children:(0,w.jsx)(`button`,{onClick:()=>be(e.id),className:`text-slate-500 hover:text-slate-300`,children:a?(0,w.jsx)(i,{size:12}):(0,w.jsx)(t,{size:12})})}),(0,w.jsx)(x,{className:`font-medium text-slate-200`,children:o}),(0,w.jsx)(x,{className:`text-xs text-slate-400`,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-slate-600 truncate max-w-[120px]`,title:e.projectPath,children:e.projectPath.split(`/`).pop()})]}),(0,w.jsx)(x,{children:(0,w.jsx)(oe,{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)(p,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs`,disabled:s,onClick:()=>void _e(e.id,!e.globalEnabled),children:s?(0,w.jsx)(n,{size:10,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(p,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs text-red-400`,disabled:s,onClick:()=>void ve(e.id),children:(0,w.jsx)(u,{size:10})})]})})]}),a&&(0,w.jsx)(b,{className:`bg-slate-900/50`,children:(0,w.jsx)(x,{colSpan:7,className:`px-6 py-3`,children:e.manifest?(0,w.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[e.manifest.description&&(0,w.jsx)(`p`,{className:`text-slate-400`,children:e.manifest.description}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[e.manifest.skills.length>0&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`mb-1 font-semibold text-slate-300`,children:`Skills`}),e.manifest.skills.map(e=>(0,w.jsxs)(`div`,{className:`text-slate-400`,children:[(0,w.jsx)(`span`,{className:`text-slate-200`,children:e.name}),e.description&&(0,w.jsxs)(`span`,{className:`ml-1 text-slate-500`,children:[`— `,e.description]})]},e.name))]}),e.manifest.agents.length>0&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`mb-1 font-semibold text-slate-300`,children:`Agents`}),e.manifest.agents.map(e=>(0,w.jsxs)(`div`,{className:`text-slate-400`,children:[(0,w.jsx)(`span`,{className:`text-slate-200`,children:e.name}),e.description&&(0,w.jsxs)(`span`,{className:`ml-1 text-slate-500`,children:[`— `,e.description]})]},e.name))]}),e.manifest.mcpServers.length>0&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`mb-1 font-semibold text-slate-300`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,w.jsx)(`div`,{className:`text-slate-400`,children:e},e))]}),e.manifest.hooks.length>0&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`mb-1 font-semibold text-slate-300`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,w.jsx)(`div`,{className:`text-slate-400`,children:e},e))]})]}),(0,w.jsx)(`div`,{className:`text-slate-600 font-mono truncate mt-1`,title:e.installPath,children:e.installPath}),K.length>0&&e.scope===`user`&&(0,w.jsxs)(`div`,{className:`mt-3 pt-2 border-t border-slate-800`,children:[(0,w.jsx)(`span`,{className:`text-slate-400 mr-2`,children:`Install to Role:`}),K.map(t=>(0,w.jsx)(p,{variant:`ghost`,size:`sm`,className:`h-5 px-2 text-[10px] mr-1`,disabled:I===e.id,onClick:()=>void ye(e.id,t.id,t.workspacePath),children:t.name},t.id))]})]}):(0,w.jsx)(`p`,{className:`text-xs text-slate-500`,children:`Loading manifest...`})})},`${e.id}-detail`)]},c)})})]})}),(0,w.jsxs)(g,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-slate-300`,onClick:()=>ue(!N),children:[(0,w.jsx)(ee,{size:14,className:`text-slate-400`}),`Marketplace (`,E.length,`)`,N?(0,w.jsx)(i,{size:12,className:`ml-auto`}):(0,w.jsx)(t,{size:12,className:`ml-auto`})]}),N&&(0,w.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(s,{size:14,className:`absolute left-2.5 top-2 text-slate-500`}),(0,w.jsx)(`input`,{className:`w-full rounded border border-slate-700 bg-slate-900 pl-8 pr-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-600 focus:border-blue-500 focus:outline-none`,value:P,onChange:e=>F(e.target.value),placeholder:`Search available plugins...`})]}),k?(0,w.jsx)(`p`,{className:`text-xs text-slate-500 text-center py-2`,children:`Loading marketplace...`}):j?(0,w.jsx)(`p`,{className:`text-xs text-red-400 text-center py-2`,children:j}):$.length===0?(0,w.jsx)(`p`,{className:`text-xs text-slate-500 text-center py-2`,children:P?`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=ce.has(e.pluginId),r=I===e.pluginId;return(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-slate-200 text-xs`,children:e.name}),(0,w.jsx)(x,{className:`text-xs text-slate-400 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)(p,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:()=>void Z(e.pluginId),children:r?(0,w.jsx)(n,{size:10,className:`animate-spin`}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(re,{size:10,className:`mr-1`}),` Install`]})}),K.length>0&&(0,w.jsxs)(`div`,{className:`relative group/install`,children:[(0,w.jsx)(p,{variant:`ghost`,size:`sm`,className:`h-6 px-1 text-xs text-slate-500`,children:(0,w.jsx)(i,{size:10})}),(0,w.jsx)(`div`,{className:`absolute right-0 top-full mt-1 z-10 hidden group-hover/install:block bg-slate-800 border border-slate-700 rounded shadow-lg py-1 min-w-[140px]`,children:K.map(t=>(0,w.jsx)(`button`,{className:`block w-full text-left px-3 py-1 text-xs text-slate-300 hover:bg-slate-700`,disabled:r,onClick:()=>void Z(e.pluginId,`project`,t.workspacePath),children:t.name},t.id))})]})]})})]},e.pluginId)})})]})]})]}),(0,w.jsxs)(g,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-slate-300`,onClick:()=>{!U&&H.length===0&&ge(),fe(!U)},children:[(0,w.jsx)(a,{size:14,className:`text-slate-400`}),`Usage Stats`,U?(0,w.jsx)(i,{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-slate-500 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-slate-200 text-xs`,children:e.pluginName}),(0,w.jsx)(x,{className:`font-mono text-xs text-slate-400`,children:e.usageCount}),(0,w.jsx)(x,{className:`text-xs text-slate-400`,children:e.lastUsed?ie(e.lastUsed):`—`})]},e.pluginPath))})]})})]})]})}export{T as Plugins};