MCPcopy Create free account
hub / github.com/SethGammon/Citadel / scanDir

Function scanDir

hooks_src/pre-compact.js:109–120  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

107 try {
108 const twoHoursAgo = Date.now() - 2 * 60 * 60 * 1000;
109 const scanDir = (dir) => {
110 const entries = fs.readdirSync(dir, { withFileTypes: true });
111 for (const entry of entries) {
112 const full = path.join(dir, entry.name);
113 if (entry.isDirectory()) { scanDir(full); continue; }
114 if (!entry.name.endsWith('.md')) continue;
115 const stat = fs.statSync(full);
116 if (stat.mtimeMs > twoHoursAgo) {
117 state.pendingResearch.push(path.relative(PROJECT_ROOT, full).replace(/\\/g, '/'));
118 }
119 }
120 };
121 scanDir(researchDir);
122 } catch { /* non-critical */ }
123 }

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected