import { h as PersonalityDefinition } from './types-Bqp-TaHW.js';
import { c as AnthropicMessagesClient } from './types-DjPlsx0H.js';

type ContactChannel = "email" | "phone" | "linkedin" | "in_person" | "conference" | "telegram" | "slack" | "sms" | "other";
type ContactDirection = "inbound" | "outbound";
type ContactSentiment = "positive" | "neutral" | "negative";
/** A single recorded interaction with a contact. */
interface ContactPoint {
    id: string;
    relationshipId: string;
    channel: ContactChannel;
    direction: ContactDirection;
    occurredAt: Date;
    sentiment?: ContactSentiment;
    /** Free-text summary of the interaction. */
    note?: string;
}
type HeatLevel = "warm" | "cool" | "cold";
/** Computed relationship heat for a single relationship. */
interface HeatScore {
    level: HeatLevel;
    /** Normalised: 0.0 (cold) → 1.0 (actively warm). */
    score: number;
    /** Positive infinity when no contact history exists. */
    daysSinceLastContact: number;
    /** Human-readable rationale produced by computeHeatScore. */
    rationale: string;
    computedAt: Date;
}
/**
 * Full tracked state for one relationship.
 * Contact history is ordered by occurredAt ascending.
 */
interface RelationshipState {
    /** Stable identifier — consumer-defined (CRM contact ID, email address, etc.). */
    id: string;
    displayName: string;
    contacts: ContactPoint[];
    /** Most recently computed heat score. Absent until first computeHeatScore call. */
    heat?: HeatScore;
    /** Consumer-defined metadata: company, role, tags, CRM URL, etc. */
    meta?: Record<string, unknown>;
}
/** Industry vertical that selects a default CadencePolicy. */
type CadenceVertical = "saas_b2b" | "professional_services" | "financial_advisory" | "recruiting" | "general";
/** Phase-specific thresholds within a CadencePolicy. */
interface CadenceThresholds {
    /** Days without contact before the relationship is considered "cool". */
    coolAfterDays: number;
    /** Days without contact before the relationship is considered "cold". */
    coldAfterDays: number;
    /**
     * Minimum days between outbound touches.
     * Prevents over-contact when the operator acts quickly on recommendations.
     */
    minDaysBetweenTouches: number;
}
/** Vertical-specific cadence rules with three engagement phases. */
interface CadencePolicy {
    vertical: CadenceVertical;
    /** Active deal / engagement cycle — shortest thresholds. */
    engagementActive: CadenceThresholds;
    /** Warm nurture — medium thresholds. */
    nurture: CadenceThresholds;
    /** Alumni / long-term maintenance — longest thresholds. */
    maintenance: CadenceThresholds;
    /** Preferred outreach channels in priority order. */
    preferredChannels: ContactChannel[];
}
/** Why the recommender is surfacing an intervention. */
type InterventionReason = "relationship_going_cold" | "no_response_to_outbound" | "reciprocity_imbalance" | "long_gap_since_meaningful_contact" | "reengagement_opportunity";
/** A recommendation to reach out, produced by InterventionRecommender. */
interface InterventionRecommendation {
    relationshipId: string;
    displayName: string;
    reason: InterventionReason;
    urgency: "high" | "medium" | "low";
    suggestedChannel: ContactChannel;
    heatScore: HeatScore;
    rationale: string;
    recommendedAt: Date;
}
type DraftChannel = "email" | "linkedin" | "call_script" | "slack" | "sms";
/**
 * A drafted outreach message produced by InterventionDrafter.
 *
 * requiresApproval is always true — drafts NEVER auto-send.
 * Consumers wire this into F0.6 Approval flow (createProposal) before delivery.
 */
interface DraftedIntervention {
    relationshipId: string;
    displayName: string;
    channel: DraftChannel;
    subject?: string;
    body: string;
    requiresApproval: true;
    draftedAt: Date;
    recommendation: InterventionRecommendation;
}
/**
 * The class of cadence pattern detected. Each maps to a single detector module
 * under src/relationship-cadence/detectors/.
 */
type CadencePatternType = "going_cold" | "frequency_shift" | "unilateral_silence" | "escalation_needed";
/**
 * A pattern emitted by a cadence detector. Anchored to a single relationship
 * (cadence patterns are not cross-relationship — that's F7's territory).
 *
 * `evidenceContactIds` references the ContactPoint ids supporting this
 * detection so downstream consumers (recommender, dashboards, audit) can
 * inspect the underlying signal.
 */
interface CadencePattern {
    id: string;
    type: CadencePatternType;
    operatorId: string;
    relationshipId: string;
    displayName: string;
    /** Human-readable explanation of what was detected. */
    description: string;
    evidenceContactIds: string[];
    /** 0.0–1.0: how confident the detector is in this pattern. */
    confidence: number;
    /** Detector-specific metrics (e.g. daysSinceLastContact, frequencyDelta). */
    metrics: Record<string, number>;
    windowStart: Date;
    windowEnd: Date;
    detectedAt: Date;
}
/**
 * Computed point-in-time snapshot of a relationship's cadence.
 *
 * Convenience aggregate used by Nyx.recommendNextAction and the
 * health-rollup downstream of detectors. Heat + phase + 90-day directional
 * counts in one struct.
 */
interface CadenceState {
    relationshipId: string;
    displayName: string;
    heat: HeatScore;
    phase: CadencePhaseName;
    /** Inbound contacts in the last 90 days. */
    inboundCount90d: number;
    /** Outbound contacts in the last 90 days. */
    outboundCount90d: number;
    lastInboundAt?: Date;
    lastOutboundAt?: Date;
    computedAt: Date;
}
/**
 * Phase identifier used in CadenceState. Mirrors heat-scorer's CadencePhase but
 * lives in types to avoid a circular import.
 */
type CadencePhaseName = "engagement_active" | "nurture" | "maintenance";
/** Overall relationship health rollup from observed CadencePatterns. */
type RelationshipHealthLevel = "healthy" | "watching" | "at_risk" | "critical";
/**
 * Joint health view produced by the escalation detector and surfaced by Nyx.
 * Composes the patterns observed for this relationship into a single rollup.
 */
