/**
 * WS5.2 R4a — the TARGET-side acceptance of a cross-machine-delivered account-follow-me mandate.
 *
 * Pure logic over INJECTED seams (the operator-machine key resolver, the bounds expectation, the
 * delivered-mandate store) so the dangerous authority decision is unit-testable without a server.
 * This is the brains behind the `account-follow-me-mandate-deliver` mesh handler.
 *
 * THE TRUST MODEL (Know Your Principal — load-bearing):
 *   - `sender` is the MESH-AUTHENTICATED operator machine (verifyEnvelope already proved the
 *     Ed25519 signature, recipient-binding, freshness, and registered-peer status before this runs).
 *     A name inside the payload is NEVER trusted; `sender` is the only fingerprint we anchor to.
 *   - We resolve the operator machine's REGISTERED Ed25519 public key for `sender` (the SAME key
 *     verifyEnvelope used), then `acceptDeliveredMandate` re-verifies the PortableMandate's OWN
 *     asymmetric issuance signature against that key + `sender` as the expected operator fingerprint.
 *     This proves the operator machine signed THIS mandate's canonical bytes (defense beyond the
 *     envelope), and that the mandate's embedded issuerFingerprint === the authenticated sender.
 *   - FAIL CLOSED on every uncertainty: feature dark, no operator key registered, signature fails,
 *     wrong issuer, or the delivered bounds are not an exact account-follow-me/re-mint shape → REFUSE
 *     and persist NOTHING. An unverified mandate never lands in the store.
 *
 * The accepted mandate's exact (accountId, targetMachineId, mechanism) bounds are validated to be a
 * re-mint account-follow-me grant for THIS machine here too (so a malformed delivery is rejected at
 * accept time); the enroll-start route re-verifies again at point-of-use (never trust a stored flag).
 */
import { type PortableMandate } from './AccountFollowMeMandateBridge.js';
import type { DeliveredMandateStore } from './DeliveredMandateStore.js';
export type MandateDeliveryResult = {
    accepted: true;
    mandateId: string;
} | {
    accepted: false;
    reason: string;
};
export interface AccountFollowMeMandateDeliveryDeps {
    /** Is account follow-me enabled (resolved dev-gate) on THIS machine? Dark ⇒ refuse everything. */
    enabled: () => boolean;
    /** This machine's id — the delivered mandate's targetMachineId MUST equal it (exact-bounds, R1). */
    selfMachineId: () => string;
    /**
     * The REGISTERED Ed25519 public key (PEM) for the AUTHENTICATED sender (the operator machine), or
     * null if unknown. SAME source verifyEnvelope used (the registered machine-identity store) — NEVER
     * a key from the payload. PEM (not a KeyObject) so the verified key is persisted for the
     * point-of-use re-verify without a later peer-key lookup.
     */
    operatorMachinePublicKey: (sender: string) => string | null;
    /** Durable store of accepted+verified delivered mandates. */
    store: DeliveredMandateStore;
    log?: (msg: string) => void;
}
/**
 * Read the account-follow-me bounds off a (already-R4a-verified) mandate. Returns null when the
 * mandate carries no account-follow-me authority (so a foreign mandate delivered here is refused).
 */
export declare function readFollowMeBounds(mandate: PortableMandate['mandate']): {
    accountId: string;
    targetMachineId: string;
    mechanism: string;
} | null;
/**
 * Accept (or refuse) a delivered account-follow-me mandate on the target. FAIL CLOSED.
 * `sender` MUST be the mesh-authenticated envelope sender.
 */
export declare function acceptMandateDelivery(deps: AccountFollowMeMandateDeliveryDeps, sender: string, portable: PortableMandate | undefined | null): MandateDeliveryResult;
//# sourceMappingURL=AccountFollowMeMandateDelivery.d.ts.map