clawatch 1.0.13 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/backend/dist/alertChecker.d.ts.map +1 -1
  2. package/backend/dist/alertChecker.js +130 -1
  3. package/backend/dist/alertChecker.js.map +1 -1
  4. package/backend/dist/db.d.ts.map +1 -1
  5. package/backend/dist/db.js +1 -0
  6. package/backend/dist/db.js.map +1 -1
  7. package/backend/dist/projects.d.ts +9 -0
  8. package/backend/dist/projects.d.ts.map +1 -1
  9. package/backend/dist/projects.js +87 -23
  10. package/backend/dist/projects.js.map +1 -1
  11. package/backend/dist/routes.d.ts.map +1 -1
  12. package/backend/dist/routes.js +687 -54
  13. package/backend/dist/routes.js.map +1 -1
  14. package/backend/dist/sessions.d.ts +14 -7
  15. package/backend/dist/sessions.d.ts.map +1 -1
  16. package/backend/dist/sessions.js +199 -43
  17. package/backend/dist/sessions.js.map +1 -1
  18. package/backend/dist/sync.d.ts.map +1 -1
  19. package/backend/dist/sync.js +293 -33
  20. package/backend/dist/sync.js.map +1 -1
  21. package/dist/cli.js +225 -93
  22. package/dist/cli.js.map +1 -1
  23. package/dist/collector.d.ts.map +1 -1
  24. package/dist/collector.js +67 -62
  25. package/dist/collector.js.map +1 -1
  26. package/dist/config.d.ts +16 -1
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js +69 -5
  29. package/dist/config.js.map +1 -1
  30. package/frontend/.next/BUILD_ID +1 -1
  31. package/frontend/.next/build-manifest.json +4 -4
  32. package/frontend/.next/server/app/_global-error/page/build-manifest.json +2 -2
  33. package/frontend/.next/server/app/_global-error/page.js.nft.json +1 -1
  34. package/frontend/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  35. package/frontend/.next/server/app/_global-error.html +2 -2
  36. package/frontend/.next/server/app/_global-error.rsc +8 -8
  37. package/frontend/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  38. package/frontend/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
  39. package/frontend/.next/server/app/_global-error.segments/_head.segment.rsc +4 -4
  40. package/frontend/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  41. package/frontend/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  42. package/frontend/.next/server/app/_not-found/page/build-manifest.json +2 -2
  43. package/frontend/.next/server/app/_not-found/page.js.nft.json +1 -1
  44. package/frontend/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  45. package/frontend/.next/server/app/_not-found.html +1 -1
  46. package/frontend/.next/server/app/_not-found.rsc +9 -9
  47. package/frontend/.next/server/app/_not-found.segments/_full.segment.rsc +9 -9
  48. package/frontend/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  49. package/frontend/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  50. package/frontend/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  51. package/frontend/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  52. package/frontend/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  53. package/frontend/.next/server/app/dashboard/page/build-manifest.json +2 -2
  54. package/frontend/.next/server/app/dashboard/page.js.nft.json +1 -1
  55. package/frontend/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  56. package/frontend/.next/server/app/dashboard/projects/[id]/page/build-manifest.json +2 -2
  57. package/frontend/.next/server/app/dashboard/projects/[id]/page.js.nft.json +1 -1
  58. package/frontend/.next/server/app/dashboard/projects/[id]/page_client-reference-manifest.js +1 -1
  59. package/frontend/.next/server/app/dashboard/sessions/[id]/page/build-manifest.json +2 -2
  60. package/frontend/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
  61. package/frontend/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
  62. package/frontend/.next/server/app/dashboard.html +1 -1
  63. package/frontend/.next/server/app/dashboard.rsc +10 -10
  64. package/frontend/.next/server/app/dashboard.segments/_full.segment.rsc +10 -10
  65. package/frontend/.next/server/app/dashboard.segments/_head.segment.rsc +4 -4
  66. package/frontend/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  67. package/frontend/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  68. package/frontend/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +4 -4
  69. package/frontend/.next/server/app/dashboard.segments/dashboard.segment.rsc +3 -3
  70. package/frontend/.next/server/app/index.html +1 -1
  71. package/frontend/.next/server/app/index.rsc +10 -10
  72. package/frontend/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  73. package/frontend/.next/server/app/index.segments/_full.segment.rsc +10 -10
  74. package/frontend/.next/server/app/index.segments/_head.segment.rsc +4 -4
  75. package/frontend/.next/server/app/index.segments/_index.segment.rsc +4 -4
  76. package/frontend/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  77. package/frontend/.next/server/app/page/build-manifest.json +2 -2
  78. package/frontend/.next/server/app/page.js.nft.json +1 -1
  79. package/frontend/.next/server/app/page_client-reference-manifest.js +1 -1
  80. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__008d27c3._.js +1 -1
  81. package/frontend/.next/server/chunks/ssr/{[root-of-the-server]__bdeac1dc._.js → [root-of-the-server]__32661fd1._.js} +2 -2
  82. package/frontend/.next/server/chunks/ssr/{[root-of-the-server]__8511f4a3._.js → [root-of-the-server]__9b38782c._.js} +2 -2
  83. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__a64655ed._.js +2 -2
  84. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__d2832b3e._.js +3 -0
  85. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__f437da88._.js +1 -1
  86. package/frontend/.next/server/chunks/ssr/_2bfdd77b._.js +1 -1
  87. package/frontend/.next/server/chunks/ssr/_b0ae6d33._.js +1 -1
  88. package/frontend/.next/server/chunks/ssr/_e17fe96b._.js +3 -0
  89. package/frontend/.next/server/chunks/ssr/_f26b1aca._.js +1 -1
  90. package/frontend/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js +1 -1
  91. package/frontend/.next/server/chunks/ssr/{node_modules_next_dist_27457240._.js → node_modules_next_dist_esm_eedfc1fd._.js} +2 -2
  92. package/frontend/.next/server/middleware-build-manifest.js +2 -2
  93. package/frontend/.next/server/pages/404.html +1 -1
  94. package/frontend/.next/server/pages/500.html +2 -2
  95. package/frontend/.next/static/chunks/641e855850e79de9.css +3 -0
  96. package/frontend/.next/static/chunks/{d702a24e2b6c48fa.js → 6b50f8d2ee1d2bea.js} +2 -2
  97. package/frontend/.next/static/chunks/88faea50dcf8f778.js +1 -0
  98. package/frontend/.next/static/chunks/8ffedcb68f4a998f.js +1 -0
  99. package/frontend/.next/static/chunks/{d2be314c3ece3fbe.js → a2dfb6fc5208ab9b.js} +1 -1
  100. package/frontend/.next/static/chunks/a909e37955d0604e.js +1 -0
  101. package/frontend/.next/static/chunks/ba72b58eb8cb3f4e.js +1 -0
  102. package/frontend/.next/static/chunks/e975763f7a359fb5.js +1 -0
  103. package/frontend/.next/static/chunks/{turbopack-0df1acbb994b2a74.js → turbopack-1e12e8d4e4225e2f.js} +1 -1
  104. package/frontend/package.json +1 -0
  105. package/frontend/server-with-proxy.js +82 -0
  106. package/package.json +4 -3
  107. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__48e09bc8._.js +0 -3
  108. package/frontend/.next/server/chunks/ssr/src_app_dashboard_page_tsx_196c74b5._.js +0 -3
  109. package/frontend/.next/static/chunks/284aee0eb323076c.js +0 -1
  110. package/frontend/.next/static/chunks/2b7d8037bb74445e.css +0 -3
  111. package/frontend/.next/static/chunks/520be2943f8ae266.js +0 -1
  112. package/frontend/.next/static/chunks/58873fd2347d1c88.js +0 -1
  113. package/frontend/.next/static/chunks/a308a3cc32b8bc4a.js +0 -1
  114. /package/frontend/.next/static/{P4g0K_y2ksljZD88vEDAA → bKa8vfUmSWQxqmsnhQLtj}/_buildManifest.js +0 -0
  115. /package/frontend/.next/static/{P4g0K_y2ksljZD88vEDAA → bKa8vfUmSWQxqmsnhQLtj}/_clientMiddlewareManifest.json +0 -0
  116. /package/frontend/.next/static/{P4g0K_y2ksljZD88vEDAA → bKa8vfUmSWQxqmsnhQLtj}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},24625,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(99570),g=a.i(91119),h=a.i(86304),i=a.i(19032),j=a.i(78434);function k(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function l(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(0)}K`:String(a)}let m={active:{color:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400",label:"Active"},idle:{color:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400",label:"Idle"},completed:{color:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",dot:"bg-zinc-400",label:"Completed"}},n={ofek:"bg-blue-500/10 text-blue-400 border-blue-500/20",anas:"bg-purple-500/10 text-purple-400 border-purple-500/20",dor:"bg-teal-500/10 text-teal-400 border-teal-500/20"};function o(){let a=(0,d.useParams)(),o=(0,d.useRouter)(),q=a.id,[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(!0),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(new Set);if((0,c.useEffect)(()=>{!async function(){try{let a=await (0,i.getSession)(q);s(a)}catch{w("Session not found")}finally{u(!1)}}()},[q]),t)return(0,b.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,b.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,b.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading session..."]})});if(v||!r)return(0,b.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-4",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:v||"Session not found"}),(0,b.jsx)(f.Button,{variant:"outline",onClick:()=>o.push("/dashboard"),children:"Back to Dashboard"})]})});let z=m[r.status],A=r.tokenBreakdown.input+r.tokenBreakdown.output+r.tokenBreakdown.cacheRead+r.tokenBreakdown.cacheWrite,B=Math.max(...r.costByModel.map(a=>a.costUsd));return(0,b.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,b.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,b.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,b.jsxs)("div",{className:"flex items-center gap-6",children:[(0,b.jsxs)(e.default,{href:"/",className:"flex items-center gap-2",children:[(0,b.jsx)(j.ClaWatchIcon,{}),(0,b.jsx)(j.ClaWatchLogo,{size:"md"})]}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"Session Detail"})]})})}),(0,b.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>o.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,b.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold",children:r.title}),(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsx)(h.Badge,{variant:"outline",className:`border ${n[r.agentId]||"text-zinc-400"}`,children:r.agentId}),(0,b.jsx)(h.Badge,{variant:"outline",className:"font-mono text-xs",children:r.model}),(0,b.jsxs)(h.Badge,{variant:"outline",className:`border ${z.color}`,children:[(0,b.jsx)("span",{className:`size-1.5 rounded-full ${z.dot} mr-1.5`}),z.label]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[(0,b.jsx)("div",{children:(0,b.jsxs)("span",{className:"text-3xl font-bold",children:["$",r.costUsd.toFixed(2)]})}),(0,b.jsxs)("div",{className:"text-muted-foreground",children:[(0,b.jsxs)("div",{children:[l(r.tokenCount)," tokens"]}),(0,b.jsxs)("div",{children:[r.messageCount," messages"]})]}),(0,b.jsxs)("div",{className:"text-muted-foreground text-xs",children:[(0,b.jsxs)("div",{children:["Started: ",k(r.startedAt)," (",new Date(r.startedAt).toLocaleString(),")"]}),(0,b.jsxs)("div",{children:["Last activity: ",k(r.lastActivityAt)]})]})]})]})]}),(0,b.jsxs)(g.Card,{children:[(0,b.jsx)(g.CardHeader,{children:(0,b.jsx)(g.CardTitle,{className:"text-sm font-medium text-muted-foreground",children:"Cost Breakdown"})}),(0,b.jsx)(g.CardContent,{children:(0,b.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"By Model"}),r.costByModel.map(a=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"font-mono text-xs",children:a.model}),(0,b.jsxs)("span",{className:"font-medium",children:["$",a.costUsd.toFixed(2)]})]}),(0,b.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${a.costUsd/B*100}%`}})}),(0,b.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:[l(a.tokenCount)," tokens"]})]},a.model))]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Token Breakdown"}),[{label:"Input",value:r.tokenBreakdown.input,color:"bg-blue-500"},{label:"Output",value:r.tokenBreakdown.output,color:"bg-emerald-500"},{label:"Cache Read",value:r.tokenBreakdown.cacheRead,color:"bg-amber-500"},{label:"Cache Write",value:r.tokenBreakdown.cacheWrite,color:"bg-purple-500"}].map(a=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-xs",children:a.label}),(0,b.jsx)("span",{className:"font-medium font-mono",children:l(a.value)})]}),(0,b.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,b.jsx)("div",{className:`h-full rounded-full ${a.color} transition-all`,style:{width:`${a.value/A*100}%`}})})]},a.label))]})]})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Messages"}),(0,b.jsxs)("div",{className:"relative space-y-3",children:[(0,b.jsx)("div",{className:"absolute left-5 top-0 bottom-0 w-px bg-border/50"}),r.messages.map(a=>(0,b.jsx)(p,{message:a,collapsed:x.has(a.id),onToggle:()=>{var b;return b=a.id,void y(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}},a.id))]})]})]})]})}function p({message:a,collapsed:c,onToggle:d}){let e=a.content.toLowerCase().includes("error");return"user"===a.role?(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-blue-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-blue-500/20 bg-blue-500/10 p-4 ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:k(a.timestamp)})]}),(0,b.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:a.content})]})]}):"assistant"===a.role?(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-zinc-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-border/50 bg-zinc-800/50 p-4 ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),a.model&&(0,b.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:a.model}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:k(a.timestamp)})]}),null!=a.costUsd&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",a.costUsd.toFixed(2)]}),null!=a.tokenCount&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:l(a.tokenCount)})]})]}),(0,b.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:a.content})]})]}):"tool"===a.role?(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-amber-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-border/50 bg-zinc-900 p-4 ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),a.toolName&&(0,b.jsx)(h.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:a.toolName}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:k(a.timestamp)})]}),(0,b.jsx)("button",{onClick:d,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:c?"Show":"Hide"})]}),a.toolInput&&(0,b.jsx)("pre",{className:"text-[11px] font-mono text-muted-foreground bg-black/30 rounded px-2 py-1 mb-2 overflow-x-auto",children:a.toolInput}),!c&&(0,b.jsx)("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:a.content})]})]}):(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-zinc-700 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:"rounded-lg px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:k(a.timestamp)})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.content})]})]})}a.s(["default",()=>o])}];
