@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/{CardFetcher-3QKJ2I5P.js → CardFetcher-4ENWKI6E.js} +2 -2
- package/dist/CardFetcher-UCJGPZ7X.cjs +9 -0
- package/dist/{CardFetcher-AR7IANM7.cjs.map → CardFetcher-UCJGPZ7X.cjs.map} +1 -1
- package/dist/{chunk-NEXCYEQT.cjs → chunk-DHQFXIEW.cjs} +2 -2
- package/dist/chunk-DHQFXIEW.cjs.map +1 -0
- package/dist/{chunk-JW3PZRCW.js → chunk-DWXNX5V3.js} +2 -2
- package/dist/chunk-DWXNX5V3.js.map +1 -0
- package/dist/index.cjs +31 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/CardFetcher-AR7IANM7.cjs +0 -9
- package/dist/chunk-JW3PZRCW.js.map +0 -1
- package/dist/chunk-NEXCYEQT.cjs.map +0 -1
- /package/dist/{CardFetcher-3QKJ2I5P.js.map → CardFetcher-4ENWKI6E.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createLogger,
|
|
4
4
|
logger,
|
|
5
5
|
normalizeAgentUrl
|
|
6
|
-
} from "./chunk-
|
|
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
|
-
|
|
795
|
-
|
|
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(
|
|
800
|
-
logger4.info(`Added agent to A2A client pool: ${
|
|
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-
|
|
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({
|