@gjermundgaraba/clankerbox-rivet-sandbox-agent 0.20.1 → 0.22.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/index.d.mts +1 -3
- package/dist/index.mjs +2 -2
- package/package.json +4 -4
- package/recipes/macos/setup.sh +4 -4
- package/recipes/ubuntu/setup.sh +23 -29
package/dist/index.d.mts
CHANGED
|
@@ -20,8 +20,6 @@ interface Options {
|
|
|
20
20
|
readonly fresh?: boolean | undefined;
|
|
21
21
|
/** `sandbox` by default. */
|
|
22
22
|
readonly namePrefix?: string | undefined;
|
|
23
|
-
/** The machine's own login user by default. */
|
|
24
|
-
readonly sshUser?: string | undefined;
|
|
25
23
|
/**
|
|
26
24
|
* The path of a public-key file, such as your `id_ed25519.pub`, whose keys the host installs for
|
|
27
25
|
* the login user after a profile's setup, as the client config's `authorizedKeys` does: the key
|
|
@@ -34,7 +32,7 @@ interface Options {
|
|
|
34
32
|
* `-S`): the tunnel ends with its ssh, and those would outlive it.
|
|
35
33
|
*/
|
|
36
34
|
readonly sshArguments?: ReadonlyArray<string> | undefined;
|
|
37
|
-
/** `/home/
|
|
35
|
+
/** `/home/admin` by default, the login user's home, where the Ubuntu recipe runs the server. */
|
|
38
36
|
readonly cwd?: string | undefined;
|
|
39
37
|
}
|
|
40
38
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -166,7 +166,7 @@ const make = (options, ssh = "ssh") => {
|
|
|
166
166
|
known.held = {
|
|
167
167
|
tunnel: yield* Effect.gen(function* () {
|
|
168
168
|
const directory = yield* (yield* FileSystem.FileSystem).makeTempDirectoryScoped({ prefix: "clankerbox-tunnel-" });
|
|
169
|
-
const args = yield* pinnedSsh(target,
|
|
169
|
+
const args = yield* pinnedSsh(target, target.login.user, forwarding(port, options.sshArguments ?? []));
|
|
170
170
|
return yield* open({
|
|
171
171
|
program: ssh,
|
|
172
172
|
args,
|
|
@@ -244,7 +244,7 @@ const provider = (options, layer, ssh) => {
|
|
|
244
244
|
const sandboxes = make(options, ssh);
|
|
245
245
|
return {
|
|
246
246
|
name,
|
|
247
|
-
defaultCwd: options.cwd ?? "/home/
|
|
247
|
+
defaultCwd: options.cwd ?? "/home/admin",
|
|
248
248
|
create: () => runtime.runPromise(sandboxes.create),
|
|
249
249
|
destroy: (id) => runtime.runPromise(sandboxes.destroy(id)),
|
|
250
250
|
pause: (id) => runtime.runPromise(sandboxes.pause(id)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjermundgaraba/clankerbox-rivet-sandbox-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "clankerbox machines as sandboxes for Rivet's Sandbox Agent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@gjermundgaraba/clankerbox-sdk": "0.
|
|
28
|
+
"@gjermundgaraba/clankerbox-sdk": "0.22.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@effect/platform-node": "4.0.5",
|
|
32
32
|
"@gjermundgaraba/effect-actions": "0.18.2",
|
|
33
33
|
"@types/node": "26.6.5",
|
|
34
34
|
"effect": "4.0.5",
|
|
35
|
-
"sandbox-agent": "0.5.
|
|
35
|
+
"sandbox-agent": "0.5.3",
|
|
36
36
|
"typescript": "7.0.2",
|
|
37
37
|
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
38
38
|
"vite-plus": "1.3.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@effect/platform-node": "~4.0.4",
|
|
42
42
|
"@gjermundgaraba/effect-actions": "^0.18.0",
|
|
43
43
|
"effect": "~4.0.4",
|
|
44
|
-
"sandbox-agent": "~0.5.
|
|
44
|
+
"sandbox-agent": "~0.5.3"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "vp pack",
|
package/recipes/macos/setup.sh
CHANGED
|
@@ -13,10 +13,10 @@ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
|
|
13
13
|
|
|
14
14
|
# The pins, each an arm64 macOS download with its sha256. The bump-sandbox-agent skill says
|
|
15
15
|
# where each comes from.
|
|
16
|
-
agent_version=0.5.
|
|
17
|
-
agent_sha256=
|
|
18
|
-
node_version=22.23.
|
|
19
|
-
node_sha256=
|
|
16
|
+
agent_version=0.5.3
|
|
17
|
+
agent_sha256=b4bf7244a67bd74ed91bef68051717503d3b4db6aad8f76c1ba71fccb9712b48
|
|
18
|
+
node_version=22.23.4
|
|
19
|
+
node_sha256=c9e1dbc748b33ed2d14f42445191ecaf14c56259c7a9a26d0042c49ec2b66428
|
|
20
20
|
|
|
21
21
|
# Softnet blocks the gateway's DNS, so public resolvers come first.
|
|
22
22
|
networksetup -listallnetworkservices | tail -n +2 | sed 's/^\*//' | while IFS= read -r service; do
|
package/recipes/ubuntu/setup.sh
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# A clankerbox setup that makes an x86_64 Ubuntu machine a sandbox for Rivet's Sandbox Agent:
|
|
3
|
-
# the login user `
|
|
4
|
-
# with root's login off
|
|
5
|
-
#
|
|
6
|
-
# loopback, port 2468.
|
|
3
|
+
# the login user `admin` with passwordless sudo, for whom the host then installs your keys, sshd
|
|
4
|
+
# with root's login off, the Sandbox Agent's server and Claude Code under `admin`, and an
|
|
5
|
+
# /etc/clankerbox/start that keeps the server running on the guest's loopback, port 2468.
|
|
7
6
|
#
|
|
8
7
|
# Name this directory, or a copy, as a profile's `setup.path`. An optional `agent.env` beside
|
|
9
8
|
# it, of `NAME=value` lines such as `ANTHROPIC_API_KEY=…`, becomes the server's environment,
|
|
@@ -14,33 +13,28 @@ export DEBIAN_FRONTEND=noninteractive
|
|
|
14
13
|
|
|
15
14
|
# The pins, each an x86_64 Linux download with its sha256. The bump-sandbox-agent skill says
|
|
16
15
|
# where each comes from.
|
|
17
|
-
agent_version=0.5.
|
|
18
|
-
agent_sha256=
|
|
16
|
+
agent_version=0.5.3
|
|
17
|
+
agent_sha256=48b8bcdabf7d22e276593651a64c72e84e41fd8ef743b524721e949f9c330b90
|
|
19
18
|
# The agents' adapters run on Node, and need a newer one than Ubuntu 24.04 packages.
|
|
20
|
-
node_version=22.23.
|
|
21
|
-
node_sha256=
|
|
22
|
-
|
|
23
|
-
# A base with its own sshd, such as boat's, keeps it as it is.
|
|
24
|
-
if [ -x /usr/sbin/sshd ]; then own_sshd=false; else own_sshd=true; fi
|
|
19
|
+
node_version=22.23.4
|
|
20
|
+
node_sha256=1805bcd35e6815559bd2eb97db438d3fdb0eb3a5e6a977b7c1badca76337e9ce
|
|
25
21
|
|
|
26
22
|
apt-get update -qq
|
|
27
23
|
apt-get install -y -qq --no-install-recommends \
|
|
28
24
|
openssh-server sudo curl ca-certificates xz-utils procps >/dev/null
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
echo "PermitRootLogin no" >/etc/ssh/sshd_config.d/10-clankerbox.conf
|
|
33
|
-
fi
|
|
26
|
+
install -d /etc/ssh/sshd_config.d
|
|
27
|
+
echo "PermitRootLogin no" >/etc/ssh/sshd_config.d/10-clankerbox.conf
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
useradd -m -s /bin/bash
|
|
29
|
+
if ! id admin >/dev/null 2>&1; then
|
|
30
|
+
groupadd -f admin
|
|
31
|
+
useradd -m -s /bin/bash -g admin admin
|
|
38
32
|
fi
|
|
39
33
|
|
|
40
|
-
echo "
|
|
41
|
-
visudo -cf /var/tmp/sudoers-
|
|
42
|
-
install -m 440 /var/tmp/sudoers-
|
|
43
|
-
rm /var/tmp/sudoers-
|
|
34
|
+
echo "admin ALL=(ALL) NOPASSWD: ALL" >/var/tmp/sudoers-admin
|
|
35
|
+
visudo -cf /var/tmp/sudoers-admin >/dev/null
|
|
36
|
+
install -m 440 /var/tmp/sudoers-admin /etc/sudoers.d/admin
|
|
37
|
+
rm /var/tmp/sudoers-admin
|
|
44
38
|
|
|
45
39
|
# Downloads $1 to $3 and refuses it unless its sha256 is $2.
|
|
46
40
|
fetch() {
|
|
@@ -58,16 +52,16 @@ fetch "https://nodejs.org/dist/v$node_version/node-v$node_version-linux-x64.tar.
|
|
|
58
52
|
tar -xJf /var/tmp/node.tar.xz -C /usr/local --strip-components=1 --no-same-owner
|
|
59
53
|
rm /var/tmp/node.tar.xz
|
|
60
54
|
|
|
61
|
-
# The agents run as `
|
|
55
|
+
# The agents run as `admin`: as root, Claude Code offers no bypass-permissions mode.
|
|
62
56
|
if [ -s agent.env ]; then
|
|
63
|
-
install -m 600 -o
|
|
57
|
+
install -m 600 -o admin -g "$(id -gn admin)" agent.env /etc/sandbox-agent.env
|
|
64
58
|
fi
|
|
65
59
|
|
|
66
60
|
# Claude Code at its latest release, and its adapter at the version the server pins. Other
|
|
67
61
|
# agents install the same way; `install-agent codex` hangs in its own check at this version, so
|
|
68
62
|
# give it a timeout too, and end what it leaves running. Claude's install takes about 30 s; 300 s
|
|
69
63
|
# leaves room for a slow mirror.
|
|
70
|
-
timeout 300 su -
|
|
64
|
+
timeout 300 su - admin -c 'sandbox-agent install-agent claude' >/var/tmp/install-agent.log 2>&1 || {
|
|
71
65
|
tail -n 15 /var/tmp/install-agent.log
|
|
72
66
|
exit 1
|
|
73
67
|
}
|
|
@@ -103,17 +97,17 @@ answers_within() {
|
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
running() {
|
|
106
|
-
pgrep -u
|
|
100
|
+
pgrep -u admin -f 'sandbox-agent server' >/dev/null
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
# A running server gets 10 s to answer, since this runs at every start, a running machine's too,
|
|
110
104
|
# before it is ended as hung: TERM, then KILL after 5 s, as a hung one may ignore TERM.
|
|
111
105
|
if running && ! answers_within 10; then
|
|
112
|
-
pkill -u
|
|
106
|
+
pkill -u admin -f 'sandbox-agent server' || true
|
|
113
107
|
for tries in $(seq 40); do
|
|
114
108
|
running || break
|
|
115
109
|
if [ "$tries" -eq 20 ]; then
|
|
116
|
-
pkill -KILL -u
|
|
110
|
+
pkill -KILL -u admin -f 'sandbox-agent server' || true
|
|
117
111
|
fi
|
|
118
112
|
sleep 0.25
|
|
119
113
|
done
|
|
@@ -121,7 +115,7 @@ fi
|
|
|
121
115
|
|
|
122
116
|
# The server listens on loopback alone, with no token: guest port 22 is the only way to it.
|
|
123
117
|
if ! running; then
|
|
124
|
-
su -
|
|
118
|
+
su - admin -c '
|
|
125
119
|
if [ -r /etc/sandbox-agent.env ]; then set -a; . /etc/sandbox-agent.env; set +a; fi
|
|
126
120
|
setsid -f sandbox-agent server --no-token --no-telemetry >/dev/null 2>&1
|
|
127
121
|
'
|