@ravshansbox/pi-quota 0.10.7 → 0.10.9
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/README.md +1 -1
- package/index.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Add `-l` to install it in project settings.
|
|
|
14
14
|
|
|
15
15
|
Pi loads the extension from `./index.ts` and shows the used quota for the provider backing the active model in the footer.
|
|
16
16
|
|
|
17
|
-
- Calls the Anthropic usage endpoint once on session start, then reads the Anthropic quota from the rate limit headers of each Anthropic response
|
|
17
|
+
- Calls the Anthropic usage endpoint once on session start, then reads the Anthropic quota from the rate limit headers of each Anthropic response, and calls it again after the reset ping
|
|
18
18
|
- Polls the OpenAI Codex usage endpoint on session start, then at every 10-minute wall-clock mark (`HH:00`, `HH:10`, `HH:20`, `HH:30`, `HH:40`, `HH:50`)
|
|
19
19
|
- Shows a footer status for the provider backing the **active model**, and only when quota data for that provider has been polled; switching models re-renders it immediately
|
|
20
20
|
- The text stays compact, e.g. `7% 1h29m · 33% 4d`, where the 5-hour window comes first and the 7-day window second, and each window shows its used percentage followed by time until reset
|
package/index.ts
CHANGED
|
@@ -294,6 +294,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
294
294
|
child.on('error', (error: unknown) => {
|
|
295
295
|
void logError(`Reset ping failed for ${provider}:`, error);
|
|
296
296
|
});
|
|
297
|
+
if (provider === 'anthropic') {
|
|
298
|
+
child.on('exit', () => {
|
|
299
|
+
void (cycle ?? Promise.resolve()).then(() => (ctxRef ? runCycle(true) : undefined));
|
|
300
|
+
});
|
|
301
|
+
}
|
|
297
302
|
|
|
298
303
|
child.unref();
|
|
299
304
|
}
|