@openape/apes 1.0.4 → 1.1.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
@@ -3392,6 +3392,7 @@ function readLitellmEnv(envPath = join5(homedir8(), "litellm", ".env")) {
3392
3392
  const value = trimmed.slice(eq + 1).trim();
3393
3393
  if (key === "LITELLM_MASTER_KEY" || key === "LITELLM_API_KEY") out.apiKey = value;
3394
3394
  if (key === "LITELLM_BASE_URL") out.baseUrl = value;
3395
+ if (key === "APE_CHAT_BRIDGE_MODEL") out.model = value;
3395
3396
  }
3396
3397
  return out;
3397
3398
  } catch {
@@ -3402,12 +3403,13 @@ function resolveBridgeConfig(opts) {
3402
3403
  const env = readLitellmEnv(opts.envPath);
3403
3404
  const apiKey = opts.cliKey ?? env?.apiKey;
3404
3405
  const baseUrl = opts.cliBaseUrl ?? env?.baseUrl ?? "http://127.0.0.1:4000/v1";
3406
+ const model = opts.cliModel ?? env?.model;
3405
3407
  if (!apiKey) {
3406
3408
  throw new Error(
3407
3409
  "No LITELLM_API_KEY resolved. Pass --bridge-key sk-\u2026 or write LITELLM_MASTER_KEY into ~/litellm/.env first."
3408
3410
  );
3409
3411
  }
3410
- return { baseUrl, apiKey };
3412
+ return { baseUrl, apiKey, model };
3411
3413
  }
3412
3414
  function bridgePlistLabel(agentName) {
3413
3415
  return `${PLIST_LABEL_PREFIX}.${agentName}`;
@@ -3416,11 +3418,13 @@ function bridgePlistPath(agentName) {
3416
3418
  return `/Library/LaunchDaemons/${bridgePlistLabel(agentName)}.plist`;
3417
3419
  }
3418
3420
  function buildBridgeEnvFile(cfg) {
3421
+ const modelLine = cfg.model ? `APE_CHAT_BRIDGE_MODEL=${cfg.model}
3422
+ ` : "";
3419
3423
  return `# Auto-generated by 'apes agents spawn --bridge'.
3420
3424
  # Read by the chat-bridge daemon at boot to talk to the local LLM proxy.
3421
3425
  LITELLM_BASE_URL=${cfg.baseUrl}
3422
3426
  LITELLM_API_KEY=${cfg.apiKey}
3423
- `;
3427
+ ${modelLine}`;
3424
3428
  }
3425
3429
  function buildBridgeStartScript() {
3426
3430
  return `#!/usr/bin/env bash
@@ -3528,6 +3532,10 @@ var spawnAgentCommand = defineCommand26({
3528
3532
  "bridge-base-url": {
3529
3533
  type: "string",
3530
3534
  description: "Override LITELLM_BASE_URL for the bridge (default: read from ~/litellm/.env or http://127.0.0.1:4000/v1)."
3535
+ },
3536
+ "bridge-model": {
3537
+ type: "string",
3538
+ description: "Model the bridge sends in chat-completion requests (default: claude-haiku-4-5). Override when fronting a proxy that doesn't route the default \u2014 e.g. ChatGPT-only proxy needs `gpt-5.4`."
3531
3539
  }
3532
3540
  },
3533
3541
  async run({ args }) {
@@ -3603,7 +3611,8 @@ and try again.`
3603
3611
  const bridge = args.bridge ? (() => {
3604
3612
  const cfg = resolveBridgeConfig({
3605
3613
  cliKey: typeof args["bridge-key"] === "string" ? args["bridge-key"] : void 0,
3606
- cliBaseUrl: typeof args["bridge-base-url"] === "string" ? args["bridge-base-url"] : void 0
3614
+ cliBaseUrl: typeof args["bridge-base-url"] === "string" ? args["bridge-base-url"] : void 0,
3615
+ cliModel: typeof args["bridge-model"] === "string" ? args["bridge-model"] : void 0
3607
3616
  });
3608
3617
  return {
3609
3618
  plistLabel: bridgePlistLabel(name),
@@ -3910,17 +3919,20 @@ function readAuthJson() {
3910
3919
  }
3911
3920
  if (!parsed.access_token) throw new CliError(`${AUTH_PATH3} is missing access_token`);
3912
3921
  if (!parsed.email) throw new CliError(`${AUTH_PATH3} is missing email`);
3913
- if (!parsed.email.startsWith("agent+")) {
3922
+ if (!parsed.email.includes("+")) {
3914
3923
  throw new CliError(
3915
- `${AUTH_PATH3} email is "${parsed.email}" \u2014 expected an agent+name+domain@idp address. Run \`apes agents spawn\` rather than calling sync from a human user.`
3924
+ `${AUTH_PATH3} email is "${parsed.email}" \u2014 expected an agent address (with embedded +owner+domain). Run \`apes agents spawn\` rather than calling sync from a human user.`
3916
3925
  );
3917
3926
  }
3918
3927
  return parsed;
3919
3928
  }
3920
3929
  function agentNameFromEmail(email) {
3921
- const m = email.match(/^agent\+([^+]+)\+/);
3922
- if (!m) throw new CliError(`agent email "${email}" does not match agent+name+domain pattern`);
3923
- return m[1];
3930
+ const before = email.split("+")[0];
3931
+ const dashIdx = before.lastIndexOf("-");
3932
+ if (dashIdx <= 0) {
3933
+ return before;
3934
+ }
3935
+ return before.slice(0, dashIdx);
3924
3936
  }
3925
3937
  function findApesBin() {
3926
3938
  const argv1 = process.argv[1];
@@ -5263,7 +5275,7 @@ var mcpCommand = defineCommand36({
5263
5275
  if (transport !== "stdio" && transport !== "sse") {
5264
5276
  throw new Error('Transport must be "stdio" or "sse"');
5265
5277
  }
5266
- const { startMcpServer } = await import("./server-TUNRAZET.js");
5278
+ const { startMcpServer } = await import("./server-YKLZLQKX.js");
5267
5279
  await startMcpServer(transport, port);
5268
5280
  }
5269
5281
  });
@@ -5901,7 +5913,7 @@ async function bestEffortGrantCount(idp) {
5901
5913
  }
5902
5914
  }
5903
5915
  async function runHealth(args) {
5904
- const version = true ? "1.0.4" : "0.0.0";
5916
+ const version = true ? "1.1.0" : "0.0.0";
5905
5917
  const auth = loadAuth();
5906
5918
  if (!auth) {
5907
5919
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -6174,10 +6186,10 @@ if (shellRewrite) {
6174
6186
  if (shellRewrite.action === "rewrite") {
6175
6187
  process.argv = shellRewrite.argv;
6176
6188
  } else if (shellRewrite.action === "version") {
6177
- console.log(`ape-shell ${"1.0.4"} (OpenApe DDISA shell wrapper)`);
6189
+ console.log(`ape-shell ${"1.1.0"} (OpenApe DDISA shell wrapper)`);
6178
6190
  process.exit(0);
6179
6191
  } else if (shellRewrite.action === "help") {
6180
- console.log(`ape-shell ${"1.0.4"} \u2014 OpenApe DDISA shell wrapper`);
6192
+ console.log(`ape-shell ${"1.1.0"} \u2014 OpenApe DDISA shell wrapper`);
6181
6193
  console.log("");
6182
6194
  console.log("Usage:");
6183
6195
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -6235,7 +6247,7 @@ var configCommand = defineCommand48({
6235
6247
  var main = defineCommand48({
6236
6248
  meta: {
6237
6249
  name: "apes",
6238
- version: "1.0.4",
6250
+ version: "1.1.0",
6239
6251
  description: "Unified CLI for OpenApe"
6240
6252
  },
6241
6253
  subCommands: {
@@ -6290,7 +6302,7 @@ async function maybeRefreshAuth() {
6290
6302
  }
6291
6303
  }
6292
6304
  await maybeRefreshAuth();
6293
- await maybeWarnStaleVersion("1.0.4").catch(() => {
6305
+ await maybeWarnStaleVersion("1.1.0").catch(() => {
6294
6306
  });
6295
6307
  runMain(main).catch((err) => {
6296
6308
  if (err instanceof CliExit) {