adam-agent-server 1.13.0 → 1.15.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.
- package/README.md +4 -5
- package/dist/App-6TRGTNZ7.js +13 -0
- package/dist/approval-handler-YLO3V75T.js +1 -0
- package/dist/audit-diagnostics-MASYIEGZ.js +1 -0
- package/dist/audit-manager-LYBXP7U4.js +1 -0
- package/dist/bree-engine-AA7EVKTG.js +1 -0
- package/dist/{channels-WFC26TED.js → channels-2IL6USWL.js} +1 -1
- package/dist/channels-6BEGHNOK.js +1 -0
- package/dist/chat-tool-calls-KARPW7PE.js +1 -0
- package/dist/chunk-245WE5AF.js +1 -0
- package/dist/chunk-2N4EOZZ4.js +9 -0
- package/dist/chunk-3BRHWRZ5.js +2 -0
- package/dist/chunk-3KNR2F6H.js +3 -0
- package/dist/chunk-42V6ZPCS.js +5 -0
- package/dist/chunk-6NWIZ3BH.js +220 -0
- package/dist/chunk-APAOIZN4.js +114 -0
- package/dist/chunk-ASPPM7TQ.js +1 -0
- package/dist/chunk-BKNXRSJU.js +4 -0
- package/dist/{chunk-MRTJFYPR.js → chunk-BLCNUT53.js} +1 -1
- package/dist/chunk-BPXS4QEO.js +1006 -0
- package/dist/chunk-CLNYHWZ6.js +5 -0
- package/dist/chunk-D3SPXZZY.js +6 -0
- package/dist/{chunk-SWP2JC54.js → chunk-DRO3DG7X.js} +1 -1
- package/dist/chunk-EVUZ5LH2.js +1 -0
- package/dist/chunk-F6U5TMM3.js +5 -0
- package/dist/chunk-FD4IKMXV.js +1 -0
- package/dist/chunk-GXWB47NF.js +9 -0
- package/dist/{chunk-PXGK5H5C.js → chunk-I7LJ4432.js} +1 -1
- package/dist/chunk-ICAM2GUU.js +1 -0
- package/dist/{chunk-B44X7JAJ.js → chunk-IRUR4DVD.js} +1 -1
- package/dist/chunk-ISKCTUI7.js +9 -0
- package/dist/{chunk-7T4B2MZ7.js → chunk-J3VYLSJI.js} +1 -1
- package/dist/chunk-KJNAORKM.js +15 -0
- package/dist/chunk-L47LZYVG.js +21 -0
- package/dist/chunk-LU3D53ZV.js +34 -0
- package/dist/{chunk-YKYRNTPV.js → chunk-N2OLEUAQ.js} +1 -1
- package/dist/{chunk-PHT24MOV.js → chunk-NLTYJUQG.js} +1 -1
- package/dist/chunk-NNMQGISW.js +1 -0
- package/dist/chunk-NPGZRSGL.js +5 -0
- package/dist/chunk-NTVLV7NI.js +1 -0
- package/dist/chunk-NUJSTEV4.js +1 -0
- package/dist/{chunk-FUWPDXXG.js → chunk-NWGRLNUM.js} +1 -1
- package/dist/chunk-OQ3JOTPK.js +1 -0
- package/dist/chunk-RBJPQYV3.js +6 -0
- package/dist/chunk-SVUP3F4V.js +14 -0
- package/dist/chunk-TLMG5W3L.js +4 -0
- package/dist/chunk-TLP4ZMJB.js +19 -0
- package/dist/{chunk-WQFNB2MQ.js → chunk-TZCMK3UG.js} +6 -6
- package/dist/chunk-UFWMUBFH.js +25 -0
- package/dist/chunk-VKKDSXMR.js +1 -0
- package/dist/chunk-VNXTBIPI.js +31 -0
- package/dist/chunk-XF7YHFVR.js +15 -0
- package/dist/{chunk-X5V4VMET.js → chunk-XIVFVKMB.js} +2 -2
- package/dist/chunk-XYZVMTNN.js +1 -0
- package/dist/{chunk-Q2JQFDAK.js → chunk-XZEBYOFR.js} +3 -3
- package/dist/chunk-Z6LHGA27.js +1 -0
- package/dist/cli.js +10 -10
- package/dist/config-VHWLMFIN.js +1 -0
- package/dist/{config-GKVOAMY2.js → config-XO7TGH27.js} +1 -1
- package/dist/db-WCTOLFAZ.js +1 -0
- package/dist/delivery-log-ML4RJOBM.js +1 -0
- package/dist/dist-HCSYRPJU.js +1 -0
- package/dist/engine-XLH4VL6Y.js +1 -0
- package/dist/evolution-audit-HLU7LQL6.js +1 -0
- package/dist/execution-tools-SYP3GR6T.js +1 -0
- package/dist/{external-api-DOVGA3ML.js → external-api-YMEFVZGG.js} +1 -1
- package/dist/index.js +240 -36
- package/dist/learner-NJXX2RUL.js +1 -0
- package/dist/{logger-WEXZORHP.js → logger-PAMNFWI3.js} +1 -1
- package/dist/memories-JDTQM3UN.js +1 -0
- package/dist/memory-extractor-5PTMCSOX.js +1 -0
- package/dist/memory-gc-BCHTOSXK.js +1 -0
- package/dist/memory-service-66EMRJXO.js +1 -0
- package/dist/onnxruntime_binding-2BPLI7ZQ.node +0 -0
- package/dist/onnxruntime_binding-5J67DTMJ.node +0 -0
- package/dist/onnxruntime_binding-7ZZLEQ2F.node +0 -0
- package/dist/onnxruntime_binding-KDCXAPN5.node +0 -0
- package/dist/onnxruntime_binding-R73P2IQW.node +0 -0
- package/dist/outbound-gateway-3INYZDOR.js +1 -0
- package/dist/presets-DT3J2ON4.js +1 -0
- package/dist/reflection-job-ST4ANCGB.js +23 -0
- package/dist/role-presets-3IQKCSVQ.js +1 -0
- package/dist/role-workspace-SIHNI6HO.js +1 -0
- package/dist/roles-F6AEM6B5.js +1 -0
- package/dist/{runtime-QA2DCZYQ.js → runtime-TWLGJSL6.js} +1 -1
- package/dist/session-manager-JTQRJI7R.js +1 -0
- package/dist/skill-registry-4JT62GEF.js +1 -0
- package/dist/target-resolution-PSSBM4LX.js +1 -0
- package/dist/task-templates-6G46OVYT.js +1 -0
- package/dist/template-dispatch-2K7KV7YS.js +1 -0
- package/dist/template-execution-artifacts-NEPSVD2B.js +1 -0
- package/dist/trace-context-UR7DI5ME.js +1 -0
- package/package.json +34 -14
- package/web/dist/assets/{Button-VPwTNGpF.js → Button-fLMsJd5o.js} +1 -1
- package/web/dist/assets/{Card-C2N6k4gh.js → Card-cy-gHU0O.js} +1 -1
- package/web/dist/assets/{ChannelDetail-DktmpO0A.js → ChannelDetail-CsKBPHkT.js} +1 -1
- package/web/dist/assets/Channels-DMutLV9r.js +14 -0
- package/web/dist/assets/Chat-DWTs-iOw.js +2 -0
- package/web/dist/assets/Dashboard-CoatfhW8.js +1 -0
- package/web/dist/assets/{EmptyState-CWS9PJND.js → EmptyState-C5kVDHc7.js} +1 -1
- package/web/dist/assets/{EnvVarEditor-D0kGIBcl.js → EnvVarEditor-BvRsHayG.js} +1 -1
- package/web/dist/assets/{EventDefDetail-BiXTA6LF.js → EventDefDetail-zuJydp12.js} +1 -1
- package/web/dist/assets/Events-nCImjXyr.js +1 -0
- package/web/dist/assets/{Evolution-C884p_CE.js → Evolution-Br41g99g.js} +1 -1
- package/web/dist/assets/ExtensionDetail-BXlphIkn.js +1 -0
- package/web/dist/assets/Extensions-3lhbw0A2.js +1 -0
- package/web/dist/assets/{FeatureRequests-Ck0WQnXX.js → FeatureRequests-oaXQNu43.js} +1 -1
- package/web/dist/assets/{GoalDetail-DJOyf7By.js → GoalDetail-DRDg1JDv.js} +1 -1
- package/web/dist/assets/Goals-DGmKvtGA.js +1 -0
- package/web/dist/assets/{Logs-6r7fnBn7.js → Logs-BZKxhdnb.js} +1 -1
- package/web/dist/assets/{Memories-CvPaqv5r.js → Memories-DhJJk-KB.js} +1 -1
- package/web/dist/assets/{Mistakes-aUhkqHDC.js → Mistakes-DxThj9as.js} +1 -1
- package/web/dist/assets/{NotFound-R6tIzhL0.js → NotFound-buXr2gl7.js} +1 -1
- package/web/dist/assets/{PageHeader-D9lLjo0N.js → PageHeader-BgNbz3JV.js} +1 -1
- package/web/dist/assets/Plugins-BXrsGsXs.js +1 -0
- package/web/dist/assets/RoleDetail-rClUsHwS.js +35 -0
- package/web/dist/assets/Roles-DH9cRv8h.js +1 -0
- package/web/dist/assets/{SectionHeader-BB3H3F_P.js → SectionHeader-CwX6m1f6.js} +1 -1
- package/web/dist/assets/Settings-My2lOEWv.js +1 -0
- package/web/dist/assets/{Strategies-DUps-2I9.js → Strategies-YLMryJlG.js} +1 -1
- package/web/dist/assets/{Switch-B_R_EX9s.js → Switch-PNpjNoGn.js} +1 -1
- package/web/dist/assets/{Table-D4lT5uHx.js → Table-BrERwl-F.js} +1 -1
- package/web/dist/assets/{Tabs-CwzWpI-7.js → Tabs-CGHmpUAD.js} +1 -1
- package/web/dist/assets/TaskDetail-Bkaq0NwW.js +2 -0
- package/web/dist/assets/Work-4OcGMu_a.js +1 -0
- package/web/dist/assets/api-BkdixMz9.js +1 -0
- package/web/dist/assets/{es2015-DCW7LI8d.js → es2015-JqLIWAgH.js} +1 -1
- package/web/dist/assets/index-C-e-qpXc.js +12 -0
- package/web/dist/assets/index-DGTVc0qD.css +2 -0
- package/web/dist/assets/{useIsMobileLayout-D6Tz5o5h.js → useIsMobileLayout-Blj4Mk4K.js} +1 -1
- package/web/dist/assets/{usePluginsWithUsage-CSQr03vZ.js → usePluginsWithUsage-Ch9WCFTb.js} +1 -1
- package/web/dist/assets/vendor-icons-U4igmrUq.js +1 -0
- package/web/dist/assets/{vendor-react-CIkiuNDu.js → vendor-react-Bp_V-Hsf.js} +1 -1
- package/web/dist/assets/{vendor-state-CEOsUh-T.js → vendor-state-Zjl_6-V3.js} +1 -1
- package/web/dist/index.html +8 -8
- package/dist/App-5QZKMPRM.js +0 -13
- package/dist/adam-tools-SQD2V4RJ.js +0 -1
- package/dist/approval-handler-J6RUTICJ.js +0 -1
- package/dist/audit-manager-CWVHQAUI.js +0 -1
- package/dist/bree-engine-VGEYMVNP.js +0 -1
- package/dist/channels-OOIM62BX.js +0 -1
- package/dist/chunk-2BXTT4P2.js +0 -6
- package/dist/chunk-47COBMRF.js +0 -1
- package/dist/chunk-6JBSBSCL.js +0 -1
- package/dist/chunk-6WRZJVQ2.js +0 -1
- package/dist/chunk-7IFLU3CY.js +0 -4
- package/dist/chunk-AQO6IIHV.js +0 -684
- package/dist/chunk-AVM3O74V.js +0 -5
- package/dist/chunk-B544JOZM.js +0 -3
- package/dist/chunk-DZIEY4CH.js +0 -47
- package/dist/chunk-E4WIUUL4.js +0 -27
- package/dist/chunk-HDHMNT6D.js +0 -1
- package/dist/chunk-JYHOGBCP.js +0 -12
- package/dist/chunk-M3RZWIW3.js +0 -50
- package/dist/chunk-N4ES7TCL.js +0 -1
- package/dist/chunk-NPIXYK5G.js +0 -5
- package/dist/chunk-O7XQSONJ.js +0 -5
- package/dist/chunk-OZL6VNOR.js +0 -146
- package/dist/chunk-Q2ISNOBQ.js +0 -1
- package/dist/chunk-QYRI4HYA.js +0 -1
- package/dist/chunk-R2WB5BKF.js +0 -7
- package/dist/chunk-RMGBR3XZ.js +0 -21
- package/dist/chunk-S6OV7Z6K.js +0 -1
- package/dist/chunk-SC2DDRYB.js +0 -5
- package/dist/chunk-SGIKNIC5.js +0 -49
- package/dist/chunk-TI3AKKWZ.js +0 -80
- package/dist/chunk-U2LBBBWO.js +0 -8
- package/dist/chunk-UXDTFTG5.js +0 -10
- package/dist/chunk-Y5FFL6UO.js +0 -5
- package/dist/chunk-ZFDULJGB.js +0 -3
- package/dist/chunk-ZQ4PNKMQ.js +0 -10
- package/dist/config-DRFRLIVN.js +0 -1
- package/dist/db-FACSMWEY.js +0 -1
- package/dist/delivery-log-JIQMHBJ5.js +0 -1
- package/dist/dist-CDWBOTZS.js +0 -1
- package/dist/engine-OHYWUUMJ.js +0 -1
- package/dist/evolution-audit-M7FSYRQR.js +0 -1
- package/dist/learner-OUNQSWN7.js +0 -1
- package/dist/memories-ABE7PMQL.js +0 -1
- package/dist/memory-extractor-ZX2NJIBV.js +0 -6
- package/dist/memory-service-UWER3T2S.js +0 -1
- package/dist/onnxruntime_binding-6Q6HXASN.node +0 -0
- package/dist/onnxruntime_binding-EKZT2NRK.node +0 -0
- package/dist/onnxruntime_binding-P6S7V3CI.node +0 -0
- package/dist/onnxruntime_binding-PJNNIIUO.node +0 -0
- package/dist/onnxruntime_binding-UN6SPTQK.node +0 -0
- package/dist/outbound-gateway-XDCGAXXW.js +0 -1
- package/dist/presets-RMW3WO5P.js +0 -1
- package/dist/role-presets-FAXQRBII.js +0 -1
- package/dist/role-workspace-ISGPO25D.js +0 -1
- package/dist/roles-WNKRM6FD.js +0 -1
- package/dist/session-manager-SOJXQHHY.js +0 -1
- package/dist/task-templates-IS3DJCZB.js +0 -1
- package/dist/token-estimator-HMPVGDCN.js +0 -1
- package/dist/workflow-executor-LOMKVFPV.js +0 -1
- package/web/dist/assets/Channels-ozCXdZMq.js +0 -12
- package/web/dist/assets/Chat-CggvtidD.js +0 -2
- package/web/dist/assets/Dashboard-z37ZVhzH.js +0 -1
- package/web/dist/assets/Events-C4P3jjZd.js +0 -1
- package/web/dist/assets/Goals-CDZWDuXR.js +0 -1
- package/web/dist/assets/Plugins-CtwoMUoj.js +0 -1
- package/web/dist/assets/RoleDetail-B32225ae.js +0 -33
- package/web/dist/assets/Roles-CGYsxuq8.js +0 -1
- package/web/dist/assets/Settings-D2jrO8-G.js +0 -1
- package/web/dist/assets/TaskDetail-DKminIM_.js +0 -2
- package/web/dist/assets/Work-uD_6IieV.js +0 -1
- package/web/dist/assets/api-D-UzHSDq.js +0 -1
- package/web/dist/assets/index-6f2jcj0h.css +0 -2
- package/web/dist/assets/index-Bl-2p6d8.js +0 -12
- package/web/dist/assets/vendor-icons-jzPiR6xl.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{U as t,mt as n,x as r}from"./vendor-icons-U4igmrUq.js";import{t as i}from"./vendor-react-Bp_V-Hsf.js";import{t as a}from"./Button-fLMsJd5o.js";import{t as o}from"./api-BkdixMz9.js";import{f as s,t as c}from"./index-C-e-qpXc.js";import{t as l}from"./Card-cy-gHU0O.js";import{t as u}from"./PageHeader-BgNbz3JV.js";import{a as d}from"./format-BUYXZqDw.js";import{t as f}from"./EmptyState-C5kVDHc7.js";var p=e(n(),1),m=i();function h(){let e=s(e=>e.roles),n=s(e=>e.fetchRoles),[i,h]=(0,p.useState)([]),[g,_]=(0,p.useState)(!0),[v,y]=(0,p.useState)(`all`);(0,p.useEffect)(()=>{n()},[n]);let b=(0,p.useCallback)(async()=>{_(!0);try{let e=new URLSearchParams({limit:`50`});v!==`all`&&e.set(`roleId`,v),h(await o(`/evolution-audit?${e}`))}catch{h([])}finally{_(!1)}},[v]);(0,p.useEffect)(()=>{b()},[b]);let x=t=>t?e.find(e=>e.id===t)?.name??t.slice(0,8):`System`;return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsx)(u,{eyebrow:`Learning`,title:`Evolution Audit`,compact:!0,description:`Rule mutations and diagnostic reports across roles.`,metrics:[{label:`Visible`,value:i.length},{label:`Role Filter`,value:v===`all`?`All`:x(v)},{label:`Catalog`,value:e.length}],actions:(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsxs)(`select`,{className:`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:v,onChange:e=>y(e.target.value),children:[(0,m.jsx)(`option`,{value:`all`,children:`All roles`}),e.map(e=>(0,m.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,m.jsx)(a,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:(0,m.jsx)(r,{size:14})})]})}),(0,m.jsx)(l,{children:g?(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-[var(--app-border)] border-t-[var(--app-accent)]`})}):i.length===0?(0,m.jsx)(f,{icon:(0,m.jsx)(t,{size:32}),title:`No evolution records`,description:`Evolution occurs when roles accumulate enough task experience.`,className:`py-8`}):(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[i.length,` records`]}),i.map(e=>(0,m.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] p-3`,children:[(0,m.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,m.jsx)(c,{variant:`info`,children:x(e.roleId)}),(0,m.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:d(e.timestamp)}),e.triggerTaskId&&(0,m.jsxs)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:[`triggered by task `,e.triggerTaskId.slice(0,8)]})]}),e.diff.includes(`--- Diagnostic Report ---`)?(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`rounded bg-[var(--app-canvas)] p-2`,children:[(0,m.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-[var(--app-text-muted)]`,children:`Diagnostic Report`}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-[var(--app-text-muted)]`,children:e.diff.split(`--- Rules Diff ---`)[0]?.replace(`--- Diagnostic Report ---
|
|
2
2
|
`,``).trim()})]}),(0,m.jsxs)(`div`,{className:`rounded bg-[var(--app-canvas)] p-2`,children:[(0,m.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-[var(--app-text-muted)]`,children:`Rules Changes`}),(0,m.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
3
|
`).map((e,t)=>(0,m.jsxs)(`span`,{className:e.startsWith(`+`)?`text-[var(--app-success)]`:e.startsWith(`-`)?`text-[var(--app-danger)]`:`text-[var(--app-text-muted)]`,children:[e,`
|
|
4
4
|
`]},t))})]})]}):(0,m.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[var(--app-canvas)] p-2 font-mono text-xs`,children:e.diff.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{F as t,at as n,c as r,mt as i,ot as a}from"./vendor-icons-U4igmrUq.js";import{d as o,f as s,t as c}from"./vendor-react-Bp_V-Hsf.js";import{t as l}from"./Button-fLMsJd5o.js";import{c as u,o as d}from"./api-BkdixMz9.js";import{p as f}from"./index-C-e-qpXc.js";import{t as p}from"./Card-cy-gHU0O.js";import{t as m}from"./PageHeader-BgNbz3JV.js";import{t as h}from"./ui-CerQw0jA.js";var g=e(i(),1),_=c();function v({meta:e}){let[t,r]=(0,g.useState)(!1);return(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`button`,{className:`flex items-center gap-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,onClick:()=>r(e=>!e),children:[t?(0,_.jsx)(a,{size:12}):(0,_.jsx)(n,{size:12}),`_meta`]}),t&&(0,_.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-lg bg-black/20 p-3 text-xs text-[var(--app-text-muted)]`,children:JSON.stringify(e,null,2)})]})}function y({fieldKey:e,field:t,value:n}){let r=n==null?t.default===void 0?``:String(t.default):String(n);return(0,_.jsxs)(`div`,{className:`space-y-1`,children:[(0,_.jsxs)(`label`,{className:`text-xs font-medium text-[var(--app-text)]`,children:[t.title,t.required&&(0,_.jsx)(`span`,{className:`ml-1 text-red-400`,children:`*`}),t.sensitive&&(0,_.jsx)(`span`,{className:`ml-1 text-[var(--app-text-subtle)]`,children:`(sensitive)`})]}),t.description&&(0,_.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:t.description}),(0,_.jsx)(`input`,{type:t.sensitive?`password`:`text`,readOnly:!0,defaultValue:r,placeholder:`${e}`,className:`w-full rounded-lg border border-[var(--app-border)] bg-black/20 px-3 py-1.5 text-xs text-[var(--app-text)] outline-none`})]})}function b(){let{name:e}=s(),n=o(),[i,a]=(0,g.useState)(null),[c,b]=(0,g.useState)(null),[x,S]=(0,g.useState)(!0),[C,w]=(0,g.useState)(!1),[T,E]=(0,g.useState)(!1),D=(0,g.useCallback)(async()=>{if(e){S(!0);try{let t=await u(e);a(t);try{b(JSON.parse(t.manifestJson))}catch{}}catch{f.error(`Extension not found`),n(`/extensions`)}finally{S(!1)}}},[e,n]);(0,g.useEffect)(()=>{D()},[D]);async function O(){if(i){w(!0);try{await d(i.name),f.success(`Uninstalled ${i.name}`),n(`/extensions`)}catch{f.error(`Failed to uninstall extension`),w(!1)}}}if(x)return(0,_.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,_.jsx)(t,{size:24,className:`animate-spin text-[var(--app-text-subtle)]`})});if(!i||!c)return null;let k=(()=>{try{return i.defaultConfigJson?JSON.parse(i.defaultConfigJson):{}}catch{return{}}})();return(0,_.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,_.jsx)(m,{title:c.display_name??i.name,description:`v${i.version} · Source: ${i.installSource}`,actions:(0,_.jsxs)(l,{variant:`destructive`,onClick:()=>E(!0),disabled:C,children:[(0,_.jsx)(r,{size:h.md}),`卸载`]})}),(0,_.jsxs)(`div`,{className:`flex-1 overflow-y-auto space-y-4 p-4`,children:[(0,_.jsxs)(p,{className:`p-4 space-y-2`,children:[(0,_.jsx)(`p`,{className:`text-sm text-[var(--app-text-muted)]`,children:c.description}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-[var(--app-text-subtle)]`,children:[(0,_.jsxs)(`span`,{children:[`Author: `,c.author.name]}),c.author.email&&(0,_.jsx)(`span`,{children:c.author.email}),c.homepage&&(0,_.jsx)(`a`,{href:c.homepage,target:`_blank`,rel:`noreferrer`,className:`text-[var(--app-accent)] hover:underline`,children:`Homepage`})]})]}),c.tools&&c.tools.length>0&&(0,_.jsxs)(p,{className:`p-4`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-[var(--app-text-subtle)]`,children:[`Tools (`,c.tools.length,`)`]}),(0,_.jsx)(`div`,{className:`space-y-2`,children:c.tools.map(e=>(0,_.jsxs)(`div`,{className:`rounded-lg border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,_.jsx)(`p`,{className:`font-mono text-xs font-medium text-[var(--app-text)]`,children:e.name}),e.description&&(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-[var(--app-text-muted)]`,children:e.description})]},e.name))})]}),c.user_config&&Object.keys(c.user_config).length>0&&(0,_.jsxs)(p,{className:`p-4`,children:[(0,_.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-[var(--app-text-subtle)]`,children:`Configuration`}),(0,_.jsx)(`div`,{className:`space-y-3`,children:Object.entries(c.user_config).map(([e,t])=>(0,_.jsx)(y,{fieldKey:e,field:t,value:k[e]},e))})]}),c._meta&&Object.keys(c._meta).length>0&&(0,_.jsx)(p,{className:`p-4`,children:(0,_.jsx)(v,{meta:c._meta})}),(0,_.jsxs)(p,{className:`p-4`,children:[(0,_.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-[var(--app-text-subtle)]`,children:`Server`}),(0,_.jsxs)(`div`,{className:`space-y-1 text-xs text-[var(--app-text)]`,children:[(0,_.jsxs)(`p`,{children:[`Type: `,(0,_.jsx)(`span`,{className:`font-mono`,children:c.server.type})]}),(0,_.jsxs)(`p`,{children:[`Command: `,(0,_.jsx)(`span`,{className:`font-mono`,children:c.server.mcp_config.command})]}),c.server.mcp_config.args&&c.server.mcp_config.args.length>0&&(0,_.jsxs)(`p`,{children:[`Args: `,(0,_.jsx)(`span`,{className:`font-mono`,children:c.server.mcp_config.args.join(` `)})]})]})]})]}),T&&(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,children:(0,_.jsxs)(`div`,{className:`w-full max-w-sm rounded-2xl border border-[var(--app-border)] bg-[var(--app-bg)] p-6 shadow-2xl`,children:[(0,_.jsx)(`h2`,{className:`mb-2 text-base font-semibold text-[var(--app-text)]`,children:`Uninstall extension?`}),(0,_.jsxs)(`p`,{className:`mb-4 text-sm text-[var(--app-text-subtle)]`,children:[`This will remove `,(0,_.jsx)(`strong`,{children:i.name}),` from the DB and delete its files from disk. This cannot be undone.`]}),(0,_.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,_.jsx)(l,{variant:`ghost`,onClick:()=>E(!1),disabled:C,children:`Cancel`}),(0,_.jsxs)(l,{variant:`destructive`,onClick:()=>void O(),disabled:C,children:[C?(0,_.jsx)(t,{size:h.md,className:`animate-spin`}):(0,_.jsx)(r,{size:h.md}),`Uninstall`]})]})]})})]})}export{b as ExtensionDetail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,F as n,at as r,mt as i,n as a,o,ot as s,s as c}from"./vendor-icons-U4igmrUq.js";import{d as l,t as u}from"./vendor-react-Bp_V-Hsf.js";import{t as d}from"./Button-fLMsJd5o.js";import{d as f,i as p,u as m,x as h}from"./api-BkdixMz9.js";import{p as g}from"./index-C-e-qpXc.js";import{t as _}from"./Card-cy-gHU0O.js";import{t as v}from"./PageHeader-BgNbz3JV.js";import{t as y}from"./EmptyState-C5kVDHc7.js";import{t as b}from"./ui-CerQw0jA.js";var x=e(i(),1),S=u();function C({snapshot:e,onClear:t}){let[i,a]=(0,x.useState)(!1),[o,l]=(0,x.useState)(null);if(e.count===0)return null;async function u(e){l(e.roleId);try{await p(e.roleId),t(e.roleId),g.success(`Cleared legacy mcp_servers for ${e.roleName}`)}catch{g.error(`Failed to clear legacy mcp_servers`)}finally{l(null)}}return(0,S.jsxs)(`div`,{className:`mb-4 rounded-xl border border-yellow-500/30 bg-yellow-500/5 p-4`,children:[(0,S.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-left`,onClick:()=>a(e=>!e),children:[(0,S.jsx)(c,{size:b.sm,className:`shrink-0 text-yellow-400`}),(0,S.jsxs)(`span`,{className:`flex-1 text-sm font-medium text-yellow-300`,children:[e.count,` role`,e.count===1?``:`s`,` with legacy`,` `,(0,S.jsx)(`code`,{className:`font-mono`,children:`mcp_servers`}),` field`]}),i?(0,S.jsx)(s,{size:b.sm,className:`text-yellow-400`}):(0,S.jsx)(r,{size:b.sm,className:`text-yellow-400`})]}),i&&(0,S.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,S.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`These roles have an inline `,(0,S.jsx)(`code`,{className:`font-mono`,children:`mcp_servers`}),` config that predates the Extensions system. Click "Clear" to zero it out — the column is preserved, only its value is reset to `,(0,S.jsx)(`code`,{className:`font-mono`,children:`{}`}),`.`]}),e.rows.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[var(--app-border)] bg-black/20 px-3 py-2`,children:[(0,S.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:e.roleName}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,onClick:()=>void u(e),disabled:o===e.roleId,children:o===e.roleId?(0,S.jsx)(n,{size:b.sm,className:`animate-spin`}):`Clear`})]},e.roleId))]})]})}function w({onClose:e,onSuccess:t}){let r=(0,x.useRef)(null),[i,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1);async function u(n){if(!n.name.endsWith(`.mcpb`)){g.error(`Only .mcpb files are supported`);return}s(!0);try{let r=await h(n);t(r),g.success(`Installed extension: ${r.name} v${r.version}`),e()}catch(e){let t=e instanceof Error?e.message:`Upload failed`;g.error(t)}finally{s(!1)}}function f(e){let t=e.target.files?.[0];t&&u(t)}function p(e){e.preventDefault(),l(!1);let t=e.dataTransfer.files[0];t&&u(t)}return(0,S.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,children:(0,S.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-[var(--app-border)] bg-[var(--app-bg)] p-6 shadow-2xl`,children:[(0,S.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,S.jsx)(`h2`,{className:`text-base font-semibold text-[var(--app-text)]`,children:`Import Extension`}),(0,S.jsx)(`button`,{onClick:e,className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:(0,S.jsx)(a,{size:b.lg})})]}),(0,S.jsx)(`div`,{className:`flex min-h-[140px] cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed p-6 transition-colors ${c?`border-[var(--app-accent)] bg-[var(--app-accent)]/10`:`border-[var(--app-border)] hover:border-[var(--app-text-subtle)]`}`,onClick:()=>r.current?.click(),onDragOver:e=>{e.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:p,children:i?(0,S.jsx)(n,{size:32,className:`animate-spin text-[var(--app-accent)]`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(o,{size:32,className:`text-[var(--app-text-subtle)]`}),(0,S.jsxs)(`p`,{className:`text-sm text-[var(--app-text-subtle)]`,children:[`Drop a `,(0,S.jsx)(`code`,{className:`font-mono`,children:`.mcpb`}),` file here, or click to browse`]})]})}),(0,S.jsx)(`input`,{ref:r,type:`file`,accept:`.mcpb`,className:`hidden`,onChange:f}),(0,S.jsx)(`div`,{className:`mt-4 flex justify-end gap-2`,children:(0,S.jsx)(d,{variant:`ghost`,onClick:e,disabled:i,children:`Cancel`})})]})})}function T({health:e}){return e?e.lastStatus===`success`?(0,S.jsx)(`span`,{title:`Last ok ${e.lastRunAt?new Date(e.lastRunAt).toLocaleString():``}`,className:`text-green-500 text-sm`,children:`✅`}):(0,S.jsx)(`span`,{title:e.lastError??`Failed`,className:`text-red-500 text-sm`,children:`❌`}):(0,S.jsx)(`span`,{title:`Never run`,className:`text-gray-500 text-sm`,children:`⏳`})}function E({extension:e}){let n=l(),r={};try{r=JSON.parse(e.manifestJson)}catch{}return(0,S.jsx)(_,{className:`cursor-pointer p-4 transition-colors hover:border-[var(--app-accent)]/50`,onClick:()=>n(`/extensions/${e.name}`),children:(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`truncate font-medium text-[var(--app-text)]`,children:e.name}),(0,S.jsxs)(`p`,{className:`mt-0.5 text-xs text-[var(--app-text-subtle)]`,children:[`v`,e.version]}),r.description&&(0,S.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-[var(--app-text-muted)]`,children:r.description})]}),(0,S.jsxs)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:[(0,S.jsx)(T,{health:e.health}),(0,S.jsx)(t,{size:b.md,className:`mt-0.5 text-[var(--app-text-subtle)]`})]})]})})}function D(){let[e,r]=(0,x.useState)([]),[i,a]=(0,x.useState)({count:0,rows:[]}),[s,c]=(0,x.useState)(!0),[l,u]=(0,x.useState)(!1),p=(0,x.useCallback)(async()=>{c(!0);try{let[e,t]=await Promise.all([m(),f()]);r(e),a(t)}catch{g.error(`Failed to load extensions`)}finally{c(!1)}},[]);(0,x.useEffect)(()=>{p()},[p]);function h(e){a(t=>({count:t.count-1,rows:t.rows.filter(t=>t.roleId!==e)}))}function _(e){r(t=>{let n=t.findIndex(t=>t.name===e.name);if(n>=0){let r=[...t];return r[n]=e,r}return[e,...t]})}return(0,S.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,S.jsx)(v,{title:`Extensions`,description:s?`Loading…`:`${e.length} installed`,actions:(0,S.jsxs)(d,{onClick:()=>u(!0),children:[(0,S.jsx)(o,{size:b.md}),`Import`]})}),(0,S.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,S.jsx)(C,{snapshot:i,onClear:h}),s?(0,S.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,S.jsx)(n,{size:24,className:`animate-spin text-[var(--app-text-subtle)]`})}):e.length===0?(0,S.jsx)(y,{icon:(0,S.jsx)(t,{size:32,className:`text-[var(--app-text-subtle)]`}),title:`还没装任何 extension`,description:`Click Import to upload a .mcpb package.`,action:(0,S.jsxs)(d,{onClick:()=>u(!0),children:[(0,S.jsx)(o,{size:b.md}),`Import`]})}):(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>(0,S.jsx)(E,{extension:e},e.id))})]}),l&&(0,S.jsx)(w,{onClose:()=>u(!1),onSuccess:_})]})}export{D as Extensions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{mt as t}from"./vendor-icons-U4igmrUq.js";import{t as n}from"./vendor-react-Bp_V-Hsf.js";import{t as r}from"./Button-fLMsJd5o.js";import{t as i}from"./api-BkdixMz9.js";import{t as a}from"./index-C-e-qpXc.js";import{t as o}from"./Card-cy-gHU0O.js";import{t as s}from"./SectionHeader-CwX6m1f6.js";import{t as c}from"./EmptyState-C5kVDHc7.js";var l=e(t(),1),u=n(),d={new:`muted`,reviewed:`success`,dismissed:`secondary`,converted:`warning`};function f(e){let t=Date.now()-e;if(Math.floor(t/6e4)<1)return`just now`;let n=Math.floor(t/36e5);return n<24?`${n}h ago`:`${Math.floor(t/864e5)}d ago`}function p(){let[e,t]=(0,l.useState)([]),[n,p]=(0,l.useState)(!0),[m,h]=(0,l.useState)(`all`),[g,_]=(0,l.useState)(null),[v,y]=(0,l.useState)(null),b=(0,l.useCallback)(async()=>{p(!0);try{let e=new URLSearchParams({limit:`200`});m!==`all`&&e.set(`status`,m),t((await i(`/feature-requests?${e}`)).featureRequests)}catch{t([])}finally{p(!1)}},[m]);(0,l.useEffect)(()=>{b()},[b]);let x=async(e,t)=>{y(e);try{await i(`/feature-requests/${e}`,{method:`PATCH`,body:JSON.stringify({status:t})}),await b()}finally{y(null)}};return(0,u.jsxs)(`div`,{className:`space-y-5`,children:[(0,u.jsx)(s,{title:`Feature Requests`,description:`Unmet user needs identified by the Feature Miner role.`,compact:!0,action:(0,u.jsx)(r,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:`Refresh`})}),(0,u.jsx)(`div`,{className:`flex gap-2`,children:[`all`,`new`,`reviewed`,`dismissed`,`converted`].map(e=>(0,u.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`rounded px-3 py-1.5 text-xs font-medium transition-colors ${m===e?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:e===`all`?`All`:e.charAt(0).toUpperCase()+e.slice(1)},e))}),n?(0,u.jsx)(o,{children:(0,u.jsx)(`p`,{className:`text-sm text-[var(--app-text-muted)]`,children:`Loading...`})}):e.length===0?(0,u.jsx)(o,{children:(0,u.jsx)(c,{title:`No feature requests`,description:`Run the Feature Mining template to extract unmet needs from chat sessions.`})}):(0,u.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,u.jsxs)(o,{padding:!1,children:[(0,u.jsx)(`div`,{className:`p-4 cursor-pointer hover:bg-black/[0.02]`,onClick:()=>_(g===e.id?null:e.id),role:`button`,tabIndex:0,onKeyDown:t=>{t.key===`Enter`&&_(g===e.id?null:e.id)},children:(0,u.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,u.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(a,{variant:d[e.status],children:e.status}),(0,u.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:f(e.extractedAt)}),e.tags&&e.tags.length>0&&(0,u.jsx)(`div`,{className:`flex gap-1`,children:e.tags.slice(0,3).map(e=>(0,u.jsx)(`span`,{className:`rounded border border-[var(--app-border)] px-1.5 py-0.5 text-[10px] text-[var(--app-text-muted)]`,children:e},e))})]}),e.summary?(0,u.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.summary}):null,(0,u.jsx)(`p`,{className:`text-sm text-[var(--app-text-muted)] line-clamp-2`,children:e.content})]})})}),g===e.id&&(0,u.jsxs)(`div`,{className:`border-t border-[var(--app-border)] p-4 space-y-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Content`}),(0,u.jsx)(`p`,{className:`text-sm text-[var(--app-text)]`,children:e.content})]}),e.evidenceQuote&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Evidence Quote`}),(0,u.jsx)(`blockquote`,{className:`border-l-2 border-[var(--app-border)] pl-3 text-sm text-[var(--app-text-muted)] italic`,children:e.evidenceQuote})]}),e.tags&&e.tags.length>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Tags`}),(0,u.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.map(e=>(0,u.jsx)(`span`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-0.5 text-xs text-[var(--app-text)]`,children:e},e))})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,u.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Extracted: `,new Date(e.extractedAt).toLocaleString()]}),e.sourceSessionId&&(0,u.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Session: `,e.sourceSessionId.slice(0,8)]})]}),(0,u.jsx)(`div`,{className:`flex gap-2 pt-1`,children:[`new`,`reviewed`,`dismissed`,`converted`].map(t=>(0,u.jsx)(r,{variant:e.status===t?`default`:`ghost`,size:`sm`,disabled:v===e.id||e.status===t,onClick:n=>{n.stopPropagation(),x(e.id,t)},children:t.charAt(0).toUpperCase()+t.slice(1)},t))})]})]},e.id))})]})}export{p as FeatureRequests};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,Z as n,d as r,dt as i,mt as a,z as o}from"./vendor-icons-U4igmrUq.js";import{f as s,r as c,t as l}from"./vendor-react-Bp_V-Hsf.js";import{t as u}from"./api-BkdixMz9.js";import{t as d}from"./index-C-e-qpXc.js";import{a as f,i as p,t as m}from"./Card-cy-gHU0O.js";import{t as h}from"./PageHeader-BgNbz3JV.js";import{t as g}from"./SectionHeader-CwX6m1f6.js";import{n as _}from"./format-BUYXZqDw.js";var v=e(a(),1),y=l();function b(){let{id:e}=s(),[a,l]=(0,v.useState)(null),[b,S]=(0,v.useState)([]),[C,w]=(0,v.useState)(null);if((0,v.useEffect)(()=>{e&&(async()=>{try{let t=await u(`/goals/${e}`);l(t.goal),w(null);try{S((await u(`/strategies?role=${t.goal.roleId}`)).strategies??[])}catch{}}catch(e){w(e instanceof Error?e.message:`Failed to load goal`)}})()},[e]),C)return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(i,{size:14}),` Back to Goals`]}),(0,y.jsx)(m,{className:`text-center text-[var(--app-danger)]`,children:C})]});if(!a)return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(i,{size:14}),` Back to Goals`]}),(0,y.jsx)(m,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let T=a.targetValue>0?Math.min(100,a.currentValue/a.targetValue*100):0,E=a.deadline>0&&a.deadline<Date.now()&&a.status!==`completed`;return(0,y.jsxs)(`div`,{className:`space-y-5`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(i,{size:14}),` Back to Goals`]}),(0,y.jsx)(h,{eyebrow:`Goal`,title:a.name,compact:!0,description:a.description||`Progress, delivery targets, and strategy support before raw metrics.`,metrics:[{label:`Status`,value:(0,y.jsx)(d,{variant:(e=>e===`completed`?`success`:e===`executing`||e===`evaluating`?`warning`:e===`failed`?`destructive`:`secondary`)(a.status),children:a.status})},{label:`Role`,value:a.roleId},{label:`Metric`,value:a.metricType},{label:`Progress`,value:`${T.toFixed(1)}%`}]}),(0,y.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:[(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Goal ID`}),(0,y.jsx)(`p`,{className:`mt-2 truncate font-mono text-sm text-[var(--app-text)]`,children:a.id})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Current delta`}),(0,y.jsx)(`p`,{className:`mt-2 text-2xl font-semibold text-[var(--app-text)]`,children:Math.max(a.targetValue-a.currentValue,0)})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Strategies in play`}),(0,y.jsx)(`p`,{className:`mt-2 text-2xl font-semibold text-[var(--app-text)]`,children:b.length})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Deadline state`}),(0,y.jsx)(`p`,{className:`mt-2 text-sm font-medium ${E?`text-[var(--app-danger-soft-text)]`:`text-[var(--app-text)]`}`,children:E?`Overdue`:`On track`})]})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(x,{icon:r,label:`Progress`,value:`${a.currentValue} / ${a.targetValue}`}),(0,y.jsx)(x,{icon:t,label:E?`Overdue`:`Deadline`,value:_(a.deadline),mono:!0}),(0,y.jsx)(x,{icon:n,label:`Budget`,value:`$${a.budgetUsd.toFixed(2)}`}),(0,y.jsx)(x,{icon:o,label:`Created`,value:_(a.createdAt),mono:!0})]}),(0,y.jsx)(g,{title:`Progress`,compact:!0,description:`Completion first, then delivery targets and strategy support.`}),(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsx)(f,{children:`Progress`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`div`,{className:`flex-1 h-3 rounded-full bg-[var(--app-panel-muted)] overflow-hidden`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] ${E?`bg-[var(--app-danger)]`:`bg-[var(--app-accent)]`}`,style:{width:`${T}%`}})}),(0,y.jsxs)(`span`,{className:`text-sm text-[var(--app-text)] font-mono`,children:[T.toFixed(1),`%`]})]}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-[var(--app-text-subtle)]`,children:[(0,y.jsxs)(`span`,{children:[a.currentValue,` current`]}),(0,y.jsxs)(`span`,{children:[a.targetValue,` target`]})]})]}),(a.deliverTo??[]).length>0&&(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsx)(f,{children:`Delivery Targets`})}),(0,y.jsx)(`div`,{className:`space-y-1.5`,children:(a.deliverTo??[]).map((e,t)=>(0,y.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:e.type===`channel`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{variant:`outline`,children:`Channel`}),(0,y.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,y.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{variant:`outline`,children:`Session`}),(0,y.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Chat session`})]})},t))})]}),b.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(g,{title:`Strategy Support`,compact:!0,description:`Strategy candidates already associated with the goal's role.`}),(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,y.jsx)(o,{size:14}),` Strategies (`,b.length,`)`]})}),(0,y.jsx)(`div`,{className:`space-y-2`,children:b.map(e=>(0,y.jsxs)(`div`,{className:`flex items-center justify-between text-sm border-b border-[var(--app-border)] pb-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),(0,y.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.taskType})]}),(0,y.jsxs)(d,{variant:`outline`,children:[e.trialCount,` trials`]})]},e.id))})]})]})]})}function x({icon:e,label:t,value:n,mono:r}){return(0,y.jsxs)(m,{className:`flex flex-col gap-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[var(--app-text-subtle)]`,children:[(0,y.jsx)(e,{size:12}),(0,y.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,y.jsx)(`span`,{className:`text-sm text-[var(--app-text)] truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{b as GoalDetail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n,c as r,d as i,k as a,mt as o,n as s,w as c,x as l}from"./vendor-icons-U4igmrUq.js";import{t as u}from"./vendor-react-Bp_V-Hsf.js";import"./es2015-JqLIWAgH.js";import{t as d}from"./Button-fLMsJd5o.js";import{t as f}from"./api-BkdixMz9.js";import{a as p,c as m,d as h,f as g,i as ee,l as _,n as v,o as y,p as b,r as x,s as S,t as C,u as te}from"./index-C-e-qpXc.js";import{a as w,i as ne,t as T}from"./Card-cy-gHU0O.js";import{t as E}from"./PageHeader-BgNbz3JV.js";import{n as D,t as re}from"./format-BUYXZqDw.js";import{t as O}from"./EmptyState-C5kVDHc7.js";var k=e(o(),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([f(`/channels`).catch(()=>({channels:[]})),f(`/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})}for(let e of t.channels)e.enabled&&e.platform===`email`&&typeof e.config.address==`string`&&a.push({id:`email:${e.id}`,channelId:e.id,channelName:e.name,platform:e.platform,chatId:e.config.address});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-[var(--app-text-muted)]`,children:n}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!a),className:`mt-1 w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-left text-sm text-[var(--app-text)] hover:border-[var(--app-border-strong)] focus:border-[var(--app-accent)] 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-[var(--app-border)] bg-[var(--app-panel-elevated)] py-1 shadow-lg`,children:[r.length===0?(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-[var(--app-text-subtle)]`,children:`No channel delivery targets available.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`px-3 py-1 text-xs text-[var(--app-text-subtle)]`,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-[var(--app-text)] hover:bg-[var(--app-panel-muted)]`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:s(e.channelId,e.chatId),onChange:()=>c(e.channelId,e.chatId),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-muted)]`}),(0,A.jsx)(`span`,{className:`truncate font-medium`,children:e.channelName}),(0,A.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,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-[var(--app-border)] px-3 py-1 text-left text-xs text-[var(--app-danger)] hover:bg-[var(--app-panel-muted)]`,children:`Clear all`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`w-full border-t border-[var(--app-border)] px-3 py-1 text-left text-xs text-[var(--app-text-subtle)] hover:bg-[var(--app-panel-muted)]`,children:`Done`})]})]})}var M={active:`paused`,paused:`active`,completed:`active`,failed:`active`},N={active:(0,A.jsx)(a,{size:12}),paused:(0,A.jsx)(t,{size:12}),completed:(0,A.jsx)(l,{size:12}),failed:(0,A.jsx)(l,{size:12})};function P(){let e=g(e=>e.goals),a=g(e=>e.fetchGoals),o=g(e=>e.updateGoal),u=g(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,ie]=(0,k.useState)([]),[$,ae]=(0,k.useState)([]),oe=e.filter(e=>e.status===`active`).length,se=e.filter(e=>e.status===`paused`).length,ce=e.filter(e=>e.status===`completed`).length;(0,k.useEffect)(()=>{a();let e=setInterval(()=>void a(),1e4);return()=>clearInterval(e)},[a]);let le=async()=>{if(I.trim()){z(!0),V(null);try{await f(`/goals`,{method:`POST`,body:JSON.stringify({input:I.trim(),deliverTo:Q.length>0?Q:void 0,reportTo:$.length>0?$:void 0})}),L(``),F(!1),a()}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.jsx)(E,{eyebrow:`Operations`,title:`Goals`,compact:!0,description:`Long-running outcomes, budgets, and delivery targets.`,metrics:[{label:`Active`,value:oe},{label:`Paused`,value:se},{label:`Completed`,value:ce}],actions:(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(d,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:(0,A.jsx)(l,{size:14})}),(0,A.jsxs)(d,{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-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] 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:ie,label:`Deliver To (results)`}),(0,A.jsx)(j,{value:$,onChange:ae,label:`Report To (status)`}),B&&(0,A.jsx)(`p`,{className:`text-xs text-[var(--app-danger)]`,children:B}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(d,{onClick:()=>void le(),disabled:R||!I.trim(),children:R?`Creating...`:`Create`}),(0,A.jsx)(d,{variant:`ghost`,onClick:()=>F(!1),children:`Cancel`})]})]}),e.length===0?(0,A.jsx)(O,{icon:(0,A.jsx)(i,{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 i=e.targetValue>0?Math.min(100,Math.round(e.currentValue/e.targetValue*100)):0,a=new Date(e.deadline).getTime()<Date.now()&&e.status!==`completed`,c=H===e.id;return(0,A.jsxs)(T,{children:[(0,A.jsxs)(ne,{children:[c?(0,A.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:W,onChange:e=>G(e.target.value),autoFocus:!0}):(0,A.jsx)(w,{className:`max-w-full text-[var(--app-text)] text-sm font-medium truncate sm:max-w-[180px]`,children:e.name}),(0,A.jsx)(C,{variant:v(e.status),children:e.status})]}),c?(0,A.jsx)(`textarea`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] 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-[var(--app-text-muted)] mb-3 line-clamp-2`,children:e.description}):null,c&&(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-[var(--app-text-subtle)]`,children:`Progress`}),(0,A.jsxs)(`span`,{className:`font-mono text-xs text-[var(--app-text)]`,children:[i,`%`]})]}),(0,A.jsx)(`div`,{className:`h-1.5 rounded-full bg-[var(--app-panel-elevated)]`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full transition-[width] ${i>=100?`bg-[var(--app-success)]`:`bg-[var(--app-accent)]`}`,style:{width:`${i}%`}})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--app-text-subtle)]`,children:[e.currentValue,` / `,e.targetValue]}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--app-text-subtle)]`,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-[var(--app-text-subtle)]`,children:`Role`}),(0,A.jsx)(C,{variant:`muted`,className:`text-[10px]`,children:e.roleId})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Budget`}),(0,A.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:re(e.budgetUsd)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)] ${a?`text-[var(--app-danger)]`:``}`,children:`Deadline`}),(0,A.jsx)(`span`,{className:`text-[var(--app-text)] ${a?`text-[var(--app-danger)]`:``}`,children:D(e.deadline)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Created`}),(0,A.jsx)(`span`,{className:`text-[var(--app-text-muted)]`,children:D(e.createdAt)})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 mt-3 pt-3 border-t border-[var(--app-border)]`,children:c?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(d,{size:`sm`,variant:`ghost`,onClick:async()=>{try{await o(e.id,{name:W,description:K,deliverTo:J,reportTo:X}),U(null),b.success(`Goal updated`)}catch(e){b.error(e instanceof Error?e.message:`Failed to update`)}},children:`Save`}),(0,A.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>U(null),children:(0,A.jsx)(s,{size:14})})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(d,{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)(d,{size:`sm`,variant:`ghost`,title:`Change to ${M[e.status]}`,onClick:async()=>{try{await o(e.id,{status:M[e.status]}),b.success(`Status changed to ${M[e.status]}`)}catch(e){b.error(e instanceof Error?e.message:`Failed to update status`)}},children:[N[e.status]??(0,A.jsx)(t,{size:12}),(0,A.jsx)(`span`,{className:`text-xs`,children:M[e.status]})]}),(0,A.jsx)(`div`,{className:`ml-auto`,children:(0,A.jsxs)(x,{children:[(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(d,{size:`sm`,variant:`ghost`,title:`Delete`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,A.jsx)(r,{size:14})})}),(0,A.jsxs)(y,{children:[(0,A.jsxs)(_,{children:[(0,A.jsx)(te,{children:`Delete goal`}),(0,A.jsxs)(S,{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)(ee,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger-strong)]`,onClick:async()=>{try{await u(e.id),b.success(`Goal deleted`)}catch(e){b.error(e instanceof Error?e.message:`Failed to delete`)}},children:`Delete`})]})]})]})})]})})]},e.id)})})]})}export{P as Goals,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,J as n,k as r,mt as i,u as a}from"./vendor-icons-U4igmrUq.js";import{t as o}from"./vendor-react-Bp_V-Hsf.js";import{t as s}from"./Button-fLMsJd5o.js";import{f as c}from"./index-C-e-qpXc.js";import{t as l}from"./Card-cy-gHU0O.js";import{t as u}from"./PageHeader-BgNbz3JV.js";import{t as d}from"./EmptyState-C5kVDHc7.js";import{t as f}from"./ui-CerQw0jA.js";var p=e(i(),1),m=o(),h={debug:`text-[var(--app-text-subtle)]`,info:`text-[var(--app-accent)]`,warn:`text-[var(--app-warning)]`,error:`text-[var(--app-danger)]`},g={adam:`text-[var(--app-log-adam)]`,manager:`text-[var(--app-log-manager)]`,worker:`text-[var(--app-success)]`,scheduler:`text-[var(--app-log-scheduler)]`,api:`text-[var(--app-accent)]`,ws:`text-[var(--app-log-ws)]`,store:`text-[var(--app-log-store)]`,embedding:`text-[var(--app-log-embedding)]`},_=[`adam`,`manager`,`worker`,`scheduler`,`api`,`ws`,`store`,`embedding`],v=[`debug`,`info`,`warn`,`error`];function y(){let e=c(e=>e.logs),i=(0,p.useRef)(null),[o,y]=(0,p.useState)(!0),[x,S]=(0,p.useState)(null),[C,w]=(0,p.useState)(null),T=(0,p.useMemo)(()=>e.filter(e=>!(x&&e.level!==x||C&&e.component!==C)),[e,x,C]);return(0,p.useEffect)(()=>{o&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[T,o]),(0,m.jsxs)(`div`,{className:`flex h-full flex-col gap-5`,children:[(0,m.jsx)(u,{title:`Logs`,compact:!0,description:`Backend events with inline filters and a stable reading surface.`,metrics:[{label:`Visible`,value:T.length},{label:`Total`,value:e.length},{label:`Mode`,value:o?`Live`:`Paused`}],className:`px-4 py-3 lg:px-4 lg:py-3`,actions:(0,m.jsxs)(`div`,{className:`flex gap-2`,children:[(0,m.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>y(!o),title:o?`Pause auto-scroll`:`Resume auto-scroll`,children:o?(0,m.jsx)(r,{size:f.sm}):(0,m.jsx)(t,{size:f.sm})}),(0,m.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>{c.setState({logs:[]})},title:`Clear logs`,children:(0,m.jsx)(n,{size:f.sm})})]})}),(0,m.jsx)(l,{className:`surface-panel-muted py-3`,children:(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Level:`}),(0,m.jsxs)(`div`,{className:`flex gap-1`,children:[(0,m.jsx)(b,{active:x===null,onClick:()=>S(null),children:`All`}),v.map(e=>(0,m.jsx)(b,{active:x===e,onClick:()=>S(x===e?null:e),children:e},e))]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Component:`}),(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,m.jsx)(b,{active:C===null,onClick:()=>w(null),children:`All`}),_.map(e=>(0,m.jsx)(b,{active:C===e,onClick:()=>w(C===e?null:e),children:e},e))]})]})]})}),(0,m.jsx)(l,{padding:!1,className:`flex-1 min-h-0`,children:T.length===0?(0,m.jsx)(`div`,{className:`p-4`,children:(0,m.jsx)(d,{icon:(0,m.jsx)(a,{size:32}),title:`No log entries`,description:`Log events will appear here in real-time via WebSocket.`,compact:!0,className:`min-h-[10rem]`})}):(0,m.jsx)(`div`,{ref:i,className:`h-full max-h-[calc(100vh-280px)] overflow-y-auto p-3 font-mono text-xs leading-5`,children:T.map((e,t)=>{let n=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3}),r=h[e.level]??`text-[var(--app-text-muted)]`,i=g[e.component]??`text-[var(--app-text-muted)]`;return(0,m.jsxs)(`div`,{className:`flex gap-2 hover:bg-[var(--app-panel-elevated)]/30 px-1 rounded`,children:[(0,m.jsx)(`span`,{className:`text-[var(--app-text-subtle)] shrink-0`,children:n}),(0,m.jsx)(`span`,{className:`w-12 shrink-0 uppercase ${r}`,children:e.level.padEnd(5)}),(0,m.jsxs)(`span`,{className:`w-20 shrink-0 ${i}`,children:[`[`,e.component,`]`]}),(0,m.jsx)(`span`,{className:`text-[var(--app-text)] break-all`,children:e.msg})]},t)})})}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-[var(--app-text-subtle)]`,children:[(0,m.jsxs)(`span`,{children:[T.length,` entries `,T.length!==e.length&&`(${e.length} total)`]}),(0,m.jsx)(`span`,{children:o?`Following live feed`:`Scroll paused`})]})]})}function b({active:e,onClick:t,children:n}){return(0,m.jsx)(`button`,{onClick:t,className:`rounded px-2 py-0.5 text-xs transition-colors ${e?`bg-[var(--app-panel-muted)] text-[var(--app-text)]`:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n})}export{y as Logs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{lt as t,mt as n,v as r,x as i}from"./vendor-icons-U4igmrUq.js";import{t as a}from"./vendor-react-Bp_V-Hsf.js";import{t as o}from"./Button-fLMsJd5o.js";import{t as s}from"./api-BkdixMz9.js";import{f as c,t as l}from"./index-C-e-qpXc.js";import{t as u}from"./Card-cy-gHU0O.js";import{t as d}from"./PageHeader-BgNbz3JV.js";import{t as f}from"./SectionHeader-CwX6m1f6.js";import{a as p}from"./format-BUYXZqDw.js";import{t as m}from"./EmptyState-C5kVDHc7.js";var h=e(n(),1),g=a();function _(){let e=c(e=>e.roles),n=c(e=>e.fetchRoles),[a,_]=(0,h.useState)(``),[v,y]=(0,h.useState)([]),[b,x]=(0,h.useState)(!1),[S,C]=(0,h.useState)(``),[w,T]=(0,h.useState)(!1),[E,D]=(0,h.useState)(`all`),[O,k]=(0,h.useState)(new Set);(0,h.useEffect)(()=>{n()},[n]),(0,h.useEffect)(()=>{!a&&e.length>0&&_(e[0].id)},[e,a]);let A=(0,h.useCallback)(async()=>{if(a){x(!0);try{y((await s(`/memories/${a}?limit=100`)).memories)}catch{y([])}finally{x(!1)}}},[a]);(0,h.useEffect)(()=>{a&&A()},[a,A]);let j=async()=>{if(!(!S.trim()||!a)){T(!0);try{y((await s(`/memories/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agentId:a,prompt:S.trim(),topK:20})})).memories)}catch{y([])}finally{T(!1)}}},M=()=>{C(``),A()},N=v.filter(e=>E===`high`?e.importance>3:E===`medium`?e.importance===3:E===`low`?e.importance<3:!0),P=e=>e>=4?`text-[var(--app-danger)]`:e===3?`text-[var(--app-warning)]`:`text-[var(--app-text-subtle)]`;return(0,g.jsxs)(`div`,{className:`space-y-5`,children:[(0,g.jsx)(d,{eyebrow:`Knowledge`,title:`Memories`,compact:!0,description:`What each role is retaining and how retrieval changes the visible recall set.`,metrics:[{label:`Role`,value:e.find(e=>e.id===a)?.name??`None`},{label:`Visible`,value:N.length},{label:`High Importance`,value:v.filter(e=>e.importance>3).length}],actions:(0,g.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void A(),children:(0,g.jsx)(i,{size:14})})}),(0,g.jsx)(f,{title:`Recall Controls`,compact:!0,description:`Switch role context, run a retrieval query, or narrow by importance.`}),(0,g.jsx)(u,{className:`surface-panel-muted`,children:(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,g.jsx)(`select`,{className:`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:a,onChange:e=>_(e.target.value),children:e.map(e=>(0,g.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,g.jsx)(`input`,{className:`w-64 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder-slate-600 focus:border-[var(--app-accent)] focus:outline-none`,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>e.key===`Enter`&&void j(),placeholder:`Search memories...`}),(0,g.jsx)(o,{size:`sm`,variant:`ghost`,onClick:()=>void j(),disabled:w,children:(0,g.jsx)(r,{size:14})}),S&&(0,g.jsx)(o,{size:`sm`,variant:`ghost`,onClick:M,children:`Clear`})]}),(0,g.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`high`,`medium`,`low`].map(e=>(0,g.jsx)(`button`,{className:`rounded px-2 py-1 text-xs transition-colors ${E===e?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>D(e),children:e},e))})]})}),(0,g.jsx)(u,{children:b||w?(0,g.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,g.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):N.length===0?(0,g.jsx)(m,{icon:(0,g.jsx)(t,{size:32}),title:`No memories`,description:S?`No results for this query`:`This agent has no memories yet`,className:`py-8`}):(0,g.jsxs)(`div`,{className:`space-y-3`,children:[(0,g.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[N.length,` memories`]}),N.map(e=>(0,g.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] p-3`,children:[(0,g.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,g.jsx)(l,{variant:e.type===`reflection`?`info`:e.type===`thought`?`warning`:`muted`,children:e.type}),(0,g.jsx)(l,{variant:`muted`,children:e.sourceType}),(0,g.jsx)(`span`,{className:`text-xs font-medium ${P(e.importance)}`,children:`*`.repeat(e.importance)}),e.score!=null&&(0,g.jsxs)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:[`score: `,e.score.toFixed(3)]})]}),(0,g.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-[var(--app-text)]`,children:e.content}),(0,g.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:e.keywords.map(e=>(0,g.jsx)(`span`,{className:`rounded bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-[10px] text-[var(--app-text-subtle)]`,children:e},e))}),e.type===`reflection`&&e.evidence&&e.evidence.length>0&&(0,g.jsxs)(`div`,{className:`mt-2`,children:[(0,g.jsxs)(`button`,{className:`text-[10px] text-[var(--app-accent)] hover:text-[var(--app-accent)]`,onClick:()=>k(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[O.has(e.id)?`Hide`:`Show`,` evidence (`,e.evidence.length,` memories)`]}),O.has(e.id)&&(0,g.jsx)(`div`,{className:`mt-1.5 space-y-1 border-l-2 border-[var(--app-border)] pl-2`,children:e.evidence.map(e=>{let t=v.find(t=>t.id===e);return(0,g.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:t?t.content.slice(0,120)+(t.content.length>120?`...`:``):(0,g.jsxs)(`span`,{className:`italic`,children:[`Memory `,e.slice(0,8),` (not in current view)`]})},e)})})]}),(0,g.jsxs)(`p`,{className:`mt-1.5 text-[10px] text-[var(--app-text-subtle)]`,children:[p(e.createdAt),` | accessed `,e.retrievedCount,`x | last: `,p(e.lastAccessed)]})]},e.id))]})})]})}export{_ as Memories};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{mt as t}from"./vendor-icons-U4igmrUq.js";import{t as n}from"./vendor-react-Bp_V-Hsf.js";import{t as r}from"./Button-fLMsJd5o.js";import{f as i,y as a}from"./api-BkdixMz9.js";import{t as o}from"./index-C-e-qpXc.js";import{t as s}from"./Card-cy-gHU0O.js";import{t as c}from"./SectionHeader-CwX6m1f6.js";import{t as l}from"./EmptyState-C5kVDHc7.js";var u=e(t(),1),d=n(),f={new:`muted`,acknowledged:`success`,dismissed:`secondary`};function p(e){let t=Date.now()-e;if(Math.floor(t/6e4)<1)return`just now`;let n=Math.floor(t/36e5);return n<24?`${n}h ago`:`${Math.floor(t/864e5)}d ago`}function m(e){return new Date(e).toLocaleString()}function h(){let[e,t]=(0,u.useState)([]),[n,h]=(0,u.useState)(!0),[g,_]=(0,u.useState)(`all`),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null),S=(0,u.useCallback)(async()=>{h(!0);try{t(await i(g===`all`?void 0:g))}catch{t([])}finally{h(!1)}},[g]);(0,u.useEffect)(()=>{S()},[S]);let C=async(e,t)=>{x(e);try{await a(e,t),await S()}finally{x(null)}};return(0,d.jsxs)(`div`,{className:`space-y-5`,children:[(0,d.jsx)(c,{title:`Mistake Patterns`,description:`Cross-role failure patterns extracted from audit data.`,compact:!0,action:(0,d.jsx)(r,{variant:`ghost`,size:`sm`,onClick:()=>void S(),children:`Refresh`})}),(0,d.jsx)(`div`,{className:`flex gap-2`,children:[`all`,`new`,`acknowledged`,`dismissed`].map(e=>(0,d.jsx)(`button`,{type:`button`,onClick:()=>_(e),className:`rounded px-3 py-1.5 text-xs font-medium transition-colors ${g===e?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:e===`all`?`All`:e.charAt(0).toUpperCase()+e.slice(1)},e))}),n?(0,d.jsx)(s,{children:(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text-muted)]`,children:`Loading...`})}):e.length===0?(0,d.jsx)(s,{children:(0,d.jsx)(l,{title:`No mistake patterns`,description:`Run the Mistake Digest template to aggregate failure signals from audit data.`})}):(0,d.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,d.jsxs)(s,{padding:!1,children:[(0,d.jsx)(`div`,{className:`p-4 cursor-pointer hover:bg-black/[0.02]`,onClick:()=>y(v===e.id?null:e.id),role:`button`,tabIndex:0,onKeyDown:t=>{t.key===`Enter`&&y(v===e.id?null:e.id)},children:(0,d.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,d.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,d.jsx)(o,{variant:f[e.status],children:e.status}),(0,d.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:p(e.lastSeen)}),(0,d.jsx)(`span`,{className:`rounded border border-[var(--app-border)] px-1.5 py-0.5 text-[10px] text-[var(--app-text-muted)] font-mono`,children:e.dimensionType})]}),(0,d.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.dimensionValue}),(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:[e.count,` occurrence`,e.count===1?``:`s`,` across `,e.roleIds.length,` role`,e.roleIds.length===1?``:`s`]})]})})}),v===e.id&&(0,d.jsxs)(`div`,{className:`border-t border-[var(--app-border)] p-4 space-y-3`,children:[(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Dimension`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)] font-mono`,children:e.dimensionType})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Dimension Value`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)] font-mono break-all`,children:e.dimensionValue})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Affected Roles`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)]`,children:e.roleIds.length>0?e.roleIds.join(`, `):`—`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Evidence Items`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)]`,children:e.sampleEvidenceIds.length>0?(0,d.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[e.sampleEvidenceIds.slice(0,5).map(e=>(0,d.jsxs)(`span`,{className:`text-xs`,children:[(0,d.jsx)(`span`,{className:`rounded border border-[var(--app-border)] px-1 py-0.5 text-[10px] font-mono`,children:e.source}),` `,e.id]},e.id)),e.sampleEvidenceIds.length>5&&(0,d.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,e.sampleEvidenceIds.length-5,` more`]})]}):`—`})]})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-4 pt-1`,children:[(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`First seen: `,m(e.firstSeen)]}),(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Last seen: `,m(e.lastSeen)]})]}),(0,d.jsx)(`div`,{className:`flex gap-2 pt-1`,children:[`new`,`acknowledged`,`dismissed`].map(t=>(0,d.jsx)(r,{variant:e.status===t?`default`:`ghost`,size:`sm`,disabled:b===e.id||e.status===t,onClick:n=>{n.stopPropagation(),C(e.id,t)},children:t.charAt(0).toUpperCase()+t.slice(1)},t))})]})]},e.id))})]})}export{h as Mistakes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-icons-
|
|
1
|
+
import"./vendor-icons-U4igmrUq.js";import{r as e,t}from"./vendor-react-Bp_V-Hsf.js";var n=t();function r(){return(0,n.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 text-[var(--app-text-muted)]`,children:[(0,n.jsx)(`span`,{className:`text-6xl font-bold text-[var(--app-text-subtle)]`,children:`404`}),(0,n.jsx)(`p`,{className:`text-lg`,children:`Page not found`}),(0,n.jsx)(e,{to:`/`,className:`text-[var(--app-accent)] hover:text-[var(--app-accent)] underline`,children:`Back to Dashboard`})]})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vendor-react-
|
|
1
|
+
import{t as e}from"./vendor-react-Bp_V-Hsf.js";import{n as t}from"./dist-CgGno8kE.js";var n=e();function r({title:e,description:r,eyebrow:i,metrics:a,actions:o,compact:s=!1,className:c}){return(0,n.jsx)(`section`,{className:t(`surface-panel-elevated rounded-xl`,s?`px-4 py-4 lg:px-5 lg:py-5`:`px-5 py-5 lg:px-6 lg:py-6`,c),children:(0,n.jsxs)(`div`,{className:t(`flex flex-col lg:flex-row lg:justify-between`,s?`gap-3 lg:items-start`:`gap-4 lg:items-end`),children:[(0,n.jsxs)(`div`,{className:t(s?`space-y-1.5`:`space-y-2`),children:[i?(0,n.jsx)(`p`,{className:`text-kicker`,children:i}):null,(0,n.jsxs)(`div`,{className:t(s?`space-y-0.5`:`space-y-1`),children:[(0,n.jsx)(`h1`,{className:`text-title`,children:e}),r?(0,n.jsx)(`p`,{className:t(`max-w-2xl text-sm text-[var(--app-text-muted)]`,s?`leading-5`:`leading-6`),children:r}):null]}),a&&a.length>0?(0,n.jsx)(`div`,{className:t(`flex flex-wrap gap-x-4 gap-y-2 pt-1`,s?`pt-0.5`:`pt-1`),children:a.map(e=>(0,n.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,n.jsx)(`span`,{className:`block text-[10px] uppercase tracking-[0.18em] text-[var(--app-text-subtle)]`,children:e.label}),(0,n.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.value})]},e.label))}):null]}),o?(0,n.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 lg:w-auto lg:justify-end`,children:o}):null]})})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{C as t,F as n,H as r,X as i,Y as a,at as o,ct as s,mt as c,n as l,ot as u,st as d,tt as f,v as ee,w as te,x as ne}from"./vendor-icons-U4igmrUq.js";import{t as re}from"./vendor-react-Bp_V-Hsf.js";import{n as p}from"./dist-CgGno8kE.js";import{_ as ie,a as ae,c as m,d as h,f as g,i as oe,m as _,n as se,o as v,p as y,r as b,s as x,t as ce,u as le,v as S}from"./es2015-JqLIWAgH.js";import{i as C,r as w,t as T}from"./Button-fLMsJd5o.js";import{t as E}from"./api-BkdixMz9.js";import{S as D,_ as ue,b as de,g as O,h as k,m as fe,p as A,t as j,v as pe,x as M,y as me}from"./index-C-e-qpXc.js";import{t as N}from"./Card-cy-gHU0O.js";import{t as he}from"./PageHeader-BgNbz3JV.js";import{t as ge}from"./SectionHeader-CwX6m1f6.js";import{a as _e}from"./format-BUYXZqDw.js";import{t as ve}from"./EmptyState-C5kVDHc7.js";import{t as P}from"./ui-CerQw0jA.js";import{a as ye,i as F,n as be,o as I,r as L,t as xe}from"./Table-BrERwl-F.js";import{n as Se,r as Ce,t as we}from"./usePluginsWithUsage-Ch9WCFTb.js";import{a as Te,c as Ee,i as De,l as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne}from"./Tabs-CGHmpUAD.js";var R=e(c(),1),z=re();function Pe(){let[e,t]=(0,R.useState)(!1),[n,r]=(0,R.useState)([]),i=(0,R.useCallback)(async()=>{try{r((await E(`/plugins/stats?limit=20`)).stats)}catch{r([])}},[]);return(0,z.jsxs)(N,{children:[(0,z.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>{!e&&n.length===0&&i(),t(e=>!e)},children:[(0,z.jsx)(s,{size:P.sm,className:`text-[var(--app-text-muted)]`}),`Usage Stats`,e?(0,z.jsx)(u,{size:P.xs,className:`ml-auto`}):(0,z.jsx)(o,{size:P.xs,className:`ml-auto`})]}),e?(0,z.jsx)(`div`,{className:`mt-3`,children:n.length===0?(0,z.jsx)(`p`,{className:`py-2 text-center text-xs text-[var(--app-text-subtle)]`,children:`No usage data yet`}):(0,z.jsxs)(xe,{children:[(0,z.jsx)(ye,{children:(0,z.jsxs)(I,{children:[(0,z.jsx)(F,{children:`Plugin`}),(0,z.jsx)(F,{children:`Usage Count`}),(0,z.jsx)(F,{children:`Last Used`})]})}),(0,z.jsx)(be,{children:n.map(e=>(0,z.jsxs)(I,{children:[(0,z.jsx)(L,{className:`text-xs font-medium text-[var(--app-text)]`,children:e.pluginName}),(0,z.jsx)(L,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.usageCount}),(0,z.jsx)(L,{className:`text-xs text-[var(--app-text-muted)]`,children:e.lastUsed?_e(e.lastUsed):`—`})]},e.pluginPath))})]})}):null]})}var Fe=[`Enter`,` `],Ie=[`ArrowDown`,`PageUp`,`Home`],Le=[`ArrowUp`,`PageDown`,`End`],Re=[...Ie,...Le],ze={ltr:[...Fe,`ArrowRight`],rtl:[...Fe,`ArrowLeft`]},Be={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B=`Menu`,[V,Ve,He]=Oe(B),[H,Ue]=ie(B,[He,D,Me]),U=D(),We=Me(),[Ge,W]=H(B),[Ke,G]=H(B),qe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=U(t),[c,l]=R.useState(null),u=R.useRef(!1),d=h(a),f=Ee(i);return R.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(M,{...s,children:(0,z.jsx)(Ge,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(Ke,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};qe.displayName=B;var Je=`MenuAnchor`,Ye=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,z.jsx)(pe,{...i,...r,ref:t})});Ye.displayName=Je;var Xe=`MenuPortal`,[Ze,Qe]=H(Xe,{forceMount:void 0}),$e=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=W(Xe,t);return(0,z.jsx)(Ze,{scope:t,forceMount:n,children:(0,z.jsx)(v,{present:n||a.open,children:(0,z.jsx)(x,{asChild:!0,container:i,children:r})})})};$e.displayName=Xe;var K=`MenuContent`,[et,tt]=H(K),nt=R.forwardRef((e,t)=>{let n=Qe(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=W(K,e.__scopeMenu),o=G(K,e.__scopeMenu);return(0,z.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(v,{present:r||a.open,children:(0,z.jsx)(V.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(rt,{...i,ref:t}):(0,z.jsx)(it,{...i,ref:t})})})})}),rt=R.forwardRef((e,t)=>{let n=W(K,e.__scopeMenu),r=R.useRef(null),i=C(t,r);return R.useEffect(()=>{let e=r.current;if(e)return ce(e)},[]),(0,z.jsx)(ot,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),it=R.forwardRef((e,t)=>{let n=W(K,e.__scopeMenu);return(0,z.jsx)(ot,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),at=_(`MenuContent.ScrollLock`),ot=R.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:ee,disableOutsideScroll:te,...ne}=e,re=W(K,n),p=G(K,n),ie=U(n),ae=We(n),m=Ve(n),[h,g]=R.useState(null),_=R.useRef(null),v=C(t,_,re.onContentChange),y=R.useRef(0),x=R.useRef(``),ce=R.useRef(0),w=R.useRef(null),T=R.useRef(`right`),E=R.useRef(0),D=te?se:R.Fragment,ue=te?{as:at,allowPinchZoom:!0}:void 0,O=e=>{let t=x.current+e,n=m().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Bt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){x.current=t,window.clearTimeout(y.current),t!==``&&(y.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};R.useEffect(()=>()=>window.clearTimeout(y.current),[]),b();let k=R.useCallback(e=>T.current===w.current?.side&&Ht(e,w.current?.area),[]);return(0,z.jsx)(et,{scope:n,searchRef:x,onItemEnter:R.useCallback(e=>{k(e)&&e.preventDefault()},[k]),onItemLeave:R.useCallback(e=>{k(e)||(_.current?.focus(),g(null))},[k]),onTriggerLeave:R.useCallback(e=>{k(e)&&e.preventDefault()},[k]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:R.useCallback(e=>{w.current=e},[]),children:(0,z.jsx)(D,{...ue,children:(0,z.jsx)(oe,{asChild:!0,trapped:i,onMountAutoFocus:S(a,e=>{e.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(le,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:ee,children:(0,z.jsx)(Ae,{asChild:!0,...ae,dir:p.dir,orientation:`vertical`,loop:r,currentTabStopId:h,onCurrentTabStopIdChange:g,onEntryFocus:S(c,e=>{p.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(de,{role:`menu`,"aria-orientation":`vertical`,"data-state":It(re.open),"data-radix-menu-content":``,dir:p.dir,...ie,...ne,ref:v,style:{outline:`none`,...ne.style},onKeyDown:S(ne.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&O(e.key));let i=_.current;if(e.target!==i||!Re.includes(e.key))return;e.preventDefault();let a=m().filter(e=>!e.disabled).map(e=>e.ref.current);Le.includes(e.key)&&a.reverse(),Rt(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(y.current),x.current=``)}),onPointerMove:S(e.onPointerMove,Z(e=>{let t=e.target,n=E.current!==e.clientX;e.currentTarget.contains(t)&&n&&(T.current=e.clientX>E.current?`right`:`left`,E.current=e.clientX)}))})})})})})})});nt.displayName=K;var st=`MenuGroup`,ct=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(g.div,{role:`group`,...r,ref:t})});ct.displayName=st;var lt=`MenuLabel`,ut=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(g.div,{...r,ref:t})});ut.displayName=lt;var q=`MenuItem`,dt=`menu.itemSelect`,J=R.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=R.useRef(null),o=G(q,e.__scopeMenu),s=tt(q,e.__scopeMenu),c=C(t,a),l=R.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(dt,{bubbles:!0,cancelable:!0});e.addEventListener(dt,e=>r?.(e),{once:!0}),y(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(ft,{...i,ref:c,disabled:n,onClick:S(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:S(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Fe.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var ft=R.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=tt(q,n),s=We(n),c=R.useRef(null),l=C(t,c),[u,d]=R.useState(!1),[f,ee]=R.useState(``);return R.useEffect(()=>{let e=c.current;e&&ee((e.textContent??``).trim())},[a.children]),(0,z.jsx)(V.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(Te,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(g.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:S(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:S(e.onFocus,()=>d(!0)),onBlur:S(e.onBlur,()=>d(!1))})})})}),pt=`MenuCheckboxItem`,mt=R.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(St,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":Lt(n),onSelect:S(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});mt.displayName=pt;var ht=`MenuRadioGroup`,[gt,_t]=H(ht,{value:void 0,onValueChange:()=>{}}),vt=R.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=h(r);return(0,z.jsx)(gt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(ct,{...i,ref:t})})});vt.displayName=ht;var yt=`MenuRadioItem`,bt=R.forwardRef((e,t)=>{let{value:n,...r}=e,i=_t(yt,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(St,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Lt(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});bt.displayName=yt;var xt=`MenuItemIndicator`,[St,Ct]=H(xt,{checked:!1}),wt=R.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Ct(xt,n);return(0,z.jsx)(v,{present:r||X(a.checked)||a.checked===!0,children:(0,z.jsx)(g.span,{...i,ref:t,"data-state":Lt(a.checked)})})});wt.displayName=xt;var Tt=`MenuSeparator`,Et=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(g.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Et.displayName=Tt;var Dt=`MenuArrow`,Ot=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,z.jsx)(me,{...i,...r,ref:t})});Ot.displayName=Dt;var kt=`MenuSub`,[At,jt]=H(kt),Mt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=W(kt,t),o=U(t),[s,c]=R.useState(null),[l,u]=R.useState(null),d=h(i);return R.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(M,{...o,children:(0,z.jsx)(Ge,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(At,{scope:t,contentId:m(),triggerId:m(),trigger:s,onTriggerChange:c,children:n})})})};Mt.displayName=kt;var Y=`MenuSubTrigger`,Nt=R.forwardRef((e,t)=>{let n=W(Y,e.__scopeMenu),r=G(Y,e.__scopeMenu),i=jt(Y,e.__scopeMenu),a=tt(Y,e.__scopeMenu),o=R.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(Ye,{asChild:!0,...l,children:(0,z.jsx)(ft,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":It(n.open),...e,ref:w(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:S(e.onPointerLeave,Z(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ze[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Nt.displayName=Y;var Pt=`MenuSubContent`,Ft=R.forwardRef((e,t)=>{let n=Qe(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=W(K,e.__scopeMenu),o=G(K,e.__scopeMenu),s=jt(Pt,e.__scopeMenu),c=R.useRef(null),l=C(t,c);return(0,z.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(v,{present:r||a.open,children:(0,z.jsx)(V.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(ot,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:S(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Be[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Ft.displayName=Pt;function It(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function Lt(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function Rt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ht(e,t){return t?Vt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Ut=qe,Wt=Ye,Gt=$e,Kt=nt,qt=ct,Jt=ut,Yt=J,Xt=mt,Zt=vt,Qt=bt,$t=wt,en=Et,tn=Ot,nn=Nt,rn=Ft,an=`DropdownMenu`,[on,sn]=ie(an,[Ue]),Q=Ue(),[cn,ln]=on(an),un=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Q(t),l=R.useRef(null),[u,d]=ae({prop:i,defaultProp:a??!1,onChange:o,caller:an});return(0,z.jsx)(cn,{scope:t,triggerId:m(),triggerRef:l,contentId:m(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(Ut,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};un.displayName=an;var dn=`DropdownMenuTrigger`,fn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ln(dn,n),o=Q(n);return(0,z.jsx)(Wt,{asChild:!0,...o,children:(0,z.jsx)(g.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:w(t,a.triggerRef),onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});fn.displayName=dn;var pn=`DropdownMenuPortal`,mn=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Q(t);return(0,z.jsx)(Gt,{...r,...n})};mn.displayName=pn;var hn=`DropdownMenuContent`,gn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ln(hn,n),a=Q(n),o=R.useRef(!1);return(0,z.jsx)(Kt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gn.displayName=hn;var _n=`DropdownMenuGroup`,vn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(qt,{...i,...r,ref:t})});vn.displayName=_n;var yn=`DropdownMenuLabel`,bn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(Jt,{...i,...r,ref:t})});bn.displayName=yn;var xn=`DropdownMenuItem`,Sn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(Yt,{...i,...r,ref:t})});Sn.displayName=xn;var Cn=`DropdownMenuCheckboxItem`,wn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(Xt,{...i,...r,ref:t})});wn.displayName=Cn;var Tn=`DropdownMenuRadioGroup`,En=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(Zt,{...i,...r,ref:t})});En.displayName=Tn;var Dn=`DropdownMenuRadioItem`,On=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(Qt,{...i,...r,ref:t})});On.displayName=Dn;var kn=`DropdownMenuItemIndicator`,An=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)($t,{...i,...r,ref:t})});An.displayName=kn;var jn=`DropdownMenuSeparator`,Mn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(en,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`DropdownMenuArrow`,Pn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(tn,{...i,...r,ref:t})});Pn.displayName=Nn;var Fn=`DropdownMenuSubTrigger`,In=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(nn,{...i,...r,ref:t})});In.displayName=Fn;var Ln=`DropdownMenuSubContent`,Rn=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,z.jsx)(rn,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Rn.displayName=Ln;var zn=un,Bn=fn,Vn=mn,Hn=gn,Un=bn,Wn=Sn,Gn=wn,Kn=On,qn=An,Jn=Mn,Yn=In,Xn=Rn,Zn=zn,Qn=Bn,$n=R.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,z.jsxs)(Yn,{ref:i,className:p(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-[var(--app-panel-elevated)] data-[state=open]:bg-[var(--app-panel-elevated)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,z.jsx)(o,{className:`ml-auto`})]}));$n.displayName=Yn.displayName;var er=R.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Xn,{ref:n,className:p(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--app-border)] bg-[var(--app-panel)] p-1 text-[var(--app-text)] shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));er.displayName=Xn.displayName;var tr=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,z.jsx)(Vn,{children:(0,z.jsx)(Hn,{ref:r,sideOffset:t,className:p(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--app-border)] bg-[var(--app-panel)] p-1 text-[var(--app-text)] shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));tr.displayName=Hn.displayName;var $=R.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Wn,{ref:r,className:p(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));$.displayName=Wn.displayName;var nr=R.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,z.jsxs)(Gn,{ref:i,className:p(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,z.jsx)(qn,{children:(0,z.jsx)(d,{className:`h-4 w-4`})})}),t]}));nr.displayName=Gn.displayName;var rr=R.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(Kn,{ref:r,className:p(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,z.jsx)(qn,{children:(0,z.jsx)(f,{className:`h-2 w-2 fill-current`})})}),t]}));rr.displayName=Kn.displayName;var ir=R.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Un,{ref:r,className:p(`px-2 py-1.5 text-sm font-semibold text-[var(--app-text)]`,t&&`pl-8`,e),...n}));ir.displayName=Un.displayName;var ar=R.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Jn,{ref:n,className:p(`-mx-1 my-1 h-px bg-[var(--app-panel-elevated)]`,e),...t}));ar.displayName=Jn.displayName;var or=({className:e,...t})=>(0,z.jsx)(`span`,{className:p(`ml-auto text-xs tracking-widest text-[var(--app-text-subtle)]`,e),...t});or.displayName=`DropdownMenuShortcut`;function sr({plugin:e}){let t=e.manifest;if(!t)return null;let n=[];return t.skills.length>0&&n.push({label:`Skill(${t.skills.length})`,variant:`info`}),t.agents.length>0&&n.push({label:`Agent(${t.agents.length})`,variant:`success`}),t.mcpServers.length>0&&n.push({label:`MCP(${t.mcpServers.length})`,variant:`warning`}),t.hooks.length>0&&n.push({label:`Hook(${t.hooks.length})`,variant:`default`}),t.lspServers.length>0&&n.push({label:`LSP(${t.lspServers.length})`,variant:`default`}),n.length===0?null:(0,z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:n.map(e=>(0,z.jsx)(j,{variant:e.variant,children:e.label},e.label))})}function cr({plugin:e,roles:t,onInstallToRole:r,onToggleGlobal:i,onUninstallUser:o,projectOperatingKey:s,userOperatingId:c}){let l=c===e.id;return(0,z.jsxs)(Zn,{modal:!1,children:[(0,z.jsx)(Qn,{asChild:!0,children:(0,z.jsx)(T,{variant:`ghost`,size:`sm`,className:`h-7 w-7 px-0`,"aria-label":`Manage ${e.name}`,children:l?(0,z.jsx)(n,{size:P.xs,className:`animate-spin`}):(0,z.jsx)(a,{size:P.sm})})}),(0,z.jsxs)(tr,{align:`end`,className:`min-w-[200px]`,children:[t.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ir,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Add to Role`}),t.map(t=>{let i=e.usedByRoles.some(e=>e.roleId===t.id),a=s===`${e.id}:${t.workspacePath}`;return(0,z.jsxs)($,{disabled:a||i,onSelect:()=>{r(e.id,t.workspacePath)},children:[(0,z.jsx)(`span`,{className:`flex-1`,children:t.name}),a?(0,z.jsx)(n,{size:P.xs,className:`animate-spin`}):i?(0,z.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`installed`}):null]},t.id)}),(0,z.jsx)(ar,{})]}):null,(0,z.jsx)($,{disabled:l,onSelect:()=>{i(e.id,!e.globalEnabled)},children:e.globalEnabled?`Disable`:`Enable`}),(0,z.jsx)($,{disabled:l,className:`text-[var(--app-danger)] focus:text-[var(--app-danger)]`,onSelect:()=>{o(e.id)},children:`Uninstall`})]})]})}function lr({plugin:e,roles:t,expandedContent:n,onInstallToRole:r,onToggleGlobal:i,onUninstallUser:a,projectOperatingKey:s,userOperatingId:c}){let[l,d]=(0,R.useState)(!1),f=e.usedByRoles.map(e=>`${e.roleName} (v${e.version})`).join(`, `)||`No Roles`;return(0,z.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] px-3 py-2`,children:[(0,z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,z.jsx)(`button`,{className:`mt-0.5 text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,onClick:()=>d(e=>!e),"aria-label":l?`Collapse ${e.name}`:`Expand ${e.name}`,children:l?(0,z.jsx)(u,{size:P.xs}):(0,z.jsx)(o,{size:P.xs})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.name}),(0,z.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`v`,e.version]}),e.marketplace?(0,z.jsx)(j,{variant:`muted`,className:`text-[10px]`,children:e.marketplace}):null,(0,z.jsx)(O,{delayDuration:150,children:(0,z.jsxs)(fe,{children:[(0,z.jsx)(ue,{asChild:!0,children:(0,z.jsxs)(`button`,{className:`text-xs text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,title:f,children:[e.usedByRoles.length,` `,e.usedByRoles.length===1?`Role`:`Roles`]})}),(0,z.jsx)(k,{children:f})]})})]}),(0,z.jsx)(sr,{plugin:e})]}),(0,z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,z.jsx)(j,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`}),(0,z.jsx)(cr,{plugin:e,roles:t,onInstallToRole:r,onToggleGlobal:i,onUninstallUser:a,projectOperatingKey:s,userOperatingId:c})]})]}),l?(0,z.jsx)(`div`,{className:`mt-4 rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:n}):null]})}function ur({label:e,value:t}){return(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:e}),(0,z.jsx)(`p`,{className:`mt-1 text-sm font-medium text-[var(--app-text)]`,children:t})]})}function dr({plugin:e}){return e.manifest?(0,z.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[e.manifest.description?(0,z.jsx)(`p`,{className:`text-[var(--app-text-muted)]`,children:e.manifest.description}):null,(0,z.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-4`,children:[(0,z.jsx)(ur,{label:`Version`,value:e.version?`v${e.version}`:`—`}),(0,z.jsx)(ur,{label:`Scope`,value:e.scope}),(0,z.jsx)(ur,{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,z.jsx)(ur,{label:`Activation`,value:e.globalEnabled?`User On`:`User Off`})]}),(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install Path`}),(0,z.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-[var(--app-text-muted)]`,title:e.installPath,children:e.installPath})]}),(0,z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e.manifest.skills.length>0?(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Skills`}),e.manifest.skills.map(e=>(0,z.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,z.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,z.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}):null,e.manifest.agents.length>0?(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Agents`}),e.manifest.agents.map(e=>(0,z.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,z.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,z.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}):null,e.manifest.mcpServers.length>0?(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,z.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null,e.manifest.hooks.length>0?(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,z.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null,e.manifest.lspServers.length>0?(0,z.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`LSP Servers`}),e.manifest.lspServers.map(e=>(0,z.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null]})]}):(0,z.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading manifest...`})}function fr(){let{userScope:e,projectScope:a,loading:o,error:s,refresh:c,rawPlugins:d,roles:f}=we(),[re,p]=(0,R.useState)(`installed`),[ie,ae]=(0,R.useState)([]),[m,h]=(0,R.useState)([]),[g,oe]=(0,R.useState)(new Set),[_,se]=(0,R.useState)(!1),[v,y]=(0,R.useState)(null),[b,x]=(0,R.useState)(``),[ce,le]=(0,R.useState)(!1),[S,C]=(0,R.useState)(``),[w,D]=(0,R.useState)(null),[ue,de]=(0,R.useState)(null),{operatingKey:O,installToRole:k,uninstallFromRole:fe,updateRoleVersion:pe}=Se(c),M=(0,R.useCallback)(async()=>{se(!0),y(null);try{let[e,t]=await Promise.all([E(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),E(`/plugins/marketplaces`)]);h(e.available),oe(new Set(e.installed.map(e=>e.id))),ae(t.sources)}catch(e){y(e instanceof Error?e.message:`Failed to load marketplace`)}finally{se(!1)}},[]);(0,R.useEffect)(()=>{M()},[M]);let me=(0,R.useCallback)(async(e,t)=>{D(e);try{await E(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),A.success(`${e} ${t?`enabled`:`disabled`} globally`)}catch(e){A.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{await c(),D(null)}},[c]),_e=(0,R.useCallback)(async e=>{D(e);try{await E(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),A.success(`Plugin uninstalled`)}catch(e){A.error(e instanceof Error?e.message:`Uninstall failed`)}finally{await Promise.all([c(),M()]),D(null)}},[M,c]),Te=(0,R.useCallback)(async()=>{let e=S.trim();if(e)try{await E(`/plugins/marketplaces`,{method:`POST`,body:JSON.stringify({url:e})}),A.success(`Marketplace added`),C(``),le(!1),await M()}catch(e){A.error(e instanceof Error?e.message:`Failed to add marketplace`)}},[M,S]),Ee=(0,R.useCallback)(async(e,t=`user`,n)=>{de(e);try{await E(`/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];A.success(`Installed ${r}`)}catch(e){A.error(e instanceof Error?e.message:`Install failed`)}finally{await Promise.all([c(),M()]),de(null)}},[M,c]),Oe=b?m.filter(e=>e.name.toLowerCase().includes(b.toLowerCase())||e.description.toLowerCase().includes(b.toLowerCase())):m,Ae=d.filter(e=>e.scope===`project`).length;return(0,z.jsxs)(`div`,{className:`space-y-5`,children:[(0,z.jsx)(he,{eyebrow:`Capabilities`,title:`Plugins`,compact:!0,description:`Installed capabilities, scope, and activation.`,metrics:[{label:`Total`,value:d.length},{label:`Project Scope`,value:Ae},{label:`Catalog`,value:m.length}],actions:(0,z.jsx)(T,{variant:`ghost`,size:`sm`,onClick:()=>void Promise.all([c(),M()]),children:(0,z.jsx)(ne,{size:P.sm})})}),(0,z.jsx)(ge,{title:`Plugin Library`,compact:!0,description:`Installed plugins and marketplace discovery live in separate tabs.`}),(0,z.jsxs)(Ne,{value:re,onValueChange:e=>p(e),children:[(0,z.jsxs)(je,{children:[(0,z.jsxs)(De,{value:`installed`,children:[`Installed (`,e.length,`)`]}),(0,z.jsxs)(De,{value:`marketplace`,children:[`Marketplace (`,m.length,`)`]})]}),(0,z.jsx)(ke,{value:`installed`,className:`space-y-5`,children:o?(0,z.jsx)(N,{children:(0,z.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-text-subtle)]`,children:`Loading...`})}):s?(0,z.jsx)(N,{children:(0,z.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-danger)]`,children:s})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsx)(ge,{title:`User scope`,compact:!0,description:`Global defaults. Available to all Roles unless overridden.`}),e.length===0?(0,z.jsx)(N,{children:(0,z.jsx)(ve,{icon:(0,z.jsx)(t,{size:P.hero}),title:`No user-scope plugins`,description:`Install a plugin once here to make it available as the default for every Role.`,className:`py-8`})}):(0,z.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,z.jsx)(lr,{plugin:e,roles:f,expandedContent:(0,z.jsx)(dr,{plugin:e}),onInstallToRole:k,onToggleGlobal:me,onUninstallUser:_e,projectOperatingKey:O,userOperatingId:w},e.id))})]}),(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsx)(ge,{title:`Project scope`,compact:!0,description:`Role-specific overrides. Only plugins that differ from user scope are shown here.`}),(0,z.jsx)(Ce,{groups:a,layout:`full`,onUninstall:fe,onUpdate:pe,operatingKey:O})]}),(0,z.jsx)(Pe,{})]})}),(0,z.jsxs)(ke,{value:`marketplace`,className:`space-y-4`,children:[(0,z.jsxs)(N,{children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(r,{size:P.sm,className:`flex-shrink-0 text-[var(--app-text-muted)]`}),ie.map(e=>(0,z.jsx)(j,{variant:`muted`,className:`text-xs`,children:e.name},e.name)),(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[_?(0,z.jsx)(n,{size:P.xs,className:`animate-spin text-[var(--app-text-subtle)]`}):null,(0,z.jsxs)(T,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>le(e=>!e),children:[ce?(0,z.jsx)(l,{size:P.xs}):(0,z.jsx)(te,{size:P.xs}),`Source`]})]})]}),ce?(0,z.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,z.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:S,onChange:e=>C(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&Te()}}),(0,z.jsx)(T,{size:`sm`,onClick:()=>void Te(),disabled:!S.trim(),children:`Add`})]}):null]}),(0,z.jsx)(N,{children:(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(ee,{size:P.sm,className:`absolute left-2.5 top-2 text-[var(--app-text-subtle)]`}),(0,z.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] py-1.5 pl-8 pr-3 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,value:b,onChange:e=>x(e.target.value),placeholder:`Search available plugins...`})]})}),_?(0,z.jsx)(N,{children:(0,z.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-text-subtle)]`,children:`Loading marketplace...`})}):v?(0,z.jsx)(N,{children:(0,z.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-danger)]`,children:v})}):Oe.length===0?(0,z.jsx)(N,{children:(0,z.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-text-subtle)]`,children:b?`No plugins match your search`:`No marketplace plugins available`})}):(0,z.jsx)(N,{padding:!1,children:(0,z.jsxs)(xe,{children:[(0,z.jsx)(ye,{children:(0,z.jsxs)(I,{children:[(0,z.jsx)(F,{children:`Name`}),(0,z.jsx)(F,{children:`Description`}),(0,z.jsx)(F,{children:`Source`}),(0,z.jsx)(F,{children:`Action`})]})}),(0,z.jsx)(be,{children:Oe.map(e=>{let t=g.has(e.pluginId),r=ue===e.pluginId;return(0,z.jsxs)(I,{children:[(0,z.jsx)(L,{className:`text-xs font-medium text-[var(--app-text)]`,children:e.name}),(0,z.jsx)(L,{className:`max-w-[300px] truncate text-xs text-[var(--app-text-muted)]`,title:e.description,children:e.description}),(0,z.jsx)(L,{children:(0,z.jsx)(j,{variant:`muted`,className:`text-[10px]`,children:e.marketplaceName})}),(0,z.jsx)(L,{children:t?(0,z.jsx)(j,{variant:`success`,className:`text-[10px]`,children:`Installed`}):(0,z.jsxs)(Zn,{modal:!1,children:[(0,z.jsx)(Qn,{asChild:!0,children:(0,z.jsx)(T,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,children:r?(0,z.jsx)(n,{size:P.xs,className:`animate-spin`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(i,{size:P.xs}),`Install`,(0,z.jsx)(u,{size:P.xs})]})})}),(0,z.jsxs)(tr,{align:`end`,className:`min-w-[200px]`,children:[(0,z.jsx)($,{disabled:r,onSelect:()=>{Ee(e.pluginId)},children:`Install globally (User scope)`}),f.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ar,{}),f.map(t=>(0,z.jsxs)($,{disabled:r,onSelect:()=>{Ee(e.pluginId,`project`,t.workspacePath)},children:[`Install to `,t.name]},t.id))]}):null]})]})})]},e.pluginId)})})]})})]})]})]})}export{fr as Plugins};
|