fleetlens 0.6.4 → 0.7.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 (178) 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 +2 -2
  12. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/app/apps/web/.next/server/app/api/ask/route.js +2 -2
  15. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  16. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +3 -3
  17. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +3 -3
  19. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  20. package/app/apps/web/.next/server/app/api/digest/month-index/route.js +1 -1
  21. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  22. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +3 -3
  23. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  24. package/app/apps/web/.next/server/app/api/digest/week-index/route.js +1 -1
  25. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  26. package/app/apps/web/.next/server/app/api/events/route.js +2 -2
  27. package/app/apps/web/.next/server/app/api/events/route.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  30. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/api/settings/route.js +3 -3
  32. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/day/[date]/page.js +3 -3
  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 +2 -2
  37. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  38. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  39. package/app/apps/web/.next/server/app/digest/[date]/page.js +2 -2
  40. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  41. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  42. package/app/apps/web/.next/server/app/digest/page.js +2 -2
  43. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  44. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  45. package/app/apps/web/.next/server/app/insights/[key]/page.js +2 -2
  46. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  47. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  48. package/app/apps/web/.next/server/app/insights/page.js +2 -2
  49. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  50. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  51. package/app/apps/web/.next/server/app/page.js +3 -3
  52. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  53. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/app/apps/web/.next/server/app/parallelism/page.js +2 -2
  55. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  56. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  57. package/app/apps/web/.next/server/app/projects/[slug]/page.js +3 -3
  58. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  59. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  60. package/app/apps/web/.next/server/app/projects/page.js +3 -3
  61. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  62. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  63. package/app/apps/web/.next/server/app/runs/page.js +2 -2
  64. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  65. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  66. package/app/apps/web/.next/server/app/sessions/[id]/page.js +3 -3
  67. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  68. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  69. package/app/apps/web/.next/server/app/sessions/page.js +3 -3
  70. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  71. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  72. package/app/apps/web/.next/server/app/settings/page.js +2 -2
  73. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  74. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  75. package/app/apps/web/.next/server/app/usage/page.js +2 -2
  76. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  77. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  78. package/app/apps/web/.next/server/chunks/{[externals]__0o43ejh._.js → [externals]__0fpbr8-._.js} +2 -2
  79. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0-vgrh1._.js +1 -1
  80. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0.z48ue._.js +3 -0
  81. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0dctov1._.js +5 -0
  82. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0e8n_x4._.js +1 -1
  83. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0jprdks._.js +2 -2
  84. package/app/apps/web/.next/server/chunks/node_modules_next_036my~r._.js +1 -1
  85. package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ck.78s.js +1 -1
  86. package/app/apps/web/.next/server/chunks/packages_09hmrqx._.js +3 -0
  87. package/app/apps/web/.next/server/chunks/packages_118y1lp._.js +3 -0
  88. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +26 -17
  89. package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_122oe0-.js +3 -0
  90. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04eq6z2._.js +3 -0
  91. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0e.gxk3._.js +3 -0
  92. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0p1x6v2._.js +3 -0
  93. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0r4tks8._.js +1 -1
  94. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rvzdnx._.js +1 -1
  95. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0sp6.jt._.js +3 -0
  96. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0tejjy_._.js +3 -0
  97. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0v.6dx0._.js +3 -0
  98. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +3 -3
  99. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0wwa6gh._.js +1 -1
  100. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0yv-a8z._.js +12 -0
  101. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10~b4bf._.js +12 -0
  102. package/app/apps/web/.next/server/chunks/ssr/_02s1n-x._.js +1 -1
  103. package/app/apps/web/.next/server/chunks/ssr/_0woap-3._.js +1 -1
  104. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  105. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_day_[date]_day-view_tsx_0wjoe1u._.js +1 -1
  106. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_settings_ai-features-form_tsx_01p699p._.js +1 -1
  107. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0ly1xes._.js +1 -1
  108. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0txtsv5._.js +1 -1
  109. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_usage-data_ts_0xtv99n._.js +1 -1
  110. package/app/apps/web/.next/server/chunks/ssr/{node_modules_0i2xw~e._.js → node_modules_0fx6-.x._.js} +2 -2
  111. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
  112. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_10_oegc._.js +3 -0
  113. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  114. package/app/apps/web/.next/server/pages/500.html +1 -1
  115. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  116. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  117. package/app/apps/web/.next/static/chunks/0.3mqbj24kwtc.js +6 -0
  118. package/app/apps/web/.next/static/chunks/07-fq4im3pmjp.js +4 -0
  119. package/app/apps/web/.next/static/chunks/09gdxttgu~.aj.js +14 -0
  120. package/app/apps/web/.next/static/chunks/0n3-prt61k7pr.js +1 -0
  121. package/app/apps/web/.next/static/chunks/{0_7303jr0sf0w.js → 0q2vd~aj.1hpz.js} +3 -3
  122. package/app/apps/web/.next/static/chunks/0qmh5da6gfm56.js +1 -0
  123. package/app/apps/web/.next/static/chunks/{0k9pksi_i.odf.js → 111-bgx08j2nq.js} +1 -1
  124. package/app/apps/web/app/api/ask/route.ts +1 -1
  125. package/app/apps/web/app/api/digest/week/[startDate]/route.ts +2 -1
  126. package/app/apps/web/app/api/settings/route.ts +1 -0
  127. package/app/apps/web/app/insights/[key]/page.tsx +8 -2
  128. package/app/apps/web/app/layout.tsx +10 -7
  129. package/app/apps/web/app/page.tsx +19 -15
  130. package/app/apps/web/app/parallelism/gantt-chart.tsx +7 -18
  131. package/app/apps/web/app/projects/projects-view.tsx +3 -0
  132. package/app/apps/web/app/sessions/[id]/session-view.tsx +168 -41
  133. package/app/apps/web/app/sessions/page.tsx +22 -12
  134. package/app/apps/web/app/sessions/sessions-grid.tsx +82 -9
  135. package/app/apps/web/app/settings/ai-features-form.tsx +20 -1
  136. package/app/apps/web/app/settings/page.tsx +1 -0
  137. package/app/apps/web/app/usage/page.tsx +161 -52
  138. package/app/apps/web/components/agent-badge.tsx +43 -0
  139. package/app/apps/web/components/agent-icon.tsx +38 -0
  140. package/app/apps/web/components/agent-mix-chip.tsx +42 -0
  141. package/app/apps/web/components/{ask-claude.tsx → ask.tsx} +13 -12
  142. package/app/apps/web/components/day-digest.tsx +1 -1
  143. package/app/apps/web/components/live-sessions-widget.tsx +5 -1
  144. package/app/apps/web/components/outcome-pill.tsx +7 -2
  145. package/app/apps/web/components/sidebar.tsx +1 -1
  146. package/app/apps/web/components/week-digest.tsx +2 -0
  147. package/app/apps/web/lib/ai/session-summary.ts +1 -1
  148. package/app/apps/web/lib/data.ts +7 -8
  149. package/app/apps/web/lib/date-range.ts +9 -2
  150. package/app/apps/web/lib/usage-data.ts +24 -1
  151. package/app/apps/web/lib/validate-settings.ts +1 -0
  152. package/app/apps/web/package.json +1 -1
  153. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  154. package/dist/daemon-worker.js +3152 -2355
  155. package/dist/index.js +4418 -3752
  156. package/package.json +1 -1
  157. package/app/apps/web/.next/server/chunks/[externals]__0_xztrf._.js +0 -3
  158. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0455vu3._.js +0 -5
  159. package/app/apps/web/.next/server/chunks/packages_0e7q9u_._.js +0 -3
  160. package/app/apps/web/.next/server/chunks/packages_0n6p2ot._.js +0 -3
  161. package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_0bc7ptm.js +0 -3
  162. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-94ji~._.js +0 -3
  163. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_6.inc._.js +0 -3
  164. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0gio_ck._.js +0 -3
  165. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0jdyefm._.js +0 -12
  166. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ln9jsw._.js +0 -3
  167. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u5d7de._.js +0 -12
  168. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~_8vff._.js +0 -3
  169. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__11v.eqw._.js +0 -3
  170. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0-jvt~a._.js +0 -3
  171. package/app/apps/web/.next/static/chunks/04m3slg_5ph02.js +0 -1
  172. package/app/apps/web/.next/static/chunks/0coa1800xqgfj.js +0 -1
  173. package/app/apps/web/.next/static/chunks/0k1psab.bybh9.js +0 -14
  174. package/app/apps/web/.next/static/chunks/0xfu09fn_358k.js +0 -4
  175. package/app/apps/web/.next/static/chunks/17u2ww8ya5dv1.js +0 -6
  176. /package/app/apps/web/.next/static/{2jcMG-92q2XKei8dN7BMd → qYW0u_NOmV0v7lf7xZc6x}/_buildManifest.js +0 -0
  177. /package/app/apps/web/.next/static/{2jcMG-92q2XKei8dN7BMd → qYW0u_NOmV0v7lf7xZc6x}/_clientMiddlewareManifest.js +0 -0
  178. /package/app/apps/web/.next/static/{2jcMG-92q2XKei8dN7BMd → qYW0u_NOmV0v7lf7xZc6x}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92566,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(64659),s=e.i(63059);let i=(0,e.i(75254).default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var a=e.i(23614),o=e.i(40484);let l={"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"},d={teammate:"<teammate-message>","task-notification":"<task-notification>","local-command-caveat":"<local-command-caveat>","image-attached":"[Image #N]","slash-command":"/command","handoff-prose":"Handoff prose"};function c({digest:e,entries:i,aiEnabled:l,actions:d}){let[u,g]=(0,r.useState)(!1),m=new Date(`${e.key}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"}),b=e.agent_min/60,v=b>=1?`${b.toFixed(1)}h`:`${Math.round(e.agent_min)}m`,j=[...i].sort((e,t)=>Date.parse(t.start_iso)-Date.parse(e.start_iso));return(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,t.jsxs)("header",{style:{marginBottom:28},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.jsx)("span",{children:m}),(0,t.jsx)(a.OutcomePill,{outcome:e.outcome_day,size:"lg"}),(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"·"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[v," agent time · ",e.projects.length," project",1===e.projects.length?"":"s"," · ",e.shipped.length," PR",1===e.shipped.length?"":"s"," shipped",e.concurrency_peak>1&&` \xb7 peak concurrency \xd7${e.concurrency_peak}`]}),d&&(0,t.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:d})]}),e.headline?(0,t.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 8px",maxWidth:820,color:"var(--af-text)"},children:e.headline}):(0,t.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:l?"No narrative yet — click Regenerate.":`Worked ${v} across ${e.projects.length} project${1===e.projects.length?"":"s"}.`}),e.day_signature&&(0,t.jsx)("p",{style:{margin:"0 0 14px",fontSize:14,fontStyle:"italic",color:"var(--af-text-secondary)",maxWidth:820,lineHeight:1.5},children:e.day_signature})]}),!l&&(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)("a",{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see daily narratives."]}),e.day_signals&&(0,t.jsx)(h,{signals:e.day_signals}),(e.what_went_well||e.what_hit_friction)&&(0,t.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,marginBottom:28},children:[(0,t.jsx)(x,{glyph:"✓",color:"#48bb78",text:e.what_went_well,emptyLabel:"(smooth)"}),(0,t.jsx)(x,{glyph:"⚠",color:"#ed8936",text:e.what_hit_friction,emptyLabel:"(no friction)"})]}),e.narrative&&(0,t.jsx)("section",{style:{marginBottom:28,padding:"4px 0",fontSize:15,lineHeight:1.6,color:"var(--af-text)",maxWidth:760},children:e.narrative}),(0,t.jsx)("div",{style:{marginBottom:18},children:(0,t.jsxs)("button",{type:"button",onClick:()=>g(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[u?(0,t.jsx)(n.ChevronDown,{size:12}):(0,t.jsx)(s.ChevronRight,{size:12}),u?"Hide details":"Show more details"]})}),u&&(0,t.jsxs)(t.Fragment,{children:[e.suggestion&&(0,t.jsxs)("section",{style:{borderLeft:"3px solid var(--af-accent)",paddingLeft:16,marginBottom:32},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:6},children:"Tomorrow"}),(0,t.jsx)("div",{style:{fontSize:15,fontWeight:600,marginBottom:4,color:"var(--af-text)"},children:e.suggestion.headline}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.5,maxWidth:760},children:e.suggestion.body})]}),e.projects.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Work breakdown"}),(0,t.jsx)("div",{style:{display:"grid",gap:6},children:e.projects.map(r=>{let n=e.shipped.filter(e=>e.project===r.display_name);return(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 56px 72px",gap:12,alignItems:"center",padding:"6px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13},children:[(0,t.jsx)("span",{title:r.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.display_name}),(0,t.jsx)(f,{pct:r.share_pct}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:[r.share_pct.toFixed(0),"%"]}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:n.length>0?`${n.length} PR${1===n.length?"":"s"}`:"—"})]},r.name)})})]}),e.shipped.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Shipped"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:e.shipped.map((e,r)=>(0,t.jsxs)("li",{style:{padding:"6px 0",fontSize:13,borderBottom:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"baseline"},children:[(0,t.jsx)("span",{style:{color:"#48bb78",fontSize:12},children:"✓"}),(0,t.jsx)("span",{style:{flex:1},children:e.title}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:e.project})]},r))})]}),j.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsxs)(p,{children:["Sessions · ",j.length]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:j.map(e=>(0,t.jsx)(y,{entry:e},e.session_id))})]}),e.top_goal_categories.length>0&&(0,t.jsxs)("section",{style:{marginTop:40,paddingTop:20,borderTop:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",marginBottom:6},children:"Goal mix"}),(0,t.jsx)(o.GoalBar,{goals:e.top_goal_categories,total:e.agent_min})]})]})]})}function p({children:e}){return(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:e})}function x({glyph:e,color:r,text:n,emptyLabel:s}){return(0,t.jsxs)("div",{style:{fontSize:14,lineHeight:1.55,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsx)("span",{style:{fontSize:16,color:r,lineHeight:1.4,flexShrink:0},children:e}),n?(0,t.jsx)("span",{style:{color:"var(--af-text)"},children:n}):(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontStyle:"italic"},children:s})]})}function f({pct:e}){return(0,t.jsx)("div",{style:{height:6,background:"var(--af-border-subtle)",borderRadius:99,overflow:"hidden"},children:(0,t.jsx)("div",{style:{width:`${Math.min(100,Math.max(0,e))}%`,height:"100%",background:"var(--af-accent)",transition:"width 0.2s"}})})}function h({signals:e}){let r=null!==e.dominant_shape,n=Object.keys(e.shape_distribution).length>0,s=e.user_authored_subagents_used.length>0||Object.keys(e.shape_distribution).length>0,i=e.skills_loaded.filter(e=>"stock"===e.origin),a=e.skills_loaded.filter(e=>"user"===e.origin),o=e.prompt_frames.filter(e=>"claude-feature"===e.origin),c=e.prompt_frames.filter(e=>"personal-habit"===e.origin),p=e.comm_style,x=p.verbosity_distribution.short+p.verbosity_distribution.medium+p.verbosity_distribution.long+p.verbosity_distribution.very_long,f=p.steering.interrupts+p.steering.frustrated+p.steering.dissatisfied;return r||n||0!==i.length||0!==a.length||0!==e.user_authored_subagents_used.length||0!==o.length||0!==c.length||0!==x||0!==p.external_refs.length||0!==f||0!==e.brainstorm_warmup_session_count||0!==e.todo_ops_total||e.plan_mode_used?(0,t.jsxs)("section",{style:{marginBottom:28,padding:"14px 16px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:"How today worked"}),r&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:999,fontSize:12,fontWeight:600,background:"var(--af-accent-subtle)",color:"var(--af-accent)"},children:l[e.dominant_shape]??e.dominant_shape}),n&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:Object.entries(e.shape_distribution).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${t} ${e}`).join(" · ")})]}),s&&e.user_authored_subagents_used.length>0&&(0,t.jsx)(u,{label:"Your subagents",children:e.user_authored_subagents_used.slice(0,4).map(e=>(0,t.jsxs)(g,{title:e.sample_prompt_preview,children:[e.type,e.count>1?` \xd7${e.count}`:""]},e.type))}),(i.length>0||a.length>0)&&(0,t.jsxs)(u,{label:"Skills loaded",children:[a.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"user",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill)),i.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"stock",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill))]}),(o.length>0||c.length>0)&&(0,t.jsxs)(u,{label:"Prompt frames",children:[c.map(e=>(0,t.jsxs)(g,{tone:"user",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame)),o.map(e=>(0,t.jsxs)(g,{tone:"stock",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame))]}),(x>0||p.external_refs.length>0||f>0)&&(0,t.jsxs)(u,{label:"Comm style",children:[x>0&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:[p.verbosity_distribution.short&&`${p.verbosity_distribution.short} short`,p.verbosity_distribution.medium&&`${p.verbosity_distribution.medium} med`,p.verbosity_distribution.long&&`${p.verbosity_distribution.long} long`,p.verbosity_distribution.very_long&&`${p.verbosity_distribution.very_long} v.long`].filter(Boolean).join(" · ")}),p.external_refs.length>0&&(0,t.jsxs)(g,{children:[p.external_refs.length," external ref",1===p.external_refs.length?"":"s"]}),p.steering.interrupts>0&&(0,t.jsxs)(g,{children:[p.steering.interrupts," interrupts"]}),p.steering.sessions_with_mid_run_redirect>0&&(0,t.jsxs)(g,{children:[p.steering.sessions_with_mid_run_redirect," mid-run redirect",1===p.steering.sessions_with_mid_run_redirect?"":"s"]})]}),(e.brainstorm_warmup_session_count>0||e.todo_ops_total>0||e.plan_mode_used)&&(0,t.jsxs)(u,{label:"Discipline",children:[e.brainstorm_warmup_session_count>0&&(0,t.jsxs)(g,{children:["brainstorm warmup ×",e.brainstorm_warmup_session_count]}),e.todo_ops_total>0&&(0,t.jsxs)(g,{children:[e.todo_ops_total," TodoWrite ops"]}),e.plan_mode_used&&(0,t.jsx)(g,{tone:"user",children:"Plan Mode used"})]})]}):null}function u({label:e,children:r}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",padding:"4px 0",fontSize:12},children:[(0,t.jsx)("span",{style:{minWidth:100,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,t.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",flex:1},children:r})]})}function g({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:11,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({entry:e}){let r=new Date(e.start_iso).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),n=Math.round(e.numbers.active_min),s=e.project.split("/").filter(Boolean).slice(-1)[0]??e.project,i=e.enrichment.outcome,o=e.enrichment.brief_summary;return(0,t.jsxs)("a",{href:`/sessions/${e.session_id}`,style:{display:"block",padding:"8px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13,color:"var(--af-text)",textDecoration:"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",width:48},children:r}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",minWidth:110,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),(0,t.jsxs)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",width:40,textAlign:"right"},children:[n,"m"]}),i&&(0,t.jsx)(a.OutcomePill,{outcome:i,size:"sm",label:"text",agent:e.agent})]}),o&&(0,t.jsx)("div",{style:{marginTop:3,marginLeft:58,fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.45,maxWidth:820},children:o})]})}function m({initial:e,entries:n,date:s,aiEnabled:i}){let[a,o]=(0,r.useState)(e),[l,d]=(0,r.useState)("idle"),[p,x]=(0,r.useState)(""),f=(0,r.useCallback)(async(e=!1)=>{d("streaming"),x("Starting...");let t=`/api/digest/day/${s}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){d("error"),x(`Error ${r.status}`);return}let n=r.body.getReader(),i=new TextDecoder,a="";for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=(a+=i.decode(t,{stream:!0})).split("\n\n");for(let e of(a=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)x(e.text);else if("entry"===e.type)x(`Enriching ${e.index}/${e.total}${e.cost_usd?` \xb7 $${e.cost_usd.toFixed(4)}`:""}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3),r=(e.bytes/1024).toFixed(1);x(`Claude composing… ${e.bytes.toLocaleString()} chars (${r} KB \xb7 ${t}s)`)}else if("digest"===e.type)o(e.digest),x("Rendering...");else if("saved"===e.type)x("Saved.");else if("error"===e.type){d("error"),x(e.message);return}}catch{}}}d("done"),x("")},[s]),h="streaming"===l,u=!!a?.headline,g=(0,r.useMemo)(()=>0!==n.length&&n.every(e=>"skipped_trivial"===e.enrichment.status),[n]),y=0===n.length,b=null;return(y||g||(b=y||g||u?(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",alignItems:"center",gap:6},children:["✓ Up to date",(0,t.jsx)("button",{onClick:()=>f(!0),disabled:h,title:"Re-roll the narrative without re-enriching capsules",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"...":"Re-roll"})]}):(0,t.jsx)("button",{onClick:()=>f(!1),disabled:h,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:h?"default":"pointer",fontSize:11,fontWeight:600,opacity:h?.6:1},children:h?"Generating...":a?"Generate (catch up)":"Generate digest"}),p&&(b=(0,t.jsxs)(t.Fragment,{children:[b,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:p})]}))),a)?(0,t.jsx)(c,{digest:a,entries:n,aiEnabled:i,actions:b}):(0,t.jsxs)(t.Fragment,{children:[b&&(0,t.jsx)("div",{style:{display:"flex",gap:10,padding:"14px 40px 0",alignItems:"center",flexWrap:"wrap"},children:b}),y?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"No entries on this day."}):g?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"💤 Warm-up only — every session was under a minute. No narrative needed."}):(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-secondary)",fontSize:13},children:"No digest generated yet — click Generate above."})]})}var b=e.i(22016);e.i(74472);var v=e.i(98572),j=e.i(56324),w=e.i(41783);let S=["rgba(45, 212, 191, 0.75)","rgba(167, 139, 250, 0.75)","rgba(248, 113, 113, 0.75)","rgba(52, 211, 153, 0.75)","rgba(251, 191, 36, 0.75)","rgba(236, 72, 153, 0.75)","rgba(34, 211, 238, 0.75)","rgba(168, 85, 247, 0.75)","rgba(244, 114, 82, 0.75)","rgba(96, 165, 250, 0.75)"];function k(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return S[Math.abs(t)%S.length]}function z(e){return k((0,v.canonicalProjectName)(e.projectName))}function _(e){return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function M(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function W({gantt:e,bursts:n=[],sessionEntries:s={}}){let i,[o,l]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[p,x]=(0,r.useState)(null),[f,h]=(0,r.useState)(!1),[u,g]=(0,r.useState)(null),[y,m]=(0,r.useState)(!1),S=(0,r.useRef)(null),T=p??d,I=(0,r.useMemo)(()=>{if(null===T)return null;let e=n[T];return e?new Set(e.sessionIds):null},[T,n]),R=(0,r.useMemo)(()=>{let t=new Map;for(let r of e.sessions){let e=(0,v.canonicalProjectName)(r.projectName),n=t.get(e);n?n.count++:t.set(e,{name:(0,j.prettyProjectName)(e),color:k(e),count:1})}return Array.from(t.values()).sort((e,t)=>t.count-e.count)},[e.sessions]),{rangeStartMs:B,rangeEndMs:D,hourMarks:P}=(0,r.useMemo)(()=>{if(0===e.sessions.length)return{rangeStartMs:e.dayStartMs,rangeEndMs:e.dayEndMs,hourMarks:[]};let t=1/0,r=-1/0;for(let n of e.sessions)for(let e of n.segments)e.startMs<t&&(t=e.startMs),e.endMs>r&&(r=e.endMs);let n=r+18e5,s=new Date(t-18e5);s.setMinutes(0,0,0);let i=new Date(n);i.setMinutes(0,0,0),i.setHours(i.getHours()+1);let a=Math.max(s.getTime(),e.dayStartMs),o=Math.min(i.getTime(),e.dayEndMs),l=[],d=new Date(a);for(d.setMinutes(0,0,0),d.getTime()<a&&d.setHours(d.getHours()+1);d.getTime()<=o;)l.push(d.getTime()),d.setHours(d.getHours()+1);return{rangeStartMs:a,rangeEndMs:o,hourMarks:l}},[e]),H=D-B,A=Math.max(700,Math.ceil(H/36e5*80)),F=33*e.sessions.length+3+8,E=e=>(e-B)/H*A,N="var(--af-surface)",L=y?n:n.slice(0,3),O=n.length-L.length;return(0,t.jsxs)(t.Fragment,{children:[n.length>0&&(0,t.jsxs)("div",{className:"af-panel",style:{marginBottom:16},children:[(0,t.jsxs)("div",{className:"af-panel-header",children:[(0,t.jsx)("span",{children:"Concurrency"}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontWeight:400},children:"periods when ≥2 agents were actively working at once"}),(0,t.jsxs)("button",{type:"button",onClick:()=>h(!0),"aria-label":"How concurrency is detected",style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"3px 9px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:100,fontSize:10,color:"var(--af-text-tertiary)",cursor:"pointer",fontWeight:500},children:[(0,t.jsx)("span",{style:{fontSize:11,lineHeight:1},children:"ⓘ"}),"How this is measured"]})]}),(0,t.jsxs)("div",{children:[L.map((r,n)=>{let s=p===n,i=d===n,a=r.projectDirs.map(t=>{let r=e.sessions.find(e=>e.projectDir===t);return r?(0,j.prettyProjectName)(r.projectName):t}).map(e=>{let t=e.split("/").filter(Boolean);return t.length>2?"…/"+t.slice(-2).join("/"):e});return(0,t.jsxs)("div",{onMouseEnter:()=>c(n),onMouseLeave:()=>c(null),onClick:()=>g(n),style:{display:"grid",gridTemplateColumns:"auto auto auto 1fr auto",gap:14,padding:"10px 18px",fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",cursor:"pointer",background:s||i?"var(--af-surface-hover)":"transparent",alignItems:"center",transition:"background 0.12s"},title:"Open burst detail",children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:110},children:[M(r.startMs),"–",M(r.endMs)]}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:10,fontWeight:700,color:"white",background:r.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)",minWidth:28,justifyContent:"center"},children:["×",r.peak]}),r.crossProject?(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"cross-project"}):(0,t.jsx)("span",{}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.join(", "),children:a.join(" · ")}),(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:60,textAlign:"right"},children:(0,j.formatDuration)(r.endMs-r.startMs)})]},`burst-row-${n}`)}),n.length>3&&(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),style:{width:"100%",padding:"10px 18px",background:"transparent",border:"none",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,textAlign:"center"},children:y?"Show fewer (first 3) ↑":`Show all ${n.length} bursts (+${O} more) ↓`})]})]}),(0,t.jsxs)("div",{className:"af-panel",style:{overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 16px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",flexWrap:"wrap"},children:[R.map(e=>{let r=e.name.split("/").filter(Boolean),n=r.length>2?"…/"+r.slice(-2).join("/"):e.name;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"default"},title:`${e.name} — ${e.count} session${1===e.count?"":"s"} on this day`,children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:e.color,flexShrink:0}}),(0,t.jsx)("span",{style:{maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),(0,t.jsxs)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:["(",e.count,")"]})]},e.name)}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,marginLeft:8,color:"var(--af-text-tertiary)",cursor:"default"},title:"Idle gap — the session was open but the agent was not actively working (gap > 3 minutes between events)",children:[(0,t.jsx)("span",{style:{width:16,height:8,borderRadius:2,background:"repeating-linear-gradient(45deg, var(--af-surface-hover), var(--af-surface-hover) 2px, var(--af-border-subtle) 2px, var(--af-border-subtle) 4px)",flexShrink:0}}),"idle"]})]}),(0,t.jsxs)("div",{ref:S,style:{overflow:"auto",maxHeight:"calc(100vh - 240px)",position:"relative"},onMouseLeave:()=>l(null),children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`220px ${A}px`,gridTemplateRows:`50px ${F}px`,width:220+A},children:[(0,t.jsxs)("div",{style:{position:"sticky",top:0,left:0,zIndex:3,background:N,borderBottom:"1px solid var(--af-border-subtle)",borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{height:24,display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 10px",fontSize:9,color:"var(--af-text-tertiary)",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600},children:n.length>0?"Concurrency":""}),(0,t.jsx)("div",{style:{height:26}})]}),(0,t.jsxs)("div",{style:{position:"sticky",top:0,zIndex:2,background:N,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("svg",{width:A,height:24,style:{display:"block"},children:n.map((e,r)=>{let n=E(e.startMs),s=E(e.endMs)-n,i=Math.max(s,26),a=s<26?n+s/2-13:n,o=T===r,l=null!==T&&!o,x=e.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)";return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:a,y:4,width:i,height:14,fill:x,rx:4,opacity:l?.3:1,stroke:p===r?"var(--af-text)":d===r?"var(--af-text-secondary)":"none",strokeWidth:p===r?1.5:1,style:{cursor:"pointer",transition:"opacity 0.12s"},onMouseEnter:()=>c(r),onMouseLeave:()=>c(null),onClick:()=>g(r),children:(0,t.jsx)("title",{children:`\xd7${e.peak} ${e.crossProject?"cross-project":"same-project"} \xb7 ${M(e.startMs)}–${M(e.endMs)} \xb7 ${(0,j.formatDuration)(e.endMs-e.startMs)} — click for detail`})}),(0,t.jsxs)("text",{x:a+i/2,y:15,textAnchor:"middle",fontSize:9,fontWeight:700,fill:"white",opacity:l?.3:1,style:{pointerEvents:"none"},children:["×",e.peak]})]},`burst-${r}`)})}),(0,t.jsx)("svg",{width:A,height:26,style:{display:"block"},children:P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("text",{x:r,y:18,textAnchor:"middle",fontSize:10,fill:n?"var(--af-text-secondary)":"var(--af-text-tertiary)",fontWeight:n?600:400,children:M(e)},e)})})]}),(0,t.jsx)("div",{style:{position:"sticky",left:0,zIndex:1,background:N,borderRight:"1px solid var(--af-border-subtle)"},children:(0,t.jsx)("div",{style:{paddingTop:3},children:e.sessions.map((e,r)=>{let n=z(e),s=e.firstUserPreview?_(e.firstUserPreview).slice(0,45):(0,j.prettyProjectName)(e.projectName),i=(0,j.prettyProjectName)(e.projectName),a=null!==I&&!I.has(e.id);return(0,t.jsxs)("div",{style:{height:30,marginBottom:3,display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 6px",background:r%2==1?"var(--af-surface-hover)":"transparent",opacity:a?.3:1,transition:"opacity 0.12s"},children:[(0,t.jsx)("span",{style:{width:6,height:6,borderRadius:2,background:n,flexShrink:0}}),(0,t.jsx)(w.AgentIcon,{agent:e.agent,size:11}),(0,t.jsx)(b.default,{href:`/sessions/${e.id}`,style:{fontSize:10.5,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.2,textDecoration:"none"},title:`${_(e.firstUserPreview??"")} — ${i}`,children:s})]},`label-${e.id}-${r}`)})})}),(0,t.jsx)("div",{children:(0,t.jsxs)("svg",{width:A,height:F,style:{display:"block"},children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("pattern",{id:"gantt-idle-stripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,t.jsx)("rect",{width:"6",height:"6",fill:"var(--af-surface-hover)"}),(0,t.jsx)("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"var(--af-border-subtle)",strokeWidth:"1.5"})]})}),P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("line",{x1:r,y1:0,x2:r,y2:F,stroke:"var(--af-border-subtle)",strokeWidth:n?.8:.4,strokeDasharray:n?void 0:"2 4"},e)}),e.sessions.map((e,r)=>{let n=33*r+3,s=z(e),i=null!==I&&!I.has(e.id);return(0,t.jsxs)("g",{opacity:i?.25:1,style:{transition:"opacity 0.12s"},children:[r%2==1&&(0,t.jsx)("rect",{x:0,y:n,width:A,height:30,fill:"var(--af-surface-hover)",opacity:.25}),e.segments.map((r,i)=>{let a=E(r.startMs),o=Math.max(E(r.endMs)-a,4);return(0,t.jsx)("rect",{x:a,y:n+5,width:o,height:20,fill:s,rx:3,style:{cursor:"pointer"},onMouseEnter:t=>{let r=t.currentTarget.closest("svg").getBoundingClientRect();l({session:e,x:t.clientX-r.left+220,y:n+30+24+26+4})}},i)}),e.segments.length>1&&e.segments.slice(0,-1).map((r,s)=>{let i=e.segments[s+1],a=E(r.endMs),o=E(i.startMs);return o-a<4?null:(0,t.jsx)("rect",{x:a+1,y:n+7,width:o-a-2,height:16,fill:"url(#gantt-idle-stripes)",rx:2,opacity:.7},`idle-${s}`)}),(0,t.jsxs)("text",{x:Math.min(E(e.endMs)+8,A-100),y:n+15+3.5,fontSize:9,fill:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",children:[(0,j.formatDuration)(e.activeMs)," · ",M(e.startMs),"–",M(e.endMs)]})]},`row-${e.id}-${r}`)})]})})]}),o&&(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(8,Math.min(o.x,220+A-340)),top:Math.min(o.y,50+F-100),zIndex:50,background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"10px 14px",fontSize:11,color:"var(--af-text)",pointerEvents:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:340,lineHeight:1.45},children:[(i=s[o.session.id])?i.outcome?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:i.outcome,size:"sm",agent:o.session.agent})}):"done"!==i.enrichmentStatus&&"skipped_trivial"!==i.enrichmentStatus?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:null,pending:!0,sessionId:o.session.id,localDay:i.localDay,size:"sm",agent:o.session.agent})}):null:null,(0,t.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:s[o.session.id]?.briefSummary||_(o.session.firstUserPreview??"").slice(0,100)||(0,j.prettyProjectName)(o.session.projectName)}),(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",marginBottom:6,fontFamily:"var(--font-mono)"},children:[(0,j.prettyProjectName)(o.session.projectName),o.session.model&&` \xb7 ${o.session.model}`]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:10,color:"var(--af-text-secondary)"},children:[(0,t.jsxs)("span",{children:["Active: ",(0,t.jsx)("strong",{children:(0,j.formatDuration)(o.session.activeMs)})]}),(0,t.jsxs)("span",{children:["Segments: ",o.session.segments.length]}),(0,t.jsxs)("span",{children:["Range: ",M(o.session.startMs),"–",M(o.session.endMs)]}),(0,t.jsxs)("span",{children:["Tokens:"," ",(0,j.formatTokens)(o.session.totalUsage.input+o.session.totalUsage.cacheRead+o.session.totalUsage.cacheWrite),"/",(0,j.formatTokens)(o.session.totalUsage.output)]})]})]})]})]}),f&&(0,t.jsx)($,{onClose:()=>h(!1)}),null!==u&&n[u]&&(0,t.jsx)(C,{burst:n[u],gantt:e,sessionEntries:s,onClose:()=>g(null),onShowInTimeline:()=>{g(null),null!==u&&(e=>{x(t=>t===e?null:e);let t=n[e],r=S.current;if(!t||!r)return;let s=220+(E(t.startMs)+E(t.endMs))/2-r.clientWidth/2;r.scrollTo({left:Math.max(0,s),behavior:"smooth"})})(u)}})]})}function $({onClose:e}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"concurrency-modal-title",onClick:e,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,maxWidth:560,width:"100%",maxHeight:"85vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.3)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{id:"concurrency-modal-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"How concurrency is measured"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{padding:"18px 22px",fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,t.jsxs)("p",{style:{margin:"0 0 14px"},children:["A ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"concurrency burst"})," ","is a window of time when two or more Claude Code sessions were actively working in parallel. The goal is to surface moments when you were running a multi-agent fleet — not every accidental tab overlap."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:'1. What counts as "active"'}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Each session's events are split into"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"active segments"})," — stretches of time where no gap between consecutive events exceeds"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"3 minutes"}),". Any longer gap (walked away, laptop closed, thinking) splits the session into separate segments."]}),(0,t.jsx)("p",{style:{margin:"0 0 6px",fontSize:12,color:"var(--af-text-tertiary)"},children:'This is the same definition used for the "active time" metric on the dashboard, so numbers stay consistent.'}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"2. Detecting overlap"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["A sweep-line walks every segment start/end across all sessions. Whenever the active count is ≥2, that stretch becomes a raw overlap. The ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"peak"})," ","reported on each burst is the maximum active count reached anywhere inside it."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"3. Cleaning up noise"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:"Raw overlaps are noisy — a typical day produces dozens of sub-minute artifacts from switching between sessions. Two rules collapse them into human-readable bursts:"}),(0,t.jsxs)("ul",{style:{margin:"6px 0 0 0",paddingLeft:22},children:[(0,t.jsxs)("li",{style:{marginBottom:4},children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Drop under 1 minute"})," — overlaps shorter than that are almost always tab-switch artifacts, not real parallel work."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Merge within 10 minutes"})," — two overlaps separated by less than 10 minutes of idle time fuse into a single burst. A morning of back-and-forth agent work becomes one burst, not forty."]})]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"4. Same-project vs cross-project"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Bursts are colored by whether the involved sessions span more than one project directory."," ",(0,t.jsx)("span",{style:{color:"rgba(167, 139, 250, 1)",fontWeight:600},children:"Purple = cross-project"})," ","— different repos running at once, usually genuine fleet work."," ",(0,t.jsx)("span",{style:{color:"rgba(45, 212, 191, 1)",fontWeight:600},children:"Teal = same-project"})," ","— multiple sessions in one repo, usually context-switching inside a single task."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Why bursts, not runs"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:'An earlier version reported every raw overlap as a separate "parallel run". On a busy day that produced 40–80 entries, most of them seconds long, most of them meaningless. Bursts are the unit humans actually think in: "this morning I was running 3 agents at once for about 20 minutes."'})]})]})})}function C({burst:e,gantt:n,sessionEntries:s,onClose:i,onShowInTimeline:o}){(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);let[l,d]=(0,r.useState)(null),c=(0,r.useRef)(new Map),p=(0,r.useMemo)(()=>{let e=new Map;for(let t of n.sessions)e.set(t.id,t);return e},[n]),x=e.sessionIds.map(e=>p.get(e)).filter(e=>!!e);x.sort((e,t)=>e.startMs-t.startMs);let f=e=>{d(e);let t=c.current.get(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},h=Math.min(e.startMs,...x.map(e=>e.startMs)),u=Math.max(e.endMs,...x.map(e=>e.endMs)),g=h-9e5,y=u+9e5,m=y-g,v=22+(25*x.length-3)+6,w=e=>(e-g)/m*510,S=[];{let e=new Date(g);for(e.setMinutes(0,0,0),e.getTime()<g&&e.setHours(e.getHours()+1);e.getTime()<=y;)S.push(e.getTime()),e.setHours(e.getHours()+1)}let k=w(e.startMs),W=w(e.endMs),$=e.endMs-e.startMs;return(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"burst-detail-title",onClick:i,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,width:"min(720px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.4)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"16px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,color:"white",background:e.crossProject?"rgba(167, 139, 250, 0.95)":"rgba(45, 212, 191, 0.95)"},children:["×",e.peak," peak"]}),e.crossProject&&(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"cross-project"})]}),(0,t.jsxs)("h2",{id:"burst-detail-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[M(e.startMs),"–",M(e.endMs)]}),(0,t.jsx)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,j.formatDuration)($)}),(0,t.jsxs)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)"},children:["· ",x.length," session",1===x.length?"":"s"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:o,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,whiteSpace:"nowrap"},title:"Pin this burst on the main timeline and close",children:"Show in timeline →"}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:24,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{overflow:"auto",padding:"18px 22px"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8,fontWeight:600},children:"Timeline (shaded = burst window)"}),(0,t.jsx)("div",{style:{background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 10px",overflow:"auto"},children:(0,t.jsxs)("svg",{width:534,height:v,style:{display:"block"},children:[x.map((e,r)=>{let n=22+25*r+11,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{onClick:()=>f(e.id),style:{cursor:"pointer"},children:[(0,t.jsx)("title",{children:`Track ${r+1} — click to focus in list below`}),(0,t.jsx)("circle",{cx:12,cy:n,r:9,fill:i?s:"var(--af-surface-elevated)",stroke:s,strokeWidth:i?2:1.5}),(0,t.jsx)("text",{x:12,y:n+3.5,textAnchor:"middle",fontSize:10,fontWeight:700,fill:i?"#fff":"var(--af-text)",style:{pointerEvents:"none"},children:r+1})]},`num-${e.id}`)}),(0,t.jsxs)("g",{transform:"translate(24, 0)",children:[(0,t.jsx)("rect",{x:k,y:0,width:Math.max(W-k,2),height:v,fill:e.crossProject?"rgba(167, 139, 250, 0.14)":"rgba(45, 212, 191, 0.14)"}),(0,t.jsx)("line",{x1:k,x2:k,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),(0,t.jsx)("line",{x1:W,x2:W,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),S.map(e=>{let r=w(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:r,x2:r,y1:22,y2:v,stroke:"var(--af-border-subtle)",strokeWidth:.5,strokeDasharray:"2 3"}),(0,t.jsx)("text",{x:r,y:16,textAnchor:"middle",fontSize:9,fill:"var(--af-text-tertiary)",children:M(e)})]},`mini-hm-${e}`)}),x.map((e,r)=>{let n=22+25*r,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:0,y:n,width:510,height:22,fill:i?"rgba(255,255,255,0.05)":"transparent",onClick:()=>f(e.id),style:{cursor:"pointer"}}),e.segments.map((e,r)=>{let a=w(e.startMs),o=Math.max(w(e.endMs)-a,2);return(0,t.jsx)("rect",{x:a,y:n+3,width:o,height:16,fill:s,rx:2,stroke:i?"var(--af-text)":"none",strokeWidth:+!!i,style:{pointerEvents:"none"}},`mini-seg-${r}`)})]},`mini-row-${e.id}`)})]})]})}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",margin:"18px 0 8px",fontWeight:600},children:"Sessions in this burst"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:x.map((r,n)=>{let i,o,d,p=z(r),x=(t=>{let r=0;for(let n of t.segments){let t=Math.max(n.startMs,e.startMs),s=Math.min(n.endMs,e.endMs);s>t&&(r+=s-t)}return r})(r),f=$>0?Math.round(x/$*100):0,h=l===r.id;return(0,t.jsx)(b.default,{href:`/sessions/${r.id}`,ref:e=>{e?c.current.set(r.id,e):c.current.delete(r.id)},style:{display:"block",padding:"11px 14px",background:h?"var(--af-surface-hover)":"var(--af-surface)",border:h?"1px solid var(--af-text-tertiary)":"1px solid var(--af-border-subtle)",borderLeft:`3px solid ${p}`,borderRadius:8,textDecoration:"none",color:"var(--af-text)",fontSize:12,lineHeight:1.45,transition:"background 0.15s, border-color 0.15s",boxShadow:h?`0 0 0 2px ${p}`:"none"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"50%",background:h?p:"transparent",border:`1.5px solid ${p}`,color:h?"#fff":"var(--af-text)",fontSize:10,fontWeight:700,flexShrink:0,marginTop:2},"aria-label":`Track ${n+1}`,children:n+1}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:(0,j.prettyProjectName)(r.projectName),children:(o=(i=(0,j.prettyProjectName)(r.projectName)).split("/").filter(Boolean)).length>2?"…/"+o.slice(-2).join("/"):i}),(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:_(r.firstUserPreview??""),children:_(r.firstUserPreview??"")||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),r.lastAgentPreview&&(0,t.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontStyle:"italic"},title:_(r.lastAgentPreview),children:["↳ ",_(r.lastAgentPreview)]})]}),(0,t.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right",whiteSpace:"nowrap",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[(d=s[r.id],d?.outcome?(0,t.jsx)(a.OutcomePill,{outcome:d.outcome,size:"sm",label:"text",agent:r.agent}):null),(0,t.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[(0,j.formatDuration)(x)," ",(0,t.jsxs)("span",{style:{opacity:.6},children:["(",f,"%)"]})]}),(0,t.jsx)("div",{style:{fontSize:9,marginTop:2},children:"in burst"})]})]})},`burst-session-${r.id}`)})})]})]})})}function T({open:e,onClose:n,rows:s,aiEnabled:i}){let[a,o]=(0,r.useState)(new Set),[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]);let x=async()=>{if(0===a.size)return;d(!0);let e=Array.from(a).sort().reverse();try{for(let t of e){let e=`/api/digest/day/${t}${c?"?force=1":""}`,r=await fetch(e,{method:"POST"});if(r.body){let e=r.body.getReader();for(;!(await e.read()).done;);}}}finally{d(!1),o(new Set)}};return e?(0,t.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:200,display:"flex",justifyContent:"flex-end"},onClick:n,children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"min(440px, 100%)",height:"100%",background:"var(--af-surface-elevated)",borderLeft:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",boxShadow:"-12px 0 32px rgba(0,0,0,0.25)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:15,fontWeight:700,margin:0},children:"Backfill digests"}),(0,t.jsx)("p",{style:{fontSize:11,color:"var(--af-text-tertiary)",margin:"2px 0 0"},children:"Each selected day enqueues a job. You can close this drawer."})]}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,cursor:"pointer"},children:"×"})]}),!i&&(0,t.jsx)("div",{style:{padding:12,margin:18,background:"rgba(237,137,54,0.1)",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:"AI features are off — only deterministic digests will be written. Enable AI in Settings to generate narratives."}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,padding:"10px 18px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap",fontSize:11},children:[(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"pending"===e.status).map(e=>e.date))),children:"Select pending"}),(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"empty"!==e.status).map(e=>e.date))),children:"Select all with entries"}),(0,t.jsx)(I,{onClick:()=>o(new Set),children:"Clear"}),(0,t.jsxs)("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"checkbox",checked:c,onChange:e=>p(e.target.checked)}),"force regen"]})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto"},children:s.map(e=>(0,t.jsxs)("label",{style:{display:"grid",gridTemplateColumns:"auto 110px 80px 1fr",gap:10,alignItems:"center",padding:"8px 18px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:12,cursor:"empty"===e.status?"default":"pointer",opacity:"empty"===e.status?.5:1},children:[(0,t.jsx)("input",{type:"checkbox",disabled:"empty"===e.status,checked:a.has(e.date),onChange:()=>{var t;return t=e.date,void o(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsx)("span",{children:e.day_label}),(0,t.jsx)("span",{style:{fontSize:10,color:"generated"===e.status?"#48bb78":"pending"===e.status?"#ed8936":"var(--af-text-tertiary)"},children:"generated"===e.status?"✓ ready":"pending"===e.status?"• pending":"—"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right"},children:[e.entry_count>0?`${e.entry_count} sess`:"",e.pr_count>0?` \xb7 ${e.pr_count} PR`:""]})]},e.date))}),(0,t.jsxs)("footer",{style:{padding:"12px 18px",borderTop:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"center"},children:[(0,t.jsxs)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",flex:1},children:[a.size," day",1===a.size?"":"s"," selected"]}),(0,t.jsx)("button",{type:"button",onClick:n,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:12,cursor:"pointer"},children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:x,disabled:l||0===a.size,style:{padding:"6px 14px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:l||0===a.size?"default":"pointer",opacity:l||0===a.size?.6:1},children:l?`Enqueueing… (${a.size})`:`Generate ${a.size}`})]})]})}):null}function I({onClick:e,children:r}){return(0,t.jsx)("button",{type:"button",onClick:e,style:{padding:"3px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:r})}var R=e.i(18566);function B(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.round(e/6e4);if(t<60)return`${t}m`;let r=Math.floor(t/60),n=t%60;return n?`${r}h ${n}m`:`${r}h`}function D({date:e,today:n,prevDay:s,nextDay:i,dayStats:a,hrefForDate:o=e=>`/day/${e}`}){let l,d,c,p,x,f,h=(0,R.useRouter)(),[u,g]=(0,r.useState)(!1),[y,m]=(0,r.useMemo)(()=>{let[t,r]=e.split("-").map(Number);return[t,r]},[e]),[v,j]=(0,r.useState)(y),[w,S]=(0,r.useState)(m),[k,z]=(0,r.useState)(null),[_,M]=(0,r.useState)(null),W=(0,r.useMemo)(()=>{let e=new Map;for(let t of a)e.set(t.date,t);return e},[a]),$=(0,r.useMemo)(()=>{let e=new Date(v,w-1,1).getDay(),t=new Date(v,w,0).getDate(),r=[];for(let t=0;t<e;t++)r.push(null);for(let e=1;e<=t;e++){let t=String(w).padStart(2,"0"),n=String(e).padStart(2,"0");r.push(`${v}-${t}-${n}`)}return r},[v,w]),C=(0,r.useMemo)(()=>{let e=0;for(let t of a)t.airTimeMs>e&&(e=t.airTimeMs);return e},[a]),T=new Date(v,w-1).toLocaleString(void 0,{month:"long",year:"numeric"}),I=e=>{let t=w+e,r=v;t<1&&(t=12,r--),t>12&&(t=1,r++),S(t),j(r)};return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",position:"relative"},children:[s?(0,t.jsx)(b.default,{href:o(s),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"←"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"←"}),(0,t.jsx)("button",{type:"button",onClick:()=>{j(y),S(m),g(e=>!e)},style:{padding:"5px 12px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:u?"var(--af-accent-subtle)":"transparent",color:u?"var(--af-accent)":"var(--af-text)",cursor:"pointer",fontWeight:500,minWidth:120,textAlign:"center"},children:e}),i?(0,t.jsx)(b.default,{href:o(i),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"→"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)(b.default,{href:o(n),style:{padding:"5px 12px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:e===n?"var(--af-accent)":"var(--af-text-secondary)",background:e===n?"var(--af-accent-subtle)":"transparent",fontWeight:500},children:"Today"}),u&&(0,t.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 8px)",left:0,zIndex:60,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:10,padding:"12px 14px",boxShadow:"0 8px 28px rgba(0,0,0,0.18)",minWidth:300},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,t.jsx)("button",{type:"button",onClick:()=>I(-1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"‹"}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)"},children:T}),(0,t.jsx)("button",{type:"button",onClick:()=>I(1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"›"})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(e=>(0,t.jsx)("div",{style:{textAlign:"center",fontSize:9,color:"var(--af-text-tertiary)",fontWeight:600,padding:"2px 0"},children:e},e))}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:$.map((r,s)=>{if(!r)return(0,t.jsx)("div",{},`blank-${s}`);let i=W.get(r),a=i?.airTimeMs??0,l=i?.burstCount??0,d=r===e,c=r===n,p=r>n,x=a>0&&C>0?Math.min(1,a/C):0,f=parseInt(r.split("-")[2],10);return(0,t.jsxs)("button",{type:"button",onClick:()=>{g(!1),h.push(o(r))},disabled:p,onMouseEnter:e=>{if(p)return;let t=e.currentTarget.getBoundingClientRect(),n=e.currentTarget.offsetParent?.getBoundingClientRect()??t;z(r),M({x:t.left-n.left+t.width/2,y:t.bottom-n.top+6})},onMouseLeave:()=>{z(null),M(null)},style:{position:"relative",width:40,height:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,border:d?"2px solid var(--af-accent)":c?"1px solid var(--af-text-tertiary)":"1px solid transparent",borderRadius:6,background:x>0?`rgba(45, 212, 191, ${.08+.35*x})`:"transparent",color:p?"var(--af-text-tertiary)":d?"var(--af-accent)":"var(--af-text)",cursor:p?"not-allowed":"pointer",fontSize:11,fontWeight:d?700:400,fontFamily:"var(--font-mono)",padding:0,opacity:p?.4:1},children:[(0,t.jsx)("span",{style:{lineHeight:1},children:f}),a>0&&(0,t.jsx)("span",{style:{fontSize:8,color:d?"var(--af-accent)":"var(--af-text-tertiary)",lineHeight:1,fontWeight:600,marginTop:2},children:B(a)}),l>0&&(0,t.jsx)("span",{style:{position:"absolute",top:3,right:3,width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)",boxShadow:"0 0 0 1px var(--af-surface)"}})]},r)})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:10,paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontSize:9,color:"var(--af-text-tertiary)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{children:"less"}),(0,t.jsx)("div",{style:{display:"flex",gap:2},children:[0,.15,.3,.5,.8].map((e,r)=>(0,t.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:0===e?"var(--af-border-subtle)":`rgba(45, 212, 191, ${.08+.35*e})`}},r))}),(0,t.jsx)("span",{children:"more active"})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},title:"Days with at least one concurrency burst",children:[(0,t.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)"}}),"parallel"]})]}),k&&_&&(l=W.get(k),d=l?.sessions??0,c=l?.airTimeMs??0,p=l?.parallelMs??0,x=l?.burstCount??0,f=l?.peakConcurrency??0,(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(10,Math.min(_.x-110,290)),top:_.y,width:220,pointerEvents:"none",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"9px 12px",boxShadow:"0 6px 22px rgba(0,0,0,0.22)",fontSize:11,color:"var(--af-text)",zIndex:65,lineHeight:1.5},children:[(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:11,marginBottom:4},children:k}),0===d&&0===c&&0===p?(0,t.jsx)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"no activity"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P,{label:"sessions",value:String(d)}),(0,t.jsx)(P,{label:"active time",value:c>0?B(c):"—"}),p>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px dashed var(--af-border-subtle)"}}),(0,t.jsx)(P,{label:"parallel time",value:B(p)}),(0,t.jsx)(P,{label:"peak concurrency",value:`\xd7${f}`,accent:!0}),(0,t.jsx)(P,{label:"bursts",value:String(x)})]})]})]}))]})]})}function P({label:e,value:r,accent:n}){return(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--af-text-secondary)",fontSize:10},children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("strong",{style:{color:n?"rgba(167, 139, 250, 1)":"var(--af-text)"},children:r})]})}function H({label:e,defaultOpen:i=!0,children:a}){let[o,l]=(0,r.useState)(i);return(0,t.jsxs)("div",{style:{borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),style:{width:"100%",padding:"12px 40px",background:"transparent",border:"none",textAlign:"left",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:11,fontWeight:700,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[o?(0,t.jsx)(n.ChevronDown,{size:13}):(0,t.jsx)(s.ChevronRight,{size:13}),e]}),o&&(0,t.jsx)("div",{children:a})]})}e.s(["DayView",0,function({date:e,today:n,prev:s,next:a,initial:o,entries:l,aiEnabled:d,gantt:c,bursts:p,sessionEntries:x,backfillRows:f,dayStats:h}){let[u,g]=(0,r.useState)(!1),y=l.length>0&&l.every(e=>"skipped_trivial"===e.enrichment.status),b=l.length>0&&!y,v=c.sessions.length>0,j=new Date(`${e}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=f.filter(e=>"pending"===e.status).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("nav",{style:{padding:"14px 40px",display:"flex",gap:12,fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",alignItems:"center",flexWrap:"wrap"},children:[(0,t.jsx)(D,{date:e,today:n,prevDay:s,nextDay:a??void 0,dayStats:h}),(0,t.jsxs)("button",{type:"button",onClick:()=>g(!0),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},title:"Open the backfill multi-select drawer",children:[(0,t.jsx)(i,{size:12}),"Backfill digests",w>0&&(0,t.jsx)("span",{style:{fontSize:10,color:"#ed8936",fontWeight:700},children:w})]})]}),b||v?(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[b&&(0,t.jsx)(H,{label:"Narrative",defaultOpen:!0,children:(0,t.jsx)(m,{initial:o,entries:l,date:e,aiEnabled:d})}),v&&(0,t.jsx)(H,{label:"Timeline & concurrency",defaultOpen:!0,children:(0,t.jsx)("div",{style:{padding:"8px 40px 40px"},children:(0,t.jsx)(W,{gantt:c,bursts:p,sessionEntries:x})})})]}):(0,t.jsxs)("div",{style:{padding:"60px 40px",textAlign:"center",color:"var(--af-text-secondary)"},children:[(0,t.jsx)("div",{style:{fontSize:14,marginBottom:6},children:j}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-tertiary)"},children:"No Claude Code activity on this day."})]}),(0,t.jsx)(T,{open:u,onClose:()=>g(!1),rows:f,aiEnabled:d})]})}],92566)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},55898,78360,e=>{"use strict";var t=e.i(18050),r=e.i(71645),o=e.i(75254);let a=(0,o.default)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var i=e.i(25063);let s=(0,o.default)("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);e.s(["DataTable",0,function({rows:e,columns:o,getRowKey:n,onRowClick:l,defaultSortKey:c,defaultSortDir:d="desc"}){let[p,u]=(0,r.useState)(c??null),[f,h]=(0,r.useState)(d),x=(0,r.useMemo)(()=>{if(!p)return e;let t=o.find(e=>e.key===p);if(!t||!t.sortValue)return e;let r="asc"===f?1:-1;return[...e].sort((e,o)=>{let a=t.sortValue(e),i=t.sortValue(o);return"number"==typeof a&&"number"==typeof i?(a-i)*r:String(a).localeCompare(String(i))*r})},[e,o,p,f]);return(0,t.jsx)("div",{style:{overflowX:"auto",border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12,color:"var(--af-text)"},children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:o.map(e=>{let r=p===e.key,o=!1!==e.sortable&&!!e.sortValue;return(0,t.jsx)("th",{onClick:()=>{!1!==e.sortable&&e.sortValue&&(p===e.key?h(e=>"asc"===e?"desc":"asc"):(u(e.key),h("desc")))},style:{textAlign:e.align??"left",fontSize:10,fontWeight:600,color:r?"var(--af-accent)":"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"10px 12px",borderBottom:"1px solid var(--af-border-subtle)",cursor:o?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",width:e.width,background:"var(--af-surface)",position:"sticky",top:0},children:(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,verticalAlign:"middle"},children:[e.header,o&&(0,t.jsx)("span",{style:{display:"inline-flex",opacity:r?1:.35},children:r?"asc"===f?(0,t.jsx)(a,{size:10}):(0,t.jsx)(i.ArrowDown,{size:10}):(0,t.jsx)(s,{size:10})})]})},e.key)})})}),(0,t.jsxs)("tbody",{children:[x.map(e=>(0,t.jsx)("tr",{onClick:()=>l?.(e),style:{cursor:l?"pointer":"default",borderBottom:"1px solid var(--af-border-subtle)",transition:"background 0.1s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)"},onMouseLeave:e=>{e.currentTarget.style.background=""},children:o.map(r=>(0,t.jsx)("td",{style:{padding:"10px 12px",textAlign:r.align??"left",whiteSpace:"right"===r.align?"nowrap":void 0,verticalAlign:"top"},children:r.render(e)},r.key))},n(e))),0===x.length&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:o.length,style:{padding:"32px 16px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No rows to display."})})]})]})})}],55898);let n=(0,o.default)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),l=(0,o.default)("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var c=e.i(86619);function d({active:e,onClick:r,label:o,icon:a,rightEdge:i}){return(0,t.jsxs)("button",{type:"button",onClick:r,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"6px 12px",fontSize:11,fontWeight:500,background:e?"var(--af-accent-subtle)":"transparent",color:e?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:i?"none":"1px solid var(--af-border-subtle)",cursor:"pointer",letterSpacing:"0.02em"},children:[a,o]})}e.s(["useViewToggle",0,function(e,r="cards"){let[o,a,i]=(0,c.usePersistentBoolean)(e,"table"===r);return{mode:o?"table":"cards",toggle:(0,t.jsxs)("div",{style:{display:"inline-flex",border:"1px solid var(--af-border-subtle)",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(d,{active:!o,onClick:()=>a(!1),label:"Cards",icon:(0,t.jsx)(n,{size:12})}),(0,t.jsx)(d,{active:o,onClick:()=>a(!0),label:"Table",icon:(0,t.jsx)(l,{size:12}),rightEdge:!0})]}),hydrated:i}}],78360)},57983,e=>{"use strict";var t=e.i(18050),r=e.i(22016),o=e.i(18566),a=e.i(56324),i=e.i(55898),s=e.i(78360),n=e.i(23614);function l({days:e,size:r="sm"}){return(0,t.jsx)("div",{style:{display:"inline-flex",gap:3,alignItems:"center"},children:e.map(e=>e.outcome?(0,t.jsx)(n.OutcomePill,{outcome:e.outcome,size:r,label:"icon"},e.date):(0,t.jsx)("span",{title:`${e.date} — no entries`,style:{display:"inline-block",width:"sm"===r?14:18,height:"sm"===r?14:18,borderRadius:99,background:"var(--af-border-subtle)",opacity:.5}},e.date))})}let c=[{key:"name",header:"Project",sortValue:e=>e.project.projectName,render:e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[(0,a.prettyProjectName)(e.project.projectName),e.project.worktreeCount>0&&(0,t.jsx)(p,{count:e.project.worktreeCount})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.project.projectName,children:e.project.projectName})]})},{key:"recent",header:"Recent (7d)",sortable:!1,render:e=>(0,t.jsx)(l,{days:e.recentDays})},{key:"sessions",header:"Sessions",sortValue:e=>e.project.metrics.sessionCount,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.sessionCount.toLocaleString()})},{key:"turns",header:"Turns",sortValue:e=>e.project.metrics.totalTurns,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.totalTurns.toLocaleString()})},{key:"tools",header:"Tool calls",sortValue:e=>e.project.metrics.totalToolCalls,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.totalToolCalls.toLocaleString()})},{key:"airtime",header:"Agent time",sortValue:e=>e.project.metrics.totalAirTimeMs,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,a.formatDuration)(e.project.metrics.totalAirTimeMs)})},{key:"tokens",header:"Tokens",sortValue:e=>e.project.metrics.totalTokens.input+e.project.metrics.totalTokens.output+e.project.metrics.totalTokens.cacheRead+e.project.metrics.totalTokens.cacheWrite,align:"right",render:e=>{let r=e.project.metrics.totalTokens.input+e.project.metrics.totalTokens.output+e.project.metrics.totalTokens.cacheRead+e.project.metrics.totalTokens.cacheWrite;return(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,a.formatTokens)(r)})}},{key:"lastActive",header:"Last active",sortValue:e=>e.project.lastActiveMs??0,align:"right",render:e=>(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.lastActiveMs?(0,a.formatRelative)(new Date(e.project.lastActiveMs).toISOString()):"—"})}];function d({row:e}){let o=e.project,i=o.metrics.totalTokens.input+o.metrics.totalTokens.output+o.metrics.totalTokens.cacheRead+o.metrics.totalTokens.cacheWrite,s=e.recentDays.some(e=>null!==e.outcome);return(0,t.jsxs)(r.default,{href:`/projects/${encodeURIComponent(o.projectDir)}`,className:"af-card",style:{display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsxs)("div",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:(0,a.prettyProjectName)(o.projectName)}),o.worktreeCount>0&&(0,t.jsx)(p,{count:o.worktreeCount})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:o.projectName}),s&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:10,color:"var(--af-text-tertiary)"},children:[(0,t.jsx)("span",{children:"recent:"}),(0,t.jsx)(l,{days:e.recentDays})]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:6,marginTop:6,fontSize:11,color:"var(--af-text-secondary)"},children:[(0,t.jsx)(u,{label:"Sessions",value:String(o.metrics.sessionCount)}),(0,t.jsx)(u,{label:"Turns",value:String(o.metrics.totalTurns)}),(0,t.jsx)(u,{label:"Tools",value:String(o.metrics.totalToolCalls)}),(0,t.jsx)(u,{label:"Agent time",value:(0,a.formatDuration)(o.metrics.totalAirTimeMs)}),(0,t.jsx)(u,{label:"Tokens",value:(0,a.formatTokens)(i)}),(0,t.jsx)(u,{label:"Last",value:o.lastActiveMs?(0,a.formatRelative)(new Date(o.lastActiveMs).toISOString()):"—"})]})]})}function p({count:e}){return(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"2px 7px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},title:`${e} git worktree${1===e?"":"s"} rolled up into this project`,children:["+",e," wt"]})}function u({label:e,value:r}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:e}),(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",marginTop:2},suppressHydrationWarning:!0,children:r})]})}e.s(["ProjectsView",0,function({rows:e}){let r=(0,o.useRouter)(),{mode:a,toggle:n}=(0,s.useViewToggle)("cclens:projects:view");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:14},children:n}),"table"===a?(0,t.jsx)(i.DataTable,{rows:e,getRowKey:e=>e.project.projectDir,onRowClick:e=>r.push(`/projects/${encodeURIComponent(e.project.projectDir)}`),defaultSortKey:"lastActive",defaultSortDir:"desc",columns:c}):(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:14},children:e.map(e=>(0,t.jsx)(d,{row:e},e.project.projectDir))})]})}],57983)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},55898,78360,e=>{"use strict";var t=e.i(18050),r=e.i(71645),o=e.i(75254);let a=(0,o.default)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var n=e.i(25063);let i=(0,o.default)("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);e.s(["DataTable",0,function({rows:e,columns:o,getRowKey:s,onRowClick:l,defaultSortKey:c,defaultSortDir:d="desc"}){let[p,u]=(0,r.useState)(c??null),[f,h]=(0,r.useState)(d),x=(0,r.useMemo)(()=>{if(!p)return e;let t=o.find(e=>e.key===p);if(!t||!t.sortValue)return e;let r="asc"===f?1:-1;return[...e].sort((e,o)=>{let a=t.sortValue(e),n=t.sortValue(o);return"number"==typeof a&&"number"==typeof n?(a-n)*r:String(a).localeCompare(String(n))*r})},[e,o,p,f]);return(0,t.jsx)("div",{style:{overflowX:"auto",border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12,color:"var(--af-text)"},children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:o.map(e=>{let r=p===e.key,o=!1!==e.sortable&&!!e.sortValue;return(0,t.jsx)("th",{onClick:()=>{!1!==e.sortable&&e.sortValue&&(p===e.key?h(e=>"asc"===e?"desc":"asc"):(u(e.key),h("desc")))},style:{textAlign:e.align??"left",fontSize:10,fontWeight:600,color:r?"var(--af-accent)":"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"10px 12px",borderBottom:"1px solid var(--af-border-subtle)",cursor:o?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",width:e.width,background:"var(--af-surface)",position:"sticky",top:0},children:(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,verticalAlign:"middle"},children:[e.header,o&&(0,t.jsx)("span",{style:{display:"inline-flex",opacity:r?1:.35},children:r?"asc"===f?(0,t.jsx)(a,{size:10}):(0,t.jsx)(n.ArrowDown,{size:10}):(0,t.jsx)(i,{size:10})})]})},e.key)})})}),(0,t.jsxs)("tbody",{children:[x.map(e=>(0,t.jsx)("tr",{onClick:()=>l?.(e),style:{cursor:l?"pointer":"default",borderBottom:"1px solid var(--af-border-subtle)",transition:"background 0.1s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)"},onMouseLeave:e=>{e.currentTarget.style.background=""},children:o.map(r=>(0,t.jsx)("td",{style:{padding:"10px 12px",textAlign:r.align??"left",whiteSpace:"right"===r.align?"nowrap":void 0,verticalAlign:"top"},children:r.render(e)},r.key))},s(e))),0===x.length&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:o.length,style:{padding:"32px 16px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No rows to display."})})]})]})})}],55898);let s=(0,o.default)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),l=(0,o.default)("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var c=e.i(86619);function d({active:e,onClick:r,label:o,icon:a,rightEdge:n}){return(0,t.jsxs)("button",{type:"button",onClick:r,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"6px 12px",fontSize:11,fontWeight:500,background:e?"var(--af-accent-subtle)":"transparent",color:e?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:n?"none":"1px solid var(--af-border-subtle)",cursor:"pointer",letterSpacing:"0.02em"},children:[a,o]})}e.s(["useViewToggle",0,function(e,r="cards"){let[o,a,n]=(0,c.usePersistentBoolean)(e,"table"===r);return{mode:o?"table":"cards",toggle:(0,t.jsxs)("div",{style:{display:"inline-flex",border:"1px solid var(--af-border-subtle)",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(d,{active:!o,onClick:()=>a(!1),label:"Cards",icon:(0,t.jsx)(s,{size:12})}),(0,t.jsx)(d,{active:o,onClick:()=>a(!0),label:"Table",icon:(0,t.jsx)(l,{size:12}),rightEdge:!0})]}),hydrated:n}}],78360)},57983,e=>{"use strict";var t=e.i(18050),r=e.i(22016),o=e.i(18566),a=e.i(56324),n=e.i(55898),i=e.i(78360),s=e.i(23614);function l({days:e,size:r="sm"}){return(0,t.jsx)("div",{style:{display:"inline-flex",gap:3,alignItems:"center"},children:e.map(e=>e.outcome?(0,t.jsx)(s.OutcomePill,{outcome:e.outcome,size:r,label:"icon"},e.date):(0,t.jsx)("span",{title:`${e.date} — no entries`,style:{display:"inline-block",width:"sm"===r?14:18,height:"sm"===r?14:18,borderRadius:99,background:"var(--af-border-subtle)",opacity:.5}},e.date))})}e.i(74472);var c=e.i(33815);function d({perAgent:e}){return e.length<2?null:(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:10,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",whiteSpace:"nowrap"},title:"Sessions split by source agent",children:e.map((e,r)=>{let o=(0,c.getAgentMetadata)(e.agent),a=o?.shortLabel??e.agent,n=o?.accentColor??"inherit";return(0,t.jsxs)("span",{children:[r>0&&(0,t.jsx)("span",{style:{margin:"0 4px",opacity:.5},children:"·"}),(0,t.jsx)("span",{style:{color:n,fontWeight:600},children:e.sessions})," ",a]},e.agent)})})}let p=[{key:"name",header:"Project",sortValue:e=>e.project.projectName,render:e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},children:[(0,a.prettyProjectName)(e.project.projectName),e.project.worktreeCount>0&&(0,t.jsx)(f,{count:e.project.worktreeCount}),(0,t.jsx)(d,{perAgent:e.project.perAgent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.project.projectName,children:e.project.projectName})]})},{key:"recent",header:"Recent (7d)",sortable:!1,render:e=>(0,t.jsx)(l,{days:e.recentDays})},{key:"sessions",header:"Sessions",sortValue:e=>e.project.metrics.sessionCount,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.sessionCount.toLocaleString()})},{key:"turns",header:"Turns",sortValue:e=>e.project.metrics.totalTurns,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.totalTurns.toLocaleString()})},{key:"tools",header:"Tool calls",sortValue:e=>e.project.metrics.totalToolCalls,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.metrics.totalToolCalls.toLocaleString()})},{key:"airtime",header:"Agent time",sortValue:e=>e.project.metrics.totalAirTimeMs,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,a.formatDuration)(e.project.metrics.totalAirTimeMs)})},{key:"tokens",header:"Tokens",sortValue:e=>e.project.metrics.totalTokens.input+e.project.metrics.totalTokens.output+e.project.metrics.totalTokens.cacheRead+e.project.metrics.totalTokens.cacheWrite,align:"right",render:e=>{let r=e.project.metrics.totalTokens.input+e.project.metrics.totalTokens.output+e.project.metrics.totalTokens.cacheRead+e.project.metrics.totalTokens.cacheWrite;return(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,a.formatTokens)(r)})}},{key:"lastActive",header:"Last active",sortValue:e=>e.project.lastActiveMs??0,align:"right",render:e=>(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.project.lastActiveMs?(0,a.formatRelative)(new Date(e.project.lastActiveMs).toISOString()):"—"})}];function u({row:e}){let o=e.project,n=o.metrics.totalTokens.input+o.metrics.totalTokens.output+o.metrics.totalTokens.cacheRead+o.metrics.totalTokens.cacheWrite,i=e.recentDays.some(e=>null!==e.outcome);return(0,t.jsxs)(r.default,{href:`/projects/${encodeURIComponent(o.projectDir)}`,className:"af-card",style:{display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsxs)("div",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:(0,a.prettyProjectName)(o.projectName)}),o.worktreeCount>0&&(0,t.jsx)(f,{count:o.worktreeCount}),(0,t.jsx)(d,{perAgent:o.perAgent})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:o.projectName}),i&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:10,color:"var(--af-text-tertiary)"},children:[(0,t.jsx)("span",{children:"recent:"}),(0,t.jsx)(l,{days:e.recentDays})]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:6,marginTop:6,fontSize:11,color:"var(--af-text-secondary)"},children:[(0,t.jsx)(h,{label:"Sessions",value:String(o.metrics.sessionCount)}),(0,t.jsx)(h,{label:"Turns",value:String(o.metrics.totalTurns)}),(0,t.jsx)(h,{label:"Tools",value:String(o.metrics.totalToolCalls)}),(0,t.jsx)(h,{label:"Agent time",value:(0,a.formatDuration)(o.metrics.totalAirTimeMs)}),(0,t.jsx)(h,{label:"Tokens",value:(0,a.formatTokens)(n)}),(0,t.jsx)(h,{label:"Last",value:o.lastActiveMs?(0,a.formatRelative)(new Date(o.lastActiveMs).toISOString()):"—"})]})]})}function f({count:e}){return(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"2px 7px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},title:`${e} git worktree${1===e?"":"s"} rolled up into this project`,children:["+",e," wt"]})}function h({label:e,value:r}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:e}),(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",marginTop:2},suppressHydrationWarning:!0,children:r})]})}e.s(["ProjectsView",0,function({rows:e}){let r=(0,o.useRouter)(),{mode:a,toggle:s}=(0,i.useViewToggle)("cclens:projects:view");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:14},children:s}),"table"===a?(0,t.jsx)(n.DataTable,{rows:e,getRowKey:e=>e.project.projectDir,onRowClick:e=>r.push(`/projects/${encodeURIComponent(e.project.projectDir)}`),defaultSortKey:"lastActive",defaultSortDir:"desc",columns:p}):(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:14},children:e.map(e=>(0,t.jsx)(u,{row:e},e.project.projectDir))})]})}],57983)}]);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Ask Claude about a session.
