import type { Runnable } from "@langchain/core/runnables"; import { z } from "zod"; import type { Lens } from "../../shared/hyde/lens.inferrer.js"; import type { OpportunityStatus } from "../../shared/interfaces/database.interface.js"; import type { OpportunityEvidence } from '../../shared/schemas/network-assignment.schema.js'; declare const OpportunitySchema: z.ZodObject<{ reasoning: z.ZodString; score: z.ZodNumber; valencyRole: z.ZodEnum<["Agent", "Patient", "Peer"]>; sourceId: z.ZodString; candidateId: z.ZodString; }, "strip", z.ZodTypeAny, { reasoning: string; score: number; sourceId: string; valencyRole: "Agent" | "Patient" | "Peer"; candidateId: string; }, { reasoning: string; score: number; sourceId: string; valencyRole: "Agent" | "Patient" | "Peer"; candidateId: string; }>; export interface EvaluatorEntity { userId: string; profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[]; context?: string; }; intents?: Array<{ intentId: string; payload: string; summary?: string; }>; networkId: string; evidenceKey?: string; ragScore?: number; matchedVia?: string; evidence?: OpportunityEvidence[]; } export interface EvaluatorInput { /** The user who triggered discovery (for context, not special treatment). */ discovererId: string; /** All relevant entities. In introduction mode, only the people being introduced (no introducer). */ entities: EvaluatorEntity[]; /** Existing opportunities for deduplication. */ existingOpportunities?: string; /** When true, DISCOVERER is the introducer; reasoning and actors must be only among ENTITIES. */ introductionMode?: boolean; /** Name of the introducer (for attribution in reasoning when introductionMode is true). */ introducerName?: string; /** Optional hint/context from the introducer about why these people should meet. */ introductionHint?: string; /** Optional discovery query (e.g. from chat). When set, only suggest opportunities where candidates clearly match this request. */ discoveryQuery?: string; /** Pre-rendered network context markdown, keyed by networkId. */ networkContexts?: Record; } declare const ActorSchema: z.ZodObject<{ userId: z.ZodString; role: z.ZodEnum<["agent", "patient", "peer"]>; intentId: z.ZodEffects, string | null, string | null>; evidenceKey: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }>; declare const _OpportunityWithActorsSchema: z.ZodObject<{ reasoning: z.ZodString; score: z.ZodNumber; actors: z.ZodArray; intentId: z.ZodEffects, string | null, string | null>; evidenceKey: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { reasoning: string; score: number; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; }, { reasoning: string; score: number; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; }>; declare const entityBundleResponseFormat: z.ZodObject<{ verdicts: z.ZodArray; intentId: z.ZodEffects, string | null, string | null>; evidenceKey: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }, { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { reasoning: string; score: number; accepted: boolean; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; candidateId: string; }, { reasoning: string; score: number; accepted: boolean; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; candidateId: string; }>, "many">; }, "strip", z.ZodTypeAny, { verdicts: { reasoning: string; score: number; accepted: boolean; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; candidateId: string; }[]; }, { verdicts: { reasoning: string; score: number; accepted: boolean; actors: { userId: string; role: "agent" | "patient" | "peer"; intentId: string | null; evidenceKey?: string | null | undefined; }[]; candidateId: string; }[]; }>; export type EvaluatorActor = z.infer; export type EvaluatedOpportunityWithActors = z.infer; export type EvaluatorOutputBundle = z.infer; /** Raised only after both bounded attempts return an incomplete evaluator batch. */ export declare class EvaluatorIncompleteError extends Error { constructor(); } type Opportunity = z.infer; export interface CandidateProfile { userId: string; identity?: { name?: string; bio?: string; location?: string; }; attributes?: { interests?: string[]; skills?: string[]; }; narrative?: { context?: string; }; score?: number; } interface OpportunityEvaluatorOptions { minScore?: number; limit?: number; hydeDescription?: string; /** Pre-inferred lenses (if not provided, lens inference runs automatically in HyDE graph). */ lenses?: Lens[]; existingOpportunities?: string; candidates?: CandidateProfile[]; filter?: Record; initialStatus?: OpportunityStatus; /** Optional caller cancellation; does not change retry/fallback policy. */ signal?: AbortSignal; } /** Optional test double for entity-bundle model (avoids live LLM in unit tests). */ export type OpportunityEvaluatorOptionsConstructor = { entityBundleModel?: Runnable; }; export declare class OpportunityEvaluator { private model; private entityBundleModel; constructor(options?: OpportunityEvaluatorOptionsConstructor); /** * Main Entry Point: Batch analysis of candidates. * * @param sourceProfileContext - The profile context string of the user we are finding opportunities FOR. * @param candidates - List of potential matches to evaluate. * @param options - Config (minScore, valid types, etc). * @returns A sorted list of high-value `Opportunity` objects. */ invoke(sourceProfileContext: string, candidates: CandidateProfile[], options: OpportunityEvaluatorOptions): Promise; /** * Analyze a single match pair using the primary Agent model. */ private analyzeMatch; /** * Entity-bundle entry point (C3): single LLM call with all entities, returns 0..N opportunities with actors. */ invokeEntityBundle(input: EvaluatorInput, options?: { minScore?: number; returnAll?: boolean; signal?: AbortSignal; }): Promise; /** * Factory method to expose the agent as a LangChain tool. * Simplified to only accept direct evaluation arguments. * PURE: Does not perform any database lookups. */ static asTool(): import("@langchain/core/tools").DynamicStructuredTool; minScore: z.ZodOptional; }, "strip", z.ZodTypeAny, { sourceProfileContext: string; minScore?: number | undefined; candidatesJson?: string | undefined; }, { sourceProfileContext: string; minScore?: number | undefined; candidatesJson?: string | undefined; }>, { sourceProfileContext: string; minScore?: number | undefined; candidatesJson?: string | undefined; }, { sourceProfileContext: string; minScore?: number | undefined; candidatesJson?: string | undefined; }, { reasoning: string; score: number; sourceId: string; valencyRole: "Agent" | "Patient" | "Peer"; candidateId: string; }[], unknown, "opportunity_evaluator">; } export {};