/**
 * AgentScanner -- Discovery engine for AI agent definitions across platforms.
 *
 * Scans project directories to detect agent configurations from Claude Code,
 * OpenAI, Cursor, and Gemini platforms. Determines governance status and
 * capabilities for each discovered agent.
 *
 * GATE 9: T-146
 *
 * @connexum/ai-governance
 */
/** Supported AI agent platforms */
export type AgentPlatform = 'claude' | 'openai' | 'cursor' | 'gemini' | 'custom' | 'unknown';
/** Governance status of a discovered agent */
export type GovernanceStatus = 'governed' | 'partial' | 'ungoverned';
/** A single agent discovered during scanning */
export interface DiscoveredAgent {
    /** Agent name (derived from filename or config) */
    name: string;
    /** Platform that owns this agent definition */
    platform: AgentPlatform;
    /** Absolute path to the agent definition file */
    filePath: string;
    /** Current governance status */
    governanceStatus: GovernanceStatus;
    /** Capabilities configured for this agent (tools, permissions, etc.) */
    capabilities: string[];
}
/** Aggregated scan statistics */
export interface ScanStats {
    total: number;
    governed: number;
    partial: number;
    ungoverned: number;
}
/** Result of a full project scan */
export interface ScanResult {
    /** All discovered agents */
    agents: DiscoveredAgent[];
    /** Project directory that was scanned */
    projectDir: string;
    /** ISO timestamp of when the scan was performed */
    scannedAt: string;
    /** Aggregated statistics */
    stats: ScanStats;
}
/**
 * Options controlling scanner behaviour.
 *
 * Defaults are deliberately conservative — the scanner treats the input
 * directory AS the agent. The customer is responsible for directing the
 * scanner at the right folder. Subdir walking is opt-in via `monorepo: true`
 * for explicit fleet-upload use cases.
 *
 * Thomas directive 2026-05-20: "The scanner should only work after you're
 * being directed to the folder that holds or the project that holds the
 * agent." Auto-walking subdirs surfaces false positives from `tests/`,
 * `examples/`, `node_modules/`, etc. that are NOT the customer's agent.
 */
export interface ScanOptions {
    /**
     * When true, walk top-level subdirs of `projectDir` looking for multiple
     * agents (fleet / monorepo case). Default false — `projectDir` IS the
     * agent and no subdir walking is performed by the vendor-neutral
     * detector.
     *
     * The platform-specific detectors (Claude Code `.claude/agents/*.md`,
     * OpenAI `.openai/`, Cursor, Gemini) still inspect their well-known
     * subdirs regardless of this flag — those paths are protocol-defined,
     * not subjective discovery.
     */
    monorepo?: boolean;
}
export declare class AgentScanner {
    /**
     * Scan a project directory for agent definitions across all supported platforms.
     *
     * Default behaviour: treats `projectDir` as the agent itself. The vendor-
     * neutral detector inspects ONLY `projectDir` — it does not walk subdirs.
     * Pass `{ monorepo: true }` to opt into the legacy subdir-walk behaviour
     * for fleet uploads.
     */
    scan(projectDir: string, options?: ScanOptions): ScanResult;
    /**
     * Detect whether the project has governance infrastructure installed.
     */
    private detectGovernanceInfrastructure;
    /**
     * Scan for Claude Code agent definitions.
     */
    private scanClaudeCode;
    /**
     * Scan for OpenAI agent definitions.
     */
    private scanOpenAI;
    /**
     * Scan for Cursor agent definitions.
     */
    private scanCursor;
    /**
     * Scan for Gemini agent definitions.
     */
    private scanGemini;
    /**
     * Scan for vendor-neutral agent definitions across any framework.
     *
     * Customers deploy AI agents in many shapes — LangChain, AutoGen, CrewAI,
     * OpenAI Assistants, native Anthropic SDK, native OpenAI SDK, custom
     * Python / TypeScript / JavaScript, framework-specific conventions like
     * Claude Code's `.claude/agents/*.md`, etc. The platform-specific detectors
     * above cover the well-known IDE/SDK paths; this detector handles the
     * generic case: a directory that "looks like an agent" by any of these
     * signals.
     *
     * Detection (any ONE signal makes a directory eligible):
     *   1. Source-file LLM-SDK import — a `.py`, `.ts`, `.js`, or `.mjs` file
     *      that imports one of the recognized LLM/orchestration SDKs.
     *   2. Manifest declaration — a `manifest.json` / `agent.yaml` / equivalent
     *      with an `agent_name` or `name`+`framework` field.
     *   3. Identity-doc + co-located source — an `IDENTITY.md` (or `AGENT.md`)
     *      alongside a source file, regardless of framework.
     *
     * De-duplication: if a directory was already discovered as a platform-
     * specific agent (Claude / OpenAI / Cursor / Gemini), this detector skips
     * it to avoid double-counting.
     *
     * The `platform` field on returned agents is set to `'custom'` — naming
     * the actual framework (LangChain, CrewAI, etc.) requires a follow-on
     * scanner extension; the current call-site cares mainly about "an agent
     * exists here" + extracted capabilities.
     */
    private scanCustomAgents;
    /**
     * Determine whether a given directory contains an agent definition by
     * any of the vendor-neutral signals. Returns the metadata needed to
     * construct a `DiscoveredAgent`, or `null` if no signal matched.
     */
    private detectCustomAgent;
    /**
     * Determine governance status for a Claude Code agent.
     */
    private assessGovernanceStatus;
    /**
     * Extract capabilities from agent file content.
     */
    private extractCapabilities;
    /**
     * Extract capabilities from a parsed settings JSON object.
     */
    private extractSettingsCapabilities;
    /**
     * Check if CLAUDE.md content contains agent-like definitions.
     */
    private containsAgentDefinitions;
    /**
     * Safely read a file, returning empty string on failure.
     */
    private safeReadFile;
    /**
     * Compute aggregate statistics from discovered agents.
     */
    private computeStats;
}
export { evaluateManifest, evaluateManifests, type ManifestFinding, type ManifestInput, type ManifestRuleId, } from './manifest-integrity';
//# sourceMappingURL=index.d.ts.map