openvibers/openvibe.ai Commits

/.well-known/agent.json: what this site serves, for agents (SEO-2) (#282)

OP OpenVibers committed 10 days ago · 72b7f1dd0e · 3 files, +36 −0

It answered 404. The shared agent layer serves server/agent-descriptor.js: the site's
purpose (its llms.txt summary), its API, docs and MCP where it has them, and its auth.

Changes

ddiff --git a/server/agent-descriptor.js b/server/agent-descriptor.js
nnew file mode 100644
iindex 0000000..745e7ff
---- /dev/null
++++ b/server/agent-descriptor.js
@@@ -0,0 +1,15 @@
++'use strict';
++// What OpenVibe.AI tells an agent about itself (openvibe-shared/agent-layer): /.well-known/agent.json (SEO-2).
++// Every field is something this site really serves; the purpose is its own llms.txt summary.
++module.exports = {
++ id: "ai",
++ name: "OpenVibe.AI",
++ purpose: "One API for chat, summaries, extraction and embeddings across many models, OpenAI-compatible. Every run says which model answered, why and what it cost.",
++ home: "https://ai.openvibe.services",
++ site: "ai.openvibe.services",
++ api: "/api/v1",
++ docs: "https://openvibe.services/docs/api",
++ policy: {
++ auth: ["Network OIDC"],
++ },
++};
ddiff --git a/server/app.js b/server/app.js
iindex d9bd734..f011909 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -23,6 +23,8 @@ const pkg = require('../package.json');
function createApp({ config, db, registry, pool, quotas, cache, runs, auth, keys, env = process.env, clock = { now: () => Date.now() }, fetchImpl = globalThis.fetch, log = console, credentials = null, preferences = null, grants = null, vault = null, benchEvents = null, runBudgets = null, memory = null }) {
const app = express();
++ // /.well-known/agent.json (openvibe-shared/agent-layer, SEO-2): what this site serves, for agents.
++ require('openvibe-shared/agent-layer').mount(app, { descriptor: require('./agent-descriptor') });
app.disable('x-powered-by');
app.set('trust proxy', 'loopback');
const release = createRelease({ service: 'ai', root: path.join(__dirname, '..') });
ddiff --git a/test/agent-json.test.js b/test/agent-json.test.js
nnew file mode 100644
iindex 0000000..fcd860e
---- /dev/null
++++ b/test/agent-json.test.js
@@@ -0,0 +1,19 @@
++'use strict';
++// SEO-2: /.well-known/agent.json answered 404 here (11-03 check of all 55 sites). The shared agent layer serves this
++// site's descriptor; every field is something it really serves.
++const assert = require('assert');
++const fs = require('fs');
++const path = require('path');
++const descriptor = require('../server/agent-descriptor');
++const { agentManifest } = require('openvibe-shared/agent-layer');
++
++const m = agentManifest(descriptor);
++assert.strictEqual(m.network, 'OpenVibe');
++assert.strictEqual(m.home, 'https://ai.openvibe.services');
++assert.ok(m.purpose && m.purpose.length > 40, 'a purpose');
++assert.ok(/^https:\/\//.test(m.api), 'its API, absolute');
++assert.strictEqual(m.llms, 'https://ai.openvibe.services/llms.txt');
++assert.ok(Array.isArray(m.policy.auth) && m.policy.auth.length, 'how it is called');
++const app = fs.readFileSync(path.join(__dirname, '..', 'server', 'app.js'), 'utf8');
++assert.match(app, /require\('openvibe-shared\/agent-layer'\)\.mount\(app, \{ descriptor: require\('\.\/agent-descriptor'\) \}\);/);
++console.log('agent.json: ok');