MCPcopy Create free account
hub / github.com/EvoMap/evolver / writeState

Function writeState

src/gep/selfPR.js:149–159  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

147}
148
149function writeState(state) {
150 try {
151 const dir = getEvolutionDir();
152 if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
153 fs.writeFileSync(getStatePath(), JSON.stringify(state, null, 2) + '\n');
154 } catch (e) {
155 if (process.env.DEBUG || process.env.EVOLVER_DEBUG) {
156 try { process.stderr.write('selfPR.writeState failed: ' + String(e && e.message || e) + '\n'); } catch (_) {}
157 }
158 }
159}
160
161function isInCooldown() {
162 const state = readState();

Callers 1

recordPRFunction · 0.70

Calls 2

getEvolutionDirFunction · 0.85
getStatePathFunction · 0.70

Tested by

no test coverage detected