a2acalling 0.6.24 → 0.6.26
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/bin/cli.js +30 -8
- package/package.json +1 -1
- package/src/routes/dashboard.js +2 -2
- package/src/server.js +11 -1
package/bin/cli.js
CHANGED
|
@@ -1480,26 +1480,48 @@ https://github.com/onthegonow/a2a_calling`;
|
|
|
1480
1480
|
console.log(`\n RECOMMENDED: Configure reverse proxy to route /api/a2a/* to port ${serverPort}`);
|
|
1481
1481
|
|
|
1482
1482
|
if (hasNginx) {
|
|
1483
|
-
console.log(`\n
|
|
1483
|
+
console.log(`\n ┌─────────────────────────────────────────────────────────────────┐`);
|
|
1484
|
+
console.log(` │ nginx config — add inside your server {} block │`);
|
|
1485
|
+
console.log(` │ File: /etc/nginx/sites-available/default │`);
|
|
1486
|
+
console.log(` └─────────────────────────────────────────────────────────────────┘`);
|
|
1487
|
+
console.log(``);
|
|
1488
|
+
console.log(` # ══════════════════════════════════════════════════════════════`);
|
|
1489
|
+
console.log(` # A2A (Agent-to-Agent) Protocol Proxy`);
|
|
1490
|
+
console.log(` # ══════════════════════════════════════════════════════════════`);
|
|
1491
|
+
console.log(` # A2A enables AI agents to communicate across different instances.`);
|
|
1492
|
+
console.log(` # This proxy routes federation requests from port 80 to the local`);
|
|
1493
|
+
console.log(` # A2A server on port ${serverPort}.`);
|
|
1494
|
+
console.log(` #`);
|
|
1495
|
+
console.log(` # Protocol: https://github.com/onthegonow/a2a_calling`);
|
|
1496
|
+
console.log(` # All requests to /api/a2a/* are agent-to-agent API calls.`);
|
|
1497
|
+
console.log(` # ══════════════════════════════════════════════════════════════`);
|
|
1484
1498
|
console.log(` location /api/a2a/ {`);
|
|
1485
1499
|
console.log(` proxy_pass http://127.0.0.1:${serverPort}/api/a2a/;`);
|
|
1486
1500
|
console.log(` proxy_http_version 1.1;`);
|
|
1487
1501
|
console.log(` proxy_set_header Host $host;`);
|
|
1488
1502
|
console.log(` proxy_set_header X-Real-IP $remote_addr;`);
|
|
1503
|
+
console.log(` proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;`);
|
|
1504
|
+
console.log(` proxy_set_header X-Forwarded-Proto $scheme;`);
|
|
1489
1505
|
console.log(` }`);
|
|
1490
|
-
console.log(
|
|
1491
|
-
console.log(
|
|
1492
|
-
console.log(` sudo nano /etc/nginx/sites-available/default`);
|
|
1493
|
-
console.log(`
|
|
1494
|
-
console.log(` sudo nginx -t
|
|
1506
|
+
console.log(``);
|
|
1507
|
+
console.log(` To apply:`);
|
|
1508
|
+
console.log(` 1. sudo nano /etc/nginx/sites-available/default`);
|
|
1509
|
+
console.log(` 2. Add the config above inside your server { } block`);
|
|
1510
|
+
console.log(` 3. sudo nginx -t`);
|
|
1511
|
+
console.log(` 4. sudo systemctl reload nginx`);
|
|
1495
1512
|
}
|
|
1496
1513
|
|
|
1497
1514
|
if (hasCaddy) {
|
|
1498
|
-
console.log(`\n
|
|
1515
|
+
console.log(`\n ┌─────────────────────────────────────────────────────────────────┐`);
|
|
1516
|
+
console.log(` │ Caddy config │`);
|
|
1517
|
+
console.log(` └─────────────────────────────────────────────────────────────────┘`);
|
|
1518
|
+
console.log(``);
|
|
1519
|
+
console.log(` # A2A (Agent-to-Agent) Protocol Proxy`);
|
|
1520
|
+
console.log(` # Routes federation requests to local A2A server on port ${serverPort}`);
|
|
1521
|
+
console.log(` # Protocol: https://github.com/onthegonow/a2a_calling`);
|
|
1499
1522
|
console.log(` handle /api/a2a/* {`);
|
|
1500
1523
|
console.log(` reverse_proxy 127.0.0.1:${serverPort}`);
|
|
1501
1524
|
console.log(` }`);
|
|
1502
|
-
console.log(` ───────────────────`);
|
|
1503
1525
|
}
|
|
1504
1526
|
|
|
1505
1527
|
console.log(`\n After reverse proxy is configured:`);
|
package/package.json
CHANGED
package/src/routes/dashboard.js
CHANGED
|
@@ -502,7 +502,7 @@ function createDashboardApiRouter(options = {}) {
|
|
|
502
502
|
manifest_file: require('../lib/disclosure').MANIFEST_FILE,
|
|
503
503
|
public_base_url: publicBaseUrl,
|
|
504
504
|
public_dashboard_url: publicBaseUrl ? `${publicBaseUrl}/dashboard/` : null,
|
|
505
|
-
callbook_install_base: publicBaseUrl ? `${publicBaseUrl}/callbook/install` : null,
|
|
505
|
+
callbook_install_base: publicBaseUrl ? `${publicBaseUrl}/api/a2a/callbook/install` : null,
|
|
506
506
|
invite_host: inviteResolution ? {
|
|
507
507
|
host: inviteResolution.host,
|
|
508
508
|
source: inviteResolution.source || null,
|
|
@@ -570,7 +570,7 @@ function createDashboardApiRouter(options = {}) {
|
|
|
570
570
|
const schemeOverride = String(process.env.A2A_PUBLIC_SCHEME || '').trim();
|
|
571
571
|
const scheme = schemeOverride || (isHttpsRequest(req) ? 'https' : 'http');
|
|
572
572
|
const baseUrl = resolvedHost ? `${scheme}://${resolvedHost}` : null;
|
|
573
|
-
const installUrl = baseUrl ? `${baseUrl}/callbook/install#code=${created.code}` : null;
|
|
573
|
+
const installUrl = baseUrl ? `${baseUrl}/api/a2a/callbook/install#code=${created.code}` : null;
|
|
574
574
|
|
|
575
575
|
return res.json({
|
|
576
576
|
success: true,
|
package/src/server.js
CHANGED
|
@@ -717,18 +717,28 @@ const app = express();
|
|
|
717
717
|
app.use(express.json());
|
|
718
718
|
|
|
719
719
|
// Minimal owner dashboard (local by default unless A2A_ADMIN_TOKEN is provided)
|
|
720
|
+
// All routes under /api/a2a/* so reverse proxy config stays simple.
|
|
720
721
|
app.use('/api/a2a/dashboard', createDashboardApiRouter({
|
|
721
722
|
tokenStore,
|
|
722
723
|
agentContext,
|
|
723
724
|
logger: logger.child({ component: 'a2a.dashboard' })
|
|
724
725
|
}));
|
|
725
|
-
app.use('/dashboard', createDashboardUiRouter({
|
|
726
|
+
app.use('/api/a2a/dashboard', createDashboardUiRouter({
|
|
726
727
|
tokenStore,
|
|
727
728
|
agentContext,
|
|
728
729
|
logger: logger.child({ component: 'a2a.dashboard' })
|
|
729
730
|
}));
|
|
730
731
|
|
|
731
732
|
// Callbook Remote pairing flow (public install page).
|
|
733
|
+
// Mounted under /api/a2a/ for reverse proxy compatibility.
|
|
734
|
+
app.use('/api/a2a/callbook', createCallbookRouter());
|
|
735
|
+
|
|
736
|
+
// Legacy routes for backwards compatibility (direct access without reverse proxy)
|
|
737
|
+
app.use('/dashboard', createDashboardUiRouter({
|
|
738
|
+
tokenStore,
|
|
739
|
+
agentContext,
|
|
740
|
+
logger: logger.child({ component: 'a2a.dashboard' })
|
|
741
|
+
}));
|
|
732
742
|
app.use('/callbook', createCallbookRouter());
|
|
733
743
|
|
|
734
744
|
app.use('/api/a2a', createRoutes({
|