/**
 * Aggregates distinct "agents" (writers) seen across the write-path tables.
 *
 * An agent is identified by `deriveAgentKey()` from `./agent_key.ts`, keeping
 * the server-side key identical to the Inspector-side `getAttributionKey()`.
 *
 * The directory is computed on demand from the provenance JSON columns of
 * `observations`, `sources`, `timeline_events`, `interpretations`, and
 * `relationship_observations`. No separate rollup table is maintained so
 * the view is always live.
 */
import { type RecordActivityItem, type RecordActivityType } from "./recent_record_activity.js";
export type AgentAttributionTier = "hardware" | "operator_attested" | "software" | "unverified_client" | "anonymous";
/** Value returned by {@link listAgents}. */
export interface AgentDirectoryEntry {
    /** Stable identifier used for `GET /agents/:key` and UI links. */
    agent_key: string;
    /** Short label: `client_name` (+ version) → `agent_sub` → short thumbprint → "Anonymous". */
    label: string;
    /** Tier reported on the most recent row for this agent. */
    tier: AgentAttributionTier;
    agent_thumbprint?: string | null;
    agent_public_key?: string | null;
    agent_algorithm?: string | null;
    agent_sub?: string | null;
    agent_iss?: string | null;
    client_name?: string | null;
    client_version?: string | null;
    /** Earliest / latest ISO timestamp the agent was seen writing anything. */
    first_seen_at: string | null;
    last_seen_at: string | null;
    /** Total rows across all record types we aggregate. */
    total_records: number;
    /** Per record-type counts. Missing buckets mean zero. */
    record_counts: Partial<Record<RecordActivityType, number>>;
    /**
     * Observations grouped by target entity type (join `entities`). Used to
     * surface feedback (`issue` / conversations), governance (`agent_grant`), and
     * other permissioned or high-signal writers on the Agents directory.
     * Omitted when empty.
     */
    observation_entity_type_counts?: Record<string, number>;
}
export interface ListAgentsResult {
    agents: AgentDirectoryEntry[];
    total: number;
}
/** List every agent that has written something for this user. */
export declare function listAgents(userId: string): ListAgentsResult;
/** Fetch a single agent by key; `null` when the key is unknown. */
export declare function getAgent(userId: string, agentKey: string): AgentDirectoryEntry | null;
/**
 * Records written by a specific agent, returned in the same
 * {@link RecordActivityItem} shape the Inspector already renders for the
 * global activity feed. Delegates to {@link listRecentRecordActivity} so
 * we reuse the enrichment joins (entity name, source filename, etc.).
 */
export declare function listAgentRecords(userId: string, agentKey: string, limit: number, offset: number): {
    items: RecordActivityItem[];
    has_more: boolean;
    limit: number;
    offset: number;
};
//# sourceMappingURL=agents_directory.d.ts.map