import { type RequestContext } from '../../utils/internal/requestContext.js';
/**
 * Bit flags specifying which partial JSON types are permissible during parsing.
 * Mirrors `partial-json`'s `Allow` constants. Combine flags with bitwise OR
 * to allow multiple partial types simultaneously.
 *
 * @example
 * ```typescript
 * // Allow only partial strings and arrays
 * const result = await jsonParser.parse(str, Allow.STR | Allow.ARR);
 *
 * // Allow everything (default)
 * const result = await jsonParser.parse(str, Allow.ALL);
 * ```
 */
export declare const Allow: {
    /** Allow partial strings. */
    readonly STR: 1;
    /** Allow partial numbers. */
    readonly NUM: 2;
    /** Allow partial arrays. */
    readonly ARR: 4;
    /** Allow partial objects. */
    readonly OBJ: 8;
    /** Allow partial null values. */
    readonly NULL: 16;
    /** Allow partial booleans. */
    readonly BOOL: 32;
    /** Allow NaN values. */
    readonly NAN: 64;
    /** Allow positive Infinity. */
    readonly INFINITY: 128;
    /** Allow negative Infinity. */
    readonly _INFINITY: 256;
    /** Allow both positive and negative Infinity (`INFINITY | _INFINITY`). */
    readonly INF: number;
    /** Allow all special values: NULL, BOOL, NAN, INFINITY, _INFINITY. */
    readonly SPECIAL: number;
    /** Allow all atomic types: STR, NUM, NULL, BOOL, NAN, INFINITY, _INFINITY. */
    readonly ATOM: number;
    /** Allow partial collections: ARR and OBJ. */
    readonly COLLECTION: number;
    /** Allow all partial types. */
    readonly ALL: number;
};
/**
 * Utility class for parsing potentially partial JSON strings.
 * Wraps the `partial-json` library for robust JSON parsing, handling
 * incomplete structures and optional `<think>` blocks from LLM outputs.
 *
 * All parse methods are async due to lazy loading of the `partial-json` peer dependency.
 * Install it with: `bun add partial-json`
 */
export declare class JsonParser {
    /**
     * Parses a JSON string, which may be partial or prefixed with a `<think>` block.
     *
     * If a `<think>...</think>` block is present at the start of the string, its content
     * is logged at debug level and stripped before parsing. The remainder is then parsed
     * using `partial-json`, which tolerates incomplete JSON structures.
     *
     * This method is async due to lazy loading of the `partial-json` peer dependency
     * (`bun add partial-json`).
     *
     * @template T - The expected type of the parsed result. Defaults to `unknown`.
     * @param jsonString - The raw string to parse. May include a leading `<think>` block
     *   and/or be a partial (incomplete) JSON value.
     * @param allowPartial - Bitwise OR combination of `Allow` flags controlling which
     *   partial JSON types are accepted. Defaults to `Allow.ALL`.
     * @param context - Optional `RequestContext` for correlated logging and error metadata.
     * @returns The parsed JavaScript value cast to `T`.
     * @throws {McpError} With `ValidationError` if the string is empty after stripping the
     *   `<think>` block and trimming, or if `partial-json` fails to parse the content.
     * @throws {McpError} With `ConfigurationError` if the `partial-json` package is not installed.
     * @example
     * ```typescript
     * import { jsonParser, Allow } from '../../utils/parsing/jsonParser.js';
     *
     * // Parse complete JSON
     * const obj = await jsonParser.parse<{ key: string }>('{"key": "value"}');
     * console.log(obj.key); // "value"
     *
     * // Parse partial JSON with a <think> prefix
     * const partial = '<think>reasoning...</think>{"items": [1, 2,';
     * const result = await jsonParser.parse(partial, Allow.ALL);
     * console.log(result); // { items: [1, 2] }
     * ```
     */
    parse<T = unknown>(jsonString: string, allowPartial?: number, context?: RequestContext): Promise<T>;
}
/**
 * Singleton instance of `JsonParser`.
 *
 * Provides partial JSON parsing with `<think>` block stripping. Methods are async
 * due to lazy loading of the `partial-json` peer dependency (`bun add partial-json`).
 *
 * @example
 * ```typescript
 * import { jsonParser, Allow } from '../../utils/parsing/jsonParser.js';
 * import { requestContextService } from '../../utils/internal/requestContext.js';
 *
 * const ctx = requestContextService.createRequestContext({ operation: 'myOp' });
 *
 * // Full JSON
 * const obj = await jsonParser.parse<{ key: string }>('{"key": "value"}', Allow.ALL, ctx);
 * console.log(obj.key); // "value"
 *
 * // Partial JSON with think block
 * const raw = '<think>reasoning...</think>{"key": "value", "arr": [1,';
 * const partial = await jsonParser.parse(raw, Allow.ALL, ctx);
 * console.log(partial); // { key: 'value', arr: [1] }
 * ```
 */
export declare const jsonParser: JsonParser;
//# sourceMappingURL=jsonParser.d.ts.map