@arhen/pi-core-subagent 1.3.47 → 1.3.48
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/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/peek.ts +0 -2
- package/src/worktree.ts +16 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.48",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -175,7 +175,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
175
175
|
],
|
|
176
176
|
parameters: SubagentParams,
|
|
177
177
|
executionMode: "parallel", // sibling subagent calls run concurrently, not serialized
|
|
178
|
-
async execute(_toolCallId, params,
|
|
178
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
179
179
|
const typed = params as SubagentParamsShape;
|
|
180
180
|
const details = manager.startInBackground(typed, ctx);
|
|
181
181
|
if (typed.autoAwait) {
|
package/src/peek.ts
CHANGED
|
@@ -48,9 +48,7 @@ function stripThinking(text: string): string {
|
|
|
48
48
|
.trim();
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: stripping real terminal escapes is the point
|
|
52
51
|
const ANSI = /\x1b\[[0-9;?]*[ -/]*[@-~]/g;
|
|
53
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: same
|
|
54
52
|
const CONTROL = /[\x00-\x08\x0b-\x1f\x7f]/g;
|
|
55
53
|
|
|
56
54
|
/** Tool output is terminal output: it carries colour escapes and carriage returns
|
package/src/worktree.ts
CHANGED
|
@@ -392,10 +392,23 @@ export function ownerAlive(path: string, ownedHere?: (path: string) => boolean):
|
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
/** Stable per-boot id, so a recycled pid from before a reboot can't look alive.
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
* live marker as dead
|
|
395
|
+
* Prefer the OS's own boot identity — the clock formula (Date.now - uptime)
|
|
396
|
+
* breaks on NTP-stepped clocks (CI runners): the step flips the floor and a
|
|
397
|
+
* live marker suddenly reads as pre-reboot/dead. The formula stays as the
|
|
398
|
+
* last-resort fallback: one floor on the expressed seconds, not two —
|
|
399
|
+
* separate floors of walltime and uptime flip by ±1 around integer
|
|
400
|
+
* boundaries and would read a live marker as dead on a cross-second read. */
|
|
398
401
|
function bootId(): string {
|
|
402
|
+
try {
|
|
403
|
+
if (process.platform === "linux") return readFileSync("/proc/sys/kernel/random/boot_id", "utf8").trim();
|
|
404
|
+
if (process.platform === "darwin") {
|
|
405
|
+
// kern.boottime = "{ sec = 1756…, usec = … }" — sec alone is stable per boot.
|
|
406
|
+
const out = execFileSync("sysctl", ["-n", "kern.boottime"], { encoding: "utf8" });
|
|
407
|
+
return out.match(/sec = (\d+)/)?.[1] ?? out.trim();
|
|
408
|
+
}
|
|
409
|
+
} catch {
|
|
410
|
+
/* fall through to the formula */
|
|
411
|
+
}
|
|
399
412
|
return String(Math.floor((Date.now() - uptime() * 1000) / 1000));
|
|
400
413
|
}
|
|
401
414
|
|