fleetlens 0.10.3 → 0.10.4

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 (49) 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/changelog/page_client-reference-manifest.js +1 -1
  13. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  14. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  15. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  16. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  17. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  18. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  19. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  20. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  21. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  22. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  23. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  24. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  26. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  27. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  28. package/app/apps/web/.next/server/chunks/[root-of-the-server]__02px2mk._.js +1 -1
  29. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0vm_41a._.js +1 -1
  30. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +6 -6
  31. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0.za3_3._.js +1 -1
  32. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  33. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_0m67-xi._.js +1 -1
  34. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_12.endt._.js +1 -1
  35. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  36. package/app/apps/web/.next/server/pages/500.html +1 -1
  37. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  38. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  39. package/app/apps/web/.next/static/chunks/08nun7x9h-ro1.js +14 -0
  40. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  41. package/app/apps/web/package.json +1 -1
  42. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  43. package/dist/daemon-worker.js +23 -8
  44. package/dist/index.js +27 -12
  45. package/package.json +6 -1
  46. package/app/apps/web/.next/static/chunks/0o3uir-f-t73p.js +0 -14
  47. /package/app/apps/web/.next/static/{dGL5ege3-_A21c65DU7Jq → _8He0IMRxt70EDQL1JOFe}/_buildManifest.js +0 -0
  48. /package/app/apps/web/.next/static/{dGL5ege3-_A21c65DU7Jq → _8He0IMRxt70EDQL1JOFe}/_clientMiddlewareManifest.js +0 -0
  49. /package/app/apps/web/.next/static/{dGL5ege3-_A21c65DU7Jq → _8He0IMRxt70EDQL1JOFe}/_ssgManifest.js +0 -0
@@ -1453,6 +1453,12 @@ function decodeProjectName(dir) {
1453
1453
  return dir;
1454
1454
  return "/" + dir.slice(1).replace(/-/g, "/");
1455
1455
  }
