@prestyj/core 5.30.2 → 5.31.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-724LOLDH.js → chunk-GYAMOZYP.js} +13 -1
- package/dist/{chunk-724LOLDH.js.map → chunk-GYAMOZYP.js.map} +1 -1
- package/dist/index.cjs +173 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +158 -1
- package/dist/index.js.map +1 -1
- package/dist/model-registry.cjs +12 -0
- package/dist/model-registry.cjs.map +1 -1
- package/dist/model-registry.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
AUTH_PROVIDERS: () => AUTH_PROVIDERS,
|
|
33
34
|
AuthStorage: () => AuthStorage,
|
|
34
35
|
DEFAULT_LOCAL_ENDPOINTS: () => DEFAULT_LOCAL_ENDPOINTS,
|
|
35
36
|
DEFAULT_MAX_VIDEO_BYTES: () => DEFAULT_MAX_VIDEO_BYTES,
|
|
@@ -44,6 +45,7 @@ __export(index_exports, {
|
|
|
44
45
|
TelegramBot: () => TelegramBot,
|
|
45
46
|
XAI_OAUTH_KEY: () => XAI_OAUTH_KEY,
|
|
46
47
|
XIAOMI_CREDITS_KEY: () => XIAOMI_CREDITS_KEY,
|
|
48
|
+
authPriorityNote: () => authPriorityNote,
|
|
47
49
|
clampThinkingForPlanMode: () => clampThinkingForPlanMode,
|
|
48
50
|
clearLocalDiscoveryCache: () => clearLocalDiscoveryCache,
|
|
49
51
|
clearRuntimeModels: () => clearRuntimeModels,
|
|
@@ -51,6 +53,7 @@ __export(index_exports, {
|
|
|
51
53
|
compareClaudeCodeVersions: () => compareClaudeCodeVersions,
|
|
52
54
|
createAutoUpdater: () => createAutoUpdater,
|
|
53
55
|
decodeOggOpus: () => decodeOggOpus,
|
|
56
|
+
describeAuthMethods: () => describeAuthMethods,
|
|
54
57
|
discoverLocalModels: () => discoverLocalModels,
|
|
55
58
|
downmixToMono: () => downmixToMono,
|
|
56
59
|
dualAuthProvider: () => dualAuthProvider,
|
|
@@ -62,6 +65,7 @@ __export(index_exports, {
|
|
|
62
65
|
generatePKCE: () => generatePKCE,
|
|
63
66
|
getAllModels: () => getAllModels,
|
|
64
67
|
getAppPaths: () => getAppPaths,
|
|
68
|
+
getAuthProvider: () => getAuthProvider,
|
|
65
69
|
getAuthStorageKey: () => getAuthStorageKey,
|
|
66
70
|
getAuthStorageKeys: () => getAuthStorageKeys,
|
|
67
71
|
getClaudeCliUserAgent: () => getClaudeCliUserAgent,
|
|
@@ -2231,6 +2235,10 @@ var MODELS = [
|
|
|
2231
2235
|
supportsImages: true,
|
|
2232
2236
|
supportsVideo: false,
|
|
2233
2237
|
costTier: "high",
|
|
2238
|
+
// Anthropic's API and Claude Code both start the 5.5 family at medium; at a
|
|
2239
|
+
// given level 5.5 thinks more than 5, so the ladder ceiling (max) made fresh
|
|
2240
|
+
// sessions slow and expensive. Users can still opt up.
|
|
2241
|
+
defaultThinkingLevel: "medium",
|
|
2234
2242
|
maxThinkingLevel: "max"
|
|
2235
2243
|
},
|
|
2236
2244
|
{
|
|
@@ -2245,6 +2253,10 @@ var MODELS = [
|
|
|
2245
2253
|
supportsImages: true,
|
|
2246
2254
|
supportsVideo: false,
|
|
2247
2255
|
costTier: "medium",
|
|
2256
|
+
// Anthropic's API and Claude Code both start the 5.5 family at medium; at a
|
|
2257
|
+
// given level 5.5 thinks more than 5, so the ladder ceiling (max) made fresh
|
|
2258
|
+
// sessions slow and expensive. Users can still opt up.
|
|
2259
|
+
defaultThinkingLevel: "medium",
|
|
2248
2260
|
maxThinkingLevel: "max"
|
|
2249
2261
|
},
|
|
2250
2262
|
{
|
|
@@ -2265,6 +2277,10 @@ var MODELS = [
|
|
|
2265
2277
|
supportsImages: true,
|
|
2266
2278
|
supportsVideo: false,
|
|
2267
2279
|
costTier: "low",
|
|
2280
|
+
// Anthropic's API and Claude Code both start the 5.5 family at medium; at a
|
|
2281
|
+
// given level 5.5 thinks more than 5, so the ladder ceiling (max) made fresh
|
|
2282
|
+
// sessions slow and expensive. Users can still opt up.
|
|
2283
|
+
defaultThinkingLevel: "medium",
|
|
2268
2284
|
maxThinkingLevel: "max"
|
|
2269
2285
|
},
|
|
2270
2286
|
// ── OpenAI (Codex) ─────────────────────────────────────
|
|
@@ -3327,6 +3343,159 @@ function findProbedModel(probes, modelId) {
|
|
|
3327
3343
|
return void 0;
|
|
3328
3344
|
}
|
|
3329
3345
|
|
|
3346
|
+
// src/auth-providers.ts
|
|
3347
|
+
var AUTH_PROVIDERS = [
|
|
3348
|
+
{
|
|
3349
|
+
value: "anthropic",
|
|
3350
|
+
label: "Anthropic",
|
|
3351
|
+
description: "Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5",
|
|
3352
|
+
methods: ["oauth"]
|
|
3353
|
+
},
|
|
3354
|
+
{
|
|
3355
|
+
value: "openai",
|
|
3356
|
+
label: "OpenAI",
|
|
3357
|
+
description: "GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna",
|
|
3358
|
+
methods: ["oauth"]
|
|
3359
|
+
},
|
|
3360
|
+
{
|
|
3361
|
+
value: "gemini",
|
|
3362
|
+
label: "Gemini",
|
|
3363
|
+
description: "Gemini 3.8 Flash, 3.5 Flash Lite, 3.7 Flash, 3.1 Flash Lite, 3.5 Flash, 3.1 Pro (Preview)",
|
|
3364
|
+
methods: ["oauth"]
|
|
3365
|
+
},
|
|
3366
|
+
{
|
|
3367
|
+
value: "xai",
|
|
3368
|
+
label: "xAI (Grok)",
|
|
3369
|
+
description: "Grok 4.7 \xB7 OAuth or API key",
|
|
3370
|
+
methods: ["oauth", "apikey"],
|
|
3371
|
+
apiKeyLabel: "xAI",
|
|
3372
|
+
methodDetails: {
|
|
3373
|
+
oauth: {
|
|
3374
|
+
method: "oauth",
|
|
3375
|
+
label: "Sign in with Grok",
|
|
3376
|
+
billing: "Included with SuperGrok or X Premium.",
|
|
3377
|
+
when: ""
|
|
3378
|
+
},
|
|
3379
|
+
apikey: {
|
|
3380
|
+
method: "apikey",
|
|
3381
|
+
label: "xAI API key",
|
|
3382
|
+
billing: "Pay-per-token on console.x.ai credits.",
|
|
3383
|
+
when: ""
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
},
|
|
3387
|
+
{
|
|
3388
|
+
value: "moonshot",
|
|
3389
|
+
label: "Moonshot",
|
|
3390
|
+
description: "Kimi K3, K2.8 Preview (Kimi sign-in), K2.7 Code, K2.7 Code HighSpeed \xB7 OAuth or API key",
|
|
3391
|
+
methods: ["oauth", "apikey"],
|
|
3392
|
+
apiKeyLabel: "Moonshot",
|
|
3393
|
+
methodDetails: {
|
|
3394
|
+
oauth: {
|
|
3395
|
+
method: "oauth",
|
|
3396
|
+
label: "Sign in with Kimi",
|
|
3397
|
+
billing: "Included with a Kimi For Coding plan.",
|
|
3398
|
+
when: ""
|
|
3399
|
+
},
|
|
3400
|
+
apikey: {
|
|
3401
|
+
method: "apikey",
|
|
3402
|
+
label: "Moonshot API key",
|
|
3403
|
+
billing: "Pay-per-token on Moonshot credits.",
|
|
3404
|
+
when: ""
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
value: "glm",
|
|
3410
|
+
label: "Z.AI (GLM)",
|
|
3411
|
+
description: "GLM-5.3, GLM-5.3-Flash",
|
|
3412
|
+
methods: ["apikey"],
|
|
3413
|
+
apiKeyLabel: "Z.AI"
|
|
3414
|
+
},
|
|
3415
|
+
{
|
|
3416
|
+
value: "minimax",
|
|
3417
|
+
label: "MiniMax",
|
|
3418
|
+
description: "MiniMax M3",
|
|
3419
|
+
methods: ["apikey"],
|
|
3420
|
+
apiKeyLabel: "MiniMax"
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
value: "xiaomi",
|
|
3424
|
+
label: "Xiaomi (MiMo)",
|
|
3425
|
+
description: "MiMo-V2.6-Pro, MiMo-V2.6-Flash, MiMo-V2.6-Pro-UltraSpeed \xB7 Token Plan or API Credits",
|
|
3426
|
+
methods: ["apikey"],
|
|
3427
|
+
apiKeyLabel: "Xiaomi MiMo",
|
|
3428
|
+
apiKeyBaseUrl: "https://token-plan-sgp.xiaomimimo.com/v1",
|
|
3429
|
+
apiKeyVariants: [
|
|
3430
|
+
{
|
|
3431
|
+
key: "xiaomi",
|
|
3432
|
+
label: "Token Plan",
|
|
3433
|
+
baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1"
|
|
3434
|
+
},
|
|
3435
|
+
{
|
|
3436
|
+
key: XIAOMI_CREDITS_KEY,
|
|
3437
|
+
label: "API Credits (required for UltraSpeed)",
|
|
3438
|
+
baseUrl: "https://api.xiaomimimo.com/v1"
|
|
3439
|
+
}
|
|
3440
|
+
]
|
|
3441
|
+
},
|
|
3442
|
+
{
|
|
3443
|
+
value: "deepseek",
|
|
3444
|
+
label: "DeepSeek",
|
|
3445
|
+
description: "DeepSeek V4 Pro, V4.1 Flash",
|
|
3446
|
+
methods: ["apikey"],
|
|
3447
|
+
apiKeyLabel: "DeepSeek"
|
|
3448
|
+
},
|
|
3449
|
+
{
|
|
3450
|
+
value: "sakana",
|
|
3451
|
+
label: "Sakana (Fugu)",
|
|
3452
|
+
description: "Fugu, Fugu Max, Fugu Ultra",
|
|
3453
|
+
methods: ["apikey"],
|
|
3454
|
+
apiKeyLabel: "Sakana"
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
value: "openrouter",
|
|
3458
|
+
label: "OpenRouter",
|
|
3459
|
+
description: "Qwen3.8 Max \xB7 multi-provider gateway",
|
|
3460
|
+
methods: ["apikey"],
|
|
3461
|
+
apiKeyLabel: "OpenRouter"
|
|
3462
|
+
},
|
|
3463
|
+
{
|
|
3464
|
+
value: "huggingface",
|
|
3465
|
+
label: "Hugging Face",
|
|
3466
|
+
description: "Kimi K2.7 Code, DeepSeek V4.1 Flash, GPT-OSS 120B",
|
|
3467
|
+
methods: ["apikey"],
|
|
3468
|
+
apiKeyLabel: "Hugging Face"
|
|
3469
|
+
}
|
|
3470
|
+
];
|
|
3471
|
+
function getAuthProvider(value) {
|
|
3472
|
+
return AUTH_PROVIDERS.find((p) => p.value === value);
|
|
3473
|
+
}
|
|
3474
|
+
function describeAuthMethods(provider) {
|
|
3475
|
+
const meta = getAuthProvider(provider);
|
|
3476
|
+
if (!meta) return [];
|
|
3477
|
+
return meta.methods.map((method) => {
|
|
3478
|
+
const override = meta.methodDetails?.[method];
|
|
3479
|
+
if (override) return { ...override };
|
|
3480
|
+
return method === "oauth" ? {
|
|
3481
|
+
method,
|
|
3482
|
+
label: `Sign in with ${meta.label}`,
|
|
3483
|
+
billing: "Uses your existing plan with this provider.",
|
|
3484
|
+
when: ""
|
|
3485
|
+
} : {
|
|
3486
|
+
method,
|
|
3487
|
+
label: `${meta.apiKeyLabel ?? meta.label} API key`,
|
|
3488
|
+
billing: "Pay-per-token on this provider's API credits.",
|
|
3489
|
+
when: ""
|
|
3490
|
+
};
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
function authPriorityNote(provider) {
|
|
3494
|
+
const dual = dualAuthProvider(provider);
|
|
3495
|
+
if (!dual) return void 0;
|
|
3496
|
+
return `Uses ${dual.oauthLabel} first; the ${dual.apiKeyLabel} takes over when it runs out, then switches back.`;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3330
3499
|
// src/provider-usage.ts
|
|
3331
3500
|
var SubscriptionUsageError = class extends Error {
|
|
3332
3501
|
constructor(message, status, retryAfterMs2) {
|
|
@@ -4063,6 +4232,7 @@ function createAutoUpdater(config) {
|
|
|
4063
4232
|
}
|
|
4064
4233
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4065
4234
|
0 && (module.exports = {
|
|
4235
|
+
AUTH_PROVIDERS,
|
|
4066
4236
|
AuthStorage,
|
|
4067
4237
|
DEFAULT_LOCAL_ENDPOINTS,
|
|
4068
4238
|
DEFAULT_MAX_VIDEO_BYTES,
|
|
@@ -4077,6 +4247,7 @@ function createAutoUpdater(config) {
|
|
|
4077
4247
|
TelegramBot,
|
|
4078
4248
|
XAI_OAUTH_KEY,
|
|
4079
4249
|
XIAOMI_CREDITS_KEY,
|
|
4250
|
+
authPriorityNote,
|
|
4080
4251
|
clampThinkingForPlanMode,
|
|
4081
4252
|
clearLocalDiscoveryCache,
|
|
4082
4253
|
clearRuntimeModels,
|
|
@@ -4084,6 +4255,7 @@ function createAutoUpdater(config) {
|
|
|
4084
4255
|
compareClaudeCodeVersions,
|
|
4085
4256
|
createAutoUpdater,
|
|
4086
4257
|
decodeOggOpus,
|
|
4258
|
+
describeAuthMethods,
|
|
4087
4259
|
discoverLocalModels,
|
|
4088
4260
|
downmixToMono,
|
|
4089
4261
|
dualAuthProvider,
|
|
@@ -4095,6 +4267,7 @@ function createAutoUpdater(config) {
|
|
|
4095
4267
|
generatePKCE,
|
|
4096
4268
|
getAllModels,
|
|
4097
4269
|
getAppPaths,
|
|
4270
|
+
getAuthProvider,
|
|
4098
4271
|
getAuthStorageKey,
|
|
4099
4272
|
getAuthStorageKeys,
|
|
4100
4273
|
getClaudeCliUserAgent,
|