@openlimiter/connectors 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/antigravity.d.ts +25 -5
- package/dist/antigravity.d.ts.map +1 -1
- package/dist/antigravity.js +56 -25
- package/dist/antigravity.js.map +1 -1
- package/dist/claude.d.ts +59 -20
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +452 -53
- package/dist/claude.js.map +1 -1
- package/dist/codex.d.ts +3 -20
- package/dist/codex.d.ts.map +1 -1
- package/dist/codex.js +99 -18
- package/dist/codex.js.map +1 -1
- package/dist/contract-gate.d.ts +56 -0
- package/dist/contract-gate.d.ts.map +1 -0
- package/dist/contract-gate.js +100 -0
- package/dist/contract-gate.js.map +1 -0
- package/dist/fixtures.d.ts +19 -0
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/fixtures.js +213 -34
- package/dist/fixtures.js.map +1 -1
- package/dist/gemini-cli.d.ts +13 -0
- package/dist/gemini-cli.d.ts.map +1 -0
- package/dist/gemini-cli.js +86 -0
- package/dist/gemini-cli.js.map +1 -0
- package/dist/grok.d.ts +13 -0
- package/dist/grok.d.ts.map +1 -0
- package/dist/grok.js +143 -0
- package/dist/grok.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/kimi.d.ts +13 -0
- package/dist/kimi.d.ts.map +1 -0
- package/dist/kimi.js +141 -0
- package/dist/kimi.js.map +1 -0
- package/dist/manual.d.ts +3 -1
- package/dist/manual.d.ts.map +1 -1
- package/dist/manual.js +6 -3
- package/dist/manual.js.map +1 -1
- package/dist/opencode.d.ts +47 -7
- package/dist/opencode.d.ts.map +1 -1
- package/dist/opencode.js +203 -67
- package/dist/opencode.js.map +1 -1
- package/dist/openrouter.d.ts +3 -1
- package/dist/openrouter.d.ts.map +1 -1
- package/dist/openrouter.js +6 -3
- package/dist/openrouter.js.map +1 -1
- package/dist/shared.d.ts +17 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +24 -0
- package/dist/shared.js.map +1 -1
- package/package.json +4 -3
package/dist/codex.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { boundedNumber, futureInstantFromEpochSeconds, plausibleResetHorizon, rawMeter, record, shortExpiry, windowSeconds } from "./shared.js";
|
|
1
|
+
import { boundedNumber, connectorConnection, futureInstantFromEpochSeconds, instantAfter, plausibleResetHorizon, rawMeter, record, shortExpiry, windowSeconds } from "./shared.js";
|
|
2
2
|
/**
|
|
3
3
|
* The Codex usage reader.
|
|
4
4
|
*
|
|
@@ -44,26 +44,102 @@ export const codexEncoding = "json";
|
|
|
44
44
|
* called rolling, so it is reported as an unknown window rather than as a five
|
|
45
45
|
* hour one this build made up.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* window
|
|
50
|
-
*
|
|
47
|
+
* Every window carried in the rate limit object is parsed into its own meter,
|
|
48
|
+
* identified by its own `limit_window_seconds`. Plans may carry a weekly
|
|
49
|
+
* primary window, a secondary window, or model-specific buckets, and ignoring
|
|
50
|
+
* any window would present a partial picture of the user's quota.
|
|
51
51
|
*/
|
|
52
|
+
/**
|
|
53
|
+
* The meter id for a window, from its length rather than its name.
|
|
54
|
+
*
|
|
55
|
+
* The two lengths that have names here are the two a reader elsewhere already
|
|
56
|
+
* uses, so a five hour Codex window and a five hour Claude window are called the
|
|
57
|
+
* same thing and the dashboard can group them. Anything else keeps its own key,
|
|
58
|
+
* uppercased, which is enough to keep two windows apart without inventing a
|
|
59
|
+
* vocabulary for buckets we have not seen yet.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* A reset stated as a countdown rather than as an instant.
|
|
63
|
+
*
|
|
64
|
+
* Some responses carry `reset_after_seconds` where others carry `reset_at`, and
|
|
65
|
+
* a reader that knows only the second reports no countdown at all against the
|
|
66
|
+
* first. The countdown is turned into an instant against the supplied clock and
|
|
67
|
+
* held to the same plausibility bound the instant form is held to, so a window
|
|
68
|
+
* cannot claim to reset years after the window it belongs to has ended.
|
|
69
|
+
*
|
|
70
|
+
* Zero and negative are refused rather than read as now: a window that reset in
|
|
71
|
+
* the past says nothing about the window running now.
|
|
72
|
+
*/
|
|
73
|
+
function resetFromCountdown(value, now, lengthSeconds) {
|
|
74
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
|
|
75
|
+
return null;
|
|
76
|
+
const horizon = lengthSeconds === null ? null : plausibleResetHorizon(lengthSeconds);
|
|
77
|
+
if (horizon !== null && value > horizon)
|
|
78
|
+
return null;
|
|
79
|
+
return instantAfter(now, value);
|
|
80
|
+
}
|
|
81
|
+
function meterIdFor(lengthSeconds, windowKey) {
|
|
82
|
+
if (lengthSeconds === 18_000)
|
|
83
|
+
return "FIVE_HOUR";
|
|
84
|
+
if (lengthSeconds === 604_800)
|
|
85
|
+
return "SEVEN_DAY";
|
|
86
|
+
return windowKey.replace(/_window$/, "").toUpperCase();
|
|
87
|
+
}
|
|
52
88
|
export function parseCodexPayload(payload, now) {
|
|
53
89
|
const root = record(payload);
|
|
54
90
|
const limits = record(root?.["rate_limit"]);
|
|
55
|
-
|
|
56
|
-
const percent = boundedNumber(primary?.["used_percent"]);
|
|
57
|
-
if (percent === null)
|
|
58
|
-
return null;
|
|
59
|
-
const length = windowSeconds(primary?.["limit_window_seconds"]);
|
|
60
|
-
const resetAt = futureInstantFromEpochSeconds(primary?.["reset_at"], now, length === null ? undefined : plausibleResetHorizon(length));
|
|
61
|
-
const expiresAt = shortExpiry(now);
|
|
62
|
-
if (resetAt === null || expiresAt === null)
|
|
91
|
+
if (limits === null)
|
|
63
92
|
return null;
|
|
64
|
-
|
|
93
|
+
const meters = [];
|
|
94
|
+
for (const windowKey of Object.keys(limits)) {
|
|
95
|
+
if (!windowKey.endsWith("_window"))
|
|
96
|
+
continue;
|
|
97
|
+
const windowRecord = record(limits[windowKey]);
|
|
98
|
+
if (windowRecord === null)
|
|
99
|
+
continue;
|
|
100
|
+
const percent = boundedNumber(windowRecord["used_percent"]);
|
|
101
|
+
if (percent === null)
|
|
102
|
+
continue;
|
|
103
|
+
const length = windowSeconds(windowRecord["limit_window_seconds"]);
|
|
104
|
+
/*
|
|
105
|
+
* A window may arrive with no reset_at at all. The reference reader emits
|
|
106
|
+
* exactly that: it passes `pw.get("reset_at")` straight through, which is
|
|
107
|
+
* null when the field is absent, and it still renders the percent. Dropping
|
|
108
|
+
* such a window silently discards a real reading, which is a worse failure
|
|
109
|
+
* than a missing countdown: the number the provider actually stated would
|
|
110
|
+
* vanish. So an ABSENT reset_at keeps the window with an unknown reset time,
|
|
111
|
+
* meaning resetAt stays null and the surface shows the percent with no
|
|
112
|
+
* countdown.
|
|
113
|
+
*
|
|
114
|
+
* A reset_at that is PRESENT but unreadable is a different thing. A reset in
|
|
115
|
+
* milliseconds, in the past, past its plausible horizon, or in the wrong
|
|
116
|
+
* type is drift, not an absence, and it still drops the window. A corrupt
|
|
117
|
+
* reset is not the same as no reset, and only the corrupt one is refused.
|
|
118
|
+
*/
|
|
119
|
+
const resetProvided = windowRecord["reset_at"] !== undefined && windowRecord["reset_at"] !== null;
|
|
120
|
+
const countdownProvided = windowRecord["reset_after_seconds"] !== undefined &&
|
|
121
|
+
windowRecord["reset_after_seconds"] !== null;
|
|
122
|
+
/* The instant form wins when both are present. It is absolute, so it
|
|
123
|
+
survives a slow response and a clock this machine reads differently,
|
|
124
|
+
while a countdown is only true at the moment it was written. */
|
|
125
|
+
const resetAt = resetProvided
|
|
126
|
+
? futureInstantFromEpochSeconds(windowRecord["reset_at"], now, length === null ? undefined : plausibleResetHorizon(length))
|
|
127
|
+
: countdownProvided
|
|
128
|
+
? resetFromCountdown(windowRecord["reset_after_seconds"], now, length)
|
|
129
|
+
: null;
|
|
130
|
+
const expiresAt = shortExpiry(now);
|
|
131
|
+
if (expiresAt === null)
|
|
132
|
+
continue;
|
|
133
|
+
if ((resetProvided || countdownProvided) && resetAt === null)
|
|
134
|
+
continue;
|
|
135
|
+
meters.push(rawMeter({
|
|
65
136
|
provider: "CODEX",
|
|
66
|
-
|
|
137
|
+
// Named by the window's OWN length, never by its position in the
|
|
138
|
+
// payload. Codex can report the bucket it calls "primary" as a weekly
|
|
139
|
+
// one, so naming from the key would put a seven day number under a
|
|
140
|
+
// label that reads like a session. Two windows sharing one id was the
|
|
141
|
+
// first version of this fix and it collided them into one meter.
|
|
142
|
+
meter: meterIdFor(length, windowKey),
|
|
67
143
|
value: percent,
|
|
68
144
|
window: length === null
|
|
69
145
|
? { kind: "unknown" }
|
|
@@ -74,8 +150,12 @@ export function parseCodexPayload(payload, now) {
|
|
|
74
150
|
observedAt: now,
|
|
75
151
|
expiresAt,
|
|
76
152
|
labels: codexLabels
|
|
77
|
-
})
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
return meters.length === 0 ? null : meters;
|
|
78
156
|
}
|
|
157
|
+
/** The local application that owns this credential. */
|
|
158
|
+
export const CODEX_TOOL = "Codex CLI";
|
|
79
159
|
export const codexConnector = {
|
|
80
160
|
id: "codex",
|
|
81
161
|
displayName: "Codex",
|
|
@@ -86,9 +166,10 @@ export const codexConnector = {
|
|
|
86
166
|
},
|
|
87
167
|
async read(context) {
|
|
88
168
|
const meters = parseCodexPayload(context.payload, context.now);
|
|
169
|
+
const connection = connectorConnection(meters !== null, context.payload, CODEX_TOOL);
|
|
89
170
|
return meters === null
|
|
90
|
-
? { ok: false, reason: "unknown" }
|
|
91
|
-
: { ok: true, meters };
|
|
171
|
+
? { ok: false, reason: "unknown", connection }
|
|
172
|
+
: { ok: true, meters, connection };
|
|
92
173
|
}
|
|
93
174
|
};
|
|
94
175
|
//# sourceMappingURL=codex.js.map
|
package/dist/codex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version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AM,EAAE,WAAW;IACnB,MAAM,CAAC,WAAW;QAChB,OAAO,WAAW,CAAC,qBAAqB,CAAC,KAAK,GAAG,CAAC;IACpD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/D,MAAM,UAAU,GAAG,mBAAmB,CACpC,MAAM,KAAK,IAAI,EACf,OAAO,CAAC,OAAO,EACf,UAAU,CACX,CAAC;QACF,OAAO,MAAM,KAAK,IAAI;YACpB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE;YAC9C,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IACvC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime contract gate.
|
|
3
|
+
*
|
|
4
|
+
* Every parser in this package already answers null when a provider response
|
|
5
|
+
* does not match the shape it was told to read. Null is the right answer, but
|
|
6
|
+
* on its own it is easy to drop on the floor: a caller that maps a provider to
|
|
7
|
+
* null and then filters nulls away makes the provider VANISH from the interface,
|
|
8
|
+
* which reads as "this provider was never configured" rather than the truth,
|
|
9
|
+
* "this provider answered and we could not believe the answer".
|
|
10
|
+
*
|
|
11
|
+
* This gate closes that gap. It takes a provider and a raw response and always
|
|
12
|
+
* returns an EXPLICIT tagged outcome, never null and never a bare list:
|
|
13
|
+
*
|
|
14
|
+
* { status: "ok", provider, meters } the shape matched and at least
|
|
15
|
+
* one reading is believable
|
|
16
|
+
* { status: "unknown", provider, reason } the response did not match, so
|
|
17
|
+
* the provider is VISIBLY unknown
|
|
18
|
+
*
|
|
19
|
+
* The unknown branch carries the provider it belongs to and a reason, so a
|
|
20
|
+
* caller and the UI can render a provider whose number is unknown rather than
|
|
21
|
+
* hide the provider or, worse, show a number the parser never produced. There
|
|
22
|
+
* is no third outcome: a shape the gate cannot read is unknown, never a guess.
|
|
23
|
+
*
|
|
24
|
+
* The gate reuses the parsers and the core normalizer unchanged. It decides
|
|
25
|
+
* nothing about the shape of a reading itself; it only turns a refusal into a
|
|
26
|
+
* value a caller cannot accidentally discard.
|
|
27
|
+
*/
|
|
28
|
+
import { type ProviderCode, type RawMeter } from "@openlimiter/core";
|
|
29
|
+
/** Why a provider is unknown, in a closed vocabulary a surface can switch on. */
|
|
30
|
+
export type ContractUnknownReason = "no_payload" | "unknown_provider" | "shape_mismatch" | "no_believable_meter";
|
|
31
|
+
export type ContractOutcome = {
|
|
32
|
+
status: "ok";
|
|
33
|
+
provider: ProviderCode;
|
|
34
|
+
meters: readonly RawMeter[];
|
|
35
|
+
} | {
|
|
36
|
+
status: "unknown";
|
|
37
|
+
provider: ProviderCode;
|
|
38
|
+
reason: ContractUnknownReason;
|
|
39
|
+
};
|
|
40
|
+
/** One human sentence per unknown reason, for a surface that wants to say why. */
|
|
41
|
+
export declare const contractUnknownSentence: Readonly<Record<ContractUnknownReason, string>>;
|
|
42
|
+
/**
|
|
43
|
+
* Run a provider response through its parser and return an explicit outcome.
|
|
44
|
+
*
|
|
45
|
+
* `payload` is whatever was read for the provider: a parsed JSON object for
|
|
46
|
+
* every provider except OpenCode, whose payload is the raw HTML string. A
|
|
47
|
+
* missing payload is unknown, a shape the parser refuses is unknown, and a
|
|
48
|
+
* shape that parses but survives normalization as nothing is unknown. Only a
|
|
49
|
+
* response that both parses and yields at least one believable reading is ok.
|
|
50
|
+
*/
|
|
51
|
+
export declare function checkProviderContract(provider: ProviderCode, payload: unknown, now: string): ContractOutcome;
|
|
52
|
+
/** Whether an outcome is the visible unknown state, for a caller that branches. */
|
|
53
|
+
export declare function isContractUnknown(outcome: ContractOutcome): outcome is Extract<ContractOutcome, {
|
|
54
|
+
status: "unknown";
|
|
55
|
+
}>;
|
|
56
|
+
//# sourceMappingURL=contract-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-gate.d.ts","sourceRoot":"","sources":["../src/contract-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,QAAQ,EAEd,MAAM,mBAAmB,CAAC;AAW3B,iFAAiF;AACjF,MAAM,MAAM,qBAAqB,GAC7B,YAAY,GACZ,kBAAkB,GAClB,gBAAgB,GAChB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,GACrE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAyBjF,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CASnF,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,eAAe,CAmBjB;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,eAAe,GACvB,OAAO,IAAI,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC,CAE5D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime contract gate.
|
|
3
|
+
*
|
|
4
|
+
* Every parser in this package already answers null when a provider response
|
|
5
|
+
* does not match the shape it was told to read. Null is the right answer, but
|
|
6
|
+
* on its own it is easy to drop on the floor: a caller that maps a provider to
|
|
7
|
+
* null and then filters nulls away makes the provider VANISH from the interface,
|
|
8
|
+
* which reads as "this provider was never configured" rather than the truth,
|
|
9
|
+
* "this provider answered and we could not believe the answer".
|
|
10
|
+
*
|
|
11
|
+
* This gate closes that gap. It takes a provider and a raw response and always
|
|
12
|
+
* returns an EXPLICIT tagged outcome, never null and never a bare list:
|
|
13
|
+
*
|
|
14
|
+
* { status: "ok", provider, meters } the shape matched and at least
|
|
15
|
+
* one reading is believable
|
|
16
|
+
* { status: "unknown", provider, reason } the response did not match, so
|
|
17
|
+
* the provider is VISIBLY unknown
|
|
18
|
+
*
|
|
19
|
+
* The unknown branch carries the provider it belongs to and a reason, so a
|
|
20
|
+
* caller and the UI can render a provider whose number is unknown rather than
|
|
21
|
+
* hide the provider or, worse, show a number the parser never produced. There
|
|
22
|
+
* is no third outcome: a shape the gate cannot read is unknown, never a guess.
|
|
23
|
+
*
|
|
24
|
+
* The gate reuses the parsers and the core normalizer unchanged. It decides
|
|
25
|
+
* nothing about the shape of a reading itself; it only turns a refusal into a
|
|
26
|
+
* value a caller cannot accidentally discard.
|
|
27
|
+
*/
|
|
28
|
+
import { normalizeMeters } from "@openlimiter/core";
|
|
29
|
+
import { parseAntigravityPayload } from "./antigravity.js";
|
|
30
|
+
import { parseClaudePayload } from "./claude.js";
|
|
31
|
+
import { parseCodexPayload } from "./codex.js";
|
|
32
|
+
import { parseGeminiCliPayload } from "./gemini-cli.js";
|
|
33
|
+
import { parseGrokPayload } from "./grok.js";
|
|
34
|
+
import { parseKimiPayload } from "./kimi.js";
|
|
35
|
+
import { parseManualPayload } from "./manual.js";
|
|
36
|
+
import { parseOpencodePayload } from "./opencode.js";
|
|
37
|
+
import { parseOpenrouterPayload } from "./openrouter.js";
|
|
38
|
+
/**
|
|
39
|
+
* The one parser each provider's response is allowed to reach.
|
|
40
|
+
*
|
|
41
|
+
* Closed to known provider codes. A provider with no generic payload parser
|
|
42
|
+
* here is not defaulted to a neighbour's; it is unknown, for the same reason
|
|
43
|
+
* the parsers themselves carry no fallback. Native collectors may write
|
|
44
|
+
* already normalized snapshots without exposing their private payload to this
|
|
45
|
+
* generic boundary.
|
|
46
|
+
*/
|
|
47
|
+
const PARSER_BY_PROVIDER = {
|
|
48
|
+
CLAUDE: parseClaudePayload,
|
|
49
|
+
OPENROUTER: parseOpenrouterPayload,
|
|
50
|
+
CODEX: parseCodexPayload,
|
|
51
|
+
ANTIGRAVITY: parseAntigravityPayload,
|
|
52
|
+
GEMINI_CLI: parseGeminiCliPayload,
|
|
53
|
+
OPENCODE: parseOpencodePayload,
|
|
54
|
+
GROK: parseGrokPayload,
|
|
55
|
+
KIMI: parseKimiPayload,
|
|
56
|
+
MANUAL: parseManualPayload
|
|
57
|
+
};
|
|
58
|
+
/** One human sentence per unknown reason, for a surface that wants to say why. */
|
|
59
|
+
export const contractUnknownSentence = {
|
|
60
|
+
no_payload: "No response was read, so this provider's usage is unknown.",
|
|
61
|
+
unknown_provider: "This build has no reader for this provider, so its usage is unknown.",
|
|
62
|
+
shape_mismatch: "The provider answered, but not in a shape this build understands, so its " +
|
|
63
|
+
"usage is unknown rather than guessed.",
|
|
64
|
+
no_believable_meter: "The provider answered, but nothing in the answer was a usage reading this " +
|
|
65
|
+
"build could believe, so its usage is unknown."
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Run a provider response through its parser and return an explicit outcome.
|
|
69
|
+
*
|
|
70
|
+
* `payload` is whatever was read for the provider: a parsed JSON object for
|
|
71
|
+
* every provider except OpenCode, whose payload is the raw HTML string. A
|
|
72
|
+
* missing payload is unknown, a shape the parser refuses is unknown, and a
|
|
73
|
+
* shape that parses but survives normalization as nothing is unknown. Only a
|
|
74
|
+
* response that both parses and yields at least one believable reading is ok.
|
|
75
|
+
*/
|
|
76
|
+
export function checkProviderContract(provider, payload, now) {
|
|
77
|
+
const parser = PARSER_BY_PROVIDER[provider];
|
|
78
|
+
if (parser === undefined) {
|
|
79
|
+
return { status: "unknown", provider, reason: "unknown_provider" };
|
|
80
|
+
}
|
|
81
|
+
if (payload === undefined || payload === null) {
|
|
82
|
+
return { status: "unknown", provider, reason: "no_payload" };
|
|
83
|
+
}
|
|
84
|
+
const meters = parser(payload, now);
|
|
85
|
+
if (meters === null) {
|
|
86
|
+
return { status: "unknown", provider, reason: "shape_mismatch" };
|
|
87
|
+
}
|
|
88
|
+
/* A shape can parse and still carry nothing believable once the core
|
|
89
|
+
normalizer has its say. That is unknown too, and stating it here stops a
|
|
90
|
+
caller from treating an empty but non null list as a silent success. */
|
|
91
|
+
if (normalizeMeters(meters).length === 0) {
|
|
92
|
+
return { status: "unknown", provider, reason: "no_believable_meter" };
|
|
93
|
+
}
|
|
94
|
+
return { status: "ok", provider, meters };
|
|
95
|
+
}
|
|
96
|
+
/** Whether an outcome is the visible unknown state, for a caller that branches. */
|
|
97
|
+
export function isContractUnknown(outcome) {
|
|
98
|
+
return outcome.status === "unknown";
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=contract-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-gate.js","sourceRoot":"","sources":["../src/contract-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAGL,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBA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AAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,iBAAiB,CAC/B,OAAwB;IAExB,OAAO,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AACtC,CAAC"}
|
package/dist/fixtures.d.ts
CHANGED
|
@@ -32,6 +32,9 @@ export declare const FIXTURE_NOW = "2026-01-01T00:00:00.000Z";
|
|
|
32
32
|
export declare const CLAUDE_STATUSLINE_DOCS_URL = "https://code.claude.com/docs/en/statusline";
|
|
33
33
|
/** Docs URL for the one remote interface with a published response shape. */
|
|
34
34
|
export declare const OPENROUTER_CREDITS_DOCS_URL = "https://openrouter.ai/docs/api-reference/get-credits";
|
|
35
|
+
export declare const GROK_BILLING_SOURCE_URL = "https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-shell/src/extensions/billing.rs";
|
|
36
|
+
export declare const KIMI_USAGE_SOURCE_URL = "https://github.com/MoonshotAI/kimi-code/blob/main/packages/oauth/src/managed-usage.ts";
|
|
37
|
+
export declare const GEMINI_CLI_QUOTA_SOURCE_URL = "https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/code_assist/server.ts";
|
|
35
38
|
/** The day a human last read both pages above against this file. */
|
|
36
39
|
export declare const FIXTURE_REVIEWED_AT = "2026-08-10";
|
|
37
40
|
/**
|
|
@@ -67,6 +70,17 @@ export declare function openrouterFixture(): Record<string, unknown>;
|
|
|
67
70
|
* read 51.
|
|
68
71
|
*/
|
|
69
72
|
export declare function codexFixture(now?: string): Record<string, unknown>;
|
|
73
|
+
/**
|
|
74
|
+
* A Codex window that states a percent and no reset time at all.
|
|
75
|
+
*
|
|
76
|
+
* The reference reader passes `reset_at` straight through, so when the provider
|
|
77
|
+
* omits it the window arrives with a real percent and no countdown. This is a
|
|
78
|
+
* separate builder rather than a change to `codexFixture` above, so the demo
|
|
79
|
+
* numbers and every existing expectation stay exactly as they were, and the
|
|
80
|
+
* no reset case gets its own fixture to exercise. The window keeps its length,
|
|
81
|
+
* so it still names itself FIVE_HOUR; the only thing missing is the reset.
|
|
82
|
+
*/
|
|
83
|
+
export declare function codexNoResetFixture(now?: string): Record<string, unknown>;
|
|
70
84
|
/**
|
|
71
85
|
* The Antigravity demo payload, in the observed shape.
|
|
72
86
|
*
|
|
@@ -79,6 +93,9 @@ export declare function codexFixture(now?: string): Record<string, unknown>;
|
|
|
79
93
|
* `remainingFraction` is what the provider states, so 0.72 remaining is 28 used.
|
|
80
94
|
*/
|
|
81
95
|
export declare function antigravityFixture(now?: string): Record<string, unknown>;
|
|
96
|
+
export declare function geminiCliFixture(now?: string): Record<string, unknown>;
|
|
97
|
+
export declare function grokFixture(now?: string): Record<string, unknown>;
|
|
98
|
+
export declare function kimiFixture(now?: string): Record<string, unknown>;
|
|
82
99
|
/**
|
|
83
100
|
* The one fixture in the red band.
|
|
84
101
|
*
|
|
@@ -278,6 +295,8 @@ export declare const antigravitySanitizedLive: SanitizedLiveFixture;
|
|
|
278
295
|
* much evidence has been gathered about it.
|
|
279
296
|
*/
|
|
280
297
|
export declare const opencodeSanitizedLive: SanitizedLiveFixture;
|
|
298
|
+
export declare const grokSanitizedLive: SanitizedLiveFixture;
|
|
299
|
+
export declare const kimiSanitizedLive: SanitizedLiveFixture;
|
|
281
300
|
export declare function rebuildCodexCapture(capture: unknown, now: string): unknown;
|
|
282
301
|
export declare function rebuildAntigravityCapture(capture: unknown, now: string): unknown;
|
|
283
302
|
export declare function rebuildOpencodeCapture(capture: unknown, now: string): unknown;
|
package/dist/fixtures.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"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