fleetlens 0.7.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/build-manifest.json +3 -3
  3. package/app/apps/web/.next/prerender-manifest.json +3 -3
  4. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/app/apps/web/.next/server/app/api/ask/route.js +1 -1
  14. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  15. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +3 -3
  16. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  17. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +3 -3
  18. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  19. package/app/apps/web/.next/server/app/api/digest/month-index/route.js +2 -2
  20. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +3 -3
  22. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  23. package/app/apps/web/.next/server/app/api/digest/week-index/route.js +2 -2
  24. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/api/events/route.js +1 -1
  26. package/app/apps/web/.next/server/app/api/events/route.js.nft.json +1 -1
  27. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  30. package/app/apps/web/.next/server/app/api/settings/route.js +4 -4
  31. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  32. package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  34. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  35. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  36. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  37. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  38. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  39. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  40. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  41. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  42. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  43. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  44. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  45. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  46. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  47. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  48. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  49. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  50. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  51. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  52. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  53. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  54. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  55. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  56. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  57. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  58. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  59. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  60. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  61. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  62. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  63. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  64. package/app/apps/web/.next/server/chunks/[root-of-the-server]__07qxzx4._.js +9 -0
  65. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0fu2xfy._.js +5 -0
  66. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0gfd42k._.js +9 -0
  67. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0i.m8y0._.js +3 -0
  68. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0iy5aqy._.js +9 -0
  69. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0nh7-nf._.js +3 -0
  70. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0nvdffv._.js +3 -0
  71. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0s2~c3g._.js +3 -0
  72. package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ck.78s.js +3 -3
  73. package/app/apps/web/.next/server/chunks/packages_09wmnv.._.js +3 -0
  74. package/app/apps/web/.next/server/chunks/packages_0o6.gpk._.js +3 -0
  75. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +13 -13
  76. package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_122oe0-.js +1 -1
  77. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0d~2~le._.js +1 -1
  78. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0r4tks8._.js +1 -1
  79. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0s4dg1y._.js +3 -0
  80. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0tejjy_._.js +1 -1
  81. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +3 -3
  82. package/app/apps/web/.next/server/chunks/ssr/_0jw2sm7._.js +1 -1
  83. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  84. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0ly1xes._.js +1 -1
  85. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0txtsv5._.js +1 -1
  86. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_usage-charts-dashboard_tsx_0bgr_uv._.js +1 -1
  87. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_0m67-xi._.js +1 -1
  88. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
  89. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_10_oegc._.js +1 -1
  90. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  91. package/app/apps/web/.next/server/pages/500.html +1 -1
  92. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  93. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  94. package/app/apps/web/.next/static/chunks/04a36uhu~p_z-.css +1 -0
  95. package/app/apps/web/.next/static/chunks/{0q2vd~aj.1hpz.js → 09--oejbzw3q-.js} +3 -3
  96. package/app/apps/web/.next/static/chunks/0l3ck.awv~4t7.js +1 -0
  97. package/app/apps/web/.next/static/chunks/{171za22fv684..js → 0lxuac2v0_gdl.js} +2 -2
  98. package/app/apps/web/.next/static/chunks/0n0n.0279ot6c.js +1 -0
  99. package/app/apps/web/.next/static/chunks/0qcu452dr~edz.js +14 -0
  100. package/app/apps/web/.next/static/chunks/0uev~g~qvbjv9.js +4 -0
  101. package/app/apps/web/components/previous-cycles-trend.tsx +26 -11
  102. package/app/apps/web/components/usage-chart.tsx +35 -37
  103. package/app/apps/web/components/usage-gauges.tsx +18 -12
  104. package/app/apps/web/components/usage-sidebar.tsx +23 -12
  105. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  106. package/app/apps/web/lib/utilization-tone.ts +74 -0
  107. package/app/apps/web/package.json +1 -1
  108. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  109. package/dist/daemon-worker.js +694 -67
  110. package/dist/index.js +1449 -823
  111. package/package.json +1 -1
  112. package/app/apps/web/.next/server/chunks/[externals]__0fpbr8-._.js +0 -3
  113. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0-vgrh1._.js +0 -3
  114. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0.z48ue._.js +0 -3
  115. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0_8zh-i._.js +0 -9
  116. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0dctov1._.js +0 -5
  117. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0e8n_x4._.js +0 -3
  118. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0ej_p3s._.js +0 -9
  119. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0jprdks._.js +0 -9
  120. package/app/apps/web/.next/server/chunks/packages_09hmrqx._.js +0 -3
  121. package/app/apps/web/.next/server/chunks/packages_118y1lp._.js +0 -3
  122. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ytdqxt._.js +0 -3
  123. package/app/apps/web/.next/static/chunks/05m.oz3kmf1p7.js +0 -1
  124. package/app/apps/web/.next/static/chunks/07-fq4im3pmjp.js +0 -4
  125. package/app/apps/web/.next/static/chunks/0o9ayt8sknubd.js +0 -1
  126. package/app/apps/web/.next/static/chunks/0wfbj5zr~az.z.css +0 -1
  127. package/app/apps/web/.next/static/chunks/179_t_igg8ghh.js +0 -14
  128. /package/app/apps/web/.next/static/{tiK9aMHXkgnKLNmxj9J1P → L0Dy1hOQrZjV9l0TNulvk}/_buildManifest.js +0 -0
  129. /package/app/apps/web/.next/static/{tiK9aMHXkgnKLNmxj9J1P → L0Dy1hOQrZjV9l0TNulvk}/_clientMiddlewareManifest.js +0 -0
  130. /package/app/apps/web/.next/static/{tiK9aMHXkgnKLNmxj9J1P → L0Dy1hOQrZjV9l0TNulvk}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40484,e=>{"use strict";var t=e.i(18050);let r={build:"var(--af-accent)",plan:"#9f7aea",debug:"#ed8936",review:"#4299e1",refactor:"#38b2ac",test:"#48bb78",release:"#ed64a6",research:"#a0aec0",steer:"#f6ad55",meta:"#718096",warmup_minimal:"#cbd5e0"};e.s(["GoalBar",0,function({goals:e,total:i,height:n=12}){return 0===i||0===e.length?(0,t.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",margin:0},children:"No goal data."}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",gap:2,height:n,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let n=e.minutes/i*100;return(0,t.jsx)("div",{style:{width:`${n}%`,background:r[e.category]??"#888"},title:`${e.category}: ${Math.round(e.minutes)}m (${n.toFixed(0)}%)`},e.category)})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,marginTop:8,flexWrap:"wrap",fontSize:11,color:"var(--af-text-tertiary)"},children:e.map(e=>(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:r[e.category]??"#888"}}),e.category," ",Math.round(e.minutes),"m"]},e.category))})]})}])},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],r=/\/conductor\/workspaces\/[^/]+\/([^/]+)(?:\/|$)/,i=/gh\s+pr\s+create\b/i,n=/#(\d+)/,a=/--title\s+["']([^"']+)["']/;e.s(["canonicalProjectName",0,function(e){let i=e.replace(/\/{2,}/g,"/"),n=function(e){for(let r of t){let t=e.lastIndexOf(r);if(t>=0)return{idx:t,marker:r}}return null}(i);if(n)return i.slice(0,n.idx);let a=function(e){let t=r.exec(e);if(!t)return null;let i=t[1],n=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-i.length-1-n,workspaceName:i}}(i);return a?i.slice(0,a.canonicalEndIdx):i},"detectPrMarkers",0,function(e){let t=[],r=e.durationMs??0;for(let s of e.events){if("tool-call"!==s.role||"Bash"!==s.toolName)continue;let o=s.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!o||"tool_use"!==o.type)continue;let l=o.input,c="string"==typeof l?.command?l.command:"";if(!i.test(c))continue;let d=c.match(a),u=c.match(n);t.push({sessionId:e.id,timestamp:s.timestamp??e.firstTimestamp??"",tOffsetMs:s.tOffsetMs,positionInSession:r>0&&void 0!==s.tOffsetMs?Math.min(1,Math.max(0,s.tOffsetMs/r)):void 0,command:c.slice(0,300),prNumber:u?Number(u[1]):void 0,title:d?.[1]})}return t}])}]);
