(line: CodexLine, state: CodexParseState, meta: CodexSessionMeta)
| 400 | } |
| 401 | |
| 402 | function handleCodexLine(line: CodexLine, state: CodexParseState, meta: CodexSessionMeta): void { |
| 403 | updateSessionMeta(line, meta); |
| 404 | const ts = line.timestamp ? new Date(line.timestamp).getTime() : null; |
| 405 | updateTimestamps(state, ts); |
| 406 | |
| 407 | if (line.type === 'event_msg') { |
| 408 | handleEventMsg(line.payload || {}, state, ts, meta.model); |
| 409 | return; |
| 410 | } |
| 411 | if (line.type === 'turn_context') { |
| 412 | handleTurnContext(line.payload || {}, state); |
| 413 | return; |
| 414 | } |
| 415 | if (line.type === 'response_item') handleResponseItem(line.payload || {}, state, ts, meta.model); |
| 416 | } |
| 417 | |
| 418 | function readCodexJsonlStreaming(filePath: string, onLine: (line: CodexLine) => void): void { |
| 419 | const fd = fs.openSync(filePath, 'r'); |
no test coverage detected