claude-use 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.cjs +49 -16
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -221857,7 +221857,7 @@ var categories_default_default = {
221857
221857
  // package.json
221858
221858
  var package_default = {
221859
221859
  name: "claude-use",
221860
- version: "0.2.1",
221860
+ version: "0.2.3",
221861
221861
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
221862
221862
  license: "Apache-2.0",
221863
221863
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -238709,14 +238709,33 @@ function listVersionsDir(dir) {
238709
238709
  };
238710
238710
  });
238711
238711
  }
238712
- function findExecutableInDir(dir, name) {
238712
+ var WINDOWS_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PS1";
238713
+ function windowsPathExtensions(pathext) {
238714
+ return (pathext ?? WINDOWS_DEFAULT_PATHEXT).split(";").map((ext) => ext.trim()).filter((ext) => ext.length > 0);
238715
+ }
238716
+ function resolveExecutableCandidate(dir, name, env) {
238713
238717
  const candidate = import_node_path12.default.join(dir, name);
238714
- try {
238715
- const stat = import_node_fs3.default.statSync(candidate);
238716
- if (stat.isFile() && (stat.mode & 73) !== 0) {
238717
- return candidate;
238718
+ if (env.platform === "win32") {
238719
+ const extensions = windowsPathExtensions(env.pathext);
238720
+ const alreadyHasRecognisedExtension = extensions.some((ext) => candidate.toLowerCase().endsWith(ext.toLowerCase()));
238721
+ if (alreadyHasRecognisedExtension) {
238722
+ return env.statFileMode(candidate) !== void 0 ? candidate : void 0;
238723
+ }
238724
+ for (const ext of extensions) {
238725
+ const withExt = candidate + ext;
238726
+ if (env.statFileMode(withExt) !== void 0) {
238727
+ return withExt;
238728
+ }
238718
238729
  }
238719
238730
  return void 0;
238731
+ }
238732
+ const mode = env.statFileMode(candidate);
238733
+ return mode !== void 0 && (mode & 73) !== 0 ? candidate : void 0;
238734
+ }
238735
+ function realStatFileMode(candidate) {
238736
+ try {
238737
+ const stat = import_node_fs3.default.statSync(candidate);
238738
+ return stat.isFile() ? stat.mode : void 0;
238720
238739
  } catch (error51) {
238721
238740
  if (isEnoent2(error51)) {
238722
238741
  return void 0;
@@ -238724,20 +238743,34 @@ function findExecutableInDir(dir, name) {
238724
238743
  throw error51;
238725
238744
  }
238726
238745
  }
238727
- function resolveOwnExecutablePath(env) {
238728
- if (env.argv1 === void 0) {
238729
- return env.execPath;
238730
- }
238731
- if (env.argv1.includes("/") || env.argv1.includes("\\")) {
238732
- return import_node_path12.default.resolve(env.cwd, env.argv1);
238733
- }
238734
- for (const dir of env.pathDirs) {
238735
- const found = env.findExecutableInDir(dir, env.argv1);
238746
+ function findExecutableInDir(dir, name) {
238747
+ return resolveExecutableCandidate(dir, name, {
238748
+ platform: process.platform,
238749
+ pathext: process.env.PATHEXT,
238750
+ statFileMode: realStatFileMode
238751
+ });
238752
+ }
238753
+ function searchPathForExecutable(pathDirs, name, findExecutableInDir2) {
238754
+ for (const dir of pathDirs) {
238755
+ const found = findExecutableInDir2(dir, name);
238736
238756
  if (found !== void 0) {
238737
238757
  return found;
238738
238758
  }
238739
238759
  }
238740
- return env.execPath;
238760
+ return void 0;
238761
+ }
238762
+ function resolveOwnExecutablePath(env) {
238763
+ if (env.argv1 !== void 0 && !env.argv1.includes("/") && !env.argv1.includes("\\")) {
238764
+ return searchPathForExecutable(env.pathDirs, env.argv1, env.findExecutableInDir) ?? env.execPath;
238765
+ }
238766
+ const candidate = env.argv1 === void 0 ? env.execPath : import_node_path12.default.resolve(env.cwd, env.argv1);
238767
+ const candidateDir = import_node_path12.default.dirname(candidate);
238768
+ const candidateDirOnPath = env.pathDirs.some((dir) => import_node_path12.default.resolve(dir) === candidateDir);
238769
+ if (candidateDirOnPath) {
238770
+ return candidate;
238771
+ }
238772
+ const viaPath = searchPathForExecutable(env.pathDirs, import_node_path12.default.basename(candidate), env.findExecutableInDir);
238773
+ return viaPath ?? candidate;
238741
238774
  }
238742
238775
  function realOwnExecutablePath() {
238743
238776
  return resolveOwnExecutablePath({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",