type RegistryEvent = {
    kind: 'start';
    record: ActiveSubagent;
} | {
    kind: 'end';
    id: string;
} | {
    kind: 'cancel';
    id: string;
} | {
    kind: 'activity';
    id: string;
    lastActivity: string;
    updatedAtMs: number;
};
/**
 * Subscribe to registry change events. Used by the server to bridge
 * registry mutations onto the harness event store so WebSocket clients
 * see start / end / cancel updates without polling.
 */
export declare function subscribeSubagentRegistry(listener: (event: RegistryEvent) => void): () => void;
export interface SubagentActivityEntry {
    label: string;
    at: number;
}
export interface ActiveSubagent {
    id: string;
    /** Display label (typically the agent_id or `name`). */
    name: string;
    /** Truncated prompt — first 200 chars, for the UI bar. */
    promptSnippet: string;
    /** ms since epoch when the run started. */
    startedAtMs: number;
    controller: AbortController;
    /** Short label of what the sub-agent is currently doing, e.g. "\uD83D\uDD27 read_file". */
    lastActivity?: string;
    /** ms since epoch when lastActivity was last updated. */
    updatedAtMs?: number;
    /** Most recent activity labels, oldest-first. Capped at MAX_ACTIVITY_HISTORY. */
    activityHistory: SubagentActivityEntry[];
}
export interface RegisterSubagentInput {
    id: string;
    name: string;
    prompt: string;
    controller: AbortController;
    startedAtMs?: number;
}
export declare function registerSubagent(input: RegisterSubagentInput): ActiveSubagent;
export declare function unregisterSubagent(id: string): void;
export declare function listActiveSubagents(): ActiveSubagent[];
export declare function getActiveSubagent(id: string): ActiveSubagent | undefined;
/**
 * Record what the sub-agent is currently doing — short labels like
 * "\uD83D\uDD27 read_file" or "thinking\u2026". Safe to call from inside the
 * event stream; no-ops when the id is not registered (e.g. when the run
 * had no runId).
 */
export declare function updateSubagentActivity(id: string, label: string): void;
/**
 * Cancel a running sub-agent by aborting its controller. Returns true
 * when a cancel signal was sent, false when the id was not found.
 * The caller is responsible for unregistering on the run's natural exit;
 * cancel does not eagerly drop the record so the run can still surface
 * a final "cancelled" event before disappearing from the bar.
 */
export declare function cancelSubagent(id: string): boolean;
/** Test helper: clear the registry. Not exported through the public API. */
export declare function _resetSubagentRegistryForTests(): void;
export {};
//# sourceMappingURL=subagentRegistry.d.ts.map