@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
27 lines • 1.39 kB
TypeScript
/**
* Always-on admission cap for tool results.
*
* Oversized tool output is the dominant driver of single-step context bursts, so it is
* projected to a deterministic head/tail excerpt at the entrance instead of waiting for
* an emergency/compaction-budget pass (see `tool-truncation.ts`). Admission is derived
* from the supplied text on every request; model-visible marker text is never state.
*/
export declare const TOOL_ADMISSION_MARKER_PREFIX = "[tool result projected:";
export interface AdmitToolResultInput {
readonly text: string;
readonly contextWindow: number;
}
export interface AdmitToolResultOutput {
readonly text: string;
readonly projected: boolean;
}
/** Token budget a single tool result may occupy before it is projected. */
export declare function resolveToolResultAdmissionCapTokens(contextWindow: number): number;
/**
* Cap a tool result at admission time. Under-cap text passes through untouched; over-cap
* text becomes a deterministic, diskless head/tail projection. Re-evaluating projected
* text under a smaller model window is safe because admission never trusts marker text.
*/
export declare function admitToolResultWithinBudget(text: string, budgetTokens: number): AdmitToolResultOutput;
export declare function admitToolResult(input: AdmitToolResultInput): AdmitToolResultOutput;
//# sourceMappingURL=tool-admission.d.ts.map