fleetlens 0.6.2 → 0.6.3

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 (53) 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.js.nft.json +1 -1
  12. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  13. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  14. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  15. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  16. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  17. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  19. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  20. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  22. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  23. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  24. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  26. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  27. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  30. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  32. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  34. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  35. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  36. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +10 -10
  37. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-1_njm._.js +1 -1
  38. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  39. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
  40. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  41. package/app/apps/web/.next/server/pages/500.html +1 -1
  42. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  43. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  44. package/app/apps/web/app/insights/page.tsx +5 -3
  45. package/app/apps/web/package.json +1 -1
  46. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  47. package/dist/daemon-worker.js +55 -39
  48. package/dist/index.js +75 -93
  49. package/package.json +1 -1
  50. package/app/apps/web/lib/auto-week-fire.ts +0 -1
  51. /package/app/apps/web/.next/static/{MLK3PKEm3q_E_QuKH5kOz → YT0fi8TIPXu7nZyww-N2v}/_buildManifest.js +0 -0
  52. /package/app/apps/web/.next/static/{MLK3PKEm3q_E_QuKH5kOz → YT0fi8TIPXu7nZyww-N2v}/_clientMiddlewareManifest.js +0 -0
  53. /package/app/apps/web/.next/static/{MLK3PKEm3q_E_QuKH5kOz → YT0fi8TIPXu7nZyww-N2v}/_ssgManifest.js +0 -0
@@ -2492,9 +2492,9 @@ var init_fs = __esm({
2492
2492
  });
2493
2493
 
2494
2494
  // src/daemon-worker.ts
2495
- import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync12 } from "node:fs";
2496
- import { dirname as dirname10, join as join14 } from "node:path";
2497
- import { homedir as homedir14 } from "node:os";
2495
+ import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync11 } from "node:fs";
2496
+ import { dirname as dirname9, join as join13 } from "node:path";
2497
+ import { homedir as homedir13 } from "node:os";
2498
2498
 
2499
2499
  // src/usage/token.ts
2500
2500
  import { execFileSync } from "node:child_process";
