mirror of
https://github.com/block/buzz.git
synced 2026-11-08 02:11:36 +00:00
Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
26 lines
844 B
TypeScript
26 lines
844 B
TypeScript
import { invokeTauri } from "@/shared/api/tauri";
|
|
import type { GlobalAgentConfig } from "@/shared/api/types";
|
|
|
|
/**
|
|
* Read the current global agent configuration defaults.
|
|
*
|
|
* Returns an empty default if the file has not been written yet.
|
|
*/
|
|
export async function getGlobalAgentConfig(): Promise<GlobalAgentConfig> {
|
|
return invokeTauri<GlobalAgentConfig>("get_global_agent_config");
|
|
}
|
|
|
|
/**
|
|
* Validate and persist a new global agent configuration.
|
|
*
|
|
* The backend strips empty env values (empty = "inherit"), validates key
|
|
* shape and reserved-key rules, and returns the saved config.
|
|
*
|
|
* Throws a string error message on validation failure.
|
|
*/
|
|
export async function setGlobalAgentConfig(
|
|
config: GlobalAgentConfig,
|
|
): Promise<GlobalAgentConfig> {
|
|
return invokeTauri<GlobalAgentConfig>("set_global_agent_config", { config });
|
|
}
|