Updates to Agent QVAC
CI / Build & Test (push) Successful in 28m18s

This commit is contained in:
2026-09-03 16:06:16 -04:00
parent 4fffdce61c
commit 9a5cbbe1ff
19 changed files with 1492 additions and 172 deletions
+28 -1
View File
@@ -57,6 +57,8 @@ function create(meta) {
createdAt: Date.now(),
updatedAt: Date.now(),
plan: [],
planMode: meta.planMode || { state: 'inactive', planPath: 'plan.md', reminderCount: 0 },
goal: meta.goal || null,
};
fs.writeFileSync(path.join(dir, 'summary.json'), JSON.stringify(summary, null, 2));
fs.writeFileSync(path.join(dir, 'chat_history.jsonl'), '');
@@ -78,7 +80,10 @@ function load(id) {
function saveSummary(summary) {
summary.updatedAt = Date.now();
fs.writeFileSync(path.join(sessionDir(summary.id), 'summary.json'), JSON.stringify(summary, null, 2));
const copy = Object.assign({}, summary);
delete copy.history;
delete copy.updates;
fs.writeFileSync(path.join(sessionDir(summary.id), 'summary.json'), JSON.stringify(copy, null, 2));
}
function appendHistory(id, msg) {
@@ -95,6 +100,24 @@ function replaceHistory(id, history) {
fs.writeFileSync(file, body ? body + '\n' : '');
}
function planFile(id) {
return path.join(sessionDir(id), 'plan.md');
}
function readPlan(id) {
try {
return fs.readFileSync(planFile(id), 'utf8');
} catch (_) {
return '';
}
}
function writePlan(id, text) {
const file = planFile(id);
fs.writeFileSync(file, String(text != null ? text : ''));
return file;
}
function list() {
const root = sessionsRoot();
let names = [];
@@ -121,6 +144,10 @@ module.exports = {
appendHistory,
appendUpdate,
replaceHistory,
sessionDir,
planFile,
readPlan,
writePlan,
list,
makeId,
};