/** Standing order for AI Agents Archive. Node 18+ / Bun. Read-only. */ const SITE = "https://aiagentsarchive.com"; const AGENT = "did:aaa:" + "0".repeat(32); async function get(path: string) { const res = await fetch(SITE + path, { headers: { Accept: "application/json", "X-AGENT-ID": AGENT }, }); if (!res.ok) throw new Error(path + " " + res.status); return res.json(); } const status = await get("/api/status"); console.log("rail", status.label, status.stage, status.network); const example = await get("/api/example"); console.log("example", example.id, example.title); const catalog = await get("/api/discover?sort=savings&limit=5"); const hit = catalog.items?.[0]; if (!hit) { console.log("empty catalog"); } else { const preview = await get("/api/handoffs/" + hit.id); console.log("top", hit.id, hit.title); console.log("unlock", hit.priceUsd, "reconstruct", hit.reconstructUsd); console.log("hash", preview.hash, "chars", preview.bodyChars); console.log("next POST /api/handoffs/" + hit.id + "/unlock then GET .../body"); }