UNPKG

@jovan158/vantage

Version:

See and control what your coding agent does

23 lines (22 loc) • 789 B
// What `vantage run` records about a session besides its event log: where it // ran, whether it was isolated, and the working-tree snapshots for the change // summary. Read by review, discard and harvest. import fs from "node:fs"; import path from "node:path"; import { sessionDir } from "./events.js"; export function writeMeta(cwd, meta) { const dir = sessionDir(cwd, meta.sessionId); fs.mkdirSync(dir, { recursive: true }); fs.writeFileSync(path.join(dir, "meta.json"), JSON.stringify(meta, null, 2)); } export function readMeta(cwd, sessionId) { const p = path.join(sessionDir(cwd, sessionId), "meta.json"); if (!fs.existsSync(p)) return null; try { return JSON.parse(fs.readFileSync(p, "utf8")); } catch { return null; } }