(state)
| 57 | } |
| 58 | |
| 59 | function writeState(state) { |
| 60 | try { |
| 61 | if (!fs.existsSync(TELEMETRY_DIR)) { |
| 62 | fs.mkdirSync(TELEMETRY_DIR, { recursive: true }); |
| 63 | } |
| 64 | fs.writeFileSync(STATE_FILE, JSON.stringify(state, null, 2)); |
| 65 | } catch { /* non-critical */ } |
| 66 | } |
| 67 | |
| 68 | // ── Policy ─────────────────────────────────────────────────────────────────── |
| 69 |