clawatch 1.0.23 → 1.0.26

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 (133) hide show
  1. package/backend/dist/alertChecker.d.ts.map +1 -1
  2. package/backend/dist/alertChecker.js +44 -0
  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 +6 -0
  6. package/backend/dist/db.js.map +1 -1
  7. package/backend/dist/index.js +3 -2
  8. package/backend/dist/index.js.map +1 -1
  9. package/backend/dist/routes.d.ts.map +1 -1
  10. package/backend/dist/routes.js +118 -11
  11. package/backend/dist/routes.js.map +1 -1
  12. package/backend/dist/sessions.d.ts +2 -0
  13. package/backend/dist/sessions.d.ts.map +1 -1
  14. package/backend/dist/sessions.js +9 -0
  15. package/backend/dist/sessions.js.map +1 -1
  16. package/backend/dist/sync.d.ts +1 -4
  17. package/backend/dist/sync.d.ts.map +1 -1
  18. package/backend/dist/sync.js +4 -0
  19. package/backend/dist/sync.js.map +1 -1
  20. package/frontend/.env +1 -0
  21. package/frontend/.next/BUILD_ID +1 -1
  22. package/frontend/.next/app-path-routes-manifest.json +1 -0
  23. package/frontend/.next/build-manifest.json +2 -2
  24. package/frontend/.next/prerender-manifest.json +24 -0
  25. package/frontend/.next/routes-manifest.json +6 -0
  26. package/frontend/.next/server/app/_global-error.html +2 -2
  27. package/frontend/.next/server/app/_global-error.rsc +1 -1
  28. package/frontend/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  29. package/frontend/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  30. package/frontend/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  31. package/frontend/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  32. package/frontend/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  33. package/frontend/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  34. package/frontend/.next/server/app/_not-found.html +1 -1
  35. package/frontend/.next/server/app/_not-found.rsc +2 -2
  36. package/frontend/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  37. package/frontend/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  38. package/frontend/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  39. package/frontend/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  40. package/frontend/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  41. package/frontend/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  42. package/frontend/.next/server/app/dashboard/costs/page/app-paths-manifest.json +3 -0
  43. package/frontend/.next/server/app/dashboard/costs/page/build-manifest.json +17 -0
  44. package/frontend/.next/server/app/dashboard/costs/page/next-font-manifest.json +11 -0
  45. package/frontend/.next/server/app/dashboard/costs/page/react-loadable-manifest.json +1 -0
  46. package/frontend/.next/server/app/dashboard/costs/page/server-reference-manifest.json +4 -0
  47. package/frontend/.next/server/app/dashboard/costs/page.js +16 -0
  48. package/frontend/.next/server/app/dashboard/costs/page.js.map +5 -0
  49. package/frontend/.next/server/app/dashboard/costs/page.js.nft.json +1 -0
  50. package/frontend/.next/server/app/dashboard/costs/page_client-reference-manifest.js +2 -0
  51. package/frontend/.next/server/app/dashboard/costs.html +1 -0
  52. package/frontend/.next/server/app/dashboard/costs.meta +16 -0
  53. package/frontend/.next/server/app/dashboard/costs.rsc +20 -0
  54. package/frontend/.next/server/app/dashboard/costs.segments/_full.segment.rsc +20 -0
  55. package/frontend/.next/server/app/dashboard/costs.segments/_head.segment.rsc +6 -0
  56. package/frontend/.next/server/app/dashboard/costs.segments/_index.segment.rsc +5 -0
  57. package/frontend/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +4 -0
  58. package/frontend/.next/server/app/dashboard/costs.segments/dashboard/costs/__PAGE__.segment.rsc +9 -0
  59. package/frontend/.next/server/app/dashboard/costs.segments/dashboard/costs.segment.rsc +4 -0
  60. package/frontend/.next/server/app/dashboard/costs.segments/dashboard.segment.rsc +4 -0
  61. package/frontend/.next/server/app/dashboard/page.js.nft.json +1 -1
  62. package/frontend/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  63. package/frontend/.next/server/app/dashboard/projects/[id]/page.js.nft.json +1 -1
  64. package/frontend/.next/server/app/dashboard/projects/[id]/page_client-reference-manifest.js +1 -1
  65. package/frontend/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
  66. package/frontend/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
  67. package/frontend/.next/server/app/dashboard.html +1 -1
  68. package/frontend/.next/server/app/dashboard.rsc +3 -3
  69. package/frontend/.next/server/app/dashboard.segments/_full.segment.rsc +3 -3
  70. package/frontend/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  71. package/frontend/.next/server/app/dashboard.segments/_index.segment.rsc +2 -2
  72. package/frontend/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  73. package/frontend/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
  74. package/frontend/.next/server/app/dashboard.segments/dashboard.segment.rsc +1 -1
  75. package/frontend/.next/server/app/index.html +1 -1
  76. package/frontend/.next/server/app/index.rsc +3 -3
  77. package/frontend/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  78. package/frontend/.next/server/app/index.segments/_full.segment.rsc +3 -3
  79. package/frontend/.next/server/app/index.segments/_head.segment.rsc +1 -1
  80. package/frontend/.next/server/app/index.segments/_index.segment.rsc +2 -2
  81. package/frontend/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  82. package/frontend/.next/server/app/page.js.nft.json +1 -1
  83. package/frontend/.next/server/app/page_client-reference-manifest.js +1 -1
  84. package/frontend/.next/server/app-paths-manifest.json +1 -0
  85. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__96998d39._.js +3 -0
  86. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__ad9c7c6a._.js +3 -0
  87. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__cb471d02._.js +3 -0
  88. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__f99f8278._.js +3 -0
  89. package/frontend/.next/server/chunks/ssr/{_2bfdd77b._.js → _7062b9c0._.js} +2 -2
  90. package/frontend/.next/server/chunks/ssr/_81435076._.js +3 -0
  91. package/frontend/.next/server/chunks/ssr/_8f399861._.js +4 -0
  92. package/frontend/.next/server/chunks/ssr/{_f26b1aca._.js → _aa02b285._.js} +2 -2
  93. package/frontend/.next/server/chunks/ssr/_b0ae6d33._.js +1 -1
  94. package/frontend/.next/server/chunks/ssr/_next-internal_server_app_dashboard_costs_page_actions_b5efa95e.js +3 -0
  95. package/frontend/.next/server/chunks/ssr/node_modules_09eef5ec._.js +3 -0
  96. package/frontend/.next/server/chunks/ssr/node_modules_b4c16e3a._.js +3 -0
  97. package/frontend/.next/server/chunks/ssr/src_app_dashboard_page_tsx_196c74b5._.js +3 -0
  98. package/frontend/.next/server/chunks/ssr/src_app_page_tsx_a7111f3e._.js +1 -1
  99. package/frontend/.next/server/chunks/ssr/src_components_ui_button_tsx_d75cfe12._.js +3 -0
  100. package/frontend/.next/server/next-font-manifest.js +1 -1
  101. package/frontend/.next/server/next-font-manifest.json +4 -0
  102. package/frontend/.next/server/pages/404.html +1 -1
  103. package/frontend/.next/server/pages/500.html +2 -2
  104. package/frontend/.next/static/chunks/139d48bcbc462224.js +1 -0
  105. package/frontend/.next/static/chunks/25c0d885ca7bcbe1.js +1 -0
  106. package/frontend/.next/static/chunks/31f0905710e3dfc3.js +1 -0
  107. package/frontend/.next/static/chunks/34b822c87d271e34.js +1 -0
  108. package/frontend/.next/static/chunks/790649543cff1084.js +1 -0
  109. package/frontend/.next/static/chunks/88a2c1056ccf4825.js +1 -0
  110. package/frontend/.next/static/chunks/9dc87ca9ab86c348.css +3 -0
  111. package/frontend/.next/static/chunks/b1b1c7e52e2182c7.js +1 -0
  112. package/frontend/.next/static/chunks/be5e61723b600d44.js +1 -0
  113. package/frontend/.next/static/chunks/c3af0c75d8e1b7b4.js +1 -0
  114. package/frontend/.next/static/chunks/f5dbb90939b55e4f.js +1 -0
  115. package/frontend/public/providers/nanobot.png +0 -0
  116. package/frontend/public/providers/nanoclaw.webp +0 -0
  117. package/frontend/public/providers/picoclaw.ico +0 -0
  118. package/frontend/public/providers/trustclaw.svg +1 -0
  119. package/frontend/public/providers/zeroclaw.png +0 -0
  120. package/package.json +1 -1
  121. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__008d27c3._.js +0 -3
  122. package/frontend/.next/server/chunks/ssr/[root-of-the-server]__69cb56c5._.js +0 -3
  123. package/frontend/.next/server/chunks/ssr/_e17fe96b._.js +0 -3
  124. package/frontend/.next/static/chunks/641e855850e79de9.css +0 -3
  125. package/frontend/.next/static/chunks/88faea50dcf8f778.js +0 -1
  126. package/frontend/.next/static/chunks/8ffedcb68f4a998f.js +0 -1
  127. package/frontend/.next/static/chunks/a909e37955d0604e.js +0 -1
  128. package/frontend/.next/static/chunks/ba72b58eb8cb3f4e.js +0 -1
  129. package/frontend/.next/static/chunks/c8ee4845be50f9b7.js +0 -1
  130. package/frontend/.next/static/chunks/e975763f7a359fb5.js +0 -1
  131. /package/frontend/.next/static/{a36G8G-fn_tjHP7E62qvj → w4h18_Clp_ODehKO0HkwI}/_buildManifest.js +0 -0
  132. /package/frontend/.next/static/{a36G8G-fn_tjHP7E62qvj → w4h18_Clp_ODehKO0HkwI}/_clientMiddlewareManifest.json +0 -0
  133. /package/frontend/.next/static/{a36G8G-fn_tjHP7E62qvj → w4h18_Clp_ODehKO0HkwI}/_ssgManifest.js +0 -0