interface RelationshipHealth {
    relationshipId: string;
    displayName: string;
    level: RelationshipHealthLevel;
    /** 0.0 (critical) → 1.0 (healthy). */
    score: number;
    /** All CadencePatterns currently observed for this relationship. */
    patterns: CadencePattern[];
    rationale: string;
    assessedAt: Date;
}
/**
 * A recommendation for the next outreach touch, produced by
 * NextTouchpointRecommender.
 *
 * Different from InterventionRecommendation (Phase A) — that recommends "you
 * should reach out". This recommends "reach out THEN via THIS channel".
 */
interface OutreachRecommendation {
    relationshipId: string;
    displayName: string;
    /** When to send the touch. Respects policy.minDaysBetweenTouches. */
    proposedTouchAt: Date;
    channel: ContactChannel;
    urgency: "high" | "medium" | "low";
    /** Why this timing + channel. */
    rationale: string;
    /** CadencePattern ids that drove this recommendation. */
    basedOnPatternIds: string[];
    recommendedAt: Date;
}
/**
 * A drafted outreach message produced by DraftSuggester.
 *
 * requiresApproval is always true — Nyx NEVER auto-sends. Wire into
 * F0.6 Approval (createProposal) before any delivery.
 */
interface DraftedOutreach {
    relationshipId: string;
    displayName: string;
    channel: DraftChannel;
    subject?: string;
    body: string;
    requiresApproval: true;
    draftedAt: Date;
    recommendation: OutreachRecommendation;
}
/**
 * Intent classifier passed to channel-specific drafters. Steers tone + framing
 * without binding to a specific cadence pattern.
 */
type OutreachIntent = "reconnect" | "follow_up" | "check_in" | "congratulate" | "condolence" | "thank" | "invite" | "ask";
interface OutreachDrafterContext {
    /** Optional past interactions used to ground the draft in real history. */
    interactionHistory?: InteractionTouchpoint[];
    /** Optional personal facts (kids, hobbies, recent events) for warmth. */
    personalFacts?: PersonalFact[];
    /** Optional commitments the operator owes the contact. */
    outstandingCommitments?: Commitment[];
    /**
     * Optional free-text hint about the specific reason this draft is being
     * generated — e.g. "saw they raised a seed round on TechCrunch".
     */
    intentNote?: string;
}
/**
 * A channel-specific drafter contract. Each drafter targets a single
 * `DraftChannel` and produces a `DraftedOutreach`.
 *
 * requiresApproval is hard-coded `true` on every result — drafters NEVER
 * touch send APIs.
 */
interface OutreachDrafter {
    readonly channel: DraftChannel;
    draft(args: {
        recommendation: OutreachRecommendation;
        relationship: RelationshipState;
        personality: PersonalityDefinition;
        intent?: OutreachIntent;
        context?: OutreachDrafterContext;
    }): Promise<DraftedOutreach>;
}
type InteractionDirection = "inbound" | "outbound";
/**
 * A captured past touchpoint: what was discussed, what commitments were made,
 * what to remember next time. Distinct from `ContactPoint` (which is the raw
 * cadence-signal record) — `InteractionTouchpoint` is the operator's
 * higher-resolution memory of the conversation.
 */
interface InteractionTouchpoint {
    id: string;
    relationshipId: string;
    occurredAt: Date;
    channel: ContactChannel;
    direction: InteractionDirection;
    /** One-line description of what happened. */
    summary: string;
    /** Topics discussed (free-form tags). */
    topicsDiscussed?: string[];
    /** Commitments the operator made during this touchpoint. */
    commitmentIds?: string[];
    /** Free-text additional notes (operator-editable). */
    notes?: string;
    createdAt: Date;
}
type PersonalFactCategory = "family" | "career" | "hobby" | "preference" | "milestone" | "other";
/**
 * A stored personal fact about a contact — kids' names, hobbies, recent
 * events. Operator-editable. Every mutation is captured in
 * `PersonalFactAuditEntry` so operators can audit + roll back.
 */
interface PersonalFact {
    id: string;
    relationshipId: string;
    category: PersonalFactCategory;
    /** The fact itself, e.g. "Daughter Mia turns 7 in July". */
    fact: string;
    /** Where the fact came from — "operator", "email_thread:msg_x", etc. */
    source: string;
    /** Optional confidence 0.0–1.0 — useful when facts come from inference. */
    confidence?: number;
    createdAt: Date;
    updatedAt: Date;
}
type PersonalFactAuditAction = "created" | "updated" | "deleted";
interface PersonalFactAuditEntry {
    id: string;
    factId: string;
    relationshipId: string;
    action: PersonalFactAuditAction;
    /** Snapshot of the fact text before the change (null on creation). */
    previousFact: string | null;
    /** Snapshot of the fact text after the change (null on deletion). */
    nextFact: string | null;
    /** Free-form actor identifier — operator id, "system", etc. */
    actor: string;
    /** Optional human-readable reason for the change. */
    reason?: string;
    occurredAt: Date;
}
type CommitmentDirection = "operator_to_contact" | "contact_to_operator";
type CommitmentStatus = "open" | "fulfilled" | "cancelled";
/**
 * A specific obligation between operator + contact. The cadence module
 * surfaces these as overdue when status === "open" and dueAt < now.
 */
interface Commitment {
    id: string;
    relationshipId: string;
    direction: CommitmentDirection;
    /** What was committed — "Send proposal draft", "Intro to Sarah at Atlas". */
    description: string;
    dueAt?: Date;
    status: CommitmentStatus;
    /** Optional touchpoint id this commitment originated from. */
    sourceTouchpointId?: string;
    createdAt: Date;
    updatedAt: Date;
    fulfilledAt?: Date;
}

