@claudeye/linux-arm64 1.0.1 → 1.0.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/assets/dist/action-registry.d.ts +9 -0
  2. package/assets/dist/action-registry.js +1 -0
  3. package/assets/dist/action-runner.d.ts +4 -0
  4. package/assets/dist/action-runner.js +1 -0
  5. package/assets/dist/action-types.d.ts +54 -0
  6. package/assets/dist/action-types.js +1 -0
  7. package/assets/dist/alert-dispatcher.d.ts +2 -0
  8. package/assets/dist/alert-dispatcher.js +1 -0
  9. package/assets/dist/alert-registry.d.ts +13 -0
  10. package/assets/dist/alert-registry.js +1 -0
  11. package/assets/dist/alert-types.d.ts +18 -0
  12. package/assets/dist/alert-types.js +1 -0
  13. package/assets/dist/app.d.ts +75 -0
  14. package/assets/dist/app.js +1 -0
  15. package/assets/dist/auth-registry.d.ts +11 -0
  16. package/assets/dist/auth-registry.js +1 -0
  17. package/assets/dist/condition-registry.d.ts +8 -0
  18. package/assets/dist/condition-registry.js +1 -0
  19. package/assets/dist/create-registry.d.ts +27 -0
  20. package/assets/dist/create-registry.js +1 -0
  21. package/assets/dist/dashboard-registry.d.ts +36 -0
  22. package/assets/dist/dashboard-registry.js +1 -0
  23. package/assets/dist/dashboard-runner.d.ts +3 -0
  24. package/assets/dist/dashboard-runner.js +1 -0
  25. package/assets/dist/dashboard-types.d.ts +194 -0
  26. package/assets/dist/dashboard-types.js +1 -0
  27. package/assets/dist/enrich-registry.d.ts +9 -0
  28. package/assets/dist/enrich-registry.js +1 -0
  29. package/assets/dist/enrich-runner.d.ts +3 -0
  30. package/assets/dist/enrich-runner.js +1 -0
  31. package/assets/dist/enrich-types.d.ts +39 -0
  32. package/assets/dist/enrich-types.js +1 -0
  33. package/assets/dist/index.d.ts +13 -0
  34. package/assets/dist/index.js +1 -0
  35. package/assets/dist/loader.d.ts +1 -0
  36. package/assets/dist/loader.js +1 -0
  37. package/assets/dist/queue-condition-registry.d.ts +13 -0
  38. package/assets/dist/queue-condition-registry.js +1 -0
  39. package/assets/dist/registry.d.ts +8 -0
  40. package/assets/dist/registry.js +1 -0
  41. package/assets/dist/run-all.d.ts +21 -0
  42. package/assets/dist/run-all.js +1 -0
  43. package/assets/dist/runner.d.ts +2 -0
  44. package/assets/dist/runner.js +1 -0
  45. package/assets/dist/server-spawn.d.ts +9 -0
  46. package/assets/dist/server-spawn.js +11 -0
  47. package/assets/dist/types.d.ts +101 -0
  48. package/assets/dist/types.js +1 -0
  49. package/assets/standalone/.next/BUILD_ID +1 -1
  50. package/assets/standalone/.next/build-manifest.json +2 -2
  51. package/assets/standalone/.next/prerender-manifest.json +3 -3
  52. package/assets/standalone/.next/server/app/_global-error.html +2 -2
  53. package/assets/standalone/.next/server/app/_global-error.rsc +1 -1
  54. package/assets/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  55. package/assets/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  56. package/assets/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  57. package/assets/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  58. package/assets/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  59. package/assets/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  60. package/assets/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  61. package/assets/standalone/.next/server/app/_not-found.html +2 -2
  62. package/assets/standalone/.next/server/app/_not-found.rsc +5 -5
  63. package/assets/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  64. package/assets/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  65. package/assets/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
  66. package/assets/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  67. package/assets/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  68. package/assets/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  69. package/assets/standalone/.next/server/app/dashboard/[viewName]/page/server-reference-manifest.json +4 -4
  70. package/assets/standalone/.next/server/app/dashboard/[viewName]/page_client-reference-manifest.js +1 -1
  71. package/assets/standalone/.next/server/app/dashboard/page/server-reference-manifest.json +4 -4
  72. package/assets/standalone/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  73. package/assets/standalone/.next/server/app/login/page/server-reference-manifest.json +2 -2
  74. package/assets/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  75. package/assets/standalone/.next/server/app/login.html +2 -2
  76. package/assets/standalone/.next/server/app/login.rsc +6 -6
  77. package/assets/standalone/.next/server/app/login.segments/_full.segment.rsc +6 -6
  78. package/assets/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  79. package/assets/standalone/.next/server/app/login.segments/_index.segment.rsc +5 -5
  80. package/assets/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  81. package/assets/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  82. package/assets/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  83. package/assets/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  84. package/assets/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  85. package/assets/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  86. package/assets/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  87. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +1 -1
  88. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +8 -8
  89. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  90. package/assets/standalone/.next/server/app/queue/page/server-reference-manifest.json +3 -3
  91. package/assets/standalone/.next/server/app/queue/page_client-reference-manifest.js +1 -1
  92. package/assets/standalone/.next/server/chunks/[root-of-the-server]__b18c2f99._.js +2 -2
  93. package/assets/standalone/.next/server/chunks/_6a9d92e6._.js +1 -1
  94. package/assets/standalone/.next/server/chunks/_7cb7a702._.js +1 -1
  95. package/assets/standalone/.next/server/chunks/_d3c87a9f._.js +1 -1
  96. package/assets/standalone/.next/server/chunks/_fb07f1d4._.js +1 -1
  97. package/assets/standalone/.next/server/chunks/lib_6cff0ca5._.js +1 -1
  98. package/assets/standalone/.next/server/chunks/lib_74f62736._.js +1 -1
  99. package/assets/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7a66d362.js +1 -1
  100. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0530a7f6._.js +1 -1
  101. package/assets/standalone/.next/server/chunks/ssr/_1d335924._.js +1 -1
  102. package/assets/standalone/.next/server/chunks/ssr/_34abf048._.js +2 -2
  103. package/assets/standalone/.next/server/chunks/ssr/_3e6c3cad._.js +2 -2
  104. package/assets/standalone/.next/server/chunks/ssr/_40b9779b._.js +2 -2
  105. package/assets/standalone/.next/server/chunks/ssr/_472a5ae2._.js +2 -2
  106. package/assets/standalone/.next/server/chunks/ssr/_76ab933f._.js +1 -1
  107. package/assets/standalone/.next/server/chunks/ssr/_87e025a1._.js +1 -1
  108. package/assets/standalone/.next/server/chunks/ssr/_cce5033e._.js +2 -2
  109. package/assets/standalone/.next/server/chunks/ssr/_d7141734._.js +2 -2
  110. package/assets/standalone/.next/server/chunks/ssr/_d982b289._.js +2 -2
  111. package/assets/standalone/.next/server/chunks/ssr/_f7ec0663._.js +2 -2
  112. package/assets/standalone/.next/server/chunks/ssr/app_actions_compute-dashboard_ts_fc151dbb._.js +1 -1
  113. package/assets/standalone/.next/server/chunks/ssr/app_login_page_tsx_ccc0019b._.js +1 -1
  114. package/assets/standalone/.next/server/chunks/ssr/app_queue_queue-client_tsx_45f040f7._.js +1 -1
  115. package/assets/standalone/.next/server/chunks/ssr/components_navbar_tsx_e9e361f1._.js +1 -1
  116. package/assets/standalone/.next/server/pages/404.html +2 -2
  117. package/assets/standalone/.next/server/pages/500.html +2 -2
  118. package/assets/standalone/.next/server/server-reference-manifest.js +1 -1
  119. package/assets/standalone/.next/server/server-reference-manifest.json +15 -15
  120. package/assets/standalone/.next/static/chunks/{a49aebd623ae4665.js → 03a963c74a738019.js} +1 -1
  121. package/assets/standalone/.next/static/chunks/{7dd73e58ba8a0797.js → 6869fbfc3b75bbde.js} +1 -1
  122. package/assets/standalone/.next/static/chunks/{7ae9fc2d3620a9da.js → 7ec327353a0d957f.js} +1 -1
  123. package/assets/standalone/.next/static/chunks/{0799325e505e77f7.js → 9c07f0f12c773b3f.js} +1 -1
  124. package/assets/standalone/.next/static/chunks/{41f5296fb6143015.js → e5ecbc1e31c7a458.js} +1 -1
  125. package/assets/standalone/.next/static/chunks/{9a7a0881a040272f.js → fe2b1f1f4a6556c1.js} +1 -1
  126. package/assets/standalone/package.json +1 -1
  127. package/bin/claudeye +0 -0
  128. package/package.json +1 -1
  129. /package/assets/standalone/.next/static/{AKt9xSBixO5pCAaT7TTds → Qf1a9hhlIMFDrqGZ1NRvH}/_buildManifest.js +0 -0
  130. /package/assets/standalone/.next/static/{AKt9xSBixO5pCAaT7TTds → Qf1a9hhlIMFDrqGZ1NRvH}/_clientMiddlewareManifest.json +0 -0
  131. /package/assets/standalone/.next/static/{AKt9xSBixO5pCAaT7TTds → Qf1a9hhlIMFDrqGZ1NRvH}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
