fleetlens 0.6.3 → 0.6.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 (25) 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/chunks/packages_parser_dist_fs_0bc7ptm.js +1 -1
  12. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  13. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0-jvt~a._.js +1 -1
  14. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  15. package/app/apps/web/.next/server/pages/500.html +1 -1
  16. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  17. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  18. package/app/apps/web/package.json +1 -1
  19. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  20. package/dist/daemon-worker.js +27 -9
  21. package/dist/index.js +32 -14
  22. package/package.json +1 -1
  23. /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → 2jcMG-92q2XKei8dN7BMd}/_buildManifest.js +0 -0
  24. /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → 2jcMG-92q2XKei8dN7BMd}/_clientMiddlewareManifest.js +0 -0
  25. /package/app/apps/web/.next/static/{YT0fi8TIPXu7nZyww-N2v → 2jcMG-92q2XKei8dN7BMd}/_ssgManifest.js +0 -0
@@ -1777,16 +1777,22 @@ async function readJsonlFile(filePath) {
1777
1777
  return out;
1778
1778
  }
1779
1779
  function cacheStats() {
1780
- return { metaEntries: metaCache.size, detailEntries: detailCache.size };
1780
+ return {
1781
+ metaEntries: metaCache.size,
1782
+ detailEntries: detailCache.size,
1783
+ calibrationEventsEntries: calibrationEventsCache.size
1784
+ };
1781
1785
  }
1782
1786
  function clearCaches() {
1783
1787
  metaCache.clear();
1784
1788
  detailCache.clear();
1789
+ calibrationEventsCache.clear();
1785
1790
  fileListCache = null;
1786
1791
  }
1787
1792
  function invalidateFile(fullPath) {
1788
1793
  metaCache.delete(fullPath);
1789
1794
  detailCache.delete(fullPath);
1795
+ calibrationEventsCache.delete(fullPath);
1790
1796
  fileListCache = null;
1791
1797
  }
1792
1798
  async function walkJsonlFiles(root = DEFAULT_ROOT) {
@@ -2271,14 +2277,18 @@ async function loadUsageByDay(start, end) {
2271
2277
  }
2272
2278
  async function loadCalibrationEvents(root = DEFAULT_ROOT) {
2273
2279
  const files = await walkJsonlFiles(root);
2274
- const byId = /* @__PURE__ */ new Map();
2275
- for (const f of files) {
2280
+ const perFile = await Promise.all(files.map(async (f) => {
2281
+ const cached = calibrationEventsCache.get(f.fullPath);
2282
+ if (cached && cached.mtimeMs === f.mtimeMs && cached.sizeBytes === f.sizeBytes) {
2283
+ return cached.events;
2284
+ }
2276
2285
  let lines;
2277
2286
  try {
2278
2287
  lines = await readJsonlFile(f.fullPath);
2279
2288
  } catch {
2280
- continue;
2289
+ return [];
2281
2290
  }
2291
+ const byId = /* @__PURE__ */ new Map();
2282
2292
  for (const raw of lines) {
2283
2293
  if (!raw || typeof raw !== "object")
2284
2294
  continue;
@@ -2310,10 +2320,17 @@ async function loadCalibrationEvents(root = DEFAULT_ROOT) {
2310
2320
  cache_5m: toNum(cc.ephemeral_5m_input_tokens)
2311
2321
  });
2312
2322
  }
2313
- }
2314
- const events = Array.from(byId.values());
2315
- events.sort((a, b) => a.ts.localeCompare(b.ts));
2316
- return events;
2323
+ const events = Array.from(byId.values());
2324
+ calibrationEventsCache.set(f.fullPath, {
2325
+ events,
2326
+ mtimeMs: f.mtimeMs,
2327
+ sizeBytes: f.sizeBytes
2328
+ });
2329
+ return events;
2330
+ }));
2331
+ const out = perFile.flat();
2332
+ out.sort((a, b) => a.ts.localeCompare(b.ts));
2333
+ return out;
2317
2334
  }