/** Persistence contract for relationship state and contact history. */
interface RelationshipTracker {
    /**
     * Record a new contact point for a relationship.
     * Creates the relationship entry if it does not already exist.
     */
    recordContact(operatorId: string, relationshipId: string, contact: Omit<ContactPoint, "id" | "relationshipId">): Promise<ContactPoint>;
    /** Returns the full relationship state including contact history, or null if unknown. */
    getRelationship(operatorId: string, relationshipId: string): Promise<RelationshipState | null>;
    /**
     * Upserts display name and optional metadata for a relationship.
     * Creates the entry if it does not exist; preserves existing contacts.
     */
    upsertRelationship(operatorId: string, id: string, displayName: string, meta?: Record<string, unknown>): Promise<RelationshipState>;
    /** Lists all tracked relationships for an operator. */
    listRelationships(operatorId: string): Promise<RelationshipState[]>;
}
/**
 * In-memory RelationshipTracker. State is per-instance — not safe for
 * concurrent multi-process writes. Suitable for tests and prototypes.
 */
declare class InMemoryRelationshipTracker implements RelationshipTracker {
    private readonly store;
    private operatorStore;
    recordContact(operatorId: string, relationshipId: string, contact: Omit<ContactPoint, "id" | "relationshipId">): Promise<ContactPoint>;
    getRelationship(operatorId: string, relationshipId: string): Promise<RelationshipState | null>;
    upsertRelationship(operatorId: string, id: string, displayName: string, meta?: Record<string, unknown>): Promise<RelationshipState>;
    listRelationships(operatorId: string): Promise<RelationshipState[]>;
}

type CadencePhase = "engagement_active" | "nurture" | "maintenance";
/**
 * Computes a heat score for a relationship under the given policy and phase.
 *
 * Score range: 0.0 (cold, no engagement) → 1.0 (actively warm with reciprocal contacts).
 */
declare function computeHeatScore(relationship: RelationshipState, policy: CadencePolicy, phase?: CadencePhase, now?: Date): HeatScore;

declare const DEFAULT_POLICIES: Record<CadenceVertical, CadencePolicy>;
/** Returns the default policy for a vertical. Throws for unknown verticals. */
declare function getCadencePolicy(vertical: CadenceVertical): CadencePolicy;

/**
 * Subset of CalibrationLearner (from proactive-surfacing) that the recommender
 * uses. Declared locally so this module has no hard dependency on the
 * proactive-surfacing module's TriggerSourceName discriminated union.
 * A real CalibrationLearner instance satisfies this structurally.
 */
interface CadenceCalibrationLearner {
    getCalibration(operatorId: string, scope: string): Promise<number>;
}
/** Decides which relationships need intervention and why. */
interface InterventionRecommender {
    recommend(operatorId: string, relationships: RelationshipState[], policy: CadencePolicy, phase?: CadencePhase): Promise<InterventionRecommendation[]>;
}
interface PolicyInterventionRecommenderConfig {
    /**
     * CalibrationLearner from proactive-surfacing. If provided, its multiplier
     * for the "relationship" scope is applied to the score threshold.
     * A multiplier < 1.0 makes the recommender less sensitive (fewer interventions).
     * A multiplier > 1.0 makes it more sensitive.
     */
    calibrationLearner?: CadenceCalibrationLearner;
    /**
     * Heat score below which an intervention is recommended.
     * Default: 0.5 (anything less than comfortably warm).
     */
    scoreThreshold?: number;
    /**
     * Maximum recommendations returned per call. Prevents overwhelming the
     * operator when many relationships are cold simultaneously. Default: 10.
     */
    maxRecommendations?: number;
}
/**
 * Policy-driven recommender that scores all relationships, applies calibration,
 * and returns those that fall below the threshold — sorted high → low urgency.
 */
declare class PolicyInterventionRecommender implements InterventionRecommender {
    private readonly calibrationLearner?;
    private readonly scoreThreshold;
    private readonly maxRecommendations;
    constructor(config?: PolicyInterventionRecommenderConfig);
    recommend(operatorId: string, relationships: RelationshipState[], policy: CadencePolicy, phase?: CadencePhase, now?: Date): Promise<InterventionRecommendation[]>;
}

/** Produces a draft outreach message for an intervention recommendation. */
interface InterventionDrafter {
    draft(recommendation: InterventionRecommendation, relationship: RelationshipState, personality: PersonalityDefinition, channel: DraftChannel): Promise<DraftedIntervention>;
}
/**
 * Claude-backed drafter. Maps DraftChannel to a PersonalityChannel for system
 * prompt construction, then asks Claude to draft appropriately-voiced copy.
 */
declare class ClaudeInterventionDrafter implements InterventionDrafter {
    private readonly anthropic;
    constructor(anthropic: AnthropicMessagesClient);
    draft(recommendation: InterventionRecommendation, relationship: RelationshipState, personality: PersonalityDefinition, channel: DraftChannel): Promise<DraftedIntervention>;
}

interface CadenceDetector<TConfig = unknown> {
    /** Stable name, e.g. "going_cold", "frequency_shift". */
    readonly name: string;
    detect(operatorId: string, relationships: RelationshipState[], config?: TConfig): CadencePattern[];
}

interface CadenceDetectorConfig {
    policy: CadencePolicy;
    phase?: CadencePhase;
    /**
     * Heat-level floor at which a pattern is emitted. Default: "cool" — both
     * cool and cold relationships emit; warm relationships are skipped.
     */
    emitOn?: "cool" | "cold";
    /** Optional reference time for testability. Default: new Date(). */
    now?: Date;
    /** Max patterns to emit per run. Default: 50. */
    maxPatterns?: number;
}
declare function detectGoingCold(operatorId: string, relationships: RelationshipState[], config: CadenceDetectorConfig): CadencePattern[];
declare const cadenceDetector: CadenceDetector<CadenceDetectorConfig>;

interface FrequencyShiftDetectorConfig {
    /** Lookback window in days. Default: 60. Split into 30-day halves. */
    lookbackDays?: number;
    /** Optional reference time for testability. Default: new Date(). */
    now?: Date;
    /**
     * Minimum absolute delta to emit (0.5 = 50%). Default: 0.5.
     * Negative direction is treated symmetrically.
     */
    minDelta?: number;
    /** Minimum total contacts across both periods. Default: 3. */
    minTotal?: number;
    /** Max patterns to emit. Default: 50. */
    maxPatterns?: number;
}
declare function detectFrequencyShift(operatorId: string, relationships: RelationshipState[], config?: FrequencyShiftDetectorConfig): CadencePattern[];
declare const frequencyShiftDetector: CadenceDetector<FrequencyShiftDetectorConfig>;

