codesesh 1.0.1 → 1.0.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.
- package/README.md +2 -1
- package/dist/{chunk-OFTTM3UD.js → chunk-PROMURPM.js} +2 -2
- package/dist/{chunk-JHX5OLL4.js → chunk-VAUC2W7I.js} +1303 -16
- package/dist/chunk-VAUC2W7I.js.map +1 -0
- package/dist/{dist-N2PQATP2.js → dist-6QTGTYZT.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/scan-refresh-worker.js +2 -2
- package/dist/search-index-worker.js +2 -2
- package/dist/smart-tag-worker.js +2 -2
- package/dist/web/assets/SessionDetail-BnpvDwtH.js +54 -0
- package/dist/web/assets/{index-BgWoUD_4.js → index-99ZxpV2y.js} +2 -2
- package/dist/web/icon/agent/dsh.svg +3 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-JHX5OLL4.js.map +0 -1
- package/dist/web/assets/SessionDetail-lQz99ARH.js +0 -54
- /package/dist/{chunk-OFTTM3UD.js.map → chunk-PROMURPM.js.map} +0 -0
- /package/dist/{dist-N2PQATP2.js.map → dist-6QTGTYZT.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OverviewScreen-DriPmCam.js","assets/jsx-runtime-B-hcVAMW.js","assets/utils-DgUgu15E.js","assets/contract-V6QuD0UY.js","assets/panel-C-gc79Gz.js","assets/Projects-BPDIcUBK.js","assets/session-indexes-0oT5HSS5.js","assets/agents-BkRP_ww3.js","assets/session-title-DdtlxtlR.js","assets/SessionDetail-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OverviewScreen-DriPmCam.js","assets/jsx-runtime-B-hcVAMW.js","assets/utils-DgUgu15E.js","assets/contract-V6QuD0UY.js","assets/panel-C-gc79Gz.js","assets/Projects-BPDIcUBK.js","assets/session-indexes-0oT5HSS5.js","assets/agents-BkRP_ww3.js","assets/session-title-DdtlxtlR.js","assets/SessionDetail-BnpvDwtH.js","assets/ErrorBoundary-D11tWzfn.js","assets/code-metrics-UYFsCC7E.js","assets/SearchResultsPanel-A6_3TPhW.js","assets/SmartTagChips-ux6idUGJ.js","assets/SearchFilterBar-Bx73B5e9.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,n as t,r as n,t as r}from"./jsx-runtime-B-hcVAMW.js";import{$ as i,$n as a,$t as o,A as s,An as c,At as l,B as u,Bn as d,Bt as f,C as p,Cn as m,Ct as h,D as g,Dn as _,Dt as v,E as y,En as b,Et as x,F as S,Fn as C,Ft as w,G as T,Gn as E,Gt as D,H as O,Hn as k,Ht as A,I as j,In as M,It as N,J as P,Jn as F,Jt as ee,K as te,Kn as I,Kt as L,L as R,Ln as z,Lt as ne,M as B,Mn as V,Mt as re,N as ie,Nn as ae,Nt as oe,O as se,On as ce,Ot as le,P as ue,Pn as de,Pt as fe,Q as pe,Qn as me,Qt as he,R as ge,Rn as _e,Rt as ve,S as ye,Sn as H,St as be,T as xe,Tn as Se,Tt as Ce,U as we,Un as Te,Ut as Ee,V as De,Vn as Oe,Vt as ke,W as Ae,Wn as je,Wt as Me,X as Ne,Xn as Pe,Xt as Fe,Y as Ie,Yn as Le,Z as Re,Zn as ze,Zt as Be,_n as Ve,_t as He,a as Ue,an as We,at as Ge,b as Ke,bn as qe,bt as Je,cn as Ye,ct as Xe,d as Ze,dn as Qe,dt as $e,er as et,et as tt,fn as U,ft as nt,gn as rt,gt as it,hn as at,ht as ot,in as st,it as ct,j as lt,jn as ut,jt as dt,k as ft,kn as pt,kt as mt,l as ht,ln as gt,lt as _t,m as vt,mn as yt,mt as bt,n as xt,nn as St,nr as Ct,nt as wt,on as Tt,ot as Et,pn as Dt,pt as Ot,q as kt,qn as At,qt as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tr as zt,tt as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as Jt,x as Yt,xn as Xt,xt as Zt,y as Qt,yn as $t,yt as en,z as tn,zn as nn,zt as rn}from"./utils-DgUgu15E.js";import{A as an,C as on,D as sn,E as cn,O as ln,S as un,T as dn,_ as fn,a as pn,b as mn,c as hn,d as gn,f as _n,g as vn,h as yn,i as bn,j as xn,k as Sn,l as Cn,m as wn,n as Tn,o as En,p as Dn,r as On,s as kn,t as An,u as jn,v as Mn,w as Nn,x as Pn,y as Fn}from"./panel-C-gc79Gz.js";import{_ as In,c as Ln,d as Rn,g as zn,h as Bn,i as Vn,l as Hn,m as Un,n as Wn,o as Gn,p as Kn,r as qn,s as Jn,t as Yn,u as Xn,v as Zn}from"./contract-V6QuD0UY.js";import{A as Qn,B as $n,F as er,J as tr,M as nr,N as rr,O as ir,Y as ar,a as or,h as sr,k as cr,q as lr,t as ur,z as dr}from"./ErrorBoundary-D11tWzfn.js";import{a as fr,c as pr,d as mr,f as hr,g as gr,h as _r,i as vr,l as yr,m as br,n as xr,o as Sr,p as Cr,r as wr,s as Tr,t as Er,u as Dr}from"./session-indexes-0oT5HSS5.js";import{n as Or}from"./SmartTagChips-ux6idUGJ.js";import{t as kr}from"./SearchFilterBar-Bx73B5e9.js";import{n as Ar,t as jr}from"./agents-BkRP_ww3.js";import{t as Mr}from"./session-title-DdtlxtlR.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Nr=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pr=n(((e,t)=>{t.exports=Nr()})),Fr=n((e=>{var n=Pr(),r=t(),i=Nt();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],I=-1;function L(e){return{current:e}}function R(e){0>I||(e.current=te[I],te[I]=null,I--)}function z(e,t){I++,te[I]=e.current,e.current=t}var ne=L(null),B=L(null),V=L(null),re=L(null);function ie(e,t){switch(z(V,t),z(B,e),z(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ne),z(ne,e)}function ae(){R(ne),R(B),R(V)}function oe(e){e.memoizedState!==null&&z(re,e);var t=ne.current,n=Gd(t,e.type);t!==n&&(z(B,e),z(ne,n))}function se(e){B.current===e&&(R(ne),R(B)),re.current===e&&(R(re),tp._currentValue=ee)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -1407,4 +1407,4 @@ Error generating stack: `+e.message+`
|
|
|
1407
1407
|
[data-type='item'] [data-session-title-scroll-complete] {
|
|
1408
1408
|
text-overflow: clip;
|
|
1409
1409
|
}
|
|
1410
|
-
`;function ny(e){return e.replaceAll(`/`,`∕`).trim()||`(untitled)`}function ry(e){return e.replace(/\/+$/,``).split(`/`).at(-1)?.trim()||`(unknown)`}function iy(e){let t=e.project_identity;if(t)return{key:Ln(t),label:t.displayName||ry(e.directory)};let n=ry(e.directory);return{key:n===`(unknown)`?`__unknown__`:`path:${e.directory||n}`,label:n}}function ay(e){return e.time_updated??e.time_created}function oy(e,t,n){let r=e.get(t.path)??2**53-1,i=e.get(n.path)??2**53-1;return r===i?t.path.localeCompare(n.path):r-i}function sy(){let e=new Set,t=new Map;return function(n){if(!e.has(n))return e.add(n),n;let r=t.get(n)??2,i=`${n} (${r})`;for(;e.has(i);)r+=1,i=`${n} (${r})`;return t.set(n,r+1),e.add(i),i}}var cy=`Unmounted`;function ly(e,{groupByProject:t=!0}={}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=sy(),c=[],l=Vn(e),u=new Map;for(let e of l.roots){let t=e.session,{key:n,label:r}=iy(t),i=ay(t),a=u.get(n);a?(a.nodes.push(e),i>a.maxTime&&(a.maxTime=i)):u.set(n,{label:r,nodes:[e],maxTime:i})}let d=t?[...u.values()].sort((e,t)=>e.label===`(unknown)`?1:t.label===`(unknown)`?-1:t.maxTime-e.maxTime):[{label:null,nodes:l.roots}];l.orphans.length>0&&d.push({label:cy,nodes:l.orphans});let f=0,p=sy();for(let e of d){let t=``;if(e.label!==null){let r=p(ny(e.label));t=`${r}/`,n.set(t,f),n.set(r,f),f+=1,a.set(t,`${e.nodes.length}`),a.set(r,`${e.nodes.length}`)}let l=(e,a,u)=>{let d=e.session,p=Mr(d);u.set(p,(u.get(p)??0)+1);let m=(u.get(p)??1)>1?`${ny(p)} #${d.id.slice(0,8)}`:ny(p),h=s(`${a}${m}`),g=wr(d),_=e.children.length>0,v=_?`${h}/`:h;_?(n.set(h,f),n.set(v,f),o.set(h,d),o.set(v,d)):(c.push(h),n.set(h,f),o.set(h,d)),f+=1,r.set(g,v),i.set(g,t);let y=new Map;for(let t of e.children)l(t,v,y)},u=new Map;for(let n of e.nodes)l(n,t,u)}return{paths:c,sortOrderByPath:n,pathBySessionReference:r,groupPathBySessionReference:i,groupCountByPath:a,sessionByPath:o}}function uy(e,t){if(!tr())return t();let n=performance.now(),r=t(),i=performance.now();return ar({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}var dy=.08,fy=16,py=700,my=1/3,hy=1.3333333333333333,gy=.6666666666666667/hy;function _y(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-item-section="content"]`);return!t||t.parentElement?.getAttribute(`data-type`)!==`item`?null:t}function vy(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function yy(e){if(e<=gy)return e/gy*.6666666666666667;let t=(e-gy)/.4999999999999999;return .6666666666666667+my*(t*(2-t))}function by(e){let t=e.shadowRoot;if(!t)return()=>{};let n=new Set,r=new Set,i=new WeakMap,a=new WeakMap;function o(e){let t=i.get(e);t!==void 0&&cancelAnimationFrame(t),a.get(e)?.remove(),a.delete(e),r.delete(e),i.delete(e),n.delete(e),e.scrollLeft=0,e.removeAttribute(`data-session-title-scroll`),e.removeAttribute(`data-session-title-scroll-complete`)}function s(e){if(vy()||e.hasAttribute(`data-session-title-scroll-complete`))return;o(e);let t=e.querySelector(`[data-truncate-group-container="middle"]`),s=t?.getBoundingClientRect().width??0;if(!t||s<=e.clientWidth+1)return;let c=t.cloneNode(!0);c.dataset.sessionTitleScrollCopy=`true`,c.setAttribute(`aria-hidden`,`true`),c.style.marginInlineStart=`${fy}px`,e.append(c),a.set(e,c),r.add(e),e.setAttribute(`data-session-title-scroll`,`running`);let l=s+fy,u=Math.max(py,l/dy*hy),d=performance.now();n.add(e);let f=t=>{if(!n.has(e))return;let r=Math.min(1,Math.max(0,(t-d)/u));if(e.scrollLeft=l*yy(r),r>=1){n.delete(e),i.delete(e),e.removeAttribute(`data-session-title-scroll`),e.setAttribute(`data-session-title-scroll-complete`,`true`);return}i.set(e,requestAnimationFrame(f))};i.set(e,requestAnimationFrame(f))}function c(e){let t=_y(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||s(t)}function l(e){let t=_y(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||o(t)}return t.addEventListener(`pointerover`,c),t.addEventListener(`pointerout`,l),()=>{t.removeEventListener(`pointerover`,c),t.removeEventListener(`pointerout`,l);for(let e of r)o(e)}}var xy=(0,W.memo)(function({sessions:e,activeSessionReference:t,selectedSessionReference:n,onSelectSession:r,bookmarkedSessionReferences:i,onToggleBookmark:a,onRenameSession:o,groupByProject:s=!0}){let[c,l]=(0,W.useState)(null),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),p=(0,W.useMemo)(()=>uy(`SessionTreeSidebar:buildTreeModel`,()=>ly(e,{groupByProject:s})),[e,s]),m=(0,W.useRef)(p.sortOrderByPath),h=(0,W.useRef)(p.groupCountByPath),g=(0,W.useRef)(p.sessionByPath),_=(0,W.useRef)(i),v=(0,W.useRef)(r),y=(0,W.useRef)(a),b=(0,W.useRef)(o),x=(0,W.useRef)(!1),S={"--trees-bg-override":`transparent`,"--trees-border-color-override":`var(--console-border)`,"--trees-fg-override":`var(--console-text)`,"--trees-fg-muted-override":`var(--console-muted)`,"--trees-font-family-override":`var(--font-mono)`,"--trees-font-size-override":`12px`,"--trees-item-margin-x-override":`0px`,"--trees-item-padding-x-override":`4px`,"--trees-padding-inline-override":`4px`,"--trees-selected-bg-override":n!==null&&n!==t?`transparent`:`var(--brand-soft)`},{model:C}=ey({flattenEmptyDirectories:!1,initialExpansion:`closed`,paths:p.paths,sort:(e,t)=>oy(m.current,e,t),density:`compact`,unsafeCSS:ty,onSelectionChange(e){if(x.current)return;let t=g.current.get(e[0]??``);t&&v.current(t)},renderRowDecoration({item:e}){return g.current.get(e.path)?{text:`⋯`,title:`Session options`}:h.current.get(e.path)?{text:h.current.get(e.path),title:`Sessions`}:null}});(0,W.useEffect)(()=>{m.current=p.sortOrderByPath,h.current=p.groupCountByPath,g.current=p.sessionByPath,C.resetPaths(p.paths)},[C,p]),(0,W.useEffect)(()=>{v.current=r},[r]),(0,W.useEffect)(()=>{_.current=i},[i]),(0,W.useEffect)(()=>{y.current=a},[a]),(0,W.useEffect)(()=>{b.current=o},[o]),(0,W.useEffect)(()=>{let e,t=0,n=()=>{let r=C.getFileTreeContainer();if(!r){t=requestAnimationFrame(n);return}e=by(r)};return n(),()=>{t&&cancelAnimationFrame(t),e?.()}},[C]);function w(e,t,n){u.current=t,d.current=n,l(e),f.current?.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowDown`,bubbles:!0,cancelable:!0}))}function T(e){let t=e.nativeEvent.composedPath(),n=t.find(e=>e instanceof HTMLElement&&e.parentElement?.getAttribute(`data-item-section`)===`decoration`),r=t.find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`),i=r?g.current.get(r.getAttribute(`data-item-path`)??``):null;!n||!r||!i||(e.preventDefault(),e.stopPropagation(),w(i,n,r))}function E(e){if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;let t=e.nativeEvent.composedPath().find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`),n=t?g.current.get(t.getAttribute(`data-item-path`)??``):null;!t||!n||(e.preventDefault(),e.stopPropagation(),w(n,t.querySelector(`[data-item-section='decoration'] > span`)??t,t))}return(0,W.useEffect)(()=>{let e=p.pathBySessionReference.get(t??``),r=p.pathBySessionReference.get(n??``)??e,i=n??t??``,a=p.groupPathBySessionReference.get(i);x.current=!0;try{for(let t of C.getSelectedPaths())t!==e&&C.getItem(t)?.deselect();e&&!C.getSelectedPaths().includes(e)&&C.getItem(e)?.select()}finally{x.current=!1}if(r&&t){let e=r.split(`/`).filter(Boolean);for(let t=1;t<=e.length;t+=1){let n=`${e.slice(0,t).join(`/`)}/`,r=C.getItem(n);r&&`expand`in r&&r.expand()}let t=a?C.getItem(a):null;t&&`expand`in t&&t.expand(),C.focusPath(r);return}a&&C.focusPath(a)},[t,C,p,n]),(0,G.jsxs)(`div`,{className:`session-tree h-[min(560px,calc(100vh-410px))] min-h-56 overflow-hidden`,style:S,onClickCapture:T,onKeyDownCapture:E,children:[(0,G.jsx)(Ol,{model:C,style:{height:`100%`},"aria-label":`Sessions`}),(0,G.jsxs)($c,{modal:!1,children:[(0,G.jsx)(ll,{ref:f,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute size-0 opacity-0`}),(0,G.jsx)(bc,{children:(0,G.jsx)(Wc,{anchor:u,side:`bottom`,align:`end`,sideOffset:4,className:`z-40`,children:(0,G.jsx)(_c,{finalFocus:d,className:`motion-menu w-36 rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-1 shadow-[var(--shadow-overlay)] focus-visible:outline-none`,children:c?(0,G.jsx)(fl,{bookmarked:_.current.has(wr(c)),onRename:()=>b.current(c),onToggleBookmark:()=>y.current(c)}):null})})})]})]})});function Sy(e){return`flex items-center gap-2 rounded-sm px-3 py-1.5 text-left motion-hover focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none ${e?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`}function Cy({scanning:e,empty:t}){let n=No();return(0,G.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:n?.active?e:t})}function wy({projects:e,selectedProjectNavigationId:t}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>{let n=vr(e),r=t===Ln(n);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:fr(n),"data-active":r?`true`:void 0,className:`min-w-0 ${Sy(r)}`,children:[(0,G.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:e.displayName}),(0,G.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:e.sessionCount})]})},`${e.identityKind}:${e.identityKey}`)})})}function Ty({model:{sidebarCollapsed:e,viewState:t,agentCatalog:n,projects:r,selectedProjectNavigationId:i,loading:a,bookmarkedSessions:o,sidebarSessions:s,selectedSidebarSessionReference:c,bookmarkedSidebarSessionReferences:l},actions:{onCollapse:u,onToggleBookmark:d,onSelectFlatSidebarSession:f,onToggleSidebarSessionBookmark:p,onRenameSession:m,onRenameBookmarkedSession:h}}){let g=t.mode===`session`?Xn(t.activeAgentKey,t.activeSessionId):null,_=t.mode===`root`;return(0,G.jsx)(`aside`,{className:`w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] ${e?`hidden`:`hidden lg:flex`}`,children:(0,G.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,G.jsx)(`section`,{children:(0,G.jsxs)(`ul`,{className:`console-scrollbar max-h-[min(320px,calc(100vh-400px))] space-y-1 overflow-y-auto pr-1`,children:[(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Sr,{to:`/`,"data-active":_?`true`:void 0,className:`min-w-0 flex-1 ${Sy(_)}`,children:[(0,G.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`Dashboard`,className:`size-3.5 rounded-[2px]`}),(0,G.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:`Dashboard`})]}),(0,G.jsx)(`button`,{type:`button`,"aria-expanded":`true`,"aria-label":`Collapse sidebar`,title:`Collapse sidebar`,onClick:u,className:`shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:(0,G.jsx)(nr,{className:`size-4`})})]}),(0,G.jsx)(wy,{projects:r,selectedProjectNavigationId:i}),r.length===0&&!a?(0,G.jsx)(`li`,{children:(0,G.jsx)(Cy,{scanning:`Scanning projects...`,empty:`No projects found`})}):null]})}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h3`,{className:`console-eyebrow mb-3`,children:`BOOKMARKS`}),o.length===0?(0,G.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No bookmarks yet`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:o.map(e=>{let{reference:r}=e,i=t.mode===`session`&&t.activeAgentKey===r.agentName&&t.activeSessionId===r.sessionId,a=Ar(n,r.agentName),o=e.availability===`available`,s=o?void 0:e.display_title,c=e.availability===`agent-unavailable`?`Agent unavailable`:`Session unavailable`,l=o?Mr(e.session):s??r.sessionId,u=s?`${a?.displayName??r.agentName} · ${r.sessionId} · ${c}`:`${a?.displayName??r.agentName} · ${c}`,f=(0,G.jsxs)(G.Fragment,{children:[a?.icon?(0,G.jsx)(xt,{icon:a.icon,iconColored:a.iconColored,alt:a.displayName,className:`mt-0.5 size-3.5 shrink-0 object-contain`}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`console-mono line-clamp-1 block text-xs`,children:l}),(0,G.jsx)(`span`,{className:`console-mono mt-0.5 line-clamp-1 block text-[10px] text-[var(--console-muted)]`,children:o?a?.displayName??r.agentName:u})]})]});return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`div`,{"data-active":i?`true`:void 0,className:`flex items-start gap-2 rounded-sm px-2 py-1.5 motion-hover ${i?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`,children:[o?(0,G.jsx)(Sr,{to:Rn(e.session),className:`flex min-w-0 flex-1 items-start gap-2`,children:f}):(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,"aria-disabled":`true`,children:f}),(0,G.jsx)(pl,{bookmarked:!0,onRename:()=>h(e),onToggleBookmark:()=>d(e)})]})},Xo(r))})})]}),i?(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`h3`,{className:`console-eyebrow mb-3`,children:[`SESSIONS`,s.length>0?(0,G.jsx)(`span`,{className:`ml-2 text-[10px] font-normal text-[var(--console-muted)]`,children:`Navigate j k · Open Enter`}):null]}),s.length===0?(0,G.jsx)(Cy,{scanning:`Scanning sessions...`,empty:`No sessions yet`}):(0,G.jsx)(lr,{id:`SessionTreeSidebar`,detail:{sessions:s.length},children:(0,G.jsx)(xy,{sessions:s,activeSessionReference:g,selectedSessionReference:c,onSelectSession:f,bookmarkedSessionReferences:l,onToggleBookmark:p,onRenameSession:m,groupByProject:!1})})]}):null]})})}var Ey=[{title:`Navigation`,items:[{keys:`j / k`,description:`Move through sessions or search results`},{keys:`Enter`,description:`Open the current selection`},{keys:`g / G`,description:`Jump to the first or last item`}]},{title:`Search & Help`,items:[{keys:`Cmd/Ctrl K`,description:`Open global search`},{keys:`/`,description:`Focus the search box`},{keys:`Esc`,description:`Exit search or close the current detail view`},{keys:`?`,description:`Open this shortcuts panel`}]}];function Dy({open:e,onClose:t}){return(0,G.jsx)(Qt,{open:e,onOpenChange:e=>e?void 0:t(),children:(0,G.jsxs)(Yt,{children:[(0,G.jsx)(ce,{className:`shortcut-overlay fixed inset-0 z-50 bg-[var(--scrim)]`}),(0,G.jsxs)(Kt,{className:`shortcut-content fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] max-w-2xl origin-center -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-5 shadow-[var(--shadow-overlay)] outline-none`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`Keyboard Shortcuts`}),(0,G.jsx)(Ut,{className:`console-display mt-2 text-[19px] font-semibold text-[var(--console-text)]`,children:`Navigate without leaving the keyboard`})]}),(0,G.jsx)(L,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Esc`})]}),(0,G.jsx)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-2`,children:Ey.map(e=>(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-4`,children:[(0,G.jsx)(`h3`,{className:`console-eyebrow`,children:e.title}),(0,G.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.items.map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-text)]`,children:e.keys}),(0,G.jsx)(`p`,{className:`mt-1 text-[13px] leading-6 text-[var(--console-text-secondary)]`,children:e.description})]},e.keys))})]},e.title))})]})]})})}var Oy={light:`dark`,dark:`system`,system:`light`},ky={light:$n,dark:cr,system:ir},Ay={light:`Light`,dark:`Dark`,system:`System`};function jy({theme:e,onChange:t}){let n=ky[e],r=Oy[e];return(0,G.jsx)(`button`,{type:`button`,onClick:()=>t(r),"aria-label":`Theme: ${Ay[e]}. Switch to ${Ay[r]}.`,title:`Theme: ${Ay[e]} (click for ${Ay[r]})`,className:`console-mono motion-hover motion-press rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1.5 text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:(0,G.jsx)(n,{"aria-hidden":`true`,className:`size-4`})})}function My({active:e,onToggle:t,className:n=``}){return(0,G.jsx)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},"aria-label":e?`Remove bookmark`:`Add bookmark`,title:e?`Remove bookmark`:`Add bookmark`,className:`motion-hover motion-press inline-flex size-6 shrink-0 items-center justify-center rounded-sm border focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none ${n} ${e?`border-[var(--brand-line)] bg-[var(--brand-soft)] text-[var(--brand)]`:`border-transparent text-[var(--console-muted)] opacity-70 hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] hover:opacity-100`}`,children:(0,G.jsx)(dr,{className:`size-3`,strokeWidth:1.8,fill:e?`currentColor`:`none`})})}function Ny(e){return e.total_tokens??e.total_input_tokens+e.total_output_tokens}function Py({label:e,value:t,hint:n}){return(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:e}),(0,G.jsx)(`p`,{className:`console-mono mt-2 text-xl font-semibold text-[var(--console-text)]`,children:t}),n?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-[var(--console-muted)]`,children:n}):null]})}function Fy({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:e}),(0,G.jsx)(`p`,{className:`console-mono mt-2 break-all text-sm leading-6 text-[var(--console-text)]`,children:t})]})}function Iy({code:e,title:t,description:n,aside:r,iconSrc:i,iconColored:a,iconAlt:o}){return(0,G.jsx)(An,{className:`p-5 md:p-6`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-5 md:flex-row md:items-start md:justify-between`,children:[(0,G.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow inline-flex rounded-full border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-1`,children:e}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-start gap-3`,children:[i?(0,G.jsx)(xt,{icon:i,iconColored:a,alt:o||``,className:`mt-1 size-8 shrink-0 object-contain`}):null,(0,G.jsx)(`h2`,{className:`console-display text-2xl leading-tight font-semibold text-[var(--console-text)] md:text-[2rem]`,children:t})]}),(0,G.jsx)(`p`,{className:`mt-3 max-w-[42rem] text-sm leading-7 text-[var(--console-muted)]`,children:n})]}),(0,G.jsxs)(`div`,{className:`min-w-0 rounded-md border border-dashed border-[var(--console-border)] bg-[var(--console-surface-muted)] px-4 py-3 md:max-w-xs`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`STATUS NOTE`}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--console-text)]`,children:r})]})]})})}function Ly({agentItems:e}){return(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Known Agents`,meta:`${e.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:e.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:Wn(e.key),className:`flex min-h-11 items-center gap-2 rounded-sm border border-transparent px-3 py-2 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)]`,children:[e.icon?(0,G.jsx)(xt,{icon:e.icon,iconColored:e.iconColored,alt:e.name,className:`size-4 object-contain`}):null,(0,G.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,G.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]})}function Ry({sessions:e,isBookmarked:t,onToggleBookmark:n}){return e.length===0?(0,G.jsx)(An,{className:`p-4 text-sm text-[var(--console-muted)]`,children:`No sessions yet`}):(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Recent Sessions`,meta:`${e.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 space-y-2`,children:e.map(e=>{let r=t(e.agentKey,e.id);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm border border-transparent px-2 py-1.5 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,G.jsxs)(Sr,{to:zn({agentName:e.agentKey,sessionId:e.sessionId}),className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`line-clamp-1 text-sm text-[var(--console-text)]`,children:Mr(e)}),(0,G.jsxs)(`p`,{className:`console-mono mt-0.5 text-[11px] text-[var(--console-muted)]`,children:[`/`,e.reference,` ·`,` `,vt(e.time_updated||e.time_created)]}),(0,G.jsx)(Or,{tags:e.smart_tags,className:`mt-1.5`})]}),(0,G.jsx)(My,{active:r,onToggle:()=>n(e)})]})},e.id)})})]})}var zy=(0,W.memo)(function({type:e,agentCatalog:t,sessions:n,agentItems:r,activeAgentKey:i,attemptedAgentKey:a,attemptedSessionId:o,isBookmarked:s,onToggleBookmark:c}){let{recentSessions:l,totalMessages:u,totalTokens:d,totalCost:f,costSource:p,latestUpdatedAt:m}=(0,W.useMemo)(()=>{let e=n.toSorted((e,t)=>(t.time_updated||t.time_created||0)-(e.time_updated||e.time_created||0)),t=0,r=0,i=0,a=!1;for(let e of n)t+=e.stats.message_count,r+=Ny(e.stats),i+=e.stats.total_cost,a||=e.stats.cost_source===`estimated`;return{recentSessions:e.slice(0,5),totalMessages:t,totalTokens:r,totalCost:i,costSource:i>0?a?`estimated`:`recorded`:void 0,latestUpdatedAt:e[0]?.time_updated||e[0]?.time_created}},[n]);if(e===`missing-agent`){let e=`/${a||`unknown`}${o?`/${o}`:``}`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(Iy,{code:`404 / AGENT`,title:`This agent isn't on the roster.`,description:`The path you requested is valid in shape, but there is no matching agent in the current registry. It may not be connected yet, or its name may not match what the system recognizes.`,aside:`Choose one of the available agents to continue.`}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,G.jsx)(Fy,{label:`Requested Agent`,value:a||`unknown`}),(0,G.jsx)(Fy,{label:`Requested Path`,value:e}),o?(0,G.jsx)(Fy,{label:`Requested Session`,value:o}):null]}),(0,G.jsx)(Ly,{agentItems:r})]})}if(e===`missing-session`){let e=i?Ar(t,i):void 0,n=e?.displayName??i??`Unknown Agent`,r=e?.icon,a=o||`unknown-session`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(Iy,{code:`404 / SESSION`,title:`This session isn't in the index.`,description:`${n} is available, but the session you're looking for does not exist in the current index. The session ID may be incorrect, or the record may never have been part of this dataset.`,aside:`We checked the current path, but nothing matched. The session list on the left is still available.`,iconSrc:r,iconColored:e?.iconColored,iconAlt:n}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`Agent`}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[r?(0,G.jsx)(xt,{icon:r,iconColored:e?.iconColored,alt:n,className:`size-4 shrink-0 object-contain`}):null,(0,G.jsx)(`p`,{className:`console-mono break-all text-sm leading-6 text-[var(--console-text)]`,children:n})]})]}),(0,G.jsx)(Fy,{label:`Session`,value:a})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]})}if(e===`global`)return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,G.jsx)(Py,{label:`Total Sessions`,value:Ze(n.length)}),(0,G.jsx)(Py,{label:`Total Messages`,value:Ze(u)}),(0,G.jsx)(Py,{label:`Latest Activity`,value:vt(m),hint:m?new Date(m).toLocaleString(`zh-CN`):void 0})]}),(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Agents`,meta:`${r.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:r.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:Wn(e.key),className:`flex items-center gap-2 rounded-sm border border-transparent px-2 py-1.5 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[e.icon?(0,G.jsx)(xt,{icon:e.icon,iconColored:e.iconColored,alt:e.name,className:`size-4 object-contain`}):null,(0,G.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,G.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]});let h=i?Ar(t,i):void 0,g=h?.displayName??`Unknown Agent`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(An,{className:`p-4`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h?.icon?(0,G.jsx)(xt,{icon:h.icon,iconColored:h.iconColored,alt:g,className:`size-6 object-contain`}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`console-display text-[15px] font-semibold text-[var(--console-text)]`,children:g}),(0,G.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Select a session from the left to view details`})]})]})}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:[(0,G.jsx)(Py,{label:`Sessions`,value:Ze(n.length)}),(0,G.jsx)(Py,{label:`Messages`,value:Ze(u)}),(0,G.jsx)(Py,{label:`Tokens`,value:Ze(d)}),(0,G.jsx)(Py,{label:`Total Cost`,value:ht(f),hint:Ue(p)})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]})}),By=[{id:`1`,roleWidth:`w-14`,timeWidth:`w-20`,bodyWidths:[`w-full`,`w-10/12`,`w-7/12`]},{id:`2`,roleWidth:`w-16`,timeWidth:`w-24`,bodyWidths:[`w-9/12`,`w-7/12`]},{id:`3`,roleWidth:`w-14`,timeWidth:`w-16`,bodyWidths:[`w-full`,`w-11/12`,`w-8/12`,`w-5/12`]},{id:`4`,roleWidth:`w-16`,timeWidth:`w-20`,bodyWidths:[`w-10/12`,`w-8/12`]},{id:`5`,roleWidth:`w-14`,timeWidth:`w-24`,bodyWidths:[`w-full`,`w-10/12`,`w-9/12`]}],Vy=[`w-8/12`,`w-7/12`,`w-9/12`,`w-6/12`,`w-10/12`,`w-7/12`];function Hy({className:e}){return(0,G.jsx)(`div`,{className:`skeleton-shimmer rounded-sm ${e}`})}function Uy(){return(0,G.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-[1440px] gap-6 px-2 md:px-4 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,G.jsxs)(`div`,{className:`hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3 min-[1025px]:block`,children:[(0,G.jsx)(Hy,{className:`h-2.5 w-20`}),(0,G.jsx)(`div`,{className:`mt-4 space-y-2.5`,children:Vy.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,G.jsx)(Hy,{className:`size-3.5 shrink-0`}),(0,G.jsx)(Hy,{className:`h-3 ${e}`})]},`${t}-${e}`))})]}),(0,G.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:By.map(e=>(0,G.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,G.jsxs)(`div`,{className:`flex gap-4`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,G.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,G.jsx)(Hy,{className:`size-3.5`})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(Hy,{className:`${e.roleWidth} h-3`}),(0,G.jsx)(Hy,{className:`${e.timeWidth} h-2.5`})]}),(0,G.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,G.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,G.jsx)(Hy,{className:`${t} h-3`},`${e.id}-${t}`))})})]})]})},e.id))})]})}var Wy=(0,W.lazy)(()=>gr(()=>import(`./OverviewScreen-DriPmCam.js`).then(e=>({default:e.OverviewScreen})),__vite__mapDeps([0,1,2,3,4]))),Gy=(0,W.lazy)(()=>gr(()=>import(`./Projects-BPDIcUBK.js`).then(e=>({default:e.ProjectsOverview})),__vite__mapDeps([5,1,2,3,4,6,7,8,0]))),Ky=(0,W.lazy)(()=>gr(()=>import(`./Projects-BPDIcUBK.js`).then(e=>({default:e.ProjectDashboardView})),__vite__mapDeps([5,1,2,3,4,6,7,8,0]))),qy=(0,W.lazy)(()=>gr(()=>import(`./SessionDetail-lQz99ARH.js`).then(e=>({default:e.SessionDetail})),__vite__mapDeps([9,1,2,3,10,6,7,11]))),Jy=(0,W.lazy)(()=>gr(()=>import(`./SearchResultsPanel-A6_3TPhW.js`).then(e=>({default:e.SearchResultsPanel})),__vite__mapDeps([12,1,3,6,13,14,8])));function Yy({children:e}){let t=mr();return(0,G.jsx)(ur,{children:(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Uy,{}),children:e})},t.pathname)}function Xy({loading:e,error:t,onRetry:n,viewState:r,detailHighlightQuery:i,agents:a,agentCatalog:o,agentNameMap:s,projects:c,landingSessions:l,sessions:u=[],sessionsByAgent:d,activeProject:f,activeProjectSessions:p,overview:m,sessionDetail:h,projectAgentFilter:g,search:_,bookmarks:v}){let y=(0,W.useMemo)(()=>a.map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,iconColored:e.iconColored,count:e.count})),[a]),b=r.mode===`session`?h.session:null,x=b?.reference.agentName,S=b?.reference.sessionId,C=(0,W.useMemo)(()=>{if(!x||!S)return[];let e=Xn(x,S);return u.filter(t=>t.parent_reference&&Xn(t.parent_reference.agentName,t.parent_reference.sessionId)===e)},[x,S,u]),w=v.toggleSessionBookmark,T=(0,W.useCallback)(e=>w(e,e.agentKey),[w]);if(e)return(0,G.jsx)(Uy,{});if(_.active){let e=_.state.status===`loaded`?_.state.results.length:0;return(0,G.jsx)(lr,{id:`SearchResultsPanel`,detail:{results:e,loading:_.state.status===`loading`},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(Jy,{query:_.query,state:_.state,agentNameMap:s,agents:a,projects:_.projectOptions,filters:_.filters,onChangeFilters:_.onChangeFilters,onOpenResult:_.onClose,onRetry:_.onRetry,selectedIndex:_.selectedIndex,registerResultRef:_.registerResultRef})})})}return t?(0,G.jsxs)(`div`,{role:`alert`,className:`mx-auto max-w-4xl rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6 text-sm text-[var(--console-error)]`,children:[(0,G.jsx)(`p`,{children:t}),(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`console-mono mt-4 rounded-sm border border-[var(--console-error-border)] px-3 py-1.5 text-xs motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Retry`})]}):r.mode===`root`?(0,G.jsx)(lr,{id:`OverviewScreen`,detail:{projects:c.length},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(Wy,{window:m.window,agentCatalog:o,rangePreset:m.rangePreset,onRangeChange:m.onRangeChange,onSelectCustom:m.onSelectCustom})})}):r.mode===`projects`?(0,G.jsx)(Yy,{children:(0,G.jsx)(Gy,{projects:c,agentCatalog:o})}):r.mode===`project`?(0,G.jsx)(Yy,{children:(0,G.jsx)(Ky,{project:f,agentCatalog:o,projectKey:r.activeProjectKey,sessions:p,activeAgent:g.selectedAgent,onChangeAgent:g.onChangeAgent,timeWindow:m.window,rangePreset:m.rangePreset,onRangeChange:m.onRangeChange,onSelectCustom:m.onSelectCustom})}):r.mode===`agent`?(0,G.jsx)(zy,{type:`agent`,agentCatalog:o,sessions:d.get(r.activeAgentKey)??[],agentItems:y,activeAgentKey:r.activeAgentKey,isBookmarked:v.isBookmarked,onToggleBookmark:T}):r.mode===`session`?h.loading?(0,G.jsx)(Uy,{}):h.error||!b?(0,G.jsx)(zy,{type:`missing-session`,agentCatalog:o,sessions:d.get(r.activeAgentKey)??[],agentItems:y,activeAgentKey:r.activeAgentKey,attemptedSessionId:r.activeSessionId,isBookmarked:v.isBookmarked,onToggleBookmark:T}):(0,G.jsx)(lr,{id:`SessionDetail`,detail:{messages:b.messages.length,session:b.id},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(qy,{session:b,agentCatalog:o,highlightQuery:i,childSessions:C},`${b.reference.agentName}/${b.reference.sessionId}`)})}):r.mode===`missingAgent`?(0,G.jsx)(zy,{type:`missing-agent`,agentCatalog:o,sessions:l,agentItems:y,attemptedAgentKey:r.attemptedKey,isBookmarked:v.isBookmarked,onToggleBookmark:e=>v.toggleSessionBookmark(e,e.agentKey)}):(0,G.jsx)(`div`,{className:`text-sm text-[var(--console-muted)]`,children:`Invalid route.`})}function Zy({visible:e}){let t=No(),n=En(t),r=t?[t.phase,t.scanningAgents[0]??``,t.completedAgents.length,t.totalAgents,t.backfill.active,t.backfill.currentAgent??``,t.backfill.pendingAgents.length,t.backfill.failedAgents.length].join(`|`):null,i=(0,W.useRef)({milestoneKey:r,label:n});return i.current.milestoneKey!==r&&(i.current={milestoneKey:r,label:n}),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{children:e&&n?(0,G.jsx)(`p`,{className:`console-mono mt-2 inline-flex max-w-4xl rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] leading-relaxed text-[var(--console-warning)]`,children:n}):null}),(0,G.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e?i.current.label:null})]})}function Qy(){let e=Cr(),t=vs(),n=Rs(t.config?.window),{timeWindow:r}=n,{activeAgents:i,agentCatalog:o,sessions:s,projects:c,dashboard:l,window:u,validAgentKeys:d,agentNameMap:f,loading:p,error:m,reload:h,applyLiveEvent:g,resyncLiveState:_,retryLoad:v}=t;bs({window:r,reload:h});let y=Po(),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(!1),{shortcutHintDismissed:w,sidebarCollapsed:T,theme:E,dismissShortcutHint:D,setSidebarCollapsed:O,setTheme:k}=Ys(),A=bn(E),[j,M]=(0,W.useState)(null),N=mr(),P=hr(),F=(0,W.useMemo)(()=>ko(P,d),[P,d]),ee=zo(F),{session:te,sessionError:I}=ee;(0,W.useEffect)(()=>{a(`route.change`,{path:N.pathname,mode:F.mode,agent:F.activeAgentKey,session:F.activeSessionId})},[N.pathname,F.mode,F.activeAgentKey,F.activeSessionId]);let L=(0,W.useMemo)(()=>Er(s,i),[s,i]),R=Go(L,u),{draftSearchQuery:z,activeSearchQuery:ne,searchMode:B,searchState:V,searchResults:re,searchLoading:ie,selectedSearchIndex:ae,searchInputRef:oe,setDraftSearchQuery:se,setSelectedSearchIndex:ce,openSearch:le,submitSearch:ue,closeSearch:de}=R,fe=B,pe=fe?ne:typeof N.state==`object`&&N.state!==null&&`searchQuery`in N.state&&typeof N.state.searchQuery==`string`?N.state.searchQuery:``,me=ns(),{bookmarkedSessions:he,isSessionBookmarked:ge,toggleBookmark:_e,toggleSessionBookmark:ve,refresh:ye}=me,H=F.mode===`project`?F.activeProjectKind:null,be=F.mode===`project`?F.activeProjectKey:null,xe=H&&be?Ln({kind:H,key:be}):null,[Se,Ce]=(0,W.useState)(null),we=Se?.identityKey===xe?Se?.agentKey:void 0,Te=(0,W.useCallback)(e=>{Ce(xe?{identityKey:xe,agentKey:e}:null)},[xe]),{activeAgent:Ee,activeProject:De,activeProjectSessions:Oe,selectedProjectNavigation:ke,sidebarSessions:Ae,sidebarSessionLookup:je,bookmarkedSidebarSessionReferences:Me}=as({viewState:F,sessionIndexes:L,session:te,agents:i,projects:c,selectedProjectAgent:we,isSessionBookmarked:ge}),Ne=ke?.identity??null,Pe=ke?.identityKey??null,Fe=(0,W.useCallback)(t=>{x(wr(t)),e(Rn(t))},[e]),Ie=(0,W.useCallback)(e=>{ve(e,Hn(e))},[ve]),Le=(0,W.useCallback)(e=>{M({agentKey:Hn(e),sessionId:e.id,title:e.title,displayTitle:e.display_title})},[]),Re=(0,W.useCallback)(e=>{M({agentKey:e.reference.agentName,sessionId:e.reference.sessionId,title:e.availability===`available`?e.session.title:e.reference.sessionId,displayTitle:e.availability===`available`?e.session.display_title:e.display_title})},[]),{liveNotice:ze}=Ss({applyLiveEvent:g,resyncLiveState:_,setScanStatus:y}),{saveAlias:Be,removeAlias:Ve}=ys((0,W.useCallback)(async()=>{await Promise.all([r?h(r):void 0,ye()])},[ye,h,r])),He=(0,W.useCallback)(async e=>{j&&await Be(j,e)},[j,Be]),Ue=(0,W.useCallback)(async()=>{j&&await Ve(j)},[j,Ve]);(0,W.useEffect)(()=>{if(!fe){if(F.mode===`session`){x(Xn(F.activeAgentKey,F.activeSessionId));return}if(F.mode===`agent`){x(null);return}x(null)}},[fe,F.mode,F.activeAgentKey,F.activeSessionId]);let We=Zs({viewState:F,isSearchMode:fe,searchSubtitle:V.status===`failed`?`Search failed for "${ne}"`:kn(ne,ie,re.length),dashboard:l,projects:c,sessionCount:s.length,activeProject:De?.project??null,activeAgent:Ee,sidebarSessionCount:Ae.length,session:te,sessionError:I,selectedProjectIdentity:Ne,selectedProject:ke?.project??null}),Ge=(0,G.jsx)(Xy,{loading:p,error:m,onRetry:()=>void v(),viewState:F,detailHighlightQuery:pe,agents:i,agentCatalog:o,agentNameMap:f,projects:c,landingSessions:L.landingSessions,sessions:s,sessionsByAgent:L.byLandingAgent,activeProject:De?.project??null,activeProjectSessions:Oe,overview:{window:u,rangePreset:n.preset??`all`,onRangeChange:n.selectPreset,onSelectCustom:n.selectCustom},sessionDetail:{session:ee.session,loading:ee.sessionLoading,error:ee.sessionError},projectAgentFilter:{selectedAgent:we,onChangeAgent:Te},search:{active:R.searchMode,query:R.activeSearchQuery,state:R.searchState,projectOptions:R.projectOptions,filters:R.searchFilters,onChangeFilters:R.setSearchFilters,onClose:R.closeSearch,onRetry:R.retrySearch,selectedIndex:R.selectedSearchIndex,registerResultRef:R.registerResultRef},bookmarks:{isBookmarked:me.isSessionBookmarked,toggleSessionBookmark:me.toggleSessionBookmark}});return ws({viewState:F,navigate:e,sidebarSessions:Ae,sidebarSessionLookup:je,selectedSidebarSessionReference:b,setSelectedSidebarSessionReference:x,selectedProjectNavigationIdentity:Ne,shortcutHelpOpen:S,setShortcutHelpOpen:C,dismissShortcutHint:D,isSearchMode:fe,activeSearchQuery:ne,searchResults:re,selectedSearchIndex:ae,setSelectedSearchIndex:ce,setDraftSearchQuery:se,openSearch:le,closeSearch:de}),(0,G.jsx)(On.Provider,{value:A,children:(0,G.jsxs)(`div`,{className:`console-ui flex h-screen flex-col overflow-hidden bg-[var(--console-bg)] text-[var(--console-text)]`,children:[(0,G.jsx)(`a`,{href:`#main`,className:`console-mono sr-only rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-1.5 text-xs text-[var(--console-text)] focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[60] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:`Skip to content`}),(0,G.jsx)(`header`,{className:`shrink-0 border-b border-[var(--console-border)] bg-[var(--console-surface)]/85 backdrop-blur-sm`,children:(0,G.jsxs)(`div`,{className:`grid min-h-14 grid-cols-[auto_1fr] items-center gap-3 px-4 py-2 sm:grid-cols-[auto_1fr_auto] sm:py-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,G.jsxs)(Sr,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,G.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,G.jsx)(`span`,{className:`console-display text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]})}),(0,G.jsxs)(`form`,{className:`order-3 col-span-2 flex w-full items-center justify-center gap-2 sm:order-none sm:col-span-1 sm:mx-auto sm:max-w-[560px]`,onSubmit:e=>{e.preventDefault(),ue()},children:[(0,G.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 focus-within:border-[var(--brand-line)] focus-within:ring-2 focus-within:ring-[var(--brand)]`,children:[(0,G.jsx)(`span`,{className:`sr-only`,children:`Search Sessions`}),(0,G.jsx)(`input`,{ref:oe,type:`search`,name:`session-search`,autoComplete:`off`,value:z,onChange:e=>se(e.target.value),placeholder:`Search sessions… /`,className:`console-mono w-full min-w-0 bg-transparent text-xs text-[var(--console-text)] outline-none placeholder:text-[var(--console-muted)]`})]}),(0,G.jsx)(`button`,{type:`submit`,className:`console-mono rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-3 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Search`})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,G.jsx)(jy,{theme:E,onChange:k}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{C(!0),D()},className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,title:`Show keyboard shortcuts`,children:[`?`,(0,G.jsx)(`span`,{className:`hidden sm:inline`,children:` Shortcuts`})]}),r&&n.preset?(0,G.jsx)(Co,{window:r,preset:n.preset,customFrom:n.customFrom,customTo:n.customTo,onSelectPreset:n.selectPreset,onSelectCustom:n.selectCustom}):null,(0,G.jsxs)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)] sm:inline-flex`,children:[`v`,`1.0.1`]})]})]})}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,G.jsx)(Ty,{model:{sidebarCollapsed:T,viewState:F,agentCatalog:o,projects:c,selectedProjectNavigationId:Pe,loading:p,bookmarkedSessions:he,sidebarSessions:Ae,selectedSidebarSessionReference:b,bookmarkedSidebarSessionReferences:Me},actions:{onCollapse:()=>O(!0),onToggleBookmark:_e,onSelectFlatSidebarSession:Fe,onToggleSidebarSessionBookmark:Ie,onRenameSession:Le,onRenameBookmarkedSession:Re}}),(0,G.jsxs)(`main`,{id:`main`,tabIndex:-1,className:`flex min-w-0 flex-1 flex-col outline-none`,children:[(0,G.jsxs)(`section`,{className:`flex shrink-0 items-start gap-3 border-b border-[var(--console-border)] bg-[var(--console-surface)]/70 px-4 py-4 backdrop-blur-sm md:px-8`,children:[T?(0,G.jsx)(`button`,{type:`button`,"aria-expanded":`false`,"aria-label":`Expand sidebar`,title:`Expand sidebar`,onClick:()=>O(!1),className:`mt-0.5 hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none lg:inline-flex`,children:(0,G.jsx)(rr,{className:`size-4`})}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`console-mono mb-2 flex flex-wrap items-center gap-1 text-[11px] text-[var(--console-muted)]`,children:We.breadcrumbs.map((e,t)=>(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.to?(0,G.jsx)(Sr,{to:e.to,className:`motion-hover hover:text-[var(--console-text)]`,children:e.label}):(0,G.jsx)(`span`,{className:`text-[var(--console-text)]`,children:e.label}),t<We.breadcrumbs.length-1?(0,G.jsx)(`span`,{children:`/`}):null]},`${e.label}-${t}`))}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5`,children:We.contextLabel}),(0,G.jsx)(`h1`,{className:`console-display text-2xl font-semibold text-[var(--console-text)]`,children:We.title})]}),(0,G.jsx)(`div`,{className:`console-mono mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[var(--console-muted)]`,children:We.subtitle}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[w?null:(0,G.jsxs)(`div`,{className:`console-mono inline-flex items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:[(0,G.jsx)(`span`,{children:`Keyboard navigation available`}),(0,G.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1`,children:`?`}),(0,G.jsx)(`button`,{type:`button`,onClick:D,className:`text-[var(--console-muted)] motion-hover hover:text-[var(--console-text)]`,"aria-label":`Dismiss keyboard shortcuts hint`,children:`×`})]}),!fe&&F.mode===`session`?(0,G.jsx)(`span`,{className:`console-mono inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:`Esc back`}):null,!fe&&F.mode===`session`&&te?(0,G.jsx)(ri,{resumeCommandPrefix:Ar(o,F.activeAgentKey)?.resumeCommandPrefix??null,sessionId:te.id,directory:te.directory}):null]}),(0,G.jsx)(`div`,{"aria-live":`polite`,children:ze?(0,G.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:ze}):null}),(0,G.jsx)(Zy,{visible:F.mode===`root`})]})]}),(0,G.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,G.jsx)(ur,{children:(0,G.jsx)(lr,{id:`MainContent`,detail:{mode:F.mode,search:fe,sessions:s.length},children:Ge})},N.pathname)})]})]}),(0,G.jsx)(Dy,{open:S,onClose:()=>C(!1)}),(0,G.jsx)(xo,{target:j,onClose:()=>M(null),onSave:He,onRemove:Ue})]})})}function $y(){let e=br(),t=Dr(e)?`${e.status} ${e.statusText}`:`The application route failed to render.`;return(0,G.jsx)(`div`,{role:`alert`,children:t})}var eb=pr([{id:`app-shell`,path:`/`,Component:Qy,ErrorBoundary:$y,loader:Do,children:To}]);function tb(){return(0,G.jsx)($r,{router:eb})}me(),Kr.createRoot(document.getElementById(`root`)).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(gn,{client:Zr,children:(0,G.jsx)(Mo,{children:(0,G.jsx)(lr,{id:`App`,children:(0,G.jsx)(tb,{})})})})}));
|
|
1410
|
+
`;function ny(e){return e.replaceAll(`/`,`∕`).trim()||`(untitled)`}function ry(e){return e.replace(/\/+$/,``).split(`/`).at(-1)?.trim()||`(unknown)`}function iy(e){let t=e.project_identity;if(t)return{key:Ln(t),label:t.displayName||ry(e.directory)};let n=ry(e.directory);return{key:n===`(unknown)`?`__unknown__`:`path:${e.directory||n}`,label:n}}function ay(e){return e.time_updated??e.time_created}function oy(e,t,n){let r=e.get(t.path)??2**53-1,i=e.get(n.path)??2**53-1;return r===i?t.path.localeCompare(n.path):r-i}function sy(){let e=new Set,t=new Map;return function(n){if(!e.has(n))return e.add(n),n;let r=t.get(n)??2,i=`${n} (${r})`;for(;e.has(i);)r+=1,i=`${n} (${r})`;return t.set(n,r+1),e.add(i),i}}var cy=`Unmounted`;function ly(e,{groupByProject:t=!0}={}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=sy(),c=[],l=Vn(e),u=new Map;for(let e of l.roots){let t=e.session,{key:n,label:r}=iy(t),i=ay(t),a=u.get(n);a?(a.nodes.push(e),i>a.maxTime&&(a.maxTime=i)):u.set(n,{label:r,nodes:[e],maxTime:i})}let d=t?[...u.values()].sort((e,t)=>e.label===`(unknown)`?1:t.label===`(unknown)`?-1:t.maxTime-e.maxTime):[{label:null,nodes:l.roots}];l.orphans.length>0&&d.push({label:cy,nodes:l.orphans});let f=0,p=sy();for(let e of d){let t=``;if(e.label!==null){let r=p(ny(e.label));t=`${r}/`,n.set(t,f),n.set(r,f),f+=1,a.set(t,`${e.nodes.length}`),a.set(r,`${e.nodes.length}`)}let l=(e,a,u)=>{let d=e.session,p=Mr(d);u.set(p,(u.get(p)??0)+1);let m=(u.get(p)??1)>1?`${ny(p)} #${d.id.slice(0,8)}`:ny(p),h=s(`${a}${m}`),g=wr(d),_=e.children.length>0,v=_?`${h}/`:h;_?(n.set(h,f),n.set(v,f),o.set(h,d),o.set(v,d)):(c.push(h),n.set(h,f),o.set(h,d)),f+=1,r.set(g,v),i.set(g,t);let y=new Map;for(let t of e.children)l(t,v,y)},u=new Map;for(let n of e.nodes)l(n,t,u)}return{paths:c,sortOrderByPath:n,pathBySessionReference:r,groupPathBySessionReference:i,groupCountByPath:a,sessionByPath:o}}function uy(e,t){if(!tr())return t();let n=performance.now(),r=t(),i=performance.now();return ar({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}var dy=.08,fy=16,py=700,my=1/3,hy=1.3333333333333333,gy=.6666666666666667/hy;function _y(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-item-section="content"]`);return!t||t.parentElement?.getAttribute(`data-type`)!==`item`?null:t}function vy(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function yy(e){if(e<=gy)return e/gy*.6666666666666667;let t=(e-gy)/.4999999999999999;return .6666666666666667+my*(t*(2-t))}function by(e){let t=e.shadowRoot;if(!t)return()=>{};let n=new Set,r=new Set,i=new WeakMap,a=new WeakMap;function o(e){let t=i.get(e);t!==void 0&&cancelAnimationFrame(t),a.get(e)?.remove(),a.delete(e),r.delete(e),i.delete(e),n.delete(e),e.scrollLeft=0,e.removeAttribute(`data-session-title-scroll`),e.removeAttribute(`data-session-title-scroll-complete`)}function s(e){if(vy()||e.hasAttribute(`data-session-title-scroll-complete`))return;o(e);let t=e.querySelector(`[data-truncate-group-container="middle"]`),s=t?.getBoundingClientRect().width??0;if(!t||s<=e.clientWidth+1)return;let c=t.cloneNode(!0);c.dataset.sessionTitleScrollCopy=`true`,c.setAttribute(`aria-hidden`,`true`),c.style.marginInlineStart=`${fy}px`,e.append(c),a.set(e,c),r.add(e),e.setAttribute(`data-session-title-scroll`,`running`);let l=s+fy,u=Math.max(py,l/dy*hy),d=performance.now();n.add(e);let f=t=>{if(!n.has(e))return;let r=Math.min(1,Math.max(0,(t-d)/u));if(e.scrollLeft=l*yy(r),r>=1){n.delete(e),i.delete(e),e.removeAttribute(`data-session-title-scroll`),e.setAttribute(`data-session-title-scroll-complete`,`true`);return}i.set(e,requestAnimationFrame(f))};i.set(e,requestAnimationFrame(f))}function c(e){let t=_y(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||s(t)}function l(e){let t=_y(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||o(t)}return t.addEventListener(`pointerover`,c),t.addEventListener(`pointerout`,l),()=>{t.removeEventListener(`pointerover`,c),t.removeEventListener(`pointerout`,l);for(let e of r)o(e)}}var xy=(0,W.memo)(function({sessions:e,activeSessionReference:t,selectedSessionReference:n,onSelectSession:r,bookmarkedSessionReferences:i,onToggleBookmark:a,onRenameSession:o,groupByProject:s=!0}){let[c,l]=(0,W.useState)(null),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),p=(0,W.useMemo)(()=>uy(`SessionTreeSidebar:buildTreeModel`,()=>ly(e,{groupByProject:s})),[e,s]),m=(0,W.useRef)(p.sortOrderByPath),h=(0,W.useRef)(p.groupCountByPath),g=(0,W.useRef)(p.sessionByPath),_=(0,W.useRef)(i),v=(0,W.useRef)(r),y=(0,W.useRef)(a),b=(0,W.useRef)(o),x=(0,W.useRef)(!1),S={"--trees-bg-override":`transparent`,"--trees-border-color-override":`var(--console-border)`,"--trees-fg-override":`var(--console-text)`,"--trees-fg-muted-override":`var(--console-muted)`,"--trees-font-family-override":`var(--font-mono)`,"--trees-font-size-override":`12px`,"--trees-item-margin-x-override":`0px`,"--trees-item-padding-x-override":`4px`,"--trees-padding-inline-override":`4px`,"--trees-selected-bg-override":n!==null&&n!==t?`transparent`:`var(--brand-soft)`},{model:C}=ey({flattenEmptyDirectories:!1,initialExpansion:`closed`,paths:p.paths,sort:(e,t)=>oy(m.current,e,t),density:`compact`,unsafeCSS:ty,onSelectionChange(e){if(x.current)return;let t=g.current.get(e[0]??``);t&&v.current(t)},renderRowDecoration({item:e}){return g.current.get(e.path)?{text:`⋯`,title:`Session options`}:h.current.get(e.path)?{text:h.current.get(e.path),title:`Sessions`}:null}});(0,W.useEffect)(()=>{m.current=p.sortOrderByPath,h.current=p.groupCountByPath,g.current=p.sessionByPath,C.resetPaths(p.paths)},[C,p]),(0,W.useEffect)(()=>{v.current=r},[r]),(0,W.useEffect)(()=>{_.current=i},[i]),(0,W.useEffect)(()=>{y.current=a},[a]),(0,W.useEffect)(()=>{b.current=o},[o]),(0,W.useEffect)(()=>{let e,t=0,n=()=>{let r=C.getFileTreeContainer();if(!r){t=requestAnimationFrame(n);return}e=by(r)};return n(),()=>{t&&cancelAnimationFrame(t),e?.()}},[C]);function w(e,t,n){u.current=t,d.current=n,l(e),f.current?.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowDown`,bubbles:!0,cancelable:!0}))}function T(e){let t=e.nativeEvent.composedPath(),n=t.find(e=>e instanceof HTMLElement&&e.parentElement?.getAttribute(`data-item-section`)===`decoration`),r=t.find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`),i=r?g.current.get(r.getAttribute(`data-item-path`)??``):null;!n||!r||!i||(e.preventDefault(),e.stopPropagation(),w(i,n,r))}function E(e){if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;let t=e.nativeEvent.composedPath().find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`),n=t?g.current.get(t.getAttribute(`data-item-path`)??``):null;!t||!n||(e.preventDefault(),e.stopPropagation(),w(n,t.querySelector(`[data-item-section='decoration'] > span`)??t,t))}return(0,W.useEffect)(()=>{let e=p.pathBySessionReference.get(t??``),r=p.pathBySessionReference.get(n??``)??e,i=n??t??``,a=p.groupPathBySessionReference.get(i);x.current=!0;try{for(let t of C.getSelectedPaths())t!==e&&C.getItem(t)?.deselect();e&&!C.getSelectedPaths().includes(e)&&C.getItem(e)?.select()}finally{x.current=!1}if(r&&t){let e=r.split(`/`).filter(Boolean);for(let t=1;t<=e.length;t+=1){let n=`${e.slice(0,t).join(`/`)}/`,r=C.getItem(n);r&&`expand`in r&&r.expand()}let t=a?C.getItem(a):null;t&&`expand`in t&&t.expand(),C.focusPath(r);return}a&&C.focusPath(a)},[t,C,p,n]),(0,G.jsxs)(`div`,{className:`session-tree h-[min(560px,calc(100vh-410px))] min-h-56 overflow-hidden`,style:S,onClickCapture:T,onKeyDownCapture:E,children:[(0,G.jsx)(Ol,{model:C,style:{height:`100%`},"aria-label":`Sessions`}),(0,G.jsxs)($c,{modal:!1,children:[(0,G.jsx)(ll,{ref:f,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute size-0 opacity-0`}),(0,G.jsx)(bc,{children:(0,G.jsx)(Wc,{anchor:u,side:`bottom`,align:`end`,sideOffset:4,className:`z-40`,children:(0,G.jsx)(_c,{finalFocus:d,className:`motion-menu w-36 rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-1 shadow-[var(--shadow-overlay)] focus-visible:outline-none`,children:c?(0,G.jsx)(fl,{bookmarked:_.current.has(wr(c)),onRename:()=>b.current(c),onToggleBookmark:()=>y.current(c)}):null})})})]})]})});function Sy(e){return`flex items-center gap-2 rounded-sm px-3 py-1.5 text-left motion-hover focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none ${e?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`}function Cy({scanning:e,empty:t}){let n=No();return(0,G.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:n?.active?e:t})}function wy({projects:e,selectedProjectNavigationId:t}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>{let n=vr(e),r=t===Ln(n);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:fr(n),"data-active":r?`true`:void 0,className:`min-w-0 ${Sy(r)}`,children:[(0,G.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:e.displayName}),(0,G.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:e.sessionCount})]})},`${e.identityKind}:${e.identityKey}`)})})}function Ty({model:{sidebarCollapsed:e,viewState:t,agentCatalog:n,projects:r,selectedProjectNavigationId:i,loading:a,bookmarkedSessions:o,sidebarSessions:s,selectedSidebarSessionReference:c,bookmarkedSidebarSessionReferences:l},actions:{onCollapse:u,onToggleBookmark:d,onSelectFlatSidebarSession:f,onToggleSidebarSessionBookmark:p,onRenameSession:m,onRenameBookmarkedSession:h}}){let g=t.mode===`session`?Xn(t.activeAgentKey,t.activeSessionId):null,_=t.mode===`root`;return(0,G.jsx)(`aside`,{className:`w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] ${e?`hidden`:`hidden lg:flex`}`,children:(0,G.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,G.jsx)(`section`,{children:(0,G.jsxs)(`ul`,{className:`console-scrollbar max-h-[min(320px,calc(100vh-400px))] space-y-1 overflow-y-auto pr-1`,children:[(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Sr,{to:`/`,"data-active":_?`true`:void 0,className:`min-w-0 flex-1 ${Sy(_)}`,children:[(0,G.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`Dashboard`,className:`size-3.5 rounded-[2px]`}),(0,G.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:`Dashboard`})]}),(0,G.jsx)(`button`,{type:`button`,"aria-expanded":`true`,"aria-label":`Collapse sidebar`,title:`Collapse sidebar`,onClick:u,className:`shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:(0,G.jsx)(nr,{className:`size-4`})})]}),(0,G.jsx)(wy,{projects:r,selectedProjectNavigationId:i}),r.length===0&&!a?(0,G.jsx)(`li`,{children:(0,G.jsx)(Cy,{scanning:`Scanning projects...`,empty:`No projects found`})}):null]})}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h3`,{className:`console-eyebrow mb-3`,children:`BOOKMARKS`}),o.length===0?(0,G.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No bookmarks yet`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:o.map(e=>{let{reference:r}=e,i=t.mode===`session`&&t.activeAgentKey===r.agentName&&t.activeSessionId===r.sessionId,a=Ar(n,r.agentName),o=e.availability===`available`,s=o?void 0:e.display_title,c=e.availability===`agent-unavailable`?`Agent unavailable`:`Session unavailable`,l=o?Mr(e.session):s??r.sessionId,u=s?`${a?.displayName??r.agentName} · ${r.sessionId} · ${c}`:`${a?.displayName??r.agentName} · ${c}`,f=(0,G.jsxs)(G.Fragment,{children:[a?.icon?(0,G.jsx)(xt,{icon:a.icon,iconColored:a.iconColored,alt:a.displayName,className:`mt-0.5 size-3.5 shrink-0 object-contain`}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`console-mono line-clamp-1 block text-xs`,children:l}),(0,G.jsx)(`span`,{className:`console-mono mt-0.5 line-clamp-1 block text-[10px] text-[var(--console-muted)]`,children:o?a?.displayName??r.agentName:u})]})]});return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`div`,{"data-active":i?`true`:void 0,className:`flex items-start gap-2 rounded-sm px-2 py-1.5 motion-hover ${i?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`,children:[o?(0,G.jsx)(Sr,{to:Rn(e.session),className:`flex min-w-0 flex-1 items-start gap-2`,children:f}):(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,"aria-disabled":`true`,children:f}),(0,G.jsx)(pl,{bookmarked:!0,onRename:()=>h(e),onToggleBookmark:()=>d(e)})]})},Xo(r))})})]}),i?(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`h3`,{className:`console-eyebrow mb-3`,children:[`SESSIONS`,s.length>0?(0,G.jsx)(`span`,{className:`ml-2 text-[10px] font-normal text-[var(--console-muted)]`,children:`Navigate j k · Open Enter`}):null]}),s.length===0?(0,G.jsx)(Cy,{scanning:`Scanning sessions...`,empty:`No sessions yet`}):(0,G.jsx)(lr,{id:`SessionTreeSidebar`,detail:{sessions:s.length},children:(0,G.jsx)(xy,{sessions:s,activeSessionReference:g,selectedSessionReference:c,onSelectSession:f,bookmarkedSessionReferences:l,onToggleBookmark:p,onRenameSession:m,groupByProject:!1})})]}):null]})})}var Ey=[{title:`Navigation`,items:[{keys:`j / k`,description:`Move through sessions or search results`},{keys:`Enter`,description:`Open the current selection`},{keys:`g / G`,description:`Jump to the first or last item`}]},{title:`Search & Help`,items:[{keys:`Cmd/Ctrl K`,description:`Open global search`},{keys:`/`,description:`Focus the search box`},{keys:`Esc`,description:`Exit search or close the current detail view`},{keys:`?`,description:`Open this shortcuts panel`}]}];function Dy({open:e,onClose:t}){return(0,G.jsx)(Qt,{open:e,onOpenChange:e=>e?void 0:t(),children:(0,G.jsxs)(Yt,{children:[(0,G.jsx)(ce,{className:`shortcut-overlay fixed inset-0 z-50 bg-[var(--scrim)]`}),(0,G.jsxs)(Kt,{className:`shortcut-content fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] max-w-2xl origin-center -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-5 shadow-[var(--shadow-overlay)] outline-none`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`Keyboard Shortcuts`}),(0,G.jsx)(Ut,{className:`console-display mt-2 text-[19px] font-semibold text-[var(--console-text)]`,children:`Navigate without leaving the keyboard`})]}),(0,G.jsx)(L,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Esc`})]}),(0,G.jsx)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-2`,children:Ey.map(e=>(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-4`,children:[(0,G.jsx)(`h3`,{className:`console-eyebrow`,children:e.title}),(0,G.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.items.map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-text)]`,children:e.keys}),(0,G.jsx)(`p`,{className:`mt-1 text-[13px] leading-6 text-[var(--console-text-secondary)]`,children:e.description})]},e.keys))})]},e.title))})]})]})})}var Oy={light:`dark`,dark:`system`,system:`light`},ky={light:$n,dark:cr,system:ir},Ay={light:`Light`,dark:`Dark`,system:`System`};function jy({theme:e,onChange:t}){let n=ky[e],r=Oy[e];return(0,G.jsx)(`button`,{type:`button`,onClick:()=>t(r),"aria-label":`Theme: ${Ay[e]}. Switch to ${Ay[r]}.`,title:`Theme: ${Ay[e]} (click for ${Ay[r]})`,className:`console-mono motion-hover motion-press rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1.5 text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:(0,G.jsx)(n,{"aria-hidden":`true`,className:`size-4`})})}function My({active:e,onToggle:t,className:n=``}){return(0,G.jsx)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},"aria-label":e?`Remove bookmark`:`Add bookmark`,title:e?`Remove bookmark`:`Add bookmark`,className:`motion-hover motion-press inline-flex size-6 shrink-0 items-center justify-center rounded-sm border focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none ${n} ${e?`border-[var(--brand-line)] bg-[var(--brand-soft)] text-[var(--brand)]`:`border-transparent text-[var(--console-muted)] opacity-70 hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] hover:opacity-100`}`,children:(0,G.jsx)(dr,{className:`size-3`,strokeWidth:1.8,fill:e?`currentColor`:`none`})})}function Ny(e){return e.total_tokens??e.total_input_tokens+e.total_output_tokens}function Py({label:e,value:t,hint:n}){return(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:e}),(0,G.jsx)(`p`,{className:`console-mono mt-2 text-xl font-semibold text-[var(--console-text)]`,children:t}),n?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-[var(--console-muted)]`,children:n}):null]})}function Fy({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:e}),(0,G.jsx)(`p`,{className:`console-mono mt-2 break-all text-sm leading-6 text-[var(--console-text)]`,children:t})]})}function Iy({code:e,title:t,description:n,aside:r,iconSrc:i,iconColored:a,iconAlt:o}){return(0,G.jsx)(An,{className:`p-5 md:p-6`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-5 md:flex-row md:items-start md:justify-between`,children:[(0,G.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow inline-flex rounded-full border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-1`,children:e}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-start gap-3`,children:[i?(0,G.jsx)(xt,{icon:i,iconColored:a,alt:o||``,className:`mt-1 size-8 shrink-0 object-contain`}):null,(0,G.jsx)(`h2`,{className:`console-display text-2xl leading-tight font-semibold text-[var(--console-text)] md:text-[2rem]`,children:t})]}),(0,G.jsx)(`p`,{className:`mt-3 max-w-[42rem] text-sm leading-7 text-[var(--console-muted)]`,children:n})]}),(0,G.jsxs)(`div`,{className:`min-w-0 rounded-md border border-dashed border-[var(--console-border)] bg-[var(--console-surface-muted)] px-4 py-3 md:max-w-xs`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`STATUS NOTE`}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--console-text)]`,children:r})]})]})})}function Ly({agentItems:e}){return(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Known Agents`,meta:`${e.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:e.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:Wn(e.key),className:`flex min-h-11 items-center gap-2 rounded-sm border border-transparent px-3 py-2 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)]`,children:[e.icon?(0,G.jsx)(xt,{icon:e.icon,iconColored:e.iconColored,alt:e.name,className:`size-4 object-contain`}):null,(0,G.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,G.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]})}function Ry({sessions:e,isBookmarked:t,onToggleBookmark:n}){return e.length===0?(0,G.jsx)(An,{className:`p-4 text-sm text-[var(--console-muted)]`,children:`No sessions yet`}):(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Recent Sessions`,meta:`${e.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 space-y-2`,children:e.map(e=>{let r=t(e.agentKey,e.id);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm border border-transparent px-2 py-1.5 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,G.jsxs)(Sr,{to:zn({agentName:e.agentKey,sessionId:e.sessionId}),className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`line-clamp-1 text-sm text-[var(--console-text)]`,children:Mr(e)}),(0,G.jsxs)(`p`,{className:`console-mono mt-0.5 text-[11px] text-[var(--console-muted)]`,children:[`/`,e.reference,` ·`,` `,vt(e.time_updated||e.time_created)]}),(0,G.jsx)(Or,{tags:e.smart_tags,className:`mt-1.5`})]}),(0,G.jsx)(My,{active:r,onToggle:()=>n(e)})]})},e.id)})})]})}var zy=(0,W.memo)(function({type:e,agentCatalog:t,sessions:n,agentItems:r,activeAgentKey:i,attemptedAgentKey:a,attemptedSessionId:o,isBookmarked:s,onToggleBookmark:c}){let{recentSessions:l,totalMessages:u,totalTokens:d,totalCost:f,costSource:p,latestUpdatedAt:m}=(0,W.useMemo)(()=>{let e=n.toSorted((e,t)=>(t.time_updated||t.time_created||0)-(e.time_updated||e.time_created||0)),t=0,r=0,i=0,a=!1;for(let e of n)t+=e.stats.message_count,r+=Ny(e.stats),i+=e.stats.total_cost,a||=e.stats.cost_source===`estimated`;return{recentSessions:e.slice(0,5),totalMessages:t,totalTokens:r,totalCost:i,costSource:i>0?a?`estimated`:`recorded`:void 0,latestUpdatedAt:e[0]?.time_updated||e[0]?.time_created}},[n]);if(e===`missing-agent`){let e=`/${a||`unknown`}${o?`/${o}`:``}`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(Iy,{code:`404 / AGENT`,title:`This agent isn't on the roster.`,description:`The path you requested is valid in shape, but there is no matching agent in the current registry. It may not be connected yet, or its name may not match what the system recognizes.`,aside:`Choose one of the available agents to continue.`}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,G.jsx)(Fy,{label:`Requested Agent`,value:a||`unknown`}),(0,G.jsx)(Fy,{label:`Requested Path`,value:e}),o?(0,G.jsx)(Fy,{label:`Requested Session`,value:o}):null]}),(0,G.jsx)(Ly,{agentItems:r})]})}if(e===`missing-session`){let e=i?Ar(t,i):void 0,n=e?.displayName??i??`Unknown Agent`,r=e?.icon,a=o||`unknown-session`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(Iy,{code:`404 / SESSION`,title:`This session isn't in the index.`,description:`${n} is available, but the session you're looking for does not exist in the current index. The session ID may be incorrect, or the record may never have been part of this dataset.`,aside:`We checked the current path, but nothing matched. The session list on the left is still available.`,iconSrc:r,iconColored:e?.iconColored,iconAlt:n}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,G.jsx)(`p`,{className:`console-eyebrow`,children:`Agent`}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[r?(0,G.jsx)(xt,{icon:r,iconColored:e?.iconColored,alt:n,className:`size-4 shrink-0 object-contain`}):null,(0,G.jsx)(`p`,{className:`console-mono break-all text-sm leading-6 text-[var(--console-text)]`,children:n})]})]}),(0,G.jsx)(Fy,{label:`Session`,value:a})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]})}if(e===`global`)return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,G.jsx)(Py,{label:`Total Sessions`,value:Ze(n.length)}),(0,G.jsx)(Py,{label:`Total Messages`,value:Ze(u)}),(0,G.jsx)(Py,{label:`Latest Activity`,value:vt(m),hint:m?new Date(m).toLocaleString(`zh-CN`):void 0})]}),(0,G.jsxs)(An,{className:`p-4`,children:[(0,G.jsx)(Tn,{title:`Agents`,meta:`${r.length} items`}),(0,G.jsx)(`ul`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:r.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(Sr,{to:Wn(e.key),className:`flex items-center gap-2 rounded-sm border border-transparent px-2 py-1.5 motion-hover hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[e.icon?(0,G.jsx)(xt,{icon:e.icon,iconColored:e.iconColored,alt:e.name,className:`size-4 object-contain`}):null,(0,G.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,G.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]});let h=i?Ar(t,i):void 0,g=h?.displayName??`Unknown Agent`;return(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,G.jsx)(An,{className:`p-4`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h?.icon?(0,G.jsx)(xt,{icon:h.icon,iconColored:h.iconColored,alt:g,className:`size-6 object-contain`}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`console-display text-[15px] font-semibold text-[var(--console-text)]`,children:g}),(0,G.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Select a session from the left to view details`})]})]})}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:[(0,G.jsx)(Py,{label:`Sessions`,value:Ze(n.length)}),(0,G.jsx)(Py,{label:`Messages`,value:Ze(u)}),(0,G.jsx)(Py,{label:`Tokens`,value:Ze(d)}),(0,G.jsx)(Py,{label:`Total Cost`,value:ht(f),hint:Ue(p)})]}),(0,G.jsx)(Ry,{sessions:l,isBookmarked:s,onToggleBookmark:c})]})}),By=[{id:`1`,roleWidth:`w-14`,timeWidth:`w-20`,bodyWidths:[`w-full`,`w-10/12`,`w-7/12`]},{id:`2`,roleWidth:`w-16`,timeWidth:`w-24`,bodyWidths:[`w-9/12`,`w-7/12`]},{id:`3`,roleWidth:`w-14`,timeWidth:`w-16`,bodyWidths:[`w-full`,`w-11/12`,`w-8/12`,`w-5/12`]},{id:`4`,roleWidth:`w-16`,timeWidth:`w-20`,bodyWidths:[`w-10/12`,`w-8/12`]},{id:`5`,roleWidth:`w-14`,timeWidth:`w-24`,bodyWidths:[`w-full`,`w-10/12`,`w-9/12`]}],Vy=[`w-8/12`,`w-7/12`,`w-9/12`,`w-6/12`,`w-10/12`,`w-7/12`];function Hy({className:e}){return(0,G.jsx)(`div`,{className:`skeleton-shimmer rounded-sm ${e}`})}function Uy(){return(0,G.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-[1440px] gap-6 px-2 md:px-4 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,G.jsxs)(`div`,{className:`hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3 min-[1025px]:block`,children:[(0,G.jsx)(Hy,{className:`h-2.5 w-20`}),(0,G.jsx)(`div`,{className:`mt-4 space-y-2.5`,children:Vy.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,G.jsx)(Hy,{className:`size-3.5 shrink-0`}),(0,G.jsx)(Hy,{className:`h-3 ${e}`})]},`${t}-${e}`))})]}),(0,G.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:By.map(e=>(0,G.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,G.jsxs)(`div`,{className:`flex gap-4`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,G.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,G.jsx)(Hy,{className:`size-3.5`})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(Hy,{className:`${e.roleWidth} h-3`}),(0,G.jsx)(Hy,{className:`${e.timeWidth} h-2.5`})]}),(0,G.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,G.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,G.jsx)(Hy,{className:`${t} h-3`},`${e.id}-${t}`))})})]})]})},e.id))})]})}var Wy=(0,W.lazy)(()=>gr(()=>import(`./OverviewScreen-DriPmCam.js`).then(e=>({default:e.OverviewScreen})),__vite__mapDeps([0,1,2,3,4]))),Gy=(0,W.lazy)(()=>gr(()=>import(`./Projects-BPDIcUBK.js`).then(e=>({default:e.ProjectsOverview})),__vite__mapDeps([5,1,2,3,4,6,7,8,0]))),Ky=(0,W.lazy)(()=>gr(()=>import(`./Projects-BPDIcUBK.js`).then(e=>({default:e.ProjectDashboardView})),__vite__mapDeps([5,1,2,3,4,6,7,8,0]))),qy=(0,W.lazy)(()=>gr(()=>import(`./SessionDetail-BnpvDwtH.js`).then(e=>({default:e.SessionDetail})),__vite__mapDeps([9,1,2,3,10,6,7,11]))),Jy=(0,W.lazy)(()=>gr(()=>import(`./SearchResultsPanel-A6_3TPhW.js`).then(e=>({default:e.SearchResultsPanel})),__vite__mapDeps([12,1,3,6,13,14,8])));function Yy({children:e}){let t=mr();return(0,G.jsx)(ur,{children:(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(Uy,{}),children:e})},t.pathname)}function Xy({loading:e,error:t,onRetry:n,viewState:r,detailHighlightQuery:i,agents:a,agentCatalog:o,agentNameMap:s,projects:c,landingSessions:l,sessions:u=[],sessionsByAgent:d,activeProject:f,activeProjectSessions:p,overview:m,sessionDetail:h,projectAgentFilter:g,search:_,bookmarks:v}){let y=(0,W.useMemo)(()=>a.map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,iconColored:e.iconColored,count:e.count})),[a]),b=r.mode===`session`?h.session:null,x=b?.reference.agentName,S=b?.reference.sessionId,C=(0,W.useMemo)(()=>{if(!x||!S)return[];let e=Xn(x,S);return u.filter(t=>t.parent_reference&&Xn(t.parent_reference.agentName,t.parent_reference.sessionId)===e)},[x,S,u]),w=v.toggleSessionBookmark,T=(0,W.useCallback)(e=>w(e,e.agentKey),[w]);if(e)return(0,G.jsx)(Uy,{});if(_.active){let e=_.state.status===`loaded`?_.state.results.length:0;return(0,G.jsx)(lr,{id:`SearchResultsPanel`,detail:{results:e,loading:_.state.status===`loading`},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(Jy,{query:_.query,state:_.state,agentNameMap:s,agents:a,projects:_.projectOptions,filters:_.filters,onChangeFilters:_.onChangeFilters,onOpenResult:_.onClose,onRetry:_.onRetry,selectedIndex:_.selectedIndex,registerResultRef:_.registerResultRef})})})}return t?(0,G.jsxs)(`div`,{role:`alert`,className:`mx-auto max-w-4xl rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6 text-sm text-[var(--console-error)]`,children:[(0,G.jsx)(`p`,{children:t}),(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`console-mono mt-4 rounded-sm border border-[var(--console-error-border)] px-3 py-1.5 text-xs motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Retry`})]}):r.mode===`root`?(0,G.jsx)(lr,{id:`OverviewScreen`,detail:{projects:c.length},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(Wy,{window:m.window,agentCatalog:o,rangePreset:m.rangePreset,onRangeChange:m.onRangeChange,onSelectCustom:m.onSelectCustom})})}):r.mode===`projects`?(0,G.jsx)(Yy,{children:(0,G.jsx)(Gy,{projects:c,agentCatalog:o})}):r.mode===`project`?(0,G.jsx)(Yy,{children:(0,G.jsx)(Ky,{project:f,agentCatalog:o,projectKey:r.activeProjectKey,sessions:p,activeAgent:g.selectedAgent,onChangeAgent:g.onChangeAgent,timeWindow:m.window,rangePreset:m.rangePreset,onRangeChange:m.onRangeChange,onSelectCustom:m.onSelectCustom})}):r.mode===`agent`?(0,G.jsx)(zy,{type:`agent`,agentCatalog:o,sessions:d.get(r.activeAgentKey)??[],agentItems:y,activeAgentKey:r.activeAgentKey,isBookmarked:v.isBookmarked,onToggleBookmark:T}):r.mode===`session`?h.loading?(0,G.jsx)(Uy,{}):h.error||!b?(0,G.jsx)(zy,{type:`missing-session`,agentCatalog:o,sessions:d.get(r.activeAgentKey)??[],agentItems:y,activeAgentKey:r.activeAgentKey,attemptedSessionId:r.activeSessionId,isBookmarked:v.isBookmarked,onToggleBookmark:T}):(0,G.jsx)(lr,{id:`SessionDetail`,detail:{messages:b.messages.length,session:b.id},children:(0,G.jsx)(Yy,{children:(0,G.jsx)(qy,{session:b,agentCatalog:o,highlightQuery:i,childSessions:C},`${b.reference.agentName}/${b.reference.sessionId}`)})}):r.mode===`missingAgent`?(0,G.jsx)(zy,{type:`missing-agent`,agentCatalog:o,sessions:l,agentItems:y,attemptedAgentKey:r.attemptedKey,isBookmarked:v.isBookmarked,onToggleBookmark:e=>v.toggleSessionBookmark(e,e.agentKey)}):(0,G.jsx)(`div`,{className:`text-sm text-[var(--console-muted)]`,children:`Invalid route.`})}function Zy({visible:e}){let t=No(),n=En(t),r=t?[t.phase,t.scanningAgents[0]??``,t.completedAgents.length,t.totalAgents,t.backfill.active,t.backfill.currentAgent??``,t.backfill.pendingAgents.length,t.backfill.failedAgents.length].join(`|`):null,i=(0,W.useRef)({milestoneKey:r,label:n});return i.current.milestoneKey!==r&&(i.current={milestoneKey:r,label:n}),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{children:e&&n?(0,G.jsx)(`p`,{className:`console-mono mt-2 inline-flex max-w-4xl rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] leading-relaxed text-[var(--console-warning)]`,children:n}):null}),(0,G.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e?i.current.label:null})]})}function Qy(){let e=Cr(),t=vs(),n=Rs(t.config?.window),{timeWindow:r}=n,{activeAgents:i,agentCatalog:o,sessions:s,projects:c,dashboard:l,window:u,validAgentKeys:d,agentNameMap:f,loading:p,error:m,reload:h,applyLiveEvent:g,resyncLiveState:_,retryLoad:v}=t;bs({window:r,reload:h});let y=Po(),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(!1),{shortcutHintDismissed:w,sidebarCollapsed:T,theme:E,dismissShortcutHint:D,setSidebarCollapsed:O,setTheme:k}=Ys(),A=bn(E),[j,M]=(0,W.useState)(null),N=mr(),P=hr(),F=(0,W.useMemo)(()=>ko(P,d),[P,d]),ee=zo(F),{session:te,sessionError:I}=ee;(0,W.useEffect)(()=>{a(`route.change`,{path:N.pathname,mode:F.mode,agent:F.activeAgentKey,session:F.activeSessionId})},[N.pathname,F.mode,F.activeAgentKey,F.activeSessionId]);let L=(0,W.useMemo)(()=>Er(s,i),[s,i]),R=Go(L,u),{draftSearchQuery:z,activeSearchQuery:ne,searchMode:B,searchState:V,searchResults:re,searchLoading:ie,selectedSearchIndex:ae,searchInputRef:oe,setDraftSearchQuery:se,setSelectedSearchIndex:ce,openSearch:le,submitSearch:ue,closeSearch:de}=R,fe=B,pe=fe?ne:typeof N.state==`object`&&N.state!==null&&`searchQuery`in N.state&&typeof N.state.searchQuery==`string`?N.state.searchQuery:``,me=ns(),{bookmarkedSessions:he,isSessionBookmarked:ge,toggleBookmark:_e,toggleSessionBookmark:ve,refresh:ye}=me,H=F.mode===`project`?F.activeProjectKind:null,be=F.mode===`project`?F.activeProjectKey:null,xe=H&&be?Ln({kind:H,key:be}):null,[Se,Ce]=(0,W.useState)(null),we=Se?.identityKey===xe?Se?.agentKey:void 0,Te=(0,W.useCallback)(e=>{Ce(xe?{identityKey:xe,agentKey:e}:null)},[xe]),{activeAgent:Ee,activeProject:De,activeProjectSessions:Oe,selectedProjectNavigation:ke,sidebarSessions:Ae,sidebarSessionLookup:je,bookmarkedSidebarSessionReferences:Me}=as({viewState:F,sessionIndexes:L,session:te,agents:i,projects:c,selectedProjectAgent:we,isSessionBookmarked:ge}),Ne=ke?.identity??null,Pe=ke?.identityKey??null,Fe=(0,W.useCallback)(t=>{x(wr(t)),e(Rn(t))},[e]),Ie=(0,W.useCallback)(e=>{ve(e,Hn(e))},[ve]),Le=(0,W.useCallback)(e=>{M({agentKey:Hn(e),sessionId:e.id,title:e.title,displayTitle:e.display_title})},[]),Re=(0,W.useCallback)(e=>{M({agentKey:e.reference.agentName,sessionId:e.reference.sessionId,title:e.availability===`available`?e.session.title:e.reference.sessionId,displayTitle:e.availability===`available`?e.session.display_title:e.display_title})},[]),{liveNotice:ze}=Ss({applyLiveEvent:g,resyncLiveState:_,setScanStatus:y}),{saveAlias:Be,removeAlias:Ve}=ys((0,W.useCallback)(async()=>{await Promise.all([r?h(r):void 0,ye()])},[ye,h,r])),He=(0,W.useCallback)(async e=>{j&&await Be(j,e)},[j,Be]),Ue=(0,W.useCallback)(async()=>{j&&await Ve(j)},[j,Ve]);(0,W.useEffect)(()=>{if(!fe){if(F.mode===`session`){x(Xn(F.activeAgentKey,F.activeSessionId));return}if(F.mode===`agent`){x(null);return}x(null)}},[fe,F.mode,F.activeAgentKey,F.activeSessionId]);let We=Zs({viewState:F,isSearchMode:fe,searchSubtitle:V.status===`failed`?`Search failed for "${ne}"`:kn(ne,ie,re.length),dashboard:l,projects:c,sessionCount:s.length,activeProject:De?.project??null,activeAgent:Ee,sidebarSessionCount:Ae.length,session:te,sessionError:I,selectedProjectIdentity:Ne,selectedProject:ke?.project??null}),Ge=(0,G.jsx)(Xy,{loading:p,error:m,onRetry:()=>void v(),viewState:F,detailHighlightQuery:pe,agents:i,agentCatalog:o,agentNameMap:f,projects:c,landingSessions:L.landingSessions,sessions:s,sessionsByAgent:L.byLandingAgent,activeProject:De?.project??null,activeProjectSessions:Oe,overview:{window:u,rangePreset:n.preset??`all`,onRangeChange:n.selectPreset,onSelectCustom:n.selectCustom},sessionDetail:{session:ee.session,loading:ee.sessionLoading,error:ee.sessionError},projectAgentFilter:{selectedAgent:we,onChangeAgent:Te},search:{active:R.searchMode,query:R.activeSearchQuery,state:R.searchState,projectOptions:R.projectOptions,filters:R.searchFilters,onChangeFilters:R.setSearchFilters,onClose:R.closeSearch,onRetry:R.retrySearch,selectedIndex:R.selectedSearchIndex,registerResultRef:R.registerResultRef},bookmarks:{isBookmarked:me.isSessionBookmarked,toggleSessionBookmark:me.toggleSessionBookmark}});return ws({viewState:F,navigate:e,sidebarSessions:Ae,sidebarSessionLookup:je,selectedSidebarSessionReference:b,setSelectedSidebarSessionReference:x,selectedProjectNavigationIdentity:Ne,shortcutHelpOpen:S,setShortcutHelpOpen:C,dismissShortcutHint:D,isSearchMode:fe,activeSearchQuery:ne,searchResults:re,selectedSearchIndex:ae,setSelectedSearchIndex:ce,setDraftSearchQuery:se,openSearch:le,closeSearch:de}),(0,G.jsx)(On.Provider,{value:A,children:(0,G.jsxs)(`div`,{className:`console-ui flex h-screen flex-col overflow-hidden bg-[var(--console-bg)] text-[var(--console-text)]`,children:[(0,G.jsx)(`a`,{href:`#main`,className:`console-mono sr-only rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-1.5 text-xs text-[var(--console-text)] focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[60] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:`Skip to content`}),(0,G.jsx)(`header`,{className:`shrink-0 border-b border-[var(--console-border)] bg-[var(--console-surface)]/85 backdrop-blur-sm`,children:(0,G.jsxs)(`div`,{className:`grid min-h-14 grid-cols-[auto_1fr] items-center gap-3 px-4 py-2 sm:grid-cols-[auto_1fr_auto] sm:py-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,G.jsxs)(Sr,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,G.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,G.jsx)(`span`,{className:`console-display text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]})}),(0,G.jsxs)(`form`,{className:`order-3 col-span-2 flex w-full items-center justify-center gap-2 sm:order-none sm:col-span-1 sm:mx-auto sm:max-w-[560px]`,onSubmit:e=>{e.preventDefault(),ue()},children:[(0,G.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 focus-within:border-[var(--brand-line)] focus-within:ring-2 focus-within:ring-[var(--brand)]`,children:[(0,G.jsx)(`span`,{className:`sr-only`,children:`Search Sessions`}),(0,G.jsx)(`input`,{ref:oe,type:`search`,name:`session-search`,autoComplete:`off`,value:z,onChange:e=>se(e.target.value),placeholder:`Search sessions… /`,className:`console-mono w-full min-w-0 bg-transparent text-xs text-[var(--console-text)] outline-none placeholder:text-[var(--console-muted)]`})]}),(0,G.jsx)(`button`,{type:`submit`,className:`console-mono rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-3 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Search`})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,G.jsx)(jy,{theme:E,onChange:k}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{C(!0),D()},className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,title:`Show keyboard shortcuts`,children:[`?`,(0,G.jsx)(`span`,{className:`hidden sm:inline`,children:` Shortcuts`})]}),r&&n.preset?(0,G.jsx)(Co,{window:r,preset:n.preset,customFrom:n.customFrom,customTo:n.customTo,onSelectPreset:n.selectPreset,onSelectCustom:n.selectCustom}):null,(0,G.jsxs)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)] sm:inline-flex`,children:[`v`,`1.0.2`]})]})]})}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,G.jsx)(Ty,{model:{sidebarCollapsed:T,viewState:F,agentCatalog:o,projects:c,selectedProjectNavigationId:Pe,loading:p,bookmarkedSessions:he,sidebarSessions:Ae,selectedSidebarSessionReference:b,bookmarkedSidebarSessionReferences:Me},actions:{onCollapse:()=>O(!0),onToggleBookmark:_e,onSelectFlatSidebarSession:Fe,onToggleSidebarSessionBookmark:Ie,onRenameSession:Le,onRenameBookmarkedSession:Re}}),(0,G.jsxs)(`main`,{id:`main`,tabIndex:-1,className:`flex min-w-0 flex-1 flex-col outline-none`,children:[(0,G.jsxs)(`section`,{className:`flex shrink-0 items-start gap-3 border-b border-[var(--console-border)] bg-[var(--console-surface)]/70 px-4 py-4 backdrop-blur-sm md:px-8`,children:[T?(0,G.jsx)(`button`,{type:`button`,"aria-expanded":`false`,"aria-label":`Expand sidebar`,title:`Expand sidebar`,onClick:()=>O(!1),className:`mt-0.5 hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none lg:inline-flex`,children:(0,G.jsx)(rr,{className:`size-4`})}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`console-mono mb-2 flex flex-wrap items-center gap-1 text-[11px] text-[var(--console-muted)]`,children:We.breadcrumbs.map((e,t)=>(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.to?(0,G.jsx)(Sr,{to:e.to,className:`motion-hover hover:text-[var(--console-text)]`,children:e.label}):(0,G.jsx)(`span`,{className:`text-[var(--console-text)]`,children:e.label}),t<We.breadcrumbs.length-1?(0,G.jsx)(`span`,{children:`/`}):null]},`${e.label}-${t}`))}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5`,children:We.contextLabel}),(0,G.jsx)(`h1`,{className:`console-display text-2xl font-semibold text-[var(--console-text)]`,children:We.title})]}),(0,G.jsx)(`div`,{className:`console-mono mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[var(--console-muted)]`,children:We.subtitle}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[w?null:(0,G.jsxs)(`div`,{className:`console-mono inline-flex items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:[(0,G.jsx)(`span`,{children:`Keyboard navigation available`}),(0,G.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1`,children:`?`}),(0,G.jsx)(`button`,{type:`button`,onClick:D,className:`text-[var(--console-muted)] motion-hover hover:text-[var(--console-text)]`,"aria-label":`Dismiss keyboard shortcuts hint`,children:`×`})]}),!fe&&F.mode===`session`?(0,G.jsx)(`span`,{className:`console-mono inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:`Esc back`}):null,!fe&&F.mode===`session`&&te?(0,G.jsx)(ri,{resumeCommandPrefix:Ar(o,F.activeAgentKey)?.resumeCommandPrefix??null,sessionId:te.id,directory:te.directory}):null]}),(0,G.jsx)(`div`,{"aria-live":`polite`,children:ze?(0,G.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:ze}):null}),(0,G.jsx)(Zy,{visible:F.mode===`root`})]})]}),(0,G.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,G.jsx)(ur,{children:(0,G.jsx)(lr,{id:`MainContent`,detail:{mode:F.mode,search:fe,sessions:s.length},children:Ge})},N.pathname)})]})]}),(0,G.jsx)(Dy,{open:S,onClose:()=>C(!1)}),(0,G.jsx)(xo,{target:j,onClose:()=>M(null),onSave:He,onRemove:Ue})]})})}function $y(){let e=br(),t=Dr(e)?`${e.status} ${e.statusText}`:`The application route failed to render.`;return(0,G.jsx)(`div`,{role:`alert`,children:t})}var eb=pr([{id:`app-shell`,path:`/`,Component:Qy,ErrorBoundary:$y,loader:Do,children:To}]);function tb(){return(0,G.jsx)($r,{router:eb})}me(),Kr.createRoot(document.getElementById(`root`)).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(gn,{client:Zr,children:(0,G.jsx)(Mo,{children:(0,G.jsx)(lr,{id:`App`,children:(0,G.jsx)(tb,{})})})})}));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none">
|
|
2
|
+
<path d="M48.8354 10.0479C48.3232 9.79199 48.1025 10.2798 47.8032 10.5278C47.7007 10.6079 47.6143 10.7119 47.5273 10.8076C46.7793 11.624 45.9048 12.1597 44.7622 12.0957C43.0923 12 41.666 12.5356 40.4058 13.8398C40.1377 12.2319 39.2476 11.272 37.8926 10.6558C37.1836 10.3359 36.4668 10.0156 35.9702 9.31982C35.6235 8.82373 35.5293 8.27197 35.356 7.72754C35.2456 7.3999 35.1353 7.06396 34.7651 7.00781C34.3633 6.94385 34.2056 7.2876 34.0479 7.57568C33.418 8.75195 33.1733 10.0479 33.1973 11.3599C33.2524 14.312 34.4736 16.6641 36.8999 18.3359C37.1758 18.5278 37.2466 18.7197 37.1597 19C36.9946 19.5757 36.7974 20.1357 36.624 20.7119C36.5137 21.0801 36.3486 21.1597 35.9624 21C34.6309 20.4321 33.481 19.5918 32.4644 18.5757C30.7393 16.8721 29.1792 14.9917 27.2334 13.52C26.7764 13.1758 26.3193 12.856 25.8467 12.5518C23.8618 10.584 26.1069 8.96777 26.627 8.77588C27.1704 8.57568 26.8159 7.8877 25.0591 7.896C23.3022 7.90381 21.6953 8.50391 19.647 9.30371C19.3477 9.42383 19.0322 9.51172 18.7095 9.58398C16.8501 9.22363 14.9199 9.14355 12.9033 9.37598C9.10596 9.80762 6.07275 11.6396 3.84326 14.7681C1.16455 18.5278 0.53418 22.7998 1.30664 27.2559C2.11768 31.9521 4.46582 35.8398 8.07373 38.8799C11.8159 42.0322 16.1255 43.5762 21.041 43.2803C24.0269 43.104 27.3516 42.6963 31.1016 39.4561C32.0469 39.936 33.0396 40.1279 34.686 40.272C35.9546 40.3921 37.1758 40.208 38.1211 40.0078C39.6021 39.688 39.4995 38.2881 38.9639 38.0322C34.623 35.9678 35.5762 36.8081 34.71 36.1279C36.9155 33.4639 40.2402 30.6958 41.54 21.728C41.6426 21.0161 41.5557 20.5679 41.54 19.9917C41.5322 19.6396 41.6108 19.5039 42.0049 19.4639C43.0923 19.3359 44.1479 19.0317 45.1167 18.4878C47.9292 16.9199 49.064 14.3438 49.3315 11.2559C49.3711 10.7837 49.3237 10.2959 48.8354 10.0479ZM24.3262 37.8398C20.1196 34.4639 18.0791 33.3521 17.2358 33.3999C16.4482 33.4482 16.5898 34.3682 16.7632 34.9678C16.9443 35.5601 17.1812 35.9683 17.5117 36.4878C17.7402 36.832 17.8979 37.3442 17.2832 37.728C15.9282 38.584 13.5728 37.4399 13.4624 37.3838C10.7207 35.7358 8.42822 33.5601 6.81348 30.584C5.25342 27.7197 4.34766 24.6479 4.19775 21.3677C4.1582 20.5757 4.38672 20.2959 5.15869 20.1519C6.17529 19.96 7.22314 19.9199 8.23926 20.0718C12.5327 20.7119 16.1885 22.6719 19.2529 25.7759C21.002 27.5439 22.3252 29.6558 23.6885 31.7202C25.1377 33.9121 26.6978 36 28.6831 37.7119C29.3843 38.312 29.9434 38.7681 30.479 39.104C28.8643 39.2881 26.1699 39.3281 24.3262 37.8398ZM26.3433 24.6001C26.3433 24.248 26.6191 23.9678 26.9658 23.9678C27.0444 23.9678 27.1152 23.9839 27.1782 24.0078C27.2651 24.04 27.3438 24.0879 27.4067 24.1602C27.5171 24.272 27.5801 24.4321 27.5801 24.6001C27.5801 24.9521 27.3042 25.2319 26.9575 25.2319C26.6108 25.2319 26.3433 24.9521 26.3433 24.6001ZM32.6064 27.8799C32.2046 28.0479 31.8027 28.1919 31.4165 28.208C30.8179 28.2397 30.1641 27.9922 29.8096 27.688C29.2583 27.2158 28.8643 26.9521 28.6987 26.1279C28.6279 25.7759 28.6675 25.2319 28.7305 24.9199C28.8721 24.248 28.7144 23.8159 28.2495 23.4238C27.8716 23.104 27.3911 23.0161 26.8633 23.0161C26.666 23.0161 26.4849 22.9277 26.3511 22.856C26.1304 22.7441 25.9492 22.4639 26.1226 22.1201C26.1777 22.0078 26.4458 21.7358 26.5088 21.688C27.2256 21.272 28.0527 21.4077 28.8169 21.7197C29.5259 22.0161 30.0615 22.5601 30.834 23.3281C31.6216 24.2559 31.7632 24.5117 32.2124 25.208C32.5669 25.752 32.8901 26.312 33.1104 26.9521C33.2446 27.3521 33.0713 27.6802 32.6064 27.8799Z" fill="#4D6BFE" fill-rule="nonzero"/>
|
|
3
|
+
</svg>
|
package/dist/web/index.html
CHANGED
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
</style>
|
|
201
|
-
<script type="module" crossorigin src="/assets/index-
|
|
201
|
+
<script type="module" crossorigin src="/assets/index-99ZxpV2y.js"></script>
|
|
202
202
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-B-hcVAMW.js">
|
|
203
203
|
<link rel="modulepreload" crossorigin href="/assets/contract-V6QuD0UY.js">
|
|
204
204
|
<link rel="modulepreload" crossorigin href="/assets/utils-DgUgu15E.js">
|