fleetlens 0.12.1 → 0.12.2

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/print/[key]/page_client-reference-manifest.js +1 -1
  22. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  23. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  24. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  25. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  27. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  28. package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
  29. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  30. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  31. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
  32. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
  33. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  34. package/app/apps/web/.next/server/middleware-manifest.json +5 -5
  35. package/app/apps/web/.next/server/pages/500.html +1 -1
  36. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  37. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  38. package/app/apps/web/.next/static/chunks/0a~ro-n30brjy.js +1 -0
  39. package/app/apps/web/app/projects/[slug]/page.tsx +3 -4
  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 +3 -3
  44. package/dist/index.js +81 -48
  45. package/package.json +1 -1
  46. package/app/apps/web/.next/static/chunks/03_7wmpodz36t.js +0 -1
  47. /package/app/apps/web/.next/static/{rrY-ephAArv8tjJOXD622 → NVjCMw2mlLqMATkilYzT7}/_buildManifest.js +0 -0
  48. /package/app/apps/web/.next/static/{rrY-ephAArv8tjJOXD622 → NVjCMw2mlLqMATkilYzT7}/_clientMiddlewareManifest.js +0 -0
  49. /package/app/apps/web/.next/static/{rrY-ephAArv8tjJOXD622 → NVjCMw2mlLqMATkilYzT7}/_ssgManifest.js +0 -0
@@ -15146,14 +15146,14 @@ async function getUpdateAvailability() {
15146
15146
  if (isDevMode()) return null;
15147
15147
  const latest = await fetchLatestVersion();
15148
15148
  if (latest === null) return {
15149
- current: "0.12.1",
15149
+ current: "0.12.2",
15150
15150
  latest: null,
15151
15151
  updateAvailable: false
15152
15152
  };
15153
15153
  return {
15154
- current: "0.12.1",
15154
+ current: "0.12.2",
15155
15155
  latest,
15156
- updateAvailable: shouldUpdate("0.12.1", latest)
15156
+ updateAvailable: shouldUpdate("0.12.2", latest)
15157
15157
  };
15158
15158
  }
15159
15159
 
