(filePath: string)
| 239 | |
| 240 | // Always ask when NCode tries to edit its own config files |
| 241 | function 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 |
| 255 | function isSessionPlanFile(absolutePath: string): boolean { |
no test coverage detected