@kagura-agent/atlas-openclaw 0.1.0 → 0.1.1
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/README.md +3 -1
- package/openclaw.plugin.json +6 -1
- package/package.json +1 -1
- package/worker.mjs +12 -2
package/README.md
CHANGED
|
@@ -14,7 +14,9 @@ In Atlas, choose **Connect AI tools → OpenClaw** from the account menu. The st
|
|
|
14
14
|
|
|
15
15
|
Restart the OpenClaw gateway after installation. Atlas shows **Connected** when the authenticated socket connects. Select the connection and send a message.
|
|
16
16
|
|
|
17
|
-
Use the public HTTPS Atlas origin when OpenClaw runs on another machine. Forward `/agent-worker` with WebSocket upgrades and `/api/agent-worker/` to the same Atlas server. HTTP is
|
|
17
|
+
Use the public HTTPS Atlas origin when OpenClaw runs on another machine. Forward `/agent-worker` with WebSocket upgrades and `/api/agent-worker/` to the same Atlas server. Loopback HTTP is supported for local development and SSH tunnels.
|
|
18
|
+
|
|
19
|
+
For development on a trusted LAN, set `channels.atlas.allowPrivateNetworkHttp` to `true` and use the Atlas machine's private IPv4 address in `baseUrl`, such as `http://10.172.208.53:4317`. Atlas must listen on its LAN interface, and the firewall must allow the OpenClaw machine to reach that port. This opt-in accepts only literal addresses in `10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`; public HTTP and HTTP hostnames remain rejected. Keep the token private and use HTTPS outside the trusted LAN. The browser's Google callback address can stay on localhost.
|
|
18
20
|
|
|
19
21
|
Tokens belong in OpenClaw's private configuration, never in messages, source files or shared installation snippets. Maintainer documentation (repository access required): [Connect agents](https://github.com/kagura-chen/atlas/blob/main/docs/product/AI-TOOLS.md#在画板中与-openclaw-对话) and [Current gaps](https://github.com/kagura-chen/atlas/blob/main/docs/CURRENT-GAPS.md).
|
|
20
22
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -20,7 +20,12 @@
|
|
|
20
20
|
"enabled": { "type": "boolean" },
|
|
21
21
|
"baseUrl": { "type": "string" },
|
|
22
22
|
"token": { "type": "string" },
|
|
23
|
-
"agentId": { "type": "string" }
|
|
23
|
+
"agentId": { "type": "string" },
|
|
24
|
+
"allowPrivateNetworkHttp": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"default": false,
|
|
27
|
+
"description": "Allow HTTP to an explicit private IPv4 address on a trusted local network"
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
"uiHints": { "token": { "sensitive": true } }
|
package/package.json
CHANGED
package/worker.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { isIP } from "node:net";
|
|
2
3
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
3
4
|
import WebSocket from "ws";
|
|
4
5
|
|
|
@@ -15,11 +16,20 @@ export function connection(account) {
|
|
|
15
16
|
!["http:", "https:"].includes(base.protocol)
|
|
16
17
|
)
|
|
17
18
|
throw new Error("Atlas requires an HTTP(S) origin");
|
|
19
|
+
const [first, second] = base.hostname.split(".").map(Number);
|
|
20
|
+
const privateIpv4 =
|
|
21
|
+
isIP(base.hostname) === 4 &&
|
|
22
|
+
(first === 10 ||
|
|
23
|
+
(first === 172 && second >= 16 && second <= 31) ||
|
|
24
|
+
(first === 192 && second === 168));
|
|
18
25
|
if (
|
|
19
26
|
base.protocol === "http:" &&
|
|
20
|
-
!["localhost", "127.0.0.1", "[::1]"].includes(base.hostname)
|
|
27
|
+
!["localhost", "127.0.0.1", "[::1]"].includes(base.hostname) &&
|
|
28
|
+
!(account.allowPrivateNetworkHttp === true && privateIpv4)
|
|
21
29
|
)
|
|
22
|
-
throw new Error(
|
|
30
|
+
throw new Error(
|
|
31
|
+
"Use HTTPS, or enable allowPrivateNetworkHttp for a private IPv4 address",
|
|
32
|
+
);
|
|
23
33
|
return base.origin;
|
|
24
34
|
}
|
|
25
35
|
export function client(account) {
|