package/dist/index.js CHANGED
@@ -12,19 +12,27 @@ var __export = (target, all) => {
12
12
  // src/pid.ts
13
13
  import { readFileSync, writeFileSync, mkdirSync, unlinkSync } from "node:fs";
14
14
  import { dirname } from "node:path";
15
- function writePid(filePath, pid, port) {
15
+ function writePid(filePath, pid, port, version) {
16
16
  mkdirSync(dirname(filePath), { recursive: true });
17
- const content = port != null ? `${pid}:${port}` : String(pid);
17
+ let content = String(pid);
18
+ if (port != null) {
19
+ content += `:${port}`;
20
+ if (version) content += `:${version}`;
21
+ }
18
22
  writeFileSync(filePath, content, "utf8");
19
23
  }
20
24
  function readPid(filePath) {
21
25
  try {
22
26
  const content = readFileSync(filePath, "utf8").trim();
23
- const [pidStr, portStr] = content.split(":");
27
+ const [pidStr, portStr, versionStr] = content.split(":");
24
28
  const pid = parseInt(pidStr, 10);
25
29
  if (Number.isNaN(pid)) return null;
26
30
  const port = portStr ? parseInt(portStr, 10) : void 0;
27
- return { pid, port: Number.isNaN(port) ? void 0 : port };
31
+ return {
32
+ pid,
33
+ port: Number.isNaN(port) ? void 0 : port,
34
+ version: versionStr || void 0
35
+ };
28
36
  } catch {
29
37
  return null;
30
38
  }
@@ -4468,7 +4476,9 @@ var init_fs = __esm({
4468
4476
  // src/server.ts
4469
4477
  var server_exports = {};
4470
4478
  __export(server_exports, {
4479
+ ensureCurrentServer: () => ensureCurrentServer,
4471
4480
  getServerStatus: () => getServerStatus,
4481
+ isServerStale: () => isServerStale,
4472
4482
  openBrowser: () => openBrowser,
4473
4483
  startServer: () => startServer,
4474
4484
  stopServer: () => stopServer
@@ -4486,10 +4496,29 @@ function getServerStatus() {
4486
4496
  cleanStalePid(PID_FILE);
4487
4497
  const entry = readPid(PID_FILE);
4488
4498
  if (entry !== null && isProcessAlive(entry.pid)) {
4489
- return { running: true, pid: entry.pid, port: entry.port ?? DEFAULT_PORT };
4499
+ return { running: true, pid: entry.pid, port: entry.port ?? DEFAULT_PORT, version: entry.version };
4490
4500
  }
4491
4501
  return { running: false };
4492
4502
  }
4503
+ function isServerStale(status2) {
4504
+ return status2.running === true && status2.version !== "0.12.2";
4505
+ }
4506
+ async function ensureCurrentServer(opts = {}) {
4507
+ const status2 = getServerStatus();
4508
+ if (status2.running && !isServerStale(status2)) {
4509
+ return { pid: status2.pid, port: status2.port, restarted: false };
4510
+ }
4511
+ let previousVersion;
4512
+ let port = opts.port;
4513
+ if (status2.running) {
4514
+ previousVersion = status2.version;
4515
+ port = port ?? status2.port;
4516
+ stopServer();
4517
+ await waitForPortFree(port, 5e3);
4518
+ }
4519
+ const result = await startServer({ port });
4520
+ return { ...result, restarted: status2.running, previousVersion };
4521
+ }
4493
4522
  async function startServer(opts = {}) {
4494
4523
  const port = opts.port ?? (parseInt(process.env.CCLENS_PORT ?? "", 10) || DEFAULT_PORT);
4495
4524
  const serverJs = join2(appDir(), "server.js");
@@ -4515,7 +4544,7 @@ async function startServer(opts = {}) {
4515
4544
  });
4516
4545
  child.unref();
4517
4546
  const pid = child.pid;
4518
- writePid(PID_FILE, pid, port);
4547
+ writePid(PID_FILE, pid, port, "0.12.2");
4519
4548
  await waitForHealth(`http://localhost:${port}`, 1e4);
4520
4549
  return { pid, port };
4521
4550
  }
@@ -4543,6 +4572,13 @@ async function checkPort(port) {
4543
4572
  server.listen(port, "localhost");
4544
4573
  });
4545
4574
  }
4575
+ async function waitForPortFree(port, timeoutMs) {
4576
+ const start2 = Date.now();
4577
+ while (Date.now() - start2 < timeoutMs) {
4578
+ if (!await checkPort(port)) return;
4579
+ await new Promise((r) => setTimeout(r, 200));
4580
+ }
4581
+ }
4546
4582
  async function waitForHealth(url, timeoutMs) {
4547
4583
  const start2 = Date.now();
4548
4584
  while (Date.now() - start2 < timeoutMs) {
@@ -4868,9 +4904,9 @@ Installed: ${PACKAGE_NAME}@${verify.installedVersion} at ${verify.installedPath
4868
4904
  console.warn(
4869
4905
  ` \u2022 reinstall in the correct Node env: 'npm install -g ${PACKAGE_NAME}@latest'`
4870
4906
  );
4871
- } else if (verify.installedVersion !== "0.12.1") {
4907
+ } else if (verify.installedVersion !== "0.12.2") {
4872
4908
  console.log(
4873
- ` \u2192 This process is still running ${"0.12.1"}. Next invocation will use ${verify.installedVersion}.`
4909
+ ` \u2192 This process is still running ${"0.12.2"}. Next invocation will use ${verify.installedVersion}.`
4874
4910
  );
4875
4911
  }
4876
4912
  }
@@ -4905,14 +4941,14 @@ async function getUpdateAvailability() {
4905
4941
  if (isDevMode()) return null;
4906
4942
  const latest = await fetchLatestVersion();
4907
4943
  if (latest === null) return {
4908
- current: "0.12.1",
4944
+ current: "0.12.2",
4909
4945
  latest: null,
4910
4946
  updateAvailable: false
4911
4947
  };
4912
4948
  return {
4913
- current: "0.12.1",
4949
+ current: "0.12.2",
4914
4950
  latest,
4915
- updateAvailable: shouldUpdate("0.12.1", latest)
4951
+ updateAvailable: shouldUpdate("0.12.2", latest)
4916
4952
  };
4917
4953
  }
4918
4954
  async function checkForUpdate() {
@@ -5002,7 +5038,7 @@ async function restartServices(state) {
5002
5038
  }
5003
5039
  async function forceUpdate() {
5004
5040
  const latest = await fetchLatestVersion();
5005
- const current = "0.12.1";
5041
+ const current = "0.12.2";
5006
5042
  if (latest === null) {
5007
5043
  console.error("Could not reach npm registry. Check your network.");
5008
5044
  process.exit(1);
@@ -5053,24 +5089,23 @@ async function start(args2) {
5053
5089
  await checkForUpdate();
5054
5090
  } catch {
5055
5091
  }
5056
- const status2 = getServerStatus();
5057
5092
  let serverUrl;
5058
5093
  let serverPid;
5059
- if (status2.running) {
5060
- serverUrl = `http://localhost:${status2.port}`;
5061
- serverPid = status2.pid;
5062
- console.log(`Server: already running on ${serverUrl} (PID ${serverPid})`);
5063
- } else {
5094
+ try {
5064
5095
  console.log("Starting Fleetlens...");
5065
- try {
5066
- const result = await startServer({ port });
5067
- serverUrl = `http://localhost:${result.port}`;
5068
- serverPid = result.pid;
5069
- console.log(`Server: started on ${serverUrl} (PID ${serverPid})`);
5070
- } catch (err) {
5071
- console.error(`Failed to start server: ${err.message}`);
5072
- process.exit(1);
5096
+ const result = await ensureCurrentServer({ port });
5097
+ serverUrl = `http://localhost:${result.port}`;
5098
+ serverPid = result.pid;
5099
+ if (result.restarted) {
5100
+ console.log(
5101
+ `Server: restarted on ${serverUrl} (PID ${serverPid}) \u2014 replaced stale ${result.previousVersion ?? "unknown"} server`
5102
+ );
5103
+ } else {
5104
+ console.log(`Server: running on ${serverUrl} (PID ${serverPid})`);
5073
5105
  }
5106
+ } catch (err) {
5107
+ console.error(`Failed to start server: ${err.message}`);
5108
+ process.exit(1);
5074
5109
  }
5075
5110
  if (!noDaemon) {
5076
5111
  const daemon2 = startDaemonSilent();
@@ -5143,7 +5178,13 @@ async function status() {
5143
5178
  const server = getServerStatus();
5144
5179
  if (server.running) {
5145
5180
  const url = `http://localhost:${server.port}`;
5146
- console.log(`Server: running on ${url} (PID ${server.pid})`);
5181
+ const ver = server.version ?? "unknown";
5182
+ console.log(`Server: running on ${url} (PID ${server.pid}, v${ver})`);
5183
+ if (isServerStale(server)) {
5184
+ console.log(
5185
+ ` \u26A0 serving stale ${ver} (CLI is ${"0.12.2"}) \u2014 run 'fleetlens start' to restart on the current version`
5186
+ );
5187
+ }
5147
5188
  } else {
5148
5189
  console.log("Server: not running");
5149
5190
  }
@@ -5181,31 +5222,23 @@ async function web(args2) {
5181
5222
  const positional = args2.filter((a) => !a.startsWith("--"));
5182
5223
  const rawPath = positional[0] ?? "";
5183
5224
  const path7 = rawPath.startsWith("/") ? rawPath : rawPath ? `/${rawPath}` : "";
5184
- const status2 = getServerStatus();
5185
- if (status2.running) {
5186
- const url = `http://localhost:${status2.port}${path7}`;
5187
- if (open) {
5188
- console.log(`Opening ${url}`);
5189
- openBrowser(url);
5190
- } else {
5191
- console.log(`Dashboard ready at ${url} (re-run with --open to launch it automatically).`);
5192
- }
5193
- return;
5194
- }
5195
- console.log("fleetlens is not running. Starting server...");
5225
+ let result;
5196
5226
  try {
5197
- const result = await startServer({});
5198
- const url = `http://localhost:${result.port}${path7}`;
5199
- console.log(`fleetlens running on ${url} (PID ${result.pid})`);
5200
- if (open) {
5201
- openBrowser(url);
5202
- } else {
5203
- console.log(`Open ${url} in your browser, or re-run with --open to launch it automatically.`);
5204
- }
5227
+ result = await ensureCurrentServer({});
5205
5228
  } catch (err) {
5206
5229
  console.error(`Failed to start: ${err.message}`);
5207
5230
  process.exit(1);
5208
5231
  }
5232
+ const url = `http://localhost:${result.port}${path7}`;
5233
+ if (result.restarted) {
5234
+ console.log(`fleetlens restarted on http://localhost:${result.port} (PID ${result.pid}) \u2014 replaced stale ${result.previousVersion ?? "unknown"} server`);
5235
+ }
5236
+ if (open) {
5237
+ console.log(`Opening ${url}`);
5238
+ openBrowser(url);
5239
+ } else {
5240
+ console.log(`Dashboard ready at ${url} (re-run with --open to launch it automatically).`);
5241
+ }
5209
5242
  }
5210
5243
  var init_web = __esm({
5211
5244
  "src/commands/web.ts"() {
@@ -17626,7 +17659,7 @@ async function main() {
17626
17659
  case "version":
17627
17660
  case "--version":
17628
17661
  case "-v":
17629
- console.log(`fleetlens ${"0.12.1"}`);
17662
+ console.log(`fleetlens ${"0.12.2"}`);
17630
17663
  break;
17631
17664
  case "help":
17632
17665
  case "--help":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetlens",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "fleetlens — local-only dashboard and usage tracker for Claude Code sessions and agent fleets",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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 a=(0,n.getAgentMetadata)(e);return a?(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:a.accentColor,background:`color-mix(in srgb, ${a.accentColor} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${a.accentColor} 30%, transparent)`},title:`Source: ${a.displayName}`,children:a.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,a,r=Date.now()){return t(100*Math.max(0,Math.min(1,(r-(n-a))/a))-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 a=(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,a],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*$/,a=/^[-*]\s+(.+?)\s*$/,r=function(e){let r=e.split(/\r?\n/),s=[],o=null,i=null,l=[];function d(){i&&l.length>0&&(i.bullets.push(l.join(" ").trim()),l=[])}for(let e of r){let r=t.exec(e);if(r){d(),i=null,o={version:r[1].trim(),date:r[2]?.trim()??null,sections:[]},s.push(o);continue}if(!o)continue;let c=n.exec(e);if(c){d(),i={kind:c[1].trim(),bullets:[]},o.sections.push(i);continue}let u=a.exec(e);if(u){d(),l=[u[1]];continue}l.length>0&&e.trim().length>0&&l.push(e.trim())}return d(),s}('# 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.12.1] — 2026-06-15\n\n### Fixed\n- **Per-day metrics for cross-midnight sessions.** A session that ran past midnight had its agent time split across calendar days but its tokens, tool calls, turns, and session count pinned to the start day — so on the dashboard (and team rollups) the continuation days showed agent time with 0 tokens / 0 sessions. Each tool call, turn, and token is now attributed to the day its own event happened, and a session counts on every local day it worked. The split is sum-preserving (totals are unchanged) and keeps `sum(per-day tokens) === session total` even across subagents that run past midnight.\n\n### Changed\n- **Team push carries a `unique_sessions` count.** Because the per-day `sessions` figure is now "session-days" (a cross-midnight session counts on each day it touched), the daemon also pushes the start-day count so the team-server\'s roster/header/maturity aggregates keep exact unique-session semantics. Requires team-server ≥ 0.12.3; older servers ignore the extra field.\n\n## [0.12.0] — 2026-06-15\n\n### Added\n- **Dynamic workflow visualization.** A single `Workflow` tool call collapses a whole fan-out — 200+ spawned agents — into one opaque transcript row. Fleetlens now reads the aggregate journals Claude Code persists per run and surfaces the real fleet work:\n - **Workflows tab** on the session page (next to Transcript / Team / Debug) with a run-count badge. Each run is a card showing status, spawned-agent count, tool calls, tokens, and duration.\n - **Fleet stat** in the session header (`N workflows · M agents`) plus a spawned-agent badge on session-list cards, so workflow-driven sessions stand out at a glance.\n - **Per-phase action tabs** inside each run — the phases the workflow declared (e.g. Build / Panel / Skeptic / Merge), each listing the agents that ran in that phase.\n - **Full per-agent step log.** Clicking an agent opens a right side-sheet with its Task, the complete ordered step list (every tool call — expand any step for the full multi-line command), and the Result. Loaded on demand so even 100+ step, 200+ agent sessions stay fast; sections are collapsed by default.\n - **Workflow lanes** on the timeline minimap (distinct from subagent lanes); click a lane to open that run in the Workflows tab.\n- **Workflow execution counts as agent time.** A run\'s wall-clock span is folded into the session\'s "agent time" and carved out of the minimap idle bands, so the stretch where the parent waits on a workflow reads as active fleet work, not dead air.\n\n## [0.11.2] — 2026-05-27\n\n### Changed\n- **`fleetlens start` and `fleetlens web` no longer auto-launch the browser.** The dashboard URL is printed so you can click it (every modern terminal makes `http://localhost:…` clickable), but no browser tab opens unless you pass the new `--open` flag. Auto-launch was surprising users whose default browser had moved to a different desktop, was a corp-managed profile they didn\'t want spawned, or was simply already in flow on another window. The previous `--no-open` flag is still accepted as a no-op — existing scripts and aliases keep working without changes.\n\n## [0.11.1] — 2026-05-21\n\n### Added\n- **Team workspace seeding script.** Added `scripts/seed-team-workspace.mjs` for local end-to-end telemetry testing.\n\n### Changed\n- **Plan page layout grid consistency.** Enhanced the Team Edition Plan page layout grid consistency and renamed the \'Latest cycle\' column to \'Current cycle\'.\n- **Completed cycles alignment.** Modified the completed cycles strip to show a maximum of 4 historical cycles, padded on the left with empty placeholders for visual right-alignment and grid uniformity.\n\n### Fixed\n- **Mini-burndown SVG typings and filtering.** Resolved mini-burndown SVG typings and parameterized cycle strip filtering.\n- **Active cycle query performance.** Batched active cycle loads in a single query to eliminate N+1 DB lookups.\n\n## [0.11.0] — 2026-05-21\n\n### Added\n- **Team-issued commands to the daemon.** When you\'ve paired with a Team Edition server, a team admin can now queue a 30-day activity backfill against your daemon from the team dashboard. The daemon picks the command up on its next 5-minute sync and re-pushes the last 30 days of daily activity rollups (server upserts, fully idempotent). No member-side UI changes — the existing "last sync N ago" tick on `/settings → Team connection` is the only feedback signal. Commands ride piggyback on the existing `/api/ingest/metrics` response; no new connections, no new polling. The privacy boundary holds: the dispatcher\'s switch has a single case (`backfill-activity`) and only calls existing aggregate-push helpers, so commands can widen the time window but never change the data shape. No transcripts, prompts, or project content can leak through a command. Always-on when paired (pairing implies consent); no opt-out env var. Requires `team-server v0.9.0+` to actually receive any commands; older servers simply don\'t issue any (the additive `commandResults` field is ignored, no harm).\n\n## [0.10.6] — 2026-05-21\n\n### Added\n- **Team-pairing visibility in the Personal Edition dashboard.** When you\'ve paired with a Team Edition server (`fleetlens team join …`), the dashboard now surfaces what\'s syncing without you having to open a terminal. A sidebar chip with a health dot (green / amber / red — re-derived client-side every 30 s so it ages correctly even when the daemon stops) and a live-aging "synced N ago" label. A `/settings → Team connection` panel showing team metadata, a labeled last-push preview (Agent time / Session count / Tool call count / Turn count / Token total / Plan tier), an explicit "What does NOT leave your machine" block, and a "Sync now" button that spawns `fleetlens team sync` as a subprocess and renders its output inline. A first-run welcome banner on the overview after pairing, dismissable per pairing. The preview also includes a "Show raw JSON payload" disclosure that displays the literal `IngestPayload` from disk — verify byte-for-byte that no transcripts, prompts, or project content leave your machine. Solo users see no change.\n\n### Changed\n- **Wire-format types now live in `@claude-lens/parser`.** `IngestPayload`, `DailyRollup`, `LastPushRecord`, and the rest of the daemon→server wire shape moved out of `packages/cli/src/team/push.ts` so the CLI and the dashboard share a single canonical definition — no drift risk on future schema changes. The CLI\'s `team-config` module also moved to the parser (`@claude-lens/parser/fs`) for the same reason.\n\n## [0.10.5] — 2026-05-21\n\n### Changed\n- **Team backfill now rides the consolidated `/api/ingest/metrics` path.** Same endpoint as the daemon\'s regular 5-min push, just with the optional `snapshotHistory` field set. Removes the need for a separate path-allowlist entry on deployments fronted by a proxy (IAP, WAF, Cloud Run / GLB path matcher), and as a side-effect the old `/api/ingest/usage-history` route is now a thin deprecation shim. Requires `team-server v0.8.4+` — older servers will return 200 without a `snapshotHistory` result block, and the CLI aborts the backfill loudly rather than silently advancing the high-water mark.\n\n### Fixed\n- **Backfill no longer silently advances the high-water mark on an older team-server.** Previously, a server that didn\'t recognize `snapshotHistory` would return 200 (zod `passthrough()` swallows unknown fields), `runTeamSync` would persist `lastSyncedUsageSnapshotAt` as if all rows landed, and the dropped rows would never be retried after the server upgraded. Backfill now requires an explicit `snapshotHistory` result block in the response.\n\n## [0.10.4] — 2026-05-21\n\n### Fixed\n- **Fleetlens\'s own LLM runs no longer show up in the dashboard.** The tmux-driven runner records its enrichment / digest / `/ask` calls as real Claude Code transcripts under `~/.claude/projects/` (cwd `~/.cclens/runtime`), since tailing that transcript is how it reads the model\'s reply. Those self-generated sessions were surfacing as a `.cclens/runtime` project and inflating session, project, and token-calibration rollups. The tmux runner now deletes each transcript once the response is captured (kill-session before unlink so claude can\'t rewrite it, gated by `FLEETLENS_TMUX_KEEP_WRAPPER`), and the parser excludes the runtime project dir at the scan chokepoint as a safety net for any transcript that outlives cleanup.\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.7.0] — 2026-05-06\n\n### Added\n- **Multi-agent observability — Codex as the first non-Claude adapter.** The parser now defines an `AgentSource` registry; new agents land as a single file plus one registry entry. Codex CLI rollouts at `~/.codex/sessions/` flow through the same pipeline as Claude Code: their sessions appear in the dashboard, timeline, calendar, and per-project rollups alongside Claude sessions, with `agent: "codex"` carried through every event so consumers can split or aggregate.\n- **Per-agent representation in the UI.** Each session row carries an agent badge; top-sessions guarantees a multi-agent representation when both agents are active; the Gantt rail uses a per-agent glyph and outcome pills.\n- **Usage page is now agent-tabbed.** Switch between Claude and Codex views; cross-agent comparisons stay readable rather than smashed onto a single chart.\n- **Codex sessions blend into the day + week digest narratives** so the insights pipeline summarises across agents instead of treating Codex as a footnote.\n- **`fleetlens` → "Ask"** (agent-neutral). Previously labelled "Ask Claude"; the underlying prompt-routing stays Claude-backed, but the surface name no longer implies single-agent.\n\n### Changed\n- Dashboard default time range moved to **90 d** to match how multi-agent fleets actually use the tool — week-only views were truncating Codex activity that lands in week-old session files.\n- `AgentSource` interface opened up so future agents (OpenCode, Gemini CLI, …) are pure additive plug-ins; no parser core changes required.\n- Daemon auto-backfills *yesterday\'s* day digest on boot when `ai_features.auto_backfill_yesterday` is on, so `--no-daemon` users still get a yesterday digest on first homepage visit.\n\n### Fixed\n- **Codex calibration math no longer pollutes the Claude window.** Non-Claude snapshots are excluded from the Claude-side cycle-peaks calibration that drives plan-fit advice — previously a Codex-heavy run skewed the projected exhaustion line.\n- **Minimap idle bands** are now derived from raw event timestamps (not row kind) and coalesced per turn, so Codex sessions with sub-minute back-and-forth no longer paint as wall-to-wall idle.\n- Sessions filter state preserved in the URL so refresh / share doesn\'t lose the active filter.\n- `/insights` persists forced current-week digests so the page actually shows them on next load.\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');r[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[a,r]=(0,t.useState)(n),[s,o]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{try{let t=window.localStorage.getItem(e);"1"===t?r(!0):"0"===t&&r(!1)}catch{}o(!0)},[e]),(0,t.useEffect)(()=>{let t=t=>{let n=t.detail;n?.key===e&&"boolean"==typeof n.value&&r(n.value)},n=t=>{t.key===e&&("1"===t.newValue?r(!0):"0"===t.newValue&&r(!1))};return window.addEventListener("cclens:persistent-boolean",t),window.addEventListener("storage",n),()=>{window.removeEventListener("cclens:persistent-boolean",t),window.removeEventListener("storage",n)}},[e]),[a,(0,t.useCallback)(t=>{r(t);try{window.localStorage.setItem(e,t?"1":"0")}catch{}window.dispatchEvent(new CustomEvent("cclens:persistent-boolean",{detail:{key:e,value:t}}))},[e]),s]}])},18566,(e,t,n)=>{t.exports=e.r(76562)},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={assign:function(){return l},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return i}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});function s(e){let t={};for(let[n,a]of e.entries()){let e=t[n];void 0===e?t[n]=a:Array.isArray(e)?e.push(a):t[n]=[e,a]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[n,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(n,o(e));else t.set(n,o(a));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,a]of n.entries())e.append(t,a)}return e}},18967,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return v},NormalizeError:function(){return w},PageNotFoundError:function(){return b},SP:function(){return f},ST:function(){return m},WEB_VITALS:function(){return s},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,n=!1;return(...a)=>(n||(n=!0,t=e(...a)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function d(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(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 g(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(n&&h(n))return a;if(!a)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return a}let f="u">typeof performance,m=f&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class w 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 k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(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 a}});let a=e=>{}},95057,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={formatUrl:function(){return i},formatWithValidation:function(){return d},urlObjectKeys:function(){return l}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,a=e.protocol||"",r=e.pathname||"",i=e.hash||"",l=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:n&&(d=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(d+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==d?(d="//"+(d||""),r&&"/"!==r[0]&&(r="/"+r)):d||(d=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),r=r.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${a}${d}${r}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return i(e)}},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return r}});let a=e.r(71645);function r(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=n.current;e&&(n.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(n.current=s(e,a)),t&&(r.current=s(t,a))},[e,t])}function s(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 s}});let a=e.r(18967),r=e.r(52817);function s(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,r.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 a}});let a=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={default:function(){return y},useLinkStatus:function(){return b}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=e.r(90809),o=e.r(18050),i=s._(e.r(71645)),l=e.r(95057),d=e.r(8372),c=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),g=e.r(91949),f=e.r(73668),m=e.r(9396);function y(t){var n,a;let r,s,y,[b,v]=(0,i.useOptimistic)(g.IDLE_LINK_STATUS),k=(0,i.useRef)(null),{href:x,as:C,children:S,prefetch:T=null,passHref:j,replace:A,shallow:E,scroll:L,onClick:P,onMouseEnter:M,onTouchStart:$,legacyBehavior:N=!1,onNavigate:O,transitionTypes:_,ref:R,unstable_dynamicOnHover:I,...F}=t;r=S,N&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let z=i.default.useContext(d.AppRouterContext),D=!1!==T,U=!1!==T?null===(a=T)||"auto"===a?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,W="string"==typeof(n=C||x)?n:(0,l.formatUrl)(n);if(N){if(r?.$$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});s=i.default.Children.only(r)}let B=N?s&&"object"==typeof s&&s.ref:R,G=i.default.useCallback(e=>(null!==z&&(k.current=(0,g.mountLinkInstance)(e,W,z,U,D,v)),()=>{k.current&&((0,g.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,g.unmountPrefetchableInstance)(e)}),[D,W,z,U,v]),q={ref:(0,c.useMergedRef)(G,B),onClick(t){N||"function"!=typeof P||P(t),N&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!z||t.defaultPrevented||function(t,n,a,r,s,o,l){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,f.isLocalURL)(n)){r&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);i.default.startTransition(()=>{u(n,r?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,a.current,l)})}}(t,W,k,A,L,O,_)},onMouseEnter(e){N||"function"!=typeof M||M(e),N&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),z&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){N||"function"!=typeof $||$(e),N&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),z&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,u.isAbsoluteUrl)(W)?q.href=W:N&&!j&&("a"!==s.type||"href"in s.props)||(q.href=(0,h.addBasePath)(W)),y=N?i.default.cloneElement(s,q):(0,o.jsx)("a",{...F,...q,children:r}),(0,o.jsx)(w.Provider,{value:b,children:y})}e.r(84508);let w=(0,i.createContext)(g.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(w);("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 a={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 r=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:i="",children:l,iconNode:d,...c},u)=>(0,t.createElement)("svg",{ref:u,...a,width:r,height:r,stroke:e,strokeWidth:o?24*Number(s)/Number(r):s,className:n("lucide",i),...c},[...d.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,a)=>{let s=(0,t.forwardRef)(({className:s,...o},i)=>(0,t.createElement)(r,{ref:i,iconNode:a,className:n(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,s),...o}));return s.displayName=`${e}`,s}],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:"✺"},{kind:"antigravity",displayName:"Antigravity",shortLabel:"Agy",accentColor:"rgb(236, 72, 153)",iconChar:"⏃"},{kind:"cowork",displayName:"Cowork",shortLabel:"Cowork",accentColor:"rgb(217, 119, 87)",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 a=e.i(33815);function r({agent:e,size:n=11,title:s}){if(!e)return null;let o=(0,a.getAgentMetadata)(e);return o?(0,t.jsx)("span",{"aria-hidden":!0,title:s??o.displayName,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n+2,height:n+2,fontSize:n,lineHeight:1,color:o.accentColor},children:o.iconChar}):null}e.s(["AgentIcon",0,r],41783);let s={shipped:{bg:"rgba(72, 187, 120, 0.12)",fg:"#48bb78",label:"Shipped",icon:"🚀"},partial:{bg:"rgba(66, 153, 225, 0.12)",fg:"#4299e1",label:"Partial",icon:"🔨"},blocked:{bg:"rgba(245, 101, 101, 0.12)",fg:"#f56565",label:"Blocked",icon:"🚧"},exploratory:{bg:"rgba(160, 174, 192, 0.12)",fg:"#a0aec0",label:"Exploratory",icon:"🧭"},trivial:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Warmup",icon:"💤"},idle:{bg:"rgba(203, 213, 224, 0.12)",fg:"#a0aec0",label:"Idle",icon:"—"}},o={sm:{fontSize:9,padding:"1px 6px",iconGap:3,borderRadius:99},md:{fontSize:10,padding:"2px 8px",iconGap:4,borderRadius:99},lg:{fontSize:11,padding:"3px 10px",iconGap:5,borderRadius:99}},i={shipped:6,partial:5,blocked:4,exploratory:3,trivial:2,idle:1};e.s(["OUTCOME_STYLES",0,s,"OutcomePill",0,function(e){let a=o[e.size??"md"],i=a.fontSize+1;if("pending"in e&&e.pending){let s={display:"inline-flex",alignItems:"center",gap:a.iconGap,padding:a.padding,borderRadius:a.borderRadius,fontSize:a.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:s,title:`Generate ${e.localDay} digest →`,children:[e.agent&&(0,t.jsx)(r,{agent:e.agent,size:i}),(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:"⋯"}),(0,t.jsx)("span",{children:"pending"})]})}let l=s[e.outcome],d=e.label??"both",c={display:"inline-flex",alignItems:"center",gap:a.iconGap,padding:a.padding,borderRadius:a.borderRadius,fontSize:a.fontSize,fontWeight:600,background:l.bg,color:l.fg,whiteSpace:"nowrap"};return(0,t.jsxs)("span",{style:c,title:l.label,children:[e.agent&&(0,t.jsx)(r,{agent:e.agent,size:i}),("icon"===d||"both"===d)&&(0,t.jsx)("span",{"aria-hidden":!0,style:{lineHeight:1},children:l.icon}),("text"===d||"both"===d)&&(0,t.jsx)("span",{children:l.label})]})},"outcomePriority",0,function(e){return e?i[e]:0}],23614)},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},a={input:5,output:25,cacheRead:.5,cacheWrite:6.25};e.s(["estimateCost",0,function(e,r){let s=function(e){if(!e)return a;let r=e.toLowerCase();return r.includes("haiku")?t:r.includes("sonnet")?n:a}(r);return e.input/1e6*s.input+e.output/1e6*s.output+e.cacheRead/1e6*s.cacheRead+e.cacheWrite/1e6*s.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),a=t%60;if(n<60)return a?`${n}m ${a}s`:`${n}m`;let r=Math.floor(n/60),s=n%60;return s?`${r}h ${s}m`:`${r}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 a=Math.floor(n/60),r=n%60;if(a<24)return r?`${a}h ${r}m`:`${a}h`;let s=Math.floor(a/24),o=a%24;return o?`${s}d ${o}h`:`${s}d`},"formatOffset",0,function(e){if(void 0===e||e<0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/3600),a=String(Math.floor(t%3600/60)).padStart(2,"0"),r=String(t%60).padStart(2,"0");return`${n}:${a}:${r}`},"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 a=Math.round(n/60);if(a<60)return`${a}m ago`;let r=Math.round(a/60);if(r<24)return`${r}h ago`;let s=Math.round(r/24);return`${s}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),a=n.lastIndexOf(".worktrees");if(a>0&&a<n.length-1){let e=n[a-1],r=n[a+1],s=`${e}/${r}`;return s.length<=t?s:"…"+s.slice(s.length-t+1)}let r=n.length>=2?`${n[n.length-2]}/${n[n.length-1]}`:n[n.length-1]??e;return r.length<=t?r:"…"+r.slice(r.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 a={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:r=!0}){if(!e.teamName)return null;let s=!0===e.isTeamLead,o=void 0!==e.agentName;return s||o?s&&r?(0,t.jsx)(n.default,{href:`/sessions/${e.id}`,style:{...a,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"}):s?(0,t.jsx)("span",{style:{...a,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:{...a,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}])}]);