MCPcopy Create free account
hub / github.com/arctic-cli/interface / latestSnapshot

Function latestSnapshot

packages/arctic/src/session/benchmark.ts:198–209  ·  view source on GitHub ↗
(sessionID: string)

Source from the content-addressed store, hash-verified

196 }
197
198 export async function latestSnapshot(sessionID: string) {
199 const messages = await Session.messages({ sessionID })
200 let snapshot: string | undefined
201 for (const message of messages) {
202 for (const part of message.parts) {
203 if (part.type === "step-finish" && part.snapshot) {
204 snapshot = part.snapshot
205 }
206 }
207 }
208 return snapshot
209 }
210
211 export async function withWorktreeLock<T>(fn: () => Promise<T>) {
212 using _ = await Lock.write(LOCK_KEY)

Callers 1

applyFunction · 0.85

Calls 1

messagesMethod · 0.45

Tested by

no test coverage detected