opencode-supertask 0.1.29 → 0.1.31

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/index.js CHANGED
@@ -20749,6 +20749,7 @@ __export(pm2_exports, {
20749
20749
  isMacLaunchAgentConfigured: () => isMacLaunchAgentConfigured,
20750
20750
  isPm2Installed: () => isPm2Installed,
20751
20751
  resolveGatewayEntry: () => resolveGatewayEntry,
20752
+ resolvePm2SupervisorEntry: () => resolvePm2SupervisorEntry,
20752
20753
  restartGatewayAfterMaintenance: () => restartGatewayAfterMaintenance,
20753
20754
  stopGatewayForMaintenance: () => stopGatewayForMaintenance,
20754
20755
  uninstall: () => uninstall,
@@ -20906,15 +20907,17 @@ function launchAgentPath() {
20906
20907
  function launchctlBin() {
20907
20908
  return process.env.SUPERTASK_LAUNCHCTL_BIN ?? "launchctl";
20908
20909
  }
20909
- function resolvePm2SupervisorEntry() {
20910
+ function resolvePm2SupervisorEntry(baseDir = __dirname) {
20910
20911
  const override = process.env.SUPERTASK_PM2_SUPERVISOR_ENTRY;
20911
20912
  if (override) {
20912
20913
  if (!existsSync5(override)) throw new Error(`[supertask] PM2 supervisor entry not found: ${override}`);
20913
20914
  return resolve3(override);
20914
20915
  }
20915
20916
  const candidates = [
20916
- join4(__dirname, "pm2-supervisor.js"),
20917
- join4(__dirname, "pm2-supervisor.ts")
20917
+ join4(baseDir, "pm2-supervisor.js"),
20918
+ join4(baseDir, "pm2-supervisor.ts"),
20919
+ join4(baseDir, "../daemon/pm2-supervisor.js"),
20920
+ join4(baseDir, "../daemon/pm2-supervisor.ts")
20918
20921
  ];
20919
20922
  const entry = candidates.find((candidate) => existsSync5(candidate));
20920
20923
  if (!entry) throw new Error(`[supertask] PM2 supervisor entry not found. Checked: ${candidates.join(", ")}`);
@@ -21229,7 +21232,7 @@ function pm2JsonList(env = process.env) {
21229
21232
  function gatewayEntryFromProcess(processInfo) {
21230
21233
  const args = processInfo?.pm2_env?.args ?? processInfo?.args;
21231
21234
  const candidates = Array.isArray(args) ? [...args].reverse() : typeof args === "string" ? [args] : [];
21232
- const savedCwd = processInfo?.pm2_env?.pm_cwd;
21235
+ const savedCwd = processInfo?.pm2_env?.pm_cwd ?? processInfo?.pm_cwd;
21233
21236
  for (const candidate of candidates) {
21234
21237
  const path = typeof savedCwd === "string" ? runtimePath(candidate, savedCwd) : candidate;
21235
21238
  if (existsSync5(path)) return resolve3(path);
@@ -21249,7 +21252,7 @@ function gatewayRuntimeFromProcess(processInfo) {
21249
21252
  const gatewayEntry = gatewayEntryFromProcess(processInfo);
21250
21253
  if (!gatewayEntry) return null;
21251
21254
  const savedBunPath = processInfo?.pm2_env?.pm_exec_path ?? processInfo?.pm_exec_path;
21252
- const savedCwd = processInfo?.pm2_env?.pm_cwd;
21255
+ const savedCwd = processInfo?.pm2_env?.pm_cwd ?? processInfo?.pm_cwd;
21253
21256
  const savedEnv = gatewayEnvironmentFromProcess(processInfo);
21254
21257
  if (typeof savedBunPath !== "string" || typeof savedCwd !== "string") return null;
21255
21258
  try {