@devflow-tools/devflow 0.12.4 → 0.12.5

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.
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/9bb745101fd21603.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-202a5f91ead17fa7.js" async=""></script><script src="/_next/static/chunks/254-814190ccf12d2df8.js" async=""></script><script src="/_next/static/chunks/app/layout-0e71002867d54cb5.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/9bb745101fd21603.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[11815,[],\"\"]\n4:I[55092,[],\"\"]\n5:I[82023,[],\"\"]\n6:I[72921,[\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"185\",\"static/chunks/app/layout-0e71002867d54cb5.js\"],\"default\",1]\nc:I[91584,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"YnHnPFDLDTTnJWGvL2oh7\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bb745101fd21603.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/9bb745101fd21603.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-202a5f91ead17fa7.js" async=""></script><script src="/_next/static/chunks/254-814190ccf12d2df8.js" async=""></script><script src="/_next/static/chunks/app/layout-0e71002867d54cb5.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/9bb745101fd21603.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[11815,[],\"\"]\n4:I[55092,[],\"\"]\n5:I[82023,[],\"\"]\n6:I[72921,[\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"185\",\"static/chunks/app/layout-0e71002867d54cb5.js\"],\"default\",1]\nc:I[91584,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"EDDf6rtQ-c_W_Mi0ANVIA\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bb745101fd21603.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{56364:function(e,s,t){Promise.resolve().then(t.bind(t,71847))},71847:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sJ}});var l,n,r=t(27573),a=t(7653),i=t(62052);let d="devflow-project-root",o="devflow-active-project-root";function c(e){try{return localStorage.getItem(e)}catch(e){return null}}function m(e,s){try{null===s?localStorage.removeItem(e):localStorage.setItem(e,s)}catch(e){}}let x=(0,i.Ue)(e=>({activeView:"overview",selectedNodeId:null,detailTab:"properties",searchQuery:"",projectRoot:c(d),activeProjectRoot:c(o),selectedRunId:null,setActiveView:s=>e({activeView:s,selectedNodeId:null}),selectNode:s=>e({selectedNodeId:s}),setDetailTab:s=>e({detailTab:s}),setSearchQuery:s=>e({searchQuery:s}),setProjectRoot:s=>{m(d,s),e({projectRoot:s})},setActiveProjectRoot:s=>{m(o,s),e({activeProjectRoot:s})},setSelectedRunId:s=>e({selectedRunId:s})}));function u(e){let{nav:s,main:t,detail:l}=e;return(0,r.jsxs)("div",{className:"flex h-screen w-full",children:[(0,r.jsx)("aside",{className:"w-[220px] shrink-0 border-r border-border bg-card overflow-y-auto",children:s}),(0,r.jsx)("main",{className:"flex-1 overflow-hidden",children:t}),l&&(0,r.jsx)("aside",{className:"w-[340px] shrink-0 border-l border-border bg-card overflow-y-auto",children:l})]})}var h=t(10607),v=t(25579);function p(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,v.m6)((0,h.W)(s))}var j=t(83071),f=t(50646),g=t(88497),y=t(61990),N=t(31815),b=t(46693),w=t(70548),k=t(41755),S=t(25555),C=t(39790),R=t(84142),T=t(31095),P=t(12198),F=t(3806);let q=[{id:"overview",labelKey:"nav.overview",icon:j.Z},{id:"graph",labelKey:"nav.graph",icon:f.Z},{id:"context",labelKey:"nav.context",icon:g.Z},{id:"workflows",labelKey:"nav.workflows",icon:y.Z},{id:"memory",labelKey:"nav.memory",icon:N.Z},{id:"benchmark",labelKey:"nav.benchmark",icon:b.Z},{id:"knowledge",labelKey:"nav.knowledge",icon:w.Z},{id:"runs",labelKey:"nav.runs",icon:k.Z},{id:"timeline",labelKey:"nav.timeline",icon:S.Z},{id:"executions",labelKey:"nav.executions",icon:C.Z},{id:"tool-metrics",labelKey:"nav.toolMetrics",icon:R.Z},{id:"accuracy",labelKey:"nav.accuracy",icon:T.Z},{id:"settings",labelKey:"nav.settings",icon:P.Z}];function K(){let{t:e,i18n:s}=(0,F.$G)(),t=x(e=>e.activeView),l=x(e=>e.setActiveView);return(0,r.jsxs)("nav",{className:"flex flex-col gap-1 p-3 h-full",children:[(0,r.jsx)("h1",{className:"text-lg font-bold mb-4 px-3 text-primary",children:e("nav.title")}),q.map(s=>(0,r.jsxs)("button",{onClick:()=>l(s.id),className:p("flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors",t===s.id?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-accent"),children:[(0,r.jsx)(s.icon,{className:"h-4 w-4"}),e(s.labelKey)]},s.id)),(0,r.jsx)("div",{className:"mt-auto pt-4 border-t border-border",children:(0,r.jsx)("button",{onClick:()=>{s.changeLanguage("zh"===s.language?"en":"zh")},className:"w-full px-3 py-2 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:e("nav.language")})})]})}var D=t(31988),L=t(77930),I=t(15969),Z=t(49767);let E=null!==(l=Z.env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==l?l:"http://localhost:13337",_=null!==(n=Z.env.NEXT_PUBLIC_DEVFLOW_API_KEY)&&void 0!==n?n:"dev-key-000000";async function O(e,s){let t=function(){try{return localStorage.getItem("devflow-active-project-root")}catch(e){return null}}(),l={"Content-Type":"application/json","x-api-key":_};t&&(l["x-devflow-project"]=t);let n=await fetch("".concat(E,"/api").concat(e),{...s,headers:{...l,...null==s?void 0:s.headers}});if(!n.ok)throw Error("API ".concat(n.status,": ").concat(await n.text()));let r=await n.json();return r&&"object"==typeof r&&"ok"in r&&"data"in r?r.data:r}let A=()=>O("/projects"),M=e=>O("/projects/connect",{method:"POST",body:JSON.stringify({rootPath:e})}),z=()=>O("/projects/active",{method:"DELETE"}),Q=()=>O("/projects/active"),G=e=>O("/projects/onboarding-pack?rootPath=".concat(encodeURIComponent(e))),U=()=>O("/context/status"),V=e=>O("/context/build",{method:"POST",body:JSON.stringify(e)}),$=e=>O("/context/build-task",{method:"POST",body:JSON.stringify(e)}),H=e=>O("/context/feedback",{method:"POST",body:JSON.stringify(e)}),J=()=>O("/graph"),B=()=>O("/graph?view=layered"),W=()=>O("/workflows"),X=(e,s)=>O("/workflows/".concat(e,"/run"),{method:"POST",body:JSON.stringify({input:s})}),Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return O("/workflows/runs?limit=".concat(e,"&offset=").concat(s))},ee=()=>O("/memory"),es=e=>O("/memory",{method:"POST",body:JSON.stringify(e)}),et=(e,s)=>O("/memory/".concat(e),{method:"PUT",body:JSON.stringify(s)}),el=e=>O("/memory/".concat(e),{method:"DELETE"}),en=e=>O("/memory/candidates/".concat(e,"/approve"),{method:"POST"}),er=e=>O("/memory/candidates/".concat(e,"/reject"),{method:"POST"}),ea=(e,s,t)=>O("/memory/search",{method:"POST",body:JSON.stringify({query:e,limit:s,categories:t})}),ei=()=>O("/memory/ollama/status"),ed=(e,s)=>O("/knowledge/search?q=".concat(encodeURIComponent(e)).concat(s?"&scope=".concat(s):"")),eo=e=>O("/knowledge/sync",{method:"POST",body:JSON.stringify({pluginName:e})}),ec=()=>O("/knowledge/sources"),em=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;return O("/telemetry/runs?limit=".concat(e,"&offset=").concat(s).concat(t?"&source=".concat(t):""))},ex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,l=new URLSearchParams({limit:String(e),offset:String(s)});return t&&l.set("projectRoot",t),O("/telemetry/sessions?".concat(l))},eu=e=>O("/telemetry/sessions/".concat(e)),eh=e=>O("/telemetry/sessions/".concat(e,"/events")),ev=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/stats?days=".concat(e))},ep=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/roi-summary?days=".concat(e))},ej=e=>O("/telemetry/cleanup",{method:"POST",body:JSON.stringify({olderThanDays:e})}),ef=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/tool-metrics/summary?days=".concat(e))},eg=(e,s)=>{let t=new URLSearchParams;e&&t.set("engine",e),s&&t.set("since",String(s));let l=t.toString();return O("/telemetry/accuracy/stats".concat(l?"?".concat(l):""))},ey=e=>{let s=new URLSearchParams;(null==e?void 0:e.engine)&&s.set("engine",e.engine),(null==e?void 0:e.status)&&s.set("status",e.status),(null==e?void 0:e.limit)&&s.set("limit",String(e.limit)),(null==e?void 0:e.offset)&&s.set("offset",String(e.offset));let t=s.toString();return O("/telemetry/accuracy/queries".concat(t?"?".concat(t):""))},eN=e=>O("/telemetry/accuracy/feedback",{method:"POST",body:JSON.stringify(e)}),eb=()=>O("/telemetry/auto-check"),ew=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1?arguments[1]:void 0,t=new URLSearchParams({limit:String(e)});return s&&t.set("skillName",s),O("/telemetry/executions?".concat(t))},ek=e=>O("/telemetry/executions/".concat(e,"/events")),eS=()=>O("/telemetry/mcp-compliance"),eC=(e,s)=>O("/registry/plugins".concat(e?"?search=".concat(encodeURIComponent(e)).concat(s?"&tag=".concat(s):""):s?"?tag=".concat(s):"")),eR=e=>O("/registry/plugins/effectiveness".concat(e?"?rootPath=".concat(encodeURIComponent(e)):""));function eT(){return(0,D.a)({queryKey:["workflows"],queryFn:()=>W()})}function eP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;return(0,D.a)({queryKey:["sessions",e,s,t],queryFn:()=>ex(e,s,t)})}function eF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["telemetry-stats",e],queryFn:()=>ev(e)})}function eq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["roi-summary",e],queryFn:()=>ep(e)})}let eK={properties:"detail.properties",imports:"detail.imports",history:"detail.history"};function eD(){let{t:e}=(0,F.$G)(),s=x(e=>e.selectedNodeId),t=x(e=>e.detailTab),l=x(e=>e.setDetailTab),{data:n}=(0,D.a)({queryKey:["graph"],queryFn:()=>J()}),a=null==n?void 0:n.nodes.find(e=>e.id===s);return s?(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex border-b border-border",children:Object.keys(eK).map(s=>(0,r.jsx)("button",{onClick:()=>l(s),className:p("flex-1 py-2 text-xs font-medium capitalize",t===s?"border-b-2 border-primary text-primary":"text-muted-foreground"),children:e(eK[s])},s))}),(0,r.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:a?(0,r.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.name"),":"]})," ",a.name]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.type"),":"]})," ",(0,r.jsx)("span",{className:"capitalize",children:a.type})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.file"),":"]})," ",(0,r.jsx)("span",{className:"font-mono text-xs",children:a.file})]})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("detail.notFound")})})]}):(0,r.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:e("detail.selectNode")})}let eL=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:p("rounded-lg border border-border bg-card text-card-foreground",t),...l})});eL.displayName="Card";let eI=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:p("flex flex-col space-y-1.5 p-4",t),...l})});eI.displayName="CardHeader";let eZ=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("h3",{ref:s,className:p("text-sm font-semibold leading-none tracking-tight",t),...l})});eZ.displayName="CardTitle";let eE=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:p("p-4 pt-0",t),...l})});function e_(e){let{className:s,...t}=e;return(0,r.jsx)("div",{className:p("animate-pulse rounded-md bg-muted",s),...t})}eE.displayName="CardContent";var eO=t(79419),eA=t(88623),eM=t(10269),ez=t(3271),eQ=t(10977),eG=t(40384),eU=t(90743),eV=t(96631),e$=t(91684),eH=t(77329);function eJ(e){let{icon:s,label:t,value:l}=e;return(0,r.jsx)(eL,{children:(0,r.jsxs)(eE,{className:"p-4 flex items-center gap-3",children:[(0,r.jsx)("div",{className:"text-primary",children:s}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:t}),(0,r.jsx)("div",{className:"font-bold text-lg",children:l})]})]})})}let eB=a.forwardRef((e,s)=>{let{className:t,type:l,...n}=e;return(0,r.jsx)("input",{type:l,className:p("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...n})});eB.displayName="Input";var eW=t(49289);let eX=(0,eW.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),eY=a.forwardRef((e,s)=>{let{className:t,variant:l,size:n,...a}=e;return(0,r.jsx)("button",{className:p(eX({variant:l,size:n,className:t})),ref:s,...a})});eY.displayName="Button";var e0=t(15134);t(23867);var e2=t(86332),e1=t.n(e2),e4=t(26598);let e5={component:"C",hook:"H",api:"A",store:"S",function:"F",class:"CL",interface:"I",enum:"E",type:"T",variable:"V",unknown:"?"},e3={graphNode:function(e){var s,t,l,n,a;let{data:i}=e,d=null!==(n=null!==(l=e5[i.nodeType])&&void 0!==l?l:null===(t=i.nodeType)||void 0===t?void 0:null===(s=t.charAt(0))||void 0===s?void 0:s.toUpperCase())&&void 0!==n?n:"?",o=null!==(a=i.layerColor)&&void 0!==a?a:"#6b7280",c=void 0!==i.highlighted,m=!0===i.highlighted;return(0,r.jsxs)("div",{className:"px-3 py-2 rounded-lg border-2 text-xs font-medium transition-opacity duration-200",style:{borderColor:o,backgroundColor:"color-mix(in srgb, ".concat(o," 8%, var(--background, #fff))"),boxShadow:m?"0 0 12px ".concat(o,", 0 0 4px ").concat(o):"0 1px 3px rgba(0,0,0,0.12)",opacity:c&&!m?.15:1},children:[(0,r.jsx)(e0.HH,{type:"target",position:e4.Ly.Top,style:{background:o}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded text-[10px] font-bold text-white flex-shrink-0",style:{backgroundColor:o},children:d}),(0,r.jsx)("span",{className:"truncate max-w-[140px]",children:i.label})]}),(0,r.jsx)(e0.HH,{type:"source",position:e4.Ly.Bottom,style:{background:o}})]})}};function e6(e){let{filterMode:s="highlight",searchQuery:t=""}=e;return(0,r.jsx)(e0.tV,{children:(0,r.jsx)(e7,{filterMode:s,searchQuery:t})})}function e7(e){let{filterMode:s,searchQuery:t}=e,{data:l}=(0,D.a)({queryKey:["layered-graph"],queryFn:()=>B()}),n=x(e=>e.selectNode),{fitView:i}=(0,e0._K)(),d=(0,a.useMemo)(()=>{if(!l)return{nodes:[],edges:[]};let e=(null!=t?t:"").toLowerCase().trim(),n="filter"===s&&e?l.nodes.filter(s=>s.name.toLowerCase().includes(e)):l.nodes.slice(0,300),r=e.length>0,a=n.map(s=>{var t,l;return{id:s.id,type:"graphNode",position:{x:0,y:0},data:{label:s.name,nodeType:s.type,layer:null!==(t=s.layer)&&void 0!==t?t:"Other",layerColor:null!==(l=s.layerColor)&&void 0!==l?l:"#6b7280",highlighted:r?s.name.toLowerCase().includes(e):void 0}}}),i=new Set(a.map(e=>e.id));return function(e,s){let t=new(e1()).graphlib.Graph;for(let s of(t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"TB",ranksep:80,nodesep:60}),e))t.setNode(s.id,{width:180,height:50});for(let e of s)t.setEdge(e.source,e.target);return e1().layout(t),{nodes:e.map(e=>{let s=t.node(e.id);return{...e,position:{x:s.x-90,y:s.y-25}}}),edges:s}}(a,l.edges.filter(e=>i.has(e.from)&&i.has(e.to)).slice(0,500).map((e,s)=>({id:"".concat(e.from,"->").concat(e.to,"-").concat(s),source:e.from,target:e.to,animated:!1,style:{stroke:"#4b5563"}})))},[l,t,s]),[o,c,m]=(0,e0.Rr)(d.nodes),[u,h,v]=(0,e0.ll)(d.edges);(0,a.useEffect)(()=>{c(d.nodes),h(d.edges)},[d,c,h]),(0,a.useEffect)(()=>{if(t){let e=d.nodes.find(e=>!0===e.data.highlighted);e&&setTimeout(()=>{i({nodes:[e],duration:500,maxZoom:1.5})},100)}},[t,d.nodes,i]);let p=(0,a.useCallback)((e,s)=>{n(s.id)},[n]);return(0,r.jsxs)(e0.x$,{nodes:o,edges:u,onNodesChange:m,onEdgesChange:v,onNodeClick:p,nodeTypes:e3,fitView:!0,children:[(0,r.jsx)(e0.Aq,{}),(0,r.jsx)(e0.ZX,{}),(0,r.jsx)(e0.a9,{nodeColor:e=>{var s;let t=null===(s=e.data)||void 0===s?void 0:s.layerColor;return null!=t?t:"#6b7280"}})]})}var e8=t(95731),e9=t(38333),se=t(57124),ss=t(36673),st=t(20054),sl=t(87354),sn=t(5025),sr=t(49767),sa=t(6315),si=t(10997),sd=t(57431);let so=sd.fC;sd.xz;let sc=sd.h_;function sm(e){let{className:s,...t}=e;return(0,r.jsx)(sd.aV,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ".concat(null!=s?s:""),...t})}function sx(e){let{className:s,children:t,...l}=e;return(0,r.jsxs)(sc,{children:[(0,r.jsx)(sm,{}),(0,r.jsx)(sd.VY,{className:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg ".concat(null!=s?s:""),...l,children:t})]})}function su(e){let{className:s,...t}=e;return(0,r.jsx)("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left ".concat(null!=s?s:""),...t})}function sh(e){let{className:s,...t}=e;return(0,r.jsx)(sd.Dx,{className:"text-lg font-semibold leading-none tracking-tight ".concat(null!=s?s:""),...t})}sd.x8;let sv=["semantic","procedural","episodic","failure_lesson"];function sp(e){var s,t,l;let{open:n,onOpenChange:i,mode:d,defaultValues:o}=e,{t:c}=(0,F.$G)(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>es(e),onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),x=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>{let{id:s,updates:t}=e;return et(s,t)},onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),[u,h]=(0,a.useState)(null!==(s=null==o?void 0:o.category)&&void 0!==s?s:"semantic"),[v,p]=(0,a.useState)(null!==(t=null==o?void 0:o.content)&&void 0!==t?t:""),[j,f]=(0,a.useState)(null!==(l=null==o?void 0:o.scope)&&void 0!==l?l:"");(0,a.useEffect)(()=>{if(n){var e,s,t;h(null!==(e=null==o?void 0:o.category)&&void 0!==e?e:"semantic"),p(null!==(s=null==o?void 0:o.content)&&void 0!==s?s:""),f(null!==(t=null==o?void 0:o.scope)&&void 0!==t?t:"")}},[n,o]);let g=e=>{let s="memory.category.".concat(e),t=c(s);return t===s?e:t};return(0,r.jsx)(so,{open:n,onOpenChange:i,children:(0,r.jsxs)(sx,{children:[(0,r.jsx)(su,{children:(0,r.jsx)(sh,{children:"add"===d?c("memory.addMemory"):c("memory.editMemory")})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.categoryLabel")}),(0,r.jsx)("select",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm",value:u,onChange:e=>h(e.target.value),children:sv.map(e=>(0,r.jsx)("option",{value:e,children:g(e)},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.content")}),(0,r.jsx)("textarea",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm min-h-[100px]",value:v,onChange:e=>p(e.target.value)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.scope")}),(0,r.jsx)("input",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm",value:j,onChange:e=>f(e.target.value)})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(eY,{variant:"outline",onClick:()=>i(!1),children:c("memory.cancel")}),(0,r.jsx)(eY,{onClick:()=>{v.trim()&&("add"===d?m.mutate({category:u,content:v.trim(),scope:j.trim()||void 0}):(null==o?void 0:o.id)&&x.mutate({id:o.id,updates:{category:u,content:v.trim(),scope:j.trim()||void 0}}),i(!1))},disabled:!v.trim(),children:c("memory.save")})]})]})]})})}let sj=["all","failure_lesson","semantic","procedural","episodic"];var sf=t(4343);let sg=sf.fC,sy=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sf.aV,{ref:s,className:p("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...l})});sy.displayName=sf.aV.displayName;let sN=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sf.xz,{ref:s,className:p("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...l})});sN.displayName=sf.xz.displayName;let sb=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sf.VY,{ref:s,className:p("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...l})});sb.displayName=sf.VY.displayName;var sw=t(74497),sk=t(12439);function sS(){var e,s,t;let{t:l}=(0,F.$G)(),{data:n,isLoading:a,error:i}=eq(7);if(a)return(0,r.jsx)("div",{children:l("benchmark.loading")});if(i||!(null==n?void 0:n.overview))return(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:l("benchmark.opsSummary")})}),(0,r.jsx)(eE,{children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:i?l("benchmark.loadFailed",{error:String(i)}):l("benchmark.noOpsData")})})]});let d=n.overview;return(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:l("benchmark.opsSummary")})}),(0,r.jsx)(eE,{className:"space-y-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.totalRunsCount")}),(0,r.jsx)("p",{className:"text-2xl font-bold",children:null!==(e=null==d?void 0:d.totalRuns)&&void 0!==e?e:0})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.successRatePercent")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[(null!==(s=null==d?void 0:d.firstPassSuccessRate)&&void 0!==s?s:0).toFixed(1),"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.avgDurationTime")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[((null!==(t=null==d?void 0:d.avgDuration)&&void 0!==t?t:0)/1e3).toFixed(1),"s"]})]})]})})]})}let sC=(0,eW.j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function sR(e){let{className:s,variant:t,...l}=e;return(0,r.jsx)("div",{className:p(sC({variant:t}),s),...l})}function sT(){var e;let{t:s}=(0,F.$G)(),{data:t=[],isLoading:l,error:n}=(e=localStorage.getItem("devflow-active-project-root")||void 0,(0,D.a)({queryKey:["plugin-effectiveness",e],queryFn:()=>eR(e)}));if(l)return(0,r.jsx)("div",{children:s("benchmark.loading")});if(n)return(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:s("benchmark.pluginAnalysis")})}),(0,r.jsx)(eE,{children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("benchmark.loadFailed",{error:String(n)})})})]});let a=t.filter(e=>"install"===e.recommendation),i=t.filter(e=>"remove"===e.recommendation);return(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:s("benchmark.pluginAnalysis")})}),(0,r.jsxs)(eE,{className:"space-y-6",children:[a.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold mb-2 text-green-600",children:s("benchmark.recommendedInstall")}),(0,r.jsx)("div",{className:"space-y-2",children:a.map(e=>{var t,l,n;return(0,r.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsx)(sR,{variant:"default",children:s("benchmark.recommended")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[s("benchmark.installCount"),": ",e.installCount]}),(0,r.jsxs)("div",{children:[s("benchmark.usageRate"),": ",((null!==(t=null==e?void 0:e.activeRate)&&void 0!==t?t:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.successRateShort"),": ",((null!==(l=null==e?void 0:e.successRate)&&void 0!==l?l:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.tokenImpact"),": ",(null!==(n=null==e?void 0:e.avgTokenImpact)&&void 0!==n?n:0).toFixed(0)]})]}),e.lastUsedAt&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s("benchmark.lastUsed"),": ",new Date(e.lastUsedAt).toLocaleDateString()]})]},e.name)})})]}),i.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold mb-2 text-red-600",children:s("benchmark.suggestedRemove")}),(0,r.jsx)("div",{className:"space-y-2",children:i.map(e=>{var t,l;return(0,r.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsx)(sR,{variant:"destructive",children:s("benchmark.lowEfficiency")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[s("benchmark.installCount"),": ",e.installCount]}),(0,r.jsxs)("div",{children:[s("benchmark.usageRate"),": ",((null!==(t=null==e?void 0:e.activeRate)&&void 0!==t?t:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.successRateShort"),": ",((null!==(l=null==e?void 0:e.successRate)&&void 0!==l?l:0)*100).toFixed(0),"%"]})]})]},e.name)})})]}),0===t.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("benchmark.noPluginData")})]})]})}let sP=[7,14,30];function sF(e){let{label:s,value:t}=e;return(0,r.jsxs)("div",{className:"p-3 rounded-md bg-secondary/50",children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:s}),(0,r.jsx)("div",{className:"text-lg font-bold",children:t})]})}function sq(e){let{steps:s,events:t}=e,{t:l}=(0,F.$G)();return(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground mb-2",children:l("events.steps")}),s.map(e=>{let s=t.filter(s=>s.stepId===e),n=s.reduce((e,s)=>{var t;return e+(null!==(t=s.duration)&&void 0!==t?t:0)},0);return(0,r.jsxs)("div",{className:"text-xs py-1 px-2 rounded hover:bg-accent cursor-pointer",children:[(0,r.jsx)("div",{className:"font-medium truncate",children:e}),(0,r.jsxs)("div",{className:"text-muted-foreground",children:[s.length," ",l("events.eventCount")," \xb7 ",n,"ms"]})]},e)})]})}let sK={llm_call:"text-blue-500",tool_use:"text-green-500",memory_read:"text-pink-500",memory_write:"text-pink-500",file_read:"text-gray-500",file_write:"text-yellow-500",bash_command:"text-purple-500",subagent:"text-orange-500",skill_invoke:"text-cyan-500",mcp_tool_call:"text-indigo-500",error:"text-red-500",user_input:"text-orange-500",step_start:"text-cyan-500",step_end:"text-cyan-500"},sD={llm_call:"events.llmCall",tool_use:"events.toolUse",memory_read:"events.memoryRead",memory_write:"events.memoryWrite",file_read:"events.fileRead",file_write:"events.fileWrite",bash_command:"events.bashCommand",subagent:"events.subagent",skill_invoke:"events.skillInvoke",mcp_tool_call:"events.mcpToolCall",error:"events.error",user_input:"events.userInput",step_start:"events.stepStart",step_end:"events.stepEnd"};function sL(e){let{events:s,onSelect:t,selectedId:l}=e,{t:n}=(0,F.$G)(),a=[...s].sort((e,s)=>e.timestamp-s.timestamp);if(0===a.length)return(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:n("events.empty")});let i="";return(0,r.jsx)("div",{className:"space-y-0",children:a.map(e=>{var s,a,d,o,c,m,x,u;let h=e.stepId!==i;i=e.stepId;let v=null!==(u=sK[e.kind])&&void 0!==u?u:"text-muted-foreground",p=sD[e.kind],j=p?n(p):e.kind,f=(null===(s=e.data)||void 0===s?void 0:s.toolName)||(null===(a=e.data)||void 0===a?void 0:a.filePath)||(null===(d=e.data)||void 0===d?void 0:d.model)||(null===(o=e.data)||void 0===o?void 0:o.command)||(null===(c=e.data)||void 0===c?void 0:c.memoryKey)||"";return(0,r.jsxs)("div",{children:[h&&(0,r.jsx)("div",{className:"text-xs font-semibold text-muted-foreground pt-2 pb-1 border-t border-border mt-1",children:e.stepId}),(0,r.jsxs)("div",{onClick:()=>t(e),className:"flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer text-xs hover:bg-accent ".concat(l===e.id?"bg-accent":""," ").concat((null===(m=e.metadata)||void 0===m?void 0:m.blocked)?"border-l-2 border-red-500 bg-red-50 dark:bg-red-950":""),children:[(null===(x=e.metadata)||void 0===x?void 0:x.blocked)&&(0,r.jsx)("span",{className:"text-red-500 font-bold text-[10px] uppercase tracking-wider",children:"BLOCKED"}),(0,r.jsx)("span",{className:"w-16 ".concat(v," font-medium"),children:j}),(0,r.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:f}),e.duration?(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e.duration,"ms"]}):null]})]},e.id)})})}function sI(e){let{event:s}=e,[t,l]=(0,a.useState)(!1),n=s.input?JSON.stringify(s.input,null,2):"null",i=s.output?JSON.stringify(s.output,null,2):"null";return(0,r.jsxs)("div",{className:"space-y-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-lg",children:s.mcpToolName||s.toolName}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s.toolType," \xb7 ",s.kind," \xb7 ",s.duration,"ms",s.blocked&&(0,r.jsx)("span",{className:"text-red-500 ml-2 font-bold",children:"BLOCKED"})]})]}),(0,r.jsx)("button",{onClick:()=>l(!t),className:"text-xs border rounded px-2 py-1 hover:bg-accent",children:t?"Formatted":"Raw JSON"})]}),s.error&&(0,r.jsx)("div",{className:"p-3 bg-red-50 dark:bg-red-950 border border-red-300 rounded text-sm text-red-700",children:s.error}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,r.jsxs)(eL,{className:"p-3",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Input"}),(0,r.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(t?"":"max-h-40 overflow-hidden"),children:(0,r.jsx)("code",{children:t?n:n.slice(0,500)+(n.length>500?"\n... (truncated)":"")})})]}),(0,r.jsxs)(eL,{className:"p-3",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Output"}),null==s.output?(0,r.jsx)("p",{className:"text-xs text-yellow-600",children:"No output captured for this event"}):(0,r.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(t?"":"max-h-40 overflow-hidden"),children:(0,r.jsx)("code",{children:t?i:i.slice(0,500)+(i.length>500?"\n... (truncated)":"")})})]})]})]})}function sZ(e){var s,t;let{event:l}=e,{t:n}=(0,F.$G)();if(!l)return(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:n("events.selectEvent")});if("tool_use"===l.kind&&(l.toolName||l.mcpToolName))return(0,r.jsx)(sI,{event:l});let a=null!==(t=l.data)&&void 0!==t?t:{};return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:n("events.eventDetail")}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.kind")}),(0,r.jsx)("div",{className:"text-sm font-medium",children:l.kind})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.step")}),(0,r.jsx)("div",{className:"text-sm font-mono",children:l.stepId})]}),null!=l.duration&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.duration")}),(0,r.jsxs)("div",{className:"text-sm",children:[l.duration,"ms"]})]}),null!=a.inputTokens&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.tokens")}),(0,r.jsx)("div",{className:"text-sm",children:n("events.tokensInOut",{input:a.inputTokens,output:a.outputTokens})})]}),null!=a.prompt&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.prompt")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.prompt})]}),null!=a.response&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.response")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.response})]}),null!=a.stdout&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.stdout")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.stdout})]}),null!=a.stderr&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.stderr")}),(0,r.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.stderr})]}),null!=a.errorMessage&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.error")}),(0,r.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.errorMessage})]}),(null===(s=l.metadata)||void 0===s?void 0:s.truncated)!=null&&(0,r.jsx)("div",{className:"text-xs text-yellow-500",children:n("events.truncated")})]})]})}var sE=t(61883);function s_(e){let{runId:s,onBack:t}=e,{t:l}=(0,F.$G)(),{data:n}=(0,D.a)({queryKey:["session-events",s],queryFn:()=>eh(s),enabled:!!s}),{data:i}=(0,D.a)({queryKey:["session",s],queryFn:()=>eu(s),enabled:!!s}),[d,o]=(0,a.useState)(null),c=(null!=n?n:[]).map(e=>{var s,t,l,n,r,a,i;let d=null!==(t=null!==(s=e.eventId)&&void 0!==s?s:e.id)&&void 0!==t?t:"",o=(null!==(l=e.kind)&&void 0!==l?l:e.toolType)||"tool_use",c={toolName:null!==(n=e.toolName)&&void 0!==n?n:e.mcpToolName,...null!==(r=e.input)&&void 0!==r?r:{}};return{id:d,stepId:null!==(a=e.executionId)&&void 0!==a?a:d,kind:o,timestamp:null!==(i=e.timestamp)&&void 0!==i?i:0,duration:e.duration,data:c,metadata:{isMcpTool:e.isMcpTool,mcpEnforced:e.mcpEnforced,mcpFallback:e.mcpFallback,blocked:e.blocked,blockReason:e.blockReason}}}),m=[...new Set(c.map(e=>e.stepId))],x=null!=i?i:{};return(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,r.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sE.Z,{className:"h-4 w-4"})}),(0,r.jsx)("h2",{className:"text-lg font-bold",children:l("runDetail.title","Session Detail")}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:s}),null!=x.totalToolCalls&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[String(x.totalToolCalls)," tools \xb7 ",String(x.mcpToolCalls)," MCP"]})]}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,r.jsx)("div",{className:"w-48 border-r border-border overflow-y-auto p-3",children:(0,r.jsx)(sq,{steps:m,events:c})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:(0,r.jsx)(sL,{events:c,onSelect:e=>o(e),selectedId:null==d?void 0:d.id})}),(0,r.jsx)("div",{className:"w-80 border-l border-border overflow-y-auto p-3",children:(0,r.jsx)(sZ,{event:d})})]})]})}let sO={active:"text-yellow-500",closed:"text-green-500"},sA={cli:"#3b82f6",mcp:"#22c55e",dashboard:"#a855f7"};function sM(e){let{runs:s,date:t}=e,l=new Date(t+"T00:00:00Z").getTime(),n=Math.max(28*s.length+40,120),a=[0,4,8,12,16,20,24].map(e=>({hour:e,x:40+e/24*720,label:"".concat(String(e).padStart(2,"0"),":00")}));return(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("svg",{viewBox:"0 0 ".concat(800," ").concat(n),className:"w-full",children:[a.map(e=>(0,r.jsxs)("g",{children:[(0,r.jsx)("line",{x1:e.x,y1:0,x2:e.x,y2:n,stroke:"#e5e7eb",strokeWidth:.5}),(0,r.jsx)("text",{x:e.x,y:12,textAnchor:"middle",fontSize:"9",fill:"#9ca3af",children:e.label})]},e.hour)),s.map((e,s)=>{var t;let n=40+(e.startedAt-l)/864e5*720,a=Math.max(40,40*(e.totalToolCalls||1)),i=40+28*s,d=null!==(t=sA[e.source])&&void 0!==t?t:"#6b7280",o="completed"===e.status?.9:"failed"===e.status?.6:.4;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:n,y:i,width:a,height:20,rx:3,fill:d,opacity:o}),(0,r.jsx)("text",{x:n+a+4,y:i+13,fontSize:"10",fill:"#6b7280",children:new Date(e.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),a>60&&(0,r.jsxs)("text",{x:n+4,y:i+13,fontSize:"9",fill:"white",fontWeight:"500",children:[e.agent," \xb7 ",e.source]})]},e.id)})]})})}var sz=t(58410),sQ=t(2966),sG=t(97066),sU=t(53512);function sV(e){let{rate:s}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-20 h-2 bg-muted rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full ".concat(s>=80?"bg-green-500":s>=50?"bg-yellow-500":"bg-red-500"," rounded-full"),style:{width:"".concat(s,"%")}})}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.toFixed(1),"%"]})]})}let s$={overview:function(){var e;let{t:s}=(0,F.$G)(),{data:t}=(0,D.a)({queryKey:["active-project"],queryFn:()=>Q()}),l=x(e=>e.projectRoot),n=x(e=>e.setProjectRoot),i=x(e=>e.activeProjectRoot),d=x(e=>e.setActiveProjectRoot),[o,c]=(0,a.useState)(""),[m,u]=(0,a.useState)(""),[h,v]=(0,a.useState)(!1),p=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>M(e),onSuccess:()=>e.invalidateQueries({queryKey:["active-project"]})})}(),j=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:()=>z(),onSuccess:()=>e.invalidateQueries({queryKey:["active-project"]})})}();(0,a.useEffect)(()=>{(null==t?void 0:t.rootPath)&&t.rootPath!==i&&(n(t.rootPath),d(t.rootPath))},[t,n,d,i]);let[f,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{f||(null==t?void 0:t.rootPath)||!i||p.isPending||(g(!0),p.mutate(i))},[null==t?void 0:t.rootPath,i,p.isPending,f]);let{data:y}=(0,D.a)({queryKey:["projects"],queryFn:()=>A()}),{data:N}=(0,D.a)({queryKey:["context-status"],queryFn:()=>U()}),{data:b}=eT(),{data:w}=eP(10,0),{data:k,isLoading:S}=(0,D.a)({queryKey:["onboarding-pack",i],queryFn:()=>G(i),enabled:!!i}),C=null==y?void 0:y.find(e=>e.rootPath===i),R=()=>{if((null==C?void 0:C.stack)&&C.stack.length>0)return C.stack;if(null==k?void 0:k.stack){let e=[...k.stack.languages,...k.stack.frameworks,...k.stack.buildTools,...k.stack.testTools];if(e.length>0)return e}return[]},T=()=>{o.trim()&&p.mutate(o.trim(),{onSuccess:e=>{n(e.rootPath),d(e.rootPath)}})},P=()=>{m.trim()&&p.mutate(m.trim(),{onSuccess:e=>{n(e.rootPath),d(e.rootPath),v(!1),u("")}})};return l?(0,r.jsxs)("div",{className:"p-6 space-y-6 overflow-y-auto h-full",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:s("overview.title")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-1 rounded font-mono",children:l}),(0,r.jsx)("button",{onClick:()=>v(!h),className:"p-1 rounded hover:bg-secondary text-muted-foreground",title:s("overview.switchProject"),children:(0,r.jsx)(eA.Z,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{j.mutate(void 0,{onSuccess:()=>{n(null),d(null)}})},className:"p-1 rounded hover:bg-secondary text-muted-foreground",title:s("overview.disconnectProject"),children:(0,r.jsx)(eM.Z,{className:"h-4 w-4"})})]})]}),h&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-card",children:[(0,r.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&P(),"Escape"===e.key&&(v(!1),u(""))},placeholder:s("overview.switchProjectPlaceholder"),className:"flex-1 px-3 py-1.5 rounded-md border border-border bg-background text-sm"}),(0,r.jsx)("button",{onClick:P,disabled:p.isPending||!m.trim(),className:"px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm disabled:opacity-50",children:p.isPending?s("overview.connecting"):s("overview.switchProjectConfirm")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(eJ,{icon:(0,r.jsx)(ez.Z,{className:"h-5 w-5"}),label:s("overview.project"),value:(null==C?void 0:C.name)?C.name:(null==k?void 0:k.projectName)?k.projectName:i&&null!==(e=i.split("/").pop())&&void 0!==e?e:"Unknown Project"}),(0,r.jsx)(eJ,{icon:(0,r.jsx)(eQ.Z,{className:"h-5 w-5"}),label:s("overview.filesIndexed"),value:N?String(N.totalFiles):"--"}),(0,r.jsx)(eJ,{icon:(0,r.jsx)(eG.Z,{className:"h-5 w-5"}),label:s("overview.workflows"),value:b?String(b.length):"--"}),(0,r.jsx)(eJ,{icon:(0,r.jsx)(eU.Z,{className:"h-5 w-5"}),label:s("overview.agentRuns"),value:w?String(w.length):"--"})]}),R().length>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:s("overview.techStack")})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:R().map(e=>(0,r.jsx)("span",{className:"px-2 py-1 rounded-md bg-secondary text-secondary-foreground text-xs",children:e},e))})})]}),S?(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eV.Z,{className:"h-4 w-4"}),s("onboarding.title")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)(e_,{className:"h-32 w-full"})})]}):k?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eV.Z,{className:"h-4 w-4"}),s("overview.architectureLayers")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.architectureLayers.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-0.5 rounded",children:s("overview.filesCount",{count:e.files})})]},e.name))})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(e$.Z,{className:"h-4 w-4"}),s("overview.keyModules")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.keyModules.slice(0,6).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-mono text-primary",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e.reason})]},e.name))})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eQ.Z,{className:"h-4 w-4"}),s("overview.keyFiles")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.keyFiles.slice(0,6).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-mono truncate",children:e.path}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e.reason})]},e.path))})})]})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eH.Z,{className:"h-4 w-4"}),s("overview.recommended")]})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.plugins")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:k.recommendedPlugins.map(e=>(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-green-100 text-green-800 text-xs",children:e},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.workflows")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:k.recommendedWorkflows.map(e=>(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-blue-100 text-blue-800 text-xs",children:e},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.queries")}),(0,r.jsx)("div",{className:"space-y-1",children:k.recommendedQueries.slice(0,3).map(e=>(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:['"',e,'"']},e))})]})]})})]})]}):(0,r.jsx)(eL,{children:(0,r.jsx)(eE,{className:"py-8 text-center text-muted-foreground",children:s("onboarding.empty")})}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:s("overview.recentRuns")})}),(0,r.jsx)(eE,{children:w&&w.length>0?(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:s("overview.label")}),(0,r.jsx)("th",{children:s("overview.status")}),(0,r.jsx)("th",{children:s("overview.toolCalls")}),(0,r.jsx)("th",{children:s("overview.duration")})]})}),(0,r.jsx)("tbody",{children:w.slice(0,5).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1",children:e.label||e.projectRoot}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat("closed"===e.status?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"),children:e.status})}),(0,r.jsxs)("td",{children:[e.totalToolCalls," (",e.mcpToolCalls," MCP)"]}),(0,r.jsx)("td",{children:e.durationMs>0?"".concat((e.durationMs/1e3).toFixed(1),"s"):"--"})]},e.id))})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:s("overview.noRuns")})})]})]}):(0,r.jsx)("div",{className:"p-6 flex items-center justify-center h-full",children:(0,r.jsxs)(eL,{className:"w-full max-w-md",children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eO.Z,{className:"h-5 w-5"}),s("overview.connectTitle")]})}),(0,r.jsxs)(eE,{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("overview.connectDescription")}),(0,r.jsx)("input",{type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&T(),placeholder:s("overview.connectPlaceholder"),className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm"}),(0,r.jsx)("button",{onClick:T,disabled:p.isPending||!o.trim(),className:"w-full px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-50",children:p.isPending?s("overview.connecting"):s("overview.connect")}),p.isError&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:s("overview.connectError")})]})]})})},graph:function(){let{t:e}=(0,F.$G)(),s=x(e=>e.searchQuery),t=x(e=>e.setSearchQuery),[l,n]=(0,a.useState)("highlight");return(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)("div",{className:"p-3 border-b border-border flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1 max-w-sm",children:[(0,r.jsx)(e8.Z,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,r.jsx)(eB,{placeholder:e("graph.searchPlaceholder"),value:s,onChange:e=>t(e.target.value),className:"pl-8"})]}),s&&(0,r.jsx)(eY,{variant:"ghost",size:"sm",onClick:()=>n(e=>"highlight"===e?"filter":"highlight"),title:e("highlight"===l?"graph.filterOnly":"graph.highlightAll"),className:"flex-shrink-0",children:"highlight"===l?(0,r.jsx)(e9.Z,{className:"h-4 w-4"}):(0,r.jsx)(se.Z,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(e6,{filterMode:l,searchQuery:s})})]})},context:function(){let{t:e}=(0,F.$G)(),[s,t]=(0,a.useState)(""),[l,n]=(0,a.useState)(!1),[i,d]=(0,a.useState)({}),o=x(e=>e.activeProjectRoot),c=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>V(e),onSuccess:s=>e.setQueryData(["context-result"],s)})}(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>$(e),onSuccess:s=>e.setQueryData(["task-context-result"],s)})}(),{data:u}=(0,D.a)({queryKey:["context-result"],queryFn:()=>Promise.reject(Error("No queryFn — this query is never enabled")),enabled:!1}),{data:h}=(0,D.a)({queryKey:["task-context-result"],queryFn:()=>Promise.reject(Error("No queryFn — this query is never enabled")),enabled:!1}),v=(0,I.D)({mutationFn:e=>H(e)}),p=l?h:u,j=l?m.isPending:c.isPending,f=()=>{s.trim()&&(d({}),l?m.mutate({query:s,mode:"fast"}):c.mutate({query:s,mode:"fast"}))},g=e=>{s.trim()&&(d({[s]:e}),v.mutate({query:s,feedback:e,projectRoot:null!=o?o:void 0,taskType:l&&h?h.taskType:void 0,contextMode:l?"task":"general",tokenCount:null==p?void 0:p.tokenCount}))};return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("context.title")}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("input",{type:"checkbox",checked:l,onChange:e=>n(e.target.checked),className:"rounded"}),e("context.taskMode")]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(eB,{placeholder:e("context.placeholder"),value:s,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&f()}),(0,r.jsxs)(eY,{onClick:f,disabled:j,children:[(0,r.jsx)(e8.Z,{className:"h-4 w-4 mr-1"})," ",e("context.build")]})]}),j&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("context.building")}),p&&(0,r.jsxs)(r.Fragment,{children:[!l&&u&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:e("context.results",{files:u.files.length,tokens:u.tokenCount})})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-3",children:u.files.map((e,s)=>(0,r.jsxs)("div",{className:"p-3 rounded-md bg-secondary/50",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.path}),(0,r.jsx)("pre",{className:"text-xs mt-1 overflow-x-auto whitespace-pre-wrap",children:e.snippet})]},s))})})]}),l&&h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eL,{children:(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{children:[e("context.taskContext"),": ",h.taskType]}),(0,r.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:e("context.confidenceTokens",{confidence:(100*h.confidence).toFixed(0),tokens:h.tokenCount})})]})})}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(ss.Z,{className:"h-4 w-4"}),e("context.requiredFiles")," (",h.requiredFiles.files.length,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-1",children:h.requiredFiles.files.map(e=>(0,r.jsxs)("div",{className:"text-sm font-mono text-green-700 dark:text-green-400",children:["● ",e]},e))})})]}),h.optionalFiles.files.length>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(ss.Z,{className:"h-4 w-4"}),e("context.optionalFiles")," (",h.optionalFiles.files.length,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-1",children:h.optionalFiles.files.map(e=>(0,r.jsxs)("div",{className:"text-sm font-mono text-muted-foreground",children:["○ ",e]},e))})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{children:[e("context.keySymbols")," (",h.keySymbols.length,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.keySymbols.slice(0,10).map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded ".concat("direct"===s.relevance?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"),children:"direct"===s.relevance?e("context.relevanceDirect"):e("context.relevanceIndirect")}),(0,r.jsx)("span",{className:"text-sm font-medium",children:s.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",s.kind,")"]}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono ml-auto",children:s.file})]},"".concat(s.file,":").concat(s.name)))})})]}),h.riskHints.length>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(st.Z,{className:"h-4 w-4"}),e("context.riskHints")," (",h.riskHints.length,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.riskHints.map((s,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ".concat("high"===s.level?"bg-red-100 text-red-700":"medium"===s.level?"bg-yellow-100 text-yellow-700":"bg-gray-100 text-gray-600"),children:"high"===s.level?e("context.levelHigh"):"medium"===s.level?e("context.levelMedium"):e("context.levelLow")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:s.category}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:s.description})]})]},t))})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eH.Z,{className:"h-4 w-4"}),e("context.nextActions")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.nextActions.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 text-xs",children:e.kind}),(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:e.payload})]},s))})})]})]}),p&&(0,r.jsx)(eL,{children:(0,r.jsx)(eE,{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-sm text-muted-foreground mr-2",children:e("context.wasHelpful")}),(0,r.jsxs)(eY,{size:"sm",variant:"hit"===i[s]?"default":"outline",onClick:()=>g("hit"),disabled:v.isPending,children:[(0,r.jsx)(sl.Z,{className:"h-3 w-3 mr-1"})," ",e("context.hit")]}),(0,r.jsxs)(eY,{size:"sm",variant:"partial"===i[s]?"default":"outline",onClick:()=>g("partial"),disabled:v.isPending,children:[(0,r.jsx)(sn.Z,{className:"h-3 w-3 mr-1"})," ",e("context.partial")]}),(0,r.jsxs)(eY,{size:"sm",variant:"miss"===i[s]?"default":"outline",onClick:()=>g("miss"),disabled:v.isPending,children:[(0,r.jsx)(eM.Z,{className:"h-3 w-3 mr-1"})," ",e("context.miss")]}),v.isSuccess&&(0,r.jsx)("span",{className:"text-xs text-green-600 ml-2",children:e("context.thanks")})]})})})]})]})},workflows:function(){let{t:e}=(0,F.$G)(),{data:s}=eT(),{data:t}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,D.a)({queryKey:["workflow-runs",e,s],queryFn:()=>Y(e,s)})}(),l=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>{let{type:s,input:t}=e;return X(s,t)},onSuccess:()=>e.invalidateQueries({queryKey:["workflow-runs"]})})}(),[n,i]=(0,a.useState)(null),{events:d,clear:o}=function(e){let[s,t]=(0,a.useState)([]),l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var s;if(!e)return;let n=new EventSource("".concat(null!==(s=sr.env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==s?s:"http://localhost:13337","/api/workflows/runs/").concat(e,"/stream"));l.current=n;let r=e=>{try{t(s=>[...s,{type:e.type,data:JSON.parse(e.data)}])}catch(e){}};return n.addEventListener("step-started",r),n.addEventListener("step-completed",r),n.addEventListener("step-failed",r),n.addEventListener("error",()=>n.close()),()=>n.close()},[e]),{events:s,clear:(0,a.useCallback)(()=>t([]),[])}}(n);return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("workflows.title")}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:e("workflows.available")})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:(null!=s?s:[]).map(s=>(0,r.jsxs)(eY,{variant:"outline",size:"sm",onClick:()=>l.mutate({type:s.name},{onSuccess:e=>i(e.runId)}),children:[s.name," (",s.stepCount," ",e("workflows.steps"),")"]},s.name))})})]}),n&&d.length>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{children:[e("workflows.stream"),": ",n]})}),(0,r.jsxs)(eE,{children:[(0,r.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto font-mono text-xs",children:d.map((e,s)=>(0,r.jsxs)("div",{className:"text-muted-foreground",children:["[",e.type,"] ",JSON.stringify(e.data)]},s))}),(0,r.jsx)(eY,{variant:"ghost",size:"sm",onClick:()=>{i(null),o()},className:"mt-2",children:e("workflows.closeStream")})]})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:e("workflows.runHistory")})}),(0,r.jsx)(eE,{children:t&&t.length>0?(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:e("workflows.runId")}),(0,r.jsx)("th",{children:e("overview.status")}),(0,r.jsx)("th",{children:e("workflows.started")})]})}),(0,r.jsx)("tbody",{children:t.slice(0,10).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono text-xs",children:e.runId}),(0,r.jsx)("td",{children:e.status}),(0,r.jsx)("td",{children:new Date(e.startedAt).toLocaleTimeString()})]},e.runId))})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("workflows.noRuns")})})]})]})},memory:function(){var e,s,t,l,n,i;let{t:d}=(0,F.$G)(),{data:o}=(0,D.a)({queryKey:["memory"],queryFn:()=>ee()}),{data:c}=(0,D.a)({queryKey:["ollama-status"],queryFn:()=>ei(),refetchInterval:3e4}),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>en(e),onSuccess:()=>{e.invalidateQueries({queryKey:["memory"]}),e.invalidateQueries({queryKey:["memory-candidates"]})}})}(),x=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>er(e),onSuccess:()=>{e.invalidateQueries({queryKey:["memory"]}),e.invalidateQueries({queryKey:["memory-candidates"]})}})}(),u=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>el(e),onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),h=function(){let{t:e}=(0,F.$G)();return s=>{let t="memory.category.".concat(s),l=e(t);return l===t?s:l}}(),[v,p]=(0,a.useState)(""),{data:j}=(0,D.a)({queryKey:["memory-search",v,void 0],queryFn:()=>ea(v,null==i?void 0:i.limit,null==i?void 0:i.categories),enabled:v.length>0}),[f,g]=(0,a.useState)(!1),[y,N]=(0,a.useState)(),[b,w]=(0,a.useState)("all"),k=null!==(t=null==o?void 0:null===(e=o.memories)||void 0===e?void 0:e.filter(e=>"approved"===e.status))&&void 0!==t?t:[],S=null!==(l=null==o?void 0:null===(s=o.memories)||void 0===s?void 0:s.filter(e=>"pending"===e.status))&&void 0!==l?l:[],C="all"===b?k:k.filter(e=>e.category===b),R="all"===b?S:S.filter(e=>e.category===b),T=(0,a.useMemo)(()=>{let e=new Map;for(let t of R){var s;let l=null!==(s=e.get(t.category))&&void 0!==s?s:[];l.push(t),e.set(t.category,l)}return[...e.entries()].sort((e,s)=>{let[t]=e,[l]=s;return"failure_lesson"===t?-1:"failure_lesson"===l?1:t.localeCompare(l)})},[R]),P=v&&j?j:C,q=e=>{var s;N({id:e.id,category:e.category,content:e.content,scope:null!==(s=e.scope)&&void 0!==s?s:""}),g(!0)},K=e=>{window.confirm(d("memory.deleteConfirm"))&&u.mutate(e.id)};return o?(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:d("memory.title")}),(0,r.jsxs)(eY,{size:"sm",onClick:()=>{N(void 0),g(!0)},children:["+ ",d("memory.addMemory")]})]}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(eB,{placeholder:d("memory.searchPlaceholder"),value:v,onChange:e=>p(e.target.value)})}),!v&&(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:sj.map(e=>(0,r.jsx)(eY,{variant:b===e?"default":"outline",size:"sm",onClick:()=>w(e),children:"all"===e?d("memory.allCategories","All"):h(e)},e))}),c&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:d("memory.ollamaStatus")})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("div",{className:"text-sm space-y-1",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.installed"),":"]}),(0,r.jsx)("span",{className:c.installed?"text-green-500":"text-red-500",children:c.installed?d("memory.yes"):d("memory.no")})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.running"),":"]}),(0,r.jsx)("span",{className:c.running?"text-green-500":"text-red-500",children:c.running?d("memory.yes"):d("memory.no")})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.model")," (",c.modelName,"):"]}),(0,r.jsx)("span",{className:c.modelAvailable?"text-green-500":"text-yellow-500",children:c.modelAvailable?d("memory.available"):d("memory.notPulled")})]}),c.infoMessage&&(0,r.jsx)("p",{className:"text-yellow-500 text-xs mt-2",children:c.infoMessage})]})})]}),!v&&R.length>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{children:[d("memory.pendingApproval")," (",R.length,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-4",children:T.map(e=>{let[s,t]=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-2",children:h(s)}),(0,r.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,r.jsxs)("div",{className:"flex items-start justify-between p-2 rounded bg-secondary/50",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate",children:e.content}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d("memory.confidence"),": ",e.confidence]})]}),(0,r.jsxs)("div",{className:"flex gap-1 ml-2",children:[(0,r.jsx)(eY,{size:"sm",variant:"outline",onClick:()=>m.mutate(e.id),children:d("memory.approve")}),(0,r.jsx)(eY,{size:"sm",variant:"ghost",onClick:()=>x.mutate(e.id),children:d("memory.reject")})]})]},e.id))})]},s)})})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:v?"".concat(null!==(n=null==j?void 0:j.length)&&void 0!==n?n:0," results"):"".concat(d("memory.approvedMemories")," (").concat(C.length,")")})}),(0,r.jsx)(eE,{children:0===P.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg text-center",children:[(0,r.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:d("memory.noMemories")}),(0,r.jsx)("p",{className:"text-muted-foreground text-xs mt-1",children:d("memory.noMemoriesHint")})]}):(0,r.jsx)("div",{className:"space-y-2",children:P.map(e=>(0,r.jsxs)("div",{className:"p-2 rounded bg-secondary/50 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsx)("span",{className:"flex-1",children:e.content}),(0,r.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h(e.category)}),(0,r.jsx)(eY,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>q(e),title:d("memory.editMemory"),children:(0,r.jsx)(sa.Z,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(eY,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive",onClick:()=>K(e),title:d("memory.deleteMemory"),children:(0,r.jsx)(si.Z,{className:"h-3.5 w-3.5"})})]})]}),e.originalText&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:[d("memory.original"),": ",e.originalText]})]},e.id))})})]}),(0,r.jsx)(sp,{open:f,onOpenChange:g,mode:y?"edit":"add",defaultValues:y})]}):(0,r.jsx)("div",{className:"p-6 text-muted-foreground",children:d("memory.loading")})},benchmark:function(){var e,s,t,l,n,i,d,o,c,m,x,u,h,v,p,j,f,g,y,N,b,w,k,R,q;let{t:K}=(0,F.$G)(),[D,L]=(0,a.useState)(7),{data:I,isLoading:Z}=eq(D);return Z||!I?(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:K("benchmark.roiTitle")}),(0,r.jsx)("p",{className:"text-muted-foreground",children:Z?K("benchmark.loading"):K("benchmark.noData")})]}):(0,r.jsxs)("div",{className:"p-6 space-y-6 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:K("benchmark.roiTitle")}),(0,r.jsx)("div",{className:"flex gap-1",children:sP.map(e=>(0,r.jsxs)(eY,{size:"sm",variant:e===D?"default":"outline",onClick:()=>L(e),children:[e,"d"]},e))})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:K("benchmark.period",{from:I.period.from,to:I.period.to})}),(0,r.jsxs)(sg,{defaultValue:"experiment",className:"space-y-6",children:[(0,r.jsxs)(sy,{children:[(0,r.jsxs)(sN,{value:"experiment",children:[(0,r.jsx)(sw.Z,{className:"h-4 w-4 mr-2"}),K("benchmark.experimentTab","实验收益")]}),(0,r.jsxs)(sN,{value:"operations",children:[(0,r.jsx)(P.Z,{className:"h-4 w-4 mr-2"}),K("benchmark.operationsTab","运行治理")]})]}),(0,r.jsxs)(sb,{value:"experiment",className:"space-y-4",children:[(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(sk.Z,{className:"h-4 w-4"}),K("benchmark.efficiency")]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"grid grid-cols-3 gap-4",children:(0,r.jsx)(sF,{label:K("benchmark.avgTimePerTask"),value:"".concat(((null!==(u=null==I?void 0:null===(e=I.efficiency)||void 0===e?void 0:e.avgTimePerTask)&&void 0!==u?u:0)/1e3).toFixed(1),"s")})})})]}),(null!==(h=null==I?void 0:null===(s=I.plugins)||void 0===s?void 0:s.length)&&void 0!==h?h:0)>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eU.Z,{className:"h-4 w-4"}),K("benchmark.pluginEffectiveness")]})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.plugin")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.successRate")})]})}),(0,r.jsx)("tbody",{children:(null!==(v=null==I?void 0:I.plugins)&&void 0!==v?v:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono",children:e.name}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsxs)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(e.successRate>=.8?"bg-green-100 text-green-700":e.successRate>=.5?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"),children:[e.successRate.toFixed(0),"%"]})})]},e.name))})]})})]})]}),(0,r.jsxs)(sb,{value:"operations",className:"space-y-4",children:[(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(C.Z,{className:"h-4 w-4"}),K("benchmark.overview")]})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,r.jsx)(sF,{label:K("benchmark.totalRuns"),value:null!==(p=null==I?void 0:null===(t=I.overview)||void 0===t?void 0:t.totalRuns)&&void 0!==p?p:0}),(0,r.jsx)(sF,{label:K("benchmark.completed"),value:null!==(j=null==I?void 0:null===(l=I.overview)||void 0===l?void 0:l.completedRuns)&&void 0!==j?j:0}),(0,r.jsx)(sF,{label:K("benchmark.failed"),value:null!==(f=null==I?void 0:null===(n=I.overview)||void 0===n?void 0:n.failedRuns)&&void 0!==f?f:0}),(0,r.jsx)(sF,{label:K("benchmark.avgDuration"),value:"".concat(((null!==(g=null==I?void 0:null===(i=I.overview)||void 0===i?void 0:i.avgDuration)&&void 0!==g?g:0)/1e3).toFixed(1),"s")}),(0,r.jsx)(sF,{label:K("benchmark.firstPassRate"),value:"".concat((null!==(y=null==I?void 0:null===(d=I.overview)||void 0===d?void 0:d.firstPassSuccessRate)&&void 0!==y?y:0).toFixed(0),"%")})]})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(st.Z,{className:"h-4 w-4"}),K("benchmark.failureBreakdown")," (",null!==(N=null==I?void 0:null===(o=I.failures)||void 0===o?void 0:o.total)&&void 0!==N?N:0,")"]})}),(0,r.jsx)(eE,{children:(0,r.jsx)("div",{className:"space-y-2",children:Object.entries(null!==(b=null==I?void 0:null===(c=I.failures)||void 0===c?void 0:c.breakdown)&&void 0!==b?b:{}).map(e=>{var s,t,l,n;let[a,i]=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm capitalize",children:K("benchmark.failureCategories.".concat(a))}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-32 h-2 bg-secondary rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-red-500 rounded-full",style:{width:"".concat((null!==(l=null==I?void 0:null===(s=I.failures)||void 0===s?void 0:s.total)&&void 0!==l?l:0)>0?i/(null!==(n=null==I?void 0:null===(t=I.failures)||void 0===t?void 0:t.total)&&void 0!==n?n:1)*100:0,"%")}})}),(0,r.jsx)("span",{className:"text-sm font-mono w-8 text-right",children:i})]})]},a)})})})]}),(null!==(w=null==I?void 0:null===(m=I.workflows)||void 0===m?void 0:m.length)&&void 0!==w?w:0)>0&&(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(eV.Z,{className:"h-4 w-4"}),K("benchmark.workflowHealth")]})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.workflow")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.successRate")}),(0,r.jsx)("th",{children:K("benchmark.avgDuration")})]})}),(0,r.jsx)("tbody",{children:(null!==(k=null==I?void 0:I.workflows)&&void 0!==k?k:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono",children:e.name}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsxs)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(e.successRate>=.8?"bg-green-100 text-green-700":e.successRate>=.5?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"),children:[e.successRate.toFixed(0),"%"]})}),(0,r.jsxs)("td",{children:[(e.avgDuration/1e3).toFixed(1),"s"]})]},e.name))})]})})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"flex items-center gap-2",children:[(0,r.jsx)(S.Z,{className:"h-4 w-4"}),K("benchmark.dailyTrends")]})}),(0,r.jsx)(eE,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.date")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.failures")})]})}),(0,r.jsx)("tbody",{children:(null!==(R=null==I?void 0:I.byDay)&&void 0!==R?R:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1",children:e.date}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:e.failures>0?"text-red-600":"text-green-600",children:e.failures})})]},e.date))})]})})]}),(0,r.jsx)(sS,{}),(0,r.jsx)(sT,{}),(null!==(q=null==I?void 0:null===(x=I.overview)||void 0===x?void 0:x.totalRuns)&&void 0!==q?q:0)===0&&(0,r.jsx)(eL,{children:(0,r.jsxs)(eE,{className:"p-6 text-center text-muted-foreground",children:[(0,r.jsx)(T.Z,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),K("benchmark.empty")]})})]})]})]})},knowledge:function(){let{t:e}=(0,F.$G)(),{data:s,isLoading:t}=(0,D.a)({queryKey:["knowledge-sources"],queryFn:()=>ec()}),l=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>eo(e),onSuccess:()=>e.invalidateQueries({queryKey:["knowledge-sources"]})})}(),[n,i]=(0,a.useState)(""),{data:d}=(0,D.a)({queryKey:["knowledge-search",n],queryFn:()=>ed(n),enabled:n.length>0});return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("knowledge.title","Knowledge Base")}),(0,r.jsx)(eY,{onClick:()=>l.mutate(void 0),disabled:l.isPending,children:l.isPending?e("knowledge.syncing","Syncing..."):e("knowledge.syncAll","Sync All")})]}),t?(0,r.jsx)("div",{className:"text-muted-foreground",children:e("knowledge.loading","Loading...")}):s&&s.length>0?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:e("knowledge.sources","Sources")}),s.map(s=>{var t,n,a,i,d,o,c,m;return(0,r.jsx)(eL,{children:(0,r.jsxs)(eE,{className:"p-4 flex justify-between items-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold",children:null!==(d=null===(t=s.source)||void 0===t?void 0:t.name)&&void 0!==d?d:s.name}),(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:[null!==(o=s.entryCount)&&void 0!==o?o:0," chunks \xb7 ",null!==(c=null===(a=s.source)||void 0===a?void 0:null===(n=a.urls)||void 0===n?void 0:n.length)&&void 0!==c?c:0," URLs \xb7 ","ready"===s.status?e("knowledge.synced"):e("knowledge.notSynced"),s.lastSyncTime?" \xb7 ".concat(e("knowledge.last"),": ").concat(new Date(s.lastSyncTime).toLocaleDateString()):""]})]}),(0,r.jsx)(eY,{variant:"outline",size:"sm",onClick:()=>{var e,t;return l.mutate(null!==(t=null===(e=s.source)||void 0===e?void 0:e.name)&&void 0!==t?t:s.name)},disabled:l.isPending,children:e("knowledge.sync")})]})},null!==(m=null===(i=s.source)||void 0===i?void 0:i.name)&&void 0!==m?m:s.name)})]}):(0,r.jsx)(eL,{children:(0,r.jsx)(eE,{className:"p-6 text-center text-muted-foreground",children:e("knowledge.noSources","No knowledge sources. Install a plugin and sync docs.")})}),(0,r.jsxs)("div",{className:"space-y-2 pt-4",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:e("knowledge.search","Search")}),(0,r.jsx)("div",{className:"flex gap-2",children:(0,r.jsx)(eB,{placeholder:e("knowledge.searchPlaceholder","Search knowledge..."),value:n,onChange:e=>i(e.target.value)})}),d&&d.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:d.map((s,t)=>{var l;return(0,r.jsx)(eL,{children:(0,r.jsxs)(eE,{className:"p-4",children:[(0,r.jsx)("div",{className:"font-semibold",children:s.title}),(0,r.jsx)("div",{className:"text-sm text-muted-foreground mt-1",children:null===(l=s.content)||void 0===l?void 0:l.slice(0,200)}),void 0!==s.score&&(0,r.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[e("knowledge.score"),": ",s.score.toFixed(2)]})]})},t)})})]})]})},runs:function(){let{t:e}=(0,F.$G)(),{data:s}=eP(50,0),[t,l]=(0,a.useState)(null);if(t)return(0,r.jsx)(s_,{runId:t,onBack:()=>l(null)});let n=null!=s?s:[];return(0,r.jsxs)("div",{className:"p-6 space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("runs.title")}),0===n.length?(0,r.jsx)("p",{className:"text-muted-foreground",children:e("runs.empty")}):(0,r.jsx)("div",{className:"space-y-2",children:n.map(e=>{var s;return(0,r.jsxs)("div",{onClick:()=>l(e.id),className:"flex items-center gap-4 p-3 rounded bg-secondary hover:bg-accent cursor-pointer",children:[(0,r.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e.label||e.id}),(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(null!==(s=sO[e.status])&&void 0!==s?s:"text-muted-foreground"),children:e.status}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.totalToolCalls," tools (",e.mcpToolCalls," MCP)"]}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:e.durationMs>0?"".concat((e.durationMs/1e3).toFixed(1),"s"):"--"}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:new Date(e.startedAt).toLocaleString()})]},e.id)})})]})},timeline:function(){let{t:e}=(0,F.$G)(),s=new Date().toISOString().slice(0,10),[t,l]=(0,a.useState)(s),{data:n}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,D.a)({queryKey:["telemetry-runs",e,s],queryFn:()=>em(e,s)})}(100,0),{data:i}=eF(1),d=new Date(t+"T00:00:00Z").getTime(),o=d+864e5,c=(null!=n?n:[]).filter(e=>e.startedAt>=d&&e.startedAt<o).slice(0,100),m=e=>{let s=new Date(t+"T00:00:00Z");s.setDate(s.getDate()+e),l(s.toISOString().slice(0,10))};return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("timeline.title")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:()=>m(-1),className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sz.Z,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t}),(0,r.jsx)("button",{onClick:()=>m(1),className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sQ.Z,{className:"h-4 w-4"})})]})]}),(0,r.jsx)(sM,{runs:c,date:t}),i&&(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.runs")}),(0,r.jsxs)("div",{className:"font-bold text-lg",children:[i.summary.completedRuns," ",e("timeline.completed")," / ",i.summary.failedRuns," ",e("timeline.failed")]})]}),(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.toolUses")}),(0,r.jsx)("div",{className:"font-bold text-lg",children:i.summary.totalToolUses})]}),(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.avgDuration")}),(0,r.jsxs)("div",{className:"font-bold text-lg",children:[(i.summary.avgRunDuration/1e3).toFixed(1),"s"]})]})]})]})},executions:function(){let{t:e}=(0,F.$G)(),[s,t]=(0,a.useState)(null),{data:l,isLoading:n}=(0,D.a)({queryKey:["telemetry","executions"],queryFn:()=>ew(50),refetchInterval:1e4}),{data:i}=(0,D.a)({queryKey:["telemetry","mcp-compliance"],queryFn:()=>eS()}),{data:d}=(0,D.a)({queryKey:["telemetry","executions",s,"events"],queryFn:()=>ek(s),enabled:!!s}),o=null!=l?l:[];return n?(0,r.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[(0,r.jsx)(C.Z,{className:"h-5 w-5 animate-spin mr-2"}),e("executions.loading")]}):(0,r.jsxs)("div",{className:"h-full overflow-auto p-6",children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-4",children:e("executions.title")}),i&&(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.overallCompliance")}),(0,r.jsxs)("div",{className:"text-2xl font-bold mt-1",children:[i.overall.toFixed(1),"%"]})]}),(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.totalExecutions")}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:o.length})]}),(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.skillsTracked")}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:Object.keys(i.bySkill).length})]})]}),(0,r.jsx)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"bg-muted/50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.skill")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.status")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.tools")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.mcpRate")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.duration")})]})}),(0,r.jsxs)("tbody",{children:[o.map(e=>{var l,n,a;return(0,r.jsxs)("tr",{className:"border-t border-border cursor-pointer hover:bg-muted/30 ".concat(s===e.executionId?"bg-muted/50":""),onClick:()=>t(e.executionId),children:[(0,r.jsx)("td",{className:"px-4 py-2 font-mono text-xs",children:e.skillName}),(0,r.jsx)("td",{className:"px-4 py-2",children:"completed"===e.status?(0,r.jsx)(sG.Z,{className:"h-4 w-4 text-green-500 inline"}):"failed"===e.status?(0,r.jsx)(sU.Z,{className:"h-4 w-4 text-red-500 inline"}):(0,r.jsx)(S.Z,{className:"h-4 w-4 text-yellow-500 inline animate-spin"})}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.totalToolCalls}),(0,r.jsx)("td",{className:"px-4 py-2",children:(0,r.jsx)(sV,{rate:null!==(l=e.mcpComplianceRate)&&void 0!==l?l:0})}),(0,r.jsx)("td",{className:"px-4 py-2",children:(a=null!==(n=e.totalDuration)&&void 0!==n?n:0)<1e3?"".concat(a,"ms"):"".concat((a/1e3).toFixed(1),"s")})]},e.executionId)}),0===o.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:e("executions.empty")})})]})]})}),s&&d&&(0,r.jsxs)("div",{className:"mt-6 bg-card border border-border rounded-lg p-4",children:[(0,r.jsxs)("h3",{className:"font-bold mb-3 flex items-center gap-2",children:[(0,r.jsx)(eU.Z,{className:"h-4 w-4"}),e("executions.traceTimeline")]}),(0,r.jsx)("div",{className:"space-y-2",children:(null!=d?d:[]).map(s=>(0,r.jsxs)("div",{className:"flex items-start gap-3 p-2 rounded-md bg-muted/30 text-sm",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground w-16 shrink-0",children:new Date(s.timestamp).toLocaleTimeString()}),(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono ".concat(s.isMcpTool?"bg-green-500/20 text-green-400":"subagent"===s.toolType?"bg-blue-500/20 text-blue-400":"bg-muted text-muted-foreground"),children:s.toolType}),(0,r.jsx)("span",{className:"font-mono text-xs flex-1",children:s.toolName}),s.blocked&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-red-500/20 text-red-400",children:e("executions.blocked")}),s.mcpEnforced&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-green-500/20 text-green-400",children:"MCP"}),s.mcpFallback&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-yellow-500/20 text-yellow-400",children:e("executions.fallback")})]},s.eventId))})]})]})},"tool-metrics":function(){let[e,s]=(0,a.useState)(7),{data:t=[],isLoading:l}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["tool-metrics-summary",e],queryFn:()=>ef(e)})}(e);return l?(0,r.jsx)("div",{className:"p-4 text-muted-foreground",children:"Loading tool metrics..."}):(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Tool Metrics"}),(0,r.jsxs)("select",{value:e,onChange:e=>s(Number(e.target.value)),className:"border rounded px-2 py-1 text-sm bg-background",children:[(0,r.jsx)("option",{value:1,children:"Last 24h"}),(0,r.jsx)("option",{value:7,children:"Last 7 days"}),(0,r.jsx)("option",{value:30,children:"Last 30 days"})]})]}),0===t.length?(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tool metrics yet. Start a Claude Code session to collect data."}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(e=>(0,r.jsxs)(eL,{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"font-mono text-sm font-medium",children:e.toolName}),(0,r.jsxs)(sR,{variant:e.callCount>10?"default":"secondary",children:[e.callCount," calls"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Success"}),(0,r.jsxs)("p",{className:"font-semibold",style:{color:e.successRate>=90?"#22c55e":e.successRate>=70?"#f59e0b":"#ef4444"},children:[e.successRate,"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Empty"}),(0,r.jsxs)("p",{className:"font-semibold",style:{color:e.emptyRate<=10?"#22c55e":e.emptyRate<=30?"#f59e0b":"#ef4444"},children:[e.emptyRate,"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Avg Results"}),(0,r.jsx)("p",{className:"font-semibold",children:e.avgResults})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Avg Latency"}),(0,r.jsxs)("p",{className:"font-semibold",children:[e.avgLatency,"ms"]})]})]})]},e.toolName))})]})},accuracy:function(){var e,s;let[t,l]=(0,a.useState)(""),{data:n}=(e=t||void 0,(0,D.a)({queryKey:["accuracy-stats",e],queryFn:()=>eg(e)})),{data:i}=(s={engine:t||void 0,status:"unannotated",limit:20},(0,D.a)({queryKey:["accuracy-queries",s],queryFn:()=>ey(s)})),{data:d}=(0,D.a)({queryKey:["auto-check"],queryFn:()=>eb()}),o=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>eN(e),onSuccess:()=>{e.invalidateQueries({queryKey:["accuracy-stats"]}),e.invalidateQueries({queryKey:["accuracy-queries"]})}})}(),c=null!=n?n:{},m=Array.isArray(i)?i:[],x=Array.isArray(d)?d:[],u=(0,a.useCallback)((e,s)=>{o.mutate({queryId:e,relevance:s})},[o]);return(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Accuracy"}),(0,r.jsxs)("select",{value:t,onChange:e=>l(e.target.value),className:"border rounded px-2 py-1 text-sm bg-background",children:[(0,r.jsx)("option",{value:"",children:"All Engines"}),(0,r.jsx)("option",{value:"codegraph",children:"CodeGraph"}),(0,r.jsx)("option",{value:"knowledge",children:"Knowledge"}),(0,r.jsx)("option",{value:"memory",children:"Memory"})]})]}),x.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Auto Check Results"}),x.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded text-sm ".concat("error"===e.severity?"bg-red-50 dark:bg-red-950 border border-red-300":"warning"===e.severity?"bg-yellow-50 dark:bg-yellow-950 border border-yellow-300":"bg-green-50 dark:bg-green-950 border border-green-300"),children:[(0,r.jsx)(sR,{variant:"ok"===e.severity?"default":"destructive",children:e.severity}),(0,r.jsx)("span",{className:"flex-1",children:e.detail})]},e.name))]}),Object.keys(c).length>0&&(0,r.jsx)("div",{className:"grid grid-cols-3 gap-4",children:Object.entries(c).map(e=>{let[s,t]=e;return(0,r.jsxs)(eL,{className:"p-4 space-y-2",children:[(0,r.jsx)("h3",{className:"font-medium text-sm capitalize",children:s}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Queries"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:t.totalQueries}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Annotated"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:t.annotatedQueries}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Hit Rate"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:null!=t.hitRate?"".concat(Math.round(100*t.hitRate),"%"):"N/A"})]})]},s)})}),m.length>0&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("h3",{className:"text-sm font-medium",children:["Annotation Queue (",m.length," unannotated)"]}),m.slice(0,10).map(e=>{var s;return(0,r.jsxs)(eL,{className:"p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(sR,{variant:"outline",children:e.engine}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,r.jsx)("p",{className:"text-sm font-mono",children:e.query}),(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Top results: ",(null===(s=e.topKResults)||void 0===s?void 0:s.slice(0,3).map(e=>{var s;return null!==(s=e.name)&&void 0!==s?s:e.title}).join(", "))||"none"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(eY,{size:"sm",variant:"default",onClick:()=>u(e.id,"hit"),children:"Hit"}),(0,r.jsx)(eY,{size:"sm",variant:"secondary",onClick:()=>u(e.id,"partial"),children:"Partial"}),(0,r.jsx)(eY,{size:"sm",variant:"destructive",onClick:()=>u(e.id,"miss"),children:"Miss"})]})]},e.id)})]}),0===Object.keys(c).length&&0===m.length&&0===x.length&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"No accuracy data yet. Start a Claude Code session to collect queries."})]})},settings:function(){var e,s,t,l,n,a,i;let{t:d}=(0,F.$G)(),{data:o}=(0,D.a)({queryKey:["plugins",void 0,void 0],queryFn:()=>eC(a,i)}),{data:c}=eF(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>ej(e),onSuccess:()=>e.invalidateQueries({queryKey:["telemetry-stats"]})})}();return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:d("settings.title","Project Settings")}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{className:"text-sm",children:d("settings.projectInfo","Project Info")})}),(0,r.jsxs)(eE,{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.name","Name"),":"]}),(0,r.jsx)("span",{children:"devflow"})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.mode","Mode"),":"]}),(0,r.jsx)("span",{children:"monorepo"})]})]})]}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsxs)(eZ,{className:"text-sm",children:[d("settings.plugins","Plugins")," (",null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0," installed)"]})}),(0,r.jsx)(eE,{className:"space-y-2",children:o&&o.length>0?o.map(e=>(0,r.jsxs)("div",{className:"flex justify-between items-center text-sm p-2 border rounded",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:["@",e.version]})]},e.name)):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:d("settings.noPlugins","No plugins installed")})})]}),(0,r.jsx)(sT,{}),(0,r.jsxs)(eL,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{className:"text-sm",children:d("settings.telemetry","Telemetry")})}),(0,r.jsxs)(eE,{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.totalRuns","Runs stored"),":"]}),(0,r.jsx)("span",{children:null!==(l=null==c?void 0:null===(e=c.summary)||void 0===e?void 0:e.totalRuns)&&void 0!==l?l:0})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.totalTokens","Total tokens"),":"]}),(0,r.jsx)("span",{children:(null!==(n=null==c?void 0:null===(s=c.summary)||void 0===s?void 0:s.totalTokens)&&void 0!==n?n:0).toLocaleString()})]}),(0,r.jsx)(eY,{variant:"outline",size:"sm",onClick:()=>m.mutate(30),disabled:m.isPending,children:d("settings.clearOldRuns","Clear old runs (30d+)")})]})]})]})}};function sH(){var e;let s=x(e=>e.activeView),t=null!==(e=s$[s])&&void 0!==e?e:()=>(0,r.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-lg",children:[s," view"]});return(0,r.jsx)(t,{})}function sJ(){let e=x(e=>e.activeView),[s,t]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{t(!0)},[]),s)?(0,r.jsx)(u,{nav:(0,r.jsx)(K,{}),main:(0,r.jsx)(sH,{}),detail:"graph"===e?(0,r.jsx)(eD,{}):void 0}):(0,r.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,r.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})})}}},function(e){e.O(0,[650,856,254,781,293,528,744],function(){return e(e.s=56364)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/9bb745101fd21603.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/322e14d06135256b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-202a5f91ead17fa7.js" async=""></script><script src="/_next/static/chunks/6b3bb038-34d5cf36bd0210d6.js" async=""></script><script src="/_next/static/chunks/254-814190ccf12d2df8.js" async=""></script><script src="/_next/static/chunks/781-97eaf0e93843fa67.js" async=""></script><script src="/_next/static/chunks/app/page-570d1b92af49aa0f.js" async=""></script><script src="/_next/static/chunks/app/layout-0e71002867d54cb5.js" async=""></script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden"><div class="flex items-center justify-center h-screen"><div class="text-muted-foreground">Loading...</div></div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/9bb745101fd21603.css\",\"style\"]\n2:HL[\"/_next/static/css/322e14d06135256b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"3:I[11815,[],\"\"]\n5:I[5428,[],\"ClientPageRoot\"]\n6:I[83138,[\"856\",\"static/chunks/6b3bb038-34d5cf36bd0210d6.js\",\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"781\",\"static/chunks/781-97eaf0e93843fa67.js\",\"931\",\"static/chunks/app/page-570d1b92af49aa0f.js\"],\"default\",1]\n7:I[72921,[\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"185\",\"static/chunks/app/layout-0e71002867d54cb5.js\"],\"default\",1]\n8:I[55092,[],\"\"]\n9:I[82023,[],\"\"]\nc:I[91584,[],\"\"]\na:{}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L3\",null,{\"buildId\":\"YnHnPFDLDTTnJWGvL2oh7\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L4\",[\"$\",\"$L5\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$6\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/322e14d06135256b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bb745101fd21603.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":\"$a\"}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n4:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/9bb745101fd21603.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/322e14d06135256b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-202a5f91ead17fa7.js" async=""></script><script src="/_next/static/chunks/6b3bb038-34d5cf36bd0210d6.js" async=""></script><script src="/_next/static/chunks/254-814190ccf12d2df8.js" async=""></script><script src="/_next/static/chunks/781-97eaf0e93843fa67.js" async=""></script><script src="/_next/static/chunks/app/page-c3269fe44e0465e7.js" async=""></script><script src="/_next/static/chunks/app/layout-0e71002867d54cb5.js" async=""></script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden"><div class="flex items-center justify-center h-screen"><div class="text-muted-foreground">Loading...</div></div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/9bb745101fd21603.css\",\"style\"]\n2:HL[\"/_next/static/css/322e14d06135256b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"3:I[11815,[],\"\"]\n5:I[5428,[],\"ClientPageRoot\"]\n6:I[71847,[\"856\",\"static/chunks/6b3bb038-34d5cf36bd0210d6.js\",\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"781\",\"static/chunks/781-97eaf0e93843fa67.js\",\"931\",\"static/chunks/app/page-c3269fe44e0465e7.js\"],\"default\",1]\n7:I[72921,[\"254\",\"static/chunks/254-814190ccf12d2df8.js\",\"185\",\"static/chunks/app/layout-0e71002867d54cb5.js\"],\"default\",1]\n8:I[55092,[],\"\"]\n9:I[82023,[],\"\"]\nc:I[91584,[],\"\"]\na:{}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L3\",null,{\"buildId\":\"EDDf6rtQ-c_W_Mi0ANVIA\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L4\",[\"$\",\"$L5\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$6\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/322e14d06135256b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bb745101fd21603.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":\"$a\"}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n4:null\n"])</script></body></html>
@@ -1,9 +1,9 @@
1
1
  2:I[5428,[],"ClientPageRoot"]
2
- 3:I[83138,["856","static/chunks/6b3bb038-34d5cf36bd0210d6.js","254","static/chunks/254-814190ccf12d2df8.js","781","static/chunks/781-97eaf0e93843fa67.js","931","static/chunks/app/page-570d1b92af49aa0f.js"],"default",1]
2
+ 3:I[71847,["856","static/chunks/6b3bb038-34d5cf36bd0210d6.js","254","static/chunks/254-814190ccf12d2df8.js","781","static/chunks/781-97eaf0e93843fa67.js","931","static/chunks/app/page-c3269fe44e0465e7.js"],"default",1]
3
3
  4:I[72921,["254","static/chunks/254-814190ccf12d2df8.js","185","static/chunks/app/layout-0e71002867d54cb5.js"],"default",1]
4
4
  5:I[55092,[],""]
5
5
  6:I[82023,[],""]
6
6
  7:{}
7
- 0:["YnHnPFDLDTTnJWGvL2oh7",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/322e14d06135256b.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bb745101fd21603.css","precedence":"next","crossOrigin":"$undefined"}]],["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null],["$L8",null]]]]
7
+ 0:["EDDf6rtQ-c_W_Mi0ANVIA",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/322e14d06135256b.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bb745101fd21603.css","precedence":"next","crossOrigin":"$undefined"}]],["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null],["$L8",null]]]]
8
8
  8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}]]
