should_add( (bool) (int) $indexable ) ) { return $output; } return $output . self::lines( home_url( '/llms.txt' ), $this->options->full_enabled() ? home_url( '/llms-full.txt' ) : null ); } /** * Whether the lines should be added. * * @param bool $indexable Whether the site asks search engines to index it. * @return bool True when they should. */ private function should_add( bool $indexable ): bool { return $indexable && $this->options->robots_line() && Urls::has_pretty_permalinks() && $this->environment->is_active(); } /** * Builds the comment lines. * * @param string $llms Address of llms.txt. * @param string|null $full Address of llms-full.txt, or null when that file is off. * @return string The lines, starting with a line break. */ public static function lines( string $llms, ?string $full ): string { $lines = "\n# AgentWelcome\n# llms.txt: " . $llms . "\n"; if ( null !== $full ) { $lines .= '# llms-full.txt: ' . $full . "\n"; } return $lines; } }