MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / parseBoundaryLine

Function parseBoundaryLine

src/utils/sessionStoragePortable.ts:491–509  ·  view source on GitHub ↗

* Confirm a byte-matched line is a real compact_boundary (marker can appear * inside user content) and check for preservedSegment.

(
  line: string,
)

Source from the content-addressed store, hash-verified

489 * inside user content) and check for preservedSegment.
490 */
491function 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

Callers 2

processStraddleFunction · 0.85
scanChunkLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected