@askexenow/exe-os 0.9.123 → 0.9.124

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/bin/cli.js CHANGED
@@ -937,7 +937,7 @@ var DEFAULT_MCP_HTTP_PORT, DEFAULT_MCP_HTTP_AGENT_ID, DEFAULT_MCP_HTTP_AGENT_ROL
937
937
  var init_mcp_http_config = __esm({
938
938
  "src/adapters/mcp-http-config.ts"() {
939
939
  "use strict";
940
- DEFAULT_MCP_HTTP_PORT = "48739";
940
+ DEFAULT_MCP_HTTP_PORT = "48700";
941
941
  DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
942
942
  DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
943
943
  }
@@ -1486,7 +1486,7 @@ var DEFAULT_MCP_HTTP_PORT, DEFAULT_MCP_HTTP_AGENT_ID, DEFAULT_MCP_HTTP_AGENT_ROL
1486
1486
  var init_mcp_http_config = __esm({
1487
1487
  "src/adapters/mcp-http-config.ts"() {
1488
1488
  "use strict";
1489
- DEFAULT_MCP_HTTP_PORT = "48739";
1489
+ DEFAULT_MCP_HTTP_PORT = "48700";
1490
1490
  DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
1491
1491
  DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
1492
1492
  }
@@ -5204,7 +5204,7 @@ var DEFAULT_MCP_HTTP_PORT, DEFAULT_MCP_HTTP_AGENT_ID, DEFAULT_MCP_HTTP_AGENT_ROL
5204
5204
  var init_mcp_http_config = __esm({
5205
5205
  "src/adapters/mcp-http-config.ts"() {
5206
5206
  "use strict";
5207
- DEFAULT_MCP_HTTP_PORT = "48739";
5207
+ DEFAULT_MCP_HTTP_PORT = "48700";
5208
5208
  DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
5209
5209
  DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
5210
5210
  }
@@ -5194,7 +5194,7 @@ var DEFAULT_MCP_HTTP_PORT, DEFAULT_MCP_HTTP_AGENT_ID, DEFAULT_MCP_HTTP_AGENT_ROL
5194
5194
  var init_mcp_http_config = __esm({
5195
5195
  "src/adapters/mcp-http-config.ts"() {
5196
5196
  "use strict";
5197
- DEFAULT_MCP_HTTP_PORT = "48739";
5197
+ DEFAULT_MCP_HTTP_PORT = "48700";
5198
5198
  DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
5199
5199
  DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
5200
5200
  }
@@ -707,7 +707,7 @@ var DEFAULT_MCP_HTTP_PORT, DEFAULT_MCP_HTTP_AGENT_ID, DEFAULT_MCP_HTTP_AGENT_ROL
707
707
  var init_mcp_http_config = __esm({
708
708
  "src/adapters/mcp-http-config.ts"() {
709
709
  "use strict";
710
- DEFAULT_MCP_HTTP_PORT = "48739";
710
+ DEFAULT_MCP_HTTP_PORT = "48700";
711
711
  DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
712
712
  DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
713
713
  }
@@ -18913,6 +18913,56 @@ function startServer() {
18913
18913
  });
18914
18914
  _mcpHttpReady = startMcpHttpServer();
18915
18915
  }
18916
+ var FIXED_MCP_PORT = 48700;
18917
+ async function resolveAndClaimPort() {
18918
+ if (process.env.EXE_MCP_PORT) {
18919
+ const envPort = parseInt(process.env.EXE_MCP_PORT, 10);
18920
+ if (envPort > 0) return envPort;
18921
+ }
18922
+ const targetPort = FIXED_MCP_PORT;
18923
+ try {
18924
+ const http = await import("http");
18925
+ const isHealthy = await new Promise((resolve) => {
18926
+ const req = http.request(
18927
+ { hostname: "127.0.0.1", port: targetPort, path: "/health", method: "GET", timeout: 2e3 },
18928
+ (res) => {
18929
+ resolve(res.statusCode === 200);
18930
+ }
18931
+ );
18932
+ req.on("error", () => resolve(false));
18933
+ req.on("timeout", () => {
18934
+ req.destroy();
18935
+ resolve(false);
18936
+ });
18937
+ req.end();
18938
+ });
18939
+ if (isHealthy) {
18940
+ process.stderr.write(`[exed] Port ${targetPort} has a healthy daemon \u2014 exiting (not a duplicate)
18941
+ `);
18942
+ process.exit(0);
18943
+ }
18944
+ } catch {
18945
+ }
18946
+ try {
18947
+ const { execSync: execSync14 } = await import("child_process");
18948
+ const pids = execSync14(`lsof -ti :${targetPort} 2>/dev/null`, { encoding: "utf8" }).trim();
18949
+ if (pids) {
18950
+ process.stderr.write(`[exed] Port ${targetPort} held by PID(s) ${pids.replace(/\n/g, ",")} \u2014 killing
18951
+ `);
18952
+ for (const pid of pids.split("\n").filter(Boolean)) {
18953
+ try {
18954
+ process.kill(parseInt(pid, 10), "SIGTERM");
18955
+ } catch {
18956
+ }
18957
+ }
18958
+ await new Promise((r) => setTimeout(r, 500));
18959
+ }
18960
+ } catch {
18961
+ }
18962
+ process.stderr.write(`[exed] Using fixed MCP port ${targetPort}
18963
+ `);
18964
+ return targetPort;
18965
+ }
18916
18966
  async function startMcpHttpServer() {
18917
18967
  process.stderr.write("[exed] MCP HTTP: starting setup...\n");
18918
18968
  try {
@@ -19018,7 +19068,7 @@ async function startMcpHttpServer() {
19018
19068
  `);
19019
19069
  });
19020
19070
  const transports = /* @__PURE__ */ new Map();
19021
- const MCP_HTTP_PORT = parseInt(process.env.EXE_MCP_PORT || "48739", 10);
19071
+ const MCP_HTTP_PORT = await resolveAndClaimPort();
19022
19072
  const MCP_SESSION_TTL_MS = parseDurationMs2(process.env.EXE_MCP_SESSION_TTL_MS, 30 * 60 * 1e3, { allowZero: true });
19023
19073
  const MCP_SESSION_SWEEP_MS = parseDurationMs2(process.env.EXE_MCP_SESSION_SWEEP_MS, 60 * 1e3);
19024
19074
  const sessionLastSeen = /* @__PURE__ */ new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.123",
3
+ "version": "0.9.124",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",