@anthonyhaussman/opencode-agy-auth 1.1.14-alpha.0 → 1.1.14-alpha.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.
@@ -1,3 +1,4 @@
1
+ import type { RetrieveUserQuotaSummaryResponse } from "../../plugin/project/types";
1
2
  export interface QuotaContext {
2
3
  terminal: boolean;
3
4
  retryDelayMs?: number;
@@ -21,8 +22,16 @@ declare function parseRetryDelayValue(value: string | {
21
22
  nanos?: number;
22
23
  }): number | null;
23
24
  declare function parseRetryDelayFromMessage(message: string): number | null;
25
+ export declare const MAX_QUOTA_RESET_WAIT_MS = 7200000;
26
+ export declare function findResetTimeForModel(summary: RetrieveUserQuotaSummaryResponse | null | undefined, model?: string): string | null;
27
+ export declare function resolveQuotaResetDelay(accessToken: string, projectId: string, model?: string, userAgentModel?: string): Promise<{
28
+ waitMs: number;
29
+ resetTime: string;
30
+ } | null>;
24
31
  export declare const retryInternals: {
25
32
  parseRetryDelayValue: typeof parseRetryDelayValue;
26
33
  parseRetryDelayFromMessage: typeof parseRetryDelayFromMessage;
34
+ findResetTimeForModel: typeof findResetTimeForModel;
35
+ resolveQuotaResetDelay: typeof resolveQuotaResetDelay;
27
36
  };
28
37
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthonyhaussman/opencode-agy-auth",
3
- "version": "1.1.14-alpha.0",
3
+ "version": "1.1.14-alpha.2",
4
4
  "author": "antigravity",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -19,6 +19,9 @@
19
19
  "license": "MIT",
20
20
  "type": "module",
21
21
  "scripts": {
22
+ "test": "vitest run",
23
+ "test:coverage": "vitest run --coverage",
24
+ "test:watch": "vitest",
22
25
  "build": "tsup && tsc -p tsconfig.build.json",
23
26
  "typecheck": "tsc",
24
27
  "models:refresh": "node scripts/fetch-models.mjs",
@@ -28,8 +31,10 @@
28
31
  "devDependencies": {
29
32
  "@opencode-ai/sdk": "^1.18.18",
30
33
  "@types/node": "^26.2.0",
34
+ "@vitest/coverage-v8": "^4.1.10",
31
35
  "tsup": "^8.5.1",
32
- "typescript": "^7.0.2"
36
+ "typescript": "^7.0.2",
37
+ "vitest": "^4.1.10"
33
38
  },
34
39
  "dependencies": {
35
40
  "@ai-sdk/google": "^4.0.44",