(wellKnownRoot, skills)
| 1121 | } |
| 1122 | |
| 1123 | function writeIndexJson(wellKnownRoot, skills) { |
| 1124 | const indexPath = path.join(wellKnownRoot, 'index.json'); |
| 1125 | const payload = {$schema: DISCOVERY_SCHEMA, skills}; |
| 1126 | fs.writeFileSync(indexPath, JSON.stringify(payload, null, 2) + '\n'); |
| 1127 | console.log(`Generated ${path.relative(REPO_ROOT, indexPath)}`); |
| 1128 | } |
| 1129 | |
| 1130 | function sha256Digest(filePath) { |
| 1131 | const hash = crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex'); |