import type { Agent } from "@caupulican/pi-agent-core/agent"; import type { CompactionController } from "./compaction-controller.ts"; import type { ProviderRequestContextController } from "./provider-request-context-controller.ts"; export interface ProviderRequestRuntimeControllerDeps { agent: Agent; compaction: Pick; context: ProviderRequestContextController; admitGoalRequest(): number | undefined; /** * True once the goal owning the currently held execution lease crossed its token budget from * charging the response just received. Checked before EVERY provider request (including a * multi-step tool-loop follow-up); returning true ends the loop gracefully after the current * turn's in-flight work completes, instead of letting a doomed request reach admission and throw. */ shouldStopGoalExecutionAfterTurn(): boolean; } /** Installs and owns the one provider planning/admission hook generation on an Agent. */ export declare class ProviderRequestRuntimeController { private readonly deps; private previousTransformContext; private previousPlanContext; private previousAdmission; private previousShouldStopAfterTurn; private installedTransformContext; private installedPlanContext; private installedAdmission; private installedShouldStopAfterTurn; private pendingSentEnvelope; private usageEnvelopeAnchor; constructor(deps: ProviderRequestRuntimeControllerDeps); private modelKey; /** * A provider usage sample already includes the system/tool envelope of the request that produced * it. Reuse that authoritative same-model total and charge only the envelope change plus trailing * conversation. A resumed or restored controller treats the current envelope as the baseline; * first requests and model switches retain the conservative full-payload fallback. */ private estimateRequestTokens; private recordSentEnvelope; install(): void; dispose(): void; } //# sourceMappingURL=provider-request-runtime-controller.d.ts.map