a2acalling 0.6.73 → 0.6.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/server.js CHANGED
@@ -28,6 +28,7 @@ const { A2AConfig } = require('./lib/config');
28
28
  const { UpdateManager } = require('./lib/update-manager');
29
29
  const { DashboardEventStore } = require('./lib/dashboard-events');
30
30
  const { CallbookStore } = require('./lib/callbook');
31
+ const { buildAgentCard } = require('./lib/agent-card');
31
32
  const { spawn } = require('child_process');
32
33
  const { resolveTurnTimeoutMs } = require('./lib/turn-timeout');
33
34
 
@@ -968,6 +969,24 @@ app.use('/api/a2a', createRoutes({
968
969
  notifyOwner
969
970
  }));
970
971
 
972
+ // A2A-76: Google A2A Agent Card — dynamically generated from config + disclosure
973
+ app.get('/.well-known/a2a-agent-card', (req, res) => {
974
+ const agent = config.getAgent();
975
+ const manifest = getTopicsForTier('public');
976
+ const keypair = config.getKeypair();
977
+ const hostname = (agent && agent.hostname) || process.env.A2A_HOSTNAME || req.headers.host || 'localhost';
978
+ const protocol = req.protocol || 'https';
979
+ const card = buildAgentCard({
980
+ config: { ...agent, owner: agentContext.owner },
981
+ manifest,
982
+ publicKey: keypair ? keypair.publicKey : null,
983
+ serverUrl: `${protocol}://${hostname}`,
984
+ version: require('../package.json').version
985
+ });
986
+ res.set('Cache-Control', 'public, max-age=3600');
987
+ res.json(card);
988
+ });
989
+
971
990
  app.get('/', (req, res) => {
972
991
  res.json({ service: 'a2a', status: 'ok', agent: agentContext.name });
973
992
  });