/**
 * AgentRegistry — plugin registration API for Vauban agent descriptors.
 *
 * Phase 1: register/get/list with validation.
 * Phase 2: discover() scans pnpm workspace packages for the
 * "@vauban/agent-plugin" keyword, dynamically imports each one,
 * and auto-registers its default export.
 */
import type { AgentCapabilityCard, AgentKind } from "./agent-capability.js";
/** Handler context injected into every agent run. */
export interface AgentContext {
    runId: string;
    traceId?: string;
}
/** Result returned by an agent handler. */
export interface AgentResult {
    output: string;
    stopReason: "complete" | "budget_exhausted" | "error" | string;
    inputTokens: number;
    outputTokens: number;
}
/** Handler function type. */
export type AgentHandler = (ctx: AgentContext, input: string) => Promise<AgentResult>;
/**
 * Descriptor for a registered agent. All fields are required except
 * `schedule` and `featureFlag` which are only relevant for cron agents.
 */
export interface AgentDescriptor {
    /** Stable slug (e.g. "market-radar"). Must be kebab-case, 1-63 chars. */
    id: string;
    /** Semver string (e.g. "0.2.0"). */
    version: string;
    /** Which loop primitive this agent uses. */
    loop: "minimal" | "sdk";
    /** Cron expression for scheduled agents (e.g. `0 * /6 * * *`). */
    schedule?: string;
    /** Env var name that gates this agent (e.g. "MARKETRADAR_CRON_ENABLED"). */
    featureFlag?: string;
    /** Monthly USD budget ceiling for this agent. */
    budget_monthly_usd: number;
    /** Human-readable description. */
    description: string;
    /** The async handler that runs the agent. */
    handler: AgentHandler;
}
export declare class AgentRegistry {
    private readonly agents;
    private readonly capabilities;
    /**
     * Register an agent descriptor. Validates the descriptor and throws on
     * duplicate id or invalid fields.
     */
    register(desc: AgentDescriptor): void;
    /** Get a registered agent by id. Returns undefined if not found. */
    get(id: string): AgentDescriptor | undefined;
    /** List all registered agent descriptors. */
    list(): AgentDescriptor[];
    /** Number of registered agents. */
    get size(): number;
    /**
     * Unregister an agent by id. Returns true if removed, false if not found.
     */
    unregister(id: string): boolean;
    /**
     * Register (or upsert) an AgentCapabilityCard keyed by agentId.
     * Re-registering the same agentId replaces the previous card atomically.
     */
    registerCapability(card: AgentCapabilityCard): void;
    /**
     * Return all capability cards whose `kind` matches the given value.
     * Returns shallow copies — mutations do not affect registry state.
     */
    discoverByKind(kind: AgentKind): AgentCapabilityCard[];
    /**
     * Return capability cards that match the given skill tags.
     * Returns shallow copies — mutations do not affect registry state.
     *
     * @param skills - Tags to match against `card.skills` (lowercased by caller).
     * @param opts.kind - Optional kind filter applied before skill matching.
     * @param opts.matchAll - When true, ALL skills must be present (AND logic).
     *   Defaults to false (OR logic: at least one skill matches).
     */
    discoverBySkills(skills: readonly string[], opts?: {
        kind?: AgentKind;
        matchAll?: boolean;
    }): AgentCapabilityCard[];
    /**
     * Scan the pnpm workspace at `workspaceRoot` for packages whose
     * `package.json` `keywords` array includes `"@vauban/agent-plugin"`,
     * dynamically import each one, and register the default export
     * (an `AgentDescriptor`).
     *
     * Idempotent: if a plugin is already registered, skips it silently.
     * Malformed plugins (missing default export, non-descriptor shape)
     * are skipped with a warning — discover() never throws.
     *
     * @param workspaceRoot  Absolute path to the workspace root containing pnpm-workspace.yaml.
     * @returns The descriptors that were newly registered by this call.
     */
    discover(workspaceRoot: string): Promise<AgentDescriptor[]>;
}
/** Default singleton registry for process-level use. */
export declare const agentRegistry: AgentRegistry;
//# sourceMappingURL=agent-registry.d.ts.map