@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.
- package/dist/antigravity.d.ts +7 -71
- package/dist/antigravity.d.ts.map +1 -1
- package/dist/antigravity.js +51 -177
- package/dist/antigravity.js.map +1 -1
- package/dist/codex.d.ts +6 -24
- package/dist/codex.d.ts.map +1 -1
- package/dist/codex.js +207 -67
- package/dist/codex.js.map +1 -1
- package/dist/fixtures.d.ts +2 -27
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/fixtures.js +34 -158
- package/dist/fixtures.js.map +1 -1
- package/dist/grok.js +1 -1
- package/dist/grok.js.map +1 -1
- package/dist/openrouter.d.ts.map +1 -1
- package/dist/openrouter.js +74 -9
- package/dist/openrouter.js.map +1 -1
- package/package.json +2 -2
package/dist/antigravity.d.ts
CHANGED
|
@@ -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: "
|
|
20
|
-
readonly automationRisk: "
|
|
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: "
|
|
25
|
-
readonly pathTemplate: "
|
|
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
|
-
|
|
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":"
|
|
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"}
|
package/dist/antigravity.js
CHANGED
|
@@ -1,201 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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: "
|
|
21
|
-
automationRisk: "
|
|
6
|
+
dataInterfaceStatus: "native-statusline-payload",
|
|
7
|
+
automationRisk: "low",
|
|
22
8
|
verification: "UNVERIFIED"
|
|
23
9
|
};
|
|
24
10
|
export const antigravityInput = {
|
|
25
|
-
kind: "
|
|
26
|
-
pathTemplate: "
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
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
|
|
121
|
-
|
|
39
|
+
const quota = record(root?.["quota"]);
|
|
40
|
+
const expiresAt = shortExpiry(observedAt);
|
|
41
|
+
if (quota === null || expiresAt === null)
|
|
122
42
|
return null;
|
|
123
|
-
|
|
124
|
-
for (const
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
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:
|
|
69
|
+
encoding: antigravityEncoding,
|
|
196
70
|
labels: antigravityLabels,
|
|
197
71
|
detect(environment) {
|
|
198
|
-
return environment["
|
|
72
|
+
return environment["ANTIGRAVITY_STATUSLINE_PAYLOAD"] === "1";
|
|
199
73
|
},
|
|
200
74
|
async read(context) {
|
|
201
75
|
const meters = parseAntigravityPayload(context.payload, context.now);
|
package/dist/antigravity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../src/antigravity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../src/antigravity.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBA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
|
|
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: "
|
|
23
|
-
readonly automationRisk: "
|
|
24
|
-
readonly verification: "
|
|
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: "
|
|
28
|
-
readonly
|
|
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
|
|
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. */
|
package/dist/codex.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"
|
|
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"}
|