@openape/apes 1.18.0 → 1.19.0
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/cli.js
CHANGED
|
@@ -1375,7 +1375,19 @@ var delegateCommand = defineCommand14({
|
|
|
1375
1375
|
body.scopes = args.scopes.split(",").map((s) => s.trim());
|
|
1376
1376
|
}
|
|
1377
1377
|
if (args.expires) {
|
|
1378
|
-
|
|
1378
|
+
if (args.approval === "timed") {
|
|
1379
|
+
const expiresMs = Date.parse(args.expires);
|
|
1380
|
+
if (Number.isNaN(expiresMs)) {
|
|
1381
|
+
throw new CliError(`Invalid --expires value: "${args.expires}" is not an ISO 8601 timestamp.`);
|
|
1382
|
+
}
|
|
1383
|
+
const durationSec = Math.floor((expiresMs - Date.now()) / 1e3);
|
|
1384
|
+
if (durationSec <= 0) {
|
|
1385
|
+
throw new CliError(`Invalid --expires value: "${args.expires}" is in the past.`);
|
|
1386
|
+
}
|
|
1387
|
+
body.duration = durationSec;
|
|
1388
|
+
} else {
|
|
1389
|
+
body.expires_at = args.expires;
|
|
1390
|
+
}
|
|
1379
1391
|
}
|
|
1380
1392
|
const result = await apiFetch(delegationsUrl, {
|
|
1381
1393
|
method: "POST",
|
|
@@ -3900,12 +3912,12 @@ function resolveBridgeConfig(opts) {
|
|
|
3900
3912
|
function captureHostBinDirs() {
|
|
3901
3913
|
const dirs = [];
|
|
3902
3914
|
const seen = /* @__PURE__ */ new Set();
|
|
3903
|
-
for (const bin of ["node", "
|
|
3915
|
+
for (const bin of ["node", "ape-agent", "apes"]) {
|
|
3904
3916
|
let resolved;
|
|
3905
3917
|
try {
|
|
3906
3918
|
resolved = execFileSync5("/usr/bin/which", [bin], { encoding: "utf8" }).trim();
|
|
3907
3919
|
} catch {
|
|
3908
|
-
const installCmd = bin === "
|
|
3920
|
+
const installCmd = bin === "ape-agent" ? "npm i -g @openape/ape-agent" : bin === "apes" ? "npm i -g @openape/apes" : "install Node.js (e.g. brew install node)";
|
|
3909
3921
|
throw new Error(`'${bin}' not found on host PATH. ${installCmd} before spawning agents \u2014 the bridge runtime resolves these at spawn time and bakes the dir into the agent's launchd plist.`);
|
|
3910
3922
|
}
|
|
3911
3923
|
const dir = dirname2(resolved);
|
|
@@ -3948,13 +3960,13 @@ ${pathLine}
|
|
|
3948
3960
|
set -a
|
|
3949
3961
|
. "$HOME/Library/Application Support/openape/bridge/.env"
|
|
3950
3962
|
set +a
|
|
3951
|
-
exec
|
|
3963
|
+
exec ape-agent
|
|
3952
3964
|
`;
|
|
3953
3965
|
}
|
|
3954
3966
|
function buildBridgePlist(agentName, homeDir, ownerEmail, hostBinDirs) {
|
|
3955
3967
|
const startScript = `${homeDir}/Library/Application Support/openape/bridge/start.sh`;
|
|
3956
|
-
const stdoutLog = `${homeDir}/Library/Logs/
|
|
3957
|
-
const stderrLog = `${homeDir}/Library/Logs/
|
|
3968
|
+
const stdoutLog = `${homeDir}/Library/Logs/ape-agent.log`;
|
|
3969
|
+
const stderrLog = `${homeDir}/Library/Logs/ape-agent.err.log`;
|
|
3958
3970
|
const pathValue = `${hostBinDirs.join(":")}:/usr/bin:/bin`;
|
|
3959
3971
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
3960
3972
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
@@ -4033,7 +4045,7 @@ var spawnAgentCommand = defineCommand26({
|
|
|
4033
4045
|
},
|
|
4034
4046
|
"bridge": {
|
|
4035
4047
|
type: "boolean",
|
|
4036
|
-
description: "Install the
|
|
4048
|
+
description: "Install the ape-agent runtime for this agent: drops a launchd plist that runs `@openape/ape-agent` so the agent answers chat.openape.ai messages. Reads LITELLM_API_KEY/BASE_URL defaults from ~/litellm/.env; override via --bridge-key / --bridge-base-url."
|
|
4037
4049
|
},
|
|
4038
4050
|
"bridge-key": {
|
|
4039
4051
|
type: "string",
|
|
@@ -4503,8 +4515,11 @@ var DEFAULT_ALLOW_PATTERNS = [
|
|
|
4503
4515
|
// Bridge invocation. The grant request escapes-helper sends to the
|
|
4504
4516
|
// IdP contains the *inner* command only — `apes run --as <agent> --`
|
|
4505
4517
|
// is the wrapper that gets unwrapped before grant creation. So the
|
|
4506
|
-
// YOLO target string is just
|
|
4507
|
-
// wrapped invocation.
|
|
4518
|
+
// YOLO target string is just the agent-runtime binary name, not
|
|
4519
|
+
// the full wrapped invocation. We list both the new canonical
|
|
4520
|
+
// name and the legacy alias — pm2 ecosystem.config.js files
|
|
4521
|
+
// written before @openape/ape-agent@2.0.0 still use the old name.
|
|
4522
|
+
"ape-agent",
|
|
4508
4523
|
"openape-chat-bridge",
|
|
4509
4524
|
// Phase E: per-agent pm2 management. The Nest shells out
|
|
4510
4525
|
// `apes run --as <agent> -- bash /var/openape/agents/<agent>/start.sh`
|
|
@@ -6412,7 +6427,7 @@ var mcpCommand = defineCommand48({
|
|
|
6412
6427
|
if (transport !== "stdio" && transport !== "sse") {
|
|
6413
6428
|
throw new Error('Transport must be "stdio" or "sse"');
|
|
6414
6429
|
}
|
|
6415
|
-
const { startMcpServer } = await import("./server-
|
|
6430
|
+
const { startMcpServer } = await import("./server-RW4PMCV7.js");
|
|
6416
6431
|
await startMcpServer(transport, port);
|
|
6417
6432
|
}
|
|
6418
6433
|
});
|
|
@@ -7050,7 +7065,7 @@ async function bestEffortGrantCount(idp) {
|
|
|
7050
7065
|
}
|
|
7051
7066
|
}
|
|
7052
7067
|
async function runHealth(args) {
|
|
7053
|
-
const version = true ? "1.
|
|
7068
|
+
const version = true ? "1.19.0" : "0.0.0";
|
|
7054
7069
|
const auth = loadAuth();
|
|
7055
7070
|
if (!auth) {
|
|
7056
7071
|
throw new CliError("Not logged in. Run `apes login` first.", 1);
|
|
@@ -7323,10 +7338,10 @@ if (shellRewrite) {
|
|
|
7323
7338
|
if (shellRewrite.action === "rewrite") {
|
|
7324
7339
|
process.argv = shellRewrite.argv;
|
|
7325
7340
|
} else if (shellRewrite.action === "version") {
|
|
7326
|
-
console.log(`ape-shell ${"1.
|
|
7341
|
+
console.log(`ape-shell ${"1.19.0"} (OpenApe DDISA shell wrapper)`);
|
|
7327
7342
|
process.exit(0);
|
|
7328
7343
|
} else if (shellRewrite.action === "help") {
|
|
7329
|
-
console.log(`ape-shell ${"1.
|
|
7344
|
+
console.log(`ape-shell ${"1.19.0"} \u2014 OpenApe DDISA shell wrapper`);
|
|
7330
7345
|
console.log("");
|
|
7331
7346
|
console.log("Usage:");
|
|
7332
7347
|
console.log(" ape-shell Start interactive grant-mediated REPL");
|
|
@@ -7384,7 +7399,7 @@ var configCommand = defineCommand60({
|
|
|
7384
7399
|
var main = defineCommand60({
|
|
7385
7400
|
meta: {
|
|
7386
7401
|
name: "apes",
|
|
7387
|
-
version: "1.
|
|
7402
|
+
version: "1.19.0",
|
|
7388
7403
|
description: "Unified CLI for OpenApe"
|
|
7389
7404
|
},
|
|
7390
7405
|
subCommands: {
|
|
@@ -7441,7 +7456,7 @@ async function maybeRefreshAuth() {
|
|
|
7441
7456
|
}
|
|
7442
7457
|
}
|
|
7443
7458
|
await maybeRefreshAuth();
|
|
7444
|
-
await maybeWarnStaleVersion("1.
|
|
7459
|
+
await maybeWarnStaleVersion("1.19.0").catch(() => {
|
|
7445
7460
|
});
|
|
7446
7461
|
runMain(main).catch((err) => {
|
|
7447
7462
|
if (err instanceof CliExit) {
|