1
+ module.exports=[36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},24625,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(99570),g=a.i(91119),h=a.i(86304),i=a.i(19032),j=a.i(78434);function k(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function l(a){return new Date(a).toLocaleString()}function m(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(0)}K`:String(a)}let n={active:{color:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400",label:"Active"},idle:{color:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400",label:"Idle"},completed:{color:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",dot:"bg-zinc-400",label:"Completed"}};function o({text:a,className:d,preformatted:e=!1}){let[f,g]=(0,c.useState)(!1),h=a.length>500,i=h&&!f?a.slice(0,500)+"…":a;return(0,b.jsxs)("div",{children:[(0,b.jsx)(e?"pre":"p",{className:d,children:i}),h&&(0,b.jsx)("button",{onClick:()=>g(!f),className:"mt-1 text-[11px] font-medium text-emerald-400 hover:text-emerald-300 transition-colors cursor-pointer",children:f?"Show less":"Show more"})]})}let p={ofek:"bg-blue-500/10 text-blue-400 border-blue-500/20",anas:"bg-purple-500/10 text-purple-400 border-purple-500/20",dor:"bg-teal-500/10 text-teal-400 border-teal-500/20"};function q(){let a=(0,d.useParams)(),o=(0,d.useRouter)(),q=a.id,[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(new Set),A=(0,c.useRef)(null),B=(0,c.useRef)(0),C=(0,c.useRef)(!0);if((0,c.useEffect)(()=>{!async function(){try{let a=await (0,i.getSession)(q);t(a)}catch{x("Session not found")}finally{v(!1)}}();let a=setInterval(async()=>{try{let a=await (0,i.getSession)(q);t(a)}catch{}},5e3);return()=>clearInterval(a)},[q]),(0,c.useEffect)(()=>{if(!s||!A.current)return;let a=s.messages.length;C.current?(A.current.scrollIntoView({behavior:"instant"}),C.current=!1):a>B.current&&A.current.scrollIntoView({behavior:"smooth"}),B.current=a},[s?.messages?.length]),u)return(0,b.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,b.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,b.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading session..."]})});if(w||!s)return(0,b.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-4",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:w||"Session not found"}),(0,b.jsx)(f.Button,{variant:"outline",onClick:()=>o.push("/dashboard"),children:"Back to Dashboard"})]})});let D=n[s.status],E=s.tokenBreakdown.input+s.tokenBreakdown.output+s.tokenBreakdown.cacheRead+s.tokenBreakdown.cacheWrite,F=Math.max(...s.costByModel.map(a=>a.costUsd));return(0,b.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,b.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,b.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,b.jsxs)("div",{className:"flex items-center gap-6",children:[(0,b.jsxs)(e.default,{href:"/",className:"flex items-center gap-2",children:[(0,b.jsx)(j.ClaWatchIcon,{}),(0,b.jsx)(j.ClaWatchLogo,{size:"md"})]}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"Session Detail"})]})})}),(0,b.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>o.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,b.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold",children:s.title}),(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsx)(h.Badge,{variant:"outline",className:`border ${p[s.agentId]||"text-zinc-400"}`,children:s.agentId}),(0,b.jsx)(h.Badge,{variant:"outline",className:"font-mono text-xs",children:s.model}),(0,b.jsxs)(h.Badge,{variant:"outline",className:`border ${D.color}`,children:[(0,b.jsx)("span",{className:`size-1.5 rounded-full ${D.dot} mr-1.5`}),D.label]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[(0,b.jsx)("div",{children:(0,b.jsxs)("span",{className:"text-3xl font-bold",children:["$",s.costUsd.toFixed(2)]})}),(0,b.jsxs)("div",{className:"text-muted-foreground",children:[(0,b.jsxs)("div",{children:[m(s.tokenCount)," tokens"]}),(0,b.jsxs)("div",{children:[s.messageCount," messages"]})]}),(0,b.jsxs)("div",{className:"text-muted-foreground text-xs",children:[(0,b.jsxs)("div",{children:["Started: ",k(s.startedAt)," (",l(s.startedAt),")"]}),(0,b.jsxs)("div",{children:["Last activity: ",k(s.lastActivityAt)]})]})]})]})]}),(0,b.jsxs)(g.Card,{children:[(0,b.jsx)(g.CardHeader,{children:(0,b.jsx)(g.CardTitle,{className:"text-sm font-medium text-muted-foreground",children:"Cost Breakdown"})}),(0,b.jsx)(g.CardContent,{children:(0,b.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"By Model"}),s.costByModel.map(a=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"font-mono text-xs",children:a.model}),(0,b.jsxs)("span",{className:"font-medium",children:["$",a.costUsd.toFixed(2)]})]}),(0,b.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${a.costUsd/F*100}%`}})}),(0,b.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:[m(a.tokenCount)," tokens"]})]},a.model))]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Token Breakdown"}),[{label:"Input",value:s.tokenBreakdown.input,color:"bg-blue-500"},{label:"Output",value:s.tokenBreakdown.output,color:"bg-emerald-500"},{label:"Cache Read",value:s.tokenBreakdown.cacheRead,color:"bg-amber-500"},{label:"Cache Write",value:s.tokenBreakdown.cacheWrite,color:"bg-purple-500"}].map(a=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-xs",children:a.label}),(0,b.jsx)("span",{className:"font-medium font-mono",children:m(a.value)})]}),(0,b.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,b.jsx)("div",{className:`h-full rounded-full ${a.color} transition-all`,style:{width:`${a.value/E*100}%`}})})]},a.label))]})]})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Messages"}),(0,b.jsxs)("div",{className:"relative space-y-3",children:[(0,b.jsx)("div",{className:"absolute left-5 top-0 bottom-0 w-px bg-border/50"}),s.messages.map(a=>(0,b.jsx)(r,{message:a,collapsed:y.has(a.id),onToggle:()=>{var b;return b=a.id,void z(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}},a.id)),(0,b.jsx)("div",{ref:A})]})]})]})]})}function r({message:a,collapsed:c,onToggle:d}){let e=a.content.toLowerCase().includes("error");return"user"===a.role?(0,b.jsxs)("div",{className:"relative pl-12 flex justify-end",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-blue-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-blue-500/20 bg-blue-500/10 p-4 max-w-[80%] ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l(a.timestamp)})]}),(0,b.jsx)(o,{text:a.content,className:"text-sm whitespace-pre-wrap"})]})]}):"assistant"===a.role?(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-zinc-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-border/50 bg-zinc-800/50 p-4 max-w-[80%] ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),a.model&&(0,b.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:a.model}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l(a.timestamp)})]}),null!=a.costUsd&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",a.costUsd.toFixed(2)]}),null!=a.tokenCount&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:m(a.tokenCount)})]})]}),(0,b.jsx)(o,{text:a.content,className:"text-sm whitespace-pre-wrap"})]})]}):"tool"===a.role?(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-amber-500 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:`rounded-lg border border-border/50 bg-zinc-900 p-4 ${e?"border-red-500/30 bg-red-500/10":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),a.toolName&&(0,b.jsx)(h.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:a.toolName}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l(a.timestamp)})]}),(0,b.jsx)("button",{onClick:d,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:c?"Show":"Hide"})]}),a.toolInput&&(0,b.jsx)("div",{className:"bg-black/30 rounded px-2 py-1 mb-2 overflow-x-auto",children:(0,b.jsx)(o,{text:a.toolInput,className:"text-[11px] font-mono text-muted-foreground",preformatted:!0})}),!c&&(0,b.jsx)(o,{text:a.content,className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",preformatted:!0})]})]}):(0,b.jsxs)("div",{className:"relative pl-12",children:[(0,b.jsx)("div",{className:"absolute left-3.5 top-3 size-3 rounded-full bg-zinc-700 ring-4 ring-background z-10"}),(0,b.jsxs)("div",{className:"rounded-lg px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l(a.timestamp)})]}),(0,b.jsx)(o,{text:a.content,className:"text-xs text-muted-foreground mt-1"})]})]})}a.s(["default",()=>q])}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__008d27c3._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml}];
1
+ module.exports=[43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__bdeac1dc._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__32661fd1._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient}];
1
+ module.exports=[36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__8511f4a3._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__9b38782c._.js.map