/**
 * Downstream Adapter Module (Module C)
 *
 * SPARC Architecture Reference: §2.4
 *
 * PURPOSE: Invoke external repository APIs with minimal coupling
 *
 * DEPENDENCIES: HTTP Client only
 *
 * FORBIDDEN:
 * - Response Parsing (NO JSON schema validation)
 * - Response Transform (NO field mapping or conversion)
 * - Business Logic (NO conditional handling based on data)
 * - Caching (NO response storage)
 * - Error Recovery (Errors bubble up unchanged)
 */
import type { AdapterRequest, AdapterResponse, HealthStatus, EndpointConfig } from '../types/index.js';
/**
 * Normalized upstream error with human-readable message and optional trace ID.
 */
interface NormalizedUpstreamError {
    message: string;
    upstreamTraceId?: string;
    code?: string;
}
/**
 * Extract a human-readable error message from an upstream error payload.
 * Handles various error response formats and never returns [object Object].
 */
export declare function normalizeUpstreamError(payload: unknown): NormalizedUpstreamError;
/**
 * Safely stringify a value, handling circular references and large objects.
 * Never returns [object Object].
 */
export declare function safeStringify(value: unknown, maxLength?: number): string;
export type { AdapterResponse, EndpointConfig } from '../types/index.js';
export interface IDownstreamAdapter {
    invoke(request: AdapterRequest): Promise<AdapterResponse>;
    health(): Promise<HealthStatus>;
    getEndpointConfig(): EndpointConfig;
}
export declare class BaseAdapter implements IDownstreamAdapter {
    protected readonly config: EndpointConfig;
    protected readonly serviceName: string;
    protected readonly correlationId?: string;
    constructor(options: {
        serviceName: string;
        config: EndpointConfig;
        correlationId?: string;
    });
    invoke(request: AdapterRequest): Promise<AdapterResponse>;
    health(): Promise<HealthStatus>;
    getEndpointConfig(): EndpointConfig;
}
export declare class ManifestsAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    select(criteria: unknown): Promise<AdapterResponse>;
}
export declare class PlannerAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    createPlan(manifestRef: unknown, params: unknown): Promise<AdapterResponse>;
}
export declare class RunnerAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    execute(planRef: unknown, config: unknown): Promise<AdapterResponse>;
}
export declare class IntentAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    resolve(simRef: unknown, spec: unknown): Promise<AdapterResponse>;
}
export declare class ExportersAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    generate(intentRef: unknown, formatSpec: unknown): Promise<AdapterResponse>;
}
export declare class DiligenceAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    package(refs: unknown[], requirements: unknown): Promise<AdapterResponse>;
}
export declare class SimulationEngineAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    inspect(simRef: unknown, outputType: string): Promise<AdapterResponse>;
    getOutputs(simRef: unknown): Promise<AdapterResponse>;
}
export declare class RoiEngineAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    quantify(simRef: unknown, reportType: string, params?: unknown): Promise<AdapterResponse>;
    getSummary(simRef: unknown): Promise<AdapterResponse>;
}
export declare class ResultsIndexAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    /**
     * Query simulation results from the results index.
     * This is a read-only operation using HTTP GET.
     *
     * @param queryParams - Structured query parameters (environment, status, limit, order)
     * @returns AdapterResponse with results array
     */
    query(queryParams: {
        environment?: string;
        status?: string;
        limit?: number;
        order?: 'newest' | 'oldest';
        id?: string;
    }): Promise<AdapterResponse>;
}
/**
 * Ruvector Service Adapter
 *
 * Persistent storage for plans. Plans are generated once by the planner
 * and persisted in Ruvector; inspection is retrieval-only.
 */
