agent-relay-orchestrator 0.70.0 → 0.71.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-orchestrator",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "description": "Agent Relay orchestrator — manages agent lifecycle across hosts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "test": "bun test"
17
17
  },
18
18
  "dependencies": {
19
- "agent-relay-sdk": "0.2.45"
19
+ "agent-relay-sdk": "0.2.46"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/bun": "latest",
@@ -1,4 +1,6 @@
1
1
  import { join } from "node:path";
2
+ import { existsSync } from "node:fs";
3
+ import { homedir } from "node:os";
2
4
  import type { OrchestratorConfig } from "./config";
3
5
  import type { RelayClient, RelayCommand } from "./relay";
4
6
  import { detectSelfSupervision, type SelfSupervision } from "./self-supervision";
@@ -34,6 +36,7 @@ function isCacheRaceError(output: string): boolean {
34
36
  export interface SelfUpgradeRunner {
35
37
  run(cmd: string[]): Promise<{ exitCode: number; stdout: string; stderr: string }>;
36
38
  commandExists(name: string): boolean;
39
+ fileExists?(path: string): boolean;
37
40
  }
38
41
 
39
42
  const defaultRunner: SelfUpgradeRunner = {
@@ -53,6 +56,9 @@ const defaultRunner: SelfUpgradeRunner = {
53
56
  return false;
54
57
  }
55
58
  },
59
+ fileExists(path) {
60
+ return existsSync(path);
61
+ },
56
62
  };
57
63
 
58
64
  interface SelfUpgradePlan {
@@ -218,9 +224,10 @@ function buildInstallCommand(
218
224
  ];
219
225
  }
220
226
 
221
- if (runner.commandExists("agent-relay")) {
227
+ const runtimeCli = join(homedir(), ".agent-relay", "runtime", "node_modules", ".bin", "agent-relay");
228
+ if (runner.fileExists?.(runtimeCli)) {
222
229
  return [
223
- "agent-relay", "upgrade",
230
+ runtimeCli, "upgrade",
224
231
  "--version", targetVersion,
225
232
  "--providers", providers.join(","),
226
233
  "--no-restart",
@@ -228,7 +235,7 @@ function buildInstallCommand(
228
235
  ];
229
236
  }
230
237
 
231
- throw new Error("agent-relay CLI is not available and no runtime prefix was detected; self-upgrade cannot install packages");
238
+ throw new Error(`runtime agent-relay CLI is not available at ${runtimeCli} and no runtime prefix was detected; refusing ambient PATH self-upgrade`);
232
239
  }
233
240
 
234
241
  function packagesForProviders(targetVersion: string, providers: string[]): string[] {