@openape/apes 1.18.0 → 1.20.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",
|
|
@@ -2770,7 +2782,7 @@ if [ -n "$UID_OF" ]; then
|
|
|
2770
2782
|
pkill -9 -u "$UID_OF" 2>/dev/null || true
|
|
2771
2783
|
fi
|
|
2772
2784
|
|
|
2773
|
-
# Per-agent system LaunchDaemon written by spawn --bridge. Bootout +
|
|
2785
|
+
# Per-agent system LaunchDaemon written by spawn (unless --no-bridge). Bootout +
|
|
2774
2786
|
# delete must come BEFORE we delete the user, otherwise launchd keeps a
|
|
2775
2787
|
# zombie reference. No-op if the plist isn't there.
|
|
2776
2788
|
BRIDGE_LABEL="eco.hofmann.apes.bridge.$NAME"
|
|
@@ -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);
|
|
@@ -3925,7 +3937,7 @@ function bridgePlistPath(agentName) {
|
|
|
3925
3937
|
function buildBridgeEnvFile(cfg) {
|
|
3926
3938
|
const modelLine = cfg.model ? `APE_CHAT_BRIDGE_MODEL=${cfg.model}
|
|
3927
3939
|
` : "";
|
|
3928
|
-
return `# Auto-generated by 'apes agents spawn
|
|
3940
|
+
return `# Auto-generated by 'apes agents spawn'.
|
|
3929
3941
|
# Read by the chat-bridge daemon at boot to talk to the local LLM proxy.
|
|
3930
3942
|
LITELLM_BASE_URL=${cfg.baseUrl}
|
|
3931
3943
|
LITELLM_API_KEY=${cfg.apiKey}
|
|
@@ -3934,7 +3946,7 @@ ${modelLine}`;
|
|
|
3934
3946
|
function buildBridgeStartScript(hostBinDirs) {
|
|
3935
3947
|
const pathLine = `export PATH="${hostBinDirs.join(":")}:/usr/bin:/bin"`;
|
|
3936
3948
|
return `#!/usr/bin/env bash
|
|
3937
|
-
# Auto-generated by 'apes agents spawn
|
|
3949
|
+
# Auto-generated by 'apes agents spawn'.
|
|
3938
3950
|
# Slim launcher \u2014 bridge stack lives on the host, no per-agent install.
|
|
3939
3951
|
set -euo pipefail
|
|
3940
3952
|
|
|
@@ -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">
|
|
@@ -4031,9 +4043,9 @@ var spawnAgentCommand = defineCommand26({
|
|
|
4031
4043
|
type: "boolean",
|
|
4032
4044
|
description: "Read the Claude Code OAuth token from stdin (paranoid form of --claude-token)."
|
|
4033
4045
|
},
|
|
4034
|
-
"bridge": {
|
|
4046
|
+
"no-bridge": {
|
|
4035
4047
|
type: "boolean",
|
|
4036
|
-
description: "
|
|
4048
|
+
description: "Skip the ape-agent runtime install. Default behaviour installs the runtime so the agent answers chat.openape.ai messages (reads LITELLM_API_KEY/BASE_URL from ~/litellm/.env; override via --bridge-key / --bridge-base-url). Use --no-bridge for headless / CI / IdP-only account provisioning where the agent will not run a chat loop."
|
|
4037
4049
|
},
|
|
4038
4050
|
"bridge-key": {
|
|
4039
4051
|
type: "string",
|
|
@@ -4126,7 +4138,8 @@ and try again.`
|
|
|
4126
4138
|
flag: typeof args["claude-token"] === "string" ? args["claude-token"] : void 0,
|
|
4127
4139
|
fromStdin: !!args["claude-token-stdin"]
|
|
4128
4140
|
});
|
|
4129
|
-
const
|
|
4141
|
+
const withBridge = !args["no-bridge"];
|
|
4142
|
+
const bridge = withBridge ? (() => {
|
|
4130
4143
|
const cfg = resolveBridgeConfig({
|
|
4131
4144
|
cliKey: typeof args["bridge-key"] === "string" ? args["bridge-key"] : void 0,
|
|
4132
4145
|
cliBaseUrl: typeof args["bridge-base-url"] === "string" ? args["bridge-base-url"] : void 0,
|
|
@@ -4180,7 +4193,7 @@ and try again.`
|
|
|
4180
4193
|
home: homeDir,
|
|
4181
4194
|
email: registration.email,
|
|
4182
4195
|
registeredAt: Math.floor(Date.now() / 1e3),
|
|
4183
|
-
bridge:
|
|
4196
|
+
bridge: withBridge ? {
|
|
4184
4197
|
baseUrl: typeof args["bridge-base-url"] === "string" ? args["bridge-base-url"] : void 0,
|
|
4185
4198
|
apiKey: typeof args["bridge-key"] === "string" ? args["bridge-key"] : void 0,
|
|
4186
4199
|
model: typeof args["bridge-model"] === "string" ? args["bridge-model"] : void 0
|
|
@@ -4191,7 +4204,7 @@ and try again.`
|
|
|
4191
4204
|
}
|
|
4192
4205
|
consola23.success(`Agent ${name} spawned.`);
|
|
4193
4206
|
consola23.info(`\u{1F517} Troop: https://troop.openape.ai/agents/${name}`);
|
|
4194
|
-
if (
|
|
4207
|
+
if (withBridge) {
|
|
4195
4208
|
consola23.info(`On first boot, the bridge will send you a contact request from ${registration.email}.`);
|
|
4196
4209
|
consola23.info("Open chat.openape.ai and accept it to start chatting with the agent.");
|
|
4197
4210
|
}
|
|
@@ -4503,8 +4516,11 @@ var DEFAULT_ALLOW_PATTERNS = [
|
|
|
4503
4516
|
// Bridge invocation. The grant request escapes-helper sends to the
|
|
4504
4517
|
// IdP contains the *inner* command only — `apes run --as <agent> --`
|
|
4505
4518
|
// is the wrapper that gets unwrapped before grant creation. So the
|
|
4506
|
-
// YOLO target string is just
|
|
4507
|
-
// wrapped invocation.
|
|
4519
|
+
// YOLO target string is just the agent-runtime binary name, not
|
|
4520
|
+
// the full wrapped invocation. We list both the new canonical
|
|
4521
|
+
// name and the legacy alias — pm2 ecosystem.config.js files
|
|
4522
|
+
// written before @openape/ape-agent@2.0.0 still use the old name.
|
|
4523
|
+
"ape-agent",
|
|
4508
4524
|
"openape-chat-bridge",
|
|
4509
4525
|
// Phase E: per-agent pm2 management. The Nest shells out
|
|
4510
4526
|
// `apes run --as <agent> -- bash /var/openape/agents/<agent>/start.sh`
|
|
@@ -4748,7 +4764,7 @@ var installNestCommand = defineCommand32({
|
|
|
4748
4764
|
},
|
|
4749
4765
|
"bridge-model": {
|
|
4750
4766
|
type: "string",
|
|
4751
|
-
description: "Default model for
|
|
4767
|
+
description: "Default model for ape-agent spawns. Persisted as APE_CHAT_BRIDGE_MODEL in ~/litellm/.env so every `apes [nest|agents] spawn` picks it up automatically. Common values: `gpt-5.4` (ChatGPT-only LiteLLM proxy), `claude-haiku-4-5` (Anthropic-only). Re-run install with a new value to overwrite."
|
|
4752
4768
|
}
|
|
4753
4769
|
},
|
|
4754
4770
|
async run({ args }) {
|
|
@@ -4857,7 +4873,7 @@ var spawnNestCommand = defineCommand34({
|
|
|
4857
4873
|
"spawn",
|
|
4858
4874
|
name
|
|
4859
4875
|
];
|
|
4860
|
-
if (
|
|
4876
|
+
if (args["no-bridge"]) apesArgs.push("--no-bridge");
|
|
4861
4877
|
if (typeof args["bridge-key"] === "string") apesArgs.push("--bridge-key", args["bridge-key"]);
|
|
4862
4878
|
if (typeof args["bridge-base-url"] === "string") apesArgs.push("--bridge-base-url", args["bridge-base-url"]);
|
|
4863
4879
|
if (typeof args["bridge-model"] === "string") apesArgs.push("--bridge-model", args["bridge-model"]);
|
|
@@ -6412,7 +6428,7 @@ var mcpCommand = defineCommand48({
|
|
|
6412
6428
|
if (transport !== "stdio" && transport !== "sse") {
|
|
6413
6429
|
throw new Error('Transport must be "stdio" or "sse"');
|
|
6414
6430
|
}
|
|
6415
|
-
const { startMcpServer } = await import("./server-
|
|
6431
|
+
const { startMcpServer } = await import("./server-WKCSHOBY.js");
|
|
6416
6432
|
await startMcpServer(transport, port);
|
|
6417
6433
|
}
|
|
6418
6434
|
});
|
|
@@ -7050,7 +7066,7 @@ async function bestEffortGrantCount(idp) {
|
|
|
7050
7066
|
}
|
|
7051
7067
|
}
|
|
7052
7068
|
async function runHealth(args) {
|
|
7053
|
-
const version = true ? "1.
|
|
7069
|
+
const version = true ? "1.20.0" : "0.0.0";
|
|
7054
7070
|
const auth = loadAuth();
|
|
7055
7071
|
if (!auth) {
|
|
7056
7072
|
throw new CliError("Not logged in. Run `apes login` first.", 1);
|
|
@@ -7323,10 +7339,10 @@ if (shellRewrite) {
|
|
|
7323
7339
|
if (shellRewrite.action === "rewrite") {
|
|
7324
7340
|
process.argv = shellRewrite.argv;
|
|
7325
7341
|
} else if (shellRewrite.action === "version") {
|
|
7326
|
-
console.log(`ape-shell ${"1.
|
|
7342
|
+
console.log(`ape-shell ${"1.20.0"} (OpenApe DDISA shell wrapper)`);
|
|
7327
7343
|
process.exit(0);
|
|
7328
7344
|
} else if (shellRewrite.action === "help") {
|
|
7329
|
-
console.log(`ape-shell ${"1.
|
|
7345
|
+
console.log(`ape-shell ${"1.20.0"} \u2014 OpenApe DDISA shell wrapper`);
|
|
7330
7346
|
console.log("");
|
|
7331
7347
|
console.log("Usage:");
|
|
7332
7348
|
console.log(" ape-shell Start interactive grant-mediated REPL");
|
|
@@ -7384,7 +7400,7 @@ var configCommand = defineCommand60({
|
|
|
7384
7400
|
var main = defineCommand60({
|
|
7385
7401
|
meta: {
|
|
7386
7402
|
name: "apes",
|
|
7387
|
-
version: "1.
|
|
7403
|
+
version: "1.20.0",
|
|
7388
7404
|
description: "Unified CLI for OpenApe"
|
|
7389
7405
|
},
|
|
7390
7406
|
subCommands: {
|
|
@@ -7441,7 +7457,7 @@ async function maybeRefreshAuth() {
|
|
|
7441
7457
|
}
|
|
7442
7458
|
}
|
|
7443
7459
|
await maybeRefreshAuth();
|
|
7444
|
-
await maybeWarnStaleVersion("1.
|
|
7460
|
+
await maybeWarnStaleVersion("1.20.0").catch(() => {
|
|
7445
7461
|
});
|
|
7446
7462
|
runMain(main).catch((err) => {
|
|
7447
7463
|
if (err instanceof CliExit) {
|