fleetlens 0.4.0 → 0.4.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.
Files changed (42) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/build-manifest.json +3 -3
  3. package/app/apps/web/.next/prerender-manifest.json +3 -3
  4. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  13. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  14. package/app/apps/web/.next/server/app/insights/print/[key]/page_client-reference-manifest.js +1 -1
  15. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  16. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  17. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  18. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  19. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  21. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  22. package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_0bc7ptm.js +1 -1
  23. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +1 -1
  24. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__13itnvx._.js +1 -1
  25. package/app/apps/web/.next/server/chunks/ssr/_0xies90._.js +1 -1
  26. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0-jvt~a._.js +1 -1
  27. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  28. package/app/apps/web/.next/server/pages/500.html +1 -1
  29. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  30. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  31. package/app/apps/web/.next/static/chunks/0u-n8fz-ms.ee.js +6 -0
  32. package/app/apps/web/.next/static/chunks/{063oimt30jeo9.js → 15w5_bct86ut6.js} +2 -2
  33. package/app/apps/web/app/sessions/[id]/session-view.tsx +450 -21
  34. package/app/apps/web/package.json +1 -1
  35. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  36. package/dist/daemon-worker.js +87 -0
  37. package/dist/index.js +92 -5
  38. package/package.json +1 -1
  39. package/app/apps/web/.next/static/chunks/03g5dw5eskotd.js +0 -6
  40. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 95-RytHk7ZQtfpZj5BLST}/_buildManifest.js +0 -0
  41. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 95-RytHk7ZQtfpZj5BLST}/_clientMiddlewareManifest.js +0 -0
  42. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 95-RytHk7ZQtfpZj5BLST}/_ssgManifest.js +0 -0
@@ -245,6 +245,91 @@ function parseTranscript(rawLines) {
245
245
  }
246
246
  activeSegments.push({ startMs: segStart, endMs: segEnd });
247
247
  }
248
+ const COLD_GAP_MS = 5 * 60 * 1e3;
249
+ const COLD_MIN_WRITE = 1e3;
250
+ const COLD_MIN_RATIO = 0.3;
251
+ const buckets = /* @__PURE__ */ new Map();
252
+ const compactBoundaries = [];
253
+ for (const e of events) {
254
+ if (!e.timestamp)
255
+ continue;
256
+ const ms = Date.parse(e.timestamp);
257
+ if (Number.isNaN(ms))
258
+ continue;
259
+ if (e.rawType === "assistant" && e.usage && e.messageId) {
260
+ const b = buckets.get(e.messageId);
261
+ if (b) {
262
+ b.siblings.push(e);
263
+ if (ms < b.ms) {
264
+ b.rep = e;
265
+ b.ms = ms;
266
+ }
267
+ } else {
268
+ buckets.set(e.messageId, { rep: e, ms, siblings: [e] });
269
+ }
270
+ } else if (e.rawType === "system") {
271
+ const r = e.raw;
272
+ if (r?.subtype !== "compact_boundary")
273
+ continue;
274
+ const meta = r.compactMetadata ?? {};
275
+ compactBoundaries.push({
276
+ ms,
277
+ trigger: meta.trigger === "manual" ? "manual" : "auto",
278
+ preTokens: typeof meta.preTokens === "number" ? meta.preTokens : 0
279
+ });
280
+ }
281
+ }
282
+ const assistantChrono = [...buckets.values()].sort((a, b) => a.ms - b.ms);
283
+ compactBoundaries.sort((a, b) => a.ms - b.ms);
284
+ let coldResumeCount = 0;
285
+ let cacheRebuildTokens = 0;
286
+ const applyFlag = (bucket, flag) => {
287
+ for (const sib of bucket.siblings)
288
+ sib.coldResume = flag;
289
+ coldResumeCount++;
290
+ cacheRebuildTokens += flag.writeTokens;
291
+ };
292
+ const flagged = /* @__PURE__ */ new Set();
293
+ for (const b of compactBoundaries) {
294
+ const after = assistantChrono.find((a) => a.ms > b.ms && (a.rep.usage?.cacheWrite ?? 0) >= COLD_MIN_WRITE);
295
+ if (!after)
296
+ continue;
297
+ let prevMs;
298
+ for (let i = assistantChrono.length - 1; i >= 0; i--) {
299
+ if (assistantChrono[i].ms <= b.ms) {
300
+ prevMs = assistantChrono[i].ms;
301
+ break;
302
+ }
303
+ }
304
+ const u = after.rep.usage;
305
+ const denom = u.cacheWrite + u.cacheRead;
306
+ applyFlag(after, {
307
+ trigger: "compact",
308
+ gapMs: prevMs !== void 0 ? after.ms - prevMs : 0,
309
+ writeTokens: u.cacheWrite,
310
+ writeRatio: denom > 0 ? u.cacheWrite / denom : 0,
311
+ compact: { trigger: b.trigger, preTokens: b.preTokens }
312
+ });
313
+ flagged.add(after.rep.messageId);
314
+ }
315
+ for (let i = 1; i < assistantChrono.length; i++) {
316
+ const prev = assistantChrono[i - 1];
317
+ const cur = assistantChrono[i];
318
+ if (flagged.has(cur.rep.messageId))
319
+ continue;
320
+ const u = cur.rep.usage;
321
+ const denom = u.cacheWrite + u.cacheRead;
322
+ const writeRatio = denom > 0 ? u.cacheWrite / denom : 0;
323
+ const gapMs = cur.ms - prev.ms;
324
+ if (gapMs > COLD_GAP_MS && u.cacheWrite >= COLD_MIN_WRITE && writeRatio >= COLD_MIN_RATIO) {
325
+ applyFlag(cur, {
326
+ trigger: "idle",
327
+ gapMs,
328
+ writeTokens: u.cacheWrite,
329
+ writeRatio
330
+ });
331
+ }
332
+ }
248
333
  const totalUsage = { ...BLANK_USAGE };
