@openape/apes 0.25.1 → 0.26.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
@@ -1908,6 +1908,16 @@ chmod 644 ${shQuote(bridge.plistPath)}
1908
1908
  function buildBridgeBootstrapBlock(bridge) {
1909
1909
  if (!bridge) return "";
1910
1910
  return `
1911
+ echo "==> Installing bridge stack as $NAME via bun (one-time)\u2026"
1912
+ su - "$NAME" -c '
1913
+ set -euo pipefail
1914
+ export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$HOME/.bun/install/global/bin"
1915
+ bun add -g @openape/chat-bridge @openape/apes @mariozechner/pi-coding-agent
1916
+ '
1917
+
1918
+ # Bootstrap into the system domain. Spawn already runs as root via
1919
+ # \`apes run --as root\`, so we have permission. Stale label is bootouted
1920
+ # first to make re-spawn idempotent.
1911
1921
  launchctl bootout "system/${bridge.plistLabel}" 2>/dev/null || true
1912
1922
  launchctl bootstrap system ${shQuote(bridge.plistPath)} || \\
1913
1923
  echo "warn: bridge bootstrap into system domain failed; check ${bridge.plistPath}"
@@ -2571,20 +2581,26 @@ LITELLM_API_KEY=${cfg.apiKey}
2571
2581
  function buildBridgeStartScript() {
2572
2582
  return `#!/usr/bin/env bash
2573
2583
  # Auto-generated by 'apes agents spawn --bridge'.
2574
- # Idempotent installer + launcher.
2584
+ # Slim launcher \u2014 install stack lives in spawn, not here.
2575
2585
  set -euo pipefail
2576
2586
 
2577
- export NPM_CONFIG_PREFIX="$HOME/.npm-global"
2578
- export PATH="$NPM_CONFIG_PREFIX/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
2579
- mkdir -p "$NPM_CONFIG_PREFIX"
2587
+ export PATH="$HOME/.bun/install/global/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
2580
2588
 
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
- if ! command -v pi >/dev/null 2>&1; then
2587
- npm install -g --silent @mariozechner/pi-coding-agent
2589
+ # Refresh IdP token. Agents auth via SSH-key signing \u2014 the cached IdP
2590
+ # token has no refresh_token and expires after ~1h. Re-running apes
2591
+ # login re-signs against the registered key. Soft-fails to leave the
2592
+ # bridge usable on cached token if the IdP is briefly unreachable.
2593
+ if [ -f "$HOME/.config/apes/auth.json" ] && command -v apes >/dev/null 2>&1; then
2594
+ agent_email=$(python3 -c "import json,os,sys
2595
+ try: print(json.load(open(os.path.expanduser('~/.config/apes/auth.json')))['email'])
2596
+ except Exception: sys.exit(1)" 2>/dev/null || true)
2597
+ agent_idp=$(python3 -c "import json,os,sys
2598
+ try: print(json.load(open(os.path.expanduser('~/.config/apes/auth.json')))['idp'])
2599
+ except Exception: sys.exit(1)" 2>/dev/null || true)
2600
+ if [ -n "$agent_email" ] && [ -n "$agent_idp" ]; then
2601
+ apes login "$agent_email" --idp "$agent_idp" >/dev/null 2>&1 \\
2602
+ || echo "warn: apes login failed for $agent_email; continuing with cached token"
2603
+ fi
2588
2604
  fi
2589
2605
 
2590
2606
  EXT_DIR="$HOME/.pi/agent/extensions"
@@ -2665,7 +2681,7 @@ function buildBridgePlist(agentName, homeDir) {
2665
2681
  <key>HOME</key>
2666
2682
  <string>${homeDir}</string>
2667
2683
  <key>PATH</key>
2668
- <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
2684
+ <string>${homeDir}/.bun/install/global/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
2669
2685
  </dict>
2670
2686
  </dict>
2671
2687
  </plist>
@@ -4139,7 +4155,7 @@ var mcpCommand = defineCommand32({
4139
4155
  if (transport !== "stdio" && transport !== "sse") {
4140
4156
  throw new Error('Transport must be "stdio" or "sse"');
4141
4157
  }
4142
- const { startMcpServer } = await import("./server-GQDX7PHW.js");
4158
+ const { startMcpServer } = await import("./server-M55Z6QYF.js");
4143
4159
  await startMcpServer(transport, port);
4144
4160
  }
4145
4161
  });
@@ -4777,7 +4793,7 @@ async function bestEffortGrantCount(idp) {
4777
4793
  }
4778
4794
  }
4779
4795
  async function runHealth(args) {
4780
- const version = true ? "0.25.1" : "0.0.0";
4796
+ const version = true ? "0.26.0" : "0.0.0";
4781
4797
  const auth = loadAuth();
4782
4798
  if (!auth) {
4783
4799
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -5050,10 +5066,10 @@ if (shellRewrite) {
5050
5066
  if (shellRewrite.action === "rewrite") {
5051
5067
  process.argv = shellRewrite.argv;
5052
5068
  } else if (shellRewrite.action === "version") {
5053
- console.log(`ape-shell ${"0.25.1"} (OpenApe DDISA shell wrapper)`);
5069
+ console.log(`ape-shell ${"0.26.0"} (OpenApe DDISA shell wrapper)`);
5054
5070
  process.exit(0);
5055
5071
  } else if (shellRewrite.action === "help") {
5056
- console.log(`ape-shell ${"0.25.1"} \u2014 OpenApe DDISA shell wrapper`);
5072
+ console.log(`ape-shell ${"0.26.0"} \u2014 OpenApe DDISA shell wrapper`);
5057
5073
  console.log("");
5058
5074
  console.log("Usage:");
5059
5075
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -5111,7 +5127,7 @@ var configCommand = defineCommand44({
5111
5127
  var main = defineCommand44({
5112
5128
  meta: {
5113
5129
  name: "apes",
5114
- version: "0.25.1",
5130
+ version: "0.26.0",
5115
5131
  description: "Unified CLI for OpenApe"
5116
5132
  },
5117
5133
  subCommands: {
@@ -5166,7 +5182,7 @@ async function maybeRefreshAuth() {
5166
5182
  }
5167
5183
  }
5168
5184
  await maybeRefreshAuth();
5169
- await maybeWarnStaleVersion("0.25.1").catch(() => {
5185
+ await maybeWarnStaleVersion("0.26.0").catch(() => {
5170
5186
  });
5171
5187
  runMain(main).catch((err) => {
5172
5188
  if (err instanceof CliExit) {