import {MASTER_KEY_TEMPLATES} from '../control-panel/public/jarvis-master-keys.mjs'; import {readFileSync,writeFileSync} from 'node:fs';import {createHash} from 'node:crypto'; export function devRequestCatalogue(){ return {schemaVersion:1,sourceHash:createHash('sha256').update(readFileSync(new URL('../control-panel/public/jarvis-master-keys.mjs',import.meta.url),'utf8').replaceAll('\r\n','\n')).digest('hex'),actions:MASTER_KEY_TEMPLATES.flatMap(t=>t.actions.map(a=>({id:a.id,label:t.label+' ยท '+a.label,version:a.version,keyType:a.keyType,fields:a.fields,effect:a.effect||'',fixedTargets:a.fixedTargets||[],webIssue:a.webIssue===true,recordOnly:a.recordOnly===true})))}; } if(process.argv[1]&&import.meta.url.endsWith('/'+process.argv[1].replaceAll('\\','/').split('/').pop())){ const data=JSON.stringify(devRequestCatalogue(),null,2)+'\n';if(process.argv[2])writeFileSync(process.argv[2],data);else process.stdout.write(data); }