chore(foundry): workbench action responsiveness (#254)

* wip

* wip
This commit is contained in:
Nathan Flurry 2026-03-14 20:42:18 -07:00 committed by GitHub
parent 400f9a214e
commit 99abb9d42e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
171 changed files with 7260 additions and 7342 deletions

View file

@ -0,0 +1,25 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { dirname } from "node:path";
import { homedir } from "node:os";
import * as toml from "@iarna/toml";
import { ConfigSchema, resolveOrganizationId, type AppConfig } from "@sandbox-agent/foundry-shared";
export const CONFIG_PATH = `${homedir()}/.config/foundry/config.toml`;
export function loadConfig(path = CONFIG_PATH): AppConfig {
if (!existsSync(path)) {
return ConfigSchema.parse({});
}
const raw = readFileSync(path, "utf8");
return ConfigSchema.parse(toml.parse(raw));
}
export function saveConfig(config: AppConfig, path = CONFIG_PATH): void {
mkdirSync(dirname(path), { recursive: true });
writeFileSync(path, toml.stringify(config), "utf8");
}
export function resolveOrganization(flagOrganization: string | undefined, config: AppConfig): string {
return resolveOrganizationId(flagOrganization, config);
}