@narumitw/pi-usage 0.64.3 → 0.65.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/README.md +9 -3
- package/dist/chunks/{chunk-ACPQJ2CM.ts → chunk-N2ZD5X4K.ts} +4 -4
- package/dist/chunks/{chunk-ACPQJ2CM.ts.map → chunk-N2ZD5X4K.ts.map} +2 -2
- package/dist/chunks/{openai-companion-auth-FGFC6DBT.ts → openai-companion-auth-QIKCD3WA.ts} +2 -2
- package/dist/chunks/{openai-companion-usage-TGHK2OQR.ts → openai-companion-usage-ZFAHCGEY.ts} +2 -2
- package/dist/index.ts +372 -110
- package/dist/index.ts.map +4 -4
- package/package.json +1 -1
- package/src/codex-fast-catalog.ts +272 -0
- package/src/codex-fast-runtime.ts +107 -26
- package/src/codex-fast.ts +28 -19
- package/src/index.ts +3 -1
- package/src/query.ts +2 -1
- package/src/usage.ts +31 -10
- /package/dist/chunks/{openai-companion-auth-FGFC6DBT.ts.map → openai-companion-auth-QIKCD3WA.ts.map} +0 -0
- /package/dist/chunks/{openai-companion-usage-TGHK2OQR.ts.map → openai-companion-usage-ZFAHCGEY.ts.map} +0 -0
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
|
|
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
|
-
|
|
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.
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
3277
|
+
//# sourceMappingURL=chunk-N2ZD5X4K.ts.map
|