@narumitw/pi-usage 0.64.3 → 0.65.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.
package/README.md CHANGED
@@ -115,11 +115,17 @@ Run `/fast` without arguments to toggle Fast for the active supported Codex mode
115
115
  Fast is about 1.5× faster and uses more of your plan allowance.
116
116
  The `codexFastMode` preference defaults to Off.
117
117
 
118
- Fast currently applies only to official `openai-codex-responses` requests for `gpt-5.5`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-6-astra`, `gpt-6-luna`, `gpt-6-sol`, and `gpt-6.1-sol` at `https://chatgpt.com`.
118
+ Fast applies to official `openai-codex-responses` requests at `https://chatgpt.com` when the current account's Codex model directory advertises a `priority` service tier or the legacy `fast` speed tier.
119
+ Discovery validates the active OAuth account and caches its model capabilities for five minutes, with background refresh on session and model changes.
120
+ `/fast` and `/usage` can refresh capability information before enabling Fast or displaying its controls, while provider request hooks use the account-validated cache and leave directory refresh in the background.
121
+
119
122
  The `fast` label indicates requested priority routing, not a measured speedup; actual availability and speed depend on the service.
120
- It sends `service_tier: "priority"` while enabled and explicit `service_tier: "default"` otherwise.
123
+ It sends `service_tier: "priority"` while enabled and supported, and explicit `service_tier: "default"` otherwise.
121
124
  The statusline adds `fast` only while the preference is effective, for example `codex fast 59% ↻ 2h30m` with the default reset countdown.
122
- Unsupported models and custom or proxy origins are left unchanged.
125
+ A missing model, incomplete capability information, or first directory failure displays **Unknown** and uses standard routing, with `codex (Fast unknown)` shown when the preference remains enabled.
126
+ Temporary network failures reuse successful discovery for the same account, while authentication rejection or malformed directory data invalidates that account's capability information.
127
+ The preference can still be turned off while capability information is unknown.
128
+ Other providers, APIs, and custom or proxy origins retain their own request payloads.
123
129
 
124
130
  A toggle affects provider requests whose payload hook starts after the save; a request already sent is unchanged.
125
131
  Repair or remove an invalid file, then run `/reload` before trying the toggle again.
@@ -141,7 +147,7 @@ This preference changes only Codex statusline formatting, not provider data or t
141
147
  ### Codex statusline reset countdown
142
148
 
143
149
  The `codexStatusResetCountdown` preference defaults to `true`. It replaces the window labels with the time remaining until each returned limit resets.
144
- Turn **Codex reset countdown** Off in the TUI Settings screen, or set it to `false` in `pi-usage.json` and run `/reload`, to restore the legacy `5h` and `wk` labels:
150
+ Turn **Codex reset countdown** Off in the TUI Settings screen, or set it to `false` in `pi-usage.json` and run `/reload`, to show static labels such as `codex 5h:59% · wk:61%`:
145
151
 
146
152
  ```json
147
153
  {
@@ -191,6 +197,16 @@ After the active runtime credential changes, the next command, turn, or schedule
191
197
  ## 📊 Statusline behavior
192
198
 
193
199
  The `usage` status item is active only for selected providers that publish statusline usage.
200
+ Codex, Command Code, Kimi, MiniMax Token Plan, Z.AI, and OpenCode Go separate quota windows with ` · ` and place static labels before values, for example `cmd 5h:100% · wk:97% · mo:98%`.
201
+ Countdown segments retain their spacing without window labels, for example `codex 89% ↻ 2h30m · 97% ↻ 5d17h`; a missing reset time falls back to a static label, such as `codex 89% ↻ 2h30m · wk:97%`.
202
+ Single windows have no separator. These presentation changes do not alter the reported values; consumers parsing the old status text must adapt to the new format. ChatGPT companion formatting is unchanged.
203
+
204
+ Kimi, MiniMax Token Plan Global/China, Z.AI Global/China, Command Code, OpenCode Go, and finite GitHub Copilot quotas show countdowns automatically when a displayed quota has a valid future reset time.
205
+ For example, `kimi 77% ↻ 2h52m · mo:87%` mixes a countdown with a static fallback; Copilot preserves its counts, percentage, and any overage, such as `copilot 245/300 82% ↻ 6d`.
206
+ These providers fall back to their existing static output when reset times are missing, invalid, or expired; unlimited quotas and balance/spend reports do not show countdowns.
207
+ Their countdowns are not controlled by the Codex-only settings. Codex and ChatGPT companion retain their existing reset behavior, including `↻ 0m` for expired returned resets.
208
+ Countdowns repaint locally every minute while a displayed eligible reset remains in the future, without additional provider requests; hidden windows and unselected model groups do not activate this repaint for the newly supported providers.
209
+
194
210
  It refreshes every five minutes while the session remains on such a provider and is cleared when the model changes to an unsupported or menu-only provider.
195
211
  DeepSeek publishes each returned currency as a separate exact balance segment and reports when the API is unavailable.
196
212
  Fireworks publishes exact per-currency rated spend totals and reports when no rated usage exists.
@@ -1540,7 +1540,7 @@ var OPENAI_CHATGPT_ADAPTER = {
1540
1540
  invalidateCacheOnFailure: true,
1541
1541
  async query(auth, signal, timeoutMs, guard) {
1542
1542
  if (auth.openaiCompanion) {
1543
- const { queryOpenAICompanionUsage } = await import("./openai-companion-usage-TGHK2OQR.ts");
1543
+ const { queryOpenAICompanionUsage } = await import("./openai-companion-usage-ZFAHCGEY.ts");
1544
1544
  signal.throwIfAborted();
1545
1545
  return queryOpenAICompanionUsage(auth, signal, timeoutMs, guard);
1546
1546
  }
@@ -2691,7 +2691,7 @@ async function resolveUsageAuth(ctx, adapter, salt = AUTH_FINGERPRINT_SALT, cred
2691
2691
  const native = finalize(
2692
2692
  resolveOpenAIChatGPTAuth(auth, providerResult.auth, providerResult.source, model, offered.candidates)
2693
2693
  );
2694
- const { resolveOpenAICompanionAuth } = await import("./openai-companion-auth-FGFC6DBT.ts");
2694
+ const { resolveOpenAICompanionAuth } = await import("./openai-companion-auth-QIKCD3WA.ts");
2695
2695
  return resolveOpenAICompanionAuth(ctx, native, salt, credentialReader, candidateReader);
2696
2696
  }
2697
2697
  if (adapter.id === "github-copilot") {
@@ -2842,7 +2842,7 @@ async function fetchProviderJson(url, auth, signal, timeoutMs, description, requ
2842
2842
  if (controller.signal.aborted) throw Object.assign(new Error("Usage query aborted."), { name: "AbortError" });
2843
2843
  const text = await readBoundedResponse(
2844
2844
  response,
2845
- response.ok ? MAX_SUCCESS_BODY_BYTES : MAX_ERROR_BODY_BYTES,
2845
+ response.ok ? request.maxSuccessBodyBytes ?? MAX_SUCCESS_BODY_BYTES : MAX_ERROR_BODY_BYTES,
2846
2846
  !response.ok,
2847
2847
  description,
2848
2848
  controller.signal
@@ -3274,4 +3274,4 @@ export {
3274
3274
  providerIsConfigured,
3275
3275
  fetchProviderJson
3276
3276
  };
3277
- //# sourceMappingURL=chunk-ACPQJ2CM.ts.map
3277
+ //# sourceMappingURL=chunk-N2ZD5X4K.ts.map