1
  (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080);function a(e,t,s){let r,a=s.initialDeps??[],n=!0;function i(){var i,l,o;let c,d;s.key&&(null==(i=s.debug)?void 0:i.call(s))&&(c=Date.now());let u=e();if(!(u.length!==a.length||u.some((e,t)=>a[t]!==e)))return r;if(a=u,s.key&&(null==(l=s.debug)?void 0:l.call(s))&&(d=Date.now()),r=t(...u),s.key&&(null==(o=s.debug)?void 0:o.call(s))){let e=Math.round((Date.now()-c)*100)/100,t=Math.round((Date.now()-d)*100)/100,r=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(n&&s.skipInitialOnChange)&&s.onChange(r),n=!1,r}return i.updateDeps=e=>{a=e},i}function n(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let i=e=>e,l=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},o={passive:!0},c=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,o),()=>{s.removeEventListener("resize",r)}},d="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let a,n=e.scrollElement;if(!n)return;let i=e.targetWindow;if(!i)return;let l=0,c=e.options.useScrollendEvent&&d?()=>void 0:(s=()=>{t(l,!1)},r=e.options.isScrollingResetDelay,function(...e){i.clearTimeout(a),a=i.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{l=n[e.options.horizontal?"scrollX":"scrollY"],c(),t(l,s)},m=u(!0),h=u(!1);n.addEventListener("scroll",m,o);let p=e.options.useScrollendEvent&&d;return p&&n.addEventListener("scrollend",h,o),()=>{n.removeEventListener("scroll",m),p&&n.removeEventListener("scrollend",h)}},m=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},h=(e,{adjustments:t=0,behavior:s},r)=>{var a,n;null==(n=null==(a=r.scrollElement)?void 0:a.scrollTo)||n.call(a,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class p{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:i,rangeExtractor:l,onChange:()=>{},measureElement:m,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=a(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let a=t-1;a>=0;a--){let t=e[a];if(s.has(t.lane))continue;let n=r.get(t.lane);if(null==n||t.end>n.end?r.set(t.lane,t):t.end<n.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=a(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,s,r,a,n)=>(void 0!==this.prevLanes&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:a,lanes:n}),{key:!1}),this.getMeasurements=a(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:a,lanes:n},i)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let o=this.measurementsCache.slice(0,l),c=Array(n).fill(void 0);for(let e=0;e<l;e++){let t=o[e];t&&(c[t.lane]=e)}for(let a=l;a<e;a++){let e,n,l=r(a),d=this.laneAssignments.get(a);if(void 0!==d&&this.options.lanes>1){let r=c[e=d],a=void 0!==r?o[r]:void 0;n=a?a.end+this.options.gap:t+s}else{let r=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a);n=r?r.end+this.options.gap:t+s,e=r?r.lane:a%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(a,e)}let u=i.get(l),m="number"==typeof u?u:this.options.estimateSize(a),h=n+m;o[a]={index:a,start:n,size:m,end:h,key:l,lane:e},c[e]=a}return this.measurementsCache=o,o},{key:!1,debug:()=>this.options.debug}),this.calculateRange=a(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};let n=x(0,a,t=>e[t].start,s),i=n;if(1===r)for(;i<a&&e[i].end<s+t;)i++;else if(r>1){let l=Array(r).fill(0);for(;i<a&&l.some(e=>e<s+t);){let t=e[i];l[t.lane]=t.end,i++}let o=Array(r).fill(s+t);for(;n>=0&&o.some(e=>e>=s);){let t=e[n];o[t.lane]=t.start,n--}n=Math.max(0,n-n%r),i=Math.min(a,i+(r-1-i%r))}return{startIndex:n,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=a(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,a)=>null===r||null===a?[]:e({startIndex:r,endIndex:a,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let s=this.indexFromElement(e),r=this.measurementsCache[s];if(!r)return;let a=r.key,n=this.elementsCache.get(a);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{let s=this.measurementsCache[e];if(!s)return;let r=t-(this.itemSizeCache.get(s.key)??s.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(s,r,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=a(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,a=e.length;r<a;r++){let a=t[e[r]];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return n(t[x(0,t.length-1,e=>n(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),a=this.getScrollOffset();return"auto"===t&&(t=e>=a+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.measurementsCache[e];if(!s)return;let r=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(s.end>=a+r-this.options.scrollPaddingEnd)t="end";else{if(!(s.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let n="end"===t?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t,s.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:s}={})=>{"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:t="auto",behavior:s}={})=>{"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0,a=t=>{if(!this.targetWindow)return;let r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);let[a,i]=r;this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{if(!this.targetWindow)return;let t=()=>{if(this.currentScrollToIndex!==e)return;let t=this.getScrollOffset(),s=this.getOffsetForIndex(e,i);s?1.01>Math.abs(s[0]-t)||n(i):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},n=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(++r<10?this.targetWindow.requestAnimationFrame(()=>a(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};a(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}let x=(e,t,s,r)=>{for(;e<=t;){let a=(e+t)/2|0,n=s(a);if(n<r)e=a+1;else{if(!(n>r))return a;t=a-1}}return e>0?e-1:0},f="u">typeof document?s.useLayoutEffect:s.useEffect;var g=e.i(64659),y=e.i(75254);let b=(0,y.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,y.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,y.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),N=(0,y.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),w=(0,y.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var k=e.i(86311);let S=(0,y.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),M=s.default.memo(function({entries:e,compact:r=!1}){let a=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,a=0,n=0,i=new Set;for(let l of e)if("user"===l.type&&t++,"queue-operation"===l.type&&n++,"assistant"===l.type){for(let e of(s++,l.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?a++:r++);l.message.model&&i.add(l.message.model)}let l="";return e.length>=2&&(l=function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let s=Math.floor(t/60);if(s>=60){let e=Math.floor(s/60);return`${e}h ${s%60}m`}let r=(t%60).toFixed(0);return`${s}m ${r}s`}(e[e.length-1].timestampMs-e[0].timestampMs)),{turnCount:n,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:a,duration:l,models:Array.from(i)}})(e),[e]),n=r?"w-3.5 h-3.5":"w-4 h-4",i=r?"text-xs font-medium":"text-sm font-medium",l=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",o=[...r?[]:[{Icon:k.MessageSquare,color:"text-primary",v:a.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:a.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:a.assistantCount,l:"Assistant"},{Icon:b,color:"text-[color:var(--chart-3)]",v:a.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:S,color:"text-[color:var(--chart-5)]",v:a.subagentCount,l:"Subagents"},{Icon:w,color:"text-[color:var(--chart-4)]",v:a.duration||"—",l:"Duration"},{Icon:N,color:"text-[color:var(--chart-5)]",v:a.models.length>0?a.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:o.map(({Icon:e,color:s,v:r,l:a})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${n} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:l,children:a})]})]},a))})})}),C=(0,y.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var I=e.i(63059);function E(e){return JSON.stringify(e.raw,null,2)}let $=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function R(e){let t=new Date(e),s=$.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let T=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:a}){let n="function"==typeof a,i=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${n?" group-hover:bg-primary/20 transition-colors":""}`,children:[n?(0,t.jsx)(I.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(C,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:R(e.timestampMs)}),n&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return n?(0,t.jsxs)("button",{type:"button",onClick:a,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var O=e.i(47163);let z={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},A={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},_={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},D=(0,y.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),F=(0,y.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),q=(0,y.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function L({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(D,{className:s});case"progress":return(0,t.jsx)(F,{className:s});case"system":return(0,t.jsx)(q,{className:s});case"queue-operation":return(0,t.jsx)(C,{className:s})}}function W({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${A[e]}`,children:[(0,t.jsx)(L,{type:e}),z[e]]})}var P=e.i(24380);function U({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(P.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:R(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(P.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let V=(0,y.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var H=e.i(73884);let B=(0,y.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),J=(0,y.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var Q=e.i(16715),K=e.i(95187);let X=(0,K.createServerReference)("789582c2218509ab245ab2d99380fb4b7529085bfc",K.callServer,void 0,K.findSourceMapURL,"checkEvalCacheAndList");async function Y(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"eval",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}let G=(0,K.createServerReference)("60281361e63ac0ab9013078db69fe9ef64cec03159",K.callServer,void 0,K.findSourceMapURL,"clearAlertMarker"),Z=(0,K.createServerReference)("786e807fa0cb3a59c7c9bf495100dc9a11ae477bfb",K.callServer,void 0,K.findSourceMapURL,"invalidateSessionItemCaches");function ee({score:e}){let s=Math.round(100*e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden max-w-[80px]",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e>=.8?"bg-green-500":e>=.5?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s}%`}})}),(0,t.jsxs)("span",{className:"text-xs font-mono text-muted-foreground w-8",children:[s,"%"]})]})}function et({result:e}){return e.error?(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}):e.pass?(0,t.jsx)(V,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(H.XCircle,{className:"w-4 h-4 text-red-500"})}function es({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full animate-pulse max-w-[80px]"})]})}function er({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function ea({result:e,cached:r,onRerun:a,globalLoading:n}){let[i,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=e.error||e.message,u=!!d,m=async t=>{t.stopPropagation(),c(!0);try{await a(e.name)}finally{c(!1)}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors ${u?"cursor-pointer":""}`,onClick:()=>u&&l(e=>!e),children:[u&&(0,t.jsx)(I.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`}),(0,t.jsx)(et,{result:e}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)(ee,{score:e.score}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.error&&(0,t.jsx)("span",{className:"text-xs text-yellow-500 flex-1 truncate min-w-0",children:e.error}),e.message&&!e.error&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this eval","aria-label":`Re-run eval ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&d&&(0,t.jsxs)("div",{className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(P.CopyButton,{text:d})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:d})]})]})}function en({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),c([]),X(e,r,a,n).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEvals){h(!0),u(!1);return}if(c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),x(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let a=await Y(e,r,s,!1,l);if(t||!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t||!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load evals"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,a,n,i]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await X(e,r,a,n);if(t||!s.ok||!s.hasEvals)return;c(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,a,n]);let k=(0,s.useCallback)(async()=>{y(!0),c(e=>e.map(e=>({status:"loading",name:e.name})));let t=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{await Z("evals",e,r,a),await G(e,r);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let a=await Y(e,r,s,!0,t);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&x(!1)}finally{w.current&&y(!1)}},[e,r,a,n,i,o]),S=(0,s.useCallback)(async t=>{x(!1),c(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let s=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{let a=await Y(e,r,t,!0,s);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===t?{status:"done",name:t,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===t?{status:"error",name:t,error:a.error}:e))}catch(e){if(!w.current)return;c(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Re-run failed"}:s))}},[e,r,a,n,i]),M=o.filter(e=>"done"===e.status),I=o.filter(e=>"loading"===e.status).length,E=M.map(e=>e.result).filter(e=>!e.skipped),$=E.filter(e=>!e.error&&e.pass).length,R=E.filter(e=>!e.error&&!e.pass).length,T=M.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,O=d||I>0||f;if(m)return null;let z=l?"p-2.5":"p-4",A=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading evals..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let _=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==_.length||O?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${z} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(J,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Eval Results"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[$>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V,{className:"w-3.5 h-3.5 text-green-500"}),(0,t.jsx)("span",{className:"font-medium",children:$}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"passed"})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(H.XCircle,{className:"w-3.5 h-3.5 text-red-500"}),(0,t.jsx)("span",{className:"font-medium",children:R}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"failed"})]}),T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"font-medium",children:T}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"errored"})]}),I>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 text-muted-foreground animate-spin"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[I," running..."]})]}),p&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"})]}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"divide-y divide-border/50",children:_.map(e=>"loading"===e.status?(0,t.jsx)(es,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(er,{name:e.name,error:e.error},e.name):(0,t.jsx)(ea,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]}):null}let ei=(0,y.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,K.createServerReference)("78b11fe2be0b61cdf78b7ba5481f50f43b2ea11610",K.callServer,void 0,K.findSourceMapURL,"checkEnrichmentCacheAndList");async function eo(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"enrichment",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}function ec({name:e}){return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"w-10 h-3 bg-muted rounded animate-pulse"})]}),(0,t.jsxs)("div",{className:"pl-1 space-y-1",children:[(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-2/3"}),(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-1/2"})]})]})}function ed({name:e,error:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})})}function eu({result:e,cached:s}){if(e.error)return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error})]})});let r=Object.entries(e.data);return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),s&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-y-1 pl-1",children:r.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2 min-w-0 flex-wrap",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-primary/70 shrink-0",children:[e,":"]}),(0,t.jsx)("span",{className:"text-sm font-mono break-all",title:String(s),children:"boolean"==typeof s?s?"Yes":"No":"number"==typeof s?s.toLocaleString():String(s)})]},e))})]})}function em({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),c([]),el(e,r,a,n).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEnrichers){h(!0),u(!1);return}if(c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),x(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let a=await eo(e,r,s,!1,l);if(t||!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t||!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load enrichments"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,a,n,i]);let k=(0,s.useCallback)(async()=>{y(!0),c(e=>e.map(e=>({status:"loading",name:e.name})));let t=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{await Z("enrichments",e,r,a);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let a=await eo(e,r,s,!0,t);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&x(!1)}finally{w.current&&y(!1)}},[e,r,a,n,i,o]),S=o.filter(e=>"done"===e.status),M=o.filter(e=>"loading"===e.status).length,I=S.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,E=d||M>0||f;if(m)return null;let $=l?"p-2.5":"p-4",R=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading enrichments..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let T=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==T.length||E?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${$} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ei,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Enrichment Data"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[I>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[I," errored"]})]}),M>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[M," running..."]})]}),p&&!E&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:E,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"space-y-3 divide-y divide-border/50",children:T.map(e=>(0,t.jsxs)("div",{className:"pt-2 first:pt-0",children:["loading"===e.status&&(0,t.jsx)(ec,{name:e.name}),"error"===e.status&&(0,t.jsx)(ed,{name:e.name,error:e.error}),"done"===e.status&&(0,t.jsx)(eu,{result:e.result,cached:e.cached})]},e.name))})]}):null}let eh=(0,y.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),ep=s.default.memo(function({block:e,allEntries:s,projectName:r,sessionId:a}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let n=e.subagentId&&s?s.filter(t=>t._source===`agent-${e.subagentId}`):void 0;return(0,t.jsx)(ey,{block:e,subagentEntries:n,projectName:r,sessionId:a})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(b,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(U,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(eh,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function ex({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:a}){let{content:n}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:n.map((e,n)=>(0,t.jsx)(ep,{block:e,allEntries:s,projectName:r,sessionId:a},n))})}),eg=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:E(e)})]})]})});function ey({block:e,subagentEntries:r,projectName:a,sessionId:n}){let[i,l]=(0,s.useState)(!1),o=(0,s.useCallback)(()=>{l(e=>!e)},[]),c=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(S,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(I.ChevronRight,{className:(0,O.cn)("w-3 h-3 transition-transform",i&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i?"Collapse":"View subagent log"})]}),i&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{entries:r,compact:!0}),(0,t.jsx)(en,{projectName:a,sessionId:n,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0}),(0,t.jsx)(em,{projectName:a,sessionId:n,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0})]}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(T,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(ev,{entry:e,projectName:a,sessionId:n},e.uuid||e.timestamp))]}),(0,t.jsx)(U,{block:e})]})}function eb({entry:e,allEntries:s,projectName:r,sessionId:a}){switch(e.type){case"user":return(0,t.jsx)(ex,{entry:e});case"assistant":return(0,t.jsx)(ef,{entry:e,allEntries:s,projectName:r,sessionId:a});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(eg,{entry:e})}}let ev=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:a}){return(0,t.jsxs)("div",{className:`border-l-4 ${_[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(W,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[(0,t.jsx)(P.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return E(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:R(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(eb,{entry:e,allEntries:s,projectName:r,sessionId:a})})]})}),ej=(0,y.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eN=(0,y.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ew=(0,K.createServerReference)("7805822687b9e36e6a6d1272cdb20abc4233604166",K.callServer,void 0,K.findSourceMapURL,"checkActionCacheAndList");async function ek(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"action",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}let eS=(0,K.createServerReference)("7c92277460985f0048e217b35d83db953a4ea70eaf",K.callServer,void 0,K.findSourceMapURL,"invalidateSessionItemCache"),eM=(0,K.createServerReference)("0057f81ed754960cfc07656c16f01a8eea5a852289",K.callServer,void 0,K.findSourceMapURL,"getQueueStatusAction");function eC({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"running..."})]})}function eI({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function eE({name:e,onRun:s,disabled:r}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(eN,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"not run"}),(0,t.jsxs)("button",{onClick:s,disabled:r,className:"ml-auto flex-shrink-0 inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,t.jsx)(C,{className:"w-2.5 h-2.5"}),"Run"]})]})}function e$({result:e,cached:r,onRerun:a,globalLoading:n}){let[i,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=e.output||e.message,u=!!d,m=async t=>{t.stopPropagation(),c(!0);try{await a(e.name)}finally{c(!1)}};if(e.error)return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]});let h="success"===e.status?(0,t.jsx)(V,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(H.XCircle,{className:"w-4 h-4 text-red-500"}),p=`action-result-${e.name}`;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors",children:[u&&(0,t.jsx)("button",{onClick:()=>l(e=>!e),"aria-expanded":i,"aria-controls":p,className:"flex-shrink-0 p-0 bg-transparent border-none cursor-pointer","aria-label":`Toggle details for ${e.name}`,children:(0,t.jsx)(I.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`})}),h,(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.message&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&d&&(0,t.jsxs)("div",{id:p,className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(P.CopyButton,{text:d})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:d})]})]})}function eR({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(0);(0,s.useEffect)(()=>{let t=++w.current;return u(!0),v(null),h(!1),c([]),ew(e,r,a,n).then(async s=>{if(t!==w.current)return;if(!s.ok){v(s.error),u(!1);return}if(!s.hasActions){h(!0),u(!1);return}let n=new Set;if(s.uncachedNames.length>0)try{let s=await eM();if(t!==w.current)return;let i=a?`${r}/agent-${a}`:r;for(let t of[...s.pending,...s.processing])"action"===t.type&&t.projectName===e&&t.sessionId===i&&n.add(t.itemName)}catch{}c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:n.has(e)?{status:"loading",name:e}:{status:"idle",name:e}})),x(0===s.uncachedNames.length),u(!1)}).catch(e=>{t===w.current&&(v(e instanceof Error?e.message:"Failed to load actions"),u(!1))}),()=>{}},[e,r,a,n]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await ew(e,r,a,n);if(t||!s.ok||!s.hasActions)return;c(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,a,n]);let k=(0,s.useCallback)(async(t,s=!1)=>{let l=w.current;c(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let o=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{s&&await eS("actions",e,r,t,a).catch(e=>console.error("Failed to invalidate action cache:",e));let n=await ek(e,r,t,s,o);if(l!==w.current||!n.ok&&"__queued__"===n.error)return;n.ok?c(e=>e.map(e=>e.name===t?{status:"done",name:t,result:n.result,cached:!1}:e)):c(e=>e.map(e=>e.name===t?{status:"error",name:t,error:n.error}:e))}catch(e){if(l!==w.current)return;c(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}},[e,r,a,n,i]),S=(0,s.useCallback)(async e=>{x(!1),await k(e,!0)},[k]),M=(0,s.useCallback)(async()=>{let t=w.current;y(!0);let s=o.map(e=>e.name);c(e=>e.map(e=>({status:"loading",name:e.name})));let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{try{await Z("actions",e,r,a)}catch(e){console.error("Failed to invalidate action caches:",e)}await Promise.all(s.map(async s=>{try{let a=await ek(e,r,s,!0,l);if(t!==w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t!==w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),t===w.current&&x(!1)}finally{t===w.current&&y(!1)}},[e,r,a,n,i,o]),I=o.filter(e=>"done"===e.status),E=o.filter(e=>"loading"===e.status).length,$=o.filter(e=>"idle"===e.status).length,R=I.filter(e=>"error"===e.result.status||!!e.result.error).length+o.filter(e=>"error"===e.status).length,T=I.filter(e=>"success"===e.result.status&&!e.result.error).length,O=d||E>0||f;if(m)return null;let z=l?"p-2.5":"p-4",A=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading actions..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let _=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==_.length||O?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${z} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),"aria-expanded":!j,"aria-controls":"action-results-content",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ej,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Actions"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-green-500",children:[(0,t.jsx)(V,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:T})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[R," errored"]})]}),$>0&&!O&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/50",children:[$," pending"]}),E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[E," running..."]})]}),p&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>M(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Run All"]})]})]}),!j&&(0,t.jsx)("div",{id:"action-results-content",className:"divide-y divide-border/50",children:_.map(e=>"idle"===e.status?(0,t.jsx)(eE,{name:e.name,onRun:()=>k(e.name,!0),disabled:O},e.name):"loading"===e.status?(0,t.jsx)(eC,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(eI,{name:e.name,error:e.error},e.name):(0,t.jsx)(e$,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]}):null}function eT(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eO({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(b,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function ez(e){return`${e.uuid}-${e.timestampMs}`}function eA({entries:e,allEntries:a,projectName:n,sessionId:i}){let[l,o]=(0,s.useState)(new Set),[d,m]=(0,s.useState)(0),x=(0,s.useCallback)(e=>{e&&m(e.offsetTop)},[]),g=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let a of e)"queue-operation"===a.type?(null!==s&&t.set(s,r),s=ez(a),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),y=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(ez(e)),!0):!t)},[e,l]),b=(0,s.useCallback)(e=>{o(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),v=function({useFlushSync:e=!0,...t}){let a=s.useReducer(()=>({}),{})[1],n={...t,onChange:(s,n)=>{var i;e&&n?(0,r.flushSync)(a):a(),null==(i=t.onChange)||i.call(t,s,n)}},[i]=s.useState(()=>new p(n));return i.setOptions(n),f(()=>i._didMount(),[]),f(()=>i._willUpdate()),i}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:c,observeElementOffset:u,scrollToFn:h,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:y.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(y[e]),overscan:5,scrollMargin:d}});return(0,t.jsx)("div",{ref:x,children:(0,t.jsx)("div",{style:{height:`${v.getTotalSize()}px`,width:"100%",position:"relative"},children:v.getVirtualItems().map(e=>{let s=y[e.index];return(0,t.jsx)("div",{"data-index":e.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-v.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(T,{entry:s,isCollapsed:l.has(ez(s)),entryCount:g.get(ez(s))??0,onToggle:()=>b(ez(s))}):(0,t.jsx)(ev,{entry:s,allEntries:a,projectName:n,sessionId:i})},"queue-operation"===s.type?ez(s):s.uuid||s.timestamp)})})})}function e_({entries:e,projectName:r,sessionId:a}){let n=(0,s.useMemo)(()=>e.filter(e=>"session"===e._source),[e]),i=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>{let t=new Map;for(let s of i){let r=`agent-${s.id}`;t.set(s.id,e.filter(e=>e._source===r))}return t},[e,i]),o=(0,s.useMemo)(()=>eT(n),[n]),[c,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(new Set),[h,p]=(0,s.useState)(!1),x=(0,s.useCallback)(e=>{m(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(M,{entries:n}),(0,t.jsx)(en,{projectName:r,sessionId:a}),(0,t.jsx)(em,{projectName:r,sessionId:a}),(0,t.jsx)(eR,{projectName:r,sessionId:a}),i.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${c?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i.length,")"]})]}),!c&&i.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(M,{entries:l.get(e.id)||[],compact:!0}),(0,t.jsx)(en,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(em,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(eR,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(s=eT(l.get(e.id)||[])).length>0?(0,t.jsx)(eO,{tools:s,compact:!0}):null]})]},e.id)})]}),o.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(eO,{tools:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>p(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!h&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===n.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(eA,{entries:n,allEntries:e,projectName:r,sessionId:a})})]})]})}e.s([],76248),e.i(76248),e.s(["default",()=>e_],36406)},5780,e=>{e.n(e.i(36406))}]);
