@botiverse/oar 0.0.2 → 0.0.4
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.
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { AccountUsageReader, AccountUsageSnapshot } from "../../contracts/account-usage.js";
|
|
2
|
-
export declare function projectClaudeUsage(content: string, referenceInstant?: Date, email?: string): AccountUsageSnapshot;
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Project the `/api/oauth/usage` payload. The authoritative shape is its
|
|
4
|
+
* `limits` array; a representative (subscription) response is:
|
|
6
5
|
*
|
|
7
6
|
* ```json
|
|
8
7
|
* {
|
|
9
|
-
* "
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* "limits": [
|
|
9
|
+
* { "kind": "session", "group": "session", "percent": 17, "severity": "normal",
|
|
10
|
+
* "resets_at": "2026-08-26T13:49:59.725522+00:00", "scope": null, "is_active": false },
|
|
11
|
+
* { "kind": "weekly_all", "group": "weekly", "percent": 72, "severity": "normal",
|
|
12
|
+
* "resets_at": "2026-08-28T06:59:59.725547+00:00", "scope": null, "is_active": false },
|
|
13
|
+
* { "kind": "weekly_scoped", "group": "weekly", "percent": 100, "severity": "critical",
|
|
14
|
+
* "resets_at": "2026-08-28T06:59:59.725963+00:00",
|
|
15
|
+
* "scope": { "model": { "display_name": "Fable" } }, "is_active": true }
|
|
16
|
+
* ]
|
|
13
17
|
* }
|
|
14
18
|
* ```
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* Reset text has no year, so it is interpreted as the next occurrence in its
|
|
26
|
-
* named IANA time zone relative to when the command result is projected.
|
|
19
|
+
*/
|
|
20
|
+
export declare function projectClaudeUsage(payload: unknown, email?: string): AccountUsageSnapshot;
|
|
21
|
+
/**
|
|
22
|
+
* Reads Claude account usage in two steps: `claude auth status --json` for the
|
|
23
|
+
* login gate and account email, then a single read-only request to Anthropic's
|
|
24
|
+
* structured usage endpoint using the persisted `/login` OAuth token. This
|
|
25
|
+
* replaces the older `claude -p /usage` subprocess, which was slower and only
|
|
26
|
+
* returned pre-rendered text.
|
|
27
27
|
*/
|
|
28
28
|
export declare const claudeAccountUsage: AccountUsageReader;
|
|
29
29
|
//# sourceMappingURL=account-usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-usage.d.ts","sourceRoot":"","sources":["../../../src/runtimes/claude/account-usage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account-usage.d.ts","sourceRoot":"","sources":["../../../src/runtimes/claude/account-usage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EAGrB,MAAM,kCAAkC,CAAC;AAqG1C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,oBAAoB,CA6BzF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBA0ChC,CAAC"}
|
|
@@ -1,140 +1,146 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { homedir, platform } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
1
4
|
import { runExecutable } from "../../shared/executable/index.js";
|
|
2
5
|
import { utcInstantFromDate } from "../../shared/instant.js";
|
|
3
|
-
import { asRecord, parseJson } from "../../shared/json.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { asNumber, asRecord, parseJson } from "../../shared/json.js";
|
|
7
|
+
const USAGE_ENDPOINT = "https://api.anthropic.com/api/oauth/usage";
|
|
8
|
+
// The structured usage endpoint is gated behind the OAuth beta and requires a
|
|
9
|
+
// full `/login` token carrying the `user:profile` scope. Inference-only tokens
|
|
10
|
+
// (env CLAUDE_CODE_OAUTH_TOKEN / injected FDs) lack that scope, so this reader
|
|
11
|
+
// only consults the persisted login credential.
|
|
12
|
+
const OAUTH_BETA = "oauth-2025-04-20";
|
|
13
|
+
const PROFILE_SCOPE = "user:profile";
|
|
14
|
+
function parseStoredOAuth(raw) {
|
|
15
|
+
const oauth = asRecord(asRecord(parseJson(raw))?.claudeAiOauth);
|
|
16
|
+
const accessToken = oauth?.accessToken;
|
|
17
|
+
if (typeof accessToken !== "string" || accessToken.length === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const scopes = oauth?.scopes;
|
|
21
|
+
const hasProfileScope = Array.isArray(scopes) && scopes.includes(PROFILE_SCOPE);
|
|
22
|
+
return { accessToken, hasProfileScope };
|
|
23
|
+
}
|
|
24
|
+
function credentialsFilePath() {
|
|
25
|
+
const base = process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude");
|
|
26
|
+
return join(base, ".credentials.json");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Read Claude Code's persisted `/login` OAuth credential, mirroring the
|
|
30
|
+
* `getClaudeAIOAuthTokens()` fallback: the plaintext credentials file (Linux,
|
|
31
|
+
* and the macOS/Windows fallback), then the macOS Keychain, which stores the
|
|
32
|
+
* same JSON blob. Any failure degrades to `null` — never throws.
|
|
33
|
+
*/
|
|
34
|
+
async function readStoredOAuth(timeoutMs) {
|
|
9
35
|
try {
|
|
10
|
-
|
|
11
|
-
timeZone,
|
|
12
|
-
calendar: "gregory",
|
|
13
|
-
numberingSystem: "latn",
|
|
14
|
-
year: "numeric",
|
|
15
|
-
month: "2-digit",
|
|
16
|
-
day: "2-digit",
|
|
17
|
-
hour: "2-digit",
|
|
18
|
-
minute: "2-digit",
|
|
19
|
-
hourCycle: "h23",
|
|
20
|
-
}).formatToParts(instant);
|
|
21
|
-
const values = Object.fromEntries(parts.map((part) => [part.type, part.value]));
|
|
22
|
-
const result = {
|
|
23
|
-
year: Number(values.year),
|
|
24
|
-
month: Number(values.month) - 1,
|
|
25
|
-
day: Number(values.day),
|
|
26
|
-
hour: Number(values.hour),
|
|
27
|
-
minute: Number(values.minute),
|
|
28
|
-
};
|
|
29
|
-
return Object.values(result).every((value) => Number.isFinite(value)) ? result : null;
|
|
36
|
+
return parseStoredOAuth(readFileSync(credentialsFilePath(), "utf8"));
|
|
30
37
|
}
|
|
31
38
|
catch {
|
|
32
|
-
|
|
39
|
+
// No file (or unreadable): fall through to the platform keystore.
|
|
33
40
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const correction = target
|
|
44
|
-
- Date.UTC(observed.year, observed.month, observed.day, observed.hour, observed.minute);
|
|
45
|
-
if (correction === 0) {
|
|
46
|
-
return instant;
|
|
41
|
+
if (platform() === "darwin") {
|
|
42
|
+
const keychain = await runExecutable("security", ["find-generic-password", "-w", "-s", "Claude Code-credentials"], { timeoutMs });
|
|
43
|
+
if (keychain.ok) {
|
|
44
|
+
try {
|
|
45
|
+
return parseStoredOAuth(keychain.stdout);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
|
-
instant += correction;
|
|
49
51
|
}
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return null;
|
|
54
|
+
function usageWindowLabel(kind, scope) {
|
|
55
|
+
const modelName = asRecord(scope?.model)?.display_name;
|
|
56
|
+
switch (kind) {
|
|
57
|
+
case "session":
|
|
58
|
+
return "Current session";
|
|
59
|
+
case "weekly_all":
|
|
60
|
+
return "Current week (all models)";
|
|
61
|
+
case "weekly_scoped":
|
|
62
|
+
return typeof modelName === "string" ? `Current week (${modelName})` : "Current week";
|
|
63
|
+
default:
|
|
64
|
+
return typeof kind === "string" && kind.length > 0 ? kind : "Usage limit";
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
}
|
|
67
|
+
async function fetchUsage(accessToken, version, timeoutMs) {
|
|
68
|
+
try {
|
|
69
|
+
return await fetch(USAGE_ENDPOINT, {
|
|
70
|
+
headers: {
|
|
71
|
+
"Authorization": `Bearer ${accessToken}`,
|
|
72
|
+
"anthropic-beta": OAUTH_BETA,
|
|
73
|
+
"Content-Type": "application/json",
|
|
74
|
+
"User-Agent": `claude-code/${version}`,
|
|
75
|
+
},
|
|
76
|
+
signal: AbortSignal.timeout(Math.min(timeoutMs, 5000)),
|
|
77
|
+
});
|
|
68
78
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
for (const year of [reference.year, reference.year + 1]) {
|
|
72
|
-
const instant = localInstant({ year, month, day, hour, minute }, timeZone);
|
|
73
|
-
if (instant !== null && instant >= cutoff) {
|
|
74
|
-
return utcInstantFromDate(new Date(instant));
|
|
75
|
-
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error("Failed to reach Claude usage endpoint", { cause: error });
|
|
76
81
|
}
|
|
77
|
-
return null;
|
|
78
82
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
function resetInstant(value) {
|
|
84
|
+
if (typeof value !== "string") {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
const date = new Date(value);
|
|
88
|
+
return Number.isNaN(date.getTime()) ? null : utcInstantFromDate(date);
|
|
82
89
|
}
|
|
83
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Project the `/api/oauth/usage` payload. The authoritative shape is its
|
|
92
|
+
* `limits` array; a representative (subscription) response is:
|
|
93
|
+
*
|
|
94
|
+
* ```json
|
|
95
|
+
* {
|
|
96
|
+
* "limits": [
|
|
97
|
+
* { "kind": "session", "group": "session", "percent": 17, "severity": "normal",
|
|
98
|
+
* "resets_at": "2026-08-26T13:49:59.725522+00:00", "scope": null, "is_active": false },
|
|
99
|
+
* { "kind": "weekly_all", "group": "weekly", "percent": 72, "severity": "normal",
|
|
100
|
+
* "resets_at": "2026-08-28T06:59:59.725547+00:00", "scope": null, "is_active": false },
|
|
101
|
+
* { "kind": "weekly_scoped", "group": "weekly", "percent": 100, "severity": "critical",
|
|
102
|
+
* "resets_at": "2026-08-28T06:59:59.725963+00:00",
|
|
103
|
+
* "scope": { "model": { "display_name": "Fable" } }, "is_active": true }
|
|
104
|
+
* ]
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export function projectClaudeUsage(payload, email) {
|
|
109
|
+
const limits = asRecord(payload)?.limits;
|
|
84
110
|
const windows = [];
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
111
|
+
let rateLimited = false;
|
|
112
|
+
if (Array.isArray(limits)) {
|
|
113
|
+
for (const entry of limits) {
|
|
114
|
+
const limit = asRecord(entry);
|
|
115
|
+
const percent = asNumber(limit?.percent);
|
|
116
|
+
if (limit === null || percent === null || percent < 0) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const resetsAt = resetInstant(limit.resets_at);
|
|
120
|
+
windows.push({
|
|
121
|
+
label: usageWindowLabel(limit.kind, asRecord(limit.scope)),
|
|
122
|
+
usedRatio: Number((percent / 100).toFixed(6)),
|
|
123
|
+
...(resetsAt === null ? {} : { resetsAt }),
|
|
124
|
+
});
|
|
125
|
+
rateLimited ||= limit.severity === "critical" || percent >= 100;
|
|
91
126
|
}
|
|
92
|
-
const usedPercent = Number(percentage);
|
|
93
|
-
if (!Number.isFinite(usedPercent) || usedPercent < 0 || usedPercent > 100) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
const resetText = match?.[3];
|
|
97
|
-
const resetsAt = resetText === undefined ? null : resetInstant(resetText, referenceInstant);
|
|
98
|
-
windows.push({
|
|
99
|
-
label,
|
|
100
|
-
usedRatio: Number((usedPercent / 100).toFixed(6)),
|
|
101
|
-
...(resetsAt === null ? {} : { resetsAt }),
|
|
102
|
-
});
|
|
103
127
|
}
|
|
104
128
|
if (windows.length === 0) {
|
|
105
|
-
throw new Error("Claude returned no usable
|
|
129
|
+
throw new Error("Claude usage endpoint returned no usable windows");
|
|
106
130
|
}
|
|
107
131
|
return {
|
|
108
132
|
kind: "available",
|
|
109
133
|
...(email === undefined ? {} : { email }),
|
|
110
|
-
rateLimited
|
|
134
|
+
rateLimited,
|
|
111
135
|
windows,
|
|
112
136
|
};
|
|
113
137
|
}
|
|
114
138
|
/**
|
|
115
|
-
* `claude
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* "type": "result",
|
|
121
|
-
* "total_cost_usd": 0,
|
|
122
|
-
* "usage": { "input_tokens": 0, "output_tokens": 0 },
|
|
123
|
-
* "result": "Total cost: $0.0000\nUsage: 0 input, 0 output, 0 cache read, 0 cache write"
|
|
124
|
-
* }
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* With a subscription login, `result` contains account usage windows:
|
|
128
|
-
*
|
|
129
|
-
* ```json
|
|
130
|
-
* {
|
|
131
|
-
* "type": "result",
|
|
132
|
-
* "result": "You are currently using your subscription to power your Claude Code usage\n\nCurrent session: 7% used · resets Aug 21 at 7:39pm (Asia/Shanghai)\nCurrent week (all models): 0% used · resets Aug 28 at 2:59pm (Asia/Shanghai)\nCurrent week (Fable): 0% used"
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
135
|
-
*
|
|
136
|
-
* Reset text has no year, so it is interpreted as the next occurrence in its
|
|
137
|
-
* named IANA time zone relative to when the command result is projected.
|
|
139
|
+
* Reads Claude account usage in two steps: `claude auth status --json` for the
|
|
140
|
+
* login gate and account email, then a single read-only request to Anthropic's
|
|
141
|
+
* structured usage endpoint using the persisted `/login` OAuth token. This
|
|
142
|
+
* replaces the older `claude -p /usage` subprocess, which was slower and only
|
|
143
|
+
* returned pre-rendered text.
|
|
138
144
|
*/
|
|
139
145
|
export const claudeAccountUsage = async (installation, options = {}) => {
|
|
140
146
|
if (installation.via !== "executable") {
|
|
@@ -157,29 +163,24 @@ export const claudeAccountUsage = async (installation, options = {}) => {
|
|
|
157
163
|
? authStatus.email
|
|
158
164
|
: undefined;
|
|
159
165
|
if (typeof authStatus?.apiKeySource === "string") {
|
|
160
|
-
// An API key takes precedence over any claude.ai login, and API-key
|
|
161
|
-
//
|
|
162
|
-
// cost report (pinned by the claude vendor usage test).
|
|
166
|
+
// An API key takes precedence over any claude.ai login, and API-key billing
|
|
167
|
+
// has no subscription usage windows.
|
|
163
168
|
return { kind: "unsupported" };
|
|
164
169
|
}
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
if (/auth(?:entication)?\s*(?:missing|required)|log(?:ged)?\s*in/iu.test(output)) {
|
|
175
|
-
return { kind: "reauth_required" };
|
|
176
|
-
}
|
|
177
|
-
throw new Error("Claude account usage command failed");
|
|
170
|
+
const stored = await readStoredOAuth(timeoutMs);
|
|
171
|
+
if (stored === null || !stored.hasProfileScope) {
|
|
172
|
+
// No persisted profile-scoped login token means the usage endpoint would
|
|
173
|
+
// reject the request; treat it as needing a fresh `/login`.
|
|
174
|
+
return { kind: "reauth_required" };
|
|
175
|
+
}
|
|
176
|
+
const response = await fetchUsage(stored.accessToken, installation.version ?? "0.0.0", timeoutMs);
|
|
177
|
+
if (response.status === 401 || response.status === 403) {
|
|
178
|
+
return { kind: "reauth_required" };
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
throw new Error("Claude returned no account usage result");
|
|
180
|
+
if (!response.ok) {
|
|
181
|
+
throw new Error(`Claude usage endpoint returned HTTP ${response.status}`);
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
const payload = parseJson(await response.text());
|
|
184
|
+
return projectClaudeUsage(payload, email);
|
|
184
185
|
};
|
|
185
186
|
//# sourceMappingURL=account-usage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-usage.js","sourceRoot":"","sources":["../../../src/runtimes/claude/account-usage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account-usage.js","sourceRoot":"","sources":["../../../src/runtimes/claude/account-usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,cAAc,GAAG,2CAA2C,CAAC;AACnE,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,gDAAgD;AAChD,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACtC,MAAM,aAAa,GAAG,cAAc,CAAC;AAOrC,SAAS,gBAAgB,CAAC,GAAW;IACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IAChE,MAAM,WAAW,GAAG,KAAK,EAAE,WAAW,CAAC;IACvC,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC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