claude-use 14.2.1 → 14.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.
package/dist/cli.cjs CHANGED
@@ -33795,6 +33795,24 @@ function commandFilename(ownExecutablePath, commandName) {
33795
33795
  function isInvokedAsClaude(invokedName) {
33796
33796
  return invokedName === "claude" || invokedName.toLowerCase() === "claude.exe";
33797
33797
  }
33798
+ function isLauncherScript(candidate) {
33799
+ let head;
33800
+ try {
33801
+ const fd2 = import_node_fs5.default.openSync(candidate, "r");
33802
+ try {
33803
+ const buffer2 = Buffer.alloc(SCRIPT_HEAD_BYTES);
33804
+ head = buffer2.subarray(0, import_node_fs5.default.readSync(fd2, buffer2, 0, SCRIPT_HEAD_BYTES, 0)).toString("utf8");
33805
+ } finally {
33806
+ import_node_fs5.default.closeSync(fd2);
33807
+ }
33808
+ } catch (error63) {
33809
+ if (isEnoent3(error63) || typeof error63 === "object" && error63 !== null && "code" in error63 && (error63.code === "EACCES" || error63.code === "EISDIR")) {
33810
+ return false;
33811
+ }
33812
+ throw error63;
33813
+ }
33814
+ return head.startsWith("#!") && LAUNCHER_NAME.test(head) && EXEC_RUN.test(head);
33815
+ }
33798
33816
  function resolveOwnBinaryCheck(paths, contentSourcePath) {
33799
33817
  const state = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
33800
33818
  const recordedTarget = state === void 0 ? void 0 : import_node_path13.default.resolve(state.targetPath);
@@ -33805,8 +33823,9 @@ function resolveOwnBinaryCheck(paths, contentSourcePath) {
33805
33823
  }
33806
33824
  ownStat ??= statOrUndefined(contentSourcePath);
33807
33825
  const candidateStat = statOrUndefined(candidate);
33808
- return ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
33826
+ const sameFile = ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
33809
33827
  ownStat.ino !== 0 && candidateStat.ino !== 0 && candidateStat.dev === ownStat.dev && candidateStat.ino === ownStat.ino;
33828
+ return sameFile || isLauncherScript(candidate);
33810
33829
  };
33811
33830
  }
33812
33831
  function resolveClaudeTargetPath(ownExecutablePath, dir) {
@@ -33955,7 +33974,7 @@ function registerShimCommand(program2, deps) {
33955
33974
  });
33956
33975
  withExamples(disable, ["agent-shim shim disable"]);
33957
33976
  }
