* Confirm a byte-matched line is a real compact_boundary (marker can appear * inside user content) and check for preservedSegment.
( line: string, )
| 489 | * inside user content) and check for preservedSegment. |
| 490 | */ |
| 491 | function parseBoundaryLine( |
| 492 | line: string, |
| 493 | ): { hasPreservedSegment: boolean } | null { |
| 494 | try { |
| 495 | const parsed = JSON.parse(line) as { |
| 496 | type?: string |
| 497 | subtype?: string |
| 498 | compactMetadata?: { preservedSegment?: unknown } |
| 499 | } |
| 500 | if (parsed.type !== 'system' || parsed.subtype !== 'compact_boundary') { |
| 501 | return null |
| 502 | } |
| 503 | return { |
| 504 | hasPreservedSegment: Boolean(parsed.compactMetadata?.preservedSegment), |
| 505 | } |
| 506 | } catch { |
| 507 | return null |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | /** |
| 512 | * Single forward chunked read for the --resume load path. Attr-snap lines |
no outgoing calls
no test coverage detected