import type { AgentProfile } from '@tangle-network/agent-interface';
import type { MatrixResult } from '../matrix';
import { type JudgeConfig, type JudgeScore } from './judges';
import type { MultishotArtifact, MultishotMessage, MultishotPersona, MultishotShape, MultishotToolDefinition, MultishotToolExecutor } from './types';
export interface ConversationJudgeInput<TPersona extends MultishotPersona> {
    transcript: MultishotMessage[];
    persona: TPersona;
}
export interface ArtifactJudgeInput<TPersona extends MultishotPersona> {
    artifact: MultishotArtifact;
    persona: TPersona;
}
export interface MultishotJudges<TPersona extends MultishotPersona> {
    /** Scores the full transcript end-to-end (always runs). */
    conversation: JudgeConfig<ConversationJudgeInput<TPersona>>;
    /** Scores each code-type artifact. Optional — omit when domain has no code artifacts. */
    codeReview?: JudgeConfig<ArtifactJudgeInput<TPersona>>;
    /** Scores each non-code (research/content/template) artifact. Optional. */
    contentQuality?: JudgeConfig<ArtifactJudgeInput<TPersona>>;
    /** Which artifact types route to codeReview. Defaults to ['code']. */
    codeArtifactTypes?: string[];
    /** Which artifact types route to contentQuality. Defaults to ['research']. */
    contentArtifactTypes?: string[];
}
export interface CellCompositeScore {
    composite: number;
    conversation: JudgeScore;
    codeReview?: {
        perArtifact: Array<JudgeScore & {
            turn: number;
            type: string;
        }>;
        composite: number;
    };
    contentQuality?: {
        perArtifact: Array<JudgeScore & {
            turn: number;
            type: string;
        }>;
        composite: number;
    };
}
export interface RunMultishotMatrixOptions<TPersona extends MultishotPersona> {
    /** AgentProfile axis (matrix primary). */
    profiles: Array<{
        id: string;
        value: AgentProfile;
    }>;
    /** Persona axis. */
    personas: TPersona[];
    /** Persona-shaping callbacks. */
    shape: MultishotShape<TPersona>;
    /** Judge configurations. */
    judges: MultishotJudges<TPersona>;
    /** Tool definitions advertised to the agent. Defaults to delegate_research + delegate_code. */
    tools?: MultishotToolDefinition[];
    /** Map from tool name → inline executor. Must align with `tools`. */
    toolExecutors?: Record<string, MultishotToolExecutor>;
    /** Tool name → artifact type label. Defaults to research/code mapping. */
    artifactTypeFor?: (toolName: string) => string | undefined;
    /** Where per-cell artifacts land. Cells write to `<runDir>/<profileId>/<personaId>/rep-N/`. */
    runDir: string;
    /** Replicates per (profile, persona) cell. */
    reps?: number;
    /** Max conversation turns per cell. */
    maxTurns?: number;
    /** Max concurrent cells. */
    maxConcurrency?: number;
    /** Total $ ceiling across the matrix; cells aborted past this. */
    costCeiling?: number;
    /** Agent model. */
    agentModel?: string;
    /** Driver model. */
    driverModel?: string;
    /** Pass-thru fields. */
    apiKey?: string;
    baseUrl?: string;
}
interface CellOutput {
    turns: number;
    toolCalls: number;
    artifactCount: number;
}
export interface CellCompositeInput {
    conversation: JudgeScore;
    /** Present iff the codeReview judge is configured. */
    codeReviews?: ReadonlyArray<JudgeScore>;
    /** Present iff the contentQuality judge is configured. */
    contentReviews?: ReadonlyArray<JudgeScore>;
}
/** Cell composite = mean over configured judge slots, excluding failed
 *  scores: a failed conversation judge or an all-failed artifact slot carries
 *  no signal and is dropped from the mean. `composite` is 0 only when EVERY
 *  configured slot failed (`allJudgesFailed` distinguishes that from a real
 *  zero). Pure — exported for deterministic testing. */
export declare function computeCellComposite(input: CellCompositeInput): {
    composite: number;
    codeComposite: number;
    contentComposite: number;
    allJudgesFailed: boolean;
};
export interface RunMultishotMatrixResult {
    matrix: MatrixResult<CellOutput>;
}
export declare function runMultishotMatrix<TPersona extends MultishotPersona>(opts: RunMultishotMatrixOptions<TPersona>): Promise<RunMultishotMatrixResult>;
export {};
//# sourceMappingURL=matrix.d.ts.map