@openlimiter/connectors 2.0.3 → 2.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,83 +1,19 @@
1
1
  import type { ConnectionTool, ConnectorContract, RawMeter } from "@openlimiter/core";
2
- /**
3
- * The Antigravity quota reader.
4
- *
5
- * The shape below is the one a working reader observed against a real Google AI
6
- * Pro account on 2026-08-07, recorded in
7
- * `Product Idea/reference-implementation`. Design evidence, not verification
8
- * evidence: Google publishes nothing about this surface, so the provider stays
9
- * UNVERIFIED whatever we observe.
10
- *
11
- * The response is not a percentage in a field. It is a list of GROUPS, each
12
- * holding a list of BUCKETS, each bucket carrying `remainingFraction` between
13
- * zero and one, a window name, and an RFC3339 reset. Usage is one minus that
14
- * fraction. The reader used to parse `quota.used_percent`, a shape from an
15
- * early prototype that has never been seen on the wire.
16
- */
2
+ /** Antigravity documents this payload as the standard input to its status line. */
17
3
  export declare const antigravityLabels: {
18
4
  readonly credentialOrigin: "official-local-tool";
19
- readonly dataInterfaceStatus: "internal-endpoint";
20
- readonly automationRisk: "high";
5
+ readonly dataInterfaceStatus: "native-statusline-payload";
6
+ readonly automationRisk: "low";
21
7
  readonly verification: "UNVERIFIED";
22
8
  };
23
9
  export declare const antigravityInput: {
24
- readonly kind: "provider_managed_payload";
25
- readonly pathTemplate: "{providerState}/quota.json";
10
+ readonly kind: "native_statusline_payload";
11
+ readonly pathTemplate: "standard input";
26
12
  readonly readMode: "read_only";
27
13
  };
28
- /** What this reader reads. JSON, because the endpoint answers JSON. */
29
14
  export declare const antigravityEncoding: "json";
30
- /**
31
- * The bucket prefix naming the pool this provider tracks.
32
- *
33
- * Matched against the prefix of `bucketId` EXACTLY, never as a substring. A
34
- * hypothetical `3p-gemini-fallback` bucket would satisfy a naive containment
35
- * test and let a third party pool overwrite the real one, which is a wrong
36
- * number rather than a missing one.
37
- */
38
- export declare const ANTIGRAVITY_TRACKED_POOL = "gemini";
39
- /**
40
- * The window names this build understands, and how long each one is.
41
- *
42
- * Google spells them "5h" and "weekly". A window name outside this table is not
43
- * dropped: the whole payload is refused. Dropping it would remove a window that
44
- * might be the binding one and leave the meter confidently reporting a LOWER
45
- * number than the truth, which is the exact failure this product exists to
46
- * prevent.
47
- */
48
- export declare const ANTIGRAVITY_WINDOWS: Readonly<Record<string, number>>;
49
- /**
50
- * Every documented window in the tracked pool, as its own meter.
51
- *
52
- * The shell may still derive one binding percentage for advice and the tray,
53
- * but the dashboard must not discard the other window to get there.
54
- *
55
- * The third party pool that rides the same subscription is deliberately not
56
- * modelled. It is a real second wallet, and reporting it under this provider's
57
- * single meter would conflate two pools into one number. It needs its own
58
- * identity in the registry before it can have one here.
59
- */
60
- export declare function parseAntigravityPayload(payload: unknown, now: string): RawMeter[] | null;
61
- /**
62
- * The same Code Assist quota document, read under this provider's name.
63
- *
64
- * Antigravity and Gemini CLI sit on one Google Code Assist backend and answer
65
- * the same per model quota shape, so `parseGeminiCliPayload` above already
66
- * knows how to read it. What differs is WHOSE credential asked and therefore
67
- * which row a person is looking at, and that is a provider code, not a parser.
68
- *
69
- * The rename is exact rather than approximate: the two label sets are field for
70
- * field identical, so nothing about the reading's honesty changes when the
71
- * provider does. Duplicating the bucket reader to achieve the same thing would
72
- * mean two parsers to keep in step with one backend, which is how one of them
73
- * ends up silently behind.
74
- *
75
- * This is the shape the network path reads. The group and bucket summary the
76
- * `parseAntigravityPayload` reader above handles is a different document from
77
- * the same family and stays exactly as it was.
78
- */
79
- export declare function parseAntigravityCodeAssistPayload(payload: unknown, now: string): RawMeter[] | null;
80
- /** The local application that owns this credential. */
15
+ /** Parse only the documented quota map. Unknown bucket identities are omitted. */
16
+ export declare function parseAntigravityPayload(payload: unknown, observedAt: string): RawMeter[] | null;
81
17
  export declare const ANTIGRAVITY_TOOL: ConnectionTool;
