@openlimiter/connectors 0.1.0 → 0.4.0

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/shared.d.ts CHANGED
@@ -1,7 +1,95 @@
1
- import type { ConnectorLabels, ProviderCode, RawMeter, SnapshotPrecision, SnapshotSource, SnapshotWindow } from "@openlimiter/core";
1
+ import type { ConnectorLabels, ProviderCode, RawMeter, SnapshotAmounts, SnapshotPrecision, SnapshotSource, SnapshotWindow } from "@openlimiter/core";
2
2
  export declare function record(value: unknown): Record<string, unknown> | null;
3
3
  export declare function boundedNumber(value: unknown, maximum?: number): number | null;
4
4
  export declare function futureInstant(value: unknown, now: string): string | null;
5
+ /**
6
+ * Largest epoch value that is still read as seconds.
7
+ *
8
+ * A number this size in seconds is the year 33658, and the same number read as
9
+ * milliseconds is 2001. Anything at or above it is therefore a millisecond
10
+ * stamp handed to a seconds field, which is the single most likely way this
11
+ * conversion gets a reset instant wrong, so it is refused rather than turned
12
+ * into a date thirty thousand years away.
13
+ */
14
+ export declare const MAX_EPOCH_SECONDS = 1000000000000;
15
+ /**
16
+ * Slack allowed between a machine's clock and a provider's clock.
17
+ *
18
+ * An hour covers a wrong time zone offset applied to a timestamp, which is the
19
+ * realistic way two correct systems disagree, without widening the plausibility
20
+ * bound below into something that accepts nonsense.
21
+ */
22
+ export declare const CLOCK_SKEW_SECONDS = 3600;
23
+ /**
24
+ * The furthest ahead a window of a given length may plausibly reset.
25
+ *
26
+ * A rolling window cannot reset more than one window from now, so twice the
27
+ * window is already generous, and the skew allowance sits on top of that. This
28
+ * is what stops a five hour meter from claiming it resets in 2038: such a value
29
+ * is not a reset, it is a corrupt field, a different unit, or a different
30
+ * meaning, and rendering a twelve year countdown beside a five hour window
31
+ * would be the product lying with a straight face.
32
+ */
33
+ export declare function plausibleResetHorizon(windowSeconds: number): number;
34
+ /**
35
+ * Read a reset instant stated as Unix epoch seconds.
36
+ *
37
+ * Claude Code states its reset times this way. The value must be a finite
38
+ * number, must be in seconds rather than milliseconds, must still be in the
39
+ * future against the supplied clock, because a window that has already reset
40
+ * says nothing about the window running now, and must be close enough to now to
41
+ * belong to the window it claims to describe. Nothing is repaired: a value that
42
+ * fails any of these is null and the caller drops that reading alone.
43
+ *
44
+ * `maxAheadSeconds` is the plausibility bound and is optional only so the
45
+ * helper stays usable for a source with no window length to reason from.
46
+ */
47
+ export declare function futureInstantFromEpochSeconds(value: unknown, now: string, maxAheadSeconds?: number): string | null;
48
+ /**
49
+ * A fraction of a whole, as Google's quota summary states remaining quota.
50
+ *
51
+ * Zero and one are both real answers, so the bound is inclusive. A boolean is
52
+ * refused explicitly: JavaScript will happily do arithmetic on `true`, and a
53
+ * `remainingFraction` of `true` would otherwise become a usage of zero percent,
54
+ * which is the most dangerous wrong answer this product can give.
55
+ */
56
+ export declare function boundedFraction(value: unknown): number | null;
57
+ /**
58
+ * A whole positive count of seconds, when a provider states a window length.
59
+ *
60
+ * Bounded above by a year, because a rolling window longer than that is not a
61
+ * subscription window, it is a misread field or a different unit.
62
+ */
63
+ export declare const MAX_WINDOW_SECONDS = 31536000;
64
+ export declare function windowSeconds(value: unknown): number | null;
65
+ /**
66
+ * Read a reset instant stated as an RFC3339 timestamp.
67
+ *
68
+ * Google's quota summary states reset times this way, and the Antigravity
69
+ * client writes them with SEVEN fractional digits, which `Date.parse` on some
70
+ * runtimes reads and others do not. The fraction is normalised to three digits
71
+ * before parsing, which is the one repair made anywhere in this file, and it is
72
+ * a repair of ENCODING rather than of value: the instant it names is unchanged.
73
+ * Recorded 2026-08-07 against a real credential and a real response.
74
+ *
75
+ * An offsetless stamp is read as UTC explicitly. Both observed sources carry an
76
+ * offset today, so this is a guard rather than a fix, and it exists because the
77
+ * alternative is silent: a naive stamp read as local time moves a reset by the
78
+ * machine's offset instead of failing.
79
+ */
80
+ export declare function futureInstantFromRfc3339(value: unknown, now: string, maxAheadSeconds?: number): string | null;
81
+ /**
82
+ * Seconds from a duration a page spelled out in words, or null.
83
+ *
84
+ * OpenCode's workspace page prints "Resets in 5 days 20 hours" rather than a
85
+ * timestamp, so the only reset available is a countdown rendered for a human.
86
+ * Only consecutive number and unit pairs are read, and an empty or zero total
87
+ * is null rather than now: a reset of zero seconds would render as a countdown
88
+ * that has already finished.
89
+ */
90
+ export declare function durationSecondsFromWords(text: string): number | null;
91
+ /** An instant this many seconds after the supplied clock, or null. */
92
+ export declare function instantAfter(now: string, seconds: number): string | null;
5
93
  export declare function shortExpiry(now: string): string | null;
