import type { Tool } from '../../types/tools.js'; import type { TurnInjectionRecord } from '../../agents/turn-knowledge-injection.js'; /** Measured + configured token state for the bound session. */ export interface ContextTokenState { /** Provider-reported (MEASURED) cumulative token usage for the session. */ readonly measured: { readonly input: number; readonly output: number; readonly cacheRead: number; readonly cacheWrite: number; }; /** MEASURED tokens the last request actually put in the context window (incl. cache). */ readonly lastInputTokens: number; /** The active model's configured context window, or null when unknown. */ readonly contextWindow: number | null; } /** * A reader onto ONE session's live context state. The interactive Orchestrator * binds itself as the source; the tool never fabricates, an unbound tool says * so rather than inventing an accounting. */ export interface ContextAccountingSource { /** A human-readable scope label so the model knows WHOSE context this is. */ readonly scope: string; readonly sessionId?: string | undefined; /** The bounded ring of per-turn passive-injection honesty records. */ getTurnInjections(): readonly TurnInjectionRecord[]; getTokenState(): ContextTokenState; getCompactionState(): { readonly isCompacting: boolean; readonly compactionCount?: number | undefined; }; } /** * A settable holder for the active context-accounting source. Registered into * the tool roster once (so every consumer inherits the tool); the interactive * session binds its Orchestrator-backed source after construction. Unbound → the * tool reports honestly that no live session context is available. */ export declare class ContextAccountingHolder { private source; setSource(source: ContextAccountingSource | null): void; getSource(): ContextAccountingSource | null; } /** * Build the context_accounting tool bound to a source holder. Read-only. */ export declare function createContextAccountingTool(holder: ContextAccountingHolder): Tool; //# sourceMappingURL=index.d.ts.map