claude-use 11.21.1 → 11.22.0

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
@@ -34181,7 +34181,7 @@ var init_package = __esm({
34181
34181
  "package.json"() {
34182
34182
  package_default = {
34183
34183
  name: "claude-use",
34184
- version: "11.21.1",
34184
+ version: "11.22.0",
34185
34185
  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.",
34186
34186
  license: "MIT",
34187
34187
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -132916,6 +132916,8 @@ var DOOR_WATCHDOG_CHECK_MS = PROBE_TIMEOUT_MS / CHECKS_PER_PROBE_DEADLINE;
132916
132916
  var WATCHDOG_SOURCE = `
132917
132917
  const { workerData, parentPort } = require("node:worker_threads");
132918
132918
  const fs = require("node:fs");
132919
+ const os = require("node:os");
132920
+ const inspector = require("node:inspector");
132919
132921
  const { shared, boundMs, checkEveryMs, stateFile, ownPid, action, logFile, respawn, respawnAfterServingMs, awaitPidEnv } = workerData;
132920
132922
  const startedAt = Date.now();
132921
132923
  const counter = new Int32Array(shared);
@@ -132942,6 +132944,45 @@ const log = (line) => {
132942
132944
  // Nowhere left to report a failed log write to; the process still has to end.
132943
132945
  }
132944
132946
  };
132947
+ // Enough of the stack to read the caller chain from the timer or socket callback down to the call that held the loop.
132948
+ const STACK_FRAMES_LOGGED = 12;
132949
+ // Asks the main thread where it is, through the inspector: a pause request interrupts JavaScript that is running (a loop, or a synchronous call that can be interrupted), so the top frames name what held the loop. A main thread that cannot be paused within the wait is not at such a point (it is idle in the event loop, which means it was not scheduled, or blocked inside a native call), and the answer says so rather than guessing. \`resume\` lets a thread that is not about to be killed run on again.
132950
+ const describeMainThread = (waitMs, resume) => new Promise((resolve) => {
132951
+ let session;
132952
+ let settled = false;
132953
+ const finish = (text) => {
132954
+ if (settled) return;
132955
+ settled = true;
132956
+ clearTimeout(timeout);
132957
+ try {
132958
+ session.disconnect();
132959
+ } catch (error) {
132960
+ // Never connected; there is nothing to release.
132961
+ }
132962
+ resolve(text);
132963
+ };
132964
+ const timeout = setTimeout(() => finish("the main thread could not be paused within " + String(waitMs) + "ms, so it was idle in the event loop or blocked inside a native call"), waitMs);
132965
+ try {
132966
+ session = new inspector.Session();
132967
+ session.connectToMainThread();
132968
+ session.on("Debugger.paused", (event) => {
132969
+ if (settled) return;
132970
+ const frames = event.params.callFrames.slice(0, STACK_FRAMES_LOGGED).map((frame) => (frame.functionName === "" ? "(anonymous)" : frame.functionName) + " " + frame.url + ":" + String(frame.location.lineNumber + 1));
132971
+ const text = "the main thread was in " + frames.join(" <- ");
132972
+ if (resume) {
132973
+ session.post("Debugger.resume", () => finish(text));
132974
+ } else {
132975
+ finish(text);
132976
+ }
132977
+ });
132978
+ session.post("Debugger.enable", () => {
132979
+ // The wait may have run out while the main thread was too stalled to answer the enable; the session is gone then.
132980
+ if (!settled) session.post("Debugger.pause");
132981
+ });
132982
+ } catch (error) {
132983
+ finish("the main thread could not be inspected: " + (error instanceof Error ? error.message : String(error)));
132984
+ }
132985
+ });
132945
132986
  const spawnReplacement = () => {
132946
132987
  if (respawn === undefined || logFile === undefined) return;
132947
132988
  const servedMs = Date.now() - startedAt;
@@ -132972,16 +133013,21 @@ const timer = setInterval(() => {
132972
133013
  }
132973
133014
  if (now - lastChangeAt >= boundMs) {
132974
133015
  const message = "the front door's event loop did not run for " + String(now - lastChangeAt) + "ms; its watchdog ended the process so the next launch starts a fresh door on the same ports";
133016
+ stopped = true;
133017
+ clearInterval(timer);
132975
133018
  record(message);
132976
133019
  log(message);
133020
+ const [oneMinute, fiveMinutes, fifteenMinutes] = os.loadavg();
133021
+ log("machine load at the stall: " + oneMinute.toFixed(1) + " (1m), " + fiveMinutes.toFixed(1) + " (5m), " + fifteenMinutes.toFixed(1) + " (15m) across " + String(os.cpus().length) + " cpus");
132977
133022
  spawnReplacement();
132978
- stopped = true;
132979
- clearInterval(timer);
132980
- if (action === "kill-process") {
132981
- process.kill(ownPid, "SIGKILL");
132982
- } else {
132983
- parentPort.postMessage({ stalled: true, message });
132984
- }
133023
+ describeMainThread(checkEveryMs, action !== "kill-process").then((where) => {
133024
+ log(where);
133025
+ if (action === "kill-process") {
133026
+ process.kill(ownPid, "SIGKILL");
133027
+ } else {
133028
+ parentPort.postMessage({ stalled: true, message });
133029
+ }
133030
+ });
132985
133031
  }
132986
133032
  }, checkEveryMs);
132987
133033
  parentPort.on("message", (message) => {
package/dist/index.cjs CHANGED
@@ -2928,7 +2928,7 @@ var init_package = __esm({
2928
2928
  "package.json"() {
2929
2929
  package_default = {
2930
2930
  name: "claude-use",
2931
- version: "11.21.1",
2931
+ version: "11.22.0",
2932
2932
  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.",
2933
2933
  license: "MIT",
2934
2934
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -2904,7 +2904,7 @@ var init_package = __esm({
2904
2904
  "package.json"() {
2905
2905
  package_default = {
2906
2906
  name: "claude-use",
2907
- version: "11.21.1",
2907
+ version: "11.22.0",
2908
2908
  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.",
2909
2909
  license: "MIT",
2910
2910
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -393,8 +393,8 @@ declare const AntigravityProviderConfigSchema: z.ZodObject<{
393
393
  models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
394
394
  degradeDownTiers: z.ZodOptional<z.ZodBoolean>;
395
395
  effort: z.ZodOptional<z.ZodEnum<{
396
- none: "none";
397
396
  max: "max";
397
+ none: "none";
398
398
  low: "low";
399
399
  medium: "medium";
400
400
  high: "high";
@@ -660,8 +660,8 @@ declare const ProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
660
660
  models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
661
661
  degradeDownTiers: z.ZodOptional<z.ZodBoolean>;
662
662
  effort: z.ZodOptional<z.ZodEnum<{
663
- none: "none";
664
663
  max: "max";
664
+ none: "none";
665
665
  low: "low";
666
666
  medium: "medium";
667
667
  high: "high";
@@ -1435,8 +1435,8 @@ declare const HeadroomGlobalConfigSchema: z.ZodObject<{
1435
1435
  targetRatio: z.ZodOptional<z.ZodNumber>;
1436
1436
  ccr: z.ZodOptional<z.ZodEnum<{
1437
1437
  default: "default";
1438
- none: "none";
1439
1438
  lossless: "lossless";
1439
+ none: "none";
1440
1440
  }>>;
1441
1441
  rolloutChannel: z.ZodOptional<z.ZodEnum<{
1442
1442
  beta: "beta";
@@ -1563,8 +1563,8 @@ declare const GlobalConfigSchema: z.ZodObject<{
1563
1563
  targetRatio: z.ZodOptional<z.ZodNumber>;
1564
1564
  ccr: z.ZodOptional<z.ZodEnum<{
1565
1565
  default: "default";
1566
- none: "none";
1567
1566
  lossless: "lossless";
1567
+ none: "none";
1568
1568
  }>>;
1569
1569
  rolloutChannel: z.ZodOptional<z.ZodEnum<{
1570
1570
  beta: "beta";
@@ -4271,12 +4271,12 @@ declare const CheckReportJsonSchema: z.ZodObject<{
4271
4271
  identity: z.ZodObject<{
4272
4272
  name: z.ZodNullable<z.ZodString>;
4273
4273
  source: z.ZodEnum<{
4274
+ env: "env";
4275
+ none: "none";
4274
4276
  "config-dir-escape-hatch": "config-dir-escape-hatch";
4275
4277
  argv: "argv";
4276
- env: "env";
4277
4278
  "directory-pin": "directory-pin";
4278
4279
  "active-identity-file": "active-identity-file";
4279
- none: "none";
4280
4280
  }>;
4281
4281
  }, z.core.$strict>;
4282
4282
  pool: z.ZodOptional<z.ZodObject<{
@@ -4354,11 +4354,11 @@ declare const CheckReportJsonSchema: z.ZodObject<{
4354
4354
  "category-default": "category-default";
4355
4355
  }>;
4356
4356
  category: z.ZodNullable<z.ZodEnum<{
4357
- secret: "secret";
4358
4357
  runtime: "runtime";
4359
4358
  history: "history";
4360
4359
  knowledge: "knowledge";
4361
4360
  settings: "settings";
4361
+ secret: "secret";
4362
4362
  }>>;
4363
4363
  rule: z.ZodOptional<z.ZodObject<{
4364
4364
  key: z.ZodString;
@@ -7091,9 +7091,9 @@ declare function createLifecycleApiRouter(deps: LifecycleApiDeps): {
7091
7091
  current: zod.ZodString;
7092
7092
  latest: zod.ZodString;
7093
7093
  action: zod.ZodEnum<{
7094
+ updated: "updated";
7094
7095
  current: "current";
7095
7096
  available: "available";
7096
- updated: "updated";
7097
7097
  }>;
7098
7098
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
7099
7099
  };
@@ -7357,12 +7357,12 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
7357
7357
  decision: zod.ZodObject<{
7358
7358
  identity: zod.ZodOptional<zod.ZodString>;
7359
7359
  identitySource: zod.ZodEnum<{
7360
+ env: "env";
7361
+ none: "none";
7360
7362
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7361
7363
  argv: "argv";
7362
- env: "env";
7363
7364
  "directory-pin": "directory-pin";
7364
7365
  "active-identity-file": "active-identity-file";
7365
- none: "none";
7366
7366
  }>;
7367
7367
  pool: zod.ZodOptional<zod.ZodObject<{
7368
7368
  name: zod.ZodString;
@@ -7961,12 +7961,12 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7961
7961
  identity: zod.ZodObject<{
7962
7962
  name: zod.ZodNullable<zod.ZodString>;
7963
7963
  source: zod.ZodEnum<{
7964
+ env: "env";
7965
+ none: "none";
7964
7966
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7965
7967
  argv: "argv";
7966
- env: "env";
7967
7968
  "directory-pin": "directory-pin";
7968
7969
  "active-identity-file": "active-identity-file";
7969
- none: "none";
7970
7970
  }>;
7971
7971
  }, zod_v4_core.$strict>;
7972
7972
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -8044,11 +8044,11 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
8044
8044
  "category-default": "category-default";
8045
8045
  }>;
8046
8046
  category: zod.ZodNullable<zod.ZodEnum<{
8047
- secret: "secret";
8048
8047
  runtime: "runtime";
8049
8048
  history: "history";
8050
8049
  knowledge: "knowledge";
8051
8050
  settings: "settings";
8051
+ secret: "secret";
8052
8052
  }>>;
8053
8053
  rule: zod.ZodOptional<zod.ZodObject<{
8054
8054
  key: zod.ZodString;
@@ -8267,10 +8267,11 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
8267
8267
  "global-config": "global-config";
8268
8268
  "config-profile": "config-profile";
8269
8269
  identity: "identity";
8270
+ keychain: "keychain";
8270
8271
  provider: "provider";
8272
+ headroom: "headroom";
8271
8273
  frontdoor: "frontdoor";
8272
8274
  pool: "pool";
8273
- keychain: "keychain";
8274
8275
  "ambient-credential": "ambient-credential";
8275
8276
  "binary-discovery": "binary-discovery";
8276
8277
  "claude-shim": "claude-shim";
@@ -8280,7 +8281,6 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
8280
8281
  "directory-rules": "directory-rules";
8281
8282
  "categories-local": "categories-local";
8282
8283
  "active-identity": "active-identity";
8283
- headroom: "headroom";
8284
8284
  }>;
8285
8285
  subject: zod.ZodOptional<zod.ZodString>;
8286
8286
  severity: zod.ZodEnum<{
@@ -8473,12 +8473,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
8473
8473
  decision: zod.ZodObject<{
8474
8474
  identity: zod.ZodOptional<zod.ZodString>;
8475
8475
  identitySource: zod.ZodEnum<{
8476
+ env: "env";
8477
+ none: "none";
8476
8478
  "config-dir-escape-hatch": "config-dir-escape-hatch";
8477
8479
  argv: "argv";
8478
- env: "env";
8479
8480
  "directory-pin": "directory-pin";
8480
8481
  "active-identity-file": "active-identity-file";
8481
- none: "none";
8482
8482
  }>;
8483
8483
  pool: zod.ZodOptional<zod.ZodObject<{
8484
8484
  name: zod.ZodString;
@@ -9869,9 +9869,9 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9869
9869
  current: zod.ZodString;
9870
9870
  latest: zod.ZodString;
9871
9871
  action: zod.ZodEnum<{
9872
+ updated: "updated";
9872
9873
  current: "current";
9873
9874
  available: "available";
9874
- updated: "updated";
9875
9875
  }>;
9876
9876
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
9877
9877
  };
@@ -10074,12 +10074,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
10074
10074
  identity: zod.ZodObject<{
10075
10075
  name: zod.ZodNullable<zod.ZodString>;
10076
10076
  source: zod.ZodEnum<{
10077
+ env: "env";
10078
+ none: "none";
10077
10079
  "config-dir-escape-hatch": "config-dir-escape-hatch";
10078
10080
  argv: "argv";
10079
- env: "env";
10080
10081
  "directory-pin": "directory-pin";
10081
10082
  "active-identity-file": "active-identity-file";
10082
- none: "none";
10083
10083
  }>;
10084
10084
  }, zod_v4_core.$strict>;
10085
10085
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -10157,11 +10157,11 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
10157
10157
  "category-default": "category-default";
10158
10158
  }>;
10159
10159
  category: zod.ZodNullable<zod.ZodEnum<{
10160
- secret: "secret";
10161
10160
  runtime: "runtime";
10162
10161
  history: "history";
10163
10162
  knowledge: "knowledge";
10164
10163
  settings: "settings";
10164
+ secret: "secret";
10165
10165
  }>>;
10166
10166
  rule: zod.ZodOptional<zod.ZodObject<{
10167
10167
  key: zod.ZodString;
@@ -10380,10 +10380,11 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
10380
10380
  "global-config": "global-config";
10381
10381
  "config-profile": "config-profile";
10382
10382
  identity: "identity";
10383
+ keychain: "keychain";
10383
10384
  provider: "provider";
10385
+ headroom: "headroom";
10384
10386
  frontdoor: "frontdoor";
10385
10387
  pool: "pool";
10386
- keychain: "keychain";
10387
10388
  "ambient-credential": "ambient-credential";
10388
10389
  "binary-discovery": "binary-discovery";
10389
10390
  "claude-shim": "claude-shim";
@@ -10393,7 +10394,6 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
10393
10394
  "directory-rules": "directory-rules";
10394
10395
  "categories-local": "categories-local";
10395
10396
  "active-identity": "active-identity";
10396
- headroom: "headroom";
10397
10397
  }>;
10398
10398
  subject: zod.ZodOptional<zod.ZodString>;
10399
10399
  severity: zod.ZodEnum<{
@@ -12245,10 +12245,11 @@ declare const DoctorFindingSchema: z.ZodObject<{
12245
12245
  "global-config": "global-config";
12246
12246
  "config-profile": "config-profile";
12247
12247
  identity: "identity";
12248
+ keychain: "keychain";
12248
12249
  provider: "provider";
12250
+ headroom: "headroom";
12249
12251
  frontdoor: "frontdoor";
12250
12252
  pool: "pool";
12251
- keychain: "keychain";
12252
12253
  "ambient-credential": "ambient-credential";
12253
12254
  "binary-discovery": "binary-discovery";
12254
12255
  "claude-shim": "claude-shim";
@@ -12258,7 +12259,6 @@ declare const DoctorFindingSchema: z.ZodObject<{
12258
12259
  "directory-rules": "directory-rules";
12259
12260
  "categories-local": "categories-local";
12260
12261
  "active-identity": "active-identity";
12261
- headroom: "headroom";
12262
12262
  }>;
12263
12263
  subject: z.ZodOptional<z.ZodString>;
12264
12264
  severity: z.ZodEnum<{
@@ -12276,10 +12276,11 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
12276
12276
  "global-config": "global-config";
12277
12277
  "config-profile": "config-profile";
12278
12278
  identity: "identity";
12279
+ keychain: "keychain";
12279
12280
  provider: "provider";
12281
+ headroom: "headroom";
12280
12282
  frontdoor: "frontdoor";
12281
12283
  pool: "pool";
12282
- keychain: "keychain";
12283
12284
  "ambient-credential": "ambient-credential";
12284
12285
  "binary-discovery": "binary-discovery";
12285
12286
  "claude-shim": "claude-shim";
@@ -12289,7 +12290,6 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
12289
12290
  "directory-rules": "directory-rules";
12290
12291
  "categories-local": "categories-local";
12291
12292
  "active-identity": "active-identity";
12292
- headroom: "headroom";
12293
12293
  }>;
12294
12294
  subject: z.ZodOptional<z.ZodString>;
12295
12295
  severity: z.ZodEnum<{
@@ -12310,9 +12310,9 @@ declare const UpdateCheckOutputSchema: z.ZodObject<{
12310
12310
  current: z.ZodString;
12311
12311
  latest: z.ZodString;
12312
12312
  action: z.ZodEnum<{
12313
+ updated: "updated";
12313
12314
  current: "current";
12314
12315
  available: "available";
12315
- updated: "updated";
12316
12316
  }>;
12317
12317
  }, z.core.$strict>;
12318
12318
  /** The Sign in with ChatGPT login's state as `codex status` reports it: no sign-in yet, signed in (with who, whether the plan scope was granted, and when the access token lapses), or a file that cannot be read. */
@@ -12362,12 +12362,12 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
12362
12362
  decision: z.ZodObject<{
12363
12363
  identity: z.ZodOptional<z.ZodString>;
12364
12364
  identitySource: z.ZodEnum<{
12365
+ env: "env";
12366
+ none: "none";
12365
12367
  "config-dir-escape-hatch": "config-dir-escape-hatch";
12366
12368
  argv: "argv";
12367
- env: "env";
12368
12369
  "directory-pin": "directory-pin";
12369
12370
  "active-identity-file": "active-identity-file";
12370
- none: "none";
12371
12371
  }>;
12372
12372
  pool: z.ZodOptional<z.ZodObject<{
12373
12373
  name: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.21.1",
3
+ "version": "11.22.0",
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>",