import { type PersistedSkillNote } from './skillNotesWriter';
export type AnalysisPathMode = 'full' | 'quick' | 'retry';
export declare const FULL_PATH_TOTAL_TOKENS = 1500;
export declare const FULL_PATH_PER_SKILL_TOKENS = 200;
export declare const QUICK_PATH_DEFAULT_TOTAL_TOKENS = 0;
export declare const QUICK_PATH_MAX_TOTAL_TOKENS = 100;
/**
 * Conservative token estimator: 3 chars/token favours English; the budget
 * intentionally errs short for Chinese which averages 1.5 char/token. The
 * exact ratio doesn't matter as long as it's stable — we want to *under*
 * inject when the agent is mid-context-pressure, not blow the budget.
 */
declare function estimateTokens(text: string): number;
export interface BudgetSnapshot {
    mode: AnalysisPathMode;
    totalCap: number;
    perSkillCap: number;
    totalUsed: number;
    injectedSkillIds: string[];
    droppedReasons: {
        skillId: string;
        reason: string;
    }[];
}
/**
 * Per-analysis budget state. Construct once per `analyze()` call and pass
 * the same instance to every invoke_skill so the running totals stay
 * consistent.
 */
export declare class SkillNotesBudget {
    private totalUsed;
    private readonly injected;
    private readonly dropped;
    readonly mode: AnalysisPathMode;
    readonly totalCap: number;
    readonly perSkillCap: number;
    constructor(opts: {
        mode: AnalysisPathMode;
        quickOverrideTotal?: number;
    });
    /**
     * Best-effort note injection. Returns the rendered text + tokens consumed,
     * or `null` if the budget rejected the request. Calling twice for the same
     * `skillId` within the same analysis returns null on the second call (we
     * don't want to inject the same notes twice).
     */
    tryConsume(skillId: string, candidates: ReadonlyArray<PersistedSkillNote>, now?: number): {
        text: string;
        tokensUsed: number;
    } | null;
    snapshot(): BudgetSnapshot;
}
declare function renderNote(note: PersistedSkillNote): string;
export interface NoteSourceOptions {
    /** Override for tests. */
    runtimeDir?: string;
    curatedDir?: string;
}
/**
 * Load curated + runtime notes for a skill. Curated entries are listed first
 * so they take precedence under tight budgets.
 */
export declare function loadSkillNotes(skillId: string, opts?: NoteSourceOptions): PersistedSkillNote[];
export declare const __testing: {
    estimateTokens: typeof estimateTokens;
    renderNote: typeof renderNote;
    DEFAULT_RUNTIME_NOTES_DIR: string;
    DEFAULT_CURATED_NOTES_DIR: string;
};
export {};
//# sourceMappingURL=skillNotesInjector.d.ts.map