@rivet-dev/agentos-runtime-sidecar 0.2.21 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +4 -1
  2. package/index.js +18 -3
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -1,10 +1,13 @@
1
1
  # @rivet-dev/agentos-runtime-sidecar
2
2
 
3
- Platform-specific resolver for the AgentOS native sidecar binary.
3
+ Platform-specific resolver for the agentOS native sidecar binary.
4
4
 
5
5
  The compiled `agentos-native-sidecar` binary ships inside one of the
6
6
  `@rivet-dev/agentos-runtime-sidecar-<platform>` packages. npm installs only the package
7
7
  matching the current `os`/`cpu`/`libc` at install time.
8
+ The resolver requires that platform package to have the same version as this
9
+ package and to contain the binary. Reinstall agentOS if either check fails;
10
+ mixing sidecar versions is unsupported.
8
11
 
9
12
  ```js
10
13
  const { getSidecarPath } = require("@rivet-dev/agentos-runtime-sidecar");
package/index.js CHANGED
@@ -12,6 +12,7 @@
12
12
 
13
13
  const { existsSync } = require("node:fs");
14
14
  const { join, dirname } = require("node:path");
15
+ const { version: RESOLVER_VERSION } = require("./package.json");
15
16
 
16
17
  const BINARY_BASENAME = "agentos-native-sidecar";
17
18
 
@@ -89,7 +90,7 @@ function getSidecarPath() {
89
90
  if (!platformPkg) {
90
91
  throw new Error(
91
92
  `@rivet-dev/agentos-runtime-sidecar: unsupported platform ${process.platform}/${process.arch}. ` +
92
- "The AgentOS sidecar supports linux (x64/arm64, glibc/musl), " +
93
+ "The agentOS sidecar supports linux (x64/arm64, glibc/musl), " +
93
94
  "macOS (x64/arm64), and Windows (x64). " +
94
95
  "Set AGENTOS_SIDECAR_BIN to a local agentos-native-sidecar binary to override.",
95
96
  );
@@ -102,12 +103,26 @@ function getSidecarPath() {
102
103
  throw new Error(
103
104
  `@rivet-dev/agentos-runtime-sidecar: platform package ${platformPkg} is not installed.\n` +
104
105
  "This usually means the platform is unsupported or optionalDependencies were\n" +
105
- `skipped during install. Try: npm install --include=optional ${platformPkg}\n` +
106
+ `skipped during install. Try: npm install --include=optional ${platformPkg}@${RESOLVER_VERSION}\n` +
106
107
  "Or set AGENTOS_SIDECAR_BIN to a local agentos-native-sidecar binary.",
107
108
  );
108
109
  }
109
110
 
110
- return join(dirname(pkgJsonPath), BINARY_NAME);
111
+ const platformVersion = require(pkgJsonPath).version;
112
+ if (platformVersion !== RESOLVER_VERSION) {
113
+ throw new Error(
114
+ `@rivet-dev/agentos-runtime-sidecar: platform package ${platformPkg} has version ${platformVersion}; expected ${RESOLVER_VERSION}. ` +
115
+ "Reinstall agentOS so the resolver and native binary use the same version.",
116
+ );
117
+ }
118
+ const binaryPath = join(dirname(pkgJsonPath), BINARY_NAME);
119
+ if (!existsSync(binaryPath)) {
120
+ throw new Error(
121
+ `@rivet-dev/agentos-runtime-sidecar: platform package ${platformPkg} is missing ${BINARY_NAME}. ` +
122
+ "Reinstall the platform package or set AGENTOS_SIDECAR_BIN to a local binary.",
123
+ );
124
+ }
125
+ return binaryPath;
111
126
  }
112
127
 
113
128
  module.exports = { getSidecarPath };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-runtime-sidecar",
3
- "version": "0.2.21",
4
- "description": "Platform-specific resolver for the AgentOS language execution native sidecar binary",
3
+ "version": "0.4.0",
4
+ "description": "Platform-specific resolver for the agentOS language execution native sidecar binary",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -23,9 +23,9 @@
23
23
  "node": ">=20"
24
24
  },
25
25
  "optionalDependencies": {
26
- "@rivet-dev/agentos-runtime-sidecar-darwin-arm64": "0.2.21",
27
- "@rivet-dev/agentos-runtime-sidecar-darwin-x64": "0.2.21",
28
- "@rivet-dev/agentos-runtime-sidecar-linux-arm64-gnu": "0.2.21",
29
- "@rivet-dev/agentos-runtime-sidecar-linux-x64-gnu": "0.2.21"
26
+ "@rivet-dev/agentos-runtime-sidecar-darwin-arm64": "0.4.0",
27
+ "@rivet-dev/agentos-runtime-sidecar-darwin-x64": "0.4.0",
28
+ "@rivet-dev/agentos-runtime-sidecar-linux-arm64-gnu": "0.4.0",
29
+ "@rivet-dev/agentos-runtime-sidecar-linux-x64-gnu": "0.4.0"
30
30
  }
31
31
  }