import { Tr as AgentMessage } from "../proxy-DpcKE9hN.js";
//#region src/agents/compaction-planning.d.ts
type StageSplitPlan = {
  mode: "single";
} | {
  mode: "split";
  chunks: AgentMessage[][];
};
type OversizedFallbackPlan = {
  smallMessages: AgentMessage[];
  oversizedNotes: string[];
};
type HistoryPrunePlan = {
  summarizableTokens: number;
  newContentTokens: number;
  maxHistoryTokens: number;
  pruned?: ReturnType<typeof pruneHistoryForContextShare>;
};
declare function pruneHistoryForContextShare(params: {
  messages: AgentMessage[];
  maxContextTokens: number;
  maxHistoryShare?: number;
  parts?: number;
  mode?: "share" | "handoff";
}): {
  messages: AgentMessage[];
  droppedMessagesList: AgentMessage[];
  droppedChunks: number;
  droppedMessages: number;
  droppedTokens: number;
  keptTokens: number;
  budgetTokens: number;
};
//#endregion
//#region src/agents/compaction-planning.worker.d.ts
type CompactionPlanningWorkerInput = {
  kind: "summaryChunks";
  messages: AgentMessage[];
  maxChunkTokens: number;
} | {
  kind: "oversizedFallback";
  messages: AgentMessage[];
  contextWindow: number;
} | {
  kind: "stageSplit";
  messages: AgentMessage[];
  maxChunkTokens: number;
  parts?: number;
  minMessagesForSplit?: number;
} | {
  kind: "historyPrune";
  messagesToSummarize: AgentMessage[];
  turnPrefixMessages: AgentMessage[];
  tokensBefore: number;
  contextWindowTokens: number;
  maxHistoryShare: number;
  parts?: number;
} | {
  kind: "adaptiveChunkRatio";
  messages: AgentMessage[];
  contextWindow: number;
};
type CompactionPlanningWorkerValue = {
  kind: "summaryChunks";
  chunks: AgentMessage[][];
} | ({
  kind: "oversizedFallback";
} & OversizedFallbackPlan) | ({
  kind: "stageSplit";
} & StageSplitPlan) | ({
  kind: "historyPrune";
} & HistoryPrunePlan) | {
  kind: "adaptiveChunkRatio";
  ratio: number;
};
type CompactionPlanningWorkerResult = {
  status: "ok";
  value: CompactionPlanningWorkerValue;
} | {
  status: "failed";
  error: string;
};
declare function runCompactionPlanningWorkerInput(input: unknown): CompactionPlanningWorkerResult;
//#endregion
export { CompactionPlanningWorkerInput, CompactionPlanningWorkerResult, CompactionPlanningWorkerValue, runCompactionPlanningWorkerInput };