249
334
  const seenMessageIds = /* @__PURE__ */ new Set();
250
335
  let model;
@@ -368,6 +453,8 @@ function parseTranscript(rawLines) {
368
453
  linesAdded,
369
454
  linesRemoved,
370
455
  filesEdited: filesEdited.size,
456
+ coldResumeCount,
457
+ cacheRebuildTokens,
371
458
  teamName,
372
459
  agentName,
373
460
  isTeamLead: teamName !== void 0 && agentName === void 0 && (hasTeamCreate || hasOutboundDispatch)
package/dist/index.js CHANGED
@@ -454,9 +454,9 @@ Installed: ${PACKAGE_NAME}@${verify.installedVersion} at ${verify.installedPath
454
454
  console.warn(
455
455
  ` \u2022 reinstall in the correct Node env: 'npm install -g ${PACKAGE_NAME}@latest'`
456
456
  );
457
- } else if (verify.installedVersion !== "0.4.0") {
457
+ } else if (verify.installedVersion !== "0.4.1") {
458
458
  console.log(
459
- ` \u2192 This process is still running ${"0.4.0"}. Next invocation will use ${verify.installedVersion}.`
459
+ ` \u2192 This process is still running ${"0.4.1"}. Next invocation will use ${verify.installedVersion}.`
460
460
  );
461
461
  }
462
462
  }