interface SilenceDetectorConfig {
    /** Days after last outbound with no inbound before pattern is emitted. Default: 7. */
    silenceAfterDays?: number;
    /**
     * Cap on days since last outbound. Outbound touches older than this aren't
     * considered "waiting on a reply" — the operator has presumably moved on
     * or sent a follow-up. Default: 60.
     */
    maxOutboundAgeDays?: number;
    /** Optional reference time for testability. Default: new Date(). */
    now?: Date;
    /** Max patterns to emit. Default: 50. */
    maxPatterns?: number;
}
declare function detectUnilateralSilence(operatorId: string, relationships: RelationshipState[], config?: SilenceDetectorConfig): CadencePattern[];
declare const silenceDetector: CadenceDetector<SilenceDetectorConfig>;

interface EscalationNeededDetectorConfig {
    /** Lookback window in days. Default: 90. Split into halves. */
    lookbackDays?: number;
    /** Optional reference time for testability. Default: new Date(). */
    now?: Date;
    /**
     * Maximum mean sentiment in the current half that still permits emission.
     * Default: 0 (i.e. current sentiment must be neutral-or-worse).
     */
    sentimentFloor?: number;
    /**
     * Required decline in sentiment baseline → current. Default: 0.4
     * (e.g. baseline 0.5 / current 0.1 = -0.4 satisfies).
     */
    sentimentDrop?: number;
    /**
     * Required decline in contact frequency baseline → current.
     * Default: 0.3 (30% drop).
     */
    frequencyDrop?: number;
    /** Minimum total contacts across both periods. Default: 4. */
    minTotal?: number;
    /** Max patterns to emit. Default: 25. */
    maxPatterns?: number;
}
declare function detectEscalationNeeded(operatorId: string, relationships: RelationshipState[], config?: EscalationNeededDetectorConfig): CadencePattern[];
declare const escalationNeededDetector: CadenceDetector<EscalationNeededDetectorConfig>;

type CadenceDetectorName = "going_cold" | "frequency_shift" | "unilateral_silence" | "escalation_needed";
interface RunAllCadenceDetectorsConfig {
    policy: CadencePolicy;
    phase?: CadencePhase;
    now?: Date;
    /** Per-detector config passthrough. */
    goingCold?: Partial<Omit<CadenceDetectorConfig, "policy" | "phase" | "now">>;
    frequencyShift?: FrequencyShiftDetectorConfig;
    unilateralSilence?: SilenceDetectorConfig;
    escalationNeeded?: EscalationNeededDetectorConfig;
    /** Detectors to skip. */
    disable?: CadenceDetectorName[];
}
/**
 * Run every cadence detector over a single relationship batch and return
 * the unified CadencePattern list. Selectively disable detectors via
 * `disable: ["escalation_needed"]`.
 */
declare function runAllCadenceDetectors(operatorId: string, relationships: RelationshipState[], config: RunAllCadenceDetectorsConfig): CadencePattern[];

interface NextTouchpointRecommenderContext {
    policy: CadencePolicy;
    phase?: CadencePhase;
    /** Reference time for testability. Default: new Date(). */
    now?: Date;
}
interface NextTouchpointRecommender {
    recommend(operatorId: string, patterns: CadencePattern[], relationships: RelationshipState[], context: NextTouchpointRecommenderContext): OutreachRecommendation[];
}
interface DraftSuggesterContext {
    /** Preferred channel. If omitted, draft uses recommendation.channel mapped via channelMap. */
    channel?: DraftChannel;
}
interface DraftSuggester {
    suggest(recommendation: OutreachRecommendation, relationship: RelationshipState, personality: PersonalityDefinition, context?: DraftSuggesterContext): Promise<DraftedOutreach>;
}

declare class PolicyNextTouchpointRecommender implements NextTouchpointRecommender {
    recommend(_operatorId: string, patterns: CadencePattern[], relationships: RelationshipState[], context: NextTouchpointRecommenderContext): OutreachRecommendation[];
}

declare class ClaudeDraftSuggester implements DraftSuggester {
    private readonly anthropic;
    constructor(anthropic: AnthropicMessagesClient);
    suggest(recommendation: OutreachRecommendation, relationship: RelationshipState, personality: PersonalityDefinition, context?: DraftSuggesterContext): Promise<DraftedOutreach>;
}

interface InteractionHistoryStore {
    recordTouchpoint(operatorId: string, touchpoint: Omit<InteractionTouchpoint, "id" | "createdAt">): Promise<InteractionTouchpoint>;
    listForRelationship(operatorId: string, relationshipId: string, limit?: number): Promise<InteractionTouchpoint[]>;
    /** Most recent N touchpoints across all relationships for the operator. */
    listRecent(operatorId: string, limit?: number): Promise<InteractionTouchpoint[]>;
    getTouchpoint(operatorId: string, touchpointId: string): Promise<InteractionTouchpoint | null>;
}
/**
 * In-memory implementation. Suitable for tests + prototypes. Production
 * consumers persist to their own store implementing `InteractionHistoryStore`.
 */
declare class InMemoryInteractionHistory implements InteractionHistoryStore {
    private readonly store;
    private bucket;
    recordTouchpoint(operatorId: string, touchpoint: Omit<InteractionTouchpoint, "id" | "createdAt">): Promise<InteractionTouchpoint>;
    listForRelationship(operatorId: string, relationshipId: string, limit?: number): Promise<InteractionTouchpoint[]>;
    listRecent(operatorId: string, limit?: number): Promise<InteractionTouchpoint[]>;
    getTouchpoint(operatorId: string, touchpointId: string): Promise<InteractionTouchpoint | null>;
}
/**
 * Convenience constructor — keeps callsites readable when building a
 * touchpoint inline for `Nyx.recordInteraction`.
 */
declare function makeTouchpoint(args: {
    relationshipId: string;
    occurredAt: Date;
    channel: ContactChannel;
    direction: InteractionDirection;
    summary: string;
    topicsDiscussed?: string[];
    commitmentIds?: string[];
    notes?: string;
}): Omit<InteractionTouchpoint, "id" | "createdAt">;

