/**
 * OutcomePort — post-run outcome instrumentation.
 *
 * Host attributes a monetary value to each agent run via its
 * domain-specific rules (config/outcomes.yaml in CC). The agent simply
 * calls recordOutcomeAsync after its tracker.finish() — fire-and-forget.
 *
 * OTel instrumentation: import { createTracedOutcomePort } to wrap any
 * OutcomePort implementation with OpenTelemetry spans. Gracefully degrades
 * to noop spans when no OTel SDK is installed.
 */
export interface AgentRunRef {
    /** agent_run.id (UUID) produced by AgentRunTracker. */
    id: string;
    /** Logical agent identity, matches AgentDescriptor.id. */
    agent_id: string;
    /** Hash / caller-generated run id for trace correlation. */
    run_id?: string;
    /** Already-linked outcome id; idempotency guard. */
    outcome_id?: string | null;
}
/**
 * Thrown when the outcome store write fails (DB connection lost, serialization
 * error, or queue full). Since recordOutcomeAsync is fire-and-forget, this
 * error is surfaced only when the implementation chooses to throw synchronously
 * (e.g., during validation or when the write queue is persistently full).
 */
export declare class OutcomeWriteError extends Error {
    readonly cause?: unknown | undefined;
    readonly runId: string;
    constructor(message: string, runId: string, cause?: unknown | undefined);
}
export interface OutcomePort {
    /**
     * Enqueue outcome attribution. Fire-and-forget: never throws,
     * never blocks the agent lifecycle. Errors are logged by the impl.
     */
    recordOutcomeAsync(run: AgentRunRef): void;
}
/**
 * Wrap any OutcomePort implementation with OTel spans.
 * The span captures the run id and agent_id as attributes.
 * Gracefully degrades to noop spans when no OTel SDK is installed.
 *
 * Usage:
 *   const raw: OutcomePort = buildPostgresOutcome(...);
 *   const traced = createTracedOutcomePort(raw);
 *   traced.recordOutcomeAsync({...}) // emits "outcome.recordOutcomeAsync" span
 */
export declare function createTracedOutcomePort(impl: OutcomePort): OutcomePort;
//# sourceMappingURL=outcome.d.ts.map