(input: ReplayInput)
| 231 | } |
| 232 | |
| 233 | export 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 | |
| 263 | export function replayLocalRows( |
| 264 | messages: SessionMessages, |
no test coverage detected