codesesh 0.1.3 → 0.1.4
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/dist/{chunk-BQ22Y6H4.js → chunk-FG2FZIU5.js} +2 -1
- package/dist/{chunk-BQ22Y6H4.js.map → chunk-FG2FZIU5.js.map} +1 -1
- package/dist/{dist-RRY4LURU.js → dist-ZF35YB7B.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/web/assets/{index-D12EHlVg.js → index-B5ae_tcH.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- /package/dist/{dist-RRY4LURU.js.map → dist-ZF35YB7B.js.map} +0 -0
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
saveCachedSessions,
|
|
24
24
|
scanSessions,
|
|
25
25
|
scanSessionsAsync
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FG2FZIU5.js";
|
|
27
27
|
export {
|
|
28
28
|
BaseAgent,
|
|
29
29
|
basenameTitle,
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
scanSessions,
|
|
50
50
|
scanSessionsAsync
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=dist-
|
|
52
|
+
//# sourceMappingURL=dist-ZF35YB7B.js.map
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getAgentInfoMap,
|
|
5
5
|
perf,
|
|
6
6
|
scanSessionsAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FG2FZIU5.js";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import { defineCommand, runMain } from "citty";
|
|
@@ -253,7 +253,7 @@ var main = defineCommand({
|
|
|
253
253
|
perf.enable();
|
|
254
254
|
}
|
|
255
255
|
if (clearCache) {
|
|
256
|
-
const { clearCache: clear } = await import("./dist-
|
|
256
|
+
const { clearCache: clear } = await import("./dist-ZF35YB7B.js");
|
|
257
257
|
clear();
|
|
258
258
|
console.log("Cache cleared.");
|
|
259
259
|
}
|
|
@@ -64,4 +64,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
64
64
|
|
|
65
65
|
`);return n.trim()?n:wb(e)}function zb(e){let t=gb(e.inputValue);if(e.status===`completed`){let e=vb(t.content);if(e.trim())return bb(e)}return wb(e)}function Bb(e){let t=gb(gb(e.state).arguments),n=hb(t.agent_type),r=hb(e.nickname),i=[hb(t.model),hb(t.reasoning_effort)].filter(Boolean).join(`-`);return[[n,r].filter(Boolean).join(` - `),i].filter(Boolean).join(` `)}function Vb(e){let t=gb(e.state);return hb(t.prompt)||hb(gb(t.arguments).message)||``}function Hb(e){let t=hb(e.nickname);return e.role===`assistant`&&t?`AGENT (${t})`:e.role===`user`?`USER`:e.role===`tool`?`TOOL`:`AGENT`}function Ub(e,t){if(t.toLowerCase()!==`cursor`)return e;let n=[];for(let t of e){if(t.role!==`tool`){n.push({...t,parts:[...t.parts]});continue}let e=n.at(-1);if(e?.role===`assistant`){e.parts.push(...t.parts);continue}n.push({...t,parts:[...t.parts]})}return n}function Wb(e){let t=e.state||{},n=t.status,r=n===`running`||n===`error`||n===`completed`?n:`completed`,i=t.output??t.result??``,a=t.error??``,o=ub(t.input??t.arguments??{}),s=t.metadata??{};return{status:r,command:mb(o),inputValue:o,outputValue:i,errorValue:a,metadataValue:s,inputText:lb(o)}}function Gb(e,t){let n=(t.command||t.inputText||`{}`).replace(/\s+/g,` `).trim(),r=n.length>72?`${n.slice(0,72)}...`:n;return{Icon:Lr,title:Sb(e),secondaryText:r?`(${r})`:void 0,details:[],expandable:!0,showInputPreview:!0,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}function Kb(e,t,n){let r=_b(gb(t.inputValue).name);return{...n,Icon:zr,title:_b(e.tool)||`skill`,secondaryText:r||void 0,expandable:!1,showInputPreview:!1}}function qb(e,t){let n=Gb(e,t),r=(e.tool||``).toLowerCase(),i=gb(t.inputValue),a=Tb(t.inputValue);if(r===`read`)return{...n,Icon:xr,title:`read`,secondaryText:a||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Ob(t.outputValue),language:qf(a),isCode:!0}};if(r===`edit`){let e=jb(a,vb(i.old_string),vb(i.new_string));return{...n,Icon:kr,title:`edit`,secondaryText:a||void 0,showInputPreview:!1,outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}return r===`write`?{...n,Icon:Ir,title:`write`,secondaryText:a||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:zb(t),language:qf(a),isCode:!0}}:{...n,title:Sb(e)}}function Jb(e,t){let n=Gb(e,t),r=(e.tool||``).toLowerCase(),i=gb(t.inputValue);if(r===`glob`){let r=_b(i.pattern);return{...n,Icon:Ar,title:e.tool||`glob`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`grep`){let r=[_b(i.path),_b(i.pattern)].filter(Boolean).join(` · `);return{...n,Icon:Ar,title:e.tool||`grep`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`bash`){let r=_b(i.description),a=_b(i.command),o=r?`${r}${a?` (${a})`:``}`:a?`(${a})`:void 0;return{...n,Icon:Lr,title:e.tool||`bash`,secondaryText:o,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`read`){let r=Tb(t.inputValue);return{...n,Icon:xr,title:e.tool||`read`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Ob(t.outputValue),language:qf(r),isCode:!0}}}if(r===`edit`){let r=Tb(t.inputValue);return{...n,Icon:kr,title:e.tool||`edit`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Rb(t),language:`diff`,isCode:!0}}}if(r===`write`){let r=Tb(t.inputValue),i=t.status===`completed`;return{...n,Icon:Ir,title:e.tool||`write`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:zb(t),language:qf(r),isCode:i}}}return r===`skill`?Kb(e,t,n):n}function Yb(e,t){let n=Gb(e,t),r=(e.tool||``).toLowerCase(),i=gb(t.inputValue);if(r===`glob`){let r=_b(i.pattern);return{...n,Icon:Ar,title:e.title||`glob`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`grep`){let r=[_b(i.path),_b(i.pattern)].filter(Boolean).join(` · `);return{...n,Icon:Ar,title:e.title||`grep`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`shell`){let r=_b(i.command);return{...n,Icon:Lr,title:e.title||`bash`,secondaryText:r?`(${r})`:void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`readfile`){let r=Tb(t.inputValue);return{...n,Icon:xr,title:e.title||`read`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Ob(t.outputValue),language:qf(r),isCode:!0}}}if(r===`strreplacefile`){let r=Tb(t.inputValue),i=Lb(t,r);return{...n,Icon:kr,title:e.title||`edit`,secondaryText:r||void 0,showInputPreview:!1,outputContent:i.length>0?{kind:`structured-diff`,blocks:i}:{kind:`plain`,text:Rb(t),language:`diff`,isCode:!0}}}if(r===`writefile`){let r=Tb(t.inputValue);return{...n,Icon:Ir,title:e.title||`write`,secondaryText:r||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:zb(t),language:qf(r),isCode:t.status===`completed`}}}return n}function Xb(e,t){let n=Gb(e,t),r=(e.tool||``).toLowerCase();if(r===`skill`)return Kb(e,t,n);if(r===`exec_command`){let e=Pf(t.inputValue,wb(t),qf);return{...n,Icon:Lr,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(r===`write_stdin`){let e=Ff(t.inputValue,wb(t),qf);return{...n,Icon:Lr,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(r===`request_user_input`){let e=If(t.inputValue,wb(t));return{...n,Icon:Dr,title:`ask`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:e.outputContent}}if(r===`patch`){let r=af(t.inputValue),i=sf(r);return{...n,Icon:kr,title:Sb(e,`patch`),secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:uf(r,wb(t),qf)}}if(r===`subagent`){let r=Vb(e),i=wb(t);return{...n,Icon:Sr,title:Bb(e)||Sb(e,`subagent`),secondaryText:void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:r||i,language:`markdown`,isCode:!1}}}return n}function Zb(e,t){let n=Gb(e,t),r=(e.tool||``).toLowerCase(),i=gb(t.inputValue),a=Tb(t.inputValue);if(r===`read_file_v2`){let e=kb(t.outputValue);return{...n,Icon:xr,title:`read`,secondaryText:a||void 0,details:e===`No output captured.`?[{label:`Lines`,value:_b(Eb(t.outputValue).totalLinesInFile)}]:[],showInputPreview:!1,outputContent:{kind:`plain`,text:e,language:qf(a),isCode:e!==`No output captured.`}}}if(r===`edit_file_v2`){let e=bb(vb(i.streamingContent));return{...n,Icon:kr,title:`edit`,secondaryText:a||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:e||wb(t),language:e?`diff`:`text`,isCode:!!e}}}if(r===`ripgrep_raw_search`){let e=_b(i.pattern),r=[_b(i.path),e].filter(Boolean).join(` · `);return{...n,Icon:Ar,title:`grep`,secondaryText:r||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}if(r===`glob_file_search`){let e=_b(i.globPattern),r=[_b(i.targetDirectory),e].filter(Boolean).join(` · `);return{...n,Icon:Ar,title:`glob`,secondaryText:r||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Ab(t.outputValue),language:`text`,isCode:!1}}}if(r===`run_terminal_command_v2`){let e=_b(i.command),r=_b(i.commandDescription),a=r?`${r}${e?` (${e})`:``}`:e?`(${e})`:void 0;return{...n,Icon:Lr,title:`bash`,secondaryText:a,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:wb(t),language:`text`,isCode:!1}}}return{...n,title:Sb(e)}}function Qb(e,t,n){let r=e.toLowerCase();return r===`opencode`?Jb(t,n):r===`codex`?Xb(t,n):r===`kimi`?Yb(t,n):r===`claudecode`?qb(t,n):r===`cursor`?Zb(t,n):Gb(t,n)}function $b(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function ex(e){if(typeof e==`number`&&e<=0)return`Unknown time`;let t=null;if(typeof e==`number`){let n=e<10**12?e*1e3:e;t=new Date(n)}else if(typeof e==`string`&&e.trim()){let n=Number(e);t=!Number.isNaN(n)&&n>0?new Date(n<10**12?n*1e3:n):new Date(e)}return!t||Number.isNaN(t.getTime())?`Unknown time`:t.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!0})}function tx({session:e}){let t=(e.slug||``).split(`/`)[0]||Bn.getDefaultAgentKey()||`claudecode`,n=(0,S.useMemo)(()=>Ub(e.messages,t),[e.messages,t]),r=(0,S.useMemo)(()=>n.filter(e=>Xd(e)),[n]),i=(0,S.useMemo)(()=>Bf(r),[r]),[a,o]=(0,S.useState)(()=>new Set(i.filterIds)),s=(0,S.useMemo)(()=>[...i.filterIds].toSorted().join(`|`),[i.filterIds]),c=(0,S.useMemo)(()=>Wf(r,a),[r,a]);return(0,S.useEffect)(()=>{o(new Set(i.filterIds))},[s,i.filterIds]),r.length===0?(0,Z.jsx)(`div`,{className:`mx-auto max-w-4xl rounded-sm border border-[var(--console-border)] bg-white p-6 text-sm text-[var(--console-muted)]`,children:`当前会话暂无可展示的消息内容。`}):(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-8 px-2 md:px-4 animate-in fade-in slide-in-from-bottom-2 duration-300`,children:[(0,Z.jsx)(ix,{summary:typeof e.summary_files==`string`?e.summary_files:void 0}),(0,Z.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:items-start`,children:[(0,Z.jsx)(rx,{toc:i,selectedFilters:a,onToggle:e=>o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}),(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:c.length>0?c.map(({msg:e,blocks:n},r)=>(0,Z.jsx)(ax,{msg:e,blocks:n,formatTokens:$b,sessionAgentKey:t},r)):(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-6 text-sm text-[var(--console-muted)]`,children:`当前筛选条件下暂无可展示的消息内容。`})})]})]})}var nx=[{id:`user`,label:`User`},{id:`agent_message`,label:`Agent Responses`},{id:`thinking`,label:`Thinking`},{id:`plan`,label:`Plans`},{id:`tools_all`,label:`Tools`}];function rx({toc:e,selectedFilters:t,onToggle:n}){let r=t.has(`tools_all`);return(0,Z.jsx)(`aside`,{className:`lg:sticky lg:top-4`,children:(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--console-border)] px-4 py-3`,children:[(0,Z.jsx)(Mr,{className:`size-3.5 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`console-mono text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:`Session TOC`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 p-3`,children:[nx.filter(({id:t})=>e.counts[t]>0).map(({id:r,label:i})=>(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-sm px-2 py-2 transition-colors hover:bg-[var(--console-surface-muted)]`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:t.has(r),onChange:()=>n(r),className:`size-3.5 rounded border-[var(--console-border-strong)] accent-[var(--console-accent-strong)]`}),(0,Z.jsx)(`span`,{className:`console-mono min-w-0 flex-1 text-xs text-[var(--console-text)]`,children:i}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.counts[r]})]},r)),e.tools.length>0?(0,Z.jsx)(`div`,{className:`space-y-1 border-t border-[var(--console-border)] pt-2`,children:e.tools.map(e=>(0,Z.jsxs)(`label`,{className:ua(`flex items-center gap-3 rounded-sm px-2 py-2 transition-colors`,r?`cursor-pointer hover:bg-[var(--console-surface-muted)]`:`cursor-not-allowed opacity-50`),children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:r&&t.has(e.id),disabled:!r,onChange:()=>n(e.id),className:`size-3.5 rounded border-[var(--console-border-strong)] accent-[var(--console-accent-strong)]`}),(0,Z.jsx)(`span`,{className:`console-mono min-w-0 flex-1 text-xs text-[var(--console-muted)]`,children:e.label}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]},e.id))}):null]})]})})}function ix({summary:e,defaultExpanded:t=!1}){let n=typeof e==`string`?e.trim():``,[r,i]=(0,S.useState)(t);return n?(0,Z.jsxs)(`section`,{className:`rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-4 py-3 text-left`,onClick:()=>i(e=>!e),children:[(0,Z.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:[(0,Z.jsx)(jr,{className:`size-3.5 text-[var(--console-accent)]`}),`Session Summary`]}),r?(0,Z.jsx)(Tr,{className:`size-3.5 text-[var(--console-muted)]`}):(0,Z.jsx)(wr,{className:`size-3.5 text-[var(--console-muted)]`})]}),r?(0,Z.jsx)(`div`,{className:`border-t border-[var(--console-border)] px-4 py-4`,children:(0,Z.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,Z.jsx)(Kd,{text:n})})}):null]}):null}function ax({msg:e,blocks:t,formatTokens:n,sessionAgentKey:r}){let i=e.role===`user`,a=$d(e,r),o=t||Yd(e.parts),s=()=>{let e=r.toLowerCase(),t=Bn.getAgentName(e),n=Bn.agents[e]?.icon;return(0,Z.jsx)(Z.Fragment,{children:n?(0,Z.jsx)(`img`,{src:n,alt:t,className:`size-4 rounded-sm object-cover`}):(0,Z.jsx)(Sr,{className:`size-4 text-[var(--console-muted)]`})})},c=e.mode?e.mode.toUpperCase():null,l=e.model||null,u=Hb(e),d=ex(e.time_created);return(0,Z.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,Z.jsxs)(`div`,{className:`flex gap-4`,children:[(0,Z.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,Z.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:i?(0,Z.jsx)(Rr,{className:`size-4 text-[var(--console-muted)]`}):s()})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,Z.jsx)(`span`,{className:`console-mono text-sm font-bold tracking-wide text-[var(--console-text)]`,children:u}),(0,Z.jsx)(`time`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:d}),c&&(0,Z.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:c}),l&&(0,Z.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:l})]}),a?(0,Z.jsx)(ox,{}):o.map((e,t)=>e.type===`reasoning`?(0,Z.jsx)(sx,{parts:e.parts},t):e.type===`plan`?(0,Z.jsx)(lx,{parts:e.parts},t):e.type===`tool`?(0,Z.jsx)(cx,{parts:e.parts,sessionAgentKey:r},t):(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4 shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:(0,Z.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:e.parts.map((e,t)=>(0,Z.jsx)(cb,{text:qd(e.text)},t))})},t)),!i&&(e.tokens||e.cost)&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.tokens?.input?(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`INPUT `,n(e.tokens.input)]}):null,e.tokens?.output?(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`OUTPUT `,n(e.tokens.output)]}):null,e.tokens?.reasoning?(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`REASONING `,n(e.tokens.reasoning)]}):null,e.cost?(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`COST $`,e.cost.toFixed(4)]}):null]})]})]})})}function ox(){return(0,Z.jsx)(`div`,{className:`space-y-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,Z.jsx)(`div`,{className:`w-full rounded-sm border border-[var(--console-border-strong)] bg-white px-3 py-2 text-left shadow-[2px_2px_0_0_rgba(15,23,42,0.05)] md:w-[560px]`,children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(Fr,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:`abort`})})]})})})})}function sx({parts:e}){let[t,n]=(0,S.useState)(!1),r=e.map(e=>qd(e.text)).filter(Boolean).join(`
|
|
66
66
|
|
|
67
|
-
`);return(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-thinking-border)] bg-[var(--console-thinking-bg)]`,children:[(0,Z.jsxs)(`div`,{className:`flex cursor-pointer items-center justify-between bg-[var(--console-surface-muted)] px-3 py-2`,onClick:()=>n(!t),children:[(0,Z.jsxs)(`span`,{className:`console-mono flex items-center gap-2 text-xs font-medium text-[var(--console-muted)]`,children:[(0,Z.jsx)(Nr,{className:`size-3.5`}),`Thinking`]}),(0,Z.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:t?(0,Z.jsx)(Tr,{className:`w-4 h-4`}):(0,Z.jsx)(wr,{className:`w-4 h-4`})})]}),t&&(0,Z.jsx)(`div`,{className:`border-t border-dashed border-[var(--console-thinking-border)] px-4 py-3`,children:(0,Z.jsx)(`div`,{className:`console-mono whitespace-pre-wrap text-xs leading-relaxed text-[var(--console-muted)]`,children:r})})]})}function cx({parts:e,sessionAgentKey:t}){return(0,Z.jsx)(`div`,{className:`space-y-2`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.map((e,n)=>(0,Z.jsx)(dx,{tool:e,sessionAgentKey:t},n))})})}function lx({parts:e}){return(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.map((e,t)=>(0,Z.jsx)(ux,{part:e},t))})}function ux({part:e}){let[t,n]=(0,S.useState)(!1),r=ff(e),i=r.approvalStatus===`fail`?sb.error:sb.completed,a=i.icon;return(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`div`,{className:`w-full md:w-[560px] rounded-sm border border-[var(--console-border-strong)] bg-white px-3 py-2 text-left shadow-[2px_2px_0_0_rgba(15,23,42,0.05)] ${r.expandable?`transition-colors hover:bg-[var(--console-surface-muted)]`:``}`,children:r.expandable?(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>n(!t),children:[(0,Z.jsx)(Cr,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:r.title})}),(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:t?(0,Z.jsx)(Tr,{className:`size-3.5`}):(0,Z.jsx)(wr,{className:`size-3.5`})})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(Cr,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:r.title})})]})}),(0,Z.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${i.className}`,children:[(0,Z.jsx)(a,{className:`size-3`}),i.label]})]}),r.expandable&&t?(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,Z.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:r.contentLabel})}),(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,Z.jsx)(cb,{text:r.contentMarkdown})})})]}):null]})}function dx({tool:e,sessionAgentKey:t}){let[n,r]=(0,S.useState)(!1),i=Wb(e),a=Qb(t,e,i),o=sb[i.status],s=o.icon,c=a.Icon;return(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`div`,{className:`w-full md:w-[560px] rounded-sm border border-[var(--console-border-strong)] bg-white px-3 py-2 text-left shadow-[2px_2px_0_0_rgba(15,23,42,0.05)] ${a.expandable?`transition-colors hover:bg-[var(--console-surface-muted)]`:``}`,children:a.expandable?(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>r(!n),children:[(0,Z.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:a.title}),a.secondaryText?(0,Z.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:a.secondaryText}):null]}),(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:n?(0,Z.jsx)(Tr,{className:`size-3.5`}):(0,Z.jsx)(wr,{className:`size-3.5`})})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:a.title}),a.secondaryText?(0,Z.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:a.secondaryText}):null]})]})}),(0,Z.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${o.className}`,children:[(0,Z.jsx)(s,{className:`size-3 ${i.status===`running`?`animate-spin`:``}`}),o.label]})]}),a.expandable&&n?(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,Z.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Output`})}),(0,Z.jsxs)(`div`,{className:`space-y-3 p-3`,children:[a.details.length>0?(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[#fafafa] px-3 py-2`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:a.details.map(e=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,Z.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] font-semibold uppercase tracking-wide text-[var(--console-muted)] md:w-24`,children:e.label}),(0,Z.jsx)(`span`,{className:`console-mono whitespace-pre-wrap break-all text-xs leading-relaxed text-[var(--console-text)]`,children:e.value})]},`${e.label}:${e.value}`))})}):null,(0,Z.jsx)(ob,{outputContent:a.outputContent})]}),a.showInputPreview?(0,Z.jsxs)(`div`,{className:`border-t border-[var(--console-border)] bg-[#fafafa] px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:`Input Preview`}),(0,Z.jsx)(`pre`,{className:`console-mono mt-1 max-h-[200px] overflow-x-auto whitespace-pre-wrap break-all text-xs leading-relaxed text-[var(--console-muted)]`,children:i.inputText||`{}`})]}):null]}):null]})}var fx=[{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`]}];function px({className:e}){return(0,Z.jsx)(`div`,{className:`rounded-sm bg-[var(--console-border)] ${e}`})}function mx(){return(0,Z.jsxs)(`div`,{className:`mx-auto flex min-h-full w-full max-w-5xl flex-col gap-8 px-2 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-8`,children:fx.map(e=>(0,Z.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,Z.jsxs)(`div`,{className:`flex gap-4`,children:[(0,Z.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,Z.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,Z.jsx)(`div`,{className:`size-3.5 rounded-sm bg-[var(--console-border-strong)] animate-pulse`})})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(px,{className:`${e.roleWidth} h-3 animate-pulse`}),(0,Z.jsx)(px,{className:`${e.timeWidth} h-2.5 animate-pulse`})]}),(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4 shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,Z.jsx)(px,{className:`${t} h-3 animate-pulse`},`${e.id}-${t}`))})})]})]})},e.id))}),(0,Z.jsx)(`div`,{className:`min-h-24 flex-1 rounded-sm border border-[var(--console-border)] bg-white/60 animate-pulse`})]})}function hx(e){return e.toLocaleString(`en-US`)}function gx(e){return e.total_tokens??e.total_input_tokens+e.total_output_tokens}function _x(e){if(!e)return`unknown`;let t=Date.now()-e;if(Number.isNaN(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function vx({label:e,value:t,hint:n}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:e}),(0,Z.jsx)(`p`,{className:`console-mono mt-2 text-xl font-semibold text-[var(--console-text)]`,children:t}),n?(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-[var(--console-muted)]`,children:n}):null]})}function yx({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:e}),(0,Z.jsx)(`p`,{className:`console-mono mt-2 break-all text-sm leading-6 text-[var(--console-text)]`,children:t})]})}function bx({code:e,title:t,description:n,aside:r,iconSrc:i,iconAlt:a}){return(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border-strong)] bg-white p-5 md:p-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5 md:flex-row md:items-start md:justify-between`,children:[(0,Z.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Z.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] font-semibold uppercase tracking-[0.16em] text-[var(--console-muted)]`,children:e}),(0,Z.jsxs)(`div`,{className:`mt-4 flex items-start gap-3`,children:[i?(0,Z.jsx)(`img`,{src:i,alt:a||``,className:`mt-1 size-8 shrink-0 object-contain`}):null,(0,Z.jsx)(`h2`,{className:`console-mono text-2xl leading-tight font-semibold tracking-tight text-[var(--console-text)] md:text-[2rem]`,children:t})]}),(0,Z.jsx)(`p`,{className:`mt-3 max-w-[42rem] text-sm leading-7 text-[var(--console-muted)]`,children:n})]}),(0,Z.jsxs)(`div`,{className:`min-w-0 rounded-sm border border-dashed border-[var(--console-border)] bg-[var(--console-surface-muted)] px-4 py-3 md:max-w-xs`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-[0.16em] text-[var(--console-muted)]`,children:`STATUS NOTE`}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--console-text)]`,children:r})]})]})})}function xx({agentItems:e}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`console-mono text-xs font-bold uppercase text-[var(--console-text)]`,children:`Known Agents`}),(0,Z.jsxs)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:[e.length,` items`]})]}),(0,Z.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.key}`,className:`flex min-h-11 items-center gap-2 rounded-sm border border-transparent px-3 py-2 transition-colors duration-200 hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--console-accent)]`,children:[(0,Z.jsx)(`img`,{src:e.icon,alt:e.name,className:`size-4 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]})}function Sx({sessions:e}){return e.length===0?(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4 text-sm text-[var(--console-muted)]`,children:`No sessions yet`}):(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h3`,{className:`console-mono text-xs font-bold uppercase text-[var(--console-text)]`,children:`Recent Sessions`}),(0,Z.jsxs)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:[e.length,` items`]})]}),(0,Z.jsx)(`ul`,{className:`space-y-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.fullPath}`,className:`block rounded-sm border border-transparent px-2 py-1.5 transition-colors hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,Z.jsx)(`p`,{className:`line-clamp-1 text-sm text-[var(--console-text)]`,children:e.title}),(0,Z.jsxs)(`p`,{className:`console-mono mt-0.5 text-[11px] text-[var(--console-muted)]`,children:[`/`,e.fullPath,` ·`,` `,_x(e.time_updated||e.time_created)]})]})},e.id))})]})}function Cx({type:e,sessions:t,agentItems:n,activeAgentKey:r,attemptedAgentKey:i,attemptedSessionSlug:a}){let o=t.toSorted((e,t)=>(t.time_updated||t.time_created||0)-(e.time_updated||e.time_created||0)),s=o.slice(0,5),c=t.reduce((e,t)=>e+t.stats.message_count,0),l=t.reduce((e,t)=>e+gx(t.stats),0),u=o[0]?.time_updated||o[0]?.time_created;if(e===`missing-agent`){let e=`/${i||`unknown`}${a?`/${a}`:``}`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(bx,{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,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(yx,{label:`Requested Agent`,value:i||`unknown`}),(0,Z.jsx)(yx,{label:`Requested Path`,value:e}),a?(0,Z.jsx)(yx,{label:`Requested Session`,value:a}):null]}),(0,Z.jsx)(xx,{agentItems:n})]})}if(e===`missing-session`){let e=r||Bn.getDefaultAgentKey()||`claudecode`,t=Bn.agents[e],n=t?.name||e,i=t?.icon,o=a||`unknown-session`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(bx,{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 slug 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:i,iconAlt:n}),(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:`Agent`}),(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[i?(0,Z.jsx)(`img`,{src:i,alt:n,className:`size-4 shrink-0 object-contain`}):null,(0,Z.jsx)(`p`,{className:`console-mono break-all text-sm leading-6 text-[var(--console-text)]`,children:n})]})]}),(0,Z.jsx)(yx,{label:`Session`,value:o})]}),(0,Z.jsx)(Sx,{sessions:s})]})}if(e===`global`)return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(vx,{label:`Total Sessions`,value:hx(t.length)}),(0,Z.jsx)(vx,{label:`Total Messages`,value:hx(c)}),(0,Z.jsx)(vx,{label:`Latest Activity`,value:_x(u),hint:u?new Date(u).toLocaleString(`zh-CN`):void 0})]}),(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`Agents`}),(0,Z.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2`,children:n.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.key}`,className:`flex items-center gap-2 rounded-sm border border-transparent px-2 py-1.5 transition-colors hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,Z.jsx)(`img`,{src:e.icon,alt:e.name,className:`size-4 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]}),(0,Z.jsx)(Sx,{sessions:s})]});let d=r?Bn.agents[r]:null,f=d?d.name:`Unknown Agent`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[d?(0,Z.jsx)(`img`,{src:d.icon,alt:f,className:`size-6 object-contain`}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono text-sm font-semibold text-[var(--console-text)]`,children:f}),(0,Z.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Select a session from the left to view details`})]})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(vx,{label:`Sessions`,value:hx(t.length)}),(0,Z.jsx)(vx,{label:`Messages`,value:hx(c)}),(0,Z.jsx)(vx,{label:`Tokens`,value:hx(l)})]}),(0,Z.jsx)(Sx,{sessions:s})]})}var wx=class extends S.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught error:`,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6`,children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-error)]`,children:`Something went wrong`}),(0,Z.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:this.state.error?.message||`Unknown error`})]}):this.props.children}};function Tx(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?n.split(`/`).map(e=>e.trim()).filter(Boolean):[];if(r.length===0)return{mode:`root`,activeAgentKey:null,activeSessionSlug:null};if(r.length===1){let e=r[0].toLowerCase();return t.has(e)?{mode:`agent`,activeAgentKey:e,activeSessionSlug:null}:{mode:`missingAgent`,activeAgentKey:null,activeSessionSlug:null,attemptedKey:e}}if(r.length===2){let e=r[0].toLowerCase(),n=r[1];return t.has(e)&&n?{mode:`session`,activeAgentKey:e,activeSessionSlug:n}:t.has(e)?{mode:`missingSession`,activeAgentKey:e,activeSessionSlug:n,attemptedSessionSlug:n}:{mode:`missingAgent`,activeAgentKey:null,activeSessionSlug:null,attemptedKey:e}}return{mode:`invalidRoute`,activeAgentKey:null,activeSessionSlug:null}}function Ex(e){if(!e)return`unknown`;let t=Date.now()-e;if(Number.isNaN(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Dx(){let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(!0),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(null);(0,S.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let[e,n]=await Promise.all([Vn(),Hn()]);t(e),r(n.sessions)}catch(e){console.error(`Failed to load data:`,e),s(`Failed to load data. Is the CLI server running?`)}finally{a(!1)}})(),()=>e.abort()},[]);let m=it(),h=(0,S.useMemo)(()=>new Set(e.map(e=>e.name.toLowerCase())),[e]),g=(0,S.useMemo)(()=>Tx(m.pathname,h),[m.pathname,h]),_=(0,S.useMemo)(()=>{let t={};for(let n of e)t[n.name]=[];for(let e of n){let n=e.slug.split(`/`)[0]?.toLowerCase();n&&t[n]&&t[n].push(e)}for(let e of Object.keys(t))t[e].sort((e,t)=>(t.time_updated??t.time_created)-(e.time_updated??e.time_created));return t},[n,e]),v=g.activeAgentKey,y=(0,S.useMemo)(()=>v?_[v]??[]:[],[v,_]),b=(0,S.useMemo)(()=>{let e=new Map;for(let t of y){let n=t.directory??``,r=n?n.replace(/\/+$/,``).split(`/`).at(-1)??n:`(unknown)`,i=r===`(unknown)`?`__unknown__`:r;e.has(i)||e.set(i,{key:i,label:r,sessions:[]}),e.get(i).sessions.push(t)}return[...e.values()].sort((e,t)=>{if(e.key===`__unknown__`)return 1;if(t.key===`__unknown__`)return-1;let n=Math.max(...e.sessions.map(e=>e.time_updated??e.time_created));return Math.max(...t.sessions.map(e=>e.time_updated??e.time_created))-n})},[y]),[x,C]=(0,S.useState)(new Set);(0,S.useEffect)(()=>{C(new Set)},[v]);function w(e){C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}(0,S.useEffect)(()=>{if(g.mode!==`session`){l(null),p(null);return}let e=new AbortController;return d(!0),p(null),(async()=>{try{l(await Un(g.activeAgentKey,g.activeSessionSlug))}catch{p(`Session not found`),l(null)}finally{d(!1)}})(),()=>e.abort()},[g.mode===`session`?`${g.activeAgentKey}/${g.activeSessionSlug}`:``,g.activeAgentKey,g.activeSessionSlug,g.mode]);let T=(0,S.useMemo)(()=>n.map(e=>{let t=e.slug.split(`/`)[0]?.toLowerCase()||`unknown`;return{...e,agentKey:t,sessionSlug:e.id,fullPath:e.slug}}),[n]),E=(0,S.useMemo)(()=>e.filter(e=>e.count>0).map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,count:e.count})),[e]),D=`CodeSesh`,O=`Select an agent to browse sessions`;if(g.mode===`agent`&&v&&(D=e.find(e=>e.name.toLowerCase()===v)?.displayName??v,O=`${y.length} sessions`),g.mode===`session`){if(f)D=`Session Not Found`,O=`Requested /${v}/${g.activeSessionSlug}`;else if(c){D=c.title||`Conversation`;let e=c.time_updated??c.time_created;O=`ID: #${c.id.slice(0,8)} · Updated ${Ex(e)}`}}g.mode===`missingAgent`&&(D=`Agent Not Found`,O=`Requested /${g.attemptedKey}`),g.mode===`missingSession`&&(D=`Session Not Found`,O=`Session not found in /${v}`);let ee;return ee=i?(0,Z.jsx)(mx,{}):o?(0,Z.jsx)(`div`,{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:o}):g.mode===`root`?(0,Z.jsx)(Cx,{type:`global`,sessions:T,agentItems:E}):g.mode===`agent`&&v?(0,Z.jsx)(Cx,{type:`agent`,sessions:T.filter(e=>e.agentKey===v),agentItems:E,activeAgentKey:v}):g.mode===`session`?u?(0,Z.jsx)(mx,{}):f||!c?(0,Z.jsx)(Cx,{type:`missing-session`,sessions:T.filter(e=>e.agentKey===g.activeAgentKey),agentItems:E,activeAgentKey:g.activeAgentKey,attemptedSessionSlug:g.activeSessionSlug}):(0,Z.jsx)(tx,{session:c}):g.mode===`missingAgent`?(0,Z.jsx)(Cx,{type:`missing-agent`,sessions:T,agentItems:E,attemptedAgentKey:g.attemptedKey}):(0,Z.jsx)(`div`,{className:`text-sm text-[var(--console-muted)]`,children:`Invalid route.`}),(0,Z.jsxs)(`div`,{className:`console-ui h-screen overflow-hidden bg-[var(--console-bg)] text-[var(--console-text)]`,children:[(0,Z.jsx)(`header`,{className:`h-14 shrink-0 border-b border-[var(--console-border)] bg-white/85 backdrop-blur-sm`,children:(0,Z.jsxs)(`div`,{className:`flex h-full items-center justify-between px-4`,children:[(0,Z.jsxs)(xn,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,Z.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,Z.jsx)(`span`,{className:`console-mono text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]}),(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)]`,children:[`v`,`0.1.3`]})]})}),(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-56px)] min-h-0`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] lg:flex`,children:(0,Z.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`AGENT`}),(0,Z.jsxs)(`ul`,{className:`space-y-1`,children:[e.map(e=>{let t=e.name.toLowerCase(),n=t===v,r=Bn.agents[t];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${t}`,className:`flex items-center gap-2 rounded-sm border px-3 py-1.5 text-left transition-colors ${n?`border-[var(--console-border-strong)] bg-white text-[var(--console-text)]`:`border-transparent text-[var(--console-muted)] hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`}`,children:[r?.icon&&(0,Z.jsx)(`img`,{src:r.icon,alt:e.displayName,className:`size-3.5 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:e.displayName}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.name)}),e.length===0&&!i&&(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No agents found`})})]})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`SESSIONS`}),v?y.length===0?(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No sessions yet`}):(0,Z.jsx)(`div`,{className:`space-y-2`,children:b.map(e=>{let t=x.has(e.key);return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{onClick:()=>w(e.key),className:`console-mono flex w-full items-center gap-1.5 rounded-sm px-2 py-1 text-left text-xs text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)]`,title:e.key===`__unknown__`?void 0:e.key,children:[(0,Z.jsx)(`span`,{className:`shrink-0 text-[10px]`,children:t?`▼`:`▶`}),(0,Z.jsx)(`span`,{className:`line-clamp-1 font-semibold`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px]`,children:e.sessions.length})]}),t&&(0,Z.jsx)(`ul`,{className:`mt-0.5 space-y-0.5 pl-3`,children:e.sessions.map(e=>{let t=g.mode===`session`&&g.activeSessionSlug===e.id;return(0,Z.jsx)(`li`,{children:(0,Z.jsx)(xn,{to:`/${v}/${e.id}`,className:`console-mono relative block rounded-sm border px-2 py-1.5 text-xs transition-colors ${t?`border-[var(--console-border-strong)] bg-white text-[var(--console-text)] before:absolute before:bottom-0 before:left-0 before:top-0 before:w-0.5 before:bg-[var(--console-accent)]`:`border-transparent text-[var(--console-muted)] hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`}`,title:e.title,children:(0,Z.jsx)(`span`,{className:`line-clamp-1`,children:e.title})})},e.id)})})]},e.key)})}):(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`Select an agent`})]})]})}),(0,Z.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`section`,{className:`shrink-0 border-b border-[var(--console-border)] bg-white/70 px-4 py-4 backdrop-blur-sm md:px-8`,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] font-bold uppercase text-[var(--console-muted)]`,children:g.mode===`session`?`Session`:`Landing`}),(0,Z.jsx)(`h1`,{className:`console-mono text-xl font-semibold tracking-tight text-[var(--console-text)]`,children:D})]}),(0,Z.jsx)(`p`,{className:`console-mono mt-1 text-xs text-[var(--console-muted)]`,children:O})]})}),(0,Z.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,Z.jsx)(wx,{children:ee})})]})]})]})}zn.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(S.StrictMode,{children:(0,Z.jsx)(vn,{children:(0,Z.jsx)(Dx,{})})}));
|
|
67
|
+
`);return(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-thinking-border)] bg-[var(--console-thinking-bg)]`,children:[(0,Z.jsxs)(`div`,{className:`flex cursor-pointer items-center justify-between bg-[var(--console-surface-muted)] px-3 py-2`,onClick:()=>n(!t),children:[(0,Z.jsxs)(`span`,{className:`console-mono flex items-center gap-2 text-xs font-medium text-[var(--console-muted)]`,children:[(0,Z.jsx)(Nr,{className:`size-3.5`}),`Thinking`]}),(0,Z.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:t?(0,Z.jsx)(Tr,{className:`w-4 h-4`}):(0,Z.jsx)(wr,{className:`w-4 h-4`})})]}),t&&(0,Z.jsx)(`div`,{className:`border-t border-dashed border-[var(--console-thinking-border)] px-4 py-3`,children:(0,Z.jsx)(`div`,{className:`console-mono whitespace-pre-wrap text-xs leading-relaxed text-[var(--console-muted)]`,children:r})})]})}function cx({parts:e,sessionAgentKey:t}){return(0,Z.jsx)(`div`,{className:`space-y-2`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.map((e,n)=>(0,Z.jsx)(dx,{tool:e,sessionAgentKey:t},n))})})}function lx({parts:e}){return(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.map((e,t)=>(0,Z.jsx)(ux,{part:e},t))})}function ux({part:e}){let[t,n]=(0,S.useState)(!1),r=ff(e),i=r.approvalStatus===`fail`?sb.error:sb.completed,a=i.icon;return(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`div`,{className:`w-full md:w-[560px] rounded-sm border border-[var(--console-border-strong)] bg-white px-3 py-2 text-left shadow-[2px_2px_0_0_rgba(15,23,42,0.05)] ${r.expandable?`transition-colors hover:bg-[var(--console-surface-muted)]`:``}`,children:r.expandable?(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>n(!t),children:[(0,Z.jsx)(Cr,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:r.title})}),(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:t?(0,Z.jsx)(Tr,{className:`size-3.5`}):(0,Z.jsx)(wr,{className:`size-3.5`})})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(Cr,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:r.title})})]})}),(0,Z.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${i.className}`,children:[(0,Z.jsx)(a,{className:`size-3`}),i.label]})]}),r.expandable&&t?(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,Z.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:r.contentLabel})}),(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,Z.jsx)(cb,{text:r.contentMarkdown})})})]}):null]})}function dx({tool:e,sessionAgentKey:t}){let[n,r]=(0,S.useState)(!1),i=Wb(e),a=Qb(t,e,i),o=sb[i.status],s=o.icon,c=a.Icon;return(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`div`,{className:`w-full md:w-[560px] rounded-sm border border-[var(--console-border-strong)] bg-white px-3 py-2 text-left shadow-[2px_2px_0_0_rgba(15,23,42,0.05)] ${a.expandable?`transition-colors hover:bg-[var(--console-surface-muted)]`:``}`,children:a.expandable?(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>r(!n),children:[(0,Z.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:a.title}),a.secondaryText?(0,Z.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:a.secondaryText}):null]}),(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:n?(0,Z.jsx)(Tr,{className:`size-3.5`}):(0,Z.jsx)(wr,{className:`size-3.5`})})]}):(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:a.title}),a.secondaryText?(0,Z.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:a.secondaryText}):null]})]})}),(0,Z.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${o.className}`,children:[(0,Z.jsx)(s,{className:`size-3 ${i.status===`running`?`animate-spin`:``}`}),o.label]})]}),a.expandable&&n?(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:[(0,Z.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,Z.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Output`})}),(0,Z.jsxs)(`div`,{className:`space-y-3 p-3`,children:[a.details.length>0?(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[#fafafa] px-3 py-2`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:a.details.map(e=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,Z.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] font-semibold uppercase tracking-wide text-[var(--console-muted)] md:w-24`,children:e.label}),(0,Z.jsx)(`span`,{className:`console-mono whitespace-pre-wrap break-all text-xs leading-relaxed text-[var(--console-text)]`,children:e.value})]},`${e.label}:${e.value}`))})}):null,(0,Z.jsx)(ob,{outputContent:a.outputContent})]}),a.showInputPreview?(0,Z.jsxs)(`div`,{className:`border-t border-[var(--console-border)] bg-[#fafafa] px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:`Input Preview`}),(0,Z.jsx)(`pre`,{className:`console-mono mt-1 max-h-[200px] overflow-x-auto whitespace-pre-wrap break-all text-xs leading-relaxed text-[var(--console-muted)]`,children:i.inputText||`{}`})]}):null]}):null]})}var fx=[{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`]}];function px({className:e}){return(0,Z.jsx)(`div`,{className:`rounded-sm bg-[var(--console-border)] ${e}`})}function mx(){return(0,Z.jsxs)(`div`,{className:`mx-auto flex min-h-full w-full max-w-5xl flex-col gap-8 px-2 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-8`,children:fx.map(e=>(0,Z.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,Z.jsxs)(`div`,{className:`flex gap-4`,children:[(0,Z.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,Z.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,Z.jsx)(`div`,{className:`size-3.5 rounded-sm bg-[var(--console-border-strong)] animate-pulse`})})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(px,{className:`${e.roleWidth} h-3 animate-pulse`}),(0,Z.jsx)(px,{className:`${e.timeWidth} h-2.5 animate-pulse`})]}),(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4 shadow-[0_1px_2px_rgba(15,23,42,0.04)]`,children:(0,Z.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,Z.jsx)(px,{className:`${t} h-3 animate-pulse`},`${e.id}-${t}`))})})]})]})},e.id))}),(0,Z.jsx)(`div`,{className:`min-h-24 flex-1 rounded-sm border border-[var(--console-border)] bg-white/60 animate-pulse`})]})}function hx(e){return e.toLocaleString(`en-US`)}function gx(e){return e.total_tokens??e.total_input_tokens+e.total_output_tokens}function _x(e){if(!e)return`unknown`;let t=Date.now()-e;if(Number.isNaN(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function vx({label:e,value:t,hint:n}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:e}),(0,Z.jsx)(`p`,{className:`console-mono mt-2 text-xl font-semibold text-[var(--console-text)]`,children:t}),n?(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-[var(--console-muted)]`,children:n}):null]})}function yx({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:e}),(0,Z.jsx)(`p`,{className:`console-mono mt-2 break-all text-sm leading-6 text-[var(--console-text)]`,children:t})]})}function bx({code:e,title:t,description:n,aside:r,iconSrc:i,iconAlt:a}){return(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border-strong)] bg-white p-5 md:p-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5 md:flex-row md:items-start md:justify-between`,children:[(0,Z.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Z.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] font-semibold uppercase tracking-[0.16em] text-[var(--console-muted)]`,children:e}),(0,Z.jsxs)(`div`,{className:`mt-4 flex items-start gap-3`,children:[i?(0,Z.jsx)(`img`,{src:i,alt:a||``,className:`mt-1 size-8 shrink-0 object-contain`}):null,(0,Z.jsx)(`h2`,{className:`console-mono text-2xl leading-tight font-semibold tracking-tight text-[var(--console-text)] md:text-[2rem]`,children:t})]}),(0,Z.jsx)(`p`,{className:`mt-3 max-w-[42rem] text-sm leading-7 text-[var(--console-muted)]`,children:n})]}),(0,Z.jsxs)(`div`,{className:`min-w-0 rounded-sm border border-dashed border-[var(--console-border)] bg-[var(--console-surface-muted)] px-4 py-3 md:max-w-xs`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-[0.16em] text-[var(--console-muted)]`,children:`STATUS NOTE`}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--console-text)]`,children:r})]})]})})}function xx({agentItems:e}){return(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`console-mono text-xs font-bold uppercase text-[var(--console-text)]`,children:`Known Agents`}),(0,Z.jsxs)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:[e.length,` items`]})]}),(0,Z.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.key}`,className:`flex min-h-11 items-center gap-2 rounded-sm border border-transparent px-3 py-2 transition-colors duration-200 hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--console-accent)]`,children:[(0,Z.jsx)(`img`,{src:e.icon,alt:e.name,className:`size-4 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]})}function Sx({sessions:e}){return e.length===0?(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4 text-sm text-[var(--console-muted)]`,children:`No sessions yet`}):(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h3`,{className:`console-mono text-xs font-bold uppercase text-[var(--console-text)]`,children:`Recent Sessions`}),(0,Z.jsxs)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:[e.length,` items`]})]}),(0,Z.jsx)(`ul`,{className:`space-y-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.fullPath}`,className:`block rounded-sm border border-transparent px-2 py-1.5 transition-colors hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,Z.jsx)(`p`,{className:`line-clamp-1 text-sm text-[var(--console-text)]`,children:e.title}),(0,Z.jsxs)(`p`,{className:`console-mono mt-0.5 text-[11px] text-[var(--console-muted)]`,children:[`/`,e.fullPath,` ·`,` `,_x(e.time_updated||e.time_created)]})]})},e.id))})]})}function Cx({type:e,sessions:t,agentItems:n,activeAgentKey:r,attemptedAgentKey:i,attemptedSessionSlug:a}){let o=t.toSorted((e,t)=>(t.time_updated||t.time_created||0)-(e.time_updated||e.time_created||0)),s=o.slice(0,5),c=t.reduce((e,t)=>e+t.stats.message_count,0),l=t.reduce((e,t)=>e+gx(t.stats),0),u=o[0]?.time_updated||o[0]?.time_created;if(e===`missing-agent`){let e=`/${i||`unknown`}${a?`/${a}`:``}`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(bx,{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,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(yx,{label:`Requested Agent`,value:i||`unknown`}),(0,Z.jsx)(yx,{label:`Requested Path`,value:e}),a?(0,Z.jsx)(yx,{label:`Requested Session`,value:a}):null]}),(0,Z.jsx)(xx,{agentItems:n})]})}if(e===`missing-session`){let e=r||Bn.getDefaultAgentKey()||`claudecode`,t=Bn.agents[e],n=t?.name||e,i=t?.icon,o=a||`unknown-session`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(bx,{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 slug 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:i,iconAlt:n}),(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3`,children:[(0,Z.jsx)(`p`,{className:`console-mono text-[11px] uppercase tracking-wider text-[var(--console-muted)]`,children:`Agent`}),(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[i?(0,Z.jsx)(`img`,{src:i,alt:n,className:`size-4 shrink-0 object-contain`}):null,(0,Z.jsx)(`p`,{className:`console-mono break-all text-sm leading-6 text-[var(--console-text)]`,children:n})]})]}),(0,Z.jsx)(yx,{label:`Session`,value:o})]}),(0,Z.jsx)(Sx,{sessions:s})]})}if(e===`global`)return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(vx,{label:`Total Sessions`,value:hx(t.length)}),(0,Z.jsx)(vx,{label:`Total Messages`,value:hx(c)}),(0,Z.jsx)(vx,{label:`Latest Activity`,value:_x(u),hint:u?new Date(u).toLocaleString(`zh-CN`):void 0})]}),(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`Agents`}),(0,Z.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2`,children:n.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${e.key}`,className:`flex items-center gap-2 rounded-sm border border-transparent px-2 py-1.5 transition-colors hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`,children:[(0,Z.jsx)(`img`,{src:e.icon,alt:e.name,className:`size-4 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono flex-1 text-xs text-[var(--console-text)]`,children:e.name}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.key))})]}),(0,Z.jsx)(Sx,{sessions:s})]});let d=r?Bn.agents[r]:null,f=d?d.name:`Unknown Agent`;return(0,Z.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-4`,children:[(0,Z.jsx)(`div`,{className:`rounded-sm border border-[var(--console-border)] bg-white p-4`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[d?(0,Z.jsx)(`img`,{src:d.icon,alt:f,className:`size-6 object-contain`}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono text-sm font-semibold text-[var(--console-text)]`,children:f}),(0,Z.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:`Select a session from the left to view details`})]})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,Z.jsx)(vx,{label:`Sessions`,value:hx(t.length)}),(0,Z.jsx)(vx,{label:`Messages`,value:hx(c)}),(0,Z.jsx)(vx,{label:`Tokens`,value:hx(l)})]}),(0,Z.jsx)(Sx,{sessions:s})]})}var wx=class extends S.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught error:`,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,Z.jsxs)(`div`,{className:`rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6`,children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-error)]`,children:`Something went wrong`}),(0,Z.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:this.state.error?.message||`Unknown error`})]}):this.props.children}};function Tx(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?n.split(`/`).map(e=>e.trim()).filter(Boolean):[];if(r.length===0)return{mode:`root`,activeAgentKey:null,activeSessionSlug:null};if(r.length===1){let e=r[0].toLowerCase();return t.has(e)?{mode:`agent`,activeAgentKey:e,activeSessionSlug:null}:{mode:`missingAgent`,activeAgentKey:null,activeSessionSlug:null,attemptedKey:e}}if(r.length===2){let e=r[0].toLowerCase(),n=r[1];return t.has(e)&&n?{mode:`session`,activeAgentKey:e,activeSessionSlug:n}:t.has(e)?{mode:`missingSession`,activeAgentKey:e,activeSessionSlug:n,attemptedSessionSlug:n}:{mode:`missingAgent`,activeAgentKey:null,activeSessionSlug:null,attemptedKey:e}}return{mode:`invalidRoute`,activeAgentKey:null,activeSessionSlug:null}}function Ex(e){if(!e)return`unknown`;let t=Date.now()-e;if(Number.isNaN(t)||t<0)return`just now`;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Dx(){let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(!0),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(null);(0,S.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let[e,n]=await Promise.all([Vn(),Hn()]);t(e),r(n.sessions)}catch(e){console.error(`Failed to load data:`,e),s(`Failed to load data. Is the CLI server running?`)}finally{a(!1)}})(),()=>e.abort()},[]);let m=it(),h=(0,S.useMemo)(()=>new Set(e.map(e=>e.name.toLowerCase())),[e]),g=(0,S.useMemo)(()=>Tx(m.pathname,h),[m.pathname,h]),_=(0,S.useMemo)(()=>{let t={};for(let n of e)t[n.name]=[];for(let e of n){let n=e.slug.split(`/`)[0]?.toLowerCase();n&&t[n]&&t[n].push(e)}for(let e of Object.keys(t))t[e].sort((e,t)=>(t.time_updated??t.time_created)-(e.time_updated??e.time_created));return t},[n,e]),v=g.activeAgentKey,y=(0,S.useMemo)(()=>v?_[v]??[]:[],[v,_]),b=(0,S.useMemo)(()=>{let e=new Map;for(let t of y){let n=t.directory??``,r=n?n.replace(/\/+$/,``).split(`/`).at(-1)??n:`(unknown)`,i=r===`(unknown)`?`__unknown__`:r;e.has(i)||e.set(i,{key:i,label:r,sessions:[]}),e.get(i).sessions.push(t)}return[...e.values()].sort((e,t)=>{if(e.key===`__unknown__`)return 1;if(t.key===`__unknown__`)return-1;let n=Math.max(...e.sessions.map(e=>e.time_updated??e.time_created));return Math.max(...t.sessions.map(e=>e.time_updated??e.time_created))-n})},[y]),[x,C]=(0,S.useState)(new Set);(0,S.useEffect)(()=>{C(new Set)},[v]);function w(e){C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}(0,S.useEffect)(()=>{if(g.mode!==`session`){l(null),p(null);return}let e=new AbortController;return d(!0),p(null),(async()=>{try{l(await Un(g.activeAgentKey,g.activeSessionSlug))}catch{p(`Session not found`),l(null)}finally{d(!1)}})(),()=>e.abort()},[g.mode===`session`?`${g.activeAgentKey}/${g.activeSessionSlug}`:``,g.activeAgentKey,g.activeSessionSlug,g.mode]);let T=(0,S.useMemo)(()=>n.map(e=>{let t=e.slug.split(`/`)[0]?.toLowerCase()||`unknown`;return{...e,agentKey:t,sessionSlug:e.id,fullPath:e.slug}}),[n]),E=(0,S.useMemo)(()=>e.filter(e=>e.count>0).map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,count:e.count})),[e]),D=`CodeSesh`,O=`Select an agent to browse sessions`;if(g.mode===`agent`&&v&&(D=e.find(e=>e.name.toLowerCase()===v)?.displayName??v,O=`${y.length} sessions`),g.mode===`session`){if(f)D=`Session Not Found`,O=`Requested /${v}/${g.activeSessionSlug}`;else if(c){D=c.title||`Conversation`;let e=c.time_updated??c.time_created;O=`ID: #${c.id.slice(0,8)} · Updated ${Ex(e)}`}}g.mode===`missingAgent`&&(D=`Agent Not Found`,O=`Requested /${g.attemptedKey}`),g.mode===`missingSession`&&(D=`Session Not Found`,O=`Session not found in /${v}`);let ee;return ee=i?(0,Z.jsx)(mx,{}):o?(0,Z.jsx)(`div`,{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:o}):g.mode===`root`?(0,Z.jsx)(Cx,{type:`global`,sessions:T,agentItems:E}):g.mode===`agent`&&v?(0,Z.jsx)(Cx,{type:`agent`,sessions:T.filter(e=>e.agentKey===v),agentItems:E,activeAgentKey:v}):g.mode===`session`?u?(0,Z.jsx)(mx,{}):f||!c?(0,Z.jsx)(Cx,{type:`missing-session`,sessions:T.filter(e=>e.agentKey===g.activeAgentKey),agentItems:E,activeAgentKey:g.activeAgentKey,attemptedSessionSlug:g.activeSessionSlug}):(0,Z.jsx)(tx,{session:c}):g.mode===`missingAgent`?(0,Z.jsx)(Cx,{type:`missing-agent`,sessions:T,agentItems:E,attemptedAgentKey:g.attemptedKey}):(0,Z.jsx)(`div`,{className:`text-sm text-[var(--console-muted)]`,children:`Invalid route.`}),(0,Z.jsxs)(`div`,{className:`console-ui h-screen overflow-hidden bg-[var(--console-bg)] text-[var(--console-text)]`,children:[(0,Z.jsx)(`header`,{className:`h-14 shrink-0 border-b border-[var(--console-border)] bg-white/85 backdrop-blur-sm`,children:(0,Z.jsxs)(`div`,{className:`flex h-full items-center justify-between px-4`,children:[(0,Z.jsxs)(xn,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,Z.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,Z.jsx)(`span`,{className:`console-mono text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]}),(0,Z.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)]`,children:[`v`,`0.1.4`]})]})}),(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-56px)] min-h-0`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] lg:flex`,children:(0,Z.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`AGENT`}),(0,Z.jsxs)(`ul`,{className:`space-y-1`,children:[e.map(e=>{let t=e.name.toLowerCase(),n=t===v,r=Bn.agents[t];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(xn,{to:`/${t}`,className:`flex items-center gap-2 rounded-sm border px-3 py-1.5 text-left transition-colors ${n?`border-[var(--console-border-strong)] bg-white text-[var(--console-text)]`:`border-transparent text-[var(--console-muted)] hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`}`,children:[r?.icon&&(0,Z.jsx)(`img`,{src:r.icon,alt:e.displayName,className:`size-3.5 object-contain`}),(0,Z.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:e.displayName}),(0,Z.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:e.count})]})},e.name)}),e.length===0&&!i&&(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No agents found`})})]})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`console-mono mb-3 text-xs font-bold uppercase text-[var(--console-text)]`,children:`SESSIONS`}),v?y.length===0?(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`No sessions yet`}):(0,Z.jsx)(`div`,{className:`space-y-2`,children:b.map(e=>{let t=x.has(e.key);return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{onClick:()=>w(e.key),className:`console-mono flex w-full items-center gap-1.5 rounded-sm px-2 py-1 text-left text-xs text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)]`,title:e.key===`__unknown__`?void 0:e.key,children:[(0,Z.jsx)(`span`,{className:`shrink-0 text-[10px]`,children:t?`▼`:`▶`}),(0,Z.jsx)(`span`,{className:`line-clamp-1 font-semibold`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px]`,children:e.sessions.length})]}),t&&(0,Z.jsx)(`ul`,{className:`mt-0.5 space-y-0.5 pl-3`,children:e.sessions.map(e=>{let t=g.mode===`session`&&g.activeSessionSlug===e.id;return(0,Z.jsx)(`li`,{children:(0,Z.jsx)(xn,{to:`/${v}/${e.id}`,className:`console-mono relative block rounded-sm border px-2 py-1.5 text-xs transition-colors ${t?`border-[var(--console-border-strong)] bg-white text-[var(--console-text)] before:absolute before:bottom-0 before:left-0 before:top-0 before:w-0.5 before:bg-[var(--console-accent)]`:`border-transparent text-[var(--console-muted)] hover:border-[var(--console-border)] hover:bg-[var(--console-surface-muted)]`}`,title:e.title,children:(0,Z.jsx)(`span`,{className:`line-clamp-1`,children:e.title})})},e.id)})})]},e.key)})}):(0,Z.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:`Select an agent`})]})]})}),(0,Z.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`section`,{className:`shrink-0 border-b border-[var(--console-border)] bg-white/70 px-4 py-4 backdrop-blur-sm md:px-8`,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] font-bold uppercase text-[var(--console-muted)]`,children:g.mode===`session`?`Session`:`Landing`}),(0,Z.jsx)(`h1`,{className:`console-mono text-xl font-semibold tracking-tight text-[var(--console-text)]`,children:D})]}),(0,Z.jsx)(`p`,{className:`console-mono mt-1 text-xs text-[var(--console-muted)]`,children:O})]})}),(0,Z.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,Z.jsx)(wx,{children:ee})})]})]})]})}zn.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(S.StrictMode,{children:(0,Z.jsx)(vn,{children:(0,Z.jsx)(Dx,{})})}));
|
package/dist/web/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
/>
|
|
10
10
|
<link rel="icon" type="image/svg+xml" href="/logo.svg?v=3" />
|
|
11
11
|
<title>CodeSesh</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-B5ae_tcH.js"></script>
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-vSqmWltx.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
package/package.json
CHANGED
|
File without changes
|