opencode-quota-gui 1.3.1 → 1.3.2
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 +16 -12
- package/dist/contracts/build-identity.js +1 -1
- package/dist/contracts/card-order.d.ts +2 -0
- package/dist/contracts/card-order.js +2 -2
- package/dist/contracts/card-visibility.d.ts +2 -1
- package/dist/contracts/card-visibility.js +2 -1
- package/dist/contracts/dashboard.d.ts +87 -5
- package/dist/contracts/dashboard.js +10 -0
- package/dist/contracts/dto-guards.d.ts +4 -0
- package/dist/contracts/dto-guards.js +29 -7
- package/dist/contracts/guards.js +3 -1
- package/dist/contracts/identity.d.ts +37 -5
- package/dist/contracts/identity.js +43 -0
- package/dist/contracts/provider-auto-resume.d.ts +9 -0
- package/dist/contracts/provider-auto-resume.js +24 -0
- package/dist/contracts/provider-failure.d.ts +22 -0
- package/dist/contracts/provider-failure.js +25 -1
- package/dist/contracts/row-order.d.ts +13 -0
- package/dist/contracts/row-order.js +34 -0
- package/dist/contracts/row-visibility.d.ts +53 -0
- package/dist/contracts/row-visibility.js +130 -0
- package/dist/data/modelsdev-pricing.min.json +1 -1
- package/dist/data/modelsdev-temporal.min.json +3 -634
- package/dist/gui/aggregation.d.ts +29 -1
- package/dist/gui/aggregation.js +157 -4
- package/dist/gui/analytics-bridge.d.ts +8 -9
- package/dist/gui/analytics-bridge.js +197 -54
- package/dist/gui/analytics-engine.d.ts +7 -15
- package/dist/gui/analytics-engine.js +246 -106
- package/dist/gui/analytics-model.d.ts +7 -0
- package/dist/gui/analytics-model.js +75 -9
- package/dist/gui/analytics-pricing-upkeep.d.ts +21 -0
- package/dist/gui/analytics-pricing-upkeep.js +23 -0
- package/dist/gui/analytics-protocol.d.ts +17 -7
- package/dist/gui/analytics-protocol.js +1 -0
- package/dist/gui/analytics-service.d.ts +10 -0
- package/dist/gui/analytics-service.js +30 -9
- package/dist/gui/analytics-state.d.ts +30 -5
- package/dist/gui/analytics-state.js +46 -7
- package/dist/gui/analytics-worker-runtime.d.ts +5 -0
- package/dist/gui/analytics-worker-runtime.js +9 -1
- package/dist/gui/analytics-worker.js +11 -0
- package/dist/gui/config.d.ts +2 -2
- package/dist/gui/config.js +46 -5
- package/dist/gui/identity.d.ts +6 -20
- package/dist/gui/identity.js +6 -54
- package/dist/gui/primary-quota-windows.js +55 -34
- package/dist/gui/provider-cards.d.ts +12 -8
- package/dist/gui/provider-cards.js +12 -53
- package/dist/gui/quota-notification-detector.d.ts +25 -2
- package/dist/gui/quota-notification-detector.js +60 -5
- package/dist/gui/quota-notification-observer.d.ts +1 -1
- package/dist/gui/quota-notification-observer.js +5 -1
- package/dist/gui/quota-observation.d.ts +4 -0
- package/dist/gui/quota-observation.js +18 -0
- package/dist/gui/rpc.js +3 -0
- package/dist/gui/server.js +6 -1
- package/dist/gui/snapshot-service.d.ts +3 -17
- package/dist/gui/snapshot-service.js +159 -9
- package/dist/gui/sources.js +84 -11
- package/dist/gui/temporal-status.d.ts +3 -2
- package/dist/gui/temporal-status.js +10 -6
- package/dist/gui-experimental.cjs +228 -228
- package/dist/lib/accounting-format.d.ts +8 -0
- package/dist/lib/accounting-format.js +12 -2
- package/dist/lib/anthropic-api-auth.d.ts +7 -0
- package/dist/lib/anthropic-api-auth.js +27 -0
- package/dist/lib/anthropic-api-rate-limits.d.ts +47 -0
- package/dist/lib/anthropic-api-rate-limits.js +92 -0
- package/dist/lib/anthropic-oauth-throttle.d.ts +76 -0
- package/dist/lib/anthropic-oauth-throttle.js +379 -0
- package/dist/lib/anthropic.d.ts +22 -4
- package/dist/lib/anthropic.js +498 -180
- package/dist/lib/cache-observer-ingestion.js +27 -0
- package/dist/lib/cache-observer.d.ts +3 -0
- package/dist/lib/cache-observer.js +9 -3
- package/dist/lib/cli-show.d.ts +5 -0
- package/dist/lib/cli-show.js +16 -5
- package/dist/lib/cli-status.js +3 -6
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.js +64 -2
- package/dist/lib/dashboard-visibility.d.ts +5 -0
- package/dist/lib/dashboard-visibility.js +11 -10
- package/dist/lib/display-sanitize.js +1 -0
- package/dist/lib/entries.d.ts +10 -1
- package/dist/lib/entries.js +4 -0
- package/dist/lib/grouped-entry-normalization.js +1 -1
- package/dist/lib/maintainer-announcements.js +2 -2
- package/dist/lib/modelsdev-pricing.d.ts +74 -2
- package/dist/lib/modelsdev-pricing.js +457 -63
- package/dist/lib/modelsdev-temporal.d.ts +6 -0
- package/dist/lib/modelsdev-temporal.js +16 -2
- package/dist/lib/opencode-config-providers.js +2 -2
- package/dist/lib/opencode-storage.d.ts +20 -0
- package/dist/lib/opencode-storage.js +89 -2
- package/dist/lib/opencode-version-core.d.ts +7 -0
- package/dist/lib/opencode-version-core.js +10 -0
- package/dist/lib/opencode-warming-refresh.d.ts +19 -0
- package/dist/lib/opencode-warming-refresh.js +95 -0
- package/dist/lib/provider-metadata.d.ts +11 -3
- package/dist/lib/provider-metadata.js +20 -2
- package/dist/lib/provider-registration.d.ts +342 -3
- package/dist/lib/provider-registration.js +409 -27
- package/dist/lib/quota-auto-resume.d.ts +74 -0
- package/dist/lib/quota-auto-resume.js +539 -0
- package/dist/lib/quota-command-format.js +22 -9
- package/dist/lib/quota-identity.d.ts +64 -0
- package/dist/lib/quota-identity.js +111 -0
- package/dist/lib/quota-providers.js +2 -2
- package/dist/lib/quota-render-data.js +2 -2
- package/dist/lib/quota-reset-notifications.js +11 -155
- package/dist/lib/quota-retry-wait.d.ts +106 -5
- package/dist/lib/quota-retry-wait.js +301 -34
- package/dist/lib/quota-runtime-context.js +1 -0
- package/dist/lib/quota-state-codec.d.ts +2 -0
- package/dist/lib/quota-state-codec.js +14 -1
- package/dist/lib/quota-state.d.ts +1 -1
- package/dist/lib/quota-state.js +60 -28
- package/dist/lib/quota-stats.d.ts +26 -0
- package/dist/lib/quota-stats.js +19 -1
- package/dist/lib/quota-surface-data.js +18 -3
- package/dist/lib/quota-telemetry.js +2 -2
- package/dist/lib/resolved-auth-identity.d.ts +19 -0
- package/dist/lib/resolved-auth-identity.js +44 -0
- package/dist/lib/state-file-lock.d.ts +26 -0
- package/dist/lib/state-file-lock.js +205 -0
- package/dist/lib/toast-format-grouped.js +7 -4
- package/dist/lib/tui-compact-format.js +29 -16
- package/dist/lib/types.d.ts +20 -0
- package/dist/lib/types.js +4 -1
- package/dist/plugin.js +67 -1
- package/dist/providers/alibaba-coding-plan.js +21 -3
- package/dist/providers/alibaba-token-plan.js +9 -5
- package/dist/providers/anthropic.d.ts +6 -2
- package/dist/providers/anthropic.js +123 -14
- package/dist/providers/chutes.js +2 -0
- package/dist/providers/claude-agent.js +24 -5
- package/dist/providers/copilot.js +5 -4
- package/dist/providers/glm-coding-plan-provider.js +30 -23
- package/dist/providers/ollama-cloud.js +10 -0
- package/dist/providers/openai.js +24 -23
- package/dist/providers/opencode-go.js +7 -6
- package/dist/providers/opencode-zen.js +1 -1
- package/dist/providers/result-helpers.d.ts +4 -2
- package/dist/providers/result-helpers.js +5 -1
- package/dist/providers/synthetic.js +4 -0
- package/dist/providers/xai.js +9 -8
- package/dist/rpc.d.ts +8 -0
- package/dist/rpc.js +15 -2
- package/dist/ui/assets/{index-BcueIm3Z.css → index-6_g1FHs-.css} +1 -1
- package/dist/ui/assets/index-sZnGUuML.js +10 -0
- package/dist/ui/assets/{popover-4bFSvRZ7.js → popover-C4ZLYe9E.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +3 -3
- package/dist/ui/assets/index-C6qRSoh8.js +0 -10
package/dist/lib/anthropic.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* token from Claude OAuth credentials (macOS Keychain first, then the local credentials file).
|
|
8
8
|
*/
|
|
9
9
|
import type { BankedResetAvailability } from "../contracts/openai-quota.js";
|
|
10
|
-
import type
|
|
10
|
+
import { type ProviderFailureCategory, type QuotaAttemptOutcome } from "../contracts/provider-failure.js";
|
|
11
11
|
import type { FixedWindowProjectionEvidence } from "./entries.js";
|
|
12
12
|
import { type ResolvedAuthIdentity } from "./resolved-auth-identity.js";
|
|
13
13
|
export interface AnthropicQuotaWindow {
|
|
@@ -90,8 +90,19 @@ export interface AnthropicDiagnostics {
|
|
|
90
90
|
message?: string;
|
|
91
91
|
/** Source-assigned category for a failed OAuth usage request; absent otherwise. */
|
|
92
92
|
failureCategory?: ProviderFailureCategory;
|
|
93
|
+
/** Outcome of this attempt; never inferred from display text. */
|
|
94
|
+
attemptOutcome?: QuotaAttemptOutcome;
|
|
95
|
+
/**
|
|
96
|
+
* When the returned quota was actually measured. Absent when no quota is
|
|
97
|
+
* returned. A reused measurement keeps its original time.
|
|
98
|
+
*/
|
|
99
|
+
quotaMeasuredAtMs?: number;
|
|
100
|
+
/** True when the CLI probe itself did not complete (timeout or unusable output). */
|
|
101
|
+
probeFailure?: true;
|
|
93
102
|
/** Epoch ms when a rate-limited usage request may be retried; absent otherwise. */
|
|
94
103
|
retryAtMs?: number;
|
|
104
|
+
/** True when the usage request returned 401 and the stored token's own expiry is in the past. */
|
|
105
|
+
storedAccessTokenExpired?: true;
|
|
95
106
|
quota?: AnthropicQuotaResult;
|
|
96
107
|
/** sha256 of the OAuth token bound to this probe, when a CLI token was used. */
|
|
97
108
|
credentialFingerprint?: string;
|
|
@@ -103,6 +114,8 @@ export interface AnthropicProbeOptions {
|
|
|
103
114
|
operationCache?: Map<symbol, unknown>;
|
|
104
115
|
forceRefresh?: boolean;
|
|
105
116
|
requestTimeoutMs?: number;
|
|
117
|
+
/** Minimum spacing between Anthropic usage requests for Claude Agent. */
|
|
118
|
+
pollIntervalMs?: number;
|
|
106
119
|
}
|
|
107
120
|
export type ClaudeCommandInvocation = {
|
|
108
121
|
file: string;
|
|
@@ -130,10 +143,15 @@ export declare function fingerprintAccessToken(accessToken: string): string;
|
|
|
130
143
|
export declare function queryAnthropicQuotaWithOAuth(accessToken: string, requestTimeoutMs?: number, forcedOperationCache?: Map<symbol, unknown>): Promise<AnthropicResult>;
|
|
131
144
|
export declare function clearAnthropicDiagnosticsCacheForTests(): void;
|
|
132
145
|
export declare function getAnthropicDiagnostics(options?: AnthropicProbeOptions): Promise<AnthropicDiagnostics>;
|
|
133
|
-
export declare function hasAnthropicCredentialsConfigured(options?: AnthropicProbeOptions
|
|
146
|
+
export declare function hasAnthropicCredentialsConfigured(options?: AnthropicProbeOptions, availability?: {
|
|
147
|
+
treatUnverifiedAsConfigured?: boolean;
|
|
148
|
+
}): Promise<boolean>;
|
|
134
149
|
/**
|
|
135
|
-
* Identity of the Claude Agent provider's single Claude CLI login.
|
|
136
|
-
*
|
|
150
|
+
* Identity of the Claude Agent provider's single Claude CLI login. It is account-specific:
|
|
151
|
+
* the readable first-party token keys it, otherwise the CLI's own user-specific account evidence
|
|
152
|
+
* (email or account/user id) does. An organization id alone is shared by its members, so it never
|
|
153
|
+
* keys a scope. Without user-specific evidence, null keeps another account's last-good from being
|
|
154
|
+
* reused.
|
|
137
155
|
*/
|
|
138
156
|
export declare function resolveClaudeAgentAccountIdentity(params: {
|
|
139
157
|
binaryPath?: string;
|