interface PersonalFactsStore {
    addFact(operatorId: string, args: {
        relationshipId: string;
        category: PersonalFactCategory;
        fact: string;
        source: string;
        confidence?: number;
        actor: string;
        reason?: string;
    }): Promise<PersonalFact>;
    updateFact(operatorId: string, factId: string, args: {
        fact: string;
        actor: string;
        reason?: string;
    }): Promise<PersonalFact | null>;
    deleteFact(operatorId: string, factId: string, args: {
        actor: string;
        reason?: string;
    }): Promise<boolean>;
    listForRelationship(operatorId: string, relationshipId: string): Promise<PersonalFact[]>;
    getFact(operatorId: string, factId: string): Promise<PersonalFact | null>;
    listAuditEntries(operatorId: string, args?: {
        relationshipId?: string;
        factId?: string;
    }): Promise<PersonalFactAuditEntry[]>;
}
/**
 * In-memory implementation. Production consumers persist to their own store
 * implementing `PersonalFactsStore`.
 */
declare class InMemoryPersonalFacts implements PersonalFactsStore {
    private readonly facts;
    private readonly audit;
    private factsFor;
    private auditFor;
    private writeAudit;
    addFact(operatorId: string, args: {
        relationshipId: string;
        category: PersonalFactCategory;
        fact: string;
        source: string;
        confidence?: number;
        actor: string;
        reason?: string;
    }): Promise<PersonalFact>;
    updateFact(operatorId: string, factId: string, args: {
        fact: string;
        actor: string;
        reason?: string;
    }): Promise<PersonalFact | null>;
    deleteFact(operatorId: string, factId: string, args: {
        actor: string;
        reason?: string;
    }): Promise<boolean>;
    listForRelationship(operatorId: string, relationshipId: string): Promise<PersonalFact[]>;
    getFact(operatorId: string, factId: string): Promise<PersonalFact | null>;
    listAuditEntries(operatorId: string, args?: {
        relationshipId?: string;
        factId?: string;
    }): Promise<PersonalFactAuditEntry[]>;
}

interface CommitmentTrackerStore {
    createCommitment(operatorId: string, args: {
        relationshipId: string;
        direction: CommitmentDirection;
        description: string;
        dueAt?: Date;
        sourceTouchpointId?: string;
    }): Promise<Commitment>;
    updateStatus(operatorId: string, commitmentId: string, status: CommitmentStatus, now?: Date): Promise<Commitment | null>;
    listForRelationship(operatorId: string, relationshipId: string, args?: {
        status?: CommitmentStatus;
    }): Promise<Commitment[]>;
    listOverdue(operatorId: string, now?: Date): Promise<Commitment[]>;
    getCommitment(operatorId: string, commitmentId: string): Promise<Commitment | null>;
}
declare class InMemoryCommitmentTracker implements CommitmentTrackerStore {
    private readonly store;
    private bucket;
    createCommitment(operatorId: string, args: {
        relationshipId: string;
        direction: CommitmentDirection;
        description: string;
        dueAt?: Date;
        sourceTouchpointId?: string;
    }): Promise<Commitment>;
    updateStatus(operatorId: string, commitmentId: string, status: CommitmentStatus, now?: Date): Promise<Commitment | null>;
    listForRelationship(operatorId: string, relationshipId: string, args?: {
        status?: CommitmentStatus;
    }): Promise<Commitment[]>;
    listOverdue(operatorId: string, now?: Date): Promise<Commitment[]>;
    getCommitment(operatorId: string, commitmentId: string): Promise<Commitment | null>;
}

interface NyxConfig {
    /** Cadence policy applied to all relationships. */
    policy: CadencePolicy;
    /** Default phase used when callers don't supply one. Default: "nurture". */
    defaultPhase?: CadencePhase;
    /** Anthropic client. Required for draftOutreach; optional otherwise. */
    anthropic?: AnthropicMessagesClient;
    /** Override the touchpoint recommender. Default: PolicyNextTouchpointRecommender. */
    touchpointRecommender?: NextTouchpointRecommender;
    /** Override the draft suggester. Default: ClaudeDraftSuggester(anthropic). */
    draftSuggester?: DraftSuggester;
    /**
     * Optional approval gate. When provided, Nyx.draftOutreach invokes it after
     * generating the draft so the consumer can call F0.6 createProposal without
     * needing to wire it manually. Nyx still returns the draft to the caller.
     */
    approvalGate?: ApprovalGate;
    /** Detector configuration passthrough. Overrides phase/now/policy supplied by Nyx. */
    detectorConfig?: Partial<Omit<RunAllCadenceDetectorsConfig, "policy" | "phase" | "now">>;
    /**
     * Channel-specific drafters. If absent for a given channel, Nyx instantiates
     * the default Claude-backed drafter on first use using `anthropic`.
     */
    drafters?: Partial<Record<DraftChannel, OutreachDrafter>>;
    /** Interaction history store (per-touchpoint memory). */
    interactionHistory?: InteractionHistoryStore;
    /** Personal facts store (kids, hobbies, milestones). */
    personalFacts?: PersonalFactsStore;
    /** Commitment tracker (obligations between operator + contact). */
    commitments?: CommitmentTrackerStore;
}
/**
 * Approval-gate hook. Nyx invokes this with the drafted outreach and metadata
 * suitable for F0.6 createProposal({ type, source, title, rationale, payload }).
 * Implementation typically calls createProposal in the consumer's repo.
 */
