@sandbox-agent/cli 0.1.5 → 0.1.6-rc.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.
Files changed (2) hide show
  1. package/bin/sandbox-agent +40 -1
  2. package/package.json +9 -5
package/bin/sandbox-agent CHANGED
@@ -1,11 +1,43 @@
1
1
  #!/usr/bin/env node
2
2
  const { execFileSync } = require("child_process");
3
+ const {
4
+ assertExecutable,
5
+ formatNonExecutableBinaryMessage,
6
+ } = require("@sandbox-agent/cli-shared");
7
+ const fs = require("fs");
3
8
  const path = require("path");
4
9
 
10
+ const TRUST_PACKAGES =
11
+ "@sandbox-agent/cli-linux-x64 @sandbox-agent/cli-linux-arm64 @sandbox-agent/cli-darwin-arm64 @sandbox-agent/cli-darwin-x64 @sandbox-agent/cli-win32-x64";
12
+
13
+ function formatHint(binPath) {
14
+ return formatNonExecutableBinaryMessage({
15
+ binPath,
16
+ trustPackages: TRUST_PACKAGES,
17
+ bunInstallBlocks: [
18
+ {
19
+ label: "Project install",
20
+ commands: [
21
+ `bun pm trust ${TRUST_PACKAGES}`,
22
+ "bun add @sandbox-agent/cli",
23
+ ],
24
+ },
25
+ {
26
+ label: "Global install",
27
+ commands: [
28
+ `bun pm -g trust ${TRUST_PACKAGES}`,
29
+ "bun add -g @sandbox-agent/cli",
30
+ ],
31
+ },
32
+ ],
33
+ });
34
+ }
35
+
5
36
  const PLATFORMS = {
6
37
  "darwin-arm64": "@sandbox-agent/cli-darwin-arm64",
7
38
  "darwin-x64": "@sandbox-agent/cli-darwin-x64",
8
39
  "linux-x64": "@sandbox-agent/cli-linux-x64",
40
+ "linux-arm64": "@sandbox-agent/cli-linux-arm64",
9
41
  "win32-x64": "@sandbox-agent/cli-win32-x64",
10
42
  };
11
43
 
@@ -19,7 +51,14 @@ if (!pkg) {
19
51
  try {
20
52
  const pkgPath = require.resolve(`${pkg}/package.json`);
21
53
  const bin = process.platform === "win32" ? "sandbox-agent.exe" : "sandbox-agent";
22
- execFileSync(path.join(path.dirname(pkgPath), "bin", bin), process.argv.slice(2), { stdio: "inherit" });
54
+ const binPath = path.join(path.dirname(pkgPath), "bin", bin);
55
+
56
+ if (!assertExecutable(binPath, fs)) {
57
+ console.error(formatHint(binPath));
58
+ process.exit(1);
59
+ }
60
+
61
+ execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
23
62
  } catch (e) {
24
63
  if (e.status !== undefined) process.exit(e.status);
25
64
  throw e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandbox-agent/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6-rc.2",
4
4
  "description": "CLI for sandbox-agent - run AI coding agents in sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -10,14 +10,18 @@
10
10
  "bin": {
11
11
  "sandbox-agent": "bin/sandbox-agent"
12
12
  },
13
+ "dependencies": {
14
+ "@sandbox-agent/cli-shared": "0.1.6-rc.2"
15
+ },
13
16
  "devDependencies": {
14
17
  "vitest": "^3.0.0"
15
18
  },
16
19
  "optionalDependencies": {
17
- "@sandbox-agent/cli-darwin-arm64": "0.1.5",
18
- "@sandbox-agent/cli-darwin-x64": "0.1.5",
19
- "@sandbox-agent/cli-linux-x64": "0.1.5",
20
- "@sandbox-agent/cli-win32-x64": "0.1.5"
20
+ "@sandbox-agent/cli-darwin-x64": "0.1.6-rc.2",
21
+ "@sandbox-agent/cli-darwin-arm64": "0.1.6-rc.2",
22
+ "@sandbox-agent/cli-linux-arm64": "0.1.6-rc.2",
23
+ "@sandbox-agent/cli-linux-x64": "0.1.6-rc.2",
24
+ "@sandbox-agent/cli-win32-x64": "0.1.6-rc.2"
21
25
  },
22
26
  "files": [
23
27
  "bin"