@kenhkl/agent-moss 0.17.20 → 0.17.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/cli.js +0 -16
- package/dist/engine/coordinator.js +0 -16
- package/dist/server.js +0 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -40,10 +40,6 @@ function getRulesRoot() {
|
|
|
40
40
|
const raw = (process.env[ENV_RULES_ROOT] ?? "").trim();
|
|
41
41
|
return raw ? raw : null;
|
|
42
42
|
}
|
|
43
|
-
function isRoot() {
|
|
44
|
-
const getuid = process.getuid;
|
|
45
|
-
return typeof getuid === "function" && getuid() === 0;
|
|
46
|
-
}
|
|
47
43
|
function resolveExplicitOwnerHome() {
|
|
48
44
|
for (const name of [process.env.SUDO_USER, process.env.LOGNAME, process.env.USER]) {
|
|
49
45
|
if (name && name !== "root" && name !== "") {
|
|
@@ -71,12 +67,6 @@ function listOwnerHomes() {
|
|
|
71
67
|
}
|
|
72
68
|
return homes;
|
|
73
69
|
}
|
|
74
|
-
function resolveOwnerHome() {
|
|
75
|
-
const explicit = resolveExplicitOwnerHome();
|
|
76
|
-
if (explicit) return explicit;
|
|
77
|
-
const owners = listOwnerHomes();
|
|
78
|
-
return owners.length > 0 ? owners[0] : null;
|
|
79
|
-
}
|
|
80
70
|
function homeOf(name) {
|
|
81
71
|
try {
|
|
82
72
|
const passwd = readFileSync("/etc/passwd", "utf-8");
|
|
@@ -94,12 +84,6 @@ function homeOf(name) {
|
|
|
94
84
|
function getDataRoot() {
|
|
95
85
|
const envPath = process.env[ENV_DATA_ROOT];
|
|
96
86
|
if (envPath) return envPath;
|
|
97
|
-
if (isRoot()) {
|
|
98
|
-
const ownerHome = resolveOwnerHome();
|
|
99
|
-
if (ownerHome) {
|
|
100
|
-
return join(ownerHome, ".config", "agentmoss");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
87
|
return DEFAULT_DATA_ROOT;
|
|
104
88
|
}
|
|
105
89
|
function getInstance() {
|
|
@@ -33,10 +33,6 @@ function getRulesRoot() {
|
|
|
33
33
|
const raw = (process.env[ENV_RULES_ROOT] ?? "").trim();
|
|
34
34
|
return raw ? raw : null;
|
|
35
35
|
}
|
|
36
|
-
function isRoot() {
|
|
37
|
-
const getuid = process.getuid;
|
|
38
|
-
return typeof getuid === "function" && getuid() === 0;
|
|
39
|
-
}
|
|
40
36
|
function resolveExplicitOwnerHome() {
|
|
41
37
|
for (const name of [process.env.SUDO_USER, process.env.LOGNAME, process.env.USER]) {
|
|
42
38
|
if (name && name !== "root" && name !== "") {
|
|
@@ -64,12 +60,6 @@ function listOwnerHomes() {
|
|
|
64
60
|
}
|
|
65
61
|
return homes;
|
|
66
62
|
}
|
|
67
|
-
function resolveOwnerHome() {
|
|
68
|
-
const explicit = resolveExplicitOwnerHome();
|
|
69
|
-
if (explicit) return explicit;
|
|
70
|
-
const owners = listOwnerHomes();
|
|
71
|
-
return owners.length > 0 ? owners[0] : null;
|
|
72
|
-
}
|
|
73
63
|
function homeOf(name) {
|
|
74
64
|
try {
|
|
75
65
|
const passwd = readFileSync("/etc/passwd", "utf-8");
|
|
@@ -87,12 +77,6 @@ function homeOf(name) {
|
|
|
87
77
|
function getDataRoot() {
|
|
88
78
|
const envPath = process.env[ENV_DATA_ROOT];
|
|
89
79
|
if (envPath) return envPath;
|
|
90
|
-
if (isRoot()) {
|
|
91
|
-
const ownerHome = resolveOwnerHome();
|
|
92
|
-
if (ownerHome) {
|
|
93
|
-
return join(ownerHome, ".config", "agentmoss");
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
80
|
return DEFAULT_DATA_ROOT;
|
|
97
81
|
}
|
|
98
82
|
function getInstance() {
|
package/dist/server.js
CHANGED
|
@@ -39,10 +39,6 @@ function getRulesRoot() {
|
|
|
39
39
|
const raw = (process.env[ENV_RULES_ROOT] ?? "").trim();
|
|
40
40
|
return raw ? raw : null;
|
|
41
41
|
}
|
|
42
|
-
function isRoot() {
|
|
43
|
-
const getuid = process.getuid;
|
|
44
|
-
return typeof getuid === "function" && getuid() === 0;
|
|
45
|
-
}
|
|
46
42
|
function resolveExplicitOwnerHome() {
|
|
47
43
|
for (const name of [process.env.SUDO_USER, process.env.LOGNAME, process.env.USER]) {
|
|
48
44
|
if (name && name !== "root" && name !== "") {
|
|
@@ -70,12 +66,6 @@ function listOwnerHomes() {
|
|
|
70
66
|
}
|
|
71
67
|
return homes;
|
|
72
68
|
}
|
|
73
|
-
function resolveOwnerHome() {
|
|
74
|
-
const explicit = resolveExplicitOwnerHome();
|
|
75
|
-
if (explicit) return explicit;
|
|
76
|
-
const owners = listOwnerHomes();
|
|
77
|
-
return owners.length > 0 ? owners[0] : null;
|
|
78
|
-
}
|
|
79
69
|
function homeOf(name) {
|
|
80
70
|
try {
|
|
81
71
|
const passwd = readFileSync("/etc/passwd", "utf-8");
|
|
@@ -93,12 +83,6 @@ function homeOf(name) {
|
|
|
93
83
|
function getDataRoot() {
|
|
94
84
|
const envPath = process.env[ENV_DATA_ROOT];
|
|
95
85
|
if (envPath) return envPath;
|
|
96
|
-
if (isRoot()) {
|
|
97
|
-
const ownerHome = resolveOwnerHome();
|
|
98
|
-
if (ownerHome) {
|
|
99
|
-
return join(ownerHome, ".config", "agentmoss");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
86
|
return DEFAULT_DATA_ROOT;
|
|
103
87
|
}
|
|
104
88
|
function getInstance() {
|