@openlimiter/core 0.4.0 → 1.3.1
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/acquire/antigravity-probe.d.ts +139 -0
- package/dist/acquire/antigravity-probe.d.ts.map +1 -0
- package/dist/acquire/antigravity-probe.js +599 -0
- package/dist/acquire/antigravity-probe.js.map +1 -0
- package/dist/acquire/cadence.d.ts +74 -0
- package/dist/acquire/cadence.d.ts.map +1 -0
- package/dist/acquire/cadence.js +171 -0
- package/dist/acquire/cadence.js.map +1 -0
- package/dist/acquire/coordination.d.ts +157 -0
- package/dist/acquire/coordination.d.ts.map +1 -0
- package/dist/acquire/coordination.js +292 -0
- package/dist/acquire/coordination.js.map +1 -0
- package/dist/acquire/credentials.d.ts +113 -0
- package/dist/acquire/credentials.d.ts.map +1 -0
- package/dist/acquire/credentials.js +316 -0
- package/dist/acquire/credentials.js.map +1 -0
- package/dist/acquire/identity.d.ts +20 -0
- package/dist/acquire/identity.d.ts.map +1 -0
- package/dist/acquire/identity.js +20 -0
- package/dist/acquire/identity.js.map +1 -0
- package/dist/acquire/index.d.ts +10 -0
- package/dist/acquire/index.d.ts.map +1 -0
- package/dist/acquire/index.js +10 -0
- package/dist/acquire/index.js.map +1 -0
- package/dist/acquire/providers.d.ts +86 -0
- package/dist/acquire/providers.d.ts.map +1 -0
- package/dist/acquire/providers.js +175 -0
- package/dist/acquire/providers.js.map +1 -0
- package/dist/acquire/runner.d.ts +146 -0
- package/dist/acquire/runner.d.ts.map +1 -0
- package/dist/acquire/runner.js +345 -0
- package/dist/acquire/runner.js.map +1 -0
- package/dist/acquire/transport.d.ts +194 -0
- package/dist/acquire/transport.d.ts.map +1 -0
- package/dist/acquire/transport.js +434 -0
- package/dist/acquire/transport.js.map +1 -0
- package/dist/acquire/windows-credential.d.ts +74 -0
- package/dist/acquire/windows-credential.d.ts.map +1 -0
- package/dist/acquire/windows-credential.js +124 -0
- package/dist/acquire/windows-credential.js.map +1 -0
- package/dist/cache.d.ts +28 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +179 -25
- package/dist/cache.js.map +1 -1
- package/dist/connection-state.d.ts +53 -2
- package/dist/connection-state.d.ts.map +1 -1
- package/dist/connection-state.js +98 -9
- package/dist/connection-state.js.map +1 -1
- package/dist/failures.d.ts +2 -1
- package/dist/failures.d.ts.map +1 -1
- package/dist/failures.js +7 -3
- package/dist/failures.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/merge.d.ts.map +1 -1
- package/dist/merge.js +17 -1
- package/dist/merge.js.map +1 -1
- package/dist/normalizer.d.ts +2 -0
- package/dist/normalizer.d.ts.map +1 -1
- package/dist/normalizer.js +39 -4
- package/dist/normalizer.js.map +1 -1
- package/dist/types.d.ts +63 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where each vendor's own client keeps the credential it obtained, and how to
|
|
3
|
+
* read it without ever changing it.
|
|
4
|
+
*
|
|
5
|
+
* Three rules hold this whole file together.
|
|
6
|
+
*
|
|
7
|
+
* One: nothing here writes. Not a refresh, not a rewrite, not a touch of the
|
|
8
|
+
* modification time. A vendor's credential file belongs to that vendor's
|
|
9
|
+
* client, and a monitor that repairs it is a monitor that can corrupt a login
|
|
10
|
+
* somebody depends on for work.
|
|
11
|
+
*
|
|
12
|
+
* Two: no secret ever leaves this module by any route other than the request
|
|
13
|
+
* builders in `transport.ts`. Every failure is a closed literal with no
|
|
14
|
+
* payload, so a token cannot reach a log, an error string, a report or a
|
|
15
|
+
* process argument.
|
|
16
|
+
*
|
|
17
|
+
* Three: absent is not broken. A machine without Codex installed is not a
|
|
18
|
+
* failure to report, it is a provider this person does not use.
|
|
19
|
+
*/
|
|
20
|
+
import { homedir } from "node:os";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
import { readJsonFileSafely } from "../cache.js";
|
|
23
|
+
/** The providers this path can read a credential for. */
|
|
24
|
+
export const ACQUISITION_PROVIDERS = [
|
|
25
|
+
"CLAUDE",
|
|
26
|
+
"CODEX",
|
|
27
|
+
"GEMINI_CLI",
|
|
28
|
+
"ANTIGRAVITY",
|
|
29
|
+
"GROK",
|
|
30
|
+
"KIMI",
|
|
31
|
+
"OPENROUTER"
|
|
32
|
+
];
|
|
33
|
+
/** Largest credential document this path will read into memory. */
|
|
34
|
+
export const MAX_CREDENTIAL_FILE_BYTES = 65_536;
|
|
35
|
+
/**
|
|
36
|
+
* Whose login this actually is.
|
|
37
|
+
*
|
|
38
|
+
* The one that matters is `shared_code_assist`. Antigravity keeps its token in
|
|
39
|
+
* the Windows credential store, and when that store holds nothing this reader
|
|
40
|
+
* falls back to the Gemini CLI's file, which is what the Antigravity client's
|
|
41
|
+
* own quota shares a backend with. That fallback is legitimate and it is what
|
|
42
|
+
* every other reader does, but the resulting row is NOT Antigravity's own
|
|
43
|
+
* login, and presenting it as one would tell a person they had connected
|
|
44
|
+
* something they never connected. So the origin travels with the credential and
|
|
45
|
+
* the row says which it is.
|
|
46
|
+
*/
|
|
47
|
+
export const CREDENTIAL_ORIGINS = [
|
|
48
|
+
"vendor_store",
|
|
49
|
+
"vendor_file",
|
|
50
|
+
"shared_code_assist",
|
|
51
|
+
"user_key"
|
|
52
|
+
];
|
|
53
|
+
function resolve(options) {
|
|
54
|
+
return {
|
|
55
|
+
platform: options.platform ?? process.platform,
|
|
56
|
+
environment: options.environment ?? process.env,
|
|
57
|
+
home: options.homeDirectory ?? homedir()
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function directoryFrom(value) {
|
|
61
|
+
return value === undefined || value.trim() === "" ? null : value;
|
|
62
|
+
}
|
|
63
|
+
function xdgConfig(context) {
|
|
64
|
+
return directoryFrom(context.environment["XDG_CONFIG_HOME"]) ??
|
|
65
|
+
path.join(context.home, ".config");
|
|
66
|
+
}
|
|
67
|
+
function xdgData(context) {
|
|
68
|
+
return directoryFrom(context.environment["XDG_DATA_HOME"]) ??
|
|
69
|
+
path.join(context.home, ".local", "share");
|
|
70
|
+
}
|
|
71
|
+
function join(base, ...parts) {
|
|
72
|
+
return base === null ? null : path.join(base, ...parts);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Every place a provider's own client is known to keep its credential, in the
|
|
76
|
+
* order the vendor's own environment variable would win.
|
|
77
|
+
*
|
|
78
|
+
* The first readable document that yields a usable secret wins. Order matters
|
|
79
|
+
* only for a machine carrying two of them, and in that case the explicit
|
|
80
|
+
* environment variable is the one the person set on purpose.
|
|
81
|
+
*/
|
|
82
|
+
export function credentialCandidatePaths(provider, options = {}) {
|
|
83
|
+
const context = resolve(options);
|
|
84
|
+
const home = context.home;
|
|
85
|
+
const candidates = [];
|
|
86
|
+
if (provider === "CLAUDE") {
|
|
87
|
+
candidates.push(join(directoryFrom(context.environment["CLAUDE_CONFIG_DIR"]), ".credentials.json"), path.join(home, ".claude", ".credentials.json"), join(xdgConfig(context), "claude", ".credentials.json"), join(xdgConfig(context), "claude-code", ".credentials.json"), join(xdgData(context), "claude-code", ".credentials.json"));
|
|
88
|
+
}
|
|
89
|
+
else if (provider === "CODEX") {
|
|
90
|
+
candidates.push(join(directoryFrom(context.environment["CODEX_HOME"]), "auth.json"), path.join(home, ".codex", "auth.json"), join(xdgConfig(context), "codex", "auth.json"), join(xdgData(context), "codex", "auth.json"));
|
|
91
|
+
}
|
|
92
|
+
else if (provider === "GEMINI_CLI" || provider === "ANTIGRAVITY") {
|
|
93
|
+
candidates.push(join(directoryFrom(context.environment["GEMINI_DIR"]), "oauth_creds.json"), path.join(home, ".gemini", "oauth_creds.json"));
|
|
94
|
+
}
|
|
95
|
+
else if (provider === "GROK") {
|
|
96
|
+
candidates.push(join(directoryFrom(context.environment["GROK_HOME"]), "auth.json"), path.join(home, ".grok", "auth.json"));
|
|
97
|
+
}
|
|
98
|
+
else if (provider === "KIMI") {
|
|
99
|
+
candidates.push(join(directoryFrom(context.environment["KIMI_CODE_HOME"]), "credentials", "kimi-code.json"), path.join(home, ".kimi", "credentials", "kimi-code.json"), path.join(home, ".kimi-code", "credentials", "kimi-code.json"), join(directoryFrom(context.environment["KIMI_SHARE_DIR"]), "credentials", "kimi-code.json"));
|
|
100
|
+
}
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
const paths = [];
|
|
103
|
+
for (const candidate of candidates) {
|
|
104
|
+
if (candidate === null || seen.has(candidate))
|
|
105
|
+
continue;
|
|
106
|
+
seen.add(candidate);
|
|
107
|
+
paths.push(candidate);
|
|
108
|
+
}
|
|
109
|
+
return paths;
|
|
110
|
+
}
|
|
111
|
+
/** The Windows Credential Manager target the Antigravity client writes to. */
|
|
112
|
+
export const ANTIGRAVITY_CREDENTIAL_TARGET = "gemini:antigravity";
|
|
113
|
+
/** The macOS keychain service Claude Code writes to, which this path skips. */
|
|
114
|
+
export const CLAUDE_KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
115
|
+
function isRecord(value) {
|
|
116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
117
|
+
}
|
|
118
|
+
function stringField(source, names) {
|
|
119
|
+
for (const name of names) {
|
|
120
|
+
const value = source[name];
|
|
121
|
+
if (typeof value === "string" && value.length > 0)
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The container inside a credential document that actually holds the token.
|
|
128
|
+
*
|
|
129
|
+
* Every one of these clients nests it under a different key, and two of them
|
|
130
|
+
* changed the key between releases, so the root itself is tried last rather
|
|
131
|
+
* than first: a document that carries both a nested container and a stray top
|
|
132
|
+
* level field should be read the way its own client reads it.
|
|
133
|
+
*/
|
|
134
|
+
const CONTAINERS = {
|
|
135
|
+
CLAUDE: ["claudeAiOauth", "oauth", "credentials"],
|
|
136
|
+
CODEX: ["tokens", "oauth", "credentials"],
|
|
137
|
+
GEMINI_CLI: ["oauth", "tokens", "credentials"],
|
|
138
|
+
ANTIGRAVITY: ["token", "oauth", "tokens", "credentials"],
|
|
139
|
+
GROK: ["credentials", "auth", "tokens"],
|
|
140
|
+
KIMI: ["credentials", "oauth", "tokens"],
|
|
141
|
+
OPENROUTER: ["credentials"]
|
|
142
|
+
};
|
|
143
|
+
const SECRET_FIELDS = {
|
|
144
|
+
CLAUDE: ["accessToken", "access_token", "token"],
|
|
145
|
+
CODEX: ["access_token", "accessToken"],
|
|
146
|
+
GEMINI_CLI: ["access_token", "accessToken"],
|
|
147
|
+
ANTIGRAVITY: ["access_token", "accessToken", "token"],
|
|
148
|
+
GROK: ["access_token", "accessToken", "key"],
|
|
149
|
+
KIMI: ["access_token", "accessToken"],
|
|
150
|
+
OPENROUTER: ["key", "api_key", "apiKey"]
|
|
151
|
+
};
|
|
152
|
+
const ACCOUNT_FIELDS = [
|
|
153
|
+
"chatgpt_account_id",
|
|
154
|
+
"account_id",
|
|
155
|
+
"accountId",
|
|
156
|
+
"user_id",
|
|
157
|
+
"userId"
|
|
158
|
+
];
|
|
159
|
+
const EXPIRY_FIELDS = [
|
|
160
|
+
"expiresAt",
|
|
161
|
+
"expires_at",
|
|
162
|
+
"expiry_date",
|
|
163
|
+
"expiry",
|
|
164
|
+
"expires"
|
|
165
|
+
];
|
|
166
|
+
/** The issuer a Grok credential file should be read under when it names one. */
|
|
167
|
+
export const GROK_PREFERRED_ISSUER = "https://auth.x.ai";
|
|
168
|
+
/**
|
|
169
|
+
* An expiry, whatever unit the document happened to state it in.
|
|
170
|
+
*
|
|
171
|
+
* Seconds, milliseconds and RFC3339 all appear across these six clients. A
|
|
172
|
+
* value below the seconds ceiling is read as seconds, which is the same rule
|
|
173
|
+
* every reset parser in this product already uses.
|
|
174
|
+
*/
|
|
175
|
+
export function expiryMilliseconds(value) {
|
|
176
|
+
if (typeof value === "number" && Number.isFinite(value) && value > 0) {
|
|
177
|
+
return value < 1e12 ? Math.round(value * 1_000) : Math.round(value);
|
|
178
|
+
}
|
|
179
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 64)
|
|
180
|
+
return null;
|
|
181
|
+
const trimmed = value.trim();
|
|
182
|
+
if (/^\d{9,14}$/u.test(trimmed)) {
|
|
183
|
+
return expiryMilliseconds(Number.parseInt(trimmed, 10));
|
|
184
|
+
}
|
|
185
|
+
const parsed = Date.parse(trimmed);
|
|
186
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Read one credential document that has already been parsed.
|
|
190
|
+
*
|
|
191
|
+
* Exported so a test can prove every shape without writing a file, and so the
|
|
192
|
+
* Windows Credential Manager path can reuse exactly the same reader for the
|
|
193
|
+
* envelope it gets back from the credential store.
|
|
194
|
+
*/
|
|
195
|
+
export function readCredentialDocument(provider, document, nowMilliseconds, origin = "vendor_file") {
|
|
196
|
+
const root = isRecord(document) ? document : null;
|
|
197
|
+
if (root === null)
|
|
198
|
+
return { ok: false, reason: "invalid" };
|
|
199
|
+
const containers = [];
|
|
200
|
+
for (const name of CONTAINERS[provider]) {
|
|
201
|
+
const nested = root[name];
|
|
202
|
+
if (isRecord(nested))
|
|
203
|
+
containers.push(nested);
|
|
204
|
+
}
|
|
205
|
+
containers.push(root);
|
|
206
|
+
/*
|
|
207
|
+
* Grok files seen in the wild key their credentials by issuer, because the
|
|
208
|
+
* client can hold a login from more than one. The issuer this product wants
|
|
209
|
+
* is named rather than guessed at, and a file with only one entry still
|
|
210
|
+
* reads through the ordinary path below.
|
|
211
|
+
*/
|
|
212
|
+
if (provider === "GROK") {
|
|
213
|
+
const issuers = isRecord(root["issuers"]) ? root["issuers"] : root;
|
|
214
|
+
const preferred = issuers[GROK_PREFERRED_ISSUER];
|
|
215
|
+
if (isRecord(preferred))
|
|
216
|
+
containers.unshift(preferred);
|
|
217
|
+
}
|
|
218
|
+
for (const container of containers) {
|
|
219
|
+
const secret = stringField(container, SECRET_FIELDS[provider]);
|
|
220
|
+
if (secret === null)
|
|
221
|
+
continue;
|
|
222
|
+
const expiry = expiryMilliseconds(EXPIRY_FIELDS.map((name) => container[name]).find((value) => value !== undefined) ?? root["expiresAt"] ?? root["expires_at"]);
|
|
223
|
+
if (expiry !== null && expiry <= nowMilliseconds) {
|
|
224
|
+
return { ok: false, reason: "expired" };
|
|
225
|
+
}
|
|
226
|
+
const accountId = stringField(container, ACCOUNT_FIELDS) ??
|
|
227
|
+
stringField(root, ACCOUNT_FIELDS);
|
|
228
|
+
return {
|
|
229
|
+
ok: true,
|
|
230
|
+
credential: {
|
|
231
|
+
secret,
|
|
232
|
+
accountId,
|
|
233
|
+
expiresAtMilliseconds: expiry,
|
|
234
|
+
origin
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
return { ok: false, reason: "invalid" };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Read the credential a provider's own client stored, from disk.
|
|
242
|
+
*
|
|
243
|
+
* The result is one of four things and never a mixture: a usable credential, a
|
|
244
|
+
* provider that is simply not installed here, a document that could not be
|
|
245
|
+
* believed, or a login that has run out. Nothing is refreshed and nothing is
|
|
246
|
+
* written back.
|
|
247
|
+
*/
|
|
248
|
+
export async function readAcquisitionCredential(provider, options = {}) {
|
|
249
|
+
const context = resolve(options);
|
|
250
|
+
const nowMilliseconds = Date.parse(options.now ?? new Date().toISOString());
|
|
251
|
+
const clock = Number.isFinite(nowMilliseconds) ? nowMilliseconds : Date.now();
|
|
252
|
+
if (provider === "ANTIGRAVITY" && context.platform === "win32") {
|
|
253
|
+
const reader = options.readWindowsCredential;
|
|
254
|
+
if (reader !== undefined) {
|
|
255
|
+
const stored = await reader(ANTIGRAVITY_CREDENTIAL_TARGET);
|
|
256
|
+
if (stored.ok) {
|
|
257
|
+
let parsed;
|
|
258
|
+
try {
|
|
259
|
+
parsed = JSON.parse(stored.value);
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
return { ok: false, reason: "invalid" };
|
|
263
|
+
}
|
|
264
|
+
return readCredentialDocument(provider, parsed, clock, "vendor_store");
|
|
265
|
+
}
|
|
266
|
+
/* A credential store that answered "not here" still lets the Gemini file
|
|
267
|
+
below stand in, which is what the Antigravity client itself falls back
|
|
268
|
+
to on a machine where the store was never written. */
|
|
269
|
+
if (stored.reason !== "absent")
|
|
270
|
+
return stored;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
let firstFailure = null;
|
|
274
|
+
for (const candidate of credentialCandidatePaths(provider, options)) {
|
|
275
|
+
const document = await readJsonFileSafely(candidate, MAX_CREDENTIAL_FILE_BYTES);
|
|
276
|
+
if (!document.ok) {
|
|
277
|
+
if (document.reason !== "missing" && firstFailure === null) {
|
|
278
|
+
firstFailure = "unreadable";
|
|
279
|
+
}
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
/* Antigravity reading the Gemini CLI's file is the shared Code Assist
|
|
283
|
+
quota, not Antigravity's own login, and the row has to say so. */
|
|
284
|
+
const result = readCredentialDocument(provider, document.value, clock, provider === "ANTIGRAVITY" ? "shared_code_assist" : "vendor_file");
|
|
285
|
+
if (result.ok)
|
|
286
|
+
return result;
|
|
287
|
+
if (firstFailure === null)
|
|
288
|
+
firstFailure = result.reason;
|
|
289
|
+
}
|
|
290
|
+
if (firstFailure !== null)
|
|
291
|
+
return { ok: false, reason: firstFailure };
|
|
292
|
+
/*
|
|
293
|
+
* Claude on macOS keeps its credential in the login keychain rather than in a
|
|
294
|
+
* file, and reading it would raise an authorization prompt in the middle of a
|
|
295
|
+
* status line render. That is a deliberate omission with a sentence attached,
|
|
296
|
+
* not a silent miss, so the row can say why the poll did not happen.
|
|
297
|
+
*/
|
|
298
|
+
if (provider === "CLAUDE" && context.platform === "darwin") {
|
|
299
|
+
return { ok: false, reason: "keychain_not_read" };
|
|
300
|
+
}
|
|
301
|
+
return { ok: false, reason: "absent" };
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* One sentence per failure, for the row a person actually reads.
|
|
305
|
+
*
|
|
306
|
+
* No dashes anywhere, and every sentence names the next step rather than the
|
|
307
|
+
* internal reason, because a person cannot act on the word "invalid".
|
|
308
|
+
*/
|
|
309
|
+
export const CREDENTIAL_FAILURE_SENTENCE = {
|
|
310
|
+
absent: "no local login found for this provider",
|
|
311
|
+
unreadable: "the local login file could not be read",
|
|
312
|
+
invalid: "the local login file was not in a shape this build understands",
|
|
313
|
+
expired: "the local login has expired, open the provider's own tool once to refresh it",
|
|
314
|
+
keychain_not_read: "the login is in the macOS keychain, which this command does not open"
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/acquire/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,aAAa;IACb,MAAM;IACN,MAAM;IACN,YAAY;CACJ,CAAC;AAIX,mEAAmE;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAgBhD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,cAAc;IACd,aAAa;IACb,oBAAoB;IACpB,UAAU;CACF,CAAC;AA4CX,SAAS,OAAO,CAAC,OAAgC;IAC/C,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ;QAC9C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG;QAC/C,IAA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AM,EAAE,mBAAmB,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACc;IACpD,MAAM,EAAE,wCAAwC;IAChD,UAAU,EAAE,wCAAwC;IACpD,OAAO,EAAE,gEAAgE;IACzE,OAAO,EAAE,8EAA8E;IACvF,iBAAiB,EACf,sEAAsE;CACzE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who OpenLimiter says it is on the wire.
|
|
3
|
+
*
|
|
4
|
+
* One string, one place, no exceptions. Every other quota monitor that reads a
|
|
5
|
+
* vendor CLI's token also copies that CLI's user agent, so the vendor cannot
|
|
6
|
+
* tell the two apart. That is impersonation, it is what the vendor terms
|
|
7
|
+
* actually forbid, and it is the one line a product with a company behind it
|
|
8
|
+
* may not cross. We identify as ourselves and accept whatever rate bucket that
|
|
9
|
+
* puts us in.
|
|
10
|
+
*
|
|
11
|
+
* The version is a constant rather than a read of package.json, because this
|
|
12
|
+
* module is bundled into a published package and a runtime file read would be
|
|
13
|
+
* one more thing that can fail inside a status line. A test holds it to the
|
|
14
|
+
* package's own version, so the constant cannot drift.
|
|
15
|
+
*/
|
|
16
|
+
/** The published version this build identifies as. */
|
|
17
|
+
export declare const ACQUISITION_CLIENT_VERSION = "1.3.1";
|
|
18
|
+
/** The only user agent any acquisition request may carry. */
|
|
19
|
+
export declare const OPENLIMITER_USER_AGENT: string;
|
|
20
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/acquire/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sDAAsD;AACtD,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB,QAC0C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who OpenLimiter says it is on the wire.
|
|
3
|
+
*
|
|
4
|
+
* One string, one place, no exceptions. Every other quota monitor that reads a
|
|
5
|
+
* vendor CLI's token also copies that CLI's user agent, so the vendor cannot
|
|
6
|
+
* tell the two apart. That is impersonation, it is what the vendor terms
|
|
7
|
+
* actually forbid, and it is the one line a product with a company behind it
|
|
8
|
+
* may not cross. We identify as ourselves and accept whatever rate bucket that
|
|
9
|
+
* puts us in.
|
|
10
|
+
*
|
|
11
|
+
* The version is a constant rather than a read of package.json, because this
|
|
12
|
+
* module is bundled into a published package and a runtime file read would be
|
|
13
|
+
* one more thing that can fail inside a status line. A test holds it to the
|
|
14
|
+
* package's own version, so the constant cannot drift.
|
|
15
|
+
*/
|
|
16
|
+
/** The published version this build identifies as. */
|
|
17
|
+
export const ACQUISITION_CLIENT_VERSION = "1.3.1";
|
|
18
|
+
/** The only user agent any acquisition request may carry. */
|
|
19
|
+
export const OPENLIMITER_USER_AGENT = "OpenLimiter/" + ACQUISITION_CLIENT_VERSION + " (+https://openlimiter.com)";
|
|
20
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/acquire/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sDAAsD;AACtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GACjC,cAAc,GAAG,0BAA0B,GAAG,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./cadence.js";
|
|
2
|
+
export * from "./coordination.js";
|
|
3
|
+
export * from "./credentials.js";
|
|
4
|
+
export * from "./identity.js";
|
|
5
|
+
export * from "./providers.js";
|
|
6
|
+
export * from "./runner.js";
|
|
7
|
+
export * from "./transport.js";
|
|
8
|
+
export * from "./windows-credential.js";
|
|
9
|
+
export * from "./antigravity-probe.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/acquire/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./cadence.js";
|
|
2
|
+
export * from "./coordination.js";
|
|
3
|
+
export * from "./credentials.js";
|
|
4
|
+
export * from "./identity.js";
|
|
5
|
+
export * from "./providers.js";
|
|
6
|
+
export * from "./runner.js";
|
|
7
|
+
export * from "./transport.js";
|
|
8
|
+
export * from "./windows-credential.js";
|
|
9
|
+
export * from "./antigravity-probe.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/acquire/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One acquisition specification per provider.
|
|
3
|
+
*
|
|
4
|
+
* Each is a credential source, a request or two, and the sentence its row
|
|
5
|
+
* carries. The parser is handed in by the caller, because the parsers live one
|
|
6
|
+
* package up. Nothing here decides whether a provider should be read: that is
|
|
7
|
+
* cadence, coordination and configuration, and they are separate on purpose.
|
|
8
|
+
*/
|
|
9
|
+
import type { RawMeter } from "../types.js";
|
|
10
|
+
import type { AcquiredCredential } from "./credentials.js";
|
|
11
|
+
import type { AcquisitionSpec, AcquisitionStep } from "./runner.js";
|
|
12
|
+
export type PayloadParser = (payload: unknown, now: string) => readonly RawMeter[] | null;
|
|
13
|
+
/**
|
|
14
|
+
* The sentence each row carries about how its number was obtained.
|
|
15
|
+
*
|
|
16
|
+
* Every one of these credentials was issued to somebody else's client. That is
|
|
17
|
+
* a thing a person is entitled to know before they rely on a bar, and it is the
|
|
18
|
+
* same thing every honest reader of these endpoints says, so it is said here
|
|
19
|
+
* once rather than implied.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ACQUISITION_DISCLOSURE: {
|
|
22
|
+
readonly claude: string;
|
|
23
|
+
readonly codex: "reads the login the Codex CLI stored, may break when OpenAI changes it";
|
|
24
|
+
readonly gemini: "reads the login the Gemini CLI stored, may break when Google changes it";
|
|
25
|
+
readonly antigravity: string;
|
|
26
|
+
readonly grok: string;
|
|
27
|
+
readonly antigravityShared: string;
|
|
28
|
+
readonly kimi: "reads the login the Kimi CLI stored, may break when Moonshot changes it";
|
|
29
|
+
readonly openrouter: "reads OpenRouter's documented key report with your own key";
|
|
30
|
+
};
|
|
31
|
+
/** What the Code Assist bootstrap calls the project the quota read is scoped to. */
|
|
32
|
+
export declare const CODE_ASSIST_PROJECT_FIELD = "cloudaicompanionProject";
|
|
33
|
+
/** The account label a reading taken from the shared Gemini login carries. */
|
|
34
|
+
export declare const SHARED_CODE_ASSIST_ACCOUNT = "gemini-cli-shared";
|
|
35
|
+
/** What a surface should print for that account instead of the identifier. */
|
|
36
|
+
export declare const SHARED_CODE_ASSIST_LABEL = "Shared Google Code Assist quota";
|
|
37
|
+
/** The list a bootstrap carries when it answered and withheld the project. */
|
|
38
|
+
export declare const CODE_ASSIST_TIERS_FIELD = "allowedTiers";
|
|
39
|
+
/**
|
|
40
|
+
* What the row says when Google withholds the companion project.
|
|
41
|
+
*
|
|
42
|
+
* Measured on 2026-09-07 on Lucas's own machine, read only: `loadCodeAssist`
|
|
43
|
+
* answered 200 to a request identifying as OpenLimiter and returned
|
|
44
|
+
* `allowedTiers` and `ineligibleTiers` and no `cloudaicompanionProject`, so
|
|
45
|
+
* there is nothing to scope the quota read to. The desktop reaches the same
|
|
46
|
+
* endpoint by claiming to be Google's own client
|
|
47
|
+
* (`apps/desktop/src-tauri/src/net.rs` 273 to 285 records exactly this), which
|
|
48
|
+
* Rule 1 forbids here. So the row states the fact rather than pretending the
|
|
49
|
+
* response was malformed.
|
|
50
|
+
*
|
|
51
|
+
* This conclusion is drawn ONLY from that measured signature. A day of silence
|
|
52
|
+
* bought on a guess would hide a provider that was merely having a bad
|
|
53
|
+
* afternoon, so anything else, a timeout, a 500, a rate limit, or a body that
|
|
54
|
+
* is not this, stays an ordinary transient failure on the ordinary cadence.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CODE_ASSIST_IDENTITY_SENTENCE: string;
|
|
57
|
+
/**
|
|
58
|
+
* The two step Code Assist read, shared by Gemini CLI and Antigravity.
|
|
59
|
+
*
|
|
60
|
+
* The second step is scoped to the project the first one named. A bootstrap
|
|
61
|
+
* that names no project produces no request, which the runner reads as a shape
|
|
62
|
+
* this build did not understand rather than as a reason to ask anyway.
|
|
63
|
+
*/
|
|
64
|
+
export declare function codeAssistSteps(): readonly AcquisitionStep[];
|
|
65
|
+
export interface ClaudeSpecOptions {
|
|
66
|
+
readonly parse: PayloadParser;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the poll is on.
|
|
69
|
+
*
|
|
70
|
+
* Off by default and off in every code path that does not read a
|
|
71
|
+
* configuration file. The documented status line payload is Claude's primary
|
|
72
|
+
* source; this poll only exists for the hours Claude Code is closed, and a
|
|
73
|
+
* person opts into it knowing what it does.
|
|
74
|
+
*/
|
|
75
|
+
readonly enabled: boolean;
|
|
76
|
+
}
|
|
77
|
+
export declare function claudeSpec(options: ClaudeSpecOptions): AcquisitionSpec;
|
|
78
|
+
export declare function codexSpec(parse: PayloadParser): AcquisitionSpec;
|
|
79
|
+
export declare function geminiCliSpec(parse: PayloadParser): AcquisitionSpec;
|
|
80
|
+
/** Whether this credential is the Gemini CLI's, borrowed for the shared quota. */
|
|
81
|
+
export declare function isSharedCodeAssist(credential: AcquiredCredential): boolean;
|
|
82
|
+
export declare function antigravitySpec(parse: PayloadParser): AcquisitionSpec;
|
|
83
|
+
export declare function grokSpec(parse: PayloadParser): AcquisitionSpec;
|
|
84
|
+
export declare function kimiSpec(parse: PayloadParser): AcquisitionSpec;
|
|
85
|
+
export declare function openrouterSpec(parse: PayloadParser): AcquisitionSpec;
|
|
86
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/acquire/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWpE,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,KACR,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;AAEhC;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;CAmBzB,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAE9D,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,oCAAoC,CA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