Interface: JsonlParseResult<T>
Makaio Framework / ai-adapters-core/node / JsonlParseResult
Interface: JsonlParseResult<T>
Section titled “Interface: JsonlParseResult<T>”Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:32
Result of parsing a JSONL file.
Remarks
Section titled “Remarks”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
Type Parameters
Section titled “Type Parameters”T
The expected type of each parsed record
Properties
Section titled “Properties”bytesRead
Section titled “bytesRead”bytesRead:
number
Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:53
Byte offset for cursor update.
Remarks
Section titled “Remarks”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
Section titled “errors”errors:
JsonlParseError[]
Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:62
Parse errors encountered.
Remarks
Section titled “Remarks”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
Section titled “records”records:
T[]
Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:40
Successfully parsed records.
Remarks
Section titled “Remarks”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.