mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-19 14:15:27 +00:00
feat(minimax): Add full MiniMax M2.1 support
- Add MiniMax settings template (config/base-minimax.settings.json) - Add MiniMax pricing (3 models: M2.1, M2.1-lightning, M2) - Add validateMiniMaxKey() pre-flight validator - Integrate MiniMax validation in main CLI flow - Fix model name casing: M2.1-lightning (lowercase l) Implementation follows GLM pattern: - Anthropic-compatible API (no proxy needed) - Pre-flight validation with health check - Fail-open on network errors - Actionable error messages
This commit is contained in:
1 parent
c05f27fdb3
commit
bd5c9a0033
7 files changed
+166
-4
No files matched your search
+27
-2
@@ -3,7 +3,7 @@ import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { detectClaudeCli } from './utils/claude-detector';
|
||||
import { getSettingsPath, loadSettings } from './utils/config-manager';
|
||||
import { validateGlmKey } from './utils/api-key-validator';
|
||||
import { validateGlmKey, validateMiniMaxKey } from './utils/api-key-validator';
|
||||
import { ErrorManager } from './utils/error-manager';
|
||||
import { execClaudeWithCLIProxy, CLIProxyProvider } from './cliproxy';
|
||||
import {
|
||||
@@ -535,7 +535,7 @@ async function main(): Promise<void> {
|
||||
// Display WebSearch status (single line, equilibrium UX)
|
||||
displayWebSearchStatus();
|
||||
|
||||
// Pre-flight validation for GLM/GLMT profiles
|
||||
// Pre-flight validation for GLM/GLMT/MiniMax profiles
|
||||
if (profileInfo.name === 'glm' || profileInfo.name === 'glmt') {
|
||||
const preflightSettingsPath = getSettingsPath(profileInfo.name);
|
||||
const preflightSettings = loadSettings(preflightSettingsPath);
|
||||
@@ -561,6 +561,31 @@ async function main(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
if (profileInfo.name === 'minimax') {
|
||||
const preflightSettingsPath = getSettingsPath(profileInfo.name);
|
||||
const preflightSettings = loadSettings(preflightSettingsPath);
|
||||
const apiKey = preflightSettings.env?.['ANTHROPIC_AUTH_TOKEN'];
|
||||
|
||||
if (apiKey) {
|
||||
const validation = await validateMiniMaxKey(
|
||||
apiKey,
|
||||
preflightSettings.env?.['ANTHROPIC_BASE_URL']
|
||||
);
|
||||
|
||||
if (!validation.valid) {
|
||||
console.error('');
|
||||
console.error(fail(validation.error || 'API key validation failed'));
|
||||
if (validation.suggestion) {
|
||||
console.error('');
|
||||
console.error(validation.suggestion);
|
||||
}
|
||||
console.error('');
|
||||
console.error(info('To skip validation: CCS_SKIP_PREFLIGHT=1 ccs minimax "prompt"'));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this is GLMT profile (requires proxy)
|
||||
if (profileInfo.name === 'glmt') {
|
||||
// GLMT FLOW: Settings-based with embedded proxy for thinking support
|
||||
|
||||
Reference in new issue
Block a user