@openape/apes 0.25.2 → 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,35 +2581,16 @@ 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"
2580
-
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
2593
- fi
2594
-
2595
- if ! command -v pi >/dev/null 2>&1; then
2596
- npm install -g --silent @mariozechner/pi-coding-agent
2597
- fi
2587
+ export PATH="$HOME/.bun/install/global/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
2598
2588
 
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
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
2603
2594
  agent_email=$(python3 -c "import json,os,sys
2604
2595
  try: print(json.load(open(os.path.expanduser('~/.config/apes/auth.json')))['email'])
2605
2596
  except Exception: sys.exit(1)" 2>/dev/null || true)
@@ -2690,7 +2681,7 @@ function buildBridgePlist(agentName, homeDir) {
2690
2681
  <key>HOME</key>
2691
2682
  <string>${homeDir}</string>
2692
2683
  <key>PATH</key>
2693
- <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>
2694
2685
  </dict>
2695
2686
  </dict>
2696
2687
  </plist>
@@ -4164,7 +4155,7 @@ var mcpCommand = defineCommand32({
4164
4155
  if (transport !== "stdio" && transport !== "sse") {
4165
4156
  throw new Error('Transport must be "stdio" or "sse"');
4166
4157
  }
4167
- const { startMcpServer } = await import("./server-LEI7F46S.js");
4158
+ const { startMcpServer } = await import("./server-M55Z6QYF.js");
4168
4159
  await startMcpServer(transport, port);
4169
4160
  }
4170
4161
  });
@@ -4802,7 +4793,7 @@ async function bestEffortGrantCount(idp) {
4802
4793
  }
4803
4794
  }
4804
4795
  async function runHealth(args) {
4805
- const version = true ? "0.25.2" : "0.0.0";
4796
+ const version = true ? "0.26.0" : "0.0.0";
4806
4797
  const auth = loadAuth();
4807
4798
  if (!auth) {
4808
4799
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -5075,10 +5066,10 @@ if (shellRewrite) {
5075
5066
  if (shellRewrite.action === "rewrite") {
5076
5067
  process.argv = shellRewrite.argv;
5077
5068
  } else if (shellRewrite.action === "version") {
5078
- console.log(`ape-shell ${"0.25.2"} (OpenApe DDISA shell wrapper)`);
5069
+ console.log(`ape-shell ${"0.26.0"} (OpenApe DDISA shell wrapper)`);
5079
5070
  process.exit(0);
5080
5071
  } else if (shellRewrite.action === "help") {
5081
- console.log(`ape-shell ${"0.25.2"} \u2014 OpenApe DDISA shell wrapper`);
5072
+ console.log(`ape-shell ${"0.26.0"} \u2014 OpenApe DDISA shell wrapper`);
5082
5073
  console.log("");
5083
5074
  console.log("Usage:");
5084
5075
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -5136,7 +5127,7 @@ var configCommand = defineCommand44({
5136
5127
  var main = defineCommand44({
5137
5128
  meta: {
5138
5129
  name: "apes",
5139
- version: "0.25.2",
5130
+ version: "0.26.0",
5140
5131
  description: "Unified CLI for OpenApe"
5141
5132
  },
5142
5133
  subCommands: {
@@ -5191,7 +5182,7 @@ async function maybeRefreshAuth() {
5191
5182
  }
5192
5183
  }
5193
5184
  await maybeRefreshAuth();
5194
- await maybeWarnStaleVersion("0.25.2").catch(() => {
5185
+ await maybeWarnStaleVersion("0.26.0").catch(() => {
5195
5186
  });
5196
5187
  runMain(main).catch((err) => {
5197
5188
  if (err instanceof CliExit) {