import type { AgentPipelines } from '../core/agent-types.js'; import type { Context } from '../core/context.js'; import type { EventBus } from '../kernel/events.js'; import { type ContextWindowConfigLike } from '../types/context-window.js'; import { AutoCompactionMiddleware } from './auto-compaction-middleware.js'; /** * Install proactive auto-compaction into a subagent's context-window pipeline. * * Subagents (CLI fleet host, the light webui/SDD factory) build their pipelines * with `createDefaultPipelines()` and historically registered nothing on * `contextWindow`, so they had **no proactive compaction** — they grew until a * provider rejected the request and only then recovered reactively. This wires * the same rule-based `HybridCompactor` + `AutoCompactionMiddleware` the leader * uses, so a subagent shrinks on the warn/soft/hard thresholds (and gets the * last-resort emergency trim) exactly like the leader. * * No custom estimator is passed: the middleware's internal * `estimateRequestTokensCalibrated` default already applies per-(provider,model) * calibration, which is what a subagent wants. Returns the middleware (so the * caller could toggle it) or `undefined` when the provider window is unknown * (0), in which case compaction is skipped rather than guessing a denominator. */ export declare function installSubagentAutoCompaction(pipelines: AgentPipelines, ctx: Context, contextConfig: ContextWindowConfigLike | undefined, events?: EventBus | undefined): AutoCompactionMiddleware | undefined; //# sourceMappingURL=subagent-compaction.d.ts.map