/** * [WHO]: synthesizeSmartRecap(), buildRecapContext(), hasMeaningfulActivity(), SynthesizeResult * [FROM]: Depends on ./recap-budget, ./recap-extractor (walkSessionActivity), ./recap-types, core/extensions-host/types for ExtensionCommandContext + CompletionResult * [TO]: Consumed by extensions/builtin/recap/index.ts * [HERE]: extensions/builtin/recap/recap-synthesizer.ts - Smart Recap synthesis: builds prompt from session, runs completeSimpleWithUsage, enforces per-call budget */ import type { CompletionResult, ExtensionCommandContext } from "../../../core/extensions-host/types.js"; import type { RecapSettings, RecapTriggerReason } from "./recap-types.js"; interface RecapContext { prompt: string; userTurns: number; assistantTurns: number; toolCalls: number; } /** * Build the user-side payload fed to the synthesis model. Tight by design: * we walk the session and take only the most recent N message turns + a tail * of tool names. Tool *results* are intentionally excluded because their bulk * eats the per-call input budget without adding facts the recap needs. Returns * activity counts alongside the prompt so callers can short-circuit before * spending tokens on an empty session. * * Tool counts come from walkSessionActivity() so Free and Smart see the same * tool view (assistant content blocks with type === "toolCall"). */ export declare function buildRecapContext(ctx: ExtensionCommandContext): RecapContext; /** * Cheap pre-check the command handler can run before showing "Synthesizing * recap…" so empty sessions don't see a misleading progress notify. */ export declare function hasMeaningfulActivity(ctx: ExtensionCommandContext): boolean; export type SynthesizeResult = { kind: "ok"; completion: CompletionResult; } | { kind: "empty_session"; } | { kind: "budget_blocked"; reason: string; estimatedInputTokens: number; } | { kind: "no_model"; } | { kind: "no_response"; }; /** * Run the Smart recap. M1 enforces the per-call input cap before calling the * model and surfaces the real `usage` from the provider on success. */ export declare function synthesizeSmartRecap(ctx: ExtensionCommandContext, settings: RecapSettings, _trigger: RecapTriggerReason): Promise; export {};