claude-use 11.60.0 → 11.60.1

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
@@ -36857,7 +36857,7 @@ var init_package = __esm({
36857
36857
  "package.json"() {
36858
36858
  package_default = {
36859
36859
  name: "claude-use",
36860
- version: "11.60.0",
36860
+ version: "11.60.1",
36861
36861
  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.",
36862
36862
  license: "MIT",
36863
36863
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -69036,7 +69036,7 @@ var init_launcher = __esm({
69036
69036
  function keyOf2(command, args) {
69037
69037
  return JSON.stringify([command, args]);
69038
69038
  }
69039
- async function resolveWithAsyncRuns(decide, runAsync2) {
69039
+ async function recordRuns(decide, runAsync2) {
69040
69040
  const answers = /* @__PURE__ */ new Map();
69041
69041
  const replay = {
69042
69042
  run: (command, args) => {
@@ -69049,7 +69049,8 @@ async function resolveWithAsyncRuns(decide, runAsync2) {
69049
69049
  };
69050
69050
  for (; ; ) {
69051
69051
  try {
69052
- return decide(replay);
69052
+ decide(replay);
69053
+ return replay;
69053
69054
  } catch (error63) {
69054
69055
  if (!(error63 instanceof RunNeededError)) {
69055
69056
  throw error63;
@@ -69058,6 +69059,16 @@ async function resolveWithAsyncRuns(decide, runAsync2) {
69058
69059
  }
69059
69060
  }
69060
69061
  }
69062
+ async function resolveWithAsyncRuns(decide, runAsync2) {
69063
+ let result;
69064
+ await recordRuns((run) => {
69065
+ result = { value: decide(run) };
69066
+ }, runAsync2);
69067
+ if (result === void 0) {
69068
+ throw new Error("the decision finished without a result");
69069
+ }
69070
+ return result.value;
69071
+ }
69061
69072
  var RunNeededError;
69062
69073
  var init_replayRun = __esm({
69063
69074
  "src/replayRun.ts"() {
@@ -69211,11 +69222,14 @@ function identityLaunchArgv(identity, flags) {
69211
69222
  }
69212
69223
  async function withIdentityClaude(params, identity, flags, use2) {
69213
69224
  const refusals = [];
69225
+ const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE));
69226
+ const argv = [...identityLaunchArgv(identity, flags)];
69227
+ const run = await recordRuns((replay) => resolveClaudeLaunch({ argv, cwd: params.cwd, env: definedEnvironment(env), paths: params.paths }, replay), params.runAsync ?? realRunAsync);
69214
69228
  const plan = prepareLaunch(
69215
69229
  realPrepareLaunchParams(params.paths, {
69216
69230
  proc: {
69217
- env: Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE)),
69218
- argv: [...identityLaunchArgv(identity, flags)],
69231
+ env,
69232
+ argv,
69219
69233
  exit: (code) => {
69220
69234
  throw new LaunchRefusedError(refusals.join("\n") || `the launch was refused (exit ${String(code)})`, code);
69221
69235
  }
@@ -69229,7 +69243,8 @@ async function withIdentityClaude(params, identity, flags, use2) {
69229
69243
  }
69230
69244
  },
69231
69245
  spawnDaemon: params.spawnDaemon,
69232
- farm: buildFarmRuntime(params.paths, params.cwd)
69246
+ run,
69247
+ farm: buildFarmRuntime(params.paths, params.cwd, run)
69233
69248
  })
69234
69249
  );
69235
69250
  const abort = new AbortController();
@@ -69249,6 +69264,8 @@ var init_identityClaude = __esm({
69249
69264
  "use strict";
69250
69265
  init_launchWiring();
69251
69266
  init_launcher();
69267
+ init_realPorts();
69268
+ init_replayRun();
69252
69269
  CONFIG_DIR_VARIABLE = "CLAUDE_CONFIG_DIR";
69253
69270
  IDENTITY_ONLY_FLAG = "--no-provider";
69254
69271
  }
package/dist/index.cjs CHANGED
@@ -4508,7 +4508,7 @@ var init_package = __esm({
4508
4508
  "package.json"() {
4509
4509
  package_default = {
4510
4510
  name: "claude-use",
4511
- version: "11.60.0",
4511
+ version: "11.60.1",
4512
4512
  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.",
4513
4513
  license: "MIT",
4514
4514
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -5797,6 +5797,13 @@ function realFrontDoorLiveness(pids) {
5797
5797
  return { status: result.status, stdout: result.stdout, stderr: result.stderr, ...result.error === void 0 ? {} : { error: result.error } };
5798
5798
  });
5799
5799
  }
5800
+ async function realRunAsync(command, args) {
5801
+ return await new Promise((resolve) => {
5802
+ (0, import_node_child_process3.execFile)(command, [...args], { encoding: "utf8", timeout: PS_TIMEOUT_MS }, (error, stdout, stderr) => {
5803
+ resolve({ status: error === null ? 0 : typeof error.code === "number" ? error.code : null, stdout, stderr });
5804
+ });
5805
+ });
5806
+ }
5800
5807
  function expandHome2(filePath) {
5801
5808
  return filePath.startsWith("~/") ? import_node_path14.default.join(import_node_os2.default.homedir(), filePath.slice(1)) : filePath;
5802
5809
  }
@@ -11819,9 +11826,46 @@ var init_realFrontDoorPort = __esm({
11819
11826
  });
11820
11827
 
11821
11828
  // src/replayRun.ts
11829
+ function keyOf2(command, args) {
11830
+ return JSON.stringify([command, args]);
11831
+ }
11832
+ async function recordRuns(decide, runAsync) {
11833
+ const answers = /* @__PURE__ */ new Map();
11834
+ const replay = {
11835
+ run: (command, args) => {
11836
+ const answer = answers.get(keyOf2(command, args));
11837
+ if (answer === void 0) {
11838
+ throw new RunNeededError(command, args);
11839
+ }
11840
+ return answer;
11841
+ }
11842
+ };
11843
+ for (; ; ) {
11844
+ try {
11845
+ decide(replay);
11846
+ return replay;
11847
+ } catch (error) {
11848
+ if (!(error instanceof RunNeededError)) {
11849
+ throw error;
11850
+ }
11851
+ answers.set(keyOf2(error.command, error.args), await runAsync(error.command, error.args));
11852
+ }
11853
+ }
11854
+ }
11855
+ var RunNeededError;
11822
11856
  var init_replayRun = __esm({
11823
11857
  "src/replayRun.ts"() {
11824
11858
  "use strict";
11859
+ RunNeededError = class extends Error {
11860
+ constructor(command, args) {
11861
+ super(`no recorded answer for ${command} ${args.join(" ")}`);
11862
+ this.command = command;
11863
+ this.args = args;
11864
+ this.name = "RunNeededError";
11865
+ }
11866
+ command;
11867
+ args;
11868
+ };
11825
11869
  }
11826
11870
  });
11827
11871
 
@@ -12117,11 +12161,14 @@ function identityLaunchArgv(identity, flags) {
12117
12161
  }
12118
12162
  async function withIdentityClaude(params, identity, flags, use) {
12119
12163
  const refusals = [];
12164
+ const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE));
12165
+ const argv = [...identityLaunchArgv(identity, flags)];
12166
+ const run = await recordRuns((replay) => resolveClaudeLaunch({ argv, cwd: params.cwd, env: definedEnvironment(env), paths: params.paths }, replay), params.runAsync ?? realRunAsync);
12120
12167
  const plan = prepareLaunch(
12121
12168
  realPrepareLaunchParams(params.paths, {
12122
12169
  proc: {
12123
- env: Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE)),
12124
- argv: [...identityLaunchArgv(identity, flags)],
12170
+ env,
12171
+ argv,
12125
12172
  exit: (code) => {
12126
12173
  throw new LaunchRefusedError(refusals.join("\n") || `the launch was refused (exit ${String(code)})`, code);
12127
12174
  }
@@ -12135,7 +12182,8 @@ async function withIdentityClaude(params, identity, flags, use) {
12135
12182
  }
12136
12183
  },
12137
12184
  spawnDaemon: params.spawnDaemon,
12138
- farm: buildFarmRuntime(params.paths, params.cwd)
12185
+ run,
12186
+ farm: buildFarmRuntime(params.paths, params.cwd, run)
12139
12187
  })
12140
12188
  );
12141
12189
  const abort = new AbortController();
@@ -12155,6 +12203,8 @@ var init_identityClaude = __esm({
12155
12203
  "use strict";
12156
12204
  init_launchWiring();
12157
12205
  init_launcher();
12206
+ init_realPorts();
12207
+ init_replayRun();
12158
12208
  CONFIG_DIR_VARIABLE = "CLAUDE_CONFIG_DIR";
12159
12209
  IDENTITY_ONLY_FLAG = "--no-provider";
12160
12210
  }
package/dist/index.mjs CHANGED
@@ -4484,7 +4484,7 @@ var init_package = __esm({
4484
4484
  "package.json"() {
4485
4485
  package_default = {
4486
4486
  name: "claude-use",
4487
- version: "11.60.0",
4487
+ version: "11.60.1",
4488
4488
  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.",
4489
4489
  license: "MIT",
4490
4490
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -5780,6 +5780,13 @@ function realFrontDoorLiveness(pids) {
5780
5780
  return { status: result.status, stdout: result.stdout, stderr: result.stderr, ...result.error === void 0 ? {} : { error: result.error } };
5781
5781
  });
5782
5782
  }
5783
+ async function realRunAsync(command, args) {
5784
+ return await new Promise((resolve) => {
5785
+ execFile(command, [...args], { encoding: "utf8", timeout: PS_TIMEOUT_MS }, (error, stdout, stderr) => {
5786
+ resolve({ status: error === null ? 0 : typeof error.code === "number" ? error.code : null, stdout, stderr });
5787
+ });
5788
+ });
5789
+ }
5783
5790
  function expandHome2(filePath) {
5784
5791
  return filePath.startsWith("~/") ? path14.join(os3.homedir(), filePath.slice(1)) : filePath;
5785
5792
  }
@@ -11790,9 +11797,46 @@ var init_realFrontDoorPort = __esm({
11790
11797
  });
11791
11798
 
11792
11799
  // src/replayRun.ts
11800
+ function keyOf2(command, args) {
11801
+ return JSON.stringify([command, args]);
11802
+ }
11803
+ async function recordRuns(decide, runAsync) {
11804
+ const answers = /* @__PURE__ */ new Map();
11805
+ const replay = {
11806
+ run: (command, args) => {
11807
+ const answer = answers.get(keyOf2(command, args));
11808
+ if (answer === void 0) {
11809
+ throw new RunNeededError(command, args);
11810
+ }
11811
+ return answer;
11812
+ }
11813
+ };
11814
+ for (; ; ) {
11815
+ try {
11816
+ decide(replay);
11817
+ return replay;
11818
+ } catch (error) {
11819
+ if (!(error instanceof RunNeededError)) {
11820
+ throw error;
11821
+ }
11822
+ answers.set(keyOf2(error.command, error.args), await runAsync(error.command, error.args));
11823
+ }
11824
+ }
11825
+ }
11826
+ var RunNeededError;
11793
11827
  var init_replayRun = __esm({
11794
11828
  "src/replayRun.ts"() {
11795
11829
  "use strict";
11830
+ RunNeededError = class extends Error {
11831
+ constructor(command, args) {
11832
+ super(`no recorded answer for ${command} ${args.join(" ")}`);
11833
+ this.command = command;
11834
+ this.args = args;
11835
+ this.name = "RunNeededError";
11836
+ }
11837
+ command;
11838
+ args;
11839
+ };
11796
11840
  }
11797
11841
  });
11798
11842
 
@@ -12088,11 +12132,14 @@ function identityLaunchArgv(identity, flags) {
12088
12132
  }
12089
12133
  async function withIdentityClaude(params, identity, flags, use) {
12090
12134
  const refusals = [];
12135
+ const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE));
12136
+ const argv = [...identityLaunchArgv(identity, flags)];
12137
+ const run = await recordRuns((replay) => resolveClaudeLaunch({ argv, cwd: params.cwd, env: definedEnvironment(env), paths: params.paths }, replay), params.runAsync ?? realRunAsync);
12091
12138
  const plan = prepareLaunch(
12092
12139
  realPrepareLaunchParams(params.paths, {
12093
12140
  proc: {
12094
- env: Object.fromEntries(Object.entries(process.env).filter(([name]) => name !== CONFIG_DIR_VARIABLE)),
12095
- argv: [...identityLaunchArgv(identity, flags)],
12141
+ env,
12142
+ argv,
12096
12143
  exit: (code) => {
12097
12144
  throw new LaunchRefusedError(refusals.join("\n") || `the launch was refused (exit ${String(code)})`, code);
12098
12145
  }
@@ -12106,7 +12153,8 @@ async function withIdentityClaude(params, identity, flags, use) {
12106
12153
  }
12107
12154
  },
12108
12155
  spawnDaemon: params.spawnDaemon,
12109
- farm: buildFarmRuntime(params.paths, params.cwd)
12156
+ run,
12157
+ farm: buildFarmRuntime(params.paths, params.cwd, run)
12110
12158
  })
12111
12159
  );
12112
12160
  const abort = new AbortController();
@@ -12126,6 +12174,8 @@ var init_identityClaude = __esm({
12126
12174
  "use strict";
12127
12175
  init_launchWiring();
12128
12176
  init_launcher();
12177
+ init_realPorts();
12178
+ init_replayRun();
12129
12179
  CONFIG_DIR_VARIABLE = "CLAUDE_CONFIG_DIR";
12130
12180
  IDENTITY_ONLY_FLAG = "--no-provider";
12131
12181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.60.0",
3
+ "version": "11.60.1",
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>",