import type { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { type CompletionAdapter } from "adminforth";
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
import type { LLMResult } from "@langchain/core/outputs";
import type { Messages, Command } from "@langchain/langgraph";
import { createSequenceDebugMiddleware } from "./middleware/sequenceDebug.js";
import type { AgentModelPurpose } from "../application/ports.js";
import type { AgentTurnContext, AgentTurnObservability } from "../domain/turnTypes.js";
export type { AgentModeCompletionAdapter, AgentModelPurpose } from "../application/ports.js";
export type AgentChatModel = BaseChatModel<any, any>;
export type AgentMiddleware = ReturnType<typeof createSequenceDebugMiddleware>;
export type AgentTurnModels = {
    model: AgentChatModel;
    summaryModel: AgentChatModel;
    modelMiddleware?: AgentMiddleware[];
};
export type AgentRuntimeRunInput = {
    models: AgentTurnModels;
    input: {
        messages: Messages;
    } | Command;
    context: AgentTurnContext;
    observability: AgentTurnObservability;
    branchFromCheckpointId?: string;
};
type AgentChatModelSpec = {
    model: AgentChatModel;
    middleware: AgentMiddleware[];
};
declare class AgentLlmMetricsLogger extends BaseCallbackHandler {
    name: string;
    lc_prefer_streaming: boolean;
    private readonly pendingRuns;
    handleLLMStart(_llm: unknown, _prompts: string[], runId: string): Promise<void>;
    handleLLMEnd(_output: LLMResult, runId: string): Promise<void>;
    handleLLMError(_error: unknown, runId: string): Promise<void>;
}
export declare function createAgentLlmMetricsLogger(): AgentLlmMetricsLogger;
export declare function createAgentChatModel(params: {
    adapter: CompletionAdapter;
    maxTokens: number;
    purpose: AgentModelPurpose;
}): Promise<AgentChatModelSpec>;
