@ash-ai/dashboard 0.0.7 → 0.1.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/app/agents/config/page.tsx +59 -0
- package/app/agents/detail/page.tsx +8 -1
- package/app/agents/evals/page.tsx +14 -403
- package/app/agents/knowledge/page.tsx +14 -157
- package/app/agents/page.tsx +34 -1
- package/app/agents/versions/page.tsx +14 -235
- package/app/sessions/page.tsx +51 -1
- package/out/404/index.html +1 -1
- package/out/404.html +1 -1
- package/out/_next/static/7bfIRYNSIrLnufuHDu6SP/_buildManifest.js +1 -0
- package/out/_next/static/chunks/447.ff2905689aee4ecc.js +1 -0
- package/out/_next/static/chunks/{929-b631fe082fe4e852.js → 929-f69b424a1300c015.js} +1 -1
- package/out/_next/static/chunks/app/agents/config/page-bd4b1aa9c56ac3bf.js +1 -0
- package/out/_next/static/chunks/app/agents/detail/page-7ddf96bb1bf30c84.js +1 -0
- package/out/_next/static/chunks/app/agents/eval-run/page-eb21414673ee3a61.js +1 -0
- package/out/_next/static/chunks/app/agents/eval-runs/page-4737a360beffdd17.js +1 -0
- package/out/_next/static/chunks/app/agents/evals/page-e764fd7f7c4e7dd0.js +1 -0
- package/out/_next/static/chunks/app/agents/knowledge/page-825e40e50aeca7b4.js +1 -0
- package/out/_next/static/chunks/app/agents/page-c70b7f8a4639d430.js +1 -0
- package/out/_next/static/chunks/app/agents/versions/page-16851d0f7e5c442c.js +1 -0
- package/out/_next/static/chunks/app/analytics/page-a1d93f279dc37c76.js +1 -0
- package/out/_next/static/chunks/app/layout-ccc59eb27dd73234.js +1 -0
- package/out/_next/static/chunks/app/logs/page-a47c75fb5c10da47.js +1 -0
- package/out/_next/static/chunks/app/page-8ce5c070587b5731.js +1 -0
- package/out/_next/static/chunks/app/playground/page-0fe012a6d6f00326.js +1 -0
- package/out/_next/static/chunks/app/queue/page-8413b5c0878aa6eb.js +1 -0
- package/out/_next/static/chunks/app/sessions/page-aac6f065bbb5b2ea.js +1 -0
- package/out/_next/static/chunks/app/settings/credentials/page-9ab78fa32e44448a.js +1 -0
- package/out/_next/static/chunks/{webpack-a50a78a04aed446d.js → webpack-2608afc863921e98.js} +1 -1
- package/out/_next/static/css/2c57b4d6ae47f2bd.css +1 -0
- package/out/agents/config/index.html +1 -0
- package/out/agents/config/index.txt +22 -0
- package/out/agents/detail/index.html +1 -1
- package/out/agents/detail/index.txt +6 -6
- package/out/agents/eval-compare/index.html +1 -1
- package/out/agents/eval-compare/index.txt +6 -6
- package/out/agents/eval-run/index.html +1 -1
- package/out/agents/eval-run/index.txt +6 -6
- package/out/agents/eval-runs/index.html +1 -1
- package/out/agents/eval-runs/index.txt +6 -6
- package/out/agents/evals/index.html +1 -1
- package/out/agents/evals/index.txt +6 -6
- package/out/agents/index.html +1 -1
- package/out/agents/index.txt +6 -6
- package/out/agents/knowledge/index.html +1 -1
- package/out/agents/knowledge/index.txt +6 -6
- package/out/agents/versions/index.html +1 -1
- package/out/agents/versions/index.txt +6 -6
- package/out/analytics/index.html +1 -1
- package/out/analytics/index.txt +6 -6
- package/out/index.html +1 -1
- package/out/index.txt +6 -6
- package/out/logs/index.html +1 -1
- package/out/logs/index.txt +6 -6
- package/out/playground/index.html +1 -1
- package/out/playground/index.txt +6 -6
- package/out/queue/index.html +1 -1
- package/out/queue/index.txt +6 -6
- package/out/sessions/index.html +1 -1
- package/out/sessions/index.txt +6 -6
- package/out/settings/api-keys/index.html +1 -1
- package/out/settings/api-keys/index.txt +6 -6
- package/out/settings/credentials/index.html +1 -1
- package/out/settings/credentials/index.txt +6 -6
- package/package.json +4 -4
- package/out/_next/static/chunks/447.6d3368efa2d996b0.js +0 -1
- package/out/_next/static/chunks/app/agents/detail/page-7427483b9c74ad63.js +0 -1
- package/out/_next/static/chunks/app/agents/eval-run/page-a38dac74d1b3787d.js +0 -1
- package/out/_next/static/chunks/app/agents/eval-runs/page-af2fb33c0fce7934.js +0 -1
- package/out/_next/static/chunks/app/agents/evals/page-6bdc4b839a7a8eda.js +0 -1
- package/out/_next/static/chunks/app/agents/knowledge/page-0e02b14bfa2a6d04.js +0 -1
- package/out/_next/static/chunks/app/agents/page-99f179eb7c41ebd4.js +0 -1
- package/out/_next/static/chunks/app/agents/versions/page-c482d9bad8f35df6.js +0 -1
- package/out/_next/static/chunks/app/analytics/page-ca5d8c60e62118ed.js +0 -1
- package/out/_next/static/chunks/app/layout-b06d1caafc026d0c.js +0 -1
- package/out/_next/static/chunks/app/logs/page-1a7df17a605f36d3.js +0 -1
- package/out/_next/static/chunks/app/page-9e02cb0e8897ab5d.js +0 -1
- package/out/_next/static/chunks/app/playground/page-cb17c2ffaeb31b4e.js +0 -1
- package/out/_next/static/chunks/app/queue/page-6013b93817822c75.js +0 -1
- package/out/_next/static/chunks/app/sessions/page-add67d96ab66b690.js +0 -1
- package/out/_next/static/chunks/app/settings/credentials/page-ffe97ffb2f60229d.js +0 -1
- package/out/_next/static/css/ab505eeeff3f7df5.css +0 -1
- package/out/_next/static/sXYgh3eUKXRKt1T_1T3tk/_buildManifest.js +0 -1
- /package/out/_next/static/{sXYgh3eUKXRKt1T_1T3tk → 7bfIRYNSIrLnufuHDu6SP}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[319],{3:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},50:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},286:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>w});var n=a(534),s=a(4166),r=a(9197),i=a(8968),l=a.n(i),c=a(3929),o=a(4765),d=a(5968),h=a(7964),x=a(1804),m=a(7155),u=a(2737),f=a(50),g=a(3701),p=a(4275),v=a(3);let y=(0,a(8154).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);var b=a(1924);function j(){let e=(0,r.useSearchParams)().get("name"),[t,a]=(0,s.useState)(null),[i,j]=(0,s.useState)(!0),[w,k]=(0,s.useState)(null);if((0,s.useEffect)(()=>{if(!e)return void j(!1);!async function(){try{let t=(await (0,c.KU)().listAgents()).find(t=>t.name===e);t?a(t):k('Agent "'.concat(e,'" not found'))}catch(e){k(e instanceof Error?e.message:"Failed to fetch agent")}finally{j(!1)}}()},[e]),!e)return(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,n.jsx)(l(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]});if(i)return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)(h.X,{height:80}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[1,2,3].map(e=>(0,n.jsx)(h.X,{height:120},e))})]});if(w||!t)return(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)("p",{className:"text-red-400",children:w||"Agent not found"}),(0,n.jsx)(l(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]});let N=[{label:"Config",href:"/agents/config?name=".concat(encodeURIComponent(t.name)),icon:m.A,description:"View and edit agent configuration"},{label:"Versions",href:"/agents/versions?name=".concat(encodeURIComponent(t.name)),icon:u.A,description:"Manage agent versions and system prompts"},{label:"Knowledge",href:"/agents/knowledge?name=".concat(encodeURIComponent(t.name)),icon:f.A,description:"Upload and manage knowledge base files"},{label:"Evals",href:"/agents/evals?name=".concat(encodeURIComponent(t.name)),icon:g.A,description:"Define and run evaluation test cases"}];return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)(l(),{href:"/agents",className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,n.jsx)(p.A,{className:"h-4 w-4"}),"Back to agents"]}),(0,n.jsx)(o.Zp,{children:(0,n.jsx)(o.Wu,{children:(0,n.jsxs)("div",{className:"flex items-start gap-4",children:[(0,n.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-indigo-500/10",children:(0,n.jsx)(v.A,{className:"h-6 w-6 text-indigo-400"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h1",{className:"text-xl font-bold text-white",children:t.name}),t.description&&(0,n.jsx)("p",{className:"mt-1 text-sm text-white/50",children:t.description}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[t.model&&(0,n.jsx)(d.E,{variant:"info",children:t.model}),t.status&&(0,n.jsx)(d.E,{variant:"active"===t.status?"success":"default",children:t.status}),t.path&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-white/30",children:[(0,n.jsx)(y,{className:"h-3 w-3"}),t.path]}),t.createdAt&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-white/30",children:[(0,n.jsx)(b.A,{className:"h-3 w-3"}),"Created ",(0,x.fw)(t.createdAt)]})]})]})]})})}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:N.map(e=>(0,n.jsx)(l(),{href:e.href,children:(0,n.jsx)(o.Zp,{className:"hover:border-white/20 hover:bg-white/[0.02] transition-all cursor-pointer h-full",children:(0,n.jsxs)(o.Wu,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,n.jsx)(e.icon,{className:"h-5 w-5 text-indigo-400"}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-white",children:e.label})]}),(0,n.jsx)("p",{className:"text-xs text-white/40",children:e.description})]})})},e.label))})]})}function w(){return(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(h.X,{height:200}),children:(0,n.jsx)(j,{})})}},1804:(e,t,a)=>{"use strict";a.d(t,{Ct:()=>o,ZV:()=>l,a3:()=>c,cn:()=>r,fw:()=>i});var n=a(6862),s=a(3690);function r(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,n.$)(t))}function i(e){let t=Date.now(),a=Math.floor((t-new Date(e).getTime())/1e3);if(a<60)return"".concat(a,"s ago");let n=Math.floor(a/60);if(n<60)return"".concat(n,"m ago");let s=Math.floor(n/60);if(s<24)return"".concat(s,"h ago");let r=Math.floor(s/24);return r<30?"".concat(r,"d ago"):new Date(e).toLocaleDateString()}function l(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let a=Math.floor(t/60);return"".concat(a,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},1924:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},2737:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]])},2965:(e,t,a)=>{Promise.resolve().then(a.bind(a,286))},3701:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]])},4275:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4765:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>c,ZB:()=>l,Zp:()=>r,aR:()=>i});var n=a(534),s=a(1804);function r(e){let{children:t,className:a}=e;return(0,n.jsx)("div",{className:(0,s.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",a),children:t})}function i(e){let{children:t,className:a}=e;return(0,n.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",a),children:t})}function l(e){let{children:t,className:a}=e;return(0,n.jsx)("h3",{className:(0,s.cn)("text-lg font-semibold leading-none tracking-tight text-white",a),children:t})}function c(e){let{children:t,className:a}=e;return(0,n.jsx)("div",{className:(0,s.cn)("p-4 sm:p-6",a),children:t})}},5968:(e,t,a)=>{"use strict";a.d(t,{E:()=>i,W:()=>l});var n=a(534),s=a(1804);let r={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function i(e){let{children:t,variant:a="default",className:i}=e;return(0,n.jsx)("span",{className:(0,s.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",r[a],i),children:t})}function l(e){let{status:t}=e;return(0,n.jsx)(i,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},7155:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(8154).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},7964:(e,t,a)=>{"use strict";a.d(t,{X:()=>r});var n=a(534),s=a(1804);function r(e){let{width:t="100%",height:a=100,className:r}=e;return(0,n.jsx)("div",{className:(0,s.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",r),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:a}})}},9197:(e,t,a)=>{"use strict";var n=a(4841);a.o(n,"usePathname")&&a.d(t,{usePathname:function(){return n.usePathname}}),a.o(n,"useSearchParams")&&a.d(t,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=2965)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[996],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>i,aA:()=>x,aX:()=>d,te:()=>o,xV:()=>m,yu:()=>h});var a=s(4166),l=s(3929);function r(e,t){let s=(0,a.useRef)(e);(0,a.useEffect)(()=>{s.current=e},[e]),(0,a.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function n(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function c(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function i(){let e=n("ash:agents"),[t,s]=(0,a.useState)(null!=e?e:[]),[r,i]=(0,a.useState)(!e),[o,u]=(0,a.useState)(null),d=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().listAgents();s(e),c("ash:agents",e),u(null)}catch(e){u(e)}finally{i(!1)}},[]);return(0,a.useEffect)(()=>{d()},[d]),{agents:t,loading:r,error:o,refetch:d}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),i=n(s),[o,u]=(0,a.useState)(null!=i?i:[]),[d,x]=(0,a.useState)(!i),[h,m]=(0,a.useState)(null),f=(0,a.useCallback)(async()=>{try{let t=await (0,l.KU)().listSessions(null==e?void 0:e.agent);u(t),c(s,t),m(null)}catch(e){m(e)}finally{x(!1)}},[null==e?void 0:e.agent,s]);return(0,a.useEffect)(()=>{f()},[f]),r(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:d,error:h,refetch:f}}function u(){let[e,t]=(0,a.useState)(()=>n("ash:health")),[s,i]=(0,a.useState)(null),o=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().health();t(e),i(null),c("ash:health",e)}catch(e){i(e)}},[]);return(0,a.useEffect)(()=>{o()},[o]),r(()=>o(),3e4),{health:e,error:s,refetch:o}}function d(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),[n,c]=(0,a.useState)(null),i=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().listCredentials();t(e),c(null)}catch(e){c(e)}finally{r(!1)}},[]);return(0,a.useEffect)(()=>{i()},[i]),{credentials:e,loading:s,error:n,refetch:i}}function x(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,l.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{c()},[c]),{versions:t,loading:r,refresh:c}}function h(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,l.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{c()},[c]),{runs:t,loading:r,refresh:c}}function m(e,t){let[s,r]=(0,a.useState)([]),[n,c]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e&&t)try{c(!0);let s=await (0,l.KU)().getEvalRunResults(e,t);r(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{c(!1)}},[e,t]);return(0,a.useEffect)(()=>{i()},[i]),{results:s,loading:n,refresh:i}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>c,a3:()=>i,cn:()=>r,fw:()=>n});var a=s(6862),l=s(3690);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,l.QP)((0,a.$)(t))}function n(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let a=Math.floor(s/60);if(a<60)return"".concat(a,"m ago");let l=Math.floor(a/60);if(l<24)return"".concat(l,"h ago");let r=Math.floor(l/24);return r<30?"".concat(r,"d ago"):new Date(e).toLocaleDateString()}function c(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function i(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},1924:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},3544:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},3634:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},4275:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4740:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var a=s(534),l=s(4166),r=s(9197),n=s(8968),c=s.n(n),i=s(989),o=s(3929),u=s(4765),d=s(5968),x=s(8314),h=s(7964),m=s(1804),f=s(4275),g=s(8408),v=s(6211),p=s(3544),y=s(3634),j=s(6379),w=s(6135),N=s(1924);function b(e){switch(e){case"completed":return"success";case"running":return"info";case"error":return"error";case"pending":return"warning";default:return"default"}}function S(e){return null===e?"text-white/30":e>=.8?"text-green-400":e>=.5?"text-yellow-400":"text-red-400"}function k(){let e=(0,r.useSearchParams)(),t=e.get("name"),s=e.get("runId"),{results:n,loading:k,refresh:C}=(0,i.xV)(t,s),[E,M]=(0,l.useState)(null),[R,F]=(0,l.useState)(!0),[L,_]=(0,l.useState)(null);return((0,l.useEffect)(()=>{if(!t||!s)return void F(!1);!async function(){try{let e=await (0,o.KU)().getEvalRun(t,s);M(e)}catch(e){console.error("Failed to fetch eval run:",e)}finally{F(!1)}}()},[t,s]),(0,l.useEffect)(()=>{if(!E||"running"!==E.status&&"pending"!==E.status)return;let e=setInterval(()=>{C(),t&&s&&(0,o.KU)().getEvalRun(t,s).then(M).catch(()=>{})},5e3);return()=>clearInterval(e)},[E,C,t,s]),t&&s)?R||k?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(h.X,{height:120}),(0,a.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(h.X,{height:70},e))})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(c(),{href:"/agents/eval-runs?name=".concat(encodeURIComponent(t)),className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,a.jsx)(f.A,{className:"h-4 w-4"}),"Back to eval runs"]}),(0,a.jsx)(u.Zp,{children:(0,a.jsxs)(u.Wu,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("h1",{className:"text-xl font-bold text-white",children:["Run ",(0,m.Ct)(s)]}),E&&(0,a.jsxs)(d.E,{variant:b(E.status),children:["running"===E.status&&(0,a.jsx)(g.A,{className:"h-3 w-3 mr-1 animate-spin"}),E.status]}),(null==E?void 0:E.versionNumber)!==null&&(null==E?void 0:E.versionNumber)!==void 0&&(0,a.jsxs)(d.E,{variant:"default",children:["v",E.versionNumber]})]}),E&&(0,a.jsxs)("p",{className:"text-xs text-white/30 mt-1",children:["Started ",(0,m.fw)(E.createdAt),E.completedAt&&" | Completed ".concat((0,m.fw)(E.completedAt))]})]}),E&&(0,a.jsxs)("div",{className:"text-sm text-white/50",children:[E.completedCases,"/",E.totalCases," cases completed"]})]}),(null==E?void 0:E.summary)&&(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-4 mt-4 pt-4 border-t border-white/5",children:[(0,a.jsx)(A,{label:"Pass Rate",value:"".concat((100*E.summary.passRate).toFixed(0),"%"),color:E.summary.passRate>=.8?"text-green-400":E.summary.passRate>=.5?"text-yellow-400":"text-red-400"}),(0,a.jsx)(A,{label:"Avg Topic Score",value:E.summary.avgTopicScore.toFixed(2),color:S(E.summary.avgTopicScore)}),(0,a.jsx)(A,{label:"Avg Safety Score",value:E.summary.avgSafetyScore.toFixed(2),color:S(E.summary.avgSafetyScore)}),null!==E.summary.avgLlmJudgeScore&&(0,a.jsx)(A,{label:"LLM Judge Score",value:E.summary.avgLlmJudgeScore.toFixed(2),color:S(E.summary.avgLlmJudgeScore)}),(0,a.jsx)(A,{label:"Avg Latency",value:"".concat(E.summary.avgLatencyMs.toFixed(0),"ms"),color:"text-white"})]})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-white mb-3",children:"Results"}),0===n.length?(0,a.jsx)(x.p,{icon:(0,a.jsx)(v.A,{className:"h-12 w-12"}),title:"No results yet",description:(null==E?void 0:E.status)==="pending"||(null==E?void 0:E.status)==="running"?"Results will appear as the eval run progresses.":"No results were recorded for this run."}):(0,a.jsx)("div",{className:"space-y-2",children:n.map(e=>{let t=L===e.id;return(0,a.jsx)(u.Zp,{children:(0,a.jsxs)(u.Wu,{className:"!py-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("button",{onClick:()=>_(t?null:e.id),className:"flex items-center gap-2 min-w-0 flex-1 text-left",children:[t?(0,a.jsx)(p.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}):(0,a.jsx)(y.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}),"completed"===e.status?(0,a.jsx)(j.A,{className:"h-4 w-4 text-green-400 flex-shrink-0"}):"error"===e.status?(0,a.jsx)(w.A,{className:"h-4 w-4 text-red-400 flex-shrink-0"}):"running"===e.status?(0,a.jsx)(g.A,{className:"h-4 w-4 text-blue-400 animate-spin flex-shrink-0"}):(0,a.jsx)(N.A,{className:"h-4 w-4 text-yellow-400 flex-shrink-0"}),(0,a.jsxs)("span",{className:"text-sm text-white truncate",children:["Case ",(0,m.Ct)(e.evalCaseId)]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0 ml-2",children:[(0,a.jsx)(d.E,{variant:b(e.status),children:e.status}),null!==e.topicScore&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-[10px] text-white/30",children:"Topic"}),(0,a.jsx)("div",{className:"text-xs font-semibold ".concat(S(e.topicScore)),children:e.topicScore.toFixed(2)})]}),null!==e.safetyScore&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-[10px] text-white/30",children:"Safety"}),(0,a.jsx)("div",{className:"text-xs font-semibold ".concat(S(e.safetyScore)),children:e.safetyScore.toFixed(2)})]}),null!==e.latencyMs&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-[10px] text-white/30",children:"Latency"}),(0,a.jsxs)("div",{className:"text-xs font-semibold text-white",children:[e.latencyMs.toFixed(0),"ms"]})]})]})]}),t&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-white/5 space-y-3",children:[e.agentResponse&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-medium text-white/40 mb-1",children:"Agent Response"}),(0,a.jsx)("div",{className:"text-sm text-white/70 bg-black/20 rounded-lg p-3 whitespace-pre-wrap max-h-48 overflow-y-auto",children:e.agentResponse})]}),e.error&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-medium text-red-400 mb-1",children:"Error"}),(0,a.jsx)("div",{className:"text-sm text-red-300 bg-red-500/10 rounded-lg p-3",children:e.error})]}),null!==e.llmJudgeScore&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-white/40",children:"LLM Judge Score:"}),(0,a.jsx)("span",{className:"text-sm font-semibold ".concat(S(e.llmJudgeScore)),children:e.llmJudgeScore.toFixed(2)})]}),null!==e.humanScore&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-white/40",children:"Human Score:"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-white",children:e.humanScore}),e.humanNotes&&(0,a.jsxs)("span",{className:"text-xs text-white/50",children:["- ",e.humanNotes]})]})]})]})},e.id)})})]})]}):(0,a.jsxs)("div",{className:"text-center py-16",children:[(0,a.jsx)("p",{className:"text-white/50",children:"Missing agent name or run ID."}),(0,a.jsx)(c(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function A(e){let{label:t,value:s,color:l}=e;return(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-xs text-white/40 mb-1",children:t}),(0,a.jsx)("div",{className:"text-lg font-bold ".concat(l),children:s})]})}function C(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(h.X,{height:200}),children:(0,a.jsx)(k,{})})}},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>i,ZB:()=>c,Zp:()=>r,aR:()=>n});var a=s(534),l=s(1804);function r(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function n(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,a.jsx)("h3",{className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("p-4 sm:p-6",s),children:t})}},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,W:()=>c});var a=s(534),l=s(1804);let r={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function n(e){let{children:t,variant:s="default",className:n}=e;return(0,a.jsx)("span",{className:(0,l.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",r[s],n),children:t})}function c(e){let{status:t}=e;return(0,a.jsx)(n,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6135:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},6211:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},6379:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>r});var a=s(534),l=s(1804);function r(e){let{width:t="100%",height:s=100,className:r}=e;return(0,a.jsx)("div",{className:(0,l.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",r),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>r});var a=s(534),l=s(1804);function r(e){let{icon:t,title:s,description:r,action:n,className:c}=e;return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col items-center justify-center py-16 text-center",c),children:[t&&(0,a.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,a.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:r}),n&&(0,a.jsx)("div",{className:"mt-4",children:n})]})}},8408:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9140:(e,t,s)=>{Promise.resolve().then(s.bind(s,4740))},9197:(e,t,s)=>{"use strict";var a=s(4841);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=9140)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>d,_F:()=>c,aA:()=>h,aX:()=>u,te:()=>o,xV:()=>m,yu:()=>x});var a=s(4166),n=s(3929);function r(e,t){let s=(0,a.useRef)(e);(0,a.useEffect)(()=>{s.current=e},[e]),(0,a.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function l(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=l("ash:agents"),[t,s]=(0,a.useState)(null!=e?e:[]),[r,c]=(0,a.useState)(!e),[o,d]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().listAgents();s(e),i("ash:agents",e),d(null)}catch(e){d(e)}finally{c(!1)}},[]);return(0,a.useEffect)(()=>{u()},[u]),{agents:t,loading:r,error:o,refetch:u}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=l(s),[o,d]=(0,a.useState)(null!=c?c:[]),[u,h]=(0,a.useState)(!c),[x,m]=(0,a.useState)(null),f=(0,a.useCallback)(async()=>{try{let t=await (0,n.KU)().listSessions(null==e?void 0:e.agent);d(t),i(s,t),m(null)}catch(e){m(e)}finally{h(!1)}},[null==e?void 0:e.agent,s]);return(0,a.useEffect)(()=>{f()},[f]),r(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:u,error:x,refetch:f}}function d(){let[e,t]=(0,a.useState)(()=>l("ash:health")),[s,c]=(0,a.useState)(null),o=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,a.useEffect)(()=>{o()},[o]),r(()=>o(),3e4),{health:e,error:s,refetch:o}}function u(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),[l,i]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{r(!1)}},[]);return(0,a.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:l,refetch:c}}function h(e){let[t,s]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{l(!0);let t=await (0,n.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{versions:t,loading:r,refresh:i}}function x(e){let[t,s]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{l(!0);let t=await (0,n.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{runs:t,loading:r,refresh:i}}function m(e,t){let[s,r]=(0,a.useState)([]),[l,i]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,n.KU)().getEvalRunResults(e,t);r(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,a.useEffect)(()=>{c()},[c]),{results:s,loading:l,refresh:c}}},1080:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>r,fw:()=>l});var a=s(6862),n=s(3690);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}function l(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let a=Math.floor(s/60);if(a<60)return"".concat(a,"m ago");let n=Math.floor(a/60);if(n<24)return"".concat(n,"h ago");let r=Math.floor(n/24);return r<30?"".concat(r,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},1924:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>r});var a=s(534),n=s(1804);let r=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:r,options:l,placeholder:i,id:c,...o}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[r&&(0,a.jsx)("label",{htmlFor:c,className:"block text-sm font-medium text-white/70",children:r}),(0,a.jsxs)("select",{ref:t,id:c,className:(0,n.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white","focus-visible:outline-none focus-visible:border-indigo-500/50",s),...o,children:[i&&(0,a.jsx)("option",{value:"",className:"bg-[#1c2129]",children:i}),l.map(e=>(0,a.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});r.displayName="Select"},3811:(e,t,s)=>{Promise.resolve().then(s.bind(s,4664))},4275:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4664:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>M});var a=s(534),n=s(4166),r=s(9197),l=s(8968),i=s.n(l),c=s(989),o=s(3929),d=s(4765),u=s(6719),h=s(3007),x=s(5968),m=s(8314),f=s(7964),v=s(1804),g=s(6379),p=s(8408),b=s(6135),y=s(1924),j=s(8154);let w=(0,j.A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var N=s(4275);let k=(0,j.A)("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);var S=s(6211),A=s(1080),C=s(6650);function E(){let e=(0,r.useSearchParams)().get("name"),{runs:t,loading:s,refresh:l}=(0,c.yu)(e),{versions:o}=(0,c.aA)(e),[h,j]=(0,n.useState)(!1),[C,E]=(0,n.useState)(!1),[M,F]=(0,n.useState)([]),[U,P]=(0,n.useState)(null);return((0,n.useEffect)(()=>{if(!t.some(e=>"running"===e.status||"pending"===e.status))return;let e=setInterval(()=>l(),5e3);return()=>clearInterval(e)},[t,l]),e)?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(i(),{href:"/agents/evals?name=".concat(encodeURIComponent(e)),className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,a.jsx)(N.A,{className:"h-4 w-4"}),"Back to eval cases"]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Eval Runs"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Run history for ",(0,a.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[t.length>=2&&(0,a.jsxs)(u.$,{variant:C?"primary":"secondary",onClick:()=>{E(!C),F([])},children:[(0,a.jsx)(k,{className:"h-4 w-4 mr-2"}),C?"Cancel Compare":"Compare"]}),C&&2===M.length&&(0,a.jsx)(i(),{href:"/agents/eval-compare?name=".concat(encodeURIComponent(e),"&runA=").concat(M[0],"&runB=").concat(M[1]),children:(0,a.jsxs)(u.$,{children:[(0,a.jsx)(S.A,{className:"h-4 w-4 mr-2"}),"Compare Selected"]})}),!C&&(0,a.jsxs)(u.$,{onClick:()=>j(!0),children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"Run Evals"]})]})]}),U&&(0,a.jsx)("div",{className:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2",children:U}),C&&(0,a.jsxs)("div",{className:"text-sm text-white/50 bg-indigo-500/5 border border-indigo-500/20 rounded-lg px-4 py-2",children:["Select 2 runs to compare. Selected: ",M.length,"/2"]}),s?(0,a.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(f.X,{height:80},e))}):0===t.length?(0,a.jsx)(m.p,{icon:(0,a.jsx)(S.A,{className:"h-12 w-12"}),title:"No eval runs yet",description:"Start an eval run to test your agent against the defined eval cases.",action:(0,a.jsxs)(u.$,{onClick:()=>j(!0),children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"Run Evals"]})}):(0,a.jsx)("div",{className:"space-y-3",children:t.map(t=>{let s=M.includes(t.id);return(0,a.jsx)(d.Zp,{className:C&&s?"border-indigo-500/50 bg-indigo-500/5":"",children:(0,a.jsx)(d.Wu,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[C&&(0,a.jsx)("button",{onClick:()=>{var e;return e=t.id,void F(t=>t.includes(e)?t.filter(t=>t!==e):t.length>=2?[t[1],e]:[...t,e])},className:"flex-shrink-0 h-5 w-5 rounded border-2 transition-colors ".concat(s?"bg-indigo-500 border-indigo-500":"border-white/20 hover:border-white/40"),children:s&&(0,a.jsx)(g.A,{className:"h-4 w-4 text-white"})}),function(e){switch(e){case"completed":return(0,a.jsx)(g.A,{className:"h-4 w-4 text-green-400"});case"running":return(0,a.jsx)(p.A,{className:"h-4 w-4 text-blue-400 animate-spin"});case"failed":return(0,a.jsx)(b.A,{className:"h-4 w-4 text-red-400"});case"pending":return(0,a.jsx)(y.A,{className:"h-4 w-4 text-yellow-400"});default:return(0,a.jsx)(w,{className:"h-4 w-4 text-white/40"})}}(t.status),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[C?(0,a.jsxs)("span",{className:"text-sm font-semibold text-white",children:["Run ",(0,v.Ct)(t.id)]}):(0,a.jsxs)(i(),{href:"/agents/eval-run?name=".concat(encodeURIComponent(e),"&runId=").concat(t.id),className:"text-sm font-semibold text-white hover:text-indigo-400 transition-colors",children:["Run ",(0,v.Ct)(t.id)]}),(0,a.jsx)(x.E,{variant:function(e){switch(e){case"completed":return"success";case"running":return"info";case"failed":return"error";case"pending":return"warning";default:return"default"}}(t.status),children:t.status}),null!==t.versionNumber&&void 0!==t.versionNumber&&(0,a.jsxs)(x.E,{variant:"default",children:["v",t.versionNumber]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,v.fw)(t.createdAt)}),(0,a.jsxs)("span",{className:"text-xs text-white/30",children:[t.completedCases,"/",t.totalCases," cases"]})]})]})]}),t.summary&&(0,a.jsxs)("div",{className:"flex items-center gap-4 flex-shrink-0",children:[(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-xs text-white/40",children:"Pass Rate"}),(0,a.jsxs)("div",{className:"text-sm font-semibold ".concat(t.summary.passRate>=.8?"text-green-400":t.summary.passRate>=.5?"text-yellow-400":"text-red-400"),children:[(100*t.summary.passRate).toFixed(0),"%"]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-xs text-white/40",children:"Topic"}),(0,a.jsx)("div",{className:"text-sm font-semibold text-white",children:t.summary.avgTopicScore.toFixed(2)})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-xs text-white/40",children:"Safety"}),(0,a.jsx)("div",{className:"text-sm font-semibold text-white",children:t.summary.avgSafetyScore.toFixed(2)})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("div",{className:"text-xs text-white/40",children:"Latency"}),(0,a.jsxs)("div",{className:"text-sm font-semibold text-white",children:[t.summary.avgLatencyMs.toFixed(0),"ms"]})]})]})]})})},t.id)})}),h&&(0,a.jsx)(R,{agentName:e,versions:o,onClose:()=>j(!1),onStarted:()=>{j(!1),l()}})]}):(0,a.jsxs)("div",{className:"text-center py-16",children:[(0,a.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,a.jsx)(i(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function R(e){let{agentName:t,versions:s,onClose:r,onStarted:l}=e,[i,c]=(0,n.useState)(""),[x,m]=(0,n.useState)(!1),[f,v]=(0,n.useState)(null);async function g(){m(!0),v(null);try{await (0,o.KU)().startEvalRun(t,{versionNumber:i?Number(i):void 0}),l()}catch(e){v(e instanceof Error?e.message:"Failed to start eval run")}finally{m(!1)}}let b=s.map(e=>({value:String(e.versionNumber),label:"v".concat(e.versionNumber).concat(e.name?" - ".concat(e.name):"").concat(e.isActive?" (active)":"")}));return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,a.jsx)(d.Zp,{className:"w-full max-w-md",children:(0,a.jsxs)(d.Wu,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Run Evals"}),(0,a.jsx)("button",{onClick:r,className:"text-white/40 hover:text-white",children:(0,a.jsx)(C.A,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(h.l,{label:"Version (optional)",placeholder:"Use active version",options:b,value:i,onChange:e=>c(e.target.value)}),(0,a.jsx)("p",{className:"text-xs text-white/40",children:"This will run all active eval cases against the selected version of the agent."}),f&&(0,a.jsx)("p",{className:"text-sm text-red-400",children:f}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,a.jsx)(u.$,{variant:"ghost",onClick:r,children:"Cancel"}),(0,a.jsx)(u.$,{onClick:g,disabled:x,children:x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Starting..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(A.A,{className:"h-4 w-4 mr-2"}),"Start Run"]})})]})]})]})})})}function M(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(f.X,{height:200}),children:(0,a.jsx)(E,{})})}},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>r,aR:()=>l});var a=s(534),n=s(1804);function r(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,n.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function l(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,a.jsx)("h3",{className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,n.cn)("p-4 sm:p-6",s),children:t})}},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>l,W:()=>i});var a=s(534),n=s(1804);let r={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function l(e){let{children:t,variant:s="default",className:l}=e;return(0,a.jsx)("span",{className:(0,n.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",r[s],l),children:t})}function i(e){let{status:t}=e;return(0,a.jsx)(l,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6135:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},6211:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},6379:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},6650:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(534),n=s(1804),r=s(4166);let l={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,r.forwardRef)((e,t)=>{let{className:s,variant:r="primary",size:c="md",disabled:o,...d}=e;return(0,a.jsx)("button",{ref:t,className:(0,n.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",l[r],i[c],s),disabled:o,...d})});c.displayName="Button"},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>r});var a=s(534),n=s(1804);function r(e){let{width:t="100%",height:s=100,className:r}=e;return(0,a.jsx)("div",{className:(0,n.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",r),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>r});var a=s(534),n=s(1804);function r(e){let{icon:t,title:s,description:r,action:l,className:i}=e;return(0,a.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,a.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,a.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:r}),l&&(0,a.jsx)("div",{className:"mt-4",children:l})]})}},8408:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9197:(e,t,s)=>{"use strict";var a=s(4841);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=3811)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[237],{191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(403)._(n(919));function a(e,t){var n;let a={};"function"==typeof e&&(a.loader=e);let o={...a,...t};return(0,r.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(8919).createAsyncLocalStorage)()},919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(534),a=n(4166),o=n(5452);function l(e){return{default:e&&"default"in e?e.default:e}}n(1649);let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...s,...e},n=(0,a.lazy)(()=>t.loader().then(l)),i=t.loading;function u(e){let l=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?a.Suspense:a.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(u,{...s?{fallback:l}:{},children:c})}return u.displayName="LoadableComponent",u}},1649:(e,t,n)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(534),n(7763),n(6890),n(2959)},1804:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>u,ZV:()=>s,a3:()=>i,cn:()=>o,fw:()=>l});var r=n(6862),a=n(3690);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}function l(e){let t=Date.now(),n=Math.floor((t-new Date(e).getTime())/1e3);if(n<60)return"".concat(n,"s ago");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let o=Math.floor(a/24);return o<30?"".concat(o,"d ago"):new Date(e).toLocaleDateString()}function s(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function i(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let n=Math.floor(t/60);return"".concat(n,"h ").concat(t%60,"m")}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},4275:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4946:(e,t,n)=>{"use strict";n.d(t,{default:()=>a.a});var r=n(191),a=n.n(r)},5452:(e,t,n)=>{"use strict";function r(e){let{reason:t,children:n}=e;return n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(8560)},5729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var r=n(534),a=n(4166),o=n(9197),l=n(8968),s=n.n(l),i=n(4946),u=n(3929),c=n(7964),d=n(4275);let f=(0,i.default)(()=>n.e(447).then(n.bind(n,6447)).then(e=>({default:e.AgentEvalRunner})),{loadableGenerated:{webpack:()=>[null]},ssr:!1,loading:()=>(0,r.jsx)(c.X,{height:200})});function h(){let e=(0,o.useSearchParams)().get("name");return e?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)(s(),{href:"/agents/detail?name=".concat(encodeURIComponent(e)),className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),"Back to ",e]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Evaluations"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Test cases and runs for ",(0,r.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,r.jsx)(f,{client:(0,u.KU)(),agentName:e})]}):(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,r.jsx)(s(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function m(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)(c.X,{height:200}),children:(0,r.jsx)(h,{})})}},6890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(345)},7075:(e,t,n)=>{Promise.resolve().then(n.bind(n,5729))},7964:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(534),a=n(1804);function o(e){let{width:t="100%",height:n=100,className:o}=e;return(0,r.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",o),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:n}})}},8919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return a?new a:new r}function l(e){return a?a.bind(e):r.bind(e)}function s(){return a?a.snapshot():function(e,...t){return e(...t)}}},9197:(e,t,n)=>{"use strict";var r=n(4841);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=7075)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[882],{191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(403)._(n(919));function a(e,t){var n;let a={};"function"==typeof e&&(a.loader=e);let o={...a,...t};return(0,r.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(8919).createAsyncLocalStorage)()},919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(534),a=n(4166),o=n(5452);function l(e){return{default:e&&"default"in e?e.default:e}}n(1649);let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...s,...e},n=(0,a.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,c=s?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(c,{...s?{fallback:l}:{},children:u})}return c.displayName="LoadableComponent",c}},1649:(e,t,n)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(534),n(7763),n(6890),n(2959)},1804:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>c,ZV:()=>s,a3:()=>i,cn:()=>o,fw:()=>l});var r=n(6862),a=n(3690);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}function l(e){let t=Date.now(),n=Math.floor((t-new Date(e).getTime())/1e3);if(n<60)return"".concat(n,"s ago");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let o=Math.floor(a/24);return o<30?"".concat(o,"d ago"):new Date(e).toLocaleDateString()}function s(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function i(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let n=Math.floor(t/60);return"".concat(n,"h ").concat(t%60,"m")}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2678:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var r=n(534),a=n(4166),o=n(9197),l=n(8968),s=n.n(l),i=n(4946),c=n(3929),u=n(7964),d=n(4275);let f=(0,i.default)(()=>n.e(447).then(n.bind(n,6447)).then(e=>({default:e.AgentKnowledgeBase})),{loadableGenerated:{webpack:()=>[null]},ssr:!1,loading:()=>(0,r.jsx)(u.X,{height:200})});function h(){let e=(0,o.useSearchParams)().get("name");return e?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)(s(),{href:"/agents/detail?name=".concat(encodeURIComponent(e)),className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),"Back to ",e]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Knowledge Base"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Manage files for ",(0,r.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,r.jsx)(f,{client:(0,c.KU)(),agentName:e})]}):(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,r.jsx)(s(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function m(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)(u.X,{height:200}),children:(0,r.jsx)(h,{})})}},2922:(e,t,n)=>{Promise.resolve().then(n.bind(n,2678))},4275:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4946:(e,t,n)=>{"use strict";n.d(t,{default:()=>a.a});var r=n(191),a=n.n(r)},5452:(e,t,n)=>{"use strict";function r(e){let{reason:t,children:n}=e;return n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(8560)},6890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(345)},7964:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(534),a=n(1804);function o(e){let{width:t="100%",height:n=100,className:o}=e;return(0,r.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",o),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:n}})}},8919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return a?new a:new r}function l(e){return a?a.bind(e):r.bind(e)}function s(){return a?a.snapshot():function(e,...t){return e(...t)}}},9197:(e,t,n)=>{"use strict";var r=n(4841);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=2922)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{3:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},50:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},647:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])},858:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>d,_F:()=>c,aA:()=>x,aX:()=>h,te:()=>o,xV:()=>m,yu:()=>u});var l=s(4166),a=s(3929);function n(e,t){let s=(0,l.useRef)(e);(0,l.useEffect)(()=>{s.current=e},[e]),(0,l.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=r("ash:agents"),[t,s]=(0,l.useState)(null!=e?e:[]),[n,c]=(0,l.useState)(!e),[o,d]=(0,l.useState)(null),h=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listAgents();s(e),i("ash:agents",e),d(null)}catch(e){d(e)}finally{c(!1)}},[]);return(0,l.useEffect)(()=>{h()},[h]),{agents:t,loading:n,error:o,refetch:h}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(s),[o,d]=(0,l.useState)(null!=c?c:[]),[h,x]=(0,l.useState)(!c),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);d(t),i(s,t),m(null)}catch(e){m(e)}finally{x(!1)}},[null==e?void 0:e.agent,s]);return(0,l.useEffect)(()=>{f()},[f]),n(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:h,error:u,refetch:f}}function d(){let[e,t]=(0,l.useState)(()=>r("ash:health")),[s,c]=(0,l.useState)(null),o=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,l.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:s,refetch:o}}function h(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)(!0),[r,i]=(0,l.useState)(null),c=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,l.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:r,refetch:c}}function x(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function u(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function m(e,t){let[s,n]=(0,l.useState)([]),[r,i]=(0,l.useState)(!0),c=(0,l.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,a.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,l.useEffect)(()=>{c()},[c]),{results:s,loading:r,refresh:c}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>r});var l=s(6862),a=s(3690);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,l.$)(t))}function r(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let l=Math.floor(s/60);if(l<60)return"".concat(l,"m ago");let a=Math.floor(l/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return n<30?"".concat(n,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2505:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var l=s(534),a=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,error:r,id:i,...c}=e;return(0,l.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,l.jsx)("label",{htmlFor:i,className:"block text-sm font-medium text-white/70",children:n}),(0,l.jsx)("input",{ref:t,id:i,className:(0,a.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white placeholder:text-white/40","focus-visible:outline-none focus-visible:border-indigo-500/50 focus-visible:bg-white/10","disabled:cursor-not-allowed disabled:opacity-50",r&&"border-red-500/50 focus-visible:border-red-400",s),...c}),r&&(0,l.jsx)("p",{className:"text-xs text-red-400",children:r})]})});n.displayName="Input"},2737:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]])},3701:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>n,aR:()=>r});var l=s(534),a=s(1804);function n(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function r(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,l.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("p-4 sm:p-6",s),children:t})}},5065:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>D});var l=s(534),a=s(4166),n=s(989),r=s(3929),i=s(4765),c=s(6719),o=s(2505),d=s(5968),h=s(8314),x=s(7964),u=s(1804),m=s(858),f=s(3),p=s(8154);let g=(0,p.A)("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var y=s(7155),b=s(2737),w=s(50),v=s(3701),j=s(7955),N=s(7691),k=s(647),C=s(6650);let A=(0,p.A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var S=s(8842),M=s(8968),E=s.n(M);function D(){let{agents:e,loading:t,refetch:s}=(0,n._F)(),[o,d]=(0,a.useState)(!1),[u,p]=(0,a.useState)(null),[g,y]=(0,a.useState)(null);async function b(e){y(null);try{await (0,r.KU)().deleteAgent(e),p(null),s()}catch(e){y(e instanceof Error?e.message:"Failed to delete agent"),p(null)}}return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Agents"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Deploy and manage your AI agents"})]}),(0,l.jsxs)(c.$,{onClick:()=>d(!0),children:[(0,l.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Create Agent"]})]}),g&&(0,l.jsx)("div",{className:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2",children:g}),t?(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(e=>(0,l.jsx)(x.X,{height:160},e))}):0===e.length?(0,l.jsx)(h.p,{icon:(0,l.jsx)(f.A,{className:"h-12 w-12"}),title:"No agents yet",description:"Create your first agent to get started. You can upload files or deploy from the CLI.",action:(0,l.jsxs)(c.$,{onClick:()=>d(!0),children:[(0,l.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Create Agent"]})}):(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,l.jsx)(U,{agent:e,onDelete:()=>p(e.name)},e.id||e.name))}),o&&(0,l.jsx)(_,{onClose:()=>d(!1),onCreated:()=>{d(!1),s()}}),u&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,l.jsx)(i.Zp,{className:"w-full max-w-md",children:(0,l.jsxs)(i.Wu,{children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-white mb-2",children:"Delete Agent"}),(0,l.jsxs)("p",{className:"text-sm text-white/60 mb-6",children:["Are you sure you want to delete ",(0,l.jsx)("span",{className:"text-white font-medium",children:u}),"? This action cannot be undone."]}),(0,l.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,l.jsx)(c.$,{variant:"ghost",onClick:()=>p(null),children:"Cancel"}),(0,l.jsx)(c.$,{variant:"danger",onClick:()=>b(u),children:"Delete"})]})]})})})]})}function U(e){let{agent:t,onDelete:s}=e,[n,r]=(0,a.useState)(!1);return(0,l.jsx)(i.Zp,{className:"relative group",children:(0,l.jsxs)(i.Wu,{children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)(E(),{href:"/agents/detail?name=".concat(encodeURIComponent(t.name)),children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-white truncate hover:text-indigo-400 transition-colors cursor-pointer",children:t.name})}),t.description&&(0,l.jsx)("p",{className:"text-xs text-white/40 mt-1 line-clamp-2",children:t.description})]}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("button",{onClick:()=>r(!n),className:"p-1 text-white/30 hover:text-white/70 transition-colors rounded",children:(0,l.jsx)(g,{className:"h-4 w-4"})}),n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0",onClick:()=>r(!1)}),(0,l.jsxs)("div",{className:"absolute right-0 mt-1 w-44 rounded-lg border border-white/10 bg-[#1c2129] shadow-xl z-10 py-1",children:[(0,l.jsxs)(E(),{href:"/agents/config?name=".concat(encodeURIComponent(t.name)),onClick:()=>r(!1),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-white/70 hover:bg-white/5",children:[(0,l.jsx)(y.A,{className:"h-3.5 w-3.5"})," Config"]}),(0,l.jsxs)(E(),{href:"/agents/versions?name=".concat(encodeURIComponent(t.name)),onClick:()=>r(!1),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-white/70 hover:bg-white/5",children:[(0,l.jsx)(b.A,{className:"h-3.5 w-3.5"})," Versions"]}),(0,l.jsxs)(E(),{href:"/agents/knowledge?name=".concat(encodeURIComponent(t.name)),onClick:()=>r(!1),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-white/70 hover:bg-white/5",children:[(0,l.jsx)(w.A,{className:"h-3.5 w-3.5"})," Knowledge"]}),(0,l.jsxs)(E(),{href:"/agents/evals?name=".concat(encodeURIComponent(t.name)),onClick:()=>r(!1),className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-white/70 hover:bg-white/5",children:[(0,l.jsx)(v.A,{className:"h-3.5 w-3.5"})," Evals"]}),(0,l.jsx)("div",{className:"my-1 border-t border-white/5"}),(0,l.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(t.name),r(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-white/70 hover:bg-white/5",children:[(0,l.jsx)(j.A,{className:"h-3.5 w-3.5"})," Copy Name"]}),(0,l.jsxs)("button",{onClick:()=>{r(!1),s()},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-red-400 hover:bg-red-500/10",children:[(0,l.jsx)(N.A,{className:"h-3.5 w-3.5"})," Delete"]})]})]})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[t.model&&(0,l.jsx)(d.E,{variant:"info",children:t.model}),t.status&&(0,l.jsx)(d.W,{status:t.status})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3 border-t border-white/5",children:[(0,l.jsx)("span",{className:"text-xs text-white/30",children:t.createdAt?(0,u.fw)(t.createdAt):"Unknown"}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsxs)(E(),{href:"/playground?agent=".concat(t.slug||t.name),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-indigo-500/10 text-indigo-400 hover:bg-indigo-500/20 transition-colors",children:[(0,l.jsx)(k.A,{className:"h-3 w-3"}),"Try"]})})]})]})})}function _(e){let{onClose:t,onCreated:s}=e,[n,d]=(0,a.useState)("upload"),[h,x]=(0,a.useState)(""),[u,m]=(0,a.useState)(""),[f,p]=(0,a.useState)(""),[g,y]=(0,a.useState)([]),[b,w]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),N=(0,a.useRef)(null),k=(0,a.useCallback)(async e=>{let t=[],s=["node_modules/",".git/","__pycache__/",".venv/",".DS_Store"];for(let l of Array.from(e)){let e=l.webkitRelativePath||l.name;if(s.some(t=>e.includes(t)))continue;let a=await l.text();t.push({path:e,content:a})}y(t)},[]);async function M(){if(!h.trim())return void j("Agent name is required");w(!0),j(null);try{await (0,r.KU)().createAgent(h.trim(),{systemPrompt:f||void 0,files:g.length>0?g:void 0}),s()}catch(e){j(e instanceof Error?e.message:"Failed to create agent")}finally{w(!1)}}return(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,l.jsx)(i.Zp,{className:"w-full max-w-lg max-h-[90vh] overflow-auto",children:(0,l.jsxs)(i.Wu,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Create Agent"}),(0,l.jsx)("button",{onClick:t,className:"text-white/40 hover:text-white",children:(0,l.jsx)(C.A,{className:"h-5 w-5"})})]}),(0,l.jsxs)("div",{className:"flex gap-1 p-1 bg-white/5 rounded-lg mb-6",children:[(0,l.jsxs)("button",{onClick:()=>d("upload"),className:"flex-1 flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors ".concat("upload"===n?"bg-white/10 text-white":"text-white/50 hover:text-white"),children:[(0,l.jsx)(A,{className:"h-4 w-4"})," Upload"]}),(0,l.jsxs)("button",{onClick:()=>d("cli"),className:"flex-1 flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors ".concat("cli"===n?"bg-white/10 text-white":"text-white/50 hover:text-white"),children:[(0,l.jsx)(S.A,{className:"h-4 w-4"})," CLI"]})]}),"upload"===n?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(o.p,{label:"Name",placeholder:"my-agent",value:h,onChange:e=>x(e.target.value)}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"System Prompt (optional)"}),(0,l.jsx)("textarea",{value:f,onChange:e=>p(e.target.value),rows:3,placeholder:"You are a helpful assistant...",className:"flex w-full rounded-xl border px-3 py-2 text-sm bg-white/5 border-white/10 text-white placeholder:text-white/40 focus-visible:outline-none focus-visible:border-indigo-500/50 resize-none"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"Agent Files (optional)"}),(0,l.jsxs)("div",{onClick:()=>{var e;return null==(e=N.current)?void 0:e.click()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.files.length>0&&k(e.dataTransfer.files)},className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-white/10 py-8 cursor-pointer hover:border-white/20 hover:bg-white/[0.02] transition-colors",children:[(0,l.jsx)(A,{className:"h-8 w-8 text-white/20 mb-2"}),(0,l.jsx)("p",{className:"text-sm text-white/40",children:"Drop files or click to upload"}),(0,l.jsx)("p",{className:"text-xs text-white/20 mt-1",children:"CLAUDE.md, tools, and agent source files"})]}),(0,l.jsx)("input",{ref:N,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&k(e.target.files)}}),g.length>0&&(0,l.jsxs)("p",{className:"text-xs text-white/50",children:[g.length," file",1!==g.length?"s":""," selected"]})]}),v&&(0,l.jsx)("p",{className:"text-sm text-red-400",children:v}),(0,l.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,l.jsx)(c.$,{variant:"ghost",onClick:t,children:"Cancel"}),(0,l.jsx)(c.$,{onClick:M,disabled:b,children:b?"Creating...":"Create Agent"})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("p",{className:"text-sm text-white/60",children:"Deploy an agent from your local machine using the Ash CLI:"}),(0,l.jsxs)("div",{className:"rounded-lg bg-black/30 p-4 font-mono text-sm text-white/80",children:[(0,l.jsx)("div",{className:"text-white/40 mb-2",children:"# Install the CLI"}),(0,l.jsx)("div",{children:"npm install -g @ash-ai/cli"}),(0,l.jsx)("div",{className:"text-white/40 mt-4 mb-2",children:"# Deploy an agent"}),(0,l.jsx)("div",{children:"ash deploy ./my-agent --name my-agent"})]}),(0,l.jsx)("div",{className:"flex justify-end pt-2",children:(0,l.jsx)(c.$,{variant:"ghost",onClick:t,children:"Close"})})]})]})})})}},5373:(e,t,s)=>{Promise.resolve().then(s.bind(s,5065))},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>r,W:()=>i});var l=s(534),a=s(1804);let n={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function r(e){let{children:t,variant:s="default",className:r}=e;return(0,l.jsx)("span",{className:(0,a.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",n[s],r),children:t})}function i(e){let{status:t}=e;return(0,l.jsx)(r,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6650:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var l=s(534),a=s(1804),n=s(4166);let r={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,n.forwardRef)((e,t)=>{let{className:s,variant:n="primary",size:c="md",disabled:o,...d}=e;return(0,l.jsx)("button",{ref:t,className:(0,a.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",r[n],i[c],s),disabled:o,...d})});c.displayName="Button"},7155:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},7691:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},7955:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var l=s(534),a=s(1804);function n(e){let{width:t="100%",height:s=100,className:n}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",n),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var l=s(534),a=s(1804);function n(e){let{icon:t,title:s,description:n,action:r,className:i}=e;return(0,l.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,l.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,l.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:n}),r&&(0,l.jsx)("div",{className:"mt-4",children:r})]})}},8842:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=5373)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[955],{191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(403)._(n(919));function a(e,t){var n;let a={};"function"==typeof e&&(a.loader=e);let o={...a,...t};return(0,r.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(8919).createAsyncLocalStorage)()},919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(534),a=n(4166),o=n(5452);function l(e){return{default:e&&"default"in e?e.default:e}}n(1649);let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...s,...e},n=(0,a.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,c=s?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(c,{...s?{fallback:l}:{},children:u})}return c.displayName="LoadableComponent",c}},1649:(e,t,n)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(534),n(7763),n(6890),n(2959)},1804:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>c,ZV:()=>s,a3:()=>i,cn:()=>o,fw:()=>l});var r=n(6862),a=n(3690);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}function l(e){let t=Date.now(),n=Math.floor((t-new Date(e).getTime())/1e3);if(n<60)return"".concat(n,"s ago");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let o=Math.floor(a/24);return o<30?"".concat(o,"d ago"):new Date(e).toLocaleDateString()}function s(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function i(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let n=Math.floor(t/60);return"".concat(n,"h ").concat(t%60,"m")}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},4275:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(8154).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},4946:(e,t,n)=>{"use strict";n.d(t,{default:()=>a.a});var r=n(191),a=n.n(r)},5452:(e,t,n)=>{"use strict";function r(e){let{reason:t,children:n}=e;return n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(8560)},6890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(345)},7964:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(534),a=n(1804);function o(e){let{width:t="100%",height:n=100,className:o}=e;return(0,r.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",o),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:n}})}},8497:(e,t,n)=>{Promise.resolve().then(n.bind(n,9107))},8919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return a?new a:new r}function l(e){return a?a.bind(e):r.bind(e)}function s(){return a?a.snapshot():function(e,...t){return e(...t)}}},9107:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var r=n(534),a=n(4166),o=n(9197),l=n(8968),s=n.n(l),i=n(4946),c=n(3929),u=n(7964),d=n(4275);let f=(0,i.default)(()=>n.e(447).then(n.bind(n,6447)).then(e=>({default:e.AgentVersionManager})),{loadableGenerated:{webpack:()=>[null]},ssr:!1,loading:()=>(0,r.jsx)(u.X,{height:200})});function h(){let e=(0,o.useSearchParams)().get("name");return e?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)(s(),{href:"/agents/detail?name=".concat(encodeURIComponent(e)),className:"inline-flex items-center gap-1.5 text-sm text-white/50 hover:text-white transition-colors",children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),"Back to ",e]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Versions"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Manage versions for ",(0,r.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,r.jsx)(f,{client:(0,c.KU)(),agentName:e})]}):(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,r.jsx)(s(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function m(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)(u.X,{height:200}),children:(0,r.jsx)(h,{})})}},9197:(e,t,n)=>{"use strict";var r=n(4841);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=8497)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[745],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,aA:()=>d,aX:()=>h,te:()=>o,xV:()=>m,yu:()=>x});var l=s(4166),a=s(3929);function n(e,t){let s=(0,l.useRef)(e);(0,l.useEffect)(()=>{s.current=e},[e]),(0,l.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=r("ash:agents"),[t,s]=(0,l.useState)(null!=e?e:[]),[n,c]=(0,l.useState)(!e),[o,u]=(0,l.useState)(null),h=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listAgents();s(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{c(!1)}},[]);return(0,l.useEffect)(()=>{h()},[h]),{agents:t,loading:n,error:o,refetch:h}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(s),[o,u]=(0,l.useState)(null!=c?c:[]),[h,d]=(0,l.useState)(!c),[x,m]=(0,l.useState)(null),f=(0,l.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);u(t),i(s,t),m(null)}catch(e){m(e)}finally{d(!1)}},[null==e?void 0:e.agent,s]);return(0,l.useEffect)(()=>{f()},[f]),n(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:h,error:x,refetch:f}}function u(){let[e,t]=(0,l.useState)(()=>r("ash:health")),[s,c]=(0,l.useState)(null),o=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,l.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:s,refetch:o}}function h(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)(!0),[r,i]=(0,l.useState)(null),c=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,l.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:r,refetch:c}}function d(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function x(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function m(e,t){let[s,n]=(0,l.useState)([]),[r,i]=(0,l.useState)(!0),c=(0,l.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,a.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,l.useEffect)(()=>{c()},[c]),{results:s,loading:r,refresh:c}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>r});var l=s(6862),a=s(3690);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,l.$)(t))}function r(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let l=Math.floor(s/60);if(l<60)return"".concat(l,"m ago");let a=Math.floor(l/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return n<30?"".concat(n,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},1924:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},3238:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},4195:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>n,aR:()=>r});var l=s(534),a=s(1804);function n(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function r(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,l.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("p-4 sm:p-6",s),children:t})}},6664:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},6813:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var l=s(534),a=s(4166),n=s(989),r=s(3929),i=s(4765),c=s(7964),o=s(1804),u=s(4195),h=s(3238),d=s(6664),x=s(1924);function m(){let[e,t]=(0,a.useState)("7d"),{agents:s}=(0,n._F)(),{sessions:m}=(0,n.te)({autoRefresh:!1}),[p,g]=(0,a.useState)([]),[y,w]=(0,a.useState)(!0),[v,j]=(0,a.useState)({sessions:0,tokens:0,toolCalls:0,computeSeconds:0});return(0,a.useEffect)(()=>{async function t(){w(!0),function(e){let t=new Date;t.setDate(t.getDate()-("7d"===e?7:"30d"===e?30:90)),t.toISOString()}(e);let t=(0,r.KU)();try{let e=await t.getUsageStats({}).catch(()=>null);e&&j({sessions:m.length,tokens:(e.totalInputTokens||0)+(e.totalOutputTokens||0),toolCalls:e.totalToolCalls||0,computeSeconds:e.totalComputeSeconds||0});let l=[];for(let e of s.slice(0,10))try{let s=await t.getUsageStats({agentName:e.name}),a=m.filter(t=>t.agentName===e.name);l.push({name:e.name,sessions:a.length,inputTokens:(null==s?void 0:s.totalInputTokens)||0,outputTokens:(null==s?void 0:s.totalOutputTokens)||0,toolCalls:(null==s?void 0:s.totalToolCalls)||0,computeSeconds:(null==s?void 0:s.totalComputeSeconds)||0})}catch(t){l.push({name:e.name,sessions:0,inputTokens:0,outputTokens:0,toolCalls:0,computeSeconds:0})}l.sort((e,t)=>t.sessions-e.sessions),g(l)}catch(e){}finally{w(!1)}}s.length>0?t():w(!1)},[e,s,m]),(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Analytics"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Usage and performance metrics"})]}),(0,l.jsx)("div",{className:"flex gap-1 p-1 bg-white/5 rounded-lg",children:["7d","30d","90d"].map(s=>(0,l.jsx)("button",{onClick:()=>t(s),className:"px-3 py-1.5 text-sm font-medium rounded-md transition-colors ".concat(e===s?"bg-white/10 text-white":"text-white/40 hover:text-white/70"),children:s},s))})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,l.jsx)(f,{icon:(0,l.jsx)(u.A,{className:"h-5 w-5"}),label:"Sessions",value:y?"-":v.sessions.toString()}),(0,l.jsx)(f,{icon:(0,l.jsx)(h.A,{className:"h-5 w-5"}),label:"Total Tokens",value:y?"-":(0,o.ZV)(v.tokens)}),(0,l.jsx)(f,{icon:(0,l.jsx)(d.A,{className:"h-5 w-5"}),label:"Tool Calls",value:y?"-":(0,o.ZV)(v.toolCalls)}),(0,l.jsx)(f,{icon:(0,l.jsx)(x.A,{className:"h-5 w-5"}),label:"Compute Time",value:y?"-":(0,o.a3)(v.computeSeconds)})]}),(0,l.jsxs)(i.Zp,{children:[(0,l.jsx)(i.aR,{children:(0,l.jsx)(i.ZB,{children:"Top Agents"})}),(0,l.jsx)(i.Wu,{className:"p-0",children:y?(0,l.jsx)("div",{className:"p-4 space-y-2",children:[1,2,3].map(e=>(0,l.jsx)(c.X,{height:40},e))}):0===p.length?(0,l.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No usage data for this period"}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-white/10",children:[(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Agent"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Sessions"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Tokens"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Tool Calls"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Compute"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-white/5",children:p.map(e=>(0,l.jsxs)("tr",{className:"hover:bg-white/[0.02]",children:[(0,l.jsx)("td",{className:"px-6 py-3 text-white/80 font-medium",children:e.name}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-white/60",children:e.sessions}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-white/60",children:(0,o.ZV)(e.inputTokens+e.outputTokens)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-white/60",children:e.toolCalls}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-white/60",children:(0,o.a3)(e.computeSeconds)})]},e.name))})]})})]})]})}function f(e){let{icon:t,label:s,value:a}=e;return(0,l.jsx)(i.Zp,{children:(0,l.jsx)(i.Wu,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-white/50",children:s}),(0,l.jsx)("p",{className:"text-2xl font-bold text-white mt-1",children:a})]}),(0,l.jsx)("div",{className:"text-white/20",children:t})]})})})}},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var l=s(534),a=s(1804);function n(e){let{width:t="100%",height:s=100,className:n}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",n),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8154:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(4166);let a=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,l.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:o="",children:u,iconNode:h,...d}=e;return(0,l.createElement)("svg",{ref:t,...n,width:r,height:r,stroke:s,strokeWidth:c?24*Number(i)/Number(r):i,className:a("lucide",o),...d},[...h.map(e=>{let[t,s]=e;return(0,l.createElement)(t,s)}),...Array.isArray(u)?u:[u]])}),i=(e,t)=>{let s=(0,l.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,l.createElement)(r,{ref:n,iconNode:t,className:a("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...c})});return s.displayName="".concat(e),s}},8593:(e,t,s)=>{Promise.resolve().then(s.bind(s,6813))}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=8593)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{989:(e,t,n)=>{"use strict";n.d(t,{Wz:()=>u,_F:()=>o,aA:()=>f,aX:()=>h,te:()=>c,xV:()=>x,yu:()=>d});var l=n(4166),a=n(3929);function s(e,t){let n=(0,l.useRef)(e);(0,l.useEffect)(()=>{n.current=e},[e]),(0,l.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>n.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function o(){let e=r("ash:agents"),[t,n]=(0,l.useState)(null!=e?e:[]),[s,o]=(0,l.useState)(!e),[c,u]=(0,l.useState)(null),h=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listAgents();n(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{o(!1)}},[]);return(0,l.useEffect)(()=>{h()},[h]),{agents:t,loading:s,error:c,refetch:h}}function c(e){var t;let n="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),o=r(n),[c,u]=(0,l.useState)(null!=o?o:[]),[h,f]=(0,l.useState)(!o),[d,x]=(0,l.useState)(null),g=(0,l.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);u(t),i(n,t),x(null)}catch(e){x(e)}finally{f(!1)}},[null==e?void 0:e.agent,n]);return(0,l.useEffect)(()=>{g()},[g]),s(()=>g(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:c,loading:h,error:d,refetch:g}}function u(){let[e,t]=(0,l.useState)(()=>r("ash:health")),[n,o]=(0,l.useState)(null),c=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().health();t(e),o(null),i("ash:health",e)}catch(e){o(e)}},[]);return(0,l.useEffect)(()=>{c()},[c]),s(()=>c(),3e4),{health:e,error:n,refetch:c}}function h(){let[e,t]=(0,l.useState)([]),[n,s]=(0,l.useState)(!0),[r,i]=(0,l.useState)(null),o=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{s(!1)}},[]);return(0,l.useEffect)(()=>{o()},[o]),{credentials:e,loading:n,error:r,refetch:o}}function f(e){let[t,n]=(0,l.useState)([]),[s,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listAgentVersions(e);n(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{versions:t,loading:s,refresh:i}}function d(e){let[t,n]=(0,l.useState)([]),[s,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listEvalRuns(e);n(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{runs:t,loading:s,refresh:i}}function x(e,t){let[n,s]=(0,l.useState)([]),[r,i]=(0,l.useState)(!0),o=(0,l.useCallback)(async()=>{if(e&&t)try{i(!0);let n=await (0,a.KU)().getEvalRunResults(e,t);s(n)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,l.useEffect)(()=>{o()},[o]),{results:n,loading:r,refresh:o}}},1804:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>c,ZV:()=>i,a3:()=>o,cn:()=>s,fw:()=>r});var l=n(6862),a=n(3690);function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,l.$)(t))}function r(e){let t=Date.now(),n=Math.floor((t-new Date(e).getTime())/1e3);if(n<60)return"".concat(n,"s ago");let l=Math.floor(n/60);if(l<60)return"".concat(l,"m ago");let a=Math.floor(l/60);if(a<24)return"".concat(a,"h ago");let s=Math.floor(a/24);return s<30?"".concat(s,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function o(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let n=Math.floor(t/60);return"".concat(n,"h ").concat(t%60,"m")}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2553:(e,t,n)=>{"use strict";n.d(t,{DashboardNav:()=>w});var l=n(534),a=n(8968),s=n.n(a),r=n(9197),i=n(1804),o=n(989),c=n(8785),u=n(647),h=n(3),f=n(4195),d=n(7413),x=n(2087),g=n(5689),b=n(4193),m=n(8530);let v=[{href:"/",label:"Dashboard",icon:c.A},{href:"/playground",label:"Playground",icon:u.A},{href:"/agents",label:"Agents",icon:h.A},{href:"/sessions",label:"Sessions",icon:f.A},{href:"/logs",label:"Logs",icon:d.A},{href:"/analytics",label:"Analytics",icon:x.A}],y=[{href:"/settings/api-keys",label:"API Keys",icon:g.A},{href:"/settings/credentials",label:"Credentials",icon:b.A},{href:"/queue",label:"Queue",icon:m.A}];function w(e){let{extraItems:t,extraBottomLinks:n,branding:a}=e,c=(0,r.usePathname)(),{health:u}=(0,o.Wz)(),h=t?[...v,...t]:v,f=n?[...y,...n]:y,d=(null==u?void 0:u.status)==="ok";return(0,l.jsxs)("nav",{className:"fixed inset-y-0 left-0 z-50 w-64 flex flex-col border-r border-white/10 bg-[#0d1117]",children:[(0,l.jsxs)("div",{className:"flex h-16 items-center gap-3 px-5 border-b border-white/10",children:[(0,l.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-indigo-500",children:(0,l.jsx)("span",{className:"text-sm font-bold text-white",children:"A"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("span",{className:"text-white font-bold tracking-tight block",children:a||"Ash"}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 text-white/40 text-xs font-mono",children:[(0,l.jsx)("span",{className:(0,i.cn)("w-1.5 h-1.5 rounded-full",d?"bg-green-400 animate-pulse":"bg-red-400")}),d?"ONLINE":"OFFLINE"]})]})]}),(0,l.jsx)("div",{className:"flex-1 overflow-auto px-3 py-4 scrollbar-thin",children:(0,l.jsx)("div",{className:"space-y-0.5",children:h.map(e=>{let t=c===e.href||"/"!==e.href&&c.startsWith(e.href);return(0,l.jsxs)(s(),{href:e.href,className:(0,i.cn)("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200",t?"bg-indigo-500/10 text-indigo-400 border border-indigo-500/30":"text-white/60 hover:text-white hover:bg-white/5 border border-transparent"),children:[(0,l.jsx)(e.icon,{className:"h-4 w-4"}),e.label,t&&(0,l.jsx)("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-indigo-400 animate-pulse"})]},e.href)})})}),(0,l.jsxs)("div",{className:"border-t border-white/10 px-3 py-3 space-y-0.5",children:[f.map(e=>{let t=!e.external&&c.startsWith(e.href);return e.external?(0,l.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-white/40 hover:text-white hover:bg-white/5 transition-all duration-200",children:[(0,l.jsx)(e.icon,{className:"h-4 w-4"}),e.label]},e.label):(0,l.jsxs)(s(),{href:e.href,className:(0,i.cn)("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200",t?"text-indigo-400":"text-white/40 hover:text-white hover:bg-white/5"),children:[(0,l.jsx)(e.icon,{className:"h-4 w-4"}),e.label]},e.label)}),(null==u?void 0:u.version)&&(0,l.jsxs)("div",{className:"px-3 py-2 text-xs text-white/20 font-mono",children:["v",u.version]})]})]})}},6121:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,9061,23)),Promise.resolve().then(n.t.bind(n,9480,23)),Promise.resolve().then(n.bind(n,2553)),Promise.resolve().then(n.bind(n,6412))},6412:(e,t,n)=>{"use strict";n.d(t,{AshProvider:()=>i});var l=n(534),a=n(4166),s=n(3929);let r=(0,a.createContext)(null);function i(e){let{children:t}=e,n=(0,s.KU)();return(0,l.jsx)(r.Provider,{value:n,children:t})}},9480:()=>{}},e=>{e.O(0,[827,513,53,839,90,929,705,522,358],()=>e(e.s=6121)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[524],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,aA:()=>h,aX:()=>d,te:()=>o,xV:()=>f,yu:()=>x});var a=s(4166),l=s(3929);function n(e,t){let s=(0,a.useRef)(e);(0,a.useEffect)(()=>{s.current=e},[e]),(0,a.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=r("ash:agents"),[t,s]=(0,a.useState)(null!=e?e:[]),[n,c]=(0,a.useState)(!e),[o,u]=(0,a.useState)(null),d=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().listAgents();s(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{c(!1)}},[]);return(0,a.useEffect)(()=>{d()},[d]),{agents:t,loading:n,error:o,refetch:d}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(s),[o,u]=(0,a.useState)(null!=c?c:[]),[d,h]=(0,a.useState)(!c),[x,f]=(0,a.useState)(null),m=(0,a.useCallback)(async()=>{try{let t=await (0,l.KU)().listSessions(null==e?void 0:e.agent);u(t),i(s,t),f(null)}catch(e){f(e)}finally{h(!1)}},[null==e?void 0:e.agent,s]);return(0,a.useEffect)(()=>{m()},[m]),n(()=>m(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:d,error:x,refetch:m}}function u(){let[e,t]=(0,a.useState)(()=>r("ash:health")),[s,c]=(0,a.useState)(null),o=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,a.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:s,refetch:o}}function d(){let[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)(!0),[r,i]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,a.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:r,refetch:c}}function h(e){let[t,s]=(0,a.useState)([]),[n,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function x(e){let[t,s]=(0,a.useState)([]),[n,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function f(e,t){let[s,n]=(0,a.useState)([]),[r,i]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,l.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,a.useEffect)(()=>{c()},[c]),{results:s,loading:r,refresh:c}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>r});var a=s(6862),l=s(3690);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,l.QP)((0,a.$)(t))}function r(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let a=Math.floor(s/60);if(a<60)return"".concat(a,"m ago");let l=Math.floor(a/60);if(l<24)return"".concat(l,"h ago");let n=Math.floor(l/24);return n<30?"".concat(n,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2998:(e,t,s)=>{Promise.resolve().then(s.bind(s,3345))},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});var a=s(534),l=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,options:r,placeholder:i,id:c,...o}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,a.jsx)("label",{htmlFor:c,className:"block text-sm font-medium text-white/70",children:n}),(0,a.jsxs)("select",{ref:t,id:c,className:(0,l.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white","focus-visible:outline-none focus-visible:border-indigo-500/50",s),...o,children:[i&&(0,a.jsx)("option",{value:"",className:"bg-[#1c2129]",children:i}),r.map(e=>(0,a.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});n.displayName="Select"},3345:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>w});var a=s(534),l=s(4166),n=s(989),r=s(3929),i=s(4765),c=s(6719),o=s(5968),u=s(3007),d=s(7964),h=s(1804),x=s(8154);let f=(0,x.A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),m=(0,x.A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),v=(0,x.A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var p=s(3544),g=s(3634);function w(){let{agents:e}=(0,n._F)(),[t,s]=(0,l.useState)(""),[r,o]=(0,l.useState)(""),[x,p]=(0,l.useState)(""),[g,w]=(0,l.useState)(!0),{sessions:y,loading:j,refetch:N}=(0,n.te)({agent:t||void 0,autoRefresh:g}),S=y.filter(e=>{if(r&&e.status!==r)return!1;if(x){let t=x.toLowerCase();return e.id.toLowerCase().includes(t)||e.agentName.toLowerCase().includes(t)||e.status.toLowerCase().includes(t)}return!0});return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Logs"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Session activity and event explorer"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(c.$,{variant:"ghost",size:"sm",onClick:function(){let e=new Blob([["Session ID,Agent,Status,Created",...S.map(e=>[e.id,e.agentName,e.status,e.createdAt].join(","))].join("\n")],{type:"text/csv"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="sessions.csv",s.click(),URL.revokeObjectURL(t)},children:[(0,a.jsx)(f,{className:"h-4 w-4 mr-1"})," CSV"]}),(0,a.jsxs)(c.$,{variant:"ghost",size:"sm",onClick:function(){let e=new Blob([JSON.stringify(S,null,2)],{type:"application/json"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="sessions.json",s.click(),URL.revokeObjectURL(t)},children:[(0,a.jsx)(f,{className:"h-4 w-4 mr-1"})," JSON"]}),(0,a.jsx)(c.$,{variant:g?"secondary":"ghost",size:"sm",onClick:()=>w(!g),children:(0,a.jsx)(m,{className:(0,h.cn)("h-4 w-4",g&&"animate-spin")})})]})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(v,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/30"}),(0,a.jsx)("input",{type:"text",placeholder:"Search sessions...",value:x,onChange:e=>p(e.target.value),className:"w-full h-9 pl-9 pr-3 rounded-xl border bg-white/5 border-white/10 text-sm text-white placeholder:text-white/40 focus-visible:outline-none focus-visible:border-indigo-500/50"})]}),(0,a.jsx)(u.l,{options:[{value:"",label:"All Agents"},...e.map(e=>({value:e.name,label:e.name}))],value:t,onChange:e=>s(e.target.value),className:"w-40 h-9 text-xs"}),(0,a.jsx)(u.l,{options:[{value:"",label:"All Statuses"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"ended",label:"Ended"},{value:"error",label:"Error"}],value:r,onChange:e=>o(e.target.value),className:"w-36 h-9 text-xs"})]}),(0,a.jsx)(i.Zp,{children:(0,a.jsx)(i.Wu,{className:"p-0",children:j?(0,a.jsx)("div",{className:"p-4 space-y-2",children:[1,2,3,4,5].map(e=>(0,a.jsx)(d.X,{height:40},e))}):0===S.length?(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-12",children:"No sessions found"}):(0,a.jsx)("div",{className:"divide-y divide-white/5",children:S.map(e=>(0,a.jsx)(b,{session:e},e.id))})})})]})}function b(e){let{session:t}=e,[s,n]=(0,l.useState)(!1),[i,c]=(0,l.useState)([]),[u,x]=(0,l.useState)(!1);async function f(){if(!s&&0===i.length){x(!0);try{let e=await (0,r.KU)().listSessionEvents(t.id,{limit:50});c(e)}catch(e){}finally{x(!1)}}n(!s)}return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:f,"aria-expanded":s,className:"flex items-center gap-4 w-full px-4 py-3 text-sm hover:bg-white/[0.02] transition-colors",children:[s?(0,a.jsx)(p.A,{className:"h-4 w-4 text-white/30 shrink-0"}):(0,a.jsx)(g.A,{className:"h-4 w-4 text-white/30 shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-white/30 w-24",children:(0,h.fw)(t.createdAt)}),(0,a.jsx)("span",{className:"text-xs font-mono text-white/50 w-20",children:(0,h.Ct)(t.id)}),(0,a.jsx)("span",{className:"text-sm text-white/70 flex-1 text-left truncate",children:t.agentName}),(0,a.jsx)(o.W,{status:t.status})]}),s&&(0,a.jsx)("div",{className:"pl-12 pr-4 pb-4",children:u?(0,a.jsx)("div",{className:"space-y-1",children:[1,2,3].map(e=>(0,a.jsx)(d.X,{height:24},e))}):0===i.length?(0,a.jsx)("p",{className:"text-xs text-white/30 py-2",children:"No events"}):(0,a.jsx)("div",{className:"space-y-0.5 max-h-64 overflow-auto scrollbar-thin",children:i.map((e,t)=>{let s="";try{var l,n;let t="string"==typeof e.data?JSON.parse(e.data):e.data;s=(null==t||null==(l=t.text)?void 0:l.slice(0,80))||(null==t?void 0:t.name)||(null==t||null==(n=t.error)?void 0:n.slice(0,80))||""}catch(e){}return(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs py-1",children:[(0,a.jsxs)("span",{className:"text-white/20 font-mono w-6",children:["#",e.sequence]}),(0,a.jsx)(o.E,{children:e.type}),(0,a.jsx)("span",{className:"text-white/40 truncate",children:s})]},e.id||t)})})})]})}},3544:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},3634:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>n,aR:()=>r});var a=s(534),l=s(1804);function n(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function r(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,a.jsx)("h3",{className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("p-4 sm:p-6",s),children:t})}},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>r,W:()=>i});var a=s(534),l=s(1804);let n={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function r(e){let{children:t,variant:s="default",className:r}=e;return(0,a.jsx)("span",{className:(0,l.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",n[s],r),children:t})}function i(e){let{status:t}=e;return(0,a.jsx)(r,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(534),l=s(1804),n=s(4166);let r={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,n.forwardRef)((e,t)=>{let{className:s,variant:n="primary",size:c="md",disabled:o,...u}=e;return(0,a.jsx)("button",{ref:t,className:(0,l.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",r[n],i[c],s),disabled:o,...u})});c.displayName="Button"},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var a=s(534),l=s(1804);function n(e){let{width:t="100%",height:s=100,className:n}=e;return(0,a.jsx)("div",{className:(0,l.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",n),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8154:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(4166);let l=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:o="",children:u,iconNode:d,...h}=e;return(0,a.createElement)("svg",{ref:t,...n,width:r,height:r,stroke:s,strokeWidth:c?24*Number(i)/Number(r):i,className:l("lucide",o),...h},[...d.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(u)?u:[u]])}),i=(e,t)=>{let s=(0,a.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,a.createElement)(r,{ref:n,iconNode:t,className:l("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...c})});return s.displayName="".concat(e),s}}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=2998)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{3:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(8154).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,aA:()=>h,aX:()=>d,te:()=>o,xV:()=>x,yu:()=>f});var n=s(4166),a=s(3929);function l(e,t){let s=(0,n.useRef)(e);(0,n.useEffect)(()=>{s.current=e},[e]),(0,n.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=r("ash:agents"),[t,s]=(0,n.useState)(null!=e?e:[]),[l,c]=(0,n.useState)(!e),[o,u]=(0,n.useState)(null),d=(0,n.useCallback)(async()=>{try{let e=await (0,a.KU)().listAgents();s(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{c(!1)}},[]);return(0,n.useEffect)(()=>{d()},[d]),{agents:t,loading:l,error:o,refetch:d}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(s),[o,u]=(0,n.useState)(null!=c?c:[]),[d,h]=(0,n.useState)(!c),[f,x]=(0,n.useState)(null),g=(0,n.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);u(t),i(s,t),x(null)}catch(e){x(e)}finally{h(!1)}},[null==e?void 0:e.agent,s]);return(0,n.useEffect)(()=>{g()},[g]),l(()=>g(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:d,error:f,refetch:g}}function u(){let[e,t]=(0,n.useState)(()=>r("ash:health")),[s,c]=(0,n.useState)(null),o=(0,n.useCallback)(async()=>{try{let e=await (0,a.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,n.useEffect)(()=>{o()},[o]),l(()=>o(),3e4),{health:e,error:s,refetch:o}}function d(){let[e,t]=(0,n.useState)([]),[s,l]=(0,n.useState)(!0),[r,i]=(0,n.useState)(null),c=(0,n.useCallback)(async()=>{try{let e=await (0,a.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{l(!1)}},[]);return(0,n.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:r,refetch:c}}function h(e){let[t,s]=(0,n.useState)([]),[l,r]=(0,n.useState)(!0),i=(0,n.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,n.useEffect)(()=>{i()},[i]),{versions:t,loading:l,refresh:i}}function f(e){let[t,s]=(0,n.useState)([]),[l,r]=(0,n.useState)(!0),i=(0,n.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,n.useEffect)(()=>{i()},[i]),{runs:t,loading:l,refresh:i}}function x(e,t){let[s,l]=(0,n.useState)([]),[r,i]=(0,n.useState)(!0),c=(0,n.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,a.KU)().getEvalRunResults(e,t);l(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,n.useEffect)(()=>{c()},[c]),{results:s,loading:r,refresh:c}}},1710:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var n=s(534),a=s(989),l=s(4765),r=s(5968),i=s(7964),c=s(1804),o=s(3),u=s(4195),d=s(3238),h=s(6664),f=s(8968),x=s.n(f);function g(){var e,t;let{agents:s,loading:f}=(0,a._F)(),{sessions:g,loading:y}=(0,a.te)({limit:5}),{health:v}=(0,a.Wz)(),p=g.filter(e=>"active"===e.status);return(0,n.jsxs)("div",{className:"space-y-8",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Dashboard"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Overview of your Ash server"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,n.jsx)(m,{icon:(0,n.jsx)(o.A,{className:"h-5 w-5"}),label:"Agents",value:f?"-":s.length.toString(),href:"/agents"}),(0,n.jsx)(m,{icon:(0,n.jsx)(u.A,{className:"h-5 w-5"}),label:"Active Sessions",value:y?"-":p.length.toString(),href:"/sessions"}),(0,n.jsx)(m,{icon:(0,n.jsx)(d.A,{className:"h-5 w-5"}),label:"Total Sessions",value:y?"-":g.length.toString(),href:"/sessions"}),(0,n.jsx)(m,{icon:(0,n.jsx)(h.A,{className:"h-5 w-5"}),label:"Sandboxes",value:null!=(t=null==v||null==(e=v.activeSandboxes)?void 0:e.toString())?t:"-"})]}),(0,n.jsxs)(l.Zp,{children:[(0,n.jsx)(l.aR,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)(l.ZB,{children:"Recent Sessions"}),(0,n.jsx)(x(),{href:"/sessions",className:"text-sm text-indigo-400 hover:text-indigo-300 transition-colors",children:"View all"})]})}),(0,n.jsx)(l.Wu,{children:y?(0,n.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,n.jsx)(i.X,{height:48},e))}):0===g.length?(0,n.jsx)("p",{className:"text-sm text-white/40 py-8 text-center",children:"No sessions yet. Create an agent and start a session in the Playground."}):(0,n.jsx)("div",{className:"space-y-2",children:g.slice(0,5).map(e=>(0,n.jsxs)(x(),{href:"/sessions?id=".concat(e.id),className:"flex items-center justify-between rounded-lg border border-white/5 bg-white/[0.02] px-4 py-3 hover:bg-white/5 transition-colors",children:[(0,n.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white truncate",children:e.agentName}),(0,n.jsx)("p",{className:"text-xs text-white/40 font-mono",children:e.id.slice(0,8)})]})}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(r.W,{status:e.status}),(0,n.jsx)("span",{className:"text-xs text-white/30",children:(0,c.fw)(e.createdAt)})]})]},e.id))})})]})]})}function m(e){let{icon:t,label:s,value:a,href:r}=e,i=(0,n.jsx)(l.Zp,{className:r?"hover:border-white/20 cursor-pointer":"",children:(0,n.jsx)(l.Wu,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm text-white/50",children:s}),(0,n.jsx)("p",{className:"text-2xl font-bold text-white mt-1",children:a})]}),(0,n.jsx)("div",{className:"text-white/20",children:t})]})})});return r?(0,n.jsx)(x(),{href:r,children:i}):i}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>l,fw:()=>r});var n=s(6862),a=s(3690);function l(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,n.$)(t))}function r(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let n=Math.floor(s/60);if(n<60)return"".concat(n,"m ago");let a=Math.floor(n/60);if(a<24)return"".concat(a,"h ago");let l=Math.floor(a/24);return l<30?"".concat(l,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},3238:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(8154).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},4195:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(8154).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>l,aR:()=>r});var n=s(534),a=s(1804);function l(e){let{children:t,className:s}=e;return(0,n.jsx)("div",{className:(0,a.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function r(e){let{children:t,className:s}=e;return(0,n.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,n.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,n.jsx)("div",{className:(0,a.cn)("p-4 sm:p-6",s),children:t})}},4854:(e,t,s)=>{Promise.resolve().then(s.bind(s,1710))},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>r,W:()=>i});var n=s(534),a=s(1804);let l={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function r(e){let{children:t,variant:s="default",className:r}=e;return(0,n.jsx)("span",{className:(0,a.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",l[s],r),children:t})}function i(e){let{status:t}=e;return(0,n.jsx)(r,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6664:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(8154).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>l});var n=s(534),a=s(1804);function l(e){let{width:t="100%",height:s=100,className:l}=e;return(0,n.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",l),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=4854)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(403)._(n(919));function u(e,t){var n;let u={};"function"==typeof e&&(u.loader=e);let a={...u,...t};return(0,r.default)({...a,modules:null==(n=a.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(8919).createAsyncLocalStorage)()},919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(534),u=n(4166),a=n(5452);function l(e){return{default:e&&"default"in e?e.default:e}}n(1649);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},s=function(e){let t={...o,...e},n=(0,u.lazy)(()=>t.loader().then(l)),s=t.loading;function i(e){let l=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,i=o?u.Suspense:u.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(i,{...o?{fallback:l}:{},children:c})}return i.displayName="LoadableComponent",i}},1649:(e,t,n)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(534),n(7763),n(6890),n(2959)},4083:(e,t,n)=>{Promise.resolve().then(n.bind(n,5186))},4946:(e,t,n)=>{"use strict";n.d(t,{default:()=>u.a});var r=n(191),u=n.n(r)},5186:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(534),u=n(4166),a=n(9197),l=n(3929);let o=(0,n(4946).default)(()=>Promise.all([n.e(513),n.e(447)]).then(n.bind(n,6447)).then(e=>({default:e.Playground})),{loadableGenerated:{webpack:()=>[null]},ssr:!1,loading:()=>(0,r.jsx)(s,{})});function s(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)("div",{className:"text-sm text-white/40",children:"Loading playground..."})})}function i(){let e=(0,a.useSearchParams)().get("agent")||void 0,t=(0,l.KU)();return(0,r.jsx)("div",{className:"h-[calc(100vh-5rem)]",children:(0,r.jsx)(o,{client:t,...e?{initialAgent:e}:{}})})}function c(){return(0,r.jsx)(u.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(i,{})})}},5452:(e,t,n)=>{"use strict";function r(e){let{reason:t,children:n}=e;return n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(8560)},6890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(345)},8919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return o}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let u="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return u?new u:new r}function l(e){return u?u.bind(e):r.bind(e)}function o(){return u?u.snapshot():function(e,...t){return e(...t)}}},9197:(e,t,n)=>{"use strict";var r=n(4841);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[53,929,705,522,358],()=>e(e.s=4083)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[166],{858:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>d,_F:()=>c,aA:()=>h,aX:()=>u,te:()=>o,xV:()=>m,yu:()=>x});var l=s(4166),a=s(3929);function n(e,t){let s=(0,l.useRef)(e);(0,l.useEffect)(()=>{s.current=e},[e]),(0,l.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function r(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=r("ash:agents"),[t,s]=(0,l.useState)(null!=e?e:[]),[n,c]=(0,l.useState)(!e),[o,d]=(0,l.useState)(null),u=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listAgents();s(e),i("ash:agents",e),d(null)}catch(e){d(e)}finally{c(!1)}},[]);return(0,l.useEffect)(()=>{u()},[u]),{agents:t,loading:n,error:o,refetch:u}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(s),[o,d]=(0,l.useState)(null!=c?c:[]),[u,h]=(0,l.useState)(!c),[x,m]=(0,l.useState)(null),f=(0,l.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);d(t),i(s,t),m(null)}catch(e){m(e)}finally{h(!1)}},[null==e?void 0:e.agent,s]);return(0,l.useEffect)(()=>{f()},[f]),n(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:u,error:x,refetch:f}}function d(){let[e,t]=(0,l.useState)(()=>r("ash:health")),[s,c]=(0,l.useState)(null),o=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,l.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:s,refetch:o}}function u(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)(!0),[r,i]=(0,l.useState)(null),c=(0,l.useCallback)(async()=>{try{let e=await (0,a.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,l.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:r,refetch:c}}function h(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function x(e){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,a.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function m(e,t){let[s,n]=(0,l.useState)([]),[r,i]=(0,l.useState)(!0),c=(0,l.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,a.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,l.useEffect)(()=>{c()},[c]),{results:s,loading:r,refresh:c}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>r});var l=s(6862),a=s(3690);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,l.$)(t))}function r(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let l=Math.floor(s/60);if(l<60)return"".concat(l,"m ago");let a=Math.floor(l/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return n<30?"".concat(n,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});var l=s(534),a=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,options:r,placeholder:i,id:c,...o}=e;return(0,l.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,l.jsx)("label",{htmlFor:c,className:"block text-sm font-medium text-white/70",children:n}),(0,l.jsxs)("select",{ref:t,id:c,className:(0,a.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white","focus-visible:outline-none focus-visible:border-indigo-500/50",s),...o,children:[i&&(0,l.jsx)("option",{value:"",className:"bg-[#1c2129]",children:i}),r.map(e=>(0,l.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});n.displayName="Select"},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>n,aR:()=>r});var l=s(534),a=s(1804);function n(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function r(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,l.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,a.cn)("p-4 sm:p-6",s),children:t})}},6135:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},6650:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var l=s(534),a=s(1804),n=s(4166);let r={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,n.forwardRef)((e,t)=>{let{className:s,variant:n="primary",size:c="md",disabled:o,...d}=e;return(0,l.jsx)("button",{ref:t,className:(0,a.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",r[n],i[c],s),disabled:o,...d})});c.displayName="Button"},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var l=s(534),a=s(1804);function n(e){let{width:t="100%",height:s=100,className:n}=e;return(0,l.jsx)("div",{className:(0,a.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",n),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8154:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(4166);let a=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,l.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:o="",children:d,iconNode:u,...h}=e;return(0,l.createElement)("svg",{ref:t,...n,width:r,height:r,stroke:s,strokeWidth:c?24*Number(i)/Number(r):i,className:a("lucide",o),...h},[...u.map(e=>{let[t,s]=e;return(0,l.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let s=(0,l.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,l.createElement)(r,{ref:n,iconNode:t,className:a("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...c})});return s.displayName="".concat(e),s}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var l=s(534),a=s(1804);function n(e){let{icon:t,title:s,description:n,action:r,className:i}=e;return(0,l.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,l.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,l.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:n}),r&&(0,l.jsx)("div",{className:"mt-4",children:r})]})}},8530:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},9204:(e,t,s)=>{Promise.resolve().then(s.bind(s,9498))},9498:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var l=s(534),a=s(4166),n=s(989),r=s(3929),i=s(4765),c=s(6719),o=s(3007),d=s(8314),u=s(7964),h=s(1804),x=s(858),m=s(8530),f=s(6135),p=s(6650);let b={pending:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",processing:"bg-blue-500/20 text-blue-400 border-blue-500/30",completed:"bg-green-500/20 text-green-400 border-green-500/30",failed:"bg-red-500/20 text-red-400 border-red-500/30",cancelled:"bg-zinc-500/20 text-zinc-400 border-zinc-500/30"};function g(){let{agents:e}=(0,n._F)(),[t,s]=(0,a.useState)([]),[p,g]=(0,a.useState)(null),[v,w]=(0,a.useState)(!0),[j,N]=(0,a.useState)(""),[k,S]=(0,a.useState)(!1),[A,C]=(0,a.useState)(null),E=(0,a.useCallback)(async()=>{try{let e=(0,r.KU)(),[t,l]=await Promise.all([e.listQueueItems(j?{status:j}:{}),e.getQueueStats()]);s(t),g(l)}catch(e){}finally{w(!1)}},[j]);async function M(e){C(null);try{await (0,r.KU)().cancelQueueItem(e),E()}catch(e){C(e instanceof Error?e.message:"Failed to cancel job")}}return(0,a.useEffect)(()=>{E();let e=setInterval(E,5e3);return()=>clearInterval(e)},[E]),(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Queue"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Async job queue for agent tasks"})]}),(0,l.jsxs)(c.$,{onClick:()=>S(!0),children:[(0,l.jsx)(x.A,{className:"h-4 w-4 mr-2"}),"Enqueue Job"]})]}),A&&(0,l.jsx)("div",{className:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2",children:A}),p&&(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:["pending","processing","completed","failed","cancelled"].map(e=>(0,l.jsx)(i.Zp,{children:(0,l.jsxs)(i.Wu,{className:"py-3",children:[(0,l.jsx)("p",{className:"text-xs text-white/40 capitalize",children:e}),(0,l.jsx)("p",{className:"text-xl font-bold text-white",children:p[e]})]})},e))}),(0,l.jsx)("div",{className:"flex gap-3",children:(0,l.jsx)(o.l,{options:[{value:"",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"processing",label:"Processing"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],value:j,onChange:e=>N(e.target.value),className:"w-40"})}),(0,l.jsx)(i.Zp,{children:(0,l.jsx)(i.Wu,{className:"p-0",children:v?(0,l.jsx)("div",{className:"p-4 space-y-2",children:[1,2,3].map(e=>(0,l.jsx)(u.X,{height:48},e))}):0===t.length?(0,l.jsx)(d.p,{icon:(0,l.jsx)(m.A,{className:"h-12 w-12"}),title:"Queue is empty",description:"Enqueue a job to process it asynchronously.",action:(0,l.jsxs)(c.$,{onClick:()=>S(!0),children:[(0,l.jsx)(x.A,{className:"h-4 w-4 mr-2"}),"Enqueue Job"]})}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-white/10",children:[(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"ID"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Agent"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Prompt"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Status"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Age"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Actions"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-white/5",children:t.map(e=>(0,l.jsxs)("tr",{className:"hover:bg-white/[0.02]",children:[(0,l.jsx)("td",{className:"px-6 py-3 font-mono text-xs text-white/50",children:(0,h.Ct)(e.id)}),(0,l.jsx)("td",{className:"px-6 py-3 text-white/80",children:e.agentName}),(0,l.jsx)("td",{className:"px-6 py-3 text-white/60 max-w-xs truncate",children:e.prompt}),(0,l.jsx)("td",{className:"px-6 py-3",children:(0,l.jsx)("span",{className:(0,h.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium border",b[e.status]||b.pending),children:e.status})}),(0,l.jsx)("td",{className:"px-6 py-3 text-white/40 text-xs",children:(0,h.fw)(e.createdAt)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:"pending"===e.status&&(0,l.jsx)(c.$,{variant:"ghost",size:"sm",onClick:()=>M(e.id),className:"text-red-400",children:(0,l.jsx)(f.A,{className:"h-3.5 w-3.5"})})})]},e.id))})]})})}),k&&(0,l.jsx)(y,{agents:e,onClose:()=>S(!1),onCreated:()=>{S(!1),E()}})]})}function y(e){var t;let{agents:s,onClose:n,onCreated:d}=e,[u,h]=(0,a.useState)((null==(t=s[0])?void 0:t.name)||""),[x,m]=(0,a.useState)(""),[f,b]=(0,a.useState)(!1),[g,y]=(0,a.useState)(null);async function v(){if(!u||!x.trim())return void y("Agent and prompt are required");b(!0),y(null);try{await (0,r.KU)().enqueue(u,x.trim()),d()}catch(e){y(e instanceof Error?e.message:"Failed to enqueue")}finally{b(!1)}}return(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,l.jsx)(i.Zp,{className:"w-full max-w-md",children:(0,l.jsxs)(i.Wu,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Enqueue Job"}),(0,l.jsx)("button",{onClick:n,className:"text-white/40 hover:text-white",children:(0,l.jsx)(p.A,{className:"h-5 w-5"})})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(o.l,{label:"Agent",options:s.map(e=>({value:e.name,label:e.name})),value:u,onChange:e=>h(e.target.value)}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"Prompt"}),(0,l.jsx)("textarea",{value:x,onChange:e=>m(e.target.value),rows:4,placeholder:"What should the agent do?",className:"flex w-full rounded-xl border px-3 py-2 text-sm bg-white/5 border-white/10 text-white placeholder:text-white/40 focus-visible:outline-none focus-visible:border-indigo-500/50 resize-none"})]}),g&&(0,l.jsx)("p",{className:"text-sm text-red-400",children:g}),(0,l.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,l.jsx)(c.$,{variant:"ghost",onClick:n,children:"Cancel"}),(0,l.jsx)(c.$,{onClick:v,disabled:f,children:f?"Enqueuing...":"Enqueue"})]})]})]})})})}}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=9204)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[898],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>d,_F:()=>c,aA:()=>x,aX:()=>u,te:()=>o,xV:()=>m,yu:()=>h});var a=s(4166),r=s(3929);function n(e,t){let s=(0,a.useRef)(e);(0,a.useEffect)(()=>{s.current=e},[e]),(0,a.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function l(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=l("ash:agents"),[t,s]=(0,a.useState)(null!=e?e:[]),[n,c]=(0,a.useState)(!e),[o,d]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{let e=await (0,r.KU)().listAgents();s(e),i("ash:agents",e),d(null)}catch(e){d(e)}finally{c(!1)}},[]);return(0,a.useEffect)(()=>{u()},[u]),{agents:t,loading:n,error:o,refetch:u}}function o(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=l(s),[o,d]=(0,a.useState)(null!=c?c:[]),[u,x]=(0,a.useState)(!c),[h,m]=(0,a.useState)(null),f=(0,a.useCallback)(async()=>{try{let t=await (0,r.KU)().listSessions(null==e?void 0:e.agent);d(t),i(s,t),m(null)}catch(e){m(e)}finally{x(!1)}},[null==e?void 0:e.agent,s]);return(0,a.useEffect)(()=>{f()},[f]),n(()=>f(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:u,error:h,refetch:f}}function d(){let[e,t]=(0,a.useState)(()=>l("ash:health")),[s,c]=(0,a.useState)(null),o=(0,a.useCallback)(async()=>{try{let e=await (0,r.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,a.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:s,refetch:o}}function u(){let[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)(!0),[l,i]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{try{let e=await (0,r.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,a.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:l,refetch:c}}function x(e){let[t,s]=(0,a.useState)([]),[n,l]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{l(!0);let t=await (0,r.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function h(e){let[t,s]=(0,a.useState)([]),[n,l]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{l(!0);let t=await (0,r.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function m(e,t){let[s,n]=(0,a.useState)([]),[l,i]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,r.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,a.useEffect)(()=>{c()},[c]),{results:s,loading:l,refresh:c}}},1080:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>l});var a=s(6862),r=s(3690);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}function l(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let a=Math.floor(s/60);if(a<60)return"".concat(a,"m ago");let r=Math.floor(a/60);if(r<24)return"".concat(r,"h ago");let n=Math.floor(r/24);return n<30?"".concat(n,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2304:(e,t,s)=>{Promise.resolve().then(s.bind(s,3782))},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});var a=s(534),r=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,options:l,placeholder:i,id:c,...o}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,a.jsx)("label",{htmlFor:c,className:"block text-sm font-medium text-white/70",children:n}),(0,a.jsxs)("select",{ref:t,id:c,className:(0,r.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white","focus-visible:outline-none focus-visible:border-indigo-500/50",s),...o,children:[i&&(0,a.jsx)("option",{value:"",className:"bg-[#1c2129]",children:i}),l.map(e=>(0,a.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});n.displayName="Select"},3544:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},3634:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},3782:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>A});var a=s(534),r=s(4166),n=s(9197),l=s(989),i=s(3929),c=s(4765),o=s(6719),d=s(5968),u=s(8314),x=s(3007),h=s(7964),m=s(1804),f=s(4195),p=s(8154);let g=(0,p.A)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),v=(0,p.A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var w=s(1080),y=s(7955);let b=(0,p.A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var j=s(8842),N=s(3544),S=s(3634);let k=(0,p.A)("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);function A(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"text-sm text-white/40",children:"Loading..."}),children:(0,a.jsx)(C,{})})}function C(){let e=(0,n.useSearchParams)().get("id"),{agents:t}=(0,l._F)(),[s,i]=(0,r.useState)(""),[c,o]=(0,r.useState)(""),{sessions:p,loading:g,refetch:v}=(0,l.te)({agent:s||void 0,autoRefresh:!0}),[w,y]=(0,r.useState)(e);(0,r.useEffect)(()=>{!w&&p.length>0&&y(p[0].id)},[p,w]);let b=p.filter(e=>!c||e.status===c),j=p.find(e=>e.id===w),N=[{value:"",label:"All Agents"},...t.map(e=>({value:e.name,label:e.name}))];return(0,a.jsxs)("div",{className:"flex h-[calc(100vh-5rem)] gap-4",children:[(0,a.jsxs)("div",{className:"w-80 shrink-0 flex flex-col",children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Sessions"})}),(0,a.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,a.jsx)(x.l,{options:N,value:s,onChange:e=>i(e.target.value),className:"flex-1 h-8 text-xs"}),(0,a.jsx)(x.l,{options:[{value:"",label:"All Statuses"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"ended",label:"Ended"},{value:"error",label:"Error"}],value:c,onChange:e=>o(e.target.value),className:"flex-1 h-8 text-xs"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto space-y-1 scrollbar-thin",children:g?(0,a.jsx)("div",{className:"space-y-2",children:[1,2,3,4,5].map(e=>(0,a.jsx)(h.X,{height:64},e))}):0===b.length?(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No sessions found"}):b.map(e=>(0,a.jsxs)("button",{onClick:()=>y(e.id),className:(0,m.cn)("w-full text-left rounded-lg border px-3 py-2.5 transition-colors",w===e.id?"bg-indigo-500/10 border-indigo-500/30":"border-transparent hover:bg-white/5"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-white truncate",children:e.agentName}),(0,a.jsx)(d.W,{status:e.status})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/30 font-mono",children:(0,m.Ct)(e.id)}),(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,m.fw)(e.createdAt)})]})]},e.id))})]}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:j?(0,a.jsx)(E,{session:j},j.id):(0,a.jsx)(u.p,{icon:(0,a.jsx)(f.A,{className:"h-12 w-12"}),title:"Select a session",description:"Choose a session from the list to view details"})})]})}function E(e){let{session:t}=e,[s,n]=(0,r.useState)("messages"),[l,u]=(0,r.useState)([]),[x,p]=(0,r.useState)([]),[N,S]=(0,r.useState)([]),[k,A]=(0,r.useState)(!0),C=(0,r.useRef)(!1),E=t.id,_=t.status,P=(0,r.useCallback)(async()=>{if(!C.current){C.current=!0;try{let e=(0,i.KU)(),[t,s]=await Promise.all([e.listMessages(E).catch(()=>[]),e.listSessionEvents(E).catch(()=>[])]);u(t),p(s)}catch(e){}finally{C.current=!1,A(!1)}}},[E]);async function O(e){let t=(0,i.KU)();try{"pause"===e?await t.pauseSession(E):"resume"===e?await t.resumeSession(E):"stop"===e?await t.stopSession(E):"end"===e&&await t.endSession(E)}catch(t){console.error("Failed to ".concat(e," session:"),t)}}return(0,r.useEffect)(()=>{P()},[P]),(0,r.useEffect)(()=>{if("active"!==_)return;let e=setInterval(P,5e3);return()=>clearInterval(e)},[_,P]),(0,r.useEffect)(()=>{if("terminal"!==s)return;let e=async()=>{try{let e=await (0,i.KU)().getSessionLogs(E);(null==e?void 0:e.logs)&&S(e.logs.map(e=>e.text))}catch(e){S(["Failed to load logs"])}};if(e(),"active"===_){let t=setInterval(e,2e3);return()=>clearInterval(t)}},[s,E,_]),(0,a.jsxs)(c.Zp,{className:"h-full flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-white/10",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-white",children:t.agentName}),(0,a.jsx)(d.W,{status:t.status})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 mt-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/30 font-mono",children:t.id}),(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,m.fw)(t.createdAt)}),t.model&&(0,a.jsx)(d.E,{variant:"info",children:t.model}),(0,a.jsx)(z,{events:x,config:t.config})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["active"===t.status&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>O("pause"),title:"Pause",children:(0,a.jsx)(g,{className:"h-4 w-4"})}),(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>O("stop"),title:"Stop",children:(0,a.jsx)(v,{className:"h-4 w-4"})})]}),("paused"===t.status||"stopped"===t.status)&&(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>O("resume"),title:"Resume",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})}),(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>navigator.clipboard.writeText(t.id),title:"Copy ID",children:(0,a.jsx)(y.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"flex gap-1 px-6 py-2 border-b border-white/10",children:[{key:"messages",label:"Messages",icon:b,count:l.length},{key:"events",label:"Events",icon:f.A,count:x.length},{key:"terminal",label:"Terminal",icon:j.A}].map(e=>{let{key:t,label:r,icon:l,count:i}=e;return(0,a.jsxs)("button",{onClick:()=>n(t),className:(0,m.cn)("flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",s===t?"bg-white/10 text-white":"text-white/40 hover:text-white/70"),children:[(0,a.jsx)(l,{className:"h-3.5 w-3.5"}),r,void 0!==i&&i>0&&(0,a.jsx)("span",{className:"text-xs text-white/30",children:i})]},t)})}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-6 scrollbar-thin",children:k?(0,a.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(h.X,{height:60},e))}):"messages"===s?(0,a.jsx)(M,{messages:l}):"events"===s?(0,a.jsx)(R,{events:x}):(0,a.jsx)(F,{logs:N})})]})}function M(e){let{messages:t}=e,s=(0,r.useRef)(null);return((0,r.useEffect)(()=>{var e;null==(e=s.current)||e.scrollIntoView({behavior:"smooth"})},[t.length]),0===t.length)?(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No messages yet"}):(0,a.jsxs)("div",{className:"space-y-4",children:[t.map((e,t)=>(0,a.jsx)(_,{message:e},e.id||t)),(0,a.jsx)("div",{ref:s})]})}function _(e){let{message:t}=e,s="user"===t.role,[n,l]=(0,r.useState)(!1),i="",c=[];try{let e=JSON.parse(t.content);if(Array.isArray(e)){let t=e.filter(e=>"text"===e.type);c=e.filter(e=>"tool_use"===e.type),i=t.map(e=>String(e.text||"")).join("\n")}else if("string"==typeof e)i=e;else if(e&&"object"==typeof e)if(Array.isArray(e.content)){let t=e.content.filter(e=>"text"===e.type);c=e.content.filter(e=>"tool_use"===e.type),i=t.map(e=>String(e.text||"")).join("\n")}else"string"==typeof e.content?i=e.content:"string"==typeof e.result?i=e.result:"string"==typeof e.text&&(i=e.text);else i=t.content}catch(e){i=t.content}return(0,a.jsxs)("div",{className:(0,m.cn)("rounded-lg border p-4",s?"border-blue-500/20 bg-blue-500/5":"border-white/5 bg-white/[0.02]"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(d.E,{variant:s?"info":"default",children:s?"User":"Assistant"}),t.createdAt&&(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,m.fw)(t.createdAt)})]}),i&&(0,a.jsx)("div",{className:"text-sm text-white/80 whitespace-pre-wrap",children:i}),c.length>0&&(0,a.jsx)("div",{className:"mt-3 space-y-2",children:c.map((e,t)=>(0,a.jsx)(P,{toolCall:e},e.id||t))}),(0,a.jsxs)("button",{onClick:()=>l(!n),className:"mt-2 text-xs text-white/30 hover:text-white/50 transition-colors flex items-center gap-1",children:[n?(0,a.jsx)(N.A,{className:"h-3 w-3"}):(0,a.jsx)(S.A,{className:"h-3 w-3"}),"Raw JSON"]}),n&&(0,a.jsx)("pre",{className:"mt-2 text-xs text-white/40 overflow-auto max-h-64 bg-black/30 rounded p-3 font-mono",children:(()=>{try{return JSON.stringify(JSON.parse(t.content),null,2)}catch(e){return t.content}})()})]})}function P(e){let{toolCall:t}=e,[s,n]=(0,r.useState)(!1);return(0,a.jsxs)("div",{className:"rounded-md border border-white/10 bg-black/20 overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>n(!s),"aria-expanded":s,className:"flex items-center gap-2 w-full px-3 py-2 text-sm text-white/60 hover:text-white/80 transition-colors",children:[s?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"font-mono text-indigo-400",children:t.name})]}),s&&(0,a.jsxs)("div",{className:"px-3 pb-3",children:[(0,a.jsx)("div",{className:"text-xs text-white/40 mb-1",children:"Input:"}),(0,a.jsx)("pre",{className:"text-xs text-white/60 overflow-auto max-h-48 bg-black/30 rounded p-2",children:JSON.stringify(t.input,null,2)})]})]})}function R(e){let{events:t}=e;if(0===t.length)return(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No events recorded"});let s={text:"text-blue-400",tool_start:"text-purple-400",tool_result:"text-purple-400",reasoning:"text-amber-400",error:"text-red-400",turn_complete:"text-green-400",lifecycle:"text-zinc-400",mcp_status:"text-cyan-400"};return(0,a.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,a.jsx)(O,{event:e,typeColors:s},e.id||t))})}function O(e){let{event:t,typeColors:s}=e,[n,l]=(0,r.useState)(!1),i=s[t.type]||"text-white/40",c="";try{let e="string"==typeof t.data?JSON.parse(t.data):t.data;e&&"object"==typeof e&&("string"==typeof e.action&&"configured"===e.action&&Array.isArray(e.servers)?c="".concat(e.servers.length," server(s): ").concat(e.servers.map(e=>e.name).join(", ")):"string"==typeof e.action&&"error"===e.action&&"string"==typeof e.error?c="MCP error: ".concat(e.error.slice(0,80)):"string"==typeof e.text?c=e.text.slice(0,100):"string"==typeof e.name?c=e.name:"string"==typeof e.error&&(c=e.error.slice(0,100)))}catch(e){}return(0,a.jsxs)("div",{className:"rounded-md border border-white/5 bg-white/[0.01]",children:[(0,a.jsxs)("button",{onClick:()=>l(!n),"aria-expanded":n,className:"flex items-center gap-3 w-full px-3 py-2 text-sm hover:bg-white/[0.02] transition-colors",children:[n?(0,a.jsx)(N.A,{className:"h-3 w-3 text-white/30"}):(0,a.jsx)(S.A,{className:"h-3 w-3 text-white/30"}),(0,a.jsxs)("span",{className:"text-xs text-white/20 font-mono w-8",children:["#",t.sequence]}),(0,a.jsx)(d.E,{className:i,children:t.type}),(0,a.jsx)("span",{className:"text-xs text-white/40 truncate flex-1 text-left",children:c}),(0,a.jsx)("span",{className:"text-xs text-white/20",children:t.createdAt?(0,m.fw)(t.createdAt):""})]}),n&&(0,a.jsx)("div",{className:"px-3 pb-3 pt-1",children:(0,a.jsx)("pre",{className:"text-xs text-white/50 overflow-auto max-h-64 bg-black/30 rounded p-2",children:"string"==typeof t.data?t.data:JSON.stringify(t.data,null,2)})})]})}function z(e){let{events:t,config:s}=e,r=t.filter(e=>"mcp_status"===e.type),n=null==s?void 0:s.mcpServers;if(!n&&0===r.length)return null;let l=r.some(e=>{try{let t="string"==typeof e.data?JSON.parse(e.data):e.data;return(null==t?void 0:t.action)==="error"}catch(e){return!1}}),i=n?Object.keys(n).length:0,c=r.find(e=>{try{let t="string"==typeof e.data?JSON.parse(e.data):e.data;return(null==t?void 0:t.action)==="configured"}catch(e){return!1}}),o=c?(()=>{try{var e,t;let s="string"==typeof c.data?JSON.parse(c.data):c.data;return null!=(t=null==s||null==(e=s.servers)?void 0:e.length)?t:0}catch(e){return 0}})():i;return(0,a.jsxs)("span",{className:(0,m.cn)("inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium",l?"bg-red-500/10 text-red-400 border border-red-500/20":"bg-cyan-500/10 text-cyan-400 border border-cyan-500/20"),children:[(0,a.jsx)(k,{className:"h-3 w-3"}),l?"MCP Error":"MCP: ".concat(o," server").concat(1!==o?"s":"")]})}function F(e){let{logs:t}=e,s=(0,r.useRef)(null);return((0,r.useEffect)(()=>{var e;null==(e=s.current)||e.scrollIntoView({behavior:"smooth"})},[t.length]),0===t.length)?(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No terminal output"}):(0,a.jsxs)("div",{className:"bg-black/40 rounded-lg p-4 font-mono text-xs",children:[t.map((e,t)=>(0,a.jsx)("div",{className:"text-white/60 whitespace-pre-wrap",children:e},t)),(0,a.jsx)("div",{ref:s})]})}},4195:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>n,aR:()=>l});var a=s(534),r=s(1804);function n(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,r.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function l(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,a.jsx)("h3",{className:(0,r.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,r.cn)("p-4 sm:p-6",s),children:t})}},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>l,W:()=>i});var a=s(534),r=s(1804);let n={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function l(e){let{children:t,variant:s="default",className:l}=e;return(0,a.jsx)("span",{className:(0,r.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",n[s],l),children:t})}function i(e){let{status:t}=e;return(0,a.jsx)(l,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(534),r=s(1804),n=s(4166);let l={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,n.forwardRef)((e,t)=>{let{className:s,variant:n="primary",size:c="md",disabled:o,...d}=e;return(0,a.jsx)("button",{ref:t,className:(0,r.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",l[n],i[c],s),disabled:o,...d})});c.displayName="Button"},7955:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var a=s(534),r=s(1804);function n(e){let{width:t="100%",height:s=100,className:n}=e;return(0,a.jsx)("div",{className:(0,r.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",n),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8154:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(4166);let r=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:o="",children:d,iconNode:u,...x}=e;return(0,a.createElement)("svg",{ref:t,...n,width:l,height:l,stroke:s,strokeWidth:c?24*Number(i)/Number(l):i,className:r("lucide",o),...x},[...u.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let s=(0,a.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,a.createElement)(l,{ref:n,iconNode:t,className:r("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...c})});return s.displayName="".concat(e),s}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(534),r=s(1804);function n(e){let{icon:t,title:s,description:n,action:l,className:i}=e;return(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,a.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,a.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:n}),l&&(0,a.jsx)("div",{className:"mt-4",children:l})]})}},8842:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},9197:(e,t,s)=>{"use strict";var a=s(4841);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=2304)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[167],{858:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>o,_F:()=>c,aA:()=>h,aX:()=>u,te:()=>d,xV:()=>f,yu:()=>x});var l=s(4166),r=s(3929);function a(e,t){let s=(0,l.useRef)(e);(0,l.useEffect)(()=>{s.current=e},[e]),(0,l.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])}function n(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=n("ash:agents"),[t,s]=(0,l.useState)(null!=e?e:[]),[a,c]=(0,l.useState)(!e),[d,o]=(0,l.useState)(null),u=(0,l.useCallback)(async()=>{try{let e=await (0,r.KU)().listAgents();s(e),i("ash:agents",e),o(null)}catch(e){o(e)}finally{c(!1)}},[]);return(0,l.useEffect)(()=>{u()},[u]),{agents:t,loading:a,error:d,refetch:u}}function d(e){var t;let s="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=n(s),[d,o]=(0,l.useState)(null!=c?c:[]),[u,h]=(0,l.useState)(!c),[x,f]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{try{let t=await (0,r.KU)().listSessions(null==e?void 0:e.agent);o(t),i(s,t),f(null)}catch(e){f(e)}finally{h(!1)}},[null==e?void 0:e.agent,s]);return(0,l.useEffect)(()=>{m()},[m]),a(()=>m(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:d,loading:u,error:x,refetch:m}}function o(){let[e,t]=(0,l.useState)(()=>n("ash:health")),[s,c]=(0,l.useState)(null),d=(0,l.useCallback)(async()=>{try{let e=await (0,r.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,l.useEffect)(()=>{d()},[d]),a(()=>d(),3e4),{health:e,error:s,refetch:d}}function u(){let[e,t]=(0,l.useState)([]),[s,a]=(0,l.useState)(!0),[n,i]=(0,l.useState)(null),c=(0,l.useCallback)(async()=>{try{let e=await (0,r.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{a(!1)}},[]);return(0,l.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:n,refetch:c}}function h(e){let[t,s]=(0,l.useState)([]),[a,n]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,r.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{n(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{versions:t,loading:a,refresh:i}}function x(e){let[t,s]=(0,l.useState)([]),[a,n]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,r.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{n(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{runs:t,loading:a,refresh:i}}function f(e,t){let[s,a]=(0,l.useState)([]),[n,i]=(0,l.useState)(!0),c=(0,l.useCallback)(async()=>{if(e&&t)try{i(!0);let s=await (0,r.KU)().getEvalRunResults(e,t);a(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,l.useEffect)(()=>{c()},[c]),{results:s,loading:n,refresh:c}}},1804:(e,t,s)=>{"use strict";s.d(t,{Ct:()=>d,ZV:()=>i,a3:()=>c,cn:()=>a,fw:()=>n});var l=s(6862),r=s(3690);function a(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,l.$)(t))}function n(e){let t=Date.now(),s=Math.floor((t-new Date(e).getTime())/1e3);if(s<60)return"".concat(s,"s ago");let l=Math.floor(s/60);if(l<60)return"".concat(l,"m ago");let r=Math.floor(l/60);if(r<24)return"".concat(r,"h ago");let a=Math.floor(r/24);return a<30?"".concat(a,"d ago"):new Date(e).toLocaleDateString()}function i(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function c(e){if(e<60)return"".concat(e.toFixed(1),"s");let t=Math.floor(e/60);if(t<60)return"".concat(t,"m ").concat(Math.floor(e%60),"s");let s=Math.floor(t/60);return"".concat(s,"h ").concat(t%60,"m")}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e.length>t?e.slice(0,t):e}},2505:(e,t,s)=>{"use strict";s.d(t,{p:()=>a});var l=s(534),r=s(1804);let a=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:a,error:n,id:i,...c}=e;return(0,l.jsxs)("div",{className:"space-y-1.5",children:[a&&(0,l.jsx)("label",{htmlFor:i,className:"block text-sm font-medium text-white/70",children:a}),(0,l.jsx)("input",{ref:t,id:i,className:(0,r.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white placeholder:text-white/40","focus-visible:outline-none focus-visible:border-indigo-500/50 focus-visible:bg-white/10","disabled:cursor-not-allowed disabled:opacity-50",n&&"border-red-500/50 focus-visible:border-red-400",s),...c}),n&&(0,l.jsx)("p",{className:"text-xs text-red-400",children:n})]})});a.displayName="Input"},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>a});var l=s(534),r=s(1804);let a=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:a,options:n,placeholder:i,id:c,...d}=e;return(0,l.jsxs)("div",{className:"space-y-1.5",children:[a&&(0,l.jsx)("label",{htmlFor:c,className:"block text-sm font-medium text-white/70",children:a}),(0,l.jsxs)("select",{ref:t,id:c,className:(0,r.cn)("flex h-9 w-full rounded-xl border px-3 py-1 text-sm transition-all duration-200","bg-white/5 border-white/10 text-white","focus-visible:outline-none focus-visible:border-indigo-500/50",s),...d,children:[i&&(0,l.jsx)("option",{value:"",className:"bg-[#1c2129]",children:i}),n.map(e=>(0,l.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});a.displayName="Select"},4193:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>i,Zp:()=>a,aR:()=>n});var l=s(534),r=s(1804);function a(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,r.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",s),children:t})}function n(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1.5 px-4 pt-4 pb-0 sm:px-6 sm:pt-6 sm:pb-0",s),children:t})}function i(e){let{children:t,className:s}=e;return(0,l.jsx)("h3",{className:(0,r.cn)("text-lg font-semibold leading-none tracking-tight text-white",s),children:t})}function c(e){let{children:t,className:s}=e;return(0,l.jsx)("div",{className:(0,r.cn)("p-4 sm:p-6",s),children:t})}},5968:(e,t,s)=>{"use strict";s.d(t,{E:()=>n,W:()=>i});var l=s(534),r=s(1804);let a={default:"bg-white/10 text-white/70 border border-white/10",success:"bg-green-500/20 text-green-400 border border-green-500/30",warning:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",error:"bg-red-500/20 text-red-400 border border-red-500/30",info:"bg-blue-500/20 text-blue-400 border border-blue-500/30"};function n(e){let{children:t,variant:s="default",className:n}=e;return(0,l.jsx)("span",{className:(0,r.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",a[s],n),children:t})}function i(e){let{status:t}=e;return(0,l.jsx)(n,{variant:{active:"success",starting:"info",paused:"warning",stopped:"default",ended:"default",error:"error"}[t]||"default",children:t})}},6650:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var l=s(534),r=s(1804),a=s(4166);let n={primary:"bg-indigo-500 text-white font-medium hover:bg-indigo-400",secondary:"border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30",ghost:"text-white/70 hover:text-white hover:bg-white/10",danger:"bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30"},i={sm:"h-8 px-3 text-xs rounded-lg",md:"h-9 px-4 text-sm rounded-xl",lg:"h-10 px-6 text-sm rounded-xl"},c=(0,a.forwardRef)((e,t)=>{let{className:s,variant:a="primary",size:c="md",disabled:d,...o}=e;return(0,l.jsx)("button",{ref:t,className:(0,r.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/50","disabled:pointer-events-none disabled:opacity-50",n[a],i[c],s),disabled:d,...o})});c.displayName="Button"},7689:(e,t,s)=>{Promise.resolve().then(s.bind(s,8031))},7691:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},7964:(e,t,s)=>{"use strict";s.d(t,{X:()=>a});var l=s(534),r=s(1804);function a(e){let{width:t="100%",height:s=100,className:a}=e;return(0,l.jsx)("div",{className:(0,r.cn)("rounded-xl","bg-gradient-to-r from-white/5 via-white/10 to-white/5","bg-[length:200%_100%]","animate-[shimmer_1.5s_ease-in-out_infinite]",a),style:{width:"number"==typeof t?"".concat(t,"px"):t,height:s}})}},8031:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var l=s(534),r=s(4166),a=s(989),n=s(3929),i=s(4765),c=s(6719),d=s(2505),o=s(3007),u=s(5968),h=s(8314),x=s(7964),f=s(1804),m=s(858),p=s(4193),b=s(7691),v=s(6650);let g=[{value:"anthropic",label:"Anthropic"},{value:"openai",label:"OpenAI"},{value:"bedrock",label:"AWS Bedrock"},{value:"custom",label:"Custom"}];function y(){let{credentials:e,loading:t,refetch:s}=(0,a.aX)(),[d,o]=(0,r.useState)(!1),[v,g]=(0,r.useState)(null);async function y(e){g(null);try{await (0,n.KU)().deleteCredential(e),s()}catch(e){g(e instanceof Error?e.message:"Failed to delete credential")}}return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Credentials"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Store API keys for LLM providers. Encrypted at rest."})]}),(0,l.jsxs)(c.$,{onClick:()=>o(!0),children:[(0,l.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Add Credential"]})]}),v&&(0,l.jsx)("div",{className:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2",children:v}),(0,l.jsx)(i.Zp,{children:(0,l.jsx)(i.Wu,{className:"p-0",children:t?(0,l.jsx)("div",{className:"p-4 space-y-2",children:[1,2,3].map(e=>(0,l.jsx)(x.X,{height:48},e))}):0===e.length?(0,l.jsx)(h.p,{icon:(0,l.jsx)(p.A,{className:"h-12 w-12"}),title:"No credentials stored",description:"Add API keys for LLM providers to use with your agents.",action:(0,l.jsxs)(c.$,{onClick:()=>o(!0),children:[(0,l.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Add Credential"]})}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-white/10",children:[(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Provider"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Label"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Status"}),(0,l.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Last Used"}),(0,l.jsx)("th",{className:"text-right px-6 py-3 text-xs font-medium text-white/40 uppercase",children:"Actions"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-white/5",children:e.map(e=>(0,l.jsxs)("tr",{className:"hover:bg-white/[0.02]",children:[(0,l.jsx)("td",{className:"px-6 py-3",children:(0,l.jsx)(u.E,{variant:"info",children:e.type})}),(0,l.jsx)("td",{className:"px-6 py-3 text-white/80",children:e.label||"-"}),(0,l.jsx)("td",{className:"px-6 py-3",children:(0,l.jsx)(u.E,{variant:e.active?"success":"default",children:e.active?"Active":"Inactive"})}),(0,l.jsx)("td",{className:"px-6 py-3 text-white/40",children:e.lastUsedAt?(0,f.fw)(e.lastUsedAt):"Never"}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:(0,l.jsx)(c.$,{variant:"ghost",size:"sm",onClick:()=>y(e.id),className:"text-red-400 hover:text-red-300",children:(0,l.jsx)(b.A,{className:"h-3.5 w-3.5"})})})]},e.id))})]})})}),d&&(0,l.jsx)(w,{onClose:()=>o(!1),onCreated:()=>{o(!1),s()}})]})}function w(e){let{onClose:t,onCreated:s}=e,[a,u]=(0,r.useState)("anthropic"),[h,x]=(0,r.useState)(""),[f,m]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[y,w]=(0,r.useState)(""),[j,N]=(0,r.useState)("us-east-1"),[k,A]=(0,r.useState)(!1),[S,C]=(0,r.useState)(null);async function E(){A(!0),C(null);try{let e=(0,n.KU)();"bedrock"===a?await e.storeBedrockCredential({accessKeyId:p,secretAccessKey:y,region:j,label:h||void 0}):await e.storeCredential(a,f,h||void 0),s()}catch(e){C(e instanceof Error?e.message:"Failed to store credential")}finally{A(!1)}}return(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,l.jsx)(i.Zp,{className:"w-full max-w-md",children:(0,l.jsxs)(i.Wu,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Add Credential"}),(0,l.jsx)("button",{onClick:t,className:"text-white/40 hover:text-white",children:(0,l.jsx)(v.A,{className:"h-5 w-5"})})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(o.l,{label:"Provider",options:g,value:a,onChange:e=>u(e.target.value)}),(0,l.jsx)(d.p,{label:"Label (optional)",placeholder:"e.g. production",value:h,onChange:e=>x(e.target.value)}),"bedrock"===a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.p,{label:"Access Key ID",placeholder:"AKIA...",value:p,onChange:e=>b(e.target.value)}),(0,l.jsx)(d.p,{label:"Secret Access Key",type:"password",value:y,onChange:e=>w(e.target.value)}),(0,l.jsx)(d.p,{label:"Region",placeholder:"us-east-1",value:j,onChange:e=>N(e.target.value)})]}):(0,l.jsx)(d.p,{label:"API Key",type:"password",placeholder:"anthropic"===a?"sk-ant-...":"sk-...",value:f,onChange:e=>m(e.target.value)}),S&&(0,l.jsx)("p",{className:"text-sm text-red-400",children:S}),(0,l.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,l.jsx)(c.$,{variant:"ghost",onClick:t,children:"Cancel"}),(0,l.jsx)(c.$,{onClick:E,disabled:k,children:k?"Saving...":"Save"})]})]})]})})})}},8154:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(4166);let r=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,l.forwardRef)((e,t)=>{let{color:s="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:d="",children:o,iconNode:u,...h}=e;return(0,l.createElement)("svg",{ref:t,...a,width:n,height:n,stroke:s,strokeWidth:c?24*Number(i)/Number(n):i,className:r("lucide",d),...h},[...u.map(e=>{let[t,s]=e;return(0,l.createElement)(t,s)}),...Array.isArray(o)?o:[o]])}),i=(e,t)=>{let s=(0,l.forwardRef)((s,a)=>{let{className:i,...c}=s;return(0,l.createElement)(n,{ref:a,iconNode:t,className:r("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...c})});return s.displayName="".concat(e),s}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>a});var l=s(534),r=s(1804);function a(e){let{icon:t,title:s,description:a,action:n,className:i}=e;return(0,l.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,l.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-white",children:s}),(0,l.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:a}),n&&(0,l.jsx)("div",{className:"mt-4",children:n})]})}}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=7689)),_N_E=e.O()}]);
|