···2727 }
2828}
29293030+// a knot's root page is its motd — the ascii ship plus whatever the operator added.
3131+// fails soft: 403'd roots, html, and dead hosts all just mean "no motd".
3232+export async function fetchMotd(hostname: string): Promise<string | null> {
3333+ try {
3434+ const res = await fetch(`https://${hostname}/`, {
3535+ signal: AbortSignal.timeout(5000),
3636+ });
3737+ if (!res.ok || !res.headers.get("content-type")?.includes("text/plain"))
3838+ return null;
3939+ const body = (await res.text()).trimEnd();
4040+ if (!body) return null;
4141+ return body.split("\n").slice(0, 12).join("\n").slice(0, 1024);
4242+ } catch {
4343+ return null;
4444+ }
4545+}
4646+3047// managed = hosted by tangled.org; keep the heuristic here, it may need refinement
3148export function isManaged(hostname: string): boolean {
3249 return (