@@ -1,6 +1,6 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52535,e=>{"use strict";var t=e.i(18050),s=e.i(71645);e.s(["LiveBadge",0,function({mtimeIso:e,size:i="sm"}){let[r,n]=(0,s.useState)(()=>Date.now());if((0,s.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e4);return()=>clearInterval(e)},[]),!e)return null;let a=Date.parse(e);if(Number.isNaN(a)||r-a>45e3)return null;let l="md"===i?8:6;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"md"===i?10:9,fontWeight:700,letterSpacing:"0.04em",padding:"md"===i?"3px 9px":"2px 7px",borderRadius:100,background:"rgba(239, 68, 68, 0.12)",color:"#ef4444",textTransform:"uppercase"},title:`Last updated ${new Date(a).toLocaleTimeString()}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:l,height:l,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"LIVE",(0,t.jsx)("style",{children:`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52535,e=>{"use strict";var t=e.i(18050),i=e.i(71645);e.s(["LiveBadge",0,function({mtimeIso:e,size:s="sm"}){let[n,r]=(0,i.useState)(()=>Date.now());if((0,i.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e4);return()=>clearInterval(e)},[]),!e)return null;let l=Date.parse(e);if(Number.isNaN(l)||n-l>45e3)return null;let a="md"===s?8:6;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"md"===s?10:9,fontWeight:700,letterSpacing:"0.04em",padding:"md"===s?"3px 9px":"2px 7px",borderRadius:100,background:"rgba(239, 68, 68, 0.12)",color:"#ef4444",textTransform:"uppercase"},title:`Last updated ${new Date(l).toLocaleTimeString()}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:a,height:a,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"LIVE",(0,t.jsx)("style",{children:`
2
2
  @keyframes cs-live-pulse {
3
3
  0%, 100% { opacity: 1; transform: scale(1); }
4
4
  50% { opacity: 0.4; transform: scale(0.85); }
5
5
  }
6
- `})]})}])},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],74886)},73375,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},25063,e=>{"use strict";let t=(0,e.i(75254).default)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,t],25063)},95116,e=>{"use strict";let t=(0,e.i(75254).default)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);e.s(["Wrench",0,t],95116)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],s=/gh\s+pr\s+create\b/i,i=/#(\d+)/,r=/--title\s+["']([^"']+)["']/;e.s(["canonicalProjectName",0,function(e){let s=e.replace(/\/{2,}/g,"/"),i=function(e){for(let s of t){let t=e.lastIndexOf(s);if(t>=0)return{idx:t,marker:s}}return null}(s);return i?s.slice(0,i.idx):s},"detectPrMarkers",0,function(e){let t=[],n=e.durationMs??0;for(let a of e.events){if("tool-call"!==a.role||"Bash"!==a.toolName)continue;let l=a.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!l||"tool_use"!==l.type)continue;let o=l.input,c="string"==typeof o?.command?o.command:"";if(!s.test(c))continue;let u=c.match(r),d=c.match(i);t.push({sessionId:e.id,timestamp:a.timestamp??e.firstTimestamp??"",tOffsetMs:a.tOffsetMs,positionInSession:n>0&&void 0!==a.tOffsetMs?Math.min(1,Math.max(0,a.tOffsetMs/n)):void 0,command:c.slice(0,300),prNumber:d?Number(d[1]):void 0,title:u?.[1]})}return t}])}]);
6
+ `})]})}])},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],74886)},73375,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},25063,e=>{"use strict";let t=(0,e.i(75254).default)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,t],25063)},95116,e=>{"use strict";let t=(0,e.i(75254).default)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);e.s(["Wrench",0,t],95116)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],i=/\/conductor\/workspaces\/[^/]+\/([^/]+)(?:\/|$)/,s=/gh\s+pr\s+create\b/i,n=/#(\d+)/,r=/--title\s+["']([^"']+)["']/;e.s(["canonicalProjectName",0,function(e){let s=e.replace(/\/{2,}/g,"/"),n=function(e){for(let i of t){let t=e.lastIndexOf(i);if(t>=0)return{idx:t,marker:i}}return null}(s);if(n)return s.slice(0,n.idx);let r=function(e){let t=i.exec(e);if(!t)return null;let s=t[1],n=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-s.length-1-n,workspaceName:s}}(s);return r?s.slice(0,r.canonicalEndIdx):s},"detectPrMarkers",0,function(e){let t=[],i=e.durationMs??0;for(let l of e.events){if("tool-call"!==l.role||"Bash"!==l.toolName)continue;let a=l.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!a||"tool_use"!==a.type)continue;let o=a.input,c="string"==typeof o?.command?o.command:"";if(!s.test(c))continue;let u=c.match(r),d=c.match(n);t.push({sessionId:e.id,timestamp:l.timestamp??e.firstTimestamp??"",tOffsetMs:l.tOffsetMs,positionInSession:i>0&&void 0!==l.tOffsetMs?Math.min(1,Math.max(0,l.tOffsetMs/i)):void 0,command:c.slice(0,300),prNumber:d?Number(d[1]):void 0,title:u?.[1]})}return t}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},36373,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(37727);let n=(0,e.i(75254).default)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);var i=e.i(88137);function s({snapshots:e,seriesKey:a,windowMs:d,colorVar:c,predictedSeries:x,onExpand:u}){let p=(0,r.useMemo)(()=>{let t=e.map(e=>({capturedAt:new Date(e.captured_at).getTime(),window:e[a]})).filter(e=>null!==e.window&&null!==e.window.utilization);if(0===t.length)return null;let r=t[t.length-1],n=r.window.resets_at?new Date(r.window.resets_at).getTime():null;if(!n)return null;let i=n-d,s=Date.now(),l=100-(r.window.utilization??0);return{points:t.filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-(e.window.utilization??0)]),predicted:(x??[]).filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-Math.max(0,Math.min(100,e.util))]).sort((e,t)=>e[0]-t[0]),windowStart:i,windowEnd:n,now:s,currentRemaining:l,latest:r}},[e,a,d,x]),f=1190,h=148,[y,g]=(0,r.useState)(null),[v,m]=(0,r.useState)(!1);if((0,r.useEffect)(()=>m(!0),[]),!p)return(0,t.jsx)("div",{className:"af-card",style:{padding:"14px 18px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data for this window yet."});let{points:b,predicted:j,windowStart:k,windowEnd:w,now:M,currentRemaining:S,latest:$}=p,D=e=>64+(e-k)/(w-k)*f,z=e=>20+h-e/100*h,A=e=>Math.max(0,Math.min(100,100-(e-k)/(w-k)*100)),W=S-A(M),F=(0,i.paceLabel)(W),L=(0,i.toneVar)(F.tone),C=F.label,T=b.length>0?b.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",N=j.length>1?j.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",R=b.length>0?`${T} L ${D(b[b.length-1][0]).toFixed(1)} ${z(0).toFixed(1)} L ${D(b[0][0]).toFixed(1)} ${z(0).toFixed(1)} Z`:"";return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsxs)("div",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:c,fontVariantNumeric:"tabular-nums"},children:[S.toFixed(1),"%",(0,t.jsx)("span",{style:{fontSize:11,fontWeight:500,color:"var(--af-text-tertiary)",marginLeft:4,letterSpacing:0},children:"remaining"})]}),(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:L,fontWeight:500},children:v&&(0,t.jsxs)(t.Fragment,{children:[C," (",W>=0?"+":"",W.toFixed(1),"pp)"]})}),(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",marginLeft:"auto"},children:[function(e){let t=e/36e5;if(t<24)return`${t} hour${1===t?"":"s"}`;let r=t/24;return`${r} day${1===r?"":"s"}`}(d)," · resets"," ",o(new Date(w).toISOString())]}),u&&(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Expand chart",title:"Expand",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-tertiary)",cursor:"pointer",marginLeft:4},children:(0,t.jsx)(n,{size:12})})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 200",style:{width:"100%",aspectRatio:"1280 / 200",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<64||r>1254)return void g(null);let a=k+(r-64)/f*(w-k),n=b[0],i=Math.abs(n[0]-a);for(let e of b){let t=Math.abs(e[0]-a);t<i&&(n=e,i=t)}let s=null;if(j.length>0){let e=j[0],t=Math.abs(e[0]-n[0]);for(let r of j){let a=Math.abs(r[0]-n[0]);a<t&&(e=r,t=a)}s=e[1]}g({x:D(n[0]),t:n[0],actual:n[1],ideal:A(n[0]),predicted:s})},onMouseLeave:()=>g(null),children:[[0,25,50,75,100].map(e=>{let r=z(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:64,x2:1254,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:56,y:r+4,textAnchor:"end",fontSize:"13",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:14,y:20+h/2,textAnchor:"middle",transform:`rotate(-90, 14, ${20+h/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("text",{x:64,y:180,textAnchor:"start",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(k)}),(0,t.jsx)("text",{x:1254,y:180,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(w)}),(0,t.jsx)("path",{d:R,fill:c,fillOpacity:"0.1"}),(0,t.jsx)("line",{x1:D(k),y1:z(100),x2:D(w),y2:z(0),stroke:"var(--af-text-tertiary)",strokeOpacity:"0.5",strokeWidth:"1.5",strokeDasharray:"4 3"}),v&&M>=k&&M<=w&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:D(M),y1:20,x2:D(M),y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),(0,t.jsx)("text",{x:D(M),y:14,textAnchor:"middle",fontSize:"12",fontWeight:"600",fill:"var(--af-text-secondary)",children:"now"})]}),(0,t.jsx)("path",{d:T,fill:"none",stroke:c,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.map(([e,r],a)=>(0,t.jsx)("circle",{cx:D(e),cy:z(r),r:"3",fill:c},a)),N&&(0,t.jsx)("path",{d:N,fill:"none",stroke:"#ff7a00",strokeOpacity:"0.9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"}),y&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:y.x,y1:20,x2:y.x,y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.7",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:y.x,cy:z(y.actual),r:"5",fill:c,stroke:"var(--af-surface)",strokeWidth:"1.5"})]})]}),y&&(0,t.jsxs)("div",{style:{pointerEvents:"none",position:"absolute",left:`${y.x/1280*100}%`,top:4,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(y.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:4,display:"flex",gap:12},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Actual"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:c},children:[y.actual.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Ideal"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[y.ideal.toFixed(1),"%"]})]}),null!==y.predicted&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Estimated"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:"#b58400"},children:[y.predicted.toFixed(1),"%"]})]})]}),(0,t.jsxs)("div",{style:{marginTop:2,color:"var(--af-text-tertiary)"},children:["Δ ",y.actual-y.ideal>=0?"+":"",(y.actual-y.ideal).toFixed(1),"%",null!==y.predicted&&(0,t.jsxs)("span",{style:{marginLeft:8},children:["· estimate ",y.predicted>=y.actual?"+":"",(y.predicted-y.actual).toFixed(1),"pp vs actual"]})]})]})]}),(0,t.jsxs)("div",{style:{marginTop:4,fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",textAlign:"right"},suppressHydrationWarning:!0,children:[b.length," snapshot",1===b.length?"":"s"," · last"," ",o(new Date($.capturedAt).toISOString()),j.length>0&&(0,t.jsxs)("span",{style:{marginLeft:8,color:"#ff7a00"},children:["· ",j.length," estimate",1===j.length?"":"s"," overlaid"]})]})]})}function l(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function o(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),a=Math.abs(r);if(a<60)t=`${a}s`;else if(a<3600)t=`${Math.floor(a/60)}m`;else if(a<86400){let e=Math.floor(a/3600),r=Math.floor(a%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(a/86400),r=Math.floor(a%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}function d({snapshots:e,seriesKey:a,startMs:n,endMs:i,windowMs:s,colorVar:l,predictedSeries:o}){var u,p;let f,h,y,g,v=(0,r.useMemo)(()=>{let t=[];for(let r of e){let e=new Date(r.captured_at).getTime(),n=r[a];n&&null!==n.utilization&&t.push({t:e,u:n.utilization,resetsAt:n.resets_at})}if(0===t.length)return null;let r=new Map;for(let e of t){if(!e.resetsAt)continue;let t=new Date(e.resetsAt).getTime();if(Number.isNaN(t))continue;let a=36e5*Math.round(t/36e5),n=r.get(a);n||(n=[],r.set(a,n)),n.push(e)}let l=[];for(let[e,t]of r){let r=e-s;t.sort((e,t)=>e.t-t.t);let a=t.map(e=>({t:e.t,u:e.u,remaining:100-e.u})),n=0;for(let e=1;e<a.length;e++)a[e].u>a[n].u&&(n=e);l.push({resetsAtMs:e,startMs:r,points:a,peak:a[n].u,peakT:a[n].t})}let o=l.filter(e=>e.resetsAtMs>=n&&e.startMs<=i).sort((e,t)=>e.resetsAtMs-t.resetsAtMs);if(0===o.length)return null;let d=o.flatMap(e=>e.points),c=Math.max(...d.map(e=>e.u)),x=o.filter(e=>e.resetsAtMs<=i&&e.resetsAtMs<Date.now()).length,u=o.length>0?o.reduce((e,t)=>e+t.peak,0)/o.length:0;return{cycles:o,allPoints:d,peakOverall:c,avgPeak:u,completeCycles:x}},[e,a,n,i,s]),[m,b]=(0,r.useState)(null);if(!v)return(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No usage data in the selected range."});let{cycles:j,allPoints:k,peakOverall:w,avgPeak:M,completeCycles:S}=v,$=1188,D=252,z=e=>60+(e-n)/(i-n)*$,A=e=>24+D-e/100*D,W=e=>n+(e-60)/$*(i-n),F=e=>{let t=z(e);return t<60?60:t>1248?1248:t};return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px",display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(u=n,p=i,h=new Date(u).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=new Date(p).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),f=(g=p-u)<36e5?`${Math.round(g/6e4)}m`:g<864e5?`${(g/36e5).toFixed(1).replace(/\.0$/,"")}h`:`${(g/864e5).toFixed(1).replace(/\.0$/,"")}d`,`${h} → ${y} (${f})`)}),(0,t.jsxs)("div",{style:{display:"flex",gap:28,fontSize:11,color:"var(--af-text-tertiary)",flexWrap:"wrap"},children:[(0,t.jsx)(c,{label:"Peak utilization",value:`${w.toFixed(1)}%`,color:l}),(0,t.jsx)(c,{label:"Avg peak / cycle",value:j.length>0?`${M.toFixed(1)}%`:"—",color:l}),(0,t.jsx)(c,{label:"Complete cycles",value:String(S),color:"var(--af-text)"}),(0,t.jsx)(c,{label:"Data points",value:String(k.length),color:"var(--af-text)"})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 320",style:{width:"100%",aspectRatio:"1280 / 320",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<60||r>1248)return void b(null);let a=W(r),n=k[0],i=Math.abs(n.t-a);for(let e of k){let t=Math.abs(e.t-a);t<i&&(n=e,i=t)}b({x:z(n.t),t:n.t,u:n.u,remaining:n.remaining})},onMouseLeave:()=>b(null),children:[[0,25,50,75,100].map(e=>{let r=A(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:60,x2:1248,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:50,y:r+4,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:16,y:24+D/2,textAnchor:"middle",transform:`rotate(-90, 16, ${24+D/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("rect",{x:60,y:A(10),width:$,height:A(0)-A(10),fill:"var(--af-danger)",fillOpacity:"0.07"}),(0,t.jsx)("rect",{x:60,y:A(30),width:$,height:A(10)-A(30),fill:"var(--af-warning)",fillOpacity:"0.05"}),j.map((e,r)=>{let a=F(e.startMs),o=F(e.resetsAtMs),d=A(100-100*(W(a)-e.startMs)/s),c=A(100-100*(W(o)-e.startMs)/s),x=e.points.filter(e=>e.t>=n&&e.t<=i),u=function(e,t,r){if(0===e.length)return"";let a=[],n=!1;for(let i=0;i<e.length;i++){let s=e[i],l=i>0?e[i-1]:null,o=!!l&&s.t-l.t>9e5,d=!n||o?"M":"L";a.push(`${d} ${t(s.t).toFixed(1)} ${r(s.remaining).toFixed(1)}`),n=!0}return a.join(" ")}(x,z,A),p=e.resetsAtMs>=n&&e.resetsAtMs<=i&&e.resetsAtMs<=Date.now();return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:a,y1:d,x2:o,y2:c,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.35",strokeWidth:"1",strokeDasharray:"3 3"}),u&&(0,t.jsx)("path",{d:u,fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),x.map((e,a)=>(0,t.jsx)("circle",{cx:z(e.t),cy:A(e.remaining),r:"1.8",fill:l,fillOpacity:"0.9"},`${r}-${a}`)),e.peakT>=n&&e.peakT<=i&&(0,t.jsx)("circle",{cx:z(e.peakT),cy:A(100-e.peak),r:"3",fill:l,stroke:"var(--background)",strokeWidth:"1.5"}),p&&(0,t.jsx)("line",{x1:z(e.resetsAtMs),y1:24,x2:z(e.resetsAtMs),y2:24+D,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.25",strokeWidth:"1",strokeDasharray:"1 3"})]},`cycle-${r}`)}),(()=>{let e=(o??[]).filter(e=>e.capturedAt>=n&&e.capturedAt<=i).sort((e,t)=>e.capturedAt-t.capturedAt);if(e.length<2)return null;let r=[],a=!1,s=e[0].util;for(let t=0;t<e.length;t++){let n=e[t],i=Math.max(0,Math.min(100,n.util)),l=100-i,o=s-i,d=t>0&&o>=50,c=t>0&&n.capturedAt-e[t-1].capturedAt>36e5,x=!a||d||c?"M":"L";r.push(`${x} ${z(n.capturedAt).toFixed(1)} ${A(l).toFixed(1)}`),a=!0,s=i}return(0,t.jsx)("path",{d:r.join(" "),fill:"none",stroke:"#ff7a00",strokeOpacity:"0.85",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"})})(),Date.now()>=n&&Date.now()<=i&&(0,t.jsx)("line",{x1:z(Date.now()),y1:24,x2:z(Date.now()),y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),m&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:m.x,y1:24,x2:m.x,y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.6",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:m.x,cy:A(m.remaining),r:"5",fill:l,stroke:"var(--background)",strokeWidth:"2"})]}),(0,t.jsx)("text",{x:60,y:300,textAnchor:"start",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(n,i-n)}),(0,t.jsx)("text",{x:1248,y:300,textAnchor:"end",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(i,i-n)}),(0,t.jsxs)("text",{x:60+$/2,y:314,textAnchor:"middle",fontSize:"11",fill:"var(--af-text-tertiary)",children:["Time · ",j.length," cycle",1===j.length?"":"s"," in view"]})]}),m&&(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{pointerEvents:"none",position:"absolute",left:`${m.x/1280*100}%`,top:6,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(m.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:2,display:"flex",gap:10},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Remaining"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:l},children:[m.remaining.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Used"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[m.u.toFixed(1),"%"]})]})]})]})]})]})}function c({label:e,value:r,color:a}){return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)("span",{style:{fontSize:9,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--af-text-tertiary)",fontWeight:600},children:e}),(0,t.jsx)("span",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:a,fontVariantNumeric:"tabular-nums"},children:r})]})}function x(e,t){let r=new Date(e);return t<=12096e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}var u=e.i(64659),p=e.i(63059),f=e.i(86619);function h({storageKey:e,label:r,children:a}){let[n,i,s]=(0,f.usePersistentBoolean)(e,!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!n),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",marginBottom:12*!!n,background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,fontWeight:600,color:"var(--af-text-secondary)",textTransform:"uppercase",letterSpacing:"0.04em",cursor:"pointer",transition:"background 0.12s, border-color 0.12s"},children:[n?(0,t.jsx)(u.ChevronDown,{size:12}):(0,t.jsx)(p.ChevronRight,{size:12}),n?`Hide ${r}`:`Show ${r}`]}),s&&n&&a]})}let y=[{key:"current",label:"Current cycle"},{key:"24h",label:"24H"},{key:"7d",label:"7D"},{key:"30d",label:"30D"},{key:"90d",label:"90D"},{key:"custom",label:"Custom"}];function g({value:e,onChange:a,windowType:n="short"}){let i="long"===n?y.filter(e=>"24h"!==e.key):y,[s,l]=(0,r.useState)(()=>m(e.startMs??Date.now()-6048e5)),[o,d]=(0,r.useState)(()=>m(e.endMs??Date.now()));return(0,r.useEffect)(()=>{if("custom"!==e.preset)return;let t=b(s),r=b(o);Number.isNaN(t)||Number.isNaN(r)||t>=r||(t!==e.startMs||r!==e.endMs)&&a({preset:"custom",startMs:t,endMs:r})},[s,o,e.preset]),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{display:"inline-flex",borderRadius:6,border:"1px solid var(--af-border-subtle)",overflow:"hidden"},children:i.map((r,n)=>(0,t.jsx)("button",{type:"button",onClick:()=>{var e;"custom"===(e=r.key)?a({preset:e,startMs:b(s),endMs:b(o)}):a({preset:e})},style:{padding:"6px 12px",fontSize:11,fontWeight:500,background:e.preset===r.key?"var(--af-accent-subtle)":"transparent",color:e.preset===r.key?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:n<i.length-1?"1px solid var(--af-border-subtle)":"none",cursor:"pointer",letterSpacing:"0.02em"},children:r.label},r.key))}),"custom"===e.preset&&(0,t.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,t.jsx)("input",{type:"datetime-local",value:s,onChange:e=>l(e.target.value),style:v}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)("input",{type:"datetime-local",value:o,onChange:e=>d(e.target.value),style:v})]})]})}let v={padding:"5px 8px",fontSize:11,background:"var(--background)",color:"var(--af-text)",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontFamily:"var(--font-mono)"};function m(e){let t=new Date(e),r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0");return`${r}-${a}-${n}T${i}:${s}`}function b(e){return new Date(e).getTime()}let j=[{key:"seven_day",label:"7d utilization",windowMs:6048e5,colorVar:"var(--af-accent)"},{key:"five_hour",label:"5h utilization",windowMs:18e6,colorVar:"var(--af-success)"}],k={key:"seven_day_sonnet",label:"7d utilization (Sonnet)",windowMs:6048e5,colorVar:"var(--af-warning)"};function w({config:e,snapshots:n,predictedSeries:i,onClose:s}){let[l,o]=(0,r.useState)({preset:"current"}),c=(0,r.useMemo)(()=>{for(let t=n.length-1;t>=0;t--){let r=n[t][e.key];if(r&&r.resets_at){let t=new Date(r.resets_at).getTime();return{startMs:t-e.windowMs,endMs:t}}}return null},[n,e.key,e.windowMs]),x=function(e){let t=Date.now();switch(e.preset){case"current":return{};case"24h":return{startMs:t-864e5,endMs:t};case"7d":return{startMs:t-6048e5,endMs:t};case"30d":return{startMs:t-2592e6,endMs:t};case"90d":return{startMs:t-7776e6,endMs:t};case"custom":return{startMs:e.startMs,endMs:e.endMs}}}(l),u="current"===l.preset&&c?c:x;return(0,t.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:32},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:1600,maxHeight:"calc(100vh - 64px)",background:"var(--background)",border:"1px solid var(--af-border-subtle)",borderRadius:12,boxShadow:"0 24px 64px rgba(0, 0, 0, 0.4)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"14px 20px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{fontSize:14,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--af-text)"},children:e.label}),(0,t.jsx)(g,{value:l,onChange:o,windowType:e.windowMs>=864e5?"long":"short"}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(a.X,{size:14})})]}),(0,t.jsx)("div",{style:{padding:20,overflow:"auto",flex:1},children:u.startMs&&u.endMs?(0,t.jsx)(d,{snapshots:n,seriesKey:e.key,startMs:u.startMs,endMs:u.endMs,windowMs:e.windowMs,colorVar:e.colorVar,predictedSeries:i}):(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data available for this window."})})]})})}function M({children:e}){return(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:e})}e.s(["UsageChartsDashboard",0,function({snapshots:e,predicted:a}){let[n,i]=(0,r.useState)(null),l=a??{five_hour:[],seven_day:[],seven_day_sonnet:[]};return(0,r.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"===e.key&&i(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),(0,r.useEffect)(()=>{if(!n)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[n]),(0,t.jsxs)(t.Fragment,{children:[j.map(r=>(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:r.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:r.key,windowMs:r.windowMs,colorVar:r.colorVar,predictedSeries:l[r.key],onExpand:()=>i(r)})]},r.key)),(0,t.jsx)(h,{storageKey:"cclens:usage:show-sonnet",label:"Sonnet 7d utilization",children:(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:k.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:k.key,windowMs:k.windowMs,colorVar:k.colorVar,predictedSeries:l[k.key],onExpand:()=>i(k)})]})}),n&&(0,t.jsx)(w,{config:n,snapshots:e,predictedSeries:l[n.key],onClose:()=>i(null)})]})}],36373)}]);
@@ -0,0 +1,14 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return v},NormalizeError:function(){return x},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return l},isResSent:function(){return p},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return k}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function p(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&p(r))return n;if(!n)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class x extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},69198,e=>{"use strict";var t=e.i(18050);e.i(74472);var r=e.i(33815);e.s(["AgentBadge",0,function({agent:e}){if(!e||"claude-code"===e)return null;let n=(0,r.getAgentMetadata)(e);return n?(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",borderRadius:4,padding:"2px 6px",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap",fontWeight:600,color:n.accentColor,background:`color-mix(in srgb, ${n.accentColor} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${n.accentColor} 30%, transparent)`},title:`Source: ${n.displayName}`,children:n.shortLabel}):null}])},43531,e=>{"use strict";let t=(0,e.i(75254).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],43531)},88137,e=>{"use strict";function t(e){return e<-15?{tone:"danger",label:"may exhaust early"}:e>15?{tone:"warning",label:"below pace"}:{tone:"success",label:"on pace"}}e.s(["paceLabel",0,t,"paceToneForCycle",0,function(e,r,n,a=Date.now()){return t(100*Math.max(0,Math.min(1,(a-(r-n))/n))-e).tone},"toneVar",0,function(e){switch(e){case"success":return"var(--af-success)";case"warning":return"#b58400";case"danger":return"var(--af-danger)"}}])},3116,e=>{"use strict";let t=(0,e.i(75254).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",0,t],3116)},41240,63639,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,r],41240);let n=(0,t.default)("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);e.s(["Radio",0,n],63639)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],31278)},54611,e=>{"use strict";let t=/^##\s+\[([^\]]+)\](?:\s+[—\-–]\s+(\S+))?\s*$/,r=/^###\s+(.+?)\s*$/,n=/^[-*]\s+(.+?)\s*$/,a=function(e){let a=e.split(/\r?\n/),i=[],o=null,s=null,l=[];function c(){s&&l.length>0&&(s.bullets.push(l.join(" ").trim()),l=[])}for(let e of a){let a=t.exec(e);if(a){c(),s=null,o={version:a[1].trim(),date:a[2]?.trim()??null,sections:[]},i.push(o);continue}if(!o)continue;let d=r.exec(e);if(d){c(),s={kind:d[1].trim(),bullets:[]},o.sections.push(s);continue}let u=n.exec(e);if(u){c(),l=[u[1]];continue}l.length>0&&e.trim().length>0&&l.push(e.trim())}return c(),i}('# Changelog\n\nAll notable user-facing changes to the Fleetlens CLI (`fleetlens` on npm) are\nrecorded here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).\nThe team-server has its own log at `packages/team-server/CHANGELOG.md`.\n\n## [0.10.0] — 2026-05-08\n\n### Changed\n- **Plan utilization reframed.** High utilization is now "getting plan value" (green); low utilization is "paying for unused headroom" (red). Mirrors how an operator actually looks at the dashboard: the wasteful outcome is paying for a plan and barely touching it, not running near the cap. Applied across `/usage` burndown, gauges, sidebar, and previous-cycles strip.\n- **In-progress cycles colored by pace, not peak.** A 50% peak halfway through a 7-day cycle reads on-pace green, not amber — the chart no longer cries wolf on a fresh cycle that just hasn\'t burnt yet. Completed cycles still use peak tone.\n- **Pace label ±15pp band.** "On pace" now covers a ±15pp window around ideal; outside that, label is "below pace" (under-burning) or "may exhaust early" (over-burning). The previous +5/-50 thresholds flipped amber every time the user took a night off.\n- **Pace label collapses to three states.** "May exhaust early" / "below pace" / "on pace" — same color tones, one fewer qualifier to read.\n- **Wording softened across the utilization views** to describe the pattern rather than judge the user. "Behind schedule" → "below pace"; "on track (+x%)" → "on pace (+xpp vs ideal)".\n\n### Added\n- **Conductor multi-agent workspace support.** Sessions inside Conductor\'s worktree-style agent workspaces (`~/conductor/workspaces/<repo>/<agent>/...`) now group correctly under their parent project, with each agent shown as a separate worktree. Mirrors the existing `.worktrees/` handling.\n\n### Fixed\n- Hydration mismatch on `/usage` when pace labels rendered before client mount.\n\n### Notes for operators\n- The CLI\'s team push now ships **only Claude Code usage snapshots** to the team server. Codex snapshots stay local until `plan_utilization` gets a per-agent partition — without one, the team-server\'s "latest snapshot" pick flips between agents and miscolors the in-progress cycle. Existing rows in `plan_utilization` stay; new pushes are claude-code only.\n\n## [0.9.0] — 2026-05-07\n\n### Added\n- **Gemini CLI** as the third agent source. Sessions written to `~/.gemini/tmp/<slug>/chats/session-*.jsonl` are now read, parsed, and rendered alongside Claude Code and Codex. Tool calls (`read_file`, `list_directory`, `glob`, `run_shell_command`, `update_topic`, …) and their results show in the session timeline; thinking blocks, multi-write status replay, `$set` / `$rewindTo` semantics, and the legacy single-JSON file shape all handled. Slug → cwd inversion via `~/.gemini/projects.json`. `✺` glyph + purple accent in the UI.\n\n### Changed\n- Session detail timeline drops in-turn idle hatching. Within a turn, every wait — model loading, tool execution, network — is the agent\'s active time. Only between-turn idle (user reading + composing the next message) renders as hatched.\n- Gemini parser anchors `firstTimestamp`, `lastTimestamp`, and `activeSegments` on conversational events only. Login/OAuth `info` records and `metadata.startTime` (file-creation moment) no longer stretch the session bar back to before the first user message.\n\n## [0.7.1] — 2026-05-07\n\n### Fixed\n- Cycle-peaks trend no longer renders two bars labeled the same day. When Anthropic\'s rolling 7-day window slid its anchor between consecutive polls, the daemon\'s bucketer (hour-rounded) recorded both reset boundaries as distinct cycles. They\'re now merged within a 12 h tolerance — same fix in `apps/web/lib/cycle-peaks.ts` (used by `/usage`) and in `packages/cli/src/team/sync.ts` (the daemon\'s team-server push), so both the personal `/usage` chart and the team-server\'s plan-utilization view stay consistent. 5-hour cycles keep no merge tolerance (their anchor is stable; merging would collapse legitimate distinct cycles).\n\n## [0.6.4] — 2026-05-04\n\n### Fixed\n- Cached calibration events per-file so `/usage` warm renders complete in well under a second on large session histories.\n\n## [0.6.3] — 2026-05-04\n\n### Fixed\n- Dropped poisoned auto-week locks left behind by interrupted runs; backfill now gates on the live pipeline lock instead.\n\n## [0.6.2] — 2026-05-04\n\n### Added\n- Last week\'s digest auto-generates on launch when AI features are on. Disable in Settings → AI features.\n\n## [0.6.1] — 2026-05-04\n\n### Changed\n- Smaller install size — published bundle no longer drags in unused workspace metadata.\n\n## [0.6.0] — 2026-04-30\n\n### Added\n- V2 perception layer. Daily, weekly, and monthly digests synthesized from per-session entries via a strict hierarchical pipeline (entry → day → week → month). Past-period digests are immutable on disk; current-period digests use a 10-min in-memory TTL.\n- `/insights` route with on-demand week and month digest generation, picker history, and force-regen.\n- `fleetlens digest day | week | month [--json]` — CLI surface that reproduces the same digests served at `/insights`.\n- `fleetlens entries [--day | --session | --all] [--json]` — inspect the per-session entry primitive.\n\n### Changed\n- Renamed "active time" to "agent time" across the dashboard and CLI for clarity.\n\n## [0.4.1] — 2026-04-23\n\n### Added\n- Concurrency view on `/parallelism` page. Bursts colored teal for same-project and purple for cross-project (the genuinely interesting fleet-work signal).\n- Plan utilization sparkline on the sidebar, fed by the usage daemon\'s 5-min snapshots.\n\n### Fixed\n- Auto-update no longer leaves a zombie web server on the old binary; both server and daemon are torn down before re-exec.\n\n## [0.4.0] — 2026-04-18\n\n### Added\n- Usage daemon (`fleetlens daemon …`) polls `/api/oauth/usage` every 5 min and appends snapshots to `~/.cclens/usage.jsonl`. `fleetlens start` and `fleetlens stop` manage server + daemon together.\n- `fleetlens usage --history` for inspecting past plan utilization.\n\n## [0.3.0] — 2026-04-10\n\n### Added\n- Project rollups with worktree aggregation. Sessions inside `<project>/.worktrees/<name>` roll up under their parent canonical project with a `+N wt` badge.\n- Pinned projects in the sidebar (per-browser via localStorage).\n\n## [0.2.0] — 2026-04-01\n\n### Changed\n- Active-segment computation now uses all timestamped events (system + summary + sidechain + conversational) instead of conversational-only. Earlier filter undercounted by up to 100x on tool-heavy sessions.\n\n## [0.1.0] — 2026-03-15\n\n### Added\n- Initial release. Local-only dashboard for Claude Code sessions: timeline, projects, daily activity bucketing, parallelism detection, per-model cost estimation. Reads JSONL transcripts from `~/.claude/projects/`.\n');a[0]?.version,e.s(["STORAGE_KEY",0,"cclens:changelog-last-seen"],54611)},86619,e=>{"use strict";var t=e.i(71645);e.s(["usePersistentBoolean",0,function(e,r){let[n,a]=(0,t.useState)(r),[i,o]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{try{let t=window.localStorage.getItem(e);"1"===t?a(!0):"0"===t&&a(!1)}catch{}o(!0)},[e]),(0,t.useEffect)(()=>{let t=t=>{let r=t.detail;r?.key===e&&"boolean"==typeof r.value&&a(r.value)},r=t=>{t.key===e&&("1"===t.newValue?a(!0):"0"===t.newValue&&a(!1))};return window.addEventListener("cclens:persistent-boolean",t),window.addEventListener("storage",r),()=>{window.removeEventListener("cclens:persistent-boolean",t),window.removeEventListener("storage",r)}},[e]),[n,(0,t.useCallback)(t=>{a(t);try{window.localStorage.setItem(e,t?"1":"0")}catch{}window.dispatchEvent(new CustomEvent("cclens:persistent-boolean",{detail:{key:e,value:t}}))},[e]),i]}])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let d=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),d&&"?"!==d[0]&&(d="?"+d),a=a.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${c}${a}${d}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),a=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809),o=e.r(18050),s=i._(e.r(71645)),l=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),p=e.r(5550);e.r(33525);let f=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var r,n;let a,i,y,[b,v]=(0,s.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,s.useRef)(null),{href:k,as:j,children:S,prefetch:C=null,passHref:M,replace:$,shallow:T,scroll:z,onClick:P,onMouseEnter:R,onTouchStart:I,legacyBehavior:E=!1,onNavigate:A,transitionTypes:L,ref:O,unstable_dynamicOnHover:N,...D}=t;a=S,E&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let _=s.default.useContext(c.AppRouterContext),W=!1!==C,F=!1!==C?null===(n=C)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(r=j||k)?r:(0,l.formatUrl)(r);if(E){if(a?.$$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});i=s.default.Children.only(a)}let U=E?i&&"object"==typeof i&&i.ref:O,H=s.default.useCallback(e=>(null!==_&&(w.current=(0,h.mountLinkInstance)(e,B,_,F,W,v)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[W,B,_,F,v]),G={ref:(0,d.useMergedRef)(H,U),onClick(t){E||"function"!=typeof P||P(t),E&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!_||t.defaultPrevented||function(t,r,n,a,i,o,l){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);s.default.startTransition(()=>{u(r,a?"replace":"push",!1===i?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,l)})}}(t,B,w,$,z,A,L)},onMouseEnter(e){E||"function"!=typeof R||R(e),E&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),_&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){E||"function"!=typeof I||I(e),E&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),_&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,u.isAbsoluteUrl)(B)?G.href=B:E&&!M&&("a"!==i.type||"href"in i.props)||(G.href=(0,p.addBasePath)(B)),y=E?s.default.cloneElement(i,G):(0,o.jsx)("a",{...D,...G,children:a}),(0,o.jsx)(x.Provider,{value:b,children:y})}e.r(84508);let x=(0,s.createContext)(h.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...n,width:a,height:a,stroke:e,strokeWidth:o?24*Number(i)/Number(a):i,className:r("lucide",s),...d},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,n)=>{let i=(0,t.forwardRef)(({className:i,...o},s)=>(0,t.createElement)(a,{ref:s,iconNode:n,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,i),...o}));return i.displayName=`${e}`,i}],75254)},74472,33815,e=>{"use strict";let t=[{kind:"claude-code",displayName:"Claude Code",shortLabel:"Claude",accentColor:"var(--af-accent)",iconChar:"✦"},{kind:"codex",displayName:"Codex (OpenAI)",shortLabel:"Codex",accentColor:"rgb(16, 163, 127)",iconChar:"◆"},{kind:"gemini",displayName:"Gemini CLI",shortLabel:"Gemini",accentColor:"rgb(124, 92, 246)",iconChar:"✺"}],r=new Set(t.map(e=>e.kind));e.s(["getAgentMetadata",0,function(e){return t.find(t=>t.kind===e)},"isAgentKind",0,function(e){return"string"==typeof e&&r.has(e)}],33815),e.s([],74472)},23614,41783,e=>{"use strict";var t=e.i(18050),r=e.i(22016);e.i(74472);var n=e.i(33815);function a({agent:e,size:r=11,title:i}){if(!e)return null;let o=(0,n.getAgentMetadata)(e);return o?(0,t.jsx)("span",{"aria-hidden":!0,title:i??o.displayName,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:r+2,height:r+2,fontSize:r,lineHeight:1,color:o.accentColor},children:o.iconChar}):null}e.s(["AgentIcon",0,a],41783);let i={shipped:{bg:"rgba(72, 187, 120, 0.12)",fg:"#48bb78",label:"Shipped",icon:"🚀"},partial:{bg:"rgba(66, 153, 225, 0.12)",fg:"#4299e1",label:"Partial",icon:"🔨"},blocked:{bg:"rgba(245, 101, 101, 0.12)",fg:"#f56565",label:"Blocked",icon:"🚧"},exploratory:{bg:"rgba(160, 174, 192, 0.12)",fg:"#a0aec0",label:"Exploratory",icon:"🧭"},trivial:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Warmup",icon:"💤"},idle:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Idle",icon:"—"}},o={sm:{fontSize:9,padding:"1px 6px",iconGap:3,borderRadius:99},md:{fontSize:10,padding:"2px 8px",iconGap:4,borderRadius:99},lg:{fontSize:11,padding:"3px 10px",iconGap:5,borderRadius:99}},s={shipped:6,partial:5,blocked:4,exploratory:3,trivial:2,idle:1};e.s(["OUTCOME_STYLES",0,i,"OutcomePill",0,function(e){let n=o[e.size??"md"],s=n.fontSize+1;if("pending"in e&&e.pending){let i={display:"inline-flex",alignItems:"center",gap:n.iconGap,padding:n.padding,borderRadius:n.borderRadius,fontSize:n.fontSize,fontWeight:600,background:"rgba(160, 174, 192, 0.08)",color:"var(--af-text-tertiary)",border:"1px dashed var(--af-border-subtle)",textDecoration:"none",whiteSpace:"nowrap"};return(0,t.jsxs)(r.default,{href:`/digest/${e.localDay}`,style:i,title:`Generate ${e.localDay} digest →`,children:[e.agent&&(0,t.jsx)(a,{agent:e.agent,size:s}),(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:"⋯"}),(0,t.jsx)("span",{children:"pending"})]})}let l=i[e.outcome],c=e.label??"both",d={display:"inline-flex",alignItems:"center",gap:n.iconGap,padding:n.padding,borderRadius:n.borderRadius,fontSize:n.fontSize,fontWeight:600,background:l.bg,color:l.fg,whiteSpace:"nowrap"};return(0,t.jsxs)("span",{style:d,title:l.label,children:[e.agent&&(0,t.jsx)(a,{agent:e.agent,size:s}),("icon"===c||"both"===c)&&(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:l.icon}),("text"===c||"both"===c)&&(0,t.jsx)("span",{children:l.label})]})},"outcomePriority",0,function(e){return e?s[e]:0}],23614)},18566,(e,t,r)=>{t.exports=e.r(76562)},56324,e=>{"use strict";let t={input:1,output:5,cacheRead:.1,cacheWrite:1.25},r={input:3,output:15,cacheRead:.3,cacheWrite:3.75},n={input:5,output:25,cacheRead:.5,cacheWrite:6.25};e.s(["estimateCost",0,function(e,a){let i=function(e){if(!e)return n;let a=e.toLowerCase();return a.includes("haiku")?t:a.includes("sonnet")?r:n}(a);return e.input/1e6*i.input+e.output/1e6*i.output+e.cacheRead/1e6*i.cacheRead+e.cacheWrite/1e6*i.cacheWrite},"formatCost",0,function(e){return e<.01?"<$0.01":e<1||e<100?`$${e.toFixed(2)}`:e<1e3?`$${e.toFixed(1)}`:`$${e.toLocaleString(void 0,{maximumFractionDigits:0})}`},"formatDuration",0,function(e){if(void 0===e)return"—";if(e<1e3)return`${e}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let r=Math.floor(t/60),n=t%60;if(r<60)return n?`${r}m ${n}s`:`${r}m`;let a=Math.floor(r/60),i=r%60;return i?`${a}h ${i}m`:`${a}h`},"formatGap",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let r=Math.floor(t/60);if(r<60){let e=Math.round(t%60);return`${r}m ${e}s`}let n=Math.floor(r/60),a=r%60;if(n<24)return a?`${n}h ${a}m`:`${n}h`;let i=Math.floor(n/24),o=n%24;return o?`${i}d ${o}h`:`${i}d`},"formatOffset",0,function(e){if(void 0===e||e<0)return"—";let t=Math.floor(e/1e3),r=Math.floor(t/3600),n=String(Math.floor(t%3600/60)).padStart(2,"0"),a=String(t%60).padStart(2,"0");return`${r}:${n}:${a}`},"formatRelative",0,function(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let r=Math.round((Date.now()-t)/1e3);if(r<60)return`${r}s ago`;let n=Math.round(r/60);if(n<60)return`${n}m ago`;let a=Math.round(n/60);if(a<24)return`${a}h ago`;let i=Math.round(a/24);return`${i}d ago`},"formatTokens",0,function(e){return e<1e3?String(e):e<1e4?(e/1e3).toFixed(1)+"k":e<1e6?Math.round(e/1e3)+"k":e<1e7?(e/1e6).toFixed(2)+"M":(e/1e6).toFixed(1)+"M"},"prettyProjectName",0,function(e,t=35){let r=e.split("/").filter(Boolean),n=r.lastIndexOf(".worktrees");if(n>0&&n<r.length-1){let e=r[n-1],a=r[n+1],i=`${e}/${a}`;return i.length<=t?i:"…"+i.slice(i.length-t+1)}let a=r.length>=2?`${r[r.length-2]}/${r[r.length-1]}`:r[r.length-1]??e;return a.length<=t?a:"…"+a.slice(a.length-t+1)},"shortId",0,function(e){return e.length<=10?e:e.slice(0,6)+"…"+e.slice(-4)}])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",0,t],55436)},56004,e=>{"use strict";var t=e.i(18050),r=e.i(22016);let n={display:"inline-flex",alignItems:"center",borderRadius:4,padding:"2px 6px",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap"};e.s(["TeamBadge",0,function({session:e,linkable:a=!0}){if(!e.teamName)return null;let i=!0===e.isTeamLead,o=void 0!==e.agentName;return i||o?i&&a?(0,t.jsx)(r.default,{href:`/sessions/${e.id}`,style:{...n,fontWeight:600,background:"var(--af-warning-subtle)",color:"var(--af-warning)",border:"1px solid var(--af-warning-subtle)",textDecoration:"none"},title:`Team lead — ${e.teamName}`,children:"Team Lead"}):i?(0,t.jsx)("span",{style:{...n,fontWeight:600,background:"var(--af-warning-subtle)",color:"var(--af-warning)",border:"1px solid var(--af-warning-subtle)"},title:`Team lead — ${e.teamName}`,children:"Team Lead"}):(0,t.jsx)("span",{style:{...n,fontWeight:500,background:"var(--af-surface-hover)",color:"var(--af-text-tertiary)",border:"1px solid var(--af-border-subtle)"},title:`Team member — ${e.teamName} \xb7 ${e.agentName}`,children:"Team Member"}):null}])},86566,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(18566),a=e.i(71645),i=e.i(75254);let o=(0,i.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),s=(0,i.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),l=(0,i.default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),c=(0,i.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),d=(0,i.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var u=e.i(55436);let p=(0,i.default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),f=(0,i.default)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var h=e.i(41240),g=e.i(63639);let m=(0,i.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),y=(0,i.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var x=e.i(56324);let b=(0,i.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),v=(0,i.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),w="claude-lens:theme";function k(e){if("u">typeof document){document.documentElement.setAttribute("data-theme",e);try{document.cookie=`claude-lens-theme=${e};path=/;max-age=31536000;samesite=lax`}catch{}}}function j(){let[e,r]=(0,a.useState)("dark"),[n,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=document.documentElement.getAttribute("data-theme");if("light"===e||"dark"===e)r(e);else{let e=function(){try{let e=window.localStorage.getItem(w);if("light"===e||"dark"===e)return e}catch{}return null}()??(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark");r(e),k(e)}i(!0)},[]),(0,t.jsx)("button",{type:"button",onClick:()=>{let t="dark"===e?"light":"dark";r(t),k(t);try{window.localStorage.setItem(w,t)}catch{}},"aria-label":"dark"===e?"Switch to light mode":"Switch to dark mode",title:"dark"===e?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)",e.currentTarget.style.color="var(--af-text)"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--af-text-secondary)"},children:n?"dark"===e?(0,t.jsx)(v,{size:14}):(0,t.jsx)(b,{size:14}):null})}var S=e.i(86619),C=e.i(88137);function M({snapshot:e}){let n,a,[i,,o]=(0,S.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!e)return(0,t.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,t.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,t.jsxs)("div",{children:["Run ",(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let s=[{label:"5h",window:e.five_hour,windowMs:18e6},{label:"7d",window:e.seven_day,windowMs:6048e5}];return o&&i&&s.push({label:"Sonnet 7d",window:e.seven_day_sonnet,windowMs:6048e5}),(0,t.jsxs)(r.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,t.jsx)("span",{children:"Current usage"}),(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(n=new Date(e.captured_at).getTime(),(a=Math.round((Date.now()-n)/1e3))<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`)})]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:s.map(e=>(0,t.jsx)($,{...e},e.label))})]})}function $({label:e,window:r,windowMs:n}){let a=r?.utilization??null,i=null!==a,o=i?Math.max(0,Math.min(100,a)):0,s=r?.resets_at?new Date(r.resets_at).getTime():null,l=i&&s?(0,C.toneVar)((0,C.paceToneForCycle)(o,s,n)):"var(--af-border-subtle)";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,t.jsx)("span",{children:e}),r?.resets_at&&(0,t.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),n=Math.abs(r);if(n<60)t=`${n}s`;else if(n<3600)t=`${Math.floor(n/60)}m`;else if(n<86400){let e=Math.floor(n/3600),r=Math.floor(n%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(n/86400),r=Math.floor(n%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}(r.resets_at)]}),(0,t.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:i?`${o.toFixed(0)}%`:"—"})]}),(0,t.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,t.jsx)("div",{style:{height:"100%",width:i?`${o}%`:"0%",background:l,borderRadius:999,transition:"width 0.24s ease"}})})]})}let T=(0,i.default)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);var z=e.i(54611);function P({latestVersion:e,active:n}){let[i,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!e)return void o(!1);try{let t=window.localStorage.getItem(z.STORAGE_KEY);o(t!==e)}catch{o(!1)}},[e]),(0,t.jsxs)(r.default,{href:"/changelog","aria-label":i?"Changelog (new entries)":"Changelog",title:i?`What's new in v${e}`:"Changelog",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:n?"var(--af-text)":"var(--af-text-tertiary)",background:n?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,t.jsx)(T,{size:14}),i&&(0,t.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:3,right:3,width:7,height:7,borderRadius:"50%",background:"#ef4444",border:"1.5px solid var(--af-surface)"}})]})}let R="claude-lens:pinned-projects:v1";function I({href:e,active:n,icon:a,trailing:i,children:o}){return(0,t.jsxs)(r.default,{href:e,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:n?"var(--af-accent)":"var(--af-text-secondary)",background:n?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[a,(0,t.jsx)("span",{style:{flex:1},children:o}),i&&(0,t.jsx)("span",{style:{fontSize:10,color:n?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})}function E({label:e,items:n,pathname:a,isPinned:i,onTogglePin:o}){return 0===n.length?null:(0,t.jsxs)("div",{style:{marginTop:10},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:e}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:n.map(e=>{let n=`/projects/${encodeURIComponent(e.projectDir)}`,s=a===n,l=(0,x.prettyProjectName)(e.projectName);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:s?"var(--af-accent-subtle)":"transparent",color:s?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,t.jsxs)(r.default,{href:n,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(e.worktreeCount??0)>0?`${e.projectName} — ${e.worktreeCount} worktree${1===e.worktreeCount?"":"s"}`:e.projectName,children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:l}),(e.worktreeCount??0)>0&&(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",e.worktreeCount," wt"]})]}),(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:e.sessionCount}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),o(e.projectDir)},"aria-label":i(e.projectDir)?"Unpin project":"Pin project",title:i(e.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:i(e.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:i(e.projectDir)?(0,t.jsx)(d,{size:12}):(0,t.jsx)(c,{size:12})}),e.lastActiveMs&&(0,t.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(e.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,x.formatRelative)(new Date(e.lastActiveMs).toISOString())})]},e.projectDir)})})]})}e.s(["Sidebar",0,function({projects:e,totalSessions:i,currentUsage:c,version:d,latestChangelogVersion:x}){let b=(0,n.usePathname)(),[v,w]=(0,a.useState)(new Set),[k,S]=(0,a.useState)(!1),[C,$]=(0,a.useState)("");(0,a.useEffect)(()=>{w(function(){try{let e=window.localStorage.getItem(R);if(!e)return new Set;let t=JSON.parse(e);return new Set(Array.isArray(t)?t:[])}catch{return new Set}}()),S(!0)},[]);let T=e=>{w(t=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e);try{window.localStorage.setItem(R,JSON.stringify(Array.from(r)))}catch{}return r})},z=(0,a.useMemo)(()=>{if(!C.trim())return e;let t=C.toLowerCase();return e.filter(e=>e.projectName.toLowerCase().includes(t))},[e,C]),A=z.filter(e=>v.has(e.projectDir)),L=z.filter(e=>!v.has(e.projectDir));return(0,t.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,t.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)"},children:(0,t.jsx)(p,{size:16,strokeWidth:2.25})}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,t.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${d}`,children:["v",d]})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,t.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)(I,{href:"/",active:"/"===b,icon:(0,t.jsx)(o,{size:15}),children:"Overview"}),(0,t.jsx)(I,{href:"/sessions",active:"/sessions"===b||b.startsWith("/sessions/"),icon:(0,t.jsx)(s,{size:15}),trailing:i>0?String(i):void 0,children:"All sessions"}),(0,t.jsx)(I,{href:"/projects",active:"/projects"===b,icon:(0,t.jsx)(l,{size:15}),trailing:e.length>0?String(e.length):void 0,children:"Projects"}),(0,t.jsx)(I,{href:"/day",active:"/day"===b||b.startsWith("/day/")||"/digest"===b||b.startsWith("/digest/")||"/parallelism"===b,icon:(0,t.jsx)(y,{size:15}),children:"Day"}),(0,t.jsx)(I,{href:"/usage",active:"/usage"===b,icon:(0,t.jsx)(f,{size:15}),children:"Usage"}),(0,t.jsx)(I,{href:"/insights",active:"/insights"===b,icon:(0,t.jsx)(h.Lightbulb,{size:15}),children:"Insights"}),(0,t.jsx)(I,{href:"/runs",active:"/runs"===b||b.startsWith("/runs/"),icon:(0,t.jsx)(g.Radio,{size:15}),children:"Runs"})]}),(0,t.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)(u.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,t.jsx)("input",{type:"text",placeholder:"Search projects",value:C,onChange:e=>$(e.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,t.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[k&&A.length>0&&(0,t.jsx)(E,{label:"Pinned",items:A,pathname:b,isPinned:e=>v.has(e),onTogglePin:T}),(0,t.jsx)(E,{label:"Projects",items:L,pathname:b,isPinned:e=>v.has(e),onTogglePin:T})]}),(0,t.jsx)(M,{snapshot:c}),(0,t.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsxs)("span",{style:{flex:1,minWidth:0},children:[i," sessions · ",e.length," projects"]}),(0,t.jsx)(P,{latestVersion:x,active:"/changelog"===b}),(0,t.jsx)(r.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===b?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===b?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,t.jsx)(m,{size:14})}),(0,t.jsx)(j,{})]})]})}],86566)},51878,e=>{"use strict";var t=e.i(18566),r=e.i(71645);e.s(["LiveRefresher",0,function(){let e,n=(0,t.useRouter)(),a=(e=(0,t.usePathname)(),e?.includes("/insights/print/")??!1),i=(0,r.useRef)(null),o=(0,r.useRef)({session:0,usage:0});return!function(e,t={}){let{enabled:n=!0}=t,a=(0,r.useRef)(e);(0,r.useEffect)(()=>{a.current=e},[e]),(0,r.useEffect)(()=>{if(!n)return;let e=new EventSource("/api/events");return e.onmessage=e=>{try{let t=JSON.parse(e.data);("session-updated"===t.type||"usage-updated"===t.type)&&a.current(t)}catch{}},e.onerror=()=>{},()=>{e.close()}},[n])}((0,r.useCallback)(e=>{let t="usage-updated"===e.type?"usage":"session";e.mtimeMs<=(o.current[t]??0)||(o.current[t]=e.mtimeMs,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{n.refresh()},400))},[n]),{enabled:!a}),(0,r.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),null}],51878)},23884,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(18566),a=e.i(22016),i=e.i(56324),o=e.i(56004),s=e.i(69198),l=e.i(23614);let c="cclens-live-widget-expanded";e.s(["LiveSessionsWidget",0,function({sessions:e,entrySummaries:d={}}){let u=(0,n.usePathname)(),[p,f]=(0,r.useState)(()=>Date.now()),[h,g]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{try{let e=localStorage.getItem(c);null!==e&&g("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=setInterval(()=>f(Date.now()),1e4);return()=>clearInterval(e)},[]),u&&/^\/sessions\/[^/]+$/.test(u))return null;let m=e.filter(e=>{if(!e.lastTimestamp)return!1;let t=Date.parse(e.lastTimestamp);return!Number.isNaN(t)&&p-t<=45e3}).slice().sort((e,t)=>{let r=e.firstTimestamp?Date.parse(e.firstTimestamp):0;return(t.firstTimestamp?Date.parse(t.firstTimestamp):0)-r});if(0===m.length)return null;let y=h?m.slice(0,5):[],x=h?m.length-y.length:0;return(0,t.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void g(t=>{let r=e(t);try{localStorage.setItem(c,String(r))}catch{}return r})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:h?"Collapse":`Show ${m.length} live session${1===m.length?"":"s"}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",m.length]}),h&&x>0&&(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",x," more live"]}),y.map(e=>{let r=d[e.id];return(0,t.jsxs)(a.default,{href:`/sessions/${e.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(e.lastUserPreview||e.firstUserPreview||e.lastAgentPreview)??(0,i.prettyProjectName)(e.projectName),children:[r&&(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginBottom:4},children:r.outcome?(0,t.jsx)(l.OutcomePill,{outcome:r.outcome,size:"sm",label:"text",agent:e.agent}):"skipped_trivial"!==r.enrichmentStatus?(0,t.jsx)(l.OutcomePill,{outcome:null,pending:!0,sessionId:e.id,localDay:r.localDay,size:"sm",agent:e.agent}):null}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.lastUserPreview||e.firstUserPreview||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,t.jsx)(o.TeamBadge,{session:e,linkable:!1}),(0,t.jsx)(s.AgentBadge,{agent:e.agent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:e.lastAgentPreview?(0,t.jsxs)(t.Fragment,{children:["↳ ",e.lastAgentPreview]}):(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,t.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,i.prettyProjectName)(e.projectName)})]},e.id)}),(0,t.jsx)("style",{children:`
2
+ @keyframes cs-live-pulse {
3
+ 0%, 100% { opacity: 1; transform: scale(1); }
4
+ 50% { opacity: 0.4; transform: scale(0.85); }
5
+ }
6
+ `})]})}])},62887,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(43531);let a=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var i=e.i(31278),o=e.i(3116),s=e.i(22016);let l="cclens-jobs-widget-expanded";function c({children:e}){return(0,t.jsx)("div",{style:{padding:"6px 14px",fontSize:9,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,background:"var(--af-surface)"},children:e})}function d({job:e}){let r="running"===e.status?i.Loader2:"queued"===e.status?o.Clock:"error"===e.status?a:n.Check,l="running"===e.status?"#4299e1":"queued"===e.status?"var(--af-text-tertiary)":"error"===e.status?"#f56565":"#48bb78",c=e.resultUrl&&("done"===e.status||"running"===e.status),u=c?s.default:"div",p=c?{href:e.resultUrl}:{};return(0,t.jsxs)(u,{...p,style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"var(--af-text)",fontSize:11.5,cursor:c?"pointer":"default"},children:[(0,t.jsx)(r,{size:13,className:"running"===e.status?"cs-job-spin":"",style:{color:l,marginTop:2,flexShrink:0}}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),e.progress&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",marginTop:2,fontFamily:"var(--font-mono)"},children:function(e){if(void 0!==e.index&&void 0!==e.total)return`${e.phase} ${e.index}/${e.total}`;if(void 0!==e.bytes){let t=(e.bytes/1024).toFixed(1);return`${e.phase} \xb7 ${t}k`}return e.text?`${e.phase} \xb7 ${e.text}`:e.phase}(e.progress)}),"error"===e.status&&e.error&&(0,t.jsx)("div",{style:{fontSize:10,color:"#f56565",marginTop:2},children:e.error.length>60?e.error.slice(0,60)+"…":e.error}),"done"===e.status&&e.resultUrl&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-accent)",marginTop:2},children:"View →"})]})]})}e.s(["JobQueueWidget",0,function(){let[e,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{let e=localStorage.getItem(l);null!==e&&o("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let t=!0,r=null,a=async()=>{try{let e=await fetch("/api/jobs",{cache:"no-store"});if(!e.ok)return;let r=await e.json();t&&n(r.jobs)}catch{}},i=()=>{t&&(r=setTimeout(async()=>{await a(),i()},e.some(e=>"running"===e.status||"queued"===e.status)?1500:6e3))};return a(),i(),()=>{t=!1,r&&clearTimeout(r)}},[e]);let s=e.filter(e=>"running"===e.status||"queued"===e.status),u=e.filter(e=>"done"===e.status||"error"===e.status||"cancelled"===e.status).slice(0,8);return 0===s.length?null:(0,t.jsxs)("div",{style:{position:"fixed",right:140,bottom:20,zIndex:99,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,alignItems:"flex-end"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void o(t=>{let r=e(t);try{localStorage.setItem(l,String(r))}catch{}return r})},title:`${s.length} job${1===s.length?"":"s"} running — click to ${a?"collapse":"expand"}`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(66, 153, 225, 0.14)",border:"1px solid rgba(66, 153, 225, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#4299e1",letterSpacing:"0.06em",textTransform:"uppercase",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(66, 153, 225, 0.15)",alignSelf:"flex-end"},children:[(0,t.jsx)(i.Loader2,{size:11,className:"cs-job-spin",style:{flexShrink:0}}),"Jobs · ",s.length]}),a&&(0,t.jsxs)("div",{style:{width:320,maxHeight:360,overflowY:"auto",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:10,boxShadow:"0 8px 24px rgba(0,0,0,0.18)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[s.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c,{children:"Running"}),s.map(e=>(0,t.jsx)(d,{job:e},e.id))]}),u.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c,{children:"Recent"}),u.map(e=>(0,t.jsx)(d,{job:e},e.id))]})]}),(0,t.jsx)("style",{children:`
7
+ @keyframes cs-job-spin {
8
+ from { transform: rotate(0deg); }
9
+ to { transform: rotate(360deg); }
10
+ }
11
+ .cs-job-spin {
12
+ animation: cs-job-spin 1s linear infinite;
13
+ }
14
+ `})]})}],62887)}]);
@@ -0,0 +1,4 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1033,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(22016),i=e.i(43531),a=e.i(74886);e.i(74472);let s={loop_suspected:{token:"loop_suspected",label:"consecutive-tool run",description:"The same tool was called 8 or more times in a row without interleaving — heuristic for a possible tool loop, but legitimate Read/Grep marathons also trigger it.",tone:"warn"},long_autonomous:{token:"long_autonomous",label:"long autonomous turn",description:"A single turn ran 20 minutes or longer without any user interruption.",tone:"info"},orchestrated:{token:"orchestrated",label:"subagent-orchestrated",description:"3 or more turns dispatched a subagent via the Task tool.",tone:"info"},fast_ship:{token:"fast_ship",label:"fast ship",description:"A PR shipped in under 5 minutes of agent time.",tone:"ok"},plan_used:{token:"plan_used",label:"plan mode",description:"Plan mode was entered at least once during this slice.",tone:"info"},interrupt_heavy:{token:"interrupt_heavy",label:"frequent interrupts",description:"You hit Esc or cancelled 3 or more times.",tone:"warn"},high_errors:{token:"high_errors",label:"high tool-error rate",description:"20 or more tool calls returned errors.",tone:"warn"}},o={warn:"#ed8936",info:"#4299e1",ok:"#48bb78"};function l({token:e,count:r}){let n=s[e]??{token:e,label:e.replace(/_/g," "),description:`Internal flag: ${e}.`,tone:"info"},i=o[n.tone];return(0,t.jsxs)("span",{title:`${n.token} — ${n.description}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,background:`color-mix(in srgb, ${i} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${i} 28%, transparent)`,fontSize:10,fontWeight:600,color:i,fontFamily:"var(--font-mono)",whiteSpace:"nowrap"},children:[n.label,"number"==typeof r&&(0,t.jsxs)("span",{style:{opacity:.7,fontWeight:500},children:["×",r]})]})}function d(e){let r,n=Object.keys(s),i=RegExp(`\\b(${n.join("|")})\\b`,"g"),a=[],o=0;for(;null!==(r=i.exec(e));)r.index>o&&a.push(e.slice(o,r.index)),a.push((0,t.jsx)(l,{token:r[1]},`${r.index}-${r[1]}`)),o=i.lastIndex;return o<e.length&&a.push(e.slice(o)),a.length>0?a:[e]}var c=e.i(40484),p=e.i(69198);let h={essential:"#48bb78",helpful:"#4299e1",neutral:"#a0aec0",unhelpful:"#f56565"},x=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],f={"spec-review-loop":"Spec-review loop","chunk-implementation":"Chunk implementation","research-then-build":"Research-then-build","reviewer-triad":"Reviewer triad","background-coordinated":"Background-coordinated","solo-continuation":"Solo continuation","solo-design":"Solo design","solo-build":"Solo build",mixed:"Mixed"},g={"spec-review-loop":"#9f7aea","chunk-implementation":"#4299e1","research-then-build":"#38b2ac","reviewer-triad":"#ed64a6","background-coordinated":"#ecc94b","solo-continuation":"#a0aec0","solo-design":"#48bb78","solo-build":"#ed8936",mixed:"#a0aec0"},u={outlier:"Outlier","novel-use":"Novel use","user-built-tool":"User-built tool","cross-week-contrast":"Cross-week contrast"},m={"claude-md":"CLAUDE.md addition",skill:"Skill to build",hook:"Hook to wire",harness:"Harness extension",decision:"Decision to make"};function y({digest:e,aiEnabled:r,actions:i,priorDigest:a}){var s,o;let l,p,h,x,f,g=e.shipped.length,u=Object.values(e.outcome_mix).reduce((e,t)=>e+(t??0),0),m=e.agent_min_total/60,j=m>=1?`${m.toFixed(1)}h`:`${Math.round(e.agent_min_total)}m`,k=a?(s=e,o=a,l=s.shipped.length-o.shipped.length,h=(p=s.agent_min_total-o.agent_min_total)/60,x=`${l>0?"+":""}${l} PR${1===Math.abs(l)?"":"s"}`,f=Math.abs(h)>=1?`${h>0?"+":""}${h.toFixed(1)}h`:`${p>0?"+":""}${Math.round(p)}m`,`${x} \xb7 ${f}`):null;return(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,t.jsxs)("header",{style:{marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[j," agent time · ",u," active day",1===u?"":"s"," · ",g," PR",1===g?"":"s"]}),k&&(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",padding:"1px 7px",borderRadius:999,border:"1px solid var(--af-border-subtle)"},title:"vs the prior calendar week",children:["vs last week: ",k]}),i&&(0,t.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:i})]}),e.headline?(0,t.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 6px",maxWidth:820,color:"var(--af-text)"},children:d(e.headline)}):(0,t.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:r?"No narrative yet.":`Worked ${j} across ${e.projects.length} project${1===e.projects.length?"":"s"}.`}),e.key_pattern&&(0,t.jsx)("p",{style:{fontSize:13,fontStyle:"italic",margin:0,lineHeight:1.5,color:"var(--af-text-secondary)",maxWidth:820},children:d(e.key_pattern)})]}),!r&&(0,t.jsxs)("div",{style:{padding:14,marginBottom:24,background:"var(--af-accent-subtle)",borderRadius:8,fontSize:13,color:"var(--af-text)"},children:["Enable AI features in ",(0,t.jsx)(n.default,{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see weekly narratives."]}),(0,t.jsx)(v,{digest:e}),(0,t.jsx)(S,{digest:e}),e.top_goal_categories.length>0&&(0,t.jsx)(H,{title:"Goal mix",anchor:"goals",children:(0,t.jsx)(c.GoalBar,{goals:e.top_goal_categories,total:e.agent_min_total})}),(0,t.jsx)(W,{digest:e}),e.top_sessions&&e.top_sessions.length>0&&(0,t.jsx)(A,{sessions:e.top_sessions}),(0,t.jsx)(F,{title:"What worked",anchor:"what-worked",items:e.what_worked??[],tone:"#48bb78",sectionFallbackProse:null}),(0,t.jsx)(F,{title:"What stalled",anchor:"what-stalled",items:e.what_stalled??[],tone:"#ed8936",sectionFallbackProse:"No stalls stuck this week."}),(0,t.jsx)(C,{items:e.what_surprised??[]}),(0,t.jsx)(B,{items:e.where_to_lean??[]}),(0,t.jsx)(D,{shipped:e.shipped}),!e.working_shapes&&(0,t.jsx)(b,{digest:e})]})}function b({digest:e}){let r=e.recurring_themes??[],n=e.outcome_correlations??[],i=e.friction_categories??[],a=e.suggestions,s=e.on_the_horizon,o=e.fun_ending;return r.length>0||n.length>0||i.length>0||(a?.claude_md_additions?.length??0)>0||s||o?(0,t.jsxs)("div",{style:{padding:"14px 16px",marginTop:18,borderRadius:8,background:"color-mix(in srgb, var(--af-text-tertiary) 5%, var(--af-surface))",border:"1px dashed var(--af-border-subtle)",fontSize:12,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Legacy digest:"})," this week was generated under a previous prompt. Re-roll the digest to refresh it under the new working-shapes narrative."]}):null}function v({digest:e}){let r=e.agent_min_total/60,i=r>=1?`${r.toFixed(1)}h`:`${Math.round(e.agent_min_total)}m`,a=function(e){let t=e.reduce((e,t)=>e+t,0);if(0===t)return null;for(let r=1;r<=24;r++){let n=0,i=0;for(let t=0;t<=24-r;t++){let a=0;for(let n=0;n<r;n++)a+=e[t+n]??0;a>n&&(n=a,i=t)}if(n/t>=.6)return{start:i,end:i+r,share_pct:n/t*100}}return null}(e.hours_distribution),s=new Map(e.days_active.map(e=>[e.date,e])),o=z(e.window.start),l=o.map(e=>s.get(e)?.agent_min??0),d=Math.max(...l,1),c=e.busiest_day?o.indexOf(e.busiest_day.date):-1,p=e.longest_run&&e.busiest_day?Math.min(1,e.longest_run.active_min/Math.max(1,e.busiest_day.agent_min)):0,h=[];return(h.push({label:"Agent time",primary:i,detail:`across ${e.days_active.length} day${1===e.days_active.length?"":"s"}`,visual:(0,t.jsx)(j,{values:l,max:d,highlight:-1})}),e.busiest_day&&h.push({label:"Busiest day",href:`/digest/${e.busiest_day.date}`,primary:`${L(e.busiest_day.date)} ${e.busiest_day.date.slice(5)}`,detail:`${Math.round(e.busiest_day.agent_min)}m \xb7 ${e.busiest_day.shipped_count} PR${1===e.busiest_day.shipped_count?"":"s"}`,visual:(0,t.jsx)(j,{values:l,max:d,highlight:c})}),e.longest_run&&h.push({label:"Longest single run",href:`/sessions/${e.longest_run.session_id}`,title:`Session ${e.longest_run.session_id.slice(0,8)}`,primary:`${Math.round(e.longest_run.active_min)}m`,detail:`${e.longest_run.project_display} \xb7 ${L(e.longest_run.date)} ${e.longest_run.date.slice(5)}`,visual:(0,t.jsx)(k,{ratio:p,caption:"vs busiest day"})}),a&&h.push({label:"Peak hours",title:`${$(a.start,a.end)} carried ${a.share_pct.toFixed(0)}% of the week's agent time`,primary:$(a.start,a.end),detail:`${a.share_pct.toFixed(0)}% of agent time`,visual:(0,t.jsx)(_,{hours:e.hours_distribution,peakStart:a.start,peakEnd:a.end})}),0===h.length)?null:(0,t.jsx)("section",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.min(h.length,4)}, minmax(0, 1fr))`,gap:10,marginBottom:20},children:h.map((e,r)=>{let i=(0,t.jsxs)("div",{style:{padding:"12px 14px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",minHeight:90},title:e.title,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginBottom:6},children:e.label}),(0,t.jsx)("div",{style:{fontSize:17,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",lineHeight:1.2},children:e.primary}),(0,t.jsx)("div",{style:{fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:e.detail})]}),e.visual&&(0,t.jsx)("div",{style:{marginTop:10},children:e.visual})]});return e.href?(0,t.jsx)(n.default,{href:e.href,style:{textDecoration:"none"},children:i},r):(0,t.jsx)("div",{children:i},r)})})}function j({values:e,max:r,highlight:n}){return(0,t.jsx)("div",{style:{display:"flex",gap:2,alignItems:"flex-end",height:18},children:e.map((e,i)=>{let a=r>0?Math.max(1,e/r*18):1,s=i===n;return(0,t.jsx)("div",{style:{flex:1,height:a,borderRadius:1,background:s?"var(--af-accent)":e>0?"color-mix(in srgb, var(--af-accent) 30%, transparent)":"var(--af-border-subtle)"}},i)})})}function k({ratio:e,caption:r}){let n=100*Math.max(0,Math.min(1,e));return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{height:6,borderRadius:99,overflow:"hidden",background:"var(--af-border-subtle)"},children:(0,t.jsx)("div",{style:{width:`${n}%`,height:"100%",background:"var(--af-accent)"}})}),(0,t.jsxs)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:[Math.round(n),"% ",r]})]})}function _({hours:e,peakStart:r,peakEnd:n}){let i=Math.max(...e,1);return(0,t.jsx)("div",{style:{display:"flex",gap:1,alignItems:"flex-end",height:18},children:e.map((e,a)=>{let s=a>=r&&a<=n,o=i>0?Math.max(1,e/i*18):1;return(0,t.jsx)("div",{style:{flex:1,height:o,borderRadius:1,background:s?"var(--af-accent)":e>0?"color-mix(in srgb, var(--af-accent) 22%, transparent)":"var(--af-border-subtle)"}},a)})})}function S({digest:e}){if(0===e.days_active.length)return null;let r=Math.max(...e.days_active.map(e=>e.agent_min)),i=new Map(e.days_active.map(e=>[e.date,e])),a=z(e.window.start);return(0,t.jsx)("section",{style:{display:"flex",gap:6,alignItems:"stretch",padding:"12px 0",marginBottom:24},children:a.map((e,a)=>{let s=i.get(e),o=s?.agent_min??0,l=r>0&&o>0?Math.max(8,o/r*100):0,d=s?w[s.outcome_day]:"var(--af-text-tertiary)",c=s?.helpfulness_day?h[s.helpfulness_day]:null;return(0,t.jsxs)(n.default,{href:s?`/digest/${e}`:"#",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch",gap:2,textDecoration:"none",pointerEvents:s?"auto":"none"},title:s?`${e} \xb7 ${Math.round(o)}m \xb7 ${s.outcome_day}${s.shipped_count>0?` \xb7 ${s.shipped_count} PR`:""}${s.helpfulness_day?` \xb7 helpfulness ${s.helpfulness_day}`:""}`:"no activity",children:[(0,t.jsxs)("div",{style:{height:56,borderRadius:4,position:"relative",background:"var(--af-surface)",border:`1px solid ${s?`color-mix(in srgb, ${d} 28%, var(--af-border-subtle))`:"var(--af-border-subtle)"}`,overflow:"hidden"},children:[s&&(0,t.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${l}%`,background:`color-mix(in srgb, ${d} 28%, transparent)`}}),s?.dominant_shape&&g[s.dominant_shape]&&(0,t.jsx)("div",{title:`${f[s.dominant_shape]??s.dominant_shape}`,style:{position:"absolute",top:0,left:0,right:0,height:3,background:g[s.dominant_shape]}}),c&&(0,t.jsx)("div",{style:{position:"absolute",top:4,right:4,width:6,height:6,borderRadius:999,background:c},title:s?.helpfulness_day??""})]}),(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",color:"var(--af-text-tertiary)",textAlign:"center"},children:x[a]}),(0,t.jsx)("div",{style:{fontSize:9,fontFamily:"var(--font-mono)",color:s?"var(--af-text-secondary)":"var(--af-text-tertiary)",textAlign:"center"},children:s?`${Math.round(o)}m`:"—"})]},a)})})}let w={shipped:"#48bb78",partial:"#4299e1",blocked:"#f56565",exploratory:"#a0aec0",trivial:"#cbd5e0",idle:"#cbd5e0"};function $(e,t){let r=e=>`${e%12||12}${e<12||24===e?"am":"pm"}`;return`${r(e)}–${r(t)}`}function z(e){let t=[],r=new Date(e);for(let e=0;e<7;e++){let n=new Date(r);n.setDate(r.getDate()+e);let i=n.getFullYear(),a=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");t.push(`${i}-${a}-${s}`)}return t}function W({digest:e}){let r=e.trajectory&&e.trajectory.length>0,i=e.standout_days&&e.standout_days.length>0,a=e.projects.filter(e=>e.share_pct>=5||e.shipped_count>0),s=a.length>0;return r||i||s?(0,t.jsxs)(H,{title:"Through the week",anchor:"through-the-week",children:[(r||i)&&(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:r&&i?"minmax(0, 1.4fr) minmax(0, 1fr)":"1fr",gap:28,marginBottom:22*!!s},children:[r&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R,{children:"Trajectory"}),(0,t.jsx)("ol",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:6},children:e.trajectory.map(e=>(0,t.jsxs)("li",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,t.jsxs)(n.default,{href:`/digest/${e.date}`,style:{fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0,width:64,paddingTop:3,textDecoration:"none"},children:[L(e.date)," ",e.date.slice(5)]}),(0,t.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text-secondary)"},children:d(e.line)})]},e.date))})]}),i&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R,{children:"Standout days"}),(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:8},children:e.standout_days.map(e=>(0,t.jsxs)("li",{style:{padding:"10px 12px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)(n.default,{href:`/digest/${e.date}`,style:{fontSize:11,fontWeight:600,color:"var(--af-accent)",textDecoration:"none",fontFamily:"var(--font-mono)",marginRight:8},children:[L(e.date)," ",e.date.slice(5)]}),(0,t.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text)"},children:d(e.why)})]},e.date))})]})]}),s&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R,{children:"Project areas"}),(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:10},children:a.map(e=>(0,t.jsxs)("li",{style:{padding:"11px 13px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,marginBottom:6*!!e.description},children:[(0,t.jsx)(n.default,{href:`/projects/${encodeURIComponent(e.name)}`,style:{fontSize:13,fontWeight:600,color:"var(--af-text)",textDecoration:"none",flex:1,minWidth:0,letterSpacing:"-0.01em"},children:e.display_name}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)"},children:[Math.round(e.agent_min),"m · ",e.share_pct.toFixed(0),"% · ",e.shipped_count," PR"]})]}),e.description&&(0,t.jsx)("p",{style:{fontSize:12,lineHeight:1.5,margin:0,color:"var(--af-text-secondary)"},children:e.description})]},e.name))})]})]}):null}function R({children:e}){return(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,marginBottom:10},children:e})}function T({label:e,payload:n}){let[s,o]=(0,r.useState)(!1);return(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("pre",{style:{margin:0,padding:"10px 12px",paddingRight:96,borderRadius:6,background:"var(--af-surface-raised)",border:"1px solid var(--af-border-subtle)",fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text)",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.55,overflowX:"auto",maxHeight:280,overflowY:"auto"},children:n}),(0,t.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(n),o(!0),setTimeout(()=>o(!1),1500)}catch{}},style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:5,background:s?"color-mix(in srgb, #48bb78 18%, var(--af-surface))":"var(--af-surface)",border:`1px solid ${s?"#48bb78":"var(--af-border-subtle)"}`,color:s?"#48bb78":"var(--af-text-secondary)",fontSize:10,fontWeight:600,cursor:"pointer"},children:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Check,{size:10})," Copied"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Copy,{size:10})," ",e]})})]})}function D({shipped:e}){let[i,a]=(0,r.useState)(!1);if(0===e.length)return null;let s=e.length>=10,o=s&&!i?e.slice(0,5):e,l=e.length-o.length;return(0,t.jsxs)(H,{title:`Shipped (${e.length})`,anchor:"shipped",children:[(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:o.map((e,r)=>(0,t.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"baseline",padding:"6px 10px",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:[(0,t.jsxs)(n.default,{href:`/digest/${e.date}`,style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",flexShrink:0,width:56,textDecoration:"none"},children:[L(e.date)," ",e.date.slice(5)]}),(0,t.jsx)("span",{style:{flex:1,minWidth:0},children:e.title}),(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:e.project})]},r))}),s&&l>0&&(0,t.jsxs)("button",{type:"button",onClick:()=>a(!0),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:["+",l," more"]}),s&&i&&(0,t.jsx)("button",{type:"button",onClick:()=>a(!1),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:"show less"})]})}function F({title:e,anchor:r,items:n,tone:i,sectionFallbackProse:a}){return n&&0!==n.length?(0,t.jsx)(H,{title:e,anchor:r,children:(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:n.map((e,r)=>(0,t.jsx)(I,{item:e,tone:i},r))})}):null===a?null:(0,t.jsx)(H,{title:e,anchor:r,children:(0,t.jsx)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-tertiary)",margin:0,padding:"8px 0"},children:a})})}function I({item:e,tone:r}){let i=M(e.anchor);return(0,t.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${r} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${r} 22%, var(--af-border))`},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:e.title}),(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:r,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${r} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${r} 28%, transparent)`,fontFamily:"var(--font-mono)"},title:`Anchor: ${e.anchor}`,children:i})]}),(0,t.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:e.detail}),(0,t.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${r} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsxs)(n.default,{href:`/digest/${e.evidence.date}`,style:{fontSize:10,fontWeight:600,color:r,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[L(e.evidence.date)," ",e.evidence.date.slice(5)]}),(0,t.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),e.evidence.quote,(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]})}function M(e){return"plan-mode-gap"===e?"Plan-mode gap":e.startsWith("interaction_grammar.")?e.slice(20).replace(/_/g," "):f[e]??e}function C({items:e}){return e&&0!==e.length?(0,t.jsx)(H,{title:"What surprised",anchor:"what-surprised",children:(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:e.map((e,r)=>{let i="#b794f4";return(0,t.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${i} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${i} 22%, var(--af-border))`},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:e.title}),(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:i,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${i} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${i} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:u[e.surprise_kind]??e.surprise_kind})]}),(0,t.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:e.detail}),(0,t.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${i} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsxs)(n.default,{href:`/digest/${e.evidence.date}`,style:{fontSize:10,fontWeight:600,color:i,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[L(e.evidence.date)," ",e.evidence.date.slice(5)]}),(0,t.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),e.evidence.quote,(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]},r)})})}):null}function B({items:e}){return e&&0!==e.length?(0,t.jsx)(H,{title:"Where to lean",anchor:"where-to-lean",children:(0,t.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:12},children:e.map((e,r)=>{let i="var(--af-accent)",a=M(e.anchor);return(0,t.jsxs)("li",{style:{padding:"14px 16px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:i,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${i} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${i} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:m[e.lean_kind]??e.lean_kind}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",flex:1,minWidth:0},children:e.title}),(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},title:`Anchor: ${e.anchor}`,children:["↳ ",a]})]}),(0,t.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 10px",color:"var(--af-text)"},children:e.detail}),e.copyable&&(0,t.jsx)(T,{label:`Copy ${"claude-md"===e.lean_kind?"block":"snippet"}`,payload:e.copyable}),(0,t.jsxs)("div",{style:{marginTop:8,fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:["Evidence · ",(0,t.jsxs)(n.default,{href:`/digest/${e.evidence.date}`,style:{color:"var(--af-text-tertiary)",textDecoration:"underline"},children:[L(e.evidence.date)," ",e.evidence.date.slice(5)]})," · “",e.evidence.quote.slice(0,100),e.evidence.quote.length>100?"…":"","”"]})]},r)})})}):null}function H({title:e,anchor:r,children:n}){return(0,t.jsxs)("section",{id:r,style:{marginBottom:28,scrollMarginTop:24},children:[(0,t.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:"0 0 12px"},children:e}),n]})}function L(e){return new Date(`${e}T12:00:00`).toLocaleDateString("en-US",{weekday:"short"})}let P={"user-steering":"#ed8936","subagent-burst":"#9f7aea","long-autonomous":"#4299e1","plan-mode":"#38b2ac","pr-ship":"#48bb78","harness-chain":"#ed64a6",interrupt:"#f56565","brainstorm-loop":"#9f7aea","agent-loop":"#f56565"},E={"user-steering":"Steering","subagent-burst":"Subagents","long-autonomous":"Autonomous","plan-mode":"Plan","pr-ship":"Shipped","harness-chain":"Harness",interrupt:"Interrupt","brainstorm-loop":"Brainstorm","agent-loop":"Loop"};function A({sessions:e}){return(0,t.jsxs)(H,{title:`Top ${e.length} session${1===e.length?"":"s"} this week`,anchor:"top-sessions",children:[(0,t.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",marginTop:-4,marginBottom:14,fontStyle:"italic",lineHeight:1.5,maxWidth:720},children:"Picked by significance — active time × subagents × ships, capped to one per project. Each card walks the timeline with annotated moments to surface the texture of how you drove the agent."}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:e.map(e=>(0,t.jsx)(G,{session:e},e.session_id))})]})}function G({session:e}){let r=e.working_shape?f[e.working_shape]??e.working_shape:null,i=e.working_shape?g[e.working_shape]??"var(--af-text-tertiary)":"var(--af-text-tertiary)",a=e.wall_min/60,s=e.active_min/60,o=a>=1?`${a.toFixed(1)}h wall`:`${Math.round(e.wall_min)}m wall`,l=s>=1?`${s.toFixed(1)}h active`:`${Math.round(e.active_min)}m active`;return(0,t.jsx)("div",{style:{borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderTop:`3px solid ${i}`,overflow:"hidden"},children:(0,t.jsxs)("div",{style:{padding:"16px 18px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",marginBottom:6},children:[(0,t.jsx)(n.default,{href:`/sessions/${e.session_id}`,style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",textDecoration:"none"},children:e.project_display}),(0,t.jsx)(p.AgentBadge,{agent:e.agent}),(0,t.jsxs)(n.default,{href:`/digest/${e.date}`,style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-accent)",textDecoration:"none"},children:[L(e.date)," ",e.date.slice(5)]}),(0,t.jsxs)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:[l," · ",o," · ",e.turn_count," turns"]}),r&&(0,t.jsx)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:`color-mix(in srgb, ${i} 14%, transparent)`,color:i},children:r}),"shipped"===e.outcome&&e.shipped_prs.length>0&&(0,t.jsxs)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:"color-mix(in srgb, #48bb78 14%, transparent)",color:"#48bb78"},children:["✓ ",e.shipped_prs.length," PR",1===e.shipped_prs.length?"":"s"]})]}),e.day_signature&&(0,t.jsxs)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-secondary)",margin:"0 0 14px",lineHeight:1.5,maxWidth:760},children:["“",e.day_signature,"”"]}),(0,t.jsx)(O,{session:e}),e.steering_summary&&(0,t.jsxs)("p",{style:{fontSize:12,lineHeight:1.55,margin:"10px 0 12px",color:"var(--af-text-secondary)",maxWidth:780,paddingLeft:10,borderLeft:"2px solid var(--af-border-subtle)"},children:[(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginRight:6},children:"steering"}),e.steering_summary]}),(0,t.jsx)(U,{session:e}),(0,t.jsx)(Y,{session:e}),e.pins.length>0&&(0,t.jsx)("ol",{style:{listStyle:"none",padding:0,margin:"12px 0 0",display:"flex",flexDirection:"column",gap:6},children:e.pins.map((e,r)=>(0,t.jsx)(K,{pin:e},r))})]})})}function O({session:e}){return e.why_picked||e.what_worked||e.what_hit_friction?(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,margin:"0 0 6px"},children:[e.why_picked&&(0,t.jsx)(N,{label:"Why this session",tone:"var(--af-text-tertiary)",accent:"var(--af-text-tertiary)",text:e.why_picked}),e.session_summary&&(0,t.jsx)(N,{label:"What happened",tone:"var(--af-text)",accent:"var(--af-text-secondary)",text:e.session_summary,weight:500}),e.what_worked&&(0,t.jsx)(N,{label:"What worked",tone:"var(--af-text)",accent:"#48bb78",text:e.what_worked}),e.what_hit_friction&&(0,t.jsx)(N,{label:"What hit friction",tone:"var(--af-text)",accent:"#ed8936",text:e.what_hit_friction})]}):e.session_summary?(0,t.jsx)("p",{style:{fontSize:13,lineHeight:1.55,margin:"0 0 8px",color:"var(--af-text)",maxWidth:780},children:e.session_summary}):null}function N({label:e,tone:r,accent:n,text:i,weight:a=400}){return(0,t.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start",maxWidth:800},children:[(0,t.jsx)("span",{style:{flexShrink:0,width:132,paddingTop:2,fontSize:9.5,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:n},children:e}),(0,t.jsx)("span",{style:{fontSize:13,lineHeight:1.55,color:r,fontWeight:a},children:i})]})}function U({session:e}){let{user_authored_skills:r,user_authored_subagents:n,stock_skills:i,top_tools:a}=e;return r.length>0||n.length>0||i.length>0||a.length>0?(0,t.jsxs)("div",{style:{marginBottom:4},children:[n.length>0&&(0,t.jsx)(q,{label:"Your subagents",children:n.map(e=>(0,t.jsxs)(X,{tone:"user",children:[e.type,e.count>1?` \xd7${e.count}`:""]},e.type))}),(r.length>0||i.length>0)&&(0,t.jsxs)(q,{label:"Skills loaded",children:[r.map(e=>(0,t.jsx)(X,{tone:"user",children:e},e)),i.slice(0,6).map(e=>(0,t.jsx)(X,{tone:"stock",children:e},e))]}),a.length>0&&(0,t.jsx)(q,{label:"Top tools",children:a.slice(0,4).map((e,r)=>(0,t.jsx)(X,{children:e},r))})]}):null}function q({label:e,children:r}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"3px 0",fontSize:11},children:[(0,t.jsx)("span",{style:{minWidth:96,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:10,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,t.jsx)("div",{style:{display:"flex",gap:5,flexWrap:"wrap",flex:1},children:r})]})}function X({children:e,tone:r,title:n}){return(0,t.jsx)("span",{title:n,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:10,fontFamily:"var(--font-mono)",background:"user"===r?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===r?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:e})}function Y({session:e}){let r=e.timeline.active_intervals,n=r.length>0?Math.max(...r.map(e=>e.end_min)):0,i=Math.max(1,e.timeline.duration_min,n);return(0,t.jsxs)("div",{style:{marginTop:10,marginBottom:4},children:[(0,t.jsxs)("div",{style:{position:"relative",width:"100%",height:28,background:"var(--af-border-subtle)",borderRadius:4},children:[r.map((e,r)=>{let n=e.start_min/i*100,a=Math.max(.6,(e.end_min-e.start_min)/i*100);return(0,t.jsx)("div",{style:{position:"absolute",top:6,bottom:6,left:`${n}%`,width:`${a}%`,background:"color-mix(in srgb, var(--af-accent) 30%, transparent)",borderRadius:2}},r)}),e.pins.map((e,r)=>{let n=Math.max(0,Math.min(100,e.start_min/i*100)),a=void 0!==e.end_min?Math.max(n+.5,Math.min(100,e.end_min/i*100)):n,s=void 0!==e.end_min&&a>n+.5,o=P[e.kind]??"var(--af-accent)";return(0,t.jsxs)("div",{children:[s&&(0,t.jsx)("div",{style:{position:"absolute",top:4,bottom:4,left:`${n}%`,width:`${a-n}%`,background:`color-mix(in srgb, ${o} 35%, transparent)`,border:`1px solid ${o}`,borderRadius:3},title:`${E[e.kind]}: ${e.label}`}),(0,t.jsx)("div",{style:{position:"absolute",top:-3,bottom:-3,left:`${n}%`,width:3,background:o,borderRadius:1,transform:"translateX(-1.5px)"},title:`${E[e.kind]}: ${e.label}`})]},r)})]}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",marginTop:3},children:[(0,t.jsx)("span",{children:"0m"}),(0,t.jsx)("span",{children:J(i/2)}),(0,t.jsxs)("span",{children:[J(i)," wall"]})]})]})}function K({pin:e}){let r=P[e.kind]??"var(--af-accent)",n=void 0!==e.end_min&&e.end_min>e.start_min+.5?`${J(e.start_min)}–${J(e.end_min)}`:J(e.start_min);return(0,t.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:12,lineHeight:1.5},children:[(0,t.jsx)("span",{style:{flexShrink:0,width:3,height:3,marginTop:7,borderRadius:999,background:r}}),(0,t.jsx)("span",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",paddingTop:1,minWidth:60},children:n}),(0,t.jsx)("span",{style:{flexShrink:0,padding:"1px 7px",borderRadius:999,fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",background:`color-mix(in srgb, ${r} 15%, transparent)`,color:r,marginTop:1},children:E[e.kind]??e.kind}),(0,t.jsx)("span",{style:{color:"var(--af-text)",maxWidth:640},children:e.label})]})}function J(e){if(e>=60){let t=Math.round(e),r=Math.floor(t/60),n=t%60;return`${r}h${n>0?` ${n}m`:""}`}return`${Math.round(10*e)/10}m`}function V({monday:e,isStreaming:r,aiEnabled:n,progress:i,onGenerate:a}){let s=new Date(`${e}T12:00:00`),o=new Date(s);o.setDate(s.getDate()+6);let l=e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=`${l(s)} — ${l(o)}`;return(0,t.jsx)("div",{style:{maxWidth:980,margin:"0 auto",padding:"60px 40px"},children:(0,t.jsxs)("div",{style:{margin:"0 auto",maxWidth:480,padding:"32px 28px",borderRadius:14,background:"var(--af-surface)",border:"1px dashed var(--af-border-subtle)",textAlign:"center"},children:[(0,t.jsx)("div",{style:{width:44,height:44,borderRadius:12,margin:"0 auto 16px",background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)",fontSize:20},children:"✦"}),(0,t.jsx)("h2",{style:{fontSize:16,fontWeight:600,margin:"0 0 6px",color:"var(--af-text)",letterSpacing:"-0.01em"},children:r?"Generating digest…":"No digest yet for this week"}),(0,t.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,margin:"0 0 18px",color:"var(--af-text-secondary)"},children:r?`Synthesizing ${d} from this week's day digests. This usually takes 5–10 minutes.`:n?`Once generated, this view shows top sessions, trajectory, findings, and project areas for ${d}.`:`Enable AI features in Settings to synthesize a weekly narrative for ${d}. Deterministic stats are still available below in the live digest as soon as data lands.`}),n&&(0,t.jsx)("button",{onClick:a,disabled:r,style:{padding:"9px 18px",borderRadius:8,background:r?"var(--af-border-subtle)":"var(--af-accent)",color:r?"var(--af-text-tertiary)":"white",border:"none",cursor:r?"default":"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.005em"},children:r?"Generating…":"Generate digest"}),i&&(0,t.jsx)("div",{style:{marginTop:12,fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})})}e.s(["WeekDigestView",0,function({initial:e,monday:n,aiEnabled:i,autoFire:a=!1,prior:s}){var o,l;let[d,c]=(0,r.useState)(e),[p,h]=(0,r.useState)("idle"),[x,f]=(0,r.useState)(""),g=(0,r.useRef)(!1),u=(0,r.useCallback)(async(e=!1)=>{h("streaming"),f("Starting...");let t=`/api/digest/week/${n}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){h("error"),f(`Error ${r.status}`);return}let i=r.body.getReader(),a=new TextDecoder,s="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let r=(s+=a.decode(t,{stream:!0})).split("\n\n");for(let e of(s=r.pop()??"",r)){let t=e.split("\n").find(e=>e.startsWith("data: "));if(t)try{let e=JSON.parse(t.slice(6));if("status"===e.type)f(e.text);else if("dependency"===e.type)f(`${"day"===e.kind?"Day":"Week"} ${e.key} ${e.status}`);else if("entry"===e.type)f(`Enriching ${e.index}/${e.total}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3);f(`Claude composing… ${e.bytes.toLocaleString()} chars (${t}s)`)}else if("digest"===e.type)e.digest&&"week"===e.digest.scope&&c(e.digest),f("Rendering...");else if("saved"===e.type)f("Saved.");else if("error"===e.type){h("error"),f(e.message);return}}catch{}}}h("done"),f("")},[n]);(0,r.useEffect)(()=>{a&&!g.current&&"idle"===p&&(g.current=!0,u(!1))},[a,p,u]);let m="streaming"===p,b=!!d?.headline,v=null;return(!b&&i?v=(0,t.jsx)("button",{onClick:()=>u(!1),disabled:m,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:(o=m)?"default":"pointer",fontSize:11,fontWeight:600,opacity:o?.6:1},children:m?"Generating...":d?"Generate":"Generate digest"}):i&&(v=(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",gap:6,alignItems:"center"},children:["✓ Up to date",(0,t.jsx)("button",{onClick:()=>u(!0),disabled:m,title:"Re-roll the narrative for this week",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:(l=m)?"default":"pointer",opacity:l?.6:1},children:m?"...":"Re-roll"})]})),x&&(v=(0,t.jsxs)(t.Fragment,{children:[v,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:x})]})),d)?(0,t.jsx)(y,{digest:d,aiEnabled:i,actions:v,priorDigest:s??null}):(0,t.jsx)(V,{monday:n,isStreaming:m,aiEnabled:i,progress:x,onGenerate:()=>u(!1)})}],1033)},57143,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(71645),i=e.i(73375),a=e.i(63059);let s=(0,e.i(75254).default)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var o=e.i(37727);function l({inDrawer:e=!1}={}){let[r,i]=(0,n.useState)("weeks"),[a,s]=(0,n.useState)(null),[o,g]=(0,n.useState)(null);return(0,n.useEffect)(()=>{fetch("/api/digest/week-index?count=12").then(e=>e.json()).then(e=>s(e.weeks)).catch(()=>s([])),fetch("/api/digest/month-index?count=6").then(e=>e.json()).then(e=>g(e.months)).catch(()=>g([]))},[]),(0,t.jsxs)("div",{style:e?{padding:"0 18px"}:{maxWidth:980,margin:"0 auto",padding:"28px 40px 0"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:e?14:18},children:[!e&&(0,t.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:0,marginRight:4},children:"History"}),(0,t.jsx)("div",{style:h,children:["weeks","months"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>i(e),style:{...x,background:r===e?"var(--af-accent)":"transparent",color:r===e?"white":"var(--af-text-secondary)"},children:"weeks"===e?"Weeks":"Months"},e))})]}),"weeks"===r?null===a?(0,t.jsx)(p,{children:"Loading weeks…"}):0===a.length?(0,t.jsx)(p,{children:"No history yet."}):(0,t.jsx)("ul",{style:f,children:a.map(e=>(0,t.jsx)(d,{w:e},e.start))}):null===o?(0,t.jsx)(p,{children:"Loading months…"}):0===o.length?(0,t.jsx)(p,{children:"No history yet."}):(0,t.jsx)("ul",{style:f,children:o.map(e=>(0,t.jsx)(c,{m:e},e.start))})]})}function d({w:e}){let n=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/week-${e.start}`,a=e.saved_key&&e.headline?e.headline:n?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:g(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:u,children:[(0,t.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:["W",String(e.iso_week).padStart(2,"0")," · ",e.label]}),e.in_progress&&(0,t.jsx)("span",{style:y,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:m,children:a})]})})}function c({m:e}){let n=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/month-${e.start.slice(0,7)}`,a=e.saved_key&&e.headline?e.headline:n?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:g(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:u,children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:e.label}),e.in_progress&&(0,t.jsx)("span",{style:y,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:m,children:a})]})})}function p({children:e}){return(0,t.jsx)("div",{style:{padding:"20px 18px",borderRadius:10,border:"1px dashed var(--af-border)",background:"var(--af-surface)",fontSize:13,color:"var(--af-text-tertiary)",lineHeight:1.55},children:e})}let h={display:"inline-flex",gap:3,border:"1px solid var(--af-border)",borderRadius:8,padding:2},x={padding:"5px 14px",fontSize:12,fontWeight:600,border:"none",borderRadius:6,cursor:"pointer"},f={listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4};function g(e){return{display:"flex",alignItems:"stretch",gap:14,padding:"10px 14px",borderRadius:10,border:`1px solid ${e?"color-mix(in srgb, var(--af-accent) 24%, var(--af-border))":"var(--af-border-subtle)"}`,background:e?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",transition:"border-color 0.15s"}}let u={display:"flex",alignItems:"center",gap:8,minWidth:0},m={fontSize:11,color:"var(--af-text-tertiary)",lineHeight:1.5,fontFamily:"var(--font-mono)"},y={fontSize:10,fontWeight:500,padding:"2px 6px",borderRadius:4,background:"color-mix(in srgb, #f5b445 18%, transparent)",color:"#c08a1f",letterSpacing:"0.02em"};function b({target:e,dir:n}){var s;let o="prev"===n?i.ChevronLeft:a.ChevronRight;return e?(0,t.jsxs)(r.default,{href:`/insights/${e.key}`,style:(s=e.cached,{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:`1px solid ${s?"color-mix(in srgb, var(--af-accent) 28%, var(--af-border))":"var(--af-border-subtle)"}`,background:s?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",color:s?"var(--af-accent)":"var(--af-text-secondary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",textDecoration:"none"}),title:e.cached?`Saved digest \xb7 ${e.label}`:`${e.label} (no saved digest yet — will prompt to Generate)`,children:[(0,t.jsx)(o,{size:14}),(0,t.jsx)("span",{children:e.label})]}):(0,t.jsx)("span",{style:k,title:`No ${"prev"===n?"earlier":"later"} period`,children:(0,t.jsx)(o,{size:14})})}function v({onClose:e}){return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Insights history",style:{position:"fixed",inset:0,zIndex:200,display:"flex",justifyContent:"flex-end"},children:[(0,t.jsx)("div",{onClick:e,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.32)",animation:"fade-in 120ms ease-out"}}),(0,t.jsxs)("aside",{style:{position:"relative",width:"min(440px, 92vw)",height:"100vh",background:"var(--background)",borderLeft:"1px solid var(--af-border-subtle)",boxShadow:"-12px 0 40px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",animation:"slide-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{style:{fontSize:13,fontWeight:600,margin:0,color:"var(--af-text)"},children:"Browse insights history"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close history",style:{marginLeft:"auto",width:26,height:26,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:"transparent",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(o.X,{size:14})})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"18px 0"},children:(0,t.jsx)(l,{inDrawer:!0})})]}),(0,t.jsx)("style",{children:`
2
+ @keyframes slide-in { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
3
+ @keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
4
+ `})]})}let j={display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text)",fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"inherit"},k={display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text-tertiary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",opacity:.45,cursor:"default"};e.s(["InsightsTopBar",0,function({scope:e,currentLabel:i,rangeLabel:a,prev:o,next:l}){let[d,c]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!d)return;let e=e=>{"Escape"===e.key&&c(!1)};return window.addEventListener("keydown",e),document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=""}},[d]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("header",{style:{position:"sticky",top:0,zIndex:50,background:"color-mix(in srgb, var(--background) 90%, transparent)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderBottom:"1px solid var(--af-border-subtle)"},className:"no-print",children:(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"12px 40px",display:"flex",alignItems:"center",gap:14,minHeight:44},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[(0,t.jsx)(r.default,{href:"/insights",style:{fontSize:10,fontWeight:700,color:"var(--af-text-tertiary)",textDecoration:"none",textTransform:"uppercase",letterSpacing:"0.08em",flexShrink:0},title:"Latest week digest",children:"Insights"}),(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontSize:11,flexShrink:0},children:"›"}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),a&&(0,t.jsx)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",flexShrink:0},children:a})]}),(0,t.jsxs)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:6},children:[(0,t.jsx)(b,{target:o,dir:"prev"}),(0,t.jsx)(b,{target:l,dir:"next"}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),style:j,title:`Browse ${"week"===e?"weekly":"monthly"} history`,children:[(0,t.jsx)(s,{size:13}),(0,t.jsx)("span",{children:"Browse"})]})]})]})}),d&&(0,t.jsx)(v,{onClose:()=>c(!1)})]})}],57143)}]);
@@ -1,10 +1,19 @@
1
1
  import type { CyclePeak } from "@/lib/calibration-data";
2
+ import {
3
+ paceToneForCycle,
4
+ toneVar,
5
+ utilizationTone,
6
+ } from "@/lib/utilization-tone";
2
7
 
3
- // Horizontal bar chart of the last few cycles' peak utilization. One bar
4
- // per cycle, height proportional to peak %, color follows the burndown
5
- // danger thresholds (green / amber / red). The right-most bar is "current"
6
- // (in-progress) and gets a distinct styling so it isn't read as a finished
7
- // trend point. Designed for direct reuse on the team-edition member card.
8
+ const HOUR = 3_600_000;
9
+ const WINDOW_MS = { "5h": 5 * HOUR, "7d": 7 * 24 * HOUR } as const;
10
+
11
+ // Horizontal bar chart of recent cycle peaks. Color logic differs by
12
+ // cycle state: completed cycles are colored by their final peak (≥70%
13
+ // green = full plan use, <40% red = wasted headroom), in-progress cycles
14
+ // are colored by PACE (utilization vs elapsed cycle fraction) so a 50%
15
+ // peak halfway through a 7-day cycle reads on-pace green, not amber.
16
+ // Right-most bar is the in-progress cycle, dashed border + transparency.
8
17
  export function PreviousCyclesTrend({
9
18
  windowLabel,
10
19
  cycles,
@@ -51,19 +60,25 @@ export function PreviousCyclesTrend({
51
60
  }}
52
61
  >
53
62
  {cycles.map((c, i) => (
54
- <CycleBar key={i} cycle={c} />
63
+ <CycleBar key={i} cycle={c} windowLabel={windowLabel} />
55
64
  ))}
56
65
  </div>
57
66
  </section>
58
67
  );
59
68
  }
60
69
 
61
- function CycleBar({ cycle }: { cycle: CyclePeak }) {
70
+ function CycleBar({
71
+ cycle,
72
+ windowLabel,
73
+ }: {
74
+ cycle: CyclePeak;
75
+ windowLabel: "5h" | "7d";
76
+ }) {
62
77
  const pct = Math.max(0, Math.min(100, cycle.peakPct));
63
- const color =
64
- pct >= 90 ? "var(--af-danger)" :
65
- pct >= 70 ? "#b58400" :
66
- "var(--af-success)";
78
+ const tone = cycle.current
79
+ ? paceToneForCycle(pct, new Date(cycle.endsAt).getTime(), WINDOW_MS[windowLabel])
80
+ : utilizationTone(pct);
81
+ const color = toneVar(tone);
67
82
  const date = new Date(cycle.endsAt);
68
83
  // Compact "Apr 23" date label; "current" cycle gets "ends Apr 30" instead
69
84
  const label = cycle.current
@@ -1,23 +1,24 @@
1
1
  "use client";
2
2
 
3
- import { useMemo, useState } from "react";
3
+ import { useEffect, useMemo, useState } from "react";
4
4
  import { Maximize2 } from "lucide-react";
5
5
  import type { UsageSnapshot, UsageWindow } from "@/lib/usage-data";
6
+ import { paceLabel, toneVar } from "@/lib/utilization-tone";
6
7
 
7
8
  type SeriesKey = "five_hour" | "seven_day" | "seven_day_sonnet";
8
9
 
9
10
  /**
10
- * Sprint-burndown-style chart for a single usage window.
11
+ * Burndown-style chart for a single usage window.
11
12
  *
12
- * Y-axis: remaining budget (100% at start, 0% when quota is exhausted)
13
+ * Y-axis: remaining budget (100% at start, 0% when quota exhausts)
13
14
  * X-axis: time from window start to reset
14
15
  *
15
16
  * Ideal line: dashed diagonal from (windowStart, 100%) to (resetsAt, 0%)
16
- * — the "sustainable burn" trajectory
17
- * Actual line: solid, plots (100 - utilization) at each snapshot's captured_at
17
+ * — full-utilization trajectory.
18
18
  *
19
- * ABOVE the ideal line = saving budget (on track)
20
- * BELOW the ideal line = burning faster than sustainable (behind schedule)
19
+ * BELOW the ideal line = burning at or above pace (getting plan value)
20
+ * ABOVE the ideal line = under-burning (paying for unused headroom)
21
+ * Far below ideal = will exhaust before reset (throttling risk)
21
22
  */
22
23
  export function UsageChart({
23
24
  snapshots,
@@ -90,6 +91,14 @@ export function UsageChart({
90
91
  predicted: number | null;
91
92
  } | null>(null);
92
93
 
94
+ // SSR can't agree with the client on `Date.now()` — the server renders
95
+ // at request time, the client hydrates milliseconds-to-minutes later.
96
+ // Both depended on `now`, so the "now" cursor + pace label produced
97
+ // a hydration mismatch warning. Render time-dependent UI only after
98
+ // mount; the SSR fragment matches the client's pre-mount fragment.
99
+ const [mounted, setMounted] = useState(false);
100
+ useEffect(() => setMounted(true), []);
101
+
93
102
  if (!computed) {
94
103
  return (
95
104
  <div
@@ -121,14 +130,9 @@ export function UsageChart({
121
130
 
122
131
  const nowIdeal = idealAt(now);
123
132
  const delta = currentRemaining - nowIdeal;
124
- const toneColor =
125
- delta < -10
126
- ? "var(--af-danger)"
127
- : delta < 0
128
- ? "var(--af-warning)"
129
- : "var(--af-success)";
130
- const toneLabel =
131
- delta < -10 ? "behind schedule" : delta < 0 ? "slightly behind" : "on track";
133
+ const pace = paceLabel(delta);
134
+ const toneColor = toneVar(pace.tone);
135
+ const toneLabel = pace.label;
132
136
 
133
137
  const linePath =
134
138
  points.length > 0
@@ -226,9 +230,16 @@ export function UsageChart({
226
230
  remaining
227
231
  </span>
228
232
  </div>
229
- <div style={{ fontSize: 11, color: toneColor, fontWeight: 500 }}>
230
- {toneLabel} ({delta >= 0 ? "+" : ""}
231
- {delta.toFixed(1)}%)
233
+ <div
234
+ suppressHydrationWarning
235
+ style={{ fontSize: 11, color: toneColor, fontWeight: 500 }}
236
+ >
237
+ {mounted && (
238
+ <>
239
+ {toneLabel} ({delta >= 0 ? "+" : ""}
240
+ {delta.toFixed(1)}pp)
241
+ </>
242
+ )}
232
243
  </div>
233
244
  <div
234
245
  suppressHydrationWarning
@@ -338,23 +349,9 @@ export function UsageChart({
338
349
  {formatAxisDatetime(windowEnd)}
339
350
  </text>
340
351
 
341
- {/* Danger (<10% remaining) and caution (10–30%) bands at the bottom */}
342
- <rect
343
- x={padding.left}
344
- y={yScale(10)}
345
- width={plotW}
346
- height={yScale(0) - yScale(10)}
347
- fill="var(--af-danger)"
348
- fillOpacity="0.07"
349
- />
350
- <rect
351
- x={padding.left}
352
- y={yScale(30)}
353
- width={plotW}
354
- height={yScale(10) - yScale(30)}
355
- fill="var(--af-warning)"
356
- fillOpacity="0.05"
357
- />
352
+ {/* No static danger bands. Low-remaining used to be flagged red,
353
+ but in the "high use = good" framing that band is the goal
354
+ zone. Pace label + ideal line carry the signal. */}
358
355
 
359
356
  {/* Area fill under actual line */}
360
357
  <path d={areaPath} fill={colorVar} fillOpacity="0.1" />
@@ -371,8 +368,9 @@ export function UsageChart({
371
368
  strokeDasharray="4 3"
372
369
  />
373
370
 
374
- {/* Current-time vertical marker */}
375
- {now >= windowStart && now <= windowEnd && (
371
+ {/* Current-time vertical marker — only after mount so the SSR
372
+ and client renders agree (Date.now() differs between them). */}
373
+ {mounted && now >= windowStart && now <= windowEnd && (
376
374
  <g>
377
375
  <line
378
376
  x1={xScale(now)}