9
9
  1:null
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: devflow:start
3
- description: 启动 DevFlow 开发服务器(服务端 + 前端),显示访问信息
3
+ description: 启动 DevFlow 服务端(API + Dashboard),显示访问信息
4
4
  required_mcp_tools: []
5
5
  ---
6
6
 
7
7
  # DevFlow Start
8
8
 
9
- 启动 DevFlow 开发环境,包括服务端和前端。使用 `npx devflow start` 命令,无论在哪个目录下调用都能正确启动 DevFlow 服务。
9
+ 启动 DevFlow 开发环境。使用 `npx devflow start` 命令,无论在哪个目录下调用都能正确启动 DevFlow 服务。
10
10
 
11
11
  ## 执行步骤
12
12
 
@@ -15,40 +15,36 @@ required_mcp_tools: []
15
15
  npx devflow start
16
16
  ```
17
17
 
18
- 这会自动启动:
19
- - DevFlow REST 服务端(默认端口 13337)
20
- - DevFlow Dashboard(默认端口 17788)
18
+ Server 启动后同时提供:
19
+ - REST API(默认端口 13337)
20
+ - Dashboard(由 Server 在同一端口提供静态文件服务)
21
21
 
22
22
  2. **显示启动信息**
23
23
  服务启动后,显示以下信息:
24
24
 
25
25
  ```
