/** * Context packet — makes interview context selection explicit, scored, and inspectable. * * Every piece of context sent to the question-generation model is decomposed into * atoms tagged with a tier (hot/warm/cold), source, and relevance score. * * Hot: direct evidence for the current interview moment * Warm: session arc + nearby project state * Cold: static ecosystem metadata that usually matters less * * Cold-start is special: project + agent metadata are promoted because they * are the strongest available grounding before any assistant turn exists. */ import type { AgentContextData, ContextPacket, ProjectSnapshot, SessionTopology, TurnContext } from "./types.js"; export interface RankedSkillCandidate { name: string; description: string; matchedTriggers: string[]; score: number; reasoning: string; } export interface InterviewIntelligenceTiers { agentOsTier: string[]; hotContextTier: string[]; warmContextTier: string[]; coldContextTier: string[]; priorInterviewReplay: string[]; matchedSkillCandidates: RankedSkillCandidate[]; } export declare function rankSkillCandidates(turn: TurnContext, agent: AgentContextData | null | undefined, maxItems?: number): RankedSkillCandidate[]; export declare function buildPriorInterviewReplay(recentPriorQuestions?: string[], recentPriorDecisions?: string[]): string[]; export declare function buildInterviewIntelligenceTiers(params: { turn: TurnContext; project?: ProjectSnapshot; agent?: AgentContextData | null; currentStateRefs?: string[]; recentPriorQuestions?: string[]; recentPriorDecisions?: string[]; activeSessionModel?: string; }): InterviewIntelligenceTiers; export declare function safeBuildInterviewIntelligenceTiers(params: { turn: TurnContext; project?: ProjectSnapshot; agent?: AgentContextData | null; currentStateRefs?: string[]; recentPriorQuestions?: string[]; recentPriorDecisions?: string[]; activeSessionModel?: string; }): InterviewIntelligenceTiers; export declare function buildContextPacket(turn: TurnContext, project: ProjectSnapshot | undefined, agent: AgentContextData | null | undefined, model: string, promptChars: number, currentStateRefs?: string[], options?: { sessionTopology?: SessionTopology; systemPromptSummary?: string; recentPriorQuestions?: string[]; recentPriorDecisions?: string[]; }): ContextPacket; /** * Estimate token count from character length (4 chars ≈ 1 token). */ export declare function estimateTokens(chars: number): number; /** * Dynamic token-aware truncation: summarize atoms when total chars exceed maxTokens * 4. * Drops lowest-score cold atoms first, then low-score warm atoms, leaving hot intact. */ export declare function truncateToTokenBudget(packet: ContextPacket, maxTokens: number): ContextPacket; export declare function selectAtoms(packet: ContextPacket, turnText: string, budget?: number): ContextPacket; /** * Compress a context packet for display in constrained terminals. * Collapses low-signal atoms and caps total rendered items. */ export declare function compressPacketForDisplay(packet: ContextPacket, maxAtoms?: number): ContextPacket; export declare function formatContextPacket(packet: ContextPacket): string; //# sourceMappingURL=context-packet.d.ts.map