import { type ActionSchema } from './action-schema.js'; export interface ActionEvent { readonly kind: 'action'; readonly id: string; /** Raw cue text including the surrounding brackets — useful for logs. */ readonly raw: string; } export interface ProseEvent { readonly kind: 'prose'; readonly text: string; } export type ParsedEvent = ActionEvent | ProseEvent; /** * Stateful incremental parser. Instantiate once per turn and feed decoded * text chunks in order. Call {@link flush} at end-of-turn to surface any * trailing prose. The parser never emits a partial cue — it waits for the * closing `]` to arrive before resolving. */ export declare class IncrementalActionParser { private buffer; private readonly cueMap; /** * Constructs a parser from an ActionSchema. The schema is expanded into * the cue vocabulary that the parser will recognise. */ constructor(schema: ActionSchema); /** * Accepts a new chunk of text and returns zero or more events derived * from what has been seen so far, in chunk order. Any unfinished cue * (open `[` without a matching `]`) is retained in the internal buffer. */ consume(chunk: string): ParsedEvent[]; /** * Emits any remaining buffered prose or unresolved cue material once the * stream is known to be complete. Call exactly once at end-of-turn. * * If an unterminated cue is still pending, it is surfaced as prose * verbatim (including the opening `[`) so nothing is silently dropped. */ flush(): ParsedEvent[]; private drain; private appendProse; }