import type { LTApiResult } from '../../types/sdk';
/**
 * List YAML workflows with optional filtering and pagination.
 *
 * Delegates to the DB layer. Returns 404 when a filter references an invalid UUID.
 *
 * @param input.status — lifecycle filter (draft, deployed, active, archived)
 * @param input.graph_topic — filter by the HotMesh subscription topic
 * @param input.app_id — filter by namespace (MCP server name)
 * @param input.search — free-text search across workflow name/description
 * @param input.source_workflow_id — filter by the execution trace this workflow was compiled from
 * @param input.set_id — filter by compositional set membership
 * @param input.limit — max rows to return
 * @param input.offset — pagination offset
 * @returns `{ status: 200, data: YamlWorkflow[] }` matching workflows
 */
export declare function listYamlWorkflows(input: {
    status?: string;
    graph_topic?: string;
    app_id?: string;
    search?: string;
    source_workflow_id?: string;
    set_id?: string;
    limit?: number;
    offset?: number;
}): Promise<LTApiResult>;
/**
 * Compile an execution trace into a new YAML workflow (draft).
 *
 * Validates that the source execution did not exhaust its tool rounds, checks for
 * topic collisions in the target namespace, then delegates to the LLM-based YAML
 * generator. The resulting YAML, schemas, and activity manifest are persisted as a
 * new draft record. Auto-derived tags are merged with any user-supplied tags.
 *
 * @param input.workflow_id — ID of the source execution trace to compile from
 * @param input.task_queue — HotMesh task queue the source execution ran on
 * @param input.workflow_name — type name of the source workflow
 * @param input.name — tool name for the new workflow (no dashes; used to derive the topic)
 * @param input.description — human-readable description passed to the generator
 * @param input.app_id — target namespace (defaults to "longtail")
 * @param input.subscribes — explicit subscription topic override (otherwise derived from name)
 * @param input.tags — additional tags to merge with auto-derived tags
 * @param input.compilation_feedback — natural-language feedback to steer the LLM compilation
 * @returns `{ status: 201, data: YamlWorkflow }` the newly created draft record
 */
export declare function createYamlWorkflow(input: {
    workflow_id: string;
    task_queue: string;
    workflow_name: string;
    name: string;
    description?: string;
    app_id?: string;
    subscribes?: string;
    tags?: string[];
    compilation_feedback?: string;
}): Promise<LTApiResult>;
/**
 * Create a YAML workflow directly from user-supplied YAML content (no compilation).
 *
 * Sanitizes the name, app_id, and graph_topic to lowercase alphanumeric characters.
 * Rewrites the `subscribes`, `id`, and `topic` fields inside the YAML to match the
 * sanitized values. Checks for topic collisions before persisting.
 *
 * @param input.name — tool name (sanitized to lowercase alphanumeric, periods, dashes, underscores)
 * @param input.description — human-readable description; also stored as original_prompt
 * @param input.yaml_content — raw HotMesh YAML definition
 * @param input.input_schema — JSON Schema describing the workflow's input (defaults to empty object)
 * @param input.activity_manifest — list of activity declarations (defaults to empty array)
 * @param input.tags — classification tags (defaults to empty array)
 * @param input.app_id — target namespace / MCP server name (defaults to "longtail", sanitized to lowercase alphanumeric)
 * @param input.graph_topic — subscription topic override (defaults to sanitized name; overridden by `subscribes` in YAML if present)
 * @returns `{ status: 200, data: YamlWorkflow }` the persisted workflow record
 */
export declare function createYamlWorkflowDirect(input: {
    name: string;
    description?: string;
    yaml_content: string;
    input_schema?: any;
    activity_manifest?: any[];
    tags?: string[];
    app_id?: string;
    graph_topic?: string;
}): Promise<LTApiResult>;
/**
 * Retrieve all distinct app_id namespaces that have at least one YAML workflow.
 *
 * @returns `{ status: 200, data: { app_ids: string[] } }` sorted list of namespace identifiers
 */
export declare function getAppIds(): Promise<LTApiResult>;
/**
 * Fetch a single YAML workflow by its primary key.
 *
 * @param input.id — UUID of the workflow record
 * @returns `{ status: 200, data: YamlWorkflow }` the full workflow record, or 404 if not found
 */
export declare function getYamlWorkflow(input: {
    id: string;
}): Promise<LTApiResult>;
/**
 * Partially update a YAML workflow record.
 *
 * Accepts arbitrary fields beyond `id` and forwards them to the DB update layer.
 *
 * @param input.id — UUID of the workflow to update
 * @param input.[key] — any mutable workflow fields (name, description, yaml_content, tags, etc.)
 * @returns `{ status: 200, data: YamlWorkflow }` the updated record, or 404 if not found
 */
export declare function updateYamlWorkflow(input: {
    id: string;
    [key: string]: any;
}): Promise<LTApiResult>;
/**
 * Re-compile an existing YAML workflow from its original execution trace.
 *
 * Looks up the source workflow reference, re-runs the LLM-based YAML generator, and
 * overwrites the YAML content, schemas, manifest, and tags in place. When
 * compilation_feedback is provided, the current YAML is passed as priorFailedYaml so
 * the generator can incorporate the feedback. Archived workflows cannot be regenerated.
 *
 * @param input.id — UUID of the workflow to regenerate
 * @param input.task_queue — override the task queue (otherwise resolved from the source task record)
 * @param input.compilation_feedback — natural-language feedback to steer the re-compilation
 * @returns `{ status: 200, data: YamlWorkflow }` the updated record with new YAML content
 */
export declare function regenerateYamlWorkflow(input: {
    id: string;
    task_queue?: string;
    compilation_feedback?: string;
}): Promise<LTApiResult>;
/**
 * Permanently delete a YAML workflow record.
 *
 * Only draft or archived workflows can be deleted. Active or deployed workflows must
 * be archived first.
 *
 * @param input.id — UUID of the workflow to delete
 * @returns `{ status: 200, data: { deleted: true } }` on success, or 400 if the workflow is active/deployed
 */
export declare function deleteYamlWorkflow(input: {
    id: string;
}): Promise<LTApiResult>;
/**
 * Compile a durable TypeScript workflow into a YAML DAG.
 *
 * Accepts inline source code or a file path. The LLM translates the procedural
 * orchestration into an equivalent HotMesh YAML DAG that runs without replay.
 *
 * @param input.source — TypeScript source code or file path
 * @param input.is_file_path — whether source is a file path (default: false)
 * @param input.workflow_name — name of the exported workflow function
 * @param input.name — name for the generated YAML workflow
 * @param input.description — optional description
 * @param input.app_id — target namespace (defaults to "longtail")
 * @param input.subscribes — graph topic override
 * @param input.tags — additional tags
 * @returns `{ status: 201, data: YamlWorkflow }` the newly created draft record
 */
export declare function createYamlWorkflowFromDurable(input: {
    source: string;
    is_file_path?: boolean;
    workflow_name: string;
    name: string;
    description?: string;
    app_id?: string;
    subscribes?: string;
    tags?: string[];
}): Promise<LTApiResult>;