2
+ * Ask an LLM about a session.
3
3
  *
4
4
  * POST /api/ask
5
5
  * { sessionId: string, question: string, model?: "haiku" | "sonnet" | "opus" }
@@ -39,7 +39,8 @@ export async function GET(_req: Request, ctx: Params) {
39
39
 
40
40
  const isCurrent = monday === currentWeekMonday();
41
41
  if (isCurrent) {
42
- const cached = getCurrentWeekDigestFromCache(monday, Date.now());
42
+ const cached =
43
+ getCurrentWeekDigestFromCache(monday, Date.now()) ?? readWeekDigest(monday);
43
44
  if (cached) {
44
45
  return new Response(JSON.stringify(cached), {
45
46
  status: 200, headers: { "content-type": "application/json" },
@@ -34,6 +34,7 @@ export async function PUT(req: Request) {
34
34
  ...current.ai_features,
35
35
  ...(update.enabled !== undefined ? { enabled: update.enabled } : {}),
36
36
  ...(update.autoBackfillLastWeek !== undefined ? { autoBackfillLastWeek: update.autoBackfillLastWeek } : {}),
37
+ ...(update.autoBackfillYesterday !== undefined ? { autoBackfillYesterday: update.autoBackfillYesterday } : {}),
37
38
  },
38
39
  });
39
40
  return NextResponse.json({ ok: true });
@@ -23,8 +23,14 @@ export default async function SavedInsightPage({
23
23
  const weekMatch = WEEK_KEY.exec(key);
24
24
  if (weekMatch) {
25
25
  const monday = weekMatch[1]!;
26
- const cached = monday === currentWeekMonday()
27
- ? getCurrentWeekDigestFromCache(monday, Date.now())
26
+ // Current-week digests live in an in-memory TTL cache by default. When
27
+ // the user explicitly forces generation we ALSO persist to disk
28
+ // (digest-week-pipeline) so the result survives across Next.js route
29
+ // bundles — fall back to disk here so the page actually reads what
30
+ // they paid the LLM to produce.
31
+ const isCurrent = monday === currentWeekMonday();
32
+ const cached = isCurrent
33
+ ? (getCurrentWeekDigestFromCache(monday, Date.now()) ?? readWeekDigest(monday))
28
34
  : readWeekDigest(monday);
29
35
 
30
36
  const prev = shiftMonday(monday, -7);
@@ -8,7 +8,8 @@ import {
8
8
  type LiveEntrySummary,
9
9
  } from "@/components/live-sessions-widget";
10
10
  import { JobQueueWidget } from "@/components/job-queue-widget";
11
- import { listProjects, listSessions, walkJsonlFiles } from "@claude-lens/parser/fs";
11
+ import { listProjects, walkJsonlFiles } from "@claude-lens/parser/fs";
12
+ import { listSessions } from "@/lib/data";
12
13
  import { latestUsageSnapshot } from "@/lib/usage-data";
13
14
  import { buildEntriesIndex } from "@/lib/entries-index";
14
15
  import pkg from "../package.json" with { type: "json" };
@@ -16,21 +17,22 @@ import "./globals.css";
16
17
 
17
18
  export const metadata: Metadata = {
18
19
  title: "Fleetlens",
19
- description: "Claude Code fleet analytics — local-only dashboard for sessions and agent fleets.",
20
+ description: "Multi-agent fleet analytics — local-only dashboard for Claude Code, Codex, and other coding-agent sessions.",
20
21
  };
21
22
 
22
23
  export const dynamic = "force-dynamic";
23
24
 
24
25
  export default async function RootLayout({ children }: { children: React.ReactNode }) {
25
- const [projects, allFiles, recentSessions, entriesIndex] = await Promise.all([
26
+ const [projects, allFiles, allSessions, entriesIndex] = await Promise.all([
26
27
  listProjects(),
27
28
  walkJsonlFiles(),
28
- // Only need the newest-mtime slice — the widget filters to the 45s
29
- // live window client-side.
30
- listSessions({ limit: 20 }),
29
+ // Pull from every registered agent source. The widget filters to the
30
+ // 45s live window client-side, so the slice is on freshness, not count.
31
+ listSessions(),
31
32
  buildEntriesIndex(),
32
33
  ]);
33
- const totalSessions = allFiles.length;
34
+ const recentSessions = allSessions.slice(0, 20);
35
+ const totalSessions = allSessions.length;
34
36
  const currentUsage = latestUsageSnapshot();
35
37
 
36
38
  // Project to the minimal shape the widget needs so we don't ship
@@ -45,6 +47,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
45
47
  lastTimestamp: s.lastTimestamp,
46
48
  teamName: s.teamName,
47
49
  agentName: s.agentName,
50
+ agent: s.agent,
48
51
  }));
49
52
 
50
53
  const liveEntrySummaries: Record<string, LiveEntrySummary> = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dashboard home — high-level metrics across all Claude Code sessions.
2
+ * Dashboard home — high-level metrics across every observed agent.
3
3
  *
4
4
  * Everything here is server-rendered from @claude-lens/parser/fs, then
5
5
  * passed down to small interactive client components (heatmap, chart).
@@ -7,6 +7,8 @@
7
7
 
8
8
  import {
9
9
  groupByProject,
10
+ type AgentKind,
11
+ agentMetadata,
10
12
  type SessionMeta,
11
13
  } from "@claude-lens/parser";
12
14
  import { DashboardView } from "@/components/dashboard-view";
@@ -110,19 +112,21 @@ export default async function DashboardHome({
110
112
  </h1>
111
113
  <p style={{ fontSize: 13, color: "var(--af-text-secondary)", marginTop: 4 }}>
112
114
  {sessions.length} of {allSessions.length} session
113
- {allSessions.length === 1 ? "" : "s"}, read from{" "}
114
- <code
115
- style={{
116
- fontFamily: "var(--font-mono)",
117
- fontSize: 11,
118
- background: "var(--af-border-subtle)",
119
- padding: "1px 6px",
120
- borderRadius: 4,
121
- }}
122
- >
123
- ~/.claude/projects
124
- </code>
125
- .
115
+ {allSessions.length === 1 ? "" : "s"} across{" "}
116
+ {(() => {
117
+ const counts = new Map<AgentKind, number>();
118
+ for (const s of allSessions) {
119
+ const k = (s.agent ?? "claude-code") as AgentKind;
120
+ counts.set(k, (counts.get(k) ?? 0) + 1);
121
+ }
122
+ const parts = agentMetadata
123
+ .map((m) => {
124
+ const n = counts.get(m.kind) ?? 0;
125
+ return n > 0 ? `${n} ${m.displayName}` : null;
126
+ })
127
+ .filter((s): s is string => s !== null);
128
+ return parts.length ? parts.join(" + ") : "no observed agents yet";
129
+ })()}.
126
130
  </p>
127
131
  </div>
128
132
  <DateRangeFilter current={range} />
@@ -246,7 +250,7 @@ export default async function DashboardHome({
246
250
  </div>
247
251
  <div>
248
252
  {recentSessions.length === 0 ? (
249
- <div className="af-empty">No sessions found in ~/.claude/projects</div>
253
+ <div className="af-empty">No sessions found from any registered agent source.</div>
250
254
  ) : (
251
255
  recentSessions.map((s) => (
252
256
  <Link
@@ -10,7 +10,8 @@ import {
10
10
  } from "@claude-lens/parser";
11
11
  import type { DayOutcome, EntryEnrichmentStatus } from "@claude-lens/entries";
12
12
  import { formatDuration, formatTokens, prettyProjectName } from "@/lib/format";
13
- import { OutcomePill, OUTCOME_STYLES } from "@/components/outcome-pill";
13
+ import { OutcomePill } from "@/components/outcome-pill";
14
+ import { AgentIcon } from "@/components/agent-icon";
14
15
 
15
16
  export type SessionEntrySummary = {
16
17
  outcome: DayOutcome | null;
@@ -643,21 +644,8 @@ export function GanttChart({
643
644
  flexShrink: 0,
644
645
  }}
645
646
  />
646
- {(() => {
647
- const sum = sessionEntries[session.id];
648
- if (sum?.outcome) {
649
- return (
650
- <span
651
- title={OUTCOME_STYLES[sum.outcome]?.label ?? sum.outcome}
652
- style={{ fontSize: 11, lineHeight: 1, flexShrink: 0 }}
653
- aria-hidden
654
- >
655
- {OUTCOME_STYLES[sum.outcome]?.icon ?? ""}
656
- </span>
657
- );
658
- }
659
- return null;
660
- })()}
647
+ <AgentIcon agent={session.agent} size={11} />
648
+
661
649
  <Link
662
650
  href={`/sessions/${session.id}`}
663
651
  style={{
@@ -841,7 +829,7 @@ export function GanttChart({
841
829
  if (sum.outcome) {
842
830
  return (
843
831
  <div style={{ marginBottom: 6 }}>
844
- <OutcomePill outcome={sum.outcome} size="sm" />
832
+ <OutcomePill outcome={sum.outcome} size="sm" agent={hover.session.agent} />
845
833
  </div>
846
834
  );
847
835
  }
@@ -854,6 +842,7 @@ export function GanttChart({
854
842
  sessionId={hover.session.id}
855
843
  localDay={sum.localDay}
856
844
  size="sm"
845
+ agent={hover.session.agent}
857
846
  />
858
847
  </div>
859
848
  );
@@ -1761,7 +1750,7 @@ function BurstDetailModal({
1761
1750
  {(() => {
1762
1751
  const sum = sessionEntries[s.id];
1763
1752
  if (sum?.outcome) {
1764
- return <OutcomePill outcome={sum.outcome} size="sm" label="text" />;
1753
+ return <OutcomePill outcome={sum.outcome} size="sm" label="text" agent={s.agent} />;
1765
1754
  }
1766
1755
  return null;
1767
1756
  })()}
@@ -8,6 +8,7 @@ import { formatDuration, formatRelative, formatTokens, prettyProjectName } from
8
8
  import { DataTable, type Column } from "@/components/data-table";
9
9
  import { useViewToggle } from "@/components/view-toggle";
10
10
  import { OutcomeMixRow } from "@/components/outcome-mix-row";
11
+ import { AgentMixChip } from "@/components/agent-mix-chip";
11
12
 
12
13
  export type ProjectRow = {
13
14
  project: ProjectRollup;
@@ -63,6 +64,7 @@ const projectTableColumns: Column<ProjectRow>[] = [
63
64
  >
64
65
  {prettyProjectName(r.project.projectName)}
65
66
  {r.project.worktreeCount > 0 && <WorktreeBadge count={r.project.worktreeCount} />}
67
+ <AgentMixChip perAgent={r.project.perAgent} />
66
68
  </div>
67
69
  <div
68
70
  style={{
@@ -203,6 +205,7 @@ function ProjectCard({ row }: { row: ProjectRow }) {
203
205
  {prettyProjectName(p.projectName)}
204
206
  </span>
205
207
  {p.worktreeCount > 0 && <WorktreeBadge count={p.worktreeCount} />}
208
+ <AgentMixChip perAgent={p.perAgent} />
206
209
  </div>
207
210
  <div
208
211
  style={{ fontSize: 11, color: "var(--af-text-tertiary)", fontFamily: "var(--font-mono)" }}