opencode support

This commit is contained in:
webdevcody
2026-01-08 15:30:20 -05:00
parent d1bd131cab
commit 5fbc7dd13e
26 changed files with 3723 additions and 26 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,14 @@ import { ProviderFactory } from '@/providers/provider-factory.js';
import { ClaudeProvider } from '@/providers/claude-provider.js';
import { CursorProvider } from '@/providers/cursor-provider.js';
import { CodexProvider } from '@/providers/codex-provider.js';
import { OpencodeProvider } from '@/providers/opencode-provider.js';
describe('provider-factory.ts', () => {
let consoleSpy: any;
let detectClaudeSpy: any;
let detectCursorSpy: any;
let detectCodexSpy: any;
let detectOpencodeSpy: any;
beforeEach(() => {
consoleSpy = {
@@ -25,6 +27,9 @@ describe('provider-factory.ts', () => {
detectCodexSpy = vi
.spyOn(CodexProvider.prototype, 'detectInstallation')
.mockResolvedValue({ installed: true });
detectOpencodeSpy = vi
.spyOn(OpencodeProvider.prototype, 'detectInstallation')
.mockResolvedValue({ installed: true });
});
afterEach(() => {
@@ -32,6 +37,7 @@ describe('provider-factory.ts', () => {
detectClaudeSpy.mockRestore();
detectCursorSpy.mockRestore();
detectCodexSpy.mockRestore();
detectOpencodeSpy.mockRestore();
});
describe('getProviderForModel', () => {
@@ -159,9 +165,9 @@ describe('provider-factory.ts', () => {
expect(hasClaudeProvider).toBe(true);
});
it('should return exactly 3 providers', () => {
it('should return exactly 4 providers', () => {
const providers = ProviderFactory.getAllProviders();
expect(providers).toHaveLength(3);
expect(providers).toHaveLength(4);
});
it('should include CursorProvider', () => {
@@ -198,7 +204,8 @@ describe('provider-factory.ts', () => {
expect(keys).toContain('claude');
expect(keys).toContain('cursor');
expect(keys).toContain('codex');
expect(keys).toHaveLength(3);
expect(keys).toContain('opencode');
expect(keys).toHaveLength(4);
});
it('should include cursor status', async () => {