@openape/apes 1.22.1 → 1.23.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
@@ -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()) {
@@ -4334,11 +4347,10 @@ var syncAgentCommand = defineCommand27({
4334
4347
  ownerEmail: auth.owner_email
4335
4348
  });
4336
4349
  consola24.info(sync.first_sync ? "\u2713 first sync \u2014 agent registered" : "\u2713 presence updated");
4337
- const { system_prompt: systemPrompt, tools, soul, skills, tasks } = await client.listTasks();
4350
+ const { system_prompt: systemPrompt, tools, skills, tasks } = await client.listTasks();
4338
4351
  consola24.info(`Pulled ${tasks.length} task${tasks.length === 1 ? "" : "s"}`);
4339
4352
  consola24.info(`Tools enabled: ${tools.length === 0 ? "(none)" : tools.join(", ")}`);
4340
4353
  consola24.info(`Skills: ${skills.length === 0 ? "(none)" : skills.map((s) => s.name).join(", ")}`);
4341
- consola24.info(`SOUL.md: ${soul.length > 0 ? `${soul.length} chars` : "(empty)"}`);
4342
4354
  let agentUid = null;
4343
4355
  let agentGid = null;
4344
4356
  if (process.geteuid?.() === 0) {
@@ -4377,10 +4389,6 @@ var syncAgentCommand = defineCommand27({
4377
4389
  `, { mode: 384 });
4378
4390
  chownToAgent(path2);
4379
4391
  }
4380
- const soulPath = join8(agentDir, "SOUL.md");
4381
- writeFileSync5(soulPath, soul.endsWith("\n") ? soul : `${soul}
4382
- `, { mode: 384 });
4383
- chownToAgent(soulPath);
4384
4392
  const skillsDir = join8(agentDir, "skills");
4385
4393
  mkdirSync3(skillsDir, { recursive: true });
4386
4394
  chownToAgent(skillsDir);
@@ -6458,7 +6466,7 @@ var mcpCommand = defineCommand48({
6458
6466
  if (transport !== "stdio" && transport !== "sse") {
6459
6467
  throw new Error('Transport must be "stdio" or "sse"');
6460
6468
  }
6461
- const { startMcpServer } = await import("./server-KCZQXFGH.js");
6469
+ const { startMcpServer } = await import("./server-D3WUVVZ2.js");
6462
6470
  await startMcpServer(transport, port);
6463
6471
  }
6464
6472
  });
@@ -7096,7 +7104,7 @@ async function bestEffortGrantCount(idp) {
7096
7104
  }
7097
7105
  }
7098
7106
  async function runHealth(args) {
7099
- const version = true ? "1.22.1" : "0.0.0";
7107
+ const version = true ? "1.23.0" : "0.0.0";
7100
7108
  const auth = loadAuth();
7101
7109
  if (!auth) {
7102
7110
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -7369,10 +7377,10 @@ if (shellRewrite) {
7369
7377
  if (shellRewrite.action === "rewrite") {
7370
7378
  process.argv = shellRewrite.argv;
7371
7379
  } else if (shellRewrite.action === "version") {
7372
- console.log(`ape-shell ${"1.22.1"} (OpenApe DDISA shell wrapper)`);
7380
+ console.log(`ape-shell ${"1.23.0"} (OpenApe DDISA shell wrapper)`);
7373
7381
  process.exit(0);
7374
7382
  } else if (shellRewrite.action === "help") {
7375
- console.log(`ape-shell ${"1.22.1"} \u2014 OpenApe DDISA shell wrapper`);
7383
+ console.log(`ape-shell ${"1.23.0"} \u2014 OpenApe DDISA shell wrapper`);
7376
7384
  console.log("");
7377
7385
  console.log("Usage:");
7378
7386
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -7430,7 +7438,7 @@ var configCommand = defineCommand60({
7430
7438
  var main = defineCommand60({
7431
7439
  meta: {
7432
7440
  name: "apes",
7433
- version: "1.22.1",
7441
+ version: "1.23.0",
7434
7442
  description: "Unified CLI for OpenApe"
7435
7443
  },
7436
7444
  subCommands: {
@@ -7487,7 +7495,7 @@ async function maybeRefreshAuth() {
7487
7495
  }
7488
7496
  }
7489
7497
  await maybeRefreshAuth();
7490
- await maybeWarnStaleVersion("1.22.1").catch(() => {
7498
+ await maybeWarnStaleVersion("1.23.0").catch(() => {
7491
7499
  });
7492
7500
  runMain(main).catch((err) => {
7493
7501
  if (err instanceof CliExit) {