()
| 7 | const { redactValue } = require('./redact'); |
| 8 | |
| 9 | function getStatus() { |
| 10 | const paths = getObserverPaths(); |
| 11 | const cycle = readJsonSafe(paths.cycleProgressPath, null); |
| 12 | const solidify = readJsonSafe(paths.solidifyStatePath, null); |
| 13 | const evolution = readJsonSafe(paths.evolutionStatePath, null); |
| 14 | const proxy = getProxySettings(); |
| 15 | // Everything observer-derived may carry prompt / task context with |
| 16 | // embedded credentials. Every other observer endpoint (runs.js, |
| 17 | // assets.js, interactions.js, ...) already pipes its payload through |
| 18 | // redactValue; /webui/status is the one that skipped it, so it became |
| 19 | // the easy exfiltration path. Funnel the three readJsonSafe outputs |
| 20 | // through the same redaction filter before they leave the process. |
| 21 | return { |
| 22 | mode: inferMode(cycle, solidify, proxy), |
| 23 | heartbeat: redactValue(cycle), |
| 24 | lastRun: redactValue(solidify && solidify.last_run ? solidify.last_run : null), |
| 25 | evolutionState: redactValue(evolution), |
| 26 | proxy, |
| 27 | filesPresent: filesPresent(paths), |
| 28 | safety: getSafetyState(), |
| 29 | }; |
| 30 | } |
| 31 | |
| 32 | function inferMode(cycle, solidify, proxy) { |
| 33 | if (cycle && isFresh(cycle.updated_at, 120_000)) return 'running'; |
nothing calls this directly
no test coverage detected