@ravshansbox/pi-quota 0.2.0 → 0.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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.ts +1 -6
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -5,7 +5,7 @@ Anthropic and OpenAI Codex quota status extension for pi.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- pi install git:github.com/ravshansbox/pi-quota
8
+ pi install npm:@ravshansbox/pi-quota
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -15,8 +15,8 @@ Pi loads the extension from `./index.ts` and shows the remaining quota for the p
15
15
  - Polls Anthropic and OpenAI Codex usage endpoints at every 10-minute wall-clock mark (`HH:00`, `HH:10`, `HH:20`, `HH:30`, `HH:40`, `HH:50`); polls immediately on session start, then aligns to the next mark
16
16
  - 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
17
17
  - The status shares the footer line with other extensions, so it uses no extra terminal row
18
- - The text starts with the provider label (`Claude` or `Codex`) and stays compact, e.g. `Claude: 93% 1h29m | 67% 3d13h`, where the 5-hour window comes first and the 7-day window second, and each window shows its remaining percentage followed by time until reset
19
- - Available resets, when present, are appended as `| 2x 5h` (count, then time until the soonest expires)
18
+ - The text stays compact, e.g. `93% 1h29m · 67% 3d13h`, where the 5-hour window comes first and the 7-day window second, and each window shows its remaining percentage followed by time until reset
19
+ - Available resets, when present, are appended as `· 2x 5h` (count, then time until the soonest expires)
20
20
  - Both providers are still polled whenever their credentials exist, so quota is already fresh when the active model changes
21
21
  - Refreshes Anthropic and OpenAI Codex OAuth access tokens from `~/.pi/agent/auth.json` when needed, writes updated credentials back (re-reading the file first to avoid clobbering concurrent updates), and notifies on the first successful refresh per provider each session
22
22
  - Appends poll and token-refresh errors to `~/.pi/agent/pi-quota.log`
package/index.ts CHANGED
@@ -76,11 +76,6 @@ const MODEL_PROVIDER_NAMES: Record<QuotaState['provider'], string> = {
76
76
  'openai-codex': 'openai',
77
77
  };
78
78
 
79
- const QUOTA_LABELS: Record<QuotaState['provider'], string> = {
80
- anthropic: 'Claude',
81
- 'openai-codex': 'Codex',
82
- };
83
-
84
79
  const REQUEST_TIMEOUT_MS = 30_000;
85
80
 
86
81
  function nextMarkAfter(time: Date): Date {
@@ -211,7 +206,7 @@ export default function (pi: ExtensionAPI) {
211
206
  : '';
212
207
  parts.push(`${state.resetsAvailable}x${expiryStr}`);
213
208
  }
214
- return parts.length > 0 ? `${QUOTA_LABELS[state.provider]}: ${parts.join(' | ')}` : undefined;
209
+ return parts.length > 0 ? parts.join(' · ') : undefined;
215
210
  }
216
211
 
217
212
  function updateStatus() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-quota",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Anthropic and OpenAI Codex quota status extension for pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@eslint/js": "^10.0.1",
38
- "@types/node": "^26.6.4",
39
- "eslint": "^10.12.0",
38
+ "@types/node": "^26.6.5",
39
+ "eslint": "^10.13.0",
40
40
  "eslint-config-prettier": "^10.1.8",
41
- "prettier": "^3.9.9",
41
+ "prettier": "^3.9.10",
42
42
  "typescript": "^6.0.3",
43
- "typescript-eslint": "^8.71.1"
43
+ "typescript-eslint": "^8.72.0"
44
44
  },
45
45
  "files": [
46
46
  "index.ts"