claude-use 9.15.0 → 9.15.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
@@ -33317,7 +33317,7 @@ var init_package = __esm({
33317
33317
  "package.json"() {
33318
33318
  package_default = {
33319
33319
  name: "claude-use",
33320
- version: "9.15.0",
33320
+ version: "9.15.1",
33321
33321
  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.",
33322
33322
  license: "MIT",
33323
33323
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -111885,7 +111885,7 @@ function requireJob(paths, name) {
111885
111885
  return job;
111886
111886
  }
111887
111887
  function writeJobs(paths, jobs) {
111888
- applyPatch(paths.globalConfigFile, GlobalConfigSchema, { jobs }, { defaults: {} });
111888
+ applyPatch(paths.globalConfigFile, GlobalConfigSchema, { jobs: Object.keys(jobs).length === 0 ? void 0 : jobs }, { defaults: {} });
111889
111889
  }
111890
111890
  function addJob(paths, name, job) {
111891
111891
  if (!PoolNameSchema.safeParse(name).success) {
@@ -111922,6 +111922,19 @@ init_realAnthropicUsageProbe();
111922
111922
  var import_node_path38 = __toESM(require("node:path"), 1);
111923
111923
  init_conditions();
111924
111924
  init_identityClaude();
111925
+
111926
+ // src/usage/sdkResult.ts
111927
+ function successfulResult(message) {
111928
+ if (message.subtype !== "success") {
111929
+ throw new Error(`the run ended as ${message.subtype}`);
111930
+ }
111931
+ if (message.is_error) {
111932
+ throw new Error(`the run ended on an error: ${message.result}`);
111933
+ }
111934
+ return message.result;
111935
+ }
111936
+
111937
+ // src/usage/realJobRunner.ts
111925
111938
  var JOB_LAUNCH_FLAGS = ["--no-headroom", "--no-remote-control", "--track-usage"];
111926
111939
  var JOB_ISOLATION_OPTIONS = { settingSources: ["user"], mcpServers: {}, strictMcpConfig: true };
111927
111940
  function logEntry(name, identity, endedAt, outcome) {
@@ -111958,10 +111971,7 @@ function createRealJobRunner(params) {
111958
111971
  try {
111959
111972
  for await (const message of session) {
111960
111973
  if (message.type === "result") {
111961
- if (message.subtype !== "success") {
111962
- throw new Error(`the run ended as ${message.subtype}`);
111963
- }
111964
- return message.result;
111974
+ return successfulResult(message);
111965
111975
  }
111966
111976
  }
111967
111977
  throw new Error("the run ended without a result");
@@ -112009,9 +112019,7 @@ function createRealWindowOpener(params) {
112009
112019
  try {
112010
112020
  for await (const message of session) {
112011
112021
  if (message.type === "result") {
112012
- if (message.subtype !== "success") {
112013
- throw new Error(`the opening request ended as ${message.subtype}`);
112014
- }
112022
+ successfulResult(message);
112015
112023
  return;
112016
112024
  }
112017
112025
  }
@@ -112057,6 +112065,7 @@ function writeHandled(fs22, file2, handled) {
112057
112065
 
112058
112066
  // src/usage/jobKeeper.ts
112059
112067
  init_middleware();
112068
+ init_pick();
112060
112069
  init_preflight();
112061
112070
 
112062
112071
  // src/usage/windowKeeper.ts
@@ -112125,6 +112134,10 @@ async function runWindowKeeper(ports) {
112125
112134
  }
112126
112135
 
112127
112136
  // src/usage/jobKeeper.ts
112137
+ var WINDOW_LENGTH_MS = { fiveHour: FIVE_HOUR_WINDOW_MS, sevenDay: SEVEN_DAY_WINDOW_MS };
112138
+ function sameWindowInstance(handledMs, resetsAtMs, window) {
112139
+ return handledMs !== void 0 && Math.abs(handledMs - resetsAtMs) < WINDOW_LENGTH_MS[window] / 2;
112140
+ }
112128
112141
  function pendingReset(snapshot, window, nowMs) {
112129
112142
  const recorded = snapshot?.providers[ANTHROPIC_PROVIDER]?.rateLimit?.unified?.[window];
112130
112143
  return recorded === void 0 ? void 0 : effectiveWindow(recorded, nowMs).resetsAtMs;
@@ -112203,7 +112216,7 @@ function runJobs(ports) {
112203
112216
  outcomes.push({ name, status: "skipped", detail: `${identity} has no ${trigger.beforeReset} window to run before` });
112204
112217
  continue;
112205
112218
  }
112206
- if (resetsAtMs - parseDuration(trigger.lead) > nowMs || handled[name] === resetsAtMs) {
112219
+ if (resetsAtMs - parseDuration(trigger.lead) > nowMs || sameWindowInstance(handled[name], resetsAtMs, trigger.beforeReset)) {
112207
112220
  outcomes.push({ name, status: "waiting", detail: `${trigger.beforeReset} window resets in ${formatAge(resetsAtMs - nowMs)}` });
112208
112221
  continue;
112209
112222
  }
@@ -129251,8 +129264,14 @@ function realFrontDoorSupervisorPorts(paths) {
129251
129264
  const quotaRefresher = createRealQuotaRefresher({ paths, store: usageStore, log });
129252
129265
  const anthropicRefresher = createRealAnthropicUsageRefresher({ paths, store: usageStore, cwd: process.cwd(), spawnDaemon: spawnDetachedSupervisor, log });
129253
129266
  setInterval(() => {
129254
- const pools = readPools(paths);
129255
- void refreshStalePoolMembers({ poolNames: Object.keys(pools), pools, loadMembers: (identities) => loadPoolMembers(realFarmFs, paths, identities, Date.now()), refresher: anthropicRefresher });
129267
+ try {
129268
+ const pools = readPools(paths);
129269
+ refreshStalePoolMembers({ poolNames: Object.keys(pools), pools, loadMembers: (identities) => loadPoolMembers(realFarmFs, paths, identities, Date.now()), refresher: anthropicRefresher }).catch((error63) => {
129270
+ log(`pool usage refresh failed: ${error63 instanceof Error ? error63.message : String(error63)}`);
129271
+ });
129272
+ } catch (error63) {
129273
+ log(`pool usage refresh failed: ${error63 instanceof Error ? error63.message : String(error63)}`);
129274
+ }
129256
129275
  }, ANTHROPIC_USAGE_FRESHNESS_MS).unref();
129257
129276
  const windowOpener = createRealWindowOpener({ paths, cwd: process.cwd(), spawnDaemon: spawnDetachedSupervisor });
129258
129277
  let keeperRunning = false;
package/dist/index.cjs CHANGED
@@ -2693,7 +2693,7 @@ var init_package = __esm({
2693
2693
  "package.json"() {
2694
2694
  package_default = {
2695
2695
  name: "claude-use",
2696
- version: "9.15.0",
2696
+ version: "9.15.1",
2697
2697
  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.",
2698
2698
  license: "MIT",
2699
2699
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -2669,7 +2669,7 @@ var init_package = __esm({
2669
2669
  "package.json"() {
2670
2670
  package_default = {
2671
2671
  name: "claude-use",
2672
- version: "9.15.0",
2672
+ version: "9.15.1",
2673
2673
  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.",
2674
2674
  license: "MIT",
2675
2675
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -1332,8 +1332,8 @@ declare const HeadroomGlobalConfigSchema: z.ZodObject<{
1332
1332
  targetRatio: z.ZodOptional<z.ZodNumber>;
1333
1333
  ccr: z.ZodOptional<z.ZodEnum<{
1334
1334
  default: "default";
1335
- lossless: "lossless";
1336
1335
  none: "none";
1336
+ lossless: "lossless";
1337
1337
  }>>;
1338
1338
  rolloutChannel: z.ZodOptional<z.ZodEnum<{
1339
1339
  beta: "beta";
@@ -1460,8 +1460,8 @@ declare const GlobalConfigSchema: z.ZodObject<{
1460
1460
  targetRatio: z.ZodOptional<z.ZodNumber>;
1461
1461
  ccr: z.ZodOptional<z.ZodEnum<{
1462
1462
  default: "default";
1463
- lossless: "lossless";
1464
1463
  none: "none";
1464
+ lossless: "lossless";
1465
1465
  }>>;
1466
1466
  rolloutChannel: z.ZodOptional<z.ZodEnum<{
1467
1467
  beta: "beta";
@@ -3911,12 +3911,12 @@ declare const CheckReportJsonSchema: z.ZodObject<{
3911
3911
  identity: z.ZodObject<{
3912
3912
  name: z.ZodNullable<z.ZodString>;
3913
3913
  source: z.ZodEnum<{
3914
- env: "env";
3915
- none: "none";
3916
3914
  "config-dir-escape-hatch": "config-dir-escape-hatch";
3917
3915
  argv: "argv";
3916
+ env: "env";
3918
3917
  "directory-pin": "directory-pin";
3919
3918
  "active-identity-file": "active-identity-file";
3919
+ none: "none";
3920
3920
  }>;
3921
3921
  }, z.core.$strict>;
3922
3922
  pool: z.ZodOptional<z.ZodObject<{
@@ -3994,11 +3994,11 @@ declare const CheckReportJsonSchema: z.ZodObject<{
3994
3994
  "category-default": "category-default";
3995
3995
  }>;
3996
3996
  category: z.ZodNullable<z.ZodEnum<{
3997
+ secret: "secret";
3997
3998
  runtime: "runtime";
3998
3999
  history: "history";
3999
4000
  knowledge: "knowledge";
4000
4001
  settings: "settings";
4001
- secret: "secret";
4002
4002
  }>>;
4003
4003
  rule: z.ZodOptional<z.ZodObject<{
4004
4004
  key: z.ZodString;
@@ -6567,9 +6567,9 @@ declare function createLifecycleApiRouter(deps: LifecycleApiDeps): {
6567
6567
  current: zod.ZodString;
6568
6568
  latest: zod.ZodString;
6569
6569
  action: zod.ZodEnum<{
6570
- updated: "updated";
6571
6570
  current: "current";
6572
6571
  available: "available";
6572
+ updated: "updated";
6573
6573
  }>;
6574
6574
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6575
6575
  };
@@ -6816,12 +6816,12 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
6816
6816
  decision: zod.ZodObject<{
6817
6817
  identity: zod.ZodOptional<zod.ZodString>;
6818
6818
  identitySource: zod.ZodEnum<{
6819
- env: "env";
6820
- none: "none";
6821
6819
  "config-dir-escape-hatch": "config-dir-escape-hatch";
6822
6820
  argv: "argv";
6821
+ env: "env";
6823
6822
  "directory-pin": "directory-pin";
6824
6823
  "active-identity-file": "active-identity-file";
6824
+ none: "none";
6825
6825
  }>;
6826
6826
  pool: zod.ZodOptional<zod.ZodObject<{
6827
6827
  name: zod.ZodString;
@@ -7207,12 +7207,12 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7207
7207
  identity: zod.ZodObject<{
7208
7208
  name: zod.ZodNullable<zod.ZodString>;
7209
7209
  source: zod.ZodEnum<{
7210
- env: "env";
7211
- none: "none";
7212
7210
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7213
7211
  argv: "argv";
7212
+ env: "env";
7214
7213
  "directory-pin": "directory-pin";
7215
7214
  "active-identity-file": "active-identity-file";
7215
+ none: "none";
7216
7216
  }>;
7217
7217
  }, zod_v4_core.$strict>;
7218
7218
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -7290,11 +7290,11 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7290
7290
  "category-default": "category-default";
7291
7291
  }>;
7292
7292
  category: zod.ZodNullable<zod.ZodEnum<{
7293
+ secret: "secret";
7293
7294
  runtime: "runtime";
7294
7295
  history: "history";
7295
7296
  knowledge: "knowledge";
7296
7297
  settings: "settings";
7297
- secret: "secret";
7298
7298
  }>>;
7299
7299
  rule: zod.ZodOptional<zod.ZodObject<{
7300
7300
  key: zod.ZodString;
@@ -7513,11 +7513,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7513
7513
  "global-config": "global-config";
7514
7514
  "config-profile": "config-profile";
7515
7515
  identity: "identity";
7516
- keychain: "keychain";
7517
7516
  provider: "provider";
7518
- headroom: "headroom";
7519
7517
  frontdoor: "frontdoor";
7520
7518
  pool: "pool";
7519
+ keychain: "keychain";
7521
7520
  "ambient-credential": "ambient-credential";
7522
7521
  "binary-discovery": "binary-discovery";
7523
7522
  "claude-shim": "claude-shim";
@@ -7527,6 +7526,7 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7527
7526
  "directory-rules": "directory-rules";
7528
7527
  "categories-local": "categories-local";
7529
7528
  "active-identity": "active-identity";
7529
+ headroom: "headroom";
7530
7530
  }>;
7531
7531
  subject: zod.ZodOptional<zod.ZodString>;
7532
7532
  severity: zod.ZodEnum<{
@@ -7647,12 +7647,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
7647
7647
  decision: zod.ZodObject<{
7648
7648
  identity: zod.ZodOptional<zod.ZodString>;
7649
7649
  identitySource: zod.ZodEnum<{
7650
- env: "env";
7651
- none: "none";
7652
7650
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7653
7651
  argv: "argv";
7652
+ env: "env";
7654
7653
  "directory-pin": "directory-pin";
7655
7654
  "active-identity-file": "active-identity-file";
7655
+ none: "none";
7656
7656
  }>;
7657
7657
  pool: zod.ZodOptional<zod.ZodObject<{
7658
7658
  name: zod.ZodString;
@@ -9028,9 +9028,9 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9028
9028
  current: zod.ZodString;
9029
9029
  latest: zod.ZodString;
9030
9030
  action: zod.ZodEnum<{
9031
- updated: "updated";
9032
9031
  current: "current";
9033
9032
  available: "available";
9033
+ updated: "updated";
9034
9034
  }>;
9035
9035
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
9036
9036
  };
@@ -9229,12 +9229,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9229
9229
  identity: zod.ZodObject<{
9230
9230
  name: zod.ZodNullable<zod.ZodString>;
9231
9231
  source: zod.ZodEnum<{
9232
- env: "env";
9233
- none: "none";
9234
9232
  "config-dir-escape-hatch": "config-dir-escape-hatch";
9235
9233
  argv: "argv";
9234
+ env: "env";
9236
9235
  "directory-pin": "directory-pin";
9237
9236
  "active-identity-file": "active-identity-file";
9237
+ none: "none";
9238
9238
  }>;
9239
9239
  }, zod_v4_core.$strict>;
9240
9240
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -9312,11 +9312,11 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9312
9312
  "category-default": "category-default";
9313
9313
  }>;
9314
9314
  category: zod.ZodNullable<zod.ZodEnum<{
9315
+ secret: "secret";
9315
9316
  runtime: "runtime";
9316
9317
  history: "history";
9317
9318
  knowledge: "knowledge";
9318
9319
  settings: "settings";
9319
- secret: "secret";
9320
9320
  }>>;
9321
9321
  rule: zod.ZodOptional<zod.ZodObject<{
9322
9322
  key: zod.ZodString;
@@ -9535,11 +9535,10 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9535
9535
  "global-config": "global-config";
9536
9536
  "config-profile": "config-profile";
9537
9537
  identity: "identity";
9538
- keychain: "keychain";
9539
9538
  provider: "provider";
9540
- headroom: "headroom";
9541
9539
  frontdoor: "frontdoor";
9542
9540
  pool: "pool";
9541
+ keychain: "keychain";
9543
9542
  "ambient-credential": "ambient-credential";
9544
9543
  "binary-discovery": "binary-discovery";
9545
9544
  "claude-shim": "claude-shim";
@@ -9549,6 +9548,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9549
9548
  "directory-rules": "directory-rules";
9550
9549
  "categories-local": "categories-local";
9551
9550
  "active-identity": "active-identity";
9551
+ headroom: "headroom";
9552
9552
  }>;
9553
9553
  subject: zod.ZodOptional<zod.ZodString>;
9554
9554
  severity: zod.ZodEnum<{
@@ -11381,11 +11381,10 @@ declare const DoctorFindingSchema: z.ZodObject<{
11381
11381
  "global-config": "global-config";
11382
11382
  "config-profile": "config-profile";
11383
11383
  identity: "identity";
11384
- keychain: "keychain";
11385
11384
  provider: "provider";
11386
- headroom: "headroom";
11387
11385
  frontdoor: "frontdoor";
11388
11386
  pool: "pool";
11387
+ keychain: "keychain";
11389
11388
  "ambient-credential": "ambient-credential";
11390
11389
  "binary-discovery": "binary-discovery";
11391
11390
  "claude-shim": "claude-shim";
@@ -11395,6 +11394,7 @@ declare const DoctorFindingSchema: z.ZodObject<{
11395
11394
  "directory-rules": "directory-rules";
11396
11395
  "categories-local": "categories-local";
11397
11396
  "active-identity": "active-identity";
11397
+ headroom: "headroom";
11398
11398
  }>;
11399
11399
  subject: z.ZodOptional<z.ZodString>;
11400
11400
  severity: z.ZodEnum<{
@@ -11412,11 +11412,10 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
11412
11412
  "global-config": "global-config";
11413
11413
  "config-profile": "config-profile";
11414
11414
  identity: "identity";
11415
- keychain: "keychain";
11416
11415
  provider: "provider";
11417
- headroom: "headroom";
11418
11416
  frontdoor: "frontdoor";
11419
11417
  pool: "pool";
11418
+ keychain: "keychain";
11420
11419
  "ambient-credential": "ambient-credential";
11421
11420
  "binary-discovery": "binary-discovery";
11422
11421
  "claude-shim": "claude-shim";
@@ -11426,6 +11425,7 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
11426
11425
  "directory-rules": "directory-rules";
11427
11426
  "categories-local": "categories-local";
11428
11427
  "active-identity": "active-identity";
11428
+ headroom: "headroom";
11429
11429
  }>;
11430
11430
  subject: z.ZodOptional<z.ZodString>;
11431
11431
  severity: z.ZodEnum<{
@@ -11446,9 +11446,9 @@ declare const UpdateCheckOutputSchema: z.ZodObject<{
11446
11446
  current: z.ZodString;
11447
11447
  latest: z.ZodString;
11448
11448
  action: z.ZodEnum<{
11449
- updated: "updated";
11450
11449
  current: "current";
11451
11450
  available: "available";
11451
+ updated: "updated";
11452
11452
  }>;
11453
11453
  }, z.core.$strict>;
11454
11454
  /** 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. */
@@ -11498,12 +11498,12 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
11498
11498
  decision: z.ZodObject<{
11499
11499
  identity: z.ZodOptional<z.ZodString>;
11500
11500
  identitySource: z.ZodEnum<{
11501
- env: "env";
11502
- none: "none";
11503
11501
  "config-dir-escape-hatch": "config-dir-escape-hatch";
11504
11502
  argv: "argv";
11503
+ env: "env";
11505
11504
  "directory-pin": "directory-pin";
11506
11505
  "active-identity-file": "active-identity-file";
11506
+ none: "none";
11507
11507
  }>;
11508
11508
  pool: z.ZodOptional<z.ZodObject<{
11509
11509
  name: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "9.15.0",
3
+ "version": "9.15.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>",