openvibers/openvibe.mediahub Commits
/.well-known/agent.json on openvibe.pics (SEO-2) (#276)
Changes
nnew file mode 100644@@@ -0,0 +1,14 @@++'use strict';++// What openvibe.pics tells an agent about itself (openvibe-shared/agent-layer): /.well-known/agent.json (SEO-2).++// Every field is something the Pics host really serves; the purpose is its own llms.txt summary.++module.exports = {++ id: 'pics',++ name: 'OpenVibe.Pics',++ purpose: 'Picture hosting on the OpenVibe network: upload a picture, get a link to share or embed, albums, any size or format. Pictures are unlisted and re-encoded with their metadata removed.',++ home: 'https://openvibe.pics',++ site: 'openvibe.pics',++ openapi: '/openapi.json',++ policy: {++ auth: ['none', 'Network OIDC'],++ },++};@@@ -637,6 +637,9 @@ ${row.state === 'hidden' ? html`<button class="ovp-btn" name="action" value="res] },],});++ // /.well-known/agent.json on the Pics host (SEO-2): its own manifest, not the drive's or the video host's.++ r.get('/.well-known/agent.json', (_req, res) => res.type('application/json').set('Cache-Control', 'public, max-age=3600')++ .send(JSON.stringify(require('openvibe-shared/agent-layer').agentManifest(require('./agent-descriptor')))));r.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders({ maxAge: 3600 })).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) => {@@@ -103,6 +103,11 @@ const PAGES = ['/exif', '/content-policy', '/ai-training'];for (const path of PAGES) assert.ok(map.includes(`<loc>https://openvibe.pics${path}</loc>`), `the sitemap lists ${path}`);const llms = (await t.get('/llms.txt', { headers: PICS })).text;for (const path of PAGES) assert.ok(llms.includes(`https://openvibe.pics${path}`), `llms.txt names ${path}`);++ // SEO-2: the Pics host's own agent manifest.++ const agent = await t.get('/.well-known/agent.json', { headers: PICS });++ assert.strictEqual(agent.status, 200);++ const m = JSON.parse(agent.text);++ assert.deepStrictEqual([m.network, m.id, m.home, m.openapi], ['OpenVibe', 'pics', 'https://openvibe.pics', 'https://openvibe.pics/openapi.json']);// SEO-33: llms-full.txt answers on the pics host, from the same descriptor.const full = await t.get('/llms-full.txt', { headers: PICS });assert.strictEqual(full.status, 200);
new file mode 100644
new file mode 100644
@@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
+'use strict';
+// What openvibe.pics tells an agent about itself (openvibe-shared/agent-layer): /.well-known/agent.json (SEO-2).
+// Every field is something the Pics host really serves; the purpose is its own llms.txt summary.
+module.exports = {
+ id: 'pics',
+ name: 'OpenVibe.Pics',
+ purpose: 'Picture hosting on the OpenVibe network: upload a picture, get a link to share or embed, albums, any size or format. Pictures are unlisted and re-encoded with their metadata removed.',
+ home: 'https://openvibe.pics',
+ site: 'openvibe.pics',
+ openapi: '/openapi.json',
+ policy: {
+ auth: ['none', 'Network OIDC'],
+ },
+};
@@ -637,6 +637,9 @@ ${row.state === 'hidden' ? html`<button class="ovp-btn" name="action" value="res
@@ -637,6 +637,9 @@ ${row.state === 'hidden' ? html`<button class="ovp-btn" name="action" value="res
] },
] },
],
],
});
});
+ // /.well-known/agent.json on the Pics host (SEO-2): its own manifest, not the drive's or the video host's.
+ r.get('/.well-known/agent.json', (_req, res) => res.type('application/json').set('Cache-Control', 'public, max-age=3600')
+ .send(JSON.stringify(require('openvibe-shared/agent-layer').agentManifest(require('./agent-descriptor')))));
r.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders({ maxAge: 3600 })).send(seo.llmsTxt(llmsSite())));
r.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders({ maxAge: 3600 })).send(seo.llmsTxt(llmsSite())));
// The same, in full (SEO-33): what the site is, then every page llms.txt lists with what it holds.
// 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) => {
r.get('/llms-full.txt', (_req, res) => {
@@ -103,6 +103,11 @@ const PAGES = ['/exif', '/content-policy', '/ai-training'];
@@ -103,6 +103,11 @@ const PAGES = ['/exif', '/content-policy', '/ai-training'];
for (const path of PAGES) assert.ok(map.includes(`<loc>https://openvibe.pics${path}</loc>`), `the sitemap lists ${path}`);
for (const path of PAGES) assert.ok(map.includes(`<loc>https://openvibe.pics${path}</loc>`), `the sitemap lists ${path}`);
const llms = (await t.get('/llms.txt', { headers: PICS })).text;
const llms = (await t.get('/llms.txt', { headers: PICS })).text;
for (const path of PAGES) assert.ok(llms.includes(`https://openvibe.pics${path}`), `llms.txt names ${path}`);
for (const path of PAGES) assert.ok(llms.includes(`https://openvibe.pics${path}`), `llms.txt names ${path}`);
+ // SEO-2: the Pics host's own agent manifest.
+ const agent = await t.get('/.well-known/agent.json', { headers: PICS });
+ assert.strictEqual(agent.status, 200);
+ const m = JSON.parse(agent.text);
+ assert.deepStrictEqual([m.network, m.id, m.home, m.openapi], ['OpenVibe', 'pics', 'https://openvibe.pics', 'https://openvibe.pics/openapi.json']);
// SEO-33: llms-full.txt answers on the pics host, from the same descriptor.
// SEO-33: llms-full.txt answers on the pics host, from the same descriptor.
const full = await t.get('/llms-full.txt', { headers: PICS });
const full = await t.get('/llms-full.txt', { headers: PICS });
assert.strictEqual(full.status, 200);
assert.strictEqual(full.status, 200);