export declare class RuvectorAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    /**
     * Store a plan in Ruvector.
     * Persistence is mandatory - failure to persist is a command failure.
     */
    storePlan(plan: {
        id: string;
        type: 'plan';
        intent: string;
        plan: unknown;
        created_at: string;
        org_id: string;
        user_id: string;
        checksum: string;
    }): Promise<AdapterResponse>;
    /**
     * Retrieve a plan by ID from Ruvector.
     * This is retrieval-only - never triggers planning.
     */
    getPlan(planId: string): Promise<AdapterResponse>;
    /**
     * List plans with optional filters.
     */
    listPlans(params?: {
        org_id?: string;
        limit?: number;
        offset?: number;
    }): Promise<AdapterResponse>;
    /**
     * Delete a plan from Ruvector.
     */
    deletePlan(planId: string): Promise<AdapterResponse>;
    /**
     * Store a deployment in Ruvector.
     */
    storeDeployment(deployment: {
        id: string;
        target_id: string;
        environment: string;
        status: string;
        preview: unknown;
        execution: unknown;
        created_at: string;
        updated_at: string;
        version: number;
        metadata?: Record<string, unknown>;
    }): Promise<AdapterResponse>;
    /**
     * Retrieve a deployment by ID from Ruvector.
     */
    getDeployment(deploymentId: string): Promise<AdapterResponse>;
    /**
     * Update a deployment in Ruvector.
     */
    updateDeployment(deploymentId: string, updates: {
        status?: string;
        execution?: unknown;
        updated_at: string;
        version: number;
    }): Promise<AdapterResponse>;
    /**
     * List deployments with optional filters.
     */
    listDeployments(params?: {
        environment?: string;
        status?: string;
        limit?: number;
        offset?: number;
    }): Promise<AdapterResponse>;
    /**
     * Delete a deployment from Ruvector.
     */
    deleteDeployment(deploymentId: string): Promise<AdapterResponse>;
    /**
     * Store a decision record in Ruvector.
     * Used by executive synthesis to persist learning events.
     */
    storeDecision(decision: {
        id: string;
        objective: string;
        command: string;
        raw_output_hash: string;
        recommendation: string;
        confidence: string;
        signals: {
            financial: string;
            risk: string;
            complexity: string;
        };
        embedding_text: string;
        graph_relations: {
            objective_to_repos: string[];
            repos_to_signals: Record<string, string[]>;
            signals_to_recommendation: string[];
        };
        created_at: string;
    }): Promise<AdapterResponse>;
    /**
     * Retrieve a decision by ID from Ruvector.
     */
    getDecision(decisionId: string): Promise<AdapterResponse>;
    /**
     * List decisions with optional filters.
     */
    listDecisions(params?: {
        objective?: string;
        limit?: number;
        offset?: number;
    }): Promise<AdapterResponse>;
    /**
     * Store a simulation memory record in Ruvector.
     * Persistence is mandatory — a simulation without a memory footprint
     * is not a simulation (ADR-004, Invariant 1).
     */
    storeSimulation(simulation: {
        id: string;
        type: 'simulation';
        intent: string;
        intent_description: string;
        status: string;
        result?: unknown;
        attribution: {
            created_by: string;
            org_id: string;
        };
        artifact_ids: string[];
        created_at: string;
        updated_at: string;
        checksum: string;
    }): Promise<AdapterResponse>;
    /**
     * Retrieve a simulation by ID from Ruvector.
     */
    getSimulation(simulationId: string): Promise<AdapterResponse>;
    /**
     * Update a simulation record in Ruvector.
     */
    updateSimulation(simulationId: string, updates: {
        status?: string;
        result?: unknown;
        artifact_ids?: string[];
        updated_at: string;
        checksum: string;
    }): Promise<AdapterResponse>;
    /**
     * List simulations with optional filters.
     */
    listSimulations(params?: {
        org_id?: string;
        status?: string;
        limit?: number;
        offset?: number;
    }): Promise<AdapterResponse>;
    /**
     * Store a lineage record in Ruvector.
     * Every artifact must have a lineage record linking it to a simulation.
     */
    storeLineage(lineage: {
        id: string;
        artifact_id: string;
        artifact_category: string;
        simulation_id: string;
        plan_id?: string;
        decision_context: string;
        attribution: {
            created_by: string;
            org_id: string;
        };
        governance: {
            gate_pipeline_version: string;
            synthesis_classification: string;
        };
        created_at: string;
    }): Promise<AdapterResponse>;
    /**
     * Query lineage forward: what artifacts did this simulation produce?
     */
    queryLineageForward(simulationId: string): Promise<AdapterResponse>;
    /**
     * Query lineage backward: what simulation created this artifact?
     */
    queryLineageBackward(artifactId: string): Promise<AdapterResponse>;
    /**
     * Store an integration proposal in Ruvector.
     * Proposals describe what would change, not what has changed.
     */
    storeIntegrationProposal(proposal: {
        id: string;
        type: 'integration_proposal';
        integration_name: string;
        proposed_changes: string;
        risks: string[];
        dependencies: string[];
        simulation_id: string;
        plan_id?: string;
        attribution: {
            created_by: string;
            org_id: string;
        };
        created_at: string;
    }): Promise<AdapterResponse>;
    /**
     * List integration proposals for a simulation.
     */
    listIntegrationProposals(simulationId: string): Promise<AdapterResponse>;
    /**
     * Store an ERP Surface mapping in Ruvector.
     * ERP Surface reflects proposed state, not live mutation.
     */
    storeErpMapping(mapping: {
        id: string;
        type: 'erp_mapping';
        erp_type: string;
        entity_type: string;
        proposed_implementation: unknown;
        simulation_id: string;
        integration_proposal_ids: string[];
        attribution: {
            created_by: string;
            org_id: string;
        };
        created_at: string;
    }): Promise<AdapterResponse>;
    /**
     * List ERP mappings for a simulation.
     */
    listErpMappings(simulationId: string): Promise<AdapterResponse>;
}
export declare class TestBenchAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ObservatoryAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ShieldAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class SentinelAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class MemoryGraphAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class LatencyLensAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ForgeAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class EdgeAgentAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class AutoOptimizerAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class IncidentManagerAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class OrchestratorAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class CostOpsAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class GovernanceDashboardAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class PolicyEngineAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class RegistryAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class MarketplaceAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class AnalyticsHubAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ConfigManagerAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class SchemaRegistryAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ConnectorHubAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class CopilotAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class SimulatorAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class BenchmarkExchangeAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class InferenceGatewayAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class DataVaultAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class ResearchLabAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export declare class PlatformAgentsAdapter extends BaseAdapter {
    constructor(config: EndpointConfig, correlationId?: string);
    invoke_agent(agent: string, payload: unknown): Promise<AdapterResponse>;
}
export type ServiceName = 'agentics-org-manifests' | 'agentics-simulation-planner' | 'agentics-simulation-runner' | 'agentics-simulation-engine' | 'agentics-results-index' | 'enterprise-roi-engine' | 'agentics-deployment-intent' | 'agentics-deployment-exporters' | 'diligence-artifacts' | 'ruvector-service' | 'test-bench-agents' | 'observatory-agents' | 'shield-agents' | 'sentinel-agents' | 'memory-graph-agents' | 'latency-lens-agents' | 'forge-agents' | 'edge-agents' | 'auto-optimizer-agents' | 'incident-manager-agents' | 'orchestrator-agents' | 'costops-agents' | 'governance-dashboard-agents' | 'policy-engine-agents' | 'registry-agents' | 'marketplace-agents' | 'analytics-hub-agents' | 'config-manager-agents' | 'schema-registry-agents' | 'connector-hub-agents' | 'copilot-agents' | 'simulator-agents' | 'benchmark-exchange-agents' | 'inference-gateway-agents' | 'data-vault-agents' | 'research-lab-agents' | 'platform-agents';
export declare function createAdapter(serviceName: ServiceName, config: EndpointConfig, correlationId?: string): IDownstreamAdapter;
//# sourceMappingURL=base-adapter.d.ts.map