ccclub 0.2.70 → 0.2.71
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/index.js +6 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -412,15 +412,11 @@ async function fetchUsageLimits() {
|
|
|
412
412
|
const credentials = JSON.parse(raw);
|
|
413
413
|
const accessToken = credentials?.claudeAiOauth?.accessToken;
|
|
414
414
|
if (!accessToken || typeof accessToken !== "string") return null;
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
signal: AbortSignal.timeout(8e3)
|
|
421
|
-
});
|
|
422
|
-
if (!res.ok) return null;
|
|
423
|
-
const data = await res.json();
|
|
415
|
+
const curlCmd = `curl -sf "https://api.anthropic.com/api/oauth/usage" -H "Authorization: Bearer ${accessToken}" -H "anthropic-beta: oauth-2025-04-20" -H "User-Agent: claude-code/2.1.5"`;
|
|
416
|
+
const response = execSync2(curlCmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 8e3 });
|
|
417
|
+
if (!response) return null;
|
|
418
|
+
const data = JSON.parse(response);
|
|
419
|
+
if (data.error) return null;
|
|
424
420
|
const fiveHourRaw = data.five_hour?.utilization;
|
|
425
421
|
const sevenDayRaw = data.seven_day?.utilization;
|
|
426
422
|
return {
|
|
@@ -1309,7 +1305,7 @@ async function hookCommand() {
|
|
|
1309
1305
|
}
|
|
1310
1306
|
|
|
1311
1307
|
// src/index.ts
|
|
1312
|
-
var VERSION = "0.2.
|
|
1308
|
+
var VERSION = "0.2.71";
|
|
1313
1309
|
startUpdateCheck(VERSION);
|
|
1314
1310
|
var program = new Command();
|
|
1315
1311
|
program.name("ccclub").description("Claude Code leaderboard among friends").version(VERSION, "-v, -V, --version");
|