@fitchmultz/pi-subagents 0.52.0 → 0.52.1
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.52.1] - 2026-10-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- On macOS, use the system `ps` directly for process-birth and shell-group checks instead of searching every PATH entry. This reduces the process events and synchronous spawn work caused by frequent parent-liveness checks without changing PID-reuse proof, cancellation, or non-macOS behavior.
|
|
10
|
+
|
|
5
11
|
## [0.52.0] - 2026-10-26
|
|
6
12
|
|
|
7
13
|
### Added
|
package/dist/agent/shell.js
CHANGED
|
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
|
-
import { readChildProcessIdentity, readProcessClock } from "../shared/post-exit-stdio-guard.js";
|
|
5
|
+
import { PS_COMMAND, readChildProcessIdentity, readProcessClock, } from "../shared/post-exit-stdio-guard.js";
|
|
6
6
|
import { read, write } from "./storage.js";
|
|
7
7
|
import { processSchema } from "./contracts.js";
|
|
8
8
|
import { verifyProcess } from "./process.js";
|
|
@@ -16,7 +16,7 @@ if (directory === undefined ||
|
|
|
16
16
|
process.ppid !== pid) {
|
|
17
17
|
throw new Error("Native shell registration requires its actual parent shell.");
|
|
18
18
|
}
|
|
19
|
-
const group = Number(execFileSync(
|
|
19
|
+
const group = Number(execFileSync(PS_COMMAND, ["-p", String(pid), "-o", "pgid="], {
|
|
20
20
|
encoding: "utf8",
|
|
21
21
|
timeout: 1000,
|
|
22
22
|
stdio: ["ignore", "pipe", "ignore"],
|
package/dist/build-info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const EXTENSION_BUILD = Object.freeze({"version":"0.52.
|
|
1
|
+
export const EXTENSION_BUILD = Object.freeze({"version":"0.52.1","sha256":"d950f3bebb47cbe1dc09b2f7f9cc042535701b14cfe39cc518107a5626698bf4"});
|
|
@@ -3,6 +3,8 @@ import { readFileSync, readlinkSync } from "node:fs";
|
|
|
3
3
|
import { isLinuxProcessReplaced, readLinuxProcess } from "../pi-intercom/broker/pid.js";
|
|
4
4
|
import { hasErrorCode } from "./unknown.js";
|
|
5
5
|
const BIRTH_FIELDS = ["lstart=", "pgid="];
|
|
6
|
+
// macOS ships /bin/ps; resolving "ps" through PATH can spawn once per missing entry.
|
|
7
|
+
export const PS_COMMAND = process.platform === "darwin" ? "/bin/ps" : "ps";
|
|
6
8
|
/** Capture only a real, cross-process clock context; unavailable context proves nothing. */
|
|
7
9
|
export function readProcessClock() {
|
|
8
10
|
if (process.platform !== "android") {
|
|
@@ -45,7 +47,7 @@ function psOptions(zone) {
|
|
|
45
47
|
}
|
|
46
48
|
function readPsFields(pid, fields, zone) {
|
|
47
49
|
try {
|
|
48
|
-
return execFileSync(
|
|
50
|
+
return execFileSync(PS_COMMAND, psArguments(pid, fields), {
|
|
49
51
|
...psOptions(zone),
|
|
50
52
|
stdio: ["ignore", "pipe", "ignore"],
|
|
51
53
|
})
|
|
@@ -59,7 +61,7 @@ function readPsFields(pid, fields, zone) {
|
|
|
59
61
|
/** Nonblocking `readPsFields`; a failed run likewise observes nothing. */
|
|
60
62
|
function observePsFields(pid, fields, zone) {
|
|
61
63
|
return new Promise((resolve) => {
|
|
62
|
-
execFile(
|
|
64
|
+
execFile(PS_COMMAND, psArguments(pid, fields), psOptions(zone), (error, stdout) => {
|
|
63
65
|
resolve(error ? undefined : stdout.trim().replace(/\s+/g, " "));
|
|
64
66
|
});
|
|
65
67
|
});
|
package/package.json
CHANGED
package/src/agent/shell.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
PS_COMMAND,
|
|
7
|
+
readChildProcessIdentity,
|
|
8
|
+
readProcessClock,
|
|
9
|
+
} from "../shared/post-exit-stdio-guard.ts";
|
|
6
10
|
import { read, write } from "./storage.ts";
|
|
7
11
|
import { processSchema } from "./contracts.ts";
|
|
8
12
|
import { verifyProcess } from "./process.ts";
|
|
@@ -22,7 +26,7 @@ if (
|
|
|
22
26
|
throw new Error("Native shell registration requires its actual parent shell.");
|
|
23
27
|
}
|
|
24
28
|
const group = Number(
|
|
25
|
-
execFileSync(
|
|
29
|
+
execFileSync(PS_COMMAND, ["-p", String(pid), "-o", "pgid="], {
|
|
26
30
|
encoding: "utf8",
|
|
27
31
|
timeout: 1000,
|
|
28
32
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -5,6 +5,9 @@ import { hasErrorCode } from "./unknown.ts";
|
|
|
5
5
|
|
|
6
6
|
const BIRTH_FIELDS = ["lstart=", "pgid="];
|
|
7
7
|
|
|
8
|
+
// macOS ships /bin/ps; resolving "ps" through PATH can spawn once per missing entry.
|
|
9
|
+
export const PS_COMMAND = process.platform === "darwin" ? "/bin/ps" : "ps";
|
|
10
|
+
|
|
8
11
|
interface AgentProcessExit {
|
|
9
12
|
readonly pid?: number;
|
|
10
13
|
readonly code: number | null;
|
|
@@ -75,7 +78,7 @@ function psOptions(zone: string | undefined) {
|
|
|
75
78
|
|
|
76
79
|
function readPsFields(pid: number, fields: readonly string[], zone?: string): string | undefined {
|
|
77
80
|
try {
|
|
78
|
-
return execFileSync(
|
|
81
|
+
return execFileSync(PS_COMMAND, psArguments(pid, fields), {
|
|
79
82
|
...psOptions(zone),
|
|
80
83
|
stdio: ["ignore", "pipe", "ignore"],
|
|
81
84
|
})
|
|
@@ -93,7 +96,7 @@ function observePsFields(
|
|
|
93
96
|
zone?: string,
|
|
94
97
|
): Promise<string | undefined> {
|
|
95
98
|
return new Promise((resolve) => {
|
|
96
|
-
execFile(
|
|
99
|
+
execFile(PS_COMMAND, psArguments(pid, fields), psOptions(zone), (error, stdout) => {
|
|
97
100
|
resolve(error ? undefined : stdout.trim().replace(/\s+/g, " "));
|
|
98
101
|
});
|
|
99
102
|
});
|