claude-use 0.2.0 → 0.2.2

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 +39 -5
  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.0",
221860
+ version: "0.2.2",
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>",
@@ -238724,6 +238724,40 @@ function findExecutableInDir(dir, name) {
238724
238724
  throw error51;
238725
238725
  }
238726
238726
  }
238727
+ function searchPathForExecutable(pathDirs, name, findExecutableInDir2) {
238728
+ for (const dir of pathDirs) {
238729
+ const found = findExecutableInDir2(dir, name);
238730
+ if (found !== void 0) {
238731
+ return found;
238732
+ }
238733
+ }
238734
+ return void 0;
238735
+ }
238736
+ function resolveOwnExecutablePath(env) {
238737
+ if (env.argv1 === void 0) {
238738
+ return env.execPath;
238739
+ }
238740
+ if (!env.argv1.includes("/") && !env.argv1.includes("\\")) {
238741
+ return searchPathForExecutable(env.pathDirs, env.argv1, env.findExecutableInDir) ?? env.execPath;
238742
+ }
238743
+ const directCandidate = import_node_path12.default.resolve(env.cwd, env.argv1);
238744
+ const directDir = import_node_path12.default.dirname(directCandidate);
238745
+ const directDirOnPath = env.pathDirs.some((dir) => import_node_path12.default.resolve(dir) === directDir);
238746
+ if (directDirOnPath) {
238747
+ return directCandidate;
238748
+ }
238749
+ const viaPath = searchPathForExecutable(env.pathDirs, import_node_path12.default.basename(directCandidate), env.findExecutableInDir);
238750
+ return viaPath ?? directCandidate;
238751
+ }
238752
+ function realOwnExecutablePath() {
238753
+ return resolveOwnExecutablePath({
238754
+ argv1: process.argv[1],
238755
+ execPath: process.execPath,
238756
+ cwd: process.cwd(),
238757
+ pathDirs: (process.env.PATH ?? "").split(import_node_path12.default.delimiter).filter((dir) => dir !== ""),
238758
+ findExecutableInDir
238759
+ });
238760
+ }
238727
238761
  function realResolveClaudeBinary(ownInstallDirs) {
238728
238762
  return () => discoverClaudeBinary({
238729
238763
  listVersionsDir,
@@ -240992,7 +241026,7 @@ function registerShimCommand(program2, paths) {
240992
241026
  "Manage the `claude` command shim \u2014 an optional, explicit way to also invoke this launcher as `claude` instead of `claude-use run`. Off by default; every installer ships only `claude-use`."
240993
241027
  );
240994
241028
  shim.command("enable").description("Create a `claude`-named copy of this same executable, alongside claude-use by default.").option("--dir <path>", "Enable into this directory instead of alongside the running claude-use executable.").option("--force", "Overwrite the target even if it doesn't look like claude-use's own doing.").action((options) => {
240995
- const ownExecutablePath = process.argv[1] ?? process.execPath;
241029
+ const ownExecutablePath = realOwnExecutablePath();
240996
241030
  const result = enableClaudeShim({
240997
241031
  paths,
240998
241032
  ownExecutablePath,
@@ -241016,7 +241050,7 @@ function registerShimCommand(program2, paths) {
241016
241050
  }
241017
241051
  });
241018
241052
  shim.command("disable").description("Remove the `claude` command shim `shim enable` previously created. A no-op, not an error, if none is enabled.").option("--dir <path>", "Look in this directory instead of trusting the recorded location.").option("--force", "Remove the target even if it doesn't look like claude-use's own doing.").action((options) => {
241019
- const ownExecutablePath = process.argv[1] ?? process.execPath;
241053
+ const ownExecutablePath = realOwnExecutablePath();
241020
241054
  const result = disableClaudeShim({
241021
241055
  paths,
241022
241056
  ownExecutablePath,
@@ -241263,7 +241297,7 @@ function registerDoctorCommand(program2, paths) {
241263
241297
  const profilePath = import_node_path18.default.join(paths.configProfilesDir, `${name}.json`);
241264
241298
  return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
241265
241299
  });
241266
- const ownExecutablePath = process.argv[1] ?? process.execPath;
241300
+ const ownExecutablePath = realOwnExecutablePath();
241267
241301
  let binaryDiscovery;
241268
241302
  try {
241269
241303
  const binary = realResolveClaudeBinary(resolveOwnInstallDirs(paths, ownExecutablePath))();
@@ -241688,7 +241722,7 @@ function runClaude(argvOverride) {
241688
241722
  spawn: realSpawnPort,
241689
241723
  proc: argvOverride === void 0 ? realProcPort : { ...realProcPort, argv: argvOverride },
241690
241724
  log: realLogPort,
241691
- resolveClaudeBinary: realResolveClaudeBinary(resolveOwnInstallDirs(paths, process.argv[1] ?? process.execPath)),
241725
+ resolveClaudeBinary: realResolveClaudeBinary(resolveOwnInstallDirs(paths, realOwnExecutablePath())),
241692
241726
  farm: farm.runtime,
241693
241727
  ...farm.directoryIdentity === void 0 ? {} : { directoryPinnedIdentity: farm.directoryIdentity },
241694
241728
  ...farm.directoryConfigProfile === void 0 ? {} : { directoryRuleConfigProfile: farm.directoryConfigProfile },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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>",