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

Function enableConfigs

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

Source from the content-addressed store, hash-verified

1406let configReadingAllowed = false
1407
1408export function enableConfigs(): void {
1409 if (configReadingAllowed) {
1410 // Ensure this is idempotent
1411 return
1412 }
1413
1414 const startTime = Date.now()
1415 logForDiagnosticsNoPII('info', 'enable_configs_started')
1416
1417 // Any reads to configuration before this flag is set show an console warning
1418 // to prevent us from adding config reading during module initialization
1419 configReadingAllowed = true
1420 // We only check the global config because currently all the configs share a file
1421 getConfig(
1422 getGlobalNcodeFile(),
1423 createDefaultGlobalConfig,
1424 true /* throw on invalid */,
1425 )
1426
1427 logForDiagnosticsNoPII('info', 'enable_configs_completed', {
1428 duration_ms: Date.now() - startTime,
1429 })
1430}
1431
1432/**
1433 * Returns the directory where config backup files are stored.

Callers 15

mainFunction · 0.85
status.test.tsFile · 0.85
user.test.tsFile · 0.85
betas.test.tsFile · 0.85
runComputerUseMcpServerFunction · 0.85

Calls 2

logForDiagnosticsNoPIIFunction · 0.85
getConfigFunction · 0.70

Tested by

no test coverage detected