@@ -492,7 +492,7 @@ async function checkForUpdate() {
492
492
  if (process.env.__FLEETLENS_UPDATED === "1" || process.env.__CCLENS_UPDATED === "1") return;
493
493
  const latest = await fetchLatestVersion();
494
494
  if (latest === null) return;
495
- const current = "0.4.0";
495
+ const current = "0.4.1";
496
496
  if (!shouldUpdate(current, latest)) return;
497
497
  console.log(`Updating ${PACKAGE_NAME} ${current} \u2192 ${latest}...`);
498
498
  await stopRunningServices();
@@ -574,7 +574,7 @@ async function restartServices(state) {
574
574
  }
575
575
  async function forceUpdate() {
576
576
  const latest = await fetchLatestVersion();
577
- const current = "0.4.0";
577
+ const current = "0.4.1";
578
578
  if (latest === null) {
579
579
  console.error("Could not reach npm registry. Check your network.");
580
580
  process.exit(1);
@@ -1018,6 +1018,91 @@ function parseTranscript(rawLines) {
1018
1018
  }
1019
1019
  activeSegments.push({ startMs: segStart, endMs: segEnd });
1020
1020
  }
1021
+ const COLD_GAP_MS = 5 * 60 * 1e3;
1022
+ const COLD_MIN_WRITE = 1e3;
1023
+ const COLD_MIN_RATIO = 0.3;
1024
+ const buckets = /* @__PURE__ */ new Map();
1025
+ const compactBoundaries = [];
1026
+ for (const e of events) {
1027
+ if (!e.timestamp)
1028
+ continue;
1029
+ const ms = Date.parse(e.timestamp);
1030
+ if (Number.isNaN(ms))
1031
+ continue;
1032
+ if (e.rawType === "assistant" && e.usage && e.messageId) {
1033
+ const b = buckets.get(e.messageId);
1034
+ if (b) {
1035
+ b.siblings.push(e);
1036
+ if (ms < b.ms) {
1037
+ b.rep = e;
1038
+ b.ms = ms;
1039
+ }
1040
+ } else {
1041
+ buckets.set(e.messageId, { rep: e, ms, siblings: [e] });
1042
+ }
1043
+ } else if (e.rawType === "system") {
1044
+ const r = e.raw;
1045
+ if (r?.subtype !== "compact_boundary")
1046
+ continue;
1047
+ const meta = r.compactMetadata ?? {};
1048
+ compactBoundaries.push({
1049
+ ms,
1050
+ trigger: meta.trigger === "manual" ? "manual" : "auto",
1051
+ preTokens: typeof meta.preTokens === "number" ? meta.preTokens : 0
1052
+ });
1053
+ }
1054
+ }
1055
+ const assistantChrono = [...buckets.values()].sort((a, b) => a.ms - b.ms);
1056
+ compactBoundaries.sort((a, b) => a.ms - b.ms);
1057
+ let coldResumeCount = 0;
1058
+ let cacheRebuildTokens = 0;
1059
+ const applyFlag = (bucket, flag2) => {
1060
+ for (const sib of bucket.siblings)
1061
+ sib.coldResume = flag2;
1062
+ coldResumeCount++;
1063
+ cacheRebuildTokens += flag2.writeTokens;
1064
+ };
1065
+ const flagged = /* @__PURE__ */ new Set();
1066
+ for (const b of compactBoundaries) {
1067
+ const after = assistantChrono.find((a) => a.ms > b.ms && (a.rep.usage?.cacheWrite ?? 0) >= COLD_MIN_WRITE);
1068
+ if (!after)
1069
+ continue;
1070
+ let prevMs;
1071
+ for (let i = assistantChrono.length - 1; i >= 0; i--) {
1072
+ if (assistantChrono[i].ms <= b.ms) {
1073
+ prevMs = assistantChrono[i].ms;
1074
+ break;
1075
+ }
1076
+ }
1077
+ const u = after.rep.usage;
1078
+ const denom = u.cacheWrite + u.cacheRead;
1079
+ applyFlag(after, {
1080
+ trigger: "compact",
1081
+ gapMs: prevMs !== void 0 ? after.ms - prevMs : 0,
1082
+ writeTokens: u.cacheWrite,
1083
+ writeRatio: denom > 0 ? u.cacheWrite / denom : 0,
1084
+ compact: { trigger: b.trigger, preTokens: b.preTokens }
1085
+ });
1086
+ flagged.add(after.rep.messageId);
1087
+ }
1088
+ for (let i = 1; i < assistantChrono.length; i++) {
1089
+ const prev = assistantChrono[i - 1];
1090
+ const cur = assistantChrono[i];
1091
+ if (flagged.has(cur.rep.messageId))
1092
+ continue;
1093
+ const u = cur.rep.usage;
1094
+ const denom = u.cacheWrite + u.cacheRead;
1095
+ const writeRatio = denom > 0 ? u.cacheWrite / denom : 0;
1096
+ const gapMs = cur.ms - prev.ms;
1097
+ if (gapMs > COLD_GAP_MS && u.cacheWrite >= COLD_MIN_WRITE && writeRatio >= COLD_MIN_RATIO) {
1098
+ applyFlag(cur, {
1099
+ trigger: "idle",
1100
+ gapMs,
1101
+ writeTokens: u.cacheWrite,
1102
+ writeRatio
1103
+ });
1104
+ }
1105
+ }
1021
1106
  const totalUsage = { ...BLANK_USAGE };
1022
1107
  const seenMessageIds = /* @__PURE__ */ new Set();
1023
1108
  let model;
@@ -1141,6 +1226,8 @@ function parseTranscript(rawLines) {
1141
1226
  linesAdded,
1142
1227
  linesRemoved,
1143
1228
  filesEdited: filesEdited.size,
1229
+ coldResumeCount,
1230
+ cacheRebuildTokens,
1144
1231
  teamName,
1145
1232
  agentName,
1146
1233
  isTeamLead: teamName !== void 0 && agentName === void 0 && (hasTeamCreate || hasOutboundDispatch)
@@ -4610,7 +4697,7 @@ async function main() {
4610
4697
  case "version":
4611
4698
  case "--version":
4612
4699
  case "-v":
4613
- console.log(`fleetlens ${"0.4.0"}`);
4700
+ console.log(`fleetlens ${"0.4.1"}`);
4614
4701
  break;
4615
4702
  case "help":
4616
4703
  case "--help":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetlens",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "fleetlens — local-only dashboard and usage tracker for Claude Code sessions and agent fleets",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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:l="",children:s,iconNode:c,...u},d)=>(0,t.createElement)("svg",{ref:d,...n,width:a,height:a,stroke:e,strokeWidth:o?24*Number(i)/Number(a):i,className:r("lucide",l),...u},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(s)?s:[s]]));e.s(["default",0,(e,n)=>{let i=(0,t.forwardRef)(({className:i,...o},l)=>(0,t.createElement)(a,{ref:l,iconNode:n,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,i),...o}));return i.displayName=`${e}`,i}],75254)},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return l}};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 l(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 s(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 b},NormalizeError:function(){return x},PageNotFoundError:function(){return v},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};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 l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(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 v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b 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 j(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=>{}},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return s}};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 l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",l=e.hash||"",s=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)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),a=a.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${a}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(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 v}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809),o=e.r(18050),l=i._(e.r(71645)),s=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),f=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var r,n;let a,i,y,[v,b]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,l.useRef)(null),{href:j,as:k,children:S,prefetch:M=null,passHref:$,replace:P,shallow:T,scroll:E,onClick:O,onMouseEnter:C,onTouchStart:N,legacyBehavior:z=!1,onNavigate:R,transitionTypes:I,ref:_,unstable_dynamicOnHover:L,...D}=t;a=S,z&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let A=l.default.useContext(c.AppRouterContext),W=!1!==M,F=!1!==M?null===(n=M)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,U="string"==typeof(r=k||j)?r:(0,s.formatUrl)(r);if(z){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=l.default.Children.only(a)}let B=z?i&&"object"==typeof i&&i.ref:_,H=l.default.useCallback(e=>(null!==A&&(w.current=(0,h.mountLinkInstance)(e,U,A,F,W,b)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[W,U,A,F,b]),q={ref:(0,u.useMergedRef)(H,B),onClick(t){z||"function"!=typeof O||O(t),z&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!A||t.defaultPrevented||function(t,r,n,a,i,o,s){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.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:d}=e.r(99781);l.default.startTransition(()=>{d(r,a?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,s)})}}(t,U,w,P,E,R,I)},onMouseEnter(e){z||"function"!=typeof C||C(e),z&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),A&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){z||"function"!=typeof N||N(e),z&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),A&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,d.isAbsoluteUrl)(U)?q.href=U:z&&!$&&("a"!==i.type||"href"in i.props)||(q.href=(0,f.addBasePath)(U)),y=z?l.default.cloneElement(i,q):(0,o.jsx)("a",{...D,...q,children:a}),(0,o.jsx)(x.Provider,{value:v,children:y})}e.r(84508);let x=(0,l.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,l.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)},41240,e=>{"use strict";let t=(0,e.i(75254).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,t],41240)},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]}])},18566,(e,t,r)=>{t.exports=e.r(76562)},56324,e=>{"use strict";e.s(["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"}]]),l=(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"}]]),s=(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)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),u=(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 f=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 g=e.i(41240),m=e.i(56324);let y=(0,i.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),x=(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"}]]),v="claude-lens:theme";function b(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 w(){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(v);if("light"===e||"dark"===e)return e}catch{}return null}()??(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark");r(e),b(e)}i(!0)},[]),(0,t.jsx)("button",{type:"button",onClick:()=>{let t="dark"===e?"light":"dark";r(t),b(t);try{window.localStorage.setItem(v,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)(x,{size:14}):(0,t.jsx)(y,{size:14}):null})}var j=e.i(86619);function k({snapshot:e}){let n,a,[i,,o]=(0,j.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 l=[{label:"5h",window:e.five_hour},{label:"7d",window:e.seven_day}];return o&&i&&l.push({label:"Sonnet 7d",window:e.seven_day_sonnet}),(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:l.map(e=>(0,t.jsx)(S,{...e},e.label))})]})}function S({label:e,window:r}){let n=r?.utilization??null,a=null!==n,i=a?Math.max(0,Math.min(100,n)):0,o=i>=90?"var(--af-danger)":i>=70?"var(--af-warning)":"var(--af-success)";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:a?`${i.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:a?`${i}%`:"0%",background:o,borderRadius:999,transition:"width 0.24s ease"}})})]})}let M="claude-lens:pinned-projects:v1";function $({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 P({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)}`,l=a===n,s=(0,m.prettyProjectName)(e.projectName);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:l?"var(--af-accent-subtle)":"transparent",color:l?"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:s}),(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)(u,{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,m.formatRelative)(new Date(e.lastActiveMs).toISOString())})]},e.projectDir)})})]})}e.s(["Sidebar",0,function({projects:e,totalSessions:r,currentUsage:i,version:u}){let d=(0,n.usePathname)(),[m,y]=(0,a.useState)(new Set),[x,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)("");(0,a.useEffect)(()=>{y(function(){try{let e=window.localStorage.getItem(M);if(!e)return new Set;let t=JSON.parse(e);return new Set(Array.isArray(t)?t:[])}catch{return new Set}}()),v(!0)},[]);let S=e=>{y(t=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e);try{window.localStorage.setItem(M,JSON.stringify(Array.from(r)))}catch{}return r})},T=(0,a.useMemo)(()=>{if(!b.trim())return e;let t=b.toLowerCase();return e.filter(e=>e.projectName.toLowerCase().includes(t))},[e,b]),E=T.filter(e=>m.has(e.projectDir)),O=T.filter(e=>!m.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 ${u}`,children:["v",u]})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Claude Code fleet analytics"})]})]})}),(0,t.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)($,{href:"/",active:"/"===d,icon:(0,t.jsx)(o,{size:15}),children:"Overview"}),(0,t.jsx)($,{href:"/sessions",active:"/sessions"===d||d.startsWith("/sessions/"),icon:(0,t.jsx)(l,{size:15}),trailing:r>0?String(r):void 0,children:"All sessions"}),(0,t.jsx)($,{href:"/projects",active:"/projects"===d,icon:(0,t.jsx)(s,{size:15}),trailing:e.length>0?String(e.length):void 0,children:"Projects"}),(0,t.jsx)($,{href:"/parallelism",active:"/parallelism"===d,icon:(0,t.jsx)(c,{size:15}),children:"Timeline"}),(0,t.jsx)($,{href:"/usage",active:"/usage"===d,icon:(0,t.jsx)(h,{size:15}),children:"Usage"}),(0,t.jsx)($,{href:"/insights",active:"/insights"===d,icon:(0,t.jsx)(g.Lightbulb,{size:15}),children:"Insights"})]}),(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)(f.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,t.jsx)("input",{type:"text",placeholder:"Search projects",value:b,onChange:e=>j(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:[x&&E.length>0&&(0,t.jsx)(P,{label:"Pinned",items:E,pathname:d,isPinned:e=>m.has(e),onTogglePin:S}),(0,t.jsx)(P,{label:"Projects",items:O,pathname:d,isPinned:e=>m.has(e),onTogglePin:S})]}),(0,t.jsx)(k,{snapshot:i}),(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:[r," sessions · ",e.length," projects"]}),(0,t.jsx)(w,{})]})]})}],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);let l="cclens-live-widget-expanded";e.s(["LiveSessionsWidget",0,function({sessions:e}){let s=(0,n.usePathname)(),[c,u]=(0,r.useState)(()=>Date.now()),[d,f]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{try{let e=localStorage.getItem(l);null!==e&&f("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=setInterval(()=>u(Date.now()),1e4);return()=>clearInterval(e)},[]),s&&/^\/sessions\/[^/]+$/.test(s))return null;let p=e.filter(e=>{if(!e.lastTimestamp)return!1;let t=Date.parse(e.lastTimestamp);return!Number.isNaN(t)&&c-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===p.length)return null;let h=d?p.slice(0,5):[],g=d?p.length-h.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 f(t=>{let r=e(t);try{localStorage.setItem(l,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:d?"Collapse":`Show ${p.length} live session${1===p.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 · ",p.length]}),d&&g>0&&(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",g," more live"]}),h.map(e=>(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:[(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)("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
- `})]})}])}]);