@openape/apes 0.25.0 → 0.25.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
@@ -2578,14 +2578,40 @@ export NPM_CONFIG_PREFIX="$HOME/.npm-global"
2578
2578
  export PATH="$NPM_CONFIG_PREFIX/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
2579
2579
  mkdir -p "$NPM_CONFIG_PREFIX"
2580
2580
 
2581
- if ! command -v openape-chat-bridge >/dev/null 2>&1; then
2582
- npm install -g --silent @openape/chat-bridge
2581
+ # Always pull @latest on boot. npm is cached so this is a no-op when the
2582
+ # global is already current; when a new version ships, the daemon auto-
2583
+ # upgrades on the next launchctl restart instead of needing manual touch.
2584
+ npm install -g --silent @openape/chat-bridge@latest
2585
+
2586
+ # apes is needed to refresh the agent's IdP token before each boot \u2014
2587
+ # agents auth via SSH key signing, the resulting token has no
2588
+ # refresh_token and expires after ~1h. Without re-running 'apes login'
2589
+ # the bridge would crashloop after the first hour. KeepAlive's 10s
2590
+ # throttle then bounds the recovery gap to ~10s.
2591
+ if ! command -v apes >/dev/null 2>&1; then
2592
+ npm install -g --silent @openape/apes
2583
2593
  fi
2584
2594
 
2585
2595
  if ! command -v pi >/dev/null 2>&1; then
2586
2596
  npm install -g --silent @mariozechner/pi-coding-agent
2587
2597
  fi
2588
2598
 
2599
+ # Refresh IdP token. Read the agent's own email + idp out of the auth
2600
+ # file spawn wrote, then re-sign via the registered SSH key. python3 is
2601
+ # always available on macOS \u2014 avoids a jq dep.
2602
+ if [ -f "$HOME/.config/apes/auth.json" ]; then
2603
+ agent_email=$(python3 -c "import json,os,sys
2604
+ try: print(json.load(open(os.path.expanduser('~/.config/apes/auth.json')))['email'])
2605
+ except Exception: sys.exit(1)" 2>/dev/null || true)
2606
+ agent_idp=$(python3 -c "import json,os,sys
2607
+ try: print(json.load(open(os.path.expanduser('~/.config/apes/auth.json')))['idp'])
2608
+ except Exception: sys.exit(1)" 2>/dev/null || true)
2609
+ if [ -n "$agent_email" ] && [ -n "$agent_idp" ]; then
2610
+ apes login "$agent_email" --idp "$agent_idp" >/dev/null 2>&1 \\
2611
+ || echo "warn: apes login failed for $agent_email; continuing with cached token"
2612
+ fi
2613
+ fi
2614
+
2589
2615
  EXT_DIR="$HOME/.pi/agent/extensions"
2590
2616
  mkdir -p "$EXT_DIR"
2591
2617
  if [ ! -f "$EXT_DIR/litellm.ts" ]; then
@@ -4138,7 +4164,7 @@ var mcpCommand = defineCommand32({
4138
4164
  if (transport !== "stdio" && transport !== "sse") {
4139
4165
  throw new Error('Transport must be "stdio" or "sse"');
4140
4166
  }
4141
- const { startMcpServer } = await import("./server-3HW3TBY5.js");
4167
+ const { startMcpServer } = await import("./server-LEI7F46S.js");
4142
4168
  await startMcpServer(transport, port);
4143
4169
  }
4144
4170
  });
@@ -4776,7 +4802,7 @@ async function bestEffortGrantCount(idp) {
4776
4802
  }
4777
4803
  }
4778
4804
  async function runHealth(args) {
4779
- const version = true ? "0.25.0" : "0.0.0";
4805
+ const version = true ? "0.25.2" : "0.0.0";
4780
4806
  const auth = loadAuth();
4781
4807
  if (!auth) {
4782
4808
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -5049,10 +5075,10 @@ if (shellRewrite) {
5049
5075
  if (shellRewrite.action === "rewrite") {
5050
5076
  process.argv = shellRewrite.argv;
5051
5077
  } else if (shellRewrite.action === "version") {
5052
- console.log(`ape-shell ${"0.25.0"} (OpenApe DDISA shell wrapper)`);
5078
+ console.log(`ape-shell ${"0.25.2"} (OpenApe DDISA shell wrapper)`);
5053
5079
  process.exit(0);
5054
5080
  } else if (shellRewrite.action === "help") {
5055
- console.log(`ape-shell ${"0.25.0"} \u2014 OpenApe DDISA shell wrapper`);
5081
+ console.log(`ape-shell ${"0.25.2"} \u2014 OpenApe DDISA shell wrapper`);
5056
5082
  console.log("");
5057
5083
  console.log("Usage:");
5058
5084
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -5110,7 +5136,7 @@ var configCommand = defineCommand44({
5110
5136
  var main = defineCommand44({
5111
5137
  meta: {
5112
5138
  name: "apes",
5113
- version: "0.25.0",
5139
+ version: "0.25.2",
5114
5140
  description: "Unified CLI for OpenApe"
5115
5141
  },
5116
5142
  subCommands: {
@@ -5165,7 +5191,7 @@ async function maybeRefreshAuth() {
5165
5191
  }
5166
5192
  }
5167
5193
  await maybeRefreshAuth();
5168
- await maybeWarnStaleVersion("0.25.0").catch(() => {
5194
+ await maybeWarnStaleVersion("0.25.2").catch(() => {
5169
5195
  });
5170
5196
  runMain(main).catch((err) => {
5171
5197
  if (err instanceof CliExit) {