MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / readSettings

Function readSettings

packages/consortium-cli/src/persistence.ts:25–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25export async function readSettings(): Promise<Settings> {
26 if (!existsSync(configuration.settingsFile)) {
27 return { ...defaultSettings }
28 }
29 try {
30 const content = await readFile(configuration.settingsFile, 'utf8')
31 const raw = JSON.parse(content)
32 return { ...defaultSettings, ...raw };
33 } catch (error: any) {
34 logger.warn(`Failed to read settings: ${error.message}`);
35 return { ...defaultSettings }
36 }
37}
38
39export async function writeSettings(settings: Settings): Promise<void> {
40 if (!existsSync(configuration.consortiumHomeDir)) {

Callers 1

updateSettingsFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected