/**
 * Simulation Renderers — Pure rendering functions
 *
 * PURPOSE: Transform raw agent responses into structured artifact content.
 * No I/O, no side effects, no external calls.
 *
 * FORBIDDEN:
 * - External API calls
 * - State mutation
 *
 * EXCEPTION (ADR-PIPELINE-066): renderFinancialAnalysis may read
 * `<runDir>/unit-economics.json` via the loader module to prefer prototype
 * unit economics over per-employee heuristics. The loader is the single
 * permitted I/O path and never throws.
 */
import { type LaborProfile } from './domain-labor-classifier.js';
export interface AgentResult {
    domain: string;
    agent: string;
    status: number;
    response: unknown;
}
interface SignalPayload {
    type?: string;
    data?: Record<string, unknown>;
}
/** Summarize agent fleet metrics for reporting. */
export declare function computeFleetMetrics(results: AgentResult[]): {
    totalInvoked: number;
    successful: number;
    failed: number;
    domainBreakdown: Record<string, {
        success: number;
        fail: number;
        agents: string[];
    }>;
};
export declare function extractSignalPayload(response: unknown): SignalPayload;
interface FinancialData {
    budget: string;
    roi: string;
    npv: string;
    payback: string;
    revenue: string;
    costSavings: string;
    hasData: boolean;
    isEstimated: boolean;
}
/**
 * ADR-PIPELINE-026: Synthesize financial data from ALL sources:
 * 1. Simulation engine result (simData)
 * 2. Agent results (planner, what-if, scenario, decision, costops)
 * 3. Query-based estimates as last resort
 * Documents should NEVER say "To be quantified".
 */
export interface DomainAnalysis {
    domain: string;
    keyMetrics: Record<string, number | string>;
    scenarios: Array<{
        name: string;
        capex: number;
        annualSavings: number;
        paybackYears: number;
    }>;
    confidence: number;
    methodology: string;
}
/**
 * ADR-PIPELINE-041: Extract or generate domain_analysis from simulation data.
 * If ruvector produced domain_analysis, use it. Otherwise, generate it from
 * the query using the same logic as tryDomainSpecificFinancials().
 * This bridges the gap until ruvector produces real domain analysis.
 */
export declare function extractDomainAnalysis(simData: Record<string, unknown>, query: string): DomainAnalysis | null;
/**
 * Enrich the raw ruvector simulation result with domain-specific analysis.
 * Call this ONCE after Phase 1 completes, before any renderer consumes simData.
 *
 * Injects: domain_analysis, enriched success probability, scenario projections.
 * Transparent: marks all enriched fields with _source so original data is preserved.
 *
 * If ruvector already produced domain_analysis, it's kept as-is (no override).
 */
export declare function enrichSimulationResult(simData: Record<string, unknown>, query: string): Record<string, unknown>;
export declare function synthesizeFinancials(simData: Record<string, unknown>, platformResults: AgentResult[], query: string): FinancialData;
export { synthesizeFinancials as extractFinancials };
/**
 * ADR-PIPELINE-040: Two-pass executive document rendering.
 * Pass 1 (already done): template engine generates structured skeleton with data.
 * Pass 2 (this function): LLM rewrites skeleton into consulting-grade narrative.
 * Falls back to skeleton if LLM unavailable — graceful degradation.
 *
 * @param skeleton - The template-generated markdown document
 * @param query - Original user query for domain context
 * @param documentType - Which document is being synthesized
 * @param agentSummary - Optional condensed agent results for evidence
 */
export declare function synthesizeExecutiveDocument(skeleton: string, query: string, documentType: string, agentSummary?: string): Promise<string>;
export declare function renderExecutiveSummary(query: string, simulationResult: unknown, platformResults: AgentResult[]): string;
export declare function renderDecisionMemo(query: string, simulationResult: unknown, platformResults: AgentResult[]): string;
interface ExtractedScenario {
    scenario_type: string;
    stakeholders: string[];
    constraints: string[];
    success_criteria: string[];
    systems: string[];
    domain_entities: string[];
    capabilities: string[];
}
export declare function buildScenarioArtifact(query: string, simulationResult: unknown, platformResults: AgentResult[]): Record<string, unknown>;
export type MaturityLevel = 'none' | 'manual' | 'rule_based' | 'automated' | 'ai_optimized';
/** A peer firm in the competitive analysis (ADR-PIPELINE-062). */
export interface PeerFirm {
    readonly name: string;
    readonly industry_position: string;
    readonly public_evidence_source: string;
}
/** One row in the capability maturity comparison table. */
export interface CapabilityMaturityRow {
    readonly capability: string;
    readonly current_level: MaturityLevel;
    readonly peer_levels: Readonly<Record<string, MaturityLevel>>;
    readonly post_pilot_level: MaturityLevel;
}
/** Summary of how one capability changes from current to post-pilot. */
export interface GapToCloseItem {
    readonly capability: string;
    readonly from: MaturityLevel;
    readonly to: MaturityLevel;
    readonly levels_jumped: number;
    readonly vs_top_peer: string;
}
/** One named risk of inaction with driver and timeframe. */
export interface RiskOfInaction {
    readonly risk: string;
    readonly driver: string;
    readonly timeframe: string;
}
/** Full competitive analysis block for the executive summary. */
export interface CompetitiveAnalysis {
    readonly peer_firms: readonly PeerFirm[];
    readonly capability_maturity: readonly CapabilityMaturityRow[];
    readonly gap_to_close: readonly GapToCloseItem[];
    readonly risks_of_inaction: readonly RiskOfInaction[];
    readonly sources: readonly string[];
}
/**
 * Build a competitive analysis deterministically from a query + extracted
 * scenario. Used when the LLM doesn't return a `competitive_analysis`
 * field, or for queries that don't flow through the LLM synthesis path.
 *
 * Guarantees (ADR-PIPELINE-062 §4):
 *  - peer_firms are sorted alphabetically
 *  - capability_maturity rows are sorted by worst-current-level first
 *  - deterministic: same (query, scenario_type) produces the same result
 *  - always non-empty: at minimum 3 peers, 4 capability rows, 2 risks
 */
export declare function buildFallbackCompetitiveAnalysis(query: string, extracted: ExtractedScenario): CompetitiveAnalysis;
/** A single quantified criterion within a phase gate (ADR-PIPELINE-061). */
export interface GateCriterion {
    readonly metric: string;
    readonly threshold: string;
    readonly data_source: string;
}
/** A phase gate with criteria, derived decision authority, and go/no-go rule. */
export interface PhaseGate {
    readonly after_phase: string;
    readonly gate: string;
    readonly criteria: GateCriterion[];
    readonly decision_authority: string;
    readonly overall_decision: string;
}
/**
 * Build quantified phase gate criteria driven by the scenario context.
 * Replaces the 3 hardcoded generic gates per ADR-PIPELINE-061.
 *
 * @param query - The original user query (used for regulation detection)
 * @param extracted - Parsed scenario fields
 * @param primarySystem - The primary target system (ERP, platform, etc.)
 */
export declare function buildPhaseGates(query: string, extracted: ExtractedScenario, primarySystem: string): PhaseGate[];
export declare function buildRoadmapArtifact(query: string, simulationResult: unknown, platformResults: AgentResult[]): Record<string, unknown>;
export declare function buildRiskAssessment(query: string, simulationResult: unknown, platformResults: AgentResult[]): Record<string, unknown>;
/** One row in the sensitivity table (ADR-PIPELINE-063). */
export interface SensitivityRow {
    readonly variable: string;
    readonly range: string;
    readonly baselineUsd: number;
    readonly lowCaseUsd: number;
    readonly highCaseUsd: number;
    readonly impactUsd: number;
    readonly impactPercent: number;
    readonly rank: number;
    readonly direction: 'bidirectional' | 'upside_only' | 'downside_only';
}
/**
 * Build the sensitivity table from specs. Returns rows sorted by absolute
 * impact magnitude (rank 1 = biggest driver). Deterministic for a given
 * (baseSavings, scenarioType) pair.
 */
export declare function buildSensitivityTable(baseSavings: number, scenarioType: string, laborProfile?: LaborProfile | null): SensitivityRow[];
export declare function renderFinancialAnalysis(query: string, simulationResult: unknown, platformResults: AgentResult[], runDir?: string | null): string;
export declare function renderSecurityAssessment(query: string, _simulationResult: unknown, platformResults: AgentResult[]): string;
export declare function renderIntegrationAssessment(query: string, _simulationResult: unknown, platformResults: AgentResult[]): string;
export declare function renderAgentFleetReport(query: string, _simulationResult: unknown, platformResults: AgentResult[]): string;
//# sourceMappingURL=simulation-renderers.d.ts.map