openvibers/openvibe.markets Commits

llms-full.txt: the home page as words

OP OpenVibers committed 3 days ago · 6d5ad4cdad · 2 files, +16 −0

/llms-full.txt was a 404 to agents (11-28, tools/llms-check.js). It is the llms.txt header and the home page in
Markdown from its own render, and llms.txt links it under Optional. Test: app.

Changes

ddiff --git a/server/app.js b/server/app.js
iindex ece9f5c..9fb2c9c 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -55,7 +55,18 @@ function createApp({ deals, vision = null, now = () => Date.now(), photoLimits =
app.get('/llms.txt', (_req, res) => res.type('text').send([
'# OpenVibe.Markets', '', '> Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.', '',
'- Search: https://openvibe.markets/search?q=<words>', '- API: GET https://openvibe.markets/api/v1/search?q=<words> → { q, deals: { ok, total, results }, elsewhere: [{ name, kind, url }] }', '',
++ '## Optional', '', '- [Full text (llms-full.txt)](https://openvibe.markets/llms-full.txt): the home page as words', '',
].join('\n')));
++ // The full text for language models (SEO-33): the home page as Markdown from its own render (11-28: /llms-full.txt
++ // was a 404 to agents, tools/llms-check.js).
++ app.get('/llms-full.txt', (_req, res) => {
++ const words = require('openvibe-shared/agent-layer').markdownTwin({ html: v.home({ photo: Boolean(vision && vision.ready) }), canonical: 'https://openvibe.markets/' }).replace(/^---[\s\S]*?\n---\n/, '').trim();
++ res.type('text').set('Cache-Control', 'public, max-age=3600').send(seo.llmsFull({
++ site: { name: 'OpenVibe.Markets', url: 'https://openvibe.markets' },
++ summary: 'Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.',
++ sections: [{ title: 'OpenVibe.Markets', url: '/', body: words }],
++ }));
++ });
app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));
app.use('/shared', require('openvibe-shared/serve').handler());
ddiff --git a/test/app.test.js b/test/app.test.js
iindex 8269601..1e16e96 100644
---- a/test/app.test.js
++++ b/test/app.test.js
@@@ -95,6 +95,11 @@ const OFFERS = [
assert.ok(!/Disallow: \/search/.test(r.text) && /Sitemap: https:\/\/openvibe\.markets\/sitemap\.xml/.test(r.text), r.text);
assert.match((await get('/sitemap.xml')).text, /<loc>https:\/\/openvibe\.markets\/<\/loc>/);
assert.match((await get('/llms.txt')).text, /OpenVibe\.Markets/);
++ // llms-full.txt (11-28: a 404 to agents): the home page as words, linked from llms.txt.
++ const full = await get('/llms-full.txt');
++ assert.strictEqual(full.status, 200);
++ assert.ok(full.text.startsWith('# OpenVibe.Markets') && full.text.length > 300 && !/<(?:script|style)\b/i.test(full.text), 'words, not markup');
++ assert.match((await get('/llms.txt')).text, /\(https:\/\/openvibe\.markets\/llms-full\.txt\)/);
assert.strictEqual((await get('/nope')).status, 404);
// Deals unreachable: said plainly, the links still work.