Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat: v2.1.0 — true multi-provider support, OllamaProvider baseUrl fix, test infra

PurpleDoubleD09018003eb29
diff --git a/package-lock.json b/package-lock.json
index 5ab944cf..7d904afc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "locally-uncensored",
- "version": "1.9.0",
+ "version": "2.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "locally-uncensored",
- "version": "1.9.0",
+ "version": "2.0.0",
"license": "MIT",
"dependencies": {
"@react-three/drei": "^10.7.7",
diff --git a/package.json b/package.json
index 8a05f029..c0baa714 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "locally-uncensored",
- "version": "2.0.0",
+ "version": "2.1.0",
"private": false,
"description": "Private, local AI chat & image/video generation. No cloud, no censorship, no data collection. Powered by Ollama & ComfyUI.",
"license": "MIT",
diff --git a/src/api/__tests__/provider-ollama.test.ts b/src/api/__tests__/provider-ollama.test.ts
new file mode 100644
index 00000000..c023a0c9
--- /dev/null
+++ b/src/api/__tests__/provider-ollama.test.ts
@@ -0,0 +1,602 @@
+/**
+ * Ollama Provider Tests
+ *
+ * Tests the Ollama provider client (model listing, tool calls, error handling, context length).
+ * Run: npx vitest run src/api/__tests__/provider-ollama.test.ts
+ */
+import { describe, it, expect, vi, beforeEach } from 'vitest'
+import { ProviderError } from '../providers/types'
+import type { ProviderConfig } from '../providers/types'
+
+// Mock the backend module — Ollama uses localFetch / localFetchStream instead of bare fetch
+vi.mock('../backend', () => ({
+ isTauri: () => false,
+ localFetch: vi.fn(),
+ localFetchStream: vi.fn(),
+}))
+
+import { OllamaProvider } from '../providers/ollama-provider'
+import { localFetch, localFetchStream } from '../backend'
+
+const mockLocalFetch = localFetch as ReturnType<typeof vi.fn>
+const mockLocalFetchStream = localFetchStream as ReturnType<typeof vi.fn>
+
+function makeConfig(overrides: Partial<ProviderConfig> = {}): ProviderConfig {
+ return {
+ id: 'ollama',
+ name: 'Ollama',
+ enabled: true,
+ baseUrl: 'http://localhost:11434',
+ isLocal: true,
+ ...overrides,
+ }
+}
+
+describe('OllamaProvider', () => {
+ beforeEach(() => {
+ vi.clearAllMocks()
+ })
+
+ describe('constructor', () => {
+ it('has correct id', () => {
+ const provider = new OllamaProvider(makeConfig())
+ expect(provider.id).toBe('ollama')
+ })
+ })
+
+ describe('listModels', () => {
+ it('parses Ollama /api/tags format with details.parameter_size', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ models: [
+ {
+ name: 'llama3.1:8b',
+ model: 'llama3.1:8b',
+ size: 4661224676,
+ digest: 'abc123',
+ modified_at: '2024-01-01T00:00:00Z',
+ details: {
+ parent_model: '',
+ format: 'gguf',
+ family: 'llama',
+ families: ['llama'],
+ parameter_size: '8.0B',
+ quantization_level: 'Q4_0',
+ },
+ },
+ {
+ name: 'mistral:7b',
+ model: 'mistral:7b',
+ size: 3825819519,
+ digest: 'def456',
+ modified_at: '2024-01-02T00:00:00Z',
+ details: {
+ parent_model: '',
+ format: 'gguf',
+ family: 'llama',
+ families: ['llama'],
+ parameter_size: '7.2B',
+ quantization_level: 'Q4_0',
+ },
+ },
+ ]
+ }), { status: 200 })
+ )
+
+ const models = await provider.listModels()
+ expect(models).toHaveLength(2)
+ expect(models[0].id).toBe('llama3.1:8b')
+ expect(models[0].name).toBe('llama3.1:8b')
+ expect(models[0].provider).toBe('ollama')
+ expect(models[0].providerName).toBe('Ollama')
+ expect(models[1].id).toBe('mistral:7b')
+ expect(models[1].provider).toBe('ollama')
+ })
+
+ it('handles empty model list', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ models: [] }), { status: 200 })
+ )
+ const models = await provider.listModels()
+ expect(models).toHaveLength(0)
+ })
+
+ it('handles missing models key', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({}), { status: 200 })
+ )
+ const models = await provider.listModels()
+ expect(models).toHaveLength(0)
+ })
+
+ it('throws ProviderError on non-ok response', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ error: 'server error' }), { status: 500 })
+ )
+ try {
+ await provider.listModels()
+ expect.fail('Should have thrown')
+ } catch (e: any) {
+ expect(e).toBeInstanceOf(ProviderError)
+ expect(e.provider).toBe('ollama')
+ expect(e.code).toBe('network')
+ expect(e.status).toBe(500)
+ }
+ })
+ })
+
+ describe('checkConnection', () => {
+ it('returns true on successful connection', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ models: [] }), { status: 200 })
+ )
+ expect(await provider.checkConnection()).toBe(true)
+ })
+
+ it('returns false on network error', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockRejectedValueOnce(new Error('ECONNREFUSED'))
+ expect(await provider.checkConnection()).toBe(false)
+ })
+
+ it('returns false on non-ok response', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response('', { status: 500 })
+ )
+ expect(await provider.checkConnection()).toBe(false)
+ })
+
+ it('returns false on 404', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response('', { status: 404 })
+ )
+ expect(await provider.checkConnection()).toBe(false)
+ })
+ })
+
+ describe('getContextLength', () => {
+ it('returns context length from model_info', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ model_info: {
+ 'general.context_length': 131072,
+ },
+ }), { status: 200 })
+ )
+ expect(await provider.getContextLength('llama3.1:8b')).toBe(131072)
+ })
+
+ it('falls back to parameters.num_ctx', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ model_info: {},
+ parameters: { num_ctx: 8192 },
+ }), { status: 200 })
+ )
+ expect(await provider.getContextLength('mistral:7b')).toBe(8192)
+ })
+
+ it('returns default 4096 when no info available', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({}), { status: 200 })
+ )
+ expect(await provider.getContextLength('unknown-model')).toBe(4096)
+ })
+
+ it('returns default 4096 on network error', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockRejectedValueOnce(new Error('Network error'))
+ expect(await provider.getContextLength('model')).toBe(4096)
+ })
+
+ it('returns default 4096 on non-ok response', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response('', { status: 404 })
+ )
+ expect(await provider.getContextLength('nonexistent')).toBe(4096)
+ })
+
+ it('sends POST to /api/show with model name', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ model_info: { 'general.context_length': 4096 } }), { status: 200 })
+ )
+ await provider.getContextLength('llama3.1:8b')
+
+ expect(mockLocalFetch).toHaveBeenCalledWith(
+ expect.stringContaining('/show'),
+ expect.objectContaining({
+ method: 'POST',
+ body: JSON.stringify({ name: 'llama3.1:8b' }),
+ })
+ )
+ })
+ })
+
+ describe('chatWithTools', () => {
+ it('parses tool calls from Ollama response', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: {
+ role: 'assistant',
+ content: '',
+ tool_calls: [{
+ function: {
+ name: 'web_search',
+ arguments: { query: 'test query' },
+ },
+ }],
+ },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const result = await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'search for test' }],
+ [{
+ type: 'function',
+ function: {
+ name: 'web_search',
+ description: 'Search the web',
+ parameters: {
+ type: 'object',
+ properties: { query: { type: 'string', description: 'query' } },
+ required: ['query'],
+ },
+ },
+ }],
+ )
+
+ expect(result.toolCalls).toHaveLength(1)
+ expect(result.toolCalls[0].function.name).toBe('web_search')
+ expect(result.toolCalls[0].function.arguments).toEqual({ query: 'test query' })
+ })
+
+ it('handles response with no tool calls', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: {
+ role: 'assistant',
+ content: 'Hello! How can I help you?',
+ },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const result = await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'hi' }],
+ [],
+ )
+
+ expect(result.content).toBe('Hello! How can I help you?')
+ expect(result.toolCalls).toHaveLength(0)
+ })
+
+ it('handles multiple tool calls', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: {
+ role: 'assistant',
+ content: '',
+ tool_calls: [
+ { function: { name: 'web_search', arguments: { query: 'weather' } } },
+ { function: { name: 'web_search', arguments: { query: 'news' } } },
+ ],
+ },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const result = await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'search weather and news' }],
+ [],
+ )
+
+ expect(result.toolCalls).toHaveLength(2)
+ expect(result.toolCalls[0].function.name).toBe('web_search')
+ expect(result.toolCalls[0].function.arguments).toEqual({ query: 'weather' })
+ expect(result.toolCalls[1].function.name).toBe('web_search')
+ expect(result.toolCalls[1].function.arguments).toEqual({ query: 'news' })
+ })
+
+ it('sends stream: false for non-streaming tool calls', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'test' }],
+ [],
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.stream).toBe(false)
+ expect(body.model).toBe('llama3.1:8b')
+ })
+
+ it('sends tools in request body', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: '' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const tools = [{
+ type: 'function' as const,
+ function: {
+ name: 'calculator',
+ description: 'Do math',
+ parameters: {
+ type: 'object',
+ properties: { expression: { type: 'string', description: 'math expression' } },
+ required: ['expression'],
+ },
+ },
+ }]
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'calc 2+2' }],
+ tools,
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.tools).toEqual(tools)
+ })
+
+ it('passes chat options to Ollama options', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'test' }],
+ [],
+ { temperature: 0.7, topP: 0.9, topK: 40, maxTokens: 1024 },
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.options.temperature).toBe(0.7)
+ expect(body.options.top_p).toBe(0.9)
+ expect(body.options.top_k).toBe(40)
+ expect(body.options.num_predict).toBe(1024)
+ })
+
+ it('does not include options key when no chat options provided', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'test' }],
+ [],
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.options).toBeUndefined()
+ })
+
+ it('handles empty message content', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const result = await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'test' }],
+ [],
+ )
+
+ expect(result.content).toBe('')
+ expect(result.toolCalls).toHaveLength(0)
+ })
+ })
+
+ describe('error handling', () => {
+ it('throws ProviderError on chatWithTools failure', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ error: 'model not found' }), { status: 404 })
+ )
+
+ try {
+ await provider.chatWithTools(
+ 'nonexistent-model',
+ [{ role: 'user', content: 'hi' }],
+ [],
+ )
+ expect.fail('Should have thrown')
+ } catch (e: any) {
+ expect(e).toBeInstanceOf(ProviderError)
+ expect(e.provider).toBe('ollama')
+ expect(e.status).toBe(404)
+ }
+ })
+
+ it('uses error message from response body', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ error: 'model "xyz" not found' }), { status: 404 })
+ )
+
+ try {
+ await provider.chatWithTools(
+ 'xyz',
+ [{ role: 'user', content: 'hi' }],
+ [],
+ )
+ expect.fail('Should have thrown')
+ } catch (e: any) {
+ expect(e).toBeInstanceOf(ProviderError)
+ expect(e.message).toBe('model "xyz" not found')
+ }
+ })
+
+ it('uses fallback message when response body is not JSON', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response('not json', { status: 500 })
+ )
+
+ try {
+ await provider.chatWithTools(
+ 'model',
+ [{ role: 'user', content: 'hi' }],
+ [],
+ )
+ expect.fail('Should have thrown')
+ } catch (e: any) {
+ expect(e).toBeInstanceOf(ProviderError)
+ expect(e.message).toBe('Tool calling failed')
+ }
+ })
+
+ it('throws ProviderError on listModels failure', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response('', { status: 503 })
+ )
+
+ try {
+ await provider.listModels()
+ expect.fail('Should have thrown')
+ } catch (e: any) {
+ expect(e).toBeInstanceOf(ProviderError)
+ expect(e.provider).toBe('ollama')
+ expect(e.status).toBe(503)
+ }
+ })
+ })
+
+ describe('URL construction', () => {
+ it('constructs correct URLs for /api/tags', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({ models: [] }), { status: 200 })
+ )
+ await provider.listModels()
+
+ // In non-Tauri mode, apiUrl returns /api/tags (dev proxy)
+ expect(mockLocalFetch).toHaveBeenCalledWith(
+ expect.stringContaining('/tags'),
+ )
+ })
+
+ it('constructs correct URLs for /api/chat', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [{ role: 'user', content: 'test' }],
+ [],
+ )
+
+ expect(mockLocalFetch).toHaveBeenCalledWith(
+ expect.stringContaining('/chat'),
+ expect.any(Object),
+ )
+ })
+ })
+
+ describe('message conversion', () => {
+ it('converts messages to Ollama format with role and content', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [
+ { role: 'system', content: 'You are helpful.' },
+ { role: 'user', content: 'Hello' },
+ { role: 'assistant', content: 'Hi there!' },
+ { role: 'user', content: 'How are you?' },
+ ],
+ [],
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.messages).toHaveLength(4)
+ expect(body.messages[0]).toEqual({ role: 'system', content: 'You are helpful.' })
+ expect(body.messages[1]).toEqual({ role: 'user', content: 'Hello' })
+ expect(body.messages[2]).toEqual({ role: 'assistant', content: 'Hi there!' })
+ expect(body.messages[3]).toEqual({ role: 'user', content: 'How are you?' })
+ })
+
+ it('passes tool_calls from messages when present', async () => {
+ const provider = new OllamaProvider(makeConfig())
+ mockLocalFetch.mockResolvedValueOnce(
+ new Response(JSON.stringify({
+ message: { role: 'assistant', content: 'ok' },
+ done: true,
+ }), { status: 200 })
+ )
+
+ const toolCallMessage = {
+ role: 'assistant' as const,
+ content: '',
+ tool_calls: [{ function: { name: 'test', arguments: { x: 1 } } }],
+ }
+
+ await provider.chatWithTools(
+ 'llama3.1:8b',
+ [
+ { role: 'user', content: 'test' },
+ toolCallMessage,
+ ],
+ [],
+ )
+
+ const body = JSON.parse(mockLocalFetch.mock.calls[0][1]?.body as string)
+ expect(body.messages[1].tool_calls).toBeDefined()
+ expect(body.messages[1].tool_calls[0].function.name).toBe('test')
+ })
+ })
+})
diff --git a/src/api/providers/ollama-provider.ts b/src/api/providers/ollama-provider.ts
index 87cd3648..9778fd76 100644
--- a/src/api/providers/ollama-provider.ts
+++ b/src/api/providers/ollama-provider.ts
@@ -6,11 +6,11 @@
*/
import type {
- ProviderClient, ProviderModel, ChatMessage, ChatOptions,
+ ProviderClient, ProviderModel, ProviderConfig, ChatMessage, ChatOptions,
ChatStreamChunk, ToolCall, ToolDefinition,
} from './types'
import { ProviderError } from './types'
-import { ollamaUrl, localFetch, localFetchStream } from '../backend'
+import { isTauri, localFetch, localFetchStream } from '../backend'
import { parseNDJSONStream } from '../stream'
// ── Ollama-specific types ──────────────────────────────────────
@@ -41,6 +41,18 @@ interface OllamaModelEntry {
export class OllamaProvider implements ProviderClient {
readonly id = 'ollama' as const
+ constructor(private config: ProviderConfig) {}
+
+ /** Build a full Ollama API URL from config.baseUrl + path */
+ private apiUrl(path: string): string {
+ const base = this.config.baseUrl || 'http://localhost:11434'
+ if (isTauri()) {
+ return `${base}/api${path}`
+ }
+ // Dev mode: proxy through Vite — use /api path
+ return `/api${path}`
+ }
+
async *chatStream(
model: string,
messages: ChatMessage[],
@@ -61,7 +73,7 @@ export class OllamaProvider implements ProviderClient {
if (options?.maxTokens) ollamaOptions.num_predict = options.maxTokens
if (Object.keys(ollamaOptions).length > 0) body.options = ollamaOptions
- const res = await localFetchStream(ollamaUrl('/chat'), {
+ const res = await localFetchStream(this.apiUrl('/chat'), {
method: 'POST',
body: JSON.stringify(body),
})
@@ -114,7 +126,7 @@ export class OllamaProvider implements ProviderClient {
if (options?.maxTokens) ollamaOptions.num_predict = options.maxTokens
if (Object.keys(ollamaOptions).length > 0) body.options = ollamaOptions
- const res = await localFetch(ollamaUrl('/chat'), {
+ const res = await localFetch(this.apiUrl('/chat'), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
@@ -139,7 +151,7 @@ export class OllamaProvider implements ProviderClient {
}
async listModels(): Promise<ProviderModel[]> {
- const res = await localFetch(ollamaUrl('/tags'))
+ const res = await localFetch(this.apiUrl('/tags'))
if (!res.ok) {
throw new ProviderError('Failed to fetch Ollama models', 'ollama', 'network', res.status)
}
@@ -156,7 +168,7 @@ export class OllamaProvider implements ProviderClient {
async checkConnection(): Promise<boolean> {
try {
- const res = await localFetch(ollamaUrl('/tags'))
+ const res = await localFetch(this.apiUrl('/tags'))
return res.ok
} catch {
return false
@@ -165,7 +177,7 @@ export class OllamaProvider implements ProviderClient {
async getContextLength(model: string): Promise<number> {
try {
- const res = await localFetch(ollamaUrl('/show'), {
+ const res = await localFetch(this.apiUrl('/show'), {
method: 'POST',
body: JSON.stringify({ name: model }),
})
diff --git a/src/api/providers/registry.ts b/src/api/providers/registry.ts
index f249288c..f42b198d 100644
--- a/src/api/providers/registry.ts
+++ b/src/api/providers/registry.ts
@@ -29,7 +29,7 @@ function cacheKey(config: ProviderConfig): string {
function createClient(config: ProviderConfig): ProviderClient {
switch (config.id) {
case 'ollama':
- return new OllamaProvider()
+ return new OllamaProvider(config)
case 'openai':
return new OpenAIProvider(config)
case 'anthropic':
diff --git a/src/components/onboarding/Onboarding.tsx b/src/components/onboarding/Onboarding.tsx
index 9d034060..ad4d4d6e 100644
--- a/src/components/onboarding/Onboarding.tsx
+++ b/src/components/onboarding/Onboarding.tsx
@@ -192,8 +192,8 @@ export function Onboarding() {
onClick={() => {
const backend = detectedBackends.find(b => b.id === selectedBackend)
if (backend && backend.id !== 'ollama') {
- // Disable Ollama, enable selected backend
- setProviderConfig('ollama', { enabled: false })
+ // Enable selected backend WITHOUT disabling Ollama
+ // Both can be active simultaneously
setProviderConfig('openai', {
enabled: true,
name: backend.name,
diff --git a/src/components/settings/ApiConfig.tsx b/src/components/settings/ApiConfig.tsx
deleted file mode 100644
index 1fabbe76..00000000
--- a/src/components/settings/ApiConfig.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useState } from 'react'
-import { Wifi, WifiOff } from 'lucide-react'
-import { GlowButton } from '../ui/GlowButton'
-import { checkConnection } from '../../api/ollama'
-
-interface Props {
- endpoint: string
- onChange: (endpoint: string) => void
-}
-
-export function ApiConfig({ endpoint, onChange }: Props) {
- const [status, setStatus] = useState<'idle' | 'connected' | 'failed'>('idle')
- const [testing, setTesting] = useState(false)
-
- const handleTest = async () => {
- setTesting(true)
- const ok = await checkConnection()
- setStatus(ok ? 'connected' : 'failed')
- setTesting(false)
- }
-
- return (
- <div className="space-y-3">
- <label className="text-sm text-gray-300">API Endpoint</label>
- <div className="flex gap-2">
- <input
- value={endpoint}
- onChange={(e) => onChange(e.target.value)}
- className="flex-1 px-3 py-2 rounded-lg bg-white/5 border border-white/10 text-white text-sm focus:outline-none focus:border-white/20 font-mono"
- />
- <GlowButton variant="secondary" onClick={handleTest} disabled={testing}>
- {testing ? '...' : 'Test'}
- </GlowButton>
- </div>
- {status === 'connected' && (
- <div className="flex items-center gap-2 text-green-400 text-sm">
- <Wifi size={14} /> Connected
- </div>
- )}
- {status === 'failed' && (
- <div className="flex items-center gap-2 text-red-400 text-sm">
- <WifiOff size={14} /> Connection failed
- </div>
- )}
- </div>
- )
-}
diff --git a/src/components/settings/ProviderConfig.tsx b/src/components/settings/ProviderConfig.tsx
index c3178ac2..2fff4306 100644
--- a/src/components/settings/ProviderConfig.tsx
+++ b/src/components/settings/ProviderConfig.tsx
@@ -1,5 +1,5 @@
import { useState } from 'react'
-import { Wifi, WifiOff, Loader2, Eye, EyeOff, ChevronDown } from 'lucide-react'
+import { Wifi, WifiOff, Loader2, Eye, EyeOff, ChevronDown, Plus, Power } from 'lucide-react'
import { useProviderStore } from '../../stores/providerStore'
import { useMemoryStore } from '../../stores/memoryStore'
import { getProvider } from '../../api/providers'
@@ -10,51 +10,30 @@ import type { ProviderId } from '../../api/providers/types'
export function ProviderSettings() {
const { providers, setProviderConfig, setProviderApiKey, getProviderApiKey } = useProviderStore()
const [dropdownOpen, setDropdownOpen] = useState(false)
- const [testing, setTesting] = useState(false)
- const [status, setStatus] = useState<'idle' | 'connected' | 'failed'>('idle')
- const [showKey, setShowKey] = useState(false)
+ const [testing, setTesting] = useState<ProviderId | null>(null)
+ const [statuses, setStatuses] = useState<Record<string, 'idle' | 'connected' | 'failed'>>({})
+ const [showKey, setShowKey] = useState<Record<string, boolean>>({})
const [showCloudWarning, setShowCloudWarning] = useState(false)
const [pendingPreset, setPendingPreset] = useState<typeof PROVIDER_PRESETS[0] | null>(null)
+ const [expandedProvider, setExpandedProvider] = useState<ProviderId | null>(null)
- // Determine what's currently active
- const activePreset = getActivePreset()
+ const autoExtractEnabled = useMemoryStore((s) => s.settings.autoExtractEnabled)
- function getActivePreset() {
- // Check Ollama
- if (providers.ollama.enabled) {
- return PROVIDER_PRESETS.find(p => p.id === 'ollama')!
- }
- // Check Anthropic
- if (providers.anthropic.enabled) {
- return PROVIDER_PRESETS.find(p => p.id === 'anthropic')!
- }
- // Check OpenAI-compat
- if (providers.openai.enabled) {
- const name = providers.openai.name
- return PROVIDER_PRESETS.find(p => p.name === name && p.providerId === 'openai') ||
- PROVIDER_PRESETS.find(p => p.id === 'custom-openai')!
- }
- // Nothing active
- return null
- }
+ // Get all enabled providers
+ const enabledProviderIds = (Object.keys(providers) as ProviderId[]).filter(id => providers[id].enabled)
- // Get the active provider's config
- function getActiveProviderId(): ProviderId | null {
- if (providers.ollama.enabled) return 'ollama'
- if (providers.anthropic.enabled) return 'anthropic'
- if (providers.openai.enabled) return 'openai'
- return null
+ // Find the preset that matches a provider config
+ function getPresetForProvider(id: ProviderId) {
+ const config = providers[id]
+ if (id === 'ollama') return PROVIDER_PRESETS.find(p => p.id === 'ollama')!
+ if (id === 'anthropic') return PROVIDER_PRESETS.find(p => p.id === 'anthropic')!
+ // For openai-compat, match by name or baseUrl
+ return PROVIDER_PRESETS.find(p => p.providerId === 'openai' && (p.name === config.name || p.baseUrl === config.baseUrl)) ||
+ PROVIDER_PRESETS.find(p => p.id === 'custom-openai')!
}
- const activeProviderId = getActiveProviderId()
- const activeConfig = activeProviderId ? providers[activeProviderId] : null
- const needsKey = activeConfig && !activeConfig.isLocal
- const currentKey = activeProviderId ? getProviderApiKey(activeProviderId) : ''
- const autoExtractEnabled = useMemoryStore((s) => s.settings.autoExtractEnabled)
-
- // Select a preset
+ // Add a preset (enable a provider without disabling others)
function selectPreset(preset: typeof PROVIDER_PRESETS[0]) {
- // Cloud → show warning first
if (!preset.isLocal) {
setPendingPreset(preset)
setShowCloudWarning(true)
@@ -64,12 +43,7 @@ export function ProviderSettings() {
}
function applyPreset(preset: typeof PROVIDER_PRESETS[0]) {
- // Disable everything first
- setProviderConfig('ollama', { enabled: false })
- setProviderConfig('openai', { enabled: false })
- setProviderConfig('anthropic', { enabled: false })
-
- // Enable selected
+ // Enable the selected provider WITHOUT disabling others
if (preset.providerId === 'ollama') {
setProviderConfig('ollama', { enabled: true, baseUrl: preset.baseUrl })
} else if (preset.providerId === 'anthropic') {
@@ -79,157 +53,219 @@ export function ProviderSettings() {
}
setDropdownOpen(false)
- setStatus('idle')
+ setStatuses(prev => ({ ...prev, [preset.providerId]: 'idle' }))
+ setExpandedProvider(preset.providerId)
}
- const handleTest = async () => {
- if (!activeProviderId) return
- setTesting(true)
- setStatus('idle')
+ // Toggle a provider on/off independently
+ function toggleProvider(id: ProviderId) {
+ setProviderConfig(id, { enabled: !providers[id].enabled })
+ setStatuses(prev => ({ ...prev, [id]: 'idle' }))
+ }
+
+ const handleTest = async (providerId: ProviderId) => {
+ setTesting(providerId)
+ setStatuses(prev => ({ ...prev, [providerId]: 'idle' }))
try {
- const client = getProvider(activeProviderId)
+ const client = getProvider(providerId)
const ok = await client.checkConnection()
- setStatus(ok ? 'connected' : 'failed')
+ setStatuses(prev => ({ ...prev, [providerId]: ok ? 'connected' : 'failed' }))
} catch {
- setStatus('failed')
+ setStatuses(prev => ({ ...prev, [providerId]: 'failed' }))
}
- setTesting(false)
+ setTesting(null)
}
- // Group presets for dropdown
+ // Group presets for the "Add provider" dropdown
const localPresets = PROVIDER_PRESETS.filter(p => p.isLocal)
const cloudPresets = PROVIDER_PRESETS.filter(p => !p.isLocal)
- const noBackend = !activeProviderId
+ const noBackend = enabledProviderIds.length === 0
return (
<div className="space-y-2">
- {/* Backend Dropdown */}
- <div className="relative">
- <button
- onClick={() => setDropdownOpen(!dropdownOpen)}
- className="w-full flex items-center justify-between px-2 py-1 rounded bg-white/5 border border-white/8 text-[0.65rem] text-gray-400 hover:text-gray-300 transition-colors"
- >
- <div className="flex items-center gap-2">
- <span className={`w-1.5 h-1.5 rounded-full ${activePreset ? 'bg-green-500' : 'bg-gray-600'}`} />
- <span className="text-gray-300">{activePreset?.name || 'No backend selected'}</span>
- {activeConfig?.isLocal && <span className="text-[0.5rem] px-1 py-0.5 rounded bg-green-500/10 text-green-400">LOCAL</span>}
- {activeConfig && !activeConfig.isLocal && <span className="text-[0.5rem] px-1 py-0.5 rounded bg-blue-500/10 text-blue-400">CLOUD</span>}
- </div>
- <ChevronDown size={10} className={`transition-transform ${dropdownOpen ? 'rotate-180' : ''}`} />
- </button>
- {dropdownOpen && (
- <div className="absolute z-50 top-full mt-1 w-full bg-[#2a2a2a] border border-white/10 rounded-lg shadow-xl max-h-56 overflow-y-auto scrollbar-thin">
- {/* Local group */}
- <div className="px-2.5 py-1 text-[0.5rem] uppercase tracking-wider text-gray-600 font-semibold">Local</div>
- {localPresets.map(preset => (
+ {/* Active Providers List */}
+ {enabledProviderIds.map(id => {
+ const config = providers[id]
+ const preset = getPresetForProvider(id)
+ const needsKey = !config.isLocal
+ const currentKey = getProviderApiKey(id)
+ const status = statuses[id] || 'idle'
+ const isExpanded = expandedProvider === id
+ const isTesting = testing === id
+ const isKeyVisible = showKey[id] || false
+
+ return (
+ <div key={id} className="rounded-lg border border-white/8 bg-white/[0.02] overflow-hidden">
+ {/* Provider header */}
+ <div className="flex items-center gap-2 px-2 py-1.5">
<button
- key={preset.id}
- onClick={() => selectPreset(preset)}
- className={`w-full text-left px-2.5 py-1.5 text-[0.65rem] transition-colors ${
- activePreset?.id === preset.id ? 'bg-white/10 text-white' : 'text-gray-300 hover:bg-white/5'
- }`}
+ onClick={() => toggleProvider(id)}
+ className="group flex items-center"
+ title={config.enabled ? 'Disable provider' : 'Enable provider'}
>
- <span className="font-medium">{preset.name}</span>
- {preset.baseUrl && <span className="block text-[0.55rem] text-gray-500 font-mono">{preset.baseUrl}</span>}
+ <Power size={10} className="text-green-400 group-hover:text-red-400 transition-colors" />
</button>
- ))}
-
- {/* Cloud group */}
- <div className="px-2.5 py-1 mt-1 border-t border-white/[0.06] text-[0.5rem] uppercase tracking-wider text-gray-600 font-semibold">Cloud</div>
- {cloudPresets.map(preset => (
<button
- key={preset.id}
- onClick={() => selectPreset(preset)}
- className={`w-full text-left px-2.5 py-1.5 text-[0.65rem] transition-colors ${
- activePreset?.id === preset.id ? 'bg-white/10 text-white' : 'text-gray-300 hover:bg-white/5'
- }`}
+ onClick={() => setExpandedProvider(isExpanded ? null : id)}
+ className="flex-1 flex items-center justify-between min-w-0"
>
- <span className="font-medium">{preset.name}</span>
- {preset.baseUrl && <span className="block text-[0.55rem] text-gray-500 font-mono">{preset.baseUrl}</span>}
+ <div className="flex items-center gap-2 min-w-0">
+ <span className="w-1.5 h-1.5 rounded-full bg-green-500 shrink-0" />
+ <span className="text-[0.65rem] text-gray-300 font-medium truncate">{preset?.name || config.name}</span>
+ {config.isLocal && <span className="text-[0.5rem] px-1 py-0.5 rounded bg-green-500/10 text-green-400 shrink-0">LOCAL</span>}
+ {!config.isLocal && <span className="text-[0.5rem] px-1 py-0.5 rounded bg-blue-500/10 text-blue-400 shrink-0">CLOUD</span>}
+ {status === 'connected' && <Wifi size={8} className="text-green-400 shrink-0" />}
+ {status === 'failed' && <WifiOff size={8} className="text-red-400 shrink-0" />}
+ </div>
+ <ChevronDown size={10} className={`text-gray-500 transition-transform shrink-0 ${isExpanded ? 'rotate-180' : ''}`} />
</button>
- ))}
+ </div>
+
+ {/* Expanded config */}
+ {isExpanded && (
+ <div className="px-2 pb-2 space-y-1.5 border-t border-white/[0.04]">
+ {/* Endpoint */}
+ <div className="pt-1.5">
+ <label className="text-[0.6rem] text-gray-500 mb-0.5 block">Endpoint</label>
+ <input
+ value={config.baseUrl}
+ onChange={(e) => setProviderConfig(id, { baseUrl: e.target.value })}
+ placeholder="http://localhost:..."
+ className="w-full px-2 py-1 rounded bg-white/5 border border-white/8 text-[0.65rem] text-gray-300 font-mono focus:outline-none focus:border-white/20"
+ />
+ </div>
+
+ {/* API Key (cloud only) */}
+ {needsKey && (
+ <div>
+ <label className="text-[0.6rem] text-gray-500 mb-0.5 block">API Key</label>
+ <div className="relative">
+ <input
+ type={isKeyVisible ? 'text' : 'password'}
+ value={currentKey}
+ onChange={(e) => setProviderApiKey(id, e.target.value)}
+ placeholder={preset?.placeholder || 'sk-...'}
+ className="w-full px-2 py-1 pr-7 rounded bg-white/5 border border-white/8 text-[0.65rem] text-gray-300 font-mono focus:outline-none focus:border-white/20"
+ />
+ <button
+ onClick={() => setShowKey(prev => ({ ...prev, [id]: !isKeyVisible }))}
+ className="absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300"
+ >
+ {isKeyVisible ? <EyeOff size={10} /> : <Eye size={10} />}
+ </button>
+ </div>
+ </div>
+ )}
+
+ {/* Test + Disable */}
+ <div className="flex items-center gap-2">
+ <button
+ onClick={() => handleTest(id)}
+ disabled={isTesting}
+ className="px-2 py-0.5 rounded bg-white/5 border border-white/8 text-[0.6rem] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-colors disabled:opacity-50"
+ >
+ {isTesting ? <Loader2 size={10} className="animate-spin" /> : 'Test'}
+ </button>
+ <button
+ onClick={() => toggleProvider(id)}
+ className="px-2 py-0.5 rounded bg-red-500/5 border border-red-500/10 text-[0.6rem] text-red-400 hover:text-red-300 hover:bg-red-500/10 transition-colors"
+ >
+ Disable
+ </button>
+ {status === 'connected' && (
+ <span className="flex items-center gap-1 text-[0.6rem] text-green-400">
+ <Wifi size={10} /> Connected
+ </span>
+ )}
+ {status === 'failed' && (
+ <span className="flex items-center gap-1 text-[0.6rem] text-red-400">
+ <WifiOff size={10} /> Failed
+ </span>
+ )}
+ </div>
+
+ {/* API key storage disclaimer */}
+ {needsKey && currentKey && (
+ <p className="text-[0.5rem] text-gray-600 mt-0.5 leading-tight">
+ Keys are stored locally with basic obfuscation, not encryption. Avoid shared computers.
+ </p>
+ )}
+
+ {/* Cloud + auto-extract cost warning */}
+ {needsKey && autoExtractEnabled && (
+ <p className="text-[0.55rem] text-amber-400/80 mt-1 leading-tight">
+ Memory auto-extraction runs a secondary inference every 3rd turn, increasing API costs. Disable in Settings &gt; Memory if not needed.
+ </p>
+ )}
+ </div>
+ )}
</div>
- )}
- </div>
+ )
+ })}
{/* No backend warning */}
{noBackend && (
- <p className="text-[0.6rem] text-red-400">No backend configured. Select one above to start chatting.</p>
+ <p className="text-[0.6rem] text-red-400">No backend configured. Add one below to start chatting.</p>
)}
- {/* Endpoint + Key + Test (only when a backend is selected) */}
- {activeConfig && activeProviderId && (
- <>
- {/* Endpoint */}
- <div>
- <label className="text-[0.6rem] text-gray-500 mb-0.5 block">Endpoint</label>
- <input
- value={activeConfig.baseUrl}
- onChange={(e) => setProviderConfig(activeProviderId, { baseUrl: e.target.value })}
- placeholder="http://localhost:..."
- className="w-full px-2 py-1 rounded bg-white/5 border border-white/8 text-[0.65rem] text-gray-300 font-mono focus:outline-none focus:border-white/20"
- />
- </div>
-
- {/* API Key (cloud only) */}
- {needsKey && (
- <div>
- <label className="text-[0.6rem] text-gray-500 mb-0.5 block">API Key</label>
- <div className="relative">
- <input
- type={showKey ? 'text' : 'password'}
- value={currentKey}
- onChange={(e) => setProviderApiKey(activeProviderId, e.target.value)}
- placeholder={activePreset?.placeholder || 'sk-...'}
- className="w-full px-2 py-1 pr-7 rounded bg-white/5 border border-white/8 text-[0.65rem] text-gray-300 font-mono focus:outline-none focus:border-white/20"
- />
+ {/* Add Provider Dropdown */}
+ <div className="relative">
+ <button
+ onClick={() => setDropdownOpen(!dropdownOpen)}
+ className="w-full flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-white/5 border border-white/8 border-dashed text-[0.65rem] text-gray-500 hover:text-gray-300 hover:border-white/15 transition-colors"
+ >
+ <Plus size={10} />
+ <span>Add Provider</span>
+ </button>
+ {dropdownOpen && (
+ <div className="absolute z-50 top-full mt-1 w-full bg-[#2a2a2a] border border-white/10 rounded-lg shadow-xl max-h-56 overflow-y-auto scrollbar-thin">
+ {/* Local group */}
+ <div className="px-2.5 py-1 text-[0.5rem] uppercase tracking-wider text-gray-600 font-semibold">Local</div>
+ {localPresets.map(preset => {
+ const isActive = enabledProviderIds.includes(preset.providerId) &&
+ (preset.providerId !== 'openai' || providers.openai.name === preset.name)
+ return (
<button
- onClick={() => setShowKey(!showKey)}
- className="absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300"
+ key={preset.id}
+ onClick={() => selectPreset(preset)}
+ className={`w-full text-left px-2.5 py-1.5 text-[0.65rem] transition-colors ${
+ isActive ? 'bg-white/10 text-white' : 'text-gray-300 hover:bg-white/5'
+ }`}
>
- {showKey ? <EyeOff size={10} /> : <Eye size={10} />}
+ <div className="flex items-center justify-between">
+ <span className="font-medium">{preset.name}</span>
+ {isActive && <span className="text-[0.5rem] text-green-400">Active</span>}
+ </div>
+ {preset.baseUrl && <span className="block text-[0.55rem] text-gray-500 font-mono">{preset.baseUrl}</span>}
</button>
- </div>
- </div>
- )}
+ )
+ })}
- {/* Test */}
- <div className="flex items-center gap-2">
- <button
- onClick={handleTest}
- disabled={testing}
- className="px-2 py-0.5 rounded bg-white/5 border border-white/8 text-[0.6rem] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-colors disabled:opacity-50"
- >
- {testing ? <Loader2 size={10} className="animate-spin" /> : 'Test'}
- </button>
- {status === 'connected' && (
- <span className="flex items-center gap-1 text-[0.6rem] text-green-400">
- <Wifi size={10} /> Connected
- </span>
- )}
- {status === 'failed' && (
- <span className="flex items-center gap-1 text-[0.6rem] text-red-400">
- <WifiOff size={10} /> Failed
- </span>
- )}
+ {/* Cloud group */}
+ <div className="px-2.5 py-1 mt-1 border-t border-white/[0.06] text-[0.5rem] uppercase tracking-wider text-gray-600 font-semibold">Cloud</div>
+ {cloudPresets.map(preset => {
+ const isActive = enabledProviderIds.includes(preset.providerId) &&
+ (preset.providerId !== 'openai' || providers.openai.name === preset.name)
+ return (
+ <button
+ key={preset.id}
+ onClick={() => selectPreset(preset)}
+ className={`w-full text-left px-2.5 py-1.5 text-[0.65rem] transition-colors ${
+ isActive ? 'bg-white/10 text-white' : 'text-gray-300 hover:bg-white/5'
+ }`}
+ >
+ <div className="flex items-center justify-between">
+ <span className="font-medium">{preset.name}</span>
+ {isActive && <span className="text-[0.5rem] text-green-400">Active</span>}
+ </div>
+ {preset.baseUrl && <span className="block text-[0.55rem] text-gray-500 font-mono">{preset.baseUrl}</span>}
+ </button>
+ )
+ })}
</div>
-
- {/* API key storage disclaimer */}
- {needsKey && currentKey && (
- <p className="text-[0.5rem] text-gray-600 mt-0.5 leading-tight">
- Keys are stored locally with basic obfuscation, not encryption. Avoid shared computers.
- </p>
- )}
-
- {/* Cloud + auto-extract cost warning */}
- {needsKey && autoExtractEnabled && (
- <p className="text-[0.55rem] text-amber-400/80 mt-1 leading-tight">
- Memory auto-extraction runs a secondary inference every 3rd turn, increasing API costs. Disable in Settings &gt; Memory if not needed.
- </p>
- )}
- </>
- )}
+ )}
+ </div>
{/* Cloud privacy warning popup */}
<Modal open={showCloudWarning} onClose={() => { setShowCloudWarning(false); setPendingPreset(null) }} title="">
diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.ts
index 62e7f964..7b321d23 100644
--- a/src/hooks/useModels.ts
+++ b/src/hooks/useModels.ts
@@ -97,9 +97,9 @@ export function useModels() {
])
const classifyComfyModel = (name: string): AIModel => {
if (isVideoModel(name)) {
- return { name, model: name, size: 0, format: 'safetensors', architecture: 'unknown', type: 'video', provider: 'ollama', providerName: 'ComfyUI' } as VideoModel
+ return { name, model: name, size: 0, format: 'safetensors', architecture: 'unknown', type: 'video', providerName: 'ComfyUI' } as VideoModel
}
- return { name, model: name, size: 0, format: 'safetensors', architecture: 'unknown', type: 'image', provider: 'ollama', providerName: 'ComfyUI' } as ImageModel
+ return { name, model: name, size: 0, format: 'safetensors', architecture: 'unknown', type: 'image', providerName: 'ComfyUI' } as ImageModel
}
comfyModels = [
...checkpoints.map((name) => classifyComfyModel(name)),
diff --git a/vitest.config.ts b/vitest.config.ts
new file mode 100644
index 00000000..00220c23
--- /dev/null
+++ b/vitest.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from 'vitest/config'
+import react from '@vitejs/plugin-react'
+import tailwindcss from '@tailwindcss/vite'
+
+export default defineConfig({
+ plugins: [react(), tailwindcss()],
+ test: {
+ globals: true,
+ environment: 'node',
+ include: ['src/**/__tests__/**/*.test.ts'],
+ },
+})