MCPcopy
hub / github.com/THU-MAIC/OpenMAIC / ParserState

Interface ParserState

lib/orchestration/stateless-generate.ts:42–53  ·  view source on GitHub ↗

* Parser state for incremental JSON Array parsing. * * Accumulates raw text from the LLM stream. Once the opening `[` is found, * uses `partial-json` to incrementally parse the growing array. Emits new * complete items as they appear, and streams partial text content deltas * for the last (pote

Source from the content-addressed store, hash-verified

40 * for the last (potentially incomplete) text item.
41 */
42interface ParserState {
43 /** Accumulated raw text from the LLM */
44 buffer: string;
45 /** Whether we've found the opening `[` */
46 jsonStarted: boolean;
47 /** Number of fully processed (emitted) items */
48 lastParsedItemCount: number;
49 /** Length of text content already emitted for the trailing partial text item */
50 lastPartialTextLength: number;
51 /** Whether parsing is complete (closing `]` found) */
52 isDone: boolean;
53}
54
55/**
56 * Create initial parser state

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected