/**
 * Shadow agent support for the broker SDK.
 *
 * A shadow agent monitors all messages to/from a primary agent.
 * Implemented SDK-side using the event hook system — no broker
 * protocol extension required.
 *
 * @example
 * ```ts
 * import { AgentRelay, ShadowManager } from "@agent-relay/sdk";
 *
 * const relay = new AgentRelay();
 * const shadows = new ShadowManager();
 *
 * // Bind "Reviewer" as shadow of "Worker1"
 * shadows.bind("Reviewer", "Worker1");
 *
 * // Wire into relay events
 * relay.onMessageReceived = (msg) => {
 *   const copies = shadows.intercept(msg.from, msg.to, msg);
 *   for (const copy of copies) {
 *     // Forward shadow copies to the shadow agent
 *     relay.human({ name: "system" }).sendMessage({
 *       to: copy.shadowAgent,
 *       text: `[Shadow of ${copy.primaryAgent}] ${msg.text}`,
 *     });
 *   }
 * };
 * ```
 */
import type { SpeakOnTrigger } from '@agent-relay/config';
export type { SpeakOnTrigger };
export interface ShadowConfig {
    primaryAgent: string;
    speakOn: SpeakOnTrigger[];
    receiveIncoming: boolean;
    receiveOutgoing: boolean;
}
export interface ShadowRelationship extends ShadowConfig {
    shadowAgent: string;
}
export interface ShadowCopy {
    shadowAgent: string;
    primaryAgent: string;
    direction: "incoming" | "outgoing";
}
export declare class ShadowManager {
    /** primaryAgent → list of shadow relationships */
    private shadowsByPrimary;
    /** shadowAgent → primaryAgent (reverse lookup) */
    private primaryByShadow;
    /**
     * Bind a shadow agent to monitor a primary agent.
     */
    bind(shadowAgent: string, primaryAgent: string, options?: {
        speakOn?: SpeakOnTrigger[];
        receiveIncoming?: boolean;
        receiveOutgoing?: boolean;
    }): void;
    /**
     * Unbind a shadow from its primary.
     */
    unbind(shadowAgent: string): void;
    /**
     * Get all shadows for a primary agent.
     */
    getShadowsFor(primaryAgent: string): ShadowRelationship[];
    /**
     * Get the primary agent a shadow is bound to.
     */
    getPrimaryFor(shadowAgent: string): string | undefined;
    /**
     * Check whether a shadow should speak for a given trigger.
     */
    shouldSpeak(shadowAgent: string, trigger: SpeakOnTrigger): boolean;
    /**
     * Determine which shadows should receive a copy of a message
     * between `from` and `to`. Returns a list of shadow copies to deliver.
     *
     * Call this from your `onMessageReceived` / `onMessageSent` hooks
     * to fan out shadow copies.
     */
    intercept(from: string, to: string): ShadowCopy[];
    /**
     * Emit a trigger event and return shadow agents that should be notified.
     *
     * Use this to implement `speakOn` behavior — when a trigger fires
     * (e.g. CODE_WRITTEN, REVIEW_REQUEST), call this to find which
     * shadows should receive a notification.
     */
    emitTrigger(primaryAgent: string, trigger: SpeakOnTrigger): string[];
    /**
     * List all current shadow bindings.
     */
    listBindings(): ShadowRelationship[];
    /**
     * Remove all bindings (for shutdown).
     */
    clear(): void;
}
//# sourceMappingURL=shadow.d.ts.map