@openape/apes 1.22.0 → 1.22.2

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
@@ -3216,21 +3216,34 @@ ${consequences.join("\n")}`);
3216
3216
  throw new CliError("`sudo` not found on PATH; required for OS teardown.");
3217
3217
  }
3218
3218
  const adminUser = userInfo().username;
3219
- const adminPassword = await collectAdminPassword({ adminUser });
3220
- const scratch = mkdtempSync(join3(tmpdir(), `apes-destroy-${name}-`));
3221
- const scriptPath = join3(scratch, "teardown.sh");
3219
+ let adminPassword;
3222
3220
  try {
3223
- const script = buildDestroyTeardownScript({ name, homeDir, adminUser });
3224
- writeFileSync2(scriptPath, script, { mode: 448 });
3225
- consola19.start("Running teardown via sudo\u2026");
3226
- execFileSync4(sudo, ["-S", "--prompt=", "--", "bash", scriptPath], {
3227
- input: `${adminPassword}
3221
+ adminPassword = await collectAdminPassword({ adminUser });
3222
+ } catch (err) {
3223
+ const headless = !process.stdin.isTTY && !process.env.APES_ADMIN_PASSWORD;
3224
+ if (headless) {
3225
+ consola19.warn(`Legacy OS teardown for ${name} requires a TTY or APES_ADMIN_PASSWORD; skipping. Run \`apes agents destroy ${name}\` from a shell later to fully clean up /Users/${name} + dscl record.`);
3226
+ adminPassword = "";
3227
+ } else {
3228
+ throw err;
3229
+ }
3230
+ }
3231
+ if (adminPassword) {
3232
+ const scratch = mkdtempSync(join3(tmpdir(), `apes-destroy-${name}-`));
3233
+ const scriptPath = join3(scratch, "teardown.sh");
3234
+ try {
3235
+ const script = buildDestroyTeardownScript({ name, homeDir, adminUser });
3236
+ writeFileSync2(scriptPath, script, { mode: 448 });
3237
+ consola19.start("Running teardown via sudo\u2026");
3238
+ execFileSync4(sudo, ["-S", "--prompt=", "--", "bash", scriptPath], {
3239
+ input: `${adminPassword}
3228
3240
  ${adminPassword}
3229
3241
  `,
3230
- stdio: ["pipe", "inherit", "inherit"]
3231
- });
3232
- } finally {
3233
- rmSync(scratch, { recursive: true, force: true });
3242
+ stdio: ["pipe", "inherit", "inherit"]
3243
+ });
3244
+ } finally {
3245
+ rmSync(scratch, { recursive: true, force: true });
3246
+ }
3234
3247
  }
3235
3248
  }
3236
3249
  } else if (!args["keep-os-user"] && isDarwin()) {
@@ -4757,17 +4770,18 @@ function installAdapter2() {
4757
4770
  return true;
4758
4771
  }
4759
4772
  function writeBridgeModelDefault(model) {
4760
- const envDir = join11(homedir11(), "litellm");
4761
- const envFile = join11(envDir, ".env");
4762
- mkdirSync5(envDir, { recursive: true });
4763
- let lines = [];
4764
- if (existsSync13(envFile)) {
4765
- lines = readFileSync11(envFile, "utf8").split("\n").filter((l) => !l.startsWith("APE_CHAT_BRIDGE_MODEL="));
4766
- }
4767
- lines.push(`APE_CHAT_BRIDGE_MODEL=${model}`);
4768
- while (lines.length > 0 && lines.at(-1).trim() === "") lines.pop();
4769
- writeFileSync7(envFile, `${lines.join("\n")}
4773
+ for (const envDir of [join11(homedir11(), "litellm"), join11(NEST_DATA_DIR, "litellm")]) {
4774
+ const envFile = join11(envDir, ".env");
4775
+ mkdirSync5(envDir, { recursive: true });
4776
+ let lines = [];
4777
+ if (existsSync13(envFile)) {
4778
+ lines = readFileSync11(envFile, "utf8").split("\n").filter((l) => !l.startsWith("APE_CHAT_BRIDGE_MODEL="));
4779
+ }
4780
+ lines.push(`APE_CHAT_BRIDGE_MODEL=${model}`);
4781
+ while (lines.length > 0 && lines.at(-1).trim() === "") lines.pop();
4782
+ writeFileSync7(envFile, `${lines.join("\n")}
4770
4783
  `, { mode: 384 });
4784
+ }
4771
4785
  }
4772
4786
  function findBinary(name) {
4773
4787
  for (const dir of [
@@ -6457,7 +6471,7 @@ var mcpCommand = defineCommand48({
6457
6471
  if (transport !== "stdio" && transport !== "sse") {
6458
6472
  throw new Error('Transport must be "stdio" or "sse"');
6459
6473
  }
6460
- const { startMcpServer } = await import("./server-SBQ77UGP.js");
6474
+ const { startMcpServer } = await import("./server-PKEGSN5E.js");
6461
6475
  await startMcpServer(transport, port);
6462
6476
  }
6463
6477
  });
@@ -7095,7 +7109,7 @@ async function bestEffortGrantCount(idp) {
7095
7109
  }
7096
7110
  }
7097
7111
  async function runHealth(args) {
7098
- const version = true ? "1.22.0" : "0.0.0";
7112
+ const version = true ? "1.22.2" : "0.0.0";
7099
7113
  const auth = loadAuth();
7100
7114
  if (!auth) {
7101
7115
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -7368,10 +7382,10 @@ if (shellRewrite) {
7368
7382
  if (shellRewrite.action === "rewrite") {
7369
7383
  process.argv = shellRewrite.argv;
7370
7384
  } else if (shellRewrite.action === "version") {
7371
- console.log(`ape-shell ${"1.22.0"} (OpenApe DDISA shell wrapper)`);
7385
+ console.log(`ape-shell ${"1.22.2"} (OpenApe DDISA shell wrapper)`);
7372
7386
  process.exit(0);
7373
7387
  } else if (shellRewrite.action === "help") {
7374
- console.log(`ape-shell ${"1.22.0"} \u2014 OpenApe DDISA shell wrapper`);
7388
+ console.log(`ape-shell ${"1.22.2"} \u2014 OpenApe DDISA shell wrapper`);
7375
7389
  console.log("");
7376
7390
  console.log("Usage:");
7377
7391
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -7429,7 +7443,7 @@ var configCommand = defineCommand60({
7429
7443
  var main = defineCommand60({
7430
7444
  meta: {
7431
7445
  name: "apes",
7432
- version: "1.22.0",
7446
+ version: "1.22.2",
7433
7447
  description: "Unified CLI for OpenApe"
7434
7448
  },
7435
7449
  subCommands: {
@@ -7486,7 +7500,7 @@ async function maybeRefreshAuth() {
7486
7500
  }
7487
7501
  }
7488
7502
  await maybeRefreshAuth();
7489
- await maybeWarnStaleVersion("1.22.0").catch(() => {
7503
+ await maybeWarnStaleVersion("1.22.2").catch(() => {
7490
7504
  });
7491
7505
  runMain(main).catch((err) => {
7492
7506
  if (err instanceof CliExit) {