/**
 * Kernel capability detection.
 *
 * The Sail Protocol kernel has shipped in two incompatible dispatch models, and
 * a given chain may run either one:
 *
 *  - "conjunctive" (older): dispatch(account, target, value, data, sig, deadline)
 *      with NO permission argument; the kernel checks EVERY registered permission
 *      and ALL must approve. The signed EIP-712 Dispatch struct has no `permission`
 *      field. RegisterPermission has no `deadline` field.
 *
 *  - "selective" (newer): dispatch(account, permission, target, value, data, sig, deadline)
 *      naming ONE permission per call. The signed Dispatch struct includes `permission`.
 *
 * The SDK's typed-data and calldata must match whatever is actually deployed, or
 * every dispatch reverts with InvalidManagerSignature. Rather than guess from a
 * version string, we read the kernel's public EIP-712 typehash constants on-chain
 * and match them against the canonical hashes for each model. Results are cached
 * per kernel address.
 */
import { type Address, type PublicClient } from "viem";
/** Which dispatch model a deployed kernel implements. */
export type DispatchModel = "conjunctive" | "selective";
/** Canonical EIP-712 type strings for each known kernel version. */
export declare const DISPATCH_TYPE_STRINGS: {
    readonly conjunctive: "Dispatch(address account,address target,uint256 value,bytes32 dataHash,uint256 nonce,uint256 deadline)";
    readonly selective: "Dispatch(address account,address permission,address target,uint256 value,bytes32 dataHash,uint256 nonce,uint256 deadline)";
};
export declare const REGISTER_PERMISSION_TYPE_STRINGS: {
    readonly noDeadline: "RegisterPermission(address account,address permission,uint256 nonce)";
    readonly withDeadline: "RegisterPermission(address account,address permission,uint256 nonce,uint256 deadline)";
};
/** Precomputed typehashes (keccak256 of the canonical type strings). */
export declare const DISPATCH_TYPEHASHES: {
    readonly conjunctive: `0x${string}`;
    readonly selective: `0x${string}`;
};
export declare const REGISTER_PERMISSION_TYPEHASHES: {
    readonly noDeadline: `0x${string}`;
    readonly withDeadline: `0x${string}`;
};
/** Detected capabilities of a deployed kernel. */
export type KernelCapabilities = {
    /** Kernel address these capabilities were detected for. */
    kernel: Address;
    /** Dispatch model the kernel implements. */
    dispatchModel: DispatchModel;
    /** Whether kernel.dispatch takes a `permission` argument (true for selective). */
    dispatchHasPermissionParam: boolean;
    /** Whether the signed Dispatch EIP-712 struct includes a `permission` field. */
    dispatchSignsPermission: boolean;
    /** Whether RegisterPermission's EIP-712 struct includes a `deadline` field. */
    registerPermissionHasDeadline: boolean;
    /** The on-chain DISPATCH_TYPEHASH that was read (or computed) for reference. */
    dispatchTypehash: `0x${string}`;
    /** The on-chain REGISTER_PERMISSION_TYPEHASH, when readable. */
    registerPermissionTypehash?: `0x${string}`;
    /** How the model was determined. */
    source: "onchain-typehash" | "static-hint";
};
/**
 * Detect a kernel's dispatch model by reading its on-chain typehash constants.
 *
 * @param publicClient viem public client bound to the kernel's chain
 * @param kernel       deployed SailKernel address
 * @param opts.chainId chain id for cache keying (defaults to publicClient.chain.id)
 * @param opts.staticModel optional hint used only if the on-chain read fails
 * @param opts.force   bypass the per-kernel cache
 */
export declare function detectKernelCapabilities(publicClient: PublicClient, kernel: Address, opts?: {
    chainId?: number;
    staticModel?: DispatchModel;
    force?: boolean;
}): Promise<KernelCapabilities>;
/** Clear the capability cache (mainly for tests / forced re-detection). */
export declare function clearCapabilityCache(): void;
//# sourceMappingURL=capabilities.d.ts.map