export declare const CREATE_YAML_WORKFLOW = "\n  INSERT INTO lt_yaml_workflows\n    (name, description, app_id, app_version, source_workflow_id,\n     source_workflow_type, yaml_content, graph_topic,\n     input_schema, output_schema, activity_manifest, input_field_meta,\n     original_prompt, category, tags, metadata, content_version,\n     set_id, set_role, set_build_order)\n  VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, 1, $17, $18, $19)\n  RETURNING *";
export declare const CHECK_TOPIC_UNIQUE = "\n  SELECT id, name FROM lt_yaml_workflows\n  WHERE app_id = $1 AND graph_topic = $2 AND status != 'archived'\n  LIMIT 1";
export declare const GET_YAML_WORKFLOW = "\n  SELECT * FROM lt_yaml_workflows WHERE id = $1";
export declare const GET_YAML_WORKFLOW_BY_NAME = "\n  SELECT * FROM lt_yaml_workflows WHERE name = $1";
export declare const UPDATE_YAML_WORKFLOW_VERSION = "\n  UPDATE lt_yaml_workflows SET app_version = $2 WHERE id = $1";
export declare const DELETE_YAML_WORKFLOW = "\n  DELETE FROM lt_yaml_workflows WHERE id = $1";
export declare const GET_ACTIVE_YAML_WORKFLOWS = "\n  SELECT * FROM lt_yaml_workflows\n  WHERE status = 'active'\n  ORDER BY name";
export declare const LIST_BY_APP_ID = "\n  SELECT * FROM lt_yaml_workflows\n  WHERE app_id = $1 AND status != 'archived'\n  ORDER BY name";
export declare const GET_MAX_APP_VERSION = "\n  SELECT COALESCE(MAX(CAST(app_version AS INTEGER)), 0) AS max_version\n  FROM lt_yaml_workflows\n  WHERE app_id = $1 AND status != 'archived'";
export declare const GET_DISTINCT_APP_IDS = "\n  SELECT DISTINCT app_id FROM (\n    SELECT app_id FROM lt_yaml_workflows WHERE status != 'archived'\n    UNION\n    SELECT app_id FROM hmsh_applications WHERE active = true\n  ) all_apps\n  ORDER BY app_id";
export declare const MARK_CONTENT_DEPLOYED = "\n  UPDATE lt_yaml_workflows\n  SET deployed_content_version = content_version\n  WHERE id = $1";
export declare const MARK_APP_ID_CONTENT_DEPLOYED = "\n  UPDATE lt_yaml_workflows\n  SET deployed_content_version = content_version\n  WHERE app_id = $1 AND status != 'archived'";
export declare const CREATE_VERSION_SNAPSHOT = "\n  INSERT INTO lt_yaml_workflow_versions\n    (workflow_id, version, yaml_content, activity_manifest, input_schema, output_schema, input_field_meta, change_summary)\n  VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n  ON CONFLICT (workflow_id, version) DO NOTHING\n  RETURNING *";
export declare const COUNT_VERSIONS = "\n  SELECT COUNT(*) FROM lt_yaml_workflow_versions WHERE workflow_id = $1";
export declare const LIST_VERSIONS = "\n  SELECT * FROM lt_yaml_workflow_versions\n  WHERE workflow_id = $1\n  ORDER BY version DESC\n  LIMIT $2 OFFSET $3";
export declare const DISCOVER_WORKFLOWS = "\n  SELECT *,\n    ts_rank_cd(search_vector, plainto_tsquery('english', $1), 32) AS fts_rank\n  FROM lt_yaml_workflows\n  WHERE status = 'active'\n    AND (\n      search_vector @@ plainto_tsquery('english', $1)\n      OR tags && $2::text[]\n      OR ($3::text IS NOT NULL AND category = $3)\n    )\n  ORDER BY fts_rank DESC, activated_at DESC NULLS LAST\n  LIMIT $4";
export declare const GET_VERSION_SNAPSHOT = "\n  SELECT * FROM lt_yaml_workflow_versions\n  WHERE workflow_id = $1 AND version = $2";
export declare const UPDATE_STATUS_BASE = "UPDATE lt_yaml_workflows SET status = $2";
export declare const UPDATE_STATUS_SUFFIX = " WHERE id = $1 RETURNING *";
export declare const UPDATE_CRON_SCHEDULE = "\n  UPDATE lt_yaml_workflows\n  SET cron_schedule = $2, cron_envelope = $3, execute_as = $4\n  WHERE id = $1\n  RETURNING *";
export declare const CLEAR_CRON_SCHEDULE = "\n  UPDATE lt_yaml_workflows\n  SET cron_schedule = NULL, cron_envelope = NULL, execute_as = NULL\n  WHERE id = $1\n  RETURNING *";
export declare const GET_CRON_SCHEDULED_WORKFLOWS = "\n  SELECT * FROM lt_yaml_workflows\n  WHERE cron_schedule IS NOT NULL AND status = 'active'\n  ORDER BY name";
export declare const FIND_BY_TAGS_ANY = "\n  SELECT * FROM lt_yaml_workflows\n  WHERE status = 'active' AND tags && $1::text[]\n  ORDER BY name";
export declare const FIND_BY_TAGS_ALL = "\n  SELECT * FROM lt_yaml_workflows\n  WHERE status = 'active' AND tags @> $1::text[]\n  ORDER BY name";
