sessionpipe 0.13.2 → 0.13.3

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/worker.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // sessionpipe 0.13.2 · Apache-2.0 · https://sessionpipe.org
2
+ // sessionpipe 0.13.3 · Apache-2.0 · https://sessionpipe.org
3
3
  var __defProp = Object.defineProperty;
4
4
  var __export = (target, all) => {
5
5
  for (var name in all)
@@ -1735,7 +1735,8 @@ __export(claude_code_control_exports, {
1735
1735
  relaunchMode: () => relaunchMode,
1736
1736
  resolveHome: () => resolveHome,
1737
1737
  runClaude: () => runClaude,
1738
- sessionFolder: () => sessionFolder
1738
+ sessionFolder: () => sessionFolder,
1739
+ versionManagerBins: () => versionManagerBins
1739
1740
  });
1740
1741
  import { execFile, execFileSync as execFileSync3 } from "node:child_process";
1741
1742
  import { closeSync as closeSync2, openSync as openSync2, readdirSync as readdirSync4, readFileSync as readFileSync5, readSync as readSync2, statSync as statSync5 } from "node:fs";
@@ -1773,6 +1774,29 @@ var cmpVersion = (a, b) => {
1773
1774
  if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
1774
1775
  return 0;
1775
1776
  };
1777
+ function versionManagerBins(env = process.env, home = os2.homedir()) {
1778
+ const out = [];
1779
+ const versions = (dir, tail) => {
1780
+ let names = [];
1781
+ try {
1782
+ names = readdirSync4(dir).filter((n) => /^v?\d+(\.\d+)*$/.test(n));
1783
+ } catch {
1784
+ return;
1785
+ }
1786
+ for (const n of names.sort((a, b) => cmpVersion(a.replace(/^v/, ""), b.replace(/^v/, ""))).reverse())
1787
+ out.push(path7.join(dir, n, ...tail));
1788
+ };
1789
+ versions(path7.join(env.NVM_DIR || path7.join(home, ".nvm"), "versions", "node"), ["bin"]);
1790
+ const fnmDirs = env.FNM_DIR ? [env.FNM_DIR] : [
1791
+ path7.join(home, "Library", "Application Support", "fnm"),
1792
+ path7.join(home, ".local", "share", "fnm"),
1793
+ path7.join(home, ".fnm")
1794
+ ];
1795
+ for (const d of fnmDirs) versions(path7.join(d, "node-versions"), ["installation", "bin"]);
1796
+ out.push(path7.join(env.VOLTA_HOME || path7.join(home, ".volta"), "bin"));
1797
+ versions(path7.join(env.ASDF_DATA_DIR || path7.join(home, ".asdf"), "installs", "nodejs"), ["bin"]);
1798
+ return out;
1799
+ }
1776
1800
  function findClaude(env = process.env, home = os2.homedir()) {
1777
1801
  if (env.SESSIONPIPE_CLAUDE && isExe(env.SESSIONPIPE_CLAUDE)) return env.SESSIONPIPE_CLAUDE;
1778
1802
  const names = process.platform === "win32" ? ["claude.exe", "claude.cmd"] : ["claude"];
@@ -1787,6 +1811,7 @@ function findClaude(env = process.env, home = os2.homedir()) {
1787
1811
  "/usr/local/bin/claude"
1788
1812
  ])
1789
1813
  if (isExe(p)) return p;
1814
+ for (const d of versionManagerBins(env, home)) if (isExe(path7.join(d, "claude"))) return path7.join(d, "claude");
1790
1815
  const app = path7.join(home, "Library", "Application Support", "Claude", "claude-code");
1791
1816
  let versions = [];
1792
1817
  try {