modelstat 0.0.26 → 0.0.27

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.
package/dist/cli.mjs CHANGED
@@ -21132,7 +21132,7 @@ var require_snapshot_recorder = __commonJS({
21132
21132
  "../../node_modules/.pnpm/undici@7.25.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
21133
21133
  "use strict";
21134
21134
  var { writeFile, readFile, mkdir: mkdir2 } = __require("fs/promises");
21135
- var { dirname: dirname8, resolve: resolve6 } = __require("path");
21135
+ var { dirname: dirname9, resolve: resolve6 } = __require("path");
21136
21136
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("timers");
21137
21137
  var { InvalidArgumentError, UndiciError } = require_errors();
21138
21138
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -21363,7 +21363,7 @@ var require_snapshot_recorder = __commonJS({
21363
21363
  throw new InvalidArgumentError("Snapshot path is required");
21364
21364
  }
21365
21365
  const resolvedPath = resolve6(path5);
21366
- await mkdir2(dirname8(resolvedPath), { recursive: true });
21366
+ await mkdir2(dirname9(resolvedPath), { recursive: true });
21367
21367
  const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
21368
21368
  hash,
21369
21369
  snapshot
@@ -45953,9 +45953,9 @@ var init_handler = __esm({
45953
45953
  if (this.fsw.closed) {
45954
45954
  return;
45955
45955
  }
45956
- const dirname8 = sysPath.dirname(file);
45956
+ const dirname9 = sysPath.dirname(file);
45957
45957
  const basename4 = sysPath.basename(file);
45958
- const parent = this.fsw._getWatchedDir(dirname8);
45958
+ const parent = this.fsw._getWatchedDir(dirname9);
45959
45959
  let prevStats = stats;
45960
45960
  if (parent.has(basename4))
45961
45961
  return;
@@ -45982,7 +45982,7 @@ var init_handler = __esm({
45982
45982
  prevStats = newStats2;
45983
45983
  }
45984
45984
  } catch (error) {
45985
- this.fsw._remove(dirname8, basename4);
45985
+ this.fsw._remove(dirname9, basename4);
45986
45986
  }
45987
45987
  } else if (parent.has(basename4)) {
45988
45988
  const at = newStats.atimeMs;
@@ -46947,6 +46947,9 @@ __export(daemon_exports, {
46947
46947
  setQueue: () => setQueue
46948
46948
  });
46949
46949
  import { existsSync as existsSync8, statSync as statSync2 } from "fs";
46950
+ import { readFileSync as readFileSync4 } from "fs";
46951
+ import { dirname as dirname8, join as join9 } from "path";
46952
+ import { fileURLToPath as __agentFileURLToPath } from "url";
46950
46953
  function setPhase(phase, message) {
46951
46954
  status.phase = phase;
46952
46955
  status.message = message ?? null;
@@ -47078,18 +47081,18 @@ async function runDaemon(opts = {}) {
47078
47081
  await runScanCycle("startup");
47079
47082
  const chokidar = (await Promise.resolve().then(() => (init_esm2(), esm_exports))).default;
47080
47083
  const { homedir: homedir9, platform: platform5 } = await import("os");
47081
- const { join: join10 } = await import("path");
47084
+ const { join: join11 } = await import("path");
47082
47085
  const home2 = homedir9();
47083
47086
  const dirs = [
47084
- join10(home2, ".claude/projects"),
47085
- join10(home2, ".codex/sessions"),
47086
- join10(home2, ".cursor/ai-tracking"),
47087
- join10(home2, ".gemini"),
47087
+ join11(home2, ".claude/projects"),
47088
+ join11(home2, ".codex/sessions"),
47089
+ join11(home2, ".cursor/ai-tracking"),
47090
+ join11(home2, ".gemini"),
47088
47091
  ...platform5() === "darwin" ? [
47089
- join10(home2, "Library/Application Support/Cursor/User/workspaceStorage"),
47090
- join10(home2, "Library/Application Support/Claude")
47092
+ join11(home2, "Library/Application Support/Cursor/User/workspaceStorage"),
47093
+ join11(home2, "Library/Application Support/Claude")
47091
47094
  ] : [
47092
- join10(home2, ".config/Cursor/User/workspaceStorage")
47095
+ join11(home2, ".config/Cursor/User/workspaceStorage")
47093
47096
  ]
47094
47097
  ].filter((p) => existsSync8(p) && statSync2(p).isDirectory());
47095
47098
  setPhase("watching", `Watching ${dirs.length} directories`);
@@ -47138,7 +47141,24 @@ var init_daemon = __esm({
47138
47141
  init_config2();
47139
47142
  init_lock();
47140
47143
  init_scan();
47141
- AGENT_VERSION2 = "agent-dev-0.0.23";
47144
+ AGENT_VERSION2 = (() => {
47145
+ try {
47146
+ const here2 = dirname8(__agentFileURLToPath(import.meta.url));
47147
+ const candidates = [
47148
+ join9(here2, "..", "package.json"),
47149
+ join9(here2, "..", "..", "package.json")
47150
+ ];
47151
+ for (const c of candidates) {
47152
+ try {
47153
+ const v = JSON.parse(readFileSync4(c, "utf8")).version;
47154
+ if (typeof v === "string") return `agent-${v}`;
47155
+ } catch {
47156
+ }
47157
+ }
47158
+ } catch {
47159
+ }
47160
+ return "agent-unknown";
47161
+ })();
47142
47162
  HEARTBEAT_INTERVAL_MS = 1e4;
47143
47163
  SCAN_INTERVAL_MS = 5 * 60 * 1e3;
47144
47164
  status = {
@@ -47160,32 +47180,32 @@ __export(watch_exports, {
47160
47180
  });
47161
47181
  import { existsSync as existsSync9 } from "fs";
47162
47182
  import { homedir as homedir8, platform as platform3 } from "os";
47163
- import { join as join9 } from "path";
47183
+ import { join as join10 } from "path";
47164
47184
  function resolveWatchDirs() {
47165
47185
  const home2 = homedir8();
47166
- const xdgConfig = process.env.XDG_CONFIG_HOME ?? join9(home2, ".config");
47167
- const xdgData = process.env.XDG_DATA_HOME ?? join9(home2, ".local/share");
47186
+ const xdgConfig = process.env.XDG_CONFIG_HOME ?? join10(home2, ".config");
47187
+ const xdgData = process.env.XDG_DATA_HOME ?? join10(home2, ".local/share");
47168
47188
  const candidates = [
47169
47189
  // universal (default HOME-rooted CLI data dirs)
47170
- join9(home2, ".claude/projects"),
47171
- join9(home2, ".codex/sessions"),
47172
- join9(home2, ".cursor/ai-tracking"),
47173
- join9(home2, ".gemini"),
47174
- join9(home2, ".aider"),
47190
+ join10(home2, ".claude/projects"),
47191
+ join10(home2, ".codex/sessions"),
47192
+ join10(home2, ".cursor/ai-tracking"),
47193
+ join10(home2, ".gemini"),
47194
+ join10(home2, ".aider"),
47175
47195
  // XDG / Linux
47176
- join9(xdgConfig, "claude/projects"),
47177
- join9(xdgConfig, "codex/sessions"),
47178
- join9(xdgConfig, "Cursor/User/workspaceStorage"),
47179
- join9(xdgConfig, "Code/User/workspaceStorage"),
47180
- join9(xdgConfig, "Code - Insiders/User/workspaceStorage"),
47181
- join9(xdgData, "claude/projects"),
47196
+ join10(xdgConfig, "claude/projects"),
47197
+ join10(xdgConfig, "codex/sessions"),
47198
+ join10(xdgConfig, "Cursor/User/workspaceStorage"),
47199
+ join10(xdgConfig, "Code/User/workspaceStorage"),
47200
+ join10(xdgConfig, "Code - Insiders/User/workspaceStorage"),
47201
+ join10(xdgData, "claude/projects"),
47182
47202
  // macOS
47183
47203
  ...platform3() === "darwin" ? [
47184
- join9(home2, "Library/Application Support/Cursor/User/workspaceStorage"),
47185
- join9(home2, "Library/Application Support/Claude"),
47186
- join9(home2, "Library/Application Support/Code/User/workspaceStorage"),
47187
- join9(home2, "Library/Application Support/Windsurf/User/workspaceStorage"),
47188
- join9(home2, "Library/Application Support/Zed")
47204
+ join10(home2, "Library/Application Support/Cursor/User/workspaceStorage"),
47205
+ join10(home2, "Library/Application Support/Claude"),
47206
+ join10(home2, "Library/Application Support/Code/User/workspaceStorage"),
47207
+ join10(home2, "Library/Application Support/Windsurf/User/workspaceStorage"),
47208
+ join10(home2, "Library/Application Support/Zed")
47189
47209
  ] : []
47190
47210
  ];
47191
47211
  return Array.from(new Set(candidates)).filter((p) => existsSync9(p));