claude-use 11.44.0 → 11.44.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
@@ -34701,7 +34701,7 @@ var init_package = __esm({
34701
34701
  "package.json"() {
34702
34702
  package_default = {
34703
34703
  name: "claude-use",
34704
- version: "11.44.0",
34704
+ version: "11.44.1",
34705
34705
  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.",
34706
34706
  license: "MIT",
34707
34707
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -135032,13 +135032,12 @@ function createRcStreamHub(deps) {
135032
135032
 
135033
135033
  // src/frontdoor/watchdog.ts
135034
135034
  var import_node_worker_threads2 = require("node:worker_threads");
135035
- init_schema();
135036
135035
  init_ensure2();
135037
135036
  init_probe();
135038
135037
  var DOOR_STALL_BOUND_MS = 2 * FRONTDOOR_PROBE_ATTEMPTS * PROBE_TIMEOUT_MS;
135039
- var MS_PER_MINUTE4 = 6e4;
135040
- var DOOR_RESPAWN_MIN_SERVING_MS = FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES * MS_PER_MINUTE4;
135041
135038
  var DOOR_AWAIT_PID_ENV = "AGENT_SHIM_FRONTDOOR_AWAIT_PID";
135039
+ var DOOR_RESPAWN_GENERATION_ENV = "AGENT_SHIM_FRONTDOOR_RESPAWN_GENERATION";
135040
+ var DOOR_RESPAWN_MAX_GENERATIONS = 3;
135042
135041
  var CHECKS_PER_PROBE_DEADLINE = 2;
135043
135042
  var DOOR_WATCHDOG_CHECK_MS = PROBE_TIMEOUT_MS / CHECKS_PER_PROBE_DEADLINE;
135044
135043
  var WATCHDOG_SOURCE = `
@@ -135046,8 +135045,7 @@ const { workerData, parentPort } = require("node:worker_threads");
135046
135045
  const fs = require("node:fs");
135047
135046
  const os = require("node:os");
135048
135047
  const inspector = require("node:inspector");
135049
- const { shared, boundMs, checkEveryMs, pauseWaitMs, stateFile, ownPid, action, logFile, respawn, respawnAfterServingMs, awaitPidEnv } = workerData;
135050
- const startedAt = Date.now();
135048
+ const { shared, boundMs, checkEveryMs, pauseWaitMs, stateFile, ownPid, action, logFile, respawn, respawnGeneration, respawnMaxGeneration, awaitPidEnv, respawnGenerationEnv } = workerData;
135051
135049
  const counter = new Int32Array(shared);
135052
135050
  let lastValue = Atomics.load(counter, 0);
135053
135051
  let lastChangeAt = Date.now();
@@ -135113,17 +135111,16 @@ const describeMainThread = (waitMs, resume) => new Promise((resolve) => {
135113
135111
  });
135114
135112
  const spawnReplacement = () => {
135115
135113
  if (respawn === undefined || logFile === undefined) return;
135116
- const servedMs = Date.now() - startedAt;
135117
- if (servedMs < respawnAfterServingMs) {
135118
- log("the door served for " + String(servedMs) + "ms before stalling, less than the " + String(respawnAfterServingMs) + "ms it must have served to be replaced; leaving the next launch to start one");
135114
+ if (respawnGeneration >= respawnMaxGeneration) {
135115
+ log("not starting another replacement: this door was replacement generation " + String(respawnGeneration) + " of " + String(respawnMaxGeneration) + ", so the stall has recurred through consecutive doors and the machine, not the door, is the one refusing to serve; leaving the next launch's ensure to start one");
135119
135116
  return;
135120
135117
  }
135121
135118
  try {
135122
135119
  const out = fs.openSync(logFile, "a");
135123
- const child = require("node:child_process").spawn(respawn.command, respawn.args, { detached: true, stdio: ["ignore", out, out], env: Object.assign({}, respawn.env, { [awaitPidEnv]: String(ownPid) }) });
135120
+ const child = require("node:child_process").spawn(respawn.command, respawn.args, { detached: true, stdio: ["ignore", out, out], env: Object.assign({}, respawn.env, { [awaitPidEnv]: String(ownPid), [respawnGenerationEnv]: String(respawnGeneration + 1) }) });
135124
135121
  child.unref();
135125
135122
  fs.closeSync(out);
135126
- log("started replacement door " + String(child.pid) + ", which binds once this process is gone");
135123
+ log("started replacement door " + String(child.pid) + " of generation " + String(respawnGeneration + 1) + ", which binds once this process is gone");
135127
135124
  } catch (error) {
135128
135125
  log("could not start a replacement door: " + (error instanceof Error ? error.message : String(error)));
135129
135126
  }
@@ -135171,7 +135168,7 @@ function startThreadWatchdog(params) {
135171
135168
  const counter = new Int32Array(shared);
135172
135169
  const worker = new import_node_worker_threads2.Worker(WATCHDOG_SOURCE, {
135173
135170
  eval: true,
135174
- workerData: { shared, boundMs: params.boundMs, checkEveryMs: params.checkEveryMs, pauseWaitMs: params.pauseWaitMs, stateFile: params.stateFile, ownPid: params.ownPid, action: params.action, logFile: params.logFile, respawn: params.respawn, respawnAfterServingMs: params.respawnAfterServingMs, awaitPidEnv: DOOR_AWAIT_PID_ENV }
135171
+ workerData: { shared, boundMs: params.boundMs, checkEveryMs: params.checkEveryMs, pauseWaitMs: params.pauseWaitMs, stateFile: params.stateFile, ownPid: params.ownPid, action: params.action, logFile: params.logFile, respawn: params.respawn, respawnGeneration: params.respawnGeneration, respawnMaxGeneration: params.respawnMaxGeneration, awaitPidEnv: DOOR_AWAIT_PID_ENV, respawnGenerationEnv: DOOR_RESPAWN_GENERATION_ENV }
135175
135172
  });
135176
135173
  worker.unref();
135177
135174
  worker.on("message", (message) => {
@@ -135299,6 +135296,10 @@ function createRealQuotaRefresher(params) {
135299
135296
 
135300
135297
  // src/frontdoor/commands.ts
135301
135298
  init_store2();
135299
+ function readRespawnGeneration() {
135300
+ const generation = Number(process.env[DOOR_RESPAWN_GENERATION_ENV]);
135301
+ return Number.isInteger(generation) && generation > 0 ? generation : 0;
135302
+ }
135302
135303
  function respawnInvocation(paths) {
135303
135304
  const env = {};
135304
135305
  for (const [name, value2] of Object.entries({ ...process.env, AGENT_SHIM_HOME: paths.root })) {
@@ -135325,7 +135326,7 @@ function realStatOwnExecutable(watchPath) {
135325
135326
  return st2?.isFile() !== true ? void 0 : { dev: st2.dev, ino: st2.ino, size: st2.size, mtimeMs: st2.mtimeMs };
135326
135327
  };
135327
135328
  }
135328
- function realFrontDoorSupervisorPorts(paths) {
135329
+ function realFrontDoorSupervisorPorts(paths, respawnGeneration) {
135329
135330
  const log = (line) => {
135330
135331
  appendLog(paths, `frontdoor ${String(process.pid)}: ${line}`);
135331
135332
  };
@@ -135742,7 +135743,8 @@ function realFrontDoorSupervisorPorts(paths) {
135742
135743
  action: "kill-process",
135743
135744
  logFile: paths.frontdoorLogPath,
135744
135745
  respawn: respawnInvocation(paths),
135745
- respawnAfterServingMs: DOOR_RESPAWN_MIN_SERVING_MS
135746
+ respawnGeneration,
135747
+ respawnMaxGeneration: DOOR_RESPAWN_MAX_GENERATIONS
135746
135748
  }),
135747
135749
  // The launch lifecycle publisher over the same backbone the typed API serves: the tick's registry facts go in here, and the door's own register, prune and end moments come out as source-tagged events.
135748
135750
  observeLaunchRegistry: createLaunchEventPublisher(doorEvents, () => Date.now()).observe,
@@ -135788,7 +135790,11 @@ function registerFrontDoorCommand(program2, deps) {
135788
135790
  registerRcCommand(frontdoor, paths);
135789
135791
  program2.command("__frontdoor-supervisor", { hidden: true }).description("Internal: serve the front-door routing listeners. Started by the launcher; never run by hand.").allowUnknownOption().action(async () => {
135790
135792
  const idleShutdownMinutes = readGlobalConfig(paths)?.frontdoor?.idleShutdownMinutes ?? FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES;
135791
- const supervisorPorts = realFrontDoorSupervisorPorts(paths);
135793
+ const awaited = Number(process.env[DOOR_AWAIT_PID_ENV]);
135794
+ const respawnGeneration = readRespawnGeneration();
135795
+ Reflect.deleteProperty(process.env, DOOR_AWAIT_PID_ENV);
135796
+ Reflect.deleteProperty(process.env, DOOR_RESPAWN_GENERATION_ENV);
135797
+ const supervisorPorts = realFrontDoorSupervisorPorts(paths, respawnGeneration);
135792
135798
  const ownPid = process.pid;
135793
135799
  process.on("exit", (code) => {
135794
135800
  supervisorPorts.log(`frontdoor ${String(ownPid)}: exiting with code ${String(code)}`);
@@ -135799,8 +135805,6 @@ function registerFrontDoorCommand(program2, deps) {
135799
135805
  deps.exit(0);
135800
135806
  });
135801
135807
  }
135802
- const awaited = Number(process.env[DOOR_AWAIT_PID_ENV]);
135803
- Reflect.deleteProperty(process.env, DOOR_AWAIT_PID_ENV);
135804
135808
  if (Number.isInteger(awaited) && awaited > 0) {
135805
135809
  const waitedMs = await awaitPidExit(awaited, supervisorPorts);
135806
135810
  supervisorPorts.log(`frontdoor ${String(ownPid)}: stalled door ${String(awaited)} released the sticky ports after ${String(waitedMs)}ms`);
package/dist/index.cjs CHANGED
@@ -3151,7 +3151,7 @@ var init_package = __esm({
3151
3151
  "package.json"() {
3152
3152
  package_default = {
3153
3153
  name: "claude-use",
3154
- version: "11.44.0",
3154
+ version: "11.44.1",
3155
3155
  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.",
3156
3156
  license: "MIT",
3157
3157
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -3127,7 +3127,7 @@ var init_package = __esm({
3127
3127
  "package.json"() {
3128
3128
  package_default = {
3129
3129
  name: "claude-use",
3130
- version: "11.44.0",
3130
+ version: "11.44.1",
3131
3131
  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.",
3132
3132
  license: "MIT",
3133
3133
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.44.0",
3
+ "version": "11.44.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>",