chore: 撤回 .omo 会话数据与 taskboard 内部数据,不推送 GitHub

This commit is contained in:
Sisyphus committed 2026-08-14 09:32:32 +08:00
1 parent f846fabfc6
commit 5a97e6124e
3 files changed
+9 -21

No files matched your search

View File
Whitespace-only changes.
-21
View File
@@ -1,21 +0,0 @@
const fs = require('fs');
const p = 'D:/拼豆/taskboard/tasks.json';
const db = JSON.parse(fs.readFileSync(p, 'utf8'));
const TZ = 8 * 60 * 60 * 1000;
function migrate(v) {
if (typeof v === 'string' && /^\d{4}-\d{2}-\d{2}T[\d:.]+Z$/.test(v)) {
const d = new Date(Date.parse(v) + TZ);
return d.toISOString().replace('Z', '+08:00');
}
return v;
}
function walk(obj) {
if (Array.isArray(obj)) { obj.forEach(walk); return; }
if (obj && typeof obj === 'object') {
for (const k of Object.keys(obj)) obj[k] = migrate(obj[k]);
for (const k of Object.keys(obj)) if (obj[k] && typeof obj[k] === 'object') walk(obj[k]);
}
}
walk(db);
fs.writeFileSync(p, JSON.stringify(db, null, 2), 'utf8');
console.log('migrated to +08:00, tasks:', db.tasks.length, 'agents:', Object.keys(db.agents || {}).length);