engine7 7.1.5 → 7.1.6

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.
@@ -29646,8 +29646,27 @@ function killTree(pid) {
29646
29646
  try {
29647
29647
  if (process.platform === "win32") {
29648
29648
  execSync(`taskkill /PID ${pid} /T /F`, { stdio: "ignore", timeout: 8e3 });
29649
+ try {
29650
+ const parentPid = execSync(`wmic process where ProcessId=${pid} get ParentProcessId /value`, { encoding: "utf-8", timeout: 3e3, stdio: ["ignore", "pipe", "ignore"] }).match(/ParentProcessId=(\d+)/)?.[1];
29651
+ if (parentPid && parseInt(parentPid) !== process.ppid) {
29652
+ execSync(`taskkill /PID ${parentPid} /F`, { stdio: "ignore", timeout: 3e3 });
29653
+ }
29654
+ } catch {
29655
+ }
29649
29656
  } else {
29650
29657
  process.kill(pid, "SIGKILL");
29658
+ try {
29659
+ const ppid = parseInt(fs.readFileSync(`/proc/${pid}/status`, "utf-8").match(/PPid:\s+(\d+)/)?.[1] || "0", 10);
29660
+ const macPpid = parseInt(execSync(`ps -p ${pid} -o ppid=`, { encoding: "utf-8", timeout: 3e3, stdio: ["ignore", "pipe", "ignore"] }).trim(), 10);
29661
+ const parentPid = ppid || macPpid;
29662
+ if (parentPid && parentPid > 1) {
29663
+ try {
29664
+ process.kill(parentPid, "SIGKILL");
29665
+ } catch {
29666
+ }
29667
+ }
29668
+ } catch {
29669
+ }
29651
29670
  }
29652
29671
  } catch (err) {
29653
29672
  console.warn(`[pid-lock] kill ${pid} failed: ${err.message}`);
package/dist/main.mjs CHANGED
@@ -30004,8 +30004,27 @@ function killTree(pid) {
30004
30004
  try {
30005
30005
  if (process.platform === "win32") {
30006
30006
  execSync(`taskkill /PID ${pid} /T /F`, { stdio: "ignore", timeout: 8e3 });
30007
+ try {
30008
+ const parentPid = execSync(`wmic process where ProcessId=${pid} get ParentProcessId /value`, { encoding: "utf-8", timeout: 3e3, stdio: ["ignore", "pipe", "ignore"] }).match(/ParentProcessId=(\d+)/)?.[1];
30009
+ if (parentPid && parseInt(parentPid) !== process.ppid) {
30010
+ execSync(`taskkill /PID ${parentPid} /F`, { stdio: "ignore", timeout: 3e3 });
30011
+ }
30012
+ } catch {
30013
+ }
30007
30014
  } else {
30008
30015
  process.kill(pid, "SIGKILL");
30016
+ try {
30017
+ const ppid = parseInt(fs2.readFileSync(`/proc/${pid}/status`, "utf-8").match(/PPid:\s+(\d+)/)?.[1] || "0", 10);
30018
+ const macPpid = parseInt(execSync(`ps -p ${pid} -o ppid=`, { encoding: "utf-8", timeout: 3e3, stdio: ["ignore", "pipe", "ignore"] }).trim(), 10);
30019
+ const parentPid = ppid || macPpid;
30020
+ if (parentPid && parentPid > 1) {
30021
+ try {
30022
+ process.kill(parentPid, "SIGKILL");
30023
+ } catch {
30024
+ }
30025
+ }
30026
+ } catch {
30027
+ }
30009
30028
  }
30010
30029
  } catch (err) {
30011
30030
  console.warn(`[pid-lock] kill ${pid} failed: ${err.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.1.5",
3
+ "version": "7.1.6",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — Self-hosted AI agent engine",
6
6
  "main": "dist/main.mjs",