@prestyj/core 5.32.2 → 5.34.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/dist/{chunk-6I3APHDP.js → chunk-7IHCMEIY.js} +1237 -484
- package/dist/chunk-7IHCMEIY.js.map +1 -0
- package/dist/{chunk-W4NHU4UL.js → chunk-DVWS2KEW.js} +4 -2
- package/dist/chunk-DVWS2KEW.js.map +1 -0
- package/dist/index.cjs +1615 -480
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +301 -95
- package/dist/index.d.ts +301 -95
- package/dist/index.js +423 -28
- package/dist/index.js.map +1 -1
- package/dist/model-registry.cjs +299 -81
- package/dist/model-registry.cjs.map +1 -1
- package/dist/model-registry.d.cts +43 -5
- package/dist/model-registry.d.ts +43 -5
- package/dist/model-registry.js +12 -2
- package/dist/paths.cjs +3 -1
- package/dist/paths.cjs.map +1 -1
- package/dist/paths.d.cts +4 -0
- package/dist/paths.d.ts +4 -0
- package/dist/paths.js +1 -1
- package/package.json +16 -3
- package/dist/chunk-6I3APHDP.js.map +0 -1
- package/dist/chunk-W4NHU4UL.js.map +0 -1
package/dist/model-registry.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var model_registry_exports = {};
|
|
32
32
|
__export(model_registry_exports, {
|
|
33
33
|
DEFAULT_MAX_VIDEO_BYTES: () => DEFAULT_MAX_VIDEO_BYTES,
|
|
34
|
+
HIDDEN_PROVIDERS: () => HIDDEN_PROVIDERS,
|
|
34
35
|
MODELS: () => MODELS,
|
|
35
36
|
clearRuntimeModels: () => clearRuntimeModels,
|
|
36
37
|
getAllModels: () => getAllModels,
|
|
@@ -39,14 +40,18 @@ __export(model_registry_exports, {
|
|
|
39
40
|
getContextWindow: () => getContextWindow,
|
|
40
41
|
getDefaultModel: () => getDefaultModel,
|
|
41
42
|
getDefaultThinkingLevel: () => getDefaultThinkingLevel,
|
|
43
|
+
getListedModels: () => getListedModels,
|
|
42
44
|
getMaxThinkingLevel: () => getMaxThinkingLevel,
|
|
43
45
|
getModel: () => getModel,
|
|
44
46
|
getModelsForProvider: () => getModelsForProvider,
|
|
47
|
+
getProviderCatalog: () => getProviderCatalog,
|
|
45
48
|
getSummaryModel: () => getSummaryModel,
|
|
46
49
|
getToolResultCharLimit: () => getToolResultCharLimit,
|
|
47
50
|
getVideoByteLimit: () => getVideoByteLimit,
|
|
51
|
+
isHiddenProvider: () => isHiddenProvider,
|
|
48
52
|
isPaidModel: () => isPaidModel,
|
|
49
53
|
registerRuntimeModels: () => registerRuntimeModels,
|
|
54
|
+
setProviderCatalog: () => setProviderCatalog,
|
|
50
55
|
usesOpenAICodexTransport: () => usesOpenAICodexTransport,
|
|
51
56
|
withoutPaidTier: () => withoutPaidTier
|
|
52
57
|
});
|
|
@@ -76,40 +81,26 @@ function isKimiCodingEndpoint(baseUrl) {
|
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
// src/auth-storage.ts
|
|
79
|
-
var
|
|
80
|
-
var
|
|
81
|
-
var
|
|
84
|
+
var import_promises5 = __toESM(require("fs/promises"), 1);
|
|
85
|
+
var import_node_fs5 = require("fs");
|
|
86
|
+
var import_node_crypto7 = __toESM(require("crypto"), 1);
|
|
82
87
|
|
|
83
88
|
// src/oauth/anthropic.ts
|
|
84
|
-
var
|
|
89
|
+
var import_node_crypto2 = __toESM(require("crypto"), 1);
|
|
85
90
|
|
|
86
91
|
// src/claude-code-version.ts
|
|
87
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
88
|
-
var import_node_fs3 = require("fs");
|
|
89
|
-
var import_node_path4 = __toESM(require("path"), 1);
|
|
90
|
-
|
|
91
|
-
// src/logger.ts
|
|
92
|
-
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
93
|
-
var import_node_path3 = __toESM(require("path"), 1);
|
|
94
|
-
var import_node_crypto2 = require("crypto");
|
|
95
92
|
var import_ai = require("@prestyj/ai");
|
|
96
|
-
var MAX_BYTES = 10 * 1024 * 1024;
|
|
97
|
-
var MIN_HEADROOM_BYTES = 64 * 1024;
|
|
98
|
-
|
|
99
|
-
// src/claude-code-version.ts
|
|
100
|
-
var CACHE_FRESH_MS = 60 * 60 * 1e3;
|
|
101
|
-
var CACHE_HARD_MS = 24 * 60 * 60 * 1e3;
|
|
102
93
|
|
|
103
94
|
// src/oauth/anthropic.ts
|
|
104
95
|
var CLIENT_ID = atob("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl");
|
|
105
96
|
|
|
106
97
|
// src/oauth/openai.ts
|
|
107
98
|
var import_node_http = __toESM(require("http"), 1);
|
|
108
|
-
var
|
|
99
|
+
var import_node_crypto3 = __toESM(require("crypto"), 1);
|
|
109
100
|
|
|
110
101
|
// src/oauth/gemini.ts
|
|
111
102
|
var import_node_http2 = __toESM(require("http"), 1);
|
|
112
|
-
var
|
|
103
|
+
var import_node_crypto4 = __toESM(require("crypto"), 1);
|
|
113
104
|
var SCOPE = [
|
|
114
105
|
"https://www.googleapis.com/auth/cloud-platform",
|
|
115
106
|
"https://www.googleapis.com/auth/userinfo.email",
|
|
@@ -120,14 +111,42 @@ var SCOPE = [
|
|
|
120
111
|
var DEVICE_TIMEOUT_FALLBACK_MS = 10 * 60 * 1e3;
|
|
121
112
|
|
|
122
113
|
// src/file-lock.ts
|
|
123
|
-
var
|
|
124
|
-
var
|
|
114
|
+
var import_promises = __toESM(require("fs/promises"), 1);
|
|
115
|
+
var import_promises2 = require("timers/promises");
|
|
116
|
+
|
|
117
|
+
// src/logger.ts
|
|
118
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
119
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
120
|
+
var import_node_crypto5 = require("crypto");
|
|
121
|
+
var import_ai2 = require("@prestyj/ai");
|
|
122
|
+
var MAX_BYTES = 10 * 1024 * 1024;
|
|
123
|
+
var MIN_HEADROOM_BYTES = 64 * 1024;
|
|
124
|
+
|
|
125
|
+
// src/hidden-providers.ts
|
|
126
|
+
var HIDDEN_PROVIDERS = ["gemini"];
|
|
127
|
+
function isHiddenProvider(provider) {
|
|
128
|
+
return HIDDEN_PROVIDERS.includes(provider);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/claude-code/runtime.ts
|
|
132
|
+
var import_node_child_process2 = require("child_process");
|
|
133
|
+
var import_node_crypto6 = __toESM(require("crypto"), 1);
|
|
134
|
+
var import_node_fs4 = __toESM(require("fs"), 1);
|
|
135
|
+
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
136
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
137
|
+
|
|
138
|
+
// src/claude-code/tar.ts
|
|
139
|
+
var import_node_fs3 = __toESM(require("fs"), 1);
|
|
140
|
+
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
141
|
+
var import_node_zlib = __toESM(require("zlib"), 1);
|
|
125
142
|
|
|
126
143
|
// src/auth-storage.ts
|
|
144
|
+
var import_ai3 = require("@prestyj/ai");
|
|
127
145
|
var MOONSHOT_OAUTH_KEY = "moonshot-oauth";
|
|
128
146
|
var XIAOMI_CREDITS_KEY = "xiaomi-credits";
|
|
129
147
|
var GEMINI_API_KEY = "gemini-api";
|
|
130
148
|
var LOCAL_CREDENTIAL_LIFETIME_MS = 100 * 365 * 24 * 60 * 60 * 1e3;
|
|
149
|
+
var MINIMAX_REGION_RETRY_MS = 5 * 60 * 1e3;
|
|
131
150
|
var USAGE_EXHAUSTED_DEFAULT_MS = 15 * 60 * 1e3;
|
|
132
151
|
|
|
133
152
|
// src/model-registry.ts
|
|
@@ -137,6 +156,12 @@ var CLAUDE_FAST_BILLING = {
|
|
|
137
156
|
paid: true,
|
|
138
157
|
standardModel: "claude-opus-5-5"
|
|
139
158
|
};
|
|
159
|
+
var CLAUDE_FABLE_FAST_BILLING = {
|
|
160
|
+
label: "bills usage credits",
|
|
161
|
+
detail: "Fast mode bills your Claude usage credits ($16 in / $80 out per million tokens) from the first token, never your plan's included usage.",
|
|
162
|
+
paid: true,
|
|
163
|
+
standardModel: "claude-fable-5-2"
|
|
164
|
+
};
|
|
140
165
|
var XIAOMI_ULTRASPEED_BILLING = {
|
|
141
166
|
label: "bills API Credits",
|
|
142
167
|
detail: "UltraSpeed runs only on your Xiaomi API Credits, billed per token at a higher rate than MiMo-V2.6-Pro, never on the Token Plan.",
|
|
@@ -151,18 +176,18 @@ var CODEX_FAST_BILLING = {
|
|
|
151
176
|
var GEMINI_AUTH_KEYS = [GEMINI_API_KEY, "gemini"];
|
|
152
177
|
var MODELS = [
|
|
153
178
|
// ── Anthropic ──────────────────────────────────────────
|
|
154
|
-
// NOTE: Claude Mythos 5.
|
|
155
|
-
// out — it's
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
{
|
|
159
|
-
// Released 2026-09
|
|
160
|
-
//
|
|
161
|
-
// forced tool use
|
|
162
|
-
// Anthropic path. Fable 5 is retired here — a
|
|
163
|
-
// saved falls back to the provider default
|
|
164
|
-
id: "claude-fable-5-
|
|
165
|
-
name: "Claude Fable 5.
|
|
179
|
+
// NOTE: Claude Mythos 5.2 (`claude-mythos-5-2`, 2026-11-09) is kept commented
|
|
180
|
+
// out — it's only for organizations verified through Anthropic's verification
|
|
181
|
+
// programs and unavailable to most users. Re-enable once it's generally
|
|
182
|
+
// available.
|
|
183
|
+
{
|
|
184
|
+
// Released 2026-11-09 — replaces Fable 5.1 at $8/$40 MTok (down from
|
|
185
|
+
// $10/$50; cache reads $0.20). Same API surface as 5.1: always-on adaptive
|
|
186
|
+
// thinking steered by effort, forced tool use rejected with a 400 (@prestyj/ai
|
|
187
|
+
// never sends it on the Anthropic path). Fable 5.1 is retired here — a
|
|
188
|
+
// session that still has it saved falls back to the provider default.
|
|
189
|
+
id: "claude-fable-5-2",
|
|
190
|
+
name: "Claude Fable 5.2",
|
|
166
191
|
provider: "anthropic",
|
|
167
192
|
contextWindow: 1e6,
|
|
168
193
|
maxOutputTokens: 128e3,
|
|
@@ -172,12 +197,28 @@ var MODELS = [
|
|
|
172
197
|
costTier: "high",
|
|
173
198
|
maxThinkingLevel: "max"
|
|
174
199
|
},
|
|
200
|
+
{
|
|
201
|
+
// Fable 5.2 in fast mode: the same model at up to 2.5x output tokens/sec,
|
|
202
|
+
// $16/$80 MTok. Sent as `claude-fable-5-2` + `speed: "fast"`; on a Claude
|
|
203
|
+
// subscription it bills usage credits only, like Opus 5.5 Fast.
|
|
204
|
+
id: "claude-fable-5-2-fast",
|
|
205
|
+
name: "Claude Fable 5.2 Fast",
|
|
206
|
+
provider: "anthropic",
|
|
207
|
+
contextWindow: 1e6,
|
|
208
|
+
maxOutputTokens: 128e3,
|
|
209
|
+
supportsThinking: true,
|
|
210
|
+
supportsImages: true,
|
|
211
|
+
supportsVideo: false,
|
|
212
|
+
costTier: "high",
|
|
213
|
+
maxThinkingLevel: "max",
|
|
214
|
+
billing: CLAUDE_FABLE_FAST_BILLING
|
|
215
|
+
},
|
|
175
216
|
// {
|
|
176
217
|
// // Mythos-class model offered through Project Glasswing (limited
|
|
177
|
-
// // availability,
|
|
178
|
-
// //
|
|
179
|
-
// id: "claude-mythos-5-
|
|
180
|
-
// name: "Claude Mythos 5.
|
|
218
|
+
// // availability, verified organizations only). Same specs and pricing as
|
|
219
|
+
// // Fable 5.2; kept here so approved accounts can select it.
|
|
220
|
+
// id: "claude-mythos-5-2",
|
|
221
|
+
// name: "Claude Mythos 5.2",
|
|
181
222
|
// provider: "anthropic",
|
|
182
223
|
// contextWindow: 1_000_000,
|
|
183
224
|
// maxOutputTokens: 128_000,
|
|
@@ -276,18 +317,13 @@ var MODELS = [
|
|
|
276
317
|
},
|
|
277
318
|
// ── OpenAI (Codex) ─────────────────────────────────────
|
|
278
319
|
{
|
|
279
|
-
// GPT-6 Astra — "Our most capable model for
|
|
280
|
-
// (Codex catalog priority 2,
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
// Note: through a plain API key OpenAI requires the Responses API for tool
|
|
287
|
-
// calling on Astra, so the Chat Completions path is text-only; the OAuth
|
|
288
|
-
// Codex route is the supported way to use it as an agent.
|
|
289
|
-
id: "gpt-6-astra",
|
|
290
|
-
name: "GPT-6 Astra",
|
|
320
|
+
// GPT-6.2 Astra — released 2026-11-17, "Our most capable model for your
|
|
321
|
+
// hardest projects." (Codex catalog priority 2, default low, client >=
|
|
322
|
+
// 0.166.0). $8/$40 MTok, cached input $0.40. 1.05M on the public Responses
|
|
323
|
+
// API, 272K on the Codex route; 128K output, text+image input. Same ladder
|
|
324
|
+
// and Ultra preset as GPT-6 Astra, which it retires; the API rejects reasoning effort `none`.
|
|
325
|
+
id: "gpt-6.2-astra",
|
|
326
|
+
name: "GPT-6.2 Astra",
|
|
291
327
|
provider: "openai",
|
|
292
328
|
contextWindow: 105e4,
|
|
293
329
|
codexContextWindow: 272e3,
|
|
@@ -300,12 +336,12 @@ var MODELS = [
|
|
|
300
336
|
maxThinkingLevel: "ultra"
|
|
301
337
|
},
|
|
302
338
|
{
|
|
303
|
-
// Codex Fast mode for Astra (
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
//
|
|
307
|
-
id: "gpt-6-astra-fast",
|
|
308
|
-
name: "GPT-6 Astra Fast",
|
|
339
|
+
// Codex Fast mode for 6.2 Astra ("2x speed, increased usage"). @prestyj/ai's
|
|
340
|
+
// `stream()` sends it as `gpt-6.2-astra` + `service_tier: "priority"`,
|
|
341
|
+
// exactly what the Codex CLI sends. On a ChatGPT plan it draws included
|
|
342
|
+
// limits at 2.5x the standard rate.
|
|
343
|
+
id: "gpt-6.2-astra-fast",
|
|
344
|
+
name: "GPT-6.2 Astra Fast",
|
|
309
345
|
provider: "openai",
|
|
310
346
|
contextWindow: 105e4,
|
|
311
347
|
codexContextWindow: 272e3,
|
|
@@ -319,25 +355,26 @@ var MODELS = [
|
|
|
319
355
|
billing: CODEX_FAST_BILLING
|
|
320
356
|
},
|
|
321
357
|
// GPT-6 Sol + Luna — released 2026-09-22 below Astra, replacing the whole
|
|
322
|
-
// GPT-5.6 family (Sol/Terra/Luna; there
|
|
323
|
-
// catalog upgrades 5.6 Terra to 6 Sol). GPT-6.1 Sol (2026-09-29)
|
|
324
|
-
// GPT-6 Sol.
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
358
|
+
// GPT-5.6 family (Sol/Terra/Luna; there was no GPT-6 Terra — OpenAI's Codex
|
|
359
|
+
// catalog upgrades 5.6 Terra to 6 Sol). GPT-6.1 Sol (2026-09-29) replaced
|
|
360
|
+
// GPT-6 Sol, GPT-6.1 Terra (2026-10-26) sits between Sol and Luna, and
|
|
361
|
+
// GPT-6.2 Sol (2026-11-17) replaced GPT-6.1 Sol. 1.05M on the public
|
|
362
|
+
// Responses API; 128K output, text+image input, freeform apply_patch,
|
|
363
|
+
// responses-lite transport. The GPT-5.6 ids, `gpt-6-sol` and `gpt-6.1-sol`
|
|
364
|
+
// are retired — a saved session on one falls back to the provider default
|
|
365
|
+
// on next start.
|
|
366
|
+
{
|
|
367
|
+
// GPT-6.2 Sol — "Our go-to model for everyday work, from coding to
|
|
368
|
+
// powering agents at scale." (Codex priority 1, default low, client >=
|
|
369
|
+
// 0.166.0). $2/$10 MTok, cached input $0.10. Like Terra, the Codex route
|
|
370
|
+
// gets a 500K window (catalog `context_window`). Ladder low →
|
|
334
371
|
// medium → high → xhigh → max → ultra; ultra is the Codex orchestration
|
|
335
372
|
// preset (xhigh effort on the wire + proactive local subagent delegation).
|
|
336
|
-
id: "gpt-6.
|
|
337
|
-
name: "GPT-6.
|
|
373
|
+
id: "gpt-6.2-sol",
|
|
374
|
+
name: "GPT-6.2 Sol",
|
|
338
375
|
provider: "openai",
|
|
339
376
|
contextWindow: 105e4,
|
|
340
|
-
codexContextWindow:
|
|
377
|
+
codexContextWindow: 5e5,
|
|
341
378
|
maxOutputTokens: 128e3,
|
|
342
379
|
supportsThinking: true,
|
|
343
380
|
defaultThinkingLevel: "low",
|
|
@@ -347,13 +384,47 @@ var MODELS = [
|
|
|
347
384
|
maxThinkingLevel: "ultra"
|
|
348
385
|
},
|
|
349
386
|
{
|
|
350
|
-
// Codex Fast mode for 6.
|
|
351
|
-
// `gpt-6-astra-fast` for the wire mapping and billing.
|
|
352
|
-
id: "gpt-6.
|
|
353
|
-
name: "GPT-6.
|
|
387
|
+
// Codex Fast mode for 6.2 Sol ("2x speed, increased usage") — see
|
|
388
|
+
// `gpt-6.2-astra-fast` for the wire mapping and billing.
|
|
389
|
+
id: "gpt-6.2-sol-fast",
|
|
390
|
+
name: "GPT-6.2 Sol Fast",
|
|
354
391
|
provider: "openai",
|
|
355
392
|
contextWindow: 105e4,
|
|
356
|
-
codexContextWindow:
|
|
393
|
+
codexContextWindow: 5e5,
|
|
394
|
+
maxOutputTokens: 128e3,
|
|
395
|
+
supportsThinking: true,
|
|
396
|
+
defaultThinkingLevel: "low",
|
|
397
|
+
supportsImages: true,
|
|
398
|
+
supportsVideo: false,
|
|
399
|
+
costTier: "medium",
|
|
400
|
+
maxThinkingLevel: "ultra",
|
|
401
|
+
billing: CODEX_FAST_BILLING
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
// GPT-6.1 Terra (Codex priority 7, default low, client >= 0.153.0). $1/$5
|
|
405
|
+
// MTok, cached input $0.05. Unlike Sol/Astra the Codex route gets a 500K
|
|
406
|
+
// window (catalog `context_window`). Same ladder and Ultra preset as Sol.
|
|
407
|
+
id: "gpt-6.1-terra",
|
|
408
|
+
name: "GPT-6.1 Terra",
|
|
409
|
+
provider: "openai",
|
|
410
|
+
contextWindow: 105e4,
|
|
411
|
+
codexContextWindow: 5e5,
|
|
412
|
+
maxOutputTokens: 128e3,
|
|
413
|
+
supportsThinking: true,
|
|
414
|
+
defaultThinkingLevel: "low",
|
|
415
|
+
supportsImages: true,
|
|
416
|
+
supportsVideo: false,
|
|
417
|
+
costTier: "medium",
|
|
418
|
+
maxThinkingLevel: "ultra"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
// Codex Fast mode for 6.1 Terra ("1.5x speed") — see `gpt-6.2-astra-fast`
|
|
422
|
+
// for the wire mapping and billing.
|
|
423
|
+
id: "gpt-6.1-terra-fast",
|
|
424
|
+
name: "GPT-6.1 Terra Fast",
|
|
425
|
+
provider: "openai",
|
|
426
|
+
contextWindow: 105e4,
|
|
427
|
+
codexContextWindow: 5e5,
|
|
357
428
|
maxOutputTokens: 128e3,
|
|
358
429
|
supportsThinking: true,
|
|
359
430
|
defaultThinkingLevel: "low",
|
|
@@ -381,7 +452,7 @@ var MODELS = [
|
|
|
381
452
|
maxThinkingLevel: "max"
|
|
382
453
|
},
|
|
383
454
|
{
|
|
384
|
-
// Codex Fast mode for Luna ("1.5x speed") — see `gpt-6-astra-fast` for the
|
|
455
|
+
// Codex Fast mode for Luna ("1.5x speed") — see `gpt-6.2-astra-fast` for the
|
|
385
456
|
// wire mapping and billing. Listed after Luna so compaction summaries
|
|
386
457
|
// (first `low` OpenAI model) stay on standard-speed Luna.
|
|
387
458
|
id: "gpt-6-luna-fast",
|
|
@@ -667,6 +738,23 @@ var MODELS = [
|
|
|
667
738
|
maxThinkingLevel: "max"
|
|
668
739
|
},
|
|
669
740
|
// ── MiniMax ────────────────────────────────────────────
|
|
741
|
+
{
|
|
742
|
+
// The only text model M Plan / Token Plan keys cover; MiniMax-M3 on those
|
|
743
|
+
// keys fails with "insufficient balance (1008)". Pay-as-you-go serves both.
|
|
744
|
+
// Always thinks (`thinking: disabled` 400s; omitted = on) with a real
|
|
745
|
+
// low→max effort ladder on output_config.effort, API default max.
|
|
746
|
+
id: "MiniMax-M3.1-Flash",
|
|
747
|
+
name: "MiniMax M3.1 Flash",
|
|
748
|
+
provider: "minimax",
|
|
749
|
+
contextWindow: 1e6,
|
|
750
|
+
maxOutputTokens: 131072,
|
|
751
|
+
supportsThinking: true,
|
|
752
|
+
supportsImages: true,
|
|
753
|
+
supportsVideo: true,
|
|
754
|
+
maxVideoBytes: 50 * 1024 * 1024,
|
|
755
|
+
costTier: "low",
|
|
756
|
+
maxThinkingLevel: "max"
|
|
757
|
+
},
|
|
670
758
|
{
|
|
671
759
|
id: "MiniMax-M3",
|
|
672
760
|
name: "MiniMax M3",
|
|
@@ -812,6 +900,93 @@ var MODELS = [
|
|
|
812
900
|
costTier: "medium",
|
|
813
901
|
maxThinkingLevel: "high"
|
|
814
902
|
},
|
|
903
|
+
// ── OpenCode Console (Go subscription, then pay-as-you-go) ────────
|
|
904
|
+
// One Console API key reaches many labs' models through opencode.ai. Ids
|
|
905
|
+
// carry the plan prefix (`opencode-go/kimi-k3`) because the gateway reuses
|
|
906
|
+
// the vendors' own ids; @prestyj/ai strips it at the wire. These rows are only the
|
|
907
|
+
// offline fallback: the desktop app replaces them with each plan's live,
|
|
908
|
+
// public model list (core/opencode-catalog-store.ts). Limits, image input
|
|
909
|
+
// and effort ladders are from GET /inference[/go]/v1/models (2026-11-11);
|
|
910
|
+
// all three speak Chat Completions natively.
|
|
911
|
+
{
|
|
912
|
+
// Go declares `max` as K3's only effort; pay-as-you-go adds low and high.
|
|
913
|
+
id: "opencode-go/kimi-k3",
|
|
914
|
+
name: "Kimi K3",
|
|
915
|
+
provider: "opencode-go",
|
|
916
|
+
contextWindow: 1048576,
|
|
917
|
+
maxOutputTokens: 131072,
|
|
918
|
+
supportsThinking: true,
|
|
919
|
+
supportsImages: true,
|
|
920
|
+
supportsVideo: false,
|
|
921
|
+
costTier: "high",
|
|
922
|
+
maxThinkingLevel: "max",
|
|
923
|
+
thinkingLevels: ["max"]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
id: "opencode-go/glm-5.3",
|
|
927
|
+
name: "GLM-5.3",
|
|
928
|
+
provider: "opencode-go",
|
|
929
|
+
contextWindow: 1e6,
|
|
930
|
+
maxOutputTokens: 131072,
|
|
931
|
+
supportsThinking: true,
|
|
932
|
+
supportsImages: false,
|
|
933
|
+
supportsVideo: false,
|
|
934
|
+
costTier: "medium",
|
|
935
|
+
maxThinkingLevel: "max",
|
|
936
|
+
thinkingLevels: ["low", "high", "max"]
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
id: "opencode-go/glm-5.3-flash",
|
|
940
|
+
name: "GLM-5.3-Flash",
|
|
941
|
+
provider: "opencode-go",
|
|
942
|
+
contextWindow: 1e6,
|
|
943
|
+
maxOutputTokens: 131072,
|
|
944
|
+
supportsThinking: true,
|
|
945
|
+
supportsImages: true,
|
|
946
|
+
supportsVideo: false,
|
|
947
|
+
costTier: "low",
|
|
948
|
+
maxThinkingLevel: "max",
|
|
949
|
+
thinkingLevels: ["low", "high", "max"]
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
id: "opencode/kimi-k3",
|
|
953
|
+
name: "Kimi K3",
|
|
954
|
+
provider: "opencode",
|
|
955
|
+
contextWindow: 1048576,
|
|
956
|
+
maxOutputTokens: 131072,
|
|
957
|
+
supportsThinking: true,
|
|
958
|
+
supportsImages: true,
|
|
959
|
+
supportsVideo: false,
|
|
960
|
+
costTier: "high",
|
|
961
|
+
maxThinkingLevel: "max",
|
|
962
|
+
thinkingLevels: ["low", "high", "max"]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
id: "opencode/glm-5.3",
|
|
966
|
+
name: "GLM-5.3",
|
|
967
|
+
provider: "opencode",
|
|
968
|
+
contextWindow: 1e6,
|
|
969
|
+
maxOutputTokens: 131072,
|
|
970
|
+
supportsThinking: true,
|
|
971
|
+
supportsImages: false,
|
|
972
|
+
supportsVideo: false,
|
|
973
|
+
costTier: "medium",
|
|
974
|
+
maxThinkingLevel: "max",
|
|
975
|
+
thinkingLevels: ["low", "high", "max"]
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
id: "opencode/glm-5.3-flash",
|
|
979
|
+
name: "GLM-5.3-Flash",
|
|
980
|
+
provider: "opencode",
|
|
981
|
+
contextWindow: 1e6,
|
|
982
|
+
maxOutputTokens: 131072,
|
|
983
|
+
supportsThinking: true,
|
|
984
|
+
supportsImages: true,
|
|
985
|
+
supportsVideo: false,
|
|
986
|
+
costTier: "low",
|
|
987
|
+
maxThinkingLevel: "max",
|
|
988
|
+
thinkingLevels: ["low", "high", "max"]
|
|
989
|
+
},
|
|
815
990
|
// ── Hugging Face (Inference Providers router) ────────
|
|
816
991
|
// One HF token (hf.co/settings/tokens, "Make calls to Inference Providers"
|
|
817
992
|
// permission) routes to whichever hosted backend serves each open model;
|
|
@@ -889,15 +1064,51 @@ function clearRuntimeModels(predicate) {
|
|
|
889
1064
|
if (predicate(model)) runtimeModels.delete(id);
|
|
890
1065
|
}
|
|
891
1066
|
}
|
|
1067
|
+
var providerCatalogs = /* @__PURE__ */ new Map();
|
|
1068
|
+
function setProviderCatalog(provider, models) {
|
|
1069
|
+
if (!models) {
|
|
1070
|
+
providerCatalogs.delete(provider);
|
|
1071
|
+
return [];
|
|
1072
|
+
}
|
|
1073
|
+
const installed = /* @__PURE__ */ new Map();
|
|
1074
|
+
for (const model of models) {
|
|
1075
|
+
if (model.provider !== provider) continue;
|
|
1076
|
+
if (MODELS.some((m) => m.id === model.id && m.provider !== provider)) continue;
|
|
1077
|
+
installed.set(model.id, model);
|
|
1078
|
+
}
|
|
1079
|
+
providerCatalogs.set(provider, installed);
|
|
1080
|
+
return [...installed.values()];
|
|
1081
|
+
}
|
|
1082
|
+
function getProviderCatalog(provider) {
|
|
1083
|
+
const catalog = providerCatalogs.get(provider);
|
|
1084
|
+
return catalog ? [...catalog.values()] : void 0;
|
|
1085
|
+
}
|
|
892
1086
|
function getAllModels() {
|
|
893
|
-
|
|
1087
|
+
const synced = [...providerCatalogs.values()].flatMap((c) => [...c.values()]);
|
|
1088
|
+
return [
|
|
1089
|
+
...MODELS.filter((m) => !providerCatalogs.has(m.provider)),
|
|
1090
|
+
...synced,
|
|
1091
|
+
...runtimeModels.values()
|
|
1092
|
+
];
|
|
894
1093
|
}
|
|
895
1094
|
function getModel(id) {
|
|
896
|
-
|
|
1095
|
+
const fixed = MODELS.find((m) => m.id === id);
|
|
1096
|
+
if (fixed && !providerCatalogs.has(fixed.provider)) return fixed;
|
|
1097
|
+
return findSynced(id) ?? fixed ?? runtimeModels.get(id);
|
|
1098
|
+
}
|
|
1099
|
+
function findSynced(id) {
|
|
1100
|
+
for (const catalog of providerCatalogs.values()) {
|
|
1101
|
+
const hit = catalog.get(id);
|
|
1102
|
+
if (hit) return hit;
|
|
1103
|
+
}
|
|
1104
|
+
return void 0;
|
|
897
1105
|
}
|
|
898
1106
|
function getModelsForProvider(provider) {
|
|
899
1107
|
return getAllModels().filter((m) => m.provider === provider);
|
|
900
1108
|
}
|
|
1109
|
+
function getListedModels() {
|
|
1110
|
+
return getAllModels().filter((m) => !isHiddenProvider(m.provider));
|
|
1111
|
+
}
|
|
901
1112
|
function isPaidModel(modelId) {
|
|
902
1113
|
return getModel(modelId)?.billing?.paid === true;
|
|
903
1114
|
}
|
|
@@ -926,13 +1137,15 @@ function getVideoByteLimit(modelId) {
|
|
|
926
1137
|
}
|
|
927
1138
|
var DEFAULT_MODEL_IDS = {
|
|
928
1139
|
xiaomi: "mimo-v2.6-pro",
|
|
929
|
-
openai: "gpt-6.
|
|
1140
|
+
openai: "gpt-6.2-sol",
|
|
930
1141
|
gemini: "gemini-3.1-flash-lite",
|
|
931
1142
|
glm: "glm-5.3",
|
|
932
1143
|
moonshot: "kimi-k3",
|
|
933
|
-
minimax: "MiniMax-M3",
|
|
1144
|
+
minimax: "MiniMax-M3.1-Flash",
|
|
934
1145
|
deepseek: "deepseek-v4-pro",
|
|
935
1146
|
huggingface: "moonshotai/Kimi-K2.7-Code",
|
|
1147
|
+
opencode: "opencode/kimi-k3",
|
|
1148
|
+
"opencode-go": "opencode-go/kimi-k3",
|
|
936
1149
|
openrouter: "qwen/qwen3.8-max",
|
|
937
1150
|
sakana: "fugu",
|
|
938
1151
|
xai: "grok-4.7"
|
|
@@ -998,6 +1211,7 @@ function getSummaryModel(provider, currentModelId) {
|
|
|
998
1211
|
// Annotate the CommonJS export names for ESM import in node:
|
|
999
1212
|
0 && (module.exports = {
|
|
1000
1213
|
DEFAULT_MAX_VIDEO_BYTES,
|
|
1214
|
+
HIDDEN_PROVIDERS,
|
|
1001
1215
|
MODELS,
|
|
1002
1216
|
clearRuntimeModels,
|
|
1003
1217
|
getAllModels,
|
|
@@ -1006,14 +1220,18 @@ function getSummaryModel(provider, currentModelId) {
|
|
|
1006
1220
|
getContextWindow,
|
|
1007
1221
|
getDefaultModel,
|
|
1008
1222
|
getDefaultThinkingLevel,
|
|
1223
|
+
getListedModels,
|
|
1009
1224
|
getMaxThinkingLevel,
|
|
1010
1225
|
getModel,
|
|
1011
1226
|
getModelsForProvider,
|
|
1227
|
+
getProviderCatalog,
|
|
1012
1228
|
getSummaryModel,
|
|
1013
1229
|
getToolResultCharLimit,
|
|
1014
1230
|
getVideoByteLimit,
|
|
1231
|
+
isHiddenProvider,
|
|
1015
1232
|
isPaidModel,
|
|
1016
1233
|
registerRuntimeModels,
|
|
1234
|
+
setProviderCatalog,
|
|
1017
1235
|
usesOpenAICodexTransport,
|
|
1018
1236
|
withoutPaidTier
|
|
1019
1237
|
});
|