clawatch 1.1.4 → 1.1.5
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/backend/dist/routes.d.ts.map +1 -1
- package/backend/dist/routes.js +4 -2
- package/backend/dist/routes.js.map +1 -1
- package/frontend/.next/BUILD_ID +1 -1
- package/frontend/.next/build-manifest.json +2 -2
- package/frontend/.next/prerender-manifest.json +3 -3
- package/frontend/.next/server/app/_global-error.html +2 -2
- package/frontend/.next/server/app/_global-error.rsc +1 -1
- package/frontend/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/frontend/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/frontend/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/frontend/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/frontend/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.html +1 -1
- package/frontend/.next/server/app/_not-found.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/frontend/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/frontend/.next/server/app/dashboard/page.js.nft.json +1 -1
- package/frontend/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/frontend/.next/server/app/dashboard/projects/[id]/page.js.nft.json +1 -1
- package/frontend/.next/server/app/dashboard/projects/[id]/page_client-reference-manifest.js +1 -1
- package/frontend/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
- package/frontend/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/frontend/.next/server/app/dashboard.html +1 -1
- package/frontend/.next/server/app/dashboard.rsc +2 -2
- package/frontend/.next/server/app/dashboard.segments/_full.segment.rsc +2 -2
- package/frontend/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/frontend/.next/server/app/dashboard.segments/_index.segment.rsc +1 -1
- package/frontend/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/frontend/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
- package/frontend/.next/server/app/dashboard.segments/dashboard.segment.rsc +1 -1
- package/frontend/.next/server/app/index.html +2 -2
- package/frontend/.next/server/app/index.rsc +2 -2
- package/frontend/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/frontend/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/frontend/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/frontend/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/frontend/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/frontend/.next/server/app/page.js.nft.json +1 -1
- package/frontend/.next/server/app/page_client-reference-manifest.js +1 -1
- package/frontend/.next/server/chunks/ssr/_21f396dd._.js +35 -0
- package/frontend/.next/server/chunks/ssr/{_2bfdd77b._.js → _2542c95f._.js} +3 -3
- package/frontend/.next/server/chunks/ssr/_b0ae6d33._.js +1 -1
- package/frontend/.next/server/chunks/ssr/{_f26b1aca._.js → _b9077047._.js} +3 -3
- package/frontend/.next/server/chunks/ssr/_e17fe96b._.js +1 -1
- package/frontend/.next/server/pages/404.html +1 -1
- package/frontend/.next/server/pages/500.html +2 -2
- package/frontend/.next/server/server-reference-manifest.js +1 -1
- package/frontend/.next/server/server-reference-manifest.json +1 -1
- package/frontend/.next/static/chunks/{856515f7c0c70a74.js → 2b61bfc898574561.js} +1 -1
- package/frontend/.next/static/chunks/34bc00d7c1d074e7.js +33 -0
- package/frontend/.next/static/chunks/{b64a4ebe4acf6ef6.js → 6d0f2f87160fcf43.js} +1 -1
- package/frontend/.next/static/chunks/7ca25fc6318e5416.js +1 -0
- package/frontend/.next/static/chunks/{89a2e839a714c1b0.js → 89e8308f2f72ca5f.js} +1 -1
- package/frontend/.next/static/chunks/bc01d49478c01c23.js +33 -0
- package/package.json +1 -1
- package/frontend/.next/static/chunks/9e5b5ccda421a827.js +0 -33
- package/frontend/.next/static/chunks/e9d6a387c57251bc.js +0 -1
- /package/frontend/.next/static/{pDJVbL9tpaWC95Oaelf3H → 3DAlqBZKDUu5or5o5ymc3}/_buildManifest.js +0 -0
- /package/frontend/.next/static/{pDJVbL9tpaWC95Oaelf3H → 3DAlqBZKDUu5or5o5ymc3}/_clientMiddlewareManifest.json +0 -0
- /package/frontend/.next/static/{pDJVbL9tpaWC95Oaelf3H → 3DAlqBZKDUu5or5o5ymc3}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--3DAlqBZKDUu5or5o5ymc3--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/1421ed2dd17a1ef2.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/6b50f8d2ee1d2bea.js" async=""></script><script src="/_next/static/chunks/turbopack-1e12e8d4e4225e2f.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/a2dfb6fc5208ab9b.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>ClaWatch — AI Agent Observability</title><meta name="description" content="Never let your agents run wild. Open-source monitoring and alerting for AI agents."/><link rel="icon" href="/favicon.ico?favicon.146e26cc.ico" sizes="48x48" type="image/x-icon"/><link rel="icon" href="/favicon.ico" sizes="48x48"/><link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png"/><link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png"/><link rel="icon" href="/clawatch-owl-192.png" sizes="192x192" type="image/png"/><link rel="icon" href="/clawatch-owl-512.png" sizes="512x512" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased" style="font-family:var(--font-inter), system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n:HL[\"/_next/static/chunks/1421ed2dd17a1ef2.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"3DAlqBZKDUu5or5o5ymc3\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/1421ed2dd17a1ef2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased\",\"style\":{\"fontFamily\":\"var(--font-inter), system-ui, sans-serif\"},\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"title\",\"0\",{\"children\":\"ClaWatch — AI Agent Observability\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Never let your agents run wild. Open-source monitoring and alerting for AI agents.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.146e26cc.ico\",\"sizes\":\"48x48\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"48x48\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon-16x16.png\",\"sizes\":\"16x16\",\"type\":\"image/png\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/favicon-32x32.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/clawatch-owl-192.png\",\"sizes\":\"192x192\",\"type\":\"image/png\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/clawatch-owl-512.png\",\"sizes\":\"512x512\",\"type\":\"image/png\"}],[\"$\",\"link\",\"8\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\",\"sizes\":\"180x180\"}],[\"$\",\"$Lc\",\"9\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--3DAlqBZKDUu5or5o5ymc3--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/6b50f8d2ee1d2bea.js" async=""></script><script src="/_next/static/chunks/turbopack-1e12e8d4e4225e2f.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/a2dfb6fc5208ab9b.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.146e26cc.ico" sizes="48x48" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"3DAlqBZKDUu5or5o5ymc3\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/a2dfb6fc5208ab9b.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.146e26cc.ico\",\"sizes\":\"48x48\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"Ewh/Wf5ubijCU3NHSk9mcUALOiuMCQ2ykqj4McUrz3o=\"\n}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},18566,(e,t,s)=>{t.exports=e.r(76562)},15288,87486,9165,e=>{"use strict";let t,s,a,n,o;var r,i=e.i(43476),d=e.i(75157);function l({className:e,size:t="default",...s}){return(0,i.jsx)("div",{"data-slot":"card","data-size":t,className:(0,d.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})}function c({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-header",className:(0,d.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...t})}function m({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-title",className:(0,d.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function u({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-content",className:(0,d.cn)("px-4 group-data-[size=sm]/card:px-3",e),...t})}e.s(["Card",()=>l,"CardContent",()=>u,"CardHeader",()=>c,"CardTitle",()=>m],15288);var g=e.i(19805),p=e.i(27601);let h=(0,e.i(25913).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 b({className:e,variant:t="default",render:s,...a}){var n;return n={defaultTagName:"span",props:(0,g.mergeProps)({className:(0,d.cn)(h({variant:t}),e)},a),render:s,state:{slot:"badge",variant:t}},(0,p.useRenderElement)(n.defaultTagName??"div",n,n)}e.s(["Badge",()=>b],87486);var x=e.i(47167);let f=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",spend:{today:24.82,mtd:128.5,allTime:364},tokens:{today:62e4,mtd:32e5,allTime:91e5},errorCount:0,lastHeartbeatMinutesAgo:.5},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",spend:{today:12.15,mtd:64.2,allTime:238},tokens:{today:32e4,mtd:16e5,allTime:595e4},errorCount:1,lastHeartbeatMinutesAgo:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",spend:{today:18.43,mtd:108.8,allTime:410},tokens:{today:49e4,mtd:272e4,allTime:1025e4},errorCount:7,lastHeartbeatMinutesAgo:12},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",spend:{today:22.67,mtd:118.3,allTime:353},tokens:{today:57e4,mtd:296e4,allTime:8825e3},errorCount:3,lastHeartbeatMinutesAgo:45},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",spend:{today:1.03,mtd:6.4,allTime:22},tokens:{today:28e3,mtd:16e4,allTime:55e4},errorCount:0,lastHeartbeatMinutesAgo:120},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",spend:{today:8.21,mtd:47.5,allTime:170},tokens:{today:22e4,mtd:119e4,allTime:425e4},errorCount:0,lastHeartbeatMinutesAgo:.2},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",spend:{today:.45,mtd:3.2,allTime:14},tokens:{today:12e3,mtd:8e4,allTime:35e4},errorCount:0,lastHeartbeatMinutesAgo:360},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",spend:{today:16.89,mtd:86.4,allTime:271.57},tokens:{today:445e3,mtd:216e4,allTime:6775e3},errorCount:2,lastHeartbeatMinutesAgo:.1}],y={today:f.reduce((e,t)=>e+t.spend.today,0),mtd:f.reduce((e,t)=>e+t.spend.mtd,0),allTime:f.reduce((e,t)=>e+t.spend.allTime,0),tokens:{today:f.reduce((e,t)=>e+t.tokens.today,0),mtd:f.reduce((e,t)=>e+t.tokens.mtd,0),allTime:f.reduce((e,t)=>e+t.tokens.allTime,0)}},k=[{id:"proj-1",name:"ClaWatch",cost:297.43},{id:"proj-2",name:"Customer Support Bot",cost:341.82},{id:"proj-3",name:"Sales Pipeline Automation",cost:287.19},{id:"proj-4",name:"Code Review Assistant",cost:319.54},{id:"proj-5",name:"Documentation Generator",cost:381.28},{id:"proj-6",name:"Slack Integration",cost:215.31}].map(e=>({...e,pct:e.cost/y.allTime})),w={byModel:[{model:"claude-sonnet-4-20250514",costUsd:+(.65*y.allTime).toFixed(2)},{model:"claude-haiku-4-20250506",costUsd:+(.25*y.allTime).toFixed(2)},{model:"gpt-4o",costUsd:+(.1*y.allTime).toFixed(2)}]},v=new Date,j=e=>new Date(v.getTime()-6e4*e).toISOString(),C=e=>new Date(v.getTime()-36e5*e).toISOString(),N=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:j(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:j(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:j(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:j(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:C(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:j(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:C(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:j(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],A=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:j(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:j(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:C(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:j(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:C(3),acknowledged:!0}],I={totalUsd:+y.allTime.toFixed(2),totalTokens:y.tokens.allTime,sessionCount:42,byAgent:f.map(e=>({agentId:e.id,name:e.name,costUsd:e.spend.allTime,tokenCount:e.tokens.allTime})),byModel:w.byModel,byProject:k.map((e,t)=>({projectId:e.id,name:e.name,costUsd:+e.cost.toFixed(2),tokenCount:Math.floor(y.tokens.allTime*e.pct),sessionCount:5+2*t})),daily:(t=[.12,.15,.11,.17,.14,.16,.15],s=[4,6,3,7,5,6,5],Array.from({length:7},(e,a)=>{let n=new Date("2026-03-04");return n.setDate(n.getDate()+a),{date:n.toISOString().slice(0,10),costUsd:+(y.mtd*t[a]).toFixed(2),tokenCount:Math.floor(y.tokens.mtd*t[a]),sessionCount:s[a]}}))},U=[{id:"session-1",agentId:"agent-1",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:j(45),lastActivityAt:j(1),duration:2640,projects:[{id:"project-1",name:"Building ClaWatch"}]},{id:"session-2",agentId:"agent-2",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:C(3),lastActivityAt:C(2),duration:3600,projects:[{id:"project-2",name:"Bug Fixes Sprint"}]},{id:"session-3",agentId:"agent-3",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:j(90),lastActivityAt:j(12),duration:4680},{id:"session-4",agentId:"agent-1",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:C(1.5),lastActivityAt:j(.5),duration:5400,projects:[{id:"project-1",name:"Building ClaWatch"},{id:"project-2",name:"Bug Fixes Sprint"}]},{id:"session-5",agentId:"agent-2",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:C(5),lastActivityAt:C(4),duration:3600},{id:"session-6",agentId:"agent-3",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:j(30),lastActivityAt:j(8),duration:1320},{id:"session-7",agentId:"agent-1",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:C(8),lastActivityAt:C(7),duration:3600},{id:"session-8",agentId:"agent-2",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:j(15),lastActivityAt:j(2),duration:780},{id:"session-9",agentId:"agent-3",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:C(12),lastActivityAt:C(10),duration:7200},{id:"session-10",agentId:"agent-1",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:j(60),lastActivityAt:j(20),duration:2400}],$=k.map((e,t)=>({id:e.id,name:e.name,description:["Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics","Automated customer support with AI-powered ticket routing and response generation","Lead scoring, pipeline automation, and CRM integration powered by AI agents","Automated PR reviews with code quality analysis, security scanning, and style enforcement","AI-driven documentation generation from code, APIs, and architecture diagrams","Slack bot integration for team notifications, standup automation, and workflow triggers"][t],createdAt:C(48+24*t),updatedAt:j(5+15*t),sessionCount:3,totalCostUsd:+e.cost.toFixed(2)})),T=(a=[],n=0,(o=(e,t,s,o,r,i)=>{n++,a.push({sessionId:e,agentId:t,id:`tl-${n}`,role:s,timestamp:j(o),content:r,...i})})("session-1","agent-1","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),o("session-1","agent-1","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),o("session-3","agent-3","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),o("session-1","agent-1","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),o("session-3","agent-3","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),o("session-1","agent-1","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),o("session-8","agent-2","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),o("session-1","agent-1","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-3","agent-3","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),o("session-3","agent-3","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-1","agent-1","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),o("session-8","agent-2","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),o("session-1","agent-1","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),o("session-1","agent-1","system",103,"Context window: 45% utilized (90K/200K tokens)"),o("session-8","agent-2","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),o("session-1","agent-1","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),o("session-3","agent-3","user",98,"Can you also review the API layer and check for error handling gaps?"),o("session-1","agent-1","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-3","agent-3","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),o("session-8","agent-2","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),o("session-1","agent-1","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),o("session-1","agent-1","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),o("session-3","agent-3","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),o("session-1","agent-1","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),o("session-1","agent-1","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),o("session-1","agent-1","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-1","agent-1","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),o("session-1","agent-1","system",68,"Context window: 72% utilized (144K/200K tokens)"),o("session-1","agent-1","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),o("session-1","agent-1","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),a.sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime())),S=["Build dashboard with real-time monitoring","Implement API integration layer","Add automated test coverage","Optimize query performance","Set up CI/CD pipeline","Refactor authentication module","Add webhook event handlers","Build notification system","Implement rate limiting","Create admin management panel"],P=Object.fromEntries(k.map((e,t)=>{let s=+e.cost.toFixed(2),a=Math.floor(y.tokens.allTime*e.pct),n=40+20*t,o=[f[t%8],f[(t+1)%8],f[(t+3)%8]],r=[.5,.3,.2],i=o.map((i,d)=>{let l=d===o.length-1,c=l?r.slice(0,d).reduce((e,t)=>e+ +(s*t).toFixed(2),0):0,m=l?+(s-c).toFixed(2):+(s*r[d]).toFixed(2),u=l?r.slice(0,d).reduce((e,t)=>e+Math.round(n*t),0):0,g=l?n-u:Math.round(n*r[d]);return{id:`proj-${t+1}-session-${d+1}`,agentId:i.id,title:S[(3*t+d)%S.length],status:0===d?"active":1===d?"idle":"completed",costUsd:m,tokenCount:Math.floor(a*r[d]),messageCount:g,model:d%3==2?"claude-haiku-4-20250506":"claude-sonnet-4-20250514",startedAt:C(4*d+1),lastActivityAt:j(15*d+2),duration:1800+1200*d,projects:[{id:e.id,name:e.name}]}});return[e.id,{id:e.id,name:e.name,description:$[t]?.description||e.name,stats:{totalCostUsd:s,totalTokens:a,totalMessages:n,sessionCount:o.length,dateRange:{from:C(48+24*t),to:j(5+15*t)}},agentBreakdown:o.map((e,t)=>({agentId:e.id,costUsd:+(s*r[t]).toFixed(2),tokenCount:Math.floor(a*r[t]),messageCount:Math.floor(n*r[t]),percentage:100*r[t]})),sessions:i,timeline:0===t?T:[]}]})),M={};for(let e of U)M[e.id]={...e,costByModel:e.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*e.costUsd,tokenCount:Math.floor(.75*e.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*e.costUsd,tokenCount:Math.floor(.25*e.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*e.costUsd,tokenCount:Math.floor(.6*e.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*e.costUsd,tokenCount:Math.floor(.4*e.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*e.tokenCount),output:Math.floor(.3*e.tokenCount),cacheRead:Math.floor(.25*e.tokenCount),cacheWrite:Math.floor(.1*e.tokenCount)},messages:(r=e.id,[{id:`${r}-msg-1`,role:"user",timestamp:j(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${r}-msg-2`,role:"assistant",timestamp:j(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${r}-msg-3`,role:"tool",timestamp:j(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${r}-msg-4`,role:"assistant",timestamp:j(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${r}-msg-5`,role:"tool",timestamp:j(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${r}-msg-6`,role:"assistant",timestamp:j(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${r}-msg-7`,role:"tool",timestamp:j(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${r}-msg-8`,role:"tool",timestamp:j(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${r}-msg-9`,role:"assistant",timestamp:j(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${r}-msg-10`,role:"tool",timestamp:j(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${r}-msg-11`,role:"user",timestamp:j(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${r}-msg-12`,role:"assistant",timestamp:j(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${r}-msg-13`,role:"tool",timestamp:j(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${r}-msg-14`,role:"system",timestamp:j(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${r}-msg-15`,role:"assistant",timestamp:j(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${r}-msg-16`,role:"tool",timestamp:j(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${r}-msg-17`,role:"assistant",timestamp:j(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${r}-msg-18`,role:"tool",timestamp:j(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${r}-msg-19`,role:"assistant",timestamp:j(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${r}-msg-20`,role:"tool",timestamp:j(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let B={"alert-1":{alert:A[0],agent:{id:"agent-4",name:"customer-support",status:"stuck"},relatedErrors:[],context:{lastHeartbeat:j(45),stuckDurationMinutes:45,agentStatus:"stuck"}},"alert-2":{alert:A[1],agent:{id:"agent-3",name:"data-pipeline",status:"error"},relatedErrors:[{timestamp:j(12),error:"TypeError: Cannot read properties of undefined (reading 'map')"},{timestamp:j(11),error:"ECONNREFUSED: Connection refused to database at 127.0.0.1:5432"},{timestamp:j(11),error:"ECONNREFUSED: Connection refused to database at 127.0.0.1:5432"},{timestamp:j(10),error:"Unhandled promise rejection: Query timeout after 30000ms"},{timestamp:j(10),error:'FATAL: too many connections for role "app_user"'}]},"alert-3":{alert:A[2],agent:{id:"agent-4",name:"customer-support",status:"running"},relatedErrors:[],context:{currentCostUsd:12.67,thresholdUsd:10,overage:2.67}},"alert-4":{alert:A[3],agent:{id:"agent-8",name:"slack-responder",status:"running"},relatedErrors:[{timestamp:j(32),error:"Detected 5 consecutive similar outputs — possible retry loop"},{timestamp:j(31),error:"Output similarity score: 0.94 (threshold: 0.85)"}]},"alert-5":{alert:A[4],agent:{id:"agent-2",name:"deploy-bot",status:"running"},relatedErrors:[{timestamp:C(3),error:"API returned 503 Service Unavailable — auto-retried successfully"}]}},F=x.default.env.NEXT_PUBLIC_API_URL||"",D=x.default.env.NEXT_PUBLIC_API_KEY||"",z=!1;function L(){return z}function E(){z=!0}async function R(e,t){let s={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...D?{"X-ClaWatch-Key":D}:{},...t?.headers||{}},a=await fetch(`${F}${e}`,{...t,headers:s});if(!a.ok)throw Error(`API error: ${a.status}`);return a.json()}async function O(){try{return(await R("/api/profiles")).profiles}catch{return console.warn("API unreachable, skipping profiles"),[]}}async function _(){try{return(await R("/api/version")).version}catch{return console.warn("API unreachable, skipping version"),null}}async function H(e,t){try{let s=new URLSearchParams;e&&s.set("status",e),t&&s.set("profile",t);let a=s.toString();return(await R(`/api/agents${a?`?${a}`:""}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),E(),N}}async function W(e){try{let t=new URLSearchParams;e?.limit!==void 0&&t.set("limit",String(e.limit)),e?.offset!==void 0&&t.set("offset",String(e.offset)),e?.severity&&t.set("severity",e.severity),e?.acknowledged!==void 0&&t.set("acknowledged",String(e.acknowledged)),e?.profile&&t.set("profile",e.profile);let s=t.toString();return await R(`/api/alerts${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock data"),E(),{alerts:A,total:A.length}}}async function K(e){return await R(`/api/alerts/acknowledge-all${e?`?severity=${e}`:""}`,{method:"POST"})}async function J(e){try{let t=new URLSearchParams;e?.profile&&t.set("profile",e.profile),e?.from&&t.set("from",e.from),e?.to&&t.set("to",e.to);let s=t.toString();return await R(`/api/costs${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock data"),E(),I}}async function q(e){await R(`/api/agents/${e}/pause`,{method:"POST"})}async function G(e){await R(`/api/agents/${e}/resume`,{method:"POST"})}async function X(e){await R(`/api/alerts/${e}/acknowledge`,{method:"POST"})}async function Q(e){try{return await R(`/api/alerts/${e}/details`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=B[e];if(t)return t;throw Error("Alert not found")}}async function V(e){let{agentId:t,status:s,sort:a,profile:n,limit:o,offset:r}=e||{};try{let e=new URLSearchParams;o&&e.set("limit",String(o)),r&&e.set("offset",String(r)),t&&e.set("agentId",t),s&&e.set("status",s),a&&e.set("sort",a),n&&e.set("profile",n);let i=e.toString(),d=await R(`/api/sessions${i?`?${i}`:""}`);return{sessions:d.sessions,total:d.total}}catch{return console.warn("API unreachable, falling back to mock data"),E(),{sessions:U,total:U.length}}}async function Y(e){try{return await R(`/api/sessions/${e}`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=M[e];if(t)return t;throw Error("Session not found")}}async function Z(e){try{let t=e?`?profile=${e}`:"";return(await R(`/api/projects${t}`)).projects}catch{return console.warn("API unreachable, falling back to mock data"),E(),$}}async function ee(e){try{return await R(`/api/projects/${e}`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=P[e];if(t)return t;throw Error("Project not found")}}async function et(e,t){return await R("/api/projects",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function es(e,t){await R(`/api/sessions/${e}/projects`,{method:"PUT",body:JSON.stringify({projectIds:t})})}async function ea(e,t){await R(`/api/sessions/${e}/projects/${t}`,{method:"DELETE"})}function en(e){let t=f.filter(e=>e.spend.allTime>50),s=k.map(e=>({projectId:e.id,name:e.name,pct:e.pct})),a=(e,a,n,o,r,i)=>{let d=a.reduce((e,t)=>e+t,0),l=((e,t)=>{let s=t.reduce((e,t)=>e+t,0),a=t.map(e=>42*e/s),n=a.map(e=>Math.floor(e)),o=42-n.reduce((e,t)=>e+t,0),r=a.map((e,t)=>({i:t,frac:e-n[t]})).sort((e,t)=>t.frac-e.frac);for(let e=0;e<o;e++)n[r[e].i]++;return n})(0,a);return{buckets:e.map((e,t)=>({date:e,costUsd:+(n*a[t]/d).toFixed(2),tokenCount:Math.floor(o*a[t]/d),sessionCount:l[t]})),byAgent:t.map(s=>({agentId:s.name,buckets:e.map((e,n)=>({date:e,costUsd:+(s.spend[r]*a[n]/d).toFixed(2),tokenCount:Math.floor(s.tokens[i]*a[n]/d),sessionCount:Math.max(0,Math.round(42/t.length*a[n]/d))}))})),byProject:s.map(({projectId:t,name:s,pct:r})=>({projectId:t,name:s,buckets:e.map((e,t)=>({date:e,costUsd:+(n*r*a[t]/d).toFixed(2),tokenCount:Math.floor(o*r*a[t]/d),sessionCount:Math.max(0,Math.round(42*r*a[t]/d))}))}))}};if("hour"===e){let e=[.02,.005,.003,.003,.003,.005,.008,.02,.04,.06,.07,.075,.065,.07,.075,.07,.065,.06,.055,.05,.04,.035,.03,.025],t=[.85,.95,1.2],s=[],n=[];for(let a=0;a<3;a++)for(let o=0;o<24;o++){s.push(e[o]*t[a]);let r=new Date;r.setDate(r.getDate()-(2-a)),r.setHours(o,0,0,0),n.push(r.toISOString().slice(0,13)+":00")}return a(n,s,3*y.today,3*y.tokens.today,"today","today")}if("week"===e)return a(Array.from({length:8},(e,t)=>{let s=new Date("2026-01-13");return s.setDate(s.getDate()+7*t),s.toISOString().slice(0,10)}),[.08,.09,.1,.11,.12,.13,.17,.2],y.allTime,y.tokens.allTime,"allTime","allTime");let n=Array.from({length:56},(e,t)=>{let s=new Date("2026-01-13");return s.setDate(s.getDate()+t),s.toISOString().slice(0,10)}),o=n.map((e,t)=>{let s=Math.floor(t/7),a=t%7;return(.7+.08*s)*(a>=5?.4:.8+a%3*.1)});return a(n,o,y.allTime,y.tokens.allTime,"allTime","allTime")}let eo={hour:en("hour"),day:en("day"),week:en("week")};async function er(e){try{let t=new URLSearchParams;e.profile&&t.set("profile",e.profile),e.groupBy&&t.set("groupBy",e.groupBy),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to);let s=t.toString();return await R(`/api/analytics${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock analytics data"),eo[e.groupBy||"day"]||eo.day}}let ei={today:94.72,mtd:236.83,allTime:1842.57,byAgent:{anas:{today:36.21,mtd:69.12},ofek:{today:42.83,mtd:112.18},dor:{today:15.68,mtd:55.53}},limits:{type:null,amount:null,agentLimits:{}},usagePercent:null};async function ed(e){try{let t=e?`?profile=${e}`:"";return await R(`/api/spend${t}`)}catch{return console.warn("API unreachable, falling back to mock spend data"),ei}}async function el(e){return await R("/api/settings/cost-limits",{method:"PUT",body:JSON.stringify(e)})}e.s(["acknowledgeAlert",()=>X,"acknowledgeAllAlerts",()=>K,"createProject",()=>et,"getAgents",()=>H,"getAlertDetails",()=>Q,"getAlerts",()=>W,"getAnalytics",()=>er,"getCosts",()=>J,"getProfiles",()=>O,"getProject",()=>ee,"getProjects",()=>Z,"getSession",()=>Y,"getSessions",()=>V,"getSpend",()=>ed,"getVersion",()=>_,"isUsingMockData",()=>L,"pauseAgent",()=>q,"removeSessionProject",()=>ea,"resumeAgent",()=>G,"setCostLimits",()=>el,"setSessionProjects",()=>es],9165)},88899,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(22016),o=e.i(19455),r=e.i(15288),i=e.i(87486),d=e.i(9165),l=e.i(98940);function c(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function m(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function u(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}let g={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"}},p=["blue-400","emerald-400","amber-400","purple-400","rose-400"];function h(e,t){return g[e]||{border:`border-l-${p[t%5]}`,bg:`bg-${p[t%5]}/10`,text:`text-${p[t%5]}`,badge:`bg-${p[t%5]}/10 text-${p[t%5]} border-${p[t%5]}/20`,dot:`bg-${p[t%5]}`}}let b={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 x(){let e=(0,a.useParams)(),g=(0,a.useRouter)(),p=e.id,[x,y]=(0,s.useState)(null),[k,w]=(0,s.useState)(!0),[v,j]=(0,s.useState)(null),[C,N]=(0,s.useState)(200),[A,I]=(0,s.useState)(new Set);if((0,s.useEffect)(()=>{!async function(){try{let e=await (0,d.getProject)(p);y(e)}catch{j("Project not found")}finally{w(!1)}}()},[p]),k)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,t.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading project..."]})});if(v||!x)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center space-y-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:v||"Project not found"}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>g.push("/dashboard"),children:"Back to Dashboard"})]})});let U=x.timeline.slice(0,C),$=x.timeline.length>C,T={};return x.agentBreakdown.forEach((e,t)=>{T[e.agentId]=t}),(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsxs)(n.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)(l.ClaWatchIcon,{}),(0,t.jsx)(l.ClaWatchLogo,{size:"md"})]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Project"})]})})}),(0,t.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>g.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,t.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold mb-2",children:x.name}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,t.jsxs)("div",{className:"flex items-center gap-6 flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:["$",x.stats.totalCostUsd.toFixed(2)]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground ml-2",children:"total cost"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.sessionCount," sessions"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.totalMessages," messages"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[m(x.stats.totalTokens)," tokens"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,t.jsxs)("div",{children:[u(x.stats.dateRange.from)," — ",u(x.stats.dateRange.to)]})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Agent Participation"}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.agentBreakdown.map(e=>{var s;let a=h(e.agentId,T[e.agentId]);return(0,t.jsx)(r.Card,{className:`border-l-4 ${a.border}`,children:(0,t.jsxs)(r.CardContent,{className:"pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`border ${a.badge} text-xs`,children:e.agentId}),(0,t.jsxs)("span",{className:"text-lg font-bold",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full ${"dor"===(s=e.agentId)?"bg-blue-400":"ofek"===s?"bg-amber-400":"anas"===s?"bg-emerald-400":"bg-purple-400"} transition-all`,style:{width:`${e.percentage}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.percentage.toFixed(1),"% of total cost"]}),(0,t.jsxs)("span",{children:[m(e.tokenCount)," tokens"]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.messageCount," messages"]})]})]})},e.agentId)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Sessions"}),(0,t.jsx)("div",{className:"grid gap-3",children:x.sessions.map(e=>{let s=b[e.status],a=h(e.agentId,T[e.agentId]??0);return(0,t.jsx)("div",{onClick:()=>g.push(`/dashboard/sessions/${e.id}`),className:"rounded-xl border border-border/50 bg-card p-4 hover:border-border transition-colors cursor-pointer group",children:(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("span",{className:`size-2.5 rounded-full mt-1.5 shrink-0 ${s.dot}`}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,t.jsx)("span",{className:"font-medium truncate max-w-[500px] group-hover:text-emerald-400 transition-colors",children:e.title.length>80?e.title.slice(0,80)+"...":e.title})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${a.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground",children:e.model}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[e.messageCount," msgs"]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.lastActivityAt)})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 shrink-0 text-sm",children:(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("div",{className:"font-bold",children:["$",e.costUsd.toFixed(2)]}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:m(e.tokenCount)})]})})]})},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Unified Timeline"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Messages from all sessions merged chronologically"}),(0,t.jsx)("div",{className:"space-y-2",children:U.map(e=>(0,t.jsx)(f,{message:e,agentIndex:T,collapsed:A.has(e.id),onToggle:()=>{var t;return t=e.id,void I(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}},e.id))}),$&&(0,t.jsx)("div",{className:"text-center mt-4",children:(0,t.jsxs)(o.Button,{variant:"outline",size:"sm",className:"text-xs border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10",onClick:()=>N(e=>e+200),children:["Load more (",x.timeline.length-C," remaining)"]})}),0===x.timeline.length&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground text-sm",children:"No timeline messages yet."})]})]})]})}function f({message:e,agentIndex:s,collapsed:a,onToggle:n}){let o=h(e.agentId,s[e.agentId]??0),r=e.content.toLowerCase().includes("error");return"user"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-blue-500/20 bg-blue-500/10 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"assistant"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-800/50 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),e.model&&(0,t.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:e.model}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),null!=e.costUsd&&(0,t.jsxs)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"tool"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-900 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),e.toolName&&(0,t.jsx)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:e.toolName}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("button",{onClick:n,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:a?"Show":"Hide"})]}),!a&&(0,t.jsx)("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:e.content})]}):(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} px-4 py-2`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.content})]})}e.s(["default",()=>x])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},18566,(e,t,s)=>{t.exports=e.r(76562)},15288,87486,9165,e=>{"use strict";let t,s,a,n,o;var r,i=e.i(43476),d=e.i(75157);function l({className:e,size:t="default",...s}){return(0,i.jsx)("div",{"data-slot":"card","data-size":t,className:(0,d.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})}function c({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-header",className:(0,d.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...t})}function u({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-title",className:(0,d.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function m({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"card-content",className:(0,d.cn)("px-4 group-data-[size=sm]/card:px-3",e),...t})}e.s(["Card",()=>l,"CardContent",()=>m,"CardHeader",()=>c,"CardTitle",()=>u],15288);var g=e.i(19805),p=e.i(27601);let h=(0,e.i(25913).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 b({className:e,variant:t="default",render:s,...a}){var n;return n={defaultTagName:"span",props:(0,g.mergeProps)({className:(0,d.cn)(h({variant:t}),e)},a),render:s,state:{slot:"badge",variant:t}},(0,p.useRenderElement)(n.defaultTagName??"div",n,n)}e.s(["Badge",()=>b],87486);var x=e.i(47167);let f=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",spend:{today:24.82,mtd:128.5,allTime:364},tokens:{today:62e4,mtd:32e5,allTime:91e5},errorCount:0,lastHeartbeatMinutesAgo:.5},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",spend:{today:12.15,mtd:64.2,allTime:238},tokens:{today:32e4,mtd:16e5,allTime:595e4},errorCount:1,lastHeartbeatMinutesAgo:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",spend:{today:18.43,mtd:108.8,allTime:410},tokens:{today:49e4,mtd:272e4,allTime:1025e4},errorCount:7,lastHeartbeatMinutesAgo:12},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",spend:{today:22.67,mtd:118.3,allTime:353},tokens:{today:57e4,mtd:296e4,allTime:8825e3},errorCount:3,lastHeartbeatMinutesAgo:45},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",spend:{today:1.03,mtd:6.4,allTime:22},tokens:{today:28e3,mtd:16e4,allTime:55e4},errorCount:0,lastHeartbeatMinutesAgo:120},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",spend:{today:8.21,mtd:47.5,allTime:170},tokens:{today:22e4,mtd:119e4,allTime:425e4},errorCount:0,lastHeartbeatMinutesAgo:.2},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",spend:{today:.45,mtd:3.2,allTime:14},tokens:{today:12e3,mtd:8e4,allTime:35e4},errorCount:0,lastHeartbeatMinutesAgo:360},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",spend:{today:16.89,mtd:86.4,allTime:271.57},tokens:{today:445e3,mtd:216e4,allTime:6775e3},errorCount:2,lastHeartbeatMinutesAgo:.1}],y={today:f.reduce((e,t)=>e+t.spend.today,0),mtd:f.reduce((e,t)=>e+t.spend.mtd,0),allTime:f.reduce((e,t)=>e+t.spend.allTime,0),tokens:{today:f.reduce((e,t)=>e+t.tokens.today,0),mtd:f.reduce((e,t)=>e+t.tokens.mtd,0),allTime:f.reduce((e,t)=>e+t.tokens.allTime,0)}},k=[{id:"proj-1",name:"ClaWatch",cost:297.43},{id:"proj-2",name:"Customer Support Bot",cost:341.82},{id:"proj-3",name:"Sales Pipeline Automation",cost:287.19},{id:"proj-4",name:"Code Review Assistant",cost:319.54},{id:"proj-5",name:"Documentation Generator",cost:381.28},{id:"proj-6",name:"Slack Integration",cost:215.31}].map(e=>({...e,pct:e.cost/y.allTime})),w={byModel:[{model:"claude-sonnet-4-20250514",costUsd:+(.65*y.allTime).toFixed(2)},{model:"claude-haiku-4-20250506",costUsd:+(.25*y.allTime).toFixed(2)},{model:"gpt-4o",costUsd:+(.1*y.allTime).toFixed(2)}]},v=new Date,j=e=>new Date(v.getTime()-6e4*e).toISOString(),C=e=>new Date(v.getTime()-36e5*e).toISOString(),N=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:j(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:j(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:j(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:j(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:C(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:j(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:C(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:j(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],A=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:j(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:j(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:C(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:j(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:C(3),acknowledged:!0}],I={totalUsd:+y.allTime.toFixed(2),totalTokens:y.tokens.allTime,sessionCount:42,byAgent:f.map(e=>({agentId:e.id,name:e.name,costUsd:e.spend.allTime,tokenCount:e.tokens.allTime})),byModel:w.byModel,byProject:k.map((e,t)=>({projectId:e.id,name:e.name,costUsd:+e.cost.toFixed(2),tokenCount:Math.floor(y.tokens.allTime*e.pct),sessionCount:5+2*t})),daily:(t=[.12,.15,.11,.17,.14,.16,.15],s=[4,6,3,7,5,6,5],Array.from({length:7},(e,a)=>{let n=new Date("2026-03-04");return n.setDate(n.getDate()+a),{date:n.toISOString().slice(0,10),costUsd:+(y.mtd*t[a]).toFixed(2),tokenCount:Math.floor(y.tokens.mtd*t[a]),sessionCount:s[a]}}))},T=[{id:"session-1",agentId:"agent-1",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:j(45),lastActivityAt:j(1),duration:2640,projects:[{id:"project-1",name:"Building ClaWatch"}]},{id:"session-2",agentId:"agent-2",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:C(3),lastActivityAt:C(2),duration:3600,projects:[{id:"project-2",name:"Bug Fixes Sprint"}]},{id:"session-3",agentId:"agent-3",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:j(90),lastActivityAt:j(12),duration:4680},{id:"session-4",agentId:"agent-1",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:C(1.5),lastActivityAt:j(.5),duration:5400,projects:[{id:"project-1",name:"Building ClaWatch"},{id:"project-2",name:"Bug Fixes Sprint"}]},{id:"session-5",agentId:"agent-2",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:C(5),lastActivityAt:C(4),duration:3600},{id:"session-6",agentId:"agent-3",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:j(30),lastActivityAt:j(8),duration:1320},{id:"session-7",agentId:"agent-1",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:C(8),lastActivityAt:C(7),duration:3600},{id:"session-8",agentId:"agent-2",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:j(15),lastActivityAt:j(2),duration:780},{id:"session-9",agentId:"agent-3",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:C(12),lastActivityAt:C(10),duration:7200},{id:"session-10",agentId:"agent-1",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:j(60),lastActivityAt:j(20),duration:2400}],U=k.map((e,t)=>({id:e.id,name:e.name,description:["Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics","Automated customer support with AI-powered ticket routing and response generation","Lead scoring, pipeline automation, and CRM integration powered by AI agents","Automated PR reviews with code quality analysis, security scanning, and style enforcement","AI-driven documentation generation from code, APIs, and architecture diagrams","Slack bot integration for team notifications, standup automation, and workflow triggers"][t],createdAt:C(48+24*t),updatedAt:j(5+15*t),sessionCount:3,totalCostUsd:+e.cost.toFixed(2)})),$=(a=[],n=0,(o=(e,t,s,o,r,i)=>{n++,a.push({sessionId:e,agentId:t,id:`tl-${n}`,role:s,timestamp:j(o),content:r,...i})})("session-1","agent-1","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),o("session-1","agent-1","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),o("session-3","agent-3","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),o("session-1","agent-1","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),o("session-3","agent-3","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),o("session-1","agent-1","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),o("session-8","agent-2","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),o("session-1","agent-1","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-3","agent-3","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),o("session-3","agent-3","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-1","agent-1","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),o("session-8","agent-2","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),o("session-1","agent-1","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),o("session-1","agent-1","system",103,"Context window: 45% utilized (90K/200K tokens)"),o("session-8","agent-2","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),o("session-1","agent-1","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),o("session-3","agent-3","user",98,"Can you also review the API layer and check for error handling gaps?"),o("session-1","agent-1","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-3","agent-3","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),o("session-8","agent-2","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),o("session-1","agent-1","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),o("session-1","agent-1","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),o("session-3","agent-3","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),o("session-1","agent-1","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),o("session-1","agent-1","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),o("session-1","agent-1","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),o("session-8","agent-2","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),o("session-1","agent-1","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),o("session-1","agent-1","system",68,"Context window: 72% utilized (144K/200K tokens)"),o("session-1","agent-1","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),o("session-1","agent-1","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),a.sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime())),S=["Build dashboard with real-time monitoring","Implement API integration layer","Add automated test coverage","Optimize query performance","Set up CI/CD pipeline","Refactor authentication module","Add webhook event handlers","Build notification system","Implement rate limiting","Create admin management panel"],P=Object.fromEntries(k.map((e,t)=>{let s=+e.cost.toFixed(2),a=Math.floor(y.tokens.allTime*e.pct),n=40+20*t,o=[f[t%8],f[(t+1)%8],f[(t+3)%8]],r=[.5,.3,.2],i=o.map((i,d)=>{let l=d===o.length-1,c=l?r.slice(0,d).reduce((e,t)=>e+ +(s*t).toFixed(2),0):0,u=l?+(s-c).toFixed(2):+(s*r[d]).toFixed(2),m=l?r.slice(0,d).reduce((e,t)=>e+Math.round(n*t),0):0,g=l?n-m:Math.round(n*r[d]);return{id:`proj-${t+1}-session-${d+1}`,agentId:i.id,title:S[(3*t+d)%S.length],status:0===d?"active":1===d?"idle":"completed",costUsd:u,tokenCount:Math.floor(a*r[d]),messageCount:g,model:d%3==2?"claude-haiku-4-20250506":"claude-sonnet-4-20250514",startedAt:C(4*d+1),lastActivityAt:j(15*d+2),duration:1800+1200*d,projects:[{id:e.id,name:e.name}]}});return[e.id,{id:e.id,name:e.name,description:U[t]?.description||e.name,stats:{totalCostUsd:s,totalTokens:a,totalMessages:n,sessionCount:o.length,dateRange:{from:C(48+24*t),to:j(5+15*t)}},agentBreakdown:o.map((e,t)=>({agentId:e.id,costUsd:+(s*r[t]).toFixed(2),tokenCount:Math.floor(a*r[t]),messageCount:Math.floor(n*r[t]),percentage:100*r[t]})),sessions:i,timeline:0===t?$:[]}]})),M={};for(let e of T)M[e.id]={...e,costByModel:e.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*e.costUsd,tokenCount:Math.floor(.75*e.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*e.costUsd,tokenCount:Math.floor(.25*e.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*e.costUsd,tokenCount:Math.floor(.6*e.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*e.costUsd,tokenCount:Math.floor(.4*e.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*e.tokenCount),output:Math.floor(.3*e.tokenCount),cacheRead:Math.floor(.25*e.tokenCount),cacheWrite:Math.floor(.1*e.tokenCount)},messages:(r=e.id,[{id:`${r}-msg-1`,role:"user",timestamp:j(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${r}-msg-2`,role:"assistant",timestamp:j(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${r}-msg-3`,role:"tool",timestamp:j(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${r}-msg-4`,role:"assistant",timestamp:j(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${r}-msg-5`,role:"tool",timestamp:j(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${r}-msg-6`,role:"assistant",timestamp:j(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${r}-msg-7`,role:"tool",timestamp:j(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${r}-msg-8`,role:"tool",timestamp:j(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${r}-msg-9`,role:"assistant",timestamp:j(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${r}-msg-10`,role:"tool",timestamp:j(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${r}-msg-11`,role:"user",timestamp:j(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${r}-msg-12`,role:"assistant",timestamp:j(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${r}-msg-13`,role:"tool",timestamp:j(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${r}-msg-14`,role:"system",timestamp:j(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${r}-msg-15`,role:"assistant",timestamp:j(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${r}-msg-16`,role:"tool",timestamp:j(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${r}-msg-17`,role:"assistant",timestamp:j(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${r}-msg-18`,role:"tool",timestamp:j(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${r}-msg-19`,role:"assistant",timestamp:j(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${r}-msg-20`,role:"tool",timestamp:j(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let B={"alert-1":{alert:A[0],agent:{id:"agent-4",name:"customer-support",status:"stuck"},relatedErrors:[],context:{lastHeartbeat:j(45),stuckDurationMinutes:45,agentStatus:"stuck"}},"alert-2":{alert:A[1],agent:{id:"agent-3",name:"data-pipeline",status:"error"},relatedErrors:[{timestamp:j(12),error:"TypeError: Cannot read properties of undefined (reading 'map')"},{timestamp:j(11),error:"ECONNREFUSED: Connection refused to database at 127.0.0.1:5432"},{timestamp:j(11),error:"ECONNREFUSED: Connection refused to database at 127.0.0.1:5432"},{timestamp:j(10),error:"Unhandled promise rejection: Query timeout after 30000ms"},{timestamp:j(10),error:'FATAL: too many connections for role "app_user"'}]},"alert-3":{alert:A[2],agent:{id:"agent-4",name:"customer-support",status:"running"},relatedErrors:[],context:{currentCostUsd:12.67,thresholdUsd:10,overage:2.67}},"alert-4":{alert:A[3],agent:{id:"agent-8",name:"slack-responder",status:"running"},relatedErrors:[{timestamp:j(32),error:"Detected 5 consecutive similar outputs — possible retry loop"},{timestamp:j(31),error:"Output similarity score: 0.94 (threshold: 0.85)"}]},"alert-5":{alert:A[4],agent:{id:"agent-2",name:"deploy-bot",status:"running"},relatedErrors:[{timestamp:C(3),error:"API returned 503 Service Unavailable — auto-retried successfully"}]}},D=x.default.env.NEXT_PUBLIC_API_URL||"",F=x.default.env.NEXT_PUBLIC_API_KEY||"",z=!1;function L(){return z}function E(){z=!0}async function R(e,t){let s={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...F?{"X-ClaWatch-Key":F}:{},...t?.headers||{}},a=await fetch(`${D}${e}`,{...t,headers:s});if(!a.ok)throw Error(`API error: ${a.status}`);return a.json()}async function O(){try{return(await R("/api/profiles")).profiles}catch{return console.warn("API unreachable, skipping profiles"),[]}}async function _(){try{return(await R("/api/version")).version}catch{return console.warn("API unreachable, skipping version"),null}}async function H(e,t){try{let s=new URLSearchParams;e&&s.set("status",e),t&&s.set("profile",t);let a=s.toString();return(await R(`/api/agents${a?`?${a}`:""}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),E(),N}}async function W(e){try{let t=new URLSearchParams;e?.limit!==void 0&&t.set("limit",String(e.limit)),e?.offset!==void 0&&t.set("offset",String(e.offset)),e?.severity&&t.set("severity",e.severity),e?.acknowledged!==void 0&&t.set("acknowledged",String(e.acknowledged)),e?.profile&&t.set("profile",e.profile);let s=t.toString();return await R(`/api/alerts${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock data"),E(),{alerts:A,total:A.length}}}async function K(e){return await R(`/api/alerts/acknowledge-all${e?`?severity=${e}`:""}`,{method:"POST"})}async function Z(e){try{let t=new URLSearchParams;e?.profile&&t.set("profile",e.profile),e?.from&&t.set("from",e.from),e?.to&&t.set("to",e.to);let s=t.toString();return await R(`/api/costs${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock data"),E(),I}}async function J(e){await R(`/api/agents/${e}/pause`,{method:"POST"})}async function q(e){await R(`/api/agents/${e}/resume`,{method:"POST"})}async function G(e){await R(`/api/alerts/${e}/acknowledge`,{method:"POST"})}async function X(e){try{return await R(`/api/alerts/${e}/details`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=B[e];if(t)return t;throw Error("Alert not found")}}async function Q(e){let{agentId:t,status:s,sort:a,profile:n,limit:o,offset:r}=e||{};try{let e=new URLSearchParams;o&&e.set("limit",String(o)),r&&e.set("offset",String(r)),t&&e.set("agentId",t),s&&e.set("status",s),a&&e.set("sort",a),n&&e.set("profile",n);let i=e.toString(),d=await R(`/api/sessions${i?`?${i}`:""}`);return{sessions:d.sessions,total:d.total}}catch{return console.warn("API unreachable, falling back to mock data"),E(),{sessions:T,total:T.length}}}async function V(e){try{return await R(`/api/sessions/${e}`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=M[e];if(t)return t;throw Error("Session not found")}}async function Y(e){try{let t=e?`?profile=${e}`:"";return(await R(`/api/projects${t}`)).projects}catch{return console.warn("API unreachable, falling back to mock data"),E(),U}}async function ee(e){try{return await R(`/api/projects/${e}`)}catch{console.warn("API unreachable, falling back to mock data"),E();let t=P[e];if(t)return t;throw Error("Project not found")}}async function et(e,t){return await R("/api/projects",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function es(e,t){await R(`/api/sessions/${e}/projects`,{method:"PUT",body:JSON.stringify({projectIds:t})})}async function ea(e,t){await R(`/api/sessions/${e}/projects/${t}`,{method:"DELETE"})}function en(e){let t=f.filter(e=>e.spend.allTime>50),s=k.map(e=>({projectId:e.id,name:e.name,pct:e.pct})),a=(e,a,n,o,r,i)=>{let d=a.reduce((e,t)=>e+t,0),l=((e,t)=>{let s=t.reduce((e,t)=>e+t,0),a=t.map(e=>42*e/s),n=a.map(e=>Math.floor(e)),o=42-n.reduce((e,t)=>e+t,0),r=a.map((e,t)=>({i:t,frac:e-n[t]})).sort((e,t)=>t.frac-e.frac);for(let e=0;e<o;e++)n[r[e].i]++;return n})(0,a);return{buckets:e.map((e,t)=>({date:e,costUsd:+(n*a[t]/d).toFixed(2),tokenCount:Math.floor(o*a[t]/d),sessionCount:l[t]})),byAgent:t.map(s=>({agentId:s.name,buckets:e.map((e,n)=>({date:e,costUsd:+(s.spend[r]*a[n]/d).toFixed(2),tokenCount:Math.floor(s.tokens[i]*a[n]/d),sessionCount:Math.max(0,Math.round(42/t.length*a[n]/d))}))})),byProject:s.map(({projectId:t,name:s,pct:r})=>({projectId:t,name:s,buckets:e.map((e,t)=>({date:e,costUsd:+(n*r*a[t]/d).toFixed(2),tokenCount:Math.floor(o*r*a[t]/d),sessionCount:Math.max(0,Math.round(42*r*a[t]/d))}))}))}};if("hour"===e){let e=[.02,.005,.003,.003,.003,.005,.008,.02,.04,.06,.07,.075,.065,.07,.075,.07,.065,.06,.055,.05,.04,.035,.03,.025],t=[.85,.95,1.2],s=[],n=[];for(let a=0;a<3;a++)for(let o=0;o<24;o++){s.push(e[o]*t[a]);let r=new Date;r.setDate(r.getDate()-(2-a)),r.setHours(o,0,0,0),n.push(r.toISOString().slice(0,13)+":00")}return a(n,s,3*y.today,3*y.tokens.today,"today","today")}if("week"===e)return a(Array.from({length:8},(e,t)=>{let s=new Date("2026-01-13");return s.setDate(s.getDate()+7*t),s.toISOString().slice(0,10)}),[.08,.09,.1,.11,.12,.13,.17,.2],y.allTime,y.tokens.allTime,"allTime","allTime");let n=Array.from({length:56},(e,t)=>{let s=new Date("2026-01-13");return s.setDate(s.getDate()+t),s.toISOString().slice(0,10)}),o=n.map((e,t)=>{let s=Math.floor(t/7),a=t%7;return(.7+.08*s)*(a>=5?.4:.8+a%3*.1)});return a(n,o,y.allTime,y.tokens.allTime,"allTime","allTime")}let eo={hour:en("hour"),day:en("day"),week:en("week")};async function er(e){try{let t=new URLSearchParams;e.profile&&t.set("profile",e.profile),e.groupBy&&t.set("groupBy",e.groupBy),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to);let s=t.toString();return await R(`/api/analytics${s?`?${s}`:""}`)}catch{return console.warn("API unreachable, falling back to mock analytics data"),function(e,t,s){if(!t&&!s)return e;let a=t?new Date(t.includes("T")&&!t.endsWith("Z")?t+":00Z":t+(t.includes("T")?"":"T00:00:00Z")).getTime():0,n=s?new Date(s.includes("T")&&!s.endsWith("Z")?s+":00Z":s+(s.includes("T")?"":"T23:59:59Z")).getTime():1/0,o=e=>{let t=new Date(e.includes("T")&&!e.endsWith("Z")?e+":00Z":e+(e.includes("T")?"":"T00:00:00Z"));return t.getTime()>=a&&t.getTime()<=n};return{buckets:e.buckets.filter(e=>o(e.date)),byAgent:e.byAgent.map(e=>({...e,buckets:e.buckets.filter(e=>o(e.date))})),byProject:e.byProject.map(e=>({...e,buckets:e.buckets.filter(e=>o(e.date))}))}}(eo[e.groupBy||"day"]||eo.day,e.from,e.to)}}let ei={today:94.72,mtd:236.83,allTime:1842.57,byAgent:{anas:{today:36.21,mtd:69.12},ofek:{today:42.83,mtd:112.18},dor:{today:15.68,mtd:55.53}},limits:{type:null,amount:null,agentLimits:{}},usagePercent:null};async function ed(e){try{let t=e?`?profile=${e}`:"";return await R(`/api/spend${t}`)}catch{return console.warn("API unreachable, falling back to mock spend data"),ei}}async function el(e){return await R("/api/settings/cost-limits",{method:"PUT",body:JSON.stringify(e)})}e.s(["acknowledgeAlert",()=>G,"acknowledgeAllAlerts",()=>K,"createProject",()=>et,"getAgents",()=>H,"getAlertDetails",()=>X,"getAlerts",()=>W,"getAnalytics",()=>er,"getCosts",()=>Z,"getProfiles",()=>O,"getProject",()=>ee,"getProjects",()=>Y,"getSession",()=>V,"getSessions",()=>Q,"getSpend",()=>ed,"getVersion",()=>_,"isUsingMockData",()=>L,"pauseAgent",()=>J,"removeSessionProject",()=>ea,"resumeAgent",()=>q,"setCostLimits",()=>el,"setSessionProjects",()=>es],9165)},88899,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(22016),o=e.i(19455),r=e.i(15288),i=e.i(87486),d=e.i(9165),l=e.i(98940);function c(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function u(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function m(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}let g={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"}},p=["blue-400","emerald-400","amber-400","purple-400","rose-400"];function h(e,t){return g[e]||{border:`border-l-${p[t%5]}`,bg:`bg-${p[t%5]}/10`,text:`text-${p[t%5]}`,badge:`bg-${p[t%5]}/10 text-${p[t%5]} border-${p[t%5]}/20`,dot:`bg-${p[t%5]}`}}let b={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 x(){let e=(0,a.useParams)(),g=(0,a.useRouter)(),p=e.id,[x,y]=(0,s.useState)(null),[k,w]=(0,s.useState)(!0),[v,j]=(0,s.useState)(null),[C,N]=(0,s.useState)(200),[A,I]=(0,s.useState)(new Set);if((0,s.useEffect)(()=>{!async function(){try{let e=await (0,d.getProject)(p);y(e)}catch{j("Project not found")}finally{w(!1)}}()},[p]),k)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,t.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading project..."]})});if(v||!x)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center space-y-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:v||"Project not found"}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>g.push("/dashboard"),children:"Back to Dashboard"})]})});let T=x.timeline.slice(0,C),U=x.timeline.length>C,$={};return x.agentBreakdown.forEach((e,t)=>{$[e.agentId]=t}),(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsxs)(n.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)(l.ClaWatchIcon,{}),(0,t.jsx)(l.ClaWatchLogo,{size:"md"})]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Project"})]})})}),(0,t.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>g.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,t.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold mb-2",children:x.name}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,t.jsxs)("div",{className:"flex items-center gap-6 flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:["$",x.stats.totalCostUsd.toFixed(2)]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground ml-2",children:"total cost"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.sessionCount," sessions"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.totalMessages," messages"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[u(x.stats.totalTokens)," tokens"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,t.jsxs)("div",{children:[m(x.stats.dateRange.from)," — ",m(x.stats.dateRange.to)]})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Agent Participation"}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.agentBreakdown.map(e=>{var s;let a=h(e.agentId,$[e.agentId]);return(0,t.jsx)(r.Card,{className:`border-l-4 ${a.border}`,children:(0,t.jsxs)(r.CardContent,{className:"pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`border ${a.badge} text-xs`,children:e.agentId}),(0,t.jsxs)("span",{className:"text-lg font-bold",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full ${"dor"===(s=e.agentId)?"bg-blue-400":"ofek"===s?"bg-amber-400":"anas"===s?"bg-emerald-400":"bg-purple-400"} transition-all`,style:{width:`${e.percentage}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.percentage.toFixed(1),"% of total cost"]}),(0,t.jsxs)("span",{children:[u(e.tokenCount)," tokens"]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.messageCount," messages"]})]})]})},e.agentId)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Sessions"}),(0,t.jsx)("div",{className:"grid gap-3",children:x.sessions.map(e=>{let s=b[e.status],a=h(e.agentId,$[e.agentId]??0);return(0,t.jsx)("div",{onClick:()=>g.push(`/dashboard/sessions/${e.id}`),className:"rounded-xl border border-border/50 bg-card p-4 hover:border-border transition-colors cursor-pointer group",children:(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("span",{className:`size-2.5 rounded-full mt-1.5 shrink-0 ${s.dot}`}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,t.jsx)("span",{className:"font-medium truncate max-w-[500px] group-hover:text-emerald-400 transition-colors",children:e.title.length>80?e.title.slice(0,80)+"...":e.title})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${a.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground",children:e.model}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[e.messageCount," msgs"]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.lastActivityAt)})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 shrink-0 text-sm",children:(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("div",{className:"font-bold",children:["$",e.costUsd.toFixed(2)]}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:u(e.tokenCount)})]})})]})},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Unified Timeline"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Messages from all sessions merged chronologically"}),(0,t.jsx)("div",{className:"space-y-2",children:T.map(e=>(0,t.jsx)(f,{message:e,agentIndex:$,collapsed:A.has(e.id),onToggle:()=>{var t;return t=e.id,void I(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}},e.id))}),U&&(0,t.jsx)("div",{className:"text-center mt-4",children:(0,t.jsxs)(o.Button,{variant:"outline",size:"sm",className:"text-xs border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10",onClick:()=>N(e=>e+200),children:["Load more (",x.timeline.length-C," remaining)"]})}),0===x.timeline.length&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground text-sm",children:"No timeline messages yet."})]})]})]})}function f({message:e,agentIndex:s,collapsed:a,onToggle:n}){let o=h(e.agentId,s[e.agentId]??0),r=e.content.toLowerCase().includes("error");return"user"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-blue-500/20 bg-blue-500/10 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"assistant"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-800/50 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),e.model&&(0,t.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:e.model}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),null!=e.costUsd&&(0,t.jsxs)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"tool"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-900 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),e.toolName&&(0,t.jsx)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:e.toolName}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("button",{onClick:n,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:a?"Show":"Hide"})]}),!a&&(0,t.jsx)("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:e.content})]}):(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} px-4 py-2`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.content})]})}e.s(["default",()=>x])}]);
|