26
26
  ╔═══════════════════════════════════════════════════════════╗
27
- ║ 🚀 DevFlow Started! ║
27
+ ║ DevFlow Started! ║
28
28
  ╠═══════════════════════════════════════════════════════════╣
29
- ║ ║
30
- ║ 🖥️ Server: http://localhost:13337 ║
31
- ║ 🎨 Dashboard: http://localhost:17788 ║
32
- ║ ║
33
- ║ Press Ctrl+C to stop all services ║
29
+ ║ Server + Dashboard: http://localhost:13337 ║
30
+ ║ ║
31
+ ║ Press Ctrl+C to stop ║
34
32
  ╚═══════════════════════════════════════════════════════════╝
35
33
  ```
36
34
 
37
35
  3. **保持运行**
38
36
  - `devflow start` 会持续运行直到 Ctrl+C
39
- - 服务端和 Dashboard 由 CLI 统一管理生命周期
37
+ - API 和 Dashboard 由 CLI 统一管理生命周期
40
38
 
41
39
  ## 注意事项
42
40
 
43
- - 端口 13337:服务端(NestJS)
44
- - 端口 17788:前端(Next.js Dashboard)
41
+ - Server 和 Dashboard 共用端口 13337(Dashboard 作为静态文件由 server 提供)
45
42
  - 使用 `npx devflow start` 从任意目录启动,不依赖当前工作目录
46
- - 如果端口被占用,提示用户 `lsof -i :13337` 或 `lsof -i :17788` 检查
43
+ - 如果端口被占用,提示用户 `lsof -i :13337` 检查
47
44
 
48
45
  ## 故障排除
49
46
 
50
47
  如果启动失败:
51
- 1. 检查端口是否被占用:`lsof -i :13337` 和 `lsof -i :17788`
48
+ 1. 检查端口是否被占用:`lsof -i :13337`
52
49
  2. 确认 devflow 已安装:`npx devflow --version`
53
- 3. 如需后台运行:`npx devflow start -d`
54
- 4. 仅启动服务端(不要 Dashboard):`npx devflow start --no-dashboard`
50
+ 3. 如需后台运行:`npx devflow start --background`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/devflow",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
4
4
  "type": "module",
5
5
  "description": "DevFlow - Developer Intelligence Platform (Distribution Package)",
6
6
  "bin": {
@@ -15,17 +15,17 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@colbymchenry/codegraph": "^1.1.1",
18
- "@devflow-tools/adapters": "^0.12.0",
19
- "@devflow-tools/benchmark": "^0.12.0",
20
- "@devflow-tools/context-engine": "^0.12.0",
21
- "@devflow-tools/database": "^0.12.0",
22
- "@devflow-tools/knowledge-engine": "^0.12.0",
23
- "@devflow-tools/mcp-server": "^0.12.0",
24
- "@devflow-tools/memory-engine": "^0.12.0",
25
- "@devflow-tools/sdk": "^0.12.0",
26
- "@devflow-tools/server": "^0.12.4",
27
- "@devflow-tools/telemetry": "^0.12.0",
28
- "@devflow-tools/workflow-engine": "^0.12.0",
18
+ "@devflow-tools/adapters": "^0.12.5",
19
+ "@devflow-tools/benchmark": "^0.12.5",
20
+ "@devflow-tools/context-engine": "^0.12.5",
21
+ "@devflow-tools/database": "^0.12.5",
22
+ "@devflow-tools/knowledge-engine": "^0.12.5",
23
+ "@devflow-tools/mcp-server": "^0.12.5",
24
+ "@devflow-tools/memory-engine": "^0.12.5",
25
+ "@devflow-tools/sdk": "^0.12.5",
26
+ "@devflow-tools/server": "^0.12.5",
27
+ "@devflow-tools/telemetry": "^0.12.5",
28
+ "@devflow-tools/workflow-engine": "^0.12.5",
29
29
  "@inquirer/prompts": "^7.10.1",
30
30
  "@modelcontextprotocol/sdk": "^1.0.0",
31
31
  "@nestjs/common": "^10.4.0",
@@ -52,5 +52,5 @@
52
52
  "plugin-registry.json",
53
53
  "scripts/postinstall.js"
54
54
  ],
55
- "gitHead": "5d7e06373dd6a3526d7732e15c0b76c764e5f929"
55
+ "gitHead": "e8440cff84139ca0cc1786ee39be3b453974e000"
56
56
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "lastUpdated": "2026-07-11T11:13:33.819Z",
3
+ "lastUpdated": "2026-07-11T15:08:15.217Z",
4
4
  "plugins": [
5
5
  {
6
6
  "name": "@devflow-tools/plugin-animation",
7
- "version": "0.11.0",
7
+ "version": "0.12.0",
8
8
  "description": "",
9
9
  "tags": [],
10
10
  "compatibleStacks": [
@@ -16,7 +16,7 @@
16
16
  },
17
17
  {
18
18
  "name": "@devflow-tools/claude-code-plugin",
19
- "version": "0.11.0",
19
+ "version": "0.12.5",
20
20
  "description": "DevFlow — Developer Intelligence Platform for Claude Code",
21
21
  "tags": [
22
22
  "pi-package",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  {
34
34
  "name": "@devflow-tools/plugin-css",
35
- "version": "0.11.0",
35
+ "version": "0.12.0",
36
36
  "description": "",
37
37
  "tags": [],
38
38
  "compatibleStacks": [
@@ -44,7 +44,7 @@
44
44
  },
45
45
  {
46
46
  "name": "@devflow-tools/plugin-docker",
47
- "version": "0.11.0",
47
+ "version": "0.12.0",
48
48
  "description": "",
49
49
  "tags": [],
50
50
  "compatibleStacks": [
@@ -56,7 +56,7 @@
56
56
  },
57
57
  {
58
58
  "name": "@devflow-tools/plugin-electron",
59
- "version": "0.11.0",
59
+ "version": "0.12.0",
60
60
  "description": "",
61
61
  "tags": [],
62
62
  "compatibleStacks": [
@@ -68,7 +68,7 @@
68
68
  },
69
69
  {
70
70
  "name": "@devflow-tools/plugin-git",
71
- "version": "0.11.0",
71
+ "version": "0.12.0",
72
72
  "description": "",
73
73
  "tags": [],
74
74
  "compatibleStacks": [
@@ -80,7 +80,7 @@
80
80
  },
81
81
  {
82
82
  "name": "@devflow-tools/plugin-graphql",
83
- "version": "0.11.0",
83
+ "version": "0.12.0",
84
84
  "description": "",
85
85
  "tags": [],
86
86
  "compatibleStacks": [
@@ -92,7 +92,7 @@
92
92
  },
93
93
  {
94
94
  "name": "@devflow-tools/plugin-nest",
95
- "version": "0.11.0",
95
+ "version": "0.12.0",
96
96
  "description": "",
97
97
  "tags": [],
98
98
  "compatibleStacks": [
@@ -104,7 +104,7 @@
104
104
  },
105
105
  {
106
106
  "name": "@devflow-tools/plugin-nextjs",
107
- "version": "0.11.0",
107
+ "version": "0.12.0",
108
108
  "description": "",
109
109
  "tags": [],
110
110
  "compatibleStacks": [
@@ -116,7 +116,7 @@
116
116
  },
117
117
  {
118
118
  "name": "@devflow-tools/plugin-performance",
119
- "version": "0.11.0",
119
+ "version": "0.12.0",
120
120
  "description": "",
121
121
  "tags": [],
122
122
  "compatibleStacks": [
@@ -128,7 +128,7 @@
128
128
  },
129
129
  {
130
130
  "name": "@devflow-tools/plugin-react",
131
- "version": "0.11.0",
131
+ "version": "0.12.0",
132
132
  "description": "",
133
133
  "tags": [],
134
134
  "compatibleStacks": [
@@ -140,7 +140,7 @@
140
140
  },
141
141
  {
142
142
  "name": "@devflow-tools/plugin-tailwind",
143
- "version": "0.11.0",
143
+ "version": "0.12.0",
144
144
  "description": "",
145
145
  "tags": [],
146
146
  "compatibleStacks": [
@@ -152,7 +152,7 @@
152
152
  },
153
153
  {
154
154
  "name": "@devflow-tools/plugin-taro",
155
- "version": "0.11.0",
155
+ "version": "0.12.0",
156
156
  "description": "",
157
157
  "tags": [],
158
158
  "compatibleStacks": [
@@ -164,7 +164,7 @@
164
164
  },
165
165
  {
166
166
  "name": "@devflow-tools/plugin-ui-layout",
167
- "version": "0.11.0",
167
+ "version": "0.12.0",
168
168
  "description": "",
169
169
  "tags": [],
170
170
  "compatibleStacks": [
@@ -176,7 +176,7 @@
176
176
  },
177
177
  {
178
178
  "name": "@devflow-tools/plugin-vue",
179
- "version": "0.11.0",
179
+ "version": "0.12.0",
180
180
  "description": "",
181
181
  "tags": [],
182
182
  "compatibleStacks": [
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{56364:function(e,s,t){Promise.resolve().then(t.bind(t,83138))},83138:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sW}});var l,n,r=t(27573),a=t(7653),i=t(62052);let d="devflow-project-root",o="devflow-active-project-root";function c(e){try{return localStorage.getItem(e)}catch(e){return null}}function m(e,s){try{null===s?localStorage.removeItem(e):localStorage.setItem(e,s)}catch(e){}}let x=(0,i.Ue)(e=>({activeView:"overview",selectedNodeId:null,detailTab:"properties",searchQuery:"",projectRoot:c(d),activeProjectRoot:c(o),selectedRunId:null,setActiveView:s=>e({activeView:s,selectedNodeId:null}),selectNode:s=>e({selectedNodeId:s}),setDetailTab:s=>e({detailTab:s}),setSearchQuery:s=>e({searchQuery:s}),setProjectRoot:s=>{m(d,s),e({projectRoot:s})},setActiveProjectRoot:s=>{m(o,s),e({activeProjectRoot:s})},setSelectedRunId:s=>e({selectedRunId:s})}));function u(e){let{nav:s,main:t,detail:l}=e;return(0,r.jsxs)("div",{className:"flex h-screen w-full",children:[(0,r.jsx)("aside",{className:"w-[220px] shrink-0 border-r border-border bg-card overflow-y-auto",children:s}),(0,r.jsx)("main",{className:"flex-1 overflow-hidden",children:t}),l&&(0,r.jsx)("aside",{className:"w-[340px] shrink-0 border-l border-border bg-card overflow-y-auto",children:l})]})}var h=t(10607),v=t(25579);function j(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,v.m6)((0,h.W)(s))}var p=t(83071),f=t(50646),g=t(88497),y=t(61990),N=t(31815),b=t(46693),w=t(70548),k=t(41755),S=t(25555),C=t(39790),R=t(84142),F=t(31095),T=t(12198),P=t(3806);let q=[{id:"overview",labelKey:"nav.overview",icon:p.Z},{id:"graph",labelKey:"nav.graph",icon:f.Z},{id:"context",labelKey:"nav.context",icon:g.Z},{id:"workflows",labelKey:"nav.workflows",icon:y.Z},{id:"memory",labelKey:"nav.memory",icon:N.Z},{id:"benchmark",labelKey:"nav.benchmark",icon:b.Z},{id:"knowledge",labelKey:"nav.knowledge",icon:w.Z},{id:"runs",labelKey:"nav.runs",icon:k.Z},{id:"timeline",labelKey:"nav.timeline",icon:S.Z},{id:"executions",labelKey:"nav.executions",icon:C.Z},{id:"tool-metrics",labelKey:"nav.toolMetrics",icon:R.Z},{id:"accuracy",labelKey:"nav.accuracy",icon:F.Z},{id:"settings",labelKey:"nav.settings",icon:T.Z}];function K(){let{t:e,i18n:s}=(0,P.$G)(),t=x(e=>e.activeView),l=x(e=>e.setActiveView);return(0,r.jsxs)("nav",{className:"flex flex-col gap-1 p-3 h-full",children:[(0,r.jsx)("h1",{className:"text-lg font-bold mb-4 px-3 text-primary",children:e("nav.title")}),q.map(s=>(0,r.jsxs)("button",{onClick:()=>l(s.id),className:j("flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors",t===s.id?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-accent"),children:[(0,r.jsx)(s.icon,{className:"h-4 w-4"}),e(s.labelKey)]},s.id)),(0,r.jsx)("div",{className:"mt-auto pt-4 border-t border-border",children:(0,r.jsx)("button",{onClick:()=>{s.changeLanguage("zh"===s.language?"en":"zh")},className:"w-full px-3 py-2 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:e("nav.language")})})]})}var D=t(31988),L=t(77930),I=t(15969),Z=t(49767);let E=null!==(l=Z.env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==l?l:"http://localhost:13337",_=null!==(n=Z.env.NEXT_PUBLIC_DEVFLOW_API_KEY)&&void 0!==n?n:"dev-key-000000";async function O(e,s){let t=function(){try{return localStorage.getItem("devflow-active-project-root")}catch(e){return null}}(),l={"Content-Type":"application/json","x-api-key":_};t&&(l["x-devflow-project"]=t);let n=await fetch("".concat(E,"/api").concat(e),{...s,headers:{...l,...null==s?void 0:s.headers}});if(!n.ok)throw Error("API ".concat(n.status,": ").concat(await n.text()));let r=await n.json();return r&&"object"==typeof r&&"ok"in r&&"data"in r?r.data:r}let A=()=>O("/projects"),M=e=>O("/projects/connect",{method:"POST",body:JSON.stringify({rootPath:e})}),z=()=>O("/projects/active",{method:"DELETE"}),Q=()=>O("/projects/active"),G=e=>O("/projects/onboarding-pack?rootPath=".concat(encodeURIComponent(e))),U=()=>O("/context/status"),V=e=>O("/context/build",{method:"POST",body:JSON.stringify(e)}),$=e=>O("/context/build-task",{method:"POST",body:JSON.stringify(e)}),H=e=>O("/context/feedback",{method:"POST",body:JSON.stringify(e)}),J=()=>O("/graph"),B=()=>O("/graph?view=layered"),W=()=>O("/workflows"),X=(e,s)=>O("/workflows/".concat(e,"/run"),{method:"POST",body:JSON.stringify({input:s})}),Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return O("/workflows/runs?limit=".concat(e,"&offset=").concat(s))},ee=()=>O("/memory"),es=e=>O("/memory",{method:"POST",body:JSON.stringify(e)}),et=(e,s)=>O("/memory/".concat(e),{method:"PUT",body:JSON.stringify(s)}),el=e=>O("/memory/".concat(e),{method:"DELETE"}),en=e=>O("/memory/candidates/".concat(e,"/approve"),{method:"POST"}),er=e=>O("/memory/candidates/".concat(e,"/reject"),{method:"POST"}),ea=(e,s,t)=>O("/memory/search",{method:"POST",body:JSON.stringify({query:e,limit:s,categories:t})}),ei=()=>O("/memory/ollama/status"),ed=(e,s)=>O("/knowledge/search?q=".concat(encodeURIComponent(e)).concat(s?"&scope=".concat(s):"")),eo=e=>O("/knowledge/sync",{method:"POST",body:JSON.stringify({pluginName:e})}),ec=()=>O("/knowledge/sources"),em=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;return O("/telemetry/runs?limit=".concat(e,"&offset=").concat(s).concat(t?"&source=".concat(t):""))},ex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,l=new URLSearchParams({limit:String(e),offset:String(s)});return t&&l.set("projectRoot",t),O("/telemetry/sessions?".concat(l))},eu=e=>O("/telemetry/sessions/".concat(e)),eh=e=>O("/telemetry/sessions/".concat(e,"/events")),ev=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/stats?days=".concat(e))},ej=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/roi-summary?days=".concat(e))},ep=e=>O("/telemetry/cleanup",{method:"POST",body:JSON.stringify({olderThanDays:e})}),ef=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return O("/telemetry/tool-metrics/summary?days=".concat(e))},eg=(e,s)=>{let t=new URLSearchParams;e&&t.set("engine",e),s&&t.set("since",String(s));let l=t.toString();return O("/telemetry/accuracy/stats".concat(l?"?".concat(l):""))},ey=e=>{let s=new URLSearchParams;(null==e?void 0:e.engine)&&s.set("engine",e.engine),(null==e?void 0:e.status)&&s.set("status",e.status),(null==e?void 0:e.limit)&&s.set("limit",String(e.limit)),(null==e?void 0:e.offset)&&s.set("offset",String(e.offset));let t=s.toString();return O("/telemetry/accuracy/queries".concat(t?"?".concat(t):""))},eN=e=>O("/telemetry/accuracy/feedback",{method:"POST",body:JSON.stringify(e)}),eb=()=>O("/telemetry/auto-check"),ew=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1?arguments[1]:void 0,t=new URLSearchParams({limit:String(e)});return s&&t.set("skillName",s),O("/telemetry/executions?".concat(t))},ek=e=>O("/telemetry/executions/".concat(e,"/events")),eS=()=>O("/telemetry/mcp-compliance"),eC=()=>O("/benchmark/results"),eR=(e,s)=>O("/registry/plugins".concat(e?"?search=".concat(encodeURIComponent(e)).concat(s?"&tag=".concat(s):""):s?"?tag=".concat(s):"")),eF=e=>O("/registry/plugins/effectiveness".concat(e?"?rootPath=".concat(encodeURIComponent(e)):""));function eT(){return(0,D.a)({queryKey:["workflows"],queryFn:()=>W()})}function eP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;return(0,D.a)({queryKey:["sessions",e,s,t],queryFn:()=>ex(e,s,t)})}function eq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["telemetry-stats",e],queryFn:()=>ev(e)})}function eK(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["roi-summary",e],queryFn:()=>ej(e)})}let eD={properties:"detail.properties",imports:"detail.imports",history:"detail.history"};function eL(){let{t:e}=(0,P.$G)(),s=x(e=>e.selectedNodeId),t=x(e=>e.detailTab),l=x(e=>e.setDetailTab),{data:n}=(0,D.a)({queryKey:["graph"],queryFn:()=>J()}),a=null==n?void 0:n.nodes.find(e=>e.id===s);return s?(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex border-b border-border",children:Object.keys(eD).map(s=>(0,r.jsx)("button",{onClick:()=>l(s),className:j("flex-1 py-2 text-xs font-medium capitalize",t===s?"border-b-2 border-primary text-primary":"text-muted-foreground"),children:e(eD[s])},s))}),(0,r.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:a?(0,r.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.name"),":"]})," ",a.name]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.type"),":"]})," ",(0,r.jsx)("span",{className:"capitalize",children:a.type})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("detail.file"),":"]})," ",(0,r.jsx)("span",{className:"font-mono text-xs",children:a.file})]})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("detail.notFound")})})]}):(0,r.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:e("detail.selectNode")})}let eI=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:j("rounded-lg border border-border bg-card text-card-foreground",t),...l})});eI.displayName="Card";let eZ=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:j("flex flex-col space-y-1.5 p-4",t),...l})});eZ.displayName="CardHeader";let eE=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("h3",{ref:s,className:j("text-sm font-semibold leading-none tracking-tight",t),...l})});eE.displayName="CardTitle";let e_=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)("div",{ref:s,className:j("p-4 pt-0",t),...l})});function eO(e){let{className:s,...t}=e;return(0,r.jsx)("div",{className:j("animate-pulse rounded-md bg-muted",s),...t})}e_.displayName="CardContent";var eA=t(79419),eM=t(88623),ez=t(10269),eQ=t(3271),eG=t(10977),eU=t(40384),eV=t(90743),e$=t(96631),eH=t(91684),eJ=t(77329);function eB(e){let{icon:s,label:t,value:l}=e;return(0,r.jsx)(eI,{children:(0,r.jsxs)(e_,{className:"p-4 flex items-center gap-3",children:[(0,r.jsx)("div",{className:"text-primary",children:s}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:t}),(0,r.jsx)("div",{className:"font-bold text-lg",children:l})]})]})})}let eW=a.forwardRef((e,s)=>{let{className:t,type:l,...n}=e;return(0,r.jsx)("input",{type:l,className:j("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...n})});eW.displayName="Input";var eX=t(49289);let eY=(0,eX.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),e0=a.forwardRef((e,s)=>{let{className:t,variant:l,size:n,...a}=e;return(0,r.jsx)("button",{className:j(eY({variant:l,size:n,className:t})),ref:s,...a})});e0.displayName="Button";var e2=t(15134);t(23867);var e1=t(86332),e4=t.n(e1),e5=t(26598);let e3={component:"C",hook:"H",api:"A",store:"S",function:"F",class:"CL",interface:"I",enum:"E",type:"T",variable:"V",unknown:"?"},e6={graphNode:function(e){var s,t,l,n,a;let{data:i}=e,d=null!==(n=null!==(l=e3[i.nodeType])&&void 0!==l?l:null===(t=i.nodeType)||void 0===t?void 0:null===(s=t.charAt(0))||void 0===s?void 0:s.toUpperCase())&&void 0!==n?n:"?",o=null!==(a=i.layerColor)&&void 0!==a?a:"#6b7280",c=void 0!==i.highlighted,m=!0===i.highlighted;return(0,r.jsxs)("div",{className:"px-3 py-2 rounded-lg border-2 text-xs font-medium transition-opacity duration-200",style:{borderColor:o,backgroundColor:"color-mix(in srgb, ".concat(o," 8%, var(--background, #fff))"),boxShadow:m?"0 0 12px ".concat(o,", 0 0 4px ").concat(o):"0 1px 3px rgba(0,0,0,0.12)",opacity:c&&!m?.15:1},children:[(0,r.jsx)(e2.HH,{type:"target",position:e5.Ly.Top,style:{background:o}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded text-[10px] font-bold text-white flex-shrink-0",style:{backgroundColor:o},children:d}),(0,r.jsx)("span",{className:"truncate max-w-[140px]",children:i.label})]}),(0,r.jsx)(e2.HH,{type:"source",position:e5.Ly.Bottom,style:{background:o}})]})}};function e7(e){let{filterMode:s="highlight",searchQuery:t=""}=e;return(0,r.jsx)(e2.tV,{children:(0,r.jsx)(e8,{filterMode:s,searchQuery:t})})}function e8(e){let{filterMode:s,searchQuery:t}=e,{data:l}=(0,D.a)({queryKey:["layered-graph"],queryFn:()=>B()}),n=x(e=>e.selectNode),{fitView:i}=(0,e2._K)(),d=(0,a.useMemo)(()=>{if(!l)return{nodes:[],edges:[]};let e=(null!=t?t:"").toLowerCase().trim(),n="filter"===s&&e?l.nodes.filter(s=>s.name.toLowerCase().includes(e)):l.nodes.slice(0,300),r=e.length>0,a=n.map(s=>{var t,l;return{id:s.id,type:"graphNode",position:{x:0,y:0},data:{label:s.name,nodeType:s.type,layer:null!==(t=s.layer)&&void 0!==t?t:"Other",layerColor:null!==(l=s.layerColor)&&void 0!==l?l:"#6b7280",highlighted:r?s.name.toLowerCase().includes(e):void 0}}}),i=new Set(a.map(e=>e.id));return function(e,s){let t=new(e4()).graphlib.Graph;for(let s of(t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"TB",ranksep:80,nodesep:60}),e))t.setNode(s.id,{width:180,height:50});for(let e of s)t.setEdge(e.source,e.target);return e4().layout(t),{nodes:e.map(e=>{let s=t.node(e.id);return{...e,position:{x:s.x-90,y:s.y-25}}}),edges:s}}(a,l.edges.filter(e=>i.has(e.from)&&i.has(e.to)).slice(0,500).map((e,s)=>({id:"".concat(e.from,"->").concat(e.to,"-").concat(s),source:e.from,target:e.to,animated:!1,style:{stroke:"#4b5563"}})))},[l,t,s]),[o,c,m]=(0,e2.Rr)(d.nodes),[u,h,v]=(0,e2.ll)(d.edges);(0,a.useEffect)(()=>{c(d.nodes),h(d.edges)},[d,c,h]),(0,a.useEffect)(()=>{if(t){let e=d.nodes.find(e=>!0===e.data.highlighted);e&&setTimeout(()=>{i({nodes:[e],duration:500,maxZoom:1.5})},100)}},[t,d.nodes,i]);let j=(0,a.useCallback)((e,s)=>{n(s.id)},[n]);return(0,r.jsxs)(e2.x$,{nodes:o,edges:u,onNodesChange:m,onEdgesChange:v,onNodeClick:j,nodeTypes:e6,fitView:!0,children:[(0,r.jsx)(e2.Aq,{}),(0,r.jsx)(e2.ZX,{}),(0,r.jsx)(e2.a9,{nodeColor:e=>{var s;let t=null===(s=e.data)||void 0===s?void 0:s.layerColor;return null!=t?t:"#6b7280"}})]})}var e9=t(95731),se=t(38333),ss=t(57124),st=t(36673),sl=t(20054),sn=t(87354),sr=t(5025),sa=t(49767),si=t(6315),sd=t(10997),so=t(57431);let sc=so.fC;so.xz;let sm=so.h_;function sx(e){let{className:s,...t}=e;return(0,r.jsx)(so.aV,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ".concat(null!=s?s:""),...t})}function su(e){let{className:s,children:t,...l}=e;return(0,r.jsxs)(sm,{children:[(0,r.jsx)(sx,{}),(0,r.jsx)(so.VY,{className:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg ".concat(null!=s?s:""),...l,children:t})]})}function sh(e){let{className:s,...t}=e;return(0,r.jsx)("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left ".concat(null!=s?s:""),...t})}function sv(e){let{className:s,...t}=e;return(0,r.jsx)(so.Dx,{className:"text-lg font-semibold leading-none tracking-tight ".concat(null!=s?s:""),...t})}so.x8;let sj=["semantic","procedural","episodic","failure_lesson"];function sp(e){var s,t,l;let{open:n,onOpenChange:i,mode:d,defaultValues:o}=e,{t:c}=(0,P.$G)(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>es(e),onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),x=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>{let{id:s,updates:t}=e;return et(s,t)},onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),[u,h]=(0,a.useState)(null!==(s=null==o?void 0:o.category)&&void 0!==s?s:"semantic"),[v,j]=(0,a.useState)(null!==(t=null==o?void 0:o.content)&&void 0!==t?t:""),[p,f]=(0,a.useState)(null!==(l=null==o?void 0:o.scope)&&void 0!==l?l:"");(0,a.useEffect)(()=>{if(n){var e,s,t;h(null!==(e=null==o?void 0:o.category)&&void 0!==e?e:"semantic"),j(null!==(s=null==o?void 0:o.content)&&void 0!==s?s:""),f(null!==(t=null==o?void 0:o.scope)&&void 0!==t?t:"")}},[n,o]);let g=e=>{let s="memory.category.".concat(e),t=c(s);return t===s?e:t};return(0,r.jsx)(sc,{open:n,onOpenChange:i,children:(0,r.jsxs)(su,{children:[(0,r.jsx)(sh,{children:(0,r.jsx)(sv,{children:"add"===d?c("memory.addMemory"):c("memory.editMemory")})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.categoryLabel")}),(0,r.jsx)("select",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm",value:u,onChange:e=>h(e.target.value),children:sj.map(e=>(0,r.jsx)("option",{value:e,children:g(e)},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.content")}),(0,r.jsx)("textarea",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm min-h-[100px]",value:v,onChange:e=>j(e.target.value)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium",children:c("memory.scope")}),(0,r.jsx)("input",{className:"w-full mt-1 rounded-md border bg-background px-3 py-2 text-sm",value:p,onChange:e=>f(e.target.value)})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(e0,{variant:"outline",onClick:()=>i(!1),children:c("memory.cancel")}),(0,r.jsx)(e0,{onClick:()=>{v.trim()&&("add"===d?m.mutate({category:u,content:v.trim(),scope:p.trim()||void 0}):(null==o?void 0:o.id)&&x.mutate({id:o.id,updates:{category:u,content:v.trim(),scope:p.trim()||void 0}}),i(!1))},disabled:!v.trim(),children:c("memory.save")})]})]})]})})}let sf=["all","failure_lesson","semantic","procedural","episodic"];var sg=t(4343);let sy=sg.fC,sN=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sg.aV,{ref:s,className:j("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...l})});sN.displayName=sg.aV.displayName;let sb=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sg.xz,{ref:s,className:j("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...l})});sb.displayName=sg.xz.displayName;let sw=a.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,r.jsx)(sg.VY,{ref:s,className:j("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...l})});sw.displayName=sg.VY.displayName;var sk=t(74497),sS=t(12439);let sC=(0,eX.j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function sR(e){let{className:s,variant:t,...l}=e;return(0,r.jsx)("div",{className:j(sC({variant:t}),s),...l})}function sF(){let{t:e}=(0,P.$G)(),{data:s=[],isLoading:t,error:l}=(0,D.a)({queryKey:["benchmark-results"],queryFn:()=>eC()});if(t)return(0,r.jsx)("div",{children:e("benchmark.loading")});if(l||0===s.length)return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:e("benchmark.experimentSummary")})}),(0,r.jsx)(e_,{children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l?e("benchmark.loadFailed",{error:String(l)}):e("benchmark.noExperimentData")})})]});let n=s.reduce((e,s)=>{var t,l;return e+(null!==(l=null==s?void 0:null===(t=s.comparison)||void 0===t?void 0:t.timeSavedRate)&&void 0!==l?l:0)},0)/s.length,a=s.reduce((e,s)=>{var t,l;return e+(null!==(l=null==s?void 0:null===(t=s.comparison)||void 0===t?void 0:t.tokenReductionRate)&&void 0!==l?l:0)},0)/s.length;return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:e("benchmark.experimentSummary")})}),(0,r.jsxs)(e_,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.timeSavedRate")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[((null!=n?n:0)*100).toFixed(1),"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.tokenSavedRate")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[((null!=a?a:0)*100).toFixed(1),"%"]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h4",{className:"font-semibold",children:e("benchmark.detailedResults")}),s.map(s=>{var t,l,n,a,i,d,o,c,m,x,u,h;return(0,r.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"font-medium",children:s.scenarioId}),(0,r.jsx)(sR,{variant:(null!==(o=null==s?void 0:null===(t=s.comparison)||void 0===t?void 0:t.timeSavedRate)&&void 0!==o?o:0)>.3?"default":"secondary",children:e("benchmark.faster",{percent:((null!==(c=null==s?void 0:null===(l=s.comparison)||void 0===l?void 0:l.timeSavedRate)&&void 0!==c?c:0)*100).toFixed(0)})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("benchmark.baseline"),": "]}),(0,r.jsxs)("span",{children:[null!==(m=null==s?void 0:null===(n=s.baseline)||void 0===n?void 0:n.tokenCount)&&void 0!==m?m:0," tokens, ",((null!==(x=null==s?void 0:null===(a=s.baseline)||void 0===a?void 0:a.durationMs)&&void 0!==x?x:0)/1e3).toFixed(1),"s"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e("benchmark.devflow"),": "]}),(0,r.jsxs)("span",{children:[null!==(u=null==s?void 0:null===(i=s.devflow)||void 0===i?void 0:i.tokenCount)&&void 0!==u?u:0," tokens, ",((null!==(h=null==s?void 0:null===(d=s.devflow)||void 0===d?void 0:d.durationMs)&&void 0!==h?h:0)/1e3).toFixed(1),"s"]})]})]})]},s.scenarioId)})]})]})]})}function sT(){var e,s,t;let{t:l}=(0,P.$G)(),{data:n,isLoading:a,error:i}=eK(7);if(a)return(0,r.jsx)("div",{children:l("benchmark.loading")});if(i||!(null==n?void 0:n.overview))return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:l("benchmark.opsSummary")})}),(0,r.jsx)(e_,{children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:i?l("benchmark.loadFailed",{error:String(i)}):l("benchmark.noOpsData")})})]});let d=n.overview;return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:l("benchmark.opsSummary")})}),(0,r.jsx)(e_,{className:"space-y-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.totalRunsCount")}),(0,r.jsx)("p",{className:"text-2xl font-bold",children:null!==(e=null==d?void 0:d.totalRuns)&&void 0!==e?e:0})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.successRatePercent")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[(null!==(s=null==d?void 0:d.firstPassSuccessRate)&&void 0!==s?s:0).toFixed(1),"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:l("benchmark.avgDurationTime")}),(0,r.jsxs)("p",{className:"text-2xl font-bold",children:[((null!==(t=null==d?void 0:d.avgDuration)&&void 0!==t?t:0)/1e3).toFixed(1),"s"]})]})]})})]})}function sP(){var e;let{t:s}=(0,P.$G)(),{data:t=[],isLoading:l,error:n}=(e=localStorage.getItem("devflow-active-project-root")||void 0,(0,D.a)({queryKey:["plugin-effectiveness",e],queryFn:()=>eF(e)}));if(l)return(0,r.jsx)("div",{children:s("benchmark.loading")});if(n)return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:s("benchmark.pluginAnalysis")})}),(0,r.jsx)(e_,{children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("benchmark.loadFailed",{error:String(n)})})})]});let a=t.filter(e=>"install"===e.recommendation),i=t.filter(e=>"remove"===e.recommendation);return(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:s("benchmark.pluginAnalysis")})}),(0,r.jsxs)(e_,{className:"space-y-6",children:[a.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold mb-2 text-green-600",children:s("benchmark.recommendedInstall")}),(0,r.jsx)("div",{className:"space-y-2",children:a.map(e=>{var t,l,n;return(0,r.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsx)(sR,{variant:"default",children:s("benchmark.recommended")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[s("benchmark.installCount"),": ",e.installCount]}),(0,r.jsxs)("div",{children:[s("benchmark.usageRate"),": ",((null!==(t=null==e?void 0:e.activeRate)&&void 0!==t?t:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.successRateShort"),": ",((null!==(l=null==e?void 0:e.successRate)&&void 0!==l?l:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.tokenImpact"),": ",(null!==(n=null==e?void 0:e.avgTokenImpact)&&void 0!==n?n:0).toFixed(0)]})]}),e.lastUsedAt&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s("benchmark.lastUsed"),": ",new Date(e.lastUsedAt).toLocaleDateString()]})]},e.name)})})]}),i.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold mb-2 text-red-600",children:s("benchmark.suggestedRemove")}),(0,r.jsx)("div",{className:"space-y-2",children:i.map(e=>{var t,l;return(0,r.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsx)(sR,{variant:"destructive",children:s("benchmark.lowEfficiency")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[s("benchmark.installCount"),": ",e.installCount]}),(0,r.jsxs)("div",{children:[s("benchmark.usageRate"),": ",((null!==(t=null==e?void 0:e.activeRate)&&void 0!==t?t:0)*100).toFixed(0),"%"]}),(0,r.jsxs)("div",{children:[s("benchmark.successRateShort"),": ",((null!==(l=null==e?void 0:e.successRate)&&void 0!==l?l:0)*100).toFixed(0),"%"]})]})]},e.name)})})]}),0===t.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("benchmark.noPluginData")})]})]})}let sq=[7,14,30];function sK(e){let{label:s,value:t}=e;return(0,r.jsxs)("div",{className:"p-3 rounded-md bg-secondary/50",children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:s}),(0,r.jsx)("div",{className:"text-lg font-bold",children:t})]})}function sD(e){let{steps:s,events:t}=e,{t:l}=(0,P.$G)();return(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground mb-2",children:l("events.steps")}),s.map(e=>{let s=t.filter(s=>s.stepId===e),n=s.reduce((e,s)=>{var t;return e+(null!==(t=s.duration)&&void 0!==t?t:0)},0);return(0,r.jsxs)("div",{className:"text-xs py-1 px-2 rounded hover:bg-accent cursor-pointer",children:[(0,r.jsx)("div",{className:"font-medium truncate",children:e}),(0,r.jsxs)("div",{className:"text-muted-foreground",children:[s.length," ",l("events.eventCount")," \xb7 ",n,"ms"]})]},e)})]})}let sL={llm_call:"text-blue-500",tool_use:"text-green-500",memory_read:"text-pink-500",memory_write:"text-pink-500",file_read:"text-gray-500",file_write:"text-yellow-500",bash_command:"text-purple-500",subagent:"text-orange-500",skill_invoke:"text-cyan-500",mcp_tool_call:"text-indigo-500",error:"text-red-500",user_input:"text-orange-500",step_start:"text-cyan-500",step_end:"text-cyan-500"},sI={llm_call:"events.llmCall",tool_use:"events.toolUse",memory_read:"events.memoryRead",memory_write:"events.memoryWrite",file_read:"events.fileRead",file_write:"events.fileWrite",bash_command:"events.bashCommand",subagent:"events.subagent",skill_invoke:"events.skillInvoke",mcp_tool_call:"events.mcpToolCall",error:"events.error",user_input:"events.userInput",step_start:"events.stepStart",step_end:"events.stepEnd"};function sZ(e){let{events:s,onSelect:t,selectedId:l}=e,{t:n}=(0,P.$G)(),a=[...s].sort((e,s)=>e.timestamp-s.timestamp);if(0===a.length)return(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:n("events.empty")});let i="";return(0,r.jsx)("div",{className:"space-y-0",children:a.map(e=>{var s,a,d,o,c,m,x,u;let h=e.stepId!==i;i=e.stepId;let v=null!==(u=sL[e.kind])&&void 0!==u?u:"text-muted-foreground",j=sI[e.kind],p=j?n(j):e.kind,f=(null===(s=e.data)||void 0===s?void 0:s.toolName)||(null===(a=e.data)||void 0===a?void 0:a.filePath)||(null===(d=e.data)||void 0===d?void 0:d.model)||(null===(o=e.data)||void 0===o?void 0:o.command)||(null===(c=e.data)||void 0===c?void 0:c.memoryKey)||"";return(0,r.jsxs)("div",{children:[h&&(0,r.jsx)("div",{className:"text-xs font-semibold text-muted-foreground pt-2 pb-1 border-t border-border mt-1",children:e.stepId}),(0,r.jsxs)("div",{onClick:()=>t(e),className:"flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer text-xs hover:bg-accent ".concat(l===e.id?"bg-accent":""," ").concat((null===(m=e.metadata)||void 0===m?void 0:m.blocked)?"border-l-2 border-red-500 bg-red-50 dark:bg-red-950":""),children:[(null===(x=e.metadata)||void 0===x?void 0:x.blocked)&&(0,r.jsx)("span",{className:"text-red-500 font-bold text-[10px] uppercase tracking-wider",children:"BLOCKED"}),(0,r.jsx)("span",{className:"w-16 ".concat(v," font-medium"),children:p}),(0,r.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:f}),e.duration?(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e.duration,"ms"]}):null]})]},e.id)})})}function sE(e){let{event:s}=e,[t,l]=(0,a.useState)(!1),n=s.input?JSON.stringify(s.input,null,2):"null",i=s.output?JSON.stringify(s.output,null,2):"null";return(0,r.jsxs)("div",{className:"space-y-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-lg",children:s.mcpToolName||s.toolName}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s.toolType," \xb7 ",s.kind," \xb7 ",s.duration,"ms",s.blocked&&(0,r.jsx)("span",{className:"text-red-500 ml-2 font-bold",children:"BLOCKED"})]})]}),(0,r.jsx)("button",{onClick:()=>l(!t),className:"text-xs border rounded px-2 py-1 hover:bg-accent",children:t?"Formatted":"Raw JSON"})]}),s.error&&(0,r.jsx)("div",{className:"p-3 bg-red-50 dark:bg-red-950 border border-red-300 rounded text-sm text-red-700",children:s.error}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,r.jsxs)(eI,{className:"p-3",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Input"}),(0,r.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(t?"":"max-h-40 overflow-hidden"),children:(0,r.jsx)("code",{children:t?n:n.slice(0,500)+(n.length>500?"\n... (truncated)":"")})})]}),(0,r.jsxs)(eI,{className:"p-3",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Output"}),null==s.output?(0,r.jsx)("p",{className:"text-xs text-yellow-600",children:"No output captured for this event"}):(0,r.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(t?"":"max-h-40 overflow-hidden"),children:(0,r.jsx)("code",{children:t?i:i.slice(0,500)+(i.length>500?"\n... (truncated)":"")})})]})]})]})}function s_(e){var s,t;let{event:l}=e,{t:n}=(0,P.$G)();if(!l)return(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:n("events.selectEvent")});if("tool_use"===l.kind&&(l.toolName||l.mcpToolName))return(0,r.jsx)(sE,{event:l});let a=null!==(t=l.data)&&void 0!==t?t:{};return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:n("events.eventDetail")}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.kind")}),(0,r.jsx)("div",{className:"text-sm font-medium",children:l.kind})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.step")}),(0,r.jsx)("div",{className:"text-sm font-mono",children:l.stepId})]}),null!=l.duration&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.duration")}),(0,r.jsxs)("div",{className:"text-sm",children:[l.duration,"ms"]})]}),null!=a.inputTokens&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.tokens")}),(0,r.jsx)("div",{className:"text-sm",children:n("events.tokensInOut",{input:a.inputTokens,output:a.outputTokens})})]}),null!=a.prompt&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.prompt")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.prompt})]}),null!=a.response&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.response")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.response})]}),null!=a.stdout&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.stdout")}),(0,r.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.stdout})]}),null!=a.stderr&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.stderr")}),(0,r.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.stderr})]}),null!=a.errorMessage&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:n("events.error")}),(0,r.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:a.errorMessage})]}),(null===(s=l.metadata)||void 0===s?void 0:s.truncated)!=null&&(0,r.jsx)("div",{className:"text-xs text-yellow-500",children:n("events.truncated")})]})]})}var sO=t(61883);function sA(e){let{runId:s,onBack:t}=e,{t:l}=(0,P.$G)(),{data:n}=(0,D.a)({queryKey:["session-events",s],queryFn:()=>eh(s),enabled:!!s}),{data:i}=(0,D.a)({queryKey:["session",s],queryFn:()=>eu(s),enabled:!!s}),[d,o]=(0,a.useState)(null),c=(null!=n?n:[]).map(e=>{var s,t,l,n,r,a,i;let d=null!==(t=null!==(s=e.eventId)&&void 0!==s?s:e.id)&&void 0!==t?t:"",o=(null!==(l=e.kind)&&void 0!==l?l:e.toolType)||"tool_use",c={toolName:null!==(n=e.toolName)&&void 0!==n?n:e.mcpToolName,...null!==(r=e.input)&&void 0!==r?r:{}};return{id:d,stepId:null!==(a=e.executionId)&&void 0!==a?a:d,kind:o,timestamp:null!==(i=e.timestamp)&&void 0!==i?i:0,duration:e.duration,data:c,metadata:{isMcpTool:e.isMcpTool,mcpEnforced:e.mcpEnforced,mcpFallback:e.mcpFallback,blocked:e.blocked,blockReason:e.blockReason}}}),m=[...new Set(c.map(e=>e.stepId))],x=null!=i?i:{};return(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,r.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sO.Z,{className:"h-4 w-4"})}),(0,r.jsx)("h2",{className:"text-lg font-bold",children:l("runDetail.title","Session Detail")}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:s}),null!=x.totalToolCalls&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[String(x.totalToolCalls)," tools \xb7 ",String(x.mcpToolCalls)," MCP"]})]}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,r.jsx)("div",{className:"w-48 border-r border-border overflow-y-auto p-3",children:(0,r.jsx)(sD,{steps:m,events:c})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:(0,r.jsx)(sZ,{events:c,onSelect:e=>o(e),selectedId:null==d?void 0:d.id})}),(0,r.jsx)("div",{className:"w-80 border-l border-border overflow-y-auto p-3",children:(0,r.jsx)(s_,{event:d})})]})]})}let sM={active:"text-yellow-500",closed:"text-green-500"},sz={cli:"#3b82f6",mcp:"#22c55e",dashboard:"#a855f7"};function sQ(e){let{runs:s,date:t}=e,l=new Date(t+"T00:00:00Z").getTime(),n=Math.max(28*s.length+40,120),a=[0,4,8,12,16,20,24].map(e=>({hour:e,x:40+e/24*720,label:"".concat(String(e).padStart(2,"0"),":00")}));return(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("svg",{viewBox:"0 0 ".concat(800," ").concat(n),className:"w-full",children:[a.map(e=>(0,r.jsxs)("g",{children:[(0,r.jsx)("line",{x1:e.x,y1:0,x2:e.x,y2:n,stroke:"#e5e7eb",strokeWidth:.5}),(0,r.jsx)("text",{x:e.x,y:12,textAnchor:"middle",fontSize:"9",fill:"#9ca3af",children:e.label})]},e.hour)),s.map((e,s)=>{var t;let n=40+(e.startedAt-l)/864e5*720,a=Math.max(40,e.tokenUsed/500),i=40+28*s,d=null!==(t=sz[e.source])&&void 0!==t?t:"#6b7280",o="completed"===e.status?.9:"failed"===e.status?.6:.4;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:n,y:i,width:a,height:20,rx:3,fill:d,opacity:o}),(0,r.jsx)("text",{x:n+a+4,y:i+13,fontSize:"10",fill:"#6b7280",children:new Date(e.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),a>60&&(0,r.jsxs)("text",{x:n+4,y:i+13,fontSize:"9",fill:"white",fontWeight:"500",children:[e.agent," \xb7 ",e.source]})]},e.id)})]})})}var sG=t(58410),sU=t(2966),sV=t(97066),s$=t(53512);function sH(e){let{rate:s}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-20 h-2 bg-muted rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full ".concat(s>=80?"bg-green-500":s>=50?"bg-yellow-500":"bg-red-500"," rounded-full"),style:{width:"".concat(s,"%")}})}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.toFixed(1),"%"]})]})}let sJ={overview:function(){var e;let{t:s}=(0,P.$G)(),{data:t}=(0,D.a)({queryKey:["active-project"],queryFn:()=>Q()}),l=x(e=>e.projectRoot),n=x(e=>e.setProjectRoot),i=x(e=>e.activeProjectRoot),d=x(e=>e.setActiveProjectRoot),[o,c]=(0,a.useState)(""),[m,u]=(0,a.useState)(""),[h,v]=(0,a.useState)(!1),j=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>M(e),onSuccess:()=>e.invalidateQueries({queryKey:["active-project"]})})}(),p=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:()=>z(),onSuccess:()=>e.invalidateQueries({queryKey:["active-project"]})})}();(0,a.useEffect)(()=>{(null==t?void 0:t.rootPath)&&t.rootPath!==i&&(n(t.rootPath),d(t.rootPath))},[t,n,d,i]);let[f,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{f||(null==t?void 0:t.rootPath)||!i||j.isPending||(g(!0),j.mutate(i))},[null==t?void 0:t.rootPath,i,j.isPending,f]);let{data:y}=(0,D.a)({queryKey:["projects"],queryFn:()=>A()}),{data:N}=(0,D.a)({queryKey:["context-status"],queryFn:()=>U()}),{data:b}=eT(),{data:w}=eP(10,0),{data:k,isLoading:S}=(0,D.a)({queryKey:["onboarding-pack",i],queryFn:()=>G(i),enabled:!!i}),C=null==y?void 0:y.find(e=>e.rootPath===i),R=()=>{if((null==C?void 0:C.stack)&&C.stack.length>0)return C.stack;if(null==k?void 0:k.stack){let e=[...k.stack.languages,...k.stack.frameworks,...k.stack.buildTools,...k.stack.testTools];if(e.length>0)return e}return[]},F=()=>{o.trim()&&j.mutate(o.trim(),{onSuccess:e=>{n(e.rootPath),d(e.rootPath)}})},T=()=>{m.trim()&&j.mutate(m.trim(),{onSuccess:e=>{n(e.rootPath),d(e.rootPath),v(!1),u("")}})};return l?(0,r.jsxs)("div",{className:"p-6 space-y-6 overflow-y-auto h-full",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:s("overview.title")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-1 rounded font-mono",children:l}),(0,r.jsx)("button",{onClick:()=>v(!h),className:"p-1 rounded hover:bg-secondary text-muted-foreground",title:s("overview.switchProject"),children:(0,r.jsx)(eM.Z,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{p.mutate(void 0,{onSuccess:()=>{n(null),d(null)}})},className:"p-1 rounded hover:bg-secondary text-muted-foreground",title:s("overview.disconnectProject"),children:(0,r.jsx)(ez.Z,{className:"h-4 w-4"})})]})]}),h&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-card",children:[(0,r.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&T(),"Escape"===e.key&&(v(!1),u(""))},placeholder:s("overview.switchProjectPlaceholder"),className:"flex-1 px-3 py-1.5 rounded-md border border-border bg-background text-sm"}),(0,r.jsx)("button",{onClick:T,disabled:j.isPending||!m.trim(),className:"px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm disabled:opacity-50",children:j.isPending?s("overview.connecting"):s("overview.switchProjectConfirm")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(eB,{icon:(0,r.jsx)(eQ.Z,{className:"h-5 w-5"}),label:s("overview.project"),value:(null==C?void 0:C.name)?C.name:(null==k?void 0:k.projectName)?k.projectName:i&&null!==(e=i.split("/").pop())&&void 0!==e?e:"Unknown Project"}),(0,r.jsx)(eB,{icon:(0,r.jsx)(eG.Z,{className:"h-5 w-5"}),label:s("overview.filesIndexed"),value:N?String(N.totalFiles):"--"}),(0,r.jsx)(eB,{icon:(0,r.jsx)(eU.Z,{className:"h-5 w-5"}),label:s("overview.workflows"),value:b?String(b.length):"--"}),(0,r.jsx)(eB,{icon:(0,r.jsx)(eV.Z,{className:"h-5 w-5"}),label:s("overview.agentRuns"),value:w?String(w.length):"--"})]}),R().length>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:s("overview.techStack")})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:R().map(e=>(0,r.jsx)("span",{className:"px-2 py-1 rounded-md bg-secondary text-secondary-foreground text-xs",children:e},e))})})]}),S?(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(e$.Z,{className:"h-4 w-4"}),s("onboarding.title")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)(eO,{className:"h-32 w-full"})})]}):k?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(e$.Z,{className:"h-4 w-4"}),s("overview.architectureLayers")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.architectureLayers.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-0.5 rounded",children:s("overview.filesCount",{count:e.files})})]},e.name))})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eH.Z,{className:"h-4 w-4"}),s("overview.keyModules")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.keyModules.slice(0,6).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-mono text-primary",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e.reason})]},e.name))})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eG.Z,{className:"h-4 w-4"}),s("overview.keyFiles")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:k.keyFiles.slice(0,6).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-mono truncate",children:e.path}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e.reason})]},e.path))})})]})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eJ.Z,{className:"h-4 w-4"}),s("overview.recommended")]})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.plugins")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:k.recommendedPlugins.map(e=>(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-green-100 text-green-800 text-xs",children:e},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.workflows")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:k.recommendedWorkflows.map(e=>(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-blue-100 text-blue-800 text-xs",children:e},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground mb-2 uppercase",children:s("overview.queries")}),(0,r.jsx)("div",{className:"space-y-1",children:k.recommendedQueries.slice(0,3).map(e=>(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:['"',e,'"']},e))})]})]})})]})]}):(0,r.jsx)(eI,{children:(0,r.jsx)(e_,{className:"py-8 text-center text-muted-foreground",children:s("onboarding.empty")})}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:s("overview.recentRuns")})}),(0,r.jsx)(e_,{children:w&&w.length>0?(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:s("overview.label")}),(0,r.jsx)("th",{children:s("overview.status")}),(0,r.jsx)("th",{children:s("overview.toolCalls")}),(0,r.jsx)("th",{children:s("overview.duration")})]})}),(0,r.jsx)("tbody",{children:w.slice(0,5).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1",children:e.label||e.projectRoot}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat("closed"===e.status?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"),children:e.status})}),(0,r.jsxs)("td",{children:[e.totalToolCalls," (",e.mcpToolCalls," MCP)"]}),(0,r.jsx)("td",{children:e.durationMs>0?"".concat((e.durationMs/1e3).toFixed(1),"s"):"--"})]},e.id))})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:s("overview.noRuns")})})]})]}):(0,r.jsx)("div",{className:"p-6 flex items-center justify-center h-full",children:(0,r.jsxs)(eI,{className:"w-full max-w-md",children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eA.Z,{className:"h-5 w-5"}),s("overview.connectTitle")]})}),(0,r.jsxs)(e_,{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s("overview.connectDescription")}),(0,r.jsx)("input",{type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&F(),placeholder:s("overview.connectPlaceholder"),className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm"}),(0,r.jsx)("button",{onClick:F,disabled:j.isPending||!o.trim(),className:"w-full px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-50",children:j.isPending?s("overview.connecting"):s("overview.connect")}),j.isError&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:s("overview.connectError")})]})]})})},graph:function(){let{t:e}=(0,P.$G)(),s=x(e=>e.searchQuery),t=x(e=>e.setSearchQuery),[l,n]=(0,a.useState)("highlight");return(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)("div",{className:"p-3 border-b border-border flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1 max-w-sm",children:[(0,r.jsx)(e9.Z,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,r.jsx)(eW,{placeholder:e("graph.searchPlaceholder"),value:s,onChange:e=>t(e.target.value),className:"pl-8"})]}),s&&(0,r.jsx)(e0,{variant:"ghost",size:"sm",onClick:()=>n(e=>"highlight"===e?"filter":"highlight"),title:e("highlight"===l?"graph.filterOnly":"graph.highlightAll"),className:"flex-shrink-0",children:"highlight"===l?(0,r.jsx)(se.Z,{className:"h-4 w-4"}):(0,r.jsx)(ss.Z,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(e7,{filterMode:l,searchQuery:s})})]})},context:function(){let{t:e}=(0,P.$G)(),[s,t]=(0,a.useState)(""),[l,n]=(0,a.useState)(!1),[i,d]=(0,a.useState)({}),o=x(e=>e.activeProjectRoot),c=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>V(e),onSuccess:s=>e.setQueryData(["context-result"],s)})}(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>$(e),onSuccess:s=>e.setQueryData(["task-context-result"],s)})}(),{data:u}=(0,D.a)({queryKey:["context-result"],queryFn:()=>Promise.reject(Error("No queryFn — this query is never enabled")),enabled:!1}),{data:h}=(0,D.a)({queryKey:["task-context-result"],queryFn:()=>Promise.reject(Error("No queryFn — this query is never enabled")),enabled:!1}),v=(0,I.D)({mutationFn:e=>H(e)}),j=l?h:u,p=l?m.isPending:c.isPending,f=()=>{s.trim()&&(d({}),l?m.mutate({query:s,mode:"fast"}):c.mutate({query:s,mode:"fast"}))},g=e=>{s.trim()&&(d({[s]:e}),v.mutate({query:s,feedback:e,projectRoot:null!=o?o:void 0,taskType:l&&h?h.taskType:void 0,contextMode:l?"task":"general",tokenCount:null==j?void 0:j.tokenCount}))};return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("context.title")}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("input",{type:"checkbox",checked:l,onChange:e=>n(e.target.checked),className:"rounded"}),e("context.taskMode")]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(eW,{placeholder:e("context.placeholder"),value:s,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&f()}),(0,r.jsxs)(e0,{onClick:f,disabled:p,children:[(0,r.jsx)(e9.Z,{className:"h-4 w-4 mr-1"})," ",e("context.build")]})]}),p&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("context.building")}),j&&(0,r.jsxs)(r.Fragment,{children:[!l&&u&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:e("context.results",{files:u.files.length,tokens:u.tokenCount})})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-3",children:u.files.map((e,s)=>(0,r.jsxs)("div",{className:"p-3 rounded-md bg-secondary/50",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.path}),(0,r.jsx)("pre",{className:"text-xs mt-1 overflow-x-auto whitespace-pre-wrap",children:e.snippet})]},s))})})]}),l&&h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eI,{children:(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{children:[e("context.taskContext"),": ",h.taskType]}),(0,r.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:e("context.confidenceTokens",{confidence:(100*h.confidence).toFixed(0),tokens:h.tokenCount})})]})})}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(st.Z,{className:"h-4 w-4"}),e("context.requiredFiles")," (",h.requiredFiles.files.length,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-1",children:h.requiredFiles.files.map(e=>(0,r.jsxs)("div",{className:"text-sm font-mono text-green-700 dark:text-green-400",children:["● ",e]},e))})})]}),h.optionalFiles.files.length>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(st.Z,{className:"h-4 w-4"}),e("context.optionalFiles")," (",h.optionalFiles.files.length,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-1",children:h.optionalFiles.files.map(e=>(0,r.jsxs)("div",{className:"text-sm font-mono text-muted-foreground",children:["○ ",e]},e))})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{children:[e("context.keySymbols")," (",h.keySymbols.length,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.keySymbols.slice(0,10).map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded ".concat("direct"===s.relevance?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"),children:"direct"===s.relevance?e("context.relevanceDirect"):e("context.relevanceIndirect")}),(0,r.jsx)("span",{className:"text-sm font-medium",children:s.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",s.kind,")"]}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono ml-auto",children:s.file})]},"".concat(s.file,":").concat(s.name)))})})]}),h.riskHints.length>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(sl.Z,{className:"h-4 w-4"}),e("context.riskHints")," (",h.riskHints.length,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.riskHints.map((s,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ".concat("high"===s.level?"bg-red-100 text-red-700":"medium"===s.level?"bg-yellow-100 text-yellow-700":"bg-gray-100 text-gray-600"),children:"high"===s.level?e("context.levelHigh"):"medium"===s.level?e("context.levelMedium"):e("context.levelLow")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:s.category}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:s.description})]})]},t))})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eJ.Z,{className:"h-4 w-4"}),e("context.nextActions")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:h.nextActions.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 text-xs",children:e.kind}),(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:e.payload})]},s))})})]})]}),j&&(0,r.jsx)(eI,{children:(0,r.jsx)(e_,{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-sm text-muted-foreground mr-2",children:e("context.wasHelpful")}),(0,r.jsxs)(e0,{size:"sm",variant:"hit"===i[s]?"default":"outline",onClick:()=>g("hit"),disabled:v.isPending,children:[(0,r.jsx)(sn.Z,{className:"h-3 w-3 mr-1"})," ",e("context.hit")]}),(0,r.jsxs)(e0,{size:"sm",variant:"partial"===i[s]?"default":"outline",onClick:()=>g("partial"),disabled:v.isPending,children:[(0,r.jsx)(sr.Z,{className:"h-3 w-3 mr-1"})," ",e("context.partial")]}),(0,r.jsxs)(e0,{size:"sm",variant:"miss"===i[s]?"default":"outline",onClick:()=>g("miss"),disabled:v.isPending,children:[(0,r.jsx)(ez.Z,{className:"h-3 w-3 mr-1"})," ",e("context.miss")]}),v.isSuccess&&(0,r.jsx)("span",{className:"text-xs text-green-600 ml-2",children:e("context.thanks")})]})})})]})]})},workflows:function(){let{t:e}=(0,P.$G)(),{data:s}=eT(),{data:t}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,D.a)({queryKey:["workflow-runs",e,s],queryFn:()=>Y(e,s)})}(),l=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>{let{type:s,input:t}=e;return X(s,t)},onSuccess:()=>e.invalidateQueries({queryKey:["workflow-runs"]})})}(),[n,i]=(0,a.useState)(null),{events:d,clear:o}=function(e){let[s,t]=(0,a.useState)([]),l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var s;if(!e)return;let n=new EventSource("".concat(null!==(s=sa.env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==s?s:"http://localhost:13337","/api/workflows/runs/").concat(e,"/stream"));l.current=n;let r=e=>{try{t(s=>[...s,{type:e.type,data:JSON.parse(e.data)}])}catch(e){}};return n.addEventListener("step-started",r),n.addEventListener("step-completed",r),n.addEventListener("step-failed",r),n.addEventListener("error",()=>n.close()),()=>n.close()},[e]),{events:s,clear:(0,a.useCallback)(()=>t([]),[])}}(n);return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("workflows.title")}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:e("workflows.available")})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:(null!=s?s:[]).map(s=>(0,r.jsxs)(e0,{variant:"outline",size:"sm",onClick:()=>l.mutate({type:s.name},{onSuccess:e=>i(e.runId)}),children:[s.name," (",s.stepCount," ",e("workflows.steps"),")"]},s.name))})})]}),n&&d.length>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{children:[e("workflows.stream"),": ",n]})}),(0,r.jsxs)(e_,{children:[(0,r.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto font-mono text-xs",children:d.map((e,s)=>(0,r.jsxs)("div",{className:"text-muted-foreground",children:["[",e.type,"] ",JSON.stringify(e.data)]},s))}),(0,r.jsx)(e0,{variant:"ghost",size:"sm",onClick:()=>{i(null),o()},className:"mt-2",children:e("workflows.closeStream")})]})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:e("workflows.runHistory")})}),(0,r.jsx)(e_,{children:t&&t.length>0?(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:e("workflows.runId")}),(0,r.jsx)("th",{children:e("overview.status")}),(0,r.jsx)("th",{children:e("workflows.started")})]})}),(0,r.jsx)("tbody",{children:t.slice(0,10).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono text-xs",children:e.runId}),(0,r.jsx)("td",{children:e.status}),(0,r.jsx)("td",{children:new Date(e.startedAt).toLocaleTimeString()})]},e.runId))})]}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:e("workflows.noRuns")})})]})]})},memory:function(){var e,s,t,l,n,i;let{t:d}=(0,P.$G)(),{data:o}=(0,D.a)({queryKey:["memory"],queryFn:()=>ee()}),{data:c}=(0,D.a)({queryKey:["ollama-status"],queryFn:()=>ei(),refetchInterval:3e4}),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>en(e),onSuccess:()=>{e.invalidateQueries({queryKey:["memory"]}),e.invalidateQueries({queryKey:["memory-candidates"]})}})}(),x=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>er(e),onSuccess:()=>{e.invalidateQueries({queryKey:["memory"]}),e.invalidateQueries({queryKey:["memory-candidates"]})}})}(),u=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>el(e),onSuccess:()=>e.invalidateQueries({queryKey:["memory"]})})}(),h=function(){let{t:e}=(0,P.$G)();return s=>{let t="memory.category.".concat(s),l=e(t);return l===t?s:l}}(),[v,j]=(0,a.useState)(""),{data:p}=(0,D.a)({queryKey:["memory-search",v,void 0],queryFn:()=>ea(v,null==i?void 0:i.limit,null==i?void 0:i.categories),enabled:v.length>0}),[f,g]=(0,a.useState)(!1),[y,N]=(0,a.useState)(),[b,w]=(0,a.useState)("all"),k=null!==(t=null==o?void 0:null===(e=o.memories)||void 0===e?void 0:e.filter(e=>"approved"===e.status))&&void 0!==t?t:[],S=null!==(l=null==o?void 0:null===(s=o.memories)||void 0===s?void 0:s.filter(e=>"pending"===e.status))&&void 0!==l?l:[],C="all"===b?k:k.filter(e=>e.category===b),R="all"===b?S:S.filter(e=>e.category===b),F=(0,a.useMemo)(()=>{let e=new Map;for(let t of R){var s;let l=null!==(s=e.get(t.category))&&void 0!==s?s:[];l.push(t),e.set(t.category,l)}return[...e.entries()].sort((e,s)=>{let[t]=e,[l]=s;return"failure_lesson"===t?-1:"failure_lesson"===l?1:t.localeCompare(l)})},[R]),T=v&&p?p:C,q=e=>{var s;N({id:e.id,category:e.category,content:e.content,scope:null!==(s=e.scope)&&void 0!==s?s:""}),g(!0)},K=e=>{window.confirm(d("memory.deleteConfirm"))&&u.mutate(e.id)};return o?(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:d("memory.title")}),(0,r.jsxs)(e0,{size:"sm",onClick:()=>{N(void 0),g(!0)},children:["+ ",d("memory.addMemory")]})]}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(eW,{placeholder:d("memory.searchPlaceholder"),value:v,onChange:e=>j(e.target.value)})}),!v&&(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:sf.map(e=>(0,r.jsx)(e0,{variant:b===e?"default":"outline",size:"sm",onClick:()=>w(e),children:"all"===e?d("memory.allCategories","All"):h(e)},e))}),c&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:d("memory.ollamaStatus")})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("div",{className:"text-sm space-y-1",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.installed"),":"]}),(0,r.jsx)("span",{className:c.installed?"text-green-500":"text-red-500",children:c.installed?d("memory.yes"):d("memory.no")})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.running"),":"]}),(0,r.jsx)("span",{className:c.running?"text-green-500":"text-red-500",children:c.running?d("memory.yes"):d("memory.no")})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{children:[d("memory.model")," (",c.modelName,"):"]}),(0,r.jsx)("span",{className:c.modelAvailable?"text-green-500":"text-yellow-500",children:c.modelAvailable?d("memory.available"):d("memory.notPulled")})]}),c.infoMessage&&(0,r.jsx)("p",{className:"text-yellow-500 text-xs mt-2",children:c.infoMessage})]})})]}),!v&&R.length>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{children:[d("memory.pendingApproval")," (",R.length,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-4",children:F.map(e=>{let[s,t]=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-2",children:h(s)}),(0,r.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,r.jsxs)("div",{className:"flex items-start justify-between p-2 rounded bg-secondary/50",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate",children:e.content}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d("memory.confidence"),": ",e.confidence]})]}),(0,r.jsxs)("div",{className:"flex gap-1 ml-2",children:[(0,r.jsx)(e0,{size:"sm",variant:"outline",onClick:()=>m.mutate(e.id),children:d("memory.approve")}),(0,r.jsx)(e0,{size:"sm",variant:"ghost",onClick:()=>x.mutate(e.id),children:d("memory.reject")})]})]},e.id))})]},s)})})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{children:v?"".concat(null!==(n=null==p?void 0:p.length)&&void 0!==n?n:0," results"):"".concat(d("memory.approvedMemories")," (").concat(C.length,")")})}),(0,r.jsx)(e_,{children:0===T.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg text-center",children:[(0,r.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:d("memory.noMemories")}),(0,r.jsx)("p",{className:"text-muted-foreground text-xs mt-1",children:d("memory.noMemoriesHint")})]}):(0,r.jsx)("div",{className:"space-y-2",children:T.map(e=>(0,r.jsxs)("div",{className:"p-2 rounded bg-secondary/50 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsx)("span",{className:"flex-1",children:e.content}),(0,r.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h(e.category)}),(0,r.jsx)(e0,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>q(e),title:d("memory.editMemory"),children:(0,r.jsx)(si.Z,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(e0,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive",onClick:()=>K(e),title:d("memory.deleteMemory"),children:(0,r.jsx)(sd.Z,{className:"h-3.5 w-3.5"})})]})]}),e.originalText&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:[d("memory.original"),": ",e.originalText]})]},e.id))})})]}),(0,r.jsx)(sp,{open:f,onOpenChange:g,mode:y?"edit":"add",defaultValues:y})]}):(0,r.jsx)("div",{className:"p-6 text-muted-foreground",children:d("memory.loading")})},benchmark:function(){var e,s,t,l,n,i,d,o,c,m,x,u,h,v,j,p,f,g,y,N,b,w,k,R,q;let{t:K}=(0,P.$G)(),[D,L]=(0,a.useState)(7),{data:I,isLoading:Z}=eK(D);return Z||!I?(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:K("benchmark.roiTitle")}),(0,r.jsx)("p",{className:"text-muted-foreground",children:Z?K("benchmark.loading"):K("benchmark.noData")})]}):(0,r.jsxs)("div",{className:"p-6 space-y-6 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:K("benchmark.roiTitle")}),(0,r.jsx)("div",{className:"flex gap-1",children:sq.map(e=>(0,r.jsxs)(e0,{size:"sm",variant:e===D?"default":"outline",onClick:()=>L(e),children:[e,"d"]},e))})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:K("benchmark.period",{from:I.period.from,to:I.period.to})}),(0,r.jsxs)(sy,{defaultValue:"experiment",className:"space-y-6",children:[(0,r.jsxs)(sN,{children:[(0,r.jsxs)(sb,{value:"experiment",children:[(0,r.jsx)(sk.Z,{className:"h-4 w-4 mr-2"}),K("benchmark.experimentTab","实验收益")]}),(0,r.jsxs)(sb,{value:"operations",children:[(0,r.jsx)(T.Z,{className:"h-4 w-4 mr-2"}),K("benchmark.operationsTab","运行治理")]})]}),(0,r.jsxs)(sw,{value:"experiment",className:"space-y-4",children:[(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(sS.Z,{className:"h-4 w-4"}),K("benchmark.efficiency")]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"grid grid-cols-3 gap-4",children:(0,r.jsx)(sK,{label:K("benchmark.avgTimePerTask"),value:"".concat(((null!==(u=null==I?void 0:null===(e=I.efficiency)||void 0===e?void 0:e.avgTimePerTask)&&void 0!==u?u:0)/1e3).toFixed(1),"s")})})})]}),(null!==(h=null==I?void 0:null===(s=I.plugins)||void 0===s?void 0:s.length)&&void 0!==h?h:0)>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(eV.Z,{className:"h-4 w-4"}),K("benchmark.pluginEffectiveness")]})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.plugin")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.successRate")})]})}),(0,r.jsx)("tbody",{children:(null!==(v=null==I?void 0:I.plugins)&&void 0!==v?v:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono",children:e.name}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsxs)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(e.successRate>=.8?"bg-green-100 text-green-700":e.successRate>=.5?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"),children:[e.successRate.toFixed(0),"%"]})})]},e.name))})]})})]}),(0,r.jsx)(sF,{})]}),(0,r.jsxs)(sw,{value:"operations",className:"space-y-4",children:[(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(C.Z,{className:"h-4 w-4"}),K("benchmark.overview")]})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,r.jsx)(sK,{label:K("benchmark.totalRuns"),value:null!==(j=null==I?void 0:null===(t=I.overview)||void 0===t?void 0:t.totalRuns)&&void 0!==j?j:0}),(0,r.jsx)(sK,{label:K("benchmark.completed"),value:null!==(p=null==I?void 0:null===(l=I.overview)||void 0===l?void 0:l.completedRuns)&&void 0!==p?p:0}),(0,r.jsx)(sK,{label:K("benchmark.failed"),value:null!==(f=null==I?void 0:null===(n=I.overview)||void 0===n?void 0:n.failedRuns)&&void 0!==f?f:0}),(0,r.jsx)(sK,{label:K("benchmark.avgDuration"),value:"".concat(((null!==(g=null==I?void 0:null===(i=I.overview)||void 0===i?void 0:i.avgDuration)&&void 0!==g?g:0)/1e3).toFixed(1),"s")}),(0,r.jsx)(sK,{label:K("benchmark.firstPassRate"),value:"".concat((null!==(y=null==I?void 0:null===(d=I.overview)||void 0===d?void 0:d.firstPassSuccessRate)&&void 0!==y?y:0).toFixed(0),"%")})]})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(sl.Z,{className:"h-4 w-4"}),K("benchmark.failureBreakdown")," (",null!==(N=null==I?void 0:null===(o=I.failures)||void 0===o?void 0:o.total)&&void 0!==N?N:0,")"]})}),(0,r.jsx)(e_,{children:(0,r.jsx)("div",{className:"space-y-2",children:Object.entries(null!==(b=null==I?void 0:null===(c=I.failures)||void 0===c?void 0:c.breakdown)&&void 0!==b?b:{}).map(e=>{var s,t,l,n;let[a,i]=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm capitalize",children:K("benchmark.failureCategories.".concat(a))}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-32 h-2 bg-secondary rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-red-500 rounded-full",style:{width:"".concat((null!==(l=null==I?void 0:null===(s=I.failures)||void 0===s?void 0:s.total)&&void 0!==l?l:0)>0?i/(null!==(n=null==I?void 0:null===(t=I.failures)||void 0===t?void 0:t.total)&&void 0!==n?n:1)*100:0,"%")}})}),(0,r.jsx)("span",{className:"text-sm font-mono w-8 text-right",children:i})]})]},a)})})})]}),(null!==(w=null==I?void 0:null===(m=I.workflows)||void 0===m?void 0:m.length)&&void 0!==w?w:0)>0&&(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(e$.Z,{className:"h-4 w-4"}),K("benchmark.workflowHealth")]})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.workflow")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.successRate")}),(0,r.jsx)("th",{children:K("benchmark.avgDuration")})]})}),(0,r.jsx)("tbody",{children:(null!==(k=null==I?void 0:I.workflows)&&void 0!==k?k:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1 font-mono",children:e.name}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsxs)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(e.successRate>=.8?"bg-green-100 text-green-700":e.successRate>=.5?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"),children:[e.successRate.toFixed(0),"%"]})}),(0,r.jsxs)("td",{children:[(e.avgDuration/1e3).toFixed(1),"s"]})]},e.name))})]})})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"flex items-center gap-2",children:[(0,r.jsx)(S.Z,{className:"h-4 w-4"}),K("benchmark.dailyTrends")]})}),(0,r.jsx)(e_,{children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,r.jsx)("th",{children:K("benchmark.date")}),(0,r.jsx)("th",{children:K("benchmark.runs")}),(0,r.jsx)("th",{children:K("benchmark.failures")})]})}),(0,r.jsx)("tbody",{children:(null!==(R=null==I?void 0:I.byDay)&&void 0!==R?R:[]).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"py-1",children:e.date}),(0,r.jsx)("td",{children:e.runs}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:e.failures>0?"text-red-600":"text-green-600",children:e.failures})})]},e.date))})]})})]}),(0,r.jsx)(sT,{}),(0,r.jsx)(sP,{}),(null!==(q=null==I?void 0:null===(x=I.overview)||void 0===x?void 0:x.totalRuns)&&void 0!==q?q:0)===0&&(0,r.jsx)(eI,{children:(0,r.jsxs)(e_,{className:"p-6 text-center text-muted-foreground",children:[(0,r.jsx)(F.Z,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),K("benchmark.empty")]})})]})]})]})},knowledge:function(){let{t:e}=(0,P.$G)(),{data:s,isLoading:t}=(0,D.a)({queryKey:["knowledge-sources"],queryFn:()=>ec()}),l=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>eo(e),onSuccess:()=>e.invalidateQueries({queryKey:["knowledge-sources"]})})}(),[n,i]=(0,a.useState)(""),{data:d}=(0,D.a)({queryKey:["knowledge-search",n],queryFn:()=>ed(n),enabled:n.length>0});return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("knowledge.title","Knowledge Base")}),(0,r.jsx)(e0,{onClick:()=>l.mutate(void 0),disabled:l.isPending,children:l.isPending?e("knowledge.syncing","Syncing..."):e("knowledge.syncAll","Sync All")})]}),t?(0,r.jsx)("div",{className:"text-muted-foreground",children:e("knowledge.loading","Loading...")}):s&&s.length>0?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:e("knowledge.sources","Sources")}),s.map(s=>{var t,n,a,i,d,o,c,m;return(0,r.jsx)(eI,{children:(0,r.jsxs)(e_,{className:"p-4 flex justify-between items-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold",children:null!==(d=null===(t=s.source)||void 0===t?void 0:t.name)&&void 0!==d?d:s.name}),(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:[null!==(o=s.entryCount)&&void 0!==o?o:0," chunks \xb7 ",null!==(c=null===(a=s.source)||void 0===a?void 0:null===(n=a.urls)||void 0===n?void 0:n.length)&&void 0!==c?c:0," URLs \xb7 ","ready"===s.status?e("knowledge.synced"):e("knowledge.notSynced"),s.lastSyncTime?" \xb7 ".concat(e("knowledge.last"),": ").concat(new Date(s.lastSyncTime).toLocaleDateString()):""]})]}),(0,r.jsx)(e0,{variant:"outline",size:"sm",onClick:()=>{var e,t;return l.mutate(null!==(t=null===(e=s.source)||void 0===e?void 0:e.name)&&void 0!==t?t:s.name)},disabled:l.isPending,children:e("knowledge.sync")})]})},null!==(m=null===(i=s.source)||void 0===i?void 0:i.name)&&void 0!==m?m:s.name)})]}):(0,r.jsx)(eI,{children:(0,r.jsx)(e_,{className:"p-6 text-center text-muted-foreground",children:e("knowledge.noSources","No knowledge sources. Install a plugin and sync docs.")})}),(0,r.jsxs)("div",{className:"space-y-2 pt-4",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:e("knowledge.search","Search")}),(0,r.jsx)("div",{className:"flex gap-2",children:(0,r.jsx)(eW,{placeholder:e("knowledge.searchPlaceholder","Search knowledge..."),value:n,onChange:e=>i(e.target.value)})}),d&&d.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:d.map((s,t)=>{var l;return(0,r.jsx)(eI,{children:(0,r.jsxs)(e_,{className:"p-4",children:[(0,r.jsx)("div",{className:"font-semibold",children:s.title}),(0,r.jsx)("div",{className:"text-sm text-muted-foreground mt-1",children:null===(l=s.content)||void 0===l?void 0:l.slice(0,200)}),void 0!==s.score&&(0,r.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[e("knowledge.score"),": ",s.score.toFixed(2)]})]})},t)})})]})]})},runs:function(){let{t:e}=(0,P.$G)(),{data:s}=eP(50,0),[t,l]=(0,a.useState)(null);if(t)return(0,r.jsx)(sA,{runId:t,onBack:()=>l(null)});let n=null!=s?s:[];return(0,r.jsxs)("div",{className:"p-6 space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("runs.title")}),0===n.length?(0,r.jsx)("p",{className:"text-muted-foreground",children:e("runs.empty")}):(0,r.jsx)("div",{className:"space-y-2",children:n.map(e=>{var s;return(0,r.jsxs)("div",{onClick:()=>l(e.id),className:"flex items-center gap-4 p-3 rounded bg-secondary hover:bg-accent cursor-pointer",children:[(0,r.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e.label||e.id}),(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(null!==(s=sM[e.status])&&void 0!==s?s:"text-muted-foreground"),children:e.status}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.totalToolCalls," tools (",e.mcpToolCalls," MCP)"]}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:e.durationMs>0?"".concat((e.durationMs/1e3).toFixed(1),"s"):"--"}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:new Date(e.startedAt).toLocaleString()})]},e.id)})})]})},timeline:function(){let{t:e}=(0,P.$G)(),s=new Date().toISOString().slice(0,10),[t,l]=(0,a.useState)(s),{data:n}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,D.a)({queryKey:["telemetry-runs",e,s],queryFn:()=>em(e,s)})}(100,0),{data:i}=eq(1),d=new Date(t+"T00:00:00Z").getTime(),o=d+864e5,c=(null!=n?n:[]).filter(e=>e.startedAt>=d&&e.startedAt<o).slice(0,100),m=e=>{let s=new Date(t+"T00:00:00Z");s.setDate(s.getDate()+e),l(s.toISOString().slice(0,10))};return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:e("timeline.title")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:()=>m(-1),className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sG.Z,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t}),(0,r.jsx)("button",{onClick:()=>m(1),className:"p-1 rounded hover:bg-accent",children:(0,r.jsx)(sU.Z,{className:"h-4 w-4"})})]})]}),(0,r.jsx)(sQ,{runs:c,date:t}),i&&(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.runs")}),(0,r.jsxs)("div",{className:"font-bold text-lg",children:[i.summary.completedRuns," ",e("timeline.completed")," / ",i.summary.failedRuns," ",e("timeline.failed")]})]}),(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.toolUses")}),(0,r.jsx)("div",{className:"font-bold text-lg",children:i.summary.totalToolUses})]}),(0,r.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e("timeline.avgDuration")}),(0,r.jsxs)("div",{className:"font-bold text-lg",children:[(i.summary.avgRunDuration/1e3).toFixed(1),"s"]})]})]})]})},executions:function(){let{t:e}=(0,P.$G)(),[s,t]=(0,a.useState)(null),{data:l,isLoading:n}=(0,D.a)({queryKey:["telemetry","executions"],queryFn:()=>ew(50),refetchInterval:1e4}),{data:i}=(0,D.a)({queryKey:["telemetry","mcp-compliance"],queryFn:()=>eS()}),{data:d}=(0,D.a)({queryKey:["telemetry","executions",s,"events"],queryFn:()=>ek(s),enabled:!!s}),o=null!=l?l:[];return n?(0,r.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[(0,r.jsx)(C.Z,{className:"h-5 w-5 animate-spin mr-2"}),e("executions.loading")]}):(0,r.jsxs)("div",{className:"h-full overflow-auto p-6",children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-4",children:e("executions.title")}),i&&(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.overallCompliance")}),(0,r.jsxs)("div",{className:"text-2xl font-bold mt-1",children:[i.overall.toFixed(1),"%"]})]}),(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.totalExecutions")}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:o.length})]}),(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("executions.skillsTracked")}),(0,r.jsx)("div",{className:"text-2xl font-bold mt-1",children:Object.keys(i.bySkill).length})]})]}),(0,r.jsx)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"bg-muted/50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.skill")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.status")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.tools")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.mcpRate")}),(0,r.jsx)("th",{className:"text-left px-4 py-2 font-medium",children:e("executions.duration")})]})}),(0,r.jsxs)("tbody",{children:[o.map(e=>{var l,n,a;return(0,r.jsxs)("tr",{className:"border-t border-border cursor-pointer hover:bg-muted/30 ".concat(s===e.executionId?"bg-muted/50":""),onClick:()=>t(e.executionId),children:[(0,r.jsx)("td",{className:"px-4 py-2 font-mono text-xs",children:e.skillName}),(0,r.jsx)("td",{className:"px-4 py-2",children:"completed"===e.status?(0,r.jsx)(sV.Z,{className:"h-4 w-4 text-green-500 inline"}):"failed"===e.status?(0,r.jsx)(s$.Z,{className:"h-4 w-4 text-red-500 inline"}):(0,r.jsx)(S.Z,{className:"h-4 w-4 text-yellow-500 inline animate-spin"})}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.totalToolCalls}),(0,r.jsx)("td",{className:"px-4 py-2",children:(0,r.jsx)(sH,{rate:null!==(l=e.mcpComplianceRate)&&void 0!==l?l:0})}),(0,r.jsx)("td",{className:"px-4 py-2",children:(a=null!==(n=e.totalDuration)&&void 0!==n?n:0)<1e3?"".concat(a,"ms"):"".concat((a/1e3).toFixed(1),"s")})]},e.executionId)}),0===o.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:e("executions.empty")})})]})]})}),s&&d&&(0,r.jsxs)("div",{className:"mt-6 bg-card border border-border rounded-lg p-4",children:[(0,r.jsxs)("h3",{className:"font-bold mb-3 flex items-center gap-2",children:[(0,r.jsx)(eV.Z,{className:"h-4 w-4"}),e("executions.traceTimeline")]}),(0,r.jsx)("div",{className:"space-y-2",children:(null!=d?d:[]).map(s=>(0,r.jsxs)("div",{className:"flex items-start gap-3 p-2 rounded-md bg-muted/30 text-sm",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground w-16 shrink-0",children:new Date(s.timestamp).toLocaleTimeString()}),(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono ".concat(s.isMcpTool?"bg-green-500/20 text-green-400":"subagent"===s.toolType?"bg-blue-500/20 text-blue-400":"bg-muted text-muted-foreground"),children:s.toolType}),(0,r.jsx)("span",{className:"font-mono text-xs flex-1",children:s.toolName}),s.blocked&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-red-500/20 text-red-400",children:e("executions.blocked")}),s.mcpEnforced&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-green-500/20 text-green-400",children:"MCP"}),s.mcpFallback&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs bg-yellow-500/20 text-yellow-400",children:e("executions.fallback")})]},s.eventId))})]})]})},"tool-metrics":function(){let[e,s]=(0,a.useState)(7),{data:t=[],isLoading:l}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return(0,D.a)({queryKey:["tool-metrics-summary",e],queryFn:()=>ef(e)})}(e);return l?(0,r.jsx)("div",{className:"p-4 text-muted-foreground",children:"Loading tool metrics..."}):(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Tool Metrics"}),(0,r.jsxs)("select",{value:e,onChange:e=>s(Number(e.target.value)),className:"border rounded px-2 py-1 text-sm bg-background",children:[(0,r.jsx)("option",{value:1,children:"Last 24h"}),(0,r.jsx)("option",{value:7,children:"Last 7 days"}),(0,r.jsx)("option",{value:30,children:"Last 30 days"})]})]}),0===t.length?(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tool metrics yet. Start a Claude Code session to collect data."}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(e=>(0,r.jsxs)(eI,{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"font-mono text-sm font-medium",children:e.toolName}),(0,r.jsxs)(sR,{variant:e.callCount>10?"default":"secondary",children:[e.callCount," calls"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Success"}),(0,r.jsxs)("p",{className:"font-semibold",style:{color:e.successRate>=90?"#22c55e":e.successRate>=70?"#f59e0b":"#ef4444"},children:[e.successRate,"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Empty"}),(0,r.jsxs)("p",{className:"font-semibold",style:{color:e.emptyRate<=10?"#22c55e":e.emptyRate<=30?"#f59e0b":"#ef4444"},children:[e.emptyRate,"%"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Avg Results"}),(0,r.jsx)("p",{className:"font-semibold",children:e.avgResults})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Avg Latency"}),(0,r.jsxs)("p",{className:"font-semibold",children:[e.avgLatency,"ms"]})]})]})]},e.toolName))})]})},accuracy:function(){var e,s;let[t,l]=(0,a.useState)(""),{data:n}=(e=t||void 0,(0,D.a)({queryKey:["accuracy-stats",e],queryFn:()=>eg(e)})),{data:i}=(s={engine:t||void 0,status:"unannotated",limit:20},(0,D.a)({queryKey:["accuracy-queries",s],queryFn:()=>ey(s)})),{data:d}=(0,D.a)({queryKey:["auto-check"],queryFn:()=>eb()}),o=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>eN(e),onSuccess:()=>{e.invalidateQueries({queryKey:["accuracy-stats"]}),e.invalidateQueries({queryKey:["accuracy-queries"]})}})}(),c=null!=n?n:{},m=Array.isArray(i)?i:[],x=Array.isArray(d)?d:[],u=(0,a.useCallback)((e,s)=>{o.mutate({queryId:e,relevance:s})},[o]);return(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Accuracy"}),(0,r.jsxs)("select",{value:t,onChange:e=>l(e.target.value),className:"border rounded px-2 py-1 text-sm bg-background",children:[(0,r.jsx)("option",{value:"",children:"All Engines"}),(0,r.jsx)("option",{value:"codegraph",children:"CodeGraph"}),(0,r.jsx)("option",{value:"knowledge",children:"Knowledge"}),(0,r.jsx)("option",{value:"memory",children:"Memory"})]})]}),x.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Auto Check Results"}),x.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded text-sm ".concat("error"===e.severity?"bg-red-50 dark:bg-red-950 border border-red-300":"warning"===e.severity?"bg-yellow-50 dark:bg-yellow-950 border border-yellow-300":"bg-green-50 dark:bg-green-950 border border-green-300"),children:[(0,r.jsx)(sR,{variant:"ok"===e.severity?"default":"destructive",children:e.severity}),(0,r.jsx)("span",{className:"flex-1",children:e.detail})]},e.name))]}),Object.keys(c).length>0&&(0,r.jsx)("div",{className:"grid grid-cols-3 gap-4",children:Object.entries(c).map(e=>{let[s,t]=e;return(0,r.jsxs)(eI,{className:"p-4 space-y-2",children:[(0,r.jsx)("h3",{className:"font-medium text-sm capitalize",children:s}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Queries"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:t.totalQueries}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Annotated"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:t.annotatedQueries}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Hit Rate"}),(0,r.jsx)("span",{className:"font-semibold text-right",children:null!=t.hitRate?"".concat(Math.round(100*t.hitRate),"%"):"N/A"})]})]},s)})}),m.length>0&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("h3",{className:"text-sm font-medium",children:["Annotation Queue (",m.length," unannotated)"]}),m.slice(0,10).map(e=>{var s;return(0,r.jsxs)(eI,{className:"p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(sR,{variant:"outline",children:e.engine}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,r.jsx)("p",{className:"text-sm font-mono",children:e.query}),(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Top results: ",(null===(s=e.topKResults)||void 0===s?void 0:s.slice(0,3).map(e=>{var s;return null!==(s=e.name)&&void 0!==s?s:e.title}).join(", "))||"none"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(e0,{size:"sm",variant:"default",onClick:()=>u(e.id,"hit"),children:"Hit"}),(0,r.jsx)(e0,{size:"sm",variant:"secondary",onClick:()=>u(e.id,"partial"),children:"Partial"}),(0,r.jsx)(e0,{size:"sm",variant:"destructive",onClick:()=>u(e.id,"miss"),children:"Miss"})]})]},e.id)})]}),0===Object.keys(c).length&&0===m.length&&0===x.length&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"No accuracy data yet. Start a Claude Code session to collect queries."})]})},settings:function(){var e,s,t,l,n,a,i;let{t:d}=(0,P.$G)(),{data:o}=(0,D.a)({queryKey:["plugins",void 0,void 0],queryFn:()=>eR(a,i)}),{data:c}=eq(),m=function(){let e=(0,L.NL)();return(0,I.D)({mutationFn:e=>ep(e),onSuccess:()=>e.invalidateQueries({queryKey:["telemetry-stats"]})})}();return(0,r.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold",children:d("settings.title","Project Settings")}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{className:"text-sm",children:d("settings.projectInfo","Project Info")})}),(0,r.jsxs)(e_,{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.name","Name"),":"]}),(0,r.jsx)("span",{children:"devflow"})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.mode","Mode"),":"]}),(0,r.jsx)("span",{children:"monorepo"})]})]})]}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsxs)(eE,{className:"text-sm",children:[d("settings.plugins","Plugins")," (",null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0," installed)"]})}),(0,r.jsx)(e_,{className:"space-y-2",children:o&&o.length>0?o.map(e=>(0,r.jsxs)("div",{className:"flex justify-between items-center text-sm p-2 border rounded",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:["@",e.version]})]},e.name)):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:d("settings.noPlugins","No plugins installed")})})]}),(0,r.jsx)(sP,{}),(0,r.jsxs)(eI,{children:[(0,r.jsx)(eZ,{children:(0,r.jsx)(eE,{className:"text-sm",children:d("settings.telemetry","Telemetry")})}),(0,r.jsxs)(e_,{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.totalRuns","Runs stored"),":"]}),(0,r.jsx)("span",{children:null!==(l=null==c?void 0:null===(e=c.summary)||void 0===e?void 0:e.totalRuns)&&void 0!==l?l:0})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[d("settings.totalTokens","Total tokens"),":"]}),(0,r.jsx)("span",{children:(null!==(n=null==c?void 0:null===(s=c.summary)||void 0===s?void 0:s.totalTokens)&&void 0!==n?n:0).toLocaleString()})]}),(0,r.jsx)(e0,{variant:"outline",size:"sm",onClick:()=>m.mutate(30),disabled:m.isPending,children:d("settings.clearOldRuns","Clear old runs (30d+)")})]})]})]})}};function sB(){var e;let s=x(e=>e.activeView),t=null!==(e=sJ[s])&&void 0!==e?e:()=>(0,r.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-lg",children:[s," view"]});return(0,r.jsx)(t,{})}function sW(){let e=x(e=>e.activeView),[s,t]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{t(!0)},[]),s)?(0,r.jsx)(u,{nav:(0,r.jsx)(K,{}),main:(0,r.jsx)(sB,{}),detail:"graph"===e?(0,r.jsx)(eL,{}):void 0}):(0,r.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,r.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})})}}},function(e){e.O(0,[650,856,254,781,293,528,744],function(){return e(e.s=56364)}),_N_E=e.O()}]);