4
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(n&&s.skipInitialOnChange)&&s.onChange(r),n=!1,r}return i.updateDeps=e=>{a=e},i}function n(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let i=e=>e,l=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},o={passive:!0},c=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,o),()=>{s.removeEventListener("resize",r)}},d="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let a,n=e.scrollElement;if(!n)return;let i=e.targetWindow;if(!i)return;let l=0,c=e.options.useScrollendEvent&&d?()=>void 0:(s=()=>{t(l,!1)},r=e.options.isScrollingResetDelay,function(...e){i.clearTimeout(a),a=i.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{l=n[e.options.horizontal?"scrollX":"scrollY"],c(),t(l,s)},m=u(!0),h=u(!1);n.addEventListener("scroll",m,o);let p=e.options.useScrollendEvent&&d;return p&&n.addEventListener("scrollend",h,o),()=>{n.removeEventListener("scroll",m),p&&n.removeEventListener("scrollend",h)}},m=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},h=(e,{adjustments:t=0,behavior:s},r)=>{var a,n;null==(n=null==(a=r.scrollElement)?void 0:a.scrollTo)||n.call(a,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class p{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:i,rangeExtractor:l,onChange:()=>{},measureElement:m,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=a(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let a=t-1;a>=0;a--){let t=e[a];if(s.has(t.lane))continue;let n=r.get(t.lane);if(null==n||t.end>n.end?r.set(t.lane,t):t.end<n.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=a(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,s,r,a,n)=>(void 0!==this.prevLanes&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:a,lanes:n}),{key:!1}),this.getMeasurements=a(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:a,lanes:n},i)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let o=this.measurementsCache.slice(0,l),c=Array(n).fill(void 0);for(let e=0;e<l;e++){let t=o[e];t&&(c[t.lane]=e)}for(let a=l;a<e;a++){let e,n,l=r(a),d=this.laneAssignments.get(a);if(void 0!==d&&this.options.lanes>1){let r=c[e=d],a=void 0!==r?o[r]:void 0;n=a?a.end+this.options.gap:t+s}else{let r=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a);n=r?r.end+this.options.gap:t+s,e=r?r.lane:a%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(a,e)}let u=i.get(l),m="number"==typeof u?u:this.options.estimateSize(a),h=n+m;o[a]={index:a,start:n,size:m,end:h,key:l,lane:e},c[e]=a}return this.measurementsCache=o,o},{key:!1,debug:()=>this.options.debug}),this.calculateRange=a(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};let n=x(0,a,t=>e[t].start,s),i=n;if(1===r)for(;i<a&&e[i].end<s+t;)i++;else if(r>1){let l=Array(r).fill(0);for(;i<a&&l.some(e=>e<s+t);){let t=e[i];l[t.lane]=t.end,i++}let o=Array(r).fill(s+t);for(;n>=0&&o.some(e=>e>=s);){let t=e[n];o[t.lane]=t.start,n--}n=Math.max(0,n-n%r),i=Math.min(a,i+(r-1-i%r))}return{startIndex:n,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=a(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,a)=>null===r||null===a?[]:e({startIndex:r,endIndex:a,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let s=this.indexFromElement(e),r=this.measurementsCache[s];if(!r)return;let a=r.key,n=this.elementsCache.get(a);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{let s=this.measurementsCache[e];if(!s)return;let r=t-(this.itemSizeCache.get(s.key)??s.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(s,r,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=a(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,a=e.length;r<a;r++){let a=t[e[r]];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return n(t[x(0,t.length-1,e=>n(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),a=this.getScrollOffset();return"auto"===t&&(t=e>=a+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.measurementsCache[e];if(!s)return;let r=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(s.end>=a+r-this.options.scrollPaddingEnd)t="end";else{if(!(s.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let n="end"===t?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t,s.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:s}={})=>{"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:t="auto",behavior:s}={})=>{"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0,a=t=>{if(!this.targetWindow)return;let r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);let[a,i]=r;this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{if(!this.targetWindow)return;let t=()=>{if(this.currentScrollToIndex!==e)return;let t=this.getScrollOffset(),s=this.getOffsetForIndex(e,i);s?1.01>Math.abs(s[0]-t)||n(i):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},n=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(++r<10?this.targetWindow.requestAnimationFrame(()=>a(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};a(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}let x=(e,t,s,r)=>{for(;e<=t;){let a=(e+t)/2|0,n=s(a);if(n<r)e=a+1;else{if(!(n>r))return a;t=a-1}}return e>0?e-1:0},f="u">typeof document?s.useLayoutEffect:s.useEffect;var g=e.i(64659),y=e.i(75254);let b=(0,y.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,y.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,y.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),N=(0,y.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),w=(0,y.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var k=e.i(86311);let S=(0,y.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),M=s.default.memo(function({entries:e,compact:r=!1}){let a=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,a=0,n=0,i=new Set;for(let l of e)if("user"===l.type&&t++,"queue-operation"===l.type&&n++,"assistant"===l.type){for(let e of(s++,l.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?a++:r++);l.message.model&&i.add(l.message.model)}let l="";return e.length>=2&&(l=function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let s=Math.floor(t/60);if(s>=60){let e=Math.floor(s/60);return`${e}h ${s%60}m`}let r=(t%60).toFixed(0);return`${s}m ${r}s`}(e[e.length-1].timestampMs-e[0].timestampMs)),{turnCount:n,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:a,duration:l,models:Array.from(i)}})(e),[e]),n=r?"w-3.5 h-3.5":"w-4 h-4",i=r?"text-xs font-medium":"text-sm font-medium",l=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",o=[...r?[]:[{Icon:k.MessageSquare,color:"text-primary",v:a.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:a.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:a.assistantCount,l:"Assistant"},{Icon:b,color:"text-[color:var(--chart-3)]",v:a.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:S,color:"text-[color:var(--chart-5)]",v:a.subagentCount,l:"Subagents"},{Icon:w,color:"text-[color:var(--chart-4)]",v:a.duration||"—",l:"Duration"},{Icon:N,color:"text-[color:var(--chart-5)]",v:a.models.length>0?a.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:o.map(({Icon:e,color:s,v:r,l:a})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${n} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:l,children:a})]})]},a))})})}),C=(0,y.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var I=e.i(63059);function E(e){return JSON.stringify(e.raw,null,2)}let $=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function R(e){let t=new Date(e),s=$.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let T=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:a}){let n="function"==typeof a,i=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${n?" group-hover:bg-primary/20 transition-colors":""}`,children:[n?(0,t.jsx)(I.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(C,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:R(e.timestampMs)}),n&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return n?(0,t.jsxs)("button",{type:"button",onClick:a,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var O=e.i(47163);let z={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},A={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},_={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},D=(0,y.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),F=(0,y.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),q=(0,y.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function L({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(D,{className:s});case"progress":return(0,t.jsx)(F,{className:s});case"system":return(0,t.jsx)(q,{className:s});case"queue-operation":return(0,t.jsx)(C,{className:s})}}function W({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${A[e]}`,children:[(0,t.jsx)(L,{type:e}),z[e]]})}var P=e.i(24380);function U({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(P.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:R(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(P.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let V=(0,y.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var H=e.i(73884);let B=(0,y.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),J=(0,y.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var Q=e.i(16715),K=e.i(95187);let X=(0,K.createServerReference)("788e85b773ba4c802a39f2c22099223a8b6a78b374",K.callServer,void 0,K.findSourceMapURL,"checkEvalCacheAndList");async function Y(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"eval",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}let G=(0,K.createServerReference)("601ea0a2730e579ec80a02a547f7771c5bd0f4b244",K.callServer,void 0,K.findSourceMapURL,"clearAlertMarker"),Z=(0,K.createServerReference)("78e2d3d664d858d2ac3558a99b066f4bcd62100153",K.callServer,void 0,K.findSourceMapURL,"invalidateSessionItemCaches");function ee({score:e}){let s=Math.round(100*e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden max-w-[80px]",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e>=.8?"bg-green-500":e>=.5?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s}%`}})}),(0,t.jsxs)("span",{className:"text-xs font-mono text-muted-foreground w-8",children:[s,"%"]})]})}function et({result:e}){return e.error?(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}):e.pass?(0,t.jsx)(V,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(H.XCircle,{className:"w-4 h-4 text-red-500"})}function es({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full animate-pulse max-w-[80px]"})]})}function er({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function ea({result:e,cached:r,onRerun:a,globalLoading:n}){let[i,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=e.error||e.message,u=!!d,m=async t=>{t.stopPropagation(),c(!0);try{await a(e.name)}finally{c(!1)}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors ${u?"cursor-pointer":""}`,onClick:()=>u&&l(e=>!e),children:[u&&(0,t.jsx)(I.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`}),(0,t.jsx)(et,{result:e}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)(ee,{score:e.score}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.error&&(0,t.jsx)("span",{className:"text-xs text-yellow-500 flex-1 truncate min-w-0",children:e.error}),e.message&&!e.error&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this eval","aria-label":`Re-run eval ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&d&&(0,t.jsxs)("div",{className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(P.CopyButton,{text:d})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:d})]})]})}function en({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),c([]),X(e,r,a,n).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEvals){h(!0),u(!1);return}if(c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),x(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let a=await Y(e,r,s,!1,l);if(t||!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t||!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load evals"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,a,n,i]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await X(e,r,a,n);if(t||!s.ok||!s.hasEvals)return;c(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,a,n]);let k=(0,s.useCallback)(async()=>{y(!0),c(e=>e.map(e=>({status:"loading",name:e.name})));let t=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{await Z("evals",e,r,a),await G(e,r);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let a=await Y(e,r,s,!0,t);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&x(!1)}finally{w.current&&y(!1)}},[e,r,a,n,i,o]),S=(0,s.useCallback)(async t=>{x(!1),c(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let s=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{let a=await Y(e,r,t,!0,s);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===t?{status:"done",name:t,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===t?{status:"error",name:t,error:a.error}:e))}catch(e){if(!w.current)return;c(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Re-run failed"}:s))}},[e,r,a,n,i]),M=o.filter(e=>"done"===e.status),I=o.filter(e=>"loading"===e.status).length,E=M.map(e=>e.result).filter(e=>!e.skipped),$=E.filter(e=>!e.error&&e.pass).length,R=E.filter(e=>!e.error&&!e.pass).length,T=M.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,O=d||I>0||f;if(m)return null;let z=l?"p-2.5":"p-4",A=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading evals..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let _=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==_.length||O?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${z} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(J,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Eval Results"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[$>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V,{className:"w-3.5 h-3.5 text-green-500"}),(0,t.jsx)("span",{className:"font-medium",children:$}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"passed"})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(H.XCircle,{className:"w-3.5 h-3.5 text-red-500"}),(0,t.jsx)("span",{className:"font-medium",children:R}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"failed"})]}),T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"font-medium",children:T}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"errored"})]}),I>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 text-muted-foreground animate-spin"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[I," running..."]})]}),p&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"})]}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"divide-y divide-border/50",children:_.map(e=>"loading"===e.status?(0,t.jsx)(es,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(er,{name:e.name,error:e.error},e.name):(0,t.jsx)(ea,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]}):null}let ei=(0,y.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,K.createServerReference)("78ae17156a3a1f1a84f490dd8a92ff73646bd7594d",K.callServer,void 0,K.findSourceMapURL,"checkEnrichmentCacheAndList");async function eo(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"enrichment",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}function ec({name:e}){return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"w-10 h-3 bg-muted rounded animate-pulse"})]}),(0,t.jsxs)("div",{className:"pl-1 space-y-1",children:[(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-2/3"}),(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-1/2"})]})]})}function ed({name:e,error:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})})}function eu({result:e,cached:s}){if(e.error)return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error})]})});let r=Object.entries(e.data);return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),s&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-y-1 pl-1",children:r.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2 min-w-0 flex-wrap",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-primary/70 shrink-0",children:[e,":"]}),(0,t.jsx)("span",{className:"text-sm font-mono break-all",title:String(s),children:"boolean"==typeof s?s?"Yes":"No":"number"==typeof s?s.toLocaleString():String(s)})]},e))})]})}function em({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),c([]),el(e,r,a,n).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEnrichers){h(!0),u(!1);return}if(c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),x(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let a=await eo(e,r,s,!1,l);if(t||!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t||!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load enrichments"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,a,n,i]);let k=(0,s.useCallback)(async()=>{y(!0),c(e=>e.map(e=>({status:"loading",name:e.name})));let t=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{await Z("enrichments",e,r,a);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let a=await eo(e,r,s,!0,t);if(!w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(!w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&x(!1)}finally{w.current&&y(!1)}},[e,r,a,n,i,o]),S=o.filter(e=>"done"===e.status),M=o.filter(e=>"loading"===e.status).length,I=S.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,E=d||M>0||f;if(m)return null;let $=l?"p-2.5":"p-4",R=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading enrichments..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let T=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==T.length||E?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${$} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ei,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Enrichment Data"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[I>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[I," errored"]})]}),M>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[M," running..."]})]}),p&&!E&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:E,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"space-y-3 divide-y divide-border/50",children:T.map(e=>(0,t.jsxs)("div",{className:"pt-2 first:pt-0",children:["loading"===e.status&&(0,t.jsx)(ec,{name:e.name}),"error"===e.status&&(0,t.jsx)(ed,{name:e.name,error:e.error}),"done"===e.status&&(0,t.jsx)(eu,{result:e.result,cached:e.cached})]},e.name))})]}):null}let eh=(0,y.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),ep=s.default.memo(function({block:e,allEntries:s,projectName:r,sessionId:a}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let n=e.subagentId&&s?s.filter(t=>t._source===`agent-${e.subagentId}`):void 0;return(0,t.jsx)(ey,{block:e,subagentEntries:n,projectName:r,sessionId:a})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(b,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(U,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(eh,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function ex({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:a}){let{content:n}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:n.map((e,n)=>(0,t.jsx)(ep,{block:e,allEntries:s,projectName:r,sessionId:a},n))})}),eg=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:E(e)})]})]})});function ey({block:e,subagentEntries:r,projectName:a,sessionId:n}){let[i,l]=(0,s.useState)(!1),o=(0,s.useCallback)(()=>{l(e=>!e)},[]),c=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(S,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(I.ChevronRight,{className:(0,O.cn)("w-3 h-3 transition-transform",i&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i?"Collapse":"View subagent log"})]}),i&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{entries:r,compact:!0}),(0,t.jsx)(en,{projectName:a,sessionId:n,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0}),(0,t.jsx)(em,{projectName:a,sessionId:n,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0})]}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(T,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(ev,{entry:e,projectName:a,sessionId:n},e.uuid||e.timestamp))]}),(0,t.jsx)(U,{block:e})]})}function eb({entry:e,allEntries:s,projectName:r,sessionId:a}){switch(e.type){case"user":return(0,t.jsx)(ex,{entry:e});case"assistant":return(0,t.jsx)(ef,{entry:e,allEntries:s,projectName:r,sessionId:a});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(eg,{entry:e})}}let ev=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:a}){return(0,t.jsxs)("div",{className:`border-l-4 ${_[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(W,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[(0,t.jsx)(P.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return E(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:R(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(eb,{entry:e,allEntries:s,projectName:r,sessionId:a})})]})}),ej=(0,y.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eN=(0,y.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ew=(0,K.createServerReference)("7894b7cf20e22ac45be4e8061e492a8d2e8f948426",K.callServer,void 0,K.findSourceMapURL,"checkActionCacheAndList");async function ek(e,t,s,r=!1,a){let n;try{n=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"action",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...a&&{agentId:a.agentId,subagentType:a.subagentType,subagentDescription:a.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===n.status?{ok:!1,error:"__queued__"}:n.ok?n.json():{ok:!1,error:`Queue request failed: ${n.status}`}}let eS=(0,K.createServerReference)("7c0c5c62baaeee521bb2533c7e4bc59ca499c8865e",K.callServer,void 0,K.findSourceMapURL,"invalidateSessionItemCache"),eM=(0,K.createServerReference)("00eb300dc82510344de416129b0c7470575d42a2a5",K.callServer,void 0,K.findSourceMapURL,"getQueueStatusAction");function eC({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"running..."})]})}function eI({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function eE({name:e,onRun:s,disabled:r}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(eN,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"not run"}),(0,t.jsxs)("button",{onClick:s,disabled:r,className:"ml-auto flex-shrink-0 inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,t.jsx)(C,{className:"w-2.5 h-2.5"}),"Run"]})]})}function e$({result:e,cached:r,onRerun:a,globalLoading:n}){let[i,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=e.output||e.message,u=!!d,m=async t=>{t.stopPropagation(),c(!0);try{await a(e.name)}finally{c(!1)}};if(e.error)return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]});let h="success"===e.status?(0,t.jsx)(V,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(H.XCircle,{className:"w-4 h-4 text-red-500"}),p=`action-result-${e.name}`;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors",children:[u&&(0,t.jsx)("button",{onClick:()=>l(e=>!e),"aria-expanded":i,"aria-controls":p,className:"flex-shrink-0 p-0 bg-transparent border-none cursor-pointer","aria-label":`Toggle details for ${e.name}`,children:(0,t.jsx)(I.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`})}),h,(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.message&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||n,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(Q.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&d&&(0,t.jsxs)("div",{id:p,className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(P.CopyButton,{text:d})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:d})]})]})}function eR({projectName:e,sessionId:r,agentId:a,subagentType:n,subagentDescription:i,compact:l}){let[o,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(0);(0,s.useEffect)(()=>{let t=++w.current;return u(!0),v(null),h(!1),c([]),ew(e,r,a,n).then(async s=>{if(t!==w.current)return;if(!s.ok){v(s.error),u(!1);return}if(!s.hasActions){h(!0),u(!1);return}let n=new Set;if(s.uncachedNames.length>0)try{let s=await eM();if(t!==w.current)return;let i=a?`${r}/agent-${a}`:r;for(let t of[...s.pending,...s.processing])"action"===t.type&&t.projectName===e&&t.sessionId===i&&n.add(t.itemName)}catch{}c(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:n.has(e)?{status:"loading",name:e}:{status:"idle",name:e}})),x(0===s.uncachedNames.length),u(!1)}).catch(e=>{t===w.current&&(v(e instanceof Error?e.message:"Failed to load actions"),u(!1))}),()=>{}},[e,r,a,n]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await ew(e,r,a,n);if(t||!s.ok||!s.hasActions)return;c(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,a,n]);let k=(0,s.useCallback)(async(t,s=!1)=>{let l=w.current;c(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let o=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{s&&await eS("actions",e,r,t,a).catch(e=>console.error("Failed to invalidate action cache:",e));let n=await ek(e,r,t,s,o);if(l!==w.current||!n.ok&&"__queued__"===n.error)return;n.ok?c(e=>e.map(e=>e.name===t?{status:"done",name:t,result:n.result,cached:!1}:e)):c(e=>e.map(e=>e.name===t?{status:"error",name:t,error:n.error}:e))}catch(e){if(l!==w.current)return;c(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}},[e,r,a,n,i]),S=(0,s.useCallback)(async e=>{x(!1),await k(e,!0)},[k]),M=(0,s.useCallback)(async()=>{let t=w.current;y(!0);let s=o.map(e=>e.name);c(e=>e.map(e=>({status:"loading",name:e.name})));let l=a?{agentId:a,subagentType:n,subagentDescription:i}:void 0;try{try{await Z("actions",e,r,a)}catch(e){console.error("Failed to invalidate action caches:",e)}await Promise.all(s.map(async s=>{try{let a=await ek(e,r,s,!0,l);if(t!==w.current||!a.ok&&"__queued__"===a.error)return;a.ok?c(e=>e.map(e=>e.name===s?{status:"done",name:s,result:a.result,cached:!1}:e)):c(e=>e.map(e=>e.name===s?{status:"error",name:s,error:a.error}:e))}catch(e){if(t!==w.current)return;c(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),t===w.current&&x(!1)}finally{t===w.current&&y(!1)}},[e,r,a,n,i,o]),I=o.filter(e=>"done"===e.status),E=o.filter(e=>"loading"===e.status).length,$=o.filter(e=>"idle"===e.status).length,R=I.filter(e=>"error"===e.result.status||!!e.result.error).length+o.filter(e=>"error"===e.status).length,T=I.filter(e=>"success"===e.result.status&&!e.result.error).length,O=d||E>0||f;if(m)return null;let z=l?"p-2.5":"p-4",A=l?"text-xs":"text-sm";if(d)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-muted-foreground`,children:[(0,t.jsx)(Q.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading actions..."]})});if(b&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${z}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${A} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),b]})});if(0===o.length)return null;let _=o.filter(e=>!("done"===e.status&&e.result.skipped));return 0!==_.length||O?(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${z} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),"aria-expanded":!j,"aria-controls":"action-results-content",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ej,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Actions"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-green-500",children:[(0,t.jsx)(V,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:T})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[R," errored"]})]}),$>0&&!O&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/50",children:[$," pending"]}),E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(Q.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[E," running..."]})]}),p&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>M(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(Q.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Run All"]})]})]}),!j&&(0,t.jsx)("div",{id:"action-results-content",className:"divide-y divide-border/50",children:_.map(e=>"idle"===e.status?(0,t.jsx)(eE,{name:e.name,onRun:()=>k(e.name,!0),disabled:O},e.name):"loading"===e.status?(0,t.jsx)(eC,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(eI,{name:e.name,error:e.error},e.name):(0,t.jsx)(e$,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]}):null}function eT(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eO({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(b,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function ez(e){return`${e.uuid}-${e.timestampMs}`}function eA({entries:e,allEntries:a,projectName:n,sessionId:i}){let[l,o]=(0,s.useState)(new Set),[d,m]=(0,s.useState)(0),x=(0,s.useCallback)(e=>{e&&m(e.offsetTop)},[]),g=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let a of e)"queue-operation"===a.type?(null!==s&&t.set(s,r),s=ez(a),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),y=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(ez(e)),!0):!t)},[e,l]),b=(0,s.useCallback)(e=>{o(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),v=function({useFlushSync:e=!0,...t}){let a=s.useReducer(()=>({}),{})[1],n={...t,onChange:(s,n)=>{var i;e&&n?(0,r.flushSync)(a):a(),null==(i=t.onChange)||i.call(t,s,n)}},[i]=s.useState(()=>new p(n));return i.setOptions(n),f(()=>i._didMount(),[]),f(()=>i._willUpdate()),i}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:c,observeElementOffset:u,scrollToFn:h,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:y.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(y[e]),overscan:5,scrollMargin:d}});return(0,t.jsx)("div",{ref:x,children:(0,t.jsx)("div",{style:{height:`${v.getTotalSize()}px`,width:"100%",position:"relative"},children:v.getVirtualItems().map(e=>{let s=y[e.index];return(0,t.jsx)("div",{"data-index":e.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-v.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(T,{entry:s,isCollapsed:l.has(ez(s)),entryCount:g.get(ez(s))??0,onToggle:()=>b(ez(s))}):(0,t.jsx)(ev,{entry:s,allEntries:a,projectName:n,sessionId:i})},"queue-operation"===s.type?ez(s):s.uuid||s.timestamp)})})})}function e_({entries:e,projectName:r,sessionId:a}){let n=(0,s.useMemo)(()=>e.filter(e=>"session"===e._source),[e]),i=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>{let t=new Map;for(let s of i){let r=`agent-${s.id}`;t.set(s.id,e.filter(e=>e._source===r))}return t},[e,i]),o=(0,s.useMemo)(()=>eT(n),[n]),[c,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(new Set),[h,p]=(0,s.useState)(!1),x=(0,s.useCallback)(e=>{m(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(M,{entries:n}),(0,t.jsx)(en,{projectName:r,sessionId:a}),(0,t.jsx)(em,{projectName:r,sessionId:a}),(0,t.jsx)(eR,{projectName:r,sessionId:a}),i.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${c?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i.length,")"]})]}),!c&&i.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(M,{entries:l.get(e.id)||[],compact:!0}),(0,t.jsx)(en,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(em,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(eR,{projectName:r,sessionId:a,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(s=eT(l.get(e.id)||[])).length>0?(0,t.jsx)(eO,{tools:s,compact:!0}):null]})]},e.id)})]}),o.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(eO,{tools:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>p(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!h&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===n.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(eA,{entries:n,allEntries:e,projectName:r,sessionId:a})})]})]})}e.s([],76248),e.i(76248),e.s(["default",()=>e_],36406)},5780,e=>{e.n(e.i(36406))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},73520,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(75254).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var s=e.i(63059);function a({currentPage:e,totalPages:a,onPageChange:n}){if(a<=1)return null;let l=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>n(e-1),disabled:1===e,className:l(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(a<=7)return Array.from({length:a},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),s=Math.min(a-1,e+1);e<=3&&(s=Math.min(5,a-1)),e>=a-2&&(r=Math.max(2,a-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=s;e++)t.push(e);return s<a-1&&t.push("ellipsis-end"),t.push(a),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>n(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>n(e+1),disabled:e===a,className:l(e===a),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]})]})}e.s(["default",()=>a],73520)},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function s(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),a=(0,t.usePathname)(),n=(0,r.useRef)(null),l=(0,r.useCallback)(t=>e.get(t),[e]),o=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),d=(0,r.useCallback)(t=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,s]of Object.entries(t))void 0===s||""===s?r.delete(e):r.set(e,s);let n=r.toString(),l=n?`${a}?${n}`:a;s.replace(l,{scroll:!1})},150)},[e,a,s]);return(0,r.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),{get:l,getAll:o,setAll:d}}function a(e){return"all"===e?void 0:e}function n(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"}function l(e){let t={};return e.from&&(t.from=p(e.from)),e.to&&(t.to=p(e.to)),t}function o(e,t){return{from:h(e),to:h(t)}}function d(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")}function i(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]}function c(e){return e<=1?void 0:String(e)}function u(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1}function m(e,t){switch(e.type){case"boolean":return"all"===t?void 0:t;case"number":if(t.min===e.min&&t.max===e.max)return;return`${t.min}~${t.max}`;case"string":if(t.size===e.values.length)return;return Array.from(t).map(e=>encodeURIComponent(e)).join(",");case"date":if(!t.from&&!t.to)return;return`${t.from??""},${t.to??""}`}}function x(e,t){if(null===t||""===t)return null;switch(e.type){case"boolean":if("true"===t||"false"===t)return t;return null;case"number":{let e=t.split("~");if(2!==e.length)return null;let r=parseFloat(e[0]),s=parseFloat(e[1]);if(!Number.isFinite(r)||!Number.isFinite(s))return null;return{min:r,max:s}}case"string":{let r=t.split(",").map(e=>decodeURIComponent(e.trim())).filter(t=>e.values.includes(t));if(0===r.length)return null;return new Set(r)}case"date":{let e=t.split(",");if(2!==e.length)return null;let r=e[0]||null,s=e[1]||null;if(!r&&!s||r&&!f(r)||s&&!f(s))return null;return{from:r,to:s}}}}function p(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${s}`}function h(e){if(!e||!f(e))return null;let[t,r,s]=e.split("-").map(Number);return new Date(t,r-1,s,12,0,0)}function f(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)&&!isNaN(Date.parse(e))}e.s(["useUrlParams",()=>s],80060),e.s(["activeFilterToParam",()=>m,"dateRangeToParams",()=>l,"keywordsToParam",()=>d,"pageToParam",()=>c,"paramToActiveFilter",()=>x,"paramToKeywords",()=>i,"paramToPage",()=>u,"paramToPreset",()=>n,"paramsToDateRange",()=>o,"presetToParam",()=>a],2711)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",()=>t],73884)},64439,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(22016),a=e.i(75254);let n=(0,a.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),l=(0,a.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var o=e.i(73884),d=e.i(16715),i=e.i(73520),c=e.i(95187);let u=(0,c.createServerReference)("40e14d485879470cb66d1c23aacbea6d5d04202fe7",c.callServer,void 0,c.findSourceMapURL,"getCompletedHistoryAction"),m=(0,c.createServerReference)("604d2dc15e037ac763b8bfb0537ca778d76bab9bcf",c.callServer,void 0,c.findSourceMapURL,"searchCompletedHistoryAction");var x=e.i(85881),p=e.i(80060),h=e.i(2711);function f(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);return`${s}h ago`}function g({type:e}){let r="eval"===e?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"action"===e?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400";return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium ${r}`,children:e.toUpperCase()})}function b({priority:e}){let r=e<=0;return(0,t.jsx)("span",{className:`text-[0.6rem] font-medium px-1.5 py-0.5 rounded ${r?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":"bg-muted text-muted-foreground"}`,children:r?"HIGH":"LOW"})}function y({projectName:e,sessionId:r}){return(0,t.jsx)(s.default,{href:`/project/${encodeURIComponent(e)}/session/${encodeURIComponent(r)}`,className:"text-blue-600 dark:text-blue-400 hover:underline truncate block max-w-[200px]",children:r})}function j(){let e,a,{intervalSec:c}=(0,x.useAutoRefresh)(),j=(0,p.useUrlParams)(),N=(0,r.useRef)(!1),[v,k]=(0,r.useState)(null),[w,S]=(0,r.useState)(null),[C,$]=(0,r.useState)(()=>{let e=j.get("tab");return"pending"===e||"processing"===e||"completed"===e?e:"processing"}),[P,R]=(0,r.useState)(()=>(0,h.paramToPage)(j.get("page"))),[T,I]=(0,r.useState)(null),A=(0,r.useRef)(C),[U,E]=(0,r.useState)(()=>{let e=j.get("type");return"eval"===e||"enrichment"===e||"action"===e?e:""}),[F,M]=(0,r.useState)(()=>j.get("item")??""),[D,L]=(0,r.useState)(()=>j.get("session")??""),z=(0,r.useRef)(null),H=(0,r.useRef)({filterType:U,filterItem:F,filterSession:D});H.current={filterType:U,filterItem:F,filterSession:D},(0,r.useEffect)(()=>{if(!N.current){N.current=!0;return}j.setAll({tab:"processing"===C?void 0:C,type:U||void 0,item:F||void 0,session:D||void 0,page:"completed"===C?(0,h.pageToParam)(P):void 0})},[C,U,F,D,P]);let q=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/queue-status",{cache:"no-store"});if(e.ok){let t=await e.json();k(t),S(null)}else S(`Failed to fetch: ${e.status}`)}catch{S("Network error")}},[]),O=(0,r.useCallback)(async e=>{try{let t,{filterType:r,filterItem:s,filterSession:a}=H.current;t=""!==r||""!==s||""!==a?await m({type:r||void 0,itemName:s||void 0,sessionId:a||void 0},e):await u(e),I(t)}catch{}},[]);(0,r.useEffect)(()=>{q();let e=setInterval(q,c>0?1e3*c:5e3);return()=>clearInterval(e)},[q,c]),(0,r.useEffect)(()=>{"completed"===C&&"completed"!==A.current&&(R(1),O(1)),A.current=C},[C,O]),(0,r.useEffect)(()=>{if("completed"===C)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{R(1),O(1)},300),()=>{z.current&&clearTimeout(z.current)}},[U,F,D]),(0,r.useEffect)(()=>{if("completed"!==C)return;O(P);let e=setInterval(()=>O(P),c>0?1e3*c:5e3);return()=>clearInterval(e)},[P,C,O,c]),(0,r.useEffect)(()=>{"completed"===C&&c>0&&1===P&&T&&0===T.entries.length&&T.totalPages>1&&R(2)},[C,c,P,T]);let B=[{key:"pending",label:"In Queue",count:v?.pending.length??0},{key:"processing",label:"Processing",count:v?.processing.length??0},{key:"completed",label:"Processed"}];return(0,t.jsxs)("div",{className:"min-h-screen bg-background p-6 max-w-4xl mx-auto",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)(s.default,{href:"/",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,t.jsx)(n,{className:"h-4 w-4"}),"Back"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mt-2",children:"Queue Details"})]}),w&&!v&&(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-destructive mb-2",children:w}),(0,t.jsx)("button",{onClick:q,className:"text-xs text-primary hover:underline",children:"Retry"})]}),!v&&!w&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),v&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex gap-1 border-b border-border",children:B.map(e=>(0,t.jsxs)("button",{onClick:()=>$(e.key),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${C===e.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[e.label,null!=e.count&&(0,t.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:["(",e.count,")"]})]},e.key))}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:["pending"===C&&(0===v.pending.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No items in queue."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Priority"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Queued"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:v.pending.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.itemName}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b,{priority:e.priority})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.addedAt)})]},e.key))})]})})),"processing"===C&&(0===v.processing.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No items currently processing."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Priority"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Started"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:v.processing.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(d.RefreshCw,{className:"w-3 h-3 text-blue-500 animate-spin flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.itemName})]})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b,{priority:e.priority})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.startedAt)})]},e.key))})]})})),"completed"===C&&(e=T?.entries??v.completed,a=T?.totalPages??1,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/30",children:[(0,t.jsxs)("select",{value:U,onChange:e=>E(e.target.value),className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground",children:[(0,t.jsx)("option",{value:"",children:"All Types"}),(0,t.jsx)("option",{value:"eval",children:"Eval"}),(0,t.jsx)("option",{value:"enrichment",children:"Enrichment"}),(0,t.jsx)("option",{value:"action",children:"Action"})]}),(0,t.jsx)("input",{type:"text",value:F,onChange:e=>M(e.target.value),placeholder:"Filter by item...",className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground w-40"}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:"Filter by session...",className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground w-40"})]}),0===e.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No completed items."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Completed"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,r)=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.itemName}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground",children:function(e){if(e<1e3)return`${e}ms`;let t=(e/1e3).toFixed(1);return`${t}s`}(e.durationMs)}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.success?(0,t.jsx)(l,{className:"h-3.5 w-3.5 text-green-600 dark:text-green-400"}):(0,t.jsx)(o.XCircle,{className:"h-3.5 w-3.5 text-red-600 dark:text-red-400"})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:new Date(e.completedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},`${e.key}-${e.completedAt}-${r}`))})]})}),(0,t.jsx)(i.default,{currentPage:P,totalPages:a,onPageChange:R})]}))]}),v.recentErrors.length>0&&(0,t.jsxs)("section",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground mb-2",children:["Recent Errors",(0,t.jsxs)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:["(",v.recentErrors.length,")"]})]}),(0,t.jsx)("div",{className:"space-y-1",children:v.recentErrors.map((e,r)=>(0,t.jsxs)("div",{className:"text-xs bg-muted/30 rounded px-2 py-1 flex items-start gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-muted-foreground shrink-0",children:e.key}),(0,t.jsx)("span",{className:"text-red-500 break-all",children:e.error}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 ml-auto",children:f(e.at)})]},`${e.key}-${e.at}-${r}`))})]})]})]})}e.s(["default",()=>j],64439)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},73520,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(75254).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var s=e.i(63059);function a({currentPage:e,totalPages:a,onPageChange:n}){if(a<=1)return null;let l=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>n(e-1),disabled:1===e,className:l(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(a<=7)return Array.from({length:a},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),s=Math.min(a-1,e+1);e<=3&&(s=Math.min(5,a-1)),e>=a-2&&(r=Math.max(2,a-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=s;e++)t.push(e);return s<a-1&&t.push("ellipsis-end"),t.push(a),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>n(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>n(e+1),disabled:e===a,className:l(e===a),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]})]})}e.s(["default",()=>a],73520)},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function s(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),a=(0,t.usePathname)(),n=(0,r.useRef)(null),l=(0,r.useCallback)(t=>e.get(t),[e]),o=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,s]of Object.entries(t))void 0===s||""===s?r.delete(e):r.set(e,s);let n=r.toString(),l=n?`${a}?${n}`:a;s.replace(l,{scroll:!1})},150)},[e,a,s]);return(0,r.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),{get:l,getAll:o,setAll:i}}function a(e){return"all"===e?void 0:e}function n(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"}function l(e){let t={};return e.from&&(t.from=p(e.from)),e.to&&(t.to=p(e.to)),t}function o(e,t){return{from:h(e),to:h(t)}}function i(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")}function d(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]}function c(e){return e<=1?void 0:String(e)}function u(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1}function m(e,t){switch(e.type){case"boolean":return"all"===t?void 0:t;case"number":if(t.min===e.min&&t.max===e.max)return;return`${t.min}~${t.max}`;case"string":if(t.size===e.values.length)return;return Array.from(t).map(e=>encodeURIComponent(e)).join(",");case"date":if(!t.from&&!t.to)return;return`${t.from??""},${t.to??""}`}}function x(e,t){if(null===t||""===t)return null;switch(e.type){case"boolean":if("true"===t||"false"===t)return t;return null;case"number":{let e=t.split("~");if(2!==e.length)return null;let r=parseFloat(e[0]),s=parseFloat(e[1]);if(!Number.isFinite(r)||!Number.isFinite(s))return null;return{min:r,max:s}}case"string":{let r=t.split(",").map(e=>decodeURIComponent(e.trim())).filter(t=>e.values.includes(t));if(0===r.length)return null;return new Set(r)}case"date":{let e=t.split(",");if(2!==e.length)return null;let r=e[0]||null,s=e[1]||null;if(!r&&!s||r&&!f(r)||s&&!f(s))return null;return{from:r,to:s}}}}function p(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${s}`}function h(e){if(!e||!f(e))return null;let[t,r,s]=e.split("-").map(Number);return new Date(t,r-1,s,12,0,0)}function f(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)&&!isNaN(Date.parse(e))}e.s(["useUrlParams",()=>s],80060),e.s(["activeFilterToParam",()=>m,"dateRangeToParams",()=>l,"keywordsToParam",()=>i,"pageToParam",()=>c,"paramToActiveFilter",()=>x,"paramToKeywords",()=>d,"paramToPage",()=>u,"paramToPreset",()=>n,"paramsToDateRange",()=>o,"presetToParam",()=>a],2711)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",()=>t],73884)},64439,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(22016),a=e.i(75254);let n=(0,a.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),l=(0,a.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var o=e.i(73884),i=e.i(16715),d=e.i(73520),c=e.i(95187);let u=(0,c.createServerReference)("4090b9baf08589d62366c047c9e8d970e14f9ff8c4",c.callServer,void 0,c.findSourceMapURL,"getCompletedHistoryAction"),m=(0,c.createServerReference)("607c85eb522256170fca539abf90f0d36ef7a09473",c.callServer,void 0,c.findSourceMapURL,"searchCompletedHistoryAction");var x=e.i(85881),p=e.i(80060),h=e.i(2711);function f(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);return`${s}h ago`}function g({type:e}){let r="eval"===e?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"action"===e?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400";return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium ${r}`,children:e.toUpperCase()})}function b({priority:e}){let r=e<=0;return(0,t.jsx)("span",{className:`text-[0.6rem] font-medium px-1.5 py-0.5 rounded ${r?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":"bg-muted text-muted-foreground"}`,children:r?"HIGH":"LOW"})}function y({projectName:e,sessionId:r}){return(0,t.jsx)(s.default,{href:`/project/${encodeURIComponent(e)}/session/${encodeURIComponent(r)}`,className:"text-blue-600 dark:text-blue-400 hover:underline truncate block max-w-[200px]",children:r})}function j(){let e,a,{intervalSec:c}=(0,x.useAutoRefresh)(),j=(0,p.useUrlParams)(),N=(0,r.useRef)(!1),[v,k]=(0,r.useState)(null),[w,S]=(0,r.useState)(null),[C,$]=(0,r.useState)(()=>{let e=j.get("tab");return"pending"===e||"processing"===e||"completed"===e?e:"processing"}),[P,R]=(0,r.useState)(()=>(0,h.paramToPage)(j.get("page"))),[T,I]=(0,r.useState)(null),A=(0,r.useRef)(C),[U,E]=(0,r.useState)(()=>{let e=j.get("type");return"eval"===e||"enrichment"===e||"action"===e?e:""}),[F,M]=(0,r.useState)(()=>j.get("item")??""),[D,L]=(0,r.useState)(()=>j.get("session")??""),z=(0,r.useRef)(null),H=(0,r.useRef)({filterType:U,filterItem:F,filterSession:D});H.current={filterType:U,filterItem:F,filterSession:D},(0,r.useEffect)(()=>{if(!N.current){N.current=!0;return}j.setAll({tab:"processing"===C?void 0:C,type:U||void 0,item:F||void 0,session:D||void 0,page:"completed"===C?(0,h.pageToParam)(P):void 0})},[C,U,F,D,P]);let q=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/queue-status",{cache:"no-store"});if(e.ok){let t=await e.json();k(t),S(null)}else S(`Failed to fetch: ${e.status}`)}catch{S("Network error")}},[]),O=(0,r.useCallback)(async e=>{try{let t,{filterType:r,filterItem:s,filterSession:a}=H.current;t=""!==r||""!==s||""!==a?await m({type:r||void 0,itemName:s||void 0,sessionId:a||void 0},e):await u(e),I(t)}catch{}},[]);(0,r.useEffect)(()=>{q();let e=setInterval(q,c>0?1e3*c:5e3);return()=>clearInterval(e)},[q,c]),(0,r.useEffect)(()=>{"completed"===C&&"completed"!==A.current&&(R(1),O(1)),A.current=C},[C,O]),(0,r.useEffect)(()=>{if("completed"===C)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{R(1),O(1)},300),()=>{z.current&&clearTimeout(z.current)}},[U,F,D]),(0,r.useEffect)(()=>{if("completed"!==C)return;O(P);let e=setInterval(()=>O(P),c>0?1e3*c:5e3);return()=>clearInterval(e)},[P,C,O,c]),(0,r.useEffect)(()=>{"completed"===C&&c>0&&1===P&&T&&0===T.entries.length&&T.totalPages>1&&R(2)},[C,c,P,T]);let B=[{key:"pending",label:"In Queue",count:v?.pending.length??0},{key:"processing",label:"Processing",count:v?.processing.length??0},{key:"completed",label:"Processed"}];return(0,t.jsxs)("div",{className:"min-h-screen bg-background p-6 max-w-4xl mx-auto",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)(s.default,{href:"/",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,t.jsx)(n,{className:"h-4 w-4"}),"Back"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mt-2",children:"Queue Details"})]}),w&&!v&&(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-destructive mb-2",children:w}),(0,t.jsx)("button",{onClick:q,className:"text-xs text-primary hover:underline",children:"Retry"})]}),!v&&!w&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),v&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex gap-1 border-b border-border",children:B.map(e=>(0,t.jsxs)("button",{onClick:()=>$(e.key),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${C===e.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[e.label,null!=e.count&&(0,t.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:["(",e.count,")"]})]},e.key))}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:["pending"===C&&(0===v.pending.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No items in queue."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Priority"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Queued"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:v.pending.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.itemName}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b,{priority:e.priority})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.addedAt)})]},e.key))})]})})),"processing"===C&&(0===v.processing.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No items currently processing."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Priority"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Started"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:v.processing.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(i.RefreshCw,{className:"w-3 h-3 text-blue-500 animate-spin flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.itemName})]})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b,{priority:e.priority})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.startedAt)})]},e.key))})]})})),"completed"===C&&(e=T?.entries??v.completed,a=T?.totalPages??1,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/30",children:[(0,t.jsxs)("select",{value:U,onChange:e=>E(e.target.value),className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground",children:[(0,t.jsx)("option",{value:"",children:"All Types"}),(0,t.jsx)("option",{value:"eval",children:"Eval"}),(0,t.jsx)("option",{value:"enrichment",children:"Enrichment"}),(0,t.jsx)("option",{value:"action",children:"Action"})]}),(0,t.jsx)("input",{type:"text",value:F,onChange:e=>M(e.target.value),placeholder:"Filter by item...",className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground w-40"}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:"Filter by session...",className:"h-7 rounded border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground w-40"})]}),0===e.length?(0,t.jsx)("p",{className:"px-4 py-8 text-xs text-muted-foreground text-center",children:"No completed items."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Item"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium text-right",children:"Completed"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,r)=>(0,t.jsxs)("tr",{className:"hover:bg-muted/20",children:[(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(g,{type:e.type})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.itemName}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(y,{projectName:e.projectName,sessionId:e.sessionId})}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground",children:function(e){if(e<1e3)return`${e}ms`;let t=(e/1e3).toFixed(1);return`${t}s`}(e.durationMs)}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.success?(0,t.jsx)(l,{className:"h-3.5 w-3.5 text-green-600 dark:text-green-400"}):(0,t.jsx)(o.XCircle,{className:"h-3.5 w-3.5 text-red-600 dark:text-red-400"})}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:new Date(e.completedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},`${e.key}-${e.completedAt}-${r}`))})]})}),(0,t.jsx)(d.default,{currentPage:P,totalPages:a,onPageChange:R})]}))]}),v.recentErrors.length>0&&(0,t.jsxs)("section",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground mb-2",children:["Recent Errors",(0,t.jsxs)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:["(",v.recentErrors.length,")"]})]}),(0,t.jsx)("div",{className:"space-y-1",children:v.recentErrors.map((e,r)=>(0,t.jsxs)("div",{className:"text-xs bg-muted/30 rounded px-2 py-1 flex items-start gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-muted-foreground shrink-0",children:e.key}),(0,t.jsx)("span",{className:"text-red-500 break-all",children:e.error}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 ml-auto",children:f(e.at)})]},`${e.key}-${e.at}-${r}`))})]})]})]})}e.s(["default",()=>j],64439)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(75254);let o=(0,n.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),l=(0,n.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var a=e.i(47163);function i(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}function u({text:e,className:n}){let[u,s]=(0,r.useState)(!1),d=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!i(e))throw Error("Both clipboard methods failed");s(!0),setTimeout(()=>s(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{i(e)&&(s(!0),setTimeout(()=>s(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:d,title:"Copy to clipboard",className:(0,a.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",n),children:u?(0,t.jsx)(l,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(o,{className:"w-3.5 h-3.5"})})}e.s(["CopyButton",()=>u],24380)},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),a=e.r(9885),i=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let u=(0,i.getDeploymentIdQueryOrEmptyString)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),a=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},s=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(i)),s=t.loading;function d(e){let i=s?(0,n.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,d=u?o.Suspense:o.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...u?{fallback:i}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},69186,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});function n({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}e.s(["default",()=>n])},79348,e=>{e.v(t=>Promise.all(["static/chunks/97c295191089a1c2.js","static/chunks/a49aebd623ae4665.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(75254);let o=(0,n.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),l=(0,n.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var a=e.i(47163);function i(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}function u({text:e,className:n}){let[u,s]=(0,r.useState)(!1),d=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!i(e))throw Error("Both clipboard methods failed");s(!0),setTimeout(()=>s(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{i(e)&&(s(!0),setTimeout(()=>s(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:d,title:"Copy to clipboard",className:(0,a.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",n),children:u?(0,t.jsx)(l,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(o,{className:"w-3.5 h-3.5"})})}e.s(["CopyButton",()=>u],24380)},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),a=e.r(9885),i=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let u=(0,i.getDeploymentIdQueryOrEmptyString)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),a=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},s=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(i)),s=t.loading;function d(e){let i=s?(0,n.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,d=u?o.Suspense:o.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...u?{fallback:i}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},69186,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});function n({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}e.s(["default",()=>n])},79348,e=>{e.v(t=>Promise.all(["static/chunks/97c295191089a1c2.js","static/chunks/03a963c74a738019.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89954,e=>{"use strict";var r=e.i(43476),o=e.i(71645),t=e.i(18566),s=e.i(95187);let d=(0,s.createServerReference)("40bb68ba2962c29eb9ea8abd3a00378698f2d44f11",s.callServer,void 0,s.findSourceMapURL,"login");var a=e.i(15127),n=e.i(22016);function i(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),i=e.get("from")??"/",[l,u]=(0,o.useState)(null),[c,m]=(0,o.useState)(!1);async function x(e){e.preventDefault(),u(null),m(!0);let r=new FormData(e.currentTarget);r.set("redirectTo",i);let o=await d(r);o?.error?(u(o.error),m(!1)):o?.redirectTo&&s.push(o.redirectTo)}return(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-lg border border-border bg-card p-8 shadow-lg",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 mb-6",children:[(0,r.jsx)(n.default,{href:"/",children:(0,r.jsx)(a.Logo,{width:36,height:36})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:"Sign in to Claudeye"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to continue"})]}),(0,r.jsxs)("form",{onSubmit:x,className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{htmlFor:"username",className:"text-sm font-medium text-foreground",children:"Username"}),(0,r.jsx)("input",{id:"username",name:"username",type:"text",required:!0,autoComplete:"username",autoFocus:!0,className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary",placeholder:"admin"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{htmlFor:"password",className:"text-sm font-medium text-foreground",children:"Password"}),(0,r.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"current-password",className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"})]}),l&&(0,r.jsx)("p",{className:"text-sm text-red-500 bg-red-500/10 rounded-md px-3 py-2",children:l}),(0,r.jsx)("button",{type:"submit",disabled:c,className:"mt-1 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:c?"Signing in...":"Sign in"})]})]})})}e.s(["default",()=>i],89954)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89954,e=>{"use strict";var r=e.i(43476),o=e.i(71645),t=e.i(18566),s=e.i(95187);let a=(0,s.createServerReference)("4003fa4cfc61ce63a808fea5ff5e80aad4cd6e9715",s.callServer,void 0,s.findSourceMapURL,"login");var d=e.i(15127),n=e.i(22016);function i(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),i=e.get("from")??"/",[l,c]=(0,o.useState)(null),[u,m]=(0,o.useState)(!1);async function f(e){e.preventDefault(),c(null),m(!0);let r=new FormData(e.currentTarget);r.set("redirectTo",i);let o=await a(r);o?.error?(c(o.error),m(!1)):o?.redirectTo&&s.push(o.redirectTo)}return(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-lg border border-border bg-card p-8 shadow-lg",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 mb-6",children:[(0,r.jsx)(n.default,{href:"/",children:(0,r.jsx)(d.Logo,{width:36,height:36})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:"Sign in to Claudeye"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to continue"})]}),(0,r.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{htmlFor:"username",className:"text-sm font-medium text-foreground",children:"Username"}),(0,r.jsx)("input",{id:"username",name:"username",type:"text",required:!0,autoComplete:"username",autoFocus:!0,className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary",placeholder:"admin"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{htmlFor:"password",className:"text-sm font-medium text-foreground",children:"Password"}),(0,r.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"current-password",className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"})]}),l&&(0,r.jsx)("p",{className:"text-sm text-red-500 bg-red-500/10 rounded-md px-3 py-2",children:l}),(0,r.jsx)("button",{type:"submit",disabled:u,className:"mt-1 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Signing in...":"Sign in"})]})]})})}e.s(["default",()=>i],89954)}]);