@kenkaiiii/gg-core 5.90.0 → 5.91.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-QL5357JB.js → chunk-M53JVW2V.js} +160 -3
- package/dist/chunk-M53JVW2V.js.map +1 -0
- package/dist/index.cjs +177 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -2
- package/dist/index.d.ts +56 -2
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/model-registry.cjs +19 -1
- package/dist/model-registry.cjs.map +1 -1
- package/dist/model-registry.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-QL5357JB.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -304,7 +304,12 @@ declare class AuthStorage {
|
|
|
304
304
|
private snapshotIno;
|
|
305
305
|
/** Per-provider lock to serialize concurrent refresh calls. */
|
|
306
306
|
private refreshLocks;
|
|
307
|
-
|
|
307
|
+
private readonly detectMiniMaxRegion;
|
|
308
|
+
private readonly detectXiaomiCluster;
|
|
309
|
+
constructor(filePath?: string, options?: {
|
|
310
|
+
detectMiniMaxBaseUrl?: (apiKey: string) => Promise<string | undefined>;
|
|
311
|
+
detectXiaomiTokenPlanBaseUrl?: (apiKey: string) => Promise<string | undefined>;
|
|
312
|
+
});
|
|
308
313
|
/** Path to the on-disk auth file. Useful for status output. */
|
|
309
314
|
get path(): string;
|
|
310
315
|
/** List provider keys with stored credentials. */
|
|
@@ -379,7 +384,21 @@ declare class AuthStorage {
|
|
|
379
384
|
private mutateLatest;
|
|
380
385
|
private reloadLatest;
|
|
381
386
|
getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
|
|
387
|
+
/**
|
|
388
|
+
* A MiniMax key saved without an endpoint (every key, until its first use)
|
|
389
|
+
* gets the endpoint of the region that issued it, saved so the check runs
|
|
390
|
+
* once. Without this a Mainland China key went to the Global API, got a 401,
|
|
391
|
+
* and was deleted as invalid.
|
|
392
|
+
*/
|
|
393
|
+
private withMiniMaxRegion;
|
|
382
394
|
setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* After a 401, move a regional key to the cluster that issued it instead of
|
|
397
|
+
* treating it as invalid. Only the Xiaomi Token Plan is regional: every key
|
|
398
|
+
* used to go to Singapore, so Europe and China keys were rejected and deleted.
|
|
399
|
+
* Returns the new base URL, or undefined when no other cluster accepts the key.
|
|
400
|
+
*/
|
|
401
|
+
relocateRegionalApiKey(storageKeys: string[]): Promise<string | undefined>;
|
|
383
402
|
clearRejectedApiKey(storageKey: string): Promise<boolean>;
|
|
384
403
|
clearCredentials(provider: string): Promise<void>;
|
|
385
404
|
/**
|
|
@@ -430,6 +449,41 @@ declare class NotLoggedInError extends Error {
|
|
|
430
449
|
constructor(provider: string);
|
|
431
450
|
}
|
|
432
451
|
|
|
452
|
+
/**
|
|
453
|
+
* MiniMax runs two separate platforms, and a key only works on the one that
|
|
454
|
+
* issued it: Global (platform.minimax.io) or Mainland China
|
|
455
|
+
* (platform.minimaxi.com). The user's location doesn't matter. Sending a key to
|
|
456
|
+
* the other region's API is rejected as an invalid key.
|
|
457
|
+
*/
|
|
458
|
+
declare const MINIMAX_GLOBAL_BASE_URL = "https://api.minimax.io/anthropic";
|
|
459
|
+
declare const MINIMAX_CN_BASE_URL = "https://api.minimax.cn/anthropic";
|
|
460
|
+
/**
|
|
461
|
+
* The Anthropic-compatible base URL for the region that issued `apiKey`, found
|
|
462
|
+
* by asking both regions about the key. Undefined when neither region gives a
|
|
463
|
+
* clear answer (offline, timeouts) — callers then keep the Global default and
|
|
464
|
+
* may ask again later.
|
|
465
|
+
*/
|
|
466
|
+
declare function detectMiniMaxBaseUrl(apiKey: string, options?: {
|
|
467
|
+
fetch?: typeof fetch;
|
|
468
|
+
timeoutMs?: number;
|
|
469
|
+
}): Promise<string | undefined>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Xiaomi MiMo Token Plan runs separate clusters, and a `tp-` key only works on
|
|
473
|
+
* the cluster that issued it (shown on the user's Token Plan page). Any other
|
|
474
|
+
* cluster answers 401 "Invalid API Key". Pay-as-you-go (API Credits) keys use
|
|
475
|
+
* the single global host and are unaffected.
|
|
476
|
+
*/
|
|
477
|
+
declare const XIAOMI_TOKEN_PLAN_BASE_URLS: readonly ["https://token-plan-sgp.xiaomimimo.com/v1", "https://token-plan-ams.xiaomimimo.com/v1", "https://token-plan-cn.xiaomimimo.com/v1"];
|
|
478
|
+
/**
|
|
479
|
+
* The Token Plan base URL whose cluster accepts `apiKey`, found by listing
|
|
480
|
+
* models (free, auth-only) on every cluster. Undefined when none accepts it.
|
|
481
|
+
*/
|
|
482
|
+
declare function detectXiaomiTokenPlanBaseUrl(apiKey: string, options?: {
|
|
483
|
+
fetch?: typeof fetch;
|
|
484
|
+
timeoutMs?: number;
|
|
485
|
+
}): Promise<string | undefined>;
|
|
486
|
+
|
|
433
487
|
type AuthMethod = "oauth" | "apikey";
|
|
434
488
|
/**
|
|
435
489
|
* One API-key option for a provider that splits auth across multiple distinct
|
|
@@ -836,4 +890,4 @@ interface AutoUpdater {
|
|
|
836
890
|
}
|
|
837
891
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
838
892
|
|
|
839
|
-
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, localModelShortName, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, ollamaServedContext, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
|
893
|
+
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, localModelShortName, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, ollamaServedContext, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
package/dist/index.d.ts
CHANGED
|
@@ -304,7 +304,12 @@ declare class AuthStorage {
|
|
|
304
304
|
private snapshotIno;
|
|
305
305
|
/** Per-provider lock to serialize concurrent refresh calls. */
|
|
306
306
|
private refreshLocks;
|
|
307
|
-
|
|
307
|
+
private readonly detectMiniMaxRegion;
|
|
308
|
+
private readonly detectXiaomiCluster;
|
|
309
|
+
constructor(filePath?: string, options?: {
|
|
310
|
+
detectMiniMaxBaseUrl?: (apiKey: string) => Promise<string | undefined>;
|
|
311
|
+
detectXiaomiTokenPlanBaseUrl?: (apiKey: string) => Promise<string | undefined>;
|
|
312
|
+
});
|
|
308
313
|
/** Path to the on-disk auth file. Useful for status output. */
|
|
309
314
|
get path(): string;
|
|
310
315
|
/** List provider keys with stored credentials. */
|
|
@@ -379,7 +384,21 @@ declare class AuthStorage {
|
|
|
379
384
|
private mutateLatest;
|
|
380
385
|
private reloadLatest;
|
|
381
386
|
getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
|
|
387
|
+
/**
|
|
388
|
+
* A MiniMax key saved without an endpoint (every key, until its first use)
|
|
389
|
+
* gets the endpoint of the region that issued it, saved so the check runs
|
|
390
|
+
* once. Without this a Mainland China key went to the Global API, got a 401,
|
|
391
|
+
* and was deleted as invalid.
|
|
392
|
+
*/
|
|
393
|
+
private withMiniMaxRegion;
|
|
382
394
|
setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* After a 401, move a regional key to the cluster that issued it instead of
|
|
397
|
+
* treating it as invalid. Only the Xiaomi Token Plan is regional: every key
|
|
398
|
+
* used to go to Singapore, so Europe and China keys were rejected and deleted.
|
|
399
|
+
* Returns the new base URL, or undefined when no other cluster accepts the key.
|
|
400
|
+
*/
|
|
401
|
+
relocateRegionalApiKey(storageKeys: string[]): Promise<string | undefined>;
|
|
383
402
|
clearRejectedApiKey(storageKey: string): Promise<boolean>;
|
|
384
403
|
clearCredentials(provider: string): Promise<void>;
|
|
385
404
|
/**
|
|
@@ -430,6 +449,41 @@ declare class NotLoggedInError extends Error {
|
|
|
430
449
|
constructor(provider: string);
|
|
431
450
|
}
|
|
432
451
|
|
|
452
|
+
/**
|
|
453
|
+
* MiniMax runs two separate platforms, and a key only works on the one that
|
|
454
|
+
* issued it: Global (platform.minimax.io) or Mainland China
|
|
455
|
+
* (platform.minimaxi.com). The user's location doesn't matter. Sending a key to
|
|
456
|
+
* the other region's API is rejected as an invalid key.
|
|
457
|
+
*/
|
|
458
|
+
declare const MINIMAX_GLOBAL_BASE_URL = "https://api.minimax.io/anthropic";
|
|
459
|
+
declare const MINIMAX_CN_BASE_URL = "https://api.minimax.cn/anthropic";
|
|
460
|
+
/**
|
|
461
|
+
* The Anthropic-compatible base URL for the region that issued `apiKey`, found
|
|
462
|
+
* by asking both regions about the key. Undefined when neither region gives a
|
|
463
|
+
* clear answer (offline, timeouts) — callers then keep the Global default and
|
|
464
|
+
* may ask again later.
|
|
465
|
+
*/
|
|
466
|
+
declare function detectMiniMaxBaseUrl(apiKey: string, options?: {
|
|
467
|
+
fetch?: typeof fetch;
|
|
468
|
+
timeoutMs?: number;
|
|
469
|
+
}): Promise<string | undefined>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Xiaomi MiMo Token Plan runs separate clusters, and a `tp-` key only works on
|
|
473
|
+
* the cluster that issued it (shown on the user's Token Plan page). Any other
|
|
474
|
+
* cluster answers 401 "Invalid API Key". Pay-as-you-go (API Credits) keys use
|
|
475
|
+
* the single global host and are unaffected.
|
|
476
|
+
*/
|
|
477
|
+
declare const XIAOMI_TOKEN_PLAN_BASE_URLS: readonly ["https://token-plan-sgp.xiaomimimo.com/v1", "https://token-plan-ams.xiaomimimo.com/v1", "https://token-plan-cn.xiaomimimo.com/v1"];
|
|
478
|
+
/**
|
|
479
|
+
* The Token Plan base URL whose cluster accepts `apiKey`, found by listing
|
|
480
|
+
* models (free, auth-only) on every cluster. Undefined when none accepts it.
|
|
481
|
+
*/
|
|
482
|
+
declare function detectXiaomiTokenPlanBaseUrl(apiKey: string, options?: {
|
|
483
|
+
fetch?: typeof fetch;
|
|
484
|
+
timeoutMs?: number;
|
|
485
|
+
}): Promise<string | undefined>;
|
|
486
|
+
|
|
433
487
|
type AuthMethod = "oauth" | "apikey";
|
|
434
488
|
/**
|
|
435
489
|
* One API-key option for a provider that splits auth across multiple distinct
|
|
@@ -836,4 +890,4 @@ interface AutoUpdater {
|
|
|
836
890
|
}
|
|
837
891
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
838
892
|
|
|
839
|
-
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, localModelShortName, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, ollamaServedContext, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
|
893
|
+
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, localModelShortName, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, ollamaServedContext, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,18 @@ import {
|
|
|
5
5
|
GEMINI_API_KEY_BASE_URL,
|
|
6
6
|
HIDDEN_PROVIDERS,
|
|
7
7
|
LOCAL_AUTH_KEY_PREFIX,
|
|
8
|
+
MINIMAX_CN_BASE_URL,
|
|
9
|
+
MINIMAX_GLOBAL_BASE_URL,
|
|
8
10
|
MODELS,
|
|
9
11
|
MOONSHOT_OAUTH_KEY,
|
|
10
12
|
NotLoggedInError,
|
|
11
13
|
XAI_OAUTH_KEY,
|
|
12
14
|
XIAOMI_CREDITS_KEY,
|
|
15
|
+
XIAOMI_TOKEN_PLAN_BASE_URLS,
|
|
13
16
|
clearRuntimeModels,
|
|
14
17
|
closeLogger,
|
|
18
|
+
detectMiniMaxBaseUrl,
|
|
19
|
+
detectXiaomiTokenPlanBaseUrl,
|
|
15
20
|
dualAuthProvider,
|
|
16
21
|
dualAuthProviderByOAuthKey,
|
|
17
22
|
generatePKCE,
|
|
@@ -61,7 +66,7 @@ import {
|
|
|
61
66
|
usesOpenAICodexTransport,
|
|
62
67
|
withFileLock,
|
|
63
68
|
withoutPaidTier
|
|
64
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-M53JVW2V.js";
|
|
65
70
|
import {
|
|
66
71
|
getAppPaths
|
|
67
72
|
} from "./chunk-2X5L6U4Z.js";
|
|
@@ -94,6 +99,13 @@ var ANTHROPIC_ADAPTIVE_THINKING_LEVELS = [
|
|
|
94
99
|
];
|
|
95
100
|
var MOONSHOT_K3_THINKING_LEVELS = ["low", "high", "max"];
|
|
96
101
|
var GLM_THINKING_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
102
|
+
var MINIMAX_EFFORT_THINKING_LEVELS = [
|
|
103
|
+
"low",
|
|
104
|
+
"medium",
|
|
105
|
+
"high",
|
|
106
|
+
"xhigh",
|
|
107
|
+
"max"
|
|
108
|
+
];
|
|
97
109
|
var LOCAL_THINKING_LEVELS = ["low", "medium", "high", "max"];
|
|
98
110
|
function isOpenAIGptModel(provider, model) {
|
|
99
111
|
return provider === "openai" && model.startsWith("gpt-");
|
|
@@ -110,6 +122,9 @@ function isMoonshotK3Model(provider, model) {
|
|
|
110
122
|
function isGlmModel(provider) {
|
|
111
123
|
return provider === "glm";
|
|
112
124
|
}
|
|
125
|
+
function isMiniMaxEffortModel(provider, model) {
|
|
126
|
+
return provider === "minimax" && model.startsWith("MiniMax-M3.1");
|
|
127
|
+
}
|
|
113
128
|
function isAnthropicXhighModel(provider, model) {
|
|
114
129
|
return provider === "anthropic" && /opus-5|opus-4-8|opus-4-7|sonnet-5[-.]5|haiku-5[-.]5/.test(model);
|
|
115
130
|
}
|
|
@@ -142,6 +157,7 @@ function getSupportedThinkingLevels(provider, model) {
|
|
|
142
157
|
}
|
|
143
158
|
if (isMoonshotK3Model(provider, model)) return MOONSHOT_K3_THINKING_LEVELS;
|
|
144
159
|
if (provider === "deepseek") return DEEPSEEK_THINKING_LEVELS;
|
|
160
|
+
if (isMiniMaxEffortModel(provider, model)) return MINIMAX_EFFORT_THINKING_LEVELS;
|
|
145
161
|
if (isGlmModel(provider)) {
|
|
146
162
|
const maxIndex2 = GLM_THINKING_LEVELS.indexOf(maxLevel);
|
|
147
163
|
if (maxIndex2 === -1) return GLM_THINKING_LEVELS;
|
|
@@ -162,7 +178,7 @@ function isThinkingLevelSupported(provider, model, level) {
|
|
|
162
178
|
}
|
|
163
179
|
function getNextThinkingLevel(provider, model, current) {
|
|
164
180
|
const supportedLevels = getSupportedThinkingLevels(provider, model);
|
|
165
|
-
const shouldCycleLevels = isOpenAIGptModel(provider, model) || isAnthropicAdaptiveModel(provider, model) || isSakanaModel(provider) || isXaiModel(provider) || isMoonshotK3Model(provider, model) || isGlmModel(provider) || provider === "deepseek" || // Local servers take a real effort level, not just on/off: Ollama accepts
|
|
181
|
+
const shouldCycleLevels = isOpenAIGptModel(provider, model) || isAnthropicAdaptiveModel(provider, model) || isSakanaModel(provider) || isXaiModel(provider) || isMoonshotK3Model(provider, model) || isGlmModel(provider) || isMiniMaxEffortModel(provider, model) || provider === "deepseek" || // Local servers take a real effort level, not just on/off: Ollama accepts
|
|
166
182
|
// low/medium/high on `reasoning_effort` (verified against 0.32) and the
|
|
167
183
|
// other OpenAI-compatible servers use the same three. A model that can't
|
|
168
184
|
// reason at all already has no supported levels, so it never gets here.
|
|
@@ -604,7 +620,7 @@ var ALL_AUTH_PROVIDERS = [
|
|
|
604
620
|
{
|
|
605
621
|
value: "minimax",
|
|
606
622
|
label: "MiniMax",
|
|
607
|
-
description: "MiniMax M3",
|
|
623
|
+
description: "MiniMax M3.1 Flash, M3",
|
|
608
624
|
methods: ["apikey"],
|
|
609
625
|
apiKeyLabel: "MiniMax"
|
|
610
626
|
},
|
|
@@ -1436,6 +1452,8 @@ export {
|
|
|
1436
1452
|
HIDDEN_PROVIDERS,
|
|
1437
1453
|
LOCAL_API_KEY_PLACEHOLDER,
|
|
1438
1454
|
LOCAL_AUTH_KEY_PREFIX,
|
|
1455
|
+
MINIMAX_CN_BASE_URL,
|
|
1456
|
+
MINIMAX_GLOBAL_BASE_URL,
|
|
1439
1457
|
MODELS,
|
|
1440
1458
|
MOONSHOT_OAUTH_KEY,
|
|
1441
1459
|
NotLoggedInError,
|
|
@@ -1444,6 +1462,7 @@ export {
|
|
|
1444
1462
|
TelegramBot,
|
|
1445
1463
|
XAI_OAUTH_KEY,
|
|
1446
1464
|
XIAOMI_CREDITS_KEY,
|
|
1465
|
+
XIAOMI_TOKEN_PLAN_BASE_URLS,
|
|
1447
1466
|
authPriorityNote,
|
|
1448
1467
|
clampThinkingForPlanMode,
|
|
1449
1468
|
clearLocalDiscoveryCache,
|
|
@@ -1452,6 +1471,8 @@ export {
|
|
|
1452
1471
|
createAutoUpdater,
|
|
1453
1472
|
decodeOggOpus,
|
|
1454
1473
|
describeAuthMethods,
|
|
1474
|
+
detectMiniMaxBaseUrl,
|
|
1475
|
+
detectXiaomiTokenPlanBaseUrl,
|
|
1455
1476
|
discoverLocalModels,
|
|
1456
1477
|
downmixToMono,
|
|
1457
1478
|
dualAuthProvider,
|