agent-session-inspector 0.1.5 → 0.1.6
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 +6 -4
- package/VERSION +1 -1
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/app/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next/server/app/api/search/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/[provider]/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/sessions/[provider]/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/sessions/[provider]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0dyq0rc._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0kgkqhn._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__10p8y9z._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1cceere._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1eclfq8._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1lz20wm._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1zdh1mi._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__20epvou._.js +1 -1
- package/app/.next/server/chunks/ssr/_0o294sf._.js +1 -1
- package/app/.next/server/chunks/ssr/{_1-5v1mi._.js → _0wfo2z0._.js} +2 -2
- package/app/.next/server/chunks/ssr/src_app_sessions_[provider]_[id]_page_tsx_0uf635h._.js +3 -3
- package/app/.next/server/middleware-build-manifest.js +3 -3
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/1uvlni5bd236c.js +6 -0
- package/app/.next/static/chunks/{043k5ranw7p1-.js → 1z_genu21d6mc.js} +1 -1
- package/app/.next/static/chunks/3xq2kqjs_2byl.css +1 -0
- package/app/README.md +6 -4
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/cli/cli.mjs +5 -3
- package/package.json +1 -1
- package/app/.next/static/chunks/1syzk-359a-tl.js +0 -6
- package/app/.next/static/chunks/23pvfhng1yidh.css +0 -1
- /package/app/.next/static/{-wq1RTFV0ts5s-g4PiOpq → rpBXcMOzD9z_w4Y9uQJJ-}/_buildManifest.js +0 -0
- /package/app/.next/static/{-wq1RTFV0ts5s-g4PiOpq → rpBXcMOzD9z_w4Y9uQJJ-}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{-wq1RTFV0ts5s-g4PiOpq → rpBXcMOzD9z_w4Y9uQJJ-}/_ssgManifest.js +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90613,e=>{"use strict";var t=e.i(45650),s=e.i(10364),a=e.i(4253),r=e.i(59920),n=e.i(13496);let o=(0,n.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),l=(0,n.default)("bookmark",[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]]),d=(0,n.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),i=(0,n.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);var c=e.i(44467);let u=(0,n.default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),m=(0,n.default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var x=e.i(32660),p=e.i(19455),h=e.i(77572),g=e.i(59684),f=e.i(34960),b=e.i(4503),j=e.i(22910),k=e.i(7067),v=e.i(84445),y=e.i(7346),N=e.i(19007);let w=(0,n.default)("arrow-down-narrow-wide",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h4",key:"6d7r33"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h10",key:"1438ji"}]]),C=(0,n.default)("arrow-up-narrow-wide",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]]),S=(0,n.default)("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);var T=e.i(98689),T=T,M=e.i(93304);let $=(0,n.default)("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]),_=(0,n.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),z=(0,n.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),A=(0,n.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var q=e.i(50395);let B=(0,n.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),D=(0,n.default)("list-filter",[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]]),I=(0,n.default)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),L=(0,n.default)("search-x",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),E=(0,n.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var R=e.i(98007),U=e.i(87486),O=e.i(70962),P=e.i(46798),F=e.i(82574),H=e.i(81795),W=e.i(48154);function V(e){let t=[],s=new Map,a=new Map,r=0,n=0,o=0,l=null;for(let d of e){if(!0===d.data.inherited)continue;if("user.message"===d.type){o+=1,l={turn:o,prompt:"string"==typeof d.data.content?d.data.content:void 0,eventId:d.id,timestamp:d.timestamp,costUSD:0,requests:0,totalUSD:n,compacted:!1},t.push(l),s.set(d.id,l);continue}l&&d.type.startsWith("session.compaction")&&(l.compacted=!0);let e=d.data.costUSD;"number"!=typeof e||e<=0||(l||(l={turn:0,eventId:d.id,timestamp:d.timestamp,costUSD:0,requests:0,totalUSD:n,compacted:!1},t.push(l)),n+=e,l.costUSD+=e,l.requests+=1,l.totalUSD=n,a.set(d.id,n),r=Math.max(r,e))}let d=t.findIndex(e=>e.costUSD>0);return{turns:-1===d?[]:t.slice(d),turnByPrompt:s,runningUSD:a,maxEventUSD:r,totalUSD:n}}var K=e.i(75379),J=e.i(29794),Z=e.i(42526),G=e.i(75157);let Y={"session.start":{label:"Session Start",dotCls:"bg-emerald-100 border-emerald-400 dark:bg-emerald-900/60 dark:border-emerald-700",typeCls:"text-emerald-700 dark:text-emerald-400"},"session.shutdown":{label:"Session Shutdown",dotCls:"bg-red-100 border-red-400 dark:bg-red-900/60 dark:border-red-700",typeCls:"text-red-700 dark:text-red-400"},"session.resume":{label:"Session Resume",dotCls:"bg-violet-100 border-violet-400 dark:bg-violet-900/60 dark:border-violet-700",typeCls:"text-violet-700 dark:text-violet-400"},"user.message":{label:"User Message",dotCls:"bg-violet-100 border-violet-400 dark:bg-violet-900/60 dark:border-violet-700",typeCls:"text-violet-700 dark:text-violet-400"},"assistant.message":{label:"Assistant",dotCls:"bg-sky-100 border-sky-400 dark:bg-sky-900/60 dark:border-sky-700",typeCls:"text-sky-700 dark:text-sky-400"},"assistant.turn_start":{label:"Turn Start",dotCls:"bg-cyan-100 border-cyan-400 dark:bg-cyan-900/60 dark:border-cyan-700",typeCls:"text-cyan-700 dark:text-cyan-400"},"assistant.turn_end":{label:"Turn End",dotCls:"bg-cyan-100 border-cyan-400 dark:bg-cyan-900/60 dark:border-cyan-700",typeCls:"text-cyan-700 dark:text-cyan-400"},"tool.execution_start":{label:"Tool Start",dotCls:"bg-amber-100 border-amber-400 dark:bg-amber-900/60 dark:border-amber-700",typeCls:"text-amber-700 dark:text-amber-400"},"tool.execution_complete":{label:"Tool Done",dotCls:"bg-amber-100 border-amber-400 dark:bg-amber-900/60 dark:border-amber-700",typeCls:"text-amber-700 dark:text-amber-400"},"external_tool.requested":{label:"External Tool Request",dotCls:"bg-lime-100 border-lime-400 dark:bg-lime-900/60 dark:border-lime-700",typeCls:"text-lime-700 dark:text-lime-400"},"external_tool.completed":{label:"External Tool Done",dotCls:"bg-lime-100 border-lime-400 dark:bg-lime-900/60 dark:border-lime-700",typeCls:"text-lime-700 dark:text-lime-400"},"permission.requested":{label:"Permission",dotCls:"bg-orange-100 border-orange-400 dark:bg-orange-900/60 dark:border-orange-700",typeCls:"text-orange-700 dark:text-orange-400"},"permission.completed":{label:"Permission Done",dotCls:"bg-orange-100 border-orange-400 dark:bg-orange-900/60 dark:border-orange-700",typeCls:"text-orange-700 dark:text-orange-400"},"hook.start":{label:"Hook Start",dotCls:"bg-cyan-100 border-cyan-400 dark:bg-cyan-900/60 dark:border-cyan-700",typeCls:"text-cyan-700 dark:text-cyan-400"},"hook.end":{label:"Hook End",dotCls:"bg-cyan-100 border-cyan-400 dark:bg-cyan-900/60 dark:border-cyan-700",typeCls:"text-cyan-700 dark:text-cyan-400"},"session.auto_mode_resolved":{label:"Auto Mode",dotCls:"bg-fuchsia-100 border-fuchsia-400 dark:bg-fuchsia-900/60 dark:border-fuchsia-700",typeCls:"text-fuchsia-700 dark:text-fuchsia-400"},"session.binary_asset":{label:"Binary Asset",dotCls:"bg-rose-100 border-rose-400 dark:bg-rose-900/60 dark:border-rose-700",typeCls:"text-rose-700 dark:text-rose-400"},"session.usage_checkpoint":{label:"Usage Checkpoint",dotCls:"bg-teal-100 border-teal-400 dark:bg-teal-900/60 dark:border-teal-700",typeCls:"text-teal-700 dark:text-teal-400"},"subagent.deselected":{label:"Subagent Deselected",dotCls:"bg-slate-100 border-slate-400 dark:bg-slate-900/60 dark:border-slate-700",typeCls:"text-slate-700 dark:text-slate-400"},"session.model_change":{label:"Model Change",dotCls:"bg-violet-100 border-violet-400 dark:bg-violet-900/60 dark:border-violet-700",typeCls:"text-violet-700 dark:text-violet-400"},"session.compaction_start":{label:"Compaction Start",dotCls:"bg-violet-100 border-violet-400 dark:bg-violet-900/60 dark:border-violet-700",typeCls:"text-violet-700 dark:text-violet-400"},"session.compaction_complete":{label:"Compaction Complete",dotCls:"bg-purple-100 border-purple-400 dark:bg-purple-900/60 dark:border-purple-700",typeCls:"text-purple-700 dark:text-purple-400"},"system.message":{label:"System",dotCls:"bg-slate-100 border-slate-400 dark:bg-slate-900/60 dark:border-slate-700",typeCls:"text-slate-700 dark:text-slate-400"},"assistant.thinking":{label:"Thinking",dotCls:"bg-indigo-100 border-indigo-400 dark:bg-indigo-900/60 dark:border-indigo-700",typeCls:"text-indigo-700 dark:text-indigo-400"},"session.error":{label:"Error",dotCls:"bg-red-100 border-red-400 dark:bg-red-900/60 dark:border-red-700",typeCls:"text-red-700 dark:text-red-400"},"context.attachment":{label:"Attachment",dotCls:"bg-stone-100 border-stone-400 dark:bg-stone-900/60 dark:border-stone-700",typeCls:"text-stone-700 dark:text-stone-400"},"file.patch_applied":{label:"Patch Applied",dotCls:"bg-emerald-100 border-emerald-400 dark:bg-emerald-900/60 dark:border-emerald-700",typeCls:"text-emerald-700 dark:text-emerald-400"},"web.search":{label:"Web Search",dotCls:"bg-blue-100 border-blue-400 dark:bg-blue-900/60 dark:border-blue-700",typeCls:"text-blue-700 dark:text-blue-400"},"session.turn_context":{label:"Turn Context",dotCls:"bg-fuchsia-100 border-fuchsia-400 dark:bg-fuchsia-900/60 dark:border-fuchsia-700",typeCls:"text-fuchsia-700 dark:text-fuchsia-400"},"session.world_state":{label:"World State",dotCls:"bg-fuchsia-100 border-fuchsia-400 dark:bg-fuchsia-900/60 dark:border-fuchsia-700",typeCls:"text-fuchsia-700 dark:text-fuchsia-400"},"session.mode_change":{label:"Mode Change",dotCls:"bg-violet-100 border-violet-400 dark:bg-violet-900/60 dark:border-violet-700",typeCls:"text-violet-700 dark:text-violet-400"},"session.turn_aborted":{label:"Turn Aborted",dotCls:"bg-orange-100 border-orange-400 dark:bg-orange-900/60 dark:border-orange-700",typeCls:"text-orange-700 dark:text-orange-400"},"session.rollback":{label:"Rollback",dotCls:"bg-orange-100 border-orange-400 dark:bg-orange-900/60 dark:border-orange-700",typeCls:"text-orange-700 dark:text-orange-400"},"subagent.activity":{label:"Subagent",dotCls:"bg-zinc-100 border-zinc-400 dark:bg-zinc-900/60 dark:border-zinc-700",typeCls:"text-zinc-700 dark:text-zinc-400"},"session.plan_changed":{label:"Plan Changed",dotCls:"bg-fuchsia-100 border-fuchsia-400 dark:bg-fuchsia-900/60 dark:border-fuchsia-700",typeCls:"text-fuchsia-700 dark:text-fuchsia-400"},"system.notification":{label:"Notification",dotCls:"bg-slate-100 border-slate-400 dark:bg-slate-900/60 dark:border-slate-700",typeCls:"text-slate-700 dark:text-slate-400"},"subagent.session_start":{label:"Subagent Start",dotCls:"bg-zinc-100 border-zinc-400 dark:bg-zinc-900/60 dark:border-zinc-700",typeCls:"text-zinc-700 dark:text-zinc-400"},"subagent.message":{label:"Subagent Message",dotCls:"bg-zinc-100 border-zinc-400 dark:bg-zinc-900/60 dark:border-zinc-700",typeCls:"text-zinc-700 dark:text-zinc-400"}},Q={label:"Event",dotCls:"bg-muted border-border",typeCls:"text-muted-foreground",chipCls:"border-border bg-muted text-muted-foreground"},X={session:{dotCls:"bg-fuchsia-100 border-fuchsia-400 dark:bg-fuchsia-900/60 dark:border-fuchsia-700",typeCls:"text-fuchsia-700 dark:text-fuchsia-400",chipCls:"border-fuchsia-300 bg-fuchsia-100 text-fuchsia-800 dark:border-fuchsia-800 dark:bg-fuchsia-900/50 dark:text-fuchsia-300"},user:{dotCls:"bg-pink-100 border-pink-400 dark:bg-pink-900/60 dark:border-pink-700",typeCls:"text-pink-700 dark:text-pink-400",chipCls:"border-pink-300 bg-pink-100 text-pink-800 dark:border-pink-800 dark:bg-pink-900/50 dark:text-pink-300"},assistant:{dotCls:"bg-sky-100 border-sky-400 dark:bg-sky-900/60 dark:border-sky-700",typeCls:"text-sky-700 dark:text-sky-400",chipCls:"border-sky-300 bg-sky-100 text-sky-800 dark:border-sky-800 dark:bg-sky-900/50 dark:text-sky-300"},tool:{dotCls:"bg-amber-100 border-amber-400 dark:bg-amber-900/60 dark:border-amber-700",typeCls:"text-amber-700 dark:text-amber-400",chipCls:"border-amber-300 bg-amber-100 text-amber-800 dark:border-amber-800 dark:bg-amber-900/50 dark:text-amber-300"},external_tool:{dotCls:"bg-lime-100 border-lime-400 dark:bg-lime-900/60 dark:border-lime-700",typeCls:"text-lime-700 dark:text-lime-400",chipCls:"border-lime-300 bg-lime-100 text-lime-800 dark:border-lime-800 dark:bg-lime-900/50 dark:text-lime-300"},permission:{dotCls:"bg-red-100 border-red-400 dark:bg-red-900/60 dark:border-red-700",typeCls:"text-red-700 dark:text-red-400",chipCls:"border-red-300 bg-red-100 text-red-800 dark:border-red-800 dark:bg-red-900/50 dark:text-red-300"},hook:{dotCls:"bg-teal-100 border-teal-400 dark:bg-teal-900/60 dark:border-teal-700",typeCls:"text-teal-700 dark:text-teal-400",chipCls:"border-teal-300 bg-teal-100 text-teal-800 dark:border-teal-800 dark:bg-teal-900/50 dark:text-teal-300"},system:{dotCls:"bg-slate-100 border-slate-400 dark:bg-slate-900/60 dark:border-slate-700",typeCls:"text-slate-700 dark:text-slate-400",chipCls:"border-slate-300 bg-slate-100 text-slate-800 dark:border-slate-700 dark:bg-slate-900/60 dark:text-slate-300"},subagent:{dotCls:"bg-zinc-100 border-zinc-400 dark:bg-zinc-900/60 dark:border-zinc-700",typeCls:"text-zinc-700 dark:text-zinc-400",chipCls:"border-zinc-300 bg-zinc-100 text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900/60 dark:text-zinc-300"},context:{dotCls:"bg-stone-100 border-stone-400 dark:bg-stone-900/60 dark:border-stone-700",typeCls:"text-stone-700 dark:text-stone-400",chipCls:"border-stone-300 bg-stone-100 text-stone-800 dark:border-stone-700 dark:bg-stone-900/60 dark:text-stone-300"},file:{dotCls:"bg-emerald-100 border-emerald-400 dark:bg-emerald-900/60 dark:border-emerald-700",typeCls:"text-emerald-700 dark:text-emerald-400",chipCls:"border-emerald-300 bg-emerald-100 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-300"},web:{dotCls:"bg-blue-100 border-blue-400 dark:bg-blue-900/60 dark:border-blue-700",typeCls:"text-blue-700 dark:text-blue-400",chipCls:"border-blue-300 bg-blue-100 text-blue-800 dark:border-blue-800 dark:bg-blue-900/50 dark:text-blue-300"}},ee={"session.start":"Session initialization event. Captures the runtime context and selected model when a session begins.","session.resume":"Session resumed from previous state. Indicates context reload and continuation.","session.shutdown":"Session end summary. Usually includes usage, token totals, premium requests, and API timing.","session.auto_mode_resolved":"Auto-mode model selection result. Shows predicted task profile and chosen model settings.","session.binary_asset":"Binary payload captured in the session (typically screenshots/images). Can consume significant context/storage.","session.usage_checkpoint":"Interim usage accounting snapshot (AIU/premium usage/cache state) while session is active.","session.model_change":"Model configuration switched during the session (model/effort/context tier).","session.compaction_start":"Context compaction started. Conversation is being summarized/compressed to reduce token load.","session.compaction_complete":"Compaction finished, with success/failure metadata and request identifiers.","user.message":"User input message that drives the next assistant turn.","assistant.message":"Assistant output message, optionally with model/tool-request and token metadata.","assistant.turn_start":"Start of a single assistant reasoning/execution turn.","assistant.turn_end":"End of the assistant turn after reasoning/tools/output.","tool.execution_start":"A local tool invocation started with tool name and arguments.","tool.execution_complete":"A local tool invocation completed with status and result payload.","external_tool.requested":"Request sent to an external tool bridge/service.","external_tool.completed":"External tool request lifecycle completed.","permission.requested":"Runtime requested user permission for an action (e.g., file/system/network).","permission.completed":"Permission flow resolved (approved/denied).","hook.start":"Lifecycle hook execution started (for example, prompt submission hooks).","hook.end":"Lifecycle hook execution completed with success/failure state.","subagent.deselected":"Subagent focus was cleared and control returned to the main agent context.","system.message":"System-level instruction/context block injected into the conversation runtime.","assistant.thinking":"Extended reasoning the model produced before answering. Billed as output tokens.","session.error":"API or transport error. Each retry re-sends the full request context.","context.attachment":"Context the runtime injected automatically: file snapshots, reminders, tool or skill listings.","file.patch_applied":"A patch the agent applied to the workspace, with the files it touched.","web.search":"Web search issued by the model; results are added to the conversation context.","session.turn_context":"Per-turn runtime configuration: model, effort, sandbox and approval policy.","session.world_state":"Snapshot of the workspace the runtime handed to the model.","session.mode_change":"Interaction or permission mode switched during the session.","session.turn_aborted":"The turn was interrupted before it completed.","session.rollback":"Conversation was rolled back by a number of turns.","subagent.activity":"Activity reported by a subagent working under the main agent.","subagent.message":"Message passed between agents.","subagent.session_start":"A subagent thread started inside this session.","session.plan_changed":"The agent created or updated its working plan.","system.notification":"Runtime notification injected into the conversation, such as a background shell finishing."};function et(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function es(e){return new Date(e).toLocaleDateString([],{weekday:"long",year:"numeric",month:"long",day:"numeric"})}function ea(e,t){return new Date(t).getTime()-new Date(e).getTime()}function er(e){let[t,...s]=e.split(".");return{category:t||"unknown",subCategory:s.join(".")||"general"}}function en(e){return!!e&&!1===e.data.success&&(eK.has(e.type)||"file.patch_applied"===e.type)}function eo(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function el({data:e}){let a=e.content||"",[r,n]=(0,s.useState)(!1),o=a.slice(0,300),l=a.length>300;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:[r?a:o,l&&!r&&"..."]}),l&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>n(!r),className:"h-auto px-0 font-normal text-violet-600 dark:text-violet-400 mt-1",children:r?"Show less":`Show more (${a.length} chars)`})]})}function ed({data:e}){let a=e.content||"",r=e.toolRequests||[],n=e.model,o=e.outputTokens,[l,d]=(0,s.useState)(!1),i=a.slice(0,400),c=a.length>400;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[n&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:n}),void 0!==o&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-violet-100 border border-violet-300 dark:bg-violet-950 dark:border-violet-800 rounded-full text-xs text-violet-700 dark:text-violet-300",children:[(0,t.jsx)("span",{className:"opacity-60",children:"out"}),(0,t.jsx)("span",{className:"font-semibold font-mono",children:o.toLocaleString()}),(0,t.jsx)("span",{className:"opacity-60",children:"tokens"})]})]}),a&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:[l?a:i,c&&!l&&"..."]}),c&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>d(!l),className:"h-auto px-0 font-normal text-sky-600 dark:text-sky-400 mt-1",children:l?"Show less":`Show more (${a.length} chars)`})]}),r.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:r.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-amber-100 border border-amber-300 dark:bg-amber-900/50 dark:border-amber-800 rounded-sm text-xs text-amber-800 dark:text-amber-300 font-mono",children:["🔧 ",e.name]},s))})]})}function ei({data:e,type:a}){let r=e.toolName,n=e.arguments,o=e.result,l=e.success,[d,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-amber-700 dark:text-amber-300 font-semibold",children:r}),"tool.execution_complete"===a&&(0,t.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded-sm font-medium ${l?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/60 dark:text-emerald-400":"bg-red-100 text-red-700 dark:bg-red-900/60 dark:text-red-400"}`,children:l?"success":"failed"})]}),n&&Object.keys(n).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Button,{variant:"link",size:"xs",onClick:()=>i(!d),className:"h-auto px-0 font-normal text-amber-600 dark:text-amber-500",children:[d?"▼":"▶"," Arguments"]}),d&&(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted rounded-sm text-xs text-foreground overflow-auto max-h-48 font-mono border border-border",children:JSON.stringify(n,null,2)})]}),o&&(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Button,{variant:"link",size:"xs",onClick:()=>u(!c),className:"h-auto px-0 font-normal text-amber-600 dark:text-amber-500",children:[c?"▼":"▶"," Result"]}),c&&(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted rounded-sm text-xs text-foreground overflow-auto max-h-48 font-mono border border-border",children:JSON.stringify(o,null,2)})]})]})}function ec({data:e}){let s=e.tokenDetails,a=e.totalApiDurationMs,r=e.totalPremiumRequests,n=e.shutdownType,o=s?.input?.tokenCount,l=s?.output?.tokenCount,d=s?.cache_read?.tokenCount;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[n&&(0,t.jsx)(U.Badge,{variant:"outline",className:"text-xs",children:n}),void 0!==r&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:r})," premium req"]}),void 0!==a&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-semibold text-foreground",children:[(a/1e3).toFixed(1),"s"]})," API"]})]}),(void 0!==o||void 0!==l)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[void 0!==o&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 bg-cyan-100 border border-cyan-300 dark:bg-cyan-950 dark:border-cyan-800 rounded-full text-xs text-cyan-700 dark:text-cyan-300",children:[(0,t.jsx)("span",{className:"opacity-60",children:"in"}),(0,t.jsx)("span",{className:"font-semibold font-mono",children:o.toLocaleString()})]}),void 0!==l&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 bg-violet-100 border border-violet-300 dark:bg-violet-950 dark:border-violet-800 rounded-full text-xs text-violet-700 dark:text-violet-300",children:[(0,t.jsx)("span",{className:"opacity-60",children:"out"}),(0,t.jsx)("span",{className:"font-semibold font-mono",children:l.toLocaleString()})]}),void 0!==d&&d>0&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 bg-teal-100 border border-teal-300 dark:bg-teal-950 dark:border-teal-800 rounded-full text-xs text-teal-700 dark:text-teal-300",children:[(0,t.jsx)("span",{className:"opacity-60",children:"cache"}),(0,t.jsx)("span",{className:"font-semibold font-mono",children:d.toLocaleString()})]})]})]})}function eu({data:e}){let a=e.role,r=e.interactionId,n=e.content||"",[o,l]=(0,s.useState)(!1),d=n.slice(0,420),i=n.length>420;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[a&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs border border-slate-300 bg-slate-100 text-slate-700 dark:border-slate-700 dark:bg-slate-900/60 dark:text-slate-300 font-mono",children:a}),r&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground font-mono",children:["interaction: ",r]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-slate-200/80 dark:border-slate-800/80 bg-background/70 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:"System Prompt"}),(0,t.jsxs)("pre",{className:"text-xs text-foreground whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-72 font-mono",children:[o?n:d,i&&!o&&"..."]})]}),i&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>l(!o),className:"h-auto px-0 font-normal text-slate-700 dark:text-slate-300",children:o?"Show less":`Show full system prompt (${n.length.toLocaleString()} chars)`})]})}function em({data:e,type:a}){let r=e.hookType,n=e.hookInvocationId,o=e.success,l=e.input,d=l?.prompt,[i,c]=(0,s.useState)(!1),u=(d||"").slice(0,300),m=(d||"").length>300;return(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[r&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:r}),"hook.end"===a&&void 0!==o&&(0,t.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded-sm font-medium border ${o?"bg-emerald-100 text-emerald-700 border-emerald-300 dark:bg-emerald-900/50 dark:text-emerald-300 dark:border-emerald-800":"bg-red-100 text-red-700 border-red-300 dark:bg-red-900/50 dark:text-red-300 dark:border-red-800"}`,children:o?"success":"failed"}),n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:n})]}),"hook.start"===a&&d&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:"Prompt Preview"}),(0,t.jsxs)("pre",{className:"text-xs text-foreground whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-44 font-mono",children:[i?d:u,m&&!i&&"..."]}),m&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>c(!i),className:"h-auto px-0 font-normal text-cyan-700 dark:text-cyan-300 mt-1",children:i?"Show less":`Show more (${d.length.toLocaleString()} chars)`})]})]})}function ex({data:e}){let s=e.chosenModel,a=e.reasoningBucket,r=e.predictedLabel,n=e.confidence,o=e.candidateModels||[],l=e.categoryScores;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[s&&(0,t.jsx)(U.Badge,{className:"text-xs font-mono bg-fuchsia-100 text-fuchsia-800 border border-fuchsia-300 dark:bg-fuchsia-900/50 dark:text-fuchsia-300 dark:border-fuchsia-800",children:s}),a&&(0,t.jsxs)(U.Badge,{variant:"outline",className:"text-xs font-mono",children:["reasoning: ",a]}),r&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["label: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:r})]}),"number"==typeof n&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["confidence: ",(0,t.jsxs)("span",{className:"font-mono text-foreground",children:[Math.round(100*n),"%"]})]})]}),o.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:"Candidate Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.slice(0,8).map((e,s)=>(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm border border-fuchsia-300 bg-fuchsia-100/70 text-fuchsia-800 dark:border-fuchsia-800 dark:bg-fuchsia-900/40 dark:text-fuchsia-300 text-xs font-mono",children:String(e)},s))})]}),l&&Object.keys(l).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:"Category Scores"}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1.5",children:Object.entries(l).slice(0,6).map(([e,s])=>(0,t.jsxs)("div",{className:"text-xs border border-fuchsia-200 bg-fuchsia-50/70 dark:border-fuchsia-900/80 dark:bg-fuchsia-950/25 rounded-sm px-2 py-1 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:String(s)})]},e))})]})]})}function ep({data:e,type:a}){let r=e.requestId,n=e.toolName,o=e.toolCallId,l=e.workingDirectory,d=e.arguments,[i,c]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs border font-medium ${"external_tool.requested"===a?"bg-lime-100 text-lime-800 border-lime-300 dark:bg-lime-900/60 dark:text-lime-300 dark:border-lime-800":"bg-emerald-100 text-emerald-700 border-emerald-300 dark:bg-emerald-900/60 dark:text-emerald-300 dark:border-emerald-800"}`,children:"external_tool.requested"===a?"requested":"completed"}),n&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:n}),o&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:o})]}),r&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground font-mono",children:["request: ",r]}),"external_tool.requested"===a&&l&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["cwd: ",(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:l})]}),"external_tool.requested"===a&&d&&Object.keys(d).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Button,{variant:"link",size:"xs",onClick:()=>c(!i),className:"h-auto px-0 font-normal text-lime-700 dark:text-lime-400",children:[i?"▼":"▶"," Arguments"]}),i&&(0,t.jsx)("pre",{className:"mt-1 p-2 bg-background/70 rounded-sm text-xs text-foreground overflow-auto max-h-40 font-mono border border-lime-200 dark:border-lime-800 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:JSON.stringify(d,null,2)})]})]})}function eh({data:e}){let s=e.assetId,a=e.type,r=e.mimeType,n=e.byteLength,o=e.data;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[a&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:a}),r&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:r})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1.5 text-xs",children:[void 0!==n&&(0,t.jsxs)("div",{className:"rounded-sm border border-rose-200 dark:border-rose-900 px-2 py-1 bg-rose-100/60 dark:bg-rose-950/25",children:["size: ",(0,t.jsxs)("span",{className:"font-mono text-foreground",children:[n.toLocaleString()," bytes"]})]}),o&&(0,t.jsxs)("div",{className:"rounded-sm border border-rose-200 dark:border-rose-900 px-2 py-1 bg-rose-100/60 dark:bg-rose-950/25",children:["payload: ",(0,t.jsxs)("span",{className:"font-mono text-foreground",children:[o.length.toLocaleString()," chars"]})]})]}),s&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground font-mono break-all",children:["asset: ",s]})]})}function eg({data:e}){let s=e.usage,a=e.contextWindow,r=e.totalNanoAiu,n=e.totalPremiumRequests,o=e.modelCacheState,l="number"==typeof r?r/1e9:void 0;return(0,t.jsxs)("div",{className:"space-y-2",children:[s&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[[["in",s.inputTokens],["cached",s.cachedInputTokens],["out",s.outputTokens],["reasoning",s.reasoningTokens]].filter(([,e])=>"number"==typeof e&&e>0).map(([e,s])=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-teal-300 bg-teal-100 px-2 py-0.5 text-teal-700 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",children:[(0,t.jsx)("span",{className:"opacity-60",children:e}),(0,t.jsx)("span",{className:"font-mono font-semibold",children:eo(s)})]},e)),a&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:["window ",eo(a)]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1.5 text-xs",children:[void 0!==l&&(0,t.jsxs)("div",{className:"rounded-sm border border-teal-200 dark:border-teal-900 px-2 py-1 bg-teal-100/60 dark:bg-teal-950/25",children:["total AIU: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:eo(l)})]}),void 0!==n&&(0,t.jsxs)("div",{className:"rounded-sm border border-teal-200 dark:border-teal-900 px-2 py-1 bg-teal-100/60 dark:bg-teal-950/25",children:["premium req: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:n})]})]}),o&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["cache state entries: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:o.length})]})]})}function ef({data:e}){let s=e.previousModel,a=e.newModel,r=e.reasoningEffort,n=e.contextTier;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"text-sm text-foreground",children:[(0,t.jsx)("span",{className:"font-mono",children:s||"unknown"}),(0,t.jsx)("span",{className:"mx-2 text-muted-foreground",children:"→"}),(0,t.jsx)("span",{className:"font-mono font-semibold",children:a||"unknown"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap text-xs",children:[(0,t.jsxs)("span",{className:"px-2 py-0.5 rounded-sm border border-violet-200 dark:border-violet-900 bg-violet-100/60 dark:bg-violet-950/25 text-muted-foreground",children:["effort: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:r??"default"})]}),(0,t.jsxs)("span",{className:"px-2 py-0.5 rounded-sm border border-violet-200 dark:border-violet-900 bg-violet-100/60 dark:bg-violet-950/25 text-muted-foreground",children:["context: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:n??"default"})]})]})]})}function eb({data:e}){let s=e.model,a=e.systemTokens,r=e.conversationTokens,n=e.toolDefinitionsTokens,o=[a,r,n].filter(e=>"number"==typeof e).reduce((e,t)=>e+t,0);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[s&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:s}),o>0&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["total: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:eo(o)})," tokens"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-1.5 text-xs",children:[void 0!==a&&(0,t.jsxs)("div",{className:"rounded-sm border border-violet-200 dark:border-violet-900 px-2 py-1 bg-violet-100/60 dark:bg-violet-950/25",children:["system: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:eo(a)})]}),void 0!==r&&(0,t.jsxs)("div",{className:"rounded-sm border border-violet-200 dark:border-violet-900 px-2 py-1 bg-violet-100/60 dark:bg-violet-950/25",children:["convo: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:eo(r)})]}),void 0!==n&&(0,t.jsxs)("div",{className:"rounded-sm border border-violet-200 dark:border-violet-900 px-2 py-1 bg-violet-100/60 dark:bg-violet-950/25",children:["tools: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:eo(n)})]})]})]})}function ej({data:e}){let s=e.success,a=e.error,r=e.statusCode,n=e.requestId,o=e.serviceRequestId;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs border font-medium ${s?"bg-emerald-100 text-emerald-700 border-emerald-300 dark:bg-emerald-900/50 dark:text-emerald-300 dark:border-emerald-800":"bg-red-100 text-red-700 border-red-300 dark:bg-red-900/50 dark:text-red-300 dark:border-red-800"}`,children:s?"success":"failed"}),void 0!==r&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["status: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:r})]})]}),a&&(0,t.jsx)("div",{className:"text-xs text-red-700 dark:text-red-300 bg-red-100/70 dark:bg-red-950/30 border border-red-200 dark:border-red-900 rounded-sm px-2 py-1.5 font-mono whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:a}),n&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground font-mono break-all",children:["requestId: ",n]}),o&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground font-mono break-all",children:["serviceRequestId: ",o]})]})}function ek(){return(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Active subagent context was cleared and focus returned to the main agent."})}function ev({data:e,type:s}){let a=e.model,r=e.turnId,n=e.interactionId;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs border font-medium ${"assistant.turn_start"===s?"bg-emerald-100 text-emerald-700 border-emerald-300 dark:bg-emerald-900/50 dark:text-emerald-300 dark:border-emerald-800":"bg-slate-100 text-slate-700 border-slate-300 dark:bg-slate-900/60 dark:text-slate-300 dark:border-slate-700"}`,children:"assistant.turn_start"===s?"turn started":"turn finished"}),void 0!==r&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["turn: ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:String(r)})]}),a&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs font-mono",children:a})]}),n&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground font-mono",children:["interaction: ",n]})]})}function ey({data:e}){let a=e.content||"",r=e.charLength??a.length,[n,o]=(0,s.useState)(!1),l=a.slice(0,400),d=a.length>400;return a?(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:["Reasoning · ",r.toLocaleString()," chars"]}),(0,t.jsxs)("div",{className:"text-sm italic leading-relaxed text-muted-foreground whitespace-pre-wrap",children:[n?a:l,d&&!n&&"…"]}),d&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>o(!n),className:"h-auto px-0 font-normal text-indigo-600 dark:text-indigo-400",children:n?"Show less":`Show more (${r.toLocaleString()} chars)`})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Reasoning was recorded but its content is encrypted in the transcript."})}function eN({data:e}){let s=e.message||"Error",a=e.detail;return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-destructive",children:s}),a&&a!==s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]})}function ew({items:e,label:a}){let[r,n]=(0,s.useState)(!1);if(0===e.length)return null;let o=r?e:e.slice(0,12);return(0,t.jsxs)("div",{className:"space-y-1",children:[a&&(0,t.jsxs)("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:[e.length," ",a]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[o.map(e=>(0,t.jsx)("span",{className:"max-w-full truncate rounded-sm border border-border bg-muted/60 px-1.5 py-0.5 font-mono text-[11px] text-foreground/80",title:e,children:e},e)),!r&&e.length>o.length&&(0,t.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:()=>n(!0),className:"text-[11px] font-normal text-muted-foreground",children:["+",e.length-o.length," more"]})]})]})}function eC({text:e,charLength:a,limit:r=400,mono:n=!0,accentCls:o="text-muted-foreground"}){let[l,d]=(0,s.useState)(!1);if(!e)return null;let i=e.length>r,c=a??e.length;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("pre",{className:(0,G.cn)("max-h-72 overflow-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-foreground/80",n&&"font-mono"),children:[l?e:e.slice(0,r),!l&&i&&"…"]}),i&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>d(!l),className:(0,G.cn)("h-auto px-0 font-normal",o),children:l?"Show less":`Show more (${c.toLocaleString()} chars)`})]})}function eS({data:e}){let s=e.attachmentType||"attachment",a=e.label||s,r=e.subject,n=e.items??[],o=e.itemsLabel,l=e.charLength??0,d=e.content||"";return(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(U.Badge,{variant:"secondary",className:"text-xs",children:a}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:s}),l>0&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["~",Math.round(l/4).toLocaleString()," tokens"]})]}),r&&(0,t.jsx)("p",{className:"break-all font-mono text-xs text-foreground/80",children:r}),(0,t.jsx)(ew,{items:n,label:o}),(0,t.jsx)(eC,{text:d,charLength:l,accentCls:"text-stone-600 dark:text-stone-400"})]})}function eT({data:e}){let s=e.success,a=e.changes||[],r=e.stdout||"";return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`rounded-sm px-1.5 py-0.5 text-xs font-medium ${!1===s?"bg-red-100 text-red-700 dark:bg-red-900/60 dark:text-red-400":"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/60 dark:text-emerald-400"}`,children:!1===s?"failed":"applied"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.length," file",1===a.length?"":"s"]})]}),a.length>0&&(0,t.jsx)("ul",{className:"space-y-1",children:a.slice(0,12).map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"rounded-sm border border-emerald-300 bg-emerald-100/70 px-1 font-mono text-[10px] uppercase text-emerald-800 dark:border-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300",children:e.type}),(0,t.jsx)("span",{className:"truncate font-mono text-foreground/80",title:e.file,children:e.file})]},e.file))}),r&&(0,t.jsx)("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:r})]})}function eM({data:e}){let s=e.query||"",a=e.resultCount;return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-sm text-foreground",children:s}),void 0!==a&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a," result",1===a?"":"s"," returned"]})]})}function e$({facts:e}){let s=e.filter(([,e])=>null!=e&&""!==e);return 0===s.length?null:(0,t.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:s.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-sm border border-border bg-muted/40 px-2 py-1 text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"min-w-0 truncate font-mono text-foreground",title:String(s),children:String(s)})]},e))})}function e_({data:e}){let s=e.mode||"unknown";return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Mode set to"}),(0,t.jsx)(U.Badge,{variant:"secondary",className:"font-mono",children:s})]})}function ez({data:e}){let s=e.sandboxPolicy,a=e.approvalPolicy,r=s?.writable_roots??[];return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(e$,{facts:[["model",e.model],["effort",e.effort],["personality",e.personality],["sandbox",s?.type],["network",s?.network_access===!0?"enabled":"restricted"],["approval",a?Object.keys(a)[0]:void 0],["cwd",e.cwd]]}),r.length>0&&(0,t.jsx)(ew,{items:r,label:"writable roots"})]})}function eA({data:e}){let s=e.sections??[],a=e.content||"",r=e.charLength??0;return(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsx)(e$,{facts:[["cwd",e.cwd],["shell",e.shell],["date",e.currentDate],["timezone",e.timezone],["snapshot",!0===e.full?"full":"delta"],["size",r?`${r.toLocaleString()} chars`:void 0]]}),(0,t.jsx)(ew,{items:s,label:"state sections"}),(0,t.jsx)(eC,{text:a,charLength:r})]})}function eq({data:e,type:s}){return"subagent.session_start"===s?(0,t.jsx)(e$,{facts:[["agent",e.agentNickname],["path",e.agentPath],["thread",e.sessionId],["parent",e.parentThreadId],["cwd",e.cwd]]}):"subagent.activity"===s?(0,t.jsx)(e$,{facts:[["activity",e.kind],["path",e.agentPath],["thread",e.agentThreadId]]}):(0,t.jsx)(eE,{data:e})}function eB({data:e}){let s=e.durationMs;return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"rounded-sm bg-orange-100 px-1.5 py-0.5 font-medium text-orange-800 dark:bg-orange-900/60 dark:text-orange-300",children:e.reason??"aborted"}),void 0!==s&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:["after"," ",(0,t.jsxs)("span",{className:"font-mono text-foreground",children:[(s/1e3).toFixed(1),"s"]})]}),void 0!==e.turnId&&(0,t.jsxs)("span",{className:"font-mono text-muted-foreground",children:["turn ",String(e.turnId)]})]})}function eD({data:e}){let s=e.turns;return(0,t.jsxs)("p",{className:"text-sm text-foreground",children:["Conversation rolled back"," ",(0,t.jsx)("span",{className:"font-semibold",children:s??"?"})," turn",1===s?"":"s","."]})}function eI({data:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Plan"}),(0,t.jsx)(U.Badge,{variant:"secondary",className:"font-mono",children:e.operation??"changed"})]})}function eL({data:e}){let s=e.kind,a=e.content||"";return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(e$,{facts:[["kind",s?.type],["shell",s?.shellId],["exit code",s?.exitCode],["description",s?.description]]}),(0,t.jsx)(eC,{text:a,mono:!1})]})}function eE({data:e}){let[a,r]=(0,s.useState)(!1),n=JSON.stringify(e,null,2),o=n.slice(0,300),l=n.length>300;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("pre",{className:"text-xs text-muted-foreground font-mono whitespace-pre-wrap",children:[a?n:o,l&&!a&&"..."]}),l&&(0,t.jsx)(p.Button,{variant:"link",size:"xs",onClick:()=>r(!a),className:"h-auto px-0 font-normal text-muted-foreground hover:text-foreground mt-1",children:a?"Collapse":"Expand"})]})}function eR(e,t=150){let s=String(e??"").replace(/\s+/g," ").trim();return s.length>t?`${s.slice(0,t)}…`:s}function eU(e){if(!e)return"";for(let t of["command","cmd","input","script","filePath","file_path","notebook_path","path","pattern","query","description","url","prompt"])if(e[t])return`${t}: ${eR(e[t],90)}`;return Object.keys(e).length?eR(JSON.stringify(e),90):"(no args)"}let eO=e=>"string"==typeof e&&e.length>0?e.replace(/\n$/,"").split("\n").length:0,eP=new Set(["user.message","assistant.message","assistant.thinking"]);function eF({event:e,prevTimestamp:a,expandAll:r,parallel:n=!1,target:o=!1,merged:l=!1,result:d,runningUSD:i,costShare:c=0,turn:u}){let m,x,h,g,b,j,k=Y[e.type]||Q,v=a?ea(a,e.timestamp):null,[y,N]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),[T,$]=(0,s.useState)({nonce:0,open:eP.has(e.type)||o}),_=r&&r.nonce!==T.nonce?"open"===r.mode:T.open,z=function(e){let t=e.data,s=Y[e.type]?.label??er(e.type).subCategory;switch(e.type){case"user.message":return{label:"User",preview:eR(t.content)};case"assistant.message":{let e=t.toolRequests??[],s=eR(t.content);if(s)return{label:"Assistant",preview:s};if(e.length)return{label:"Assistant",preview:`requests ${e.map(e=>e.name).filter(Boolean).join(", ")}`};return{label:"Assistant",preview:"(no text)"}}case"assistant.turn_start":case"assistant.turn_end":{let s=t.turnId;return{label:"assistant.turn_start"===e.type?"Turn start":"Turn end",preview:[void 0!==s?`turn ${s}`:"",t.model].filter(Boolean).join(" · ")}}case"tool.execution_start":return{label:t.toolName||"Tool",preview:eU(t.arguments),delta:function(e){if(!e)return null;let t=[e.input,e.patch,e.command].find(e=>"string"==typeof e&&e.includes("*** Begin Patch"));if(t){let e=0,s=0;for(let a of t.split("\n"))a.startsWith("+")&&!a.startsWith("+++")?e+=1:a.startsWith("-")&&!a.startsWith("---")&&(s+=1);return{added:e,removed:s}}let s=Array.isArray(e.edits)?e.edits:[e],a=0,r=0,n=!1;for(let e of s){let t=e.new_string??e.new_str??e.content??e.file_text,s=e.old_string??e.old_str;("string"==typeof t||"string"==typeof s)&&(n=!0,a+=eO(t),r+=eO(s))}return n?{added:a,removed:r}:null}(t.arguments)};case"tool.execution_complete":return{label:t.toolName||"Tool",preview:!1===t.success?"failed":"completed"};case"external_tool.requested":case"external_tool.completed":return{label:t.toolName||"External tool",preview:"external_tool.requested"===e.type?eU(t.arguments):"completed"};case"session.start":case"session.resume":{let s=t.context;return{label:"session.start"===e.type?"Session start":"Session resume",preview:[s?.branch?`branch ${s.branch}`:"",t.selectedModel?`model ${t.selectedModel}`:""].filter(Boolean).join(" · ")}}case"session.shutdown":return{label:"Shutdown",preview:[t.shutdownType,void 0!==t.totalPremiumRequests?`${t.totalPremiumRequests} premium req`:""].filter(Boolean).join(" · ")};case"session.auto_mode_resolved":return{label:"Auto mode",preview:[t.chosenModel,t.predictedLabel?`label ${t.predictedLabel}`:""].filter(Boolean).join(" · ")};case"session.binary_asset":return{label:"Binary asset",preview:[t.mimeType,"number"==typeof t.byteLength?`${(t.byteLength/1024).toFixed(0)} KB`:""].filter(Boolean).join(" · ")};case"session.usage_checkpoint":{let e=t.usage;if(e)return{label:"Usage checkpoint",preview:`in ${eo(e.inputTokens??0)} \xb7 out ${eo(e.outputTokens??0)}`};return{label:"Usage checkpoint",preview:void 0!==t.totalPremiumRequests?`${t.totalPremiumRequests} premium req`:"usage snapshot"}}case"session.model_change":return{label:"Model change",preview:`${t.previousModel??"unknown"} → ${t.newModel??"unknown"}`};case"session.compaction_start":return{label:"Compaction",preview:`started \xb7 ${t.model??""}`.trim()};case"session.compaction_complete":return{label:"Compaction",preview:t.success?"completed":`failed${t.error?`: ${eR(t.error,80)}`:""}`};case"system.message":{let e=t.charLength||String(t.content??"").length;return{label:"System",preview:`${t.role??"system"} \xb7 ${e.toLocaleString()} chars`}}case"hook.start":case"hook.end":{let s=t.input;if("hook.end"===e.type)return{label:t.hookType||"Hook",preview:!1===t.success?"failed":"success"};return{label:t.hookType||"Hook",preview:eR(s?.prompt,90)||"started"}}case"permission.requested":{let e=t.permissionRequest;return{label:"Permission",preview:[e?.kind,eR(e?.intention,90)].filter(Boolean).join(" · ")}}case"permission.completed":{let e=t.result;return{label:"Permission",preview:e?.kind??"resolved"}}case"subagent.deselected":return{label:"Subagent",preview:"focus returned to main agent"};case"subagent.activity":return{label:"Subagent",preview:[t.kind,t.agentPath].filter(Boolean).join(" · ")};case"subagent.session_start":return{label:"Subagent start",preview:[t.agentNickname,t.agentPath,t.cwd].filter(Boolean).join(" · ")};case"session.plan_changed":return{label:"Plan",preview:String(t.operation??"changed")};case"system.notification":{let e=t.kind;return{label:"Notification",preview:[e?.type,e?.description].filter(Boolean).join(" · ")||eR(t.content,90)}}case"assistant.thinking":{let e=eR(t.content),s=t.charLength??0;return{label:"Thinking",preview:e||(s?`${s.toLocaleString()} chars (encrypted)`:"reasoning")}}case"session.error":return{label:"Error",preview:eR(t.detail||t.message,90)};case"context.attachment":{let e=t.charLength??0,s=t.itemCount??0,a=t.subject||(s?`${s} ${t.itemsLabel??"items"}`:"")||eR(t.content,70);return{label:t.label||"Attachment",preview:[a,e?`${e.toLocaleString()} chars`:""].filter(Boolean).join(" · ")}}case"file.patch_applied":{let e=t.changes??[],s=e[0]?.file.split("/").pop();return{label:"Patch",preview:e.length>1?`${e.length} files \xb7 ${s}, …`:s??(!1===t.success?"failed":"applied")}}case"web.search":return{label:"Web search",preview:eR(t.query,90)};case"session.turn_context":return{label:"Turn context",preview:[t.model,t.effort?`effort ${t.effort}`:""].filter(Boolean).join(" · ")};case"session.world_state":let a;return{label:"World state",preview:(a=(t.sections??[]).length,[!0===t.full?"full snapshot":"delta",`${a} section${1===a?"":"s"}`,`${(t.charLength??0).toLocaleString()} chars`].join(" · "))};case"session.mode_change":return{label:"Mode",preview:String(t.mode??"changed")};case"session.turn_aborted":return{label:"Turn aborted",preview:[t.reason,t.durationMs?`${Math.round(t.durationMs/1e3)}s`:""].filter(Boolean).join(" · ")};case"session.rollback":return{label:"Rollback",preview:`${t.turns??"?"} turn(s)`};default:return{label:s,preview:eR(JSON.stringify(t),90)}}}(e),A=(x=(m=e.data).tokenDetails,h=m.sessionTotals,g=m.usageSummary,b=("number"==typeof m.inputTokens?m.inputTokens:0)||(x?.input?.tokenCount??0)||(g?.inputTokens??0)||(h?.inputTokens??0),j=("number"==typeof m.outputTokens?m.outputTokens:0)||(x?.output?.tokenCount??0)||(g?.outputTokens??0)||(h?.outputTokens??0),0===b&&0===j?null:{input:b,output:j}),D="number"==typeof e.data.costUSD?e.data.costUSD:null,I=er(e.type),L=X[I.category]??k,E=ee[e.type]??`Event in "${I.category}" category with "${I.subCategory}" sub-category.`,R=function(){if(l)return(0,t.jsx)(ei,{data:d?{...e.data,result:d.data.result,success:d.data.success}:e.data,type:d?"tool.execution_complete":"tool.execution_start"});switch(e.type){case"user.message":return(0,t.jsx)(el,{data:e.data});case"assistant.message":return(0,t.jsx)(ed,{data:e.data});case"assistant.turn_start":return(0,t.jsx)(ev,{data:e.data,type:"assistant.turn_start"});case"assistant.turn_end":return(0,t.jsx)(ev,{data:e.data,type:"assistant.turn_end"});case"tool.execution_start":case"tool.execution_complete":return(0,t.jsx)(ei,{data:e.data,type:e.type});case"external_tool.requested":return(0,t.jsx)(ep,{data:e.data,type:"external_tool.requested"});case"external_tool.completed":return(0,t.jsx)(ep,{data:e.data,type:"external_tool.completed"});case"session.shutdown":return(0,t.jsx)(ec,{data:e.data});case"session.start":case"session.resume":{let s=e.data.context;return(0,t.jsx)("div",{className:"text-xs text-muted-foreground space-y-1",children:s&&(0,t.jsxs)("div",{children:["Branch: ",(0,t.jsx)("span",{className:"text-foreground",children:s.branch})," · ","Model: ",(0,t.jsx)("span",{className:"text-foreground",children:e.data.selectedModel})]})})}case"hook.start":return(0,t.jsx)(em,{data:e.data,type:"hook.start"});case"hook.end":return(0,t.jsx)(em,{data:e.data,type:"hook.end"});case"session.auto_mode_resolved":return(0,t.jsx)(ex,{data:e.data});case"session.binary_asset":return(0,t.jsx)(eh,{data:e.data});case"session.usage_checkpoint":return(0,t.jsx)(eg,{data:e.data});case"subagent.deselected":return(0,t.jsx)(ek,{});case"session.model_change":return(0,t.jsx)(ef,{data:e.data});case"session.compaction_start":return(0,t.jsx)(eb,{data:e.data});case"session.compaction_complete":return(0,t.jsx)(ej,{data:e.data});case"system.message":return(0,t.jsx)(eu,{data:e.data});case"assistant.thinking":return(0,t.jsx)(ey,{data:e.data});case"session.error":return(0,t.jsx)(eN,{data:e.data});case"context.attachment":return(0,t.jsx)(eS,{data:e.data});case"file.patch_applied":return(0,t.jsx)(eT,{data:e.data});case"web.search":return(0,t.jsx)(eM,{data:e.data});case"session.mode_change":return(0,t.jsx)(e_,{data:e.data});case"session.turn_context":return(0,t.jsx)(ez,{data:e.data});case"session.world_state":return(0,t.jsx)(eA,{data:e.data});case"subagent.session_start":case"subagent.activity":case"subagent.message":return(0,t.jsx)(eq,{data:e.data,type:e.type});case"session.turn_aborted":return(0,t.jsx)(eB,{data:e.data});case"session.rollback":return(0,t.jsx)(eD,{data:e.data});case"session.plan_changed":return(0,t.jsx)(eI,{data:e.data});case"system.notification":return(0,t.jsx)(eL,{data:e.data});case"permission.requested":{let s=e.data.permissionRequest;return s?(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"text-orange-600 dark:text-orange-400 font-medium",children:s.kind})," ",s.intention]}):null}case"permission.completed":{let s=e.data.result;return s?(0,t.jsx)("div",{className:"text-xs",children:(0,t.jsx)("span",{className:"approved"===s.kind?"text-emerald-600 dark:text-emerald-400":"text-destructive",children:s.kind})}):null}default:return(0,t.jsx)(eE,{data:e.data})}}(),U=JSON.stringify(l&&d?[e,d]:e,null,2),O=d?.data.success===!1,P=d?ea(e.timestamp,d.timestamp):null,H=!!R;return(0,t.jsxs)("div",{"data-event-id":e.id,className:"relative scroll-mt-40 border-l-2 border-border pb-1.5 pl-6 last:border-l-transparent",children:[(0,t.jsx)("span",{className:`absolute -left-[5px] top-3 size-2 rounded-full border border-background ${L.dotCls}`,"aria-hidden":!0}),(0,t.jsxs)("div",{className:(0,G.cn)("relative overflow-hidden rounded-lg border border-border bg-card",n&&"border-l-2 border-l-amber-400 dark:border-l-amber-600",o&&"ring-2 ring-brand/60"),children:[c>0&&(0,t.jsx)("span",{className:"pointer-events-none absolute inset-y-0 left-0 w-[3px] bg-emerald-500",style:{opacity:Math.max(.12,c)},"aria-hidden":!0}),(0,t.jsxs)("button",{type:"button","data-event-row":!0,onClick:()=>{let e;return e=!_,$({nonce:r?.nonce??0,open:e})},"aria-expanded":_,className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-muted/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(M.ChevronRight,{className:(0,G.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",_&&"rotate-90"),"aria-hidden":!0}),(0,t.jsx)("span",{className:`max-w-[9rem] shrink-0 truncate rounded-sm px-1.5 py-0.5 font-mono text-[11px] font-semibold ${L.chipCls??k.typeCls}`,title:z.label,children:z.label}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground/90",children:z.preview}),z.delta&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] tabular-nums",title:"Lines written and replaced by this call",children:[(0,t.jsxs)("span",{className:"text-emerald-700 dark:text-emerald-400",children:["+",z.delta.added]}),z.delta.removed>0&&(0,t.jsxs)("span",{className:"ml-1 text-red-700 dark:text-red-400",children:["−",z.delta.removed]})]}),l&&(0,t.jsx)("span",{className:(0,G.cn)("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[11px] tabular-nums",O?"bg-red-100 text-red-700 dark:bg-red-900/60 dark:text-red-400":"bg-muted text-muted-foreground"),title:d?O?"The call failed":"Time from the call to its result":"No result was recorded for this call",children:d?O?"failed":null!==P&&P>=1e3?`${(P/1e3).toFixed(1)}s`:"done":"no result"}),A&&(0,t.jsxs)("span",{className:"hidden shrink-0 items-center gap-1.5 font-mono text-[11px] tabular-nums text-muted-foreground sm:inline-flex",title:`${A.input.toLocaleString()} input tokens \xb7 ${A.output.toLocaleString()} output tokens`,children:[A.input>0&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,t.jsx)(F.InputTokensIcon,{className:"size-3","aria-hidden":!0}),(0,t.jsx)("span",{className:"opacity-70",children:"in"})," ",eo(A.input)]}),A.output>0&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,t.jsx)(F.OutputTokensIcon,{className:"size-3","aria-hidden":!0}),(0,t.jsx)("span",{className:"opacity-70",children:"out"})," ",eo(A.output)]})]}),null!==D&&D>0&&(0,t.jsx)("span",{className:"hidden shrink-0 font-mono text-[11px] tabular-nums text-emerald-700 dark:text-emerald-400 sm:inline",title:"Estimated cost of this request at API list prices",children:(0,K.formatCost)(D)}),void 0!==i&&(0,t.jsxs)("span",{className:"hidden shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground md:inline",title:"Estimated cost of the session up to and including this request",children:["Σ ",(0,K.formatCost)(i)]}),u&&u.costUSD>0&&(0,t.jsxs)("span",{className:"hidden shrink-0 font-mono text-[11px] tabular-nums text-emerald-700 dark:text-emerald-400 sm:inline",title:`Estimated cost of the ${u.requests} ${1===u.requests?"request":"requests"} made to answer this prompt; ${(0,K.formatCost)(u.totalUSD)} for the session by the end of the turn`,children:["turn ",(0,K.formatCost)(u.costUSD)]}),null!==v&&v>5e3&&(0,t.jsxs)("span",{className:"hidden shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[11px] tabular-nums text-muted-foreground sm:inline",title:"Gap since the previous event",children:["+",v>6e4?`${(v/6e4).toFixed(1)}m`:`${(v/1e3).toFixed(1)}s`]}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",title:`${es(e.timestamp)}, ${et(e.timestamp)}`,children:et(e.timestamp)})]}),_&&(0,t.jsxs)("div",{className:"border-t border-border",children:[H?(0,t.jsx)("div",{className:"px-3 py-2.5",children:R}):(0,t.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:"No structured detail for this event — see the raw event below."}),(0,t.jsxs)("div",{className:"flex items-center gap-1 border-t border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)("span",{className:"mr-auto truncate pl-1 font-mono text-[11px] text-muted-foreground",children:l&&d?`${e.type} + ${d.type}`:e.type}),(0,t.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:()=>C(!w),"aria-expanded":w,className:"text-muted-foreground",children:[(0,t.jsx)(q.Info,{className:"size-3.5","aria-hidden":!0}),"About"]}),(0,t.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:()=>N(!y),"aria-expanded":y,className:"text-muted-foreground",children:[(0,t.jsx)(S,{className:"size-3.5","aria-hidden":!0}),y?"Hide raw":"Raw"]}),(0,t.jsx)(f.CopyButton,{value:()=>{let t=new URL(window.location.href);return t.search="",t.searchParams.set("event",e.id),t.toString()},label:"Copy a link to this event",icon:B,children:"Link"}),(0,t.jsx)(f.CopyButton,{value:U,label:"Copy raw JSON",children:"Copy"})]}),w&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/40 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:E}),y&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2.5",children:[(0,t.jsx)("p",{className:"mb-1.5 text-[11px] uppercase tracking-wide text-muted-foreground",children:"Raw event"}),(0,t.jsx)("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted p-2.5 font-mono text-xs leading-relaxed text-foreground [overflow-wrap:anywhere]",children:U})]})]})]})]})}function eH(e){return X[e]?.chipCls||"border-border bg-muted text-muted-foreground"}let eW=new Set(["system.message","context.attachment","session.world_state"]),eV=new Set(["tool.execution_start","external_tool.requested"]),eK=new Set(["tool.execution_complete","external_tool.completed"]),eJ=new Set(["user.message","assistant.thinking","assistant.message"]),eZ=["normal","compact","focused"];function eG(e){let t=Array.from(document.querySelectorAll("[data-event-row]")),s=t.indexOf(document.activeElement),a=-1===s?Math.max(0,t.findIndex(e=>e.getBoundingClientRect().top>160)):Math.min(t.length-1,Math.max(0,s+e));t[a]?.focus({preventScroll:!0}),t[a]?.scrollIntoView({block:"center"})}function eY(e){let{category:t}=er(e);return eH(t)}function eQ({events:e,focusRequest:a,targetEventId:r,live:n=!1,onLiveChange:o,running:l=!1}){let[d,i]=(0,Z.useQueryParam)("mode","normal"),[c,u]=(0,s.useState)(eZ.includes(d)?d:"normal");(0,s.useEffect)(()=>i(c),[c,i]);let[m,x]=(0,s.useState)("asc"),[h,g]=(0,s.useState)([]),[f,b]=(0,s.useState)([]),[j,k]=(0,s.useState)(""),[v,y]=(0,s.useState)(!0),[N,S]=(0,s.useState)(!1),[M,q]=(0,s.useState)(!1),[B,U]=(0,s.useState)(!1),O=(0,s.useRef)(null),[F,K]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=O.current;if(!e)return;let t=getComputedStyle(document.documentElement),s=parseFloat(t.getPropertyValue("--cv-topbar-h"))+parseFloat(t.getPropertyValue("--cv-tabbar-h")),a=new IntersectionObserver(([e])=>K(!e.isIntersecting&&e.boundingClientRect.top<s),{rootMargin:`-${s}px 0px 0px 0px`});return a.observe(e),()=>a.disconnect()},[]);let Y=(0,s.useRef)(null),[Q,X]=(0,s.useState)(0);(0,s.useEffect)(()=>{let e=Y.current;if(!e)return;let t=new ResizeObserver(()=>X(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]);let[ee,et]=(0,s.useState)(null),ea=(0,s.useMemo)(()=>e.map(e=>{let t=er(e.type);return{...e,category:t.category,subCategory:t.subCategory,subKey:`${t.category}.${t.subCategory}`}}),[e]),eo=(0,s.useMemo)(()=>V(e),[e]),el=(0,s.useMemo)(()=>{let t=new Set,s=null,a=()=>{s&&t.add(s),s=null};for(let r of e)"user.message"===r.type?(a(),t.add(r.id)):"assistant.message"===r.type&&String(r.data.content??"").trim()&&(s=r.id);return a(),t},[e]),ed=(0,s.useMemo)(()=>{let t=new Map,s=new Set,a=[];for(let r of e)if(eV.has(r.type))a.push(r);else if(eK.has(r.type)){let e=r.data.toolCallId,n=a.findIndex(t=>e?t.data.toolCallId===e:!t.data.toolCallId&&t.data.toolName===r.data.toolName);if(-1===n)continue;t.set(a[n].id,r),s.add(r.id),a.splice(n,1)}return{results:t,consumed:s}},[e]),ei=(0,s.useMemo)(()=>{let t=new Map,s=[],a=()=>{if(s.length>1){let e={key:s[0].id,size:s.length};for(let a of s)t.set(a.id,e)}s=[]};for(let t of e)eV.has(t.type)?s.push(t):a();return a(),t},[e]),ec=(0,s.useMemo)(()=>"normal"===c?ea:ea.filter(e=>"focused"===c?el.has(e.id):!ed.consumed.has(e.id)&&(eV.has(e.type)||eK.has(e.type)||eJ.has(e.type)&&("assistant.message"!==e.type||String(e.data.content??"").trim()))),[ea,c,el,ed]),eu=(0,s.useMemo)(()=>ec.some(e=>eW.has(e.type)),[ec]),em=(0,s.useMemo)(()=>ec.filter(e=>v||!eW.has(e.type)),[ec,v]),ex=(0,s.useMemo)(()=>{let e=new Map;for(let t of em){let s=e.get(t.category)??{count:0,typeCounts:new Map};s.count+=1,s.typeCounts.set(t.type,(s.typeCounts.get(t.type)||0)+1),e.set(t.category,s)}return Array.from(e.entries()).map(([e,t])=>{let s=Array.from(t.typeCounts.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))[0]?.[0];return{category:e,count:t.count,representativeType:s}}).sort((e,t)=>t.count-e.count||e.category.localeCompare(t.category))},[em]),ep=(0,s.useMemo)(()=>h.filter(e=>ex.some(t=>t.category===e)),[h,ex]),eh=(0,s.useMemo)(()=>{if(0===ep.length)return[];let e=new Set(ep),t=new Map;for(let s of em){if(!e.has(s.category))continue;let a=t.get(s.subKey);a?a.count+=1:t.set(s.subKey,{category:s.category,subCategory:s.subCategory,count:1})}return Array.from(t.values()).sort((e,t)=>t.count-e.count||e.subCategory.localeCompare(t.subCategory))},[em,ep]),eg=(0,s.useMemo)(()=>{let e=new Set(eh.map(e=>`${e.category}.${e.subCategory}`));return f.filter(t=>e.has(t))},[f,eh]),[ef,eb]=(0,s.useState)(null);a&&a!==ef&&(eb(a),g(a.categories??[]),b(a.subKeys??[]),k(a.search??""),q(a.failures??!1),((a.categories??[]).includes("system")||(a.subKeys??[]).includes("system.message"))&&y(!0),u("normal"),U(!0));let ej=(0,s.useMemo)(()=>{let e=new Set(ep),t=new Set(eg),s=j.toLowerCase().split(/\s+/).filter(Boolean),a=em.filter(a=>{if(e.size>0&&!e.has(a.category)||t.size>0&&!t.has(a.subKey)||N&&!function(e){let t=e.data,s=t.outputTokens;if("number"==typeof s&&s>0)return!0;let a=t.inputTokens;if("number"==typeof a&&a>0)return!0;let r=t.cacheReadTokens;if("number"==typeof r&&r>0)return!0;let n=t.tokenDetails;if(n){let e=n.input?.tokenCount??0,t=n.output?.tokenCount??0,s=n.cache_read?.tokenCount??0;if(e>0||t>0||s>0)return!0}return!1}(a)||M&&!en(a)&&!en(ed.results.get(a.id)))return!1;if(s.length>0){let e="compact"===c?ed.results.get(a.id):void 0,t=(JSON.stringify(a)+(e?JSON.stringify(e):"")).toLowerCase();return s.every(e=>t.includes(e))}return!0});return"desc"===m?a.reverse():a},[em,ep,eg,N,M,j,c,ed,m]),ek=`${ep.join()}|${eg.join()}|${j}|${v}|${N}|${M}|${c}|${m}`,[ev,ey]=(0,s.useState)({key:ek,count:150}),eN=r?ej.findIndex(e=>e.id===r):-1,ew=Math.max(ev.key===ek?ev.count:150,eN+1),eC=e=>ey({key:ek,count:e}),eS=n&&"asc"===m,eT=(0,s.useMemo)(()=>eS?ej.slice(-ew):ej.slice(0,ew),[ej,ew,eS]);(0,s.useEffect)(()=>{if(!eS)return;let e=requestAnimationFrame(()=>window.scrollTo({top:document.documentElement.scrollHeight}));return()=>cancelAnimationFrame(e)},[eS,e.length]),(0,s.useEffect)(()=>{r&&document.querySelector(`[data-event-id="${CSS.escape(r)}"]`)?.scrollIntoView({block:"center"})},[r]),(0,J.useHotkeys)({f:()=>u(e=>eZ[(eZ.indexOf(e)+1)%eZ.length]),o:()=>x(e=>"asc"===e?"desc":"asc"),l:o&&(()=>o(!n)),e:()=>et({nonce:Date.now(),mode:"open"}),E:()=>et({nonce:Date.now(),mode:"closed"}),j:()=>eG(1),k:()=>eG(-1)});let eM=(0,s.useMemo)(()=>{let e=[];for(let t of eT){let s=new Date(t.timestamp).toLocaleDateString([],{month:"short",day:"numeric"}),a=e[e.length-1];a&&a.date===s?a.events.push(t):e.push({date:s,fullDate:es(t.timestamp),events:[t]})}return e},[eT]),e$=ep.length+eg.length+ +!!N+ +!!M+(eu&&!v?1:0),e_=e$+ +!!j;function ez(){g([]),b([]),k(""),S(!1),q(!1),y(!0),u("normal")}let eA=ej.length-eT.length,eq=eA>0&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing ",eS?"the last ":"",eT.length.toLocaleString()," of ",ej.length.toLocaleString()," matching events"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:()=>eC(ew+150),children:["Load ",Math.min(150,eA)," ",eS?"earlier":"more"]}),(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",onClick:()=>eC(ej.length),className:"text-muted-foreground",children:"Show all"})]})]});return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{ref:O,"aria-hidden":!0}),(0,t.jsxs)("div",{ref:Y,className:(0,G.cn)("sticky top-[calc(var(--cv-topbar-h)+var(--cv-tabbar-h))] z-10 -mx-4 border-b bg-background/90 px-4 pt-1 pb-2.5 backdrop-blur transition-colors supports-[backdrop-filter]:bg-background/75 sm:-mx-6 sm:px-6",F?"border-border":"border-transparent"),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(H.SearchInput,{value:j,onChange:k,shortcut:!0,placeholder:"Search events…","aria-label":"Search events",className:"w-full sm:w-56"}),(0,t.jsx)(W.Segmented,{label:"Transcript view",size:"default",value:c,onChange:u,options:[{value:"normal",label:"Normal"},{value:"compact",label:"Compact"},{value:"focused",label:"Focused"}]}),(0,t.jsxs)(p.Button,{variant:"outline",onClick:()=>U(e=>!e),"aria-expanded":B,className:(0,G.cn)(e$>0?"border-foreground/25 bg-muted":"text-muted-foreground"),children:[(0,t.jsx)(E,{className:"size-3.5","aria-hidden":!0}),"Filters",e$>0&&(0,t.jsx)("span",{className:"rounded-sm bg-foreground/10 px-1 tabular-nums",children:e$}),(0,t.jsx)(T.default,{className:(0,G.cn)("size-3.5 transition-transform",B&&"rotate-180"),"aria-hidden":!0})]}),e_>0&&(0,t.jsxs)(p.Button,{variant:"ghost",onClick:ez,className:"text-muted-foreground",children:[(0,t.jsx)(R.X,{className:"size-3.5","aria-hidden":!0}),"Clear"]}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[o&&(0,t.jsx)(eX,{active:n,onClick:()=>o(!n),icon:I,label:"Follow live",title:l?"Follow the session: keep the newest events in view (l)":"Watch for new events and keep the newest in view (l)",pulse:l,iconOnly:!0}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsx)(p.Button,{variant:"outline",size:"icon",onClick:()=>x("asc"===m?"desc":"asc"),"aria-label":"asc"===m?"Show newest first":"Show oldest first",className:"text-muted-foreground",children:"asc"===m?(0,t.jsx)(w,{className:"size-3.5","aria-hidden":!0}):(0,t.jsx)(C,{className:"size-3.5","aria-hidden":!0})})}),(0,t.jsxs)(P.TooltipContent,{children:["asc"===m?"Oldest first":"Newest first"," (o)"]})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsx)(p.Button,{variant:"outline",size:"icon",onClick:()=>et({nonce:Date.now(),mode:"open"}),"aria-label":"Expand all events",className:"text-muted-foreground",children:(0,t.jsx)(_,{className:"size-3.5","aria-hidden":!0})})}),(0,t.jsx)(P.TooltipContent,{children:"Expand all"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsx)(p.Button,{variant:"outline",size:"icon",onClick:()=>et({nonce:Date.now(),mode:"closed"}),"aria-label":"Collapse all events",className:"text-muted-foreground",children:(0,t.jsx)($,{className:"size-3.5","aria-hidden":!0})})}),(0,t.jsx)(P.TooltipContent,{children:"Collapse all"})]}),(0,t.jsx)("span",{className:"ml-1 text-xs tabular-nums text-muted-foreground",children:ej.length===e.length?`${e.length} events`:`${ej.length} of ${e.length} events`})]})]}),B&&(0,t.jsxs)("div",{className:"mt-2.5 space-y-2 border-t border-border pt-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[eu&&(0,t.jsx)(eX,{active:!v,onClick:()=>y(!v),icon:A,label:"Hide context",title:"Hide system prompts, auto-attached context and world-state snapshots"}),(0,t.jsx)(eX,{active:N,onClick:()=>S(!N),icon:D,label:"Token events",title:"Show only events that report token usage"}),(0,t.jsx)(eX,{active:M,onClick:()=>q(!M),icon:z,label:"Failures",title:"Show only tool calls that failed"})]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:ex.map(({category:e,count:s,representativeType:a})=>{let r=ep.includes(e);return(0,t.jsxs)("button",{type:"button","aria-pressed":r,onClick:()=>g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:(0,G.cn)("inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-xs transition-all","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",a?eY(a):eH(e),r?"ring-2 ring-ring ring-offset-1 ring-offset-background":"opacity-70 hover:opacity-100"),children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("span",{className:"font-bold tabular-nums",children:s})]},e)})}),ep.length>0&&eh.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Sub-type"}),eh.map(({category:e,subCategory:s,count:a})=>{let r=`${e}.${s}`,n=eg.includes(r);return(0,t.jsxs)("button",{type:"button","aria-pressed":n,title:r,onClick:()=>b(e=>e.includes(r)?e.filter(e=>e!==r):[...e,r]),className:(0,G.cn)("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 font-mono text-xs transition-all","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",eY(r),n?"ring-2 ring-ring ring-offset-1 ring-offset-background":"opacity-70 hover:opacity-100"),children:[ep.length>1&&(0,t.jsxs)("span",{className:"opacity-70",children:[e,":"]}),(0,t.jsx)("span",{children:s}),(0,t.jsx)("span",{className:"font-bold tabular-nums",children:a})]},r)})]})]})]}),(0,t.jsxs)("div",{className:"pr-2",children:[eS&&eq,eM.map(e=>(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute inset-x-0 top-[27px] h-px bg-border","aria-hidden":!0}),(0,t.jsx)("div",{className:"pointer-events-none sticky z-[5] flex justify-center py-4",style:{top:`calc(var(--cv-topbar-h) + var(--cv-tabbar-h) + ${Q}px - 0.5rem)`},children:(0,t.jsx)("span",{className:"pointer-events-auto rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground shadow-sm",title:e.fullDate,children:e.date})}),e.events.map((a,n)=>{let o=ei.get(a.id),l=e.events["asc"===m?n-1:n+1],d=o&&ei.get(e.events[n-1]?.id)!==o;return(0,t.jsxs)(s.Fragment,{children:[d&&(0,t.jsxs)("div",{className:"border-l-2 border-border pb-1 pl-6 font-mono text-[11px] text-amber-700 dark:text-amber-400",children:["parallel · ",o.size," calls"]}),(0,t.jsx)(eF,{event:a,prevTimestamp:l?.timestamp,expandAll:ee,parallel:!!o,target:a.id===r,merged:"compact"===c&&eV.has(a.type),result:"compact"===c?ed.results.get(a.id):void 0,runningUSD:eo.runningUSD.get(a.id),costShare:eo.runningUSD.has(a.id)&&"number"==typeof a.data.costUSD?a.data.costUSD/eo.maxEventUSD:0,turn:eo.turnByPrompt.get(a.id)})]},a.id)})]},e.date)),!eS&&eq,0===ej.length&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 rounded-xl border border-dashed border-border px-6 py-14 text-center",children:[(0,t.jsx)("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(L,{className:"size-5","aria-hidden":!0})}),(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No events match your filters"}),(0,t.jsxs)("p",{className:"max-w-sm text-xs text-muted-foreground",children:[e.length.toLocaleString()," events are recorded in this session."]}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:ez,className:"mt-2",children:"Clear filters"})]})]})]})}function eX({active:e,onClick:s,icon:a,label:r,title:n,pulse:o=!1,iconOnly:l=!1}){return(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsxs)(O.Toggle,{variant:"outline",pressed:e,onPressedChange:s,"aria-label":l?r:void 0,className:(0,G.cn)("relative gap-1.5 text-muted-foreground aria-pressed:border-foreground/25 aria-pressed:text-foreground",l&&"px-0 aria-pressed:border-emerald-500/60 aria-pressed:text-emerald-600 dark:aria-pressed:text-emerald-400"),children:[(0,t.jsx)(a,{className:"size-3.5","aria-hidden":!0}),!l&&r,o&&(0,t.jsx)("span",{className:(0,G.cn)("size-1.5 animate-pulse rounded-full bg-emerald-500",l&&"absolute top-1 right-1"),"aria-hidden":!0})]})}),(0,t.jsx)(P.TooltipContent,{children:n})]})}var e0=e.i(35334);let e1=/(?<!<)<<(?!<)-?\s*(['"]?)([A-Za-z_]\w*)\1/g,e2=/^__heredoc_(\d+)__$/,e5=new Set(["sudo","command","env","time","nohup","exec","xargs"]),e4=/^(ba|z|da)?sh$/,e3=/^(python[\d.]*|node|bun|deno)$/,e7=e=>e.startsWith("-");function e6(e,t=/^-[a-zA-Z]*[ef]$|^--(expression|file)$/){let s=[],a=!1;for(let r=0;r<e.length;r++)t.test(e[r])?(a=!0,r++):e7(e[r])||""===e[r]||s.push(e[r]);return{files:s,scripted:a}}let e9=String.raw`(?:(['"\`])([^'"\`\n]+)\1|([A-Za-z_$][\w$]*))`,e8=[RegExp(String.raw`\bopen\(\s*${e9}\s*,\s*(?:mode\s*=\s*)?['"](?=[^'"]*[wax+])[rwaxbt+]+['"]`,"g"),RegExp(String.raw`\bPath\(\s*${e9}\s*\)\s*\.write_(?:text|bytes)\(`,"g"),RegExp(String.raw`\b(?:write|append)File(?:Sync)?\(\s*${e9}`,"g")],te=/^(\/dev\/|\/tmp\/|\/private\/tmp\/|\/var\/folders\/|\/private\/var\/folders\/)/,tt=e=>""!==e&&"-"!==e&&!/[$`*?{}]/.test(e)&&!e.startsWith("~")&&!te.test(e);function ts(e,t){if(t.startsWith("/")||!e)return t.replace(/^(\.\/)+/,"");let s=e.split("/");for(let e of t.split("/"))".."===e?s.pop():"."!==e&&""!==e&&s.push(e);return s.join("/")}let ta=["file_path","filePath","notebook_path","path","target_file"],tr=/^(edit|write|multiedit|notebookedit|update|create|patch|apply_patch|replace|search_replace|str_replace\w*|(copilot_)?(write|edit|create|replace|insert)\w*(file|string|edit|notebook)\w*)$/i,tn=/^(bash|sh|zsh|shell|exec|exec_command|shell_command|local_shell|terminal|run_in_terminal|run_terminal_cmd|run_terminal_command\w*|run_shell_command|run_command|execute_command|container\.exec)$/i,to=/^\*\*\* (?:Add|Update|Delete) File: (.+)$/gm,tl=e=>[...new Set([...e.matchAll(to)].map(e=>e[1].trim()))];function td(e,t){let s=new Set;for(let t of e)"file.patch_applied"===t.type&&t.data.callId&&s.add(t.data.callId);let a=[],r={turn:0,timestamp:e[0]?.timestamp??"",files:[],edits:0},n=0,o=(e,t,s)=>{0===r.files.length&&a.push(r),r.edits++;let n=r.files.find(e=>e.path===t);n?(n.count++,n.tools.includes(s)||n.tools.push(s)):r.files.push({path:t,count:1,tools:[s],eventId:e.id})};for(let a of e)if("user.message"===a.type)r={turn:++n,prompt:"string"==typeof a.data.content?a.data.content:void 0,promptEventId:a.id,timestamp:a.timestamp,files:[],edits:0};else if("file.patch_applied"===a.type){if(!1===a.data.success)continue;for(let e of a.data.changes??[])e?.file&&o(a,e.file,"patch")}else if("tool.execution_start"===a.type){let e=function(e){let t=e.toolName??e.name;return"string"==typeof t?t:""}(a.data);if(s.has(a.data.toolCallId))continue;for(let s of tr.test(e)?function(e){let t=e.arguments,s=t&&"object"==typeof t?t:{};for(let e of ta){let t=s[e];if("string"==typeof t&&t)return[t]}let a="string"==typeof t?t:s.input??s.patch??s.patchText;return"string"!=typeof a?[]:tl(a)}(a.data):tn.test(e)?function(e,t){let s=function(e){let t=e.arguments;if("string"==typeof t)return t;let s=t&&"object"==typeof t?t:{},a=s.command??s.cmd??s.script??s.input;return"string"==typeof a?a:Array.isArray(a)&&a.every(e=>"string"==typeof e)?/^-l?c$/.test(a[1]??"")&&3===a.length?a[2]:a.join(" "):void 0}(e);if(!s)return[];let a=tl(s);return a.length>0?a:function e(t,s){let{shell:a,bodies:r}=function(e){let t=[],s=[],a=e.split("\n");for(let e=0;e<a.length;e++){let r=[];for(let n of(t.push(a[e].replace(e1,(e,t,a)=>(r.push(a),`<<__heredoc_${s.length+r.length-1}__`))),r)){let t=[];for(;++e<a.length&&a[e].trim()!==n;)t.push(a[e]);s.push(t.join("\n"))}}return{shell:t.join("\n"),bodies:s}}(t),n=new Set,o=s?.replace(/\/+$/,""),l=e=>{if(!tt(e))return;let t=ts(o,e);te.test(t)||n.add(t)};for(let{words:t,writes:s,inputs:d}of function(e){let t=[],s={words:[],writes:[],inputs:[]},a=null,r="words",n=()=>{null!==a&&(s[r].push(a),a=null,r="words")},o=()=>{n(),(s.words.length>0||s.writes.length>0)&&t.push(s),s={words:[],writes:[],inputs:[]},r="words"};for(let t=0;t<e.length;t++){let s=e[t];if("\\"===s)"\n"!==e[++t]&&(a=(a??"")+(e[t]??""));else if("'"===s){let s=e.indexOf("'",t+1),r=s<0?e.length:s;a=(a??"")+e.slice(t+1,r),t=r}else if('"'===s){let s="";for(t++;t<e.length&&'"'!==e[t];t++)"\\"===e[t]&&t+1<e.length&&t++,s+=e[t];a=(a??"")+s}else if(" "===s||" "===s)n();else if("#"===s&&null===a)for(;t+1<e.length&&"\n"!==e[t+1];)t++;else if("&"===s&&">"===e[t+1])n();else if("\n"===s||";"===s||"|"===s||"&"===s||"("===s||")"===s)o();else if(">"===s){if(null!==a&&/^\d+$/.test(a)?a=null:n(),(">"===e[t+1]||"|"===e[t+1])&&t++,"&"===e[t+1]){t++;let s=/^[\d-]+/.exec(e.slice(t+1));if(s){t+=s[0].length;continue}}r="writes"}else if("<"===s){for(n();"<"===e[t+1]||"-"===e[t+1];)t++;r="inputs"}else a=(a??"")+s}return o(),t}(a)){let a=0;for(;a<t.length&&(/^\w+=/.test(t[a])||e5.has(t[a]));)a++;let i=t[a]?.split("/").pop()??"",c=t.slice(a+1),u=d.flatMap(e=>r[Number(e2.exec(e)?.[1])]??[]);if("cd"===i)c[0]&&tt(c[0])&&(c[0].startsWith("/")||o)&&(o=ts(o,c[0]));else if(e4.test(i)){let t=c.findIndex(e=>/^-[a-zA-Z]*c$/.test(e));for(let s of t>=0?[c[t+1]??""]:u)e(s,o).forEach(e=>n.add(e))}else if(e3.test(i))for(let e of[...c,...u])(function(e){let t=[];for(let s of e8)for(let a of e.matchAll(s)){let s=a[2]??function(e,t,s){let a,r=t.replace(/\$/g,"\\$"),n=RegExp(String.raw`(?<![\w$.])${r}\s*=\s*(['"])([^'"\n]+)\1`,"g");for(let t of e.slice(0,s).matchAll(n))a=t[2];return a}(e,a[3],a.index);s&&t.push({index:a.index,path:s})}return t.sort((e,t)=>e.index-t.index).map(e=>e.path)})(e).forEach(l);else(function(e,t){"git"===e&&("mv"===t[0]||"rm"===t[0])&&(e=t[0],t=t.slice(1));let s=t.some(e=>/^-[a-zA-Z]*[rR]/.test(e)||"--recursive"===e);switch(e){case"tee":case"touch":case"mv":return e6(t).files;case"sed":case"gsed":{if(!t.some(e=>/^-[a-zA-Z]*i/.test(e)||e.startsWith("--in-place")))return[];let{files:e,scripted:s}=e6(t);return s?e:e.slice(1)}case"perl":if(!t.some(e=>/^-[a-zA-Z]*i/.test(e)))return[];return e6(t,/^-[a-zA-Z]*e$/).files;case"rm":return s?[]:e6(t).files;case"cp":return s?[]:e6(t).files.slice(-1);default:return[]}})(i,c).forEach(l);s.forEach(l)}return[...n]}(s,t)}(a.data,t):[])o(a,s,e)}return a}let ti=(e,t)=>`${e.toLocaleString()} ${t}${1===e?"":"s"}`;function tc({events:e,cwd:a,onOpenEvent:r}){let[n,o]=(0,s.useState)(""),l=(0,s.useMemo)(()=>td(e,a),[e,a]),d=n.trim().toLowerCase(),c=(0,s.useMemo)(()=>d?l.map(e=>({...e,files:e.files.filter(e=>e.path.toLowerCase().includes(d))})).filter(e=>e.files.length>0):l,[l,d]);if(0===l.length)return(0,t.jsx)(e0.EmptyState,{icon:i,title:"No file edits",description:"Files appear here, grouped by prompt, when the agent writes, edits or patches one, or changes one from the shell."});let u=a?`${a.replace(/[\\/]+$/,"")}/`:null,m=new Set(l.flatMap(e=>e.files.map(e=>e.path))).size,x=l.reduce((e,t)=>e+t.edits,0);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[m>8&&(0,t.jsx)(H.SearchInput,{value:n,onChange:o,placeholder:"Filter files…","aria-label":"Filter edited files",className:"w-full max-w-sm"}),(0,t.jsxs)("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground",children:[ti(m,"file")," · ",ti(x,"edit")," · ",ti(l.length,"turn")]})]}),c.map(e=>(0,t.jsxs)("section",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,t.jsxs)("header",{className:"flex items-baseline gap-3 border-b border-border bg-muted/40 px-3 py-2",children:[(0,t.jsx)("span",{className:"shrink-0 text-xs font-medium tabular-nums text-muted-foreground",children:e.turn>0?`Turn ${e.turn}`:"Start"}),e.promptEventId?(0,t.jsx)("button",{type:"button",onClick:()=>r(e.promptEventId),title:"Open this prompt in the timeline",className:"min-w-0 flex-1 truncate rounded-sm text-left text-sm font-medium hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:(0,K.firstLine)(e.prompt)??"Prompt"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:"Before the first prompt"}),(0,t.jsxs)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[ti(e.files.length,"file")," · ",(0,K.formatDateTime)(e.timestamp)]})]}),(0,t.jsx)("ul",{children:e.files.map(e=>{let s;return(0,t.jsxs)("li",{className:"group flex items-center gap-3 border-b border-border/60 px-3 py-2 text-sm last:border-b-0 hover:bg-muted/50",children:[(0,t.jsx)("button",{type:"button",onClick:()=>r(e.eventId),title:`${e.path}
|
|
2
|
-
Open the edit in the timeline`,className:"min-w-0 flex-1 truncate rounded-sm text-left font-mono text-[13px] hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:(s=e.path,u&&s.startsWith(u)?s.slice(u.length):s)}),(0,t.jsx)("span",{className:"opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:(0,t.jsx)(f.CopyButton,{value:e.path,label:"Copy path"})}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:e.tools.join(", ")}),(0,t.jsx)("span",{className:"w-8 shrink-0 text-right text-xs tabular-nums text-muted-foreground",children:e.count>1?`\xd7${e.count}`:""})]},e.path)})})]},e.promptEventId??"start")),0===c.length&&(0,t.jsxs)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:["No files match “",n,"”"]})]})}var tu=e.i(50267);let tm=(0,n.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]),tx=(0,n.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var tp=e.i(56248);let th=(0,n.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),tg=(0,n.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);var tf=e.i(93125),tb=e.i(99160),tj=e.i(75858),tk=e.i(76639),tv=e.i(84774);let ty={input:"Uncached input",cacheWrite:"Cache write",cacheWrite1h:"Cache write (1h)",cacheRead:"Cache read",output:"Output"},tN=[["Uncached input","new prompt text the model had not seen before."],["Cache write","context stored so later requests can reuse it. A 1-hour cache costs more to write than the default."],["Cache read","stored context reused at a discount. The whole conversation is re-sent on every request, so this grows fastest in long sessions."],["Output","the model's replies, tool calls and reasoning."]];function tw({cost:e,totalLabel:a}){let r=e.byModel.length>1,n=e.unpricedModels.length>0;return(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border",children:(0,t.jsxs)(tv.Table,{className:"text-xs",children:[(0,t.jsx)(tv.TableHeader,{children:(0,t.jsxs)(tv.TableRow,{className:"bg-muted/60 hover:bg-muted/60",children:[(0,t.jsx)(tv.TableHead,{className:"h-8 px-3 text-muted-foreground",children:"Token type"}),(0,t.jsx)(tv.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Tokens"}),(0,t.jsx)(tv.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Rate / 1M"}),(0,t.jsx)(tv.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Cost"})]})}),(0,t.jsx)(tv.TableBody,{className:"tabular-nums",children:e.byModel.map(a=>(0,t.jsxs)(s.Fragment,{children:[(0,t.jsxs)(tv.TableRow,{className:"bg-muted/30 hover:bg-muted/30",children:[(0,t.jsx)(tv.TableHead,{colSpan:3,scope:"rowgroup",className:"h-auto px-3 py-1.5 font-mono font-semibold",children:a.model}),(0,t.jsx)(tv.TableCell,{className:"px-3 py-1.5 text-right font-mono font-semibold text-foreground",children:r&&null!==a.costUSD&&(0,K.formatCost)(a.costUSD)})]}),e.lines.filter(e=>e.model===a.model).map(e=>{var s;return(0,t.jsxs)(tv.TableRow,{className:"border-border/60",children:[(0,t.jsx)(tv.TableCell,{className:"px-3 py-1.5 text-foreground",children:ty[e.kind]}),(0,t.jsx)(tv.TableCell,{className:"px-3 py-1.5 text-right font-mono",children:e.tokens.toLocaleString()}),(0,t.jsx)(tv.TableCell,{className:"px-3 py-1.5 text-right font-mono",children:null===e.rate?"—":(s=e.rate,`$${s.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})}`)}),(0,t.jsx)(tv.TableCell,{className:"px-3 py-1.5 text-right font-mono text-foreground",children:null===e.usd?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:"no price"}):(0,K.formatCost)(e.usd)})]},`${e.kind}-${e.rate}`)})]},a.model))}),(0,t.jsx)(tv.TableFooter,{className:"bg-muted/60",children:(0,t.jsxs)(tv.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(tv.TableHead,{colSpan:3,scope:"row",className:"h-auto px-3 py-2 font-semibold",children:a}),(0,t.jsxs)(tv.TableCell,{className:"px-3 py-2 text-right font-mono font-bold tabular-nums text-foreground",children:[(0,K.formatCost)(e.totalUSD),n&&"+"]})]})})]})})}function tC({cost:e,open:a,onOpenChange:r}){let n,o=e.unpricedModels.length>0,l=(n=Object.entries(e.prices).map(([e,t])=>{let s=(t??[{input:0,output:0}]).map(e=>` ${JSON.stringify(e).replace(/([{,:])/g,"$1 ").replace("}"," }")}`).join(",\n");return` ${JSON.stringify(e)}: [
|
|
3
|
-
${s}
|
|
4
|
-
]`}),`{
|
|
5
|
-
${n.join(",\n")}
|
|
6
|
-
}`),[d,i]=(0,s.useState)(o);return(0,t.jsx)(tk.Dialog,{open:a,onOpenChange:r,children:(0,t.jsxs)(tk.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(tk.DialogTitle,{children:"How this cost is estimated"}),(0,t.jsx)(tk.DialogDescription,{children:"This is what the session’s tokens would cost on the pay-per-token API at list prices. It is not a bill: on a subscription or a request-based plan you pay your plan price, however many tokens a session uses."})]}),(0,t.jsx)(tw,{cost:e,totalLabel:e.inherited?"This session":"Total"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Each row is tokens ÷ 1,000,000 × rate, using the list price on the day of the request.",o&&(0,t.jsxs)(t.Fragment,{children:[" ","No price is known for ",e.unpricedModels.join(", "),", so the total leaves ",e.unpricedModels.length>1?"them":"it"," out."]})]}),e.inherited&&(0,t.jsxs)("div",{className:"space-y-2 border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:"Inherited from the forked session"}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"This session is a fork, so it opens with a copy of its parent’s history. Those requests were made, and are counted, in the parent session; they are listed here for reference and are not part of this session’s cost or of any usage total."})]}),(0,t.jsx)(tw,{cost:e.inherited,totalLabel:"Inherited"})]}),(0,t.jsx)("dl",{className:"space-y-1.5 border-t border-border pt-3 text-xs leading-relaxed text-muted-foreground",children:tN.map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"inline font-medium text-foreground",children:[e,": "]}),(0,t.jsx)("dd",{className:"inline",children:s})]},e))}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card text-xs",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!d),"aria-expanded":d,"aria-controls":"cost-dialog-prices",className:"flex w-full items-center gap-2 px-3 py-2 text-left font-medium text-foreground transition-colors hover:bg-muted/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(M.ChevronRight,{className:(0,G.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",d&&"rotate-90"),"aria-hidden":!0}),o?"Add the missing price":"Change these prices"]}),(0,t.jsxs)("div",{id:"cost-dialog-prices",hidden:!d,className:"space-y-2 border-t border-border px-3 py-3 leading-relaxed text-muted-foreground",children:[(0,t.jsxs)("p",{children:["Save the block below as"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:e.overridePath})," ","and edit the numbers. It replaces the bundled price for the models it lists and takes effect on the next page load."]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg border border-border bg-muted/50 p-3 pr-10 font-mono text-[11px] leading-relaxed text-foreground",children:l}),(0,t.jsx)(f.CopyButton,{value:l,label:"Copy pricing.json",className:"absolute top-1.5 right-1.5"})]}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-4",children:[(0,t.jsx)("li",{children:"All prices are US dollars per million tokens."}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"font-mono text-foreground",children:"input"})," and"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"output"})," are required. ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheRead"}),","," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite"})," and"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite1h"})," ","are optional: the first two fall back to the input price, and ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite1h"})," ","to ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite"}),"."," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"fast"})," multiplies every price for requests made in a faster, premium speed tier."]}),(0,t.jsxs)("li",{children:["To record a price change, add a second entry with"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:'"from": "YYYY-MM-DD"'}),". Requests before that day keep the old price."]})]})]})]})]})})}let tS=(0,n.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var tT=e.i(26162),tM=e.i(82183),t$=e.i(9449);function t_({health:e,open:s,onOpenChange:a,onFocus:r}){return(0,t.jsx)(tk.Dialog,{open:s,onOpenChange:a,children:(0,t.jsxs)(tk.DialogContent,{children:[(0,t.jsx)(tk.DialogTitle,{children:"Session health"}),(0,t.jsx)(tk.DialogDescription,{children:"A rule-based score read straight off the transcript. It measures how smoothly the session ran, not whether the result was any good."}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(tM.GradeBadge,{grade:e.grade,className:"h-12 min-w-12 rounded-lg text-2xl"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-2xl font-bold leading-none tabular-nums",children:e.score}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"/ 100"}),(0,t.jsx)("span",{className:"ml-auto text-xs font-medium",children:t$.OUTCOME_LABELS[e.outcome]})]}),(0,t.jsx)("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:(0,G.cn)("h-full rounded-full",t$.GRADE_STYLES[e.grade].bar),style:{width:`${e.score}%`}})})]})]}),0===e.signals.length?(0,t.jsxs)("div",{className:"flex items-center gap-2.5 rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 dark:border-emerald-900 dark:bg-emerald-950/30",children:[(0,t.jsx)(tT.CheckCircle2,{className:"size-4 shrink-0 text-emerald-600 dark:text-emerald-400","aria-hidden":!0}),(0,t.jsxs)("p",{className:"text-sm",children:["Nothing went wrong. ",t$.OUTCOME_NOTES[e.outcome]]})]}):(0,t.jsx)("ul",{className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.signals.map(s=>{let n=t$.SIGNAL_INFO[s.id];return(0,t.jsxs)("li",{className:"px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:"outcome"===s.id?t$.OUTCOME_LABELS[e.outcome]:n.label}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs font-semibold tabular-nums text-red-600 dark:text-red-400",children:["−",s.penalty]})]}),(0,t.jsxs)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:[n.describe(s,e)," ",n.advice]}),n.focus&&r&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>{a(!1),n.focus&&r(n.focus)},children:["View related events",(0,t.jsx)(tS,{"data-icon":"inline-end","aria-hidden":!0})]})]},s.id)})}),(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["Every session starts at 100 and loses points for each signal above. 90 and up is an A, 80 a B, 70 a C, 60 a D; anything lower is an F.",e.toolResults>0&&0===e.toolFailures&&(0,t.jsxs)(t.Fragment,{children:[" All ",e.toolResults.toLocaleString()," tool results succeeded."]})]})]})})}var tz=e.i(46816),tA=e.i(48209);function tq(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function tB({meta:e}){let[a,r]=(0,s.useState)(!1);async function n(){try{let t=await fetch(`/api/sessions/${e.provider}/${encodeURIComponent(e.id)}/reveal`,{method:"POST"});r(!t.ok)}catch{r(!0)}}return(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:n,className:(0,G.cn)("text-muted-foreground",a&&"text-destructive"),children:[(0,t.jsx)(tg,{className:"size-3.5","aria-hidden":!0}),"Reveal"]})}),(0,t.jsx)(P.TooltipContent,{children:a?"Could not open a file manager here. Copy the path instead.":"Show this session's files in the file manager"})]})}function tD({meta:e,storagePath:r,revealable:n=!1,stats:o,cost:l,activeMs:d,running:i=!1,onFocusEvents:c}){let u=(0,K.firstLine)(e.name),m=e.title??u,x=e.title?u:void 0,[p,h]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!1),j=e.health,k=(0,tz.providerStyle)(e.provider),v=(0,tA.resumeCommand)(e),y=o?.totalInputTokens??0,N=o?.totalOutputTokens??0,w=o?.totalCacheReadTokens??0,C=y+N+w;return(0,t.jsx)("div",{className:"border-b border-border bg-card/40",children:(0,t.jsxs)("div",{className:"mx-auto max-w-6xl px-4 py-5 sm:px-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h1",{className:"text-lg font-bold leading-tight text-foreground sm:text-xl",children:m??(0,t.jsx)("span",{className:"font-normal italic text-muted-foreground",children:"Unnamed session"})}),x&&(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:x}),(0,t.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground",children:e.id}),(0,t.jsx)(f.CopyButton,{value:e.id,label:"Copy session id"}),v&&(0,t.jsx)(f.CopyButton,{value:v,label:"Copy the command that resumes this session in a terminal",icon:tb.Terminal,className:"ml-1",children:"Resume"}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.CopyButton,{value:r,label:`Copy where this session is stored: ${r}`,icon:th,children:"Path"}),n&&(0,t.jsx)(tB,{meta:e})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end",children:[i&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-300 bg-emerald-50 px-2.5 py-0.5 text-xs font-medium text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300",children:[(0,t.jsx)("span",{className:"size-1.5 animate-pulse rounded-full bg-emerald-500","aria-hidden":!0}),"Running"]}),(0,t.jsxs)("span",{className:(0,G.cn)("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium",k.badgeCls),children:[(0,t.jsx)("span",{className:(0,G.cn)("size-1.5 rounded-full",k.dotCls),"aria-hidden":!0}),k.label]}),e.model&&(0,t.jsx)(U.Badge,{variant:"secondary",className:"font-mono",children:e.model}),e.client_name&&(0,t.jsx)(U.Badge,{variant:"secondary",children:e.client_name}),e.host_type&&(0,t.jsx)(U.Badge,{variant:"outline",children:e.host_type})]})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground",children:[e.project&&(0,t.jsxs)(a.default,{href:`/?tab=sessions&project=${encodeURIComponent(e.project)}`,title:e.projectPath,className:"inline-flex min-w-0 items-center gap-1.5 rounded-sm hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(tp.FolderGit2,{className:"size-3.5 shrink-0 opacity-70","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium text-foreground/80",children:e.project})]}),e.repository&&(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)(tx,{className:"size-3.5 shrink-0 opacity-70","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-mono text-foreground/80",children:e.repository})]}),e.branch&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(tf.GitBranch,{className:"size-3.5 opacity-70","aria-hidden":!0}),(0,t.jsx)("span",{className:"font-mono",children:e.branch})]}),e.created_at&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(tu.CalendarDays,{className:"size-3.5 opacity-70","aria-hidden":!0}),(0,K.formatFullDateTime)(e.created_at)]}),e.updated_at&&(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{render:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(tm,{className:"size-3.5 opacity-70","aria-hidden":!0}),"Updated ",(0,K.timeAgo)(e.updated_at)]})}),(0,t.jsx)(P.TooltipContent,{children:(0,K.formatFullDateTime)(e.updated_at)})]})]}),o&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)(tj.StatCardGrid,{children:[(0,t.jsx)(tj.StatCard,{label:"Events",value:o.eventCount.toLocaleString(),sub:"recorded in session"}),(0,t.jsx)(tj.StatCard,{label:"Messages",value:(o.totalUserMessages+o.totalAssistantMessages).toLocaleString(),sub:`${o.totalUserMessages} user \xb7 ${o.totalAssistantMessages} assistant`}),(0,t.jsx)(tj.StatCard,{label:"Tool calls",value:o.totalToolCalls.toLocaleString(),sub:"local + external"}),(0,t.jsx)(tj.StatCard,{label:"Total tokens",value:C>0?tq(C):"—",sub:"in + out + cache",accent:!0}),l&&(l.inherited||l.byModel.some(e=>null!==e.costUSD))&&(0,t.jsx)(tj.StatCard,{label:"Est. cost",value:`${(0,K.formatCost)(l.totalUSD)}${l.unpricedModels.length>0?"+":""}`,sub:l.unpricedModels.length>0?`excludes ${l.unpricedModels.join(", ")}`:l.inherited?`+ ${(0,K.formatCost)(l.inherited.totalUSD)} inherited`:"at API list prices",onClick:()=>h(!0)}),j&&(0,t.jsx)(tj.StatCard,{label:"Health",value:(0,t$.healthSummary)(j),sub:j.signals.length>0?`${t$.OUTCOME_LABELS[j.outcome].toLowerCase()} \xb7 ${j.signals.length} signal${1===j.signals.length?"":"s"}`:t$.OUTCOME_LABELS[j.outcome].toLowerCase(),onClick:()=>b(!0)}),y>0&&(0,t.jsx)(tj.StatCard,{label:"Input tokens",value:tq(y),sub:"fresh input"}),N>0&&(0,t.jsx)(tj.StatCard,{label:"Output tokens",value:tq(N),sub:"generated"}),w>0&&(0,t.jsx)(tj.StatCard,{label:"Cache reads",value:tq(w),sub:"reused context"}),o.totalPremiumRequests>0&&(0,t.jsx)(tj.StatCard,{label:"Premium req",value:o.totalPremiumRequests.toLocaleString(),sub:"billed requests"}),o.totalApiDurationMs>0&&(0,t.jsx)(tj.StatCard,{label:"API time",value:(0,K.formatDuration)(o.totalApiDurationMs),sub:"waiting on the model"}),null!=d&&d>0&&(0,t.jsx)(tj.StatCard,{label:"Time span",value:(0,K.formatDuration)(d),sub:"first to last event"})]}),l&&(0,t.jsx)(tC,{cost:l,open:p,onOpenChange:h}),j&&(0,t.jsx)(t_,{health:j,open:g,onOpenChange:b,onFocus:c})]})]})})}var tI=e.i(28735),tL=e.i(10976),tL=tL,tE=e.i(93472),tR=e.i(19390);function tU({events:e,partial:a,onOpenEvent:r}){let{turns:n,totalUSD:o}=(0,s.useMemo)(()=>V(e),[e]),[l,d]=(0,s.useState)(null);if(n.length<2||o<=0)return null;let i=null!==l&&l<n.length?l:null,c=(0,tR.niceCeil)(Math.max(...n.map(e=>e.costUSD))),u=(0,tR.niceCeil)(o),m=n.reduce((e,t)=>t.costUSD>e.costUSD?t:e),x=e=>`${Math.round(e/o*100)}%`,p=e=>0===e?"Before the first prompt":`Turn ${e}`,h=Math.floor((n.length-1)/2),g=null===i?null:n[i],f=n.reduce((e,t,s)=>`${e} H${s+.5} V${100-t.totalUSD/u*100}`,"M0,100")+` H${n.length}`;return(0,t.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5",children:[(0,t.jsx)("div",{className:"mb-4 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground",children:["Cost by turn",(0,t.jsx)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:"a turn is one prompt and everything the agent did to answer it"})]})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("div",{className:"flex h-40 flex-col justify-between text-right text-[10px] leading-none tabular-nums text-emerald-700 dark:text-emerald-400",children:[(0,t.jsx)("span",{children:(0,K.formatCost)(c)}),(0,t.jsx)("span",{children:(0,K.formatCost)(c/2)}),(0,t.jsx)("span",{children:"$0"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:(0,G.cn)("relative flex h-40 items-end border-b border-border",n.length>80?"gap-0":"gap-[2px]"),onMouseLeave:()=>d(null),children:[(0,t.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-0 border-t border-dashed border-border"}),(0,t.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-1/2 border-t border-dashed border-border"}),n.map((e,s)=>(0,t.jsxs)("button",{type:"button",onMouseEnter:()=>d(s),onFocus:()=>d(s),onBlur:()=>d(null),onClick:()=>r(e.eventId),"aria-label":`${p(e.turn)}: ${(0,K.formatCost)(e.costUSD)}, ${(0,K.formatCost)(e.totalUSD)} so far. Open in the timeline.`,className:(0,G.cn)("relative flex h-full min-w-0 flex-1 cursor-pointer flex-col justify-end focus-visible:outline-2 focus-visible:outline-ring",null!==i&&i!==s&&"opacity-50"),children:[e.compacted&&(0,t.jsx)("span",{className:"absolute top-1 left-1/2 size-1.5 -translate-x-1/2 rotate-45 bg-amber-500","aria-hidden":!0}),(0,t.jsx)("span",{className:"w-full rounded-t-[3px] bg-emerald-500/60 dark:bg-emerald-500/50",style:{height:`${e.costUSD/c*100}%`,minHeight:2*(e.costUSD>0)}})]},e.eventId)),(0,t.jsx)("svg",{className:"pointer-events-none absolute inset-0 size-full overflow-visible text-foreground",viewBox:`0 0 ${n.length} 100`,preserveAspectRatio:"none","aria-hidden":!0,children:(0,t.jsx)("path",{d:f,fill:"none",stroke:"currentColor",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"})})]}),(0,t.jsxs)("div",{className:"mt-1.5 flex justify-between text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:p(n[0].turn)}),n.length>4&&(0,t.jsx)("span",{children:n[h].turn}),(0,t.jsx)("span",{children:n[n.length-1].turn})]})]}),(0,t.jsxs)("div",{className:"flex h-40 flex-col justify-between text-[10px] leading-none tabular-nums text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,K.formatCost)(u)}),(0,t.jsx)("span",{children:(0,K.formatCost)(u/2)}),(0,t.jsx)("span",{children:"$0"})]})]}),(0,t.jsxs)("div",{className:"mt-3 space-y-1 text-xs","aria-live":"polite",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5",children:[(0,t.jsxs)("span",{className:"font-medium tabular-nums",children:[g?p(g.turn):"Whole session"," ·"," ",(0,K.formatCost)(g?g.costUSD:o),!g&&a&&"+"]}),g?(0,t.jsxs)("span",{className:"tabular-nums text-muted-foreground",children:[x(g.costUSD)," of the session · ",g.requests," ",1===g.requests?"request":"requests"," ·"," ",(0,K.formatCost)(g.totalUSD)," so far",g.compacted&&" · context compacted"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)("span",{className:"size-2.5 rounded-[3px] bg-emerald-500/60","aria-hidden":!0}),"cost of the turn (left axis)"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)("span",{className:"w-3 border-t-2 border-foreground","aria-hidden":!0}),"running total (right axis)"]}),n.some(e=>e.compacted)&&(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)("span",{className:"size-1.5 rotate-45 bg-amber-500","aria-hidden":!0}),"context compacted"]})]})]}),(0,t.jsx)("p",{className:"truncate text-muted-foreground",children:g?(0,K.firstLine)(g.prompt)??"Requests made before the first prompt.":`${p(m.turn)} cost the most: ${(0,K.formatCost)(m.costUSD)}, ${x(m.costUSD)} of the session. Click a bar to open its turn in the timeline.`})]})]})}let tO={high:{label:"High impact",Icon:tL.default,card:"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950/30",icon:"text-red-600 dark:text-red-400"},medium:{label:"Medium impact",Icon:tL.default,card:"border-amber-200 bg-amber-50 dark:border-amber-900 dark:bg-amber-950/30",icon:"text-amber-600 dark:text-amber-400"},low:{label:"Info",Icon:q.Info,card:"border-emerald-200 bg-emerald-50 dark:border-emerald-900 dark:bg-emerald-950/30",icon:"text-emerald-600 dark:text-emerald-400"}},tP=["high","medium","low"];function tF({cost:e}){let[a,r]=(0,s.useState)(!1);if(0===e.byModel.length)return null;let n=[{label:"Output",note:"replies + reasoning",usd:e.breakdown.output,bar:"bg-sky-400 dark:bg-sky-500"},{label:"Cache writes",note:"new context stored",usd:e.breakdown.cacheWrite,bar:"bg-amber-400 dark:bg-amber-500"},{label:"Cache reads",note:"context re-sent each turn",usd:e.breakdown.cacheRead,bar:"bg-emerald-400 dark:bg-emerald-500"},{label:"Uncached input",usd:e.breakdown.input,bar:"bg-red-400 dark:bg-red-500"}].filter(e=>e.usd>0),o=e.byModel.reduce((e,t)=>e+t.cacheReadTokens,0),l=e.byModel.reduce((e,t)=>e+t.inputTokens+t.cacheWriteTokens+t.cacheReadTokens,0),d=e.unpricedModels.length>0;return(0,t.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5",children:[(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Estimated cost"}),(0,t.jsxs)("span",{className:"font-mono text-lg font-bold tabular-nums text-foreground",children:[(0,K.formatCost)(e.totalUSD),d&&"+"]})]}),e.totalUSD>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mb-4 flex h-2.5 overflow-hidden rounded-full bg-muted",children:n.map(({label:s,usd:a,bar:r})=>(0,t.jsx)("div",{className:r,style:{width:`${a/e.totalUSD*100}%`}},s))}),(0,t.jsx)("div",{className:"grid gap-x-6 gap-y-2 sm:grid-cols-2",children:n.map(({label:s,note:a,usd:r,bar:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:(0,G.cn)("size-2 shrink-0 rounded-full",n),"aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:[s,a&&(0,t.jsxs)("span",{className:"ml-1 hidden text-muted-foreground sm:inline",children:["(",a,")"]})]}),(0,t.jsx)("span",{className:"font-mono font-semibold tabular-nums text-foreground",children:(0,K.formatCost)(r)}),(0,t.jsxs)("span",{className:"w-9 text-right tabular-nums text-muted-foreground",children:[Math.round(r/e.totalUSD*100),"%"]})]},s))})]}),(0,t.jsx)("div",{className:"mt-4 border-t border-border pt-1.5",children:(0,t.jsxs)(tv.Table,{className:"text-xs",children:[(0,t.jsx)(tv.TableHeader,{children:(0,t.jsx)(tv.TableRow,{className:"hover:bg-transparent",children:["Model","Input","Cache write","Cache read","Output","Cost"].map((e,s)=>(0,t.jsx)(tv.TableHead,{className:(0,G.cn)("h-8 px-0 text-muted-foreground",s>0&&"pl-3 text-right"),children:e},e))})}),(0,t.jsx)(tv.TableBody,{className:"font-mono tabular-nums",children:e.byModel.map(e=>(0,t.jsxs)(tv.TableRow,{className:"border-border/60",children:[(0,t.jsx)(tv.TableCell,{className:"px-0 py-1.5 text-foreground",children:e.model}),(0,t.jsx)(tv.TableCell,{className:"py-1.5 pr-0 pl-3 text-right",children:(0,K.formatTokens)(e.inputTokens)??"—"}),(0,t.jsx)(tv.TableCell,{className:"py-1.5 pr-0 pl-3 text-right",children:(0,K.formatTokens)(e.cacheWriteTokens)??"—"}),(0,t.jsx)(tv.TableCell,{className:"py-1.5 pr-0 pl-3 text-right",children:(0,K.formatTokens)(e.cacheReadTokens)??"—"}),(0,t.jsx)(tv.TableCell,{className:"py-1.5 pr-0 pl-3 text-right",children:(0,K.formatTokens)(e.outputTokens)??"—"}),(0,t.jsx)(tv.TableCell,{className:"py-1.5 pr-0 pl-3 text-right font-semibold text-foreground",children:null===e.costUSD?(0,t.jsx)("span",{className:"font-sans font-normal text-muted-foreground",children:"no price"}):(0,K.formatCost)(e.costUSD)})]},e.model))})]})}),(0,t.jsxs)("p",{className:"mt-3 text-xs leading-relaxed text-muted-foreground",children:[l>0&&o>0&&(0,t.jsxs)(t.Fragment,{children:[Math.round(o/l*100),"% of input was served from cache."," "]}),"API-equivalent estimate at list prices on the day of each request, not a bill: subscription and request-based plans charge differently."," ",(0,t.jsx)(p.Button,{variant:"link",onClick:()=>r(!0),"aria-haspopup":"dialog",className:"inline h-auto rounded-sm p-0 text-xs text-foreground underline underline-offset-2 hover:text-brand",children:"See the rates and arithmetic"}),d&&(0,t.jsxs)(t.Fragment,{children:[" ","No price is known for ",e.unpricedModels.join(", "),", so the total leaves ",e.unpricedModels.length>1?"them":"it"," out; add one in"," ",(0,t.jsx)("code",{className:"font-mono",children:"~/.agent-session-inspector/pricing.json"}),"."]})]}),(0,t.jsx)(tC,{cost:e,open:a,onOpenChange:r})]})}function tH({analysis:e,stats:s,cost:a,events:r,eventTypeCounts:n,onFocusHint:o,onOpenEvent:l}){let d=[{label:"System context",note:"agent managed",chars:e.systemContextChars,bar:"bg-red-400 dark:bg-red-500",text:"text-red-700 dark:text-red-400"},{label:"Tool results",chars:e.toolResultChars,bar:"bg-amber-400 dark:bg-amber-500",text:"text-amber-700 dark:text-amber-400"},{label:"Assistant replies",chars:e.assistantChars,bar:"bg-sky-400 dark:bg-sky-500",text:"text-sky-700 dark:text-sky-400"}],i=d.reduce((e,t)=>e+t.chars,0),c=tP.flatMap(t=>e.hints.filter(e=>e.severity===t));return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(tF,{cost:a}),(0,t.jsx)(tU,{events:r,partial:a.unpricedModels.length>0,onOpenEvent:l}),(0,t.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5",children:[(0,t.jsx)("h2",{className:"mb-4 text-sm font-semibold text-foreground",children:"Context usage breakdown"}),0===i?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No measurable context recorded for this session."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mb-4 flex h-2.5 overflow-hidden rounded-full bg-muted",children:d.map(({label:e,chars:s,bar:a})=>(0,t.jsx)("div",{className:a,style:{width:`${s/i*100}%`}},e))}),(0,t.jsx)("div",{className:"space-y-2.5",children:d.map(({label:e,note:s,chars:a,bar:r,text:n})=>{let o=Math.round(a/i*100);return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex w-36 shrink-0 items-center gap-2 sm:w-60",children:[(0,t.jsx)("span",{className:(0,G.cn)("size-2 shrink-0 rounded-full",r),"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate text-xs text-foreground",children:[e,s&&(0,t.jsxs)("span",{className:"ml-1 hidden text-muted-foreground sm:inline",children:["(",s,")"]})]})]}),(0,t.jsx)("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:(0,G.cn)("h-full rounded-full",r),style:{width:`${o}%`}})}),(0,t.jsxs)("span",{className:(0,G.cn)("w-20 text-right font-mono text-xs font-semibold tabular-nums",n),children:[(a/1e3).toFixed(0),"K chars"]}),(0,t.jsxs)("span",{className:"w-9 text-right text-xs tabular-nums text-muted-foreground",children:[o,"%"]})]},e)})})]}),(0,t.jsx)("div",{className:"mt-5 grid grid-cols-2 gap-3 border-t border-border pt-4 sm:grid-cols-4",children:[{label:"Output tokens",value:s.totalOutputTokens>0?`${(s.totalOutputTokens/1e3).toFixed(1)}K`:"—"},{label:"Input tokens",value:s.totalInputTokens>0?`${(s.totalInputTokens/1e3).toFixed(1)}K`:"N/A (active)"},{label:"Compactions",value:String(e.compactionCount)},{label:"Hook events",value:String(e.hookEventCount)}].map(({label:e,value:s})=>(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"font-mono text-base font-bold tabular-nums text-foreground",children:s}),(0,t.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:e})]},e))})]}),(0,t.jsxs)("section",{className:"grid gap-4 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-5",children:[(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold text-foreground",children:"Tool usage"}),(0,t.jsx)(tE.BarList,{items:e.topToolsByCount.map(({name:e,count:t})=>({name:e,value:t})),color:"bg-chart-3",emptyLabel:"No tool calls recorded."})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-5",children:[(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold text-foreground",children:"Event types"}),(0,t.jsx)(tE.BarList,{items:n,color:"bg-brand-2",limit:10,emptyLabel:"No events recorded."})]})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-foreground",children:[(0,t.jsx)(m,{className:"size-4 text-brand","aria-hidden":!0}),"Optimization hints",c.length>0&&(0,t.jsx)("span",{className:"rounded-sm bg-muted px-1.5 text-xs font-normal tabular-nums text-muted-foreground",children:c.length})]}),0===c.length?(0,t.jsxs)("div",{className:"flex items-center gap-2.5 rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 dark:border-emerald-900 dark:bg-emerald-950/30",children:[(0,t.jsx)(tT.CheckCircle2,{className:"size-4 shrink-0 text-emerald-600 dark:text-emerald-400","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm text-foreground",children:"No issues detected in this session’s context usage."})]}):(0,t.jsx)("div",{className:"space-y-3",children:c.map(e=>{let s=tO[e.severity];return(0,t.jsx)("article",{className:(0,G.cn)("rounded-xl border p-4",s.card),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(s.Icon,{className:(0,G.cn)("mt-0.5 size-4 shrink-0",s.icon),"aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e.category}),(0,t.jsx)("span",{className:"sr-only",children:s.label}),e.saving&&(0,t.jsxs)("span",{className:"rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-xs text-foreground",children:["save ~",e.saving]})]}),(0,t.jsx)("p",{className:"mt-0.5 text-sm font-semibold text-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e.description}),e.focus&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:()=>e.focus&&o(e.focus),className:"mt-2.5",children:["View related events",(0,t.jsx)(tS,{"data-icon":"inline-end","aria-hidden":!0})]})]})]})},`${e.category}-${e.title}`)})})]})]})}function tW({checkpoints:e}){let[a,r]=(0,s.useState)(new Set);return 0===e.length?(0,t.jsx)(e0.EmptyState,{icon:l,title:"No checkpoints",description:"Copilot CLI writes checkpoint files when it summarizes progress. Claude Code and Codex sessions have none."}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>{let s=a.has(e.name);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.name,void r(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},"aria-expanded":s,className:"flex w-full items-center gap-3 bg-muted/60 px-4 py-3 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(M.ChevronRight,{className:(0,G.cn)("size-4 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90"),"aria-hidden":!0}),(0,t.jsx)(c.FileText,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm font-medium text-foreground",children:e.name}),e.content&&(0,t.jsxs)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[e.content.length.toLocaleString()," chars"]})]}),s&&(e.content?(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsx)("div",{className:"flex justify-end border-b border-border bg-background px-2 py-1",children:(0,t.jsx)(f.CopyButton,{value:e.content,label:"Copy checkpoint"})}),(0,t.jsx)(g.ScrollArea,{className:"h-[60vh] w-full",children:(0,t.jsx)("pre",{className:"w-max min-w-full p-4 font-mono text-xs text-foreground",children:e.content})})]}):(0,t.jsx)("p",{className:"border-t border-border p-4 text-sm text-muted-foreground",children:"Empty file"}))]},e.name)})})}function tV({paths:e,kind:a}){let[r,n]=(0,s.useState)(""),o=r.trim().toLowerCase(),l=o?e.filter(e=>e.toLowerCase().includes(o)):e,d="research"===a?u:c.FileText;return 0===e.length?(0,t.jsx)(e0.EmptyState,{icon:d,title:"research"===a?"No research files":"No files",description:"research"===a?"Research notes appear here when the agent saves its findings.":"No files recorded. Copilot lists its workspace files here; Claude Code and Codex list the files the session edited."}):(0,t.jsxs)("div",{className:"space-y-2",children:[e.length>8&&(0,t.jsx)(H.SearchInput,{value:r,onChange:n,placeholder:"Filter paths…","aria-label":"Filter paths",className:"w-full max-w-sm"}),l.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-sm transition-colors hover:bg-muted/50",children:[(0,t.jsx)(d,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",children:e}),(0,t.jsx)(f.CopyButton,{value:e,label:"Copy path"})]},e)),0===l.length&&(0,t.jsxs)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:["No paths match “",r,"”"]})]})}let tK=["events","checkpoints","files","edits","research","workspace","optimizer"];function tJ({value:e}){return(0,t.jsx)("span",{className:"ml-1 rounded-sm bg-foreground/10 px-1.5 text-[11px] tabular-nums",children:e})}function tZ({provider:e,id:n}){let[w,C]=(0,Z.useTabParam)(tK,"events"),[S,T]=(0,s.useState)(null),[M,$]=(0,s.useState)(!0),[_,z]=(0,s.useState)(null),[A,q]=(0,s.useState)(null),[B]=(0,Z.useQueryParam)("q",""),D=(0,s.useMemo)(()=>B?{nonce:0,search:B}:null,[B]),[I,L]=(0,s.useState)(B);B!==I&&(L(B),q(null));let[E,R]=(0,Z.useQueryParam)("event",""),[U,O]=(0,s.useState)(0),P=(0,s.useRef)(null),F=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let t=!1;return(async()=>{try{let s=await fetch(`/api/sessions/${e}/${n}?probe=1`),a=s.ok?(await s.json()).revision:null,r=await fetch(`/api/sessions/${e}/${n}`);if(!r.ok)throw Error("Request failed");let o=await r.json();if(!o?.meta)throw Error("Not found");t||(P.current=a,F.current=!0,T(o))}catch{t||F.current||z("This session could not be loaded. It may have been removed.")}finally{t||$(!1)}})(),()=>{t=!0}},[e,n,U]);let[H,W]=(0,s.useState)(!1),V=(0,tA.isRunning)(S?.meta.updated_at),[,J]=(0,s.useState)(0),G=null!==S&&(H||V),Y=S?.meta.updated_at;(0,s.useEffect)(()=>{if(!G)return;let t=!1,s=window.setInterval(async()=>{if(!document.hidden)try{let s=await fetch(`/api/sessions/${e}/${n}?probe=1`);if(!s.ok||t)return;let a=(await s.json()).revision;if(t)return;a!==P.current?O(e=>e+1):(0,tA.isRunning)(Y)||J(e=>e+1)}catch{}},3e3);return()=>{t=!0,window.clearInterval(s)}},[G,e,n,Y]);let Q=(0,s.useMemo)(()=>{let e=new Map;for(let t of S?.events??[])e.set(t.type,(e.get(t.type)??0)+1);return Array.from(e,([e,t])=>({name:e,value:t}))},[S]),X=(0,s.useMemo)(()=>td(S?.events??[],S?.meta.cwd).reduce((e,t)=>e+t.edits,0),[S]),ee=(0,s.useMemo)(()=>{let e=S?.events??[];if(e.length<2)return null;let t=e.map(e=>new Date(e.timestamp).getTime()).filter(e=>Number.isFinite(e));return t.length<2?null:Math.max(...t)-Math.min(...t)},[S]);function et(e){C("events"),q({nonce:Date.now(),...e})}let[es,ea]=(0,s.useState)(null);function er(e){R(e),C("events"),ea({eventId:e,nonce:Date.now()})}(0,s.useEffect)(()=>{if(!es||"events"!==w)return;let e=requestAnimationFrame(()=>document.querySelector(`[data-event-id="${CSS.escape(es.eventId)}"]`)?.scrollIntoView({block:"center"}));return()=>cancelAnimationFrame(e)},[es,w]);let en="checkpoints"===w&&S?.checkpoints.length===0||"research"===w&&S?.research.length===0?"events":w,eo=S?S.meta.title??(0,K.firstLine)(S.meta.name)??S.meta.id:n;return(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsx)("div",{className:"sticky top-0 z-30 border-b border-border bg-background/85 backdrop-blur supports-[backdrop-filter]:bg-background/70",children:(0,t.jsxs)("div",{className:"mx-auto flex h-[var(--cv-topbar-h)] max-w-6xl items-center gap-3 px-4 sm:px-6",children:[(0,t.jsx)(tI.SidebarTrigger,{className:"-ml-2 shrink-0"}),(0,t.jsxs)(p.Button,{variant:"ghost",nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/?tab=sessions"}),className:"text-muted-foreground",children:[(0,t.jsx)(o,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Sessions"})]}),(0,t.jsx)("span",{className:"text-muted-foreground/50","aria-hidden":!0,children:"/"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:eo}),(0,t.jsx)(v.SearchTrigger,{className:"shrink-0"}),(0,t.jsx)(tI.ShortcutsTrigger,{className:"hidden shrink-0 sm:inline-flex"}),(0,t.jsx)(k.PalettePicker,{className:"shrink-0"}),(0,t.jsx)(y.ThemeToggle,{className:"shrink-0"}),(0,t.jsx)(N.AboutDialog,{className:"shrink-0"})]})}),M?(0,t.jsxs)("div",{className:"mx-auto max-w-6xl space-y-4 px-4 py-8 sm:px-6",children:[(0,t.jsx)(j.Skeleton,{className:"h-7 w-2/3"}),(0,t.jsx)(j.Skeleton,{className:"h-4 w-1/3"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:Array.from({length:6},(e,s)=>(0,t.jsx)(j.Skeleton,{className:"h-11 w-24"},s))}),(0,t.jsx)(j.Skeleton,{className:"h-9 w-96"}),(0,t.jsx)("div",{className:"space-y-3 pt-4",children:Array.from({length:6},(e,s)=>(0,t.jsx)(j.Skeleton,{className:"h-20 w-full"},s))})]}):_||!S?(0,t.jsx)("div",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-border px-6 py-14 text-center",children:[(0,t.jsx)(r.AlertTriangle,{className:"size-6 text-destructive","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Session unavailable"}),(0,t.jsx)("p",{className:"max-w-sm text-xs text-muted-foreground",children:_}),(0,t.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:function(){$(!0),z(null),O(e=>e+1)},children:"Retry"}),(0,t.jsx)(p.Button,{size:"sm",nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/?tab=sessions"}),children:"Back to sessions"})]})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tD,{meta:S.meta,storagePath:S.storagePath,revealable:S.revealable,stats:S.stats,cost:S.cost,activeMs:ee,running:V,onFocusEvents:et}),(0,t.jsx)("main",{id:"main",className:"mx-auto max-w-6xl px-4 pt-2 pb-5 sm:px-6",children:(0,t.jsxs)(h.Tabs,{value:en,onValueChange:C,className:"gap-0",children:[(0,t.jsx)("div",{className:"sticky top-[var(--cv-topbar-h)] z-20 -mx-4 overflow-x-auto scrollbar-none bg-background/85 px-4 py-2 backdrop-blur supports-[backdrop-filter]:bg-background/70 sm:-mx-6 sm:px-6",children:(0,t.jsxs)(h.TabsList,{className:"w-max",children:[(0,t.jsxs)(h.TabsTrigger,{value:"events",className:"px-3",children:[(0,t.jsx)(x.Zap,{className:"size-4","aria-hidden":!0}),"Events",(0,t.jsx)(tJ,{value:S.events.length})]}),S.checkpoints.length>0&&(0,t.jsxs)(h.TabsTrigger,{value:"checkpoints",className:"px-3",children:[(0,t.jsx)(l,{className:"size-4","aria-hidden":!0}),"Checkpoints",(0,t.jsx)(tJ,{value:S.checkpoints.length})]}),(0,t.jsxs)(h.TabsTrigger,{value:"files",className:"px-3",children:[(0,t.jsx)(c.FileText,{className:"size-4","aria-hidden":!0}),"Files",(0,t.jsx)(tJ,{value:S.files.length})]}),(0,t.jsxs)(h.TabsTrigger,{value:"edits",className:"px-3",children:[(0,t.jsx)(i,{className:"size-4","aria-hidden":!0}),"Edits",(0,t.jsx)(tJ,{value:X})]}),S.research.length>0&&(0,t.jsxs)(h.TabsTrigger,{value:"research",className:"px-3",children:[(0,t.jsx)(u,{className:"size-4","aria-hidden":!0}),"Research",(0,t.jsx)(tJ,{value:S.research.length})]}),(0,t.jsxs)(h.TabsTrigger,{value:"workspace",className:"px-3",children:[(0,t.jsx)(d,{className:"size-4","aria-hidden":!0}),"Metadata"]}),(0,t.jsxs)(h.TabsTrigger,{value:"optimizer",className:"px-3",children:[(0,t.jsx)(m,{className:"size-4","aria-hidden":!0}),"Token Optimizer",S.tokenAnalysis?.hints.some(e=>"high"===e.severity)&&(0,t.jsx)("span",{className:"ml-1 inline-flex size-4 items-center justify-center rounded-full bg-red-500 text-[10px] font-bold text-white",title:"High-impact hints",children:S.tokenAnalysis.hints.filter(e=>"high"===e.severity).length})]})]})}),(0,t.jsx)(h.TabsContent,{value:"events",children:(0,t.jsx)(eQ,{events:S.events,focusRequest:A??D,targetEventId:E||void 0,live:H,onLiveChange:W,running:V})}),(0,t.jsx)(h.TabsContent,{value:"checkpoints",className:"pt-2",children:(0,t.jsx)(tW,{checkpoints:S.checkpoints})}),(0,t.jsx)(h.TabsContent,{value:"files",className:"pt-2",children:(0,t.jsx)(tV,{paths:S.files,kind:"file"})}),(0,t.jsx)(h.TabsContent,{value:"edits",className:"pt-2",children:(0,t.jsx)(tc,{events:S.events,cwd:S.meta.cwd,onOpenEvent:er})}),(0,t.jsx)(h.TabsContent,{value:"research",className:"pt-2",children:(0,t.jsx)(tV,{paths:S.research,kind:"research"})}),(0,t.jsx)(h.TabsContent,{value:"workspace",className:"pt-2",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:S.rawMeta.name}),S.rawMeta.content&&(0,t.jsx)(f.CopyButton,{value:S.rawMeta.content,label:`Copy ${S.rawMeta.name}`,className:"ml-auto"})]}),(0,t.jsx)(g.ScrollArea,{className:"h-[60vh] w-full",children:(0,t.jsx)("pre",{className:"w-max min-w-full p-4 font-mono text-xs text-foreground",children:S.rawMeta.content||"No session metadata found"})})]})}),(0,t.jsx)(h.TabsContent,{value:"optimizer",className:"pt-2",children:(0,t.jsx)(tH,{analysis:S.tokenAnalysis,stats:S.stats,cost:S.cost,events:S.events,eventTypeCounts:Q,onFocusHint:et,onOpenEvent:er})})]})})]}),(0,t.jsx)(b.ScrollToTop,{})]})}e.s(["default",0,function(e){let{provider:a,id:r}=(0,s.use)(e.params);return(0,t.jsx)(s.Suspense,{children:(0,t.jsx)(tZ,{provider:a,id:r},`${a}/${r}`)})}],90613)}]);
|