ccusage 20.0.42 → 20.0.44

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 (2) hide show
  1. package/package.json +7 -7
  2. package/src/cli.js +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccusage",
3
- "version": "20.0.42",
3
+ "version": "20.0.44",
4
4
  "description": "Analyze coding (agent) CLI token usage and costs from local data",
5
5
  "homepage": "https://github.com/ccusage/ccusage#readme",
6
6
  "bugs": {
@@ -26,12 +26,12 @@
26
26
  "@types/node": "^24.19.2"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@ccusage/ccusage-darwin-arm64": "20.0.42",
30
- "@ccusage/ccusage-darwin-x64": "20.0.42",
31
- "@ccusage/ccusage-linux-arm64": "20.0.42",
32
- "@ccusage/ccusage-linux-x64": "20.0.42",
33
- "@ccusage/ccusage-win32-arm64": "20.0.42",
34
- "@ccusage/ccusage-win32-x64": "20.0.42"
29
+ "@ccusage/ccusage-darwin-arm64": "20.0.44",
30
+ "@ccusage/ccusage-darwin-x64": "20.0.44",
31
+ "@ccusage/ccusage-linux-arm64": "20.0.44",
32
+ "@ccusage/ccusage-linux-x64": "20.0.44",
33
+ "@ccusage/ccusage-win32-arm64": "20.0.44",
34
+ "@ccusage/ccusage-win32-x64": "20.0.44"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "scripts/ensure-native-binary.nu && publint"
package/src/cli.js CHANGED
@@ -7,6 +7,9 @@ import process from 'node:process';
7
7
  import { fileURLToPath } from 'node:url';
8
8
 
9
9
  const require = createRequire(import.meta.url);
10
+ /** @type {{ version: string }} */
11
+ const packageJson = require('../package.json');
12
+ const wrapperVersion = packageJson.version;
10
13
 
11
14
  /**
12
15
  * @typedef {{ args: string[]; command: string } | { errorMessage: string }} CliRuntime
@@ -103,8 +106,16 @@ function resolveCliRuntime({
103
106
  };
104
107
  }
105
108
 
109
+ const target = `${platform}-${arch}`;
110
+ const packageName = getNativePackageName(platform, arch);
111
+ if (packageName == null) {
112
+ return {
113
+ errorMessage: `ccusage does not provide a native binary for ${target}.\n`,
114
+ };
115
+ }
116
+
106
117
  return {
107
- errorMessage: `ccusage native binary is not available for ${platform}-${arch}. Reinstall ccusage so optional native dependencies are installed.\n`,
118
+ errorMessage: `Missing optional native package "${packageName}@${wrapperVersion}" for ${target}. It may be absent because of npm --before/--min-release-age, mise minimum_release_age, or --omit=optional. Reinstall ccusage with optional dependencies enabled and no release-age cutoff.\n`,
108
119
  };
109
120
  }
110
121