import type { Agent, ToolHost } from "@earendil-works/pi-agent-core";
import type { PromptSurface } from "../../core/dynamic-prompt/build.ts";
import { type HandedPageSession } from "./handed-pages.ts";
/** The brain session whose transcript a hand's pages join. */
export interface HandPageBudgetSession {
    /** Its runs: when one ends, every page it handed is recorded or never will be. */
    readonly agent: Pick<Agent, "subscribe">;
    readonly sessionManager: HandedPageSession;
    readonly promptSurface: PromptSurface;
}
/**
 * A hand (brain/hand split) runs show_html_page without the session's transcript, so it holds a page to the per-page
 * cap alone. This wraps the brain's ToolHost for that hand and applies the session's page budget to each page the hand
 * hands back, before its result is emitted or recorded: a page over the budget is handed as written, its own text saying
 * so, and whatever the hand's `tool_result` handlers added stays (senpi#6921, senpi#6928). The wrapper holds the pages it
 * let through until they are recorded; it empties that ledger when a run of the session ends, as the extension does with
 * its own, and `close` ends it with the session's link to the hand (senpi#6932).
 */
export declare function withHandPageBudget(host: ToolHost & {
    close(): void;
}, session: HandPageBudgetSession): ToolHost & {
    close(): void;
};
//# sourceMappingURL=hand-page-budget.d.ts.map