openclaw-aegis 1.2.2 → 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 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(18789),
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");
@@ -1086,18 +1100,6 @@ function ask(rl, question, defaultValue) {
1086
1100
  });
1087
1101
  });
1088
1102
  }
1089
- function detectPort() {
1090
- try {
1091
- const configPath = expandHome("~/.openclaw/openclaw.json");
1092
- if (fs8.existsSync(configPath)) {
1093
- const raw = JSON.parse(fs8.readFileSync(configPath, "utf-8"));
1094
- const gateway = raw?.gateway;
1095
- if (gateway?.port && typeof gateway.port === "number") return gateway.port;
1096
- }
1097
- } catch {
1098
- }
1099
- return 3e3;
1100
- }
1101
1103
  function detectPlatform() {
1102
1104
  if (os5.platform() === "darwin") {
1103
1105
  return { type: "launchd", pidFile: "ai.openclaw.gateway" };
@@ -1169,7 +1171,7 @@ var initCommand = new import_commander3.Command("init").description("Interactive
1169
1171
  }
1170
1172
  rl.close();
1171
1173
  }
1172
- const detectedPort = detectPort();
1174
+ const detectedPort = detectGatewayPort();
1173
1175
  const channels = [];
1174
1176
  if (opts.auto) {
1175
1177
  console.log("Auto-detecting configuration...");