import { SettingsManager, type ExtensionContext } from "@earendil-works/pi-coding-agent"; import { type PiContextSettings } from "../settings.js"; export type ResolvedThresholds = { reminder: number; reserve: number; warning: number; }; /** * Pure derivation of the thresholds from Pi's reserve: the reminder fires at reserve * plus the pi-context margin, the warning steer at reserve plus WARNING_RUNWAY_TOKENS. * An invalid margin degrades to the default and reports one warning. Automatic * threshold/overflow handling is represented by reset lifecycle boundary drafts; * no compaction summary is generated. */ export declare function deriveThresholds(reserveTokens: number, margins: PiContextSettings): { thresholds: ResolvedThresholds; warnings: string[]; }; /** * Read the active compaction reserve, enablement, and pi-context margin settings. This * function deliberately has no cache: the budget owner supplies the invocation-scoped * cache so two live piContext instances cannot share mutable policy state. */ export type ThresholdSettingsResolution = { thresholds: ResolvedThresholds; automatic: boolean; warnings: string[]; }; /** * Resolve policy from either the explicitly supplied SDK authority or Pi's default * file-backed settings. The caller owns diagnostics and any lifecycle caching. */ export declare function readThresholdSettings(ctx: ExtensionContext, settingsManager?: SettingsManager): ThresholdSettingsResolution;