@240xu/dsh-message-ops 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@240xu/dsh-message-ops",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "Roll back, branch, and export any DSH conversation — from the UI or straight from the agent via a message_ops tool. Non-destructive: logs stay append-only and recoverable. 消息回滚/删除/分支/导出四合一,内置 message_ops agent 工具;非破坏语义,日志只追加可恢复。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/index.js
CHANGED
|
@@ -353,13 +353,14 @@ async function opsRestore(targetCtx, sessionId, restoreSeq) {
|
|
|
353
353
|
}
|
|
354
354
|
// store-miss → 磁盘路径:说明事件 + 重放事件批量追加(一个帧)
|
|
355
355
|
let cursor = nextSeqFrom(events);
|
|
356
|
-
const
|
|
356
|
+
const baseTime = Date.now();
|
|
357
357
|
const batch = [buildRestoreNoticeEvent({
|
|
358
|
-
seq: cursor++, time:
|
|
358
|
+
seq: cursor++, time: baseTime, turnStep: plan.turnStep,
|
|
359
359
|
text: restoreNoticeText(plan), restoreSeq: plan.restoreSeq,
|
|
360
360
|
})];
|
|
361
|
+
let offset = 0;
|
|
361
362
|
for (const item of plan.replayable) {
|
|
362
|
-
batch.push(buildReplayEvent({ seq: cursor++, time: ++
|
|
363
|
+
batch.push(buildReplayEvent({ seq: cursor++, time: baseTime + (++offset), item }));
|
|
363
364
|
}
|
|
364
365
|
await diskAppend(logPath, batch);
|
|
365
366
|
return {
|