MCPcopy Index your code
hub / github.com/anomalyco/opencode / replaySession

Function replaySession

packages/opencode/src/cli/cmd/run/session-replay.ts:233–261  ·  view source on GitHub ↗
(input: ReplayInput)

Source from the content-addressed store, hash-verified

231}
232
233export function replaySession(input: ReplayInput): SessionReplay {
234 const data = createSessionData()
235 const commits: StreamCommit[] = []
236 let patch: FooterPatch | undefined
237 const summaries = summaryMessageIDs(input.messages)
238
239 bootstrapSessionData({
240 data,
241 messages: input.messages,
242 permissions: input.permissions,
243 questions: input.questions,
244 })
245
246 for (const message of input.messages) {
247 const next = replayMessage(data, message, input.thinking, {
248 limits: input.limits,
249 providers: input.providers,
250 summaries,
251 })
252 commits.push(...next.commits)
253 patch = mergePatch(patch, next.patch)
254 }
255
256 return {
257 data,
258 commits,
259 patch: replayPatch(data, patch),
260 }
261}
262
263export function replayLocalRows(
264 messages: SessionMessages,

Callers 2

createLayerFunction · 0.90

Calls 7

createSessionDataFunction · 0.90
bootstrapSessionDataFunction · 0.90
summaryMessageIDsFunction · 0.85
replayMessageFunction · 0.85
mergePatchFunction · 0.85
replayPatchFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected