core: add session diff API to show file changes between snapshots

This commit is contained in:
Dax Raad
2025-10-20 17:58:48 -04:00
parent f3f21194ae
commit a0a09f421c
6 changed files with 317 additions and 46 deletions

View File

@@ -1195,13 +1195,14 @@ export namespace SessionPrompt {
throw value.error
case "start-step":
snapshot = await Snapshot.track()
await Session.updatePart({
id: Identifier.ascending("part"),
messageID: assistantMsg.id,
sessionID: assistantMsg.sessionID,
snapshot,
type: "step-start",
})
snapshot = await Snapshot.track()
break
case "finish-step":
@@ -1214,6 +1215,7 @@ export namespace SessionPrompt {
assistantMsg.tokens = usage.tokens
await Session.updatePart({
id: Identifier.ascending("part"),
snapshot: await Snapshot.track(),
messageID: assistantMsg.id,
sessionID: assistantMsg.sessionID,
type: "step-finish",