import type { CreateOpportunityData } from '../../shared/interfaces/database.interface.js'; /** Input for the host-side newborn pool-preference stamper (IND-420 P4b). */ export interface StampNewbornOpportunitiesInput { ownerUserId: string; intentId: string; items: CreateOpportunityData[]; } /** * Optional host callback that stamps call-local create items before INSERT. * It must preserve array length/order and may only enrich metadata/signals. */ export type StampNewbornOpportunitiesFn = (input: StampNewbornOpportunitiesInput) => Promise; /** Persist-node facts that determine whether a new item may cross the host stamping boundary. */ export interface NewbornStampingEligibility { ownerUserId: string; operationMode?: string; hasIntroductionContext: boolean; onBehalfOfUserId?: string; targetUserId?: string; discoverySource?: string; resolvedTriggerIntentId?: string; indexedIntentIds: readonly string[]; } /** Fail-open events are injected so the graph retains its owning observability policy. */ export interface NewbornStampingObserver { onUnsafeResult?: (details: { expected: number; actual: number | null; }) => void; onFailure?: (details: { intentId: string; error: unknown; }) => void; } /** * Stamps only newly-created, owned-intent discovery items. Reactivations and * manual, introducer, on-behalf-of, context-only, and continuation flows never * cross this host boundary. Unsafe callback output and callback failures retain * the original create items without changing their order. */ export declare function stampEligibleNewbornOpportunities(itemsToPersist: CreateOpportunityData[], eligibility: NewbornStampingEligibility, stamper?: StampNewbornOpportunitiesFn, observer?: NewbornStampingObserver): Promise;