openvibers/openvibe.surf Commits

/llms-full.txt (SEO-33): the site in full, from the same descriptor as llms.txt (#69)

OP OpenVibers committed 10 days ago · 802371460f · 2 files, +24 −2

It answered 404. The llms.txt descriptor becomes llmsSite(), and /llms-full.txt renders
it with seo.llmsFull: an About section (the summary and details), then every page
llms.txt lists with what it holds.

Changes

ddiff --git a/server/http/discovery.js b/server/http/discovery.js
iindex c1b0932..e83b959 100644
---- a/server/http/discovery.js
++++ b/server/http/discovery.js
@@@ -59,8 +59,8 @@ function createDiscoveryRoutes(ctx) {
+ seo.robotsTxt({ sitemaps: [abs('/sitemap.xml')], disallow: DISALLOW }));
});
-- r.get('/llms.txt', async (_req, res) => {
-- res.type('text/plain').set('Cache-Control', TEXT).send(seo.llmsTxt({
++ // The site as llms.txt describes it, shared by /llms.txt and /llms-full.txt (SEO-33).
++ const llmsSite = () => ({
name: SITE_NAME,
summary: DESCRIPTION,
details: 'The pages here are server-rendered and readable without JavaScript. Ride is a proxy to OpenVibe.Games, Watch merges OpenVibe.Live’s live, clip and moment feeds, and Web creates one OpenVibe.Actor task with the signed-in person’s own Network token.',
@@@ -84,6 +84,19 @@ function createDiscoveryRoutes(ctx) {
{ title: 'OpenVibe.Actor', url: 'https://openvibe.actor', note: 'who browses the web for Web' },
] },
],
++ });
++ r.get('/llms.txt', async (_req, res) => {
++ res.type('text/plain').set('Cache-Control', TEXT).send(seo.llmsTxt(llmsSite()));
++ });
++ // The same, in full (SEO-33): what the site is, then every page llms.txt lists with what it holds.
++ r.get('/llms-full.txt', (_req, res) => {
++ const d = llmsSite();
++ res.type('text/plain').set('Cache-Control', TEXT).send(seo.llmsFull({
++ site: d.name, summary: d.summary, base: abs('/'),
++ sections: [
++ { title: 'About', pages: [{ title: d.name, url: abs('/'), text: [d.summary, d.details].filter(Boolean).join('\n\n') }] },
++ ...(d.sections || []).map((x) => ({ title: x.title, pages: (x.links || []).map((l) => ({ title: l.title, url: l.url, text: l.note || '' })) })),
++ ],
}));
});
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex 264a4fd..12d66c2 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -27,6 +27,15 @@ const { boot, check, done } = require('./helpers/boot');
assert.match(r.text, /<lastmod>2026-/);
});
++ await check('llms-full.txt (SEO-33): the site in full, from the same descriptor as llms.txt', async () => {
++ const r = await t.get('/llms-full.txt');
++ assert.strictEqual(r.status, 200);
++ assert.match(r.headers.get('content-type') || '', /^text\/plain/);
++ assert.ok(r.text.startsWith('# OpenVibe.Surf'), r.text.slice(0, 60));
++ assert.ok(r.text.length > 500, `${r.text.length} characters`);
++ assert.match(r.text, /## About\n\n### /);
++ });
++
await check('llms.txt describes the room, its three surfs and the machine-readable routes', async () => {
const r = await t.get('/llms.txt');
assert.strictEqual(r.status, 200);