@moltium/core 0.1.25 → 0.1.27

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/dist/index.js CHANGED
@@ -3040,7 +3040,7 @@ var AgentCardBuilder = class {
3040
3040
  name: config.name,
3041
3041
  description: config.personality.bio || `${config.name} - An autonomous AI agent`,
3042
3042
  protocolVersion: "0.3.0",
3043
- version: "0.1.25",
3043
+ version: "0.1.27",
3044
3044
  url: `${baseUrl}/a2a/jsonrpc`,
3045
3045
  skills,
3046
3046
  capabilities,
@@ -3489,8 +3489,10 @@ function createApp(agent, options = {}) {
3489
3489
  if (options.enableA2A !== false) {
3490
3490
  const port = options.port || parseInt(process.env.PORT || "3000", 10);
3491
3491
  const host = options.host || "0.0.0.0";
3492
- const protocol = host === "localhost" || host === "127.0.0.1" || host === "0.0.0.0" ? "http" : "https";
3493
- const baseUrl = options.a2aConfig?.baseUrl || `${protocol}://${host}:${port}`;
3492
+ const cardHost = host === "0.0.0.0" ? "localhost" : host;
3493
+ const protocol = cardHost === "localhost" || cardHost === "127.0.0.1" ? "http" : "https";
3494
+ const rawBaseUrl = options.a2aConfig?.baseUrl || `${protocol}://${cardHost}:${port}`;
3495
+ const baseUrl = rawBaseUrl.replace("://0.0.0.0:", "://localhost:");
3494
3496
  const a2aIntegration = createA2AIntegration(agent, {
3495
3497
  a2aConfig: {
3496
3498
  enabled: true,
@@ -3517,8 +3519,9 @@ async function startServer(agent, options = {}) {
3517
3519
  app.listen(port, host, () => {
3518
3520
  logger10.info(`Agent "${agent.name}" running at http://${host}:${port}`);
3519
3521
  if (options.enableA2A !== false) {
3520
- const protocol = host === "localhost" || host === "127.0.0.1" ? "http" : "https";
3521
- const baseUrl = `${protocol}://${host}:${port}`;
3522
+ const logHost = host === "0.0.0.0" ? "localhost" : host;
3523
+ const protocol = logHost === "localhost" || logHost === "127.0.0.1" ? "http" : "https";
3524
+ const baseUrl = `${protocol}://${logHost}:${port}`;
3522
3525
  logger10.info("A2A Protocol Endpoints:");
3523
3526
  logger10.info(` Agent Card: ${baseUrl}/.well-known/agent-card.json`);
3524
3527
  logger10.info(` JSON-RPC: ${baseUrl}/a2a/jsonrpc`);