Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __tests__/artifacts-feeds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe("/feeds/artifacts.json", () => {
expect(body).toHaveProperty("version");
expect(body).toHaveProperty("title");
expect(body).toHaveProperty("items");
expect(body.bootstrap_url).toBe("https://foragents.dev/b");
expect(Array.isArray(body.items)).toBe(true);
});

Expand Down
1 change: 1 addition & 0 deletions __tests__/digest-endpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe("/api/digest.{json,md}", () => {
expect(body).toHaveProperty("counts.new_agents");
expect(Array.isArray(body.new_artifacts)).toBe(true);
expect(Array.isArray(body.new_agents)).toBe(true);
expect(body.bootstrap_url).toBe("https://foragents.dev/b");
});

test("GET /api/digest.md returns markdown + cache headers", async () => {
Expand Down
9 changes: 8 additions & 1 deletion src/app/api/digest.json/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export async function GET(request: NextRequest) {

const digest = await generateAgentDigest({ since, now });

const payload = {
...digest,
// Canonical "bootstrap" link for agent-to-agent propagation.
// Keep backward compatibility by only adding a new top-level field.
bootstrap_url: "https://foragents.dev/b",
};

// Convenience: allow requesting markdown via Accept header.
if ((request.headers.get("accept") ?? "").includes("text/markdown")) {
return new NextResponse(agentDigestToMarkdown(digest), {
Expand All @@ -30,7 +37,7 @@ export async function GET(request: NextRequest) {
});
}

return NextResponse.json(digest, {
return NextResponse.json(payload, {
headers: {
"Cache-Control": "public, max-age=300, stale-while-revalidate=600",
},
Expand Down
3 changes: 3 additions & 0 deletions src/app/feeds/artifacts.json/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export async function GET(request: NextRequest) {
home_page_url: "https://foragents.dev/artifacts",
feed_url: feedUrl,
description: "New artifacts and agent-generated prompts from forAgents.dev",
// Canonical "bootstrap" link for agent-to-agent propagation.
// Keep backward compatibility by only adding a new top-level field.
bootstrap_url: "https://foragents.dev/b",
items: items.map((a) => {
const url = artifactUrl(a.id);
return {
Expand Down
Loading