6
94
  export declare function rawMeter(input: {
7
95
  provider: ProviderCode;
@@ -14,5 +102,13 @@ export declare function rawMeter(input: {
14
102
  observedAt: string;
15
103
  expiresAt: string;
16
104
  labels: ConnectorLabels;
105
+ /**
106
+ * Money, when the provider's own documented payload states it.
107
+ *
108
+ * Passed through untouched. The normalizer is the only thing that decides
109
+ * whether these are believable, and it drops all three together or keeps all
110
+ * three together, so a connector never has to reason about the pair.
111
+ */
112
+ amounts?: SnapshotAmounts;
17
113
  }): RawMeter;
18
114
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAIrE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,SAAM,GAAG,MAAM,GAAG,IAAI,CAO1E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AA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;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAa,CAAC;AAE7C,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAG3D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,EACX,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,GAAG,IAAI,CAuBf;AAUD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAapE;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKxE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,GAAG,QAAQ,CAGX"}
package/dist/shared.js CHANGED
@@ -20,11 +20,178 @@ export function futureInstant(value, now) {
20
20
  ? new Date(parsed).toISOString()
21
21
  : null;
22
22
  }
23
+ /**
24
+ * Largest epoch value that is still read as seconds.
25
+ *
26
+ * A number this size in seconds is the year 33658, and the same number read as
27
+ * milliseconds is 2001. Anything at or above it is therefore a millisecond
28
+ * stamp handed to a seconds field, which is the single most likely way this
29
+ * conversion gets a reset instant wrong, so it is refused rather than turned
30
+ * into a date thirty thousand years away.
31
+ */
32
+ export const MAX_EPOCH_SECONDS = 1e12;
33
+ /**
34
+ * Slack allowed between a machine's clock and a provider's clock.
35
+ *
36
+ * An hour covers a wrong time zone offset applied to a timestamp, which is the
37
+ * realistic way two correct systems disagree, without widening the plausibility
38
+ * bound below into something that accepts nonsense.
39
+ */
40
+ export const CLOCK_SKEW_SECONDS = 3_600;
41
+ /**
42
+ * The furthest ahead a window of a given length may plausibly reset.
43
+ *
44
+ * A rolling window cannot reset more than one window from now, so twice the
45
+ * window is already generous, and the skew allowance sits on top of that. This
46
+ * is what stops a five hour meter from claiming it resets in 2038: such a value
47
+ * is not a reset, it is a corrupt field, a different unit, or a different
48
+ * meaning, and rendering a twelve year countdown beside a five hour window
49
+ * would be the product lying with a straight face.
50
+ */
51
+ export function plausibleResetHorizon(windowSeconds) {
52
+ return windowSeconds * 2 + CLOCK_SKEW_SECONDS;
53
+ }
54
+ /**
55
+ * Read a reset instant stated as Unix epoch seconds.
56
+ *
57
+ * Claude Code states its reset times this way. The value must be a finite
58
+ * number, must be in seconds rather than milliseconds, must still be in the
59
+ * future against the supplied clock, because a window that has already reset
60
+ * says nothing about the window running now, and must be close enough to now to
61
+ * belong to the window it claims to describe. Nothing is repaired: a value that
62
+ * fails any of these is null and the caller drops that reading alone.
63
+ *
64
+ * `maxAheadSeconds` is the plausibility bound and is optional only so the
65
+ * helper stays usable for a source with no window length to reason from.
66
+ */
67
+ export function futureInstantFromEpochSeconds(value, now, maxAheadSeconds) {
68
+ if (typeof value !== "number" || !Number.isFinite(value))
69
+ return null;
70
+ if (value <= 0 || value >= MAX_EPOCH_SECONDS)
71
+ return null;
72
+ const current = Date.parse(now);
73
+ if (!Number.isFinite(current))
74
+ return null;
75
+ const milliseconds = Math.round(value * 1_000);
76
+ if (milliseconds <= current)
77
+ return null;
78
+ if (typeof maxAheadSeconds === "number" &&
79
+ Number.isFinite(maxAheadSeconds) &&
80
+ maxAheadSeconds > 0 &&
81
+ milliseconds > current + maxAheadSeconds * 1_000)
82
+ return null;
83
+ const instant = new Date(milliseconds);
84
+ return Number.isFinite(instant.getTime()) ? instant.toISOString() : null;
85
+ }
86
+ /**
87
+ * A fraction of a whole, as Google's quota summary states remaining quota.
88
+ *
89
+ * Zero and one are both real answers, so the bound is inclusive. A boolean is
90
+ * refused explicitly: JavaScript will happily do arithmetic on `true`, and a
91
+ * `remainingFraction` of `true` would otherwise become a usage of zero percent,
92
+ * which is the most dangerous wrong answer this product can give.
93
+ */
94
+ export function boundedFraction(value) {
95
+ if (typeof value !== "number" || !Number.isFinite(value))
96
+ return null;
97
+ return value >= 0 && value <= 1 ? value : null;
98
+ }
99
+ /**
100
+ * A whole positive count of seconds, when a provider states a window length.
101
+ *
102
+ * Bounded above by a year, because a rolling window longer than that is not a
103
+ * subscription window, it is a misread field or a different unit.
104
+ */
105
+ export const MAX_WINDOW_SECONDS = 31_536_000;
106
+ export function windowSeconds(value) {
107
+ if (typeof value !== "number" || !Number.isInteger(value))
108
+ return null;
109
+ return value > 0 && value <= MAX_WINDOW_SECONDS ? value : null;
110
+ }
111
+ /**
112
+ * Read a reset instant stated as an RFC3339 timestamp.
113
+ *
114
+ * Google's quota summary states reset times this way, and the Antigravity
115
+ * client writes them with SEVEN fractional digits, which `Date.parse` on some
116
+ * runtimes reads and others do not. The fraction is normalised to three digits
117
+ * before parsing, which is the one repair made anywhere in this file, and it is
118
+ * a repair of ENCODING rather than of value: the instant it names is unchanged.
119
+ * Recorded 2026-08-07 against a real credential and a real response.
120
+ *
121
+ * An offsetless stamp is read as UTC explicitly. Both observed sources carry an
122
+ * offset today, so this is a guard rather than a fix, and it exists because the
123
+ * alternative is silent: a naive stamp read as local time moves a reset by the
124
+ * machine's offset instead of failing.
125
+ */
126
+ export function futureInstantFromRfc3339(value, now, maxAheadSeconds) {
127
+ if (typeof value !== "string" || value.length > 64)
128
+ return null;
129
+ const trimmed = value.trim();
130
+ /* Three digits is what every runtime agrees on; the rest are dropped, not
131
+ rounded, because sub millisecond precision on a quota reset is noise. */
132
+ const normalized = trimmed.replace(/\.(\d{1,9})/u, (_match, digits) => "." + (digits + "000").slice(0, 3));
133
+ const withZone = /(?:Z|[+-]\d{2}:?\d{2})$/u.test(normalized)
134
+ ? normalized
135
+ : normalized + "Z";
136
+ const parsed = Date.parse(withZone);
137
+ const current = Date.parse(now);
138
+ if (!Number.isFinite(parsed) || !Number.isFinite(current))
139
+ return null;
140
+ if (parsed <= current)
141
+ return null;
142
+ if (typeof maxAheadSeconds === "number" &&
143
+ Number.isFinite(maxAheadSeconds) &&
144
+ maxAheadSeconds > 0 &&
145
+ parsed > current + maxAheadSeconds * 1_000)
146
+ return null;
147
+ return new Date(parsed).toISOString();
148
+ }
149
+ /** How many seconds each unit a provider spells out is worth. */
150
+ const DURATION_UNITS = {
151
+ day: 86_400,
152
+ hour: 3_600,
153
+ minute: 60,
154
+ second: 1
155
+ };
156
+ /**
157
+ * Seconds from a duration a page spelled out in words, or null.
158
+ *
159
+ * OpenCode's workspace page prints "Resets in 5 days 20 hours" rather than a
160
+ * timestamp, so the only reset available is a countdown rendered for a human.
161
+ * Only consecutive number and unit pairs are read, and an empty or zero total
162
+ * is null rather than now: a reset of zero seconds would render as a countdown
163
+ * that has already finished.
164
+ */
165
+ export function durationSecondsFromWords(text) {
166
+ let total = 0;
167
+ let seen = false;
168
+ const pattern = /(\d{1,6})\s*(day|hour|minute|second)s?/giu;
169
+ for (const match of text.matchAll(pattern)) {
170
+ const count = Number.parseInt(match[1] ?? "", 10);
171
+ const unit = DURATION_UNITS[(match[2] ?? "").toLowerCase()];
172
+ if (!Number.isFinite(count) || unit === undefined)
173
+ return null;
174
+ total += count * unit;
175
+ seen = true;
176
+ }
177
+ if (!seen || total <= 0 || total > MAX_WINDOW_SECONDS)
178
+ return null;
179
+ return total;
180
+ }
181
+ /** An instant this many seconds after the supplied clock, or null. */
182
+ export function instantAfter(now, seconds) {
183
+ const current = Date.parse(now);
184
+ if (!Number.isFinite(current))
185
+ return null;
186
+ const instant = new Date(current + seconds * 1_000);
187
+ return Number.isFinite(instant.getTime()) ? instant.toISOString() : null;
188
+ }
23
189
  export function shortExpiry(now) {
24
190
  const parsed = Date.parse(now);
25
191
  return Number.isFinite(parsed) ? new Date(parsed + 60_000).toISOString() : null;
26
192
  }
27
193
  export function rawMeter(input) {
28
- return { ...input, unit: "PERCENT" };
194
+ const { amounts, ...rest } = input;
195
+ return { ...rest, unit: "PERCENT", ...(amounts === undefined ? {} : amounts) };
29
196
  }
30
197
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,KAAgC;QAClC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,OAAO,GAAG,GAAG;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACtB,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,OAAO;QAChB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,GAAW;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CA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AAC,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAmBxB;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACnC,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;AACjF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlimiter/connectors",
3
- "version": "0.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "Provider connectors that collect quota and usage data for OpenLimiter.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "NOTICE"
20
20
  ],
21
21
  "dependencies": {
22
- "@openlimiter/core": "0.1.0"
22
+ "@openlimiter/core": "0.4.0"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",