( runtime: PiRuntime, sessionPath: string, thread: ThreadData, reason: RuntimeThreadReason, timestamp: number, )
| 293 | } |
| 294 | |
| 295 | async function applyPersistedThreadUpdate( |
| 296 | runtime: PiRuntime, |
| 297 | sessionPath: string, |
| 298 | thread: ThreadData, |
| 299 | reason: RuntimeThreadReason, |
| 300 | timestamp: number, |
| 301 | ) { |
| 302 | if (!(await hasPersistedSessionFile(sessionPath))) { |
| 303 | return runtime.session.sessionId |
| 304 | } |
| 305 | |
| 306 | const threadId = upsertPersistedThreadSummary({ runtime, sessionPath, thread, timestamp }) |
| 307 | updateThreadRunningState(sessionPath, thread, reason) |
| 308 | updateInboxStartState(sessionPath, thread, reason) |
| 309 | updateInboxEndState(sessionPath, thread, reason, timestamp) |
| 310 | return threadId |
| 311 | } |
| 312 | |
| 313 | export async function publishThreadUpdate(runtime: PiRuntime, reason: RuntimeThreadReason) { |
| 314 | const sessionPath = runtime.session.sessionFile |
no test coverage detected