MCPcopy
hub / github.com/garrytan/gstack / writeDecision

Function writeDecision

browse/src/security.ts:591–601  ·  view source on GitHub ↗
(record: DecisionRecord)

Source from the content-addressed store, hash-verified

589}
590
591export function writeDecision(record: DecisionRecord): void {
592 try {
593 mkdirSecure(DECISIONS_DIR);
594 const file = decisionFileForTab(record.tabId);
595 const tmp = `${file}.tmp.${process.pid}`;
596 writeSecureFile(tmp, JSON.stringify(record));
597 fs.renameSync(tmp, file);
598 } catch (err) {
599 console.error('[security] writeDecision failed:', (err as Error).message);
600 }
601}
602
603export function readDecision(tabId: number): DecisionRecord | null {
604 try {

Callers 1

Calls 3

mkdirSecureFunction · 0.90
writeSecureFileFunction · 0.90
decisionFileForTabFunction · 0.85

Tested by

no test coverage detected