/**
 * Self-Registration Hook (W2.2 of F-NEW-PRODUCT-AGENT-VISIBILITY-CLUSTER-2026-05-12).
 *
 * Runtime-observed agent discovery: the first time an agent fires a tool
 * call, the hook records its identity and incrementally builds an
 * AgentManifest from observed activity. Complements W2.1 (static project
 * scan) — captures agents that don't show up in a code scan (dynamically
 * instantiated agents, framework-internal agents, agents authored as
 * notebook cells, etc.).
 *
 * Honors Invariant 10 (push-only): hook runs in the customer's process
 * and emits manifest events through an injected sink. We do not poll the
 * customer; the customer pushes events to us via the sink they configure.
 *
 * Idempotent: subsequent calls for an already-registered agent update the
 * observed-tools set but do not re-emit the REGISTERED event.
 *
 * @connexum/ai-governance  F-NEW-PRODUCT-AGENT-SELF-REGISTRATION
 */
import type { ActionContext } from '../adapters/index.js';
import type { AgentManifest } from './owasp-agentic-scanner.js';
export type SelfRegistrationEventKind = 'AGENT_REGISTERED' | 'AGENT_TOOL_OBSERVED';
export interface SelfRegistrationEvent {
    kind: SelfRegistrationEventKind;
    agentId: string;
    orgId: string;
    tool: string;
    timestamp: string;
    /** Full manifest snapshot at the time of this event. */
    manifest: AgentManifest;
}
export type SelfRegistrationSink = (event: SelfRegistrationEvent) => void;
export interface SelfRegistrationOptions {
    /** Where to emit registration + tool-observation events. Default: NOOP. */
    sink?: SelfRegistrationSink;
    /** LLM provider hint to bake into manifests for agents we observe. */
    defaultLlmProvider?: string;
}
/**
 * Per-process registry that observes ActionContext events from PreToolUse
 * hooks and produces / updates AgentManifests.
 */
export declare class SelfRegistrationHook {
    private readonly records;
    private readonly sink;
    private readonly defaultLlmProvider?;
    constructor(options?: SelfRegistrationOptions);
    /**
     * Record a single observed tool call. If the agent is unknown, emit
     * AGENT_REGISTERED. If the tool is new for a known agent, emit
     * AGENT_TOOL_OBSERVED. Otherwise no event is emitted.
     *
     * Always idempotent — safe to call from every PreToolUse fire.
     */
    observe(action: ActionContext): void;
    /** Mark a hook stage as wired on an agent (PreToolUse/PostToolUse/PostResponse). */
    markHookWired(orgId: string, agentId: string, hook: 'preToolUse' | 'postToolUse' | 'postResponse'): void;
    /** Read a manifest by orgId + agentId. */
    getManifest(orgId: string, agentId: string): AgentManifest | undefined;
    /** List all registered manifests. */
    listManifests(): AgentManifest[];
    /** Clear state (typically for tests or per-test isolation). */
    clear(): void;
}
//# sourceMappingURL=self-registration-hook.d.ts.map