@cydm/pie 4.9.0 → 4.10.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/dist/builtin/extensions/ask-user/index.js +4 -4
- package/dist/builtin/extensions/im-forward/index.js +126 -74
- package/dist/builtin/extensions/memory/index.js +5 -5
- package/dist/builtin/extensions/pie-ipc/index.js +5 -5
- package/dist/builtin/extensions/pie-proc/index.js +336 -102
- package/dist/builtin/extensions/plan-mode/index.js +4 -4
- package/dist/builtin/extensions/subagent/index.js +5 -5
- package/dist/builtin/extensions/todo/index.js +4 -4
- package/dist/builtin/skills/computer-use-axi/computer-use-axi-broker.js +83 -10
- package/dist/chunks/{chunk-LRHNAG4V.js → chunk-5QMS6RQC.js} +7 -2
- package/dist/chunks/{chunk-EEC5PJTC.js → chunk-7LICWWUE.js} +3 -3
- package/dist/chunks/chunk-BB7ETSJK.js +463 -0
- package/dist/chunks/{chunk-BA4Z27XT.js → chunk-BQWHLYYZ.js} +1 -1
- package/dist/chunks/{chunk-Z5KL6AO2.js → chunk-BTUMBUDU.js} +2 -2
- package/dist/chunks/{chunk-WYXUF4MP.js → chunk-FC5AN5QP.js} +22 -1
- package/dist/chunks/{chunk-4UIUMTHG.js → chunk-G2K4GY6N.js} +1 -1
- package/dist/chunks/{chunk-DBDU3RRN.js → chunk-HK3FHIAH.js} +3 -3
- package/dist/chunks/{chunk-WBL73KRI.js → chunk-KWK7KTSZ.js} +1 -0
- package/dist/chunks/{chunk-PN6B54VT.js → chunk-XMTRKMBG.js} +6 -6
- package/dist/chunks/{host-image-fallback-RASJSVZY.js → host-image-fallback-3TEMOQM5.js} +1 -1
- package/dist/chunks/{manager-cli-Y6HM3MHA.js → manager-cli-UU6SDS3F.js} +1 -1
- package/dist/chunks/{manager-upgrade-LSTOHBUV.js → manager-upgrade-XPFXKO7A.js} +64 -39
- package/dist/chunks/{model-registry-5TLYILYR.js → model-registry-QKJ3YVDS.js} +2 -2
- package/dist/chunks/{read-file-understanding-VPKDBV23.js → read-file-understanding-N2ZZQLTZ.js} +5 -5
- package/dist/chunks/{src-6QGGDHIW.js → src-3PSR2AAX.js} +3 -3
- package/dist/chunks/{src-2XI5P62J.js → src-D5GN4Q5O.js} +2 -2
- package/dist/chunks/{src-DI4MCAGT.js → src-F5N6O2HR.js} +4 -4
- package/dist/chunks/{src-CCEENRKC.js → src-TIDKYA5F.js} +1 -1
- package/dist/chunks/{test-stream-SYVWIPPW.js → test-stream-JAJHK44G.js} +1 -1
- package/dist/cli.js +2379 -1045
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
createPlanCapability,
|
|
7
7
|
markCompletedPlanSteps,
|
|
8
8
|
restoreExecutionState
|
|
9
|
-
} from "../../../chunks/chunk-
|
|
10
|
-
import "../../../chunks/chunk-
|
|
11
|
-
import "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
9
|
+
} from "../../../chunks/chunk-HK3FHIAH.js";
|
|
10
|
+
import "../../../chunks/chunk-5QMS6RQC.js";
|
|
11
|
+
import "../../../chunks/chunk-BQWHLYYZ.js";
|
|
12
|
+
import "../../../chunks/chunk-G2K4GY6N.js";
|
|
13
13
|
import {
|
|
14
14
|
Type
|
|
15
15
|
} from "../../../chunks/chunk-XXGYUYXI.js";
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
createCliRetryPolicy,
|
|
6
6
|
formatTransportLifecycle,
|
|
7
7
|
logTransportLifecycle
|
|
8
|
-
} from "../../../chunks/chunk-
|
|
8
|
+
} from "../../../chunks/chunk-7LICWWUE.js";
|
|
9
9
|
import {
|
|
10
10
|
SUBAGENT_SESSION_RECORD_VERSION,
|
|
11
11
|
createPolicyEnforcedTools,
|
|
12
12
|
createSharedFileSystemTools,
|
|
13
13
|
createSubagentCapability
|
|
14
|
-
} from "../../../chunks/chunk-
|
|
15
|
-
import "../../../chunks/chunk-
|
|
16
|
-
import "../../../chunks/chunk-
|
|
14
|
+
} from "../../../chunks/chunk-HK3FHIAH.js";
|
|
15
|
+
import "../../../chunks/chunk-5QMS6RQC.js";
|
|
16
|
+
import "../../../chunks/chunk-BQWHLYYZ.js";
|
|
17
17
|
import {
|
|
18
18
|
getConfigDir
|
|
19
19
|
} from "../../../chunks/chunk-CBDQJMUI.js";
|
|
20
|
-
import "../../../chunks/chunk-
|
|
20
|
+
import "../../../chunks/chunk-G2K4GY6N.js";
|
|
21
21
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
22
22
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
23
23
|
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
executeManageTodoList,
|
|
9
9
|
executionStateToTodos,
|
|
10
10
|
restoreExecutionState
|
|
11
|
-
} from "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-
|
|
14
|
-
import "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-HK3FHIAH.js";
|
|
12
|
+
import "../../../chunks/chunk-5QMS6RQC.js";
|
|
13
|
+
import "../../../chunks/chunk-BQWHLYYZ.js";
|
|
14
|
+
import "../../../chunks/chunk-G2K4GY6N.js";
|
|
15
15
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
16
16
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
17
17
|
|
|
@@ -8395,7 +8395,7 @@ async function verifyProfileHolderDetailed(pid, profile) {
|
|
|
8395
8395
|
}
|
|
8396
8396
|
if (process.platform === "darwin") {
|
|
8397
8397
|
return await new Promise((resolve2) => {
|
|
8398
|
-
execFile("ps", ["-o", "command=", "-p", String(pid)], { timeout: 1500 }, (error, stdout) => {
|
|
8398
|
+
execFile("ps", ["-ww", "-o", "command=", "-p", String(pid)], { timeout: 1500 }, (error, stdout) => {
|
|
8399
8399
|
if (error) {
|
|
8400
8400
|
resolve2(pidStillAlive(pid) ? "unknown" : "no_match");
|
|
8401
8401
|
return;
|
|
@@ -8405,7 +8405,7 @@ async function verifyProfileHolderDetailed(pid, profile) {
|
|
|
8405
8405
|
resolve2(pidStillAlive(pid) ? "unknown" : "no_match");
|
|
8406
8406
|
return;
|
|
8407
8407
|
}
|
|
8408
|
-
resolve2(
|
|
8408
|
+
resolve2(evaluateMacOsPsCommand(command, profile));
|
|
8409
8409
|
});
|
|
8410
8410
|
});
|
|
8411
8411
|
}
|
|
@@ -8468,25 +8468,97 @@ function commandIncludesExactUserDataDir(command, profile) {
|
|
|
8468
8468
|
const exactFlag = `--user-data-dir=${profile}`;
|
|
8469
8469
|
return tokens.some((arg, i) => arg === exactFlag || arg === "--user-data-dir" && tokens[i + 1] === profile);
|
|
8470
8470
|
}
|
|
8471
|
-
|
|
8471
|
+
function evaluateMacOsPsCommand(command, profile) {
|
|
8472
|
+
const hasAmbiguousProfileChars = /[\s'"]/.test(profile);
|
|
8473
|
+
if (!hasAmbiguousProfileChars && commandIncludesExactUserDataDir(command, profile)) {
|
|
8474
|
+
return "match";
|
|
8475
|
+
}
|
|
8476
|
+
if (hasAmbiguousProfileChars && command.includes(profile)) {
|
|
8477
|
+
return "unknown";
|
|
8478
|
+
}
|
|
8479
|
+
if (tokenizeCommandLine(command) === void 0) {
|
|
8480
|
+
return "unknown";
|
|
8481
|
+
}
|
|
8482
|
+
return "no_match";
|
|
8483
|
+
}
|
|
8484
|
+
async function readProcessStartSignature(pid) {
|
|
8472
8485
|
if (process.platform === "win32") {
|
|
8486
|
+
return await new Promise((resolve2) => {
|
|
8487
|
+
execFile(
|
|
8488
|
+
"powershell.exe",
|
|
8489
|
+
[
|
|
8490
|
+
"-NoProfile",
|
|
8491
|
+
"-NonInteractive",
|
|
8492
|
+
"-Command",
|
|
8493
|
+
`Get-CimInstance Win32_Process -Filter "ProcessId=${pid}" | Select-Object -ExpandProperty CreationDate`
|
|
8494
|
+
],
|
|
8495
|
+
{ timeout: 2500, windowsHide: true },
|
|
8496
|
+
(error, stdout) => {
|
|
8497
|
+
if (error) {
|
|
8498
|
+
resolve2(null);
|
|
8499
|
+
return;
|
|
8500
|
+
}
|
|
8501
|
+
const sig = String(stdout ?? "").trim();
|
|
8502
|
+
resolve2(sig || null);
|
|
8503
|
+
}
|
|
8504
|
+
);
|
|
8505
|
+
});
|
|
8506
|
+
}
|
|
8507
|
+
return await new Promise((resolve2) => {
|
|
8508
|
+
execFile("ps", ["-o", "lstart=", "-p", String(pid)], { timeout: 1500 }, (error, stdout) => {
|
|
8509
|
+
if (error) {
|
|
8510
|
+
resolve2(null);
|
|
8511
|
+
return;
|
|
8512
|
+
}
|
|
8513
|
+
const sig = String(stdout ?? "").trim();
|
|
8514
|
+
resolve2(sig || null);
|
|
8515
|
+
});
|
|
8516
|
+
});
|
|
8517
|
+
}
|
|
8518
|
+
async function terminateVerifiedPid(pid, guard) {
|
|
8519
|
+
const verifyHolder = guard?.verifyHolder ?? verifyProfileHolderDetailed;
|
|
8520
|
+
const readStartSig = guard?.readStartSignature ?? readProcessStartSignature;
|
|
8521
|
+
const sendKill = guard?.kill ?? ((targetPid, signal) => {
|
|
8522
|
+
process.kill(targetPid, signal);
|
|
8523
|
+
});
|
|
8524
|
+
const sleep4 = guard?.sleep ?? ((ms) => new Promise((resolve2) => setTimeout(resolve2, ms)));
|
|
8525
|
+
const stillOwned = async () => {
|
|
8526
|
+
if (!guard) return true;
|
|
8527
|
+
if (await verifyHolder(pid, guard.profile) !== "match") return false;
|
|
8528
|
+
if (guard.expectedStartSignature) {
|
|
8529
|
+
const currentSig = await readStartSig(pid);
|
|
8530
|
+
if (!currentSig || currentSig !== guard.expectedStartSignature) return false;
|
|
8531
|
+
}
|
|
8532
|
+
return true;
|
|
8533
|
+
};
|
|
8534
|
+
if (!await stillOwned()) return false;
|
|
8535
|
+
if (process.platform === "win32" && !guard?.kill) {
|
|
8473
8536
|
await new Promise((resolve2) => {
|
|
8474
8537
|
execFile("taskkill.exe", ["/PID", String(pid), "/T", "/F"], { windowsHide: true, timeout: 3e3 }, () => resolve2());
|
|
8475
8538
|
});
|
|
8476
|
-
return;
|
|
8539
|
+
return true;
|
|
8477
8540
|
}
|
|
8478
8541
|
try {
|
|
8479
|
-
|
|
8542
|
+
sendKill(pid, "SIGTERM");
|
|
8480
8543
|
} catch {
|
|
8481
8544
|
}
|
|
8482
|
-
await
|
|
8483
|
-
|
|
8545
|
+
await sleep4(400);
|
|
8546
|
+
let alive = false;
|
|
8547
|
+
try {
|
|
8548
|
+
sendKill(pid, 0);
|
|
8549
|
+
alive = true;
|
|
8550
|
+
} catch (error) {
|
|
8551
|
+
alive = error.code === "EPERM";
|
|
8552
|
+
}
|
|
8553
|
+
if (alive) {
|
|
8554
|
+
if (!await stillOwned()) return false;
|
|
8484
8555
|
try {
|
|
8485
|
-
|
|
8556
|
+
sendKill(pid, "SIGKILL");
|
|
8486
8557
|
} catch {
|
|
8487
8558
|
}
|
|
8488
|
-
await
|
|
8559
|
+
await sleep4(300);
|
|
8489
8560
|
}
|
|
8561
|
+
return true;
|
|
8490
8562
|
}
|
|
8491
8563
|
async function signalTreeOfProfile(profile, signal) {
|
|
8492
8564
|
const scan = await scanProfileHolders(profile);
|
|
@@ -8983,11 +9055,12 @@ async function sweepOrphanedManagedBrowser() {
|
|
|
8983
9055
|
return;
|
|
8984
9056
|
}
|
|
8985
9057
|
const pidVerified = pid !== void 0 && await manifestPidIsOurBrowser(pid, resolved);
|
|
9058
|
+
const pidStartSignature = pidVerified && pid !== void 0 ? await readProcessStartSignature(pid) : null;
|
|
8986
9059
|
if (port && pidVerified) {
|
|
8987
9060
|
await requestBrowserClose(port).catch(() => void 0);
|
|
8988
9061
|
}
|
|
8989
9062
|
if (pidVerified && pid !== void 0) {
|
|
8990
|
-
await terminateVerifiedPid(pid);
|
|
9063
|
+
await terminateVerifiedPid(pid, { profile: resolved, expectedStartSignature: pidStartSignature });
|
|
8991
9064
|
}
|
|
8992
9065
|
await releaseOwnedBrowser(void 0, void 0, resolved);
|
|
8993
9066
|
clearManagedBrowserManifest();
|
|
@@ -2,14 +2,14 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
createAgentOperationError,
|
|
4
4
|
getAgentFailureMetadata
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BQWHLYYZ.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSystemGateway,
|
|
8
8
|
detectPlatform,
|
|
9
9
|
getFileSystemGateway,
|
|
10
10
|
getPlatformConfig,
|
|
11
11
|
streamSimple
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G2K4GY6N.js";
|
|
13
13
|
import {
|
|
14
14
|
Type
|
|
15
15
|
} from "./chunk-XXGYUYXI.js";
|
|
@@ -6243,6 +6243,8 @@ async function runAgentSessionControllerAutoCompact(params) {
|
|
|
6243
6243
|
}
|
|
6244
6244
|
if (!result?.aborted && runAfterAgentEndHook) {
|
|
6245
6245
|
await params.handleAgentEndHook(params.agent.state.messages.slice());
|
|
6246
|
+
} else if (result?.aborted && !cancelOnAbort && runAfterAgentEndHook) {
|
|
6247
|
+
params.scheduleQueuedTurn?.();
|
|
6246
6248
|
}
|
|
6247
6249
|
}
|
|
6248
6250
|
return result;
|
|
@@ -6615,6 +6617,9 @@ var AgentSessionController = class {
|
|
|
6615
6617
|
await this.continue();
|
|
6616
6618
|
},
|
|
6617
6619
|
handleAgentEndHook: (messages) => this.handleAgentEndHook(messages),
|
|
6620
|
+
scheduleQueuedTurn: () => {
|
|
6621
|
+
if (this.queue.length > 0) this.queueDispatcher.schedule();
|
|
6622
|
+
},
|
|
6618
6623
|
emitSettled: options?.emitSettled,
|
|
6619
6624
|
runAfterAgentEndHook: options?.runAfterAgentEndHook,
|
|
6620
6625
|
cancelOnAbort: options?.cancelOnAbort
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
createSharedWebSearchTool,
|
|
7
7
|
defaultShellKindForPlatform,
|
|
8
8
|
interpretShellExit
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HK3FHIAH.js";
|
|
10
10
|
import {
|
|
11
11
|
requestInteraction
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5QMS6RQC.js";
|
|
13
13
|
import {
|
|
14
14
|
getBuiltinDir,
|
|
15
15
|
getConfigDir
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
EMPTY_ASSISTANT_CONTENT_ERROR,
|
|
19
19
|
OPENAI_COMPAT_PROTOCOL_ERROR_CODE,
|
|
20
20
|
getLogger
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-G2K4GY6N.js";
|
|
22
22
|
import {
|
|
23
23
|
Type
|
|
24
24
|
} from "./chunk-XXGYUYXI.js";
|