import type { ConversationManager } from './conversation.js'; import type { ConfigManager } from '../config/manager.js'; import type { ModelDefinition, ProviderRegistry } from '../providers/registry.js'; import type { SessionMemoryStore } from './session-memory.js'; import type { SessionLineageTracker } from './session-lineage.js'; import type { AgentManager } from '../tools/agent/index.js'; import type { WrfcController } from '../agents/wrfc-controller.js'; import type { ExecutionPlanManager } from './execution-plan.js'; import type { RuntimeEventBus } from '../runtime/events/index.js'; import type { HookEvent, HookResult } from '../hooks/types.js'; import type { CompactionStrategyChoice } from './compaction-types.js'; type HookDispatcherLike = { fire(event: HookEvent): Promise; }; type EmitterContextFactory = (turnId: string) => import('../runtime/emitters/index.js').EmitterContext; type CatalogTier = 'free' | 'paid' | 'subscription'; /** * Set when the model/provider itself reported context exhaustion on a response * (see isContextOverflowSignal). Forces compaction at the next opportunity, * regardless of locally estimated usage and even when the percentage threshold * is disabled, the provider's own report is authoritative over estimates, * matching how the reactive strategy treats prompt-too-long errors. */ export type ModelContextWarning = { provider: string; model: string; providerStopReason?: string | undefined; }; export type PreflightDeps = { conversation: ConversationManager; requestRender: () => void; hookDispatcher: HookDispatcherLike | null; configManager: Pick; providerRegistry: ProviderRegistry; sessionLineageTracker: Pick; sessionId: string; agentManager: Pick; wrfcController: Pick; planManager: Pick | null; sessionMemoryStore: Pick | null; runtimeBus: RuntimeEventBus | null; emitterContext: EmitterContextFactory; isCompacting: boolean; setIsCompacting: (value: boolean) => void; modelContextWarning?: ModelContextWarning | null | undefined; clearModelContextWarning?: (() => void) | undefined; getSystemPrompt?: (() => string) | undefined; getActiveSkillFrontmatter?: (() => string | null | undefined) | undefined; getCompactionStrategy?: (() => CompactionStrategyChoice) | undefined; }; export declare function checkContextWindowPreflight(deps: PreflightDeps, turnId: string, model: ModelDefinition): Promise<'ok' | 'compacted' | 'error'>; export declare function emitContextOverflowError(conversation: { addSystemMessage: (message: string) => void; }, requestRender: () => void, _turnId: string, estimatedTokens: number, contextWindow: number, modelDisplayName: string, providerRegistry: Pick, tier?: CatalogTier): void; export type PostTurnContextDeps = { conversation: ConversationManager; agentManager: Pick; wrfcController: Pick; planManager: Pick | null; sessionMemoryStore: Pick | null; runtimeBus: RuntimeEventBus | null; emitterContext: EmitterContextFactory; hookDispatcher: HookDispatcherLike | null; configManager: Pick; providerRegistry: ProviderRegistry; sessionLineageTracker: Pick; sessionId: string; requestRender: () => void; isCompacting: boolean; setIsCompacting: (value: boolean) => void; lastWarningBracket: number; setLastWarningBracket: (value: number) => void; modelContextWarning?: ModelContextWarning | null | undefined; clearModelContextWarning?: (() => void) | undefined; getSystemPrompt?: (() => string) | undefined; getActiveSkillFrontmatter?: (() => string | null | undefined) | undefined; }; export declare function handlePostTurnContextMaintenance(deps: PostTurnContextDeps, turnId: string, totalTokens: number): Promise; export {}; //# sourceMappingURL=orchestrator-context-runtime.d.ts.map