@openape/apes 1.17.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",
|
|
@@ -4321,8 +4333,9 @@ var syncAgentCommand = defineCommand27({
|
|
|
4321
4333
|
ownerEmail: auth.owner_email
|
|
4322
4334
|
});
|
|
4323
4335
|
consola24.info(sync.first_sync ? "\u2713 first sync \u2014 agent registered" : "\u2713 presence updated");
|
|
4324
|
-
const { system_prompt: systemPrompt, tasks } = await client.listTasks();
|
|
4336
|
+
const { system_prompt: systemPrompt, tools, tasks } = await client.listTasks();
|
|
4325
4337
|
consola24.info(`Pulled ${tasks.length} task${tasks.length === 1 ? "" : "s"}`);
|
|
4338
|
+
consola24.info(`Tools enabled: ${tools.length === 0 ? "(none)" : tools.join(", ")}`);
|
|
4326
4339
|
let agentUid = null;
|
|
4327
4340
|
let agentGid = null;
|
|
4328
4341
|
if (process.geteuid?.() === 0) {
|
|
@@ -4348,7 +4361,7 @@ var syncAgentCommand = defineCommand27({
|
|
|
4348
4361
|
const agentJsonPath = join8(agentDir, "agent.json");
|
|
4349
4362
|
writeFileSync5(
|
|
4350
4363
|
agentJsonPath,
|
|
4351
|
-
`${JSON.stringify({ systemPrompt }, null, 2)}
|
|
4364
|
+
`${JSON.stringify({ systemPrompt, tools }, null, 2)}
|
|
4352
4365
|
`,
|
|
4353
4366
|
{ mode: 384 }
|
|
4354
4367
|
);
|
|
@@ -4502,8 +4515,11 @@ var DEFAULT_ALLOW_PATTERNS = [
|
|
|
4502
4515
|
// Bridge invocation. The grant request escapes-helper sends to the
|
|
4503
4516
|
// IdP contains the *inner* command only — `apes run --as <agent> --`
|
|
4504
4517
|
// is the wrapper that gets unwrapped before grant creation. So the
|
|
4505
|
-
// YOLO target string is just
|
|
4506
|
-
// 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",
|
|
4507
4523
|
"openape-chat-bridge",
|
|
4508
4524
|
// Phase E: per-agent pm2 management. The Nest shells out
|
|
4509
4525
|
// `apes run --as <agent> -- bash /var/openape/agents/<agent>/start.sh`
|
|
@@ -6411,7 +6427,7 @@ var mcpCommand = defineCommand48({
|
|
|
6411
6427
|
if (transport !== "stdio" && transport !== "sse") {
|
|
6412
6428
|
throw new Error('Transport must be "stdio" or "sse"');
|
|
6413
6429
|
}
|
|
6414
|
-
const { startMcpServer } = await import("./server-
|
|
6430
|
+
const { startMcpServer } = await import("./server-RW4PMCV7.js");
|
|
6415
6431
|
await startMcpServer(transport, port);
|
|
6416
6432
|
}
|
|
6417
6433
|
});
|
|
@@ -7049,7 +7065,7 @@ async function bestEffortGrantCount(idp) {
|
|
|
7049
7065
|
}
|
|
7050
7066
|
}
|
|
7051
7067
|
async function runHealth(args) {
|
|
7052
|
-
const version = true ? "1.
|
|
7068
|
+
const version = true ? "1.19.0" : "0.0.0";
|
|
7053
7069
|
const auth = loadAuth();
|
|
7054
7070
|
if (!auth) {
|
|
7055
7071
|
throw new CliError("Not logged in. Run `apes login` first.", 1);
|
|
@@ -7322,10 +7338,10 @@ if (shellRewrite) {
|
|
|
7322
7338
|
if (shellRewrite.action === "rewrite") {
|
|
7323
7339
|
process.argv = shellRewrite.argv;
|
|
7324
7340
|
} else if (shellRewrite.action === "version") {
|
|
7325
|
-
console.log(`ape-shell ${"1.
|
|
7341
|
+
console.log(`ape-shell ${"1.19.0"} (OpenApe DDISA shell wrapper)`);
|
|
7326
7342
|
process.exit(0);
|
|
7327
7343
|
} else if (shellRewrite.action === "help") {
|
|
7328
|
-
console.log(`ape-shell ${"1.
|
|
7344
|
+
console.log(`ape-shell ${"1.19.0"} \u2014 OpenApe DDISA shell wrapper`);
|
|
7329
7345
|
console.log("");
|
|
7330
7346
|
console.log("Usage:");
|
|
7331
7347
|
console.log(" ape-shell Start interactive grant-mediated REPL");
|
|
@@ -7383,7 +7399,7 @@ var configCommand = defineCommand60({
|
|
|
7383
7399
|
var main = defineCommand60({
|
|
7384
7400
|
meta: {
|
|
7385
7401
|
name: "apes",
|
|
7386
|
-
version: "1.
|
|
7402
|
+
version: "1.19.0",
|
|
7387
7403
|
description: "Unified CLI for OpenApe"
|
|
7388
7404
|
},
|
|
7389
7405
|
subCommands: {
|
|
@@ -7440,7 +7456,7 @@ async function maybeRefreshAuth() {
|
|
|
7440
7456
|
}
|
|
7441
7457
|
}
|
|
7442
7458
|
await maybeRefreshAuth();
|
|
7443
|
-
await maybeWarnStaleVersion("1.
|
|
7459
|
+
await maybeWarnStaleVersion("1.19.0").catch(() => {
|
|
7444
7460
|
});
|
|
7445
7461
|
runMain(main).catch((err) => {
|
|
7446
7462
|
if (err instanceof CliExit) {
|