/** Legacy marker some models emit after a serialized JSON tool request. */ export declare const END_TOOL_REQUEST = "[END_TOOL_REQUEST]"; /** Harmony stream marker that introduces the target channel before a tool call. */ export declare const HARMONY_CHANNEL_MARKER = "<|channel|>"; /** Harmony stream marker that may separate the header from the JSON payload. */ export declare const HARMONY_MESSAGE_MARKER = "<|message|>"; /** Harmony stream marker that may close a serialized tool-call payload. */ export declare const HARMONY_CALL_MARKER = "<|call|>"; /** * Harmony marker real gpt-oss emits in place of the reference grammar's literal `code` token — * e.g. `<|constrain|>json` declares the tool-call payload format. (EXT-43.) */ export declare const HARMONY_CONSTRAIN_MARKER = "<|constrain|>"; /** Tool names in bracket/plain-text repairs intentionally match provider-safe ids only. */ export declare function isPlainTextToolNameChar(char: string | undefined): boolean; /** * Harmony tool names may be NAMESPACED with dots (real gpt-oss emits `to=functions.get_weather`), * so the Harmony header scanner accepts `.` on top of the provider-safe id chars. This is a * Harmony-only widening (EXT-43): the bracket/XML-ish dialects keep {@link isPlainTextToolNameChar} * unchanged so their prose-safety is untouched. The final dot-segment is the tool name matched * against the allow-list (see {@link finalDotSegment}). */ export declare function isHarmonyToolNameChar(char: string | undefined): boolean; /** * The tool name for a (possibly namespaced) Harmony target: the final dot-segment. * `functions.get_weather` → `get_weather`; `functions.tools.get_weather` → `get_weather`; a dotless * `get_weather` → itself. Returns `''` for a trailing-dot / empty final segment (rejected upstream). */ export declare function finalDotSegment(name: string): string; /** Skips spaces and tabs only, preserving line boundaries for grammar decisions. */ export declare function skipHorizontalWhitespace(text: string, start: number): number; /** Skips all JavaScript whitespace when line structure is no longer meaningful. */ export declare function skipWhitespace(text: string, start: number): number; /** Consumes either Unix or Windows line endings and returns the first offset after them. */ export declare function consumeLineBreak(text: string, start: number): number | null; /** * Finds the exclusive end offset of a balanced JSON object starting at `start`. Returns null if * the object never closes, or (when `maxPayloadBytes` is set) as soon as the scan runs past the * cap — the payload-size gate that keeps a runaway blob from being treated as a tool call. */ export declare function findJsonObjectEnd(text: string, start: number, maxPayloadBytes?: number): number | null;