aigetwey 1.0.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/CHANGELOG.md +84 -0
- package/LICENSE +21 -0
- package/README.md +302 -0
- package/assets/logo.svg +8 -0
- package/assets/screenshot.png +0 -0
- package/assets/wordmark.svg +9 -0
- package/config.example.yaml +56 -0
- package/dashboard/.env.example +12 -0
- package/dashboard/next-env.d.ts +6 -0
- package/dashboard/next.config.ts +12 -0
- package/dashboard/package-lock.json +1771 -0
- package/dashboard/package.json +29 -0
- package/dashboard/postcss.config.mjs +5 -0
- package/dashboard/src/app/(console)/combos/page.tsx +10 -0
- package/dashboard/src/app/(console)/config/page.tsx +5 -0
- package/dashboard/src/app/(console)/console/page.tsx +92 -0
- package/dashboard/src/app/(console)/endpoint/page.tsx +5 -0
- package/dashboard/src/app/(console)/layout.tsx +17 -0
- package/dashboard/src/app/(console)/page.tsx +8 -0
- package/dashboard/src/app/(console)/providers/[id]/page.tsx +6 -0
- package/dashboard/src/app/(console)/providers/page.tsx +5 -0
- package/dashboard/src/app/(console)/quota/page.tsx +5 -0
- package/dashboard/src/app/(console)/tools/[id]/page.tsx +6 -0
- package/dashboard/src/app/(console)/tools/page.tsx +5 -0
- package/dashboard/src/app/(console)/usage/page.tsx +24 -0
- package/dashboard/src/app/api/cli-detect/[tool]/route.ts +253 -0
- package/dashboard/src/app/api/gw/[...path]/route.ts +89 -0
- package/dashboard/src/app/api/login/route.ts +30 -0
- package/dashboard/src/app/api/logout/route.ts +9 -0
- package/dashboard/src/app/api/password/route.ts +34 -0
- package/dashboard/src/app/globals.css +340 -0
- package/dashboard/src/app/icon.svg +8 -0
- package/dashboard/src/app/layout.tsx +28 -0
- package/dashboard/src/app/login/page.tsx +60 -0
- package/dashboard/src/components/AreaChart.tsx +115 -0
- package/dashboard/src/components/Badge.tsx +32 -0
- package/dashboard/src/components/Button.tsx +60 -0
- package/dashboard/src/components/CapacityBadges.tsx +40 -0
- package/dashboard/src/components/Checkbox.tsx +40 -0
- package/dashboard/src/components/CliToolConfig.tsx +63 -0
- package/dashboard/src/components/ConfigEditor.tsx +199 -0
- package/dashboard/src/components/ConfirmModal.tsx +36 -0
- package/dashboard/src/components/CooldownTimer.tsx +42 -0
- package/dashboard/src/components/EndpointView.tsx +439 -0
- package/dashboard/src/components/Icon.tsx +25 -0
- package/dashboard/src/components/KeyReveal.tsx +78 -0
- package/dashboard/src/components/Lamp.tsx +8 -0
- package/dashboard/src/components/LogTable.tsx +223 -0
- package/dashboard/src/components/LogoutButton.tsx +20 -0
- package/dashboard/src/components/ModelPicker.tsx +121 -0
- package/dashboard/src/components/ModelSelectModal.tsx +126 -0
- package/dashboard/src/components/PasswordEditor.tsx +86 -0
- package/dashboard/src/components/PricingEditor.tsx +171 -0
- package/dashboard/src/components/ProviderDetail.tsx +566 -0
- package/dashboard/src/components/ProviderManager.tsx +311 -0
- package/dashboard/src/components/QuotaView.tsx +78 -0
- package/dashboard/src/components/Rail.tsx +82 -0
- package/dashboard/src/components/RichCard.tsx +46 -0
- package/dashboard/src/components/RoutingView.tsx +329 -0
- package/dashboard/src/components/ThemeProvider.tsx +36 -0
- package/dashboard/src/components/ToastProvider.tsx +58 -0
- package/dashboard/src/components/ToolDetail.tsx +475 -0
- package/dashboard/src/components/TopBar.tsx +128 -0
- package/dashboard/src/components/UsageView.tsx +151 -0
- package/dashboard/src/components/ui.tsx +54 -0
- package/dashboard/src/lib/capabilities.ts +318 -0
- package/dashboard/src/lib/cliTools.ts +120 -0
- package/dashboard/src/lib/client.ts +190 -0
- package/dashboard/src/lib/gateway.ts +269 -0
- package/dashboard/src/lib/session.ts +71 -0
- package/dashboard/src/middleware.ts +37 -0
- package/dashboard/tsconfig.json +21 -0
- package/dist/adapters/anthropic.js +289 -0
- package/dist/adapters/anthropic.js.map +1 -0
- package/dist/adapters/gemini.js +268 -0
- package/dist/adapters/gemini.js.map +1 -0
- package/dist/adapters/index.js +8 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai.js +13 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/cli/tray/autostart.js +152 -0
- package/dist/cli/tray/autostart.js.map +1 -0
- package/dist/cli/tray/icon.js +4 -0
- package/dist/cli/tray/icon.js.map +1 -0
- package/dist/cli/tray/tray.js +141 -0
- package/dist/cli/tray/tray.js.map +1 -0
- package/dist/cli/tray/trayRuntime.js +91 -0
- package/dist/cli/tray/trayRuntime.js.map +1 -0
- package/dist/cli.js +361 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.js +728 -0
- package/dist/config.js.map +1 -0
- package/dist/core/authStore.js +78 -0
- package/dist/core/authStore.js.map +1 -0
- package/dist/core/canonical.js +9 -0
- package/dist/core/canonical.js.map +1 -0
- package/dist/core/console-buffer.js +25 -0
- package/dist/core/console-buffer.js.map +1 -0
- package/dist/core/fallback.js +62 -0
- package/dist/core/fallback.js.map +1 -0
- package/dist/core/handler.js +174 -0
- package/dist/core/handler.js.map +1 -0
- package/dist/core/keypool.js +105 -0
- package/dist/core/keypool.js.map +1 -0
- package/dist/core/quota.js +165 -0
- package/dist/core/quota.js.map +1 -0
- package/dist/core/state.js +52 -0
- package/dist/core/state.js.map +1 -0
- package/dist/db.js +193 -0
- package/dist/db.js.map +1 -0
- package/dist/headroom/compress.js +44 -0
- package/dist/headroom/compress.js.map +1 -0
- package/dist/headroom/detect.js +108 -0
- package/dist/headroom/detect.js.map +1 -0
- package/dist/headroom/process.js +158 -0
- package/dist/headroom/process.js.map +1 -0
- package/dist/inject/caveman.js +30 -0
- package/dist/inject/caveman.js.map +1 -0
- package/dist/inject/index.js +24 -0
- package/dist/inject/index.js.map +1 -0
- package/dist/inject/ponytail.js +19 -0
- package/dist/inject/ponytail.js.map +1 -0
- package/dist/middleware/auth.js +66 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/providers/capabilities.js +246 -0
- package/dist/providers/capabilities.js.map +1 -0
- package/dist/providers/free.js +43 -0
- package/dist/providers/free.js.map +1 -0
- package/dist/providers/pricing.js +224 -0
- package/dist/providers/pricing.js.map +1 -0
- package/dist/providers/vertex.js +97 -0
- package/dist/providers/vertex.js.map +1 -0
- package/dist/routes/admin.js +622 -0
- package/dist/routes/admin.js.map +1 -0
- package/dist/routes/health.js +4 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/index.js +12 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/v1.js +75 -0
- package/dist/routes/v1.js.map +1 -0
- package/dist/rtk/detect.js +50 -0
- package/dist/rtk/detect.js.map +1 -0
- package/dist/rtk/filters.js +85 -0
- package/dist/rtk/filters.js.map +1 -0
- package/dist/rtk/index.js +39 -0
- package/dist/rtk/index.js.map +1 -0
- package/dist/server.js +100 -0
- package/dist/server.js.map +1 -0
- package/dist/stream/anthropic-stream.js +239 -0
- package/dist/stream/anthropic-stream.js.map +1 -0
- package/dist/stream/chunk.js +7 -0
- package/dist/stream/chunk.js.map +1 -0
- package/dist/stream/gemini-stream.js +135 -0
- package/dist/stream/gemini-stream.js.map +1 -0
- package/dist/stream/index.js +12 -0
- package/dist/stream/index.js.map +1 -0
- package/dist/stream/openai-stream.js +34 -0
- package/dist/stream/openai-stream.js.map +1 -0
- package/dist/stream/sse.js +64 -0
- package/dist/stream/sse.js.map +1 -0
- package/dist/translator/thinking.js +70 -0
- package/dist/translator/thinking.js.map +1 -0
- package/dist/translator/thinkingUnified.js +322 -0
- package/dist/translator/thinkingUnified.js.map +1 -0
- package/dist/upstream/client.js +120 -0
- package/dist/upstream/client.js.map +1 -0
- package/package.json +76 -0
- package/run.sh +27 -0
- package/src/adapters/anthropic.ts +377 -0
- package/src/adapters/gemini.ts +341 -0
- package/src/adapters/index.ts +17 -0
- package/src/adapters/openai.ts +22 -0
- package/src/cli/tray/autostart.ts +133 -0
- package/src/cli/tray/icon.ts +4 -0
- package/src/cli/tray/tray.ts +156 -0
- package/src/cli/tray/trayRuntime.ts +90 -0
- package/src/cli.ts +379 -0
- package/src/config.ts +777 -0
- package/src/core/authStore.ts +86 -0
- package/src/core/canonical.ts +93 -0
- package/src/core/console-buffer.ts +39 -0
- package/src/core/fallback.ts +116 -0
- package/src/core/handler.ts +236 -0
- package/src/core/keypool.ts +152 -0
- package/src/core/quota.ts +214 -0
- package/src/core/state.ts +65 -0
- package/src/db.ts +280 -0
- package/src/headroom/compress.ts +78 -0
- package/src/headroom/detect.ts +119 -0
- package/src/headroom/process.ts +166 -0
- package/src/inject/caveman.ts +35 -0
- package/src/inject/index.ts +46 -0
- package/src/inject/ponytail.ts +31 -0
- package/src/middleware/auth.ts +76 -0
- package/src/providers/capabilities.ts +297 -0
- package/src/providers/free.ts +53 -0
- package/src/providers/pricing.ts +261 -0
- package/src/providers/vertex.ts +117 -0
- package/src/routes/admin.ts +716 -0
- package/src/routes/health.ts +5 -0
- package/src/routes/index.ts +24 -0
- package/src/routes/v1.ts +87 -0
- package/src/rtk/detect.ts +55 -0
- package/src/rtk/filters.ts +94 -0
- package/src/rtk/index.ts +58 -0
- package/src/server.ts +108 -0
- package/src/stream/anthropic-stream.ts +310 -0
- package/src/stream/chunk.ts +46 -0
- package/src/stream/gemini-stream.ts +158 -0
- package/src/stream/index.ts +23 -0
- package/src/stream/openai-stream.ts +41 -0
- package/src/stream/sse.ts +72 -0
- package/src/translator/thinking.ts +64 -0
- package/src/translator/thinkingUnified.ts +319 -0
- package/src/upstream/client.ts +155 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Free passthrough providers (e.g. OpenCode Free). These speak OpenAI format,
|
|
3
|
+
* need no upstream auth, and expose their catalog at `{base_url}/models`. The
|
|
4
|
+
* gateway already routes them through the normal pipeline (the key pool hands
|
|
5
|
+
* out an empty key, the client omits the auth header); this module only adds the
|
|
6
|
+
* one extra capability they need — fetching the model list at runtime so it
|
|
7
|
+
* doesn't have to be hand-maintained in config.
|
|
8
|
+
*/
|
|
9
|
+
import { request } from "undici";
|
|
10
|
+
/**
|
|
11
|
+
* Fetch a provider's model catalog from `{base_url}/models` (OpenAI shape:
|
|
12
|
+
* `{ data: [{ id }] }`). Never throws — returns a structured result so the
|
|
13
|
+
* dashboard's "Connect OpenCode Free" button can surface failures inline.
|
|
14
|
+
*/
|
|
15
|
+
export async function fetchModels(provider) {
|
|
16
|
+
const base = provider.base_url.replace(/\/$/, "");
|
|
17
|
+
const headers = { ...(provider.headers ?? {}) };
|
|
18
|
+
// a free provider has no key; a keyed one still gets its bearer for /models.
|
|
19
|
+
const key = provider.api_keys?.[0] ?? provider.api_key;
|
|
20
|
+
if (key && !provider.free)
|
|
21
|
+
headers["authorization"] = `Bearer ${key}`;
|
|
22
|
+
try {
|
|
23
|
+
const res = await request(`${base}/models`, {
|
|
24
|
+
method: "GET",
|
|
25
|
+
headers,
|
|
26
|
+
headersTimeout: 15_000,
|
|
27
|
+
bodyTimeout: 15_000,
|
|
28
|
+
});
|
|
29
|
+
if (res.statusCode >= 400) {
|
|
30
|
+
await res.body.dump();
|
|
31
|
+
return { ok: false, models: [], error: `models endpoint returned ${res.statusCode}` };
|
|
32
|
+
}
|
|
33
|
+
const body = (await res.body.json());
|
|
34
|
+
const models = (body.data ?? [])
|
|
35
|
+
.map((m) => (typeof m.id === "string" ? { id: m.id } : null))
|
|
36
|
+
.filter((m) => m !== null);
|
|
37
|
+
return { ok: true, models };
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
return { ok: false, models: [], error: e.message };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=free.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free.js","sourceRoot":"","sources":["../../src/providers/free.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAajC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAkB;IAClD,MAAM,IAAI,GA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,CAAC;QAChD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAG,CAAW,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// Pricing rates for AI models — all rates in $/1M tokens
|
|
2
|
+
//
|
|
3
|
+
// Fallback order (first match wins):
|
|
4
|
+
// 1. PROVIDER_PRICING[provider][model] — provider-specific override
|
|
5
|
+
// 2. MODEL_PRICING[model] — canonical model price (provider-agnostic)
|
|
6
|
+
// 3. PATTERN_PRICING — glob pattern match (e.g. "codex-*")
|
|
7
|
+
/**
|
|
8
|
+
* Canonical model pricing — provider-agnostic.
|
|
9
|
+
* Cover all known models; deduplicated across providers.
|
|
10
|
+
*/
|
|
11
|
+
export const MODEL_PRICING = {
|
|
12
|
+
// === Anthropic / Claude ===
|
|
13
|
+
"claude-opus-4-6": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 25.00, cache_creation: 6.25 },
|
|
14
|
+
"claude-opus-4-5-20251101": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 25.00, cache_creation: 6.25 },
|
|
15
|
+
"claude-sonnet-4-6": { input: 3.00, output: 15.00, cached: 0.30, reasoning: 15.00, cache_creation: 3.75 },
|
|
16
|
+
"claude-sonnet-4-5-20250929": { input: 3.00, output: 15.00, cached: 0.30, reasoning: 15.00, cache_creation: 3.75 },
|
|
17
|
+
"claude-haiku-4-5-20251001": { input: 1.00, output: 5.00, cached: 0.10, reasoning: 5.00, cache_creation: 1.25 },
|
|
18
|
+
"claude-sonnet-4-20250514": { input: 3.00, output: 15.00, cached: 1.50, reasoning: 15.00, cache_creation: 3.00 },
|
|
19
|
+
"claude-opus-4-20250514": { input: 15.00, output: 25.00, cached: 7.50, reasoning: 112.50, cache_creation: 15.00 },
|
|
20
|
+
"claude-3-5-sonnet-20241022": { input: 3.00, output: 15.00, cached: 1.50, reasoning: 15.00, cache_creation: 3.00 },
|
|
21
|
+
"claude-haiku-4.5": { input: 0.50, output: 2.50, cached: 0.05, reasoning: 3.75, cache_creation: 0.50 },
|
|
22
|
+
"claude-opus-4.1": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 37.50, cache_creation: 5.00 },
|
|
23
|
+
"claude-opus-4.5": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 37.50, cache_creation: 5.00 },
|
|
24
|
+
"claude-opus-4.6": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 37.50, cache_creation: 5.00 },
|
|
25
|
+
"claude-sonnet-4": { input: 3.00, output: 15.00, cached: 0.30, reasoning: 22.50, cache_creation: 3.00 },
|
|
26
|
+
"claude-sonnet-4.5": { input: 3.00, output: 15.00, cached: 0.30, reasoning: 22.50, cache_creation: 3.00 },
|
|
27
|
+
"claude-sonnet-4.6": { input: 3.00, output: 15.00, cached: 0.30, reasoning: 22.50, cache_creation: 3.00 },
|
|
28
|
+
"claude-opus-4-5-thinking": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 37.50, cache_creation: 5.00 },
|
|
29
|
+
"claude-opus-4-6-thinking": { input: 5.00, output: 25.00, cached: 0.50, reasoning: 37.50, cache_creation: 5.00 },
|
|
30
|
+
// === OpenAI / GPT ===
|
|
31
|
+
"gpt-3.5-turbo": { input: 0.50, output: 1.50, cached: 0.25, reasoning: 2.25, cache_creation: 0.50 },
|
|
32
|
+
"gpt-4": { input: 2.50, output: 10.00, cached: 1.25, reasoning: 15.00, cache_creation: 2.50 },
|
|
33
|
+
"gpt-4-turbo": { input: 10.00, output: 30.00, cached: 5.00, reasoning: 45.00, cache_creation: 10.00 },
|
|
34
|
+
"gpt-4o": { input: 2.50, output: 10.00, cached: 1.25, reasoning: 15.00, cache_creation: 2.50 },
|
|
35
|
+
"gpt-4o-mini": { input: 0.15, output: 0.60, cached: 0.075, reasoning: 0.90, cache_creation: 0.15 },
|
|
36
|
+
"gpt-4.1": { input: 2.50, output: 10.00, cached: 1.25, reasoning: 15.00, cache_creation: 2.50 },
|
|
37
|
+
"gpt-5": { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 },
|
|
38
|
+
"gpt-5-mini": { input: 0.75, output: 3.00, cached: 0.375, reasoning: 4.50, cache_creation: 0.75 },
|
|
39
|
+
"gpt-5-codex": { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 },
|
|
40
|
+
"gpt-5.1": { input: 4.00, output: 16.00, cached: 2.00, reasoning: 24.00, cache_creation: 4.00 },
|
|
41
|
+
"gpt-5.1-codex": { input: 4.00, output: 16.00, cached: 2.00, reasoning: 24.00, cache_creation: 4.00 },
|
|
42
|
+
"gpt-5.1-codex-mini": { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 },
|
|
43
|
+
"gpt-5.1-codex-mini-high": { input: 2.00, output: 8.00, cached: 1.00, reasoning: 12.00, cache_creation: 2.00 },
|
|
44
|
+
"gpt-5.1-codex-max": { input: 8.00, output: 32.00, cached: 4.00, reasoning: 48.00, cache_creation: 8.00 },
|
|
45
|
+
"gpt-5.2": { input: 5.00, output: 20.00, cached: 2.50, reasoning: 30.00, cache_creation: 5.00 },
|
|
46
|
+
"gpt-5.2-codex": { input: 5.00, output: 20.00, cached: 2.50, reasoning: 30.00, cache_creation: 5.00 },
|
|
47
|
+
"gpt-5.3-codex": { input: 6.00, output: 24.00, cached: 3.00, reasoning: 36.00, cache_creation: 6.00 },
|
|
48
|
+
"gpt-5.3-codex-xhigh": { input: 10.00, output: 40.00, cached: 5.00, reasoning: 60.00, cache_creation: 10.00 },
|
|
49
|
+
"gpt-5.3-codex-high": { input: 8.00, output: 32.00, cached: 4.00, reasoning: 48.00, cache_creation: 8.00 },
|
|
50
|
+
"gpt-5.3-codex-low": { input: 4.00, output: 16.00, cached: 2.00, reasoning: 24.00, cache_creation: 4.00 },
|
|
51
|
+
"gpt-5.3-codex-none": { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 },
|
|
52
|
+
"gpt-5.3-codex-spark": { input: 3.00, output: 12.00, cached: 0.30, reasoning: 12.00, cache_creation: 3.00 },
|
|
53
|
+
"o1": { input: 15.00, output: 60.00, cached: 7.50, reasoning: 90.00, cache_creation: 15.00 },
|
|
54
|
+
"o1-mini": { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 },
|
|
55
|
+
// === Gemini ===
|
|
56
|
+
"gemini-3-flash-preview": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
|
57
|
+
"gemini-3-pro-preview": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
|
58
|
+
"gemini-3.1-pro-low": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
|
59
|
+
"gemini-3.1-pro-high": { input: 4.00, output: 18.00, cached: 0.50, reasoning: 27.00, cache_creation: 4.00 },
|
|
60
|
+
"gemini-pro-agent": { input: 4.00, output: 18.00, cached: 0.50, reasoning: 27.00, cache_creation: 4.00 },
|
|
61
|
+
"gemini-3-flash-agent": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
|
62
|
+
"gemini-3.5-flash-low": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
|
63
|
+
"gemini-3.5-flash-extra-low": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
|
64
|
+
"gemini-3-flash": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
|
65
|
+
"gemini-2.5-pro": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
|
66
|
+
"gemini-2.5-flash": { input: 0.30, output: 2.50, cached: 0.03, reasoning: 3.75, cache_creation: 0.30 },
|
|
67
|
+
"gemini-2.5-flash-lite": { input: 0.15, output: 1.25, cached: 0.015, reasoning: 1.875, cache_creation: 0.15 },
|
|
68
|
+
// === Qwen ===
|
|
69
|
+
"qwen3-coder-plus": { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 },
|
|
70
|
+
"qwen3-coder-flash": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
71
|
+
// === Kimi ===
|
|
72
|
+
"kimi-k2": { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 },
|
|
73
|
+
"kimi-k2-thinking": { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 },
|
|
74
|
+
"kimi-k2.5": { input: 1.20, output: 4.80, cached: 0.60, reasoning: 7.20, cache_creation: 1.20 },
|
|
75
|
+
"kimi-k2.5-thinking": { input: 1.80, output: 7.20, cached: 0.90, reasoning: 10.80, cache_creation: 1.80 },
|
|
76
|
+
"kimi-latest": { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 },
|
|
77
|
+
// === DeepSeek ===
|
|
78
|
+
"deepseek-chat": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
79
|
+
"deepseek-reasoner": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
80
|
+
"deepseek-r1": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
81
|
+
"deepseek-v3.2-chat": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
82
|
+
"deepseek-v3.2-reasoner": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
83
|
+
"deepseek-v4-flash": { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 },
|
|
84
|
+
"deepseek-v4-pro": { input: 0.435, output: 0.87, cached: 0.003625, reasoning: 0.87, cache_creation: 0.435 },
|
|
85
|
+
// === GLM ===
|
|
86
|
+
"glm-4.6": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
87
|
+
"glm-4.6v": { input: 0.75, output: 3.00, cached: 0.375, reasoning: 4.50, cache_creation: 0.75 },
|
|
88
|
+
"glm-4.7": { input: 0.75, output: 3.00, cached: 0.375, reasoning: 4.50, cache_creation: 0.75 },
|
|
89
|
+
"glm-5": { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 },
|
|
90
|
+
// === MiniMax ===
|
|
91
|
+
"MiniMax-M3": { input: 0.30, output: 1.20, cached: 0.06, reasoning: 1.80, cache_creation: 0.30 },
|
|
92
|
+
"MiniMax-M2.1": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
93
|
+
"MiniMax-M2.5": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
94
|
+
"MiniMax-M2.7": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
95
|
+
"minimax-m2.1": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
96
|
+
"minimax-m2.5": { input: 0.60, output: 2.40, cached: 0.30, reasoning: 3.60, cache_creation: 0.60 },
|
|
97
|
+
// === Grok ===
|
|
98
|
+
"grok-code-fast-1": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
99
|
+
// === OpenRouter fallback ===
|
|
100
|
+
"auto": { input: 2.00, output: 8.00, cached: 1.00, reasoning: 12.00, cache_creation: 2.00 },
|
|
101
|
+
// === Misc ===
|
|
102
|
+
"oswe-vscode-prime": { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 },
|
|
103
|
+
"gpt-oss-120b-medium": { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 },
|
|
104
|
+
"vision-model": { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 },
|
|
105
|
+
"coder-model": { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 },
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Provider-specific pricing overrides.
|
|
109
|
+
* Only include entries where price DIFFERS from MODEL_PRICING.
|
|
110
|
+
* Keyed by provider alias (cc, cx, gc, gh, ...) or provider id (openai, anthropic, ...).
|
|
111
|
+
*/
|
|
112
|
+
export const PROVIDER_PRICING = {
|
|
113
|
+
// GitHub Copilot (gh) — gpt-5.3-codex has different rate than canonical
|
|
114
|
+
gh: {
|
|
115
|
+
"gpt-5.3-codex": { input: 1.75, output: 14.00, cached: 0.175, reasoning: 14.00, cache_creation: 1.75 },
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Pattern-based pricing fallback — matched when no exact model entry found.
|
|
120
|
+
* Patterns use simple glob: "*" matches any substring.
|
|
121
|
+
* First match wins — order matters.
|
|
122
|
+
*/
|
|
123
|
+
export const PATTERN_PRICING = [
|
|
124
|
+
// --- Codex variants ---
|
|
125
|
+
{ pattern: "*-codex-xhigh", pricing: { input: 10.00, output: 40.00, cached: 5.00, reasoning: 60.00, cache_creation: 10.00 } },
|
|
126
|
+
{ pattern: "*-codex-high", pricing: { input: 8.00, output: 32.00, cached: 4.00, reasoning: 48.00, cache_creation: 8.00 } },
|
|
127
|
+
{ pattern: "*-codex-max", pricing: { input: 8.00, output: 32.00, cached: 4.00, reasoning: 48.00, cache_creation: 8.00 } },
|
|
128
|
+
{ pattern: "*-codex-mini-*", pricing: { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 } },
|
|
129
|
+
{ pattern: "*-codex-mini", pricing: { input: 1.50, output: 6.00, cached: 0.75, reasoning: 9.00, cache_creation: 1.50 } },
|
|
130
|
+
{ pattern: "*-codex-low", pricing: { input: 4.00, output: 16.00, cached: 2.00, reasoning: 24.00, cache_creation: 4.00 } },
|
|
131
|
+
{ pattern: "*-codex-none", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
132
|
+
{ pattern: "*-codex-spark", pricing: { input: 3.00, output: 12.00, cached: 0.30, reasoning: 12.00, cache_creation: 3.00 } },
|
|
133
|
+
{ pattern: "codex-*", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
134
|
+
{ pattern: "*-codex", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
135
|
+
// --- Claude ---
|
|
136
|
+
{ pattern: "claude-opus-*", pricing: { input: 5.00, output: 25.00, cached: 0.50, reasoning: 25.00, cache_creation: 6.25 } },
|
|
137
|
+
{ pattern: "claude-sonnet-*", pricing: { input: 3.00, output: 15.00, cached: 0.30, reasoning: 15.00, cache_creation: 3.75 } },
|
|
138
|
+
{ pattern: "claude-haiku-*", pricing: { input: 1.00, output: 5.00, cached: 0.10, reasoning: 5.00, cache_creation: 1.25 } },
|
|
139
|
+
{ pattern: "claude-*", pricing: { input: 3.00, output: 15.00, cached: 0.30, reasoning: 15.00, cache_creation: 3.75 } },
|
|
140
|
+
// --- Gemini (specific first, generic last) ---
|
|
141
|
+
{ pattern: "gemini-*-flash-lite", pricing: { input: 0.15, output: 1.25, cached: 0.015, reasoning: 1.875, cache_creation: 0.15 } },
|
|
142
|
+
{ pattern: "gemini-*-flash", pricing: { input: 0.30, output: 2.50, cached: 0.03, reasoning: 3.75, cache_creation: 0.30 } },
|
|
143
|
+
{ pattern: "gemini-*-pro", pricing: { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 } },
|
|
144
|
+
{ pattern: "gemini-3-*", pricing: { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 } },
|
|
145
|
+
{ pattern: "gemini-2.5-*", pricing: { input: 0.30, output: 2.50, cached: 0.03, reasoning: 3.75, cache_creation: 0.30 } },
|
|
146
|
+
{ pattern: "gemini-*", pricing: { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 } },
|
|
147
|
+
// --- GPT (specific first, generic last) ---
|
|
148
|
+
{ pattern: "gpt-5.3-*", pricing: { input: 6.00, output: 24.00, cached: 3.00, reasoning: 36.00, cache_creation: 6.00 } },
|
|
149
|
+
{ pattern: "gpt-5.2-*", pricing: { input: 5.00, output: 20.00, cached: 2.50, reasoning: 30.00, cache_creation: 5.00 } },
|
|
150
|
+
{ pattern: "gpt-5.1-*", pricing: { input: 4.00, output: 16.00, cached: 2.00, reasoning: 24.00, cache_creation: 4.00 } },
|
|
151
|
+
{ pattern: "gpt-5-*", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
152
|
+
{ pattern: "gpt-5*", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
153
|
+
{ pattern: "gpt-4o-*", pricing: { input: 0.15, output: 0.60, cached: 0.075, reasoning: 0.90, cache_creation: 0.15 } },
|
|
154
|
+
{ pattern: "gpt-4o", pricing: { input: 2.50, output: 10.00, cached: 1.25, reasoning: 15.00, cache_creation: 2.50 } },
|
|
155
|
+
{ pattern: "gpt-4*", pricing: { input: 2.50, output: 10.00, cached: 1.25, reasoning: 15.00, cache_creation: 2.50 } },
|
|
156
|
+
// --- o1 / o-series ---
|
|
157
|
+
{ pattern: "o1-*", pricing: { input: 3.00, output: 12.00, cached: 1.50, reasoning: 18.00, cache_creation: 3.00 } },
|
|
158
|
+
{ pattern: "o1", pricing: { input: 15.00, output: 60.00, cached: 7.50, reasoning: 90.00, cache_creation: 15.00 } },
|
|
159
|
+
{ pattern: "o3-*", pricing: { input: 10.00, output: 40.00, cached: 5.00, reasoning: 60.00, cache_creation: 10.00 } },
|
|
160
|
+
{ pattern: "o4-*", pricing: { input: 2.00, output: 8.00, cached: 1.00, reasoning: 12.00, cache_creation: 2.00 } },
|
|
161
|
+
// --- Qwen ---
|
|
162
|
+
{ pattern: "qwen3-coder-*", pricing: { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 } },
|
|
163
|
+
{ pattern: "qwen*-coder-*", pricing: { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 } },
|
|
164
|
+
{ pattern: "qwen*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
165
|
+
// --- Kimi ---
|
|
166
|
+
{ pattern: "kimi-*-thinking", pricing: { input: 1.80, output: 7.20, cached: 0.90, reasoning: 10.80, cache_creation: 1.80 } },
|
|
167
|
+
{ pattern: "kimi-k2*", pricing: { input: 1.20, output: 4.80, cached: 0.60, reasoning: 7.20, cache_creation: 1.20 } },
|
|
168
|
+
{ pattern: "kimi-*", pricing: { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 } },
|
|
169
|
+
// --- DeepSeek ---
|
|
170
|
+
{ pattern: "deepseek-*reasoner*", pricing: { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 } },
|
|
171
|
+
{ pattern: "deepseek-r*", pricing: { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 } },
|
|
172
|
+
{ pattern: "deepseek-v*", pricing: { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 } },
|
|
173
|
+
{ pattern: "deepseek-*", pricing: { input: 0.14, output: 0.28, cached: 0.0028, reasoning: 0.28, cache_creation: 0.14 } },
|
|
174
|
+
// --- GLM ---
|
|
175
|
+
{ pattern: "glm-5*", pricing: { input: 1.00, output: 4.00, cached: 0.50, reasoning: 6.00, cache_creation: 1.00 } },
|
|
176
|
+
{ pattern: "glm-4*", pricing: { input: 0.75, output: 3.00, cached: 0.375, reasoning: 4.50, cache_creation: 0.75 } },
|
|
177
|
+
{ pattern: "glm-*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
178
|
+
// --- MiniMax ---
|
|
179
|
+
{ pattern: "MiniMax-*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
180
|
+
{ pattern: "minimax-*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
181
|
+
// --- Grok ---
|
|
182
|
+
{ pattern: "grok-code-*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
183
|
+
{ pattern: "grok-*", pricing: { input: 0.50, output: 2.00, cached: 0.25, reasoning: 3.00, cache_creation: 0.50 } },
|
|
184
|
+
];
|
|
185
|
+
/**
|
|
186
|
+
* Match a model ID against a glob pattern (* = wildcard). Case-insensitive:
|
|
187
|
+
* registry ids mix casing (e.g. "MiniMax-M2.5" vs "minimax-m2.5").
|
|
188
|
+
*/
|
|
189
|
+
export function matchPattern(pattern, model) {
|
|
190
|
+
const regex = new RegExp("^" + pattern.split("*").map(s => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(".*") + "$", "i");
|
|
191
|
+
return regex.test(model);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Resolve pricing for a model using the 3-step fallback chain:
|
|
195
|
+
* 1. PROVIDER_PRICING[provider][model]
|
|
196
|
+
* 2. MODEL_PRICING[model]
|
|
197
|
+
* 3. PATTERN_PRICING (glob match)
|
|
198
|
+
*
|
|
199
|
+
* @param {string} provider
|
|
200
|
+
* @param {string} model
|
|
201
|
+
* @returns {object|null}
|
|
202
|
+
*/
|
|
203
|
+
export function getPricingForModel(provider, model) {
|
|
204
|
+
if (!model)
|
|
205
|
+
return null;
|
|
206
|
+
// 1. Provider-specific override
|
|
207
|
+
if (provider && PROVIDER_PRICING[provider]?.[model]) {
|
|
208
|
+
return PROVIDER_PRICING[provider][model];
|
|
209
|
+
}
|
|
210
|
+
// 2. Canonical model pricing (strip vendor prefix if needed: "deepseek/deepseek-chat" → "deepseek-chat")
|
|
211
|
+
const baseModel = (model.includes("/") ? model.split("/").pop() : model) ?? model;
|
|
212
|
+
if (MODEL_PRICING[baseModel])
|
|
213
|
+
return MODEL_PRICING[baseModel];
|
|
214
|
+
if (MODEL_PRICING[model])
|
|
215
|
+
return MODEL_PRICING[model];
|
|
216
|
+
// 3. Pattern match
|
|
217
|
+
for (const { pattern, pricing } of PATTERN_PRICING) {
|
|
218
|
+
if (matchPattern(pattern, baseModel) || matchPattern(pattern, model)) {
|
|
219
|
+
return pricing;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=pricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/providers/pricing.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,qCAAqC;AACrC,uEAAuE;AACvE,sFAAsF;AACtF,gFAAgF;AAchF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,6BAA6B;IAC7B,iBAAiB,EAAe,EAAE,KAAK,EAAE,IAAI,EAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAG,SAAS,EAAE,KAAK,EAAG,cAAc,EAAE,IAAI,EAAG;IACxH,0BAA0B,EAAM,EAAE,KAAK,EAAE,IAAI,EAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAG,SAAS,EAAE,KAAK,EAAG,cAAc,EAAE,IAAI,EAAG;IACxH,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CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAClF,IAAI,aAAa,CAAC,SAAS,CAAC;QAAE,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9D,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;IAEtD,mBAAmB;IACnB,KAAK,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,eAAe,EAAE,CAAC;QACnD,IAAI,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;YACrE,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vertex AI auth via a GCP service account (not user OAuth). Reads the service
|
|
3
|
+
* account JSON, mints a signed JWT, and exchanges it for an access token at
|
|
4
|
+
* Google's token endpoint. Tokens are cached and refreshed shortly before expiry
|
|
5
|
+
* so the hot request path never blocks on a network round-trip when avoidable.
|
|
6
|
+
*
|
|
7
|
+
* The access token becomes the provider's bearer key in the upstream client;
|
|
8
|
+
* Vertex models otherwise speak the Gemini format the gemini adapter already
|
|
9
|
+
* handles.
|
|
10
|
+
*/
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
import { createSign } from "node:crypto";
|
|
13
|
+
import { request } from "undici";
|
|
14
|
+
const SCOPE = "https://www.googleapis.com/auth/cloud-platform";
|
|
15
|
+
const DEFAULT_TOKEN_URI = "https://oauth2.googleapis.com/token";
|
|
16
|
+
// refresh this many ms before the real expiry so a token never goes stale mid-flight.
|
|
17
|
+
const EXPIRY_SKEW_MS = 60_000;
|
|
18
|
+
function base64url(input) {
|
|
19
|
+
return Buffer.from(input).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
20
|
+
}
|
|
21
|
+
function loadServiceAccount(path) {
|
|
22
|
+
const sa = JSON.parse(readFileSync(path, "utf8"));
|
|
23
|
+
if (!sa.client_email || !sa.private_key) {
|
|
24
|
+
throw new Error(`service account ${path} missing client_email/private_key`);
|
|
25
|
+
}
|
|
26
|
+
return { client_email: sa.client_email, private_key: sa.private_key, token_uri: sa.token_uri };
|
|
27
|
+
}
|
|
28
|
+
/** Build and RS256-sign the JWT assertion used in the token exchange. */
|
|
29
|
+
function buildAssertion(sa, nowSec) {
|
|
30
|
+
const header = base64url(JSON.stringify({ alg: "RS256", typ: "JWT" }));
|
|
31
|
+
const claims = base64url(JSON.stringify({
|
|
32
|
+
iss: sa.client_email,
|
|
33
|
+
scope: SCOPE,
|
|
34
|
+
aud: sa.token_uri ?? DEFAULT_TOKEN_URI,
|
|
35
|
+
iat: nowSec,
|
|
36
|
+
exp: nowSec + 3600,
|
|
37
|
+
}));
|
|
38
|
+
const signingInput = `${header}.${claims}`;
|
|
39
|
+
const signature = createSign("RSA-SHA256").update(signingInput).sign(sa.private_key);
|
|
40
|
+
return `${signingInput}.${base64url(signature)}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Token provider for one service account file. Caches the access token and
|
|
44
|
+
* exchanges a new one only when the cached token is missing or near expiry.
|
|
45
|
+
* In-memory only — restart re-mints, which is fine for personal use.
|
|
46
|
+
*/
|
|
47
|
+
export class VertexAuth {
|
|
48
|
+
serviceAccountPath;
|
|
49
|
+
now;
|
|
50
|
+
cache = null;
|
|
51
|
+
inflight = null;
|
|
52
|
+
constructor(serviceAccountPath, now = Date.now) {
|
|
53
|
+
this.serviceAccountPath = serviceAccountPath;
|
|
54
|
+
this.now = now;
|
|
55
|
+
}
|
|
56
|
+
/** A valid access token, minting/refreshing if needed. */
|
|
57
|
+
async getToken() {
|
|
58
|
+
const t = this.now();
|
|
59
|
+
if (this.cache && this.cache.expiresAt - EXPIRY_SKEW_MS > t)
|
|
60
|
+
return this.cache.token;
|
|
61
|
+
// collapse concurrent refreshes so a burst of requests mints only one token.
|
|
62
|
+
if (this.inflight)
|
|
63
|
+
return this.inflight;
|
|
64
|
+
this.inflight = this.exchange().finally(() => {
|
|
65
|
+
this.inflight = null;
|
|
66
|
+
});
|
|
67
|
+
return this.inflight;
|
|
68
|
+
}
|
|
69
|
+
async exchange() {
|
|
70
|
+
const sa = loadServiceAccount(this.serviceAccountPath);
|
|
71
|
+
const nowSec = Math.floor(this.now() / 1000);
|
|
72
|
+
const assertion = buildAssertion(sa, nowSec);
|
|
73
|
+
const res = await request(sa.token_uri ?? DEFAULT_TOKEN_URI, {
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
76
|
+
body: new URLSearchParams({
|
|
77
|
+
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
|
78
|
+
assertion,
|
|
79
|
+
}).toString(),
|
|
80
|
+
headersTimeout: 15_000,
|
|
81
|
+
bodyTimeout: 15_000,
|
|
82
|
+
});
|
|
83
|
+
if (res.statusCode >= 400) {
|
|
84
|
+
const text = await res.body.text();
|
|
85
|
+
throw new Error(`vertex token exchange failed (${res.statusCode}): ${text}`);
|
|
86
|
+
}
|
|
87
|
+
const body = (await res.body.json());
|
|
88
|
+
if (!body.access_token)
|
|
89
|
+
throw new Error("vertex token exchange returned no access_token");
|
|
90
|
+
const ttlMs = (body.expires_in ?? 3600) * 1000;
|
|
91
|
+
this.cache = { token: body.access_token, expiresAt: this.now() + ttlMs };
|
|
92
|
+
return body.access_token;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// expose internals for unit testing the JWT build without a network call.
|
|
96
|
+
export const _internal = { buildAssertion, base64url, loadServiceAccount };
|
|
97
|
+
//# sourceMappingURL=vertex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex.js","sourceRoot":"","sources":["../../src/providers/vertex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY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