Skip to content

Interface: JsonlParseResult<T>

Makaio Framework


Makaio Framework / ai-adapters-core/node / JsonlParseResult

Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:32

Result of parsing a JSONL file.

Contains successfully parsed records, the new byte offset for cursor updates, and any errors encountered. Errors don’t prevent successful records from being returned - the parser continues after malformed lines.

parseJsonlFile - Function that produces this result

T

The expected type of each parsed record

bytesRead: number

Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:53

Byte offset for cursor update.

This is the position immediately after the last complete line (the last \n character processed). Use this value to update the cursor for resuming later reads.

If the file ends without a trailing newline, bytesRead points to the end of the last complete line, leaving incomplete content for the next read when it becomes complete.


errors: JsonlParseError[]

Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:62

Parse errors encountered.

One entry per malformed line. Lines that fail JSON.parse() are logged here but don’t stop processing. The caller should log these for debugging while continuing to process valid records.


records: T[]

Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:40

Successfully parsed records.

Records are returned in file order. Each record is the result of JSON.parse() on a complete line. Type safety is the caller’s responsibility via validation or type guards.