export interface InternalMeta {
    fromRoot: string;
    /** @deprecated Use fromRoot */
    fromRealm?: string;
    incomingProfile: 'matrix3' | 'mxenv1';
    msgId?: string;
    principalKey?: string;
    traceId?: string;
}
export interface InternalRequest {
    correlationId: string;
    replyTo: string;
    params: unknown;
    _mx: InternalMeta;
}
/**
 * Wire-level shape emitted by FederationPeer onto the local bus.
 *
 * - Default mode includes `_mx` (required by the reference component_host).
 * - Integration mode may omit `_mx` if the local component system does not
 *   tolerate unknown fields, or if meta is conveyed out-of-band.
 * - `envelope` may be included for debugging / handler adaptation.
 */
export interface InternalRequestWire {
    correlationId: string;
    replyTo: string;
    params: unknown;
    _mx?: InternalMeta;
    envelope?: unknown;
}
export interface InternalReply {
    correlationId: string;
    ok: boolean;
    body: unknown;
    error?: {
        code: string;
        message: string;
        details?: unknown;
    };
}
export declare function parseInternalRequest(json: string): InternalRequest | null;
export declare function parseInternalReply(json: string): InternalReply | null;
/**
 * Lenient decoder for internal replies.
 *
 * Goal: minimize handler friction (integration point), without breaking invariants.
 *
 * Accepted forms on the internal reply topic:
 *  1) Full InternalReply: { correlationId, ok, body, error? }
 *  2) "Semi" reply: { ok, body? } or { ok:false, error:{code,message,...} }
 *  3) Simple result object: { result: ... }  (implies ok=true, body=result)
 *  4) Any other JSON value (object/array/string/number/null): implies ok=true, body=value
 *  5) Non-JSON string: implies ok=true, body=raw string
 */
export declare function normalizeInternalReply(rawPayload: string, fallbackCorrelationId: string): InternalReply;
export declare function isJsonNullPayload(rawPayload: string): boolean;
//# sourceMappingURL=internal_messages.d.ts.map