export declare const LIST_TOPICS = "\n  SELECT t.*,\n    COALESCE(s.sub_count, 0)::int AS subscriber_count\n  FROM lt_topic_catalog t\n  LEFT JOIN LATERAL (\n    SELECT COUNT(*)::int AS sub_count\n    FROM lt_agent_subscriptions\n    WHERE enabled = true\n      AND (\n        topic = t.topic\n        OR t.topic LIKE REPLACE(REPLACE(topic, '*', '%'), '>', '%')\n      )\n  ) s ON true\n  WHERE ($1::text IS NULL OR t.category = $1)\n    AND ($2::text IS NULL OR t.topic ILIKE '%' || $2 || '%' OR t.description ILIKE '%' || $2 || '%')\n  ORDER BY t.category, t.topic\n  LIMIT $3 OFFSET $4\n";
export declare const COUNT_TOPICS = "\n  SELECT COUNT(*)::int AS total FROM lt_topic_catalog\n  WHERE ($1::text IS NULL OR category = $1)\n    AND ($2::text IS NULL OR topic ILIKE '%' || $2 || '%' OR description ILIKE '%' || $2 || '%')\n";
export declare const GET_TOPIC = "\n  SELECT * FROM lt_topic_catalog WHERE topic = $1\n";
export declare const INSERT_TOPIC = "\n  INSERT INTO lt_topic_catalog\n    (topic, description, category, payload_schema, example_payload, source, tags)\n  VALUES ($1, $2, $3, $4, $5, $6, $7)\n  RETURNING *\n";
export declare const UPDATE_TOPIC = "\n  UPDATE lt_topic_catalog SET\n    description = COALESCE($2, description),\n    category = COALESCE($3, category),\n    payload_schema = COALESCE($4, payload_schema),\n    example_payload = COALESCE($5, example_payload),\n    tags = COALESCE($6, tags)\n  WHERE topic = $1\n  RETURNING *\n";
export declare const DELETE_TOPIC = "\n  DELETE FROM lt_topic_catalog WHERE topic = $1 AND source != 'system'\n";
export declare const UPSERT_ON_PUBLISH = "\n  INSERT INTO lt_topic_catalog\n    (topic, category, source, example_payload, last_seen_at)\n  VALUES ($1, $2, $3, $4, NOW())\n  ON CONFLICT (topic) DO UPDATE SET\n    last_seen_at = NOW(),\n    example_payload = COALESCE(EXCLUDED.example_payload, lt_topic_catalog.example_payload)\n";
export declare const SEED_TOPIC = "\n  INSERT INTO lt_topic_catalog\n    (topic, description, category, payload_schema, example_payload, source, tags)\n  VALUES ($1, $2, $3, $4, $5, $6, $7)\n  ON CONFLICT (topic) DO NOTHING\n";
export declare const RESET_TOPIC = "\n  INSERT INTO lt_topic_catalog\n    (topic, description, category, payload_schema, example_payload, source, tags, managed)\n  VALUES ($1, $2, $3, $4, $5, $6, $7, true)\n  ON CONFLICT (topic) DO UPDATE SET\n    description = EXCLUDED.description,\n    category = EXCLUDED.category,\n    payload_schema = EXCLUDED.payload_schema,\n    example_payload = EXCLUDED.example_payload,\n    source = EXCLUDED.source,\n    tags = EXCLUDED.tags,\n    managed = true\n";
export declare const LIST_SUBSCRIBERS = "\n  SELECT s.id, s.agent_id, s.topic, s.reaction_type,\n    a.id AS agent_name\n  FROM lt_agent_subscriptions s\n  JOIN lt_agents a ON s.agent_id = a.id\n  WHERE s.enabled = true AND a.status = 'active'\n    AND (\n      s.topic = $1\n      OR $1 LIKE REPLACE(REPLACE(s.topic, '*', '%'), '>', '%')\n    )\n  ORDER BY s.created_at\n";
