@teamclaws/teamclaw 2026.8.0 → 2026.8.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/dist/api.js +1 -0
- package/dist/index.js +325 -0
- package/dist/src/config.js +381 -0
- package/dist/src/controller/controller-capacity.js +14 -0
- package/dist/src/controller/controller-service.js +393 -0
- package/dist/src/controller/controller-tools.js +582 -0
- package/dist/src/controller/delivery-report.js +458 -0
- package/dist/src/controller/github-auth.js +564 -0
- package/dist/src/controller/http-server.js +6032 -0
- package/dist/src/controller/kickoff-orchestrator.js +220 -0
- package/dist/src/controller/managed-gateway-process.js +286 -0
- package/dist/src/controller/message-router.js +38 -0
- package/dist/src/controller/orchestration-manifest.js +173 -0
- package/dist/src/controller/preview-manager.js +586 -0
- package/dist/src/controller/prompt-injector.js +187 -0
- package/dist/src/controller/role-inference.js +35 -0
- package/dist/src/controller/task-router.js +67 -0
- package/dist/src/controller/tunnel-manager.js +548 -0
- package/dist/src/controller/websocket.js +42 -0
- package/dist/src/controller/worker-provisioning.js +1648 -0
- package/dist/src/discovery.js +86 -0
- package/dist/src/git-collaboration.js +694 -0
- package/dist/src/identity.js +131 -0
- package/dist/src/install-defaults.js +1 -0
- package/dist/src/interaction-contracts.js +531 -0
- package/dist/src/networking.js +91 -0
- package/dist/src/openclaw-workspace.js +903 -0
- package/dist/src/prompt-policy.js +373 -0
- package/dist/src/protocol.js +58 -0
- package/dist/src/roles.js +349 -0
- package/dist/src/state.js +183 -0
- package/dist/src/task-executor.js +1033 -0
- package/dist/src/teamauto/github-client.js +192 -0
- package/dist/src/teamauto/norms.js +85 -0
- package/dist/src/teamauto/repo-sync.js +201 -0
- package/dist/src/teamauto/scanner.js +179 -0
- package/dist/src/teamauto/schedule.js +123 -0
- package/dist/src/teamauto/scheduler.js +688 -0
- package/dist/src/teamauto/store.js +133 -0
- package/dist/src/types.js +243 -0
- package/dist/src/ui/app.js +4292 -0
- package/dist/src/ui/assets/teamclaw-app-icon.png +0 -0
- package/dist/src/ui/github-login.html +296 -0
- package/dist/src/ui/index.html +414 -0
- package/dist/src/ui/style.css +2611 -0
- package/dist/src/worker/http-handler.js +146 -0
- package/dist/src/worker/message-queue.js +24 -0
- package/dist/src/worker/prompt-injector.js +42 -0
- package/dist/src/worker/skill-installer.js +253 -0
- package/dist/src/worker/tools.js +541 -0
- package/dist/src/worker/worker-service.js +234 -0
- package/dist/src/workspace-browser.js +269 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
function isPrivateLanIpv4(address) {
|
|
4
|
+
if (address.startsWith("10.") || address.startsWith("192.168.")) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
const parts = address.split(".").map((value) => Number.parseInt(value, 10));
|
|
8
|
+
return parts.length === 4 && parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31;
|
|
9
|
+
}
|
|
10
|
+
function rankLanAddress(address) {
|
|
11
|
+
if (address.startsWith("192.168.")) {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
if (address.startsWith("10.")) {
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
const parts = address.split(".").map((value) => Number.parseInt(value, 10));
|
|
18
|
+
if (parts.length === 4 && parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31) {
|
|
19
|
+
return 2;
|
|
20
|
+
}
|
|
21
|
+
return 3;
|
|
22
|
+
}
|
|
23
|
+
function parseDefaultRouteInterface(text) {
|
|
24
|
+
const directMatch = text.match(/(?:^|\n)\s*interface:\s*(\S+)/i);
|
|
25
|
+
if (directMatch?.[1]) {
|
|
26
|
+
return directMatch[1];
|
|
27
|
+
}
|
|
28
|
+
const devMatch = text.match(/(?:^|\n)default(?:\s+via\s+\S+)?\s+dev\s+(\S+)/i);
|
|
29
|
+
if (devMatch?.[1]) {
|
|
30
|
+
return devMatch[1];
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
function probeDefaultRouteInterface() {
|
|
35
|
+
const candidates = process.platform === "darwin"
|
|
36
|
+
? [
|
|
37
|
+
{ command: "route", args: ["-n", "get", "default"] },
|
|
38
|
+
{ command: "ip", args: ["route", "show", "default"] },
|
|
39
|
+
]
|
|
40
|
+
: [
|
|
41
|
+
{ command: "ip", args: ["route", "show", "default"] },
|
|
42
|
+
{ command: "route", args: ["-n", "get", "default"] },
|
|
43
|
+
];
|
|
44
|
+
for (const candidate of candidates) {
|
|
45
|
+
const result = spawnSync(candidate.command, candidate.args, { encoding: "utf8" });
|
|
46
|
+
if (result.status !== 0 || result.error) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const interfaceName = parseDefaultRouteInterface(result.stdout || "");
|
|
50
|
+
if (interfaceName) {
|
|
51
|
+
return interfaceName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
function listNonInternalIpv4Addresses() {
|
|
57
|
+
const addresses = [];
|
|
58
|
+
const interfaces = os.networkInterfaces();
|
|
59
|
+
for (const records of Object.values(interfaces)) {
|
|
60
|
+
for (const record of records ?? []) {
|
|
61
|
+
if (!record || record.internal || record.family !== "IPv4") {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
addresses.push(record.address);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return addresses.filter((value, index, values) => values.indexOf(value) === index);
|
|
68
|
+
}
|
|
69
|
+
export function resolvePreferredLanAddress() {
|
|
70
|
+
const interfaces = os.networkInterfaces();
|
|
71
|
+
const defaultRouteInterface = probeDefaultRouteInterface();
|
|
72
|
+
if (defaultRouteInterface) {
|
|
73
|
+
const records = (interfaces[defaultRouteInterface] ?? [])
|
|
74
|
+
.filter((record) => Boolean(record) && record.family === "IPv4" && !record.internal);
|
|
75
|
+
const preferredPrivate = records.find((record) => isPrivateLanIpv4(record.address));
|
|
76
|
+
if (preferredPrivate) {
|
|
77
|
+
return preferredPrivate.address;
|
|
78
|
+
}
|
|
79
|
+
if (records[0]) {
|
|
80
|
+
return records[0].address;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const privateCandidates = listNonInternalIpv4Addresses()
|
|
84
|
+
.filter((address) => isPrivateLanIpv4(address))
|
|
85
|
+
.sort((left, right) => rankLanAddress(left) - rankLanAddress(right) || left.localeCompare(right));
|
|
86
|
+
if (privateCandidates[0]) {
|
|
87
|
+
return privateCandidates[0];
|
|
88
|
+
}
|
|
89
|
+
const fallback = listNonInternalIpv4Addresses()[0];
|
|
90
|
+
return fallback || null;
|
|
91
|
+
}
|