feat: enable/disable providers from settings

Adds a per-provider toggle in Settings → Providers, persisted via daemon
config, so users can turn off providers they don't have installed (or
don't want to use) without removing them from the registry.

Disabled providers stay visible everywhere — settings, `paseo provider
ls`, MCP `list_providers`, model/mode lists — marked as disabled rather
than silently filtered. Availability probes are skipped for them, and
attempts to launch an agent or fetch models/modes from a disabled
provider return a clear "Provider '<id>' is disabled" error.

Schema additions (`enabled` on `ProviderSnapshotEntry`, MCP provider
summary) are backward-compatible: optional with a default of true so
older clients continue to parse new daemon messages.

CLI: `paseo provider ls` gains an ENABLED column; JSON output includes
the new field.
This commit is contained in:
Mohamed Boudra
2026-04-25 14:00:38 +07:00
parent de42858213
commit 4b3603604a
31 changed files with 1920 additions and 216 deletions
+3 -3
View File
@@ -44,7 +44,7 @@ async function probeExecutable(executablePath: string): Promise<boolean> {
return await new Promise((resolve) => {
let pendingResolve: ((result: boolean) => void) | null = resolve;
let started = false;
let timer: ReturnType<typeof setTimeout> | undefined;
let timer: NodeJS.Timeout | undefined;
const settle = (result: boolean) => {
if (!pendingResolve) {
@@ -78,8 +78,8 @@ async function probeExecutable(executablePath: string): Promise<boolean> {
return;
}
settle(false);
}, PROBE_TIMEOUT_MS);
timer.unref?.();
}, PROBE_TIMEOUT_MS) as unknown as NodeJS.Timeout;
timer.unref();
child.once("spawn", () => {
started = true;