/** * Radar Graph: Build the opportunity radar view — a flat, presenter-texted * list of opportunity cards for a viewer, optionally scoped to one intent. * * Independent of ChatGraph. Flow: * loadOpportunities → checkPresenterCache → [generateCardText if misses] * → cachePresenterResults → normalizeItems * * Uses OpportunityPresenter for card text and caches presenter results via * OpportunityCache. Responses are a flat `items` array; clients bucket by * lifecycle status themselves. */ import type { RadarGraphDatabase, OpportunityStatus } from '../../shared/interfaces/database.interface.js'; import type { OpportunityCache } from '../../shared/interfaces/cache.interface.js'; import { type RadarCardItem, type RadarResponseItem } from './radar.state.js'; import type { DebugMetaAgent } from '../../capabilities/participant-agents.debug.facade.js'; /** Database must satisfy both RadarGraphDatabase and presenter context (getProfile, getActiveIntents, getNetwork, getUser). */ type RadarGraphDb = RadarGraphDatabase; export type RadarGraphInvokeInput = { userId: string; networkId?: string; scopeType?: 'intent'; scopeId?: string; limit?: number; noCache?: boolean; /** * 'skeleton' returns immediately without LLM work: cached cards complete, * uncached cards with identity fields only + `presentationPending: true`. * Meant as the fast first phase of a two-phase fetch — follow up with a * full request to fill in the text. */ presentation?: 'full' | 'skeleton'; /** * When set, filter loaded opportunities to these lifecycle statuses. Defaults to `DEFAULT_RADAR_STATUSES`. * Explicit statuses switch the graph to "lifecycle view" mode: terminal/internal * statuses pass through (only latent/pending stay gated by viewer actionability), * ordering is newest-first, and composition capping is skipped. */ statuses?: OpportunityStatus[]; }; export type RadarGraphInvokeResult = { items: RadarResponseItem[]; meta: { totalOpportunities: number; }; error?: string; }; /** Default radar statuses: the lifecycle stages a viewer can act on today. */ export declare const DEFAULT_RADAR_STATUSES: OpportunityStatus[]; /** Full status enumeration. Pass this to `RadarGraphInvokeInput.statuses` to restore pre-Issue-3 (unfiltered) behavior. */ export declare const ALL_OPPORTUNITY_STATUSES: OpportunityStatus[]; /** Pure cache policy for presenter cards; degraded current-request copy retries later. */ export declare function isRadarPresentationCacheable(card: Pick, status: OpportunityStatus | undefined): boolean; /** * Strip leading narrator name from remark when the UI already prepends "Name: " to the chip. * Avoids duplication like "Yankı Ekin Yüksel: Yankı Ekin Yüksel introduced you two..." * Repeats until no leading name (handles "Name: Name rest"). */ export declare function stripLeadingNarratorName(remark: string, narratorName: string): string; export declare class RadarGraphFactory { private database; private cache; constructor(database: RadarGraphDb, cache: OpportunityCache); createGraph(): import("@langchain/langgraph").CompiledStateGraph<{ userId: string; networkId: string | undefined; scopeType: "intent" | undefined; scopeId: string | undefined; limit: number; noCache: boolean; presentation: "full" | "skeleton"; statuses: OpportunityStatus[] | undefined; opportunities: import("../../shared/interfaces/database.interface.js").Opportunity[]; cards: RadarCardItem[]; items: RadarResponseItem[]; cachedCards: Map; uncachedOpportunities: import("../../shared/interfaces/database.interface.js").Opportunity[]; error: string | undefined; meta: { totalOpportunities: number; }; agentTimings: DebugMetaAgent[]; }, { userId?: string | import("@langchain/langgraph").OverwriteValue | undefined; networkId?: string | import("@langchain/langgraph").OverwriteValue | undefined; scopeType?: "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined; scopeId?: string | import("@langchain/langgraph").OverwriteValue | undefined; limit?: number | import("@langchain/langgraph").OverwriteValue | undefined; noCache?: boolean | import("@langchain/langgraph").OverwriteValue | undefined; presentation?: "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton"> | undefined; statuses?: OpportunityStatus[] | import("@langchain/langgraph").OverwriteValue | undefined; opportunities?: import("../../shared/interfaces/database.interface.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue | undefined; cards?: RadarCardItem[] | import("@langchain/langgraph").OverwriteValue | undefined; items?: RadarResponseItem[] | import("@langchain/langgraph").OverwriteValue | undefined; cachedCards?: Map | import("@langchain/langgraph").OverwriteValue> | undefined; uncachedOpportunities?: import("../../shared/interfaces/database.interface.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue | undefined; error?: string | import("@langchain/langgraph").OverwriteValue | undefined; meta?: { totalOpportunities: number; } | import("@langchain/langgraph").OverwriteValue<{ totalOpportunities: number; }> | undefined; agentTimings?: DebugMetaAgent[] | import("@langchain/langgraph").OverwriteValue | undefined; }, "__start__" | "loadOpportunities" | "checkPresenterCache" | "generateCardText" | "cachePresenterResults" | "normalizeItems", { userId: import("@langchain/langgraph").BaseChannel, unknown>; networkId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; scopeType: import("@langchain/langgraph").BaseChannel<"intent" | undefined, "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined, unknown>; scopeId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; limit: import("@langchain/langgraph").BaseChannel, unknown>; noCache: import("@langchain/langgraph").BaseChannel, unknown>; presentation: import("@langchain/langgraph").BaseChannel<"full" | "skeleton", "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton">, unknown>; statuses: import("@langchain/langgraph").BaseChannel | undefined, unknown>; opportunities: import("@langchain/langgraph").BaseChannel, unknown>; cards: import("@langchain/langgraph").BaseChannel, unknown>; items: import("@langchain/langgraph").BaseChannel, unknown>; cachedCards: import("@langchain/langgraph").BaseChannel, Map | import("@langchain/langgraph").OverwriteValue>, unknown>; uncachedOpportunities: import("@langchain/langgraph").BaseChannel, unknown>; error: import("@langchain/langgraph").BaseChannel | undefined, unknown>; meta: import("@langchain/langgraph").BaseChannel<{ totalOpportunities: number; }, { totalOpportunities: number; } | import("@langchain/langgraph").OverwriteValue<{ totalOpportunities: number; }>, unknown>; agentTimings: import("@langchain/langgraph").BaseChannel, unknown>; }, { userId: import("@langchain/langgraph").BaseChannel, unknown>; networkId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; scopeType: import("@langchain/langgraph").BaseChannel<"intent" | undefined, "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined, unknown>; scopeId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; limit: import("@langchain/langgraph").BaseChannel, unknown>; noCache: import("@langchain/langgraph").BaseChannel, unknown>; presentation: import("@langchain/langgraph").BaseChannel<"full" | "skeleton", "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton">, unknown>; statuses: import("@langchain/langgraph").BaseChannel | undefined, unknown>; opportunities: import("@langchain/langgraph").BaseChannel, unknown>; cards: import("@langchain/langgraph").BaseChannel, unknown>; items: import("@langchain/langgraph").BaseChannel, unknown>; cachedCards: import("@langchain/langgraph").BaseChannel, Map | import("@langchain/langgraph").OverwriteValue>, unknown>; uncachedOpportunities: import("@langchain/langgraph").BaseChannel, unknown>; error: import("@langchain/langgraph").BaseChannel | undefined, unknown>; meta: import("@langchain/langgraph").BaseChannel<{ totalOpportunities: number; }, { totalOpportunities: number; } | import("@langchain/langgraph").OverwriteValue<{ totalOpportunities: number; }>, unknown>; agentTimings: import("@langchain/langgraph").BaseChannel, unknown>; }, import("@langchain/langgraph").StateDefinition, { loadOpportunities: { error: string; opportunities?: undefined; } | { opportunities: import("../../shared/interfaces/database.interface.js").Opportunity[]; error?: undefined; } | { error: string; opportunities: never[]; }; checkPresenterCache: { cachedCards: Map; uncachedOpportunities: import("../../shared/interfaces/database.interface.js").Opportunity[]; }; generateCardText: { cards: RadarCardItem[]; agentTimings: DebugMetaAgent[]; meta: { totalOpportunities: number; }; }; cachePresenterResults: { cards: RadarCardItem[]; meta: { totalOpportunities: number; }; }; normalizeItems: { items: RadarResponseItem[]; meta: { totalOpportunities: number; }; }; }, unknown, unknown, []>; } export {};