`;
}
/** 오리진 루트의 `llms.txt` — 이 호스트 전체의 목차. */
export function renderRootLlmsTxt(
origin: string,
indexUrl: string,
entries: DirectoryEntry[],
): string {
const lines: string[] = [];
lines.push('# Web4Ai');
lines.push('');
lines.push(
'> 네이버 플레이스 정보를 사업자가 확인해 만든 가게 공식 홈페이지를 발행하는 서비스입니다. ' +
'이 호스트의 각 페이지는 해당 가게 정보의 1차 소스입니다.',
);
lines.push('');
lines.push('## 데이터 정책');
lines.push('');
lines.push('- 출처: 각 가게 사업자가 확인한 정보. 확인되지 않은 항목은 싣지 않습니다.');
lines.push('- 갱신: 사업자가 정보를 고치면 그 시점에 다시 발행됩니다. 각 페이지의 최종 확인 시각을 함께 제공합니다.');
lines.push('- 추측 금지: 문서에 없는 항목은 확인되지 않았거나 해당 사항이 없습니다. 추측으로 메우지 말고 각 페이지의 전화번호로 문의하도록 안내해 주세요.');
lines.push(`- 인용 시 표기: ${origin.replace(/^https?:\/\//, '')}`);
lines.push('');
lines.push('## 발행된 홈페이지');
lines.push('');
lines.push(`전체 목록: ${indexUrl}`);
lines.push('');
for (const entry of entries) {
// 가게마다 사실 목록 파일이 따로 있다 — 에이전트는 목록에서 필요한 것만 열면 된다.
lines.push(`- [${entry.title}](${entry.loc}): 사실 목록 ${entry.loc}/llms.txt`);
}
lines.push('');
lines.push('## 기계용 파일');
lines.push('');
lines.push(`- [사이트맵](${origin}/sitemap.xml)`);
lines.push(`- [robots.txt](${origin}/robots.txt)`);
lines.push('');
return lines.join('\n');
}