type RobotRule = { allow?: string; disallow?: string[]; userAgent: string | string[]; }; /** * Known AI user agents, split by purpose: * - assistant/search bots fetch a page to answer a user's question live or to * power an AI search index — the ones that make "the chat reads your site" * work, and that most businesses WANT. * - training crawlers collect pages to train models — some clients prefer to * opt out of these while keeping assistant/search visibility. */ export declare const AI_ASSISTANT_BOTS: readonly ["ClaudeBot", "Claude-Web", "Claude-SearchBot", "ChatGPT-User", "OAI-SearchBot", "PerplexityBot", "Perplexity-User"]; export declare const AI_TRAINING_BOTS: readonly ["GPTBot", "Google-Extended", "CCBot", "anthropic-ai", "Applebot-Extended", "Bytespider", "Meta-ExternalAgent"]; type AiBotsPolicy = 'allow' | 'block-training' | 'disallow' | false; type BuildRobotsArgs = { /** Override the assistant/search bot list. */ aiAssistantAgents?: readonly string[]; /** * How to treat AI crawlers (assistant/search + training). Default 'allow' — * explicitly welcome them so the site stays visible to Claude, ChatGPT, * Perplexity etc. and an accidental future '*' tightening doesn't lock them * out. Options: * - 'allow' (default): explicit allow for assistant AND training bots. * - 'block-training': allow assistant/search bots, disallow training crawlers * — keep AI answers/visibility, opt out of model training. * - 'disallow': block all known AI bots. * - false: emit no AI-specific rules (only the '*' rule). */ aiBots?: AiBotsPolicy; /** Override the training crawler list. */ aiTrainingAgents?: readonly string[]; /** Absolute origin, e.g. 'https://example.com'. */ baseUrl: string; /** Paths to disallow. Defaults to Payload's admin and API. */ disallow?: string[]; /** Whether to advertise the sitemap. Defaults to true. */ sitemap?: boolean; }; /** * Shape for Next's `app/robots.ts`. `rules` may be a single rule or an array * (Next accepts both) — it becomes an array when AI-bot rules are added. */ export type RobotsRules = { host?: string; rules: RobotRule | RobotRule[]; sitemap?: string; }; /** * Builds robots rules that allow crawling everything except the admin panel and * API, point crawlers at the sitemap, and (by default) explicitly welcome AI * assistant/search/training bots. * * ```ts * // app/robots.ts * export default function robots() { * return buildRobots({ baseUrl: process.env.NEXT_PUBLIC_SERVER_URL! }) * } * ``` * * The admin and API are disallowed by default — no reason for them in the index, * and it keeps crawl budget on real content. * * AI visibility: the #1 reason "the chat won't read the site" is an AI user * agent being blocked (or not explicitly allowed under a tightened '*' rule). * `aiBots: 'allow'` (default) emits explicit allow rules for ClaudeBot, GPTBot, * PerplexityBot, Google-Extended and friends. To keep AI answers but opt out of * model training, use `aiBots: 'block-training'`. To block them all, 'disallow'. * * Pass custom disallow to block parametrized/thin URLs that waste crawl budget: * ```ts * buildRobots({ baseUrl, disallow: ['/admin', '/api', '/*?meter=*', '/*?s=*'] }) * ``` */ export declare function buildRobots({ aiAssistantAgents, aiBots, aiTrainingAgents, baseUrl, disallow, sitemap, }: BuildRobotsArgs): RobotsRules; export {};