/** * ExplainabilityTracer — structured decision cards for agent actions. * * Records every significant decision made during task orchestration so that * operators can audit *why* a particular outcome was produced. * * @module explainability */ /** A single factor that influenced a decision. */ export interface DecisionFactor { name: string; value: unknown; weight?: number; description?: string; } /** Structured record of one orchestrator decision. */ export interface DecisionCard { /** Unique trace id */ traceId: string; /** ISO timestamp */ timestamp: string; /** Which component made the decision */ source: string; /** Short label for the decision type */ decision: string; /** The outcome chosen */ outcome: string; /** Factors that contributed */ factors: DecisionFactor[]; /** Parent trace (e.g. the delegation that spawned this) */ parentTraceId?: string; /** Agent involved, if any */ agentId?: string; /** Arbitrary metadata */ metadata?: Record; } /** * Collects decision cards during a session. * * Usage: * ```ts * const tracer = new ExplainabilityTracer(); * tracer.record({ * source: 'AuthGuardian', * decision: 'permission_check', * outcome: 'granted', * factors: [{ name: 'trust_level', value: 0.8 }], * }); * const cards = tracer.getTrace(traceId); * ``` */ export declare class ExplainabilityTracer { private cards; private maxCards; constructor(options?: { maxCards?: number; }); /** * Record a decision card. Returns the generated traceId. */ record(card: Omit & { traceId?: string; timestamp?: string; }): string; /** Get a single card by traceId. */ getCard(traceId: string): DecisionCard | undefined; /** Get all cards sharing a parentTraceId — i.e. the full trace tree for a delegation. */ getTrace(parentTraceId: string): DecisionCard[]; /** Get cards filtered by source, decision type, agent, or time range. */ query(filter: { source?: string; decision?: string; agentId?: string; since?: string; until?: string; }): DecisionCard[]; /** Total number of recorded cards. */ get size(): number; /** Clear all recorded cards. */ clear(): void; /** Export all cards as a JSON-serializable array. */ export(): DecisionCard[]; private generateId; } //# sourceMappingURL=explainability.d.ts.map