interface ApprovalGate {
    submit(args: {
        drafted: DraftedOutreach;
        title: string;
        rationale: string;
    }): Promise<void>;
}
interface NyxScanResult {
    patterns: CadencePattern[];
    health: RelationshipHealth[];
    states: CadenceState[];
    recommendations: OutreachRecommendation[];
}
declare class Nyx {
    private readonly tracker;
    private readonly policy;
    private readonly phase;
    private readonly anthropic?;
    private readonly touchpointRecommender;
    private readonly draftSuggester?;
    private readonly approvalGate?;
    private readonly detectorConfig;
    private readonly drafters;
    private readonly interactionHistory?;
    private readonly personalFacts?;
    private readonly commitments?;
    constructor(tracker: RelationshipTracker, config: NyxConfig);
    /**
     * Run the full sweep: detect, score health, recommend touchpoints. Returns
     * everything Nyx knows about the operator's relationships at this moment.
     */
    scan(operatorId: string, phase?: CadencePhase, now?: Date): Promise<NyxScanResult>;
    /**
     * Focused per-relationship recommendation. Returns the single best outreach
     * action for this contact, or null when nothing is due.
     */
    recommendNextAction(operatorId: string, relationshipId: string, phase?: CadencePhase, now?: Date): Promise<OutreachRecommendation | null>;
    /**
     * Draft an outreach message for an in-flight recommendation. Never sends.
     *
     * If a channel-specific Phase C drafter is registered for the resolved
     * channel, Nyx uses it (and pulls in interaction history + personal facts +
     * outstanding commitments from the memory stores when available). Otherwise
     * Nyx falls back to the Phase B `DraftSuggester`.
     *
     * If an `approvalGate` was provided in NyxConfig, this also forwards the
     * draft to that gate (which typically calls F0.6 createProposal).
     *
     * Throws if Nyx was constructed without any drafter route or Anthropic client.
     */
    draftOutreach(operatorId: string, relationshipId: string, personality: PersonalityDefinition, channelOrOptions?: DraftChannel | {
        channel?: DraftChannel;
        intent?: OutreachIntent;
        intentNote?: string;
    }, now?: Date): Promise<DraftedOutreach>;
    /**
     * Phase C — surface the top-N OutreachRecommendations across all
     * relationships for an operator. Wraps `scan` and trims the result so
     * dashboards can ask for "the top 5 things to do today".
     */
    surfaceRecommendations(operatorId: string, args?: {
        limit?: number;
        phase?: CadencePhase;
        now?: Date;
    }): Promise<OutreachRecommendation[]>;
    /**
     * Phase C — record an interaction touchpoint into the configured
     * `InteractionHistoryStore`. Optionally also records the underlying
     * cadence `ContactPoint` on the tracker.
     */
    recordInteraction(operatorId: string, args: {
        touchpoint: Omit<InteractionTouchpoint, "id" | "createdAt">;
        /** When true, also append a ContactPoint to the cadence tracker. */
        alsoTrackContact?: boolean;
    }): Promise<InteractionTouchpoint>;
    /**
     * Phase C — fetch known personal facts about a contact for downstream
     * context (drafting, surfacing, dashboards). Returns [] when no facts store
     * is configured or none are known.
     */
    queryPersonalFacts(operatorId: string, relationshipId: string): Promise<PersonalFact[]>;
    private defaultChannelFor;
    private resolveDrafter;
    private buildDrafterContext;
    /**
     * Phase A intervention recommender — exposed for callers who want the
     * legacy heat-only flow alongside the Phase B pipeline.
     */
    recommendInterventions(operatorId: string, phase?: CadencePhase, now?: Date): Promise<InterventionRecommendation[]>;
}

declare class EmailDrafter implements OutreachDrafter {
    private readonly anthropic;
    readonly channel: DraftChannel;
    constructor(anthropic: AnthropicMessagesClient);
    draft(args: {
        recommendation: OutreachRecommendation;
        relationship: RelationshipState;
        personality: PersonalityDefinition;
        intent?: OutreachIntent;
        context?: OutreachDrafterContext;
    }): Promise<DraftedOutreach>;
}

declare class SlackDrafter implements OutreachDrafter {
    private readonly anthropic;
    readonly channel: DraftChannel;
    constructor(anthropic: AnthropicMessagesClient);
    draft(args: {
        recommendation: OutreachRecommendation;
        relationship: RelationshipState;
        personality: PersonalityDefinition;
        intent?: OutreachIntent;
        context?: OutreachDrafterContext;
    }): Promise<DraftedOutreach>;
}

declare const SMS_CHAR_LIMIT = 160;
declare class TextDrafter implements OutreachDrafter {
    private readonly anthropic;
    readonly channel: DraftChannel;
    constructor(anthropic: AnthropicMessagesClient);
    draft(args: {
        recommendation: OutreachRecommendation;
        relationship: RelationshipState;
        personality: PersonalityDefinition;
        intent?: OutreachIntent;
        context?: OutreachDrafterContext;
    }): Promise<DraftedOutreach>;
}

declare const LINKEDIN_CHAR_LIMIT = 300;
declare class LinkedInDrafter implements OutreachDrafter {
    private readonly anthropic;
    readonly channel: DraftChannel;
    constructor(anthropic: AnthropicMessagesClient);
    draft(args: {
        recommendation: OutreachRecommendation;
        relationship: RelationshipState;
        personality: PersonalityDefinition;
        intent?: OutreachIntent;
        context?: OutreachDrafterContext;
    }): Promise<DraftedOutreach>;
}

