import { HotMesh } from '@hotmeshio/hotmesh';
import type { QuorumProfile, ThrottleOptions } from '@hotmeshio/hotmesh/build/types/quorum';
import type { ControlPlaneApp, StreamStats, StreamMessagesParams, StreamMessagesResult } from './types';
export type { QuorumProfile, ThrottleOptions };
/**
 * Get or create a read-only HotMesh engine for control plane operations.
 * The engine taps into the Postgres quorum channel for the given appId,
 * enabling rollCall and throttle without running any workflows.
 */
export declare function getEngine(appId: string): Promise<HotMesh>;
/**
 * List all active HotMesh application IDs from the `hmsh_applications` table.
 */
export declare function listApps(): Promise<ControlPlaneApp[]>;
/**
 * Execute a roll call against the mesh for a given appId.
 * Broadcasts a ping and collects pong responses from all engines and workers.
 */
export declare function rollCall(appId: string, delay?: number): Promise<QuorumProfile[]>;
/**
 * Broadcast a throttle command to the mesh.
 *
 * @param appId — target application
 * @param options.throttle — ms delay per message (-1 = pause, 0 = resume)
 * @param options.topic — target a specific worker topic
 * @param options.guid — target a specific engine/worker by GUID
 */
export declare function applyThrottle(appId: string, options: ThrottleOptions): Promise<boolean>;
/**
 * Get stream processing statistics for a given appId schema.
 *
 * @param schema — the Postgres schema (appId, e.g. "durable")
 * @param duration — time range key (15m, 30m, 1h, 1d, 7d)
 * @param streamName — optional: filter to a specific stream (task queue topic)
 */
export declare function getStreamStats(schema: string, duration?: string, streamName?: string | null): Promise<StreamStats>;
/**
 * Browse stream messages across engine_streams and worker_streams tables
 * with pagination, filtering, and sorting.
 *
 * @param schema — the Postgres schema (namespace, e.g. "durable")
 * @param params — pagination, filter, and sort options
 */
export declare function getStreamMessages(schema: string, params: StreamMessagesParams): Promise<StreamMessagesResult>;
/**
 * Start the quorum→NATS bridge for an appId.
 * Subscribes to the HotMesh quorum channel and republishes
 * messages to NATS on `lt.mesh.*` topics.
 */
export declare function subscribeMesh(appId: string): Promise<void>;
/**
 * Check if a quorum bridge is active for an appId.
 */
export declare function isBridgeActive(appId: string): boolean;
