feat(settings): add getConfig/updateConfig to HttpClient

This commit is contained in:
Mark IJbema
2026-02-12 15:11:49 +01:00
parent 45415656e6
commit 4eabb8787b
2 changed files with 21 additions and 0 deletions
@@ -9,6 +9,7 @@ import type {
ProviderListResponse,
McpStatus,
McpConfig,
Config,
} from "./types"
/**
@@ -174,6 +175,25 @@ export class HttpClient {
return this.request<AgentInfo[]>("GET", "/agent", undefined, { directory })
}
// ============================================
// Config Methods
// ============================================
/**
* Get the current backend configuration.
*/
async getConfig(directory: string): Promise<Config> {
return this.request<Config>("GET", "/config", undefined, { directory })
}
/**
* Update backend configuration (partial merge).
* The server merges the provided fields into the existing config.
*/
async updateConfig(config: Partial<Config>, directory: string): Promise<Config> {
return this.request<Config>("PATCH", "/config", config, { directory })
}
// ============================================
// Messaging Methods
// ============================================
@@ -25,6 +25,7 @@ export type {
McpLocalConfig,
McpRemoteConfig,
McpConfig,
Config,
} from "./types"
export { ServerManager } from "./server-manager"