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

Function generateIntakeItem

scripts/watch.js:393–420  ·  view source on GitHub ↗
(marker, hash)

Source from the content-addressed store, hash-verified

391}
392
393function generateIntakeItem(marker, hash) {
394 if (!fs.existsSync(INTAKE_DIR)) {
395 fs.mkdirSync(INTAKE_DIR, { recursive: true });
396 }
397
398 const timestamp = Date.now();
399 const slug = slugify(marker.file);
400 const filename = `watch-${marker.action}-${slug}-${timestamp}.md`;
401 const filePath = path.join(INTAKE_DIR, filename);
402
403 const descriptionBlock = marker.description ? `\n${marker.description}\n` : '';
404
405 const content = `---
406title: "${marker.action} ${marker.file}:${marker.line}"
407status: pending
408priority: normal
409target: ${marker.file}
410source: watch
411marker_hash: ${hash}
412---
413
414Marker comment found at ${marker.file}:${marker.line}:
415\`${marker.raw}\`
416${descriptionBlock}`;
417
418 fs.writeFileSync(filePath, content, 'utf8');
419 return filename;
420}
421
422// -- Output formatting --------------------------------------------------------
423

Callers 1

runScanFunction · 0.85

Calls 1

slugifyFunction · 0.70

Tested by

no test coverage detected