@melaya/runner 1.0.0 → 1.0.1
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/cli.js +1 -1
- package/dist/connection.js +7 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -60,7 +60,7 @@ async function findPython() {
|
|
|
60
60
|
const { execSync } = await import("child_process");
|
|
61
61
|
for (const cmd of ["python3", "python"]) {
|
|
62
62
|
try {
|
|
63
|
-
const version = execSync(`${cmd} --version`, { encoding: "utf-8", timeout: 5000 }).trim();
|
|
63
|
+
const version = execSync(`${cmd} --version`, { encoding: "utf-8", timeout: 5000, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
64
64
|
if (version.includes("Python 3."))
|
|
65
65
|
return cmd;
|
|
66
66
|
}
|
package/dist/connection.js
CHANGED
|
@@ -23,10 +23,14 @@ const HEARTBEAT_INTERVAL = 30_000;
|
|
|
23
23
|
const activeProcesses = new Map();
|
|
24
24
|
export async function connect(opts) {
|
|
25
25
|
const spinner = ora("Connecting to Melaya...").start();
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// Connect to the /api/v1/runner NAMESPACE on the existing Socket.IO server.
|
|
27
|
+
// The `path` must match the server's Socket.IO HTTP path (/api/v1/events).
|
|
28
|
+
// The namespace is specified in the URL suffix, not the path option.
|
|
29
|
+
const nsUrl = opts.serverUrl.replace(/\/$/, "") + "/api/v1/runner";
|
|
30
|
+
const socket = io(nsUrl, {
|
|
31
|
+
path: "/api/v1/events",
|
|
28
32
|
auth: { token: opts.token },
|
|
29
|
-
transports: ["websocket"],
|
|
33
|
+
transports: ["websocket", "polling"],
|
|
30
34
|
reconnection: true,
|
|
31
35
|
reconnectionDelay: 2000,
|
|
32
36
|
reconnectionAttempts: Infinity,
|