@moltium/world-core 0.1.21 → 0.1.22

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
@@ -3,7 +3,7 @@ import {
3
3
  createLogger,
4
4
  logger,
5
5
  normalizeAgentUrl
6
- } from "./chunk-JW3PZRCW.js";
6
+ } from "./chunk-DWXNX5V3.js";
7
7
 
8
8
  // src/config/types.ts
9
9
  function profileFromCard(card, walletAddress) {
@@ -791,13 +791,14 @@ var WorldA2AClient = class {
791
791
  * Add an agent to the client pool
792
792
  */
793
793
  addAgent(agentUrl) {
794
- if (this.clients.has(agentUrl)) {
795
- logger4.debug(`Agent already in client pool: ${agentUrl}`);
794
+ const baseUrl = this.extractBaseUrl(agentUrl);
795
+ if (this.clients.has(baseUrl)) {
796
+ logger4.debug(`Agent already in client pool: ${baseUrl}`);
796
797
  return;
797
798
  }
798
- const client = new A2AClient({ agentUrl });
799
- this.clients.set(agentUrl, client);
800
- logger4.info(`Added agent to A2A client pool: ${agentUrl}`);
799
+ const client = new A2AClient({ agentUrl: baseUrl });
800
+ this.clients.set(baseUrl, client);
801
+ logger4.info(`Added agent to A2A client pool: ${baseUrl}`);
801
802
  }
802
803
  /**
803
804
  * Remove an agent from the client pool
@@ -867,6 +868,17 @@ var WorldA2AClient = class {
867
868
  getAgentUrls() {
868
869
  return Array.from(this.clients.keys());
869
870
  }
871
+ /**
872
+ * Extract base URL (protocol://host:port) from a full URL
873
+ */
874
+ extractBaseUrl(url) {
875
+ try {
876
+ const parsed = new URL(url);
877
+ return `${parsed.protocol}//${parsed.host}`;
878
+ } catch {
879
+ return url;
880
+ }
881
+ }
870
882
  };
871
883
 
872
884
  // src/engine/WorldActions.ts
@@ -1677,7 +1689,7 @@ function createWorldApp(world) {
1677
1689
  logger10.info(`Agent join request from: ${agentUrl}`, {
1678
1690
  wallet: walletAddress || "none"
1679
1691
  });
1680
- const cardFetcher = new (await import("./CardFetcher-3QKJ2I5P.js")).CardFetcher();
1692
+ const cardFetcher = new (await import("./CardFetcher-4ENWKI6E.js")).CardFetcher();
1681
1693
  const result = await cardFetcher.fetchCard(agentUrl);
1682
1694
  if (!result.success || !result.card) {
1683
1695
  return res.status(400).json({