MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / statePath

Function statePath

src/index.js:318–318  ·  view source on GitHub ↗
(directory, sessionID)

Source from the content-addressed store, hash-verified

316}
317
318function stateDir(directory) { return path.join(directory, STATE_DIR) }
319function statePath(directory, sessionID) { return path.join(stateDir(directory), `${safeID(sessionID)}.json`) }
320async function ensureDir(directory) { await fs.mkdir(directory, { recursive: true }) }
321async function pathExists(filePath) { try { await fs.access(filePath); return true } catch { return false } }

Callers 3

readStateFunction · 0.85
writeStateFunction · 0.85
removeStateFunction · 0.85

Calls 2

stateDirFunction · 0.85
safeIDFunction · 0.85

Tested by

no test coverage detected