33958
- var import_node_fs5, import_node_path13, EXECUTABLE_FILE_MODE, ClaudeShimStateSchema, ForeignClaudeEntryError, UnsupportedShimSourceError, nodeLinkFs;
33977
+ var import_node_fs5, import_node_path13, EXECUTABLE_FILE_MODE, ClaudeShimStateSchema, ForeignClaudeEntryError, UnsupportedShimSourceError, SCRIPT_HEAD_BYTES, LAUNCHER_NAME, EXEC_RUN, nodeLinkFs;
33959
33978
  var init_claudeShim = __esm({
33960
33979
  "src/claudeShim.ts"() {
33961
33980
  "use strict";
@@ -33994,6 +34013,9 @@ var init_claudeShim = __esm({
33994
34013
  }
33995
34014
  contentSourcePath;
33996
34015
  };
34016
+ SCRIPT_HEAD_BYTES = 4096;
34017
+ LAUNCHER_NAME = /\b(agent-shim|claude-use)\b/;
34018
+ EXEC_RUN = /^\s*exec\s[^\n#]*\brun\b/m;
33997
34019
  nodeLinkFs = { link: import_node_fs5.default.linkSync, copyFile: import_node_fs5.default.copyFileSync, chmod: import_node_fs5.default.chmodSync };
33998
34020
  }
33999
34021
  });
@@ -74600,7 +74622,7 @@ var init_package = __esm({
74600
74622
  "package.json"() {
74601
74623
  package_default = {
74602
74624
  name: "claude-use",
74603
- version: "14.2.1",
74625
+ version: "14.2.2",
74604
74626
  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.",
74605
74627
  license: "MIT",
74606
74628
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.cjs CHANGED
@@ -13912,7 +13912,7 @@ var init_package = __esm({
13912
13912
  "package.json"() {
13913
13913
  package_default = {
13914
13914
  name: "claude-use",
13915
- version: "14.2.1",
13915
+ version: "14.2.2",
13916
13916
  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.",
13917
13917
  license: "MIT",
13918
13918
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -14123,6 +14123,24 @@ var init_commandDeps = __esm({
14123
14123
  function commandFilename(ownExecutablePath, commandName) {
14124
14124
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
14125
14125
  }
14126
+ function isLauncherScript(candidate) {
14127
+ let head;
14128
+ try {
14129
+ const fd = import_node_fs9.default.openSync(candidate, "r");
14130
+ try {
14131
+ const buffer = Buffer.alloc(SCRIPT_HEAD_BYTES);
14132
+ head = buffer.subarray(0, import_node_fs9.default.readSync(fd, buffer, 0, SCRIPT_HEAD_BYTES, 0)).toString("utf8");
14133
+ } finally {
14134
+ import_node_fs9.default.closeSync(fd);
14135
+ }
14136
+ } catch (error) {
14137
+ if (isEnoent4(error) || typeof error === "object" && error !== null && "code" in error && (error.code === "EACCES" || error.code === "EISDIR")) {
14138
+ return false;
14139
+ }
14140
+ throw error;
14141
+ }
14142
+ return head.startsWith("#!") && LAUNCHER_NAME.test(head) && EXEC_RUN.test(head);
14143
+ }
14126
14144
  function resolveOwnBinaryCheck(paths, contentSourcePath) {
14127
14145
  const state = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
14128
14146
  const recordedTarget = state === void 0 ? void 0 : import_node_path33.default.resolve(state.targetPath);
@@ -14133,8 +14151,9 @@ function resolveOwnBinaryCheck(paths, contentSourcePath) {
14133
14151
  }
14134
14152
  ownStat ??= statOrUndefined(contentSourcePath);
14135
14153
  const candidateStat = statOrUndefined(candidate);
14136
- return ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
14154
+ const sameFile = ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
14137
14155
  ownStat.ino !== 0 && candidateStat.ino !== 0 && candidateStat.dev === ownStat.dev && candidateStat.ino === ownStat.ino;
14156
+ return sameFile || isLauncherScript(candidate);
14138
14157
  };
14139
14158
  }
14140
14159
  function isEnoent4(error) {
@@ -14161,7 +14180,7 @@ function findPathShadow(params) {
14161
14180
  }
14162
14181
  return params.pathDirs.some((dir) => import_node_path33.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
14163
14182
  }
14164
- var import_node_fs9, import_node_path33, import_zod29, ClaudeShimStateSchema, nodeLinkFs;
14183
+ var import_node_fs9, import_node_path33, import_zod29, ClaudeShimStateSchema, SCRIPT_HEAD_BYTES, LAUNCHER_NAME, EXEC_RUN, nodeLinkFs;
14165
14184
  var init_claudeShim = __esm({
14166
14185
  "src/claudeShim.ts"() {
14167
14186
  "use strict";
@@ -14177,6 +14196,9 @@ var init_claudeShim = __esm({
14177
14196
  method: import_zod29.z.enum(["hardlink", "copy"]),
14178
14197
  installedAtMs: import_zod29.z.number()
14179
14198
  });
14199
+ SCRIPT_HEAD_BYTES = 4096;
14200
+ LAUNCHER_NAME = /\b(agent-shim|claude-use)\b/;
14201
+ EXEC_RUN = /^\s*exec\s[^\n#]*\brun\b/m;
14180
14202
  nodeLinkFs = { link: import_node_fs9.default.linkSync, copyFile: import_node_fs9.default.copyFileSync, chmod: import_node_fs9.default.chmodSync };
14181
14203
  }
14182
14204
  });
package/dist/index.mjs CHANGED
@@ -13885,7 +13885,7 @@ var init_package = __esm({
13885
13885
  "package.json"() {
13886
13886
  package_default = {
13887
13887
  name: "claude-use",
13888
- version: "14.2.1",
13888
+ version: "14.2.2",
13889
13889
  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.",
13890
13890
  license: "MIT",
13891
13891
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -14099,6 +14099,24 @@ import { z as z29 } from "zod";
14099
14099
  function commandFilename(ownExecutablePath, commandName) {
14100
14100
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
14101
14101
  }
14102
+ function isLauncherScript(candidate) {
14103
+ let head;
14104
+ try {
14105
+ const fd = fs9.openSync(candidate, "r");
14106
+ try {
14107
+ const buffer = Buffer.alloc(SCRIPT_HEAD_BYTES);
14108
+ head = buffer.subarray(0, fs9.readSync(fd, buffer, 0, SCRIPT_HEAD_BYTES, 0)).toString("utf8");
14109
+ } finally {
14110
+ fs9.closeSync(fd);
14111
+ }
14112
+ } catch (error) {
14113
+ if (isEnoent4(error) || typeof error === "object" && error !== null && "code" in error && (error.code === "EACCES" || error.code === "EISDIR")) {
14114
+ return false;
14115
+ }
14116
+ throw error;
14117
+ }
14118
+ return head.startsWith("#!") && LAUNCHER_NAME.test(head) && EXEC_RUN.test(head);
14119
+ }
14102
14120
  function resolveOwnBinaryCheck(paths, contentSourcePath) {
14103
14121
  const state = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
14104
14122
  const recordedTarget = state === void 0 ? void 0 : path33.resolve(state.targetPath);
@@ -14109,8 +14127,9 @@ function resolveOwnBinaryCheck(paths, contentSourcePath) {
14109
14127
  }
14110
14128
  ownStat ??= statOrUndefined(contentSourcePath);
14111
14129
  const candidateStat = statOrUndefined(candidate);
14112
- return ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
14130
+ const sameFile = ownStat !== void 0 && candidateStat !== void 0 && // A platform reporting no inode number for either file must not read every candidate as this tool.
14113
14131
  ownStat.ino !== 0 && candidateStat.ino !== 0 && candidateStat.dev === ownStat.dev && candidateStat.ino === ownStat.ino;
14132
+ return sameFile || isLauncherScript(candidate);
14114
14133
  };
14115
14134
  }
14116
14135
  function isEnoent4(error) {
@@ -14137,7 +14156,7 @@ function findPathShadow(params) {
14137
14156
  }
14138
14157
  return params.pathDirs.some((dir) => path33.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
14139
14158
  }
14140
- var ClaudeShimStateSchema, nodeLinkFs;
14159
+ var ClaudeShimStateSchema, SCRIPT_HEAD_BYTES, LAUNCHER_NAME, EXEC_RUN, nodeLinkFs;
14141
14160
  var init_claudeShim = __esm({
14142
14161
  "src/claudeShim.ts"() {
14143
14162
  "use strict";
@@ -14150,6 +14169,9 @@ var init_claudeShim = __esm({
14150
14169
  method: z29.enum(["hardlink", "copy"]),
14151
14170
  installedAtMs: z29.number()
14152
14171
  });
14172
+ SCRIPT_HEAD_BYTES = 4096;
14173
+ LAUNCHER_NAME = /\b(agent-shim|claude-use)\b/;
14174
+ EXEC_RUN = /^\s*exec\s[^\n#]*\brun\b/m;
14153
14175
  nodeLinkFs = { link: fs9.linkSync, copyFile: fs9.copyFileSync, chmod: fs9.chmodSync };
14154
14176
  }
14155
14177
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "14.2.1",
3
+ "version": "14.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": "MIT",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",