@@ -0,0 +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},86304,a=>{"use strict";var b=a.i(84991),c=a.i(2840),d=a.i(187),e=a.i(68114);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function g({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}a.s(["Badge",()=>g],86304)},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
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__cb471d02._.js.map
@@ -0,0 +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},86304,a=>{"use strict";var b=a.i(84991),c=a.i(2840),d=a.i(187),e=a.i(68114);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function g({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}a.s(["Badge",()=>g],86304)},35680,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)}function m(a){return new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}let n={dor:{border:"border-l-blue-400",bg:"bg-blue-500/10",text:"text-blue-400",badge:"bg-blue-500/10 text-blue-400 border-blue-500/20",dot:"bg-blue-400"},ofek:{border:"border-l-amber-400",bg:"bg-amber-500/10",text:"text-amber-400",badge:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400"},anas:{border:"border-l-emerald-400",bg:"bg-emerald-500/10",text:"text-emerald-400",badge:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400"}},o=["blue-400","emerald-400","amber-400","purple-400","rose-400"];function p(a,b){return n[a]||{border:`border-l-${o[b%5]}`,bg:`bg-${o[b%5]}/10`,text:`text-${o[b%5]}`,badge:`bg-${o[b%5]}/10 text-${o[b%5]} border-${o[b%5]}/20`,dot:`bg-${o[b%5]}`}}let q={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 r(){let a=(0,d.useParams)(),n=(0,d.useRouter)(),o=a.id,[r,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(200),[A,B]=(0,c.useState)(new Set);if((0,c.useEffect)(()=>{!async function(){try{let a=await (0,i.getProject)(o);t(a)}catch{x("Project not found")}finally{v(!1)}}()},[o]),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 project..."]})});if(w||!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:w||"Project not found"}),(0,b.jsx)(f.Button,{variant:"outline",onClick:()=>n.push("/dashboard"),children:"Back to Dashboard"})]})});let C=r.timeline.slice(0,y),D=r.timeline.length>y,E={};return r.agentBreakdown.forEach((a,b)=>{E[a.agentId]=b}),(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:"Project"})]})})}),(0,b.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>n.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.jsx)("h1",{className:"text-2xl font-bold mb-2",children:r.name}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:r.description}),(0,b.jsxs)("div",{className:"flex items-center gap-6 flex-wrap",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:"text-3xl font-bold",children:["$",r.stats.totalCostUsd.toFixed(2)]}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground ml-2",children:"total cost"})]}),(0,b.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,b.jsxs)("div",{className:"font-medium text-foreground",children:[r.stats.sessionCount," sessions"]})}),(0,b.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,b.jsxs)("div",{className:"font-medium text-foreground",children:[r.stats.totalMessages," messages"]})}),(0,b.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,b.jsxs)("div",{className:"font-medium text-foreground",children:[l(r.stats.totalTokens)," tokens"]})}),(0,b.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,b.jsxs)("div",{children:[m(r.stats.dateRange.from)," — ",m(r.stats.dateRange.to)]})})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Agent Participation"}),(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.agentBreakdown.map(a=>{var c;let d=p(a.agentId,E[a.agentId]);return(0,b.jsx)(g.Card,{className:`border-l-4 ${d.border}`,children:(0,b.jsxs)(g.CardContent,{className:"pt-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(h.Badge,{variant:"outline",className:`border ${d.badge} text-xs`,children:a.agentId}),(0,b.jsxs)("span",{className:"text-lg font-bold",children:["$",a.costUsd.toFixed(2)]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(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 ${"dor"===(c=a.agentId)?"bg-blue-400":"ofek"===c?"bg-amber-400":"anas"===c?"bg-emerald-400":"bg-purple-400"} transition-all`,style:{width:`${a.percentage}%`}})}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a.percentage.toFixed(1),"% of total cost"]}),(0,b.jsxs)("span",{children:[l(a.tokenCount)," tokens"]})]}),(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.messageCount," messages"]})]})]})},a.agentId)})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Sessions"}),(0,b.jsx)("div",{className:"grid gap-3",children:r.sessions.map(a=>{let c=q[a.status],d=p(a.agentId,E[a.agentId]??0);return(0,b.jsx)("div",{onClick:()=>n.push(`/dashboard/sessions/${a.id}`),className:"rounded-xl border border-border/50 bg-card p-4 hover:border-border transition-colors cursor-pointer group",children:(0,b.jsxs)("div",{className:"flex items-start gap-4",children:[(0,b.jsx)("span",{className:`size-2.5 rounded-full mt-1.5 shrink-0 ${c.dot}`}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,b.jsx)("span",{className:"font-medium truncate max-w-[500px] group-hover:text-emerald-400 transition-colors",children:a.title.length>80?a.title.slice(0,80)+"...":a.title})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsx)(h.Badge,{variant:"outline",className:`text-[10px] border ${d.badge}`,children:a.agentId}),(0,b.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground",children:a.model}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[a.messageCount," msgs"]}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:k(a.lastActivityAt)})]})]}),(0,b.jsx)("div",{className:"flex items-center gap-4 shrink-0 text-sm",children:(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsxs)("div",{className:"font-bold",children:["$",a.costUsd.toFixed(2)]}),(0,b.jsx)("div",{className:"text-[11px] text-muted-foreground",children:l(a.tokenCount)})]})})]})},a.id)})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Unified Timeline"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Messages from all sessions merged chronologically"}),(0,b.jsx)("div",{className:"space-y-2",children:C.map(a=>(0,b.jsx)(s,{message:a,agentIndex:E,collapsed:A.has(a.id),onToggle:()=>{var b;return b=a.id,void B(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}},a.id))}),D&&(0,b.jsx)("div",{className:"text-center mt-4",children:(0,b.jsxs)(f.Button,{variant:"outline",size:"sm",className:"text-xs border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10",onClick:()=>z(a=>a+200),children:["Load more (",r.timeline.length-y," remaining)"]})}),0===r.timeline.length&&(0,b.jsx)("div",{className:"text-center py-12 text-muted-foreground text-sm",children:"No timeline messages yet."})]})]})]})}function s({message:a,agentIndex:c,collapsed:d,onToggle:e}){let f=p(a.agentId,c[a.agentId]??0),g=a.content.toLowerCase().includes("error");return"user"===a.role?(0,b.jsxs)("div",{className:`rounded-lg border-l-4 ${f.border} border border-blue-500/20 bg-blue-500/10 p-4 ${g?"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)(h.Badge,{variant:"outline",className:`text-[10px] border ${f.badge}`,children:a.agentId}),(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:`rounded-lg border-l-4 ${f.border} border border-border/50 bg-zinc-800/50 p-4 ${g?"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)(h.Badge,{variant:"outline",className:`text-[10px] border ${f.badge}`,children:a.agentId}),(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)(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)]})]}),(0,b.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:a.content})]}):"tool"===a.role?(0,b.jsxs)("div",{className:`rounded-lg border-l-4 ${f.border} border border-border/50 bg-zinc-900 p-4 ${g?"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)(h.Badge,{variant:"outline",className:`text-[10px] border ${f.badge}`,children:a.agentId}),(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:e,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:d?"Show":"Hide"})]}),!d&&(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:`rounded-lg border-l-4 ${f.border} px-4 py-2`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Badge,{variant:"outline",className:`text-[10px] border ${f.badge}`,children:a.agentId}),(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",()=>r])}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__f99f8278._.js.map