1456
+ function encodeProjectDir(cwd) {
1457
+ return cwd.replace(/[/.]/g, "-");
1458
+ }
1459
+ function isFleetlensRuntimeDir(projectDir) {
1460
+ return projectDir === FLEETLENS_RUNTIME_PROJECT_DIR;
1461
+ }
1456
1462
  async function readJsonlFile(filePath) {
1457
1463
  const raw = await fs.readFile(filePath, "utf8");
1458
1464
  const out = [];
@@ -1499,7 +1505,7 @@ async function walkJsonlFiles(root = DEFAULT_ROOT) {
1499
1505
  } catch {
1500
1506
  return [];
1501
1507
  }
1502
- const projectDirs = topEntries.filter((e) => e.isDirectory()).map((e) => e.name);
1508
+ const projectDirs = topEntries.filter((e) => e.isDirectory() && !isFleetlensRuntimeDir(e.name)).map((e) => e.name);
1503
1509
  const perProject = await Promise.all(projectDirs.map(async (projectDir) => {
1504
1510
  const projectPath = path.join(root, projectDir);
1505
1511
  let files;
@@ -1980,7 +1986,7 @@ async function findTeamLead(sessionId, opts = {}) {
1980
1986
  agentName: self.agentName
1981
1987
  };
1982
1988
  }
1983
- var DEFAULT_ROOT, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, claudeCodeSource;
1989
+ var DEFAULT_ROOT, FLEETLENS_RUNTIME_PROJECT_DIR, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, claudeCodeSource;
1984
1990
  var init_claude_code = __esm({
1985
1991
  "../parser/dist/claude-code.js"() {
1986
1992
  "use strict";
@@ -1990,6 +1996,7 @@ var init_claude_code = __esm({
1990
1996
  init_agent_metadata();
1991
1997
  init_calibration();
1992
1998
  DEFAULT_ROOT = path.join(os.homedir(), ".claude", "projects");
1999
+ FLEETLENS_RUNTIME_PROJECT_DIR = encodeProjectDir(path.join(os.homedir(), ".cclens", "runtime"));
1993
2000
  metaCache = /* @__PURE__ */ new Map();
1994
2001
  detailCache = /* @__PURE__ */ new Map();
1995
2002
  calibrationEventsCache = /* @__PURE__ */ new Map();
@@ -2989,6 +2996,7 @@ __export(fs_exports, {
2989
2996
  getLatestCodexUsage: () => getLatestCodexUsage,
2990
2997
  getSession: () => getSession,
2991
2998
  invalidateFile: () => invalidateFile,
2999
+ isFleetlensRuntimeDir: () => isFleetlensRuntimeDir,
2992
3000
  listAllSessions: () => listAllSessions,
2993
3001
  listCodexSessions: () => listCodexSessions,
2994
3002
  listGeminiSessions: () => listGeminiSessions,
@@ -9854,8 +9862,9 @@ exec ${shellEscape(claudeBin)} \\
9854
9862
  const timeoutMs = args.timeoutMs ?? 12e4;
9855
9863
  let lastReportedKb = -1;
9856
9864
  let lastEmittedLength = 0;
9865
+ let transcriptPath;
9857
9866
  try {
9858
- const transcriptPath = await discoverTranscript(cwd, existingBefore, startMs, timeoutMs, args.signal);
9867
+ transcriptPath = await discoverTranscript(cwd, existingBefore, startMs, timeoutMs, args.signal);
9859
9868
  while (Date.now() - startMs < timeoutMs) {
9860
9869
  if (args.signal?.aborted)
9861
9870
  throw new TmuxRunError("aborted");
@@ -9888,7 +9897,7 @@ exec ${shellEscape(claudeBin)} \\
9888
9897
  throw new TmuxRunError(`timeout after ${timeoutMs}ms waiting for assistant turn`);
9889
9898
  } finally {
9890
9899
  args.signal?.removeEventListener("abort", onAbort);
9891
- cleanup(cwd, runId, tmuxBin, sessionName);
9900
+ cleanup(cwd, runId, tmuxBin, sessionName, transcriptPath);
9892
9901
  }
9893
9902
  }
9894
9903
  function num(v) {
@@ -10028,12 +10037,18 @@ function parseTranscript2(path5, defaultModel) {
10028
10037
  }
10029
10038
  return { assembled, inputTokens, outputTokens, modelUsed, done };
10030
10039
  }
10031
- function cleanup(cwd, runId, tmuxBin, sessionName) {
10040
+ function cleanup(cwd, runId, tmuxBin, sessionName, transcriptPath) {
10032
10041
  try {
10033
10042
  spawnSync(tmuxBin, ["kill-session", "-t", sessionName], { stdio: "ignore" });
10034
10043
  } catch {
10035
10044
  }
10036
10045
  if (process.env.FLEETLENS_TMUX_KEEP_WRAPPER !== "1") {
10046
+ if (transcriptPath) {
10047
+ try {
10048
+ unlinkSync2(transcriptPath);
10049
+ } catch {
10050
+ }
10051
+ }
10037
10052
  for (const f of [`system-${runId}.txt`, `user-${runId}.txt`, `run-${runId}.sh`]) {
10038
10053
  try {
10039
10054
  unlinkSync2(join6(cwd, f));
@@ -13381,14 +13396,14 @@ async function getUpdateAvailability() {
13381
13396
  if (isDevMode()) return null;
13382
13397
  const latest = await fetchLatestVersion();
13383
13398
  if (latest === null) return {
13384
- current: "0.10.3",
13399
+ current: "0.10.4",
13385
13400
  latest: null,
13386
13401
  updateAvailable: false
13387
13402
  };
13388
13403
  return {
13389
- current: "0.10.3",
13404
+ current: "0.10.4",
13390
13405
  latest,
13391
- updateAvailable: shouldUpdate("0.10.3", latest)
13406
+ updateAvailable: shouldUpdate("0.10.4", latest)
13392
13407
  };
13393
13408
  }
13394
13409
 
package/dist/index.js CHANGED
@@ -1470,6 +1470,12 @@ function decodeProjectName(dir) {
1470
1470
  return dir;
1471
1471
  return "/" + dir.slice(1).replace(/-/g, "/");
1472
1472
  }
1473
+ function encodeProjectDir(cwd) {
1474
+ return cwd.replace(/[/.]/g, "-");
1475
+ }
1476
+ function isFleetlensRuntimeDir(projectDir) {
1477
+ return projectDir === FLEETLENS_RUNTIME_PROJECT_DIR;
1478
+ }
1473
1479
  async function readJsonlFile(filePath) {
1474
1480
  const raw = await fs.readFile(filePath, "utf8");
1475
1481
  const out = [];
@@ -1516,7 +1522,7 @@ async function walkJsonlFiles(root = DEFAULT_ROOT) {
1516
1522
  } catch {
1517
1523
  return [];
1518
1524
  }
1519
- const projectDirs = topEntries.filter((e) => e.isDirectory()).map((e) => e.name);
1525
+ const projectDirs = topEntries.filter((e) => e.isDirectory() && !isFleetlensRuntimeDir(e.name)).map((e) => e.name);
1520
1526
  const perProject = await Promise.all(projectDirs.map(async (projectDir) => {
1521
1527
  const projectPath = path.join(root, projectDir);
1522
1528
  let files;
@@ -1997,7 +2003,7 @@ async function findTeamLead(sessionId, opts = {}) {
1997
2003
  agentName: self.agentName
1998
2004
  };
1999
2005
  }
2000
- var DEFAULT_ROOT, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, claudeCodeSource;
2006
+ var DEFAULT_ROOT, FLEETLENS_RUNTIME_PROJECT_DIR, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, claudeCodeSource;
2001
2007
  var init_claude_code = __esm({
2002
2008
  "../parser/dist/claude-code.js"() {
2003
2009
  "use strict";
@@ -2007,6 +2013,7 @@ var init_claude_code = __esm({
2007
2013
  init_agent_metadata();
2008
2014
  init_calibration();
2009
2015
  DEFAULT_ROOT = path.join(os.homedir(), ".claude", "projects");
2016
+ FLEETLENS_RUNTIME_PROJECT_DIR = encodeProjectDir(path.join(os.homedir(), ".cclens", "runtime"));
2010
2017
  metaCache = /* @__PURE__ */ new Map();
2011
2018
  detailCache = /* @__PURE__ */ new Map();
2012
2019
  calibrationEventsCache = /* @__PURE__ */ new Map();
@@ -3006,6 +3013,7 @@ __export(fs_exports, {
3006
3013
  getLatestCodexUsage: () => getLatestCodexUsage,
3007
3014
  getSession: () => getSession,
3008
3015
  invalidateFile: () => invalidateFile,
3016
+ isFleetlensRuntimeDir: () => isFleetlensRuntimeDir,
3009
3017
  listAllSessions: () => listAllSessions,
3010
3018
  listCodexSessions: () => listCodexSessions,
3011
3019
  listGeminiSessions: () => listGeminiSessions,
@@ -3720,9 +3728,9 @@ Installed: ${PACKAGE_NAME}@${verify.installedVersion} at ${verify.installedPath
3720
3728
  console.warn(
3721
3729
  ` \u2022 reinstall in the correct Node env: 'npm install -g ${PACKAGE_NAME}@latest'`
3722
3730
  );
3723
- } else if (verify.installedVersion !== "0.10.3") {
3731
+ } else if (verify.installedVersion !== "0.10.4") {
3724
3732
  console.log(
3725
- ` \u2192 This process is still running ${"0.10.3"}. Next invocation will use ${verify.installedVersion}.`
3733
+ ` \u2192 This process is still running ${"0.10.4"}. Next invocation will use ${verify.installedVersion}.`
3726
3734
  );
3727
3735
  }
3728
3736
  }
@@ -3757,14 +3765,14 @@ async function getUpdateAvailability() {
3757
3765
  if (isDevMode()) return null;
3758
3766
  const latest = await fetchLatestVersion();
3759
3767
  if (latest === null) return {
3760
- current: "0.10.3",
3768
+ current: "0.10.4",
3761
3769
  latest: null,
3762
3770
  updateAvailable: false
3763
3771
  };
3764
3772
  return {
3765
- current: "0.10.3",
3773
+ current: "0.10.4",
3766
3774
  latest,
3767
- updateAvailable: shouldUpdate("0.10.3", latest)
3775
+ updateAvailable: shouldUpdate("0.10.4", latest)
3768
3776
  };
3769
3777
  }
3770
3778
  async function checkForUpdate() {
@@ -3854,7 +3862,7 @@ async function restartServices(state) {
3854
3862
  }
3855
3863
  async function forceUpdate() {
3856
3864
  const latest = await fetchLatestVersion();
3857
- const current = "0.10.3";
3865
+ const current = "0.10.4";
3858
3866
  if (latest === null) {
3859
3867
  console.error("Could not reach npm registry. Check your network.");
3860
3868
  process.exit(1);
@@ -9949,8 +9957,9 @@ exec ${shellEscape(claudeBin)} \\
9949
9957
  const timeoutMs = args2.timeoutMs ?? 12e4;
9950
9958
  let lastReportedKb = -1;
9951
9959
  let lastEmittedLength = 0;
9960
+ let transcriptPath;
9952
9961
  try {
9953
- const transcriptPath = await discoverTranscript(cwd, existingBefore, startMs, timeoutMs, args2.signal);
9962
+ transcriptPath = await discoverTranscript(cwd, existingBefore, startMs, timeoutMs, args2.signal);
9954
9963
  while (Date.now() - startMs < timeoutMs) {
9955
9964
  if (args2.signal?.aborted)
9956
9965
  throw new TmuxRunError("aborted");
@@ -9983,7 +9992,7 @@ exec ${shellEscape(claudeBin)} \\
9983
9992
  throw new TmuxRunError(`timeout after ${timeoutMs}ms waiting for assistant turn`);
9984
9993
  } finally {
9985
9994
  args2.signal?.removeEventListener("abort", onAbort);
9986
- cleanup(cwd, runId, tmuxBin, sessionName);
9995
+ cleanup(cwd, runId, tmuxBin, sessionName, transcriptPath);
9987
9996
  }
9988
9997
  }
9989
9998
  function num(v) {
@@ -10122,12 +10131,18 @@ function parseTranscript2(path5, defaultModel) {
10122
10131
  }
10123
10132
  return { assembled, inputTokens, outputTokens, modelUsed, done };
10124
10133
  }
10125
- function cleanup(cwd, runId, tmuxBin, sessionName) {
10134
+ function cleanup(cwd, runId, tmuxBin, sessionName, transcriptPath) {
10126
10135
  try {
10127
10136
  spawnSync2(tmuxBin, ["kill-session", "-t", sessionName], { stdio: "ignore" });
10128
10137
  } catch {
10129
10138
  }
10130
10139
  if (process.env.FLEETLENS_TMUX_KEEP_WRAPPER !== "1") {
10140
+ if (transcriptPath) {
10141
+ try {
10142
+ unlinkSync2(transcriptPath);
10143
+ } catch {
10144
+ }
10145
+ }
10131
10146
  for (const f of [`system-${runId}.txt`, `user-${runId}.txt`, `run-${runId}.sh`]) {
10132
10147
  try {
10133
10148
  unlinkSync2(join7(cwd, f));
@@ -15846,7 +15861,7 @@ async function main() {
15846
15861
  case "version":
15847
15862
  case "--version":
15848
15863
  case "-v":
15849
- console.log(`fleetlens ${"0.10.3"}`);
15864
+ console.log(`fleetlens ${"0.10.4"}`);
15850
15865
  break;
15851
15866
  case "help":
15852
15867
  case "--help":
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "fleetlens",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "fleetlens — local-only dashboard and usage tracker for Claude Code sessions and agent fleets",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/cowcow02/fleetlens.git",
9
+ "directory": "packages/cli"
10
+ },
6
11
  "type": "module",
7
12
  "bin": {
8
13
  "fleetlens": "./dist/index.js"
@@ -1,14 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return o}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});function i(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,s(e));else t.set(n,s(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},18967,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={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 s},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 r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>o.test(e);function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}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 n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&p(n))return r;if(!r)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}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,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},69198,e=>{"use strict";var t=e.i(18050);e.i(74472);var n=e.i(33815);e.s(["AgentBadge",0,function({agent:e}){if(!e||"claude-code"===e)return null;let r=(0,n.getAgentMetadata)(e);return r?(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:r.accentColor,background:`color-mix(in srgb, ${r.accentColor} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${r.accentColor} 30%, transparent)`},title:`Source: ${r.displayName}`,children:r.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,n,r,a=Date.now()){return t(100*Math.max(0,Math.min(1,(a-(n-r))/r))-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 n=(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,n],41240);let r=(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,r],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*$/,n=/^###\s+(.+?)\s*$/,r=/^[-*]\s+(.+?)\s*$/,a=function(e){let a=e.split(/\r?\n/),i=[],s=null,o=null,l=[];function c(){o&&l.length>0&&(o.bullets.push(l.join(" ").trim()),l=[])}for(let e of a){let a=t.exec(e);if(a){c(),o=null,s={version:a[1].trim(),date:a[2]?.trim()??null,sections:[]},i.push(s);continue}if(!s)continue;let d=n.exec(e);if(d){c(),o={kind:d[1].trim(),bullets:[]},s.sections.push(o);continue}let u=r.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.3] — 2026-05-16\n\n### Added\n- **Daemon auto-update every 6 hours.** The local daemon now hourly-checks `registry.npmjs.org/fleetlens/latest` and spawns a detached `fleetlens update` child when a newer version exists. Timestamp persisted in `~/.cclens/daemon-update.json` so closing the laptop lid for days and reopening triggers an immediate catch-up check instead of waiting out the interval. Opt-out via `FLEETLENS_DAEMON_AUTO_UPDATE=0`.\n\n### Changed\n- **Unified team sync.** `runTeamSync` now drives history backfill, daily activity, live utilization, queue drain, and tier propagation through a single path. `team join` and the daemon\'s 5-min tick both call the same function — so a user disconnected from the team server for days will autonomously catch up on next sync, no manual `team backfill` needed.\n- New `lastSyncedUsageSnapshotAt` high-water mark in `~/.cclens/team.json` means incremental syncs only ship eligible new snapshots. Cold-start full backfill is bypass-able via `fleetlens team backfill --force` (and still runs unconditionally on first pair).\n- Team sync cadence is now independent of Claude OAuth polling, so an expired Claude token can no longer turn team sync into a 5-second retry storm.\n\n### Fixed\n- `lastSyncedDay` no longer advances past a failed day on partial outage — previously a transient mid-stream 5xx left a permanent hole in the team-server\'s daily-activity coverage.\n- Both `/api/ingest/metrics` and `/api/ingest/usage-history` POSTs now have a 15-second `AbortSignal.timeout` to bound hangs on network stalls.\n\n## [0.10.2] — 2026-05-15\n\n### Fixed\n- **Session-detail minimap no longer paints subagent runtime as idle.** Long agent runs that dispatched many subagents were reading as wall-to-wall "Session idle" stripes because the parent\'s tool_use → tool_result gap (the subagent\'s actual runtime) was classified as in-turn idle. `rawIdleBands` now carves subagent run spans out of every candidate gap; for in-turn gaps that overlap any subagent run the entire gap is dropped, and between-turn gaps with background subagent activity keep only the genuinely-unwatched residue.\n- **First-response thinking stops registering as idle.** Anchors now include every timestamped event (agent-thinking, meta, etc.), and the loop tracks an "awaiting first response" phase across intermediate thinking anchors. A `user → thinking → thinking → agent` sequence where the model takes a while to compose its first reply is now treated as response latency rather than painted as a stripe.\n- **Turn duration no longer shows `0ms` for single-row turns.** `buildMegaRows` now anchors a turn\'s `tOffsetMs` and `durationMs` at the originating user message rather than at the first agent row. Single-row turns show the actual user → agent latency, and the visual span of the turn rectangle on the minimap covers the whole arc.\n- **Single `Session idle` divider per band.** A user row and the turn-collapsed row that follows it now share a `tOffsetMs`, so the body\'s `IdleDivider` emitter dedupes per band to stop two consecutive identical idle markers around the same boundary.\n\n### Changed\n- Minimap idle threshold raised from 10s to 30s. Ordinary tool latency (slow Bash, big-file Read, between-anchor model thinking) no longer registers as idle.\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,n){let[r,a]=(0,t.useState)(n),[i,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{try{let t=window.localStorage.getItem(e);"1"===t?a(!0):"0"===t&&a(!1)}catch{}s(!0)},[e]),(0,t.useEffect)(()=>{let t=t=>{let n=t.detail;n?.key===e&&"boolean"==typeof n.value&&a(n.value)},n=t=>{t.key===e&&("1"===t.newValue?a(!0):"0"===t.newValue&&a(!1))};return window.addEventListener("cclens:persistent-boolean",t),window.addEventListener("storage",n),()=>{window.removeEventListener("cclens:persistent-boolean",t),window.removeEventListener("storage",n)}},[e]),[r,(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,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,r=e.protocol||"",a=e.pathname||"",o=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let d=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||s.test(r))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),d&&"?"!==d[0]&&(d="?"+d),a=a.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${r}${c}${a}${d}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return a}});let r=e.r(71645);function a(e,t){let n=(0,r.useRef)(null),a=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=i(e,r)),t&&(a.current=i(t,r))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return i}});let r=e.r(18967),a=e.r(52817);function i(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},84508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return y},useLinkStatus:function(){return b}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=e.r(90809),s=e.r(18050),o=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 n,r;let a,i,y,[b,v]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),w=(0,o.useRef)(null),{href:k,as:j,children:S,prefetch:C=null,passHref:M,replace:T,shallow:$,scroll:z,onClick:P,onMouseEnter:E,onTouchStart:A,legacyBehavior:O=!1,onNavigate:L,transitionTypes:R,ref:I,unstable_dynamicOnHover:N,..._}=t;a=S,O&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let D=o.default.useContext(c.AppRouterContext),W=!1!==C,F=!1!==C?null===(r=C)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,U="string"==typeof(n=j||k)?n:(0,l.formatUrl)(n);if(O){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=o.default.Children.only(a)}let B=O?i&&"object"==typeof i&&i.ref:I,H=o.default.useCallback(e=>(null!==D&&(w.current=(0,f.mountLinkInstance)(e,U,D,F,W,v)),()=>{w.current&&((0,f.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,f.unmountPrefetchableInstance)(e)}),[W,U,D,F,v]),q={ref:(0,d.useMergedRef)(H,B),onClick(t){O||"function"!=typeof P||P(t),O&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!D||t.defaultPrevented||function(t,n,r,a,i,s,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)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);o.default.startTransition(()=>{u(n,a?"replace":"push",!1===i?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,l)})}}(t,U,w,T,z,L,R)},onMouseEnter(e){O||"function"!=typeof E||E(e),O&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),D&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){O||"function"!=typeof A||A(e),O&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),D&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,u.isAbsoluteUrl)(U)?q.href=U:O&&!M&&("a"!==i.type||"href"in i.props)||(q.href=(0,p.addBasePath)(U)),y=O?o.default.cloneElement(i,q):(0,s.jsx)("a",{..._,...q,children:a}),(0,s.jsx)(x.Provider,{value:b,children:y})}e.r(84508);let x=(0,o.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,o.useContext)(x);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},75254,e=>{"use strict";var t=e.i(71645);let n=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var r={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:s,className:o="",children:l,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...r,width:a,height:a,stroke:e,strokeWidth:s?24*Number(i)/Number(a):i,className:n("lucide",o),...d},[...c.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,r)=>{let i=(0,t.forwardRef)(({className:i,...s},o)=>(0,t.createElement)(a,{ref:o,iconNode:r,className:n(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,i),...s}));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:"✺"}],n=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&&n.has(e)}],33815),e.s([],74472)},23614,41783,e=>{"use strict";var t=e.i(18050),n=e.i(22016);e.i(74472);var r=e.i(33815);function a({agent:e,size:n=11,title:i}){if(!e)return null;let s=(0,r.getAgentMetadata)(e);return s?(0,t.jsx)("span",{"aria-hidden":!0,title:i??s.displayName,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n+2,height:n+2,fontSize:n,lineHeight:1,color:s.accentColor},children:s.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:"—"}},s={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}},o={shipped:6,partial:5,blocked:4,exploratory:3,trivial:2,idle:1};e.s(["OUTCOME_STYLES",0,i,"OutcomePill",0,function(e){let r=s[e.size??"md"],o=r.fontSize+1;if("pending"in e&&e.pending){let i={display:"inline-flex",alignItems:"center",gap:r.iconGap,padding:r.padding,borderRadius:r.borderRadius,fontSize:r.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)(n.default,{href:`/digest/${e.localDay}`,style:i,title:`Generate ${e.localDay} digest →`,children:[e.agent&&(0,t.jsx)(a,{agent:e.agent,size:o}),(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:r.iconGap,padding:r.padding,borderRadius:r.borderRadius,fontSize:r.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:o}),("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?o[e]:0}],23614)},18566,(e,t,n)=>{t.exports=e.r(76562)},56324,e=>{"use strict";let t={input:1,output:5,cacheRead:.1,cacheWrite:1.25},n={input:3,output:15,cacheRead:.3,cacheWrite:3.75},r={input:5,output:25,cacheRead:.5,cacheWrite:6.25};e.s(["estimateCost",0,function(e,a){let i=function(e){if(!e)return r;let a=e.toLowerCase();return a.includes("haiku")?t:a.includes("sonnet")?n:r}(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 n=Math.floor(t/60),r=t%60;if(n<60)return r?`${n}m ${r}s`:`${n}m`;let a=Math.floor(n/60),i=n%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 n=Math.floor(t/60);if(n<60){let e=Math.round(t%60);return`${n}m ${e}s`}let r=Math.floor(n/60),a=n%60;if(r<24)return a?`${r}h ${a}m`:`${r}h`;let i=Math.floor(r/24),s=r%24;return s?`${i}d ${s}h`:`${i}d`},"formatOffset",0,function(e){if(void 0===e||e<0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=String(Math.floor(t%3600/60)).padStart(2,"0"),a=String(t%60).padStart(2,"0");return`${n}:${r}:${a}`},"formatRelative",0,function(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.round((Date.now()-t)/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let a=Math.round(r/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 n=e.split("/").filter(Boolean),r=n.lastIndexOf(".worktrees");if(r>0&&r<n.length-1){let e=n[r-1],a=n[r+1],i=`${e}/${a}`;return i.length<=t?i:"…"+i.slice(i.length-t+1)}let a=n.length>=2?`${n[n.length-2]}/${n[n.length-1]}`:n[n.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),n=e.i(22016);let r={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,s=void 0!==e.agentName;return i||s?i&&a?(0,t.jsx)(n.default,{href:`/sessions/${e.id}`,style:{...r,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:{...r,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:{...r,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),n=e.i(22016),r=e.i(18566),a=e.i(71645),i=e.i(75254);let s=(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"}]]),o=(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,n]=(0,a.useState)("dark"),[r,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=document.documentElement.getAttribute("data-theme");if("light"===e||"dark"===e)n(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");n(e),k(e)}i(!0)},[]),(0,t.jsx)("button",{type:"button",onClick:()=>{let t="dark"===e?"light":"dark";n(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:r?"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 r,a,[i,,s]=(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 o=[{label:"5h",window:e.five_hour,windowMs:18e6},{label:"7d",window:e.seven_day,windowMs:6048e5}];return s&&i&&o.push({label:"Sonnet 7d",window:e.seven_day_sonnet,windowMs:6048e5}),(0,t.jsxs)(n.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:(r=new Date(e.captured_at).getTime(),(a=Math.round((Date.now()-r)/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:o.map(e=>(0,t.jsx)(T,{...e},e.label))})]})}function T({label:e,window:n,windowMs:r}){let a=n?.utilization??null,i=null!==a,s=i?Math.max(0,Math.min(100,a)):0,o=n?.resets_at?new Date(n.resets_at).getTime():null,l=i&&o?(0,C.toneVar)((0,C.paceToneForCycle)(s,o,r)):"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}),n?.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,n=Math.round((new Date(e).getTime()-Date.now())/1e3),r=Math.abs(n);if(r<60)t=`${r}s`;else if(r<3600)t=`${Math.floor(r/60)}m`;else if(r<86400){let e=Math.floor(r/3600),n=Math.floor(r%3600/60);t=n>0?`${e}h${n}m`:`${e}h`}else{let e=Math.floor(r/86400),n=Math.floor(r%86400/3600);t=n>0?`${e}d${n}h`:`${e}d`}return n<0?`${t} ago`:`in ${t}`}(n.resets_at)]}),(0,t.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:i?`${s.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?`${s}%`:"0%",background:l,borderRadius:999,transition:"width 0.24s ease"}})})]})}let $=(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:r}){let[i,s]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!e)return void s(!1);try{let t=window.localStorage.getItem(z.STORAGE_KEY);s(t!==e)}catch{s(!1)}},[e]),(0,t.jsxs)(n.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:r?"var(--af-text)":"var(--af-text-tertiary)",background:r?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,t.jsx)($,{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 A({href:e,active:r,icon:a,trailing:i,children:s}){return(0,t.jsxs)(n.default,{href:e,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:r?"var(--af-accent)":"var(--af-text-secondary)",background:r?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[a,(0,t.jsx)("span",{style:{flex:1},children:s}),i&&(0,t.jsx)("span",{style:{fontSize:10,color:r?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})}function O({label:e,items:r,pathname:a,isPinned:i,onTogglePin:s}){return 0===r.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:r.map(e=>{let r=`/projects/${encodeURIComponent(e.projectDir)}`,o=a===r,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:o?"var(--af-accent-subtle)":"transparent",color:o?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,t.jsxs)(n.default,{href:r,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(),s(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,r.usePathname)(),[v,w]=(0,a.useState)(new Set),[k,S]=(0,a.useState)(!1),[C,T]=(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 $=e=>{w(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{window.localStorage.setItem(E,JSON.stringify(Array.from(n)))}catch{}return n})},z=(0,a.useMemo)(()=>{if(!C.trim())return e;let t=C.toLowerCase();return e.filter(e=>e.projectName.toLowerCase().includes(t))},[e,C]),L=z.filter(e=>v.has(e.projectDir)),R=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)(A,{href:"/",active:"/"===b,icon:(0,t.jsx)(s,{size:15}),children:"Overview"}),(0,t.jsx)(A,{href:"/sessions",active:"/sessions"===b||b.startsWith("/sessions/"),icon:(0,t.jsx)(o,{size:15}),trailing:i>0?String(i):void 0,children:"All sessions"}),(0,t.jsx)(A,{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)(A,{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)(A,{href:"/usage",active:"/usage"===b,icon:(0,t.jsx)(h,{size:15}),children:"Usage"}),(0,t.jsx)(A,{href:"/insights",active:"/insights"===b,icon:(0,t.jsx)(f.Lightbulb,{size:15}),children:"Insights"}),(0,t.jsx)(A,{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=>T(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&&L.length>0&&(0,t.jsx)(O,{label:"Pinned",items:L,pathname:b,isPinned:e=>v.has(e),onTogglePin:$}),(0,t.jsx)(O,{label:"Projects",items:R,pathname:b,isPinned:e=>v.has(e),onTogglePin:$})]}),(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)(n.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),n=e.i(71645);e.s(["LiveRefresher",0,function(){let e,r=(0,t.useRouter)(),a=(e=(0,t.usePathname)(),e?.includes("/insights/print/")??!1),i=(0,n.useRef)(null),s=(0,n.useRef)({session:0,usage:0});return!function(e,t={}){let{enabled:r=!0}=t,a=(0,n.useRef)(e);(0,n.useEffect)(()=>{a.current=e},[e]),(0,n.useEffect)(()=>{if(!r)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()}},[r])}((0,n.useCallback)(e=>{let t="usage-updated"===e.type?"usage":"session";e.mtimeMs<=(s.current[t]??0)||(s.current[t]=e.mtimeMs,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.refresh()},400))},[r]),{enabled:!a}),(0,n.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),null}],51878)},23884,e=>{"use strict";var t=e.i(18050),n=e.i(71645),r=e.i(18566),a=e.i(22016),i=e.i(56324),s=e.i(56004),o=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,r.usePathname)(),[p,h]=(0,n.useState)(()=>Date.now()),[f,g]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{try{let e=localStorage.getItem(c);null!==e&&g("true"===e)}catch{}},[]),(0,n.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 n=e.firstTimestamp?Date.parse(e.firstTimestamp):0;return(t.firstTimestamp?Date.parse(t.firstTimestamp):0)-n});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 n=e(t);try{localStorage.setItem(c,String(n))}catch{}return n})},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 n=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:[n&&(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginBottom:4},children:n.outcome?(0,t.jsx)(l.OutcomePill,{outcome:n.outcome,size:"sm",label:"text",agent:e.agent}):"skipped_trivial"!==n.enrichmentStatus?(0,t.jsx)(l.OutcomePill,{outcome:null,pending:!0,sessionId:e.id,localDay:n.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)(s.TeamBadge,{session:e,linkable:!1}),(0,t.jsx)(o.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),n=e.i(71645),r=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),s=e.i(3116),o=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 n="running"===e.status?i.Loader2:"queued"===e.status?s.Clock:"error"===e.status?a:r.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?o.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)(n,{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,r]=(0,n.useState)([]),[a,s]=(0,n.useState)(!1);(0,n.useEffect)(()=>{try{let e=localStorage.getItem(l);null!==e&&s("true"===e)}catch{}},[]),(0,n.useEffect)(()=>{let e=!0,t=null,n=!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;r(a.jobs),n=a.jobs.some(e=>"running"===e.status||"queued"===e.status)}catch{}},i=()=>{e&&(t=setTimeout(async()=>{await a(),i()},n?1500:6e3))};return a().then(i),()=>{e=!1,t&&clearTimeout(t)}},[]);let o=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===o.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 s(t=>{let n=e(t);try{localStorage.setItem(l,String(n))}catch{}return n})},title:`${o.length} job${1===o.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 · ",o.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:[o.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c,{children:"Running"}),o.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)}]);