/**
 * Trace Middleware — Transparent Agent Invocation Tracing (ADR-039)
 *
 * Wraps agent invocations without modifying agent code. Infers inputs
 * (which DecisionGraph nodes were read) and outputs (which nodes were
 * written) by diffing the graph state before and after execution.
 *
 * Key principle: Agents are unaware of tracing. They do not need to
 * emit trace data. The middleware handles everything.
 */
import type { PassNumber, AgentRef, AgentInvocationResult } from './types.js';
import { DecisionGraph } from './decision-graph.js';
import { ProvenanceTracker } from './provenance-tracker.js';
/** The agent invoker function signature. */
export type AgentInvoker = (agents: readonly AgentRef[], payload: Record<string, unknown>, pass: PassNumber, timeoutMs: number) => Promise<AgentInvocationResult[]>;
/**
 * Create a tracing wrapper around an agent invoker.
 *
 * The wrapped invoker:
 *   1. Snapshots the graph node count before invocation
 *   2. Invokes the original invoker
 *   3. Diffs the graph to find new nodes (inferred outputs)
 *   4. Records a TraceRecord per agent with code provenance
 *
 * Usage:
 *   const tracedInvoker = createTracingInvoker(originalInvoker, graph, tracker, 'Pass Name', 'workstream');
 *   const results = await tracedInvoker(agents, payload, pass, timeoutMs);
 */
export declare function createTracingInvoker(inner: AgentInvoker, graph: DecisionGraph, tracker: ProvenanceTracker, passName: string, workstream: string): AgentInvoker;
/**
 * Create a tracing wrapper that also writes TraceRecords to the DecisionGraph.
 *
 * This is the full ADR-039 implementation: trace records are stored both
 * in the ProvenanceTracker (in-memory) and as DecisionGraph nodes (persisted).
 */
export declare function createFullTracingInvoker(inner: AgentInvoker, graph: DecisionGraph, tracker: ProvenanceTracker, passName: string, workstream: string): AgentInvoker;
//# sourceMappingURL=trace-middleware.d.ts.map