mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat: add assistant mode, SSE streaming, and OpenCode server integration (#214)
This commit is contained in:
1 parent
3cc24288a6
commit
c3d6549f01
133 files changed
+7284
-6293
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { vi } from 'vitest'
|
||||
import type { OpenCodeClient } from '../../src/services/opencode/client'
|
||||
|
||||
export function createStubOpenCodeClient(overrides: Partial<OpenCodeClient> = {}): OpenCodeClient {
|
||||
return {
|
||||
forward: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
||||
forwardRaw: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
||||
getJson: vi.fn(async () => ({}) as unknown),
|
||||
postJson: vi.fn(async () => ({}) as unknown),
|
||||
setProviderAuth: vi.fn(async () => true),
|
||||
deleteProviderAuth: vi.fn(async () => true),
|
||||
startMcpAuth: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
||||
authenticateMcp: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
||||
...overrides,
|
||||
} as OpenCodeClient
|
||||
}
|
||||
Reference in new issue
Block a user