@proagentstore/cli 0.1.23 → 0.1.24
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.js +21 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1258,6 +1258,25 @@ async function waitForKey(keys) {
|
|
|
1258
1258
|
// src/commands/up.ts
|
|
1259
1259
|
var API_BASE2 = "https://api.proagentstore.online";
|
|
1260
1260
|
var CLI_VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
1261
|
+
async function stopRunnerProcesses() {
|
|
1262
|
+
if (process.platform === "win32") return false;
|
|
1263
|
+
const { execSync } = await import("child_process");
|
|
1264
|
+
const patterns = [
|
|
1265
|
+
"dist/browser-runner/index.js",
|
|
1266
|
+
"browser-runner/src/index",
|
|
1267
|
+
"runner connect",
|
|
1268
|
+
"tunnel --url http://127.0.0.1"
|
|
1269
|
+
];
|
|
1270
|
+
let stopped = false;
|
|
1271
|
+
for (const p of patterns) {
|
|
1272
|
+
try {
|
|
1273
|
+
execSync(`pkill -f ${JSON.stringify(p)}`, { stdio: "ignore" });
|
|
1274
|
+
stopped = true;
|
|
1275
|
+
} catch {
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
return stopped;
|
|
1279
|
+
}
|
|
1261
1280
|
var upCommand = new Command7("up").description("Start the browser runner for all your agent instances").option("--headless", "Run browser in headless mode").option("--instance <id>", "Connect to a specific instance only").action(async (opts) => {
|
|
1262
1281
|
const session = requireSession();
|
|
1263
1282
|
const state = {
|
|
@@ -1301,6 +1320,7 @@ var upCommand = new Command7("up").description("Start the browser runner for all
|
|
|
1301
1320
|
const target = instances[0];
|
|
1302
1321
|
state.activeInstance = target.name || target.slug || target.id.slice(0, 8);
|
|
1303
1322
|
printStep(`Connecting: ${state.activeInstance}`, "wait");
|
|
1323
|
+
await stopRunnerProcesses();
|
|
1304
1324
|
const { spawn: spawn3 } = await import("child_process");
|
|
1305
1325
|
const cliPath = process.argv[1];
|
|
1306
1326
|
const args = [cliPath, "runner", "connect", target.id];
|
|
@@ -1419,21 +1439,7 @@ var downCommand = new Command7("down").description("Stop the browser runner and
|
|
|
1419
1439
|
writeLine("");
|
|
1420
1440
|
return;
|
|
1421
1441
|
}
|
|
1422
|
-
const
|
|
1423
|
-
const patterns = [
|
|
1424
|
-
"dist/browser-runner/index.js",
|
|
1425
|
-
"browser-runner/src/index",
|
|
1426
|
-
"runner connect",
|
|
1427
|
-
"tunnel --url http://127.0.0.1"
|
|
1428
|
-
];
|
|
1429
|
-
let stopped = false;
|
|
1430
|
-
for (const p of patterns) {
|
|
1431
|
-
try {
|
|
1432
|
-
execSync(`pkill -f ${JSON.stringify(p)}`, { stdio: "ignore" });
|
|
1433
|
-
stopped = true;
|
|
1434
|
-
} catch {
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1442
|
+
const stopped = await stopRunnerProcesses();
|
|
1437
1443
|
if (stopped) {
|
|
1438
1444
|
writeLine(" \u2713 Runner stopped \u2014 you're disconnected.");
|
|
1439
1445
|
writeLine("");
|