tokentracker-cli 0.5.96 → 0.5.97

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.
@@ -135,8 +135,8 @@
135
135
  ]
136
136
  }
137
137
  </script>
138
- <script type="module" crossorigin src="/assets/main-DOlPovqc.js"></script>
139
- <link rel="stylesheet" crossorigin href="/assets/main-DL3FPCZX.css">
138
+ <script type="module" crossorigin src="/assets/main-h-vFy9lS.js"></script>
139
+ <link rel="stylesheet" crossorigin href="/assets/main-HLMqEvtH.css">
140
140
  </head>
141
141
  <body>
142
142
  <main class="aeo-seed-content" aria-label="Token Tracker AI-readable summary">
@@ -51,8 +51,8 @@
51
51
  "description": "Shareable Token Tracker dashboard snapshot."
52
52
  }
53
53
  </script>
54
- <script type="module" crossorigin src="/assets/main-DOlPovqc.js"></script>
55
- <link rel="stylesheet" crossorigin href="/assets/main-DL3FPCZX.css">
54
+ <script type="module" crossorigin src="/assets/main-h-vFy9lS.js"></script>
55
+ <link rel="stylesheet" crossorigin href="/assets/main-HLMqEvtH.css">
56
56
  </head>
57
57
  <body>
58
58
  <main class="aeo-seed-content" aria-label="Token Tracker share page summary">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.5.96",
3
+ "version": "0.5.97",
4
4
  "description": "Token usage tracker for AI agent CLIs (Claude Code, Codex, Cursor, Kiro, Gemini, OpenCode, OpenClaw, Hermes, GitHub Copilot)",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -8,18 +8,31 @@ const { readJson } = require("./fs");
8
8
 
9
9
  // ── Path resolution ──
10
10
 
11
- function resolveCursorPaths({ home } = {}) {
11
+ function resolveCursorPaths({ home, platform = process.platform, env = process.env } = {}) {
12
12
  const h = home || os.homedir();
13
- const appSupport = path.join(h, "Library", "Application Support", "Cursor");
13
+ let appDir;
14
+ if (platform === "darwin") {
15
+ appDir = path.join(h, "Library", "Application Support", "Cursor");
16
+ } else if (platform === "win32") {
17
+ const appData =
18
+ (typeof env.APPDATA === "string" && env.APPDATA.trim()) ||
19
+ path.join(h, "AppData", "Roaming");
20
+ appDir = path.join(appData, "Cursor");
21
+ } else {
22
+ const xdg =
23
+ (typeof env.XDG_CONFIG_HOME === "string" && env.XDG_CONFIG_HOME.trim()) ||
24
+ path.join(h, ".config");
25
+ appDir = path.join(xdg, "Cursor");
26
+ }
14
27
  return {
15
- appDir: appSupport,
16
- stateDbPath: path.join(appSupport, "User", "globalStorage", "state.vscdb"),
28
+ appDir,
29
+ stateDbPath: path.join(appDir, "User", "globalStorage", "state.vscdb"),
17
30
  cliConfigPath: path.join(h, ".cursor", "cli-config.json"),
18
31
  };
19
32
  }
20
33
 
21
- function isCursorInstalled({ home } = {}) {
22
- const { appDir } = resolveCursorPaths({ home });
34
+ function isCursorInstalled({ home, platform, env } = {}) {
35
+ const { appDir } = resolveCursorPaths({ home, platform, env });
23
36
  try {
24
37
  return fs.statSync(appDir).isDirectory();
25
38
  } catch {