import { type CallbackRouteV1 } from "./callback-transport.js"; import type { Conversation } from "./protocol.js"; export interface CallbackRouteAuthorityRecord { callback_route?: unknown; gateway_method?: unknown; gateway_session?: unknown; openclaw_session?: unknown; openclaw_bin?: unknown; gateway_url?: unknown; } export interface ResolveCallbackRouteAuthorityInput { conversation: CallbackRouteAuthorityRecord; primaryOutbox?: unknown; } /** * Canonical, secretless identity for one trusted callback route snapshot. * The digest is durable dispatch authority; it is never a model argument. */ export declare function callbackRouteFingerprint(route: unknown): string; /** * Read the durable route authority without collapsing explicit no-route * (`null`) into a legacy record that predates the field. Malformed declared * authority is never treated as absent. */ export declare function callbackRouteFingerprintFromRecord(value: unknown): string | null | undefined; /** * Project one receipt's route authority into its ledger. A ledger that * predates the field may be upgraded, but an already-declared different * authority is a hard conflict rather than a redirect. */ export declare function callbackRouteFingerprintLedgerFields(input: { receipt: unknown; ledger: unknown; context: string; }): { callback_route_fingerprint?: string | null; }; export declare function callbackRouteFingerprintForConversation(conversation: CallbackRouteAuthorityRecord): string | undefined; /** * Resolve the durable callback destination without silently downgrading a * malformed generic route to legacy OpenClaw fields. * * A primary outbox route is an immutable delivery snapshot and therefore has * precedence over every Conversation route, including when the immutable * snapshot uses legacy Gateway fields. Legacy compatibility is available only * when both a non-blank Gateway method and controller session can be proven. */ export declare function resolveCallbackRouteAuthority({ conversation, primaryOutbox }: ResolveCallbackRouteAuthorityInput): CallbackRouteV1 | undefined; export declare function callbackRouteForConversation(conversation: CallbackRouteAuthorityRecord): CallbackRouteV1 | undefined; export declare function callbackRouteForPrimaryOutbox(conversation: Conversation): CallbackRouteV1 | undefined; export declare function callbackExpectedForConversation(conversation: CallbackRouteAuthorityRecord): boolean; /** * Preserve a callback_expected bit written by an older dispatch ledger only * when the Conversation has no callback authority declaration of its own. * A malformed generic route still throws, and an incomplete legacy route does * not inherit a stale truthy bit from the ledger. */ export declare function callbackExpectedForConversationWithLegacyFallback(conversation: CallbackRouteAuthorityRecord, legacyCallbackExpected: unknown): boolean; export declare function callbackExpectedForPrimaryOutbox(conversation: Conversation): boolean;