82
18
  export declare const antigravityConnector: ConnectorContract;
83
19
  //# sourceMappingURL=antigravity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../src/antigravity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAGjB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAY3B;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,iBAAiB;;;;;CAKM,CAAC;AAErC,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAG,MAAe,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGhE,CAAC;AA6DF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,QAAQ,EAAE,GAAG,IAAI,CAkCnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,QAAQ,EAAE,GAAG,IAAI,CAQnB;AAED,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,EAAE,cAA8B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,EAAE,iBAmBlC,CAAC"}
1
+ {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../src/antigravity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAGjB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAI3B,mFAAmF;AACnF,eAAO,MAAM,iBAAiB;;;;;CAKM,CAAC;AAErC,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAG,MAAe,CAAC;AAuBnD,kFAAkF;AAClF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI,CA0B/F;AAED,eAAO,MAAM,gBAAgB,EAAE,cAA8B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,EAAE,iBAelC,CAAC"}
@@ -1,201 +1,75 @@
1
- import { parseGeminiCliPayload } from "./gemini-cli.js";
2
- import { boundedFraction, connectorConnection, futureInstantFromRfc3339, plausibleResetHorizon, rawMeter, record, shortExpiry } from "./shared.js";
3
- /**
4
- * The Antigravity quota reader.
5
- *
6
- * The shape below is the one a working reader observed against a real Google AI
7
- * Pro account on 2026-08-07, recorded in
8
- * `Product Idea/reference-implementation`. Design evidence, not verification
9
- * evidence: Google publishes nothing about this surface, so the provider stays
10
- * UNVERIFIED whatever we observe.
11
- *
12
- * The response is not a percentage in a field. It is a list of GROUPS, each
13
- * holding a list of BUCKETS, each bucket carrying `remainingFraction` between
14
- * zero and one, a window name, and an RFC3339 reset. Usage is one minus that
15
- * fraction. The reader used to parse `quota.used_percent`, a shape from an
16
- * early prototype that has never been seen on the wire.
17
- */
1
+ import { antigravityMeter } from "@openlimiter/core";
2
+ import { connectorConnection, rawMeter, record, shortExpiry } from "./shared.js";
3
+ /** Antigravity documents this payload as the standard input to its status line. */
18
4
  export const antigravityLabels = {
19
5
  credentialOrigin: "official-local-tool",
20
- dataInterfaceStatus: "internal-endpoint",
21
- automationRisk: "high",
6
+ dataInterfaceStatus: "native-statusline-payload",
7
+ automationRisk: "low",
22
8
  verification: "UNVERIFIED"
23
9
  };
24
10
  export const antigravityInput = {
25
- kind: "provider_managed_payload",
26
- pathTemplate: "{providerState}/quota.json",
11
+ kind: "native_statusline_payload",
12
+ pathTemplate: "standard input",
27
13
  readMode: "read_only"
28
14
  };
29
- /** What this reader reads. JSON, because the endpoint answers JSON. */
30
15
  export const antigravityEncoding = "json";
31
- /**
32
- * The bucket prefix naming the pool this provider tracks.
33
- *
34
- * Matched against the prefix of `bucketId` EXACTLY, never as a substring. A
35
- * hypothetical `3p-gemini-fallback` bucket would satisfy a naive containment
36
- * test and let a third party pool overwrite the real one, which is a wrong
37
- * number rather than a missing one.
38
- */
39
- export const ANTIGRAVITY_TRACKED_POOL = "gemini";
40
- /**
41
- * The window names this build understands, and how long each one is.
42
- *
43
- * Google spells them "5h" and "weekly". A window name outside this table is not
44
- * dropped: the whole payload is refused. Dropping it would remove a window that
45
- * might be the binding one and leave the meter confidently reporting a LOWER
46
- * number than the truth, which is the exact failure this product exists to
47
- * prevent.
48
- */
49
- export const ANTIGRAVITY_WINDOWS = {
50
- "5h": 18_000,
51
- weekly: 604_800
52
- };
53
- /**
54
- * Every bucket of one group, or null if any one of them cannot be believed.
55
- *
56
- * Whole rather than per bucket, for the reason above: a partially read group is
57
- * a group whose worst window may be the one that failed to read.
58
- */
59
- function readBuckets(buckets, now) {
60
- const windows = [];
61
- for (const entry of buckets) {
62
- const bucket = record(entry);
63
- if (bucket === null)
64
- return null;
65
- const fraction = boundedFraction(bucket["remainingFraction"]);
66
- if (fraction === null)
67
- return null;
68
- const name = bucket["window"];
69
- if (typeof name !== "string")
70
- return null;
71
- const seconds = ANTIGRAVITY_WINDOWS[name.toLowerCase()];
72
- if (seconds === undefined)
73
- return null;
74
- const resetAt = futureInstantFromRfc3339(bucket["resetTime"], now, plausibleResetHorizon(seconds));
75
- if (resetAt === null)
76
- return null;
77
- /* One decimal, which is the precision the reference reader keeps and more
78
- than a quota bar can show. Clamped, because floating point subtraction
79
- of a fraction can land a hair outside the range. */
80
- const percent = Math.round(Math.max(0, Math.min(100, (1 - fraction) * 100)) * 10) / 10;
81
- windows.push({
82
- meter: name.toLowerCase() === "5h" ? "FIVE_HOUR" : "SEVEN_DAY",
83
- percent,
84
- seconds,
85
- resetAt
86
- });
87
- }
88
- return windows.length === 0 ? null : windows;
16
+ function remainingFraction(bucket) {
17
+ const value = typeof bucket["remaining_fraction"] === "number"
18
+ ? bucket["remaining_fraction"]
19
+ : typeof bucket["remainingFraction"] === "number"
20
+ ? bucket["remainingFraction"]
21
+ : null;
22
+ return value !== null && Number.isFinite(value) && value >= 0 && value <= 1
23
+ ? value
24
+ : null;
89
25
  }
90
- /** The prefix of every bucket id in a group, or null if any is unreadable. */
91
- function poolPrefixes(buckets) {
92
- const prefixes = new Set();
93
- for (const entry of buckets) {
94
- const bucket = record(entry);
95
- if (bucket === null)
96
- return null;
97
- const id = bucket["bucketId"];
98
- if (typeof id !== "string")
99
- return null;
100
- const separator = id.indexOf("-");
101
- if (separator <= 0)
102
- return null;
103
- prefixes.add(id.slice(0, separator));
104
- }
105
- return prefixes;
26
+ function resetInstant(bucket) {
27
+ const value = typeof bucket["reset_time"] === "string"
28
+ ? bucket["reset_time"]
29
+ : typeof bucket["resetTime"] === "string"
30
+ ? bucket["resetTime"]
31
+ : null;
32
+ if (value === null || !Number.isFinite(Date.parse(value)))
33
+ return null;
34
+ return new Date(value).toISOString();
106
35
  }
107
- /**
108
- * Every documented window in the tracked pool, as its own meter.
109
- *
110
- * The shell may still derive one binding percentage for advice and the tray,
111
- * but the dashboard must not discard the other window to get there.
112
- *
113
- * The third party pool that rides the same subscription is deliberately not
114
- * modelled. It is a real second wallet, and reporting it under this provider's
115
- * single meter would conflate two pools into one number. It needs its own
116
- * identity in the registry before it can have one here.
117
- */
118
- export function parseAntigravityPayload(payload, now) {
36
+ /** Parse only the documented quota map. Unknown bucket identities are omitted. */
37
+ export function parseAntigravityPayload(payload, observedAt) {
119
38
  const root = record(payload);
120
- const groups = root?.["groups"];
121
- if (!Array.isArray(groups))
39
+ const quota = record(root?.["quota"]);
40
+ const expiresAt = shortExpiry(observedAt);
41
+ if (quota === null || expiresAt === null)
122
42
  return null;
123
- let tracked = null;
124
- for (const entry of groups) {
125
- const group = record(entry);
126
- if (group === null)
127
- return null;
128
- const buckets = group["buckets"];
129
- if (!Array.isArray(buckets))
130
- return null;
131
- const prefixes = poolPrefixes(buckets);
132
- if (prefixes === null)
133
- return null;
134
- if (!prefixes.has(ANTIGRAVITY_TRACKED_POOL))
43
+ const meters = [];
44
+ for (const [bucketId, value] of Object.entries(quota)) {
45
+ const bucket = record(value);
46
+ const remaining = bucket === null ? null : remainingFraction(bucket);
47
+ const mapped = antigravityMeter(bucketId.toLowerCase());
48
+ if (bucket === null || remaining === null || mapped === null)
135
49
  continue;
136
- /* Two groups claiming the same pool is ambiguous, and picking one would be
137
- picking at random. */
138
- if (tracked !== null)
139
- return null;
140
- tracked = readBuckets(buckets, now);
141
- if (tracked === null)
142
- return null;
50
+ meters.push(rawMeter({
51
+ provider: "ANTIGRAVITY",
52
+ meter: mapped.meter,
53
+ value: Math.round((1 - remaining) * 1_000) / 10,
54
+ window: { kind: "rolling", durationSeconds: mapped.durationSeconds },
55
+ resetAt: resetInstant(bucket),
56
+ source: "native_payload",
57
+ precision: "estimated",
58
+ observedAt,
59
+ expiresAt,
60
+ labels: antigravityLabels
61
+ }));
143
62
  }
144
- if (tracked === null)
145
- return null;
146
- const expiresAt = shortExpiry(now);
147
- if (expiresAt === null)
148
- return null;
149
- return tracked.map((candidate) => rawMeter({
150
- provider: "ANTIGRAVITY",
151
- meter: candidate.meter,
152
- value: candidate.percent,
153
- window: { kind: "rolling", durationSeconds: candidate.seconds },
154
- resetAt: candidate.resetAt,
155
- source: "internal_payload",
156
- precision: "estimated",
157
- observedAt: now,
158
- expiresAt,
159
- labels: antigravityLabels
160
- }));
161
- }
162
- /**
163
- * The same Code Assist quota document, read under this provider's name.
164
- *
165
- * Antigravity and Gemini CLI sit on one Google Code Assist backend and answer
166
- * the same per model quota shape, so `parseGeminiCliPayload` above already
167
- * knows how to read it. What differs is WHOSE credential asked and therefore
168
- * which row a person is looking at, and that is a provider code, not a parser.
169
- *
170
- * The rename is exact rather than approximate: the two label sets are field for
171
- * field identical, so nothing about the reading's honesty changes when the
172
- * provider does. Duplicating the bucket reader to achieve the same thing would
173
- * mean two parsers to keep in step with one backend, which is how one of them
174
- * ends up silently behind.
175
- *
176
- * This is the shape the network path reads. The group and bucket summary the
177
- * `parseAntigravityPayload` reader above handles is a different document from
178
- * the same family and stays exactly as it was.
179
- */
180
- export function parseAntigravityCodeAssistPayload(payload, now) {
181
- const meters = parseGeminiCliPayload(payload, now);
182
- if (meters === null)
183
- return null;
184
- return meters.map((meter) => ({
185
- ...meter,
186
- provider: "ANTIGRAVITY",
187
- labels: antigravityLabels
188
- }));
63
+ return meters.length === 0 ? null : meters;
189
64
  }
190
- /** The local application that owns this credential. */
191
65
  export const ANTIGRAVITY_TOOL = "Antigravity";
192
66
  export const antigravityConnector = {
193
67
  id: "antigravity",
194
68
  displayName: "Antigravity",
195
- encoding: "json",
69
+ encoding: antigravityEncoding,
196
70
  labels: antigravityLabels,
197
71
  detect(environment) {
198
- return environment["ANTIGRAVITY_USAGE_PAYLOAD"] === "1";
72
+ return environment["ANTIGRAVITY_STATUSLINE_PAYLOAD"] === "1";
199
73
  },
200
74
  async read(context) {
201
75
  const meters = parseAntigravityPayload(context.payload, context.now);
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../src/antigravity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,QAAQ,EACR,MAAM,EACN,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,gBAAgB,EAAE,qBAAqB;IACvC,mBAAmB,EAAE,mBAAmB;IACxC,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,YAAY;CACQ,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,0BAA0B;IAChC,YAAY,EAAE,4BAA4B;IAC1C,QAAQ,EAAE,WAAW;CACb,CAAC;AAEX,uEAAuE;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAe,CAAC;AAEnD;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**
3
- * The Codex usage reader.
4
- *
5
- * The shape below is the one a working reader observed against a real account
6
- * on 2026-08-07, recorded in `Product Idea/reference-implementation`. OpenAI
7
- * publishes nothing about it, so it is DESIGN evidence and not verification
8
- * evidence: it tells us what to parse, and it does not turn an internal
9
- * endpoint into an official API. The labels below stay as they are, and the
10
- * provider stays UNVERIFIED, until a sanitized capture lands in the fixture
11
- * slot and even then the interface is still internal.
12
- *
13
- * The reader used to parse `rate_limits` with an s, a shape carried over from
14
- * an early prototype and never seen on the wire. The real field is
15
- * `rate_limit`, singular. That one letter is the whole reason the drift
16
- * machinery exists: both shapes are well formed JSON, both would have arrived
17
- * with a 200, and the wrong one produces no reading at all rather than a wrong
18
- * one only because this parser refuses whatever it was not told to expect.
19
- */
20
2
  export declare const codexLabels: {
21
3
  readonly credentialOrigin: "official-local-tool";
22
- readonly dataInterfaceStatus: "internal-endpoint";
23
- readonly automationRisk: "high";
24
- readonly verification: "UNVERIFIED";
4
+ readonly dataInterfaceStatus: "documented-api";
5
+ readonly automationRisk: "low";
6
+ readonly verification: "VERIFIED_FIXTURES";
25
7
  };
26
8
  export declare const codexInput: {
27
- readonly kind: "provider_managed_payload";
28
- readonly pathTemplate: "{providerState}/usage.json";
9
+ readonly kind: "local_command";
10
+ readonly command: "codex app-server";
29
11
  readonly readMode: "read_only";
30
12
  };
31
- /** What this reader reads. JSON, because the endpoint answers JSON. */
13
+ /** What this reader reads. JSON, because the app server answers JSONL messages. */
32
14
  export declare const codexEncoding: "json";
33
15
  export declare function parseCodexPayload(payload: unknown, now: string): RawMeter[] | null;
34
16
  /** The local application that owns this credential. */
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAGjB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAa3B;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,WAAW;;;;;CAKY,CAAC;AAErC,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,aAAa,EAAG,MAAe,CAAC;AA2D7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI,CAwFlF;AAED,uDAAuD;AACvD,eAAO,MAAM,UAAU,EAAE,cAA4B,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,iBAmB5B,CAAC"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAGjB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAa3B,eAAO,MAAM,WAAW;;;;;CAKY,CAAC;AAErC,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,mFAAmF;AACnF,eAAO,MAAM,aAAa,EAAG,MAAe,CAAC;AA6O7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI,CAuElF;AAED,uDAAuD;AACvD,eAAO,MAAM,UAAU,EAAE,cAA4B,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,iBAmB5B,CAAC"}