fleetlens 0.6.3 → 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.
- package/app/apps/web/.next/BUILD_ID +1 -1
- package/app/apps/web/.next/build-manifest.json +3 -3
- package/app/apps/web/.next/prerender-manifest.json +3 -3
- package/app/apps/web/.next/server/app/_global-error.html +1 -1
- package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_not-found/page.js +2 -2
- package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/api/ask/route.js +2 -2
- package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +3 -3
- package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +3 -3
- package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month-index/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +3 -3
- package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week-index/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/events/route.js +2 -2
- package/app/apps/web/.next/server/app/api/events/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/route.js +3 -3
- package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page.js +3 -3
- package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/page.js +2 -2
- package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page.js +2 -2
- package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/page.js +2 -2
- package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/[key]/page.js +2 -2
- package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/page.js +2 -2
- package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/page.js +3 -3
- package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/parallelism/page.js +2 -2
- package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page.js +3 -3
- package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/page.js +3 -3
- package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/runs/page.js +2 -2
- package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page.js +3 -3
- package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/page.js +3 -3
- package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/settings/page.js +2 -2
- package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/usage/page.js +2 -2
- package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/chunks/{[externals]__0o43ejh._.js → [externals]__0fpbr8-._.js} +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0-vgrh1._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0.z48ue._.js +3 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0dctov1._.js +5 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0e8n_x4._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0jprdks._.js +2 -2
- package/app/apps/web/.next/server/chunks/node_modules_next_036my~r._.js +1 -1
- package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ck.78s.js +1 -1
- package/app/apps/web/.next/server/chunks/packages_09hmrqx._.js +3 -0
- package/app/apps/web/.next/server/chunks/packages_118y1lp._.js +3 -0
- package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +26 -17
- package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_122oe0-.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04eq6z2._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0e.gxk3._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0p1x6v2._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0r4tks8._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rvzdnx._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0sp6.jt._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0tejjy_._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0v.6dx0._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +3 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0wwa6gh._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0yv-a8z._.js +12 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10~b4bf._.js +12 -0
- package/app/apps/web/.next/server/chunks/ssr/_02s1n-x._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/_0woap-3._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_app_day_[date]_day-view_tsx_0wjoe1u._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_app_settings_ai-features-form_tsx_01p699p._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0ly1xes._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0txtsv5._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_usage-data_ts_0xtv99n._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/{node_modules_0i2xw~e._.js → node_modules_0fx6-.x._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_10_oegc._.js +3 -0
- package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/app/apps/web/.next/server/pages/500.html +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next/static/chunks/0.3mqbj24kwtc.js +6 -0
- package/app/apps/web/.next/static/chunks/07-fq4im3pmjp.js +4 -0
- package/app/apps/web/.next/static/chunks/09gdxttgu~.aj.js +14 -0
- package/app/apps/web/.next/static/chunks/0n3-prt61k7pr.js +1 -0
- package/app/apps/web/.next/static/chunks/{0_7303jr0sf0w.js → 0q2vd~aj.1hpz.js} +3 -3
- package/app/apps/web/.next/static/chunks/0qmh5da6gfm56.js +1 -0
- package/app/apps/web/.next/static/chunks/{0k9pksi_i.odf.js → 111-bgx08j2nq.js} +1 -1
- package/app/apps/web/app/api/ask/route.ts +1 -1
- package/app/apps/web/app/api/digest/week/[startDate]/route.ts +2 -1
- package/app/apps/web/app/api/settings/route.ts +1 -0
- package/app/apps/web/app/insights/[key]/page.tsx +8 -2
- package/app/apps/web/app/layout.tsx +10 -7
- package/app/apps/web/app/page.tsx +19 -15
- package/app/apps/web/app/parallelism/gantt-chart.tsx +7 -18
- package/app/apps/web/app/projects/projects-view.tsx +3 -0
- package/app/apps/web/app/sessions/[id]/session-view.tsx +168 -41
- package/app/apps/web/app/sessions/page.tsx +22 -12
- package/app/apps/web/app/sessions/sessions-grid.tsx +82 -9
- package/app/apps/web/app/settings/ai-features-form.tsx +20 -1
- package/app/apps/web/app/settings/page.tsx +1 -0
- package/app/apps/web/app/usage/page.tsx +161 -52
- package/app/apps/web/components/agent-badge.tsx +43 -0
- package/app/apps/web/components/agent-icon.tsx +38 -0
- package/app/apps/web/components/agent-mix-chip.tsx +42 -0
- package/app/apps/web/components/{ask-claude.tsx → ask.tsx} +13 -12
- package/app/apps/web/components/day-digest.tsx +1 -1
- package/app/apps/web/components/live-sessions-widget.tsx +5 -1
- package/app/apps/web/components/outcome-pill.tsx +7 -2
- package/app/apps/web/components/sidebar.tsx +1 -1
- package/app/apps/web/components/week-digest.tsx +2 -0
- package/app/apps/web/lib/ai/session-summary.ts +1 -1
- package/app/apps/web/lib/data.ts +7 -8
- package/app/apps/web/lib/date-range.ts +9 -2
- package/app/apps/web/lib/usage-data.ts +24 -1
- package/app/apps/web/lib/validate-settings.ts +1 -0
- package/app/apps/web/package.json +1 -1
- package/app/apps/web/tsconfig.tsbuildinfo +1 -1
- package/dist/daemon-worker.js +3150 -2335
- package/dist/index.js +4444 -3760
- package/package.json +1 -1
- package/app/apps/web/.next/server/chunks/[externals]__0_xztrf._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0455vu3._.js +0 -5
- package/app/apps/web/.next/server/chunks/packages_0e7q9u_._.js +0 -3
- package/app/apps/web/.next/server/chunks/packages_0n6p2ot._.js +0 -3
- package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_0bc7ptm.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-94ji~._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_6.inc._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0gio_ck._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0jdyefm._.js +0 -12
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ln9jsw._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u5d7de._.js +0 -12
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~_8vff._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__11v.eqw._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0-jvt~a._.js +0 -3
- package/app/apps/web/.next/static/chunks/04m3slg_5ph02.js +0 -1
- package/app/apps/web/.next/static/chunks/0coa1800xqgfj.js +0 -1
- package/app/apps/web/.next/static/chunks/0k1psab.bybh9.js +0 -14
- package/app/apps/web/.next/static/chunks/0xfu09fn_358k.js +0 -4
- package/app/apps/web/.next/static/chunks/17u2ww8ya5dv1.js +0 -6
- /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → qYW0u_NOmV0v7lf7xZc6x}/_buildManifest.js +0 -0
- /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → qYW0u_NOmV0v7lf7xZc6x}/_clientMiddlewareManifest.js +0 -0
- /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → qYW0u_NOmV0v7lf7xZc6x}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[85041,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(33441),f=a.i(5151);let g={loop_suspected:{token:"loop_suspected",label:"consecutive-tool run",description:"The same tool was called 8 or more times in a row without interleaving — heuristic for a possible tool loop, but legitimate Read/Grep marathons also trigger it.",tone:"warn"},long_autonomous:{token:"long_autonomous",label:"long autonomous turn",description:"A single turn ran 20 minutes or longer without any user interruption.",tone:"info"},orchestrated:{token:"orchestrated",label:"subagent-orchestrated",description:"3 or more turns dispatched a subagent via the Task tool.",tone:"info"},fast_ship:{token:"fast_ship",label:"fast ship",description:"A PR shipped in under 5 minutes of agent time.",tone:"ok"},plan_used:{token:"plan_used",label:"plan mode",description:"Plan mode was entered at least once during this slice.",tone:"info"},interrupt_heavy:{token:"interrupt_heavy",label:"frequent interrupts",description:"You hit Esc or cancelled 3 or more times.",tone:"warn"},high_errors:{token:"high_errors",label:"high tool-error rate",description:"20 or more tool calls returned errors.",tone:"warn"}},h={warn:"#ed8936",info:"#4299e1",ok:"#48bb78"};function i({token:a,count:c}){let d=g[a]??{token:a,label:a.replace(/_/g," "),description:`Internal flag: ${a}.`,tone:"info"},e=h[d.tone];return(0,b.jsxs)("span",{title:`${d.token} — ${d.description}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,background:`color-mix(in srgb, ${e} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontSize:10,fontWeight:600,color:e,fontFamily:"var(--font-mono)",whiteSpace:"nowrap"},children:[d.label,"number"==typeof c&&(0,b.jsxs)("span",{style:{opacity:.7,fontWeight:500},children:["×",c]})]})}function j(a){let c,d=Object.keys(g),e=RegExp(`\\b(${d.join("|")})\\b`,"g"),f=[],h=0;for(;null!==(c=e.exec(a));)c.index>h&&f.push(a.slice(h,c.index)),f.push((0,b.jsx)(i,{token:c[1]},`${c.index}-${c[1]}`)),h=e.lastIndex;return h<a.length&&f.push(a.slice(h)),f.length>0?f:[a]}var k=a.i(68381);let l={essential:"#48bb78",helpful:"#4299e1",neutral:"#a0aec0",unhelpful:"#f56565"},m=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],n={"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"},o={"spec-review-loop":"#9f7aea","chunk-implementation":"#4299e1","research-then-build":"#38b2ac","reviewer-triad":"#ed64a6","background-coordinated":"#ecc94b","solo-continuation":"#a0aec0","solo-design":"#48bb78","solo-build":"#ed8936",mixed:"#a0aec0"},p={outlier:"Outlier","novel-use":"Novel use","user-built-tool":"User-built tool","cross-week-contrast":"Cross-week contrast"},q={"claude-md":"CLAUDE.md addition",skill:"Skill to build",hook:"Hook to wire",harness:"Harness extension",decision:"Decision to make"};function r({digest:a,aiEnabled:c,actions:e,priorDigest:f}){var g,h;let i,l,m,n,o,p=a.shipped.length,q=Object.values(a.outcome_mix).reduce((a,b)=>a+(b??0),0),u=a.agent_min_total/60,v=u>=1?`${u.toFixed(1)}h`:`${Math.round(a.agent_min_total)}m`,w=f?(g=a,h=f,i=g.shipped.length-h.shipped.length,m=(l=g.agent_min_total-h.agent_min_total)/60,n=`${i>0?"+":""}${i} PR${1===Math.abs(i)?"":"s"}`,o=Math.abs(m)>=1?`${m>0?"+":""}${m.toFixed(1)}h`:`${l>0?"+":""}${Math.round(l)}m`,`${n} \xb7 ${o}`):null;return(0,b.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,b.jsxs)("header",{style:{marginBottom:24},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[v," agent time · ",q," active day",1===q?"":"s"," · ",p," PR",1===p?"":"s"]}),w&&(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",padding:"1px 7px",borderRadius:999,border:"1px solid var(--af-border-subtle)"},title:"vs the prior calendar week",children:["vs last week: ",w]}),e&&(0,b.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:e})]}),a.headline?(0,b.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 6px",maxWidth:820,color:"var(--af-text)"},children:j(a.headline)}):(0,b.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:c?"No narrative yet.":`Worked ${v} across ${a.projects.length} project${1===a.projects.length?"":"s"}.`}),a.key_pattern&&(0,b.jsx)("p",{style:{fontSize:13,fontStyle:"italic",margin:0,lineHeight:1.5,color:"var(--af-text-secondary)",maxWidth:820},children:j(a.key_pattern)})]}),!c&&(0,b.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,b.jsx)(d.default,{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see weekly narratives."]}),(0,b.jsx)(t,{digest:a}),(0,b.jsx)(x,{digest:a}),a.top_goal_categories.length>0&&(0,b.jsx)(K,{title:"Goal mix",anchor:"goals",children:(0,b.jsx)(k.GoalBar,{goals:a.top_goal_categories,total:a.agent_min_total})}),(0,b.jsx)(B,{digest:a}),a.top_sessions&&a.top_sessions.length>0&&(0,b.jsx)(O,{sessions:a.top_sessions}),(0,b.jsx)(F,{title:"What worked",anchor:"what-worked",items:a.what_worked??[],tone:"#48bb78",sectionFallbackProse:null}),(0,b.jsx)(F,{title:"What stalled",anchor:"what-stalled",items:a.what_stalled??[],tone:"#ed8936",sectionFallbackProse:"No stalls stuck this week."}),(0,b.jsx)(I,{items:a.what_surprised??[]}),(0,b.jsx)(J,{items:a.where_to_lean??[]}),(0,b.jsx)(E,{shipped:a.shipped}),!a.working_shapes&&(0,b.jsx)(s,{digest:a})]})}function s({digest:a}){let c=a.recurring_themes??[],d=a.outcome_correlations??[],e=a.friction_categories??[],f=a.suggestions,g=a.on_the_horizon,h=a.fun_ending;return c.length>0||d.length>0||e.length>0||(f?.claude_md_additions?.length??0)>0||g||h?(0,b.jsxs)("div",{style:{padding:"14px 16px",marginTop:18,borderRadius:8,background:"color-mix(in srgb, var(--af-text-tertiary) 5%, var(--af-surface))",border:"1px dashed var(--af-border-subtle)",fontSize:12,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Legacy digest:"})," this week was generated under a previous prompt. Re-roll the digest to refresh it under the new working-shapes narrative."]}):null}function t({digest:a}){let c=a.agent_min_total/60,e=c>=1?`${c.toFixed(1)}h`:`${Math.round(a.agent_min_total)}m`,f=function(a){let b=a.reduce((a,b)=>a+b,0);if(0===b)return null;for(let c=1;c<=24;c++){let d=0,e=0;for(let b=0;b<=24-c;b++){let f=0;for(let d=0;d<c;d++)f+=a[b+d]??0;f>d&&(d=f,e=b)}if(d/b>=.6)return{start:e,end:e+c,share_pct:d/b*100}}return null}(a.hours_distribution),g=new Map(a.days_active.map(a=>[a.date,a])),h=A(a.window.start),i=h.map(a=>g.get(a)?.agent_min??0),j=Math.max(...i,1),k=a.busiest_day?h.indexOf(a.busiest_day.date):-1,l=a.longest_run&&a.busiest_day?Math.min(1,a.longest_run.active_min/Math.max(1,a.busiest_day.agent_min)):0,m=[];return(m.push({label:"Agent time",primary:e,detail:`across ${a.days_active.length} day${1===a.days_active.length?"":"s"}`,visual:(0,b.jsx)(u,{values:i,max:j,highlight:-1})}),a.busiest_day&&m.push({label:"Busiest day",href:`/digest/${a.busiest_day.date}`,primary:`${L(a.busiest_day.date)} ${a.busiest_day.date.slice(5)}`,detail:`${Math.round(a.busiest_day.agent_min)}m \xb7 ${a.busiest_day.shipped_count} PR${1===a.busiest_day.shipped_count?"":"s"}`,visual:(0,b.jsx)(u,{values:i,max:j,highlight:k})}),a.longest_run&&m.push({label:"Longest single run",href:`/sessions/${a.longest_run.session_id}`,title:`Session ${a.longest_run.session_id.slice(0,8)}`,primary:`${Math.round(a.longest_run.active_min)}m`,detail:`${a.longest_run.project_display} \xb7 ${L(a.longest_run.date)} ${a.longest_run.date.slice(5)}`,visual:(0,b.jsx)(v,{ratio:l,caption:"vs busiest day"})}),f&&m.push({label:"Peak hours",title:`${z(f.start,f.end)} carried ${f.share_pct.toFixed(0)}% of the week's agent time`,primary:z(f.start,f.end),detail:`${f.share_pct.toFixed(0)}% of agent time`,visual:(0,b.jsx)(w,{hours:a.hours_distribution,peakStart:f.start,peakEnd:f.end})}),0===m.length)?null:(0,b.jsx)("section",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.min(m.length,4)}, minmax(0, 1fr))`,gap:10,marginBottom:20},children:m.map((a,c)=>{let e=(0,b.jsxs)("div",{style:{padding:"12px 14px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",minHeight:90},title:a.title,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginBottom:6},children:a.label}),(0,b.jsx)("div",{style:{fontSize:17,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",lineHeight:1.2},children:a.primary}),(0,b.jsx)("div",{style:{fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:a.detail})]}),a.visual&&(0,b.jsx)("div",{style:{marginTop:10},children:a.visual})]});return a.href?(0,b.jsx)(d.default,{href:a.href,style:{textDecoration:"none"},children:e},c):(0,b.jsx)("div",{children:e},c)})})}function u({values:a,max:c,highlight:d}){return(0,b.jsx)("div",{style:{display:"flex",gap:2,alignItems:"flex-end",height:18},children:a.map((a,e)=>{let f=c>0?Math.max(1,a/c*18):1,g=e===d;return(0,b.jsx)("div",{style:{flex:1,height:f,borderRadius:1,background:g?"var(--af-accent)":a>0?"color-mix(in srgb, var(--af-accent) 30%, transparent)":"var(--af-border-subtle)"}},e)})})}function v({ratio:a,caption:c}){let d=100*Math.max(0,Math.min(1,a));return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{height:6,borderRadius:99,overflow:"hidden",background:"var(--af-border-subtle)"},children:(0,b.jsx)("div",{style:{width:`${d}%`,height:"100%",background:"var(--af-accent)"}})}),(0,b.jsxs)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:[Math.round(d),"% ",c]})]})}function w({hours:a,peakStart:c,peakEnd:d}){let e=Math.max(...a,1);return(0,b.jsx)("div",{style:{display:"flex",gap:1,alignItems:"flex-end",height:18},children:a.map((a,f)=>{let g=f>=c&&f<=d,h=e>0?Math.max(1,a/e*18):1;return(0,b.jsx)("div",{style:{flex:1,height:h,borderRadius:1,background:g?"var(--af-accent)":a>0?"color-mix(in srgb, var(--af-accent) 22%, transparent)":"var(--af-border-subtle)"}},f)})})}function x({digest:a}){if(0===a.days_active.length)return null;let c=Math.max(...a.days_active.map(a=>a.agent_min)),e=new Map(a.days_active.map(a=>[a.date,a])),f=A(a.window.start);return(0,b.jsx)("section",{style:{display:"flex",gap:6,alignItems:"stretch",padding:"12px 0",marginBottom:24},children:f.map((a,f)=>{let g=e.get(a),h=g?.agent_min??0,i=c>0&&h>0?Math.max(8,h/c*100):0,j=g?y[g.outcome_day]:"var(--af-text-tertiary)",k=g?.helpfulness_day?l[g.helpfulness_day]:null;return(0,b.jsxs)(d.default,{href:g?`/digest/${a}`:"#",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch",gap:2,textDecoration:"none",pointerEvents:g?"auto":"none"},title:g?`${a} \xb7 ${Math.round(h)}m \xb7 ${g.outcome_day}${g.shipped_count>0?` \xb7 ${g.shipped_count} PR`:""}${g.helpfulness_day?` \xb7 helpfulness ${g.helpfulness_day}`:""}`:"no activity",children:[(0,b.jsxs)("div",{style:{height:56,borderRadius:4,position:"relative",background:"var(--af-surface)",border:`1px solid ${g?`color-mix(in srgb, ${j} 28%, var(--af-border-subtle))`:"var(--af-border-subtle)"}`,overflow:"hidden"},children:[g&&(0,b.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${i}%`,background:`color-mix(in srgb, ${j} 28%, transparent)`}}),g?.dominant_shape&&o[g.dominant_shape]&&(0,b.jsx)("div",{title:`${n[g.dominant_shape]??g.dominant_shape}`,style:{position:"absolute",top:0,left:0,right:0,height:3,background:o[g.dominant_shape]}}),k&&(0,b.jsx)("div",{style:{position:"absolute",top:4,right:4,width:6,height:6,borderRadius:999,background:k},title:g?.helpfulness_day??""})]}),(0,b.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",color:"var(--af-text-tertiary)",textAlign:"center"},children:m[f]}),(0,b.jsx)("div",{style:{fontSize:9,fontFamily:"var(--font-mono)",color:g?"var(--af-text-secondary)":"var(--af-text-tertiary)",textAlign:"center"},children:g?`${Math.round(h)}m`:"—"})]},f)})})}let y={shipped:"#48bb78",partial:"#4299e1",blocked:"#f56565",exploratory:"#a0aec0",trivial:"#cbd5e0",idle:"#cbd5e0"};function z(a,b){let c=a=>`${a%12||12}${a<12||24===a?"am":"pm"}`;return`${c(a)}–${c(b)}`}function A(a){let b=[],c=new Date(a);for(let a=0;a<7;a++){let d=new Date(c);d.setDate(c.getDate()+a);let e=d.getFullYear(),f=String(d.getMonth()+1).padStart(2,"0"),g=String(d.getDate()).padStart(2,"0");b.push(`${e}-${f}-${g}`)}return b}function B({digest:a}){let c=a.trajectory&&a.trajectory.length>0,e=a.standout_days&&a.standout_days.length>0,f=a.projects.filter(a=>a.share_pct>=5||a.shipped_count>0),g=f.length>0;return c||e||g?(0,b.jsxs)(K,{title:"Through the week",anchor:"through-the-week",children:[(c||e)&&(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:c&&e?"minmax(0, 1.4fr) minmax(0, 1fr)":"1fr",gap:28,marginBottom:22*!!g},children:[c&&(0,b.jsxs)("div",{children:[(0,b.jsx)(C,{children:"Trajectory"}),(0,b.jsx)("ol",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:6},children:a.trajectory.map(a=>(0,b.jsxs)("li",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0,width:64,paddingTop:3,textDecoration:"none"},children:[L(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text-secondary)"},children:j(a.line)})]},a.date))})]}),e&&(0,b.jsxs)("div",{children:[(0,b.jsx)(C,{children:"Standout days"}),(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:8},children:a.standout_days.map(a=>(0,b.jsxs)("li",{style:{padding:"10px 12px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:11,fontWeight:600,color:"var(--af-accent)",textDecoration:"none",fontFamily:"var(--font-mono)",marginRight:8},children:[L(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text)"},children:j(a.why)})]},a.date))})]})]}),g&&(0,b.jsxs)("div",{children:[(0,b.jsx)(C,{children:"Project areas"}),(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:10},children:f.map(a=>(0,b.jsxs)("li",{style:{padding:"11px 13px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,marginBottom:6*!!a.description},children:[(0,b.jsx)(d.default,{href:`/projects/${encodeURIComponent(a.name)}`,style:{fontSize:13,fontWeight:600,color:"var(--af-text)",textDecoration:"none",flex:1,minWidth:0,letterSpacing:"-0.01em"},children:a.display_name}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)"},children:[Math.round(a.agent_min),"m · ",a.share_pct.toFixed(0),"% · ",a.shipped_count," PR"]})]}),a.description&&(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.5,margin:0,color:"var(--af-text-secondary)"},children:a.description})]},a.name))})]})]}):null}function C({children:a}){return(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,marginBottom:10},children:a})}function D({label:a,payload:d}){let[g,h]=(0,c.useState)(!1);return(0,b.jsxs)("div",{style:{position:"relative"},children:[(0,b.jsx)("pre",{style:{margin:0,padding:"10px 12px",paddingRight:96,borderRadius:6,background:"var(--af-surface-raised)",border:"1px solid var(--af-border-subtle)",fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text)",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.55,overflowX:"auto",maxHeight:280,overflowY:"auto"},children:d}),(0,b.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(d),h(!0),setTimeout(()=>h(!1),1500)}catch{}},style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:5,background:g?"color-mix(in srgb, #48bb78 18%, var(--af-surface))":"var(--af-surface)",border:`1px solid ${g?"#48bb78":"var(--af-border-subtle)"}`,color:g?"#48bb78":"var(--af-text-secondary)",fontSize:10,fontWeight:600,cursor:"pointer"},children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.Check,{size:10})," Copied"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Copy,{size:10})," ",a]})})]})}function E({shipped:a}){let[e,f]=(0,c.useState)(!1);if(0===a.length)return null;let g=a.length>=10,h=g&&!e?a.slice(0,5):a,i=a.length-h.length;return(0,b.jsxs)(K,{title:`Shipped (${a.length})`,anchor:"shipped",children:[(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:h.map((a,c)=>(0,b.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"baseline",padding:"6px 10px",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",flexShrink:0,width:56,textDecoration:"none"},children:[L(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:a.project})]},c))}),g&&i>0&&(0,b.jsxs)("button",{type:"button",onClick:()=>f(!0),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:["+",i," more"]}),g&&e&&(0,b.jsx)("button",{type:"button",onClick:()=>f(!1),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:"show less"})]})}function F({title:a,anchor:c,items:d,tone:e,sectionFallbackProse:f}){return d&&0!==d.length?(0,b.jsx)(K,{title:a,anchor:c,children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:d.map((a,c)=>(0,b.jsx)(G,{item:a,tone:e},c))})}):null===f?null:(0,b.jsx)(K,{title:a,anchor:c,children:(0,b.jsx)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-tertiary)",margin:0,padding:"8px 0"},children:f})})}function G({item:a,tone:c}){let e=H(a.anchor);return(0,b.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${c} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${c} 22%, var(--af-border))`},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:c,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${c} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${c} 28%, transparent)`,fontFamily:"var(--font-mono)"},title:`Anchor: ${a.anchor}`,children:e})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:a.detail}),(0,b.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${c} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{fontSize:10,fontWeight:600,color:c,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[L(a.evidence.date)," ",a.evidence.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),a.evidence.quote,(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]})}function H(a){return"plan-mode-gap"===a?"Plan-mode gap":a.startsWith("interaction_grammar.")?a.slice(20).replace(/_/g," "):n[a]??a}function I({items:a}){return a&&0!==a.length?(0,b.jsx)(K,{title:"What surprised",anchor:"what-surprised",children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:a.map((a,c)=>{let e="#b794f4";return(0,b.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${e} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${e} 22%, var(--af-border))`},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:e,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${e} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:p[a.surprise_kind]??a.surprise_kind})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:a.detail}),(0,b.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${e} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{fontSize:10,fontWeight:600,color:e,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[L(a.evidence.date)," ",a.evidence.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),a.evidence.quote,(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]},c)})})}):null}function J({items:a}){return a&&0!==a.length?(0,b.jsx)(K,{title:"Where to lean",anchor:"where-to-lean",children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:12},children:a.map((a,c)=>{let e="var(--af-accent)",f=H(a.anchor);return(0,b.jsxs)("li",{style:{padding:"14px 16px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:6,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:e,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${e} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:q[a.lean_kind]??a.lean_kind}),(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",flex:1,minWidth:0},children:a.title}),(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},title:`Anchor: ${a.anchor}`,children:["↳ ",f]})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 10px",color:"var(--af-text)"},children:a.detail}),a.copyable&&(0,b.jsx)(D,{label:`Copy ${"claude-md"===a.lean_kind?"block":"snippet"}`,payload:a.copyable}),(0,b.jsxs)("div",{style:{marginTop:8,fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:["Evidence · ",(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{color:"var(--af-text-tertiary)",textDecoration:"underline"},children:[L(a.evidence.date)," ",a.evidence.date.slice(5)]})," · “",a.evidence.quote.slice(0,100),a.evidence.quote.length>100?"…":"","”"]})]},c)})})}):null}function K({title:a,anchor:c,children:d}){return(0,b.jsxs)("section",{id:c,style:{marginBottom:28,scrollMarginTop:24},children:[(0,b.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:"0 0 12px"},children:a}),d]})}function L(a){return new Date(`${a}T12:00:00`).toLocaleDateString("en-US",{weekday:"short"})}let M={"user-steering":"#ed8936","subagent-burst":"#9f7aea","long-autonomous":"#4299e1","plan-mode":"#38b2ac","pr-ship":"#48bb78","harness-chain":"#ed64a6",interrupt:"#f56565","brainstorm-loop":"#9f7aea","agent-loop":"#f56565"},N={"user-steering":"Steering","subagent-burst":"Subagents","long-autonomous":"Autonomous","plan-mode":"Plan","pr-ship":"Shipped","harness-chain":"Harness",interrupt:"Interrupt","brainstorm-loop":"Brainstorm","agent-loop":"Loop"};function O({sessions:a}){return(0,b.jsxs)(K,{title:`Top ${a.length} session${1===a.length?"":"s"} this week`,anchor:"top-sessions",children:[(0,b.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",marginTop:-4,marginBottom:14,fontStyle:"italic",lineHeight:1.5,maxWidth:720},children:"Picked by significance — active time × subagents × ships, capped to one per project. Each card walks the timeline with annotated moments to surface the texture of how you drove the agent."}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:a.map(a=>(0,b.jsx)(P,{session:a},a.session_id))})]})}function P({session:a}){let c=a.working_shape?n[a.working_shape]??a.working_shape:null,e=a.working_shape?o[a.working_shape]??"var(--af-text-tertiary)":"var(--af-text-tertiary)",f=a.wall_min/60,g=a.active_min/60,h=f>=1?`${f.toFixed(1)}h wall`:`${Math.round(a.wall_min)}m wall`,i=g>=1?`${g.toFixed(1)}h active`:`${Math.round(a.active_min)}m active`;return(0,b.jsx)("div",{style:{borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderTop:`3px solid ${e}`,overflow:"hidden"},children:(0,b.jsxs)("div",{style:{padding:"16px 18px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",marginBottom:6},children:[(0,b.jsx)(d.default,{href:`/sessions/${a.session_id}`,style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",textDecoration:"none"},children:a.project_display}),(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-accent)",textDecoration:"none"},children:[L(a.date)," ",a.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:[i," · ",h," · ",a.turn_count," turns"]}),c&&(0,b.jsx)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:`color-mix(in srgb, ${e} 14%, transparent)`,color:e},children:c}),"shipped"===a.outcome&&a.shipped_prs.length>0&&(0,b.jsxs)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:"color-mix(in srgb, #48bb78 14%, transparent)",color:"#48bb78"},children:["✓ ",a.shipped_prs.length," PR",1===a.shipped_prs.length?"":"s"]})]}),a.day_signature&&(0,b.jsxs)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-secondary)",margin:"0 0 14px",lineHeight:1.5,maxWidth:760},children:["“",a.day_signature,"”"]}),(0,b.jsx)(Q,{session:a}),a.steering_summary&&(0,b.jsxs)("p",{style:{fontSize:12,lineHeight:1.55,margin:"10px 0 12px",color:"var(--af-text-secondary)",maxWidth:780,paddingLeft:10,borderLeft:"2px solid var(--af-border-subtle)"},children:[(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginRight:6},children:"steering"}),a.steering_summary]}),(0,b.jsx)(S,{session:a}),(0,b.jsx)(V,{session:a}),a.pins.length>0&&(0,b.jsx)("ol",{style:{listStyle:"none",padding:0,margin:"12px 0 0",display:"flex",flexDirection:"column",gap:6},children:a.pins.map((a,c)=>(0,b.jsx)(W,{pin:a},c))})]})})}function Q({session:a}){return a.why_picked||a.what_worked||a.what_hit_friction?(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,margin:"0 0 6px"},children:[a.why_picked&&(0,b.jsx)(R,{label:"Why this session",tone:"var(--af-text-tertiary)",accent:"var(--af-text-tertiary)",text:a.why_picked}),a.session_summary&&(0,b.jsx)(R,{label:"What happened",tone:"var(--af-text)",accent:"var(--af-text-secondary)",text:a.session_summary,weight:500}),a.what_worked&&(0,b.jsx)(R,{label:"What worked",tone:"var(--af-text)",accent:"#48bb78",text:a.what_worked}),a.what_hit_friction&&(0,b.jsx)(R,{label:"What hit friction",tone:"var(--af-text)",accent:"#ed8936",text:a.what_hit_friction})]}):a.session_summary?(0,b.jsx)("p",{style:{fontSize:13,lineHeight:1.55,margin:"0 0 8px",color:"var(--af-text)",maxWidth:780},children:a.session_summary}):null}function R({label:a,tone:c,accent:d,text:e,weight:f=400}){return(0,b.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start",maxWidth:800},children:[(0,b.jsx)("span",{style:{flexShrink:0,width:132,paddingTop:2,fontSize:9.5,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:d},children:a}),(0,b.jsx)("span",{style:{fontSize:13,lineHeight:1.55,color:c,fontWeight:f},children:e})]})}function S({session:a}){let{user_authored_skills:c,user_authored_subagents:d,stock_skills:e,top_tools:f}=a;return c.length>0||d.length>0||e.length>0||f.length>0?(0,b.jsxs)("div",{style:{marginBottom:4},children:[d.length>0&&(0,b.jsx)(T,{label:"Your subagents",children:d.map(a=>(0,b.jsxs)(U,{tone:"user",children:[a.type,a.count>1?` \xd7${a.count}`:""]},a.type))}),(c.length>0||e.length>0)&&(0,b.jsxs)(T,{label:"Skills loaded",children:[c.map(a=>(0,b.jsx)(U,{tone:"user",children:a},a)),e.slice(0,6).map(a=>(0,b.jsx)(U,{tone:"stock",children:a},a))]}),f.length>0&&(0,b.jsx)(T,{label:"Top tools",children:f.slice(0,4).map((a,c)=>(0,b.jsx)(U,{children:a},c))})]}):null}function T({label:a,children:c}){return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"3px 0",fontSize:11},children:[(0,b.jsx)("span",{style:{minWidth:96,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:10,textTransform:"uppercase",letterSpacing:"0.04em"},children:a}),(0,b.jsx)("div",{style:{display:"flex",gap:5,flexWrap:"wrap",flex:1},children:c})]})}function U({children:a,tone:c,title:d}){return(0,b.jsx)("span",{title:d,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:10,fontFamily:"var(--font-mono)",background:"user"===c?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===c?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:a})}function V({session:a}){let c=a.timeline.active_intervals,d=c.length>0?Math.max(...c.map(a=>a.end_min)):0,e=Math.max(1,a.timeline.duration_min,d);return(0,b.jsxs)("div",{style:{marginTop:10,marginBottom:4},children:[(0,b.jsxs)("div",{style:{position:"relative",width:"100%",height:28,background:"var(--af-border-subtle)",borderRadius:4},children:[c.map((a,c)=>{let d=a.start_min/e*100,f=Math.max(.6,(a.end_min-a.start_min)/e*100);return(0,b.jsx)("div",{style:{position:"absolute",top:6,bottom:6,left:`${d}%`,width:`${f}%`,background:"color-mix(in srgb, var(--af-accent) 30%, transparent)",borderRadius:2}},c)}),a.pins.map((a,c)=>{let d=Math.max(0,Math.min(100,a.start_min/e*100)),f=void 0!==a.end_min?Math.max(d+.5,Math.min(100,a.end_min/e*100)):d,g=void 0!==a.end_min&&f>d+.5,h=M[a.kind]??"var(--af-accent)";return(0,b.jsxs)("div",{children:[g&&(0,b.jsx)("div",{style:{position:"absolute",top:4,bottom:4,left:`${d}%`,width:`${f-d}%`,background:`color-mix(in srgb, ${h} 35%, transparent)`,border:`1px solid ${h}`,borderRadius:3},title:`${N[a.kind]}: ${a.label}`}),(0,b.jsx)("div",{style:{position:"absolute",top:-3,bottom:-3,left:`${d}%`,width:3,background:h,borderRadius:1,transform:"translateX(-1.5px)"},title:`${N[a.kind]}: ${a.label}`})]},c)})]}),(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",marginTop:3},children:[(0,b.jsx)("span",{children:"0m"}),(0,b.jsx)("span",{children:X(e/2)}),(0,b.jsxs)("span",{children:[X(e)," wall"]})]})]})}function W({pin:a}){let c=M[a.kind]??"var(--af-accent)",d=void 0!==a.end_min&&a.end_min>a.start_min+.5?`${X(a.start_min)}–${X(a.end_min)}`:X(a.start_min);return(0,b.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:12,lineHeight:1.5},children:[(0,b.jsx)("span",{style:{flexShrink:0,width:3,height:3,marginTop:7,borderRadius:999,background:c}}),(0,b.jsx)("span",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",paddingTop:1,minWidth:60},children:d}),(0,b.jsx)("span",{style:{flexShrink:0,padding:"1px 7px",borderRadius:999,fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",background:`color-mix(in srgb, ${c} 15%, transparent)`,color:c,marginTop:1},children:N[a.kind]??a.kind}),(0,b.jsx)("span",{style:{color:"var(--af-text)",maxWidth:640},children:a.label})]})}function X(a){if(a>=60){let b=Math.round(a),c=Math.floor(b/60),d=b%60;return`${c}h${d>0?` ${d}m`:""}`}return`${Math.round(10*a)/10}m`}function Y({monday:a,isStreaming:c,aiEnabled:d,progress:e,onGenerate:f}){let g=new Date(`${a}T12:00:00`),h=new Date(g);h.setDate(g.getDate()+6);let i=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),j=`${i(g)} — ${i(h)}`;return(0,b.jsx)("div",{style:{maxWidth:980,margin:"0 auto",padding:"60px 40px"},children:(0,b.jsxs)("div",{style:{margin:"0 auto",maxWidth:480,padding:"32px 28px",borderRadius:14,background:"var(--af-surface)",border:"1px dashed var(--af-border-subtle)",textAlign:"center"},children:[(0,b.jsx)("div",{style:{width:44,height:44,borderRadius:12,margin:"0 auto 16px",background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)",fontSize:20},children:"✦"}),(0,b.jsx)("h2",{style:{fontSize:16,fontWeight:600,margin:"0 0 6px",color:"var(--af-text)",letterSpacing:"-0.01em"},children:c?"Generating digest…":"No digest yet for this week"}),(0,b.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,margin:"0 0 18px",color:"var(--af-text-secondary)"},children:c?`Synthesizing ${j} from this week's day digests. This usually takes 5–10 minutes.`:d?`Once generated, this view shows top sessions, trajectory, findings, and project areas for ${j}.`:`Enable AI features in Settings to synthesize a weekly narrative for ${j}. Deterministic stats are still available below in the live digest as soon as data lands.`}),d&&(0,b.jsx)("button",{onClick:f,disabled:c,style:{padding:"9px 18px",borderRadius:8,background:c?"var(--af-border-subtle)":"var(--af-accent)",color:c?"var(--af-text-tertiary)":"white",border:"none",cursor:c?"default":"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.005em"},children:c?"Generating…":"Generate digest"}),e&&(0,b.jsx)("div",{style:{marginTop:12,fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:e})]})})}a.s(["WeekDigestView",0,function({initial:a,monday:d,aiEnabled:e,autoFire:f=!1,prior:g}){var h,i;let[j,k]=(0,c.useState)(a),[l,m]=(0,c.useState)("idle"),[n,o]=(0,c.useState)(""),p=(0,c.useRef)(!1),q=(0,c.useCallback)(async(a=!1)=>{m("streaming"),o("Starting...");let b=`/api/digest/week/${d}${a?"?force=1":""}`,c=await fetch(b,{method:"POST"});if(!c.ok||!c.body){m("error"),o(`Error ${c.status}`);return}let e=c.body.getReader(),f=new TextDecoder,g="";for(;;){let{done:a,value:b}=await e.read();if(a)break;let c=(g+=f.decode(b,{stream:!0})).split("\n\n");for(let a of(g=c.pop()??"",c)){let b=a.split("\n").find(a=>a.startsWith("data: "));if(b)try{let a=JSON.parse(b.slice(6));if("status"===a.type)o(a.text);else if("dependency"===a.type)o(`${"day"===a.kind?"Day":"Week"} ${a.key} ${a.status}`);else if("entry"===a.type)o(`Enriching ${a.index}/${a.total}...`);else if("progress"===a.type){let b=Math.round(a.elapsed_ms/1e3);o(`Claude composing… ${a.bytes.toLocaleString()} chars (${b}s)`)}else if("digest"===a.type)a.digest&&"week"===a.digest.scope&&k(a.digest),o("Rendering...");else if("saved"===a.type)o("Saved.");else if("error"===a.type){m("error"),o(a.message);return}}catch{}}}m("done"),o("")},[d]);(0,c.useEffect)(()=>{f&&!p.current&&"idle"===l&&(p.current=!0,q(!1))},[f,l,q]);let s="streaming"===l,t=!!j?.headline,u=null;return(!t&&e?u=(0,b.jsx)("button",{onClick:()=>q(!1),disabled:s,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:(h=s)?"default":"pointer",fontSize:11,fontWeight:600,opacity:h?.6:1},children:s?"Generating...":j?"Generate":"Generate digest"}):e&&(u=(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",gap:6,alignItems:"center"},children:["✓ Up to date",(0,b.jsx)("button",{onClick:()=>q(!0),disabled:s,title:"Re-roll the narrative for this week",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:(i=s)?"default":"pointer",opacity:i?.6:1},children:s?"...":"Re-roll"})]})),n&&(u=(0,b.jsxs)(b.Fragment,{children:[u,(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:n})]})),j)?(0,b.jsx)(r,{digest:j,aiEnabled:e,actions:u,priorDigest:g??null}):(0,b.jsx)(Y,{monday:d,isStreaming:s,aiEnabled:e,progress:n,onGenerate:()=>q(!1)})}],85041)},76435,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(13749),f=a.i(50522);let g=(0,a.i(70106).default)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var h=a.i(33508);function i({inDrawer:a=!1}={}){let[c,e]=(0,d.useState)("weeks"),[f,g]=(0,d.useState)(null),[h,p]=(0,d.useState)(null);return(0,d.useEffect)(()=>{fetch("/api/digest/week-index?count=12").then(a=>a.json()).then(a=>g(a.weeks)).catch(()=>g([])),fetch("/api/digest/month-index?count=6").then(a=>a.json()).then(a=>p(a.months)).catch(()=>p([]))},[]),(0,b.jsxs)("div",{style:a?{padding:"0 18px"}:{maxWidth:980,margin:"0 auto",padding:"28px 40px 0"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:a?14:18},children:[!a&&(0,b.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:0,marginRight:4},children:"History"}),(0,b.jsx)("div",{style:m,children:["weeks","months"].map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>e(a),style:{...n,background:c===a?"var(--af-accent)":"transparent",color:c===a?"white":"var(--af-text-secondary)"},children:"weeks"===a?"Weeks":"Months"},a))})]}),"weeks"===c?null===f?(0,b.jsx)(l,{children:"Loading weeks…"}):0===f.length?(0,b.jsx)(l,{children:"No history yet."}):(0,b.jsx)("ul",{style:o,children:f.map(a=>(0,b.jsx)(j,{w:a},a.start))}):null===h?(0,b.jsx)(l,{children:"Loading months…"}):0===h.length?(0,b.jsx)(l,{children:"No history yet."}):(0,b.jsx)("ul",{style:o,children:h.map(a=>(0,b.jsx)(k,{m:a},a.start))})]})}function j({w:a}){let d=0===a.active_days&&!a.in_progress&&!a.saved_key,e=a.saved_key?`/insights/${a.saved_key}`:`/insights/week-${a.start}`,f=a.saved_key&&a.headline?a.headline:d?"no data":a.in_progress?"in progress · click to view":`${a.active_days} active day${1===a.active_days?"":"s"} \xb7 click to generate`;return(0,b.jsx)("li",{style:p(!!a.saved_key),children:(0,b.jsxs)(c.default,{href:e,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:q,children:[(0,b.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:["W",String(a.iso_week).padStart(2,"0")," · ",a.label]}),a.in_progress&&(0,b.jsx)("span",{style:s,children:"in progress"}),a.saved_key&&(0,b.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[a.shipped_count," PR · ",a.agent_min,"m"]})]}),(0,b.jsx)("span",{style:r,children:f})]})})}function k({m:a}){let d=0===a.active_days&&!a.in_progress&&!a.saved_key,e=a.saved_key?`/insights/${a.saved_key}`:`/insights/month-${a.start.slice(0,7)}`,f=a.saved_key&&a.headline?a.headline:d?"no data":a.in_progress?"in progress · click to view":`${a.active_days} active day${1===a.active_days?"":"s"} \xb7 click to generate`;return(0,b.jsx)("li",{style:p(!!a.saved_key),children:(0,b.jsxs)(c.default,{href:e,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:q,children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:a.label}),a.in_progress&&(0,b.jsx)("span",{style:s,children:"in progress"}),a.saved_key&&(0,b.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[a.shipped_count," PR · ",a.agent_min,"m"]})]}),(0,b.jsx)("span",{style:r,children:f})]})})}function l({children:a}){return(0,b.jsx)("div",{style:{padding:"20px 18px",borderRadius:10,border:"1px dashed var(--af-border)",background:"var(--af-surface)",fontSize:13,color:"var(--af-text-tertiary)",lineHeight:1.55},children:a})}let m={display:"inline-flex",gap:3,border:"1px solid var(--af-border)",borderRadius:8,padding:2},n={padding:"5px 14px",fontSize:12,fontWeight:600,border:"none",borderRadius:6,cursor:"pointer"},o={listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4};function p(a){return{display:"flex",alignItems:"stretch",gap:14,padding:"10px 14px",borderRadius:10,border:`1px solid ${a?"color-mix(in srgb, var(--af-accent) 24%, var(--af-border))":"var(--af-border-subtle)"}`,background:a?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",transition:"border-color 0.15s"}}let q={display:"flex",alignItems:"center",gap:8,minWidth:0},r={fontSize:11,color:"var(--af-text-tertiary)",lineHeight:1.5,fontFamily:"var(--font-mono)"},s={fontSize:10,fontWeight:500,padding:"2px 6px",borderRadius:4,background:"color-mix(in srgb, #f5b445 18%, transparent)",color:"#c08a1f",letterSpacing:"0.02em"};function t({target:a,dir:d}){var g;let h="prev"===d?e.ChevronLeft:f.ChevronRight;return a?(0,b.jsxs)(c.default,{href:`/insights/${a.key}`,style:(g=a.cached,{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:`1px solid ${g?"color-mix(in srgb, var(--af-accent) 28%, var(--af-border))":"var(--af-border-subtle)"}`,background:g?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",color:g?"var(--af-accent)":"var(--af-text-secondary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",textDecoration:"none"}),title:a.cached?`Saved digest \xb7 ${a.label}`:`${a.label} (no saved digest yet — will prompt to Generate)`,children:[(0,b.jsx)(h,{size:14}),(0,b.jsx)("span",{children:a.label})]}):(0,b.jsx)("span",{style:w,title:`No ${"prev"===d?"earlier":"later"} period`,children:(0,b.jsx)(h,{size:14})})}function u({onClose:a}){return(0,b.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Insights history",style:{position:"fixed",inset:0,zIndex:200,display:"flex",justifyContent:"flex-end"},children:[(0,b.jsx)("div",{onClick:a,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.32)",animation:"fade-in 120ms ease-out"}}),(0,b.jsxs)("aside",{style:{position:"relative",width:"min(440px, 92vw)",height:"100vh",background:"var(--background)",borderLeft:"1px solid var(--af-border-subtle)",boxShadow:"-12px 0 40px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",animation:"slide-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1)"},children:[(0,b.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("h2",{style:{fontSize:13,fontWeight:600,margin:0,color:"var(--af-text)"},children:"Browse insights history"}),(0,b.jsx)("button",{type:"button",onClick:a,"aria-label":"Close history",style:{marginLeft:"auto",width:26,height:26,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:"transparent",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,b.jsx)(h.X,{size:14})})]}),(0,b.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"18px 0"},children:(0,b.jsx)(i,{inDrawer:!0})})]}),(0,b.jsx)("style",{children:`
|
|
1
|
+
module.exports=[85041,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(33441),f=a.i(5151);let g={loop_suspected:{token:"loop_suspected",label:"consecutive-tool run",description:"The same tool was called 8 or more times in a row without interleaving — heuristic for a possible tool loop, but legitimate Read/Grep marathons also trigger it.",tone:"warn"},long_autonomous:{token:"long_autonomous",label:"long autonomous turn",description:"A single turn ran 20 minutes or longer without any user interruption.",tone:"info"},orchestrated:{token:"orchestrated",label:"subagent-orchestrated",description:"3 or more turns dispatched a subagent via the Task tool.",tone:"info"},fast_ship:{token:"fast_ship",label:"fast ship",description:"A PR shipped in under 5 minutes of agent time.",tone:"ok"},plan_used:{token:"plan_used",label:"plan mode",description:"Plan mode was entered at least once during this slice.",tone:"info"},interrupt_heavy:{token:"interrupt_heavy",label:"frequent interrupts",description:"You hit Esc or cancelled 3 or more times.",tone:"warn"},high_errors:{token:"high_errors",label:"high tool-error rate",description:"20 or more tool calls returned errors.",tone:"warn"}},h={warn:"#ed8936",info:"#4299e1",ok:"#48bb78"};function i({token:a,count:c}){let d=g[a]??{token:a,label:a.replace(/_/g," "),description:`Internal flag: ${a}.`,tone:"info"},e=h[d.tone];return(0,b.jsxs)("span",{title:`${d.token} — ${d.description}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,background:`color-mix(in srgb, ${e} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontSize:10,fontWeight:600,color:e,fontFamily:"var(--font-mono)",whiteSpace:"nowrap"},children:[d.label,"number"==typeof c&&(0,b.jsxs)("span",{style:{opacity:.7,fontWeight:500},children:["×",c]})]})}function j(a){let c,d=Object.keys(g),e=RegExp(`\\b(${d.join("|")})\\b`,"g"),f=[],h=0;for(;null!==(c=e.exec(a));)c.index>h&&f.push(a.slice(h,c.index)),f.push((0,b.jsx)(i,{token:c[1]},`${c.index}-${c[1]}`)),h=e.lastIndex;return h<a.length&&f.push(a.slice(h)),f.length>0?f:[a]}var k=a.i(68381),l=a.i(99309);let m={essential:"#48bb78",helpful:"#4299e1",neutral:"#a0aec0",unhelpful:"#f56565"},n=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],o={"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"},p={"spec-review-loop":"#9f7aea","chunk-implementation":"#4299e1","research-then-build":"#38b2ac","reviewer-triad":"#ed64a6","background-coordinated":"#ecc94b","solo-continuation":"#a0aec0","solo-design":"#48bb78","solo-build":"#ed8936",mixed:"#a0aec0"},q={outlier:"Outlier","novel-use":"Novel use","user-built-tool":"User-built tool","cross-week-contrast":"Cross-week contrast"},r={"claude-md":"CLAUDE.md addition",skill:"Skill to build",hook:"Hook to wire",harness:"Harness extension",decision:"Decision to make"};function s({digest:a,aiEnabled:c,actions:e,priorDigest:f}){var g,h;let i,l,m,n,o,p=a.shipped.length,q=Object.values(a.outcome_mix).reduce((a,b)=>a+(b??0),0),r=a.agent_min_total/60,v=r>=1?`${r.toFixed(1)}h`:`${Math.round(a.agent_min_total)}m`,w=f?(g=a,h=f,i=g.shipped.length-h.shipped.length,m=(l=g.agent_min_total-h.agent_min_total)/60,n=`${i>0?"+":""}${i} PR${1===Math.abs(i)?"":"s"}`,o=Math.abs(m)>=1?`${m>0?"+":""}${m.toFixed(1)}h`:`${l>0?"+":""}${Math.round(l)}m`,`${n} \xb7 ${o}`):null;return(0,b.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,b.jsxs)("header",{style:{marginBottom:24},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[v," agent time · ",q," active day",1===q?"":"s"," · ",p," PR",1===p?"":"s"]}),w&&(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",padding:"1px 7px",borderRadius:999,border:"1px solid var(--af-border-subtle)"},title:"vs the prior calendar week",children:["vs last week: ",w]}),e&&(0,b.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:e})]}),a.headline?(0,b.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 6px",maxWidth:820,color:"var(--af-text)"},children:j(a.headline)}):(0,b.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:c?"No narrative yet.":`Worked ${v} across ${a.projects.length} project${1===a.projects.length?"":"s"}.`}),a.key_pattern&&(0,b.jsx)("p",{style:{fontSize:13,fontStyle:"italic",margin:0,lineHeight:1.5,color:"var(--af-text-secondary)",maxWidth:820},children:j(a.key_pattern)})]}),!c&&(0,b.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,b.jsx)(d.default,{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see weekly narratives."]}),(0,b.jsx)(u,{digest:a}),(0,b.jsx)(y,{digest:a}),a.top_goal_categories.length>0&&(0,b.jsx)(L,{title:"Goal mix",anchor:"goals",children:(0,b.jsx)(k.GoalBar,{goals:a.top_goal_categories,total:a.agent_min_total})}),(0,b.jsx)(C,{digest:a}),a.top_sessions&&a.top_sessions.length>0&&(0,b.jsx)(P,{sessions:a.top_sessions}),(0,b.jsx)(G,{title:"What worked",anchor:"what-worked",items:a.what_worked??[],tone:"#48bb78",sectionFallbackProse:null}),(0,b.jsx)(G,{title:"What stalled",anchor:"what-stalled",items:a.what_stalled??[],tone:"#ed8936",sectionFallbackProse:"No stalls stuck this week."}),(0,b.jsx)(J,{items:a.what_surprised??[]}),(0,b.jsx)(K,{items:a.where_to_lean??[]}),(0,b.jsx)(F,{shipped:a.shipped}),!a.working_shapes&&(0,b.jsx)(t,{digest:a})]})}function t({digest:a}){let c=a.recurring_themes??[],d=a.outcome_correlations??[],e=a.friction_categories??[],f=a.suggestions,g=a.on_the_horizon,h=a.fun_ending;return c.length>0||d.length>0||e.length>0||(f?.claude_md_additions?.length??0)>0||g||h?(0,b.jsxs)("div",{style:{padding:"14px 16px",marginTop:18,borderRadius:8,background:"color-mix(in srgb, var(--af-text-tertiary) 5%, var(--af-surface))",border:"1px dashed var(--af-border-subtle)",fontSize:12,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Legacy digest:"})," this week was generated under a previous prompt. Re-roll the digest to refresh it under the new working-shapes narrative."]}):null}function u({digest:a}){let c=a.agent_min_total/60,e=c>=1?`${c.toFixed(1)}h`:`${Math.round(a.agent_min_total)}m`,f=function(a){let b=a.reduce((a,b)=>a+b,0);if(0===b)return null;for(let c=1;c<=24;c++){let d=0,e=0;for(let b=0;b<=24-c;b++){let f=0;for(let d=0;d<c;d++)f+=a[b+d]??0;f>d&&(d=f,e=b)}if(d/b>=.6)return{start:e,end:e+c,share_pct:d/b*100}}return null}(a.hours_distribution),g=new Map(a.days_active.map(a=>[a.date,a])),h=B(a.window.start),i=h.map(a=>g.get(a)?.agent_min??0),j=Math.max(...i,1),k=a.busiest_day?h.indexOf(a.busiest_day.date):-1,l=a.longest_run&&a.busiest_day?Math.min(1,a.longest_run.active_min/Math.max(1,a.busiest_day.agent_min)):0,m=[];return(m.push({label:"Agent time",primary:e,detail:`across ${a.days_active.length} day${1===a.days_active.length?"":"s"}`,visual:(0,b.jsx)(v,{values:i,max:j,highlight:-1})}),a.busiest_day&&m.push({label:"Busiest day",href:`/digest/${a.busiest_day.date}`,primary:`${M(a.busiest_day.date)} ${a.busiest_day.date.slice(5)}`,detail:`${Math.round(a.busiest_day.agent_min)}m \xb7 ${a.busiest_day.shipped_count} PR${1===a.busiest_day.shipped_count?"":"s"}`,visual:(0,b.jsx)(v,{values:i,max:j,highlight:k})}),a.longest_run&&m.push({label:"Longest single run",href:`/sessions/${a.longest_run.session_id}`,title:`Session ${a.longest_run.session_id.slice(0,8)}`,primary:`${Math.round(a.longest_run.active_min)}m`,detail:`${a.longest_run.project_display} \xb7 ${M(a.longest_run.date)} ${a.longest_run.date.slice(5)}`,visual:(0,b.jsx)(w,{ratio:l,caption:"vs busiest day"})}),f&&m.push({label:"Peak hours",title:`${A(f.start,f.end)} carried ${f.share_pct.toFixed(0)}% of the week's agent time`,primary:A(f.start,f.end),detail:`${f.share_pct.toFixed(0)}% of agent time`,visual:(0,b.jsx)(x,{hours:a.hours_distribution,peakStart:f.start,peakEnd:f.end})}),0===m.length)?null:(0,b.jsx)("section",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.min(m.length,4)}, minmax(0, 1fr))`,gap:10,marginBottom:20},children:m.map((a,c)=>{let e=(0,b.jsxs)("div",{style:{padding:"12px 14px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",minHeight:90},title:a.title,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginBottom:6},children:a.label}),(0,b.jsx)("div",{style:{fontSize:17,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",lineHeight:1.2},children:a.primary}),(0,b.jsx)("div",{style:{fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:a.detail})]}),a.visual&&(0,b.jsx)("div",{style:{marginTop:10},children:a.visual})]});return a.href?(0,b.jsx)(d.default,{href:a.href,style:{textDecoration:"none"},children:e},c):(0,b.jsx)("div",{children:e},c)})})}function v({values:a,max:c,highlight:d}){return(0,b.jsx)("div",{style:{display:"flex",gap:2,alignItems:"flex-end",height:18},children:a.map((a,e)=>{let f=c>0?Math.max(1,a/c*18):1,g=e===d;return(0,b.jsx)("div",{style:{flex:1,height:f,borderRadius:1,background:g?"var(--af-accent)":a>0?"color-mix(in srgb, var(--af-accent) 30%, transparent)":"var(--af-border-subtle)"}},e)})})}function w({ratio:a,caption:c}){let d=100*Math.max(0,Math.min(1,a));return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{height:6,borderRadius:99,overflow:"hidden",background:"var(--af-border-subtle)"},children:(0,b.jsx)("div",{style:{width:`${d}%`,height:"100%",background:"var(--af-accent)"}})}),(0,b.jsxs)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:3},children:[Math.round(d),"% ",c]})]})}function x({hours:a,peakStart:c,peakEnd:d}){let e=Math.max(...a,1);return(0,b.jsx)("div",{style:{display:"flex",gap:1,alignItems:"flex-end",height:18},children:a.map((a,f)=>{let g=f>=c&&f<=d,h=e>0?Math.max(1,a/e*18):1;return(0,b.jsx)("div",{style:{flex:1,height:h,borderRadius:1,background:g?"var(--af-accent)":a>0?"color-mix(in srgb, var(--af-accent) 22%, transparent)":"var(--af-border-subtle)"}},f)})})}function y({digest:a}){if(0===a.days_active.length)return null;let c=Math.max(...a.days_active.map(a=>a.agent_min)),e=new Map(a.days_active.map(a=>[a.date,a])),f=B(a.window.start);return(0,b.jsx)("section",{style:{display:"flex",gap:6,alignItems:"stretch",padding:"12px 0",marginBottom:24},children:f.map((a,f)=>{let g=e.get(a),h=g?.agent_min??0,i=c>0&&h>0?Math.max(8,h/c*100):0,j=g?z[g.outcome_day]:"var(--af-text-tertiary)",k=g?.helpfulness_day?m[g.helpfulness_day]:null;return(0,b.jsxs)(d.default,{href:g?`/digest/${a}`:"#",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch",gap:2,textDecoration:"none",pointerEvents:g?"auto":"none"},title:g?`${a} \xb7 ${Math.round(h)}m \xb7 ${g.outcome_day}${g.shipped_count>0?` \xb7 ${g.shipped_count} PR`:""}${g.helpfulness_day?` \xb7 helpfulness ${g.helpfulness_day}`:""}`:"no activity",children:[(0,b.jsxs)("div",{style:{height:56,borderRadius:4,position:"relative",background:"var(--af-surface)",border:`1px solid ${g?`color-mix(in srgb, ${j} 28%, var(--af-border-subtle))`:"var(--af-border-subtle)"}`,overflow:"hidden"},children:[g&&(0,b.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${i}%`,background:`color-mix(in srgb, ${j} 28%, transparent)`}}),g?.dominant_shape&&p[g.dominant_shape]&&(0,b.jsx)("div",{title:`${o[g.dominant_shape]??g.dominant_shape}`,style:{position:"absolute",top:0,left:0,right:0,height:3,background:p[g.dominant_shape]}}),k&&(0,b.jsx)("div",{style:{position:"absolute",top:4,right:4,width:6,height:6,borderRadius:999,background:k},title:g?.helpfulness_day??""})]}),(0,b.jsx)("div",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",color:"var(--af-text-tertiary)",textAlign:"center"},children:n[f]}),(0,b.jsx)("div",{style:{fontSize:9,fontFamily:"var(--font-mono)",color:g?"var(--af-text-secondary)":"var(--af-text-tertiary)",textAlign:"center"},children:g?`${Math.round(h)}m`:"—"})]},f)})})}let z={shipped:"#48bb78",partial:"#4299e1",blocked:"#f56565",exploratory:"#a0aec0",trivial:"#cbd5e0",idle:"#cbd5e0"};function A(a,b){let c=a=>`${a%12||12}${a<12||24===a?"am":"pm"}`;return`${c(a)}–${c(b)}`}function B(a){let b=[],c=new Date(a);for(let a=0;a<7;a++){let d=new Date(c);d.setDate(c.getDate()+a);let e=d.getFullYear(),f=String(d.getMonth()+1).padStart(2,"0"),g=String(d.getDate()).padStart(2,"0");b.push(`${e}-${f}-${g}`)}return b}function C({digest:a}){let c=a.trajectory&&a.trajectory.length>0,e=a.standout_days&&a.standout_days.length>0,f=a.projects.filter(a=>a.share_pct>=5||a.shipped_count>0),g=f.length>0;return c||e||g?(0,b.jsxs)(L,{title:"Through the week",anchor:"through-the-week",children:[(c||e)&&(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:c&&e?"minmax(0, 1.4fr) minmax(0, 1fr)":"1fr",gap:28,marginBottom:22*!!g},children:[c&&(0,b.jsxs)("div",{children:[(0,b.jsx)(D,{children:"Trajectory"}),(0,b.jsx)("ol",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:6},children:a.trajectory.map(a=>(0,b.jsxs)("li",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0,width:64,paddingTop:3,textDecoration:"none"},children:[M(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text-secondary)"},children:j(a.line)})]},a.date))})]}),e&&(0,b.jsxs)("div",{children:[(0,b.jsx)(D,{children:"Standout days"}),(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:8},children:a.standout_days.map(a=>(0,b.jsxs)("li",{style:{padding:"10px 12px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:11,fontWeight:600,color:"var(--af-accent)",textDecoration:"none",fontFamily:"var(--font-mono)",marginRight:8},children:[M(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{fontSize:12.5,lineHeight:1.55,color:"var(--af-text)"},children:j(a.why)})]},a.date))})]})]}),g&&(0,b.jsxs)("div",{children:[(0,b.jsx)(D,{children:"Project areas"}),(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:10},children:f.map(a=>(0,b.jsxs)("li",{style:{padding:"11px 13px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,marginBottom:6*!!a.description},children:[(0,b.jsx)(d.default,{href:`/projects/${encodeURIComponent(a.name)}`,style:{fontSize:13,fontWeight:600,color:"var(--af-text)",textDecoration:"none",flex:1,minWidth:0,letterSpacing:"-0.01em"},children:a.display_name}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)"},children:[Math.round(a.agent_min),"m · ",a.share_pct.toFixed(0),"% · ",a.shipped_count," PR"]})]}),a.description&&(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.5,margin:0,color:"var(--af-text-secondary)"},children:a.description})]},a.name))})]})]}):null}function D({children:a}){return(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,marginBottom:10},children:a})}function E({label:a,payload:d}){let[g,h]=(0,c.useState)(!1);return(0,b.jsxs)("div",{style:{position:"relative"},children:[(0,b.jsx)("pre",{style:{margin:0,padding:"10px 12px",paddingRight:96,borderRadius:6,background:"var(--af-surface-raised)",border:"1px solid var(--af-border-subtle)",fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text)",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.55,overflowX:"auto",maxHeight:280,overflowY:"auto"},children:d}),(0,b.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(d),h(!0),setTimeout(()=>h(!1),1500)}catch{}},style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:5,background:g?"color-mix(in srgb, #48bb78 18%, var(--af-surface))":"var(--af-surface)",border:`1px solid ${g?"#48bb78":"var(--af-border-subtle)"}`,color:g?"#48bb78":"var(--af-text-secondary)",fontSize:10,fontWeight:600,cursor:"pointer"},children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.Check,{size:10})," Copied"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Copy,{size:10})," ",a]})})]})}function F({shipped:a}){let[e,f]=(0,c.useState)(!1);if(0===a.length)return null;let g=a.length>=10,h=g&&!e?a.slice(0,5):a,i=a.length-h.length;return(0,b.jsxs)(L,{title:`Shipped (${a.length})`,anchor:"shipped",children:[(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:h.map((a,c)=>(0,b.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"baseline",padding:"6px 10px",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",flexShrink:0,width:56,textDecoration:"none"},children:[M(a.date)," ",a.date.slice(5)]}),(0,b.jsx)("span",{style:{flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:a.project})]},c))}),g&&i>0&&(0,b.jsxs)("button",{type:"button",onClick:()=>f(!0),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:["+",i," more"]}),g&&e&&(0,b.jsx)("button",{type:"button",onClick:()=>f(!1),style:{marginTop:6,padding:"4px 10px",borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-secondary)",cursor:"pointer",fontFamily:"var(--font-mono)"},children:"show less"})]})}function G({title:a,anchor:c,items:d,tone:e,sectionFallbackProse:f}){return d&&0!==d.length?(0,b.jsx)(L,{title:a,anchor:c,children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:d.map((a,c)=>(0,b.jsx)(H,{item:a,tone:e},c))})}):null===f?null:(0,b.jsx)(L,{title:a,anchor:c,children:(0,b.jsx)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-tertiary)",margin:0,padding:"8px 0"},children:f})})}function H({item:a,tone:c}){let e=I(a.anchor);return(0,b.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${c} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${c} 22%, var(--af-border))`},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:c,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${c} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${c} 28%, transparent)`,fontFamily:"var(--font-mono)"},title:`Anchor: ${a.anchor}`,children:e})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:a.detail}),(0,b.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${c} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{fontSize:10,fontWeight:600,color:c,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[M(a.evidence.date)," ",a.evidence.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),a.evidence.quote,(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]})}function I(a){return"plan-mode-gap"===a?"Plan-mode gap":a.startsWith("interaction_grammar.")?a.slice(20).replace(/_/g," "):o[a]??a}function J({items:a}){return a&&0!==a.length?(0,b.jsx)(L,{title:"What surprised",anchor:"what-surprised",children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:a.map((a,c)=>{let e="#b794f4";return(0,b.jsxs)("li",{style:{padding:"12px 14px",borderRadius:10,background:`color-mix(in srgb, ${e} 6%, var(--af-surface))`,border:`1px solid color-mix(in srgb, ${e} 22%, var(--af-border))`},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:4,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",flex:1,minWidth:0},children:a.title}),(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:e,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${e} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:q[a.surprise_kind]??a.surprise_kind})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 8px",color:"var(--af-text)"},children:a.detail}),(0,b.jsxs)("div",{style:{padding:"6px 10px",borderRadius:6,background:"var(--af-surface-raised)",borderLeft:`2px solid color-mix(in srgb, ${e} 50%, transparent)`,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{fontSize:10,fontWeight:600,color:e,fontFamily:"var(--font-mono)",flexShrink:0,textDecoration:"none",paddingTop:2},children:[M(a.evidence.date)," ",a.evidence.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,lineHeight:1.5,color:"var(--af-text)",fontStyle:"italic"},children:[(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"“"}),a.evidence.quote,(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"”"})]})]})]},c)})})}):null}function K({items:a}){return a&&0!==a.length?(0,b.jsx)(L,{title:"Where to lean",anchor:"where-to-lean",children:(0,b.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:12},children:a.map((a,c)=>{let e="var(--af-accent)",f=I(a.anchor);return(0,b.jsxs)("li",{style:{padding:"14px 16px",borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:6,flexWrap:"wrap"},children:[(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:e,padding:"1px 7px",borderRadius:999,background:`color-mix(in srgb, ${e} 14%, transparent)`,border:`1px solid color-mix(in srgb, ${e} 28%, transparent)`,fontFamily:"var(--font-mono)"},children:r[a.lean_kind]??a.lean_kind}),(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",flex:1,minWidth:0},children:a.title}),(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},title:`Anchor: ${a.anchor}`,children:["↳ ",f]})]}),(0,b.jsx)("p",{style:{fontSize:12,lineHeight:1.6,margin:"0 0 10px",color:"var(--af-text)"},children:a.detail}),a.copyable&&(0,b.jsx)(E,{label:`Copy ${"claude-md"===a.lean_kind?"block":"snippet"}`,payload:a.copyable}),(0,b.jsxs)("div",{style:{marginTop:8,fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:["Evidence · ",(0,b.jsxs)(d.default,{href:`/digest/${a.evidence.date}`,style:{color:"var(--af-text-tertiary)",textDecoration:"underline"},children:[M(a.evidence.date)," ",a.evidence.date.slice(5)]})," · “",a.evidence.quote.slice(0,100),a.evidence.quote.length>100?"…":"","”"]})]},c)})})}):null}function L({title:a,anchor:c,children:d}){return(0,b.jsxs)("section",{id:c,style:{marginBottom:28,scrollMarginTop:24},children:[(0,b.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:"0 0 12px"},children:a}),d]})}function M(a){return new Date(`${a}T12:00:00`).toLocaleDateString("en-US",{weekday:"short"})}let N={"user-steering":"#ed8936","subagent-burst":"#9f7aea","long-autonomous":"#4299e1","plan-mode":"#38b2ac","pr-ship":"#48bb78","harness-chain":"#ed64a6",interrupt:"#f56565","brainstorm-loop":"#9f7aea","agent-loop":"#f56565"},O={"user-steering":"Steering","subagent-burst":"Subagents","long-autonomous":"Autonomous","plan-mode":"Plan","pr-ship":"Shipped","harness-chain":"Harness",interrupt:"Interrupt","brainstorm-loop":"Brainstorm","agent-loop":"Loop"};function P({sessions:a}){return(0,b.jsxs)(L,{title:`Top ${a.length} session${1===a.length?"":"s"} this week`,anchor:"top-sessions",children:[(0,b.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",marginTop:-4,marginBottom:14,fontStyle:"italic",lineHeight:1.5,maxWidth:720},children:"Picked by significance — active time × subagents × ships, capped to one per project. Each card walks the timeline with annotated moments to surface the texture of how you drove the agent."}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:a.map(a=>(0,b.jsx)(Q,{session:a},a.session_id))})]})}function Q({session:a}){let c=a.working_shape?o[a.working_shape]??a.working_shape:null,e=a.working_shape?p[a.working_shape]??"var(--af-text-tertiary)":"var(--af-text-tertiary)",f=a.wall_min/60,g=a.active_min/60,h=f>=1?`${f.toFixed(1)}h wall`:`${Math.round(a.wall_min)}m wall`,i=g>=1?`${g.toFixed(1)}h active`:`${Math.round(a.active_min)}m active`;return(0,b.jsx)("div",{style:{borderRadius:10,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderTop:`3px solid ${e}`,overflow:"hidden"},children:(0,b.jsxs)("div",{style:{padding:"16px 18px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",marginBottom:6},children:[(0,b.jsx)(d.default,{href:`/sessions/${a.session_id}`,style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",textDecoration:"none"},children:a.project_display}),(0,b.jsx)(l.AgentBadge,{agent:a.agent}),(0,b.jsxs)(d.default,{href:`/digest/${a.date}`,style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-accent)",textDecoration:"none"},children:[M(a.date)," ",a.date.slice(5)]}),(0,b.jsxs)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:[i," · ",h," · ",a.turn_count," turns"]}),c&&(0,b.jsx)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:`color-mix(in srgb, ${e} 14%, transparent)`,color:e},children:c}),"shipped"===a.outcome&&a.shipped_prs.length>0&&(0,b.jsxs)("span",{style:{padding:"2px 9px",borderRadius:999,fontSize:11,fontWeight:600,background:"color-mix(in srgb, #48bb78 14%, transparent)",color:"#48bb78"},children:["✓ ",a.shipped_prs.length," PR",1===a.shipped_prs.length?"":"s"]})]}),a.day_signature&&(0,b.jsxs)("p",{style:{fontSize:12,fontStyle:"italic",color:"var(--af-text-secondary)",margin:"0 0 14px",lineHeight:1.5,maxWidth:760},children:["“",a.day_signature,"”"]}),(0,b.jsx)(R,{session:a}),a.steering_summary&&(0,b.jsxs)("p",{style:{fontSize:12,lineHeight:1.55,margin:"10px 0 12px",color:"var(--af-text-secondary)",maxWidth:780,paddingLeft:10,borderLeft:"2px solid var(--af-border-subtle)"},children:[(0,b.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--af-text-tertiary)",marginRight:6},children:"steering"}),a.steering_summary]}),(0,b.jsx)(T,{session:a}),(0,b.jsx)(W,{session:a}),a.pins.length>0&&(0,b.jsx)("ol",{style:{listStyle:"none",padding:0,margin:"12px 0 0",display:"flex",flexDirection:"column",gap:6},children:a.pins.map((a,c)=>(0,b.jsx)(X,{pin:a},c))})]})})}function R({session:a}){return a.why_picked||a.what_worked||a.what_hit_friction?(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,margin:"0 0 6px"},children:[a.why_picked&&(0,b.jsx)(S,{label:"Why this session",tone:"var(--af-text-tertiary)",accent:"var(--af-text-tertiary)",text:a.why_picked}),a.session_summary&&(0,b.jsx)(S,{label:"What happened",tone:"var(--af-text)",accent:"var(--af-text-secondary)",text:a.session_summary,weight:500}),a.what_worked&&(0,b.jsx)(S,{label:"What worked",tone:"var(--af-text)",accent:"#48bb78",text:a.what_worked}),a.what_hit_friction&&(0,b.jsx)(S,{label:"What hit friction",tone:"var(--af-text)",accent:"#ed8936",text:a.what_hit_friction})]}):a.session_summary?(0,b.jsx)("p",{style:{fontSize:13,lineHeight:1.55,margin:"0 0 8px",color:"var(--af-text)",maxWidth:780},children:a.session_summary}):null}function S({label:a,tone:c,accent:d,text:e,weight:f=400}){return(0,b.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start",maxWidth:800},children:[(0,b.jsx)("span",{style:{flexShrink:0,width:132,paddingTop:2,fontSize:9.5,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:d},children:a}),(0,b.jsx)("span",{style:{fontSize:13,lineHeight:1.55,color:c,fontWeight:f},children:e})]})}function T({session:a}){let{user_authored_skills:c,user_authored_subagents:d,stock_skills:e,top_tools:f}=a;return c.length>0||d.length>0||e.length>0||f.length>0?(0,b.jsxs)("div",{style:{marginBottom:4},children:[d.length>0&&(0,b.jsx)(U,{label:"Your subagents",children:d.map(a=>(0,b.jsxs)(V,{tone:"user",children:[a.type,a.count>1?` \xd7${a.count}`:""]},a.type))}),(c.length>0||e.length>0)&&(0,b.jsxs)(U,{label:"Skills loaded",children:[c.map(a=>(0,b.jsx)(V,{tone:"user",children:a},a)),e.slice(0,6).map(a=>(0,b.jsx)(V,{tone:"stock",children:a},a))]}),f.length>0&&(0,b.jsx)(U,{label:"Top tools",children:f.slice(0,4).map((a,c)=>(0,b.jsx)(V,{children:a},c))})]}):null}function U({label:a,children:c}){return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"3px 0",fontSize:11},children:[(0,b.jsx)("span",{style:{minWidth:96,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:10,textTransform:"uppercase",letterSpacing:"0.04em"},children:a}),(0,b.jsx)("div",{style:{display:"flex",gap:5,flexWrap:"wrap",flex:1},children:c})]})}function V({children:a,tone:c,title:d}){return(0,b.jsx)("span",{title:d,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:10,fontFamily:"var(--font-mono)",background:"user"===c?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===c?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:a})}function W({session:a}){let c=a.timeline.active_intervals,d=c.length>0?Math.max(...c.map(a=>a.end_min)):0,e=Math.max(1,a.timeline.duration_min,d);return(0,b.jsxs)("div",{style:{marginTop:10,marginBottom:4},children:[(0,b.jsxs)("div",{style:{position:"relative",width:"100%",height:28,background:"var(--af-border-subtle)",borderRadius:4},children:[c.map((a,c)=>{let d=a.start_min/e*100,f=Math.max(.6,(a.end_min-a.start_min)/e*100);return(0,b.jsx)("div",{style:{position:"absolute",top:6,bottom:6,left:`${d}%`,width:`${f}%`,background:"color-mix(in srgb, var(--af-accent) 30%, transparent)",borderRadius:2}},c)}),a.pins.map((a,c)=>{let d=Math.max(0,Math.min(100,a.start_min/e*100)),f=void 0!==a.end_min?Math.max(d+.5,Math.min(100,a.end_min/e*100)):d,g=void 0!==a.end_min&&f>d+.5,h=N[a.kind]??"var(--af-accent)";return(0,b.jsxs)("div",{children:[g&&(0,b.jsx)("div",{style:{position:"absolute",top:4,bottom:4,left:`${d}%`,width:`${f-d}%`,background:`color-mix(in srgb, ${h} 35%, transparent)`,border:`1px solid ${h}`,borderRadius:3},title:`${O[a.kind]}: ${a.label}`}),(0,b.jsx)("div",{style:{position:"absolute",top:-3,bottom:-3,left:`${d}%`,width:3,background:h,borderRadius:1,transform:"translateX(-1.5px)"},title:`${O[a.kind]}: ${a.label}`})]},c)})]}),(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",marginTop:3},children:[(0,b.jsx)("span",{children:"0m"}),(0,b.jsx)("span",{children:Y(e/2)}),(0,b.jsxs)("span",{children:[Y(e)," wall"]})]})]})}function X({pin:a}){let c=N[a.kind]??"var(--af-accent)",d=void 0!==a.end_min&&a.end_min>a.start_min+.5?`${Y(a.start_min)}–${Y(a.end_min)}`:Y(a.start_min);return(0,b.jsxs)("li",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:12,lineHeight:1.5},children:[(0,b.jsx)("span",{style:{flexShrink:0,width:3,height:3,marginTop:7,borderRadius:999,background:c}}),(0,b.jsx)("span",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",paddingTop:1,minWidth:60},children:d}),(0,b.jsx)("span",{style:{flexShrink:0,padding:"1px 7px",borderRadius:999,fontSize:9,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",background:`color-mix(in srgb, ${c} 15%, transparent)`,color:c,marginTop:1},children:O[a.kind]??a.kind}),(0,b.jsx)("span",{style:{color:"var(--af-text)",maxWidth:640},children:a.label})]})}function Y(a){if(a>=60){let b=Math.round(a),c=Math.floor(b/60),d=b%60;return`${c}h${d>0?` ${d}m`:""}`}return`${Math.round(10*a)/10}m`}function Z({monday:a,isStreaming:c,aiEnabled:d,progress:e,onGenerate:f}){let g=new Date(`${a}T12:00:00`),h=new Date(g);h.setDate(g.getDate()+6);let i=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),j=`${i(g)} — ${i(h)}`;return(0,b.jsx)("div",{style:{maxWidth:980,margin:"0 auto",padding:"60px 40px"},children:(0,b.jsxs)("div",{style:{margin:"0 auto",maxWidth:480,padding:"32px 28px",borderRadius:14,background:"var(--af-surface)",border:"1px dashed var(--af-border-subtle)",textAlign:"center"},children:[(0,b.jsx)("div",{style:{width:44,height:44,borderRadius:12,margin:"0 auto 16px",background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)",fontSize:20},children:"✦"}),(0,b.jsx)("h2",{style:{fontSize:16,fontWeight:600,margin:"0 0 6px",color:"var(--af-text)",letterSpacing:"-0.01em"},children:c?"Generating digest…":"No digest yet for this week"}),(0,b.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,margin:"0 0 18px",color:"var(--af-text-secondary)"},children:c?`Synthesizing ${j} from this week's day digests. This usually takes 5–10 minutes.`:d?`Once generated, this view shows top sessions, trajectory, findings, and project areas for ${j}.`:`Enable AI features in Settings to synthesize a weekly narrative for ${j}. Deterministic stats are still available below in the live digest as soon as data lands.`}),d&&(0,b.jsx)("button",{onClick:f,disabled:c,style:{padding:"9px 18px",borderRadius:8,background:c?"var(--af-border-subtle)":"var(--af-accent)",color:c?"var(--af-text-tertiary)":"white",border:"none",cursor:c?"default":"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.005em"},children:c?"Generating…":"Generate digest"}),e&&(0,b.jsx)("div",{style:{marginTop:12,fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:e})]})})}a.s(["WeekDigestView",0,function({initial:a,monday:d,aiEnabled:e,autoFire:f=!1,prior:g}){var h,i;let[j,k]=(0,c.useState)(a),[l,m]=(0,c.useState)("idle"),[n,o]=(0,c.useState)(""),p=(0,c.useRef)(!1),q=(0,c.useCallback)(async(a=!1)=>{m("streaming"),o("Starting...");let b=`/api/digest/week/${d}${a?"?force=1":""}`,c=await fetch(b,{method:"POST"});if(!c.ok||!c.body){m("error"),o(`Error ${c.status}`);return}let e=c.body.getReader(),f=new TextDecoder,g="";for(;;){let{done:a,value:b}=await e.read();if(a)break;let c=(g+=f.decode(b,{stream:!0})).split("\n\n");for(let a of(g=c.pop()??"",c)){let b=a.split("\n").find(a=>a.startsWith("data: "));if(b)try{let a=JSON.parse(b.slice(6));if("status"===a.type)o(a.text);else if("dependency"===a.type)o(`${"day"===a.kind?"Day":"Week"} ${a.key} ${a.status}`);else if("entry"===a.type)o(`Enriching ${a.index}/${a.total}...`);else if("progress"===a.type){let b=Math.round(a.elapsed_ms/1e3);o(`Claude composing… ${a.bytes.toLocaleString()} chars (${b}s)`)}else if("digest"===a.type)a.digest&&"week"===a.digest.scope&&k(a.digest),o("Rendering...");else if("saved"===a.type)o("Saved.");else if("error"===a.type){m("error"),o(a.message);return}}catch{}}}m("done"),o("")},[d]);(0,c.useEffect)(()=>{f&&!p.current&&"idle"===l&&(p.current=!0,q(!1))},[f,l,q]);let r="streaming"===l,t=!!j?.headline,u=null;return(!t&&e?u=(0,b.jsx)("button",{onClick:()=>q(!1),disabled:r,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:(h=r)?"default":"pointer",fontSize:11,fontWeight:600,opacity:h?.6:1},children:r?"Generating...":j?"Generate":"Generate digest"}):e&&(u=(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",gap:6,alignItems:"center"},children:["✓ Up to date",(0,b.jsx)("button",{onClick:()=>q(!0),disabled:r,title:"Re-roll the narrative for this week",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:(i=r)?"default":"pointer",opacity:i?.6:1},children:r?"...":"Re-roll"})]})),n&&(u=(0,b.jsxs)(b.Fragment,{children:[u,(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:n})]})),j)?(0,b.jsx)(s,{digest:j,aiEnabled:e,actions:u,priorDigest:g??null}):(0,b.jsx)(Z,{monday:d,isStreaming:r,aiEnabled:e,progress:n,onGenerate:()=>q(!1)})}],85041)},76435,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(13749),f=a.i(50522);let g=(0,a.i(70106).default)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var h=a.i(33508);function i({inDrawer:a=!1}={}){let[c,e]=(0,d.useState)("weeks"),[f,g]=(0,d.useState)(null),[h,p]=(0,d.useState)(null);return(0,d.useEffect)(()=>{fetch("/api/digest/week-index?count=12").then(a=>a.json()).then(a=>g(a.weeks)).catch(()=>g([])),fetch("/api/digest/month-index?count=6").then(a=>a.json()).then(a=>p(a.months)).catch(()=>p([]))},[]),(0,b.jsxs)("div",{style:a?{padding:"0 18px"}:{maxWidth:980,margin:"0 auto",padding:"28px 40px 0"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:a?14:18},children:[!a&&(0,b.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:0,marginRight:4},children:"History"}),(0,b.jsx)("div",{style:m,children:["weeks","months"].map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>e(a),style:{...n,background:c===a?"var(--af-accent)":"transparent",color:c===a?"white":"var(--af-text-secondary)"},children:"weeks"===a?"Weeks":"Months"},a))})]}),"weeks"===c?null===f?(0,b.jsx)(l,{children:"Loading weeks…"}):0===f.length?(0,b.jsx)(l,{children:"No history yet."}):(0,b.jsx)("ul",{style:o,children:f.map(a=>(0,b.jsx)(j,{w:a},a.start))}):null===h?(0,b.jsx)(l,{children:"Loading months…"}):0===h.length?(0,b.jsx)(l,{children:"No history yet."}):(0,b.jsx)("ul",{style:o,children:h.map(a=>(0,b.jsx)(k,{m:a},a.start))})]})}function j({w:a}){let d=0===a.active_days&&!a.in_progress&&!a.saved_key,e=a.saved_key?`/insights/${a.saved_key}`:`/insights/week-${a.start}`,f=a.saved_key&&a.headline?a.headline:d?"no data":a.in_progress?"in progress · click to view":`${a.active_days} active day${1===a.active_days?"":"s"} \xb7 click to generate`;return(0,b.jsx)("li",{style:p(!!a.saved_key),children:(0,b.jsxs)(c.default,{href:e,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:q,children:[(0,b.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:["W",String(a.iso_week).padStart(2,"0")," · ",a.label]}),a.in_progress&&(0,b.jsx)("span",{style:s,children:"in progress"}),a.saved_key&&(0,b.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[a.shipped_count," PR · ",a.agent_min,"m"]})]}),(0,b.jsx)("span",{style:r,children:f})]})})}function k({m:a}){let d=0===a.active_days&&!a.in_progress&&!a.saved_key,e=a.saved_key?`/insights/${a.saved_key}`:`/insights/month-${a.start.slice(0,7)}`,f=a.saved_key&&a.headline?a.headline:d?"no data":a.in_progress?"in progress · click to view":`${a.active_days} active day${1===a.active_days?"":"s"} \xb7 click to generate`;return(0,b.jsx)("li",{style:p(!!a.saved_key),children:(0,b.jsxs)(c.default,{href:e,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:q,children:[(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:a.label}),a.in_progress&&(0,b.jsx)("span",{style:s,children:"in progress"}),a.saved_key&&(0,b.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[a.shipped_count," PR · ",a.agent_min,"m"]})]}),(0,b.jsx)("span",{style:r,children:f})]})})}function l({children:a}){return(0,b.jsx)("div",{style:{padding:"20px 18px",borderRadius:10,border:"1px dashed var(--af-border)",background:"var(--af-surface)",fontSize:13,color:"var(--af-text-tertiary)",lineHeight:1.55},children:a})}let m={display:"inline-flex",gap:3,border:"1px solid var(--af-border)",borderRadius:8,padding:2},n={padding:"5px 14px",fontSize:12,fontWeight:600,border:"none",borderRadius:6,cursor:"pointer"},o={listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4};function p(a){return{display:"flex",alignItems:"stretch",gap:14,padding:"10px 14px",borderRadius:10,border:`1px solid ${a?"color-mix(in srgb, var(--af-accent) 24%, var(--af-border))":"var(--af-border-subtle)"}`,background:a?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",transition:"border-color 0.15s"}}let q={display:"flex",alignItems:"center",gap:8,minWidth:0},r={fontSize:11,color:"var(--af-text-tertiary)",lineHeight:1.5,fontFamily:"var(--font-mono)"},s={fontSize:10,fontWeight:500,padding:"2px 6px",borderRadius:4,background:"color-mix(in srgb, #f5b445 18%, transparent)",color:"#c08a1f",letterSpacing:"0.02em"};function t({target:a,dir:d}){var g;let h="prev"===d?e.ChevronLeft:f.ChevronRight;return a?(0,b.jsxs)(c.default,{href:`/insights/${a.key}`,style:(g=a.cached,{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:`1px solid ${g?"color-mix(in srgb, var(--af-accent) 28%, var(--af-border))":"var(--af-border-subtle)"}`,background:g?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",color:g?"var(--af-accent)":"var(--af-text-secondary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",textDecoration:"none"}),title:a.cached?`Saved digest \xb7 ${a.label}`:`${a.label} (no saved digest yet — will prompt to Generate)`,children:[(0,b.jsx)(h,{size:14}),(0,b.jsx)("span",{children:a.label})]}):(0,b.jsx)("span",{style:w,title:`No ${"prev"===d?"earlier":"later"} period`,children:(0,b.jsx)(h,{size:14})})}function u({onClose:a}){return(0,b.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Insights history",style:{position:"fixed",inset:0,zIndex:200,display:"flex",justifyContent:"flex-end"},children:[(0,b.jsx)("div",{onClick:a,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.32)",animation:"fade-in 120ms ease-out"}}),(0,b.jsxs)("aside",{style:{position:"relative",width:"min(440px, 92vw)",height:"100vh",background:"var(--background)",borderLeft:"1px solid var(--af-border-subtle)",boxShadow:"-12px 0 40px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",animation:"slide-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1)"},children:[(0,b.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("h2",{style:{fontSize:13,fontWeight:600,margin:0,color:"var(--af-text)"},children:"Browse insights history"}),(0,b.jsx)("button",{type:"button",onClick:a,"aria-label":"Close history",style:{marginLeft:"auto",width:26,height:26,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:"transparent",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,b.jsx)(h.X,{size:14})})]}),(0,b.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"18px 0"},children:(0,b.jsx)(i,{inDrawer:!0})})]}),(0,b.jsx)("style",{children:`
|
|
2
2
|
@keyframes slide-in { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
|
|
3
3
|
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
4
4
|
`})]})}let v={display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text)",fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"inherit"},w={display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text-tertiary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",opacity:.45,cursor:"default"};a.s(["InsightsTopBar",0,function({scope:a,currentLabel:e,rangeLabel:f,prev:h,next:i}){let[j,k]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{if(!j)return;let a=a=>{"Escape"===a.key&&k(!1)};return window.addEventListener("keydown",a),document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",a),document.body.style.overflow=""}},[j]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("header",{style:{position:"sticky",top:0,zIndex:50,background:"color-mix(in srgb, var(--background) 90%, transparent)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderBottom:"1px solid var(--af-border-subtle)"},className:"no-print",children:(0,b.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"12px 40px",display:"flex",alignItems:"center",gap:14,minHeight:44},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[(0,b.jsx)(c.default,{href:"/insights",style:{fontSize:10,fontWeight:700,color:"var(--af-text-tertiary)",textDecoration:"none",textTransform:"uppercase",letterSpacing:"0.08em",flexShrink:0},title:"Latest week digest",children:"Insights"}),(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontSize:11,flexShrink:0},children:"›"}),(0,b.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),f&&(0,b.jsx)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",flexShrink:0},children:f})]}),(0,b.jsxs)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:6},children:[(0,b.jsx)(t,{target:h,dir:"prev"}),(0,b.jsx)(t,{target:i,dir:"next"}),(0,b.jsxs)("button",{type:"button",onClick:()=>k(!0),style:v,title:`Browse ${"week"===a?"weekly":"monthly"} history`,children:[(0,b.jsx)(g,{size:13}),(0,b.jsx)("span",{children:"Browse"})]})]})]})}),j&&(0,b.jsx)(u,{onClose:()=>k(!1)})]})}],76435)}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[44422,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(50944),e=a.i(72131),f=a.i(70106);let g=(0,f.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),h=(0,f.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),i=(0,f.default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),j=(0,f.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),k=(0,f.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var l=a.i(87532);let m=(0,f.default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),n=(0,f.default)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var o=a.i(69439),p=a.i(71727);let q=(0,f.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),r=(0,f.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var s=a.i(3444);let t=(0,f.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),u=(0,f.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function v(a){if("u">typeof document){document.documentElement.setAttribute("data-theme",a);try{document.cookie=`claude-lens-theme=${a};path=/;max-age=31536000;samesite=lax`}catch{}}}function w(){let[a,c]=(0,e.useState)("dark"),[d,f]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let a=document.documentElement.getAttribute("data-theme");if("light"===a||"dark"===a)c(a);else{let a="dark";c(a),v(a)}f(!0)},[]),(0,b.jsx)("button",{type:"button",onClick:()=>{let b="dark"===a?"light":"dark";c(b),v(b);try{window.localStorage.setItem("claude-lens:theme",b)}catch{}},"aria-label":"dark"===a?"Switch to light mode":"Switch to dark mode",title:"dark"===a?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--af-surface-hover)",a.currentTarget.style.color="var(--af-text)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--af-text-secondary)"},children:d?"dark"===a?(0,b.jsx)(u,{size:14}):(0,b.jsx)(t,{size:14}):null})}var x=a.i(2591);function y({snapshot:a}){let d,e,[f,,g]=(0,x.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!a)return(0,b.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,b.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,b.jsxs)("div",{children:["Run ",(0,b.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let h=[{label:"5h",window:a.five_hour},{label:"7d",window:a.seven_day}];return g&&f&&h.push({label:"Sonnet 7d",window:a.seven_day_sonnet}),(0,b.jsxs)(c.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,b.jsx)("span",{children:"Current usage"}),(0,b.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(d=new Date(a.captured_at).getTime(),(e=Math.round((Date.now()-d)/1e3))<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`)})]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:h.map(a=>(0,b.jsx)(z,{...a},a.label))})]})}function z({label:a,window:c}){let d=c?.utilization??null,e=null!==d,f=e?Math.max(0,Math.min(100,d)):0,g=f>=90?"var(--af-danger)":f>=70?"var(--af-warning)":"var(--af-success)";return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,b.jsx)("span",{children:a}),c?.resets_at&&(0,b.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(a){let b,c=Math.round((new Date(a).getTime()-Date.now())/1e3),d=Math.abs(c);if(d<60)b=`${d}s`;else if(d<3600)b=`${Math.floor(d/60)}m`;else if(d<86400){let a=Math.floor(d/3600),c=Math.floor(d%3600/60);b=c>0?`${a}h${c}m`:`${a}h`}else{let a=Math.floor(d/86400),c=Math.floor(d%86400/3600);b=c>0?`${a}d${c}h`:`${a}d`}return c<0?`${b} ago`:`in ${b}`}(c.resets_at)]}),(0,b.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:e?`${f.toFixed(0)}%`:"—"})]}),(0,b.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,b.jsx)("div",{style:{height:"100%",width:e?`${f}%`:"0%",background:g,borderRadius:999,transition:"width 0.24s ease"}})})]})}function A({href:a,active:d,icon:e,trailing:f,children:g}){return(0,b.jsxs)(c.default,{href:a,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:d?"var(--af-accent)":"var(--af-text-secondary)",background:d?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[e,(0,b.jsx)("span",{style:{flex:1},children:g}),f&&(0,b.jsx)("span",{style:{fontSize:10,color:d?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:f})]})}function B({label:a,items:d,pathname:e,isPinned:f,onTogglePin:g}){return 0===d.length?null:(0,b.jsxs)("div",{style:{marginTop:10},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:a}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:d.map(a=>{let d=`/projects/${encodeURIComponent(a.projectDir)}`,h=e===d,i=(0,s.prettyProjectName)(a.projectName);return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:h?"var(--af-accent-subtle)":"transparent",color:h?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,b.jsxs)(c.default,{href:d,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(a.worktreeCount??0)>0?`${a.projectName} — ${a.worktreeCount} worktree${1===a.worktreeCount?"":"s"}`:a.projectName,children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:i}),(a.worktreeCount??0)>0&&(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",a.worktreeCount," wt"]})]}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:a.sessionCount}),(0,b.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.projectDir)},"aria-label":f(a.projectDir)?"Unpin project":"Pin project",title:f(a.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:f(a.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:f(a.projectDir)?(0,b.jsx)(k,{size:12}):(0,b.jsx)(j,{size:12})}),a.lastActiveMs&&(0,b.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(a.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,s.formatRelative)(new Date(a.lastActiveMs).toISOString())})]},a.projectDir)})})]})}a.s(["Sidebar",0,function({projects:a,totalSessions:f,currentUsage:j,version:k}){let s=(0,d.usePathname)(),[t,u]=(0,e.useState)(new Set),[v,x]=(0,e.useState)(!1),[z,C]=(0,e.useState)("");(0,e.useEffect)(()=>{u(new Set),x(!0)},[]);let D=a=>{u(b=>{let c=new Set(b);c.has(a)?c.delete(a):c.add(a);try{window.localStorage.setItem("claude-lens:pinned-projects:v1",JSON.stringify(Array.from(c)))}catch{}return c})},E=(0,e.useMemo)(()=>{if(!z.trim())return a;let b=z.toLowerCase();return a.filter(a=>a.projectName.toLowerCase().includes(b))},[a,z]),F=E.filter(a=>t.has(a.projectDir)),G=E.filter(a=>!t.has(a.projectDir));return(0,b.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,b.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,b.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)"},children:(0,b.jsx)(m,{size:16,strokeWidth:2.25})}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,b.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${k}`,children:["v",k]})]}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Claude Code fleet analytics"})]})]})}),(0,b.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,b.jsx)(A,{href:"/",active:"/"===s,icon:(0,b.jsx)(g,{size:15}),children:"Overview"}),(0,b.jsx)(A,{href:"/sessions",active:"/sessions"===s||s.startsWith("/sessions/"),icon:(0,b.jsx)(h,{size:15}),trailing:f>0?String(f):void 0,children:"All sessions"}),(0,b.jsx)(A,{href:"/projects",active:"/projects"===s,icon:(0,b.jsx)(i,{size:15}),trailing:a.length>0?String(a.length):void 0,children:"Projects"}),(0,b.jsx)(A,{href:"/day",active:"/day"===s||s.startsWith("/day/")||"/digest"===s||s.startsWith("/digest/")||"/parallelism"===s,icon:(0,b.jsx)(r,{size:15}),children:"Day"}),(0,b.jsx)(A,{href:"/usage",active:"/usage"===s,icon:(0,b.jsx)(n,{size:15}),children:"Usage"}),(0,b.jsx)(A,{href:"/insights",active:"/insights"===s,icon:(0,b.jsx)(o.Lightbulb,{size:15}),children:"Insights"}),(0,b.jsx)(A,{href:"/runs",active:"/runs"===s||s.startsWith("/runs/"),icon:(0,b.jsx)(p.Radio,{size:15}),children:"Runs"})]}),(0,b.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,b.jsx)(l.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,b.jsx)("input",{type:"text",placeholder:"Search projects",value:z,onChange:a=>C(a.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,b.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[v&&F.length>0&&(0,b.jsx)(B,{label:"Pinned",items:F,pathname:s,isPinned:a=>t.has(a),onTogglePin:D}),(0,b.jsx)(B,{label:"Projects",items:G,pathname:s,isPinned:a=>t.has(a),onTogglePin:D})]}),(0,b.jsx)(y,{snapshot:j}),(0,b.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,b.jsxs)("span",{style:{flex:1,minWidth:0},children:[f," sessions · ",a.length," projects"]}),(0,b.jsx)(c.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===s?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===s?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,b.jsx)(q,{size:14})}),(0,b.jsx)(w,{})]})]})}],44422)},46069,a=>{"use strict";var b=a.i(50944),c=a.i(72131);a.s(["LiveRefresher",0,function(){let a,d=(0,b.useRouter)(),e=(a=(0,b.usePathname)(),a?.includes("/insights/print/")??!1),f=(0,c.useRef)(null),g=(0,c.useRef)({session:0,usage:0});return!function(a,b={}){let{enabled:d=!0}=b,e=(0,c.useRef)(a);(0,c.useEffect)(()=>{e.current=a},[a]),(0,c.useEffect)(()=>{if(!d)return;let a=new EventSource("/api/events");return a.onmessage=a=>{try{let b=JSON.parse(a.data);("session-updated"===b.type||"usage-updated"===b.type)&&e.current(b)}catch{}},a.onerror=()=>{},()=>{a.close()}},[d])}((0,c.useCallback)(a=>{let b="usage-updated"===a.type?"usage":"session";a.mtimeMs<=(g.current[b]??0)||(g.current[b]=a.mtimeMs,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d.refresh()},400))},[d]),{enabled:!e}),(0,c.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]),null}],46069)},1568,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(3444),g=a.i(76285),h=a.i(44220);let i="cclens-live-widget-expanded";a.s(["LiveSessionsWidget",0,function({sessions:a,entrySummaries:j={}}){let k=(0,d.usePathname)(),[l,m]=(0,c.useState)(()=>Date.now()),[n,o]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{try{let a=localStorage.getItem(i);null!==a&&o("true"===a)}catch{}},[]),(0,c.useEffect)(()=>{let a=setInterval(()=>m(Date.now()),1e4);return()=>clearInterval(a)},[]),k&&/^\/sessions\/[^/]+$/.test(k))return null;let p=a.filter(a=>{if(!a.lastTimestamp)return!1;let b=Date.parse(a.lastTimestamp);return!Number.isNaN(b)&&l-b<=45e3}).slice().sort((a,b)=>{let c=a.firstTimestamp?Date.parse(a.firstTimestamp):0;return(b.firstTimestamp?Date.parse(b.firstTimestamp):0)-c});if(0===p.length)return null;let q=n?p.slice(0,5):[],r=n?p.length-q.length:0;return(0,b.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{var a;return a=a=>!a,void o(b=>{let c=a(b);try{localStorage.setItem(i,String(c))}catch{}return c})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:n?"Collapse":`Show ${p.length} live session${1===p.length?"":"s"}`,children:[(0,b.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",p.length]}),n&&r>0&&(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",r," more live"]}),q.map(a=>{let c=j[a.id];return(0,b.jsxs)(e.default,{href:`/sessions/${a.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(a.lastUserPreview||a.firstUserPreview||a.lastAgentPreview)??(0,f.prettyProjectName)(a.projectName),children:[c&&(0,b.jsx)("div",{onClick:a=>a.stopPropagation(),style:{marginBottom:4},children:c.outcome?(0,b.jsx)(h.OutcomePill,{outcome:c.outcome,size:"sm",label:"text"}):"skipped_trivial"!==c.enrichmentStatus?(0,b.jsx)(h.OutcomePill,{outcome:null,pending:!0,sessionId:a.id,localDay:c.localDay,size:"sm"}):null}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:a.lastUserPreview||a.firstUserPreview||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,b.jsx)(g.TeamBadge,{session:a,linkable:!1})]}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:a.lastAgentPreview?(0,b.jsxs)(b.Fragment,{children:["↳ ",a.lastAgentPreview]}):(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,b.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,f.prettyProjectName)(a.projectName)})]},a.id)}),(0,b.jsx)("style",{children:`
|
|
1
|
+
module.exports=[44422,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(50944),e=a.i(72131),f=a.i(70106);let g=(0,f.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),h=(0,f.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),i=(0,f.default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),j=(0,f.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),k=(0,f.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var l=a.i(87532);let m=(0,f.default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),n=(0,f.default)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var o=a.i(69439),p=a.i(71727);let q=(0,f.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),r=(0,f.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var s=a.i(3444);let t=(0,f.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),u=(0,f.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function v(a){if("u">typeof document){document.documentElement.setAttribute("data-theme",a);try{document.cookie=`claude-lens-theme=${a};path=/;max-age=31536000;samesite=lax`}catch{}}}function w(){let[a,c]=(0,e.useState)("dark"),[d,f]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let a=document.documentElement.getAttribute("data-theme");if("light"===a||"dark"===a)c(a);else{let a="dark";c(a),v(a)}f(!0)},[]),(0,b.jsx)("button",{type:"button",onClick:()=>{let b="dark"===a?"light":"dark";c(b),v(b);try{window.localStorage.setItem("claude-lens:theme",b)}catch{}},"aria-label":"dark"===a?"Switch to light mode":"Switch to dark mode",title:"dark"===a?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--af-surface-hover)",a.currentTarget.style.color="var(--af-text)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--af-text-secondary)"},children:d?"dark"===a?(0,b.jsx)(u,{size:14}):(0,b.jsx)(t,{size:14}):null})}var x=a.i(2591);function y({snapshot:a}){let d,e,[f,,g]=(0,x.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!a)return(0,b.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,b.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,b.jsxs)("div",{children:["Run ",(0,b.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let h=[{label:"5h",window:a.five_hour},{label:"7d",window:a.seven_day}];return g&&f&&h.push({label:"Sonnet 7d",window:a.seven_day_sonnet}),(0,b.jsxs)(c.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,b.jsx)("span",{children:"Current usage"}),(0,b.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(d=new Date(a.captured_at).getTime(),(e=Math.round((Date.now()-d)/1e3))<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`)})]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:h.map(a=>(0,b.jsx)(z,{...a},a.label))})]})}function z({label:a,window:c}){let d=c?.utilization??null,e=null!==d,f=e?Math.max(0,Math.min(100,d)):0,g=f>=90?"var(--af-danger)":f>=70?"var(--af-warning)":"var(--af-success)";return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,b.jsx)("span",{children:a}),c?.resets_at&&(0,b.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(a){let b,c=Math.round((new Date(a).getTime()-Date.now())/1e3),d=Math.abs(c);if(d<60)b=`${d}s`;else if(d<3600)b=`${Math.floor(d/60)}m`;else if(d<86400){let a=Math.floor(d/3600),c=Math.floor(d%3600/60);b=c>0?`${a}h${c}m`:`${a}h`}else{let a=Math.floor(d/86400),c=Math.floor(d%86400/3600);b=c>0?`${a}d${c}h`:`${a}d`}return c<0?`${b} ago`:`in ${b}`}(c.resets_at)]}),(0,b.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:e?`${f.toFixed(0)}%`:"—"})]}),(0,b.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,b.jsx)("div",{style:{height:"100%",width:e?`${f}%`:"0%",background:g,borderRadius:999,transition:"width 0.24s ease"}})})]})}function A({href:a,active:d,icon:e,trailing:f,children:g}){return(0,b.jsxs)(c.default,{href:a,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:d?"var(--af-accent)":"var(--af-text-secondary)",background:d?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[e,(0,b.jsx)("span",{style:{flex:1},children:g}),f&&(0,b.jsx)("span",{style:{fontSize:10,color:d?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:f})]})}function B({label:a,items:d,pathname:e,isPinned:f,onTogglePin:g}){return 0===d.length?null:(0,b.jsxs)("div",{style:{marginTop:10},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:a}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:d.map(a=>{let d=`/projects/${encodeURIComponent(a.projectDir)}`,h=e===d,i=(0,s.prettyProjectName)(a.projectName);return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:h?"var(--af-accent-subtle)":"transparent",color:h?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,b.jsxs)(c.default,{href:d,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(a.worktreeCount??0)>0?`${a.projectName} — ${a.worktreeCount} worktree${1===a.worktreeCount?"":"s"}`:a.projectName,children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:i}),(a.worktreeCount??0)>0&&(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",a.worktreeCount," wt"]})]}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:a.sessionCount}),(0,b.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.projectDir)},"aria-label":f(a.projectDir)?"Unpin project":"Pin project",title:f(a.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:f(a.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:f(a.projectDir)?(0,b.jsx)(k,{size:12}):(0,b.jsx)(j,{size:12})}),a.lastActiveMs&&(0,b.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(a.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,s.formatRelative)(new Date(a.lastActiveMs).toISOString())})]},a.projectDir)})})]})}a.s(["Sidebar",0,function({projects:a,totalSessions:f,currentUsage:j,version:k}){let s=(0,d.usePathname)(),[t,u]=(0,e.useState)(new Set),[v,x]=(0,e.useState)(!1),[z,C]=(0,e.useState)("");(0,e.useEffect)(()=>{u(new Set),x(!0)},[]);let D=a=>{u(b=>{let c=new Set(b);c.has(a)?c.delete(a):c.add(a);try{window.localStorage.setItem("claude-lens:pinned-projects:v1",JSON.stringify(Array.from(c)))}catch{}return c})},E=(0,e.useMemo)(()=>{if(!z.trim())return a;let b=z.toLowerCase();return a.filter(a=>a.projectName.toLowerCase().includes(b))},[a,z]),F=E.filter(a=>t.has(a.projectDir)),G=E.filter(a=>!t.has(a.projectDir));return(0,b.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,b.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,b.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)"},children:(0,b.jsx)(m,{size:16,strokeWidth:2.25})}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,b.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${k}`,children:["v",k]})]}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,b.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,b.jsx)(A,{href:"/",active:"/"===s,icon:(0,b.jsx)(g,{size:15}),children:"Overview"}),(0,b.jsx)(A,{href:"/sessions",active:"/sessions"===s||s.startsWith("/sessions/"),icon:(0,b.jsx)(h,{size:15}),trailing:f>0?String(f):void 0,children:"All sessions"}),(0,b.jsx)(A,{href:"/projects",active:"/projects"===s,icon:(0,b.jsx)(i,{size:15}),trailing:a.length>0?String(a.length):void 0,children:"Projects"}),(0,b.jsx)(A,{href:"/day",active:"/day"===s||s.startsWith("/day/")||"/digest"===s||s.startsWith("/digest/")||"/parallelism"===s,icon:(0,b.jsx)(r,{size:15}),children:"Day"}),(0,b.jsx)(A,{href:"/usage",active:"/usage"===s,icon:(0,b.jsx)(n,{size:15}),children:"Usage"}),(0,b.jsx)(A,{href:"/insights",active:"/insights"===s,icon:(0,b.jsx)(o.Lightbulb,{size:15}),children:"Insights"}),(0,b.jsx)(A,{href:"/runs",active:"/runs"===s||s.startsWith("/runs/"),icon:(0,b.jsx)(p.Radio,{size:15}),children:"Runs"})]}),(0,b.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,b.jsx)(l.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,b.jsx)("input",{type:"text",placeholder:"Search projects",value:z,onChange:a=>C(a.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,b.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[v&&F.length>0&&(0,b.jsx)(B,{label:"Pinned",items:F,pathname:s,isPinned:a=>t.has(a),onTogglePin:D}),(0,b.jsx)(B,{label:"Projects",items:G,pathname:s,isPinned:a=>t.has(a),onTogglePin:D})]}),(0,b.jsx)(y,{snapshot:j}),(0,b.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,b.jsxs)("span",{style:{flex:1,minWidth:0},children:[f," sessions · ",a.length," projects"]}),(0,b.jsx)(c.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===s?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===s?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,b.jsx)(q,{size:14})}),(0,b.jsx)(w,{})]})]})}],44422)},46069,a=>{"use strict";var b=a.i(50944),c=a.i(72131);a.s(["LiveRefresher",0,function(){let a,d=(0,b.useRouter)(),e=(a=(0,b.usePathname)(),a?.includes("/insights/print/")??!1),f=(0,c.useRef)(null),g=(0,c.useRef)({session:0,usage:0});return!function(a,b={}){let{enabled:d=!0}=b,e=(0,c.useRef)(a);(0,c.useEffect)(()=>{e.current=a},[a]),(0,c.useEffect)(()=>{if(!d)return;let a=new EventSource("/api/events");return a.onmessage=a=>{try{let b=JSON.parse(a.data);("session-updated"===b.type||"usage-updated"===b.type)&&e.current(b)}catch{}},a.onerror=()=>{},()=>{a.close()}},[d])}((0,c.useCallback)(a=>{let b="usage-updated"===a.type?"usage":"session";a.mtimeMs<=(g.current[b]??0)||(g.current[b]=a.mtimeMs,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d.refresh()},400))},[d]),{enabled:!e}),(0,c.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]),null}],46069)},1568,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(3444),g=a.i(76285),h=a.i(99309),i=a.i(44220);let j="cclens-live-widget-expanded";a.s(["LiveSessionsWidget",0,function({sessions:a,entrySummaries:k={}}){let l=(0,d.usePathname)(),[m,n]=(0,c.useState)(()=>Date.now()),[o,p]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{try{let a=localStorage.getItem(j);null!==a&&p("true"===a)}catch{}},[]),(0,c.useEffect)(()=>{let a=setInterval(()=>n(Date.now()),1e4);return()=>clearInterval(a)},[]),l&&/^\/sessions\/[^/]+$/.test(l))return null;let q=a.filter(a=>{if(!a.lastTimestamp)return!1;let b=Date.parse(a.lastTimestamp);return!Number.isNaN(b)&&m-b<=45e3}).slice().sort((a,b)=>{let c=a.firstTimestamp?Date.parse(a.firstTimestamp):0;return(b.firstTimestamp?Date.parse(b.firstTimestamp):0)-c});if(0===q.length)return null;let r=o?q.slice(0,5):[],s=o?q.length-r.length:0;return(0,b.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{var a;return a=a=>!a,void p(b=>{let c=a(b);try{localStorage.setItem(j,String(c))}catch{}return c})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:o?"Collapse":`Show ${q.length} live session${1===q.length?"":"s"}`,children:[(0,b.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",q.length]}),o&&s>0&&(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",s," more live"]}),r.map(a=>{let c=k[a.id];return(0,b.jsxs)(e.default,{href:`/sessions/${a.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(a.lastUserPreview||a.firstUserPreview||a.lastAgentPreview)??(0,f.prettyProjectName)(a.projectName),children:[c&&(0,b.jsx)("div",{onClick:a=>a.stopPropagation(),style:{marginBottom:4},children:c.outcome?(0,b.jsx)(i.OutcomePill,{outcome:c.outcome,size:"sm",label:"text",agent:a.agent}):"skipped_trivial"!==c.enrichmentStatus?(0,b.jsx)(i.OutcomePill,{outcome:null,pending:!0,sessionId:a.id,localDay:c.localDay,size:"sm",agent:a.agent}):null}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:a.lastUserPreview||a.firstUserPreview||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,b.jsx)(g.TeamBadge,{session:a,linkable:!1}),(0,b.jsx)(h.AgentBadge,{agent:a.agent})]}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:a.lastAgentPreview?(0,b.jsxs)(b.Fragment,{children:["↳ ",a.lastAgentPreview]}):(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,b.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,f.prettyProjectName)(a.projectName)})]},a.id)}),(0,b.jsx)("style",{children:`
|
|
2
2
|
@keyframes cs-live-pulse {
|
|
3
3
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|
4
4
|
50% { opacity: 0.4; transform: scale(0.85); }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[70709,a=>{"use strict";var b=a.i(717),c=a.i(2157),d=a.i(50227),e=a.i(60526);let f=(0,b.cache)(()=>{let a=process.env.CCLENS_USAGE_LOG||(0,d.join)((0,e.homedir)(),".cclens","usage.jsonl");if(!(0,c.existsSync)(a))return[];let b=(0,c.readFileSync)(a,"utf8"),f=[];for(let a of b.split("\n"))if(a.trim())try{f.push(JSON.parse(a))}catch{}return f}),g=(0,b.cache)(()=>{let a=f();return a.length>0?a[a.length-1]:null}),h=(0,b.cache)(()=>{let a=process.env.CCLENS_PROFILE_CACHE||(0,d.join)((0,e.homedir)(),".cclens","profile.json");if(!(0,c.existsSync)(a))return null;try{let b=JSON.parse((0,c.readFileSync)(a,"utf8"));if(!b.profile?.planTier)return null;return{planTier:b.profile.planTier,rateLimitTier:b.profile.rateLimitTier??null,organizationType:b.profile.organizationType??null,fetchedAtMs:"number"==typeof b.fetchedAtMs?b.fetchedAtMs:0}}catch{return null}});a.s(["PLAN_TIER_LABELS",0,{pro:{label:"Claude Pro",monthlyPriceUsd:20},"pro-max":{label:"Claude Pro Max",monthlyPriceUsd:100},"pro-max-20x":{label:"Claude Pro Max 20x",monthlyPriceUsd:200},custom:{label:"Custom plan",monthlyPriceUsd:0}},"latestUsageSnapshot",0,g,"
|
|
1
|
+
module.exports=[70709,a=>{"use strict";var b=a.i(717),c=a.i(2157),d=a.i(50227),e=a.i(60526);let f=(0,b.cache)(()=>{let a=process.env.CCLENS_USAGE_LOG||(0,d.join)((0,e.homedir)(),".cclens","usage.jsonl");if(!(0,c.existsSync)(a))return[];let b=(0,c.readFileSync)(a,"utf8"),f=[];for(let a of b.split("\n"))if(a.trim())try{f.push(JSON.parse(a))}catch{}return f}),g=(0,b.cache)(()=>{let a=f().filter(a=>(a.agent??"claude-code")==="claude-code");return a.length>0?a[a.length-1]:null}),h=(0,b.cache)(a=>{let b=f().filter(b=>(b.agent??"claude-code")===a);return b.length>0?b[b.length-1]:null}),i=(0,b.cache)(a=>f().filter(b=>(b.agent??"claude-code")===a)),j=(0,b.cache)(()=>{let a=process.env.CCLENS_PROFILE_CACHE||(0,d.join)((0,e.homedir)(),".cclens","profile.json");if(!(0,c.existsSync)(a))return null;try{let b=JSON.parse((0,c.readFileSync)(a,"utf8"));if(!b.profile?.planTier)return null;return{planTier:b.profile.planTier,rateLimitTier:b.profile.rateLimitTier??null,organizationType:b.profile.organizationType??null,fetchedAtMs:"number"==typeof b.fetchedAtMs?b.fetchedAtMs:0}}catch{return null}});a.s(["PLAN_TIER_LABELS",0,{pro:{label:"Claude Pro",monthlyPriceUsd:20},"pro-max":{label:"Claude Pro Max",monthlyPriceUsd:100},"pro-max-20x":{label:"Claude Pro Max 20x",monthlyPriceUsd:200},custom:{label:"Custom plan",monthlyPriceUsd:0}},"latestUsageSnapshot",0,g,"latestUsageSnapshotByAgent",0,h,"readCachedPlanTier",0,j,"readUsageSnapshots",0,f,"readUsageSnapshotsByAgent",0,i])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_web_lib_usage-data_ts_0xtv99n._.js.map
|