/**
 * Typed plugin event bus — from Paperclip's plugin-event-bus.ts.
 * Pub/sub with namespace isolation and error-isolated concurrent dispatch.
 *
 * Plugins subscribe via SDK; core emits events at natural integration points.
 * Plugin-emitted events are auto-namespaced to prevent cross-namespace spoofing.
 */
export interface PluginEvent {
    topic: string;
    pluginId?: string;
    timestamp: number;
    data: Record<string, unknown>;
}
type EventHandler = (event: PluginEvent) => void | Promise<void>;
/**
 * Subscribe to events matching a topic pattern.
 * Supports exact match ('tool.executed') or wildcard suffix ('tool.*').
 */
export declare function subscribe(pluginId: string, topic: string, handler: EventHandler): () => void;
/**
 * Emit an event to all matching subscribers.
 * Each handler runs independently — errors in one never block others.
 */
export declare function emit(event: PluginEvent): Promise<void>;
/**
 * Emit an event from a plugin (auto-namespaces the topic).
 * Plugin-emitted events get prefixed with the plugin ID to prevent spoofing.
 */
export declare function emitFromPlugin(pluginId: string, topic: string, data: Record<string, unknown>): Promise<void>;
/**
 * Emit a core system event (no namespace prefix).
 */
export declare function emitSystem(topic: string, data: Record<string, unknown>): Promise<void>;
/** Remove all subscriptions for a plugin (used during plugin unload) */
export declare function unsubscribeAll(pluginId: string): void;
/** Get subscription count (for diagnostics) */
export declare function getSubscriptionCount(): number;
export {};
