@hirra/vibemeter 0.1.0 → 0.1.1
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/import-sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/usage/route.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0chedn~._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js +62 -0
- package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__0ade2u0._.js → [root-of-the-server]__0y68a5d._.js} +5 -5
- package/.next/server/chunks/[root-of-the-server]__0y68a5d._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js +8 -8
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js.map +1 -1
- package/.next/server/chunks/ssr/_0ye~8el._.js +1 -1
- package/.next/server/chunks/ssr/_0ye~8el._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{05t54y~yfn5og.js → 0erq0bmub6w_z.js} +1 -1
- package/package.json +17 -4
- package/.next/server/chunks/[root-of-the-server]__0ade2u0._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js +0 -63
- package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js.map +0 -1
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_buildManifest.js +0 -0
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_ssgManifest.js +0 -0
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/03~yq9q893hmn.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/pbaZ4xRfoDHL1KG3S0xG-/_buildManifest.js",
|
|
11
|
+
"static/pbaZ4xRfoDHL1KG3S0xG-/_ssgManifest.js",
|
|
12
|
+
"static/pbaZ4xRfoDHL1KG3S0xG-/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/00gq-v0e07i1q.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/002~6040mndie.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/0pqt~8bl3ukh4.js" async=""></script><script src="/_next/static/chunks/02g3221oh~3le.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-14vio.b1b9i4l.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Vibemeter</title><meta name="description" content="Measure your AI coding vibe — local-first dashboard for Claude Code, Codex, and Cursor"/><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="min-h-full flex flex-col"><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/00gq-v0e07i1q.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/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/002~6040mndie.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/002~6040mndie.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/01xlw8hd842-c.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col\",\"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,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/002~6040mndie.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/002~6040mndie.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/0pqt~8bl3ukh4.js" async=""></script><script src="/_next/static/chunks/02g3221oh~3le.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-14vio.b1b9i4l.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Vibemeter</title><meta name="description" content="Measure your AI coding vibe — local-first dashboard for Claude Code, Codex, and Cursor"/><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="min-h-full flex flex-col"><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/00gq-v0e07i1q.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/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/002~6040mndie.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/002~6040mndie.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/01xlw8hd842-c.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col\",\"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,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/002~6040mndie.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"pbaZ4xRfoDHL1KG3S0xG-\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[27201,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Vibemeter\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Measure your AI coding vibe — local-first dashboard for Claude Code, Codex, and Cursor\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><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/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/0pqt~8bl3ukh4.js" async=""></script><script src="/_next/static/chunks/02g3221oh~3le.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-14vio.b1b9i4l.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.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;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.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/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"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: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><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/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/0pqt~8bl3ukh4.js" async=""></script><script src="/_next/static/chunks/02g3221oh~3le.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-14vio.b1b9i4l.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.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;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.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/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"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: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"pbaZ4xRfoDHL1KG3S0xG-\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[27201,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"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\": \"pGzYgQdSdDArnXtsL24UKB1jVF3DIxQnbYm++Ut14Jc=\"\n}"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return o},urlObjectKeys:function(){return c}};for(var r in n)Object.defineProperty(s,r,{enumerable:!0,get:n[r]});let l=e.r(90809)._(e.r(98183)),a=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:s}=e,n=e.protocol||"",r=e.pathname||"",i=e.hash||"",c=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:s&&(o=t+(~s.indexOf(":")?`[${s}]`:s),e.port&&(o+=":"+e.port)),c&&"object"==typeof c&&(c=String(l.urlQueryToSearchParams(c)));let d=e.search||c&&`?${c}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==o?(o="//"+(o||""),r&&"/"!==r[0]&&(r="/"+r)):o||(o=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),r=r.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${o}${r}${d}${i}`}let c=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function o(e){return i(e)}},18581,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"useMergedRef",{enumerable:!0,get:function(){return r}});let n=e.r(71645);function r(e,t){let s=(0,n.useRef)(null),r=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=s.current;e&&(s.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(s.current=l(e,n)),t&&(r.current=l(t,n))},[e,t])}function l(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let s=e(t);return"function"==typeof s?s:()=>e(null)}}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},73668,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"isLocalURL",{enumerable:!0,get:function(){return l}});let n=e.r(18967),r=e.r(52817);function l(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),s=new URL(e,t);return s.origin===t&&(0,r.hasBasePath)(s.pathname)}catch(e){return!1}}},84508,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var n={default:function(){return f},useLinkStatus:function(){return j}};for(var r in n)Object.defineProperty(s,r,{enumerable:!0,get:n[r]});let l=e.r(90809),a=e.r(43476),i=l._(e.r(71645)),c=e.r(95057),o=e.r(8372),d=e.r(18581),x=e.r(18967),u=e.r(5550);e.r(33525);let m=e.r(88540),p=e.r(91949),h=e.r(73668),g=e.r(9396);function f(t){var s,n;let r,l,f,[j,v]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),N=(0,i.useRef)(null),{href:y,as:z,children:w,prefetch:k=null,passHref:M,replace:$,shallow:_,scroll:S,onClick:C,onMouseEnter:T,onTouchStart:F,legacyBehavior:D=!1,onNavigate:L,transitionTypes:R,ref:P,unstable_dynamicOnHover:O,...A}=t;r=w,D&&("string"==typeof r||"number"==typeof r)&&(r=(0,a.jsx)("a",{children:r}));let E=i.default.useContext(o.AppRouterContext),U=!1!==k,X=!1!==k?null===(n=k)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,I="string"==typeof(s=z||y)?s:(0,c.formatUrl)(s);if(D){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});l=i.default.Children.only(r)}let W=D?l&&"object"==typeof l&&l.ref:P,B=i.default.useCallback(e=>(null!==E&&(N.current=(0,p.mountLinkInstance)(e,I,E,X,U,v)),()=>{N.current&&((0,p.unmountLinkForCurrentNavigation)(N.current),N.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,I,E,X,v]),K={ref:(0,d.useMergedRef)(B,W),onClick(t){D||"function"!=typeof C||C(t),D&&l.props&&"function"==typeof l.props.onClick&&l.props.onClick(t),!E||t.defaultPrevented||function(t,s,n,r,l,a,c){if("u">typeof window){let o,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((o=t.currentTarget.getAttribute("target"))&&"_self"!==o||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(s)){r&&(t.preventDefault(),location.replace(s));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:x}=e.r(99781);i.default.startTransition(()=>{x(s,r?"replace":"push",!1===l?m.ScrollBehavior.NoScroll:m.ScrollBehavior.Default,n.current,c)})}}(t,I,N,$,S,L,R)},onMouseEnter(e){D||"function"!=typeof T||T(e),D&&l.props&&"function"==typeof l.props.onMouseEnter&&l.props.onMouseEnter(e),E&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){D||"function"!=typeof F||F(e),D&&l.props&&"function"==typeof l.props.onTouchStart&&l.props.onTouchStart(e),E&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,x.isAbsoluteUrl)(I)?K.href=I:D&&!M&&("a"!==l.type||"href"in l.props)||(K.href=(0,u.addBasePath)(I)),f=D?i.default.cloneElement(l,K):(0,a.jsx)("a",{...A,...K,children:r}),(0,a.jsx)(b.Provider,{value:j,children:f})}e.r(84508);let b=(0,i.createContext)(p.IDLE_LINK_STATUS),j=()=>(0,i.useContext)(b);("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},18566,(e,t,s)=>{t.exports=e.r(76562)},58116,e=>{"use strict";var t=e.i(43476),s=e.i(71645),n=e.i(18566);let r=["blocked","poc","spike","review","done"];function l(e){return e?e.split("/").filter(Boolean).pop()??e:"—"}function a({tool:e}){return"codex"===e?(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-emerald-900/40 text-emerald-400 border border-emerald-800/50",children:"codex"}):"cursor"===e?(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-sky-900/40 text-sky-400 border border-sky-800/50",children:"cursor"}):(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-violet-900/40 text-violet-400 border border-violet-800/50",children:"claude"})}function i({label:e,onRemove:s}){let n={blocked:"bg-red-900/40 text-red-400 border-red-800/50",poc:"bg-yellow-900/40 text-yellow-400 border-yellow-800/50",spike:"bg-orange-900/40 text-orange-400 border-orange-800/50",review:"bg-blue-900/40 text-blue-400 border-blue-800/50",done:"bg-zinc-700/40 text-zinc-400 border-zinc-600/50"}[e]??"bg-zinc-800/40 text-zinc-400 border-zinc-700/50";return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded border ${n}`,children:[e,s&&(0,t.jsx)("button",{onClick:s,className:"hover:text-white leading-none",children:"×"})]})}function c({sessions:e}){let[n,o]=(0,s.useState)(""),[d,x]=(0,s.useState)({}),[u,m]=(0,s.useState)({}),[p,h]=(0,s.useState)(null),g=(0,s.useMemo)(()=>{let t=n.toLowerCase();return t?e.filter(e=>l(e.cwd).toLowerCase().includes(t)||(e.ai_title??"").toLowerCase().includes(t)||(e.summary??"").toLowerCase().includes(t)):e},[e,n]);async function f(e,t){x(s=>({...s,[e]:t})),await fetch(`/api/sessions/${e}/tags`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({tags:t})})}function b(e){return d[e.id]??function(e){try{return e?JSON.parse(e):[]}catch{return[]}}(e.tags)}function j(e,t){let s=t.trim().toLowerCase().replace(/\s+/g,"-");if(!s)return;let n=b(e);n.includes(s)||(f(e.id,[...n,s]),m(t=>({...t,[e.id]:""})))}return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-800 gap-4",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-zinc-300 shrink-0",children:"Recent Sessions"}),(0,t.jsx)("input",{type:"text",placeholder:"search project / title…",value:n,onChange:e=>o(e.target.value),className:"flex-1 max-w-xs bg-zinc-800 border border-zinc-700 rounded px-3 py-1 text-xs text-zinc-200 placeholder-zinc-600 focus:outline-none focus:border-zinc-500"}),(0,t.jsxs)("span",{className:"text-xs text-zinc-500 shrink-0",children:[e.filter(e=>!e.ended_at).length," active · ",g.length,"/",e.length]})]}),0===g.length?(0,t.jsx)("p",{className:"px-5 py-8 text-zinc-600 text-sm text-center",children:"No sessions match."}):(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-xs text-zinc-500 border-b border-zinc-800",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"started"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"tool"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"project · title"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"dur"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"status"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left font-normal",children:"tags"})]})}),(0,t.jsx)("tbody",{children:g.map(e=>{let n=!e.ended_at,c=b(e),o=p===e.id;return(0,t.jsx)(s.default.Fragment,{children:(0,t.jsxs)("tr",{className:"border-b border-zinc-800/40 hover:bg-zinc-800/20 transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-2 text-zinc-500 tabular-nums whitespace-nowrap text-xs",children:new Date(e.started_at).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}),(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(a,{tool:e.tool})}),(0,t.jsxs)("td",{className:"px-4 py-2 max-w-xs",children:[(0,t.jsx)("div",{className:"text-zinc-200 text-xs font-medium",children:l(e.cwd)}),e.ai_title&&(0,t.jsx)("div",{className:"text-zinc-500 text-xs truncate",children:e.ai_title}),!e.ai_title&&e.summary&&(0,t.jsx)("div",{className:"text-zinc-600 text-xs truncate",children:e.summary})]}),(0,t.jsx)("td",{className:"px-4 py-2 text-zinc-500 tabular-nums text-xs",children:function(e,t){if(!t)return"active";let s=Math.round((t-e)/6e4);return s<60?`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}(e.started_at,e.ended_at??null)}),(0,t.jsx)("td",{className:"px-4 py-2",children:n?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-emerald-400 text-xs",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse inline-block"}),"active"]}):(0,t.jsx)("span",{className:"text-zinc-700 text-xs",children:"done"})}),(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 items-center",children:[c.map(s=>(0,t.jsx)(i,{label:s,onRemove:()=>{f(e.id,b(e).filter(e=>e!==s))}},s)),o?(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("input",{autoFocus:!0,value:u[e.id]??"",onChange:t=>m(s=>({...s,[e.id]:t.target.value})),onKeyDown:t=>{"Enter"===t.key&&j(e,u[e.id]??""),"Escape"===t.key&&h(null)},placeholder:"tag…",className:"w-16 bg-zinc-800 border border-zinc-600 rounded px-1 py-0.5 text-xs text-zinc-200 focus:outline-none"}),(0,t.jsx)("div",{className:"flex gap-1",children:r.filter(e=>!c.includes(e)).slice(0,3).map(s=>(0,t.jsx)("button",{onClick:()=>j(e,s),className:"text-xs text-zinc-500 hover:text-zinc-300 px-1 py-0.5 rounded border border-zinc-700",children:s},s))}),(0,t.jsx)("button",{onClick:()=>h(null),className:"text-zinc-600 hover:text-zinc-400 text-xs",children:"✕"})]}):(0,t.jsx)("button",{onClick:()=>h(e.id),className:"text-zinc-700 hover:text-zinc-400 text-xs leading-none",children:"+"})]})})]})},e.id)})})]})]})}let o={"claude-code":"bg-violet-500",codex:"bg-emerald-500",cursor:"bg-sky-500",other:"bg-zinc-500"};function d({data:e}){let s=e.reduce((e,t)=>e+t.sessions,0);return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"tool split"}),0===e.length?(0,t.jsx)("p",{className:"text-zinc-600 text-sm",children:"no data"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex h-2 rounded overflow-hidden gap-0.5 mb-3",children:e.map(e=>(0,t.jsx)("div",{className:`${o[e.tool]??"bg-zinc-500"} rounded-sm`,style:{width:`${e.pct}%`}},e.tool))}),(0,t.jsx)("div",{className:"space-y-1.5",children:e.map(e=>{let s;return(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`w-2 h-2 rounded-sm inline-block ${o[e.tool]??"bg-zinc-500"}`}),(0,t.jsx)("span",{className:"text-zinc-300",children:"claude-code"===e.tool?"claude code":e.tool})]}),(0,t.jsxs)("span",{className:"text-zinc-500 tabular-nums",children:[e.sessions," sessions · ",(s=e.totalMs/36e5)<1?`${Math.round(60*s)}m`:`${s.toFixed(1)}h`," · ",e.pct,"%"]})]},e.tool)})}),(0,t.jsxs)("p",{className:"text-xs text-zinc-600 mt-2",children:[s," total sessions"]})]})]})}function x(e){return e.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ")}function u(e){let t=new Date(e),s=new Date,n=t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1});return t.toDateString()===s.toDateString()?n:`${(t.getMonth()+1).toString().padStart(2,"0")}/${t.getDate().toString().padStart(2,"0")} ${n}`}function m({data:e,label:n="claude code"}){let r=(0,s.useRef)(null),[l,a]=(0,s.useState)(null),i=e.length>=2?e[0].ts:0,c=e.length>=2?e[e.length-1].ts:1,o=c-i||1,d=e=>32+(e-i)/o*520,p=e=>null==e?null:4+(1-e/100)*112,h=(0,s.useCallback)(t=>{if(!r.current||e.length<2)return;let s=r.current.getBoundingClientRect(),n=32+520*Math.max(0,Math.min(1,(t.clientX-s.left)/s.width)),l=e[0],i=1/0;for(let t of e){let e=Math.abs(d(t.ts)-n);e<i&&(i=e,l=t)}a({svgX:d(l.ts),screenX:t.clientX,screenY:s.top,point:l})},[e,i,o]);if(e.length<2)return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-2",children:["usage history (7d) · ",n]}),(0,t.jsx)("p",{className:"text-zinc-600 text-sm",children:"not enough data yet"})]});let g=e.filter(e=>null!=e.pct5h).map(e=>({x:d(e.ts),y:p(e.pct5h)})),f=e.filter(e=>null!=e.pctWeekly).map(e=>({x:d(e.ts),y:p(e.pctWeekly)})),b=e.filter(e=>null!=e.pct5h).at(-1)?.pct5h,j=e.filter(e=>null!=e.pctWeekly).at(-1)?.pctWeekly;return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5 relative",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:["usage history (7d) · ",n]}),(0,t.jsxs)("svg",{ref:r,viewBox:"0 0 560 120",className:"w-full h-28 cursor-crosshair",preserveAspectRatio:"none",onMouseMove:h,onMouseLeave:()=>a(null),children:[[0,25,50,75,100].map(e=>{let s=p(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:32,y1:s,x2:552,y2:s,stroke:"#27272a",strokeWidth:"1"}),(0,t.jsxs)("text",{x:29,y:s+3.5,textAnchor:"end",fontSize:"8",fill:"#52525b",children:[e,"%"]})]},e)}),g.length>=2&&(0,t.jsx)("polyline",{points:x(g),fill:"none",stroke:"#8b5cf6",strokeWidth:"1.5",strokeLinejoin:"round"}),f.length>=2&&(0,t.jsx)("polyline",{points:x(f),fill:"none",stroke:"#10b981",strokeWidth:"1.5",strokeLinejoin:"round",strokeDasharray:"4 2"}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("line",{x1:l.svgX,y1:4,x2:l.svgX,y2:116,stroke:"#52525b",strokeWidth:"1",strokeDasharray:"3 2"}),null!=l.point.pct5h&&(0,t.jsx)("circle",{cx:l.svgX,cy:p(l.point.pct5h),r:"2.5",fill:"#8b5cf6"}),null!=l.point.pctWeekly&&(0,t.jsx)("circle",{cx:l.svgX,cy:p(l.point.pctWeekly),r:"2.5",fill:"#10b981"})]})]}),l&&(0,t.jsxs)("div",{className:"pointer-events-none absolute z-10 bg-zinc-800 border border-zinc-700 rounded px-2 py-1.5 text-xs shadow-lg",style:{left:`${((l.svgX-32)/520*100).toFixed(1)}%`,transform:l.svgX>364?"translateX(-110%)":"translateX(4px)",top:"40px"},children:[(0,t.jsx)("p",{className:"text-zinc-400 mb-1",children:u(l.point.ts)}),null!=l.point.pct5h&&(0,t.jsxs)("p",{className:"text-violet-400",children:["5h: ",l.point.pct5h.toFixed(0),"% used"]}),null!=l.point.pctWeekly&&(0,t.jsxs)("p",{className:"text-emerald-400",children:["7day: ",l.point.pctWeekly.toFixed(0),"% used"]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-1 text-xs text-zinc-600",children:[(0,t.jsx)("span",{children:u(i)}),(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("span",{className:"text-violet-400",children:["— 5h ",null!=b?`(${b.toFixed(0)}% used)`:""]}),(0,t.jsxs)("span",{className:"text-emerald-400",children:["-- 7day ",null!=j?`(${j.toFixed(0)}% used)`:""]})]}),(0,t.jsx)("span",{children:u(c)})]})]})}function p({data:e}){if(0===e.length)return null;let s=e[0].changes;return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"file hotspots"}),(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>{let n,r;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[(0,t.jsxs)("span",{className:"text-zinc-300 truncate max-w-xs",title:e.path,children:[(0,t.jsxs)("span",{className:"text-zinc-600",children:[(n=e.path.split("/")).length>1?n.slice(-2,-1)[0]:"","/"]}),(r=e.path).split("/").pop()??r]}),(0,t.jsxs)("span",{className:"text-zinc-500 tabular-nums ml-2 shrink-0",children:[e.changes,"× · ",e.sessions," sessions"]})]}),(0,t.jsx)("div",{className:"h-1 bg-zinc-800 rounded",children:(0,t.jsx)("div",{className:"h-1 bg-amber-500/60 rounded",style:{width:`${e.changes/s*100}%`}})})]},e.path)})})]})}function h(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(0)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function g({data:e,toolFilter:s}){let n="all"===s||"claude-code"===s,r="all"===s||"codex"===s,l=n?Math.max(...e.daily.map(e=>e.claudeUsd),.01):.01,a=r?Math.max(...e.daily.map(e=>e.codexTokens),1):1;return n||r?(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"spending / consumption"}),(0,t.jsxs)("div",{className:"flex gap-6 mb-4",children:[n&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-xl font-bold text-violet-400",children:["$",e.claudeTotalUsd.toFixed(2)]}),(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-0.5",children:"claude code total"})]}),r&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xl font-bold text-emerald-400",children:h(e.codexTotalTokens)}),(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-0.5",children:"codex tokens"})]})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-600 mb-2",children:"last 14 days"}),(0,t.jsx)("div",{className:"flex items-end gap-px h-16",children:e.daily.map(e=>{let s=n?e.claudeUsd/l*100:0,i=r?e.codexTokens/a*100:0,c=[e.date.slice(5),n?`Claude $${e.claudeUsd.toFixed(2)}`:"",r?`Codex ${h(e.codexTokens)} tokens`:""].filter(Boolean).join("\n");return(0,t.jsx)("div",{className:"flex-1 flex flex-col items-center",title:c,children:(0,t.jsxs)("div",{className:"w-full flex flex-col justify-end gap-px",style:{height:"56px"},children:[r&&e.codexTokens>0&&(0,t.jsx)("div",{className:"w-full bg-emerald-600/60 rounded-sm",style:{height:`${Math.max(.56*i,1)}px`}}),n&&e.claudeUsd>0&&(0,t.jsx)("div",{className:"w-full bg-violet-500/70 rounded-sm",style:{height:`${Math.max(.56*s,1)}px`}})]})},e.date)})}),(0,t.jsxs)("div",{className:"flex justify-between mt-1",children:[(0,t.jsx)("span",{className:"text-zinc-700 text-xs",children:e.daily[0]?.date.slice(5)}),(0,t.jsx)("span",{className:"text-zinc-700 text-xs",children:e.daily[e.daily.length-1]?.date.slice(5)})]}),(0,t.jsxs)("div",{className:"flex gap-4 mt-2",children:[n&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-zinc-600",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm bg-violet-500/70 inline-block"})," claude ($)"]}),r&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-zinc-600",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm bg-emerald-600/60 inline-block"})," codex (tokens)"]})]})]}):(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"spending / consumption"}),(0,t.jsx)("p",{className:"text-zinc-600 text-sm",children:"no spending data for cursor"})]})}let f=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function b(e){return e<60?`${Math.round(e)}m`:`${(e/60).toFixed(1)}h`}function j(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}let v={"claude-code":"bg-violet-500/80 border-violet-400 text-violet-50",codex:"bg-emerald-600/80 border-emerald-400 text-emerald-50",cursor:"bg-sky-600/80 border-sky-400 text-sky-50"};function N({sessions:e,streak:n,timeline:r}){var l;let[a,i]=(0,s.useState)("pattern"),[c,o]=(0,s.useState)(null),d=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e){let e=s.started_at,n=s.ended_at??Math.min(Date.now(),s.started_at+36e5),r=e,l=null;for(;r<n;){let e=new Date(r),s=(e.getDay()+6)%7,a=e.getHours(),i=`${s}-${a}`,c=new Date(e);c.setMinutes(0,0,0),c.setHours(e.getHours()+1);let o=(Math.min(c.getTime(),n)-r)/6e4,d=t.get(i)??{minutes:0,sessions:0};d.minutes+=o,null===l&&(d.sessions+=1,l=i),t.set(i,d),r=c.getTime()}}let s=[];for(let e=0;e<7;e++)for(let n=0;n<24;n++){let r=t.get(`${e}-${n}`)??{minutes:0,sessions:0};s.push({dow:e,hour:n,...r})}return s})(e),[e]),x=Math.max(...d.map(e=>e.minutes),1),u=d.reduce((e,t)=>e+t.minutes,0)/60,m=d.reduce((e,t)=>t.minutes>e.minutes?t:e,d[0]),p=new Date(r.dateLabel+"T00:00:00").getTime(),h=p+864e5,g=r.sessions.map(e=>({...e,_start:Math.max(e.startMs,p),_end:Math.min(e.endMs,h)})).filter(e=>e._end>e._start).sort((e,t)=>e._start-t._start),y=[];for(let e of g){let t=!1;for(let s of y)if(s[s.length-1]._end<=e._start){s.push(e),t=!0;break}t||y.push([e])}let z=Math.max(y.length,1),w=g.reduce((e,t)=>e+(t._end-t._start),0)/36e5;return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5 relative",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4 gap-4 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider",children:"activity"}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("button",{onClick:()=>i("pattern"),className:`text-xs px-2.5 py-1 rounded border transition-colors ${"pattern"===a?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-800 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:"pattern"}),(0,t.jsx)("button",{onClick:()=>i("today"),className:`text-xs px-2.5 py-1 rounded border transition-colors ${"today"===a?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-800 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:"today"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-base font-bold text-zinc-100 tabular-nums",children:n.current}),(0,t.jsx)("span",{className:"text-zinc-500 ml-1",children:"day streak"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-base font-bold text-zinc-300 tabular-nums",children:n.longest}),(0,t.jsx)("span",{className:"text-zinc-500 ml-1",children:"longest"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-base font-bold text-zinc-300 tabular-nums",children:n.totalDays}),(0,t.jsx)("span",{className:"text-zinc-500 ml-1",children:"active days"})]}),(0,t.jsxs)("div",{className:"border-l border-zinc-800 pl-4",children:[(0,t.jsxs)("span",{className:"text-base font-bold text-violet-400 tabular-nums",children:[u.toFixed(0),"h"]}),(0,t.jsx)("span",{className:"text-zinc-500 ml-1",children:"total"})]})]})]}),"pattern"===a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-600 mb-2",children:["peak slot: ",f[m.dow]," ",m.hour.toString().padStart(2,"0"),":00 (",b(m.minutes),")"]}),(0,t.jsxs)("div",{className:"flex gap-1 text-xs",children:[(0,t.jsx)("div",{className:"w-8 shrink-0"}),(0,t.jsx)("div",{className:"flex-1 grid gap-px",style:{gridTemplateColumns:"repeat(24, minmax(0, 1fr))"},children:Array.from({length:24}).map((e,s)=>(0,t.jsx)("div",{className:`text-center text-[9px] text-zinc-600 ${s%3==0?"":"opacity-40"}`,children:s%3==0?s.toString().padStart(2,"0"):""},s))})]}),f.map((e,s)=>(0,t.jsxs)("div",{className:"flex gap-1 mt-px",children:[(0,t.jsx)("div",{className:"w-8 shrink-0 text-[10px] text-zinc-600 leading-4",children:e}),(0,t.jsx)("div",{className:"flex-1 grid gap-px",style:{gridTemplateColumns:"repeat(24, minmax(0, 1fr))"},children:Array.from({length:24}).map((n,r)=>{let l=d[24*s+r];return(0,t.jsx)("div",{className:`h-4 rounded-sm ${function(e,t){if(0===e)return"bg-zinc-900";let s=t>0?e/t:0;return s<.15?"bg-violet-900/40":s<.3?"bg-violet-800/60":s<.5?"bg-violet-700":s<.75?"bg-violet-600":"bg-violet-400"}(l.minutes,x)}`,title:`${e} ${r.toString().padStart(2,"0")}:00
|
|
2
|
-
${b(l.minutes)} \xb7 ${l.sessions} sessions`},r)})})]},e)),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 text-[10px] text-zinc-600",children:[(0,t.jsx)("span",{children:"less"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-zinc-900 border border-zinc-800"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-900/40"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-800/60"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-700"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-600"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-400"}),(0,t.jsx)("span",{children:"more"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-600 mb-2",children:[r.dateLabel," · ",g.length," sessions · ",w.toFixed(1),"h active"]}),0===g.length?(0,t.jsx)("p",{className:"text-zinc-600 text-sm py-4",children:"no sessions today"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"relative h-4 mb-1",children:Array.from({length:25}).map((e,s)=>(0,t.jsx)("div",{className:"absolute top-0 text-[10px] text-zinc-600 tabular-nums",style:{left:`${s/24*100}%`,transform:"translateX(-50%)"},children:s%3==0?s.toString().padStart(2,"0"):""},s))}),(0,t.jsxs)("div",{className:"relative bg-zinc-950/50 rounded overflow-hidden",style:{height:`${32*z+4}px`},children:[Array.from({length:25}).map((e,s)=>(0,t.jsx)("div",{className:"absolute top-0 bottom-0 border-l border-zinc-800/40",style:{left:`${s/24*100}%`}},s)),y.flatMap((e,s)=>e.map(e=>{let n=(e._start-p)/864e5*100,r=(e._end-e._start)/864e5*100;return(0,t.jsx)("div",{className:`absolute rounded border text-[11px] font-medium leading-none cursor-pointer hover:brightness-125 transition-all overflow-hidden ${v[e.tool]??"bg-zinc-600 border-zinc-500 text-zinc-100"}`,style:{left:`${n}%`,width:`${Math.max(r,.4)}%`,top:`${4+32*s}px`,height:"28px"},onMouseEnter:t=>o({s:e,x:t.clientX,y:t.clientY}),onMouseMove:t=>o({s:e,x:t.clientX,y:t.clientY}),onMouseLeave:()=>o(null),children:r>4&&(0,t.jsxs)("div",{className:"px-1.5 py-1 truncate",children:[(0,t.jsx)("span",{className:"opacity-80",children:j(e._start)})," · ",e.project]})},e.id)}))]}),(0,t.jsxs)("div",{className:"flex gap-4 mt-3 text-[11px] text-zinc-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-violet-500/80 inline-block"})," claude code"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-emerald-600/80 inline-block"})," codex"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-sky-600/80 inline-block"})," cursor"]})]}),c&&(0,t.jsxs)("div",{className:"fixed z-20 bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-xs shadow-xl pointer-events-none max-w-xs",style:{left:c.x+12,top:c.y+12},children:[(0,t.jsxs)("p",{className:"text-zinc-100 font-medium mb-0.5",children:[c.s.project," ",(0,t.jsxs)("span",{className:"text-zinc-500 font-normal",children:["· ",c.s.tool]})]}),c.s.aiTitle&&(0,t.jsx)("p",{className:"text-zinc-400 mb-1 line-clamp-2",children:c.s.aiTitle}),(0,t.jsxs)("p",{className:"text-zinc-500 tabular-nums",children:[j(c.s.startMs)," → ",j(c.s.endMs)," · ",(l=c.s.startMs,Math.max(1,Math.round((c.s.endMs-l)/6e4))),"m"]})]})]})]})]})}let y={"claude-code":"bg-violet-500",codex:"bg-emerald-500",cursor:"bg-sky-500"};function z({sessions:e,limit:n=10}){let r=(0,s.useMemo)(()=>{let t=new Map;for(let n of e){var s;let e=(s=n.cwd)?s.split("/").filter(Boolean).pop()??s:"—";if("—"===e)continue;let r=(n.ended_at??n.started_at)-n.started_at,l=t.get(e)??{project:e,cwd:n.cwd,sessions:0,totalMs:0,tools:{}};l.sessions+=1,l.totalMs+=r,l.tools[n.tool]=(l.tools[n.tool]??0)+1,t.set(e,l)}return[...t.values()].sort((e,t)=>t.totalMs-e.totalMs).slice(0,n)},[e,n]),l=Math.max(...r.map(e=>e.totalMs),1);return 0===r.length?(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"project leaderboard"}),(0,t.jsx)("p",{className:"text-zinc-600 text-sm",children:"no projects yet"})]}):(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"project leaderboard"}),(0,t.jsx)("div",{className:"space-y-1.5",children:r.map((e,s)=>{let n;return(0,t.jsxs)("div",{className:"group",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"w-5 text-right text-zinc-600 tabular-nums",children:s+1}),(0,t.jsx)("span",{className:"flex-1 text-zinc-200 truncate",title:e.cwd??e.project,children:e.project}),(0,t.jsx)("div",{className:"flex gap-0.5",children:Object.entries(e.tools).map(([e,s])=>(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${y[e]??"bg-zinc-500"}`,title:`${e}: ${s}`},e))}),(0,t.jsxs)("span",{className:"text-zinc-500 tabular-nums w-12 text-right",children:[e.sessions,"×"]}),(0,t.jsx)("span",{className:"text-zinc-400 tabular-nums w-14 text-right",children:(n=e.totalMs/36e5)<1?`${Math.round(60*n)}m`:`${n.toFixed(1)}h`})]}),(0,t.jsx)("div",{className:"flex gap-px h-1 mt-0.5 ml-8",children:(0,t.jsx)("div",{className:"bg-violet-500/30 rounded-sm",style:{width:`${e.totalMs/l*100}%`}})})]},e.project)})})]})}function w({data:e}){let[n,r]=(0,s.useState)(!1),l=e.filter(e=>e.unlocked),a=e.filter(e=>!e.unlocked).sort((e,t)=>{let s=e.progress?e.progress.current/e.progress.target:0;return(t.progress?t.progress.current/t.progress.target:0)-s}),i=n?[...l,...a]:[...l.slice(0,4),...a.slice(0,Math.max(0,6-Math.min(l.length,4)))];return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider",children:"achievements"}),(0,t.jsxs)("p",{className:"text-xs text-zinc-600",children:[l.length," / ",e.length," unlocked"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:i.map(e=>{let s=e.progress?Math.min(100,e.progress.current/e.progress.target*100):100*!!e.unlocked;return(0,t.jsxs)("div",{className:`rounded border px-2.5 py-2 ${e.unlocked?"border-amber-700/50 bg-amber-950/30":"border-zinc-800 bg-zinc-950/30"}`,title:e.description,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:`text-xs font-medium ${e.unlocked?"text-amber-300":"text-zinc-500"}`,children:[e.unlocked?"★":"☆"," ",e.title]}),(0,t.jsx)("span",{className:"text-[10px] text-zinc-600 tabular-nums shrink-0",children:function(e){if(!e.progress)return"";let{current:t,target:s}=e.progress;return s>=1e6?`${(t/1e6).toFixed(0)}M / ${(s/1e6).toFixed(0)}M`:s>=1e3?`${t.toLocaleString()} / ${s.toLocaleString()}`:s>=100&&Number.isFinite(t)&&t<100&&t%1!=0?`${t.toFixed(1)} / ${s}`:`${Math.floor(t)} / ${s}`}(e)})]}),(0,t.jsx)("div",{className:"h-0.5 bg-zinc-800 rounded mt-1.5 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${e.unlocked?"bg-amber-500":"bg-zinc-600"}`,style:{width:`${s}%`}})}),(0,t.jsx)("p",{className:"text-[10px] text-zinc-600 mt-1 truncate",children:e.description})]},e.id)})}),e.length>6&&(0,t.jsx)("button",{onClick:()=>r(!n),className:"w-full mt-3 text-xs text-zinc-500 hover:text-zinc-300 border border-zinc-800 rounded py-1",children:n?"show less":`show all (${e.length})`})]})}let k=["all","claude-code","codex","cursor"],M={all:"All","claude-code":"Claude Code",codex:"Codex",cursor:"Cursor"},$=["today","7d","30d","all"],_={today:"Today","7d":"7 days","30d":"30 days",all:"All time"};function S(e){if(!e)return"";let t=e-Date.now();if(t<=0)return"resetting…";let s=new Date(e),n=s.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1}),r=new Date().toDateString()===s.toDateString()?n:`${(s.getMonth()+1).toString().padStart(2,"0")}/${s.getDate().toString().padStart(2,"0")} ${n}`,l=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4),i=l>0?`${l}h ${a}m`:`${a}m`;return`resets at ${r} (in ${i})`}e.s(["Dashboard",0,function({sessions:e,streak:r,claudeBurndown:l,codexBurndown:a,hotspots:i,claudeUsage:o,codexUsage:x,codexAccounts:u,selectedCodexAccountId:h,spending:f,timeline:b,achievements:j}){var v;let y,C,T=(0,n.useRouter)(),F=(0,n.usePathname)(),D=(0,n.useSearchParams)(),[L,R]=(0,s.useState)("all"),[P,O]=(0,s.useState)("all"),[A,E]=(0,s.useState)("idle"),[U,X]=(0,s.useState)(null),I=(0,s.useMemo)(()=>u.find(e=>e.isCurrent)?.accountId??null,[u]),W=(0,s.useMemo)(()=>u.find(e=>e.accountId===h)??null,[u,h]),B=W?`codex \xb7 ${W.label}`:"codex",K=(0,s.useMemo)(()=>{let e;return e=new Date,"today"===P?(e.setHours(0,0,0,0),e.getTime()):"7d"===P?Date.now()-6048e5:"30d"===P?Date.now()-2592e6:0},[P]),H=(0,s.useMemo)(()=>{let t=K>0?e.filter(e=>e.started_at>=K):e,s={all:t.length};for(let e of t)s[e.tool]=(s[e.tool]??0)+1;return s},[e,K]),J=(0,s.useMemo)(()=>{let t="all"===L?e:e.filter(e=>e.tool===L);return K>0&&(t=t.filter(e=>e.started_at>=K)),t},[e,L,K]),Y=(0,s.useMemo)(()=>{let e=new Map;for(let t of J){let s=(t.ended_at??t.started_at)-t.started_at,n=e.get(t.tool)??{sessions:0,totalMs:0};e.set(t.tool,{sessions:n.sessions+1,totalMs:n.totalMs+s})}let t=Math.max([...e.values()].reduce((e,t)=>e+t.totalMs,0),1);return[...e.entries()].map(([e,s])=>({tool:e,sessions:s.sessions,totalMs:s.totalMs,pct:Math.round(s.totalMs/t*100)})).sort((e,t)=>t.totalMs-e.totalMs)},[J]),q=(0,s.useMemo)(()=>{if(0===K)return f;let e=new Date(K).toISOString().slice(0,10);return{...f,daily:f.daily.filter(t=>t.date>=e)}},[f,K]);async function Q(){E("refreshing"),X(null);try{let e=await fetch("/api/import-sessions",{method:"POST"}),t=await e.json();if(!e.ok)throw Error(t.error??"Refresh failed");E("done"),X(`scanned ${t.scanned??0} logs in ${Math.round((t.durationMs??0)/100)/10}s`),T.refresh()}catch(e){E("error"),X(e instanceof Error?e.message:"Refresh failed")}}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-3",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:k.filter(e=>"all"===e||(H[e]??0)>0).sort((e,t)=>"all"===e?-1:"all"===t?1:(H[t]??0)-(H[e]??0)).map(e=>(0,t.jsxs)("button",{onClick:()=>R(e),className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${L===e?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:[M[e],(0,t.jsx)("span",{className:"ml-1.5 text-zinc-600 tabular-nums",children:H[e]??0})]},e))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1",children:$.map(e=>(0,t.jsx)("button",{onClick:()=>O(e),className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${P===e?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:_[e]},e))}),(0,t.jsx)("button",{type:"button",onClick:Q,disabled:"refreshing"===A,className:"text-xs px-3 py-1.5 rounded-full border border-violet-500/40 bg-violet-500/10 text-violet-100 transition-colors hover:bg-violet-500/20 disabled:cursor-not-allowed disabled:opacity-50",children:"refreshing"===A?"Refreshing...":"Refresh data"})]})]}),U&&(0,t.jsx)("div",{className:`mb-4 rounded-lg border px-4 py-3 text-xs ${"error"===A?"border-red-900/60 bg-red-950/40 text-red-200":"border-emerald-900/60 bg-emerald-950/30 text-emerald-200"}`,children:U}),u.length>0&&(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-zinc-800 bg-zinc-900 px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-zinc-500",children:"Codex account"}),(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-zinc-600",children:W?.isCurrent?"default current account":"viewing saved account history"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("select",{value:h??"",onChange:e=>{var t;let s,n;return t=e.target.value,R("codex"),s=new URLSearchParams(D.toString()),t&&t!==I?s.set("codexAccount",t):s.delete("codexAccount"),n=s.toString(),void(T.replace(n?`${F}?${n}`:F,{scroll:!1}),T.refresh())},className:"max-w-72 rounded-md border border-zinc-700 bg-zinc-950 px-3 py-2 text-xs text-zinc-100 outline-none transition-colors hover:border-zinc-500 focus:border-violet-500",children:u.map(e=>(0,t.jsxs)("option",{value:e.accountId,children:[e.label," · ",e.planType??"unknown",e.isCurrent?" · current":""]},e.accountId))}),W&&(0,t.jsx)("span",{className:"hidden shrink-0 text-xs text-zinc-600 sm:inline",children:(v=W.accountId).length>12?`${v.slice(0,6)}...${v.slice(-4)}`:v})]})]}),(y="codex"===L?x:"claude-code"===L?o:o??x,C="codex"===L?B:"claude code",(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-2",children:["5h window · ",C]}),y?.window_5h_used_pct!=null?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-3xl font-bold text-zinc-100",children:[(100-y.window_5h_used_pct).toFixed(0),"%"]}),(0,t.jsxs)("p",{className:"text-xs text-zinc-500 mt-1",children:["remaining · ",y.window_5h_used_pct.toFixed(0),"% used"]}),y.reset_at_5h&&(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-1",children:S(y.reset_at_5h)})]}):(0,t.jsx)("p",{className:"text-zinc-600 text-sm mt-1",children:"codex"===L?"no usage snapshot for this account yet":"no data yet"})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-2",children:["7-day budget · ",C]}),y?.window_weekly_used_pct!=null?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-3xl font-bold text-zinc-100",children:[(100-y.window_weekly_used_pct).toFixed(0),"%"]}),(0,t.jsxs)("p",{className:"text-xs text-zinc-500 mt-1",children:["remaining · ",y.window_weekly_used_pct.toFixed(0),"% used"]}),y.reset_at_weekly&&(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-1",children:S(y.reset_at_weekly)})]}):(0,t.jsx)("p",{className:"text-zinc-600 text-sm mt-1",children:"codex"===L?"click Refresh data after using this account":"no data yet"})]})]})})),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsx)(g,{data:q,toolFilter:L}),(0,t.jsx)(w,{data:j})]}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(N,{sessions:J,streak:r,timeline:b})}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(m,{data:"codex"===L?a:l,label:"codex"===L?B:"claude code"})}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsx)(d,{data:Y}),(0,t.jsx)(z,{sessions:J})]}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(c,{sessions:J.slice(0,40)})}),i.length>0&&(0,t.jsx)(p,{data:i})]})}],58116)}]);
|
|
2
|
+
${b(l.minutes)} \xb7 ${l.sessions} sessions`},r)})})]},e)),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 text-[10px] text-zinc-600",children:[(0,t.jsx)("span",{children:"less"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-zinc-900 border border-zinc-800"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-900/40"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-800/60"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-700"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-600"}),(0,t.jsx)("span",{className:"w-3 h-3 rounded-sm bg-violet-400"}),(0,t.jsx)("span",{children:"more"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-600 mb-2",children:[r.dateLabel," · ",g.length," sessions · ",w.toFixed(1),"h active"]}),0===g.length?(0,t.jsx)("p",{className:"text-zinc-600 text-sm py-4",children:"no sessions today"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"relative h-4 mb-1",children:Array.from({length:25}).map((e,s)=>(0,t.jsx)("div",{className:"absolute top-0 text-[10px] text-zinc-600 tabular-nums",style:{left:`${s/24*100}%`,transform:"translateX(-50%)"},children:s%3==0?s.toString().padStart(2,"0"):""},s))}),(0,t.jsxs)("div",{className:"relative bg-zinc-950/50 rounded overflow-hidden",style:{height:`${32*z+4}px`},children:[Array.from({length:25}).map((e,s)=>(0,t.jsx)("div",{className:"absolute top-0 bottom-0 border-l border-zinc-800/40",style:{left:`${s/24*100}%`}},s)),y.flatMap((e,s)=>e.map(e=>{let n=(e._start-p)/864e5*100,r=(e._end-e._start)/864e5*100;return(0,t.jsx)("div",{className:`absolute rounded border text-[11px] font-medium leading-none cursor-pointer hover:brightness-125 transition-all overflow-hidden ${v[e.tool]??"bg-zinc-600 border-zinc-500 text-zinc-100"}`,style:{left:`${n}%`,width:`${Math.max(r,.4)}%`,top:`${4+32*s}px`,height:"28px"},onMouseEnter:t=>o({s:e,x:t.clientX,y:t.clientY}),onMouseMove:t=>o({s:e,x:t.clientX,y:t.clientY}),onMouseLeave:()=>o(null),children:r>4&&(0,t.jsxs)("div",{className:"px-1.5 py-1 truncate",children:[(0,t.jsx)("span",{className:"opacity-80",children:j(e._start)})," · ",e.project]})},e.id)}))]}),(0,t.jsxs)("div",{className:"flex gap-4 mt-3 text-[11px] text-zinc-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-violet-500/80 inline-block"})," claude code"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-emerald-600/80 inline-block"})," codex"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm bg-sky-600/80 inline-block"})," cursor"]})]}),c&&(0,t.jsxs)("div",{className:"fixed z-20 bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-xs shadow-xl pointer-events-none max-w-xs",style:{left:c.x+12,top:c.y+12},children:[(0,t.jsxs)("p",{className:"text-zinc-100 font-medium mb-0.5",children:[c.s.project," ",(0,t.jsxs)("span",{className:"text-zinc-500 font-normal",children:["· ",c.s.tool]})]}),c.s.aiTitle&&(0,t.jsx)("p",{className:"text-zinc-400 mb-1 line-clamp-2",children:c.s.aiTitle}),(0,t.jsxs)("p",{className:"text-zinc-500 tabular-nums",children:[j(c.s.startMs)," → ",j(c.s.endMs)," · ",(l=c.s.startMs,Math.max(1,Math.round((c.s.endMs-l)/6e4))),"m"]})]})]})]})]})}let y={"claude-code":"bg-violet-500",codex:"bg-emerald-500",cursor:"bg-sky-500"};function z({sessions:e,limit:n=10}){let r=(0,s.useMemo)(()=>{let t=new Map;for(let n of e){var s;let e=(s=n.cwd)?s.split("/").filter(Boolean).pop()??s:"—";if("—"===e)continue;let r=(n.ended_at??n.started_at)-n.started_at,l=t.get(e)??{project:e,cwd:n.cwd,sessions:0,totalMs:0,tools:{}};l.sessions+=1,l.totalMs+=r,l.tools[n.tool]=(l.tools[n.tool]??0)+1,t.set(e,l)}return[...t.values()].sort((e,t)=>t.totalMs-e.totalMs).slice(0,n)},[e,n]),l=Math.max(...r.map(e=>e.totalMs),1);return 0===r.length?(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"project leaderboard"}),(0,t.jsx)("p",{className:"text-zinc-600 text-sm",children:"no projects yet"})]}):(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-3",children:"project leaderboard"}),(0,t.jsx)("div",{className:"space-y-1.5",children:r.map((e,s)=>{let n;return(0,t.jsxs)("div",{className:"group",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"w-5 text-right text-zinc-600 tabular-nums",children:s+1}),(0,t.jsx)("span",{className:"flex-1 text-zinc-200 truncate",title:e.cwd??e.project,children:e.project}),(0,t.jsx)("div",{className:"flex gap-0.5",children:Object.entries(e.tools).map(([e,s])=>(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${y[e]??"bg-zinc-500"}`,title:`${e}: ${s}`},e))}),(0,t.jsxs)("span",{className:"text-zinc-500 tabular-nums w-12 text-right",children:[e.sessions,"×"]}),(0,t.jsx)("span",{className:"text-zinc-400 tabular-nums w-14 text-right",children:(n=e.totalMs/36e5)<1?`${Math.round(60*n)}m`:`${n.toFixed(1)}h`})]}),(0,t.jsx)("div",{className:"flex gap-px h-1 mt-0.5 ml-8",children:(0,t.jsx)("div",{className:"bg-violet-500/30 rounded-sm",style:{width:`${e.totalMs/l*100}%`}})})]},e.project)})})]})}function w({data:e}){let[n,r]=(0,s.useState)(!1),l=e.filter(e=>e.unlocked),a=e.filter(e=>!e.unlocked).sort((e,t)=>{let s=e.progress?e.progress.current/e.progress.target:0;return(t.progress?t.progress.current/t.progress.target:0)-s}),i=n?[...l,...a]:[...l.slice(0,4),...a.slice(0,Math.max(0,6-Math.min(l.length,4)))];return(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider",children:"achievements"}),(0,t.jsxs)("p",{className:"text-xs text-zinc-600",children:[l.length," / ",e.length," unlocked"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:i.map(e=>{let s=e.progress?Math.min(100,e.progress.current/e.progress.target*100):100*!!e.unlocked;return(0,t.jsxs)("div",{className:`rounded border px-2.5 py-2 ${e.unlocked?"border-amber-700/50 bg-amber-950/30":"border-zinc-800 bg-zinc-950/30"}`,title:e.description,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:`text-xs font-medium ${e.unlocked?"text-amber-300":"text-zinc-500"}`,children:[e.unlocked?"★":"☆"," ",e.title]}),(0,t.jsx)("span",{className:"text-[10px] text-zinc-600 tabular-nums shrink-0",children:function(e){if(!e.progress)return"";let{current:t,target:s}=e.progress;return s>=1e6?`${(t/1e6).toFixed(0)}M / ${(s/1e6).toFixed(0)}M`:s>=1e3?`${t.toLocaleString()} / ${s.toLocaleString()}`:s>=100&&Number.isFinite(t)&&t<100&&t%1!=0?`${t.toFixed(1)} / ${s}`:`${Math.floor(t)} / ${s}`}(e)})]}),(0,t.jsx)("div",{className:"h-0.5 bg-zinc-800 rounded mt-1.5 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${e.unlocked?"bg-amber-500":"bg-zinc-600"}`,style:{width:`${s}%`}})}),(0,t.jsx)("p",{className:"text-[10px] text-zinc-600 mt-1 truncate",children:e.description})]},e.id)})}),e.length>6&&(0,t.jsx)("button",{onClick:()=>r(!n),className:"w-full mt-3 text-xs text-zinc-500 hover:text-zinc-300 border border-zinc-800 rounded py-1",children:n?"show less":`show all (${e.length})`})]})}let k=["all","claude-code","codex","cursor"],M={all:"All","claude-code":"Claude Code",codex:"Codex",cursor:"Cursor"},$=["today","7d","30d","all"],_={today:"Today","7d":"7 days","30d":"30 days",all:"All time"};function S(e){if(!e)return"";let t=e-Date.now();if(t<=0)return"resetting…";let s=new Date(e),n=s.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1}),r=new Date().toDateString()===s.toDateString()?n:`${(s.getMonth()+1).toString().padStart(2,"0")}/${s.getDate().toString().padStart(2,"0")} ${n}`,l=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4),i=l>0?`${l}h ${a}m`:`${a}m`;return`resets at ${r} (in ${i})`}e.s(["Dashboard",0,function({sessions:e,streak:r,allBurndown:l,claudeBurndown:a,codexBurndown:i,hotspots:o,allUsage:x,claudeUsage:u,codexUsage:h,codexAccounts:f,selectedCodexAccountId:b,initialToolFilter:j,spending:v,timeline:y,achievements:C}){var T;let F,D,L=(0,n.useRouter)(),R=(0,n.usePathname)(),P=(0,n.useSearchParams)(),[O,A]=(0,s.useState)(j),[E,U]=(0,s.useState)("all"),[X,I]=(0,s.useState)("idle"),[W,B]=(0,s.useState)(null),K=(0,s.useMemo)(()=>f.find(e=>e.accountId===b)??null,[f,b]),H=K?`codex \xb7 ${K.label}`:"codex · all accounts",J=(0,s.useMemo)(()=>{let e;return e=new Date,"today"===E?(e.setHours(0,0,0,0),e.getTime()):"7d"===E?Date.now()-6048e5:"30d"===E?Date.now()-2592e6:0},[E]),Y=(0,s.useMemo)(()=>{let t=J>0?e.filter(e=>e.started_at>=J):e,s={all:t.length};for(let e of t)s[e.tool]=(s[e.tool]??0)+1;return s},[e,J]),q=(0,s.useMemo)(()=>{let t="all"===O?e:e.filter(e=>e.tool===O);return J>0&&(t=t.filter(e=>e.started_at>=J)),t},[e,O,J]),Q=(0,s.useMemo)(()=>{let e=new Map;for(let t of q){let s=(t.ended_at??t.started_at)-t.started_at,n=e.get(t.tool)??{sessions:0,totalMs:0};e.set(t.tool,{sessions:n.sessions+1,totalMs:n.totalMs+s})}let t=Math.max([...e.values()].reduce((e,t)=>e+t.totalMs,0),1);return[...e.entries()].map(([e,s])=>({tool:e,sessions:s.sessions,totalMs:s.totalMs,pct:Math.round(s.totalMs/t*100)})).sort((e,t)=>t.totalMs-e.totalMs)},[q]),V=(0,s.useMemo)(()=>{if(0===J)return v;let e=new Date(J).toISOString().slice(0,10);return{...v,daily:v.daily.filter(t=>t.date>=e)}},[v,J]);async function G(){I("refreshing"),B(null);try{let e=await fetch("/api/import-sessions",{method:"POST"}),t=await e.json();if(!e.ok)throw Error(t.error??"Refresh failed");I("done"),B(`scanned ${t.scanned??0} logs in ${Math.round((t.durationMs??0)/100)/10}s`),L.refresh()}catch(e){I("error"),B(e instanceof Error?e.message:"Refresh failed")}}function Z(e,t){let s=new URLSearchParams(P.toString());"all"===e?(s.delete("agent"),s.delete("codexAccount")):(s.set("agent",e),"codex"!==e&&s.delete("codexAccount")),"codex"===e&&t?s.set("codexAccount",t):s.delete("codexAccount");let n=s.toString();L.replace(n?`${R}?${n}`:R,{scroll:!1}),L.refresh()}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-3",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:k.filter(e=>"all"===e||(Y[e]??0)>0).sort((e,t)=>"all"===e?-1:"all"===t?1:(Y[t]??0)-(Y[e]??0)).map(e=>(0,t.jsxs)("button",{onClick:()=>{A(e),Z(e,"codex"===e?b:null)},className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${O===e?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:[M[e],(0,t.jsx)("span",{className:"ml-1.5 text-zinc-600 tabular-nums",children:Y[e]??0})]},e))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1",children:$.map(e=>(0,t.jsx)("button",{onClick:()=>U(e),className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${E===e?"bg-zinc-700 border-zinc-500 text-zinc-100":"border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:border-zinc-600"}`,children:_[e]},e))}),(0,t.jsx)("button",{type:"button",onClick:G,disabled:"refreshing"===X,className:"text-xs px-3 py-1.5 rounded-full border border-violet-500/40 bg-violet-500/10 text-violet-100 transition-colors hover:bg-violet-500/20 disabled:cursor-not-allowed disabled:opacity-50",children:"refreshing"===X?"Refreshing...":"Refresh data"})]})]}),W&&(0,t.jsx)("div",{className:`mb-4 rounded-lg border px-4 py-3 text-xs ${"error"===X?"border-red-900/60 bg-red-950/40 text-red-200":"border-emerald-900/60 bg-emerald-950/30 text-emerald-200"}`,children:W}),"codex"===O&&f.length>0&&(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-zinc-800 bg-zinc-900 px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-zinc-500",children:"Codex account"}),(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-zinc-600",children:K?K.isCurrent?"current account only":"saved account only":"all saved and legacy Codex usage"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsxs)("select",{value:b??"",onChange:e=>{var t;return t=e.target.value,void(A("codex"),Z("codex",t||null))},className:"max-w-72 rounded-md border border-zinc-700 bg-zinc-950 px-3 py-2 text-xs text-zinc-100 outline-none transition-colors hover:border-zinc-500 focus:border-violet-500",children:[(0,t.jsx)("option",{value:"",children:"All Codex accounts"}),f.map(e=>(0,t.jsxs)("option",{value:e.accountId,children:[e.label," · ",e.planType??"unknown",e.isCurrent?" · current":""]},e.accountId))]}),(0,t.jsx)("span",{className:"hidden shrink-0 text-xs text-zinc-600 sm:inline",children:K?(T=K.accountId).length>12?`${T.slice(0,6)}...${T.slice(-4)}`:T:"all"})]})]}),(F="codex"===O?h:"claude-code"===O?u:"all"===O?x:null,D="codex"===O?H:"claude-code"===O?"claude code":"all"===O?"all agents":M[O].toLowerCase(),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-2",children:["5h window · ",D]}),F?.window_5h_used_pct!=null?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-3xl font-bold text-zinc-100",children:[(100-F.window_5h_used_pct).toFixed(0),"%"]}),(0,t.jsxs)("p",{className:"text-xs text-zinc-500 mt-1",children:["remaining · ",F.window_5h_used_pct.toFixed(0),"% used"]}),F.reset_at_5h&&(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-1",children:S(F.reset_at_5h)})]}):(0,t.jsx)("p",{className:"text-zinc-600 text-sm mt-1",children:"codex"===O&&b?"no usage snapshot for this account yet":"no data yet"})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900 p-5",children:[(0,t.jsxs)("p",{className:"text-xs text-zinc-500 uppercase tracking-wider mb-2",children:["7-day budget · ",D]}),F?.window_weekly_used_pct!=null?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-3xl font-bold text-zinc-100",children:[(100-F.window_weekly_used_pct).toFixed(0),"%"]}),(0,t.jsxs)("p",{className:"text-xs text-zinc-500 mt-1",children:["remaining · ",F.window_weekly_used_pct.toFixed(0),"% used"]}),F.reset_at_weekly&&(0,t.jsx)("p",{className:"text-xs text-zinc-600 mt-1",children:S(F.reset_at_weekly)})]}):(0,t.jsx)("p",{className:"text-zinc-600 text-sm mt-1",children:"codex"===O&&b?"click Refresh data after using this account":"no data yet"})]})]})})),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsx)(g,{data:V,toolFilter:O}),(0,t.jsx)(w,{data:C})]}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(N,{sessions:q,streak:r,timeline:y})}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(m,{data:"codex"===O?i:"claude-code"===O?a:l,label:"codex"===O?H:"claude-code"===O?"claude code":"all agents"})}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsx)(d,{data:Q}),(0,t.jsx)(z,{sessions:q})]}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(c,{sessions:q.slice(0,40)})}),o.length>0&&(0,t.jsx)(p,{data:o})]})}],58116)}]);
|
package/package.json
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hirra/vibemeter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Local-first dashboard for your AI coding life — Claude Code, Codex, Cursor session tracking with usage windows, spending, heatmaps, and achievements.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude-code",
|
|
7
|
+
"codex",
|
|
8
|
+
"cursor",
|
|
9
|
+
"dashboard",
|
|
10
|
+
"ai-coding",
|
|
11
|
+
"session-tracking",
|
|
12
|
+
"local-first"
|
|
13
|
+
],
|
|
6
14
|
"homepage": "https://github.com/myhirra/Vibemeter",
|
|
7
|
-
"repository": {
|
|
8
|
-
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/myhirra/Vibemeter.git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
9
22
|
"license": "MIT",
|
|
10
23
|
"author": "hirra <myhirra@126.com>",
|
|
11
24
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/db.ts","../../../src/lib/data-dir.ts","../../../src/lib/db-bootstrap.ts","../../../src/lib/codex-auth.ts","../../../src/lib/usage-snapshots.ts","../../../src/lib/collectors/session-importer.ts","../../../src/lib/parsers/session-log.ts","../../../src/lib/parsers/statusline-json.ts","../../../src/lib/parsers/codex-ratelimit.ts","../../../src/lib/collectors/codex-importer.ts","../../../src/lib/collectors/cursor-importer.ts"],"sourcesContent":["import Database from 'better-sqlite3';\nimport path from 'path';\nimport fs from 'fs';\nimport { dataDir } from './data-dir';\nimport { bootstrap } from './db-bootstrap';\n\nlet _db: Database.Database | null = null;\n\nexport function getDb(): Database.Database {\n if (_db) return _db;\n const dir = dataDir();\n fs.mkdirSync(dir, { recursive: true });\n _db = new Database(path.join(dir, 'continuity.sqlite'));\n _db.pragma('journal_mode = WAL');\n bootstrap(_db);\n return _db;\n}\n","import path from 'path';\n\n/**\n * Where Vibemeter stores its SQLite DB and statusline snapshot.\n *\n * - When installed via `npx @hirra/vibemeter`: the bin script sets\n * VIBEMETER_DATA_DIR to `~/.vibemeter` for a stable user-data location.\n * - In local development from a checkout: defaults to `<cwd>/.data`.\n */\nexport function dataDir(): string {\n return process.env.VIBEMETER_DATA_DIR ?? path.join(process.cwd(), '.data');\n}\n","import type Database from 'better-sqlite3';\n\nexport function bootstrap(db: Database.Database): void {\n db.exec(`\n CREATE TABLE IF NOT EXISTS sessions (\n id TEXT PRIMARY KEY,\n tool TEXT NOT NULL,\n started_at INTEGER NOT NULL,\n ended_at INTEGER,\n exit_code INTEGER,\n cwd TEXT,\n cli_args TEXT,\n summary TEXT,\n confidence TEXT NOT NULL DEFAULT 'medium'\n );\n\n CREATE TABLE IF NOT EXISTS usage_snapshots (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n captured_at INTEGER NOT NULL,\n source TEXT NOT NULL,\n account_id TEXT,\n window_5h_used_pct REAL,\n window_weekly_used_pct REAL,\n reset_at_5h INTEGER,\n reset_at_weekly INTEGER,\n raw_output TEXT,\n confidence TEXT NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS file_changes (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT NOT NULL,\n path TEXT NOT NULL,\n change_type TEXT NOT NULL,\n detected_at INTEGER NOT NULL,\n FOREIGN KEY (session_id) REFERENCES sessions(id)\n );\n `);\n\n // Idempotent column additions (SQLite has no ADD COLUMN IF NOT EXISTS)\n const addCol = (table: string, col: string, def: string) => {\n try { db.exec(`ALTER TABLE ${table} ADD COLUMN ${col} ${def}`); } catch { /* already exists */ }\n };\n addCol('sessions', 'ai_title', 'TEXT');\n addCol('sessions', 'tags', 'TEXT DEFAULT \"[]\"');\n addCol('sessions', 'codex_category', 'TEXT');\n addCol('sessions', 'tokens_used', 'INTEGER');\n addCol('usage_snapshots', 'account_id', 'TEXT');\n\n db.exec(`\n CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);\n `);\n}\n","import { mkdir, readFile, rename, readdir, stat, unlink, writeFile } from 'node:fs/promises';\nimport { readFileSync, statSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\n\ninterface CodexAuthFile {\n auth_mode?: unknown;\n OPENAI_API_KEY?: unknown;\n tokens?: {\n id_token?: unknown;\n access_token?: unknown;\n refresh_token?: unknown;\n account_id?: unknown;\n };\n last_refresh?: unknown;\n}\n\nexport interface CodexAccountSummary {\n accountId: string;\n label: string;\n email: string | null;\n name: string | null;\n planType: string | null;\n userId: string | null;\n lastRefresh: string | null;\n idTokenExpiresAt: string | null;\n accessTokenExpiresAt: string | null;\n storedAt: string | null;\n isCurrent: boolean;\n}\n\nexport interface CodexAuthPaths {\n authPath?: string;\n storeDir?: string;\n}\n\nexport interface CurrentCodexAccount {\n accountId: string;\n authMtimeMs: number;\n}\n\nconst AUTH_CLAIMS_KEY = 'https://api.openai.com/auth';\n\nfunction defaultAuthPath() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth.json');\n}\n\nfunction defaultStoreDir() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth-accounts');\n}\n\nfunction resolvePaths(paths: CodexAuthPaths = {}) {\n return {\n authPath: paths.authPath ?? defaultAuthPath(),\n storeDir: paths.storeDir ?? defaultStoreDir(),\n };\n}\n\nfunction accountPath(accountId: string, storeDir: string) {\n return path.join(/* turbopackIgnore: true */ storeDir, `${accountId.replace(/[^a-zA-Z0-9_-]/g, '_')}.json`);\n}\n\nasync function readAuthFile(filePath: string): Promise<CodexAuthFile> {\n const raw = await readFile(filePath, 'utf8');\n const parsed = JSON.parse(raw) as CodexAuthFile;\n if (!parsed.tokens || typeof parsed.tokens.account_id !== 'string') {\n throw new Error('Codex auth file is missing tokens.account_id');\n }\n return parsed;\n}\n\nasync function writeJsonAtomic(filePath: string, data: unknown) {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmp, `${JSON.stringify(data, null, 2)}\\n`, { encoding: 'utf8', mode: 0o600 });\n await rename(tmp, filePath);\n}\n\nfunction decodeJwtPayload(token: unknown): Record<string, unknown> | null {\n if (typeof token !== 'string') return null;\n const [, payload] = token.split('.');\n if (!payload) return null;\n\n try {\n return JSON.parse(Buffer.from(payload, 'base64url').toString('utf8')) as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\nfunction stringClaim(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null;\n}\n\nfunction expiryClaim(value: unknown): string | null {\n return typeof value === 'number' ? new Date(value * 1000).toISOString() : null;\n}\n\nfunction summarizeAuth(auth: CodexAuthFile, storedAt: string | null, currentAccountId: string | null): CodexAccountSummary {\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) throw new Error('Codex auth file is missing tokens.account_id');\n\n const idPayload = decodeJwtPayload(auth.tokens?.id_token);\n const accessPayload = decodeJwtPayload(auth.tokens?.access_token);\n const idAuthClaims = idPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n const accessAuthClaims = accessPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n\n const email = stringClaim(idPayload?.email);\n const name = stringClaim(idPayload?.name);\n const planType = stringClaim(idAuthClaims?.chatgpt_plan_type) ?? stringClaim(accessAuthClaims?.chatgpt_plan_type);\n const userId = stringClaim(idAuthClaims?.user_id) ?? stringClaim(accessAuthClaims?.user_id);\n const label = email ?? name ?? `${accountId.slice(0, 8)}...${accountId.slice(-4)}`;\n\n return {\n accountId,\n label,\n email,\n name,\n planType,\n userId,\n lastRefresh: stringClaim(auth.last_refresh),\n idTokenExpiresAt: expiryClaim(idPayload?.exp),\n accessTokenExpiresAt: expiryClaim(accessPayload?.exp),\n storedAt,\n isCurrent: accountId === currentAccountId,\n };\n}\n\nexport async function getCodexAccounts(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary[]> {\n const { authPath, storeDir } = resolvePaths(paths);\n let currentAccountId: string | null = null;\n let currentAuth: CodexAuthFile | null = null;\n\n try {\n currentAuth = await readAuthFile(authPath);\n currentAccountId = stringClaim(currentAuth.tokens?.account_id);\n } catch {\n currentAuth = null;\n }\n\n const accounts = new Map<string, CodexAccountSummary>();\n\n try {\n const entries = await readdir(storeDir);\n for (const entry of entries) {\n if (!entry.endsWith('.json')) continue;\n const filePath = path.join(storeDir, entry);\n try {\n const storedAuth = await readAuthFile(filePath);\n const storedStat = await stat(filePath);\n const summary = summarizeAuth(storedAuth, storedStat.mtime.toISOString(), currentAccountId);\n accounts.set(summary.accountId, summary);\n } catch {\n // Ignore malformed account snapshots so one bad file does not break the admin page.\n }\n }\n } catch {\n // Missing store just means no saved accounts yet.\n }\n\n if (currentAuth && currentAccountId && !accounts.has(currentAccountId)) {\n accounts.set(currentAccountId, summarizeAuth(currentAuth, null, currentAccountId));\n }\n\n return [...accounts.values()].sort((a, b) => {\n if (a.isCurrent !== b.isCurrent) return a.isCurrent ? -1 : 1;\n return a.label.localeCompare(b.label);\n });\n}\n\nexport function getCurrentCodexAccount(paths: CodexAuthPaths = {}): CurrentCodexAccount | null {\n const { authPath } = resolvePaths(paths);\n try {\n const auth = JSON.parse(readFileSync(authPath, 'utf8')) as CodexAuthFile;\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) return null;\n return {\n accountId,\n authMtimeMs: statSync(authPath).mtimeMs,\n };\n } catch {\n return null;\n }\n}\n\nexport async function importCurrentCodexAuth(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary> {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath);\n const accountId = auth.tokens?.account_id as string;\n const destination = accountPath(accountId, storeDir);\n await writeJsonAtomic(destination, auth);\n const storedStat = await stat(destination);\n return summarizeAuth(auth, storedStat.mtime.toISOString(), accountId);\n}\n\nexport async function switchCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const source = accountPath(accountId, storeDir);\n const auth = await readAuthFile(source);\n const sourceAccountId = auth.tokens?.account_id;\n if (sourceAccountId !== accountId) {\n throw new Error('Stored account id does not match requested account');\n }\n\n let backupPath: string | null = null;\n try {\n const current = await readFile(authPath, 'utf8');\n backupPath = `${authPath}.${new Date().toISOString().replace(/[:.]/g, '-')}.bak`;\n await writeFile(backupPath, current, { encoding: 'utf8', mode: 0o600 });\n } catch {\n backupPath = null;\n }\n\n await writeJsonAtomic(authPath, auth);\n return {\n ...summarizeAuth(auth, null, accountId),\n backupPath,\n };\n}\n\nexport async function deleteCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath).catch(() => null);\n if (auth?.tokens?.account_id === accountId) {\n throw new Error('Cannot delete the currently active Codex account');\n }\n await unlink(accountPath(accountId, storeDir));\n}\n","import type Database from 'better-sqlite3';\n\nexport type UsageSource = 'claude_usage_cmd' | 'statusline' | 'manual' | 'codex';\nexport type UsageConfidence = 'high' | 'medium' | 'low';\n\nexport interface UsageSnapshotInput {\n capturedAt: number;\n source: UsageSource;\n accountId: string | null;\n window5hUsedPct: number | null;\n windowWeeklyUsedPct: number | null;\n resetAt5h: number | null;\n resetAtWeekly: number | null;\n rawOutput: string | null;\n confidence: UsageConfidence;\n}\n\nexport interface UsageSnapshotRecord {\n id: number;\n captured_at: number;\n source: UsageSource;\n account_id: string | null;\n window_5h_used_pct: number | null;\n window_weekly_used_pct: number | null;\n reset_at_5h: number | null;\n reset_at_weekly: number | null;\n raw_output: string | null;\n confidence: UsageConfidence;\n}\n\nexport function insertUsageSnapshot(db: Database.Database, input: UsageSnapshotInput): void {\n db.prepare(`\n INSERT INTO usage_snapshots\n (captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence)\n VALUES\n (@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,\n @reset_at_5h, @reset_at_weekly, @raw_output, @confidence)\n `).run({\n captured_at: input.capturedAt,\n source: input.source,\n account_id: input.accountId,\n window_5h_used_pct: input.window5hUsedPct,\n window_weekly_used_pct: input.windowWeeklyUsedPct,\n reset_at_5h: input.resetAt5h,\n reset_at_weekly: input.resetAtWeekly,\n raw_output: input.rawOutput,\n confidence: input.confidence,\n });\n}\n\nexport function getLatestUsageSnapshot(\n db: Database.Database,\n source: UsageSource,\n accountId?: string | null,\n): UsageSnapshotRecord | null {\n const row = accountId != null\n ? db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ? AND account_id = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source, accountId)\n : db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source);\n\n return (row as UsageSnapshotRecord | undefined) ?? null;\n}\n","/**\n * Scans ~/.claude/projects/ for session JSONL files and upserts them into SQLite.\n * Active sessions (present in ~/.claude/sessions/) get ended_at = null.\n *\n * This is the primary data source — no claude CLI alias needed.\n * confidence='high' because data comes directly from Claude Code's own files.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\nimport { parseSessionLog } from '../parsers/session-log';\nimport { parseStatuslineJson } from '../parsers/statusline-json';\nimport { parseCodexRateLimit } from '../parsers/codex-ratelimit';\nimport { importCodexSessions } from './codex-importer';\nimport { importCursorSessions } from './cursor-importer';\nimport { getCurrentCodexAccount } from '../codex-auth';\nimport { insertUsageSnapshot } from '../usage-snapshots';\n\nconst CLAUDE_DIR = path.join(os.homedir(), '.claude');\nconst PROJECTS_DIR = path.join(CLAUDE_DIR, 'projects');\nconst SESSIONS_DIR = path.join(CLAUDE_DIR, 'sessions');\n\n/** Returns the set of sessionIds currently active (file present in ~/.claude/sessions/). */\nfunction getActiveSessionIds(): Set<string> {\n const active = new Set<string>();\n try {\n const files = fs.readdirSync(SESSIONS_DIR);\n for (const f of files) {\n if (!f.endsWith('.json')) continue;\n try {\n const raw = fs.readFileSync(path.join(SESSIONS_DIR, f), 'utf8');\n const data = JSON.parse(raw) as { sessionId?: string };\n if (data.sessionId) active.add(data.sessionId);\n } catch { /* corrupt file, skip */ }\n }\n } catch { /* SESSIONS_DIR doesn't exist */ }\n return active;\n}\n\n/** Returns all .jsonl paths under ~/.claude/projects/. */\nfunction collectJsonlPaths(): string[] {\n const result: string[] = [];\n try {\n const projectDirs = fs.readdirSync(PROJECTS_DIR);\n for (const dir of projectDirs) {\n const full = path.join(PROJECTS_DIR, dir);\n try {\n const stat = fs.statSync(full);\n if (!stat.isDirectory()) continue;\n const files = fs.readdirSync(full);\n for (const f of files) {\n if (f.endsWith('.jsonl')) result.push(path.join(full, f));\n }\n } catch { /* skip */ }\n }\n } catch { /* PROJECTS_DIR doesn't exist */ }\n return result;\n}\n\nexport interface ImportResult {\n scanned: number;\n inserted: number;\n skipped: number;\n}\n\nexport function importSessions(): ImportResult {\n const db = getDb();\n const activeIds = getActiveSessionIds();\n const jsonlPaths = collectJsonlPaths();\n\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, exit_code, cwd, cli_args, summary, ai_title, confidence)\n VALUES (@id, @tool, @started_at, @ended_at, @exit_code, @cwd, @cli_args, @summary, @ai_title, @confidence)\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n exit_code = excluded.exit_code,\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title),\n confidence = excluded.confidence\n `);\n\n let inserted = 0;\n let skipped = 0;\n\n const importAll = db.transaction(() => {\n for (const jsonlPath of jsonlPaths) {\n const meta = parseSessionLog(jsonlPath);\n if (!meta || !meta.startedAt) { skipped++; continue; }\n\n const isActive = activeIds.has(meta.sessionId);\n\n upsert.run({\n id: meta.sessionId,\n tool: 'claude-code',\n started_at: meta.startedAt,\n ended_at: isActive ? null : meta.lastSeenAt,\n exit_code: null,\n cwd: meta.cwd,\n cli_args: null,\n summary: null,\n ai_title: meta.aiTitle,\n confidence: 'high',\n });\n inserted++;\n }\n });\n\n importAll();\n importCodexSessions();\n importCursorSessions();\n\n // Claude Code: from statusline-latest.json written by statusline-command.sh\n const usage = parseStatuslineJson();\n if (usage) {\n insertUsageSnapshot(db, {\n capturedAt: Date.now(),\n source: 'statusline',\n accountId: null,\n window5hUsedPct: usage.window_5h_used_pct,\n windowWeeklyUsedPct: usage.window_weekly_used_pct,\n resetAt5h: usage.reset_at_5h,\n resetAtWeekly: usage.reset_at_weekly,\n rawOutput: usage.raw_output,\n confidence: 'high',\n });\n }\n\n // Codex: from most recent ~/.codex/sessions/*/rollout-*.jsonl rate_limits event\n const currentCodexAccount = getCurrentCodexAccount();\n const codexUsage = parseCodexRateLimit({\n minMtimeMs: currentCodexAccount?.authMtimeMs,\n });\n if (codexUsage) {\n insertUsageSnapshot(db, {\n capturedAt: Date.now(),\n source: 'codex',\n accountId: currentCodexAccount?.accountId ?? null,\n window5hUsedPct: codexUsage.window_5h_used_pct,\n windowWeeklyUsedPct: codexUsage.window_weekly_used_pct,\n resetAt5h: codexUsage.reset_at_5h,\n resetAtWeekly: codexUsage.reset_at_weekly,\n rawOutput: null,\n confidence: 'high',\n });\n }\n\n return { scanned: jsonlPaths.length, inserted, skipped };\n}\n","import fs from 'fs';\nimport { z } from 'zod';\n\n// Minimal shapes we care about — extra fields are ignored via .passthrough()\nconst LineWithTimestamp = z.object({\n timestamp: z.string().optional(),\n sessionId: z.string().optional(),\n cwd: z.string().optional(),\n gitBranch: z.string().optional(),\n version: z.string().optional(),\n type: z.string(),\n}).passthrough();\n\nconst AiTitleLine = z.object({\n type: z.literal('ai-title'),\n aiTitle: z.string(),\n sessionId: z.string(),\n});\n\nexport interface SessionLogMeta {\n sessionId: string;\n cwd: string | null;\n gitBranch: string | null;\n version: string | null;\n /** Unix ms of first timestamped line */\n startedAt: number | null;\n /** Unix ms of last timestamped line */\n lastSeenAt: number | null;\n /**\n * Claude-generated session title from the ai-title event.\n * Safe to store (not user prompt content).\n * TODO Day 2: use as seed for continuation prompt generation.\n */\n aiTitle: string | null;\n}\n\nexport function parseSessionLog(jsonlPath: string): SessionLogMeta | null {\n let raw: string;\n try {\n raw = fs.readFileSync(jsonlPath, 'utf8');\n } catch {\n return null;\n }\n\n const lines = raw.split('\\n').filter(Boolean);\n if (lines.length === 0) return null;\n\n // sessionId comes from the filename (uuid before .jsonl)\n const sessionId = jsonlPath.split('/').pop()?.replace('.jsonl', '') ?? null;\n if (!sessionId) return null;\n\n let cwd: string | null = null;\n let gitBranch: string | null = null;\n let version: string | null = null;\n let startedAt: number | null = null;\n let lastSeenAt: number | null = null;\n let aiTitle: string | null = null;\n\n for (const line of lines) {\n let parsed: Record<string, unknown>;\n try {\n parsed = JSON.parse(line) as Record<string, unknown>;\n } catch {\n continue;\n }\n\n const base = LineWithTimestamp.safeParse(parsed);\n if (!base.success) continue;\n\n const data = base.data;\n\n if (data.timestamp) {\n const ms = new Date(data.timestamp).getTime();\n if (!Number.isNaN(ms)) {\n if (startedAt === null || ms < startedAt) startedAt = ms;\n if (lastSeenAt === null || ms > lastSeenAt) lastSeenAt = ms;\n }\n }\n\n if (!cwd && data.cwd) cwd = data.cwd;\n if (!gitBranch && data.gitBranch) gitBranch = data.gitBranch;\n if (!version && data.version) version = data.version;\n\n if (data.type === 'ai-title') {\n const titleParsed = AiTitleLine.safeParse(parsed);\n if (titleParsed.success) aiTitle = titleParsed.data.aiTitle;\n }\n }\n\n return { sessionId, cwd, gitBranch, version, startedAt, lastSeenAt, aiTitle };\n}\n\nexport interface ConversationTurn {\n role: 'user' | 'assistant';\n text: string;\n toolNames?: string[];\n}\n\nexport function readConversationTurns(jsonlPath: string, limit = 12): ConversationTurn[] {\n let raw: string;\n try {\n raw = fs.readFileSync(jsonlPath, 'utf8');\n } catch {\n return [];\n }\n\n const turns: ConversationTurn[] = [];\n\n for (const line of raw.split('\\n').filter(Boolean)) {\n let parsed: Record<string, unknown>;\n try { parsed = JSON.parse(line) as Record<string, unknown>; } catch { continue; }\n\n const type = parsed.type as string | undefined;\n const msg = parsed.message as Record<string, unknown> | undefined;\n if (!msg || (type !== 'user' && type !== 'assistant')) continue;\n\n const role = msg.role as string;\n const content = msg.content;\n\n if (role === 'user' && typeof content === 'string' && content.trim()) {\n turns.push({ role: 'user', text: content.trim().slice(0, 800) });\n } else if (role === 'assistant' && Array.isArray(content)) {\n const textParts: string[] = [];\n const toolNames: string[] = [];\n for (const part of content as Record<string, unknown>[]) {\n if (part.type === 'text' && typeof part.text === 'string') {\n textParts.push((part.text as string).slice(0, 600));\n } else if (part.type === 'tool_use' && typeof part.name === 'string') {\n toolNames.push(part.name as string);\n }\n }\n if (textParts.length > 0 || toolNames.length > 0) {\n turns.push({ role: 'assistant', text: textParts.join(' ').trim(), toolNames });\n }\n }\n }\n\n return turns.slice(-limit);\n}\n","/**\n * Parses ~/.data/statusline-latest.json written by the patched statusline-command.sh.\n * Claude Code writes this file on every status line render with current session context.\n * All fields come directly from Claude Code internals — confidence='high'.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport { z } from 'zod';\nimport { dataDir } from '../data-dir';\n\nexport const STATUSLINE_PATH = path.join(dataDir(), 'statusline-latest.json');\n\nconst StatuslineSchema = z.object({\n session_id: z.string().optional(),\n session_name: z.string().optional(),\n transcript_path: z.string().optional(),\n cwd: z.string().optional(),\n model: z.object({ id: z.string(), display_name: z.string() }).optional(),\n cost: z.object({ total_cost_usd: z.number() }).optional(),\n context_window: z.object({\n total_input_tokens: z.number(),\n total_output_tokens: z.number(),\n used_percentage: z.number(),\n }).optional(),\n rate_limits: z.object({\n five_hour: z.object({\n used_percentage: z.number(),\n resets_at: z.number().optional(), // unix seconds\n }).optional(),\n seven_day: z.object({\n used_percentage: z.number(),\n resets_at: z.number().optional(),\n }).optional(),\n }).optional(),\n}).passthrough();\n\nexport type StatuslineData = z.infer<typeof StatuslineSchema>;\n\nexport interface StatuslineUsage {\n window_5h_used_pct: number | null;\n window_weekly_used_pct: number | null;\n reset_at_5h: number | null; // unix ms\n reset_at_weekly: number | null; // unix ms\n raw_output: string;\n confidence: 'high';\n /** Also returned for session upsert */\n session_id: string | null;\n session_name: string | null;\n cwd: string | null;\n}\n\nexport function parseStatuslineJson(): StatuslineUsage | null {\n let raw: string;\n try {\n raw = fs.readFileSync(STATUSLINE_PATH, 'utf8');\n } catch {\n return null;\n }\n\n const parsed = StatuslineSchema.safeParse(JSON.parse(raw));\n if (!parsed.success) return null;\n\n const d = parsed.data;\n const rl = d.rate_limits;\n\n return {\n window_5h_used_pct: rl?.five_hour?.used_percentage ?? null,\n window_weekly_used_pct: rl?.seven_day?.used_percentage ?? null,\n // resets_at from Claude Code is unix seconds — convert to ms\n reset_at_5h: rl?.five_hour?.resets_at != null ? rl.five_hour.resets_at * 1000 : null,\n reset_at_weekly: rl?.seven_day?.resets_at != null ? rl.seven_day.resets_at * 1000 : null,\n raw_output: raw.slice(0, 2000),\n confidence: 'high',\n session_id: d.session_id ?? null,\n session_name: d.session_name ?? null,\n cwd: d.cwd ?? null,\n };\n}\n","/**\n * Scans the most recent ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl and extracts\n * the last rate_limits event (type=token_count with payload.rate_limits).\n * primary = 5-hour window (300 min)\n * secondary = 7-day window (10080 min)\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport os from 'os';\n\nconst SESSIONS_DIR = path.join(os.homedir(), '.codex', 'sessions');\n\ninterface RateLimitWindow {\n used_percent: number;\n window_minutes: number;\n resets_at: number; // unix seconds\n}\n\ninterface RateLimits {\n primary: RateLimitWindow;\n secondary: RateLimitWindow;\n}\n\nexport interface CodexUsage {\n window_5h_used_pct: number;\n window_weekly_used_pct: number;\n reset_at_5h: number; // unix ms\n reset_at_weekly: number; // unix ms\n source_mtime_ms: number;\n}\n\nexport interface CodexRateLimitParseOptions {\n sessionsDir?: string;\n minMtimeMs?: number;\n}\n\nexport function parseCodexRateLimit(options: CodexRateLimitParseOptions = {}): CodexUsage | null {\n // Find the most recently modified jsonl across all session dirs\n const sessionsDir = options.sessionsDir ?? SESSIONS_DIR;\n const minMtimeMs = options.minMtimeMs ?? 0;\n try {\n let bestFile: { path: string; mtime: number } | null = null as { path: string; mtime: number } | null;\n function walk(dir: string) {\n for (const entry of fs.readdirSync(dir)) {\n const full = path.join(dir, entry);\n try {\n const stat = fs.statSync(full);\n if (stat.isDirectory()) { walk(full); continue; }\n if (entry.endsWith('.jsonl') && stat.mtimeMs >= minMtimeMs && stat.mtimeMs > (bestFile?.mtime ?? 0)) {\n bestFile = { path: full, mtime: stat.mtimeMs };\n }\n } catch { /* skip */ }\n }\n }\n if (!fs.existsSync(sessionsDir)) return null;\n walk(sessionsDir);\n if (!bestFile) return null;\n\n // Read from the end — last rate_limits event wins\n const lines = fs.readFileSync(bestFile.path, 'utf8').split('\\n').filter(Boolean).reverse();\n for (const line of lines) {\n try {\n const obj = JSON.parse(line) as { payload?: { rate_limits?: RateLimits } };\n const rl = obj?.payload?.rate_limits;\n if (!rl?.primary || !rl?.secondary) continue;\n return {\n window_5h_used_pct: rl.primary.used_percent,\n window_weekly_used_pct: rl.secondary.used_percent,\n reset_at_5h: rl.primary.resets_at * 1000,\n reset_at_weekly: rl.secondary.resets_at * 1000,\n source_mtime_ms: bestFile.mtime,\n };\n } catch { /* skip */ }\n }\n return null;\n } catch {\n return null;\n }\n}\n","import fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\n\nconst CODEX_DIR = path.join(os.homedir(), '.codex');\nconst STATE_DB = path.join(CODEX_DIR, 'state_5.sqlite');\nconst HISTORY_PATH = path.join(CODEX_DIR, 'history.jsonl');\n\ninterface ThreadRow {\n id: string;\n created_at_ms: number;\n updated_at_ms: number;\n cwd: string | null;\n title: string | null;\n first_user_message: string | null;\n tokens_used: number | null;\n git_branch: string | null;\n model: string | null;\n archived: number;\n}\n\nfunction importFromStateDb(): boolean {\n if (!fs.existsSync(STATE_DB)) return false;\n try {\n // Use better-sqlite3 to read Codex's own SQLite\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BetterSqlite = require('better-sqlite3') as typeof import('better-sqlite3');\n const codexDb = new BetterSqlite(STATE_DB, { readonly: true });\n\n const threads = codexDb.prepare(`\n SELECT id, created_at_ms, updated_at_ms, cwd, title, first_user_message,\n tokens_used, git_branch, model, archived\n FROM threads\n ORDER BY created_at_ms ASC\n `).all() as ThreadRow[];\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, cwd, ai_title, tokens_used, confidence)\n VALUES (@id, 'codex', @started_at, @ended_at, @cwd, @ai_title, @tokens_used, 'high')\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n cwd = COALESCE(sessions.cwd, excluded.cwd),\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title),\n tokens_used = excluded.tokens_used,\n confidence = 'high'\n `);\n\n const importAll = db.transaction(() => {\n for (const t of threads) {\n upsert.run({\n id: t.id,\n started_at: t.created_at_ms,\n ended_at: t.updated_at_ms,\n cwd: t.cwd,\n ai_title: t.title ?? t.first_user_message?.slice(0, 120) ?? null,\n tokens_used: t.tokens_used,\n });\n }\n });\n importAll();\n codexDb.close();\n return true;\n } catch {\n return false;\n }\n}\n\nfunction importFromHistoryJsonl(): void {\n if (!fs.existsSync(HISTORY_PATH)) return;\n interface Entry { session_id: string; ts: number; }\n const bySession = new Map<string, { minTs: number; maxTs: number }>();\n try {\n for (const line of fs.readFileSync(HISTORY_PATH, 'utf8').split('\\n').filter(Boolean)) {\n try {\n const e = JSON.parse(line) as Entry;\n if (!e.session_id || !e.ts) continue;\n const cur = bySession.get(e.session_id);\n if (!cur) { bySession.set(e.session_id, { minTs: e.ts, maxTs: e.ts }); }\n else { if (e.ts < cur.minTs) cur.minTs = e.ts; if (e.ts > cur.maxTs) cur.maxTs = e.ts; }\n } catch { /* skip */ }\n }\n } catch { return; }\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, confidence)\n VALUES (@id, 'codex', @started_at, @ended_at, 'medium')\n ON CONFLICT(id) DO NOTHING\n `);\n const importAll = db.transaction(() => {\n for (const [id, { minTs, maxTs }] of bySession) {\n upsert.run({ id, started_at: minTs * 1000, ended_at: maxTs * 1000 });\n }\n });\n importAll();\n}\n\nexport function importCodexSessions(): void {\n const usedStateDb = importFromStateDb();\n if (!usedStateDb) importFromHistoryJsonl(); // fallback\n}\n","import fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\n\nconst CURSOR_BASE = path.join(\n os.homedir(),\n 'Library/Application Support/Cursor/User'\n);\nconst CURSOR_WS = path.join(CURSOR_BASE, 'workspaceStorage');\nconst CURSOR_GLOBAL_DB = path.join(CURSOR_BASE, 'globalStorage/state.vscdb');\n\ninterface ComposerEntry {\n composerId: string;\n createdAt: number;\n name?: string;\n unifiedMode?: string;\n totalLinesAdded?: number;\n totalLinesRemoved?: number;\n isArchived?: boolean;\n}\n\ninterface ComposerData {\n allComposers?: ComposerEntry[];\n}\n\nexport function importCursorSessions(): void {\n if (!fs.existsSync(CURSOR_WS)) return;\n\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BetterSqlite = require('better-sqlite3') as typeof import('better-sqlite3');\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, cwd, ai_title, confidence)\n VALUES (@id, 'cursor', @started_at, @ended_at, @cwd, @ai_title, 'high')\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n cwd = COALESCE(sessions.cwd, excluded.cwd),\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title)\n `);\n\n let dirs: string[];\n try { dirs = fs.readdirSync(CURSOR_WS); } catch { return; }\n\n const importAll = db.transaction(() => {\n for (const dir of dirs) {\n const vscdb = path.join(CURSOR_WS, dir, 'state.vscdb');\n const wsJson = path.join(CURSOR_WS, dir, 'workspace.json');\n if (!fs.existsSync(vscdb)) continue;\n\n let folder: string | null = null;\n try {\n const ws = JSON.parse(fs.readFileSync(wsJson, 'utf8')) as { folder?: string };\n folder = ws.folder?.replace('file://', '') ?? null;\n } catch { /* ok */ }\n\n try {\n const cdb = new BetterSqlite(vscdb, { readonly: true });\n const row = cdb.prepare(\n `SELECT value FROM ItemTable WHERE key = 'composer.composerData'`\n ).get() as { value: string } | undefined;\n cdb.close();\n if (!row) continue;\n\n const data = JSON.parse(row.value) as ComposerData;\n const composers = data.allComposers ?? [];\n\n for (const c of composers) {\n if (!c.composerId || !c.createdAt) continue;\n upsert.run({\n id: c.composerId,\n started_at: c.createdAt,\n ended_at: c.createdAt, // Cursor doesn't record end time\n cwd: folder,\n ai_title: c.name ?? null,\n });\n }\n } catch { /* corrupt db, skip */ }\n }\n });\n\n importAll();\n\n // 2026 onwards: Cursor migrated composers to a single global `cursorDiskKV`\n // table inside ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb.\n // Per-workspace storage above only covers pre-migration data; we read the new\n // table here too. Upsert dedupes on composerId.\n if (fs.existsSync(CURSOR_GLOBAL_DB)) {\n try {\n const gdb = new BetterSqlite(CURSOR_GLOBAL_DB, { readonly: true });\n // Check the table exists before querying (older Cursor versions won't have it).\n const hasTable = gdb.prepare(\n `SELECT name FROM sqlite_master WHERE type='table' AND name='cursorDiskKV'`,\n ).get();\n if (hasTable) {\n const rows = gdb.prepare(\n `SELECT key, value FROM cursorDiskKV WHERE key LIKE 'composerData:%'`,\n ).all() as { key: string; value: Buffer | string }[];\n\n const importGlobal = db.transaction(() => {\n for (const r of rows) {\n const id = r.key.slice('composerData:'.length);\n let data: { composerId?: string; createdAt?: number; lastUpdatedAt?: number; name?: string; text?: string };\n try {\n data = JSON.parse(typeof r.value === 'string' ? r.value : r.value.toString('utf8'));\n } catch { continue; }\n const composerId = data.composerId || id;\n const createdAt = data.createdAt;\n if (!composerId || !createdAt) continue;\n const endedAt = data.lastUpdatedAt ?? createdAt;\n const aiTitle = data.name || (data.text ? data.text.slice(0, 120) : null);\n upsert.run({\n id: composerId,\n started_at: createdAt,\n ended_at: endedAt,\n cwd: null,\n ai_title: aiTitle,\n });\n }\n });\n importGlobal();\n }\n gdb.close();\n } catch { /* skip — corrupt or locked */ }\n }\n}\n"],"names":["dataDir","process","env","VIBEMETER_DATA_DIR","join","cwd","AUTH_CLAIMS_KEY","defaultAuthPath","defaultStoreDir","resolvePaths","paths","authPath","storeDir","accountPath","accountId","replace","readAuthFile","filePath","raw","parsed","JSON","parse","tokens","account_id","Error","writeJsonAtomic","data","dirname","recursive","tmp","pid","Date","now","stringify","encoding","mode","decodeJwtPayload","token","payload","split","Buffer","from","toString","stringClaim","value","length","expiryClaim","toISOString","summarizeAuth","auth","storedAt","currentAccountId","idPayload","id_token","accessPayload","access_token","idAuthClaims","accessAuthClaims","email","name","planType","chatgpt_plan_type","userId","user_id","label","slice","lastRefresh","last_refresh","idTokenExpiresAt","exp","accessTokenExpiresAt","isCurrent","getCodexAccounts","currentAuth","accounts","Map","entries","entry","endsWith","storedAuth","storedStat","summary","mtime","set","has","values","sort","a","b","localeCompare","getCurrentCodexAccount","authMtimeMs","mtimeMs","importCurrentCodexAuth","destination","switchCodexAccount","source","sourceAccountId","backupPath","current","deleteCodexAccount","catch","insertUsageSnapshot","db","input","prepare","run","captured_at","capturedAt","window_5h_used_pct","window5hUsedPct","window_weekly_used_pct","windowWeeklyUsedPct","reset_at_5h","resetAt5h","reset_at_weekly","resetAtWeekly","raw_output","rawOutput","confidence","getLatestUsageSnapshot","row","get","AiTitleLine","LineWithTimestamp","object","timestamp","string","optional","sessionId","gitBranch","version","type","passthrough","literal","aiTitle","parseSessionLog","jsonlPath","readFileSync","lines","filter","Boolean","pop","startedAt","lastSeenAt","line","base","safeParse","success","ms","getTime","Number","isNaN","titleParsed","readConversationTurns","limit","turns","msg","message","role","content","trim","push","text","Array","isArray","textParts","toolNames","part"],"mappings":"gRAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCOO,SAASA,IACd,OAAOC,QAAQC,GAAG,CAACC,kBAAkB,EAAI,EAAA,OAAI,CAACC,IAAI,CAACH,QAAQI,G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,EAAG,OAAO,CAAC,SAAS,CACjC,gBAA0C,IAAzB,EAAG,SAAS,CAAC,SAAS,CACvC,gBAAiB,EAAS,KAAK,AACjCG,CACF,CAAE,KAAM,CAAa,CAEvBlI,OAAO,IACT,CAAE,KAAM,CACN,OAAO2I,IACT,CACF,EHmDyC,CACrC,WAAY,GAAqB,WACnC,GAeA,OAdI,GACF,CAAA,EAAA,EAAA,IADc,eACd,AAAmB,EAAC,EAAI,CACtB,WAAY,KAAK,GAAG,GACpB,OAAQ,QACR,UAAW,GAAqB,WAAa,KAC7C,gBAAiB,EAAW,kBAAkB,CAC9C,oBAAqB,EAAW,sBAAsB,CACtD,UAAW,EAAW,WAAW,CACjC,cAAe,EAAW,eAAe,CACzC,UAAW,KACX,WAAY,MACd,GAGK,CAAE,QAAS,EAAW,MAAM,UAAE,UAAU,CAAQ,CACzD"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
module.exports=[14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},85148,(e,t,r)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},43793,77930,e=>{"use strict";var t=e.i(85148),r=e.i(14747),a=e.i(22734);function n(){return process.env.VIBEMETER_DATA_DIR??r.default.join(process.cwd(),".data")}e.s(["dataDir",0,n],77930);let s=null;e.s(["getDb",0,function(){var e;let o;if(s)return s;let i=n();return a.default.mkdirSync(i,{recursive:!0}),(s=new t.default(r.default.join(i,"continuity.sqlite"))).pragma("journal_mode = WAL"),(e=s).exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS sessions (
|
|
3
|
-
id TEXT PRIMARY KEY,
|
|
4
|
-
tool TEXT NOT NULL,
|
|
5
|
-
started_at INTEGER NOT NULL,
|
|
6
|
-
ended_at INTEGER,
|
|
7
|
-
exit_code INTEGER,
|
|
8
|
-
cwd TEXT,
|
|
9
|
-
cli_args TEXT,
|
|
10
|
-
summary TEXT,
|
|
11
|
-
confidence TEXT NOT NULL DEFAULT 'medium'
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
CREATE TABLE IF NOT EXISTS usage_snapshots (
|
|
15
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
16
|
-
captured_at INTEGER NOT NULL,
|
|
17
|
-
source TEXT NOT NULL,
|
|
18
|
-
account_id TEXT,
|
|
19
|
-
window_5h_used_pct REAL,
|
|
20
|
-
window_weekly_used_pct REAL,
|
|
21
|
-
reset_at_5h INTEGER,
|
|
22
|
-
reset_at_weekly INTEGER,
|
|
23
|
-
raw_output TEXT,
|
|
24
|
-
confidence TEXT NOT NULL
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
CREATE TABLE IF NOT EXISTS file_changes (
|
|
28
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
29
|
-
session_id TEXT NOT NULL,
|
|
30
|
-
path TEXT NOT NULL,
|
|
31
|
-
change_type TEXT NOT NULL,
|
|
32
|
-
detected_at INTEGER NOT NULL,
|
|
33
|
-
FOREIGN KEY (session_id) REFERENCES sessions(id)
|
|
34
|
-
);
|
|
35
|
-
`),(o=(t,r,a)=>{try{e.exec(`ALTER TABLE ${t} ADD COLUMN ${r} ${a}`)}catch{}})("sessions","ai_title","TEXT"),o("sessions","tags",'TEXT DEFAULT "[]"'),o("sessions","codex_category","TEXT"),o("sessions","tokens_used","INTEGER"),o("usage_snapshots","account_id","TEXT"),e.exec(`
|
|
36
|
-
CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);
|
|
37
|
-
CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);
|
|
38
|
-
CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);
|
|
39
|
-
`),s}],43793)},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},46023,e=>{"use strict";var t=e.i(12714),r=e.i(2157),a=e.i(60526),n=e.i(50227);let s="https://api.openai.com/auth";function o(e={}){return{authPath:e.authPath??n.default.join((0,a.homedir)(),".codex","auth.json"),storeDir:e.storeDir??n.default.join((0,a.homedir)(),".codex","auth-accounts")}}function i(e,t){return n.default.join(t,`${e.replace(/[^a-zA-Z0-9_-]/g,"_")}.json`)}async function u(e){let r=JSON.parse(await (0,t.readFile)(e,"utf8"));if(!r.tokens||"string"!=typeof r.tokens.account_id)throw Error("Codex auth file is missing tokens.account_id");return r}async function c(e,r){await (0,t.mkdir)(n.default.dirname(e),{recursive:!0});let a=`${e}.${process.pid}.${Date.now()}.tmp`;await (0,t.writeFile)(a,`${JSON.stringify(r,null,2)}
|
|
40
|
-
`,{encoding:"utf8",mode:384}),await (0,t.rename)(a,e)}function l(e){if("string"!=typeof e)return null;let[,t]=e.split(".");if(!t)return null;try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{return null}}function d(e){return"string"==typeof e&&e.length>0?e:null}function p(e){return"number"==typeof e?new Date(1e3*e).toISOString():null}function _(e,t,r){let a=d(e.tokens?.account_id);if(!a)throw Error("Codex auth file is missing tokens.account_id");let n=l(e.tokens?.id_token),o=l(e.tokens?.access_token),i=n?.[s],u=o?.[s],c=d(n?.email),_=d(n?.name),E=d(i?.chatgpt_plan_type)??d(u?.chatgpt_plan_type),h=d(i?.user_id)??d(u?.user_id),w=c??_??`${a.slice(0,8)}...${a.slice(-4)}`;return{accountId:a,label:w,email:c,name:_,planType:E,userId:h,lastRefresh:d(e.last_refresh),idTokenExpiresAt:p(n?.exp),accessTokenExpiresAt:p(o?.exp),storedAt:t,isCurrent:a===r}}async function E(e={}){let{authPath:r,storeDir:a}=o(e),s=null,i=null;try{i=await u(r),s=d(i.tokens?.account_id)}catch{i=null}let c=new Map;try{for(let e of(await (0,t.readdir)(a))){if(!e.endsWith(".json"))continue;let r=n.default.join(a,e);try{let e=await u(r),a=await (0,t.stat)(r),n=_(e,a.mtime.toISOString(),s);c.set(n.accountId,n)}catch{}}}catch{}return i&&s&&!c.has(s)&&c.set(s,_(i,null,s)),[...c.values()].sort((e,t)=>e.isCurrent!==t.isCurrent?e.isCurrent?-1:1:e.label.localeCompare(t.label))}async function h(e={}){let{authPath:r,storeDir:a}=o(e),n=await u(r),s=n.tokens?.account_id,l=i(s,a);return await c(l,n),_(n,(await (0,t.stat)(l)).mtime.toISOString(),s)}async function w(e,r={}){let{authPath:a,storeDir:n}=o(r),s=i(e,n),l=await u(s);if(l.tokens?.account_id!==e)throw Error("Stored account id does not match requested account");let d=null;try{let e=await (0,t.readFile)(a,"utf8");d=`${a}.${new Date().toISOString().replace(/[:.]/g,"-")}.bak`,await (0,t.writeFile)(d,e,{encoding:"utf8",mode:384})}catch{d=null}return await c(a,l),{..._(l,null,e),backupPath:d}}async function T(e,r={}){let{authPath:a,storeDir:n}=o(r),s=await u(a).catch(()=>null);if(s?.tokens?.account_id===e)throw Error("Cannot delete the currently active Codex account");await (0,t.unlink)(i(e,n))}e.s(["deleteCodexAccount",0,T,"getCodexAccounts",0,E,"getCurrentCodexAccount",0,function(e={}){let{authPath:t}=o(e);try{let e=JSON.parse((0,r.readFileSync)(t,"utf8")),a=d(e.tokens?.account_id);if(!a)return null;return{accountId:a,authMtimeMs:(0,r.statSync)(t).mtimeMs}}catch{return null}},"importCurrentCodexAuth",0,h,"switchCodexAccount",0,w])},81149,e=>{"use strict";e.s(["getLatestUsageSnapshot",0,function(e,t,r){return(null!=r?e.prepare(`
|
|
41
|
-
SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
42
|
-
reset_at_5h, reset_at_weekly, raw_output, confidence
|
|
43
|
-
FROM usage_snapshots
|
|
44
|
-
WHERE source = ? AND account_id = ?
|
|
45
|
-
ORDER BY captured_at DESC
|
|
46
|
-
LIMIT 1
|
|
47
|
-
`).get(t,r):e.prepare(`
|
|
48
|
-
SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
49
|
-
reset_at_5h, reset_at_weekly, raw_output, confidence
|
|
50
|
-
FROM usage_snapshots
|
|
51
|
-
WHERE source = ?
|
|
52
|
-
ORDER BY captured_at DESC
|
|
53
|
-
LIMIT 1
|
|
54
|
-
`).get(t))??null},"insertUsageSnapshot",0,function(e,t){e.prepare(`
|
|
55
|
-
INSERT INTO usage_snapshots
|
|
56
|
-
(captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
57
|
-
reset_at_5h, reset_at_weekly, raw_output, confidence)
|
|
58
|
-
VALUES
|
|
59
|
-
(@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,
|
|
60
|
-
@reset_at_5h, @reset_at_weekly, @raw_output, @confidence)
|
|
61
|
-
`).run({captured_at:t.capturedAt,source:t.source,account_id:t.accountId,window_5h_used_pct:t.window5hUsedPct,window_weekly_used_pct:t.windowWeeklyUsedPct,reset_at_5h:t.resetAt5h,reset_at_weekly:t.resetAtWeekly,raw_output:t.rawOutput,confidence:t.confidence})}])},62043,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),u=e.i(16795),c=e.i(87718),l=e.i(95169),d=e.i(47587),p=e.i(66012),_=e.i(70101),E=e.i(26937),h=e.i(10372),w=e.i(93695);e.i(52474);var T=e.i(220),f=e.i(89171),R=e.i(43793),x=e.i(46023),g=e.i(81149);let N=new Set(["claude_usage_cmd","statusline","manual","codex"]);e.s(["GET",0,function(e){let t=new URL(e.url),r=t.searchParams.get("source"),a=r&&N.has(r)?r:null,n=t.searchParams.get("accountId"),s="codex"===a?n??(0,x.getCurrentCodexAccount)()?.accountId??null:null,o=(0,R.getDb)();if(a)return f.NextResponse.json({snapshot:(0,g.getLatestUsageSnapshot)(o,a,s)});let i=o.prepare("SELECT * FROM usage_snapshots ORDER BY captured_at DESC LIMIT 1").get();return f.NextResponse.json({snapshot:i??null})}],51548);var m=e.i(51548);let y=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/usage/route",pathname:"/api/usage",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/usage/route.ts",nextConfigOutput:"",userland:m,...{}}),{workAsyncStorage:C,workUnitAsyncStorage:A,serverHooks:v}=y;async function S(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),y.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/usage/route";f=f.replace(/\/index$/,"")||"/";let R=await y.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:x,deploymentId:g,params:N,nextConfig:m,parsedUrl:C,isDraftMode:A,prerenderManifest:v,routerServerContext:S,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,resolvedPathname:k,clientReferenceManifest:L,serverActionsManifest:b}=R,D=(0,i.normalizeAppPath)(f),U=!!(v.dynamicRoutes[D]||v.routes[k]),q=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,C,!1):t.end("This page could not be found"),null);if(U&&!A){let e=!!v.routes[k],t=v.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(m.adapterPath)return await q();throw new w.NoFallbackError}}let P=null;!U||y.isDev||A||(P="/index"===(P=k)?"/":P);let M=!0===y.isDev||!U,j=U&&!M;b&&L&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:L,serverActionsManifest:b});let X=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),H=!!(null==S?void 0:S.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await y.getIncrementalCache(e,m,v,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let K={params:N,previewProps:v.preview,renderOpts:{experimental:{authInterrupts:!!m.experimental.authInterrupts},cacheComponents:!!m.cacheComponents,supportsDynamicResponse:M,incrementalCache:G,cacheLifeProfiles:m.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>y.onRequestError(e,t,a,n,S)},sharedContext:{buildId:x,deploymentId:g}},Y=new u.NodeNextRequest(e),W=new u.NodeNextResponse(t),V=c.NextRequestAdapter.fromNodeNextRequest(Y,(0,c.signalFromNodeResponse)(t));try{let n,o=async e=>y.handle(V,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${X} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${X} ${f}`)}),i=async n=>{var s,i;let u=async({previousCacheEntry:r})=>{try{if(!B&&I&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let i=K.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let u=K.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(Y,W,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,_.toNodeOutgoingHttpHeaders)(s.headers);u&&(t[h.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:T.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await y.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:I})},!1,S),t}},c=await y.handleResponse({req:e,nextConfig:m,cacheKey:P,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:v,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:B});if(!U)return null;if((null==c||null==(s=c.value)?void 0:s.kind)!==T.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(i=c.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",I?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,_.fromNodeOutgoingHttpHeaders)(c.value.headers);return B&&U||l.delete(h.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,E.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(Y,W,new Response(c.value.body,{headers:l,status:c.value.status||200})),null};H&&$?await i($):(n=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(l.BaseServerSpan.handleRequest,{spanName:`${X} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":X,"http.target":e.url}},i),void 0,!H))}catch(t){if(t instanceof w.NoFallbackError||await y.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:I})},!1,S),U)throw t;return await (0,p.sendResponse)(Y,W,new Response(null,{status:500})),null}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:A})},"routeModule",0,y,"serverHooks",0,v,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,A],62043)}];
|
|
62
|
-
|
|
63
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0ub_1u.._.js.map
|