opencode-supertask 0.1.7 → 0.1.8

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.
@@ -27289,6 +27289,23 @@ function findBunPath() {
27289
27289
  return process.execPath;
27290
27290
  }
27291
27291
  }
27292
+ function pm2StartGateway(version3) {
27293
+ const bunPath = findBunPath();
27294
+ return pm2Exec([
27295
+ "start",
27296
+ bunPath,
27297
+ "--name",
27298
+ PROCESS_NAME,
27299
+ "--interpreter",
27300
+ "none",
27301
+ "--restart-delay",
27302
+ "5000",
27303
+ "--max-restarts",
27304
+ "30",
27305
+ "--",
27306
+ GATEWAY_ENTRY
27307
+ ]);
27308
+ }
27292
27309
  function ensureGateway() {
27293
27310
  const currentVersion = getPackageVersion();
27294
27311
  try {
@@ -27301,25 +27318,8 @@ function ensureGateway() {
27301
27318
  return;
27302
27319
  }
27303
27320
  console.log(`[supertask] Version changed: ${envVersion ?? "unknown"} \u2192 ${currentVersion}, reloading Gateway...`);
27304
- const bunPath = findBunPath();
27305
- pm2Exec([
27306
- "delete",
27307
- PROCESS_NAME
27308
- ]);
27309
- pm2Exec([
27310
- "start",
27311
- GATEWAY_ENTRY,
27312
- "--name",
27313
- PROCESS_NAME,
27314
- "--interpreter",
27315
- bunPath,
27316
- "--restart-delay",
27317
- "5000",
27318
- "--max-restarts",
27319
- "30",
27320
- "--env",
27321
- `SUPERTASK_VERSION=${currentVersion}`
27322
- ]);
27321
+ pm2Exec(["delete", PROCESS_NAME]);
27322
+ pm2StartGateway(currentVersion);
27323
27323
  pm2Exec(["save"]);
27324
27324
  return;
27325
27325
  }
@@ -27343,22 +27343,8 @@ function ensureGateway() {
27343
27343
  if (existing) {
27344
27344
  pm2Exec(["restart", PROCESS_NAME]);
27345
27345
  } else {
27346
- const bunPath = findBunPath();
27347
27346
  const version3 = getPackageVersion();
27348
- pm2Exec([
27349
- "start",
27350
- GATEWAY_ENTRY,
27351
- "--name",
27352
- PROCESS_NAME,
27353
- "--interpreter",
27354
- bunPath,
27355
- "--restart-delay",
27356
- "5000",
27357
- "--max-restarts",
27358
- "30",
27359
- "--env",
27360
- `SUPERTASK_VERSION=${version3}`
27361
- ]);
27347
+ pm2StartGateway(version3);
27362
27348
  }
27363
27349
  pm2Exec(["save"]);
27364
27350
  }