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

Function isNcodeConfigFilePath

src/utils/permissions/filesystem.ts:241–252  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

239
240// Always ask when NCode tries to edit its own config files
241function isNcodeConfigFilePath(filePath: string): boolean {
242 if (isNcodeSettingsPath(filePath)) {
243 return true
244 }
245
246 // Check if file is within managed commands/agents/skills directories
247 // using proper path segment validation (not string matching with includes())
248 // pathInWorkingPath now handles case-insensitive comparison to prevent bypasses
249 const configDirs = [join(getOriginalCwd(), '.ncode', 'commands'), join(getOriginalCwd(), '.ncode', 'agents'), join(getOriginalCwd(), '.ncode', 'skills'), join(getOriginalCwd(), '.claude', 'commands'), join(getOriginalCwd(), '.claude', 'agents'), join(getOriginalCwd(), '.claude', 'skills')]
250
251 return configDirs.some(configDir => pathInWorkingPath(filePath, configDir))
252}
253
254// Check if file is the plan file for the current session
255function isSessionPlanFile(absolutePath: string): boolean {

Callers 1

Calls 3

isNcodeSettingsPathFunction · 0.85
getOriginalCwdFunction · 0.85
pathInWorkingPathFunction · 0.70

Tested by

no test coverage detected