/**
 * NegotiatorGate — the lease/voice send gate (D-B) for the Threadline
 * single-negotiator lock (THREADLINE-SINGLE-NEGOTIATOR-SPEC.md, CMT-1362).
 *
 * This is the chokepoint orchestration that the server's `/threadline/relay-send`
 * route calls right after it mints the effective threadId, BEFORE the content is
 * delivered. It does exactly one decision: enforce the lease so only the owning
 * session is the agent's voice (G1). It has NO authority over content MEANING —
 * binding lives only in the existing operator-anchored primitives (G2, D-C).
 *
 * Behavior by config (FD-7):
 *  - enabled:false (default, ships dark) → pure pass-through. No store write, no
 *    log, zero overhead. The fleet sees no behavior change.
 *  - enabled:true + dryRun:true → observe-only. Acquire/record the lease and log
 *    the verdict it WOULD reach, but ALWAYS allow the send.
 *  - enabled:true + dryRun:false → enforce. A non-owner's CONTENT send is
 *    withheld; the gate emits at most one holding-notice to the peer (rate-
 *    limited, FD-3) and the owning session is the only voice.
 *
 * Fail-open (FD / D-B): a lease-store ERROR fails OPEN for the send (it proceeds)
 * — G1 is explicitly NOT enforced during that window — AND raises a HIGH-priority
 * alert (never silent). Safe because prose is inert (G2): the worst case is two
 * of the agent's own sessions briefly both speaking inert prose, never a binding.
 */
import { ConversationStore } from './ConversationStore.js';
import { type HoldingNotice } from './NegotiatorLease.js';
/** What the route should do with the send. */
export type SendGateVerdict = 
/** Caller owns the voice (acquired/renewed) — deliver the content. */
{
    decision: 'allow';
    reason: 'own';
}
/** Feature dark — pure pass-through, deliver the content. */
 | {
    decision: 'allow';
    reason: 'disabled';
}
/** Lease-store error — fail open, deliver the content; an alert was raised. */
 | {
    decision: 'allow';
    reason: 'fail-open';
}
/** Dry-run observed a foreign lease — deliver anyway, but it was logged. */
 | {
    decision: 'allow';
    reason: 'would-hold';
}
/** Enforcing + foreign live lease — WITHHOLD the content. */
 | {
    decision: 'hold';
    /** A holding notice to best-effort deliver to the peer (null if rate-limited). */
    notice: HoldingNotice | null;
    ownerSessionName: string;
    epoch: number;
};
export interface SendGateDeps {
    conversationStore?: ConversationStore | null;
    /** Raw `threadline.singleNegotiator` config block (resolved defensively). */
    rawConfig: unknown;
    /**
     * Whether this agent is a development agent. The lease's `enabled` flag rides
     * the developmentAgent dark-feature gate — LIVE (in dry-run) on a dev agent,
     * DARK on the fleet — unless the config sets `enabled` explicitly.
     */
    developmentAgent?: boolean;
    /** This machine's id. */
    machineId: string;
    /** This agent's display name (interpolated into the fixed holding-notice template). */
    agentName: string;
    /** The sending session's server-authoritative name (from INSTAR_SESSION_NAME). */
    ownerSessionName: string | undefined;
    /** Directory for the dry-run/fail-open observability JSONL (logs/). */
    logDir: string;
    /** Whether a session is currently live (fences a dead foreign owner). */
    isSessionLive?: (sessionName: string) => boolean;
    /** Raise a HIGH-priority alert on fail-open (never silent). Best-effort. */
    raiseFailOpenAlert?: (detail: {
        threadId: string;
        sessionName: string;
        reason: string;
    }) => void;
    /** Clock injection for tests. */
    now?: () => number;
}
/**
 * Evaluate the send gate for one outbound send. Returns the verdict the route
 * acts on. Performs the lease CAS + holding-notice stamp + observability log
 * internally; never throws into the send path (a store error fails open).
 */
export declare function evaluateSendGate(threadId: string, deps: SendGateDeps): Promise<SendGateVerdict>;
/** Resolve the standard logs/ directory for negotiator observability. */
export declare function negotiatorLogDir(stateDir: string): string;
//# sourceMappingURL=NegotiatorGate.d.ts.map