fleetlens 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +4 -3
- 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 -4
- 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 -4
- 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 +3 -3
- 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 -4
- 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 +3 -3
- 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 -3
- 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 +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 +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 +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/runs/route.js +1 -1
- package/app/apps/web/.next/server/app/api/runs/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/route.js +3 -4
- package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/changelog/page.js +2 -2
- package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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]__09v47rg._.js +3 -0
- package/app/apps/web/.next/server/chunks/[externals]__0o43ejh._.js +3 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__00n3f9y._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__02px2mk._.js +3 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__02zukjw._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0455vu3._.js +5 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__067~im1._.js +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__06b4cj-._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__08agijy._.js +3 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0_8zh-i._.js +9 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0ej_p3s._.js +9 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0i06ito._.js +3 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0jprdks._.js +9 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0vm_41a._.js +3 -0
- package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ck.78s.js +4 -4
- package/app/apps/web/.next/server/chunks/packages_0c-sz9n._.js +3 -0
- package/app/apps/web/.next/server/chunks/packages_0wywuu.._.js +3 -0
- package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +27 -13
- 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]__0s4dg1y._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0yv0m0q._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.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_0m67-xi._.js +1 -1
- 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_12.endt._.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/{09--oejbzw3q-.js → 0g8ujtb0lp._9.js} +1 -1
- package/app/apps/web/.next/static/chunks/0~n2a9f52wju9.js +14 -0
- package/app/apps/web/app/api/ask/route.ts +124 -111
- package/app/apps/web/app/api/events/route.ts +3 -4
- package/app/apps/web/app/api/runs/[runId]/route.ts +2 -2
- package/app/apps/web/app/api/runs/[runId]/stream/route.ts +3 -2
- package/app/apps/web/app/api/runs/route.ts +8 -4
- package/app/apps/web/app/sessions/[id]/session-view.tsx +31 -0
- package/app/apps/web/components/job-queue-widget.tsx +11 -8
- package/app/apps/web/lib/calibration-data.ts +2 -4
- package/app/apps/web/lib/changelog-data.generated.ts +1 -1
- package/app/apps/web/lib/entries-index.ts +2 -2
- package/app/apps/web/lib/jobs.ts +3 -5
- package/app/apps/web/lib/usage-data.ts +3 -4
- package/app/apps/web/package.json +1 -1
- package/app/apps/web/tsconfig.tsbuildinfo +1 -1
- package/dist/daemon-worker.js +476 -79
- package/dist/index.js +4368 -3959
- package/package.json +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__07qxzx4._.js +0 -9
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0fu2xfy._.js +0 -5
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0gfd42k._.js +0 -9
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0i.m8y0._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0iy5aqy._.js +0 -9
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0nh7-nf._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0nvdffv._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0op9af~._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0s2~c3g._.js +0 -3
- package/app/apps/web/.next/server/chunks/packages_09wmnv.._.js +0 -3
- package/app/apps/web/.next/server/chunks/packages_0o6.gpk._.js +0 -3
- package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_122oe0-.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0sp6.jt._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_10_oegc._.js +0 -3
- package/app/apps/web/.next/static/chunks/0qcu452dr~edz.js +0 -14
- /package/app/apps/web/.next/static/{L0Dy1hOQrZjV9l0TNulvk → sxcMbKfZ5XgVXYN4QHOHd}/_buildManifest.js +0 -0
- /package/app/apps/web/.next/static/{L0Dy1hOQrZjV9l0TNulvk → sxcMbKfZ5XgVXYN4QHOHd}/_clientMiddlewareManifest.js +0 -0
- /package/app/apps/web/.next/static/{L0Dy1hOQrZjV9l0TNulvk → sxcMbKfZ5XgVXYN4QHOHd}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return v},NormalizeError:function(){return x},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return l},isResSent:function(){return p},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return k}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function p(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&p(r))return n;if(!n)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class x extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},69198,e=>{"use strict";var t=e.i(18050);e.i(74472);var r=e.i(33815);e.s(["AgentBadge",0,function({agent:e}){if(!e||"claude-code"===e)return null;let n=(0,r.getAgentMetadata)(e);return n?(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",borderRadius:4,padding:"2px 6px",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap",fontWeight:600,color:n.accentColor,background:`color-mix(in srgb, ${n.accentColor} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${n.accentColor} 30%, transparent)`},title:`Source: ${n.displayName}`,children:n.shortLabel}):null}])},43531,e=>{"use strict";let t=(0,e.i(75254).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],43531)},88137,e=>{"use strict";function t(e){return e<-15?{tone:"danger",label:"may exhaust early"}:e>15?{tone:"warning",label:"below pace"}:{tone:"success",label:"on pace"}}e.s(["paceLabel",0,t,"paceToneForCycle",0,function(e,r,n,a=Date.now()){return t(100*Math.max(0,Math.min(1,(a-(r-n))/n))-e).tone},"toneVar",0,function(e){switch(e){case"success":return"var(--af-success)";case"warning":return"#b58400";case"danger":return"var(--af-danger)"}}])},3116,e=>{"use strict";let t=(0,e.i(75254).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",0,t],3116)},41240,63639,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,r],41240);let n=(0,t.default)("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);e.s(["Radio",0,n],63639)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],31278)},54611,e=>{"use strict";let t=/^##\s+\[([^\]]+)\](?:\s+[—\-–]\s+(\S+))?\s*$/,r=/^###\s+(.+?)\s*$/,n=/^[-*]\s+(.+?)\s*$/,a=function(e){let a=e.split(/\r?\n/),i=[],o=null,s=null,l=[];function c(){s&&l.length>0&&(s.bullets.push(l.join(" ").trim()),l=[])}for(let e of a){let a=t.exec(e);if(a){c(),s=null,o={version:a[1].trim(),date:a[2]?.trim()??null,sections:[]},i.push(o);continue}if(!o)continue;let d=r.exec(e);if(d){c(),s={kind:d[1].trim(),bullets:[]},o.sections.push(s);continue}let u=n.exec(e);if(u){c(),l=[u[1]];continue}l.length>0&&e.trim().length>0&&l.push(e.trim())}return c(),i}('# Changelog\n\nAll notable user-facing changes to the Fleetlens CLI (`fleetlens` on npm) are\nrecorded here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).\nThe team-server has its own log at `packages/team-server/CHANGELOG.md`.\n\n## [0.10.1] — 2026-05-14\n\n### Added\n- **Alternative claude runtime via tmux.** When `tmux` is on PATH, both the LLM pipeline (digest synth, entry enrichment, top-session perception) and the `/ask` feature now drive `claude` through a detached tmux session instead of `claude -p`. Sessions produced this way carry `entrypoint: cli` in their JSONL, which is also extracted by the parser and surfaced as a small badge on `/sessions/<id>` next to the model chip — green for `cli` / `claude-desktop`, amber for `sdk-*`. The path falls back to `claude -p` whenever tmux is unavailable or the run errors; set `FLEETLENS_FORCE_PRINT_MODE=1` to disable the tmux path entirely.\n- **`CCLENS_HOME` env override.** All `~/.cclens/` state (pid file, daemon log, perception state, usage snapshot log, llm-runs traces) is now reached through a shared `cclensHome()` helper that honors `CCLENS_HOME`. Lets multiple installs / workspaces run side-by-side without stomping on each other\'s state.\n\n### Fixed\n- `/api/runs` rendered every successful tmux-driven run as `status=error`. Tmux runs have no subprocess exit code (the session is killed by cleanup), and the runs viewer was treating a missing code as failure. End records now stamp `exit_code: 0` on success and the active-process filter no longer requires the literal `claude -p` flag, so tmux-driven processes also show up in the "active" panel while they\'re running.\n- `JobQueueWidget`\'s `/api/jobs` polling effect listed `jobs` in its deps, so each tick re-armed the effect on the freshly-set state ref — effective cadence collapsed to a 1–4 ms refetch loop. Now tracks `hasActive` in a closure-local var and runs the effect once on mount.\n\n### Conductor\n- New `conductor.json` + `scripts/conductor-{setup,run,archive}.sh` so each Conductor workspace allocates its own 3-port band (web / team-server / postgres) and boots its own `fleetlens-<workspace>` Compose stack against `.harness/cclens-state`. Replaces ~30 hard-coded `join(homedir(), ".cclens", …)` call sites with the shared `cclensHome()/cclensPath()` helper so a second workspace can boot without colliding with the user\'s primary install.\n\n## [0.10.0] — 2026-05-08\n\n### Changed\n- **Plan utilization reframed.** High utilization is now "getting plan value" (green); low utilization is "paying for unused headroom" (red). Mirrors how an operator actually looks at the dashboard: the wasteful outcome is paying for a plan and barely touching it, not running near the cap. Applied across `/usage` burndown, gauges, sidebar, and previous-cycles strip.\n- **In-progress cycles colored by pace, not peak.** A 50% peak halfway through a 7-day cycle reads on-pace green, not amber — the chart no longer cries wolf on a fresh cycle that just hasn\'t burnt yet. Completed cycles still use peak tone.\n- **Pace label ±15pp band.** "On pace" now covers a ±15pp window around ideal; outside that, label is "below pace" (under-burning) or "may exhaust early" (over-burning). The previous +5/-50 thresholds flipped amber every time the user took a night off.\n- **Pace label collapses to three states.** "May exhaust early" / "below pace" / "on pace" — same color tones, one fewer qualifier to read.\n- **Wording softened across the utilization views** to describe the pattern rather than judge the user. "Behind schedule" → "below pace"; "on track (+x%)" → "on pace (+xpp vs ideal)".\n\n### Added\n- **Conductor multi-agent workspace support.** Sessions inside Conductor\'s worktree-style agent workspaces (`~/conductor/workspaces/<repo>/<agent>/...`) now group correctly under their parent project, with each agent shown as a separate worktree. Mirrors the existing `.worktrees/` handling.\n\n### Fixed\n- Hydration mismatch on `/usage` when pace labels rendered before client mount.\n\n### Notes for operators\n- The CLI\'s team push now ships **only Claude Code usage snapshots** to the team server. Codex snapshots stay local until `plan_utilization` gets a per-agent partition — without one, the team-server\'s "latest snapshot" pick flips between agents and miscolors the in-progress cycle. Existing rows in `plan_utilization` stay; new pushes are claude-code only.\n\n## [0.9.0] — 2026-05-07\n\n### Added\n- **Gemini CLI** as the third agent source. Sessions written to `~/.gemini/tmp/<slug>/chats/session-*.jsonl` are now read, parsed, and rendered alongside Claude Code and Codex. Tool calls (`read_file`, `list_directory`, `glob`, `run_shell_command`, `update_topic`, …) and their results show in the session timeline; thinking blocks, multi-write status replay, `$set` / `$rewindTo` semantics, and the legacy single-JSON file shape all handled. Slug → cwd inversion via `~/.gemini/projects.json`. `✺` glyph + purple accent in the UI.\n\n### Changed\n- Session detail timeline drops in-turn idle hatching. Within a turn, every wait — model loading, tool execution, network — is the agent\'s active time. Only between-turn idle (user reading + composing the next message) renders as hatched.\n- Gemini parser anchors `firstTimestamp`, `lastTimestamp`, and `activeSegments` on conversational events only. Login/OAuth `info` records and `metadata.startTime` (file-creation moment) no longer stretch the session bar back to before the first user message.\n\n## [0.7.1] — 2026-05-07\n\n### Fixed\n- Cycle-peaks trend no longer renders two bars labeled the same day. When Anthropic\'s rolling 7-day window slid its anchor between consecutive polls, the daemon\'s bucketer (hour-rounded) recorded both reset boundaries as distinct cycles. They\'re now merged within a 12 h tolerance — same fix in `apps/web/lib/cycle-peaks.ts` (used by `/usage`) and in `packages/cli/src/team/sync.ts` (the daemon\'s team-server push), so both the personal `/usage` chart and the team-server\'s plan-utilization view stay consistent. 5-hour cycles keep no merge tolerance (their anchor is stable; merging would collapse legitimate distinct cycles).\n\n## [0.6.4] — 2026-05-04\n\n### Fixed\n- Cached calibration events per-file so `/usage` warm renders complete in well under a second on large session histories.\n\n## [0.6.3] — 2026-05-04\n\n### Fixed\n- Dropped poisoned auto-week locks left behind by interrupted runs; backfill now gates on the live pipeline lock instead.\n\n## [0.6.2] — 2026-05-04\n\n### Added\n- Last week\'s digest auto-generates on launch when AI features are on. Disable in Settings → AI features.\n\n## [0.6.1] — 2026-05-04\n\n### Changed\n- Smaller install size — published bundle no longer drags in unused workspace metadata.\n\n## [0.6.0] — 2026-04-30\n\n### Added\n- V2 perception layer. Daily, weekly, and monthly digests synthesized from per-session entries via a strict hierarchical pipeline (entry → day → week → month). Past-period digests are immutable on disk; current-period digests use a 10-min in-memory TTL.\n- `/insights` route with on-demand week and month digest generation, picker history, and force-regen.\n- `fleetlens digest day | week | month [--json]` — CLI surface that reproduces the same digests served at `/insights`.\n- `fleetlens entries [--day | --session | --all] [--json]` — inspect the per-session entry primitive.\n\n### Changed\n- Renamed "active time" to "agent time" across the dashboard and CLI for clarity.\n\n## [0.4.1] — 2026-04-23\n\n### Added\n- Concurrency view on `/parallelism` page. Bursts colored teal for same-project and purple for cross-project (the genuinely interesting fleet-work signal).\n- Plan utilization sparkline on the sidebar, fed by the usage daemon\'s 5-min snapshots.\n\n### Fixed\n- Auto-update no longer leaves a zombie web server on the old binary; both server and daemon are torn down before re-exec.\n\n## [0.4.0] — 2026-04-18\n\n### Added\n- Usage daemon (`fleetlens daemon …`) polls `/api/oauth/usage` every 5 min and appends snapshots to `~/.cclens/usage.jsonl`. `fleetlens start` and `fleetlens stop` manage server + daemon together.\n- `fleetlens usage --history` for inspecting past plan utilization.\n\n## [0.3.0] — 2026-04-10\n\n### Added\n- Project rollups with worktree aggregation. Sessions inside `<project>/.worktrees/<name>` roll up under their parent canonical project with a `+N wt` badge.\n- Pinned projects in the sidebar (per-browser via localStorage).\n\n## [0.2.0] — 2026-04-01\n\n### Changed\n- Active-segment computation now uses all timestamped events (system + summary + sidechain + conversational) instead of conversational-only. Earlier filter undercounted by up to 100x on tool-heavy sessions.\n\n## [0.1.0] — 2026-03-15\n\n### Added\n- Initial release. Local-only dashboard for Claude Code sessions: timeline, projects, daily activity bucketing, parallelism detection, per-model cost estimation. Reads JSONL transcripts from `~/.claude/projects/`.\n');a[0]?.version,e.s(["STORAGE_KEY",0,"cclens:changelog-last-seen"],54611)},86619,e=>{"use strict";var t=e.i(71645);e.s(["usePersistentBoolean",0,function(e,r){let[n,a]=(0,t.useState)(r),[i,o]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{try{let t=window.localStorage.getItem(e);"1"===t?a(!0):"0"===t&&a(!1)}catch{}o(!0)},[e]),(0,t.useEffect)(()=>{let t=t=>{let r=t.detail;r?.key===e&&"boolean"==typeof r.value&&a(r.value)},r=t=>{t.key===e&&("1"===t.newValue?a(!0):"0"===t.newValue&&a(!1))};return window.addEventListener("cclens:persistent-boolean",t),window.addEventListener("storage",r),()=>{window.removeEventListener("cclens:persistent-boolean",t),window.removeEventListener("storage",r)}},[e]),[n,(0,t.useCallback)(t=>{a(t);try{window.localStorage.setItem(e,t?"1":"0")}catch{}window.dispatchEvent(new CustomEvent("cclens:persistent-boolean",{detail:{key:e,value:t}}))},[e]),i]}])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let d=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),d&&"?"!==d[0]&&(d="?"+d),a=a.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${c}${a}${d}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),a=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809),o=e.r(18050),s=i._(e.r(71645)),l=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),p=e.r(5550);e.r(33525);let h=e.r(88540),f=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var r,n;let a,i,y,[b,v]=(0,s.useOptimistic)(f.IDLE_LINK_STATUS),w=(0,s.useRef)(null),{href:k,as:j,children:S,prefetch:C=null,passHref:M,replace:$,shallow:T,scroll:z,onClick:P,onMouseEnter:E,onTouchStart:R,legacyBehavior:L=!1,onNavigate:I,transitionTypes:A,ref:O,unstable_dynamicOnHover:N,..._}=t;a=S,L&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let D=s.default.useContext(c.AppRouterContext),W=!1!==C,F=!1!==C?null===(n=C)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(r=j||k)?r:(0,l.formatUrl)(r);if(L){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=s.default.Children.only(a)}let U=L?i&&"object"==typeof i&&i.ref:O,H=s.default.useCallback(e=>(null!==D&&(w.current=(0,f.mountLinkInstance)(e,B,D,F,W,v)),()=>{w.current&&((0,f.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,f.unmountPrefetchableInstance)(e)}),[W,B,D,F,v]),G={ref:(0,d.useMergedRef)(H,U),onClick(t){L||"function"!=typeof P||P(t),L&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!D||t.defaultPrevented||function(t,r,n,a,i,o,l){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);s.default.startTransition(()=>{u(r,a?"replace":"push",!1===i?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,l)})}}(t,B,w,$,z,I,A)},onMouseEnter(e){L||"function"!=typeof E||E(e),L&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),D&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){L||"function"!=typeof R||R(e),L&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),D&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,u.isAbsoluteUrl)(B)?G.href=B:L&&!M&&("a"!==i.type||"href"in i.props)||(G.href=(0,p.addBasePath)(B)),y=L?s.default.cloneElement(i,G):(0,o.jsx)("a",{..._,...G,children:a}),(0,o.jsx)(x.Provider,{value:b,children:y})}e.r(84508);let x=(0,s.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:s="",children:l,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...n,width:a,height:a,stroke:e,strokeWidth:o?24*Number(i)/Number(a):i,className:r("lucide",s),...d},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,n)=>{let i=(0,t.forwardRef)(({className:i,...o},s)=>(0,t.createElement)(a,{ref:s,iconNode:n,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,i),...o}));return i.displayName=`${e}`,i}],75254)},74472,33815,e=>{"use strict";let t=[{kind:"claude-code",displayName:"Claude Code",shortLabel:"Claude",accentColor:"var(--af-accent)",iconChar:"✦"},{kind:"codex",displayName:"Codex (OpenAI)",shortLabel:"Codex",accentColor:"rgb(16, 163, 127)",iconChar:"◆"},{kind:"gemini",displayName:"Gemini CLI",shortLabel:"Gemini",accentColor:"rgb(124, 92, 246)",iconChar:"✺"}],r=new Set(t.map(e=>e.kind));e.s(["getAgentMetadata",0,function(e){return t.find(t=>t.kind===e)},"isAgentKind",0,function(e){return"string"==typeof e&&r.has(e)}],33815),e.s([],74472)},23614,41783,e=>{"use strict";var t=e.i(18050),r=e.i(22016);e.i(74472);var n=e.i(33815);function a({agent:e,size:r=11,title:i}){if(!e)return null;let o=(0,n.getAgentMetadata)(e);return o?(0,t.jsx)("span",{"aria-hidden":!0,title:i??o.displayName,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:r+2,height:r+2,fontSize:r,lineHeight:1,color:o.accentColor},children:o.iconChar}):null}e.s(["AgentIcon",0,a],41783);let i={shipped:{bg:"rgba(72, 187, 120, 0.12)",fg:"#48bb78",label:"Shipped",icon:"🚀"},partial:{bg:"rgba(66, 153, 225, 0.12)",fg:"#4299e1",label:"Partial",icon:"🔨"},blocked:{bg:"rgba(245, 101, 101, 0.12)",fg:"#f56565",label:"Blocked",icon:"🚧"},exploratory:{bg:"rgba(160, 174, 192, 0.12)",fg:"#a0aec0",label:"Exploratory",icon:"🧭"},trivial:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Warmup",icon:"💤"},idle:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Idle",icon:"—"}},o={sm:{fontSize:9,padding:"1px 6px",iconGap:3,borderRadius:99},md:{fontSize:10,padding:"2px 8px",iconGap:4,borderRadius:99},lg:{fontSize:11,padding:"3px 10px",iconGap:5,borderRadius:99}},s={shipped:6,partial:5,blocked:4,exploratory:3,trivial:2,idle:1};e.s(["OUTCOME_STYLES",0,i,"OutcomePill",0,function(e){let n=o[e.size??"md"],s=n.fontSize+1;if("pending"in e&&e.pending){let i={display:"inline-flex",alignItems:"center",gap:n.iconGap,padding:n.padding,borderRadius:n.borderRadius,fontSize:n.fontSize,fontWeight:600,background:"rgba(160, 174, 192, 0.08)",color:"var(--af-text-tertiary)",border:"1px dashed var(--af-border-subtle)",textDecoration:"none",whiteSpace:"nowrap"};return(0,t.jsxs)(r.default,{href:`/digest/${e.localDay}`,style:i,title:`Generate ${e.localDay} digest →`,children:[e.agent&&(0,t.jsx)(a,{agent:e.agent,size:s}),(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:"⋯"}),(0,t.jsx)("span",{children:"pending"})]})}let l=i[e.outcome],c=e.label??"both",d={display:"inline-flex",alignItems:"center",gap:n.iconGap,padding:n.padding,borderRadius:n.borderRadius,fontSize:n.fontSize,fontWeight:600,background:l.bg,color:l.fg,whiteSpace:"nowrap"};return(0,t.jsxs)("span",{style:d,title:l.label,children:[e.agent&&(0,t.jsx)(a,{agent:e.agent,size:s}),("icon"===c||"both"===c)&&(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:l.icon}),("text"===c||"both"===c)&&(0,t.jsx)("span",{children:l.label})]})},"outcomePriority",0,function(e){return e?s[e]:0}],23614)},18566,(e,t,r)=>{t.exports=e.r(76562)},56324,e=>{"use strict";let t={input:1,output:5,cacheRead:.1,cacheWrite:1.25},r={input:3,output:15,cacheRead:.3,cacheWrite:3.75},n={input:5,output:25,cacheRead:.5,cacheWrite:6.25};e.s(["estimateCost",0,function(e,a){let i=function(e){if(!e)return n;let a=e.toLowerCase();return a.includes("haiku")?t:a.includes("sonnet")?r:n}(a);return e.input/1e6*i.input+e.output/1e6*i.output+e.cacheRead/1e6*i.cacheRead+e.cacheWrite/1e6*i.cacheWrite},"formatCost",0,function(e){return e<.01?"<$0.01":e<1||e<100?`$${e.toFixed(2)}`:e<1e3?`$${e.toFixed(1)}`:`$${e.toLocaleString(void 0,{maximumFractionDigits:0})}`},"formatDuration",0,function(e){if(void 0===e)return"—";if(e<1e3)return`${e}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let r=Math.floor(t/60),n=t%60;if(r<60)return n?`${r}m ${n}s`:`${r}m`;let a=Math.floor(r/60),i=r%60;return i?`${a}h ${i}m`:`${a}h`},"formatGap",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let r=Math.floor(t/60);if(r<60){let e=Math.round(t%60);return`${r}m ${e}s`}let n=Math.floor(r/60),a=r%60;if(n<24)return a?`${n}h ${a}m`:`${n}h`;let i=Math.floor(n/24),o=n%24;return o?`${i}d ${o}h`:`${i}d`},"formatOffset",0,function(e){if(void 0===e||e<0)return"—";let t=Math.floor(e/1e3),r=Math.floor(t/3600),n=String(Math.floor(t%3600/60)).padStart(2,"0"),a=String(t%60).padStart(2,"0");return`${r}:${n}:${a}`},"formatRelative",0,function(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let r=Math.round((Date.now()-t)/1e3);if(r<60)return`${r}s ago`;let n=Math.round(r/60);if(n<60)return`${n}m ago`;let a=Math.round(n/60);if(a<24)return`${a}h ago`;let i=Math.round(a/24);return`${i}d ago`},"formatTokens",0,function(e){return e<1e3?String(e):e<1e4?(e/1e3).toFixed(1)+"k":e<1e6?Math.round(e/1e3)+"k":e<1e7?(e/1e6).toFixed(2)+"M":(e/1e6).toFixed(1)+"M"},"prettyProjectName",0,function(e,t=35){let r=e.split("/").filter(Boolean),n=r.lastIndexOf(".worktrees");if(n>0&&n<r.length-1){let e=r[n-1],a=r[n+1],i=`${e}/${a}`;return i.length<=t?i:"…"+i.slice(i.length-t+1)}let a=r.length>=2?`${r[r.length-2]}/${r[r.length-1]}`:r[r.length-1]??e;return a.length<=t?a:"…"+a.slice(a.length-t+1)},"shortId",0,function(e){return e.length<=10?e:e.slice(0,6)+"…"+e.slice(-4)}])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",0,t],55436)},56004,e=>{"use strict";var t=e.i(18050),r=e.i(22016);let n={display:"inline-flex",alignItems:"center",borderRadius:4,padding:"2px 6px",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap"};e.s(["TeamBadge",0,function({session:e,linkable:a=!0}){if(!e.teamName)return null;let i=!0===e.isTeamLead,o=void 0!==e.agentName;return i||o?i&&a?(0,t.jsx)(r.default,{href:`/sessions/${e.id}`,style:{...n,fontWeight:600,background:"var(--af-warning-subtle)",color:"var(--af-warning)",border:"1px solid var(--af-warning-subtle)",textDecoration:"none"},title:`Team lead — ${e.teamName}`,children:"Team Lead"}):i?(0,t.jsx)("span",{style:{...n,fontWeight:600,background:"var(--af-warning-subtle)",color:"var(--af-warning)",border:"1px solid var(--af-warning-subtle)"},title:`Team lead — ${e.teamName}`,children:"Team Lead"}):(0,t.jsx)("span",{style:{...n,fontWeight:500,background:"var(--af-surface-hover)",color:"var(--af-text-tertiary)",border:"1px solid var(--af-border-subtle)"},title:`Team member — ${e.teamName} \xb7 ${e.agentName}`,children:"Team Member"}):null}])},86566,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(18566),a=e.i(71645),i=e.i(75254);let o=(0,i.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),s=(0,i.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),l=(0,i.default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),c=(0,i.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),d=(0,i.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var u=e.i(55436);let p=(0,i.default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),h=(0,i.default)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(41240),g=e.i(63639);let m=(0,i.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),y=(0,i.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var x=e.i(56324);let b=(0,i.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),v=(0,i.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),w="claude-lens:theme";function k(e){if("u">typeof document){document.documentElement.setAttribute("data-theme",e);try{document.cookie=`claude-lens-theme=${e};path=/;max-age=31536000;samesite=lax`}catch{}}}function j(){let[e,r]=(0,a.useState)("dark"),[n,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=document.documentElement.getAttribute("data-theme");if("light"===e||"dark"===e)r(e);else{let e=function(){try{let e=window.localStorage.getItem(w);if("light"===e||"dark"===e)return e}catch{}return null}()??(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark");r(e),k(e)}i(!0)},[]),(0,t.jsx)("button",{type:"button",onClick:()=>{let t="dark"===e?"light":"dark";r(t),k(t);try{window.localStorage.setItem(w,t)}catch{}},"aria-label":"dark"===e?"Switch to light mode":"Switch to dark mode",title:"dark"===e?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)",e.currentTarget.style.color="var(--af-text)"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--af-text-secondary)"},children:n?"dark"===e?(0,t.jsx)(v,{size:14}):(0,t.jsx)(b,{size:14}):null})}var S=e.i(86619),C=e.i(88137);function M({snapshot:e}){let n,a,[i,,o]=(0,S.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!e)return(0,t.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,t.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,t.jsxs)("div",{children:["Run ",(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let s=[{label:"5h",window:e.five_hour,windowMs:18e6},{label:"7d",window:e.seven_day,windowMs:6048e5}];return o&&i&&s.push({label:"Sonnet 7d",window:e.seven_day_sonnet,windowMs:6048e5}),(0,t.jsxs)(r.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,t.jsx)("span",{children:"Current usage"}),(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(n=new Date(e.captured_at).getTime(),(a=Math.round((Date.now()-n)/1e3))<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`)})]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:s.map(e=>(0,t.jsx)($,{...e},e.label))})]})}function $({label:e,window:r,windowMs:n}){let a=r?.utilization??null,i=null!==a,o=i?Math.max(0,Math.min(100,a)):0,s=r?.resets_at?new Date(r.resets_at).getTime():null,l=i&&s?(0,C.toneVar)((0,C.paceToneForCycle)(o,s,n)):"var(--af-border-subtle)";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,t.jsx)("span",{children:e}),r?.resets_at&&(0,t.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),n=Math.abs(r);if(n<60)t=`${n}s`;else if(n<3600)t=`${Math.floor(n/60)}m`;else if(n<86400){let e=Math.floor(n/3600),r=Math.floor(n%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(n/86400),r=Math.floor(n%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}(r.resets_at)]}),(0,t.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:i?`${o.toFixed(0)}%`:"—"})]}),(0,t.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,t.jsx)("div",{style:{height:"100%",width:i?`${o}%`:"0%",background:l,borderRadius:999,transition:"width 0.24s ease"}})})]})}let T=(0,i.default)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);var z=e.i(54611);function P({latestVersion:e,active:n}){let[i,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!e)return void o(!1);try{let t=window.localStorage.getItem(z.STORAGE_KEY);o(t!==e)}catch{o(!1)}},[e]),(0,t.jsxs)(r.default,{href:"/changelog","aria-label":i?"Changelog (new entries)":"Changelog",title:i?`What's new in v${e}`:"Changelog",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:n?"var(--af-text)":"var(--af-text-tertiary)",background:n?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,t.jsx)(T,{size:14}),i&&(0,t.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:3,right:3,width:7,height:7,borderRadius:"50%",background:"#ef4444",border:"1.5px solid var(--af-surface)"}})]})}let E="claude-lens:pinned-projects:v1";function R({href:e,active:n,icon:a,trailing:i,children:o}){return(0,t.jsxs)(r.default,{href:e,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:n?"var(--af-accent)":"var(--af-text-secondary)",background:n?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[a,(0,t.jsx)("span",{style:{flex:1},children:o}),i&&(0,t.jsx)("span",{style:{fontSize:10,color:n?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})}function L({label:e,items:n,pathname:a,isPinned:i,onTogglePin:o}){return 0===n.length?null:(0,t.jsxs)("div",{style:{marginTop:10},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:e}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:n.map(e=>{let n=`/projects/${encodeURIComponent(e.projectDir)}`,s=a===n,l=(0,x.prettyProjectName)(e.projectName);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:s?"var(--af-accent-subtle)":"transparent",color:s?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,t.jsxs)(r.default,{href:n,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(e.worktreeCount??0)>0?`${e.projectName} — ${e.worktreeCount} worktree${1===e.worktreeCount?"":"s"}`:e.projectName,children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:l}),(e.worktreeCount??0)>0&&(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",e.worktreeCount," wt"]})]}),(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:e.sessionCount}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),o(e.projectDir)},"aria-label":i(e.projectDir)?"Unpin project":"Pin project",title:i(e.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:i(e.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:i(e.projectDir)?(0,t.jsx)(d,{size:12}):(0,t.jsx)(c,{size:12})}),e.lastActiveMs&&(0,t.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(e.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,x.formatRelative)(new Date(e.lastActiveMs).toISOString())})]},e.projectDir)})})]})}e.s(["Sidebar",0,function({projects:e,totalSessions:i,currentUsage:c,version:d,latestChangelogVersion:x}){let b=(0,n.usePathname)(),[v,w]=(0,a.useState)(new Set),[k,S]=(0,a.useState)(!1),[C,$]=(0,a.useState)("");(0,a.useEffect)(()=>{w(function(){try{let e=window.localStorage.getItem(E);if(!e)return new Set;let t=JSON.parse(e);return new Set(Array.isArray(t)?t:[])}catch{return new Set}}()),S(!0)},[]);let T=e=>{w(t=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e);try{window.localStorage.setItem(E,JSON.stringify(Array.from(r)))}catch{}return r})},z=(0,a.useMemo)(()=>{if(!C.trim())return e;let t=C.toLowerCase();return e.filter(e=>e.projectName.toLowerCase().includes(t))},[e,C]),I=z.filter(e=>v.has(e.projectDir)),A=z.filter(e=>!v.has(e.projectDir));return(0,t.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,t.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)"},children:(0,t.jsx)(p,{size:16,strokeWidth:2.25})}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,t.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${d}`,children:["v",d]})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,t.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)(R,{href:"/",active:"/"===b,icon:(0,t.jsx)(o,{size:15}),children:"Overview"}),(0,t.jsx)(R,{href:"/sessions",active:"/sessions"===b||b.startsWith("/sessions/"),icon:(0,t.jsx)(s,{size:15}),trailing:i>0?String(i):void 0,children:"All sessions"}),(0,t.jsx)(R,{href:"/projects",active:"/projects"===b,icon:(0,t.jsx)(l,{size:15}),trailing:e.length>0?String(e.length):void 0,children:"Projects"}),(0,t.jsx)(R,{href:"/day",active:"/day"===b||b.startsWith("/day/")||"/digest"===b||b.startsWith("/digest/")||"/parallelism"===b,icon:(0,t.jsx)(y,{size:15}),children:"Day"}),(0,t.jsx)(R,{href:"/usage",active:"/usage"===b,icon:(0,t.jsx)(h,{size:15}),children:"Usage"}),(0,t.jsx)(R,{href:"/insights",active:"/insights"===b,icon:(0,t.jsx)(f.Lightbulb,{size:15}),children:"Insights"}),(0,t.jsx)(R,{href:"/runs",active:"/runs"===b||b.startsWith("/runs/"),icon:(0,t.jsx)(g.Radio,{size:15}),children:"Runs"})]}),(0,t.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)(u.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,t.jsx)("input",{type:"text",placeholder:"Search projects",value:C,onChange:e=>$(e.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,t.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[k&&I.length>0&&(0,t.jsx)(L,{label:"Pinned",items:I,pathname:b,isPinned:e=>v.has(e),onTogglePin:T}),(0,t.jsx)(L,{label:"Projects",items:A,pathname:b,isPinned:e=>v.has(e),onTogglePin:T})]}),(0,t.jsx)(M,{snapshot:c}),(0,t.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsxs)("span",{style:{flex:1,minWidth:0},children:[i," sessions · ",e.length," projects"]}),(0,t.jsx)(P,{latestVersion:x,active:"/changelog"===b}),(0,t.jsx)(r.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===b?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===b?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,t.jsx)(m,{size:14})}),(0,t.jsx)(j,{})]})]})}],86566)},51878,e=>{"use strict";var t=e.i(18566),r=e.i(71645);e.s(["LiveRefresher",0,function(){let e,n=(0,t.useRouter)(),a=(e=(0,t.usePathname)(),e?.includes("/insights/print/")??!1),i=(0,r.useRef)(null),o=(0,r.useRef)({session:0,usage:0});return!function(e,t={}){let{enabled:n=!0}=t,a=(0,r.useRef)(e);(0,r.useEffect)(()=>{a.current=e},[e]),(0,r.useEffect)(()=>{if(!n)return;let e=new EventSource("/api/events");return e.onmessage=e=>{try{let t=JSON.parse(e.data);("session-updated"===t.type||"usage-updated"===t.type)&&a.current(t)}catch{}},e.onerror=()=>{},()=>{e.close()}},[n])}((0,r.useCallback)(e=>{let t="usage-updated"===e.type?"usage":"session";e.mtimeMs<=(o.current[t]??0)||(o.current[t]=e.mtimeMs,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{n.refresh()},400))},[n]),{enabled:!a}),(0,r.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),null}],51878)},23884,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(18566),a=e.i(22016),i=e.i(56324),o=e.i(56004),s=e.i(69198),l=e.i(23614);let c="cclens-live-widget-expanded";e.s(["LiveSessionsWidget",0,function({sessions:e,entrySummaries:d={}}){let u=(0,n.usePathname)(),[p,h]=(0,r.useState)(()=>Date.now()),[f,g]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{try{let e=localStorage.getItem(c);null!==e&&g("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=setInterval(()=>h(Date.now()),1e4);return()=>clearInterval(e)},[]),u&&/^\/sessions\/[^/]+$/.test(u))return null;let m=e.filter(e=>{if(!e.lastTimestamp)return!1;let t=Date.parse(e.lastTimestamp);return!Number.isNaN(t)&&p-t<=45e3}).slice().sort((e,t)=>{let r=e.firstTimestamp?Date.parse(e.firstTimestamp):0;return(t.firstTimestamp?Date.parse(t.firstTimestamp):0)-r});if(0===m.length)return null;let y=f?m.slice(0,5):[],x=f?m.length-y.length:0;return(0,t.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void g(t=>{let r=e(t);try{localStorage.setItem(c,String(r))}catch{}return r})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:f?"Collapse":`Show ${m.length} live session${1===m.length?"":"s"}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",m.length]}),f&&x>0&&(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",x," more live"]}),y.map(e=>{let r=d[e.id];return(0,t.jsxs)(a.default,{href:`/sessions/${e.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(e.lastUserPreview||e.firstUserPreview||e.lastAgentPreview)??(0,i.prettyProjectName)(e.projectName),children:[r&&(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginBottom:4},children:r.outcome?(0,t.jsx)(l.OutcomePill,{outcome:r.outcome,size:"sm",label:"text",agent:e.agent}):"skipped_trivial"!==r.enrichmentStatus?(0,t.jsx)(l.OutcomePill,{outcome:null,pending:!0,sessionId:e.id,localDay:r.localDay,size:"sm",agent:e.agent}):null}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.lastUserPreview||e.firstUserPreview||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,t.jsx)(o.TeamBadge,{session:e,linkable:!1}),(0,t.jsx)(s.AgentBadge,{agent:e.agent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:e.lastAgentPreview?(0,t.jsxs)(t.Fragment,{children:["↳ ",e.lastAgentPreview]}):(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,t.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,i.prettyProjectName)(e.projectName)})]},e.id)}),(0,t.jsx)("style",{children:`
|
|
2
|
+
@keyframes cs-live-pulse {
|
|
3
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
4
|
+
50% { opacity: 0.4; transform: scale(0.85); }
|
|
5
|
+
}
|
|
6
|
+
`})]})}])},62887,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(43531);let a=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var i=e.i(31278),o=e.i(3116),s=e.i(22016);let l="cclens-jobs-widget-expanded";function c({children:e}){return(0,t.jsx)("div",{style:{padding:"6px 14px",fontSize:9,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,background:"var(--af-surface)"},children:e})}function d({job:e}){let r="running"===e.status?i.Loader2:"queued"===e.status?o.Clock:"error"===e.status?a:n.Check,l="running"===e.status?"#4299e1":"queued"===e.status?"var(--af-text-tertiary)":"error"===e.status?"#f56565":"#48bb78",c=e.resultUrl&&("done"===e.status||"running"===e.status),u=c?s.default:"div",p=c?{href:e.resultUrl}:{};return(0,t.jsxs)(u,{...p,style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"var(--af-text)",fontSize:11.5,cursor:c?"pointer":"default"},children:[(0,t.jsx)(r,{size:13,className:"running"===e.status?"cs-job-spin":"",style:{color:l,marginTop:2,flexShrink:0}}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),e.progress&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",marginTop:2,fontFamily:"var(--font-mono)"},children:function(e){if(void 0!==e.index&&void 0!==e.total)return`${e.phase} ${e.index}/${e.total}`;if(void 0!==e.bytes){let t=(e.bytes/1024).toFixed(1);return`${e.phase} \xb7 ${t}k`}return e.text?`${e.phase} \xb7 ${e.text}`:e.phase}(e.progress)}),"error"===e.status&&e.error&&(0,t.jsx)("div",{style:{fontSize:10,color:"#f56565",marginTop:2},children:e.error.length>60?e.error.slice(0,60)+"…":e.error}),"done"===e.status&&e.resultUrl&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-accent)",marginTop:2},children:"View →"})]})]})}e.s(["JobQueueWidget",0,function(){let[e,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{let e=localStorage.getItem(l);null!==e&&o("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=!0,t=null,r=!1,a=async()=>{try{let t=await fetch("/api/jobs",{cache:"no-store"});if(!t.ok)return;let a=await t.json();if(!e)return;n(a.jobs),r=a.jobs.some(e=>"running"===e.status||"queued"===e.status)}catch{}},i=()=>{e&&(t=setTimeout(async()=>{await a(),i()},r?1500:6e3))};return a().then(i),()=>{e=!1,t&&clearTimeout(t)}},[]);let s=e.filter(e=>"running"===e.status||"queued"===e.status),u=e.filter(e=>"done"===e.status||"error"===e.status||"cancelled"===e.status).slice(0,8);return 0===s.length?null:(0,t.jsxs)("div",{style:{position:"fixed",right:140,bottom:20,zIndex:99,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,alignItems:"flex-end"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void o(t=>{let r=e(t);try{localStorage.setItem(l,String(r))}catch{}return r})},title:`${s.length} job${1===s.length?"":"s"} running — click to ${a?"collapse":"expand"}`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(66, 153, 225, 0.14)",border:"1px solid rgba(66, 153, 225, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#4299e1",letterSpacing:"0.06em",textTransform:"uppercase",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(66, 153, 225, 0.15)",alignSelf:"flex-end"},children:[(0,t.jsx)(i.Loader2,{size:11,className:"cs-job-spin",style:{flexShrink:0}}),"Jobs · ",s.length]}),a&&(0,t.jsxs)("div",{style:{width:320,maxHeight:360,overflowY:"auto",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:10,boxShadow:"0 8px 24px rgba(0,0,0,0.18)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[s.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c,{children:"Running"}),s.map(e=>(0,t.jsx)(d,{job:e},e.id))]}),u.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c,{children:"Recent"}),u.map(e=>(0,t.jsx)(d,{job:e},e.id))]})]}),(0,t.jsx)("style",{children:`
|
|
7
|
+
@keyframes cs-job-spin {
|
|
8
|
+
from { transform: rotate(0deg); }
|
|
9
|
+
to { transform: rotate(360deg); }
|
|
10
|
+
}
|
|
11
|
+
.cs-job-spin {
|
|
12
|
+
animation: cs-job-spin 1s linear infinite;
|
|
13
|
+
}
|
|
14
|
+
`})]})}],62887)}]);
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
import { getSession } from "@claude-lens/parser/fs";
|
|
19
19
|
import { summarizeSessionForAI } from "@/lib/ai/session-summary";
|
|
20
20
|
import { spawn } from "node:child_process";
|
|
21
|
+
import {
|
|
22
|
+
runClaudeUnderTmux,
|
|
23
|
+
tmuxRunnerAvailable,
|
|
24
|
+
TmuxRunError,
|
|
25
|
+
TmuxUnavailableError,
|
|
26
|
+
} from "@claude-lens/entries/node";
|
|
21
27
|
|
|
22
28
|
export const dynamic = "force-dynamic";
|
|
23
29
|
export const runtime = "nodejs";
|
|
@@ -56,6 +62,11 @@ export async function POST(request: Request) {
|
|
|
56
62
|
const fullPrompt = `Here is the session transcript summary:\n\n${context}\n\n---\n\nUser's question: ${question}`;
|
|
57
63
|
|
|
58
64
|
const encoder = new TextEncoder();
|
|
65
|
+
// Resolve at request time so an admin toggling tmux on/off doesn't
|
|
66
|
+
// require a server restart.
|
|
67
|
+
const useTmux =
|
|
68
|
+
process.env.FLEETLENS_FORCE_PRINT_MODE !== "1" && tmuxRunnerAvailable().ok;
|
|
69
|
+
|
|
59
70
|
const stream = new ReadableStream({
|
|
60
71
|
start(controller) {
|
|
61
72
|
let closed = false;
|
|
@@ -69,127 +80,129 @@ export async function POST(request: Request) {
|
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"--tools",
|
|
85
|
-
"", // no tools — pure analysis
|
|
86
|
-
"--disable-slash-commands",
|
|
87
|
-
"--no-session-persistence",
|
|
88
|
-
"--setting-sources",
|
|
89
|
-
"", // skip user settings for speed
|
|
90
|
-
"--append-system-prompt",
|
|
91
|
-
SYSTEM_PROMPT,
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
const proc = spawn(claudeBin, args, {
|
|
95
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
96
|
-
// Inherit PATH so the claude binary is found.
|
|
97
|
-
env: { ...process.env },
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// Write the prompt to stdin and close.
|
|
101
|
-
proc.stdin.write(fullPrompt);
|
|
102
|
-
proc.stdin.end();
|
|
103
|
-
|
|
104
|
-
let stderr = "";
|
|
105
|
-
|
|
106
|
-
proc.stdout.on("data", (chunk: Buffer) => {
|
|
107
|
-
const text = chunk.toString("utf8");
|
|
108
|
-
// stream-json emits one JSON object per line.
|
|
109
|
-
for (const line of text.split("\n")) {
|
|
110
|
-
const trimmed = line.trim();
|
|
111
|
-
if (!trimmed) continue;
|
|
83
|
+
function finish() {
|
|
84
|
+
if (!closed) {
|
|
85
|
+
try { controller.close(); } catch {}
|
|
86
|
+
closed = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Kick off the LLM work without awaiting — Next.js waits for start()
|
|
91
|
+
// to return before opening the response, so any blocking here would
|
|
92
|
+
// stall the SSE headers.
|
|
93
|
+
void (async () => {
|
|
94
|
+
if (useTmux) {
|
|
112
95
|
try {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
96
|
+
const res = await runClaudeUnderTmux({
|
|
97
|
+
systemPrompt: SYSTEM_PROMPT,
|
|
98
|
+
model,
|
|
99
|
+
userPrompt: fullPrompt,
|
|
100
|
+
onDelta: (chunk) => send({ type: "delta", text: chunk }),
|
|
101
|
+
signal: request.signal,
|
|
102
|
+
});
|
|
103
|
+
send({ type: "done", totalTokens: res.input_tokens + res.output_tokens });
|
|
104
|
+
finish();
|
|
105
|
+
return;
|
|
106
|
+
} catch (err) {
|
|
107
|
+
const isExpected = err instanceof TmuxUnavailableError || err instanceof TmuxRunError;
|
|
108
|
+
if (!isExpected) {
|
|
109
|
+
console.warn("[ask] tmux runner failed, falling back to -p:", err);
|
|
110
|
+
}
|
|
111
|
+
// fall through to print mode
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
runPrintModeFallback();
|
|
115
|
+
})();
|
|
116
|
+
|
|
117
|
+
function runPrintModeFallback() {
|
|
118
|
+
const claudeBin = "claude";
|
|
119
|
+
|
|
120
|
+
const args = [
|
|
121
|
+
"-p",
|
|
122
|
+
"--output-format",
|
|
123
|
+
"stream-json",
|
|
124
|
+
"--verbose",
|
|
125
|
+
"--model",
|
|
126
|
+
model,
|
|
127
|
+
"--tools",
|
|
128
|
+
"",
|
|
129
|
+
"--disable-slash-commands",
|
|
130
|
+
"--no-session-persistence",
|
|
131
|
+
"--setting-sources",
|
|
132
|
+
"",
|
|
133
|
+
"--append-system-prompt",
|
|
134
|
+
SYSTEM_PROMPT,
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
const proc = spawn(claudeBin, args, {
|
|
138
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
139
|
+
env: { ...process.env },
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
proc.stdin.write(fullPrompt);
|
|
143
|
+
proc.stdin.end();
|
|
144
|
+
|
|
145
|
+
let stderr = "";
|
|
146
|
+
|
|
147
|
+
proc.stdout.on("data", (chunk: Buffer) => {
|
|
148
|
+
const text = chunk.toString("utf8");
|
|
149
|
+
for (const line of text.split("\n")) {
|
|
150
|
+
const trimmed = line.trim();
|
|
151
|
+
if (!trimmed) continue;
|
|
152
|
+
try {
|
|
153
|
+
const obj = JSON.parse(trimmed) as Record<string, unknown>;
|
|
154
|
+
if (obj.type === "assistant") {
|
|
155
|
+
const msg = obj.message as Record<string, unknown> | undefined;
|
|
156
|
+
const content = msg?.content as Array<Record<string, unknown>> | undefined;
|
|
157
|
+
if (Array.isArray(content)) {
|
|
158
|
+
for (const block of content) {
|
|
159
|
+
if (block.type === "text" && typeof block.text === "string") {
|
|
160
|
+
send({ type: "delta", text: block.text });
|
|
161
|
+
}
|
|
123
162
|
}
|
|
124
163
|
}
|
|
125
164
|
}
|
|
165
|
+
if (obj.type === "result") {
|
|
166
|
+
const usage = obj.usage as Record<string, unknown> | undefined;
|
|
167
|
+
const totalTokens =
|
|
168
|
+
typeof usage?.input_tokens === "number" &&
|
|
169
|
+
typeof usage?.output_tokens === "number"
|
|
170
|
+
? usage.input_tokens + usage.output_tokens
|
|
171
|
+
: undefined;
|
|
172
|
+
send({ type: "done", totalTokens: totalTokens ?? undefined });
|
|
173
|
+
}
|
|
174
|
+
} catch {
|
|
175
|
+
// Skip non-JSON lines (verbose debug output, etc.)
|
|
126
176
|
}
|
|
127
|
-
|
|
128
|
-
// Result event — extract total tokens for display.
|
|
129
|
-
if (obj.type === "result") {
|
|
130
|
-
const usage = obj.usage as Record<string, unknown> | undefined;
|
|
131
|
-
const totalTokens =
|
|
132
|
-
typeof usage?.input_tokens === "number" &&
|
|
133
|
-
typeof usage?.output_tokens === "number"
|
|
134
|
-
? usage.input_tokens + usage.output_tokens
|
|
135
|
-
: undefined;
|
|
136
|
-
send({ type: "done", totalTokens: totalTokens ?? undefined });
|
|
137
|
-
}
|
|
138
|
-
} catch {
|
|
139
|
-
// Skip non-JSON lines (verbose debug output, etc.)
|
|
140
177
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (!closed) {
|
|
156
|
-
try {
|
|
157
|
-
controller.close();
|
|
158
|
-
} catch {
|
|
159
|
-
// already closed
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
proc.stderr.on("data", (chunk: Buffer) => {
|
|
181
|
+
stderr += chunk.toString("utf8");
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
proc.on("close", (code) => {
|
|
185
|
+
if (code !== 0 && !closed) {
|
|
186
|
+
send({
|
|
187
|
+
type: "error",
|
|
188
|
+
message: stderr.trim().slice(0, 300) || `claude exited with code ${code}`,
|
|
189
|
+
});
|
|
160
190
|
}
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
});
|
|
191
|
+
finish();
|
|
192
|
+
});
|
|
164
193
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
controller.close();
|
|
170
|
-
} catch {
|
|
171
|
-
// already closed
|
|
194
|
+
proc.on("error", (err) => {
|
|
195
|
+
if (!closed) {
|
|
196
|
+
send({ type: "error", message: `Failed to spawn claude: ${err.message}` });
|
|
197
|
+
finish();
|
|
172
198
|
}
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
});
|
|
199
|
+
});
|
|
176
200
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
// ignore
|
|
183
|
-
}
|
|
184
|
-
if (!closed) {
|
|
185
|
-
try {
|
|
186
|
-
controller.close();
|
|
187
|
-
} catch {
|
|
188
|
-
// already closed
|
|
189
|
-
}
|
|
190
|
-
closed = true;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
201
|
+
request.signal.addEventListener("abort", () => {
|
|
202
|
+
try { proc.kill("SIGTERM"); } catch { /* ignore */ }
|
|
203
|
+
finish();
|
|
204
|
+
});
|
|
205
|
+
}
|
|
193
206
|
},
|
|
194
207
|
});
|
|
195
208
|
|
|
@@ -14,17 +14,16 @@
|
|
|
14
14
|
* changed file so the next RSC render re-parses fresh data.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { invalidateFile, DEFAULT_ROOT } from "@claude-lens/parser/fs";
|
|
17
|
+
import { invalidateFile, DEFAULT_ROOT, cclensHome } from "@claude-lens/parser/fs";
|
|
18
18
|
import { watch, promises as fs, existsSync } from "node:fs";
|
|
19
19
|
import path from "node:path";
|
|
20
|
-
import { homedir } from "node:os";
|
|
21
20
|
|
|
22
21
|
export const dynamic = "force-dynamic";
|
|
23
22
|
// Edge runtime can't do fs.watch
|
|
24
23
|
export const runtime = "nodejs";
|
|
25
24
|
|
|
26
|
-
/**
|
|
27
|
-
const USAGE_LOG_DIR =
|
|
25
|
+
/** cclensHome()/usage.jsonl — written by the cclens daemon every 5 minutes. */
|
|
26
|
+
const USAGE_LOG_DIR = cclensHome();
|
|
28
27
|
const USAGE_LOG_FILE = "usage.jsonl";
|
|
29
28
|
|
|
30
29
|
type LiveEvent =
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
2
|
import { join } from "node:path";
|
|
3
|
+
import { cclensPath } from "@claude-lens/parser/fs";
|
|
4
4
|
|
|
5
5
|
export const runtime = "nodejs";
|
|
6
6
|
export const dynamic = "force-dynamic";
|
|
7
7
|
|
|
8
|
-
const RUNS_DIR =
|
|
8
|
+
const RUNS_DIR = cclensPath("llm-runs");
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* GET /api/runs/<runId> dump the full event trace
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { existsSync, readdirSync, statSync, watch, openSync, readSync, closeSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
2
|
import { join } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { cclensPath } from "@claude-lens/parser/fs";
|
|
4
5
|
|
|
5
6
|
export const runtime = "nodejs";
|
|
6
7
|
export const dynamic = "force-dynamic";
|
|
7
8
|
|
|
8
|
-
const RUNS_DIR =
|
|
9
|
+
const RUNS_DIR = cclensPath("llm-runs");
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* GET /api/runs/<runId>/stream → SSE tail of a per-run trace file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync, openSync, readSync, closeSync } from "node:fs";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
3
|
import { join } from "node:path";
|
|
4
|
+
import { cclensPath } from "@claude-lens/parser/fs";
|
|
5
5
|
|
|
6
6
|
export const runtime = "nodejs";
|
|
7
7
|
export const dynamic = "force-dynamic";
|
|
@@ -57,8 +57,12 @@ function listActiveRuns(): ActiveRun[] {
|
|
|
57
57
|
}
|
|
58
58
|
const runs: ActiveRun[] = [];
|
|
59
59
|
for (const line of out.split("\n")) {
|
|
60
|
-
|
|
60
|
+
// Match both `claude -p` (print mode) and tmux-driven interactive
|
|
61
|
+
// (no `-p`). The shared marker is `--append-system-prompt`, which
|
|
62
|
+
// the LLM-runner pipeline always sets — interactive user sessions
|
|
63
|
+
// launched from a terminal don't carry it.
|
|
61
64
|
if (!line.includes("--append-system-prompt")) continue;
|
|
65
|
+
if (!/\bclaude\b/.test(line)) continue;
|
|
62
66
|
if (line.includes("grep")) continue;
|
|
63
67
|
const m = line.trim().match(/^(\d+)\s+(\S+)\s+([\d:.]+)\s+(.+)$/);
|
|
64
68
|
if (!m) continue;
|
|
@@ -74,7 +78,7 @@ function listActiveRuns(): ActiveRun[] {
|
|
|
74
78
|
return runs.sort((a, b) => a.elapsed_s - b.elapsed_s);
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
const SPEND_PATH =
|
|
81
|
+
const SPEND_PATH = cclensPath("llm-spend.jsonl");
|
|
78
82
|
|
|
79
83
|
type CompletedRun = {
|
|
80
84
|
ts: string;
|
|
@@ -123,7 +127,7 @@ function parseSince(s: string | null): number {
|
|
|
123
127
|
return Date.now() - 24 * 3_600_000;
|
|
124
128
|
}
|
|
125
129
|
|
|
126
|
-
const RUNS_DIR =
|
|
130
|
+
const RUNS_DIR = cclensPath("llm-runs");
|
|
127
131
|
|
|
128
132
|
type TraceSummary = {
|
|
129
133
|
run_id: string;
|
|
@@ -621,6 +621,12 @@ export function SessionView({
|
|
|
621
621
|
</span>
|
|
622
622
|
<InlineStatDivider />
|
|
623
623
|
{model && <InlineStat icon={<Cpu size={12} />} value={model} mono />}
|
|
624
|
+
{session.entrypoint && (
|
|
625
|
+
<>
|
|
626
|
+
<InlineStatDivider />
|
|
627
|
+
<EntrypointBadge entrypoint={session.entrypoint} />
|
|
628
|
+
</>
|
|
629
|
+
)}
|
|
624
630
|
<InlineStatDivider />
|
|
625
631
|
<InlineStat icon={<Folder size={12} />} value={projectName} truncate />
|
|
626
632
|
<InlineStatDivider />
|
|
@@ -1143,6 +1149,31 @@ function InlineStatDivider() {
|
|
|
1143
1149
|
);
|
|
1144
1150
|
}
|
|
1145
1151
|
|
|
1152
|
+
function EntrypointBadge({ entrypoint }: { entrypoint: string }) {
|
|
1153
|
+
// cli + claude-desktop are human-driven; sdk-* are programmatic.
|
|
1154
|
+
const isSdk = entrypoint.startsWith("sdk-");
|
|
1155
|
+
const tone = isSdk
|
|
1156
|
+
? { bg: "rgba(245, 158, 11, 0.16)", fg: "#b45309" }
|
|
1157
|
+
: { bg: "rgba(16, 185, 129, 0.16)", fg: "#047857" };
|
|
1158
|
+
return (
|
|
1159
|
+
<span
|
|
1160
|
+
title={`entrypoint: ${entrypoint}`}
|
|
1161
|
+
style={{
|
|
1162
|
+
fontSize: 10.5,
|
|
1163
|
+
padding: "2px 7px",
|
|
1164
|
+
borderRadius: 4,
|
|
1165
|
+
background: tone.bg,
|
|
1166
|
+
color: tone.fg,
|
|
1167
|
+
fontWeight: 600,
|
|
1168
|
+
fontFamily: "var(--font-mono)",
|
|
1169
|
+
letterSpacing: 0.2,
|
|
1170
|
+
}}
|
|
1171
|
+
>
|
|
1172
|
+
{entrypoint}
|
|
1173
|
+
</span>
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1146
1177
|
function InlineTokenStat({ usage }: { usage: SessionEvent["usage"] }) {
|
|
1147
1178
|
const { ref, anchor, open, close } = useAnchoredTooltip();
|
|
1148
1179
|
const u = usage ?? { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
|
@@ -40,34 +40,37 @@ export function JobQueueWidget() {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
// Poll /api/jobs. Faster cadence when there's anything active.
|
|
43
|
+
// Poll /api/jobs. Faster cadence when there's anything active. Empty
|
|
44
|
+
// deps + closure-local `hasActive` — listing `jobs` here would re-run
|
|
45
|
+
// the effect on every successful tick (because setJobs changes the
|
|
46
|
+
// ref), collapsing the throttle into a tight 1–4 ms refetch loop.
|
|
44
47
|
useEffect(() => {
|
|
45
48
|
let mounted = true;
|
|
46
49
|
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
50
|
+
let hasActive = false;
|
|
47
51
|
|
|
48
52
|
const tick = async () => {
|
|
49
53
|
try {
|
|
50
54
|
const res = await fetch("/api/jobs", { cache: "no-store" });
|
|
51
55
|
if (!res.ok) return;
|
|
52
56
|
const data = await res.json() as { jobs: Job[] };
|
|
53
|
-
if (mounted)
|
|
57
|
+
if (!mounted) return;
|
|
58
|
+
setJobs(data.jobs);
|
|
59
|
+
hasActive = data.jobs.some(j => j.status === "running" || j.status === "queued");
|
|
54
60
|
} catch { /* ignore */ }
|
|
55
61
|
};
|
|
56
62
|
|
|
57
63
|
const schedule = () => {
|
|
58
64
|
if (!mounted) return;
|
|
59
|
-
|
|
60
|
-
const delay = hasActive ? 1500 : 6000;
|
|
61
|
-
timeoutId = setTimeout(async () => { await tick(); schedule(); }, delay);
|
|
65
|
+
timeoutId = setTimeout(async () => { await tick(); schedule(); }, hasActive ? 1500 : 6000);
|
|
62
66
|
};
|
|
63
67
|
|
|
64
|
-
void tick();
|
|
65
|
-
schedule();
|
|
68
|
+
void tick().then(schedule);
|
|
66
69
|
return () => {
|
|
67
70
|
mounted = false;
|
|
68
71
|
if (timeoutId) clearTimeout(timeoutId);
|
|
69
72
|
};
|
|
70
|
-
}, [
|
|
73
|
+
}, []);
|
|
71
74
|
|
|
72
75
|
const active = jobs.filter(j => j.status === "running" || j.status === "queued");
|
|
73
76
|
const recent = jobs.filter(j => j.status === "done" || j.status === "error" || j.status === "cancelled").slice(0, 8);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { cache } from "react";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import {
|
|
5
|
-
import { homedir } from "node:os";
|
|
6
|
-
import { loadCalibrationCurve } from "@claude-lens/parser/fs";
|
|
4
|
+
import { loadCalibrationCurve, cclensPath } from "@claude-lens/parser/fs";
|
|
7
5
|
import type { PlanTier, RateSource } from "@claude-lens/parser";
|
|
8
6
|
|
|
9
7
|
// One point on the calibration overlay — pairs the daemon's measured
|
|
@@ -71,7 +69,7 @@ export function predictedSeriesFor(dump: CalibrationDump | null): PredictedSerie
|
|
|
71
69
|
// start we fall back to the heaviest tier so cold-start back-fill predicts
|
|
72
70
|
// the longest possible windows. The profile cache lives next to the JSON
|
|
73
71
|
// dump and is read below if available.
|
|
74
|
-
const PROFILE_CACHE =
|
|
72
|
+
const PROFILE_CACHE = cclensPath("profile.json");
|
|
75
73
|
const DEFAULT_TIER: PlanTier = "pro-max-20x";
|
|
76
74
|
|
|
77
75
|
function readTier(): PlanTier {
|