added
This commit is contained in:
1 parent
38ae828d82
commit
6dda00181f
29 files changed
+1185
-339
No files matched your search
@@ -6,6 +6,8 @@ Outputs:
|
||||
- public/llms.txt
|
||||
- public/agents.md
|
||||
- public/skills.md
|
||||
- public/.well-known/security.txt
|
||||
- public/.well-known/agent-card.json
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -28,6 +30,7 @@ HUGO_PUBLIC = REPO_ROOT / "hugo-html-builder" / "public"
|
||||
SITE_URL = "https://indx.earth"
|
||||
SITE_TITLE = "iNDX Earth"
|
||||
PUBLISHER = "Eddie Soehnel"
|
||||
SECURITY_CONTACT = "https://indx.earth/#contact-us"
|
||||
SITEMAP_ROOT_HELPER_FILES = (
|
||||
"ai-index.json",
|
||||
"llms.txt",
|
||||
@@ -350,6 +353,47 @@ The generated sitemap currently declares {len(entries)} public URLs with last mo
|
||||
"""
|
||||
|
||||
|
||||
def build_security_txt() -> str:
|
||||
expires_year = date.today().year + 1
|
||||
return "\n".join(
|
||||
[
|
||||
f"Contact: {SECURITY_CONTACT}",
|
||||
f"Expires: {expires_year}-12-31T23:59:59Z",
|
||||
f"Canonical: {SITE_URL}/.well-known/security.txt",
|
||||
f"Preferred-Languages: en",
|
||||
"",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def build_agent_card_json() -> str:
|
||||
payload = {
|
||||
"name": SITE_TITLE,
|
||||
"url": f"{SITE_URL}/",
|
||||
"description": "Public, AI-readable discovery website for iNDX platform information, community summaries, and semantic artifacts.",
|
||||
"publisher": PUBLISHER,
|
||||
"contact": SECURITY_CONTACT,
|
||||
"license": f"{SITE_URL}/wiki/license/",
|
||||
"discovery": {
|
||||
"ai_index": f"{SITE_URL}/ai-index.json",
|
||||
"sitemap": f"{SITE_URL}/sitemap.xml",
|
||||
"llms": f"{SITE_URL}/llms.txt",
|
||||
"agents": f"{SITE_URL}/agents.md",
|
||||
"skills": f"{SITE_URL}/skills.md",
|
||||
},
|
||||
"retrieval": {
|
||||
"preferred_start": f"{SITE_URL}/ai-index.json",
|
||||
"semantic_artifacts": "/data/open/pages/**/chunks.json",
|
||||
"qa_artifacts": "/data/open/pages/**/qa.json",
|
||||
},
|
||||
"policies": {
|
||||
"crawl": "Crawl politely, cache public resources when possible, and do not submit forms unless a human explicitly initiates the action.",
|
||||
"attribution": "Preserve source URLs, license, usageInfo, and attribution metadata when reusing content or semantic artifacts.",
|
||||
},
|
||||
}
|
||||
return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
|
||||
|
||||
|
||||
def skill_title_from_file(path: Path) -> str:
|
||||
if path.suffix == ".py":
|
||||
return path.name
|
||||
@@ -440,7 +484,7 @@ def validate_outputs() -> None:
|
||||
raise RuntimeError("sitemap.xml is missing changefreq or priority fields")
|
||||
if f"Sitemap: {SITE_URL}/sitemap.xml" not in read_text(PUBLIC_ROOT / "robots.txt"):
|
||||
raise RuntimeError("robots.txt does not reference sitemap.xml")
|
||||
for filename in ("llms.txt", "agents.md", "skills.md"):
|
||||
for filename in ("llms.txt", "agents.md", "skills.md", ".well-known/security.txt", ".well-known/agent-card.json"):
|
||||
path = PUBLIC_ROOT / filename
|
||||
if not path.exists() or path.stat().st_size == 0:
|
||||
raise RuntimeError(f"{filename} was not created")
|
||||
@@ -457,6 +501,8 @@ def main() -> None:
|
||||
write_text(PUBLIC_ROOT / "llms.txt", build_llms_txt(entries))
|
||||
write_text(PUBLIC_ROOT / "agents.md", build_agents_md(entries))
|
||||
write_text(PUBLIC_ROOT / "skills.md", build_skills_md())
|
||||
write_text(PUBLIC_ROOT / ".well-known" / "security.txt", build_security_txt())
|
||||
write_text(PUBLIC_ROOT / ".well-known" / "agent-card.json", build_agent_card_json())
|
||||
validate_outputs()
|
||||
print(f"Wrote discovery files in {PUBLIC_ROOT} for {len(entries)} sitemap URLs.")
|
||||
|
||||
|
||||
Reference in new issue
Block a user