type index_ApprovalGate = ApprovalGate;
type index_CadenceDetector<TConfig = unknown> = CadenceDetector<TConfig>;
type index_CadenceDetectorConfig = CadenceDetectorConfig;
type index_CadenceDetectorName = CadenceDetectorName;
type index_CadencePattern = CadencePattern;
type index_CadencePatternType = CadencePatternType;
type index_CadencePhase = CadencePhase;
type index_CadencePhaseName = CadencePhaseName;
type index_CadencePolicy = CadencePolicy;
type index_CadenceState = CadenceState;
type index_CadenceThresholds = CadenceThresholds;
type index_CadenceVertical = CadenceVertical;
type index_ClaudeDraftSuggester = ClaudeDraftSuggester;
declare const index_ClaudeDraftSuggester: typeof ClaudeDraftSuggester;
type index_ClaudeInterventionDrafter = ClaudeInterventionDrafter;
declare const index_ClaudeInterventionDrafter: typeof ClaudeInterventionDrafter;
type index_Commitment = Commitment;
type index_CommitmentDirection = CommitmentDirection;
type index_CommitmentStatus = CommitmentStatus;
type index_CommitmentTrackerStore = CommitmentTrackerStore;
type index_ContactChannel = ContactChannel;
type index_ContactDirection = ContactDirection;
type index_ContactPoint = ContactPoint;
type index_ContactSentiment = ContactSentiment;
declare const index_DEFAULT_POLICIES: typeof DEFAULT_POLICIES;
type index_DraftChannel = DraftChannel;
type index_DraftSuggester = DraftSuggester;
type index_DraftSuggesterContext = DraftSuggesterContext;
type index_DraftedIntervention = DraftedIntervention;
type index_DraftedOutreach = DraftedOutreach;
type index_EmailDrafter = EmailDrafter;
declare const index_EmailDrafter: typeof EmailDrafter;
type index_EscalationNeededDetectorConfig = EscalationNeededDetectorConfig;
type index_FrequencyShiftDetectorConfig = FrequencyShiftDetectorConfig;
type index_HeatLevel = HeatLevel;
type index_HeatScore = HeatScore;
type index_InMemoryCommitmentTracker = InMemoryCommitmentTracker;
declare const index_InMemoryCommitmentTracker: typeof InMemoryCommitmentTracker;
type index_InMemoryInteractionHistory = InMemoryInteractionHistory;
declare const index_InMemoryInteractionHistory: typeof InMemoryInteractionHistory;
type index_InMemoryPersonalFacts = InMemoryPersonalFacts;
declare const index_InMemoryPersonalFacts: typeof InMemoryPersonalFacts;
type index_InMemoryRelationshipTracker = InMemoryRelationshipTracker;
declare const index_InMemoryRelationshipTracker: typeof InMemoryRelationshipTracker;
type index_InteractionDirection = InteractionDirection;
type index_InteractionHistoryStore = InteractionHistoryStore;
type index_InteractionTouchpoint = InteractionTouchpoint;
type index_InterventionDrafter = InterventionDrafter;
type index_InterventionReason = InterventionReason;
type index_InterventionRecommendation = InterventionRecommendation;
type index_InterventionRecommender = InterventionRecommender;
declare const index_LINKEDIN_CHAR_LIMIT: typeof LINKEDIN_CHAR_LIMIT;
type index_LinkedInDrafter = LinkedInDrafter;
declare const index_LinkedInDrafter: typeof LinkedInDrafter;
type index_NextTouchpointRecommender = NextTouchpointRecommender;
type index_NextTouchpointRecommenderContext = NextTouchpointRecommenderContext;
type index_Nyx = Nyx;
declare const index_Nyx: typeof Nyx;
type index_NyxConfig = NyxConfig;
type index_NyxScanResult = NyxScanResult;
type index_OutreachDrafter = OutreachDrafter;
type index_OutreachDrafterContext = OutreachDrafterContext;
type index_OutreachIntent = OutreachIntent;
type index_OutreachRecommendation = OutreachRecommendation;
type index_PersonalFact = PersonalFact;
type index_PersonalFactAuditAction = PersonalFactAuditAction;
type index_PersonalFactAuditEntry = PersonalFactAuditEntry;
type index_PersonalFactCategory = PersonalFactCategory;
type index_PersonalFactsStore = PersonalFactsStore;
type index_PolicyInterventionRecommender = PolicyInterventionRecommender;
declare const index_PolicyInterventionRecommender: typeof PolicyInterventionRecommender;
type index_PolicyInterventionRecommenderConfig = PolicyInterventionRecommenderConfig;
type index_PolicyNextTouchpointRecommender = PolicyNextTouchpointRecommender;
declare const index_PolicyNextTouchpointRecommender: typeof PolicyNextTouchpointRecommender;
type index_RelationshipHealth = RelationshipHealth;
type index_RelationshipHealthLevel = RelationshipHealthLevel;
type index_RelationshipState = RelationshipState;
type index_RelationshipTracker = RelationshipTracker;
type index_RunAllCadenceDetectorsConfig = RunAllCadenceDetectorsConfig;
declare const index_SMS_CHAR_LIMIT: typeof SMS_CHAR_LIMIT;
type index_SilenceDetectorConfig = SilenceDetectorConfig;
type index_SlackDrafter = SlackDrafter;
declare const index_SlackDrafter: typeof SlackDrafter;
type index_TextDrafter = TextDrafter;
declare const index_TextDrafter: typeof TextDrafter;
declare const index_cadenceDetector: typeof cadenceDetector;
declare const index_computeHeatScore: typeof computeHeatScore;
declare const index_detectEscalationNeeded: typeof detectEscalationNeeded;
declare const index_detectFrequencyShift: typeof detectFrequencyShift;
declare const index_detectGoingCold: typeof detectGoingCold;
declare const index_detectUnilateralSilence: typeof detectUnilateralSilence;
declare const index_escalationNeededDetector: typeof escalationNeededDetector;
declare const index_frequencyShiftDetector: typeof frequencyShiftDetector;
declare const index_getCadencePolicy: typeof getCadencePolicy;
declare const index_makeTouchpoint: typeof makeTouchpoint;
declare const index_runAllCadenceDetectors: typeof runAllCadenceDetectors;
declare const index_silenceDetector: typeof silenceDetector;
declare namespace index {
  export { type index_ApprovalGate as ApprovalGate, type index_CadenceDetector as CadenceDetector, type index_CadenceDetectorConfig as CadenceDetectorConfig, type index_CadenceDetectorName as CadenceDetectorName, type index_CadencePattern as CadencePattern, type index_CadencePatternType as CadencePatternType, type index_CadencePhase as CadencePhase, type index_CadencePhaseName as CadencePhaseName, type index_CadencePolicy as CadencePolicy, type index_CadenceState as CadenceState, type index_CadenceThresholds as CadenceThresholds, type index_CadenceVertical as CadenceVertical, index_ClaudeDraftSuggester as ClaudeDraftSuggester, index_ClaudeInterventionDrafter as ClaudeInterventionDrafter, type index_Commitment as Commitment, type index_CommitmentDirection as CommitmentDirection, type index_CommitmentStatus as CommitmentStatus, type index_CommitmentTrackerStore as CommitmentTrackerStore, type index_ContactChannel as ContactChannel, type index_ContactDirection as ContactDirection, type index_ContactPoint as ContactPoint, type index_ContactSentiment as ContactSentiment, index_DEFAULT_POLICIES as DEFAULT_POLICIES, type index_DraftChannel as DraftChannel, type index_DraftSuggester as DraftSuggester, type index_DraftSuggesterContext as DraftSuggesterContext, type index_DraftedIntervention as DraftedIntervention, type index_DraftedOutreach as DraftedOutreach, index_EmailDrafter as EmailDrafter, type index_EscalationNeededDetectorConfig as EscalationNeededDetectorConfig, type index_FrequencyShiftDetectorConfig as FrequencyShiftDetectorConfig, type index_HeatLevel as HeatLevel, type index_HeatScore as HeatScore, index_InMemoryCommitmentTracker as InMemoryCommitmentTracker, index_InMemoryInteractionHistory as InMemoryInteractionHistory, index_InMemoryPersonalFacts as InMemoryPersonalFacts, index_InMemoryRelationshipTracker as InMemoryRelationshipTracker, type index_InteractionDirection as InteractionDirection, type index_InteractionHistoryStore as InteractionHistoryStore, type index_InteractionTouchpoint as InteractionTouchpoint, type index_InterventionDrafter as InterventionDrafter, type index_InterventionReason as InterventionReason, type index_InterventionRecommendation as InterventionRecommendation, type index_InterventionRecommender as InterventionRecommender, index_LINKEDIN_CHAR_LIMIT as LINKEDIN_CHAR_LIMIT, index_LinkedInDrafter as LinkedInDrafter, type index_NextTouchpointRecommender as NextTouchpointRecommender, type index_NextTouchpointRecommenderContext as NextTouchpointRecommenderContext, index_Nyx as Nyx, type index_NyxConfig as NyxConfig, type index_NyxScanResult as NyxScanResult, type index_OutreachDrafter as OutreachDrafter, type index_OutreachDrafterContext as OutreachDrafterContext, type index_OutreachIntent as OutreachIntent, type index_OutreachRecommendation as OutreachRecommendation, type index_PersonalFact as PersonalFact, type index_PersonalFactAuditAction as PersonalFactAuditAction, type index_PersonalFactAuditEntry as PersonalFactAuditEntry, type index_PersonalFactCategory as PersonalFactCategory, type index_PersonalFactsStore as PersonalFactsStore, index_PolicyInterventionRecommender as PolicyInterventionRecommender, type index_PolicyInterventionRecommenderConfig as PolicyInterventionRecommenderConfig, index_PolicyNextTouchpointRecommender as PolicyNextTouchpointRecommender, type index_RelationshipHealth as RelationshipHealth, type index_RelationshipHealthLevel as RelationshipHealthLevel, type index_RelationshipState as RelationshipState, type index_RelationshipTracker as RelationshipTracker, type index_RunAllCadenceDetectorsConfig as RunAllCadenceDetectorsConfig, index_SMS_CHAR_LIMIT as SMS_CHAR_LIMIT, type index_SilenceDetectorConfig as SilenceDetectorConfig, index_SlackDrafter as SlackDrafter, index_TextDrafter as TextDrafter, index_cadenceDetector as cadenceDetector, index_computeHeatScore as computeHeatScore, index_detectEscalationNeeded as detectEscalationNeeded, index_detectFrequencyShift as detectFrequencyShift, index_detectGoingCold as detectGoingCold, index_detectUnilateralSilence as detectUnilateralSilence, index_escalationNeededDetector as escalationNeededDetector, index_frequencyShiftDetector as frequencyShiftDetector, index_getCadencePolicy as getCadencePolicy, index_makeTouchpoint as makeTouchpoint, index_runAllCadenceDetectors as runAllCadenceDetectors, index_silenceDetector as silenceDetector };
}