2318
2335
  async function loadCalibrationSnapshots() {
2319
2336
  let raw;
@@ -2473,7 +2490,7 @@ async function loadCalibrationCurve(tier = "pro-max-20x", root = DEFAULT_ROOT, g
2473
2490
  ]);
2474
2491
  return buildCalibrationCurve(events, snapshots, tier, granularityMin);
2475
2492
  }
2476
- var DEFAULT_ROOT, metaCache, detailCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, USAGE_LOG;
2493
+ var DEFAULT_ROOT, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, USAGE_LOG;
2477
2494
  var init_fs = __esm({
2478
2495
  "../parser/dist/fs.js"() {
2479
2496
  "use strict";
@@ -2484,6 +2501,7 @@ var init_fs = __esm({
2484
2501
  DEFAULT_ROOT = path.join(os.homedir(), ".claude", "projects");
2485
2502
  metaCache = /* @__PURE__ */ new Map();
2486
2503
  detailCache = /* @__PURE__ */ new Map();
2504
+ calibrationEventsCache = /* @__PURE__ */ new Map();
2487
2505
  fileListCache = null;
2488
2506
  FILE_LIST_TTL_MS = 1e3;
2489
2507
  BLANK_USAGE3 = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
package/dist/index.js CHANGED
@@ -454,9 +454,9 @@ Installed: ${PACKAGE_NAME}@${verify.installedVersion} at ${verify.installedPath
454
454
  console.warn(
455
455
  ` \u2022 reinstall in the correct Node env: 'npm install -g ${PACKAGE_NAME}@latest'`
456
456
  );
457
- } else if (verify.installedVersion !== "0.6.3") {
457
+ } else if (verify.installedVersion !== "0.6.4") {
458
458
  console.log(
459
- ` \u2192 This process is still running ${"0.6.3"}. Next invocation will use ${verify.installedVersion}.`
459
+ ` \u2192 This process is still running ${"0.6.4"}. Next invocation will use ${verify.installedVersion}.`
460
460
  );
461
461
  }
462
462
  }
@@ -492,7 +492,7 @@ async function checkForUpdate() {
492
492
  if (process.env.__FLEETLENS_UPDATED === "1" || process.env.__CCLENS_UPDATED === "1") return;
493
493
  const latest = await fetchLatestVersion();
494
494
  if (latest === null) return;
495
- const current = "0.6.3";
495
+ const current = "0.6.4";
496
496
  if (!shouldUpdate(current, latest)) return;
497
497
  console.log(`Updating ${PACKAGE_NAME} ${current} \u2192 ${latest}...`);
498
498
  await stopRunningServices();
@@ -574,7 +574,7 @@ async function restartServices(state) {
574
574
  }
575
575
  async function forceUpdate() {
576
576
  const latest = await fetchLatestVersion();
577
- const current = "0.6.3";
577
+ const current = "0.6.4";
578
578
  if (latest === null) {
579
579
  console.error("Could not reach npm registry. Check your network.");
580
580
  process.exit(1);
@@ -2338,16 +2338,22 @@ async function readJsonlFile(filePath) {
2338
2338
  return out;
2339
2339
  }
2340
2340
  function cacheStats() {
2341
- return { metaEntries: metaCache.size, detailEntries: detailCache.size };
2341
+ return {
2342
+ metaEntries: metaCache.size,
2343
+ detailEntries: detailCache.size,
2344
+ calibrationEventsEntries: calibrationEventsCache.size
2345
+ };
2342
2346
  }
2343
2347
  function clearCaches() {
2344
2348
  metaCache.clear();
2345
2349
  detailCache.clear();
2350
+ calibrationEventsCache.clear();
2346
2351
  fileListCache = null;
2347
2352
  }
2348
2353
  function invalidateFile(fullPath) {
2349
2354
  metaCache.delete(fullPath);
2350
2355
  detailCache.delete(fullPath);
2356
+ calibrationEventsCache.delete(fullPath);
2351
2357
  fileListCache = null;
2352
2358
  }
2353
2359
  async function walkJsonlFiles(root = DEFAULT_ROOT) {
@@ -2832,14 +2838,18 @@ async function loadUsageByDay(start2, end) {
2832
2838
  }
2833
2839
  async function loadCalibrationEvents(root = DEFAULT_ROOT) {
2834
2840
  const files = await walkJsonlFiles(root);
2835
- const byId = /* @__PURE__ */ new Map();
2836
- for (const f of files) {
2841
+ const perFile = await Promise.all(files.map(async (f) => {
2842
+ const cached = calibrationEventsCache.get(f.fullPath);
2843
+ if (cached && cached.mtimeMs === f.mtimeMs && cached.sizeBytes === f.sizeBytes) {
2844
+ return cached.events;
2845
+ }
2837
2846
  let lines;
2838
2847
  try {
2839
2848
  lines = await readJsonlFile(f.fullPath);
2840
2849
  } catch {
2841
- continue;
2850
+ return [];
2842
2851
  }
2852
+ const byId = /* @__PURE__ */ new Map();
2843
2853
  for (const raw of lines) {
2844
2854
  if (!raw || typeof raw !== "object")
2845
2855
  continue;
@@ -2871,10 +2881,17 @@ async function loadCalibrationEvents(root = DEFAULT_ROOT) {
2871
2881
  cache_5m: toNum(cc.ephemeral_5m_input_tokens)
2872
2882
  });
2873
2883
  }
2874
- }
2875
- const events = Array.from(byId.values());
2876
- events.sort((a, b) => a.ts.localeCompare(b.ts));
2877
- return events;
2884
+ const events = Array.from(byId.values());
2885
+ calibrationEventsCache.set(f.fullPath, {
2886
+ events,
2887
+ mtimeMs: f.mtimeMs,
2888
+ sizeBytes: f.sizeBytes
2889
+ });
2890
+ return events;
2891
+ }));
2892
+ const out = perFile.flat();
2893
+ out.sort((a, b) => a.ts.localeCompare(b.ts));
2894
+ return out;
2878
2895
  }
2879
2896
  async function loadCalibrationSnapshots() {
2880
2897
  let raw;
@@ -3034,7 +3051,7 @@ async function loadCalibrationCurve(tier = "pro-max-20x", root = DEFAULT_ROOT, g
3034
3051
  ]);
3035
3052
  return buildCalibrationCurve(events, snapshots, tier, granularityMin);
3036
3053
  }
3037
- var DEFAULT_ROOT, metaCache, detailCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, USAGE_LOG2;
3054
+ var DEFAULT_ROOT, metaCache, detailCache, calibrationEventsCache, fileListCache, FILE_LIST_TTL_MS, BLANK_USAGE3, USAGE_LOG2;
3038
3055
  var init_fs = __esm({
3039
3056
  "../parser/dist/fs.js"() {
3040
3057
  "use strict";
@@ -3045,6 +3062,7 @@ var init_fs = __esm({
3045
3062
  DEFAULT_ROOT = path.join(os.homedir(), ".claude", "projects");
3046
3063
  metaCache = /* @__PURE__ */ new Map();
3047
3064
  detailCache = /* @__PURE__ */ new Map();
3065
+ calibrationEventsCache = /* @__PURE__ */ new Map();
3048
3066
  fileListCache = null;
3049
3067
  FILE_LIST_TTL_MS = 1e3;
3050
3068
  BLANK_USAGE3 = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
@@ -14048,7 +14066,7 @@ async function main() {
14048
14066
  case "version":
14049
14067
  case "--version":
14050
14068
  case "-v":
14051
- console.log(`fleetlens ${"0.6.3"}`);
14069
+ console.log(`fleetlens ${"0.6.4"}`);
14052
14070
  break;
14053
14071
  case "help":
14054
14072
  case "--help":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetlens",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "fleetlens — local-only dashboard and usage tracker for Claude Code sessions and agent fleets",
5
5
  "license": "MIT",
6
6
  "type": "module",