@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
35 lines • 1.63 kB
TypeScript
import type { ContextEvent, ExtensionContext } from "../../types.ts";
import { type ContextReductionState } from "./context-reduction-state.ts";
import { type EmergencyPruneLatch } from "./speculative.ts";
export { createContextReductionState, readContextReductionState } from "./context-reduction-state.ts";
export declare function buildCompactionContext(input: {
event: ContextEvent;
ctx: ExtensionContext;
contextWindow: number;
/**
* Context window minus the model's output reserve. The emergency prune budgets against the
* space a request can actually occupy, so it must not see the full window.
*/
promptContextWindow: number;
toolAdmissionEnabled: boolean;
breakerFallback: boolean;
laneOwnsCompaction: boolean;
contextReductionState?: ContextReductionState;
contextOverheadTokens?: number;
contextReductionBlockBudgetRatio?: number;
/** The smaller of the compaction threshold and the reserved prompt budget. */
reductionCeilingTokens?: number;
/**
* The lane replays into a resident transcript that only accepts appends, so no per-turn reduction
* runs, including the breaker fallback: a rewrite of an already-sent message diverges it.
*/
appendOnlyTranscript?: boolean;
emergencyPruneLatch: EmergencyPruneLatch;
/** Emits the compaction log event for a real emergency prune at its one true site. */
logEmergencyPrune?: (fields: {
route: string;
tokensBefore: number;
tokens: number;
}) => void;
}): import("@earendil-works/pi-ai").Message[];
//# sourceMappingURL=context-pipeline.d.ts.map