import type { LTYamlWorkflowRecord } from '../../types/yaml-workflow';
import type { CreateYamlWorkflowInput } from './types';
export { parseVersionFromYaml, updateYamlWorkflowStatus, listYamlWorkflows, findYamlWorkflowsByTags, } from './db-utils';
export { createVersionSnapshot, getVersionHistory, getVersionSnapshot, markContentDeployed, markAppIdContentDeployed, updateCronSchedule, clearCronSchedule, getCronScheduledWorkflows, } from './db-versions';
/**
 * Check whether a graph_topic is already in use by a non-archived workflow
 * in the same namespace. Returns the conflicting workflow name, or null.
 */
export declare function checkTopicConflict(appId: string, graphTopic: string, excludeId?: string): Promise<string | null>;
export declare function createYamlWorkflow(input: CreateYamlWorkflowInput): Promise<LTYamlWorkflowRecord>;
export declare function getYamlWorkflow(id: string): Promise<LTYamlWorkflowRecord | null>;
export declare function getYamlWorkflowByName(name: string): Promise<LTYamlWorkflowRecord | null>;
export declare function updateYamlWorkflowVersion(id: string, version: string): Promise<void>;
export declare function updateYamlWorkflow(id: string, updates: Partial<Pick<CreateYamlWorkflowInput, 'name' | 'description' | 'app_id' | 'yaml_content' | 'graph_topic' | 'input_schema' | 'output_schema' | 'activity_manifest' | 'tags' | 'metadata'>>): Promise<LTYamlWorkflowRecord | null>;
export declare function deleteYamlWorkflow(id: string): Promise<boolean>;
/**
 * Ranked discovery: find active workflows matching the user's prompt
 * via full-text search (tsvector) + tag overlap + optional category filter.
 */
export declare function discoverWorkflows(prompt: string, tags: string[], category?: string | null, limit?: number): Promise<(LTYamlWorkflowRecord & {
    fts_rank: number;
})[]>;
export declare function getActiveYamlWorkflows(): Promise<LTYamlWorkflowRecord[]>;
export declare function listYamlWorkflowsByAppId(appId: string): Promise<LTYamlWorkflowRecord[]>;
/**
 * Return the next app-level version for a namespace.
 *
 * Each deploy of an app (namespace) must use a strictly increasing integer
 * version. This queries the current max across all non-archived workflows
 * in the namespace and returns max + 1.
 *
 * A new namespace with no workflows returns '1'.
 * An existing namespace with one active tool at v1 returns '2' when a
 * second tool is added -- even though that second tool is "version 1" of itself.
 */
export declare function getNextAppVersion(appId: string): Promise<string>;
export declare function getDistinctAppIds(): Promise<string[]>;
