export declare const GET_ESCALATION_TARGETS = "\n  SELECT target_role\n  FROM lt_config_role_escalations\n  WHERE source_role = $1\n  ORDER BY target_role";
export declare const GET_ALL_ESCALATION_CHAINS = "\n  SELECT source_role, target_role\n  FROM lt_config_role_escalations\n  ORDER BY source_role, target_role";
export declare const INSERT_ESCALATION_CHAIN = "\n  INSERT INTO lt_config_role_escalations (source_role, target_role)\n  VALUES ($1, $2)\n  ON CONFLICT DO NOTHING";
export declare const DELETE_ESCALATION_CHAIN = "\n  DELETE FROM lt_config_role_escalations\n  WHERE source_role = $1 AND target_role = $2";
export declare const DELETE_ESCALATION_CHAINS_BY_SOURCE = "\n  DELETE FROM lt_config_role_escalations\n  WHERE source_role = $1";
export declare const CHECK_ESCALATION_CHAIN_EXISTS = "\n  SELECT 1\n  FROM lt_config_role_escalations\n  WHERE source_role = $1 AND target_role = $2";
export declare const ENSURE_ROLE_EXISTS = "\n  INSERT INTO lt_roles (role) VALUES ($1)\n  ON CONFLICT DO NOTHING";
export declare const LIST_ROLES = "\n  SELECT role FROM lt_roles ORDER BY role";
export declare const DELETE_ROLE = "\n  DELETE FROM lt_roles WHERE role = $1";
export declare const LIST_ROLES_WITH_DETAILS = "\n  WITH\n  user_counts AS (\n    SELECT role, COUNT(DISTINCT user_id)::int AS cnt\n    FROM lt_user_roles\n    GROUP BY role\n  ),\n  chain_counts AS (\n    SELECT role, COUNT(*)::int AS cnt\n    FROM (\n      SELECT source_role AS role FROM lt_config_role_escalations\n      UNION ALL\n      SELECT target_role AS role FROM lt_config_role_escalations\n    ) c\n    GROUP BY role\n  ),\n  workflow_counts AS (\n    SELECT role, COUNT(*)::int AS cnt\n    FROM lt_config_roles\n    GROUP BY role\n  )\n  SELECT\n    r.role,\n    COALESCE(uc.cnt, 0) AS user_count,\n    COALESCE(cc.cnt, 0) AS chain_count,\n    COALESCE(wc.cnt, 0) AS workflow_count\n  FROM lt_roles r\n  LEFT JOIN user_counts uc ON uc.role = r.role\n  LEFT JOIN chain_counts cc ON cc.role = r.role\n  LEFT JOIN workflow_counts wc ON wc.role = r.role\n  ORDER BY r.role";
export declare const COUNT_USER_ROLE_REFS = "\n  SELECT COUNT(*)::int AS cnt FROM lt_user_roles WHERE role = $1";
export declare const COUNT_CHAIN_REFS = "\n  SELECT COUNT(*)::int AS cnt\n  FROM lt_config_role_escalations\n  WHERE source_role = $1 OR target_role = $1";
export declare const COUNT_WORKFLOW_REFS = "\n  SELECT COUNT(*)::int AS cnt FROM lt_config_roles WHERE role = $1";
export declare const COUNT_ACTIVE_ESCALATION_REFS = "\n  SELECT COUNT(*)::int AS cnt\n  FROM lt_escalations\n  WHERE role = $1 AND status IN ('pending', 'claimed')";
