a2acalling 0.6.26 → 0.6.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "a2acalling",
3
- "version": "0.6.26",
3
+ "version": "0.6.28",
4
4
  "description": "Agent-to-agent calling for OpenClaw - A2A agent communication",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -117,10 +117,10 @@ function createCallbookRouter() {
117
117
  setStatus('Connected. Session cookie stored in your browser.', 'ok');
118
118
  openBtn.style.display = 'inline-block';
119
119
  openBtn.addEventListener('click', () => {
120
- window.location.href = result.dashboard_path || '/dashboard/';
120
+ window.location.href = result.dashboard_path || '/api/a2a/dashboard/';
121
121
  });
122
122
  window.setTimeout(() => {
123
- window.location.href = result.dashboard_path || '/dashboard/';
123
+ window.location.href = result.dashboard_path || '/api/a2a/dashboard/';
124
124
  }, 350);
125
125
  } catch (err) {
126
126
  setStatus('Failed: ' + err.message, 'error');
@@ -451,7 +451,7 @@ function createDashboardApiRouter(options = {}) {
451
451
  return res.json({
452
452
  success: true,
453
453
  device: result.device,
454
- dashboard_path: '/dashboard/'
454
+ dashboard_path: '/api/a2a/dashboard/'
455
455
  });
456
456
  });
457
457
 
@@ -465,10 +465,26 @@ function createDashboardApiRouter(options = {}) {
465
465
  let warnings = [];
466
466
  let inviteResolution = null;
467
467
  try {
468
+ // Determine default port based on config hostname:
469
+ // - If hostname has no port (e.g., "149.28.213.47"), assume port 80 (reverse proxy)
470
+ // - If hostname has explicit port, use that
471
+ // - Otherwise fall back to server port or env
472
+ const agent = context.config?.getAgent?.() || {};
473
+ const hostname = agent.hostname || '';
474
+ const hasExplicitPort = hostname.includes(':') && !hostname.startsWith('[');
475
+ let defaultPort;
476
+ if (hasExplicitPort) {
477
+ defaultPort = null; // Will be parsed from hostname
478
+ } else if (hostname && !hostname.includes('localhost')) {
479
+ defaultPort = 80; // External hostname without port = assume reverse proxy on 80
480
+ } else {
481
+ defaultPort = process.env.PORT || process.env.A2A_PORT || 80;
482
+ }
483
+
468
484
  const resolved = await resolveInviteHost({
469
485
  config: context.config,
470
486
  fallbackHost: req.headers.host || process.env.HOSTNAME || 'localhost',
471
- defaultPort: process.env.PORT || process.env.A2A_PORT || 3001,
487
+ defaultPort,
472
488
  refreshExternalIp: refreshIp,
473
489
  forceRefreshExternalIp: refreshIp,
474
490
  alwaysLookupExternalIp: true,
@@ -554,10 +570,23 @@ function createDashboardApiRouter(options = {}) {
554
570
  let resolvedHost = null;
555
571
  let warnings = [];
556
572
  try {
573
+ // Use same port logic as /status endpoint
574
+ const agent = context.config?.getAgent?.() || {};
575
+ const hostname = agent.hostname || '';
576
+ const hasExplicitPort = hostname.includes(':') && !hostname.startsWith('[');
577
+ let defaultPort;
578
+ if (hasExplicitPort) {
579
+ defaultPort = null;
580
+ } else if (hostname && !hostname.includes('localhost')) {
581
+ defaultPort = 80;
582
+ } else {
583
+ defaultPort = process.env.PORT || process.env.A2A_PORT || 80;
584
+ }
585
+
557
586
  const resolved = await resolveInviteHost({
558
587
  config: context.config,
559
588
  fallbackHost: req.headers.host || process.env.HOSTNAME || 'localhost',
560
- defaultPort: process.env.PORT || process.env.A2A_PORT || 3001,
589
+ defaultPort,
561
590
  refreshExternalIp: true,
562
591
  forceRefreshExternalIp: true
563
592
  });