MCPcopy Create free account
hub / github.com/freecodexyz/free-code / enableConfigs

Function enableConfigs

src/utils/config.ts:1354–1376  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1352let configReadingAllowed = false
1353
1354export function enableConfigs(): void {
1355 if (configReadingAllowed) {
1356 // Ensure this is idempotent
1357 return
1358 }
1359
1360 const startTime = Date.now()
1361 logForDiagnosticsNoPII('info', 'enable_configs_started')
1362
1363 // Any reads to configuration before this flag is set show an console warning
1364 // to prevent us from adding config reading during module initialization
1365 configReadingAllowed = true
1366 // We only check the global config because currently all the configs share a file
1367 getConfig(
1368 getGlobalClaudeFile(),
1369 createDefaultGlobalConfig,
1370 true /* throw on invalid */,
1371 )
1372
1373 logForDiagnosticsNoPII('info', 'enable_configs_completed', {
1374 duration_ms: Date.now() - startTime,
1375 })
1376}
1377
1378/**
1379 * Returns the directory where config backup files are stored.

Callers 7

mainFunction · 0.85
runComputerUseMcpServerFunction · 0.85
bridgeMainFunction · 0.85
runBridgeHeadlessFunction · 0.85
mainFunction · 0.85
init.tsFile · 0.85

Calls 2

logForDiagnosticsNoPIIFunction · 0.85
getConfigFunction · 0.70

Tested by

no test coverage detected