import { HotMesh } from '@hotmeshio/hotmesh';
import type { HotMeshManifest } from '@hotmeshio/hotmesh/build/types/hotmesh';
export { buildMergedYaml } from './deployer-helpers';
/**
 * Get or create a HotMesh engine instance for a given app ID.
 * Flows sharing the same appId share the same engine (and DB connection pool).
 */
export declare function getEngine(appId: string): Promise<HotMesh>;
/**
 * Deploy all YAML workflows for an app_id as a single merged version.
 *
 * On failure, attempts one recompilation cycle:
 *   1. Identifies the workflow that was most recently compiled (the trigger)
 *   2. Re-runs the full compilation pipeline with the error as context
 *   3. The compile stage's LLM receives the error + failed YAML to avoid the same issue
 *   4. Stores the recompiled YAML and retries deployment
 *
 * If recompilation is unavailable or fails, the original error is thrown.
 */
export declare function deployAppId(appId: string, version: string): Promise<HotMeshManifest>;
/**
 * Deploy a single YAML workflow to HotMesh (inactive until activated).
 * @deprecated Use deployAppId for merged deployment.
 */
export declare function deployYamlWorkflow(appId: string, yamlContent: string): Promise<HotMeshManifest>;
/**
 * Activate a deployed version of a YAML workflow.
 */
export declare function activateYamlWorkflow(appId: string, version: string): Promise<boolean>;
/**
 * Invoke a YAML workflow (fire-and-forget). Returns the job ID.
 */
export declare function invokeYamlWorkflow(appId: string, topic: string, data: Record<string, unknown>, entity?: string, context?: Record<string, any>): Promise<string>;
/**
 * Invoke a YAML workflow and wait for the result.
 *
 * Replicates HotMesh's engine.pubsub() logic exactly, but adds the
 * `extended` parameter (where entity lives) to the internal pub() call.
 * HotMesh's pubsub omits extended, so entity was never set.
 *
 * Source: @hotmeshio/hotmesh engine/index.js pubsub()
 */
export declare function invokeYamlWorkflowSync(appId: string, topic: string, data: Record<string, unknown>, timeout?: number, entity?: string): Promise<{
    job_id: string;
    result: Record<string, unknown>;
}>;
/**
 * Stop a specific YAML workflow engine.
 */
export declare function stopEngine(appId: string): Promise<void>;
/**
 * Stop all YAML workflow engines.
 */
export declare function stopAllEngines(): Promise<void>;
