openclaw-aegis 1.2.1 → 1.2.3
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/index.js +17 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -93,7 +93,7 @@ var aegisConfigSchema = import_zod.z.object({
|
|
|
93
93
|
gateway: import_zod.z.object({
|
|
94
94
|
configPath: import_zod.z.string().default("~/.openclaw/openclaw.json"),
|
|
95
95
|
pidFile: import_zod.z.string().default("openclaw-gateway.service"),
|
|
96
|
-
port: import_zod.z.number().int().min(1).max(65535).default(
|
|
96
|
+
port: import_zod.z.number().int().min(1).max(65535).default(3e3),
|
|
97
97
|
logPath: import_zod.z.string().default("~/.openclaw/logs/gateway.log"),
|
|
98
98
|
healthEndpoint: import_zod.z.string().default("/health")
|
|
99
99
|
}).default({}),
|
|
@@ -172,6 +172,7 @@ function loadConfig(configPath) {
|
|
|
172
172
|
const resolvedPath = expandHome(configPath);
|
|
173
173
|
if (!fs.existsSync(resolvedPath)) {
|
|
174
174
|
const defaults = aegisConfigSchema.parse({});
|
|
175
|
+
defaults.gateway.port = detectGatewayPort();
|
|
175
176
|
return resolveConfigPaths(defaults);
|
|
176
177
|
}
|
|
177
178
|
const raw = fs.readFileSync(resolvedPath, "utf-8");
|
|
@@ -179,6 +180,19 @@ function loadConfig(configPath) {
|
|
|
179
180
|
const validated = aegisConfigSchema.parse(parsed);
|
|
180
181
|
return resolveConfigPaths(validated);
|
|
181
182
|
}
|
|
183
|
+
function detectGatewayPort() {
|
|
184
|
+
try {
|
|
185
|
+
const configPath = expandHome("~/.openclaw/openclaw.json");
|
|
186
|
+
if (fs.existsSync(configPath)) {
|
|
187
|
+
const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
188
|
+
const gateway = raw?.gateway;
|
|
189
|
+
if (gateway?.port && typeof gateway.port === "number") return gateway.port;
|
|
190
|
+
if (raw?.port && typeof raw.port === "number") return raw.port;
|
|
191
|
+
}
|
|
192
|
+
} catch {
|
|
193
|
+
}
|
|
194
|
+
return 3e3;
|
|
195
|
+
}
|
|
182
196
|
var DEFAULT_CONFIG_PATH = "~/.openclaw/aegis/config.toml";
|
|
183
197
|
function getConfigDir() {
|
|
184
198
|
return expandHome("~/.openclaw/aegis");
|
|
@@ -464,9 +478,7 @@ async function httpHealthProbe(target, port, endpoint = "/health", timeoutMs = 5
|
|
|
464
478
|
|
|
465
479
|
// src/health/probes/config.ts
|
|
466
480
|
var fs3 = __toESM(require("fs"));
|
|
467
|
-
var REQUIRED_CONFIG_PATHS = [
|
|
468
|
-
{ path: [["gateway", "port"], ["port"]], label: "gateway.port" }
|
|
469
|
-
];
|
|
481
|
+
var REQUIRED_CONFIG_PATHS = [];
|
|
470
482
|
var POISON_KEYS = ["autoAck", "autoAckMessage"];
|
|
471
483
|
async function configProbe(_target, configPath) {
|
|
472
484
|
const start = Date.now();
|
|
@@ -1088,18 +1100,6 @@ function ask(rl, question, defaultValue) {
|
|
|
1088
1100
|
});
|
|
1089
1101
|
});
|
|
1090
1102
|
}
|
|
1091
|
-
function detectPort() {
|
|
1092
|
-
try {
|
|
1093
|
-
const configPath = expandHome("~/.openclaw/openclaw.json");
|
|
1094
|
-
if (fs8.existsSync(configPath)) {
|
|
1095
|
-
const raw = JSON.parse(fs8.readFileSync(configPath, "utf-8"));
|
|
1096
|
-
const gateway = raw?.gateway;
|
|
1097
|
-
if (gateway?.port && typeof gateway.port === "number") return gateway.port;
|
|
1098
|
-
}
|
|
1099
|
-
} catch {
|
|
1100
|
-
}
|
|
1101
|
-
return 3e3;
|
|
1102
|
-
}
|
|
1103
1103
|
function detectPlatform() {
|
|
1104
1104
|
if (os5.platform() === "darwin") {
|
|
1105
1105
|
return { type: "launchd", pidFile: "ai.openclaw.gateway" };
|
|
@@ -1171,7 +1171,7 @@ var initCommand = new import_commander3.Command("init").description("Interactive
|
|
|
1171
1171
|
}
|
|
1172
1172
|
rl.close();
|
|
1173
1173
|
}
|
|
1174
|
-
const detectedPort =
|
|
1174
|
+
const detectedPort = detectGatewayPort();
|
|
1175
1175
|
const channels = [];
|
|
1176
1176
|
if (opts.auto) {
|
|
1177
1177
|
console.log("Auto-detecting configuration...");
|