@@ -8635,22 +8635,66 @@ import { writeFileSync as writeFileSync8, unlinkSync as unlinkSync2, existsSync
8635
8635
  import { join as join11 } from "node:path";
8636
8636
  import { homedir as homedir11 } from "node:os";
8637
8637
  var STALE_MS2 = 60 * 1e3;
8638
+ var HEARTBEAT_MS = 30 * 1e3;
8638
8639
  var lockPathCached = null;
8640
+ var heartbeat = null;
8639
8641
  function lockPath() {
8640
8642
  if (lockPathCached)
8641
8643
  return lockPathCached;
8642
8644
  lockPathCached = join11(homedir11(), ".cclens", "llm-interactive.lock");
8643
8645
  return lockPathCached;
8644
8646
  }
8645
- function writeInteractiveLock() {
8647
+ function touchLock() {
8646
8648
  writeFileSync8(lockPath(), String(process.pid), "utf8");
8647
8649
  }
8650
+ function writeInteractiveLock() {
8651
+ touchLock();
8652
+ if (heartbeat)
8653
+ clearInterval(heartbeat);
8654
+ heartbeat = setInterval(() => {
8655
+ try {
8656
+ touchLock();
8657
+ } catch {
8658
+ }
8659
+ }, HEARTBEAT_MS);
8660
+ heartbeat.unref?.();
8661
+ }
8648
8662
  function removeInteractiveLock() {
8663
+ if (heartbeat) {
8664
+ clearInterval(heartbeat);
8665
+ heartbeat = null;
8666
+ }
8649
8667
  try {
8650
8668
  unlinkSync2(lockPath());
8651
8669
  } catch {
8652
8670
  }
8653
8671
  }
8672
+ function pidAlive(pid) {
8673
+ try {
8674
+ process.kill(pid, 0);
8675
+ return true;
8676
+ } catch {
8677
+ return false;
8678
+ }
8679
+ }
8680
+ function interactiveLockFresh(nowMs) {
8681
+ const p = lockPath();
8682
+ if (!existsSync8(p))
8683
+ return false;
8684
+ try {
8685
+ const mtime = statSync3(p).mtimeMs;
8686
+ if (nowMs - mtime > STALE_MS2)
8687
+ return false;
8688
+ const pid = Number(readFileSync11(p, "utf8").trim());
8689
+ if (!Number.isFinite(pid) || pid <= 0)
8690
+ return false;
8691
+ if (!pidAlive(pid))
8692
+ return false;
8693
+ return true;
8694
+ } catch {
8695
+ return false;
8696
+ }
8697
+ }
8654
8698
 
8655
8699
  // ../entries/dist/queue.js
8656
8700
  var THIRTY_MIN_MS = 30 * 60 * 1e3;
@@ -11240,34 +11284,6 @@ async function* runWeekDigestPipeline(monday, opts) {
11240
11284
  }
11241
11285
  }
11242
11286
 
11243
- // ../entries/dist/auto-week-fire.js
11244
- import { existsSync as existsSync10, readFileSync as readFileSync13, mkdirSync as mkdirSync11, renameSync as renameSync5, writeFileSync as writeFileSync10 } from "node:fs";
11245
- import { join as join13, dirname as dirname9 } from "node:path";
11246
- import { homedir as homedir13 } from "node:os";
11247
- function autoFireFile() {
11248
- return process.env.CCLENS_AUTO_WEEK_FILE ?? join13(homedir13(), ".cclens", "auto-week-fired-at");
11249
- }
11250
- var MONDAY_RE = /^\d{4}-\d{2}-\d{2}$/;
11251
- function shouldAutoFireWeek(monday) {
11252
- const file = autoFireFile();
11253
- let prev = null;
11254
- if (existsSync10(file)) {
11255
- try {
11256
- const raw = readFileSync13(file, "utf8").trim();
11257
- if (MONDAY_RE.test(raw))
11258
- prev = raw;
11259
- } catch {
11260
- }
11261
- }
11262
- if (prev === monday)
11263
- return false;
11264
- mkdirSync11(dirname9(file), { recursive: true });
11265
- const tmp = `${file}.tmp`;
11266
- writeFileSync10(tmp, monday + "\n", "utf8");
11267
- renameSync5(tmp, file);
11268
- return true;
11269
- }
11270
-
11271
11287
  // src/perception/backfill.ts
11272
11288
  function toLocalDay2(ms) {
11273
11289
  const d = new Date(ms);
@@ -11313,9 +11329,9 @@ async function backfillLastWeekDigest(opts = {}) {
11313
11329
  log3("info", `auto-backfill: skipped (no_entries)`);
11314
11330
  return { fired: false, reason: "no_entries", key: monday };
11315
11331
  }
11316
- if (!shouldAutoFireWeek(monday)) {
11317
- log3("info", `auto-backfill: skipped (already_fired_this_week)`);
11318
- return { fired: false, reason: "already_fired_this_week", key: monday };
11332
+ if (interactiveLockFresh(now)) {
11333
+ log3("info", `auto-backfill: skipped (in_flight)`);
11334
+ return { fired: false, reason: "in_flight", key: monday };
11319
11335
  }
11320
11336
  log3("info", `auto-backfill: fired week-${monday}`);
11321
11337
  try {
@@ -11336,11 +11352,11 @@ async function backfillLastWeekDigest(opts = {}) {
11336
11352
  }
11337
11353
 
11338
11354
  // src/daemon-worker.ts
11339
- var STATE_DIR = join14(homedir14(), ".cclens");
11340
- var USAGE_LOG3 = join14(STATE_DIR, "usage.jsonl");
11341
- var DAEMON_LOG = join14(STATE_DIR, "daemon.log");
11355
+ var STATE_DIR = join13(homedir13(), ".cclens");
11356
+ var USAGE_LOG3 = join13(STATE_DIR, "usage.jsonl");
11357
+ var DAEMON_LOG = join13(STATE_DIR, "daemon.log");
11342
11358
  var WATCHDOG_INTERVAL_MS = 5 * 1e3;
11343
- mkdirSync12(dirname10(USAGE_LOG3), { recursive: true });
11359
+ mkdirSync11(dirname9(USAGE_LOG3), { recursive: true });
11344
11360
  function log2(level, message) {
11345
11361
  const line = `${(/* @__PURE__ */ new Date()).toISOString()} ${level.toUpperCase()} ${message}
11346
11362
  `;
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.2") {
457
+ } else if (verify.installedVersion !== "0.6.3") {
458
458
  console.log(
459
- ` \u2192 This process is still running ${"0.6.2"}. Next invocation will use ${verify.installedVersion}.`
459
+ ` \u2192 This process is still running ${"0.6.3"}. 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.2";
495
+ const current = "0.6.3";
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.2";
577
+ const current = "0.6.3";
578
578
  if (latest === null) {
579
579
  console.error("Could not reach npm registry. Check your network.");
580
580
  process.exit(1);
@@ -8552,10 +8552,26 @@ function lockPath() {
8552
8552
  function __setInteractiveLockPathForTest(path2) {
8553
8553
  lockPathCached = path2;
8554
8554
  }
8555
- function writeInteractiveLock() {
8555
+ function touchLock() {
8556
8556
  writeFileSync5(lockPath(), String(process.pid), "utf8");
8557
8557
  }
8558
+ function writeInteractiveLock() {
8559
+ touchLock();
8560
+ if (heartbeat)
8561
+ clearInterval(heartbeat);
8562
+ heartbeat = setInterval(() => {
8563
+ try {
8564
+ touchLock();
8565
+ } catch {
8566
+ }
8567
+ }, HEARTBEAT_MS);
8568
+ heartbeat.unref?.();
8569
+ }
8558
8570
  function removeInteractiveLock() {
8571
+ if (heartbeat) {
8572
+ clearInterval(heartbeat);
8573
+ heartbeat = null;
8574
+ }
8559
8575
  try {
8560
8576
  unlinkSync2(lockPath());
8561
8577
  } catch {
@@ -8587,12 +8603,14 @@ function interactiveLockFresh(nowMs) {
8587
8603
  return false;
8588
8604
  }
8589
8605
  }
8590
- var STALE_MS, lockPathCached;
8606
+ var STALE_MS, HEARTBEAT_MS, lockPathCached, heartbeat;
8591
8607
  var init_pipeline_lock = __esm({
8592
8608
  "../entries/dist/pipeline-lock.js"() {
8593
8609
  "use strict";
8594
8610
  STALE_MS = 60 * 1e3;
8611
+ HEARTBEAT_MS = 30 * 1e3;
8595
8612
  lockPathCached = null;
8613
+ heartbeat = null;
8596
8614
  }
8597
8615
  });
8598
8616
 
@@ -12297,40 +12315,6 @@ var init_digest_month_pipeline = __esm({
12297
12315
  }
12298
12316
  });
12299
12317
 
12300
- // ../entries/dist/auto-week-fire.js
12301
- import { existsSync as existsSync11, readFileSync as readFileSync11, mkdirSync as mkdirSync8, renameSync as renameSync4, writeFileSync as writeFileSync7 } from "node:fs";
12302
- import { join as join12, dirname as dirname9 } from "node:path";
12303
- import { homedir as homedir11 } from "node:os";
12304
- function autoFireFile() {
12305
- return process.env.CCLENS_AUTO_WEEK_FILE ?? join12(homedir11(), ".cclens", "auto-week-fired-at");
12306
- }
12307
- function shouldAutoFireWeek(monday) {
12308
- const file = autoFireFile();
12309
- let prev = null;
12310
- if (existsSync11(file)) {
12311
- try {
12312
- const raw = readFileSync11(file, "utf8").trim();
12313
- if (MONDAY_RE.test(raw))
12314
- prev = raw;
12315
- } catch {
12316
- }
12317
- }
12318
- if (prev === monday)
12319
- return false;
12320
- mkdirSync8(dirname9(file), { recursive: true });
12321
- const tmp = `${file}.tmp`;
12322
- writeFileSync7(tmp, monday + "\n", "utf8");
12323
- renameSync4(tmp, file);
12324
- return true;
12325
- }
12326
- var MONDAY_RE;
12327
- var init_auto_week_fire = __esm({
12328
- "../entries/dist/auto-week-fire.js"() {
12329
- "use strict";
12330
- MONDAY_RE = /^\d{4}-\d{2}-\d{2}$/;
12331
- }
12332
- });
12333
-
12334
12318
  // ../entries/dist/node.js
12335
12319
  var node_exports = {};
12336
12320
  __export(node_exports, {
@@ -12384,7 +12368,6 @@ __export(node_exports, {
12384
12368
  setCurrentMonthDigestInCache: () => setCurrentMonthDigestInCache,
12385
12369
  setCurrentWeekDigestInCache: () => setCurrentWeekDigestInCache,
12386
12370
  setTodayDigestInCache: () => setTodayDigestInCache,
12387
- shouldAutoFireWeek: () => shouldAutoFireWeek,
12388
12371
  weekDates: () => weekDates,
12389
12372
  writeDayDigest: () => writeDayDigest,
12390
12373
  writeInteractiveLock: () => writeInteractiveLock,
@@ -12410,7 +12393,6 @@ var init_node = __esm({
12410
12393
  init_digest_month();
12411
12394
  init_digest_week_pipeline();
12412
12395
  init_digest_month_pipeline();
12413
- init_auto_week_fire();
12414
12396
  init_digest_fs();
12415
12397
  }
12416
12398
  });
@@ -12882,23 +12864,23 @@ var init_digest = __esm({
12882
12864
  });
12883
12865
 
12884
12866
  // src/team/config.ts
12885
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3, mkdirSync as mkdirSync9 } from "node:fs";
12886
- import { join as join13 } from "node:path";
12887
- import { homedir as homedir12 } from "node:os";
12867
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync as unlinkSync3, mkdirSync as mkdirSync8 } from "node:fs";
12868
+ import { join as join12 } from "node:path";
12869
+ import { homedir as homedir11 } from "node:os";
12888
12870
  function readTeamConfig(dir = DEFAULT_DIR) {
12889
12871
  try {
12890
- return JSON.parse(readFileSync12(join13(dir, CONFIG_FILE), "utf8"));
12872
+ return JSON.parse(readFileSync11(join12(dir, CONFIG_FILE), "utf8"));
12891
12873
  } catch {
12892
12874
  return null;
12893
12875
  }
12894
12876
  }
12895
12877
  function writeTeamConfig(config, dir = DEFAULT_DIR) {
12896
- mkdirSync9(dir, { recursive: true });
12897
- writeFileSync8(join13(dir, CONFIG_FILE), JSON.stringify(config, null, 2), { mode: 384 });
12878
+ mkdirSync8(dir, { recursive: true });
12879
+ writeFileSync7(join12(dir, CONFIG_FILE), JSON.stringify(config, null, 2), { mode: 384 });
12898
12880
  }
12899
12881
  function clearTeamConfig(dir = DEFAULT_DIR) {
12900
12882
  try {
12901
- unlinkSync3(join13(dir, CONFIG_FILE));
12883
+ unlinkSync3(join12(dir, CONFIG_FILE));
12902
12884
  } catch {
12903
12885
  }
12904
12886
  }
@@ -12906,14 +12888,14 @@ var DEFAULT_DIR, CONFIG_FILE;
12906
12888
  var init_config = __esm({
12907
12889
  "src/team/config.ts"() {
12908
12890
  "use strict";
12909
- DEFAULT_DIR = join13(homedir12(), ".cclens");
12891
+ DEFAULT_DIR = join12(homedir11(), ".cclens");
12910
12892
  CONFIG_FILE = "team.json";
12911
12893
  }
12912
12894
  });
12913
12895
 
12914
12896
  // src/usage/profile.ts
12915
- import { existsSync as existsSync12, mkdirSync as mkdirSync10, readFileSync as readFileSync13, writeFileSync as writeFileSync9 } from "node:fs";
12916
- import { dirname as dirname10 } from "node:path";
12897
+ import { existsSync as existsSync11, mkdirSync as mkdirSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync8 } from "node:fs";
12898
+ import { dirname as dirname9 } from "node:path";
12917
12899
  function mapRateLimitTier(rateLimitTier) {
12918
12900
  switch (rateLimitTier) {
12919
12901
  case "default_claude_pro":
@@ -12953,9 +12935,9 @@ async function fetchProfile(nowMs = Date.now()) {
12953
12935
  };
12954
12936
  }
12955
12937
  function readCachedProfile(cachePath) {
12956
- if (!existsSync12(cachePath)) return null;
12938
+ if (!existsSync11(cachePath)) return null;
12957
12939
  try {
12958
- const raw = JSON.parse(readFileSync13(cachePath, "utf8"));
12940
+ const raw = JSON.parse(readFileSync12(cachePath, "utf8"));
12959
12941
  if (typeof raw.fetchedAtMs !== "number" || !raw.profile) return null;
12960
12942
  return raw;
12961
12943
  } catch {
@@ -12963,8 +12945,8 @@ function readCachedProfile(cachePath) {
12963
12945
  }
12964
12946
  }
12965
12947
  function writeCachedProfile(cachePath, profile, nowMs = Date.now()) {
12966
- mkdirSync10(dirname10(cachePath), { recursive: true });
12967
- writeFileSync9(
12948
+ mkdirSync9(dirname9(cachePath), { recursive: true });
12949
+ writeFileSync8(
12968
12950
  cachePath,
12969
12951
  JSON.stringify({ fetchedAtMs: nowMs, profile }, null, 2),
12970
12952
  { mode: 384 }
@@ -12999,8 +12981,8 @@ __export(backfill_exports, {
12999
12981
  chunk: () => chunk,
13000
12982
  runTeamBackfill: () => runTeamBackfill
13001
12983
  });
13002
- import { homedir as homedir13 } from "node:os";
13003
- import { join as join14 } from "node:path";
12984
+ import { homedir as homedir12 } from "node:os";
12985
+ import { join as join13 } from "node:path";
13004
12986
  function rawToWire(raw) {
13005
12987
  const win = (w) => w ? { utilization: w.utilization, resetsAt: w.resets_at } : null;
13006
12988
  return {
@@ -13107,8 +13089,8 @@ var init_backfill = __esm({
13107
13089
  init_storage();
13108
13090
  init_config();
13109
13091
  init_profile();
13110
- USAGE_LOG4 = join14(homedir13(), ".cclens", "usage.jsonl");
13111
- PROFILE_CACHE = join14(homedir13(), ".cclens", "profile.json");
13092
+ USAGE_LOG4 = join13(homedir12(), ".cclens", "usage.jsonl");
13093
+ PROFILE_CACHE = join13(homedir12(), ".cclens", "profile.json");
13112
13094
  BATCH_SIZE = 500;
13113
13095
  noopLog = () => {
13114
13096
  };
@@ -13195,11 +13177,11 @@ var init_push = __esm({
13195
13177
  });
13196
13178
 
13197
13179
  // src/team/queue.ts
13198
- import { readFileSync as readFileSync14, writeFileSync as writeFileSync10, appendFileSync as appendFileSync4, statSync as statSync3, mkdirSync as mkdirSync11 } from "node:fs";
13199
- import { join as join15, dirname as dirname11 } from "node:path";
13200
- import { homedir as homedir14 } from "node:os";
13180
+ import { readFileSync as readFileSync13, writeFileSync as writeFileSync9, appendFileSync as appendFileSync4, statSync as statSync3, mkdirSync as mkdirSync10 } from "node:fs";
13181
+ import { join as join14, dirname as dirname10 } from "node:path";
13182
+ import { homedir as homedir13 } from "node:os";
13201
13183
  function enqueuePayload(payload, queuePath = QUEUE_PATH) {
13202
- mkdirSync11(dirname11(queuePath), { recursive: true });
13184
+ mkdirSync10(dirname10(queuePath), { recursive: true });
13203
13185
  const entry = { payload, enqueuedAt: (/* @__PURE__ */ new Date()).toISOString() };
13204
13186
  appendFileSync4(queuePath, JSON.stringify(entry) + "\n", "utf8");
13205
13187
  try {
@@ -13213,7 +13195,7 @@ function enqueuePayload(payload, queuePath = QUEUE_PATH) {
13213
13195
  function dequeuePayloads(queuePath = QUEUE_PATH) {
13214
13196
  let lines;
13215
13197
  try {
13216
- lines = readFileSync14(queuePath, "utf8").trim().split("\n").filter(Boolean);
13198
+ lines = readFileSync13(queuePath, "utf8").trim().split("\n").filter(Boolean);
13217
13199
  } catch {
13218
13200
  return [];
13219
13201
  }
@@ -13228,24 +13210,24 @@ function dequeuePayloads(queuePath = QUEUE_PATH) {
13228
13210
  } catch {
13229
13211
  }
13230
13212
  }
13231
- writeFileSync10(queuePath, "", "utf8");
13213
+ writeFileSync9(queuePath, "", "utf8");
13232
13214
  return valid.map((e) => e.payload);
13233
13215
  }
13234
13216
  function pruneOldest(queuePath) {
13235
13217
  let lines;
13236
13218
  try {
13237
- lines = readFileSync14(queuePath, "utf8").trim().split("\n").filter(Boolean);
13219
+ lines = readFileSync13(queuePath, "utf8").trim().split("\n").filter(Boolean);
13238
13220
  } catch {
13239
13221
  return;
13240
13222
  }
13241
13223
  const keep = lines.slice(Math.floor(lines.length / 2));
13242
- writeFileSync10(queuePath, keep.join("\n") + "\n", "utf8");
13224
+ writeFileSync9(queuePath, keep.join("\n") + "\n", "utf8");
13243
13225
  }
13244
13226
  var QUEUE_PATH, MAX_SIZE_BYTES, MAX_AGE_MS;
13245
13227
  var init_queue2 = __esm({
13246
13228
  "src/team/queue.ts"() {
13247
13229
  "use strict";
13248
- QUEUE_PATH = join15(homedir14(), ".cclens", "ingest-queue.jsonl");
13230
+ QUEUE_PATH = join14(homedir13(), ".cclens", "ingest-queue.jsonl");
13249
13231
  MAX_SIZE_BYTES = 10 * 1024 * 1024;
13250
13232
  MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
13251
13233
  }
@@ -13256,8 +13238,8 @@ var sync_exports = {};
13256
13238
  __export(sync_exports, {
13257
13239
  runTeamSync: () => runTeamSync
13258
13240
  });
13259
- import { homedir as homedir15 } from "node:os";
13260
- import { join as join16 } from "node:path";
13241
+ import { homedir as homedir14 } from "node:os";
13242
+ import { join as join15 } from "node:path";
13261
13243
  async function runTeamSync(log = noopLog2, configOverride) {
13262
13244
  const config = configOverride === void 0 ? readTeamConfig() : configOverride;
13263
13245
  if (!config) return { paired: false, pushed: 0, queued: 0, queuedDrained: 0 };
@@ -13401,8 +13383,8 @@ var init_sync = __esm({
13401
13383
  init_push();
13402
13384
  init_queue2();
13403
13385
  init_profile();
13404
- USAGE_LOG5 = join16(homedir15(), ".cclens", "usage.jsonl");
13405
- PROFILE_CACHE2 = join16(homedir15(), ".cclens", "profile.json");
13386
+ USAGE_LOG5 = join15(homedir14(), ".cclens", "usage.jsonl");
13387
+ PROFILE_CACHE2 = join15(homedir14(), ".cclens", "profile.json");
13406
13388
  noopLog2 = () => {
13407
13389
  };
13408
13390
  }
@@ -13547,13 +13529,13 @@ var logs_exports = {};
13547
13529
  __export(logs_exports, {
13548
13530
  teamLogs: () => teamLogs
13549
13531
  });
13550
- import { readFileSync as readFileSync15 } from "node:fs";
13551
- import { join as join17 } from "node:path";
13552
- import { homedir as homedir16 } from "node:os";
13532
+ import { readFileSync as readFileSync14 } from "node:fs";
13533
+ import { join as join16 } from "node:path";
13534
+ import { homedir as homedir15 } from "node:os";
13553
13535
  async function teamLogs() {
13554
- const logPath = join17(homedir16(), ".cclens", "daemon.log");
13536
+ const logPath = join16(homedir15(), ".cclens", "daemon.log");
13555
13537
  try {
13556
- const lines = readFileSync15(logPath, "utf8").trim().split("\n");
13538
+ const lines = readFileSync14(logPath, "utf8").trim().split("\n");
13557
13539
  const teamLines = lines.filter((l) => l.includes("team "));
13558
13540
  if (teamLines.length === 0) {
13559
13541
  console.log("No team-related log entries found.");
@@ -13649,9 +13631,9 @@ __export(runs_exports, {
13649
13631
  runs: () => runs
13650
13632
  });
13651
13633
  import { execSync as execSync2 } from "node:child_process";
13652
- import { existsSync as existsSync13, readFileSync as readFileSync16, readdirSync as readdirSync3, statSync as statSync4 } from "node:fs";
13653
- import { homedir as homedir17 } from "node:os";
13654
- import { join as join18 } from "node:path";
13634
+ import { existsSync as existsSync12, readFileSync as readFileSync15, readdirSync as readdirSync3, statSync as statSync4 } from "node:fs";
13635
+ import { homedir as homedir16 } from "node:os";
13636
+ import { join as join17 } from "node:path";
13655
13637
  async function runs(args2) {
13656
13638
  const json = args2.includes("--json");
13657
13639
  const watch = args2.includes("--watch");
@@ -13735,8 +13717,8 @@ function listActiveRuns() {
13735
13717
  return runs2.sort((a, b) => a.elapsed_s - b.elapsed_s);
13736
13718
  }
13737
13719
  function readSpend(sinceMs) {
13738
- if (!existsSync13(SPEND_PATH)) return [];
13739
- const lines = readFileSync16(SPEND_PATH, "utf-8").split("\n").filter((l) => l.trim());
13720
+ if (!existsSync12(SPEND_PATH)) return [];
13721
+ const lines = readFileSync15(SPEND_PATH, "utf-8").split("\n").filter((l) => l.trim());
13740
13722
  const out = [];
13741
13723
  for (const line of lines) {
13742
13724
  try {
@@ -13857,23 +13839,23 @@ function ageLabel(ms) {
13857
13839
  return `${Math.floor(ms / 864e5)}d`;
13858
13840
  }
13859
13841
  function listTraceFiles() {
13860
- if (!existsSync13(RUNS_DIR2)) return [];
13842
+ if (!existsSync12(RUNS_DIR2)) return [];
13861
13843
  const entries2 = readdirSync3(RUNS_DIR2).filter((f) => f.endsWith(".jsonl"));
13862
13844
  return entries2.map((f) => {
13863
- const path2 = join18(RUNS_DIR2, f);
13845
+ const path2 = join17(RUNS_DIR2, f);
13864
13846
  const st = statSync4(path2);
13865
13847
  return { runId: f.replace(/\.jsonl$/, ""), path: path2, mtimeMs: st.mtimeMs };
13866
13848
  }).sort((a, b) => b.mtimeMs - a.mtimeMs);
13867
13849
  }
13868
13850
  function resolveRunId(arg) {
13869
- if (!existsSync13(RUNS_DIR2)) return null;
13851
+ if (!existsSync12(RUNS_DIR2)) return null;
13870
13852
  if (arg === "latest") {
13871
13853
  const all2 = listTraceFiles();
13872
13854
  if (all2.length === 0) return null;
13873
13855
  return { runId: all2[0].runId, path: all2[0].path };
13874
13856
  }
13875
- const exact = join18(RUNS_DIR2, `${arg}.jsonl`);
13876
- if (existsSync13(exact)) return { runId: arg, path: exact };
13857
+ const exact = join17(RUNS_DIR2, `${arg}.jsonl`);
13858
+ if (existsSync12(exact)) return { runId: arg, path: exact };
13877
13859
  const all = listTraceFiles();
13878
13860
  const matches = all.filter((r) => r.runId.includes(arg));
13879
13861
  if (matches.length === 1) return { runId: matches[0].runId, path: matches[0].path };
@@ -13885,7 +13867,7 @@ function resolveRunId(arg) {
13885
13867
  return null;
13886
13868
  }
13887
13869
  function readTrace(path2) {
13888
- return readFileSync16(path2, "utf-8").split("\n").filter((l) => l.trim()).map((l) => {
13870
+ return readFileSync15(path2, "utf-8").split("\n").filter((l) => l.trim()).map((l) => {
13889
13871
  try {
13890
13872
  return JSON.parse(l);
13891
13873
  } catch {
@@ -13897,7 +13879,7 @@ async function inspect(arg, follow, json) {
13897
13879
  const r = resolveRunId(arg);
13898
13880
  if (!r) {
13899
13881
  console.error(`run not found: ${arg}`);
13900
- if (existsSync13(RUNS_DIR2)) {
13882
+ if (existsSync12(RUNS_DIR2)) {
13901
13883
  const all = listTraceFiles().slice(0, 5);
13902
13884
  if (all.length > 0) {
13903
13885
  console.error(`
@@ -13998,8 +13980,8 @@ var init_runs = __esm({
13998
13980
  { kind: "day_digest", marker: /single local day into a short, honest narrative/i },
13999
13981
  { kind: "entry_enrich", marker: /per[- ]entry|enrich.{0,40}entry|brief_summary/i }
14000
13982
  ];
14001
- SPEND_PATH = join18(homedir17(), ".cclens", "llm-spend.jsonl");
14002
- RUNS_DIR2 = join18(homedir17(), ".cclens", "llm-runs");
13983
+ SPEND_PATH = join17(homedir16(), ".cclens", "llm-spend.jsonl");
13984
+ RUNS_DIR2 = join17(homedir16(), ".cclens", "llm-runs");
14003
13985
  }
14004
13986
  });
14005
13987
 
@@ -14066,7 +14048,7 @@ async function main() {
14066
14048
  case "version":
14067
14049
  case "--version":
14068
14050
  case "-v":
14069
- console.log(`fleetlens ${"0.6.2"}`);
14051
+ console.log(`fleetlens ${"0.6.3"}`);
14070
14052
  break;
14071
14053
  case "help":
14072
14054
  case "--help":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetlens",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "fleetlens — local-only dashboard and usage tracker for Claude Code sessions and agent fleets",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- export { shouldAutoFireWeek } from "@claude-lens/entries/node";