MCPcopy Index your code
hub / github.com/freecodexyz/free-code / getCurrentProjectConfig

Function getCurrentProjectConfig

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

Source from the content-addressed store, hash-verified

1620})
1621
1622export function getCurrentProjectConfig(): ProjectConfig {
1623 if (process.env.NODE_ENV === 'test') {
1624 return TEST_PROJECT_CONFIG_FOR_TESTING
1625 }
1626
1627 const absolutePath = getProjectPathForConfig()
1628 const config = getGlobalConfig()
1629
1630 if (!config.projects) {
1631 return DEFAULT_PROJECT_CONFIG
1632 }
1633
1634 const projectConfig = config.projects[absolutePath] ?? DEFAULT_PROJECT_CONFIG
1635 // Not sure how this became a string
1636 // TODO: Fix upstream
1637 if (typeof projectConfig.allowedTools === 'string') {
1638 projectConfig.allowedTools =
1639 (safeParseJSON(projectConfig.allowedTools) as string[]) ?? []
1640 }
1641
1642 return projectConfig
1643}
1644
1645export function saveCurrentProjectConfig(
1646 updater: (currentConfig: ProjectConfig) => ProjectConfig,

Callers 15

getStoredSessionCostsFunction · 0.85
setupFunction · 0.85
ConfigFunction · 0.85
claudemd.tsFile · 0.85
exampleCommands.tsFile · 0.85
getReadOnlyToolNamesFunction · 0.85
bridgeMainFunction · 0.85
mcpRemoveHandlerFunction · 0.85
addMcpConfigFunction · 0.85

Calls 1

getGlobalConfigFunction · 0.85

Tested by

no test coverage detected