@decentnetwork/lan 0.1.39 → 0.1.40
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/cli/commands.js +17 -3
- package/package.json +1 -1
package/dist/cli/commands.js
CHANGED
|
@@ -883,10 +883,24 @@ export async function cmdProxyListHosts(args) {
|
|
|
883
883
|
export async function cmdProxyUse(args) {
|
|
884
884
|
const dir = args.configDir || ConfigLoader.defaultConfigDir();
|
|
885
885
|
const config = await ConfigLoader.load(resolve(dir, "config.yaml"));
|
|
886
|
-
const
|
|
887
|
-
const
|
|
886
|
+
const { peers, source } = await fetchLiveIpam(config);
|
|
887
|
+
const stripDomain = (s) => s.replace(/\.[A-Za-z][A-Za-z0-9-]*$/, "");
|
|
888
|
+
const record = peers.find((p) => p.carrierId === args.peer ||
|
|
889
|
+
p.name === args.peer ||
|
|
890
|
+
p.name === stripDomain(args.peer) ||
|
|
891
|
+
p.virtualIp === args.peer);
|
|
888
892
|
if (!record) {
|
|
889
|
-
console.error(`Unknown peer: ${args.peer}
|
|
893
|
+
console.error(`Unknown peer: ${args.peer}.`);
|
|
894
|
+
if (source === "daemon") {
|
|
895
|
+
console.error(`Live peers from daemon:`);
|
|
896
|
+
for (const p of peers) {
|
|
897
|
+
console.error(` ${p.name} (${p.virtualIp})`);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
console.error(`Daemon is down — start it with 'agentnet up' (dora populates IPAM automatically),`);
|
|
902
|
+
console.error(`or add the peer manually via 'agentnet ipam assign'.`);
|
|
903
|
+
}
|
|
890
904
|
process.exit(1);
|
|
891
905
|
}
|
|
892
906
|
const port = config.proxy?.port ?? 8888;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|