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

Function getWatchablePaths

src/utils/skills/skillChangeDetector.ts:192–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190}
191
192async function getWatchablePaths(): Promise<string[]> {
193 const fs = getFsImplementation()
194 const paths: string[] = []
195
196 // User skills directories (~/.ncode/skills preferred, legacy ~/.claude/skills)
197 for (const userSkillsPath of getUserSkillWatchPaths('skills')) {
198 try {
199 await fs.stat(userSkillsPath)
200 paths.push(userSkillsPath)
201 } catch {
202 // Path doesn't exist, skip it
203 }
204 }
205
206 // User commands directories (~/.ncode/commands preferred, legacy ~/.claude/commands)
207 for (const userCommandsPath of getUserSkillWatchPaths('commands')) {
208 try {
209 await fs.stat(userCommandsPath)
210 paths.push(userCommandsPath)
211 } catch {
212 // Path doesn't exist, skip it
213 }
214 }
215
216 // Project skills directories (.ncode/skills preferred, legacy .claude/skills)
217 for (const projectSkillsPath of getProjectSkillWatchPaths('skills')) {
218 try {
219 await fs.stat(projectSkillsPath)
220 paths.push(projectSkillsPath)
221 } catch {
222 // Path doesn't exist, skip it
223 }
224 }
225
226 // Project commands directories (.ncode/commands preferred, legacy .claude/commands)
227 for (const projectCommandsPath of getProjectSkillWatchPaths('commands')) {
228 try {
229 await fs.stat(projectCommandsPath)
230 paths.push(projectCommandsPath)
231 } catch {
232 // Path doesn't exist, skip it
233 }
234 }
235
236 // Additional directories (--add-dir) skills
237 for (const dir of getAdditionalDirectoriesForClaudeMd()) {
238 for (const additionalSkillsPath of getAdditionalSkillWatchPaths(dir)) {
239 try {
240 await fs.stat(additionalSkillsPath)
241 paths.push(additionalSkillsPath)
242 } catch {
243 // Path doesn't exist, skip it
244 }
245 }
246 }
247
248 return paths
249}

Callers 1

initializeFunction · 0.85

Calls 5

getFsImplementationFunction · 0.85
getUserSkillWatchPathsFunction · 0.85

Tested by

no test coverage detected