mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-24 01:24:18 +08:00
feat(settings): add getConfig/updateConfig to HttpClient
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user