feat(M2): FR-S1/S4/S6 保存机制完善——setBody 防抖读 settings.autoSaveInterval(S1); beforeunload 冲刷+saveNow(S4); ReadDocResult 加 mtime+reloadDoc 检测外部改动(R6); store 暴露 __STORE__; save-mechanism E2E 3 项

This commit is contained in:
hunter-dev
2026-08-26 15:05:09 +08:00
parent 01ea477d18
commit 3390e91406
5 changed files with 142 additions and 6 deletions
@@ -140,8 +140,9 @@ export class FileService {
async readDoc(path: string): Promise<ReadDocResult> {
const abs = this.abs(path);
const raw = await fs.readFile(abs, 'utf8');
const stat = await fs.stat(abs);
const { meta, body } = splitFrontmatter(raw);
return { meta, body };
return { meta, body, mtime: stat.mtimeMs };
}
async writeDoc(payload: WriteDocPayload): Promise<void> {