refactor(protocol): add status + completedAt to ThreadIndexEntry

- ThreadIndexEntry gains status and completedAt fields
- createThreadIndexEntry defaults to idle/null
- normalizeThreadIndexEntry backward-compat defaults
- updateThreadHead resets to idle (衔尾蛇 resume prep)
- markThreadSuspended sets status=suspended
- New markThreadCompleted(entry, status, now) function
- serializeThreadIndexEntry includes new fields

Part of #39, closes #40
This commit is contained in:
2026-06-04 14:42:14 +08:00
parent 84bdd81317
commit 23e2ae9eb4
4 changed files with 146 additions and 8 deletions
+1
View File
@@ -5,6 +5,7 @@ export {
} from "./schemas.js";
export {
createThreadIndexEntry,
markThreadCompleted,
markThreadSuspended,
normalizeThreadIndexEntry,
parseThreadsIndex,