MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / handleCodexLine

Function handleCodexLine

src/core/parser-codex.ts:402–416  ·  view source on GitHub ↗
(line: CodexLine, state: CodexParseState, meta: CodexSessionMeta)

Source from the content-addressed store, hash-verified

400}
401
402function 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
418function readCodexJsonlStreaming(filePath: string, onLine: (line: CodexLine) => void): void {
419 const fd = fs.openSync(filePath, 'r');

Callers 1

parseCodexSessionFileFunction · 0.85

Calls 5

updateSessionMetaFunction · 0.85
updateTimestampsFunction · 0.85
handleEventMsgFunction · 0.85
handleTurnContextFunction · 0.85
handleResponseItemFunction · 0.85

Tested by

no test coverage detected