remote-agents 0.1.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/LICENSE +21 -0
- package/README.md +43 -0
- package/install.js +80 -0
- package/package.json +43 -0
- package/run.js +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Remote Agents contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# remote-agents
|
|
2
|
+
|
|
3
|
+
Unified, [MCP](https://modelcontextprotocol.io)-compatible control plane for
|
|
4
|
+
fleets of remote machines, driven by AI agents (Claude, opencode).
|
|
5
|
+
|
|
6
|
+
This npm package is a thin launcher: on install it downloads the prebuilt
|
|
7
|
+
`remote-agent` binary for your platform from the matching GitHub release.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g remote-agents
|
|
13
|
+
# or run without installing:
|
|
14
|
+
npx remote-agents --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Supported platforms: linux x64, macOS x64/arm64, windows x64.
|
|
18
|
+
|
|
19
|
+
## Use as an MCP server
|
|
20
|
+
|
|
21
|
+
```jsonc
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"remote-agents": {
|
|
25
|
+
"command": "remote-agents",
|
|
26
|
+
"args": ["mcp"],
|
|
27
|
+
"env": {
|
|
28
|
+
"REMOTE_AGENTS_RELAY": "wss://<your-relay-host>",
|
|
29
|
+
"REMOTE_AGENTS_ROOM": "myroom",
|
|
30
|
+
"REMOTE_AGENTS_TOKEN": "<secret>"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`remote-agents <subcommand>` forwards to the native binary (`run`, `mcp`,
|
|
38
|
+
`install`, …). See the [project README](https://github.com/ObsidianMotorman/tunshell_mcp_agents#readme)
|
|
39
|
+
for the full documentation.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/install.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// postinstall: download the prebuilt `remote-agent` binary matching this
|
|
2
|
+
// platform from the matching GitHub release (tag v<package version>) and place
|
|
3
|
+
// it in ./bin. No external dependencies; follows GitHub's redirect to the CDN.
|
|
4
|
+
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const https = require("https");
|
|
8
|
+
const { version } = require("./package.json");
|
|
9
|
+
|
|
10
|
+
const REPO = "ObsidianMotorman/tunshell_mcp_agents";
|
|
11
|
+
|
|
12
|
+
function target() {
|
|
13
|
+
const p = process.platform;
|
|
14
|
+
const a = process.arch;
|
|
15
|
+
if (p === "linux" && a === "x64") return { triple: "x86_64-unknown-linux-musl", exe: "" };
|
|
16
|
+
if (p === "darwin" && a === "x64") return { triple: "x86_64-apple-darwin", exe: "" };
|
|
17
|
+
if (p === "darwin" && a === "arm64") return { triple: "aarch64-apple-darwin", exe: "" };
|
|
18
|
+
if (p === "win32" && a === "x64") return { triple: "x86_64-pc-windows-msvc", exe: ".exe" };
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function download(url, dest, redirects = 0) {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
if (redirects > 10) return reject(new Error("too many redirects"));
|
|
25
|
+
https
|
|
26
|
+
.get(url, { headers: { "User-Agent": "remote-agents-installer" } }, (res) => {
|
|
27
|
+
if ([301, 302, 303, 307, 308].includes(res.statusCode)) {
|
|
28
|
+
res.resume();
|
|
29
|
+
return resolve(download(res.headers.location, dest, redirects + 1));
|
|
30
|
+
}
|
|
31
|
+
if (res.statusCode !== 200) {
|
|
32
|
+
res.resume();
|
|
33
|
+
return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
|
|
34
|
+
}
|
|
35
|
+
const file = fs.createWriteStream(dest);
|
|
36
|
+
res.pipe(file);
|
|
37
|
+
file.on("finish", () => file.close(() => resolve()));
|
|
38
|
+
file.on("error", reject);
|
|
39
|
+
})
|
|
40
|
+
.on("error", reject);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function main() {
|
|
45
|
+
// Escape hatch for CI / source installs where no matching release exists.
|
|
46
|
+
if (process.env.REMOTE_AGENTS_SKIP_DOWNLOAD) {
|
|
47
|
+
console.log("remote-agents: REMOTE_AGENTS_SKIP_DOWNLOAD set, skipping binary download");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const t = target();
|
|
52
|
+
if (!t) {
|
|
53
|
+
console.error(
|
|
54
|
+
`remote-agents: no prebuilt binary for ${process.platform}/${process.arch}.\n` +
|
|
55
|
+
` Supported: linux x64, macOS x64/arm64, windows x64.\n` +
|
|
56
|
+
` Build from source: https://github.com/${REPO}`
|
|
57
|
+
);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const asset = `remote-agent-${t.triple}${t.exe}`;
|
|
62
|
+
const url = `https://github.com/${REPO}/releases/download/v${version}/${asset}`;
|
|
63
|
+
const binDir = path.join(__dirname, "bin");
|
|
64
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
65
|
+
const dest = path.join(binDir, `remote-agent${t.exe}`);
|
|
66
|
+
|
|
67
|
+
console.log(`remote-agents: downloading ${asset} (v${version})…`);
|
|
68
|
+
try {
|
|
69
|
+
await download(url, dest);
|
|
70
|
+
if (!t.exe) fs.chmodSync(dest, 0o755);
|
|
71
|
+
console.log(`remote-agents: installed ${dest}`);
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error(`remote-agents: failed to download binary: ${e.message}`);
|
|
74
|
+
console.error(` URL: ${url}`);
|
|
75
|
+
console.error(` Ensure a release tagged v${version} exists with that asset.`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "remote-agents",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unified MCP server for controlling fleets of remote machines through AI agents (Claude, opencode)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"remote",
|
|
9
|
+
"agent",
|
|
10
|
+
"fleet",
|
|
11
|
+
"ssh",
|
|
12
|
+
"devops"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/ObsidianMotorman/tunshell_mcp_agents#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/ObsidianMotorman/tunshell_mcp_agents.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "47-ron",
|
|
21
|
+
"bin": {
|
|
22
|
+
"remote-agents": "run.js"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"postinstall": "node install.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"run.js",
|
|
29
|
+
"install.js"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
},
|
|
34
|
+
"os": [
|
|
35
|
+
"linux",
|
|
36
|
+
"darwin",
|
|
37
|
+
"win32"
|
|
38
|
+
],
|
|
39
|
+
"cpu": [
|
|
40
|
+
"x64",
|
|
41
|
+
"arm64"
|
|
42
|
+
]
|
|
43
|
+
}
|
package/run.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher: exec the downloaded native `remote-agent` binary, forwarding args,
|
|
3
|
+
// stdin/stdout/stderr, and exit code. `remote-agents <cmd>` == `remote-agent <cmd>`.
|
|
4
|
+
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const { spawnSync } = require("child_process");
|
|
8
|
+
|
|
9
|
+
const exe = process.platform === "win32" ? ".exe" : "";
|
|
10
|
+
const bin = path.join(__dirname, "bin", `remote-agent${exe}`);
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(bin)) {
|
|
13
|
+
console.error(
|
|
14
|
+
"remote-agents: native binary not found.\n" +
|
|
15
|
+
" Reinstall it with: npm install -g remote-agents (re-runs the download)."
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
21
|
+
if (result.error) {
|
|
22
|
+
console.error(`remote-agents: failed to launch binary: ${result.error.message}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
process.exit(result.status === null ? 1 : result.status);
|