@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[996],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>i,_o:()=>h,aA:()=>x,aX:()=>d,l3:()=>m,te:()=>o,xV:()=>g,yu:()=>f});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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{c()},[c]),{files:t,loading:r,refresh:c}}function m(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{c()},[c]),{cases:t,loading:r,refresh:c}}function f(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 g(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),b=s(1924);function N(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,F]=(0,l.useState)(null),[M,R]=(0,l.useState)(!0),[L,K]=(0,l.useState)(null);return((0,l.useEffect)(()=>{if(!t||!s)return void R(!1);!async function(){try{let e=await (0,o.KU)().getEvalRun(t,s);F(e)}catch(e){console.error("Failed to fetch eval run:",e)}finally{R(!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(F).catch(()=>{})},5e3);return()=>clearInterval(e)},[E,C,t,s]),t&&s)?M||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:N(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:()=>K(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)(b.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:N(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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>d,_F:()=>c,_o:()=>x,aA:()=>h,aX:()=>u,l3:()=>m,te:()=>o,xV:()=>v,yu:()=>f});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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files:t,loading:r,refresh:i}}function m(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{l(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:r,refresh:i}}function f(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 v(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),w=s(8154);let j=(0,w.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,w.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,w]=(0,n.useState)(!1),[C,E]=(0,n.useState)(!1),[M,F]=(0,n.useState)([]),[U,_]=(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:()=>w(!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:()=>w(!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)(j,{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:()=>w(!1),onStarted:()=>{w(!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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[237],{599:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).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"}]])},858:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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,_o:()=>x,aA:()=>h,aX:()=>u,l3:()=>m,te:()=>o,xV:()=>p,yu:()=>f});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 i(e){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}}function r(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=i("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,l.KU)().listAgents();s(e),r("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=i(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,l.KU)().listSessions(null==e?void 0:e.agent);d(t),r(s,t),m(null)}catch(e){m(e)}finally{h(!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:x,refetch:f}}function d(){let[e,t]=(0,a.useState)(()=>i("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),r("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),[i,r]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{try{let e=await (0,l.KU)().listCredentials();t(e),r(null)}catch(e){r(e)}finally{n(!1)}},[]);return(0,a.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:i,refetch:c}}function h(e){let[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),r=(0,a.useCallback)(async()=>{if(e)try{i(!0);let t=await (0,l.KU)().listAgentVersions(e);s(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{i(!1)}},[e]);return(0,a.useEffect)(()=>{r()},[r]),{versions:t,loading:n,refresh:r}}function x(e){let[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),r=(0,a.useCallback)(async()=>{if(e)try{i(!0);let t=await (0,l.KU)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{i(!1)}},[e]);return(0,a.useEffect)(()=>{r()},[r]),{files:t,loading:n,refresh:r}}function m(e){let[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),r=(0,a.useCallback)(async()=>{if(e)try{i(!0);let t=await (0,l.KU)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{i(!1)}},[e]);return(0,a.useEffect)(()=>{r()},[r]),{cases:t,loading:n,refresh:r}}function f(e){let[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),r=(0,a.useCallback)(async()=>{if(e)try{i(!0);let t=await (0,l.KU)().listEvalRuns(e);s(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{i(!1)}},[e]);return(0,a.useEffect)(()=>{r()},[r]),{runs:t,loading:n,refresh:r}}function p(e,t){let[s,n]=(0,a.useState)([]),[i,r]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{if(e&&t)try{r(!0);let s=await (0,l.KU)().getEvalRunResults(e,t);n(s)}catch(e){console.error("Failed to fetch eval results:",e)}finally{r(!1)}},[e,t]);return(0,a.useEffect)(()=>{c()},[c]),{results:s,loading:i,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:()=>r,a3:()=>c,cn:()=>n,fw:()=>i});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 i(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 r(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 a=s(534),l=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,error:i,id:r,...c}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,a.jsx)("label",{htmlFor:r,className:"block text-sm font-medium text-white/70",children:n}),(0,a.jsx)("input",{ref:t,id:r,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 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",i&&"border-red-500/50 focus-visible:border-red-400",s),...c}),i&&(0,a.jsx)("p",{className:"text-xs text-red-400",children:i})]})});n.displayName="Input"},3234:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>M});var a=s(534),l=s(4166),n=s(9197),i=s(8968),r=s.n(i),c=s(989),o=s(3929),d=s(4765),u=s(6719),h=s(2505),x=s(5968),m=s(8314),f=s(7964),p=s(4275),v=s(1080),g=s(9266),b=s(599),w=s(858),y=s(3701),j=s(3544),N=s(3634);let k=(0,s(8154).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var C=s(7691),S=s(6650);function A(){let e=(0,n.useSearchParams)().get("name"),{cases:t,loading:s,refresh:i}=(0,c.l3)(e),[h,S]=(0,l.useState)(!1),[A,M]=(0,l.useState)(null),[U,T]=(0,l.useState)(null),[R,F]=(0,l.useState)(null),[K,_]=(0,l.useState)(!1),[P,$]=(0,l.useState)(null);async function z(t){if(e){$(null);try{await (0,o.KU)().deleteEvalCase(e,t),T(null),i()}catch(e){$(e instanceof Error?e.message:"Failed to delete eval case"),T(null)}}}async function q(){if(e){$(null);try{let t=await (0,o.KU)().exportEvalCases(e),s=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download="".concat(e,"-eval-cases.json"),l.click(),URL.revokeObjectURL(a)}catch(e){$(e instanceof Error?e.message:"Failed to export eval cases")}}}async function I(t){if(e&&0!==t.length){_(!0),$(null);try{let s=await t[0].text(),a=JSON.parse(s),l=Array.isArray(a)?a:a.cases||[];await (0,o.KU)().importEvalCases(e,l),i()}catch(e){$(e instanceof Error?e.message:"Failed to import eval cases")}finally{_(!1)}}}return e?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(r(),{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,a.jsx)(p.A,{className:"h-4 w-4"}),"Back to ",e]}),(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 Cases"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Test cases for ",(0,a.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r(),{href:"/agents/eval-runs?name=".concat(encodeURIComponent(e)),children:(0,a.jsxs)(u.$,{variant:"secondary",children:[(0,a.jsx)(v.A,{className:"h-4 w-4 mr-2"}),"Eval Runs"]})}),(0,a.jsxs)(u.$,{variant:"secondary",onClick:q,children:[(0,a.jsx)(g.A,{className:"h-4 w-4 mr-2"}),"Export"]}),(0,a.jsxs)("label",{className:"cursor-pointer",children:[(0,a.jsxs)("span",{className:"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 border border-white/20 bg-white/5 text-white hover:bg-white/10 hover:border-white/30 h-9 px-4 text-sm rounded-xl",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 mr-2"}),K?"Importing...":"Import"]}),(0,a.jsx)("input",{type:"file",accept:".json",className:"hidden",onChange:e=>{e.target.files&&(I(e.target.files),e.target.value="")}})]}),(0,a.jsxs)(u.$,{onClick:()=>S(!0),children:[(0,a.jsx)(w.A,{className:"h-4 w-4 mr-2"}),"Add Case"]})]})]}),P&&(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:P}),s?(0,a.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(f.X,{height:70},e))}):0===t.length?(0,a.jsx)(m.p,{icon:(0,a.jsx)(y.A,{className:"h-12 w-12"}),title:"No eval cases yet",description:"Create test cases to evaluate your agent's responses. Define questions, expected topics, and reference answers.",action:(0,a.jsxs)(u.$,{onClick:()=>S(!0),children:[(0,a.jsx)(w.A,{className:"h-4 w-4 mr-2"}),"Add Eval Case"]})}):(0,a.jsx)("div",{className:"space-y-2",children:t.map(e=>{let t=R===e.id;return(0,a.jsx)(d.Zp,{children:(0,a.jsxs)(d.Wu,{className:"!py-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("button",{onClick:()=>F(t?null:e.id),className:"flex items-center gap-2 min-w-0 flex-1 text-left",children:[t?(0,a.jsx)(j.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}):(0,a.jsx)(N.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm text-white truncate",children:e.question})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-2",children:[e.category&&(0,a.jsx)(x.E,{variant:"info",children:e.category}),!e.isActive&&(0,a.jsx)(x.E,{variant:"warning",children:"Inactive"}),(0,a.jsx)(u.$,{variant:"ghost",size:"sm",onClick:()=>M(e),className:"text-white/30 hover:text-white",children:(0,a.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(u.$,{variant:"ghost",size:"sm",onClick:()=>T(e.id),className:"text-white/30 hover:text-red-400",children:(0,a.jsx)(C.A,{className:"h-3.5 w-3.5"})})]})]}),t&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-white/5 space-y-2",children:[e.expectedTopics&&e.expectedTopics.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-white/40",children:"Expected topics: "}),(0,a.jsx)("span",{className:"text-xs text-white/60",children:e.expectedTopics.join(", ")})]}),e.expectedNotTopics&&e.expectedNotTopics.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-white/40",children:"Should NOT mention: "}),(0,a.jsx)("span",{className:"text-xs text-white/60",children:e.expectedNotTopics.join(", ")})]}),e.referenceAnswer&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-white/40",children:"Reference answer: "}),(0,a.jsx)("p",{className:"text-xs text-white/60 mt-0.5",children:e.referenceAnswer})]}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex items-center gap-1 mt-1",children:e.tags.map(e=>(0,a.jsx)(x.E,{variant:"default",children:e},e))})]})]})},e.id)})}),(h||A)&&(0,a.jsx)(E,{agentName:e,evalCase:A,onClose:()=>{S(!1),M(null)},onSaved:()=>{S(!1),M(null),i()}}),U&&(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.jsx)("h3",{className:"text-lg font-semibold text-white mb-2",children:"Delete Eval Case"}),(0,a.jsx)("p",{className:"text-sm text-white/60 mb-6",children:"Are you sure you want to delete this eval case? This action cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,a.jsx)(u.$,{variant:"ghost",onClick:()=>T(null),children:"Cancel"}),(0,a.jsx)(u.$,{variant:"danger",onClick:()=>z(U),children:"Delete"})]})]})})})]}):(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)(r(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function E(e){var t,s,n;let{agentName:i,evalCase:r,onClose:c,onSaved:x}=e,m=!!r,[f,p]=(0,l.useState)((null==r?void 0:r.question)||""),[v,g]=(0,l.useState)((null==r||null==(t=r.expectedTopics)?void 0:t.join(", "))||""),[b,w]=(0,l.useState)((null==r||null==(s=r.expectedNotTopics)?void 0:s.join(", "))||""),[y,j]=(0,l.useState)((null==r?void 0:r.referenceAnswer)||""),[N,k]=(0,l.useState)((null==r?void 0:r.category)||""),[C,A]=(0,l.useState)((null==r||null==(n=r.tags)?void 0:n.join(", "))||""),[E,M]=(0,l.useState)(!1),[U,T]=(0,l.useState)(null);function R(e){return e.split(",").map(e=>e.trim()).filter(Boolean)}async function F(){if(!f.trim())return void T("Question is required");M(!0),T(null);try{let e={question:f.trim(),expectedTopics:v?R(v):void 0,expectedNotTopics:b?R(b):void 0,referenceAnswer:y||void 0,category:N||void 0,tags:C?R(C):void 0};m?await (0,o.KU)().updateEvalCase(i,r.id,e):await (0,o.KU)().createEvalCase(i,e),x()}catch(e){T(e instanceof Error?e.message:"Failed to save eval case")}finally{M(!1)}}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-lg max-h-[90vh] overflow-auto",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:m?"Edit Eval Case":"Add Eval Case"}),(0,a.jsx)("button",{onClick:c,className:"text-white/40 hover:text-white",children:(0,a.jsx)(S.A,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"Question"}),(0,a.jsx)("textarea",{value:f,onChange:e=>p(e.target.value),rows:3,placeholder:"What question should the agent answer?",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,a.jsx)(h.p,{label:"Expected Topics (comma-separated)",placeholder:"e.g. pricing, features, support",value:v,onChange:e=>g(e.target.value)}),(0,a.jsx)(h.p,{label:"Should NOT Mention (comma-separated)",placeholder:"e.g. competitor names, internal details",value:b,onChange:e=>w(e.target.value)}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"Reference Answer (optional)"}),(0,a.jsx)("textarea",{value:y,onChange:e=>j(e.target.value),rows:3,placeholder:"The ideal answer for comparison...",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,a.jsx)(h.p,{label:"Category",placeholder:"e.g. accuracy, safety, edge_case",value:N,onChange:e=>k(e.target.value)}),(0,a.jsx)(h.p,{label:"Tags (comma-separated)",placeholder:"e.g. regression, critical",value:C,onChange:e=>A(e.target.value)}),U&&(0,a.jsx)("p",{className:"text-sm text-red-400",children:U}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,a.jsx)(u.$,{variant:"ghost",onClick:c,children:"Cancel"}),(0,a.jsx)(u.$,{onClick:F,disabled:E,children:E?"Saving...":m?"Update":"Create"})]})]})]})})})}function M(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(f.X,{height:200}),children:(0,a.jsx)(A,{})})}},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"}]])},3701:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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"}]])},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"}]])},4765:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>c,ZB:()=>r,Zp:()=>n,aR:()=>i});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 i(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 r(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:()=>i,W:()=>r});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 i(e){let{children:t,variant:s="default",className:i}=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],i),children:t})}function r(e){let{status:t}=e;return(0,a.jsx)(i,{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:()=>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),l=s(1804),n=s(4166);let i={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"},r={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,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",i[n],r[c],s),disabled:o,...d})});c.displayName="Button"},7075:(e,t,s)=>{Promise.resolve().then(s.bind(s,3234))},7691:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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:()=>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}})}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(534),l=s(1804);function n(e){let{icon:t,title:s,description:n,action:i,className:r}=e;return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col items-center justify-center py-16 text-center",r),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}),i&&(0,a.jsx)("div",{className:"mt-4",children:i})]})}},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}})},9266:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).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"}]])}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=7075)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[882],{50:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(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"}]])},599:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8154).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"}]])},989:(e,t,a)=>{"use strict";a.d(t,{Wz:()=>u,_F:()=>c,_o:()=>f,aA:()=>d,aX:()=>h,l3:()=>x,te:()=>o,xV:()=>y,yu:()=>m});var s=a(4166),l=a(3929);function n(e,t){let a=(0,s.useRef)(e);(0,s.useEffect)(()=>{a.current=e},[e]),(0,s.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>a.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,a]=(0,s.useState)(null!=e?e:[]),[n,c]=(0,s.useState)(!e),[o,u]=(0,s.useState)(null),h=(0,s.useCallback)(async()=>{try{let e=await (0,l.KU)().listAgents();a(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{c(!1)}},[]);return(0,s.useEffect)(()=>{h()},[h]),{agents:t,loading:n,error:o,refetch:h}}function o(e){var t;let a="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),c=r(a),[o,u]=(0,s.useState)(null!=c?c:[]),[h,d]=(0,s.useState)(!c),[f,x]=(0,s.useState)(null),m=(0,s.useCallback)(async()=>{try{let t=await (0,l.KU)().listSessions(null==e?void 0:e.agent);u(t),i(a,t),x(null)}catch(e){x(e)}finally{d(!1)}},[null==e?void 0:e.agent,a]);return(0,s.useEffect)(()=>{m()},[m]),n(()=>m(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:h,error:f,refetch:m}}function u(){let[e,t]=(0,s.useState)(()=>r("ash:health")),[a,c]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{try{let e=await (0,l.KU)().health();t(e),c(null),i("ash:health",e)}catch(e){c(e)}},[]);return(0,s.useEffect)(()=>{o()},[o]),n(()=>o(),3e4),{health:e,error:a,refetch:o}}function h(){let[e,t]=(0,s.useState)([]),[a,n]=(0,s.useState)(!0),[r,i]=(0,s.useState)(null),c=(0,s.useCallback)(async()=>{try{let e=await (0,l.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{n(!1)}},[]);return(0,s.useEffect)(()=>{c()},[c]),{credentials:e,loading:a,error:r,refetch:c}}function d(e){let[t,a]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),i=(0,s.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listAgentVersions(e);a(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,s.useEffect)(()=>{i()},[i]),{versions:t,loading:n,refresh:i}}function f(e){let[t,a]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),i=(0,s.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listAgentFiles(e);a(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,s.useEffect)(()=>{i()},[i]),{files:t,loading:n,refresh:i}}function x(e){let[t,a]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),i=(0,s.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listEvalCases(e);a(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,s.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function m(e){let[t,a]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),i=(0,s.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,l.KU)().listEvalRuns(e);a(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,s.useEffect)(()=>{i()},[i]),{runs:t,loading:n,refresh:i}}function y(e,t){let[a,n]=(0,s.useState)([]),[r,i]=(0,s.useState)(!0),c=(0,s.useCallback)(async()=>{if(e&&t)try{i(!0);let a=await (0,l.KU)().getEvalRunResults(e,t);n(a)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,s.useEffect)(()=>{c()},[c]),{results:a,loading:r,refresh:c}}},1804:(e,t,a)=>{"use strict";a.d(t,{Ct:()=>o,ZV:()=>i,a3:()=>c,cn:()=>n,fw:()=>r});var s=a(6862),l=a(3690);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,l.QP)((0,s.$)(t))}function r(e){let t=Date.now(),a=Math.floor((t-new Date(e).getTime())/1e3);if(a<60)return"".concat(a,"s ago");let s=Math.floor(a/60);if(s<60)return"".concat(s,"m ago");let l=Math.floor(s/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 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}},2029:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var s=a(534),l=a(4166),n=a(9197),r=a(8968),i=a.n(r),c=a(989),o=a(3929),u=a(4765),h=a(6719),d=a(8314),f=a(7964),x=a(4275),m=a(8408),y=a(599),p=a(50),g=a(3544),v=a(3634);let w=(0,a(8154).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var b=a(7691);function j(){let e=(0,n.useSearchParams)().get("name"),{files:t,loading:a,refresh:r}=(0,c._o)(e),[j,k]=(0,l.useState)(null),[N,S]=(0,l.useState)(null),[A,C]=(0,l.useState)(!1),[M,E]=(0,l.useState)(null),F=(0,l.useRef)(null),U=(0,l.useCallback)(async t=>{if(e){C(!0),E(null);try{let a=[];for(let e of Array.from(t)){let t=await e.text();a.push({path:e.name,content:t})}await (0,o.KU)().uploadAgentFiles(e,a),r()}catch(e){E(e instanceof Error?e.message:"Failed to upload files")}finally{C(!1)}}},[e,r]);async function K(t){if(e){S(t),E(null);try{await (0,o.KU)().deleteAgentFile(e,t),k(null),r()}catch(e){E(e instanceof Error?e.message:"Failed to delete file")}finally{S(null)}}}return e?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)(i(),{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,s.jsx)(x.A,{className:"h-4 w-4"}),"Back to ",e]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Knowledge Base"}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Files for ",(0,s.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,s.jsxs)(h.$,{onClick:()=>{var e;return null==(e=F.current)?void 0:e.click()},disabled:A,children:[A?(0,s.jsx)(m.A,{className:"h-4 w-4 mr-2 animate-spin"}):(0,s.jsx)(y.A,{className:"h-4 w-4 mr-2"}),A?"Uploading...":"Upload Files"]}),(0,s.jsx)("input",{ref:F,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&e.target.files.length>0&&(U(e.target.files),e.target.value="")}})]}),M&&(0,s.jsx)("div",{className:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2",children:M}),a?(0,s.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,s.jsx)(f.X,{height:60},e))}):0===t.length?(0,s.jsx)(d.p,{icon:(0,s.jsx)(p.A,{className:"h-12 w-12"}),title:"No files yet",description:"Upload knowledge base files for your agent. These files will be available in the agent's working directory.",action:(0,s.jsxs)(h.$,{onClick:()=>{var e;return null==(e=F.current)?void 0:e.click()},children:[(0,s.jsx)(y.A,{className:"h-4 w-4 mr-2"}),"Upload Files"]})}):(0,s.jsx)("div",{className:"space-y-2",children:t.map(e=>{let t="string"==typeof e?e:e.path||e.name,a=j===t;return(0,s.jsx)(u.Zp,{children:(0,s.jsxs)(u.Wu,{className:"!py-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("button",{onClick:()=>k(a?null:t),className:"flex items-center gap-2 min-w-0 flex-1 text-left",children:[a?(0,s.jsx)(g.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}):(0,s.jsx)(v.A,{className:"h-4 w-4 text-white/40 flex-shrink-0"}),(0,s.jsx)(w,{className:"h-4 w-4 text-indigo-400 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-sm text-white truncate",children:t})]}),(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>K(t),disabled:N===t,className:"text-white/30 hover:text-red-400 flex-shrink-0 ml-2",children:N===t?(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(b.A,{className:"h-3.5 w-3.5"})})]}),a&&"object"==typeof e&&e.content&&(0,s.jsx)("div",{className:"mt-3 pt-3 border-t border-white/5",children:(0,s.jsx)("pre",{className:"text-xs text-white/60 bg-black/20 rounded-lg p-3 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:e.content})})]})},t)})})]}):(0,s.jsxs)("div",{className:"text-center py-16",children:[(0,s.jsx)("p",{className:"text-white/50",children:"No agent name specified."}),(0,s.jsx)(i(),{href:"/agents",className:"text-indigo-400 hover:text-indigo-300 text-sm mt-2 inline-block",children:"Back to agents"})]})}function k(){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(f.X,{height:200}),children:(0,s.jsx)(j,{})})}},2922:(e,t,a)=>{Promise.resolve().then(a.bind(a,2029))},3544:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8154).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},3634:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8154).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},4275:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(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:()=>i,Zp:()=>n,aR:()=>r});var s=a(534),l=a(1804);function n(e){let{children:t,className:a}=e;return(0,s.jsx)("div",{className:(0,l.cn)("rounded-2xl border border-white/10 bg-[#1c2129] transition-all duration-200",a),children:t})}function r(e){let{children:t,className:a}=e;return(0,s.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",a),children:t})}function i(e){let{children:t,className:a}=e;return(0,s.jsx)("h3",{className:(0,l.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,s.jsx)("div",{className:(0,l.cn)("p-4 sm:p-6",a),children:t})}},6719:(e,t,a)=>{"use strict";a.d(t,{$:()=>c});var s=a(534),l=a(1804),n=a(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:a,variant:n="primary",size:c="md",disabled:o,...u}=e;return(0,s.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],a),disabled:o,...u})});c.displayName="Button"},7691:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(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,a)=>{"use strict";a.d(t,{X:()=>n});var s=a(534),l=a(1804);function n(e){let{width:t="100%",height:a=100,className:n}=e;return(0,s.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:a}})}},8314:(e,t,a)=>{"use strict";a.d(t,{p:()=>n});var s=a(534),l=a(1804);function n(e){let{icon:t,title:a,description:n,action:r,className:i}=e;return(0,s.jsxs)("div",{className:(0,l.cn)("flex flex-col items-center justify-center py-16 text-center",i),children:[t&&(0,s.jsx)("div",{className:"mb-4 text-white/30",children:t}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-white",children:a}),(0,s.jsx)("p",{className:"mt-1 max-w-sm text-sm text-white/50",children:n}),r&&(0,s.jsx)("div",{className:"mt-4",children:r})]})}},8408:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8154).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9197:(e,t,a)=>{"use strict";var s=a(4841);a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useSearchParams")&&a.d(t,{useSearchParams:function(){return s.useSearchParams}})}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=2922)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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"}]])},599:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(8154).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"}]])},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,_o:()=>x,aA:()=>h,aX:()=>u,l3:()=>m,te:()=>o,xV:()=>g,yu:()=>f});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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{files:t,loading:n,refresh:i}}function m(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function f(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 g(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"},2625:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});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),u=s(8314),h=s(7964),x=s(1804),m=s(858),f=s(3);let g=(0,s(8154).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 p=s(7955),y=s(7691),b=s(647),w=s(6650),v=s(599),j=s(8842),N=s(8968),k=s.n(N);function C(){let{agents:e,loading:t,refetch:s}=(0,n._F)(),[o,d]=(0,a.useState)(!1),[x,g]=(0,a.useState)(null),[p,y]=(0,a.useState)(null);async function b(e){y(null);try{await (0,r.KU)().deleteAgent(e),g(null),s()}catch(e){y(e instanceof Error?e.message:"Failed to delete agent"),g(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"]})]}),p&&(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:p}),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)(h.X,{height:160},e))}):0===e.length?(0,l.jsx)(u.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)(A,{agent:e,onDelete:()=>g(e.name)},e.id||e.name))}),o&&(0,l.jsx)(S,{onClose:()=>d(!1),onCreated:()=>{d(!1),s()}}),x&&(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:x}),"? This action cannot be undone."]}),(0,l.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,l.jsx)(c.$,{variant:"ghost",onClick:()=>g(null),children:"Cancel"}),(0,l.jsx)(c.$,{variant:"danger",onClick:()=>b(x),children:"Delete"})]})]})})})]})}function A(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)(k(),{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-40 rounded-lg border border-white/10 bg-[#1c2129] shadow-xl z-10 py-1",children:[(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)(p.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)(y.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,x.fw)(t.createdAt):"Unknown"}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsxs)(k(),{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)(b.A,{className:"h-3 w-3"}),"Try"]})})]})]})})}function S(e){let{onClose:t,onCreated:s}=e,[n,d]=(0,a.useState)("upload"),[u,h]=(0,a.useState)(""),[x,m]=(0,a.useState)(""),[f,g]=(0,a.useState)(""),[p,y]=(0,a.useState)([]),[b,N]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),A=(0,a.useRef)(null),S=(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 E(){if(!u.trim())return void C("Agent name is required");N(!0),C(null);try{await (0,r.KU)().createAgent(u.trim(),{systemPrompt:f||void 0,files:p.length>0?p:void 0}),s()}catch(e){C(e instanceof Error?e.message:"Failed to create agent")}finally{N(!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)(w.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)(v.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)(j.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: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:"System Prompt (optional)"}),(0,l.jsx)("textarea",{value:f,onChange:e=>g(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=A.current)?void 0:e.click()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.files.length>0&&S(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)(v.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:A,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&S(e.target.files)}}),p.length>0&&(0,l.jsxs)("p",{className:"text-xs text-white/50",children:[p.length," file",1!==p.length?"s":""," selected"]})]}),k&&(0,l.jsx)("p",{className:"text-sm text-red-400",children:k}),(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: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"})})]})]})})})}},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})}},5373:(e,t,s)=>{Promise.resolve().then(s.bind(s,2625))},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"},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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[955],{858:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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,_o:()=>x,aA:()=>h,aX:()=>u,l3:()=>m,te:()=>o,xV:()=>b,yu:()=>f});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,d]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{let e=await (0,l.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=r(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,l.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]),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,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 u(){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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files:t,loading:n,refresh:i}}function m(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function f(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 b(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}},2505:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(534),l=s(1804);let n=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:n,error:r,id:i,...c}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[n&&(0,a.jsx)("label",{htmlFor:i,className:"block text-sm font-medium text-white/70",children:n}),(0,a.jsx)("input",{ref:t,id:i,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 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,a.jsx)("p",{className:"text-xs text-red-400",children:r})]})});n.displayName="Input"},2737:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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"}]])},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"}]])},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})}},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),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,...d}=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,...d})});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}})}},8314:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(534),l=s(1804);function n(e){let{icon:t,title:s,description:n,action:r,className:i}=e;return(0,a.jsxs)("div",{className:(0,l.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}),r&&(0,a.jsx)("div",{className:"mt-4",children:r})]})}},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"}]])},8497:(e,t,s)=>{Promise.resolve().then(s.bind(s,9107))},9107:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(534),l=s(4166),n=s(9197),r=s(8968),i=s.n(r),c=s(989),o=s(3929),d=s(4765),u=s(6719),h=s(2505),x=s(5968),m=s(8314),f=s(7964),b=s(1804),g=s(4275),v=s(858),p=s(2737),w=s(6379),y=s(8408),j=s(6650);function N(){let e=(0,n.useSearchParams)().get("name"),{versions:t,loading:s,refresh:r}=(0,c.aA)(e),[h,j]=(0,l.useState)(!1),[N,S]=(0,l.useState)(null),[C,A]=(0,l.useState)(null);async function E(t){if(e){S(t),A(null);try{await (0,o.KU)().activateAgentVersion(e,t),r()}catch(e){A(e instanceof Error?e.message:"Failed to activate version")}finally{S(null)}}}return e?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(i(),{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,a.jsx)(g.A,{className:"h-4 w-4"}),"Back to ",e]}),(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:"Versions"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-white/50",children:["Manage versions for ",(0,a.jsx)("span",{className:"text-white/70",children:e})]})]}),(0,a.jsxs)(u.$,{onClick:()=>j(!0),children:[(0,a.jsx)(v.A,{className:"h-4 w-4 mr-2"}),"Create Version"]})]}),C&&(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:C}),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)(p.A,{className:"h-12 w-12"}),title:"No versions yet",description:"Create your first version to snapshot the agent's configuration.",action:(0,a.jsxs)(u.$,{onClick:()=>j(!0),children:[(0,a.jsx)(v.A,{className:"h-4 w-4 mr-2"}),"Create Version"]})}):(0,a.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,a.jsx)(d.Zp,{children:(0,a.jsx)(d.Wu,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-white",children:["v",e.versionNumber]}),e.name&&(0,a.jsx)("span",{className:"text-sm text-white/50",children:e.name}),e.isActive&&(0,a.jsxs)(x.E,{variant:"success",children:[(0,a.jsx)(w.A,{className:"h-3 w-3 mr-1"}),"Active"]})]}),e.releaseNotes&&(0,a.jsx)("p",{className:"text-xs text-white/40 mt-1",children:e.releaseNotes}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,b.fw)(e.createdAt)}),e.systemPrompt&&(0,a.jsx)("span",{className:"text-xs text-white/30",children:"Has system prompt"}),e.knowledgeFiles&&e.knowledgeFiles.length>0&&(0,a.jsxs)("span",{className:"text-xs text-white/30",children:[e.knowledgeFiles.length," knowledge file",1!==e.knowledgeFiles.length?"s":""]})]})]}),!e.isActive&&(0,a.jsxs)(u.$,{variant:"secondary",size:"sm",onClick:()=>E(e.versionNumber),disabled:N===e.versionNumber,children:[N===e.versionNumber?(0,a.jsx)(y.A,{className:"h-3 w-3 animate-spin mr-1"}):(0,a.jsx)(w.A,{className:"h-3 w-3 mr-1"}),"Activate"]})]})})},e.id))}),h&&(0,a.jsx)(k,{agentName:e,onClose:()=>j(!1),onCreated:()=>{j(!1),r()}})]}):(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 k(e){let{agentName:t,onClose:s,onCreated:n}=e,[r,i]=(0,l.useState)(""),[c,x]=(0,l.useState)(""),[m,f]=(0,l.useState)(""),[b,g]=(0,l.useState)(!1),[v,p]=(0,l.useState)(null);async function w(){g(!0),p(null);try{await (0,o.KU)().createAgentVersion(t,{name:r||void 0,systemPrompt:c||void 0,releaseNotes:m||void 0}),n()}catch(e){p(e instanceof Error?e.message:"Failed to create version")}finally{g(!1)}}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-lg max-h-[90vh] overflow-auto",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:"Create Version"}),(0,a.jsx)("button",{onClick:s,className:"text-white/40 hover:text-white",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(h.p,{label:"Version Name (optional)",placeholder:"e.g. v2 - improved grounding",value:r,onChange:e=>i(e.target.value)}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"System Prompt (optional)"}),(0,a.jsx)("textarea",{value:c,onChange:e=>x(e.target.value),rows:4,placeholder:"System prompt for this version...",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,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-white/70",children:"Release Notes (optional)"}),(0,a.jsx)("textarea",{value:m,onChange:e=>f(e.target.value),rows:2,placeholder:"What changed in this version...",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"})]}),v&&(0,a.jsx)("p",{className:"text-sm text-red-400",children:v}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,a.jsx)(u.$,{variant:"ghost",onClick:s,children:"Cancel"}),(0,a.jsx)(u.$,{onClick:w,disabled:b,children:b?"Creating...":"Create Version"})]})]})]})})})}function S(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(f.X,{height:200}),children:(0,a.jsx)(N,{})})}},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=8497)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[745],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,_o:()=>x,aA:()=>d,aX:()=>h,l3:()=>f,te:()=>o,xV:()=>p,yu:()=>m});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,f]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{try{let t=await (0,a.KU)().listSessions(null==e?void 0:e.agent);u(t),i(s,t),f(null)}catch(e){f(e)}finally{d(!1)}},[null==e?void 0:e.agent,s]);return(0,l.useEffect)(()=>{m()},[m]),n(()=>m(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:h,error:x,refetch:m}}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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{files:t,loading:n,refresh:i}}function f(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function m(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 p(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:()=>f});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 f(){let[e,t]=(0,a.useState)("7d"),{agents:s}=(0,n._F)(),{sessions:f}=(0,n.te)({autoRefresh:!1}),[p,y]=(0,a.useState)([]),[g,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:f.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=f.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),y(l)}catch(e){}finally{w(!1)}}s.length>0?t():w(!1)},[e,s,f]),(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)(m,{icon:(0,l.jsx)(u.A,{className:"h-5 w-5"}),label:"Sessions",value:g?"-":v.sessions.toString()}),(0,l.jsx)(m,{icon:(0,l.jsx)(h.A,{className:"h-5 w-5"}),label:"Total Tokens",value:g?"-":(0,o.ZV)(v.tokens)}),(0,l.jsx)(m,{icon:(0,l.jsx)(d.A,{className:"h-5 w-5"}),label:"Tool Calls",value:g?"-":(0,o.ZV)(v.toolCalls)}),(0,l.jsx)(m,{icon:(0,l.jsx)(x.A,{className:"h-5 w-5"}),label:"Compute Time",value:g?"-":(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:g?(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 m(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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{989:(e,t,l)=>{"use strict";l.d(t,{Wz:()=>u,_F:()=>o,_o:()=>d,aA:()=>h,aX:()=>f,l3:()=>x,te:()=>c,xV:()=>b,yu:()=>g});var a=l(4166),n=l(3929);function s(e,t){let l=(0,a.useRef)(e);(0,a.useEffect)(()=>{l.current=e},[e]),(0,a.useEffect)(()=>{if(null===t)return;let e=setInterval(()=>l.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,l]=(0,a.useState)(null!=e?e:[]),[s,o]=(0,a.useState)(!e),[c,u]=(0,a.useState)(null),f=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().listAgents();l(e),i("ash:agents",e),u(null)}catch(e){u(e)}finally{o(!1)}},[]);return(0,a.useEffect)(()=>{f()},[f]),{agents:t,loading:s,error:c,refetch:f}}function c(e){var t;let l="ash:sessions:".concat(null!=(t=null==e?void 0:e.agent)?t:"all"),o=r(l),[c,u]=(0,a.useState)(null!=o?o:[]),[f,h]=(0,a.useState)(!o),[d,x]=(0,a.useState)(null),g=(0,a.useCallback)(async()=>{try{let t=await (0,n.KU)().listSessions(null==e?void 0:e.agent);u(t),i(l,t),x(null)}catch(e){x(e)}finally{h(!1)}},[null==e?void 0:e.agent,l]);return(0,a.useEffect)(()=>{g()},[g]),s(()=>g(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:c,loading:f,error:d,refetch:g}}function u(){let[e,t]=(0,a.useState)(()=>r("ash:health")),[l,o]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().health();t(e),o(null),i("ash:health",e)}catch(e){o(e)}},[]);return(0,a.useEffect)(()=>{c()},[c]),s(()=>c(),3e4),{health:e,error:l,refetch:c}}function f(){let[e,t]=(0,a.useState)([]),[l,s]=(0,a.useState)(!0),[r,i]=(0,a.useState)(null),o=(0,a.useCallback)(async()=>{try{let e=await (0,n.KU)().listCredentials();t(e),i(null)}catch(e){i(e)}finally{s(!1)}},[]);return(0,a.useEffect)(()=>{o()},[o]),{credentials:e,loading:l,error:r,refetch:o}}function h(e){let[t,l]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,n.KU)().listAgentVersions(e);l(t)}catch(e){console.error("Failed to fetch versions:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{versions:t,loading:s,refresh:i}}function d(e){let[t,l]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,n.KU)().listAgentFiles(e);l(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files:t,loading:s,refresh:i}}function x(e){let[t,l]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,n.KU)().listEvalCases(e);l(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:s,refresh:i}}function g(e){let[t,l]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{r(!0);let t=await (0,n.KU)().listEvalRuns(e);l(t)}catch(e){console.error("Failed to fetch eval runs:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{runs:t,loading:s,refresh:i}}function b(e,t){let[l,s]=(0,a.useState)([]),[r,i]=(0,a.useState)(!0),o=(0,a.useCallback)(async()=>{if(e&&t)try{i(!0);let l=await (0,n.KU)().getEvalRunResults(e,t);s(l)}catch(e){console.error("Failed to fetch eval results:",e)}finally{i(!1)}},[e,t]);return(0,a.useEffect)(()=>{o()},[o]),{results:l,loading:r,refresh:o}}},1804:(e,t,l)=>{"use strict";l.d(t,{Ct:()=>c,ZV:()=>i,a3:()=>o,cn:()=>s,fw:()=>r});var a=l(6862),n=l(3690);function s(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return(0,n.QP)((0,a.$)(t))}function r(e){let t=Date.now(),l=Math.floor((t-new Date(e).getTime())/1e3);if(l<60)return"".concat(l,"s ago");let a=Math.floor(l/60);if(a<60)return"".concat(a,"m ago");let n=Math.floor(a/60);if(n<24)return"".concat(n,"h ago");let s=Math.floor(n/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 l=Math.floor(t/60);return"".concat(l,"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,l)=>{"use strict";l.d(t,{DashboardNav:()=>w});var a=l(534),n=l(8968),s=l.n(n),r=l(9197),i=l(1804),o=l(989),c=l(8785),u=l(647),f=l(3),h=l(4195),d=l(7413),x=l(2087),g=l(5689),b=l(4193),m=l(8530);let v=[{href:"/",label:"Dashboard",icon:c.A},{href:"/playground",label:"Playground",icon:u.A},{href:"/agents",label:"Agents",icon:f.A},{href:"/sessions",label:"Sessions",icon:h.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:l,branding:n}=e,c=(0,r.usePathname)(),{health:u}=(0,o.Wz)(),f=t?[...v,...t]:v,h=l?[...y,...l]:y,d=(null==u?void 0:u.status)==="ok";return(0,a.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,a.jsxs)("div",{className:"flex h-16 items-center gap-3 px-5 border-b border-white/10",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-indigo-500",children:(0,a.jsx)("span",{className:"text-sm font-bold text-white",children:"A"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"text-white font-bold tracking-tight block",children:n||"Ash"}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-white/40 text-xs font-mono",children:[(0,a.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,a.jsx)("div",{className:"flex-1 overflow-auto px-3 py-4 scrollbar-thin",children:(0,a.jsx)("div",{className:"space-y-0.5",children:f.map(e=>{let t=c===e.href||"/"!==e.href&&c.startsWith(e.href);return(0,a.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,a.jsx)(e.icon,{className:"h-4 w-4"}),e.label,t&&(0,a.jsx)("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-indigo-400 animate-pulse"})]},e.href)})})}),(0,a.jsxs)("div",{className:"border-t border-white/10 px-3 py-3 space-y-0.5",children:[h.map(e=>{let t=!e.external&&c.startsWith(e.href);return e.external?(0,a.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,a.jsx)(e.icon,{className:"h-4 w-4"}),e.label]},e.label):(0,a.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,a.jsx)(e.icon,{className:"h-4 w-4"}),e.label]},e.label)}),(null==u?void 0:u.version)&&(0,a.jsxs)("div",{className:"px-3 py-2 text-xs text-white/20 font-mono",children:["v",u.version]})]})]})}},6121:(e,t,l)=>{Promise.resolve().then(l.t.bind(l,9061,23)),Promise.resolve().then(l.t.bind(l,9480,23)),Promise.resolve().then(l.bind(l,2553)),Promise.resolve().then(l.bind(l,6412))},6412:(e,t,l)=>{"use strict";l.d(t,{AshProvider:()=>i});var a=l(534),n=l(4166),s=l(3929);let r=(0,n.createContext)(null);function i(e){let{children:t}=e,l=(0,s.KU)();return(0,a.jsx)(r.Provider,{value:l,children:t})}},9480:()=>{}},e=>{e.O(0,[827,513,53,839,90,929,705,522,358],()=>e(e.s=6121)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[524],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,_o:()=>f,aA:()=>h,aX:()=>d,l3:()=>x,te:()=>o,xV:()=>v,yu:()=>m});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),[f,x]=(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),x(null)}catch(e){x(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:f,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 f(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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files: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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function m(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 v(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,8468))},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"},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}},8468:(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),f=s(9266),x=s(8154);let 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.A,{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.A,{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,f]=(0,l.useState)(!1);async function x(){if(!s&&0===i.length){f(!0);try{let e=await (0,r.KU)().listSessionEvents(t.id,{limit:50});c(e)}catch(e){}finally{f(!1)}}n(!s)}return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:x,"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)})})})]})}},9266:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8154).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"}]])}},e=>{e.O(0,[513,53,929,705,522,358],()=>e(e.s=2998)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{3:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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,_o:()=>f,aA:()=>h,aX:()=>d,l3:()=>x,te:()=>o,xV:()=>m,yu:()=>g});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),[f,x]=(0,a.useState)(null),g=(0,a.useCallback)(async()=>{try{let t=await (0,l.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,a.useEffect)(()=>{g()},[g]),n(()=>g(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:d,error:f,refetch:g}}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 f(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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files: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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function g(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 m(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}}},1710:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var a=s(534),l=s(989),n=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,l._F)(),{sessions:g,loading:y}=(0,l.te)({limit:5}),{health:v}=(0,l.Wz)(),b=g.filter(e=>"active"===e.status);return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Dashboard"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"Overview of your Ash server"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsx)(m,{icon:(0,a.jsx)(o.A,{className:"h-5 w-5"}),label:"Agents",value:f?"-":s.length.toString(),href:"/agents"}),(0,a.jsx)(m,{icon:(0,a.jsx)(u.A,{className:"h-5 w-5"}),label:"Active Sessions",value:y?"-":b.length.toString(),href:"/sessions"}),(0,a.jsx)(m,{icon:(0,a.jsx)(d.A,{className:"h-5 w-5"}),label:"Total Sessions",value:y?"-":g.length.toString(),href:"/sessions"}),(0,a.jsx)(m,{icon:(0,a.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,a.jsxs)(n.Zp,{children:[(0,a.jsx)(n.aR,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(n.ZB,{children:"Recent Sessions"}),(0,a.jsx)(x(),{href:"/sessions",className:"text-sm text-indigo-400 hover:text-indigo-300 transition-colors",children:"View all"})]})}),(0,a.jsx)(n.Wu,{children:y?(0,a.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(i.X,{height:48},e))}):0===g.length?(0,a.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,a.jsx)("div",{className:"space-y-2",children:g.slice(0,5).map(e=>(0,a.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,a.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-white truncate",children:e.agentName}),(0,a.jsx)("p",{className:"text-xs text-white/40 font-mono",children:e.id.slice(0,8)})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(r.W,{status:e.status}),(0,a.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:l,href:r}=e,i=(0,a.jsx)(n.Zp,{className:r?"hover:border-white/20 cursor-pointer":"",children:(0,a.jsx)(n.Wu,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-white/50",children:s}),(0,a.jsx)("p",{className:"text-2xl font-bold text-white mt-1",children:l})]}),(0,a.jsx)("div",{className:"text-white/20",children:t})]})})});return r?(0,a.jsx)(x(),{href:r,children:i}):i}},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}},3238:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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:()=>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:()=>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})}},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 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})}},6664:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(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:()=>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}})}}},e=>{e.O(0,[513,53,839,929,705,522,358],()=>e(e.s=4854)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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 l={...u,...t};return(0,r.default)({...l,modules:null==(n=l.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),l=n(5452);function a(e){return{default:e&&"default"in e?e.default:e}}n(1649);let o={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...o,...e},n=(0,u.lazy)(()=>t.loader().then(a)),s=t.loading;function i(e){let a=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)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(i,{...o?{fallback:a}:{},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,5619))},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)},5619:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(534),u=n(4166),l=n(9197),a=n(3929),o=n(191);let s=n.n(o)()(()=>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)(i,{})});function i(){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 c(){let e=(0,l.useSearchParams)().get("agent")||void 0,t=(0,a.KU)();return(0,r.jsx)("div",{className:"h-[calc(100vh-5rem)]",children:(0,r.jsx)(s,{client:t,...e?{initialAgent:e}:{}})})}function d(){return(0,r.jsx)(u.Suspense,{fallback:(0,r.jsx)(i,{}),children:(0,r.jsx)(c,{})})}},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 a},createAsyncLocalStorage:function(){return l},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 l(){return u?new u:new r}function a(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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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:()=>u,_F:()=>c,_o:()=>x,aA:()=>h,aX:()=>d,l3:()=>m,te:()=>o,xV:()=>p,yu:()=>f});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),d=(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)(()=>{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,l.useState)(null!=c?c:[]),[d,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);u(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:d,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 d(){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)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{files:t,loading:n,refresh:i}}function m(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)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{r(!1)}},[e]);return(0,l.useEffect)(()=>{i()},[i]),{cases:t,loading:n,refresh:i}}function f(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 p(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,...u}=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,...u})});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:u,iconNode:d,...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},[...d.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}},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),u=s(8314),d=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),[C,A]=(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){A(null);try{await (0,r.KU)().cancelQueueItem(e),E()}catch(e){A(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"]})]}),C&&(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:C}),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)(d.X,{height:48},e))}):0===t.length?(0,l.jsx)(u.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:u}=e,[d,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(!d||!x.trim())return void y("Agent and prompt are required");b(!0),y(null);try{await (0,r.KU)().enqueue(d,x.trim()),u()}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:d,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()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[898],{989:(e,t,s)=>{"use strict";s.d(t,{Wz:()=>u,_F:()=>c,_o:()=>h,aA:()=>x,aX:()=>d,l3:()=>f,te:()=>o,xV:()=>p,yu:()=>m});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 i(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}function c(){let e=n("ash:agents"),[t,s]=(0,a.useState)(null!=e?e:[]),[r,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: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"),c=n(s),[o,u]=(0,a.useState)(null!=c?c:[]),[d,x]=(0,a.useState)(!c),[h,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{x(!1)}},[null==e?void 0:e.agent,s]);return(0,a.useEffect)(()=>{m()},[m]),r(()=>m(),(null==e?void 0:e.autoRefresh)!==!1?1e4:null),{sessions:o,loading:d,error:h,refetch:m}}function u(){let[e,t]=(0,a.useState)(()=>n("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]),r(()=>o(),3e4),{health:e,error:s,refetch:o}}function d(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),[n,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{r(!1)}},[]);return(0,a.useEffect)(()=>{c()},[c]),{credentials:e,loading:s,error:n,refetch:c}}function x(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),i=(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)(()=>{i()},[i]),{versions:t,loading:r,refresh:i}}function h(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,l.KU)().listAgentFiles(e);s(t.files)}catch(e){console.error("Failed to fetch files:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{files:t,loading:r,refresh:i}}function f(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{if(e)try{n(!0);let t=await (0,l.KU)().listEvalCases(e);s(t)}catch(e){console.error("Failed to fetch eval cases:",e)}finally{n(!1)}},[e]);return(0,a.useEffect)(()=>{i()},[i]),{cases:t,loading:r,refresh:i}}function m(e){let[t,s]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),i=(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)(()=>{i()},[i]),{runs:t,loading:r,refresh:i}}function p(e,t){let[s,r]=(0,a.useState)([]),[n,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);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:n,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:()=>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 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,6616))},3007:(e,t,s)=>{"use strict";s.d(t,{l:()=>r});var a=s(534),l=s(1804);let r=(0,s(4166).forwardRef)((e,t)=>{let{className:s,label:r,options:n,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,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}),n.map(e=>(0,a.jsx)("option",{value:e.value,disabled:e.disabled,className:"bg-[#1c2129]",children:e.label},e.value))]})]})});r.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"}]])},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:()=>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 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:()=>n,W:()=>i});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 i(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})}},6616:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var a=s(534),l=s(4166),r=s(9197),n=s(989),i=s(3929),c=s(4765),o=s(6719),u=s(5968),d=s(8314),x=s(3007),h=s(7964),f=s(1804),m=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"}]]),w=(0,p.A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var v=s(1080),b=s(7955);let y=(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);function k(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"text-sm text-white/40",children:"Loading..."}),children:(0,a.jsx)(A,{})})}function A(){let e=(0,r.useSearchParams)().get("id"),{agents:t}=(0,n._F)(),[s,i]=(0,l.useState)(""),[c,o]=(0,l.useState)(""),{sessions:p,loading:g,refetch:w}=(0,n.te)({agent:s||void 0,autoRefresh:!0}),[v,b]=(0,l.useState)(e);(0,l.useEffect)(()=>{!v&&p.length>0&&b(p[0].id)},[p,v]);let y=p.filter(e=>!c||e.status===c),j=p.find(e=>e.id===v),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===y.length?(0,a.jsx)("p",{className:"text-sm text-white/40 text-center py-8",children:"No sessions found"}):y.map(e=>(0,a.jsxs)("button",{onClick:()=>b(e.id),className:(0,f.cn)("w-full text-left rounded-lg border px-3 py-2.5 transition-colors",v===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)(u.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,f.Ct)(e.id)}),(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,f.fw)(e.createdAt)})]})]},e.id))})]}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:j?(0,a.jsx)(C,{session:j},j.id):(0,a.jsx)(d.p,{icon:(0,a.jsx)(m.A,{className:"h-12 w-12"}),title:"Select a session",description:"Choose a session from the list to view details"})})]})}function C(e){let{session:t}=e,[s,r]=(0,l.useState)("messages"),[n,d]=(0,l.useState)([]),[x,p]=(0,l.useState)([]),[N,S]=(0,l.useState)([]),[k,A]=(0,l.useState)(!0),C=(0,l.useRef)(!1),_=t.id,R=t.status,M=(0,l.useCallback)(async()=>{if(!C.current){C.current=!0;try{let e=(0,i.KU)(),[t,s]=await Promise.all([e.listMessages(_).catch(()=>[]),e.listSessionEvents(_).catch(()=>[])]);d(t),p(s)}catch(e){}finally{C.current=!1,A(!1)}}},[_]);async function z(e){let t=(0,i.KU)();try{"pause"===e?await t.pauseSession(_):"resume"===e?await t.resumeSession(_):"stop"===e?await t.stopSession(_):"end"===e&&await t.endSession(_)}catch(t){console.error("Failed to ".concat(e," session:"),t)}}return(0,l.useEffect)(()=>{M()},[M]),(0,l.useEffect)(()=>{if("active"!==R)return;let e=setInterval(M,5e3);return()=>clearInterval(e)},[R,M]),(0,l.useEffect)(()=>{if("terminal"!==s)return;let e=async()=>{try{let e=await (0,i.KU)().getSessionLogs(_);(null==e?void 0:e.logs)&&S(e.logs.map(e=>e.text))}catch(e){S(["Failed to load logs"])}};if(e(),"active"===R){let t=setInterval(e,2e3);return()=>clearInterval(t)}},[s,_,R]),(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)(u.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,f.fw)(t.createdAt)}),t.model&&(0,a.jsx)(u.E,{variant:"info",children:t.model})]})]}),(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:()=>z("pause"),title:"Pause",children:(0,a.jsx)(g,{className:"h-4 w-4"})}),(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>z("stop"),title:"Stop",children:(0,a.jsx)(w,{className:"h-4 w-4"})})]}),("paused"===t.status||"stopped"===t.status)&&(0,a.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>z("resume"),title:"Resume",children:(0,a.jsx)(v.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)(b.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:y,count:n.length},{key:"events",label:"Events",icon:m.A,count:x.length},{key:"terminal",label:"Terminal",icon:j.A}].map(e=>{let{key:t,label:l,icon:n,count:i}=e;return(0,a.jsxs)("button",{onClick:()=>r(t),className:(0,f.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)(n,{className:"h-3.5 w-3.5"}),l,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)(E,{messages:n}):"events"===s?(0,a.jsx)(F,{events:x}):(0,a.jsx)(P,{logs:N})})]})}function E(e){let{messages:t}=e,s=(0,l.useRef)(null);return((0,l.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,[r,n]=(0,l.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,f.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)(u.E,{variant:s?"info":"default",children:s?"User":"Assistant"}),t.createdAt&&(0,a.jsx)("span",{className:"text-xs text-white/30",children:(0,f.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)(R,{toolCall:e},e.id||t))}),(0,a.jsxs)("button",{onClick:()=>n(!r),className:"mt-2 text-xs text-white/30 hover:text-white/50 transition-colors flex items-center gap-1",children:[r?(0,a.jsx)(N.A,{className:"h-3 w-3"}):(0,a.jsx)(S.A,{className:"h-3 w-3"}),"Raw JSON"]}),r&&(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 R(e){let{toolCall:t}=e,[s,r]=(0,l.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:()=>r(!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 F(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"};return(0,a.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,a.jsx)(M,{event:e,typeColors:s},e.id||t))})}function M(e){let{event:t,typeColors:s}=e,[r,n]=(0,l.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.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:()=>n(!r),"aria-expanded":r,className:"flex items-center gap-3 w-full px-3 py-2 text-sm hover:bg-white/[0.02] transition-colors",children:[r?(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)(u.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,f.fw)(t.createdAt):""})]}),r&&(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 P(e){let{logs:t}=e,s=(0,l.useRef)(null);return((0,l.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})]})}},6719:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(534),l=s(1804),r=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,r.forwardRef)((e,t)=>{let{className:s,variant:r="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",n[r],i[c],s),disabled:o,...u})});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:()=>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}})}},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 r={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,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:o="",children:u,iconNode:d,...x}=e;return(0,a.createElement)("svg",{ref:t,...r,width:n,height:n,stroke:s,strokeWidth:c?24*Number(i)/Number(n):i,className:l("lucide",o),...x},[...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,r)=>{let{className:i,...c}=s;return(0,a.createElement)(n,{ref:r,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}},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:i}=e;return(0,a.jsxs)("div",{className:(0,l.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}),n&&(0,a.jsx)("div",{className:"mt-4",children:n})]})}},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()}]);
|