import { ToolRegistry } from '../tools/registry.js';
import type { ProviderRegistry } from '../providers/registry.js';
import type { ModelDefinition } from '../providers/registry-types.js';
import type { ProviderOptimizer } from '../providers/optimizer.js';
import type { AgentRecord } from '../tools/agent/index.js';
import type { LLMProvider } from '../providers/interface.js';
import type { ProcessManager } from '../tools/shared/process-manager.js';
import type { FeatureFlagManager } from '../runtime/feature-flags/manager.js';
import type { RuntimeEventBus } from '../runtime/events/index.js';
import type { AgentMessageBus } from './message-bus.js';
import type { KnowledgeService } from '../knowledge/index.js';
type EmitterContext = import('../runtime/emitters/index.js').EmitterContext;
export interface AgentOrchestratorRunContext {
    readonly workingDirectory: string;
    readonly surfaceRoot?: string | undefined;
    readonly runtimeBus: RuntimeEventBus | null;
    readonly featureFlagManager: FeatureFlagManager | null;
    readonly emitterContext: (agentId: string) => EmitterContext;
    readonly emitAgentProgress: (recordId: string, progress: string) => void;
    readonly emitOrchestrationProgress: (record: AgentRecord, progress: string) => void;
    readonly emitAgentStarted: (recordId: string) => void;
    readonly emitAgentCancelledEvent: (recordId: string, reason: string) => void;
    readonly emitOrchestrationCancelled: (record: AgentRecord, reason: string) => void;
    readonly emitAgentFailedEvent: (recordId: string, error: string, durationMs: number) => void;
    readonly emitOrchestrationFailed: (record: AgentRecord, error: string) => void;
    readonly emitAgentCompletedEvent: (recordId: string, durationMs: number, output: string, toolCallsMade: number) => void;
    readonly emitOrchestrationCompleted: (record: AgentRecord, output: string) => void;
    readonly emitStreamDelta: (recordId: string, content: string, accumulated: string) => void;
    readonly processManager?: ProcessManager | undefined;
    readonly messageBus: Pick<AgentMessageBus, 'getMessages'>;
    readonly knowledgeService?: Pick<KnowledgeService, 'buildPromptPacketSync'> | undefined;
    readonly memoryRegistry?: Pick<import('../state/index.js').MemoryRegistry, 'getAll' | 'searchSemantic'> | undefined;
    readonly archetypeLoader?: {
        loadArchetype(template: string): {
            systemPrompt?: string | undefined;
        } | null | undefined;
    } | undefined;
    readonly getFullRegistry: () => ToolRegistry;
    readonly buildScopedRegistry: (allowedNames: string[], fullRegistry: ToolRegistry) => ToolRegistry;
    readonly providerRegistry: Pick<ProviderRegistry, 'getCurrentModel' | 'getForModel' | 'listModels' | 'getContextWindowForModel'>;
    readonly providerOptimizer?: Pick<ProviderOptimizer, 'recordFallbackTransition'> | undefined;
    readonly resolveProviderForRecord: (providerRegistry: Pick<ProviderRegistry, 'getCurrentModel' | 'getForModel' | 'listModels'>, record: AgentRecord, currentModel: {
        id: string;
        provider: string;
        registryKey: string;
    }) => {
        provider: LLMProvider;
        modelId: string;
        requestedModelId: string;
    };
    readonly resolveFallbackModelRoutes: (providerRegistry: Pick<ProviderRegistry, 'listModels' | 'getForModel'>, record: AgentRecord, currentModel: {
        id: string;
        provider: string;
        registryKey: string;
    }, primaryRequestedModelId: string) => Array<{
        provider: LLMProvider;
        modelId: string;
        requestedModelId: string;
    }>;
}
type ActiveProviderRoute = {
    readonly provider: Pick<LLMProvider, 'name'>;
    readonly modelId: string;
    readonly requestedModelId: string;
};
export declare function resolveContextWindowModelDefinition(providerRegistry: Pick<ProviderRegistry, 'getCurrentModel' | 'listModels'>, activeRoute: ActiveProviderRoute): ModelDefinition;
export declare function runAgentTask(context: AgentOrchestratorRunContext, record: AgentRecord): Promise<void>;
export {};
//# sourceMappingURL=orchestrator-runner.d.ts.map