export { type OutreachIntent as $, type ApprovalGate as A, type HeatScore as B, type CadenceDetector as C, DEFAULT_POLICIES as D, EmailDrafter as E, type FrequencyShiftDetectorConfig as F, InMemoryInteractionHistory as G, type HeatLevel as H, InMemoryCommitmentTracker as I, InMemoryPersonalFacts as J, InMemoryRelationshipTracker as K, type InteractionDirection as L, type InteractionHistoryStore as M, type InteractionTouchpoint as N, type InterventionDrafter as O, type InterventionReason as P, type InterventionRecommendation as Q, type InterventionRecommender as R, LINKEDIN_CHAR_LIMIT as S, LinkedInDrafter as T, type NextTouchpointRecommender as U, type NextTouchpointRecommenderContext as V, Nyx as W, type NyxConfig as X, type NyxScanResult as Y, type OutreachDrafter as Z, type OutreachDrafterContext as _, type CadenceDetectorConfig as a, type OutreachRecommendation as a0, type PersonalFact as a1, type PersonalFactAuditAction as a2, type PersonalFactAuditEntry as a3, type PersonalFactCategory as a4, type PersonalFactsStore as a5, PolicyInterventionRecommender as a6, type PolicyInterventionRecommenderConfig as a7, PolicyNextTouchpointRecommender as a8, type RelationshipHealth as a9, type RelationshipHealthLevel as aa, type RelationshipState as ab, type RelationshipTracker as ac, type RunAllCadenceDetectorsConfig as ad, SMS_CHAR_LIMIT as ae, type SilenceDetectorConfig as af, SlackDrafter as ag, TextDrafter as ah, cadenceDetector as ai, computeHeatScore as aj, detectEscalationNeeded as ak, detectFrequencyShift as al, detectGoingCold as am, detectUnilateralSilence as an, escalationNeededDetector as ao, frequencyShiftDetector as ap, getCadencePolicy as aq, index as ar, makeTouchpoint as as, runAllCadenceDetectors as at, silenceDetector as au, type CadenceDetectorName as b, type CadencePattern as c, type CadencePatternType as d, type CadencePhase as e, type CadencePhaseName as f, type CadencePolicy as g, type CadenceState as h, type CadenceThresholds as i, type CadenceVertical as j, ClaudeDraftSuggester as k, ClaudeInterventionDrafter as l, type Commitment as m, type CommitmentDirection as n, type CommitmentStatus as o, type CommitmentTrackerStore as p, type ContactChannel as q, type ContactDirection as r, type ContactPoint as s, type ContactSentiment as t, type DraftChannel as u, type DraftSuggester as v, type DraftSuggesterContext as w, type DraftedIntervention as x, type DraftedOutreach as y, type EscalationNeededDetectorConfig as z };
