feat(cliproxy): add xAI Grok provider

This commit is contained in:
minhbi245 committed 2026-07-17 00:02:12 +07:00
1 parent 1b67c7840b
commit 54a2b4759b
37 files changed
+510 -54

No files matched your search

+8
View File
@@ -94,12 +94,20 @@ describe('ProfileDetector', () => {
});
it('should detect newly added cliproxy providers', () => {
expect(detector.detectProfileType('xai').provider).toBe('xai');
expect(detector.detectProfileType('gitlab').provider).toBe('gitlab');
expect(detector.detectProfileType('codebuddy').provider).toBe('codebuddy');
expect(detector.detectProfileType('kilo').provider).toBe('kilo');
expect(detector.detectProfileType('qoder').provider).toBe('qoder');
});
it('should resolve the grok CLI alias to canonical xai routing', () => {
const result = detector.detectProfileType('grok');
expect(result.type).toBe('cliproxy');
expect(result.name).toBe('xai');
expect(result.provider).toBe('xai');
});
it('should detect settings-based profile from unified config', () => {
const settingsPath = path.join(tempDir, 'glm.settings.json');
fs.writeFileSync(settingsPath, JSON.stringify({ env: { ANTHROPIC_MODEL: 'glm-4' } }));